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
2480c4a4fd9934374759aba995648848aab3a7c8
91adc264eb26be39c656f054005ec740d07900bd
/tc_project/tciuforep/src/client/com/ufida/report/anareport/edit/AnaEditPlugin.java
9a82c4e2e72b3020160f527b73605f5d73b174f7
[]
no_license
xhrise/nc-workspaces
9f30caf273e932bd1b4c2d419ac6bef4ef55e1cc
d5fcbce810ba4d4b5405edabfb5a26c36a19e7f8
refs/heads/master
2020-05-19T10:43:29.058686
2013-06-20T02:40:27
2013-06-20T02:40:27
37,459,512
0
1
null
null
null
null
GB18030
Java
false
false
7,152
java
package com.ufida.report.anareport.edit; import java.awt.Component; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import com.ufida.report.anareport.applet.AnaReportPlugin; import com.ufida.report.anareport.model.AnaReportModel; import com.ufida.report.anareport.model.AreaDataModel; import com.ufsoft.report.StateUtil; import com.ufsoft.report.UfoReport; import com.ufsoft.report.command.UfoCommand; import com.ufsoft.report.plugin.AbsActionExt; import com.ufsoft.report.plugin.AbstractPlugDes; import com.ufsoft.report.plugin.ActionUIDes; import com.ufsoft.report.plugin.ICommandExt; import com.ufsoft.report.plugin.IExtension; import com.ufsoft.report.plugin.IPluginDescriptor; import com.ufsoft.report.sysplugin.edit.AbsChoosePaste; import com.ufsoft.report.sysplugin.edit.EditExt; import com.ufsoft.report.sysplugin.edit.EditPasteFormat; import com.ufsoft.report.sysplugin.edit.EditPlugin; import com.ufsoft.report.sysplugin.edit.FormatBrushExt; import com.ufsoft.report.util.MultiLang; import com.ufsoft.table.AreaPosition; import com.ufsoft.table.CellPosition; import com.ufsoft.table.CellsModel; import com.ufsoft.table.EditParameter; import com.ufsoft.table.exarea.ExAreaCell; import com.ufsoft.table.exarea.ExAreaModel; import com.ufsoft.table.re.BorderPlayRender; /** * * @author wangyga * */ public class AnaEditPlugin extends EditPlugin { private class AnaEditExt extends EditExt { public AnaEditExt(UfoReport report, int editType, int clipType) { super(report, editType, clipType); } @Override public boolean isEnabled(Component focusComp) { AnaReportModel model = getAanRepModel(); if (model == null) return true; CellsModel formatModel = model.getFormatModel(); AreaPosition[] selectedAreas = getSelectedAreas(); if (selectedAreas != null && selectedAreas.length > 0) { ExAreaCell ex = ExAreaModel.getInstance(formatModel).getExArea( selectedAreas[0]); if (ex != null && (ex.getModel() instanceof AreaDataModel)) { AreaDataModel areaDataModel = (AreaDataModel) ex.getModel(); if (areaDataModel != null && areaDataModel.isCross()) { if (!model.isFormatState()) {//数据态不允许复制交叉区域 return false; } if (!ex.getArea().equals(selectedAreas[0]))//格式态必须复制整个扩展区域 return false; } } } return isExtEnabled(focusComp); } @Override protected AreaPosition[] getSelectedAreas() { return getSelectAreas(); } @Override protected CellsModel getCellsModel() { return getAanRepModel().getFormatModel(); } } private class AnaFormatBrushExt extends FormatBrushExt { public AnaFormatBrushExt(UfoReport report) { super(report); } public boolean isEnabled(Component focusComp) { return isExtEnabled(focusComp); } @Override protected AreaPosition[] getSelectedAreas() { return getSelectAreas(); } @Override protected MouseListener createMouseListener() { return new MouseAdapter() { public void mouseReleased(MouseEvent e) { if (isSeries()) {// 双击连续操作时,格式刷状态是:可以持续操作 setUseBrush(true); } if (isUseBrush()) { getChoosePaste().choosePaste();//粘贴格式 if(!getAanRepModel().isFormatState()) getAanPlugin().refreshDataModel(true); setUseBrush(false);// 执行一次后,使格式刷不可用:如果是连续(双击格式刷按钮)操作时,再变成可用,可以继续操作 if (!isSeries()) {// 执行一次时,停止动画,连续执行时,不需要停止 BorderPlayRender.stopPlay(getReport().getTable().getCells()); } } } }; } private AbsChoosePaste getChoosePaste() { AbsChoosePaste choosePaste = null; if (choosePaste == null) { choosePaste = new EditPasteFormat(getReport(), false); } choosePaste.setDataModel(getAanRepModel().getFormatModel()); choosePaste.setAnchorCell(getStartCell()); return choosePaste; } private CellPosition getStartCell(){ AnaReportModel anaRepModel = getAanRepModel(); CellsModel dataModel = getReport().getCellsModel(); AreaPosition[] selectedAreas = anaRepModel.getFormatModel().getSelectModel().getSelectedAreas(); if(!anaRepModel.isFormatState())//数据态时,需要把数据态的位置转化为格式态的对应字段位置上 selectedAreas = anaRepModel.getFormatAreas(dataModel, dataModel.getSelectModel().getSelectedAreas()); if(selectedAreas != null && selectedAreas.length >0) return selectedAreas[0].getStart(); return null; } } private boolean isExtEnabled(Component focusComp) { return StateUtil.isAreaSel(getReport(), focusComp); } private AnaReportModel getAanRepModel(){ if(getAanPlugin() == null) return null; return getAanPlugin().getModel(); } private AnaReportPlugin getAanPlugin(){ return (AnaReportPlugin)getReport().getPluginManager().getPlugin(AnaReportPlugin.class.getName()); } private AreaPosition[] getSelectAreas(){ AnaReportModel anaRepModel = getAanRepModel(); CellsModel dataModel = getReport().getCellsModel(); AreaPosition[] selectedAreas = anaRepModel.getFormatModel().getSelectModel().getSelectedAreas(); if(!anaRepModel.isFormatState())//数据态时,需要把数据态的位置转化为格式态的对应字段位置上 selectedAreas = anaRepModel.getFormatAreas(dataModel, dataModel.getSelectModel().getSelectedAreas()); return selectedAreas; } public IPluginDescriptor createDescriptor() { return new AbstractPlugDes(this) { protected IExtension[] createExtensions() { ICommandExt extCutAll = new AnaEditExt(getReport(), EditParameter.CUT, EditParameter.CELL_ALL); ICommandExt extCutContent = new AnaEditExt(getReport(), EditParameter.CUT, EditParameter.CELL_CONTENT); ICommandExt extCutFormat = new AnaEditExt(getReport(), EditParameter.CUT, EditParameter.CELL_FORMAT); ICommandExt extCopyAll = new AnaEditExt(getReport(), EditParameter.COPY, EditParameter.CELL_ALL); ICommandExt extCopyContent = new AnaEditExt(getReport(), EditParameter.COPY, EditParameter.CELL_CONTENT); ICommandExt extCopyFormat = new AnaEditExt(getReport(), EditParameter.COPY, EditParameter.CELL_FORMAT); ICommandExt extPaste = new AnaEditPasteExt(getReport()); ICommandExt extClearAll = new AnaEditClearAllExt(getReport()); ICommandExt extClearContent = new AnaEditClearContentExt(getReport()); ICommandExt extClearFormat = new AnaEditClearFormatExt(getReport()); ICommandExt formatBrushExt = new AnaFormatBrushExt(getReport()); return new IExtension[] { extCutAll, extCutContent, extCutFormat, extCopyAll, extCopyContent,extCopyFormat, extPaste, extClearAll, extClearContent, extClearFormat, formatBrushExt }; } }; } }
[ "comicme_yanghe@126.com" ]
comicme_yanghe@126.com
543f15b96be96d3caeb8c81d2bc375fb6dfdf083
a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb
/cdn-20180510/src/main/java/com/aliyun/cdn20180510/models/BatchStartCdnDomainResponseBody.java
ff1f8d1e3114cb8dcd1ec387922447f0a18eb30a
[ "Apache-2.0" ]
permissive
aliyun/alibabacloud-java-sdk
83a6036a33c7278bca6f1bafccb0180940d58b0b
008923f156adf2e4f4785a0419f60640273854ec
refs/heads/master
2023-09-01T04:10:33.640756
2023-09-01T02:40:45
2023-09-01T02:40:45
288,968,318
40
45
null
2023-06-13T02:47:13
2020-08-20T09:51:08
Java
UTF-8
Java
false
false
750
java
// This file is auto-generated, don't edit it. Thanks. package com.aliyun.cdn20180510.models; import com.aliyun.tea.*; public class BatchStartCdnDomainResponseBody extends TeaModel { /** * <p>The ID of the request.</p> */ @NameInMap("RequestId") public String requestId; public static BatchStartCdnDomainResponseBody build(java.util.Map<String, ?> map) throws Exception { BatchStartCdnDomainResponseBody self = new BatchStartCdnDomainResponseBody(); return TeaModel.build(map, self); } public BatchStartCdnDomainResponseBody setRequestId(String requestId) { this.requestId = requestId; return this; } public String getRequestId() { return this.requestId; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
8d0eb07bc572f17ca8ae137ba9f2250774b9e1b7
9964f9b51b8a23433a58e9214bd0ce496866b7f0
/src/dav/test/NewClass.java
f452bc6e8f51a99c221adaee541de8c260e3759f
[]
no_license
ADolodarenko/somespecial
90a662fc1d2d19e2282ac6083dcc7c8ca5c07752
9b19fbc83b08fdb5df85240d402c417376497899
refs/heads/master
2023-06-12T16:25:31.062218
2021-07-04T17:44:18
2021-07-04T19:21:00
382,910,954
0
0
null
null
null
null
UTF-8
Java
false
false
133
java
package dav.test; public class NewClass { public void print() { System.out.println(getClass().getSimpleName()); } }
[ "adolodar@gmail.com" ]
adolodar@gmail.com
97548fcb72a74421c41e596177fc19f6862458c8
4b4f27637dc57f3025935c6fb2bc1daf86b8407a
/src/HocaKlasor/Gun33/Tasks/task2/Task2.java
d871067f273f519acddb8150ee53afd9af14b0f1
[]
no_license
ctntprk63/JavaKursum
954bd8fada47fb448b9a0b49bc6cd6354a7806eb
6f33820d4e681a617ca717192283ca63bece1d42
refs/heads/master
2022-12-03T19:06:53.571025
2020-08-30T09:51:30
2020-08-30T09:51:30
291,442,384
0
0
null
null
null
null
UTF-8
Java
false
false
2,493
java
package HocaKlasor.Gun33.Tasks.task2; import java.util.ArrayList; public class Task2 { // Bir Üniversitede öğrencilere ders kaydı yapılacaktır. // 1- Ders sınınıfı ayrı dosyada : adı: Lesson , fields : name, credit (1-3 arasında değer alıyor) // 2- Öğrenci Sınıfı ayrı dosyada: adı: Student, fields : name, maxCredit, dersleri listesini // tutacak bir liste // 3- 3 adet ders oluşturunuz. // 4- 1 adet öğrenci tanımlayınız alabileceği maxCredi si 10 olsun. // 5- Bu öğrencinin ders listesine açılmış dersleri ekleyiniz. // ders eklerken max alabileceği Crediyi geçmemeli, geçerse // uyarı versi, alabileceğiniz max credi doldu şeklinde. // Ödev // 6- Aşağıdaki ders oluşturma kısmı için ilgili sınıfta lessonCreate adında bir metod // oluşturunuz // 7- Öğrenciye ders ekleme bölümünü yine ilgili sınıfta bir metod olarak yazınız. public static void main(String[] args) { Lesson mat101=new Lesson(); mat101.name="Matematik"; mat101.credit=3; Lesson java101=new Lesson(); java101.name="Java Programming"; java101.credit=6; Lesson fiz101=new Lesson(); fiz101.name="Fizik"; fiz101.credit=4; Student ogrenci1=new Student(); ogrenci1.name="Kemal"; ogrenci1.maxCredit =10; ogrenci1.dersListesi=new ArrayList<>(); // buraya kontrol konacak toplam aldığı krediye bakılarak // Eklenecek ders ile öğrencinin o ana kadarki kredisi toplamı // öğrencinin alabileceği max krediyi aşmıyorsa ekle if (ogrenci1.totalCredit()+ mat101.credit <= ogrenci1.maxCredit) { ogrenci1.dersListesi.add(mat101); } else { System.out.println("mat101 için Alabileceğiniz Kredi miktarı doldu"); } if (ogrenci1.totalCredit()+ fiz101.credit <= ogrenci1.maxCredit) { ogrenci1.dersListesi.add(fiz101); } else { System.out.println("fiz101 için Alabileceğiniz Kredi miktarı doldu"); } if (ogrenci1.totalCredit()+ java101.credit <= ogrenci1.maxCredit) { ogrenci1.dersListesi.add(java101); } else { System.out.println("java101 için Alabileceğiniz Kredi miktarı doldu"); } } }
[ "cetintoprak63@gmail.com" ]
cetintoprak63@gmail.com
1f435594ea42b21a4c753daf6c3b0e557c56da22
99f9e9b5dbd3db8163af3238f4dcad2d77306f30
/src/main/java/com/github/teocci/codesample/av/streaming/utils/Config.java
0578d917829f8b7886c575054d22056d09b55ccd
[ "MIT" ]
permissive
teocci/Streaming-Player-Java
bb1187423be21f7c58b8a014f11042054e57ea89
525837f1911037845d086e5c3242b204a5e54c3f
refs/heads/master
2021-05-07T03:11:48.635182
2018-08-14T05:49:03
2018-08-14T05:49:03
110,643,623
1
0
null
null
null
null
UTF-8
Java
false
false
516
java
package com.github.teocci.codesample.av.streaming.utils; /** * Created by teocci. * * @author teocci@yandex.com on 2017-Nov-14 */ public class Config { public static final String EOL = "\r\n"; public static final String LOG_PREFIX = "[Streamer]"; public static final int MAX_ITEMS = 3; public static final String IMAGE_NO_VIDEO = "/images/no-video.png"; public static final String IMAGE_ERROR = "/images/error.png"; public static final String IMAGE_HANDLER = "/images/handler.png"; }
[ "teocci@yandex.com" ]
teocci@yandex.com
5070a4fe2116c34b2d94c447cd92c5ba49b26a39
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/10/10_b7859db40a3734047dc043a219e7cdfe1c0e91c6/GWTCacheControlFilter/10_b7859db40a3734047dc043a219e7cdfe1c0e91c6_GWTCacheControlFilter_s.java
57fa1e2c0a0cc623c8613fd8f3b45ffb7e5f17de
[]
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,333
java
package org.sagebionetworks.web.server.servlet.filter; import java.io.IOException; import java.util.Date; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * very basic filter to browser scripts * * @author jayhodgson * */ public class GWTCacheControlFilter implements Filter { private FilterConfig filterConfig; public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException { HttpServletRequest httpRequest = (HttpServletRequest) request; String requestURI = httpRequest.getRequestURI(); if (!requestURI.contains(".nocache.")) { long today = new Date().getTime(); HttpServletResponse httpResponse = (HttpServletResponse) response; //6 hours httpResponse.setDateHeader("Expires", today+(1000*60*60*6)); } filterChain.doFilter(request, response); } public void init(FilterConfig config) throws ServletException { this.filterConfig = config; } @Override public void destroy() { this.filterConfig = null; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
758199ecdca904b7173fb3c053b3b5247603ee03
7927ef9fd7d0756ddde0f43e5862d592dbf6062e
/hope-server-gateway/src/main/java/com/hope/server/utils/YmlConfig.java
a6318f4f2a877e45ce571720fe92460822a59502
[]
no_license
Android19931001/HOPESERVER
c6f05ebfb2b0482a8058365b9751ddd4cc56640e
2755159593fb45b0eea6efc6fef1249b651fa533
refs/heads/master
2023-01-08T08:45:57.034747
2022-12-30T06:10:42
2022-12-30T06:10:42
203,543,634
4
0
null
2022-06-21T01:43:13
2019-08-21T08:45:19
Java
UTF-8
Java
false
false
839
java
package com.hope.server.utils; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.PropertySource; import org.springframework.stereotype.Component; /** * @author wangning */ @Component @ConfigurationProperties(prefix = "hope.header") @PropertySource("classpath:config/application.yml") public class YmlConfig { private String hopeheaderkey; private String hopeheadervalue; public String getHopeheaderkey() { return hopeheaderkey; } public void setHopeheaderkey(String hopeheaderkey) { this.hopeheaderkey = hopeheaderkey; } public String getHopeheadervalue() { return hopeheadervalue; } public void setHopeheadervalue(String hopeheadervalue) { this.hopeheadervalue = hopeheadervalue; } }
[ "1234qwer" ]
1234qwer
56abf49e99639b88389e62a25619f982e0b58501
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Math/66/org/apache/commons/math/random/EmpiricalDistributionImpl_ArrayDataAdapter_290.java
ed6450f04265ceffbc146f78c9b1591c471f7f29
[]
no_license
hvdthong/NetML
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
9bb103da21327912e5a29cbf9be9ff4d058731a5
refs/heads/master
2021-06-30T15:03:52.618255
2020-10-07T01:58:48
2020-10-07T01:58:48
150,383,588
1
1
null
2018-09-26T07:08:45
2018-09-26T07:08:44
null
UTF-8
Java
false
false
1,431
java
org apach common math random implement code empir distribut empiricaldistribut code implement amount href http nedwww ipac caltech level5 march02 silverman silver2 html variabl kernel method gaussian smooth strong digest input file strong pass file comput min max divid rang min max code bin count bincount code bin pass data file comput bin count univari statist std dev bin divid interv subinterv bin length bin' subinterv proport count strong gener random valu distribut strong gener uniformli distribut select subinterv belong gener random gaussian bin std dev std dev bin strong usag note strong code bin count bincount code set good rule thumb set bin count approxim length input file divid input file plain text file valid numer entri line version revis date empir distribut impl empiricaldistributionimpl serializ empir distribut empiricaldistribut construct arrai data adapt arraydataadapt arrai param arrai hold data arrai data adapt arraydataadapt input arrai inputarrai
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
cb3f1e238357ae37ef283679ae7eccaa8683f924
7cfabdec02b61ab2e8dd68eb4c37c21248e11cbe
/src/com/wechat/interceptor/PrivilegeInterceptor.java
870a2f6f1095dcbf2bf404ebcbec96a931f4a62e
[]
no_license
hzjianglf/wechat-manager
6dbd5aedf8984e19d658c3a11b059d458a5f8043
f450fed175a36ee3b8f1ad3a13868449e2c8fa51
refs/heads/master
2022-06-05T13:18:54.064421
2020-05-04T14:37:06
2020-05-04T14:37:06
261,207,226
0
0
null
2020-05-04T14:36:25
2020-05-04T14:36:24
null
UTF-8
Java
false
false
2,857
java
/** * Copyright: Copyright (c) 2015 xlz * * @ClassName: PrivilegeInterceptor.java * @Description: 系统功能权限验证拦截�? * * @version: v1.0.0 * @author: xuyiping * @date: 2015-4-20 上午9:37:24 * * Modification History: * Date Author Version Description *---------------------------------------------------------* * 2014-1-13 xuyiping v1.0.0 修改原因 */ package com.wechat.interceptor; import java.io.PrintWriter; import java.lang.reflect.Method; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; import com.wechat.entity.Privilege; import com.wechat.entity.PrivilegePK; import com.wechat.entity.User; import com.wechat.prev.Prev; import com.wechat.service.PrivilegeService; import com.wechat.util.Constrants; public class PrivilegeInterceptor extends HandlerInterceptorAdapter { @Autowired protected @Qualifier("prevService") PrivilegeService prevService; @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { Method method = getCurrentMethod(handler); Prev privilegeAnotation = method.getAnnotation(Prev.class); if (privilegeAnotation != null) { String oprator = privilegeAnotation.oprator(); String module = privilegeAnotation.module(); PrivilegePK privilegePK = new PrivilegePK(module, oprator); Privilege pri = new Privilege(privilegePK); User user = (User) request.getSession().getAttribute(Constrants.USER_KEY); List<Privilege> privilegeList = prevService .findAllPrevToUser(user); request.getSession() .setAttribute(Constrants.USER_PRIVILEGE_KEY, privilegeList); if (privilegeList != null && privilegeList.contains(pri)) { return true; } else { if (request.getHeader("X-Requested-With") != null && request.getHeader("X-Requested-With") .equalsIgnoreCase("XMLHttpRequest")) {//是ajax请求 response.setCharacterEncoding("text/html;charset=UTF-8"); response.setContentType("text/html;charset=UTF-8"); PrintWriter writer = response.getWriter(); StringBuffer jsonTip = new StringBuffer("{\"result\":"); jsonTip.append(false).append(",\"tip\":\"您无权操作\"}"); writer.print(jsonTip.toString()); return false; }else{//非ajax请求 return false; } } } else { return true; } } private Method getCurrentMethod(Object invocation) throws Exception { HandlerMethod method = (HandlerMethod) invocation; return method.getMethod(); } }
[ "691529382@qq.com" ]
691529382@qq.com
d200229a9297d8276131ec35b9eccf8a89f08641
11c82833b1066d5e48c06ff11de766298f127674
/open-metadata-implementation/access-services/connected-asset/connected-asset-api/src/test/java/org/odpi/openmetadata/accessservices/connectedasset/ffdc/exceptions/UnrecognizedConnectionGUIDExceptionTest.java
cd526ee22697ebfbb13f31a25dfe5a6280680a36
[ "CC-BY-4.0", "Apache-2.0" ]
permissive
PieterJanVanAeken/egeria
37ac28ee35ac8b395cbe7fb5849741a3d1ffb9ae
8c71faed767297464ba2bd8396b7b7aa3f1277c5
refs/heads/master
2020-03-30T16:09:04.913927
2019-03-05T11:35:44
2019-03-05T11:35:44
148,496,778
0
0
Apache-2.0
2018-09-12T14:52:25
2018-09-12T14:52:24
null
UTF-8
Java
false
false
8,139
java
/* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ package org.odpi.openmetadata.accessservices.connectedasset.ffdc.exceptions; import org.testng.annotations.Test; import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertTrue; /** * Validate that the unrecognized connection guid exception is properly populated and supports toString, hashCode and * equals. */ public class UnrecognizedConnectionGUIDExceptionTest { private int reportedHTTPCode = 404; private String reportingClassName = "TestClassName"; private String reportingActionDescription = "TestActionDescription"; private String reportedErrorMessage = "TestErrorMessage"; private String reportedSystemAction = "TestSystemAction"; private String reportedUserAction = "TestUserAction"; private String connectionGUID = "TestConnectionGUID"; private Throwable reportedCaughtException = new Exception("TestReportedCaughtException"); /** * Constructor */ public UnrecognizedConnectionGUIDExceptionTest() { } /** * Test that a new exception is properly populated */ @Test public void testNewException() { UnrecognizedConnectionGUIDException exception = new UnrecognizedConnectionGUIDException(reportedHTTPCode, reportingClassName, reportingActionDescription, reportedErrorMessage, reportedSystemAction, reportedUserAction, null); assertTrue(exception.getReportedHTTPCode() == reportedHTTPCode); assertTrue(exception.getReportingClassName().equals(reportingClassName)); assertTrue(exception.getReportingActionDescription().equals(reportingActionDescription)); assertTrue(exception.getErrorMessage().equals(reportedErrorMessage)); assertTrue(exception.getReportedSystemAction().equals(reportedSystemAction)); assertTrue(exception.getReportedUserAction().equals(reportedUserAction)); assertTrue(exception.getReportedCaughtException() == null); assertTrue(exception.getConnectionGUID() == null); } /** * Test that a caught exception is properly wrapped */ @Test public void testWrappingException() { UnrecognizedConnectionGUIDException exception = new UnrecognizedConnectionGUIDException(reportedHTTPCode, reportingClassName, reportingActionDescription, reportedErrorMessage, reportedSystemAction, reportedUserAction, reportedCaughtException, connectionGUID); assertTrue(exception.getReportedHTTPCode() == reportedHTTPCode); assertTrue(exception.getReportingClassName().equals(reportingClassName)); assertTrue(exception.getReportingActionDescription().equals(reportingActionDescription)); assertTrue(exception.getErrorMessage().equals(reportedErrorMessage)); assertTrue(exception.getReportedSystemAction().equals(reportedSystemAction)); assertTrue(exception.getReportedUserAction().equals(reportedUserAction)); assertFalse(exception.getReportedCaughtException().equals(null)); assertTrue(exception.getReportedCaughtException().getMessage().equals("TestReportedCaughtException")); assertTrue(exception.getConnectionGUID().equals(connectionGUID)); } /** * Validate that string, equals and hashCode work off of the values of the exception */ @Test public void testHashCode() { UnrecognizedConnectionGUIDException exception = new UnrecognizedConnectionGUIDException(reportedHTTPCode, reportingClassName, reportingActionDescription, reportedErrorMessage, reportedSystemAction, reportedUserAction, connectionGUID); UnrecognizedConnectionGUIDException exception2 = new UnrecognizedConnectionGUIDException(reportedHTTPCode, reportingClassName, reportingActionDescription, reportedErrorMessage, reportedSystemAction, reportedUserAction, reportedCaughtException, connectionGUID); UnrecognizedConnectionGUIDException exception3 = new UnrecognizedConnectionGUIDException(reportedHTTPCode, reportingClassName, reportingActionDescription, reportedErrorMessage, reportedSystemAction, reportedUserAction, reportedCaughtException, connectionGUID); assertTrue(exception.hashCode() == exception.hashCode()); assertFalse(exception.hashCode() == exception2.hashCode()); assertTrue(exception.equals(exception)); assertFalse(exception.equals(reportedCaughtException)); assertFalse(exception.equals(exception2)); assertTrue(exception2.equals(exception3)); assertTrue(exception.toString().contains("UnrecognizedConnectionGUIDException")); assertTrue(exception.toString().equals(exception.toString())); assertFalse(exception.toString().equals(exception2.toString())); assertTrue(exception.getConnectionGUID().equals(exception2.getConnectionGUID())); } }
[ "mandy_chessell@uk.ibm.com" ]
mandy_chessell@uk.ibm.com
5fc771cec28118c88aaf67ad2165f235f3ecf97e
806d98680bfd318fe5d8e65d08628ec75729faca
/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/ext/history/ChatMetadata.java
0a83f0800829513cc1649161a4d7781de81e22ca
[ "Apache-2.0" ]
permissive
AdarshMaurya/Smack
f21df5428d8fca5701b28a24b27217030bffe221
5fd07110ba9771c7bbb859612f2f82bff0d9f49a
refs/heads/master
2020-05-18T09:51:37.423628
2019-04-30T22:46:06
2019-04-30T22:46:06
184,337,343
0
0
Apache-2.0
2019-04-30T22:01:13
2019-04-30T22:01:12
null
UTF-8
Java
false
false
3,414
java
/** * * Copyright 2003-2007 Jive Software. * * 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.jivesoftware.smackx.workgroup.ext.history; import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; import org.jivesoftware.smack.packet.IQ; import org.jivesoftware.smack.packet.XmlEnvironment; import org.jivesoftware.smack.provider.IQProvider; import org.jivesoftware.smackx.workgroup.util.MetaDataUtils; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; public class ChatMetadata extends IQ { /** * Element name of the stanza extension. */ public static final String ELEMENT_NAME = "chat-metadata"; /** * Namespace of the stanza extension. */ public static final String NAMESPACE = "http://jivesoftware.com/protocol/workgroup"; private String sessionID; public ChatMetadata() { super(ELEMENT_NAME, NAMESPACE); } public String getSessionID() { return sessionID; } public void setSessionID(String sessionID) { this.sessionID = sessionID; } private Map<String, List<String>> map = new HashMap<String, List<String>>(); public void setMetadata(Map<String, List<String>> metadata) { this.map = metadata; } public Map<String, List<String>> getMetadata() { return map; } @Override protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder buf) { buf.rightAngleBracket(); buf.append("<sessionID>").append(getSessionID()).append("</sessionID>"); return buf; } /** * An IQProvider for Metadata packets. * * @author Derek DeMoro */ public static class Provider extends IQProvider<ChatMetadata> { @Override public ChatMetadata parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException { final ChatMetadata chatM = new ChatMetadata(); boolean done = false; while (!done) { int eventType = parser.next(); if (eventType == XmlPullParser.START_TAG) { if (parser.getName().equals("sessionID")) { chatM.setSessionID(parser.nextText()); } else if (parser.getName().equals("metadata")) { Map<String, List<String>> map = MetaDataUtils.parseMetaData(parser); chatM.setMetadata(map); } } else if (eventType == XmlPullParser.END_TAG) { if (parser.getName().equals(ELEMENT_NAME)) { done = true; } } } return chatM; } } }
[ "flo@geekplace.eu" ]
flo@geekplace.eu
60f46632f767fe387bcf07a45c77380ceb3f660d
90eb7a131e5b3dc79e2d1e1baeed171684ef6a22
/sources/p005b/p096l/p180d/p191q/p192f/p202m/C4186h.java
357e416145cee45580ddcd1e824f7262831967d4
[]
no_license
shalviraj/greenlens
1c6608dca75ec204e85fba3171995628d2ee8961
fe9f9b5a3ef4a18f91e12d3925e09745c51bf081
refs/heads/main
2023-04-20T13:50:14.619773
2021-04-26T15:45:11
2021-04-26T15:45:11
361,799,768
0
0
null
null
null
null
UTF-8
Java
false
false
331
java
package p005b.p096l.p180d.p191q.p192f.p202m; import org.json.JSONObject; import p005b.p096l.p180d.p191q.p192f.p195g.C4026n0; import p005b.p096l.p180d.p191q.p192f.p202m.p203j.C4192e; /* renamed from: b.l.d.q.f.m.h */ public interface C4186h { /* renamed from: a */ C4192e mo15782a(C4026n0 n0Var, JSONObject jSONObject); }
[ "73280944+shalviraj@users.noreply.github.com" ]
73280944+shalviraj@users.noreply.github.com
b714abcc9427bb591c1471e9a9c2127a3086fc7f
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/15/15_32f4ceb2434b6f204cf8152b406d0f9a642feb73/MoreSuggestionsView/15_32f4ceb2434b6f204cf8152b406d0f9a642feb73_MoreSuggestionsView_s.java
f5c64ed03ea901ab9913cf511fb6a81e1e2b8bd4
[]
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
8,062
java
/* * Copyright (C) 2011 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.android.inputmethod.latin.suggestions; import android.content.Context; import android.content.res.Resources; import android.util.AttributeSet; import android.view.Gravity; import android.view.MotionEvent; import android.view.View; import android.widget.PopupWindow; import com.android.inputmethod.keyboard.KeyDetector; import com.android.inputmethod.keyboard.Keyboard; import com.android.inputmethod.keyboard.KeyboardActionListener; import com.android.inputmethod.keyboard.KeyboardView; import com.android.inputmethod.keyboard.MoreKeysDetector; import com.android.inputmethod.keyboard.MoreKeysPanel; import com.android.inputmethod.keyboard.PointerTracker; import com.android.inputmethod.keyboard.PointerTracker.DrawingProxy; import com.android.inputmethod.keyboard.PointerTracker.KeyEventHandler; import com.android.inputmethod.keyboard.PointerTracker.TimerProxy; import com.android.inputmethod.latin.R; /** * A view that renders a virtual {@link MoreSuggestions}. It handles rendering of keys and detecting * key presses and touch movements. */ public class MoreSuggestionsView extends KeyboardView implements MoreKeysPanel { private final int[] mCoordinates = new int[2]; final KeyDetector mModalPanelKeyDetector; private final KeyDetector mSlidingPanelKeyDetector; private Controller mController; KeyboardActionListener mListener; private int mOriginX; private int mOriginY; static final TimerProxy EMPTY_TIMER_PROXY = new TimerProxy.Adapter(); final KeyboardActionListener mSuggestionsPaneListener = new KeyboardActionListener.Adapter() { @Override public void onPressKey(int primaryCode) { mListener.onPressKey(primaryCode); } @Override public void onReleaseKey(int primaryCode, boolean withSliding) { mListener.onReleaseKey(primaryCode, withSliding); } @Override public void onCodeInput(int primaryCode, int x, int y) { final int index = primaryCode - MoreSuggestions.SUGGESTION_CODE_BASE; if (index >= 0 && index < SuggestionsView.MAX_SUGGESTIONS) { mListener.onCustomRequest(index); } } @Override public void onCancelInput() { mListener.onCancelInput(); } }; public MoreSuggestionsView(Context context, AttributeSet attrs) { this(context, attrs, R.attr.moreSuggestionsViewStyle); } public MoreSuggestionsView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); final Resources res = context.getResources(); mModalPanelKeyDetector = new KeyDetector(/* keyHysteresisDistance */ 0); mSlidingPanelKeyDetector = new MoreKeysDetector( res.getDimension(R.dimen.more_suggestions_slide_allowance)); setKeyPreviewPopupEnabled(false, 0); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { final Keyboard keyboard = getKeyboard(); if (keyboard != null) { final int width = keyboard.mOccupiedWidth + getPaddingLeft() + getPaddingRight(); final int height = keyboard.mOccupiedHeight + getPaddingTop() + getPaddingBottom(); setMeasuredDimension(width, height); } else { super.onMeasure(widthMeasureSpec, heightMeasureSpec); } } @Override public void setKeyboard(Keyboard keyboard) { super.setKeyboard(keyboard); mModalPanelKeyDetector.setKeyboard(keyboard, -getPaddingLeft(), -getPaddingTop()); mSlidingPanelKeyDetector.setKeyboard(keyboard, -getPaddingLeft(), -getPaddingTop() + mVerticalCorrection); } @Override public KeyDetector getKeyDetector() { return mSlidingPanelKeyDetector; } @Override public KeyboardActionListener getKeyboardActionListener() { return mSuggestionsPaneListener; } @Override public DrawingProxy getDrawingProxy() { return this; } @Override public TimerProxy getTimerProxy() { return EMPTY_TIMER_PROXY; } @Override public void setKeyPreviewPopupEnabled(boolean previewEnabled, int delay) { // Suggestions pane needs no pop-up key preview displayed, so we pass always false with a // delay of 0. The delay does not matter actually since the popup is not shown anyway. super.setKeyPreviewPopupEnabled(false, 0); } @Override public void showMoreKeysPanel(View parentView, Controller controller, int pointX, int pointY, PopupWindow window, KeyboardActionListener listener) { mController = controller; mListener = listener; final View container = (View)getParent(); final MoreSuggestions pane = (MoreSuggestions)getKeyboard(); final int defaultCoordX = pane.mOccupiedWidth / 2; // The coordinates of panel's left-top corner in parentView's coordinate system. final int x = pointX - defaultCoordX - container.getPaddingLeft(); final int y = pointY - container.getMeasuredHeight() + container.getPaddingBottom(); window.setContentView(container); window.setWidth(container.getMeasuredWidth()); window.setHeight(container.getMeasuredHeight()); parentView.getLocationInWindow(mCoordinates); window.showAtLocation(parentView, Gravity.NO_GRAVITY, x + mCoordinates[0], y + mCoordinates[1]); mOriginX = x + container.getPaddingLeft(); mOriginY = y + container.getPaddingTop(); } private boolean mIsDismissing; @Override public boolean dismissMoreKeysPanel() { if (mIsDismissing) return false; mIsDismissing = true; final boolean dismissed = mController.dismissMoreKeysPanel(); mIsDismissing = false; return dismissed; } @Override public int translateX(int x) { return x - mOriginX; } @Override public int translateY(int y) { return y - mOriginY; } private final KeyEventHandler mModalPanelKeyEventHandler = new KeyEventHandler() { @Override public KeyDetector getKeyDetector() { return mModalPanelKeyDetector; } @Override public KeyboardActionListener getKeyboardActionListener() { return mSuggestionsPaneListener; } @Override public DrawingProxy getDrawingProxy() { return MoreSuggestionsView.this; } @Override public TimerProxy getTimerProxy() { return EMPTY_TIMER_PROXY; } }; @Override public boolean onTouchEvent(MotionEvent me) { final int action = me.getAction(); final long eventTime = me.getEventTime(); final int index = me.getActionIndex(); final int id = me.getPointerId(index); final PointerTracker tracker = PointerTracker.getPointerTracker(id, this); final int x = (int)me.getX(index); final int y = (int)me.getY(index); tracker.processMotionEvent(action, x, y, eventTime, mModalPanelKeyEventHandler); return true; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
7d5970584ac2f0b098b3e86135bcb7c43d11fd9e
a7447a5d5b49a4cdce62b61177a35857d73fa836
/framework/tenio-common/src/main/java/com/tenio/common/pool/IPoolable.java
0550f273d5a04cbb50af7dc43340270ec02cdf8b
[ "MIT" ]
permissive
iuriimattos2/tenio
63c88e4b5a0ad8cee006ed4f9fbaed12a4f5e5b8
219201a8be50b99f51fc8af9ea603d14301ce12a
refs/heads/master
2023-03-31T17:10:43.465918
2021-04-10T01:37:30
2021-04-10T01:37:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,205
java
/* The MIT License Copyright (c) 2016-2021 kong <congcoi123@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package com.tenio.common.pool; /** * @author kong */ public interface IPoolable { int getIndex(); }
[ "congcoi123@gmail.com" ]
congcoi123@gmail.com
9221323719a62558d00044e407e975c6afb3aaa5
a128f19f6c10fc775cd14daf740a5b4e99bcd2fb
/middleheaven-core/src/main/java/org/middleheaven/core/wiring/WiringUtils.java
e7bebe1dd5e81485bbd20ea37b8ee7ecf30b6af1
[]
no_license
HalasNet/middleheaven
c8bfa6199cb9b320b9cfd17b1f8e4961e3d35e6e
15e3e91c338e359a96ad01dffe9d94e069070e9c
refs/heads/master
2021-06-20T23:25:09.978612
2017-08-12T21:35:56
2017-08-12T21:37:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
606
java
/** * */ package org.middleheaven.core.wiring; import java.lang.annotation.Annotation; import org.middleheaven.core.annotations.ScopeSpecification; /** * */ public class WiringUtils { public static String readScope(Annotation a){ return readScope(a.annotationType()); } public static String readScope(Class<? extends Annotation> annotationType){ final ScopeSpecification scopeSpecification = annotationType.getAnnotation(ScopeSpecification.class); if (scopeSpecification != null){ return scopeSpecification.name(); } return null; } }
[ "sergiotaborda@yahoo.com.br" ]
sergiotaborda@yahoo.com.br
5a7d54c79d0473b47c2ed1c72da8bb62e11aa8aa
684732efc4909172df38ded729c0972349c58b67
/util/src/main/java/net/sf/ahtutils/controller/factory/ejb/tracker/EjbActionTrackerFactory.java
18766101d5066f20c3e4be342a1ed85256fc0821
[]
no_license
aht-group/jeesl
2c4683e8c1e9d9e9698d044c6a89a611b8dfe1e7
3f4bfca6cf33f60549cac23f3b90bf1218c9daf9
refs/heads/master
2023-08-13T20:06:38.593666
2023-08-12T06:59:51
2023-08-12T06:59:51
39,823,889
0
9
null
2022-12-13T18:35:24
2015-07-28T09:06:11
Java
UTF-8
Java
false
false
1,181
java
package net.sf.ahtutils.controller.factory.ejb.tracker; import java.util.Date; import org.jeesl.interfaces.model.io.label.revision.tracker.JeeslActionTracker; import org.jeesl.interfaces.model.system.security.user.JeeslUser; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class EjbActionTrackerFactory<USER extends JeeslUser<?>, T extends JeeslActionTracker<USER>> { final static Logger logger = LoggerFactory.getLogger(EjbActionTrackerFactory.class); final Class<T> clTracker; public static <USER extends JeeslUser<?>, T extends JeeslActionTracker<USER>> EjbActionTrackerFactory<USER,T> createFactory(final Class<T> clTracker) { return new EjbActionTrackerFactory<USER,T>(clTracker); } public EjbActionTrackerFactory(final Class<T> clTracker) { this.clTracker = clTracker; } public T create(USER user) { T ejb = null; try { ejb = clTracker.newInstance(); ejb.setUser(user); ejb.setRecord(new Date()); } catch (InstantiationException e) {e.printStackTrace();} catch (IllegalAccessException e) {e.printStackTrace();} return ejb; } }
[ "t.kisner@web.de" ]
t.kisner@web.de
bb16780cb4e18db405ab2d209c575e0f2915fc12
a47146b21740eb686fa9e48613564a9506ebe280
/transaction-user/src/main/java/com/ly/user/vo/UserVo.java
c09a2b54daaada41ec88abe5331cb3c9f05223db
[]
no_license
gloomysun/distributed-transaction-local-message
44dc7cb59de4f7a58cb5a16ac3b76d693a2dbc24
cab55cf9d219a077ee2b449499aecd9aadb4b7ca
refs/heads/master
2020-04-07T16:21:17.990149
2018-11-21T09:53:31
2018-11-21T09:53:31
158,525,672
0
0
null
null
null
null
UTF-8
Java
false
false
134
java
package com.ly.user.vo; import lombok.Data; @Data public class UserVo { private String username; private String password; }
[ "409575046@qq.com" ]
409575046@qq.com
e40c6a477994092ecc9316714b91bc20902ab1b7
f009dc33f9624aac592cb66c71a461270f932ffa
/src/main/java/com/alipay/api/domain/AlipayDataAiserviceCloudbusSchedualconfigGetModel.java
e8ce412a421a55ccfdd6515748ea449a43f2a384
[ "Apache-2.0" ]
permissive
1093445609/alipay-sdk-java-all
d685f635af9ac587bb8288def54d94e399412542
6bb77665389ba27f47d71cb7fa747109fe713f04
refs/heads/master
2021-04-02T16:49:18.593902
2020-03-06T03:04:53
2020-03-06T03:04:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,060
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-03-02 16:19:31 */ public class AlipayDataAiserviceCloudbusSchedualconfigGetModel extends AlipayObject { private static final long serialVersionUID = 2138936524712317283L; /** * 接口版本号 */ @ApiField("app_version") private String appVersion; /** * 市 */ @ApiField("city_code") private String cityCode; /** * 公交公司id */ @ApiField("corp_id") private String corpId; public String getAppVersion() { return this.appVersion; } public void setAppVersion(String appVersion) { this.appVersion = appVersion; } public String getCityCode() { return this.cityCode; } public void setCityCode(String cityCode) { this.cityCode = cityCode; } public String getCorpId() { return this.corpId; } public void setCorpId(String corpId) { this.corpId = corpId; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
fea1ee6fa0735b6f24dd3ba21195461416d6fa58
269bce0bf0e23f5e5f7b5d31167c8a804b62ae52
/comparator-tools/modagame/MODAGAME_jmetal-source/src.main.java/jmetal/metaheuristics/singleObjective/geneticAlgorithm/GA_main.java
c5c73660cbb53aef28c61a03de1c8f6528469022
[]
no_license
acapulco-spl/acapulco_replication_package
5c4378b7662d6aa10f11f52a9fa8793107b34d6d
7de4d9a96c11977f0cd73d761a4f8af1e0e064e0
refs/heads/master
2023-04-15T17:40:14.003166
2022-04-13T08:37:11
2022-04-13T08:37:11
306,005,002
3
1
null
2022-04-11T17:35:06
2020-10-21T11:39:59
Java
UTF-8
Java
false
false
4,578
java
// GA_main.java // // Author: // Antonio J. Nebro <antonio@lcc.uma.es> // Juan J. Durillo <durillo@lcc.uma.es> // // Copyright (c) 2011 Antonio J. Nebro, Juan J. Durillo // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // 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 Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. package jmetal.metaheuristics.singleObjective.geneticAlgorithm; import jmetal.core.Algorithm; import jmetal.core.Operator; import jmetal.core.Problem; import jmetal.core.SolutionSet; import jmetal.operators.crossover.CrossoverFactory; import jmetal.operators.mutation.MutationFactory; import jmetal.operators.selection.SelectionFactory; import jmetal.problems.singleObjective.OneMax; import jmetal.util.JMException; import java.util.HashMap; /** * This class runs a single-objective genetic algorithm (GA). The GA can be * a steady-state GA (class ssGA), a generational GA (class gGA), a synchronous * cGA (class scGA) or an asynchronous cGA (class acGA). The OneMax * problem is used to test the algorithms. */ public class GA_main { public static void main(String [] args) throws JMException, ClassNotFoundException { Problem problem ; // The problem to solve Algorithm algorithm ; // The algorithm to use Operator crossover ; // Crossover operator Operator mutation ; // Mutation operator Operator selection ; // Selection operator //int bits ; // Length of bit string in the OneMax problem HashMap parameters ; // Operator parameters int bits = 512 ; problem = new OneMax("Binary", bits); //problem = new Sphere("Real", 10) ; //problem = new Easom("Real") ; //problem = new Griewank("Real", 10) ; algorithm = new gGA(problem) ; // Generational GA //algorithm = new ssGA(problem); // Steady-state GA //algorithm = new scGA(problem) ; // Synchronous cGA //algorithm = new acGA(problem) ; // Asynchronous cGA /* Algorithm parameters*/ algorithm.setInputParameter("populationSize",100); algorithm.setInputParameter("maxEvaluations", 25000); /* // Mutation and Crossover for Real codification parameters = new HashMap() ; parameters.put("probability", 0.9) ; parameters.put("distributionIndex", 20.0) ; crossover = CrossoverFactory.getCrossoverOperator("SBXCrossover", parameters); parameters = new HashMap() ; parameters.put("probability", 1.0/problem.getNumberOfVariables()) ; parameters.put("distributionIndex", 20.0) ; mutation = MutationFactory.getMutationOperator("PolynomialMutation", parameters); */ // Mutation and Crossover for Binary codification parameters = new HashMap() ; parameters.put("probability", 0.9) ; crossover = CrossoverFactory.getCrossoverOperator("SinglePointCrossover", parameters); parameters = new HashMap() ; parameters.put("probability", 1.0/bits) ; mutation = MutationFactory.getMutationOperator("BitFlipMutation", parameters); /* Selection Operator */ parameters = null ; selection = SelectionFactory.getSelectionOperator("BinaryTournament", parameters) ; /* Add the operators to the algorithm*/ algorithm.addOperator("crossover",crossover); algorithm.addOperator("mutation",mutation); algorithm.addOperator("selection",selection); /* Execute the Algorithm */ long initTime = System.currentTimeMillis(); SolutionSet population = algorithm.execute(); long estimatedTime = System.currentTimeMillis() - initTime; System.out.println("Total execution time: " + estimatedTime); /* Log messages */ System.out.println("Objectives values have been writen to file FUN"); population.printObjectivesToFile("FUN"); System.out.println("Variables values have been writen to file VAR"); population.printVariablesToFile("VAR"); } //main } // GA_main
[ "daniel_str@gmx.de" ]
daniel_str@gmx.de
5b26ac309ade93af487b923285d1ed0511d0218b
7ef841751c77207651aebf81273fcc972396c836
/cstream/src/main/java/com/loki/cstream/stubs/SampleClass4138.java
941f08119de64d0f115ba98898411bd59bb35f31
[]
no_license
SergiiGrechukha/ModuleApp
e28e4dd39505924f0d36b4a0c3acd76a67ed4118
00e22d51c8f7100e171217bcc61f440f94ab9c52
refs/heads/master
2022-05-07T13:27:37.704233
2019-11-22T07:11:19
2019-11-22T07:11:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
274
java
package com.loki.cstream.stubs; public class SampleClass4138 { private SampleClass4139 sampleClass; public SampleClass4138(){ sampleClass = new SampleClass4139(); } public String getClassName() { return sampleClass.getClassName(); } }
[ "sergey.grechukha@gmail.com" ]
sergey.grechukha@gmail.com
d4073d70660edc1613777f8d3b82a68cca23afbb
a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb
/risk-20160713/src/main/java/com/aliyun/risk20160713/models/QueryNameListForLxResponse.java
5194b9f8625264c9534b3db820660f45fb46ede4
[ "Apache-2.0" ]
permissive
aliyun/alibabacloud-java-sdk
83a6036a33c7278bca6f1bafccb0180940d58b0b
008923f156adf2e4f4785a0419f60640273854ec
refs/heads/master
2023-09-01T04:10:33.640756
2023-09-01T02:40:45
2023-09-01T02:40:45
288,968,318
40
45
null
2023-06-13T02:47:13
2020-08-20T09:51:08
Java
UTF-8
Java
false
false
1,398
java
// This file is auto-generated, don't edit it. Thanks. package com.aliyun.risk20160713.models; import com.aliyun.tea.*; public class QueryNameListForLxResponse extends TeaModel { @NameInMap("headers") @Validation(required = true) public java.util.Map<String, String> headers; @NameInMap("statusCode") @Validation(required = true) public Integer statusCode; @NameInMap("body") @Validation(required = true) public QueryNameListForLxResponseBody body; public static QueryNameListForLxResponse build(java.util.Map<String, ?> map) throws Exception { QueryNameListForLxResponse self = new QueryNameListForLxResponse(); return TeaModel.build(map, self); } public QueryNameListForLxResponse setHeaders(java.util.Map<String, String> headers) { this.headers = headers; return this; } public java.util.Map<String, String> getHeaders() { return this.headers; } public QueryNameListForLxResponse setStatusCode(Integer statusCode) { this.statusCode = statusCode; return this; } public Integer getStatusCode() { return this.statusCode; } public QueryNameListForLxResponse setBody(QueryNameListForLxResponseBody body) { this.body = body; return this; } public QueryNameListForLxResponseBody getBody() { return this.body; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
7b82f00999404679f358f14142d7f43fcd38a383
baba7ae4f32f0e680f084effcd658890183e7710
/MutationFramework/muJava/muJavaMutantStructure/Persistence/openjml/Bag/void_add(int)/AOIS_86/Bag.java
615a7527152fe659d445fcf3dd5e3e686d0ecb0a
[ "Apache-2.0" ]
permissive
TUBS-ISF/MutationAnalysisForDBC-FormaliSE21
75972c823c3c358494d2a2e9ec12e0a00e26d771
de825bc9e743db851f5ec1c5133dca3f04d20bad
refs/heads/main
2023-04-22T21:29:28.165271
2021-05-17T07:43:22
2021-05-17T07:43:22
368,096,901
0
0
null
null
null
null
UTF-8
Java
false
false
2,153
java
// This is a mutant program. // Author : ysma package openjml; /* Solution: */ class Bag { int[] contents; //@ invariant contents != null; int n; //@ invariant 0 <= n; //@ invariant n <= contents.length; Bag( int[] input ) { n = input.length; contents = new int[n]; arraycopy( input, 0, contents, 0, n ); } void removeOnce( int elt ) { //@ loop_invariant 0 <= i && i <= n && n >= 0 && n <= contents.length; // added by DRC for (int i = 0; i < n; i++) { if (contents[i] == elt) { n--; contents[i] = contents[n]; return; } } } void removeAll( int elt ) { //@ loop_invariant i>=0 && i<=n && n >= 0 && n <= contents.length; // DRC modified for (int i = 0; i < n; i++) { if (contents[i] == elt) { n--; contents[i] = contents[n]; i--; } } } //@ ensures \result >= 0; /*@ pure @*/ int getCount(int elt) { int count = 0; /*@ loop_invariant i>=0 && i<=n; @ loop_invariant count >= 0; @*/ for (int i = 0; i < n; i++) { if (contents[i] == elt) { count++; } } return count; } //@ modifies n, contents, contents[*]; // added by DRC void add( int elt ) { if (n == contents.length) { int[] new_contents = new int[2 * n + 1]; arraycopy( contents, 0, new_contents, 0, n ); contents = new_contents; } contents[n] = elt--; n++; } /*@ requires src != null; @ requires srcOff >=0; @ requires dest != null; @ requires destOff >=0; @ requires length >=0; @ requires srcOff + length <= src.length; @ requires destOff + length <= dest.length; @ assignable dest[*]; @*/ private static void arraycopy( int[] src, int srcOff, int[] dest, int destOff, int length ) { /*@ loop_invariant i>=0 && i<=length; @*/ for (int i = 0; i < length; i++) { dest[destOff + i] = src[srcOff + i]; } } }
[ "a.knueppel@tu-bs.de" ]
a.knueppel@tu-bs.de
3919058e2e3efa828231dbac797e297ce252b006
377405a1eafa3aa5252c48527158a69ee177752f
/src/com/biznessapps/events/UploadPhotoUtils$UploadPhotoTextListener.java
5616f045bb81ea99d8c952676782ef08e59b2c14
[]
no_license
apptology/AltFuelFinder
39c15448857b6472ee72c607649ae4de949beb0a
5851be78af47d1d6fcf07f9a4ad7f9a5c4675197
refs/heads/master
2016-08-12T04:00:46.440301
2015-10-25T18:25:16
2015-10-25T18:25:16
44,921,258
0
1
null
null
null
null
UTF-8
Java
false
false
420
java
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.biznessapps.events; // Referenced classes of package com.biznessapps.events: // UploadPhotoUtils public static interface { public abstract void onCancel(); public abstract void onCaptionSelected(String s); }
[ "rich.foreman@apptology.com" ]
rich.foreman@apptology.com
b017df3134d497eff4c3bf7c8be21d283be28dbe
da83d7375a26c10b4f36d50a153ff0f7b0028d2f
/day05_test/Test2.java
4307742154fc3740307b8eaf8c8833065e53736a
[]
no_license
776903455/day01_java
f4953d6873953095aeafb2eeabd969de562d16a7
a9b4d494bd7eb1b189b3ad1da13751f0b94f1f45
refs/heads/master
2020-12-11T08:32:27.855975
2020-01-19T01:16:09
2020-01-19T01:16:09
233,798,874
0
0
null
null
null
null
UTF-8
Java
false
false
481
java
package day05_test; public class Test2 { /*定义一个学生类,老师类,并打印相应方法*/ public static void main(String[] args) { Teacher teacher =new Teacher(); teacher.setAge(30); teacher.setName("周老师"); teacher.setContent("java面向对象"); teacher.eat(); teacher.teach(); Student student =new Student(18,"韩同学","java面向对象"); student.eat(); student.study(); } }
[ "776903455@qq.com" ]
776903455@qq.com
d0de6e58774795d4a261655af7945c568c1085e2
84e3dfdf4e7887c0bc421c0771bb6e3eb5f19ead
/opennlp-distr/target/filtered-md/opennlp-tools/src/main/java/opennlp/tools/postag/POSModel.java
41a2187ce795d99f7ca24ab21f7f6600747c077a
[ "Apache-2.0", "BSD-3-Clause" ]
permissive
shrsv/opennlp-testing
0db621dfc112fe56a1777d90ee53f3adb74c14f4
aad23bcbbedb628dce0e30cf0982a87ff06a5fa9
refs/heads/master
2023-04-23T01:36:18.018271
2020-05-30T23:01:42
2020-05-30T23:01:42
258,618,873
1
0
Apache-2.0
2021-04-26T20:20:05
2020-04-24T20:37:28
HTML
UTF-8
Java
false
false
6,475
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package opennlp.tools.postag; import opennlp.tools.dictionary.Dictionary; import opennlp.tools.ml.BeamSearch; import opennlp.tools.ml.model.MaxentModel; import opennlp.tools.ml.model.SequenceClassificationModel; import opennlp.tools.util.BaseToolFactory; import opennlp.tools.util.InvalidFormatException; import opennlp.tools.util.model.*; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.nio.file.Path; import java.util.Map; import java.util.Objects; import java.util.Properties; /** * The {@link POSModel} is the model used * by a learnable {@link POSTagger}. * * @see POSTaggerME */ public final class POSModel extends BaseModel implements SerializableArtifact { static final String POS_MODEL_ENTRY_NAME = "pos.model"; static final String GENERATOR_DESCRIPTOR_ENTRY_NAME = "generator.featuregen"; private static final String COMPONENT_NAME = "POSTaggerME"; public POSModel(String languageCode, SequenceClassificationModel<String> posModel, Map<String, String> manifestInfoEntries, POSTaggerFactory posFactory) { super(COMPONENT_NAME, languageCode, manifestInfoEntries, posFactory); artifactMap.put(POS_MODEL_ENTRY_NAME, Objects.requireNonNull(posModel, "posModel must not be null")); artifactMap.put(GENERATOR_DESCRIPTOR_ENTRY_NAME, posFactory.getFeatureGenerator()); for (Map.Entry<String, Object> resource : posFactory.getResources().entrySet()) { artifactMap.put(resource.getKey(), resource.getValue()); } // TODO: This fails probably for the sequence model ... ?! // checkArtifactMap(); } public POSModel(String languageCode, MaxentModel posModel, Map<String, String> manifestInfoEntries, POSTaggerFactory posFactory) { this(languageCode, posModel, POSTaggerME.DEFAULT_BEAM_SIZE, manifestInfoEntries, posFactory); } public POSModel(String languageCode, MaxentModel posModel, int beamSize, Map<String, String> manifestInfoEntries, POSTaggerFactory posFactory) { super(COMPONENT_NAME, languageCode, manifestInfoEntries, posFactory); Objects.requireNonNull(posModel, "posModel must not be null"); Properties manifest = (Properties) artifactMap.get(MANIFEST_ENTRY); manifest.setProperty(BeamSearch.BEAM_SIZE_PARAMETER, Integer.toString(beamSize)); artifactMap.put(POS_MODEL_ENTRY_NAME, posModel); artifactMap.put(GENERATOR_DESCRIPTOR_ENTRY_NAME, posFactory.getFeatureGenerator()); for (Map.Entry<String, Object> resource : posFactory.getResources().entrySet()) { artifactMap.put(resource.getKey(), resource.getValue()); } checkArtifactMap(); } public POSModel(InputStream in) throws IOException { super(COMPONENT_NAME, in); } public POSModel(File modelFile) throws IOException { super(COMPONENT_NAME, modelFile); } public POSModel(Path modelPath) throws IOException { this(modelPath.toFile()); } public POSModel(URL modelURL) throws IOException { super(COMPONENT_NAME, modelURL); } @Override protected Class<? extends BaseToolFactory> getDefaultFactory() { return POSTaggerFactory.class; } @Override protected void validateArtifactMap() throws InvalidFormatException { super.validateArtifactMap(); if (!(artifactMap.get(POS_MODEL_ENTRY_NAME) instanceof MaxentModel)) { throw new InvalidFormatException("POS model is incomplete!"); } } /** * @deprecated use getPosSequenceModel instead. This method will be removed soon. * Only required for Parser 1.5.x backward compatibility. Newer models don't need this anymore. */ @Deprecated public MaxentModel getPosModel() { if (artifactMap.get(POS_MODEL_ENTRY_NAME) instanceof MaxentModel) { return (MaxentModel) artifactMap.get(POS_MODEL_ENTRY_NAME); } else { return null; } } public SequenceClassificationModel<String> getPosSequenceModel() { Properties manifest = (Properties) artifactMap.get(MANIFEST_ENTRY); if (artifactMap.get(POS_MODEL_ENTRY_NAME) instanceof MaxentModel) { String beamSizeString = manifest.getProperty(BeamSearch.BEAM_SIZE_PARAMETER); int beamSize = POSTaggerME.DEFAULT_BEAM_SIZE; if (beamSizeString != null) { beamSize = Integer.parseInt(beamSizeString); } return new BeamSearch<>(beamSize, (MaxentModel) artifactMap.get(POS_MODEL_ENTRY_NAME)); } else if (artifactMap.get(POS_MODEL_ENTRY_NAME) instanceof SequenceClassificationModel) { return (SequenceClassificationModel) artifactMap.get(POS_MODEL_ENTRY_NAME); } else { return null; } } public POSTaggerFactory getFactory() { return (POSTaggerFactory) this.toolFactory; } @Override protected void createArtifactSerializers(Map<String, ArtifactSerializer> serializers) { super.createArtifactSerializers(serializers); serializers.put("featuregen", new ByteArraySerializer()); } /** * Retrieves the ngram dictionary. * * @return ngram dictionary or null if not used */ public Dictionary getNgramDictionary() { if (getFactory() != null) return getFactory().getDictionary(); return null; } @Override public Class<POSModelSerializer> getArtifactSerializerClass() { return POSModelSerializer.class; } }
[ "shrijith.sv@gmail.com" ]
shrijith.sv@gmail.com
d4838efc291495665bb4ca98256f9cb6af0ebe10
4abd603f82fdfa5f5503c212605f35979b77c406
/html/Programs/hw4/c3e95560152200831f7fdb0075e85b82/Deques.java
c4dea79e85a7d350be37e68bd67213ba20bcbd90
[]
no_license
dn070017/1042-PDSA
b23070f51946c8ac708d3ab9f447ab8185bd2a34
5e7d7b1b2c9d751a93de9725316aa3b8f59652e6
refs/heads/master
2020-03-20T12:13:43.229042
2018-06-15T01:00:48
2018-06-15T01:00:48
137,424,305
0
0
null
null
null
null
UTF-8
Java
false
false
4,353
java
import java.io.BufferedReader; import java.io.FileReader; import java.util.Iterator; import java.util.NoSuchElementException; public class Deque<Item> implements Iterable<Item> { private Node<Item> first; // top of stack private Node<Item> last; private int N,M; // size of the stack // helper linked list class private static class Node<Item> { private Item item; private Node<Item> next; private Node<Item> previous; } public Deque() // construct an empty deque { first = null; last = null; N = 0; } public boolean isEmpty() { return first == null; } public int size() { return N; } public void addFirst(Item item) // add the item to the front { if(item==null)throw new NullPointerException(); Deque.Node<Item> oldfirst = first; first = new Deque.Node<Item>(); first.item = item; first.next = oldfirst; if(N==0){last=first;} else{ oldfirst.previous = last; } N++; } public void addLast(Item item) // add the item to the end { if(item==null)throw new NullPointerException(); Deque.Node<Item> oldlast = new Deque.Node<Item>(); oldlast = last; last = new Deque.Node<Item>(); last.item = item; if(N==0){first=last;} else{ oldlast.next = last; } last.previous=oldlast; N++; } public Item removeFirst() // remove and return the item from the front { if (isEmpty()) { throw new NoSuchElementException(); } Item item = first.item; // save item to return N--; if (N == 0) { first = null; last = null; }else{ first = first.next; // delete first node first.previous=null; } return item; // return the saved item } public Item removeLast() // remove and return the item from the end { if (isEmpty()) { throw new NoSuchElementException(); } Item item = last.item; // save item to return N--; if (N == 0) { first = null; last = null; }else{ last = last.previous; // delete first node last.next=null; } return item; // return the saved item } @Override public Iterator<Item> iterator() { return new ListIterator<>(first); } private class ListIterator<Item> implements Iterator<Item> { private Deque.Node<Item> current; public ListIterator(Deque.Node<Item> first) { current = first; } @Override public boolean hasNext() { return current != null; } @Override public void remove() { throw new UnsupportedOperationException(); } @Override public Item next() { if (!hasNext()) { throw new NoSuchElementException(); } Item item = current.item; current = current.next; return item; } } public static void main(String[] args) throws Exception { try (BufferedReader br = new BufferedReader(new FileReader(""input.txt""))) { String fund = br.readLine(); String[] cha = fund.split("" ""); Deque d = new Deque(); d.addFirst(cha[0]); d.addFirst(cha[1]); d.addFirst(cha[2]); d.addFirst(cha[3]); d.addLast(cha[4]); d.addLast(cha[5]); d.addLast(cha[6]); d.removeLast(); d.removeLast(); d.removeLast(); d.removeFirst(); Iterator e = d.iterator(); d.M=d.N; while (e.hasNext()&&d.M>0) { d.M--; System.out.println(e.next()); } } } }
[ "dn070017@gmail.com" ]
dn070017@gmail.com
d173c120f681dfb2777945ea4873dc07c1887007
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/18/18_a6db3495ca50b5a01307ec8b29cfed4fc831a28f/MenuState/18_a6db3495ca50b5a01307ec8b29cfed4fc831a28f_MenuState_t.java
599f8622942e7270d56f7011b9e1dd3ecba816ea
[]
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,301
java
package game; import org.newdawn.slick.Color; import org.newdawn.slick.GameContainer; import org.newdawn.slick.Graphics; import org.newdawn.slick.Input; import org.newdawn.slick.SlickException; import org.newdawn.slick.state.BasicGameState; import org.newdawn.slick.state.StateBasedGame; import org.newdawn.slick.state.transition.FadeInTransition; import org.newdawn.slick.state.transition.FadeOutTransition; public class MenuState extends BasicGameState { public static final int ID = 2; @Override public void init(GameContainer gc, StateBasedGame sb) throws SlickException { } @Override public void render(GameContainer gc, StateBasedGame sb, Graphics g) throws SlickException { g.setColor(Color.white); g.drawString("MENU", 350, 100); g.drawString("1. New Game", 350, 200); g.drawString("2. Options", 350, 250); g.drawString("3. Exit", 350, 300); } @Override public void update(GameContainer gc, StateBasedGame sb, int delta) throws SlickException { Input input = gc.getInput(); if (input.isKeyPressed(Input.KEY_ESCAPE)) { sb.enterState(InGameState.ID, new FadeOutTransition(Color.black, 250), null); } } @Override public int getID() { return ID; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
5197b96cc0614379e1f1b0977cead34ccdb520e9
accf6a38581424ef91833968a276d7a0aec5e631
/src/com/hotent/platform/service/ats/AtsShiftTypeService.java
47a9ccef82e54521cc4650a7f8be62582524eb4b
[]
no_license
abgronie/bpm
d79ddf1c00863be45f764d054ebb2cf1dfaa85a3
6323a3180597307d8ccdd51d265750064fcef477
refs/heads/master
2020-12-04T02:38:21.080704
2019-04-11T08:35:26
2019-04-11T08:35:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,360
java
package com.hotent.platform.service.ats; import java.util.List; import javax.annotation.Resource; import org.springframework.stereotype.Service; import com.hotent.core.db.IEntityDao; import com.hotent.core.service.BaseService; import com.hotent.core.util.UniqueIdUtil; import com.hotent.platform.dao.ats.AtsShiftTypeDao; import com.hotent.platform.model.ats.AtsConstant; import com.hotent.platform.model.ats.AtsShiftType; /** *<pre> * 对象功能:班次类型 Service类 * 开发公司:广州宏天软件有限公司 * 开发人员:zxh * 创建时间:2015-05-16 21:44:00 *</pre> */ @Service public class AtsShiftTypeService extends BaseService<AtsShiftType> { @Resource private AtsShiftTypeDao dao; public AtsShiftTypeService() { } @Override protected IEntityDao<AtsShiftType, Long> getEntityDao() { return dao; } /** * 保存 班次类型 信息 * @param atsShiftType */ public void save(AtsShiftType atsShiftType){ Long id=atsShiftType.getId(); if(id==null || id==0){ id=UniqueIdUtil.genId(); atsShiftType.setId(id); atsShiftType.setIsSys(AtsConstant.NO); this.add(atsShiftType); } else{ this.update(atsShiftType); } } public List<AtsShiftType> getListByStatus(Short status) { return dao.getListByStatus(status); } }
[ "2500391980@qq.com" ]
2500391980@qq.com
5d266956b8d9c22b10b38f99f0a465d2300c65e3
e08129cc09d5fa3d7d8bba3e23b3dfde316ddcf9
/projects/openquote/1.4/core/core.ear/lib/core.jar/com/ail/core/Allowable.java
4d1b1baca3f6a40945578eda18351b6732615f5f
[]
no_license
zhangjh953166/open-quote
459dd7b58e7faa8cbb970af30b377c1c1e51c0a2
d0823cff3254293e0031d818bb1289fbbf3e6aa2
refs/heads/master
2020-03-29T05:13:19.380579
2014-10-08T08:52:38
2014-10-08T08:52:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,426
java
/* Copyright Applied Industrial Logic Limited 2002. All rights Reserved */ /* * 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 com.ail.core; import com.ail.annotation.TypeDefinition; import com.ail.core.Type; import java.util.Collection; import java.util.Vector; /** * @version $Revision: 1.3 $ * @state $State: Exp $ * @date $Date: 2005/12/18 17:01:18 $ * @source $Source: /home/bob/CVSRepository/projects/core/core.ear/core.jar/com/ail/core/Allowable.java,v $ * @stereotype type */ @TypeDefinition public class Allowable extends Type { /** * @link aggregationByValue * @clientCardinality 1 * @supplierCardinality 0..* * @directed */ /*# Allowable lnkAllowable; */ private Vector<Allowable> allowable = new Vector<Allowable>(); // field Name private String name = null; // if collection element, type identifier private String typeId = ""; // class name of field private String className = null; /** * Get the className associated with this allowable. * * @return The field className. */ public String getClassName() { return className; } /** * Set the className associated with this allowable * * @param className New field className */ public void setClassName(String className) { this.className = className; } /** * Get the typeId associated with this allowable. * * @return The field typeId. */ public String getTypeId() { return typeId; } /** * Set the typeId associated with this allowable * * @param typeId New field typeId */ public void setTypeId(String typeId) { this.typeId = typeId; } /** * Get the name associated with this allowable. * * @return The field name. */ public String getName() { return name; } /** * Set the name associated with this allowable * * @param name New field name */ public void setName(String name) { this.name = name; } /** * Get the collection of instances of com.ail.core.Allowable associated with this object. * @return A collection of instances of Allowable * @see #setAllowable */ public Collection<Allowable> getAllowable() { return allowable; } /** * Set the collection of instances of com.ail.core.Allowable associated with this object. * @param allowable A collection of instances of Allowable * @see #getAllowable */ public void setAllowable(Collection<Allowable> allowable) { this.allowable = new Vector<Allowable>(allowable); } /** * Get a count of the number of com.ail.core.Allowable instances associated with this object * @return Number of instances */ public int getAllowableCount() { return this.allowable.size(); } /** * Fetch a spacific com.ail.core.Allowable from the collection by index number. * @param i Index of element to return * @return The instance of com.ail.core.Allowable at the specified index */ public Allowable getAllowable(int i) { return (com.ail.core.Allowable) this.allowable.get(i); } /** * Remove the element specified from the list. * @param i Index of element to remove */ public void removeAllowable(int i) { this.allowable.remove(i); } /** * Remove the specified instance of com.ail.core.Allowable from the list. * @param wording Instance to be removed */ public void removeAllowable(Allowable wording) { this.allowable.remove(wording); } /** * Add an instance of com.ail.core.Allowable to the list associated with this object. * @param wording Instance to add to list */ public void addAllowable(Allowable allowable) { this.allowable.add(allowable); } }
[ "dickanderson@22cb28ec-0345-0410-b6dc-f8d001edd02c" ]
dickanderson@22cb28ec-0345-0410-b6dc-f8d001edd02c
ebcbcedc7cb5323ca435f2e158da7022c5ac647e
22f641a3761b59000d89a7c85b79b982c4b7b842
/src/net/test/chapter05_initializeAndCleanup/SimpleEnumUse.java
4dd84236ee0607ad436a8f32b6571b3aaa1df16d
[]
no_license
wuli2496/ThinkingInJava
29074a1dde12e7189cec76ddb63fc9974612916c
ed9c126f9d497043f71f7adce2591dc9c0d4900a
refs/heads/master
2021-01-19T08:04:38.948720
2020-11-28T16:14:52
2020-11-28T16:14:52
87,596,094
0
0
null
null
null
null
UTF-8
Java
false
false
242
java
package net.test.chapter05_initializeAndCleanup; import static net.test.util.Print.*; public class SimpleEnumUse { public static void main(String[] args) { Spiciness howHot = Spiciness.MEDIUM; print(howHot); } }
[ "wuli2496@163.com" ]
wuli2496@163.com
a01229eafacea57a771676f79ee718ce42803d05
5976fada6f069cb52615c0c02b2c989a7657b3cb
/designpattern/src/main/java/abstractfactory_update_update/DataAccess.java
582fb995b96366a9925caccaa81a6545e42a27e5
[]
no_license
cdncn/Code
ca216a7b9256ade05f16f408dfd2e20e555a6172
cf0b72da47156b81e47c4b984b2d7c044c215ba0
refs/heads/master
2022-11-13T11:16:08.109727
2019-07-03T17:01:09
2019-07-03T17:01:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
859
java
package abstractfactory_update_update; /** * @author HT * @version V1.0 * @package abstractfactory_update * @date 2019-05-09 16:17 */ public class DataAccess { private static final String db = "Access"; public static IUser createUser() throws ClassNotFoundException, IllegalAccessException, InstantiationException { IUser result = null; Class clazz = Class.forName("abstractfactory_update_update." + db + "User"); result = (IUser) clazz.newInstance(); return result; } public static IDepartment createDepartment() throws IllegalAccessException, InstantiationException, ClassNotFoundException { IDepartment result = null; Class clazz = Class.forName("abstractfactory_update_update." + db + "Department"); result = (IDepartment) clazz.newInstance(); return result; } }
[ "fengyunhetao@gmail.com" ]
fengyunhetao@gmail.com
d2f9c80f5022363de5ee13cdb0ad35053354831a
e5e048f1716e5d8e92023b6a9d4f80d9e6bd366b
/src/main/java/com/opengamma/analytics/financial/model/option/definition/SimpleChooserOptionDefinition.java
da071cacc44dd64c42aeaa57f756b28ef99241e3
[ "Apache-2.0" ]
permissive
jerome79/Analytics
e4dd03ae9d95a67f7ff36fb75bd5e268b87f2547
71ab1c7a88ed851c50a8de87af000155666f4894
refs/heads/master
2020-04-09T17:24:30.623733
2015-08-17T10:01:27
2015-08-17T10:01:27
42,441,934
1
0
null
2015-09-14T10:19:57
2015-09-14T10:19:56
null
UTF-8
Java
false
false
5,487
java
/** * Copyright (C) 2009 - present by OpenGamma Inc. and the OpenGamma group of companies * * Please see distribution for license. */ package com.opengamma.analytics.financial.model.option.definition; import java.util.Collections; import java.util.Objects; import java.util.Set; import com.opengamma.analytics.financial.greeks.Greek; import com.opengamma.analytics.financial.model.option.pricing.analytic.AnalyticOptionModel; import com.opengamma.analytics.financial.model.option.pricing.analytic.BlackScholesMertonModel; import com.opengamma.analytics.util.time.Expiry; import com.opengamma.strata.collect.ArgChecker; /** * A simple chooser option gives the holder the right to choose whether the * option is to be a standard call or put (both with the same expiry) after a * certain time. The exercise style of the option, once the choice has been * made, is European. * <p> * The payoff of this option is: * $$ * \begin{align*} * \mathrm{payoff} = \max(c_{BSM}(S, K, T_2), p_{BSM}(S, K, T_2)) * \end{align*} * $$ * where $c_{BSM}$ is the general Black-Scholes Merton call price, $c_{BSM}$ is * the general Black-Scholes Merton put price (see {@link BlackScholesMertonModel}), * $K$ is the strike, $S$ is the spot and $T_2$ is the time to expiry of the * underlying option. */ public class SimpleChooserOptionDefinition extends OptionDefinition { /** The payoff function */ private final OptionPayoffFunction<StandardOptionDataBundle> _payoffFunction = new OptionPayoffFunction<StandardOptionDataBundle>() { @SuppressWarnings("synthetic-access") @Override public double getPayoff(final StandardOptionDataBundle data, final Double optionPrice) { ArgChecker.notNull(data, "data"); final double callPrice = BSM.getGreeks(getCallDefinition(), data, GREEKS).get(Greek.FAIR_PRICE); final double putPrice = BSM.getGreeks(getPutDefinition(), data, GREEKS).get(Greek.FAIR_PRICE); return Math.max(callPrice, putPrice); } }; /** The exercise function */ private final OptionExerciseFunction<StandardOptionDataBundle> _exerciseFunction = new EuropeanExerciseFunction<>(); /** The strike of the underlying option */ private final double _underlyingStrike; /** The expiry of the underlying option */ private final Expiry _underlyingExpiry; /** The underlying call */ private final OptionDefinition _callDefinition; /** The underlying put */ private final OptionDefinition _putDefinition; /** Black-Scholes Merton model */ private static final AnalyticOptionModel<OptionDefinition, StandardOptionDataBundle> BSM = new BlackScholesMertonModel(); /** The greeks that can be computed */ private static final Set<Greek> GREEKS = Collections.singleton(Greek.FAIR_PRICE); /** * @param chooseDate The date when the choice is to be made (i.e. the chooser option expiry) * @param underlyingStrike The strike of the underlying option * @param underlyingExpiry The expiry of the underlying European option */ public SimpleChooserOptionDefinition(final Expiry chooseDate, final double underlyingStrike, final Expiry underlyingExpiry) { super(null, chooseDate, null); ArgChecker.notNull(underlyingExpiry, "underlyingExpiry"); ArgChecker.isTrue(underlyingStrike > 0, "underlying strike"); if (underlyingExpiry.getExpiry().isBefore(chooseDate.getExpiry())) { throw new IllegalArgumentException("Underlying option expiry must be after the choice date"); } _underlyingStrike = underlyingStrike; _underlyingExpiry = underlyingExpiry; _callDefinition = new EuropeanVanillaOptionDefinition(underlyingStrike, underlyingExpiry, true); _putDefinition = new EuropeanVanillaOptionDefinition(underlyingStrike, underlyingExpiry, false); } /** * @return The underlying call definition */ public OptionDefinition getCallDefinition() { return _callDefinition; } /** * @return The underlying put definition */ public OptionDefinition getPutDefinition() { return _putDefinition; } /** * @return The strike of the underlying option */ public double getUnderlyingStrike() { return _underlyingStrike; } /** * @return The expiry of the underlying option */ public Expiry getUnderlyingExpiry() { return _underlyingExpiry; } /** * {@inheritDoc} */ @Override public OptionExerciseFunction<StandardOptionDataBundle> getExerciseFunction() { return _exerciseFunction; } /** * {@inheritDoc} */ @Override public OptionPayoffFunction<StandardOptionDataBundle> getPayoffFunction() { return _payoffFunction; } @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((_underlyingExpiry == null) ? 0 : _underlyingExpiry.hashCode()); long temp; temp = Double.doubleToLongBits(_underlyingStrike); result = prime * result + (int) (temp ^ (temp >>> 32)); return result; } @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } if (getClass() != obj.getClass()) { return false; } final SimpleChooserOptionDefinition other = (SimpleChooserOptionDefinition) obj; if (Double.doubleToLongBits(_underlyingStrike) != Double.doubleToLongBits(other._underlyingStrike)) { return false; } return Objects.equals(_underlyingExpiry, other._underlyingExpiry); } }
[ "stephen@opengamma.com" ]
stephen@opengamma.com
af07dcd627f1ba343b472dfba88cc147a905a330
77cd5868df1b0f18de6fd75a0db1e44612ab5b0a
/src/main/java/nc/handler/DungeonLootHandler.java
5404d865f1e09b9da79d13d02e8edaf8ef15face
[ "CC0-1.0" ]
permissive
sanrom/NuclearCraft
445bc631ad503b4014c828c6ac48176ad384ff3a
c8fc8ab87e8940a95c8de7efe84faac233de07ee
refs/heads/master
2022-12-22T07:22:49.917786
2020-09-26T14:59:40
2020-09-26T14:59:40
274,776,780
3
1
null
2020-07-16T17:46:03
2020-06-24T21:53:53
Java
UTF-8
Java
false
false
4,886
java
package nc.handler; import static nc.config.NCConfig.dungeon_loot; import nc.Global; import nc.init.NCItems; import net.minecraft.world.storage.loot.*; import net.minecraft.world.storage.loot.conditions.LootCondition; import net.minecraft.world.storage.loot.functions.*; import net.minecraftforge.event.LootTableLoadEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; public class DungeonLootHandler { @SubscribeEvent public void onLootTableLoad(LootTableLoadEvent event) { if (event.getName() != null && event.getTable() != null) { LootCondition[] noCondition = new LootCondition[0]; LootPool pool = event.getTable().getPool("main"); if (pool == null) { pool = new LootPool(new LootEntry[0], noCondition, new RandomValueRange(5, 10), new RandomValueRange(0), "main"); event.getTable().addPool(pool); } // boolean addPlating = false; // boolean addSolenoids = false; // boolean addMachinery = false; boolean addOther = false; if (dungeon_loot) { if (LootTableList.CHESTS_SIMPLE_DUNGEON.equals(event.getName())) { // addPlating = true; // addMachinery = true; addOther = true; } else if (LootTableList.CHESTS_ABANDONED_MINESHAFT.equals(event.getName())) { // addPlating = true; // addMachinery = true; } else if (LootTableList.CHESTS_VILLAGE_BLACKSMITH.equals(event.getName())) { // addPlating = true; // addSolenoids = true; addOther = true; } else if (LootTableList.CHESTS_STRONGHOLD_LIBRARY.equals(event.getName())) { addOther = true; } else if (LootTableList.CHESTS_STRONGHOLD_CROSSING.equals(event.getName())) { // addPlating = true; // addSolenoids = true; // addMachinery = true; } else if (LootTableList.CHESTS_STRONGHOLD_CORRIDOR.equals(event.getName())) { // addPlating = true; // addSolenoids = true; // addMachinery = true; } else if (LootTableList.CHESTS_IGLOO_CHEST.equals(event.getName())) { // addSolenoids = true; // addMachinery = true; } else if (LootTableList.CHESTS_DESERT_PYRAMID.equals(event.getName())) { // addSolenoids = true; addOther = true; } else if (LootTableList.CHESTS_NETHER_BRIDGE.equals(event.getName())) { // addPlating = true; // addSolenoids = true; // addMachinery = true; } else if (LootTableList.CHESTS_END_CITY_TREASURE.equals(event.getName())) { // addPlating = true; // addSolenoids = true; // addMachinery = true; } else if (LootTableList.CHESTS_WOODLAND_MANSION.equals(event.getName())) { addOther = true; } else if (LootTableList.CHESTS_JUNGLE_TEMPLE.equals(event.getName())) { // addPlating = true; // addSolenoids = true; // addMachinery = true; } } /* if (addPlating) { pool.addEntry(new LootEntryItem(NCItems.part, 15, 0, lootFunctions(0, 3, 3, 6), noCondition, Global.MOD_ID + ":plating")); } * * if (addSolenoids) { pool.addEntry(new LootEntryItem(NCItems.part, 15, 0, lootFunctions(4, 5, 4, 8), noCondition, Global.MOD_ID + ":solenoids")); } * * if (addMachinery) { pool.addEntry(new LootEntryItem(NCItems.part, 20, 0, lootFunctions(7, 9, 2, 4), noCondition, Global.MOD_ID + ":machinery")); } */ if (addOther) { pool.addEntry(new LootEntryItem(NCItems.dominos, 3, 0, lootFunctions(0, 0, 2, 4), noCondition, Global.MOD_ID + ":dominos")); pool.addEntry(new LootEntryItem(NCItems.milk_chocolate, 4, 0, lootFunctions(0, 0, 2, 4), noCondition, Global.MOD_ID + ":milk_chocolate")); pool.addEntry(new LootEntryItem(NCItems.marshmallow, 4, 0, lootFunctions(0, 0, 2, 4), noCondition, Global.MOD_ID + ":marshmallow")); pool.addEntry(new LootEntryItem(NCItems.smore, 3, 0, lootFunctions(0, 0, 2, 4), noCondition, Global.MOD_ID + ":smore")); pool.addEntry(new LootEntryItem(NCItems.record_end_of_the_world, 3, 0, lootFunctions(0, 0, 1, 1), noCondition, Global.MOD_ID + ":record_end_of_the_world")); pool.addEntry(new LootEntryItem(NCItems.record_money_for_nothing, 3, 0, lootFunctions(0, 0, 1, 1), noCondition, Global.MOD_ID + ":record_money_for_nothing")); pool.addEntry(new LootEntryItem(NCItems.record_wanderer, 3, 0, lootFunctions(0, 0, 1, 1), noCondition, Global.MOD_ID + ":record_wanderer")); pool.addEntry(new LootEntryItem(NCItems.record_hyperspace, 3, 0, lootFunctions(0, 0, 1, 1), noCondition, Global.MOD_ID + ":record_hyperspace")); } } } private static LootFunction[] lootFunctions(float metaMin, float metaMax, float countMin, float countMax) { LootCondition[] noCondition = new LootCondition[0]; LootFunction damage = new SetMetadata(noCondition, new RandomValueRange(metaMin, metaMax)); LootFunction amount = new SetCount(noCondition, new RandomValueRange(countMin, countMax)); return new LootFunction[] {damage, amount}; } }
[ "joedodd35@gmail.com" ]
joedodd35@gmail.com
3fae674127dcbf43a92deccd51e298c490ae1443
a31913790a5aa5e88900a5d059727fbf55fc844d
/bundles/at.bestsolution.dart.server.api/src-gen/at/bestsolution/dart/server/api/model/Position.java
1c95c1df0640eb82ea7ad47440a7a1f725138b54
[]
no_license
BestSolution-at/dartedit
a12e7b4b798423e2f5e8f2fc3d1e46e22817f17c
4aa7f55735948d961d3d2466ea3f55203ed66313
refs/heads/master
2020-04-05T14:03:07.237484
2016-09-16T08:47:10
2016-09-16T08:47:10
39,617,841
1
1
null
null
null
null
UTF-8
Java
false
false
531
java
package at.bestsolution.dart.server.api.model; import java.util.Map; public class Position { private java.lang.String file ; private int offset ; public Position() { } public java.lang.String getFile() { return this.file; } public void setFile(java.lang.String file) { this.file = file; } public int getOffset() { return this.offset; } public void setOffset(int offset) { this.offset = offset; } public String toString() { return "Position@"+hashCode()+"[file = "+file+", offset = "+offset+"]"; } }
[ "tom.schindl@bestsolution.at" ]
tom.schindl@bestsolution.at
b4cd21d382b6713820abf30c1e3b217015238ad4
064875f6746ff611f142c44c2e19deadbcb94b36
/core/src/main/java/net/firejack/platform/core/utils/OpenFlameSpringContext.java
9aa53d66ed2bdc9a157dd34acb9f78eca0d187aa
[ "Apache-2.0" ]
permissive
alim-firejack/Firejack-Platform
d7faeb35091c042923e698d598d0118f3f4b0c11
bc1f58d425d91425cfcd6ab4fb6b1eed3fe0b815
refs/heads/master
2021-01-15T09:23:05.489281
2014-02-27T17:39:25
2014-02-27T17:39:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,974
java
/* * Firejack Open Flame - Copyright (c) 2012 Firejack Technologies * * This source code is the product of the Firejack Technologies * Core Technologies Team (Benjamin A. Miller, Oleg Marshalenko, and Timur * Asanov) and licensed only under valid, executed license agreements * between Firejack Technologies and its customers. Modification and / or * re-distribution of this source code is allowed only within the terms * of an executed license agreement. * * Any modification of this code voids any and all warranties and indemnifications * for the component in question and may interfere with upgrade path. Firejack Technologies * encourages you to extend the core framework and / or request modifications. You may * also submit and assign contributions to Firejack Technologies for consideration * as improvements or inclusions to the platform to restore modification * warranties and indemnifications upon official re-distributed in patch or release form. */ package net.firejack.platform.core.utils; import org.springframework.beans.BeansException; import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.stereotype.Component; import java.util.ArrayList; import java.util.List; import java.util.Map; @Component public class OpenFlameSpringContext implements ApplicationContextAware { private static ApplicationContext context; @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { context = applicationContext; } /** * @return */ public static ApplicationContext getContext() { return context; } /** * @param beanName * @return */ public static <T> T getBean(String beanName) { if (context == null) throw new NoSuchBeanDefinitionException("Context not initialized"); return (T) context.getBean(beanName); } /** * @param clazz * @return */ public static <T> T getBean(Class<T> clazz) { return context.getBean(clazz); } /** * @param clazz * @return */ public static <T> Map<String, T> getBeans(Class<T> clazz) { return context.getBeansOfType(clazz); } public static <T> List<T> getBeansByClass(Class<T> clazz) { return new ArrayList<T>(context.getBeansOfType(clazz).values()); } public static void addSingleton(String name, Object bean) { ConfigurableListableBeanFactory factory = ((ConfigurableApplicationContext) context).getBeanFactory(); if (!factory.containsSingleton(name)) { factory.registerSingleton(name, bean); } } }
[ "CF8DCmPgvS" ]
CF8DCmPgvS
03a4c906a74a6839f85c1e123b5727865972ba4e
af73e7c07e708d531709a056b2e01857c0e4b3fc
/src/main/java/com/dj/mobile/config/LocaleConfiguration.java
d62be41e207d8df82b2a941a40685f0967d11aa7
[]
no_license
BulkSecurityGeneratorProject/djMobile
8c287e23bc5da02c85e059e6bc7d3daa253d9358
e7a0f833cbc87f93f9666c22c7526759898c79cf
refs/heads/master
2022-12-24T16:22:03.940949
2019-01-02T06:50:20
2019-01-02T06:50:20
296,708,780
0
0
null
2020-09-18T19:10:05
2020-09-18T19:10:04
null
UTF-8
Java
false
false
1,056
java
package com.dj.mobile.config; import io.github.jhipster.config.locale.AngularCookieLocaleResolver; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.LocaleResolver; import org.springframework.web.servlet.config.annotation.*; import org.springframework.web.servlet.i18n.LocaleChangeInterceptor; @Configuration public class LocaleConfiguration implements WebMvcConfigurer { @Bean(name = "localeResolver") public LocaleResolver localeResolver() { AngularCookieLocaleResolver cookieLocaleResolver = new AngularCookieLocaleResolver(); cookieLocaleResolver.setCookieName("NG_TRANSLATE_LANG_KEY"); return cookieLocaleResolver; } @Override public void addInterceptors(InterceptorRegistry registry) { LocaleChangeInterceptor localeChangeInterceptor = new LocaleChangeInterceptor(); localeChangeInterceptor.setParamName("language"); registry.addInterceptor(localeChangeInterceptor); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
a4b4c6c298a2c6ee0c12105175c8238d762c3f06
57d7801f31d911cde6570e3e513e43fb33f2baa3
/src/main/java/nl/strohalm/cyclos/services/sms/exceptions/SmsContextInitializationException.java
522780c46a76467081649968243ee2479b36b0de
[]
no_license
kryzoo/cyclos
61f7f772db45b697fe010f11c5e6b2b2e34a8042
ead4176b832707d4568840e38d9795d7588943c8
refs/heads/master
2020-04-29T14:50:20.470400
2011-12-09T11:51:05
2011-12-09T11:51:05
54,712,705
0
1
null
2016-03-25T10:41:41
2016-03-25T10:41:41
null
UTF-8
Java
false
false
1,842
java
/* This file is part of Cyclos <http://project.cyclos.org> Cyclos is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Cyclos 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 Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with Cyclos. If not, see <http://www.gnu.org/licenses/>. */ package nl.strohalm.cyclos.services.sms.exceptions; import nl.strohalm.cyclos.entities.groups.MemberGroup; import nl.strohalm.cyclos.exceptions.ApplicationException; public class SmsContextInitializationException extends ApplicationException { private static final long serialVersionUID = 1L; private String smsContextClassName; private MemberGroup group; public SmsContextInitializationException(final MemberGroup group, final String smsContextClassName, final String message) { this(group, smsContextClassName, message, null); } public SmsContextInitializationException(final MemberGroup group, final String smsContextClassName, final String message, final Throwable cause) { super(message, cause); this.smsContextClassName = smsContextClassName; this.group = group; } @Override public String getMessage() { return "Group: " + group.getName() + ". Context impl: " + smsContextClassName + ". Error: " + super.getMessage(); } public String getSmsContextClassName() { return smsContextClassName; } }
[ "mpr@touk.pl" ]
mpr@touk.pl
142a2ab95c80c98704a64444677eaa6dfe1612c1
ceed8ee18ab314b40b3e5b170dceb9adedc39b1e
/android/external/sl4a/Common/src/com/googlecode/android_scripting/FeaturedInterpreters.java
005560bd98679a7c738794427fa109437e874656
[]
no_license
BPI-SINOVOIP/BPI-H3-New-Android7
c9906db06010ed6b86df53afb6e25f506ad3917c
111cb59a0770d080de7b30eb8b6398a545497080
refs/heads/master
2023-02-28T20:15:21.191551
2018-10-08T06:51:44
2018-10-08T06:51:44
132,708,249
1
1
null
null
null
null
UTF-8
Java
false
false
4,204
java
/* * Copyright (C) 2016 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package com.googlecode.android_scripting; import android.content.Context; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; public class FeaturedInterpreters { private static final Map<String, FeaturedInterpreter> mNameMap = new HashMap<String, FeaturedInterpreter>(); private static final Map<String, FeaturedInterpreter> mExtensionMap = new HashMap<String, FeaturedInterpreter>(); static { try { FeaturedInterpreter interpreters[] = { new FeaturedInterpreter("BeanShell 2.0b4", ".bsh", "http://android-scripting.googlecode.com/files/beanshell_for_android_r2.apk"), new FeaturedInterpreter("JRuby", ".rb", "https://github.com/downloads/ruboto/sl4a_jruby_interpreter/JRubyForAndroid_r2dev.apk"), new FeaturedInterpreter("Lua 5.1.4", ".lua", "http://android-scripting.googlecode.com/files/lua_for_android_r1.apk"), new FeaturedInterpreter("Perl 5.10.1", ".pl", "http://android-scripting.googlecode.com/files/perl_for_android_r1.apk"), new FeaturedInterpreter("Python 2.6.2", ".py", "http://python-for-android.googlecode.com/files/PythonForAndroid_r5.apk"), new FeaturedInterpreter("Rhino 1.7R2", ".js", "http://android-scripting.googlecode.com/files/rhino_for_android_r2.apk"), new FeaturedInterpreter("PHP 5.3.3", ".php", "http://php-for-android.googlecode.com/files/phpforandroid_r1.apk") }; for (FeaturedInterpreter interpreter : interpreters) { mNameMap.put(interpreter.mmName, interpreter); mExtensionMap.put(interpreter.mmExtension, interpreter); } } catch (MalformedURLException e) { Log.e(e); } } public static List<String> getList() { ArrayList<String> list = new ArrayList<String>(mNameMap.keySet()); Collections.sort(list); return list; } public static URL getUrlForName(String name) { if (!mNameMap.containsKey(name)) { return null; } return mNameMap.get(name).mmUrl; } public static String getInterpreterNameForScript(String fileName) { String extension = getExtension(fileName); if (extension == null || !mExtensionMap.containsKey(extension)) { return null; } return mExtensionMap.get(extension).mmName; } public static boolean isSupported(String fileName) { String extension = getExtension(fileName); return (extension != null) && (mExtensionMap.containsKey(extension)); } public static int getInterpreterIcon(Context context, String key) { String packageName = context.getPackageName(); String name = "_icon"; if (key.contains(".")) { name = key.substring(key.lastIndexOf('.') + 1) + name; } else { name = key + name; } return context.getResources().getIdentifier(name, "drawable", packageName); } private static String getExtension(String fileName) { int dotIndex = fileName.lastIndexOf('.'); if (dotIndex == -1) { return null; } return fileName.substring(dotIndex); } private static class FeaturedInterpreter { private final String mmName; private final String mmExtension; private final URL mmUrl; private FeaturedInterpreter(String name, String extension, String url) throws MalformedURLException { mmName = name; mmExtension = extension; mmUrl = new URL(url); } } }
[ "Justin" ]
Justin
d889d0d772848fc0aaf20481f94ab2dea4a571ef
fd478bb2fcfdc1fa479f2d7bb59c7c1dd82ad059
/src/main/java/com/aqetest/myapp/service/InvalidPasswordException.java
115e7134f0f526c29e441b1d4635a8739537217f
[]
no_license
HappyCompilerMaking/jhipsteraqetestapplication
25044b23b4161326175a313c2a24ccb4e902e657
e2d3c77a7be30d51e8489dd11cad6ddc7a3b48dc
refs/heads/master
2022-12-22T06:44:02.930194
2019-09-18T17:28:25
2019-09-18T17:28:25
209,366,540
0
0
null
2022-12-16T05:05:44
2019-09-18T17:28:11
Java
UTF-8
Java
false
false
188
java
package com.aqetest.myapp.service; public class InvalidPasswordException extends RuntimeException { public InvalidPasswordException() { super("Incorrect password"); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
0e7d279a4440e12055ea3b384f18162a32a4f3e7
ee829d74c1c8ef4e0da952851add2d30c601fa65
/src/tw/brad/bradjava/Bike2.java
8f0192a2179bae52d120b2b86a2b8de9167157e1
[]
no_license
mesa5/bradjava
9a7adcc21ad5610d9371af197c3bc7a4a0395c1e
80e57d1ec0d3f2d6993c49f97e5499fb253dd13e
refs/heads/master
2020-05-21T23:48:18.803986
2016-09-25T02:46:00
2016-09-25T02:46:00
65,650,464
0
0
null
null
null
null
UTF-8
Java
false
false
481
java
package tw.brad.bradjava; class Bike2 { // Field private double speed; static int count; // Constructor public Bike2(){ count++; speed = 1; System.out.println("Bike():" + speed); } void Bike(){ } // Method void upSpeed(){ speed = speed<1?1:speed*1.2; } void downSpeed(){ speed = speed<1?0:speed*0.7; } double getSpeed(){ return speed; } @Override public String toString() { return "Brad's Bike"; } }
[ "brad@brad.tw" ]
brad@brad.tw
676d7843284531bdb0feedc4e6d2835f94cf04d7
11845d52eb308b5702331863e4106f10794b83dc
/restapp11-spring-data/src/main/java/com/bookapp/ResourceNotFoundException.java
7f8a5567e8176cd8bc4e1bb27dcdb0ea182723f2
[]
no_license
rgupta00/spring-boot-ymsli-code
750380be0ac36b838e0c077f982985a1bcbfe79c
db027497b5a5b4ea5b7017656f23cc9db9e8ef41
refs/heads/master
2023-03-13T06:00:50.261388
2021-03-01T10:42:39
2021-03-01T10:42:39
341,398,523
0
2
null
null
null
null
UTF-8
Java
false
false
160
java
package com.bookapp; public class ResourceNotFoundException extends RuntimeException { private static final long serialVersionUID = -2054642051415045948L; }
[ "rgupta.mtech@gmail.com" ]
rgupta.mtech@gmail.com
0d24191faf9da4697e66a38385527545c01587e0
77ad52172e4d2982b59becc9d4005b85b1de76be
/src/main/java/com/kkhenissi/fidecooin/security/UserNotActivatedException.java
4e1ed937a720f35c1ee30e738b62834c432ab743
[]
no_license
BulkSecurityGeneratorProject/mongoAngularSpringBootAppn
f90b3754e5ae4cf74f82da17116940839ce9caa8
dd316533ea2ef2189eca8ca7c497ba837ac8b4a5
refs/heads/master
2022-12-31T07:45:52.264075
2019-05-19T19:15:23
2019-05-19T19:15:23
296,573,769
0
0
null
2020-09-18T09:19:49
2020-09-18T09:19:48
null
UTF-8
Java
false
false
519
java
package com.kkhenissi.fidecooin.security; import org.springframework.security.core.AuthenticationException; /** * This exception is thrown in case of a not activated user trying to authenticate. */ public class UserNotActivatedException extends AuthenticationException { private static final long serialVersionUID = 1L; public UserNotActivatedException(String message) { super(message); } public UserNotActivatedException(String message, Throwable t) { super(message, t); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
c9d1a36473b9ad13ff87e36d27f96593fd4f92e6
cfe033f1a111823bb6fb198eaf28e85f9d6a5e3b
/UI界面/主界面/上海——黄埔微门户/UI_MainView_SHHP/src/com/and/netease/SHHP_MainView.java
c90d2d65c4eed78c2bf04b1b0170cc5719c3f5d5
[]
no_license
uusoft/Android_UI
ac0021a1c81c6e23f7d1373250adbebce080fca8
7bec95d611c0a46857fd1d02b4ac979a55cf04b8
refs/heads/master
2021-01-17T22:52:33.254006
2014-01-23T15:25:13
2014-01-23T15:25:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,029
java
package com.and.netease; import android.app.TabActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.TabHost; public class SHHP_MainView extends TabActivity implements OnClickListener { TabHost tabHost; TabHost.TabSpec tabSpec; public static String JRHP = "JRHP"; public static String HPYW = "HPYW"; public static String CSMP = "CSMP"; public static String MORE = "MORE"; Button hpywButton; Button jrhpButton; Button csmpButton; Button moreButton; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.shhp_main); initUI(); } private void initUI() { tabHost = getTabHost(); tabHost.addTab(tabHost.newTabSpec(HPYW).setIndicator(HPYW) .setContent(new Intent(this, SHHP_Tab_HPYWView.class))); tabHost.addTab(tabHost.newTabSpec(JRHP).setIndicator(JRHP) .setContent(new Intent(this, SHHP_Tab_JRHPView.class))); tabHost.addTab(tabHost.newTabSpec(CSMP).setIndicator(CSMP) .setContent(new Intent(this, SHHP_Tab_CSMPView.class))); tabHost.addTab(tabHost.newTabSpec(MORE).setIndicator(MORE) .setContent(new Intent(this, SHHP_Tab_MoreView.class))); hpywButton = (Button) findViewById(R.id.bottom_buttom_hpyw); jrhpButton = (Button) findViewById(R.id.bottom_buttom_jrhp); csmpButton = (Button) findViewById(R.id.bottom_buttom_csmp); moreButton = (Button) findViewById(R.id.bottom_buttom_more); hpywButton.setOnClickListener(this); jrhpButton.setOnClickListener(this); csmpButton.setOnClickListener(this); moreButton.setOnClickListener(this); } @Override public void onClick(View v) { if (v == hpywButton) { tabHost.setCurrentTabByTag(HPYW); } else if (v == jrhpButton) { tabHost.setCurrentTabByTag(JRHP); } else if (v == csmpButton) { tabHost.setCurrentTabByTag(CSMP); } else if (v == moreButton) { tabHost.setCurrentTabByTag(MORE); } } }
[ "ww1095@163.com" ]
ww1095@163.com
5ee4046a02987b9adcce9b18270715f0ec421edf
b15eebd783330da7d5fcb7ac2b10e88e9f8a54dd
/trunk/mybento/src/main/java/dto/YearMonthData.java
0f34bf202a8e43b8306de014461fab611f5c5e60
[]
no_license
BGCX067/f0rth-svn-to-git
6f43842b2c1fd0fda739e5e3977c4b2847e17c5d
96b8743f93e3e413fed7be21145846c699cf394f
refs/heads/master
2016-09-01T08:52:31.923805
2015-12-28T14:17:52
2015-12-28T14:17:52
48,872,131
0
0
null
null
null
null
UTF-8
Java
false
false
358
java
package dto; import java.io.Serializable; public class YearMonthData implements Serializable { private int yearMonth; public YearMonthData(int yearMonth) { this.yearMonth = yearMonth; } public int getYearMonth() { return yearMonth; } public int getYear() { return yearMonth / 100; } public int getMonth() { return yearMonth % 100; } }
[ "you@example.com" ]
you@example.com
e821abeacafa7ff55de04e409672630d513768b5
a4178e5042f43f94344789794d1926c8bdba51c0
/iwxxmCore/src/test/resources/iwxxm/2.1/org/isotc211/_2005/gmd/DQFormatConsistencyType.java
e42d8db6cd661daa9c7bd07a9486c76716f8ee93
[ "Apache-2.0" ]
permissive
moryakovdv/iwxxmConverter
c6fb73bc49765c4aeb7ee0153cca04e3e3846ab0
5c2b57e57c3038a9968b026c55e381eef0f34dad
refs/heads/master
2023-07-20T06:58:00.317736
2023-07-05T10:10:10
2023-07-05T10:10:10
128,777,786
11
7
Apache-2.0
2023-07-05T10:03:12
2018-04-09T13:38:59
Java
UTF-8
Java
false
false
1,140
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2018.02.27 at 12:33:13 PM MSK // package org.isotc211._2005.gmd; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for DQ_FormatConsistency_Type complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="DQ_FormatConsistency_Type"> * &lt;complexContent> * &lt;extension base="{http://www.isotc211.org/2005/gmd}AbstractDQ_LogicalConsistency_Type"> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "DQ_FormatConsistency_Type") public class DQFormatConsistencyType extends AbstractDQLogicalConsistencyType { }
[ "moryakovdv@gmail.com" ]
moryakovdv@gmail.com
44410b6722cbe98d2c759517ecf077a0a4438192
fc022277b72f2fcfce27df66a2e9fa4623b8b461
/src/main/java/nl/elec332/sdr/lib/SDRLibrary.java
a9c5e260dd32db6c74a135c28f6a368079605bee
[]
no_license
JavaSDR/JavaSDRLib
400ca65f8eb36282a45947e5e742bfc79e056568
add0cb208364b3c542943c0eb31842b8e5788659
refs/heads/master
2021-05-18T00:38:36.882976
2020-04-22T16:19:45
2020-04-22T16:19:45
251,027,301
1
0
null
null
null
null
UTF-8
Java
false
false
2,315
java
package nl.elec332.sdr.lib; import nl.elec332.sdr.lib.api.IExtensionManager; import nl.elec332.sdr.lib.api.ISDRLibrary; import nl.elec332.sdr.lib.api.ISourceManager; import nl.elec332.sdr.lib.api.SDRLibraryAPI; import nl.elec332.sdr.lib.api.datastream.IDataSource; import nl.elec332.sdr.lib.api.datastream.IPipeline; import nl.elec332.sdr.lib.api.source.IInputSource; import nl.elec332.sdr.lib.api.util.IDataConverterFactory; import nl.elec332.sdr.lib.datastream.PipelineHelper; import nl.elec332.sdr.lib.source.CachedDataConverterFactory; import nl.elec332.sdr.lib.source.DynamicDataConverterFactory; import java.lang.reflect.Field; import java.util.function.Supplier; /** * Created by Elec332 on 5-4-2020 */ public class SDRLibrary implements ISDRLibrary { private SDRLibrary() { if (instance != null) { throw new UnsupportedOperationException(); } } private static SDRLibrary instance; public static SDRLibrary getInstance() { load(); return instance; } public static void load() { if (instance == null) { instance = new SDRLibrary(); ExtensionManager.load(); SourceManager.load(); } } @Override public IExtensionManager getExtensionManager() { return ExtensionManager.INSTANCE; } @Override public ISourceManager getSourceManager() { return SourceManager.INSTANCE; } @Override public IDataConverterFactory getCachedDataConverterFactory() { return CachedDataConverterFactory.INSTANCE; } @Override public IDataConverterFactory getDynamicDataConverterFactory() { return DynamicDataConverterFactory.INSTANCE; } @Override public IPipeline createPipeline(IInputSource<?> source) { return PipelineHelper.createPipeline(source); } @Override public IPipeline createPipeline(IDataSource source) { return PipelineHelper.createPipeline(source); } static { try { Field f = SDRLibraryAPI.class.getDeclaredField("implGetter"); f.setAccessible(true); f.set(null, (Supplier<ISDRLibrary>) SDRLibrary::getInstance); } catch (Exception e) { System.out.println("Failed to inject API"); } } }
[ "arnout1998@gmail.com" ]
arnout1998@gmail.com
95c53a2e374dff87c5f6d9515278307319977c27
ec2b811cf4c24f8412eb0b65e43bc44e315015ef
/core/src/test/java/com/dtolabs/rundeck/core/execution/service/TestFileCopierService.java
c90dd660f943bbecf15b79d69607fd8cf73d9b40
[ "Apache-2.0" ]
permissive
cjpetrus/rundeck
e6cd2e3f374bcc6af871a9a071b96c5b632494af
4df51911cdde6f8393b82073eddb183dde768f1b
refs/heads/master
2020-05-26T00:38:17.217612
2016-07-10T04:41:32
2016-07-10T04:41:32
62,974,110
1
0
null
2016-07-10T04:41:34
2016-07-10T00:04:04
Groovy
UTF-8
Java
false
false
4,409
java
/* * Copyright 2011 DTO Solutions, Inc. (http://dtosolutions.com) * * 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. */ /* * TestFileCopierService.java * * User: Greg Schueler <a href="mailto:greg@dtosolutions.com">greg@dtosolutions.com</a> * Created: 3/24/11 3:05 PM * */ package com.dtolabs.rundeck.core.execution.service; import com.dtolabs.rundeck.core.common.Framework; import com.dtolabs.rundeck.core.common.FrameworkProject; import com.dtolabs.rundeck.core.common.IRundeckProject; import com.dtolabs.rundeck.core.common.NodeEntryImpl; import com.dtolabs.rundeck.core.execution.impl.jsch.JschScpFileCopier; import com.dtolabs.rundeck.core.execution.impl.local.LocalFileCopier; import com.dtolabs.rundeck.core.tools.AbstractBaseTest; import com.dtolabs.rundeck.core.utils.FileUtils; import java.io.File; import java.io.IOException; import java.util.*; /** * TestFileCopierService is ... * * @author Greg Schueler <a href="mailto:greg@dtosolutions.com">greg@dtosolutions.com</a> */ public class TestFileCopierService extends AbstractBaseTest { private static final String PROJ_NAME = "TestFileCopierService"; public TestFileCopierService(String name) { super(name); } public void setUp() { super.setUp(); final Framework frameworkInstance = getFrameworkInstance(); final IRundeckProject frameworkProject = frameworkInstance.getFilesystemFrameworkProjectManager().createFrameworkProject( PROJ_NAME); generateProjectResourcesFile( new File("src/test/resources/com/dtolabs/rundeck/core/common/test-nodes1.xml"), frameworkProject ); } public void tearDown() throws Exception { super.tearDown(); File projectdir = new File(getFrameworkProjectsBase(), PROJ_NAME); FileUtils.deleteDir(projectdir); } public void testGetProviderForNode() throws Exception { final FileCopierService service = FileCopierService.getInstanceForFramework(getFrameworkInstance()); { //default for local node should be local provider final NodeEntryImpl test1 = new NodeEntryImpl("test1"); final FileCopier provider = service.getProviderForNodeAndProject(test1, PROJ_NAME); assertNotNull(provider); assertTrue(provider instanceof LocalFileCopier); } { //default for non-local node should be jsch-scp provider final NodeEntryImpl test1 = new NodeEntryImpl("testnode2"); final FileCopier provider = service.getProviderForNodeAndProject(test1, PROJ_NAME); assertNotNull(provider); assertTrue(provider instanceof JschScpFileCopier); } //specify override attributes for node to change file copier provider { //default for local node should be local provider final NodeEntryImpl test1 = new NodeEntryImpl("test1"); //set attribute test1.setAttributes(new HashMap<String, String>()); test1.getAttributes().put(FileCopierService.LOCAL_NODE_SERVICE_SPECIFIER_ATTRIBUTE, "jsch-scp"); final FileCopier provider = service.getProviderForNodeAndProject(test1, PROJ_NAME); assertNotNull(provider); assertTrue(provider instanceof JschScpFileCopier); } { //default for non-local node should be jsch-scp provider final NodeEntryImpl test1 = new NodeEntryImpl("testnode2"); test1.setAttributes(new HashMap<String, String>()); test1.getAttributes().put(FileCopierService.REMOTE_NODE_SERVICE_SPECIFIER_ATTRIBUTE, "local"); final FileCopier provider = service.getProviderForNodeAndProject(test1, PROJ_NAME); assertNotNull(provider); assertTrue(provider instanceof LocalFileCopier); } } }
[ "greg.schueler@gmail.com" ]
greg.schueler@gmail.com
6686eeea3bc07af5a4a3e7d571036af9f80f6d47
d383eae25299467f33a15d606fdcf91e56fc3967
/xml/src/main/java/org/tipprunde/model/xml/liga/Right.java
01efa45a3f37eed2254dbc5961dccd780b3986c0
[]
no_license
thorsten-k/tipprunde
6dc11424064d867c6009b8359d9e862c22a8767c
4bbc99784e642f88e46b58ee1ae92b380a2c2c25
refs/heads/master
2023-04-30T07:31:59.169857
2023-04-19T11:52:53
2023-04-19T11:52:53
71,550,240
0
0
null
2021-08-22T06:12:09
2016-10-21T09:20:05
Java
UTF-8
Java
false
false
1,673
java
package org.tipprunde.model.xml.liga; import java.io.Serializable; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element ref="{http://www.tipprunde.org/liga}opponent"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "opponent" }) @XmlRootElement(name = "right") public class Right implements Serializable { private final static long serialVersionUID = 1L; @XmlElement(required = true) protected Opponent opponent; /** * Gets the value of the opponent property. * * @return * possible object is * {@link Opponent } * */ public Opponent getOpponent() { return opponent; } /** * Sets the value of the opponent property. * * @param value * allowed object is * {@link Opponent } * */ public void setOpponent(Opponent value) { this.opponent = value; } public boolean isSetOpponent() { return (this.opponent!= null); } }
[ "t.kisner@web.de" ]
t.kisner@web.de
906f5789e374e8da88e489c96c2af672cf603f24
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/13/13_69439153832466443251c05c40858437c9498fba/JBossSARModuleFactory/13_69439153832466443251c05c40858437c9498fba_JBossSARModuleFactory_t.java
32df91593b73998fa6207d4770603f89eccb3bed
[]
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,462
java
/******************************************************************************* * Copyright (c) 2007 Red Hat, Inc. * Distributed under license by Red Hat, Inc. All rights reserved. * This program is 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: * Red Hat, Inc. - initial API and implementation ******************************************************************************/ package org.jboss.ide.eclipse.as.ui.mbeans.project; import java.io.File; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Status; import org.eclipse.wst.common.componentcore.internal.flat.IChildModuleReference; import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; import org.eclipse.wst.common.project.facet.core.IFacetedProject; import org.eclipse.wst.common.project.facet.core.IProjectFacet; import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; import org.eclipse.wst.server.core.IModule; import org.eclipse.wst.web.internal.deployables.FlatComponentDeployable; import org.jboss.ide.eclipse.as.ui.mbeans.Activator; import org.jboss.ide.eclipse.as.wtp.core.modules.JBTFlatProjectModuleFactory; public class JBossSARModuleFactory extends JBTFlatProjectModuleFactory { public static final String FACTORY_ID = "org.jboss.ide.eclipse.as.core.modules.sar.moduleFactory"; //$NON-NLS-1$ public static final String MODULE_TYPE = IJBossSARFacetDataModelProperties.JBOSS_SAR_FACET_ID; public String getFactoryId() { return FACTORY_ID; } public JBossSARModuleFactory() { super(); } protected FlatComponentDeployable createModuleDelegate(IProject project, IVirtualComponent component) { return new JBossSARModuleDelegate(project, component, this); } @Override protected boolean canHandleProject(IProject project) { IProjectFacet facet = ProjectFacetsManager .getProjectFacet(MODULE_TYPE); IFacetedProject facetedProject = null; try { facetedProject = ProjectFacetsManager.create(project); if (facetedProject.hasProjectFacet(facet)) { return true; } } catch (CoreException e) { /* * Ignore. No matter what problem occurs here, * if the project is closed, inaccessible, is not * a faceted project, etc, it is not an error. The * project simply cannot be handled by this factory. * * But I'll log it anyway :/ */ Platform.getLog(Platform.getBundle(Activator.PLUGIN_ID)).log( new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e)); } return false; } @Override protected String getModuleType(IProject project) { // TODO Auto-generated method stub return MODULE_TYPE; } @Override protected String getModuleVersion(IProject project) { return "1.0"; //$NON-NLS-1$ } @Override protected String getModuleType(File binaryFile) { // TODO Auto-generated method stub return null; } @Override protected String getModuleVersion(File binaryFile) { // TODO Auto-generated method stub return null; } @Override public IModule createChildModule(FlatComponentDeployable parent, IChildModuleReference child) { return null; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
c0557c7da90482b9685cff3bf13d3f7f399ebe33
ac1e2ef7ab9cfb412c103e87a25917b4a9da47a7
/src/main/java/org/elasticsearch/util/gnu/trove/TFloatByteProcedure.java
f9fd012c1bc32216b79c91ef4cfa066d4eee433d
[]
no_license
877867559/elasticsearch06
05a9917a559134bad75619f7b1aa7af94df461d9
749779c3582f8bf6061e080973072264adac3c1f
refs/heads/master
2020-04-29T23:33:11.860335
2019-03-21T10:35:15
2019-03-21T10:35:15
176,479,780
0
1
null
null
null
null
UTF-8
Java
false
false
1,719
java
/* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.elasticsearch.util.gnu.trove; ////////////////////////////////////////////////// // THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // ////////////////////////////////////////////////// /** * Interface for procedures that take two parameters of type float and byte. * <p/> * Created: Mon Nov 5 22:03:30 2001 * * @author Eric D. Friedman * @version $Id: P2PProcedure.template,v 1.1 2006/11/10 23:28:00 robeden Exp $ */ public interface TFloatByteProcedure { /** * Executes this procedure. A false return value indicates that * the application executing this procedure should not invoke this * procedure again. * * @param a a <code>float</code> value * @param b a <code>byte</code> value * @return true if additional invocations of the procedure are * allowed. */ public boolean execute(float a, byte b); }// TFloatByteProcedure
[ "liushuaishuai@xforceplus.com" ]
liushuaishuai@xforceplus.com
435bbe418930ebb79d7975c17fb938319244a0eb
4ae217d2a2d4e0a993490f2b58fc31cf343b8d72
/src/java/com/hzih/gap/myjfree/LiuLiangBean.java
de669e175c52548bb82168c3b87af57045de2f77
[]
no_license
huanghengmin/gap
16afc9f7d9a48230eacaf24f4296929940a4cdd6
e6e52947001723afe44785175b6467e28c88a4d2
refs/heads/master
2021-01-01T05:45:18.292140
2016-04-16T02:17:16
2016-04-16T02:17:16
56,360,908
0
1
null
null
null
null
UTF-8
Java
false
false
1,466
java
package com.hzih.gap.myjfree; import org.jfree.data.time.Hour; /** * Created by IntelliJ IDEA. * User: cx * Date: 13-2-19 * Time: 下午5:48 * To change this template use File | Settings | File Templates. */ public class LiuLiangBean { private int minute; private Hour hour; private double netFlow; private double liuliangNum; private long currentMillis; public LiuLiangBean() { } public LiuLiangBean(int minute, Hour hour, double netFlow, double liuliangNum, long currentMillis) { this.minute = minute; this.hour = hour; this.netFlow = netFlow; this.liuliangNum = liuliangNum; this.currentMillis = currentMillis; } public double getNetFlow() { return netFlow; } public void setNetFlow(double netFlow) { this.netFlow = netFlow; } public int getMinute() { return minute; } public void setMinute(int minute) { this.minute = minute; } public Hour getHour() { return hour; } public void setHour(Hour hour) { this.hour = hour; } public double getLiuliangNum() { return liuliangNum; } public void setLiuliangNum(double liuliangNum) { this.liuliangNum = liuliangNum; } public long getCurrentMillis() { return currentMillis; } public void setCurrentMillis(long currentMillis) { this.currentMillis = currentMillis; } }
[ "465805947@QQ.com" ]
465805947@QQ.com
aea6ca9fd66dfdf815bbe7707514b91e1f1a11b3
9885446259af09cd6f224124b67e38c4384f60e7
/src/main/generated/uk/org/siri/wsdl/WsStopPointsDiscoveryStructure.java
8c3eca64806aea60a7dc0816b84d588dbdc543d4
[]
no_license
dsuru1499/situation_exchange
685b08e29ba11d9c4f797f51d33e8118b097bfa9
c43b4a90a2de56b50b68bd66f8b087d100c600c5
refs/heads/master
2021-05-11T14:20:50.736215
2018-07-27T06:08:07
2018-07-27T06:08:07
117,700,983
0
0
null
null
null
null
UTF-8
Java
false
false
2,881
java
package uk.org.siri.wsdl; import java.io.Serializable; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import uk.org.siri.siri.ExtensionsStructure; import uk.org.siri.siri.StopPointsDiscoveryRequestStructure; /** * <p>Classe Java pour WsStopPointsDiscoveryStructure complex type. * * <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe. * * <pre> * &lt;complexType name="WsStopPointsDiscoveryStructure"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="Request" type="{http://www.siri.org.uk/siri}StopPointsDiscoveryRequestStructure"/> * &lt;element name="RequestExtension" type="{http://www.siri.org.uk/siri}ExtensionsStructure"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "WsStopPointsDiscoveryStructure", propOrder = { "request", "requestExtension" }) public class WsStopPointsDiscoveryStructure implements Serializable { private final static long serialVersionUID = 1L; @XmlElement(name = "Request", required = true) protected StopPointsDiscoveryRequestStructure request; @XmlElement(name = "RequestExtension", required = true) protected ExtensionsStructure requestExtension; /** * Obtient la valeur de la propriété request. * * @return * possible object is * {@link StopPointsDiscoveryRequestStructure } * */ public StopPointsDiscoveryRequestStructure getRequest() { return request; } /** * Définit la valeur de la propriété request. * * @param value * allowed object is * {@link StopPointsDiscoveryRequestStructure } * */ public void setRequest(StopPointsDiscoveryRequestStructure value) { this.request = value; } public boolean isSetRequest() { return (this.request!= null); } /** * Obtient la valeur de la propriété requestExtension. * * @return * possible object is * {@link ExtensionsStructure } * */ public ExtensionsStructure getRequestExtension() { return requestExtension; } /** * Définit la valeur de la propriété requestExtension. * * @param value * allowed object is * {@link ExtensionsStructure } * */ public void setRequestExtension(ExtensionsStructure value) { this.requestExtension = value; } public boolean isSetRequestExtension() { return (this.requestExtension!= null); } }
[ "user@localhost.localdomain" ]
user@localhost.localdomain
b53431636bd54077ccf32c463071893f11b510ef
9eb88736f632b25d2908106d56c415a69e8b72cf
/bibsonomy/bibsonomy-common/src/main/java/org/bibsonomy/util/ExceptionUtils.java
597a58ca5565b6e272da115d9651fefbb7929b91
[]
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
2,831
java
/** * * BibSonomy-Common - Common things (e.g., exceptions, enums, utils, etc.) * * 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 Lesser 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser 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.util; import java.sql.SQLException; import org.apache.commons.logging.Log; import org.bibsonomy.common.exceptions.QueryTimeoutException; /** * Convenience methods to throw exceptions. * * @author Christian Schenk * @version $Id: ExceptionUtils.java,v 1.16 2011-04-29 06:36:50 bibsonomy Exp $ */ public class ExceptionUtils { /** * Like the name suggests this method logs an error and throws a * RuntimeException attached with the initial exception. * @param log the logger instance to use * @param ex the exception to log an rethrow wrapped * @param error message of the new RuntimeException * @throws RuntimeException the resulting exception */ public static void logErrorAndThrowRuntimeException(final Log log, final Exception ex, final String error) throws RuntimeException { log.error(error + " - throwing RuntimeException" + ((ex != null) ? ("\n" + ex.toString()) : ""), ex ); /* * Inserted to get more information (e.g., on "java.sql.SQLException: Unknown error" messages) * FIXME: it's probably not the best place to handle SQL stuff */ if (ex != null && ex.getCause() != null && ex.getCause().getClass().equals(SQLException.class)) { final SQLException sqlException = ((SQLException) ex); log.error("SQL error code: " + sqlException.getErrorCode() + ", SQL state: " + sqlException.getSQLState()); } throw new RuntimeException(error, ex); } /** * throw query timeout exception * * @param log * @param ex * @param query * @throws QueryTimeoutException */ public static void logErrorAndThrowQueryTimeoutException(final Log log, final Exception ex, final String query) throws QueryTimeoutException { log.error("Query timeout for query: " + query); throw new QueryTimeoutException(ex, query); } }
[ "juanpablotec4@gmail.com" ]
juanpablotec4@gmail.com
e842b638748707c6bd3a17bbb6ba109fc6beef4d
6792be6bd1d37efef43e89f3e86e2495f07ae15e
/src/coding/ninjas/assignments/Arrays_1/ArraySum.java
9e38d51c1624efd0054a60d12222cbe2c365c75a
[]
no_license
mayank-17/codingninja
9c5db1d6be52f29ab9e068b8bf7a6f8d61c497b5
90401e9b28225199d840598db7248e3bbaf6a00a
refs/heads/master
2020-06-16T19:08:00.577426
2018-09-16T04:19:18
2018-09-16T04:19:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
544
java
package Arrays_1; /*Given an array of length N, you need to find and return the sum of all elements of the array. Input Format : Line 1 : An Integer N i.e. size of array Line 2 : N integers which are elements of the array, separated by spaces */ public class ArraySum { public static void main(String[] args) { int[] arr= {4,6,8,2,9,7,3,1}; System.out.println(sum(arr)); } public static int sum(int[] input){ int sum=0; int i; for(i= input.length - 1; 0 <= i; sum+= input[i--]); return sum; } }
[ "rajesh.kumar.raj.mca@gmail.com" ]
rajesh.kumar.raj.mca@gmail.com
71f67d30e8d25d7f260017acff46d87cad86e1fa
c93d57edc5337e479230150b3bb3833c9a1cce3e
/src/com/javarush/test/level10/lesson04/task03/Solution.java
0bbe3203508527cdfd82bca070c5e75a47150884
[]
no_license
Lao-Ax/JavaRushHomeWork
fe1cbafc41a57a3bcb5804337ab10474ba34948a
d33681fad5d6f891609e1ff1bc51ae104476b7af
refs/heads/master
2023-01-28T22:01:36.059968
2023-01-15T13:11:46
2023-01-15T14:28:05
264,274,037
0
0
null
null
null
null
UTF-8
Java
false
false
416
java
package com.javarush.test.level10.lesson04.task03; /* Задача №3 на преобразование целых типов Расставь где нужно оператор приведения типа: float f = 333.50; int i = f; byte b = i; */ public class Solution { public static void main(String[] args) { float f = 333.50f; int i= (int) f; byte b = (byte) i; } }
[ "aplekhov@wiley.com" ]
aplekhov@wiley.com
0a903e23e8f1275ed733326cc560850b242cea09
15c33eb2ad75385ae16e5d4309f49665b2cce0fa
/Java/lib/IaaS-Jasdk/MOps驱动/ceilometer-model/src/com/isoft/iaas/openstack/ceilometer/v2/model/AlarmCombination.java
ca187417aa3cf6853ce684aa5d0cf6dd8b36bdbc
[]
no_license
caocaodl/zabbix_with_java
588cb13ebce707bec79611981149582cb6712ed2
41d1e8b5bb417b5010678ffc9dff795e5d218c75
refs/heads/master
2021-01-21T23:16:51.657808
2017-06-26T11:12:51
2017-06-26T11:12:51
95,219,984
4
4
null
null
null
null
UTF-8
Java
false
false
2,796
java
package com.isoft.iaas.openstack.ceilometer.v2.model; import java.io.Serializable; import org.codehaus.jackson.annotate.JsonProperty; public class AlarmCombination implements Serializable { private static final long serialVersionUID = 1L; @JsonProperty("alarm_id") private String id; @JsonProperty("alarm_actions") private String[] alarmActions; @JsonProperty("combination_rule") private AlarmCombinationRule combinationRule; @JsonProperty private String description; @JsonProperty private Boolean enabled; @JsonProperty("insufficient_data_actions") private String[] insufficientDataActions; @JsonProperty private String name; @JsonProperty("ok_actions") private String[] okActions; @JsonProperty("project_id") private String projectid; @JsonProperty("repeat_actions") private Boolean repeatActions; @JsonProperty private String state; @JsonProperty private String type; @JsonProperty("user_id") private String userid; public String getId() { return id; } public void setId(String id) { this.id = id; } public void setAlarmActions(String[] alarmActions) { this.alarmActions = alarmActions; } public void setCombinationRule(AlarmCombinationRule combinationRule) { this.combinationRule = combinationRule; } public void setDescription(String description) { this.description = description; } public void setEnabled(Boolean enabled) { this.enabled = enabled; } public void setInsufficientDataActions(String[] insufficientDataActions) { this.insufficientDataActions = insufficientDataActions; } public void setName(String name) { this.name = name; } public void setOkActions(String[] okActions) { this.okActions = okActions; } public void setProjectid(String projectid) { this.projectid = projectid; } public void setRepeatActions(Boolean repeatActions) { this.repeatActions = repeatActions; } public void setState(String state) { this.state = state; } public void setType(String type) { this.type = type; } public void setUserid(String userid) { this.userid = userid; } public String[] getAlarmActions() { return alarmActions; } public AlarmCombinationRule getCombinationRule() { return combinationRule; } public String getDescription() { return description; } public Boolean getEnabled() { return enabled; } public String[] getInsufficientDataActions() { return insufficientDataActions; } public String getName() { return name; } public String[] getOkActions() { return okActions; } public String getProjectid() { return projectid; } public Boolean getRepeatActions() { return repeatActions; } public String getState() { return state; } public String getType() { return type; } public String getUserid() { return userid; } }
[ "wlx0710@gmail.com" ]
wlx0710@gmail.com
412847ead3022778c24295eb4054d1c8e1d52565
5e25ffcd9d238bfdfc4feed57aad3b44bf03ed47
/src/main/java/jodd/jerry/JerryNodeFunction.java
d517b70468f5ab8469f6b380320960dcbf1996ef
[ "BSD-2-Clause", "BSD-3-Clause" ]
permissive
tangyoucheng/jodd-lagarto
173b19f47fa96075b454731b48e5a19413e590e2
be64926a97a6703bad439c71a3d9fc5e111b2d0d
refs/heads/master
2023-03-11T12:19:16.494004
2021-03-01T17:02:10
2021-03-01T17:02:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,664
java
// Copyright (c) 2003-present, Jodd Team (http://jodd.org) // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // // 2. 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. // // 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. package jodd.jerry; import jodd.lagarto.dom.Node; /** * Callback function for iterating nodes. */ @FunctionalInterface public interface JerryNodeFunction { /** * Invoked on node. Returns {@code true} to continue looping. */ boolean onNode(Node node, int index); }
[ "igor@jodd.org" ]
igor@jodd.org
f929e079e7e5e75f812c2515af70a7b75fb66a99
f1fb970cce7cda7ce6c8c3e0dc9119b2ffe595c7
/kikaha-modules/kikaha-uworkers/source/kikaha/uworkers/core/MicroWorkerListenerClass.java
e6edfdd3a38af5a83b4e43fb072bcf8237ad2620
[ "Apache-2.0" ]
permissive
hustbill/kikaha
fc4eb7064793e420140a11525dc5d1113720ad8d
d709dcead58e74c3657fd881bb88c7a233d3d9b3
refs/heads/master
2021-01-13T13:31:14.342076
2016-10-28T14:04:52
2016-10-28T14:04:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
669
java
package kikaha.uworkers.core; import lombok.*; /** * */ @Getter @EqualsAndHashCode @RequiredArgsConstructor public class MicroWorkerListenerClass { final String packageName; final String targetClass; final String methodName; final String parameterType; final String endpointName; final String endpointURL; final boolean rawObject; public long getIdentifier() { return hashCode() & 0xffffffffl; } public String getClassName(){ return "GeneratedWorkerMethod" + getIdentifier(); } public String getTargetCanonicalClassName(){ return packageName + "." + targetClass; } public String toString(){ return packageName + "." + getClassName(); } }
[ "miere00@gmail.com" ]
miere00@gmail.com
be085dbdf23cb493dd0e481d219f8ef0e625125a
1c9bdf7e53599fa79f4e808a6daf1bab08b35a00
/peach/app/src/main/java/com/xygame/sg/imageloader/FileManager.java
88463b938e221771c43943d5168692eba28ccd37
[]
no_license
snoylee/GamePromote
cd1380613a16dc0fa8b5aa9656c1e5a1f081bd91
d017706b4d6a78b5c0a66143f6a7a48fcbd19287
refs/heads/master
2021-01-21T20:42:42.116142
2017-06-18T07:59:38
2017-06-18T07:59:38
94,673,520
0
0
null
null
null
null
UTF-8
Java
false
false
280
java
package com.xygame.sg.imageloader; public class FileManager { public static String getSaveFilePath() { if (CommonUtil.hasSDCard()) { return CommonUtil.getRootFilePath(); } else { return CommonUtil.getRootFilePath() + "com.geniuseoe2012/files"; } } }
[ "litieshan549860123@126.com" ]
litieshan549860123@126.com
60f69fe47f4032d9e457276d7e136b29929602d8
3a966289d5669702eb51ac16a95ac27621ec8879
/XML+Servlet+mysql/day19_eg/src/cn/itcast/utils/WebUtils.java
ec6c0f13e0e06672aed4a54b6656cb0c86fa2009
[]
no_license
lixianSharp/XML-Servlet-mysql
3ff494e10f231668334c3bee5c6de16b08570fc5
e8515578c950bdd9b47a7ff42d8fbfeab537e5a5
refs/heads/master
2021-09-09T16:00:26.507660
2018-03-17T16:06:29
2018-03-17T16:06:29
125,624,849
0
0
null
null
null
null
UTF-8
Java
false
false
1,260
java
package cn.itcast.utils; import java.util.Enumeration; import javax.servlet.http.HttpServletRequest; import org.apache.commons.beanutils.BeanUtils; import cn.itcast.entity.Admin; public class WebUtils { @Deprecated public static <T> T copyToBean_old(HttpServletRequest request, Class<T> clazz) { try { // 创建对象 T t = clazz.newInstance(); // 获取所有的表单元素的名称 Enumeration<String> enums = request.getParameterNames(); // 遍历 while (enums.hasMoreElements()) { // 获取表单元素的名称:<input type="password" name="pwd"/> String name = enums.nextElement(); // pwd // 获取名称对应的值 String value = request.getParameter(name); // 把指定属性名称对应的值进行拷贝 BeanUtils.copyProperty(t, name, value); } return t; } catch (Exception e) { throw new RuntimeException(e); } } /** * 处理请求数据的封装 */ public static <T> T copyToBean(HttpServletRequest request, Class<T> clazz) { try { // (注册日期类型转换器) // 创建对象 T t = clazz.newInstance(); BeanUtils.populate(t, request.getParameterMap()); return t; } catch (Exception e) { throw new RuntimeException(e); } } }
[ "861034458@qq.com" ]
861034458@qq.com
f253e26071a41bfd5e1a3dda3d34242a4679145c
875d88ee9cf7b40c9712178d1ee48f0080fa0f8a
/geronimo-validation_2.0_spec/src/main/java/javax/validation/ConstraintValidator.java
98be78f235db2126bba37b12263f5fb087c60482
[ "Apache-2.0", "W3C", "W3C-19980720" ]
permissive
jgallimore/geronimo-specs
b152164488692a7e824c73a9ba53e6fb72c6a7a3
09c09bcfc1050d60dcb4656029e957837f851857
refs/heads/trunk
2022-12-15T14:02:09.338370
2020-09-14T18:21:46
2020-09-14T18:21:46
284,994,475
0
1
Apache-2.0
2020-09-14T18:21:47
2020-08-04T13:51:47
Java
UTF-8
Java
false
false
1,092
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with this * work for additional information regarding copyright ownership. The ASF * licenses this file to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package javax.validation; import java.lang.annotation.Annotation; /** * @version $Rev$ $Date$ */ public interface ConstraintValidator<A extends Annotation, T> { default void initialize(A constraintAnnotation) { } boolean isValid(T value, ConstraintValidatorContext context); }
[ "johndament@apache.org" ]
johndament@apache.org
2fe887a6c0ecb25f25c92a1651b53282c7e0a76f
bcbd32c21278340d7cd83a722c5812526c2c5783
/lockpattern/src/main/java/com/ks/lockpattern/MainActivity.java
aa7681aa8a2f2a9ecbdc46c268031dcffbc7f3d7
[]
no_license
zhudaihao/SafeLogin-master
026061a716fde0fa83bca726f563b8d1d6b33439
1201efeaa8bc2e7f5a19c4324b5ae2163ef31ff9
refs/heads/master
2020-03-26T10:47:13.328069
2018-08-15T06:38:17
2018-08-15T06:38:17
144,815,445
5
2
null
null
null
null
UTF-8
Java
false
false
1,114
java
package com.ks.lockpattern; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); findViewById(R.id.patternlock_setting).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(MainActivity.this, PatternLockActivity.class); intent.putExtra("type", "setting"); startActivity(intent); } }); findViewById(R.id.patternlock_open).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(MainActivity.this, PatternLockActivity.class); intent.putExtra("type", "open"); startActivity(intent); } }); } }
[ "zhudaihao@wswtz.com" ]
zhudaihao@wswtz.com
b04888de2a2a6139225c76b8964fdf513fa20427
6ff259c741e9ff0a27511692f41f571b15edcadc
/batik/src/main/java/org/apache/batik/dom/svg/SVGOMFEDistantLightElement.java
03ec4ce4a69c4590b6d4e876e7b3951ccc0a5d47
[ "Apache-2.0" ]
permissive
zhangdan660/jgdraw
20da489f4f962d4bd5ce98e8574ed89ff106faa5
7762908477af1c4bb56f73a6789342bbea810a6a
refs/heads/master
2021-01-09T21:55:51.552952
2016-03-09T02:01:27
2016-03-09T02:02:12
53,459,541
0
0
null
null
null
null
UTF-8
Java
false
false
4,232
java
/* Copyright 2000-2002 The Apache Software Foundation 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.apache.batik.dom.svg; import org.apache.batik.dom.AbstractDocument; import org.w3c.dom.Attr; import org.w3c.dom.DOMException; import org.w3c.dom.Node; import org.w3c.dom.TypeInfo; import org.w3c.dom.UserDataHandler; import org.w3c.dom.svg.SVGAnimatedNumber; import org.w3c.dom.svg.SVGFEDistantLightElement; /** * This class implements {@link SVGFEDistantLightElement}. * * @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a> * @version $Id: SVGOMFEDistantLightElement.java,v 1.1 2005/11/21 09:51:24 dev Exp $ */ public class SVGOMFEDistantLightElement extends SVGOMElement implements SVGFEDistantLightElement { /** * Creates a new SVGOMFEDistantLightElement object. */ protected SVGOMFEDistantLightElement() { } /** * Creates a new SVGOMFEDistantLightElement object. * @param prefix The namespace prefix. * @param owner The owner document. */ public SVGOMFEDistantLightElement(String prefix, AbstractDocument owner) { super(prefix, owner); } /** * <b>DOM</b>: Implements {@link Node#getLocalName()}. */ public String getLocalName() { return SVG_FE_DISTANT_LIGHT_TAG; } /** * <b>DOM</b>: Implements {@link SVGFEDistantLightElement#getAzimuth()}. */ public SVGAnimatedNumber getAzimuth() { return getAnimatedNumberAttribute(null, SVG_AZIMUTH_ATTRIBUTE, 0f); } /** * <b>DOM</b>: Implements {@link SVGFEDistantLightElement#getElevation()}. */ public SVGAnimatedNumber getElevation() { return getAnimatedNumberAttribute(null, SVG_ELEVATION_ATTRIBUTE, 0f); } /** * Returns a new uninitialized instance of this object's class. */ protected Node newNode() { return new SVGOMFEDistantLightElement(); } public TypeInfo getSchemaTypeInfo() { // TODO Auto-generated method stub return null; } public void setIdAttribute(String arg0, boolean arg1) throws DOMException { // TODO Auto-generated method stub } public void setIdAttributeNS(String arg0, String arg1, boolean arg2) throws DOMException { // TODO Auto-generated method stub } public void setIdAttributeNode(Attr arg0, boolean arg1) throws DOMException { // TODO Auto-generated method stub } public String getBaseURI() { // TODO Auto-generated method stub return null; } public short compareDocumentPosition(Node arg0) throws DOMException { // TODO Auto-generated method stub return 0; } public String getTextContent() throws DOMException { // TODO Auto-generated method stub return null; } public void setTextContent(String arg0) throws DOMException { // TODO Auto-generated method stub } public boolean isSameNode(Node arg0) { // TODO Auto-generated method stub return false; } public String lookupPrefix(String arg0) { // TODO Auto-generated method stub return null; } public boolean isDefaultNamespace(String arg0) { // TODO Auto-generated method stub return false; } public String lookupNamespaceURI(String arg0) { // TODO Auto-generated method stub return null; } public boolean isEqualNode(Node arg0) { // TODO Auto-generated method stub return false; } public Object getFeature(String arg0, String arg1) { // TODO Auto-generated method stub return null; } public Object setUserData(String arg0, Object arg1, UserDataHandler arg2) { // TODO Auto-generated method stub return null; } public Object getUserData(String arg0) { // TODO Auto-generated method stub return null; } }
[ "zhangdan_660@163.com" ]
zhangdan_660@163.com
18a0e52c2cca4641fe99285b2fc07a06c125169a
db8d0016325aec485bf8b66a7d0f84bb925cc7d0
/shop-common/src/main/java/com/rt/shop/common/excel/template/utils/TagUtil.java
589f3e2b7cdc42d958a197bf46b9f1de2d98e77c
[]
no_license
jjmnbv/shop
a0ff70e235de91198cea0a7b0efc270a8719ccd0
48c6d47f12468b5692f13c20f7c7f24592acb1b0
refs/heads/master
2021-06-12T14:09:31.784490
2017-04-07T02:59:12
2017-04-07T02:59:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,649
java
package com.rt.shop.common.excel.template.utils; import java.util.Collection; import java.util.HashMap; import java.util.Map; import java.util.StringTokenizer; import com.rt.shop.common.excel.template.tags.ForeachTag; import com.rt.shop.common.excel.template.tags.Tag; /** * 标签处理工具类 * */ public class TagUtil { public static final String KEY_TAG = "#"; private static Map<String, Tag> tagMap = new HashMap<String, Tag>(); static { registerTag(ForeachTag.class); } /** * 注册标签类 * @param clazz */ public static void registerTag(Class<?> clazz){ Tag tag; try { tag = (Tag) clazz.newInstance(); tagMap.put(tag.getTagName(), tag); } catch (Exception e) { e.printStackTrace(); } } /** * 注册指定包中的标签类 * @param tagPackage */ public static void registerTagPackage(String tagPackage){ Collection<Class<?>> classs = PackageUtil.getClasses(tagPackage, true); for(Class<?> clazz : classs){ if(Tag.class.isAssignableFrom(clazz)) { registerTag(clazz); } } } /** * 获取字符串中对应的标签对象 * @param str * @return */ public static Tag getTag(String str) { String tagName = null; if(str != null){ int keytag = str.indexOf(KEY_TAG); if (keytag < 0) return null; if (!(keytag < str.length() - 1)) return null; String tagRight = str.substring(keytag + 1, str.length()); if (tagRight.startsWith(KEY_TAG)) return null; StringTokenizer st = new StringTokenizer(str, " "); if (st.hasMoreTokens()) { tagName = st.nextToken(); } } Tag tag = (Tag) tagMap.get(tagName); return tag; } }
[ "bl.jiwenlei@gmail.com" ]
bl.jiwenlei@gmail.com
aee502504d7b92df58110e49bafc48d85170edfb
67835e460bb0e2340971bb9777a3ed8b07bfe5d5
/app/src/main/java/com/example/administrator/sqt/zxing/common/Constant.java
47ffdfd1de122138bb1e75680da55c91a4f3a40c
[]
no_license
ZGQ012/shangquantong
d3e0495e573b39f03338c00f761af8bb1fcf1315
e9218439b3250ce4bdeb4e052d74cd2d477cb221
refs/heads/master
2020-04-01T03:55:02.196092
2018-10-13T07:27:04
2018-10-13T07:27:04
152,841,317
0
0
null
null
null
null
UTF-8
Java
false
false
836
java
package com.example.administrator.sqt.zxing.common; /** * Created by yzq on 2017/7/20. * <p> * zxing常量 */ public class Constant { public static final int DECODE = 1; public static final int DECODE_FAILED = 2; public static final int DECODE_SUCCEEDED = 3; public static final int LAUNCH_PRODUCT_QUERY = 4; public static final int QUIT = 5; public static final int RESTART_PREVIEW = 6; public static final int RETURN_SCAN_RESULT = 7; public static final int FLASH_OPEN = 8; public static final int FLASH_CLOSE = 9; public static final int REQUEST_IMAGE = 10; public static final String CODED_CONTENT = "codedContent"; public static final String CODED_BITMAP = "codedBitmap"; /*传递的zxingconfing*/ public static final String INTENT_ZXING_CONFIG = "zxingConfig"; }
[ "you@example.com" ]
you@example.com
4d8007e4db8fa1adcff4ea4c959f3b9fa7512dcc
b5389245f454bd8c78a8124c40fdd98fb6590a57
/java_only_big_connected/module74/src/main/java/module74packageJava0/Foo3.java
0be2d473b0b72a53e1aa3cf0ec3419de89b03065
[]
no_license
jin/android-projects
3bbf2a70fcf9a220df3716b804a97b8c6bf1e6cb
a6d9f050388cb8af84e5eea093f4507038db588a
refs/heads/master
2021-10-09T11:01:51.677994
2018-12-26T23:10:24
2018-12-26T23:10:24
131,518,587
29
1
null
2018-12-26T23:10:25
2018-04-29T18:21:09
Java
UTF-8
Java
false
false
204
java
package module74packageJava0; public class Foo3 { public void foo0() { new module74packageJava0.Foo2().foo2(); } public void foo1() { foo0(); } public void foo2() { foo1(); } }
[ "jingwen@google.com" ]
jingwen@google.com
d2855156ec3f8c5cc5d5a712a39afc2964ebd3ca
9e9610df2de50fe3bc16d1865d7d503e0b4277a0
/common/src/main/java/cn/sohu/jack/thinking/java/chapeter21concurrent/CircularSet.java
f5a70eac26210e499de37ace38a6c5ea6004e6e6
[]
no_license
JackAbel/voyage
aba80e324dce768b212bffab747cca8f7e0a46ed
e7acbb4d3645a5e5bdbf05eb741f4e53561010de
refs/heads/master
2022-12-01T21:26:16.392513
2020-09-28T11:49:03
2020-09-28T11:49:03
173,219,466
0
0
null
2022-11-16T05:51:51
2019-03-01T02:14:50
Java
UTF-8
Java
false
false
749
java
package cn.sohu.jack.thinking.java.chapeter21concurrent; /** * @description: * @author: Xiangbao Jin * @since 2019/8/22 7:54 PM */ public class CircularSet { private int[] array; private int len; private int index = 0; public CircularSet(int size) { array = new int[size]; len = size; for (int i = 0; i < size; i++) { array[i] = -1; } } public synchronized void add(int i) { array[index] = i; // wrap inde and write over old elements index = ++index/len; } public synchronized boolean contain(int i) { for (int j : array) { if (j == i) { return true; } } return false; } }
[ "xiangbaojin215867@sohu-inc.com" ]
xiangbaojin215867@sohu-inc.com
74dd1edd9d65fc990f412dcf861209710d90b869
2cc97ea8be78b2202e5636e57941a75469679cde
/src/main/java/com/esdemo/frame/log/StdOutErrRedirect.java
7c896b8df4f5f621259519385706b60d4bd81655
[]
no_license
houmenghui/es-demo
9fff9a92cfdb332b0ea74c5143dfce0adc17f2c2
6e2b1d4842d1da9267320d36a700311460aaac36
refs/heads/master
2022-11-14T04:07:55.132853
2020-07-14T03:57:51
2020-07-14T03:57:51
279,468,101
0
0
null
null
null
null
UTF-8
Java
false
false
3,098
java
package com.esdemo.frame.log; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.PrintStream; /** * Created by lzj on 2019/9/12. */ public class StdOutErrRedirect { private final static Logger logger = LoggerFactory.getLogger(StdOutErrRedirect.class); public static void redirectSystemOutAndErrToLog() { PrintStream printStreamForOut = createLoggingWrapper(System.out, false); PrintStream printStreamForErr = createLoggingWrapper(System.out, true); System.setOut(printStreamForOut); System.setErr(printStreamForErr); } public static PrintStream createLoggingWrapper(final PrintStream printStream, final boolean isErr) { return new PrintStream(printStream) { @Override public void print(final String string) { if (!isErr){ logger.info(string); }else{ logger.error(string); } } @Override public void print(boolean b) { if (!isErr){ logger.info(Boolean.valueOf(b).toString()); }else{ logger.error(Boolean.valueOf(b).toString()); } } @Override public void print(char c) { if (!isErr){ logger.info(Character.valueOf(c).toString()); }else{ logger.error(Character.valueOf(c).toString()); } } @Override public void print(int i) { if (!isErr){ logger.info(String.valueOf(i)); }else{ logger.error(String.valueOf(i)); } } @Override public void print(long l) { if (!isErr){ logger.info(String.valueOf(l)); }else{ logger.error(String.valueOf(l)); } } @Override public void print(float f) { if (!isErr){ logger.info(String.valueOf(f)); }else{ logger.error(String.valueOf(f)); } } @Override public void print(double d) { if (!isErr){ logger.info(String.valueOf(d)); }else{ logger.error(String.valueOf(d)); } } @Override public void print(char[] x) { if (!isErr){ logger.info(x == null ? null : new String(x)); }else{ logger.error(x == null ? null : new String(x)); } } @Override public void print(Object obj) { if (!isErr){ logger.info(obj.toString()); }else{ logger.error(obj.toString()); } } }; } }
[ "hmh@eeepay.cn" ]
hmh@eeepay.cn
d2c767308978690849a2590f95f27c1bcc80dc79
07399d93a482f7565a97e69d8b9197ad25adf688
/com.astra.ses.spell.gui.preferences/src/com/astra/ses/spell/gui/preferences/values/DisplayDataPref.java
68d4bfe980c9bc3803ba52ece99b3cf7673f7eae
[]
no_license
CalypsoCubesat/SPELL-GUI-4.0.2-SRC
1fda020fb3edc11f5ad2fd59ba1c5cea5b0c1074
a171a26ea9413c9787f0c7b4e98aeb8c2ab378ab
refs/heads/master
2020-08-29T07:26:22.789627
2019-10-28T04:34:16
2019-10-28T04:34:16
217,966,403
0
0
null
null
null
null
UTF-8
Java
false
false
408
java
package com.astra.ses.spell.gui.preferences.values; public enum DisplayDataPref { NAME("Name"), VALUE("Value"), BOTH("Both name and value"); private DisplayDataPref( String title ) { this.title = title; } public static DisplayDataPref fromTitle( String title ) { for(DisplayDataPref dd : values()) { if (dd.title.equals(title)) return dd; } return null; } public String title; }
[ "matthew.travis@aresinstitute.org" ]
matthew.travis@aresinstitute.org
3debe75d4ec7d3e8c17e0d8ce6204fd5eb12f24e
743117f9aef3644c7656fdbff308c5fd4ae5afee
/fuzz-tests/src/test/java/org/roaringbitmap/RandomisedTestData.java
d23fe16d6e3c2f0a0f88665f194bc8fc1d295f92
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
lemire/RoaringBitmap
6009e298c19d9faeb7fa4c29f5c2d550819982be
b2580c61dea3e3f102a26b70ff3fa6065eabc448
refs/heads/master
2023-08-31T01:48:33.531874
2023-08-28T18:14:41
2023-08-28T18:14:41
189,455,958
136
19
Apache-2.0
2019-05-30T17:34:00
2019-05-30T17:34:00
null
UTF-8
Java
false
false
3,602
java
package org.roaringbitmap; import java.util.Arrays; import java.util.concurrent.ThreadLocalRandom; import java.util.stream.IntStream; import static java.lang.Integer.parseInt; import static org.roaringbitmap.RoaringBitmapWriter.writer; public class RandomisedTestData { public static final int ITERATIONS = parseInt(System.getProperty("org.roaringbitmap.fuzz.iterations", "10000")); private static final ThreadLocal<long[]> bits = ThreadLocal.withInitial(() -> new long[1 << 10]); public static RoaringBitmap randomBitmap(int maxKeys, double rleLimit, double denseLimit) { return randomBitmap(maxKeys, rleLimit, denseLimit, writer().initialCapacity(maxKeys).optimiseForArrays().get()); } public static RoaringBitmap randomBitmap(int maxKeys) { double rleLimit = ThreadLocalRandom.current().nextDouble(); double denseLimit = ThreadLocalRandom.current().nextDouble(rleLimit, 1D); return randomBitmap(maxKeys, rleLimit, denseLimit); } public static <T extends BitmapDataProvider> T randomBitmap(int maxKeys, RoaringBitmapWriter<T> writer) { double rleLimit = ThreadLocalRandom.current().nextDouble(); double denseLimit = ThreadLocalRandom.current().nextDouble(rleLimit, 1D); return randomBitmap(maxKeys, rleLimit, denseLimit, writer); } private static <T extends BitmapDataProvider> T randomBitmap(int maxKeys, double rleLimit, double denseLimit, RoaringBitmapWriter<T> writer) { int[] keys = createSorted16BitInts(ThreadLocalRandom.current().nextInt(1, maxKeys)); IntStream.of(keys) .forEach(key -> { double choice = ThreadLocalRandom.current().nextDouble(); final IntStream stream; if (choice < rleLimit) { stream = rleRegion(); } else if (choice < denseLimit) { stream = denseRegion(); } else { stream = sparseRegion(); } stream.map(i -> (key << 16) | i).forEach(writer::add); }); return writer.get(); } private static IntStream rleRegion() { int numRuns = ThreadLocalRandom.current().nextInt(1, 2048); int[] runs = createSorted16BitInts(numRuns * 2); return IntStream.range(0, numRuns) .map(i -> i * 2) .mapToObj(i -> IntStream.range(runs[i], runs[i + 1])) .flatMapToInt(i -> i); } private static IntStream sparseRegion() { return IntStream.of(createSorted16BitInts(ThreadLocalRandom.current().nextInt(1, 4096))); } private static IntStream denseRegion() { return IntStream.of(createSorted16BitInts(ThreadLocalRandom.current().nextInt(4096, 1 << 16))); } private static int[] createSorted16BitInts(int howMany) { // we can have at most 65536 keys in a RoaringBitmap long[] bitset = bits.get(); Arrays.fill(bitset, 0L); int consumed = 0; while (consumed < howMany) { int value = ThreadLocalRandom.current().nextInt(1 << 16); long bit = (1L << value); consumed += 1 - Long.bitCount(bitset[value >>> 6] & bit); bitset[value >>> 6] |= bit; } int[] keys = new int[howMany]; int prefix = 0; int k = 0; for (int i = bitset.length - 1; i >= 0; --i) { long word = bitset[i]; while (word != 0) { keys[k++] = prefix + Long.numberOfTrailingZeros(word); word &= (word - 1); } prefix += 64; } return keys; } }
[ "lemire@gmail.com" ]
lemire@gmail.com
cb3aa7fc883a418ab7aa983375b0ba7d5ddedc5b
ebac8f18af20853d6ca8efa2038146ef8d9a1cae
/utility/elasticsearch_compatibility_0.19/src/org/elasticsearch/common/collect/CrossVersionImmutableMap.java
fd22256f2b97019d7a3b851e3aa39088617a2161
[]
no_license
Alex-At-Home/Infinit.e
ad4a5ca33045c2356d09dd58233c8af227d5b91b
49b4600139bfdd2c371f79d7257f286ccdcdc4b5
refs/heads/master
2021-01-24T02:39:01.280698
2016-02-09T19:06:16
2016-02-09T19:06:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
678
java
package org.elasticsearch.common.collect; import org.elasticsearch.cluster.metadata.IndexTemplateMetaData; import org.elasticsearch.cluster.metadata.MetaData; public class CrossVersionImmutableMap<T> { protected ImmutableMap<String, T> _backingMap; public static CrossVersionImmutableMap<IndexTemplateMetaData> getTemplates(MetaData meta) { return new CrossVersionImmutableMap<IndexTemplateMetaData>(meta.getTemplates()); } CrossVersionImmutableMap(ImmutableMap<String, T> backingMap) { _backingMap = backingMap; } public T get(String key) { return _backingMap.get(key); } public boolean containsKey(String key) { return _backingMap.containsKey(key); } }
[ "apiggott@ikanow.com" ]
apiggott@ikanow.com
cb4f6669ee5e9d84b11f6a72d1d93d92d722fe63
9e64d53b69c90e582fd8d8d79fb8a7e7dc93fb17
/ch.elexis.artikel_ch/src/ch/elexis/artikel_ch/data/Messages.java
31c7bec19ff8788836a5f51bb4f1c7bdf257a960
[]
no_license
jsigle/elexis-base
e89e277516f2eb94d870f399266560700820dcc5
fbda2efb49220b61ef81da58c1fa4b68c28bbcd4
refs/heads/master
2021-01-17T00:08:29.782414
2013-05-05T18:12:15
2013-05-05T18:12:15
6,995,370
0
1
null
null
null
null
UTF-8
Java
false
false
1,225
java
package ch.elexis.artikel_ch.data; import org.eclipse.osgi.util.NLS; public class Messages extends NLS { private static final String BUNDLE_NAME = "ch.elexis.artikel_ch.data.messages"; //$NON-NLS-1$ public static String Medikament_CodeSystemNameMedicaments; public static String MedikamentImporter_BadFileFormat; public static String MedikamentImporter_BadPharmaCode; public static String MedikamentImporter_MedikamentImportTitle; public static String MedikamentImporter_ModeOfImport; public static String MedikamentImporter_OnlyIGM10AndIGM11; public static String MedikamentImporter_PleaseChoseFile; public static String MedikamentImporter_WindowTitleMedicaments; public static String MedikamentImporter_SuccessTitel; public static String MedikamentImporter_SuccessContent; public static String MedikamentImporter_BadArticleEntry; public static String MiGelImporter_ClearAllData; public static String MiGelImporter_ModeCreateNew; public static String MiGelImporter_ModeUpdateAdd; public static String MiGelImporter_PleaseSelectFile; public static String MiGelImporter_ReadMigel; static { // initialize resource bundle NLS.initializeMessages(BUNDLE_NAME, Messages.class); } private Messages(){} }
[ "jsigle@think3.sc.de" ]
jsigle@think3.sc.de
361da60ba105302f10118a13981040895913ae3c
63aa90f81728c223df1eca002ba8b30e3b89ab29
/src/main/java/org/assertj/core/error/ShouldBeAfterOrEqualsTo.java
78f7c97b14eac4011cd92cdec53b359d116e1fd2
[ "Apache-2.0" ]
permissive
assilzm/assertj-core
f87b92f05d8644b7c7946fdcbdf1041196dad6dc
faa1b442e674d440caa54ae860a70983ba3e2588
refs/heads/master
2021-01-18T08:24:33.533825
2015-03-11T21:11:44
2015-03-15T04:37:40
32,510,975
1
0
null
2015-03-19T09:01:51
2015-03-19T09:01:51
null
UTF-8
Java
false
false
2,209
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. * * Copyright 2012-2015 the original author or authors. */ package org.assertj.core.error; import java.util.Date; import org.assertj.core.internal.*; /** * Creates an error message indicating that an assertion that verifies that a {@link Date} is after or equals to another one * failed. * * @author Joel Costigliola */ public class ShouldBeAfterOrEqualsTo extends BasicErrorMessageFactory { /** * Creates a new </code>{@link ShouldBeAfterOrEqualsTo}</code>. * @param actual the actual value in the failed assertion. * @param other the value used in the failed assertion to compare the actual value to. * @param comparisonStrategy the {@link ComparisonStrategy} used to evaluate assertion. * @return the created {@code ErrorMessageFactory}. */ public static ErrorMessageFactory shouldBeAfterOrEqualsTo(Date actual, Date other, ComparisonStrategy comparisonStrategy) { return new ShouldBeAfterOrEqualsTo(actual, other, comparisonStrategy); } /** * Creates a new </code>{@link ShouldBeAfterOrEqualsTo}</code>. * @param actual the actual value in the failed assertion. * @param other the value used in the failed assertion to compare the actual value to. * @return the created {@code ErrorMessageFactory}. */ public static ErrorMessageFactory shouldBeAfterOrEqualsTo(Date actual, Date other) { return new ShouldBeAfterOrEqualsTo(actual, other, StandardComparisonStrategy.instance()); } private ShouldBeAfterOrEqualsTo(Date actual, Date other, ComparisonStrategy comparisonStrategy) { super("%nExpecting:%n <%s>%nto be after or equals to:%n <%s>%s", actual, other, comparisonStrategy); } }
[ "joel.costigliola@gmail.com" ]
joel.costigliola@gmail.com
d548261279bce98b4937560b7f2dc230c7057296
7c46a44f1930b7817fb6d26223a78785e1b4d779
/store/src/java/com/zimbra/cs/service/admin/GetAllCalendarResources.java
bdd3244b7b8a9356e03de9ea878d5381304a4862
[]
no_license
Zimbra/zm-mailbox
20355a191c7174b1eb74461a6400b0329907fb02
8ef6538e789391813b65d3420097f43fbd2e2bf3
refs/heads/develop
2023-07-20T15:07:30.305312
2023-07-03T06:44:00
2023-07-06T10:09:53
85,609,847
67
128
null
2023-09-14T10:12:10
2017-03-20T18:07:01
Java
UTF-8
Java
false
false
2,994
java
/* * ***** BEGIN LICENSE BLOCK ***** * Zimbra Collaboration Suite Server * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2013, 2014, 2016 Synacor, Inc. * * 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, * version 2 of the License. * * 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 <https://www.gnu.org/licenses/>. * ***** END LICENSE BLOCK ***** */ package com.zimbra.cs.service.admin; import java.util.List; import org.dom4j.QName; import com.zimbra.common.service.ServiceException; import com.zimbra.common.soap.AdminConstants; import com.zimbra.common.soap.Element; import com.zimbra.cs.account.Account; import com.zimbra.cs.account.CalendarResource; import com.zimbra.cs.account.Domain; import com.zimbra.cs.account.NamedEntry; import com.zimbra.cs.account.Provisioning; import com.zimbra.cs.account.Server; import com.zimbra.cs.account.accesscontrol.AdminRight; import com.zimbra.cs.account.accesscontrol.Rights.Admin; import com.zimbra.cs.service.admin.GetAllAccounts.AccountVisitor; import com.zimbra.soap.ZimbraSoapContext; /** * @author jhahm */ public class GetAllCalendarResources extends GetAllAccounts { protected QName getResponseQName() { return AdminConstants.GET_ALL_CALENDAR_RESOURCES_RESPONSE; } protected static class CalendarResourceVisitor extends AccountVisitor { CalendarResourceVisitor(ZimbraSoapContext zsc, AdminDocumentHandler handler, Element parent) throws ServiceException { super(zsc, handler, parent); } public void visit(com.zimbra.cs.account.NamedEntry entry) throws ServiceException { if (mHandler.hasRightsToList(mZsc, entry, Admin.R_listCalendarResource, null)) ToXML.encodeCalendarResource(mParent, (CalendarResource)entry, true, null, mAAC.getAttrRightChecker(entry)); } } /* * server s is not used, need to use the same signature as GetAllAccounts.doDomain * so the overridden doDomain is called. */ protected void doDomain(ZimbraSoapContext zsc, final Element e, Domain d, Server s) throws ServiceException { CalendarResourceVisitor visitor = new CalendarResourceVisitor(zsc, this, e); Provisioning.getInstance().getAllCalendarResources(d, s, visitor); } @Override public void docRights(List<AdminRight> relatedRights, List<String> notes) { relatedRights.add(Admin.R_listCalendarResource); relatedRights.add(Admin.R_getCalendarResource); notes.add(AdminRightCheckPoint.Notes.LIST_ENTRY); } }
[ "shriram.vishwanathan@synacor.com" ]
shriram.vishwanathan@synacor.com
ca3db093a32747760d275635db1a48d78ab95e9a
fff8d45864fdca7f43e6d65acbe4c1f469531877
/erp_desktop_all/src_nomina/com/bydan/erp/nomina/presentation/swing/jinternalframes/FuncionBeanSwingJInternalFrameAdditional.java
7093513357a63f6fb1748c7930619d48fc9080aa
[ "Apache-2.0" ]
permissive
jarocho105/pre2
26b04cc91ff1dd645a6ac83966a74768f040f418
f032fc63741b6deecdfee490e23dfa9ef1f42b4f
refs/heads/master
2020-09-27T16:16:52.921372
2016-09-01T04:34:56
2016-09-01T04:34:56
67,095,806
1
0
null
null
null
null
UTF-8
Java
false
false
5,410
java
/* *ADVERTENCIA : Este programa esta protegido por la ley de derechos de autor. *La reproducci?n o distribuci?n il?cita de este programa o de cualquiera de *sus partes esta penado por la ley con severas sanciones civiles y penales, *y ser?n objeto de todas las sanciones legales que correspondan. */ package com.bydan.erp.nomina.presentation.swing.jinternalframes; import com.bydan.erp.seguridad.business.entity.Usuario; import com.bydan.erp.seguridad.business.entity.PerfilOpcion; import com.bydan.erp.seguridad.business.entity.PerfilCampo; import com.bydan.erp.seguridad.business.entity.PerfilAccion; import com.bydan.erp.seguridad.business.entity.ParametroGeneralSg; import com.bydan.erp.seguridad.business.entity.ParametroGeneralUsuario; import com.bydan.erp.seguridad.business.entity.Modulo; import com.bydan.erp.seguridad.business.entity.Opcion; import com.bydan.framework.erp.business.entity.*; import com.bydan.framework.erp.util.*; import com.bydan.erp.nomina.util.FuncionConstantesFunciones; import com.bydan.erp.nomina.business.entity.Funcion; import com.bydan.erp.nomina.business.logic.*; //import com.bydan.erp.nomina.service.ejb.interfaces.FuncionAdditionable; ////import com.bydan.erp.nomina.service.ejb.interfaces.FuncionAdditionableHome; //import com.bydan.erp.nomina.business.entity.*; //import com.bydan.framework.erp.business.logic.QueryWhereSelectParameters; //import com.bydan.framework.erp.business.logic.*; //import java.util.ArrayList; import java.util.List; import java.util.Set; import java.util.HashSet; import java.util.ArrayList; import javax.swing.*; import java.awt.*; import java.awt.event.*; import javax.swing.event.*; import javax.swing.GroupLayout.Alignment; import org.hibernate.collection.PersistentBag; import com.bydan.framework.erp.presentation.desktop.swing.JInternalFrameBase; import javax.swing.JTree; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.TreeModel; import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.TreeSelectionModel; import javax.swing.tree.TreePath; import javax.swing.tree.MutableTreeNode; import javax.swing.event.TreeSelectionEvent; import javax.swing.event.TreeSelectionListener; import com.bydan.framework.erp.business.entity.DatoGeneral; //import javax.servlet.http.HttpSession; //import javax.servlet.ServletConfig; //CONTROL_INCLUDE @SuppressWarnings("unused") public class FuncionBeanSwingJInternalFrameAdditional extends JInternalFrameBase//FuncionBeanSwingJInternalFrame { private static final long serialVersionUID = 1L; //CONTROL_INICIO FuncionLogic funcionLogic; FuncionLogicAdditional funcionLogicAdditional; Mensaje mensaje; public static int openFrameCount = 0; public static final int xOffset = 10, yOffset = 35; public FuncionBeanSwingJInternalFrameAdditional(PaginaTipo paginaTipo) throws Exception { super(paginaTipo); try { funcionLogic=new FuncionLogic(); funcionLogicAdditional=new FuncionLogicAdditional(); } catch(Exception e) { throw e; } } //CONTROL_FUNCION1 public static void RecargarFormFuncion(FuncionBeanSwingJInternalFrame funcionBeanSwingJInternalFrame,String sTipo,Object oValor,ArrayList<DatoGeneral> arrDatoGeneral) throws Exception { //CONTROL_1 } public static void RecargarVentanaSegunOpcion(JInternalFrameBase jInternalFrameBase,Opcion opcionActual) throws Exception { //CONTROL_2 } public static void ProcesarAccion(String sProceso,String sLabelProceso,JInternalFrameBase jInternalFrameBase) throws Exception { //CONTROL_3 } public static void CargaInicial(JInternalFrameBase jInternalFrameBase,String sTipo,Object objectGeneral) throws Exception { //CONTROL_4 } public static void CargaInicialInicio(JInternalFrameBase jInternalFrameBase,String sTipo,Object objectGeneral) throws Exception { //CONTROL_5 } public static Boolean EsProcesoAccionNormal(String sTipoProceso) throws Exception { //CONTROL_6 Boolean esProcesoAccionNormal=true; if(sTipoProceso.equals("XYZ")) { //esProcesoAccionNormal=false; } return esProcesoAccionNormal; } public static GeneralEntityParameterReturnGeneral procesarEventosVista(ParametroGeneralUsuario parametroGeneralUsuario,Modulo modulo,Opcion opcion,Usuario usuario,JInternalFrameBase jInternalFrameBase,FuncionTipo funcionTipo,ControlTipo controlTipo,EventoTipo eventoTipo,EventoSubTipo eventoSubTipo,String sTipo,Object object,Object objects,GeneralEntityParameterReturnGeneral generalEntityParameterGeneral,GeneralEntityParameterReturnGeneral generalEntityReturnGeneral)throws Exception { try { //CONTROL_7 if(controlTipo.equals(ControlTipo.WINDOW)) { } else if(controlTipo.equals(ControlTipo.PANEL)) { } else if(controlTipo.equals(ControlTipo.FORM)) { } else if(controlTipo.equals(ControlTipo.BUTTON)) { } else if(controlTipo.equals(ControlTipo.COMBOBOX)) { } else if(controlTipo.equals(ControlTipo.TEXTBOX)) { } else if(controlTipo.equals(ControlTipo.CHECKBOX)) { } else if(controlTipo.equals(ControlTipo.TEXTAREA)) { } else if(controlTipo.equals(ControlTipo.TREE)) { } return generalEntityReturnGeneral; } catch(Exception e) { throw e; } finally { } } //CONTROL_FUNCION2 }
[ "byrondanilo10@hotmail.com" ]
byrondanilo10@hotmail.com
59b62fc10cf2032c2092ffbfa4a5b5b7310cf1ae
3dd35c0681b374ce31dbb255b87df077387405ff
/generated/entity/windowed/PolicyAddressVersionList.java
f14743caeccc62cf172f1c7aaecbbaa6a6365109
[]
no_license
walisashwini/SBTBackup
58b635a358e8992339db8f2cc06978326fed1b99
4d4de43576ec483bc031f3213389f02a92ad7528
refs/heads/master
2023-01-11T09:09:10.205139
2020-11-18T12:11:45
2020-11-18T12:11:45
311,884,817
0
0
null
null
null
null
UTF-8
Java
false
false
511
java
package entity.windowed; @javax.annotation.Generated(value = "com.guidewire.pl.metadata.codegen.Codegen", comments = "PolicyAddress.eti;PolicyAddress.eix;PolicyAddress.etx") @java.lang.SuppressWarnings(value = {"deprecation", "unchecked"}) @gw.lang.SimplePropertyProcessing public interface PolicyAddressVersionList extends gw.pl.persistence.core.effdate.EffDatedVersionList { entity.PolicyAddress AsOf(java.util.Date date); java.util.List<? extends entity.PolicyAddress> getAllVersions(); }
[ "ashwini@cruxxtechnologies.com" ]
ashwini@cruxxtechnologies.com
896cdfe4d9cd3ae6301ab0d0a2b46929a3546e8b
d1aa387f63c1388e01408929031d2757f0566566
/src/test/java/com/tw/apistackbase/EmployeeControllerTest.java
4a7b5da4015f9e35cafb331d2090fb49c4503b86
[]
no_license
Lidongpeng1/springboot-stack-2019-7-16-9-35-9-633
e2cc4e1109e508976ebdb91f83d0fd4bb0c0d8ca
648eb76f3f34126d21ec52bad99b07e3dd2c1059
refs/heads/master
2020-06-20T17:45:20.918564
2019-07-17T13:52:51
2019-07-17T13:52:51
197,197,209
0
0
null
2019-07-16T13:14:52
2019-07-16T13:14:52
null
UTF-8
Java
false
false
3,740
java
package com.tw.apistackbase; import com.tw.apistackbase.controller.Company; import com.tw.apistackbase.controller.Employee; import org.json.JSONArray; import org.json.JSONObject; import org.junit.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.MediaType; import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.MvcResult; import java.util.ArrayList; import java.util.List; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @RunWith(SpringRunner.class) @AutoConfigureMockMvc @ExtendWith(SpringExtension.class) @SpringBootTest public class EmployeeControllerTest { @Autowired private MockMvc mockMvc; @Test public void contextLoads() { } @Test public void return_all_employee_when_get_employee() throws Exception { final MvcResult mvcResult = mockMvc.perform(get("/employees")).andExpect(status().isOk()).andReturn(); JSONArray jsonArray = new JSONArray(mvcResult.getResponse().getContentAsString()); assertEquals("employeeone", jsonArray.getJSONObject(0).getString("employeeName")); assertEquals(20, jsonArray.getJSONObject(0).getInt("employeeAge")); assertEquals("F", jsonArray.getJSONObject(0).getString("employeeGender")); } @Test public void return_employee_when_get_employee_0() throws Exception { final MvcResult mvcResult = mockMvc.perform(get("/employees/0")).andExpect(status().isOk()).andReturn(); JSONObject jsonArray = new JSONObject(mvcResult.getResponse().getContentAsString()); assertEquals(0, jsonArray.getInt("employeeId")); assertEquals("employeeone", jsonArray.getString("employeeName")); assertEquals(20, jsonArray.getInt("employeeAge")); } @Test public void return_status_is_created_when_put_new_employee() throws Exception { Employee employee = new Employee(1, "employeethree", 20, "M"); JSONObject jsonObject = new JSONObject(employee); String objectJson = jsonObject.toString(); this.mockMvc.perform(post("/employees").contentType(MediaType.APPLICATION_JSON_UTF8) .content(objectJson)).andExpect(status().isCreated()); } @Test public void return_revised_employee_when_put_employee_info() throws Exception { Employee employee = new Employee(2, "employeethree", 22, "M"); JSONObject jsonObject = new JSONObject(employee); String objectJson = jsonObject.toString(); String content = this.mockMvc.perform(put("/employees/0").contentType(MediaType.APPLICATION_JSON_UTF8) .content(objectJson)).andExpect(status().isOk()).andReturn().getResponse().getContentAsString(); JSONObject jobj = new JSONObject(content); assertEquals("enployeethree", jobj.get("employeeName")); assertEquals("M", jobj.get("employeeGender")); } // @Test // public void should_return_status_code_200_when_delete_success() throws Exception { // this.mockMvc.perform(delete("/employees/0")).andExpect(status().isOk()); // } }
[ "l" ]
l
a767bf1355c0affb58817a81bc226835757a3f1c
4cfc9837cef75af10d4ec549bb73a6b61fce6692
/Chapter 11/Converters/src/main/java/com/oreilly/sdata/BookUtil.java
fdb719c866b6ca2c1a4280ae4483c862a63b7ef1
[]
no_license
noctuaIv/-oreilly--spring-data-for-java-developers
c95c71a93999b3e6f09d8d36e12a17f83bf53917
1c835a2f2700b492d4ffdaa94fa0f8b7e4398b83
refs/heads/master
2020-04-28T21:51:28.191946
2019-03-14T10:13:19
2019-03-14T10:13:19
175,596,869
0
0
null
null
null
null
UTF-8
Java
false
false
1,747
java
package com.oreilly.sdata; import java.math.BigDecimal; import java.util.Date; import java.util.LinkedList; import java.util.List; import java.util.concurrent.ThreadLocalRandom; public class BookUtil { private static String[] titles = { "Don Quixote", "1984", "Adventures of Huckleberry Finn", "Ulysses", "The Great Gatsby", "On The Road", "Catch 22", "To Kill A Mockingbird", "Brave New World", "The Scarlet Letter" }; private static String[][] authors = { { "Ernest", "Hemmingway" }, { "Mark", "Twain" }, { "Charles", "Dickens" }, { "George", "Orwell" }, { "Leo", "Tolstoy" }, { "Mark", "Twain" }, { "Oscar", "Wilde" }, { "John", "Steinbeck" } }; private static String[] countries = { "United States", "Cuba", "Australia", "Russia", "Canda" }; private static String[] tags = { "Classic", "Novel", "Best Seller", "Must Read" }; public static List<Book> create(int size) { List<Book> books = new LinkedList<Book>(); for (int x = 0; x < size; x++) { books.add(BookUtil.create()); } return books; } public static Book create() { Book book = new Book(); book.setTitle(titles[ThreadLocalRandom.current().nextInt(1, titles.length - 1)]); book.setPageCount(ThreadLocalRandom.current().nextInt(100, 151)); book.setPublishDate(new Date()); book.setPrice(new BigDecimal("15.00")); Author author = new Author(); String[] tmpAuthor = authors[ThreadLocalRandom.current().nextInt(1, authors.length - 1)]; author.setFirstName(tmpAuthor[0]); author.setLastName(tmpAuthor[1]); author.setCountry(countries[ThreadLocalRandom.current().nextInt(1, countries.length - 1)]); book.setAuthor(author); book.getTags().add(tags[ThreadLocalRandom.current().nextInt(1, countries.length - 1)]); return book; } }
[ "noctua.vt@gmail.com" ]
noctua.vt@gmail.com
198e66cd0c48023440f30474695eb5869f214528
b4420eef1cb3289449cbcd52f98aa618332e53cf
/office/src/main/java/com/hunglv/office/fc/hssf/record/chart/SeriesLabelsRecord.java
4de7c55d0cb58975f792fe5103e2e7671c8f7114
[]
no_license
hunglvv/TestDocument
941a3bd9560ef3bef9a93eab70964a04cc03e620
d1cdce4c61377f0118440138acb7f0bf3f3d4b6d
refs/heads/main
2023-03-11T12:33:50.022945
2021-03-02T10:33:31
2021-03-02T10:33:31
342,557,038
0
0
null
null
null
null
UTF-8
Java
false
false
6,898
java
/* ==================================================================== Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ package com.hunglv.office.fc.hssf.record.chart; import com.hunglv.office.fc.hssf.record.RecordInputStream; import com.hunglv.office.fc.hssf.record.StandardRecord; import com.hunglv.office.fc.util.BitField; import com.hunglv.office.fc.util.BitFieldFactory; import com.hunglv.office.fc.util.HexDump; import com.hunglv.office.fc.util.LittleEndianOutput; /** * The series label record defines the type of label associated with the data format record.<p/> * * @author Glen Stampoultzis (glens at apache.org) */ public final class SeriesLabelsRecord extends StandardRecord { public final static short sid = 0x100c; private static final BitField showActual = BitFieldFactory.getInstance(0x01); private static final BitField showPercent = BitFieldFactory.getInstance(0x02); private static final BitField labelAsPercentage = BitFieldFactory.getInstance(0x04); private static final BitField smoothedLine = BitFieldFactory.getInstance(0x08); private static final BitField showLabel = BitFieldFactory.getInstance(0x10); private static final BitField showBubbleSizes = BitFieldFactory.getInstance(0x20); private short field_1_formatFlags; public SeriesLabelsRecord() { } public SeriesLabelsRecord(RecordInputStream in) { field_1_formatFlags = in.readShort(); } public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append("[ATTACHEDLABEL]\n"); buffer.append(" .formatFlags = ") .append("0x").append(HexDump.toHex( getFormatFlags ())) .append(" (").append( getFormatFlags() ).append(" )"); buffer.append(System.getProperty("line.separator")); buffer.append(" .showActual = ").append(isShowActual()).append('\n'); buffer.append(" .showPercent = ").append(isShowPercent()).append('\n'); buffer.append(" .labelAsPercentage = ").append(isLabelAsPercentage()).append('\n'); buffer.append(" .smoothedLine = ").append(isSmoothedLine()).append('\n'); buffer.append(" .showLabel = ").append(isShowLabel()).append('\n'); buffer.append(" .showBubbleSizes = ").append(isShowBubbleSizes()).append('\n'); buffer.append("[/ATTACHEDLABEL]\n"); return buffer.toString(); } public void serialize(LittleEndianOutput out) { out.writeShort(field_1_formatFlags); } protected int getDataSize() { return 2; } public short getSid() { return sid; } public Object clone() { SeriesLabelsRecord rec = new SeriesLabelsRecord(); rec.field_1_formatFlags = field_1_formatFlags; return rec; } /** * Get the format flags field for the SeriesLabels record. */ public short getFormatFlags() { return field_1_formatFlags; } /** * Set the format flags field for the SeriesLabels record. */ public void setFormatFlags(short field_1_formatFlags) { this.field_1_formatFlags = field_1_formatFlags; } /** * Sets the show actual field value. * show actual value of the data point */ public void setShowActual(boolean value) { field_1_formatFlags = showActual.setShortBoolean(field_1_formatFlags, value); } /** * show actual value of the data point * @return the show actual field value. */ public boolean isShowActual() { return showActual.isSet(field_1_formatFlags); } /** * Sets the show percent field value. * show value as percentage of total (pie charts only) */ public void setShowPercent(boolean value) { field_1_formatFlags = showPercent.setShortBoolean(field_1_formatFlags, value); } /** * show value as percentage of total (pie charts only) * @return the show percent field value. */ public boolean isShowPercent() { return showPercent.isSet(field_1_formatFlags); } /** * Sets the label as percentage field value. * show category label/value as percentage (pie charts only) */ public void setLabelAsPercentage(boolean value) { field_1_formatFlags = labelAsPercentage.setShortBoolean(field_1_formatFlags, value); } /** * show category label/value as percentage (pie charts only) * @return the label as percentage field value. */ public boolean isLabelAsPercentage() { return labelAsPercentage.isSet(field_1_formatFlags); } /** * Sets the smoothed line field value. * show smooth line */ public void setSmoothedLine(boolean value) { field_1_formatFlags = smoothedLine.setShortBoolean(field_1_formatFlags, value); } /** * show smooth line * @return the smoothed line field value. */ public boolean isSmoothedLine() { return smoothedLine.isSet(field_1_formatFlags); } /** * Sets the show label field value. * display category label */ public void setShowLabel(boolean value) { field_1_formatFlags = showLabel.setShortBoolean(field_1_formatFlags, value); } /** * display category label * @return the show label field value. */ public boolean isShowLabel() { return showLabel.isSet(field_1_formatFlags); } /** * Sets the show bubble sizes field value. * ?? */ public void setShowBubbleSizes(boolean value) { field_1_formatFlags = showBubbleSizes.setShortBoolean(field_1_formatFlags, value); } /** * ?? * @return the show bubble sizes field value. */ public boolean isShowBubbleSizes() { return showBubbleSizes.isSet(field_1_formatFlags); } }
[ "hunglv@solarapp.asia" ]
hunglv@solarapp.asia
e2383dba6e35b24792271b54befc60e9c3574c93
3ef55e152decb43bdd90e3de821ffea1a2ec8f75
/large/module1714/src/java/module1714/a/IFoo2.java
6690440478f3e8662ff04c12d9c6c0425abc7563
[ "BSD-3-Clause" ]
permissive
salesforce/bazel-ls-demo-project
5cc6ef749d65d6626080f3a94239b6a509ef145a
948ed278f87338edd7e40af68b8690ae4f73ebf0
refs/heads/master
2023-06-24T08:06:06.084651
2023-03-14T11:54:29
2023-03-14T11:54:29
241,489,944
0
5
BSD-3-Clause
2023-03-27T11:28:14
2020-02-18T23:30:47
Java
UTF-8
Java
false
false
779
java
package module1714.a; import javax.annotation.processing.*; import javax.lang.model.*; import javax.management.*; /** * Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut * labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. * Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. * * @see java.io.File * @see java.rmi.Remote * @see java.nio.file.FileStore */ @SuppressWarnings("all") public interface IFoo2<Q> extends module1714.a.IFoo0<Q> { java.sql.Array f0 = null; java.util.logging.Filter f1 = null; java.util.zip.Deflater f2 = null; String getName(); void setName(String s); Q get(); void set(Q e); }
[ "gwagenknecht@salesforce.com" ]
gwagenknecht@salesforce.com
e2888114e8df4dd265f9454a55ada55f21dec7a6
9a5a6329b31c72c9bb87e1ce497f7b566f5a7186
/demo-iciql/src/main/java/com/example/iciql/Base.java
5a1167a020bc8b3794bc09cdb954990ef1fcd6f7
[]
no_license
garbagetown/spring-boot-db-samples
d8d569e43c969a3274188be81529415f8a076c4e
8fe9bc76ef29410bdba67ecb777a47eccb12256a
refs/heads/master
2021-01-17T22:21:03.737258
2016-07-26T09:34:28
2016-07-26T09:34:28
63,080,374
0
1
null
2016-07-11T15:37:26
2016-07-11T15:37:26
null
UTF-8
Java
false
false
253
java
package com.example.iciql; import com.iciql.Iciql.IQColumn; import com.iciql.Iciql.IQTable; @IQTable(name = "base") public class Base { @IQColumn(primaryKey = true, autoIncrement = true) public Long id; @IQColumn public String name; }
[ "backpaper0@gmail.com" ]
backpaper0@gmail.com
e08f290091712f2b1f1ecabf96c4c30e5deaf5c4
4e4beb1bb07ee57f239157f26a35b03f1c1089af
/CollectionLearn/src/collection1/CollectionTest.java
7059f4d83b7a5770dd16ee7c0fedd4dc2a87fea9
[]
no_license
Mbabysbreath/JavaReview
b0957ab3e167e2e80c565f795b85d9c8dce63a64
4948c41e6520f77481fc04f1c88c3460d76566a7
refs/heads/master
2020-12-09T13:45:02.078207
2020-04-22T15:55:26
2020-04-22T15:55:26
232,775,860
0
0
null
null
null
null
UTF-8
Java
false
false
7,554
java
package collection1; import com.sun.nio.sctp.PeerAddressChangeNotification; import org.junit.Test; import java.util.*; /** * 一、集合框架的概述: * 1.集合、数组都是对多个数据进行存储操作的结构,简称Java容器 * 说明:此时的存储,主要怕指的是内存层面的存储,不涉及到持久化的存储(数据库中的数据) * (1)数组在存储多个数据方面的特点: * 》一旦初始化以后,其长度就确定了 * 》数组一旦定义好,其元素的类型也就确定了。我们就只能操作指定类型的数据 * 》比如:String[] arr,int[] arr,Object[] arr * (2)数组在存储多个数据方面的缺点: * 》一旦初始化以后,其长度就确定了 * 》数组中提供的方法非常有限,对于添加、删除、插入数据等操作,非常不便,同时效率不高 * 》获取数组中实际元素的个数的需求,数组没有现成的属性或方法可以用 * 》数组存储数据的特点:有序可重复,对于无序不可重复的需求,不能满足 * 二、集合框架 * |------Collection接口:单列集合,用来存储一个一个的对象 * |----List接口:有序的可重复的数据,”动态“的数组 * |----ArrayList\LinkedList\Vector * |----Set接口:无序的不可重复的数据---》高中的”集合“ * |----HashSet\LinkedHashSet\TreeSet * |------Map接口:双列集合,用来存储一对(key-value)一对的数据--》高中函数(v)y=f(x)(k) * 一个key只能对应一个value(一对多) * |---HashMap\LinkedHashMap\TreeMap\Hashtable\Properties *三、Collection接口中的方法的使用 * 结论: *向Collection接口的实现类的对象中添加数据obj时,要求obj所在类要重写equals() * @author zhaomin * @date 2020/2/5 18:29 */ public class CollectionTest { @Test public void test(){ Collection coll=new ArrayList(); //add(Object e):将元素e添加到集合coll coll.add("AA"); coll.add("BB"); coll.add(123);//自动装箱 coll.add(new Date()); //size():获取添加的元素的个数 System.out.println(coll.size()); //addAll(Collection coll2);将coll2集合中的元素全部添加到当前的集合中 Collection coll2=new ArrayList(); coll2.add("DD"); coll2.add("DD"); coll.addAll(coll2); System.out.println(coll.size()); //clear():将集合中的元素清空,不是将对象清为null coll.clear(); System.out.println(coll.size()); //isEmpty():判断当前集合是否为空 System.out.println(coll.isEmpty()); } @Test public void test1(){ Collection coll=new ArrayList(); coll.add(123); coll.add("abc"); coll.add(new String("sdf")); coll.add(new Person("Z",11)); coll.add(122); Person p=new Person("ZhaoMin",20); coll.add(p); coll.add(new Person("WangYiBo",22)); //contains(Object obj);判断当前集合中是否包含obj,equals比较 boolean contains=coll.contains(123); System.out.println(contains); System.out.println(coll.contains(new String("abc"))); System.out.println(coll.contains(new String("sdf"))); System.out.println(coll.contains(p));//true System.out.println(coll.contains(new Person("ZhaoMin", 20)));//false,如果Person类没有重写equals() //containsAll(Collection coll1);判断形参coll1中的所有是否都存在于当前集合中 System.out.println("******"); Collection coll1= Arrays.asList(123,"abc",new Person("Z",11)); System.out.println(coll.containsAll(coll1)); } @Test public void test2(){ Collection coll=new ArrayList(); coll.add(123); coll.add("abc"); coll.add(new String("sdf")); Person p=new Person("ZhaoMin",20); coll.add(p); coll.add(new Person("WangYiBo",22)); //remove(Object obj) boolean remove = coll.remove(123); System.out.println(remove); System.out.println(coll.remove(234)); System.out.println(coll.remove(new Person("ZhaoMin", 20))); System.out.println(coll); //removeAll(Collection coll1);差集:从当前集合中移除coll1中所有的元素 System.out.println("***********"); Collection coll1=Arrays.asList(123,234); System.out.println(coll.removeAll(coll1)); } @Test public void test3(){ Collection coll=new ArrayList(); coll.add(123); coll.add("abc"); coll.add(new String("sdf")); Person p=new Person("ZhaoMin",20); coll.add(p); coll.add(new Person("WangYiBo",22)); //retainAll(Collection coll1);交集:获取当前集合与coll1集合的交集,并修改当前集合为交集 Collection coll1=Arrays.asList(123,234,new Person("WangYiBo",22)); boolean retain=coll.retainAll(coll1); System.out.println(retain); System.out.println(coll); //equals(Object obj);要想返回true,需要当前集合和形参集合的元素都相同, //至于顺序差别对结果的影响,需要看是ArrayList(顺序不同,接果为false)还是HashSet等 Collection coll2=new ArrayList(); coll2.add(123); coll2.add("abc"); coll2.add(new String("sdf")); Person p1=new Person("ZhaoMin",20); coll2.add(p1); coll2.add(new Person("WangYiBo",22)); System.out.println(coll2.equals(coll2)); } @Test public void test4(){ Collection coll=new ArrayList(); coll.add(123); coll.add("abc"); coll.add(new String("sdf")); Person p=new Person("ZhaoMin",20); coll.add(p); coll.add(new Person("WangYiBo",22)); //hashCode():返回当前对象的哈希值 System.out.println(coll.hashCode()); //集合---》数组:toArray() Object[] arr=coll.toArray(); System.out.println(Arrays.toString(arr)); //拓展:数组--》集合:Arrays.asList() List<String> list = Arrays.asList(new String[]{"AA", "BB", "CC"}); List<String> list4 = Arrays.asList("AA", "BB", "CC"); System.out.println(list); System.out.println(list4); List<Integer> list1 = Arrays.asList(123, 23); List<Integer> list2 = Arrays.asList(new Integer[]{123, 23}); List<int[]> list3 = Arrays.asList(new int[]{123, 23}); System.out.println(list1); System.out.println(list2); System.out.println(list3); //iterator():返回Iterator接口的实例,用于遍历集合元素,放在IteratorTest.java中 } @Test public void test5(){ System.out.println(isExists("abc","ac")); } private boolean isExists(String s1,String s2){ char[] arr1=s1.toCharArray(); Character[] a = new Character[arr1.length]; for(int i=0;i<arr1.length;i++){ a[i]=arr1[i]; } char[] arr2=s2.toCharArray(); Character[] a2 = new Character[arr2.length]; for(int i=0;i<arr2.length;i++){ a2[i]=arr2[i]; } List<Character> list1=Arrays.asList(a); List<Character> list2=Arrays.asList(a2); if(list1.containsAll(list2)){ return true; } return false; } }
[ "1830817543@qq.com" ]
1830817543@qq.com
7c38ab80e2c36c1abc3df98efc3925cf2e0c72a2
445c3cf84dd4bbcbbccf787b2d3c9eb8ed805602
/aliyun-java-sdk-dyplsapi/src/main/java/com/aliyuncs/dyplsapi/model/v20170525/GetSecretAsrDetailRequest.java
b01807e05068449c7d3fc16ae87172014d4b37b2
[ "Apache-2.0" ]
permissive
caojiele/aliyun-openapi-java-sdk
b6367cc95469ac32249c3d9c119474bf76fe6db2
ecc1c949681276b3eed2500ec230637b039771b8
refs/heads/master
2023-06-02T02:30:02.232397
2021-06-18T04:08:36
2021-06-18T04:08:36
172,076,930
0
0
NOASSERTION
2019-02-22T14:08:29
2019-02-22T14:08:29
null
UTF-8
Java
false
false
2,089
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 com.aliyuncs.dyplsapi.model.v20170525; import com.aliyuncs.RpcAcsRequest; import com.aliyuncs.http.MethodType; import com.aliyuncs.dyplsapi.Endpoint; /** * @author auto create * @version */ public class GetSecretAsrDetailRequest extends RpcAcsRequest<GetSecretAsrDetailResponse> { private String callId; private String callTime; private String poolKey; public GetSecretAsrDetailRequest() { super("Dyplsapi", "2017-05-25", "GetSecretAsrDetail", "dyplsapi"); setMethod(MethodType.POST); try { com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap); com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType); } catch (Exception e) {} } public String getCallId() { return this.callId; } public void setCallId(String callId) { this.callId = callId; if(callId != null){ putQueryParameter("CallId", callId); } } public String getCallTime() { return this.callTime; } public void setCallTime(String callTime) { this.callTime = callTime; if(callTime != null){ putQueryParameter("CallTime", callTime); } } public String getPoolKey() { return this.poolKey; } public void setPoolKey(String poolKey) { this.poolKey = poolKey; if(poolKey != null){ putQueryParameter("PoolKey", poolKey); } } @Override public Class<GetSecretAsrDetailResponse> getResponseClass() { return GetSecretAsrDetailResponse.class; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
b5c851ec8133c37d5a20c7e81786e1a82c9c617f
cdab26c7d4bdfa4145004f21a1c9d9ab4baf4cfb
/src/main/java/com/vcredit/jdev/p2p/enums/MessageReadStatusEnum.java
6b20d9b3ead446a8c4de6ef0615d2279d450a171
[]
no_license
gspandy/p2p-server
eaec4e0cbdd37d5a3851dd528c54d5edd51b853c
6792ed9fd9cdef0bbeb4d63169024d0574928d1d
refs/heads/master
2023-08-09T23:25:30.229310
2015-05-08T04:40:46
2015-05-08T04:40:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
360
java
package com.vcredit.jdev.p2p.enums; /** * @ClassName: MessageReadStatus * @Description: * @author ChenChang * @date 2015年1月6日 上午10:05:50 */ public enum MessageReadStatusEnum { READ(0), //已读 UNREAD(1);//未读 private int code; MessageReadStatusEnum(int code) { this.code = code; } public int getCode() { return this.code; } }
[ "372594984@qq.com" ]
372594984@qq.com
70208ee063f24dc082e6a70d603ef3487b52d421
c95b26c2f7dd77f5e30e2d1cd1a45bc1d936c615
/HibernateTest/src/main/java/com/bookstore/Main.java
e0baa098dc4635a44ef60233681b556c724800c4
[]
no_license
ostigter/testproject3
b918764f5c7d4c10d3846411bd9270ca5ba2f4f2
2d2336ef19631148c83636c3e373f874b000a2bf
refs/heads/master
2023-07-27T08:35:59.212278
2023-02-22T09:10:45
2023-02-22T09:10:45
41,742,046
2
1
null
2023-07-07T22:07:12
2015-09-01T14:02:08
Java
UTF-8
Java
false
false
1,423
java
package com.bookstore; import java.util.List; import org.apache.log4j.Logger; import com.bookstore.dao.CustomerDao; import com.bookstore.dao.hibernate.HibernateCustomerDao; import com.bookstore.domain.Customer; /** * Test driver for the BookStore application with Hibernate. * * @author Oscar Stigter */ public class Main { private static final Logger logger = Logger.getLogger(Main.class); public static void main(String[] args) throws Exception { logger.info("Started"); // Get the customer DAO (normally injected with Spring). CustomerDao customerDao = new HibernateCustomerDao(); // Create new customer. Customer customer = new Customer(); customer.setLastName("Klaassen"); customer.setFirstName("Jan"); customerDao.create(customer); // Retrieve all customers. List<Customer> customers = customerDao.retrieveAll(); for (Customer c : customers) { logger.info(String.format("Retrieved customer: '%s'", c)); } // Update customer. customer.setLastName("Janssen"); customerDao.update(customer); // Retrieve customer by ID. int id = 1; customer = customerDao.retrieveById(id); if (customer != null) { logger.info(String.format("Retrieved customer by ID: '%s'", customer)); } else { logger.error(String.format("Customer by ID %d not found", id)); } // Delete customer. customerDao.delete(customer); logger.info("Finished"); } }
[ "oscar.stigter@e0aef87a-ea4e-0410-81cd-4b1fdc67522b" ]
oscar.stigter@e0aef87a-ea4e-0410-81cd-4b1fdc67522b
8acd90d4aecd20fa5586ee0411e7c002e1c18172
f62d998a6fc87c84227be8eb81e4bf14b2e196e8
/流程/comp/Check/localClassName.java
b8c7f48b7a0bf04d6fa82ff7cc22f6c59716bcc0
[]
no_license
cylee0909/Javac-Research
14121f13e7189a141747009a5f1e08a2195c994e
3b767454d837e01593a68ec281ea68caec8a8c74
refs/heads/master
2021-01-21T00:59:27.787365
2016-07-01T11:16:53
2016-07-01T11:16:53
61,563,719
3
3
null
2016-06-20T16:39:29
2016-06-20T16:39:23
null
UTF-8
Java
false
false
685
java
/* ************************************************************************* * Class name generation **************************************************************************/ /** Return name of local class. * This is of the form <enclClass> $ n <classname> * where * enclClass is the flat name of the enclosing class, * classname is the simple name of the local class */ Name localClassName(ClassSymbol c) { for (int i=1; ; i++) { Name flatname = names. fromString("" + c.owner.enclClass().flatname + target.syntheticNameChar() + i + c.name); if (compiled.get(flatname) == null) return flatname; } }
[ "zhh200910@gmail.com" ]
zhh200910@gmail.com
ff8b5b6100f557ce53fc3f2832000a099c7c4d59
badb628afabf45dbbf054bc55f3d3423a96f3c24
/backend_show/backend_show_consumer/src/main/java/com/mooc/meetingfilm/feignconf/FeignHelloConf.java
83f0d4e2e5ee909e7669d088d0b2fd665b6121cb
[]
no_license
oweson/malleye_backend-parent
bd1770d856a525c142c347a75188e6e6594f1629
e23145bf7c851edb5b03baceb2b938332bee6b90
refs/heads/master
2022-12-18T01:45:11.830252
2020-09-26T06:58:29
2020-09-26T06:58:29
293,290,748
0
1
null
null
null
null
UTF-8
Java
false
false
413
java
package com.mooc.meetingfilm.feignconf; import feign.Contract; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; /** * @author : jiangzh * @program : com.mooc.meetingfilm.feignconf * @description : **/ @Configuration public class FeignHelloConf { @Bean public Contract contract(){ return new feign.Contract.Default(); } }
[ "570347720@qq.com" ]
570347720@qq.com
db0b967618b838b630cbd7737b7d74472e0b2435
73925750d91094262be4256cc27ec78bf37c34b2
/src/project2/Ansver.java
bad3097ddb1be4d4cc9ea2e051bc6b773c3b306b
[]
no_license
galuropek/practice
f94b11fb27e8c690de7eedc2bb46bd48af251b2b
58626b1e2a35f43bcc1fa6c893b068776724ac32
refs/heads/master
2020-03-27T19:45:36.237991
2019-02-03T21:00:28
2019-02-03T21:00:28
147,009,818
0
0
null
null
null
null
UTF-8
Java
false
false
208
java
package project2; public class Ansver extends Message { public Ansver(String value) { super("Ansver", value); } @Override public void reaction() { super.reaction(); } }
[ "galuropek@gmail.com" ]
galuropek@gmail.com
7e391e3069b6cde1d7f2ff20fdb3697bd7c34fd4
7f00ae77941e49bb2e20c09df49adc3d7b681dad
/terasoluna-filedao/src/test/java/jp/terasoluna/fw/file/dao/standard/CSVFileLineWriter_Stub01.java
97c758d70532da983486c489b9a3417ae0b2f09e
[ "Apache-2.0" ]
permissive
ElementOne/terasoluna-batch
77b730bc33d1a49c36a414b065812237be6828d0
e0bd4a05ab9f2f98ed053c6b316064a354e9a35b
refs/heads/master
2020-03-22T20:56:25.650986
2018-02-13T09:01:18
2018-02-13T09:01:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
905
java
package jp.terasoluna.fw.file.dao.standard; import jp.terasoluna.fw.file.annotation.FileFormat; import jp.terasoluna.fw.file.annotation.InputFileColumn; import jp.terasoluna.fw.file.annotation.OutputFileColumn; /** * FileFormatアノテーションを持ち、属性を持たないファイル行オブジェクトスタブ * <p> * 以下の設定を持つ<br> * <ul> * <li>@FileFormat(delimiter以外の設定はデフォルト値ではない) */ @FileFormat(lineFeedChar = "\r", encloseChar = '\"', fileEncoding = "UTF-8", headerLineCount = 1, trailerLineCount = 1, overWriteFlg = true) public class CSVFileLineWriter_Stub01 { @InputFileColumn(columnIndex = 0) @OutputFileColumn(columnIndex = 0) private String dummy; public String getDummy() { return dummy; } public void setDummy(String dummy) { this.dummy = dummy; } }
[ "yggd@yahoo.co.jp" ]
yggd@yahoo.co.jp
4aa9e17418b4ea5f9306218f106e27ae7af6b4cc
2cf2288a4ac7d3081cfd107d64e6f23c117f74e7
/core-ng/src/main/java/core/framework/internal/web/service/WebServiceClient.java
9e8b3f5b27d1b23c9313a0dd8fde4f5b3e7b0f1f
[ "Apache-2.0" ]
permissive
xeathen/core-ng-project
a538901874a4a784abd9ed3ec2b2fad5754dec70
16595ea260c53ece5920f9bdb972b2ccdd48050b
refs/heads/master
2023-08-15T00:39:41.743635
2021-09-14T15:51:05
2021-09-14T15:51:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,732
java
package core.framework.internal.web.service; import core.framework.api.http.HTTPStatus; import core.framework.http.ContentType; import core.framework.http.HTTPClient; import core.framework.http.HTTPMethod; import core.framework.http.HTTPRequest; import core.framework.http.HTTPResponse; import core.framework.internal.http.HTTPClientImpl; import core.framework.internal.log.ActionLog; import core.framework.internal.log.LogManager; import core.framework.internal.web.HTTPHandler; import core.framework.internal.web.bean.RequestBeanWriter; import core.framework.internal.web.bean.ResponseBeanReader; import core.framework.log.Severity; import core.framework.util.Maps; import core.framework.web.service.RemoteServiceException; import core.framework.web.service.WebServiceClientInterceptor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; import java.io.UncheckedIOException; import java.lang.reflect.Type; import java.util.Map; /** * @author neo */ public class WebServiceClient { public static final String USER_AGENT = "APIClient"; private static final Logger LOGGER = LoggerFactory.getLogger(WebServiceClient.class); private static final Map<Integer, HTTPStatus> HTTP_STATUSES; static { HTTPStatus[] values = HTTPStatus.values(); HTTP_STATUSES = Maps.newHashMapWithExpectedSize(values.length); for (HTTPStatus status : values) { HTTP_STATUSES.put(status.code, status); } } static HTTPStatus parseHTTPStatus(int statusCode) { HTTPStatus status = HTTP_STATUSES.get(statusCode); if (status == null) throw new Error("unsupported http status code, code=" + statusCode); return status; } private final String serviceURL; private final HTTPClient httpClient; private final RequestBeanWriter writer; private final ResponseBeanReader reader; private WebServiceClientInterceptor interceptor; public WebServiceClient(String serviceURL, HTTPClient httpClient, RequestBeanWriter writer, ResponseBeanReader reader) { this.serviceURL = serviceURL; this.httpClient = httpClient; this.writer = writer; this.reader = reader; } // used by generated code, must be public public <T> Object execute(HTTPMethod method, String path, Class<T> requestBeanClass, T requestBean, Type responseType) { var request = new HTTPRequest(method, serviceURL + path); request.accept(ContentType.APPLICATION_JSON); linkContext(request); if (requestBeanClass != null) { putRequestBean(request, requestBeanClass, requestBean); } if (interceptor != null) { LOGGER.debug("interceptor={}", interceptor.getClass().getCanonicalName()); interceptor.onRequest(request); } HTTPResponse response = httpClient.execute(request); if (interceptor != null) { interceptor.onResponse(response); } validateResponse(response); try { return reader.fromJSON(responseType, response.body); } catch (IOException e) { // for security concern, to hide original error message, jackson may return detailed info, e.g. possible allowed values for enum // detailed info can still be found in trace log or exception stack trace throw new UncheckedIOException("failed to deserialize remote service response, responseType=" + responseType.getTypeName(), e); } } // used by generated code, must be public public void intercept(WebServiceClientInterceptor interceptor) { if (this.interceptor != null) throw new Error("found duplicate interceptor, previous=" + this.interceptor.getClass().getCanonicalName()); this.interceptor = interceptor; } // used by generated code, must be public public void logCallWebService(String method) { LOGGER.debug("call web service, method={}", method); } <T> void putRequestBean(HTTPRequest request, Class<T> requestBeanClass, T requestBean) { HTTPMethod method = request.method; if (method == HTTPMethod.GET || method == HTTPMethod.DELETE) { Map<String, String> queryParams = writer.toParams(requestBeanClass, requestBean); request.params.putAll(queryParams); } else if (method == HTTPMethod.POST || method == HTTPMethod.PUT || method == HTTPMethod.PATCH) { byte[] json = writer.toJSON(requestBeanClass, requestBean); request.body(json, ContentType.APPLICATION_JSON); } else { throw new Error("not supported method, method=" + method); } } void linkContext(HTTPRequest request) { Map<String, String> headers = request.headers; headers.put(HTTPHandler.HEADER_CLIENT.toString(), LogManager.APP_NAME); ActionLog actionLog = LogManager.CURRENT_ACTION_LOG.get(); if (actionLog == null) return; // web service client may be used without action log context headers.put(HTTPHandler.HEADER_CORRELATION_ID.toString(), actionLog.correlationId()); if (actionLog.trace) headers.put(HTTPHandler.HEADER_TRACE.toString(), "true"); headers.put(HTTPHandler.HEADER_REF_ID.toString(), actionLog.id); long timeout = ((HTTPClientImpl) httpClient).timeoutInNano; // not count connect timeout, as action starts after connecting if (actionLog.maxProcessTimeInNano != -1) { // only action initiated by http/message has max process time long remainingTime = actionLog.remainingProcessTimeInNano(); if (remainingTime < timeout) timeout = remainingTime; } headers.put(HTTPHandler.HEADER_TIMEOUT.toString(), String.valueOf(timeout)); } void validateResponse(HTTPResponse response) { int statusCode = response.statusCode; if (statusCode >= 200 && statusCode < 300) return; // handle empty body gracefully, e.g. 503 during deployment // handle html error message gracefully, e.g. public cloud LB failed to connect to backend if (response.body.length > 0 && response.contentType != null && ContentType.APPLICATION_JSON.mediaType.equals(response.contentType.mediaType)) { InternalErrorResponse error = errorResponse(response); if (error.id != null && error.errorCode != null) { // use manual validation rather than annotation to keep the flow straightforward and less try/catch, check if valid error response json LOGGER.debug("failed to call remote service, statusCode={}, id={}, severity={}, errorCode={}, remoteStackTrace={}", statusCode, error.id, error.severity, error.errorCode, error.stackTrace); throw new RemoteServiceException(error.message, parseSeverity(error.severity), error.errorCode, parseHTTPStatus(statusCode)); } } throw new RemoteServiceException("failed to call remote service, statusCode=" + statusCode, Severity.ERROR, "REMOTE_SERVICE_ERROR", parseHTTPStatus(statusCode)); } private InternalErrorResponse errorResponse(HTTPResponse response) { try { return (InternalErrorResponse) reader.fromJSON(InternalErrorResponse.class, response.body); } catch (Throwable e) { int statusCode = response.statusCode; throw new RemoteServiceException("failed to deserialize remote service error response, statusCode=" + statusCode, Severity.ERROR, "REMOTE_SERVICE_ERROR", parseHTTPStatus(statusCode), e); } } private Severity parseSeverity(String severity) { if (severity == null) return Severity.ERROR; return Severity.valueOf(severity); } }
[ "neowu.us@gmail.com" ]
neowu.us@gmail.com
791579b925a5a7e0a7711ceb1b38a63e153d8970
2c19c8d8caadac67e6d349d5de8daee52c661ca5
/src/main/java/com/kf/modules/act/service/ext/ActGroupEntityService.java
4872019d36b4628bfcb03d0df162d0704ae8ff2d
[ "Apache-2.0" ]
permissive
lizief/kfapp
035a4a441dc4977876c3d9e73c4b72d2c56c6596
bbe683a803d83657a54e92bb2539a4de84b58380
refs/heads/master
2021-05-05T08:21:56.358775
2018-01-31T15:57:53
2018-01-31T15:57:53
118,873,989
0
0
null
null
null
null
UTF-8
Java
false
false
3,608
java
/** * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved. */ package com.kf.modules.act.service.ext; import java.util.List; import java.util.Map; import org.activiti.engine.identity.Group; import org.activiti.engine.identity.GroupQuery; import org.activiti.engine.impl.GroupQueryImpl; import org.activiti.engine.impl.Page; import org.activiti.engine.impl.persistence.entity.GroupEntity; import org.activiti.engine.impl.persistence.entity.GroupEntityManager; import org.springframework.stereotype.Service; import com.google.common.collect.Lists; import com.kf.common.utils.SpringContextHolder; import com.kf.modules.act.utils.ActUtils; import com.kf.modules.sys.entity.Role; import com.kf.modules.sys.entity.User; import com.kf.modules.sys.service.SystemService; /** * Activiti Group Entity Service * @author ThinkGem * @version 2013-12-05 */ @Service public class ActGroupEntityService extends GroupEntityManager { private SystemService systemService; public SystemService getSystemService() { if (systemService == null){ systemService = SpringContextHolder.getBean(SystemService.class); } return systemService; } public Group createNewGroup(String groupId) { return new GroupEntity(groupId); } public void insertGroup(Group group) { // getDbSqlSession().insert((PersistentObject) group); throw new RuntimeException("not implement method."); } public void updateGroup(GroupEntity updatedGroup) { // CommandContext commandContext = Context.getCommandContext(); // DbSqlSession dbSqlSession = commandContext.getDbSqlSession(); // dbSqlSession.update(updatedGroup); throw new RuntimeException("not implement method."); } public void deleteGroup(String groupId) { // GroupEntity group = getDbSqlSession().selectById(GroupEntity.class, groupId); // getDbSqlSession().delete("deleteMembershipsByGroupId", groupId); // getDbSqlSession().delete(group); throw new RuntimeException("not implement method."); } public GroupQuery createNewGroupQuery() { // return new GroupQueryImpl(Context.getProcessEngineConfiguration().getCommandExecutorTxRequired()); throw new RuntimeException("not implement method."); } // @SuppressWarnings("unchecked") public List<Group> findGroupByQueryCriteria(GroupQueryImpl query, Page page) { // return getDbSqlSession().selectList("selectGroupByQueryCriteria", query, page); throw new RuntimeException("not implement method."); } public long findGroupCountByQueryCriteria(GroupQueryImpl query) { // return (Long) getDbSqlSession().selectOne("selectGroupCountByQueryCriteria", query); throw new RuntimeException("not implement method."); } public List<Group> findGroupsByUser(String userId) { // return getDbSqlSession().selectList("selectGroupsByUserId", userId); List<Group> list = Lists.newArrayList(); User user = getSystemService().getUserByLoginName(userId); if (user != null && user.getRoleList() != null){ for (Role role : user.getRoleList()){ list.add(ActUtils.toActivitiGroup(role)); } } return list; } public List<Group> findGroupsByNativeQuery(Map<String, Object> parameterMap, int firstResult, int maxResults) { // return getDbSqlSession().selectListWithRawParameter("selectGroupByNativeQuery", parameterMap, firstResult, maxResults); throw new RuntimeException("not implement method."); } public long findGroupCountByNativeQuery(Map<String, Object> parameterMap) { // return (Long) getDbSqlSession().selectOne("selectGroupCountByNativeQuery", parameterMap); throw new RuntimeException("not implement method."); } }
[ "lenovo@Lenovo-PC" ]
lenovo@Lenovo-PC
9a29c9e6989b638ba3b33c32ccf136ff199f913b
25f5d381de732e3fbba72983b7d3ee931e55b72c
/basex-core/src/main/java/org/basex/query/expr/Unary.java
5bd8fa187aec24f52329a89e17726077d0ca6cd5
[ "BSD-3-Clause" ]
permissive
klavs/basex
4ce8f0a983785a0fed188974a9f948e6956e9184
010a30f3822d9d15cd4de9b45294376b94095453
refs/heads/master
2020-04-05T19:03:52.511428
2016-07-12T15:27:14
2016-07-12T15:27:14
63,189,994
1
0
null
2016-07-12T20:24:21
2016-07-12T20:24:21
null
UTF-8
Java
false
false
2,454
java
package org.basex.query.expr; import static org.basex.query.QueryError.*; import static org.basex.query.QueryText.*; import org.basex.query.*; import org.basex.query.value.item.*; import org.basex.query.value.node.*; import org.basex.query.value.type.*; import org.basex.query.value.type.SeqType.Occ; import org.basex.query.var.*; import org.basex.util.*; import org.basex.util.hash.*; /** * Unary expression. * * @author BaseX Team 2005-16, BSD License * @author Christian Gruen */ public final class Unary extends Single { /** Minus flag. */ private final boolean minus; /** * Constructor. * @param info input info * @param expr expression * @param minus minus flag */ public Unary(final InputInfo info, final Expr expr, final boolean minus) { super(info, expr); this.minus = minus; } @Override public Expr compile(final QueryContext qc, final VarScope scp) throws QueryException { return super.compile(qc, scp).optimize(qc, scp); } @Override public Expr optimize(final QueryContext qc, final VarScope scp) throws QueryException { if(expr.isValue()) return preEval(qc); final SeqType st = expr.seqType(); final Type t = st.type; seqType = SeqType.get(t.isUntyped() ? AtomType.DBL : t.isNumber() ? t : AtomType.ITR, st.one() && !st.mayBeArray() ? Occ.ONE : Occ.ZERO_ONE); return this; } @Override public Item item(final QueryContext qc, final InputInfo ii) throws QueryException { final Item it = expr.atomItem(qc, info); if(it == null) return null; final Type ip = it.type; if(ip.isUntyped()) { final double d = it.dbl(info); return Dbl.get(minus ? -d : d); } if(!ip.isNumber()) throw numberError(this, it); if(!minus) return it; if(ip == AtomType.DBL) return Dbl.get(-it.dbl(info)); if(ip == AtomType.FLT) return Flt.get(-it.flt(info)); if(ip == AtomType.DEC) return Dec.get(it.dec(info).negate()); // default: integer final long l = it.itr(info); if(l == Long.MIN_VALUE) throw RANGE_X.get(info, it); return Int.get(-l); } @Override public Expr copy(final QueryContext qc, final VarScope scp, final IntObjMap<Var> vs) { return copyType(new Unary(info, expr.copy(qc, scp, vs), minus)); } @Override public void plan(final FElem plan) { addPlan(plan, planElem(VAL, minus), expr); } @Override public String toString() { return (minus ? "-" : "") + expr; } }
[ "christian.gruen@gmail.com" ]
christian.gruen@gmail.com
9a0875db740b8ed86bf208384c1e78c70341d891
e4e000db442e88dbad133dad4603521fea5f509e
/src/problems/twopointers/NumberOfSubsequencesThatSatisfy.java
6e9909c866a937448dc047d404608242a2719f3e
[]
no_license
XurajB/data_structure_algorithms
363669c2c4098a3e3bab5069a1d7ef11b8a899a2
3f7825d1bf68deaa13d08bd616ec4425a26e5ac9
refs/heads/master
2023-03-13T17:50:45.818163
2021-03-05T03:20:22
2021-03-05T03:20:22
223,202,201
0
1
null
null
null
null
UTF-8
Java
false
false
1,232
java
package problems.twopointers; import java.util.Arrays; /** * Given an array of integers nums and an integer target. * Return the number of non-empty subsequences of nums such that the sum of the minimum and maximum element on it is less or equal to target. * Since the answer may be too large, return it modulo 109 + 7. */ public class NumberOfSubsequencesThatSatisfy { public static void main(String[] args) { System.out.println(numSubseq(new int[] {3,5,6,7}, 9)); } // O(N), O(N) private static int numSubseq(int[] nums, int target) { Arrays.sort(nums); int ans = 0; int n = nums.length; int left = 0; int right = n - 1; int MOD = (int) 1e9+7; int[] pows = new int[n]; pows[0] = 1; // if max and min sum to <= target, there are total 2^n-1 total combinations for (int i = 1; i < pows.length; i++) { pows[i] = (pows[i-1] * 2) % MOD; } while (left <= right) { if (nums[left] + nums[right] > target) { right--; } else { ans = (ans + pows[right-left]) % MOD; left++; } } return ans; } }
[ "surajbh@hotmail.com" ]
surajbh@hotmail.com
1009190e6ec7015cc4a5c19910e663eba99b09c1
6c69998676e9df8be55e28f6d63942b9f7cef913
/src/com/insigma/siis/local/pagemodel/sysorg/org/hzb/QXCJGBPB.java
5f4c4919659ba2ae7b20c77c40c00301babecc8f
[]
no_license
HuangHL92/ZHGBSYS
9dea4de5931edf5c93a6fbcf6a4655c020395554
f2ff875eddd569dca52930d09ebc22c4dcb47baf
refs/heads/master
2023-08-04T04:37:08.995446
2021-09-15T07:35:53
2021-09-15T07:35:53
406,219,162
0
0
null
null
null
null
UTF-8
Java
false
false
823
java
package com.insigma.siis.local.pagemodel.sysorg.org.hzb; import java.util.HashMap; import java.util.List; import com.insigma.odin.framework.persistence.HBUtil; import com.insigma.odin.framework.radow.PageModel; import com.insigma.odin.framework.radow.RadowException; import com.insigma.siis.local.pagemodel.comm.CommQuery; import net.sf.json.JSONArray; public class QXCJGBPB { public static String expData(){ try { String sql = HBUtil.getValueFromTab("comments", "sourcetable", "table_name='QXCJGBPB'"); CommQuery cqbs=new CommQuery(); List<HashMap<String, Object>> listCode=cqbs.getListBySQL(sql.toString()); JSONArray updateunDataStoreObject = JSONArray.fromObject(listCode); return updateunDataStoreObject.toString(); } catch (Exception e) { e.printStackTrace(); } return "[]"; } }
[ "351036848@qq.com" ]
351036848@qq.com
122c8987a5831715e6c70032b206ea25ed32a4fe
d18af2a6333b1a868e8388f68733b3fccb0b4450
/java/src/com/flurry/android/monolithic/sdk/impl/pj.java
c57e57d04c37830342d2daffe808458590fa7a08
[]
no_license
showmaxAlt/showmaxAndroid
60576436172495709121f08bd9f157d36a077aad
d732f46d89acdeafea545a863c10566834ba1dec
refs/heads/master
2021-03-12T20:01:11.543987
2015-08-19T20:31:46
2015-08-19T20:31:46
41,050,587
0
1
null
null
null
null
UTF-8
Java
false
false
1,802
java
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.flurry.android.monolithic.sdk.impl; // Referenced classes of package com.flurry.android.monolithic.sdk.impl: // pb class pj { static final int a[]; static { a = new int[pb.values().length]; try { a[pb.b.ordinal()] = 1; } catch (NoSuchFieldError nosuchfielderror10) { } try { a[pb.d.ordinal()] = 2; } catch (NoSuchFieldError nosuchfielderror9) { } try { a[pb.c.ordinal()] = 3; } catch (NoSuchFieldError nosuchfielderror8) { } try { a[pb.e.ordinal()] = 4; } catch (NoSuchFieldError nosuchfielderror7) { } try { a[pb.i.ordinal()] = 5; } catch (NoSuchFieldError nosuchfielderror6) { } try { a[pb.k.ordinal()] = 6; } catch (NoSuchFieldError nosuchfielderror5) { } try { a[pb.l.ordinal()] = 7; } catch (NoSuchFieldError nosuchfielderror4) { } try { a[pb.m.ordinal()] = 8; } catch (NoSuchFieldError nosuchfielderror3) { } try { a[pb.g.ordinal()] = 9; } catch (NoSuchFieldError nosuchfielderror2) { } try { a[pb.h.ordinal()] = 10; } catch (NoSuchFieldError nosuchfielderror1) { } try { a[pb.j.ordinal()] = 11; } catch (NoSuchFieldError nosuchfielderror) { return; } } }
[ "invisible@example.com" ]
invisible@example.com
dce4b35ffe213565681f393de41f2d626379870c
ca7ce9ebd3732e8ef329978e156a37558f8a3fea
/src/test/java/net/jianbo/cmdb/security/jwt/JWTFilterTest.java
bb42f2efafa63bf76b17b72f02083b7ad718caf3
[]
no_license
Jianbo-Zhu/myCMDB
496b76e7a570e20a92007926daa5150f430ca431
2b1786db5c809da1465ff672d8d055d3498341c5
refs/heads/master
2020-04-05T08:00:05.121525
2018-11-21T14:03:02
2018-11-21T14:03:02
156,696,990
0
0
null
2018-11-21T12:50:23
2018-11-08T11:31:02
Java
UTF-8
Java
false
false
5,482
java
package net.jianbo.cmdb.security.jwt; import net.jianbo.cmdb.security.AuthoritiesConstants; import io.github.jhipster.config.JHipsterProperties; import io.jsonwebtoken.io.Decoders; import io.jsonwebtoken.security.Keys; import org.junit.Before; import org.junit.Test; import org.springframework.http.HttpStatus; import org.springframework.mock.web.MockFilterChain; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockHttpServletResponse; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.test.util.ReflectionTestUtils; import java.util.Collections; import static org.assertj.core.api.Assertions.assertThat; public class JWTFilterTest { private TokenProvider tokenProvider; private JWTFilter jwtFilter; @Before public void setup() { JHipsterProperties jHipsterProperties = new JHipsterProperties(); tokenProvider = new TokenProvider(jHipsterProperties); ReflectionTestUtils.setField(tokenProvider, "key", Keys.hmacShaKeyFor(Decoders.BASE64 .decode("fd54a45s65fds737b9aafcb3412e07ed99b267f33413274720ddbb7f6c5e64e9f14075f2d7ed041592f0b7657baf8"))); ReflectionTestUtils.setField(tokenProvider, "tokenValidityInMilliseconds", 60000); jwtFilter = new JWTFilter(tokenProvider); SecurityContextHolder.getContext().setAuthentication(null); } @Test public void testJWTFilter() throws Exception { UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken( "test-user", "test-password", Collections.singletonList(new SimpleGrantedAuthority(AuthoritiesConstants.USER)) ); String jwt = tokenProvider.createToken(authentication, false); MockHttpServletRequest request = new MockHttpServletRequest(); request.addHeader(JWTFilter.AUTHORIZATION_HEADER, "Bearer " + jwt); request.setRequestURI("/api/test"); MockHttpServletResponse response = new MockHttpServletResponse(); MockFilterChain filterChain = new MockFilterChain(); jwtFilter.doFilter(request, response, filterChain); assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value()); assertThat(SecurityContextHolder.getContext().getAuthentication().getName()).isEqualTo("test-user"); assertThat(SecurityContextHolder.getContext().getAuthentication().getCredentials().toString()).isEqualTo(jwt); } @Test public void testJWTFilterInvalidToken() throws Exception { String jwt = "wrong_jwt"; MockHttpServletRequest request = new MockHttpServletRequest(); request.addHeader(JWTFilter.AUTHORIZATION_HEADER, "Bearer " + jwt); request.setRequestURI("/api/test"); MockHttpServletResponse response = new MockHttpServletResponse(); MockFilterChain filterChain = new MockFilterChain(); jwtFilter.doFilter(request, response, filterChain); assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value()); assertThat(SecurityContextHolder.getContext().getAuthentication()).isNull(); } @Test public void testJWTFilterMissingAuthorization() throws Exception { MockHttpServletRequest request = new MockHttpServletRequest(); request.setRequestURI("/api/test"); MockHttpServletResponse response = new MockHttpServletResponse(); MockFilterChain filterChain = new MockFilterChain(); jwtFilter.doFilter(request, response, filterChain); assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value()); assertThat(SecurityContextHolder.getContext().getAuthentication()).isNull(); } @Test public void testJWTFilterMissingToken() throws Exception { MockHttpServletRequest request = new MockHttpServletRequest(); request.addHeader(JWTFilter.AUTHORIZATION_HEADER, "Bearer "); request.setRequestURI("/api/test"); MockHttpServletResponse response = new MockHttpServletResponse(); MockFilterChain filterChain = new MockFilterChain(); jwtFilter.doFilter(request, response, filterChain); assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value()); assertThat(SecurityContextHolder.getContext().getAuthentication()).isNull(); } @Test public void testJWTFilterWrongScheme() throws Exception { UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken( "test-user", "test-password", Collections.singletonList(new SimpleGrantedAuthority(AuthoritiesConstants.USER)) ); String jwt = tokenProvider.createToken(authentication, false); MockHttpServletRequest request = new MockHttpServletRequest(); request.addHeader(JWTFilter.AUTHORIZATION_HEADER, "Basic " + jwt); request.setRequestURI("/api/test"); MockHttpServletResponse response = new MockHttpServletResponse(); MockFilterChain filterChain = new MockFilterChain(); jwtFilter.doFilter(request, response, filterChain); assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value()); assertThat(SecurityContextHolder.getContext().getAuthentication()).isNull(); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
269c952d5dcba01dc220807e87ee12f3ef38cb2d
c269bc8917053a04bb3e746165a3b6b45b797c6e
/app/src/main/java/com/feiyou/headstyle/utils/RandomUtils.java
4d8443a9da0c7c69a6d482c64f0d485e045ba363
[]
no_license
YangChengTeam/newheadstyle
9053647fec2568c68bddeeccc15a70350cdf1a7b
8095999dfe6415a2063260191ddb99b9274743b5
refs/heads/master
2021-08-17T08:28:53.394363
2020-04-24T09:50:26
2020-04-24T09:50:26
168,095,146
0
1
null
null
null
null
UTF-8
Java
false
false
7,682
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.feiyou.headstyle.utils; import org.jsoup.helper.Validate; import java.util.Random; /** * <p>Utility library that supplements the standard {@link Random} class.</p> * * <p>Caveat: Instances of {@link Random} are not cryptographically secure.</p> * * <p>Please note that the Apache Commons project provides a component * dedicated to pseudo-random number generation, namely * <a href="https://commons.apache.org/rng">Commons RNG</a>, that may be * a better choice for applications with more stringent requirements * (performance and/or correctness).</p> * * @since 3.3 */ public class RandomUtils { /** * Random object used by random method. This has to be not local to the * random method so as to not return the same value in the same millisecond. */ private static final Random RANDOM = new Random(); /** * <p> * {@code RandomUtils} instances should NOT be constructed in standard * programming. Instead, the class should be used as * {@code RandomUtils.nextBytes(5);}. * </p> * * <p> * This constructor is public to permit tools that require a JavaBean * instance to operate. * </p> */ public RandomUtils() { super(); } /** * <p> * Returns a random boolean value * </p> * * @return the random boolean * @since 3.5 */ public static boolean nextBoolean() { return RANDOM.nextBoolean(); } /** * <p> * Creates an array of random bytes. * </p> * * @param count * the size of the returned array * @return the random byte array * @throws 'IllegalArgumentException' if {@code count} is negative */ public static byte[] nextBytes(final int count) { Validate.isTrue(count >= 0, "Count cannot be negative."); final byte[] result = new byte[count]; RANDOM.nextBytes(result); return result; } /** * <p> * Returns a random integer within the specified range. * </p> * * @param startInclusive * the smallest value that can be returned, must be non-negative * @param endExclusive * the upper bound (not included) * @throws 'IllegalArgumentException' * if {@code startInclusive > endExclusive} or if * {@code startInclusive} is negative * @return the random integer */ public static int nextInt(final int startInclusive, final int endExclusive) { Validate.isTrue(endExclusive >= startInclusive, "Start value must be smaller or equal to end value."); Validate.isTrue(startInclusive >= 0, "Both range values must be non-negative."); if (startInclusive == endExclusive) { return startInclusive; } return startInclusive + RANDOM.nextInt(endExclusive - startInclusive); } /** * <p> Returns a random int within 0 - Integer.MAX_VALUE </p> * * @return the random integer * @see #nextInt(int, int) * @since 3.5 */ public static int nextInt() { return nextInt(0, Integer.MAX_VALUE); } /** * <p> * Returns a random long within the specified range. * </p> * * @param startInclusive * the smallest value that can be returned, must be non-negative * @param endExclusive * the upper bound (not included) * @throws 'IllegalArgumentException' * if {@code startInclusive > endExclusive} or if * {@code startInclusive} is negative * @return the random long */ public static long nextLong(final long startInclusive, final long endExclusive) { Validate.isTrue(endExclusive >= startInclusive, "Start value must be smaller or equal to end value."); Validate.isTrue(startInclusive >= 0, "Both range values must be non-negative."); if (startInclusive == endExclusive) { return startInclusive; } return (long) nextDouble(startInclusive, endExclusive); } /** * <p> Returns a random long within 0 - Long.MAX_VALUE </p> * * @return the random long * @see #nextLong(long, long) * @since 3.5 */ public static long nextLong() { return nextLong(0, Long.MAX_VALUE); } /** * <p> * Returns a random double within the specified range. * </p> * * @param startInclusive * the smallest value that can be returned, must be non-negative * @param endInclusive * the upper bound (included) * @throws 'IllegalArgumentException' * if {@code startInclusive > endInclusive} or if * {@code startInclusive} is negative * @return the random double */ public static double nextDouble(final double startInclusive, final double endInclusive) { Validate.isTrue(endInclusive >= startInclusive, "Start value must be smaller or equal to end value."); Validate.isTrue(startInclusive >= 0, "Both range values must be non-negative."); if (startInclusive == endInclusive) { return startInclusive; } return startInclusive + ((endInclusive - startInclusive) * RANDOM.nextDouble()); } /** * <p> Returns a random double within 0 - Double.MAX_VALUE </p> * * @return the random double * @see #nextDouble(double, double) * @since 3.5 */ public static double nextDouble() { return nextDouble(0, Double.MAX_VALUE); } /** * <p> * Returns a random float within the specified range. * </p> * * @param startInclusive * the smallest value that can be returned, must be non-negative * @param endInclusive * the upper bound (included) * @throws 'IllegalArgumentException' * if {@code startInclusive > endInclusive} or if * {@code startInclusive} is negative * @return the random float */ public static float nextFloat(final float startInclusive, final float endInclusive) { Validate.isTrue(endInclusive >= startInclusive, "Start value must be smaller or equal to end value."); Validate.isTrue(startInclusive >= 0, "Both range values must be non-negative."); if (startInclusive == endInclusive) { return startInclusive; } return startInclusive + ((endInclusive - startInclusive) * RANDOM.nextFloat()); } /** * <p> Returns a random float within 0 - Float.MAX_VALUE </p> * * @return the random float * @see #nextFloat() * @since 3.5 */ public static float nextFloat() { return nextFloat(0, Float.MAX_VALUE); } }
[ "512710257@qq.com" ]
512710257@qq.com
e120cb4ba2968c7534c700811879ebd261d49e49
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Time/18/org/joda/time/DateTime_millisOfDay_1985.java
209b0351bb732b5255088225d8c9c91c7da8a0b9
[]
no_license
hvdthong/NetML
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
9bb103da21327912e5a29cbf9be9ff4d058731a5
refs/heads/master
2021-06-30T15:03:52.618255
2020-10-07T01:58:48
2020-10-07T01:58:48
150,383,588
1
1
null
2018-09-26T07:08:45
2018-09-26T07:08:44
null
UTF-8
Java
false
false
3,354
java
org joda time date time datetim standard implement unmodifi datetim code date time datetim code wide implement link readabl instant readableinst instant repres exact point time line limit precis millisecond code date time datetim code calcul field respect link date time zone datetimezon time zone intern hold piec data firstli hold datetim millisecond java epoch t00 01t00 00z hold link chronolog determin millisecond instant convert date time field chronolog link iso chronolog isochronolog agre intern standard compat modern gregorian calendar individu field queri wai code hour dai gethourofdai code code hour dai hourofdai code techniqu access method field numer text text maximum minimum valu add subtract set round date time datetim thread safe immut provid chronolog standard chronolog class suppli thread safe immut author stephen colebourn author kandarp shah author brian neill o'neil mutabl date time mutabledatetim date time datetim milli dai properti access advanc function milli dai properti properti milli dai millisofdai properti chronolog getchronolog milli dai millisofdai
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
180d98c7b282b9fcf9a9e3da447682c03f012933
8a11f62cdd6ba43dfad7e967c0a0b3dd3bb676db
/playgrounds/michalm/src/main/java/playground/michalm/drt/scheduler/DrtSchedulerParams.java
39a79bda4f6f8d77714bcce1fc3c9f8bedf32e02
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
kamazzor/matsim
79e4b2f8a27bb273585fdced4e50fa44d0a027b5
89bdae9433fffd16eb9a0b8d2394b76c39335211
refs/heads/master
2021-06-14T05:21:20.895671
2017-03-22T10:17:48
2017-03-22T10:17:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,363
java
/* *********************************************************************** * * project: org.matsim.* * * * *********************************************************************** * * * * copyright : (C) 2014 by the members listed in the COPYING, * * LICENSE and WARRANTY file. * * email : info at matsim dot org * * * * *********************************************************************** * * * * 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. * * See also COPYING, LICENSE and WARRANTY file * * * * *********************************************************************** */ package playground.michalm.drt.scheduler; import org.matsim.contrib.taxi.run.TaxiConfigGroup; /** * @author michalm */ public class DrtSchedulerParams { public final boolean vehicleDiversion; public final double pickupDuration;// TODO per passenger?? public final double dropoffDuration;// TODO per passenger?? public final double AStarEuclideanOverdoFactor; public DrtSchedulerParams(TaxiConfigGroup taxiCfg) { this.vehicleDiversion = taxiCfg.isVehicleDiversion(); this.pickupDuration = taxiCfg.getPickupDuration(); this.dropoffDuration = taxiCfg.getDropoffDuration(); this.AStarEuclideanOverdoFactor = taxiCfg.getAStarEuclideanOverdoFactor(); } public DrtSchedulerParams(boolean destinationKnown, boolean vehicleDiversion, double pickupDuration, double dropoffDuration, double AStarEuclideanOverdoFactor) { this.vehicleDiversion = vehicleDiversion; this.pickupDuration = pickupDuration; this.dropoffDuration = dropoffDuration; this.AStarEuclideanOverdoFactor = AStarEuclideanOverdoFactor; } }
[ "michal.mac@gmail.com" ]
michal.mac@gmail.com
6fe06b23c79b71f091d46b628db9dd9a5fffdc98
5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1
/Code Snippet Repository/Spring/Spring6956.java
30c0885dbea47ce2277b78501908091acbe3f887
[]
no_license
saber13812002/DeepCRM
3336a244d4852a364800af3181e03e868cf6f9f5
be3e5e50e34a042d5ba7259ff5ff75c08ab32bb9
refs/heads/master
2023-03-16T00:08:06.473699
2018-04-18T05:29:50
2018-04-18T05:29:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,534
java
@Test public void testCachingConnectionFactoryWithTopicConnectionFactoryAndJms102Usage() throws JMSException { TopicConnectionFactory cf = mock(TopicConnectionFactory.class); TopicConnection con = mock(TopicConnection.class); TopicSession txSession = mock(TopicSession.class); TopicSession nonTxSession = mock(TopicSession.class); given(cf.createTopicConnection()).willReturn(con); given(con.createTopicSession(true, Session.AUTO_ACKNOWLEDGE)).willReturn(txSession); given(txSession.getTransacted()).willReturn(true); given(con.createTopicSession(false, Session.CLIENT_ACKNOWLEDGE)).willReturn(nonTxSession); CachingConnectionFactory scf = new CachingConnectionFactory(cf); scf.setReconnectOnException(false); Connection con1 = scf.createTopicConnection(); Session session1 = con1.createSession(true, Session.AUTO_ACKNOWLEDGE); session1.getTransacted(); session1.close(); // should lead to rollback session1 = con1.createSession(false, Session.CLIENT_ACKNOWLEDGE); session1.close(); con1.start(); TopicConnection con2 = scf.createTopicConnection(); Session session2 = con2.createTopicSession(false, Session.CLIENT_ACKNOWLEDGE); session2.close(); session2 = con2.createSession(true, Session.AUTO_ACKNOWLEDGE); session2.getTransacted(); session2.close(); con2.start(); con1.close(); con2.close(); scf.destroy(); // should trigger actual close verify(txSession).close(); verify(nonTxSession).close(); verify(con).start(); verify(con).stop(); verify(con).close(); }
[ "Qing.Mi@my.cityu.edu.hk" ]
Qing.Mi@my.cityu.edu.hk