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
5b7fc2b8fca100b86ff65d0188a163ad67d1c784
2c552dbe25d166fe02b8d9124e7888dfde65ade4
/Investigacion-ejb/src/java/ec/edu/espe_ctt_investigacion/session/SeaComisionXConvocaFacade.java
8cbb30c98ed246227e3d56ef4f909a0383f25721
[]
no_license
developerJhonAlon/Proyecto-Investigacion-ESPE
d03aec50f6b5fa0864e1419524f74f4e41d89151
a97a68b4d5fc173ae0cbae82fc63ad45f4c2ef66
refs/heads/master
2022-04-11T16:44:11.215153
2020-03-31T01:37:46
2020-03-31T01:37:46
126,053,013
0
0
null
null
null
null
UTF-8
Java
false
false
2,277
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 ec.edu.espe_ctt_investigacion.session; import ec.edu.espe_ctt_investigacion.entity.SeaComisionXConvoca; import ec.edu.espe_ctt_investigacion.entity.SeaConvoca; import ec.edu.espe_ctt_investigacion.entity.SeaDatGeneralProy; import java.math.BigDecimal; import java.util.List; import javax.ejb.Stateless; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.Query; /** * * @author PC1 */ @Stateless public class SeaComisionXConvocaFacade extends AbstractFacade<SeaComisionXConvoca> { @PersistenceContext(unitName = "Investigacion-ejbPU") private EntityManager em; @Override protected EntityManager getEntityManager() { return em; } public SeaComisionXConvocaFacade() { super(SeaComisionXConvoca.class); } public List<SeaComisionXConvoca> findComisionByConvocatoria(BigDecimal codConvoca) { return em.createQuery("select o from SeaComisionXConvoca as o where o.convocaId.convocaId = :codConvoca") .setHint("eclipse.link", true) .setParameter("codConvoca", codConvoca) .getResultList(); } public List<SeaConvoca> findConvocatoriaByUsuario(BigDecimal idUsuario) { return em.createQuery("select o.convocaId from SeaComisionXConvoca as o where o.usuId.usuId = :codUsu") .setHint("eclipse.link", true) .setParameter("codUsu", idUsuario) .getResultList(); } public List<SeaComisionXConvoca> findComisionByConvocatoriaAndTipoResponsabilidad(BigDecimal codConvoca, BigDecimal codTipoResponsabilidad) { return em.createQuery("select o from SeaComisionXConvoca as o where o.convocaId.convocaId = :codConvoca and o.tipresId.tipresId = :codTipoResponsabilidad") .setHint("eclipse.link", true) .setParameter("codConvoca", codConvoca) .setParameter("codTipoResponsabilidad", codTipoResponsabilidad) .getResultList(); } }
[ "jhonalonjami@gmail.com" ]
jhonalonjami@gmail.com
8b8bacb96f5f77a2e9c7e3be07abf383ee4e5eef
b34404ddb2c04765eb099c58ad8ac614ab84adca
/src/com/cicro/wcm/template/velocity/impl/VelocityInterViewContextImp.java
e84db733f27cdb254f5a68605f2dd781ef6b6790
[]
no_license
373974360/cicroCms
a69f46d0148f948a55c22f4a9b60792b958e5744
7cd9b157253811046ab9db6a3c2aa91be5eadc48
refs/heads/master
2020-12-30T07:42:35.825771
2020-02-07T09:52:20
2020-02-07T09:52:20
238,906,940
0
0
null
null
null
null
UTF-8
Java
false
false
3,109
java
/* */ package com.cicro.wcm.template.velocity.impl; /* */ /* */ import com.cicro.wcm.bean.interview.SubjectCategory; /* */ import com.cicro.wcm.services.interview.SubjectCategoryServices; /* */ import com.cicro.wcm.template.velocity.VelocityContextAbstract; /* */ import java.io.PrintStream; /* */ import javax.servlet.http.HttpServletRequest; /* */ import org.apache.velocity.VelocityContext; /* */ /* */ public class VelocityInterViewContextImp extends VelocityContextAbstract /* */ { /* */ public VelocityInterViewContextImp(HttpServletRequest request) /* */ { /* 12 */ super(request); /* */ } /* */ /* */ public void vcontextPut(String key, Object o) { /* 16 */ this.vcontext.put(key, o); /* */ } /* */ /* */ public void setTemplateID(String cat_id, String temp_type) /* */ { /* 29 */ String app_id = "interview"; /* 30 */ if ((this.site_id == null) || ("".equals(this.site_id))) { /* 31 */ this.site_id = this.vcontext.get("site_id").toString(); /* */ } /* 33 */ System.out.println("VelocityInterViewContextImp---------------" + this.site_id); /* 34 */ if ((cat_id != null) && (!"".equals(cat_id))) /* */ { /* 36 */ this.vcontext.put("cat_id", cat_id); /* */ try /* */ { /* 39 */ if ("list".equals(temp_type)) /* 40 */ this.template_id = SubjectCategoryServices.getSubjectCategoryBean(cat_id).getM_hlist_path(); /* 41 */ if ("live".equals(temp_type)) { /* 42 */ this.template_id = SubjectCategoryServices.getSubjectCategoryBean(cat_id).getM_on_path(); /* */ } /* 44 */ if ("forecastList".equals(temp_type)) /* 45 */ this.template_id = SubjectCategoryServices.getSubjectCategoryBean(cat_id).getM_forecast_path(); /* 46 */ if ("historyContent".equals(temp_type)) /* 47 */ this.template_id = SubjectCategoryServices.getSubjectCategoryBean(cat_id).getM_h_path(); /* 48 */ if ("infoList".equals(temp_type)) /* 49 */ this.template_id = SubjectCategoryServices.getSubjectCategoryBean(cat_id).getM_rlist_path(); /* 50 */ if (!"infoContent".equals(temp_type)) return; /* 51 */ this.template_id = SubjectCategoryServices.getSubjectCategoryBean(cat_id).getM_rcontent_list(); /* */ } /* */ catch (Exception e) /* */ { /* 55 */ e.printStackTrace(); /* 56 */ System.out.println("setTemplateID -- template_id is null app_id:" + app_id + " site_id:" + this.site_id + " id:" + cat_id); /* */ } /* */ } /* */ else /* */ { /* 61 */ this.template_id = SubjectCategoryServices.getInterViewTemplate(temp_type, this.site_id); /* 62 */ System.out.println("VelocityInterViewContextImp----" + this.site_id + "-----" + this.template_id); /* */ } /* */ } /* */ } /* Location: C:\Users\Administrator\Desktop\wcm\shared\classes.zip * Qualified Name: classes.com.cicro.wcm.template.velocity.impl.VelocityInterViewContextImp * JD-Core Version: 0.6.2 */
[ "373974360@qq.com" ]
373974360@qq.com
42b5e099718417ef992122814fefe0951a13c027
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/14/14_63f6fba175fde294819a4c1f80c45b5624c2d79d/UrlDecode/14_63f6fba175fde294819a4c1f80c45b5624c2d79d_UrlDecode_t.java
7d1d7d35d48b5d5356485ef5de11b1b65a8d49b7
[]
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
1,846
java
/* * Copyright 2013 Eediom 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 org.araqne.logdb.query.expr; import java.net.URLDecoder; import java.nio.charset.Charset; import java.util.List; import org.araqne.logdb.LogMap; import org.araqne.logdb.LogQueryParseException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * @since 1.6.7 * @author darkluster * */ public class UrlDecode implements Expression { private final Logger logger = LoggerFactory.getLogger(UrlDecode.class); private Expression valueExpr; private String charset; public UrlDecode(List<Expression> exprs) { this.valueExpr = exprs.get(0); charset = "utf-8"; if (exprs.size() > 1) charset = exprs.get(1).eval(null).toString(); try { Charset.forName(charset); } catch (Exception e) { throw new LogQueryParseException("invalid-charset", -1); } } @Override public Object eval(LogMap map) { Object value = valueExpr.eval(map); if (value == null) return null; try { return URLDecoder.decode(value.toString(), charset); } catch (Throwable t) { if (logger.isDebugEnabled()) logger.debug("araqne logdb: cannot decode url [" + value + "]", t); return value; } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
301d137a76adc73e4d21ffebf8c2e4c8a0f2096c
5ebf8e5463d207b5cc17e14cc51e5a1df135ccb9
/moe.apple/moe.platform.ios/src/main/java/apple/audiotoolbox/struct/AudioUnitProperty.java
0e60e2fc03653e2982d7833069d978b63cb1dc26
[ "ICU", "Apache-2.0", "W3C" ]
permissive
multi-os-engine-community/moe-core
1cd1ea1c2caf6c097d2cd6d258f0026dbf679725
a1d54be2cf009dd57953c9ed613da48cdfc01779
refs/heads/master
2021-07-09T15:31:19.785525
2017-08-22T10:34:50
2017-08-22T10:59:02
101,847,137
1
0
null
2017-08-30T06:43:46
2017-08-30T06:43:46
null
UTF-8
Java
false
false
2,432
java
/* Copyright 2014-2016 Intel Corporation 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 apple.audiotoolbox.struct; import apple.audiotoolbox.opaque.AudioComponentInstance; import org.moe.natj.c.StructObject; import org.moe.natj.c.ann.Structure; import org.moe.natj.c.ann.StructureField; import org.moe.natj.general.NatJ; import org.moe.natj.general.Pointer; import org.moe.natj.general.ann.Generated; @Generated @Structure() public final class AudioUnitProperty extends StructObject { private static long __natjCache; static { NatJ.register(); } @Generated public AudioUnitProperty() { super(AudioUnitProperty.class); } @Generated protected AudioUnitProperty(Pointer peer) { super(peer); } @Generated public AudioUnitProperty(AudioComponentInstance mAudioUnit, int mPropertyID, int mScope, int mElement) { super(AudioUnitProperty.class); setMAudioUnit(mAudioUnit); setMPropertyID(mPropertyID); setMScope(mScope); setMElement(mElement); } @Generated @StructureField(order = 0, isGetter = true) public native AudioComponentInstance mAudioUnit(); @Generated @StructureField(order = 0, isGetter = false) public native void setMAudioUnit(AudioComponentInstance value); @Generated @StructureField(order = 1, isGetter = true) public native int mPropertyID(); @Generated @StructureField(order = 1, isGetter = false) public native void setMPropertyID(int value); @Generated @StructureField(order = 2, isGetter = true) public native int mScope(); @Generated @StructureField(order = 2, isGetter = false) public native void setMScope(int value); @Generated @StructureField(order = 3, isGetter = true) public native int mElement(); @Generated @StructureField(order = 3, isGetter = false) public native void setMElement(int value); }
[ "kristof.liliom@migeran.com" ]
kristof.liliom@migeran.com
f28c7e4d9e6cea7a2a14ffd3b4441cf930fae3ed
2fd9d77d529e9b90fd077d0aa5ed2889525129e3
/DecompiledViberSrc/app/src/main/java/org/webrtc/CameraVideoCapturer.java
7657e61f91f5d7b253052498fe0409335147afd2
[]
no_license
cga2351/code
703f5d49dc3be45eafc4521e931f8d9d270e8a92
4e35fb567d359c252c2feca1e21b3a2a386f2bdb
refs/heads/master
2021-07-08T15:11:06.299852
2021-05-06T13:22:21
2021-05-06T13:22:21
60,314,071
1
3
null
null
null
null
UTF-8
Java
false
false
4,481
java
package org.webrtc; import android.media.MediaRecorder; import android.os.Handler; import android.os.Looper; public abstract interface CameraVideoCapturer extends VideoCapturer { @Deprecated public abstract void addMediaRecorderToCamera(MediaRecorder paramMediaRecorder, MediaRecorderHandler paramMediaRecorderHandler); @Deprecated public abstract void removeMediaRecorderFromCamera(MediaRecorderHandler paramMediaRecorderHandler); public abstract void switchCamera(CameraSwitchHandler paramCameraSwitchHandler); public static abstract interface CameraEventsHandler { public abstract void onCameraClosed(); public abstract void onCameraDisconnected(); public abstract void onCameraError(String paramString); public abstract void onCameraFreezed(String paramString); public abstract void onCameraOpening(String paramString); public abstract void onFirstFrameAvailable(); } public static class CameraStatistics { private static final int CAMERA_FREEZE_REPORT_TIMOUT_MS = 4000; private static final int CAMERA_OBSERVER_PERIOD_MS = 2000; private static final String TAG = "CameraStatistics"; private final Runnable cameraObserver = new Runnable() { public void run() { int i = Math.round(1000.0F * CameraVideoCapturer.CameraStatistics.this.frameCount / 2000.0F); Logging.d("CameraStatistics", "Camera fps: " + i + "."); if (CameraVideoCapturer.CameraStatistics.this.frameCount == 0) { CameraVideoCapturer.CameraStatistics.access$104(CameraVideoCapturer.CameraStatistics.this); if ((2000 * CameraVideoCapturer.CameraStatistics.this.freezePeriodCount >= 4000) && (CameraVideoCapturer.CameraStatistics.this.eventsHandler != null)) { Logging.e("CameraStatistics", "Camera freezed."); if (CameraVideoCapturer.CameraStatistics.this.surfaceTextureHelper.isTextureInUse()) { CameraVideoCapturer.CameraStatistics.this.eventsHandler.onCameraFreezed("Camera failure. Client must return video buffers."); return; } CameraVideoCapturer.CameraStatistics.this.eventsHandler.onCameraFreezed("Camera failure."); } } else { CameraVideoCapturer.CameraStatistics.access$102(CameraVideoCapturer.CameraStatistics.this, 0); } CameraVideoCapturer.CameraStatistics.access$002(CameraVideoCapturer.CameraStatistics.this, 0); CameraVideoCapturer.CameraStatistics.this.surfaceTextureHelper.getHandler().postDelayed(this, 2000L); } }; private final CameraVideoCapturer.CameraEventsHandler eventsHandler; private int frameCount; private int freezePeriodCount; private final SurfaceTextureHelper surfaceTextureHelper; public CameraStatistics(SurfaceTextureHelper paramSurfaceTextureHelper, CameraVideoCapturer.CameraEventsHandler paramCameraEventsHandler) { if (paramSurfaceTextureHelper == null) throw new IllegalArgumentException("SurfaceTextureHelper is null"); this.surfaceTextureHelper = paramSurfaceTextureHelper; this.eventsHandler = paramCameraEventsHandler; this.frameCount = 0; this.freezePeriodCount = 0; paramSurfaceTextureHelper.getHandler().postDelayed(this.cameraObserver, 2000L); } private void checkThread() { if (Thread.currentThread() != this.surfaceTextureHelper.getHandler().getLooper().getThread()) throw new IllegalStateException("Wrong thread"); } public void addFrame() { checkThread(); this.frameCount = (1 + this.frameCount); } public void release() { this.surfaceTextureHelper.getHandler().removeCallbacks(this.cameraObserver); } } public static abstract interface CameraSwitchHandler { public abstract void onCameraSwitchDone(boolean paramBoolean); public abstract void onCameraSwitchError(String paramString); } @Deprecated public static abstract interface MediaRecorderHandler { public abstract void onMediaRecorderError(String paramString); public abstract void onMediaRecorderSuccess(); } } /* Location: E:\Study\Tools\apktool2_2\dex2jar-0.0.9.15\classes_viber_4_dex2jar.jar * Qualified Name: org.webrtc.CameraVideoCapturer * JD-Core Version: 0.6.2 */
[ "yu.liang@navercorp.com" ]
yu.liang@navercorp.com
7db29ef7aaf2e83ccc0fe64c88dd59cb0d9f3f8f
03c720e9b9ec200c5e6bde091b5d8719deb731dd
/src/main/java/com/eshequ/reconciliation/codes/CarType.java
529d6e1e3cdeb996ff321162a7bee12af45fcaca
[]
no_license
linknabor/reconciliation
9c91909bfe8fd1d4944fa0483b7c70371d129f31
7ad4d835b0dc583f05264c0c1a40f68cae7207a4
refs/heads/master
2020-05-24T08:25:34.819617
2019-05-22T09:25:34
2019-05-22T09:25:34
187,184,596
0
0
null
null
null
null
UTF-8
Java
false
false
3,912
java
package com.eshequ.reconciliation.codes; /**Auto Created by VBScript Do not modify!*/ import java.util.HashMap; import java.util.List; import java.util.Map; import com.eshequ.reconciliation.model.CodeInfo; /** Auto generated */ public class CarType extends CodesItem { private CarType(String code){super(CodesItem.carType,code);} public static String getValue(String code){ return CodesItem.getValue(CodesItem.carType,code); } public static String getValue(CarType code){ return CodesItem.getValue(CodesItem.carType,code.toString()); } public static List<CodeInfo> getCodeList(){ return CodesItem.getCodeList(CodesItem.carType); } public static final CarType getObject(String code){ Map map=(Map)mapCodeObject.get(CodesItem.carType); return map==null?null:(CarType)map.get(code); } static { fillObjectToMap(); } private static final void fillObjectToMap(){ List<CodeInfo> listCode = getCodeFromDB(CodesItem.carType); Map map = new HashMap(listCode.size()); String temp = null; Map map2 = new HashMap(listCode.size()); for (int i=0; i<listCode.size();i++){ CodeInfo codeInfo = listCode.get(i); temp = codeInfo.getCiSpCode(); map.put(temp, codeInfo.getCiSpName()); map2.put(temp, new CarType(temp)); } mapCategoryCode.put(CodesItem.carType, map); mapCodeObject.put(CodesItem.carType, map2); } ///////////////////////////////////////////////////////////////////////////////// public int hashCode(){return super.hashCode();} public boolean equals(Object obj) { if( obj instanceof CodesItem) return (this == obj); else return super.equals(obj); } ///////////////////////////////////////////////////////////////////////////////// public static final CarType JiaoChe = getObject("01"); public static final CarType YueYeChe = getObject("02"); public static final CarType PaoChe = getObject("03"); public static final CarType LvXingChe = getObject("04"); public static final CarType KeChe = getObject("05"); public static final CarType HuoChe = getObject("06"); public static final CarType QiTa = getObject("99"); }
[ "davidhardson@hotmail.com" ]
davidhardson@hotmail.com
c2509184dc3200075a36695bae72cf7e83714c3c
e20b9a1f40a130cbebbbfb018072eb2d07862478
/net/minecraft/server/BlockStep.java
e69bbe07da0ae5791499587797b25d626c308241
[]
no_license
IServerPowered/mc-dev
d3aec5d09375e34264037a190285dbfbc95fc46a
14d88a9a6d9e4c9084d3037a0682a5c415832042
refs/heads/1.8.3
2021-01-17T17:49:54.651138
2015-03-09T22:35:39
2015-03-09T22:35:39
33,264,491
2
0
null
2015-04-01T18:19:08
2015-04-01T18:19:07
null
UTF-8
Java
false
false
171
java
package net.minecraft.server; public class BlockStep extends BlockDoubleStepAbstract { public BlockStep() {} public boolean l() { return false; } }
[ "Techcable@outlook.com" ]
Techcable@outlook.com
43709a7d1ce94f3c14ea6ed41b3560f65b90e682
f567c98cb401fc7f6ad2439cd80c9bcb45e84ce9
/src/main/java/com/alipay/api/domain/HuanxuTradeOrderQueryModel.java
890ecf9e17c2be517702f4eb2d2dc17b0ecf14ef
[ "Apache-2.0" ]
permissive
XuYingJie-cmd/alipay-sdk-java-all
0887fa02f857dac538e6ea7a72d4d9279edbe0f3
dd18a679f7543a65f8eba2467afa0b88e8ae5446
refs/heads/master
2023-07-15T23:01:02.139231
2021-09-06T07:57:09
2021-09-06T07:57:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,490
java
package com.alipay.api.domain; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; /** * 焕旭科技聚合支付产品操作指令查询接口 * * @author auto create * @since 1.0, 2020-10-15 15:26:21 */ public class HuanxuTradeOrderQueryModel extends AlipayObject { private static final long serialVersionUID = 5768395471637345835L; /** * 支付、打款、退款时候焕旭返回的唯一凭证id,调用方查询时候建议优先传入该值,内部处理时优先以该值为准。instruction_id和out_request_no不能同时为空。 */ @ApiField("instruction_id") private String instructionId; /** * 指令类型,表明该笔查询是支付,打款还是退款,跟out_request_no一起使用。 支付:PAY 打款:DISBURSE 退款:REFUND */ @ApiField("instruction_type") private String instructionType; /** * 商户订单号,merchant_order_no和out_request_no是一起使用。 */ @ApiField("merchant_order_no") private String merchantOrderNo; /** * 支付、打款或退款请求号,out_request_no和instruction_id不能同时为空。 */ @ApiField("out_request_no") private String outRequestNo; /** * 支付请求号,out_request_no是一起使用。 */ @ApiField("pay_request_no") private String payRequestNo; /** * 付款方信息,跟out_request_no一起使用。 */ @ApiField("payer") private UserIdentity payer; public String getInstructionId() { return this.instructionId; } public void setInstructionId(String instructionId) { this.instructionId = instructionId; } public String getInstructionType() { return this.instructionType; } public void setInstructionType(String instructionType) { this.instructionType = instructionType; } public String getMerchantOrderNo() { return this.merchantOrderNo; } public void setMerchantOrderNo(String merchantOrderNo) { this.merchantOrderNo = merchantOrderNo; } public String getOutRequestNo() { return this.outRequestNo; } public void setOutRequestNo(String outRequestNo) { this.outRequestNo = outRequestNo; } public String getPayRequestNo() { return this.payRequestNo; } public void setPayRequestNo(String payRequestNo) { this.payRequestNo = payRequestNo; } public UserIdentity getPayer() { return this.payer; } public void setPayer(UserIdentity payer) { this.payer = payer; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
3b13bec3a3d435355faa3f5c2a60995909ed7535
449cff34c3a3ad2be71c5260fb333859d58d2e86
/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/api/AssetConsumerAssetInterface.java
8142a7967345503261b187e7069ef02a1dc8e832
[ "CC-BY-4.0", "Apache-2.0" ]
permissive
cong78/egeria
9f93733360cbfb085a1e5c69616d6646d5139b4f
686762a9bb8ea8969a6d65329b26388e6ee13558
refs/heads/master
2021-07-25T03:43:32.014784
2020-08-05T06:23:01
2020-08-05T06:23:01
170,706,355
1
0
Apache-2.0
2019-02-14T14:42:43
2019-02-14T14:42:43
null
UTF-8
Java
false
false
6,978
java
/* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ package org.odpi.openmetadata.accessservices.assetconsumer.api; import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; import org.odpi.openmetadata.frameworks.connectors.properties.AssetUniverse; import java.util.List; /** * AssetConsumerAssetInterface supports queries to retrieve information about an asset. */ public interface AssetConsumerAssetInterface { /** * Return a list of assets with the requested search string in their name, qualified name * or description. The search string is interpreted as a regular expression (RegEx). * * @param userId calling user * @param searchString string to search for in text * @param startFrom starting element (used in paging through large result sets) * @param pageSize maximum number of results to return * * @return list of assets that match the search string. * * @throws InvalidParameterException the searchString is invalid * @throws PropertyServerException there is a problem access in the property server * @throws UserNotAuthorizedException the user does not have access to the properties */ List<String> findAssets(String userId, String searchString, int startFrom, int pageSize) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException; /** * Return a list of assets with the requested name. * * @param userId calling user * @param name name to search for * @param startFrom starting element (used in paging through large result sets) * @param pageSize maximum number of results to return * * @return list of unique identifiers of assets with matching name. * * @throws InvalidParameterException the name is invalid * @throws PropertyServerException there is a problem access in the property server * @throws UserNotAuthorizedException the user does not have access to the properties */ List<String> getAssetsByName(String userId, String name, int startFrom, int pageSize) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException; /** * Returns a list of assets that match the token. The following calls are issued in * in order for find the asset. * - getAssetProperties passing the token as the GUID * - getAssetByName passing the token as the name * * @param userId userId of user making request. * @param assetToken token used to find the Asset - may be a name or GUID * @param startFrom starting element (used in paging through large result sets) * @param pageSize maximum number of results to return * * @return a list of unique identifiers for the matching assets * * @throws InvalidParameterException one of the parameters is null or invalid. * @throws PropertyServerException there is a problem retrieving the asset properties from the property servers). * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. */ List<String> getAssetsByToken(String userId, String assetToken, int startFrom, int pageSize) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException; /** * Returns the unique identifier for the asset connected to the requested connection. * * @param userId the userId of the requesting user. * @param connectionGUID unique identifier for the connection. * * @return unique identifier of asset. * * @throws InvalidParameterException one of the parameters is null or invalid. * @throws PropertyServerException there is a problem retrieving information from the property server. * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. */ String getAssetForConnection(String userId, String connectionGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException; /** * Returns the asset corresponding to the supplied connection name. * * @param userId userId of user making request. * @param connectionName this may be the qualifiedName or displayName of the connection. * * @return unique identifier of asset. * * @throws InvalidParameterException one of the parameters is null or invalid. * @throws PropertyServerException there is a problem retrieving information from the property server(s). * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. */ String getAssetForConnectionName(String userId, String connectionName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException; /** * Returns a comprehensive collection of properties about the requested asset. * * @param userId userId of user making request. * @param assetGUID unique identifier for asset. * * @return a comprehensive collection of properties about the asset. * * @throws InvalidParameterException one of the parameters is null or invalid. * @throws PropertyServerException there is a problem retrieving the asset properties from the property servers). * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. */ AssetUniverse getAssetProperties(String userId, String assetGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException; }
[ "mandy_chessell@uk.ibm.com" ]
mandy_chessell@uk.ibm.com
f5e0a4c70e405887a984dd6a647378d15e22c4da
48f0fdfd9e3926311be9f7c4f05f8896c292c993
/Food Analyzer Server/src/bg/sofia/uni/fmi/mjt/analyzer/command/GetFoodsCommand.java
b52c7a694a1adde6e2fa32a7db97e7c1d848a94d
[]
no_license
vanshianec/Food-Analyzer
4c881ada465e7fcde35a5eac866fd1a41b5c316f
fe00cfa72bb97111cc6ae4a20662793997527ed9
refs/heads/master
2023-03-05T09:59:19.463975
2021-02-21T12:51:28
2021-02-21T12:51:28
340,900,309
0
0
null
null
null
null
UTF-8
Java
false
false
2,602
java
package bg.sofia.uni.fmi.mjt.analyzer.command; import bg.sofia.uni.fmi.mjt.analyzer.api.FoodService; import bg.sofia.uni.fmi.mjt.analyzer.dtos.Food; import bg.sofia.uni.fmi.mjt.analyzer.exceptions.FoodServiceException; import bg.sofia.uni.fmi.mjt.analyzer.exceptions.InvalidCommandArgumentException; import bg.sofia.uni.fmi.mjt.analyzer.storage.Storage; import java.util.List; /** * An command object used to execute a command which returns a String representation * of a {@code List} of {@code Food} objects */ public class GetFoodsCommand extends AbstractServiceCommand<String, List<Food>> { private static final int ZERO_ARGUMENTS = 0; private static final String INVALID_ARGUMENTS_COUNT = "At least one argument is required"; private static final String WHITESPACE = " "; private Storage<String, Food> barcodesCache; /** * Constructs a new {@code GetFoodCommand} with a given foods and barcodes storages and a food service * * @param foodsStorage The storage which will be used to store and retrieve a {@code List} of {@code Food} objects by their name * @param barcodesStorage The storage which will be used to store and retrieve {@code Food} objects by their barcodes * @param foodService The service which will be used to retrieve {@code Food} data if no such data is found in the storages */ public GetFoodsCommand(Storage<String, List<Food>> foodsStorage, Storage<String, Food> barcodesStorage, FoodService foodService) { super(foodsStorage, foodService); this.barcodesCache = barcodesStorage; } @Override public String execute(String... arguments) throws FoodServiceException, InvalidCommandArgumentException { validateArguments(arguments); String foodName = String.join(WHITESPACE, arguments); List<Food> foods = storage.get(foodName); if (foods == null) { foods = foodService.getFoods(foodName); saveFoodsWithBarcodesInBarcodesCache(foods); storage.save(foodName, foods); } return foods.toString(); } private void saveFoodsWithBarcodesInBarcodesCache(List<Food> foods) { foods.forEach(f -> { if (f.getGtinUpc() != null) { barcodesCache.save(f.getGtinUpc(), f); } }); } private void validateArguments(String... arguments) throws InvalidCommandArgumentException { if (arguments == null || arguments.length == ZERO_ARGUMENTS) { throw new InvalidCommandArgumentException(INVALID_ARGUMENTS_COUNT); } } }
[ "ivaniovov@abv.bg" ]
ivaniovov@abv.bg
9da34b6364ad78b24f227cf9dfd5fd69e8cae3a3
e7ee311e20b40c87bf6d23a53a1d7b11fd29d2c3
/src/chosun/ciis/hd/cost/rec/HD_COST_1009_MCURLIST1Record.java
da4305168e64d3dbea13c01eeb7f7b5121a1a0ce
[]
no_license
nosmoon/misdevteam
4e3695ef7bbdcd231bb84d7d8d7df54a23ff0a60
1829d5bd489eb6dd307ca244f0e183a31a1de773
refs/heads/master
2020-04-15T15:57:05.480056
2019-01-10T01:12:01
2019-01-10T01:12:01
164,812,547
1
0
null
null
null
null
UHC
Java
false
false
1,373
java
/*************************************************************************************************** * 파일명 : .java * 기능 : 독자우대-구독신청 * 작성일자 : 2007-05-22 * 작성자 : 김대섭 ***************************************************************************************************/ /*************************************************************************************************** * 수정내역 : * 수정자 : * 수정일자 : * 백업 : ***************************************************************************************************/ package chosun.ciis.hd.cost.rec; import java.sql.*; import chosun.ciis.hd.cost.dm.*; import chosun.ciis.hd.cost.ds.*; /** * */ public class HD_COST_1009_MCURLIST1Record extends java.lang.Object implements java.io.Serializable{ public String cd; public String cdnm; public String mang_cd_1; public HD_COST_1009_MCURLIST1Record(){} public void setCd(String cd){ this.cd = cd; } public void setCdnm(String cdnm){ this.cdnm = cdnm; } public void setMang_cd_1(String mang_cd_1){ this.mang_cd_1 = mang_cd_1; } public String getCd(){ return this.cd; } public String getCdnm(){ return this.cdnm; } public String getMang_cd_1(){ return this.mang_cd_1; } } /* 작성시간 : Wed Oct 31 15:55:05 KST 2018 */
[ "DLCOM000@172.16.30.11" ]
DLCOM000@172.16.30.11
dc94509a9a08412b7a32ce5426e66537824f4d2a
bd2e9fcb13b01071111b2ca141ecd568e33c35dc
/src/main/java/chapter04/section01/thread_4_1_15/pro_1_awaitUntilTest/Service.java
5f17cf7e5ba5f144efb0a028f935af2950967386
[ "Apache-2.0" ]
permissive
turoDog/java-multi-thread-programming
59bf392bcea73da7f5f43c06ff35e87a4b127f8a
cb0d5e1735577fb76e57ec2b53d692c8063d6d66
refs/heads/master
2020-09-03T12:47:58.686757
2019-12-03T15:19:19
2019-12-03T15:19:19
219,465,626
1
0
null
null
null
null
UTF-8
Java
false
false
1,626
java
package chapter04.section01.thread_4_1_15.pro_1_awaitUntilTest; import java.util.Calendar; import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.ReentrantLock; /** * Project Name:java-multi-thread-programming <br/> * Package Name:chapter04.thread_4_1_15.pro_1_awaitUntilTest <br/> * Date:2019/11/27 16:34 <br/> * * @author <a href="mailto:chenzy01@eastcom-sw.com">chenzy</a><br/> */ public class Service { private ReentrantLock lock = new ReentrantLock(); private Condition condition = lock.newCondition(); public void waitMethod() { try { Calendar calendarRef = Calendar.getInstance(); calendarRef.add(Calendar.SECOND, 10); lock.lock(); System.out .println("wait begin timer=" + System.currentTimeMillis()); condition.awaitUntil(calendarRef.getTime()); System.out .println("wait end timer=" + System.currentTimeMillis()); } catch (InterruptedException e) { e.printStackTrace(); } finally { lock.unlock(); } } public void notifyMethod() { try { Calendar calendarRef = Calendar.getInstance(); calendarRef.add(Calendar.SECOND, 10); lock.lock(); System.out .println("notify begin timer=" + System.currentTimeMillis()); condition.signalAll(); System.out .println("notify end timer=" + System.currentTimeMillis()); } finally { lock.unlock(); } } }
[ "turodog@foxmail.com" ]
turodog@foxmail.com
bd4278150c7a0dad42c65d70a73ece2648c85dbb
f7b5199e2721d767c9b86fd1011266363fd6a617
/src/main/java/com/jk/service/Dom4JXmlResponse.java
c6140d7e372f9f4804bd2949246f1df7da37f9ed
[]
no_license
WorkJun/webservice-client
4b5ca8e4c3e8a4beaf02720cb9d40be78938bbcd
0ebb74f1912e45ea868a49e850a25adadfd3cef5
refs/heads/master
2021-06-18T19:55:47.990963
2017-06-30T01:23:08
2017-06-30T01:23:08
null
0
0
null
null
null
null
GB18030
Java
false
false
756
java
package com.jk.service; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; /** * <p>dom4jXmlResponse complex type的 Java 类。 * * <p>以下模式片段指定包含在此类中的预期内容。 * * <pre> * &lt;complexType name="dom4jXmlResponse"&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "dom4jXmlResponse") public class Dom4JXmlResponse { }
[ "1754031481@qq.com" ]
1754031481@qq.com
05bf7317bac2fe5d0a71d0240d0b036c6ac5dc23
8592ba0914fdbd076048d9ee1481c9d263ef1e8a
/framework/java/implementations/java/org.hl7.fhir.dstu2/src/org/hl7/fhir/dstu2/utils/client/ResourceRequest.java
a2ec0b73340fb525b72d02659b7dc2fc917cf298
[]
no_license
HL7/UTG
a6f35d038b76f4bf172c453c95fe0ed67cb88889
cc0ed03ee9b576e6d22bfd3e3ea34d694abc9d5b
refs/heads/master
2023-08-04T12:13:53.870641
2023-07-25T15:45:21
2023-07-25T15:45:21
133,315,209
9
9
null
2023-09-07T17:39:11
2018-05-14T06:33:02
Java
UTF-8
Java
false
false
3,451
java
package org.hl7.fhir.dstu2.utils.client; /* Copyright (c) 2011+, HL7, 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 HL7 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 HOLDER 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. */ import java.util.ArrayList; import java.util.List; import org.hl7.fhir.dstu2.model.Resource; public class ResourceRequest<T extends Resource> { private T payload; private int httpStatus = -1; private String location; private List<Integer> successfulStatuses = new ArrayList<Integer>(); private List<Integer> errorStatuses = new ArrayList<Integer>(); public ResourceRequest(T payload, int httpStatus, List<Integer> successfulStatuses, List<Integer> errorStatuses, String location) { this.payload = payload; this.httpStatus = httpStatus; if(successfulStatuses != null) { this.successfulStatuses.addAll(successfulStatuses); } if(errorStatuses != null) { this.errorStatuses.addAll(errorStatuses); } this.location = location; } public ResourceRequest(T payload, int httpStatus, String location) { this.payload = payload; this.httpStatus = httpStatus; this.location = location; } public ResourceRequest(T payload, int httpStatus, int successfulStatus, String location) { this.payload = payload; this.httpStatus = httpStatus; this.successfulStatuses.add(successfulStatus); this.location = location; } public int getHttpStatus() { return httpStatus; } public T getPayload() { return payload; } public T getReference() { T payloadResource = null; if(payload != null) { payloadResource = payload; } return payloadResource; } public boolean isSuccessfulRequest() { return successfulStatuses.contains(httpStatus) && !errorStatuses.contains(httpStatus) && httpStatus > 0; } public boolean isUnsuccessfulRequest() { return !isSuccessfulRequest(); } public void addSuccessStatus(int status) { this.successfulStatuses.add(status); } public void addErrorStatus(int status) { this.errorStatuses.add(status); } public String getLocation() { return location; } }
[ "ywang@imo-online.com" ]
ywang@imo-online.com
f238e084bb498636118ac0f3f70b4ca58ec413c1
66082992919f526e2b428cb91383950c5e2870ff
/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/catalog/glue/TestIcebergGlueCatalogConnectorSmokeTest.java
90d1e3efa56020147304d90a2d2180ba4f091272
[ "Apache-2.0" ]
permissive
doytsujin/presto
240fe7f7d79027a565cdad12f7423cc2d969961b
812c006920a2d18a683417d87b5da508500a7d23
refs/heads/master
2022-07-26T01:34:53.796968
2022-07-11T08:40:13
2022-07-11T16:48:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,813
java
/* * 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 io.trino.plugin.iceberg.catalog.glue; import com.amazonaws.services.s3.AmazonS3; import com.amazonaws.services.s3.AmazonS3ClientBuilder; import com.amazonaws.services.s3.model.DeleteObjectsRequest; import com.amazonaws.services.s3.model.ListObjectsV2Request; import com.amazonaws.services.s3.model.ListObjectsV2Result; import com.amazonaws.services.s3.model.S3ObjectSummary; import com.google.common.collect.ImmutableMap; import io.trino.plugin.hive.metastore.glue.GlueMetastoreApiStats; import io.trino.plugin.iceberg.BaseIcebergConnectorSmokeTest; import io.trino.plugin.iceberg.IcebergQueryRunner; import io.trino.plugin.iceberg.SchemaInitializer; import io.trino.testing.QueryRunner; import org.apache.iceberg.FileFormat; import org.testng.annotations.AfterClass; import org.testng.annotations.Parameters; import org.testng.annotations.Test; import java.util.List; import static com.google.common.collect.ImmutableList.toImmutableList; import static io.trino.plugin.hive.metastore.glue.AwsSdkUtil.getPaginatedResults; import static io.trino.testing.sql.TestTable.randomTableSuffix; import static java.lang.String.format; import static java.util.Objects.requireNonNull; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; /* * TestIcebergGlueCatalogConnectorSmokeTest currently uses AWS Default Credential Provider Chain, * See https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html#credentials-default * on ways to set your AWS credentials which will be needed to run this test. */ public class TestIcebergGlueCatalogConnectorSmokeTest extends BaseIcebergConnectorSmokeTest { private final String bucketName; private final String schemaName; @Parameters("s3.bucket") public TestIcebergGlueCatalogConnectorSmokeTest(String bucketName) { super(FileFormat.PARQUET); this.bucketName = requireNonNull(bucketName, "bucketName is null"); this.schemaName = "test_iceberg_smoke_" + randomTableSuffix(); } @Override protected QueryRunner createQueryRunner() throws Exception { return IcebergQueryRunner.builder() .setIcebergProperties( ImmutableMap.of( "iceberg.catalog.type", "glue", "hive.metastore.glue.default-warehouse-dir", schemaPath())) .setSchemaInitializer( SchemaInitializer.builder() .withClonedTpchTables(REQUIRED_TPCH_TABLES) .withSchemaName(schemaName) .build()) .build(); } @AfterClass(alwaysRun = true) public void cleanup() { computeActual("SHOW TABLES").getMaterializedRows() .forEach(table -> getQueryRunner().execute("DROP TABLE " + table.getField(0))); getQueryRunner().execute("DROP SCHEMA IF EXISTS " + schemaName); // DROP TABLES should clean up any files, but clear the directory manually to be safe AmazonS3 s3 = AmazonS3ClientBuilder.standard().build(); ListObjectsV2Request listObjectsRequest = new ListObjectsV2Request() .withBucketName(bucketName) .withPrefix(schemaPath()); List<DeleteObjectsRequest.KeyVersion> keysToDelete = getPaginatedResults( s3::listObjectsV2, listObjectsRequest, ListObjectsV2Request::setContinuationToken, ListObjectsV2Result::getNextContinuationToken, new GlueMetastoreApiStats()) .map(ListObjectsV2Result::getObjectSummaries) .flatMap(objectSummaries -> objectSummaries.stream().map(S3ObjectSummary::getKey)) .map(DeleteObjectsRequest.KeyVersion::new) .collect(toImmutableList()); if (!keysToDelete.isEmpty()) { s3.deleteObjects(new DeleteObjectsRequest(bucketName).withKeys(keysToDelete)); } } @Test @Override public void testShowCreateTable() { assertThat((String) computeScalar("SHOW CREATE TABLE region")) .isEqualTo(format("" + "CREATE TABLE iceberg.%1$s.region (\n" + " regionkey bigint,\n" + " name varchar,\n" + " comment varchar\n" + ")\n" + "WITH (\n" + " format = 'ORC',\n" + " format_version = 2,\n" + " location = '%2$s/%1$s.db/region'\n" + ")", schemaName, schemaPath())); } @Test @Override public void testRenameSchema() { assertThatThrownBy(super::testRenameSchema) .hasStackTraceContaining("renameNamespace is not supported for Iceberg Glue catalogs"); } private String schemaPath() { return format("s3://%s/%s", bucketName, schemaName); } }
[ "piotr.findeisen@gmail.com" ]
piotr.findeisen@gmail.com
fa52b50f5fb7ea6ebe0597b2484676ce6c30d4af
4d38f89105f30d5aed3f6da303c4fa8c3ce9e724
/DroneServerAnalyzer/src/main/java/com/dbanalyzer/commands/Dump.java
12bb7ed6e2c340ab97b51d6b30e56b17a4762a76
[]
no_license
tymiles003/DroneServer
9c4a6ee5418bfc36e60de73f2b311d3fba0e15f2
b1ad3f92cedc07fedec659c4823423f60f034b40
refs/heads/master
2021-09-22T16:32:43.324858
2018-03-10T19:14:48
2018-03-10T19:15:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,165
java
package com.dbanalyzer.commands; import com.dbanalyzer.QuerySvcRemoteWrapper; import com.generic_tools.Pair.Pair; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import javax.annotation.PostConstruct; import java.util.ArrayList; import java.util.List; @Component public class Dump implements RunnablePayload { @Autowired private Query query; private List<Pair<String, String>> usage; @PostConstruct public void init() { usage = new ArrayList<>(); usage.add(new Pair<>("dump","Print all tables in DB")); usage.add(new Pair<>("dump -u <UserName>","Print all tables in DB for <UserName>")); } @Override public boolean isRelevant(String payload) { for (Pair pair : usage) { if (pair.getFirst().equals(payload)) return true; else { int idx = pair.getFirst().toString().indexOf("<"); if (idx <= 0) continue; if (payload.contains(pair.getFirst().toString().substring(0, idx - 1))) { return true; } } } return false; } @Override public List<Pair<String, String>> getUsage() { return usage; } @Override public String run(String payload) { String[] strings = payload.split(" "); if (strings.length == 3) { // QuerySvcRemoteWrapper.userName = strings[2]; // System.out.println("Dump dedicated user table of '" + QuerySvcRemoteWrapper.userName + "'"); } else { // QuerySvcRemoteWrapper.userName = "PUBLIC"; } System.out.println(payload); String ans = "Tables:\n"; List<Class> tables = ShowTables.getTableClass(); for (Class clz : tables) ans += " " + clz.getSimpleName() + "\n"; ans += "\nDetails:\n"; for (Class clz : tables) { ans += clz.getSimpleName() + "\n"; ans += query.run("q select a from " + clz.getSimpleName() + " a") + "\n"; } return ans; } }
[ "taljmars@gmail.com" ]
taljmars@gmail.com
89e1ea322efabe58285eeacfdf0fdc11ed190627
7e963d9b1b6742c26e1284281058b1bd857a2dd0
/src/main/java/com/rbmurussi/ecommerce/application/service/util/RandomUtil.java
f2e0163ea03e06ad1dbe6839d3a17ea801682cd3
[]
no_license
rbmurussi/ecommerce-application
53b1dfaa3370fb7dc645c28e5f3b2ee0c914a1dc
dca2f53dc5d3bf2c48e8e3d626718c42889b2b66
refs/heads/master
2020-04-13T00:38:42.297282
2018-12-23T00:11:08
2018-12-23T00:11:08
158,205,992
0
0
null
null
null
null
UTF-8
Java
false
false
1,480
java
package com.rbmurussi.ecommerce.application.service.util; import org.apache.commons.lang3.RandomStringUtils; /** * Utility class for generating random Strings. */ public final class RandomUtil { private static final int DEF_COUNT = 20; private RandomUtil() { } /** * Generate a password. * * @return the generated password */ public static String generatePassword() { return RandomStringUtils.randomAlphanumeric(DEF_COUNT); } /** * Generate an activation key. * * @return the generated activation key */ public static String generateActivationKey() { return RandomStringUtils.randomNumeric(DEF_COUNT); } /** * Generate a reset key. * * @return the generated reset key */ public static String generateResetKey() { return RandomStringUtils.randomNumeric(DEF_COUNT); } /** * Generate a unique series to validate a persistent token, used in the * authentication remember-me mechanism. * * @return the generated series data */ public static String generateSeriesData() { return RandomStringUtils.randomAlphanumeric(DEF_COUNT); } /** * Generate a persistent token, used in the authentication remember-me mechanism. * * @return the generated token data */ public static String generateTokenData() { return RandomStringUtils.randomAlphanumeric(DEF_COUNT); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
f6d20810a1718ab4f653f7313322ef5c26276b86
25820da6b91f8b270fd9490f1de013d7207388d2
/graph-dc/graph-dc-hbase/src/main/java/com/haizhi/graph/dc/hbase/Application.java
ddb15e0b441f215be100beeae011634aab0f4394
[]
no_license
Joegxx/graphplatform
d784da9d5475a84d836974474bc00263b06a4ad0
b9341937406f5cfc946ded3ecac5126114c977c0
refs/heads/master
2022-04-01T14:01:43.466782
2019-10-15T16:27:41
2019-10-15T16:27:41
272,382,227
0
1
null
2020-06-15T08:24:19
2020-06-15T08:24:18
null
UTF-8
Java
false
false
1,266
java
package com.haizhi.graph.dc.hbase; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.domain.EntityScan; import org.springframework.boot.web.servlet.ServletComponentScan; import org.springframework.context.annotation.ComponentScan; import org.springframework.data.jpa.repository.config.EnableJpaAuditing; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; import org.springframework.scheduling.annotation.EnableScheduling; /** * Created by chengmo on 2018/10/25. */ @SpringBootApplication @ServletComponentScan @EnableScheduling @EnableJpaAuditing @EnableJpaRepositories({"com.haizhi.graph.dc.core", "com.haizhi.graph.sys"}) @EntityScan({"com.haizhi.graph.dc.core", "com.haizhi.graph.sys"}) @ComponentScan({ "com.haizhi.graph.common", "com.haizhi.graph.server", "com.haizhi.graph.sys.file.service", "com.haizhi.graph.dc.core", "com.haizhi.graph.dc.common", "com.haizhi.graph.dc.store.api", "com.haizhi.graph.dc.hbase" }) public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } }
[ "geektcp@163.com" ]
geektcp@163.com
397dc230d2ab826c627e8ce9cdcfc74b81170d5f
72f77450eb99de6de59f44206cc663b22e57b016
/study_java/study-design_patterns/src/main/java/top/mcwebsite/visior_pattern/ObjectStruture.java
c1f70a7ac0daeaf4d9c2874a8fb9607474369422
[]
no_license
woxin123/Java-Study
27a09b34a954dc0294f62944fa79be02d6ae8029
f569c4fe27fa65f88232d246906aa67f9ab9d4ba
refs/heads/master
2022-12-17T01:43:03.476391
2019-06-17T07:07:58
2019-06-17T07:07:58
105,738,558
2
0
null
2022-12-16T06:40:00
2017-10-04T06:35:48
JavaScript
UTF-8
Java
false
false
396
java
package top.mcwebsite.visior_pattern; import java.util.Random; /** * @author mengchen * @time 19-2-19 下午10:27 */ public class ObjectStruture { public static Element createElement() { Random random = new Random(); if (random.nextInt(100) > 50) { return new ConcreteElement1(); } else { return new ConcreteElement2(); } } }
[ "1293141942@qq.com" ]
1293141942@qq.com
d0e4a3a1ad7995073841bba2f2f9bc8445f9d0e7
5a474257353b9bbf88c30688fab17a618b154c22
/snHose-Server/src/main/java/net/minecraft/server/PacketPlayInListener.java
d1a36f364c826b1deaae8333b28e45177bd8f13f
[]
no_license
RealKezuk/snHose
7e5424cd3edbf99bb6a586b9592943b11cd9d549
8c89453218621426f394fae44625f97b2a57840c
refs/heads/master
2020-07-22T14:24:17.936438
2019-09-09T03:39:21
2019-09-09T03:39:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,156
java
package net.minecraft.server.v1_7_R4; public interface PacketPlayInListener extends PacketListener { void a(final PacketPlayInArmAnimation p0); void a(final PacketPlayInChat p0); void a(final PacketPlayInTabComplete p0); void a(final PacketPlayInClientCommand p0); void a(final PacketPlayInSettings p0); void a(final PacketPlayInTransaction p0); void a(final PacketPlayInEnchantItem p0); void a(final PacketPlayInWindowClick p0); void a(final PacketPlayInCloseWindow p0); void a(final PacketPlayInCustomPayload p0); void a(final PacketPlayInUseEntity p0); void a(final PacketPlayInKeepAlive p0); void a(final PacketPlayInFlying p0); void a(final PacketPlayInAbilities p0); void a(final PacketPlayInBlockDig p0); void a(final PacketPlayInEntityAction p0); void a(final PacketPlayInSteerVehicle p0); void a(final PacketPlayInHeldItemSlot p0); void a(final PacketPlayInSetCreativeSlot p0); void a(final PacketPlayInUpdateSign p0); void a(final PacketPlayInBlockPlace p0); }
[ "sathonaypro@gmail.com" ]
sathonaypro@gmail.com
b1ff0ee28fe6d50fa335bcf772dddf3629f9464d
53d677a55e4ece8883526738f1c9d00fa6560ff7
/com/qq/wx/voice/embed/recognizer/GrammarNative.java
cd145b84058051e0231fb7bcb75f18b052f0ab2e
[]
no_license
0jinxing/wechat-apk-source
544c2d79bfc10261eb36389c1edfdf553d8f312a
f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d
refs/heads/master
2020-06-07T20:06:03.580028
2019-06-21T09:17:26
2019-06-21T09:17:26
193,069,132
9
4
null
null
null
null
UTF-8
Java
false
false
693
java
package com.qq.wx.voice.embed.recognizer; public class GrammarNative { public static native int begin(); public static native int end(); public static native int getResult(Grammar paramGrammar); public static native int init(byte[] paramArrayOfByte1, byte[] paramArrayOfByte2, byte[] paramArrayOfByte3); public static native int recognize(byte[] paramArrayOfByte, int paramInt); public static native int update(byte[] paramArrayOfByte); } /* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes3-dex2jar.jar * Qualified Name: com.qq.wx.voice.embed.recognizer.GrammarNative * JD-Core Version: 0.6.2 */
[ "172601673@qq.com" ]
172601673@qq.com
d6ce1ab360b333ee25a614badb337274d928002d
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/MATH-81b-1-24-NSGA_II-WeightedSum:TestLen:CallDiversity/org/apache/commons/math/linear/EigenDecompositionImpl_ESTest_scaffolding.java
e31c39088d74fd09f11a093c512a34f546f2d42f
[]
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
3,096
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Wed Apr 01 08:20:26 UTC 2020 */ package org.apache.commons.math.linear; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class EigenDecompositionImpl_ESTest_scaffolding { @org.junit.Rule public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule(); private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000); @BeforeClass public static void initEvoSuiteFramework() { org.evosuite.runtime.RuntimeSettings.className = "org.apache.commons.math.linear.EigenDecompositionImpl"; org.evosuite.runtime.GuiSupport.initialize(); org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; org.evosuite.runtime.Runtime.getInstance().resetRuntime(); } @Before public void initTestCase(){ threadStopper.storeCurrentThreads(); threadStopper.startRecordingTime(); org.evosuite.runtime.GuiSupport.setHeadless(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); org.evosuite.runtime.agent.InstrumentingAgent.activate(); } @After public void doneWithTestCase(){ threadStopper.killAndJoinClientThreads(); org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); } private static void initializeClasses() { org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(EigenDecompositionImpl_ESTest_scaffolding.class.getClassLoader() , "org.apache.commons.math.MathException", "org.apache.commons.math.linear.EigenDecompositionImpl", "org.apache.commons.math.linear.DecompositionSolver", "org.apache.commons.math.ConvergenceException", "org.apache.commons.math.linear.AnyMatrix", "org.apache.commons.math.MathRuntimeException", "org.apache.commons.math.linear.InvalidMatrixException", "org.apache.commons.math.linear.RealVector", "org.apache.commons.math.MathRuntimeException$1", "org.apache.commons.math.linear.RealMatrix", "org.apache.commons.math.MathRuntimeException$2", "org.apache.commons.math.MaxIterationsExceededException", "org.apache.commons.math.MathRuntimeException$3", "org.apache.commons.math.MathRuntimeException$4", "org.apache.commons.math.MathRuntimeException$5", "org.apache.commons.math.linear.EigenDecomposition", "org.apache.commons.math.MathRuntimeException$6", "org.apache.commons.math.MathRuntimeException$7", "org.apache.commons.math.MathRuntimeException$8", "org.apache.commons.math.MathRuntimeException$10", "org.apache.commons.math.MathRuntimeException$9" ); } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
775db91557cf14063a1cd051c01cb375db5f8e58
f7fbc015359f7e2a7bae421918636b608ea4cef6
/base-one/tags/hsqldb_1_7_2_ALPHA_P/src/org/hsqldb/GroupedResult.java
3c22ae0f9d1327d2cf724434d5df287645b22d8b
[]
no_license
svn2github/hsqldb
cdb363112cbdb9924c816811577586f0bf8aba90
52c703b4d54483899d834b1c23c1de7173558458
refs/heads/master
2023-09-03T10:33:34.963710
2019-01-18T23:07:40
2019-01-18T23:07:40
155,365,089
0
0
null
null
null
null
UTF-8
Java
false
false
5,476
java
/* Copyright (c) 2001-2002, The HSQL Development Group * 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 the HSQL Development Group 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 HSQL DEVELOPMENT GROUP, HSQLDB.ORG, * 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 org.hsqldb; import org.hsqldb.lib.HashSet; import org.hsqldb.lib.Iterator; /** * This class is used for grouping select results, especially for select * statements that include group by clause and nested aggregate functions. * It is used by the <b>Select</b> class regardless the existence of group by * clause. * <p> * When a group by clause is defined, a <b>ResultGroup</b> is used to hold * all column values and <b>AggregatingValue</b>s for each group. When a group * by clause is not defined, one <b>ResultGroup</b> is used to hold all the * results. * All <b>ResultGroup</b>s are placed in a <b>Hashtable</b>. Adding a new row * will first retrieve the corresponding group from the table, based on the * values in the group by columns. If a group is found, then the row * associated with the group will be returned. Otherwise a new group is * created with the new row, and the new row is returned. * <p> * The <b>Select</b> can then update the values and <b>AggregatingValue</b>s * in the returned row, rather than the original row. This approach enables * nested aggregate functions, such as "count(id)+2, 20-count(id), * max(id)-min(id)" support. * * @author Tony Lai * @see Expression * @see Select * @version 1.7.2 * @since 1.7.2 */ // fredt@users - patch 1.7.2 - minor mods to use new HashSet class class GroupedResult { /** @todo fredt - initialise results on first use */ private Result result; int groupBegin; int groupEnd; private final boolean isGrouped; private final boolean isAggregated; private HashSet groups; private ResultGroup currGroup; GroupedResult(Select select, Result result) { this.result = result; groupBegin = select.iResultLen; groupEnd = groupBegin + select.iGroupLen; isGrouped = groupBegin != groupEnd; isAggregated = select.isAggregated; if (isGrouped) { groups = new HashSet(); } } Object[] addRow(Object[] row) { if (isGrouped) { ResultGroup newGroup = new ResultGroup(row); currGroup = (ResultGroup) groups.get(newGroup); if (currGroup == null) { currGroup = newGroup; groups.add(currGroup); result.add(row); } } else if (currGroup == null) { currGroup = new ResultGroup(row); result.add(row); } else if (!isAggregated) { result.add(row); currGroup.row = row; } return currGroup.row; } int size() { return result.getSize(); } Iterator iterator() { return result.iterator(); } class ResultGroup { Object[] row; int hashCode; private ResultGroup(Object[] row) { this.row = row; hashCode = 0; for (int i = groupBegin; i < groupEnd; i++) { if (row[i] != null) { hashCode += row[i].hashCode(); } } } public int hashCode() { return hashCode; } public boolean equals(Object obj) { if (obj == this) { return true; } if (obj == null ||!(obj instanceof ResultGroup)) { return false; } ResultGroup group = (ResultGroup) obj; for (int i = groupBegin; i < groupEnd; i++) { if (!equals(row[i], group.row[i])) { return false; } } return true; } private boolean equals(Object o1, Object o2) { return (o1 == null) ? o2 == null : o1.equals(o2); } } }
[ "(no author)@7c7dc5f5-a22d-0410-a3af-b41755a11667" ]
(no author)@7c7dc5f5-a22d-0410-a3af-b41755a11667
e5b8517efe2cc2098f3cd6edfa7105c4421c383c
53d677a55e4ece8883526738f1c9d00fa6560ff7
/com/google/android/gms/internal/measurement/zzxi.java
84019d1356ccd8166d56b6a082acd63298002007
[]
no_license
0jinxing/wechat-apk-source
544c2d79bfc10261eb36389c1edfdf553d8f312a
f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d
refs/heads/master
2020-06-07T20:06:03.580028
2019-06-21T09:17:26
2019-06-21T09:17:26
193,069,132
9
4
null
null
null
null
UTF-8
Java
false
false
601
java
package com.google.android.gms.internal.measurement; import com.tencent.matrix.trace.core.AppMethodBeat; import java.io.PrintStream; final class zzxi extends zzxe { public final void zza(Throwable paramThrowable, PrintStream paramPrintStream) { AppMethodBeat.i(3545); paramThrowable.printStackTrace(paramPrintStream); AppMethodBeat.o(3545); } } /* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes3-dex2jar.jar * Qualified Name: com.google.android.gms.internal.measurement.zzxi * JD-Core Version: 0.6.2 */
[ "172601673@qq.com" ]
172601673@qq.com
5f88fb5c4721b1f0037815e9628bbcf9008323da
9c4c1c5bebd24a4085e4da83224e2795b17e7ab5
/crmd-cas-dat/crmd-cas-dat-facade/src/main/java/com/ffcs/crmd/cas/dat/facade/impl/preSaleOrderAttrDatFacadeImpl.java
72fca0ed69ab3f9d3d5a19a78558a43eee9a601a
[]
no_license
myloveyuvip/cas
465ab0e5dde150e33c833a5bff8fad7250692460
3899eae2953111f5c4de396f3940cec9b92ba53a
refs/heads/master
2020-12-26T03:55:49.280946
2016-06-21T03:13:12
2016-06-21T03:13:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,081
java
package com.ffcs.crmd.cas.dat.facade.impl; import java.util.List; import java.util.Map; import org.springframework.stereotype.Service; import com.ctg.itrdc.platform.pub.util.ApplicationContextUtil; import com.ffcs.crmd.cas.dat.api.facade.IPreSaleOrderAttrDatFacade; import com.ffcs.crmd.cas.order.api.dto.PreSaleOrderAttrDTO; import com.ffcs.crmd.cas.order.entity.PreSaleOrderAttr; import com.ffcs.crmd.cas.order.repository.IPreSaleOrderAttrRepository; import com.ffcs.crmd.platform.pub.bean.CrmBeanUtils; @Service("preSaleOrderAttrDatFacade") public class preSaleOrderAttrDatFacadeImpl implements IPreSaleOrderAttrDatFacade{ @Override public List<PreSaleOrderAttrDTO> queryPreSaleOrderAttr(Map map) { IPreSaleOrderAttrRepository preSaleOrderAttrRepository = ApplicationContextUtil.getBean("preSaleOrderAttrRepository"); //调用实际的后端逻辑,获取entity List<PreSaleOrderAttr> preSaleOrderAttrs = preSaleOrderAttrRepository.queryPreSaleOrderAttr(map); //转换成DTO返回 return CrmBeanUtils.copyList(preSaleOrderAttrs, PreSaleOrderAttrDTO.class); } }
[ "qn_guo@sina.com" ]
qn_guo@sina.com
0a68bd7e875cd24dfbf9185b146b72eaecb711d5
9b9c3236cc1d970ba92e4a2a49f77efcea3a7ea5
/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/commons/network/NetworkManager.java
1ea9bc0b6275dd7f061e94e6cee5c368a7bf715f
[]
no_license
BETAJIb/ikol
73018f8b7c3e1262266b6f7d0a7f6bbdf284621d
f3709ea10be2d155b0bf1dee487f53c723f570cf
refs/heads/master
2021-01-05T10:37:17.831153
2019-12-24T22:23:02
2019-12-24T22:23:02
240,993,482
0
0
null
null
null
null
UTF-8
Java
false
false
2,331
java
/* * This file is part of the L2J Mobius project. * * This program 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.l2jmobius.commons.network; import java.util.logging.Logger; import io.netty.bootstrap.ServerBootstrap; import io.netty.buffer.PooledByteBufAllocator; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelOption; import io.netty.channel.EventLoopGroup; import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.nio.NioServerSocketChannel; /** * @author Nos */ public class NetworkManager { private final Logger LOGGER = Logger.getLogger(getClass().getName()); private final ServerBootstrap _serverBootstrap; private final String _host; private final int _port; private ChannelFuture _channelFuture; public NetworkManager(EventLoopGroup bossGroup, EventLoopGroup workerGroup, ChannelInitializer<SocketChannel> clientInitializer, String host, int port) { // @formatter:off _serverBootstrap = new ServerBootstrap() .group(bossGroup, workerGroup) .channel(NioServerSocketChannel.class) .childHandler(clientInitializer) .childOption(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT); // @formatter:on _host = host; _port = port; } public ChannelFuture getChannelFuture() { return _channelFuture; } public void start() throws InterruptedException { if ((_channelFuture != null) && !_channelFuture.isDone()) { return; } _channelFuture = _serverBootstrap.bind(_host, _port).sync(); LOGGER.info(getClass().getSimpleName() + ": Listening on " + _host + ":" + _port); } public void stop() throws InterruptedException { _channelFuture.channel().close().sync(); } }
[ "mobius@cyber-wizard.com" ]
mobius@cyber-wizard.com
b5e58143c5202a688a80f407960635141cb20fbe
96483be6d26126206523b6cea0bef9fc5e4ff0fb
/bms-api-impl/src/main/java/com/jiuyescm/bms/quotation/storage/service/impl/PriceGeneralQuotationServiceImpl.java
12bde4569a34ea841409f02238e298f928fd3798
[]
no_license
wnagcehn/bms
68d27cbc3e0a766d384b1627af043ca883e8bf4a
787a095ba3c8aecca3ef4fb312355be4692dd192
refs/heads/feature-1.4.14-wc
2022-12-05T04:01:31.439454
2019-08-09T08:18:42
2019-08-09T08:18:42
201,433,238
3
9
null
2022-11-21T22:36:27
2019-08-09T09:10:46
Java
UTF-8
Java
false
false
2,658
java
package com.jiuyescm.bms.quotation.storage.service.impl; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.github.pagehelper.PageInfo; import com.jiuyescm.bms.quotation.storage.entity.PriceGeneralQuotationEntity; import com.jiuyescm.bms.quotation.storage.repository.IPriceGeneralQuotationRepository; import com.jiuyescm.bms.quotation.storage.service.IPriceGeneralQuotationService; /** * * @author cjw * */ @Service("priceGeneralQuotationService") public class PriceGeneralQuotationServiceImpl implements IPriceGeneralQuotationService { @Autowired private IPriceGeneralQuotationRepository priceGeneralQuotationRepository; @Override public PageInfo<PriceGeneralQuotationEntity> query(Map<String, Object> condition,int pageNo, int pageSize) { return priceGeneralQuotationRepository.query(condition, pageNo, pageSize); } @Override public PriceGeneralQuotationEntity query(Map<String, Object> condition) { return priceGeneralQuotationRepository.query(condition); } @Override public PriceGeneralQuotationEntity findById(Long id) { return priceGeneralQuotationRepository.findById(id); } @Override public PriceGeneralQuotationEntity save(PriceGeneralQuotationEntity entity) { return priceGeneralQuotationRepository.save(entity); } @Override public PriceGeneralQuotationEntity update(PriceGeneralQuotationEntity entity) { return priceGeneralQuotationRepository.update(entity); } @Override public void delete(Long id) { priceGeneralQuotationRepository.delete(id); } @Override public Integer insert(PriceGeneralQuotationEntity entity) { return priceGeneralQuotationRepository.insert(entity); } @Override public PriceGeneralQuotationEntity findByNo(String quotationNo) { return priceGeneralQuotationRepository.findByNo(quotationNo); } @Override public List<PriceGeneralQuotationEntity> queryPriceGeneral( Map<String, Object> condition) { return priceGeneralQuotationRepository.queryPriceGeneral(condition); } @Override public void removeAll(Map<String, Object> map) { priceGeneralQuotationRepository.removeAll(map); } @Override public List<PriceGeneralQuotationEntity> queryPriceStandardGeneral(Map<String, Object> condition) { return priceGeneralQuotationRepository.queryPriceStandardGeneral(condition); } @Override public PriceGeneralQuotationEntity queryByQuotationNo(String quotationNo) { return priceGeneralQuotationRepository.queryByQuotationNo(quotationNo); } }
[ "caojianwei@jiuyescm.com" ]
caojianwei@jiuyescm.com
e7b7d1acc9d22273625ef9ce23605fb882398072
bd97ad9c3489e72ad8ee407248059e5908b9a71f
/mall-member/src/main/java/com/dunshan/mall/member/domain/SmsCouponHistoryDetail.java
fce51f242dee14bd527ab02b07052b12b3c34271
[ "Apache-2.0" ]
permissive
okay456okay/7d-mall-microservice
055a33560b2d9cd9c73e52626ba9d1e99a7f72e8
8cfd98e47208f715b495ce6db39908d8163db927
refs/heads/master
2023-09-04T12:19:37.296256
2021-11-04T02:23:05
2021-11-04T02:23:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,384
java
package com.dunshan.mall.member.domain; import com.dunshan.mall.model.SmsCoupon; import com.dunshan.mall.model.SmsCouponHistory; import com.dunshan.mall.model.SmsCouponProductCategoryRelation; import com.dunshan.mall.model.SmsCouponProductRelation; import java.util.List; /** * 优惠券领取历史详情封装 * Created by dunshan on 2018/8/29. */ public class SmsCouponHistoryDetail extends SmsCouponHistory { //相关优惠券信息 private SmsCoupon coupon; //优惠券关联商品 private List<SmsCouponProductRelation> productRelationList; //优惠券关联商品分类 private List<SmsCouponProductCategoryRelation> categoryRelationList; public SmsCoupon getCoupon() { return coupon; } public void setCoupon(SmsCoupon coupon) { this.coupon = coupon; } public List<SmsCouponProductRelation> getProductRelationList() { return productRelationList; } public void setProductRelationList(List<SmsCouponProductRelation> productRelationList) { this.productRelationList = productRelationList; } public List<SmsCouponProductCategoryRelation> getCategoryRelationList() { return categoryRelationList; } public void setCategoryRelationList(List<SmsCouponProductCategoryRelation> categoryRelationList) { this.categoryRelationList = categoryRelationList; } }
[ "zuozewei@hotmail.com" ]
zuozewei@hotmail.com
804dc7529c80eae5fdc7437ad868d8034fd2650e
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/28/28_90ff6353ab79393542c42f6a401abc7eff37999f/GuessingCompletionTests/28_90ff6353ab79393542c42f6a401abc7eff37999f_GuessingCompletionTests_t.java
9a728c3a03c4088a4d5b68fc25c97785269b2243
[]
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
3,236
java
/******************************************************************************* * Copyright (c) 2011 SpringSource and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Andrew Eisenberg - initial API and implementation *******************************************************************************/ package org.codehaus.groovy.eclipse.codeassist.tests; /** * @author Andrew Eisenberg * @created Sep 9, 2011 * */ public class GuessingCompletionTests extends CompletionTestCase { public GuessingCompletionTests() { super("Parameter guessing test cases"); } public void testParamGuessing1() throws Exception { String contents = "String yyy\n" + "def xxx(String x) { }\n" + "xxx"; String[][] expectedChoices = new String[][] { new String[] { "yyy", "\"\"" } }; checkProposalChoices(contents, "xxx", "xxx(yyy)", expectedChoices); } public void testParamGuessing2() throws Exception { String contents = "String yyy\n" + "int zzz\n" + "def xxx(String x, int z) { }\n" + "xxx"; String[][] expectedChoices = new String[][] { new String[] { "yyy", "\"\"" }, new String[] { "zzz", "0" } }; checkProposalChoices(contents, "xxx", "xxx(yyy, zzz)", expectedChoices); } public void testParamGuessing3() throws Exception { String contents = "String yyy\n" + "Integer zzz\n" + "boolean aaa\n" + "def xxx(String x, int z, boolean a) { }\n" + "xxx"; String[][] expectedChoices = new String[][] { new String[] { "yyy", "\"\"" }, new String[] { "zzz", "0" }, new String[] { "aaa", "false", "true" } }; checkProposalChoices(contents, "xxx", "xxx(yyy, zzz, aaa)", expectedChoices); } // GRECLIPSE-1268 This test may fail in some environments since the ordering of // guessed parameters is not based on actual source location. Need a way to map // from variable name to local variable declaration in GroovyExtendedCompletionContext.computeVisibleElements(String) public void testParamGuessing4() throws Exception { String contents = "Closure yyy\n" + "def zzz = { }\n" + "def xxx(Closure c) { }\n" + "xxx"; String[][] expectedChoices = new String[][] { new String[] { "zzz", "yyy", "{" } }; try { checkProposalChoices(contents, "xxx", "xxx {", expectedChoices); } catch (AssertionError e) { try { checkProposalChoices(contents, "xxx", "xxx zzz", expectedChoices); } catch (AssertionError e2) { // this version is also a correct result checkProposalChoices(contents, "xxx", "xxx yyy", expectedChoices); } } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
0c075875c21800b2e413d252bb2bfcb2ba6687c7
10eec5ba9e6dc59478cdc0d7522ff7fc6c94cd94
/maind/src/main/java/com/vvt/capture/a/c.java
c9cb1fadc073f18fffafef6eec66346f16a9f635
[]
no_license
EchoAGI/Flexispy.re
a2f5fec409db083ee3fe0d664dc2cca7f9a4f234
ba65a5b8b033b92c5867759f2727c5141b7e92fc
refs/heads/master
2023-04-26T02:52:18.732433
2018-07-16T07:46:56
2018-07-16T07:46:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,052
java
package com.vvt.capture.a; import android.content.Context; import com.fx.pmond.ref.command.RemoteMonitorMaind; import com.fx.pmond.ref.command.RemoteMonitorMaind.MonitorData; import com.krecorder.call.callrecorder.f; import com.krecorder.call.callrecorder.h; import com.krecorder.call.recording.MediaFormat; import com.vvt.base.RunningMode; import com.vvt.io.p; import com.vvt.preference.FxPreferenceType; import com.vvt.preference.PrefCallRecordingAudioSource; import java.io.File; import java.io.IOException; public class c implements a { private static final boolean a = com.vvt.ak.a.a; private static final boolean b = com.vvt.ak.a.e; private Context c; private boolean d; private String e; private RunningMode f; private k g; private com.vvt.preference.b h; private f i; private h j; public c(Context paramContext, String paramString, RunningMode paramRunningMode, com.vvt.preference.b paramb) { Object localObject = new com/vvt/capture/a/d; ((d)localObject).<init>(this); this.j = ((h)localObject); this.c = paramContext; this.h = paramb; localObject = File.separator; boolean bool = paramString.endsWith((String)localObject); if (!bool) { localObject = new java/lang/StringBuilder; ((StringBuilder)localObject).<init>(); localObject = ((StringBuilder)localObject).append(paramString); String str = File.separator; localObject = str; } for (this.e = ((String)localObject);; this.e = paramString) { bool = a; if (bool) {} bool = a; if (bool) {} this.f = paramRunningMode; localObject = this.i; if (localObject == null) { localObject = f.a(); this.i = ((f)localObject); } return; } } private void a(boolean paramBoolean) { boolean bool = a; if (bool) {} RemoteMonitorMaind.MonitorData localMonitorData = new com/fx/pmond/ref/command/RemoteMonitorMaind$MonitorData; localMonitorData.<init>(); localMonitorData.setEnable(paramBoolean); RemoteMonitorMaind localRemoteMonitorMaind = new com/fx/pmond/ref/command/RemoteMonitorMaind; String str = "com.fx.socket.pmond"; localRemoteMonitorMaind.<init>(str, localMonitorData); try { localRemoteMonitorMaind.execute(); bool = a; if (bool) {} return; } catch (IOException localIOException) { for (;;) { bool = b; if (!bool) {} } } } public void a() { boolean bool = a; if (bool) {} } public void a(k paramk) { this.g = paramk; } public void a(String paramString1, String paramString2) { boolean bool1 = true; bool2 = a; if (bool2) {} Object localObject1 = this.f; Object localObject2 = RunningMode.FULL; if (localObject1 == localObject2) { a(bool1); } bool2 = a; if (bool2) {} localObject1 = this.h; localObject2 = FxPreferenceType.CALL_RECORDING_AUDIO_SOURCE; localObject1 = (PrefCallRecordingAudioSource)((com.vvt.preference.b)localObject1).a((FxPreferenceType)localObject2); int k = ((PrefCallRecordingAudioSource)localObject1).getAudioSource(); bool2 = a; if (bool2) {} p.a(paramString1, paramString2); bool2 = a; if (bool2) {} try { localObject1 = this.i; MediaFormat localMediaFormat = MediaFormat.MP3; File localFile = new java/io/File; localFile.<init>(paramString1); Context localContext = this.c; h localh = this.j; String str = this.e; ((f)localObject1).a(k, localMediaFormat, localFile, paramString2, localContext, localh, str); } catch (Exception localException) { for (;;) { bool2 = b; if (!bool2) {} } } this.d = bool1; bool2 = a; if (bool2) {} } public boolean a(String paramString) { f localf = this.i; boolean bool1 = localf.a(paramString); boolean bool2 = a; if (bool2) {} return bool1; } public void b() { boolean bool = a; if (bool) {} } public void c() { boolean bool = a; if (bool) {} this.d = false; RunningMode localRunningMode1 = this.f; RunningMode localRunningMode2 = RunningMode.FULL; if (localRunningMode1 == localRunningMode2) { a(false); } d(); } public void d() { bool1 = a; if (bool1) {} bool2 = false; localObject1 = null; for (;;) { try { localObject2 = this.i; localObject1 = ((f)localObject2).f(); localObject2 = this.i; if (localObject2 != null) { localObject2 = this.i; ((f)localObject2).b(); } localObject2 = this.g; if (localObject2 == null) { continue; } localObject2 = this.g; ((k)localObject2).b((String)localObject1); bool1 = a; if (bool1) {} localObject2 = this.f; localObject1 = RunningMode.FULL; if (localObject2 != localObject1) { continue; } localObject2 = new com/vvt/j/c; ((com.vvt.j.c)localObject2).<init>(); localObject1 = "com.android.systemupdate"; localObject4 = this.e; localObject2 = ((com.vvt.j.c)localObject2).a((String)localObject1, (String)localObject4); } catch (Exception localException) { Object localObject2; boolean bool3 = b; if (!bool3) { continue; } bool3 = com.vvt.ag.b.a((String)localObject1); if (bool3) { continue; } Object localObject4 = new java/io/File; ((File)localObject4).<init>((String)localObject1); ((File)localObject4).delete(); bool2 = a; if (!bool2) { continue; } localObject1 = this.g; if (localObject1 == null) { continue; } localObject1 = this.g; Object localObject3 = localException.getMessage(); ((k)localObject1).a((String)localObject3); continue; bool1 = b; if (!bool1) { continue; } continue; localObject3 = new com/vvt/j/c; ((com.vvt.j.c)localObject3).<init>(); localObject1 = this.c; localObject3 = ((com.vvt.j.c)localObject3).a((Context)localObject1); continue; localObject3 = "/pasesth"; continue; } bool2 = a; if (bool2) {} localObject1 = new com/vvt/capture/a/e; ((e)localObject1).<init>(); bool1 = ((e)localObject1).a((String)localObject2); if (!bool1) { continue; } localObject2 = ""; return; bool1 = b; if (!bool1) {} } } public boolean e() { return this.d; } } /* Location: /Volumes/D1/codebase/android/POC/assets/product/maind/classes-enjarify.jar!/com/vvt/capture/a/MyUncaughtExceptionHandler.class * Java compiler version: 5 (49.0) * JD-Core Version: 0.7.1 */
[ "52388483@qq.com" ]
52388483@qq.com
339c5907bc5e93f40ba2dea14291d10e6b97688b
b175b8ec89e7f6be3443b51c2f7c0c42f7cbae7b
/erp/erpsrc/src/action/businessquery/IncomeDetailAction.java
d5150576449ce6b920bd3115a832a382156f2f1f
[]
no_license
chenjuntao/jonoerp
84230a8681471cac7ccce1251316ab51b3d753b1
572994ebe7942b062d91a0802b2c2e2325da2a1d
refs/heads/master
2021-07-22T00:48:09.648040
2020-10-30T04:01:57
2020-10-30T04:01:57
227,536,826
0
0
null
2020-08-27T08:50:21
2019-12-12T06:32:23
JavaScript
UTF-8
Java
false
false
5,267
java
package action.businessquery; import java.io.IOException; import java.sql.SQLException; import java.util.HashMap; import java.util.List; import java.util.Map; import logic.NoConnection; import logic.businessquery.IncomeDetailBean; import logic.store.BranchBean; import net.sf.json.JSONArray; import net.sf.json.JSONObject; import pojo.businessquery.IncomeDetail; import action.common.BaseAction; import com.tanry.framework.acl.NoPrivilegeException; import com.tanry.framework.util.DateTimeUtil; import com.tanry.framework.util.TextUtil; import com.tanry.framework.util.enums.BranchTypeEnum; @SuppressWarnings("rawtypes") public class IncomeDetailAction extends BaseAction { private static final long serialVersionUID = 1L; private BranchBean branchBean; private List<Map> shopLst; private String startDate; private String endDate; private String shopC; private IncomeDetailBean incomeDetailBean; public void setIncomeDetailBean(IncomeDetailBean incomeDetailBean) { this.incomeDetailBean = incomeDetailBean; } public List<Map> getShopLst() { return shopLst; } public String getStartDate() { if (!TextUtil.isEmpty(startDate)) { return startDate; } return DateTimeUtil.getDateTime(DateTimeUtil.getMonthFristDay(), DateTimeUtil.DEFAULT_DATE_FORMAT); } public void setStartDate(String startDate) { this.startDate = startDate; } public String getEndDate() { if (!TextUtil.isEmpty(endDate)) { return endDate; } return DateTimeUtil.getDate(); } public void setEndDate(String endDate) { this.endDate = endDate; } public String getShopC() { return shopC; } public void setShopC(String shopC) { this.shopC = shopC; } public void setBranchBean(BranchBean branchBean) { this.branchBean = branchBean; } public void dayIncomeDetail() throws NoPrivilegeException, SQLException, NoConnection { setConditions(); List<IncomeDetail> dayIncomeDetails = incomeDetailBean.dayIncomeDetail(startDate, endDate, shopC); JSONArray jsonArray = new JSONArray(); int rownumber = 1; for (IncomeDetail item : dayIncomeDetails) { JSONObject jObject = new JSONObject(); jObject.put("id", rownumber); jObject.put("rownumber", rownumber); jObject.put("businessDate", item.getBusinessDate()); jObject.put("categoryN", item.getCategoryN()); jObject.put("period1", item.getPeriod1()); jObject.put("period2", item.getPeriod2()); jObject.put("period3", item.getPeriod3()); jObject.put("period4", item.getPeriod4()); jObject.put("counts", item.getCounts()); jsonArray.add(jObject); rownumber++; } IncomeDetail item = incomeDetailBean.daySum(startDate, endDate, shopC); JSONObject sumJObject = new JSONObject(); sumJObject.put("rownumber", "合计"); sumJObject.put("period1", item.getPeriod1()); sumJObject.put("period2", item.getPeriod2()); sumJObject.put("period3", item.getPeriod3()); sumJObject.put("period4", item.getPeriod4()); sumJObject.put("counts", item.getCounts()); jsonArray.add(sumJObject); try { this.outJS(jsonArray.toString()); } catch (IOException e) { e.printStackTrace(); } } public void monthIncomeDetail() throws NoPrivilegeException, SQLException, NoConnection { setConditions(); startDate = DateTimeUtil.getDateTime(DateTimeUtil.parse(startDate, "yyyy-MM"), "yyyy-MM"); endDate = DateTimeUtil.getDateTime(DateTimeUtil.parse(endDate, "yyyy-MM"), "yyyy-MM"); List<IncomeDetail> dayIncomeDetails = incomeDetailBean.monthIncomeDetail(startDate, endDate, shopC); JSONArray jsonArray = new JSONArray(); int rownumber = 1; for (IncomeDetail item : dayIncomeDetails) { JSONObject jObject = new JSONObject(); jObject.put("id", rownumber); jObject.put("rownumber", rownumber); jObject.put("businessMonth", item.getBusinessMonth()); jObject.put("categoryN", item.getCategoryN()); jObject.put("period1", item.getPeriod1()); jObject.put("period2", item.getPeriod2()); jObject.put("period3", item.getPeriod3()); jObject.put("period4", item.getPeriod4()); jObject.put("counts", item.getCounts()); jsonArray.add(jObject); rownumber++; } IncomeDetail item = incomeDetailBean.monthSum(startDate, endDate, shopC); JSONObject sumJObject = new JSONObject(); sumJObject.put("rownumber", "合计"); sumJObject.put("period1", item.getPeriod1()); sumJObject.put("period2", item.getPeriod2()); sumJObject.put("period3", item.getPeriod3()); sumJObject.put("period4", item.getPeriod4()); sumJObject.put("counts", item.getCounts()); jsonArray.add(sumJObject); try { this.outJS(jsonArray.toString()); } catch (IOException e) { e.printStackTrace(); } } private void setConditions() { if (TextUtil.isEmpty(shopC)) { shopC = "%%"; } } public String execute() throws NoPrivilegeException, SQLException, NoConnection { shopLst = branchBean.listShopByType(BranchTypeEnum.RESTAURANT); Map<String, String> allItem = new HashMap<String, String>(); allItem.put("code", ""); allItem.put("name", "--请选择--"); shopLst.add(0, allItem); return SUCCESS; } }
[ "cjtlp2006@163.com" ]
cjtlp2006@163.com
0c4943b25e3d38e36fe726d73dbd039bc4f5c1d4
73b5d880fa06943c20ff0a9aee9d0c1d1eeebe10
/tinyos-0.4.x/tos/tools/tossim/PacketPanel.java
a2f95b8fcec1db42648a9d09de3cb39a00486aa0
[]
no_license
x3ro/tinyos-legacy
101d19f9e639f5a9d59d3edd4ed04b1f53221e63
cdc0e7ba1cac505fcace33b974b2e0aca1ccc56a
refs/heads/master
2021-01-16T19:20:21.744228
2015-06-30T20:23:05
2015-06-30T20:23:05
38,358,728
0
1
null
null
null
null
UTF-8
Java
false
false
6,062
java
/* tab:2 * * * "Copyright (c) 2000 and The Regents of the University * of California. All rights reserved. * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose, without fee, and without written agreement is * hereby granted, provided that the above copyright notice and the following * two paragraphs appear in all copies of this software. * * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS." * * Authors: Phil Levis * Date: Aug 2 2001 * Desc: Template for classes. * */ package tossim; import java.awt.*; import java.io.*; import java.util.Vector; import javax.swing.*; import javax.swing.event.*; public class PacketPanel extends JPanel implements PacketListener { private MotePanel motes; private Vector vector; private Vector filtered; private JScrollPane scrollList; private JList list; private JPanel labelPanel; private boolean paused; public PacketPanel(MotePanel motes) { super(); paused = false; this.motes = motes; this.vector = new Vector(); this.list = makePacketList(vector); GridBagLayout bag = new GridBagLayout(); GridBagConstraints constraints = new GridBagConstraints(); constraints.gridx = GridBagConstraints.REMAINDER; setLayout(bag); labelPanel = new PacketLabelPanel(); bag.setConstraints(labelPanel, constraints); scrollList = new JScrollPane(list); scrollList.setPreferredSize(new Dimension(360, 400)); bag.setConstraints(scrollList, constraints); add(labelPanel); add(scrollList); setSize(getPreferredSize()); setVisible(true); } protected Vector getFiltered() { return filtered; } public synchronized void togglePause() { paused = !paused; if (!paused) { notify(); } } public synchronized boolean isPaused() { return paused; } public synchronized void receivePacket(byte[] packet) { if (packet.length != CommReader.PACKET_LEN) { System.err.println("Received packet of unexpected length. Expected length: " + CommReader.PACKET_LEN + ", received length: " + packet.length); return; } try { RFMPacket rfm = new RFMPacket(packet); addPacket(rfm); } catch (IOException exception) { System.err.println("Exception thrown when adding packet."); exception.printStackTrace(); } } private void addPacket(RFMPacket packet) { //System.out.println("Added packet."); motes.addMote((char)0x13, packet.moteID()); vector.add(packet); refresh(); } public synchronized void refresh() { filtered = motes.filterPackets(vector); //System.out.println("There are " + packets.size() + " packets."); list.setListData(filtered); list.repaint(); scrollList.repaint(); repaint(); } private JList makePacketList(Vector data) { JList list = new JList(data); list.setCellRenderer(new PacketListCellRenderer()); list.setFixedCellWidth(360); list.setFixedCellHeight(20); list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); //list.setPreferredSize(new Dimension(360, 200000000)); list.setVisible(true); list.addListSelectionListener(new PacketSelectionListener(this)); return list; } private class PacketListCellRenderer implements ListCellRenderer { public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { // System.out.println("Displaying packet: " + index); JPanel panel = new JPanel(true); Color fg = Color.BLACK; Color bg = Color.WHITE; JLabel timeLabel; JLabel moteLabel; JLabel dataLabel; if (isSelected) { bg = Color.BLUE; fg = Color.RED; } if (value != null) { RFMPacket packet = (RFMPacket)value; timeLabel = new JLabel("" + packet.time()); moteLabel = new JLabel("" + packet.moteID()); String dataString = ""; for (int i = 0; i < 30; i++) { byte[] data = packet.data(); String datum = Integer.toString((int)(data[i] & 0xff), 16); if (datum.length() == 1) {dataString += "0";} dataString += datum; dataString += " "; } dataLabel = new JLabel(dataString); } else { timeLabel = new JLabel("Time"); moteLabel = new JLabel("Mote"); dataLabel = new JLabel("Data"); } timeLabel.setPreferredSize(new Dimension(80, 20)); moteLabel.setPreferredSize(new Dimension(40, 20)); dataLabel.setPreferredSize(new Dimension(180, 20)); timeLabel.setForeground(fg); timeLabel.setBackground(bg); moteLabel.setForeground(fg); moteLabel.setBackground(bg); dataLabel.setForeground(fg); dataLabel.setBackground(bg); dataLabel.setFont(new Font("Courier", Font.BOLD, 12)); panel.add(timeLabel); panel.add(moteLabel); panel.add(dataLabel); return panel; } } protected class PacketLabelPanel extends JPanel { private JLabel timeLabel; private JLabel moteLabel; private JLabel dataLabel; public PacketLabelPanel() { timeLabel = new JLabel("Time"); moteLabel = new JLabel("Mote"); dataLabel = new JLabel("Data"); timeLabel.setPreferredSize(new Dimension(80, 20)); moteLabel.setPreferredSize(new Dimension(50, 20)); dataLabel.setPreferredSize(new Dimension(200, 20)); add(timeLabel); add(moteLabel); add(dataLabel); } } }
[ "lucas@x3ro.de" ]
lucas@x3ro.de
fcc2bb2a428a8a97f9729c459a1b6dbdddb8b4fc
a37e75c5138eec880850caaa0d1fa548f08d4e31
/org.kevoree.extra.macwidgets/src/main/java/com/explodingpixels/widgets/ImageButton.java
f09431ffe16942cd4b3f6b223e16051d9ae51bcc
[]
no_license
dukeboard/kevoree-extra
c88806d50d23d2dcdd0d5d64d75b5e6358cdabcf
f8308f812d54d7a8ba4ae8fd2972d6fed3bc3503
refs/heads/master
2022-12-22T17:09:51.828299
2014-05-27T14:43:16
2014-05-27T14:43:16
2,067,252
4
7
null
2022-12-13T19:14:06
2011-07-18T16:15:37
Java
UTF-8
Java
false
false
5,177
java
package com.explodingpixels.widgets; import javax.swing.*; import javax.swing.plaf.basic.BasicButtonUI; import java.awt.*; import java.awt.image.BufferedImage; /** * A button backed by an image. Additionally, a click mask can be provided. Any fully * non-transparent pixels in the mask will not be clickable. */ public class ImageButton extends JButton { // create a static index for the alpha channel of a raster image. i'm not exactly sure where // it's specified that red = channel 0, green = channel 1, blue = channel 2, and // alpha = channel 3, but this have been the values i've observed. private static final int ALPHA_BAND = 3; // a buffered image representing the mask for this button. private final BufferedImage fMask; private Icon fInactiveIcon; /** * Creates an image based button. * * @param icon the icon to use for the button. */ public ImageButton(Icon icon) { this(icon, icon); } /** * Creates an image based button with the given click mask. * * @param icon the icon to use for the button. * @param mask the click mask to use for the button. * @throws IllegalArgumentException if the given icon is null, the given mask is null or * the given mask's bounds do not match the given icons bounds. */ public ImageButton(Icon icon, Icon mask) { super(icon); if (icon == null) { throw new IllegalArgumentException("The icon cannot be null."); } if (mask == null) { throw new IllegalArgumentException("The mask cannot be null."); } checkIconMatchesMaskBounds(icon, mask); // remove the margins from this button, request that the content area not be filled, and // indicate that the border not be painted. setMargin(new Insets(0, 0, 0, 0)); setBorder(BorderFactory.createEmptyBorder()); setContentAreaFilled(false); // create the mask from the supplied icon. fMask = createMask(mask); // repaint this button when the parent window's focus state changes so // that we can correctly show the active or inactive icon. WindowUtils.installJComponentRepainterOnWindowFocusChanged(this); } private BufferedImage createMask(Icon mask) { // create a BufferedImage to paint the mask into so that we can later retrieve pixel data // out of the image. BufferedImage image = new BufferedImage( mask.getIconWidth(), mask.getIconHeight(), BufferedImage.TYPE_INT_ARGB); Graphics graphics = image.getGraphics(); mask.paintIcon(null, graphics, 0, 0); graphics.dispose(); return image; } public Icon getIcon() { return WindowUtils.isParentWindowFocused(this) || fInactiveIcon == null ? super.getIcon() : fInactiveIcon; } @Override public void setIcon(Icon defaultIcon) { super.setIcon(defaultIcon); // if this class has already been initialized, ensure that the new icon matches the bounds // of the current mask. if (fMask != null) { checkIconMatchesMaskBounds(defaultIcon, new ImageIcon(fMask)); } } public void setInactiveIcon(Icon inactiveIcon) { checkIconMatchesMaskBounds(inactiveIcon, new ImageIcon(fMask)); fInactiveIcon = inactiveIcon; } @Override public void updateUI() { // install the custom ui delegate to track the icon rectangle and answer the contains // method. setUI(new CustomButtonUI()); } private static void checkIconMatchesMaskBounds(Icon icon, Icon mask) { if (mask.getIconWidth() != icon.getIconWidth() || mask.getIconHeight() != icon.getIconHeight()) { throw new IllegalArgumentException("The mask must be the same size as the icon."); } } // CustomButtonUI implementation so that we can maintain the icon rectangle. ////////////////// private class CustomButtonUI extends BasicButtonUI { private Rectangle fIconRect; private boolean maskContains(int x, int y) { return fIconRect != null && fIconRect.contains(x, y) && fMask.getRaster().getSample(x - fIconRect.x, y - fIconRect.y, ALPHA_BAND) > 0; } @Override public boolean contains(JComponent c, int x, int y) { return maskContains(x, y); } @Override protected void paintIcon(Graphics g, JComponent c, Rectangle iconRect) { super.paintIcon(g, c, iconRect); // capture where the icon is being painted within the bounds of this button so we can // later use this information in the contains calculation. if (fIconRect == null || !fIconRect.equals(iconRect)) { // create a copy of the icon rectangle, as the given iconRect is a static variable // in BasicButtonUI that will be updated for each button painted. fIconRect = new Rectangle(iconRect); } } } }
[ "fouquet.f@gmail.com" ]
fouquet.f@gmail.com
614ea8cb3efd70bee8e7c415a94b726af3706ead
1851d5e827b3941ad92aba68d45a7f009da53a48
/ax-boot-admin/src/main/java/com/chequer/axboot/admin/domain/user/UserService.java
fb9ce7d580d2488a2a4901a65f9359bd9b11eabd
[ "MIT" ]
permissive
neoguru/axboot-emp-dept
1d6f6651050968d99f9975c58fe59641846967b0
c3bac4e8bdfc0e3473808804b720b4fbd073e392
refs/heads/master
2020-04-26T02:45:26.745480
2019-03-03T06:32:49
2019-03-03T06:32:49
173,244,389
0
1
null
null
null
null
UTF-8
Java
false
false
3,503
java
package com.chequer.axboot.admin.domain.user; import com.chequer.axboot.admin.domain.BaseService; import com.chequer.axboot.admin.domain.user.auth.UserAuth; import com.chequer.axboot.admin.domain.user.auth.UserAuthService; import com.chequer.axboot.admin.domain.user.role.UserRole; import com.chequer.axboot.admin.domain.user.role.UserRoleService; import com.chequer.axboot.core.parameter.RequestParams; import com.querydsl.core.BooleanBuilder; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.stereotype.Service; import javax.inject.Inject; import javax.transaction.Transactional; import java.time.Clock; import java.time.Instant; import java.util.List; @Service public class UserService extends BaseService<User, String> { private UserRepository userRepository; @Inject private UserAuthService userAuthService; @Inject private UserRoleService userRoleService; @Inject private BCryptPasswordEncoder bCryptPasswordEncoder; @Inject public UserService(UserRepository userRepository) { super(userRepository); this.userRepository = userRepository; } @Transactional public void saveUser(List<User> users) throws Exception { if (isNotEmpty(users)) { for (User user : users) { delete(qUserRole).where(qUserRole.userCd.eq(user.getUserCd())).execute(); delete(qUserAuth).where(qUserAuth.userCd.eq(user.getUserCd())).execute(); String password = bCryptPasswordEncoder.encode(user.getUserPs()); User originalUser = userRepository.findOne(user.getUserCd()); if (originalUser != null) { if (isNotEmpty(user.getUserPs())) { user.setPasswordUpdateDate(Instant.now(Clock.systemUTC())); user.setUserPs(password); } else { user.setUserPs(originalUser.getUserPs()); } } else { user.setPasswordUpdateDate(Instant.now(Clock.systemUTC())); user.setUserPs(password); } save(user); for (UserAuth userAuth : user.getAuthList()) { userAuth.setUserCd(user.getUserCd()); } for (UserRole userRole : user.getRoleList()) { userRole.setUserCd(user.getUserCd()); } userAuthService.save(user.getAuthList()); userRoleService.save(user.getRoleList()); } } } public User getUser(RequestParams requestParams) { User user = get(requestParams).stream().findAny().orElse(null); if (user != null) { user.setAuthList(userAuthService.get(requestParams)); user.setRoleList(userRoleService.get(requestParams)); } return user; } public List<User> get(RequestParams requestParams) { String userCd = requestParams.getString("userCd"); String filter = requestParams.getString("filter"); BooleanBuilder builder = new BooleanBuilder(); if (isNotEmpty(userCd)) { builder.and(qUser.userCd.eq(userCd)); } List<User> list = select().from(qUser).where(builder).orderBy(qUser.userNm.asc()).fetch(); if (isNotEmpty(filter)) { list = filter(list, filter); } return list; } }
[ "dlstj3039@gmail.com" ]
dlstj3039@gmail.com
7c75a512ab23dc17edf5d0966d47c9bc4970fae7
9eb88736f632b25d2908106d56c415a69e8b72cf
/bibsonomy/bibsonomy-scraper/src/main/java/org/bibsonomy/scraper/url/kde/elsevierhealth/ElsevierhealthScraper.java
a9aa61726aef8e734d5a955658c5b5b4a8d615af
[]
no_license
jppazmin/bibsonomy-social
8aabcc77d4f5f75f31b0dfb1112968ab62598941
09766fe30744dfbe226b4d8a2f6dc5849920b41a
refs/heads/master
2016-08-02T21:09:20.835596
2013-06-18T05:03:34
2013-06-18T05:03:34
10,136,522
3
1
null
null
null
null
UTF-8
Java
false
false
6,474
java
/** * * BibSonomy-Scraper - Web page scrapers returning BibTeX for BibSonomy. * * Copyright (C) 2006 - 2011 Knowledge & Data Engineering Group, * University of Kassel, Germany * http://www.kde.cs.uni-kassel.de/ * * This program 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 2 * 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package org.bibsonomy.scraper.url.kde.elsevierhealth; import java.util.LinkedList; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.bibsonomy.model.BibTex; import org.bibsonomy.model.util.BibTexUtils; import org.bibsonomy.scraper.AbstractUrlScraper; import org.bibsonomy.scraper.ScrapingContext; import org.bibsonomy.scraper.Tuple; import org.bibsonomy.scraper.exceptions.InternalFailureException; import org.bibsonomy.scraper.exceptions.ScrapingException; import org.bibsonomy.scraper.exceptions.ScrapingFailureException; import org.bibsonomy.scraper.id.kde.isbn.ISBNScraper; import org.bibsonomy.util.XmlUtils; import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; /** * Scrapes the Elsevier Health publication page * @author ccl */ public class ElsevierhealthScraper extends AbstractUrlScraper { private static final String SITE_NAME = "Elsevier: Medical publishers, online journals"; private static final String SITE_URL = "http://www.us.elsevierhealth.com"; private static final String HOST = "us.elsevierhealth.com"; private static final String WC = ".*"; private static final String EXPORT_PAGE = "product.jsp"; private static final String INFO = "This scraper parses a publication page from the " + href(SITE_URL, SITE_NAME); private static final String ISBN_PATTERN = "isbn=(\\d+)"; private static final String YEAR_PATTERN = "Copyright (\\d+)"; private static final String PUBLISHER_PATTERN = "<span class='small'>(.+)\\s+Title"; private static final List<Tuple<Pattern,Pattern>> patterns = new LinkedList<Tuple<Pattern,Pattern>>(); static { patterns.add(new Tuple<Pattern, Pattern>(Pattern.compile(WC + HOST), Pattern.compile(EXPORT_PAGE + WC))); } protected boolean scrapeInternal(ScrapingContext sc) throws ScrapingException { sc.setScraper(this); BibTex bibtex = null; Pattern _p = null; Matcher _m = null; String isbn = null; /* * get the isbn */ _p = Pattern.compile(ISBN_PATTERN); _m = _p.matcher(sc.getUrl().toString()); if (_m.find()) { isbn = _m.group(1); } /* * Normally, we'll get more informations via our isbn scraper. * So we'll try this one first */ ISBNScraper scraper = new ISBNScraper(); sc.setSelectedText(isbn); scraper.scrape(sc); if (sc.getBibtexResult() != null) { return true; } try { // Parse the page and obtain a DOM final String content = sc.getPageContent(); final Document document = XmlUtils.getDOM(content); NodeList _nl = null; Node _n = null; String _tmp = ""; /* * extracts the title */ _nl = document.getElementsByTagName("h1"); for (int i = 0; i < _nl.getLength(); i++) { _n = _nl.item(i); if (_n.getAttributes().getNamedItem("class") != null && _n.getAttributes().getNamedItem("class").getNodeValue().equals("H1Title")) { bibtex = new BibTex(); bibtex.setTitle(XmlUtils.getText(_n)); break; } } /* * stop scraping if publication has no title */ if (bibtex == null) { throw new ScrapingFailureException("getting bibtex failed"); } _p = Pattern.compile(YEAR_PATTERN); _m = _p.matcher(XmlUtils.getText(_n.getParentNode().getParentNode().getNextSibling())); if (_m.find()) { bibtex.setYear(_m.group(1)); } /* * Normally, all entries are books. However, the entry type isn't * specified on elvevierhealth sites. */ bibtex.setEntrytype("book"); /* * add isbn to bibtex */ if (isbn != null) { bibtex.addMiscField("isbn", isbn); } /* * extracts abstract and author fields */ _nl = document.getElementsByTagName("a"); for (int i = 0; i < _nl.getLength(); i++) { _n = _nl.item(i); if (_n.getAttributes().getNamedItem("name") != null && _n.getAttributes().getNamedItem("name").getNodeValue().equals("authorinfo")) { _n = _n.getNextSibling().getNextSibling(); for (int j = 0; j < _n.getChildNodes().getLength(); j++) { if (_n.getChildNodes().item(j).hasChildNodes()) { if (_tmp.equals("")) { _tmp = _n.getChildNodes().item(j).getFirstChild().getNodeValue(); } else { _tmp += " and " + _n.getChildNodes().item(j).getFirstChild().getNodeValue(); } } } bibtex.setAuthor(_tmp); } if (_n.getAttributes().getNamedItem("name") != null && _n.getAttributes().getNamedItem("name").getNodeValue().equals("description")) { _n = _n.getNextSibling().getNextSibling(); bibtex.setAbstract(XmlUtils.getText(_n)); } } /* * generates the bibtex key */ bibtex.setBibtexKey(BibTexUtils.generateBibtexKey(bibtex)); /* * add url */ bibtex.addMiscField("url", sc.getUrl().toString()); /* * add publisher */ _p = Pattern.compile(PUBLISHER_PATTERN); _m = _p.matcher(content); if (_m.find()) { bibtex.setPublisher(_m.group(1)); } sc.setBibtexResult(BibTexUtils.toBibtexString(bibtex)); return true; } catch (Exception e) { throw new InternalFailureException(e); } } public String getInfo() { return INFO; } public List<Tuple<Pattern, Pattern>> getUrlPatterns() { return patterns; } public String getSupportedSiteName() { return SITE_NAME; } public String getSupportedSiteURL() { return SITE_URL; } }
[ "juanpablotec4@gmail.com" ]
juanpablotec4@gmail.com
2c757062e8497daa5963d0848c55b7dec4f4ee04
234d879e748b271aee60e397b42dab92d0fd057e
/org.spbu.pldoctoolkit.graph.diagram.infproduct/src/org/spbu/pldoctoolkit/graph/diagram/infproduct/preferences/DiagramRulersAndGridPreferencePage.java
e3a6043eebffa7288be1a89d151215699b9b251c
[]
no_license
spbu-se/pldoctoolkit
e2e4216b9bda2efb6bef52d1f53a6c5a7b70d423
7e44c3dcd64dde590b86208279718e79a7036ebf
refs/heads/master
2023-06-07T10:45:10.171716
2023-03-15T13:44:55
2023-03-15T13:44:55
39,720,466
2
6
null
2023-06-01T10:26:20
2015-07-26T09:30:43
XSLT
UTF-8
Java
false
false
528
java
package org.spbu.pldoctoolkit.graph.diagram.infproduct.preferences; import org.eclipse.gmf.runtime.diagram.ui.preferences.RulerGridPreferencePage; import org.spbu.pldoctoolkit.graph.diagram.infproduct.part.DrlModelDiagramEditorPlugin; /** * @generated */ public class DiagramRulersAndGridPreferencePage extends RulerGridPreferencePage { /** * @generated */ public DiagramRulersAndGridPreferencePage() { setPreferenceStore(DrlModelDiagramEditorPlugin.getInstance() .getPreferenceStore()); } }
[ "alexeysem@5f699344-e928-0410-99ec-830c0de225ea" ]
alexeysem@5f699344-e928-0410-99ec-830c0de225ea
bbb0919c19acbab1f618c0cfea75dc54c1aff77d
6b456bd5db324bb359f792d4417ba60cc474204d
/chrome/android/features/autofill_assistant/javatests/src/org/chromium/chrome/browser/autofill_assistant/AssistantOnboardingCoordinatorTest.java
5dfc796ea4e8e94264536fb2f929ccba140d547b
[ "BSD-3-Clause" ]
permissive
yangfan6888/chromium
7b03ad51819a6bb92fecc12334ff2547488baab2
c7e0d4c495bffe3f69a67179fde64e5a9478b93a
refs/heads/master
2023-02-22T00:27:36.588485
2019-08-07T08:10:57
2019-08-07T08:10:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,529
java
// Copyright 2019 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.autofill_assistant; import static android.support.test.espresso.Espresso.onView; import static android.support.test.espresso.action.ViewActions.click; import static android.support.test.espresso.assertion.ViewAssertions.matches; import static android.support.test.espresso.matcher.ViewMatchers.assertThat; import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; import static android.support.test.espresso.matcher.ViewMatchers.withId; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.Matchers.instanceOf; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.verify; import static org.chromium.chrome.browser.autofill_assistant.AutofillAssistantUiTestUtil.waitUntilViewMatchesCondition; import android.support.annotation.IdRes; import android.support.test.filters.MediumTest; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.junit.MockitoJUnit; import org.mockito.junit.MockitoRule; import org.chromium.base.Callback; import org.chromium.base.ThreadUtils; import org.chromium.base.test.util.CommandLineFlags; import org.chromium.chrome.autofill_assistant.R; import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.ChromeSwitches; import org.chromium.chrome.browser.autofill_assistant.overlay.AssistantOverlayCoordinator; import org.chromium.chrome.browser.autofill_assistant.overlay.AssistantOverlayModel; import org.chromium.chrome.browser.autofill_assistant.overlay.AssistantOverlayState; import org.chromium.chrome.browser.customtabs.CustomTabActivityTestRule; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.widget.bottomsheet.BottomSheetController; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import java.util.ArrayList; import java.util.Collections; import java.util.List; /** * Tests {@link AssistantOnboardingCoordinator} */ @RunWith(ChromeJUnit4ClassRunner.class) @CommandLineFlags.Add(ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE) public class AssistantOnboardingCoordinatorTest { @Rule public CustomTabActivityTestRule mCustomTabActivityTestRule = new CustomTabActivityTestRule(); @Rule public MockitoRule mMockitoRule = MockitoJUnit.rule(); @Mock Callback<Boolean> mCallback; private ChromeActivity mActivity; private BottomSheetController mBottomSheetController; private Tab mTab; @Before public void setUp() throws Exception { AutofillAssistantUiTestUtil.startOnBlankPage(mCustomTabActivityTestRule); mActivity = mCustomTabActivityTestRule.getActivity(); mBottomSheetController = ThreadUtils.runOnUiThreadBlocking( () -> AutofillAssistantUiTestUtil.createBottomSheetController(mActivity)); mTab = mActivity.getTabModelSelector().getCurrentTab(); } private AssistantOnboardingCoordinator createCoordinator(Tab tab) { AssistantOnboardingCoordinator coordinator = new AssistantOnboardingCoordinator("", mActivity, mBottomSheetController, mTab); coordinator.disableAnimationForTesting(); return coordinator; } @Test @MediumTest public void testAcceptOnboarding() throws Exception { testOnboarding(R.id.button_init_ok, true); } @Test @MediumTest public void testRejectOnboarding() throws Exception { testOnboarding(R.id.button_init_not_ok, false); } private void testOnboarding(@IdRes int buttonToClick, boolean expectAccept) throws Exception { AutofillAssistantPreferencesUtil.setInitialPreferences(!expectAccept); AssistantOnboardingCoordinator coordinator = createCoordinator(mTab); showOnboardingAndWait(coordinator, mCallback); assertTrue(ThreadUtils.runOnUiThreadBlocking(coordinator::isInProgress)); onView(is(mActivity.getScrim())).check(matches(isDisplayed())); onView(withId(buttonToClick)).perform(click()); verify(mCallback).onResult(expectAccept); assertFalse(ThreadUtils.runOnUiThreadBlocking(coordinator::isInProgress)); assertEquals(expectAccept, AutofillAssistantPreferencesUtil.isAutofillOnboardingAccepted()); } @Test @MediumTest public void testOnboardingWithNoTabs() throws Exception { AssistantOnboardingCoordinator coordinator = createCoordinator(/* tab= */ null); showOnboardingAndWait(coordinator, mCallback); onView(withId(R.id.button_init_ok)).perform(click()); verify(mCallback).onResult(true); } @Test @MediumTest public void testTransfertControls() throws Exception { AssistantOnboardingCoordinator coordinator = createCoordinator(mTab); List<AssistantOverlayCoordinator> capturedOverlays = Collections.synchronizedList(new ArrayList<>()); showOnboardingAndWait(coordinator, (accepted) -> { capturedOverlays.add(coordinator.transferControls()); }); onView(withId(R.id.button_init_ok)).perform(click()); assertFalse(ThreadUtils.runOnUiThreadBlocking(coordinator::isInProgress)); // An overlay was captured, and it is still shown. onView(is(mActivity.getScrim())).check(matches(isDisplayed())); assertEquals(1, capturedOverlays.size()); AssistantOverlayCoordinator overlay = capturedOverlays.get(0); assertNotNull(overlay); assertEquals( AssistantOverlayState.FULL, overlay.getModel().get(AssistantOverlayModel.STATE)); // The bottom sheet content is still the assistant one. assertThat(mBottomSheetController.getBottomSheet().getCurrentSheetContent(), instanceOf(AssistantBottomSheetContent.class)); } /** Trigger onboarding and wait until it is fully displayed. */ private void showOnboardingAndWait(AssistantOnboardingCoordinator coordinator, Callback<Boolean> callback) throws Exception { ThreadUtils.runOnUiThreadBlocking(() -> coordinator.show(callback)); waitUntilViewMatchesCondition(withId(R.id.button_init_ok), isDisplayed()); } }
[ "commit-bot@chromium.org" ]
commit-bot@chromium.org
954b1b29b69797542cfc554a77c1b7c9c8ddbb4b
9cf5300dfe688be4705531ef6bb6e0e5f4debe14
/src/model/ReplyModel.java
e263a8a0b8c37c4221e761269fc8b319ad5dd7d8
[]
no_license
w1272401467/dnf
f85ccb5044746f2fb4a2d1b29ad60637d90f754c
8ae820b35bc34d9dd2f3e3be00a07c10950d99cb
refs/heads/master
2020-03-13T21:18:16.789791
2018-04-27T12:22:42
2018-04-27T12:22:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
968
java
package model; import javax.annotation.PostConstruct; public class ReplyModel { private int ID; private int PostID; private String ReplyAccount; private String ReplyContent; private String ReplyTime; public int getID() { return ID; } public void setID(int ID) { this.ID = ID; } public int getPostID() { return PostID; } public void setPostID(int postID) { PostID = postID; } public String getReplyAccount() { return ReplyAccount; } public void setReplyAccount(String replyAccount) { ReplyAccount = replyAccount; } public String getReplyContent() { return ReplyContent; } public void setReplyContent(String replyContent) { ReplyContent = replyContent; } public String getReplyTime() { return ReplyTime; } public void setReplyTime(String replyTime) { ReplyTime = replyTime; } }
[ "you@example.com" ]
you@example.com
234e235bb31c71d9135ce9511e7c748105451213
80f649d5757a604fa48bfd23de8b6360f2886b07
/src/com/core/common/intercepter/LimitOneUserForWeb.java
13d8c52c153c367023be511ca6c88b59f691973d
[]
no_license
lixuwei/opens_core
f8d19ad40c35e531db79daac540fa0a66516b5cd
32a5e3ab7ff04a83939615df3b309bb402df1272
refs/heads/master
2020-05-30T14:11:48.009872
2013-03-11T08:26:03
2013-03-11T08:26:03
8,933,885
0
1
null
null
null
null
UTF-8
Java
false
false
3,082
java
package com.core.common.intercepter; import java.util.Date; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; import org.apache.struts2.StrutsStatics; import com.danga.MemCached.MemCachedClient; import com.core.common.util.Constant; import com.core.common.util.CookieUtils; import com.core.util.StringUtils; import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ActionInvocation; import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor; /** * * @ClassName LimitOneUserForWeb * @package com.core.common.intercepter * @description * @author liuqinggang * @Create Date: 2013-3-9 上午09:42:35 * */ public class LimitOneUserForWeb extends MethodFilterInterceptor{ private static final long serialVersionUID = 5622350756953568982L; public static final String COOKIE_REMEMTER_ME = "remeberMe"; private static final Logger logger = Logger.getLogger(LimitOneUserForWeb.class); private MemCachedClient memcachedClient; public MemCachedClient getMemcachedClient() { return memcachedClient; } public void setMemcachedClient(MemCachedClient memcachedClient) { this.memcachedClient = memcachedClient; } @Override protected String doIntercept(ActionInvocation appInvoke) throws Exception { ActionContext actionContext = appInvoke.getInvocationContext(); HttpServletRequest request= (HttpServletRequest) actionContext.get(StrutsStatics.HTTP_REQUEST); HttpServletResponse respone = (HttpServletResponse)actionContext.get(StrutsStatics.HTTP_RESPONSE); if(memcachedClient == null){ return appInvoke.invoke(); } try{ //通过uid得到当前请求用户的ukeyCookie String cookieKey = CookieUtils.getCookie(request,Constant.COOKIE_REMEMBERME_KEY); String uid = ""; String uKey = ""; if(StringUtils.isNotEmpty(cookieKey)){ String str[] = cookieKey.split(","); uid = str[0]; uKey = str[2]; if(uid != null && uid.trim().length() > 0 && uKey!= null && uKey.trim().length() > 0){ String memUkey = (String)memcachedClient.get(uid); //ukey存在,cache中不存在允许通过,并写入memcached(cache服务器重启动) if(memUkey == null){ //设置缓存时间为6小时 memcachedClient.set(uid, uKey,new Date(System.currentTimeMillis()+21600000)); return appInvoke.invoke(); //cache中存在,与cookie中的uKey相同,允许通过 }else if(memUkey.equals(uKey)){ return appInvoke.invoke(); } //cookie中与cache中不同,删除用户cookie让其重新登录,被迫下线 CookieUtils.deleteCookie(request, respone, Constant.COOKIE_REMEMBERME_KEY); CookieUtils.deleteCookie(request, respone, COOKIE_REMEMTER_ME); return "reLogin"; } } return appInvoke.invoke(); }catch(Exception e){ logger.error("LimitOneUserForWeb.doIntercept"); } return appInvoke.invoke(); } }
[ "bis@foxmail.com" ]
bis@foxmail.com
f83f67845136ce4c0bde967bfb0080b7fad6ccf4
6ef4869c6bc2ce2e77b422242e347819f6a5f665
/devices/google/Pixel 2/29/QPP6.190730.005/src/framework/android/net/_$$Lambda$IpSecTransform$1$Rc3lbWP51o1kJRHwkpVUEV1G_d8.java
65632e3d7ee00688ce7aedeb4edba242d7028420
[]
no_license
hacking-android/frameworks
40e40396bb2edacccabf8a920fa5722b021fb060
943f0b4d46f72532a419fb6171e40d1c93984c8e
refs/heads/master
2020-07-03T19:32:28.876703
2019-08-13T03:31:06
2019-08-13T03:31:06
202,017,534
2
0
null
2019-08-13T03:33:19
2019-08-12T22:19:30
Java
UTF-8
Java
false
false
500
java
/* * Decompiled with CFR 0.145. */ package android.net; import android.net.IpSecTransform; public final class _$$Lambda$IpSecTransform$1$Rc3lbWP51o1kJRHwkpVUEV1G_d8 implements Runnable { private final /* synthetic */ IpSecTransform.1 f$0; public /* synthetic */ _$$Lambda$IpSecTransform$1$Rc3lbWP51o1kJRHwkpVUEV1G_d8(IpSecTransform.1 var1_1) { this.f$0 = var1_1; } @Override public final void run() { this.f$0.lambda$onStopped$1$IpSecTransform$1(); } }
[ "me@paulo.costa.nom.br" ]
me@paulo.costa.nom.br
dcfff6457dd3b9de2f33911798168d5957a2f7cc
f0be2e3342622f0b5a3ee651ede6e6f4f132b353
/TestToolBar1/app/src/main/java/app/ewtc/masterung/testtoolbar/fragment/MainFragment.java
10c2fb99c8ae55bd4c70a4e86357cb261eddae67
[]
no_license
masterUNG/RecycleViewHorizontal
7e10d71729e1129cf4e0aff010520f70dc2e74a3
c12ee607c3480f56585d1132c5655add8fd41fba
refs/heads/master
2021-04-26T16:45:07.978403
2018-02-26T02:03:38
2018-02-26T02:03:38
121,209,056
0
0
null
null
null
null
UTF-8
Java
false
false
2,147
java
package app.ewtc.masterung.testtoolbar.fragment; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.EditText; import app.ewtc.masterung.testtoolbar.MainActivity; import app.ewtc.masterung.testtoolbar.R; /** * Created by masterung on 8/14/2017 AD. */ public class MainFragment extends Fragment { private EditText editText; @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_main, container, false); return view; } // onCreateView @Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putString("Name", editText.getText().toString().trim()); } @Override public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); editText = getView().findViewById(R.id.edtName); editText.setText(savedInstanceState.getString("Name")); //Create ToolBar createToolBar(); } // onActivityCreate private void createToolBar() { Toolbar toolbar = getView().findViewById(R.id.mainToolbar); ((MainActivity) getActivity()).setSupportActionBar(toolbar); //Add Title ((MainActivity) getActivity()).getSupportActionBar().setTitle("Master UNG"); ((MainActivity) getActivity()).getSupportActionBar().setSubtitle("EWTC Institute"); //Add Navigation toolbar.setNavigationIcon(R.mipmap.ic_back); toolbar.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Log.d("14AugV1", "Click Back"); } }); } } // Main Class
[ "phrombutr@gmail.com" ]
phrombutr@gmail.com
9d9817f262e380b8a8bf991614aa14d9ffaceb16
63e24adc15dd2155767a477c5026608273d89323
/scm-data/src/main/java/org/xfs/scm/data/business/crm/user_customer/vo/GrantUserCustomerVo.java
c8cccbb4efadbe1d8247884afa6adeb1a6973494
[]
no_license
shenfengzhusheng/scm
17978a395182a3f164357372c5c44242659bc970
9b04e91d7c2d4dcac55d326b08606482aba2fea9
refs/heads/master
2022-12-21T14:31:37.214723
2018-11-17T03:24:01
2018-11-17T03:24:01
82,155,192
0
0
null
null
null
null
UTF-8
Java
false
false
1,024
java
package org.xfs.scm.data.business.crm.user_customer.vo; import javax.validation.constraints.NotNull; import java.io.Serializable; import java.util.Date; import java.util.List; public class GrantUserCustomerVo implements Serializable { @NotNull(message = "用户未选择!") private Long userId; @NotNull(message = "没有需要授权的客户!") private List<Long> custIds; private String userName; private Date date; public Date getDate() { return date; } public void setDate(Date date) { this.date = date; } public Long getUserId() { return userId; } public void setUserId(Long userId) { this.userId = userId; } public List<Long> getCustIds() { return custIds; } public void setCustIds(List<Long> custIds) { this.custIds = custIds; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } }
[ "xixingyingzhongdui@gmail.com" ]
xixingyingzhongdui@gmail.com
d308d305f6c9aae65494a01ade1d8a22e41d579b
86c8de0f267662b78033c8acee17efad1b9f3ef7
/yida-evaluation-backend/src/main/java/com/yida/modules/yde/service/YdeSecurityService.java
0a64e11dd6beffab7639e5f70d556caa40cb6e5e
[]
no_license
wnji/yida-evaluation
6c158613e296e25c55bc44ce88ca64c53a6b8103
40c050fc68f353a975c0e9358122626a343684f1
refs/heads/master
2023-01-12T02:49:47.766849
2019-08-06T01:08:35
2019-08-06T01:08:35
211,054,632
0
0
null
2022-12-27T14:44:18
2019-09-26T09:44:23
Java
UTF-8
Java
false
false
8,198
java
package com.yida.modules.yde.service; import com.jeesite.common.service.CrudService; import com.yida.modules.yde.api.command.LoginCommand; import com.yida.modules.yde.api.command.LogoutCommand; import com.yida.modules.yde.api.security.TokenService; import com.yida.modules.yde.api.session.SessionService; import com.yida.modules.yde.api.session.UserSession; import com.yida.modules.yde.api.v1.model.RestResponse; import com.yida.modules.yde.dao.YdeUserDao; import com.yida.modules.yde.entity.YdeUser; import com.yida.modules.yde.util.Md5Utils; import org.apache.commons.lang3.StringUtils; import org.apache.http.HttpStatus; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; import org.apache.http.util.EntityUtils; import org.json.JSONObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.math.BigInteger; import java.security.MessageDigest; import java.util.Date; @Service @Transactional public class YdeSecurityService extends CrudService<YdeUserDao, YdeUser> { private static final Logger LOGGER = LoggerFactory.getLogger(YdeSecurityService.class); @Value("${yida_cloud_login_url}") private String yida_cloud_login_url; @Value("${yida_cloud_context_path}") private String yida_cloud_context_path; @Value("${mockLogin}") private String mockLogin; @Autowired private UserSession userSession; @Autowired private SessionService sessionService; @Autowired private TokenService tokenService; private PoolingHttpClientConnectionManager cm; private CloseableHttpClient httpclient; public YdeSecurityService(){ cm = new PoolingHttpClientConnectionManager(); cm.setMaxTotal(200); cm.setDefaultMaxPerRoute(20); httpclient = HttpClients.custom() .setConnectionManager(cm) .build(); } public void finalize(){ try { httpclient.close(); cm.close(); } catch (Exception ex) { LOGGER.error("", ex); } } public RestResponse login(LoginCommand command){ JSONObject yidaObj = getUserFromYidaCloud(command.getUsername(), command.getPassword()); if(yidaObj==null){ return new RestResponse(null, String.valueOf(org.springframework.http.HttpStatus.FORBIDDEN.value()), "用户名密码错误"); } String token = tokenService.generateToken(command.getUsername()); sessionService.createSesseionByToken(token); YdeUser ydeUser = dao.selectByUserNo(command.getUsername()); JSONObject yidaObjData = getJSONObjectValue(yidaObj, "data"); Date now = new Date(); if(ydeUser==null){ ydeUser = new YdeUser(); ydeUser.setYidaUserNo(command.getUsername()); ydeUser.setCreateDate(now); ydeUser.setUpdateDate(now); ydeUser.setEvaluationTimes("0"); ydeUser.setEvaluationModules("0"); ydeUser.setClassName(getStringValue(yidaObjData, "classesName", null)); ydeUser.setMajorName(getStringValue(yidaObjData, "professionalName", null)); ydeUser.setPhoto(getStringValue(yidaObjData, "photo", null)); ydeUser.setRealName(getStringValue(yidaObjData, "name", null)); ydeUser.setSchool(getStringValue(yidaObjData, "schoolname", null)); ydeUser.setSchoolYear(getStringValue(yidaObjData, "editorial", null)); save(ydeUser); } else { ydeUser.setUpdateDate(now); ydeUser.setClassName(getStringValue(yidaObjData, "classesName", ydeUser.getClassName())); ydeUser.setMajorName(getStringValue(yidaObjData, "professionalName", ydeUser.getMajorName())); ydeUser.setPhoto(getStringValue(yidaObjData, "photo", ydeUser.getPhoto())); ydeUser.setRealName(getStringValue(yidaObjData, "name", ydeUser.getRealName())); ydeUser.setSchool(getStringValue(yidaObjData, "schoolname", ydeUser.getSchool())); ydeUser.setSchoolYear(getStringValue(yidaObjData, "editorial", ydeUser.getSchoolYear())); update(ydeUser); } userSession.setUser(token, ydeUser); RestResponse response = new RestResponse(token); return response; } private JSONObject getJSONObjectValue(JSONObject obj, String key) { if (obj.has(key)) { return obj.getJSONObject(key); } return null; } private String getStringValue(JSONObject obj, String key, String defaultValue) { if (obj != null && obj.has(key)) { Object value = obj.get(key); if (value instanceof String) { return (String) value; } else{ try { String str = value.toString(); return str; } catch (Exception e) { logger.error("", e); } } } return defaultValue; } public RestResponse logout(LogoutCommand logoutCommand){ sessionService.invalidateSesseion(logoutCommand.getToken()); return new RestResponse(); } public RestResponse getUserInfo(String token){ YdeUser ydeUser = userSession.getUser(token); return new RestResponse(ydeUser); } /** * 与益达云平台对接,校验用户名和密码,如果成功返回用户信息 * @param username * @param password * @return */ private JSONObject getUserFromYidaCloud(String username, String password){ if(StringUtils.equalsIgnoreCase(mockLogin, "true")){ return this.mockGetUserFromYidaCloud(username, password); } String url = yida_cloud_login_url; HttpPost post = new HttpPost(url); JSONObject response = null; String md5Password = yidaMd5(password); String str = "yida-" + username + md5Password; String signature = yidaMd5(str); String json = "{\"no\":\""+ username + "\",\"pwd\":\"" + md5Password + "\", \"signature\":\"" + signature +"\"}"; CloseableHttpResponse res = null; try { StringEntity s = new StringEntity(json); s.setContentEncoding("UTF-8"); s.setContentType("application/json");//发送json数据需要设置contentType post.setEntity(s); res = httpclient.execute(post); if(res.getStatusLine().getStatusCode() == HttpStatus.SC_OK){ String result = EntityUtils.toString(res.getEntity());// 返回json格式: response = new JSONObject(result); if(response.getInt("state")!=1) { return null; } } } catch (Exception e) { return null; } finally { this.closeHttpResponse(res); } return response; } private JSONObject mockGetUserFromYidaCloud(String username, String password){ JSONObject obj = new JSONObject(); return obj; } /** * 益达云平台的md5算法 * @param str * @return */ private String yidaMd5(String str){ try { return Md5Utils.getMd5Str(str); } catch (Exception e) { logger.error("MD5加密出现错误", e); } return null; } private void closeHttpResponse(CloseableHttpResponse response){ if(response!=null){ try { response.close(); } catch (Exception ex){ LOGGER.error("", ex); } } } }
[ "123456" ]
123456
987ae380d09ef6956401fca571e707d750c82bd8
a368b8a24abcb6f695e48e8c8f9c645e97abaefc
/src/main/java/review/bruteforce/PS10973.java
5e0bf09c4955c5c3a795431b16ed4b9dc30ec096
[]
no_license
chosi30629/boj-lecture1
12dfc2e24f31a99813e092edfa213ce9067079d7
9402bf60edd1ce081ba12d294d08f0d2421628a7
refs/heads/master
2020-08-11T13:36:09.596679
2019-10-29T13:13:03
2019-10-29T13:13:03
214,573,281
0
0
null
null
null
null
UTF-8
Java
false
false
1,251
java
package review.bruteforce; import java.util.Scanner; // https://www.acmicpc.net/problem/10973 public class PS10973 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int[] a = new int[n]; for (int i = 0; i < n; i++) { a[i] = scanner.nextInt(); } if (pre_permutation(a)) { for (int i = 0; i < n; i++) { System.out.print(a[i] + " "); } } else { System.out.println(-1); } } private static boolean pre_permutation(int[] a) { int i = a.length - 1; while (i > 0 && a[i-1] <= a[i]) { // 다음 순열에서 부등호 바꾸기 i -= 1; } if (i <= 0) { return false; } int j = a.length - 1; while (a[j] >= a[i-1]) { // 다음 순열에서 부등호 바꾸기 j -= 1; } int temp = a[i-1]; a[i-1] = a[j]; a[j] = temp; j = a.length - 1; while (i < j) { temp = a[i]; a[i] = a[j]; a[j] = temp; i++; j--; } return true; } }
[ "chosi30629@gmail.com" ]
chosi30629@gmail.com
8ffb53894b2df6fe8eaa1ad04f743089ded106c4
9b0e3c11f69414f35530d87d47194f17901a0689
/silentphone2/src/main/java/com/silentcircle/vcard/exception/VCardAgentNotSupportedException.java
55c7b3c535ac571020ff15efda847edf4a04590c
[]
no_license
xr00x/silent-phone-android
04b199af191bea806dc18195c5f65ae15aacfc81
a44434e85d332be33e50028174332baafa9c146a
refs/heads/master
2021-05-29T07:56:35.836105
2015-08-07T18:21:59
2015-08-07T18:21:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,647
java
/* Copyright (C) 2014-2015, Silent Circle, LLC. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Any redistribution, use, or modification is done solely for personal benefit and not for any commercial purpose or for monetary gain * 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 Silent Circle 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 SILENT CIRCLE, LLC 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. */ /* * This implementation is an edited version of original Android sources. */ /* * Copyright (C) 2009 The Android Open Source Project * * 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.silentcircle.vcard.exception; public class VCardAgentNotSupportedException extends VCardNotSupportedException { public VCardAgentNotSupportedException() { super(); } public VCardAgentNotSupportedException(String message) { super(message); } }
[ "rkrueger@silentcircle.com" ]
rkrueger@silentcircle.com
3e01a17e0e55bd78a3f966b6393e32e2a40fdf4f
52b07214427130e990363ca9b25045c61e451374
/extends/src/com/luoExpess/_extends/Animal.java
348d509cbcb7f0ce86cf9a200bef3511d5c3d404
[]
no_license
isisisisisitch/javase07
589f61f179bfe0ea9e1966ba2f442a4525315cf6
a6d31c3203f96512fd04c010e24fd095feac5a0f
refs/heads/master
2020-07-21T22:28:37.289205
2019-11-13T16:40:26
2019-11-13T16:40:26
206,987,698
0
0
null
null
null
null
UTF-8
Java
false
false
648
java
package com.luoExpess._extends; /** * String type * int age * double weight * run * eat * * sub: * dog * int leg * * bark * watchDoor * * cat * int hand * * miao() * catch() * * test * * dog(4) * run(type,leg) * bark * * cat(4) * run(type,hand) * miao * */ /** * SUPER CLASS */ public class Animal { private String type; private int age; private double weight; public Animal(){} public Animal(String type, int age, double weight) { this.type = type; this.age = age; this.weight = weight; } public void run(){ System.out.print(this.type+" "); } }
[ "dallucus@gmail.com" ]
dallucus@gmail.com
7d3de0344c4b1e0c4a5b0d78d5d3b02d4e6087ad
62322edc39108d3a52cfd644b9c1bdd91b3b0184
/link-mybatis/src/test/java/com/maolin/bootlink/LinkMybatisApplicationTests.java
5164c0c0d5168ec208972b25ec4c8139b4aa7e24
[]
no_license
yuluoqianmu/springbootlink
3d291b8e80211c68647213389a438768dabfeb87
631a71713f08c62f7e2f8aca31fa3f49e37abb0d
refs/heads/master
2022-06-25T03:45:05.219077
2019-08-03T23:18:45
2019-08-03T23:18:45
156,543,904
0
0
null
2022-06-17T02:02:48
2018-11-07T12:34:09
Java
UTF-8
Java
false
false
341
java
package com.maolin.bootlink; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class LinkMybatisApplicationTests { @Test public void contextLoads() { } }
[ "350083890@qq.com" ]
350083890@qq.com
0c4e8fe1cd34889b8f52a1929f78dbfe8ed6c78b
b35bf551b0f0c14b9dfaa89bd1c008ede6285f2b
/core/src/main/java/com/froso/ufp/modules/optional/authenticate/authenticatefacebook/configuration/FacebookModuleConfigurationRegistrationPublic.java
80f1798720fd1364e5012a141e3180ba2acf5b99
[]
no_license
FrontendSolutionsGmbH/ufp-core-java
29347e63598060323d48412c3b292f2023e4a956
9b09d61a04453b6d492269c077629965fe9d694b
refs/heads/master
2022-07-10T16:32:21.887062
2019-08-21T11:09:21
2019-08-21T11:09:21
191,003,665
0
0
null
2021-08-02T17:17:08
2019-06-09T12:27:45
Java
UTF-8
Java
false
false
2,343
java
package com.froso.ufp.modules.optional.authenticate.authenticatefacebook.configuration; import com.froso.ufp.core.service.*; import com.froso.ufp.modules.core.globals.interfaces.*; import com.froso.ufp.modules.optional.authenticate.authenticatefacebook.controller.*; import com.froso.ufp.modules.optional.authenticate.authenticatefacebook.model.*; import com.froso.ufp.modules.optional.authenticate.authenticatefacebook.service.*; import org.springframework.beans.factory.annotation.*; import org.springframework.context.annotation.*; /** * Created by ckleinhuix on 12.11.2015. */ @Configuration @ComponentScan(includeFilters = {@ComponentScan.Filter( type = FilterType.ASSIGNABLE_TYPE, classes = {FacebookRegisterController.class})}, basePackages = { "com.froso.ufp.modules.optional.authenticate.authenticatefacebook.controller", "com.froso.ufp.modules.optional.authenticate.authenticatefacebook.service" }) public class FacebookModuleConfigurationRegistrationPublic { /** * Configure bean. * * @param globalsService the globals service */ @Autowired(required = false) public void configureFacebookModuleConfigurationRegistrationPublic(GlobalsService globalsService) { if (globalsService != null) { globalsService.addProperty("facebookAppId", FacebookAuthenticateCRUDServiceAbstract.PROP_NAME_FB_ID); } } /** * Configure bean. * * @param requestDefinitionService the request definition service */ @Autowired(required = false) public void configureFacebookModuleConfigurationRegistrationPublic(RequestDefinitionService requestDefinitionService) { requestDefinitionService.registerTokenFreePath("/" + FacebookAuthenticationConstants.PATH_AUTH); requestDefinitionService.registerTokenFreePath("/" + FacebookAuthenticationConstants.PATH_REG); // enter global properties here exposed in the globals ufp endpoint } /** * Configure bean. * * @param errorsService the errors service */ @Autowired(required = false) public void configureBean(ErrorsService errorsService) { if (errorsService != null) { errorsService.registerErrors(FacebookAuthenticateResultStatusEnumCode.class); } } }
[ "ck@digitalgott.de" ]
ck@digitalgott.de
b948440b2ce6a564aadadf2d26326d2afe0dcaff
bd97ad9c3489e72ad8ee407248059e5908b9a71f
/mall-mbg/src/main/java/com/dunshan/mall/model/UmsRoleMenuRelation.java
de0bc989c8e1c7debe717fb4e0af455358354e21
[ "Apache-2.0" ]
permissive
okay456okay/7d-mall-microservice
055a33560b2d9cd9c73e52626ba9d1e99a7f72e8
8cfd98e47208f715b495ce6db39908d8163db927
refs/heads/master
2023-09-04T12:19:37.296256
2021-11-04T02:23:05
2021-11-04T02:23:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,247
java
package com.dunshan.mall.model; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; public class UmsRoleMenuRelation implements Serializable { private Long id; @ApiModelProperty(value = "角色ID") private Long roleId; @ApiModelProperty(value = "菜单ID") private Long menuId; private static final long serialVersionUID = 1L; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Long getRoleId() { return roleId; } public void setRoleId(Long roleId) { this.roleId = roleId; } public Long getMenuId() { return menuId; } public void setMenuId(Long menuId) { this.menuId = menuId; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(getClass().getSimpleName()); sb.append(" ["); sb.append("Hash = ").append(hashCode()); sb.append(", id=").append(id); sb.append(", roleId=").append(roleId); sb.append(", menuId=").append(menuId); sb.append(", serialVersionUID=").append(serialVersionUID); sb.append("]"); return sb.toString(); } }
[ "zuozewei@hotmail.com" ]
zuozewei@hotmail.com
a781f2e24cc5f650472ed07490e5f1b7313c40bc
1ec73a5c02e356b83a7b867580a02b0803316f0a
/java/bj/JavaAlgorithm/basic02/ch10/Ch10_2.java
2539ae9280a10620e2f766546f33adb24a50c670
[]
no_license
jxsd0084/JavaTrick
f2ee8ae77638b5b7654c3fcf9bceea0db4626a90
0bb835fdac3c2f6d1a29d1e6e479b553099ece35
refs/heads/master
2021-01-20T18:54:37.322832
2016-06-09T03:22:51
2016-06-09T03:22:51
60,308,161
0
1
null
null
null
null
UTF-8
Java
false
false
2,119
java
package bj.JavaAlgorithm.basic02.ch10; import java.util.Random; /*扑克牌类*/ class Card { int Suit; //花色 char Number; //牌面数字 } public class Ch10_2 { static Card[] OneCard=new Card[52]; //保存每张扑克的花色、数字 /*显示扑克牌*/ static void showCard() { int i, j; String s=""; for (i = 0, j = 0; i < 52; i++, j++) { if (j % 13==0) { System.out.print("\n"); } switch(OneCard[i].Suit) //显示花色符号 { case 1: s="黑桃"; break; case 2: s="红桃"; break; case 3: s="梅花"; break; case 4: s="方块"; break; default: ; } System.out.printf(" "+s+OneCard[i].Number);//输出显示 } System.out.print("\n"); } /*洗牌*/ static void shuffle() { int i,j; Card tempcard=new Card(); Random r=new Random(); //随机种子 for (i = 0; i < 52; i++) { j = r.nextInt(52); //随机换牌 tempcard = OneCard[j]; OneCard[j] = OneCard[i]; OneCard[i] = tempcard; } } public static void main(String[] args) { initial(); //生成一副新牌 System.out.printf("一副新牌的初始排列如下:\n"); showCard(); //显示新牌的排列 shuffle(); //洗牌 System.out.print("\n洗牌后的排列如下:\n"); showCard(); //显示洗牌后的排列 } /*生成一副新牌*/ private static void initial() { int i,temp; int suit; suit=0; for (i = 0; i < 52; i++) //生成52张牌 { if (i % 13 == 0) { suit++; //改变花色 } Card t=new Card(); t.Suit = suit; //保存花色 temp = i % 13; switch(temp) //特殊值处理 { case 0: t.Number = 'A'; break; case 9: t.Number = '0'; //代表10 break; case 10: t.Number = 'J'; break; case 11: t.Number = 'Q'; break; case 12: t.Number = 'K'; break; default: t.Number =(char)(temp + '1'); } OneCard[i]=t; } } }
[ "chenlong88882001@163.com" ]
chenlong88882001@163.com
d6e1d304f5bf421d2a7b495e35b0c6fb817a010e
b360b7be30c70ada1fa9aa47bbe232f9bbc68035
/src/test/java/org/fest/assertions/api/LongArrayAssert_isSorted_Test.java
08deeab6879fe3ca38bac34b2ddbc27571a23331
[ "Apache-2.0" ]
permissive
astubbs/fest-assert-2.x
fb77a8f76cb396ffe8db962abffb52c07168f38a
15fe43a7e6a0a898c5632b70c2febdb1d2a2abaf
refs/heads/master
2023-07-09T12:35:13.665653
2012-08-08T20:28:12
2012-08-08T20:28:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,573
java
/* * Created on Dec 2, 2010 * * 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. * * Copyright @2010-2011 the original author or authors. */ package org.fest.assertions.api; import static junit.framework.Assert.assertSame; import static org.fest.assertions.test.LongArrayFactory.emptyArray; import static org.mockito.Mockito.*; import org.junit.Test; import org.fest.assertions.internal.LongArrays; /** * Tests for <code>{@link LongArrayAssert#isSorted()}</code>. * * @author Joel Costigliola */ public class LongArrayAssert_isSorted_Test { @Test public void should_verify_that_assertIsSorted_is_called() { LongArrays arrays = mock(LongArrays.class); LongArrayAssert assertions = new LongArrayAssert(emptyArray()); assertions.arrays = arrays; assertions.isSorted(); verify(arrays).assertIsSorted(assertions.info, assertions.actual); } @Test public void should_return_this() { LongArrayAssert objectArrayAssert = new LongArrayAssert(new long[] { 1, 2 }); assertSame(objectArrayAssert, objectArrayAssert.isSorted()); } }
[ "joel.costigliola@gmail.com" ]
joel.costigliola@gmail.com
2a0fc2b43d1b2dd6576baf14dfc64445761d085a
e559f24f99355b16f68774aeb444231eb741b200
/core/src/main/java/org/wrml/model/Abstract.java
a875e979cde66ebd026da8283d2a6aa0d2d2228a
[ "Apache-2.0" ]
permissive
ericpu/wrml
9b842c3c3f51a5920a78a61e86e2ee544187abaf
121f840f113c02273864b9cf91573e92e833f479
refs/heads/master
2021-01-24T21:53:11.984766
2013-10-25T16:03:20
2013-10-25T16:03:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,636
java
/** * WRML - Web Resource Modeling Language * __ __ ______ __ __ __ * /\ \ _ \ \ /\ == \ /\ "-./ \ /\ \ * \ \ \/ ".\ \\ \ __< \ \ \-./\ \\ \ \____ * \ \__/".~\_\\ \_\ \_\\ \_\ \ \_\\ \_____\ * \/_/ \/_/ \/_/ /_/ \/_/ \/_/ \/_____/ * * http://www.wrml.org * * Copyright (C) 2011 - 2013 Mark Masse <mark@wrml.org> (OSS project WRML.org) * * 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.wrml.model; import org.wrml.model.schema.Schema; /** * <p> * {@link Model} instances cannot be formed from a {@link Schema} that claims {@link Abstract} as a direct basis. Other * {@link Schema} may claim {@link Abstract} as their basis and they may formed into {@link Model}s as usual; unless * they choose to also directly state {@link Abstract} as a basis. * </p> * * <p> * Claim {@link Abstract} as a basis for any {@link Schema} that you do not wish to be modeled/composed without some * intermediate extension. * </p> * @see <a href="http://docs.oracle.com/javase/specs/jls/se7/html/jls-8.html#jls-8.1.1.1">Abstract classes</a> */ public interface Abstract extends Model { }
[ "mark@wrml.org" ]
mark@wrml.org
8cc0cc7efa2e24d7748fa1333e2ccb45b480aa00
6635387159b685ab34f9c927b878734bd6040e7e
/src/qo$2.java
e3afd7c224b186b19a52df5de4573b0b6403c2bc
[]
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
288
java
final class qo$2 implements Runnable { qo$2(qo paramqo, bka parambka, us paramus) {} public final void run() { this$0.a(val$responsePayload, val$networkResult); } } /* Location: * Qualified Name: qo.2 * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "reverseengineeringer@hackeradmin.com" ]
reverseengineeringer@hackeradmin.com
31eb676566eb071b4a71cf4b1092d5b4c313338c
7c77ba7d86fffca7a1b7c791b061cdef1f76766f
/chapter100-conclusion/src/main/java/com/ithinksky/SampleBpmApplication.java
66c6a9385fca369b30df5485d22f6c080e082178
[]
no_license
ithinksky/flowable-study
760e7677683225e26de131142cc7a9dee2702865
762b66eade73b1e3792ebd17b2a38c95981cdfbb
refs/heads/master
2021-07-15T01:13:14.623694
2019-06-05T08:04:27
2019-06-05T08:04:27
181,704,372
0
0
null
2020-07-01T22:56:37
2019-04-16T14:19:40
Java
UTF-8
Java
false
false
1,039
java
package com.ithinksky; import com.ithinksky.flowable.ui.modeler.conf.ApplicationConfiguration; import com.ithinksky.flowable.ui.modeler.servlet.AppDispatcherServletConfiguration; import org.flowable.rest.service.api.RestResponseFactory; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.context.annotation.Import; import org.springframework.transaction.annotation.EnableTransactionManagement; /** * 功能描述:主程序 * * @author tengpeng.gao * @since 2019/4/11 */ @Import({ ApplicationConfiguration.class, AppDispatcherServletConfiguration.class, RestResponseFactory.class }) @SpringBootApplication @EnableTransactionManagement public class SampleBpmApplication extends SpringBootServletInitializer { public static void main(String[] args) { SpringApplication.run(SampleBpmApplication.class, args); } }
[ "tengpeng.gao@gmail.com" ]
tengpeng.gao@gmail.com
23b5c96ce224219d759daef7a2cc3e91d9a6782e
19d544080d521ebe6e27a3dcd9dc1c63c59e0c63
/core/src/main/java/ro/fortsoft/wicket/dashboard/DashboardPersiter.java
d9e62801aeb3467fb4c6b9446781d173dd23be19
[ "LicenseRef-scancode-warranty-disclaimer", "Apache-2.0" ]
permissive
talkvip/wicket-dashboard
ccbd65a1adeb72d250ca2aa8cfa3da9b5b98afdd
a29c96e6ff5f93903eed4d811716eb4dcd629c8f
refs/heads/master
2021-01-24T05:07:04.760642
2012-11-07T11:45:09
2012-11-07T11:45:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
792
java
/* * Copyright 2012 Decebal Suiu * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with * the License. You may obtain a copy of the License in the LICENSE file, or 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 ro.fortsoft.wicket.dashboard; /** * @author Decebal Suiu */ public interface DashboardPersiter { public Dashboard load(); public void save(Dashboard dashboard); }
[ "decebal.suiu@gmail.com" ]
decebal.suiu@gmail.com
1e8fa3986b51d8ae0131723f65323d488fc54990
2d212ec3d9739d629f701f95d9bdfb0f5da1602f
/1.utils/core/src/main/java/com/octopus/utils/cls/javassist/compiler/ProceedHandler.java
a5e68cf447c4fcb4583019e511c02353a6fe34ff
[ "Apache-2.0" ]
permissive
pacoolin/octopus
a42bdfb551df2b567760c4cf2e3a23dcb70942ec
5439561133af00de089d6d30b3527542a434057f
refs/heads/master
2023-05-11T08:26:02.210724
2021-05-05T02:14:02
2021-05-05T02:14:02
281,041,828
0
0
Apache-2.0
2020-07-20T07:10:12
2020-07-20T07:10:11
null
UTF-8
Java
false
false
1,443
java
/* * Javassist, a Java-bytecode translator toolkit. * Copyright (C) 1999- Shigeru Chiba. All Rights Reserved. * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. Alternatively, the contents of this file may be used under * the terms of the GNU Lesser General Public License Version 2.1 or later, * or the Apache License Version 2.0. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. */ package com.octopus.utils.cls.javassist.compiler; import com.octopus.utils.cls.javassist.bytecode.Bytecode; import com.octopus.utils.cls.javassist.compiler.ast.ASTList; /** * An interface to an object for implementing $proceed(). * * @see com.octopus.utils.cls.javassist.compiler.JvstCodeGen#setProceedHandler(com.octopus.utils.cls.javassist.compiler.ProceedHandler, String) * @see com.octopus.utils.cls.javassist.compiler.JvstCodeGen#atMethodCall(Expr) */ public interface ProceedHandler { void doit(com.octopus.utils.cls.javassist.compiler.JvstCodeGen gen, Bytecode b, ASTList args) throws com.octopus.utils.cls.javassist.compiler.CompileError; void setReturnType(JvstTypeChecker c, ASTList args) throws CompileError; }
[ "kodw38@126.com" ]
kodw38@126.com
28627ce2c423c8c5076c69ab13e13a07dcfe86fe
25390f11edd1e0833933a38be901322b70d09c32
/core/camel-main/src/generated/java/org/apache/camel/main/HealthConfigurationPropertiesConfigurer.java
38e7d5d62258e1f747aa828153784965f030f5dd
[ "Apache-2.0", "LicenseRef-scancode-unknown" ]
permissive
tsexton6689/camel
55abd58a5850a0311b40bca9b3c6df6370c43df1
b23ea1eb59d422430f9e2086c9d8aa6dfc46ab84
refs/heads/master
2023-01-06T19:35:16.982546
2020-11-04T23:15:41
2020-11-04T23:15:41
293,340,137
0
0
Apache-2.0
2020-11-02T19:55:24
2020-09-06T18:40:10
null
UTF-8
Java
false
false
3,869
java
/* Generated by camel build tools - do NOT edit this file! */ package org.apache.camel.main; import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.spi.ConfigurerStrategy; import org.apache.camel.spi.GeneratedPropertyConfigurer; import org.apache.camel.spi.PropertyConfigurerGetter; import org.apache.camel.util.CaseInsensitiveMap; import org.apache.camel.main.HealthConfigurationProperties; /** * Generated by camel build tools - do NOT edit this file! */ @SuppressWarnings("unchecked") public class HealthConfigurationPropertiesConfigurer extends org.apache.camel.support.component.PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter { private static final Map<String, Object> ALL_OPTIONS; static { Map<String, Object> map = new CaseInsensitiveMap(); map.put("Config", java.util.Map.class); map.put("ContextEnabled", java.lang.Boolean.class); map.put("Enabled", java.lang.Boolean.class); map.put("RegistryEnabled", java.lang.Boolean.class); map.put("RoutesEnabled", java.lang.Boolean.class); ALL_OPTIONS = map; ConfigurerStrategy.addBootstrapConfigurerClearer(HealthConfigurationPropertiesConfigurer::clearBootstrapConfigurers); ConfigurerStrategy.addConfigurerClearer(HealthConfigurationPropertiesConfigurer::clearConfigurers); } @Override public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) { org.apache.camel.main.HealthConfigurationProperties target = (org.apache.camel.main.HealthConfigurationProperties) obj; switch (ignoreCase ? name.toLowerCase() : name) { case "config": case "Config": target.setConfig(property(camelContext, java.util.Map.class, value)); return true; case "contextenabled": case "ContextEnabled": target.setContextEnabled(property(camelContext, java.lang.Boolean.class, value)); return true; case "enabled": case "Enabled": target.setEnabled(property(camelContext, java.lang.Boolean.class, value)); return true; case "registryenabled": case "RegistryEnabled": target.setRegistryEnabled(property(camelContext, java.lang.Boolean.class, value)); return true; case "routesenabled": case "RoutesEnabled": target.setRoutesEnabled(property(camelContext, java.lang.Boolean.class, value)); return true; default: return false; } } @Override public Map<String, Object> getAllOptions(Object target) { return ALL_OPTIONS; } public static void clearBootstrapConfigurers() { ALL_OPTIONS.clear(); } public static void clearConfigurers() { ALL_OPTIONS.clear(); } @Override public Object getOptionValue(Object obj, String name, boolean ignoreCase) { org.apache.camel.main.HealthConfigurationProperties target = (org.apache.camel.main.HealthConfigurationProperties) obj; switch (ignoreCase ? name.toLowerCase() : name) { case "config": case "Config": return target.getConfig(); case "contextenabled": case "ContextEnabled": return target.getContextEnabled(); case "enabled": case "Enabled": return target.getEnabled(); case "registryenabled": case "RegistryEnabled": return target.getRegistryEnabled(); case "routesenabled": case "RoutesEnabled": return target.getRoutesEnabled(); default: return null; } } @Override public Object getCollectionValueType(Object target, String name, boolean ignoreCase) { switch (ignoreCase ? name.toLowerCase() : name) { case "config": case "Config": return org.apache.camel.main.HealthCheckConfigurationProperties.class; default: return null; } } }
[ "claus.ibsen@gmail.com" ]
claus.ibsen@gmail.com
0302b94473e7b0a7a06db5243637f91e2647983a
bc794d54ef1311d95d0c479962eb506180873375
/gmao/gmao-dao/dao-ifaces/src/main/java/com/teratech/gmao/dao/ifaces/base/EntrepotDAORemote.java
e6dc63911745f196e6e1b61030226b10136ec428
[]
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
251
java
package com.teratech.gmao.dao.ifaces.base; import javax.ejb.Remote; /** * Interface remote de la DAO * @since Fri Jul 13 14:45:36 GMT+01:00 2018 * */ @Remote public interface EntrepotDAORemote extends EntrepotDAO { }
[ "bekondo_dieu@yahoo.fr" ]
bekondo_dieu@yahoo.fr
cb03d29173c2c057c3fa5b4656356a97e3587953
6fef7045d88e4d368db62c9e8e1998c9f114cab2
/src/main/java/org/liuzhugu/javastudy/course/ruyuanconcurrent/pipeline/TerminationToken.java
ef7044d8e84978d87454713facc5d0f2150c91e5
[]
no_license
liuzhugu/study
02a7a104b31507858dc8f91c1e852f6bbc83a68f
22f3fadf08b2c0a881a701a09e31c77b6907f113
refs/heads/master
2023-08-30T09:29:27.410391
2023-08-29T22:35:49
2023-08-29T22:35:49
151,524,422
0
0
null
2022-12-16T09:44:31
2018-10-04T05:47:49
Java
UTF-8
Java
false
false
1,934
java
package org.liuzhugu.javastudy.course.ruyuanconcurrent.pipeline; import org.liuzhugu.javastudy.course.ruyuanconcurrent.twostagetermination.Termination; import java.lang.ref.WeakReference; import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.atomic.AtomicInteger; /** * Description:线程停止标志 **/ public class TerminationToken { /** * 通过volatile来修饰,无锁的请求下当数据修改后其他线程可以读取到,是否停止标志 */ protected volatile boolean toShutdowm = false; /** * 未执行的任务的数量 * */ public final AtomicInteger reservations = new AtomicInteger(0); /** * 当多个线程共享一个TerminationToken实例时 通过队列的方式来记录所有的停止线程 * 减少锁的方式来实现 * */ private final Queue<WeakReference<Termination>> coordinatedThreads; public TerminationToken() { this.coordinatedThreads = new ConcurrentLinkedQueue<>(); } /** * 是否终止 * */ public boolean isToShutdowm() { return toShutdowm; } public void setToShutdowm(boolean toShutdowm) { this.toShutdowm = toShutdowm; } /** * 注册一个线程到TerminationToken上 * */ public void register(Termination thread) { coordinatedThreads.add(new WeakReference<>(thread)); } /** * 通知TerminationToken中所有实例 有一个线程停止了 通知其他线程也停止 * */ public void notifyThreadTermination(Termination thread) { WeakReference<Termination> wrThread; Termination otherThread; while ((wrThread = coordinatedThreads.poll()) != null) { otherThread = wrThread.get(); if (otherThread != null && otherThread != thread) { otherThread.terminate(); } } } }
[ "987685625@qq.com" ]
987685625@qq.com
1dd00a1ea1402b3dbeb7d25f97e2630e8dbed006
eb9c3dac0dca0ecd184df14b1fda62e61cc8c7d7
/google/ads/googleads/v6/googleads-java/gapic-googleads-java/src/test/java/com/google/ads/googleads/v6/services/FeedPlaceholderViewServiceClientTest.java
0dc4286328308750e4b648e17a40622db715d75c
[ "Apache-2.0" ]
permissive
Tryweirder/googleapis-gen
2e5daf46574c3af3d448f1177eaebe809100c346
45d8e9377379f9d1d4e166e80415a8c1737f284d
refs/heads/master
2023-04-05T06:30:04.726589
2021-04-13T23:35:20
2021-04-13T23:35:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,146
java
/* * Copyright 2021 Google LLC * * 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 com.google.ads.googleads.v6.services; import com.google.ads.googleads.v6.resources.FeedPlaceholderView; import com.google.ads.googleads.v6.resources.FeedPlaceholderViewName; import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.grpc.GaxGrpcProperties; import com.google.api.gax.grpc.testing.LocalChannelProvider; import com.google.api.gax.grpc.testing.MockGrpcService; import com.google.api.gax.grpc.testing.MockServiceHelper; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.InvalidArgumentException; import com.google.protobuf.AbstractMessage; import io.grpc.StatusRuntimeException; import java.io.IOException; import java.util.Arrays; import java.util.List; import java.util.UUID; import javax.annotation.Generated; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; @Generated("by gapic-generator-java") public class FeedPlaceholderViewServiceClientTest { private static MockServiceHelper mockServiceHelper; private static MockFeedPlaceholderViewService mockFeedPlaceholderViewService; private FeedPlaceholderViewServiceClient client; private LocalChannelProvider channelProvider; @BeforeClass public static void startStaticServer() { mockFeedPlaceholderViewService = new MockFeedPlaceholderViewService(); mockServiceHelper = new MockServiceHelper( UUID.randomUUID().toString(), Arrays.<MockGrpcService>asList(mockFeedPlaceholderViewService)); mockServiceHelper.start(); } @AfterClass public static void stopServer() { mockServiceHelper.stop(); } @Before public void setUp() throws IOException { mockServiceHelper.reset(); channelProvider = mockServiceHelper.createChannelProvider(); FeedPlaceholderViewServiceSettings settings = FeedPlaceholderViewServiceSettings.newBuilder() .setTransportChannelProvider(channelProvider) .setCredentialsProvider(NoCredentialsProvider.create()) .build(); client = FeedPlaceholderViewServiceClient.create(settings); } @After public void tearDown() throws Exception { client.close(); } @Test public void getFeedPlaceholderViewTest() throws Exception { FeedPlaceholderView expectedResponse = FeedPlaceholderView.newBuilder() .setResourceName( FeedPlaceholderViewName.of("[CUSTOMER_ID]", "[PLACEHOLDER_TYPE]").toString()) .build(); mockFeedPlaceholderViewService.addResponse(expectedResponse); FeedPlaceholderViewName resourceName = FeedPlaceholderViewName.of("[CUSTOMER_ID]", "[PLACEHOLDER_TYPE]"); FeedPlaceholderView actualResponse = client.getFeedPlaceholderView(resourceName); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockFeedPlaceholderViewService.getRequests(); Assert.assertEquals(1, actualRequests.size()); GetFeedPlaceholderViewRequest actualRequest = ((GetFeedPlaceholderViewRequest) actualRequests.get(0)); Assert.assertEquals(resourceName.toString(), actualRequest.getResourceName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } @Test public void getFeedPlaceholderViewExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockFeedPlaceholderViewService.addException(exception); try { FeedPlaceholderViewName resourceName = FeedPlaceholderViewName.of("[CUSTOMER_ID]", "[PLACEHOLDER_TYPE]"); client.getFeedPlaceholderView(resourceName); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. } } @Test public void getFeedPlaceholderViewTest2() throws Exception { FeedPlaceholderView expectedResponse = FeedPlaceholderView.newBuilder() .setResourceName( FeedPlaceholderViewName.of("[CUSTOMER_ID]", "[PLACEHOLDER_TYPE]").toString()) .build(); mockFeedPlaceholderViewService.addResponse(expectedResponse); String resourceName = "resourceName-384566343"; FeedPlaceholderView actualResponse = client.getFeedPlaceholderView(resourceName); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockFeedPlaceholderViewService.getRequests(); Assert.assertEquals(1, actualRequests.size()); GetFeedPlaceholderViewRequest actualRequest = ((GetFeedPlaceholderViewRequest) actualRequests.get(0)); Assert.assertEquals(resourceName, actualRequest.getResourceName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } @Test public void getFeedPlaceholderViewExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockFeedPlaceholderViewService.addException(exception); try { String resourceName = "resourceName-384566343"; client.getFeedPlaceholderView(resourceName); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. } } }
[ "bazel-bot-development[bot]@users.noreply.github.com" ]
bazel-bot-development[bot]@users.noreply.github.com
e9dc6f6e2b77890af822f3f297b0fd067479ddba
772d00094f3c86fd5b0dfdff5986ce73cb4f6ada
/src/com/Sts/Framework/MVC/GcFileSystemProvider.java
6d65e0a668e2a683bf7bd4ade4b60311414f1b0d
[]
no_license
tlasseter/gcs
52ccfe32c836caca3c53daf0387e0d64a2b6f140
7538bb2272c4a3caee43be212f3e8a7ccf091b43
refs/heads/master
2021-03-27T20:47:48.844053
2014-09-25T18:58:31
2014-09-25T18:58:31
24,471,103
0
0
null
null
null
null
UTF-8
Java
false
false
1,861
java
package com.Sts.Framework.MVC; /** * Copyright: Copyright (c) 2012 * Author: Tom Lasseter * Date: 5/19/12 */ public class GcFileSystemProvider // extends FileSystemProvider { /* public abstract String getScheme(); public abstract FileSystem newFileSystem(URI uri, Map<String,?> env) throws IOException; public abstract FileSystem getFileSystem(URI uri); public abstract Path getPath(URI uri); public abstract SeekableByteChannel newByteChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IOException; public abstract SeekableByteChannel newByteChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IOException; public abstract DirectoryStream<Path> newDirectoryStream(Path dir, DirectoryStream.Filter<? super Path> filter) throws IOException; public abstract void createDirectory(Path dir, FileAttribute<?>... attrs) throws IOException; public abstract void delete(Path path) throws IOException; public abstract void copy(Path source, Path target, CopyOption... options) throws IOException; public abstract void move(Path source, Path target, CopyOption... options) throws IOException; public abstract boolean isSameFile(Path path, Path path2) throws IOException; public abstract boolean isHidden(Path path) throws IOException; public abstract FileStore getFileStore(Path path) throws IOException; public abstract void checkAccess(Path path, AccessMode... modes) throws IOException; public abstract <V extends FileAttributeView> V getFileAttributeView(Path path, Class<V> type, LinkOption... options); public abstract <A extends BasicFileAttributes> A readAttributes(Path path, Class<A> type, LinkOption... options) throws IOException; public abstract Map<String,Object> readAttributes(Path path, String attributes, LinkOption... options) throws IOException; */ }
[ "t.lasseter@comcast.net" ]
t.lasseter@comcast.net
66bcaeb03fbab4811a76dfc95146a1fafca73b4b
97ec5c1dd1e6d9f6ed8380e55d985382d0543ad4
/ch8_4/src/main/java/cn/txx/ch8_4/service/impl/DemoServiceImpl.java
8caa677689a10588f7879689fcf3b310d7487281
[]
no_license
tianxx7/spring_boot_action
421e1deba7f0a0e0312cdae4f9152583cb0a84d9
8da78a4a2a145b4573c945f4c87f485a6ebe36de
refs/heads/master
2022-12-23T10:05:55.390893
2019-09-08T04:26:16
2019-09-08T04:26:16
193,212,567
0
0
null
2022-12-16T09:59:20
2019-06-22T08:51:51
Java
UTF-8
Java
false
false
1,083
java
package cn.txx.ch8_4.service.impl; import cn.txx.ch8_4.dao.PersonRepository; import cn.txx.ch8_4.domain.Person; import cn.txx.ch8_4.service.DemoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @Service public class DemoServiceImpl implements DemoService { @Autowired PersonRepository personRepository; //1 @Transactional(rollbackFor={IllegalArgumentException.class}) //2 public Person savePersonWithRollBack(Person person){ Person p =personRepository.save(person); if(person.getName().equals("汪云飞")){ throw new IllegalArgumentException("汪云飞已存在,数据将回滚"); //3 } return p; } @Transactional(noRollbackFor={IllegalArgumentException.class}) //4 public Person savePersonWithoutRollBack(Person person){ Person p =personRepository.save(person); if(person.getName().equals("汪云飞")){ throw new IllegalArgumentException("汪云飞虽已存在,数据将不会回滚"); } return p; } }
[ "1729549607@qq.com" ]
1729549607@qq.com
a3960733b0e8fec95f9e127c95b8ff1f765f4308
bc0f99c36dd89530e49347b519c399608be10955
/tianfang/tianfang-business/src/main/java/com/tianfang/business/dao/AlbumPicDao.java
9405761d6197e033022ca05412a143b1c14ed7cb
[]
no_license
jamyin/ken-tianfang
7eed073fe715c8f171362664c26a29fe65c95778
f35f6b61cfba6cdf85a3274cb06682babe5667f5
refs/heads/master
2016-09-14T00:55:59.958381
2016-03-31T03:39:55
2016-03-31T03:39:55
56,197,030
0
1
null
null
null
null
UTF-8
Java
false
false
7,099
java
package com.tianfang.business.dao; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import lombok.Getter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import com.google.common.base.Objects; import com.tianfang.business.dto.AlbumPictureDto; import com.tianfang.business.mapper.SportAlbumPicExMapper; import com.tianfang.business.mapper.SportAlbumPictureMapper; import com.tianfang.business.pojo.SportAlbumPicture; import com.tianfang.business.pojo.SportAlbumPictureExample; import com.tianfang.business.pojo.SportAlbumPictureExample.Criteria; import com.tianfang.common.constants.DataStatus; import com.tianfang.common.model.PageQuery; import com.tianfang.common.mybatis.MyBatisBaseDao; import com.tianfang.common.util.StringUtils; @Repository public class AlbumPicDao extends MyBatisBaseDao<SportAlbumPicture>{ @Autowired @Getter private SportAlbumPictureMapper mapper; @Autowired @Getter private SportAlbumPicExMapper mapperEx; /* @Autowired @Getter private SportAlbumPictureMapper mappers;*/ /** * 球队首页相册轮播显示 * @author YIn * @time:2015年11月14日 下午3:33:33 */ /*public List<SportAlbumPicture> selectAlbumbyTeamId(String teamId) { SportAlbumPictureExample example = new SportAlbumPictureExample(); SportAlbumPictureExample.Criteria criteria = example.createCriteria(); criteria.andTeamIdEqualTo(teamId); example.setOrderByClause("create_time desc limit "); return mappers.selectByExample(example); }*/ /** * @author YIn * @time:2015年11月14日 下午1:51:38 */ public List<AlbumPictureDto> selectAlbumPicbyTeamId(SportAlbumPicture sportAlbumPicture, PageQuery page) { /* SportAlbumPictureExample example = new SportAlbumPictureExample(); SportAlbumPictureExample.Criteria criteria = example.createCriteria(); criteria.andStatEqualTo(1); //criteria.andTeamIdEqualTo(teamId); long starNum = page.getStartNum(); int pageSize = page.getPageSize(); example.setOrderByClause("create_time desc limit " + starNum + ", " + pageSize); return mapper.selectByExample(example);*/ return mapperEx.selectAlbumPicByPage(sportAlbumPicture, page); } /** * @author YIn * @param string * @time:2015年11月14日 下午1:52:24 */ public long selectAllAlbumPic(SportAlbumPicture sportAlbumPicture) { /*SportAlbumPictureExample example = new SportAlbumPictureExample(); SportAlbumPictureExample.Criteria criteria = example.createCriteria(); return mapper.countByExample(example);*/ return mapperEx.selectAlbumPicByPageCount(sportAlbumPicture); } /** * @author YIn * @time:2015年11月14日 下午6:01:11 */ public SportAlbumPicture selectAlbumPicById(String teamId) { SportAlbumPictureExample example = new SportAlbumPictureExample(); SportAlbumPictureExample.Criteria criteria = example.createCriteria(); criteria.andAlbumIdEqualTo(teamId); criteria.andStatEqualTo(DataStatus.ENABLED); return mapper.selectByPrimaryKey(teamId); } public List<SportAlbumPicture> findAlbumPicById(String id) { SportAlbumPictureExample example = new SportAlbumPictureExample(); SportAlbumPictureExample.Criteria criteria = example.createCriteria(); criteria.andAlbumIdEqualTo(id); criteria.andStatEqualTo(DataStatus.ENABLED); return mapper.selectByExample(example); } public List<SportAlbumPicture> findTeamAlbumPic(AlbumPictureDto albumPictureDto) { SportAlbumPictureExample example = new SportAlbumPictureExample(); Criteria criteria = example.createCriteria(); if(!StringUtils.isEmpty(albumPictureDto.getTeamId())){ criteria.andTeamIdEqualTo(albumPictureDto.getTeamId()); } if(!StringUtils.isEmpty(albumPictureDto.getAlbumId())){ criteria.andAlbumIdEqualTo(albumPictureDto.getAlbumId()); } if(albumPictureDto.getPicType()!=null){ criteria.andPicTypeEqualTo(albumPictureDto.getPicType()); } if(albumPictureDto.getPicStatus()!=null){ criteria.andPicStatusEqualTo(albumPictureDto.getPicStatus()); } criteria.andStatEqualTo(DataStatus.ENABLED); if(!Objects.equal(albumPictureDto.getLimit(),null)){ example.setOrderByClause("create_time desc limit " + albumPictureDto.getLimit()); } return mapper.selectByExample(example); } public List<SportAlbumPicture> findByPage(AlbumPictureDto albumPictureDto,PageQuery page) { SportAlbumPictureExample example = new SportAlbumPictureExample(); example = queryBySql(albumPictureDto); example.setOrderByClause(" create_time desc limit " + page.getStartNum() + ", " + page.getPageSize()); List<SportAlbumPicture> list = mapper.selectByExample(example); return list; } public long count(AlbumPictureDto albumPictureDto) { SportAlbumPictureExample example = new SportAlbumPictureExample(); example = queryBySql(albumPictureDto); return mapper.countByExample(example); } public SportAlbumPictureExample queryBySql(AlbumPictureDto albumPictureDto){ SportAlbumPictureExample example = new SportAlbumPictureExample(); Criteria criteria = example.createCriteria(); if(!StringUtils.isEmpty(albumPictureDto.getAlbumId())){ criteria.andAlbumIdEqualTo(albumPictureDto.getAlbumId()); } if(!StringUtils.isEmpty(albumPictureDto.getTeamId())){ criteria.andTeamIdEqualTo(albumPictureDto.getTeamId()); } if(!StringUtils.isEmpty(albumPictureDto.getUserId())){ criteria.andUserIdEqualTo(albumPictureDto.getUserId()); } if(!StringUtils.isEmpty(albumPictureDto.getId())){ criteria.andIdEqualTo(albumPictureDto.getId()); } if(albumPictureDto.getPicStatus()!=null){ criteria.andPicStatusEqualTo(albumPictureDto.getPicStatus()); } if(albumPictureDto.getPicType()!=null){ criteria.andPicTypeEqualTo(albumPictureDto.getPicType()); } criteria.andStatEqualTo(DataStatus.ENABLED); return example; } public void insertPictures(AlbumPictureDto albumPicDto) { List<String> pictures = new ArrayList<String>(); if(albumPicDto.getPictureList()!=null){ pictures = Arrays.asList(albumPicDto.getPictureList()); } albumPicDto.setStat(DataStatus.ENABLED); mapperEx.insertPictures(albumPicDto,pictures); } public void updateAlbumPicList(String albumId) { // TODO Auto-generated method stub mapperEx.updateAlbumPicList(albumId); } public List<SportAlbumPicture> findTeamAlbumPicByRand( AlbumPictureDto albumPictureDto) { // TODO Auto-generated method stub return mapperEx.findTeamAlbumPicByRand(albumPictureDto); } public SportAlbumPicture getAlbumPicByDto(AlbumPictureDto albumPicDto) { SportAlbumPictureExample example = new SportAlbumPictureExample(); example = queryBySql(albumPicDto); List<SportAlbumPicture> list = mapper.selectByExample(example); if(list!=null && list.size()>0){ return list.get(0); }else{ return null; } } }
[ "mark_chu@ssic.cn" ]
mark_chu@ssic.cn
86ca300edb2cb9fbcd85ab2a96e1e3782041d412
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/neo4j--neo4j/0dee00b16d4210b0e4e66673d51b443472a026b8/after/PhysicalTransactionAppender.java
417011c7ad7e872d2dc7f5a69e388762067f3cf4
[]
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
4,800
java
/** * Copyright (c) 2002-2014 "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.kernel.impl.transaction.xaframework; import java.io.IOException; import java.util.concurrent.Future; import org.neo4j.helpers.FutureAdapter; public class PhysicalTransactionAppender implements TransactionAppender { private final WritableLogChannel channel; private final TxIdGenerator txIdGenerator; private final LogEntryWriter logEntryWriter; private final LogPositionCache positionCache; public PhysicalTransactionAppender( WritableLogChannel channel, TxIdGenerator txIdGenerator, LogPositionCache positionCache ) { this.channel = channel; this.txIdGenerator = txIdGenerator; this.positionCache = positionCache; this.logEntryWriter = new LogEntryWriterv1( channel, new CommandSerializer( channel ) ); } @Override public synchronized Future<Long> append( TransactionRepresentation transaction ) throws IOException { // Write start record LogPosition logPosition = channel.getCurrentPosition(); logEntryWriter.writeStartEntry( transaction.getMasterId(), transaction.getAuthorId(), transaction.getTimeWritten(), transaction.getLatestCommittedTxWhenStarted(), transaction.additionalHeader() ); // Write all the commands to the log channel logEntryWriter.serialize(transaction); // Write commit record long transactionId = txIdGenerator.generate( transaction ); logEntryWriter.writeCommitEntry( transaction.getTimeWritten(), transactionId ); positionCache.putStartPosition( transactionId, logPosition ); // force channel.force(); return FutureAdapter.present( transactionId ); } @Override public void close() throws IOException { channel.close(); } // private class PhysicalLogWriterSPI implements LogHandler.SPI // { // private ForceMode forceMode; // private long nextTxId; // // @Override // public LogBuffer getWriteBuffer() // { // return writeBuffer; // } // // @Override // public void commitTransactionWithoutTxId( LogEntry.Start startEntry ) throws IOException // { // if ( startEntry == null ) // { // throw new IOException( "Unable to find start entry" ); // } // try // { // injectedTxValidator.assertInjectionAllowed( startEntry.getLastCommittedTxWhenTransactionStarted() ); // } // catch ( XAException e ) // { // throw new IOException( e ); // } // // LogEntry.OnePhaseCommit commit = new LogEntry.OnePhaseCommit( // startEntry.getIdentifier(), nextTxId, System.currentTimeMillis() ); // // logEntryWriter.writeLogEntry( commit, writeBuffer ); // // need to manually force since xaRm.commit will not do it (transaction marked as recovered) // forceMode.force( writeBuffer ); // Xid xid = startEntry.getXid(); // try // { // XaTransaction xaTx = xaRm.getXaTransaction( xid ); // xaTx.setCommitTxId( nextTxId ); // positionCache.cacheStartPosition( nextTxId, startEntry, logVersion ); // xaRm.commit( xid, true ); // LogEntry doneEntry = new LogEntry.Done( startEntry.getIdentifier() ); // logEntryWriter.writeLogEntry( doneEntry, writeBuffer ); // xidIdentMap.remove( startEntry.getIdentifier() ); // recoveredTxMap.remove( startEntry.getIdentifier() ); // } // catch ( XAException e ) // { // throw new IOException( e ); // } // } // // public void bind( ForceMode forceMode, long nextTxId ) // { // this.forceMode = forceMode; // this.nextTxId = nextTxId; // } // } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
4452961be91e4d954f32b9bb16b17113b86bf5da
c26745ff46f5b42a849736d862e443d7cb734253
/src/test/java/io/toolisticon/byoct/jpa/associationoverrideprocessor/AssociationOverrideProcessorTest.java
a2c74060bde7275fba4087da92f467b19d974813
[ "MIT" ]
permissive
toolisticon/byoct-jpa
2b3862e913bd4b5ee20635e2eeb14e41e89d68d8
97d55714f1af895fc527312cdc44fd587f7cc1b0
refs/heads/master
2023-06-23T17:02:31.949661
2019-05-08T23:14:32
2019-05-08T23:14:32
117,159,054
1
0
MIT
2023-06-10T07:23:59
2018-01-11T22:04:39
Java
UTF-8
Java
false
false
4,939
java
package io.toolisticon.byoct.jpa.associationoverrideprocessor; import io.toolisticon.annotationprocessortoolkit.testhelper.AbstractAnnotationProcessorIntegrationTest; import io.toolisticon.annotationprocessortoolkit.testhelper.integrationtest.AnnotationProcessorIntegrationTestConfiguration; import io.toolisticon.annotationprocessortoolkit.testhelper.integrationtest.AnnotationProcessorIntegrationTestConfigurationBuilder; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.Ignore; import java.util.Arrays; import java.util.List; /** * Tests of {@link AssociationOverrideProcessor}. */ @RunWith(Parameterized.class) public class AssociationOverrideProcessorTest extends AbstractAnnotationProcessorIntegrationTest<AssociationOverrideProcessor> { public AssociationOverrideProcessorTest(String description, AnnotationProcessorIntegrationTestConfiguration configuration) { super(configuration); } @Before public void init() { AssociationOverrideProcessorMessages.setPrintMessageCodes(true); } @Override protected AssociationOverrideProcessor getAnnotationProcessor() { return new AssociationOverrideProcessor(); } @Parameterized.Parameters(name = "{index}: \"{0}\"") public static List<Object[]> data() { return Arrays.asList(new Object[][]{ // -------------------------------------------------------------- // -- type : testinterface // -------------------------------------------------------------- { "Test valid usage", AnnotationProcessorIntegrationTestConfigurationBuilder .createTestConfig() .setSourceFileToCompile("testcases/associationoverrideprocessor/type/testinterface/TestcaseValidUsage.java") .compilationShouldSucceed() .build() }, // -------------------------------------------------------------- // -- type : testenum // -------------------------------------------------------------- { "Test valid usage", AnnotationProcessorIntegrationTestConfigurationBuilder .createTestConfig() .setSourceFileToCompile("testcases/associationoverrideprocessor/type/testenum/TestcaseValidUsage.java") .compilationShouldSucceed() .build() }, // -------------------------------------------------------------- // -- type : testclass // -------------------------------------------------------------- { "Test valid usage", AnnotationProcessorIntegrationTestConfigurationBuilder .createTestConfig() .setSourceFileToCompile("testcases/associationoverrideprocessor/type/testclass/TestcaseValidUsage.java") .compilationShouldSucceed() .build() }, // -------------------------------------------------------------- // -- method : testmethod // -------------------------------------------------------------- { "Test valid usage", AnnotationProcessorIntegrationTestConfigurationBuilder .createTestConfig() .setSourceFileToCompile("testcases/associationoverrideprocessor/method/testmethod/TestcaseValidUsage.java") .compilationShouldSucceed() .build() }, // -------------------------------------------------------------- // -- field : testfield // -------------------------------------------------------------- { "Test valid usage", AnnotationProcessorIntegrationTestConfigurationBuilder .createTestConfig() .setSourceFileToCompile("testcases/associationoverrideprocessor/field/testfield/TestcaseValidUsage.java") .compilationShouldSucceed() .build() }, }); } @Test @Ignore public void testCorrectnessOfAdviceArgumentAnnotation() { super.test(); } }
[ "tobias.stamann@holisticon.de" ]
tobias.stamann@holisticon.de
7a0f6ff750c6febfd4af59d46ab0627ea9d2448f
8a135ca3f5eb37520774209cbe37244dbaf0e268
/core/src/main/java/com/gengoai/io/resource/URLResource.java
3dd72ba9a296e3e48f2c7e391a92c0034526761b
[ "Apache-2.0" ]
permissive
gengoai/mango
511ccb5cd69ee7930996277c400e6a6c26dafd73
c9f427bb74c2dc60813dd5a9c4f66cc2562dc69f
refs/heads/master
2021-06-12T13:42:31.298020
2020-07-31T16:45:11
2020-07-31T16:45:11
128,667,584
0
0
null
null
null
null
UTF-8
Java
false
false
6,072
java
/* * (c) 2005 David B. Bracewell * * 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 com.gengoai.io.resource; import com.gengoai.io.FileUtils; import com.gengoai.io.QuietIO; import com.gengoai.stream.MStream; import com.gengoai.stream.StreamingContext; import com.gengoai.string.Strings; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.MalformedURLException; import java.net.URI; import java.net.URL; import java.net.URLConnection; import java.util.Arrays; import java.util.List; import java.util.Objects; import java.util.Optional; /** * <p> A <code>Resource</code> wrapper for a URL. </p> * * @author David B. Bracewell */ public class URLResource extends BaseResource { private static final long serialVersionUID = -5874490341557934277L; private URL url; private String userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36"; private int connectionTimeOut = 30000; /** * Instantiates a new uRL resource. * * @param url the url * @throws MalformedURLException the malformed url exception */ public URLResource(String url) throws MalformedURLException { this.url = new URL(url); } public URLResource(URL url) { this.url = url; } @Override public boolean equals(Object o) { if(this == o) return true; if(!(o instanceof URLResource)) return false; URLResource that = (URLResource) o; return connectionTimeOut == that.connectionTimeOut && Objects.equals(url, that.url) && Objects.equals(userAgent, that.userAgent); } @Override public int hashCode() { return Objects.hash(url, userAgent, connectionTimeOut); } @Override public String descriptor() { return url.toString(); } @Override public Optional<File> asFile() { if(url.getProtocol().equalsIgnoreCase("file")) { return Optional.of(new File(url.getFile())); } return super.asFile(); } @Override public Optional<URI> asURI() { return Optional.of(URI.create(url.toString())); } @Override public String path() { return url.getPath(); } @Override public String baseName() { return url.getFile(); } @Override public Optional<URL> asURL() { return Optional.of(url); } @Override public Resource getChild(String relativePath) { try { return new URLResource(new URL(url, relativePath)); } catch(MalformedURLException e) { return EmptyResource.INSTANCE; } } @Override public Resource getParent() { try { return new URLResource(FileUtils.parent(url.toString())); } catch(MalformedURLException e) { return EmptyResource.INSTANCE; } } @Override public Resource append(String content) throws IOException { throw new UnsupportedOperationException("URLResource does not support appending"); } @Override public Resource append(byte[] byteArray) throws IOException { throw new UnsupportedOperationException("URLResource does not support appending"); } @Override public boolean exists() { boolean exists = true; InputStream is = null; try { URLConnection connection = createConnection(); connection.setConnectTimeout(5 * 1000); is = connection.getInputStream(); } catch(Exception e) { exists = false; } finally { QuietIO.closeQuietly(is); } return exists; } @Override public List<String> readLines() throws IOException { return Arrays.asList(readToString().split("\\r?\\n")); } @Override public MStream<String> lines() throws IOException { return StreamingContext.local().stream(readLines()); } @Override public InputStream createInputStream() throws IOException { return createConnection().getInputStream(); } private URLConnection createConnection() throws IOException { URLConnection connection = url.openConnection(); if(!Strings.isNullOrBlank(userAgent)) { connection.setRequestProperty("User-Agent", userAgent); } connection.setConnectTimeout(connectionTimeOut); return connection; } @Override public OutputStream createOutputStream() throws IOException { return createConnection().getOutputStream(); } /** * @return The user agent string to pass along to the web server */ public String getUserAgent() { return userAgent; } /** * Sets The user agent string to pass along to the web server * * @param userAgent the user agent */ public void setUserAgent(String userAgent) { this.userAgent = userAgent; } /** * @return the amount of time to wait in connecting to the host before giving up */ public int getConnectionTimeOut() { return connectionTimeOut; } /** * Sets the amount of time to wait in connecting to the host before giving up * * @param connectionTimeOut The connectionTimeOut */ public void setConnectionTimeOut(int connectionTimeOut) { this.connectionTimeOut = connectionTimeOut; } }//END OF URLResource
[ "david@davidbracewell.com" ]
david@davidbracewell.com
4bd22ef1a3153cc2ec89d112131a93eab1759a44
c885ef92397be9d54b87741f01557f61d3f794f3
/results/Lang-5/org.apache.commons.lang3.LocaleUtils/BBC-F0-opt-50/tests/18/org/apache/commons/lang3/LocaleUtils_ESTest_scaffolding.java
f45aba9e34e6dd538242e4ea4fb7876ea0057f3b
[ "CC-BY-4.0", "MIT" ]
permissive
pderakhshanfar/EMSE-BBC-experiment
f60ac5f7664dd9a85f755a00a57ec12c7551e8c6
fea1a92c2e7ba7080b8529e2052259c9b697bbda
refs/heads/main
2022-11-25T00:39:58.983828
2022-04-12T16:04:26
2022-04-12T16:04:26
309,335,889
0
1
null
2021-11-05T11:18:43
2020-11-02T10:30:38
null
UTF-8
Java
false
false
3,307
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Thu Oct 21 02:44:48 GMT 2021 */ package org.apache.commons.lang3; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; import org.evosuite.runtime.sandbox.Sandbox; import org.evosuite.runtime.sandbox.Sandbox.SandboxMode; @EvoSuiteClassExclude public class LocaleUtils_ESTest_scaffolding { @org.junit.Rule public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule(); private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000); @BeforeClass public static void initEvoSuiteFramework() { org.evosuite.runtime.RuntimeSettings.className = "org.apache.commons.lang3.LocaleUtils"; org.evosuite.runtime.GuiSupport.initialize(); org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100; org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED; org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT(); org.evosuite.runtime.classhandling.JDKClassResetter.init(); setSystemProperties(); initializeClasses(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); } @Before public void initTestCase(){ threadStopper.storeCurrentThreads(); threadStopper.startRecordingTime(); org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler(); org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode(); org.evosuite.runtime.GuiSupport.setHeadless(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); org.evosuite.runtime.agent.InstrumentingAgent.activate(); } @After public void doneWithTestCase(){ threadStopper.killAndJoinClientThreads(); org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks(); org.evosuite.runtime.classhandling.JDKClassResetter.reset(); resetClasses(); org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode(); org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); } public static void setSystemProperties() { /*No java.lang.System property to set*/ } private static void initializeClasses() { org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(LocaleUtils_ESTest_scaffolding.class.getClassLoader() , "org.apache.commons.lang3.LocaleUtils", "org.apache.commons.lang3.LocaleUtils$SyncAvoid" ); } private static void resetClasses() { org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(LocaleUtils_ESTest_scaffolding.class.getClassLoader()); org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses( "org.apache.commons.lang3.LocaleUtils", "org.apache.commons.lang3.LocaleUtils$SyncAvoid" ); } }
[ "pderakhshanfar@serg2.ewi.tudelft.nl" ]
pderakhshanfar@serg2.ewi.tudelft.nl
3ec9abc5a119ad655677b786f5d43cd184a7c366
2edbc7267d9a2431ee3b58fc19c4ec4eef900655
/AL-Game/data/scripts/system/handlers/ai/instance/steelRake/GoldenEyeMantutuAI2.java
3716bc32286cf0d6248ff92ed10e373af073b8aa
[]
no_license
EmuZONE/Aion-Lightning-5.1
3c93b8bc5e63fd9205446c52be9b324193695089
f4cfc45f6aa66dfbfdaa6c0f140b1861bdcd13c5
refs/heads/master
2020-03-08T14:38:42.579437
2018-04-06T04:18:19
2018-04-06T04:18:19
128,191,634
1
1
null
null
null
null
UTF-8
Java
false
false
5,408
java
/* * This file is part of Encom. **ENCOM FUCK OTHER SVN** * * Encom is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Encom 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 Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with Encom. If not, see <http://www.gnu.org/licenses/>. */ package ai.instance.steelRake; import ai.AggressiveNpcAI2; import com.aionemu.commons.utils.Rnd; import com.aionemu.gameserver.ai2.AIName; import com.aionemu.gameserver.ai2.AIState; import com.aionemu.gameserver.ai2.AISubState; import com.aionemu.gameserver.ai2.manager.AttackManager; import com.aionemu.gameserver.ai2.manager.EmoteManager; import com.aionemu.gameserver.model.EmotionType; import com.aionemu.gameserver.model.actions.NpcActions; import com.aionemu.gameserver.model.gameobjects.Creature; import com.aionemu.gameserver.model.gameobjects.Npc; import com.aionemu.gameserver.model.gameobjects.VisibleObject; import com.aionemu.gameserver.network.aion.serverpackets.SM_EMOTION; import com.aionemu.gameserver.skillengine.SkillEngine; import com.aionemu.gameserver.utils.PacketSendUtility; import com.aionemu.gameserver.utils.ThreadPoolManager; import java.util.concurrent.Future; import java.util.concurrent.atomic.AtomicBoolean; /****/ /** Author Rinzler (Encom) /****/ @AIName("goldeneyemantutu") public class GoldenEyeMantutuAI2 extends AggressiveNpcAI2 { private Future<?> hungerTask; private boolean canThink = true; private AtomicBoolean isHome = new AtomicBoolean(true); @Override public boolean canThink() { return canThink; } @Override protected void handleCustomEvent(int eventId, Object... args) { if (eventId == 1 && args != null) { canThink = false; getMoveController().abortMove(); EmoteManager.emoteStopAttacking(getOwner()); Npc npc = (Npc) args[0]; getOwner().setTarget(npc); setStateIfNot(AIState.FOLLOWING); getMoveController().moveToTargetObject(); getOwner().setState(1); PacketSendUtility.broadcastPacket(getOwner(), new SM_EMOTION(getOwner(), EmotionType.START_EMOTE2, 0, getObjectId())); } } @Override protected void handleMoveArrived() { super.handleMoveArrived(); if (!canThink) { VisibleObject target = getTarget(); getMoveController().abortMove(); if (target != null && target.isSpawned() && target instanceof Npc) { Npc npc = (Npc) target; int npcId = npc.getNpcId(); if (npcId == 281128 || npcId == 281129) { startFeedTime(npc); } } } } private void startFeedTime(final Npc npc) { ThreadPoolManager.getInstance().schedule(new Runnable() { @Override public void run() { if (!isAlreadyDead() && npc != null) { switch (npc.getNpcId()) { case 281128: //Feed Supply Device. getEffectController().removeEffect(20489); spawn(701386, 716.508f, 508.571f, 939.607f, (byte) 119); break; case 281129: //Water Supply Device. spawn(701387, 716.389f, 494.207f, 939.607f, (byte) 119); getEffectController().removeEffect(20490); break; } NpcActions.delete(npc); canThink = true; Creature creature = getAggroList().getMostHated(); if (creature == null || creature.getLifeStats().isAlreadyDead() || !getOwner().canSee(creature)) { setStateIfNot(AIState.FIGHT); think(); } else { getOwner().setTarget(creature); getOwner().getGameStats().renewLastAttackTime(); getOwner().getGameStats().renewLastAttackedTime(); getOwner().getGameStats().renewLastChangeTargetTime(); getOwner().getGameStats().renewLastSkillTime(); setStateIfNot(AIState.FIGHT); handleMoveValidate(); } } } }, 6000); } @Override protected void handleAttack(Creature creature) { super.handleAttack(creature); if (isHome.compareAndSet(true, false)) { doSchedule(); } } @Override protected void handleDespawned() { cancelHungerTask(); super.handleDespawned(); } @Override protected void handleDied() { cancelHungerTask(); Npc npc = getPosition().getWorldMapInstance().getNpc(215079); if (npc != null && !NpcActions.isAlreadyDead(npc)) { npc.getEffectController().removeEffect(18189); } super.handleDied(); } @Override protected void handleBackHome() { cancelHungerTask(); getEffectController().removeEffect(20489); getEffectController().removeEffect(20490); canThink = true; isHome.set(true); super.handleBackHome(); } private void doSchedule() { hungerTask = ThreadPoolManager.getInstance().scheduleAtFixedRate(new Runnable() { @Override public void run() { int rnd = Rnd.get(1, 2); int skill = 0; switch (rnd) { case 1: skill = 20489; //Hunger. break; case 2: skill = 20490; //Thirst. break; } SkillEngine.getInstance().getSkill(getOwner(), skill, 20, getOwner()).useNoAnimationSkill(); } }, 10000, 30000); } private void cancelHungerTask() { if (hungerTask != null && !hungerTask.isDone()) { hungerTask.cancel(true); } } }
[ "naxdevil@gmail.com" ]
naxdevil@gmail.com
b33567838b23799e78d898085298e05553a4598a
e27942cce249f7d62b7dc8c9b86cd40391c1ddd4
/modules/ads_lib/src/test/java/com/google/api/ads/adwords/lib/utils/v201708/AwqlReportRequestTest.java
117971704b572dc0f3e67c8f648d54ef2807d79a
[ "Apache-2.0" ]
permissive
mo4ss/googleads-java-lib
b4b6178747d25d16ae6aa0c80d80ee18a2dfe01a
efaa9c3bd8a46a3ed4b00963dc9760c6dd8bd641
refs/heads/master
2022-12-05T00:30:56.740813
2022-11-16T10:47:15
2022-11-16T10:47:15
108,132,394
0
0
Apache-2.0
2022-11-16T10:47:16
2017-10-24T13:41:43
Java
UTF-8
Java
false
false
2,123
java
// Copyright 2017 Google Inc. 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.google.api.ads.adwords.lib.utils.v201708; import static org.junit.Assert.assertEquals; import com.google.api.ads.adwords.lib.jaxb.v201708.DownloadFormat; import com.google.api.ads.adwords.lib.utils.ReportRequest.RequestType; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; /** * Tests for {@link AwqlReportRequest}. */ @RunWith(JUnit4.class) public class AwqlReportRequestTest { @Rule public ExpectedException thrown = ExpectedException.none(); /** * @throws java.lang.Exception */ @Before public void setUp() throws Exception {} @Test public void testConstructor_nullArgs_fails() { thrown.expect(NullPointerException.class); thrown.expectMessage("query"); new AwqlReportRequest(null, null); } @Test public void testConstructor_nullQuery_fails() { thrown.expect(NullPointerException.class); thrown.expectMessage("query"); new AwqlReportRequest(null, DownloadFormat.CSV); } @Test public void testConstructor_nullFormat_fails() { thrown.expect(NullPointerException.class); thrown.expectMessage("download format"); new AwqlReportRequest("SELECT foo, bar", null); } @Test public void testGetRequestType() { AwqlReportRequest request = new AwqlReportRequest("SELECT foo, bar", DownloadFormat.CSV); assertEquals("Incorrect request type", RequestType.AWQL, request.getRequestType()); } }
[ "jradcliff@users.noreply.github.com" ]
jradcliff@users.noreply.github.com
31614611c0ecebdf147bac3d5cefd588ea5a77fa
9132b69a6cd253a5314f1cb5a718cf486a665785
/src/org/jgroups/logging/Slf4jLogImpl.java
f18c0e4966b46ff8e661ab3e836227ff7bcf04cc
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
linuxfreakus/JGroups
bd4137be9ae142135aac7f0df166fdf71a0609ab
488dc7733ac2b09d85896b630e5ae96dc02c14b5
refs/heads/master
2020-04-02T01:19:02.012963
2018-10-10T19:05:41
2018-10-11T05:54:13
153,849,313
0
0
Apache-2.0
2018-10-19T22:44:31
2018-10-19T22:44:31
null
UTF-8
Java
false
false
4,820
java
package org.jgroups.logging; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.LinkedHashMap; import java.util.Locale; import java.util.Map; import java.util.function.Function; /** * Logger that delivers messages to a SLF4J logger * * @author Konstantin Gusarov * @since 4.0.0 */ public class Slf4jLogImpl implements Log { private static final Map<Function<Logger, Boolean>, String> LEVELS = new LinkedHashMap<>(); private static final Locale LOCALE = new Locale(System.getProperty("user.language"), System.getProperty("user.country")); static { LEVELS.put(Logger::isErrorEnabled, "ERROR"); LEVELS.put(Logger::isWarnEnabled, "WARN"); LEVELS.put(Logger::isInfoEnabled, "INFO"); LEVELS.put(Logger::isDebugEnabled, "DEBUG"); LEVELS.put(Logger::isTraceEnabled, "TRACE"); } private final Logger logger; private final Locale locale; public Slf4jLogImpl(final Class<?> clazz) { this(LOCALE, LoggerFactory.getLogger(clazz)); } public Slf4jLogImpl(final String category) { this(LOCALE, LoggerFactory.getLogger(category)); } public Slf4jLogImpl(final Locale locale, final Logger logger) { this.logger = logger; this.locale = locale; } @Override public boolean isFatalEnabled() { return logger.isErrorEnabled(); } @Override public boolean isErrorEnabled() { return logger.isErrorEnabled(); } @Override public boolean isWarnEnabled() { return logger.isWarnEnabled(); } @Override public boolean isInfoEnabled() { return logger.isInfoEnabled(); } @Override public boolean isDebugEnabled() { return logger.isDebugEnabled(); } @Override public boolean isTraceEnabled() { return logger.isTraceEnabled(); } @Override public void fatal(final String msg) { logger.error(msg); } @Override public void fatal(final String msg, final Object... args) { final String formatted = String.format(locale, msg, args); logger.error(formatted); } @Override public void fatal(final String msg, final Throwable throwable) { logger.error(msg, throwable); } @Override public void error(final String msg) { logger.error(msg); } @Override public void error(final String format, final Object... args) { final String formatted = String.format(locale, format, args); logger.error(formatted); } @Override public void error(final String msg, final Throwable throwable) { logger.error(msg, throwable); } @Override public void warn(final String msg) { logger.warn(msg); } @Override public void warn(final String msg, final Object... args) { final String formatted = String.format(locale, msg, args); logger.warn(formatted); } @Override public void warn(final String msg, final Throwable throwable) { logger.warn(msg, throwable); } @Override public void info(final String msg) { logger.info(msg); } @Override public void info(final String msg, final Object... args) { final String formatted = String.format(locale, msg, args); logger.info(formatted); } @Override public void debug(final String msg) { logger.debug(msg); } @Override public void debug(final String msg, final Object... args) { final String formatted = String.format(locale, msg, args); logger.debug(formatted); } @Override public void debug(final String msg, final Throwable throwable) { logger.debug(msg, throwable); } @Override public void trace(final Object msg) { logger.trace("{}", msg); } @Override public void trace(final String msg) { logger.trace(msg); } @Override public void trace(final String msg, final Object... args) { final String formatted = String.format(locale, msg, args); logger.trace(formatted); } @Override public void trace(final String msg, final Throwable throwable) { logger.trace(msg, throwable); } @Override public void setLevel(final String level) { throw new UnsupportedOperationException(); } @Override public String getLevel() { String result = "NONE"; for (final Map.Entry<Function<Logger, Boolean>, String> entry : LEVELS.entrySet()) { if (entry.getKey().apply(logger)) { result = entry.getValue(); } else { break; } } return result; } }
[ "belaban@yahoo.com" ]
belaban@yahoo.com
b81ee90e217ea8c6a39cd53f5040527cdaff8963
37992a7083efea148c66381a2e7c988f59de712b
/cppk/app/src/main/java/ru/ppr/cppk/sync/kpp/model/AdditionalInfoForEtt.java
67da1dc68fc04346b4f367533b898ae2d894b3fe
[]
no_license
RVC3/PTK
5ab897d6abee1f7f7be3ba49c893b97e719085e9
1052b2bfa8f565c96a85d5c5928ed6c938a20543
refs/heads/master
2022-12-22T22:11:40.231298
2020-07-01T09:45:38
2020-07-01T09:45:38
259,278,530
0
0
null
null
null
null
UTF-8
Java
false
false
993
java
package ru.ppr.cppk.sync.kpp.model; import java.util.Date; /** * Доп. параметры для ЭТТ * * @author Grigoriy Kashka */ public class AdditionalInfoForEtt { /** * Шифр категории льготника */ public String PassengerCategory; /** * Дата выдачи ЭТТ */ public Date IssueDataTime; /** * Код подразделения (билетного бюро), выдавшего ТТ */ public String IssueUnitCode; /** * Код организации в штате которой состоит работник */ public String OwnerOrganizationCode; /** * Фамилия, инициалы пассажира */ public String PassengerFio; /** * Фамилия, инициалы работника РЖД, на чьем иждивении находится пассажир */ public String GuardianFio; public String SNILS; }
[ "kopanevartem@mail.ru" ]
kopanevartem@mail.ru
87f96ef8cf4f07e9057393d14159a5e64fd6ac39
b2250fe43f39a8dbc47d3743e04e661c520d2b98
/app/src/main/java/Camera2/src/com/android/camera/device/SingleDeviceActions.java
ede1d1dafdcc86f9dee8d0f5a1ac471919dd16a5
[]
no_license
liuzhao1006/apps
0e9c7148e922d457cef166b1670489b5a61aa972
835bf07121f9b121fd3c35ebc921c2f2963fff55
refs/heads/master
2020-08-17T12:45:17.541141
2019-10-17T00:25:00
2019-10-17T00:25:00
215,668,597
0
0
null
null
null
null
UTF-8
Java
false
false
1,651
java
/* * Copyright (C) 2015 The Android Open Source Project * * 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 Camera2.src.com.android.camera.device; import com.android.camera.async.Lifetime; /** * Device specific actions for opening and closing a device. */ public interface SingleDeviceActions<TDevice> { /** * Open the device represented by this instance. This should only * be called if there is a reasonable expectation that the device is * available and openable. * * It is possible for this to throw if there is a problem with the * parameters or if the camera device determined to be un-openable. */ public void executeOpen(SingleDeviceOpenListener<TDevice> openListener, Lifetime deviceLifetime) throws UnsupportedOperationException; /** * Close the device represented by this instance. * * It is possible for this to throw if there is a problem with the * parameters used to create these actions. */ public void executeClose(SingleDeviceCloseListener closeListener, TDevice device) throws UnsupportedOperationException; }
[ "zhaoliu1006@gmail.com" ]
zhaoliu1006@gmail.com
5b5bd0446dd2ff2f4ba0da5a2efeda835c800eb5
1708f73319c7de31d5c25f9050538399625f6271
/src/main/java/cn/qnxx/modules/admin/quartz/QuartzDemo.java
ea54bdffbca5839232b1da365323394ef591824d
[]
no_license
weilengdeyu/qnb
fc05c7af2e770a82842e5739b895bda1557e1485
f10c08e3fd371b123a95c2348ff053b5a773bf94
refs/heads/master
2022-06-22T20:46:11.359720
2019-06-22T03:50:35
2019-06-22T03:50:38
193,187,726
0
0
null
2022-06-21T01:19:40
2019-06-22T03:45:19
CSS
UTF-8
Java
false
false
1,485
java
package cn.qnxx.modules.admin.quartz; import cn.qnxx.modules.admin.entity.SalesPm; import cn.qnxx.modules.admin.service.ISalesPmService; import cn.qnxx.modules.admin.service.impl.WebSocketServer; import cn.qnxx.modules.admin.util.R; import com.alibaba.fastjson.JSON; import org.quartz.Job; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; import org.springframework.beans.factory.annotation.Autowired; import java.io.IOException; import java.util.*; /** * 定义任务类 */ public class QuartzDemo implements Job { @Autowired private ISalesPmService salesPmService; /** * 任务被触发时所执行的方法 */ public void execute(JobExecutionContext arg0) throws JobExecutionException { //System.out.println("Execute...."+new Date()); Map<String, Object> datamap=new HashMap<String,Object>(); datamap.put("date","2013-10-20"); List<SalesPm> list = salesPmService.selectList(datamap); //销售平台集合 List<String> dateList=new ArrayList<String>(); //销量集合 List<Integer> numList=new ArrayList<Integer>(); for (SalesPm item:list) { dateList.add(item.getName()); numList.add(item.getNum()); } Map<String,Object> map=new TreeMap<String,Object>(); map.put("datelist",dateList); // map.put("numlist",numList); // R r= R.success("sales",map); try { String result = JSON.toJSONString(r); WebSocketServer.sendInfo(result, "33"); } catch (IOException e) { e.printStackTrace(); } } }
[ "yymqqc@126.com" ]
yymqqc@126.com
60e32c2b377d742ceddba1835c990c19503c251f
23947e89b6b6aca3a60d2c6c8603600d5fd10d16
/sketchlet-designer/src/main/java/net/sf/sketchlet/designer/editor/tool/LineTool.java
1cab73ab8cedea5ce62273d0cec71ecf7cc97e6d
[]
no_license
zeljkoobrenovic/sketchlet
68051886c9ad7b285f6edc442b0229211e03d119
933e7872f1e0dea58ac9d70cca2cc7c21e7c3fbd
refs/heads/master
2016-09-06T04:36:47.049616
2012-12-30T09:13:36
2012-12-30T09:13:36
6,383,313
2
0
null
null
null
null
UTF-8
Java
false
false
1,244
java
package net.sf.sketchlet.designer.editor.tool; import net.sf.sketchlet.common.translation.Language; import net.sf.sketchlet.designer.Workspace; import net.sf.sketchlet.framework.model.log.ActivityLog; import javax.swing.*; import java.awt.*; /** * @author zobrenovic */ public class LineTool extends ShapeTool { public LineTool(ToolInterface toolInterface) { super(toolInterface, new String[]{"stroke type", "stroke width", "anitaliasing", "fill patterns"}); } @Override public void draw(Graphics2D g2, int x, int y, int w, int h) { g2.drawLine(x1, y1, x2, y2); } @Override public ImageIcon getIcon() { return Workspace.createImageIcon("resources/line_1.png"); } @Override public String getIconFileName() { return "line_1.png"; } @Override public String getName() { return Language.translate("Line"); } @Override public boolean checkDimensions() { return true; } @Override public void mouseReleased(int x, int y, int modifiers) { super.mouseReleased(x, y, modifiers); ActivityLog.log("toolResult", "Draw a line in " + toolInterface.getName(), "line_1.png", toolInterface.getPanel()); } }
[ "obren@acm.org" ]
obren@acm.org
5ca7be9af5e7b08e8f248d09a2341b6f61ce9986
4709463257b97bd346882f595faf61b348c753ac
/awt/dnd/DropTargetAdapter.java
0631b92fc0cf4a6655ea1458da94c3cfc1543e81
[]
no_license
xiaodaguan/java_1_8_025
796f1168b0f47d4d66cef7fc1259f8a360cc5cc8
b779328e08f11eddd25cb560d997c1f866b7d531
refs/heads/master
2020-12-30T15:42:20.078667
2017-05-13T10:47:57
2017-05-13T10:47:57
91,167,508
0
0
null
null
null
null
UTF-8
Java
false
false
579
java
package java.awt.dnd; public abstract class DropTargetAdapter implements DropTargetListener { public void dragEnter(DropTargetDragEvent paramDropTargetDragEvent) {} public void dragOver(DropTargetDragEvent paramDropTargetDragEvent) {} public void dropActionChanged(DropTargetDragEvent paramDropTargetDragEvent) {} public void dragExit(DropTargetEvent paramDropTargetEvent) {} } /* Location: /Users/guanxiaoda/Documents/workspace/rt.jar!/java/awt/dnd/DropTargetAdapter.class * Java compiler version: 8 (52.0) * JD-Core Version: 0.7.1 */
[ "xiaodaguan@gmail.com" ]
xiaodaguan@gmail.com
eb43ff14d67f17628bf67808b5908059bbee76bb
d36d5ba4d8d1df1ad4494c94bd39252e128c5b5b
/com.jaspersoft.studio/src/com/jaspersoft/studio/data/designer/QueryDesigner.java
98082d8b64c465ec6a7d83d5f8be0feded4595eb
[]
no_license
xviakoh/jaspersoft-xvia-plugin
6dfca36eb27612f136edc4c206e631d8dd8470f0
c037a0568a518e858a201fda257a8fa416af3908
refs/heads/master
2021-01-01T19:35:32.905460
2015-06-18T15:21:11
2015-06-18T15:21:11
37,666,261
0
0
null
null
null
null
UTF-8
Java
false
false
4,654
java
/******************************************************************************* * Copyright (C) 2005 - 2014 TIBCO Software Inc. All rights reserved. http://www.jaspersoft.com. * * Unless you have purchased a commercial license agreement from Jaspersoft, the following license terms apply: * * This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html ******************************************************************************/ package com.jaspersoft.studio.data.designer; import net.sf.jasperreports.engine.JRDataset; import net.sf.jasperreports.engine.design.JRDesignQuery; import net.sf.jasperreports.engine.design.JasperDesign; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.StyledText; import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import com.jaspersoft.studio.data.DataAdapterDescriptor; import com.jaspersoft.studio.data.fields.IFieldsProvider; import com.jaspersoft.studio.messages.Messages; import com.jaspersoft.studio.preferences.fonts.utils.FontUtils; import com.jaspersoft.studio.utils.Misc; import com.jaspersoft.studio.utils.jasper.JasperReportsConfiguration; import com.jaspersoft.studio.wizards.ContextHelpIDs; public class QueryDesigner extends AQueryDesigner { private boolean refresh = false; public final class QueryListener implements ModifyListener { public void modifyText(ModifyEvent e) { doSourceTextChanged(); } } protected void doSourceTextChanged() { if (!refresh) { refresh = true; if (jDataset != null && jDataset.getQuery() != null) ((JRDesignQuery) jDataset.getQuery()).setText(Misc.nvl(getQueryFromWidget())); refresh = false; } } protected StyledText control; private Composite tbCompo; private Button btn; protected UndoRedoImpl undoHandlrer; public QueryDesigner() { } /* * (non-Javadoc) * * @see com.jaspersoft.studio.data.IQueryDesigner#getControl() */ public Control getControl() { return control; } public Control getToolbarControl() { return tbCompo; } public Control createControl(Composite parent) { control = new StyledText(parent, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER); control.addModifyListener(new QueryListener()); setupSourceEditorFont(); undoHandlrer = new UndoRedoImpl(control); return control; } protected void setupSourceEditorFont() { control.setFont(FontUtils.getEditorsFont(jConfig)); } /* * (non-Javadoc) * * @see com.jaspersoft.studio.data.IQueryDesigner#setQuery(java.lang.String) */ public void setQuery(JasperDesign jDesign, JRDataset jDataset, JasperReportsConfiguration jConfig) { super.setQuery(jDesign, jDataset, jConfig); refresh = true; updateQueryText(jDataset.getQuery().getText()); if (undoHandlrer != null) undoHandlrer.clearStack(); refresh = false; } protected void updateQueryText(String txt) { control.setText(txt); } protected String getQueryFromWidget() { return control.getText(); } public void dispose() { } public Control createToolbar(Composite parent) { if (parent != null) { tbCompo = new Composite(parent, SWT.NONE); tbCompo.setBackgroundMode(SWT.INHERIT_FORCE); GridLayout layout = new GridLayout(1, false); layout.marginHeight = 0; layout.marginWidth = 0; tbCompo.setLayout(layout); tbCompo.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); btn = new Button(tbCompo, SWT.PUSH); btn.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, true, false)); btn.setText(Messages.QueryDesigner_readFieldsButton); btn.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { container.doGetFields(); } }); setFieldProviderEnabled(true); } return tbCompo; } public void setDataAdapter(DataAdapterDescriptor da) { boolean enable = (da instanceof IFieldsProvider && ((IFieldsProvider) da).supportsGetFieldsOperation(container.getjConfig())); setFieldProviderEnabled(enable); } protected void setFieldProviderEnabled(boolean enable) { if (btn != null) btn.setEnabled(enable); } @Override public String getContextHelpId() { return ContextHelpIDs.WIZARD_QUERY_DIALOG; } }
[ "kyungseog.oh@trackvia.com" ]
kyungseog.oh@trackvia.com
91448ead34e1fa4df516789314b1d2589691daa6
8bba923942604359185cfceffc680b006efb9306
/DatabasesFrameworksHibernate/wedding-planner/src/main/java/weddingplanner/weddingplanner/services/api/PeopleService.java
e3501d21f2467c435dafc3508b1045cb760c8556
[]
no_license
KaPrimov/JavaCoursesSoftUni
d8a48ab30421d7a847f35d970535ddc3da595597
9676ec4c9bc1ece13d64880ff47a3728227bf4c9
refs/heads/master
2022-12-04T13:27:47.249203
2022-07-14T14:44:10
2022-07-14T14:44:10
97,306,295
1
2
null
2022-11-24T09:28:28
2017-07-15T09:39:47
Java
UTF-8
Java
false
false
206
java
package weddingplanner.weddingplanner.services.api; import weddingplanner.weddingplanner.dto.binding.json.AddPersonDto; public interface PeopleService { void addPeople(AddPersonDto[] personDtos); }
[ "k.primov92@gmail.com" ]
k.primov92@gmail.com
1f68ea79ef49612e187215332a7608788fe8b329
e82c1473b49df5114f0332c14781d677f88f363f
/MED-CLOUD/med-core/src/main/java/nta/med/core/domain/phr/PhrStandardFoodTotalFat.java
11fb1c51c1d849d8a9ff569bbfc1889dd29aebe1
[]
no_license
zhiji6/mih
fa1d2279388976c901dc90762bc0b5c30a2325fc
2714d15853162a492db7ea8b953d5b863c3a8000
refs/heads/master
2023-08-16T18:35:19.836018
2017-12-28T09:33:19
2017-12-28T09:33:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,391
java
package nta.med.core.domain.phr; import java.io.Serializable; import javax.persistence.*; import java.math.BigDecimal; import java.sql.Timestamp; import java.math.BigInteger; /** * The persistent class for the phr_standard_food_total_fat database table. * */ @Entity @Table(name="PHR_STANDARD_FOOD_TOTAL_FAT") @NamedQuery(name="PhrStandardFoodTotalFat.findAll", query="SELECT p FROM PhrStandardFoodTotalFat p") public class PhrStandardFoodTotalFat extends PhrBaseEntity implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "ID", unique = true, nullable = false) private Long id; @Column(name="EATING_TIME") private Timestamp eatingTime; @Column(name="NOTE") private String note; @Column(name="PROFILE_ID") private Long profileId; @Column(name="RATING") private Long rating; @Column(name="SOURCE") private String source; @Column(name="SYNC_ID") private BigInteger syncId; @Column(name="SYS_ID") private String sysId; @Column(name="TOTAL_FAT") private BigDecimal totalFat; @Column(name="UPD_ID") private String updId; public PhrStandardFoodTotalFat() { } public Long getId() { return this.id; } public void setId(Long id) { this.id = id; } public Timestamp getEatingTime() { return eatingTime; } public void setEatingTime(Timestamp eatingTime) { this.eatingTime = eatingTime; } public String getNote() { return note; } public void setNote(String note) { this.note = note; } public Long getProfileId() { return profileId; } public void setProfileId(Long profileId) { this.profileId = profileId; } public Long getRating() { return rating; } public void setRating(Long rating) { this.rating = rating; } public String getSource() { return source; } public void setSource(String source) { this.source = source; } public BigInteger getSyncId() { return syncId; } public void setSyncId(BigInteger syncId) { this.syncId = syncId; } public String getSysId() { return sysId; } public void setSysId(String sysId) { this.sysId = sysId; } public BigDecimal getTotalFat() { return totalFat; } public void setTotalFat(BigDecimal totalFat) { this.totalFat = totalFat; } public String getUpdId() { return updId; } public void setUpdId(String updId) { this.updId = updId; } }
[ "duc_nt@nittsusystem-vn.com" ]
duc_nt@nittsusystem-vn.com
15000f500e29ee027618f2e4935d4ac9e240911c
96be46745d445cdb3b3bbad6ce5b32dda53927a6
/trackviewer/src/main/GeoPos.java
bf1e7f13cfb5ee9b1946f2e4c4f063dc3e5852e0
[]
no_license
wahello/trackviewer
21c04d343c2da112607d0e6c4fe7cf82b149bc96
6c25bc563b10847c40868148a81ec3d6b581c0b7
refs/heads/master
2021-05-27T03:09:09.950141
2013-02-02T11:01:37
2013-02-02T11:01:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,865
java
package main; import java.util.List; import common.GeoUtils; /** * Code to find the distance in metres between a lat/lng point and a polyline of * lat/lng points All in WGS84. Free for any use. * @author Bill Chadwick (2007) */ public class GeoPos { private double x, y, z; private double lat, lon; /** * Construct a GeoPos from its latitude and longitude in degrees * @param lat latitude in degrees * @param lon longitude in degrees */ public GeoPos(double lat, double lon) { double theta = (lon * Math.PI / 180.0); double rlat = geocentricLatitude(lat * Math.PI / 180.0); double c = Math.cos(rlat); this.lat = lat; this.lon = lon; this.x = c * Math.cos(theta); this.y = c * Math.sin(theta); this.z = Math.sin(rlat); } /** * @return the latitude in degrees */ public double lat() { return lat; } /** * @return the longitude in degrees */ public double lng() { return lon; } /** * Convert from geographic to geocentric latitude (radians). * @param geographicLatitude the geographic latitude * @return the geocentric latitude in radians */ private double geocentricLatitude(double geographicLatitude) { double flattening = GeoUtils.WGS84_EARTH_FLATTENING; double f = (1.0 - flattening) * (1.0 - flattening); return Math.atan((Math.tan(geographicLatitude) * f)); } // /** // * Convert from geocentric to geographic latitude (radians) // * @param geocentricLatitude the geocentric Latitude // * @return the geographic latitude in radians // */ // private static double geographicLatitude(double geocentricLatitude) // { // double flattening = 1.0 / earthFlattening; // double f = (1.0 - flattening) * (1.0 - flattening); // return Math.atan(Math.tan(geocentricLatitude) / f); // } /** * Returns the two antipodal points of intersection of two great circles * defined by the arcs geo1 to geo2 and geo3 to geo4. Returns a point as a * {@link GeoPos}, use .antipode to get the other point * @param geo1 start of first arc * @param geo2 end of first arc * @param geo3 start of second arc * @param geo4 end of second arc * @return the intersection point (and its antipode) */ private static GeoPos getIntersection(GeoPos geo1, GeoPos geo2, GeoPos geo3, GeoPos geo4) { GeoPos geoCross1 = geo1.crossNormalize(geo2); GeoPos geoCross2 = geo3.crossNormalize(geo4); return geoCross1.crossNormalize(geoCross2); } private static double radiansToMeters(double rad) { return rad * GeoUtils.WGS84_MEAN_RADIUS; } // private static double metersToRadians(double m) // { // return m / earthRadius; // } // private double getLatitudeRadians() // { // return (bdccGeoGeographicLatitude(Math.atan2(this.z, Math.sqrt((this.x * this.x) + (this.y * this.y))))); // } // // private double getLongitudeRadians() // { // return (Math.atan2(this.y, this.x)); // } private double dot(GeoPos b) { return ((this.x * b.x) + (this.y * b.y) + (this.z * b.z)); } private double crossLength(GeoPos b) { double x = (this.y * b.z) - (this.z * b.y); double y = (this.z * b.x) - (this.x * b.z); double z = (this.x * b.y) - (this.y * b.x); return Math.sqrt((x * x) + (y * y) + (z * z)); } private GeoPos scale(double s) { GeoPos r = new GeoPos(0, 0); r.x = this.x * s; r.y = this.y * s; r.z = this.z * s; return r; } private GeoPos crossNormalize(GeoPos b) { double x = (this.y * b.z) - (this.z * b.y); double y = (this.z * b.x) - (this.x * b.z); double z = (this.x * b.y) - (this.y * b.x); double L = Math.sqrt((x * x) + (y * y) + (z * z)); GeoPos r = new GeoPos(0, 0); r.x = x / L; r.y = y / L; r.z = z / L; return r; } /** * @return Point on opposite side of the world to this point */ private GeoPos antipode() { return this.scale(-1.0); } /** * Distance in radians from this point to point v2 * @param v2 the other point * @return the distance in radians */ private double distance(GeoPos v2) { return Math.atan2(v2.crossLength(this), v2.dot(this)); } /** * Returns in meters the minimum of the perpendicular distance of this point * from the line segment geo1-geo2 and the distance from this point to the * line segment ends in geo1 and geo2 * @param geo1 start of the line segment * @param geo2 end of the line segment * @return the distance in meters */ private double distanceToLineSegMtrs(GeoPos geo1, GeoPos geo2) { //point on unit sphere above origin and normal to plane of geo1,geo2 //could be either side of the plane GeoPos p2 = geo1.crossNormalize(geo2); // intersection of GC normal to geo1/geo2 passing through p with GC geo1/geo2 GeoPos ip = getIntersection(geo1, geo2, this, p2); //need to check that ip or its antipode is between p1 and p2 double d = geo1.distance(geo2); double d1p = geo1.distance(ip); double d2p = geo2.distance(ip); //window.status = d + ", " + d1p + ", " + d2p; if ((d >= d1p) && (d >= d2p)) return radiansToMeters(this.distance(ip)); else { ip = ip.antipode(); d1p = geo1.distance(ip); d2p = geo2.distance(ip); } if ((d >= d1p) && (d >= d2p)) return radiansToMeters(this.distance(ip)); else return radiansToMeters(Math.min(geo1.distance(this), geo2.distance(this))); } /** * Distance in meters from point to a polyline * @param poly the polyline * @param point the point * @return the distance in meters */ public static double distanceToPolyMtrs(List<GeoPos> poly, GeoPos point) { double d = Double.MAX_VALUE; int i; GeoPos p = new GeoPos(point.lat(), point.lng()); for (i = 0; i < (poly.size() - 1); i++) { GeoPos p1 = poly.get(i); GeoPos l1 = new GeoPos(p1.lat(), p1.lng()); GeoPos p2 = poly.get(i + 1); GeoPos l2 = new GeoPos(p2.lat(), p2.lng()); double dp = p.distanceToLineSegMtrs(l1, l2); if (dp < d) d = dp; } return d; } }
[ "git@martin-steiger.de" ]
git@martin-steiger.de
b07dcb79109b519f19a9ff04320ace91dcd6b9c9
f65df16ef266aa17e3fec6e6b172f7f32ec4ddc6
/2.JavaCore/src/com/javarush/task/task14/task1408/RussianHen.java
a45b41ffe2f9b4909bb8b09a3e55c61912b03d16
[]
no_license
Andrei-Rom/JavaRushTasks
56f5e4ad920f689667453ba9a0fb8f94a5c84bb7
e631d5dd824051809d3b142b2711a0651a2a837b
refs/heads/master
2020-06-11T11:18:31.500589
2019-08-10T19:38:33
2019-08-10T19:38:33
193,941,708
0
0
null
null
null
null
UTF-8
Java
false
false
405
java
package com.javarush.task.task14.task1408; public class RussianHen extends Hen implements Country{ @Override public int getCountOfEggsPerMonth() { return 0; } @Override public String getDescription() { return String.format("%s Моя страна - %s. Я несу %s яиц в месяц.", super.getDescription(), Country.RUSSIA, getCountOfEggsPerMonth()); } }
[ "andrisrom@gmail.com" ]
andrisrom@gmail.com
96f496b6ad7da6ee4ec5dc0cf8da0229d25c37ed
c54ab7d7d7e0161af315d7cbae669b4c52029951
/springcore/src/main/java/com/techchefs/springcore/beans/DepartmentInfoBean.java
3209f78f6ce4e8f95a5a89312217123d4d0d23a2
[]
no_license
deekshitr/ELF-06June19-TechChefs-DeekshitR
82c6796ad0ec142896e17971f2d9fd73aeb0d1c4
5296cbdddb89b3ef4a529f04f6aba500d474a327
refs/heads/master
2023-01-13T12:33:11.550703
2019-08-22T14:33:09
2019-08-22T14:33:09
192,527,129
0
0
null
2023-01-04T06:58:16
2019-06-18T11:31:00
Rich Text Format
UTF-8
Java
false
false
369
java
package com.techchefs.springcore.beans; public class DepartmentInfoBean { private int deptId; private String deptName; public int getDeptId() { return deptId; } public void setDeptId(int deptId) { this.deptId = deptId; } public String getDeptName() { return deptName; } public void setDeptName(String deptName) { this.deptName = deptName; } }
[ "deekshitr456@gmai.com" ]
deekshitr456@gmai.com
0a0eb15052ac043e939db9ca16da6aaf494a4b2e
5a26b745dcbe99e7bbce9b61ba0004aaed0762d4
/app/src/main/java/com/yingzhiyun/yingquxue/OkBean/AliveBeaginBean.java
1f6317280552911cabe26c58b1bc78ff4ce478f1
[]
no_license
moxun/Yingzhiyun
c7a41c78f7d0b57e16b733944f246da0516c5fc0
ca5d62f26d885c057ae502715e9de78f2154e58c
refs/heads/master
2022-09-06T21:07:57.926039
2020-06-03T08:58:06
2020-06-03T08:58:06
269,038,272
0
0
null
null
null
null
UTF-8
Java
false
false
4,143
java
package com.yingzhiyun.yingquxue.OkBean; public class AliveBeaginBean { /** * status : 200 * hint : null * result : {"isFollow":true,"effective":"2020年4月15日 10:00-12:00","teacherId":1,"teacherName":"R楠","playerUrl":"null","teacherHead":"http://192.168.0.120/yzyFiles//userHead/0de88590-df13-4a2f-b884-0b5224a91ac5-1567062269600.JPG","subject":"语文","courseImg":"http://192.168.0.120/yzyFiles/icons/3d058f74-90cb-4768-ae93-e6bc308580b31578714814099.png","teacherLabel":null,"title":"直播课程测试1"} */ private int status; private Object hint; private ResultBean result; public int getStatus() { return status; } public void setStatus(int status) { this.status = status; } public Object getHint() { return hint; } public void setHint(Object hint) { this.hint = hint; } public ResultBean getResult() { return result; } public void setResult(ResultBean result) { this.result = result; } public static class ResultBean { /** * isFollow : true * effective : 2020年4月15日 10:00-12:00 * teacherId : 1 * teacherName : R楠 * playerUrl : null * teacherHead : http://192.168.0.120/yzyFiles//userHead/0de88590-df13-4a2f-b884-0b5224a91ac5-1567062269600.JPG * subject : 语文 * courseImg : http://192.168.0.120/yzyFiles/icons/3d058f74-90cb-4768-ae93-e6bc308580b31578714814099.png * teacherLabel : null * title : 直播课程测试1 */ private boolean isFollow; private String effective; private int teacherId; private String teacherName; private String playerUrl; private String teacherHead; private String subject; private String courseImg; private Object teacherLabel; private String title; private String roomId; public boolean isFollow() { return isFollow; } public void setFollow(boolean follow) { isFollow = follow; } public String getRoomId() { return roomId; } public void setRoomId(String roomId) { this.roomId = roomId; } public boolean getIsFollow() { return isFollow; } public void setIsFollow(boolean isFollow) { this.isFollow = isFollow; } public String getEffective() { return effective; } public void setEffective(String effective) { this.effective = effective; } public int getTeacherId() { return teacherId; } public void setTeacherId(int teacherId) { this.teacherId = teacherId; } public String getTeacherName() { return teacherName; } public void setTeacherName(String teacherName) { this.teacherName = teacherName; } public String getPlayerUrl() { return playerUrl; } public void setPlayerUrl(String playerUrl) { this.playerUrl = playerUrl; } public String getTeacherHead() { return teacherHead; } public void setTeacherHead(String teacherHead) { this.teacherHead = teacherHead; } public String getSubject() { return subject; } public void setSubject(String subject) { this.subject = subject; } public String getCourseImg() { return courseImg; } public void setCourseImg(String courseImg) { this.courseImg = courseImg; } public Object getTeacherLabel() { return teacherLabel; } public void setTeacherLabel(Object teacherLabel) { this.teacherLabel = teacherLabel; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } } }
[ "2636216883@qq.com" ]
2636216883@qq.com
c3aed24aabab72382a710147d93611932b6562e8
3da6f1593ae3c0d6fd0bef0f81825a6dcb4f562b
/spring-tx/src/main/java/org/springframework/transaction/TransactionUsageException.java
91c4478ff858976f408c2089d06f87b8a39930d7
[ "Apache-2.0" ]
permissive
binfooo/spring
c784f3b49717bb65c6bdf0eb8db08f3f36852006
a1f1a3e6f0a7a26641fe5f925aae76a2d32e566c
refs/heads/master
2023-02-23T12:11:02.335887
2021-01-30T01:54:25
2021-01-30T01:54:25
334,065,384
1
0
null
null
null
null
UTF-8
Java
false
false
693
java
package org.springframework.transaction; /** * Superclass for exceptions caused by inappropriate usage of * a Spring transaction API. * * @author Rod Johnson * @since 22.03.2003 */ @SuppressWarnings("serial") public class TransactionUsageException extends TransactionException { /** * Constructor for TransactionUsageException. * @param msg the detail message */ public TransactionUsageException(String msg) { super(msg); } /** * Constructor for TransactionUsageException. * @param msg the detail message * @param cause the root cause from the transaction API in use */ public TransactionUsageException(String msg, Throwable cause) { super(msg, cause); } }
[ "LinHJ090827" ]
LinHJ090827
ee55ef62148c340f2695f342b97c0656a48166d0
716c59e3a3705271fd9963139614fa78931e3704
/src/test/java/com/fasterxml/jackson/dataformat/smile/TestSmileGeneratorBinary.java
d5830e9b4a8caca00c40cdb2be77f37cb2fe498c
[]
no_license
mtyurt/jackson-dataformat-smile
742dfd57582d86e32ed3b4870b2a65158e66c24a
11653e37e38b3c4520f935a107c6fcc6ceff7f7b
refs/heads/master
2021-01-18T12:45:52.408564
2013-01-14T21:26:25
2013-01-14T21:26:25
6,022,737
1
0
null
null
null
null
UTF-8
Java
false
false
3,200
java
package com.fasterxml.jackson.dataformat.smile; import java.io.*; import org.junit.Assert; import com.fasterxml.jackson.core.*; public class TestSmileGeneratorBinary extends SmileTestBase { static class ThrottledInputStream extends FilterInputStream { protected final int _maxBytes; public ThrottledInputStream(byte[] data, int maxBytes) { this(new ByteArrayInputStream(data), maxBytes); } public ThrottledInputStream(InputStream in, int maxBytes) { super(in); _maxBytes = maxBytes; } @Override public int read(byte[] buf) throws IOException { return read(buf, 0, buf.length); } @Override public int read(byte[] buf, int offset, int len) throws IOException { return in.read(buf, offset, Math.min(_maxBytes, len)); } } /* /********************************************************** /* Test methods /********************************************************** */ public void testStreamingBinary() throws Exception { _testStreamingBinary(true); _testStreamingBinary(false); } public void testBinaryWithoutLength() throws Exception { final SmileFactory f = new SmileFactory(); JsonGenerator jg = f.createGenerator(new ByteArrayOutputStream()); try { jg.writeBinary(new ByteArrayInputStream(new byte[1]), -1); fail("Should have failed"); } catch (UnsupportedOperationException e) { verifyException(e, "must pass actual length"); } } /* /********************************************************** /* Helper methods /********************************************************** */ private final static String TEXT = "Some content so that we can test encoding of base64 data; must" +" be long enough include a line wrap or two..."; private final static String TEXT4 = TEXT + TEXT + TEXT + TEXT; private void _testStreamingBinary(boolean rawBinary) throws Exception { final SmileFactory f = new SmileFactory(); f.configure(SmileGenerator.Feature.ENCODE_BINARY_AS_7BIT, !rawBinary); final byte[] INPUT = TEXT4.getBytes("UTF-8"); for (int chunkSize : new int[] { 1, 2, 3, 4, 7, 11, 29, 5000 }) { JsonGenerator jgen; final ByteArrayOutputStream bytes = new ByteArrayOutputStream(); jgen = f.createGenerator(bytes); jgen.writeStartArray(); InputStream data = new ThrottledInputStream(INPUT, chunkSize); jgen.writeBinary(data, INPUT.length); jgen.writeEndArray(); jgen.close(); JsonParser jp = f.createParser(bytes.toByteArray()); assertToken(JsonToken.START_ARRAY, jp.nextToken()); assertToken(JsonToken.VALUE_EMBEDDED_OBJECT, jp.nextToken()); byte[] b = jp.getBinaryValue(); Assert.assertArrayEquals(INPUT, b); assertToken(JsonToken.END_ARRAY, jp.nextToken()); } } }
[ "tsaloranta@gmail.com" ]
tsaloranta@gmail.com
a83ee04ea6d9eaed589648aea21f8a748e5fcfb5
5fb0a846928cbb2fbf93cccdff77a19f0d510994
/src/main/java/kz/kegoc/bln/filter/dict/SubstationFilterImpl.java
4c53207ac33bbb3752ac8f6f5de8a196a303c99f
[]
no_license
eugenenew80/blnDictApi
d15267bbe2ef96b21979dc272c3694572525b4bf
baaed16e0b41fc221da0dda83987fbc0c6fd80c3
refs/heads/master
2021-09-11T14:16:25.083246
2018-04-08T17:18:38
2018-04-08T17:18:38
105,112,268
0
0
null
null
null
null
UTF-8
Java
false
false
2,214
java
package kz.kegoc.bln.filter.dict; import kz.kegoc.bln.entity.dict.Organization; import kz.kegoc.bln.webapi.filters.SessionContext; import kz.kegoc.bln.entity.common.Lang; import kz.kegoc.bln.entity.dict.Substation; import kz.kegoc.bln.entity.dict.translate.SubstationTranslate; import kz.kegoc.bln.filter.AbstractFilter; import kz.kegoc.bln.filter.Filter; import kz.kegoc.bln.service.dict.SubstationService; import javax.ejb.Stateless; import javax.inject.Inject; import java.util.HashMap; @Stateless public class SubstationFilterImpl extends AbstractFilter<Substation> implements Filter<Substation> { public Substation filter(Substation entity, SessionContext context) { return translate(prepare(entity, context), context); } private Substation prepare(Substation entity, SessionContext context) { if (entity.getId()!=null) { Substation curEntity = substationService.findById(entity.getId(), context); entity.setCreateDate(curEntity.getCreateDate()); entity.setCreateBy(curEntity.getCreateBy()); if (entity.getTranslations()==null) entity.setTranslations(curEntity.getTranslations()); } if (entity.getOrg()==null) entity.setOrg(new Organization(context.getUser().getOrgId())); if (entity.getTranslations()==null) entity.setTranslations(new HashMap<>()); entity = addUpdateInfo(entity, context); return entity; } private Substation translate(Substation entity, SessionContext context) { Lang lang = entity.getLang()!=null ? entity.getLang() : defLang; SubstationTranslate translate = entity.getTranslations().getOrDefault(lang, new SubstationTranslate()); translate = addUpdateInfo(translate, context); translate.setLang(lang); translate.setSubstation(entity); translate.setName(entity.getName()); translate.setShortName(entity.getShortName()); translate.setAddress(entity.getAddress()); entity.getTranslations().put(lang, translate); return entity; } @Inject private SubstationService substationService; @Inject private Lang defLang; }
[ "eugenenew80@gmail.com" ]
eugenenew80@gmail.com
fa59f872f034c24254068a9cee77a40352603c16
477654b8575d1d721ef8b2f4f960d458436af720
/src/main/java/com/busasst/controller/CodeController.java
27d8137ab92d6ea08815e6405d4aac573c13f03f
[]
no_license
BusAssistant-Group/BusAssistant
e09c9bc14c99ef21eb37bf7db75cfe5fd9559b73
a9860fd4ee055d46a00f5bcadcd4865d3819063a
refs/heads/master
2020-12-21T09:02:54.649674
2016-08-15T08:29:10
2016-08-15T08:29:10
57,212,429
1
5
null
2016-08-15T08:26:44
2016-04-27T12:41:00
JavaScript
UTF-8
Java
false
false
4,117
java
package com.busasst.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import javax.imageio.ImageIO; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import java.awt.*; import java.awt.image.BufferedImage; import java.io.IOException; import java.util.Random; /** * Created by tsj on 16-5-11. */ @Controller public class CodeController { private int width = 140;//定义图片的width private int height = 40;//定义图片的height private int codeCount = 4;//定义图片上显示验证码的个数 private int xx = 28; private int fontHeight = 36; private int codeY = 32; char[] codeSequence = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}; @RequestMapping("/code") public void getCode(HttpServletRequest req, HttpServletResponse resp) throws IOException { //尝试验证码 System.out.println("getcode!"); // 定义图像buffer BufferedImage buffImg = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); // Graphics2D gd = buffImg.createGraphics(); //Graphics2D gd = (Graphics2D) buffImg.getGraphics(); Graphics gd = buffImg.getGraphics(); // 创建一个随机数生成器类 Random random = new Random(); // 将图像填充为白色 gd.setColor(Color.WHITE); gd.fillRect(0, 0, width, height); // 创建字体,字体的大小应该根据图片的高度来定。 Font font = new Font("Fixedsys", Font.BOLD, fontHeight); // 设置字体。 gd.setFont(font); // 画边框。 gd.setColor(Color.BLACK); gd.drawRect(0, 0, width - 1, height - 1); // 随机产生40条干扰线,使图象中的认证码不易被其它程序探测到。 gd.setColor(Color.BLACK); for (int i = 0; i < 40; i++) { int x = random.nextInt(width); int y = random.nextInt(height); int xl = random.nextInt(12); int yl = random.nextInt(12); gd.drawLine(x, y, x + xl, y + yl); } // randomCode用于保存随机产生的验证码,以便用户登录后进行验证。 StringBuffer randomCode = new StringBuffer(); int red = 0, green = 0, blue = 0; // 随机产生codeCount数字的验证码。 for (int i = 0; i < codeCount; i++) { // 得到随机产生的验证码数字。 String code = String.valueOf(codeSequence[random.nextInt(36)]); // 产生随机的颜色分量来构造颜色值,这样输出的每位数字的颜色值都将不同。 red = random.nextInt(255); green = random.nextInt(255); blue = random.nextInt(255); // 用随机产生的颜色将验证码绘制到图像中。 gd.setColor(new Color(red, green, blue)); gd.drawString(code, (i + 1) * xx, codeY); // 将产生的四个随机数组合在一起。 randomCode.append(code); } // 将四位数字的验证码保存到Session中。 HttpSession session = req.getSession(); System.out.println("randomcode:"+randomCode); session.setAttribute("code", randomCode.toString()); // 禁止图像缓存。 resp.setHeader("Pragma", "no-cache"); resp.setHeader("Cache-Control", "no-cache"); resp.setDateHeader("Expires", 0); resp.setContentType("image/jpeg"); // 将图像输出到Servlet输出流中。 ServletOutputStream sos = resp.getOutputStream(); ImageIO.write(buffImg, "jpeg", sos); try { sos.close(); } catch (IOException e) { e.printStackTrace(); } } }
[ "948138224@qq.com" ]
948138224@qq.com
16eaa1a664806970ae17766576aa0aa56248d9e2
5d76b555a3614ab0f156bcad357e45c94d121e2d
/src/com/google/android/gms/tagmanager/ah.java
f9910219cd38f32966ebb110c8300fe8428ff8ee
[]
no_license
BinSlashBash/xcrumby
8e09282387e2e82d12957d22fa1bb0322f6e6227
5b8b1cc8537ae1cfb59448d37b6efca01dded347
refs/heads/master
2016-09-01T05:58:46.144411
2016-02-15T13:23:25
2016-02-15T13:23:25
51,755,603
5
1
null
null
null
null
UTF-8
Java
false
false
754
java
package com.google.android.gms.tagmanager; import com.google.android.gms.internal.a; import com.google.android.gms.internal.d.a; import java.util.Map; class ah extends aj { private static final String ID = a.I.toString(); private final cs WL; public ah(cs paramcs) { super(ID, new String[0]); this.WL = paramcs; } public boolean jX() { return false; } public d.a x(Map<String, d.a> paramMap) { paramMap = this.WL.lx(); if (paramMap == null) { return dh.lT(); } return dh.r(paramMap); } } /* Location: /home/dev/Downloads/apk/dex2jar-2.0/crumby-dex2jar.jar!/com/google/android/gms/tagmanager/ah.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "binslashbash@otaking.top" ]
binslashbash@otaking.top
b193516692b3985bd33a0698be92d855a483cefb
0af8b92686a58eb0b64e319b22411432aca7a8f3
/large-multiproject/project76/src/main/java/org/gradle/test/performance76_3/Production76_224.java
9737f274b7e22109ecd034c2a33715a65874b3d3
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
305
java
package org.gradle.test.performance76_3; public class Production76_224 extends org.gradle.test.performance16_3.Production16_224 { private final String property; public Production76_224() { this.property = "foo"; } public String getProperty() { return property; } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
0c81c803883108eb3b213ecc233d317166667d0e
644277e4b4aa6b3a9932931081bb524c53688937
/Java/Loon-Neo-GWT/src/loon/html5/gwt/GWTPattern.java
dfbcad70f6837478c3d325bfee2de6870b07e6cd
[ "Apache-2.0" ]
permissive
cping/LGame
25e905281e31f4ca9e60ddbf7e192d130c8fa886
9b003a2e3e8a485c1b039b1ba15971dc17eb3f3c
refs/heads/master
2023-08-31T23:23:10.921734
2023-08-30T10:16:12
2023-08-30T10:16:12
6,753,822
470
163
Apache-2.0
2022-02-16T06:29:56
2012-11-19T02:05:03
Java
UTF-8
Java
false
false
1,561
java
/** * Copyright 2008 - 2015 The Loon Game Engine 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. * * @project loon * @author cping * @email:javachenpeng@yahoo.com * @version 0.5 */ package loon.html5.gwt; import loon.canvas.Pattern; import com.google.gwt.canvas.dom.client.CanvasPattern; import com.google.gwt.canvas.dom.client.Context2d; import com.google.gwt.dom.client.ImageElement; class GWTPattern extends Pattern { private final ImageElement patimg; private CanvasPattern pattern; GWTPattern(ImageElement patimg, boolean repeatX, boolean repeatY) { super(repeatX, repeatY); this.patimg = patimg; } public CanvasPattern pattern(Context2d ctx) { if (pattern == null) { Context2d.Repetition repeat; if (repeatX) { if (repeatY) repeat = Context2d.Repetition.REPEAT; else repeat = Context2d.Repetition.REPEAT_X; } else if (repeatY) { repeat = Context2d.Repetition.REPEAT_Y; } else { repeat = null; } pattern = ctx.createPattern(patimg, repeat); } return pattern; } }
[ "longwind2012@hotmail.com" ]
longwind2012@hotmail.com
956915997a6dcccaa77c4dfc2d7cff0fba6ff2d1
ceeacb5157b67b43d40615daf5f017ae345816db
/generated/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressPropertiesFormat.java
9f9f6538281b5359e4052949db051f2f0add00e8
[ "LicenseRef-scancode-generic-cla" ]
no_license
ChenTanyi/autorest.java
1dd9418566d6b932a407bf8db34b755fe536ed72
175f41c76955759ed42b1599241ecd876b87851f
refs/heads/ci
2021-12-25T20:39:30.473917
2021-11-07T17:23:04
2021-11-07T17:23:04
218,717,967
0
0
null
2020-11-18T14:14:34
2019-10-31T08:24:24
Java
UTF-8
Java
false
false
4,016
java
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.network.generated.models; import com.azure.core.management.SubResource; import com.azure.resourcemanager.network.generated.fluent.models.PublicIpAddressPropertiesFormatInner; import java.util.List; /** An immutable client-side representation of PublicIpAddressPropertiesFormat. */ public interface PublicIpAddressPropertiesFormat { /** * Gets the publicIpAllocationMethod property: The public IP address allocation method. * * @return the publicIpAllocationMethod value. */ IpAllocationMethod publicIpAllocationMethod(); /** * Gets the publicIpAddressVersion property: The public IP address version. * * @return the publicIpAddressVersion value. */ IpVersion publicIpAddressVersion(); /** * Gets the ipConfiguration property: The IP configuration associated with the public IP address. * * @return the ipConfiguration value. */ IpConfiguration ipConfiguration(); /** * Gets the dnsSettings property: The FQDN of the DNS record associated with the public IP address. * * @return the dnsSettings value. */ PublicIpAddressDnsSettings dnsSettings(); /** * Gets the ddosSettings property: The DDoS protection custom policy associated with the public IP address. * * @return the ddosSettings value. */ DdosSettings ddosSettings(); /** * Gets the ipTags property: The list of tags associated with the public IP address. * * @return the ipTags value. */ List<IpTag> ipTags(); /** * Gets the ipAddress property: The IP address associated with the public IP address resource. * * @return the ipAddress value. */ String ipAddress(); /** * Gets the publicIpPrefix property: The Public IP Prefix this Public IP Address should be allocated from. * * @return the publicIpPrefix value. */ SubResource publicIpPrefix(); /** * Gets the idleTimeoutInMinutes property: The idle timeout of the public IP address. * * @return the idleTimeoutInMinutes value. */ Integer idleTimeoutInMinutes(); /** * Gets the resourceGuid property: The resource GUID property of the public IP address resource. * * @return the resourceGuid value. */ String resourceGuid(); /** * Gets the provisioningState property: The provisioning state of the public IP address resource. * * @return the provisioningState value. */ ProvisioningState provisioningState(); /** * Gets the servicePublicIpAddress property: The service public IP address of the public IP address resource. * * @return the servicePublicIpAddress value. */ PublicIpAddress servicePublicIpAddress(); /** * Gets the natGateway property: The NatGateway for the Public IP address. * * @return the natGateway value. */ NatGateway natGateway(); /** * Gets the migrationPhase property: Migration phase of Public IP Address. * * @return the migrationPhase value. */ PublicIpAddressMigrationPhase migrationPhase(); /** * Gets the linkedPublicIpAddress property: The linked public IP address of the public IP address resource. * * @return the linkedPublicIpAddress value. */ PublicIpAddress linkedPublicIpAddress(); /** * Gets the deleteOption property: Specify what happens to the public IP address when the VM using it is deleted. * * @return the deleteOption value. */ DeleteOptions deleteOption(); /** * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.PublicIpAddressPropertiesFormatInner * object. * * @return the inner object. */ PublicIpAddressPropertiesFormatInner innerModel(); }
[ "actions@github.com" ]
actions@github.com
e4566e3037ce0555895f6f1e768a9bd3f325c21e
73de70fe610f5270d667aa606b5eec73f155898c
/src/main/java/com/jdon/mvc/core/ActionException.java
d295d0514b16386f85b8af6c06ab1ce1daa10d13
[]
no_license
zhunengfei/jdonmvc
c5244e9c0b6208128032dd7859abae95843e6f82
bdca9c3dfe21c54f6e65718cfeefae82e49dc9d4
refs/heads/master
2021-01-21T20:53:51.130292
2016-12-14T04:06:02
2016-12-14T04:06:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
444
java
package com.jdon.mvc.core; /** * User: Asion * Date: 13-6-6 * Time: 下午4:09 */ public class ActionException extends Exception { public ActionException() { super(); } public ActionException(String message) { super(message); } public ActionException(String message, Throwable cause) { super(message, cause); } public ActionException(Throwable cause) { super(cause); } }
[ "vsmysee@gmail.com" ]
vsmysee@gmail.com
2f2b1b0d53cff234de1cdf17ae7aa9f06795a432
3982cc0a73455f8ce32dba330581b4a809988a17
/platform/lang-impl/src/com/intellij/ide/highlighter/custom/impl/StandardFileTypeRegistrator.java
772adf695ea55877f7999c59302c70dd3deb3937
[ "Apache-2.0" ]
permissive
lshain-android-source/tools-idea
56d754089ebadd689b7d0e6400ef3be4255f6bc6
b37108d841684bcc2af45a2539b75dd62c4e283c
refs/heads/master
2016-09-05T22:31:43.471772
2014-07-09T07:58:59
2014-07-09T07:58:59
16,572,470
3
2
null
null
null
null
UTF-8
Java
false
false
3,120
java
/* * Copyright 2000-2009 JetBrains s.r.o. * * 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.intellij.ide.highlighter.custom.impl; import com.intellij.codeInsight.completion.CompletionUtil; import com.intellij.codeInsight.completion.SyntaxTableCompletionData; import com.intellij.codeInsight.editorActions.TypedHandler; import com.intellij.codeInsight.highlighting.BraceMatchingUtil; import com.intellij.ide.highlighter.FileTypeRegistrator; import com.intellij.ide.highlighter.custom.SyntaxTable; import com.intellij.lang.Commenter; import com.intellij.openapi.fileTypes.FileType; import com.intellij.openapi.fileTypes.impl.AbstractFileType; import com.intellij.openapi.fileTypes.impl.CustomSyntaxTableFileType; public class StandardFileTypeRegistrator implements FileTypeRegistrator { @Override public void initFileType(final FileType fileType) { if (fileType instanceof AbstractFileType) { init(((AbstractFileType)fileType)); } } private static void init(final AbstractFileType abstractFileType) { SyntaxTable table = abstractFileType.getSyntaxTable(); CompletionUtil.registerCompletionData(abstractFileType,new SyntaxTableCompletionData(table)); if (!isEmpty(table.getStartComment()) && !isEmpty(table.getEndComment()) || !isEmpty(table.getLineComment())) { abstractFileType.setCommenter(new MyCommenter(abstractFileType)); } if (table.isHasBraces() || table.isHasBrackets() || table.isHasParens()) { BraceMatchingUtil.registerBraceMatcher(abstractFileType,new CustomFileTypeBraceMatcher()); } TypedHandler.registerQuoteHandler(abstractFileType, new CustomFileTypeQuoteHandler()); } private static class MyCommenter implements Commenter { private final CustomSyntaxTableFileType myAbstractFileType; public MyCommenter(final CustomSyntaxTableFileType abstractFileType) { myAbstractFileType = abstractFileType; } @Override public String getLineCommentPrefix() { return myAbstractFileType.getSyntaxTable().getLineComment(); } @Override public String getBlockCommentPrefix() { return myAbstractFileType.getSyntaxTable().getStartComment(); } @Override public String getBlockCommentSuffix() { return myAbstractFileType.getSyntaxTable().getEndComment(); } @Override public String getCommentedBlockCommentPrefix() { return null; } @Override public String getCommentedBlockCommentSuffix() { return null; } } private static boolean isEmpty(String str) { return str==null || str.length() == 0; } }
[ "lshain.gyh@gmail.com" ]
lshain.gyh@gmail.com
8bdd8f90b24a68d4ee8a40f38fc270777dce98d0
661a25949407f44ff229ef1ede7e54c186fce1f0
/AndroidLab/part6_17/src/main/java/com/example/part6_17/Lab17_3Activity.java
2539146f4b302218148293f1a4c6e7c703f42413
[]
no_license
conquerex/WhatTheAndroid
1857964de40342d2febbff9303bf300864e3c250
9efb4ed3fc224ae3cd154a51019f51190f7a3bb8
refs/heads/master
2022-11-24T07:21:41.476632
2020-07-24T05:00:11
2020-07-24T05:00:11
268,811,019
0
0
null
null
null
null
UTF-8
Java
false
false
1,483
java
package com.example.part6_17; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import android.support.v4.view.ViewPager; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import java.util.ArrayList; /** * Created by kkang * 깡샘의 안드로이드 프로그래밍 - 루비페이퍼 * 위의 교재에 담겨져 있는 코드로 설명 및 활용 방법은 교제를 확인해 주세요. */ public class Lab17_3Activity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_lab17_3); ViewPager pager=findViewById(R.id.lab2_pager); MyPagerAdapter adapter=new MyPagerAdapter(getSupportFragmentManager()); pager.setAdapter(adapter); } class MyPagerAdapter extends FragmentPagerAdapter{ ArrayList<Fragment> fragments; public MyPagerAdapter(FragmentManager manager){ super(manager); fragments=new ArrayList<>(); fragments.add(new OneFragment()); fragments.add(new ThreeFragment()); } @Override public int getCount() { return 2; } @Override public Fragment getItem(int i) { return fragments.get(i); } } }
[ "conquerex@gmail.com" ]
conquerex@gmail.com
606086328fdd78f2059b1a7decc9787a18503baf
6baf1fe00541560788e78de5244ae17a7a2b375a
/hollywood/com.oculus.vrshell-VrShell/sources/com/oculus/android/exoplayer2/source/dash/manifest/UtcTimingElement.java
6126863ef981356587c8b3ca7c32d7101fbb3f98
[]
no_license
phwd/quest-tracker
286e605644fc05f00f4904e51f73d77444a78003
3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba
refs/heads/main
2023-03-29T20:33:10.959529
2021-04-10T22:14:11
2021-04-10T22:14:11
357,185,040
4
2
null
2021-04-12T12:28:09
2021-04-12T12:28:08
null
UTF-8
Java
false
false
381
java
package com.oculus.android.exoplayer2.source.dash.manifest; public final class UtcTimingElement { public final String schemeIdUri; public final String value; public UtcTimingElement(String str, String str2) { this.schemeIdUri = str; this.value = str2; } public String toString() { return this.schemeIdUri + ", " + this.value; } }
[ "cyuubiapps@gmail.com" ]
cyuubiapps@gmail.com
6ee1701ff104f49e4bfe9c1327146e812065c14a
a1f8360949073f3e894100a8a2cb317ce9ec1eff
/src/ch04/Flow29.java
c1ff16468f9df001d41002925da4cd693d6aa1b2
[]
no_license
loon0214/JAVA
308d377ec074bee9aba4f14a49cb004b48fe5d75
86bf331715394b9949c1d1870d5fc09847a03f71
refs/heads/master
2023-02-24T03:21:18.515249
2021-02-07T22:51:49
2021-02-07T22:51:49
336,907,765
0
0
null
null
null
null
UTF-8
Java
false
false
399
java
package ch04; public class Flow29 { public static void main(String[] args) { for(int i=1; i<=100; i++) { System.out.printf("i=%d ", i); int tmp = i; do { //tmp%10이 3의 배수인지 확인(0 제외) if(tmp%10%3==0 && tmp%10!=0) System.out.print("clap"); // tmp /= 10은 tmp = tmp / 10과 동일. }while((tmp/=10)!=0); System.out.println(); } } }
[ "valentine458@naver.com" ]
valentine458@naver.com
c79fee12a1d06f66cfc63c672cbc2051912a6c7b
b9c24d8872b3f1d0168d86ec11293fc3bf9dd734
/decorator-pattern-app/src/com/techlab/model/ThincrustPizza.java
a3c7cfc6b75d7c408179df6218f2d83ee398792b
[]
no_license
deepak-misal/java_design_patterns
24497c1eb784da071f434dd0237159c396d935be
0021f0bd9a98579addbe337b10b2fb0d140f47f9
refs/heads/master
2023-07-09T21:46:15.746052
2021-08-06T04:29:20
2021-08-06T04:29:20
393,247,875
0
0
null
null
null
null
UTF-8
Java
false
false
355
java
package com.techlab.model; public class ThincrustPizza implements Pizza{ private String description; private int price; public ThincrustPizza() { this.description="Thin crust pizza with tomato sauce"; this.price=20; } @Override public String getDescription() { return description; } @Override public int cost() { return price; } }
[ "deepak.misal2350@gmail.com" ]
deepak.misal2350@gmail.com
2e1381a81be75315f1ede6f13dec5ae6da45b450
278ed483cae1001dbbb9f7350f7086293063b967
/newyu-domain/src/main/java/com/newyu/domain/exam/SubjectCj.java
96ac8a77d44fdd73e76c7f82256205e0673fc9b0
[]
no_license
newyuliuyu/newyu
cca1b44a34b1101662641505760d8880dbabab11
228871303c2329ac392f436c2744c813a232cf7d
refs/heads/master
2022-12-28T00:49:00.267977
2019-12-06T07:35:33
2019-12-06T07:35:33
180,946,389
0
0
null
2022-12-16T00:03:17
2019-04-12T06:40:13
Java
UTF-8
Java
false
false
1,718
java
package com.newyu.domain.exam; import com.google.common.collect.Maps; import com.newyu.domain.org.TeachClazz; import lombok.*; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; /** * ClassName: SubjectCj <br/> * Function: ADD FUNCTION. <br/> * Reason: ADD REASON(可选). <br/> * date: 19-4-12 下午4:15 <br/> * * @author liuyu * @version v1.0 * @since JDK 1.7+ */ @Getter @Setter @NoArgsConstructor @AllArgsConstructor @ToString(of = {"subject", "qk", "score", "teachClazz"}) @Builder public class SubjectCj { private String subject; private TeachClazz teachClazz; @Builder.Default private boolean qk = false; @Builder.Default private boolean miss = false; private double score; private double kgScore; private double zgScore; private Map<String, ItemCj> itemCjMap = Maps.newHashMap(); private int qkNum; private int missNum; public void setItemCjs(List<ItemCj> itemCjs) { itemCjMap = itemCjs.stream().collect(Collectors.toMap(x -> x.getItemName(), x -> x)); } public void addItemCj(ItemCj itemCj) { itemCjMap.put(itemCj.getItemName(), itemCj); } public ItemCj queryItemCj(String itemName) { Optional<ItemCj> itemCj = Optional.ofNullable(itemCjMap.get(itemName)); return itemCj.orElse(ItemCj.builder().itemName(itemName).score(0d).selected("").build()); } public double getItemGroupScore(ItemGroup itemGroup) { List<Item> items = itemGroup.getItems(); double sumScore = 0d; for (Item item : items) { sumScore += queryItemCj(item.getName()).getScore(); } return sumScore; } }
[ "306487103@qq.com" ]
306487103@qq.com
22b8c1f3a66b3cd4b85f01d16e001fd98a54377c
4c1002f61f78737587027e19a0fd90d1ca90b851
/src/test/java/testNG/MedTran005.java
604441c5c21b30e20dd9d32917a9c52443228f63
[]
no_license
aravindanath/GOT
327bbed72d8d64f132757aaa90a32d98868766fb
fae1a74d3d2053febcc92e791731a81994221820
refs/heads/master
2023-05-11T10:32:55.384650
2020-02-29T17:26:41
2020-02-29T17:26:41
228,140,900
0
0
null
null
null
null
UTF-8
Java
false
false
875
java
package testNG; import org.testng.annotations.Test; import org.testng.annotations.Test; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.testng.SkipException; import org.testng.annotations.AfterTest; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; public class MedTran005 extends Browser { /** * Verify Buy now button * */ @Test(alwaysRun = false) public void verifyBuyNow() { int age = 100; if (age <= 10) { throw new SkipException("you are young.."); } System.out.println("verifyBuyNow"); WebElement buynow = driver.findElement(By.xpath("//a[@class='btn buy']")); System.out.println("Buy button is displayed?" + buynow.isDisplayed()); System.out.println("Buy button is Enabled?" + buynow.isEnabled()); System.out.println("Buy button is Selected?" + buynow.isSelected()); } }
[ "aravindanath86@gmail.com" ]
aravindanath86@gmail.com
225e20819a9a6d968a3024aeb5e16808c48f6614
e63363389e72c0822a171e450a41c094c0c1a49c
/Mate20_9_0_0/src/main/java/android/app/backup/RestoreDescription.java
8d2b3b73ad7c2ca26467b43d83a991144eef4864
[]
no_license
solartcc/HwFrameWorkSource
fc23ca63bcf17865e99b607cc85d89e16ec1b177
5b92ed0f1ccb4bafc0fdb08b6fc4d98447b754ad
refs/heads/master
2022-12-04T21:14:37.581438
2020-08-25T04:30:43
2020-08-25T04:30:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,195
java
package android.app.backup; import android.annotation.SystemApi; import android.os.Parcel; import android.os.Parcelable; import android.os.Parcelable.Creator; @SystemApi public class RestoreDescription implements Parcelable { public static final Creator<RestoreDescription> CREATOR = new Creator<RestoreDescription>() { public RestoreDescription createFromParcel(Parcel in) { RestoreDescription unparceled = new RestoreDescription(in, null); if (RestoreDescription.NO_MORE_PACKAGES_SENTINEL.equals(unparceled.mPackageName)) { return RestoreDescription.NO_MORE_PACKAGES; } return unparceled; } public RestoreDescription[] newArray(int size) { return new RestoreDescription[size]; } }; public static final RestoreDescription NO_MORE_PACKAGES = new RestoreDescription(NO_MORE_PACKAGES_SENTINEL, 0); private static final String NO_MORE_PACKAGES_SENTINEL = "NO_MORE_PACKAGES"; public static final int TYPE_FULL_STREAM = 2; public static final int TYPE_KEY_VALUE = 1; private final int mDataType; private final String mPackageName; public String toString() { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("RestoreDescription{"); stringBuilder.append(this.mPackageName); stringBuilder.append(" : "); stringBuilder.append(this.mDataType == 1 ? "KEY_VALUE" : "STREAM"); stringBuilder.append('}'); return stringBuilder.toString(); } public RestoreDescription(String packageName, int dataType) { this.mPackageName = packageName; this.mDataType = dataType; } public String getPackageName() { return this.mPackageName; } public int getDataType() { return this.mDataType; } public int describeContents() { return 0; } public void writeToParcel(Parcel out, int flags) { out.writeString(this.mPackageName); out.writeInt(this.mDataType); } private RestoreDescription(Parcel in) { this.mPackageName = in.readString(); this.mDataType = in.readInt(); } }
[ "lygforbs0@gmail.com" ]
lygforbs0@gmail.com
7d6085fad5297af5c6ed38d22a2d5841d1087a6c
af810df7ce36461ec2cfc6f572748ba56e1eea06
/testsuite/integration-tests/src/test/java/org/jboss/resteasy/test/stream/StreamRawFlowableRxJava2Test.java
b20f5e82a5b63b3b64834bb6362cfc0e8f1e38cf
[ "Apache-2.0" ]
permissive
benjamin-chapoton/Resteasy
07f47ee432bd5e6cfc09edae125f916e69e8afa6
9b78c494b84d33a556034ff0c5638be8767d2d4a
refs/heads/master
2020-03-29T15:36:15.265508
2018-09-20T10:43:27
2018-09-20T10:43:27
150,071,698
0
0
null
2018-09-24T08:06:59
2018-09-24T08:06:59
null
UTF-8
Java
false
false
5,714
java
package org.jboss.resteasy.test.stream; import javax.ws.rs.client.Invocation; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.junit.Arquillian; import org.jboss.resteasy.client.jaxrs.ResteasyClient; import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder; import org.jboss.resteasy.test.stream.resource.StreamRawByteArrayMessageBodyReaderWriter; import org.jboss.resteasy.test.stream.resource.StreamRawByteMessageBodyReaderWriter; import org.jboss.resteasy.test.stream.resource.StreamRawCharArrayMessageBodyReaderWriter; import org.jboss.resteasy.test.stream.resource.StreamRawCharMessageBodyReaderWriter; import org.jboss.resteasy.test.stream.resource.StreamRawFlowableRxJava2Resource; import org.jboss.resteasy.test.stream.resource.StreamRawMediaTypes; import org.jboss.resteasy.utils.PortProviderUtil; import org.jboss.resteasy.utils.TestUtil; import org.jboss.shrinkwrap.api.Archive; import org.jboss.shrinkwrap.api.asset.StringAsset; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; /** * @tpSubChapter Reactive classes * @tpChapter Integration tests * @tpSince RESTEasy 4.0 * * These tests check raw streaming. */ @RunWith(Arquillian.class) @RunAsClient public class StreamRawFlowableRxJava2Test { private static ResteasyClient client; @Deployment public static Archive<?> deploy() { WebArchive war = TestUtil.prepareArchive(StreamRawFlowableRxJava2Test.class.getSimpleName()); war.setManifest(new StringAsset("Manifest-Version: 1.0\n" + "Dependencies: org.jboss.resteasy.resteasy-rxjava2 services")); return TestUtil.finishContainerPrepare(war, null, StreamRawFlowableRxJava2Resource.class, StreamRawByteMessageBodyReaderWriter.class, StreamRawByteArrayMessageBodyReaderWriter.class, StreamRawCharMessageBodyReaderWriter.class, StreamRawCharArrayMessageBodyReaderWriter.class); } private static String generateURL(String path) { return PortProviderUtil.generateURL(path, StreamRawFlowableRxJava2Test.class.getSimpleName()); } ////////////////////////////////////////////////////////////////////////////// @BeforeClass public static void beforeClass() throws Exception { client = new ResteasyClientBuilder().build(); } @AfterClass public static void after() throws Exception { client.close(); } ////////////////////////////////////////////////////////////////////////////// @Test public void testByte() throws Exception { doByteTest("default"); doByteTest("false"); doByteTest("true"); } void doByteTest(String include) { Invocation.Builder request = client.target(generateURL("/byte/" + include)).request(); Response response = request.get(); StreamRawMediaTypes.testMediaType("byte", include, MediaType.valueOf(response.getHeaderString("Content-Type"))); byte[] entity = response.readEntity(byte[].class); Assert.assertEquals(200, response.getStatus()); Assert.assertEquals(3, entity.length); for (int i = 0; i < 3; i++) { Assert.assertEquals((byte) i, entity[i]); } } @Test public void testByteArray() throws Exception { doByteArrayTest("default"); doByteArrayTest("false"); doByteArrayTest("true"); } void doByteArrayTest(String include) { Invocation.Builder request = client.target(generateURL("/bytes/" + include)).request(); Response response = request.get(); StreamRawMediaTypes.testMediaType("byte", include, MediaType.valueOf(response.getHeaderString("Content-Type"))); byte[] entity = response.readEntity(byte[].class); Assert.assertEquals(200, response.getStatus()); Assert.assertEquals(9, entity.length); byte[] expected = new byte[] {0, 1, 2, 0, 1, 2, 0, 1, 2}; for (int i = 0; i < 9; i++) { Assert.assertEquals(expected[i], entity[i]); } } @Test public void testChar() throws Exception { doCharTest("default"); doCharTest("false"); doCharTest("true"); } void doCharTest(String include) { Invocation.Builder request = client.target(generateURL("/char/" + include)).request(); Response response = request.get(); StreamRawMediaTypes.testMediaType("char", include, MediaType.valueOf(response.getHeaderString("Content-Type"))); String entity = response.readEntity(String.class); Assert.assertEquals(200, response.getStatus()); Assert.assertEquals("abc", entity); } @Test public void testCharArray() throws Exception { doCharArrayTest("default"); doCharArrayTest("false"); doCharArrayTest("true"); } void doCharArrayTest(String include) { Invocation.Builder request = client.register(StreamRawCharArrayMessageBodyReaderWriter.class).target(generateURL("/chars/" + include)).request(); Response response = request.get(); StreamRawMediaTypes.testMediaType("char", include, MediaType.valueOf(response.getHeaderString("Content-Type"))); Character[] entity = response.readEntity(Character[].class); Assert.assertEquals(200, response.getStatus()); Assert.assertEquals(9, entity.length); Character[] chars = new Character[] {'a', 'b', 'c', 'a', 'b', 'c','a', 'b', 'c'}; for (int i = 0; i < entity.length; i++) { Assert.assertEquals(chars[i], entity[i]); } } }
[ "soldano.servizi@email.it" ]
soldano.servizi@email.it