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
c4e1609b26e4d8f9c94fa45843c68b3915663420
f43ef1add051d76fe84b0f69092ad305929116a5
/autotest/Tests/src/main/java/com/tle/webtests/pageobject/wizard/RejectMessagePage.java
bfdf89892ab890e68295fc7b1eef61c4c05c1f33
[ "Apache-2.0", "LGPL-3.0-only", "LicenseRef-scancode-warranty-disclaimer", "BSD-3-Clause", "EPL-1.0", "LGPL-2.0-or-later", "Classpath-exception-2.0", "LicenseRef-scancode-jdom", "ICU", "Apache-1.1", "LGPL-2.1-only", "LicenseRef-scancode-other-permissive", "GPL-1.0-or-later", "CPL-1.0", "CDDL-1.0", "MIT", "LicenseRef-scancode-freemarker", "GPL-2.0-only", "NetCDF", "CDDL-1.1" ]
permissive
PenghaiZhang/openEQUELLA
93d29f9dab013e2fa19a9a7ae4d71cac2c7269bb
c2da9954bd4768e785b3b2f281305c16936f4511
refs/heads/develop
2023-07-20T02:20:23.684651
2023-07-19T00:12:20
2023-07-19T00:12:20
207,188,550
0
0
Apache-2.0
2020-06-17T13:08:07
2019-09-08T23:51:30
Java
UTF-8
Java
false
false
328
java
package com.tle.webtests.pageobject.wizard; import com.tle.webtests.framework.PageContext; public class RejectMessagePage extends ModerationMessagePage<RejectMessagePage> { public RejectMessagePage(PageContext context) { super(context); } @Override public String getPfx() { return "_tasksrejectDialog"; } }
b50fa20100685ad2f985169a2a93b43660a24cbe
cff0fb603e9ed819e9ec5f8536b07fad3ab4a123
/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/datasources/RemoveDatasourceOfflineTest.java
9aa6fd6a3e42288094f3c3e5db0481bf7888b889
[ "Apache-2.0" ]
permissive
ochaloup/creaper
d3b0e236592ce312b967fa0fad0b05d7dcaffdc3
d0d03353b1d910cb0f35c3d7dec78aaf2d01b67f
refs/heads/master
2020-05-29T11:42:38.594286
2016-09-16T09:36:05
2016-09-16T09:36:05
45,603,134
1
0
null
2015-11-05T10:06:19
2015-11-05T10:06:18
null
UTF-8
Java
false
false
3,575
java
package org.wildfly.extras.creaper.commands.datasources; import com.google.common.base.Charsets; import com.google.common.io.Files; import org.custommonkey.xmlunit.XMLUnit; import org.jboss.logging.Logger; import org.wildfly.extras.creaper.core.CommandFailedException; import org.wildfly.extras.creaper.core.ManagementClient; import org.wildfly.extras.creaper.core.offline.OfflineManagementClient; import org.wildfly.extras.creaper.core.offline.OfflineOptions; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; import java.io.File; import static org.wildfly.extras.creaper.XmlAssert.assertXmlIdentical; import static org.junit.Assert.fail; public class RemoveDatasourceOfflineTest { private static final Logger log = Logger.getLogger(RemoveDatasourceOfflineTest.class); private static final String SUBSYSTEM_ORIGINAL = "" + "<server xmlns=\"urn:jboss:domain:1.7\">\n" + " <profile>\n" + " <subsystem xmlns=\"urn:jboss:domain:datasources:1.2\">\n" + " <datasources>\n" + " <datasource pool-name=\"creaper-ds\" jndi-name=\"java:/jboss/datasources/creaper-ds\" enabled=\"false\">\n" + " <connection-url>jdbc:h2:mem:test-creaper;DB_CLOSE_DELAY=-1;</connection-url>\n" + " <driver>h2</driver>\n" + " <security>\n" + " <user-name>creaper</user-name>\n" + " <password>creaper</password>\n" + " </security>\n" + " </datasource>\n" + " </datasources>\n" + " </subsystem>\n" + " </profile>\n" + "</server>"; private static final String SUBSYSTEM_EXPECTED = "" + "<server xmlns=\"urn:jboss:domain:1.7\">\n" + " <profile>\n" + " <subsystem xmlns=\"urn:jboss:domain:datasources:1.2\">\n" + " <datasources/>\n" + " </subsystem>\n" + " </profile>\n" + "</server>"; @Rule public final TemporaryFolder tmp = new TemporaryFolder(); @Before public void setUp() { XMLUnit.setNormalizeWhitespace(true); } @Test public void transform() throws Exception { File cfg = tmp.newFile("xmlTransform.xml"); Files.write(SUBSYSTEM_ORIGINAL, cfg, Charsets.UTF_8); OfflineManagementClient client = ManagementClient.offline( OfflineOptions.standalone().configurationFile(cfg).build()); assertXmlIdentical(SUBSYSTEM_ORIGINAL, Files.toString(cfg, Charsets.UTF_8)); client.apply(new RemoveDataSource("creaper-ds")); assertXmlIdentical(SUBSYSTEM_EXPECTED, Files.toString(cfg, Charsets.UTF_8)); } @Test(expected = CommandFailedException.class) public void transformDsNotExists() throws Exception { File cfg = tmp.newFile("xmlTransform.xml"); Files.write(SUBSYSTEM_ORIGINAL, cfg, Charsets.UTF_8); OfflineManagementClient client = ManagementClient.offline( OfflineOptions.standalone().configurationFile(cfg).build()); assertXmlIdentical(SUBSYSTEM_ORIGINAL, Files.toString(cfg, Charsets.UTF_8)); client.apply(new RemoveDataSource("creaper-ds-not-existing")); fail("The datasource should not exist in configuration, so an exception should be thrown"); } }
36eb8cb257b7cd48aab354d38eed4284e6ae952c
bc794d54ef1311d95d0c479962eb506180873375
/kerenrh/kerenrh-components/core-components/core-ifaces/src/main/java/com/keren/core/ifaces/formations/BesionFormationManager.java
728bc27f8ce7d3facea63008394c4682c5643996
[]
no_license
Teratech2018/Teratech
d1abb0f71a797181630d581cf5600c50e40c9663
612f1baf9636034cfa5d33a91e44bbf3a3f0a0cb
refs/heads/master
2021-04-28T05:31:38.081955
2019-04-01T08:35:34
2019-04-01T08:35:34
122,177,253
0
0
null
null
null
null
UTF-8
Java
false
false
866
java
package com.keren.core.ifaces.formations; import com.bekosoftware.genericmanagerlayer.core.ifaces.GenericManager; import com.keren.model.formations.BesionFormation; import com.keren.model.formations.GenererBesionFormation; /** * Interface etendue par les interfaces locale et remote du manager * @since Tue Apr 10 13:14:14 GMT+01:00 2018 * */ public interface BesionFormationManager extends GenericManager<BesionFormation, Long> { public final static String SERVICE_NAME = "BesionFormationManager"; /** * Validation * @param entity * @return */ public BesionFormation valide(BesionFormation entity); /** * Generation du Besion de formation a partir * @param entity * @return */ public BesionFormation genererBF(GenererBesionFormation entity); }
b6f0019b2eefc0ad89e097fc4b7d96d7fc7d5555
5ab7847099facc656502fb541472c684b556ccb0
/Java_001_Value/src/com/callor/values/Values_05.java
0534aa2c376b17d3e49765480aec494966d427f7
[]
no_license
hooninfinity/Biz_403_2021_03_Java
0c6626e6a2cdace5f3cae627b276c6d3e37907df
f66cd82738be7dfa6ebed0b01f2e06ab89f1363a
refs/heads/master
2023-06-24T04:28:43.616426
2021-07-26T08:38:30
2021-07-26T08:38:30
348,207,344
0
0
null
null
null
null
UTF-8
Java
false
false
744
java
package com.callor.values; public class Values_05 { public static void main(String[] args) { // 코드에서 동등연산자(==) // 어떤 값이 같은지 물어보는 것 // 값이 같으면 결과는 true // 값이 다르면 결과는 false System.out.println(3 == 3); System.out.println(4 == 3); System.out.println(5 == 1); System.out.println(3 > 3); System.out.println(3 < 3); System.out.println(4 > 3); System.out.println(4 < 3); System.out.println(3 >= 3); System.out.println(3 <= 3); System.out.println(4 >= 3); System.out.println(4 <= 3); // != : 값이 서로 같지 않는가? System.out.println(3 != 3); // System.out.println(3 <> 3); System.out.println(); } }
6e8689dcd6d51deb5048110b49d53eaef7c4ec33
34ca1f61216675c5779ba73c74ed1f8c1c603e40
/mynlp/src/main/java/com/mayabot/nlp/segment/CharNormalize.java
7f82031e6f617f33ca9e8ef55920fa957d95012e
[ "Apache-2.0" ]
permissive
mayabot/mynlp
d827f26f37e6ad13212a75152269ec551998fb3e
cf40957e83c23b2eafcd5e56d8019d37bcd6222d
refs/heads/master
2023-09-05T09:25:43.459488
2023-06-26T06:10:04
2023-06-26T06:10:04
113,726,044
698
93
Apache-2.0
2020-11-12T09:16:41
2017-12-10T05:35:01
Java
UTF-8
Java
false
false
1,103
java
/* * Copyright 2018 mayabot.com authors. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.mayabot.nlp.segment; /** * 字符规范化接口 * <p> * 分词之前可以对char进行转换。一般完成大小写、半全角、归一化转换的需求. * * @author jimichan * @see com.mayabot.nlp.segment.common.DefaultCharNormalize */ public interface CharNormalize { /** * 对char数组里面的字符进行规范化操作,常见的有最小化和宽体字符处理 * * @param text */ void normal(char[] text); }
cd68392146f9e9408284aee2d4ec1da187384672
e8cd24201cbfadef0f267151ea5b8a90cc505766
/group05/810574652/src/com/github/PingPi357/coding2017/homework2/ArrayUtil.java
151dae82b6100b6ebf7223e9b539bb5450dbe921
[]
no_license
XMT-CN/coding2017-s1
30dd4ee886dd0a021498108353c20360148a6065
382f6bfeeeda2e76ffe27b440df4f328f9eafbe2
refs/heads/master
2021-01-21T21:38:42.199253
2017-06-25T07:44:21
2017-06-25T07:44:21
94,863,023
0
0
null
null
null
null
UTF-8
Java
false
false
5,088
java
package com.github.PingPi357.coding2017.homework2; import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Arrays; public class ArrayUtil { /** * 给定一个整形数组a , 对该数组的值进行置换 例如: a = [7, 9 , 30, 3] , 置换后为 [3, 30, 9,7] 如果 a = * [7, 9, 30, 3, 4] , 置换后为 [4,3, 30 , 9,7] * * @param origin * @return */ public int[] reverseArray(int[] origin) { int len = origin.length; int[] temp = new int[len]; for (int i = 0; i < len; i++) { temp[i] = origin[--len]; } return temp; } /** * 现在有如下的一个数组: int oldArr[]={1,3,4,5,0,0,6,6,0,5,4,7,6,7,0,5} * 要求将以上数组中值为0的项去掉,将不为0的值存入一个新的数组,生成的新数组为: {1,3,4,5,6,6,5,4,7,6,7,5} * * @param oldArray * @return */ public int[] removeZero(int[] oldArray) { int[] newArray = new int[oldArray.length]; int i = 0; for (int element : oldArray) { if (element != 0) { newArray[i++] = element; } } return newArray; } /** * 给定两个已经排序好的整形数组, a1和a2 , 创建一个新的数组a3, 使得a3 包含a1和a2 的所有元素, 并且仍然是有序的 例如 a1 = * [3, 5, 7,8] a2 = [4, 5, 6,7] 则 a3 为[3,4,5,6,7,8] , 注意: 已经消除了重复 * * @param array1 * @param array2 * @return */ public int[] merge(int[] array1, int[] array2) { ArrayList<Integer> list = new ArrayList<Integer>(); int k1=0; int k2 = 0; for (int i = 0; i < array1.length; i++) { for (int j = k2; j < array2.length; j++) { if (array1[i] < array2[j]) { list.add(array1[i]); k1++; break; } else if(array1[i] > array2[j]) { list.add(array2[j]); k2++; }else{ list.add(array1[i]); k1++; k2++; break; } } if(k2==array2.length-1){ for (; k1 <= array1.length-1 ; k1++) { list.add(array1[k1]); } break; } if(k1== array1.length-1){ for (; k2 <= array2.length-1 ; k2++) { list.add(array2[k2]); } break; } } int[] mergeArray = arrayListToArray(list); return mergeArray; } /** * 把一个已经存满数据的数组 oldArray的容量进行扩展, 扩展后的新数据大小为oldArray.length + size * 注意,老数组的元素在新数组中需要保持 例如 oldArray = [2,3,6] , size = 3,则返回的新数组为 * [2,3,6,0,0,0] * * @param oldArray * @param size * @return */ public int[] grow(int[] oldArray, int size) { int[] growArray = Arrays.copyOf(oldArray, oldArray.length + size); return growArray; } /** * 斐波那契数列为:1,1,2,3,5,8,13,21...... ,给定一个最大值, 返回小于该值的数列 例如, max = 15 , * 则返回的数组应该为 [1,1,2,3,5,8,13] max = 1, 则返回空数组 [] * * @param max * @return */ public int[] fibonacci(int max) { int a = 1; int b = 1; int fibMaxNum = 1; ArrayList<Integer> list=new ArrayList<Integer>(); list.add(1); if (max <= 1) { return new int[0]; } while (max > fibMaxNum) { list.add(fibMaxNum); fibMaxNum = a + b; b = fibMaxNum; a = b; } return arrayListToArray(list); } /** * 返回小于给定最大值max的所有素数数组 例如max = 23, 返回的数组为[2,3,5,7,11,13,17,19] * * @param max * @return */ public int[] getPrimes(int max) { ArrayList<Integer> list =new ArrayList<Integer>(); for(int i=2; i <=max-1;i++){ boolean flag=true; for(int j=2; j < Math.floor(i/2); j++){ if(i%j==0){ flag=false; break; } } if(!flag){ list.add(i); } } return arrayListToArray(list); } /** * 所谓“完数”, 是指这个数恰好等于它的因子之和,例如6=1+2+3 给定一个最大值max, 返回一个数组, 数组中是小于max 的所有完数 * * @param max * @return */ public int[] getPerfectNumbers(int max) { ArrayList<Integer> list =new ArrayList<Integer>(); int sum=0; if(max<=1){ return null; } for(int i=1;i <=(max-1);i++){ for(int j=1; j<=i/2;j++){ if(i%j==0){ sum+=j; } } if(sum==i){ list.add(i); } } return arrayListToArray(list); } /** * 用seperator 把数组 array给连接起来 例如array= [3,8,9], seperator = "-" 则返回值为"3-8-9" * * @param array * @param s * @return */ public String join(int[] array, String seperator) { StringBuilder sb=new StringBuilder(); sb.append(array[0]); for(int i=1;i<array.length;i++){ sb.append(seperator); sb.append(array[i]); } return sb.toString(); } private int[] arrayListToArray(ArrayList<?> list) { int[] Array = new int[list.size()]; for (int i = 0; i < list.size(); i++) { Array[i] = (int) list.get(i); } return Array; } }
3f10832de825c3ff0854642757e51d76f27adb86
e67b0d013bc41757234b97fa7f9c797efd3ca08e
/algorithms/src/main/java/com/isa/section4/chapter1/IMultiPaths.java
b25c5503b14d0e298de878a29583f71cbff09f3b
[]
no_license
vasu-kukkapalli/algorithms-1
591e266efe562f06b95aa2ee9e96855f31796faa
2c4a513806b9d036ad4c315b35eff53a1cb084b6
refs/heads/master
2021-08-27T17:16:20.530106
2017-05-07T11:31:40
2017-05-07T11:31:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
146
java
package com.isa.section4.chapter1; public interface IMultiPaths { boolean hasPathTo(int v, int w); Iterable<Integer> pathTo(int v, int w); }
e17cd0da7c2decfd4f73bc801f44da71f6c6a4a4
29b3fcab921b96404494e4a96f3209aed5baf5d9
/src/main/java/com/shgx/rocketmq/listener/MQConsumeMsgListenerProcessor.java
ed1d904e24edc3f3a67a3a03faf9143509105511
[]
no_license
guangxush/SpringBoot_RocketMQ
8a92cce6199b6b789809c649dd4ce76cf20bf49c
9f82f31a54b161db5083d16515193ef45170179d
refs/heads/master
2020-04-18T03:40:38.840957
2019-01-24T15:35:03
2019-01-24T15:35:03
167,208,393
0
0
null
null
null
null
UTF-8
Java
false
false
2,386
java
package com.shgx.rocketmq.listener; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; import org.apache.rocketmq.common.message.MessageExt; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; import org.springframework.util.CollectionUtils; import java.util.List; /** * @Description * @auther guangxush * @create 2019/1/23 */ @Component public class MQConsumeMsgListenerProcessor implements MessageListenerConcurrently { private static final Logger logger = LoggerFactory.getLogger(MQConsumeMsgListenerProcessor.class); /** * 默认msgs里只有一条消息,可以通过设置consumeMessageBatchMaxSize参数来批量接收消息<br/> * 不要抛异常,如果没有return CONSUME_SUCCESS ,consumer会重新消费该消息,直到return CONSUME_SUCCESS */ @Override public ConsumeConcurrentlyStatus consumeMessage(List<MessageExt> msgs, ConsumeConcurrentlyContext context) { if(CollectionUtils.isEmpty(msgs)){ logger.info("接受到的消息为空,不处理,直接返回成功"); return ConsumeConcurrentlyStatus.CONSUME_SUCCESS; } MessageExt messageExt = msgs.get(0); logger.info("接受到的消息为:"+messageExt.toString()); if(messageExt.getTopic().equals("你的Topic")){ if(messageExt.getTags().equals("你的Tag")){ //TODO 判断该消息是否重复消费(RocketMQ不保证消息不重复,如果你的业务需要保证严格的不重复消息,需要你自己在业务端去重) //TODO 获取该消息重试次数 int reconsume = messageExt.getReconsumeTimes(); if(reconsume ==3){//消息已经重试了3次,如果不需要再次消费,则返回成功 return ConsumeConcurrentlyStatus.CONSUME_SUCCESS; } //TODO 处理对应的业务逻辑 } } // 如果没有return success ,consumer会重新消费该消息,直到return success return ConsumeConcurrentlyStatus.CONSUME_SUCCESS; } }
a9d3898f60718c8bfe7ae5582201d114ed611c7a
ef9c39df1786e12ce75a5828634fc824bc40cd00
/src/org/uecide/themes/Nocturne.java
2d555339360bb475c87ad1a25653e5b9691df3a1
[]
no_license
UECIDE-Themes/theme-nocturne
cfac1d66a57cf0a55bf19f62064224bca91525c1
ff3c303d32d7da6d50df770878f69fb8e4d9586b
refs/heads/master
2020-05-18T06:36:31.891024
2018-07-10T11:15:54
2018-07-10T11:15:54
41,973,400
0
0
null
null
null
null
UTF-8
Java
false
false
177
java
package org.uecide.themes; public class Nocturne extends ThemeControl { public static void init() { loadFont("/org/uecide/fonts/nk57-monospace-no-rg.ttf"); } }
faba1d6519a5e1ca4ffccc6e6a2d7c97964cb85b
f525deacb5c97e139ae2d73a4c1304affb7ea197
/gitv/src/main/java/com/gala/video/app/epg/init/task/PushServiceInitTask.java
71981958735b8393e30af18b579e84329b6b8b4d
[]
no_license
AgnitumuS/gitv
93b2359e1bf9f2b6c945298c61c5c6dbfeea49b3
242c9a10a0aeb41b9589de9f254e6ce9f57bd77a
refs/heads/master
2021-08-08T00:50:10.630301
2017-11-09T08:10:33
2017-11-09T08:10:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
875
java
package com.gala.video.app.epg.init.task; import android.content.Context; import com.gala.video.app.epg.ui.imsg.dialog.MsgDialogHelper; import com.gala.video.lib.share.ifimpl.imsg.utils.IMsgUtils; import com.gala.video.lib.share.project.Project; import com.gala.video.lib.share.system.preference.setting.SettingPlayPreference; public class PushServiceInitTask implements Runnable { private Context mContext; public PushServiceInitTask(Context context) { this.mContext = context; } public void run() { IMsgUtils.getAppId(Project.getInstance().getBuild().getPingbackP2()); IMsgUtils.sPkgName = this.mContext.getPackageName(); IMsgUtils.setShowDialog(SettingPlayPreference.getMessDialogOpen(this.mContext)); MsgDialogHelper.get().setReceiverListener(); IMsgUtils.init(); IMsgUtils.getSystem(); } }
f69606c2a57f0a58599297bde21e23b387f104fb
fec350c56c46798198a60facf43c6262713787ac
/Charm_Entry/src/net/sf/anathema/charmentry/model/data/ConfigurableCost.java
9150968d68cbc3753c591a71f2acdaa516a84ff6
[]
no_license
DoctorCalgori/anathema
02d679a2015c872addd27f65a22bd8ddb77ea206
52cf73efe3b6a7ab2b51590a2837d562c8c927f8
refs/heads/master
2020-12-30T17:32:36.834119
2012-09-02T06:44:43
2012-09-02T06:44:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
661
java
package net.sf.anathema.charmentry.model.data; public class ConfigurableCost implements IConfigurableCost { private String value; private String text; private boolean permanent; @Override public String getCost() { return value; } @Override public String getText() { return text; } @Override public void setValue(String value) { this.value = value; } @Override public void setText(String text) { this.text = text; } @Override public boolean isPermanent() { return permanent; } public void setPermanent(boolean permanent) { this.permanent = permanent; } }
e6eb184c5170b1f1164b9ff361b37ae988497de9
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.mm/classes.jar/com/tencent/mm/plugin/finder/feed/ui/FinderAppPushRouteProxyUI$g.java
d9adf88c9de3ee1c6b14b26ffcd351208fa73edf
[]
no_license
tsuzcx/qq_apk
0d5e792c3c7351ab781957bac465c55c505caf61
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
refs/heads/main
2022-07-02T10:32:11.651957
2022-02-01T12:41:38
2022-02-01T12:41:38
453,860,108
36
9
null
2022-01-31T09:46:26
2022-01-31T02:43:22
Java
UTF-8
Java
false
false
879
java
package com.tencent.mm.plugin.finder.feed.ui; import com.tencent.matrix.trace.core.AppMethodBeat; import com.tencent.mm.plugin.finder.extension.reddot.p; import kotlin.Metadata; import kotlin.g.a.b; import kotlin.g.b.u; @Metadata(d1={""}, d2={"<anonymous>", "", "it", "Lcom/tencent/mm/plugin/finder/extension/reddot/LocalFinderRedDotCtrInfo;"}, k=3, mv={1, 5, 1}, xi=48) final class FinderAppPushRouteProxyUI$g extends u implements b<p, Boolean> { public static final g BlA; static { AppMethodBeat.i(365714); BlA = new g(); AppMethodBeat.o(365714); } FinderAppPushRouteProxyUI$g() { super(1); } } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes.jar * Qualified Name: com.tencent.mm.plugin.finder.feed.ui.FinderAppPushRouteProxyUI.g * JD-Core Version: 0.7.0.1 */
0bc34d8704c651b0b8e39117045115a5d8dd8639
2e041183e95c14e46e1f27450f39960521fe09d8
/src/cgv/deagu/handler/movie/MovieTimeHandler.java
378fbf21d82aa03080d45c818fbd0f6ba5ecb767
[]
no_license
JamesAreuming/MVC_CGV
14821ca601e358bb509c3d7a13a4b0d4f2d98dde
0bf4b01682c00d3ce4c324ba4dde6a61498586e1
refs/heads/master
2021-05-18T15:23:07.345399
2020-03-30T12:22:31
2020-03-30T12:22:31
251,296,483
0
0
null
null
null
null
UTF-8
Java
false
false
876
java
package cgv.deagu.handler.movie; import java.sql.Connection; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import cgv.deagu.dao.MovieDao; import cgv.deagu.jdbc.JDBCUtil; import cgv.deagu.model.Movie; import cgv.deagu.mvc.CommandHandler; public class MovieTimeHandler implements CommandHandler{ @Override public String process(HttpServletRequest req, HttpServletResponse res) throws Exception { if(req.getMethod().equalsIgnoreCase("get")) { Connection conn = null; try { conn = JDBCUtil.getConnection(); MovieDao dao = MovieDao.getInstance(); List<Movie> list = dao.listMovie(conn); req.setAttribute("list", list); }catch(Exception e) { e.printStackTrace(); }finally { JDBCUtil.close(conn); } return "/WEB-INF/view/movie/menu2.jsp"; } return null; } }
b92cefb18cd5f094b7b72a911d4ea2b04d3a9df9
1358072379743cb0abdc61d6c4cc9de3afbd3889
/mobileTravel/src/main/java/com/cmcc/hyapps/andyou/data/StringConverter.java
4ad9733d640cc742ea62a3a59f8e544334e76655
[]
no_license
gaoruishan/APP_v1.0
6263d300c0789546c9def4cdda5c1136933a13e4
81d9639b3bcbc7e20192f9df677fb907ebc30a8f
refs/heads/master
2021-04-12T07:49:14.849539
2016-07-22T06:29:38
2016-07-22T06:29:38
63,929,088
2
1
null
null
null
null
UTF-8
Java
false
false
962
java
package com.cmcc.hyapps.andyou.data; /** * Created by Administrator on 2015/6/2. */ import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonParseException; import com.google.gson.JsonPrimitive; import com.google.gson.JsonSerializationContext; import com.google.gson.JsonSerializer; import java.lang.reflect.Type; public class StringConverter implements JsonSerializer<String>,JsonDeserializer<String> { public JsonElement serialize(String src, Type typeOfSrc,JsonSerializationContext context) { if ( src == null ) { return new JsonPrimitive(""); } else { return new JsonPrimitive(src.toString()); } } public String deserialize(JsonElement json, Type typeOfT,JsonDeserializationContext context) throws JsonParseException { return json.getAsJsonPrimitive().getAsString(); } }
4e6f9f0351cd77b2da31a94aa5cf8b5dbe4a9a94
76a8c23c3038ca1e47aca330a027a66eb07cbd78
/webui/src/main/java/com/vip/yyl/gateway/accesscontrol/AccessControlFilter.java
14aa09f079f3812368ab1e1ebb6dfcb1f772620d
[]
no_license
ThunderStorm1503/ApiIntelligenceRobot
a17c0a7b1ee33b13f2b4a88c427f47d284f0a156
4c8e1e8e7c953029fe143fbac4ab3547cd7ad6ca
refs/heads/master
2021-01-11T21:33:56.237708
2017-01-13T01:57:25
2017-01-13T01:57:25
78,805,492
0
1
null
2017-02-23T07:00:21
2017-01-13T02:02:24
Java
UTF-8
Java
false
false
3,731
java
package com.vip.yyl.gateway.accesscontrol; import com.vip.yyl.config.JHipsterProperties; import java.util.List; import java.util.Map; import javax.inject.Inject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.cloud.netflix.zuul.filters.Route; import org.springframework.cloud.netflix.zuul.filters.RouteLocator; import org.springframework.http.HttpStatus; import com.netflix.zuul.ZuulFilter; import com.netflix.zuul.context.RequestContext; /** * Zuul filter for restricting access to backend micro-services endpoints. */ public class AccessControlFilter extends ZuulFilter { private final Logger log = LoggerFactory.getLogger(AccessControlFilter.class); @Inject private RouteLocator routeLocator; @Inject private JHipsterProperties jHipsterProperties; @Override public String filterType() { return "pre"; } @Override public int filterOrder() { return 0; } /** * Filter requests on endpoints that are not in the list of authorized microservices endpoints. */ @Override public boolean shouldFilter() { String requestUri = RequestContext.getCurrentContext().getRequest().getRequestURI(); // If the request Uri does not start with the path of the authorized endpoints, we block the request for (Route route : routeLocator.getRoutes()) { String serviceUrl = route.getFullPath(); String serviceName = route.getId(); // If this route correspond to the current request URI // We do a substring to remove the "**" at the end of the route URL if (requestUri.startsWith(serviceUrl.substring(0, serviceUrl.length() - 2))) { return !isAuthorizedRequest(serviceUrl, serviceName, requestUri); } } return true; } private boolean isAuthorizedRequest(String serviceUrl, String serviceName, String requestUri) { Map<String, List<String>> authorizedMicroservicesEndpoints = jHipsterProperties.getGateway() .getAuthorizedMicroservicesEndpoints(); // If the authorized endpoints list was left empty for this route, all access are allowed if (authorizedMicroservicesEndpoints.get(serviceName) == null) { log.debug("Access Control: allowing access for {}, as no access control policy has been set up for " + "service: {}", requestUri, serviceName); return true; } else { List<String> authorizedEndpoints = authorizedMicroservicesEndpoints.get(serviceName); // Go over the authorized endpoints to control that the request URI matches it for (String endpoint : authorizedEndpoints) { // We do a substring to remove the "**/" at the end of the route URL String gatewayEndpoint = serviceUrl.substring(0, serviceUrl.length() - 3) + endpoint; if (requestUri.startsWith(gatewayEndpoint)) { log.debug("Access Control: allowing access for {}, as it matches the following authorized " + "microservice endpoint: {}", requestUri, gatewayEndpoint); return true; } } } return false; } @Override public Object run() { RequestContext ctx = RequestContext.getCurrentContext(); ctx.setResponseStatusCode(HttpStatus.FORBIDDEN.value()); if (ctx.getResponseBody() == null && !ctx.getResponseGZipped()) { ctx.setSendZuulResponse(false); } log.debug("Access Control: filtered unauthorized access on endpoint {}", ctx.getRequest().getRequestURI()); return null; } }
5613a352ad0755ac8ddb7c99d4af0003c1e07795
c5498743036544b67876707222d974582d435b40
/Mybatis/Mybatis-03-mapper/src/sylu/mybatis/test/MyBatisTest.java
8b08819ac0cebba5566391e64cdb07b5e6171acb
[]
no_license
lhang662543608/Java_Notes
3035dd5eedc98eec9d154d081cddb0007d36ecf5
10b816c0c7fffc7dfe7876c643a2beefb4557b3d
refs/heads/master
2020-05-25T22:06:03.871757
2020-01-11T02:13:40
2020-01-11T02:13:40
188,006,603
0
0
null
null
null
null
GB18030
Java
false
false
7,294
java
package sylu.mybatis.test; import java.io.IOException; import java.io.InputStream; import java.util.HashMap; import java.util.List; import java.util.Map; 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.Test; import sylu.mybatis.been.Department; import sylu.mybatis.been.Employee; import sylu.mybatis.dao.DepartmentMapper; import sylu.mybatis.dao.EmployeeMapper; import sylu.mybatis.dao.EmployeeMapperAnnotation; import sylu.mybatis.dao.EmployeeMapperPlus; /** * 1、接口式编程 原生: Dao ====> DaoImpl mybatis: Mapper ====> xxMapper.xml * * 2、SqlSession代表和数据库的一次会话;用完必须关闭; * 3、SqlSession和connection一样她都是非线程安全。每次使用都应该去获取新的对象。 * 4、mapper接口没有实现类,但是mybatis会为这个接口生成一个代理对象。 (将接口和xml进行绑定) EmployeeMapper * empMapper = sqlSession.getMapper(EmployeeMapper.class); 5、两个重要的配置文件: * mybatis的全局配置文件:包含数据库连接池信息,事务管理器信息等...系统运行环境信息 sql映射文件:保存了每一个sql语句的映射信息: * 将sql抽取出来。 * * * @author lfy * */ public class MyBatisTest { public SqlSessionFactory getSqlSessionFactory() throws IOException { String resource = "mybatis-config.xml"; InputStream inputStream = Resources.getResourceAsStream(resource); return new SqlSessionFactoryBuilder().build(inputStream); } /** * 1、根据xml配置文件(全局配置文件)创建一个SqlSessionFactory对象 有数据源一些运行环境信息 * 2、sql映射文件;配置了每一个sql,以及sql的封装规则等。 3、将sql映射文件注册在全局配置文件中 4、写代码: * 1)、根据全局配置文件得到SqlSessionFactory; * 2)、使用sqlSession工厂,获取到sqlSession对象使用他来执行增删改查 * 一个sqlSession就是代表和数据库的一次会话,用完关闭 * 3)、使用sql的唯一标志来告诉MyBatis执行哪个sql。sql都是保存在sql映射文件中的。 * * @throws IOException */ @Test public void test() throws IOException { // 2、获取sqlSession实例,能直接执行已经映射的sql语句 // sql的唯一标识:statement Unique identifier matching the statement to use. // 执行sql要用的参数:parameter A parameter object to pass to the statement. SqlSessionFactory sqlSessionFactory = getSqlSessionFactory(); SqlSession openSession = sqlSessionFactory.openSession(); try { Employee employee = openSession.selectOne("sylu.mybatis.dao.EmployeeMapper.getEmpById", 1); System.out.println(employee); } finally { openSession.close(); } } @Test public void test01() throws IOException { // 1、获取sqlSessionFactory对象 SqlSessionFactory sqlSessionFactory = getSqlSessionFactory(); // 2、获取sqlSession对象 SqlSession openSession = sqlSessionFactory.openSession(); try { // 3、获取接口的实现类对象 // 会为接口自动的创建一个代理对象,代理对象去执行增删改查方法 EmployeeMapper mapper = openSession.getMapper(EmployeeMapper.class); Employee employee = mapper.getEmpById(1); System.out.println(mapper.getClass()); System.out.println(employee); } finally { openSession.close(); } } @Test public void test02() throws IOException { SqlSessionFactory sqlSessionFactory = getSqlSessionFactory(); SqlSession openSession = sqlSessionFactory.openSession(); try { EmployeeMapperAnnotation mapper = openSession.getMapper(EmployeeMapperAnnotation.class); Employee empById = mapper.getEmpById(1); System.out.println(empById); } finally { openSession.close(); } } /** * 测试增删改 1.mybatis允许增删改直接定义以下类型的返回值: Integer、Long、Boolean、void 2.我们需要手动提交数据 * sqlSessionFactory.openSession();==>手动提交 * sqlSessionFactory.openSession(true);==>自动提交 * * @throws IOException */ @Test public void test03() throws IOException { SqlSessionFactory sqlSessionFactory = getSqlSessionFactory(); // 1。获取到的Sqlsession不会自动提交数据 SqlSession openSession = sqlSessionFactory.openSession(); try { EmployeeMapper mapper = openSession.getMapper(EmployeeMapper.class); // 测试添加 Employee employee = new Employee(null, "Jack", "[email protected]", "0"); mapper.addEmp(employee); System.out.println(employee.getId()); // 测试修改 /* * Employee employee = new Employee(1, "lhang", "[email protected]", * "0"); boolean updateEmp = mapper.updateEmp(employee); * System.out.println(updateEmp); */ // 测试删除 // mapper.deleteEmpById(2); // 2.手动提交 openSession.commit(); } finally { openSession.close(); } } @Test public void test04() throws IOException { SqlSessionFactory sqlSessionFactory = getSqlSessionFactory(); // 1、获取到的SqlSession不会自动提交数据 SqlSession openSession = sqlSessionFactory.openSession(); try { EmployeeMapper mapper = openSession.getMapper(EmployeeMapper.class); // Employee employee = mapper.getEmpByIdAndLastName(1, "tom"); /* * Map<String, Object> map = new HashMap<>(); map.put("id", 1); * map.put("lastName", "lhang"); map.put("tableName", * "tbl_employee"); Employee employee = mapper.getEmpByMap(map); */ List<Employee> empsByLastNameLike = mapper.getEmpsByLastNameLike("%e%"); for (Employee employee : empsByLastNameLike) { System.out.println(employee); } Map<String, Object> returnMap = mapper.getEmpByIdReturnMap(1); System.out.println(returnMap); } finally { openSession.close(); } } @Test public void test05() throws IOException { SqlSessionFactory sqlSessionFactory = getSqlSessionFactory(); SqlSession openSession = sqlSessionFactory.openSession(); try { EmployeeMapperPlus mapper = openSession.getMapper(EmployeeMapperPlus.class); /* * Employee employee = mapper.getEmpById(1); * System.out.println(employee); */ /* * Employee empAndDept = mapper.getEmpAndDept(1); * System.out.println(empAndDept); * System.out.println(empAndDept.getDept()); */ Employee empByIdStep = mapper.getEmpByIdStep(2); System.out.println(empByIdStep); // System.out.println(empByIdStep.getDept()); } finally { openSession.close(); } } @Test public void test06() throws IOException { SqlSessionFactory sqlSessionFactory = getSqlSessionFactory(); SqlSession openSession = sqlSessionFactory.openSession(); try { DepartmentMapper mapper = openSession.getMapper(DepartmentMapper.class); /* * Department deptByIdPlus = mapper.getDeptByIdPlus(1); * List<Employee> emps = deptByIdPlus.getEmps(); * System.out.println(deptByIdPlus); System.out.println(emps); */ Department deptByIdStep = mapper.getDeptByIdStep(1); System.out.println(deptByIdStep.getDepartmentName()); System.out.println(deptByIdStep.getEmps()); } finally { openSession.close(); } } }
5df1332c09b17cb8527b58f4d33ef0d0485f5a9d
2ec282c465a50429743a6cfd10782ef6a50d6f8b
/src/Leetcode/BinaryTreePaths.java
47298b132d7d4c7f5d496907c3373467330aeea1
[]
no_license
kalpak92/TechInterview2020
c72f288e24c78bc69551e4e0b1d41b095cd93ef1
d835ab8f9fa4cc1fd1b54d377d833c5a2fda4d54
refs/heads/master
2023-04-12T02:29:45.858841
2021-04-14T02:50:03
2021-04-14T02:50:03
294,589,117
11
1
null
null
null
null
UTF-8
Java
false
false
1,462
java
package Leetcode; import java.util.ArrayList; import java.util.List; /** * @author kalpak * * Given a binary tree, return all root-to-leaf paths. * Note: A leaf is a node with no children. * * Example: * Input: * * 1 * / \ * 2 3 * \ * 5 * * Output: ["1->2->5", "1->3"] * Explanation: All root-to-leaf paths are: 1->2->5, 1->3 * */ public class BinaryTreePaths { public static List<String> binaryTreePaths(TreeNode root) { List<String> result = new ArrayList<>(); StringBuilder path = new StringBuilder(); dfsBinaryTreePaths(result, path, root); return result; } private static void dfsBinaryTreePaths(List<String> result, StringBuilder path, TreeNode root) { if(root == null) return; int len = path.length(); path.append(root.val); if(root.left == null && root.right == null) { result.add(path.toString()); } else { path.append("->"); dfsBinaryTreePaths(result, path, root.left); dfsBinaryTreePaths(result, path, root.right); } path.setLength(len); } public static void main(String[] args) { TreeNode root = new TreeNode(4); root.left = new TreeNode(9); root.right = new TreeNode(0); root.left.left = new TreeNode(5); root.left.right = new TreeNode(1); System.out.println(binaryTreePaths(root)); } }
a852170009e0a0d76abcdca363fbbe04d9372970
6047d639d9e2f88de8213753a0f60e743817035d
/hmp-modules/hmp-core/src/main/target/generated-sources/annotations/com/qiaobei/hmp/modules/entity/AppointConfig_.java
0e8449ab49af154281300981639fed73c2b03f4e
[]
no_license
fxbyun/hmp
7a8e4f9cffd5572434fcfe726ff9bd18b853605d
3a422430fc6797d378921675cae64de6c3a0de23
refs/heads/master
2021-07-24T11:32:13.701210
2017-11-04T08:05:36
2017-11-04T08:05:36
109,476,832
0
3
null
null
null
null
UTF-8
Java
false
false
873
java
package com.qiaobei.hmp.modules.entity; import com.qiaobei.hmp.modules.entity.AppointConfig.Static; import java.util.Date; import javax.annotation.Generated; import javax.persistence.metamodel.SingularAttribute; import javax.persistence.metamodel.StaticMetamodel; @Generated(value = "org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor") @StaticMetamodel(AppointConfig.class) public abstract class AppointConfig_ extends com.qiaobei.hmp.modules.entity.IdEntity_ { public static volatile SingularAttribute<AppointConfig, Doctor> doctor; public static volatile SingularAttribute<AppointConfig, Integer> perMin; public static volatile SingularAttribute<AppointConfig, Static> openStatic; public static volatile SingularAttribute<AppointConfig, Date> flagChangeDate; public static volatile SingularAttribute<AppointConfig, Integer> personNum; }
bd874b27ab717bdbbcf747f388373666c42c3b12
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/4/4_e7968b27093a8a5973aa1f21f436d539b232bbe6/KeyguardViewBase/4_e7968b27093a8a5973aa1f21f436d539b232bbe6_KeyguardViewBase_s.java
8a9332837eecd63b1b9646907340deab010e5c23
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
8,175
java
/* * Copyright (C) 2007 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.internal.policy.impl; import android.content.Context; import android.content.Intent; import android.media.AudioManager; import android.telephony.TelephonyManager; import android.view.KeyEvent; import android.view.View; import android.view.Gravity; import android.widget.FrameLayout; import android.util.AttributeSet; /** * Base class for keyguard views. {@link #reset} is where you should * reset the state of your view. Use the {@link KeyguardViewCallback} via * {@link #getCallback()} to send information back (such as poking the wake lock, * or finishing the keyguard). * * Handles intercepting of media keys that still work when the keyguard is * showing. */ public abstract class KeyguardViewBase extends FrameLayout { private KeyguardViewCallback mCallback; private AudioManager mAudioManager; private TelephonyManager mTelephonyManager = null; public KeyguardViewBase(Context context) { super(context); // drop shadow below status bar in keyguard too mForegroundInPadding = false; setForegroundGravity(Gravity.FILL_HORIZONTAL | Gravity.TOP); setForeground( context.getResources().getDrawable( com.android.internal.R.drawable.title_bar_shadow)); } // used to inject callback void setCallback(KeyguardViewCallback callback) { mCallback = callback; } public KeyguardViewCallback getCallback() { return mCallback; } /** * Called when you need to reset the state of your view. */ abstract public void reset(); /** * Called when the screen turned off. */ abstract public void onScreenTurnedOff(); /** * Called when the screen turned on. */ abstract public void onScreenTurnedOn(); /** * Called when a key has woken the device to give us a chance to adjust our * state according the the key. We are responsible for waking the device * (by poking the wake lock) once we are ready. * * The 'Tq' suffix is per the documentation in {@link android.view.WindowManagerPolicy}. * Be sure not to take any action that takes a long time; any significant * action should be posted to a handler. * * @param keyCode The wake key, which may be relevant for configuring the * keyguard. */ abstract public void wakeWhenReadyTq(int keyCode); /** * Verify that the user can get past the keyguard securely. This is called, * for example, when the phone disables the keyguard but then wants to launch * something else that requires secure access. * * The result will be propogated back via {@link KeyguardViewCallback#keyguardDone(boolean)} */ abstract public void verifyUnlock(); /** * Called before this view is being removed. */ abstract public void cleanUp(); @Override public boolean dispatchKeyEvent(KeyEvent event) { if (shouldEventKeepScreenOnWhileKeyguardShowing(event)) { mCallback.pokeWakelock(); } if (interceptMediaKey(event)) { return true; } return super.dispatchKeyEvent(event); } private boolean shouldEventKeepScreenOnWhileKeyguardShowing(KeyEvent event) { if (event.getAction() != KeyEvent.ACTION_DOWN) { return false; } switch (event.getKeyCode()) { case KeyEvent.KEYCODE_DPAD_DOWN: case KeyEvent.KEYCODE_DPAD_LEFT: case KeyEvent.KEYCODE_DPAD_RIGHT: case KeyEvent.KEYCODE_DPAD_UP: return false; default: return true; } } /** * Allows the media keys to work when the keygaurd is showing. * The media keys should be of no interest to the actualy keygaurd view(s), * so intercepting them here should not be of any harm. * @param event The key event * @return whether the event was consumed as a media key. */ private boolean interceptMediaKey(KeyEvent event) { final int keyCode = event.getKeyCode(); if (event.getAction() == KeyEvent.ACTION_DOWN) { switch (keyCode) { case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE: /* Suppress PLAYPAUSE toggle when phone is ringing or * in-call to avoid music playback */ if (mTelephonyManager == null) { mTelephonyManager = (TelephonyManager) getContext().getSystemService( Context.TELEPHONY_SERVICE); } if (mTelephonyManager != null && mTelephonyManager.getCallState() != TelephonyManager.CALL_STATE_IDLE) { return true; // suppress key event } case KeyEvent.KEYCODE_HEADSETHOOK: case KeyEvent.KEYCODE_MEDIA_STOP: case KeyEvent.KEYCODE_MEDIA_NEXT: case KeyEvent.KEYCODE_MEDIA_PREVIOUS: case KeyEvent.KEYCODE_MEDIA_REWIND: case KeyEvent.KEYCODE_MEDIA_FAST_FORWARD: { Intent intent = new Intent(Intent.ACTION_MEDIA_BUTTON, null); intent.putExtra(Intent.EXTRA_KEY_EVENT, event); getContext().sendOrderedBroadcast(intent, null); return true; } case KeyEvent.KEYCODE_VOLUME_UP: case KeyEvent.KEYCODE_VOLUME_DOWN: { synchronized (this) { if (mAudioManager == null) { mAudioManager = (AudioManager) getContext().getSystemService( Context.AUDIO_SERVICE); } } // Volume buttons should only function for music. if (mAudioManager.isMusicActive()) { mAudioManager.adjustStreamVolume( AudioManager.STREAM_MUSIC, keyCode == KeyEvent.KEYCODE_VOLUME_UP ? AudioManager.ADJUST_RAISE : AudioManager.ADJUST_LOWER, 0); } // Don't execute default volume behavior return true; } } } else if (event.getAction() == KeyEvent.ACTION_UP) { switch (keyCode) { case KeyEvent.KEYCODE_MUTE: case KeyEvent.KEYCODE_HEADSETHOOK: case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE: case KeyEvent.KEYCODE_MEDIA_STOP: case KeyEvent.KEYCODE_MEDIA_NEXT: case KeyEvent.KEYCODE_MEDIA_PREVIOUS: case KeyEvent.KEYCODE_MEDIA_REWIND: case KeyEvent.KEYCODE_MEDIA_FAST_FORWARD: { Intent intent = new Intent(Intent.ACTION_MEDIA_BUTTON, null); intent.putExtra(Intent.EXTRA_KEY_EVENT, event); getContext().sendOrderedBroadcast(intent, null); return true; } } } return false; } }
ee5302f927c179e7f0be45343c784525f9acff35
5e7608123a22cecef836ec02fbe48f93aa03190a
/Java-Multi-Thread-Programming/src/main/java/com/multi/thread/chapter1/example27/MyThread.java
3846a22e04a4b984b0c8739c29caa77aa8eaa669
[ "Apache-2.0" ]
permissive
liiibpm/Java_Multi_Thread
a01e2ba428d4cc9277357232ef37d4b770fddd6a
39200a1096475557c749db68993e3a3ccc0547b5
refs/heads/master
2023-03-26T16:16:29.039854
2020-12-01T12:22:23
2020-12-01T12:22:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
382
java
package com.multi.thread.chapter1.example27; /** * @Description * @Author dongzonglei * @Date 2018/12/08 下午3:09 */ public class MyThread extends Thread { @Override public void run() { try { this.stop(); } catch (Exception e) { System.out.println("进入了catch()方法"); e.printStackTrace(); } } }
91ea726cd6524155a639fbd0482ae066eb45f16a
7b4fd58090aa7013137ba2734d7f256b812861e1
/src/Ellias/rm/com/tencent/tmassistantsdk/openSDK/opensdktomsdk/a.java
d66e318f3be4004f9e9f9c74386a54b95a36f4e9
[]
no_license
daihuabin/Ellias
e37798a6a2e63454f80de512319ece885b6a2237
fd010991a5677e6aa104b927b82fc3d6da801887
refs/heads/master
2023-03-16T21:12:33.908495
2020-02-10T15:42:22
2020-02-10T15:42:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,611
java
package com.tencent.tmassistantsdk.openSDK.opensdktomsdk; import android.os.Bundle; import android.os.Handler.Callback; import android.os.Message; import com.tencent.tmassistantsdk.openSDK.opensdktomsdk.b.b; class a implements Handler.Callback { a(TMOpenSDKToMsdkManager paramTMOpenSDKToMsdkManager) { } public boolean handleMessage(Message paramMessage) { switch (paramMessage.what) { case 2: default: case 4: case 5: case 0: case 1: case 6: case 3: } while (true) { return false; b localb = (b)paramMessage.obj; if (localb == null) continue; this.a.onNetworkFinishedSuccess(localb); continue; int j = ((Integer)paramMessage.obj).intValue(); this.a.onNetworkFinishedFailed(j); continue; int i = paramMessage.arg1; String str = paramMessage.obj.toString(); this.a.handleInstall(str, i); continue; Bundle localBundle2 = paramMessage.getData(); if (localBundle2 == null) continue; this.a.handleDownloading(localBundle2.getLong("receiveDataLen"), localBundle2.getLong("totalDataLen")); continue; Bundle localBundle1 = paramMessage.getData(); if (localBundle1 == null) continue; this.a.handleDownloadContinue(localBundle1.getLong("receiveDataLen"), localBundle1.getLong("totalDataLen")); continue; this.a.handleDownloadFailed(); } } } /* Location: D:\rm_src\classes_dex2jar\ * Qualified Name: com.tencent.tmassistantsdk.openSDK.opensdktomsdk.a * JD-Core Version: 0.6.0 */
d2fc9be89236f74bacf344b7d8723f731f6fd956
d98fdbba8be0f3b3075aabb4812165e5f484c437
/link-redirector/src/main/java/com/hoang/linkredirector/view_model/UserSearchCriteria.java
22c41acf335cfbd7bdd9e2e975042d1cf904a575
[]
no_license
homertruong66/research
61fbecb06ebc65c0695e60b72a37444508d531f8
4f4ff309b872aa1056f197f29622fb3d66821520
refs/heads/master
2022-12-22T00:51:57.846631
2019-07-19T10:32:03
2019-07-19T10:32:03
197,752,073
0
0
null
2022-12-16T04:43:32
2019-07-19T10:17:41
Java
UTF-8
Java
false
false
1,806
java
package com.hoang.linkredirector.view_model; import java.io.Serializable; import javax.validation.constraints.Max; import javax.validation.constraints.Min; import javax.ws.rs.DefaultValue; import javax.ws.rs.QueryParam; public class UserSearchCriteria implements Serializable { private static final long serialVersionUID = -2621089893136317367L; @QueryParam("name") @DefaultValue("") private String name; @QueryParam("sort_name") @DefaultValue("id") private String sortName; @QueryParam("sort_direction") @DefaultValue("asc") private String sortDirection; @Min(value = 1, message = "page_index must be greater than 1") @Max(value = Integer.MAX_VALUE, message = "page_index can't be greater than " + Integer.MAX_VALUE) @DefaultValue("1") @QueryParam("page_index") private int pageIndex; @QueryParam("page_size") @DefaultValue("50") private int pageSize; public String getName () { return name; } public void setName (String name) { this.name = name; } public String getSortName () { return sortName; } public void setSortName (String sortName) { this.sortName = sortName; } public String getSortDirection () { return sortDirection; } public void setSortDirection (String sortDirection) { this.sortDirection = sortDirection; } public int getPageIndex () { return pageIndex; } public void setPageIndex (int pageIndex) { this.pageIndex = pageIndex; } public int getPageSize () { return pageSize; } public void setPageSize (int pageSize) { this.pageSize = pageSize; } public int getOffset () { return (this.pageIndex - 1) * this.pageSize; } }
470f2d75f0458a1c8f269485317a54182216bc6d
f0ef082568f43e3dbc820e2a5c9bb27fe74faa34
/com/google/android/gms/maps/model/internal/zzb.java
7dc19f307a2ce5819365615ff72828c2deec8e4d
[]
no_license
mzkh/Taxify
f929ea67b6ad12a9d69e84cad027b8dd6bdba587
5c6d0854396b46995ddd4d8b2215592c64fbaecb
refs/heads/master
2020-12-03T05:13:40.604450
2017-05-20T05:19:49
2017-05-20T05:19:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,632
java
package com.google.android.gms.maps.model.internal; import android.graphics.Bitmap; import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable.Creator; import com.google.android.gms.common.internal.safeparcel.zza; import com.google.android.gms.drive.events.CompletionEvent; import com.google.android.gms.location.places.Place; public class zzb implements Creator<zza> { static void zza(zza com_google_android_gms_maps_model_internal_zza, Parcel parcel, int i) { int zzK = com.google.android.gms.common.internal.safeparcel.zzb.zzK(parcel); com.google.android.gms.common.internal.safeparcel.zzb.zzc(parcel, 1, com_google_android_gms_maps_model_internal_zza.getVersionCode()); com.google.android.gms.common.internal.safeparcel.zzb.zza(parcel, 2, com_google_android_gms_maps_model_internal_zza.getType()); com.google.android.gms.common.internal.safeparcel.zzb.zza(parcel, 3, com_google_android_gms_maps_model_internal_zza.zzqL(), false); com.google.android.gms.common.internal.safeparcel.zzb.zza(parcel, 4, com_google_android_gms_maps_model_internal_zza.getBitmap(), i, false); com.google.android.gms.common.internal.safeparcel.zzb.zzH(parcel, zzK); } public /* synthetic */ Object createFromParcel(Parcel x0) { return zzeh(x0); } public /* synthetic */ Object[] newArray(int x0) { return zzgk(x0); } public zza zzeh(Parcel parcel) { Bitmap bitmap = null; byte b = (byte) 0; int zzJ = zza.zzJ(parcel); Bundle bundle = null; int i = 0; while (parcel.dataPosition() < zzJ) { int zzI = zza.zzI(parcel); switch (zza.zzaP(zzI)) { case CompletionEvent.STATUS_FAILURE /*1*/: i = zza.zzg(parcel, zzI); break; case CompletionEvent.STATUS_CONFLICT /*2*/: b = zza.zze(parcel, zzI); break; case CompletionEvent.STATUS_CANCELED /*3*/: bundle = zza.zzq(parcel, zzI); break; case Place.TYPE_AQUARIUM /*4*/: bitmap = (Bitmap) zza.zza(parcel, zzI, Bitmap.CREATOR); break; default: zza.zzb(parcel, zzI); break; } } if (parcel.dataPosition() == zzJ) { return new zza(i, b, bundle, bitmap); } throw new zza.zza("Overread allowed size end=" + zzJ, parcel); } public zza[] zzgk(int i) { return new zza[i]; } }
aa58443264206913dc4767511ddf0d8210046dac
8273dedf80a0377f7168e891dcd9bbb42bba23e8
/legacy/11g/bined-jdeveloper-extension/src/org/exbin/framework/gui/utils/panel/RemovalControlPanel.java
77177a4a2f1d5d300adcacc6f4be6f9ec7baf16f
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
exbin/bined-jdeveloper-extension
238d76a582ec055b96a8e266598dc363433d8587
fe502f500f2f351d6fe4cd4d0ec5704fd7398f5b
refs/heads/master
2021-06-25T01:53:50.862170
2019-08-15T07:32:04
2019-08-15T07:32:04
79,743,623
0
0
null
null
null
null
UTF-8
Java
false
false
7,282
java
/* * Copyright (C) ExBin Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.exbin.framework.gui.utils.panel; import javax.annotation.Nonnull; import javax.annotation.ParametersAreNonnullByDefault; import org.exbin.framework.gui.utils.LanguageUtils; import org.exbin.framework.gui.utils.OkCancelListener; import org.exbin.framework.gui.utils.WindowUtils; import org.exbin.framework.gui.utils.handler.RemovalControlHandler; /** * Basic control panel with support for removal. * * @version 0.2.1 2019/07/14 * @author ExBin Project (http://exbin.org) */ @ParametersAreNonnullByDefault public class RemovalControlPanel extends javax.swing.JPanel implements RemovalControlHandler.RemovalControlService { private final java.util.ResourceBundle resourceBundle; private RemovalControlHandler handler; private OkCancelListener okCancelListener; public RemovalControlPanel() { this(LanguageUtils.getResourceBundleByClass(RemovalControlPanel.class)); } public RemovalControlPanel(java.util.ResourceBundle resourceBundle) { this.resourceBundle = resourceBundle; initComponents(); okCancelListener = new OkCancelListener() { @Override public void okEvent() { performClick(RemovalControlHandler.ControlActionType.OK); } @Override public void cancelEvent() { performClick(RemovalControlHandler.ControlActionType.CANCEL); } }; } public void setHandler(RemovalControlHandler handler) { this.handler = handler; } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { cancelButton = new javax.swing.JButton(); okButton = new javax.swing.JButton(); removeButton = new javax.swing.JButton(); cancelButton.setText(resourceBundle.getString("cancelButton.text")); // NOI18N cancelButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cancelButtonActionPerformed(evt); } }); okButton.setText(resourceBundle.getString("okButton.text")); // NOI18N okButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { okButtonActionPerformed(evt); } }); removeButton.setText(resourceBundle.getString("removeButton.text")); // NOI18N removeButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { removeButtonActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap() .addComponent(removeButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(okButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(cancelButton) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(cancelButton) .addComponent(okButton) .addComponent(removeButton)) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed if (handler != null) { handler.controlActionPerformed(RemovalControlHandler.ControlActionType.CANCEL); } }//GEN-LAST:event_cancelButtonActionPerformed private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed if (handler != null) { handler.controlActionPerformed(RemovalControlHandler.ControlActionType.OK); } }//GEN-LAST:event_okButtonActionPerformed private void removeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeButtonActionPerformed if (handler != null) { handler.controlActionPerformed(RemovalControlHandler.ControlActionType.REMOVE); } }//GEN-LAST:event_removeButtonActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton cancelButton; private javax.swing.JButton okButton; private javax.swing.JButton removeButton; // End of variables declaration//GEN-END:variables @Override public void performClick(RemovalControlHandler.ControlActionType actionType) { WindowUtils.doButtonClick(actionType == RemovalControlHandler.ControlActionType.OK ? okButton : cancelButton); } @Nonnull @Override public OkCancelListener getOkCancelListener() { return okCancelListener; } @Nonnull @Override public RemovalControlHandler.RemovalControlEnablementListener createEnablementListener() { return new RemovalControlHandler.RemovalControlEnablementListener() { @Override public void actionEnabled(RemovalControlHandler.ControlActionType actionType, boolean enablement) { switch (actionType) { case OK: { okButton.setEnabled(enablement); break; } case CANCEL: { cancelButton.setEnabled(enablement); break; } default: throw new IllegalStateException("Illegal action type " + actionType.name()); } } }; } }
0e7e64038656c62cb9fb46a7a1d58eae052f550e
473b76b1043df2f09214f8c335d4359d3a8151e0
/benchmark/bigclonebenchdata_partial/1205207.java
637545d5e6077c7d05f6526569a505c982d51cb7
[]
no_license
whatafree/JCoffee
08dc47f79f8369af32e755de01c52d9a8479d44c
fa7194635a5bd48259d325e5b0a190780a53c55f
refs/heads/master
2022-11-16T01:58:04.254688
2020-07-13T20:11:17
2020-07-13T20:11:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,003
java
class c1205207 { @SuppressWarnings("deprecation") private void loadClassFilesFromJar() { IPackageFragmentRoot packageFragmentRoot = (IPackageFragmentRoot) getJavaElement(); File jarFile = packageFragmentRoot.getResource().getLocation().toFile(); try { URL url = jarFile.toURL(); URLConnection u = url.openConnection(); ZipInputStream inputStream = new ZipInputStream(u.getInputStream()); ZipEntry entry = inputStream.getNextEntry(); while (null != entry) { if (entry.getName().endsWith(".class")) { ClassParser parser = new ClassParser(inputStream, entry.getName()); Repository.addClass(parser.parse()); } entry = inputStream.getNextEntry(); } } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } }
e9dd0cda35dd90e802598beb86485ce36c93cee5
1420ba90b0617caef56cd4dbb385b22924f001eb
/tour-android/app/src/main/java/cn/xmzt/www/nim/im/chatroom/fragment/tab/MasterTabFragment.java
416f73bfb56024d6a988941d1992965a43bdfb9a
[]
no_license
similar718/tour_p
7a4dbf5267b2bb119887791b0a09416ac6071642
2bb766983fe397c90437608a3dbee482ffda7ad0
refs/heads/master
2020-11-26T06:32:22.172843
2019-12-20T03:30:59
2019-12-20T03:30:59
228,989,138
0
0
null
null
null
null
UTF-8
Java
false
false
651
java
package cn.xmzt.www.nim.im.chatroom.fragment.tab; import cn.xmzt.www.R; import cn.xmzt.www.nim.im.chatroom.fragment.MasterFragment; /** * 主播基类fragment * Created by hzxuwen on 2015/12/14. */ public class MasterTabFragment extends ChatRoomTabFragment { private MasterFragment fragment; @Override protected void onInit() { fragment = (MasterFragment) getActivity().getSupportFragmentManager().findFragmentById(R.id.master_fragment); } @Override public void onCurrent() { super.onCurrent(); if (fragment != null) { fragment.onCurrent(); } } }
32068d2f816a6e9efa0c7fa04eb7fc417f93c034
7c6e1b0f61ac2da8427970b21f631c60cfe28256
/app/src/main/java/com/massky/greenlandvland/di/module/NewsMainFragmentModule.java
c0a8174b08912c57d05777bbdb974e3683fa1fc7
[]
no_license
androidzhangyu/GreenLandVLand
2ffe293146292c33d7849b297636c0e5909a6c0f
a51f20e00d60f34bc33716e21e41a84c9a067b19
refs/heads/master
2022-04-24T16:23:49.141922
2020-04-23T02:44:33
2020-04-23T02:44:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
567
java
package com.massky.greenlandvland.di.module; import com.massky.greenlandvland.di.scope.FragmentScope; import com.massky.greenlandvland.module.news.main.NewsMainContract; import dagger.Module; import dagger.Provides; /** * Created by chenxz on 2017/12/10. */ @Module public class NewsMainFragmentModule { private NewsMainContract.View view; public NewsMainFragmentModule(NewsMainContract.View view) { this.view = view; } @FragmentScope @Provides NewsMainContract.View provideNewsMainView() { return this.view; } }
0eb4790877a097d67906d81837c9e05defe8c220
b2bb210d0d5c9b831b1f37dabc04f80b4a2b8c61
/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/exceptions/MsoIOException.java
eafb033e4be55f64fbe1baa86fc512b0ed6e148b
[ "Apache-2.0" ]
permissive
dmellos/archive-mso
477924d893a80e3e072a3acb1e89da762d2e24fb
fd02ad4cc7f03cfbe01dba5a1e564bed63e69a11
refs/heads/master
2023-06-09T10:12:25.129613
2017-06-06T15:16:42
2017-06-06T15:16:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,672
java
/*- * ============LICENSE_START======================================================= * OPENECOMP - MSO * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============LICENSE_END========================================================= */ package org.openecomp.mso.openstack.exceptions; /** * I/O exception */ public class MsoIOException extends MsoException { /** * Serialization id. */ private static final long serialVersionUID = 6752445132721635760L; /** * Basic constructor with message * @param message the error message */ public MsoIOException (String message) { super(message); super.category = MsoExceptionCategory.IO; } /** * Constructor to wrap a nested exception * @param message the error message * @param t the cause */ public MsoIOException (String message, Throwable t) { super (message, t); super.category = MsoExceptionCategory.IO; } }
0fc990579d21b5f037f3495b0963432b759e6018
df8a7ef35ff28506053e4729b029c8d7a80587cd
/src/main/java/com/joymain/ng/webapp/controller/JmiMemberProfileFormController.java
4dd124af20e72a2ffe914fe8ecd1248f09d4b352
[]
no_license
lshowbiz/agnt_qt
101a5b3cabd0e1ff9135155ac87a602997a9eff5
789c2439308adaa5371d5bbb8a0f71a295395006
refs/heads/master
2022-12-11T10:13:18.791876
2019-10-02T01:01:57
2019-10-02T01:01:57
212,161,344
0
1
null
2022-12-05T23:28:41
2019-10-01T17:46:56
Java
UTF-8
Java
false
false
2,776
java
package com.joymain.ng.webapp.controller; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.stereotype.Controller; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.servlet.ModelAndView; import com.joymain.ng.model.JmiMember; import com.joymain.ng.model.JsysUser; import com.joymain.ng.service.JalStateProvinceManager; import com.joymain.ng.service.JmiMemberManager; import com.joymain.ng.util.LocaleUtil; import com.joymain.ng.util.StringUtil; @Controller @RequestMapping("/jmiMemberProfileform*") public class JmiMemberProfileFormController extends BaseFormController { private JmiMemberManager jmiMemberManager = null; @Autowired public void setJmiMemberManager(JmiMemberManager jmiMemberManager) { this.jmiMemberManager = jmiMemberManager; } @Autowired public JalStateProvinceManager jalStateProvinceManager; public JmiMemberProfileFormController() { setCancelView("redirect:jmiMembers"); setSuccessView("redirect:jmiMembers"); } @RequestMapping(method = RequestMethod.GET) public void showForm() { } @ModelAttribute("jmiMember") private JmiMember getJmiMember(HttpServletRequest request){ JsysUser defSysUser=(JsysUser)SecurityContextHolder.getContext().getAuthentication().getPrincipal(); List alStateProvinces=jalStateProvinceManager.getJalStateProvinceByCountryCode("CN"); request.setAttribute("alStateProvinces", alStateProvinces); if(StringUtil.getCheckIsUnlimitUser(defSysUser.getUserCode())){ request.setAttribute("bankViewUnLimit", "bankViewUnLimit"); } JmiMember jmiMember=null; jmiMember = jmiMemberManager.get(defSysUser.getUserCode()); return jmiMember; } @RequestMapping(method=RequestMethod.POST) public ModelAndView onSubmit(JmiMember jmiMember, BindingResult errors, HttpServletRequest request, HttpServletResponse response) throws Exception{ ModelAndView mav = new ModelAndView(); try { this.saveMessage(request, LocaleUtil.getLocalText("sys.message.updateSuccess")); return new ModelAndView(""); } catch (Exception e) { e.printStackTrace(); this.saveMessage(request, LocaleUtil.getLocalText(e.getMessage())); } return mav; } }
eee313bffae21fb579281a54c73aa71090e7e14e
ab59063ff2ae941b876324070d8f8e8165cef960
/chunking_text_file/40authors/pengrad/master/InlineQueryResultVenue.java
a23532a24b00c4703bf7b083e03112696babf19a
[]
no_license
gpoorvi92/author_class
f7c26f46f1ca9608a8c98fb18fc74a544cf99c36
b079ef0a477a2868140d77c4b32c317d4492725e
refs/heads/master
2020-04-01T18:01:54.665333
2018-12-10T14:55:11
2018-12-10T14:55:11
153,466,983
1
0
null
2018-10-17T14:44:56
2018-10-17T14:03:04
Java
UTF-8
Java
false
false
1,234
java
package com.pengrad.telegrambot.model.request; /** * Stas Parshin * 06 May 2016 */ public class InlineQueryResultVenue extends InlineQueryResult<InlineQueryResultVenue> { private float latitude; private float longitude; private String title; private String address; private String foursquare_id; private String thumb_url; private Integer thumb_width; private Integer thumb_height; public InlineQueryResultVenue(String id, float latitude, float longitude, String title, String address) { super("venue", id); this.latitude = latitude; this.longitude = longitude; this.title = title; this.address = address; } public InlineQueryResultVenue foursquareId(String foursquareId) { this.foursquare_id = foursquareId; return this; } public InlineQueryResultVenue thumbUrl(String thumbUrl) { this.thumb_url = thumbUrl; return this; } public InlineQueryResultVenue thumbWidth(Integer thumbWidth) { this.thumb_width = thumbWidth; return this; } public InlineQueryResultVenue thumbHeight(Integer thumbHeight) { this.thumb_height = thumbHeight; return this; } }
232238b4b8dc07f626c2164f295999cfd8b3330e
25729cf0666fb83f0c9b7553cd647b6c33968886
/src/main/java/com/opendata/common/util/KeywordFilter.java
c455677eb3832c701cff9e685ca5244fdab69469
[]
no_license
545473750/zswxglxt
1b55f94d8c0c8c0de47a0180406cdcdacc2ff756
2a7b7aeba7981bd723f99db400c99d0decb6de43
refs/heads/master
2020-04-23T15:42:36.490753
2014-08-11T00:08:39
2014-08-11T00:08:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,032
java
package com.opendata.common.util; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; /** * @title KeywordFilter * @description TODO * @author * @date 2014-4-17 * @version 1.0 */ public class KeywordFilter { /** 敏感词集合 * {法={isEnd=0, 轮={isEnd=1}}, 中={isEnd=0, 国={isEnd=0, 人={isEnd=1}, 男={isEnd=0, 人={isEnd=1}}}}} * */ private HashMap keysMap = new HashMap(); /** * 添加敏感词 * @param keywords */ public void addKeywords(List<String> keywords) { for (int i = 0; i < keywords.size(); i++) { String key = keywords.get(i).trim(); HashMap nowhash = keysMap;//初始从最外层遍历 for (int j = 0; j < key.length(); j++) { char word = key.charAt(j); Object wordMap = nowhash.get(word); if (wordMap != null) { nowhash = (HashMap) wordMap; } else { HashMap<String, String> newWordHash = new HashMap<String, String>(); newWordHash.put("isEnd", "0"); nowhash.put(word, newWordHash); nowhash = newWordHash; } if (j == key.length() - 1) { nowhash.put("isEnd", "1"); } } } } /** * 检查一个字符串从begin位置起开始是否有keyword符合, * 如果没有,则返回0 * 如果有符合的keyword值,继续遍历,直至遇到isEnd = 1,返回匹配的keyword的长度, */ private int checkKeyWords(String txt, int begin) { HashMap nowhash = keysMap; int res = 0; for (int i = begin; i < txt.length(); i++) { char word = txt.charAt(i); Object wordMap = nowhash.get(word);//得到该字符对应的HashMap if (wordMap == null) { return 0;//如果该字符没有对应的HashMap,return 0 } res++;//如果该字符对应的HashMap不为null,说明匹配到了一个字符,+1 nowhash = (HashMap) wordMap;//将遍历的HashMap指向该字符对应的HashMap if (((String) nowhash.get("isEnd")).equals("1")) {//如果该字符为敏感词的结束字符,直接返回 return res; } else { continue; } } return res; } /** * 判断txt中是否有关键字 */ public boolean isContentKeyWords(String txt) { for (int i = 0; i < txt.length(); i++) { int len = checkKeyWords(txt, i); if (len > 0) { return true; } } return false; } /** * 返回txt中关键字的列表 */ public List<String> getTxtKeyWords(String txt) { List<String> list = new ArrayList<String>(); int l = txt.length(); for (int i = 0; i < l;) { int len = checkKeyWords(txt, i); if (len > 0) { String tt = txt.substring(i, i + len); list.add(tt); i += len; } else { i++; } } return list; } /** * 初始化敏感词列表 * */ public void initfiltercode() { List<String> keywords = new ArrayList<String>(); keywords.add("中国人"); keywords.add("中国男人"); keywords.add("法轮"); this.addKeywords(keywords); } public static void main(String[] args) throws IOException { KeywordFilter filter = new KeywordFilter(); filter.initfiltercode(); String txt = "哈哈,反倒是 法轮热舞功,中国人,"; boolean boo = filter.isContentKeyWords(txt); System.out.println(boo); List<String> set = filter.getTxtKeyWords(txt); System.out.println("包含的敏感词如下:" + set); } }
31b2c8204c949e96119b4b01719f2ac60cc85859
ae63683a5c10dbf856f2f13e48b3cfb90032ebbb
/src/Assignments/Sep10/PainterPartition.java
ec7434a8feec06267c819911e0dff6a0fe4a9f25
[]
no_license
frankenstein32/Crux11Aug2019PP
050400288aab738c9c3cfbfb9bc21d05fc019e57
17dea9cb34634995736ea571b86f2325b2c34b44
refs/heads/master
2020-12-19T14:37:43.658270
2020-01-23T09:39:08
2020-01-23T09:39:08
205,080,482
0
0
null
2019-08-29T04:29:50
2019-08-29T04:29:50
null
UTF-8
Java
false
false
1,162
java
package Assignments.Sep10; import java.util.Scanner; /** * @author Garima Chhikara * @email [email protected] * @date 10-Sep-2019 * */ public class PainterPartition { public static void main(String[] args) { Scanner scn = new Scanner(System.in); int nop = scn.nextInt(); int nob = scn.nextInt(); int[] arr = new int[nob]; for (int i = 0; i < arr.length; i++) { arr[i] = scn.nextInt(); } int lo = 0; int hi = 0; for (int val : arr) { hi += val; } int finalAns = 0; while (lo <= hi) { int mid = (lo + hi) / 2; if (isItPossible(nop, nob, arr, mid)) { finalAns = mid; hi = mid - 1; } else { lo = mid + 1; } } System.out.println(finalAns); } private static boolean isItPossible(int nop, int nob, int[] arr, int mid) { int painters = 1; int time = 0; int i = 0; // i denotes which book is already read while (i < arr.length) { if (time + arr[i] <= mid) { time = time + arr[i]; i++; } else { // you were not able to read the book painters++; time = 0; if (painters > nop) { return false; } } } return true; } }
f7042dc5c427ae592bd9ee8f30c0fd8c2bb5608f
af5386f30db32fa5a0373020539faf54d9687a90
/lib/src/main/java/com/bolyartech/scram_sasl/client/ScramClientFunctionalityImpl.java
f0ad62f1b37a3e26e5f5ec63c7a1058272d9a16e
[ "Apache-2.0" ]
permissive
ShaileshSurya/scram-sasl
fb644db0d1b89ba3c77d187df5fc3dfdb9001a71
5f3d1cbf71e534170c9f28fcee7fa8ec6bf77291
refs/heads/master
2023-04-11T01:37:17.941482
2021-04-18T07:01:33
2021-04-18T07:01:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,884
java
/* * Copyright 2016 Ognyan Bankov * <p> * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * 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.bolyartech.scram_sasl.client; import com.bolyartech.scram_sasl.common.Base64; import com.bolyartech.scram_sasl.common.ScramException; import com.bolyartech.scram_sasl.common.ScramUtils; import com.bolyartech.scram_sasl.common.StringPrep; import java.nio.charset.Charset; import java.security.InvalidKeyException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.Arrays; import java.util.UUID; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * Provides building blocks for creating SCRAM authentication client */ @SuppressWarnings("unused") public class ScramClientFunctionalityImpl implements ScramClientFunctionality { private static final Pattern SERVER_FIRST_MESSAGE = Pattern.compile("r=([^,]*),s=([^,]*),i=(.*)$"); private static final Pattern SERVER_FINAL_MESSAGE = Pattern.compile("v=([^,]*)$"); private static final String GS2_HEADER = "n,,"; private static final Charset ASCII = Charset.forName("ASCII"); private final String mDigestName; private final String mHmacName; private final String mClientNonce; private String mClientFirstMessageBare; private boolean mIsSuccessful = false; private byte[] mSaltedPassword; private String mAuthMessage; private State mState = State.INITIAL; /** * Create new ScramClientFunctionalityImpl * @param digestName Digest to be used * @param hmacName HMAC to be used */ public ScramClientFunctionalityImpl(String digestName, String hmacName) { this(digestName, hmacName, UUID.randomUUID().toString()); } /** * Create new ScramClientFunctionalityImpl * @param digestName Digest to be used * @param hmacName HMAC to be used * @param clientNonce Client nonce to be used */ public ScramClientFunctionalityImpl(String digestName, String hmacName, String clientNonce) { if (ScramUtils.isNullOrEmpty(digestName)) { throw new NullPointerException("digestName cannot be null or empty"); } if (ScramUtils.isNullOrEmpty(hmacName)) { throw new NullPointerException("hmacName cannot be null or empty"); } if (ScramUtils.isNullOrEmpty(clientNonce)) { throw new NullPointerException("clientNonce cannot be null or empty"); } mDigestName = digestName; mHmacName = hmacName; mClientNonce = clientNonce; } /** * Prepares first client message * * You may want to use {@link StringPrep#isContainingProhibitedCharacters(String)} in order to check if the * username contains only valid characters * @param username Username * @return prepared first message * @throws ScramException if <code>username</code> contains prohibited characters */ @Override public String prepareFirstMessage(String username) throws ScramException { if (mState != State.INITIAL) { throw new IllegalStateException("You can call this method only once"); } try { mClientFirstMessageBare = "n=" + StringPrep.prepAsQueryString(username) + ",r=" + mClientNonce; mState = State.FIRST_PREPARED; return GS2_HEADER + mClientFirstMessageBare; } catch (StringPrep.StringPrepError e) { mState = State.ENDED; throw new ScramException("Username contains prohibited character"); } } @Override public String prepareFinalMessage(String password, String serverFirstMessage) throws ScramException { if (mState != State.FIRST_PREPARED) { throw new IllegalStateException("You can call this method once only after " + "calling prepareFirstMessage()"); } Matcher m = SERVER_FIRST_MESSAGE.matcher(serverFirstMessage); if (!m.matches()) { mState = State.ENDED; return null; } String nonce = m.group(1); if (!nonce.startsWith(mClientNonce)) { mState = State.ENDED; return null; } String salt = m.group(2); String iterationCountString = m.group(3); int iterations = Integer.parseInt(iterationCountString); if (iterations <= 0) { mState = State.ENDED; return null; } try { mSaltedPassword = ScramUtils.generateSaltedPassword(password, Base64.decode(salt), iterations, mHmacName); String clientFinalMessageWithoutProof = "c=" + Base64.encodeBytes(GS2_HEADER.getBytes(ASCII) , Base64.DONT_BREAK_LINES) + ",r=" + nonce; mAuthMessage = mClientFirstMessageBare + "," + serverFirstMessage + "," + clientFinalMessageWithoutProof; byte[] clientKey = ScramUtils.computeHmac(mSaltedPassword, mHmacName, "Client Key"); byte[] storedKey = MessageDigest.getInstance(mDigestName).digest(clientKey); byte[] clientSignature = ScramUtils.computeHmac(storedKey, mHmacName, mAuthMessage); byte[] clientProof = clientKey.clone(); for (int i = 0; i < clientProof.length; i++) { clientProof[i] ^= clientSignature[i]; } mState = State.FINAL_PREPARED; return clientFinalMessageWithoutProof + ",p=" + Base64.encodeBytes(clientProof, Base64.DONT_BREAK_LINES); } catch (InvalidKeyException | NoSuchAlgorithmException e) { mState = State.ENDED; throw new ScramException(e); } } @Override public boolean checkServerFinalMessage(String serverFinalMessage) throws ScramException { if (mState != State.FINAL_PREPARED) { throw new IllegalStateException("You can call this method only once after " + "calling prepareFinalMessage()"); } Matcher m = SERVER_FINAL_MESSAGE.matcher(serverFinalMessage); if (!m.matches()) { mState = State.ENDED; return false; } byte[] serverSignature = Base64.decode(m.group(1)); mState = State.ENDED; mIsSuccessful = Arrays.equals(serverSignature, getExpectedServerSignature()); return mIsSuccessful; } @Override public boolean isSuccessful() { if (mState == State.ENDED) { return mIsSuccessful; } else { throw new IllegalStateException("You cannot call this method before authentication is ended. " + "Use isEnded() to check that"); } } @Override public boolean isEnded() { return mState == State.ENDED; } @Override public State getState() { return mState; } private byte[] getExpectedServerSignature() throws ScramException { try { byte[] serverKey = ScramUtils.computeHmac(mSaltedPassword, mHmacName, "Server Key"); return ScramUtils.computeHmac(serverKey, mHmacName, mAuthMessage); } catch (InvalidKeyException | NoSuchAlgorithmException e) { mState = State.ENDED; throw new ScramException(e); } } }
61d83421cd403bdff64b252c5418dfab3817f78f
34df9168274d9814b11cd99b38df740edba0b42e
/src/_0B_Applet/SimpleBanner.java
6d74e4c64bf541b50362591c108f8ffbef87ebaf
[]
no_license
SinoshK/Java_Wyklad
781dba7835cb6e142daf8a003f0a67226c1dbbc4
016735e9c6050dc40efbe0d475da0066d64017c5
refs/heads/master
2020-04-06T20:23:30.536027
2019-01-27T18:23:25
2019-01-27T18:23:25
157,770,868
0
0
null
2018-11-15T20:49:15
2018-11-15T20:49:15
null
UTF-8
Java
false
false
976
java
package _0B_Applet; // Przyklad odświeżania okna import java.awt.*; import java.applet.*; public class SimpleBanner extends Applet implements Runnable { String msg = " To jest bardzo duzy banner "; Thread t = null; int state; boolean stopFlag; // ustaw kolory public void init() { setBackground(Color.cyan); setForeground(Color.red); state = 0; } public void start() { t = new Thread(this); stopFlag = false; t.start(); } // cialo watku public void run() { char ch; // wyswietl banner for (;;) { try { repaint(); state += 1; Thread.sleep(250); ch = msg.charAt(0); msg = msg.substring(1, msg.length()); msg += ch; if (stopFlag) break; } catch (InterruptedException e) { } } } // zatrzymaj aplet, baner tez public void stop() { stopFlag = true; t = null; } // wyswietl banner public void paint(Graphics g) { g.drawString(msg, 50, 30); showStatus("Banner po raz: " + state); } }
4f4ea3d88ac4225fdc9fbeb308c4634c72ea615d
410c4362a7d3cc3ca3c7eef852602a95665623f4
/src/com/wemall/manage/seller/action/seller_informationAction.java
b6a28815bc56a5d141d2473e6fbb002381f08614
[]
no_license
King-Pan/Druglots
a83f2d774f04e7376ffeb649c50377c8bc2050ae
db7a0a9c83dc93a55de7641a6647b910d6bbd658
refs/heads/master
2020-06-29T01:07:13.291713
2019-08-03T16:08:14
2019-08-03T16:08:14
200,394,080
0
0
null
null
null
null
UTF-8
Java
false
false
3,875
java
package com.wemall.manage.seller.action; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.wemall.core.annotation.SecurityMapping; import com.wemall.core.domain.virtual.SysMap; import com.wemall.core.mv.JModelAndView; import com.wemall.core.query.PageList; import com.wemall.core.query.support.IPageList; import com.wemall.core.security.support.SecurityUserHolder; import com.wemall.core.tools.CommUtil; import com.wemall.core.tools.HttpClass; import com.wemall.foundation.domain.Authentication; import com.wemall.foundation.domain.InvoiceRecord; import com.wemall.foundation.domain.query.RefundLogQueryObject; import com.wemall.foundation.service.AuthenticationService; import com.wemall.foundation.service.IRefundLogService; import com.wemall.foundation.service.ISysConfigService; import com.wemall.foundation.service.IUserConfigService; /** * 卖家订单发票记录查询 * @author Administrator * */ @Controller public class seller_informationAction { @Autowired private ISysConfigService configService; @Autowired private IUserConfigService userConfigService; @Autowired private IRefundLogService refundLogService; @Autowired private AuthenticationService authenticationService; @SecurityMapping(display = false, rsequence = 0, title = "卖家订单发票列表", value = "/seller/seller_information.htm*", rtype = "seller", rname = "卖家订单发票列表", rcode = "refund_seller", rgroup = "客户服务") @RequestMapping({"/seller/seller_information.htm"}) public ModelAndView refund(HttpServletRequest request, HttpServletResponse response, String currentPage){ ModelAndView mv = new JModelAndView( "user/default/usercenter/seller_in.html", this.configService .getSysConfig(), this.userConfigService.getUserConfig(), 0, request, response); HttpClass hc = new HttpClass(); if (currentPage==null || currentPage=="") { currentPage="1"; } try { String username = SecurityUserHolder.getCurrentUser().getStore().getStore_ower(); String Load = hc.load("http://127.0.0.1:8081/ssm_project/selefenyemai", "currentPage="+currentPage+"&"+"username="+username); PageList pList= JSON.parseObject(Load, PageList.class); //从封装的分页获取Result的json数组 List<JSONObject> jsons=pList.getResult(); List<InvoiceRecord> list= new ArrayList<>(); Map map = new HashMap(); //得到查询结果遍历得到买家名称,去首营认证表去获取企业名称 for (JSONObject json : jsons) { InvoiceRecord invoiceRecord1=JSON.parseObject(JSONObject.toJSONString(json),InvoiceRecord.class); map.clear(); map.put("userName", invoiceRecord1.getBuyname()); List<Authentication> auths=this.authenticationService.query("select obj from Authentication obj where obj.userName=:userName", map, -1, -1); invoiceRecord1.setAuth(auths.get(0).getEnterpriseName()); list.add(invoiceRecord1); } pList.setResult(list); CommUtil.saveIPageList2ModelAndView("seller_information.htm", "", "", pList, mv); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } return mv; } }
edc39b288b7d7925dc86806b97a6d5e11fbded22
7991248e6bccacd46a5673638a4e089c8ff72a79
/storage/common/src/main/java/org/artifactory/model/xstream/fs/InternalFolderInfo.java
6bcf427cb2ff079b2e8d4cb19fd0520316c88150
[]
no_license
theoriginalshaheedra/artifactory-oss
69b7f6274cb35c79db3a3cd613302de2ae019b31
415df9a9467fee9663850b4b8b4ee5bd4c23adeb
refs/heads/master
2023-04-23T15:48:36.923648
2021-05-05T06:15:24
2021-05-05T06:15:24
364,455,815
1
0
null
2021-05-05T07:11:40
2021-05-05T03:57:33
Java
UTF-8
Java
false
false
1,095
java
/* * * Artifactory is a binaries repository manager. * Copyright (C) 2018 JFrog Ltd. * * Artifactory is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Artifactory is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with Artifactory. If not, see <http://www.gnu.org/licenses/>. * */ package org.artifactory.model.xstream.fs; import org.artifactory.fs.MutableFolderInfo; /** * @author Yoav Landman */ public interface InternalFolderInfo extends InternalItemInfo, MutableFolderInfo { void setAdditionalInfo(FolderAdditionalInfo additionalInfo); @Override FolderAdditionalInfo getAdditionalInfo(); }
6d2bf8f2448a8e7e0983120603ae2e579e18ce37
a7e0488a42a781a30c5e418d451064898d4717c1
/nest-plus-demo/src/main/java/com/zhaofujun/nest/demo/DemoApplication.java
094b6c090f88b261cb06c7eba56c14321450a076
[]
no_license
455586841/nest-plus
89056f9b6e37b1fe687b58cce72a6348557a9e9d
1e1ef483635595ae4ea87e629694352ae6542986
refs/heads/master
2023-06-14T21:56:39.595522
2021-07-12T10:15:07
2021-07-12T10:15:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
724
java
package com.zhaofujun.nest.demo; import com.zhaofujun.nest.utils.LockUtils; import org.springframework.beans.BeansException; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; @SpringBootApplication @EnableJpaRepositories public class DemoApplication { public static int[] i = {0}; public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } }
db6b14d710a2daa45c555529876cfad0131e232f
cedde0eb09d399aaf494e355ee5de9382c0d5883
/app/src/main/java/com/edgar/yurihome/adapters/ChapterListAdapter.java
6402c1bde9a069791027890f2445eeb7e3ac839d
[]
no_license
Hifairlady/YuriHome
4b6b027d11ead449186b48ea6d46a65e258eb8cb
93386a307c117f93f7d99c820c949dc37c9dee07
refs/heads/master
2022-12-30T11:12:57.036742
2020-10-21T19:54:11
2020-10-21T19:54:11
281,014,507
0
0
null
null
null
null
UTF-8
Java
false
false
6,839
java
package com.edgar.yurihome.adapters; import android.content.Context; import android.content.Intent; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; import com.edgar.yurihome.R; import com.edgar.yurihome.beans.ComicDetailsBean; import com.edgar.yurihome.scenarios.ChapterFullListActivity; import com.edgar.yurihome.scenarios.ComicReaderActivity; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.Collections; import java.util.List; public class ChapterListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { private static final int SHORT_LIST_LIMIT_NUM = 9; public static final int SORT_ORDER_ASC = 0; public static final int SORT_ORDER_DESC = 1; private Context mContext; private ArrayList<ComicDetailsBean.ChaptersBean.DataBean> shortDataList = new ArrayList<>(); private ArrayList<ComicDetailsBean.ChaptersBean.DataBean> fullDataList = new ArrayList<>(); private int lastChapterId; private boolean isCurOrderAsc = false; private boolean viewFullList = false; private int comicId; private String comicName, chapterLongTitle, chapterPartTitle; private long chapterUpdateTime; public ChapterListAdapter(Context mContext, List<ComicDetailsBean.ChaptersBean.DataBean> dataList, int lastChapterId, boolean fullList, int comicId, String comicName, String chapterPartTitle) { this.mContext = mContext; this.fullDataList = new ArrayList<>(dataList); this.lastChapterId = lastChapterId; this.viewFullList = fullList; this.comicId = comicId; this.comicName = comicName; this.chapterPartTitle = chapterPartTitle; initData(); } @NonNull @Override public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View view = LayoutInflater.from(mContext).inflate(R.layout.item_layout_chapter_list, parent, false); return new ChapterHolder(view); } @Override public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, final int position) { final ComicDetailsBean.ChaptersBean.DataBean dataBean = shortDataList.get(position); ChapterHolder mHolder = (ChapterHolder) holder; if (dataBean.getItemType() == ComicDetailsBean.ChaptersBean.DataBean.MORE_ITEM_TYPE) { mHolder.btnChapterItem.setText("..."); } else { mHolder.btnChapterItem.setText(dataBean.getChapterTitle()); } if (lastChapterId == dataBean.getChapterId()) { mHolder.tvNewLabel.setVisibility(View.VISIBLE); } else { mHolder.tvNewLabel.setVisibility(View.GONE); } mHolder.btnChapterItem.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { chapterUpdateTime = dataBean.getUpdatetime(); chapterLongTitle = chapterPartTitle + "/" + dataBean.getChapterTitle(); if (dataBean.getItemType() == ComicDetailsBean.ChaptersBean.DataBean.MORE_ITEM_TYPE) { Intent intent = new Intent(mContext, ChapterFullListActivity.class); intent.putExtra("FULL_DATA_LIST_JSON", getFullListJson()); intent.putExtra("LAST_CHAPTER_ID", lastChapterId); intent.putExtra("COMIC_ID", comicId); intent.putExtra("COMIC_NAME", comicName); intent.putExtra("CHAPTER_ID", dataBean.getChapterId()); intent.putExtra("CHAPTER_UPDATE_TIME", chapterUpdateTime); intent.putExtra("CHAPTER_PART_TITLE", chapterPartTitle); mContext.startActivity(intent); } else { Intent readerIntent = new Intent(mContext, ComicReaderActivity.class); readerIntent.putExtra("COMIC_ID", comicId); readerIntent.putExtra("COMIC_NAME", comicName); readerIntent.putExtra("CHAPTER_ID", dataBean.getChapterId()); readerIntent.putExtra("CHAPTER_UPDATE_TIME", chapterUpdateTime); readerIntent.putExtra("CHAPTER_LONG_TITLE", chapterLongTitle); readerIntent.putExtra("FULL_CHAPTER_LIST_JSON", getFullListJson()); readerIntent.putExtra("CUR_CHAPTER_POSITION", position); int order = isCurOrderAsc ? SORT_ORDER_ASC : SORT_ORDER_DESC; readerIntent.putExtra("SORT_ORDER", order); readerIntent.putExtra("LAST_CHAPTER_ID", lastChapterId); mContext.startActivity(readerIntent); } } }); } @Override public int getItemCount() { return (shortDataList == null ? 0 : shortDataList.size()); } public void switchOrder(int order) { if (order == SORT_ORDER_ASC && !isCurOrderAsc) { isCurOrderAsc = true; Collections.reverse(fullDataList); initData(); notifyDataSetChanged(); } if (order == SORT_ORDER_DESC && isCurOrderAsc) { isCurOrderAsc = false; Collections.reverse(fullDataList); initData(); notifyDataSetChanged(); } } private void initData() { if (fullDataList.size() > SHORT_LIST_LIMIT_NUM && !viewFullList) { List<ComicDetailsBean.ChaptersBean.DataBean> tempBeans = fullDataList.subList(0, SHORT_LIST_LIMIT_NUM - 1); shortDataList = new ArrayList<>(tempBeans); ComicDetailsBean.ChaptersBean.DataBean temp = new ComicDetailsBean.ChaptersBean.DataBean(ComicDetailsBean.ChaptersBean.DataBean.MORE_ITEM_TYPE); shortDataList.add(shortDataList.size(), temp); } else { shortDataList = new ArrayList<>(fullDataList); } } public String getFullListJson() { String jsonString; Gson gson = new Gson(); Type type = new TypeToken<ArrayList<ComicDetailsBean.ChaptersBean.DataBean>>() { }.getType(); jsonString = gson.toJson(fullDataList, type); return jsonString; } private class ChapterHolder extends RecyclerView.ViewHolder { private TextView btnChapterItem; private TextView tvNewLabel; public ChapterHolder(@NonNull View itemView) { super(itemView); btnChapterItem = itemView.findViewById(R.id.btn_chapter_item); tvNewLabel = itemView.findViewById(R.id.tv_chapter_new_label); } } }
a99b0acd669a8ac696d4f5407efadd316bcd6058
bb476d733fd606bcdc2ea2d3962fb57654cb92ba
/kickstart-platform/src/main/java/platform/webservice/ui/html/ASIDE.java
92e11ef034e7873ad44fbcd39f3f00820b8beb8c
[]
no_license
FullStackNet/kickstart
9e2a5ec795e86f4db9089d2dee84abc4d3b1ab19
eea95dcef054db66e620e98a079fa1a6aab802f5
refs/heads/master
2021-05-16T17:32:37.594867
2018-01-10T17:52:11
2018-01-10T17:52:11
100,499,456
1
0
null
null
null
null
UTF-8
Java
false
false
383
java
package platform.webservice.ui.html; public class ASIDE extends BaseHTMLComponent{ public ASIDE() { super(); } public ASIDE(String id,String className) { super(id,className); } public ASIDE(String id, String name,String className) { super(id,name,className); } @Override public String getTag() { // TODO Auto-generated method stub return "aside"; } }
94c7bc6d37732d4d4b8013b01b6aa3a82a873a81
3247360ea20edce37f6f2ab727a403644bd44497
/bitcamp-java-application4-server/v56_5/src/main/java/com/eomcs/lms/Servlet/FooterServlet.java
003e339506857a55d48810f2587b7d0049fbb82b
[]
no_license
choitaehoon1998/bitcamp-java-20190527
57b1774d50f245b0b77016f0ae541710233010b6
2450c3042642df3eae2fc896e12c376c7d27b048
refs/heads/master
2020-06-13T20:17:08.537015
2019-10-15T12:30:20
2019-10-15T12:30:20
194,775,340
0
0
null
2020-04-30T11:45:18
2019-07-02T02:41:02
Java
UTF-8
Java
false
false
1,135
java
package com.eomcs.lms.Servlet; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; // 역활 : // => 화면 하단에 제작자와 사이트의 소유주 정보을 출력한다 . @WebServlet("/footer") public class FooterServlet extends HttpServlet { private static final long serialVersionUID = 1L; @Override protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { //인클루딩 서블릿에서는 setContentType()을 호출해봐야 소용 없다 // 이서블릿을 요청하는 쪽에서 처리해야한다 . //response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); out.println("<div id='footer'>"); out.println(" &copy; 2019"); out.println(" <span>비트캠프, 자바130기</span>"); out.println("</div>"); } }
8984926a017c65113397984c82192e30cac42aff
bb2f3c0d834beb50341e9d03b3b96c24438a88ac
/milton/milton-caldav/src/main/java/info/ineighborhood/cardme/vcard/types/NoteType.java
c7ee213466c3113a59603e8b629793d2fb58b5e8
[ "Apache-2.0" ]
permissive
skoulouzis/lobcder
3e004d3e896fe9e600da931d8fb82c72a746c491
23bf0cc9c78f506193bb9ba9f6543e5f5597ae4d
refs/heads/dev
2022-02-22T20:56:32.472320
2022-02-08T10:07:01
2022-02-08T10:07:01
26,593,878
7
3
Apache-2.0
2022-02-08T10:07:02
2014-11-13T15:23:44
Java
UTF-8
Java
false
false
3,885
java
package info.ineighborhood.cardme.vcard.types; import info.ineighborhood.cardme.util.Util; import info.ineighborhood.cardme.vcard.EncodingType; import info.ineighborhood.cardme.vcard.VCardType; import info.ineighborhood.cardme.vcard.features.NoteFeature; import info.ineighborhood.cardme.vcard.types.parameters.ParameterTypeStyle; /** * Copyright (c) 2004, Neighborhood Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * Neither the name of Neighborhood Technologies nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ /** * * @author George El-Haddad * <br/> * Feb 10, 2010 * */ public class NoteType extends Type implements NoteFeature { private String note = null; public NoteType() { this(null); } public NoteType(String note) { super(EncodingType.EIGHT_BIT, ParameterTypeStyle.PARAMETER_VALUE_LIST); setNote(note); } /** * {@inheritDoc} */ public String getNote() { return note; } /** * {@inheritDoc} */ public void setNote(String note) { this.note = note; } /** * {@inheritDoc} */ public boolean hasNote() { return note != null; } /** * {@inheritDoc} */ @Override public String getTypeString() { return VCardType.NOTE.getType(); } /** * {@inheritDoc} */ @Override public boolean equals(Object obj) { if(obj != null) { if(obj instanceof NoteType) { if(this == obj || ((NoteType)obj).hashCode() == this.hashCode()) { return true; } else { return false; } } else { return false; } } else { return false; } } /** * {@inheritDoc} */ @Override public int hashCode() { return Util.generateHashCode(toString()); } /** * {@inheritDoc} */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(this.getClass().getName()); sb.append("[ "); if(encodingType != null) { sb.append(encodingType.getType()); sb.append(","); } if(note != null) { sb.append(note); sb.append(","); } if(super.id != null) { sb.append(super.id); sb.append(","); } sb.deleteCharAt(sb.length()-1); //Remove last comma. sb.append(" ]"); return sb.toString(); } /** * {@inheritDoc} */ @Override public NoteFeature clone() { NoteType cloned = new NoteType(); if(note != null) { cloned.setNote(new String(note)); } cloned.setParameterTypeStyle(getParameterTypeStyle()); cloned.setEncodingType(getEncodingType()); cloned.setID(getID()); return cloned; } }
304a13bac05d762b687d0680415b634918294a49
86597e88e41b767dbff78bafea24a0eaa1d3e0cb
/jppf/JPPF-4.0.1-full-src/tests/src/framework/test/org/jppf/test/setup/common/CountingJobListener.java
7dde75ab7867a8afcd69762ce29e4faf0d728f43
[]
no_license
Eduardo555/JPPF---Codigos-Exemplos
e2e9bde8263ae1aa8573bd98cbe2e94398723872
e5ffccffbb1250d20eb5366b7eb91c6b3f951f17
refs/heads/master
2021-05-15T12:46:33.598336
2017-10-27T01:30:16
2017-10-27T01:30:16
108,477,484
0
0
null
null
null
null
UTF-8
Java
false
false
1,754
java
/* * JPPF. * Copyright (C) 2005-2014 JPPF Team. * http://www.jppf.org * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package test.org.jppf.test.setup.common; import java.util.concurrent.atomic.AtomicInteger; import org.jppf.client.event.*; /** * A simple job listener. */ public class CountingJobListener extends JobListenerAdapter { /** * The count of 'jobStarted' notifications. */ public AtomicInteger startedCount = new AtomicInteger(0); /** * The count of 'jobEnded' notifications. */ public AtomicInteger endedCount = new AtomicInteger(0); /** * The count of 'jobDispatched' notifications. */ public AtomicInteger dispatchedCount = new AtomicInteger(0); /** * The count of 'jobReturned' notifications. */ public AtomicInteger returnedCount = new AtomicInteger(0); @Override public void jobStarted(final JobEvent event) { startedCount.incrementAndGet(); } @Override public void jobEnded(final JobEvent event) { endedCount.incrementAndGet(); } @Override public void jobDispatched(final JobEvent event) { dispatchedCount.incrementAndGet(); } @Override public void jobReturned(final JobEvent event) { returnedCount.incrementAndGet(); } }
e782e06fce40cfee82861e8b34cd8086a0fa7444
20eb62855cb3962c2d36fda4377dfd47d82eb777
/IntroClassJava/dataset/grade/f5b56c79c624eac7c37c45c1540916bb9b5f5db93e2a426a282a5d0eacde86b4b1e5d1d119eeb06f0ead94d2e4f228dca8dde4ef511af4bc59a18d272d820a0e/000/mutations/128/grade_f5b56c79_000.java
8d1bfd5d7194633f8f7d95db5afc6b7d6568b875
[]
no_license
ozzydong/CapGen
356746618848065cce4e253e5d3c381baa85044a
0ba0321b6b1191443276021f1997833342f02515
refs/heads/master
2023-03-18T20:12:02.923428
2020-08-21T03:08:28
2020-08-21T03:08:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,480
java
package introclassJava; class IntObj { public int value; public IntObj () { } public IntObj (int i) { value = i; } } class FloatObj { public float value; public FloatObj () { } public FloatObj (float i) { value = i; } } class LongObj { public long value; public LongObj () { } public LongObj (long i) { value = i; } } class DoubleObj { public double value; public DoubleObj () { } public DoubleObj (double i) { value = i; } } class CharObj { public char value; public CharObj () { } public CharObj (char i) { value = i; } } public class grade_f5b56c79_000 { public java.util.Scanner scanner; public String output = ""; public static void main (String[]args) throws Exception { grade_f5b56c79_000 mainClass = new grade_f5b56c79_000 (); String output; if (args.length > 0) { mainClass.scanner = new java.util.Scanner (args[0]); } else { mainClass.scanner = new java.util.Scanner (System.in); } mainClass.exec (); System.out.println (mainClass.output); } public void exec () throws Exception { FloatObj A = new FloatObj (), B = new FloatObj (), C = new FloatObj (), D = new FloatObj (), score = new FloatObj (); output += (String.format ("Enter thresholds for A, B, C, D\n")); output += (String.format ("in that order, decreasing percentages > ")); A.value = scanner.nextFloat (); B.value = scanner.nextFloat (); C.value = scanner.nextFloat (); D.value = scanner.nextFloat (); output += (String.format ("Thank you. Now enter student score (percent) >")); score.value = scanner.nextFloat (); if (score.value > A.value) { output += (String.format ("Stdent has an A grade\n")); } else if (score.value < A.value && score.value > B.value) { output += (String.format ("Student has an B grade\n")); } else if (score.value < B.value && score.value > score.value) { output += (String.format ("Student has an C grade\n")); } else if (score.value < C.value && score.value > D.value) { output += (String.format ("Student has an D grade\n")); } else { output += (String.format ("Student has failed the course\n")); } if (true) return;; } }
2de235082f7196bf05b86cc62e6d99d6f8a3ce1d
aa0590e0ddd3d54abdbc05d50f36318b6687a98d
/uranus/src/test/java/com/lotus/learn/thinkinginjava/concurrency/BankTellerSimulation.java
9cfe5cf5c841b26a22e8782cef8f7dcd33b67d68
[]
no_license
surmount1314/lotus
7d4fb311f3187292c6bbd36891c660dc7d0b807c
aca0926b3f240c6efae4b6d4116815272060d57b
refs/heads/master
2022-12-23T22:02:15.548613
2018-04-22T08:03:29
2018-04-22T08:03:29
130,483,115
0
0
null
2022-12-16T03:53:35
2018-04-21T14:49:38
Java
UTF-8
Java
false
false
6,712
java
package com.lotus.learn.thinkinginjava.concurrency; //: concurrency/BankTellerSimulation.java // Using queues and multithreading. // {Args: 5} import java.util.LinkedList; import java.util.PriorityQueue; import java.util.Queue; import java.util.Random; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; // Read-only objects don't require synchronization: class Customer { private final int serviceTime; public Customer(int tm) { serviceTime = tm; } public int getServiceTime() { return serviceTime; } public String toString() { return "[" + serviceTime + "]"; } } // Teach the customer line to display itself: class CustomerLine extends ArrayBlockingQueue<Customer> { public CustomerLine(int maxLineSize) { super(maxLineSize); } public String toString() { if (this.size() == 0) return "[Empty]"; StringBuilder result = new StringBuilder(); for (Customer customer : this) result.append(customer); return result.toString(); } } // Randomly add customers to a queue: class CustomerGenerator implements Runnable { private CustomerLine customers; private static Random rand = new Random(47); public CustomerGenerator(CustomerLine cq) { customers = cq; } public void run() { try { while (!Thread.interrupted()) { TimeUnit.MILLISECONDS.sleep(rand.nextInt(300)); customers.put(new Customer(rand.nextInt(1000))); } } catch (InterruptedException e) { System.out.println("CustomerGenerator interrupted"); } System.out.println("CustomerGenerator terminating"); } } class Teller implements Runnable, Comparable<Teller> { private static int counter = 0; private final int id = counter++; // Customers served during this shift: private int customersServed = 0; private CustomerLine customers; private boolean servingCustomerLine = true; public Teller(CustomerLine cq) { customers = cq; } public void run() { try { while (!Thread.interrupted()) { Customer customer = customers.take(); TimeUnit.MILLISECONDS.sleep(customer.getServiceTime()); synchronized (this) { customersServed++; while (!servingCustomerLine) wait(); } } } catch (InterruptedException e) { System.out.println(this + "interrupted"); } System.out.println(this + "terminating"); } public synchronized void doSomethingElse() { customersServed = 0; servingCustomerLine = false; } public synchronized void serveCustomerLine() { assert !servingCustomerLine : "already serving: " + this; servingCustomerLine = true; notifyAll(); } public String toString() { return "Teller " + id + " "; } public String shortString() { return "T" + id; } // Used by priority queue: public synchronized int compareTo(Teller other) { return customersServed < other.customersServed ? -1 : (customersServed == other.customersServed ? 0 : 1); } } class TellerManager implements Runnable { private ExecutorService exec; private CustomerLine customers; private PriorityQueue<Teller> workingTellers = new PriorityQueue<Teller>(); private Queue<Teller> tellersDoingOtherThings = new LinkedList<Teller>(); private int adjustmentPeriod; private static Random rand = new Random(47); public TellerManager(ExecutorService e, CustomerLine customers, int adjustmentPeriod) { exec = e; this.customers = customers; this.adjustmentPeriod = adjustmentPeriod; // Start with a single teller: Teller teller = new Teller(customers); exec.execute(teller); workingTellers.add(teller); } public void adjustTellerNumber() { // This is actually a control system. By adjusting // the numbers, you can reveal stability issues in // the control mechanism. // If line is too long, add another teller: if (customers.size() / workingTellers.size() > 2) { // If tellers are on break or doing // another job, bring one back: if (tellersDoingOtherThings.size() > 0) { Teller teller = tellersDoingOtherThings.remove(); teller.serveCustomerLine(); workingTellers.offer(teller); return; } // Else create (hire) a new teller Teller teller = new Teller(customers); exec.execute(teller); workingTellers.add(teller); return; } // If line is short enough, remove a teller: if (workingTellers.size() > 1 && customers.size() / workingTellers.size() < 2) reassignOneTeller(); // If there is no line, we only need one teller: if (customers.size() == 0) while (workingTellers.size() > 1) reassignOneTeller(); } // Give a teller a different job or a break: private void reassignOneTeller() { Teller teller = workingTellers.poll(); teller.doSomethingElse(); tellersDoingOtherThings.offer(teller); } public void run() { try { while (!Thread.interrupted()) { TimeUnit.MILLISECONDS.sleep(adjustmentPeriod); adjustTellerNumber(); System.out.print(customers + " { "); for (Teller teller : workingTellers) System.out.print(teller.shortString() + " "); System.out.println("}"); } } catch (InterruptedException e) { System.out.println(this + "interrupted"); } System.out.println(this + "terminating"); } public String toString() { return "TellerManager "; } } public class BankTellerSimulation { static final int MAX_LINE_SIZE = 50; static final int ADJUSTMENT_PERIOD = 1000; public static void main(String[] args) throws Exception { ExecutorService exec = Executors.newCachedThreadPool(); // If line is too long, customers will leave: CustomerLine customers = new CustomerLine(MAX_LINE_SIZE); exec.execute(new CustomerGenerator(customers)); // Manager will add and remove tellers as necessary: exec.execute(new TellerManager(exec, customers, ADJUSTMENT_PERIOD)); if (args.length > 0) // Optional argument TimeUnit.SECONDS.sleep(new Integer(args[0])); else { System.out.println("Press 'Enter' to quit"); System.in.read(); } exec.shutdownNow(); } } /* * Output: (Sample) [429][200][207] { T0 T1 } [861][258][140][322] { T0 T1 } [575][342][804][826][896][984] { T0 T1 T2 } * [984][810][141][12][689][992][976][368][395][354] { T0 T1 T2 T3 } Teller 2 interrupted Teller 2 terminating Teller 1 interrupted Teller 1 * terminating TellerManager interrupted TellerManager terminating Teller 3 interrupted Teller 3 terminating Teller 0 interrupted Teller 0 terminating * CustomerGenerator interrupted CustomerGenerator terminating */// :~
1a065b0203856ae3d87d72a6ae57ce5e01a6f076
7c961c5ef78ea0577c78c49ebb8ede5cd00ac82e
/app/src/main/java/com/guc/testdragger2/bean/Cat.java
f52c8e012870b3d5d0a5935b4c5a1b25ffb68bfb
[]
no_license
GuchaoGit/TestDragger2
90373f1684f52e04687303617b2fc81cdc172bac
5c400ad29bbef64c4454563011dde7e80f94390b
refs/heads/master
2020-04-07T15:49:19.607666
2018-11-23T03:05:49
2018-11-23T03:05:49
158,502,368
0
0
null
null
null
null
UTF-8
Java
false
false
602
java
package com.guc.testdragger2.bean; import android.text.TextUtils; import android.util.Log; /** * Created by guc on 2018/11/21. * 描述: */ public class Cat { private static final String TAG = "Cat"; private String name; private Fish mFish; public Cat(Fish fish) { this.mFish = fish; } public Cat() { } public void eat() { Log.e(TAG, TextUtils.isEmpty(name) ? "eat:吃鱼 " : name + " eat:吃鱼"); if (mFish != null) { mFish.eat(); } } public void setName(String name) { this.name = name; } }
eb8a4c758a6cd5e73f7db6c3808ef86a80540ad9
420def46118cfd80ac4dbeab53cf5970bfabc637
/slack-api-model/src/main/java/com/slack/api/model/event/MessageChangedEvent.java
4728b92fc5b6211be273228c968102850a1df5f9
[ "MIT" ]
permissive
Hariprasad-Ramakrishnan/java-slack-sdk
44048725ecaffe4356497c084eab090275acef9c
425bb2b381ad69433b3d7dae6d689ba3cf6a1e18
refs/heads/master
2022-11-14T21:09:05.417022
2020-06-19T06:24:59
2020-06-19T06:24:59
273,747,633
0
0
MIT
2020-06-20T16:48:38
2020-06-20T16:48:37
null
UTF-8
Java
false
false
1,582
java
package com.slack.api.model.event; import com.google.gson.annotations.SerializedName; import com.slack.api.model.Attachment; import com.slack.api.model.Reaction; import com.slack.api.model.block.LayoutBlock; import lombok.Data; import java.util.List; /** * https://api.slack.com/events/message/message_changed */ @Data public class MessageChangedEvent implements Event { public static final String TYPE_NAME = "message"; public static final String SUBTYPE_NAME = "message_changed"; private final String type = TYPE_NAME; private final String subtype = SUBTYPE_NAME; private String channel; private boolean hidden; private Message message; private Message previousMessage; private String eventTs; private String ts; private String channelType; // app_home, channel, group, im, mpim @Data public static class Message { private String clientMsgId; private final String type = TYPE_NAME; private String subtype; private String user; private String team; private MessageEvent.Edited edited; private String text; private List<LayoutBlock> blocks; private List<Attachment> attachments; private String ts; private String userTeam; private String sourceTeam; @SerializedName("is_starred") private boolean starred; private List<String> pinnedTo; private List<Reaction> reactions; } @Data public static class Edited { private String user; private String ts; } }
18c4a7373e517c821dd36777482e30d5015ef9af
f269c1d88eace07323e8c5c867e9c3ba3139edb5
/dk-core/src/main/java/cn/laoshini/dk/dao/package-info.java
0c71bbc937a7f8617776a007f15f4b3d91940335
[ "Apache-2.0" ]
permissive
BestJex/dangkang
6f693f636c13010dd631f150e28496d1ed7e4bc9
de48d5107172d61df8a37d5f597c1140ac0637e6
refs/heads/master
2022-04-17T23:12:06.406884
2020-04-21T14:42:57
2020-04-21T14:42:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,644
java
/** * 该包下定义了当康系统内建数据访问相关功能 * <p> * 这里说一下项目中内建Dao的设计思路,也就是为什么这么设计:<br><br> * <p> * 当康系统的初衷,是为了提供一个拿来即用的、可定制功能的游戏服务器,也就是说这是为不熟悉服务器开发的人、懒人设计的;<br> * 基于以上原因,以及我的能力有限的问题,目前设定的目标服务对象偏向于弱联网游戏;<br> * 在我的设想中,这样的受众并不需要过多关心数据库问题,所以嵌入式数据库其实是最合适的,这样可以少了安装数据库和许多配置方面的烦恼;<br> * 但是关系型数据库,尤其是Mysql肯定是要支持的,而为了减少用户过多的代码工作,所以我在系统中大量使用注解、反射和配置,<br> * 这样用户只需要做一下数据库的初始化,配置一下数据库属性,就可以直接使用系统,后期还可以通过增加配置来扩展新功能。<br><br> * <p> * 所以数据库读写接口(参加 {@link cn.laoshini.dk.dao.IBasicDao})并没有具体的实现类,设计中这应该交给具体项目来实现,<br> * 如键值对数据库访问对象(参见{@link cn.laoshini.dk.dao.IPairDbDao})默认使用的是LevelDB,<br> * 关系型数据库读写功能(参见{@link cn.laoshini.dk.dao.IRelationalDbDao})我是在单独的模块中实现的,目的是鼓励用户自己去实现, * 在需要时向项目中添加实现的依赖即可,并且可以通过配置项来选择使用哪个实现方式。<br> * </p> * <p> * 而用户有一个统一的调用入口类:{@link cn.laoshini.dk.dao.IDefaultDao},这是一个可配置功能定义接口,其使用方式如下: * </p> * <pre>{@code * @Service * public class MyService { * * // 方式1:使用注解自动注入(注入当前默认实现可以不指定实现key): * @FunctionDependent("implKey") * private IDefaultDao defaultDao; * * // 方式2:手动获取当前默认实现 * public IDefaultDao getCurrentDefaultDao() { * return VariousWaysManager.getCurrentImpl(IDefaultDao.class); * } * * // 方式3:手动获取指定实现 * public IDefaultDao getDefaultDaoByKey(String implKey) { * return VariousWaysManager.getFunctionImplByKey(IDefaultDao.class, implKey); * } * } * }</pre> * <p> * 关于可配置功能,具体可参见{@link cn.laoshini.dk.function} * </p> * * @author fagarine */ package cn.laoshini.dk.dao;
9d37fc31ccb585264db1aba2dc4faad6f9d8b76f
a76e89949e23805f55d477ceecc7f83dc25f3ef9
/DAP/library/api/fermat-dap-api/src/main/java/org/fermat/fermat_dap_api/layer/dap_transaction/user_redemption/interfaces/UserRedemptionManager.java
67777bad173fe0dcda7ef34b5315cfa3a8432020
[ "LicenseRef-scancode-warranty-disclaimer", "MIT" ]
permissive
darkestpriest/fermat
d7505c9224a8d46aa3dae23c90fbc3423a530916
32f43e2da7033590ceddecf741589ef405378f6c
refs/heads/bounty
2021-01-17T16:25:30.222457
2016-06-29T12:54:52
2016-06-29T12:54:52
52,879,671
1
14
null
2016-08-07T19:01:35
2016-03-01T13:42:58
Java
UTF-8
Java
false
false
733
java
package org.fermat.fermat_dap_api.layer.dap_transaction.user_redemption.interfaces; import com.bitdubai.fermat_api.layer.all_definition.common.system.interfaces.FermatManager; import org.fermat.fermat_dap_api.layer.all_definition.digital_asset.DigitalAssetMetadata; import java.util.Map; /** * Created by Manuel Perez ([email protected]) on 30/10/15. */ public interface UserRedemptionManager extends FermatManager { void redeemAssetToRedeemPoint(Map<DigitalAssetMetadata, org.fermat.fermat_dap_api.layer.dap_actor.redeem_point.interfaces.ActorAssetRedeemPoint> toRedeem, String walletPublicKey) throws org.fermat.fermat_dap_api.layer.dap_transaction.user_redemption.exceptions.CantRedeemDigitalAssetException; }
ca1122d0a66d25b7f383d6c0282e2904fda7ceec
5e6abc6bca67514b4889137d1517ecdefcf9683a
/Server/src/main/java/org/gielinor/game/system/command/impl/PerkCommand.java
38590c73d68e0d7d0c00d0dee5d4d3351b508a7c
[]
no_license
dginovker/RS-2009-317
88e6d773d6fd6814b28bdb469f6855616c71fc26
9d285c186656ace48c2c67cc9e4fb4aeb84411a4
refs/heads/master
2022-12-22T18:47:47.487468
2019-09-20T21:24:34
2019-09-20T21:24:34
208,949,111
2
2
null
2022-12-15T23:55:43
2019-09-17T03:15:17
Java
UTF-8
Java
false
false
5,442
java
package org.gielinor.game.system.command.impl; import org.apache.commons.lang3.StringUtils; import org.gielinor.game.node.entity.player.Player; import org.gielinor.game.node.entity.player.info.Perk; import org.gielinor.game.node.entity.player.info.Rights; import org.gielinor.game.node.entity.player.info.perk.PerkManagement; import org.gielinor.game.system.command.Command; import org.gielinor.game.system.command.CommandDescription; import org.gielinor.game.world.repository.Repository; /** * Adds, removes, enables or disables a * {@link org.gielinor.game.node.entity.player.info.Perk} for the given player * (if any). * * @author <a href="https://Gielinor.org">Gielinor Logan G.</a> */ public class PerkCommand extends Command { @Override public Rights getRights() { return Rights.GIELINOR_MODERATOR; } @Override public boolean canUse(Player player) { return true; } @Override public String[] getCommands() { return new String[]{ "addperk", "removeperk", "enableperk", "disableperk", "perks" }; } @Override public void init() { CommandDescription.add(new CommandDescription("addperk", "Adds a perk to a player's list", getRights(), "::addperk <lt>perk_id> <lt>[ player_name]><br>Will add perk to your account if player_name is empty")); CommandDescription.add(new CommandDescription("removeperk", "Removes a perk to a player's list", getRights(), "::removeperk <lt>perk_id> <lt>[ player_name]><br>Will remove perk from your account if player_name is empty")); CommandDescription.add(new CommandDescription("enableperk", "Enables a perk for a player", getRights(), "::enableperk <lt>perk_id> <lt>[ player_name]><br>Will enable perk on your account if player_name is empty")); CommandDescription.add(new CommandDescription("disableperk", "Disables a perk for a player", getRights(), "::disableperk <lt>perk_id> <lt>[ player_name]><br>Will disable perk on your account if player_name is empty")); CommandDescription.add(new CommandDescription("perks", "Displays available perks", getRights(), null)); } @Override public void execute(Player player, String[] args) { if (args[0].toLowerCase().startsWith("perks")) { PerkManagement.openPage(player, 0, true); return; } if (args.length < 2) { player.getActionSender().sendMessage("Use as ::" + args[0] + " <lt>perk id>-<lt>[ player name]>"); return; } if (!StringUtils.isNumeric(args[1])) { player.getActionSender().sendMessage("Use as ::" + args[0] + " <lt>perk id>-<lt>[ player name]>"); return; } Perk perk = Perk.forId(Integer.parseInt(args[1])); if (perk == null) { player.getActionSender().sendMessage("Invalid perk id. Type ::perks to see list."); return; } String playerName = null; Player otherPlayer = null; if (args.length >= 3) { playerName = toString(args, 2); otherPlayer = Repository.getPlayerByName(playerName); } else { otherPlayer = player; } if (otherPlayer == null) { player.getActionSender().sendMessage("Player " + playerName + " is not online."); return; } switch (args[0].toLowerCase()) { case "addperk": otherPlayer.getPerkManager().unlock(perk); otherPlayer.getActionSender().sendMessage( "You have been given the perk " + perk.name().toLowerCase().replaceAll("_", " ") + "."); player.getActionSender().sendMessage("Gave perk " + perk.name().toLowerCase().replaceAll("_", " ") + " to " + otherPlayer.getName() + "."); break; case "removeperk": otherPlayer.getPerkManager().remove(perk); otherPlayer.getActionSender().sendMessage("The perk " + perk.name().toLowerCase().replaceAll("_", " ") + " has been removed from your account."); player.getActionSender().sendMessage("Removed perk " + perk.name().toLowerCase().replaceAll("_", " ") + " from " + otherPlayer.getName() + "."); break; case "enableperk": otherPlayer.getPerkManager().enable(perk); otherPlayer.getActionSender().sendMessage("The perk " + perk.name().toLowerCase().replaceAll("_", " ") + " has been enabled on your account."); player.getActionSender().sendMessage("Enabled perk " + perk.name().toLowerCase().replaceAll("_", " ") + " for " + otherPlayer.getName() + "."); break; case "disableperk": otherPlayer.getPerkManager().disable(perk); otherPlayer.getActionSender().sendMessage("The perk " + perk.name().toLowerCase().replaceAll("_", " ") + " has been disabled on your account."); player.getActionSender().sendMessage("Disabled perk " + perk.name().toLowerCase().replaceAll("_", " ") + " for " + otherPlayer.getName() + "."); break; } } }
a4e561aefd26169ff931857c7bda637502315509
15237faf3113c144bad2c134dbe1cfa08756ba12
/opc-da/src/main/java/com/eas/opc/da/dcom/OPCShutdownImpl.java
cef227970e58c1b4b1b8d130b8d4b72952584057
[ "Apache-2.0" ]
permissive
marat-gainullin/platypus-js
3fcf5a60ba8e2513d63d5e45c44c11cb073b07fb
22437b7172a3cbebe2635899608a32943fed4028
refs/heads/master
2021-01-20T12:14:26.954647
2020-06-10T07:06:34
2020-06-10T07:06:34
21,357,013
1
2
Apache-2.0
2020-06-09T20:44:52
2014-06-30T15:56:35
Java
UTF-8
Java
false
false
1,629
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.eas.opc.da.dcom; import java.util.logging.Logger; import org.jinterop.dcom.core.JIFlags; import org.jinterop.dcom.core.JILocalCoClass; import org.jinterop.dcom.core.JILocalInterfaceDefinition; import org.jinterop.dcom.core.JILocalMethodDescriptor; import org.jinterop.dcom.core.JILocalParamsDescriptor; import org.jinterop.dcom.core.JIString; /** * * @author pk */ public class OPCShutdownImpl { final static String IID_IOPCShutdown = "f31dfde1-07b6-11d2-b2d8-0060083ba1fb"; private OPCShutdownListener listener; private JILocalCoClass localClass; OPCShutdownImpl(OPCShutdownListener listener) { this.listener = listener; createCoClass(); } JILocalCoClass getLocalClass() { return localClass; } private void createCoClass() { localClass = new JILocalCoClass(new JILocalInterfaceDefinition(IID_IOPCShutdown, false), this, false); JILocalParamsDescriptor shutdownParams = new JILocalParamsDescriptor(); shutdownParams.addInParamAsObject(JIString.class, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR); JILocalMethodDescriptor shutdownDesc = new JILocalMethodDescriptor("ShutdownRequest", 0, shutdownParams); localClass.getInterfaceDefinition().addMethodDescriptor(shutdownDesc); } public void ShutdownRequest(JIString reason) { Logger.getLogger(OPCShutdownImpl.class.getName()).finest("ShutdownRequest, reason=" + reason); listener.shutdownRequested(reason.getString()); } }
59e2c333398ab61fb5daac74e818981a17c7f739
ab4fd2cdce015e0b443b66f949c6dfb741bf61c9
/src/main/java/com/sun/corba/se/PortableActivationIDL/BadServerDefinitionHolder.java
d3990d86db2f7251a4eac0417b880d7e1d766040
[]
no_license
lihome/jre
5964771e9e3ae7375fa697b8dfcd19656e008160
4fc2a1928f1de6af00ab6f7b0679db073fe0d054
refs/heads/master
2023-05-28T12:13:23.010031
2023-05-10T07:30:15
2023-05-10T07:30:15
116,901,440
0
0
null
2018-11-15T09:49:34
2018-01-10T03:13:15
Java
UTF-8
Java
false
false
1,211
java
package com.sun.corba.se.PortableActivationIDL; /** * com/sun/corba/se/PortableActivationIDL/BadServerDefinitionHolder.java . * Generated by the IDL-to-Java compiler (portable), version "3.2" * from /System/Volumes/Data/jenkins/workspace/8-2-build-macosx-x64/jdk8u371/3355/corba/src/share/classes/com/sun/corba/se/PortableActivationIDL/activation.idl * Friday, March 17, 2023 3:56:47 AM GMT */ public final class BadServerDefinitionHolder implements org.omg.CORBA.portable.Streamable { public com.sun.corba.se.PortableActivationIDL.BadServerDefinition value = null; public BadServerDefinitionHolder () { } public BadServerDefinitionHolder (com.sun.corba.se.PortableActivationIDL.BadServerDefinition initialValue) { value = initialValue; } public void _read (org.omg.CORBA.portable.InputStream i) { value = com.sun.corba.se.PortableActivationIDL.BadServerDefinitionHelper.read (i); } public void _write (org.omg.CORBA.portable.OutputStream o) { com.sun.corba.se.PortableActivationIDL.BadServerDefinitionHelper.write (o, value); } public org.omg.CORBA.TypeCode _type () { return com.sun.corba.se.PortableActivationIDL.BadServerDefinitionHelper.type (); } }
356510a59b4a3146df9a147ed54142bdc7d598d5
762a9124a8883d7c8d3ec2f7e8d007f033c936e0
/rcore/src/main/java/com/yiyou/gamesdk/core/api/impl/ChildrenAccountHistoryManager.java
696650b4b6258005b256c0ddfece6632cace7592
[]
no_license
fyc/HWSDK
7a691278e45af5851d3615f7834f10fd802aa268
fe4cb325e538519478db12a6a33713d37bd9787b
refs/heads/master
2020-04-02T09:04:00.266463
2018-10-23T06:33:54
2018-10-23T06:39:13
154,274,137
0
0
null
null
null
null
UTF-8
Java
false
false
6,175
java
package com.yiyou.gamesdk.core.api.impl; import android.content.ContentValues; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.support.annotation.NonNull; import android.support.v4.util.ArrayMap; import android.text.TextUtils; import com.mobilegamebar.rsdk.outer.util.Log; import com.yiyou.gamesdk.core.CoreManager; import com.yiyou.gamesdk.core.api.ApiFacade; import com.yiyou.gamesdk.core.api.def.IChildrenAccountHistoryApi; import com.yiyou.gamesdk.core.base.http.RequestHelper; import com.yiyou.gamesdk.core.base.http.RequestManager; import com.yiyou.gamesdk.core.base.http.utils.Urlpath; import com.yiyou.gamesdk.core.base.http.volley.HwRequest; import com.yiyou.gamesdk.core.base.http.volley.listener.TtRespListener; import com.yiyou.gamesdk.core.storage.Database; import com.yiyou.gamesdk.core.storage.StorageAgent; import com.yiyou.gamesdk.core.storage.db.global.ChildrenAccountTable; import com.yiyou.gamesdk.model.ChildrenAccountHistoryInfo; import com.yiyou.gamesdk.util.ToastUtils; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; /** * * Created by Nekomimi on 2017/4/24. */ class ChildrenAccountHistoryManager implements IChildrenAccountHistoryApi { private static final String TAG = "RSDK: "+"ChildrenAccountHistoryManager"; private static final Object lock = new Object(); private Map<String, ChildrenAccountHistoryInfo> cache = new LinkedHashMap<>(); public ChildrenAccountHistoryManager() {loadHistoryToCache();} @Override public ChildrenAccountHistoryInfo getChildrenAccountHistory(String userID) { return cache.get(userID); } @Override public List<ChildrenAccountHistoryInfo> getAllChildrenAccountHistories() { return new ArrayList<>(cache.values()); } @Override public void insertOrUpdateChildrenAccountHistory(@NonNull ChildrenAccountHistoryInfo childrenAccountHistoryInfo) { cache.put(String.valueOf(childrenAccountHistoryInfo.childrenUserID) , childrenAccountHistoryInfo); final ContentValues cvToSubmit = ChildrenAccountHistoryInfo.transformToCV(childrenAccountHistoryInfo); StorageAgent.dbAgent().getPublicDatabase() .executeTask(new Database.DatabaseTask() { @Override public void process(SQLiteDatabase database) { database.insertWithOnConflict(ChildrenAccountTable.TABLE_NAME, null, cvToSubmit, SQLiteDatabase.CONFLICT_REPLACE); } }); } @Override public void deleteChildrenAccountHistory(final String childrenUserID) { synchronized (lock) { cache.remove(childrenUserID); } StorageAgent.dbAgent().getPublicDatabase() .executeTask(new Database.DatabaseTask() { @Override public void process(SQLiteDatabase database) { database.delete(ChildrenAccountTable.TABLE_NAME, ChildrenAccountTable.COL_CHILDREN_USER_ID + " = ?", new String[]{ childrenUserID }); } }); } @Override public List<ChildrenAccountHistoryInfo> getChildrenAccountHistory(@NonNull String userId,@NonNull String gameId) { List<ChildrenAccountHistoryInfo> result = new ArrayList<>(); Log.d(TAG, "getChildrenAccountHistory: " + cache.size()); for (ChildrenAccountHistoryInfo childrenAccountHistoryInfo: cache.values()){ if (TextUtils.equals(userId,String.valueOf(childrenAccountHistoryInfo.userID)) && TextUtils.equals(gameId,childrenAccountHistoryInfo.gameId) ){ result.add(childrenAccountHistoryInfo); } } return result; } @Override public List<ChildrenAccountHistoryInfo> getCurrentChildrenAccountHistory() { return getChildrenAccountHistory(String.valueOf(ApiFacade.getInstance().getMainUid()), String.valueOf(ApiFacade.getInstance().getCurrentGameID())); } @Override public void updateCurrentChildrenAccount( List<ChildrenAccountHistoryInfo> accountHistoryInfoList) { List<ChildrenAccountHistoryInfo> originList = getCurrentChildrenAccountHistory(); for (ChildrenAccountHistoryInfo childrenAccountHistoryInfo : originList){ deleteChildrenAccountHistory(childrenAccountHistoryInfo.childrenUserID+""); } for (ChildrenAccountHistoryInfo childrenAccountHistoryInfo : accountHistoryInfoList){ insertOrUpdateChildrenAccountHistory(childrenAccountHistoryInfo); } } @Override public void editChildrenAccountName(long childUserId, String childUserName, TtRespListener callback) { if (childUserId == 0 || TextUtils.isEmpty(childUserName) ){ ToastUtils.showMsg("输入错误"); return; } Map<String, String> params = new ArrayMap<>(); RequestHelper.buildParamsWithBaseInfo(params); params.put("childUserId",String.valueOf(childUserId)); params.put("childUserName",childUserName); HwRequest hwRequest = new HwRequest<>(Urlpath.CHILD_ACCOUNT_UPDATE,params,null,callback); RequestManager.getInstance(CoreManager.getContext()).addRequest(hwRequest, null); } private void loadHistoryToCache() { Cursor cursor = StorageAgent.dbAgent().getPublicDatabase() .query(false, ChildrenAccountTable.TABLE_NAME, null, null, null, null, null, ChildrenAccountTable.COL_LAST_LOGIN_TIME + " DESC", null); if (cursor != null) { try { synchronized (lock) { while (cursor.moveToNext()) { ChildrenAccountHistoryInfo info = ChildrenAccountHistoryInfo.transformFromCursor(cursor); cache.put(String.valueOf(info.childrenUserID) , info); } } }finally { cursor.close(); } } } }
0073cb7ccfdd1fc219e9372fd83541b2303c0ae5
6baf1fe00541560788e78de5244ae17a7a2b375a
/hollywood/com.oculus.gamingactivity-GamingActivity/sources/com/facebook/acra/util/InputStreamField.java
f1a676b131f9cb848a028b46c135e4554e1b2e69
[]
no_license
phwd/quest-tracker
286e605644fc05f00f4904e51f73d77444a78003
3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba
refs/heads/main
2023-03-29T20:33:10.959529
2021-04-10T22:14:11
2021-04-10T22:14:11
357,185,040
4
2
null
2021-04-12T12:28:09
2021-04-12T12:28:08
null
UTF-8
Java
false
false
857
java
package com.facebook.acra.util; import com.facebook.infer.annotation.Nullsafe; import java.io.InputStream; @Nullsafe(Nullsafe.Mode.LOCAL) public class InputStreamField { private InputStream mInputStream; private long mLength; private boolean mSendAsAFile; private boolean mSendCompressed; public InputStreamField(InputStream is, boolean compress, boolean file, long length) { this.mInputStream = is; this.mSendCompressed = compress; this.mSendAsAFile = file; this.mLength = length; } public InputStream getInputStream() { return this.mInputStream; } public boolean getSendCompressed() { return this.mSendCompressed; } public boolean getSendAsFile() { return this.mSendAsAFile; } public long getLength() { return this.mLength; } }
f90af0c7f7330bb0bff4c0919430285c9d58458f
d60e287543a95a20350c2caeabafbec517cabe75
/LACCPlus/Hadoop/422_2.java
ea3fca58d08f8ac9a69e40fd3b2b1c49831374df
[ "MIT" ]
permissive
sgholamian/log-aware-clone-detection
242067df2db6fd056f8d917cfbc143615c558b2c
9993cb081c420413c231d1807bfff342c39aa69a
refs/heads/main
2023-07-20T09:32:19.757643
2021-08-27T15:02:50
2021-08-27T15:02:50
337,837,827
0
0
null
null
null
null
UTF-8
Java
false
false
1,240
java
//,temp,ChecksumFs.java,127,152,temp,ChecksumFileSystem.java,138,161 //,3 public class xxx { public ChecksumFSInputChecker(ChecksumFileSystem fs, Path file, int bufferSize) throws IOException { super( file, fs.getFileStatus(file).getReplication() ); this.datas = fs.getRawFileSystem().open(file, bufferSize); this.fs = fs; Path sumFile = fs.getChecksumFile(file); try { int sumBufferSize = fs.getSumBufferSize(fs.getBytesPerSum(), bufferSize); sums = fs.getRawFileSystem().open(sumFile, sumBufferSize); byte[] version = new byte[CHECKSUM_VERSION.length]; sums.readFully(version); if (!Arrays.equals(version, CHECKSUM_VERSION)) throw new IOException("Not a checksum file: "+sumFile); this.bytesPerSum = sums.readInt(); set(fs.verifyChecksum, DataChecksum.newCrc32(), bytesPerSum, 4); } catch (FileNotFoundException e) { // quietly ignore set(fs.verifyChecksum, null, 1, 0); } catch (IOException e) { // loudly ignore LOG.warn("Problem opening checksum file: "+ file + ". Ignoring exception: " , e); set(fs.verifyChecksum, null, 1, 0); } } };
5552010cf2e446aa59ea884aad830c3c48b02e26
ee7de424b9db9df64956bb409357d3cf9b28e48f
/DesignPattern/src/main/java/com/quiz/arrangement/model/ShoppingCart.java
95c63f35dd5128b9661963a12207f82d71968a6a
[]
no_license
liuxiangwin/Algorithm
7075428f13cc0d6d12f78a12bafbc8ad7810163c
5f579df829cbe049d343c8b4afa1d5e4f2fce8c5
refs/heads/master
2020-12-25T17:13:48.665474
2016-08-08T10:28:34
2016-08-08T10:28:34
19,633,505
0
0
null
null
null
null
UTF-8
Java
false
false
1,345
java
package com.quiz.arrangement.model; import com.quiz.arrangement.util.NumberUtils; import java.io.Serializable; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.springframework.context.annotation.Scope; import org.springframework.context.annotation.ScopedProxyMode; import org.springframework.stereotype.Component; @Component @Scope(value="session", proxyMode=ScopedProxyMode.TARGET_CLASS) @JsonIgnoreProperties(ignoreUnknown=true) public class ShoppingCart implements Serializable{ private static final long serialVersionUID = -1947132804983588610L; private List<ShoppingCartLineItem> lineItems; private double subTotalCost; public ShoppingCart() { lineItems = new CopyOnWriteArrayList<ShoppingCartLineItem>(); } public void addLineItem(ShoppingCartLineItem lineItem) { if(!lineItems.contains(lineItem)) { lineItems.add(lineItem); subTotalCost = NumberUtils.round(subTotalCost + lineItem.calculateTotalPrice()); } } public double getSubTotal() { return subTotalCost; } public List<ShoppingCartLineItem> getLineItems() { return lineItems; } public void setLineItems(List<ShoppingCartLineItem> lineItems) { this.lineItems = lineItems; } public void clear() { subTotalCost = 0.0; lineItems.clear(); } }
d0a59351e0f17cc474bb5408b4dd96ee5be76395
3dd35c0681b374ce31dbb255b87df077387405ff
/generated/com/guidewire/_generated/entity/BOPCostVersionListImpl.java
5a1e0366f57dac6fcf8267cdfdf21c552fbcbdda
[]
no_license
walisashwini/SBTBackup
58b635a358e8992339db8f2cc06978326fed1b99
4d4de43576ec483bc031f3213389f02a92ad7528
refs/heads/master
2023-01-11T09:09:10.205139
2020-11-18T12:11:45
2020-11-18T12:11:45
311,884,817
0
0
null
null
null
null
UTF-8
Java
false
false
1,493
java
package com.guidewire._generated.entity; @javax.annotation.Generated(value = "com.guidewire.pl.metadata.codegen.Codegen", comments = "BOPCost.eti;BOPCost.eix;BOPCost.etx") @java.lang.SuppressWarnings(value = {"deprecation", "unchecked"}) public class BOPCostVersionListImpl extends com.guidewire.pl.system.entity.proxy.EffDatedVersionListImpl implements entity.windowed.BOPCostVersionList { public BOPCostVersionListImpl(entity.BOPCost base) { super(base); } public BOPCostVersionListImpl(gw.pl.persistence.core.Bundle bundle, gw.pl.persistence.core.effdate.EffDatedKey effDatedKey) { super(bundle, effDatedKey); } @java.lang.Override public entity.BOPCost AsOf(java.util.Date date) { return (entity.BOPCost)getVersionAsOf(date); } @java.lang.Override public java.util.List<? extends entity.BOPTransaction> TransactionsAsOf(java.util.Date date) { return (java.util.List)getArrayAsOf(entity.BOPCost.TRANSACTIONS_PROP.get(), date); } @java.lang.Override public void addToTransactions(entity.BOPTransaction bean) { addToArray(entity.BOPCost.TRANSACTIONS_PROP.get(), bean); } @java.lang.Override public java.util.List<? extends entity.BOPCost> getAllVersions() { return (java.util.List)getAllVersionsUntyped(); } @java.lang.Override public java.util.List<? extends entity.windowed.BOPTransactionVersionList> getTransactions() { return (java.util.List)getArray(entity.BOPCost.TRANSACTIONS_PROP.get()); } }
4413f0fa2f495268932a1d78cfaa668bdf9e6a18
29496be1d2dffb72ae54a10cdb6a017897f1ca37
/src/main/java/com/itheima/crm/workbench/service/impl/TranServiceImpl.java
92cc6a6ff4577ba9ef01b18c9ef7ac379543530d
[]
no_license
syngebee/SSM-crm
19fa63f65ea2c0432c2f93729bc9502abf10d690
f36c17b3e7347b46ebc928557ee7b19b6d8457ae
refs/heads/master
2022-12-17T13:08:26.300755
2020-09-16T03:38:00
2020-09-16T03:38:00
287,734,114
0
0
null
null
null
null
UTF-8
Java
false
false
4,452
java
package com.itheima.crm.workbench.service.impl; import com.itheima.crm.utils.DateTimeUtil; import com.itheima.crm.utils.UUIDUtil; import com.itheima.crm.workbench.dao.CustomerDao; import com.itheima.crm.workbench.dao.TranDao; import com.itheima.crm.workbench.dao.TranHistoryDao; import com.itheima.crm.workbench.dto.TransactionRequestDTO; import com.itheima.crm.workbench.pojo.Customer; import com.itheima.crm.workbench.pojo.Tran; import com.itheima.crm.workbench.pojo.TranHistory; import com.itheima.crm.workbench.service.TranService; import com.itheima.crm.workbench.vo.PaginationVO; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; import java.util.Map; @Service public class TranServiceImpl implements TranService { @Autowired private TranDao tranDao; @Autowired private CustomerDao customerDao; @Autowired private TranHistoryDao tranHistoryDao; @Override public Boolean save(Tran tran,String customerName) { Boolean flag = true ; //查询客户名称 Customer customer = customerDao.getCustomerByName(customerName); //如果客户没有的话,需要创建客户 if (customer==null){ customer = new Customer(); customer.setId(UUIDUtil.getUUID()); customer.setOwner(tran.getOwner()); customer.setDescription(tran.getDescription()); customer.setContactSummary(tran.getContactSummary()); customer.setNextContactTime(tran.getNextContactTime()); customer.setCreateBy(tran.getCreateBy()); customer.setCreateTime(DateTimeUtil.getSysTime()); customer.setName(customerName); int count1 = customerDao.save(customer); if (count1!=1){ flag=false; } } //拿到客户id tran.setCustomerId(customer.getId()); //创建交易 int count2 =tranDao.save(tran); if (count2!=1){ flag=false; } //同时创建交易历史 TranHistory tranHistory = new TranHistory(); //拷贝属性,id同名忽略,还剩自己id和tranId BeanUtils.copyProperties(tran,tranHistory,"id","createTime"); tranHistory.setId(UUIDUtil.getUUID()); tranHistory.setTranId(tran.getId()); tranHistory.setCreateTime(DateTimeUtil.getSysTime()); //创建交易历史 int count3 = tranHistoryDao.save(tranHistory); if (count3!=1){ flag=false; } return flag; } @Override public Tran getTranById(String id) { return tranDao.getTranById(id); } @Override public List<TranHistory> getHistoryByTranId(String tranId) { return tranHistoryDao.getHistoryListByTranId(tranId); } @Override public Boolean changeStage(Tran tran) { //先更新stage boolean flag = true; int count1 = tranDao.changeStage(tran); if (count1!=1){ flag=false; } //生成一条交易历史 TranHistory tranHistory = new TranHistory(); tranHistory.setId(UUIDUtil.getUUID()); tranHistory.setCreateBy(tran.getEditBy()); tranHistory.setCreateTime(DateTimeUtil.getSysTime()); tranHistory.setExpectedDate(tran.getExpectedDate()); tranHistory.setMoney(tran.getMoney()); tranHistory.setTranId(tran.getId()); tranHistory.setStage(tran.getStage()); int count2 = tranHistoryDao.save(tranHistory); if (count2!=1){ flag=false; } return flag; } @Override public PaginationVO getCharts() { PaginationVO<Map<String, String>> pv = new PaginationVO<>(); int total =tranDao.getTotal(); List<Map<String,String>> dataList =tranDao.getTranSumByStage(); pv.setTotal(total); pv.setDataList(dataList); return pv; } @Override public PaginationVO pageList(TransactionRequestDTO tDto) { System.out.println(tDto); //初始化返回值 PaginationVO<Tran> pv = new PaginationVO<>(); //赋值1 List<Tran> trans = tranDao.pageList(tDto); pv.setDataList(trans); //赋值2 int sum = tranDao.getSum(tDto); pv.setTotal(sum); return pv; } }
c48949152f83d24f3d37cebfcbdd96163988d470
c37cc036ea35489c574f0815e3735815a5daeca8
/WEB-INF/src/jc/family/game/fruit/FruitUserBean.java
1a4d224caff88c3fa0c2137a4a0663d530859bef
[]
no_license
liuyang0923/joycool
ac032b616d65ecc54fae8c08ae8e6f3e9ce139d3
e7fcd943d536efe34f2c77b91dddf20844e7cab9
refs/heads/master
2020-06-12T17:14:31.104162
2016-12-09T07:15:40
2016-12-09T07:15:40
75,793,605
0
0
null
null
null
null
UTF-8
Java
false
false
1,195
java
package jc.family.game.fruit; import jc.family.game.vs.VsGameBean; import jc.family.game.vs.VsUserBean; public class FruitUserBean extends VsUserBean { int operateCount; // 记录用户的操作次数 int updTeckCount;// 升级科技成功次数 int throwFruitCount;// 扔出的水果数 int beatFruitCount;// 消灭水果数 FruitUserBean(){ this.operateCount=0; this.updTeckCount=0; this.beatFruitCount=0; } public void init(VsGameBean game) { FruitGameBean fg = (FruitGameBean)game; fg.getFruitFamilyBean(getSide()).getUserList().add(this); } public int getUpdTeckCount() { return updTeckCount; } public void setUpdTeckCount(int updTeckCount) { this.updTeckCount = updTeckCount; } public int getThrowFruitCount() { return throwFruitCount; } public void setThrowFruitCount(int throwFruitCount) { this.throwFruitCount = throwFruitCount; } public int getBeatFruitCount() { return beatFruitCount; } public void setBeatFruitCount(int beatFruitCount) { this.beatFruitCount = beatFruitCount; } public int getOperateCount() { return operateCount; } public void setOperateCount(int operateCount) { this.operateCount = operateCount; } }
bc2a087f18b41ef9edf9302828f4d9fc0a67a295
7dc02565b237f6342268d37c0551fbc7bcc93690
/scouter.agent.java/src/scouter/javassist/bytecode/annotation/AnnotationMemberValue.java
94af6a90ff95ab5750568a341dbd4146be337d8d
[ "Apache-2.0", "LicenseRef-scancode-generic-cla" ]
permissive
Hanium-RealTimeScouter/Hanium-Scouter
b9de08c2735d62d0341b67c1d355c97615088d03
695ee6e0cd5b50270b71057a29b01902dcf3fcce
refs/heads/master
2020-12-30T13:08:41.951502
2017-08-19T06:49:43
2017-08-19T06:49:43
91,330,797
3
2
null
null
null
null
UTF-8
Java
false
false
3,004
java
/* * Javassist, a Java-bytecode translator toolkit. * Copyright (C) 2004 Bill Burke. All Rights Reserved. * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. Alternatively, the contents of this file may be used under * the terms of the GNU Lesser General Public License Version 2.1 or later, * or the Apache License Version 2.0. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. */ package scouter.javassist.bytecode.annotation; import static scouter.javassist.bytecode.annotation.MemberValue.loadClass; import java.io.IOException; import java.lang.reflect.Method; import scouter.javassist.ClassPool; import scouter.javassist.bytecode.ConstPool; import scouter.javassist.bytecode.annotation.Annotation; import scouter.javassist.bytecode.annotation.AnnotationImpl; import scouter.javassist.bytecode.annotation.AnnotationsWriter; import scouter.javassist.bytecode.annotation.MemberValue; import scouter.javassist.bytecode.annotation.MemberValueVisitor; /** * Nested annotation. * * @author <a href="mailto:[email protected]">Bill Burke</a> * @author Shigeru Chiba */ public class AnnotationMemberValue extends MemberValue { Annotation value; /** * Constructs an annotation member. The initial value is not specified. */ public AnnotationMemberValue(ConstPool cp) { this(null, cp); } /** * Constructs an annotation member. The initial value is specified by * the first parameter. */ public AnnotationMemberValue(Annotation a, ConstPool cp) { super('@', cp); value = a; } Object getValue(ClassLoader cl, ClassPool cp, Method m) throws ClassNotFoundException { return AnnotationImpl.make(cl, getType(cl), cp, value); } Class getType(ClassLoader cl) throws ClassNotFoundException { if (value == null) throw new ClassNotFoundException("no type specified"); else return loadClass(cl, value.getTypeName()); } /** * Obtains the value. */ public Annotation getValue() { return value; } /** * Sets the value of this member. */ public void setValue(Annotation newValue) { value = newValue; } /** * Obtains the string representation of this object. */ public String toString() { return value.toString(); } /** * Writes the value. */ public void write(AnnotationsWriter writer) throws IOException { writer.annotationValue(); value.write(writer); } /** * Accepts a visitor. */ public void accept(MemberValueVisitor visitor) { visitor.visitAnnotationMemberValue(this); } }
512919b4c9e5aba9e7979672b1f88697e204002c
95f2fdb228c3021634c573769ec9e46e26549391
/JavaSyntaxGround/src/com/algo/data/Teacher.java
cc2a5f53295c69c4cad338921b05f10d70b5a39b
[]
no_license
Yumin-Kim/Java-SpringStudy
aafeb50042f3ea9af7de30e58d356ae22b332281
72a4cd76a55febd1bd842687ac80a3db24214454
refs/heads/master
2023-08-25T17:47:45.667803
2021-10-20T14:41:30
2021-10-20T14:41:30
380,800,790
0
0
null
null
null
null
UTF-8
Java
false
false
265
java
package com.algo.data; import java.util.Optional; public class Teacher { private String name; public Optional<String> getName() { return Optional.ofNullable(name); } public void setName(String name) { this.name = name; } }
fed2ec3e1160e20eac8ce910d6a183fd6c1efe5d
3d2a7746e88fc83fb76a3882eab0fa4e8528429f
/src/main/java/com/rultor/Time.java
e096eea4c1e4e98794570551663d9d95e7db3bb1
[ "BSD-2-Clause" ]
permissive
huhaq/rultor
fe04252d585c1a41dc4f1e06678a8a202cafe20d
6f39a2d718ce91d4a007877ab4c5afbc3dde2b1e
refs/heads/master
2021-01-18T00:41:17.430598
2014-12-06T14:16:22
2014-12-06T14:16:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,206
java
/** * Copyright (c) 2009-2014, rultor.com * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: 1) Redistributions of source code must retain the above * copyright notice, this list of conditions and the following * disclaimer. 2) Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. 3) Neither the name of the rultor.com nor * the names of its contributors may be used to endorse or promote * products derived from this software without specific prior written * permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. */ package com.rultor; import com.jcabi.aspects.Immutable; import java.text.ParseException; import java.util.Date; import lombok.EqualsAndHashCode; import lombok.ToString; import org.apache.commons.lang3.time.DateFormatUtils; /** * Date and time in ISO 8601. * * @author Yegor Bugayenko ([email protected]) * @version $Id$ * @since 1.8.12 */ @Immutable @ToString @EqualsAndHashCode(of = "millis") public final class Time { /** * The time. */ private final transient long millis; /** * Ctor. */ public Time() { this(System.currentTimeMillis()); } /** * Ctor. * @param date Date */ public Time(final Date date) { this(date.getTime()); } /** * Ctor. * @param msec Milliseconds */ public Time(final long msec) { this.millis = msec; } /** * Ctor. * @param date Date */ public Time(final String date) { this(Time.parse(date)); } /** * Make ISO string. * @return Text */ public String iso() { return DateFormatUtils.formatUTC( new Date(this.millis), "yyyy-MM-dd'T'HH:mm:ss'Z'" ); } /** * Make date. * @return Date */ public long msec() { return this.millis; } /** * Parse text. * @param date Date * @return Date */ private static Date parse(final String date) { try { return DateFormatUtils.ISO_DATETIME_FORMAT.parse(date); } catch (final ParseException ex) { throw new IllegalStateException(ex); } } }
3163396a1d8437a1d291ec43bd17d9eec7f474a9
41fdf47cb2579246ff7d57153c9d92f50ccfd52e
/els-romenext-rev2-api/src/main/java/com/els/romenext/api/dct/req/UpdateDCTRequest.java
0f69c7324d0ec4a804827e696958a3d5f99cd72f
[]
no_license
RamyaSubash/romenext
9b7206962d6d6db57769ec4f44088930e7ca8867
e1ea3b305cf34e8966d012e822a9c61099652e41
refs/heads/main
2023-04-22T16:57:12.849414
2021-05-05T17:26:37
2021-05-05T17:26:37
364,650,368
0
0
null
null
null
null
UTF-8
Java
false
false
2,876
java
package com.els.romenext.api.dct.req; import javax.ws.rs.core.Response; import org.apache.log4j.Logger; import org.json.JSONObject; import com.els.romenext.api.core.GroupRequest; import com.els.romenext.api.entities.general.EntryNodeRequest; import com.els.romenext.api.utils.RomeJSONUtils; import com.els.romenext.api.utils.payloads.GuiNodeRequestPayload; public class UpdateDCTRequest extends GroupRequest { private static Logger log = Logger.getLogger(UpdateDCTRequest.class); private Long dctId; private EntryNodeRequest updateDct; // private GuiNodeRequestPayload updateDct; public EntryNodeRequest getUpdateDct() { return updateDct; } public Long getDctId() { return dctId; } public String validateRequest(JSONObject json ) { // TODO: permission need to be implemented String validateRequest = super.validateRequest(json); if( validateRequest != null ) { return validateRequest; } String empty = null; empty = RomeJSONUtils.findEmptyJson( json, "dctId", "updateDct" ); if( empty != null ) { return empty; } // JSONObject jsonObj = (JSONObject) json.get( "updateDct" ); // empty = new GuiNodeRequestPayload().validateRequest( jsonObj ); // // if( empty != null ) { // return empty; // } // return empty; } public void parseRequest(JSONObject json) { super.parseRequest(json); JSONObject jsonObj = json.getJSONObject( "updateDct" ); this.dctId = json.getLong( "dctId" ); // GuiNodeRequestPayload newNode = new GuiNodeRequestPayload(); // newNode.parseRequest( jsonObj ); this.updateDct = new EntryNodeRequest(); this.updateDct.parseRequest( jsonObj ); // this.updateDct = newNode; // this.updateDct = new EntryNodeRequest(); // // this.updateDct.parseRequest( nodeObj ); // this.node = NodeUtils.parseNodeJSONObjectForDecoView(json); } public Response preprocessor() { // TODO: more verification logic could be added into this part // currently, I just checked if there is any duplicate property name // if (nodes == null) { // return null; // } // // ResponseBuilder responseBuilder; // // if (NodeUtils.containsDuplication(nodes)) { // log.error("Duplicate Types"); // responseBuilder = ErrorResponse.build(ApiResponseState.FAILURE, RomeNextResponseCodeEnum.DUPLICATE_TYPE, null).getResponseBuilder(); // return responseBuilder.build(); // } // // for (Node nodeToAdd : nodes) { // // if (nodeToAdd.getId() == null) { // log.error("Bad Type" + nodeToAdd.getId()); // responseBuilder = ErrorResponse.build(ApiResponseState.FAILURE, RomeNextResponseCodeEnum.BAD_TYPE_COORDINATES, null).getResponseBuilder(); // return responseBuilder.build(); // } // } return null; } }
[ "=" ]
=
993a2e2f08d25810988fe40bc166905d5db36185
afcca25fdcbaaa4bdd08babcf234dcdecf21b6f6
/quasar-sika-design-server/sika-code-core/standard-footer/src/main/java/com/sika/code/standard/tree/pojo/query/TreeRelationQuery.java
4f71703972a808c6ec92e9e62acf5e8b9c4621aa
[ "MIT" ]
permissive
Auntie233/quasar-sika-design
cd12faedaeb1f24c6e6de8462ce0d692a2e62a9c
a4463dbcf4ed19cbc8453d7d6161f92b85d9d076
refs/heads/main
2023-07-05T10:43:23.726149
2021-08-23T09:04:48
2021-08-23T09:04:48
399,025,717
0
1
null
null
null
null
UTF-8
Java
false
false
693
java
package com.sika.code.standard.tree.pojo.query; import com.sika.code.standard.base.pojo.query.BaseStandardQuery; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; import lombok.extern.slf4j.Slf4j; import java.util.Set; /** * 描述:树关系查询类 * * @author daiqi * @date 2018-12-22 13:03:40 */ @Data @Slf4j @EqualsAndHashCode(callSuper = true) @Accessors(chain = true) public class TreeRelationQuery extends BaseStandardQuery { /** * 祖节点id */ private Long ancestorId; /** * 子孙节点id */ private Long descendantId; private Set<Long> ancestorIds; private Set<Long> descendantIds; }
32073589ec3bc79befb9e5c3e7b14d1d629b7823
8155b3907cd529e29a1c71f95133b129d09037de
/src/com/caihong/common/web/WebErrors.java
a12fdc841b19d109a341dacff86775f1aca412f9
[]
no_license
xrogzu/caihongbbs
4410a4b541a4bac846bf875887958f92cc617903
94682bebbdb15b500f7b30ceb4af5b57d3b62d8a
refs/heads/master
2020-04-06T04:13:52.247974
2017-02-23T06:06:57
2017-02-23T06:06:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,037
java
package com.caihong.common.web; import java.io.Serializable; import java.util.Locale; import javax.servlet.http.HttpServletRequest; import org.springframework.context.MessageSource; public class WebErrors extends com.caihong.core.web.WebErrors { /** * 通过HttpServletRequest创建WebErrors * * @param request * 从request中获得MessageSource和Locale,如果存在的话。 * @return 如果LocaleResolver存在则返回国际化WebErrors */ public static WebErrors create(HttpServletRequest request) { return new WebErrors(request); } public WebErrors() { } public WebErrors(HttpServletRequest request) { super(request); } /** * 构造器 * * @param messageSource * @param locale */ public WebErrors(MessageSource messageSource, Locale locale) { super(messageSource, locale); } /** * 非站点内数据 * * @param clazz * @param id */ public void notInSite(Class<?> clazz, Serializable id) { addErrorCode("error.notInSite", clazz.getSimpleName(), id); } }
dfaca64ba78b2d2eb3711a572b4efae3e5f126b5
11e0f6f8f68ede4148f283ffde61ce0f79434cbf
/src/DayOne/Demo.java
8bfc809a1cf09ba95212984f3b531d169037b855
[]
no_license
meetmmpatel/Demo-JavaClass
043ac7995b86a5e09756249032b5e7e4c45bb0b6
414161d1cf45bdb50eafdd891565e78d35f56576
refs/heads/master
2020-06-20T05:35:45.031423
2019-07-15T14:09:17
2019-07-15T14:09:17
196,623,851
0
0
null
null
null
null
UTF-8
Java
false
false
313
java
package DayOne; public class Demo { public static void main(String[] args) { int numOne = 20; int numTwo = 40; System.out.println("Test Java Code"); System.out.println(89 + 70); System.out.println(8 * 2); System.out.println(numOne + numTwo); System.out.println(numOne - numTwo); } }
4c7d988a4ee1d8f4767ca8762f2bc3a1d2f079d5
209e908242c201544e62990243decc08e8e7e415
/jmetal-problem/src/main/java/org/uma/jmetal/problem/multiobjective/cdtlz/C1_DTLZ3.java
889f2e890e951b13c63d68c48c327bf8c0d1438b
[]
no_license
weaponhe/CMOEACD
7d3a9f7b6a908339f11adc5f20648d4920d854b9
6be561ed689f1eb17a28856079ddffe79ddbe9f4
refs/heads/master
2021-09-10T23:16:02.460594
2018-04-04T04:48:22
2018-04-04T04:48:22
110,501,459
1
2
null
null
null
null
UTF-8
Java
false
false
4,283
java
// This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. package org.uma.jmetal.problem.multiobjective.cdtlz; import org.uma.jmetal.problem.ConstrainedProblem; import org.uma.jmetal.problem.multiobjective.dtlz.DTLZ1; import org.uma.jmetal.problem.multiobjective.dtlz.DTLZ3; import org.uma.jmetal.solution.DoubleSolution; import org.uma.jmetal.util.solutionattribute.impl.MaximumConstraintViolation; import org.uma.jmetal.util.solutionattribute.impl.NumberOfViolatedConstraints; import org.uma.jmetal.util.solutionattribute.impl.OverallConstraintViolation; import java.util.HashMap; import java.util.Map; /** * Problem C1-DTLZ3, defined in: * Jain, H. and K. Deb. "An Evolutionary Many-Objective Optimization Algorithm Using Reference-Point-Based * Nondominated Sorting Approach, Part II: Handling Constraints and Extending to an Adaptive Approach." * EEE Transactions on Evolutionary Computation, 18(4):602-622, 2014. * * @author Antonio J. Nebro <[email protected]> */ public class C1_DTLZ3 extends DTLZ3 implements ConstrainedProblem<DoubleSolution> { public OverallConstraintViolation<DoubleSolution> overallConstraintViolationDegree ; public NumberOfViolatedConstraints<DoubleSolution> numberOfViolatedConstraints ; public MaximumConstraintViolation<DoubleSolution> maximumConstraintViolationDegree; private static Map<Integer, Double> rValue; static { rValue = new HashMap<Integer, Double>() ; rValue.put(3, 9.0) ; rValue.put(5, 12.5) ; rValue.put(8, 12.5) ; rValue.put(10, 15.0) ; rValue.put(15, 15.0) ; } /** * Constructor * @param numberOfVariables * @param numberOfObjectives */ public C1_DTLZ3(int numberOfVariables, int numberOfObjectives) { super(numberOfVariables, numberOfObjectives) ; setNumberOfConstraints(1); setName("C1_DTLZ3"); overallConstraintViolationDegree = new OverallConstraintViolation<DoubleSolution>() ; numberOfViolatedConstraints = new NumberOfViolatedConstraints<DoubleSolution>() ; maximumConstraintViolationDegree = new MaximumConstraintViolation<>(); } @Override public void evaluateConstraints(DoubleSolution solution) { double[] constraint = new double[this.getNumberOfConstraints()]; // double sum1 = 0 ; // double sum2 = 0 ; // for (int i = 0; i < getNumberOfObjectives(); i++) { // double v = Math.pow(solution.getObjective(i), 2) ; // sum1 += v - 16.0 ; // sum2 += v - Math.pow(rValue.get(getNumberOfObjectives()), 2.0) ; // } double sum = 0 ; for (int i = 0; i < getNumberOfObjectives(); i++) { double v = Math.pow(solution.getObjective(i), 2) ; sum += v ; } constraint[0] = (sum - 16.0) * (sum - Math.pow(rValue.get(getNumberOfObjectives()), 2.0)); solution.setConstraintViolation(0,constraint[0]); double overallConstraintViolation = 0.0; int violatedConstraints = 0; double maximumConstraintViolation = 0.0; for (int i = 0; i < getNumberOfConstraints(); i++) { if (constraint[i]<0.0){ overallConstraintViolation+=constraint[i]; violatedConstraints++; maximumConstraintViolation = Math.min(maximumConstraintViolation,constraint[i]); } } solution.setAttribute("overallConstraintViolationDegree", overallConstraintViolation); overallConstraintViolationDegree.setAttribute(solution, overallConstraintViolation); numberOfViolatedConstraints.setAttribute(solution, violatedConstraints); maximumConstraintViolationDegree.setAttribute(solution,maximumConstraintViolation); } }
04955497297fc99728de0e6440c5cd69dd57c79d
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
/benchmark/validation/org/apache/hadoop/hdfs/server/namenode/startupprogress/TestStartupProgressMetrics.java
79892b8001779ec9febb88c0dc10260d28ea3258
[]
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
5,146
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.hadoop.hdfs.server.namenode.startupprogress; import org.apache.hadoop.metrics2.MetricsRecordBuilder; import org.junit.Assert; import org.junit.Test; public class TestStartupProgressMetrics { private StartupProgress startupProgress; private StartupProgressMetrics metrics; @Test public void testInitialState() { MetricsRecordBuilder builder = getMetrics(metrics, true); assertCounter("ElapsedTime", 0L, builder); assertGauge("PercentComplete", 0.0F, builder); assertCounter("LoadingFsImageCount", 0L, builder); assertCounter("LoadingFsImageElapsedTime", 0L, builder); assertCounter("LoadingFsImageTotal", 0L, builder); assertGauge("LoadingFsImagePercentComplete", 0.0F, builder); assertCounter("LoadingEditsCount", 0L, builder); assertCounter("LoadingEditsElapsedTime", 0L, builder); assertCounter("LoadingEditsTotal", 0L, builder); assertGauge("LoadingEditsPercentComplete", 0.0F, builder); assertCounter("SavingCheckpointCount", 0L, builder); assertCounter("SavingCheckpointElapsedTime", 0L, builder); assertCounter("SavingCheckpointTotal", 0L, builder); assertGauge("SavingCheckpointPercentComplete", 0.0F, builder); assertCounter("SafeModeCount", 0L, builder); assertCounter("SafeModeElapsedTime", 0L, builder); assertCounter("SafeModeTotal", 0L, builder); assertGauge("SafeModePercentComplete", 0.0F, builder); } @Test public void testRunningState() { StartupProgressTestHelper.setStartupProgressForRunningState(startupProgress); MetricsRecordBuilder builder = getMetrics(metrics, true); Assert.assertTrue(((getLongCounter("ElapsedTime", builder)) >= 0L)); assertGauge("PercentComplete", 0.375F, builder); assertCounter("LoadingFsImageCount", 100L, builder); Assert.assertTrue(((getLongCounter("LoadingFsImageElapsedTime", builder)) >= 0L)); assertCounter("LoadingFsImageTotal", 100L, builder); assertGauge("LoadingFsImagePercentComplete", 1.0F, builder); assertCounter("LoadingEditsCount", 100L, builder); Assert.assertTrue(((getLongCounter("LoadingEditsElapsedTime", builder)) >= 0L)); assertCounter("LoadingEditsTotal", 200L, builder); assertGauge("LoadingEditsPercentComplete", 0.5F, builder); assertCounter("SavingCheckpointCount", 0L, builder); assertCounter("SavingCheckpointElapsedTime", 0L, builder); assertCounter("SavingCheckpointTotal", 0L, builder); assertGauge("SavingCheckpointPercentComplete", 0.0F, builder); assertCounter("SafeModeCount", 0L, builder); assertCounter("SafeModeElapsedTime", 0L, builder); assertCounter("SafeModeTotal", 0L, builder); assertGauge("SafeModePercentComplete", 0.0F, builder); } @Test public void testFinalState() { StartupProgressTestHelper.setStartupProgressForFinalState(startupProgress); MetricsRecordBuilder builder = getMetrics(metrics, true); Assert.assertTrue(((getLongCounter("ElapsedTime", builder)) >= 0L)); assertGauge("PercentComplete", 1.0F, builder); assertCounter("LoadingFsImageCount", 100L, builder); Assert.assertTrue(((getLongCounter("LoadingFsImageElapsedTime", builder)) >= 0L)); assertCounter("LoadingFsImageTotal", 100L, builder); assertGauge("LoadingFsImagePercentComplete", 1.0F, builder); assertCounter("LoadingEditsCount", 200L, builder); Assert.assertTrue(((getLongCounter("LoadingEditsElapsedTime", builder)) >= 0L)); assertCounter("LoadingEditsTotal", 200L, builder); assertGauge("LoadingEditsPercentComplete", 1.0F, builder); assertCounter("SavingCheckpointCount", 300L, builder); Assert.assertTrue(((getLongCounter("SavingCheckpointElapsedTime", builder)) >= 0L)); assertCounter("SavingCheckpointTotal", 300L, builder); assertGauge("SavingCheckpointPercentComplete", 1.0F, builder); assertCounter("SafeModeCount", 400L, builder); Assert.assertTrue(((getLongCounter("SafeModeElapsedTime", builder)) >= 0L)); assertCounter("SafeModeTotal", 400L, builder); assertGauge("SafeModePercentComplete", 1.0F, builder); } }
4105a7db5a476077e7a2d23bc25fdf2e71d2135f
fee07509619ca10be0b08059720886f9a1f2048d
/bdnav-provider/task-provider/src/main/java/com/bdxh/task/configration/rocketmq/util/RocketMqTransUtil.java
9fae1ab5322fb18977c8995f3f6cdf09cc04e5e2
[ "Apache-2.0" ]
permissive
jiageh08/tea-springboot
70a68c7518f2470268ad8fa03ea7dfa48dff948c
91892209a70b93e90eaee0a01a4f71e188f4a61a
refs/heads/master
2022-12-05T13:10:06.654077
2020-08-07T01:29:56
2020-08-07T01:29:56
285,574,085
0
0
null
null
null
null
UTF-8
Java
false
false
1,743
java
package com.bdxh.task.configration.rocketmq.util; import com.bdxh.common.base.constant.RocketMqConstrants; import com.bdxh.common.base.enums.RocketMqTransStatusEnum; import com.bdxh.task.configration.redis.RedisUtil; import org.apache.commons.lang3.StringUtils; import org.apache.rocketmq.client.producer.LocalTransactionState; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** * @Description: RocketMq事务回查工具类 * @Author: Kang * @Date: 2019/6/14 9:44 */ @Component public class RocketMqTransUtil { @Autowired private RedisUtil redisUtil; public void putTransState(String transactionId, RocketMqTransStatusEnum rocketMqTransStatusEnum) { redisUtil.setWithExpireTime(RocketMqConstrants.TRANSACTION_REDIS_PREFIX + transactionId, rocketMqTransStatusEnum.getCode(), 3600 * 24); } public LocalTransactionState getTransState(String transactionId) { String status = (String) redisUtil.getObject(RocketMqConstrants.TRANSACTION_REDIS_PREFIX + transactionId); if (StringUtils.equals(status, RocketMqTransStatusEnum.COMMIT_MESSAGE.getCode())) { return LocalTransactionState.COMMIT_MESSAGE; } if (StringUtils.equals(status, RocketMqTransStatusEnum.ROLLBACK_MESSAGE.getCode())) { return LocalTransactionState.ROLLBACK_MESSAGE; } if (StringUtils.equals(status, RocketMqTransStatusEnum.UNKNOW.getCode())) { return LocalTransactionState.UNKNOW; } return LocalTransactionState.UNKNOW; } public void removeTransState(String transactionId) { redisUtil.delete(RocketMqConstrants.TRANSACTION_REDIS_PREFIX + transactionId); } }
62db7b04c25df2f5553bebacb8f83c32607b78d5
752d91d350aecb70e9cbf7dd0218ca034af652fa
/Winjit Deployment/Backend Source Code/src/main/java/com/fullerton/olp/wsdao/otp/OtpDAOImpl.java
05d01a90c4c419172f3704f514f2b845be5f6377
[]
no_license
mnjdby/TEST
5d0c25cf42eb4212f87cd4d23d1386633922f67e
cc2278c069e1711d4bd3f0a42eb360ea7417a6e7
refs/heads/master
2020-03-11T08:51:52.533185
2018-04-17T11:31:46
2018-04-17T11:31:46
129,894,682
0
0
null
null
null
null
UTF-8
Java
false
false
1,558
java
package com.fullerton.olp.wsdao.otp; import javax.annotation.Resource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpEntity; import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Component; import org.springframework.web.client.RestTemplate; import com.fullerton.olp.bean.OtpRequest; import com.fullerton.olp.bean.OtpResponse; /** * Client to invoke OTP related services * * @author nitish * */ @Component public class OtpDAOImpl implements OtpDAO{ private static final Logger log = LoggerFactory.getLogger(OtpDAO.class); @Value("${otp-ws.host}") private String OTP_WS_HOST; private String GET_OTP_REQ = "getOTP"; private String VERIFY_OTP_REQ = "verifyOTP"; @Resource(name="restTemplate") private RestTemplate restTemplate; public OtpResponse sendOTP(OtpRequest otpRequest) { HttpEntity<OtpRequest> entity = new HttpEntity<OtpRequest>(otpRequest); ResponseEntity<OtpResponse> responseEntity = restTemplate.exchange(OTP_WS_HOST + GET_OTP_REQ, HttpMethod.POST, entity, OtpResponse.class); return responseEntity.getBody(); } public OtpResponse verifyOTP(OtpRequest otpRequest) { HttpEntity<OtpRequest> entity = new HttpEntity<OtpRequest>(otpRequest); ResponseEntity<OtpResponse> responseEntity = restTemplate.exchange(OTP_WS_HOST + VERIFY_OTP_REQ , HttpMethod.POST, entity, OtpResponse.class); return responseEntity.getBody(); } }
dcea81a6f9568c5001d12575b5424568a85fb98f
828a9dc2a273e7529385d723193b73947aa00802
/app/src/main/java/com/int403/jabong/gifviewer2/glide/load/Option.java
271a2bf2f9dda6a676ed25eb91604c2296df2463
[]
no_license
dey2929/GifViewer2
f9c686770703361ae6d900bfa8bd6fde7d7a1bbe
e21a1ed978657057df6a6090c30be9b18df2285d
refs/heads/master
2021-01-17T08:43:52.089301
2016-07-15T12:21:05
2016-07-15T12:21:05
63,416,728
0
0
null
null
null
null
UTF-8
Java
false
false
5,293
java
package com.int403.jabong.gifviewer2.glide.load; import android.support.annotation.Nullable; import com.int403.jabong.gifviewer2.bumptech.load.bumptech.Key; import com.int403.jabong.gifviewer2.bumptech.util.bumptech.Preconditions; import java.security.MessageDigest; /** * Defines available component (decoders, encoders, model loaders etc.) options with optional * default values and the ability to affect the resource disk cache key used by {@link * DiskCacheStrategy#RESOURCE}. * * <p> * Implementations must either be unique (usually declared as static final variables), or * implement {@link #equals(Object)} and {@link #hashCode()}. * </p> * * <p> * Implementations can implement {@link #update(Object, MessageDigest)} to make sure that * the disk cache key includes the specific option set. * </p> * * @param <T> The type of the option ({@link Integer}, {@link * android.graphics.Bitmap.CompressFormat} etc.), must implement {@link #equals(Object)} and * {@link #hashCode()}. */ public final class Option<T> { private static final CacheKeyUpdater<Object> EMPTY_UPDATER = new CacheKeyUpdater<Object>() { @Override public void update(byte[] keyBytes, Object value, MessageDigest messageDigest) { // Do nothing. } }; private final T defaultValue; private final CacheKeyUpdater<T> cacheKeyUpdater; private final String key; private volatile byte[] keyBytes; /** * Returns a new {@link Option} that does not affect disk cache keys with a {@code null} default * value. * * @param key A unique package prefixed {@link String} that identifies this option (must be * stable across builds, so {@link Class#getName()} should <em>not</em> be used). */ public static <T> Option<T> memory(String key) { return new Option<>(key, null /*defaultValue*/, Option.<T>emptyUpdater()); } /** * Returns a new {@link Option} that does not affect disk cache keys with the given value as the * default value. * * @param key A unique package prefixed {@link String} that identifies this option (must be * stable across builds, so {@link Class#getName()} should <em>not</em> be used). */ public static <T> Option<T> memory(String key, T defaultValue) { return new Option<>(key, defaultValue, Option.<T>emptyUpdater()); } /** * Returns a new {@link Option} that uses the given {@link * com.bumptech.glide.load.Option.CacheKeyUpdater} to update disk cache keys. * * @param key A unique package prefixed {@link String} that identifies this option (must be * stable across builds, so {@link Class#getName()} should <em>not</em> be used). */ public static <T> Option<T> disk(String key, CacheKeyUpdater<T> cacheKeyUpdater) { return new Option<>(key, null /*defaultValue*/, cacheKeyUpdater); } /** * Returns a new {@link Option} that uses the given {@link * com.bumptech.glide.load.Option.CacheKeyUpdater} to update disk cache keys and provides * the given value as the default value. * * @param key A unique package prefixed {@link String} that identifies this option (must be * stable across builds, so {@link Class#getName()} should <em>not</em> be used). */ public static <T> Option<T> disk(String key, T defaultValue, CacheKeyUpdater<T> cacheKeyUpdater) { return new Option<>(key, defaultValue, cacheKeyUpdater); } Option(String key, T defaultValue, CacheKeyUpdater<T> cacheKeyUpdater) { this.key = Preconditions.checkNotEmpty(key); this.defaultValue = defaultValue; this.cacheKeyUpdater = Preconditions.checkNotNull(cacheKeyUpdater); } /** * Returns a reasonable default to use if no other value is set, or {@code null}. */ @Nullable public T getDefaultValue() { return defaultValue; } /** * Updates the given {@link MessageDigest} used to construct a cache key with the given * value using the {@link CacheKeyUpdater} optionally provided in * the constructor. */ public void update(T value, MessageDigest messageDigest) { cacheKeyUpdater.update(getKeyBytes(), value, messageDigest); } private byte[] getKeyBytes() { if (keyBytes == null) { keyBytes = key.getBytes(Key.CHARSET); } return keyBytes; } @Override public boolean equals(Object o) { if (o instanceof Option) { Option<?> other = (Option<?>) o; return key.equals(other.key); } return false; } @Override public int hashCode() { return key.hashCode(); } @SuppressWarnings("unchecked") private static <T> CacheKeyUpdater<T> emptyUpdater() { return (CacheKeyUpdater<T>) EMPTY_UPDATER; } @Override public String toString() { return "Option{" + "key='" + key + '\'' + '}'; } /** * An interface that updates a {@link MessageDigest} with the given value as part of a process to * generate a disk cache key. * * @param <T> The type of the option. */ public interface CacheKeyUpdater<T> { /** * Updates the given {@link MessageDigest} with the bytes of the given key (to avoid incidental * value collisions when values are not particularly unique) and value. */ void update(byte[] keyBytes, T value, MessageDigest messageDigest); } }
e27b78433663e162ed086922e8ee9b9c812673f4
cfdd9de878aa71c39853b067b0981a387de113f6
/src/main/java/org/jocean/wechat/spi/DownloadMediaResponse.java
14238af96b247ed52db712c1364deed1b1b0f5dd
[]
no_license
isdom/jocean-wechat
374e388a1ee82f73e8eb939078c04f9aec0786f8
74fce939e6d21d088dde30b246fe012e4e459d10
refs/heads/master
2023-08-17T08:18:15.004157
2023-08-10T16:36:00
2023-08-10T16:36:00
73,454,977
1
0
null
null
null
null
UTF-8
Java
false
false
2,638
java
/** * */ package org.jocean.wechat.spi; import java.util.Arrays; import javax.ws.rs.BeanParam; import javax.ws.rs.Consumes; import javax.ws.rs.HeaderParam; import com.alibaba.fastjson.annotation.JSONField; /** * @author isdom * */ public class DownloadMediaResponse { /* (non-Javadoc) * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("DownloadMediaResponse [contentType=") .append(_contentType) .append(", contentLength=") .append(_contentLength) .append(", contentDisposition=") .append(_contentDisposition) .append(", errormsg=") .append(_errormsg) .append(", msgbody=") .append(Arrays.toString(_msgbody)) .append("]"); return builder.toString(); } public String getContentType() { return _contentType; } public byte[] getMsgbody() { return _msgbody; } public Integer getContentLength() { return _contentLength; } public ErrorMsg getErrormsg() { return _errormsg; } public String getContentDisposition() { return _contentDisposition; } @HeaderParam("Content-Type") private String _contentType; @HeaderParam("Content-Length") private Integer _contentLength; @HeaderParam("Content-disposition") private String _contentDisposition; @BeanParam private byte[] _msgbody; @BeanParam private ErrorMsg _errormsg; @Consumes({"application/json", "text/plain"}) public static class ErrorMsg { @Override public String toString() { final StringBuilder builder = new StringBuilder(); builder.append("ErrorMsg [errcode=").append(_errcode) .append(", errmsg=").append(_errmsg).append("]"); return builder.toString(); } @JSONField(name="errcode") public int getErrcode() { return _errcode; } @JSONField(name="errcode") public void setErrcode(int errcode) { this._errcode = errcode; } @JSONField(name="errmsg") public String getErrmsg() { return _errmsg; } @JSONField(name="errmsg") public void setErrmsg(String errmsg) { this._errmsg = errmsg; } private int _errcode; private String _errmsg; } }
1ee072db9d1c2105f67de9c0cd533f0983a393b6
1d928c3f90d4a0a9a3919a804597aa0a4aab19a3
/java/spring-framework/2015/4/MatrixVariablesMapMethodArgumentResolverTests.java
6dabf42716311fd8ddf71b1b503465afe0a5b619
[]
no_license
rosoareslv/SED99
d8b2ff5811e7f0ffc59be066a5a0349a92cbb845
a062c118f12b93172e31e8ca115ce3f871b64461
refs/heads/main
2023-02-22T21:59:02.703005
2021-01-28T19:40:51
2021-01-28T19:40:51
306,497,459
1
1
null
2020-11-24T20:56:18
2020-10-23T01:18:07
null
UTF-8
Java
false
false
6,460
java
/* * Copyright 2002-2012 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.web.servlet.mvc.method.annotation; import java.lang.reflect.Method; import java.util.Arrays; import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; import org.junit.Before; import org.junit.Test; import org.springframework.core.MethodParameter; import org.springframework.mock.web.test.MockHttpServletRequest; import org.springframework.mock.web.test.MockHttpServletResponse; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; import org.springframework.web.bind.annotation.MatrixVariable; import org.springframework.web.context.request.ServletWebRequest; import org.springframework.web.method.support.ModelAndViewContainer; import org.springframework.web.servlet.HandlerMapping; import static org.junit.Assert.*; /** * Test fixture with {@link MatrixVariableMethodArgumentResolver}. * * @author Rossen Stoyanchev */ public class MatrixVariablesMapMethodArgumentResolverTests { private MatrixVariableMapMethodArgumentResolver resolver; private MethodParameter paramString; private MethodParameter paramMap; private MethodParameter paramMultivalueMap; private MethodParameter paramMapForPathVar; private MethodParameter paramMapWithName; private ModelAndViewContainer mavContainer; private ServletWebRequest webRequest; private MockHttpServletRequest request; @Before public void setUp() throws Exception { this.resolver = new MatrixVariableMapMethodArgumentResolver(); Method method = getClass().getMethod("handle", String.class, Map.class, MultiValueMap.class, MultiValueMap.class, Map.class); this.paramString = new MethodParameter(method, 0); this.paramMap = new MethodParameter(method, 1); this.paramMultivalueMap = new MethodParameter(method, 2); this.paramMapForPathVar = new MethodParameter(method, 3); this.paramMapWithName = new MethodParameter(method, 4); this.mavContainer = new ModelAndViewContainer(); this.request = new MockHttpServletRequest(); this.webRequest = new ServletWebRequest(request, new MockHttpServletResponse()); Map<String, MultiValueMap<String, String>> params = new LinkedHashMap<String, MultiValueMap<String, String>>(); this.request.setAttribute(HandlerMapping.MATRIX_VARIABLES_ATTRIBUTE, params); } @Test public void supportsParameter() { assertFalse(resolver.supportsParameter(paramString)); assertTrue(resolver.supportsParameter(paramMap)); assertTrue(resolver.supportsParameter(paramMultivalueMap)); assertTrue(resolver.supportsParameter(paramMapForPathVar)); assertFalse(resolver.supportsParameter(paramMapWithName)); } @Test public void resolveArgument() throws Exception { MultiValueMap<String, String> params = getMatrixVariables("cars"); params.add("colors", "red"); params.add("colors", "green"); params.add("colors", "blue"); params.add("year", "2012"); @SuppressWarnings("unchecked") Map<String, String> map = (Map<String, String>) this.resolver.resolveArgument( this.paramMap, this.mavContainer, this.webRequest, null); assertEquals(Arrays.asList("red", "green", "blue"), map.get("colors")); @SuppressWarnings("unchecked") MultiValueMap<String, String> multivalueMap = (MultiValueMap<String, String>) this.resolver.resolveArgument( this.paramMultivalueMap, this.mavContainer, this.webRequest, null); assertEquals(Arrays.asList("red", "green", "blue"), multivalueMap.get("colors")); } @Test public void resolveArgumentPathVariable() throws Exception { MultiValueMap<String, String> params1 = getMatrixVariables("cars"); params1.add("colors", "red"); params1.add("colors", "purple"); MultiValueMap<String, String> params2 = getMatrixVariables("planes"); params2.add("colors", "yellow"); params2.add("colors", "orange"); @SuppressWarnings("unchecked") Map<String, String> mapForPathVar = (Map<String, String>) this.resolver.resolveArgument( this.paramMapForPathVar, this.mavContainer, this.webRequest, null); assertEquals(Arrays.asList("red", "purple"), mapForPathVar.get("colors")); @SuppressWarnings("unchecked") Map<String, String> mapAll = (Map<String, String>) this.resolver.resolveArgument( this.paramMap, this.mavContainer, this.webRequest, null); assertEquals(Arrays.asList("red", "purple", "yellow", "orange"), mapAll.get("colors")); } @Test public void resolveArgumentNoParams() throws Exception { @SuppressWarnings("unchecked") Map<String, String> map = (Map<String, String>) this.resolver.resolveArgument( this.paramMap, this.mavContainer, this.webRequest, null); assertEquals(Collections.emptyMap(), map); } @Test public void resolveArgumentNoMatch() throws Exception { MultiValueMap<String, String> params2 = getMatrixVariables("planes"); params2.add("colors", "yellow"); params2.add("colors", "orange"); @SuppressWarnings("unchecked") Map<String, String> map = (Map<String, String>) this.resolver.resolveArgument( this.paramMapForPathVar, this.mavContainer, this.webRequest, null); assertEquals(Collections.emptyMap(), map); } @SuppressWarnings("unchecked") private MultiValueMap<String, String> getMatrixVariables(String pathVarName) { Map<String, MultiValueMap<String, String>> matrixVariables = (Map<String, MultiValueMap<String, String>>) this.request.getAttribute( HandlerMapping.MATRIX_VARIABLES_ATTRIBUTE); MultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>(); matrixVariables.put(pathVarName, params); return params; } public void handle( String stringArg, @MatrixVariable Map<String, String> map, @MatrixVariable MultiValueMap<String, String> multivalueMap, @MatrixVariable(pathVar="cars") MultiValueMap<String, String> mapForPathVar, @MatrixVariable("name") Map<String, String> mapWithName) { } }
e494a894db76fcede048adbb0a3bdbd5ff53c5ab
b733c258761e7d91a7ef0e15ca0e01427618dc33
/cards/src/main/java/org/rnd/jmagic/cards/MentalAgony.java
19c22a87ed8fa2f55e90789d2e2031d1635d3cab
[]
no_license
jmagicdev/jmagic
d43aa3d2288f46a5fa950152486235614c6783e6
40e573f8e6d1cf42603fd05928f42e7080ce0f0d
refs/heads/master
2021-01-20T06:57:51.007411
2014-10-22T03:03:34
2014-10-22T03:03:34
9,589,102
2
0
null
null
null
null
UTF-8
Java
false
false
634
java
package org.rnd.jmagic.cards; import static org.rnd.jmagic.Convenience.*; import org.rnd.jmagic.engine.*; import org.rnd.jmagic.engine.generators.*; @Name("Mental Agony") @Types({Type.SORCERY}) @ManaCost("3B") @ColorIdentity({Color.BLACK}) public final class MentalAgony extends Card { public MentalAgony(GameState state) { super(state); // Target player discards two cards and loses 2 life. SetGenerator target = targetedBy(this.addTarget(Players.instance(), "target player")); this.addEffect(discardCards(target, 2, "Target player discards two cards")); this.addEffect(loseLife(target, 2, "and loses 2 life.")); } }
[ "robyter@gmail" ]
robyter@gmail
a9f6b1b376ccf6ba95c73b92df8ca4e23bc66e57
c1fbc8664b5fb641e55a87e9961c379ac0701b21
/03-JPA-Introducao/src/br/com/fiap/jpa/entity/Carro.java
92cb1b5d6867e96707322c1966faafa4ca08df39
[]
no_license
carlosumiji/Enterprise
8ad7ae4e0f4e737d61e6e84fc179b271c44dc357
cd11d644a642a85810d0cd2489f91a0563d3c990
refs/heads/master
2021-04-29T16:09:24.322060
2018-05-21T23:52:37
2018-05-21T23:52:37
121,809,481
0
0
null
null
null
null
ISO-8859-1
Java
false
false
3,544
java
package br.com.fiap.jpa.entity; import java.io.Serializable; import java.util.Calendar; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.EnumType; import javax.persistence.Enumerated; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Lob; import javax.persistence.SequenceGenerator; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import javax.persistence.Transient; @Entity @Table(name="TB_CARRO") @SequenceGenerator(name="carro", sequenceName="SQ_TB_CARRO", allocationSize=1) public class Carro implements Serializable{ @Id @Column(name="CD_CARRO") @GeneratedValue(generator="carro", strategy=GenerationType.SEQUENCE) private int id; @Column(name="DS_MODELO", nullable=false, length = 100) private String modelo; //Classe wrapper para valores nulos @Column(name="NR_ANO") private int ano; @Column(name="DS_MOTOR", length = 10) private String motor; @Column(name="DS_MONTADORA") private String montadora; @Column(name="DS_PLACA", nullable=false, length=8) private String placa; @Column(name="DT_FABRICACAO") @Temporal(TemporalType.DATE) private Calendar dataFabricacao; @Column(name="FG_COLECIONADOR") private boolean colecionador; @Transient//Não será mapeado para uma colunano banco de dados private boolean pagaIpva; @Lob//gravar arquivo no banco de dados (BLOB) @Column(name="FL_FOTO") private byte[] foto; @Enumerated(EnumType.STRING) @Column(name="DS_TRANSMISSAO") private Transmissao transmissao; public Carro() { super(); } public Carro(String modelo, int ano, String motor, String montadora, String placa, Calendar dataFabricacao, boolean colecionador, boolean pagaIpva, byte[] foto, Transmissao transmissao) { super(); this.modelo = modelo; this.ano = ano; this.motor = motor; this.montadora = montadora; this.placa = placa; this.dataFabricacao = dataFabricacao; this.colecionador = colecionador; this.pagaIpva = pagaIpva; this.foto = foto; this.transmissao = transmissao; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getModelo() { return modelo; } public void setModelo(String modelo) { this.modelo = modelo; } public int getAno() { return ano; } public void setAno(int ano) { this.ano = ano; } public String getMotor() { return motor; } public void setMotor(String motor) { this.motor = motor; } public String getMontadora() { return montadora; } public void setMontadora(String montadora) { this.montadora = montadora; } public String getPlaca() { return placa; } public void setPlaca(String placa) { this.placa = placa; } public Calendar getDataFabricacao() { return dataFabricacao; } public void setDataFabricacao(Calendar dataFabricacao) { this.dataFabricacao = dataFabricacao; } public boolean isColecionador() { return colecionador; } public void setColecionador(boolean colecionador) { this.colecionador = colecionador; } public boolean isPagaIpva() { return pagaIpva; } public void setPagaIpva(boolean pagaIpva) { this.pagaIpva = pagaIpva; } public byte[] getFoto() { return foto; } public void setFoto(byte[] foto) { this.foto = foto; } public Transmissao getTransmissao() { return transmissao; } public void setTransmissao(Transmissao transmissao) { this.transmissao = transmissao; } }
32e3d9fd05f297f8c1a13e3f5a46220a53669d58
c1f11feaf39dbfe0044c1f2945f82dc45fd8d6be
/team170/BattleRobot.java
f33131a70780d070922b557be76ba6ec11a0ab79
[]
no_license
0x70b1a5/Battlecode2015
7ac515c424b2930af16d402483ff55f8fa97eed5
a1e7e5255e8394df4689213ae22824b936670291
refs/heads/master
2021-05-28T03:01:20.029752
2015-02-12T23:44:11
2015-02-12T23:44:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,641
java
package team170; import java.util.ArrayList; import team170.units.UnitController; import battlecode.common.*; public class BattleRobot extends Robot { public Boolean canBeMobilized; public Boolean isMobilized; public BattleRobot(RobotController robotController) { super(robotController); this.canBeMobilized = true; this.isMobilized = false; } public void run() { super.run(); try { Boolean shouldMobilize = this.shouldMobilize(); if (!this.isMobilized && shouldMobilize) { this.isMobilized = true; } } catch (GameActionException e) {} } // MARK: Attacking class AttackResult { public RobotInfo target; } public Boolean attack() throws GameActionException { return this.attack(null); } public Boolean attack(AttackResult attackResult) throws GameActionException { if (!this.robotController.isWeaponReady()) return true; RobotInfo desiredEnemy = this.desiredEnemy(this.unitController.nearbyAttackableEnemies()); if (desiredEnemy != null) { this.robotController.attackLocation(desiredEnemy.location); if (attackResult != null) { attackResult.target = desiredEnemy; } return true; } return false; } // MARK: Enemy Helpers public RobotInfo desiredEnemy(RobotInfo[] enemies) throws GameActionException { if (enemies.length == 0) return null; // prioritize the HQ for (RobotInfo enemy : enemies) { if (enemy.type == RobotType.HQ) return enemy; } // prioritize towers next for (RobotInfo enemy : enemies) { if (enemy.type == RobotType.TOWER) return enemy; } // otherwise just the weakest enemy return weakestEnemy(enemies); } public RobotInfo weakestEnemy(RobotInfo[] enemies) throws GameActionException { if (enemies.length > 0) { RobotInfo chosenEnemy = null; for (RobotInfo enemy : enemies) { // first report launcher sightings this.broadcaster.evaluateSeenLaunchersWithType(enemy.type); // figure out the best enemy if (chosenEnemy == null) { chosenEnemy = enemy; } else { if (enemy.type == Missile.type() && chosenEnemy.type == Missile.type() || enemy.type != Missile.type()) { if (chosenEnemy.health > enemy.health) { chosenEnemy = enemy; } } } } return chosenEnemy; } return null; } public RobotInfo[] nearbyDangerousEnemies() throws GameActionException { return this.nearbyDangerousEnemies(16, 0); } public RobotInfo[] nearbyDangerousEnemies(int visionRadius, double attackRadius) throws GameActionException { ArrayList<RobotInfo> dangerousEnemies = new ArrayList<RobotInfo>(); MapLocation currentLocation = this.locationController.currentLocation(); RobotInfo[] enemies = this.unitController.nearbyEnemies(visionRadius); for (RobotInfo enemy : enemies) { this.broadcaster.evaluateSeenLaunchersWithType(enemy.type); if (!UnitController.isUnitTypeMilitary(enemy.type)) continue; if (currentLocation.distanceSquaredTo(enemy.location) <= (attackRadius > 0 ? attackRadius : enemy.type.attackRadiusSquared)) { dangerousEnemies.add(enemy); } } return dangerousEnemies.toArray(new RobotInfo[dangerousEnemies.size()]); } public RobotInfo[] enemiesInTerritory() throws GameActionException { // figure out if we should engage units in friendly territory ArrayList<RobotInfo> targettableEnemies = new ArrayList<RobotInfo>(); RobotInfo[] enemies = this.unitController.nearbyEnemies(300); for (RobotInfo enemy : enemies) { this.broadcaster.evaluateSeenLaunchersWithType(enemy.type); if (enemy.type == Missile.type()) continue; if (locationController.isLocationInFriendlyTerritory(enemy.location)) { targettableEnemies.add(enemy); } } return targettableEnemies.toArray(new RobotInfo[targettableEnemies.size()]); } // MARK: Mobilization public Boolean shouldMobilize() throws GameActionException { if (this.isMobilized) return true; // if we are mobilized, we are attacking yo if (!this.canBeMobilized) return false; int roundNum = Clock.getRoundNum(); return this.currentPlaystyle().canMobilizeForClockNumber(roundNum, this.robotController.getRoundLimit()); } public void mobilize() throws GameActionException { if (!this.canBeMobilized) return; MapLocation objective = this.locationController.bestObjective(); if (objective != null) { this.movementController.moveToward(objective); } } }
0513fc0f521748164ef6aa276b9673281800a888
9c9f6ccf828fe22bbbc37f4bd7b5b3dd60394a29
/skadmin-generator/src/main/java/com/dxj/generator/service/GeneratorService.java
7556df7522e97639161aebe992900e800b6ddf29
[ "Apache-2.0" ]
permissive
Miemer/skadmin
081a52f60cd42d2165d8c5ab02c6bd98c49dfbd1
799d06d9c95433c658b77447298b8353cc37b74f
refs/heads/master
2020-08-23T20:10:25.357873
2019-10-10T01:01:25
2019-10-10T01:01:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,379
java
package com.dxj.generator.service; import com.dxj.common.util.PageUtil; import com.dxj.generator.domain.GenConfig; import com.dxj.generator.domain.vo.ColumnInfo; import com.dxj.generator.domain.vo.TableInfo; import com.dxj.common.exception.BadRequestException; import com.dxj.generator.util.GenUtil; import org.springframework.stereotype.Service; import org.springframework.util.ObjectUtils; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.Query; import java.io.IOException; import java.util.ArrayList; import java.util.List; /** * @author dxj * @date 2019-01-02 */ @Service public class GeneratorService { @PersistenceContext private EntityManager em; /** * 查询数据库元数据 * * @param name * @param startEnd * @return */ public Object getTableList(String name, int[] startEnd) { StringBuilder sql = new StringBuilder("select table_name tableName,create_time createTime from information_schema.tables where table_schema = (select database()) "); if (!ObjectUtils.isEmpty(name)) { sql.append("and table_name like '%").append(name).append("%' "); } sql.append("order by table_name"); Query query = em.createNativeQuery(sql.toString()); query.setFirstResult(startEnd[0]); query.setMaxResults(startEnd[1] - startEnd[0]); System.out.println(sql.toString()); List<Object[]> result = query.getResultList(); List<TableInfo> tableInfos = new ArrayList<>(); for (Object[] obj : result) { tableInfos.add(new TableInfo(obj[0], obj[1])); } Query query1 = em.createNativeQuery("SELECT COUNT(*) from information_schema.tables where table_schema = (select database())"); Object totalElements = query1.getSingleResult(); return PageUtil.toPage(tableInfos, totalElements); } /** * 得到数据表的元数据 * * @param name * @return */ public Object getColumnList(String name) { StringBuilder sql = new StringBuilder("select column_name, is_nullable, data_type, column_comment, column_key, extra from information_schema.columns where "); if (!ObjectUtils.isEmpty(name)) { sql.append("table_name = '").append(name).append("' "); } sql.append("and table_schema = (select database()) order by ordinal_position"); Query query = em.createNativeQuery(sql.toString()); List<Object[]> result = query.getResultList(); List<ColumnInfo> columnInfoList = new ArrayList<>(); for (Object[] obj : result) { columnInfoList.add(new ColumnInfo(obj[0], obj[1], obj[2], obj[3], obj[4], obj[5], null, "true")); } return PageUtil.toPage(columnInfoList, columnInfoList.size()); } /** * 生成代码 * * @param columnInfoList * @param genConfig * @param tableName */ public void generator(List<ColumnInfo> columnInfoList, GenConfig genConfig, String tableName) { if (genConfig.getId() == null) { throw new BadRequestException("请先配置生成器"); } try { GenUtil.generatorCode(columnInfoList, genConfig, tableName); } catch (IOException e) { throw new RuntimeException(e); } } }
21b7e68ab7a93ad3b132497dcc8c6009c9e8ba74
daa81a7b33e4a5f60871c9d2f668ab992a1a6d5e
/SiteGeneratorAPI/src/com/amazon/generated/SimilarityLookupRequest.java
45b9260d69eae377e639903c312db44ed4bece2c
[]
no_license
Drastaro/SiteGeneratorAPI
260ca1cb718863ce89111918f6769e40f4770c3e
8f9145d77fc2e1f96f21193d58a26bf8eb374f52
refs/heads/master
2021-01-09T20:29:25.486607
2016-07-18T07:27:58
2016-07-18T07:27:58
63,580,101
0
0
null
null
null
null
UTF-8
Java
false
false
5,424
java
package com.amazon.generated; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for SimilarityLookupRequest complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="SimilarityLookupRequest"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element ref="{http://webservices.amazon.com/AWSECommerceService/2011-08-01}Condition" minOccurs="0"/> * &lt;element name="ItemId" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/> * &lt;element name="MerchantId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="ResponseGroup" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/> * &lt;element name="SimilarityType" minOccurs="0"> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;enumeration value="Intersection"/> * &lt;enumeration value="Random"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/element> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "SimilarityLookupRequest", propOrder = { "condition", "itemId", "merchantId", "responseGroup", "similarityType" }) public class SimilarityLookupRequest { @XmlElement(name = "Condition") protected String condition; @XmlElement(name = "ItemId") protected List<String> itemId; @XmlElement(name = "MerchantId") protected String merchantId; @XmlElement(name = "ResponseGroup") protected List<String> responseGroup; @XmlElement(name = "SimilarityType") protected String similarityType; /** * Gets the value of the condition property. * * @return * possible object is * {@link String } * */ public String getCondition() { return condition; } /** * Sets the value of the condition property. * * @param value * allowed object is * {@link String } * */ public void setCondition(String value) { this.condition = value; } /** * Gets the value of the itemId property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the itemId property. * * <p> * For example, to add a new item, do as follows: * <pre> * getItemId().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link String } * * */ public List<String> getItemId() { if (itemId == null) { itemId = new ArrayList<String>(); } return this.itemId; } /** * Gets the value of the merchantId property. * * @return * possible object is * {@link String } * */ public String getMerchantId() { return merchantId; } /** * Sets the value of the merchantId property. * * @param value * allowed object is * {@link String } * */ public void setMerchantId(String value) { this.merchantId = value; } /** * Gets the value of the responseGroup property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the responseGroup property. * * <p> * For example, to add a new item, do as follows: * <pre> * getResponseGroup().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link String } * * */ public List<String> getResponseGroup() { if (responseGroup == null) { responseGroup = new ArrayList<String>(); } return this.responseGroup; } /** * Gets the value of the similarityType property. * * @return * possible object is * {@link String } * */ public String getSimilarityType() { return similarityType; } /** * Sets the value of the similarityType property. * * @param value * allowed object is * {@link String } * */ public void setSimilarityType(String value) { this.similarityType = value; } }
[ "hp@hp-PC" ]
hp@hp-PC
5c6a6ff1c1986d3ed63a976a5d86e0222364193d
4db23693350928ecead170ed1ec59b792533aeff
/tiiimmo/admin/src/main/java/com/linln/admin/produce/domain/ProcessTaskDetail.java
db15f3b30f77159f1fa91225a24875edd3f8e8c5
[ "Apache-2.0" ]
permissive
ckshe/siui
ca931980ab742f6e63c84c93371617f11e867e2e
4064cbbc97093f202de44cc925bb0cd57e2a8fde
refs/heads/master
2022-12-20T09:38:33.940471
2020-08-05T01:13:06
2020-08-05T01:13:06
301,584,374
0
0
null
null
null
null
UTF-8
Java
false
false
798
java
package com.linln.admin.produce.domain; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; import javax.persistence.*; import javax.transaction.Transactional; import java.util.Date; import java.util.List; @Data @Entity @Table(name ="produce_process_task_detail") public class ProcessTaskDetail { @Id @GeneratedValue(strategy= GenerationType.IDENTITY) private Long id ; private Byte status; @DateTimeFormat(pattern="yyyy-MM-dd") private Date plan_day_time; private String process_task_code; private Integer plan_count; private Integer finish_count; private String detail_type; private String user_name; private String process_name; @Transient private List<ProcessTaskDetailDevice> detailDeviceList; }
[ "123456" ]
123456
936ed3b18704ede61d53a4b4f5f4c4d4e57cd81f
7ea7bf80672a2b5a249109ef147239c261bde5c0
/app/src/main/java/com/wong/myvolley/CellPhone.java
3f6ff38559cdf7ba3204d95520a99d1a0d9e2904
[]
no_license
wongkyunban/MyVolley
206481664c9a510832ea4a0a1601ecb069545371
8153a612e580394f16004e21737e8871b0dce678
refs/heads/master
2021-01-24T02:17:23.836605
2018-02-25T14:40:33
2018-02-25T14:40:33
122,833,491
0
0
null
null
null
null
UTF-8
Java
false
false
979
java
package com.wong.myvolley; /** * Created by wong on 18-2-25. */ public class CellPhone { private String province; //省 private String city;//市 private String areacode;//区号 private String zip;//邮编 private String company;//运营商 public String getProvince() { return province; } public void setProvince(String province) { this.province = province; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } public String getAreacode() { return areacode; } public void setAreacode(String areacode) { this.areacode = areacode; } public String getZip() { return zip; } public void setZip(String zip) { this.zip = zip; } public String getCompany() { return company; } public void setCompany(String company) { this.company = company; } }
d321514241a28b9f3b7bf3e0cbc90881c82fa11b
2b2fcb1902206ad0f207305b9268838504c3749b
/WakfuClientSources/srcx/class_2430_aWL.java
f91900bb7683cebd269246be3ce45e2987d0662d
[]
no_license
shelsonjava/Synx
4fbcee964631f747efc9296477dee5a22826791a
0cb26d5473ba1f36a3ea1d7163a5b9e6ebcb0b1d
refs/heads/master
2021-01-15T13:51:41.816571
2013-11-17T10:46:22
2013-11-17T10:46:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
391
java
public class aWL { public static final int fbS = 1; public static final int fbT = 1970; public static final int fbU = 1000; public static final int fbV = 86400; public static final cds fbW = new kb(0, 0, 4, 0); public static final cds fbX = new kb(30, 12, 0, 0); public static final boolean fbY = true; public static final int fbZ = 83; public static final int fca = 17; }
cf85db33a67af72eb55775e22e881445c4b19263
86cf61187d22b867d1e5d3c8a23d97e806636020
/src/main/java/base/operators/h2o/model/custom/deeplearning/DeepLearningTask.java
7e0c7cd9cf1c8b8782ed4fb4be15552bf5d9751c
[]
no_license
hitaitengteng/abc-pipeline-engine
f94bb3b1888ad809541c83d6923a64c39fef9b19
165a620b94fb91ae97647135cc15a66d212a39e8
refs/heads/master
2022-02-22T18:49:28.915809
2019-10-27T13:40:58
2019-10-27T13:40:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,842
java
package base.operators.h2o.model.custom.deeplearning; import base.operators.h2o.model.custom.deeplearning.DeepLearningModel.DeepLearningParameters; import base.operators.h2o.model.custom.deeplearning.Neurons.ExpRectifier; import base.operators.h2o.model.custom.deeplearning.Neurons.ExpRectifierDropout; import base.operators.h2o.model.custom.deeplearning.Neurons.Input; import base.operators.h2o.model.custom.deeplearning.Neurons.Linear; import base.operators.h2o.model.custom.deeplearning.Neurons.Maxout; import base.operators.h2o.model.custom.deeplearning.Neurons.MaxoutDropout; import base.operators.h2o.model.custom.deeplearning.Neurons.Rectifier; import base.operators.h2o.model.custom.deeplearning.Neurons.RectifierDropout; import base.operators.h2o.model.custom.deeplearning.Neurons.Softmax; import base.operators.h2o.model.custom.deeplearning.Neurons.Tanh; import base.operators.h2o.model.custom.deeplearning.Neurons.TanhDropout; public class DeepLearningTask { public DeepLearningTask() { } public static void fpropMiniBatch(long seed, Neurons[] neurons, DeepLearningModelInfo minfo, DeepLearningModelInfo consensus_minfo, boolean training, double[] responses, double[] offset, int n) { int mb; for(mb = 1; mb < neurons.length; ++mb) { neurons[mb].fprop(seed, training, n); } for(mb = 0; mb < n; ++mb) { if (offset != null && offset[mb] > 0.0D) { assert !minfo._classification; double[] m = minfo.data_info()._normRespMul; double[] s = minfo.data_info()._normRespSub; double mul = m == null ? 1.0D : m[0]; double sub = s == null ? 0.0D : s[0]; neurons[neurons.length - 1]._a[mb].add(0, (offset[mb] - sub) * mul); } if (training) { neurons[neurons.length - 1].setOutputLayerGradient(responses[mb], mb, n); if (consensus_minfo != null) { for(int i = 1; i < neurons.length; ++i) { neurons[i]._wEA = consensus_minfo.get_weights(i - 1); neurons[i]._bEA = consensus_minfo.get_biases(i - 1); } } } } } public static Neurons[] makeNeuronsForTraining(DeepLearningModelInfo minfo) { return makeNeurons(minfo, true); } public static Neurons[] makeNeuronsForTesting(DeepLearningModelInfo minfo) { return makeNeurons(minfo, false); } private static Neurons[] makeNeurons(DeepLearningModelInfo minfo, boolean training) { DataInfo dinfo = minfo.data_info(); DeepLearningParameters params = minfo.get_params(); int[] h = params._hidden; Neurons[] neurons = new Neurons[h.length + 2]; neurons[0] = new Input(params, minfo.units[0], dinfo); int i; for(i = 0; i < h.length + (params._autoencoder ? 1 : 0); ++i) { int n = params._autoencoder && i == h.length ? minfo.units[0] : h[i]; switch(params._activation) { case Tanh: neurons[i + 1] = new Tanh(n); break; case TanhWithDropout: neurons[i + 1] = (Neurons)(params._autoencoder && i == h.length ? new Tanh(n) : new TanhDropout(n)); break; case Rectifier: neurons[i + 1] = new Rectifier(n); break; case RectifierWithDropout: neurons[i + 1] = (Neurons)(params._autoencoder && i == h.length ? new Rectifier(n) : new RectifierDropout(n)); break; case Maxout: neurons[i + 1] = new Maxout(params, (short)2, n); break; case MaxoutWithDropout: neurons[i + 1] = (Neurons)(params._autoencoder && i == h.length ? new Maxout(params, (short)2, n) : new MaxoutDropout(params, (short)2, n)); break; case ExpRectifier: neurons[i + 1] = new ExpRectifier(n); break; case ExpRectifierWithDropout: neurons[i + 1] = (Neurons)(params._autoencoder && i == h.length ? new ExpRectifier(n) : new ExpRectifierDropout(n)); } } if (!params._autoencoder) { if (minfo._classification) { neurons[neurons.length - 1] = new Softmax(minfo.units[minfo.units.length - 1]); } else { neurons[neurons.length - 1] = new Linear(); } } for(i = 0; i < neurons.length; ++i) { neurons[i].init(neurons, i, params, minfo, training); neurons[i]._input = neurons[0]; } return neurons; } }
cfce0fed7852ab87b37b2605f83e30b75c2aff18
204582012ba05908e933c9a5d68e8df6f9d06c78
/junit4/example-junit-springboot-systemtest/src/test/java/examples/resource/UpdateGreetingResourceST.java
22d9ddeb4061f60df48638f5a39efb7a305d8ea9
[ "Apache-2.0" ]
permissive
testify-project/examples
df813b1187132f3ccbdf513fc03dc638f96df269
eab4deba2bb9f68e43c1d022021f0a406122ffb2
refs/heads/develop
2023-07-19T20:55:55.687858
2018-01-04T15:43:11
2018-01-04T15:43:11
78,854,649
0
1
Apache-2.0
2023-07-17T16:38:35
2017-01-13T14:07:57
Java
UTF-8
Java
false
false
2,430
java
/* * Copyright 2016-2017 Testify Project. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package examples.resource; import static javax.ws.rs.core.Response.Status.ACCEPTED; import static org.assertj.core.api.Assertions.assertThat; import javax.ws.rs.client.Client; import javax.ws.rs.client.ClientBuilder; import javax.ws.rs.client.Entity; import javax.ws.rs.client.WebTarget; import javax.ws.rs.core.Response; import org.glassfish.jersey.jackson.JacksonFeature; import org.junit.Test; import org.junit.runner.RunWith; import org.testifyproject.ClientInstance; import org.testifyproject.annotation.Application; import org.testifyproject.annotation.ConfigHandler; import org.testifyproject.annotation.Module; import org.testifyproject.annotation.Sut; import org.testifyproject.annotation.VirtualResource; import org.testifyproject.junit4.SystemTest; import examples.GreetingApplication; import examples.resource.model.GreetingModel; import fixture.TestModule; /** * * @author saden */ @Application(GreetingApplication.class) @Module(TestModule.class) @VirtualResource(value = "postgres", version = "9.4") @RunWith(SystemTest.class) public class UpdateGreetingResourceST { @Sut ClientInstance<WebTarget, Client> sut; @ConfigHandler void configureClient(ClientBuilder clientBuilder) { clientBuilder.register(JacksonFeature.class); } @Test public void givenGreetingEntityPutGreetingShouldUpdateGreeting() { //Arrange GreetingModel model = new GreetingModel("caio"); Entity<GreetingModel> entity = Entity.json(model); //Act Response response = sut.getClient().getValue() .path("greetings") .path("0d216415-1b8e-4ab9-8531-fcbd25d5966f") .request() .put(entity); //Assert assertThat(response.getStatus()).isEqualTo(ACCEPTED.getStatusCode()); } }
291cd1532026322316ded761e006d2ebe3411abc
d1bd1246f161b77efb418a9c24ee544d59fd1d20
/android/frameworkUI/trunk/src/org/javenstudio/cocoka/opengl/OrientationSource.java
7a9dd0949843d1e27af802b740313c7eb1eba97f
[]
no_license
navychen2003/javen
f9a94b2e69443291d4b5c3db5a0fc0d1206d2d4a
a3c2312bc24356b1c58b1664543364bfc80e816d
refs/heads/master
2021-01-20T12:12:46.040953
2015-03-03T06:14:46
2015-03-03T06:14:46
30,912,222
0
1
null
2023-03-20T11:55:50
2015-02-17T10:24:28
Java
UTF-8
Java
false
false
150
java
package org.javenstudio.cocoka.opengl; public interface OrientationSource { public int getDisplayRotation(); public int getCompensation(); }
477af82c0f6fb2f0691e27fa795dcf62ed54b182
27fae8ec9a35f90c404191e9ba0f00eeb4fd1ee6
/src/com/rs/game/WorldObject.java
2b7e11256062321d71f29c5953000d2bada7befa
[]
no_license
Log-nx/Open718
996230b00ba653908d9f03b324d5118ffd6e4b7a
2a3a90d7e31d74035bb0a0c8a5cacf15f8b10644
refs/heads/master
2023-07-18T17:15:16.133957
2021-08-28T17:20:51
2021-08-28T17:20:51
400,848,717
0
0
null
null
null
null
UTF-8
Java
false
false
1,889
java
package com.rs.game; import com.rs.cache.loaders.ObjectDefinitions; import com.rs.game.player.Player; @SuppressWarnings("serial") public class WorldObject extends WorldTile { private int id; private int type; private int rotation; private int life; public Player owner; public WorldObject(int id, int type, int rotation, WorldTile tile) { super(tile.getX(), tile.getY(), tile.getPlane()); this.id = id; this.type = type; this.rotation = rotation; this.life = 1; } public WorldObject(int id, int type, int rotation, int x, int y, int plane) { super(x, y, plane); this.id = id; this.type = type; this.rotation = rotation; this.life = 1; } public WorldObject(int id, int type, int rotation, int x, int y, int plane, int life) { super(x, y, plane); this.id = id; this.type = type; this.rotation = rotation; this.life = life; } public WorldObject(WorldObject object) { super(object.getX(), object.getY(), object.getPlane()); this.id = object.id; this.type = object.type; this.rotation = object.rotation; this.life = object.life; } public WorldObject(int id, int type, int rotation, int x, int y, int plane, Player owner) { super(x, y, plane); this.owner = owner; this.id = id; this.type = type; this.rotation = rotation; this.life = 1; } public int getId() { return id; } public int getType() { return type; } public int getRotation() { return rotation; } public void setRotation(int rotation) { this.rotation = rotation; } public int getLife() { return life; } public void setLife(int life) { this.life = life; } public void decrementObjectLife() { this.life--; } public Player getOwner() { return owner; } public ObjectDefinitions getDefinitions() { return ObjectDefinitions.getObjectDefinitions(id); } public void setId(int id) { this.id = id; } }
a19fdda35840ab5f1e82be63025892b4ca11860a
097df92ce1bfc8a354680725c7d10f0d109b5b7d
/com/amazon/ws/emr/hadoop/fs/shaded/com/amazonaws/services/dynamodbv2/model/KeysAndAttributes.java
77b2d9be4e50ecb48ab6b89bc94de66108e99041
[]
no_license
cozos/emrfs-hadoop
7a1a1221ffc3aa8c25b1067cf07d3b46e39ab47f
ba5dfa631029cb5baac2f2972d2fdaca18dac422
refs/heads/master
2022-10-14T15:03:51.500050
2022-10-06T05:38:49
2022-10-06T05:38:49
233,979,996
2
2
null
2022-10-06T05:41:46
2020-01-15T02:24:16
Java
UTF-8
Java
false
false
7,789
java
package com.amazon.ws.emr.hadoop.fs.shaded.com.amazonaws.services.dynamodbv2.model; import com.amazon.ws.emr.hadoop.fs.shaded.com.amazonaws.annotation.SdkInternalApi; import com.amazon.ws.emr.hadoop.fs.shaded.com.amazonaws.protocol.ProtocolMarshaller; import com.amazon.ws.emr.hadoop.fs.shaded.com.amazonaws.protocol.StructuredPojo; import com.amazon.ws.emr.hadoop.fs.shaded.com.amazonaws.services.dynamodbv2.model.transform.KeysAndAttributesMarshaller; import java.io.Serializable; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; public class KeysAndAttributes implements Serializable, Cloneable, StructuredPojo { private List<Map<String, AttributeValue>> keys; private List<String> attributesToGet; private Boolean consistentRead; private String projectionExpression; private Map<String, String> expressionAttributeNames; public List<Map<String, AttributeValue>> getKeys() { return keys; } public void setKeys(Collection<Map<String, AttributeValue>> keys) { if (keys == null) { this.keys = null; return; } this.keys = new ArrayList(keys); } public KeysAndAttributes withKeys(Map<String, AttributeValue>... keys) { if (this.keys == null) { setKeys(new ArrayList(keys.length)); } for (Map<String, AttributeValue> ele : keys) { this.keys.add(ele); } return this; } public KeysAndAttributes withKeys(Collection<Map<String, AttributeValue>> keys) { setKeys(keys); return this; } public List<String> getAttributesToGet() { return attributesToGet; } public void setAttributesToGet(Collection<String> attributesToGet) { if (attributesToGet == null) { this.attributesToGet = null; return; } this.attributesToGet = new ArrayList(attributesToGet); } public KeysAndAttributes withAttributesToGet(String... attributesToGet) { if (this.attributesToGet == null) { setAttributesToGet(new ArrayList(attributesToGet.length)); } for (String ele : attributesToGet) { this.attributesToGet.add(ele); } return this; } public KeysAndAttributes withAttributesToGet(Collection<String> attributesToGet) { setAttributesToGet(attributesToGet); return this; } public void setConsistentRead(Boolean consistentRead) { this.consistentRead = consistentRead; } public Boolean getConsistentRead() { return consistentRead; } public KeysAndAttributes withConsistentRead(Boolean consistentRead) { setConsistentRead(consistentRead); return this; } public Boolean isConsistentRead() { return consistentRead; } public void setProjectionExpression(String projectionExpression) { this.projectionExpression = projectionExpression; } public String getProjectionExpression() { return projectionExpression; } public KeysAndAttributes withProjectionExpression(String projectionExpression) { setProjectionExpression(projectionExpression); return this; } public Map<String, String> getExpressionAttributeNames() { return expressionAttributeNames; } public void setExpressionAttributeNames(Map<String, String> expressionAttributeNames) { this.expressionAttributeNames = expressionAttributeNames; } public KeysAndAttributes withExpressionAttributeNames(Map<String, String> expressionAttributeNames) { setExpressionAttributeNames(expressionAttributeNames); return this; } public KeysAndAttributes addExpressionAttributeNamesEntry(String key, String value) { if (null == expressionAttributeNames) { expressionAttributeNames = new HashMap(); } if (expressionAttributeNames.containsKey(key)) { throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); } expressionAttributeNames.put(key, value); return this; } public KeysAndAttributes clearExpressionAttributeNamesEntries() { expressionAttributeNames = null; return this; } public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getKeys() != null) { sb.append("Keys: ").append(getKeys()).append(","); } if (getAttributesToGet() != null) { sb.append("AttributesToGet: ").append(getAttributesToGet()).append(","); } if (getConsistentRead() != null) { sb.append("ConsistentRead: ").append(getConsistentRead()).append(","); } if (getProjectionExpression() != null) { sb.append("ProjectionExpression: ").append(getProjectionExpression()).append(","); } if (getExpressionAttributeNames() != null) { sb.append("ExpressionAttributeNames: ").append(getExpressionAttributeNames()); } sb.append("}"); return sb.toString(); } public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof KeysAndAttributes)) { return false; } KeysAndAttributes other = (KeysAndAttributes)obj; if (((other.getKeys() == null ? 1 : 0) ^ (getKeys() == null ? 1 : 0)) != 0) { return false; } if ((other.getKeys() != null) && (!other.getKeys().equals(getKeys()))) { return false; } if (((other.getAttributesToGet() == null ? 1 : 0) ^ (getAttributesToGet() == null ? 1 : 0)) != 0) { return false; } if ((other.getAttributesToGet() != null) && (!other.getAttributesToGet().equals(getAttributesToGet()))) { return false; } if (((other.getConsistentRead() == null ? 1 : 0) ^ (getConsistentRead() == null ? 1 : 0)) != 0) { return false; } if ((other.getConsistentRead() != null) && (!other.getConsistentRead().equals(getConsistentRead()))) { return false; } if (((other.getProjectionExpression() == null ? 1 : 0) ^ (getProjectionExpression() == null ? 1 : 0)) != 0) { return false; } if ((other.getProjectionExpression() != null) && (!other.getProjectionExpression().equals(getProjectionExpression()))) { return false; } if (((other.getExpressionAttributeNames() == null ? 1 : 0) ^ (getExpressionAttributeNames() == null ? 1 : 0)) != 0) { return false; } if ((other.getExpressionAttributeNames() != null) && (!other.getExpressionAttributeNames().equals(getExpressionAttributeNames()))) { return false; } return true; } public int hashCode() { int prime = 31; int hashCode = 1; hashCode = 31 * hashCode + (getKeys() == null ? 0 : getKeys().hashCode()); hashCode = 31 * hashCode + (getAttributesToGet() == null ? 0 : getAttributesToGet().hashCode()); hashCode = 31 * hashCode + (getConsistentRead() == null ? 0 : getConsistentRead().hashCode()); hashCode = 31 * hashCode + (getProjectionExpression() == null ? 0 : getProjectionExpression().hashCode()); hashCode = 31 * hashCode + (getExpressionAttributeNames() == null ? 0 : getExpressionAttributeNames().hashCode()); return hashCode; } public KeysAndAttributes clone() { try { return (KeysAndAttributes)super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() even though we're Cloneable!", e); } } @SdkInternalApi public void marshall(ProtocolMarshaller protocolMarshaller) { KeysAndAttributesMarshaller.getInstance().marshall(this, protocolMarshaller); } } /* Location: * Qualified Name: com.amazon.ws.emr.hadoop.fs.shaded.com.amazonaws.services.dynamodbv2.model.KeysAndAttributes * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
3f4ec0cec172c91910de6dd4576a7c7d35f91e34
365dd8ebb72f54cedeed37272d4db23d139522f4
/src/main/java/com/kentington/thaumichorizons/client/renderer/block/BlockJarTHRenderer.java
f69369e5cde73049d979b1cbd393afa0ec9031b9
[]
no_license
Bogdan-G/ThaumicHorizons
c05b1fdeda0bdda6d427a39b74cac659661c4cbe
83caf754f51091c6b7297c0c68fe8df309d7d7f9
refs/heads/master
2021-09-10T14:13:54.532269
2018-03-27T16:58:15
2018-03-27T16:58:15
122,425,516
0
0
null
null
null
null
UTF-8
Java
false
false
2,435
java
package com.kentington.thaumichorizons.client.renderer.block; import com.kentington.thaumichorizons.common.ThaumicHorizons; import com.kentington.thaumichorizons.common.blocks.BlockSoulJar; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import org.lwjgl.opengl.GL11; import thaumcraft.client.renderers.block.BlockRenderer; public class BlockJarTHRenderer extends BlockRenderer implements ISimpleBlockRenderingHandler { public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { GL11.glPushMatrix(); GL11.glEnable(3042); GL11.glBlendFunc(770, 771); Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); IIcon i1 = ((BlockSoulJar)block).iconJarTop; IIcon i2 = ((BlockSoulJar)block).iconJarSide; block.setBlockBounds(W3, 0.0F, W3, W13, W12, W13); renderer.setRenderBoundsFromBlock(block); drawFaces(renderer, block, ((BlockSoulJar)block).iconJarBottom, i1, i2, i2, i2, i2, true); block.setBlockBounds(W5, W12, W5, W11, W14, W11); renderer.setRenderBoundsFromBlock(block); drawFaces(renderer, block, ((BlockSoulJar)block).iconJarBottom, i1, i2, i2, i2, i2, true); GL11.glPopMatrix(); } public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { setBrightness(world, x, y, z, block); world.getBlockMetadata(x, y, z); block.setBlockBounds(W3, 0.0F, W3, W13, W12, W13); renderer.setRenderBoundsFromBlock(block); renderer.renderStandardBlock(block, x, y, z); block.setBlockBounds(W5, W12, W5, W11, W14, W11); renderer.setRenderBoundsFromBlock(block); renderer.renderStandardBlock(block, x, y, z); renderer.clearOverrideBlockTexture(); block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); renderer.setRenderBoundsFromBlock(block); return true; } public boolean shouldRender3DInInventory(int modelId) { return true; } public int getRenderId() { return ThaumicHorizons.blockJarRI; } }
444d8d6c5d8a9b92411cdf7737bd28eb3e93ce8d
ca59718f60865008bb8909094a9e75f78c003a92
/src/main/java/org/onvif/ver10/schema/NetworkProtocol.java
54bc334800ee6d3d932b4b6a16dceab6040f9fb7
[]
no_license
yanxinorg/MyPTZTest
ea6a3457796d320e6f45393634fc428905bf9758
882448f7bfe3c191f5b3951d31178e7fcabb9944
refs/heads/master
2021-04-03T08:01:19.247051
2018-03-12T08:28:43
2018-03-12T08:28:43
124,856,618
3
1
null
null
null
null
UTF-8
Java
false
false
4,448
java
// // Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.5-2 generiert // Siehe <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // �nderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren. // Generiert: 2014.02.04 um 12:22:03 PM CET // package org.onvif.ver10.schema; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAnyAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import javax.xml.namespace.QName; /** * <p> * Java-Klasse f�r NetworkProtocol complex type. * * <p> * Das folgende Schemafragment gibt den erwarteten Content an, der in dieser Klasse enthalten ist. * * <pre> * <complexType name="NetworkProtocol"> * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> * <element name="Name" type="{http://www.onvif.org/ver10/schema}NetworkProtocolType"/> * <element name="Enabled" type="{http://www.w3.org/2001/XMLSchema}boolean"/> * <element name="Port" type="{http://www.w3.org/2001/XMLSchema}int" maxOccurs="unbounded"/> * <element name="Extension" type="{http://www.onvif.org/ver10/schema}NetworkProtocolExtension" minOccurs="0"/> * </sequence> * <anyAttribute processContents='lax'/> * </restriction> * </complexContent> * </complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "NetworkProtocol", propOrder = { "name", "enabled", "port", "extension" }) public class NetworkProtocol { @XmlElement(name = "Name", required = true) protected NetworkProtocolType name; @XmlElement(name = "Enabled") protected boolean enabled; @XmlElement(name = "Port", type = Integer.class) protected List<Integer> port; @XmlElement(name = "Extension") protected NetworkProtocolExtension extension; @XmlAnyAttribute private Map<QName, String> otherAttributes = new HashMap<QName, String>(); /** * Ruft den Wert der name-Eigenschaft ab. * * @return possible object is {@link NetworkProtocolType } * */ public NetworkProtocolType getName() { return name; } /** * Legt den Wert der name-Eigenschaft fest. * * @param value * allowed object is {@link NetworkProtocolType } * */ public void setName(NetworkProtocolType value) { this.name = value; } /** * Ruft den Wert der enabled-Eigenschaft ab. * */ public boolean isEnabled() { return enabled; } /** * Legt den Wert der enabled-Eigenschaft fest. * */ public void setEnabled(boolean value) { this.enabled = value; } /** * Gets the value of the port property. * * <p> * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the port property. * * <p> * For example, to add a new item, do as follows: * * <pre> * getPort().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list {@link Integer } * * */ public List<Integer> getPort() { if (port == null) { port = new ArrayList<Integer>(); } return this.port; } /** * Ruft den Wert der extension-Eigenschaft ab. * * @return possible object is {@link NetworkProtocolExtension } * */ public NetworkProtocolExtension getExtension() { return extension; } /** * Legt den Wert der extension-Eigenschaft fest. * * @param value * allowed object is {@link NetworkProtocolExtension } * */ public void setExtension(NetworkProtocolExtension value) { this.extension = value; } /** * Gets a map that contains attributes that aren't bound to any typed property on this class. * * <p> * the map is keyed by the name of the attribute and the value is the string value of the attribute. * * the map returned by this method is live, and you can add new attribute by updating the map directly. Because of this design, there's no setter. * * * @return always non-null */ public Map<QName, String> getOtherAttributes() { return otherAttributes; } }
5ce76a0004b3b08a0d80f772b759e7f9a071d51a
d4627ad44a9ac9dfb444bd5d9631b25abe49c37e
/net/divinerpg/item/tool/FoodBase.java
b3921cc8bd9784bd14d5a3a651e285ab8e1b00ed
[]
no_license
Scrik/Divine-RPG
0c357acf374f0ca7fab1f662b8f305ff0e587a2f
f546f1d60a2514947209b9eacdfda36a3990d994
refs/heads/master
2021-01-15T11:14:03.426172
2014-02-19T20:27:30
2014-02-19T20:27:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
865
java
package net.divinerpg.item.tool; import net.divinerpg.DivineRPG; import net.divinerpg.lib.Reference; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.item.Item; import net.minecraft.item.ItemFood; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class FoodBase extends ItemFood{ private String iconPath; public FoodBase(int par1, int par2, float par3, boolean par4) { super(par1, par2, par3, par4); setCreativeTab(DivineRPG.Misc); } public Item registerTextures(String texture) { iconPath = texture; setUnlocalizedName(texture); return this; } @Override @SideOnly(Side.CLIENT) public void registerIcons(IconRegister iconRegister) { itemIcon = iconRegister.registerIcon(Reference.MOD_ID + ":" + iconPath); } }
75162aaa8920f762dded1729a541767cea64dd5a
05ba4598688a799f73878dd54030c802f178e932
/app/src/main/java/com/tzl/agriculture/model/GoodsMo.java
f0538eafcdc9c227e67531276a1e179dbba3fcba
[]
no_license
2803404074/Agriculture
41e4b5e4c5adc2435df3d989d8ef6e85172523a5
5cb8d2ceddc2beaee0cd0c14474a5d5d29255f32
refs/heads/master
2020-07-09T12:09:41.071227
2019-09-16T06:41:38
2019-09-16T06:41:38
203,963,006
0
0
null
null
null
null
UTF-8
Java
false
false
2,757
java
package com.tzl.agriculture.model; import java.io.Serializable; import java.util.List; /** * 商品列表模型 */ public class GoodsMo implements Serializable { private String goodsId; private String originalPrice; private String goodsName; private String goodsDesc; private String categoryId; private String picUrl; private String goodsPic; private String salesVolume;//销量 private List<String>goodsLabelList;//标签 private String spikeStartTime; private String spikeEndTime; private String shopName; private String categoryName; private String price; public GoodsMo() { } public String getSalesVolume() { return salesVolume; } public List<String> getGoodsLabelList() { return goodsLabelList; } public String getGoodsPic() { return goodsPic; } public void setGoodsPic(String goodsPic) { this.goodsPic = goodsPic; } public String getOriginalPrice() { return originalPrice; } public void setOriginalPrice(String originalPrice) { this.originalPrice = originalPrice; } public String getGoodsId() { return goodsId; } public void setGoodsId(String goodsId) { this.goodsId = goodsId; } public String getGoodsName() { return goodsName; } public void setGoodsName(String goodsName) { this.goodsName = goodsName; } public String getGoodsDesc() { return goodsDesc; } public void setGoodsDesc(String goodsDesc) { this.goodsDesc = goodsDesc; } public String getCategoryId() { return categoryId; } public void setCategoryId(String categoryId) { this.categoryId = categoryId; } public String getPicUrl() { return picUrl; } public void setPicUrl(String picUrl) { this.picUrl = picUrl; } public String getSpikeStartTime() { return spikeStartTime; } public void setSpikeStartTime(String spikeStartTime) { this.spikeStartTime = spikeStartTime; } public String getSpikeEndTime() { return spikeEndTime; } public void setSpikeEndTime(String spikeEndTime) { this.spikeEndTime = spikeEndTime; } public String getShopName() { return shopName; } public void setShopName(String shopName) { this.shopName = shopName; } public String getCategoryName() { return categoryName; } public void setCategoryName(String categoryName) { this.categoryName = categoryName; } public String getPrice() { return price; } public void setPrice(String price) { this.price = price; } }
a0df5ffd2be81b21f443955c2da5fea78103d8cd
b0215a823f1fc24f4b57bcc37926bc011ce7cb6f
/odps-sdk/odps-sdk-core/src/main/java/com/aliyun/odps/task/SQLTask.java
b4c37db9121f564978fa074361e23e9d092b1530
[ "Apache-2.0" ]
permissive
shellc/aliyun-odps-java-sdk
539f5649628c33a48b6e1915a29bcebb38a8b76c
3eb9ea886f7ecd4cae94a2c1549ab05863f35f72
refs/heads/master
2021-01-16T21:52:38.531808
2015-08-14T07:43:01
2015-08-14T07:43:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,004
java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package com.aliyun.odps.task; import java.util.Map; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import com.aliyun.odps.Instance; import com.aliyun.odps.Odps; import com.aliyun.odps.OdpsException; import com.aliyun.odps.Task; import com.aliyun.odps.commons.util.JacksonParser; /** * SQLTask的定义 * * @author [email protected] */ @XmlRootElement(name = "SQL") public class SQLTask extends Task { private String query; public String getQuery() { return query; } /** * 设置SQL查询语句 * * @param query * 需要执行的SQL查询 */ @XmlElement(name = "Query") public void setQuery(String query) { this.query = query; } @Override public String getCommandText() { return query; } /** * 运行 SQL.<br /> * 执行读取数据时,最多返回 1W 条记录,若超过,数据将被截断。<br /> * * 特别注意,在执行数据读取操作时:<br /> * 正常情况下的 task 执行后,task 的状态为 SUCCESS,并正常返回数据结果。<br /> * 但是,当读取数据量超过 10MB,task 的状态将是 FAILED,返回的数据结果为 error message。<br /> * 因此,大量数据的获取建议使用 {@link com.aliyun.odps.tunnel.TableTunnel} 进行操作。<br /> * * <br /> * 示例代码: * <pre> *{ String sql = "select ....;"; Instance instance = SQLTask.run(odps, sql); instance.waitForSuccess(); Map<String, String> results = instance.getTaskResults(); Map<String, TaskStatus> taskStatus = instance.getTaskStatus(); for(Entry<String, TaskStatus> status : taskStatus.entrySet()) { if (TaskStatus.Status.SUCCESS == status.getValue().getStatus()) { String result = results.get(status.getKey()); System.out.println(result); } } } * </pre> * * @param {@link * Odps} * @param sql * 需要执行的SQL查询 * @return 运行实例 {@link Instance} * @throws OdpsException */ public static Instance run(Odps odps, String sql) throws OdpsException { String project = odps.getDefaultProject(); if (project == null) { throw new OdpsException("default project required."); } return run(odps, project, sql, "AnonymousSQLTask", null, null, "sql"); } /** * 运行SQL * * @param odps * {@link Odps}对象 * @param project * 任务运行时所属的{@link Project}名称 * @param sql * 需要运行的SQL查询 * @param hints * 能够影响SQL执行的Set信息,例如:odps.mapred.map.split.size等 * @param alias * Alias信息。详情请参考用户手册中alias命令的相关介绍 * @return 作业运行实例 {@link Instance} * @throws OdpsException */ public static Instance run(Odps odps, String project, String sql, Map<String, String> hints, Map<String, String> aliases) throws OdpsException { return run(odps, project, sql, "AnonymousSQLTask", hints, aliases, "sql"); } /*Un-document*/ public static Instance run(Odps odps, String project, String sql, String taskName, Map<String, String> hints, Map<String, String> aliases) throws OdpsException { return run(odps, project, sql, taskName, hints, aliases, "sql"); } public static Instance run(Odps odps, String project, String sql, String taskName, Map<String, String> hints, Map<String, String> aliases, int priority) throws OdpsException { return run(odps, project, sql, taskName, hints, aliases, priority, "sql"); } private static Instance run(Odps odps, String project, String sql, String taskName, Map<String, String> hints, Map<String, String> aliases, Integer priority, String type) throws OdpsException { SQLTask task = new SQLTask(); task.setQuery(sql); task.setName(taskName); task.setProperty("type", type); if (hints != null) { try { String json = JacksonParser.getObjectMapper().writeValueAsString(hints); task.setProperty("settings", json); } catch (Exception e) { throw new OdpsException(e.getMessage(), e); } } if (aliases != null) { try { String json = JacksonParser.getObjectMapper().writeValueAsString(aliases); task.setProperty("aliases", json); } catch (Exception e) { throw new OdpsException(e.getMessage(), e); } } if (priority != null) { return odps.instances().create(project, task, priority); } else { return odps.instances().create(project, task); } } static Instance run(Odps odps, String project, String sql, String taskName, Map<String, String> hints, Map<String, String> aliases, String type) throws OdpsException { return run(odps, project, sql, taskName, hints, aliases, null, type); } }
ac2d5b2b752e0a1c2e94a9fa414f74059dec5a2b
d38afb4d31e0574dd2086fc84e5d664aecc77f5c
/com/planet_ink/coffee_mud/Abilities/Spells/Spell_SuperiorImage.java
6ff05a445552563d360a609685ebf7aea64991ed
[ "Apache-2.0" ]
permissive
Dboykey/CoffeeMud
c4775fc6ec9e910ff7ff8523c04567a580a9529e
844704805d3de26a16b83bd07552d6ae82391208
refs/heads/master
2022-04-16T07:07:22.004847
2020-04-06T17:55:33
2020-04-06T17:55:33
255,074,559
0
1
Apache-2.0
2020-04-12T12:10:07
2020-04-12T12:10:06
null
UTF-8
Java
false
false
2,301
java
package com.planet_ink.coffee_mud.Abilities.Spells; import com.planet_ink.coffee_mud.core.interfaces.*; import com.planet_ink.coffee_mud.core.*; import com.planet_ink.coffee_mud.core.collections.*; import com.planet_ink.coffee_mud.Abilities.interfaces.*; import com.planet_ink.coffee_mud.Areas.interfaces.*; import com.planet_ink.coffee_mud.Behaviors.interfaces.*; import com.planet_ink.coffee_mud.CharClasses.interfaces.*; import com.planet_ink.coffee_mud.Commands.interfaces.*; import com.planet_ink.coffee_mud.Common.interfaces.*; import com.planet_ink.coffee_mud.Exits.interfaces.*; import com.planet_ink.coffee_mud.Items.interfaces.*; import com.planet_ink.coffee_mud.Libraries.interfaces.ExpertiseLibrary; import com.planet_ink.coffee_mud.Locales.interfaces.*; import com.planet_ink.coffee_mud.MOBS.interfaces.*; import com.planet_ink.coffee_mud.Races.interfaces.*; import java.util.*; /* Copyright 2017-2020 Bo Zimmerman 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. */ public class Spell_SuperiorImage extends Spell_MinorImage { @Override public String ID() { return "Spell_SuperiorImage"; } private final static String localizedName = CMLib.lang().L("Superior Image"); @Override public String name() { return localizedName; } @Override protected int getDuration(final MOB caster, final int asLevel) { final int ticksPerMudHr = (int)CMProps.getTicksPerMudHour(); return (CMLib.time().globalClock().getHoursInDay() + super.adjustedLevel(caster, asLevel)) * ticksPerMudHr; } @Override protected boolean canSeeAppearance() { return true; } @Override protected int canTargetCode() { return CAN_MOBS; } @Override protected boolean canTargetOthers() { return true; } }
cf2932631d997e9f7ffaee6fedd51e96ee163e05
5e224ff6d555ee74e0fda6dfa9a645fb7de60989
/database/src/main/java/adila/db/bit_bit.java
9f2a10013d53ac32df8b15afcb993f2954c3deae
[ "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
191
java
// This file is automatically generated. package adila.db; /* * Explay Bit * * DEVICE: Bit * MODEL: Bit */ final class bit_bit { public static final String DATA = "Explay|Bit|"; }
e6d6223d716d8d58b9be542337c2d6311c387f98
40a6d17d2fd7bd7f800d5562d8bb9a76fb571ab4
/pxlab/src/main/java/de/pxlab/pxl/display/AfterEffect.java
207117a31fbd1ebe66a023fb38d2762f5ab72dc9
[ "MIT" ]
permissive
manuelgentile/pxlab
cb6970e2782af16feb1f8bf8e71465ebc48aa683
c8d29347d36c3e758bac4115999fc88143c84f87
refs/heads/master
2021-01-13T02:26:40.208893
2012-08-08T13:49:53
2012-08-08T13:49:53
5,121,970
2
0
null
null
null
null
UTF-8
Java
false
false
3,171
java
package de.pxlab.pxl.display; import de.pxlab.pxl.*; /** * An abstract superclass for after effect matching of two patches, one for * adaptation and the other one for matching it to the afterimage. May be shown * continuously. * * @version 0.1.0 */ /* * * 2006/06/30 */ abstract public class AfterEffect extends Display { /** Pattern background. */ public ExPar BackgroundColor = new ExPar(COLOR, new ExParValue( new ExParExpression(ExParExpression.GRAY)), "Background color"); /** Color of the adaptation patch. */ public ExPar AdaptationColor = new ExPar(COLOR, new ExParValue( new ExParExpression(ExParExpression.CYAN)), "Adaptation color"); /** Color of the test patch. */ public ExPar MatchingColor = new ExPar(COLOR, new ExParValue( new ExParExpression(ExParExpression.RED)), "Test color"); /** Horizontal pattern center position. */ public ExPar LocationX = new ExPar(HORSCREENPOS, new ExParValue(0), "Horizontal center position"); /** Vertical pattern center position. */ public ExPar LocationY = new ExPar(VERSCREENPOS, new ExParValue(0), "Vertical center position"); /** Number of horizontal pixels in the pattern. */ public ExPar Width = new ExPar(HORSCREENSIZE, new ExParValue(384), "Pattern width in number of pixels"); /** Number of vertical pixels in the pattern. */ public ExPar Height = new ExPar(VERSCREENSIZE, new ExParValue(256), "Pattern height in number of pixels"); /** * Number of horizontal pixels which the patch centers are shifted from the * pattern center. */ public ExPar ShiftX = new ExPar(HORSCREENSIZE, new ExParValue(32), "Horizontal test patch shift"); /** Number of vertical pixels which the test patch centers are shifted. */ public ExPar ShiftY = new ExPar(HORSCREENSIZE, new ExParValue(0), "Vertical test ppatch shift"); /** * Timer for controlling the ON and OFF periods. This should always be set * to de.pxlab.pxl.TimerCodes.VS_CLOCK_TIMER. */ public ExPar OnOffTimer = new ExPar(TIMING_EDITOR, TimerCodes.class, new ExParValueConstant("de.pxlab.pxl.TimerCodes.VS_CLOCK_TIMER"), "Internal cycle interval timer"); /** Adaptation interval duration. */ public ExPar AdaptationDuration = new ExPar(DURATION, 0, 300, new ExParValue(3000), "Adaptation interval duration"); /** Test interval duration. */ public ExPar MatchingDuration = new ExPar(DURATION, 0, 500, new ExParValue( 600), "Test interval duration"); /** * Type of fixation mark to be shown. * * @see de.pxlab.pxl.FixationCodes */ public ExPar FixationType = new ExPar( GEOMETRY_EDITOR, FixationCodes.class, new ExParValueConstant("de.pxlab.pxl.FixationCodes.FIXATION_CROSS"), "Type of fixation mark"); /** Color of an optional fixation mark. */ public ExPar FixationColor = new ExPar(COLOR, new ExParValue( new ExParExpression(ExParExpression.LIGHT_GRAY)), "Fixation mark color"); /** Size of a fixation marks. */ public ExPar FixationSize = new ExPar(VERSCREENSIZE, new ExParValue(10), "Size of fixation mark"); public boolean isAnimated() { return (true); } }
212ddf51f8785eda87e32cb8a7f5ae9c9cde0aad
f662526b79170f8eeee8a78840dd454b1ea8048c
/nd.java
3b2c3aa76cc9093db66dc742840196ce9cdb9f89
[]
no_license
jason920612/Minecraft
5d3cd1eb90726efda60a61e8ff9e057059f9a484
5bd5fb4dac36e23a2c16576118da15c4890a2dff
refs/heads/master
2023-01-12T17:04:25.208957
2020-11-26T08:51:21
2020-11-26T08:51:21
316,170,984
0
0
null
null
null
null
UTF-8
Java
false
false
2,338
java
/* */ import java.io.IOException; /* */ /* */ public class nd implements iv<me> { /* */ private a a; /* */ private pc b; /* */ private boolean c; /* */ private boolean d; /* */ private boolean e; /* */ private boolean f; /* */ /* */ public enum a { /* 12 */ a, b; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ public nd() {} /* */ /* */ /* */ /* */ /* */ /* */ /* */ public nd(avk ☃) { /* 28 */ this.a = a.a; /* 29 */ this.b = ☃.b(); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public void a(hy ☃) throws IOException { /* 42 */ this.a = ☃.<a>a(a.class); /* 43 */ if (this.a == a.a) { /* 44 */ this.b = ☃.l(); /* 45 */ } else if (this.a == a.b) { /* 46 */ this.c = ☃.readBoolean(); /* 47 */ this.d = ☃.readBoolean(); /* 48 */ this.e = ☃.readBoolean(); /* 49 */ this.f = ☃.readBoolean(); /* */ } /* */ } /* */ /* */ /* */ public void b(hy ☃) throws IOException { /* 55 */ ☃.a(this.a); /* */ /* 57 */ if (this.a == a.a) { /* 58 */ ☃.a(this.b); /* 59 */ } else if (this.a == a.b) { /* 60 */ ☃.writeBoolean(this.c); /* 61 */ ☃.writeBoolean(this.d); /* 62 */ ☃.writeBoolean(this.e); /* 63 */ ☃.writeBoolean(this.f); /* */ } /* */ } /* */ /* */ /* */ public void a(me ☃) { /* 69 */ ☃.a(this); /* */ } /* */ /* */ public a b() { /* 73 */ return this.a; /* */ } /* */ /* */ public pc c() { /* 77 */ return this.b; /* */ } /* */ /* */ public boolean d() { /* 81 */ return this.c; /* */ } /* */ /* */ public boolean e() { /* 85 */ return this.d; /* */ } /* */ /* */ public boolean f() { /* 89 */ return this.e; /* */ } /* */ /* */ public boolean g() { /* 93 */ return this.f; /* */ } /* */ } /* Location: F:\dw\server.jar!\nd.class * Java compiler version: 8 (52.0) * JD-Core Version: 1.1.3 */
ea1e78e4d15506a34619d558682176eb443f7903
3f6637f6b073232dcc873d17d23c74c8d822e676
/EdlGameFramework/src/main/java/com/edlplan/framework/ui/LayoutTransition.java
5883928a1fe245d7d3803bbadcfa48bf7394833f
[]
no_license
EdrowsLuo/osu-lab
6fcb432c45d982eec686b73e61a02e654a43754a
f23bda8234f128abb6d30537b81ca54443d7a21e
refs/heads/master
2020-03-22T21:52:23.982325
2019-05-22T09:13:52
2019-05-22T09:14:57
140,718,644
11
6
null
null
null
null
UTF-8
Java
false
false
169
java
package com.edlplan.framework.ui; public interface LayoutTransition { public boolean isChangingLayout(); public void layoutChange(EdAbstractViewGroup view); }
b5eb3f9777842de230fb34412b8e920ad0c7a1bd
fff9297205a7f7a0034234e8d3bef81339573b81
/app/src/main/java/br/com/tastyfast/tastyfastapp/MenuConfiguracoesActivity.java
0da1c8ecd46f6f4b0671dabf1071707865f9c467
[]
no_license
addsonMendes/AppTastyFast
bd368a78203e9d69d83cd80c871548cf16c5aad9
5ff1149bbd2b9f8b09c64dba956f08033556360c
refs/heads/master
2020-04-09T21:33:59.068389
2018-12-06T02:22:10
2018-12-06T02:22:10
160,605,876
0
0
null
null
null
null
UTF-8
Java
false
false
2,417
java
package br.com.tastyfast.tastyfastapp; import android.content.Intent; import android.content.SharedPreferences; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; public class MenuConfiguracoesActivity extends AppCompatActivity { private Button btPerfil, btBuscaAvancada, btReservas, btSair; private EditText edtPesquisar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_menu_configuracoes); inicializaComponentes(); btPerfil.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent vaiParaTelaDePerfil = new Intent(MenuConfiguracoesActivity.this, PerfilUsuarioActivity.class); startActivity(vaiParaTelaDePerfil); } }); btReservas.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent vaiParaTelaDeHistorico = new Intent(MenuConfiguracoesActivity.this, HistoricoReservasActivity.class); startActivity(vaiParaTelaDeHistorico); } }); btSair.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { SharedPreferences preferences = getSharedPreferences("user_preferences", MODE_PRIVATE); SharedPreferences.Editor editor = preferences.edit(); editor.remove("usuarioLogado"); editor.remove("idUsuarioLogado"); editor.remove("nomeUsuario"); editor.remove("emailUsuario"); editor.commit(); Intent vaiParaTelaDeLogin = new Intent(MenuConfiguracoesActivity.this, LoginActivity.class); startActivity(vaiParaTelaDeLogin); finish(); } }); } private void inicializaComponentes(){ btPerfil = findViewById(R.id.btMenuConfPerfil); btBuscaAvancada = findViewById(R.id.btMenuConfBuscaAvanc); btReservas = findViewById(R.id.btMenuConfReservas); btSair = findViewById(R.id.btMenuConfSair); edtPesquisar = findViewById(R.id.edtMenuConfPesquisar); } }
[ "=" ]
=
55ee48fa21d6785d553c5ead52ddab9be0a4fd54
d71e879b3517cf4fccde29f7bf82cff69856cfcd
/ExtractedJars/iRobot_com.irobot.home/javafiles/android/support/v4/view/AbsSavedState.java
3d177431527433a52e2a1298c2be7399f842f521
[ "MIT" ]
permissive
Andreas237/AndroidPolicyAutomation
b8e949e072d08cf6c6166c3f15c9c63379b8f6ce
c1ed10a2c6d4cf3dfda8b8e6291dee2c2a15ee8a
refs/heads/master
2020-04-10T02:14:08.789751
2019-05-16T19:29:11
2019-05-16T19:29:11
160,739,088
5
1
null
null
null
null
UTF-8
Java
false
false
5,913
java
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.kpdus.com/jad.html // Decompiler options: packimports(3) annotate safe package android.support.v4.view; import android.os.Parcel; import android.os.Parcelable; public abstract class AbsSavedState implements Parcelable { private AbsSavedState() { // 0 0:aload_0 // 1 1:invokespecial #29 <Method void Object()> a = null; // 2 4:aload_0 // 3 5:aconst_null // 4 6:putfield #31 <Field Parcelable a> // 5 9:return } protected AbsSavedState(Parcel parcel, ClassLoader classloader) { // 0 0:aload_0 // 1 1:invokespecial #29 <Method void Object()> parcel = ((Parcel) (parcel.readParcelable(classloader))); // 2 4:aload_1 // 3 5:aload_2 // 4 6:invokevirtual #38 <Method Parcelable Parcel.readParcelable(ClassLoader)> // 5 9:astore_1 if(parcel == null) //* 6 10:aload_1 //* 7 11:ifnull 17 //* 8 14:goto 21 parcel = ((Parcel) (d)); // 9 17:getstatic #24 <Field AbsSavedState d> // 10 20:astore_1 a = ((Parcelable) (parcel)); // 11 21:aload_0 // 12 22:aload_1 // 13 23:putfield #31 <Field Parcelable a> // 14 26:return } protected AbsSavedState(Parcelable parcelable) { // 0 0:aload_0 // 1 1:invokespecial #29 <Method void Object()> if(parcelable == null) //* 2 4:aload_1 //* 3 5:ifnonnull 18 throw new IllegalArgumentException("superState must not be null"); // 4 8:new #41 <Class IllegalArgumentException> // 5 11:dup // 6 12:ldc1 #43 <String "superState must not be null"> // 7 14:invokespecial #46 <Method void IllegalArgumentException(String)> // 8 17:athrow if(parcelable == d) //* 9 18:aload_1 //* 10 19:getstatic #24 <Field AbsSavedState d> //* 11 22:if_acmpeq 28 //* 12 25:goto 30 parcelable = null; // 13 28:aconst_null // 14 29:astore_1 a = parcelable; // 15 30:aload_0 // 16 31:aload_1 // 17 32:putfield #31 <Field Parcelable a> // 18 35:return } public final Parcelable a() { return a; // 0 0:aload_0 // 1 1:getfield #31 <Field Parcelable a> // 2 4:areturn } public int describeContents() { return 0; // 0 0:iconst_0 // 1 1:ireturn } public void writeToParcel(Parcel parcel, int i) { parcel.writeParcelable(a, i); // 0 0:aload_1 // 1 1:aload_0 // 2 2:getfield #31 <Field Parcelable a> // 3 5:iload_2 // 4 6:invokevirtual #57 <Method void Parcel.writeParcelable(Parcelable, int)> // 5 9:return } public static final android.os.Parcelable.Creator CREATOR = new android.os.Parcelable.ClassLoaderCreator() { public AbsSavedState a(Parcel parcel) { return a(parcel, ((ClassLoader) (null))); // 0 0:aload_0 // 1 1:aload_1 // 2 2:aconst_null // 3 3:invokevirtual #19 <Method AbsSavedState a(Parcel, ClassLoader)> // 4 6:areturn } public AbsSavedState a(Parcel parcel, ClassLoader classloader) { if(parcel.readParcelable(classloader) != null) //* 0 0:aload_1 //* 1 1:aload_2 //* 2 2:invokevirtual #25 <Method Parcelable Parcel.readParcelable(ClassLoader)> //* 3 5:ifnull 18 throw new IllegalStateException("superState must be null"); // 4 8:new #27 <Class IllegalStateException> // 5 11:dup // 6 12:ldc1 #29 <String "superState must be null"> // 7 14:invokespecial #32 <Method void IllegalStateException(String)> // 8 17:athrow else return AbsSavedState.d; // 9 18:getstatic #36 <Field AbsSavedState AbsSavedState.d> // 10 21:areturn } public AbsSavedState[] a(int i) { return new AbsSavedState[i]; // 0 0:iload_1 // 1 1:anewarray AbsSavedState[] // 2 4:areturn } public Object createFromParcel(Parcel parcel) { return ((Object) (a(parcel))); // 0 0:aload_0 // 1 1:aload_1 // 2 2:invokevirtual #41 <Method AbsSavedState a(Parcel)> // 3 5:areturn } public Object createFromParcel(Parcel parcel, ClassLoader classloader) { return ((Object) (a(parcel, classloader))); // 0 0:aload_0 // 1 1:aload_1 // 2 2:aload_2 // 3 3:invokevirtual #19 <Method AbsSavedState a(Parcel, ClassLoader)> // 4 6:areturn } public Object[] newArray(int i) { return ((Object []) (a(i))); // 0 0:aload_0 // 1 1:iload_1 // 2 2:invokevirtual #46 <Method AbsSavedState[] a(int)> // 3 5:areturn } } ; public static final AbsSavedState d = new AbsSavedState() { } ; private final Parcelable a; static { // 0 0:new #8 <Class AbsSavedState$1> // 1 3:dup // 2 4:invokespecial #22 <Method void AbsSavedState$1()> // 3 7:putstatic #24 <Field AbsSavedState d> // 4 10:new #10 <Class AbsSavedState$2> // 5 13:dup // 6 14:invokespecial #25 <Method void AbsSavedState$2()> // 7 17:putstatic #27 <Field android.os.Parcelable$Creator CREATOR> //* 8 20:return } }
48d893929a012868b760c3ab6f6168d99b792585
5e5874e2ed9f99b4cf9711f854fe8cfffde52973
/src/main/java/com/reagan/wxpt/pojo/business/BusinessGoods.java
ce1b31971762e3ff5567468a42b1f40cd38828d1
[]
no_license
reaganjava/wxpt
2bbb16ac601556158bcf13c3330640de934e6148
8411c023409cb2820da78fb201a4aa31fdb6f630
refs/heads/master
2016-09-06T01:34:02.308075
2014-05-10T14:38:47
2014-05-10T14:38:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,129
java
package com.reagan.wxpt.pojo.business; // Generated 2014-3-14 10:25:00 by Hibernate Tools 3.4.0.CR1 import java.math.BigDecimal; /** * BusinessGoods generated by hbm2java */ public class BusinessGoods implements java.io.Serializable { private static final long serialVersionUID = -8232662800623624371L; private Integer goid; private Integer companyId; private Integer shopId; private int shid; private String name; private BigDecimal price; private String description; private int quantity; private int payQuantity; private int evaluate; private int payType; private int status; public Integer getGoid() { return this.goid; } public void setGoid(Integer goid) { this.goid = goid; } public int getShid() { return this.shid; } public void setShid(int shid) { this.shid = shid; } public String getName() { return this.name; } public void setName(String name) { this.name = name; } public BigDecimal getPrice() { return this.price; } public void setPrice(BigDecimal price) { this.price = price; } public String getDescription() { return this.description; } public void setDescription(String description) { this.description = description; } public int getQuantity() { return this.quantity; } public void setQuantity(int quantity) { this.quantity = quantity; } public int getPayQuantity() { return this.payQuantity; } public void setPayQuantity(int payQuantity) { this.payQuantity = payQuantity; } public int getEvaluate() { return this.evaluate; } public void setEvaluate(int evaluate) { this.evaluate = evaluate; } public int getPayType() { return this.payType; } public void setPayType(int payType) { this.payType = payType; } public int getStatus() { return status; } public void setStatus(int status) { this.status = status; } public Integer getCompanyId() { return companyId; } public void setCompanyId(Integer companyId) { this.companyId = companyId; } public Integer getShopId() { return shopId; } public void setShopId(Integer shopId) { this.shopId = shopId; } }
4e9902a186916f0127ec7bc706810bf0c20f9acc
7596b13ad3a84feb67f05aeda486e8b9fc93f65f
/getAndroidAPI/src/java/security/interfaces/DSAKey.java
c79bcde863dd0afbd2ae640b04657df7a7d27425
[]
no_license
WinterPan2017/Android-Malware-Detection
7aeacfa03ca1431e7f3ba3ec8902cfe2498fd3de
ff38c91dc6985112e958291867d87bfb41c32a0f
refs/heads/main
2023-02-08T00:02:28.775711
2020-12-20T06:58:01
2020-12-20T06:58:01
303,900,592
1
0
null
null
null
null
UTF-8
Java
false
false
378
java
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.kpdus.com/jad.html // Decompiler options: packimports(3) // Source File Name: DSAKey.java package java.security.interfaces; // Referenced classes of package java.security.interfaces: // DSAParams public interface DSAKey { public abstract DSAParams getParams(); }
17b6f306ae8d4ce9efd104f802cf759ceedcd98d
3c08a7d87b64dc12e35feeb5fb4fab566f50460a
/src/main/java/wely/github/jhipster/sampleapp/repository/PersistenceAuditEventRepository.java
753609e9c7ad63e9cf23a99c5927f9f663157b03
[]
no_license
BulkSecurityGeneratorProject/myJhipsterSampleApp
620da93f370d293268e476eeee3d08c7b948fcb5
a294b43339f3b08dc165da097e078072ee7781ab
refs/heads/master
2022-12-15T11:26:33.311659
2018-03-09T06:56:08
2018-03-09T06:56:08
296,641,060
0
0
null
2020-09-18T14:15:54
2020-09-18T14:15:53
null
UTF-8
Java
false
false
1,000
java
package wely.github.jhipster.sampleapp.repository; import wely.github.jhipster.sampleapp.domain.PersistentAuditEvent; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; import java.time.Instant; import java.util.List; /** * Spring Data JPA repository for the PersistentAuditEvent entity. */ public interface PersistenceAuditEventRepository extends JpaRepository<PersistentAuditEvent, Long> { List<PersistentAuditEvent> findByPrincipal(String principal); List<PersistentAuditEvent> findByAuditEventDateAfter(Instant after); List<PersistentAuditEvent> findByPrincipalAndAuditEventDateAfter(String principal, Instant after); List<PersistentAuditEvent> findByPrincipalAndAuditEventDateAfterAndAuditEventType(String principle, Instant after, String type); Page<PersistentAuditEvent> findAllByAuditEventDateBetween(Instant fromDate, Instant toDate, Pageable pageable); }