blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
390
content_id
stringlengths
40
40
detected_licenses
listlengths
0
35
license_type
stringclasses
2 values
repo_name
stringlengths
6
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
539 values
visit_date
timestamp[us]date
2016-08-02 21:09:20
2023-09-06 10:10:07
revision_date
timestamp[us]date
1990-01-30 01:55:47
2023-09-05 21:45:37
committer_date
timestamp[us]date
2003-07-12 18:48:29
2023-09-05 21:45:37
github_id
int64
7.28k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
13 values
gha_event_created_at
timestamp[us]date
2012-06-11 04:05:37
2023-09-14 21:59:18
gha_created_at
timestamp[us]date
2008-05-22 07:58:19
2023-08-28 02:39:21
gha_language
stringclasses
62 values
src_encoding
stringclasses
26 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
128
12.8k
extension
stringclasses
11 values
content
stringlengths
128
8.19k
authors
listlengths
1
1
author_id
stringlengths
1
79
818d43fae4518638de789e1b6cab00d6b54df8e5
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/8/8_b972bb364832a4ee6f3ed34a63a088f50a459314/DefaultAbstractRepository/8_b972bb364832a4ee6f3ed34a63a088f50a459314_DefaultAbstractRepository_t.java
a5a6356c1afbcec12de1700556bf52693152cfa7
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
4,142
java
package com.aciertoteam.common.repository.impl; import com.aciertoteam.common.interfaces.IAbstractEntity; import com.aciertoteam.common.repository.AbstractRepository; import org.hibernate.Criteria; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.criterion.Projections; import org.hibernate.criterion.Restrictions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; import java.lang.reflect.ParameterizedType; import java.util.Collection; import java.util.HashSet; import java.util.List; import java.util.Set; /** * @param <T> IAbstractEntity * @author Bogdan Nechyporenko */ @SuppressWarnings("unchecked") public abstract class DefaultAbstractRepository<T extends IAbstractEntity> implements AbstractRepository<T> { @Autowired private SessionFactory sessionFactory; @Override @Transactional(readOnly = true) public List<T> getAll() { return getSession().createQuery("from " + getClazz().getSimpleName()).list(); } @Override @Transactional(readOnly = true) public T get(Long id) { return (T) getSession().createCriteria(getClazz()).add(Restrictions.eq("id", id)).uniqueResult(); } @Override public void saveAll(Collection<T> coll) { for (T t : coll) { save(t); } } @Override public T save(T t) { getSession().save(t); return t; } @Override public T findByField(String fieldName, Object value) { Criteria criteria = getSession().createCriteria(getClazz()); return (T) criteria.add(Restrictions.like(fieldName, value)).uniqueResult(); } @Override public Collection<T> findCollectionByField(String fieldName, Object value) { Criteria criteria = getSession().createCriteria(getClazz()); return criteria.add(Restrictions.like(fieldName, value)).list(); } @Override public T saveOrUpdate(T t) { t.check(); getSession().saveOrUpdate(t); return t; } @Override public void markAsDeleted(Long id) { T t = get(id); t.closeEndPeriod(); saveOrUpdate(t); } @Override public void markAsDeleted(List<T> entities) { for (T t : entities) { t.closeEndPeriod(); saveOrUpdate(t); } } @Override public void markAsDeleted(T entity) { entity.closeEndPeriod(); saveOrUpdate(entity); } @Override public void delete(Long id) { getSession().delete(get(id)); } @Override public void delete(List<T> entities) { for (T entity : entities) { delete(entity); } } @Override public void delete(T entity) { getSession().delete(entity); } @Override public void deleteAll() { getSession().createQuery("delete from " + getClazz().getSimpleName()).executeUpdate(); } @Override public List<T> getList(List<Long> ids) { return getSession().createCriteria(getClazz()).add(Restrictions.in("id", ids)).list(); } @Override public Set<T> getSet(List<Long> ids) { return new HashSet<T>(getList(ids)); } @Override public long count() { return Long.valueOf(String.valueOf(getSession().createCriteria(getClazz()) .setProjection(Projections.rowCount()).uniqueResult())); } @Override public boolean isEmpty() { return count() == 0; } public Class getClazz() { ParameterizedType superClass = (ParameterizedType) this.getClass().getGenericSuperclass(); return (Class) superClass.getActualTypeArguments()[0]; } protected final Session getSession() { return sessionFactory.getCurrentSession(); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
07a497d5baa6741de9489544f084756d8685d08a
9950d7d77822aa9bf175f24e5fde7e74f468145e
/src/com/ceco/marshmallow/gravitybox/quicksettings/AirplaneModeTile.java
65c71c62f685a89e82ef7a42cbaf263bdce4c56a
[ "Apache-2.0" ]
permissive
pylerCM/GravityBox
1b4c00ce814490f439006a6dc96c804d62e03aaa
b376f3a4d0f8329a4c9411a52e1bc41850bb87b6
refs/heads/marshmallow
2020-02-26T16:22:17.940694
2016-03-03T16:46:52
2016-03-03T16:46:52
53,075,135
1
1
null
2016-03-03T18:57:09
2016-03-03T18:57:09
null
UTF-8
Java
false
false
872
java
package com.ceco.marshmallow.gravitybox.quicksettings; import android.provider.Settings; import de.robv.android.xposed.XSharedPreferences; public class AirplaneModeTile extends AospTile { public static final String AOSP_KEY = "airplane"; protected AirplaneModeTile(Object host, Object tile, XSharedPreferences prefs, QsTileEventDistributor eventDistributor) throws Throwable { super(host, "aosp_tile_airplane_mode", tile, prefs, eventDistributor); } @Override protected String getClassName() { return "com.android.systemui.qs.tiles.AirplaneModeTile"; } @Override public String getAospKey() { return AOSP_KEY; } @Override public boolean handleLongClick() { startSettingsActivity(Settings.ACTION_AIRPLANE_MODE_SETTINGS); return true; } }
[ "ceco@ceco.sk.eu.org" ]
ceco@ceco.sk.eu.org
09c120bf2f2b4dc5ae91a67a2382e5e161ba67fa
a78e998b0cb3c096a6d904982bb449da4003ff8b
/app/src/main/java/com/alipay/api/domain/SimpleShopModel.java
eee9e42a87f886f084b04a8035b4684f43c20780
[ "Apache-2.0" ]
permissive
Zhengfating/F2FDemo
4b85b598989376b3794eefb228dfda48502ca1b2
8654411f4269472e727e2230e768051162a6b672
refs/heads/master
2020-05-03T08:30:29.641080
2019-03-30T07:50:30
2019-03-30T07:50:30
178,528,073
0
0
null
null
null
null
UTF-8
Java
false
false
826
java
package com.alipay.api.domain; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; /** * 口碑商家中心员工管理的商户门店信息简单模型,包括门店id,门店名称 * * @author auto create * @since 1.0, 2018-03-23 11:31:55 */ public class SimpleShopModel extends AlipayObject { private static final long serialVersionUID = 5629169737341358393L; /** * 商户门店id */ @ApiField("shop_id") private String shopId; /** * 商户门店名称 */ @ApiField("shop_name") private String shopName; public String getShopId() { return this.shopId; } public void setShopId(String shopId) { this.shopId = shopId; } public String getShopName() { return this.shopName; } public void setShopName(String shopName) { this.shopName = shopName; } }
[ "452139060@qq.com" ]
452139060@qq.com
14a9bb37a724533bbd6936721211fe28fd3d27b4
1ca86d5d065372093c5f2eae3b1a146dc0ba4725
/quarkus/src/main/java/com/surya/quarkus/LibraryResource.java
21e55dab8a1bb5d2dc0c60b30a11dde9bf85f2b9
[]
no_license
Suryakanta97/DemoExample
1e05d7f13a9bc30f581a69ce811fc4c6c97f2a6e
5c6b831948e612bdc2d9d578a581df964ef89bfb
refs/heads/main
2023-08-10T17:30:32.397265
2021-09-22T16:18:42
2021-09-22T16:18:42
391,087,435
0
1
null
null
null
null
UTF-8
Java
false
false
545
java
package com.surya.quarkus; import com.surya.quarkus.model.Book; import com.surya.quarkus.service.LibraryService; import javax.inject.Inject; import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import java.util.Set; @Path("/library") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public class LibraryResource { @Inject LibraryService libraryService; @GET @Path("/book") public Set<Book> findBooks(@QueryParam("query") String query) { return libraryService.find(query); } }
[ "suryakanta97@github.com" ]
suryakanta97@github.com
f7aaad943dbf895feb4c78f233f0c9caafa59699
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Lang/23/org/apache/commons/lang3/builder/ToStringBuilder_append_910.java
75f0a199883e4ec44fcea46dd67602aaf6ce25f8
[]
no_license
hvdthong/NetML
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
9bb103da21327912e5a29cbf9be9ff4d058731a5
refs/heads/master
2021-06-30T15:03:52.618255
2020-10-07T01:58:48
2020-10-07T01:58:48
150,383,588
1
1
null
2018-09-26T07:08:45
2018-09-26T07:08:44
null
UTF-8
Java
false
false
2,579
java
org apach common lang3 builder assist implement link object string tostr method enabl good consist code string tostr code built object aim simplifi process allow field name handl type consist handl null consist output arrai multi dimension arrai enabl detail level control object collect handl hierarchi write code pre person string ag smoker string string tostr string builder tostringbuild append append ag ag append smoker smoker string tostr pre produc string tostr format code person 7f54 stephen ag smoker code add superclass code string tostr code link append super appendsup append code string tostr code object deleg object link append string appendtostr altern method reflect determin field test field method code reflect string reflectiontostr code code access object accessibleobject set access setaccess code chang visibl field fail secur manag permiss set correctli slower test explicitli typic invoc method pre string string tostr string builder tostringbuild reflect string reflectiontostr pre builder debug 3rd parti object pre system println object string builder tostringbuild reflect string reflectiontostr object anobject pre exact format code string tostr code determin link string style tostringstyl pass constructor author apach softwar foundat author gari gregori author pete gieser version string builder tostringbuild builder string append code string tostr code code code param field fieldnam field param add code string tostr code string builder tostringbuild append string field fieldnam style append buffer field fieldnam
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
844cb9d41cd799be94fb641974a87c3aeecfb43e
187ccbd587dc6b946a4845d3fff353aa6838f6f1
/src/main/java/statemachine/seatheater/SeatHeaterState.java
67319f19b4bcf486241b5227bc8dc4d4327fd37c
[]
no_license
lippaitamas1021/training
dd1b52db60804ffeb1699254869393ffc7fa6e24
1f3f28d0286eff6798368b5c2a68b650046c3be1
refs/heads/master
2023-04-07T13:56:35.191872
2021-04-21T09:04:52
2021-04-21T09:04:52
345,300,131
0
0
null
null
null
null
UTF-8
Java
false
false
349
java
package statemachine.seatheater; public enum SeatHeaterState { ONE { public SeatHeaterState next() { return OFF; }}, TWO { public SeatHeaterState next() { return ONE; }}, THREE { public SeatHeaterState next() { return TWO; }}, OFF { public SeatHeaterState next() { return THREE; }}; public abstract SeatHeaterState next(); }
[ "lippaitamas1021@gmail.com" ]
lippaitamas1021@gmail.com
e8a78aa079ef5cffe9ed6778c618f3eb41c421ef
5ec06dab1409d790496ce082dacb321392b32fe9
/clients/java-play-framework/generated/app/apimodels/ComAdobeFormsCommonServletTempCleanUpTaskProperties.java
cc129c20961713f939bd31a0be3c99154571ee88
[ "Apache-2.0" ]
permissive
shinesolutions/swagger-aem-osgi
e9d2385f44bee70e5bbdc0d577e99a9f2525266f
c2f6e076971d2592c1cbd3f70695c679e807396b
refs/heads/master
2022-10-29T13:07:40.422092
2021-04-09T07:46:03
2021-04-09T07:46:03
190,217,155
3
3
Apache-2.0
2022-10-05T03:26:20
2019-06-04T14:23:28
null
UTF-8
Java
false
false
4,459
java
package apimodels; import apimodels.ConfigNodePropertyString; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; import java.util.Objects; import javax.validation.constraints.*; /** * ComAdobeFormsCommonServletTempCleanUpTaskProperties */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaPlayFrameworkCodegen", date = "2019-08-05T00:55:42.601Z[GMT]") @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ComAdobeFormsCommonServletTempCleanUpTaskProperties { @JsonProperty("scheduler.expression") private ConfigNodePropertyString schedulerExpression = null; @JsonProperty("Duration for Temporary Storage") private ConfigNodePropertyString durationForTemporaryStorage = null; @JsonProperty("Duration for Anonymous Storage") private ConfigNodePropertyString durationForAnonymousStorage = null; public ComAdobeFormsCommonServletTempCleanUpTaskProperties schedulerExpression(ConfigNodePropertyString schedulerExpression) { this.schedulerExpression = schedulerExpression; return this; } /** * Get schedulerExpression * @return schedulerExpression **/ @Valid public ConfigNodePropertyString getSchedulerExpression() { return schedulerExpression; } public void setSchedulerExpression(ConfigNodePropertyString schedulerExpression) { this.schedulerExpression = schedulerExpression; } public ComAdobeFormsCommonServletTempCleanUpTaskProperties durationForTemporaryStorage(ConfigNodePropertyString durationForTemporaryStorage) { this.durationForTemporaryStorage = durationForTemporaryStorage; return this; } /** * Get durationForTemporaryStorage * @return durationForTemporaryStorage **/ @Valid public ConfigNodePropertyString getDurationForTemporaryStorage() { return durationForTemporaryStorage; } public void setDurationForTemporaryStorage(ConfigNodePropertyString durationForTemporaryStorage) { this.durationForTemporaryStorage = durationForTemporaryStorage; } public ComAdobeFormsCommonServletTempCleanUpTaskProperties durationForAnonymousStorage(ConfigNodePropertyString durationForAnonymousStorage) { this.durationForAnonymousStorage = durationForAnonymousStorage; return this; } /** * Get durationForAnonymousStorage * @return durationForAnonymousStorage **/ @Valid public ConfigNodePropertyString getDurationForAnonymousStorage() { return durationForAnonymousStorage; } public void setDurationForAnonymousStorage(ConfigNodePropertyString durationForAnonymousStorage) { this.durationForAnonymousStorage = durationForAnonymousStorage; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ComAdobeFormsCommonServletTempCleanUpTaskProperties comAdobeFormsCommonServletTempCleanUpTaskProperties = (ComAdobeFormsCommonServletTempCleanUpTaskProperties) o; return Objects.equals(schedulerExpression, comAdobeFormsCommonServletTempCleanUpTaskProperties.schedulerExpression) && Objects.equals(durationForTemporaryStorage, comAdobeFormsCommonServletTempCleanUpTaskProperties.durationForTemporaryStorage) && Objects.equals(durationForAnonymousStorage, comAdobeFormsCommonServletTempCleanUpTaskProperties.durationForAnonymousStorage); } @Override public int hashCode() { return Objects.hash(schedulerExpression, durationForTemporaryStorage, durationForAnonymousStorage); } @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ComAdobeFormsCommonServletTempCleanUpTaskProperties {\n"); sb.append(" schedulerExpression: ").append(toIndentedString(schedulerExpression)).append("\n"); sb.append(" durationForTemporaryStorage: ").append(toIndentedString(durationForTemporaryStorage)).append("\n"); sb.append(" durationForAnonymousStorage: ").append(toIndentedString(durationForAnonymousStorage)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
[ "cliffano@gmail.com" ]
cliffano@gmail.com
880f15258b27bce2738f6ab28aced274e9898301
5a0bfac7ad00c079fe8e0bdf1482f4271c46eeab
/app/src/main/wechat6.5.3/com/tencent/mm/protocal/c/aft.java
b450a5e31ef8c55db90c2b112f9a4ced748bdfb1
[]
no_license
newtonker/wechat6.5.3
8af53a870a752bb9e3c92ec92a63c1252cb81c10
637a69732afa3a936afc9f4679994b79a9222680
refs/heads/master
2020-04-16T03:32:32.230996
2017-06-15T09:54:10
2017-06-15T09:54:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,386
java
package com.tencent.mm.protocal.c; import com.tencent.mm.ba.a; import java.util.LinkedList; public final class aft extends a { public String aXz; public int efm; public String hHb; public float mFC; public int mFD; public LinkedList<Integer> mFE = new LinkedList(); public int mFF; public LinkedList<arf> mFG = new LinkedList(); public float mFH; public String mFI; public are mFJ; protected final int a(int i, Object... objArr) { if (i == 0) { a.a.a.c.a aVar = (a.a.a.c.a) objArr[0]; if (this.hHb != null) { aVar.e(1, this.hHb); } if (this.aXz != null) { aVar.e(2, this.aXz); } aVar.j(3, this.mFC); aVar.dV(4, this.mFD); aVar.c(5, this.mFE); aVar.dV(6, this.mFF); aVar.d(7, 8, this.mFG); aVar.j(8, this.mFH); if (this.mFI != null) { aVar.e(9, this.mFI); } aVar.dV(10, this.efm); if (this.mFJ == null) { return 0; } aVar.dX(11, this.mFJ.aHr()); this.mFJ.a(aVar); return 0; } else if (i == 1) { if (this.hHb != null) { r0 = a.a.a.b.b.a.f(1, this.hHb) + 0; } else { r0 = 0; } if (this.aXz != null) { r0 += a.a.a.b.b.a.f(2, this.aXz); } r0 = (((((r0 + (a.a.a.b.b.a.cw(3) + 4)) + a.a.a.a.dS(4, this.mFD)) + a.a.a.a.b(5, this.mFE)) + a.a.a.a.dS(6, this.mFF)) + a.a.a.a.c(7, 8, this.mFG)) + (a.a.a.b.b.a.cw(8) + 4); if (this.mFI != null) { r0 += a.a.a.b.b.a.f(9, this.mFI); } r0 += a.a.a.a.dS(10, this.efm); if (this.mFJ != null) { r0 += a.a.a.a.dU(11, this.mFJ.aHr()); } return r0; } else if (i == 2) { r0 = (byte[]) objArr[0]; this.mFE.clear(); this.mFG.clear(); a.a.a.a.a aVar2 = new a.a.a.a.a(r0, unknownTagHandler); for (r0 = a.a(aVar2); r0 > 0; r0 = a.a(aVar2)) { if (!super.a(aVar2, this, r0)) { aVar2.bQL(); } } return 0; } else if (i != 3) { return -1; } else { a.a.a.a.a aVar3 = (a.a.a.a.a) objArr[0]; aft com_tencent_mm_protocal_c_aft = (aft) objArr[1]; int intValue = ((Integer) objArr[2]).intValue(); LinkedList zQ; int size; a.a.a.a.a aVar4; boolean z; switch (intValue) { case 1: com_tencent_mm_protocal_c_aft.hHb = aVar3.pMj.readString(); return 0; case 2: com_tencent_mm_protocal_c_aft.aXz = aVar3.pMj.readString(); return 0; case 3: com_tencent_mm_protocal_c_aft.mFC = aVar3.pMj.readFloat(); return 0; case 4: com_tencent_mm_protocal_c_aft.mFD = aVar3.pMj.mH(); return 0; case 5: com_tencent_mm_protocal_c_aft.mFE = new a.a.a.a.a(aVar3.bQK().lVU, unknownTagHandler).bQH(); return 0; case 6: com_tencent_mm_protocal_c_aft.mFF = aVar3.pMj.mH(); return 0; case 7: zQ = aVar3.zQ(intValue); size = zQ.size(); for (intValue = 0; intValue < size; intValue++) { r0 = (byte[]) zQ.get(intValue); arf com_tencent_mm_protocal_c_arf = new arf(); aVar4 = new a.a.a.a.a(r0, unknownTagHandler); for (z = true; z; z = com_tencent_mm_protocal_c_arf.a(aVar4, com_tencent_mm_protocal_c_arf, a.a(aVar4))) { } com_tencent_mm_protocal_c_aft.mFG.add(com_tencent_mm_protocal_c_arf); } return 0; case 8: com_tencent_mm_protocal_c_aft.mFH = aVar3.pMj.readFloat(); return 0; case 9: com_tencent_mm_protocal_c_aft.mFI = aVar3.pMj.readString(); return 0; case 10: com_tencent_mm_protocal_c_aft.efm = aVar3.pMj.mH(); return 0; case 11: zQ = aVar3.zQ(intValue); size = zQ.size(); for (intValue = 0; intValue < size; intValue++) { r0 = (byte[]) zQ.get(intValue); are com_tencent_mm_protocal_c_are = new are(); aVar4 = new a.a.a.a.a(r0, unknownTagHandler); for (z = true; z; z = com_tencent_mm_protocal_c_are.a(aVar4, com_tencent_mm_protocal_c_are, a.a(aVar4))) { } com_tencent_mm_protocal_c_aft.mFJ = com_tencent_mm_protocal_c_are; } return 0; default: return -1; } } } }
[ "zhangxhbeta@gmail.com" ]
zhangxhbeta@gmail.com
8aaa9526c7e48efe8afd105df6e631ecdb602db6
61602d4b976db2084059453edeafe63865f96ec5
/com/android/volley/h.java
13e09292ba43d6e8f7b82b68e3c95dd9efb214ca
[]
no_license
ZoranLi/thunder
9d18fd0a0ec0a5bb3b3f920f9413c1ace2beb4d0
0778679ef03ba1103b1d9d9a626c8449b19be14b
refs/heads/master
2020-03-20T23:29:27.131636
2018-06-19T06:43:26
2018-06-19T06:43:26
137,848,886
12
1
null
null
null
null
UTF-8
Java
false
false
129
java
package com.android.volley; /* compiled from: Network */ public interface h { j a(Request<?> request) throws VolleyError; }
[ "lizhangliao@xiaohongchun.com" ]
lizhangliao@xiaohongchun.com
2dab6610470b87c600171dd1ff30cc4dbabb854a
1b949586c8feb0fb5230382fa8501850893950b1
/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/email/ScheduledEmailConstants.java
359b3401174ef8ed807dfc45869f4d4f47ca00d9
[ "MIT", "BSD-3-Clause", "Apache-2.0", "LGPL-2.0-or-later", "LicenseRef-scancode-public-domain", "CDDL-1.1", "LicenseRef-scancode-free-unknown", "EPL-1.0", "Classpath-exception-2.0", "GPL-2.0-only" ]
permissive
cjxonix/fineractapp
44d3a66cf9eddc99bfa3d8f5697797bc855f8e46
b711fb2d142f5f7ecc39448fa868cc0542084328
refs/heads/master
2022-06-19T11:52:56.167338
2020-04-06T05:37:37
2020-04-06T05:37:37
253,395,889
0
0
Apache-2.0
2022-06-03T02:18:38
2020-04-06T04:39:14
Java
UTF-8
Java
false
false
5,268
java
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.fineract.infrastructure.campaigns.email; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.Set; public class ScheduledEmailConstants { // define the API resource entity name public static final String SCHEDULED_EMAIL_ENTITY_NAME = "SCHEDULEDEMAIL"; // general API resource request parameter constants public static final String LOCALE_PARAM_NAME = "locale"; public static final String DATE_FORMAT_PARAM_NAME = "dateFormat"; // parameter constants for create/update entity API request public static final String NAME_PARAM_NAME = "name"; public static final String DESCRIPTION_PARAM_NAME = "description"; public static final String START_DATE_TIME_PARAM_NAME = "startDateTime"; public static final String RECURRENCE_PARAM_NAME = "recurrence"; public static final String EMAIL_RECIPIENTS_PARAM_NAME = "emailRecipients"; public static final String EMAIL_SUBJECT_PARAM_NAME = "emailSubject"; public static final String EMAIL_MESSAGE_PARAM_NAME = "emailMessage"; public static final String EMAIL_ATTACHMENT_FILE_FORMAT_ID_PARAM_NAME = "emailAttachmentFileFormatId"; public static final String STRETCHY_REPORT_ID_PARAM_NAME = "stretchyReportId"; public static final String STRETCHY_REPORT_PARAM_MAP_PARAM_NAME = "stretchyReportParamMap"; public static final String IS_ACTIVE_PARAM_NAME = "isActive"; // other parameter constants public static final String ID_PARAM_NAME = "id"; public static final String EMAIL_ATTACHMENT_FILE_FORMAT_PARAM_NAME = "emailAttachmentFileFormat"; public static final String PREVIOUS_RUN_DATE_TIME_PARAM_NAME = "previousRunDateTime"; public static final String NEXT_RUN_DATE_TIME_PARAM_NAME = "nextRunDateTime"; public static final String PREVIOUS_RUN_STATUS = "previousRunStatus"; public static final String PREVIOUS_RUN_ERROR_LOG = "previousRunErrorLog"; public static final String PREVIOUS_RUN_ERROR_MESSAGE = "previousRunErrorMessage"; public static final String NUMBER_OF_RUNS = "numberOfRuns"; public static final String STRETCHY_REPORT_PARAM_NAME = "stretchyReport"; // list of permitted parameters for the create report mailing job request public static final Set<String> CREATE_REQUEST_PARAMETERS = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(LOCALE_PARAM_NAME, DATE_FORMAT_PARAM_NAME, NAME_PARAM_NAME, DESCRIPTION_PARAM_NAME, RECURRENCE_PARAM_NAME, EMAIL_RECIPIENTS_PARAM_NAME, EMAIL_SUBJECT_PARAM_NAME, EMAIL_MESSAGE_PARAM_NAME, EMAIL_ATTACHMENT_FILE_FORMAT_ID_PARAM_NAME, STRETCHY_REPORT_ID_PARAM_NAME, STRETCHY_REPORT_PARAM_MAP_PARAM_NAME, IS_ACTIVE_PARAM_NAME, START_DATE_TIME_PARAM_NAME))); // list of permitted parameters for the update report mailing job request public static final Set<String> UPDATE_REQUEST_PARAMETERS = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(LOCALE_PARAM_NAME, DATE_FORMAT_PARAM_NAME, NAME_PARAM_NAME, DESCRIPTION_PARAM_NAME, RECURRENCE_PARAM_NAME, EMAIL_RECIPIENTS_PARAM_NAME, EMAIL_SUBJECT_PARAM_NAME, EMAIL_MESSAGE_PARAM_NAME, EMAIL_ATTACHMENT_FILE_FORMAT_ID_PARAM_NAME, STRETCHY_REPORT_ID_PARAM_NAME, STRETCHY_REPORT_PARAM_MAP_PARAM_NAME, IS_ACTIVE_PARAM_NAME, START_DATE_TIME_PARAM_NAME))); // list of parameters that represent the properties of a report mailing job public static final Set<String> REPORT_MAILING_JOB_DATA_PARAMETERS = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(ID_PARAM_NAME, NAME_PARAM_NAME, DESCRIPTION_PARAM_NAME, RECURRENCE_PARAM_NAME, EMAIL_RECIPIENTS_PARAM_NAME, EMAIL_SUBJECT_PARAM_NAME, EMAIL_MESSAGE_PARAM_NAME, EMAIL_ATTACHMENT_FILE_FORMAT_PARAM_NAME, STRETCHY_REPORT_PARAM_NAME, STRETCHY_REPORT_PARAM_MAP_PARAM_NAME, IS_ACTIVE_PARAM_NAME, START_DATE_TIME_PARAM_NAME, PREVIOUS_RUN_DATE_TIME_PARAM_NAME, NEXT_RUN_DATE_TIME_PARAM_NAME, PREVIOUS_RUN_STATUS, PREVIOUS_RUN_ERROR_LOG, PREVIOUS_RUN_ERROR_MESSAGE, NUMBER_OF_RUNS))); // report mailing job configuration names public static final String GMAIL_SMTP_SERVER = "GMAIL_SMTP_SERVER"; public static final String GMAIL_SMTP_PORT = "GMAIL_SMTP_PORT"; public static final String GMAIL_SMTP_USERNAME = "GMAIL_SMTP_USERNAME"; public static final String GMAIL_SMTP_PASSWORD = "GMAIL_SMTP_PASSWORD"; }
[ "niwoogabajoel@gmail.com" ]
niwoogabajoel@gmail.com
78c19f101bbd481cadb95aa85e20a1242b20b2a0
17e8438486cb3e3073966ca2c14956d3ba9209ea
/dso/tags/3.5.5/code/base/dso-l2/src/com/tc/objectserver/dgc/impl/GCStatsEventPublisher.java
c173ce13bc988805036696da3cba0eebf6222976
[]
no_license
sirinath/Terracotta
fedfc2c4f0f06c990f94b8b6c3b9c93293334345
00a7662b9cf530dfdb43f2dd821fa559e998c892
refs/heads/master
2021-01-23T05:41:52.414211
2015-07-02T15:21:54
2015-07-02T15:21:54
38,613,711
1
0
null
null
null
null
UTF-8
Java
false
false
4,298
java
/* * All content copyright (c) 2003-2008 Terracotta, Inc., except as may otherwise be noted in a separate copyright * notice. All rights reserved. */ package com.tc.objectserver.dgc.impl; import com.tc.objectserver.api.GCStats; import com.tc.objectserver.api.GCStatsEventListener; import com.tc.objectserver.core.impl.GarbageCollectionID; import com.tc.objectserver.dgc.api.GCStatsImpl; import com.tc.objectserver.dgc.api.GarbageCollectionInfo; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map.Entry; import java.util.concurrent.CopyOnWriteArrayList; public class GCStatsEventPublisher extends GarbageCollectorEventListenerAdapter { private final List gcStatsEventListeners = new CopyOnWriteArrayList(); private final LossyLinkedHashMap gcHistory = new LossyLinkedHashMap(1500); public void addListener(GCStatsEventListener listener) { gcStatsEventListeners.add(listener); } public GCStats[] getGarbageCollectorStats() { return gcHistory.values().toArray(new GCStats[gcHistory.size()]); } public GCStats getLastGarbageCollectorStats() { Iterator iter = gcHistory.values().iterator(); if (iter.hasNext()) { return (GCStats) iter.next(); } return null; } @Override public void garbageCollectorStart(GarbageCollectionInfo info) { GCStatsImpl gcStats = getGCStats(info); push(info.getGarbageCollectionID(), gcStats); fireGCStatsEvent(gcStats); } @Override public void garbageCollectorMark(GarbageCollectionInfo info) { GCStatsImpl gcStats = getGCStats(info); gcStats.setMarkState(); fireGCStatsEvent(gcStats); } @Override public void garbageCollectorPausing(GarbageCollectionInfo info) { GCStatsImpl gcStats = getGCStats(info); gcStats.setPauseState(); fireGCStatsEvent(gcStats); } @Override public void garbageCollectorMarkComplete(GarbageCollectionInfo info) { GCStatsImpl gcStats = getGCStats(info); gcStats.setMarkCompleteState(); gcStats.setActualGarbageCount(info.getActualGarbageCount()); fireGCStatsEvent(gcStats); } @Override public void garbageCollectorDelete(GarbageCollectionInfo info) { GCStatsImpl gcStats = getGCStats(info); gcStats.setDeleteState(); fireGCStatsEvent(gcStats); } @Override public void garbageCollectorCompleted(GarbageCollectionInfo info) { GCStatsImpl gcStats = getGCStats(info); gcStats.setEndObjectCount(info.getEndObjectCount()); gcStats.setCompleteState(); fireGCStatsEvent(gcStats); } @Override public void garbageCollectorCanceled(GarbageCollectionInfo info) { GCStatsImpl gcStats = getGCStats(info); gcStats.setCanceledState(); fireGCStatsEvent(gcStats); } private GCStatsImpl getGCStats(GarbageCollectionInfo info) { GCStatsImpl gcStats = null; if ((gcStats = gcHistory.get(info.getGarbageCollectionID())) == null) { gcStats = new GCStatsImpl(info.getIteration(), info.isFullGC(), info.getStartTime()); push(info.getGarbageCollectionID(), gcStats); } gcStats.setActualGarbageCount(info.getActualGarbageCount()); gcStats.setBeginObjectCount(info.getBeginObjectCount()); gcStats.setCandidateGarbageCount(info.getCandidateGarbageCount()); gcStats.setDeleteStageTime(info.getDeleteStageTime()); gcStats.setElapsedTime(info.getElapsedTime()); gcStats.setMarkStageTime(info.getMarkStageTime()); gcStats.setPausedStageTime(info.getPausedStageTime()); gcStats.setEndObjectCount(info.getEndObjectCount()); return gcStats; } private void push(GarbageCollectionID id, GCStatsImpl stats) { gcHistory.put(id, stats); } public void fireGCStatsEvent(GCStats gcStats) { for (Iterator iter = gcStatsEventListeners.iterator(); iter.hasNext();) { GCStatsEventListener listener = (GCStatsEventListener) iter.next(); listener.update(gcStats); } } private static class LossyLinkedHashMap extends LinkedHashMap<GarbageCollectionID, GCStatsImpl> { private final int size; public LossyLinkedHashMap(int size) { this.size = size; } @Override protected boolean removeEldestEntry(Entry<GarbageCollectionID, GCStatsImpl> eldest) { return (size() < size) ? false : true; } } }
[ "cruise@7fc7bbf3-cf45-46d4-be06-341739edd864" ]
cruise@7fc7bbf3-cf45-46d4-be06-341739edd864
988d7f0e97f33421415858241c5dc9841333d3f2
d250381386ee9be47fb67fa6c7cc451c5cbe2e55
/services/ConnectPoint_Reservation/src/com/gzipcompressiontest/services/connectpoint_reservation/model/datacontract3/RetrieveBalanceResponse.java
4ebce0809b8e1355666ddd1f521297a7ead939fc
[]
no_license
wavemakerapps/Rest_With_Server_calls
2f50e2e46a4951a5521072d598cbd15ada62fb50
9ee4d729ff0b2ace4ac468b949d0071e944ef215
refs/heads/master
2021-05-13T15:42:49.334469
2018-01-09T06:34:36
2018-01-09T06:34:36
116,776,198
0
0
null
null
null
null
UTF-8
Java
false
false
2,894
java
/*Copyright (c) 2016-2017 wavemaker.com All Rights Reserved. This software is the confidential and proprietary information of wavemaker.com You shall not disclose such Confidential Information and shall use it only in accordance with the terms of the source code license agreement you entered into with wavemaker.com*/ package com.gzipcompressiontest.services.connectpoint_reservation.model.datacontract3; import java.math.BigDecimal; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import com.gzipcompressiontest.services.connectpoint_reservation.model.datacontract5.ExceptionInformationException; /** * <p>Java class for RetrieveBalanceResponse complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="RetrieveBalanceResponse"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="Balance" type="{http://www.w3.org/2001/XMLSchema}decimal"/> * &lt;element name="Exceptions" type="{http://schemas.datacontract.org/2004/07/Radixx.ConnectPoint.Exceptions}ExceptionInformation.Exception"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "RetrieveBalanceResponse", propOrder = { "balance", "exceptions" }) public class RetrieveBalanceResponse { @XmlElement(name = "Balance", required = true, nillable = true) protected BigDecimal balance; @XmlElement(name = "Exceptions", required = true, nillable = true) protected ExceptionInformationException exceptions; /** * Gets the value of the balance property. * * @return * possible object is * {@link BigDecimal } * */ public BigDecimal getBalance() { return balance; } /** * Sets the value of the balance property. * * @param value * allowed object is * {@link BigDecimal } * */ public void setBalance(BigDecimal value) { this.balance = value; } /** * Gets the value of the exceptions property. * * @return * possible object is * {@link ExceptionInformationException } * */ public ExceptionInformationException getExceptions() { return exceptions; } /** * Sets the value of the exceptions property. * * @param value * allowed object is * {@link ExceptionInformationException } * */ public void setExceptions(ExceptionInformationException value) { this.exceptions = value; } }
[ "appTest1@wavemaker.com" ]
appTest1@wavemaker.com
ad8b5c1aa1c4ea425ac7da206ea8b60904c04876
bd497fa56eb59116a9cf060c7fb9e195c91be4a4
/app/src/main/java/com/hmw/mytoutiaoapp/database/table/MediaChannelTable.java
d616992eaded94dea35ee3f5d4490ea481b38821
[ "Apache-2.0" ]
permissive
hanmingwang/MyToutiaoApp
35654ef1a9a9095e8a1aa20920fc672cf5a81cd7
a5fe4b0f22994da835c3ed70ee29e8c85eb674df
refs/heads/master
2020-03-19T06:05:39.398299
2018-06-26T02:11:07
2018-06-26T02:11:07
135,990,008
0
0
null
null
null
null
UTF-8
Java
false
false
1,356
java
package com.hmw.mytoutiaoapp.database.table; /** * Created by han on 2018/6/6. */ public class MediaChannelTable { /** * 头条号信息表 */ public static final String TABLENAME = "MediaChannelTable"; /** * 字段部分 */ public static final String ID = "id"; public static final String NAME = "name"; public static final String AVATAR = "avatar"; public static final String TYPE = "type"; public static final String FOLLOWCOUNT = "followCount"; public static final String DESCTEXT = "descText"; public static final String URL = "url"; /** * 字段ID 数据库操作建立字段对应关系 从0开始 */ public static final int ID_ID = 0; public static final int ID_NAME = 1; public static final int ID_AVATAR = 2; public static final int ID_TYPE = 3; public static final int ID_FOLLOWCOUNT = 4; public static final int ID_DESCTEXT = 5; public static final int ID_URL = 6; /** * 创建表 */ public static final String CREATE_TABLE = "create table if not exists " + TABLENAME + "(" + ID + " text primary key, " + NAME + " text, " + AVATAR + " text, " + TYPE + " text, " + FOLLOWCOUNT + " text, " + DESCTEXT + " text, " + URL + " text) "; }
[ "you@example.com" ]
you@example.com
672b5eb3fe3abc94a4d0ab5ebc2a049d05d8389d
96ec89610466731f88d88cda8f166e82f9a79e96
/src/main/java/com/cfy/interest/model/UserOperationMessage.java
ca9bb35df1a78bb63e06e1e0e48f71263d977b22
[]
no_license
chenfuyuan/interest-circle
8bf3216878426e2cf43067f5bc37703e9d4bec15
79c3c3329bcf5a108c7a4e1caf56c124041af91c
refs/heads/master
2022-06-21T05:03:09.368295
2020-07-02T17:24:42
2020-07-02T17:24:42
225,778,875
1
0
null
2022-06-17T02:46:38
2019-12-04T04:27:46
JavaScript
UTF-8
Java
false
false
837
java
package com.cfy.interest.model; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import java.util.Date; @Data @AllArgsConstructor @NoArgsConstructor @TableName("user_operation_message") public class UserOperationMessage { @TableId(type = IdType.AUTO) private Integer id; @TableField(exist = false) private User user; private Long uid; private String message; private Date datetime; private Integer type; public static final Integer CREATE = 1; public static final Integer UPDATE = 2; public static final Integer CHANGEPASSWORD = 3; }
[ "chenfuyuan0713@163.com" ]
chenfuyuan0713@163.com
438f9bff380589c897c0eed508864fcbc3ec645d
30620f7010d11255f00df9b4f0c4e9bdda2fa11d
/Module 2/Chapter 11/Windows/xamformsinsights/droid/obj/debug/android/src/mono/android/support/design/widget/SwipeDismissBehavior_OnDismissListenerImplementor.java
d822fec22ecf70d070f22d137272e1f44595afcd
[ "MIT" ]
permissive
PacktPublishing/Xamarin-Cross-Platform-Mobile-Application-Development
957db5a284c9b590d34d932909724e9eb10ca7a6
dc83c18f4d4d1720b62f3077b4f53d5a90143304
refs/heads/master
2023-02-11T16:07:55.095797
2023-01-30T10:24:05
2023-01-30T10:24:05
66,077,875
7
17
MIT
2022-06-22T17:23:02
2016-08-19T11:32:15
Java
UTF-8
Java
false
false
1,937
java
package mono.android.support.design.widget; public class SwipeDismissBehavior_OnDismissListenerImplementor extends java.lang.Object implements mono.android.IGCUserPeer, android.support.design.widget.SwipeDismissBehavior.OnDismissListener { static final String __md_methods; static { __md_methods = "n_onDismiss:(Landroid/view/View;)V:GetOnDismiss_Landroid_view_View_Handler:Android.Support.Design.Widget.SwipeDismissBehavior/IOnDismissListenerInvoker, Xamarin.Android.Support.Design\n" + "n_onDragStateChanged:(I)V:GetOnDragStateChanged_IHandler:Android.Support.Design.Widget.SwipeDismissBehavior/IOnDismissListenerInvoker, Xamarin.Android.Support.Design\n" + ""; mono.android.Runtime.register ("Android.Support.Design.Widget.SwipeDismissBehavior+IOnDismissListenerImplementor, Xamarin.Android.Support.Design, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", SwipeDismissBehavior_OnDismissListenerImplementor.class, __md_methods); } public SwipeDismissBehavior_OnDismissListenerImplementor () throws java.lang.Throwable { super (); if (getClass () == SwipeDismissBehavior_OnDismissListenerImplementor.class) mono.android.TypeManager.Activate ("Android.Support.Design.Widget.SwipeDismissBehavior+IOnDismissListenerImplementor, Xamarin.Android.Support.Design, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", "", this, new java.lang.Object[] { }); } public void onDismiss (android.view.View p0) { n_onDismiss (p0); } private native void n_onDismiss (android.view.View p0); public void onDragStateChanged (int p0) { n_onDragStateChanged (p0); } private native void n_onDragStateChanged (int p0); java.util.ArrayList refList; public void monodroidAddReference (java.lang.Object obj) { if (refList == null) refList = new java.util.ArrayList (); refList.add (obj); } public void monodroidClearReferences () { if (refList != null) refList.clear (); } }
[ "vishalm@packtpub.com" ]
vishalm@packtpub.com
55a0c287a0e983c045b41fd921f372de769fc7a1
cbc1a85aa864150e20428b99370f8b2f3700976e
/Reporter/html/SAME_POSITION/69_stru_declaration.java
34722d91c3e85a3778c1ecba1492b66bc2c03da2
[]
no_license
guilhermejccavalcanti/sourcesvj
965f4d8e88ba25ff102ef54101e9eb3ca53cc8a0
9ca14a022dfe91a4a4307a9fa8196d823356b022
refs/heads/master
2020-04-24T11:58:01.645560
2019-09-07T00:35:06
2019-09-07T00:35:06
171,941,485
0
0
null
null
null
null
UTF-8
Java
false
false
7,033
java
@SuppressWarnings(value = {"static-access", }) public static void main(String[] args) throws Exception { final OmidDelta registrationService = new OmidDelta("ExampleApp"); CommandLineParser cmdLineParser = new ExtendedPosixParser(true); Options options = new Options(); options.addOption(OptionBuilder.withLongOpt("txs").withDescription("Number of transactions to execute").withType(Number.class).hasArg().withArgName("argname").create()); options.addOption(OptionBuilder.withLongOpt("rows-per-tx").withDescription("Number of rows that each transaction inserts").withType(Number.class).hasArg().withArgName("argname").create()); int txsToExecute = 1; int rowsPerTx = 1; try { CommandLine cmdLine = cmdLineParser.parse(options, args); if (cmdLine.hasOption("txs")) { txsToExecute = ((Number)cmdLine.getParsedOptionValue("txs")).intValue(); } if (cmdLine.hasOption("rows-per-tx")) { rowsPerTx = ((Number)cmdLine.getParsedOptionValue("rows-per-tx")).intValue(); } cdl = new CountDownLatch(txsToExecute * rowsPerTx * 2); } catch (ParseException e) { e.printStackTrace(); System.exit(1); } <<<<<<< C:\Users\user\Desktop\gjcc\amostra\projects\omid\revisions\rev_d4aa650_fe8d343\rev_left_d4aa650\src\main\java\com\yahoo\omid\examples\notifications\ClientNotificationAppExample.java Configuration tsoClientHbaseConf = HBaseConfiguration.create(); ======= Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { try { registrationService.close(); logger.info("ooo Omid ooo - Omid\'s Notification Example App Stopped (CTRL+C) - ooo Omid ooo"); } catch (IOException e) { } } }); >>>>>>> C:\Users\user\Desktop\gjcc\amostra\projects\omid\revisions\rev_d4aa650_fe8d343\rev_right_fe8d343\src\main\java\com\yahoo\omid\examples\notifications\ClientNotificationAppExample.java tsoClientHbaseConf.set("tso.host", "localhost"); tsoClientHbaseConf.setInt("tso.port", 1234); logger.info("ooo Omid ooo - STARTING OMID\'S EXAMPLE NOTIFICATION APP. - ooo Omid ooo"); logger.info("ooo Omid ooo -" + " A table called " + Constants.TABLE_1 + " with a column Family " + Constants.COLUMN_FAMILY_1 + " has been already created by the Omid Infrastructure " + "- ooo Omid ooo"); Observer obs1 = new Observer() { Interest interestObs1 = new Interest(Constants.TABLE_1, Constants.COLUMN_FAMILY_1, Constants.COLUMN_1); public void onColumnChanged(byte[] column, byte[] columnFamily, byte[] table, byte[] rowKey, TransactionState tx) { logger.info("ooo Omid ooo -" + "I\'M OBSERVER o1." + " An update has occurred on Table: " + Bytes.toString(table) + " RowKey: " + Bytes.toString(rowKey) + " ColumnFamily: " + Bytes.toString(columnFamily) + " Column: " + Bytes.toString(column) + " !!! - ooo Omid ooo"); logger.info("ooo Omid ooo - OBSERVER o1 INSERTING A NEW ROW ON COLUMN " + Constants.COLUMN_2 + " UNDER TRANSACTIONAL CONTEXT " + tx + " - ooo Omid ooo"); Configuration tsoClientConf = HBaseConfiguration.create(); tsoClientConf.set("tso.host", "localhost"); tsoClientConf.setInt("tso.port", 1234); try { TransactionalTable tt = new TransactionalTable(tsoClientConf, Constants.TABLE_1); doTransactionalPut(tx, tt, rowKey, Bytes.toBytes(Constants.COLUMN_FAMILY_1), Bytes.toBytes(Constants.COLUMN_2), Bytes.toBytes("Data written by OBSERVER o1")); } catch (IOException e) { e.printStackTrace(); } cdl.countDown(); } @Override public String getName() { return "o1"; } @Override public List<Interest> getInterests() { return Collections.singletonList(interestObs1); } }; Observer obs2 = new Observer() { Interest interestObs2 = new Interest(Constants.TABLE_1, Constants.COLUMN_FAMILY_1, Constants.COLUMN_2); public void onColumnChanged(byte[] column, byte[] columnFamily, byte[] table, byte[] rowKey, TransactionState tx) { logger.info("ooo Omid ooo - " + "I\'M OBSERVER o2." + " An update has occurred on Table: " + Bytes.toString(table) + " RowKey: " + Bytes.toString(rowKey) + " ColumnFamily: " + Bytes.toString(columnFamily) + " Column: " + Bytes.toString(column) + " !!! I\'M NOT GONNA DO ANYTHING ELSE - ooo Omid ooo"); cdl.countDown(); } @Override public String getName() { return "o2"; } @Override public List<Interest> getInterests() { return Collections.singletonList(interestObs2); } }; final IncrementalApplication app = new DeltaOmid.AppBuilder("ExampleApp").addObserver(obs1).addObserver(obs2).build(); Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { try { app.close(); logger.info("ooo Omid ooo - Omid\'s Notification Example App Stopped (CTRL+C) - ooo Omid ooo"); } catch (IOException e) { } } }); logger.info("ooo Omid ooo - WAITING 5 SECONDS TO ALLOW OBSERVER REGISTRATION - ooo Omid ooo"); Thread.currentThread().sleep(5000); TransactionManager tm = new TransactionManager(tsoClientHbaseConf); TransactionalTable tt = new TransactionalTable(tsoClientHbaseConf, Constants.TABLE_1); logger.info("ooo Omid ooo - STARTING " + txsToExecute + " TRIGGER TXS INSERTING " + rowsPerTx + " ROWS EACH IN COLUMN " + Constants.COLUMN_1 + " - ooo Omid ooo"); for (int i = 0; i < txsToExecute; i++) { TransactionState tx = tm.beginTransaction(); for (int j = 0; j < rowsPerTx; j++) { Put row = new Put(Bytes.toBytes("row-" + Integer.toString(i + (j * 10000)))); row.add(Bytes.toBytes(Constants.COLUMN_FAMILY_1), Bytes.toBytes(Constants.COLUMN_1), Bytes.toBytes("testWrite-" + Integer.toString(i + (j * 10000)))); tt.put(tx, row); } tm.tryCommit(tx); } logger.info("ooo Omid ooo - TRIGGER TXS COMMITTED - ooo Omid ooo"); tt.close(); logger.info("ooo Omid ooo - WAITING TO ALLOW THE 2 OBSERVERS RECEIVING ALL THE NOTIFICATIONS - ooo Omid ooo"); cdl.await(); logger.info("ooo Omid ooo - OBSERVERS HAVE RECEIVED ALL THE NOTIFICATIONS WAITING 30 SECONDS TO ALLOW FINISHING CLEARING STUFF - ooo Omid ooo"); Thread.currentThread().sleep(30000); app.close(); Thread.currentThread().sleep(10000); <<<<<<< C:\Users\user\Desktop\gjcc\amostra\projects\omid\revisions\rev_d4aa650_fe8d343\rev_left_d4aa650\src\main\java\com\yahoo\omid\examples\notifications\ClientNotificationAppExample.java logger.info("ooo Omid ooo - OMID\'S NOTIFICATION APP FINISHED - ooo Omid ooo"); ======= registrationService.close(); >>>>>>> C:\Users\user\Desktop\gjcc\amostra\projects\omid\revisions\rev_d4aa650_fe8d343\rev_right_fe8d343\src\main\java\com\yahoo\omid\examples\notifications\ClientNotificationAppExample.java }
[ "gjcc@cin.ufpe.br" ]
gjcc@cin.ufpe.br
98a5d915f789e3580853eb54a29c2a7b65c77cb4
51a2eeef60ab5d109d512f816e18e61221490e49
/src/br/com/java/controller/ProdutoControle.java
6a6b48069ce1d30759f9538d0073e52655f3594a
[]
no_license
diegotpereira/SistemaDeVendasJavaConsole
1c271ace3e4410818a5b23ad150719ff4dc5be28
8d31eab8bd7044e55590b83d7067e613b6bb404a
refs/heads/master
2023-09-02T21:57:58.418209
2021-11-23T13:50:38
2021-11-23T13:50:38
430,849,435
0
0
null
null
null
null
UTF-8
Java
false
false
1,478
java
package br.com.java.controller; import java.util.ArrayList; import br.com.java.interfaces.IController; import br.com.java.modelo.Produto; import br.com.java.utils.Console; public class ProdutoControle implements IController<Produto> { static ArrayList<Produto> produtos = new ArrayList<Produto>(); @Override public void cadastrar(Produto produto) { // TODO Auto-generated method stub int i = encontrarProduto(produto); if (i == -1) { produtos.add(produto); Console.MensagemGenericaSucesso(); } else { Console.MensagemGenericaErro(); } } private static int encontrarProduto(Produto produto) { int i = -1; for(Produto cadastrado : produtos) { i++; if (cadastrado.getNomeProduto().equalsIgnoreCase(produto.getNomeProduto())) { return i; } } return -1; } @Override public ArrayList<Produto> listar() { // TODO Auto-generated method stub return produtos; } public boolean validaProduto(String item, int quantidade) { ArrayList<Produto> produtos = new ArrayList<>(); for(Produto produto : produtos) { if (item.equalsIgnoreCase(produto.getNomeProduto())) { if (quantidade <= produto.getQuantidade()) { return true; } } } return false; } }
[ "diegoteixeirapereira@hotmail.com" ]
diegoteixeirapereira@hotmail.com
ef1eaafa5c4d9fb355e0b80796b9b54fa6fdbe55
ded2330f5d1589d50fb531a3466a277163a9c5f2
/meal/jxd-whotel/src/main/java/com/whotel/thirdparty/jxd/mode/MbrCardUpgradeQuery.java
cf3d8b582cc8262bf735c8cdc19d4f7b099b0456
[]
no_license
hasone/whotel
d106cb85ca0fecfa7a0f631b096c8c396e806b76
92ab351d056021f02539262e74c019a6363e9be7
refs/heads/master
2021-06-18T01:22:50.462881
2017-06-14T12:10:47
2017-06-14T12:10:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
642
java
package com.whotel.thirdparty.jxd.mode; import com.whotel.thirdparty.jxd.util.AbstractInputParam; public class MbrCardUpgradeQuery extends AbstractInputParam { private String opType = "会员卡升级列表"; private String mbrCardType; public String getOpType() { return opType; } public void setOpType(String opType) { this.opType = opType; } public String getMbrCardType() { return mbrCardType; } public void setMbrCardType(String mbrCardType) { this.mbrCardType = mbrCardType; } @Override public String getRoot() { // TODO Auto-generated method stub return null; } }
[ "374255041@qq.com" ]
374255041@qq.com
bf8c329568ec8c16fb14ecbca7712bb8ce106175
2eb5604c0ba311a9a6910576474c747e9ad86313
/chado-pg-orm/src/org/irri/iric/chado/so/RnapolIiPromoterId.java
3d1adc4c232ab85b3fa20b1cec4a7e0287502f76
[]
no_license
iric-irri/portal
5385c6a4e4fd3e569f5334e541d4b852edc46bc1
b2d3cd64be8d9d80b52d21566f329eeae46d9749
refs/heads/master
2021-01-16T00:28:30.272064
2014-05-26T05:46:30
2014-05-26T05:46:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,181
java
package org.irri.iric.chado.so; // Generated 05 26, 14 1:32:25 PM by Hibernate Tools 3.4.0.CR1 import java.util.Date; /** * RnapolIiPromoterId generated by hbm2java */ public class RnapolIiPromoterId implements java.io.Serializable { private Integer rnapolIiPromoterId; private Integer featureId; private Integer dbxrefId; private Integer organismId; private String name; private String uniquename; private String residues; private Integer seqlen; private String md5checksum; private Integer typeId; private Boolean isAnalysis; private Boolean isObsolete; private Date timeaccessioned; private Date timelastmodified; public RnapolIiPromoterId() { } public RnapolIiPromoterId(Integer rnapolIiPromoterId, Integer featureId, Integer dbxrefId, Integer organismId, String name, String uniquename, String residues, Integer seqlen, String md5checksum, Integer typeId, Boolean isAnalysis, Boolean isObsolete, Date timeaccessioned, Date timelastmodified) { this.rnapolIiPromoterId = rnapolIiPromoterId; this.featureId = featureId; this.dbxrefId = dbxrefId; this.organismId = organismId; this.name = name; this.uniquename = uniquename; this.residues = residues; this.seqlen = seqlen; this.md5checksum = md5checksum; this.typeId = typeId; this.isAnalysis = isAnalysis; this.isObsolete = isObsolete; this.timeaccessioned = timeaccessioned; this.timelastmodified = timelastmodified; } public Integer getRnapolIiPromoterId() { return this.rnapolIiPromoterId; } public void setRnapolIiPromoterId(Integer rnapolIiPromoterId) { this.rnapolIiPromoterId = rnapolIiPromoterId; } public Integer getFeatureId() { return this.featureId; } public void setFeatureId(Integer featureId) { this.featureId = featureId; } public Integer getDbxrefId() { return this.dbxrefId; } public void setDbxrefId(Integer dbxrefId) { this.dbxrefId = dbxrefId; } public Integer getOrganismId() { return this.organismId; } public void setOrganismId(Integer organismId) { this.organismId = organismId; } public String getName() { return this.name; } public void setName(String name) { this.name = name; } public String getUniquename() { return this.uniquename; } public void setUniquename(String uniquename) { this.uniquename = uniquename; } public String getResidues() { return this.residues; } public void setResidues(String residues) { this.residues = residues; } public Integer getSeqlen() { return this.seqlen; } public void setSeqlen(Integer seqlen) { this.seqlen = seqlen; } public String getMd5checksum() { return this.md5checksum; } public void setMd5checksum(String md5checksum) { this.md5checksum = md5checksum; } public Integer getTypeId() { return this.typeId; } public void setTypeId(Integer typeId) { this.typeId = typeId; } public Boolean getIsAnalysis() { return this.isAnalysis; } public void setIsAnalysis(Boolean isAnalysis) { this.isAnalysis = isAnalysis; } public Boolean getIsObsolete() { return this.isObsolete; } public void setIsObsolete(Boolean isObsolete) { this.isObsolete = isObsolete; } public Date getTimeaccessioned() { return this.timeaccessioned; } public void setTimeaccessioned(Date timeaccessioned) { this.timeaccessioned = timeaccessioned; } public Date getTimelastmodified() { return this.timelastmodified; } public void setTimelastmodified(Date timelastmodified) { this.timelastmodified = timelastmodified; } public boolean equals(Object other) { if ((this == other)) return true; if ((other == null)) return false; if (!(other instanceof RnapolIiPromoterId)) return false; RnapolIiPromoterId castOther = (RnapolIiPromoterId) other; return ((this.getRnapolIiPromoterId() == castOther .getRnapolIiPromoterId()) || (this.getRnapolIiPromoterId() != null && castOther.getRnapolIiPromoterId() != null && this .getRnapolIiPromoterId().equals( castOther.getRnapolIiPromoterId()))) && ((this.getFeatureId() == castOther.getFeatureId()) || (this .getFeatureId() != null && castOther.getFeatureId() != null && this .getFeatureId().equals(castOther.getFeatureId()))) && ((this.getDbxrefId() == castOther.getDbxrefId()) || (this .getDbxrefId() != null && castOther.getDbxrefId() != null && this .getDbxrefId().equals(castOther.getDbxrefId()))) && ((this.getOrganismId() == castOther.getOrganismId()) || (this .getOrganismId() != null && castOther.getOrganismId() != null && this .getOrganismId().equals(castOther.getOrganismId()))) && ((this.getName() == castOther.getName()) || (this.getName() != null && castOther.getName() != null && this.getName() .equals(castOther.getName()))) && ((this.getUniquename() == castOther.getUniquename()) || (this .getUniquename() != null && castOther.getUniquename() != null && this .getUniquename().equals(castOther.getUniquename()))) && ((this.getResidues() == castOther.getResidues()) || (this .getResidues() != null && castOther.getResidues() != null && this .getResidues().equals(castOther.getResidues()))) && ((this.getSeqlen() == castOther.getSeqlen()) || (this .getSeqlen() != null && castOther.getSeqlen() != null && this .getSeqlen().equals(castOther.getSeqlen()))) && ((this.getMd5checksum() == castOther.getMd5checksum()) || (this .getMd5checksum() != null && castOther.getMd5checksum() != null && this .getMd5checksum().equals(castOther.getMd5checksum()))) && ((this.getTypeId() == castOther.getTypeId()) || (this .getTypeId() != null && castOther.getTypeId() != null && this .getTypeId().equals(castOther.getTypeId()))) && ((this.getIsAnalysis() == castOther.getIsAnalysis()) || (this .getIsAnalysis() != null && castOther.getIsAnalysis() != null && this .getIsAnalysis().equals(castOther.getIsAnalysis()))) && ((this.getIsObsolete() == castOther.getIsObsolete()) || (this .getIsObsolete() != null && castOther.getIsObsolete() != null && this .getIsObsolete().equals(castOther.getIsObsolete()))) && ((this.getTimeaccessioned() == castOther .getTimeaccessioned()) || (this.getTimeaccessioned() != null && castOther.getTimeaccessioned() != null && this .getTimeaccessioned().equals( castOther.getTimeaccessioned()))) && ((this.getTimelastmodified() == castOther .getTimelastmodified()) || (this.getTimelastmodified() != null && castOther.getTimelastmodified() != null && this .getTimelastmodified().equals( castOther.getTimelastmodified()))); } public int hashCode() { int result = 17; result = 37 * result + (getRnapolIiPromoterId() == null ? 0 : this .getRnapolIiPromoterId().hashCode()); result = 37 * result + (getFeatureId() == null ? 0 : this.getFeatureId().hashCode()); result = 37 * result + (getDbxrefId() == null ? 0 : this.getDbxrefId().hashCode()); result = 37 * result + (getOrganismId() == null ? 0 : this.getOrganismId() .hashCode()); result = 37 * result + (getName() == null ? 0 : this.getName().hashCode()); result = 37 * result + (getUniquename() == null ? 0 : this.getUniquename() .hashCode()); result = 37 * result + (getResidues() == null ? 0 : this.getResidues().hashCode()); result = 37 * result + (getSeqlen() == null ? 0 : this.getSeqlen().hashCode()); result = 37 * result + (getMd5checksum() == null ? 0 : this.getMd5checksum() .hashCode()); result = 37 * result + (getTypeId() == null ? 0 : this.getTypeId().hashCode()); result = 37 * result + (getIsAnalysis() == null ? 0 : this.getIsAnalysis() .hashCode()); result = 37 * result + (getIsObsolete() == null ? 0 : this.getIsObsolete() .hashCode()); result = 37 * result + (getTimeaccessioned() == null ? 0 : this.getTimeaccessioned() .hashCode()); result = 37 * result + (getTimelastmodified() == null ? 0 : this .getTimelastmodified().hashCode()); return result; } }
[ "locem@berting-debian.ourwebserver.no-ip.biz" ]
locem@berting-debian.ourwebserver.no-ip.biz
fe25e912a1fc9a476a6354fa051d698140a03fe4
1ca2579c187d57d40062a5401867853dd70b2e32
/src/main/java/com/elmapigateway/config/CacheConfiguration.java
a4c6101176c5199226f39bf27857e1f879e22181
[]
no_license
BulkSecurityGeneratorProject/int-api-gateway
968036b0bf3f28738ff5395fb35daea6d74666db
5bd77a567c5abd7483cb7809c5ee03e66d118afd
refs/heads/master
2022-12-15T23:26:24.898998
2018-10-29T13:05:26
2018-10-29T13:05:26
296,597,128
0
0
null
2020-09-18T11:07:47
2020-09-18T11:07:47
null
UTF-8
Java
false
false
7,103
java
package com.elmapigateway.config; import io.github.jhipster.config.JHipsterConstants; import io.github.jhipster.config.JHipsterProperties; import com.hazelcast.config.*; import com.hazelcast.core.HazelcastInstance; import com.hazelcast.core.Hazelcast; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.cache.CacheManager; import org.springframework.cache.annotation.EnableCaching; import org.springframework.cloud.client.ServiceInstance; import org.springframework.cloud.client.discovery.DiscoveryClient; import org.springframework.cloud.client.serviceregistry.Registration; import org.springframework.context.annotation.*; import org.springframework.core.env.Environment; import javax.annotation.PreDestroy; @Configuration @EnableCaching public class CacheConfiguration { private final Logger log = LoggerFactory.getLogger(CacheConfiguration.class); private final Environment env; private final ServerProperties serverProperties; private final DiscoveryClient discoveryClient; private Registration registration; public CacheConfiguration(Environment env, ServerProperties serverProperties, DiscoveryClient discoveryClient) { this.env = env; this.serverProperties = serverProperties; this.discoveryClient = discoveryClient; } @Autowired(required = false) public void setRegistration(Registration registration) { this.registration = registration; } @PreDestroy public void destroy() { log.info("Closing Cache Manager"); Hazelcast.shutdownAll(); } @Bean public CacheManager cacheManager(HazelcastInstance hazelcastInstance) { log.debug("Starting HazelcastCacheManager"); CacheManager cacheManager = new com.hazelcast.spring.cache.HazelcastCacheManager(hazelcastInstance); return cacheManager; } @Bean public HazelcastInstance hazelcastInstance(JHipsterProperties jHipsterProperties) { log.debug("Configuring Hazelcast"); HazelcastInstance hazelCastInstance = Hazelcast.getHazelcastInstanceByName("IntApiGateway"); if (hazelCastInstance != null) { log.debug("Hazelcast already initialized"); return hazelCastInstance; } Config config = new Config(); config.setInstanceName("IntApiGateway"); config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false); if (this.registration == null) { log.warn("No discovery service is set up, Hazelcast cannot create a cluster."); } else { // The serviceId is by default the application's name, // see the "spring.application.name" standard Spring property String serviceId = registration.getServiceId(); log.debug("Configuring Hazelcast clustering for instanceId: {}", serviceId); // In development, everything goes through 127.0.0.1, with a different port if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)) { log.debug("Application is running with the \"dev\" profile, Hazelcast " + "cluster will only work with localhost instances"); System.setProperty("hazelcast.local.localAddress", "127.0.0.1"); config.getNetworkConfig().setPort(serverProperties.getPort() + 5701); config.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(true); for (ServiceInstance instance : discoveryClient.getInstances(serviceId)) { String clusterMember = "127.0.0.1:" + (instance.getPort() + 5701); log.debug("Adding Hazelcast (dev) cluster member " + clusterMember); config.getNetworkConfig().getJoin().getTcpIpConfig().addMember(clusterMember); } } else { // Production configuration, one host per instance all using port 5701 config.getNetworkConfig().setPort(5701); config.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(true); for (ServiceInstance instance : discoveryClient.getInstances(serviceId)) { String clusterMember = instance.getHost() + ":5701"; log.debug("Adding Hazelcast (prod) cluster member " + clusterMember); config.getNetworkConfig().getJoin().getTcpIpConfig().addMember(clusterMember); } } } config.getMapConfigs().put("default", initializeDefaultMapConfig(jHipsterProperties)); // Full reference is available at: http://docs.hazelcast.org/docs/management-center/3.9/manual/html/Deploying_and_Starting.html config.setManagementCenterConfig(initializeDefaultManagementCenterConfig(jHipsterProperties)); config.getMapConfigs().put("com.elmapigateway.domain.*", initializeDomainMapConfig(jHipsterProperties)); return Hazelcast.newHazelcastInstance(config); } private ManagementCenterConfig initializeDefaultManagementCenterConfig(JHipsterProperties jHipsterProperties) { ManagementCenterConfig managementCenterConfig = new ManagementCenterConfig(); managementCenterConfig.setEnabled(jHipsterProperties.getCache().getHazelcast().getManagementCenter().isEnabled()); managementCenterConfig.setUrl(jHipsterProperties.getCache().getHazelcast().getManagementCenter().getUrl()); managementCenterConfig.setUpdateInterval(jHipsterProperties.getCache().getHazelcast().getManagementCenter().getUpdateInterval()); return managementCenterConfig; } private MapConfig initializeDefaultMapConfig(JHipsterProperties jHipsterProperties) { MapConfig mapConfig = new MapConfig(); /* Number of backups. If 1 is set as the backup-count for example, then all entries of the map will be copied to another JVM for fail-safety. Valid numbers are 0 (no backup), 1, 2, 3. */ mapConfig.setBackupCount(jHipsterProperties.getCache().getHazelcast().getBackupCount()); /* Valid values are: NONE (no eviction), LRU (Least Recently Used), LFU (Least Frequently Used). NONE is the default. */ mapConfig.setEvictionPolicy(EvictionPolicy.LRU); /* Maximum size of the map. When max size is reached, map is evicted based on the policy defined. Any integer between 0 and Integer.MAX_VALUE. 0 means Integer.MAX_VALUE. Default is 0. */ mapConfig.setMaxSizeConfig(new MaxSizeConfig(0, MaxSizeConfig.MaxSizePolicy.USED_HEAP_SIZE)); return mapConfig; } private MapConfig initializeDomainMapConfig(JHipsterProperties jHipsterProperties) { MapConfig mapConfig = new MapConfig(); mapConfig.setTimeToLiveSeconds(jHipsterProperties.getCache().getHazelcast().getTimeToLiveSeconds()); return mapConfig; } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
986b8558bf09e5ef0081f9a9142bf3d3b4636719
16b7359d118e80b84a87372ae0d1e9c261861091
/hutool-extra/src/main/java/cn/hutool/extra/tokenizer/engine/analysis/AnalysisEngine.java
90c03c6a32ec5c64844eaf7991354fdca04a1f6c
[ "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-mulanpsl-1.0-en", "MulanPSL-1.0" ]
permissive
PlexPt/hutool
0ddc61f69f186cbf57652c55fcbf063976b58ff9
dfdcdd2b4452c27807f5bfb55125347237ec3654
refs/heads/v4-master
2020-07-11T07:42:07.666829
2019-08-31T13:52:40
2019-08-31T13:52:40
116,757,910
0
0
Apache-2.0
2019-08-26T13:20:31
2018-01-09T02:57:03
Java
UTF-8
Java
false
false
1,065
java
package cn.hutool.extra.tokenizer.engine.analysis; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.TokenStream; import cn.hutool.core.util.StrUtil; import cn.hutool.extra.tokenizer.Result; import cn.hutool.extra.tokenizer.TokenizerEngine; import cn.hutool.extra.tokenizer.TokenizerException; /** * Lucene-analysis分词抽象封装<br> * 项目地址:https://github.com/apache/lucene-solr/tree/master/lucene/analysis * * @author looly * */ public class AnalysisEngine implements TokenizerEngine { private Analyzer analyzer; /** * 构造 * * @param analyzer 分析器{@link Analyzer} */ public AnalysisEngine(Analyzer analyzer) { this.analyzer = analyzer; } @Override public Result parse(CharSequence text) { TokenStream stream; try { stream = analyzer.tokenStream("text", StrUtil.str(text)); stream.reset(); } catch (IOException e) { throw new TokenizerException(e); } return new AnalysisResult(stream); } }
[ "loolly@gmail.com" ]
loolly@gmail.com
477f1e2bd51e1f87cab2f69934ef7615f2cce7b4
28f2a84997afbce25c9c48d2148546b623a94841
/java的老年大学项目/schoolclass/trunk/schoolclass-service/src/main/java/com/learnyeai/schoolclass/mq/TestingScQueueReceiverConfig.java
5fdd33fee1d716d01a56cb681784515f0b6ff6f0
[]
no_license
hanghaifeng1994/java
8b0d490cfcd4da451fc2636ddb0370a2f79b8924
bc1fdfdaa428bdcb77ae8b5922444af084bc36d2
refs/heads/master
2020-04-18T22:36:25.288605
2019-02-11T10:24:57
2019-02-11T10:24:57
167,798,815
0
2
null
null
null
null
UTF-8
Java
false
false
1,179
java
package com.learnyeai.schoolclass.mq; import org.springframework.amqp.core.AcknowledgeMode; import org.springframework.amqp.rabbit.connection.ConnectionFactory; import org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import com.learnyeai.mq.TestingConstans; @Configuration public class TestingScQueueReceiverConfig { @Bean(name = "testingScQueueContainer") public SimpleMessageListenerContainer testingCourseQueueContainer(ConnectionFactory connectionFactory, TestingScQueueReceiver testingScQueueContainer) { SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(connectionFactory); container.setQueueNames(TestingConstans.TESTING_SC_QUEUE); container.setExposeListenerChannel(true); container.setAcknowledgeMode(AcknowledgeMode.MANUAL); container.setMessageListener(testingScQueueContainer); /** 设置消费者能处理未应答消息的最大个数 */ container.setPrefetchCount(10); container.setConcurrentConsumers(1); container.setMaxConcurrentConsumers(10); return container; } }
[ "2561836089@qq.com" ]
2561836089@qq.com
11ddd668b3b1e7442b608ded9931648ae76ce7d1
f2aaa52182fdce6e622630a6036a097238e1f94c
/src/com/pauldavdesign/mineauz/minigames/CTFFlag.java
d4cebe2699a14e9e95685bca5bff930f7493456c
[]
no_license
fensoft/Minigames
c72bb972ff51982b8f89258fb2fb172cf165f31b
39a3c52146ac5d521c1989e74b38baae2cb4d871
refs/heads/master
2021-01-15T11:28:38.835145
2014-05-08T10:39:03
2014-05-08T10:39:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,957
java
package com.pauldavdesign.mineauz.minigames; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Effect; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.BlockState; import org.bukkit.block.Sign; import org.bukkit.entity.Player; import org.bukkit.material.MaterialData; import com.pauldavdesign.mineauz.minigames.minigame.Minigame; public class CTFFlag{ private Location spawnLocation = null; private Location currentLocation = null; private MaterialData data = null; private BlockState spawnData = null; private BlockState originalBlock = null; private String[] signText = null; private boolean atHome = true; private int team = -1; private int respawnTime = 60; private int taskID = -1; private Minigame minigame = null; private int cParticleID = -1; public CTFFlag(Location spawn, int team, Player carrier, Minigame minigame){ spawnLocation = spawn; data = ((Sign)spawnLocation.getBlock().getState()).getData(); spawnData = spawnLocation.getBlock().getState(); signText = ((Sign)spawnLocation.getBlock().getState()).getLines(); this.team = team; this.setMinigame(minigame); respawnTime = Minigames.plugin.getConfig().getInt("multiplayer.ctf.flagrespawntime"); } public Location getSpawnLocation() { return spawnLocation; } public void setSpawnLocation(Location spawnLocation) { this.spawnLocation = spawnLocation; } public Location getCurrentLocation() { return currentLocation; } public void setCurrentLocation(Location currentLocation) { this.currentLocation = currentLocation; } public boolean isAtHome() { return atHome; } public void setAtHome(boolean atHome) { this.atHome = atHome; } public int getTeam() { return team; } public void setTeam(int team) { this.team = team; } public Location spawnFlag(Location location){ Location blockBelow = location.clone(); Location newLocation = location.clone(); blockBelow.setY(blockBelow.getBlockY() - 1); if(blockBelow.getBlock().getType() == Material.AIR){ while(blockBelow.getBlock().getType() == Material.AIR){ if(blockBelow.getY() > 1){ blockBelow.setY(blockBelow.getY() - 1); } else{ return null; } } } else if(blockBelow.getBlock().getType() != Material.AIR){ while(blockBelow.getBlock().getType() != Material.AIR){ if(blockBelow.getY() < 255){ blockBelow.setY(blockBelow.getY() + 1); } else{ return null; } } blockBelow.setY(blockBelow.getY() - 1); } if(blockBelow.getBlock().getType() == Material.FURNACE || blockBelow.getBlock().getType() == Material.DISPENSER || blockBelow.getBlock().getType() == Material.CHEST || blockBelow.getBlock().getType() == Material.BREWING_STAND || blockBelow.getBlock().getType() == Material.SIGN_POST || blockBelow.getBlock().getType() == Material.WALL_SIGN){ blockBelow.setY(blockBelow.getY() + 1); } newLocation = blockBelow.clone(); newLocation.setY(newLocation.getY() + 1); newLocation.getBlock().setType(Material.SIGN_POST); Sign sign = (Sign) newLocation.getBlock().getState(); sign.setData(data); originalBlock = blockBelow.getBlock().getState(); blockBelow.getBlock().setType(Material.BEDROCK); if(newLocation != null){ atHome = false; for(int i = 0; i < 4; i++){ sign.setLine(i, signText[i]); } sign.update(); currentLocation = newLocation.clone(); } return newLocation; } public void removeFlag(){ if(!atHome){ if(currentLocation != null){ Location blockBelow = currentLocation.clone(); currentLocation.getBlock().setType(Material.AIR); blockBelow.setY(blockBelow.getY() - 1); blockBelow.getBlock().setType(originalBlock.getType()); originalBlock.update(); currentLocation = null; stopTimer(); } } else{ spawnLocation.getBlock().setType(Material.AIR); } } public void respawnFlag(){ removeFlag(); spawnLocation.getBlock().setType(spawnData.getType()); spawnData.update(); currentLocation = null; atHome = true; Sign sign = (Sign) spawnLocation.getBlock().getState(); for(int i = 0; i < 4; i++){ sign.setLine(i, signText[i]); } sign.update(); } public void stopTimer(){ if(taskID != -1){ Bukkit.getScheduler().cancelTask(taskID); } } public Minigame getMinigame() { return minigame; } public void setMinigame(Minigame minigame) { this.minigame = minigame; } public void startReturnTimer(){ final CTFFlag self = this; taskID = Bukkit.getScheduler().scheduleSyncDelayedTask(Minigames.plugin, new Runnable() { @Override public void run() { String id = MinigameUtils.createLocationID(currentLocation); if(minigame.hasDroppedFlag(id)){ minigame.removeDroppedFlag(id); String newID = MinigameUtils.createLocationID(spawnLocation); minigame.addDroppedFlag(newID, self); } respawnFlag(); for(MinigamePlayer pl : minigame.getPlayers()){ if(getTeam() == 0){ pl.sendMessage(MinigameUtils.formStr("minigame.flag.returnedTeam", ChatColor.RED.toString() + "Red Team's" + ChatColor.WHITE), null); }else if(getTeam() == 1){ pl.sendMessage(MinigameUtils.formStr("minigame.flag.returnedTeam", ChatColor.BLUE.toString() + "Blue Team's" + ChatColor.WHITE), null); } else{ pl.sendMessage(MinigameUtils.getLang("minigame.flag.returnedNeutral"), null); } } taskID = -1; } }, respawnTime * 20); } public void startCarrierParticleEffect(final Player player){ cParticleID = Bukkit.getScheduler().scheduleSyncRepeatingTask(Minigames.plugin, new Runnable() { @Override public void run() { player.getWorld().playEffect(player.getLocation(), Effect.MOBSPAWNER_FLAMES, 0); } }, 15L, 15L); } public void stopCarrierParticleEffect(){ if(cParticleID != -1){ Bukkit.getScheduler().cancelTask(cParticleID); cParticleID = -1; } } }
[ "paul.dav.1991@gmail.com" ]
paul.dav.1991@gmail.com
ffca05e8fcc76352ec0b886d826fb8b69c869903
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/stanfordnlp--CoreNLP/d9c1596c24a8443510501e9c94bea26603b6b8d7/before/UnknownWordModelTrainer.java
3ad1581049193db3183d1d1ed7a938487b2243b1
[]
no_license
fracz/refactor-extractor
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
dd5e82bfcc376e74a99e18c2bf54c95676914272
refs/heads/master
2021-01-19T06:50:08.211003
2018-11-30T13:00:57
2018-11-30T13:00:57
87,353,478
0
0
null
null
null
null
UTF-8
Java
false
false
2,273
java
package edu.stanford.nlp.parser.lexparser; import java.util.Collection; import edu.stanford.nlp.ling.TaggedWord; import edu.stanford.nlp.trees.Tree; import edu.stanford.nlp.util.Index; /** * An interface for training an UnknownWordModel. Once initialized, * you can feed it trees and then call finishTraining to get the * UnknownWordModel. * * @author John Bauer */ public interface UnknownWordModelTrainer { /** * Initialize the trainer with a few of the data structures it needs * to train. Also, it is necessary to estimate the number of trees * that it will be given, as many of the UWMs switch training modes * after seeing a fraction of the trees. * <br> * This is an initialization method and not part of the constructor * because these Trainers are generally loaded by reflection, and * making this a method instead of a constructor lets the compiler * catch silly errors. */ public void initializeTraining(Options op, Lexicon lex, Index<String> wordIndex, Index<String> tagIndex, double totalTrees); /** * Tallies statistics for this particular collection of trees. Can * be called multiple times. */ public void train(Collection<Tree> trees); /** * Tallies statistics for a weighted collection of trees. Can * be called multiple times. */ public void train(Collection<Tree> trees, double weight); /** * Tallies statistics for a single tree. * Can be called multiple times. */ public void train(Tree tree, double weight); /** * Tallies statistics for a single word. * Can be called multiple times. */ public void train(TaggedWord tw, int loc, double weight); public void incrementTreesRead(double weight); /** * Returns the trained UWM. Many of the subclasses build exactly * one classify, and some of the finishTraining methods manipulate the * data in permanent ways, so this should only be called once */ public UnknownWordModel finishTraining(); static public final String unknown = "UNK"; static public final int nullWord = -1; static public final short nullTag = -1; static public final IntTaggedWord NULL_ITW = new IntTaggedWord(nullWord, nullTag); }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
111cadee65e6a99eee4e3ef66bf9a4e3da52bbb5
ef68f145f4364da490b6aec4df0ec62c80085ff9
/src/main/java/com/fisc/gestionotr/client/UserFeignClientInterceptor.java
a49a970a5025b9538bebb7c8100da89e295f739f
[]
no_license
sandalothier/jhipster-gestionotr
591a50912d0fbd3c8d75590aaa3fac0e4694c0de
94b5492573302a150bacc04b18c54bdca0ad398a
refs/heads/master
2022-12-23T03:35:22.925271
2020-01-29T14:29:00
2020-01-29T14:29:00
229,055,686
0
0
null
2022-12-16T06:04:43
2019-12-19T13:02:29
Java
UTF-8
Java
false
false
624
java
package com.fisc.gestionotr.client; import com.fisc.gestionotr.security.SecurityUtils; import feign.RequestInterceptor; import feign.RequestTemplate; import org.springframework.stereotype.Component; @Component public class UserFeignClientInterceptor implements RequestInterceptor { private static final String AUTHORIZATION_HEADER = "Authorization"; private static final String BEARER = "Bearer"; @Override public void apply(RequestTemplate template) { SecurityUtils.getCurrentUserJWT() .ifPresent(s -> template.header(AUTHORIZATION_HEADER,String.format("%s %s", BEARER, s))); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
5117398ccfdbf94047e0c1d32e992cf5b5c532df
a81c08273d36d59a5f2e313d26fee16eb7b60fc4
/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/BrowserFeature.java
d7cb3570d2110fec93e72e0b3fb8cb03f10dd0f7
[ "Apache-2.0" ]
permissive
edouardswiac/htmlunit
88cdc4bc2e7807627c5619be5ad721a17117dbe7
cc9f8e4b341b980ec0bac9cb8b531f4ff958c534
refs/heads/master
2016-09-14T13:53:28.461222
2016-04-29T21:32:17
2016-04-29T21:32:17
57,413,853
0
0
null
null
null
null
UTF-8
Java
false
false
1,610
java
/* * Copyright (c) 2002-2016 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.gargoylesoftware.htmlunit.javascript.configuration; import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.CHROME; import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.FF; import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.IE; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * An annotation to mark a feature in {@link com.gargoylesoftware.htmlunit.BrowserVersionFeatures}. * * @author Ahmed Ashour */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) public @interface BrowserFeature { /** * The {@link WebBrowser}s supported by this feature. * @return the {@link WebBrowser}s */ WebBrowser[] value() default { @WebBrowser(IE), @WebBrowser(FF), @WebBrowser(CHROME) }; }
[ "eswiac@twitter.com" ]
eswiac@twitter.com
39d2e9cac55e5f89fcda9de9798301b4becc8f7c
8567438779e6af0754620a25d379c348e4cd5a5d
/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/StatusCardViewHolder.java
811d7bc4ec70597fff50f3687c07433ed19e63ff
[ "BSD-3-Clause" ]
permissive
thngkaiyuan/chromium
c389ac4b50ccba28ee077cbf6115c41b547955ae
dab56a4a71f87f64ecc0044e97b4a8f247787a68
refs/heads/master
2022-11-10T02:50:29.326119
2017-04-08T12:28:57
2017-04-08T12:28:57
84,073,924
0
1
BSD-3-Clause
2022-10-25T19:47:15
2017-03-06T13:04:15
null
UTF-8
Java
false
false
2,691
java
// Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package org.chromium.chrome.browser.ntp.cards; import android.content.Context; import android.support.annotation.IntegerRes; import android.support.annotation.StringRes; import android.view.View; import android.widget.Button; import android.widget.TextView; import org.chromium.chrome.R; import org.chromium.chrome.browser.ntp.ContextMenuManager; import org.chromium.chrome.browser.widget.displaystyle.UiConfig; /** * ViewHolder for Status and Promo cards. */ public class StatusCardViewHolder extends CardViewHolder { private final TextView mTitleView; private final TextView mBodyView; private final Button mActionView; public StatusCardViewHolder( NewTabPageRecyclerView parent, ContextMenuManager contextMenuManager, UiConfig config) { super(R.layout.new_tab_page_status_card, parent, config, contextMenuManager); mTitleView = (TextView) itemView.findViewById(R.id.status_title); mBodyView = (TextView) itemView.findViewById(R.id.status_body); mActionView = (Button) itemView.findViewById(R.id.status_action_button); } /** * Interface for data items that will be shown in this card. */ public interface DataSource { /** * @return Resource ID for the header string. */ @StringRes int getHeader(); /** * @return Description string. */ String getDescription(); /** * @return Resource ID for the action label string, or 0 if the card does not have a label. */ @StringRes int getActionLabel(); /** * Called when the user clicks on the action button. * * @param context The context to execute the action in. */ void performAction(Context context); } public void onBindViewHolder(final DataSource item) { super.onBindViewHolder(); mTitleView.setText(item.getHeader()); mBodyView.setText(item.getDescription()); @IntegerRes int actionLabel = item.getActionLabel(); if (actionLabel != 0) { mActionView.setText(actionLabel); mActionView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { item.performAction(v.getContext()); } }); mActionView.setVisibility(View.VISIBLE); } else { mActionView.setVisibility(View.GONE); } } }
[ "hedonist.ky@gmail.com" ]
hedonist.ky@gmail.com
71be5b044baa1bcf5ddee9faf89ac470f6d073a9
51cf893b29e0025e86efc571a0b20fbbec43f744
/LuBanOne/app/src/main/java/com/example/administrator/lubanone/fragment/task/ReviewingTaskFragment.java
3389bd0c5bf7132ccbe6dc6b040d6c25e24631bb
[]
no_license
quyang-xianzaishi/mylib
1dfc3c141347a8eee5ad831efab5e18fb9d9f726
4cabe396090d820a58e6917f16e57a69cc6485b9
refs/heads/master
2018-09-29T16:19:05.253246
2018-07-15T15:52:46
2018-07-15T15:52:46
111,664,822
0
0
null
null
null
null
UTF-8
Java
false
false
5,637
java
package com.example.administrator.lubanone.fragment.task; import android.content.Intent; import android.view.View; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import com.example.administrator.lubanone.Config; import com.example.administrator.lubanone.MyApplication; import com.example.administrator.lubanone.R; import com.example.administrator.lubanone.activity.task.TaskDetailsActivity; import com.example.administrator.lubanone.adapter.task.TaskCommonListAdapter; import com.example.administrator.lubanone.bean.model.TaskModel; import com.example.administrator.lubanone.fragment.BaseFragment; import com.example.administrator.lubanone.rxjava.BaseModelFunc; import com.example.administrator.lubanone.rxjava.MySubscriber; import com.example.administrator.lubanone.utils.HouLog; import com.example.administrator.lubanone.utils.HouToast; import com.example.qlibrary.utils.SPUtils; import com.jingchen.pulltorefresh.PullToRefreshLayout; import com.jingchen.pulltorefresh.PullToRefreshLayout.OnPullListener; import com.jingchen.pulltorefresh.PullableImageView; import com.jingchen.pulltorefresh.PullableListView; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import rx.Subscriber; import rx.android.schedulers.AndroidSchedulers; import rx.schedulers.Schedulers; /** * Created by hou on 2017/8/24. */ public class ReviewingTaskFragment extends BaseFragment { private static final String TAG = "ReviewingTaskFragment"; private PullToRefreshLayout noDataLayout, listLayout; private PullableImageView noDataImage; private PullableListView mListView; private TaskCommonListAdapter mAdapter; private List<TaskModel.TaskList> datas; private int pageNo = 1; @Override public View initView() { View view = mInflater.inflate(R.layout.fragment_task_common, null); noDataImage = (PullableImageView) view.findViewById(R.id.task_common_no_data_image); noDataLayout = (PullToRefreshLayout) view.findViewById(R.id.task_common_no_data_layout); listLayout = (PullToRefreshLayout) view.findViewById(R.id.task_common_list_layout); mListView = (PullableListView) view.findViewById(R.id.task_common_list_view); MyRefreshListener myRefreshListener = new MyRefreshListener(); noDataLayout.setOnPullListener(myRefreshListener); noDataLayout.setPullUpEnable(false); listLayout.setOnPullListener(myRefreshListener); listLayout.setPullDownEnable(true); listLayout.setPullUpEnable(true); datas = new ArrayList<>(); mAdapter = new TaskCommonListAdapter(mActivity, datas); mListView.setAdapter(mAdapter); mListView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Intent intent = new Intent(getActivity(), TaskDetailsActivity.class); intent.putExtra("if_id", datas.get(position).getTaskid()); startActivity(intent); } }); return view; } class MyRefreshListener implements OnPullListener { @Override public void onRefresh(PullToRefreshLayout pullToRefreshLayout) { pageNo = 1; getDataFromServer(pullToRefreshLayout); } @Override public void onLoadMore(PullToRefreshLayout pullToRefreshLayout) { pageNo++; getDataFromServer(pullToRefreshLayout); } } @Override public void onResume() { super.onResume(); pageNo = 1; getDataFromServer(listLayout); } private void getDataFromServer(final PullToRefreshLayout refreshLayout) { Subscriber subscriber = new MySubscriber<TaskModel>(getActivity()) { @Override public void onCompleted() { } @Override public void onError(Throwable e) { super.onError(e); noDataLayout.setVisibility(View.VISIBLE); noDataImage.setImageResource(R.drawable.loading_fail); refreshLayout.refreshFinish(PullToRefreshLayout.FAIL); HouLog.d(TAG + "审核中任务列表onError", e.toString()); } @Override public void onNext(TaskModel taskModel) { noDataLayout.setVisibility(View.GONE); refreshLayout.refreshFinish(PullToRefreshLayout.SUCCEED); if (pageNo == 1) { datas.clear(); } if (taskModel != null && taskModel.getTasklist() != null && taskModel.getTasklist().size() > 0) { datas.addAll(taskModel.getTasklist()); HouLog.d(TAG, "返回数据个数: " + taskModel.getTasklist().size()); HouLog.d(TAG, "列表数据个数: " + datas.size()); } else { if (pageNo > 1) { HouToast.showLongToast(getActivity(), getInfo(R.string.no_more_message)); pageNo--; } else { noDataImage.setImageResource(R.drawable.no_data); noDataLayout.setVisibility(View.VISIBLE); } } mAdapter.notifyDataSetChanged(); HouLog.d(TAG + "页数:", String.valueOf(pageNo)); } }; Map<String, String> params = new HashMap<>(); params.put("token", SPUtils.getStringValue(mActivity, Config.USER_INFO, Config.TOKEN, "")); params.put("page", String.valueOf(pageNo)); params.put("type", "1"); HouLog.d(TAG, "任务列表.审核中任务参数:" + params.toString()); MyApplication.rxNetUtils.getTaskService().getTaskListTwo(params) .map(new BaseModelFunc<TaskModel>()) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(subscriber); } @Override public void initData() { } }
[ "quyang@xianzaishi.com" ]
quyang@xianzaishi.com
9d134c5a6f5071209808235b39e036cabb814c45
5fb9d5cd069f9df099aed99516092346ee3cf91a
/perf/src/main/java/org/teiid/test/teiid4201/TestSqlQuery.java
ffc45301d647deb4308fbd832ec56c8dec590c72
[]
no_license
kylinsoong/teiid-test
862e238e055481dfb14fb84694b316ae74174467
ea5250fa372c7153ad6e9a0c344fdcfcf10800cc
refs/heads/master
2021-04-19T00:31:41.173819
2017-10-09T06:41:00
2017-10-09T06:41:00
35,716,627
0
0
null
null
null
null
UTF-8
Java
false
false
1,930
java
package org.teiid.test.teiid4201; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.Properties; public class TestSqlQuery { String username="user"; String pwd=""; public void execute(String query) { System.out.println("Query:"+query); String url = "jdbc:teiid:apm_public@mm://localhost:54321"; Connection connection=null; Properties prop = new Properties(); prop.setProperty("FetchSize", "1"); prop.setProperty("user", username); prop.setProperty("Password", pwd); try{ Class.forName("org.teiid.jdbc.TeiidDriver"); connection = DriverManager.getConnection(url, prop); System.out.println("Connection ="+connection); Statement statement = connection.createStatement(); ResultSet results = statement.executeQuery(query); long n=0; while(results.next()) { ++n; } results.close(); statement.close(); System.out.println("Total number of record is :"+n); } catch (Exception e){ e.printStackTrace(); } finally { try{ connection.close(); }catch(SQLException e1){ // ignore } } } public static void main(String as[]){ new TestSqlQuery().execute("select * from public.share_market_data where frequency=5000 and ts between {ts '2016-04-08 01:00:00.0'} and {ts '2016-04-09 13:00:00.0'}"); } }
[ "kylinsoong.1214@gmail.com" ]
kylinsoong.1214@gmail.com
549890e2a627f18a541228da1f08a646967b90b9
4bbb3ece3857c7ac905091c2c01e5439e6a99780
/framework-payment/src/main/java/net/frank/framework/payment/alipay/AlipayUtil.java
e2dfc8bae2c1251c8e052ae3ac5ee51db711ac28
[]
no_license
frankzhf/dream
b98d77de2ea13209aed52a0499cced0be7b99d3c
c90edbdd8dcdb4b0e7c8c22c1fccdefadeb85791
refs/heads/master
2022-12-22T12:20:29.710989
2020-10-13T02:41:37
2020-10-13T02:41:37
38,374,538
0
1
null
2022-12-16T01:03:37
2015-07-01T14:06:19
JavaScript
UTF-8
Java
false
false
2,757
java
package net.frank.framework.payment.alipay; import java.math.BigDecimal; import java.util.List; import net.frank.commons.util.StringUtil; public final class AlipayUtil { /** * 获取批量退款单笔数据集 * @param items * @return */ public static String getRefundDetailDatas(List<RefundItem> items){ if(!items.isEmpty()){ StringBuilder sb = new StringBuilder(); for (RefundItem item : items) { sb.append("#").append(getRefundDetailData(item)); } return sb.substring(1); } return null; } /** * 获取退款单笔数据集 * @param item * @return */ public static String getRefundDetailData(RefundItem item){ if(StringUtil.isNotEmpty(item.getOriginAlipayTradeNo())&&null!=item.getRefundAmount()&&StringUtil.isNotEmpty(item.getRefundDesc())){ return item.getOriginAlipayTradeNo()+"^"+item.getRefundAmount().toString()+"^"+item.getRefundDesc(); } return null; } /** * 退款项信息 * 单笔交易退款次数不应该超过99次 */ public static class RefundItem{ //原支付宝交易号 private String originAlipayTradeNo; //退款金额 ,退款总金额不大于原交易付款金额 private BigDecimal refundAmount; //退款理由 ,剔除 ^ | $ # 字符,长度不应该超过256个字符 private String refundDesc; public RefundItem(String originAlipayTradeNo, BigDecimal refundAmount, String refundDesc) { this.originAlipayTradeNo = originAlipayTradeNo; this.refundAmount = refundAmount; if(StringUtil.isNotEmpty(refundDesc)){ refundDesc = refundDesc.replaceAll("[\\^\\|\\$#]","*"); } this.refundDesc = refundDesc; } public String getOriginAlipayTradeNo() { return originAlipayTradeNo; } public void setOriginAlipayTradeNo(String originAlipayTradeNo) { this.originAlipayTradeNo = originAlipayTradeNo; } public BigDecimal getRefundAmount() { return refundAmount; } public void setRefundAmount(BigDecimal refundAmount) { this.refundAmount = refundAmount; } public String getRefundDesc() { return refundDesc; } public void setRefundDesc(String refundDesc) { if(StringUtil.isNotEmpty(refundDesc)){ refundDesc = refundDesc.replaceAll("[\\^\\|\\$#]","*"); } this.refundDesc = refundDesc; } } }
[ "zhaofeng@ilinong.com" ]
zhaofeng@ilinong.com
e5391a5dd1efacd85ebaa23e7f64409a6d0f1f6d
66de872ffe864373ec1b669bd3e15e7b0d12a537
/instacapture/src/main/java/com/tarek360/instacapture/screenshot/ScreenshotTaker.java
3034b586acb246dcab7fd2c720b4b354075b576c
[ "Apache-2.0" ]
permissive
anasanasanas/InstaCapture
a6914cb5eb8ed84620c44040e847c0c8c8578757
5408c75671387fe1d6b89d515af9e5b6b4a2b25f
refs/heads/develop
2021-01-12T05:39:51.314179
2016-10-15T07:18:20
2016-10-15T07:18:20
77,161,408
1
0
null
2016-12-22T16:55:05
2016-12-22T16:55:05
null
UTF-8
Java
false
false
7,204
java
package com.tarek360.instacapture.screenshot; import android.app.Activity; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.PorterDuff; import android.graphics.PorterDuffXfermode; import android.opengl.GLES20; import android.opengl.GLSurfaceView; import android.os.Build; import android.support.annotation.RequiresApi; import android.view.TextureView; import android.view.View; import android.view.ViewGroup; import android.view.WindowManager; import com.tarek360.instacapture.exception.ScreenCapturingFailedException; import com.tarek360.instacapture.utility.Logger; import java.nio.IntBuffer; import java.util.ArrayList; import java.util.List; import java.util.concurrent.CountDownLatch; import javax.microedition.khronos.egl.EGL10; import javax.microedition.khronos.egl.EGLContext; import javax.microedition.khronos.opengles.GL10; /** * Created by tarek on 5/17/16. */ public final class ScreenshotTaker { private ScreenshotTaker() { } /** * Capture screenshot for the current activity and return bitmap of it. * * @param activity current activity. * @param ignoredViews from the screenshot. * @return Bitmap of screenshot. * @throws ScreenCapturingFailedException if unexpected error is occurred during capturing * screenshot */ public static Bitmap getScreenshotBitmap(Activity activity, View[] ignoredViews) { if (activity == null) { throw new IllegalArgumentException("Parameter activity cannot be null."); } final List<RootViewInfo> viewRoots = FieldHelper.getRootViews(activity); Logger.d("viewRoots count: " + viewRoots.size()); View main = activity.getWindow().getDecorView(); final Bitmap bitmap; try { bitmap = Bitmap.createBitmap(main.getWidth(), main.getHeight(), Bitmap.Config.ARGB_8888); } catch (final IllegalArgumentException e) { return null; } drawRootsToBitmap(viewRoots, bitmap, ignoredViews); return bitmap; } //static int count = 0 ; private static void drawRootsToBitmap(List<RootViewInfo> viewRoots, Bitmap bitmap, View[] ignoredViews) { //count = 0; for (RootViewInfo rootData : viewRoots) { drawRootToBitmap(rootData, bitmap, ignoredViews); } } private static void drawRootToBitmap(final RootViewInfo rootViewInfo, Bitmap bitmap, View[] ignoredViews) { // support dim screen if ((rootViewInfo.getLayoutParams().flags & WindowManager.LayoutParams.FLAG_DIM_BEHIND) == WindowManager.LayoutParams.FLAG_DIM_BEHIND) { Canvas dimCanvas = new Canvas(bitmap); int alpha = (int) (255 * rootViewInfo.getLayoutParams().dimAmount); dimCanvas.drawARGB(alpha, 0, 0, 0); } final Canvas canvas = new Canvas(bitmap); canvas.translate(rootViewInfo.getLeft(), rootViewInfo.getTop()); int[] ignoredViewsVisibility = null; if (ignoredViews != null) { ignoredViewsVisibility = new int[ignoredViews.length]; } if (ignoredViews != null) { for (int i = 0; i < ignoredViews.length; i++) { if (ignoredViews[i] != null) { ignoredViewsVisibility[i] = ignoredViews[i].getVisibility(); ignoredViews[i].setVisibility(View.INVISIBLE); } } } rootViewInfo.getView().draw(canvas); //Draw undrawable views drawUnDrawableViews(rootViewInfo.getView(), canvas); if (ignoredViews != null) { for (int i = 0; i < ignoredViews.length; i++) { if (ignoredViews[i] != null) { ignoredViews[i].setVisibility(ignoredViewsVisibility[i]); } } } } private static ArrayList<View> drawUnDrawableViews(View v, Canvas canvas) { if (!(v instanceof ViewGroup)) { ArrayList<View> viewArrayList = new ArrayList<>(); viewArrayList.add(v); return viewArrayList; } ArrayList<View> result = new ArrayList<>(); ViewGroup viewGroup = (ViewGroup) v; for (int i = 0; i < viewGroup.getChildCount(); i++) { View child = viewGroup.getChildAt(i); ArrayList<View> viewArrayList = new ArrayList<>(); viewArrayList.add(v); viewArrayList.addAll(drawUnDrawableViews(child, canvas)); if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH && child instanceof TextureView) { drawTextureView((TextureView) child, canvas); } if (child instanceof GLSurfaceView) { drawGLSurfaceView((GLSurfaceView) child, canvas); } result.addAll(viewArrayList); } return result; } private static void drawGLSurfaceView(GLSurfaceView surfaceView, Canvas canvas) { Logger.d("Drawing GLSurfaceView"); if (surfaceView.getWindowToken() != null) { int[] location = new int[2]; surfaceView.getLocationOnScreen(location); final int width = surfaceView.getWidth(); final int height = surfaceView.getHeight(); final int x = 0; final int y = 0; int[] b = new int[width * (y + height)]; final IntBuffer ib = IntBuffer.wrap(b); ib.position(0); //To wait for the async call to finish before going forward final CountDownLatch countDownLatch = new CountDownLatch(1); surfaceView.queueEvent(new Runnable() { @Override public void run() { EGL10 egl = (EGL10) EGLContext.getEGL(); egl.eglWaitGL(); GL10 gl = (GL10) egl.eglGetCurrentContext().getGL(); gl.glFinish(); try { Thread.sleep(200); } catch (InterruptedException e) { e.printStackTrace(); } gl.glReadPixels(x, 0, width, y + height, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, ib); countDownLatch.countDown(); } }); try { countDownLatch.await(); } catch (InterruptedException e) { e.printStackTrace(); } int[] bt = new int[width * height]; int i = 0; for (int k = 0; i < height; k++) { for (int j = 0; j < width; j++) { int pix = b[(i * width + j)]; int pb = pix >> 16 & 0xFF; int pr = pix << 16 & 0xFF0000; int pix1 = pix & 0xFF00FF00 | pr | pb; bt[((height - k - 1) * width + j)] = pix1; } i++; } Bitmap sb = Bitmap.createBitmap(bt, width, height, Bitmap.Config.ARGB_8888); Paint paint = new Paint(); paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_ATOP)); canvas.drawBitmap(sb, location[0], location[1], paint); sb.recycle(); } } @RequiresApi(api = Build.VERSION_CODES.ICE_CREAM_SANDWICH) private static void drawTextureView(TextureView textureView, Canvas canvas) { Logger.d("Drawing TextureView"); int[] textureViewLocation = new int[2]; textureView.getLocationOnScreen(textureViewLocation); Bitmap textureViewBitmap = textureView.getBitmap(); if (textureViewBitmap != null) { Paint paint = new Paint(); paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_ATOP)); canvas.drawBitmap(textureViewBitmap, textureViewLocation[0], textureViewLocation[1], paint); textureViewBitmap.recycle(); } } }
[ "ahmed.tarek@code95.com" ]
ahmed.tarek@code95.com
f8a05755363fed18cad4b589db54eb30b8f61ab7
ab5a734feba2d1471d77cca67b43b71bc928d95f
/Core/src/main/java/net/cogzmc/core/player/message/FClickAction.java
0c1ef41a384997d3495cfaef2704f348062a571e
[ "Apache-2.0" ]
permissive
TigerHix/Core
667a17a29be7ab146717644a78d30b00447339e8
925a08ac4b46e2e3eb02299fbef08265e228d861
refs/heads/master
2021-01-15T23:03:10.496337
2014-08-23T04:42:53
2014-08-23T04:42:53
23,252,675
2
0
null
null
null
null
UTF-8
Java
false
false
373
java
package net.cogzmc.core.player.message; import lombok.Data; import lombok.EqualsAndHashCode; @EqualsAndHashCode(callSuper = true) @Data public final class FClickAction extends FAction { private final String value; private final FClickActionType clickActionType; @Override protected String getAction() { return clickActionType.toString(); } }
[ "joey.sacchini264@gmail.com" ]
joey.sacchini264@gmail.com
48a71f324c287dacbe857eed6aa7e5306a9a2d36
4b533c1db53cb485f1981da02f57c0da0912d753
/com.syhan.rcp.geftut4/src/com/syhan/rcp/geftut4/editor/part/tree/EnterpriseTreeEditPart.java
99f7d053a9cbd8d5d704bdb660dbeaf72ef1eead
[]
no_license
Lareinahe/Exercise.gef
cd1705625f1c743db3864435d1bdedf31c98a7db
c699b9a4f1a71e03a47c8c18fe0bff75088c6da8
refs/heads/master
2021-12-09T16:23:49.737212
2016-06-02T08:50:46
2016-06-02T08:50:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
652
java
package com.syhan.rcp.geftut4.editor.part.tree; import java.beans.PropertyChangeEvent; import java.util.List; import com.syhan.rcp.geftut4.editor.model.Enterprise; import com.syhan.rcp.geftut4.editor.model.Node; public class EnterpriseTreeEditPart extends AppAbstractTreeEditPart { // @Override protected List<Node> getModelChildren() { // return ((Enterprise)getModel()).getChildren(); } @Override public void propertyChange(PropertyChangeEvent evt) { // if (evt.getPropertyName().equals(Node.PROPERTY_ADD)) { refreshChildren(); } if (evt.getPropertyName().equals(Node.PROPERTY_REMOVE)) { refreshChildren(); } } }
[ "syhan@nextree.co.kr" ]
syhan@nextree.co.kr
d7d3bdad674baadc781e21043b0c054760dd9c9a
a2ed12650e771e52ff94bea49710bd048fe38e21
/judge-impl/src/main/java/com/dwarfeng/judge/impl/service/telqos/EvaluateLocalCacheCommand.java
1234482391758c44579f642db066a36a48cbf79a
[ "Apache-2.0" ]
permissive
DwArFeng/judge
e36720f4018afc549c661e9d82966dcb489f69a3
801f99b9d34ce8783a1ceef17fde214544de1dce
refs/heads/master
2023-08-17T03:23:37.438421
2021-06-22T07:03:10
2021-06-22T07:03:10
251,041,700
0
0
Apache-2.0
2023-08-31T13:38:41
2020-03-29T13:42:43
Java
UTF-8
Java
false
false
4,060
java
package com.dwarfeng.judge.impl.service.telqos; import com.dwarfeng.judge.stack.bean.EvaluateInfo; import com.dwarfeng.judge.stack.bean.entity.JudgerInfo; import com.dwarfeng.judge.stack.handler.Judger; import com.dwarfeng.judge.stack.service.EvaluateQosService; import com.dwarfeng.springtelqos.sdk.command.CliCommand; import com.dwarfeng.springtelqos.stack.command.Context; import com.dwarfeng.springtelqos.stack.exception.TelqosException; import com.dwarfeng.subgrade.stack.bean.key.LongIdKey; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.Option; import org.apache.commons.cli.ParseException; import org.apache.commons.lang3.tuple.Pair; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.List; import java.util.Map; import java.util.Objects; @Component public class EvaluateLocalCacheCommand extends CliCommand { private static final Logger LOGGER = LoggerFactory.getLogger(EvaluateLocalCacheCommand.class); private static final String IDENTITY = "elc"; private static final String DESCRIPTION = "本地缓存操作"; private static final String CMD_LINE_SYNTAX_C = "elc -c"; private static final String CMD_LINE_SYNTAX_S = "elc -s section-id"; private static final String CMD_LINE_SYNTAX = CMD_LINE_SYNTAX_C + System.lineSeparator() + CMD_LINE_SYNTAX_S; public EvaluateLocalCacheCommand() { super(IDENTITY, DESCRIPTION, CMD_LINE_SYNTAX); } @Autowired private EvaluateQosService evaluateQosService; @Override protected List<Option> buildOptions() { return CommandUtils.buildLcOptions(); } @SuppressWarnings("DuplicatedCode") @Override protected void executeWithCmd(Context context, CommandLine cmd) throws TelqosException { try { Pair<String, Integer> pair = CommandUtils.analyseLcCommand(cmd); if (pair.getRight() != 1) { context.sendMessage("下列选项必须且只能含有一个: -c -s"); context.sendMessage(CMD_LINE_SYNTAX); return; } switch (pair.getLeft()) { case "c": handleC(context); break; case "s": handleS(context, cmd); break; } } catch (Exception e) { throw new TelqosException(e); } } private void handleC(Context context) throws Exception { evaluateQosService.clearLocalCache(); context.sendMessage("缓存已清空"); } @SuppressWarnings("DuplicatedCode") private void handleS(Context context, CommandLine cmd) throws Exception { long sectionId; try { sectionId = ((Number) cmd.getParsedOptionValue("s")).longValue(); } catch (ParseException e) { LOGGER.warn("解析命令选项时发生异常,异常信息如下", e); context.sendMessage("命令行格式错误,正确的格式为: " + CMD_LINE_SYNTAX_S); context.sendMessage("请留意选项 s 后接参数的类型应该是数字 "); return; } EvaluateInfo evaluateInfo = evaluateQosService.getContext(new LongIdKey(sectionId)); if (Objects.isNull(evaluateInfo)) { context.sendMessage("not exists!"); return; } context.sendMessage(String.format("section: %s", evaluateInfo.getSection().toString())); context.sendMessage(""); context.sendMessage("judgers:"); int index = 0; for (Map.Entry<JudgerInfo, Judger> entry : evaluateInfo.getJudgerMap().entrySet()) { if (index != 0) { context.sendMessage(""); } context.sendMessage(String.format(" %-3d %s", ++index, entry.getKey().toString())); context.sendMessage(String.format(" %-3d %s", index, entry.getValue().toString())); } } }
[ "915724865@qq.com" ]
915724865@qq.com
d7fbcd8692332811228c51fe5ab42a1a51099a09
6dbae30c806f661bcdcbc5f5f6a366ad702b1eea
/Corpus/tomcat70/985.java
73e72c04870affb1b379e501da2f647e6d69ab4a
[ "MIT" ]
permissive
SurfGitHub/BLIZZARD-Replication-Package-ESEC-FSE2018
d3fd21745dfddb2979e8ac262588cfdfe471899f
0f8f4affd0ce1ecaa8ff8f487426f8edd6ad02c0
refs/heads/master
2020-03-31T15:52:01.005505
2018-10-01T23:38:50
2018-10-01T23:38:50
152,354,327
1
0
MIT
2018-10-10T02:57:02
2018-10-10T02:57:02
null
UTF-8
Java
false
false
5,551
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.tomcat.util.http.fileupload.util; import java.io.FilterInputStream; import java.io.IOException; import java.io.InputStream; /** * An input stream, which limits its data size. This stream is * used, if the content length is unknown. */ public abstract class LimitedInputStream extends FilterInputStream implements Closeable { /** * The maximum size of an item, in bytes. */ private final long sizeMax; /** * The current number of bytes. */ private long count; /** * Whether this stream is already closed. */ private boolean closed; /** * Creates a new instance. * * @param inputStream The input stream, which shall be limited. * @param pSizeMax The limit; no more than this number of bytes * shall be returned by the source stream. */ public LimitedInputStream(InputStream inputStream, long pSizeMax) { super(inputStream); sizeMax = pSizeMax; } /** * Called to indicate, that the input streams limit has * been exceeded. * * @param pSizeMax The input streams limit, in bytes. * @param pCount The actual number of bytes. * @throws IOException The called method is expected * to raise an IOException. */ protected abstract void raiseError(long pSizeMax, long pCount) throws IOException; /** * Called to check, whether the input streams * limit is reached. * * @throws IOException The given limit is exceeded. */ private void checkLimit() throws IOException { if (count > sizeMax) { raiseError(sizeMax, count); } } /** * Reads the next byte of data from this input stream. The value * byte is returned as an <code>int</code> in the range * <code>0</code> to <code>255</code>. If no byte is available * because the end of the stream has been reached, the value * <code>-1</code> is returned. This method blocks until input data * is available, the end of the stream is detected, or an exception * is thrown. * <p> * This method * simply performs <code>in.read()</code> and returns the result. * * @return the next byte of data, or <code>-1</code> if the end of the * stream is reached. * @throws IOException if an I/O error occurs. * @see java.io.FilterInputStream#in */ @Override public int read() throws IOException { int res = super.read(); if (res != -1) { count++; checkLimit(); } return res; } /** * Reads up to <code>len</code> bytes of data from this input stream * into an array of bytes. If <code>len</code> is not zero, the method * blocks until some input is available; otherwise, no * bytes are read and <code>0</code> is returned. * <p> * This method simply performs <code>in.read(b, off, len)</code> * and returns the result. * * @param b the buffer into which the data is read. * @param off The start offset in the destination array * <code>b</code>. * @param len the maximum number of bytes read. * @return the total number of bytes read into the buffer, or * <code>-1</code> if there is no more data because the end of * the stream has been reached. * @throws NullPointerException If <code>b</code> is <code>null</code>. * @throws IndexOutOfBoundsException If <code>off</code> is negative, * <code>len</code> is negative, or <code>len</code> is greater than * <code>b.length - off</code> * @throws IOException if an I/O error occurs. * @see java.io.FilterInputStream#in */ @Override public int read(byte[] b, int off, int len) throws IOException { int res = super.read(b, off, len); if (res > 0) { count += res; checkLimit(); } return res; } /** * Returns, whether this stream is already closed. * * @return True, if the stream is closed, otherwise false. * @throws IOException An I/O error occurred. */ @Override public boolean isClosed() throws IOException { return closed; } /** * Closes this input stream and releases any system resources * associated with the stream. * This * method simply performs <code>in.close()</code>. * * @throws IOException if an I/O error occurs. * @see java.io.FilterInputStream#in */ @Override public void close() throws IOException { closed = true; super.close(); } }
[ "masudcseku@gmail.com" ]
masudcseku@gmail.com
fe96b392c9cf54125e3ebe2ffee3715758b16111
aa8085ea3aaf4cbbb938fac0ad95477d79c12e64
/subprojects/griffon-javafx/src/main/java/griffon/javafx/collections/DelegatingObservableSet.java
5ab7ae2525eebc35adc775bde56802d091890b39
[ "Apache-2.0" ]
permissive
griffon/griffon
3197c9ee3a5ee3bcb26418729f5c611f6f49c2d9
de3a5a7807478e750bfa7684f796ced42322f1aa
refs/heads/development
2023-09-04T16:34:08.308818
2021-11-06T23:19:37
2021-11-06T23:19:37
1,889,544
288
96
Apache-2.0
2020-04-30T19:14:02
2011-06-13T15:58:14
Java
UTF-8
Java
false
false
3,391
java
/* * SPDX-License-Identifier: Apache-2.0 * * Copyright 2008-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package griffon.javafx.collections; import griffon.annotations.core.Nonnull; import javafx.collections.ObservableSet; import javafx.collections.SetChangeListener; import javafx.collections.WeakSetChangeListener; import java.util.Collection; import java.util.Iterator; import static java.util.Objects.requireNonNull; /** * @author Andres Almiray * @since 2.9.0 */ public abstract class DelegatingObservableSet<E> extends ObservableSetBase<E> implements ObservableSet<E> { private final ObservableSet<E> delegate; private SetChangeListener<E> sourceListener; public DelegatingObservableSet(@Nonnull ObservableSet<E> delegate) { this.delegate = requireNonNull(delegate, "Argument 'delegate' must not be null"); this.delegate.addListener(new WeakSetChangeListener<>(getListener())); } @Nonnull protected ObservableSet<E> getDelegate() { return delegate; } private SetChangeListener<E> getListener() { if (sourceListener == null) { sourceListener = DelegatingObservableSet.this::sourceChanged; } return sourceListener; } protected abstract void sourceChanged(@Nonnull SetChangeListener.Change<? extends E> c); // --== Delegate methods ==-- @Override public int size() { return getDelegate().size(); } @Override public boolean isEmpty() { return getDelegate().isEmpty(); } @Override public boolean contains(Object o) { return getDelegate().contains(o); } @Override public Iterator<E> iterator() { return getDelegate().iterator(); } @Override public Object[] toArray() { return getDelegate().toArray(); } @Override public <T> T[] toArray(T[] a) { return getDelegate().toArray(a); } @Override public boolean add(E e) { return getDelegate().add(e); } @Override public boolean remove(Object o) { return getDelegate().remove(o); } @Override public boolean containsAll(Collection<?> c) { return getDelegate().containsAll(c); } @Override public boolean addAll(Collection<? extends E> c) { return getDelegate().addAll(c); } @Override public boolean retainAll(Collection<?> c) { return getDelegate().retainAll(c); } @Override public boolean removeAll(Collection<?> c) { return getDelegate().removeAll(c); } @Override public void clear() { getDelegate().clear(); } @Override public boolean equals(Object o) { return getDelegate().equals(o); } @Override public int hashCode() { return getDelegate().hashCode(); } }
[ "aalmiray@gmail.com" ]
aalmiray@gmail.com
300fe5641ca426e0f516f68b7b5f7da0f7a9a927
1c0fa98cfa725e6f0bbb29792a2ebaeb955bde6b
/fanyi/src/main/java/com/fypool/component/ScheduleComponent.java
90ce58ea19349d7656e1f13340496c63d674e62e
[]
no_license
mack-wang/project
043a17d97b747352d2d20ab8143188a26872cfaf
c7eec8ba9b87d24272511abb519754067e6e65e3
refs/heads/master
2021-09-01T06:59:51.084085
2017-12-25T14:34:40
2017-12-25T14:34:40
115,329,425
0
0
null
null
null
null
UTF-8
Java
false
false
2,674
java
package com.fypool.component; import com.fypool.controller.web.FileCleanController; import com.fypool.model.SmsNotify; import com.fypool.repository.AttributeRepository; import com.fypool.repository.FileCleanRepository; import com.fypool.repository.SmsNotifyRepository; import com.fypool.repository.TaskRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.io.support.ResourcePatternResolver; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import java.util.Date; @Component public class ScheduleComponent { @Autowired TaskRepository taskRepository; @Autowired SmsNotifyRepository smsNotifyRepository; @Autowired AttributeRepository attributeRepository; //这个类,可以用来读取/* /** /*/* 匹配型的目录和文件 @Autowired ResourcePatternResolver resourcePatternResolver; @Autowired FileCleanController fileCleanController; //每半小时执行一次,并且每次重新部署都会执行一次 //置顶到期后,半小时之间把置顶的1变回0 @Scheduled(fixedDelay = 30 * 60 * 1000) public void fixedDelayJob() { // System.out.println("定时任务正在执行"); taskRepository.updateTop(new Date()); } //每天0点整,将提醒短信的数量重置为0 @Scheduled(cron = "0 0 0 * * ?") public void cronJob() { smsNotifyRepository.updateUsed(); } //每周日早上4点整,清理每周文件,若出现问题大家加班解决,以便周一工作日不影响用户使用 @Scheduled(cron = "0 0 4 ? * 1") public void cleanEveryWeek() { fileCleanController.cleanAdvice(); fileCleanController.cleanAttachment(); fileCleanController.cleanAvatar(); fileCleanController.cleanCertificate(); fileCleanController.cleanIdCard(); fileCleanController.cleanLicense(); fileCleanController.cleanQrcode(); fileCleanController.cleanVipAttachment(); fileCleanController.cleanVipTask(); } // @Scheduled(fixedDelay=ONE_Minute) // public void fixedDelayJob(){ // System.out.println(Dates.format_yyyyMMddHHmmss(new Date())+" >>fixedDelay执行...."); // } // // @Scheduled(fixedRate=ONE_Minute) // public void fixedRateJob(){ // System.out.println(Dates.format_yyyyMMddHHmmss(new Date())+" >>fixedRate执行...."); // } // // @Scheduled(cron="0 15 3 * * ?") // public void cronJob(){ // System.out.println(Dates.format_yyyyMMddHHmmss(new Date())+" >>cron执行...."); // } //文件清理 }
[ "641212003@qq.com" ]
641212003@qq.com
88d3429fa89ee38809c8ad226218c3dda950cafa
1d928c3f90d4a0a9a3919a804597aa0a4aab19a3
/java/neo4j/2018/4/BatchOperationService.java
bd01ee7aa0c2cb0b41a5a0e5d7d0c113d1cbe62b
[]
no_license
rosoareslv/SED99
d8b2ff5811e7f0ffc59be066a5a0349a92cbb845
a062c118f12b93172e31e8ca115ce3f871b64461
refs/heads/main
2023-02-22T21:59:02.703005
2021-01-28T19:40:51
2021-01-28T19:40:51
306,497,459
1
1
null
2020-11-24T20:56:18
2020-10-23T01:18:07
null
UTF-8
Java
false
false
6,720
java
/* * Copyright (c) 2002-2018 "Neo Technology," * Network Engine for Objects in Lund AB [http://neotechnology.com] * * This file is part of Neo4j. * * Neo4j is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.neo4j.server.rest.web; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; import java.io.IOException; import java.io.InputStream; import java.util.Map; import javax.servlet.ServletOutputStream; import javax.servlet.WriteListener; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.core.Context; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.StreamingOutput; import javax.ws.rs.core.UriInfo; import org.neo4j.server.rest.batch.BatchOperationResults; import org.neo4j.server.rest.batch.NonStreamingBatchOperations; import org.neo4j.server.rest.repr.OutputFormat; import org.neo4j.server.rest.repr.RepresentationWriteHandler; import org.neo4j.server.rest.repr.StreamingFormat; import org.neo4j.server.web.HttpHeaderUtils; import org.neo4j.server.web.WebServer; import org.neo4j.udc.UsageData; import static org.neo4j.udc.UsageDataKeys.Features.http_batch_endpoint; import static org.neo4j.udc.UsageDataKeys.features; @Path( "/batch" ) public class BatchOperationService { private static final Logger LOGGER = Log.getLogger(BatchOperationService.class); private final OutputFormat output; private final WebServer webServer; private final UsageData usage; private RepresentationWriteHandler representationWriteHandler = RepresentationWriteHandler.DO_NOTHING; public BatchOperationService( @Context WebServer webServer, @Context OutputFormat output, @Context UsageData usage ) { this.output = output; this.webServer = webServer; this.usage = usage; } public void setRepresentationWriteHandler( RepresentationWriteHandler representationWriteHandler ) { this.representationWriteHandler = representationWriteHandler; } @POST public Response performBatchOperations( @Context UriInfo uriInfo, @Context HttpHeaders httpHeaders, @Context HttpServletRequest req, InputStream body ) { usage.get( features ).flag( http_batch_endpoint ); if ( isStreaming( httpHeaders ) ) { return batchProcessAndStream( uriInfo, httpHeaders, req, body ); } return batchProcess( uriInfo, httpHeaders, req, body ); } private Response batchProcessAndStream( final UriInfo uriInfo, final HttpHeaders httpHeaders, final HttpServletRequest req, final InputStream body ) { try { final StreamingOutput stream = output -> { try { final ServletOutputStream servletOutputStream = new ServletOutputStream() { @Override public void write( int i ) throws IOException { output.write( i ); } @Override public boolean isReady() { return true; } @Override public void setWriteListener( WriteListener writeListener ) { try { writeListener.onWritePossible(); } catch ( IOException e ) { // Ignore } } }; new StreamingBatchOperations( webServer ).readAndExecuteOperations( uriInfo, httpHeaders, req, body, servletOutputStream ); representationWriteHandler.onRepresentationWritten(); } catch ( Exception e ) { LOGGER.warn( "Error executing batch request ", e ); } finally { representationWriteHandler.onRepresentationFinal(); } }; return Response.ok(stream) .type( HttpHeaderUtils.mediaTypeWithCharsetUtf8(MediaType.APPLICATION_JSON_TYPE) ).build(); } catch ( Exception e ) { return output.serverError( e ); } } private Response batchProcess( UriInfo uriInfo, HttpHeaders httpHeaders, HttpServletRequest req, InputStream body ) { try { NonStreamingBatchOperations batchOperations = new NonStreamingBatchOperations( webServer ); BatchOperationResults results = batchOperations.performBatchJobs( uriInfo, httpHeaders, req, body ); Response res = Response.ok().entity(results.toJSON()) .type(HttpHeaderUtils.mediaTypeWithCharsetUtf8(MediaType.APPLICATION_JSON_TYPE)).build(); representationWriteHandler.onRepresentationWritten(); return res; } catch ( Exception e ) { return output.serverError( e ); } finally { representationWriteHandler.onRepresentationFinal(); } } private boolean isStreaming( HttpHeaders httpHeaders ) { if ( "true".equalsIgnoreCase( httpHeaders.getRequestHeaders().getFirst( StreamingFormat.STREAM_HEADER ) ) ) { return true; } for ( MediaType mediaType : httpHeaders.getAcceptableMediaTypes() ) { Map<String, String> parameters = mediaType.getParameters(); if ( parameters.containsKey( "stream" ) && "true".equalsIgnoreCase( parameters.get( "stream" ) ) ) { return true; } } return false; } }
[ "rodrigosoaresilva@gmail.com" ]
rodrigosoaresilva@gmail.com
bd92d7c22a9dea583f6fdaeac342c44a6a9abe55
ec3d38beb8b58093c4b69902e23094aa9c44ab08
/src/main/java/com/mall/dao/ProductMapper.java
45d6351fc2fdc7e702fc1fa776f2b06ebf7712ae
[]
no_license
chuckma/mall_learn
75987ea70c826f72fb85b52585d3f6e0dfd923ea
d9b119677461cae8ab6197f533de6c85fc707a74
refs/heads/master
2021-01-19T22:49:04.770003
2018-06-13T13:05:36
2018-06-13T13:05:36
88,873,908
2
0
null
2018-06-13T13:05:37
2017-04-20T14:18:27
Java
UTF-8
Java
false
false
870
java
package com.mall.dao; import com.mall.pojo.Product; import org.apache.ibatis.annotations.Param; import java.util.List; public interface ProductMapper { int deleteByPrimaryKey(Integer id); int insert(Product record); int insertSelective(Product record); Product selectByPrimaryKey(Integer id); int updateByPrimaryKeySelective(Product record); int updateByPrimaryKey(Product record); List<Product> selectList(); List<Product> selectByNameAndProductId(@Param("productName") String productName, @Param("productId") Integer productId); List<Product> selectByNameAndCategoryIds(@Param("productName") String productName, @Param("categoryIdList") List<Integer> categoryIdList); // 此处一定要用Integer ,因为int 无法为null,考虑到很多商品已经删除的情况. Integer selectStockByProductId(Integer id); }
[ "robbincen@163.com" ]
robbincen@163.com
7ab12acbd24d79a7e14124409a1880459e35f857
d81f128a33dd66a11b74e929cb6637b4d73b1c09
/Saffron_OSGI/.svn/pristine/5d/5d66c8422f50c629e3ea5753357d4aa2f37793ab.svn-base
8792cf57ac4375adcf79c48d413287c4e7c064bb
[]
no_license
deepakdinakaran86/poc
f56e146f01b66fd5231b3e16d1e5bf55ae4405c6
9aa4f845d3355f6ce8c5e205d42d66a369f671bb
refs/heads/master
2020-04-03T10:05:08.550330
2016-08-11T06:57:57
2016-08-11T06:57:57
65,439,459
0
1
null
null
null
null
UTF-8
Java
false
false
4,442
/** * */ package com.pcs.device.gateway.ruptela.config; /** * @author pcseg310 * */ public interface PropertyKeys { static final String CACHE_PROVIDER = "ruptela.devicemanager.cacheprovider"; static final String CACHE_PROVIDER_CONFIG_PATH = "ruptela.devicemanager.cacheprovider.config.path"; static final String DEVICE_COMMAND_CACHE = "ruptela.command.cache"; static final String DEVICE_SESSION_CACHE = "ruptela.devicemanager.cache.session"; static final String DEVICE_SESSION_CACHE_TIMEOUT = "ruptela.devicemanager.cache.session.timeout"; static final String DEVICE_CONFIGURATION_CACHE = "ruptela.devicemanager.cache.configuration"; static final String DEVICE_KEYS_CACHE = "ruptela.devicemanager.cache.keys"; static final String DEVICE_POINTS_PROTOCOL_CACHE = "ruptela.devicemanager.cache.points.protocol"; static final String REMOTE_PLATFORM_IP = "ruptela.devicemanager.remote.platform.hostIp"; static final String REMOTE_PLATFORM_PORT = "ruptela.devicemanager.remote.platform.port"; static final String REMOTE_PLATFORM_SCHEME = "ruptela.devicemanager.remote.platform.scheme"; static final String AUTHENTICATION_URL = "ruptela.devicemanager.remote.authentication.url"; static final String CONFIGURATION_URL = "ruptela.devicemanager.remote.configuration.url"; static final String DATASOURCE_REGISTER_URL = "ruptela.devicemanager.datasource.register.url"; static final String DATASOURCE_UPDATE_URL = "ruptela.devicemanager.datasource.update.url"; static final String DATASOURCE_PUBLISH_URL = "ruptela.devicemanager.datasource.publish.url"; static final String DATASOURCE_PLATFORM_IP ="ruptela.devicemanager.datasource.platform.hostIp"; static final String DATASOURCE_PLATFORM_PORT="ruptela.devicemanager.datasource.platform.port"; static final String ENTITY_PLATFORM_IP ="ruptela.devicemanager.entity.platform.hostIp"; static final String ENTITY_PLATFORM_PORT="ruptela.devicemanager.entity.platform.port"; static final String DEVICE_DATASOURCE_UPDATE_URL = "ruptela.devicemanager.device.datasource.update.url"; static final String DATADISTRIBUTOR_IP="ruptela.devicemanager.datadistributor.ip"; static final String DATADISTRIBUTOR_REGISTRY_NAME = "ruptela.devicemanager.datadistributor.registryname"; static final String ANALYZED_MESSAGE_STREAM= "ruptela.devicemanager.datadistributor.analyzedmessagestream"; static final String DECODED_MESSAGE_STREAM = "ruptela.devicemanager.datadistributor.decodedmessagestream"; static final String DATADISTRIBUTOR_PORT = "ruptela.devicemanager.datadistributor.port"; static final String DEVICE_PROTOCOL_POINTS_URL = "ruptela.devicemanager.datasource.device.points"; //Gateway configurations static final String START_MODE = "ruptela.devicegateway.startmode"; static final String START_WITH_DELAY = "ruptela.devicegateway.startwithdelay"; static final String TCP_DATA_SERVER_DOMAIN = "ruptela.devicegateway.tcp.dataserverdomain"; static final String TCP_DATA_SERVER_IP = "ruptela.devicegateway.tcp.dataserverip"; static final String TCP_DATA_SERVER_PORT = "ruptela.devicegateway.tcp.dataserverport"; static final String TCP_CONTROL_SERVER_PORT = "ruptela.devicegateway.tcp.controlserverport"; static final String TCP_DATA_COMMAND_PORT = "ruptela.devicegateway.tcp.commandport"; static final String UDP_DATA_SERVER_DOMAIN = "ruptela.devicegateway.udp.dataserverdomain"; static final String UDP_DATA_SERVER_IP = "ruptela.devicegateway.udp.dataserverip"; static final String UDP_DATA_SERVER_PORT = "ruptela.devicegateway.udp.dataserverport"; static final String UDP_CONTROL_SERVER_PORT = "ruptela.devicegateway.udp.controlserverport"; static final String UDP_DATA_COMMAND_PORT = "ruptela.devicegateway.udp.commandport"; static final String DATA_DISTRIBUTOR_IP = "ruptela.devicegateway.datadistributor.ip"; static final String DATA_DISTRIBUTOR_PORT = "ruptela.devicegateway.datadistributor.port"; static final String REALTIME_DATA_PERSIST_TOPIC ="ruptela.devicegateway.realtime.persist.topic"; static final String COMMAND_REGISTER_URL = "ruptela.devicegateway.command.register.url"; static final String COMMAND_REGISTER = "ruptela.devicegateway.command.register"; static final String FMXXX_MODEL = "FMS"; static final String FMXXX_PROTOCOL = "FMPRO"; static final String FMXXX_TYPE = "Telematics"; static final String FMXXX_VENDOR = "Ruptela"; static final String FMXXX_VERSION = "1.02"; static final String DIAG_ENABLE="diag.enable"; }
[ "PCSEG288@pcs.com" ]
PCSEG288@pcs.com
fdf2eb4144ad02a87de01306679a1edb4ebe7838
667728b86381407d7e775403a06a3ea4b3404d7f
/src/main/java/com/myself/wechatfileupload/util/HttpServletRequestUtil.java
08a8e443c33ece6c32b72cae54d7f5c699b4f63b
[]
no_license
gotheworld/SBToWxFileUpload
1d89b5130ee525105ee9218e9855b02d5d1f992e
107874a8b66a130132922e52485a508e089bc83b
refs/heads/master
2021-09-20T16:15:18.116297
2018-08-12T08:45:07
2018-08-12T08:45:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,312
java
package com.myself.wechatfileupload.util; import javax.servlet.http.HttpServletRequest; /** * @Author:UncleCatMySelf * @Email:zhupeijie_java@126.com * @QQ:1341933031 * @Date:Created in 11:14 2018\8\11 0011 */ public class HttpServletRequestUtil { public static int getInt(HttpServletRequest request, String key) { try { return Integer.decode(request.getParameter(key)); } catch (Exception e) { return -1; } } public static long getLong(HttpServletRequest request, String key) { try { return Long.valueOf(request.getParameter(key)); } catch (Exception e) { return -1; } } public static Double getDouble(HttpServletRequest request, String key) { try { return Double.valueOf(request.getParameter(key)); } catch (Exception e) { return -1d; } } public static boolean getBoolean(HttpServletRequest request, String key) { try { return Boolean.valueOf(request.getParameter(key)); } catch (Exception e) { return false; } } public static String getString(HttpServletRequest request, String key) { try { String result = request.getParameter(key); if (result != null) { result = result.trim(); } if ("".equals(result)) { result = null; } return result; } catch (Exception e) { return null; } } public static String getObjectArray(HttpServletRequest request, String key){ try { String newResult = ""; String[] arrays = request.getParameterValues(key); System.err.println("arrays.toString(): " + arrays.toString()); if (arrays != null){ StringBuffer stringBuffer = new StringBuffer(); for (int i = 0; i < arrays.length; i++){ stringBuffer.append(arrays[i]); } newResult = stringBuffer.toString(); } return newResult; } catch (Exception e) { return null; } } }
[ "awakeningcode@126.com" ]
awakeningcode@126.com
e59a0c16553859c42353b72393a5b898987a90e4
7e1511cdceeec0c0aad2b9b916431fc39bc71d9b
/flakiness-predicter/input_data/original_tests/doanduyhai-Achilles/nonFlakyMethods/info.archinnov.achilles.test.integration.tests.ClusteredEntityIT-should_iterate_over_clusterings_components.java
72256f475e1d481e3dfda85d7e73796e4e5778bd
[ "BSD-3-Clause" ]
permissive
Taher-Ghaleb/FlakeFlagger
6fd7c95d2710632fd093346ce787fd70923a1435
45f3d4bc5b790a80daeb4d28ec84f5e46433e060
refs/heads/main
2023-07-14T16:57:24.507743
2021-08-26T14:50:16
2021-08-26T14:50:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,399
java
@Test public void should_iterate_over_clusterings_components() throws Exception { long partitionKey=RandomUtils.nextLong(); insertClusteredEntity(partitionKey,1,"name11","val11"); insertClusteredEntity(partitionKey,1,"name12","val12"); insertClusteredEntity(partitionKey,1,"name13","val13"); insertClusteredEntity(partitionKey,2,"name21","val21"); insertClusteredEntity(partitionKey,2,"name22","val22"); insertClusteredEntity(partitionKey,3,"name31","val31"); insertClusteredEntity(partitionKey,4,"name41","val41"); final Iterator<ClusteredEntity> iterator=manager.sliceQuery(ClusteredEntity.class).partitionComponents(partitionKey).fromClusterings(1).bounding(INCLUSIVE_START_BOUND_ONLY).limit(6).iterator(2); assertThat(iterator.hasNext()).isTrue(); assertThat(iterator.next().getValue()).isEqualTo("val11"); assertThat(iterator.hasNext()).isTrue(); assertThat(iterator.next().getValue()).isEqualTo("val12"); assertThat(iterator.hasNext()).isTrue(); assertThat(iterator.next().getValue()).isEqualTo("val13"); assertThat(iterator.hasNext()).isTrue(); assertThat(iterator.next().getValue()).isEqualTo("val21"); assertThat(iterator.hasNext()).isTrue(); assertThat(iterator.next().getValue()).isEqualTo("val22"); assertThat(iterator.hasNext()).isTrue(); assertThat(iterator.next().getValue()).isEqualTo("val31"); assertThat(iterator.hasNext()).isFalse(); }
[ "aalsha2@masonlive.gmu.edu" ]
aalsha2@masonlive.gmu.edu
2ab70bbb4109f37bface4017e20ceb5442d68707
cbbd05b152eacc7be1ee686426129f38409d39d6
/src/main/java/edu/eci/pdsw/persistence/PacienteDAO.java
5f4da2795adba7ad534b515964ac720a632a5811
[]
no_license
JuanMorenoS/Laboratorio5
245c3e43e9f2ee0704149513bd6b8844df8f0c62
8de9e64163785ae578e3dbe01d2839069a2bca72
refs/heads/master
2021-07-10T10:36:53.989419
2017-10-12T18:00:41
2017-10-12T18:00:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
639
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package edu.eci.pdsw.persistence; import edu.eci.pdsw.samples.entities.Paciente; import java.util.List; /** * * @author blackphantom */ public interface PacienteDAO { public List<Paciente> load() throws PersistenceException; public Paciente loadById(int id,String tipoId) throws PersistenceException; public void save(Paciente p) throws PersistenceException ; public void update(Paciente p) throws PersistenceException; }
[ "=" ]
=
917386175036097910e02cf2fe0f9f1432c0d3f7
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/6/6_afd78e3e9259653ff8a7fa7265537a96b5cc2e54/InputEventProvider/6_afd78e3e9259653ff8a7fa7265537a96b5cc2e54_InputEventProvider_s.java
621ab0a667251f30e119c0477426ca169547004b
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
4,014
java
/******************************************************************************* * Copyright (c) 2008, 2009 Bug Labs, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * - Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - Neither the name of Bug Labs, Inc. nor the names of its contributors may be * used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ package com.buglabs.bug.input.pub; import java.util.ArrayList; import java.util.ConcurrentModificationException; import java.util.Iterator; import org.osgi.service.log.LogService; import com.buglabs.bug.jni.common.FCNTL_H; import com.buglabs.bug.jni.input.InputDevice; import com.buglabs.bug.jni.input.InputEvent; import com.buglabs.device.ButtonEvent; import com.buglabs.device.IButtonEventListener; import com.buglabs.device.IButtonEventProvider; public class InputEventProvider extends Thread implements IButtonEventProvider { private ArrayList listeners; private final LogService log; private String inputDevice; public InputEventProvider(String inputDevice, LogService log) { this.log = log; listeners = new ArrayList(); this.inputDevice = inputDevice; } public void addListener(IButtonEventListener listener) { synchronized (listeners) { if (!listeners.contains(listener)) { listeners.add(listener); } } } public void removeListener(IButtonEventListener listener) { synchronized (listeners) { listeners.remove(listener); } } public void run() { InputDevice dev = new InputDevice(); if (dev.open(inputDevice, FCNTL_H.O_RDWR) < 0) { log.log(LogService.LOG_ERROR, "Unable to open input device: " + inputDevice); } while (!isInterrupted()) { try { InputEvent[] inputEvents = dev.readEvents(); synchronized (listeners) { Iterator iter = listeners.iterator(); for (int i = 0; i < inputEvents.length; ++i) { ButtonEvent b = new ButtonEvent(inputEvents[i].code, 0, inputEvents[i].code, convertButtonAction(inputEvents[i].value), this.getClass().toString()); while (iter.hasNext()) { IButtonEventListener l = (IButtonEventListener) iter.next(); l.buttonEvent(b); } } } } catch (ConcurrentModificationException e) { log.log(LogService.LOG_ERROR, "Concurrency issue", e); } } dev.close(); } private long convertButtonAction(long value) { if (value == 1) { return ButtonEvent.KEY_DOWN; } if (value == 0) { return ButtonEvent.KEY_UP; } return value; } public void tearDown() { interrupt(); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
8173ba344a7267d6887b6258e9c760bc052df928
b9a14875c2c2983bf940a63c66d46e9580b8eabe
/modules/framework/src/main/java/io/cattle/platform/async/retry/Retry.java
1b5ea57b5d4f3e81fab5787da4538f5b6b972b65
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
bartoszcisek/cattle
a341d93dc4feb010c9b1efe07b4ddb665f952391
f59058d70fdb139f9259c2e3d697c0f57b615862
refs/heads/master
2020-03-21T17:37:16.010693
2017-10-17T19:01:18
2017-10-17T19:01:18
138,843,076
0
0
Apache-2.0
2018-06-27T07:05:59
2018-06-27T07:05:58
null
UTF-8
Java
false
false
1,082
java
package io.cattle.platform.async.retry; import java.util.concurrent.Future; public class Retry { int retryCount; int retries; Long timeoutMillis; Runnable runnable; Future<?> future; boolean keepalive = false; public Retry(int retries, Long timeoutMillis, Future<?> future, Runnable runnable) { super(); this.retryCount = 0; this.retries = retries; this.timeoutMillis = timeoutMillis; this.runnable = runnable; this.future = future; } public int getRetryCount() { return retryCount; } public int getRetries() { return retries; } public Long getTimeoutMillis() { return timeoutMillis; } public Runnable getRunnable() { return runnable; } public Future<?> getFuture() { return future; } public int increment() { return ++retryCount; } public void setKeepalive(boolean keepalive) { this.keepalive = keepalive; } public boolean isKeepalive() { return keepalive; } }
[ "darren.s.shepherd@gmail.com" ]
darren.s.shepherd@gmail.com
e0b9fdd681645bcaca3b6e35cdee377ef1d78771
4a377af1007965606623a073d9ab6841c21bb235
/s2-tiger/src/main/java/org/seasar/extension/dxo/converter/impl/EnumConverter.java
721c34ac1c897601ea2bbc334b37e48140736517
[ "Apache-2.0" ]
permissive
ngoclt-28/seasar2
52de6eee1eead3f15f063d4c9f0b2a2d96f9a32c
48b637c58b5bb777cff16595659b6f5b9d6e730a
refs/heads/master
2021-01-18T13:28:45.120427
2014-12-06T18:08:51
2014-12-06T18:08:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,680
java
/* * Copyright 2004-2014 the Seasar Foundation and the Others. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package org.seasar.extension.dxo.converter.impl; import org.seasar.extension.dxo.converter.ConversionContext; /** * 数値または文字列から列挙定数へ変換するコンバータです。 * * @author koichik */ @SuppressWarnings("unchecked") public class EnumConverter extends AbstractConverter { public Class getDestClass() { return Enum.class; } public Class[] getSourceClasses() { return new Class[] { Object.class }; } public Object convert(Object source, Class destClass, ConversionContext context) { if (source == null) { return null; } if (source.getClass() == destClass) { return source; } if (source instanceof Number) { final int ordinal = Number.class.cast(source).intValue(); return destClass.getEnumConstants()[ordinal]; } final String name = source.toString(); return Enum.valueOf(destClass, name); } }
[ "koichik@improvement.jp" ]
koichik@improvement.jp
bf13c81ca9a7907356c80cb39ea61e1a9831c81d
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/7/7_50b864a3743af99c6028537e0d09e49a69cea78c/TextViewEx/7_50b864a3743af99c6028537e0d09e49a69cea78c_TextViewEx_t.java
1456199ca0811a219050a6d1702581f3fad09afd
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
5,912
java
package com.example.textjustify; import com.fscz.util.TextJustifyUtils; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Bitmap.Config; import android.graphics.Canvas; import android.graphics.Paint; import android.widget.TextView; import android.util.AttributeSet; /* * * TextViewEx.java * @author Mathew Kurian * * !-- Requires -- ! * TextJustifyUtils.java * * From TextJustify-Android Library v1.0.2 * https://github.com/bluejamesbond/TextJustify-Android * * Please report any issues * https://github.com/bluejamesbond/TextJustify-Android/issues * * Date: 12/13/2013 12:28:16 PM * */ public class TextViewEx extends TextView { private Paint paint = new Paint(); private String [] blocks; private float spaceOffset = 0; private float horizontalOffset = 0; private float verticalOffset = 0; private float horizontalFontOffset = 0; private float dirtyRegionWidth = 0; private boolean wrapEnabled = false; private float strecthOffset; private float wrappedEdgeSpace; private String block; private String wrappedLine; private String [] lineAsWords; private Object[] wrappedObj; private Bitmap cache = null; private boolean cacheEnabled = false; public TextViewEx(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public TextViewEx(Context context, AttributeSet attrs) { super(context, attrs); } public TextViewEx(Context context) { super(context); } @Override public void setDrawingCacheEnabled(boolean cacheEnabled) { this.cacheEnabled = cacheEnabled; } public void setText(String st, boolean wrap) { wrapEnabled = wrap; super.setText(st); } @Override protected void onDraw(Canvas canvas) { // If wrap is disabled then, // request original onDraw if(!wrapEnabled) { super.onDraw(canvas); return; } // Active canas needs to be set // based on cacheEnabled Canvas activeCanvas = null; // Set the active canvas based on // whether cache is enabled if (cacheEnabled) { if (cache != null) { // Draw to the OS provided canvas // if the cache is not empty canvas.drawBitmap(cache, 0, 0, paint); return; } else { // Create a bitmap and set the activeCanvas // to the one derived from the bitmap cache = Bitmap.createBitmap(getWidth(), getHeight(), Config.ARGB_4444); activeCanvas = new Canvas(cache); } } else { // Active canvas is the OS // provided canvas activeCanvas = canvas; } // Pull widget properties paint.setColor(getCurrentTextColor()); paint.setTypeface(getTypeface()); paint.setTextSize(getTextSize()); dirtyRegionWidth = getWidth(); int maxLines = Integer.MAX_VALUE; int currentapiVersion = android.os.Build.VERSION.SDK_INT; if (currentapiVersion >= android.os.Build.VERSION_CODES.JELLY_BEAN){ maxLines = getMaxLines(); } int lines = 1; blocks = getText().toString().split("((?<=\n)|(?=\n))"); verticalOffset = horizontalFontOffset = getLineHeight() - 0.5f; // Temp fix spaceOffset = paint.measureText(" "); for(int i = 0; i < blocks.length && lines <= maxLines; i++) { block = blocks[i]; horizontalOffset = 0; if(block.length() == 0) { continue; } else if(block.equals("\n")) { verticalOffset += horizontalFontOffset; continue; } block = block.trim(); if(block.length() == 0) { continue; } wrappedObj = TextJustifyUtils.createWrappedLine(block, paint, spaceOffset, dirtyRegionWidth); wrappedLine = ((String) wrappedObj[0]); wrappedEdgeSpace = (Float) wrappedObj[1]; lineAsWords = wrappedLine.split(" "); strecthOffset = wrappedEdgeSpace != Float.MIN_VALUE ? wrappedEdgeSpace/(lineAsWords.length - 1) : 0; for(int j = 0; j < lineAsWords.length; j++) { String word = lineAsWords[j]; if (lines == maxLines && j == lineAsWords.length - 1) { activeCanvas.drawText("...", horizontalOffset, verticalOffset, paint); } else { activeCanvas.drawText(word, horizontalOffset, verticalOffset, paint); } horizontalOffset += paint.measureText(word) + spaceOffset + strecthOffset; } lines++; if(blocks[i].length() > 0) { blocks[i] = blocks[i].substring(wrappedLine.length()); verticalOffset += blocks[i].length() > 0 ? horizontalFontOffset : 0; i--; } } if (cacheEnabled) { // Draw the cache onto the OS provided // canvas. canvas.drawBitmap(cache, 0, 0, paint); } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
1988840ac9bfb8411b0e69436e8695ee3f6bd8f4
2eefae8e048e87904c5c2e1844a8e5174b7257bb
/commercetools-models/src/main/java/io/sphere/sdk/products/queries/ProductProjectionByIdGetImpl.java
77e882e477541a02788e829ea9eac6966625d726
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
francescaramsey/commercetools-jvm-sdk
a475ddbd518475e45fdf93a0fb632ef75c163171
3ae0afe51ba9d30a5f63f93cdebccbb9e5df993d
refs/heads/master
2022-04-14T02:57:15.873756
2020-03-31T11:11:11
2020-03-31T11:11:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,008
java
package io.sphere.sdk.products.queries; import io.sphere.sdk.http.NameValuePair; import io.sphere.sdk.products.ProductProjection; import io.sphere.sdk.products.ProductProjectionType; import io.sphere.sdk.products.expansion.ProductProjectionExpansionModel; import io.sphere.sdk.products.search.PriceSelection; import io.sphere.sdk.queries.MetaModelGetDslBuilder; import io.sphere.sdk.queries.MetaModelGetDslImpl; import javax.annotation.Nullable; import java.util.Collections; import java.util.List; import static io.sphere.sdk.products.search.PriceSelectionQueryParameters.extractPriceSelectionFromHttpQueryParameters; import static io.sphere.sdk.products.search.PriceSelectionQueryParameters.getQueryParametersWithPriceSelection; final class ProductProjectionByIdGetImpl extends MetaModelGetDslImpl<ProductProjection, ProductProjection, ProductProjectionByIdGet, ProductProjectionExpansionModel<ProductProjection>> implements ProductProjectionByIdGet { ProductProjectionByIdGetImpl(final String id, final ProductProjectionType projectionType) { super(ProductProjectionEndpoint.ENDPOINT, id, ProductProjectionExpansionModel.of(), ProductProjectionByIdGetImpl::new, Collections.singletonList(NameValuePair.of("staged", projectionType.isStaged().toString()))); } public ProductProjectionByIdGetImpl(MetaModelGetDslBuilder<ProductProjection, ProductProjection, ProductProjectionByIdGet, ProductProjectionExpansionModel<ProductProjection>> builder) { super(builder); } @Override public ProductProjectionByIdGet withPriceSelection(@Nullable final PriceSelection priceSelection) { final List<NameValuePair> resultingParameters = getQueryParametersWithPriceSelection(priceSelection, additionalQueryParameters()); return withAdditionalQueryParameters(resultingParameters); } @Nullable @Override public PriceSelection getPriceSelection() { return extractPriceSelectionFromHttpQueryParameters(additionalQueryParameters()); } }
[ "michael.schleichardt@commercetools.de" ]
michael.schleichardt@commercetools.de
97657d561c189c895776dd61c7cf454d3f85901f
c8a7974ebdf8c2f2e7cdc34436d667e3f1d29609
/src/main/java/com/tencentcloudapi/redis/v20180412/models/InstanceIntegerParam.java
28a6544265915f1d0b166a266f5c4efd80cc1188
[ "Apache-2.0" ]
permissive
TencentCloud/tencentcloud-sdk-java-en
d6f099a0de82ffd3e30d40bf7465b9469f88ffa6
ba403db7ce36255356aeeb4279d939a113352990
refs/heads/master
2023-08-23T08:54:04.686421
2022-06-28T08:03:02
2022-06-28T08:03:02
193,018,202
0
3
Apache-2.0
2022-06-28T08:03:04
2019-06-21T02:40:54
Java
UTF-8
Java
false
false
6,409
java
/* * Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.tencentcloudapi.redis.v20180412.models; import com.tencentcloudapi.common.AbstractModel; import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.Expose; import java.util.HashMap; public class InstanceIntegerParam extends AbstractModel{ /** * Parameter name */ @SerializedName("ParamName") @Expose private String ParamName; /** * Parameter type: Integer */ @SerializedName("ValueType") @Expose private String ValueType; /** * Whether restart is required after a modification is made. Value range: true, false */ @SerializedName("NeedRestart") @Expose private String NeedRestart; /** * Default value of the parameter */ @SerializedName("DefaultValue") @Expose private String DefaultValue; /** * Current value of a parameter */ @SerializedName("CurrentValue") @Expose private String CurrentValue; /** * Parameter description */ @SerializedName("Tips") @Expose private String Tips; /** * Minimum value of a parameter */ @SerializedName("Min") @Expose private String Min; /** * Maximum value of a parameter */ @SerializedName("Max") @Expose private String Max; /** * Parameter status. 1: modifying; 2: modified */ @SerializedName("Status") @Expose private Long Status; /** * Get Parameter name * @return ParamName Parameter name */ public String getParamName() { return this.ParamName; } /** * Set Parameter name * @param ParamName Parameter name */ public void setParamName(String ParamName) { this.ParamName = ParamName; } /** * Get Parameter type: Integer * @return ValueType Parameter type: Integer */ public String getValueType() { return this.ValueType; } /** * Set Parameter type: Integer * @param ValueType Parameter type: Integer */ public void setValueType(String ValueType) { this.ValueType = ValueType; } /** * Get Whether restart is required after a modification is made. Value range: true, false * @return NeedRestart Whether restart is required after a modification is made. Value range: true, false */ public String getNeedRestart() { return this.NeedRestart; } /** * Set Whether restart is required after a modification is made. Value range: true, false * @param NeedRestart Whether restart is required after a modification is made. Value range: true, false */ public void setNeedRestart(String NeedRestart) { this.NeedRestart = NeedRestart; } /** * Get Default value of the parameter * @return DefaultValue Default value of the parameter */ public String getDefaultValue() { return this.DefaultValue; } /** * Set Default value of the parameter * @param DefaultValue Default value of the parameter */ public void setDefaultValue(String DefaultValue) { this.DefaultValue = DefaultValue; } /** * Get Current value of a parameter * @return CurrentValue Current value of a parameter */ public String getCurrentValue() { return this.CurrentValue; } /** * Set Current value of a parameter * @param CurrentValue Current value of a parameter */ public void setCurrentValue(String CurrentValue) { this.CurrentValue = CurrentValue; } /** * Get Parameter description * @return Tips Parameter description */ public String getTips() { return this.Tips; } /** * Set Parameter description * @param Tips Parameter description */ public void setTips(String Tips) { this.Tips = Tips; } /** * Get Minimum value of a parameter * @return Min Minimum value of a parameter */ public String getMin() { return this.Min; } /** * Set Minimum value of a parameter * @param Min Minimum value of a parameter */ public void setMin(String Min) { this.Min = Min; } /** * Get Maximum value of a parameter * @return Max Maximum value of a parameter */ public String getMax() { return this.Max; } /** * Set Maximum value of a parameter * @param Max Maximum value of a parameter */ public void setMax(String Max) { this.Max = Max; } /** * Get Parameter status. 1: modifying; 2: modified * @return Status Parameter status. 1: modifying; 2: modified */ public Long getStatus() { return this.Status; } /** * Set Parameter status. 1: modifying; 2: modified * @param Status Parameter status. 1: modifying; 2: modified */ public void setStatus(Long Status) { this.Status = Status; } /** * Internal implementation, normal users should not use it. */ public void toMap(HashMap<String, String> map, String prefix) { this.setParamSimple(map, prefix + "ParamName", this.ParamName); this.setParamSimple(map, prefix + "ValueType", this.ValueType); this.setParamSimple(map, prefix + "NeedRestart", this.NeedRestart); this.setParamSimple(map, prefix + "DefaultValue", this.DefaultValue); this.setParamSimple(map, prefix + "CurrentValue", this.CurrentValue); this.setParamSimple(map, prefix + "Tips", this.Tips); this.setParamSimple(map, prefix + "Min", this.Min); this.setParamSimple(map, prefix + "Max", this.Max); this.setParamSimple(map, prefix + "Status", this.Status); } }
[ "zhiqiangfan@tencent.com" ]
zhiqiangfan@tencent.com
d9f07093553855bce2fe6b90a51c5616a831b584
d55d17769a21ed3d0bfc41c4eaa8f60711144621
/java-advanced/src/main/java/advanced/functional/lambda/functions/DemoFunctions.java
9cc040e0135b37cb26471d74254f62e6e84e4e1c
[]
no_license
rogers1235/new-project
fc42ca0f85c1a606a4196624088230338ddba496
b9df64b6f9e2924211fe70b80c8ab923624ec817
refs/heads/main
2023-08-04T08:28:18.018401
2021-09-16T20:22:38
2021-09-16T20:22:38
407,303,470
0
0
null
null
null
null
UTF-8
Java
false
false
310
java
package advanced.functional.lambda.functions; import java.util.HashMap; import java.util.Map; public class DemoFunctions { public static void main(String[] args) { Map<String, Integer> nameMap = new HashMap<>(); Integer value = nameMap.computeIfAbsent("John", s -> s.length()); } }
[ "craiova_2006@yahoo.it" ]
craiova_2006@yahoo.it
a3f54463dbb7cbcc4db807d1ee611326f2f7ed6e
2451da7e47f705c0719e9d35efeedbae747e2324
/litho-intellij-plugin/src/main/java/com/facebook/litho/intellij/actions/OnEventGenerateAction.java
be66a051b82e9e1ef8af268600af4d23c3447c02
[ "Apache-2.0" ]
permissive
naufalprakoso/litho
69d3a55fd6db2de44cf8e2a2ce50a5591651e3b1
1cb053683e8012c699a89ef73f359ec673673a53
refs/heads/master
2022-11-28T04:00:30.450425
2020-08-09T08:45:59
2020-08-09T08:45:59
286,190,495
0
0
Apache-2.0
2020-08-09T07:41:26
2020-08-09T07:41:25
null
UTF-8
Java
false
false
7,763
java
/* * Copyright (c) Facebook, Inc. and its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.facebook.litho.intellij.actions; import com.facebook.litho.intellij.LithoPluginUtils; import com.facebook.litho.intellij.completion.OnEventGenerateUtils; import com.facebook.litho.intellij.extensions.EventLogger; import com.facebook.litho.intellij.logging.LithoLoggerProvider; import com.facebook.litho.intellij.services.ComponentGenerateService; import com.intellij.codeInsight.CodeInsightActionHandler; import com.intellij.codeInsight.generation.ClassMember; import com.intellij.codeInsight.generation.GenerateMembersHandlerBase; import com.intellij.codeInsight.generation.GenerationInfo; import com.intellij.codeInsight.generation.PsiGenerationInfo; import com.intellij.codeInsight.generation.PsiMethodMember; import com.intellij.codeInsight.generation.actions.BaseGenerateAction; import com.intellij.ide.util.TreeJavaClassChooserDialog; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.CommonDataKeys; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.project.Project; import com.intellij.psi.PsiClass; import com.intellij.psi.PsiFile; import com.intellij.psi.PsiMethod; import com.intellij.psi.PsiParameter; import com.intellij.psi.search.GlobalSearchScope; import com.intellij.util.IncorrectOperationException; import java.util.ArrayList; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; import javax.annotation.Nullable; import org.jetbrains.annotations.NotNull; /** * Generates a method handling Litho event in the Litho Spec. * https://fblitho.com/docs/events-overview */ public class OnEventGenerateAction extends BaseGenerateAction { public interface EventChooser { PsiClass choose(PsiClass context, Project project); } @Nullable public interface OnEventRefactorer { PsiMethod changeSignature(Project project, PsiMethod originalOnEventMethod, PsiClass context); } public interface OnEventGeneratedListener { void onGenerated(PsiMethod onEvent); } public static CodeInsightActionHandler createHandler( EventChooser eventChooser, OnEventGeneratedListener onEventGeneratedListener) { return new OnEventGenerateHandler( eventChooser, (project, originalOnEventMethod, context) -> { if (ApplicationManager.getApplication().isUnitTestMode()) { return originalOnEventMethod; } final OnEventChangeSignatureDialog onEventMethodSignatureChooser = new OnEventChangeSignatureDialog(project, originalOnEventMethod, context); onEventMethodSignatureChooser.show(); return onEventMethodSignatureChooser.getMethod(); }, onEventGeneratedListener); } public OnEventGenerateAction() { super( createHandler( (context, project) -> { // Choose event to generate method for final TreeJavaClassChooserDialog chooseEventDialog = new TreeJavaClassChooserDialog( "Choose Event", project, GlobalSearchScope.allScope(project), LithoPluginUtils::isEvent, context /* Any initial class */); chooseEventDialog.show(); return chooseEventDialog.getSelected(); }, onEventMethod -> LithoLoggerProvider.getEventLogger() .log(EventLogger.EVENT_ON_EVENT_GENERATION + ".success"))); } @Override public void update(AnActionEvent e) { // Applies visibility of the Generate Action group super.update(e); final PsiFile file = e.getData(CommonDataKeys.PSI_FILE); if (!LithoPluginUtils.isLithoSpec(file)) { e.getPresentation().setEnabledAndVisible(false); } } @Override public void actionPerformed(AnActionEvent e) { LithoLoggerProvider.getEventLogger().log(EventLogger.EVENT_ON_EVENT_GENERATION + ".invoke"); super.actionPerformed(e); final PsiFile file = e.getData(CommonDataKeys.PSI_FILE); LithoPluginUtils.getFirstLayoutSpec(file) .ifPresent(cls -> ComponentGenerateService.getInstance().updateLayoutComponentAsync(cls)); } /** * Generates Litho event method. Prompts the user for additional data: choose Event class and * method signature customisation. * * @see com.facebook.litho.intellij.completion.MethodGenerateHandler */ static class OnEventGenerateHandler extends GenerateMembersHandlerBase { private final EventChooser eventChooser; private final OnEventGeneratedListener onEventGeneratedListener; private final OnEventRefactorer onEventRefactorer; OnEventGenerateHandler( EventChooser eventChooser, OnEventRefactorer onEventRefactorer, OnEventGeneratedListener onEventGeneratedListener) { super(""); this.eventChooser = eventChooser; this.onEventGeneratedListener = onEventGeneratedListener; this.onEventRefactorer = onEventRefactorer; } /** @return method based on user choice. */ @Override protected ClassMember[] chooseOriginalMembers(PsiClass aClass, Project project) { return Optional.ofNullable(eventChooser.choose(aClass, project)) .map( eventClass -> { final List<PsiParameter> propsAndStates = LithoPluginUtils.getPsiParameterStream(null, aClass.getMethods()) .filter(LithoPluginUtils::isPropOrState) .collect(Collectors.toList()); return OnEventGenerateUtils.createOnEventMethod(aClass, eventClass, propsAndStates); }) .map(onEventMethod -> onEventRefactorer.changeSignature(project, onEventMethod, aClass)) .map( customMethod -> { OnEventGenerateUtils.addComment(aClass, customMethod); onEventGeneratedListener.onGenerated(customMethod); return new ClassMember[] {new PsiMethodMember(customMethod)}; }) .orElse(ClassMember.EMPTY_ARRAY); } @Override protected GenerationInfo[] generateMemberPrototypes(PsiClass psiClass, ClassMember classMember) throws IncorrectOperationException { return generateMemberPrototypes(psiClass, new ClassMember[] {classMember}) .toArray(GenerationInfo.EMPTY_ARRAY); } /** @return a list of objects to insert into generated code. */ @NotNull @Override protected List<? extends GenerationInfo> generateMemberPrototypes( PsiClass aClass, ClassMember[] members) throws IncorrectOperationException { final List<GenerationInfo> prototypes = new ArrayList<>(); for (ClassMember member : members) { if (member instanceof PsiMethodMember) { PsiMethodMember methodMember = (PsiMethodMember) member; prototypes.add(new PsiGenerationInfo<>(methodMember.getElement())); } } return prototypes; } @Override protected ClassMember[] getAllOriginalMembers(PsiClass psiClass) { return ClassMember.EMPTY_ARRAY; } } }
[ "facebook-github-bot@users.noreply.github.com" ]
facebook-github-bot@users.noreply.github.com
f5aff31ba76a0479c1e1473aa627bb5e37b1a7a9
09832253bbd9c7837d4a380c7410bd116d9d8119
/Web Based Learning/JavaTPoint/JavaTPoint/src/Java8NewFeatures/LambdaExpressioin/LambdaExWithoutReturn.java
9268771306b3e0324f171d9097349e7f6c581f02
[]
no_license
shshetu/Java
d892ae2725f8ad0acb2d98f5fd4e6ca2b1ce171e
51bddc580432c74e0339588213ef9aa0d384169a
refs/heads/master
2020-04-11T21:25:12.588859
2019-04-02T05:41:00
2019-04-02T05:41:00
162,104,906
0
1
null
null
null
null
UTF-8
Java
false
false
732
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package Java8NewFeatures.LambdaExpressioin; /** * * @author shshe */ interface Addable2{ int add(int a, int b); } public class LambdaExWithoutReturn { public static void main(String[] args) { //lambda expression without return keyword Addable2 add1 = (a,b)->(a+b); System.out.println(add1.add(10, 11));; //lambda expression with return keyword Addable2 add2 = (int a,int b)->{ return a+b; }; //call the method System.out.println(add2.add(100, 200)); } }
[ "shshetu2017@gmail.com" ]
shshetu2017@gmail.com
d63226d2a21af55a194d653a81594ffa8b1784f9
10fdc3aa333ef07a180f29a4425650945c3da9c8
/zhuanbo-service/src/main/java/com/zhuanbo/service/service/impl/SeqIncrServiceImpl.java
b088081a42128880dfae8d9948cbbac4c2356f0b
[]
no_license
arvin-xiao/lexuan
4d67f4ab40243c7e6167e514d899c6cd0c3f0995
6cffeee1002bad067e6c8481a3699186351d91a8
refs/heads/master
2023-04-27T21:01:06.644131
2020-05-03T03:03:52
2020-05-03T03:03:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,925
java
package com.zhuanbo.service.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.zhuanbo.core.exception.ShopException; import com.zhuanbo.core.service.impl.RedissonDistributedLocker; import com.zhuanbo.core.constants.Align; import com.zhuanbo.core.constants.Constants; import com.zhuanbo.core.entity.SeqIncr; import com.zhuanbo.service.mapper.SeqIncrMapper; import com.zhuanbo.service.service.ISeqIncrService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import java.util.HashMap; import java.util.Map; import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; /** * <p> * 序列号表 服务实现类 * </p> * * @author rome * @since 2019-06-13 */ @Service @Slf4j public class SeqIncrServiceImpl extends ServiceImpl<SeqIncrMapper, SeqIncr> implements ISeqIncrService { @Autowired private RedissonDistributedLocker redissonLocker; private static Map<String, SeqIncr> seqIncrMap = new HashMap<String, SeqIncr>(); //默认增长数 private static final int DEFAULT_INCREMENT = 1; private String padding = "00000000000000000000000000000000"; static Lock lock = new ReentrantLock(true); @Override @Transactional(propagation = Propagation.NOT_SUPPORTED) public String nextVal(String seqName, int length, Align align) { long currentValue = 0; try { lock.tryLock(Constants.LOCK_WAIT_TIME, TimeUnit.SECONDS); SeqIncr seqIncr = seqIncrMap.get(seqName); if (null == seqIncr) { seqIncr = getSeqIncr(seqName); if (null == seqIncr) { throw new ShopException("11200", "获取序列号失败,seqName=" + seqName); } //如果增长值小于等于DEFAULT_INCREMENT,直接返回 if (seqIncr.getIncrement().intValue() <= DEFAULT_INCREMENT) { return paddingVal(String.valueOf(seqIncr.getCurrentValue() + seqIncr.getIncrement()), length, align); } } long nextValue = seqIncr.getNextValue(); currentValue = seqIncr.getCurrentValue(); //当序列值超过DEFAULT_LOAD_FACTOR值,需要重新扩展 if (currentValue >= nextValue) { resize(seqName); seqIncr = seqIncrMap.get(seqName); nextValue = seqIncr.getNextValue(); currentValue = seqIncr.getCurrentValue(); } currentValue++; seqIncr.setCurrentValue(currentValue); return paddingVal(String.valueOf(currentValue), length, align); } catch (Exception e) { log.error("获取序列号失败,seqName=" + seqName); throw new ShopException("11201", "获取序列号失败", e); } finally { lock.unlock(); } } @Override public String currVal(String seqName, int length, Align align) { return this.paddingVal(String.valueOf(baseMapper.currVal(seqName)), length, align); } public String paddingVal(String value, int length, Align align) { if (length > value.length()) { if (align.equals(Align.LEFT)) { return padding.substring(0, length - value.length()) + value; } return value + padding.substring(0, length - value.length()); } else if (length < value.length()) { if (align.equals(Align.LEFT)) { return value.substring(value.length() - length, value.length()); } return value.substring(0, value.length() - length); } return value; } private SeqIncr getSeqIncr(String seqName) throws InterruptedException { try { boolean lockFlag = false; lockFlag = redissonLocker.tryLock(seqName, TimeUnit.SECONDS, Constants.LOCK_WAIT_TIME, Constants.LOCK_LEASE_TIME); if (!lockFlag) { log.error("获取分布式失败lockFlag=" + lockFlag + ",seqName=" + seqName); throw new ShopException("11201"); } SeqIncr seqIncr = seqIncrMap.get(seqName); if (null == seqIncr) { seqIncr = this.getOne(new QueryWrapper<SeqIncr>().eq("name", seqName)); if (null == seqIncr) { log.error("获取序列号失败,seqName=" + seqName); throw new ShopException("11201"); } long nextVal = baseMapper.nextVal(seqName); seqIncr.setNextValue(nextVal); seqIncr.setCurrentValue(nextVal - seqIncr.getIncrement()); //如果增长值小于等于DEFAULT_INCREMENT,直接返回 if (seqIncr.getIncrement().intValue() > DEFAULT_INCREMENT) { seqIncrMap.put(seqName, seqIncr); } } return seqIncr; } finally { redissonLocker.unlock(seqName); } } private void resize(String seqName) { try { boolean lockFlag = false; lockFlag = redissonLocker.tryLock(seqName, TimeUnit.SECONDS, Constants.LOCK_WAIT_TIME, Constants.LOCK_LEASE_TIME); if (!lockFlag) { log.error("获取分布式失败lockFlag=" + lockFlag + ",seqName=" + seqName); throw new ShopException("11201"); } SeqIncr seqIncr = this.getOne(new QueryWrapper<SeqIncr>().eq("name", seqName)); if (null == seqIncr) { log.error("获取序列号失败,seqName=" + seqName); throw new ShopException("11201"); } long nextVal = baseMapper.nextVal(seqName); seqIncr.setNextValue(nextVal); seqIncr.setCurrentValue(nextVal - seqIncr.getIncrement()); seqIncrMap.put(seqName, seqIncr); } finally { redissonLocker.unlock(seqName); } } }
[ "13509030019@163.com" ]
13509030019@163.com
1dc9d54e7b8a6476b1f5d30d99ac886d0f235442
58e4b974229bf6b6ea0fb6036d941432d2ab597d
/app/src/main/java/com/scatl/uestcbbs/activities/BlackUserActivity.java
02c264999057ef96244d224e74cabfbd48c88f50
[ "Apache-2.0" ]
permissive
scatl/UestcBBS
508b47e97480fbdfc2428be15d934a46e5a5498b
bf970c12e0c600827c39f02496e46a7725feb3ac
refs/heads/master
2022-04-03T13:50:41.557261
2020-02-20T13:36:08
2020-02-20T13:36:08
220,958,682
3
0
null
null
null
null
UTF-8
Java
false
false
5,557
java
package com.scatl.uestcbbs.activities; import android.os.Bundle; import android.view.MenuItem; import android.view.View; import android.widget.CompoundButton; import android.widget.RelativeLayout; import androidx.annotation.NonNull; import androidx.appcompat.widget.SwitchCompat; import androidx.appcompat.widget.Toolbar; import androidx.coordinatorlayout.widget.CoordinatorLayout; import com.alibaba.fastjson.JSONObject; import com.scatl.uestcbbs.R; import com.scatl.uestcbbs.base.BaseActivity; import com.scatl.uestcbbs.interfaces.OnHttpRequest; import com.scatl.uestcbbs.utils.CommonUtil; import com.scatl.uestcbbs.utils.Constants; import com.scatl.uestcbbs.utils.SharePrefUtil; import com.scatl.uestcbbs.utils.ToastUtil; import com.scatl.uestcbbs.utils.httprequest.HttpRequestUtil; import java.util.HashMap; import java.util.Map; import okhttp3.Call; public class BlackUserActivity extends BaseActivity { private static final String TAG = "BlackUserActivity"; private SwitchCompat black_switch; private RelativeLayout relativeLayout; private Toolbar toolbar; private CoordinatorLayout coordinatorLayout; private int user_id; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_black_user); init(); } /** * author: TanLei * description: */ private void init() { user_id = getIntent().getIntExtra(Constants.Key.USER_ID, Integer.MAX_VALUE); coordinatorLayout = findViewById(R.id.black_user_coorlayout); black_switch = findViewById(R.id.black_user_switch); relativeLayout = findViewById(R.id.black_user_rl); relativeLayout.setVisibility(View.GONE); toolbar = findViewById(R.id.black_user_toolbar); setSupportActionBar(toolbar); toolbar.setTitle("黑名单操作"); if (getSupportActionBar() != null) getSupportActionBar().setDisplayHomeAsUpEnabled(true); getUserData(); black_switch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean b) { if (! compoundButton.isPressed()) return; blackUser(b ? "black" : "delblack"); } }); } /** * author: TanLei * description: 获取用户数据 */ private void getUserData() { Map<String, String> map = new HashMap<>(); map.put("userId", user_id + ""); map.put("accessToken", SharePrefUtil.getAccessToken(this)); map.put("accessSecret", SharePrefUtil.getAccessSecret(this)); map.put("apphash", CommonUtil.getAppHashValue()); HttpRequestUtil.post(Constants.Api.GET_USER_INFO, map, new OnHttpRequest() { @Override public void onRequestError(Call call, Exception e, int id) { ToastUtil.showSnackBar(coordinatorLayout, getResources().getString(R.string.request_error)); } @Override public void onRequestInProgress(float progress, long total, int id) { } @Override public void onRequestSuccess(String response, int id) { JSONObject jsonObject = JSONObject.parseObject(response); int rs = jsonObject.getIntValue("rs"); //通常 1 表示成功,0 表示失败。 if (rs == 1) { relativeLayout.setVisibility(View.VISIBLE); int is_black = jsonObject.getIntValue("is_black"); black_switch.setChecked(is_black == 1); } else { black_switch.setEnabled(false); ToastUtil.showSnackBar(coordinatorLayout, jsonObject.getString("errcode")); } } }); } /** * author: TanLei * description: 黑名单操作 */ private void blackUser(String type) { Map<String, String> map = new HashMap<>(); map.put("uid", user_id + ""); map.put("type", type); map.put("accessToken", SharePrefUtil.getAccessToken(this)); map.put("accessSecret", SharePrefUtil.getAccessSecret(this)); map.put("apphash", CommonUtil.getAppHashValue()); HttpRequestUtil.post(Constants.Api.BLACK_USER, map, new OnHttpRequest() { @Override public void onRequestError(Call call, Exception e, int id) { black_switch.setChecked(! black_switch.isChecked()); ToastUtil.showSnackBar(coordinatorLayout, "操作失败"); } @Override public void onRequestInProgress(float progress, long total, int id) { } @Override public void onRequestSuccess(String response, int id) { JSONObject jsonObject = JSONObject.parseObject(response); int rs = jsonObject.getIntValue("rs"); //通常 1 表示成功,0 表示失败。 if (rs == 1) { black_switch.setChecked(black_switch.isChecked()); } ToastUtil.showSnackBar(coordinatorLayout, jsonObject.getString("errcode")); } }); } @Override public boolean onOptionsItemSelected(@NonNull MenuItem item) { switch (item.getItemId()) { case android.R.id.home: finish(); break; } return super.onOptionsItemSelected(item); } }
[ "sca_tl@foxmail.com" ]
sca_tl@foxmail.com
16a0a1986f56bbf42a0c38315772eb438b68594a
65eac80b75dd1e3b9f79504c25558347d79df9e7
/juc/src/main/java/ac/cn/saya/juc/print/PrintABCTest.java
2e036b0d2ddaf1f30ed27fbdddce54478f763f77
[ "Apache-2.0" ]
permissive
saya-ac-cn/java-utils
b07b4a40fa71941e5952ef415327c8839e0993ac
a49ba01e0beb3bec0e8e56ea7e55b7fb6aa1a897
refs/heads/master
2023-05-27T21:15:21.668806
2023-05-26T14:08:38
2023-05-26T14:08:38
182,410,675
0
0
Apache-2.0
2022-06-21T04:21:45
2019-04-20T13:40:41
Java
UTF-8
Java
false
false
3,443
java
package ac.cn.saya.juc.print; import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; /** * @Title: PrintABCTest * @ProjectName java-utils * @Description: TODO * @Author liunengkai * @Date: 2019-04-21 17:37 * @Description: * 编写一个程序,开启3个线程,这3个线程的ID分别为A B C ,每个线程将自己的ID在屏幕上打印10遍,要求输出的结果必须按顺序显示 * 如:ABCABC */ public class PrintABCTest { public static void main(String[] args){ PrintABC printABC = new PrintABC(); new Thread(new Runnable() { @Override public void run() { for (int i = 1; i <= 20; i++){ printABC.loopA(i); } } },"A").start(); new Thread(new Runnable() { @Override public void run() { for (int i = 1; i <= 20; i++){ printABC.loopB(i); } } },"B").start(); new Thread(new Runnable() { @Override public void run() { for (int i = 1; i <= 20; i++){ printABC.loopC(i); } } },"C").start(); } } class PrintABC{ private String number = "A"; private Lock lock = new ReentrantLock(); private Condition conditionA = lock.newCondition(); private Condition conditionB = lock.newCondition(); private Condition conditionC = lock.newCondition(); // 打印A public void loopA(int totalLoop){ lock.lock(); try{ // 1、判断 if(!number.equals("A")){ conditionA.await(); } // 2、打印 for (int i = 1; i <= 5; i++){ System.out.println(Thread.currentThread().getName()+"\t"+ i + "\t" + totalLoop); } // 3、通知唤醒,让B打印 number = "B"; conditionB.signal(); }catch (Exception e){ e.printStackTrace(); }finally { lock.unlock(); } } // 打印B public void loopB(int totalLoop){ lock.lock(); try{ // 1、判断 if(!number.equals("B")){ conditionB.await(); } // 2、打印 for (int i = 1; i <= 5; i++){ System.out.println(Thread.currentThread().getName()+"\t"+ i + "\t" + totalLoop); } // 3、唤醒,让C打印 number = "C"; conditionC.signal(); }catch (Exception e){ e.printStackTrace(); }finally { lock.unlock(); } } // 打印C public void loopC(int totalLoop){ lock.lock(); try{ // 1、判断 if(!number.equals("C")){ conditionC.await(); } // 2、打印 for (int i = 1; i <= 5; i++){ System.out.println(Thread.currentThread().getName()+"\t"+ i + "\t" + totalLoop); } System.out.println("--------"); // 3、唤醒,让A打印 number = "A"; conditionA.signal(); }catch (Exception e){ e.printStackTrace(); }finally { lock.unlock(); } } }
[ "saya@saya.ac.cn" ]
saya@saya.ac.cn
4061b55c8972fcddfa685bc639adef73d884cbfd
6ea26be2d82a74de3a726fac4aa2589334d56211
/src/main/java/io/github/jhipster/application/ApplicationWebXml.java
37fccea53cad8d1f59b77660e061f50b6314eb1d
[]
no_license
alexandrebotta/jhipster-objective-okrs
269c58cbbad122d8fdb06647acad2d7cd51f855c
4f2550eddbe0aa813f31d2dadf959f002ee57fc8
refs/heads/master
2020-05-09T22:44:47.772790
2019-04-15T12:28:10
2019-04-15T12:28:10
181,480,828
0
0
null
2019-04-15T12:28:57
2019-04-15T12:21:49
Java
UTF-8
Java
false
false
857
java
package io.github.jhipster.application; import io.github.jhipster.application.config.DefaultProfileUtil; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; /** * This is a helper Java class that provides an alternative to creating a web.xml. * This will be invoked only when the application is deployed to a Servlet container like Tomcat, JBoss etc. */ public class ApplicationWebXml extends SpringBootServletInitializer { @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { /** * set a default to use when no profile is configured. */ DefaultProfileUtil.addDefaultProfile(application.application()); return application.sources(ObjectiveOkrsApp.class); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
3c237aeb7ea3691bee12bc109c9e864b8c6d29de
23954a7d5713fbbe5e35a87c81745907cabc5462
/src/main/java/com/youedata/nncloud/modular/nanning/timer/CreationArticleTimer.java
74ed80f7ddc158772b9c1fae94ff73f21d830640
[]
no_license
lj88811498/db
410a8c5af0f2e7c34bc78996e08650b16ee966e3
fd19c30fff7a5c44ebae34dbe10a6101d67eae74
refs/heads/master
2022-10-07T05:33:43.516126
2020-01-06T09:38:16
2020-01-06T09:38:16
232,068,336
0
0
null
2022-09-01T23:18:23
2020-01-06T09:35:38
JavaScript
UTF-8
Java
false
false
4,670
java
//package com.youedata.nncloud.modular.nanning.timer; // //import com.alibaba.fastjson.JSONObject; //import com.youedata.nncloud.core.util.UrlsUtil; //import com.youedata.nncloud.modular.nanning.model.CreationArticle; //import com.youedata.nncloud.modular.nanning.model.vo.CreationArticleVo; //import com.youedata.nncloud.modular.nanning.service.ICreationArticleService; //import org.slf4j.Logger; //import org.slf4j.LoggerFactory; //import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.stereotype.Component; // //import java.net.URLEncoder; //import java.util.ArrayList; //import java.util.List; // //@Component //public class CreationArticleTimer { // private Logger log = LoggerFactory.getLogger(this.getClass()); // // @Autowired // private ICreationArticleService service; // //// @Scheduled(cron = "0 26 10 * * ?") // public void getTech() { // try { // log.info("创新创业-技术前沿-定时器启动"); // String API_URL_TECH = "http://219.159.152.202:8081/INTERFACE.API/f/api/geii_ibdms?key=53ccff6b116740a8bb0ae9c4753a0a9c&category_name=" + URLEncoder.encode("技术前沿", "utf-8") + "&pageIndex=1&pageSize=2000"; // List<CreationArticleVo> json = JSONObject.parseArray(UrlsUtil.loadJson(API_URL_TECH).toString(), CreationArticleVo.class); // List<CreationArticle> list = new ArrayList<>(); // if (json.size() > 0) { // for (CreationArticleVo vo : json) { // //通过反射机制获取对象信息 // CreationArticle creationArticle = (CreationArticle) UrlsUtil.radiation(vo, CreationArticle.class); // list.add(creationArticle); // } // service.insertBatch(list); // } else { // log.info("创新创业-技术前沿接口信息为空或第三方接口异常"); // } // log.info("创新创业-技术前沿-定时器结束"); // } catch (Exception e) { // log.error(e.getMessage()); // } // } // //// @Scheduled(cron = "0 28 10 * * ?") // public void getProduct() { // try { // log.info("创新创业-产品推荐-定时器启动"); // String API_URL_PRODUCT = "http://219.159.152.202:8081/INTERFACE.API/f/api/geii_ibdms?key=53ccff6b116740a8bb0ae9c4753a0a9c&category_name=" + URLEncoder.encode("产品推荐", "utf-8") + "&pageIndex=1&pageSize=1000"; // List<CreationArticleVo> json = JSONObject.parseArray(UrlsUtil.loadJson(API_URL_PRODUCT).toString(), CreationArticleVo.class); // List<CreationArticle> list = new ArrayList<>(); // if (json.size() > 0) { // for (CreationArticleVo vo : json) { // //通过反射机制获取对象信息 // CreationArticle creationArticle = (CreationArticle) UrlsUtil.radiation(vo, CreationArticle.class); // list.add(creationArticle); // } // service.insertBatch(list); // } else { // log.info("创新创业-产品推荐接口信息为空或第三方接口异常"); // } // log.info("创新创业-产品推荐-定时器结束"); // } catch (Exception e) { // log.error(e.getMessage()); // } // } // //// @Scheduled(cron = "0 30 10 * * ?") // public void getReport() { // try { // log.info("创新创业-项目申报-定时器启动"); // String API_URL_REPORT = "http://219.159.152.202:8081/INTERFACE.API/f/api/geii_ibdms?key=53ccff6b116740a8bb0ae9c4753a0a9c&category_name=" + URLEncoder.encode("项目申报", "utf-8") + "&pageIndex=1&pageSize=1000"; // List<CreationArticleVo> json = JSONObject.parseArray(UrlsUtil.loadJson(API_URL_REPORT).toString(), CreationArticleVo.class); // List<CreationArticle> list = new ArrayList<>(); // if (json.size() > 0) { // for (CreationArticleVo vo : json) { // //通过反射机制获取对象信息 // CreationArticle creationArticle = (CreationArticle) UrlsUtil.radiation(vo, CreationArticle.class); // list.add(creationArticle); // } // service.insertBatch(list); // } else { // log.info("创新创业-项目申报接口信息为空或第三方接口异常"); // } // log.info("创新创业-项目申报-定时器结束"); // } catch (Exception e) { // log.error(e.getMessage()); // } // } //}
[ "450416064@qq.com" ]
450416064@qq.com
8f865c55c8fde27adc009a09c6801e6e9e7aaeb4
29f78bfb928fb6f191b08624ac81b54878b80ded
/generated_SPs_SCs/IADC/SCs/SC_helicopter1/src/main/java/SP_aircraftcarrier1/input/InputDataClassName_3_2.java
d29ba65f1781e48ca7f8dacddb818d7fbe45b926
[]
no_license
MSPL4SOA/MSPL4SOA-tool
8a78e73b4ac7123cf1815796a70f26784866f272
9f3419e416c600cba13968390ee89110446d80fb
refs/heads/master
2020-04-17T17:30:27.410359
2018-07-27T14:18:55
2018-07-27T14:18:55
66,304,158
0
1
null
null
null
null
UTF-8
Java
false
false
2,499
java
package SP_aircraftcarrier1.input; import java.io.Serializable; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement(name = "InputDataClassName_3_2") public class InputDataClassName_3_2 implements Serializable { private static final long serialVersionUID = 1L; @XmlElement(name = "InputName_3_2_2") protected Integer InputName_3_2_2; @XmlElement(name = "InputName_3_2_3") protected Float InputName_3_2_3; @XmlElement(name = "InputName_3_2_1") protected Float InputName_3_2_1; @XmlElement(name = "InputName_3_2_8") protected Integer InputName_3_2_8; @XmlElement(name = "InputName_3_2_9") protected String InputName_3_2_9; @XmlElement(name = "InputName_3_2_6") protected Integer InputName_3_2_6; @XmlElement(name = "InputName_3_2_7") protected String InputName_3_2_7; @XmlElement(name = "InputName_3_2_4") protected Float InputName_3_2_4; @XmlElement(name = "InputName_3_2_5") protected Integer InputName_3_2_5; public Integer getInputName_3_2_2() { return InputName_3_2_2; } public Float getInputName_3_2_3() { return InputName_3_2_3; } public Float getInputName_3_2_1() { return InputName_3_2_1; } public Integer getInputName_3_2_8() { return InputName_3_2_8; } public String getInputName_3_2_9() { return InputName_3_2_9; } public Integer getInputName_3_2_6() { return InputName_3_2_6; } public String getInputName_3_2_7() { return InputName_3_2_7; } public Float getInputName_3_2_4() { return InputName_3_2_4; } public Integer getInputName_3_2_5() { return InputName_3_2_5; } public void setInputName_3_2_2(Integer value) { this.InputName_3_2_2 = value; } public void setInputName_3_2_3(Float value) { this.InputName_3_2_3 = value; } public void setInputName_3_2_1(Float value) { this.InputName_3_2_1 = value; } public void setInputName_3_2_8(Integer value) { this.InputName_3_2_8 = value; } public void setInputName_3_2_9(String value) { this.InputName_3_2_9 = value; } public void setInputName_3_2_6(Integer value) { this.InputName_3_2_6 = value; } public void setInputName_3_2_7(String value) { this.InputName_3_2_7 = value; } public void setInputName_3_2_4(Float value) { this.InputName_3_2_4 = value; } public void setInputName_3_2_5(Integer value) { this.InputName_3_2_5 = value; } }
[ "akram.kamoun@gmail.com" ]
akram.kamoun@gmail.com
92d89a9d27614e09cbe9bbcc1ca7f27280488fc4
b97a9d99fbf4066469e64592065d6a62970d9833
/ares-core/common/src/main/java/com/aw/common/util/SystemOrLatestTime.java
18fc2b1c53bae8c151f127baa2bd008cd9ba0414
[]
no_license
analyticswarescott/ares
2bacb8eaac612e36836f7138c4398b6560468a91
5ac8d4ed50ca749b52eafc6fe95593ff68b85b54
refs/heads/master
2020-05-29T16:08:56.917029
2016-11-11T21:11:02
2016-11-11T21:11:02
59,563,723
0
0
null
null
null
null
UTF-8
Java
false
false
651
java
package com.aw.common.util; import java.time.Instant; /** * A current time equal to the current system time, or the latest time seen, whichever is later. * * * */ public class SystemOrLatestTime implements TimeSource { /** * @return The latest time seen - if greater than the system time, this will be the current time */ private Instant latest; @Override public long nowMillis() { return now().toEpochMilli(); } @Override public Instant now() { if (this.latest == null) { return TimeSource.super.now(); } else { return this.latest; } } public void updateLatest(Instant time) { this.latest = time; } }
[ "scott@analyticsware.com" ]
scott@analyticsware.com
654cd0315dad7944264cb28a7ca0c990f1bc5d69
9602f5661333f9aa0ed55d24f225bad18102daa5
/src/main/java/projet/ynov/dizifymusicapi/security/JwtTokenFilterConfigurer.java
7967b5ea6260fda84c7424d575502276498273b6
[]
no_license
Kredoa/dizifyMusic_API
180e18d3814fbb11d8564f56afbad1851161e8d0
39d1ca755afec9df345a664ef56e3edf3302cd25
refs/heads/master
2023-01-29T11:46:52.519121
2020-11-22T20:40:07
2020-11-22T20:40:07
320,705,453
0
0
null
null
null
null
UTF-8
Java
false
false
902
java
package projet.ynov.dizifymusicapi.security; import org.springframework.security.config.annotation.SecurityConfigurerAdapter; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.web.DefaultSecurityFilterChain; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; public class JwtTokenFilterConfigurer extends SecurityConfigurerAdapter<DefaultSecurityFilterChain, HttpSecurity> { private JwtTokenProvider jwtTokenProvider; public JwtTokenFilterConfigurer(JwtTokenProvider jwtTokenProvider) { this.jwtTokenProvider = jwtTokenProvider; } @Override public void configure(HttpSecurity http) throws Exception { JwtTokenFilter customFilter = new JwtTokenFilter(jwtTokenProvider); http.addFilterBefore(customFilter, UsernamePasswordAuthenticationFilter.class); } }
[ "you@example.com" ]
you@example.com
bab3b229cbd9b12e0bc5fca23768f7a8b5483868
09b7f281818832efb89617d6f6cab89478d49930
/root/projects/alfresco-jlan/source/java/org/alfresco/jlan/server/auth/asn/DERBitString.java
7591001198f667e0abbe54f9524f09db24bc3273
[]
no_license
verve111/alfresco3.4.d
54611ab8371a6e644fcafc72dc37cdc3d5d8eeea
20d581984c2d22d5fae92e1c1674552c1427119b
refs/heads/master
2023-02-07T14:00:19.637248
2020-12-25T10:19:17
2020-12-25T10:19:17
323,932,520
1
1
null
null
null
null
UTF-8
Java
false
false
2,806
java
/* * Copyright (C) 2006-2010 Alfresco Software Limited. * * This file is part of Alfresco * * Alfresco is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Alfresco is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with Alfresco. If not, see <http://www.gnu.org/licenses/>. */ package org.alfresco.jlan.server.auth.asn; import java.io.IOException; /** * DER Bit String Class * * @author gkspencer */ public class DERBitString extends DERObject { // Bit flags value private long m_bits; /** * Default constructor */ public DERBitString() { } /** * Class constructor * * @param bits int */ public DERBitString( long bits) { m_bits = bits; } /** * Return the value * * @return long */ public final long getValue() { return m_bits; } /** * Return the value as an integer * * @return int */ public final int intValue() { return (int) m_bits; } /** * Decode the object * * @param buf * @throws IOException */ public void derDecode(DERBuffer buf) throws IOException { // Decode the type if ( buf.unpackType() == DER.BitString) { // Unpack the length and bytes int len = buf.unpackLength(); int lastBits = buf.unpackByte(); m_bits = 0; long curByt = 0L; len --; for ( int idx = (len - 1); idx >= 0; idx--) { // Get the value bytes curByt = (long) buf.unpackByte(); m_bits += curByt << (idx * 8); } } else throw new IOException("Wrong DER type, expected BitString"); } /** * Encode the object * * @param buf * @throws IOException */ public void derEncode(DERBuffer buf) throws IOException { // Pack the type, length and bytes buf.packByte( DER.BitString); buf.packByte( 0); buf.packLength( 8); for ( int idx = 7; idx >= 0; idx--) { long bytVal = m_bits >> ( idx * 8); buf.packByte((int) ( m_bits & 0xFF)); } } /** * Return the bit string as a string * * @return String */ public String toString() { StringBuffer str = new StringBuffer(); str.append("[BitString:0x"); str.append( Long.toHexString( m_bits)); str.append("]"); return str.toString(); } }
[ "verve111@mail.ru" ]
verve111@mail.ru
b64b15b343a012dbaed45484157dd44f006335f3
73fd7cf535b476ed2238ca42cb5e79d440a92f06
/app/src/main/java/com/cn/uca/view/datepicker/DatePickDialog.java
71861876971db8249691176787026fed284fc18f
[]
no_license
WengYihao/UCA
f4c5ee5d8624aa89aa23eb0558062d80902a576b
2b83b0550db9b44c73015f17e1e0e3a7287768a6
refs/heads/master
2021-01-02T22:28:49.469304
2018-03-29T12:38:11
2018-03-29T12:38:11
99,201,955
0
0
null
null
null
null
UTF-8
Java
false
false
4,520
java
package com.cn.uca.view.datepicker; import android.app.Dialog; import android.content.Context; import android.os.Bundle; import android.text.TextUtils; import android.view.Gravity; import android.view.View; import android.view.WindowManager; import android.widget.FrameLayout; import android.widget.TextView; import com.cn.uca.R; import com.cn.uca.bean.datepicker.DateType; import com.cn.uca.impl.datepicker.OnChangeLisener; import com.cn.uca.impl.datepicker.OnSureLisener; import com.cn.uca.util.datepicker.DateUtils; import java.text.SimpleDateFormat; import java.util.Date; /** * 自定义日期选择器 */ public class DatePickDialog extends Dialog implements OnChangeLisener { private TextView titleTv; private FrameLayout wheelLayout; private TextView cancel; private TextView sure; private TextView messgeTv; private String title; private String format; private DateType type = DateType.TYPE_ALL; //开始时间 private Date startDate = new Date(); //年分限制,默认上下5年 private int yearLimt = 5; private OnChangeLisener onChangeLisener; private OnSureLisener onSureLisener; private DatePicker mDatePicker; private TextView view; public void setView(TextView view){ this.view = view; } //设置标题 public void setTitle(String title) { this.title=title; } //设置模式 public void setType(DateType type) { this.type = type; } //设置选择日期显示格式,设置显示message,不设置不显示message public void setMessageFormat(String format) { this.format = format; } //设置开始时间 public void setStartDate(Date startDate) { this.startDate = startDate; } //设置年份限制,上下年份 public void setYearLimt(int yearLimt) { this.yearLimt = yearLimt; } //设置选择回调 public void setOnChangeLisener(OnChangeLisener onChangeLisener) { this.onChangeLisener = onChangeLisener; } //设置点击确定按钮,回调 public void setOnSureLisener(OnSureLisener onSureLisener) { this.onSureLisener = onSureLisener; this.view = view; } public DatePickDialog(Context context) { super(context, R.style.dialog_style); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.dialog_pick_time); initView(); initParas(); } private DatePicker getDatePicker() { DatePicker picker = new DatePicker(getContext(),type); picker.setStartDate(startDate); picker.setYearLimt(yearLimt); picker.setOnChangeLisener(this); picker.init(); return picker; } private void initView() { this.sure = (TextView) findViewById(R.id.sure); this.cancel = (TextView) findViewById(R.id.cancel); this.wheelLayout = (FrameLayout) findViewById(R.id.wheelLayout); this.titleTv = (TextView) findViewById(R.id.title); messgeTv = (TextView) findViewById(R.id.message); mDatePicker = getDatePicker(); this.wheelLayout.addView(mDatePicker); //setValue this.titleTv.setText(title); this.cancel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { dismiss(); } }); this.sure.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { dismiss(); if (onSureLisener != null) { onSureLisener.onSure(mDatePicker.getSelectDate()); } } }); } private void initParas() { WindowManager.LayoutParams params = getWindow().getAttributes(); params.gravity = Gravity.BOTTOM; params.width = DateUtils.getScreenWidth(getContext()); getWindow().setAttributes(params); } @Override public void onChanged(Date date) { if (onChangeLisener != null) { onChangeLisener.onChanged(date); } if (!TextUtils.isEmpty(format)) { String messge = ""; try { messge = new SimpleDateFormat(format).format(date); } catch (Exception e) { e.printStackTrace(); } messgeTv.setText(messge); } } }
[ "15112360329@163.com" ]
15112360329@163.com
50ad51d31a8ad6526075aa47ca8f0c4bd64749b8
a7397709e9ff6eca5a8117b4479bcc64a4e41d4b
/components/visual-panels/core/src/java/util/com/oracle/solaris/vp/util/misc/AggregatingLoader.java
2dd160f53bd1aea35e42bd257f9cfc88f67d3ccb
[]
no_license
alhazred/userland
6fbd28d281c08cf76f59e41e1331fe49fea6bcf2
72ea01e9a0ea237c9a960b3533273dc0afe06ff2
refs/heads/master
2020-05-17T10:17:16.836583
2013-03-04T07:36:23
2013-03-04T07:36:23
8,550,473
2
0
null
null
null
null
UTF-8
Java
false
false
1,466
java
/* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. */ package com.oracle.solaris.vp.util.misc; import java.io.File; import java.net.*; import java.util.*; public class AggregatingLoader extends URLClassLoader { private Set<URL> jars = new HashSet<URL>(); public AggregatingLoader(ClassLoader parent) { super(new URL[0], parent); } public void addJar(String path) { File f = new File(path); if (!f.exists()) return; URL url; try { url = f.toURI().toURL(); } catch (MalformedURLException e) { return; } if (jars.contains(url)) return; jars.add(url); addURL(url); } }
[ "a.eremin@nexenta.com" ]
a.eremin@nexenta.com
0523ff91a5050cd84aca7d7a3f9738b5318ba71b
1d8d3f11f734fac34e0d197f4707f3ba1c9fe7d6
/MyApplication/app/src/main/java/notrace/daytongue/views/UnScrollableGridView.java
8f9ea1802862df7025931b8fe212784a4ccf6bda
[]
no_license
messnoTrace/DayTongue
6e7edd2294616463ac9f80785d82b4b30d72ef57
8b2a5869af29a6d836ee1360567b9768d6d87c12
refs/heads/master
2020-04-13T12:43:14.596456
2015-09-28T11:04:37
2015-09-28T11:04:37
42,583,946
0
0
null
null
null
null
UTF-8
Java
false
false
771
java
package notrace.daytongue.views; import android.content.Context; import android.util.AttributeSet; import android.widget.GridView; /** * 解决GridView和ScrollView嵌套滚动冲突的问题 */ public class UnScrollableGridView extends GridView { public UnScrollableGridView(Context context, AttributeSet attrs) { super(context, attrs); } public UnScrollableGridView(Context context) { super(context); } public UnScrollableGridView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } @Override public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST); super.onMeasure(widthMeasureSpec, expandSpec); } }
[ "cy_nforget@126.com" ]
cy_nforget@126.com
d7ec55c06ea62135780b3a3d520b5e053b84edeb
1d64bf4b7cec44c8a12e4086ad2918e8df6dcc76
/SpringRelatedJars/spring-framework-2.0.5/dist/org/springframework/jms/connection/ChainedExceptionListener.java
db14f6a43e345e1f974a69bd2af02e97826e1798
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
XerO00/AllJarFiles
03472690fad55b5c2fcae530ac7de6294c54521e
d546337cfa29f4d33c3d3c5a4479a35063771612
refs/heads/master
2020-05-07T15:51:39.184855
2019-04-10T20:08:57
2019-04-10T20:08:57
180,655,268
0
0
null
null
null
null
UTF-8
Java
false
false
1,960
java
/* * Copyright 2002-2006 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.jms.connection; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import javax.jms.ExceptionListener; import javax.jms.JMSException; import org.springframework.util.Assert; /** * Implementation of the JMS ExceptionListener interface that supports chaining, * allowing the addition of multiple ExceptionListener instances in order. * * @author Juergen Hoeller * @since 2.0 */ public class ChainedExceptionListener implements ExceptionListener { /** List of ExceptionListeners */ private final List delegates = new ArrayList(2); /** * Add an ExceptionListener to the chained delegate list. */ public final void addDelegate(ExceptionListener listener) { Assert.notNull(listener, "ExceptionListener must not be null"); this.delegates.add(listener); } /** * Return all registered ExceptionListener delegates (as array). */ public final ExceptionListener[] getDelegates() { return (ExceptionListener[]) this.delegates.toArray(new ExceptionListener[this.delegates.size()]); } public void onException(JMSException ex) { for (Iterator it = this.delegates.iterator(); it.hasNext();) { ExceptionListener listener = (ExceptionListener) it.next(); listener.onException(ex); } } }
[ "prasannadandhalkar1@gmail.com" ]
prasannadandhalkar1@gmail.com
e5922bfa58dba4d9ef00970214e5253aa92ae625
eb97ee5d4f19d7bf028ae9a400642a8c644f8fe3
/tags/2010-06-20/seasar2-2.4.42/seasar2/s2-framework/src/main/java/org/seasar/framework/exception/SRuntimeException.java
e9773bd2109d7a6018ecd36daca453e2e7406a1f
[ "Apache-2.0" ]
permissive
svn2github/s2container
54ca27cf0c1200a93e1cb88884eb8226a9be677d
625adc6c4e1396654a7297d00ec206c077a78696
refs/heads/master
2020-06-04T17:15:02.140847
2013-08-09T09:38:15
2013-08-09T09:38:15
10,850,644
0
1
null
null
null
null
UTF-8
Java
false
false
2,965
java
/* * Copyright 2004-2010 the Seasar Foundation and the Others. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package org.seasar.framework.exception; import org.seasar.framework.message.MessageFormatter; /** * Seasar2の例外のベースクラスです。 * * @author higa * */ public class SRuntimeException extends RuntimeException { private static final long serialVersionUID = -4452607868694297329L; private String messageCode; private Object[] args; private String message; private String simpleMessage; /** * {@link SRuntimeException}を作成します。 * * @param messageCode */ public SRuntimeException(String messageCode) { this(messageCode, null, null); } /** * {@link SRuntimeException}を作成します。 * * @param messageCode * @param args */ public SRuntimeException(String messageCode, Object[] args) { this(messageCode, args, null); } /** * {@link SRuntimeException}を作成します。 * * @param messageCode * @param args * @param cause */ public SRuntimeException(String messageCode, Object[] args, Throwable cause) { super(cause); this.messageCode = messageCode; this.args = args; simpleMessage = MessageFormatter.getSimpleMessage(messageCode, args); message = "[" + messageCode + "]" + simpleMessage; } /** * メッセージコードを返します。 * * @return メッセージコード */ public final String getMessageCode() { return messageCode; } /** * 引数の配列を返します。 * * @return 引数の配列 */ public final Object[] getArgs() { return args; } public final String getMessage() { return message; } /** * メッセージを設定します。 * * @param message * メッセージ */ protected void setMessage(String message) { this.message = message; } /** * メッセージコードなしの単純なメッセージを返します。 * * @return メッセージコードなしの単純なメッセージ */ public final String getSimpleMessage() { return simpleMessage; } }
[ "koichik@319488c0-e101-0410-93bc-b5e51f62721a" ]
koichik@319488c0-e101-0410-93bc-b5e51f62721a
720b9e65df0a11761f5e912a2c060f22f50a0382
0eb7dcb0459de31871e2357cf5c713a53ea5f015
/graph-browser/src/org/dancingbear/graphbrowser/importer/dotparser/NodeId.java
411fda4c85b963cb86ecd7f73fcd44ce5174663a
[]
no_license
cwi-swat/meta-environment
a87055da2a6825c97c7744cdd84c08d39d9f3f66
eea9a90fdb52415f43430a89adc7acddba2be0a4
refs/heads/master
2021-01-19T08:42:05.812049
2012-11-15T14:16:54
2012-11-15T14:16:54
5,178,544
8
2
null
null
null
null
UTF-8
Java
false
false
553
java
/* Generated By:JJTree: Do not edit this line. NodeId.java Version 4.1 */ /* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ package org.dancingbear.graphbrowser.importer.dotparser; public class NodeId extends SimpleNode { public NodeId(int id) { super(id); } public NodeId(DOTParser p, int id) { super(p, id); } } /* JavaCC - OriginalChecksum=68308e31c9f383800bcefaa73580a9de (do not edit this line) */
[ "arnold.lankamp@gmail.com" ]
arnold.lankamp@gmail.com
814d05673c716d15d0aa131f0511d46998793bd8
f766baf255197dd4c1561ae6858a67ad23dcda68
/app/src/main/java/com/tencent/mm/protocal/c/nh.java
299de8f257b718e91a9f35c854ff5088992b46c5
[]
no_license
jianghan200/wxsrc6.6.7
d83f3fbbb77235c7f2c8bc945fa3f09d9bac3849
eb6c56587cfca596f8c7095b0854cbbc78254178
refs/heads/master
2020-03-19T23:40:49.532494
2018-06-12T06:00:50
2018-06-12T06:00:50
137,015,278
4
2
null
null
null
null
UTF-8
Java
false
false
2,851
java
package com.tencent.mm.protocal.c; public final class nh extends com.tencent.mm.bk.a { public String rro; public String rrp; public String rrq; public int rrr; public int rrs; public String rrt; public int rru; protected final int a(int paramInt, Object... paramVarArgs) { if (paramInt == 0) { paramVarArgs = (f.a.a.c.a)paramVarArgs[0]; if (this.rro != null) { paramVarArgs.g(1, this.rro); } if (this.rrp != null) { paramVarArgs.g(2, this.rrp); } if (this.rrq != null) { paramVarArgs.g(3, this.rrq); } paramVarArgs.fT(4, this.rrr); paramVarArgs.fT(5, this.rrs); if (this.rrt != null) { paramVarArgs.g(6, this.rrt); } paramVarArgs.fT(7, this.rru); return 0; } if (paramInt == 1) { if (this.rro == null) { break label461; } } label461: for (int i = f.a.a.b.b.a.h(1, this.rro) + 0;; i = 0) { paramInt = i; if (this.rrp != null) { paramInt = i + f.a.a.b.b.a.h(2, this.rrp); } i = paramInt; if (this.rrq != null) { i = paramInt + f.a.a.b.b.a.h(3, this.rrq); } i = i + f.a.a.a.fQ(4, this.rrr) + f.a.a.a.fQ(5, this.rrs); paramInt = i; if (this.rrt != null) { paramInt = i + f.a.a.b.b.a.h(6, this.rrt); } return paramInt + f.a.a.a.fQ(7, this.rru); if (paramInt == 2) { paramVarArgs = new f.a.a.a.a((byte[])paramVarArgs[0], unknownTagHandler); for (paramInt = com.tencent.mm.bk.a.a(paramVarArgs); paramInt > 0; paramInt = com.tencent.mm.bk.a.a(paramVarArgs)) { if (!super.a(paramVarArgs, this, paramInt)) { paramVarArgs.cJS(); } } break; } if (paramInt == 3) { f.a.a.a.a locala = (f.a.a.a.a)paramVarArgs[0]; nh localnh = (nh)paramVarArgs[1]; switch (((Integer)paramVarArgs[2]).intValue()) { default: return -1; case 1: localnh.rro = locala.vHC.readString(); return 0; case 2: localnh.rrp = locala.vHC.readString(); return 0; case 3: localnh.rrq = locala.vHC.readString(); return 0; case 4: localnh.rrr = locala.vHC.rY(); return 0; case 5: localnh.rrs = locala.vHC.rY(); return 0; case 6: localnh.rrt = locala.vHC.readString(); return 0; } localnh.rru = locala.vHC.rY(); return 0; } return -1; } } } /* Location: /Users/Han/Desktop/wxall/微信反编译/反编译 6.6.7/dex2jar-2.0/classes4-dex2jar.jar!/com/tencent/mm/protocal/c/nh.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "526687570@qq.com" ]
526687570@qq.com
7d4f813980d18a1dee453277e7b2f961a813ecf1
767fcaecb092d294e26734f520d59bedeb3cfd9d
/BusApp/src/main/java/com/bus/app/controller/TestBusController.java
337319d56ce2d29ad5dcc407c0b21e43f946f7ac
[]
no_license
ABLive/BusApp
84b5b3493ea779ce9efad4c55ab81932f2112ad0
fafa4b28187448d33cce5d43ae0c956c28b81f54
refs/heads/master
2020-04-27T01:56:27.026883
2019-03-10T17:04:45
2019-03-10T17:04:45
173,979,212
0
0
null
null
null
null
UTF-8
Java
false
false
485
java
package com.bus.app.controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; @RestController public class TestBusController { @RequestMapping(value = "/sonu/learningREST", method = RequestMethod.GET) public TestBus something() { TestBus t1 = new TestBus(); t1.setTestBusId(1001); t1.setBusColor("RED"); return t1; } }
[ "test@test.com" ]
test@test.com
a4ed805fc4fb24f66354a985f2373cd3e6144b1d
bbe10639bb9c8f32422122c993530959534560e1
/delivery/app-release_source_from_JADX/com/google/android/gms/ads/internal/zzm.java
3570c5e4b00ae9450f8d8a51e79cd1cabfadc271
[ "Apache-2.0" ]
permissive
ANDROFAST/delivery_articulos
dae74482e41b459963186b6e7e3d6553999c5706
ddcc8b06d7ea2895ccda2e13c179c658703fec96
refs/heads/master
2020-04-07T15:13:18.470392
2018-11-21T02:15:19
2018-11-21T02:15:19
158,476,390
0
0
null
null
null
null
UTF-8
Java
false
false
1,105
java
package com.google.android.gms.ads.internal; import android.content.Context; import com.google.android.gms.ads.internal.client.zzw.zza; import com.google.android.gms.ads.internal.util.client.zzb; import com.google.android.gms.internal.zzha; @zzha public class zzm extends zza { private static final Object zzqf = new Object(); private static zzm zzqg; private final Context mContext; private boolean zzqh = false; zzm(Context context) { this.mContext = context; } public static zzm zzr(Context context) { zzm com_google_android_gms_ads_internal_zzm; synchronized (zzqf) { if (zzqg == null) { zzqg = new zzm(context.getApplicationContext()); } com_google_android_gms_ads_internal_zzm = zzqg; } return com_google_android_gms_ads_internal_zzm; } public void zza() { synchronized (zzqf) { if (this.zzqh) { zzb.zzaH("Mobile ads is initialized already."); return; } this.zzqh = true; } } }
[ "cespedessanchezalex@gmail.com" ]
cespedessanchezalex@gmail.com
f2b4094d0f2fc4b8f53d422b5de53c58600f51fa
22919f620c40af4b6f2cffdf66e0e57af9fc4a85
/guns-admin/src/main/java/com/stylefeng/guns/netty/requestEntity/BillCodeDefinitionVOEntity.java
bed708eac5ea3b0b210b21b057bf4bdc22f8bdfb
[ "Apache-2.0" ]
permissive
iam6/best
0a44d2ccb853266b139b6d6ad08260ac16cb2b2b
398b6f65bb41acb7decfbda09f9032f2e19e50dd
refs/heads/master
2020-04-13T05:39:53.791389
2018-08-24T05:48:49
2018-08-24T05:48:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,065
java
package com.stylefeng.guns.netty.requestEntity; /** * 缓存的面单规则 */ public class BillCodeDefinitionVOEntity { private String code; //面单种类编码 private String name; //面单种类名称 private Boolean isList; //是否有明细 private Integer unitNumber; //单位数目 private String startChars; //开始字符 private Integer afterLength; //开始字符之后的字长度 private Integer totalLength; //面单字符总长度 private Integer billTypeId;//面单类型 id private long syncVersion; //版本号 private String billTypeName; //面单类型名称 private Boolean isEBill; //是否是电子面单 public Boolean getIsList() { return isList; } public void setIsList(Boolean list) { isList = list; } @Override public String toString() { return "BillCodeDefinitionVOEntity{" + "code='" + code + '\'' + ", name='" + name + '\'' + ", isList=" + isList + ", unitNumber=" + unitNumber + ", startChars='" + startChars + '\'' + ", afterLength=" + afterLength + ", totalLength=" + totalLength + ", billTypeId=" + billTypeId + ", syncVersion=" + syncVersion + ", billTypeName='" + billTypeName + '\'' + ", isEBill=" + isEBill + '}'; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getUnitNumber() { return unitNumber; } public void setUnitNumber(Integer unitNumber) { this.unitNumber = unitNumber; } public String getStartChars() { return startChars; } public void setStartChars(String startChars) { this.startChars = startChars; } public Integer getAfterLength() { return afterLength; } public void setAfterLength(Integer afterLength) { this.afterLength = afterLength; } public Integer getTotalLength() { return totalLength; } public void setTotalLength(Integer totalLength) { this.totalLength = totalLength; } public Integer getBillTypeId() { return billTypeId; } public void setBillTypeId(Integer billTypeId) { this.billTypeId = billTypeId; } public long getSyncVersion() { return syncVersion; } public void setSyncVersion(long syncVersion) { this.syncVersion = syncVersion; } public String getBillTypeName() { return billTypeName; } public void setBillTypeName(String billTypeName) { this.billTypeName = billTypeName; } public Boolean getIsEBill() { return isEBill; } public void setIsEBill(Boolean EBill) { isEBill = EBill; } }
[ "438483836@qq.com" ]
438483836@qq.com
4673edbd1dfa0363bcc7f55b45d679cebe19d83a
e465358040c4de9d5dc9a3e1e08fa4eb27547810
/asterixdb/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AStringPrinter.java
6f379271af5d90577bb65a03c8690b8ddee3f7e1
[]
no_license
zhaosheng-zhang/cdnc
84ff7511b57c260e070fc0f3f1d941f39101116e
bc436a948ab1a7eb5df9857916592c7e7b39798c
refs/heads/master
2016-08-04T18:43:31.480569
2013-10-15T17:29:04
2013-10-15T17:29:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,406
java
/* * Copyright 2009-2013 by The Regents of the University of California * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * you may obtain a copy of the License from * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package edu.uci.ics.asterix.dataflow.data.nontagged.printers; import java.io.IOException; import java.io.PrintStream; import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException; import edu.uci.ics.hyracks.algebricks.data.IPrinter; import edu.uci.ics.hyracks.algebricks.data.utils.WriteValueTools; public class AStringPrinter implements IPrinter { public static final AStringPrinter INSTANCE = new AStringPrinter(); @Override public void init() { } @Override public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException { try { WriteValueTools.writeUTF8String(b, s + 1, l - 1, ps); } catch (IOException e) { throw new AlgebricksException(e); } } }
[ "happily84@gmail.com" ]
happily84@gmail.com
edd34bf8cc4da31d9b9df0de70e6423a31aab5b8
4d37505edab103fd2271623b85041033d225ebcc
/spring-test/src/test/java/org/springframework/test/util/subpackage/StaticFields.java
92723c0ac97328d42fdfcad76f08161922a6b452
[ "Apache-2.0" ]
permissive
huifer/spring-framework-read
1799f1f073b65fed78f06993e58879571cc4548f
73528bd85adc306a620eedd82c218094daebe0ee
refs/heads/master
2020-12-08T08:03:17.458500
2020-03-02T05:51:55
2020-03-02T05:51:55
232,931,630
6
2
Apache-2.0
2020-03-02T05:51:57
2020-01-10T00:18:15
Java
UTF-8
Java
false
false
1,112
java
/* * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.test.util.subpackage; /** * Simple class with static fields; intended for use in unit tests. * * @author Sam Brannen * @since 4.2 */ public class StaticFields { public static String publicField = "public"; private static String privateField = "private"; public static void reset() { publicField = "public"; privateField = "private"; } public static String getPrivateField() { return privateField; } }
[ "huifer97@163.com" ]
huifer97@163.com
2f686dbbc95c40f41083eb01213f5ec6f8b6cad1
bc794d54ef1311d95d0c479962eb506180873375
/kerenpaie/kerenpaie-rest/src/main/java/com/keren/kerenpaie/jaxrs/ifaces/employes/CategorieRS.java
cf610a4a7b4c0726d0c1f75042cdc53a21467b04
[]
no_license
Teratech2018/Teratech
d1abb0f71a797181630d581cf5600c50e40c9663
612f1baf9636034cfa5d33a91e44bbf3a3f0a0cb
refs/heads/master
2021-04-28T05:31:38.081955
2019-04-01T08:35:34
2019-04-01T08:35:34
122,177,253
0
0
null
null
null
null
UTF-8
Java
false
false
362
java
package com.keren.kerenpaie.jaxrs.ifaces.employes; import com.keren.kerenpaie.model.employes.Categorie; import com.megatimgroup.generic.jax.rs.layer.ifaces.GenericService; /** * Interface du service JAX-RS * @since Thu Mar 01 10:22:26 GMT+01:00 2018 * */ public interface CategorieRS extends GenericService<Categorie, Long> { }
[ "bekondo_dieu@yahoo.fr" ]
bekondo_dieu@yahoo.fr
1b0402d59afac08b416ab46a1137b0cd7ebfdde0
71505060050f0a9f4e6478e1755280c2bbaccac9
/morganStanley/src/main/java/com/suidifu/morganstanley/model/request/repayment/CheckPrepayment.java
a1c508f3307745996daf84bf43358439ac86b599
[]
no_license
soldiers1989/comsui
1f73003e7345946ef51af7d73ee3da593f6151ed
6f5c8a28fb1f58e0afc979a1dd5f2e43cbfa09cc
refs/heads/master
2020-03-27T19:25:33.560060
2018-07-06T06:21:05
2018-07-06T06:21:05
146,988,141
0
1
null
2018-09-01T10:11:31
2018-09-01T10:11:31
null
UTF-8
Java
false
false
3,528
java
package com.suidifu.morganstanley.model.request.repayment; import com.suidifu.matryoshka.customize.CustomizeServices; import com.suidifu.matryoshka.handler.ProductCategoryCacheHandler; import com.suidifu.matryoshka.handler.SandboxDataSetHandler; import com.suidifu.matryoshka.productCategory.ProductCategory; import com.suidifu.matryoshka.snapshot.ContractSnapshot; import com.suidifu.matryoshka.snapshot.SandboxDataSet; import com.suidifu.morganstanley.controller.api.repayment.PrepaymentController; import com.zufangbao.gluon.api.earth.v3.model.ApiMessage; import com.zufangbao.gluon.exception.ApiException; import com.zufangbao.gluon.spec.earth.v3.ApiResponseCode; import com.zufangbao.sun.utils.AmountUtils; import com.zufangbao.sun.utils.DateUtils; import com.zufangbao.sun.utils.JsonUtils; import com.zufangbao.sun.utils.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import javax.validation.constraints.NotNull; import java.math.BigDecimal; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * 校验提前全额还款接口请求参数 * @author louguanyang at 2017/10/16 14:35 */ public class CheckPrepayment { /** * 校验提前还款请求参数 * * @param prepayment 提前还款请求参数 */ public static void check(@NotNull Prepayment prepayment) { Integer hasDeducted = prepayment.getHasDeducted(); if (hasDeducted != null) { if (hasDeducted < 0 || hasDeducted > 1) { throw new ApiException(ApiMessage.INVALID_PARAMS.getCode(), "hasDeducted:错误,取值范围:0-[本端未扣款],1-[对端已扣款]"); } } if (AmountUtils.notEquals(prepayment.getAssetInitialValueBD(), prepayment.getAmount())) { throw new ApiException(ApiMessage.INVALID_PARAMS.getCode(), "提前还款明细金额之和与总金额[assetInitialValue]不匹配"); } } public static void checkInterestAndPrincipal(@NotNull Prepayment prepayment, boolean isWF, SandboxDataSetHandler sandboxDataSetHandler, ProductCategoryCacheHandler productCategoryCacheHandler){ Map<String, String> preRequest = new HashMap<>(); List<BigDecimal> interests = new ArrayList<>(); List<BigDecimal> principals = new ArrayList<>(); List<String> assetRecycleDates = new ArrayList<>(); interests.add(new BigDecimal(prepayment.getAssetInterest())); principals.add(new BigDecimal(prepayment.getAssetInterest())); assetRecycleDates.add(prepayment.getAssetRecycleDate()); preRequest.put("interest", JsonUtils.toJSONString(interests)); preRequest.put("principal", JsonUtils.toJSONString(principals)); preRequest.put("assetRecycleDate", JsonUtils.toJSONString(assetRecycleDates)); preRequest.put("uniqueId", prepayment.getUniqueId()); preRequest.put("contractNo", prepayment.getContractNo()); if(isWF) { ProductCategory productCategory = productCategoryCacheHandler.get("importAssetPackage/weifang/10003", true); CustomizeServices services = (CustomizeServices) productCategoryCacheHandler.getScript(productCategory); boolean result = services.evaluate(sandboxDataSetHandler, preRequest, new HashMap<>(), LogFactory.getLog(PrepaymentController.class)); if(!result){ throw new ApiException(ApiResponseCode.CUSTOMER_FEE_CHECK_FAIL); } } } }
[ "mwf5310@163.com" ]
mwf5310@163.com
1b5e2e69c27cec8a6ab98868e7d8bc7817420c54
ed5159d056e98d6715357d0d14a9b3f20b764f89
/test/irvine/oeis/a010/A010434Test.java
a840f2f0930efc51dfea2c8f261a35ddeaead103
[]
no_license
flywind2/joeis
c5753169cf562939b04dd246f8a2958e97f74558
e5efd6971a0062ac99f4fae21a7c78c9f9e74fea
refs/heads/master
2020-09-13T18:34:35.080552
2019-11-19T05:40:55
2019-11-19T05:40:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
195
java
package irvine.oeis.a010; import irvine.oeis.AbstractSequenceTest; /** * Tests the corresponding class. * @author Sean A. Irvine */ public class A010434Test extends AbstractSequenceTest { }
[ "sairvin@gmail.com" ]
sairvin@gmail.com
e8dc381c2c653d93a3f151285319fbd2617a82bb
92cbd572d8239de627a4ff89558a2c5d6a84c240
/clonepedia/src/clonepedia/java/visitor/CollectStatementInMethodVisitor.java
07e07064664cb148d6e6c54e3e03a0f9f7a58a65
[]
no_license
llmhyy/clonepedia
95491e0948561b170ca770e1b6d4c01a50f8cb7c
04fc913af7e9884b53904ac4f96225bc29c8552c
refs/heads/master
2020-12-11T04:00:26.152439
2019-11-08T12:58:38
2019-11-08T12:58:38
68,502,477
2
1
null
null
null
null
UTF-8
Java
false
false
777
java
package clonepedia.java.visitor; import java.util.ArrayList; import org.eclipse.jdt.core.dom.ASTNode; import org.eclipse.jdt.core.dom.ASTVisitor; import org.eclipse.jdt.core.dom.Block; import org.eclipse.jdt.core.dom.Statement; public class CollectStatementInMethodVisitor extends ASTVisitor { private ArrayList<Statement> totalStatList = new ArrayList<Statement>(); @Override public boolean preVisit2(ASTNode node){ if(node instanceof Statement){ Statement stat = (Statement)node; if(!(stat instanceof Block)){ totalStatList.add(stat); return false; } else{ return true; } } else{ return true; } } public ArrayList<Statement> getTotalStatementList(){ return totalStatList; } }
[ "llmhyy@gmail.com" ]
llmhyy@gmail.com
e95700ed6c9d29d1fc82512e91a90d4420d4f157
6635387159b685ab34f9c927b878734bd6040e7e
/src/ve.java
412012dca48d0a8ed0e1d04c2cd33fe029fa5530
[]
no_license
RepoForks/com.snapchat.android
987dd3d4a72c2f43bc52f5dea9d55bfb190966e2
6e28a32ad495cf14f87e512dd0be700f5186b4c6
refs/heads/master
2021-05-05T10:36:16.396377
2015-07-16T16:46:26
2015-07-16T16:46:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
177
java
public abstract interface ve { public abstract long a(int paramInt); } /* Location: * Qualified Name: ve * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "reverseengineeringer@hackeradmin.com" ]
reverseengineeringer@hackeradmin.com
4e4f847a959e71daa28271bd9dedda1d3e80f113
6ae9a5d840a7a80ce97906e4576a2f9611817a86
/src/main/java/edu/arizona/biosemantics/oto2/oto/shared/model/community/Synonymization.java
60d62e96851aefdee94686b957f6cbf23efe1395
[]
no_license
rodenhausen/otosteps
e581d5ba93ea06054aea2a5f70a146c56a6eb01f
4ab7615d1ff754e3166827076108cbbd04ca150f
refs/heads/master
2021-01-10T20:17:53.933206
2014-11-19T13:20:09
2014-11-19T13:20:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
663
java
package edu.arizona.biosemantics.oto2.oto.shared.model.community; import java.io.Serializable; import java.util.HashSet; import java.util.Set; public class Synonymization implements Serializable { private String label; private String mainTerm; private Set<String> synonyms = new HashSet<String>(); public Synonymization(String label, String mainTerm, Set<String> synonyms) { this.label = label; this.mainTerm = mainTerm; this.synonyms = synonyms; } public String getLabel() { return label; } public String getMainTerm() { return mainTerm; } public Set<String> getSynonyms() { return synonyms; } }
[ "thomas.rodenhausen@gmail.com" ]
thomas.rodenhausen@gmail.com
8d9a9367e67851f73eb2193824533ee7d330dc18
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XWIKI-12584-2-3-NSGA_II-WeightedSum:TestLen:CallDiversity/com/xpn/xwiki/store/XWikiHibernateStore_ESTest_scaffolding.java
cd575d9c9a4248d66382bd0cca849b519f262008
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
443
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Wed Apr 01 14:54:37 UTC 2020 */ package com.xpn.xwiki.store; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class XWikiHibernateStore_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
048d9af26435185bef33d59f4220203dce1697e0
d16724e97358f301e99af0687f5db82d9ac4ff7e
/rawdata/java/snippets/243.java
8fbbbdf36678ce89d11ce531a1289bdf87d24a54
[]
no_license
kaushik-rohit/code2seq
39b562f79e9555083c18c73c05ffc4f379d1f3b8
c942b95d7d5997e5b2d45ed8c3161ca9296ddde3
refs/heads/master
2022-11-29T11:46:43.105591
2020-01-04T02:04:04
2020-01-04T02:04:04
225,870,854
0
0
null
2022-11-16T09:21:10
2019-12-04T13:12:59
C#
UTF-8
Java
false
false
215
java
void add(long value) { if (value >= 0) { if (count > 0) { min = Math.min(min, value); max = Math.max(max, value); } else { min = value; max = value; } count++; sum += value; } }
[ "kaushikrohit325@gmail.com" ]
kaushikrohit325@gmail.com
2930fe279c013ce8cfe10742878e7d30d077af80
e9d98aa0d0f9e684db84fae1069a657d679e3a64
/Jsp25_3/src/com/study/jsp/modifyOk.java
0bd9ad7755a51615c2ba45e241fa86951d9a1731
[]
no_license
jbisne/Web
d6190b2a26abd82d8b06d3e8543fedb243a522b1
425d795bbb38622dd394e912a17562828d060fb6
refs/heads/master
2022-12-23T21:53:17.202096
2019-06-08T20:26:34
2019-06-08T20:26:34
172,474,634
0
0
null
2022-12-16T02:41:48
2019-02-25T09:25:41
JavaScript
UTF-8
Java
false
false
1,748
java
package com.study.jsp; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; public class modifyOk implements Service { public modifyOk() { } @Override public void execute(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { System.out.println("modify ok"); MemberDto dto = new MemberDto(); MemberDao dao = MemberDao.getInstance(); HttpSession session = request.getSession(); String id = (String)session.getAttribute("id"); dto.setId(id); dto.setPw(request.getParameter("pw")); //dto.setName(request.getParameter("name")); dto.seteMail(request.getParameter("eMail")); dto.setAddress(request.getParameter("address")); response.setContentType("text/html; charset=UTF-8"); PrintWriter writer = response.getWriter(); int ri = dao.updateMember(dto); if(ri == 1) { System.out.println("변경 성공"); //html 출력 writer.println("<html><head></head><body>"); writer.println("<script language=\"javascript\">"); writer.println(" alert(\"정보 수정 성공.\");"); writer.println(" document.location.href=\"main.jsp\";"); writer.println("</script>"); writer.println("</body></html>"); writer.close(); }else { //html 출력 writer.println("<html><head></head><body>"); writer.println("<script language=\"javascript\">"); writer.println(" alert(\"정보 수정 실패.\");"); writer.println(" document.location.href=\"modify.jsp\";"); writer.println("</script>"); writer.println("</body></html>"); writer.close(); } } }
[ "jisun7894@gmail.com" ]
jisun7894@gmail.com
83a086ddb9f1cbad282a6ce3e20ab2b137dfcdf8
9c00688a804f059fa128cc929ec5523351731b3e
/hot-deploy/demo/src/localhost/services/DocService/DocService.java
9cba6501c2d93ac48411e2a65c1029317d0df71e
[]
no_license
yangrui110/asunerp
f37b4c9f425cd67c9dd6fc35cac124ae9f89e241
3f702ce694b7b7bd6df77a60cd6578a8e1744bb5
refs/heads/master
2020-05-07T12:45:16.575197
2019-04-10T07:46:41
2019-04-10T07:46:41
180,295,937
0
0
null
null
null
null
UTF-8
Java
false
false
510
java
/** * DocService.java * * This file was auto-generated from WSDL * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package localhost.services.DocService; public interface DocService extends javax.xml.rpc.Service { public String getDocServiceHttpPortAddress(); public DocServicePortType getDocServiceHttpPort() throws javax.xml.rpc.ServiceException; public DocServicePortType getDocServiceHttpPort(java.net.URL portAddress) throws javax.xml.rpc.ServiceException; }
[ "“Youremail@xxx.com”" ]
“Youremail@xxx.com”
cafe4d2846211e1aba9b366b4378aab5f52161e6
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_3b93676832694dac6355846a9e51c1763b9d8a90/Authenticator/2_3b93676832694dac6355846a9e51c1763b9d8a90_Authenticator_s.java
5ee4cd58ff49f237ca3e2326f54592bc3ca4ee57
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
7,181
java
/** * Copyright 2005-2009 Noelios Technologies. * * The contents of this file are subject to the terms of one of the following * open source licenses: LGPL 3.0 or LGPL 2.1 or CDDL 1.0 or EPL 1.0 (the * "Licenses"). You can select the license that you prefer but you may not use * this file except in compliance with one of these Licenses. * * You can obtain a copy of the LGPL 3.0 license at * http://www.opensource.org/licenses/lgpl-3.0.html * * You can obtain a copy of the LGPL 2.1 license at * http://www.opensource.org/licenses/lgpl-2.1.php * * You can obtain a copy of the CDDL 1.0 license at * http://www.opensource.org/licenses/cddl1.php * * You can obtain a copy of the EPL 1.0 license at * http://www.opensource.org/licenses/eclipse-1.0.php * * See the Licenses for the specific language governing permissions and * limitations under the Licenses. * * Alternatively, you can obtain a royalty free commercial license with less * limitations, transferable or non-transferable, directly at * http://www.noelios.com/products/restlet-engine * * Restlet is a registered trademark of Noelios Technologies. */ package org.restlet.security; import org.restlet.Context; import org.restlet.Request; import org.restlet.Response; import org.restlet.routing.Filter; /** * Filter authenticating the client sending the request. * * @author Jerome Louvel */ public abstract class Authenticator extends Filter { /** * Indicates if the authenticator is not required to succeed. In those * cases, the attached Restlet is invoked. */ private volatile boolean optional; /** * Invoked upon successful authentication to update the subject with new * principals. */ private volatile Enroler enroler; /** * Default constructor setting the mode to "required". */ public Authenticator(Context context) { this(context, false); } /** * Constructor. Use the context's enroler by default. * * @param optional * The authentication mode. */ public Authenticator(Context context, boolean optional) { this(context, optional, context.getEnroler()); } /** * Constructor. * * @param optional * The authentication mode. * @param enroler * The enroler to invoke upon successful authentication. */ public Authenticator(Context context, boolean optional, Enroler enroler) { super(context); this.optional = optional; this.enroler = enroler; } /** * Attempts to authenticate the subject sending the request. * * @param request * The request sent. * @param response * The response to update. * @return True if the authentication succeeded. */ protected abstract boolean authenticate(Request request, Response response); /** * Handles the authentication by first invoking the * {@link #authenticate(Request, Response)} method. Then, depending on the * result and the mode set, it either skips or invoke the (optionally) * attached Restlet. */ @Override protected int beforeHandle(Request request, Response response) { if (authenticate(request, response)) { return authenticated(request, response); } else { return unauthenticated(request, response); } } /** * Invoked upon successful authentication. By default, it updates the * request's clientInfo and challengeResponse "authenticated" properties, * clears the existing challenge requests on the response, calls the enroler * and finally returns {@link Filter#CONTINUE}. * * @param request * The request sent. * @param response * The response to update. * @return The filter continuation code. */ @SuppressWarnings("deprecation") protected int authenticated(Request request, Response response) { // Update the challenge response accordingly if (request.getChallengeResponse() != null) { request.getChallengeResponse().setAuthenticated(true); } // Update the client info accordingly if (request.getClientInfo() != null) { request.getClientInfo().setAuthenticated(true); } // Clear previous challenge requests response.getChallengeRequests().clear(); // Add the roles for the authenticated subject if (getEnroler() != null) { getEnroler().enrole(request.getClientInfo()); } return CONTINUE; } /** * Invoked upon failed authentication. By default, it updates the request's * clientInfo and challengeResponse "authenticated" properties, and returns * {@link Filter#STOP}. * * @param request * The request sent. * @param response * The response to update. * @return The filter continuation code. */ @SuppressWarnings("deprecation") protected int unauthenticated(Request request, Response response) { if (isOptional()) { return CONTINUE; } else { // Update the challenge response accordingly if (request.getChallengeResponse() != null) { request.getChallengeResponse().setAuthenticated(false); } // Update the client info accordingly if (request.getClientInfo() != null) { request.getClientInfo().setAuthenticated(false); } // Stop the filtering chain return STOP; } } /** * Returns the enroler invoked upon successful authentication to update the * subject with new principals. Typically new {@link RolePrincipal} are * added based on the available {@link UserPrincipal} instances available. * * @return The enroler invoked upon successful authentication */ public Enroler getEnroler() { return enroler; } /** * Indicates if the authenticator is not required to succeed. In those * cases, the attached Restlet is invoked. * * @return True if the authentication success is optional. */ public boolean isOptional() { return optional; } /** * Sets the enroler invoked upon successful authentication. * * @param enroler * The enroler invoked upon successful authentication. */ public void setEnroler(Enroler enroler) { this.enroler = enroler; } /** * Indicates if the authenticator is not required to succeed. In those * cases, the attached Restlet is invoked. * * @param optional * True if the authentication success is optional. */ public void setOptional(boolean optional) { this.optional = optional; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
aab16476bd2977af8ec69aefaaed7da917bb54e3
bf3af327858203ea2e8941e48031f7c3f0a6c4e9
/src/com/op/entity/pointService/project/PojectPraise.java
f20a457c1cf445a3f3edc920a3e0bbe2dd21a5a0
[]
no_license
luotianwen/outdoorPortal
3bf2b7c2fedc34409291427429f4e40bce941fda
9d3c0601415a9bfb0720798b1f38586b282c8506
refs/heads/master
2021-06-24T01:07:00.413497
2017-09-09T15:01:53
2017-09-09T15:01:53
102,962,941
1
0
null
null
null
null
UTF-8
Java
false
false
1,094
java
package com.op.entity.pointService.project; import java.io.Serializable; /** * 项目点赞(pojectPraise)实体类 * @author Win Zhong * @version Revision: 1.00 * Date: 2016-06-27 15:25:43 */ public class PojectPraise implements Serializable { /** * */ private static final long serialVersionUID = 1L; //id private int pp_id; //项目ID private int pp_project_id; //用户ID private String pp_user_id; /** *id * @return */ public int getPp_id() { return pp_id; } /** *id * @param type */ public void setPp_id(int pp_id) { this.pp_id = pp_id; } /** *项目ID * @return */ public int getPp_project_id() { return pp_project_id; } /** *项目ID * @param type */ public void setPp_project_id(int pp_project_id) { this.pp_project_id = pp_project_id; } /** *用户ID * @return */ public String getPp_user_id() { return pp_user_id; } /** *用户ID * @param type */ public void setPp_user_id(String pp_user_id) { this.pp_user_id = pp_user_id; } }
[ "tw l" ]
tw l
bf8f97d8f084cfce86996f4a4035fddc9fad3d88
ddcf75561b40464bdfa36b6208b8ae1f1f43dd93
/app/src/main/java/com/blankj/androidutilcode/activities/ToastActivity.java
b7dca9e0b6a8ae8d355ae280f249a870f4a619f7
[ "Apache-2.0" ]
permissive
zhutengfei/AndroidUtilCode
343d10c5f89b6b07e47e5aa48223f25232fb8e04
481f98cc7d4dfba7779dbf7005222eaedacb651e
refs/heads/master
2021-01-11T12:01:16.025301
2016-12-13T15:04:04
2016-12-13T15:04:04
76,612,755
1
0
null
2016-12-16T02:08:33
2016-12-16T02:08:32
null
UTF-8
Java
false
false
2,826
java
package com.blankj.androidutilcode.activities; import android.app.Activity; import android.content.Context; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.TextView; import com.blankj.androidutilcode.R; import com.blankj.utilcode.utils.ToastUtils; /** * <pre> * author: Blankj * blog : http://blankj.com * time : 2016/9/29 * desc : Toast工具类Demo * </pre> */ public class ToastActivity extends Activity implements View.OnClickListener { private Context mContext; private boolean isJumpWhenMore; private TextView tvAboutToast; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_toast); mContext = this; isJumpWhenMore = false; tvAboutToast = (TextView) findViewById(R.id.tv_about_toast); findViewById(R.id.btn_is_jump_when_more).setOnClickListener(this); findViewById(R.id.btn_show_short_toast_safe).setOnClickListener(this); findViewById(R.id.btn_show_long_toast_safe).setOnClickListener(this); findViewById(R.id.btn_show_short_toast).setOnClickListener(this); findViewById(R.id.btn_show_long_toast).setOnClickListener(this); findViewById(R.id.btn_cancel_toast).setOnClickListener(this); tvAboutToast.setText(String.format("Is Jump When More: %b", isJumpWhenMore)); } @Override public void onClick(View view) { switch (view.getId()) { case R.id.btn_is_jump_when_more: ToastUtils.init(isJumpWhenMore = !isJumpWhenMore); break; case R.id.btn_show_short_toast_safe: new Thread(new Runnable() { @Override public void run() { ToastUtils.showShortToastSafe(mContext, "show_short_toast_safe"); } }).start(); break; case R.id.btn_show_long_toast_safe: new Thread(new Runnable() { @Override public void run() { ToastUtils.showLongToastSafe(mContext, "show_long_toast_safe"); } }).start(); break; case R.id.btn_show_short_toast: ToastUtils.showShortToast(mContext, "show_short_toast"); break; case R.id.btn_show_long_toast: ToastUtils.showShortToast(mContext, "show_long_toast"); break; case R.id.btn_cancel_toast: ToastUtils.cancelToast(); break; } tvAboutToast.setText(String.format("Is Jump When More: %b", isJumpWhenMore)); } }
[ "625783482@qq.com" ]
625783482@qq.com
6b48a28e470d1456ea5e2d501c6669fb2db0e5d7
30436ce0097ffbc25ec3fe731405121409bfe5e4
/bin/modules/common/src/main/java/com/beanframework/common/specification/CommonSpecification.java
61f1a47995b0f1ffc1bc84f33d6419123bd1fbae
[ "MIT" ]
permissive
williamtanws/beanframework
0ff351dc68dbc1a0fbf389c99de89ce35624f995
f89e6708f9e7deb79188cff7e306ae9487f9291c
refs/heads/master
2023-05-14T02:53:39.497987
2021-05-25T14:31:43
2021-05-25T14:31:43
150,228,256
1
0
MIT
2023-04-29T11:39:26
2018-09-25T07:59:25
JavaScript
UTF-8
Java
false
false
6,070
java
package com.beanframework.common.specification; import java.lang.reflect.Field; import java.util.ArrayList; import java.util.List; import java.util.UUID; import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Predicate; import javax.persistence.criteria.Root; import javax.persistence.criteria.Selection; import org.apache.commons.lang3.StringUtils; import com.beanframework.common.data.DataTableColumnSpecs; import com.beanframework.common.data.DataTableRequest; import com.beanframework.common.domain.GenericEntity; import com.beanframework.common.utils.BooleanUtils; import com.beanframework.common.utils.CommonStringUtils; public class CommonSpecification { public static String convertToLikePattern(String value) { if (value.contains("%") == Boolean.FALSE) { value = "%" + value + "%"; } return value; } public static boolean isUuid(String uuid) { try { UUID.fromString(uuid); return true; } catch (IllegalArgumentException e) { return false; } } public static boolean isInteger(String s) { try { Integer.parseInt(s); return true; } catch (NumberFormatException ex) { return false; } } public static String clean(String s) { return s.trim(); } public static <T> AbstractSpecification<T> getCommonSpecification( DataTableRequest dataTableRequest) { return new AbstractSpecification<T>() { private static final long serialVersionUID = 1L; @Override public Predicate toPredicate(Root<T> root, CriteriaQuery<?> query, CriteriaBuilder cb) { return getPredicate(dataTableRequest, root, query, cb); } public String toString() { return dataTableRequest.toString(); } @Override public List<Selection<?>> toSelection(Root<T> root) { return null; } }; } public static <T> Predicate getPredicate(DataTableRequest dataTableRequest, Root<T> root, CriteriaQuery<?> query, CriteriaBuilder cb) { List<Predicate> predicates = new ArrayList<Predicate>(); if (dataTableRequest.isGlobalSearch() && StringUtils.isNotEmpty(dataTableRequest.getSearch())) { if (isUuid(dataTableRequest.getSearch())) { predicates.add(cb.or( cb.equal(root.get(GenericEntity.UUID), UUID.fromString(dataTableRequest.getSearch())))); } predicates.add(cb.or( cb.like(root.get(GenericEntity.ID), convertToLikePattern(dataTableRequest.getSearch())))); for (DataTableColumnSpecs specs : dataTableRequest.getColumns()) { if (specs.getData().equals(GenericEntity.UUID) == Boolean.FALSE && specs.getData().equals(GenericEntity.ID) == Boolean.FALSE) { if (specs.getData().contains(".")) { String[] objectProperty = specs.getData().split("\\."); predicates.add(cb.or(cb.like(root.get(objectProperty[0]).get(objectProperty[1]), convertToLikePattern(dataTableRequest.getSearch())))); } else { try { Field field = root.getJavaType().getDeclaredField(specs.getData()); field.setAccessible(true); if (field.getType().isAssignableFrom(String.class)) { predicates.add(cb.or(cb.like(root.get(specs.getData()), convertToLikePattern(dataTableRequest.getSearch())))); } else if (field.getType().isAssignableFrom(Integer.class) && CommonStringUtils.isStringInt(dataTableRequest.getSearch())) { predicates.add(cb.or(cb.equal(root.get(specs.getData()), Integer.parseInt(dataTableRequest.getSearch())))); } /* * else if (field.getType().isAssignableFrom(Boolean.class)) { if * (BooleanUtils.parseBoolean(dataTableRequest.getSearch())) { * predicates.add(cb.or(cb.isTrue(root.get(specs.getData())))); } else { * predicates.add(cb.or(cb.isFalse(root.get(specs.getData())))); } } */ } catch (Exception e) { predicates.add(cb.or(cb.like(root.get(specs.getData()), convertToLikePattern(dataTableRequest.getSearch())))); } } } } } else { for (DataTableColumnSpecs specs : dataTableRequest.getColumns()) { if (StringUtils.isNotBlank(specs.getSearch())) { if (specs.getData().contains(".")) { String[] objectProperty = specs.getData().split("\\."); predicates.add(cb.or(cb.like(root.get(objectProperty[0]).get(objectProperty[1]), convertToLikePattern(specs.getSearch())))); } else { try { Field field = root.getJavaType().getDeclaredField(specs.getData()); field.setAccessible(true); if (field.getType().isAssignableFrom(String.class)) { predicates.add(cb.or( cb.like(root.get(specs.getData()), convertToLikePattern(specs.getSearch())))); } else if (field.getType().isAssignableFrom(Integer.class)) { predicates.add(cb.or(cb.equal(root.get(specs.getData()), specs.getSearch()))); } else if (field.getType().isAssignableFrom(Boolean.class)) { if (BooleanUtils.parseBoolean(specs.getSearch())) { predicates.add(cb.or(cb.isTrue(root.get(specs.getData())))); } else { predicates.add(cb.or(cb.isFalse(root.get(specs.getData())))); } } } catch (Exception e) { predicates.add(cb .or(cb.like(root.get(specs.getData()), convertToLikePattern(specs.getSearch())))); } } } } } if (predicates.isEmpty()) { return cb.and(predicates.toArray(new Predicate[predicates.size()])); } else { return cb.or(predicates.toArray(new Predicate[predicates.size()])); } } }
[ "william.tan@bertelsmann.de" ]
william.tan@bertelsmann.de
4d8493a6916c8e8566790f266dcf301db6018595
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/27/27_6f58fb0b3507e90287096c42e74482afdade8078/CurveLine3Points/27_6f58fb0b3507e90287096c42e74482afdade8078_CurveLine3Points_t.java
f41d05037f21dbcc0b11fb01a0bef2e2716a6466
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
2,059
java
package com.spongeblob.paint.model; import java.awt.Color; import java.awt.Graphics; import java.util.LinkedList; import java.util.List; import org.codehaus.jackson.annotate.JsonIgnore; import com.spongeblob.paint.utils.PointUtil; public class CurveLine3Points extends AbstractShape{ /** * */ private static final long serialVersionUID = 3456072526729463848L; private static float STEP = 0.1f; public CurveLine3Points(){} public CurveLine3Points(int x, int y, Color c){ points = new LinkedList<Point>(); points.add(new Point(x, y)); color = c; } public void drawPathPoints(Graphics g) { g.setColor(getColor()); g.drawPolyline(PointUtil.getXs(points), PointUtil.getYs(points), points.size()); for (Point point : points) { PointUtil.paintCircleAroundPoint(g, point); } } public void draw(Graphics g) { g.setColor(getColor()); List<Point> curvePoints = getCurvePoints(); g.drawPolyline(PointUtil.getXs(curvePoints), PointUtil.getYs(curvePoints), curvePoints.size()); } @JsonIgnore public List<Point> getCurvePoints() { List<Point> pathPoints = new LinkedList<Point>(); if (points.size() > 2){ for (int i = 0; i < points.size() - 2; i= i + 2) { pathPoints.addAll(calculateCurveLine3Points(points.get(i).x, points.get(i).y, points.get(i + 1).x, points.get(i + 1).y, points.get(i + 2).x, points.get(i + 2).y)); } } return pathPoints; } /* Formula: * ((1-t)^2 * P1) + (2*(t)*(1-t) * P2) + ((tt) * P3) */ public List<Point> calculateCurveLine3Points(float x1, float y1, float x2, float y2, float x3, float y3) { List<Point> mPoints = new LinkedList<Point>(); for(float t=0; t <= 1; t += STEP){ final float u = 1 - t; final float tt = t*t; final float uu = u*u; final float ut2 = 2 * u * t; final float x = (uu * x1) + (ut2 * x2) + (tt * x3); final float y = (uu * y1) + (ut2 * y2) + (tt * y3); mPoints.add(new Point((int)x, (int)y)); } return mPoints; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
b4b9955504a7b06ae39b832adb9a3cdd45882c7c
b6f0618096b05a10a7507e391ca837a5ee126736
/src/zReplit/Task164_MethodsWithReturn2_Max.java
e9c065852109366b2bd8c96db3e37cab51e010d3
[]
no_license
toyligb/JavaProgramming
572687ff0532b1eb5992c8035e1339d0ad25b7ad
6a1d04487bf614c47939d34cb3fd8405cf1c467d
refs/heads/master
2021-01-07T20:23:17.006616
2020-02-23T21:54:19
2020-02-23T21:54:19
241,811,088
0
0
null
null
null
null
UTF-8
Java
false
false
376
java
package zReplit; import java.util.*; public class Task164_MethodsWithReturn2_Max { public static void main(String[] args) { System.out.println(max(11, 10)); } public static int max(int x, int max) { // if (x > max) { // return max; // } else { // return x; // } return (x > max)? max : x; } }
[ "toyligb@gmail.com" ]
toyligb@gmail.com
6b93b3f8adc8e7701a226fc17d43cb6f11a0a209
f140118cd3f1b4a79159154087e7896960ca0c88
/sql/core/target/java/org/apache/spark/sql/columnar/INT$.java
6a0274461e451017c57fc5983f61949e87bc1d8b
[]
no_license
loisZ/miaomiaomiao
d45dc779355e2280fe6f505d959b5e5c475f9b9c
6236255e4062d1788d7a212fa49af1849965f22c
refs/heads/master
2021-08-24T09:22:41.648169
2017-12-09T00:56:41
2017-12-09T00:56:41
111,349,685
1
0
null
null
null
null
UTF-8
Java
false
false
1,307
java
package org.apache.spark.sql.columnar; // no position public class INT$ extends org.apache.spark.sql.columnar.NativeColumnType<org.apache.spark.sql.catalyst.types.IntegerType$> { /** * Static reference to the singleton instance of this Scala object. */ public static final INT$ MODULE$ = null; public INT$ () { throw new RuntimeException(); } public void append (int v, java.nio.ByteBuffer buffer) { throw new RuntimeException(); } public void append (org.apache.spark.sql.catalyst.expressions.Row row, int ordinal, java.nio.ByteBuffer buffer) { throw new RuntimeException(); } public int extract (java.nio.ByteBuffer buffer) { throw new RuntimeException(); } public void extract (java.nio.ByteBuffer buffer, org.apache.spark.sql.catalyst.expressions.MutableRow row, int ordinal) { throw new RuntimeException(); } public void setField (org.apache.spark.sql.catalyst.expressions.MutableRow row, int ordinal, int value) { throw new RuntimeException(); } public int getField (org.apache.spark.sql.catalyst.expressions.Row row, int ordinal) { throw new RuntimeException(); } public void copyField (org.apache.spark.sql.catalyst.expressions.Row from, int fromOrdinal, org.apache.spark.sql.catalyst.expressions.MutableRow to, int toOrdinal) { throw new RuntimeException(); } }
[ "283802073@qq.com" ]
283802073@qq.com
388d81a242c87d2dd8de78ebe9942d70bbedb218
cc70f0eac152553f0744954a1c4da8af67faa5ab
/PPA/src/examples/AES/class_1286.java
e8330ea36107456f32f7315816f9f3322c9bcfef
[]
no_license
islamazhar/Detecting-Insecure-Implementation-code-snippets
b49b418e637a2098027e6ce70c0ddf93bc31643b
af62bef28783c922a8627c62c700ef54028b3253
refs/heads/master
2023-02-01T10:48:31.815921
2020-12-11T00:21:40
2020-12-11T00:21:40
307,543,127
0
0
null
null
null
null
UTF-8
Java
false
false
331
java
package examples.AES; public class class_1286 { byte[] iv = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; // use different random value AlgorithmParameterSpec algorithmSpec = new IvParameterSpec(iv); Cipher ecipher = Cipher.getInstance("AES/CBC/PKCS7Padding"); ecipher.init(Cipher.ENCRYPT_MODE, skeySpec, algorithmSpec); }
[ "mislam9@wisc.edu" ]
mislam9@wisc.edu
a6f8ea5b3a2e0939e145fea4853111ea93ffb6dc
e7cab3cd52221f4e60a6684a909c3c79ea6cae4e
/src/main/java/com/climbingzone5/config/AsyncConfiguration.java
4f8b92390078df1307324351ea9feb38bb1bf932
[]
no_license
francoisauxietre/climbingzone5
df014c17511e57f1ab2f7b12ced2c14c8b7fc0f6
89bc6e014a38df8fb17e818cca7610cba0ccb976
refs/heads/master
2022-12-23T07:18:53.945069
2019-10-29T13:40:33
2019-10-29T13:40:33
218,180,644
0
0
null
2019-10-29T01:54:31
2019-10-29T01:43:01
Java
UTF-8
Java
false
false
2,001
java
package com.climbingzone5.config; import io.github.jhipster.async.ExceptionHandlingAsyncTaskExecutor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler; import org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler; import org.springframework.boot.autoconfigure.task.TaskExecutionProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.annotation.AsyncConfigurer; import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import java.util.concurrent.Executor; @Configuration @EnableAsync @EnableScheduling public class AsyncConfiguration implements AsyncConfigurer { private final Logger log = LoggerFactory.getLogger(AsyncConfiguration.class); private final TaskExecutionProperties taskExecutionProperties; public AsyncConfiguration(TaskExecutionProperties taskExecutionProperties) { this.taskExecutionProperties = taskExecutionProperties; } @Override @Bean(name = "taskExecutor") public Executor getAsyncExecutor() { log.debug("Creating Async Task Executor"); ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); executor.setCorePoolSize(taskExecutionProperties.getPool().getCoreSize()); executor.setMaxPoolSize(taskExecutionProperties.getPool().getMaxSize()); executor.setQueueCapacity(taskExecutionProperties.getPool().getQueueCapacity()); executor.setThreadNamePrefix(taskExecutionProperties.getThreadNamePrefix()); return new ExceptionHandlingAsyncTaskExecutor(executor); } @Override public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() { return new SimpleAsyncUncaughtExceptionHandler(); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
566d66dc549bf1bb51b5df7fc561636f160e844b
3de3dae722829727edfdd6cc3b67443a69043475
/cave/com.raytheon.viz.awipstools/src/com/raytheon/viz/awipstools/common/RangeRing.java
b2998fccffe5b03fb943a4e5c3e44a304fa757ff
[ "LicenseRef-scancode-public-domain", "Apache-2.0" ]
permissive
Unidata/awips2
9aee5b7ec42c2c0a2fa4d877cb7e0b399db74acb
d76c9f96e6bb06f7239c563203f226e6a6fffeef
refs/heads/unidata_18.2.1
2023-08-18T13:00:15.110785
2023-08-09T06:06:06
2023-08-09T06:06:06
19,332,079
161
75
NOASSERTION
2023-09-13T19:06:40
2014-05-01T00:59:04
Java
UTF-8
Java
false
false
5,677
java
/** * This software was developed and / or modified by Raytheon Company, * pursuant to Contract DG133W-05-CQ-1067 with the US Government. * * U.S. EXPORT CONTROLLED TECHNICAL DATA * This software product contains export-restricted data whose * export/transfer/disclosure is restricted by U.S. law. Dissemination * to non-U.S. persons whether in the United States or abroad requires * an export license or other authorization. * * Contractor Name: Raytheon Company * Contractor Address: 6825 Pine Street, Suite 340 * Mail Stop B8 * Omaha, NE 68106 * 402.291.0100 * * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ package com.raytheon.viz.awipstools.common; import java.util.Arrays; import com.vividsolutions.jts.geom.Coordinate; /** * A class which represents a RangeRing(although really it can also have * multiple rings around a single center, so its more of a target shaped object * then a ring). * * <pre> * * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * 10-21-09 #1711 bsteffen Initial Comments, changed to accomodate both Fixed and Movable Rings * 08-13-14 #3467 mapeters Modified equals() method to prevent ArrayIndexOutOfBoundsException. * 09-08-16 #5871 njensen Added hashCode() and formatted * * </pre> * * @author unknown */ public class RangeRing { public enum RangeRingType { FIXED, MOVABLE } private RangeRingType type; private boolean visible = false; private String id = ""; private Coordinate centerCoordinate; private int[] radii; private String label = ""; public RangeRing(String id, Coordinate centerCoordinate, int radius, String label) { this(id, centerCoordinate, radius, label, false); } public RangeRing(String id, Coordinate centerCoordinate, int radius, String label, boolean visible) { this.type = RangeRingType.MOVABLE; this.id = id; this.centerCoordinate = centerCoordinate; this.radii = new int[] { radius }; this.label = label; this.visible = visible; } public RangeRing(String id, Coordinate centerCoordinate, int[] radii, String label) { this(id, centerCoordinate, radii, label, false); } public RangeRing(String id, Coordinate centerCoordinate, int[] radii, String label, boolean visible) { this.type = RangeRingType.FIXED; this.id = id; this.centerCoordinate = centerCoordinate; this.radii = radii; this.label = label; this.visible = visible; } public String getId() { return id; } public void setId(String id) { this.id = id; } public Coordinate getCenterCoordinate() { return centerCoordinate; } public void setCenterCoordinate(Coordinate centerCoordinate) { this.centerCoordinate = centerCoordinate; } public int getRadius() { return radii[0]; } public void setRadius(int radius) { this.radii[0] = radius; } public int[] getRadii() { return radii; } public void setRadii(int[] radii) { this.radii = radii; } public String getLabel() { return label; } public void setLabel(String label) { this.label = label; } public boolean isVisible() { return visible; } public void setVisible(boolean visible) { this.visible = visible; } public RangeRingType getType() { return type; } public void setType(RangeRingType type) { this.type = type; } @Override public RangeRing clone() { RangeRing newRing = new RangeRing(this.id, new Coordinate(this.centerCoordinate), Arrays.copyOf(this.radii, this.radii.length), this.label, this.visible); newRing.setType(this.type); return newRing; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((centerCoordinate == null) ? 0 : centerCoordinate.hashCode()); result = prime * result + ((id == null) ? 0 : id.hashCode()); result = prime * result + ((label == null) ? 0 : label.hashCode()); result = prime * result + Arrays.hashCode(radii); result = prime * result + ((type == null) ? 0 : type.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; RangeRing other = (RangeRing) obj; if (centerCoordinate == null) { if (other.centerCoordinate != null) return false; } else if (!centerCoordinate.equals(other.centerCoordinate)) return false; if (id == null) { if (other.id != null) return false; } else if (!id.equals(other.id)) return false; if (label == null) { if (other.label != null) return false; } else if (!label.equals(other.label)) return false; if (!Arrays.equals(radii, other.radii)) return false; if (type != other.type) return false; return true; } }
[ "mjames@unidata.ucar.edu" ]
mjames@unidata.ucar.edu
dfa582b6ac2583a1321086c0dc7d3758c929a481
4694d36492acad39b6464d153e4d3d3ad47c5c57
/adcom/adstock.server/src/main/java/org/adorsys/adstock/recptcls/sls/SlsInvceEvtProcessor.java
dc3bdcf0318862a4fd6edbec94837f205417e976
[ "Apache-2.0" ]
permissive
francis-pouatcha/adcom
36ac7ff33eabb351be78b5555c61498b7bc3de6f
0e3ea1ce6c2045d31c7003fc87dbda533c09c767
refs/heads/master
2021-03-27T20:31:45.315016
2015-06-29T09:32:06
2015-06-29T09:32:06
28,821,594
0
0
null
null
null
null
UTF-8
Java
false
false
3,584
java
package org.adorsys.adstock.recptcls.sls; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.UUID; import javax.ejb.Asynchronous; import javax.ejb.Stateless; import javax.ejb.TransactionAttribute; import javax.ejb.TransactionAttributeType; import javax.inject.Inject; import org.adorsys.adsales.jpa.SlsInvceEvt; import org.adorsys.adsales.jpa.SlsInvceEvtLease; import org.adorsys.adsales.jpa.SlsInvceItem; import org.adorsys.adsales.jpa.SlsInvoice; import org.adorsys.adsales.rest.SlsInvceEvtLeaseEJB; import org.adorsys.adsales.rest.SlsInvceItemLookup; import org.adorsys.adsales.rest.SlsInvoiceLookup; import org.adorsys.adstock.jpa.StkDirectSalesItemHstry; import org.adorsys.adstock.rest.StkDirectSalesItemHstryEJB; import org.apache.commons.lang3.time.DateUtils; /** * Check for the incoming of direct sales closed event and * process corresponding inventory items. * * @author francis * */ @Stateless public class SlsInvceEvtProcessor { @Inject private SlsInvoiceLookup evtDataEJB; @Inject private SlsInvceItemLookup itemEvtDataEJB; @Inject private SlsInvceItemEvtProcessor itemEvtProcessor; @Inject private SlsInvceEvtLeaseEJB evtLeaseEJB; @Inject private StkDirectSalesItemHstryEJB itemHstryEJB; @Inject private SlsInvceEvtProcessorHelper evtProcessorHelper; @Asynchronous @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) public void process(SlsInvceEvt evt) { if(!evtProcessorHelper.shallProcessEvtLease(evt)) return; // This identifies a run. String processId = UUID.randomUUID().toString(); Date now = new Date(); String leaseId = null; // 1. Check if there is a lease associated with this processor. List<SlsInvceEvtLease> leases = evtLeaseEJB.findByEvtIdAndHandlerName(evt.getId(), getHandlerName()); if(leases.isEmpty()){ // create one SlsInvceEvtLease lease = new SlsInvceEvtLease(); lease.setEvtId(evt.getId()); lease.setEvtName(evt.getEvtName()); lease.setHandlerName(getHandlerName()); lease.setProcessOwner(processId); lease = evtLeaseEJB.create(lease); leaseId = lease.getId(); } else { SlsInvceEvtLease lease = leases.iterator().next(); // look if lease expired. if(lease.expired(now)){ leaseId = evtLeaseEJB.recover(processId, lease.getId()); } } if(leaseId==null) return; String entIdentif = evt.getEntIdentif(); SlsInvoice invoice = evtDataEJB.findById(entIdentif); if(invoice==null) { evtProcessorHelper.closeEvtLease(processId, leaseId, evt); return; } String invceNbr = invoice.getInvceNbr(); Long evtDataCount = itemEvtDataEJB.countByInvceNbr(invceNbr); int start = 0; int max = 100; List<String> itemEventDataToProcess = new ArrayList<String>(); while(start<=evtDataCount){ List<SlsInvceItem> list = itemEvtDataEJB.findByInvceNbr(invceNbr, start, max); start +=max; for (SlsInvceItem itemEvtData : list) { StkDirectSalesItemHstry itemEvt = itemHstryEJB.findById(itemEvtData.getIdentif()); if(itemEvt!=null) continue;// processed. itemEventDataToProcess.add(itemEvtData.getId()); } } if(itemEventDataToProcess.isEmpty()) { evtProcessorHelper.closeEvtLease(processId, leaseId, evt); return; } Date time = new Date(); for (String itemEvtDataId : itemEventDataToProcess) { itemEvtProcessor.process(itemEvtDataId, evt); if(DateUtils.addMinutes(new Date(), 1).before(time)){ evtLeaseEJB.recover(processId, leaseId); } } } private String getHandlerName(){ return SlsInvceEvtProcessor.class.getSimpleName(); } }
[ "francis.pouatcha@adorsys.com" ]
francis.pouatcha@adorsys.com
b231f47709a4d0f7f9d48fab37b4af2a453f8cda
352cb15cce9be9e4402131bb398a3c894b9c72bc
/src/main/java/bytedance/other/UTF8.java
22b771c6f26f1083d30611b2511e572bfb5b7090
[ "MIT" ]
permissive
DonaldY/LeetCode-Practice
9f67220bc6087c2c34606f81154a3e91c5ee6673
2b7e6525840de7ea0aed68a60cdfb1757b183fec
refs/heads/master
2023-04-27T09:58:36.792602
2023-04-23T15:49:22
2023-04-23T15:49:22
179,708,097
3
0
null
null
null
null
UTF-8
Java
false
false
1,642
java
package bytedance.other; /** * 拓展练习 - UTF-8 编码验证 * * 这是 UTF-8 编码的工作方式: * * Char. number range | UTF-8 octet sequence * (hexadecimal) | (binary) * --------------------+--------------------------------------------- * 0000 0000-0000 007F | 0xxxxxxx * 0000 0080-0000 07FF | 110xxxxx 10xxxxxx * 0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx * 0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx * * 示例 1: * * data = [197, 130, 1], 表示 8 位的序列: 11000101 10000010 00000001. * * 返回 true 。 * 这是有效的 utf-8 编码,为一个2字节字符,跟着一个1字节字符。 * 示例 2: * * data = [235, 140, 4], 表示 8 位的序列: 11101011 10001100 00000100. * * 返回 false 。 * 前 3 位都是 1 ,第 4 位为 0 表示它是一个3字节字符。 * 下一个字节是开头为 10 的延续字节,这是正确的。 * 但第二个延续字节不以 10 开头,所以是不符合规则的。 * * 题意: 比对 * * 思路: 直接比对 */ public class UTF8 { // Time: o(n), Space: o(1) public boolean validUtf8(int[] data) { int cnt = 0; for (int num : data) { if (cnt == 0) { if ((num >> 5) == 0b110) cnt = 1; else if ((num >> 4) == 0b1110) cnt = 2; else if ((num >> 3) == 0b11110) cnt = 3; else if ((num >> 7) > 0) return false; } else { if ((num >> 6) != 0b10) return false; --cnt; } } return cnt == 0; } }
[ "448641125@qq.com" ]
448641125@qq.com
ed4bd2bbd9078ae7534efc8d525a7fcd9c523aa6
903be4f617a2db222ffe48498291fde8947ac1e3
/org/omg/CosNaming/NameComponentHelper.java
0b37fec7732ec946a7543f0b964aa384bfb99217
[]
no_license
CrazyITBoy/jdk1_8_source
28b33e029a3a972ee30fa3c0429d8f193373a5c3
d01551b2df442d1912403127a1c56a06ac84f7bd
refs/heads/master
2022-12-10T07:27:54.028455
2020-07-05T15:18:50
2020-07-05T15:18:50
273,000,289
0
1
null
2020-06-27T15:22:27
2020-06-17T14:45:23
Java
UTF-8
Java
false
false
2,860
java
package org.omg.CosNaming; /** * org/omg/CosNaming/NameComponentHelper.java . * Generated by the IDL-to-Java compiler (portable), version "3.2" * from /jenkins/workspace/8-2-build-macosx-x86_64/jdk8u251/737/corba/src/share/classes/org/omg/CosNaming/nameservice.idl * Thursday, March 12, 2020 2:38:17 AM PDT */ abstract public class NameComponentHelper { private static String _id = "IDL:omg.org/CosNaming/NameComponent:1.0"; public static void insert (org.omg.CORBA.Any a, org.omg.CosNaming.NameComponent that) { org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); a.type (type ()); write (out, that); a.read_value (out.create_input_stream (), type ()); } public static org.omg.CosNaming.NameComponent extract (org.omg.CORBA.Any a) { return read (a.create_input_stream ()); } private static org.omg.CORBA.TypeCode __typeCode = null; private static boolean __active = false; synchronized public static org.omg.CORBA.TypeCode type () { if (__typeCode == null) { synchronized (org.omg.CORBA.TypeCode.class) { if (__typeCode == null) { if (__active) { return org.omg.CORBA.ORB.init().create_recursive_tc ( _id ); } __active = true; org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [2]; org.omg.CORBA.TypeCode _tcOf_members0 = null; _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CosNaming.IstringHelper.id (), "Istring", _tcOf_members0); _members0[0] = new org.omg.CORBA.StructMember ( "id", _tcOf_members0, null); _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CosNaming.IstringHelper.id (), "Istring", _tcOf_members0); _members0[1] = new org.omg.CORBA.StructMember ( "kind", _tcOf_members0, null); __typeCode = org.omg.CORBA.ORB.init ().create_struct_tc (org.omg.CosNaming.NameComponentHelper.id (), "NameComponent", _members0); __active = false; } } } return __typeCode; } public static String id () { return _id; } public static org.omg.CosNaming.NameComponent read (org.omg.CORBA.portable.InputStream istream) { org.omg.CosNaming.NameComponent value = new org.omg.CosNaming.NameComponent (); value.id = istream.read_string (); value.kind = istream.read_string (); return value; } public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CosNaming.NameComponent value) { ostream.write_string (value.id); ostream.write_string (value.kind); } }
[ "1396757497@qq.com" ]
1396757497@qq.com
7f73ef05b0285c53a8619269d6bde27f297ff52f
fbd16739b5a5e476916fa22ddcd2157fafff82b9
/src/minecraft_server/net/minecraft/world/gen/feature/WorldGenTallGrass.java
60e1a250f8605e861da30b23e86f3da279aea41b
[]
no_license
CodeMajorGeek/lwjgl3-mcp908
6b49c80944ab87f1c863ff537417f53f16c643d5
2a6d28f2b7541b760ebb8e7a6dc905465f935a64
refs/heads/master
2020-06-18T19:53:49.089357
2019-07-14T13:14:06
2019-07-14T13:14:06
196,421,564
2
0
null
null
null
null
UTF-8
Java
false
false
1,504
java
package net.minecraft.world.gen.feature; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.world.World; public class WorldGenTallGrass extends WorldGenerator { private Block field_150522_a; private int tallGrassMetadata; private static final String __OBFID = "CL_00000437"; public WorldGenTallGrass(Block p_i45466_1_, int p_i45466_2_) { this.field_150522_a = p_i45466_1_; this.tallGrassMetadata = p_i45466_2_; } public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { Block var6; while (((var6 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_)).getMaterial() == Material.air || var6.getMaterial() == Material.field_151584_j) && p_76484_4_ > 0) { --p_76484_4_; } for (int var7 = 0; var7 < 128; ++var7) { int var8 = p_76484_3_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); int var9 = p_76484_4_ + p_76484_2_.nextInt(4) - p_76484_2_.nextInt(4); int var10 = p_76484_5_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); if (p_76484_1_.isAirBlock(var8, var9, var10) && this.field_150522_a.canBlockStay(p_76484_1_, var8, var9, var10)) { p_76484_1_.setBlock(var8, var9, var10, this.field_150522_a, this.tallGrassMetadata, 2); } } return true; } }
[ "37310498+CodeMajorGeek@users.noreply.github.com" ]
37310498+CodeMajorGeek@users.noreply.github.com
ec6bc66dd287c06c94df7dfd2783ead41d368e7f
684cb20da303b2a1446cafe462ef27791c93a81a
/src/test/java/com/cybertek/day04_LocatingChecBoxes/LocatingRadioBtn.java
5e9b05fd3514d587d88f626c57a3a6e9599d5067
[]
no_license
Nasratullahsarabi/SeleniumProject
cbd7dea45be931913b4b7fb6c618f730c65b59a2
247d37f0550f4cd9c1abb2f75cf03b07140523bc
refs/heads/master
2023-08-22T20:58:23.371532
2021-09-30T18:49:26
2021-09-30T18:49:26
402,506,891
0
0
null
null
null
null
UTF-8
Java
false
false
2,073
java
package com.cybertek.day04_LocatingChecBoxes; import io.github.bonigarcia.wdm.WebDriverManager; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import java.util.List; public class LocatingRadioBtn { public static void main(String[] args) { WebDriverManager.chromedriver().setup(); WebDriver driver = new ChromeDriver(); driver.get("http://practice.cybertekschool.com/radio_buttons"); WebElement radioBtnBlue = driver.findElement(By.id("blue")); System.out.println("radioBtnBlue.isSelected() = " + radioBtnBlue.isSelected()); WebElement redRadio = driver.findElement(By.id("red")); System.out.println("radioBtnBlue.isSelected() = " + redRadio.isSelected()); redRadio.click(); System.out.println("redRadio.isSelected() = " + redRadio.isSelected()); System.out.println("radioBtnBlue.isSelected() = " + radioBtnBlue.isSelected()); WebElement greenRadio = driver.findElement(By.id("green")); System.out.println("radioBtnBlue.isSelected() = " + greenRadio.isSelected()); System.out.println("greenRadio.isEnabled() = " + greenRadio.isEnabled()); greenRadio.click(); System.out.println("greenRadio.isSelected() = " + greenRadio.isSelected()); List<WebElement> allRadios = driver.findElements(By.name("color")); System.out.println("allRadios.size() = " + allRadios.size()); allRadios.get(2).click(); for (WebElement eachRadio : allRadios) { System.out.println("-----------------------------------------"); System.out.println("eachRadio.getAttribute(\"id\") = " + eachRadio.getAttribute("id")); System.out.println("eachRadio.isSelected() = " + eachRadio.isSelected()); System.out.println("eachRadio.isEnabled() = " + eachRadio.isEnabled()); System.out.println("-----------------------------------------"); } // driver.quit(); } }
[ "Nasratullah_sarabi@yahoo.com" ]
Nasratullah_sarabi@yahoo.com
0593609a34c422ca743fe1f0782cd9ce57d6f3d8
44857dfdd14651f656526ca0ef451355d336a210
/src/com/fasterxml/jackson/databind/ser/std/NullSerializer.java
0937a4f6e7a536c68fb32745fc97daf51d394bdb
[]
no_license
djun100/yueTV
a410ca9255fd5a3f915e8a84c879ad7aeb142719
8ca9d1e37ee1eb3dea7cf3fdfcfde7a7e3eae9e0
refs/heads/master
2021-01-23T13:56:59.567927
2014-03-17T02:02:23
2014-03-17T02:02:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,403
java
package com.fasterxml.jackson.databind.ser.std; import java.lang.reflect.Type; import java.io.IOException; import com.fasterxml.jackson.core.*; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.annotation.JacksonStdImpl; import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper; /** * This is a simple dummy serializer that will just output literal * JSON null value whenever serialization is requested. * Used as the default "null serializer" (which is used for serializing * null object references unless overridden), as well as for some * more exotic types (java.lang.Void). */ @JacksonStdImpl public class NullSerializer extends StdSerializer<Object> { public final static NullSerializer instance = new NullSerializer(); private NullSerializer() { super(Object.class); } @Override public void serialize(Object value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonGenerationException { jgen.writeNull(); } @Override public JsonNode getSchema(SerializerProvider provider, Type typeHint) throws JsonMappingException { return createSchemaNode("null"); } @Override public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) { visitor.expectNullFormat(typeHint); } }
[ "djun100@qq.com" ]
djun100@qq.com
85195002febe336c377559598e20ca016af78356
c53c074440f01951e24fec40b24ac9fe02b6a2a9
/s/o/src/main/java/threadpool/BasicThreadPool.java
ae1ea750f7f9a19e0ec7d475b755d32bca5446ed
[]
no_license
robertfg/Sandbox
c1c0ca73bf4f5e3b4707ca33bd6c22de60c276dd
cd808cf3ccf6f5e51e920ed52363f5e435c6dad1
refs/heads/master
2021-04-27T10:59:50.060378
2018-02-28T02:50:38
2018-02-28T02:50:38
122,550,086
0
0
null
2018-02-22T23:56:00
2018-02-22T23:56:00
null
WINDOWS-1252
Java
false
false
2,806
java
package threadpool; import java.util.LinkedList; /** * Very basic implementation of a thread pool. * * @author Rob Gordon. */ public class BasicThreadPool { private BlockingQueue queue = new BlockingQueue(); private boolean closed = true; private int poolSize = 3; public void setPoolSize(int poolSize) { this.poolSize = poolSize; } public int getPoolSize() { return poolSize; } synchronized public void start() { if (!closed) { throw new IllegalStateException("Pool already started."); } closed = false; for (int i = 0; i < poolSize; ++i) { new PooledThread().start(); } } synchronized public void execute(Runnable job) { if (closed) { throw new PoolClosedException(); } queue.enqueue(job); } private class PooledThread extends Thread { public void run() { while (true) { Runnable job = (Runnable) queue.dequeue(); if (job == null) { break; } try { job.run(); } catch (Throwable t) { // ignore } } } } public void close() { closed = true; queue.close(); } private static class PoolClosedException extends RuntimeException { PoolClosedException() { super ("Pool closed."); } } } /* * Copyright © 2004, Rob Gordon. */ /** * * @author Rob Gordon. */ class BlockingQueue { private final LinkedList list = new LinkedList(); private boolean closed = false; private boolean wait = false; synchronized public void enqueue(Object o) { if (closed) { throw new ClosedException(); } list.add(o); notify(); } synchronized public Object dequeue() { while (!closed && list.size() == 0) { try { wait(); } catch (InterruptedException e) { // ignore } } if (list.size() == 0) { return null; } return list.removeFirst(); } synchronized public int size() { return list.size(); } synchronized public void close() { closed = true; notifyAll(); } synchronized public void open() { closed = false; } public static class ClosedException extends RuntimeException { ClosedException() { super("Queue closed."); } } }
[ "degs@ubuntu.(none)" ]
degs@ubuntu.(none)