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
e28619da1b56ab60638b683f018e0854304d5faf
bb05fc62169b49e01078b6bd211f18374c25cdc9
/soft/form/src/com/chimu/form/description/DescriptionPack.java
4332f473ac264cca31e20c14a2ee376d41698b96
[]
no_license
markfussell/form
58717dd84af1462d8e3fe221535edcc8f18a8029
d227c510ff072334a715611875c5ae6a13535510
refs/heads/master
2016-09-10T00:12:07.602440
2013-02-07T01:24:14
2013-02-07T01:24:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,298
java
/*====================================================================== ** ** File: chimu/form/description/DescriptionPack.java ** ** Copyright (c) 1997-2000, ChiMu Corporation. All Rights Reserved. ** See the file COPYING for copying permission. ** ======================================================================*/ package com.chimu.form.description; import java.sql.Connection; import com.chimu.kernel.collections.*; import com.chimu.form.database.*; import com.chimu.form.database.product.*; import com.chimu.form.database.typeConstants.*; /** **/ public class DescriptionPack { static public DatabaseDescription newDatabaseDescription() { return new DatabaseDescriptionC(); } static public DatabaseDescription newDatabaseDescriptionFrom(DatabaseConnection dbConnection) { DatabaseDescription dbDesc = newDatabaseDescription(); dbDesc.initFrom(dbConnection); return dbDesc; } //************************************** //************************************** //************************************** static public CatalogDescription newCatalogDescription() { return new CatalogDescriptionC(); } static public CatalogDescription newCatalogDescriptionFrom(Catalog aCatalog) { CatalogDescription cd = new CatalogDescriptionC(); cd.initFrom(aCatalog); return cd; } //************************************** //************************************** //************************************** static public SchemeDescription newSchemeDescription() { return new SchemeDescriptionC(); } static public SchemeDescription newSchemeDescriptionFrom(Scheme aScheme){ SchemeDescription sd = new SchemeDescriptionC(); sd.initFrom(aScheme); return sd; } static public SchemeDescription newSchemeDescriptionFrom(Scheme aScheme, CatalogDescription cd){ SchemeDescription sd = new SchemeDescriptionC(); sd.initFrom(aScheme, cd); return sd; } //************************************** //************************************** //************************************** static public TableDescription newTableDescriptionFrom(Table aTable) { TableDescription table = new TableDescriptionC(); table.initFrom(aTable); return table; } static public TableDescription newTableDescriptionFrom(String tableName, SchemeDescription sd, String primaryKey) { TableDescription td = newTableDescription(tableName, primaryKey); td.setSchemeDescription(sd); td.setPrimaryKey(primaryKey); return td; } static public TableDescription newTableDescription(String name, List colList, String primaryKey) { TableDescription table = new TableDescriptionC(); table.setName(name); table.setPrimaryKey(primaryKey); table.setColumnsList(colList); return table; } static public TableDescription newTableDescription(String name, String primaryKey) { TableDescription table = new TableDescriptionC(); table.setName(name); table.setPrimaryKey(primaryKey); return table; } static public TableDescription newTableDescription(String name) { TableDescription table = new TableDescriptionC(); table.setName(name); return table; } //************************************** //************************************** //************************************** static public ColumnDescription newColumnDescription(String name, String sqlTypeString, boolean nullable) { ColumnDescription col = new ColumnDescriptionC(name, sqlTypeString, nullable); SqlDataType sqlType = SqlDataTypePack.typeFromKey(sqlTypeString); int typeInt = sqlType.code(); col.setSqlDataType(typeInt); return col; } //************************************** //************************************** //************************************** private DescriptionPack() {}; };
[ "mark.fussell@emenar.com" ]
mark.fussell@emenar.com
c0066fc9c42c88b33995ae0967b7c7c71238f3ae
d834398d37713784fd79d9ffad6be129eeaa2b61
/src/main/java/com/shop/repository/CartRepository.java
34e57ad0369a91f64cac2f0a6076fb1d3cdee5af
[]
no_license
byeungoo/shop
5bd8edf370206b4e19cf33a14f2e758d39f2cfe5
d540e0e411ce4d7bb505d91d1da4364eab8cef27
refs/heads/master
2023-02-07T18:55:57.995905
2020-12-28T06:22:25
2020-12-28T06:22:25
293,307,609
0
1
null
null
null
null
UTF-8
Java
false
false
234
java
package com.shop.repository; import com.shop.entity.Cart; import org.springframework.data.jpa.repository.JpaRepository; public interface CartRepository extends JpaRepository<Cart, Long> { Cart findByMemberId(Long memberId); }
[ "dksekfldks65@naver.com" ]
dksekfldks65@naver.com
44e146e62db0a1fe3479486d001a0cce75011ad7
6c1097cb3b68f8dd800350a2535c76bc8c5f8187
/executor/src/main/java/org/study/locks/Sync021.java
6bfdf06ba7f5ad759b65c7f36889e07919583649
[]
no_license
db117/study
0955198ea5ba50ba93b42f8418c4e72a7cdb43d3
5da4648e9417846322093231975dca1dbf6831c7
refs/heads/master
2021-07-24T01:33:35.519465
2018-10-12T03:15:14
2018-10-12T03:15:14
152,688,110
1
0
null
2020-04-27T03:43:41
2018-10-12T03:18:16
Java
UTF-8
Java
false
false
1,254
java
package org.study.locks;/* * ━━━━━━如来保佑━━━━━━ *    ┏┓   ┏┓ *   ┏┛┻━━━┛┻┓ *   ┃   ━   ┃ *   ┃ ┳┛ ┗┳ ┃ *   ┃   ┻   ┃ *   ┗━┓   ┏━┛ *     ┃   ┗━━━┓ *     ┃       ┣┓ *     ┃       ┏┛ *     ┗┓┓┏━┳┓┏┛ *      ┗┻┛ ┗┻┛ * ━━━━━━永无BUG━━━━━━ * 图灵学院-悟空老师 * www.jiagouedu.com * 悟空老师QQ:245553999 * * 还没开始 */ public class Sync021 implements Runnable { static int i = 0; @Override public void run() { for (int j = 0; j < 100000; j++) { add(); } } public synchronized void add() { i++; } public static void main(String[] args) throws InterruptedException { Sync021 sync02 = new Sync021(); Thread thread1 = new Thread(sync02); Thread thread2 = new Thread(sync02); thread1.start(); thread2.start(); thread1.join(); thread2.join(); System.out.println(i); } }
[ "z351622948@163.com" ]
z351622948@163.com
7eaeccfb04f877b6aca535fe6dfe459791727240
9906374567855059c506dde6f76f4090ff3a1baf
/src/main/java/org/xmlcml/norma/grobid/GrobidFigDescElement.java
ca56cca91f6806d14f8bbe43f10e565ec5e7e254
[ "Apache-2.0" ]
permissive
passysosysmas/norma
f70a7b5399ba5d5ccb2e25d99130256377e35eac
e652321bc6238980aa9e83839653c5d1fb093bd3
refs/heads/master
2021-01-19T23:41:10.601951
2017-04-13T07:44:32
2017-04-13T07:44:32
89,010,715
0
0
null
2017-04-21T18:04:46
2017-04-21T18:04:46
null
UTF-8
Java
false
false
379
java
package org.xmlcml.norma.grobid; import org.apache.log4j.Level; import org.apache.log4j.Logger; public class GrobidFigDescElement extends GrobidElement { public static final String TAG = "figDesc"; private static final Logger LOG = Logger.getLogger(GrobidFigDescElement.class); static { LOG.setLevel(Level.DEBUG); } public GrobidFigDescElement() { super(TAG); } }
[ "peter.murray.rust@googlemail.com" ]
peter.murray.rust@googlemail.com
fdd1971629c51cd1682399ba17dba7ad866add76
a30b7feaac08e35a63ab2a17adce6c578ff8b9eb
/aebiz-b2b2c/aebiz-app/aebiz-web/src/main/java/com/aebiz/app/sales/modules/models/Sales_gift_class.java
53d8edf9da0b607dcf328ffb4bee0f89137d6048
[]
no_license
zenghaorong/ntgcb2b2cJar
15ef95dfe87b5b483f63510e7a87bf73f7fa7c4e
ff360606816a9a76e3cccef0d821bb3a4fa24e88
refs/heads/master
2020-05-14T23:27:53.764175
2019-04-18T02:26:43
2019-04-18T02:28:22
181,997,233
1
1
null
null
null
null
UTF-8
Java
false
false
1,183
java
package com.aebiz.app.sales.modules.models; import com.aebiz.baseframework.base.model.BaseModel; import org.nutz.dao.entity.annotation.*; import java.io.Serializable; /** * 赠品分类表 * Created by wizzer on 2017/6/7. */ @Table("sales_gift_class") public class Sales_gift_class extends BaseModel implements Serializable { private static final long serialVersionUID = 1L; @Column @Name @Comment("ID") @ColDefine(type = ColType.VARCHAR, width = 32) @Prev(els = {@EL("ig(view.tableName,'')")}) private String id; @Column @Comment("商城ID") @ColDefine(type = ColType.VARCHAR, width = 32) private String storeId; @Column @Comment("分类名称") @ColDefine(type = ColType.VARCHAR, width = 255) private String name; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getStoreId() { return storeId; } public void setStoreId(String storeId) { this.storeId = storeId; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
[ "2861574504@qq.com" ]
2861574504@qq.com
e5141e8759e227d634fcb3aab12b0db85c2cb64a
d765d62ee0376f36876ecb0c3bf6677215374918
/IntentActivityForResultCalculator/app/src/main/java/com/anukul/intentactivityforresultcalculator/SecondActivity.java
de2fca994ac5d6d8b00504b72029ac8736dd01e2
[]
no_license
MehtaAnukul/Android-Learn-Tasks
6ecad36313f59c736930c733bfdd933c768c5853
0585aca08a73d01f91615db15df2e5bf392138bd
refs/heads/master
2020-03-27T11:13:00.562876
2019-06-07T06:42:00
2019-06-07T06:42:00
146,472,580
0
0
null
null
null
null
UTF-8
Java
false
false
2,858
java
package com.anukul.intentactivityforresultcalculator; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import android.widget.EditText; public class SecondActivity extends AppCompatActivity implements View.OnClickListener { private EditText valueOneEd; private EditText valueSecEd; private Button okBtn; private Button cancelBtn; private int value1; private int value2; private int operationCode; private int ans; private Intent intent; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_second); initView(); } private void initView() { valueOneEd = findViewById(R.id.activity_second_valueOneEd); valueSecEd = findViewById(R.id.activity_second_valueSecEd); okBtn = findViewById(R.id.activity_second_okBtn); cancelBtn = findViewById(R.id.activity_second_cencalBtn); intent = getIntent(); operationCode = intent.getIntExtra("KEY_CODE", 0); okBtn.setOnClickListener(this); cancelBtn.setOnClickListener(this); } @Override public void onClick(View v) { value1 = Integer.parseInt(valueOneEd.getText().toString().trim()); value2 = Integer.parseInt(valueSecEd.getText().toString().trim()); switch (v.getId()) { case R.id.activity_second_okBtn: performTask(); break; case R.id.activity_second_cencalBtn: setResult(RESULT_CANCELED); finish(); break; } } private void performTask() { switch (operationCode) { case 1: ans = value1 + value2; intent.putExtra("ADD", ans); intent.putExtra("KEY_CODE_RETURN_ADD", 1); setResult(RESULT_OK, intent); finish(); break; case 2: ans = value1 - value2; intent.putExtra("SUB", ans); intent.putExtra("KEY_CODE_RETURN_SUB", 2); setResult(RESULT_OK, intent); finish(); break; case 3: ans = value1 * value2; intent.putExtra("MUL", ans); intent.putExtra("KEY_CODE_RETURN_MUL", 3); setResult(RESULT_OK, intent); finish(); break; case 4: ans = value1 / value2; intent.putExtra("DIV", ans); intent.putExtra("KEY_CODE_RETURN_DIV", 4); setResult(RESULT_OK, intent); finish(); break; } } }
[ "mehtaanukul@gmail.com" ]
mehtaanukul@gmail.com
f1e5ac33230a5b91b57e9d1940ed4e138cbdcc18
df4d0fb1848774a960ef857bea2f0afd8df20ff3
/gmall-chart/src/main/java/com/demo/controller/IndexController.java
39b3a853f8d73c0f2413843bd6cf77884050e57a
[]
no_license
LyfsGithud/spark-gmall-parent
da2888f43bc20461766b7eba4d979c1c03c54291
2024cf68b209c09aa562349928257f9d5c59d8d4
refs/heads/master
2022-11-11T11:05:27.229034
2020-03-13T02:53:55
2020-03-13T02:53:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,705
java
package com.demo.controller; import javax.servlet.http.HttpServletRequest; import com.demo.utils.GetDate; import com.demo.utils.HttpClientUtil; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.PropertySource; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; /** * <p> * description * </p> * * @author isacc 2020/2/23 5:08 * @since 1.0 */ @Controller @RequestMapping(value = "/") @PropertySource({"classpath:config/config.properties"}) public class IndexController { @Value("${my.totalUrl}") private String totalUrl; @Value("${my.hourUrl}") private String hourUrl; @Value("${my.esDataUrl}") private String esDataUrl; @Value("${my.sexUrl}") private String sexUrl; @GetMapping(value = "index1") public String index1() { return "index1"; } @GetMapping(value = "index") public String index() { return "index"; } @GetMapping(value = "table") public String table() { return "table"; } @GetMapping(value = "map") public String map() { return "map"; } @GetMapping(value = "getTotal") @ResponseBody public String getTotal() { String sysDate = GetDate.getSysDate(); return HttpClientUtil.doGet(totalUrl + "?date=" + sysDate); // String s = "[{'id':'l0','name':'每日统计','yesData':100,'toData':50},{'id':'l1','name':'每日日活','yesData':500,'toData':50},{'id':'l2','name':'活跃度','yesData':100,'toData':50},{'id':'l3','name':'啊啊啊','yesData':100,'toData':50}]"; // return s; } /** * 获取统计数据 */ @GetMapping(value = "getAnalysisData") @ResponseBody public String getList(String tag) { // hourUrl // System.out.println(tag); // String s = "{'yesterday':{'00':110,'01':110,'02':25,'03':40,'07':87,'08':65,'09':32,'10':45,'11':35,'12':87,'13':34,'14':78,'15':54,'16':110,'17':100,'18':100,'19':56,'20':89,'21':88,'22':87,'23':86},'today':{'00':122,'01':122,'02':110,'03':105,'04':100,'05':46,'06':24,'07':24,'08':123,'09':221,'10':222,'11':100,'12':100,'13':78,'14':87,'15':67,'16':44,'17':77,'18':120,'19':100,'20':100,'21':108,'22':80,'23':55}}"; String sysDate = GetDate.getSysDate(); return HttpClientUtil.doGet(hourUrl + "?id=" + tag + "&&date=" + sysDate); // return s; } @GetMapping(value = "getData") @ResponseBody public String getData(HttpServletRequest req) { String level = req.getParameter("level"); String draw = req.getParameter("draw"); String start = req.getParameter("start"); String length = req.getParameter("length"); // System.out.println(time+level+text); String time = req.getParameter("time"); String text = req.getParameter("text"); int d = Integer.parseInt(draw); int s = Integer.parseInt(start) + 1; int l = Integer.parseInt(level); int size = Integer.parseInt(length); String sysDate = GetDate.getSysDate(); String url = esDataUrl + "?startpage=" + s + "&&size=" + size; if (time != null && !"".equals(time)) { url = url + "&&date=" + time; } else { url = url + "&&date=" + "2019-03-04"; } if (text != null && !"".equals(text)) { url = url + "&&keyword=" + text; } else { url = url + "&&keyword=" + ""; } /*//获取前台额外传递过来的查询条件 String extra_search = req.getParameter("extra_search");*/ String json = HttpClientUtil.doGet(url); return "{'draw':" + draw + ",'data':" + json + "}"; /*return "{'data':{'draw':"+draw+",'total':20,'rows':[{'user_id':'123'," + "'sku_id':'123'," + "'user_gender':'M'," + "'user_age':12," + "'user_level':1," + "'order_price':123.2," + "'sku_name':'asd'," + "'sku_tm_id':'234'," + "'sku_category1_id':'435'," + "'sku_category2_id':'3465'," + "'sku_category3_id':'56'," + "'sku_category1_name':'dfg'," + "'sku_category2_name':'hg'," + "'sku_category3_name':'bc'," + "'spu_id':'876'," + "'sku_num':234," + "'order_count':234," + "'order_amount':654," + "'dt':'hgdff'},{'user_id':'123'," + "'sku_id':'123'," + "'user_gender':'M'," + "'user_age':12," + "'user_level':1," + "'order_price':123.2," + "'sku_name':'asd'," + "'sku_tm_id':'234'," + "'sku_category1_id':'435'," + "'sku_category2_id':'3465'," + "'sku_category3_id':'56'," + "'sku_category1_name':'dfg'," + "'sku_category2_name':'hg'," + "'sku_category3_name':'bc'," + "'spu_id':'876'," + "'sku_num':234," + "'order_count':234," + "'order_amount':654," + "'dt':'hgdff'},{'user_id':'123'," + "'sku_id':'123'," + "'user_gender':'M'," + "'user_age':12," + "'user_level':1," + "'order_price':123.2," + "'sku_name':'asd'," + "'sku_tm_id':'234'," + "'sku_category1_id':'435'," + "'sku_category2_id':'3465'," + "'sku_category3_id':'56'," + "'sku_category1_name':'dfg'," + "'sku_category2_name':'hg'," + "'sku_category3_name':'bc'," + "'spu_id':'876'," + "'sku_num':234," + "'order_count':234," + "'order_amount':654," + "'dt':'hgdff'}," + "{'user_id':'123'," + "'sku_id':'123'," + "'user_gender':'M'," + "'user_age':12," + "'user_level':1," + "'order_price':123.2," + "'sku_name':'asd'," + "'sku_tm_id':'234'," + "'sku_category1_id':'435'," + "'sku_category2_id':'3465'," + "'sku_category3_id':'56'," + "'sku_category1_name':'dfg'," + "'sku_category2_name':'hg'," + "'sku_category3_name':'bc'," + "'spu_id':'876'," + "'sku_num':234," + "'order_count':234," + "'order_amount':654," + "'dt':'hgdff'}" + "]}}";*/ } @GetMapping(value = "getSexData") @ResponseBody public String getSexData(String time, Integer level, String text) { // System.out.println(time+level+text); /*String json = HttpClientUtil.doGet(sexUrl + "?from=" + s + "&&time=" + time + "&&text=" + text + "&&level=" + l + "&&size=" + size);*/ return "{'stat':[{'group':[{'name':'20岁以下','value':300},{'name':'20-30岁','value':200},{'name':'30岁以上','value':100}]},{'group':[{'name':'男','value':200},{'name':'女','value':200}]}]}"; } /** * 获取地图数据 */ @GetMapping(value = "getChinaOrderData") @ResponseBody public String getChinaOrderData() { return ""; } }
[ "codingdebugallday@163.com" ]
codingdebugallday@163.com
b1a0c2b5c66c5393e3435aeb094617ae1805280a
0b0d470c2f5800f61f6f67ec3a30dc376187a9e2
/deeplearning4j-scaleout/deeplearning4j-scaleout-akka-word2vec/src/main/java/org/deeplearning4j/text/sentenceiterator/UimaSentenceIterator.java
365dc6e121454e8340ad71d9e0a3938dafbc1932
[ "Apache-2.0" ]
permissive
lipengyu/java-deeplearning
1311942415cd6489b6cbec00ef2a71ab0c813e11
82d55aeecec08798d7ce48d017f7c282cc0f3ef2
refs/heads/master
2021-01-21T03:59:30.360076
2014-08-30T16:59:55
2014-08-30T16:59:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,787
java
package org.deeplearning4j.text.sentenceiterator; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.apache.uima.analysis_engine.AnalysisEngine; import org.apache.uima.cas.CAS; import org.apache.uima.collection.CollectionReader; import org.apache.uima.fit.factory.AnalysisEngineFactory; import org.apache.uima.fit.util.JCasUtil; import org.apache.uima.resource.ResourceInitializationException; import org.cleartk.token.type.Sentence; import org.cleartk.util.cr.FilesCollectionReader; import org.deeplearning4j.text.annotator.SentenceAnnotator; import org.deeplearning4j.text.annotator.TokenizerAnnotator; import org.deeplearning4j.word2vec.sentenceiterator.BaseSentenceIterator; import org.deeplearning4j.word2vec.sentenceiterator.SentenceIterator; import org.deeplearning4j.word2vec.sentenceiterator.SentencePreProcessor; /** * Iterates over and returns sentences * based on the passed in analysis engine * @author Adam Gibson * */ public class UimaSentenceIterator extends BaseSentenceIterator { protected CAS cas; protected CollectionReader reader; protected AnalysisEngine engine; protected Iterator<String> sentences; protected String path; public UimaSentenceIterator(SentencePreProcessor preProcessor,String path, AnalysisEngine engine) { super(preProcessor); this.path = path; try { this.reader = FilesCollectionReader.getCollectionReader(path); } catch (ResourceInitializationException e) { throw new RuntimeException(e); } this.engine = engine; } public UimaSentenceIterator(String path, AnalysisEngine engine) { this(null,path,engine); } @Override public String nextSentence() { if(sentences == null || !sentences.hasNext()) { try { if(cas == null) cas = engine.newCAS(); cas.reset(); reader.getNext(cas); engine.process(cas); List<String> list = new ArrayList<String>(); for(Sentence sentence : JCasUtil.select(cas.getJCas(), Sentence.class)) { list.add(sentence.getCoveredText()); } sentences = list.iterator(); //needs to be next cas while(!sentences.hasNext()) { //sentence is empty; go to another cas if(reader.hasNext()) { cas.reset(); reader.getNext(cas); engine.process(cas); for(Sentence sentence : JCasUtil.select(cas.getJCas(), Sentence.class)) { list.add(sentence.getCoveredText()); } sentences = list.iterator(); } else return null; } String ret = sentences.next(); if(this.getPreProcessor() != null) ret = this.getPreProcessor().preProcess(ret); return ret; } catch (Exception e) { throw new RuntimeException(e); } } else { String ret = sentences.next(); if(this.getPreProcessor() != null) ret = this.getPreProcessor().preProcess(ret); return ret; } } /** * Creates a uima sentence iterator with the given path * @param path the path to the root directory or file to read from * @return the uima sentence iterator for the given root dir or file * @throws Exception */ public static SentenceIterator createWithPath(String path) throws Exception { return new UimaSentenceIterator(path,AnalysisEngineFactory.createEngine(AnalysisEngineFactory.createEngineDescription(TokenizerAnnotator.getDescription(), SentenceAnnotator.getDescription()))); } @Override public boolean hasNext() { try { return reader.hasNext() || sentences != null && sentences.hasNext(); } catch (Exception e) { throw new RuntimeException(e); } } @Override public void reset() { try { this.reader = FilesCollectionReader.getCollectionReader(path); } catch (ResourceInitializationException e) { throw new RuntimeException(e); } } }
[ "agibson@clevercloudcomputing.com" ]
agibson@clevercloudcomputing.com
abfb041e4c39c948e81b53f68c96bcd7551996e6
5f889ef76c02fb43048b9037ea18169130747613
/beehive-design/src/main/java/top/aprilyolies/curator/framework/TransactionExample.java
761ce05e56b8a8996d68ec1f5275efcbb1f66481
[ "MIT", "Apache-2.0" ]
permissive
AprilYoLies/beehive
e3b2728accf57098a372894613d9ded040d5c028
507ede3ace163e1c420aa12755466b96d5699b65
refs/heads/master
2022-12-20T22:57:32.923900
2019-09-16T11:43:32
2019-09-16T11:43:32
190,317,990
0
0
Apache-2.0
2022-12-16T03:20:29
2019-06-05T03:14:42
Java
UTF-8
Java
false
false
2,303
java
package top.aprilyolies.curator.framework; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.api.transaction.CuratorTransaction; import org.apache.curator.framework.api.transaction.CuratorTransactionFinal; import org.apache.curator.framework.api.transaction.CuratorTransactionResult; import java.util.Collection; /** * @Author EvaJohnson * @Date 2019-06-06 * @Email g863821569@gmail.com */ public class TransactionExample { public static void main(String[] args) throws Exception { CuratorFramework client = CreateClientExample.createSimple("127.0.0.1:2181"); client.start(); transaction(client); } public static Collection<CuratorTransactionResult> transaction(CuratorFramework client) throws Exception { // this example shows how to use ZooKeeper's new transactions Collection<CuratorTransactionResult> results = client.inTransaction().create().forPath("/path", "some data".getBytes()) .and().setData().forPath("/path", "other data".getBytes()) .and().delete().forPath("/path") .and().commit(); // IMPORTANT! // called for (CuratorTransactionResult result : results) { System.out.println(result.getForPath() + " - " + result.getType()); } return results; } /* * These next four methods show how to use Curator's transaction APIs in a * more traditional - one-at-a-time - manner */ public static CuratorTransaction startTransaction(CuratorFramework client) { // start the transaction builder return client.inTransaction(); } public static CuratorTransactionFinal addCreateToTransaction(CuratorTransaction transaction) throws Exception { // add a create operation return transaction.create().forPath("/a/path", "some data".getBytes()).and(); } public static CuratorTransactionFinal addDeleteToTransaction(CuratorTransaction transaction) throws Exception { // add a delete operation return transaction.delete().forPath("/another/path").and(); } public static void commitTransaction(CuratorTransactionFinal transaction) throws Exception { // commit the transaction transaction.commit(); } }
[ "863821569@qq.com" ]
863821569@qq.com
a02238cf293f0771c1465041044e8cc1d69f81ed
14b389df8efcde6eb5c043bd9afec6c9772d03dd
/src/day18/Test1_6.java
e6b59d78ac7d61bf53c55419298daea34189dbe1
[]
no_license
if123456/work
3ea03fd5722e2ed125c31f875aa0023848addbec
26258d5563135cee402bef2fd68f98183ac2f498
refs/heads/master
2020-12-11T08:24:24.900033
2020-01-18T09:28:18
2020-01-18T09:28:18
233,799,873
0
0
null
null
null
null
UTF-8
Java
false
false
509
java
package day18; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; public class Test1_6 { public static void main(String[] args) throws IOException { FileInputStream fis=new FileInputStream("D:\\1.jpg"); FileOutputStream fos=new FileOutputStream("D:\\a\\1copy.jpg"); byte[]b=new byte[1024]; int len; while((len=fis.read(b))!=-1){ fos.write(b,0,len); } fos.close(); fis.close(); } }
[ "l" ]
l
afbe1bf8b75449ce2151c0dd21a58cff68c40409
e9da33e1e8795c5f5e8f524858c1a8ce73309c3f
/net/src/main/java/ru/finance2/simplecrmandroid/net/OneWayEntityNetClient.java
a166e326cd80c9a97ceadcde6f568f8cb9759869
[]
no_license
Alexey2FC/SyncExample-android-
985a7e24d22d5fbfd38b0b72e94d89408a1007c6
806a9163594a237747e50440d91b4bb6a20ad19f
refs/heads/master
2020-12-10T03:25:54.222224
2017-06-27T12:07:25
2017-06-27T12:08:31
95,554,071
0
0
null
null
null
null
UTF-8
Java
false
false
821
java
package ru.finance2.simplecrmandroid.net; import com.google.gson.JsonObject; import java.io.IOException; import java.util.List; import retrofit2.Call; public class OneWayEntityNetClient extends BasicNetClient<TwoWaysEntitiesAPI> { public OneWayEntityNetClient(String baseUrl, String token) { super(baseUrl, token, TwoWaysEntitiesAPI.class); } public List<JsonObject> getEntities() throws IOException { Call<List<JsonObject>> call = api.getEntities(); return fillResultOrError(call); } public static void main(String[] args) throws IOException { OneWayEntityNetClient client = new OneWayEntityNetClient("http://192.168.1.38/one-way-entity-sync-api/", "1"); List<JsonObject> entities = client.getEntities(); System.out.println(entities); } }
[ "admin@example.com" ]
admin@example.com
e31a5ea2a7cb17b60ffdf29b320d54b3f8c61884
fa93c9be2923e697fb8a2066f8fb65c7718cdec7
/sources/hu/akarnokd/rxjava2/operators/BasicMergeSubscription.java
800d2f8db2fda7a7fe4f7822fab0719f60fb0827
[]
no_license
Auch-Auch/avito_source
b6c9f4b0e5c977b36d5fbc88c52f23ff908b7f8b
76fdcc5b7e036c57ecc193e790b0582481768cdc
refs/heads/master
2023-05-06T01:32:43.014668
2021-05-25T10:19:22
2021-05-25T10:19:22
370,650,685
0
0
null
null
null
null
UTF-8
Java
false
false
5,854
java
package hu.akarnokd.rxjava2.operators; import a2.b.a.a.a; import io.reactivex.internal.fuseable.SimpleQueue; import io.reactivex.internal.subscribers.InnerQueuedSubscriber; import io.reactivex.internal.subscribers.InnerQueuedSubscriberSupport; import io.reactivex.internal.subscriptions.EmptySubscription; import io.reactivex.internal.subscriptions.SubscriptionHelper; import io.reactivex.internal.util.AtomicThrowable; import io.reactivex.internal.util.BackpressureHelper; import io.reactivex.parallel.ParallelFlowable; import io.reactivex.plugins.RxJavaPlugins; import java.util.Arrays; import java.util.Comparator; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; import org.reactivestreams.Publisher; import org.reactivestreams.Subscriber; import org.reactivestreams.Subscription; public final class BasicMergeSubscription<T> extends AtomicInteger implements Subscription, InnerQueuedSubscriberSupport<T> { private static final long serialVersionUID = -8467324377226330554L; public final Subscriber<? super T> a; public final Comparator<? super T> b; public final InnerQueuedSubscriber<T>[] c; public final boolean d; public final AtomicThrowable e; public final AtomicLong f; public final Object[] g; public volatile boolean h; public BasicMergeSubscription(Subscriber<? super T> subscriber, Comparator<? super T> comparator, int i, int i2, boolean z) { this.a = subscriber; this.b = comparator; this.d = z; InnerQueuedSubscriber<T>[] innerQueuedSubscriberArr = new InnerQueuedSubscriber[i]; for (int i3 = 0; i3 < i; i3++) { innerQueuedSubscriberArr[i3] = new InnerQueuedSubscriber<>(this, i2); } this.c = innerQueuedSubscriberArr; this.f = new AtomicLong(); this.e = new AtomicThrowable(); this.g = new Object[i]; } public void a() { Arrays.fill(this.g, this); InnerQueuedSubscriber<T>[] innerQueuedSubscriberArr = this.c; for (InnerQueuedSubscriber<T> innerQueuedSubscriber : innerQueuedSubscriberArr) { innerQueuedSubscriber.cancel(); SimpleQueue<T> queue = innerQueuedSubscriber.queue(); if (queue != null) { queue.clear(); } } } public void b() { Arrays.fill(this.g, this); for (InnerQueuedSubscriber<T> innerQueuedSubscriber : this.c) { SimpleQueue<T> queue = innerQueuedSubscriber.queue(); if (queue != null) { queue.clear(); } } } @Override // org.reactivestreams.Subscription public void cancel() { if (!this.h) { this.h = true; for (InnerQueuedSubscriber<T> innerQueuedSubscriber : this.c) { innerQueuedSubscriber.cancel(); } if (getAndIncrement() == 0) { b(); } } } /* JADX DEBUG: Failed to insert an additional move for type inference into block B:131:0x00cf */ /* JADX WARNING: Code restructure failed: missing block: B:42:0x00a4, code lost: if (r0 != r26) goto L_0x00a6; */ /* JADX WARNING: Removed duplicated region for block: B:133:0x00cf A[SYNTHETIC] */ /* JADX WARNING: Removed duplicated region for block: B:47:0x00ad A[SYNTHETIC, Splitter:B:47:0x00ad] */ /* JADX WARNING: Removed duplicated region for block: B:56:0x00cc */ @Override // io.reactivex.internal.subscribers.InnerQueuedSubscriberSupport /* Code decompiled incorrectly, please refer to instructions dump. */ public void drain() { /* // Method dump skipped, instructions count: 402 */ throw new UnsupportedOperationException("Method not decompiled: hu.akarnokd.rxjava2.operators.BasicMergeSubscription.drain():void"); } @Override // io.reactivex.internal.subscribers.InnerQueuedSubscriberSupport public void innerComplete(InnerQueuedSubscriber<T> innerQueuedSubscriber) { innerQueuedSubscriber.setDone(); drain(); } @Override // io.reactivex.internal.subscribers.InnerQueuedSubscriberSupport public void innerError(InnerQueuedSubscriber<T> innerQueuedSubscriber, Throwable th) { if (this.e.addThrowable(th)) { if (!this.d) { for (InnerQueuedSubscriber<T> innerQueuedSubscriber2 : this.c) { innerQueuedSubscriber2.cancel(); } } else { innerQueuedSubscriber.setDone(); } drain(); return; } RxJavaPlugins.onError(th); } @Override // io.reactivex.internal.subscribers.InnerQueuedSubscriberSupport public void innerNext(InnerQueuedSubscriber<T> innerQueuedSubscriber, T t) { innerQueuedSubscriber.queue().offer(t); drain(); } @Override // org.reactivestreams.Subscription public void request(long j) { if (SubscriptionHelper.validate(j)) { BackpressureHelper.add(this.f, j); drain(); } } public void subscribe(Publisher<T>[] publisherArr, int i) { InnerQueuedSubscriber<T>[] innerQueuedSubscriberArr = this.c; for (int i2 = 0; i2 < i && !this.h; i2++) { Publisher<T> publisher = publisherArr[i2]; if (publisher != null) { publisher.subscribe(innerQueuedSubscriberArr[i2]); } else { EmptySubscription.error(new NullPointerException(a.Q2("The ", i2, "th source is null")), innerQueuedSubscriberArr[i2]); if (!this.d) { return; } } } } public void subscribe(ParallelFlowable<T> parallelFlowable) { parallelFlowable.subscribe(this.c); } }
[ "auchhunter@gmail.com" ]
auchhunter@gmail.com
91323178419222735932b8cb324bfeb81d8fcd38
f82bcfb9afe11e2ebad32054c887a2eb524ad006
/dentaku-metadata-service/src/java/org/omg/java/cwm/foundation/datatypes/EnumerationLiteralClass.java
798697be226fc4f0299bd4327305b759d6a48d40
[ "BSD-3-Clause", "Apache-2.0" ]
permissive
codehaus/dentaku
8655e76c29e207156f175fd61360fe270bc528d7
c916d029069b84ee444d3606fa28db79cf5a6ba8
refs/heads/master
2023-07-20T00:36:04.244855
2006-03-18T06:43:18
2006-03-18T06:43:18
36,364,422
1
0
null
null
null
null
UTF-8
Java
false
false
536
java
/* * Java(TM) OLAP Interface */ package org.omg.java.cwm.foundation.datatypes; public interface EnumerationLiteralClass extends javax.jmi.reflect.RefClass { public org.omg.java.cwm.foundation.datatypes.EnumerationLiteral createEnumerationLiteral( java.lang.String _name, org.omg.java.cwm.objectmodel.core.VisibilityKind _visibility, org.omg.java.cwm.objectmodel.core.Expression _value ) throws javax.jmi.reflect.JmiException; public org.omg.java.cwm.foundation.datatypes.EnumerationLiteral createEnumerationLiteral(); }
[ "topping@51e4faab-3f0f-0410-8d7f-865566f634a9" ]
topping@51e4faab-3f0f-0410-8d7f-865566f634a9
99fe892d798ae3121972d9053ca739275a270af9
91f7dc07b2c0d07cf02ecee54b8548d42fe2f720
/sources/external/scy-com-ext/ext-impl/src/com/liferay/portlet/messageboards/action/LinkAction.java
319b7b172b76f1d666cb16432fb3fda9ce189577
[]
no_license
yattias/scy
8996a485de7dfef22ac9ae69005cfb12be91dbc3
e80421c7457e5ba27874abeef06668196ed8125a
refs/heads/master
2021-01-10T01:15:04.267584
2013-04-03T09:32:50
2013-04-03T09:32:50
36,696,984
0
0
null
null
null
null
UTF-8
Java
false
false
5,504
java
package com.liferay.portlet.messageboards.action; import javax.portlet.ActionRequest; import javax.portlet.ActionResponse; import javax.portlet.PortletConfig; import javax.portlet.RenderRequest; import javax.portlet.RenderResponse; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import com.liferay.portal.kernel.servlet.SessionErrors; import com.liferay.portal.kernel.util.Constants; import com.liferay.portal.security.auth.PrincipalException; import com.liferay.portal.service.ClassNameLocalServiceUtil; import com.liferay.portal.service.ServiceContext; import com.liferay.portal.service.ServiceContextFactory; import com.liferay.portal.struts.PortletAction; import com.liferay.portal.util.WebKeys; import com.liferay.portlet.bookmarks.EntryURLException; import com.liferay.portlet.bookmarks.NoSuchEntryException; import com.liferay.portlet.bookmarks.NoSuchFolderException; import com.liferay.portlet.bookmarks.model.BookmarksEntry; import com.liferay.portlet.journal.model.JournalArticle; import com.liferay.portlet.messageboards.model.MBMessage; import com.liferay.portlet.messageboards.model.MBMessageDisplay; import com.liferay.portlet.messageboards.service.MBMessageLocalServiceUtil; import com.liferay.portlet.tags.TagsEntryException; import com.liferay.util.LinkToolUtil; /** * Extern-Link action for message board portlet. Add extern links from a chosen * start resource to an entered url. It is fired after pressing the taglib ui * add_link. If the user chose callByRefence or let the radio button empty an * new bookmark entry will create. A new link from viewed resource to created * where created and a new link from created bookmark. If user chose callByValue * the content from entered url will be save from stream as new webcontent and * also links between the resource would be create. * * @author daniel * */ public class LinkAction extends PortletAction { public static final String NL = System.getProperty("line.separator"); public void processAction(ActionMapping mapping, ActionForm form, PortletConfig portletConfig, ActionRequest req, ActionResponse res) throws Exception { Long entryId = Long.valueOf(req.getParameter("entryId")); String redirect = req.getParameter("redirect"); String cmd = req.getParameter(Constants.CMD); String radio; if (req.getParameter("saveAsRadio") == null) { radio = "bookmark"; } else { radio = req.getParameter("saveAsRadio"); } LinkToolUtil util = new LinkToolUtil(); MBMessage mb = MBMessageLocalServiceUtil.getMBMessage(entryId); long threadId = mb.getThread().getThreadId(); MBMessageDisplay entry; try { entry = MBMessageLocalServiceUtil.getMessageDisplay(entryId, Long.toString(threadId)); ServiceContext serviceContext = ServiceContextFactory.getInstance(MBMessage.class.getName(), req); if (cmd == null) { req.setAttribute(WebKeys.MESSAGE_BOARDS_MESSAGE, entry); req.setAttribute("redirect", redirect); // set Forward setForward(req, "portlet.message_boards.view_link"); return; } else if (cmd.equals("extern") && radio.equals("bookmark")) { Long linkedResourceId = util.updateEntry(req, serviceContext); String classNameIdBookmark = String.valueOf(ClassNameLocalServiceUtil.getClassNameId(BookmarksEntry.class.getName())); String classNameIdMessage = String.valueOf(ClassNameLocalServiceUtil.getClassNameId(MBMessage.class.getName())); // add link for blog util.addLink(entryId.toString(), linkedResourceId.toString(), classNameIdBookmark, serviceContext); // add link for new bookmark util.addLink(linkedResourceId.toString(), entryId.toString(), classNameIdMessage, serviceContext); res.sendRedirect(redirect); } else if (cmd.equals("extern") && radio.equals("copy")) { JournalArticle ja = util.saveCopyFromUrl(req, serviceContext); Long linkedResourceId = ja.getResourcePrimKey(); String classNameIdJournalArticle = String.valueOf(ClassNameLocalServiceUtil.getClassNameId(JournalArticle.class.getName())); String classNameIdMessage = String.valueOf(ClassNameLocalServiceUtil.getClassNameId(MBMessage.class.getName())); // add link for blog util.addLink(entryId.toString(), linkedResourceId.toString(), classNameIdJournalArticle, serviceContext); // add link for new bookmark util.addLink(linkedResourceId.toString(), entryId.toString(), classNameIdMessage, serviceContext); res.sendRedirect(redirect); } res.sendRedirect(redirect); } catch (Exception e) { if (e instanceof NoSuchEntryException || e instanceof PrincipalException) { SessionErrors.add(req, e.getClass().getName()); setForward(req, "portlet.bookmarks.error"); } else if (e instanceof EntryURLException || e instanceof NoSuchFolderException) { SessionErrors.add(req, e.getClass().getName()); setForward(req, "portlet.message_boards.view_link"); } else if (e instanceof TagsEntryException) { SessionErrors.add(req, e.getClass().getName(), e); } else { throw e; } } } public ActionForward render(ActionMapping mapping, ActionForm form, PortletConfig portletConfig, RenderRequest renderRequest, RenderResponse renderResponse) throws Exception { return mapping.findForward(getForward(renderRequest, "portlet.message_boards.view_link")); } }
[ "mueller.daniel.1981@b2e416e9-8f50-0410-b9aa-47b31ee1ff64" ]
mueller.daniel.1981@b2e416e9-8f50-0410-b9aa-47b31ee1ff64
1331cd8abd25ac2fc7c05c48f5caefc3efb7242b
4da9097315831c8639a8491e881ec97fdf74c603
/src/StockIT-v2-release_source_from_JADX/sources/com/google/android/gms/internal/ads/zzblq.java
bd7f339429f40c778a60e6a425327fcd1578554a
[ "Apache-2.0" ]
permissive
atul-vyshnav/2021_IBM_Code_Challenge_StockIT
5c3c11af285cf6f032b7c207e457f4c9a5b0c7e1
25c26a4cc59a3f3e575f617b59acc202ee6ee48a
refs/heads/main
2023-08-11T06:17:05.659651
2021-10-01T08:48:06
2021-10-01T08:48:06
410,595,708
1
1
null
null
null
null
UTF-8
Java
false
false
238
java
package com.google.android.gms.internal.ads; /* compiled from: com.google.android.gms:play-services-ads@@19.4.0 */ final class zzblq { /* access modifiers changed from: private */ public static final zzbln zzfmn = new zzbln(); }
[ "57108396+atul-vyshnav@users.noreply.github.com" ]
57108396+atul-vyshnav@users.noreply.github.com
57810e04386ab81013c9c65c4d0be05449d0c6b2
c885ef92397be9d54b87741f01557f61d3f794f3
/results/Gson-18/com.google.gson.internal.$Gson$Types/BBC-F0-opt-10/tests/20/com/google/gson/internal/$Gson$Types_ESTest_scaffolding.java
0eb3425c21f2b06a5336e8e05ce409ed4b77e7ce
[ "CC-BY-4.0", "MIT" ]
permissive
pderakhshanfar/EMSE-BBC-experiment
f60ac5f7664dd9a85f755a00a57ec12c7551e8c6
fea1a92c2e7ba7080b8529e2052259c9b697bbda
refs/heads/main
2022-11-25T00:39:58.983828
2022-04-12T16:04:26
2022-04-12T16:04:26
309,335,889
0
1
null
2021-11-05T11:18:43
2020-11-02T10:30:38
null
UTF-8
Java
false
false
542
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Wed Oct 20 22:50:18 GMT 2021 */ package com.google.gson.internal; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; import org.evosuite.runtime.sandbox.Sandbox; import org.evosuite.runtime.sandbox.Sandbox.SandboxMode; @EvoSuiteClassExclude public class $Gson$Types_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pderakhshanfar@serg2.ewi.tudelft.nl" ]
pderakhshanfar@serg2.ewi.tudelft.nl
812a75c4aa31f7d4ee0aec72e66cdc9abc94f530
ca030864a3a1c24be6b9d1802c2353da4ca0d441
/classes5.dex_source_from_JADX/com/facebook/graphql/model/GraphQLFollowUpFeedUnitsConnection$1.java
5661c0d6f73f015cf9599f2ca4e1ce1ec194cdf2
[]
no_license
pxson001/facebook-app
87aa51e29195eeaae69adeb30219547f83a5b7b1
640630f078980f9818049625ebc42569c67c69f7
refs/heads/master
2020-04-07T20:36:45.758523
2018-03-07T09:04:57
2018-03-07T09:04:57
124,208,458
4
0
null
null
null
null
UTF-8
Java
false
false
530
java
package com.facebook.graphql.model; import android.os.Parcel; import android.os.Parcelable.Creator; /* compiled from: hdAtomSize */ final class GraphQLFollowUpFeedUnitsConnection$1 implements Creator<GraphQLFollowUpFeedUnitsConnection> { GraphQLFollowUpFeedUnitsConnection$1() { } public final Object createFromParcel(Parcel parcel) { return new GraphQLFollowUpFeedUnitsConnection(parcel); } public final Object[] newArray(int i) { return new GraphQLFollowUpFeedUnitsConnection[i]; } }
[ "son.pham@jmango360.com" ]
son.pham@jmango360.com
3a9e512568d509f71562e4020c8782dfb60e1afb
e1a1c0ecd5f77d1c2ed6ae87436cb38cf37b2190
/src/main/java/org/agilewiki/jasocket/commands/CommandAgent.java
8adace1f25e319a3fbffeb7bcae906b8fdbf9072
[]
no_license
luciendra/JASocket
c79cf216ffa27c6293b74c9ead7ad8c4eababda3
4ec753d23b236b92a66d32e3bd42069e3382107d
refs/heads/master
2020-12-25T01:44:43.045143
2012-12-08T04:26:31
2012-12-08T04:26:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,421
java
/* * Copyright 2012 Bill La Forge * * This file is part of AgileWiki and is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License (LGPL) as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This code 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * or navigate to the following url http://www.gnu.org/licenses/lgpl-2.1.txt * * Note however that only Scala, Java and JavaScript files are being covered by LGPL. * All other files are covered by the Common Public License (CPL). * A copy of this license is also included and can be * found as well at http://www.opensource.org/licenses/cpl1.0.txt */ package org.agilewiki.jasocket.commands; import org.agilewiki.jactor.RP; import org.agilewiki.jactor.factory.JAFactory; import org.agilewiki.jasocket.jid.agent.AgentJid; import org.agilewiki.jid.JidFactories; import org.agilewiki.jid.collection.vlenc.BListJid; import org.agilewiki.jid.scalar.vlens.string.StringJid; import java.util.Iterator; abstract public class CommandAgent extends AgentJid { protected BListJid<StringJid> out; public void setCommandLineString(String commandLine) throws Exception { } protected Commands commands() { return (Commands) getAncestor(Commands.class); } protected Command getCommand(String name) { return commands().get(name); } protected Iterator<String> commandIterator() { return commands().iterator(); } protected void println(String v) throws Exception { out.iAdd(-1); StringJid sj = out.iGet(-1); sj.setValue(v); } abstract protected void process(RP rp) throws Exception; @Override public void start(RP rp) throws Exception { out = (BListJid<StringJid>) JAFactory.newActor( this, JidFactories.STRING_BLIST_JID_TYPE, getMailboxFactory().createMailbox()); process(rp); } }
[ "laforge49@gmail.com" ]
laforge49@gmail.com
e32fdb3e6e4a3b593d60418b8d884d6cc5a522d5
17b2223310983f0252ff58ac3f395cf9503f0fa2
/services/hrdb/src/com/auto_wihrycxpim/hrdb/service/HrdbQueryExecutorServiceImpl.java
11d0005738e69b025db1a23d6e3aef243b4d2229
[]
no_license
wavemakerapps/Auto_wIHRycXPIM
f04cbc215665064a7940409d10f88cf01a16673a
f464925a6b1fd8369b2869feb51b2866d43da1ad
refs/heads/master
2021-08-08T06:59:52.537801
2017-11-09T20:42:51
2017-11-09T20:42:51
110,164,134
0
0
null
null
null
null
UTF-8
Java
false
false
1,053
java
/*Copyright (c) 2016-2017 wavemaker.com All Rights Reserved. This software is the confidential and proprietary information of wavemaker.com You shall not disclose such Confidential Information and shall use it only in accordance with the terms of the source code license agreement you entered into with wavemaker.com*/ package com.auto_wihrycxpim.hrdb.service; /*This is a Studio Managed File. DO NOT EDIT THIS FILE. Your changes may be reverted by Studio.*/ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Service; import com.wavemaker.runtime.data.dao.query.WMQueryExecutor; @Service public class HrdbQueryExecutorServiceImpl implements HrdbQueryExecutorService { private static final Logger LOGGER = LoggerFactory.getLogger(HrdbQueryExecutorServiceImpl.class); @Autowired @Qualifier("hrdbWMQueryExecutor") private WMQueryExecutor queryExecutor; }
[ "appTest1@wavemaker.com" ]
appTest1@wavemaker.com
ef0036108b2116dc3e3d6729b5e4ecf4faded628
1304e5f703b2fd682603e676a4156ce9e944febc
/xbms/index-server/src/main/java/com/pl/model/ReportJiangxiFamilyPlanning.java
109388266ab471cf905b5e1d074488ef7fdfeaf7
[]
no_license
HuangGuangLei666/xbms
1a726298ae72454bfc8b22c1cbe348aed7387cc1
535952f652fa716e8fce677ccfc29898d9c73dae
refs/heads/master
2022-12-10T10:29:25.975200
2019-11-19T02:57:40
2019-11-19T02:57:40
222,399,619
0
0
null
2022-12-06T00:44:08
2019-11-18T08:32:09
Java
UTF-8
Java
false
false
3,848
java
package com.pl.model; import java.io.Serializable; import java.util.Date; public class ReportJiangxiFamilyPlanning implements Serializable { private Integer id; private Long dialogId; private String phone; private String name; private String medicalExamination; private String free; private String satisfaction; private String status; private String createBy; private Date createDate; private String updateBy; private Date updateDate; private String remark; private static final long serialVersionUID = 1L; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public Long getDialogId() { return dialogId; } public void setDialogId(Long dialogId) { this.dialogId = dialogId; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone == null ? null : phone.trim(); } public String getName() { return name; } public void setName(String name) { this.name = name == null ? null : name.trim(); } public String getMedicalExamination() { return medicalExamination; } public void setMedicalExamination(String medicalExamination) { this.medicalExamination = medicalExamination == null ? null : medicalExamination.trim(); } public String getFree() { return free; } public void setFree(String free) { this.free = free == null ? null : free.trim(); } public String getSatisfaction() { return satisfaction; } public void setSatisfaction(String satisfaction) { this.satisfaction = satisfaction == null ? null : satisfaction.trim(); } public String getStatus() { return status; } public void setStatus(String status) { this.status = status == null ? null : status.trim(); } public String getCreateBy() { return createBy; } public void setCreateBy(String createBy) { this.createBy = createBy == null ? null : createBy.trim(); } public Date getCreateDate() { return createDate; } public void setCreateDate(Date createDate) { this.createDate = createDate; } public String getUpdateBy() { return updateBy; } public void setUpdateBy(String updateBy) { this.updateBy = updateBy == null ? null : updateBy.trim(); } public Date getUpdateDate() { return updateDate; } public void setUpdateDate(Date updateDate) { this.updateDate = updateDate; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark == null ? null : remark.trim(); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(getClass().getSimpleName()); sb.append(" ["); sb.append("Hash = ").append(hashCode()); sb.append(", id=").append(id); sb.append(", dialogId=").append(dialogId); sb.append(", phone=").append(phone); sb.append(", name=").append(name); sb.append(", medicalExamination=").append(medicalExamination); sb.append(", free=").append(free); sb.append(", satisfaction=").append(satisfaction); sb.append(", status=").append(status); sb.append(", createBy=").append(createBy); sb.append(", createDate=").append(createDate); sb.append(", updateBy=").append(updateBy); sb.append(", updateDate=").append(updateDate); sb.append(", remark=").append(remark); sb.append(", serialVersionUID=").append(serialVersionUID); sb.append("]"); return sb.toString(); } }
[ "1144716956@qq.com" ]
1144716956@qq.com
a45b52f068cecefd1a9ad628286021351a4c0c45
f2395c2667f93df09d3e36542562ce2943925662
/src/main/java/wenyu/jca/JCAUsage/SignatureDemo.java
56280e094b7b108ae2c6d4af499a6d9b8aa715fc
[]
no_license
WenyuChang/JCAUsage
089820aa0c343e8947446143f5bce4b8ad91d3e0
62f28737ee1fe8a1c595496fb37b410b37a209fe
refs/heads/master
2021-01-10T21:26:48.793915
2014-10-30T02:43:50
2014-10-30T02:43:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,249
java
package wenyu.jca.JCAUsage; import java.security.PrivateKey; import java.security.PublicKey; import java.security.Signature; import javax.xml.bind.DatatypeConverter; public class SignatureDemo { public static final String algorithm = "SHA512withRSA"; // For demo, pls don't change public PrivateKey privKey; public PublicKey pubKey; public Signature sign; public byte[] signedResult; public void initKey() throws Exception { if(GeneralProperties.privKey == null || GeneralProperties.pubKey == null) { SecureRandomDemo.ExportValue(); KeyPairGeneratorDemo.ExportValue(); privKey = GeneralProperties.privKey; pubKey = GeneralProperties.pubKey; } } public void initSignSignature() throws Exception { if(StandardAlgorithmNameMapping.Signature.ifValid(algorithm)) { sign = Signature.getInstance(algorithm); } else { System.out.println("Pls input correct algorithm."); return; } initKey(); sign.initSign(privKey); } public void initVeriferSignature() throws Exception { if(StandardAlgorithmNameMapping.Signature.ifValid(algorithm)) { sign = Signature.getInstance(algorithm); } else { System.out.println("Pls input correct algorithm."); return; } initKey(); sign.initVerify(pubKey); } public void sign(String[] messages) throws Exception { initSignSignature(); for(String message:messages) { sign.update(message.getBytes()); } signedResult = sign.sign(); System.out.println("The signed result is: " + DatatypeConverter.printBase64Binary(signedResult)); } public void verify(String[] messages) throws Exception { if(signedResult == null) { return; } initVeriferSignature(); for(String message:messages) { sign.update(message.getBytes()); } boolean result = sign.verify(signedResult); String resultMessage = result?"Successed":"Failed"; System.out.println(String.format("%s to verify!", resultMessage)); } public static void main(String[] args) throws Exception { String[] messages = {"message-1", "message-2", "message-3"}; String[] messages1 = {"message-3", "message-4", "message-5"}; SignatureDemo demo = new SignatureDemo(); demo.sign(messages); demo.verify(messages); demo.verify(messages1); } }
[ "changwy_1987@hotmail.com" ]
changwy_1987@hotmail.com
4be641c62e91227e481c357db0971b5ecfe57950
46cf3cf4b111f78d32cce77631ea4e2be74a11cf
/src/test/java/org/assertj/core/internal/iterables/Iterables_assertHasSameSizeAs_with_Iterable_Test.java
4c657e348961f400fd9a7ecb04a062040de1e5be
[ "Apache-2.0" ]
permissive
KBiron/assertj-core
269c4c1349c88087d3462b696c646f230b80be2f
8940a37eb89e98ca0ffafbc2e6329c9247054077
refs/heads/master
2021-01-17T20:34:25.469725
2013-12-23T13:10:29
2013-12-23T13:10:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,198
java
/* * Created on Apr 27, 2010 * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. * * Copyright @2010-2015 the original author or authors. */ package org.assertj.core.internal.iterables; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.error.ShouldHaveSameSizeAs.shouldHaveSameSizeAs; import static org.assertj.core.test.TestData.someInfo; import static org.assertj.core.test.TestFailures.failBecauseExpectedAssertionErrorWasNotThrown; import static org.assertj.core.util.FailureMessages.actualIsNull; import static org.assertj.core.util.Lists.newArrayList; import static org.mockito.Mockito.verify; import java.util.Collection; import org.assertj.core.api.AssertionInfo; import org.assertj.core.internal.Iterables; import org.assertj.core.internal.IterablesBaseTest; import org.junit.Test; /** * Tests for <code>{@link Iterables#assertHasSameSizeAs(AssertionInfo, Iterable, Iterable)}</code>. * * @author Nicolas François */ public class Iterables_assertHasSameSizeAs_with_Iterable_Test extends IterablesBaseTest { @Test public void should_pass_if_size_of_actual_is_equal_to_expected_size() { iterables.assertHasSameSizeAs(someInfo(), newArrayList("Yoda", "Luke"), newArrayList("Solo", "Leia")); } @Test public void should_fail_if_actual_is_null() { thrown.expectAssertionError(actualIsNull()); iterables.assertHasSameSizeAs(someInfo(), null, newArrayList("Solo", "Leia")); } @Test public void should_fail_if_other_is_null() { thrown.expectNullPointerException("The Iterable to compare actual size with should not be null"); Iterable<?> other = null; iterables.assertHasSameSizeAs(someInfo(), newArrayList("Yoda", "Luke"), other); } @Test public void should_fail_if_actual_size_is_not_equal_to_other_size() { AssertionInfo info = someInfo(); Collection<String> actual = newArrayList("Yoda"); Collection<String> other = newArrayList("Solo", "Luke", "Leia"); try { iterables.assertHasSameSizeAs(info, actual, other); } catch (AssertionError e) { assertThat(e).hasMessage(shouldHaveSameSizeAs(actual, actual.size(), other.size()).create(null)); return; } failBecauseExpectedAssertionErrorWasNotThrown(); } @Test public void should_pass_if_actual_has_same_size_as_other_whatever_custom_comparison_strategy_is() { iterablesWithCaseInsensitiveComparisonStrategy.assertHasSameSizeAs(someInfo(), newArrayList("Luke", "Yoda"), newArrayList("Solo", "Leia")); } @Test public void should_fail_if_actual_is_null_whatever_custom_comparison_strategy_is() { thrown.expectAssertionError(actualIsNull()); iterablesWithCaseInsensitiveComparisonStrategy.assertHasSameSizeAs(someInfo(), null, newArrayList("Solo", "Leia")); } @Test public void should_fail_if_other_is_null_whatever_custom_comparison_strategy_is() { thrown.expectNullPointerException("The Iterable to compare actual size with should not be null"); Iterable<?> other = null; iterables.assertHasSameSizeAs(someInfo(), newArrayList("Yoda", "Luke"), other); } @Test public void should_fail_if_actual_size_is_not_equal_to_other_size_whatever_custom_comparison_strategy_is() { AssertionInfo info = someInfo(); Collection<String> actual = newArrayList("Yoda"); Collection<String> other = newArrayList("Solo", "Luke", "Leia"); try { iterablesWithCaseInsensitiveComparisonStrategy.assertHasSameSizeAs(info, actual, other); } catch (AssertionError e) { assertThat(e).hasMessage(shouldHaveSameSizeAs(actual, actual.size(), other.size()).create(null)); return; } failBecauseExpectedAssertionErrorWasNotThrown(); } }
[ "joel.costigliola@gmail.com" ]
joel.costigliola@gmail.com
e0522bb3d6461d2f1e940229535cd312971c238d
9b75d8540ff2e55f9ff66918cc5676ae19c3bbe3
/bazaar8.apk-decompiled/sources/j/a/a/f.java
e8cfb23c64692edfb70478d338378657b1931b4e
[]
no_license
BaseMax/PopularAndroidSource
a395ccac5c0a7334d90c2594db8273aca39550ed
bcae15340907797a91d39f89b9d7266e0292a184
refs/heads/master
2020-08-05T08:19:34.146858
2019-10-06T20:06:31
2019-10-06T20:06:31
212,433,298
2
0
null
null
null
null
UTF-8
Java
false
false
487
java
package j.a.a; import java.io.IOException; import k.y; /* compiled from: DiskLruCache */ class f extends i { /* renamed from: c reason: collision with root package name */ public final /* synthetic */ h f15278c; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public f(h hVar, y yVar) { super(yVar); this.f15278c = hVar; } public void a(IOException iOException) { this.f15278c.n = true; } }
[ "MaxBaseCode@gmail.com" ]
MaxBaseCode@gmail.com
e30a70c32cea49ff3cef1ae8d178710659686d6e
4d574f5816e3b0e4ce88e7fb9c4e2202dbca2dfa
/jodconverter-local/src/test/java/org/jodconverter/local/process/ProcessManagerTest.java
294012bb62ced687b898e5da7dc438dd07f22504
[ "Apache-2.0" ]
permissive
mexekanez/jodconverter
f5f91c92b9a5fbff5dadc127b8c3a6eb1822b0a7
70096f4136367b920b3c7269dc3cf59924a00a0e
refs/heads/master
2022-07-21T19:55:09.069810
2020-05-16T12:25:17
2020-05-16T12:25:17
264,429,795
0
0
null
2020-05-16T12:16:15
2020-05-16T12:16:15
null
UTF-8
Java
false
false
8,072
java
/* * Copyright 2004 - 2012 Mirko Nasato and contributors * 2016 - 2020 Simon Braconnier and contributors * * This file is part of JODConverter - Java OpenDocument Converter. * * 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.jodconverter.local.process; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; import static org.junit.jupiter.api.Assumptions.assumeTrue; import java.io.IOException; import org.junit.jupiter.api.Test; import org.jodconverter.core.test.util.TestUtil; import org.jodconverter.core.util.OSUtils; import org.jodconverter.local.office.LocalOfficeManager; import org.jodconverter.local.office.LocalOfficeUtils; /** Contains tests for the {@link ProcessManager} classes */ public class ProcessManagerTest { private static long waitForPidNotFound( final ProcessManager processManager, final ProcessQuery query) throws IOException { int tryCount = 0; long pid; do { tryCount++; pid = processManager.findPid(query); if (pid != ProcessManager.PID_NOT_FOUND) { TestUtil.sleepQuietly(250L); } } while (pid != ProcessManager.PID_NOT_FOUND && tryCount != 10); return pid; } @Test public void freeBsdProcessManager() throws IOException { assumeTrue(OSUtils.IS_OS_FREE_BSD); final ProcessManager processManager = FreeBSDProcessManager.getDefault(); final Process process = Runtime.getRuntime().exec("ping -c 5 127.0.0.1"); final ProcessQuery query = new ProcessQuery("ping", "-c 5 127.0.0.1"); final long pid = processManager.findPid(query); assertThat(pid).isNotEqualTo(ProcessManager.PID_NOT_FOUND); assertThat(process) .extracting("pid") .isInstanceOfSatisfying( Number.class, number -> assertThat(number.longValue()).isEqualTo(pid)); processManager.kill(process, pid); assertThat(waitForPidNotFound(processManager, query)).isEqualTo(ProcessManager.PID_NOT_FOUND); } @Test public void freeBsdPureJavaProcessManager() throws IOException { assumeTrue(OSUtils.IS_OS_FREE_BSD); final ProcessManager defaultManager = LocalOfficeUtils.findBestProcessManager(); final ProcessManager processManager = PureJavaProcessManager.getDefault(); final Process process = Runtime.getRuntime().exec("ping -c 5 127.0.0.1"); final ProcessQuery query = new ProcessQuery("ping", "-c 5 127.0.0.1"); final long pid = processManager.findPid(query); assertThat(pid).isEqualTo(ProcessManager.PID_UNKNOWN); processManager.kill(process, pid); assertThat(waitForPidNotFound(defaultManager, query)).isEqualTo(ProcessManager.PID_NOT_FOUND); } @Test public void unixProcessManager() throws IOException { assumeTrue(OSUtils.IS_OS_UNIX && !OSUtils.IS_OS_MAC && !OSUtils.IS_OS_FREE_BSD); final ProcessManager processManager = UnixProcessManager.getDefault(); final Process process = Runtime.getRuntime().exec("sleep 5s"); final ProcessQuery query = new ProcessQuery("sleep", "5s"); final long pid = processManager.findPid(query); assertThat(pid).isNotEqualTo(ProcessManager.PID_NOT_FOUND); assertThat(process) .extracting("pid") .isInstanceOfSatisfying( Number.class, number -> assertThat(number.longValue()).isEqualTo(pid)); processManager.kill(process, pid); assertThat(waitForPidNotFound(processManager, query)).isEqualTo(ProcessManager.PID_NOT_FOUND); } @Test public void unixPureJavaProcessManager() throws IOException { assumeTrue(OSUtils.IS_OS_UNIX && !OSUtils.IS_OS_MAC && !OSUtils.IS_OS_FREE_BSD); final ProcessManager defaultManager = LocalOfficeUtils.findBestProcessManager(); final ProcessManager processManager = PureJavaProcessManager.getDefault(); final Process process = Runtime.getRuntime().exec("sleep 5s"); final ProcessQuery query = new ProcessQuery("sleep", "5s"); final long pid = processManager.findPid(query); assertThat(pid).isEqualTo(ProcessManager.PID_UNKNOWN); processManager.kill(process, pid); assertThat(waitForPidNotFound(defaultManager, query)).isEqualTo(ProcessManager.PID_NOT_FOUND); } @Test public void macProcessManager() throws IOException { assumeTrue(OSUtils.IS_OS_MAC); final ProcessManager processManager = MacProcessManager.getDefault(); final Process process = Runtime.getRuntime().exec("sleep 5s"); final ProcessQuery query = new ProcessQuery("sleep", "5s"); final long pid = processManager.findPid(query); assertThat(pid).isNotEqualTo(ProcessManager.PID_NOT_FOUND); assertThat(process) .extracting("pid") .isInstanceOfSatisfying( Number.class, number -> assertThat(number.longValue()).isEqualTo(pid)); processManager.kill(process, pid); assertThat(waitForPidNotFound(processManager, query)).isEqualTo(ProcessManager.PID_NOT_FOUND); } @Test public void macPureJavaProcessManager() throws IOException { assumeTrue(OSUtils.IS_OS_MAC); final ProcessManager defaultManager = LocalOfficeUtils.findBestProcessManager(); final ProcessManager processManager = PureJavaProcessManager.getDefault(); final Process process = Runtime.getRuntime().exec("sleep 5s"); final ProcessQuery query = new ProcessQuery("sleep", "5s"); final long pid = processManager.findPid(query); assertThat(pid).isEqualTo(ProcessManager.PID_UNKNOWN); processManager.kill(process, pid); assertThat(waitForPidNotFound(defaultManager, query)).isEqualTo(ProcessManager.PID_NOT_FOUND); } @Test public void windowsProcessManager() throws IOException { assumeTrue(OSUtils.IS_OS_WINDOWS); final ProcessManager processManager = WindowsProcessManager.getDefault(); final Process process = Runtime.getRuntime().exec("ping 127.0.0.1 -n 5"); final ProcessQuery query = new ProcessQuery("ping", "127.0.0.1 -n 5"); final long pid = processManager.findPid(query); assertThat(pid).isNotEqualTo(ProcessManager.PID_NOT_FOUND); // Won't work on Windows, skip this assertion // assertThat(process).extracting("pid") // .isInstanceOfSatisfying( // Number.class, number -> assertThat(number.longValue()).isEqualTo(pid)); processManager.kill(process, pid); assertThat(waitForPidNotFound(processManager, query)).isEqualTo(ProcessManager.PID_NOT_FOUND); } @Test public void windowsPureJavaProcessManager() throws IOException { assumeTrue(OSUtils.IS_OS_WINDOWS); final ProcessManager defaultManager = LocalOfficeUtils.findBestProcessManager(); final ProcessManager processManager = PureJavaProcessManager.getDefault(); final Process process = Runtime.getRuntime().exec("ping 127.0.0.1 -n 5"); final ProcessQuery query = new ProcessQuery("ping", "127.0.0.1 -n 5"); final long pid = processManager.findPid(query); assertThat(pid).isEqualTo(ProcessManager.PID_UNKNOWN); processManager.kill(process, pid); assertThat(waitForPidNotFound(defaultManager, query)).isEqualTo(ProcessManager.PID_NOT_FOUND); } /** * Tests that using an custom process manager that does not appear in the classpath will fail with * an IllegalArgumentException. */ @Test public void customProcessManagerNotFound() { assertThatIllegalArgumentException() .isThrownBy( () -> LocalOfficeManager.builder() .processManager("org.foo.fallback.ProcessManager") .build()); } }
[ "simonbraconnier@gmail.com" ]
simonbraconnier@gmail.com
0abcfed6f047d5e74a11ee76d29b23ebdea684e7
9a95b29692e2c7bae893eb597cfb2b3f87fd9c20
/src/test/java/com/redis/study/RedisStudyApplicationTests.java
19dad3bc26c1ff431143ae987fd374bfc5a3ece0
[]
no_license
whdals7337/redis-study
faebf57c8f33c76bb8768acc7578bdf23f0e2f6b
e80d2d38ff81e564e7d350dd710ff3d6dcc45dc6
refs/heads/master
2023-05-06T19:41:13.766112
2021-05-22T16:24:03
2021-05-22T16:24:03
369,801,137
0
0
null
null
null
null
UTF-8
Java
false
false
211
java
package com.redis.study; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class RedisStudyApplicationTests { @Test void contextLoads() { } }
[ "uok02018496@naver.com" ]
uok02018496@naver.com
66003107c358575fa2d3ed8a588a4fd2ba9c352d
163c9f58cf4a98d7c198eca1381410e405b6004d
/springboot-rabbitmq-learn/src/main/java/com/learn/springbootrabbitmqlearn/listener/InsertOrderRecordListener.java
641db8a93839755f70e7aea332c176d2b4eba2bc
[]
no_license
liman657/springboot_rabbitmq
c2441f5f664f4f703e5af53bd6048b16d4f451d9
54655bee1a1a74a9b9f88264f7d76fb307b9dadf
refs/heads/master
2023-08-08T19:50:49.751247
2019-11-20T12:37:28
2019-11-20T12:41:24
222,933,335
0
0
null
2023-07-22T22:09:10
2019-11-20T12:33:17
Java
UTF-8
Java
false
false
1,624
java
package com.learn.springbootrabbitmqlearn.listener; import com.learn.springbootrabbitmqlearn.entity.OrderRecord; import com.learn.springbootrabbitmqlearn.mapper.OrderRecordMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationListener; import org.springframework.stereotype.Component; /** * autor:liman * createtime:2019/10/20 * comment: */ @Component public class InsertOrderRecordListener implements ApplicationListener<InsertOrderRecordEvent> { private static final Logger log = LoggerFactory.getLogger(InsertOrderRecordListener.class); @Autowired private OrderRecordMapper orderRecordMapper; @Override public void onApplicationEvent(InsertOrderRecordEvent insertOrderRecordEvent) { log.info("监听到下单记录"); try{ if(insertOrderRecordEvent!=null){ OrderRecord orderRecord = new OrderRecord(); BeanUtils.copyProperties(insertOrderRecordEvent,orderRecord); try { log.info("我看看事件处理是否是异步的"); Thread.sleep(5000L); } catch (InterruptedException e) { e.printStackTrace(); } orderRecordMapper.insert(orderRecord); log.info("数据保存完成"); } }catch (Exception e){ log.error("监听下单事件异常,异常信息为:{}",e.fillInStackTrace()); } } }
[ "657271181@qq.com" ]
657271181@qq.com
9e64819fe7e0e15a236d63f0b14f355e03fe3e00
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/19/19_3f8c37e8a08176a12f2b18aef27a8cb53d01a037/DeadlinesController/19_3f8c37e8a08176a12f2b18aef27a8cb53d01a037_DeadlinesController_t.java
2ac4f626ae36f5ec9783c9612df0f2faad8208ac
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
5,775
java
package uk.ac.cam.dashboard.controllers; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.ws.rs.DELETE; import javax.ws.rs.FormParam; import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import org.hibernate.Session; import org.jboss.resteasy.annotations.Form; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import uk.ac.cam.cl.dtg.ldap.LDAPObjectNotFoundException; import uk.ac.cam.cl.dtg.ldap.LDAPPartialQuery; import uk.ac.cam.cl.dtg.ldap.LDAPQueryManager; import uk.ac.cam.cl.dtg.ldap.LDAPUser; import uk.ac.cam.dashboard.exceptions.AuthException; import uk.ac.cam.dashboard.forms.DeadlineForm; import uk.ac.cam.dashboard.models.Deadline; import uk.ac.cam.dashboard.models.DeadlineUser; import uk.ac.cam.dashboard.models.Group; import uk.ac.cam.dashboard.models.User; import uk.ac.cam.dashboard.queries.DeadlineQuery; import uk.ac.cam.dashboard.util.HibernateUtil; import uk.ac.cam.dashboard.util.Mail; import uk.ac.cam.dashboard.util.Strings; import uk.ac.cam.dashboard.util.Util; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ImmutableMap; @Path("/api/deadlines") @Produces(MediaType.APPLICATION_JSON) public class DeadlinesController extends ApplicationController { // Create the logger private static Logger log = LoggerFactory.getLogger(GroupsController.class); private User currentUser; // Index @GET @Path("/") public ImmutableMap<String, ?> indexDeadlines() { try { currentUser = validateUser(); } catch (AuthException e) { return ImmutableMap.of("error", e.getMessage()); } return ImmutableMap.of("user", currentUser.toMap(), "deadlines", currentUser.setDeadlinesToMap()); } // Manage @GET @Path("/{id}") public Map<String, ?> getDeadline(@PathParam("id") int id) { try { currentUser = validateUser(); } catch (AuthException e) { return ImmutableMap.of("error", e.getMessage()); } Deadline deadline = DeadlineQuery.get(id); if(!deadline.getOwner().equals(currentUser)){ return ImmutableMap.of("redirectTo", "deadlines"); } return ImmutableMap.of("deadline", deadline.toMap(), "deadlineEdit", deadline.toMap(), "users", deadline.usersToMap(), "errors", "undefined"); } // Create @POST @Path("/") public Map<String, ?> createDeadline(@Form DeadlineForm deadlineForm) throws Exception { try { currentUser = validateUser(); } catch (AuthException e) { return ImmutableMap.of("error", e.getMessage()); } ArrayListMultimap<String, String> errors = deadlineForm.validate(); ImmutableMap<String, List<String>> actualErrors = Util.multimapToImmutableMap(errors); if(errors.isEmpty()){ int id = deadlineForm.handleCreate(currentUser); return ImmutableMap.of("redirectTo", "deadlines/"+id); } else { return ImmutableMap.of("deadline", deadlineForm.toMap(-1), "errors", actualErrors); } } // Update @POST @Path("/{id}") public Map<String, ?> updateDeadline(@Form DeadlineForm deadlineForm, @PathParam("id") int id) { try { currentUser = validateUser(); } catch (AuthException e) { return ImmutableMap.of("error", e.getMessage()); } ArrayListMultimap<String, String> errors = deadlineForm.validate(); ImmutableMap<String, List<String>> actualErrors = Util.multimapToImmutableMap(errors); if(errors.isEmpty()){ deadlineForm.handleUpdate(currentUser, id); return ImmutableMap.of("redirectTo", "deadlines/"+id); } else { return ImmutableMap.of("errors", actualErrors, "deadlineEdit", deadlineForm.toMap(id), "target", "edit"); } } // Delete @DELETE @Path("/{id}") public Map<String, ?> deleteDeadline(@PathParam("id") int id) { Session session = HibernateUtil.getTransactionSession(); Deadline deadline = DeadlineQuery.get(id); session.delete(deadline); return ImmutableMap.of("success", "true", "id", id); } // Mark as complete/not complete @PUT @Path("/{id}/complete") public Map<String, ?> updateComplete(@PathParam("id") int id) { DeadlineUser d = DeadlineQuery.getDUser(id); if(d.getComplete()){ d.toggleComplete(false); } else { d.toggleComplete(true); } return d.toMap(); } // Mark as archived @PUT @Path("/{id}/archive") public Map<String, ?> updateArchive(@PathParam("id") int id) { DeadlineUser d = DeadlineQuery.getDUser(id); if(d.getArchived()){ d.toggleArchived(false); } else { d.toggleArchived(true); } return d.toMap(); } // Find users by crsid @POST @Path("/queryCRSID") public List<HashMap<String, String>> queryCRSId(@FormParam("q") String x) { List<HashMap<String, String>> matches = null; try { matches = LDAPPartialQuery.partialUserByCrsid(x); } catch (LDAPObjectNotFoundException e){ log.error("Error performing LDAPQuery: " + e.getMessage()); return new ArrayList<HashMap<String, String>>(); } return matches; } // Find groups @POST @Path("/queryGroup") public List<ImmutableMap<String, ?>> queryCRSID(@FormParam("q") String x) { try { currentUser = validateUser(); } catch (AuthException e) { return new ArrayList<ImmutableMap<String, ?>>(); } ArrayList<ImmutableMap<String,?>> matches = new ArrayList<ImmutableMap<String, ?>>(); for(Group g : currentUser.getGroups()){ matches.add(ImmutableMap.of("group_id", g.getId(), "group_name", g.getTitle())); } return matches; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
927bd2f66726075eddb06e8d8ef03f96bbf51138
c54ab7d7d7e0161af315d7cbae669b4c52029951
/CoreJava/src/com/techchefs/javaapp/doublecolon/six/Example1.java
479cea71d65b2683cb68b1f15deca30b47055856
[]
no_license
deekshitr/ELF-06June19-TechChefs-DeekshitR
82c6796ad0ec142896e17971f2d9fd73aeb0d1c4
5296cbdddb89b3ef4a529f04f6aba500d474a327
refs/heads/master
2023-01-13T12:33:11.550703
2019-08-22T14:33:09
2019-08-22T14:33:09
192,527,129
0
0
null
2023-01-04T06:58:16
2019-06-18T11:31:00
Rich Text Format
UTF-8
Java
false
false
368
java
package com.techchefs.javaapp.doublecolon.six; import lombok.extern.java.Log; @Log public class Example1 { public static void main(String[] args) { MyProduct mp = Product::new; Product p1 = mp.getProductDetails("Fan", 45646.43); log.info("Product: "+p1); Product p2 = mp.getProductDetails("AirConditioner", 56756.34); log.info("Product: "+p2); } }
[ "deekshitr456@gmai.com" ]
deekshitr456@gmai.com
980a4b3be81dd693b3462702eb65c269a0294e7d
87a0ddd63ad59eece0b7964a22a710c43f333ad5
/src/main/java/com/baizhitong/resource/dao/point/sqlserver/PointRuleLotteryOrgDaoImpl.java
e2ed21df96c840fbf0acf1e69ee19f56c7237470
[]
no_license
royxpf/cloud
b41101f87b4edf3e228266f533836d1951768959
84f81431536c11ebe98fc67773e0c8a1223f7b7b
refs/heads/master
2020-06-27T02:13:56.374981
2017-04-25T07:48:42
2017-04-25T07:48:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,928
java
package com.baizhitong.resource.dao.point.sqlserver; import java.util.Date; import java.util.HashMap; import java.util.Map; import org.apache.commons.lang.StringUtils; import org.springframework.stereotype.Service; import com.baizhitong.common.Page; import com.baizhitong.common.dao.jdbc.QueryRule; import com.baizhitong.resource.common.core.dao.BaseSqlServerDao; import com.baizhitong.resource.dao.point.PointRuleLotteryOrgDao; import com.baizhitong.resource.model.point.PointRuleLotteryOrg; import com.baizhitong.utils.DateUtils; /** * 积分规则dao实现 PointRuleLotteryOrgDaoImpl TODO * * @author creator BZT 2016年6月23日 下午5:03:07 * @author updater * * @version 1.0.0 */ @Service public class PointRuleLotteryOrgDaoImpl extends BaseSqlServerDao<PointRuleLotteryOrg> implements PointRuleLotteryOrgDao { /** * 查询积分规则 ()<br> * * @param page * @param rows * @return */ public Page getList(String orgCode, Integer page, Integer rows) { StringBuffer sql = new StringBuffer(); Map<String, Object> sqlParam = new HashMap<String, Object>(); sql.append("select"); sql.append(" * "); sql.append(" FROM"); sql.append(" point_rule_lottery_org "); sql.append(" WHERE"); sql.append(" 1=1 and flagDelete=0 "); if (StringUtils.isNotEmpty(orgCode)) { sql.append(" and orgCode=:orgCode "); sqlParam.put("orgCode", orgCode); } sql.append(" order by startTime desc "); return super.queryDistinctPage(sql.toString(), sqlParam, page, rows); } /** * 机构积分规则 ()<br> * * @param ruleOrg * @return */ public boolean add(PointRuleLotteryOrg ruleOrg) { try { return super.saveOne(ruleOrg); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block e.printStackTrace(); return false; } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); return false; } } /** * 查询机构积分规则 ()<br> * * @param id * @return */ public PointRuleLotteryOrg getById(Integer id) { QueryRule qr = QueryRule.getInstance(); qr.andEqual("id", id); qr.andEqual("flagDelete", 0); return super.findUnique(qr); } /** * 让之前的规则失效 ()<br> * * @return */ public int makeExpire(String orgCode) { StringBuffer sql = new StringBuffer(); Map<String, Object> sqlParam = new HashMap<String, Object>(); sql.append("UPDATE"); sql.append(" point_rule_lottery_org "); sql.append(" SET"); sql.append(" expireTime =:expireTime "); sql.append(" WHERE"); sql.append(" expireTime='99999999999999' "); sql.append(" and orgCode=:orgCode"); sqlParam.put("orgCode", orgCode); sqlParam.put("expireTime", Long.parseLong(DateUtils.getDate(new Date(), "yyyyMMddHHmmss"))); sqlParam.put("startTime", Long.parseLong(DateUtils.getDate(new Date(), "yyyyMMddHHmmss"))); return super.update(sql.toString(), sqlParam); } /** * 删除 ()<br> * * @param id * @return */ public int delete(int id) { StringBuffer sql = new StringBuffer(); Map<String, Object> sqlParam = new HashMap<String, Object>(); sql.append("UPDATE"); sql.append(" point_rule_lottery_org "); sql.append(" SET"); sql.append(" flagDelete =1 "); sql.append(" WHERE"); sql.append(" id =:id "); sqlParam.put("id", id); return super.update(sql.toString(), sqlParam); } }
[ "2636011620@qq.com" ]
2636011620@qq.com
bbc7f03170a218df409fa9114ec92cdd74900009
c6a2ddd0afbdd7fbdab6f121c9dfe00e38ff3434
/src/main/java/com/bs/util/AuthImage.java
fdb609641aa3c8f41e1862eabf9d23a005657310
[]
no_license
huangcz3/rentcar
3c298ea45cfe3dd461092f96afacf2d13240a880
3b33288106dd34e3181828edc623dd92646866bf
refs/heads/master
2020-03-07T21:42:40.650388
2018-05-12T11:17:33
2018-05-12T11:17:33
127,733,562
0
0
null
null
null
null
UTF-8
Java
false
false
1,314
java
package com.bs.util; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import java.io.IOException; /** * AuthImage Description:(验证码) * @author User */ public class AuthImage extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet { static final long serialVersionUID = 1L; @Override public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setHeader("Pragma", "No-cache"); response.setHeader("Cache-Control", "no-cache"); response.setDateHeader("Expires", 0); response.setContentType("image/jpeg"); System.out.println("AuthImage.service()"); //生成随机字串 String verifyCode = VerifyCodeUtils.generateVerifyCode(4); //存入会话session HttpSession session = request.getSession(true); //删除以前的 session.removeAttribute("randStr"); //设置新的验证码 session.setAttribute("randStr", verifyCode.toLowerCase()); //生成图片 int w = 107, h = 38; VerifyCodeUtils.outputImage(w, h, response.getOutputStream(), verifyCode); } }
[ "273514614@qq.com" ]
273514614@qq.com
bbb6b38d7d5a9e43ba76274225b1842814636888
8dc2fc950dc78285f9cbe400ae1bd7db30966b04
/chapter9/pax-exam/src/test/java/camelinaction/PaxExamIT.java
42dd0ff12a74c804b73e61b2929b6b19d9422b99
[ "Apache-2.0" ]
permissive
espre05/camelinaction2
fd8a057cdbc475bb5d0af0898127b15a8f1eb74f
6739b5c82fa7248bba934f402c19a3dea1711e1c
refs/heads/master
2021-07-23T02:38:09.923325
2017-11-02T19:25:39
2017-11-02T19:25:39
109,548,095
1
0
null
2017-11-05T03:15:03
2017-11-05T03:15:02
null
UTF-8
Java
false
false
4,417
java
package camelinaction; import java.io.File; import javax.inject.Inject; import org.apache.camel.CamelContext; import org.apache.camel.ProducerTemplate; import org.junit.Test; import org.junit.runner.RunWith; import org.ops4j.pax.exam.Configuration; import org.ops4j.pax.exam.Option; import org.ops4j.pax.exam.junit.PaxExam; import org.ops4j.pax.exam.karaf.options.LogLevelOption; import org.ops4j.pax.exam.options.UrlReference; import org.ops4j.pax.exam.util.Filter; import org.osgi.framework.BundleContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import static org.junit.Assert.assertEquals; import static org.ops4j.pax.exam.CoreOptions.junitBundles; import static org.ops4j.pax.exam.CoreOptions.maven; import static org.ops4j.pax.exam.CoreOptions.mavenBundle; import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.configureConsole; import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.features; import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration; import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder; import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.logLevel; /** * Integration test to test this example running in Apache Karaf using Pax-Exam for testing on the container. */ @RunWith(PaxExam.class) public class PaxExamIT { private static final Logger LOG = LoggerFactory.getLogger(PaxExamIT.class); @Inject protected BundleContext bundleContext; // inject the Camel application with this name (eg the id attribute in <camelContext>) @Inject @Filter("(camel.context.name=quotesCamel)") protected CamelContext camelContext; @Test public void testPaxExam() throws Exception { // we should have completed 0 exchange long total = camelContext.getManagedCamelContext().getExchangesTotal(); assertEquals("Should be 0 exchanges completed", 0, total); // need a little delay to be ready Thread.sleep(2000); // call the servlet, and log what it returns String url = "http4://localhost:8181/camel/say"; ProducerTemplate template = camelContext.createProducerTemplate(); String json = template.requestBody(url, null, String.class); System.out.println("Wiseman says: " + json); LOG.info("Wiseman says: {}", json); // and we should have completed 1 exchange total = camelContext.getManagedCamelContext().getExchangesTotal(); assertEquals("Should be 1 exchanges completed", 1, total); } @Configuration public Option[] config() { return new Option[]{ // setup which karaf server we are using karafDistributionConfiguration() .frameworkUrl(maven().groupId("org.apache.karaf").artifactId("apache-karaf").version("4.1.2").type("tar.gz")) .karafVersion("4.1.2") .name("Apache Karaf") .useDeployFolder(false) .unpackDirectory(new File("target/karaf")), // keep the folder so we can look inside when something fails, eg check the data/logs directory keepRuntimeFolder(), // Disable the SSH port configureConsole().ignoreRemoteShell(), // Configure Logging to not be verbose, if you set to DEBUG you see a lot of details logLevel(LogLevelOption.LogLevel.WARN), // Install JUnit junitBundles(), // Install base camel features features(getCamelKarafFeatureUrl(), "camel", "camel-test"), // and use camel-http for testing features(getCamelKarafFeatureUrl(), "camel-http4"), // install our example feature features(maven().groupId("com.camelinaction").artifactId("chapter9-pax-exam").version("2.0.0").classifier("features").type("xml"), "camel-quote") }; } public static UrlReference getCamelKarafFeatureUrl() { // the Apache Camel Karaf feature file return mavenBundle(). groupId("org.apache.camel.karaf"). artifactId("apache-camel") .version("2.19.0") .classifier("features") .type("xml"); } }
[ "claus.ibsen@gmail.com" ]
claus.ibsen@gmail.com
0128a09fcd7a5c032a3668fe6192658e2f9c40da
95270cf9741637fcfc394af8847efea6504f79cf
/src/main/java/de/hpi/interactionnet/enforceability/EnforceabilityChecker.java
ad5ca858dd7ce33239b6a59d7ba63650dd76ca7e
[]
no_license
juyixin/yxxf
5a0f8ec45e3f2941006baea504478dba023e1c41
ff101a3e7436238322099bc2e94be17da5f41a97
refs/heads/master
2020-04-11T21:17:02.190272
2018-12-18T06:13:21
2018-12-18T06:13:21
162,100,650
0
1
null
null
null
null
UTF-8
Java
false
false
3,844
java
package de.hpi.interactionnet.enforceability; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.Map; import java.util.Set; import de.hpi.PTnet.Marking; import de.hpi.PTnet.verification.PTNetInterpreter; import de.hpi.interactionnet.InteractionNet; import de.hpi.interactionnet.InteractionNetFactory; import de.hpi.interactionnet.InteractionTransition; public class EnforceabilityChecker { private InteractionNet net; private PTNetInterpreter interpreter; private Set<String> visited; private Set<String> visitedcancel; private boolean[] wasreached; private int numtransitions; private boolean[][] shareRole; public EnforceabilityChecker(InteractionNet net) { this.net = net; interpreter = InteractionNetFactory.eINSTANCE.createInterpreter(); visited = new HashSet<String>(); visitedcancel = new HashSet<String>(); wasreached = new boolean[net.getTransitions().size()]; numtransitions = net.getTransitions().size(); setupShareRole(); } public boolean checkEnforceability() { visited.clear(); visitedcancel.clear(); for (int i=0; i<wasreached.length; i++) wasreached[i] = false; if (!recursivelyCheck(net.getInitialMarking(), new boolean[numtransitions])) return false; for (int i=0; i<wasreached.length; i++) if (!wasreached[i]) return false; return true; } private boolean recursivelyCheck(Marking marking, boolean[] blocked) { String markingstr = marking.toString(); if (!visited.add(markingstr+" + "+blocked)) return true; boolean completed = false; boolean hasEnabledTransitions = false; boolean[] enabled = getEnablement(marking); // enabled(M) for (int ui=0; ui<numtransitions; ui++) if (enabled[ui]) { hasEnabledTransitions = true; if (!blocked[ui]) { Marking marking2 = interpreter.fireTransition(net, marking, net.getTransitions().get(ui)); boolean[] enabled2 = getEnablement(marking2); // enabled(M') for (int vi=0; vi<numtransitions; vi++) { if (enabled[vi] && !enabled2[vi] && !shareRole[ui][vi]) return false; } boolean[] blocked2 = new boolean[numtransitions]; for (int vi=0; vi<numtransitions; vi++) { if (enabled2[vi] && !enabled[vi] && !shareRole[ui][vi]) blocked2[vi] = true; else if (blocked[vi] && !shareRole[ui][vi]) blocked2[vi] = true; } if (!recursivelyCheck(marking2, blocked2)) return false; if (!visitedcancel.contains(marking2+" + "+blocked2)) { wasreached[ui] = true; completed = true; } } } if (!completed && hasEnabledTransitions) { visitedcancel.add(marking+" + "+blocked); } return true; } protected void setupShareRole() { shareRole = new boolean[numtransitions][numtransitions]; int x1 = 0; for (Iterator<de.hpi.petrinet.Transition> iter=net.getTransitions().iterator(); iter.hasNext(); ) { InteractionTransition i1 = (InteractionTransition)iter.next(); int x2 = 0; for (Iterator<de.hpi.petrinet.Transition> iter2=net.getTransitions().iterator(); iter2.hasNext(); ) { InteractionTransition i2 = (InteractionTransition)iter2.next(); shareRole[x1][x2] = (i1.getSender().equals(i2.getSender()) || i1.getSender().equals(i2.getReceiver()) || i1.getReceiver().equals(i2.getSender()) || i1.getReceiver().equals(i2.getReceiver())); x2++; } x1++; } } private Map<String,boolean[]> enablementMap = new HashMap<String,boolean[]>(); private boolean[] getEnablement(Marking marking) { boolean[] enablement = enablementMap.get(marking.toString()); if (enablement != null) return enablement; enablement = interpreter.getEnablement(net, marking); enablementMap.put(marking.toString(), enablement); return enablement; } }
[ "juyx@eazytec.com" ]
juyx@eazytec.com
c23898b726902079a5f2236287d4119d8f6b7cc1
19f8aefc88e856b07bdeeb809cb03b7c39726484
/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTestWithIncludeFilterIntegrationTests.java
77cd76220141dd250c32ddf6d679d6df83b5855a
[ "Apache-2.0" ]
permissive
moving-bricks/spring-boot-2.1.x
8dd7c6ba6e43ca2ec16cc262548245ced41806ab
78ed6ff678b51672abdbc761019edb64de36afde
refs/heads/master
2023-01-07T09:21:31.434984
2019-08-14T11:41:04
2019-08-14T11:41:04
202,248,924
0
1
Apache-2.0
2022-12-27T14:44:14
2019-08-14T01:22:07
Java
UTF-8
Java
false
false
2,543
java
/* * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.boot.test.autoconfigure.data.neo4j; import org.junit.ClassRule; import org.junit.Test; import org.junit.runner.RunWith; import org.testcontainers.containers.Neo4jContainer; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.util.TestPropertyValues; import org.springframework.boot.testsupport.testcontainers.SkippableContainer; import org.springframework.context.ApplicationContextInitializer; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.ComponentScan.Filter; import org.springframework.stereotype.Service; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringRunner; import static org.assertj.core.api.Assertions.assertThat; /** * Integration test with custom include filter for {@link DataNeo4jTest}. * * @author Eddú Meléndez * @author Michael Simons */ @RunWith(SpringRunner.class) @ContextConfiguration(initializers = DataNeo4jTestWithIncludeFilterIntegrationTests.Initializer.class) @DataNeo4jTest(includeFilters = @Filter(Service.class)) public class DataNeo4jTestWithIncludeFilterIntegrationTests { @ClassRule public static SkippableContainer<Neo4jContainer<?>> neo4j = new SkippableContainer<Neo4jContainer<?>>( () -> new Neo4jContainer<>().withAdminPassword(null)); @Autowired private ExampleService service; @Test public void testService() { assertThat(this.service.hasNode(ExampleGraph.class)).isFalse(); } static class Initializer implements ApplicationContextInitializer<ConfigurableApplicationContext> { @Override public void initialize(ConfigurableApplicationContext configurableApplicationContext) { TestPropertyValues.of("spring.data.neo4j.uri=" + neo4j.getContainer().getBoltUrl()) .applyTo(configurableApplicationContext.getEnvironment()); } } }
[ "810095178@qq.com" ]
810095178@qq.com
b4b7e8d070a6211c3742a1bf21d79fe867754805
7b82d70ba5fef677d83879dfeab859d17f4809aa
/f/cjlgb-cloud-platform/cjlgb-design-common/cjlgb-design-common-upms/src/main/java/com/cjlgb/design/common/upms/entity/SysRole.java
109fe8acab3223ba1d0ba7c0c2eab5b030f1c4a1
[ "Apache-2.0" ]
permissive
apollowesley/jun_test
fb962a28b6384c4097c7a8087a53878188db2ebc
c7a4600c3f0e1b045280eaf3464b64e908d2f0a2
refs/heads/main
2022-12-30T20:47:36.637165
2020-10-13T18:10:46
2020-10-13T18:10:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,402
java
package com.cjlgb.design.common.upms.entity; import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.TableField; import com.cjlgb.design.common.core.bean.BaseEntity; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import org.springframework.format.annotation.DateTimeFormat; import javax.validation.constraints.NotBlank; import java.time.LocalDateTime; import java.util.Collection; /** * @author WFT * @date 2020/7/13 * description:系统角色 */ @Setter @Getter @NoArgsConstructor public class SysRole extends BaseEntity { /** * 角色名称 */ @NotBlank(message = "角色名称不能为空") private String roleName; /** * 描述 */ private String roleDescribe; /** * 创建时间 */ @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @TableField(fill = FieldFill.INSERT) private LocalDateTime createTime; /** * 最后修改时间 */ @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @TableField(fill = FieldFill.INSERT_UPDATE) private LocalDateTime lastModifyTime; /** * 权限标识列表 */ @TableField(exist = false) private Collection<String> authorities; }
[ "wujun728@hotmail.com" ]
wujun728@hotmail.com
00571eee31bd741a069a3a8f549ab51a4d62c14c
ec4780894cff3531d0c9eb9e78861f060d2bd9cd
/advertising-system/ad-service/ad-sponsor/src/main/java/cn/edu/nju/vo/AdPlanGetRequest.java
8eef975cfa381843fedb0ea3235f3d9a28832917
[]
no_license
Thpffcj/SpringBoot-Project
e2c16b66a781b279ebecbf855bd00a0bac89f64e
1968895a2faff646cdeea5eb9849603220488869
refs/heads/master
2022-12-23T22:54:41.992818
2019-11-04T13:00:52
2019-11-04T13:00:52
107,384,236
2
1
null
2022-12-16T10:32:06
2017-10-18T09:06:15
JavaScript
UTF-8
Java
false
false
465
java
package cn.edu.nju.vo; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import org.springframework.util.CollectionUtils; import java.util.List; /** * Created by thpffcj on 2019/8/26. */ @Data @NoArgsConstructor @AllArgsConstructor public class AdPlanGetRequest { private Long userId; private List<Long> ids; public boolean validate() { return userId != null && !CollectionUtils.isEmpty(ids); } }
[ "1441732331@qq.com" ]
1441732331@qq.com
7e08474bfe0e11701e142f5cdc95ecbe05cf8c6a
2033a1ab5781ae0762782f5e5b7e4cf05bffb2b7
/Group/DevNightmare/jsdf-dataflowtesting/src/main/java/net/bqc/jsdf/core/model/EntryVertex.java
2dfae05784820a9c9ea0ffaccb1055ffd81fff9d
[]
no_license
truonganhhoang/int3117-2017
17df99d31fcad95b468a96f3882a76ba2a4c83e8
972f6635d2b512a276d2c6f26cd316d62232efa3
refs/heads/master
2021-01-20T09:29:04.977067
2018-01-04T13:41:28
2018-01-04T13:41:28
101,594,242
10
97
null
2018-01-04T13:41:29
2017-08-28T01:59:51
JavaScript
UTF-8
Java
false
false
144
java
package net.bqc.jsdf.core.model; public class EntryVertex extends Vertex { public EntryVertex() { this.type = Type.ENTRY; } }
[ "bqcuong2212@gmail.com" ]
bqcuong2212@gmail.com
1f51d076f21481f0e90f295dc43639cddff7b587
33cae071de05a68ce026bbbdeaa34780f965fd42
/src/剑指offer/_53表示数值的字符串.java
f157d8ba1f37b192ac2eaefce9afe3f331c330ea
[]
no_license
xiaok1024/AlgorithmWithDesign
85c04ab08f43409b5314fdc21220f0446aa3f2be
80f5fce4d4864a7451534d13cbc9bc83e4b042ef
refs/heads/master
2020-05-01T09:47:53.202394
2019-03-24T12:02:05
2019-03-24T12:02:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,241
java
package 剑指offer; public class _53表示数值的字符串 { /* * 请实现一个函数用来判断字符串是否表示数值(包括整数和小数)。 * 例如,字符串"+100","5e2","-123","3.1416"和"-1E-16"都表示数值。 * 但是"12e","1a3.14","1.2.3","+-5"和"12e+4.3"都不是。 * */ // 思路:逐个字符进行判断,e或E和小数点最多出现一次(无法共存),而e或E的前一个必须是数字,且不能是第一个或最后一个字符, // 符号的前一个字符不能是e或E。也可用正则表达式判断! /* * 思路:定义ecount 和 pcount 先判断第一个数是否为'-' 或者'+',遍历str * 后面的数字判断'-'或者'+'的前面是否为'e或者'E', * 判断e/E出现的次数,出现一次eCount 和pCount 都要+1,判断eCount >1 -> false,判断e的位置是否合法(不能为首尾,前面必须是数字) ,不满足false,都满足continue * 判断'.'出现的次数,eCount>1,false否则continue继续遍历 * 判断是否合法(为数字<48~57,e,E>) * */ /*public boolean isNumeric(char[] str) { if (str == null) return false; int index = 0; int ecount = 0; int pcount = 0; //如果第一个字符是符号就跳过 if (str[0] == '-' || str[0] == '+') index++; for (int i = index; i < str.length; i++) { if (str[i] == '-' || str[i] == '+') { if (str[i - 1] != 'e' && str[i - 1] != 'E') return false; continue; } if (str[i] == 'e' || str[i] == 'E') { ecount++; if (ecount > 1) return false; if (i == 0 || str[i - 1] < 48 || str[i - 1] > 57 || i == str.length - 1) return false; pcount++; continue; } if (str[i] == '.') { pcount++; if (pcount > 1) return false; continue; } // 出现非数字且不是e/E则返回false(小数点和符号用continue跳过了) if ((str[i] < 48 || str[i] > 57) && (str[i] != 'e') && (str[i] != 'E')) return false; } return true; } */ public boolean isNumeric(char[] str) { if(str ==null) return false; int ecount=0; //e的个数 int pcount=0; //p的个数 int index =0; //首字母是否为正负 //判断第一个位置是否为-|+ if(str[0] =='-' || str[0] =='+') index =1; for (int i = index; i < str.length; i++) { //数组中后面的位置出现了正负前面必须为e,E if(str[i] == '-' || str[i] == '+') { if (str[i-1] != 'e' && str[i-1] != 'E') { return false; } continue; } //判断存在几个e|E if( str[i] =='e' || str[i] =='E' ) { ecount++; if(ecount>1) return false; //判断e的前后条件 if(i==0 || i==str.length-1 ||str[i-1] <48 ||str[i-1] >57) return false; //存在e或者E就不能有小数 pcount++; continue; } //判断是否存在小数 if(str[i] =='.') { pcount++; if(pcount >1) return false; continue; } // 出现非数字且不是e/E(因为前面是根据e/E来判断的,可能前面出现了E,后面有e)则返回false(小数点和符号用continue跳过了) if ((str[i] < 48 || str[i] > 57) && (str[i] != 'e') && (str[i] != 'E')) return false; } return true; } }
[ "xiaokang136106@163.com" ]
xiaokang136106@163.com
c28af66a3550226c75e788dc12e152de67880712
c7ad128bb722227c7995e58fb3b41e767562357b
/app/src/main/java/com/article/oa_article/view/mobanmanager/ItemTouchHelperAdapter.java
710bf573a0087ee76e252b307128c7da17298253
[]
no_license
sengeiou/oa_article
45bbc650274ab4976c4fcf27f17b91d82be3086a
233a4a4acda90d69a7b961c894714bbfbd950f34
refs/heads/master
2022-03-30T11:20:34.007968
2020-01-14T08:27:02
2020-01-14T08:27:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
247
java
package com.article.oa_article.view.mobanmanager; //先写一个接口 public interface ItemTouchHelperAdapter { void onItemMove(int fromPosition, int toPosition);//移动时方法 void onItemDissmiss(int position);//消失时方法 }
[ "wy19941007" ]
wy19941007
2e854d04162a17b9b551d4d05f96b61d9acd0618
f3a9108db02fa0b01f58e0c1f799be37a8603089
/src/test/java/MyTest.java
1bf5f42b7e632abac8d91c3a876556b52d19eaf2
[]
no_license
lisz1012/mybatis-sql-mapping
7ef214fd3d38e2df64606d50b9c61a5f5b20f205
fd0f43e4b68a84c896f8d2e964d0fb88136b11be
refs/heads/master
2023-02-12T17:26:47.654518
2020-12-31T06:21:50
2020-12-31T06:21:50
325,229,589
0
0
null
null
null
null
UTF-8
Java
false
false
4,644
java
import com.lisz.bean.User; import com.lisz.dao.UserDao; import com.lisz.dao.UserDaoAnnotation; import org.apache.ibatis.io.Resources; import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSessionFactory; import org.apache.ibatis.session.SqlSessionFactoryBuilder; import org.junit.Before; import org.junit.Test; import java.io.IOException; import java.io.InputStream; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; public class MyTest { private static final String RESOURCE = "mybatis-config.xml"; private InputStream inputStream; private SqlSessionFactory sqlSessionFactory; @Before public void setup() { try { inputStream = Resources.getResourceAsStream(RESOURCE); } catch (IOException e) { e.printStackTrace(); } sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream); } @Test public void testSelect() throws Exception{ try (SqlSession session = sqlSessionFactory.openSession()) { //UserDaoAnnotation dao = session.getMapper(UserDaoAnnotation.class); UserDao dao = session.getMapper(UserDao.class); User user = dao.findById(1); System.out.println(user); // 动态代理类:org.apache.ibatis.binding.MapperProxy@5178056b //System.out.println(dao); } } @Test public void testSelect2() throws Exception{ try (SqlSession session = sqlSessionFactory.openSession()) { //UserDaoAnnotation dao = session.getMapper(UserDaoAnnotation.class); UserDao dao = session.getMapper(UserDao.class); Map<Object, Object> map = dao.findById2(1); System.out.println(map); // 动态代理类:org.apache.ibatis.binding.MapperProxy@5178056b System.out.println(dao); } } @Test public void testSelectAll() throws Exception{ try (SqlSession session = sqlSessionFactory.openSession()) { UserDao dao = session.getMapper(UserDao.class); List<User> users = dao.selectAll(); System.out.println(users); } } @Test public void testSelectAll2() throws Exception{ try (SqlSession session = sqlSessionFactory.openSession()) { UserDao dao = session.getMapper(UserDao.class); Map<String, User> map = dao.selectAll2(); System.out.println(map); } } @Test public void testSelectUsersByScore() throws Exception{ try (SqlSession session = sqlSessionFactory.openSession()) { UserDao dao = session.getMapper(UserDao.class); User user = new User(); user.setScore(110.00); List<User> users = dao.selectUsersByScore(user); System.out.println(users); } } @Test public void testSelectUsersByScoreAndId1() throws Exception{ try (SqlSession session = sqlSessionFactory.openSession()) { UserDao dao = session.getMapper(UserDao.class); List<User> users = dao.selectUsersByScoreAndId1(1, 110.00); System.out.println(users); } } @Test public void testSelectUsersByScoreAndId2() throws Exception{ try (SqlSession session = sqlSessionFactory.openSession()) { UserDao dao = session.getMapper(UserDao.class); List<User> users = dao.selectUsersByScoreAndId2(1, 110.00); System.out.println(users); } } @Test public void testSelectUsersByScoreAndId3() throws Exception{ try (SqlSession session = sqlSessionFactory.openSession()) { UserDao dao = session.getMapper(UserDao.class); Map<String, Object> map = new HashMap<>(); map.put("id", 1); map.put("score", 110.00); List<User> users = dao.selectUsersByScoreAndId3(map); System.out.println(users); } } @Test public void testSave() throws Exception{ try (SqlSession session = sqlSessionFactory.openSession()) {// sqlSessionFactory.openSession(true) 自动提交 UserDao dao = session.getMapper(UserDao.class); User user = new User(); user.setName("yijing"); user.setJob("SDE"); user.setBirthDate(new Date("1991/09/15")); user.setEmail("yijing@gmail.com"); user.setScore(100.00); user.setCreatedAt(new Date("2020/12/13")); user.setModifiedAt(new Date("2020/12/13")); Integer res = dao.save(user); session.commit(); System.out.println("Result: " + res); System.out.println(user); } } @Test public void testUpdate() throws Exception{ try (SqlSession session = sqlSessionFactory.openSession(true)) { UserDao dao = session.getMapper(UserDao.class); User user = new User(); user.setId(1); user.setScore(120.00); dao.update(user); System.out.println(user); } } @Test public void testDelete() throws Exception{ try (SqlSession session = sqlSessionFactory.openSession(true)) { UserDao dao = session.getMapper(UserDao.class); Integer delete = dao.deleteById(9); System.out.println(delete); } } }
[ "lisz1012@163.com" ]
lisz1012@163.com
e846d23b549e3bef289de1a0d1eabd15594cd411
524968bba3e28288b9fa3d7c9bd2d99c30957858
/src/main/java/com/king/frame/entity/SuperEntity.java
18965c7c4b3a23c446d5a09c429d13d5897fb72e
[]
no_license
ls909074489/stockAdmin
af87e1d89e5fe032233dc4fb9767a1c4016d2718
54b5f88cd76d29aae304a38f0ab5c1de9958d9eb
refs/heads/master
2022-12-21T05:59:07.211881
2019-10-11T05:36:02
2019-10-11T05:36:02
191,016,890
0
0
null
2022-12-16T04:50:21
2019-06-09T14:33:04
JavaScript
UTF-8
Java
false
false
2,914
java
package com.king.frame.entity; import java.util.Date; import javax.persistence.Column; import javax.persistence.MappedSuperclass; import javax.persistence.Temporal; import javax.persistence.TemporalType; import org.apache.poi.ss.formula.functions.T; import com.fasterxml.jackson.annotation.JsonFormat; import com.king.common.annotation.MetaData; /** * 实体类基类-超级 * * * @author zhangcb * */ @MappedSuperclass public class SuperEntity extends BaseEntity implements ISuperEntity<T> { private static final long serialVersionUID = 1L; @MetaData(value = "审批状态", comments = "1:自由态,2:提交态,3:审批态,4:退回态,5:通过态") @Column(nullable = false) protected Integer billstatus = 1; @MetaData(value = "单据号") @Column(length = 100) protected String billcode; @MetaData(value = "单据类型") @Column(length = 100) protected String billtype; @MetaData(value = "单据日期") @Temporal(TemporalType.DATE) protected Date billdate; @MetaData(value = "提交时间") @Temporal(TemporalType.DATE) protected Date submittime; @MetaData(value = "最后审批人id") @Column(length = 36) protected String approver; @MetaData(value = "最后审批人") @Column(length = 200) protected String approvername; @MetaData(value = "最后审批时间") protected Date approvetime; @MetaData(value = "审核意见") @Column(length = 2000) protected String approveremark; public Integer getBillstatus() { return billstatus; } public void setBillstatus(Integer billstatus) { this.billstatus = billstatus; } public String getBillcode() { return billcode; } public void setBillcode(String billcode) { this.billcode = billcode; } @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00") public Date getBilldate() { return billdate; } public void setBilldate(Date billdate) { this.billdate = billdate; } public String getApprover() { return approver; } public void setApprover(String approver) { this.approver = approver; } public String getApprovername() { return approvername; } public void setApprovername(String approvername) { this.approvername = approvername; } @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00") public Date getApprovetime() { return approvetime; } public void setApprovetime(Date approvetime) { this.approvetime = approvetime; } public String getBilltype() { return billtype; } public void setBilltype(String billtype) { this.billtype = billtype; } @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00") public Date getSubmittime() { return submittime; } public void setSubmittime(Date submittime) { this.submittime = submittime; } public String getApproveremark() { return approveremark; } public void setApproveremark(String approveremark) { this.approveremark = approveremark; } }
[ "909074489@qq.com" ]
909074489@qq.com
745951902fcdc4d6757dd1b1ed57cc83eb426793
9bac6b22d956192ba16d154fca68308c75052cbb
/icmsint-ejb/src/main/java/hk/judiciary/icmsint/model/sysinf/inf/gccij2d/NumericCT.java
8b9a409ee2068bda83a7b15ba81640ddec93bb61
[]
no_license
peterso05168/icmsint
9d4723781a6666cae8b72d42713467614699b66d
79461c4dc34c41b2533587ea3815d6275731a0a8
refs/heads/master
2020-06-25T07:32:54.932397
2017-07-13T10:54:56
2017-07-13T10:54:56
96,960,773
0
0
null
null
null
null
UTF-8
Java
false
false
2,558
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 // 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: 2017.06.20 at 04:47:35 AM CST // package hk.judiciary.icmsint.model.sysinf.inf.gccij2d; import java.math.BigDecimal; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlValue; /** * Numeric information that is assigned or is determined by calculation, counting, or sequencing. It does not require a unit of quantity or unit of measure. * * * <p>Java class for Numeric.CT complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="Numeric.CT"&gt; * &lt;simpleContent&gt; * &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema&gt;decimal"&gt; * &lt;/extension&gt; * &lt;/simpleContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "Numeric.CT", namespace = "CCT", propOrder = { "value" }) @XmlSeeAlso({ AgeV10CT.class, AgeV11CT.class, ChapterV10CT.class, ChapterV11CT.class, VersionNumberV10CT.class, TimeBarOffenceV10CT.class, TimeBarDiscoverV10CT.class, HearingWeightV10CT.class, PenaltyWeightV10CT.class, VariableTypeV10CT.class, OrderInternalNumberV10CT.class, YearV10CT.class, MonthV10CT.class, WeekV10CT.class, DayV10CT.class, HourV10CT.class, AmountV10CT.class, AppealInternalNumberV10CT.class, ReviewInternalNumberV10CT.class, MinuteV10CT.class, MinuteV11CT.class, SecondV10CT.class, PartyNoV10CT.class, AmountV11CT.class, HearingElapsedTimeV10CT.class }) public class NumericCT { @XmlValue protected BigDecimal value; /** * Gets the value of the value property. * * @return * possible object is * {@link BigDecimal } * */ public BigDecimal getValue() { return value; } /** * Sets the value of the value property. * * @param value * allowed object is * {@link BigDecimal } * */ public void setValue(BigDecimal value) { this.value = value; } }
[ "chiu.cheukman@gmail.com" ]
chiu.cheukman@gmail.com
b068d64fd9e46f2e7ed0595fddd083db2897aa84
f9c94c23839e0451d3c6c09c407d71fb679a524c
/java-client/src/main/java/com/couchbase/client/java/env/ClusterEnvironment.java
e76b8249051392c3c83e3236533047ac4941d537
[]
no_license
plokhotnyuk/couchbase-jvm-clients
6127e97dbb77c9e46854c1f992afdbdee8c4dd8a
e12fe43f5d04f40e1aa3f5d9bd3c2095bccaafff
refs/heads/master
2020-06-10T18:36:18.585785
2019-05-21T09:36:06
2019-06-24T13:44:15
193,707,958
1
0
null
2019-06-25T12:57:23
2019-06-25T12:57:23
null
UTF-8
Java
false
false
2,897
java
/* * Copyright (c) 2018 Couchbase, 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.couchbase.client.java.env; import com.couchbase.client.core.env.ConnectionStringPropertyLoader; import com.couchbase.client.core.env.CoreEnvironment; import com.couchbase.client.core.env.Credentials; import com.couchbase.client.core.env.RoleBasedCredentials; public class ClusterEnvironment extends CoreEnvironment { private ClusterEnvironment(Builder builder) { super(builder); } @Override protected Package agentPackage() { return ClusterEnvironment.class.getPackage(); } @Override protected String defaultAgentTitle() { return "java"; } public static ClusterEnvironment create(final String username, final String password) { return builder(username, password).build(); } public static ClusterEnvironment create(final Credentials credentials) { return builder(credentials).build(); } public static ClusterEnvironment create(final String connectionString, String username, String password) { return builder(connectionString, username, password).build(); } public static ClusterEnvironment create(final String connectionString, Credentials credentials) { return builder(connectionString, credentials).build(); } public static ClusterEnvironment.Builder builder(final String username, final String password) { return builder(new RoleBasedCredentials(username, password)); } public static ClusterEnvironment.Builder builder(final Credentials credentials) { return new ClusterEnvironment.Builder(credentials); } public static ClusterEnvironment.Builder builder(final String connectionString, final String username, final String password) { return builder(connectionString, new RoleBasedCredentials(username, password)); } public static ClusterEnvironment.Builder builder(final String connectionString, final Credentials credentials) { return builder(credentials).load(new ConnectionStringPropertyLoader(connectionString)); } public static class Builder extends CoreEnvironment.Builder<Builder> { Builder(Credentials credentials) { super(credentials); } public Builder load(final ClusterPropertyLoader loader) { loader.load(this); return this; } public ClusterEnvironment build() { return new ClusterEnvironment(this); } } }
[ "michael@nitschinger.at" ]
michael@nitschinger.at
9be0a1123c891fb780ed12f6073016df590c669b
dcb5e84b676cfa08f7eb7b5c8d80039fc6639c29
/src/main/java/de/flapdoodle/embed/process/types/Wrapped.java
9b6896cc3091a9ad9be151b5029fc9d2b81f65a5
[ "Apache-2.0" ]
permissive
flapdoodle-oss/de.flapdoodle.embed.process
5703b88aec0c2bb78ca0291471a9023a3d1c4a1f
5fc4225ea7a3b1f4a6ecc191a6b17937ae989115
refs/heads/main
2023-07-22T11:25:00.509789
2023-07-16T13:03:27
2023-07-16T13:03:27
5,412,556
224
104
Apache-2.0
2023-09-14T19:36:23
2012-08-14T12:37:01
Java
UTF-8
Java
false
false
1,185
java
/** * Copyright (C) 2011 * Michael Mosmann <michael@mosmann.de> * Martin Jöhren <m.joehren@googlemail.com> * * with contributions from * konstantin-ba@github, Archimedes Trajano (trajano@github), Kevin D. Keck (kdkeck@github), Ben McCann (benmccann@github) * * 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 de.flapdoodle.embed.process.types; import org.immutables.value.Value; import org.immutables.value.Value.Style.ImplementationVisibility; @Value.Style( typeAbstract = "_*", typeImmutable = "*", visibility = ImplementationVisibility.PUBLIC, defaults = @Value.Immutable(builder = false, copy = false)) public @interface Wrapped {}
[ "michael@mosmann.de" ]
michael@mosmann.de
87d8640cf608a28dd95e0493c1f877bc66b53f3c
7f298c2bf9ff5a61eeb87e3929e072c9a04c8832
/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/SpringJUnitJupiterConstructorInjectionTests.java
bc24e6a68c8b886022a97b9e1e0903a4a9f1af7c
[ "Apache-2.0" ]
permissive
stwen/my-spring5
1ca1e85786ba1b5fdb90a583444a9c030fe429dd
d44be68874b8152d32403fe87c39ae2a8bebac18
refs/heads/master
2023-02-17T19:51:32.686701
2021-01-15T05:39:14
2021-01-15T05:39:14
322,756,105
0
0
null
null
null
null
UTF-8
Java
false
false
3,271
java
/* * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.test.context.junit.jupiter; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInfo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.ApplicationContext; import org.springframework.test.context.TestPropertySource; import org.springframework.test.context.junit.SpringJUnitJupiterTestSuite; import org.springframework.test.context.junit.jupiter.comics.Dog; import org.springframework.test.context.junit.jupiter.comics.Person; import static org.junit.jupiter.api.Assertions.*; /** * Integration tests which demonstrate support for autowiring individual * parameters in test class constructors using {@link Autowired @Autowired} * and {@link Value @Value} with the Spring TestContext Framework and JUnit Jupiter. * * <p>To run these tests in an IDE that does not have built-in support for the JUnit * Platform, simply run {@link SpringJUnitJupiterTestSuite} as a JUnit 4 test. * * @author Sam Brannen * @see SpringExtension * @see SpringJUnitJupiterAutowiredConstructorInjectionTests * @since 5.0 */ @SpringJUnitConfig(TestConfig.class) @TestPropertySource(properties = "enigma = 42") class SpringJUnitJupiterConstructorInjectionTests { final ApplicationContext applicationContext; final Person dilbert; final Dog dog; final Integer enigma; final TestInfo testInfo; SpringJUnitJupiterConstructorInjectionTests(ApplicationContext applicationContext, @Autowired Person dilbert, @Autowired Dog dog, @Value("${enigma}") Integer enigma, TestInfo testInfo) { this.applicationContext = applicationContext; this.dilbert = dilbert; this.dog = dog; this.enigma = enigma; this.testInfo = testInfo; } @Test void applicationContextInjected() { assertNotNull(applicationContext, "ApplicationContext should have been injected by Spring"); assertEquals(this.dilbert, applicationContext.getBean("dilbert", Person.class)); } @Test void beansInjected() { assertNotNull(this.dilbert, "Dilbert should have been @Autowired by Spring"); assertEquals("Dilbert", this.dilbert.getName(), "Person's name"); assertNotNull(this.dog, "Dogbert should have been @Autowired by Spring"); assertEquals("Dogbert", this.dog.getName(), "Dog's name"); } @Test void propertyPlaceholderInjected() { assertNotNull(this.enigma, "Enigma should have been injected via @Value by Spring"); assertEquals(Integer.valueOf(42), this.enigma, "enigma"); } @Test void testInfoInjected() { assertNotNull(this.testInfo, "TestInfo should have been injected by JUnit"); } }
[ "xianhao_gan@qq.com" ]
xianhao_gan@qq.com
4b6c9c5c32d663dc0fb144d1fc5a0cd548211929
ca217730cff9435b03347587d61d2ef28b478f7e
/old/tileentities/SCPTileEntity076.java
3d6e2494b83df71ffe265edd81b6505751b7cec7
[]
no_license
Ordinastie/SCPCraft
e8c4c78cc86ac0e7f364156058f35ce30adf059d
547a204bb14fc33adefb9926baca2f5188d89421
refs/heads/master
2023-07-18T19:50:59.231189
2014-03-21T23:59:54
2014-03-21T23:59:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,623
java
package SCPCraft.tileentities; import java.util.Iterator; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityList; import net.minecraft.nbt.NBTBase; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.packet.Packet; import net.minecraft.network.packet.Packet132TileEntityData; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class SCPTileEntity076 extends TileEntity { /** The stored delay before a new spawn. */ public int delay = -1; /** * The string ID of the mobs being spawned from this spawner. Defaults to pig, apparently. */ private String mobID = "SCP-076"; /** The extra NBT data to add to spawned entities */ private NBTTagCompound spawnerTags = null; public double yaw; public double yaw2 = 0.0D; @SideOnly(Side.CLIENT) private Entity spawnedMob; public SCPTileEntity076() { } @SideOnly(Side.CLIENT) public String getMobID() { return this.mobID; } public void setMobID(String par1Str) { this.mobID = par1Str; } /** * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count * ticks and creates a new spawn inside its implementation. */ public void updateEntity() { if (this.worldObj.isRemote) { double var1 = (double)((float)this.xCoord + this.worldObj.rand.nextFloat()); double var3 = (double)((float)this.yCoord + this.worldObj.rand.nextFloat()); double var5 = (double)((float)this.zCoord + this.worldObj.rand.nextFloat()); this.worldObj.spawnParticle("smoke", var1, var3, var5, 0.0D, 0.0D, 0.0D); this.worldObj.spawnParticle("flame", var1, var3, var5, 0.0D, 0.0D, 0.0D); this.worldObj.spawnParticle("smoke", var1 + 1, var3, var5, 0.0D, 0.0D, 0.0D); this.worldObj.spawnParticle("flame", var1 + 1, var3, var5, 0.0D, 0.0D, 0.0D); this.worldObj.spawnParticle("smoke", var1, var3, var5 + 1, 0.0D, 0.0D, 0.0D); this.worldObj.spawnParticle("flame", var1, var3, var5 + 1, 0.0D, 0.0D, 0.0D); this.worldObj.spawnParticle("smoke", var1, var3 + 1, var5, 0.0D, 0.0D, 0.0D); this.worldObj.spawnParticle("flame", var1, var3 + 1, var5, 0.0D, 0.0D, 0.0D); this.worldObj.spawnParticle("smoke", var1 + 1, var3 + 1, var5, 0.0D, 0.0D, 0.0D); this.worldObj.spawnParticle("flame", var1 + 1, var3 + 1, var5, 0.0D, 0.0D, 0.0D); this.worldObj.spawnParticle("smoke", var1, var3 + 1, var5 + 1, 0.0D, 0.0D, 0.0D); this.worldObj.spawnParticle("flame", var1, var3 + 1, var5 + 1, 0.0D, 0.0D, 0.0D); this.yaw2 = this.yaw % 360.0D; this.yaw += 4.545454502105713D; } else { if (this.delay == -1) { this.updateDelay(); } //10 ticks = 1 second if(this.delay == 90)worldObj.playSoundEffect((double)((float)this.xCoord + 0.5F), (double)((float)this.yCoord + 0.5F), (double)((float)this.zCoord + 0.5F), "sounds.StoneDoorOpen", 0.5F, 1F); for (int var11 = 0; var11 < 1; ++var11) { Entity var2 = EntityList.createEntityByName(this.mobID, this.worldObj); if (var2 == null) { return; } int var12 = this.worldObj.getEntitiesWithinAABB(var2.getClass(), AxisAlignedBB.getAABBPool().getAABB((double)this.xCoord, (double)this.yCoord, (double)this.zCoord, (double)(this.xCoord + 256), (double)(this.yCoord + 256), (double)(this.zCoord + 256)).expand(256.0D, 40.0D, 256.0D)).size(); if (var12 >= 1) { this.updateDelay(); return; } if (var2 != null) { if (this.delay > 0) { --this.delay; System.out.println(delay); return; } double var4 = (double)this.xCoord + 0.5D; double var6 = (double)this.yCoord + 1D; double var8 = (double)this.zCoord + 0.5D; var2.setLocationAndAngles(var4, var6, var8, this.worldObj.rand.nextFloat() * 360.0F, 0.0F); this.writeNBTTagsTo(var2); this.worldObj.spawnEntityInWorld(var2); } } } super.updateEntity(); } public void writeNBTTagsTo(Entity par1Entity) { if (this.spawnerTags != null) { NBTTagCompound var2 = new NBTTagCompound(); par1Entity.addEntityID(var2); Iterator var3 = this.spawnerTags.getTags().iterator(); while (var3.hasNext()) { NBTBase var4 = (NBTBase)var3.next(); var2.setTag(var4.getName(), var4.copy()); } par1Entity.readFromNBT(var2); } } /** * Sets the delay before a new spawn (base delay of 200 + random number up to 600). */ private void updateDelay() { this.delay = 200 + this.worldObj.rand.nextInt(5000); } /** * Reads a tile entity from NBT. */ public void readFromNBT(NBTTagCompound par1NBTTagCompound) { super.readFromNBT(par1NBTTagCompound); this.mobID = par1NBTTagCompound.getString("EntityId"); this.delay = par1NBTTagCompound.getShort("Delay"); if (par1NBTTagCompound.hasKey("SpawnData")) { this.spawnerTags = par1NBTTagCompound.getCompoundTag("SpawnData"); } else { this.spawnerTags = null; } } /** * Writes a tile entity to NBT. */ public void writeToNBT(NBTTagCompound par1NBTTagCompound) { super.writeToNBT(par1NBTTagCompound); par1NBTTagCompound.setString("EntityId", this.mobID); par1NBTTagCompound.setShort("Delay", (short)this.delay); if (this.spawnerTags != null) { par1NBTTagCompound.setCompoundTag("SpawnData", this.spawnerTags); } } @SideOnly(Side.CLIENT) /** * will create the entity from the internalID the first time it is accessed */ public Entity getMobEntity() { if (this.spawnedMob == null) { Entity var1 = EntityList.createEntityByName(this.getMobID(), (World)null); this.writeNBTTagsTo(var1); this.spawnedMob = var1; } return this.spawnedMob; } /** * Overriden in a sign to provide the text. */ public Packet getDescriptionPacket() { NBTTagCompound var1 = new NBTTagCompound(); this.writeToNBT(var1); return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 1, var1); } }
[ "ntzrmtthihu777@gmail.com" ]
ntzrmtthihu777@gmail.com
522bcc897e328e6925eef32230b8ef8371f97f3e
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/3/3_cec41acb2a06d66ed1e672c3fc4927242843197e/Main/3_cec41acb2a06d66ed1e672c3fc4927242843197e_Main_s.java
be8397c0088d9474f7bedaf9b8c4778ce2e0aba5
[]
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,956
java
/* * This file is part of Spoutcraft Launcher (http://wiki.getspout.org/). * * Spoutcraft Launcher 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. * * Spoutcraft Launcher 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 org.spoutcraft.launcher; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.util.ArrayList; import javax.swing.UIManager; import org.spoutcraft.launcher.gui.LoginForm; import org.spoutcraft.launcher.logs.SystemConsoleListener; import com.beust.jcommander.JCommander; public class Main { static String[] args_temp; public static int build = -1; static File recursion; public Main() throws Exception { main(new String[0]); } public static void reboot(String memory) { try { String pathToJar = Main.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath(); ArrayList<String> params = new ArrayList<String>(); if (PlatformUtils.getPlatform() == PlatformUtils.OS.windows) { params.add("javaw"); // Windows-specific } else { params.add("java"); // Linux/Mac/whatever } params.add(memory); params.add("-classpath"); params.add(pathToJar); params.add("org.spoutcraft.launcher.Main"); for (String arg : args_temp) { params.add(arg); } ProcessBuilder pb = new ProcessBuilder(params); Process process = pb.start(); if(process == null) throw new Exception("!"); System.exit(0); } catch(Exception e) { e.printStackTrace(); } } public static void main(String[] args) throws Exception { Options options = new Options(); try { new JCommander(options, args); } catch (Exception ex) { ex.printStackTrace(); } MinecraftUtils.setOptions(options); recursion = new File(PlatformUtils.getWorkingDirectory(), "rtemp"); args_temp = args; boolean relaunch = false; try { if (!recursion.exists()) { relaunch = true; } else { recursion.delete(); } } catch (Exception e) { //e.printStackTrace(); } if (relaunch) { if (SettingsUtil.getMemorySelection() < 6) { int mem = 1 << (9 + SettingsUtil.getMemorySelection()); recursion.createNewFile(); reboot("-Xmx" + mem + "m"); } } PlatformUtils.getWorkingDirectory().mkdirs(); new File(PlatformUtils.getWorkingDirectory(), "spoutcraft").mkdir(); SystemConsoleListener listener = new SystemConsoleListener(); listener.initialize(); System.out.println("------------------------------------------"); System.out.println("Spoutcraft Launcher is starting...."); System.out.println("Spoutcraft Launcher Build: " + getBuild()); try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { System.out.println("Warning: Can't get system LnF: " + e); } LoginForm login = new LoginForm(); login.setVisible(true); } private static int getBuild() { if (build == -1) { File buildInfo = new File(PlatformUtils.getWorkingDirectory(), "launcherVersion"); if (buildInfo.exists()) { try { BufferedReader bf = new BufferedReader(new FileReader(buildInfo)); String version = bf.readLine(); build = Integer.parseInt(version); } catch (Exception e) { e.printStackTrace(); } } } return build; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
521d2f379fef8318848e986d628f87b9ea0f77a8
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/23/23_7a64e55ffee1f77e5ef710d2e90dfd0e90510e61/DefaultOptimizer/23_7a64e55ffee1f77e5ef710d2e90dfd0e90510e61_DefaultOptimizer_t.java
12edd87d8ff891370f6b3dae95fb02ae750ef173
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
7,755
java
package com.shsrobotics.reinforcementlearning.optimizers; import com.shsrobotics.reinforcementlearning.util.DataPoint; /** * Optimize coordinates based on a Pattern Search algorithm. To use this class, * classes must extend it and provide a {@code double f(double[] input)} method. * Method calls should be made to {@code minimize()} and {@code maximize()} * only. Other members are public only for extension and implementation * purposes. * <p/> * @author Team 2412. */ public abstract class DefaultOptimizer implements Optimizer { /** * The number of variables to optimize. Data dimensions. */ private final int n; /** * How many times to run the algorithm */ private final int iterations; /** * Minimum variable values. Used to choose random starting points. */ private final double[] minimums; /** * Maximum Variable values. Used to choose random starting points. */ private final double[] maximums; /** * Step size for Pattern Search algorithm. Defaults to ten percent of * average variable range. */ private double[] PatternSearchStep; /** * Stores the default search step size. Defaults to a quarter of average * variable range, for a total range of a quarter of the search size. */ private double[] InitialStep; /** * Default step size fraction. */ private double stepSize = 0.25; /** * Create an optimizer. * <p/> * @param dimension the number of variables. * @param iterations how precise to maximize. * @param minimums the minimum domain values. * @param maximums the maximum domain values. */ public DefaultOptimizer(int iterations, double[] minimums, double[] maximums) { this.n = minimums.length; this.iterations = iterations; this.minimums = minimums; this.maximums = maximums; PatternSearchStep = new double[n]; InitialStep = new double[n]; //find step size for (int variable = 0; variable < n; variable++) { InitialStep[variable] = stepSize * (maximums[variable] - minimums[variable]); // twenty-five percent of the range } } @Override public final double[] maximize() { PatternSearchStep = InitialStep.clone(); return psOptimize(true); } @Override public final double[] minimize() { PatternSearchStep = InitialStep.clone(); return psOptimize(false); } /** * Uses a Pattern Search algorithm to find the coordinates that maximize the * function. * <p/> * @param maximize whether or not to maximize or minimize. If set to true, * the method will maximize. * @return the maximized coordinates. */ private double[] psOptimize(boolean maximize) { /* * Pattern vertices. Center is stored in 0, Left(k) is stored in k + 1, * and Right(k) is stored in (k + 1) + n. */ Point[] vertices = new Point[2 * n + 1]; int length = vertices.length; // center point placed randomly double[] center = rands(); for (int vertex = 0; vertex < length; vertex++) { if (vertex == 0) { vertices[vertex] = new Point(center, f(center)); } else { vertices[vertex] = new Point(center, 0.0); // saves computation time, as these are recalculated immediately } } // each variable for (int k = 0; k < n; k++) { int leftPoint = k + 1; int rightPoint = k + 1 + n; vertices[leftPoint].increment(k, -PatternSearchStep[k]); vertices[leftPoint].update(); vertices[rightPoint].increment(k, PatternSearchStep[k]); vertices[rightPoint].update(); } for (int i = 0; i < iterations; i++) { double best = vertices[0].value(); // best value int bestIndex = 0; // index of best value (currently center) for (int vertex = 1; vertex < length; vertex++) { if (better(vertices[vertex].value(), best, maximize)) { best = vertices[vertex].value(); bestIndex = vertex; } } if (bestIndex == 0) { // scale pattern for (int k = 0; k < n; k++) { PatternSearchStep[k] /= 2; // halve search size. int leftPoint = k + 1; int rightPoint = k + 1 + n; vertices[leftPoint].increment(k, PatternSearchStep[k]); // opposite direction vertices[leftPoint].update(); vertices[rightPoint].increment(k, -PatternSearchStep[k]); // opposite direction vertices[rightPoint].update(); } } else { // move pattern int variable = (bestIndex - 1) % n; // the variable to change int direction = (bestIndex - 1 - n >= 0) ? 1 : -1; // which way to move int oppositeVertex; // find which vertex index corresponds to the opposite vertex if (direction == 1) { oppositeVertex = variable + 1; } else { oppositeVertex = variable + 1 + n; } double change = direction * PatternSearchStep[variable]; // difference between best and center for (int vertex = 0; vertex < length; vertex++) { vertices[vertex].increment(variable, change); // save re-evaluation of function if (vertex == 0) { vertices[vertex].setValue(vertices[bestIndex].value()); } else if (vertex == oppositeVertex) { vertices[vertex].setValue(vertices[0].value()); } else { vertices[vertex].update(); // for new values } } } } return vertices[0].coordinates(); } /** * A data point. Used for optimization. */ public class Point extends DataPoint { /** * Create a point. * <p/> * @param coordinates the action coordinates. * @param value the Q-Value from the coordinates. */ public Point(double[] coordinates, double value) { super(coordinates, value); } /** * The data coordinates. */ public double[] coordinates() { return super.getInputs(); } /** * The data dependent variable (output). */ public double value() { return super.getOutputs()[0]; } /** * Update the {@code value} variable. */ public void update() { super.setOutput(0, f(super.getInputs())); } /** * Set the {@code value} variable. If the value is known, save the time * updating it. */ public void setValue(double value) { super.setOutput(0, value); } /** * Increment a coordinate by a specified amount. A call to * {@code update} is recommended afterwards. * <p/> * @param k the coordinate variable to change. * @param amount the amount to increment by. */ public void increment(int k, double amount) { double[] newCoordinates = super.getInputs().clone(); double newCoordinate = newCoordinates[k] + amount; if (newCoordinate > minimums[k] && newCoordinate < maximums[k]) { //in bounds setInput(k, newCoordinate); } } } /** * Find which double is better. Whether or not a variable is better is * determined by the maximize parameter. * <p/> * @param a the first value to test. * @param b the second value to test. * @param maximize whether or not to test if {@code a > b}. If false, tests * for * {@code a < b}. * @return True if {@code a} is better than {@code b}. */ private boolean better(double a, double b, boolean maximize) { if (maximize) { return a > b; } else { return a < b; } } /** * Fill an array with random values. * <p/> * @return The array. */ double[] rands() { double[] toReturn = new double[n]; double rangeScale = 2 * stepSize; for (int i = 0; i < n; i++) { double range = (maximums[i] - minimums[i]) * rangeScale; toReturn[i] = Math.random() * range + minimums[i] + range / 2; // generate random number in range } return toReturn; } @Override public abstract double f(double[] input); }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
5dad65955029530ac01eb736cb340fa00aae7422
a1b0d7437af7c1543e313231162b92660217872a
/KKY/xlgLib/src/main/java/com/xlg/library/helper/ResourceIdHelper.java
fe2da6a23397af10cddf5bd0712ff7cb2d6056c7
[]
no_license
KaiKeYi/KKY-Android
3c05f99b36fdfacd0464bfc58dd50036ea5229da
bec87ef2fd3ae1647874fc23822fdf1d7a295dd9
refs/heads/master
2020-03-10T20:42:42.566789
2018-06-15T08:41:00
2018-06-15T08:41:00
129,575,856
0
0
null
null
null
null
UTF-8
Java
false
false
2,585
java
package com.xlg.library.helper; import android.content.Context; /** * @Author: Jason * @Time: 2018/4/20 15:09 * @Description: 根据资源的名字获取其ID值 */ public class ResourceIdHelper { public static int getIdByName(Context context, String className, String name) { String packageName = context.getPackageName(); Class r = null; int id = 0; try { r = Class.forName(packageName + ".R"); Class[] classes = r.getClasses(); Class desireClass = null; for (int i = 0; i < classes.length; ++i) { if (classes[i].getName().split("\\$")[1].equals(className)) { desireClass = classes[i]; break; } } if (desireClass != null) { id = desireClass.getField(name).getInt(desireClass); } } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (SecurityException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (NoSuchFieldException e) { e.printStackTrace(); } return id; } public static int[] getIdsByName(Context context, String className, String name) { String packageName = context.getPackageName(); Class r = null; int[] ids = null; try { r = Class.forName(packageName + ".R"); Class[] classes = r.getClasses(); Class desireClass = null; for (int i = 0; i < classes.length; ++i) { if (classes[i].getName().split("\\$")[1].equals(className)) { desireClass = classes[i]; break; } } if ((desireClass != null) && (desireClass.getField(name).get(desireClass)) != null && (desireClass.getField(name).get(desireClass).getClass().isArray())) { ids = (int[]) desireClass.getField(name).get(desireClass); } } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (SecurityException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (NoSuchFieldException e) { e.printStackTrace(); } return ids; } }
[ "1655661337@qq.com" ]
1655661337@qq.com
3120b40ccb996f9eb47e373a54e639fb33c6d433
98ccbb4f41669dbdfcae08c3709a404131f54f05
/암기해둘것/src/누적합/수들의합4.java
200ff1e95cb8fcebf7d4e8c68ffc9f9edf27ee97
[ "MIT" ]
permissive
KimJaeHyun94/CodingTest
fee6f14b3320c85670bdab7e9dbe97f429a31d9c
f153879ac0ac1cf45de487afd9a4a94c9ffbe10d
refs/heads/main
2023-04-22T15:27:46.325475
2021-05-16T15:02:27
2021-05-16T15:02:27
330,885,734
0
0
null
null
null
null
UTF-8
Java
false
false
1,088
java
package 누적합; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.HashMap; import java.util.StringTokenizer; public class 수들의합4 { static int N, K; static int arr[], sum[]; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); N = Integer.parseInt(st.nextToken()); K = Integer.parseInt(st.nextToken()); arr = new int[N + 1]; sum = new int[N + 1]; st = new StringTokenizer(br.readLine()); for (int i = 1; i <= N; i++) { arr[i] = Integer.parseInt(st.nextToken()); sum[i] = sum[i - 1] + arr[i]; //구간 합 구성 } HashMap<Integer, Integer> map = new HashMap<>(); map.put(0, 1); long ans = 0; for (int i = 1; i <= N; i++) { ans += map.getOrDefault(sum[i] - K, 0); //잇으면 갯수를 더해준다. map.put(sum[i], map.getOrDefault(sum[i], 0) + 1); } System.out.println(ans); } }
[ "ru6300@naver.com" ]
ru6300@naver.com
240c858bb5486f2c7d64777cc9b7a183d3e9b5a4
a2df6764e9f4350e0d9184efadb6c92c40d40212
/aliyun-java-sdk-aliyuncvc/src/main/java/com/aliyuncs/aliyuncvc/model/v20200330/CreateUserResponse.java
4f073d557b6162a9e4e4b3fdf4ec0b7e56bc0bdb
[ "Apache-2.0" ]
permissive
warriorsZXX/aliyun-openapi-java-sdk
567840c4bdd438d43be6bd21edde86585cd6274a
f8fd2b81a5f2cd46b1e31974ff6a7afed111a245
refs/heads/master
2022-12-06T15:45:20.418475
2020-08-20T08:37:31
2020-08-26T06:17:49
290,450,773
1
0
NOASSERTION
2020-08-26T09:15:48
2020-08-26T09:15:47
null
UTF-8
Java
false
false
1,963
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.aliyuncvc.model.v20200330; import com.aliyuncs.AcsResponse; import com.aliyuncs.aliyuncvc.transform.v20200330.CreateUserResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class CreateUserResponse extends AcsResponse { private Integer errorCode; private String message; private Boolean success; private String requestId; private String userId; public Integer getErrorCode() { return this.errorCode; } public void setErrorCode(Integer errorCode) { this.errorCode = errorCode; } public String getMessage() { return this.message; } public void setMessage(String message) { this.message = message; } public Boolean getSuccess() { return this.success; } public void setSuccess(Boolean success) { this.success = success; } public String getRequestId() { return this.requestId; } public void setRequestId(String requestId) { this.requestId = requestId; } public String getUserId() { return this.userId; } public void setUserId(String userId) { this.userId = userId; } @Override public CreateUserResponse getInstance(UnmarshallerContext context) { return CreateUserResponseUnmarshaller.unmarshall(this, context); } @Override public boolean checkShowJsonItemName() { return false; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
ed94529dec99565d100e4e6d75e18a906394516b
8b04eb64502f63653b2f435e268019d42fd171e1
/core/src/test/java/io/grpc/internal/AbstractReadableBufferTest.java
46a66586d2d1a3cd66e88a49eaff3ad0764b68cd
[ "Apache-2.0" ]
permissive
grpc-nebula/grpc-nebula-java
de553e5d9d77dc28bb0ec78076d7dc5bd8caa41b
04f20585354e1994e70404535b048c9c188d5d95
refs/heads/master
2023-07-19T08:54:45.297237
2022-02-09T13:48:39
2022-02-09T13:48:39
188,228,592
140
63
Apache-2.0
2023-07-05T20:43:37
2019-05-23T12:20:14
Java
UTF-8
Java
false
false
1,720
java
/* * Copyright 2014 The gRPC Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.grpc.internal; import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.when; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.mockito.stubbing.OngoingStubbing; /** * Tests for {@link AbstractReadableBuffer}. */ @RunWith(JUnit4.class) public class AbstractReadableBufferTest { @Mock private AbstractReadableBuffer buffer; @Before public void setup() { MockitoAnnotations.initMocks(this); } @Test public void readPositiveIntShouldSucceed() { mockBytes(0x7F, 0xEE, 0xDD, 0xCC); assertEquals(0x7FEEDDCC, buffer.readInt()); } @Test public void readNegativeIntShouldSucceed() { mockBytes(0xFF, 0xEE, 0xDD, 0xCC); assertEquals(0xFFEEDDCC, buffer.readInt()); } private void mockBytes(int... bytes) { when(buffer.readableBytes()).thenReturn(bytes.length); OngoingStubbing<Integer> stub = when(buffer.readUnsignedByte()); for (int b : bytes) { stub = stub.thenReturn(b); } } }
[ "cozyshu@qq.com" ]
cozyshu@qq.com
5372dc8d65d47841bb7ab879f07f6bf4dfb4a7a8
fa93c9be2923e697fb8a2066f8fb65c7718cdec7
/sources/com/facebook/internal/FacebookInitProvider.java
b179874f57f0ad041d269ae7208ab2a817e917cd
[]
no_license
Auch-Auch/avito_source
b6c9f4b0e5c977b36d5fbc88c52f23ff908b7f8b
76fdcc5b7e036c57ecc193e790b0582481768cdc
refs/heads/master
2023-05-06T01:32:43.014668
2021-05-25T10:19:22
2021-05-25T10:19:22
370,650,685
0
0
null
null
null
null
UTF-8
Java
false
false
1,326
java
package com.facebook.internal; import android.content.ContentProvider; import android.content.ContentValues; import android.database.Cursor; import android.net.Uri; import com.facebook.FacebookSdk; public final class FacebookInitProvider extends ContentProvider { public static final String a = FacebookInitProvider.class.getSimpleName(); @Override // android.content.ContentProvider public int delete(Uri uri, String str, String[] strArr) { return 0; } @Override // android.content.ContentProvider public String getType(Uri uri) { return null; } @Override // android.content.ContentProvider public Uri insert(Uri uri, ContentValues contentValues) { return null; } @Override // android.content.ContentProvider public boolean onCreate() { try { FacebookSdk.sdkInitialize(getContext()); return false; } catch (Exception unused) { return false; } } @Override // android.content.ContentProvider public Cursor query(Uri uri, String[] strArr, String str, String[] strArr2, String str2) { return null; } @Override // android.content.ContentProvider public int update(Uri uri, ContentValues contentValues, String str, String[] strArr) { return 0; } }
[ "auchhunter@gmail.com" ]
auchhunter@gmail.com
08859195db8f3443af9147d9d5a3ad14af195bea
13f937f75987ad2185c51ca4b1cd013d3e647e1e
/DMI/Claim Processing Automation/cpa_v2.0/main/src/com/aghit/task/util/DbcpUtil.java
76f62117437b448f1c445ba4a407812d806c0b84
[]
no_license
hwlsniper/DMI
30644374b35b2ed8bb297634311a71d0f1b0eb91
b6ac5f1eac635485bb4db14437aa3444e582be84
refs/heads/master
2020-03-19T16:44:33.828781
2018-05-22T05:38:52
2018-05-22T05:38:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,591
java
package com.aghit.task.util; import java.io.IOException; import java.sql.Connection; import java.sql.SQLException; import java.util.Properties; import javax.sql.DataSource; import org.apache.commons.dbcp.BasicDataSource; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; public class DbcpUtil { private static DbcpUtil du = new DbcpUtil(); private DataSource DS; private Log log = LogFactory.getLog(DbcpUtil.class); public DbcpUtil() { try { this.init(); } catch (IOException e) { log.error("初始化数据源失败," + e.getMessage()); } } public static DbcpUtil getInstance() { return du; } private void init() throws IOException { Properties p = new Properties(); p.load(DbcpUtil.class.getResourceAsStream("/jdbc.properties")); BasicDataSource ds = new BasicDataSource(); ds.setDriverClassName(p.getProperty("jdbc.driverClassName")); ds.setUsername(p.getProperty("jdbc.username")); ds.setPassword(p.getProperty("jdbc.password")); ds.setUrl(p.getProperty("jdbc.url")); DS = ds; } public DataSource getDataSource() { return DS; } /** * 从数据源获得一个连接 * * @throws SQLException */ public Connection getConn() throws SQLException { try { return DS.getConnection(); } catch (SQLException e) { throw new SQLException("获取数据库连接出错," + e.getMessage()); } } public void shutdownDataSource() throws SQLException { BasicDataSource bds = (BasicDataSource) DS; bds.close(); } }
[ "33211781+thekeygithub@users.noreply.github.com" ]
33211781+thekeygithub@users.noreply.github.com
47c309643d857adec3bb5f475d18de6f1ee28f11
0bf9879f7e43dc6f69dd7003a833ffe66224abb5
/src/test/java/gov/usgs/wma/waterdata/TSDataTypeFactory.java
ae996e35f7d2b52559b9efedae0fb1e4755a8ef0
[ "LicenseRef-scancode-warranty-disclaimer", "CC0-1.0", "LicenseRef-scancode-public-domain" ]
permissive
usgs/aqts-ts-type-router
d6df88a0fe8cb869bbb9a0fee220d65281850de9
586798449ebd1ab5301724ff4f1208c0ba221995
refs/heads/master
2021-08-19T00:54:23.655841
2021-01-15T15:52:35
2021-01-15T15:52:35
237,274,319
3
6
NOASSERTION
2021-07-28T10:45:19
2020-01-30T18:09:12
Java
UTF-8
Java
false
false
856
java
package gov.usgs.wma.waterdata; import java.sql.Types; import org.dbunit.dataset.datatype.DataType; import org.dbunit.dataset.datatype.DataTypeException; import org.dbunit.ext.postgresql.PostgresqlDataTypeFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class TSDataTypeFactory extends PostgresqlDataTypeFactory { private static final Logger logger = LoggerFactory.getLogger(TSDataTypeFactory.class); public DataType createDataType(int sqlType, String sqlTypeName) throws DataTypeException { logger.debug("createDataType(sqlType={}, sqlTypeName={})", String.valueOf(sqlType), sqlTypeName); if (sqlType == Types.OTHER && ("json".equals(sqlTypeName) || "jsonb".equals(sqlTypeName))) { return new JsonType(); // support PostgreSQL json/jsonb } else { return super.createDataType(sqlType, sqlTypeName); } } }
[ "drsteini@contractor.usgs.gov" ]
drsteini@contractor.usgs.gov
c33d891ec3953b144525911e8bc3fcb295e7e2d8
c03a28264a1da6aa935a87c6c4f84d4d28afe272
/Leetcode/src/medium/Q221_Maximal_Square.java
d0bb85eaaf3252b6f940dff33304d9cab8941f4a
[]
no_license
bbfeechen/Algorithm
d59731686f06d6f4d4c13d66a8963f190a84f361
87a158a608d842e53e13bccc73526aadd5d129b0
refs/heads/master
2021-04-30T22:35:03.499341
2019-05-03T07:26:15
2019-05-03T07:26:15
7,991,128
1
1
null
null
null
null
UTF-8
Java
false
false
1,318
java
package medium; public class Q221_Maximal_Square { public static int maximalSquare(char[][] matrix) { if(matrix == null || matrix.length == 0 || matrix[0].length == 0) { return 0; } int m = matrix.length; int n = matrix[0].length; int[][] dp = new int[m][n]; for(int i = 0; i < m; i++) { dp[i][0] = Integer.valueOf(matrix[i][0] + ""); } for(int j = 0; j < n; j++) { dp[0][j] = Integer.valueOf(matrix[0][j] + ""); } for(int i = 1; i < m; i++) { for(int j = 1; j < n; j++) { if(matrix[i][j] == '1') { dp[i][j] = Math.min(Math.min(dp[i - 1][j], dp[i][j - 1]), dp[i - 1][j - 1]) + 1; } else { dp[i][j] = 0; } } } int max = Integer.MIN_VALUE; for(int i = 0; i < m; i++) { for(int j = 0; j < n; j++) { max = Math.max(max, dp[i][j]); } } return max * max; } public static void main(String[] args) { char[][] matrix = {{'1', '0', '1', '0', '0'}, {'1', '0', '1', '1', '1'}, {'1', '1', '1', '1', '1'}, {'1', '0', '0', '1', '0'}}; System.out.println(maximalSquare(matrix)); } }
[ "bbfeechen@gmail.com" ]
bbfeechen@gmail.com
c32681cefa8763f37b85954fa43b69fea72e8bd7
6000edbe01f35679b1cf510575d547a6bb5e430c
/core/src/test/java/org/apache/logging/log4j/core/lookup/ContextMapLookupTest.java
4c5672a90f8cd2c5bac62bad7c2e11b6e816f220
[ "Apache-2.0" ]
permissive
JavaQualitasCorpus/log4j-2.0-beta
7cdd1a06e6b786bca3180c1fe1d077d0044b2b40
1aec5ba88965528ce8c3649b5d6f0136dc942c74
refs/heads/master
2023-08-12T09:29:17.392341
2020-06-02T18:02:37
2020-06-02T18:02:37
167,004,977
0
0
Apache-2.0
2022-12-16T01:21:49
2019-01-22T14:08:39
Java
UTF-8
Java
false
false
1,469
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache license, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the license for the specific language governing permissions and * limitations under the license. */ package org.apache.logging.log4j.core.lookup; import org.apache.logging.log4j.ThreadContext; import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; /** * */ public class ContextMapLookupTest { private static final String TESTKEY = "TestKey"; private static final String TESTVAL = "TestValue"; @Test public void testLookup() { ThreadContext.put(TESTKEY, TESTVAL); final StrLookup lookup = new ContextMapLookup(); String value = lookup.lookup(TESTKEY); assertEquals(TESTVAL, value); value = lookup.lookup("BadKey"); assertNull(value); } }
[ "taibi@sonar-scheduler.rd.tut.fi" ]
taibi@sonar-scheduler.rd.tut.fi
93d92441a2afe8d9adbf74c96ed81b60a46b68db
d2f1bfd51911e9dfd68bbf502eff7db2acb4061b
/cxf-2.6.2/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/ClientAccessToken.java
c3adf604d141d51348e3a84fe8790a100e79e2ed
[]
no_license
neuwerk/jaxws-cxf
fbf06c46ea0682549ff9b684806d56fe36a4e7ed
8dc9437e20b6ac728db38b444d61e3ab6a963556
refs/heads/master
2020-06-03T05:28:19.024915
2019-06-20T15:28:46
2019-06-20T15:28:46
191,460,489
0
0
null
2019-06-11T22:44:47
2019-06-11T22:44:47
null
UTF-8
Java
false
false
1,813
java
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.cxf.rs.security.oauth2.common; /** * Represents the extended client view of {@link AccessToken}. * It may contain the actual scope value assigned to the access token, * the refresh token key, and other properties such as when this token * will expire, etc. */ public class ClientAccessToken extends AccessToken { private String scope; public ClientAccessToken(String tokenType, String tokenKey) { super(tokenType, tokenKey); } /** * Sets the actual scope assigned to the access token. * For example, it can be down-scoped in which case the client * may need to adjust the way it works with the end user. * @param approvedScope the actual scope */ public void setApprovedScope(String approvedScope) { this.scope = approvedScope; } /** * Gets the actual scope assigned to the access token. * @return the scope */ public String getApprovedScope() { return scope; } }
[ "tjjohnso@us.ibm.com" ]
tjjohnso@us.ibm.com
d744aab4a7ec637485ef41edb853ece0dfa31a37
baffff1bc6454352780e1262aac507f668853bfb
/src/main/java/com/boubei/tss/dm/DataExport.java
3f556e0e875a14b1b05f240e31fbe6922bf11db1
[ "MIT" ]
permissive
bierguogai/boubei-tss
926c76c9aabef22db3d659488c6adb2d0710b219
9af9b9437f70d86f27026beb1a88215ecef4a893
refs/heads/master
2021-04-09T10:38:15.249177
2018-03-16T06:05:53
2018-03-16T06:06:12
125,503,070
2
0
null
2018-03-16T10:45:16
2018-03-16T10:45:15
null
UTF-8
Java
false
false
8,090
java
/* ================================================================== * Created [2016-3-5] by Jon.King * ================================================================== * TSS * ================================================================== * mailTo:boubei@163.com * Copyright (c) boubei.com, 2015-2018 * ================================================================== */ package com.boubei.tss.dm; import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; import com.boubei.tss.dm.ext.query.AbstractExportSO; import com.boubei.tss.dm.ext.query.AbstractVO; import com.boubei.tss.framework.exception.BusinessException; import com.boubei.tss.util.EasyUtils; import com.boubei.tss.util.FileHelper; public class DataExport { public static final String CSV_CHAR_SET = "GBK"; static Logger log = Logger.getLogger(DataExport.class); public static String getExportPath() { return DMUtil.getExportPath().replace("\n", "") + "/export"; } /** * 将已经读取到缓存中的VOList分页展示给前台 */ public static Map<String, Object> getDataByPage(List<? extends AbstractVO> voList, int page, int rows ) { Map<String, Object> rlt = new HashMap<String, Object>(); rlt.put("total", voList.size()); page = Math.max(1, page); rows = Math.max(1, rows); int fromLine = (page - 1) * rows; int toLine = page * rows; if (fromLine <= voList.size()) { toLine = Math.min(voList.size(), toLine); rlt.put("rows", voList.subList(fromLine, toLine)); } if(voList.size() > 0) { rlt.put("headerNames", voList.get(0).displayHeaderNames()); } return rlt; } public static String exportCSV(List<Object[]> data, List<String> cnFields) { String basePath = getExportPath(); String exportFileName = System.currentTimeMillis() + ".csv"; String exportPath = basePath + "/" + exportFileName; DataExport._exportCSV(exportPath, convertList2Array(data), cnFields ); return exportFileName; } public static String exportCSV(List<? extends AbstractVO> voList, AbstractExportSO so) { String basePath = getExportPath(); String exportFileName = so.getExportFileName(); String exportPath = basePath + "/" + exportFileName; List<String> cnFields = null; if(voList != null && voList.size() > 0) { cnFields = voList.get(0).displayHeaderNames(); } Object[][] data = convertList2Array(AbstractVO.voList2Objects(voList)); _exportCSV(exportPath, data, cnFields ); return exportFileName; } /** 把 List<Object[]> 转换成 Object[][] 的 */ public static Object[][] convertList2Array(List<Object[]> list) { if (list == null || list.isEmpty()) { return new Object[0][0]; } int rowSize = list.size(); int columnSize = list.get(0).length; Object[][] rlt = new Object[rowSize][columnSize]; for (int i = 0; i < rowSize; i++) { Object[] tmpArrays = list.get(i); for (int j = 0; j < columnSize; j++) { rlt[i][j] = tmpArrays[j]; } } return rlt; } public static String exportCSVII(String fileName, Object[][] data, List<String> cnFields) { String basePath = getExportPath(); String exportPath = basePath + "/" + fileName; _exportCSV(exportPath, data, cnFields ); return fileName; } private static void _exportCSV(String path, Object[][] data, List<String> fields) { List<Object[]> list = new ArrayList<Object[]>(); for(Object[] temp : data) { list.add(temp); } DataExport.exportCSV(path, list, fields); } public static String exportCSV(String fileName, List<Map<String, Object>> data, List<String> fields) { List<Object[]> list = new ArrayList<Object[]>(); for (Map<String, Object> row : data) { list.add( row.values().toArray() ); } String exportPath = DataExport.getExportPath() + "/" + fileName; exportCSV(exportPath, list, fields); return exportPath; } public static void exportCSV(String path, Collection<Object[]> data, List<String> fields) { exportCSV(path, data, fields, CSV_CHAR_SET); } public static void exportCSV(String path, Collection<Object[]> data, List<String> fields, String charSet) { try { File file = FileHelper.createFile(path); boolean append = fields == null; OutputStreamWriter write = new OutputStreamWriter(new FileOutputStream(file, append), charSet ); BufferedWriter fw = new BufferedWriter(write); if( !append ) { fw.write(EasyUtils.list2Str(fields)); // 表头 fw.write("\r\n"); } int index = 0; for (Object[] row : data) { List<Object> values = new ArrayList<Object>(); for(Object value : row) { String valueS = DMUtil.preCheatVal(value); values.add(valueS); } fw.write(EasyUtils.list2Str(values)); fw.write("\r\n"); if (index++ % 10000 == 0) { fw.flush(); // 每一万行输出一次 } } fw.flush(); fw.close(); } catch (IOException e) { throw new BusinessException("export csv error:" + path + ", " + e.getMessage()); } } // 共Web页面上的表格数据直接导出成csv调用 public static void exportCSV(String path, String data) { try { File file = FileHelper.createFile(path); OutputStreamWriter write = new OutputStreamWriter(new FileOutputStream(file), CSV_CHAR_SET ); BufferedWriter fw = new BufferedWriter(write); fw.write(data); fw.flush(); fw.close(); } catch (IOException e) { throw new BusinessException("export data error:" + path, e); } } /** * 使用http请求下载附件。 * @param sourceFilePath 导出文件路径 * @param exportName 导出名字 */ public static void downloadFileByHttp(HttpServletResponse response, String sourceFilePath) { File sourceFile = new File(sourceFilePath); if( !sourceFile.exists() ) { log.error("download file[" + sourceFilePath + "] not found."); return; } response.reset(); response.setCharacterEncoding("utf-8"); response.setContentType("application/octet-stream"); // 设置附件类型 response.setContentLength((int) sourceFile.length()); response.setHeader("Content-Disposition", "attachment; filename=\"" + EasyUtils.toUtf8String(sourceFile.getName()) + "\""); InputStream inStream = null; OutputStream outStream = null; try { outStream = response.getOutputStream(); inStream = new FileInputStream(sourceFilePath); int len = 0; byte[] b = new byte[1024]; while ((len = inStream.read(b)) != -1) { outStream.write(b, 0, len); outStream.flush(); } } catch (IOException e) { // throw new BusinessException("导出时发生IO异常!", e); } finally { sourceFile.delete(); // 删除导出目录下面的临时文件 FileHelper.closeSteam(inStream, outStream); } } }
[ "jinpujun@gmail.com" ]
jinpujun@gmail.com
cc77f06b064ec57b3ab8dcc939849e895552f101
5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1
/Code Snippet Repository/Spring/Spring5689.java
62fb133edb640eb92fb903ae3178263dea225b20
[]
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
304
java
private boolean getBooleanValue(ExpressionState state, SpelNodeImpl operand) { try { Boolean value = operand.getValue(state, Boolean.class); assertValueNotNull(value); return value; } catch (SpelEvaluationException ee) { ee.setPosition(operand.getStartPosition()); throw ee; } }
[ "Qing.Mi@my.cityu.edu.hk" ]
Qing.Mi@my.cityu.edu.hk
2f8941e5f22d4ec35609770e80a36a85cf7359bb
834d1c20b9a8e4f5f2763d841eb3f563c3887932
/src/main/java/kfs/kfsDbiStd/kfsOneStringTable.java
88624cf5cf0c0051d7b093da30458d485242b00e
[ "Apache-2.0" ]
permissive
k0fis/kfsWfl
7adec6fcb1027bc0b14e8face25e29012118e145
95e58f7a0df6843071415096e79434a70ff3b777
refs/heads/master
2021-01-22T06:58:14.752816
2014-11-14T08:33:15
2014-11-14T08:33:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,373
java
package kfs.kfsDbiStd; import kfs.kfsDbi.*; /** * * @author pavedrim */ public class kfsOneStringTable extends kfsDbObject { private final kfsString data; public kfsOneStringTable(kfsDbServerType st, String tableName, String colName, int maxLen) { super(st, tableName); int pos = 0; data = new kfsString(colName, colName, maxLen, pos++); super.setColumns(data); } @Override public String getCreateTable(String schema) { if (getName() == null) { return null; } else { return super.getCreateTable(schema); } } @Override public pjOneString getPojo(kfsRowData rd) { return new pjOneString(rd); } public class pjOneString extends kfsPojoObj<kfsOneStringTable> { public pjOneString(kfsRowData row) { super(kfsOneStringTable.this, row); } public String getData() { return inx.data.getData(rd); } public void setData(String newVal) { inx.data.setData(newVal, rd); } @Override public String toString() { return getData(); } } public class pjOneStringList extends kfsPojoArrayList<kfsOneStringTable, pjOneString> { public pjOneStringList() { super(kfsOneStringTable.this); } } }
[ "k0fis@me.com" ]
k0fis@me.com
bed7bf97327ede7da3d831b68ddf9038a67d6344
fa1408365e2e3f372aa61e7d1e5ea5afcd652199
/src/testcases/CWE191_Integer_Underflow/s02/CWE191_Integer_Underflow__int_getQueryString_Servlet_sub_17.java
9ec0f3a301dc630dfa7e260674dc14e4c065a35e
[]
no_license
bqcuong/Juliet-Test-Case
31e9c89c27bf54a07b7ba547eddd029287b2e191
e770f1c3969be76fdba5d7760e036f9ba060957d
refs/heads/master
2020-07-17T14:51:49.610703
2019-09-03T16:22:58
2019-09-03T16:22:58
206,039,578
1
2
null
null
null
null
UTF-8
Java
false
false
5,536
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE191_Integer_Underflow__int_getQueryString_Servlet_sub_17.java Label Definition File: CWE191_Integer_Underflow__int.label.xml Template File: sources-sinks-17.tmpl.java */ /* * @description * CWE: 191 Integer Underflow * BadSource: getQueryString_Servlet Parse id param out of the URL query string (without using getParameter()) * GoodSource: A hardcoded non-zero, non-min, non-max, even number * Sinks: sub * GoodSink: Ensure there will not be an underflow before subtracting 1 from data * BadSink : Subtract 1 from data, which can cause an Underflow * Flow Variant: 17 Control flow: for loops * * */ package testcases.CWE191_Integer_Underflow.s02; import testcasesupport.*; import javax.servlet.http.*; import java.util.StringTokenizer; import java.util.logging.Level; public class CWE191_Integer_Underflow__int_getQueryString_Servlet_sub_17 extends AbstractTestCaseServlet { public void bad(HttpServletRequest request, HttpServletResponse response) throws Throwable { int data; /* We need to have one source outside of a for loop in order * to prevent the Java compiler from generating an error because * data is uninitialized */ data = Integer.MIN_VALUE; /* initialize data in case id is not in query string */ /* POTENTIAL FLAW: Parse id param out of the URL querystring (without using getParam) */ { StringTokenizer tokenizer = new StringTokenizer(request.getQueryString(), "&"); while (tokenizer.hasMoreTokens()) { String token = tokenizer.nextToken(); /* a token will be like "id=33" */ if(token.startsWith("id=")) /* check if we have the "id" parameter" */ { try { data = Integer.parseInt(token.substring(3)); /* set data to the int 33 */ } catch(NumberFormatException exceptNumberFormat) { IO.logger.log(Level.WARNING, "Number format exception reading id from query string", exceptNumberFormat); } break; /* exit while loop */ } } } for (int j = 0; j < 1; j++) { /* POTENTIAL FLAW: if data == Integer.MIN_VALUE, this will overflow */ int result = (int)(data - 1); IO.writeLine("result: " + result); } } /* goodG2B() - use goodsource and badsink */ private void goodG2B(HttpServletRequest request, HttpServletResponse response) throws Throwable { int data; /* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */ data = 2; for (int j = 0; j < 1; j++) { /* POTENTIAL FLAW: if data == Integer.MIN_VALUE, this will overflow */ int result = (int)(data - 1); IO.writeLine("result: " + result); } } /* goodB2G() - use badsource and goodsink*/ private void goodB2G(HttpServletRequest request, HttpServletResponse response) throws Throwable { int data; data = Integer.MIN_VALUE; /* initialize data in case id is not in query string */ /* POTENTIAL FLAW: Parse id param out of the URL querystring (without using getParam) */ { StringTokenizer tokenizer = new StringTokenizer(request.getQueryString(), "&"); while (tokenizer.hasMoreTokens()) { String token = tokenizer.nextToken(); /* a token will be like "id=33" */ if(token.startsWith("id=")) /* check if we have the "id" parameter" */ { try { data = Integer.parseInt(token.substring(3)); /* set data to the int 33 */ } catch(NumberFormatException exceptNumberFormat) { IO.logger.log(Level.WARNING, "Number format exception reading id from query string", exceptNumberFormat); } break; /* exit while loop */ } } } for (int k = 0; k < 1; k++) { /* FIX: Add a check to prevent an overflow from occurring */ if (data > Integer.MIN_VALUE) { int result = (int)(data - 1); IO.writeLine("result: " + result); } else { IO.writeLine("data value is too small to perform subtraction."); } } } public void good(HttpServletRequest request, HttpServletResponse response) throws Throwable { goodG2B(request, response); goodB2G(request, response); } /* Below is the main(). It is only used when building this testcase on * its own for testing or for building a binary to use in testing binary * analysis tools. It is not used when compiling all the testcases as one * application, which is how source code analysis tools are tested. */ public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException { mainFromParent(args); } }
[ "bqcuong2212@gmail.com" ]
bqcuong2212@gmail.com
8ecbae8ca07b0735fdfca1f165497f20dd62ae72
12a99ab3fe76e5c7c05609c0e76d1855bd051bbb
/src/main/java/com/alipay/api/domain/NetFlowOfferInfo.java
f4c699883dc1ec7d18c3e891adf51f83c4e1ca53
[ "Apache-2.0" ]
permissive
WindLee05-17/alipay-sdk-java-all
ce2415cfab2416d2e0ae67c625b6a000231a8cfc
19ccb203268316b346ead9c36ff8aa5f1eac6c77
refs/heads/master
2022-11-30T18:42:42.077288
2020-08-17T05:57:47
2020-08-17T05:57:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,340
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-06-11 14:54:09 */ public class NetFlowOfferInfo extends AlipayObject { private static final long serialVersionUID = 3757586534682846985L; /** * 流量生效时间 */ @ApiField("effective_time") private String effectiveTime; /** * 流量过期时间 */ @ApiField("expire_time") private String expireTime; /** * 流量套餐名称 */ @ApiField("offer_name") private String offerName; /** * 下单时间 */ @ApiField("order_time") private String orderTime; public String getEffectiveTime() { return this.effectiveTime; } public void setEffectiveTime(String effectiveTime) { this.effectiveTime = effectiveTime; } public String getExpireTime() { return this.expireTime; } public void setExpireTime(String expireTime) { this.expireTime = expireTime; } public String getOfferName() { return this.offerName; } public void setOfferName(String offerName) { this.offerName = offerName; } public String getOrderTime() { return this.orderTime; } public void setOrderTime(String orderTime) { this.orderTime = orderTime; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
a2a4ffbfcfe7fddb22e08f5a747551dd6ec4fa52
427b69465523bd39b1fb14b30aa5b13d86addfa7
/sp5-web/ex02/src/test/java/org/zerock/mapper/ReplyMapperTests.java
aec6c23b951810be20e97635bbe14334f7cb2b7f
[]
no_license
hansol4412/project
fb0fa7b816720fcf0bb518b91c7b2f172b3672a6
a7ec872f30844944c83bc801f7b84df200dbaa43
refs/heads/master
2023-03-16T18:55:39.423865
2021-03-06T11:42:52
2021-03-06T11:42:52
313,502,040
0
0
null
null
null
null
WINDOWS-1253
Java
false
false
1,670
java
package org.zerock.mapper; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.zerock.domain.Criteria; import org.zerock.domain.ReplyVO; import lombok.Setter; import lombok.extern.log4j.Log4j; import java.util.stream.IntStream; import java.util.List; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("file:src/main/webapp/WEB-INF/spring/root-context.xml") @Log4j public class ReplyMapperTests { private Long[] bnoArr = { 141L, 142L, 143L, 144L, 145L}; @Setter(onMethod_ = @Autowired) private ReplyMapper mapper; @Test public void testMapper() { log.info(mapper); } /* @Test public void testCreate() { IntStream.rangeClosed(1, 100).forEach(i -> { ReplyVO vo = new ReplyVO(); vo.setBno(bnoArr[i % 5]); vo.setReply("΄ρΕ¬ ΕΧ½ΊΖ®" + i); vo.setReplyer("replyer" + i); mapper.insert(vo); }); } @Test public void testRead() { Long targetRno = 5L; ReplyVO vo = mapper.read(targetRno); log.info(vo); } @Test public void testDelete() { Long targetRno = 10L; mapper.delete(targetRno); } @Test public void testUpdate() { Long targetRno = 5L; ReplyVO vo = mapper.read(targetRno); vo.setReply("update reply"); int count = mapper.update(vo); log.info("update count::"+count); } */ @Test public void testList2() { Criteria cri = new Criteria(2,10); List<ReplyVO> replies = mapper.getListWithPaging(cri, 141L); replies.forEach(reply -> log.info(reply)); } }
[ "hansol4412@naver.com" ]
hansol4412@naver.com
3411a6164fb4be39d63f4237ef264811cd4b7119
bf812baa4cfd31d22d74ac7ec1a324641a991ede
/kadry/src/main/java/beanstesty/OkresBean.java
3cbe7a27b649b464851cfe224e378e77f15d8e42
[]
no_license
brzaskun/NetBeansProjects
f5d0abc95a29681fab87e6a039a7f925edab3dc6
aa67838735901cc9171c49600348eaea8e35e523
refs/heads/masterpozmianach
2023-08-31T23:32:37.748389
2023-08-30T21:30:09
2023-08-30T21:30:09
40,359,654
0
0
null
2023-03-27T22:22:00
2015-08-07T12:35:43
Java
UTF-8
Java
false
false
3,004
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package beanstesty; import data.Data; import embeddable.Mce; import embeddable.Okres; import entity.Nieobecnosc; import java.io.Serializable; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; import javax.enterprise.context.SessionScoped; import javax.inject.Named; /** * * @author Osito */ @Named @SessionScoped public class OkresBean implements Serializable{ private static final long serialVersionUID = 1L; private static final List<Okres> okresylista; static { okresylista = generujokresy(); } public OkresBean() { } static List<Okres> generujokresy() { List<Okres> zwrot = new ArrayList<>(); Integer rokod = 2020; Integer rokdo = 2043; Integer mcod = 1; Integer mcdo = 12; int i = 1; for (int rok = rokod;rok<=rokdo;rok++) { for (int mc = mcod;mc<=mcdo;mc++) { Okres nowy = new Okres(String.valueOf(rok),Mce.getNumberToMiesiac().get(mc), i); zwrot.add(nowy); } } return zwrot; } static List<Okres> generujokresy(Nieobecnosc nieobecnosc) { List<Okres> zwrot = new ArrayList<>(); Integer rokod = Integer.parseInt(nieobecnosc.getRokod()); Integer rokdo = Integer.parseInt(nieobecnosc.getRokdo()); Integer mcod = Integer.parseInt(nieobecnosc.getMcod()); Integer mcdo = Integer.parseInt(nieobecnosc.getMcdo()); for (int rok = rokod;rok<=rokdo;rok++) { for (int mc = mcod;mc<=mcdo;mc++) { Okres nowy = new Okres(String.valueOf(rok),Mce.getNumberToMiesiac().get(mc)); zwrot.add(nowy); } } return zwrot; } public static List<Okres> pobierzokresy(String dataod, String datado) { Set<Okres> zwrot = new HashSet<>(); String rokod = Data.getRok(dataod); String mcod = Data.getMc(dataod); String rokdo = Data.getRok(datado); String mcdo = Data.getMc(datado); boolean start = false; boolean stop = false; for (Okres o : okresylista) { if (stop==false) { if (rokod.equals(o.getRok())&&mcod.equals(o.getMc())) { zwrot.add(o); start = true; } if (start) { zwrot.add(o); } if (rokdo.equals(o.getRok())&&mcdo.equals(o.getMc())) { zwrot.add(o); stop = true; } } else { break; } } return new ArrayList<>(zwrot); } public List<Okres> getOkresylista() { return okresylista; } }
[ "Osito@DESKTOP-DVFG0DI" ]
Osito@DESKTOP-DVFG0DI
2d2913640caacf02bb1b19dc4323d3db3f1b6317
eeb7f2aa90bdb175b3d046f9072fa0cb9b286a5d
/jsonTest/src/cn/com/ths/dbcenter/domain/popularfeelings/PopularFeeling.java
402adbb21139b156375a49047bc6752b8310a816
[]
no_license
longtaoge/jsonTest
abd4d4f4f50185f9fa20e1b69dab6d2768ff43b8
b99075d6b232e08970caf4d33f96768b99df1acf
refs/heads/master
2020-05-28T09:56:09.250672
2014-12-01T05:35:26
2014-12-01T05:35:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,316
java
package cn.com.ths.dbcenter.domain.popularfeelings; import java.io.Serializable; import java.util.ArrayList; import java.util.List; /** * 类名: PopularFeeling</br> * 包名:cn.com.ths.dbcenter.domain.popularfeelings </br> * 描述: 封装舆情页面四个列表数据的数据模型 </br> * 发布版本号:</br> * 开发人员: weiyubiao</br> * 创建时间: 2014-11-28 */ public class PopularFeeling implements Serializable { /** * 部委要闻 * ministriesNews */ private List<NewsIndex> memuMN =new ArrayList<NewsIndex>(); /** *省厅资讯 *informationMinistriesAgencies */ private List<NewsIndex> menuIMAg=new ArrayList<NewsIndex>(); /** * 今日舆情 * TodayPublicOpinion */ private List<NewsIndex> menuTPO=new ArrayList<NewsIndex>() ; /** * 舆情聚焦 * PublicOpinionFocus */ private List<NewsIndex> menuPOF=new ArrayList<NewsIndex>(); public List<NewsIndex> getMemuMN() { return memuMN; } public void setMemuMN(List<NewsIndex> memuMN) { this.memuMN = memuMN; } public List<NewsIndex> getMenuIMAg() { return menuIMAg; } public void setMenuIMAg(List<NewsIndex> menuIMAg) { this.menuIMAg = menuIMAg; } public List<NewsIndex> getMenuTPO() { return menuTPO; } public void setMenuTPO(List<NewsIndex> menuTPO) { this.menuTPO = menuTPO; } public List<NewsIndex> getMenuPOF() { return menuPOF; } public void setMenuPOF(List<NewsIndex> menuPOF) { this.menuPOF = menuPOF; } @Override public String toString() { return "PopularFeeling [memuMN=" + memuMN + ", menuIMAg=" + menuIMAg + ", menuTPO=" + menuTPO + ", menuPOF=" + menuPOF + "]"; } public PopularFeeling(List<NewsIndex> memuMN, List<NewsIndex> menuIMAg, List<NewsIndex> menuTPO, List<NewsIndex> menuPOF) { super(); this.memuMN = memuMN; this.menuIMAg = menuIMAg; this.menuTPO = menuTPO; this.menuPOF = menuPOF; } public PopularFeeling() { super(); // TODO Auto-generated constructor stub } }
[ "61852263@qq.com" ]
61852263@qq.com
da4b0ec71e487d24f0ef4c88b5ea16db6e191a43
4bdcd866bf6c4a98e813052cf5cd41ac517d65e0
/tuling_springIoc/src/main/java/com/lslnx/springIoc/Hi.java
2351bade479c85e9165fc941db1eb7ff7a49761d
[]
no_license
lslnx0307/tulingDemo
e239a3ec6ac12c7d4642041af8658d2d3a16f1d0
5ea2596edcdaead3bbce8fe990e995758223fa02
refs/heads/master
2020-03-27T15:49:45.080542
2019-02-21T07:26:12
2019-02-21T07:26:12
146,742,199
0
0
null
null
null
null
UTF-8
Java
false
false
296
java
package com.lslnx.springIoc;/** * Created by Administrator on 2018/8/26. */ /** * @author Tommy * Created by Tommy on 2018/8/26 **/ public class Hi { public Hi() { System.out.println("new hi"); } public void sayHi() { System.out.println("hi"); } }
[ "184576454@qq.com" ]
184576454@qq.com
42d10fadc61929f999dff4b310d91371ffcf42a8
7a96414d5b49603238e95a6b1e77809a77143082
/software/ear/src/test/java/gov/nih/nci/firebird/selenium2/pages/sponsor/annual/registration/EditAnnualRegistrationConfigurationPageHelper.java
61b837c7c8c7fcfebd4670b25dff2a96471c0486
[]
no_license
NCIP/nci-ocr
822788379a2bf0a95ee00e1667e365766cc8c794
e36adffb92fdb9833bb8835f87eab4b46594019e
refs/heads/master
2016-09-05T12:40:31.309373
2013-08-28T14:32:45
2013-08-28T14:32:45
12,298,569
2
1
null
null
null
null
UTF-8
Java
false
false
6,343
java
/** * The software subject to this notice and license includes both human readable * source code form and machine readable, binary, object code form. The NCI OCR * Software was developed in conjunction with the National Cancer Institute * (NCI) by NCI employees and 5AM Solutions, Inc. (5AM). To the extent * government employees are authors, any rights in such works shall be subject * to Title 17 of the United States Code, section 105. * * This NCI OCR Software License (the License) is between NCI and You. You (or * Your) shall mean a person or an entity, and all other entities that control, * are controlled by, or are under common control with the entity. Control for * purposes of this definition means (i) the direct or indirect power to cause * the direction or management of such entity, whether by contract or otherwise, * or (ii) ownership of fifty percent (50%) or more of the outstanding shares, * or (iii) beneficial ownership of such entity. * * This License is granted provided that You agree to the conditions described * below. NCI grants You a non-exclusive, worldwide, perpetual, fully-paid-up, * no-charge, irrevocable, transferable and royalty-free right and license in * its rights in the NCI OCR Software to (i) use, install, access, operate, * execute, copy, modify, translate, market, publicly display, publicly perform, * and prepare derivative works of the NCI OCR Software; (ii) distribute and * have distributed to and by third parties the NCI OCR Software and any * modifications and derivative works thereof; and (iii) sublicense the * foregoing rights set out in (i) and (ii) to third parties, including the * right to license such rights to further third parties. For sake of clarity, * and not by way of limitation, NCI shall have no right of accounting or right * of payment from You or Your sub-licensees for the rights granted under this * License. This License is granted at no charge to You. * * Your redistributions of the source code for the Software must retain the * above copyright notice, this list of conditions and the disclaimer and * limitation of liability of Article 6, below. Your redistributions in object * code form must reproduce the above copyright notice, this list of conditions * and the disclaimer of Article 6 in the documentation and/or other materials * provided with the distribution, if any. * * Your end-user documentation included with the redistribution, if any, must * include the following acknowledgment: This product includes software * developed by 5AM and the National Cancer Institute. If You do not include * such end-user documentation, You shall include this acknowledgment in the * Software itself, wherever such third-party acknowledgments normally appear. * * You may not use the names "The National Cancer Institute", "NCI", or "5AM" * to endorse or promote products derived from this Software. This License does * not authorize You to use any trademarks, service marks, trade names, logos or * product names of either NCI or 5AM, except as required to comply with the * terms of this License. * * For sake of clarity, and not by way of limitation, You may incorporate this * Software into Your proprietary programs and into any third party proprietary * programs. However, if You incorporate the Software into third party * proprietary programs, You agree that You are solely responsible for obtaining * any permission from such third parties required to incorporate the Software * into such third party proprietary programs and for informing Your * sub-licensees, including without limitation Your end-users, of their * obligation to secure any required permissions from such third parties before * incorporating the Software into such third party proprietary software * programs. In the event that You fail to obtain such permissions, You agree * to indemnify NCI for any claims against NCI by such third parties, except to * the extent prohibited by law, resulting from Your failure to obtain such * permissions. * * For sake of clarity, and not by way of limitation, You may add Your own * copyright statement to Your modifications and to the derivative works, and * You may provide additional or different license terms and conditions in Your * sublicenses of modifications of the Software, or any derivative works of the * Software as a whole, provided Your use, reproduction, and distribution of the * Work otherwise complies with the conditions stated in this License. * * THIS SOFTWARE IS PROVIDED "AS IS," AND ANY EXPRESSED OR IMPLIED WARRANTIES, * (INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, * NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE) ARE DISCLAIMED. IN NO * EVENT SHALL THE NATIONAL CANCER INSTITUTE, 5AM SOLUTIONS, INC. OR THEIR * AFFILIATES 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 gov.nih.nci.firebird.selenium2.pages.sponsor.annual.registration; import gov.nih.nci.firebird.data.FormOptionality; import gov.nih.nci.firebird.data.FormType; import gov.nih.nci.firebird.selenium2.pages.sponsor.annual.registration.EditAnnualRegistrationConfigurationPage.RegistrationFormListing; import gov.nih.nci.firebird.selenium2.pages.util.FirebirdTableUtils; public class EditAnnualRegistrationConfigurationPageHelper { private EditAnnualRegistrationConfigurationPage page; public EditAnnualRegistrationConfigurationPageHelper(EditAnnualRegistrationConfigurationPage page) { this.page = page; } public RegistrationFormListing getListing(FormType formType) { return FirebirdTableUtils.getListing(page.getListings(), formType); } public void addForm(FormType formType, FormOptionality optionality) { page.selectFormType(formType); page.clickAddFormButton(); getListing(formType).setOptionality(optionality); } }
[ "mkher@fusionspan.com" ]
mkher@fusionspan.com
5c2a8d4fdade593f1b6df7ee121b3761063d693b
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/LANG-13b-4-1-NSGA_II-LineCoverage:ExceptionType:StackTraceSimilarity/org/apache/commons/lang3/SerializationUtils$ClassLoaderAwareObjectInputStream_ESTest_scaffolding.java
f9d5ba4c3536800d512662909045e4d4b2ef3697
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
481
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Tue Jan 21 20:37:14 UTC 2020 */ package org.apache.commons.lang3; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class SerializationUtils$ClassLoaderAwareObjectInputStream_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
9f32c2e9421ecc247eeb47915a9d7c214d9a9b96
cb808210aa5bf4f11913e735d59bfa54dd553089
/rabbit-fsh-api/src/main/java/com/rabbit/fsh/api/controller/LocalController.java
f404c97a8c59d1e7df7b417a14cc1d2abe1128ca
[]
no_license
RabbitWFly/spring-cloud-learning
0f113af63fd420ee7567be80afd350071fb58864
e22a377e2507775dd94fcc6346c8c4270032cc00
refs/heads/master
2020-04-27T12:47:58.971153
2019-04-07T14:49:08
2019-04-07T14:49:08
174,344,862
0
0
null
null
null
null
UTF-8
Java
false
false
441
java
package com.rabbit.fsh.api.controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RestController; /** * @Author chentao * Date 2019/3/26 * Description **/ @RestController public class LocalController { @GetMapping("/local/{id}") public String local(@PathVariable String id){ return id; } }
[ "chentao@daokoudai.com" ]
chentao@daokoudai.com
727718f45b0ca2ff943116834d6d606ea1e57777
b65cc22c1a5f523520359359d6fee3f700b889aa
/baselibrary/src/main/java/com/wrs/gykjewm/baselibrary/iface/IPresenter.java
2b45957c790979bfadeac1492ebefd3e1362f672
[]
no_license
hxs2mr/Cashier-android
9f53f29106f935cf8aa42dfd337321dd0a0f52c2
00e82a7ba22570bdfd0b96e3d21be82ca9217eef
refs/heads/master
2020-05-17T08:01:42.556462
2019-04-26T09:00:46
2019-04-26T09:00:46
183,594,682
0
1
null
null
null
null
UTF-8
Java
false
false
448
java
package com.wrs.gykjewm.baselibrary.iface; import com.wrs.gykjewm.baselibrary.base.IBaseView; import io.reactivex.disposables.Disposable; /** * description: * <p> * author: josh.lu * created: 11/6/18 下午12:46 * email: 1113799552@qq.com * version: v1.0 */ public interface IPresenter<V extends IBaseView> { void attachView(V view); void detachView(); void addDisposable(Disposable disposable); void cancel(); }
[ "1363826037@qq.com" ]
1363826037@qq.com
f7f41479913c29c34c33176ec46717839b51776d
d19a81be996d1f7cdaef3c20079a6ee0c4c92f61
/src/main/java/com/kk/nio/mysql/packhandler/console/Capabilities.java
2f52b1ed2a32bcdccdc7b8a0d137cc840034c341
[]
no_license
kkzfl22/NIO-kk
87df782179aed2b6108949d1b795d508d479f672
b7a2d85e4bd1daba835ed279cc5906f7cb1b4d24
refs/heads/master
2021-01-19T19:03:22.235197
2017-11-22T09:34:18
2017-11-22T09:34:18
83,712,449
0
0
null
null
null
null
UTF-8
Java
false
false
4,394
java
/* * Copyright (c) 2013, OpenCloudDB/MyCAT and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software;Designed and Developed mainly by many Chinese * opensource volunteers. you can redistribute it and/or modify it under the * terms of the GNU General Public License version 2 only, as published by the * Free Software Foundation. * * This code 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 * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Any questions about this component can be directed to it's project Web address * https://code.google.com/p/opencloudb/. * */ package com.kk.nio.mysql.packhandler.console; /** * 处理能力标识定义 * * @author mycat */ public interface Capabilities { /** * server capabilities * * <pre> * server: 11110111 11111111 * client_cmd: 11 10100110 10000101 * client_jdbc:10 10100010 10001111 * * @see http://dev.mysql.com/doc/refman/5.1/en/mysql-real-connect.html * </pre> */ // new more secure passwords public static final int CLIENT_LONG_PASSWORD = 1; // Found instead of affected rows // 返回找到(匹配)的行数,而不是改变了的行数。 public static final int CLIENT_FOUND_ROWS = 2; // Get all column flags public static final int CLIENT_LONG_FLAG = 4; // One can specify db on connect public static final int CLIENT_CONNECT_WITH_DB = 8; // Don't allow database.table.column // 不允许“数据库名.表名.列名”这样的语法。这是对于ODBC的设置。 // 当使用这样的语法时解析器会产生一个错误,这对于一些ODBC的程序限制bug来说是有用的。 public static final int CLIENT_NO_SCHEMA = 16; // Can use compression protocol // 使用压缩协议 public static final int CLIENT_COMPRESS = 32; // Odbc client public static final int CLIENT_ODBC = 64; // Can use LOAD DATA LOCAL public static final int CLIENT_LOCAL_FILES = 128; // Ignore spaces before '(' // 允许在函数名后使用空格。所有函数名可以预留字。 public static final int CLIENT_IGNORE_SPACE = 256; // New 4.1 protocol This is an interactive client public static final int CLIENT_PROTOCOL_41 = 512; // This is an interactive client // 允许使用关闭连接之前的不活动交互超时的描述,而不是等待超时秒数。 // 客户端的会话等待超时变量变为交互超时变量。 public static final int CLIENT_INTERACTIVE = 1024; // Switch to SSL after handshake // 使用SSL。这个设置不应该被应用程序设置,他应该是在客户端库内部是设置的。 // 可以在调用mysql_real_connect()之前调用mysql_ssl_set()来代替设置。 public static final int CLIENT_SSL = 2048; // IGNORE sigpipes // 阻止客户端库安装一个SIGPIPE信号处理器。 // 这个可以用于当应用程序已经安装该处理器的时候避免与其发生冲突。 public static final int CLIENT_IGNORE_SIGPIPE = 4096; // Client knows about transactions public static final int CLIENT_TRANSACTIONS = 8192; // Old flag for 4.1 protocol public static final int CLIENT_RESERVED = 16384; // New 4.1 authentication public static final int CLIENT_SECURE_CONNECTION = 32768; // Enable/disable multi-stmt support // 通知服务器客户端可以发送多条语句(由分号分隔)。如果该标志为没有被设置,多条语句执行。 public static final int CLIENT_MULTI_STATEMENTS = 65536; // Enable/disable multi-results // 通知服务器客户端可以处理由多语句或者存储过程执行生成的多结果集。 // 当打开CLIENT_MULTI_STATEMENTS时,这个标志自动的被打开。 public static final int CLIENT_MULTI_RESULTS = 131072; }
[ "546064298@qq.com" ]
546064298@qq.com
8fec0e3e8aea240483585cd2061227bf35da5498
7eafc6d93781d0e31bb9479cd8b36d3ae7567f44
/org.osate.aadl2/src/org/osate/aadl2/BusAccess.java
d1b4bd86117df54a58b075e5916718bfe434bfe6
[]
no_license
gmcahill/osate2-core
024e10c17ade2cd0e0e11b58bd15e5df29736e5d
a0995e2ae5e958f73d1a1e28e788287f8a5c1192
refs/heads/master
2021-01-17T04:23:42.662623
2011-11-09T15:18:26
2011-11-09T15:18:26
2,180,744
1
0
null
null
null
null
UTF-8
Java
false
false
4,195
java
/** * <copyright> * Copyright 2008 by Carnegie Mellon University, all rights reserved. * * Use of the Open Source AADL Tool Environment (OSATE) is subject to the terms of the license set forth * at http://www.eclipse.org/org/documents/epl-v10.html. * * NO WARRANTY * * ANY INFORMATION, MATERIALS, SERVICES, INTELLECTUAL PROPERTY OR OTHER PROPERTY OR RIGHTS GRANTED OR PROVIDED BY * CARNEGIE MELLON UNIVERSITY PURSUANT TO THIS LICENSE (HEREINAFTER THE "DELIVERABLES") ARE ON AN "AS-IS" BASIS. * CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED AS TO ANY MATTER INCLUDING, * BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, INFORMATIONAL CONTENT, * NONINFRINGEMENT, OR ERROR-FREE OPERATION. CARNEGIE MELLON UNIVERSITY SHALL NOT BE LIABLE FOR INDIRECT, SPECIAL OR * CONSEQUENTIAL DAMAGES, SUCH AS LOSS OF PROFITS OR INABILITY TO USE SAID INTELLECTUAL PROPERTY, UNDER THIS LICENSE, * REGARDLESS OF WHETHER SUCH PARTY WAS AWARE OF THE POSSIBILITY OF SUCH DAMAGES. LICENSEE AGREES THAT IT WILL NOT * MAKE ANY WARRANTY ON BEHALF OF CARNEGIE MELLON UNIVERSITY, EXPRESS OR IMPLIED, TO ANY PERSON CONCERNING THE * APPLICATION OF OR THE RESULTS TO BE OBTAINED WITH THE DELIVERABLES UNDER THIS LICENSE. * * Licensee hereby agrees to defend, indemnify, and hold harmless Carnegie Mellon University, its trustees, officers, * employees, and agents from all claims or demands made against them (and any related losses, expenses, or * attorney's fees) arising out of, or relating to Licensee's and/or its sub licensees' negligent use or willful * misuse of or negligent conduct or willful misconduct regarding the Software, facilities, or other rights or * assistance granted by Carnegie Mellon University under this License, including, but not limited to, any claims of * product liability, personal injury, death, damage to property, or violation of any laws or regulations. * * Carnegie Mellon University Software Engineering Institute authored documents are sponsored by the U.S. Department * of Defense under Contract F19628-00-C-0003. Carnegie Mellon University retains copyrights in all material produced * under this contract. The U.S. Government retains a non-exclusive, royalty-free license to publish or reproduce these * documents, or allow others to do so, for U.S. Government purposes only pursuant to the copyright license * under the contract clause at 252.227.7013. * </copyright> * * $Id: BusAccess.java,v 1.9 2009-06-04 14:59:49 lwrage Exp $ */ package org.osate.aadl2; /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>Bus Access</b></em>'. * <!-- end-user-doc --> * * <p> * The following features are supported: * <ul> * <li>{@link org.osate.aadl2.BusAccess#getBusFeatureClassifier <em>Bus Feature Classifier</em>}</li> * </ul> * </p> * * @see org.osate.aadl2.Aadl2Package#getBusAccess() * @model * @generated */ public interface BusAccess extends Access { /** * Returns the value of the '<em><b>Bus Feature Classifier</b></em>' reference. * <p> * This feature subsets the following features: * <ul> * <li>'{@link org.osate.aadl2.Feature#getFeatureClassifier() <em>Feature Classifier</em>}'</li> * </ul> * </p> * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Bus Feature Classifier</em>' reference isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Bus Feature Classifier</em>' reference. * @see #setBusFeatureClassifier(BusSubcomponentType) * @see org.osate.aadl2.Aadl2Package#getBusAccess_BusFeatureClassifier() * @model ordered="false" * @generated */ BusSubcomponentType getBusFeatureClassifier(); /** * Sets the value of the '{@link org.osate.aadl2.BusAccess#getBusFeatureClassifier <em>Bus Feature Classifier</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Bus Feature Classifier</em>' reference. * @see #getBusFeatureClassifier() * @generated */ void setBusFeatureClassifier(BusSubcomponentType value); } // BusAccess
[ "lutz.wrage@gmail.com" ]
lutz.wrage@gmail.com
d43ca3f947010acd140bdf8a242382262fe29993
f28dce60491e33aefb5c2187871c1df784ccdb3a
/src/main/java/uk/co/senab/photoview/gestures/VersionedGestureDetector.java
00285b9edbe41541768aee215635d28630176086
[ "Apache-2.0" ]
permissive
JackChan1999/boohee_v5.6
861a5cad79f2bfbd96d528d6a2aff84a39127c83
221f7ea237f491e2153039a42941a515493ba52c
refs/heads/master
2021-06-11T23:32:55.977231
2017-02-14T18:07:04
2017-02-14T18:07:04
81,962,585
8
6
null
null
null
null
UTF-8
Java
false
false
675
java
package uk.co.senab.photoview.gestures; import android.content.Context; import android.os.Build.VERSION; public final class VersionedGestureDetector { public static GestureDetector newInstance(Context context, OnGestureListener listener) { GestureDetector detector; int sdkVersion = VERSION.SDK_INT; if (sdkVersion < 5) { detector = new CupcakeGestureDetector(context); } else if (sdkVersion < 8) { detector = new EclairGestureDetector(context); } else { detector = new FroyoGestureDetector(context); } detector.setOnGestureListener(listener); return detector; } }
[ "jackychan2040@gmail.com" ]
jackychan2040@gmail.com
27bb6da16d7473646eab8923a67df502de324d0e
2cb7187bcbef4ce4d8dac997e8b6838a5265bb7a
/BetaApplications/src/aplicacion/cliente/corrector/test/_Test.java
0c3bab474febccd322b5acd5a1e559bc287d2c5e
[]
no_license
pjpincheiragr/Catalogos
cc5185e7a22c4a2c4ed1c9ebfd6d42186f996c50
d462cc5bcd740215a01f7684a5ea6cb6086ef3db
refs/heads/master
2021-01-10T06:15:27.738122
2015-12-18T13:05:54
2015-12-18T13:05:54
48,194,633
0
0
null
null
null
null
UTF-8
Java
false
false
355
java
package aplicacion.cliente.corrector.test; import aplicacion.cliente.corrector.constructor.*; import aplicacion.herramientas.conexion.conectores.MsSQL; public class _Test { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub _Constructor CC=new _Constructor(); CC.build(null); CC.init(); } }
[ "juli.otero01@gmail.com" ]
juli.otero01@gmail.com
1173e4c86a480620f5a1b7f98c8018eddeb0a564
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
/benchmark/training/com/iluwatar/proxy/WizardTest.java
484d152f06882ba77b6376887a2838b69dcbd12a
[]
no_license
STAMP-project/dspot-experiments
f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5
121487e65cdce6988081b67f21bbc6731354a47f
refs/heads/master
2023-02-07T14:40:12.919811
2019-11-06T07:17:09
2019-11-06T07:17:09
75,710,758
14
19
null
2023-01-26T23:57:41
2016-12-06T08:27:42
null
UTF-8
Java
false
false
1,600
java
/** * The MIT License * Copyright (c) 2014-2016 Ilkka Sepp?l? * * 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.iluwatar.proxy; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; /** * Tests for {@link Wizard} */ public class WizardTest { @Test public void testToString() throws Exception { final String[] wizardNames = new String[]{ "Gandalf", "Dumbledore", "Oz", "Merlin" }; for (String name : wizardNames) { Assertions.assertEquals(name, new Wizard(name).toString()); } } }
[ "benjamin.danglot@inria.fr" ]
benjamin.danglot@inria.fr
03bf56967d1ef6ce50ebb920c6ceac594e43b753
a7d2b45e72d745f51db450cc16dc332269a6b5f1
/AlmullaExchange/src/com/amg/exchange/remittance/serviceimpl/HighValueCurrencyServiceImpl.java
039d72f236d607bb7e2990874a0de20c51b2c856
[]
no_license
Anilreddyvasantham/AlmullaExchange
2974ecd53b1d752931c50b7ecd22c5a37fa05a03
b68bca218ce4b7585210deeda2a8cf84c6306ee3
refs/heads/master
2021-05-08T17:48:01.976582
2018-02-02T09:32:22
2018-02-02T09:32:22
119,484,446
1
0
null
null
null
null
UTF-8
Java
false
false
2,053
java
package com.amg.exchange.remittance.serviceimpl; import java.math.BigDecimal; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.amg.exchange.remittance.dao.IHighValueCurrencyDao; import com.amg.exchange.remittance.model.HighValueCurrencySetup; import com.amg.exchange.remittance.service.IHighValueCurrencyService; import com.amg.exchange.treasury.model.CurrencyMaster; @SuppressWarnings("serial") @Service("highValueCurrencyServiceImpl") public class HighValueCurrencyServiceImpl<T> implements IHighValueCurrencyService<T> { @Autowired IHighValueCurrencyDao<T> highValueCurrencyDao; public IHighValueCurrencyDao<T> getHighValueCurrencyDao() { return highValueCurrencyDao; } public void setHighValueCurrencyDao(IHighValueCurrencyDao<T> highValueCurrencyDao) { this.highValueCurrencyDao = highValueCurrencyDao; } public HighValueCurrencyServiceImpl() { // TODO Auto-generated constructor stub } @Transactional @Override public void save(HighValueCurrencySetup highValueCurrencySetup) { getHighValueCurrencyDao().save(highValueCurrencySetup); } @Transactional @Override public List<HighValueCurrencySetup> getAllCurrencyList(BigDecimal currencyId){ return getHighValueCurrencyDao().getAllCurrencyList(currencyId); } @Transactional @Override public List<HighValueCurrencySetup> getEnquiryList(){ return getHighValueCurrencyDao().getEnquiryList(); } @Transactional @Override public String approveReord(BigDecimal highValueId, String userName){ return getHighValueCurrencyDao().approveReord(highValueId, userName); } @Transactional @Override public void delete(BigDecimal highValueId){ getHighValueCurrencyDao().delete(highValueId); } @Transactional @Override public List<CurrencyMaster> getCurrencyList(BigDecimal currencyId) { // TODO Auto-generated method stub return getHighValueCurrencyDao().getCurrencyList(currencyId); } }
[ "anilreddy.vasantham@gmail.com" ]
anilreddy.vasantham@gmail.com
77eb9ef49d4c103c993337f29c2cae5abf722453
f9f1780502d471f9586bf5d2976e24f05ef6d01f
/src/main/java/net/floodlightcontroller/hub/Hub.java
8dc85753830d36e4b943cfdd1d8ff8b69766d91a
[ "Apache-2.0" ]
permissive
vonzhou/floodlightx
6c7f98bb51c6173983a06be28f8936f77809f738
8effab5020b020b9b3e634fd6ce634f826b26672
refs/heads/master
2021-01-17T07:10:32.874346
2016-04-26T04:48:35
2016-04-26T04:48:35
25,626,476
1
0
null
null
null
null
GB18030
Java
false
false
4,271
java
package net.floodlightcontroller.hub; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Map; import net.floodlightcontroller.core.FloodlightContext; import net.floodlightcontroller.core.IFloodlightProviderService; import net.floodlightcontroller.core.IOFMessageListener; import net.floodlightcontroller.core.IOFSwitch; import net.floodlightcontroller.core.module.FloodlightModuleContext; import net.floodlightcontroller.core.module.FloodlightModuleException; import net.floodlightcontroller.core.module.IFloodlightModule; import net.floodlightcontroller.core.module.IFloodlightService; import org.openflow.protocol.OFMessage; import org.openflow.protocol.OFPacketIn; import org.openflow.protocol.OFPacketOut; import org.openflow.protocol.OFPort; import org.openflow.protocol.OFType; import org.openflow.protocol.action.OFAction; import org.openflow.protocol.action.OFActionOutput; import org.openflow.util.U16; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class Hub implements IFloodlightModule, IOFMessageListener { protected static Logger log = LoggerFactory.getLogger(Hub.class); protected IFloodlightProviderService floodlightProvider; /** * @param floodlightProvider the floodlightProvider to set */ public void setFloodlightProvider(IFloodlightProviderService floodlightProvider) { this.floodlightProvider = floodlightProvider; } @Override public String getName() { return Hub.class.getPackage().getName(); } /* * Hub的具体处理逻辑:通过packet out来广播到其他端口 */ public Command receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx) { // 只监听packet in 消息 OFPacketIn pi = (OFPacketIn) msg; OFPacketOut po = (OFPacketOut) floodlightProvider.getOFMessageFactory() .getMessage(OFType.PACKET_OUT); po.setBufferId(pi.getBufferId()) .setInPort(pi.getInPort()); // set actions OFActionOutput action = new OFActionOutput().setPort((short) OFPort.OFPP_FLOOD.getValue()); po.setActions(Collections.singletonList((OFAction)action)); po.setActionsLength((short) OFActionOutput.MINIMUM_LENGTH); // set data if is is included in the packetin if (pi.getBufferId() == 0xffffffff) { byte[] packetData = pi.getPacketData(); po.setLength(U16.t(OFPacketOut.MINIMUM_LENGTH + po.getActionsLength() + packetData.length)); po.setPacketData(packetData); } else { po.setLength(U16.t(OFPacketOut.MINIMUM_LENGTH + po.getActionsLength())); } try { sw.write(po, cntx); } catch (IOException e) { log.error("Failure writing PacketOut", e); } return Command.CONTINUE; } @Override public boolean isCallbackOrderingPrereq(OFType type, String name) { return false; } @Override public boolean isCallbackOrderingPostreq(OFType type, String name) { return false; } // IFloodlightModule @Override public Collection<Class<? extends IFloodlightService>> getModuleServices() { // We don't provide any services, return null return null; } @Override public Map<Class<? extends IFloodlightService>, IFloodlightService> getServiceImpls() { // We don't provide any services, return null return null; } @Override public Collection<Class<? extends IFloodlightService>> getModuleDependencies() { Collection<Class<? extends IFloodlightService>> l = new ArrayList<Class<? extends IFloodlightService>>(); l.add(IFloodlightProviderService.class); return l; } @Override public void init(FloodlightModuleContext context) throws FloodlightModuleException { floodlightProvider = context.getServiceImpl(IFloodlightProviderService.class); } @Override public void startUp(FloodlightModuleContext context) { floodlightProvider.addOFMessageListener(OFType.PACKET_IN, this); } }
[ "vonzhou@163.com" ]
vonzhou@163.com
952ef3cfa5c7f8f1915b2ba2849dd2b0be1ae3fa
d64582aa2a32cc0e274bc1422b4e3621c2f91736
/lab-api/src/main/java/ac/cn/saya/lab/api/service/medium/PictureStorageService.java
66a3df4f63b5fbc9b390a84bf5c65904a16fdab9
[ "Apache-2.0" ]
permissive
saya-ac-cn/lab
6ef59e4263774ed88aa6fb59241c42b20c6c5361
034ef9c80b7d2f6462a7c352c351c00bb99e784c
refs/heads/master
2022-07-04T12:24:19.206621
2020-08-26T14:41:14
2020-08-26T14:41:14
234,917,318
0
0
Apache-2.0
2022-06-21T02:54:45
2020-01-19T14:58:16
Java
UTF-8
Java
false
false
1,667
java
package ac.cn.saya.lab.api.service.medium; import ac.cn.saya.lab.api.entity.PictureEntity; import ac.cn.saya.lab.api.tools.Result; /** * @Title: PictureStorageService * @ProjectName lab * @Description: TODO * @Author liunengkai * @Date: 2020-03-13 20:41 * @Description: */ public interface PictureStorageService { /** * @描述 图片上传服务(Base64) * @参数 [entity] * @返回值 java.lang.Integer * @创建人 saya.ac.cn-刘能凯 * @创建时间 2020/3/13 * @修改人和其它信息 */ public Result<Integer> uploadPictureBase64(PictureEntity entity); /** * @描述 删除base64类型的图片 * @参数 * @返回值 * @创建人 saya.ac.cn-刘能凯 * @创建时间 2020/3/13 * @修改人和其它信息 */ public Result<Integer> deletePictuBase64(PictureEntity entity); /** * @描述 查询分页后的图片 * @参数 * @返回值 * @创建人 saya.ac.cn-刘能凯 * @创建时间 2020/3/13 * @修改人和其它信息 */ public Result<Object> getPictuBase64Page(PictureEntity entity); /** * @描述 查询一张图片 * @参数 * @返回值 * @创建人 saya.ac.cn-刘能凯 * @创建时间 2020/3/13 * @修改人和其它信息 */ public Result<PictureEntity> getOnePictuBase64(PictureEntity entity); /** * @描述 查询图片的总数 * @参数 * @返回值 * @创建人 saya.ac.cn-刘能凯 * @创建时间 2019/1/12 * @修改人和其它信息 */ public Result<Long> getPictuBase64Count(PictureEntity entity); }
[ "saya@saya.ac.cn" ]
saya@saya.ac.cn
68d2d83767f92cd4d2faa1e5bc78058f17843bb8
1dd2c51fd68b819af41e06ab1aa8a4418cb531d8
/jaxrs/src/main/java/com/proofpoint/jaxrs/testing/GuavaMultivaluedMap.java
1746f84aab0b66e3006549da85fdd8d06ea188d4
[ "Apache-2.0" ]
permissive
proofpoint/platform
768ba49f00c019f5745892bcd714f73b04db3ce2
c6e9f0444d0fea936453ece83670d970caf43ee3
refs/heads/master
2023-08-25T15:01:42.955632
2023-08-24T17:10:20
2023-08-24T18:50:02
1,384,929
59
78
Apache-2.0
2023-09-14T20:52:50
2011-02-19T01:26:11
Java
UTF-8
Java
false
false
1,779
java
package com.proofpoint.jaxrs.testing; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ForwardingMap; import com.google.common.collect.ImmutableList; import com.google.common.collect.ListMultimap; import com.google.common.collect.Multimap; import com.google.common.collect.Multimaps; import jakarta.ws.rs.core.MultivaluedMap; import java.util.List; import java.util.Map; public class GuavaMultivaluedMap<K, V> extends ForwardingMap<K, List<V>> implements MultivaluedMap<K, V> { private final ListMultimap<K, V> multimap = ArrayListMultimap.create(); public GuavaMultivaluedMap() { } public GuavaMultivaluedMap(Multimap<K, V> multimap) { this.multimap.putAll(multimap); } @Override public void putSingle(K key, V value) { multimap.removeAll(key); multimap.put(key, value); } @Override protected Map<K, List<V>> delegate() { return Multimaps.asMap(multimap); } @Override public void add(K key, V value) { multimap.put(key, value); } @SafeVarargs @Override public final void addAll(K key, V... newValues) { multimap.putAll(key, ImmutableList.copyOf(newValues)); } @Override public void addAll(K key, List<V> valueList) { multimap.putAll(key, valueList); } @Override public V getFirst(K key) { return multimap.get(key).stream().findFirst().orElse(null); } @Override public void addFirst(K key, V value) { throw new UnsupportedOperationException(); } @Override public boolean equalsIgnoreValueOrder(MultivaluedMap<K, V> otherMap) { throw new UnsupportedOperationException(); } }
[ "jgmyers@proofpoint.com" ]
jgmyers@proofpoint.com
0c4ba1874a0bef9876595238c5dd1b8d8aa9efe6
b40591ea380eced5360cc9f30e55a766f3a66585
/qunaer/App/src/main/java/com/iflytek/aiui/AIUIEvent.java
80bbdc1234003787f2b2c2d75e493597eef18d3d
[]
no_license
PoseidonMRT/UserfulCodeResource
08935f4155ac7567fc279300a03f80337f9a5516
040dacc22c236fde06f650c46c5cfeb8d52171c0
refs/heads/master
2022-10-09T13:00:48.616694
2019-04-19T02:42:45
2019-04-19T02:42:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
651
java
package com.iflytek.aiui; import android.os.Bundle; public final class AIUIEvent implements Cloneable { public int arg1; public int arg2; public Bundle data; public int eventType; public String info; public AIUIEvent(int i, int i2, int i3, String str, Bundle bundle) { this.eventType = i; this.arg1 = i2; this.arg2 = i3; this.info = str; this.data = bundle; } public Object clone() { AIUIEvent aIUIEvent = (AIUIEvent) super.clone(); if (this.data != null) { aIUIEvent.data = (Bundle) this.data.clone(); } return aIUIEvent; } }
[ "1044176601@qq.com" ]
1044176601@qq.com
ad01e20155de0e1fb1d6f94f08ea0e8fae618c41
6d6463ec34aaf362d191ae88f351e236492751b2
/app/src/main/java/com/cretin/www/caipu/eventbus/NotifyRegisterOrLoginSuccess.java
c0f9e54fbde7704fa5f6e96306c71089139ee84b
[]
no_license
MZCretin/Caipu1
7a360ad2f571b3ba4a707b58bced4693a52bd192
2402215fdf87dbadc5e171d24d30116e566bbe68
refs/heads/master
2021-01-22T19:31:08.070143
2017-03-21T13:36:14
2017-03-21T13:36:14
85,207,165
5
0
null
null
null
null
UTF-8
Java
false
false
129
java
package com.cretin.www.caipu.eventbus; /** * Created by cretin on 2017/1/5. */ public class NotifyRegisterOrLoginSuccess { }
[ "mxnzp_life@163.com" ]
mxnzp_life@163.com
f6f5378bf45238a40cb1147ac3afaf846fde8f1c
eab084584e34ec065cd115139c346180e651c1c2
/src/test/java/v1/t1200/T1282Test.java
c4f3d62b6ab1ac931a72f9a363ef126aff90f305
[]
no_license
zhouyuan93/leetcode
5396bd3a01ed0f127553e1e175bb1f725d1c7919
cc247bc990ad4d5aa802fc7a18a38dd46ed40a7b
refs/heads/master
2023-05-11T19:11:09.322348
2023-05-05T09:12:53
2023-05-05T09:12:53
197,735,845
0
0
null
2020-04-05T09:17:34
2019-07-19T08:38:17
Java
UTF-8
Java
false
false
460
java
package v1.t1200; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import java.util.List; import static org.junit.jupiter.api.Assertions.*; class T1282Test { T1282 t; @BeforeEach void setUp() { t = new T1282(); } @Test void test_1() { int[] groupSizes = {3, 3, 3, 3, 3, 1, 3}; List<List<Integer>> actual = t.groupThePeople(groupSizes); System.out.println(actual); } }
[ "492407250@qq.com" ]
492407250@qq.com
9ef5db4a2b02fa70921855c8f9187a104b4fdd6d
8d1014a3800ec0163bdbae78fc55a466fec64715
/workspace/shop/src/view/ReturnManagerView.java
1275fdbc466fb1c00072a2aeb45917f44de93d4d
[]
no_license
Geend/FHDWGojaShop
23c186a625b141a90f1599f8a24c34ad0c9676f8
1701caa7fa0e76d9b3ef77f2904d2f04bb77da65
refs/heads/master
2021-06-08T14:08:05.356702
2016-12-12T19:19:07
2016-12-12T19:19:07
72,030,711
1
0
null
null
null
null
UTF-8
Java
false
false
742
java
package view; import view.objects.*; import view.visitor.*; public interface ReturnManagerView extends Anything, AbstractViewRoot { public java.util.Vector<ArticleReturnView> getArticleReturn()throws ModelException; public void setArticleReturn(java.util.Vector<ArticleReturnView> newValue) throws ModelException ; public void accept(AnythingVisitor visitor) throws ModelException; public <R> R accept(AnythingReturnVisitor<R> visitor) throws ModelException; public <E extends view.UserException> void accept(AnythingExceptionVisitor<E> visitor) throws ModelException, E; public <R, E extends view.UserException> R accept(AnythingReturnExceptionVisitor<R, E> visitor) throws ModelException, E; }
[ "git@t-voltmer.net" ]
git@t-voltmer.net
076057e9dfcc8821a684e50ffc608bbe5952d296
39c49b324d0ee9a86229c4f310da9ad7971e9831
/src/main/java/level1/exercise/Array5.java
cf231e0b68b29a41b73fdec78137655446a94226
[]
no_license
zhwei5311/study
e3f9abc3aba5eedaf1e8ed6ae7e9db949e7e7b74
e7b4847684349d596f8d4c9b29d502c47607a13d
refs/heads/master
2022-07-09T09:54:57.948953
2022-06-21T12:55:11
2022-06-21T12:55:11
231,111,954
0
0
null
null
null
null
UTF-8
Java
false
false
458
java
package com.study.exercise; /** * 定义一个数组来存储10个学生的成绩{72,89,65,87,91,82,71,93,76,68},计算并输出学生的平均成绩。 */ public class Array5 { public static void main(String[] args) { int[] arr = new int[]{72, 89, 65, 87, 91, 82, 71, 93, 76, 68}; int sum = 0; for (int i = 0; i < arr.length; i++) { sum += arr[i]; } System.err.println(sum / arr.length); } }
[ "zhwei1228@qq.com" ]
zhwei1228@qq.com
1351f53d9748c51ae5ea80de9dcc0d794c5cfe3a
9bb4cf7e03f137506067062a25167357d577e5bb
/wirez-core/wirez-commons/wirez-client-common/src/main/java/org/wirez/core/client/validation/canvas/CanvasValidatorImpl.java
cc7c3048a510daf994a85c2cfc601d65f1e21168
[]
no_license
pefernan/wirez
78840906c36e4629167b0254e11d88756b948302
537a95790b274e48e0a2d5da86956495f85376c8
refs/heads/master
2021-01-14T14:23:09.756622
2016-08-30T09:26:33
2016-08-30T09:26:33
56,070,487
0
0
null
2016-04-12T14:31:17
2016-04-12T14:31:15
null
UTF-8
Java
false
false
4,439
java
package org.wirez.core.client.validation.canvas; import org.wirez.core.client.canvas.Canvas; import org.wirez.core.client.canvas.CanvasHandler; import org.wirez.core.client.shape.Shape; import org.wirez.core.client.util.ShapeStateUtils; import org.wirez.core.graph.Edge; import org.wirez.core.graph.Element; import org.wirez.core.graph.Graph; import org.wirez.core.graph.Node; import org.wirez.core.rule.graph.GraphRulesManager; import org.wirez.core.validation.AbstractValidator; import org.wirez.core.validation.graph.AbstractGraphValidatorCallback; import org.wirez.core.validation.graph.GraphValidationViolation; import org.wirez.core.validation.graph.GraphValidator; import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; import java.util.Collection; import java.util.LinkedList; @ApplicationScoped public class CanvasValidatorImpl extends AbstractValidator<CanvasHandler, CanvasValidatorCallback> implements CanvasValidator { GraphValidator graphValidator; ShapeStateUtils shapeStateUtils; private GraphRulesManager rulesManager = null; @Inject public CanvasValidatorImpl( final GraphValidator graphValidator, final ShapeStateUtils shapeStateUtils ) { this.graphValidator = graphValidator; this.shapeStateUtils = shapeStateUtils; } @Override public CanvasValidator withRulesManager( final GraphRulesManager rulesManager ) { this.rulesManager = rulesManager; return this; } @Override @SuppressWarnings( "unchecked" ) public void validate( final CanvasHandler canvasHandler, final CanvasValidatorCallback callback ) { final Graph graph = canvasHandler.getDiagram().getGraph(); graphValidator .withRulesManager( rulesManager ) .validate( graph, new AbstractGraphValidatorCallback() { @Override public void afterValidateNode( final Node node, final Iterable<GraphValidationViolation> violations ) { super.afterValidateNode( node, violations ); checkViolations( canvasHandler, node, violations ); } @Override public void afterValidateEdge( final Edge edge, final Iterable<GraphValidationViolation> violations ) { super.afterValidateEdge( edge, violations ); checkViolations( canvasHandler, edge, violations ); } @Override public void onSuccess() { callback.onSuccess(); } @Override public void onFail( final Iterable<GraphValidationViolation> violations ) { final Collection<CanvasValidationViolation> canvasValidationViolations = new LinkedList<CanvasValidationViolation>(); for ( final GraphValidationViolation violation : violations ) { final CanvasValidationViolation canvasValidationViolation = new CanvasValidationViolationImpl( canvasHandler, violation ); canvasValidationViolations.add( canvasValidationViolation ); } callback.onFail( canvasValidationViolations ); } } ); } private void checkViolations( final CanvasHandler canvasHandler, final Element element, final Iterable<GraphValidationViolation> violations ) { if ( hasViolations( violations ) ) { final Canvas canvas = canvasHandler.getCanvas(); final Shape shape = getShape( canvasHandler, element.getUUID() ); shapeStateUtils.invalid( canvas, shape ); } } private Shape getShape( final CanvasHandler canvasHandler, final String uuid ) { return canvasHandler.getCanvas().getShape( uuid ); } private boolean hasViolations( final Iterable<GraphValidationViolation> violations ) { return violations != null && violations.iterator().hasNext(); } }
[ "roger600@gmail.com" ]
roger600@gmail.com
751fbf9c6484a773b6adfdc3ff8f0ec91d2ce958
319a371ab83c04a9a2466b0ec1e2a67b93fa7f2f
/zj-lzeh/src/main/java/com/apih5/mybatis/dao/ZjLzehProduceTaskPlanItemMapper.java
305175709aaaf987ae869ad2a2c359445045979e
[]
no_license
zhangrenyi666/apih5-2
0232faa65e2968551d55db47fb35f689e5a03996
afd9b7d574fab11410aab5e0465a0bd706bcf942
refs/heads/master
2023-08-01T13:11:51.678508
2021-09-10T05:52:34
2021-09-10T05:52:34
406,647,352
0
0
null
null
null
null
UTF-8
Java
false
false
1,031
java
package com.apih5.mybatis.dao; import java.util.List; import com.apih5.mybatis.pojo.ZjLzehProduceTaskPlanItem; import org.apache.ibatis.annotations.Param; public interface ZjLzehProduceTaskPlanItemMapper { int deleteByPrimaryKey(String key); int insert(ZjLzehProduceTaskPlanItem record); int insertSelective(ZjLzehProduceTaskPlanItem record); ZjLzehProduceTaskPlanItem selectByPrimaryKey(String key); int updateByPrimaryKeySelective(ZjLzehProduceTaskPlanItem record); int updateByPrimaryKey(ZjLzehProduceTaskPlanItem record); List<ZjLzehProduceTaskPlanItem> selectByZjLzehProduceTaskPlanItemList(ZjLzehProduceTaskPlanItem record); int batchDeleteUpdateZjLzehProduceTaskPlanItem(List<ZjLzehProduceTaskPlanItem> recordList, ZjLzehProduceTaskPlanItem record); // ↓↓↓----扩展-(命名格式:select查询;update更新;sum统计;count数量)----↓↓↓ int insertProduceTaskPlanItemList(@Param("excelImportList") List<ZjLzehProduceTaskPlanItem> excelImportList); }
[ "2267843676@qq.com" ]
2267843676@qq.com
c461d474eb60403b46866a2bb1f70a41c656d3c0
aaac30301a5b18e8b930d9932a5e11d514924c7e
/framework/seckilldemo/src/main/java/me/maiz/project/highconcurrency/service/impl/ProductServiceImpl.java
c248313f972db86e6d5159af6a74dd5631f8e849
[]
no_license
stickgoal/trainning
9206e30fc0b17c817c5826a6e212ad25a3b9d8a6
58348f8a3d21e91cad54d0084078129e788ea1f4
refs/heads/master
2023-03-14T12:29:11.508957
2022-12-01T09:17:50
2022-12-01T09:17:50
91,793,279
1
0
null
2023-02-22T06:55:38
2017-05-19T10:06:01
JavaScript
UTF-8
Java
false
false
814
java
package me.maiz.project.highconcurrency.service.impl; import me.maiz.project.highconcurrency.model.Product; import me.maiz.project.highconcurrency.dao.ProductMapper; import me.maiz.project.highconcurrency.service.IProductService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; /** * <p> * 商品 服务实现类 * </p> * * @author lucas * @since 2020-03-03 */ @Service public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> implements IProductService { @Autowired private ProductMapper productMapper; @Override public List<Product> query(int seckillId) { return productMapper.query(seckillId); } }
[ "stick.goal@163.com" ]
stick.goal@163.com
f78c695b26387ee5674b31e7c89ee5ac0e2dd9f2
0a6e41da01e43562e8a5ef6d227e10159fc253b3
/server/acceptpayment/src/main/java/com/spring/exception/BestPayException.java
42b3c287c9340f901fdd73ba3c5208552191883e
[]
no_license
chq347796066/base-interface
917914190be0b487929f38d2cce68f7e396c149e
356aabbdcf827c9a65083d17c3e7ade259801bfd
refs/heads/main
2023-02-26T13:53:26.205433
2021-02-08T10:24:36
2021-02-08T10:24:36
337,037,239
0
0
null
null
null
null
UTF-8
Java
false
false
412
java
package com.spring.exception; import com.spring.enums.BestPayResultEnum; /** * * @author null * @date 2017/2/23 */ public class BestPayException extends RuntimeException { private final Integer code; public BestPayException(BestPayResultEnum resultEnum) { super(resultEnum.getMsg()); code = resultEnum.getCode(); } public Integer getCode() { return code; } }
[ "chq347796066@126.com" ]
chq347796066@126.com
d5ec5ae2f2c7eb29a35d292bbf5990c1cf2d553a
3abd72fc6e25e11b444d472ee29ac9ef84603b73
/src/main/java/by/creepid/algorithms/basic/uf/UnionFindingFastUnion.java
7ba31816ee3823154d78b9a48c8d36a927ddd50a
[]
no_license
rusakovichma/algorithms-research
3cd0a69d85fdebc1e51dd819da9b9c9d137b65c1
74e43d6eb9e3cd9dcb99aa9ba9025afe13fb240a
refs/heads/master
2021-05-30T17:38:55.354474
2016-03-02T17:08:24
2016-03-02T17:08:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,342
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package by.creepid.algorithms.basic.uf; /** * * @author mirash * * Result structure - tree (id[] - forest trees, binding by parent links) NB: * faster than fast search algorithm fast() - best case: 1 appeal to id[], worst * case - (2N-1) appeal * * Improvement: faster then linear union() execution of FastSearch. * * Common array appeals count while find execution(): for N pairs (p, q) is * 2(1+2+...+N) ~ N^2 */ public class UnionFindingFastUnion extends UnionFindingFastSearch { public UnionFindingFastUnion(int n) { super(n); } /** * Searching for root of p, for example find(5) -> id[id[id[5]]] in [1 1 1 8 * 3 0 5 1 8 8] * * @param p component * @return root name of p */ @Override public int find(int p) { while (p != id[p]) { p = id[p]; } return p; } /** * Fast union method * * @param p component * @param q component */ @Override public void union(int p, int q) { //bring p and q to a common root int pRoot = find(p); int qRoot = find(q); if (pRoot == qRoot) { return; } id[pRoot] = qRoot; count--; } }
[ "mikhail.complete@gmail.com" ]
mikhail.complete@gmail.com
eaa9e52cd1c4bae3942edce899488e842139b594
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/3/3_2b358050f489a2235d90008583f559353e9a8c87/L/3_2b358050f489a2235d90008583f559353e9a8c87_L_s.java
93dca4ab98c6d54520b2bebb2fc4b289f245b712
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
4,688
java
/** * Copyright 2012 Alex Yanchenko * * 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.droidparts.util; import static android.content.pm.ApplicationInfo.FLAG_DEBUGGABLE; import static android.content.pm.PackageManager.GET_META_DATA; import static org.droidparts.contract.Constants.TAG; import org.droidparts.contract.Constants.ManifestMeta; import org.droidparts.inject.Injector; import android.content.Context; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.os.Bundle; import android.util.Log; public class L { private static final int VERBOSE = Log.VERBOSE; private static final int DEBUG = Log.DEBUG; private static final int INFO = Log.INFO; private static final int WARN = Log.WARN; private static final int ERROR = Log.ERROR; private static final int ASSERT = Log.ASSERT; private static final int DISABLE = 1024; public static void v(Object obj) { log(VERBOSE, obj); } public static void d(Object obj) { log(DEBUG, obj); } public static void i(Object obj) { log(INFO, obj); } public static void w(Object obj) { log(WARN, obj); } public static void e(Object obj) { log(ERROR, obj); } public static void wtf(Object obj) { log(ASSERT, "WTF: " + obj); } public static void wtf() { log(ASSERT, "WTF"); } private static void log(int priority, Object obj) { boolean debug = isDebug(); if (debug || (!debug && priority >= getLogLevel())) { String msg = (obj instanceof Exception) ? Log .getStackTraceString((Exception) obj) : String.valueOf(obj); Log.println(priority, getTag(debug), msg); } } private static boolean isDebug() { if (_debug == null) { Context ctx = Injector.getApplicationContext(); if (ctx != null) { ApplicationInfo appInfo = ctx.getApplicationInfo(); _debug = (appInfo.flags & FLAG_DEBUGGABLE) != 0; } } return (_debug != null && _debug); } private static int getLogLevel() { if (_logLevel == 0) { Context ctx = Injector.getApplicationContext(); if (ctx != null) { PackageManager pm = ctx.getPackageManager(); String logLevelStr = null; try { Bundle metaData = pm.getApplicationInfo( ctx.getPackageName(), GET_META_DATA).metaData; logLevelStr = metaData.getString(ManifestMeta.LOG_LEVEL); } catch (Exception e) { Log.d(TAG, "", e); } if (ManifestMeta.DISABLE.equalsIgnoreCase(logLevelStr)) { _logLevel = DISABLE; } else if (ManifestMeta.VERBOSE.equalsIgnoreCase(logLevelStr)) { _logLevel = VERBOSE; } else if (ManifestMeta.DEBUG.equalsIgnoreCase(logLevelStr)) { _logLevel = DEBUG; } else if (ManifestMeta.INFO.equalsIgnoreCase(logLevelStr)) { _logLevel = INFO; } else if (ManifestMeta.WARN.equalsIgnoreCase(logLevelStr)) { _logLevel = WARN; } else if (ManifestMeta.ERROR.equalsIgnoreCase(logLevelStr)) { _logLevel = ERROR; } else if (ManifestMeta.ASSERT.equalsIgnoreCase(logLevelStr)) { _logLevel = ASSERT; } else { _logLevel = DISABLE; Log.i(TAG, "No <meta-data android:name=\"droidparts_log_level\" android:value=\"...\"/> in AndroidManifest.xml. Logging disabled."); } } } return (_logLevel != 0) ? _logLevel : DISABLE; } private static String getTag(boolean debug) { if (debug) { StackTraceElement caller = Thread.currentThread().getStackTrace()[5]; String c = caller.getClassName(); String className = c.substring(c.lastIndexOf(".") + 1, c.length()); StringBuilder sb = new StringBuilder(5); sb.append(className); sb.append("."); sb.append(caller.getMethodName()); sb.append("():"); sb.append(caller.getLineNumber()); return sb.toString(); } else { if (_tag == null) { Context ctx = Injector.getApplicationContext(); if (ctx != null) { _tag = ctx.getPackageName(); } } return (_tag != null) ? _tag : ""; } } private static Boolean _debug; private static int _logLevel; private static String _tag; private L() { } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
25c485dfa0f002f2f600844cbe511ed4ea8b9f46
27b052c54bcf922e1a85cad89c4a43adfca831ba
/src/android/support/v4/app/ActivityCompat.java
3adf2f7b46cc591d90bde5ed6c03e074f254704e
[]
no_license
dreadiscool/YikYak-Decompiled
7169fd91f589f917b994487045916c56a261a3e8
ebd9e9dd8dba0e657613c2c3b7036f7ecc3fc95d
refs/heads/master
2020-04-01T10:30:36.903680
2015-04-14T15:40:09
2015-04-14T15:40:09
33,902,809
3
0
null
null
null
null
UTF-8
Java
false
false
3,416
java
package android.support.v4.app; import android.app.Activity; import android.content.Intent; import android.os.Build.VERSION; import android.os.Bundle; import android.support.v4.content.ContextCompat; public class ActivityCompat extends ContextCompat { private static ActivityCompat21.SharedElementCallback21 createCallback(SharedElementCallback paramSharedElementCallback) { ActivityCompat.SharedElementCallback21Impl localSharedElementCallback21Impl = null; if (paramSharedElementCallback != null) { localSharedElementCallback21Impl = new ActivityCompat.SharedElementCallback21Impl(paramSharedElementCallback); } return localSharedElementCallback21Impl; } public static void finishAffinity(Activity paramActivity) { if (Build.VERSION.SDK_INT >= 16) { ActivityCompatJB.finishAffinity(paramActivity); } for (;;) { return; paramActivity.finish(); } } public static void finishAfterTransition(Activity paramActivity) { if (Build.VERSION.SDK_INT >= 21) { ActivityCompat21.finishAfterTransition(paramActivity); } for (;;) { return; paramActivity.finish(); } } public static boolean invalidateOptionsMenu(Activity paramActivity) { if (Build.VERSION.SDK_INT >= 11) { ActivityCompatHoneycomb.invalidateOptionsMenu(paramActivity); } for (boolean bool = true;; bool = false) { return bool; } } public static void postponeEnterTransition(Activity paramActivity) { if (Build.VERSION.SDK_INT >= 21) { ActivityCompat21.postponeEnterTransition(paramActivity); } } public static void setEnterSharedElementCallback(Activity paramActivity, SharedElementCallback paramSharedElementCallback) { if (Build.VERSION.SDK_INT >= 21) { ActivityCompat21.setEnterSharedElementCallback(paramActivity, createCallback(paramSharedElementCallback)); } } public static void setExitSharedElementCallback(Activity paramActivity, SharedElementCallback paramSharedElementCallback) { if (Build.VERSION.SDK_INT >= 21) { ActivityCompat21.setExitSharedElementCallback(paramActivity, createCallback(paramSharedElementCallback)); } } public static void startActivity(Activity paramActivity, Intent paramIntent, Bundle paramBundle) { if (Build.VERSION.SDK_INT >= 16) { ActivityCompatJB.startActivity(paramActivity, paramIntent, paramBundle); } for (;;) { return; paramActivity.startActivity(paramIntent); } } public static void startActivityForResult(Activity paramActivity, Intent paramIntent, int paramInt, Bundle paramBundle) { if (Build.VERSION.SDK_INT >= 16) { ActivityCompatJB.startActivityForResult(paramActivity, paramIntent, paramInt, paramBundle); } for (;;) { return; paramActivity.startActivityForResult(paramIntent, paramInt); } } public static void startPostponedEnterTransition(Activity paramActivity) { if (Build.VERSION.SDK_INT >= 21) { ActivityCompat21.startPostponedEnterTransition(paramActivity); } } } /* Location: C:\Users\dreadiscool\Desktop\tools\classes-dex2jar.jar * Qualified Name: android.support.v4.app.ActivityCompat * JD-Core Version: 0.7.0.1 */
[ "paras@protrafsolutions.com" ]
paras@protrafsolutions.com
95df78599aa963923a1b39f06206ed5c8dabd9aa
40df4983d86a3f691fc3f5ec6a8a54e813f7fe72
/app/src/main/java/com/tencent/stat/event/C1745j.java
7cd434d38c2a906c5168b59ff40b2af04d55f9f9
[]
no_license
hlwhsunshine/RootGeniusTrunAK
5c63599a939b24a94c6f083a0ee69694fac5a0da
1f94603a9165e8b02e4bc9651c3528b66c19be68
refs/heads/master
2020-04-11T12:25:21.389753
2018-12-24T10:09:15
2018-12-24T10:09:15
161,779,612
0
0
null
null
null
null
UTF-8
Java
false
false
1,330
java
package com.tencent.stat.event; import android.content.Context; import com.tencent.stat.NetworkManager; import com.tencent.stat.StatSpecifyReportedInfo; import com.tencent.stat.common.StatCommonHelper; import com.tencent.stat.common.Util; import org.json.JSONObject; /* renamed from: com.tencent.stat.event.j */ public class C1745j extends C1735f { /* renamed from: a */ private static String f5124a = null; /* renamed from: n */ private String f5125n = null; /* renamed from: o */ private String f5126o = null; public C1745j(Context context, int i, StatSpecifyReportedInfo statSpecifyReportedInfo) { super(context, i, statSpecifyReportedInfo); this.f5125n = NetworkManager.getInstance(context).getCurNetwrokName(); if (f5124a == null) { f5124a = StatCommonHelper.getSimOperator(context); } } /* renamed from: a */ public EventType mo7924a() { return EventType.NETWORK_MONITOR; } /* renamed from: a */ public void mo7939a(String str) { this.f5126o = str; } /* renamed from: a */ public boolean mo7925a(JSONObject jSONObject) { Util.jsonPut(jSONObject, "op", f5124a); Util.jsonPut(jSONObject, "cn", this.f5125n); jSONObject.put("sp", this.f5126o); return true; } }
[ "603820467@qq.com" ]
603820467@qq.com
d5a3c7f3436e2cef0375b81fb54bbc5d947cb179
c8b19d39165d506c5d455be4bd85a1d40abb2424
/src/main/java/edu/gzhu/its/humanism/web/HumanismController.java
c371333c71deb18956a4d363578a02ffd9143f17
[]
no_license
dinggz1982/DingDing-Tutoring-System
2b21be75cd77afadf70bc20b3f686cf940ea3f34
69c245c0e1e4de3dba3e7de33953383f4892d865
refs/heads/master
2022-07-23T09:40:11.128802
2019-11-27T18:28:45
2019-11-27T18:28:45
202,401,808
0
1
null
2022-06-29T17:34:40
2019-08-14T18:07:56
JavaScript
UTF-8
Java
false
false
782
java
package edu.gzhu.its.humanism.web; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; /** * 人文性知识图谱 入口 * <p>Title : HumanismController</p> * <p>Description : </p> * <p>Company : </p> * @author 丁国柱 * @date 2018年7月11日 下午4:24:00 */ @Controller @RequestMapping("/humanism") public class HumanismController { /** * 群体-人文性知识图谱入口 * <p>方法名:index </p> * <p>Description : </p> * <p>Company : </p> * @author 丁国柱 * @date 2018年7月11日 下午4:25:10 * @return */ @GetMapping("/index") public String index(){ return "humanism/index"; } }
[ "dgz888@163.com" ]
dgz888@163.com
597f176f31c7e2e58dd1fd37da47a1bd98990460
b218169eb27975819fe771b226430ac0759af53c
/Star Ticket User/src/com/ignite/mm/ticketing/user/PromotionActivity.java
05bb71cbff2bba36235d4c265e167d7268624012
[]
no_license
ignitemyanmar/starticketandroid
23b40ba44040d1ea6bf238f980fc6261a3c666fa
69c8e2ed3172f9d08489bf68cc998ffcafb2d5f9
refs/heads/master
2021-06-12T18:39:09.390898
2017-02-27T10:32:05
2017-02-27T10:32:05
37,309,842
0
0
null
null
null
null
UTF-8
Java
false
false
3,293
java
package com.ignite.mm.ticketing.user; import java.util.ArrayList; import java.util.List; import retrofit.Callback; import retrofit.RetrofitError; import retrofit.client.Response; import android.app.ActionBar; import android.app.ProgressDialog; import android.content.Intent; import android.os.Bundle; import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.ImageButton; import android.widget.ListView; import android.widget.RelativeLayout; import android.widget.TextView; import com.ignite.mm.ticketing.application.BaseActivity; import com.ignite.mm.ticketing.clientapi.NetworkEngine; import com.ignite.mm.ticketing.custom.listview.adapter.PromotionAdapter; import com.ignite.mm.ticketing.sqlite.database.model.Promotion; import com.thuongnh.zprogresshud.ZProgressHUD; public class PromotionActivity extends BaseActivity{ private ListView lv_promotion; private ActionBar actionBar; private TextView actionBarTitle; private TextView actionBarTitle2; private ImageButton actionBarBack; private RelativeLayout layout_noPromotion; private ZProgressHUD dialog; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.activity_promotion); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); if (toolbar != null) { toolbar.setNavigationIcon(R.drawable.abc_ic_ab_back_mtrl_am_alpha); toolbar.setTitle("ပ႐ုိမိုရွင္း"); this.setSupportActionBar(toolbar); } layout_noPromotion = (RelativeLayout)findViewById(R.id.layout_noPromotion); lv_promotion = (ListView)findViewById(R.id.lv_promotion); lv_promotion.setDividerHeight(0); List<String> listOperatorPromo = new ArrayList<String>(); listOperatorPromo.add("မႏၱလာမင္း"); listOperatorPromo.add("Elite"); listOperatorPromo.add("ေရႊမႏၱလာ"); /*listOperatorPromo.add("မုိးေကာင္းကင္"); listOperatorPromo.add("Asia Express "); listOperatorPromo.add("အာကာသ"); listOperatorPromo.add("တုိးရတနာ");*/ getPromo(); } private void getPromo() { // TODO Auto-generated method stub dialog = new ZProgressHUD(PromotionActivity.this); dialog.show(); NetworkEngine.getInstance().GetPromotion(new Callback<List<Promotion>>() { public void success(List<Promotion> arg0, Response arg1) { // TODO Auto-generated method stub if (arg0 != null && arg0.size() > 0) { lv_promotion.setAdapter(new PromotionAdapter(PromotionActivity.this, arg0)); }else { layout_noPromotion.setVisibility(View.VISIBLE); lv_promotion.setAdapter(null); } dialog.dismissWithSuccess(); } public void failure(RetrofitError arg0) { // TODO Auto-generated method stub if (arg0.getResponse() != null) { Log.i("", "Promo Error: "+arg0.getResponse().getStatus()); } dialog.dismissWithFailure(); } }); } @Override public Intent getSupportParentActivityIntent() { // TODO Auto-generated method stub finish(); return super.getSupportParentActivityIntent(); } }
[ "suwaiphyo1985@gmail.com" ]
suwaiphyo1985@gmail.com
638b363499dc26c14c3021756a144dfc37b00aa4
23458bdfb7393433203985569e68bc1935a022d6
/NDC-GraphQL-Client/src/generated-sources/java/org/iata/oo/schema/AirShoppingRS/AgencyIDType.java
c9a1561bb5873d213ace8c74b5a08c721a780f77
[]
no_license
joelmorales/NDC
7c6baa333c0285b724e6356bd7ae808f1f74e7ec
ebddd30369ec74e078a2c9996da0402f9ac448a1
refs/heads/master
2021-06-30T02:49:12.522375
2019-06-13T14:55:05
2019-06-13T14:55:05
171,594,242
1
0
null
2020-10-13T12:03:33
2019-02-20T03:29:16
Java
UTF-8
Java
false
false
1,111
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 // 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: 2019.03.05 at 04:34:49 PM CST // package org.iata.oo.schema.AirShoppingRS; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; /** * A data type for Agency (Seller) ID. * * <p>Java class for AgencyID_Type complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="AgencyID_Type"> * &lt;simpleContent> * &lt;extension base="&lt;http://www.iata.org/IATA/EDIST/2017.2>UniqueIDContextType"> * &lt;/extension> * &lt;/simpleContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "AgencyID_Type") public class AgencyIDType extends UniqueIDContextType { }
[ "joel.moralesmorales@hotmail.com" ]
joel.moralesmorales@hotmail.com
73b3ef7d9535cc88e75ef2a43a09d4a41845a44d
f2abd88aeb49c0bb58370354b1b06c02896f8190
/src/main/java/iq/kurd/com/exception/MsgException.java
903ad134ad3b4d2594126ed478e766a7cbe6f672
[]
no_license
jinkookjeong/KURD
3b865553175b2f79d25d484732027861d54f9154
a4f83a1602ea12e0df37f9e46e91f2719d54cf82
refs/heads/master
2020-04-09T04:54:27.655479
2018-12-04T11:57:48
2018-12-04T11:57:48
158,838,276
0
0
null
null
null
null
UTF-8
Java
false
false
372
java
package iq.kurd.com.exception; /** * 화면에 에러 메세지 전달용 * @author jwchoi * */ public class MsgException extends Exception { private static final long serialVersionUID = -3029187880941733652L; public MsgException(String msg){ super(msg); } public MsgException(String msg, Throwable cause){ super(msg, cause); } }
[ "user@user-PC" ]
user@user-PC
e92766da6e5fc10d81985ebeb312b312a3e337be
47e4d883a939b4b9961ba2a9387b1d4616bbc653
/src/org/sxb/mail/mock/MockFetchMailPro.java
b7138ff24c0e37013462cb4e186d21eb7b7271c0
[]
no_license
jeffson1985/sxb
196f5e4e29072bf060467f2f8cd312b76b2af124
addf8debad2449cf1bc5920c7fd7ea87ab0855f0
refs/heads/master
2020-05-29T16:56:44.582291
2015-09-09T01:18:04
2015-09-09T01:18:04
42,148,048
0
0
null
null
null
null
UTF-8
Java
false
false
7,025
java
package org.sxb.mail.mock; import java.util.ArrayList; import java.util.List; import javax.mail.internet.MimeMessage; import org.sxb.log.Logger; import org.sxb.mail.MailException; import org.sxb.mail.NotConnectedException; import org.sxb.mail.fetch.FetchMailPro; import org.sxb.mail.fetch.ReceivedMail; /** * FetchMailProImplクラスのMock。 * * @since 1.2 * @author Jeffson (jeffson.app@gmail.com) * @version $Id: MockFetchMailPro.java,v 1.1.2 */ public class MockFetchMailPro implements FetchMailPro { private static Logger log = Logger.getLogger(MockFetchMailPro.class); /** デフォルトのSMTPサーバ。「localhost」 */ public static final String DEFAULT_HOST = "localhost"; /** デフォルトのプロトコル。「pop3」 */ public static final String DEFAULT_PROTOCOL = "pop3"; /** * デフォルトのポート。「-1」<br> * -1はプロトコルに応じた適切なポートを設定する特別な値。 */ public static final int DEFAULT_PORT = -1; @SuppressWarnings("unused") private static final String INBOX_NAME = "INBOX"; private String host = DEFAULT_HOST; private String protocol = DEFAULT_PROTOCOL; private int port = DEFAULT_PORT; private String username; private String password; private boolean javaMailLogEnabled; private boolean connected = false; private List<ReceivedMail> receivedMails; /** * コンストラクタ。 */ public MockFetchMailPro() { super(); receivedMails = new ArrayList<ReceivedMail>(); } /** * @see org.sxb.mail.fetch.FetchMailPro#connect() */ public synchronized void connect() throws MailException { if (isConnected()) { log.warn("既にサーバ[" + host + "]に接続されています。再接続するには先に接続を切断する必要があります。"); return; } log.debug(protocol.toUpperCase() + "サーバ[" + host + "]に接続するフリ。"); connected = true; log.info(protocol.toUpperCase() + "サーバ[" + host + "]に接続したフリ。"); } /** * @see org.sxb.mail.fetch.FetchMailPro#disconnect() */ public synchronized void disconnect() throws MailException { if (isConnected()) { log.debug(protocol.toUpperCase() + "サーバ[" + host + "]との接続を切断するフリ。"); connected = false; log.debug(protocol.toUpperCase() + "サーバ[" + host + "]との接続を切断したフリ。"); } } /** * <code>MockFetchMailPro</code>の<code>getMails()</code>メソッドが返す * <code>ReceivedMail</code>インスタンスをセットします。 * * @param mail <code>getMails()</code>メソッドが返す<code>ReceivedMail</code>インスタンス */ public void setupGetMails(ReceivedMail mail) { receivedMails.add(mail); } /** * <code>MockFetchMailPro</code>の<code>getMails()</code>メソッドが返す * <code>ReceivedMail</code>インスタンスをセットします。 * * @param mails <code>getMails()</code>メソッドが返す<code>ReceivedMail</code>インスタンス配列 */ public void setupGetMails(ReceivedMail[] mails) { for (int i = 0; i < mails.length; i++) { ReceivedMail mail = mails[i]; setupGetMails(mail); } } /** * @see org.sxb.mail.fetch.FetchMailPro#getMailCount() */ public int getMailCount() throws MailException { return receivedMails.size(); } /** * @see org.sxb.mail.fetch.FetchMailPro#getMail(int) */ public synchronized ReceivedMail getMail(int num) throws MailException { return getMail(num, false); } /** * @see org.sxb.mail.fetch.FetchMailPro#getMail(int, boolean) */ public synchronized ReceivedMail getMail(int num, boolean delete) throws MailException { if (isConnected()) { if (delete) { return (ReceivedMail)receivedMails.remove(num - 1); } else { return (ReceivedMail)receivedMails.get(num - 1); } } else { throw new NotConnectedException(protocol.toUpperCase() + "サーバ[" + host + "]に接続されていません。"); } } /** * @see org.sxb.mail.fetch.FetchMailPro#getMails(boolean) */ public synchronized ReceivedMail[] getMails(boolean delete) throws MailException { if (isConnected()) { ReceivedMail[] results = (ReceivedMail[])receivedMails .toArray(new ReceivedMail[receivedMails.size()]); if (delete) { receivedMails.clear(); } return results; } else { throw new NotConnectedException(protocol.toUpperCase() + "サーバ[" + host + "]に接続されていません。"); } } /** * @see org.sxb.mail.fetch.FetchMailPro#getMessage(int) */ public MimeMessage getMessage(int num) throws MailException { throw new UnsupportedOperationException("申し訳ございません。MockFetchMailProでは、このメソッドをサポートしていません。"); } /** * @see org.sxb.mail.fetch.FetchMailPro#getMessages(boolean) */ public MimeMessage[] getMessages(boolean delete) throws MailException { throw new UnsupportedOperationException("申し訳ございません。MockFetchMailProでは、このメソッドをサポートしていません。"); } /** * @see org.sxb.mail.fetch.FetchMailPro#changeFolder(java.lang.String) */ public synchronized void changeFolder(String folderName) throws MailException { if (!isConnected()) { log.warn("メールサーバに接続されていません。"); return; } log.debug("メッセージフォルダ[" + folderName + "]をオープンするフリ。"); log.debug("メッセージフォルダ[" + folderName + "]をオープンしたフリ。"); } /** * @see org.sxb.mail.fetch.FetchMailPro#isConnected() */ public boolean isConnected() { return connected; } /** * @return Returns the host. */ public String getHost() { return host; } /** * @param host The host to set. */ public void setHost(String host) { this.host = host; } /** * @return Returns the javaMailLogEnabled. */ public boolean isJavaMailLogEnabled() { return javaMailLogEnabled; } /** * @param javaMailLogEnabled The javaMailLogEnabled to set. */ public void setJavaMailLogEnabled(boolean javaMailLogEnabled) { this.javaMailLogEnabled = javaMailLogEnabled; } /** * @return Returns the password. */ public String getPassword() { return password; } /** * @param password The password to set. */ public void setPassword(String password) { this.password = password; } /** * @return Returns the port. */ public int getPort() { return port; } /** * @param port The port to set. */ public void setPort(int port) { this.port = port; } /** * @return Returns the protocol. */ public String getProtocol() { return protocol; } /** * @param protocol The protocol to set. */ public void setProtocol(String protocol) { this.protocol = protocol; } /** * @return Returns the username. */ public String getUsername() { return username; } /** * @param username The username to set. */ public void setUsername(String username) { this.username = username; } }
[ "kevionsun@gmail.com" ]
kevionsun@gmail.com
de7ffbf8e8933fc8d8ad5cb4d0f1990912ee47c2
9f1768d88e343aab3c8a351ade5059e7a73af30c
/nfsdb-core/src/main/java/com/nfsdb/journal/column/SymbolTable.java
137d8c58631f1e8e75b048786feea7460dfcbda9
[]
no_license
gitter-badger/nfsdb
46bd260a176139684faf2c81e3a9d591de275f31
67b4cfb8bb39956e1238ee2eae1c58dcc83188c8
refs/heads/master
2021-01-18T00:01:48.128654
2014-12-10T16:14:33
2014-12-10T16:14:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,503
java
/* * Copyright (c) 2014-2015. Vlad Ilyushchenko * * 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.nfsdb.journal.column; import com.nfsdb.journal.JournalMode; import com.nfsdb.journal.collections.AbstractImmutableIterator; import com.nfsdb.journal.collections.ObjIntHashMap; import com.nfsdb.journal.exceptions.JournalException; import com.nfsdb.journal.exceptions.JournalInvalidSymbolValueException; import com.nfsdb.journal.exceptions.JournalRuntimeException; import com.nfsdb.journal.index.Cursor; import com.nfsdb.journal.index.KVIndex; import com.nfsdb.journal.utils.ByteBuffers; import com.nfsdb.journal.utils.Checksum; import com.nfsdb.journal.utils.Lists; import java.io.Closeable; import java.io.File; import java.util.ArrayList; public class SymbolTable implements Closeable { public static final int VALUE_NOT_FOUND = -2; public static final int VALUE_IS_NULL = -1; private static final String DATA_FILE_SUFFIX = ".symd"; private static final String INDEX_FILE_SUFFIX = ".symi"; private static final String HASH_INDEX_FILE_SUFFIX = ".symr"; private static final double CACHE_LOAD_FACTOR = 0.2; private final int hashKeyCount; private final String column; private final ObjIntHashMap<String> valueCache; private final ArrayList<String> keyCache; private final boolean noCache; private VariableColumn data; private KVIndex index; private int size; public SymbolTable(int keyCount, int avgStringSize, int txCountHint, File directory, String column, JournalMode mode, int size, long indexTxAddress, boolean noCache) throws JournalException { // number of hash keys stored in index // assume it is 20% of stated capacity this.hashKeyCount = Math.max(1, (int) (keyCount * CACHE_LOAD_FACTOR)); this.column = column; this.noCache = noCache; JournalMode m; switch (mode) { case BULK_APPEND: m = JournalMode.APPEND; break; case BULK_READ: m = JournalMode.READ; break; default: m = mode; } MappedFile dataFile = new MappedFileImpl(new File(directory, column + DATA_FILE_SUFFIX), ByteBuffers.getBitHint(avgStringSize * 2 + 4, keyCount), m); MappedFile indexFile = new MappedFileImpl(new File(directory, column + INDEX_FILE_SUFFIX), ByteBuffers.getBitHint(8, keyCount), m); this.data = new VariableColumn(dataFile, indexFile); this.size = size; this.index = new KVIndex(new File(directory, column + HASH_INDEX_FILE_SUFFIX), this.hashKeyCount, keyCount, txCountHint, mode, indexTxAddress); this.valueCache = new ObjIntHashMap<>(noCache ? 0 : keyCount, VALUE_NOT_FOUND); this.keyCache = new ArrayList<>(noCache ? 0 : keyCount); } public void applyTx(int size, long indexTxAddress) { this.size = size; this.index.setTxAddress(indexTxAddress); } public void alignSize() { this.size = (int) data.size(); } public int put(String value) { int key = getQuick(value); if (key == VALUE_NOT_FOUND) { key = (int) data.putStr(value); data.commit(); index.add(hashKey(value), key); size++; cache(key, value); } return key; } public int getQuick(String value) { if (!noCache) { int key = value == null ? VALUE_IS_NULL : this.valueCache.get(value); if (key != VALUE_NOT_FOUND) { return key; } } int hashKey = hashKey(value); if (!index.contains(hashKey)) { return VALUE_NOT_FOUND; } Cursor cursor = index.cachedCursor(hashKey); while (cursor.hasNext()) { int key; if (data.cmpStr((key = (int) cursor.next()), value)) { cache(key, value); return key; } } return VALUE_NOT_FOUND; } public int get(String value) { int result = getQuick(value); if (result == VALUE_NOT_FOUND) { throw new JournalInvalidSymbolValueException("Invalid value %s for symbol %s", value, column); } else { return result; } } public boolean valueExists(String value) { return getQuick(value) != VALUE_NOT_FOUND; } public String value(int key) { if (key >= size) { throw new JournalRuntimeException("Invalid symbol key: " + key); } String value = key < keyCache.size() ? keyCache.get(key) : null; if (value == null) { cache(key, value = data.getStr(key)); } return value; } public Iterable<String> values() { return new AbstractImmutableIterator<String>() { private final long size = SymbolTable.this.size(); private long current = 0; @Override public boolean hasNext() { return current < size; } @Override public String next() { return data.getStr(current++); } }; } public int size() { return size; } public void close() { if (data != null) { data.close(); } if (index != null) { index.close(); } index = null; data = null; } public void truncate() { truncate(0); } public void truncate(int size) { if (size() > size) { data.truncate(size); index.truncate(size); data.commit(); clearCache(); this.size = size; } } public void updateIndex(int oldSize, int newSize) { if (oldSize < newSize) { for (int i = oldSize; i < newSize; i++) { index.add(hashKey(data.getStr(i)), i); } } } public VariableColumn getDataColumn() { return data; } public SymbolTable preLoad() { for (int key = 0, size = (int) data.size(); key < size; key++) { String value = data.getStr(key); valueCache.putIfAbsent(value, key); keyCache.add(value); } return this; } public long getIndexTxAddress() { return index.getTxAddress(); } public void commit() { data.commit(); index.commit(); } public void force() { data.force(); index.force(); } private void cache(int key, String value) { if (noCache) { return; } valueCache.put(value, key); Lists.advance(keyCache, key); keyCache.set(key, value); } private void clearCache() { valueCache.clear(); keyCache.clear(); } private int hashKey(String value) { return Checksum.hash(value, hashKeyCount); } }
[ "bluestreak@gmail.com" ]
bluestreak@gmail.com
ec32ebc3bc709603126661656dd8d4969248eb1b
1fc6412873e6b7f6df6c9333276cd4aa729c259f
/ThinkingInJava/src/com/thinking4/initialization/Mugs.java
d2f7ec4592fe26f9cf4e26324ee864311dc10c14
[]
no_license
youzhibicheng/ThinkingJava
dbe9bec5b17e46c5c781a98f90e883078ebbd996
5390a57100ae210dc57bea445750c50b0bfa8fc4
refs/heads/master
2021-01-01T05:29:01.183768
2016-05-10T01:07:58
2016-05-10T01:07:58
58,379,014
1
2
null
null
null
null
WINDOWS-1252
Java
false
false
936
java
package com.thinking4.initialization; //: initialization/Mugs.java // Java "Instance Initialization." import static com.thinking4.util.Print.*; // mug n. Á³£»±­×Ó£»¿à¶ÁÕß class Mug { Mug(int marker) { print("Mug(" + marker + ")"); } void f(int marker) { print("f(" + marker + ")"); } } public class Mugs { Mug mug1; Mug mug2; { mug1 = new Mug(1); mug2 = new Mug(2); print("mug1 & mug2 initialized"); } Mugs() { print("Mugs()"); } Mugs(int i) { print("Mugs(int)"); } public static void main(String[] args) { print("Inside main()"); new Mugs(); print("new Mugs() completed"); new Mugs(1); print("new Mugs(1) completed"); } } /* Output: Inside main() Mug(1) Mug(2) mug1 & mug2 initialized Mugs() new Mugs() completed Mug(1) Mug(2) mug1 & mug2 initialized Mugs(int) new Mugs(1) completed *///:~
[ "youzhibicheng@163.com" ]
youzhibicheng@163.com
28e355df986db5f761734465c534f9ac806cc041
5e224ff6d555ee74e0fda6dfa9a645fb7de60989
/database/src/main/java/adila/db/zm1_infocus20m808i.java
d2bed4535ec67a74417b1bd5f7a250ec5cc7eae8
[ "MIT" ]
permissive
karim/adila
8b0b6ba56d83f3f29f6354a2964377e6197761c4
00f262f6d5352b9d535ae54a2023e4a807449faa
refs/heads/master
2021-01-18T22:52:51.508129
2016-11-13T13:08:04
2016-11-13T13:08:04
45,054,909
3
1
null
null
null
null
UTF-8
Java
false
false
218
java
// This file is automatically generated. package adila.db; /* * InFocus M808i * * DEVICE: ZM1 * MODEL: InFocus M808i */ final class zm1_infocus20m808i { public static final String DATA = "InFocus|M808i|"; }
[ "keldeeb@gmail.com" ]
keldeeb@gmail.com