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
61e757a24bac062f5987c028a1905b48d9840c28
8689e36b9e8e91ee27eaac721627a39df37e5c24
/spring-test/src/main/java/org/springframework/test/web/servlet/setup/SharedHttpSessionConfigurer.java
d747e4dd6544ba029a0fa7e2018d3792af7b62e6
[]
no_license
liuqupingshanyao/spring-code
87e459c7e50b19f55e6814c8fb750da002027b63
bc8d794be7a5957b7a6b415762e0d4898ca4f30f
refs/heads/master
2020-07-03T01:28:12.054671
2019-08-11T11:35:59
2019-08-11T11:35:59
201,741,442
63
6
null
null
null
null
UTF-8
Java
false
false
2,123
java
/* * Copyright 2002-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.test.web.servlet.setup; import javax.servlet.http.HttpSession; import org.springframework.lang.Nullable; import org.springframework.test.web.servlet.request.RequestPostProcessor; import org.springframework.web.context.WebApplicationContext; /** * {@link MockMvcConfigurer} that stores and re-uses the HTTP session across * multiple requests performed through the same {@code MockMvc} instance. * * <p>Example use: * <pre class="code"> * imports static org.springframework.test.web.servlet.setup.SharedHttpSessionConfigurer.sharedHttpSession; * * // ... * * MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new TestController()) * .apply(sharedHttpSession()) * .build(); * * // Use mockMvc to perform requests ... * </pre> * * @author Rossen Stoyanchev * @since 5.0 */ public class SharedHttpSessionConfigurer implements MockMvcConfigurer { @Nullable private HttpSession session; @Override public void afterConfigurerAdded(ConfigurableMockMvcBuilder<?> builder) { builder.alwaysDo(result -> this.session = result.getRequest().getSession(false)); } @Override public RequestPostProcessor beforeMockMvcCreated(ConfigurableMockMvcBuilder<?> builder, WebApplicationContext context) { return request -> { if (this.session != null) { request.setSession(this.session); } return request; }; } public static SharedHttpSessionConfigurer sharedHttpSession() { return new SharedHttpSessionConfigurer(); } }
[ "52489568+liuqupingshanyao@users.noreply.github.com" ]
52489568+liuqupingshanyao@users.noreply.github.com
741e3693dee52379aa9a7e972501e137a51a48d4
be129fc37be31166da78660614fd6e3eba3edd56
/ms_web/Publish-app/publish-modules/src.bak/publish/controller/ChannelController.java
6f779ef61b2329793ec21f1d6505688127407ca5
[]
no_license
cckwzmc/myLearning
f82248cebdb23870b09ac6573ce2048b152eb1b2
977b6d6562fef0eb3967c338192eb0687520cf4c
refs/heads/master
2021-01-18T07:58:25.583071
2014-01-26T15:04:34
2014-01-26T15:04:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,004
java
package com.toney.publish.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import com.toney.dal.dao.sys.biz.SysChannelManager; import com.toney.publish.annotation.AuthRequired; import com.toney.publish.contants.AuthLevel; @Controller @AuthRequired(AuthLevel.STRICT) @RequestMapping("/sys/channel") public class ChannelController { @Autowired private SysChannelManager sysChannelManager; @RequestMapping(value="list",method=RequestMethod.GET) public String list(){ return "sys/channelmgr/list"; } @RequestMapping(value="create",method=RequestMethod.GET) public String create(){ return "sys/channelmgr/create"; } @RequestMapping(value="doCreate",method=RequestMethod.GET) public String doCreate(){ return "sys/channelmgr/list"; } }
[ "lyxmq.ljh@9c0ba882-c8bc-11dd-9042-6d746b85d38b" ]
lyxmq.ljh@9c0ba882-c8bc-11dd-9042-6d746b85d38b
83474f18fa200b6adaf8756ea176119841425276
5598faaaaa6b3d1d8502cbdaca903f9037d99600
/code_changes/Apache_projects/ZOOKEEPER-2383/eac693cc76a34f96b9116ef33d1e92af7129416d/StatResetCommand.java
c7d5ad795b5370f0538ce64db6a0e81b88b27c3b
[]
no_license
SPEAR-SE/LogInBugReportsEmpirical_Data
94d1178346b4624ebe90cf515702fac86f8e2672
ab9603c66899b48b0b86bdf63ae7f7a604212b29
refs/heads/master
2022-12-18T02:07:18.084659
2020-09-09T16:49:34
2020-09-09T16:49:34
286,338,252
0
2
null
null
null
null
UTF-8
Java
false
false
1,350
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.zookeeper.server.command; import java.io.PrintWriter; import org.apache.zookeeper.server.ServerCnxn; public class StatResetCommand extends AbstractFourLetterCommand { public StatResetCommand(PrintWriter pw, ServerCnxn serverCnxn) { super(pw, serverCnxn); } @Override public void commandRun() { if (isZKServerRunning()) { pw.println(ZK_NOT_SERVING); } else { zkServer.serverStats().reset(); pw.println("Server stats reset."); } } }
[ "archen94@gmail.com" ]
archen94@gmail.com
3683d91a9f4ea3902190a81eca1d855bb61929cf
614a23b8a5d945300772039c7006aaa119e70ffe
/ejb-project/src/main/java/tn/esprit/translator/TranslatorServiceRemote.java
1d6d77505e5f25912b038e0c1374397a49d2b33e
[]
no_license
medalibettaieb/ejb-demo
17621b9cc22bf2043b443f0c3fb58baa17bf0041
16b4eeeec2119747f8a30f7dc15fb912f879e680
refs/heads/master
2020-05-17T02:36:06.169817
2015-01-26T19:19:05
2015-01-26T19:19:05
29,876,805
0
0
null
null
null
null
UTF-8
Java
false
false
144
java
package tn.esprit.translator; import javax.ejb.Remote; @Remote public interface TranslatorServiceRemote { String translate(String french); }
[ "medali.bettaieb@esprit.tn" ]
medali.bettaieb@esprit.tn
5bcd462d84ce87a3766f30d6e7ed8aefc2d148f0
92f6227f08e19bd2e1bf79738bf906b9ed134091
/chapter_001/src/main/java/ru/job4j/printntom/PrintNToM.java
ef8bef2f0aeb252872fac3327130072efb29a125
[ "Apache-2.0" ]
permissive
kirillkrohmal/krohmal
b8af0e81b46081f53c8ff857609bb99785165f3f
12a8ce50caf76cf2c3b54a7fbaa2813fd3550a78
refs/heads/master
2023-06-23T17:27:56.513004
2023-06-13T07:05:56
2023-06-13T07:05:56
91,477,464
0
0
Apache-2.0
2023-02-22T08:20:14
2017-05-16T15:58:50
Java
UTF-8
Java
false
false
189
java
package ru.job4j.printntom; public class PrintNToM { public static void out(int n, int m) { for (int i = n; i < m; i++) { System.out.println(i); } } }
[ "krohmal_kirill@mail.ru" ]
krohmal_kirill@mail.ru
1f15565a1b1dcf02674ce7286b9963e2f54d1c3a
f1b1ec9ee6f212c01b69e9a5bf3b8abf62e234a7
/src/org/archiviststoolkit/importer/MARCXML/.svn/text-base/Handle544Action.java.svn-base
a92b35f44382323262a19a94eba8bf56e56baf21
[]
no_license
RockefellerArchiveCenter/ATReference
c79acc0f557f7af57c36ca5471e23fc924b9c04c
f7fcad9e8bacc704f0a4a1ed2129228df16b40b1
refs/heads/master
2021-01-15T15:46:04.176193
2016-12-03T16:39:31
2016-12-03T16:39:31
855,223
5
4
null
null
null
null
UTF-8
Java
false
false
1,518
package org.archiviststoolkit.importer.MARCXML; import java.util.List; import java.util.Vector; import org.archiviststoolkit.model.ArchDescriptionNotes; import org.archiviststoolkit.model.Resources; import org.archiviststoolkit.model.UnsupportedRepeatingDataTypeException; import org.archiviststoolkit.structure.MARCXML.DataFieldType; import org.archiviststoolkit.structure.NotesEtcTypes; import org.archiviststoolkit.util.NoteEtcTypesUtils; import org.archiviststoolkit.swing.InfiniteProgressPanel; public class Handle544Action implements MARCXMLAction { public void processElement(Resources resource, Object o, InfiniteProgressPanel progressPanel) throws UnsupportedRepeatingDataTypeException { DataFieldType dataField = (DataFieldType) o; String titles[] = {"3","t","a","b","c","e","n"}; Vector <String> titlesV; titlesV = MARCIngest.arrayToVector(titles); String noteTitle = "Related Archival Materials"; NotesEtcTypes noteType = NoteEtcTypesUtils.lookupNoteEtcTypeByCannonicalName("Related Archival Materials note"); String title = MARCIngest.getSpecificSubCodeValuesAsDelimitedString(dataField,titlesV,","); ArchDescriptionNotes adn = new ArchDescriptionNotes(resource,noteTitle,NotesEtcTypes.DATA_TYPE_NOTE,resource.getRepeatingData().size()+1,noteType,title); adn.setPersistentId(resource.getNextPersistentIdAndIncrement()); resource.addRepeatingData(adn); } public List getChildren(Object element) { return null; } }
[ "lee@boswyckfarms.org" ]
lee@boswyckfarms.org
12055c1c991143529dbc1feb5c80b8226080f62f
5734d92d0a18852ace26ee540e7c205b81e86e02
/WTServer/Wutong/src/main/java/com/borqs/server/wutong/category/CategoryLogic.java
5413e323c2fd420d71423ae34a2825bb84856477
[]
no_license
FreeDao/wutongservice
16c5f833763d3cbb9a4ee20d6d7593c5faafeec2
81d66d3cc06d362a355582d38d691f341db565da
refs/heads/master
2020-12-30T22:09:26.037600
2013-09-24T08:52:00
2013-09-24T08:52:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
828
java
package com.borqs.server.wutong.category; import com.borqs.server.base.context.Context; import com.borqs.server.base.data.Record; import com.borqs.server.base.data.RecordSet; public interface CategoryLogic { RecordSet createCategoryType(Context ctx, RecordSet categories); Record createCategory(Context ctx, String userId,String categoryId,String targetType,String targetId); Record updateCategoryType(Context ctx, Record category); Record updateCategory(Context ctx, Record category); boolean destroyedCategories(Context ctx, Record category); RecordSet getCategories(Context ctx, String category_id,long startTime,long endTime,int page,int count); RecordSet getCategoryTypes(Context ctx, String scope); Record getCategoryType(Context ctx, String category_id); }
[ "liuhuadong78@gmail.com" ]
liuhuadong78@gmail.com
ffd9ad08e58414315b9d8c1cf519064745ee0538
13c2d3db2d49c40c74c2e6420a9cd89377f1c934
/program_data/JavaProgramData/91/833.java
188bc2bd047c09e013553b51da2c3d10ecf99ce5
[ "MIT" ]
permissive
qiuchili/ggnn_graph_classification
c2090fefe11f8bf650e734442eb96996a54dc112
291ff02404555511b94a4f477c6974ebd62dcf44
refs/heads/master
2021-10-18T14:54:26.154367
2018-10-21T23:34:14
2018-10-21T23:34:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
467
java
package <missing>; public class GlobalMembers { public static int Main() { String a = new String(new char[102]); String b = new String(new char[102]); a = new Scanner(System.in).nextLine(); int i = 0; for (;i < a.length();i++) { b = tangible.StringFunctions.changeCharacter(b, i, a.charAt(i) + a.charAt((i + 1) % a.length())); } b = tangible.StringFunctions.changeCharacter(b, i, '\0'); System.out.printf("%s",b); return 0; } }
[ "y.yu@open.ac.uk" ]
y.yu@open.ac.uk
f123a0cef4353be54a7d6e0230714a5fc871373a
b74aab5a21a9f0a81ee0c55ee9a7bf37d1e68ecc
/rocketmq-store/src/test/java/com/alibaba/rocketmq/store/RecoverTest.java
90bb0c3e19b1b1381588c20cb467cce4db071a1e
[ "Apache-2.0" ]
permissive
jinfei21/RocketMQ
71544d0e55d53268ed15cf97970c953b9a66072b
bd0d2008cd6b227964d42c893559acabe409aa6e
refs/heads/master
2020-04-08T05:15:47.706706
2016-06-01T06:17:02
2016-06-01T06:17:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,268
java
/** * $Id: RecoverTest.java 1831 2013-05-16 01:39:51Z shijia.wxr $ */ package com.alibaba.rocketmq.store; import com.alibaba.rocketmq.common.config.Config; import com.alibaba.rocketmq.common.message.MessageDecoder; import com.alibaba.rocketmq.common.message.MessageExt; import com.alibaba.rocketmq.store.config.MessageStoreConfig; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.SocketAddress; import java.nio.ByteBuffer; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; import static org.junit.Assert.assertTrue; public class RecoverTest { private static final String StoreMessage = "Once, there was a chance for me!aaaaaaaaaaaaaaaaaaaaaaaa"; // 队列个数 private static int QUEUE_TOTAL = 10; // 发往哪个队列 private static AtomicInteger QueueId = new AtomicInteger(0); // 发送主机地址 private static SocketAddress BornHost; // 存储主机地址 private static SocketAddress StoreHost; // 消息体 private static byte[] MessageBody; private MessageStore storeWrite1; private MessageStore storeWrite2; private MessageStore storeRead; @BeforeClass public static void setUpBeforeClass() throws Exception { StoreHost = new InetSocketAddress(InetAddress.getLocalHost(), 8123); BornHost = new InetSocketAddress(InetAddress.getByName("127.0.0.1"), 0); } @AfterClass public static void tearDownAfterClass() throws Exception { } public MessageExtBrokerInner buildMessage() { MessageExtBrokerInner msg = new MessageExtBrokerInner(); msg.setTopic("TOPIC_A"); msg.setTags("TAG1"); msg.setKeys("Hello"); msg.setBody(MessageBody); msg.setKeys(String.valueOf(System.currentTimeMillis())); msg.setQueueId(Math.abs(QueueId.getAndIncrement()) % QUEUE_TOTAL); msg.setSysFlag(4); msg.setBornTimestamp(System.currentTimeMillis()); msg.setStoreHost(StoreHost); msg.setBornHost(BornHost); return msg; } private void destroy() { if (storeWrite1 != null) { // 关闭存储服务 storeWrite1.shutdown(); // 删除文件 storeWrite1.destroy(); } if (storeWrite2 != null) { // 关闭存储服务 storeWrite2.shutdown(); // 删除文件 storeWrite2.destroy(); } if (storeRead != null) { // 关闭存储服务 storeRead.shutdown(); // 删除文件 storeRead.destroy(); } } public void writeMessage(boolean normal, boolean first) throws Exception { System.out.println("================================================================"); long totalMsgs = 1000; QUEUE_TOTAL = 3; // 构造消息体 MessageBody = StoreMessage.getBytes(); MessageStoreConfig messageStoreConfig = new MessageStoreConfig(); // 每个物理映射文件 messageStoreConfig.setMapedFileSizeCommitLog(1024 * 32); // 每个逻辑映射文件 messageStoreConfig.setMapedFileSizeConsumeQueue(100 * 20); messageStoreConfig.setMessageIndexEnable(false); MessageStore messageStore = new DefaultMessageStore(messageStoreConfig, null, new Config()); if (first) { this.storeWrite1 = messageStore; } else { this.storeWrite2 = messageStore; } // 第一步,load已有数据 boolean loadResult = messageStore.load(); assertTrue(loadResult); // 第二步,启动服务 messageStore.start(); // 第三步,发消息 for (long i = 0; i < totalMsgs; i++) { PutMessageResult result = messageStore.putMessage(buildMessage()); System.out.println(i + "\t" + result.getAppendMessageResult().getMsgId()); } if (normal) { // 关闭存储服务 messageStore.shutdown(); } System.out.println("========================writeMessage OK========================================"); } private void veryReadMessage(int queueId, long queueOffset, List<ByteBuffer> byteBuffers) { for (ByteBuffer byteBuffer : byteBuffers) { MessageExt msg = MessageDecoder.decode(byteBuffer); System.out.println("request queueId " + queueId + ", request queueOffset " + queueOffset + " msg queue offset " + msg.getQueueOffset()); assertTrue(msg.getQueueOffset() == queueOffset); queueOffset++; } } public void readMessage(final long msgCnt) throws Exception { System.out.println("================================================================"); QUEUE_TOTAL = 3; // 构造消息体 MessageBody = StoreMessage.getBytes(); MessageStoreConfig messageStoreConfig = new MessageStoreConfig(); // 每个物理映射文件 messageStoreConfig.setMapedFileSizeCommitLog(1024 * 32); // 每个逻辑映射文件 messageStoreConfig.setMapedFileSizeConsumeQueue(100 * 20); messageStoreConfig.setMessageIndexEnable(false); storeRead = new DefaultMessageStore(messageStoreConfig, null, new Config()); // 第一步,load已有数据 boolean loadResult = storeRead.load(); assertTrue(loadResult); // 第二步,启动服务 storeRead.start(); // 第三步,收消息 long readCnt = 0; for (int queueId = 0; queueId < QUEUE_TOTAL; queueId++) { for (long offset = 0; ; ) { GetMessageResult result = storeRead.getMessage("GROUP_A", "TOPIC_A", queueId, offset, 1024 * 1024, null); if (result.getStatus() == GetMessageStatus.FOUND) { System.out.println(queueId + "\t" + result.getMessageCount()); this.veryReadMessage(queueId, offset, result.getMessageBufferList()); offset += result.getMessageCount(); readCnt += result.getMessageCount(); result.release(); } else { break; } } } System.out.println("readCnt = " + readCnt); assertTrue(readCnt == msgCnt); System.out.println("========================readMessage OK========================================"); } /** * 正常关闭后,重启恢复消息,验证是否有消息丢失 */ @Test public void test_recover_normally() throws Exception { this.writeMessage(true, true); Thread.sleep(1000 * 3); this.readMessage(1000); this.destroy(); } /** * 正常关闭后,重启恢复消息,并再次写入消息,验证是否有消息丢失 */ @Test public void test_recover_normally_write() throws Exception { this.writeMessage(true, true); Thread.sleep(1000 * 3); this.writeMessage(true, false); Thread.sleep(1000 * 3); this.readMessage(2000); this.destroy(); } /** * 异常关闭后,重启恢复消息,验证是否有消息丢失 */ @Test public void test_recover_abnormally() throws Exception { this.writeMessage(false, true); Thread.sleep(1000 * 3); this.readMessage(1000); this.destroy(); } /** * 异常关闭后,重启恢复消息,并再次写入消息,验证是否有消息丢失 */ @Test public void test_recover_abnormally_write() throws Exception { this.writeMessage(false, true); Thread.sleep(1000 * 3); this.writeMessage(false, false); Thread.sleep(1000 * 3); this.readMessage(2000); this.destroy(); } }
[ "diwayou@qq.com" ]
diwayou@qq.com
67261e4b310174176016ad02525ac7900b6666d3
ece153c7951245fd47b1e7e12c33896f557e68db
/crawler-manage-web/src/main/java/com/crawlermanage/controller/modules/AjaxSinaweiboController.java
b3a940021e9f9a253b5c0fce8655798949fe189c
[]
no_license
zhonghuayichen/crawler
05ed2a66adb1ea13ea7b43ca44ab5345c52c45ab
056f388477afa63bed5cf16e45e0ac0e95681d7d
refs/heads/master
2021-01-13T04:59:39.367625
2017-02-07T08:25:25
2017-02-07T08:25:25
81,163,841
0
0
null
2017-02-07T03:49:51
2017-02-07T03:49:51
null
UTF-8
Java
false
false
1,966
java
package com.crawlermanage.controller.modules; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import com.crawler.domain.json.Result; import com.crawler.weibo.domain.json.UserFeedJson; import com.crawlermanage.service.weibo.WeiboUserSearchService; import com.google.gson.Gson; @Controller @RequestMapping("/modules/sinaweibo") public class AjaxSinaweiboController { private static final Logger log = LoggerFactory.getLogger(AjaxSinaweiboController.class); @Autowired private WeiboUserSearchService weiboUserSearchService; //搜索人物 @RequestMapping(value="/getSearchResults",method=RequestMethod.GET) public @ResponseBody List<UserFeedJson> getSearchResults(@RequestParam("person") String person){ List<UserFeedJson> userFeedJsonList=null; try { log.info("新浪微博person:{}",URLDecoder.decode(person,"utf-8")); String personURL= "http://s.weibo.com/user/"+person; log.info("新浪微博personURL:{}",personURL); Result<List<UserFeedJson>> result = weiboUserSearchService.searchUser(personURL,false,""); userFeedJsonList=result.getData(); Gson gson = new Gson(); String usersJson = gson.toJson(userFeedJsonList); log.info("新浪微博搜索结果:{}", usersJson); } catch (UnsupportedEncodingException e) { // TODO Auto-generated catch block e.printStackTrace(); } return userFeedJsonList; } }
[ "gengjie@upbase.com.cn" ]
gengjie@upbase.com.cn
65b28dc74d7c478a05113b4023d28c3f0c2d3101
447520f40e82a060368a0802a391697bc00be96f
/apks/playstore_apps/com_ubercab/source/retrofit2/http/QueryMap.java
a22b88d891a3ea9e83f931592dce40ecbfc3e055
[ "GPL-1.0-or-later", "Apache-2.0" ]
permissive
iantal/AndroidPermissions
7f3343a9c29d82dbcd4ecd98b3a50ddf8d179465
d623b732734243590b5f004d167e542e2e2ae249
refs/heads/master
2023-07-19T01:29:26.689186
2019-09-30T19:01:42
2019-09-30T19:01:42
107,239,248
0
0
Apache-2.0
2023-07-16T07:41:38
2017-10-17T08:22:57
null
UTF-8
Java
false
false
394
java
package retrofit2.http; import java.lang.annotation.Annotation; import java.lang.annotation.Documented; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Documented @Retention(RetentionPolicy.RUNTIME) @Target({java.lang.annotation.ElementType.PARAMETER}) public @interface QueryMap { boolean encoded() default false; }
[ "antal.micky@yahoo.com" ]
antal.micky@yahoo.com
080dc853adcab3d260dab4fc482c188e8bfbf967
69072dc8587d053542783dcf594118a07ae97f4a
/ancun-boss/src/main/java/com/ancun/boss/pojo/callInfo/CallInRecordInput.java
cd2c12b742e7993625387996f5fe0341e1e00b3d
[]
no_license
hejunling/boss-dts
f5dac435796b95ada7e965b60b586eb9a45f14b9
fa4f6caef355805938412e503d15f1f10cda4efd
refs/heads/master
2022-12-20T12:35:41.683426
2019-05-23T12:21:15
2019-05-23T12:21:15
94,403,799
1
2
null
2022-12-16T03:42:19
2017-06-15T05:40:09
Java
UTF-8
Java
false
false
4,606
java
package com.ancun.boss.pojo.callInfo; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import com.ancun.boss.pojo.BossPagePojo; /** * 呼入登记信息请求封装POJO类 * @author cys * */ @XmlAccessorType(value=XmlAccessType.PROPERTY) @XmlRootElement(name="content") public class CallInRecordInput extends BossPagePojo{ /** * 编号id */ private Long id; /** * 客服工号 */ private String userno; /** * 客服姓名 */ private String username; /** * 来电时间开始时间(日期+时间) */ private String calltimestart; /** * 来电时间结束时间(日期+时间) */ private String calltimeend; /** * 来电时间(日期+时间) */ private String callTime; /** * 来电号码 */ private String callphone; /** * 性别 */ private String sex; /** * 称呼 */ private String name; /** * 来电时长 */ private String duration; /** * 业务(项目名称) */ private String business; /** * 问题 */ private String question; /** * 备注 */ private String remark; /** * 是否回拨 */ private String callback; /** * 回访情况 */ private String visitsituation; /** * 新增修改标志(1:新增;2:修改) */ private String modifyflag; /** * 呼入类型(1:呼入登记,2:投诉退订) */ private String callType; /** * 质检状态(1:未质检,2:已质检) */ private String checkStatus; /** * 投诉退订ID */ private Long cancelId; /** * 质检ID */ private Long checkId; public String getModifyflag() { return modifyflag; } public void setModifyflag(String modifyflag) { this.modifyflag = modifyflag; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getUserno() { return userno; } public void setUserno(String userno) { this.userno = userno; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getCallphone() { return callphone; } public void setCallphone(String callphone) { this.callphone = callphone; } public String getSex() { return sex; } public void setSex(String sex) { this.sex = sex; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDuration() { return duration; } public void setDuration(String duration) { this.duration = duration; } public String getBusiness() { return business; } public void setBusiness(String business) { this.business = business; } public String getQuestion() { return question; } public void setQuestion(String question) { this.question = question; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } public String getCallback() { return callback; } public void setCallback(String callback) { this.callback = callback; } public String getVisitsituation() { return visitsituation; } public void setVisitsituation(String visitsituation) { this.visitsituation = visitsituation; } public String getCalltimestart() { return calltimestart; } public void setCalltimestart(String calltimestart) { this.calltimestart = calltimestart; } public String getCalltimeend() { return calltimeend; } public void setCalltimeend(String calltimeend) { this.calltimeend = calltimeend; } public String getCallTime() { return callTime; } public void setCallTime(String callTime) { this.callTime = callTime; } public String getCallType() { return callType; } public void setCallType(String callType) { this.callType = callType; } public String getCheckStatus() { return checkStatus; } public void setCheckStatus(String checkStatus) { this.checkStatus = checkStatus; } public Long getCancelId() { return cancelId; } public void setCancelId(Long cancelId) { this.cancelId = cancelId; } public Long getCheckId() { return checkId; } public void setCheckId(Long checkId) { this.checkId = checkId; } }
[ "hechuan@ancun.com" ]
hechuan@ancun.com
ec2057f7b8ee1509d478d4eadf1583ee63d7595b
73b9f35b96af8c5b17526484c867e524f94dd1ec
/src/main/java/com/fuguo/concurrent/WaitMethodTest.java
7ee84553a9357e2477f6a53fd995b4839caf64b2
[]
no_license
wangfuguo/spring-boot-demo
73b9b1738bf874c2e09807a4f24c5181f4dc8d05
8111a8c8c9f6c0abdcc6767f31c17966a9c68464
refs/heads/master
2021-05-03T09:03:58.207198
2018-04-09T01:48:49
2018-04-09T01:48:49
120,569,610
1
0
null
null
null
null
UTF-8
Java
false
false
774
java
package com.fuguo.concurrent; /** * @author 00938658-王富国 * @description: TODO * @date 2018-03-19 15:15 * @since V1.0.0 */ public class WaitMethodTest { public static void main(String[] args){ Object object = new Object(); new Thread(new MyThread(object)).start(); System.out.println("main is over."); } } class MyThread implements Runnable { private Object object = null; public MyThread(Object object) { this.object = object; } @Override public void run() { try { synchronized (object) { object.wait(2000); } } catch (InterruptedException e) { e.printStackTrace(); } System.out.println("wait end..."); } }
[ "wangfuguo_wfg@163.com" ]
wangfuguo_wfg@163.com
59c1e9af5efddaf9856db621e29654d41dc9bace
385708bc194c2372dfe981baf7fb065fbce97c81
/gulimall-coupon/src/main/java/com/atguigu/gulimall/coupon/entity/CouponEntity.java
177aa2bc549ba8207a52de72fbc028517f1e8463
[ "Apache-2.0" ]
permissive
clown14/gulimall
07c2b6060127d93ec63b4e766171070334275fd9
29dfc52d136a0a756faa2c3d944235880e734a8d
refs/heads/main
2023-02-25T14:02:51.045603
2021-02-08T07:27:24
2021-02-08T07:27:24
310,208,507
0
0
null
null
null
null
UTF-8
Java
false
false
1,799
java
package com.atguigu.gulimall.coupon.entity; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import java.math.BigDecimal; import java.io.Serializable; import java.util.Date; import lombok.Data; /** * 优惠券信息 * * @author clown * @email 785613198@qq.com * @date 2020-11-07 14:26:44 */ @Data @TableName("sms_coupon") public class CouponEntity implements Serializable { private static final long serialVersionUID = 1L; /** * id */ @TableId private Long id; /** * 优惠卷类型[0->全场赠券;1->会员赠券;2->购物赠券;3->注册赠券] */ private Integer couponType; /** * 优惠券图片 */ private String couponImg; /** * 优惠卷名字 */ private String couponName; /** * 数量 */ private Integer num; /** * 金额 */ private BigDecimal amount; /** * 每人限领张数 */ private Integer perLimit; /** * 使用门槛 */ private BigDecimal minPoint; /** * 开始时间 */ private Date startTime; /** * 结束时间 */ private Date endTime; /** * 使用类型[0->全场通用;1->指定分类;2->指定商品] */ private Integer useType; /** * 备注 */ private String note; /** * 发行数量 */ private Integer publishCount; /** * 已使用数量 */ private Integer useCount; /** * 领取数量 */ private Integer receiveCount; /** * 可以领取的开始日期 */ private Date enableStartTime; /** * 可以领取的结束日期 */ private Date enableEndTime; /** * 优惠码 */ private String code; /** * 可以领取的会员等级[0->不限等级,其他-对应等级] */ private Integer memberLevel; /** * 发布状态[0-未发布,1-已发布] */ private Integer publish; }
[ "785613198@qq.com" ]
785613198@qq.com
0607df6fb2ec5a51b35cf75f3f5661cc626905dd
53d677a55e4ece8883526738f1c9d00fa6560ff7
/com/tencent/mm/ui/base/HorizontalListView$1.java
19f4da60021d09a1234108c471b2ef813bec2058
[]
no_license
0jinxing/wechat-apk-source
544c2d79bfc10261eb36389c1edfdf553d8f312a
f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d
refs/heads/master
2020-06-07T20:06:03.580028
2019-06-21T09:17:26
2019-06-21T09:17:26
193,069,132
9
4
null
null
null
null
UTF-8
Java
false
false
963
java
package com.tencent.mm.ui.base; import android.database.DataSetObserver; import com.tencent.matrix.trace.core.AppMethodBeat; final class HorizontalListView$1 extends DataSetObserver { HorizontalListView$1(HorizontalListView paramHorizontalListView) { } public final void onChanged() { AppMethodBeat.i(106309); synchronized (this.ysO) { HorizontalListView.a(this.ysO); this.ysO.invalidate(); this.ysO.requestLayout(); AppMethodBeat.o(106309); return; } } public final void onInvalidated() { AppMethodBeat.i(106310); HorizontalListView.b(this.ysO); this.ysO.invalidate(); this.ysO.requestLayout(); AppMethodBeat.o(106310); } } /* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes3-dex2jar.jar * Qualified Name: com.tencent.mm.ui.base.HorizontalListView.1 * JD-Core Version: 0.6.2 */
[ "172601673@qq.com" ]
172601673@qq.com
66158c51fca92b0e8890ba26a0270fdcafa70cda
3d319a5f01a5ccddb9d746ebf38331ec015a7ebb
/src/snake/GameUtils.java
3cba2a19e955529557240727970e55fedd7c339b
[]
no_license
mateusborja/snake
7d9ae3cc718596be68dd968cfeb8e7a3e4ab42ef
220b14669814e337f8a172ce894e03fe549c4b1e
refs/heads/master
2022-12-20T11:23:34.790497
2020-10-05T20:13:08
2020-10-05T20:13:08
297,518,526
0
0
null
null
null
null
UTF-8
Java
false
false
446
java
package snake; import java.util.List; public class GameUtils { public static void sleep(int millis) { try { Thread.sleep(millis); } catch (InterruptedException e) { } } public static void moveRects(List<Rect> rects) { for (int i = rects.size() - 1; i >= 1; i--) { rects.set(i, rects.get(i -1)); } } public static int random(int min, int max) { return(int) (Math.random() * (max - min + 1)) + min; } }
[ "mateus.borja@gmail.com" ]
mateus.borja@gmail.com
078a4c73c6d174fe2ad6eb6bbb522af301b8a7c9
6baf1fe00541560788e78de5244ae17a7a2b375a
/hollywood/com.oculus.socialplatform-base/sources/com/oculus/secure/trustedapp/exception/SignatureNullException.java
837fe7681e99b2c717fb1f5e88c81699e2f3c464
[]
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
312
java
package com.oculus.secure.trustedapp.exception; public class SignatureNullException extends SecurityException { public SignatureNullException() { } public SignatureNullException(Exception exc) { super(exc); } public SignatureNullException(String str) { super(str); } }
[ "cyuubiapps@gmail.com" ]
cyuubiapps@gmail.com
99de9a14aad6e8f7f1125622e86c36ac2aae5076
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Time/25/org/joda/time/DateTime_year_1756.java
94a87d13032f686d6f3ef1c6a6f43046e1e4c4fb
[]
no_license
hvdthong/NetML
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
9bb103da21327912e5a29cbf9be9ff4d058731a5
refs/heads/master
2021-06-30T15:03:52.618255
2020-10-07T01:58:48
2020-10-07T01:58:48
150,383,588
1
1
null
2018-09-26T07:08:45
2018-09-26T07:08:44
null
UTF-8
Java
false
false
3,183
java
org joda time date time datetim standard implement unmodifi datetim code date time datetim code wide implement link readabl instant readableinst instant repres exact point time line limit precis millisecond code date time datetim code calcul field respect link date time zone datetimezon time zone intern hold piec data firstli hold datetim millisecond java epoch t00 01t00 00z hold link chronolog determin millisecond instant convert date time field chronolog link iso chronolog isochronolog agre intern standard compat modern gregorian calendar individu field queri wai code hour dai gethourofdai code code hour dai hourofdai code techniqu access method field numer text text maximum minimum valu add subtract set round date time datetim thread safe immut provid chronolog standard chronolog class suppli thread safe immut author stephen colebourn author kandarp shah author brian neill o'neil mutabl date time mutabledatetim date time datetim year properti access advanc function year properti properti year properti chronolog getchronolog year
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
3150bd16371c44301cade4264cc9a9a22b9b975b
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XWIKI-14263-13-21-MOEAD-WeightedSum:TestLen:CallDiversity/com/xpn/xwiki/api/Document_ESTest_scaffolding.java
3ee37256318d3357425a4f69a3e17fe71a3e1138
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
430
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Thu Apr 09 04:36:46 UTC 2020 */ package com.xpn.xwiki.api; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class Document_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
27d8af7d9da2e854487dd3491552740ab504db99
43a383c5df2bfa07e2abb92bf155712137d94670
/src/main/java/com/easyiot/easylinker/easylinkerserver/client/BaseServive.java
2dbcb13ac0bd3ac9368fa9aaef51f124c5ce1276
[]
no_license
skyformat99/easy-linker-server
b77550c8dd123856e4d7a57e658e86d1d83c6051
a9962c0dbd5c700bee21816bd4f4d9678205a813
refs/heads/master
2020-04-02T02:03:20.836762
2018-10-19T08:23:03
2018-10-19T08:23:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
269
java
package com.easyiot.easylinker.easylinkerserver.client; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; public interface BaseServive<T> { void save(T t); void delete(T t); Page <T>getAll(Pageable pageable); }
[ "751957846@qq.com" ]
751957846@qq.com
2e22471701d7f9db52065a9249676f4ce6986ece
6fa8e84ecc47018bf6885c542f482aaf26fea0fe
/build/generated/source/greendao/com/ilop/sthome/data/greenDao/RoomBeanDao.java
c9c8141993b221e6c581cda9f30664356c1d2891
[]
no_license
sengeiou/familylink
0e6b71818db6d072300a884e9283858037427aeb
e3948b3be4be95c5bd8e5f330ec4ad2c0fc8af77
refs/heads/master
2022-04-04T04:38:36.077001
2020-02-14T11:38:10
2020-02-14T11:38:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,591
java
package com.ilop.sthome.data.greenDao; import android.database.Cursor; import android.database.sqlite.SQLiteStatement; import org.greenrobot.greendao.AbstractDao; import org.greenrobot.greendao.Property; import org.greenrobot.greendao.internal.DaoConfig; import org.greenrobot.greendao.database.Database; import org.greenrobot.greendao.database.DatabaseStatement; import com.ilop.sthome.utils.greenDao.DeviceConverter; import java.util.List; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. /** * DAO for table "ROOM_BEAN". */ public class RoomBeanDao extends AbstractDao<RoomBean, Long> { public static final String TABLENAME = "ROOM_BEAN"; /** * Properties of entity RoomBean.<br/> * Can be used for QueryBuilder and for referencing column names. */ public static class Properties { public final static Property Id = new Property(0, Long.class, "id", true, "_id"); public final static Property UserId = new Property(1, String.class, "userId", false, "USER_ID"); public final static Property Rid = new Property(2, int.class, "rid", false, "RID"); public final static Property Room_name = new Property(3, String.class, "room_name", false, "ROOM_NAME"); public final static Property GatewayList = new Property(4, String.class, "gatewayList", false, "GATEWAY_LIST"); public final static Property CameraList = new Property(5, String.class, "cameraList", false, "CAMERA_LIST"); public final static Property SubDeviceList = new Property(6, String.class, "subDeviceList", false, "SUB_DEVICE_LIST"); } private final DeviceConverter gatewayListConverter = new DeviceConverter(); private final DeviceConverter cameraListConverter = new DeviceConverter(); private final DeviceConverter subDeviceListConverter = new DeviceConverter(); public RoomBeanDao(DaoConfig config) { super(config); } public RoomBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"ROOM_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"USER_ID\" TEXT," + // 1: userId "\"RID\" INTEGER NOT NULL ," + // 2: rid "\"ROOM_NAME\" TEXT," + // 3: room_name "\"GATEWAY_LIST\" TEXT," + // 4: gatewayList "\"CAMERA_LIST\" TEXT," + // 5: cameraList "\"SUB_DEVICE_LIST\" TEXT);"); // 6: subDeviceList } /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"ROOM_BEAN\""; db.execSQL(sql); } @Override protected final void bindValues(DatabaseStatement stmt, RoomBean entity) { stmt.clearBindings(); Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } String userId = entity.getUserId(); if (userId != null) { stmt.bindString(2, userId); } stmt.bindLong(3, entity.getRid()); String room_name = entity.getRoom_name(); if (room_name != null) { stmt.bindString(4, room_name); } List gatewayList = entity.getGatewayList(); if (gatewayList != null) { stmt.bindString(5, gatewayListConverter.convertToDatabaseValue(gatewayList)); } List cameraList = entity.getCameraList(); if (cameraList != null) { stmt.bindString(6, cameraListConverter.convertToDatabaseValue(cameraList)); } List subDeviceList = entity.getSubDeviceList(); if (subDeviceList != null) { stmt.bindString(7, subDeviceListConverter.convertToDatabaseValue(subDeviceList)); } } @Override protected final void bindValues(SQLiteStatement stmt, RoomBean entity) { stmt.clearBindings(); Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } String userId = entity.getUserId(); if (userId != null) { stmt.bindString(2, userId); } stmt.bindLong(3, entity.getRid()); String room_name = entity.getRoom_name(); if (room_name != null) { stmt.bindString(4, room_name); } List gatewayList = entity.getGatewayList(); if (gatewayList != null) { stmt.bindString(5, gatewayListConverter.convertToDatabaseValue(gatewayList)); } List cameraList = entity.getCameraList(); if (cameraList != null) { stmt.bindString(6, cameraListConverter.convertToDatabaseValue(cameraList)); } List subDeviceList = entity.getSubDeviceList(); if (subDeviceList != null) { stmt.bindString(7, subDeviceListConverter.convertToDatabaseValue(subDeviceList)); } } @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); } @Override public RoomBean readEntity(Cursor cursor, int offset) { RoomBean entity = new RoomBean( // cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userId cursor.getInt(offset + 2), // rid cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // room_name cursor.isNull(offset + 4) ? null : gatewayListConverter.convertToEntityProperty(cursor.getString(offset + 4)), // gatewayList cursor.isNull(offset + 5) ? null : cameraListConverter.convertToEntityProperty(cursor.getString(offset + 5)), // cameraList cursor.isNull(offset + 6) ? null : subDeviceListConverter.convertToEntityProperty(cursor.getString(offset + 6)) // subDeviceList ); return entity; } @Override public void readEntity(Cursor cursor, RoomBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); entity.setUserId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); entity.setRid(cursor.getInt(offset + 2)); entity.setRoom_name(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setGatewayList(cursor.isNull(offset + 4) ? null : gatewayListConverter.convertToEntityProperty(cursor.getString(offset + 4))); entity.setCameraList(cursor.isNull(offset + 5) ? null : cameraListConverter.convertToEntityProperty(cursor.getString(offset + 5))); entity.setSubDeviceList(cursor.isNull(offset + 6) ? null : subDeviceListConverter.convertToEntityProperty(cursor.getString(offset + 6))); } @Override protected final Long updateKeyAfterInsert(RoomBean entity, long rowId) { entity.setId(rowId); return rowId; } @Override public Long getKey(RoomBean entity) { if(entity != null) { return entity.getId(); } else { return null; } } @Override public boolean hasKey(RoomBean entity) { return entity.getId() != null; } @Override protected final boolean isEntityUpdateable() { return true; } }
[ "1805298170@qq.com" ]
1805298170@qq.com
5d6e12a06b362cdcf297821f2ab4a8d00669a2c7
d4dd79d830f283d6fec1f346d864e11ecd3053f8
/src/test/java/com/qa/democart/tests/LoginPageTest.java
e0b948a718e67359781a70e899dbe7bbe07c98d2
[]
no_license
revati-arnepalli/AutomationFramework
739ae79b74386b4fe92f57abbe1c0b6bd548c97e
4984921273012c5a92a96f196737be9c9cf6b844
refs/heads/master
2023-08-10T22:13:43.111780
2021-09-19T19:02:44
2021-09-19T19:02:44
407,925,366
0
0
null
null
null
null
UTF-8
Java
false
false
1,083
java
package com.qa.democart.tests; import org.testng.Assert; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import com.qa.democart.base.BaseTest; import com.qa.democart.utils.Constant; import com.qa.democart.utils.ExcelUtil; public class LoginPageTest extends BaseTest{ @Test(priority=1) public void verifyLoginPageTitleTest() { String title=loginPage.getPageTitle(); Assert.assertEquals(title, Constant.Login_Page_Title); System.out.println(title); } @Test(priority=3) public void verifyUserIsAbleToLogin() { loginPage.doLogin(prop.getProperty("username"), prop.getProperty("Password")); } // @Test(priority=2) // public void verifyForgottenPasswordLink() { // loginPage.isForgotPasswordLinks(); // } @DataProvider public Object[][] getInvalidData() { Object data[][]= ExcelUtil.getTestData(Constant.INVALID_USERNAME_PASSWORD); return data; } @Test(dataProvider="getInvalidData") public void VerifyUserIsAbleToRegisterForm(String username,String password) { loginPage.doNotLogin(username,password); } }
[ "you@example.com" ]
you@example.com
3cd8d83aa6690ff20e4caf639034cabf9fe7b98d
3f3620a5542b0c51b69a26bb36934af256e9392e
/src/main/java/com/LeetCode/code/q714/BestTimetoBuyandSellStockwithTransactionFee/Solution.java
5fb3039d4b63715255e93b5d4c2ae85446c7a29f
[]
no_license
dengxiny/LeetCode
f4b2122ba61076fa664dbb4a04de824a7be21bfd
66a8e937e57f9fa817e9bf5c5b0a2187851b0ab0
refs/heads/master
2022-06-24T01:40:27.339596
2019-09-24T07:19:41
2019-09-24T07:19:41
210,536,818
0
0
null
2020-10-13T16:15:41
2019-09-24T07:15:33
Java
UTF-8
Java
false
false
1,213
java
package com.LeetCode.code.q714.BestTimetoBuyandSellStockwithTransactionFee; /** * @QuestionId : 714 * @difficulty : Medium * @Title : Best Time to Buy and Sell Stock with Transaction Fee * @TranslatedTitle:买卖股票的最佳时机含手续费 * @url : https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/ * @TranslatedContent:给定一个整数数组 prices,其中第 i 个元素代表了第 i 天的股票价格 ;非负整数 fee 代表了交易股票的手续费用。 你可以无限次地完成交易,但是你每次交易都需要付手续费。如果你已经购买了一个股票,在卖出它之前你就不能再继续购买股票了。 返回获得利润的最大值。 示例 1: 输入: prices = [1, 3, 2, 8, 4, 9], fee = 2 输出: 8 解释: 能够达到的最大利润: 在此处买入 prices[0] = 1 在此处卖出 prices[3] = 8 在此处买入 prices[4] = 4 在此处卖出 prices[5] = 9 总利润: ((8 - 1) - 2) + ((9 - 4) - 2) = 8. 注意: 0 < prices.length <= 50000. 0 < prices[i] < 50000. 0 <= fee < 50000. */ class Solution { public int maxProfit(int[] prices, int fee) { } }
[ "dengxy@YFB-DENGXY.sumpay.local" ]
dengxy@YFB-DENGXY.sumpay.local
a7fec647b6f212dc4739df121dab2d2a12bcac8c
94dcd0da08a5e68d6c1c7c83a7ea29d4d59f73de
/CinemaManagementSystemAndroid/app/src/main/java/me/lancer/cinemaadmin/mvp/play/fragment/PlayListFragment.java
852aaf21425ddf4814d260b00c8f057f758f4bcf
[]
no_license
1anc3r/Cinema-Management-System-Android
0b970c6bfa61757c2353852796df41edb673339f
d0a2cc67fedb7526ab8cc44cf04ca3a5958a3e17
refs/heads/master
2021-01-21T11:46:58.173605
2019-03-02T11:53:27
2019-03-02T11:53:27
91,754,942
2
0
null
null
null
null
UTF-8
Java
false
false
6,966
java
package me.lancer.cinemaadmin.mvp.play.fragment; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentTransaction; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v7.widget.DefaultItemAnimator; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.SearchView; import android.support.v7.widget.StaggeredGridLayoutManager; import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import java.util.ArrayList; import java.util.List; import me.lancer.cinemaadmin.R; import me.lancer.cinemaadmin.mvp.base.activity.PresenterFragment; import me.lancer.cinemaadmin.mvp.play.IPlayView; import me.lancer.cinemaadmin.mvp.play.PlayBean; import me.lancer.cinemaadmin.mvp.play.PlayPresenter; import me.lancer.cinemaadmin.mvp.play.adapter.PlayAdapter; import me.lancer.cinemaadmin.ui.activity.MainActivity; import me.lancer.cinemaadmin.ui.application.mApp; /** * Created by HuangFangzhi on 2016/12/18. */ public class PlayListFragment extends PresenterFragment<PlayPresenter> implements IPlayView { mApp app; private Toolbar toolbar; private SwipeRefreshLayout mSwipeRefreshLayout; private RecyclerView mRecyclerView; private PlayAdapter mAdapter; private StaggeredGridLayoutManager mStaggeredGridLayoutManager; private List<PlayBean> mList = new ArrayList<>(); private int last = 0; private String id = "", type = "", lang = "", name = "", introduction = "", img = "", price = "", status = "", session; private Handler handler = new Handler() { @Override public void handleMessage(Message msg) { switch (msg.what) { case 0: mSwipeRefreshLayout.setRefreshing(false); break; case 1: mSwipeRefreshLayout.setRefreshing(true); break; case 2: Log.e("log", (String) msg.obj); break; case 3: if (msg.obj != null) { mList.clear(); mList.addAll((List<PlayBean>) msg.obj); mAdapter = new PlayAdapter(getActivity(), mList); mRecyclerView.setAdapter(mAdapter); } mSwipeRefreshLayout.setRefreshing(false); break; } } }; private Runnable fetch = new Runnable() { @Override public void run() { presenter.fetch(id, type, lang, name, introduction, img, price, status, session); } }; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return inflater.inflate(R.layout.fragment_list, container, false); } @Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); app = (mApp) getActivity().getApplication(); toolbar = (Toolbar) view.findViewById(R.id.t_large); toolbar.setTitle("影片"); ((MainActivity) getActivity()).initDrawer(toolbar); initView(view); initData(); inflateMenu(); initSearchView(); } private void initData() { session = app.getSession(); new Thread(fetch).start(); } private void initView(View view) { mSwipeRefreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.srl_list); mSwipeRefreshLayout.setColorSchemeResources(R.color.blue, R.color.teal, R.color.green, R.color.yellow, R.color.orange, R.color.red, R.color.pink, R.color.purple); mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { @Override public void onRefresh() { Message msg = new Message(); msg.what = 0; handler.sendMessageDelayed(msg, 800); // flag = 0; // new Thread(loadLatest).start(); } }); mRecyclerView = (RecyclerView) view.findViewById(R.id.rv_list); mStaggeredGridLayoutManager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL); mRecyclerView.setLayoutManager(mStaggeredGridLayoutManager); mRecyclerView.setItemAnimator(new DefaultItemAnimator()); mRecyclerView.setHasFixedSize(true); mAdapter = new PlayAdapter(getActivity(), mList); mAdapter.setHasStableIds(true); mRecyclerView.setAdapter(mAdapter); } private void inflateMenu() { toolbar.inflateMenu(R.menu.menu_search); } private void initSearchView() { final SearchView searchView = (SearchView) toolbar.getMenu() .findItem(R.id.menu_search).getActionView(); searchView.setQueryHint("搜索..."); searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { @Override public boolean onQueryTextSubmit(String query) { // Fragment newfragment = new DiseaseFragment(); // Bundle data = new Bundle(); // data.putInt("what", 3); // data.putInt("obj", 0); // data.putString("name", query); // newfragment.setArguments(data); // FragmentTransaction fragmentTransaction = getActivity().getSupportFragmentManager().beginTransaction(); // fragmentTransaction.replace(R.id.fl_main, newfragment).commit(); // getActivity().invalidateOptionsMenu(); return false; } @Override public boolean onQueryTextChange(String s) { return false; } }); } @Override protected PlayPresenter onCreatePresenter() { return new PlayPresenter(this); } @Override public void showAdd(String result) { } @Override public void showFetch(List<PlayBean> list) { Message msg = new Message(); msg.what = 3; msg.obj = list; handler.sendMessage(msg); } @Override public void showModify(String result) { } @Override public void showDelete(String result) { } @Override public void showMsg(String log) { Message msg = new Message(); msg.what = 2; msg.obj = log; handler.sendMessage(msg); } @Override public void showLoad() { Message msg = new Message(); msg.what = 1; handler.sendMessage(msg); } @Override public void hideLoad() { Message msg = new Message(); msg.what = 0; handler.sendMessage(msg); } }
[ "huangfangzhi@icloud.com" ]
huangfangzhi@icloud.com
eef46fcc280cf17968b84a13d80dafb339bcf82b
47eb5bf54da6c19ca175fc8938ca9b6a2b545dfa
/smpp-esme/src/main/java/com/whty/framework/spring/SpringPropertyPlaceholderConfigurer.java
064646c1a86a4841baba62884fd0914a01b08999
[]
no_license
liszhu/whatever_ty
44ddb837f2de19cb980c28fe06e6634f9d6bd8cb
e02ef9e125cac9103848c776e420edcf0dcaed2f
refs/heads/master
2021-12-13T21:37:06.539805
2017-04-05T01:50:23
2017-04-05T01:50:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,432
java
/** * Copyright (c). * All rights reserved. * * Created on 2017-1-12 * Id: SpringPropertyPlaceholderConfigurer.java,v 1.0 2017-1-12 上午10:39:22 Administrator */ package com.whty.framework.spring; import java.util.HashMap; import java.util.Map; import java.util.Properties; import org.springframework.beans.BeansException; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; /** * @ClassName SpringPropertyPlaceholderConfigurer * @author Administrator * @date 2017-1-12 上午10:39:43 * @Description TODO(加载配置文件) */ public class SpringPropertyPlaceholderConfigurer extends PropertyPlaceholderConfigurer { private static Map<String, String> ctxPropertiesMap; @Override protected void processProperties( ConfigurableListableBeanFactory beanFactoryToProcess, Properties props) throws BeansException { super.processProperties(beanFactoryToProcess, props); ctxPropertiesMap = new HashMap<String, String>(); for (Object key : props.keySet()) { String keyStr = key.toString(); String value = props.getProperty(keyStr); ctxPropertiesMap.put(keyStr, value); } } /** * 获取Property * @param name Property名称 * @return */ public static String getStringProperty(String name){ if(ctxPropertiesMap == null)return null; return ctxPropertiesMap.get(name); } }
[ "652241956@qq.com" ]
652241956@qq.com
b3bc847373099912b0aa2481002cb54fc06c51dd
082e26b011e30dc62a62fae95f375e4f87d9e99c
/docs/weixin_7.0.4_source/反编译源码/未反混淆/src/main/java/a/i/b/a/c/n/a.java
4843a7dab99a15f82f10a04810559a51215af19a
[]
no_license
xsren/AndroidReverseNotes
9631a5aabc031006e795a112b7ac756a8edd4385
9202c276fe9f04a978e4e08b08e42645d97ca94b
refs/heads/master
2021-04-07T22:50:51.072197
2019-07-16T02:24:43
2019-07-16T02:24:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,356
java
package a.i.b.a.c.n; import a.a.k; import a.a.t; import a.a.v; import a.f.b.j; import com.tencent.matrix.trace.core.AppMethodBeat; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; public final class a { public static final <K> Map<K, Integer> x(Iterable<? extends K> iterable) { AppMethodBeat.i(122914); j.p(iterable, "receiver$0"); LinkedHashMap linkedHashMap = new LinkedHashMap(); int i = 0; Iterator it = iterable.iterator(); while (true) { int i2 = i; if (it.hasNext()) { linkedHashMap.put(it.next(), Integer.valueOf(i2)); i = i2 + 1; } else { Map map = linkedHashMap; AppMethodBeat.o(122914); return map; } } } public static final <T> void b(Collection<T> collection, T t) { AppMethodBeat.i(122915); j.p(collection, "receiver$0"); if (t != null) { collection.add(t); } AppMethodBeat.o(122915); } public static final <K, V> HashMap<K, V> UP(int i) { AppMethodBeat.i(122916); HashMap hashMap = new HashMap(UR(i)); AppMethodBeat.o(122916); return hashMap; } public static final <E> HashSet<E> UQ(int i) { AppMethodBeat.i(122917); HashSet hashSet = new HashSet(UR(i)); AppMethodBeat.o(122917); return hashSet; } public static final int UR(int i) { return i < 3 ? 3 : ((i / 3) + i) + 1; } public static final <T> List<T> at(ArrayList<T> arrayList) { AppMethodBeat.i(122918); j.p(arrayList, "receiver$0"); List<T> list; switch (arrayList.size()) { case 0: list = v.AUP; AppMethodBeat.o(122918); return list; case 1: list = k.listOf(t.fJ(arrayList)); AppMethodBeat.o(122918); return list; default: arrayList.trimToSize(); List<T> list2 = arrayList; AppMethodBeat.o(122918); return list2; } } }
[ "alwangsisi@163.com" ]
alwangsisi@163.com
e3e632710ad50ae934047cbe03ed34fa92f3f5d1
7733311b407ec50956660f722fe8f5fd581dbc46
/app/src/main/java/com/sunland/securitycheck/activities/Ac_base.java
1944e5f2f92e7a5bb8ab5ca50aeb3c148041110e
[]
no_license
diggaScan/SecurityCheck
f18d628152547a49d1332f83120ae0b41ab3560b
d15b96c216ab41277a76bdc62b2d55a04cefc54e
refs/heads/master
2020-04-06T22:00:18.599776
2019-01-21T07:56:18
2019-01-21T07:56:18
157,822,117
0
0
null
null
null
null
UTF-8
Java
false
false
5,040
java
package com.sunland.securitycheck.activities; import android.content.Intent; import android.content.res.TypedArray; import android.graphics.Color; import android.inputmethodservice.KeyboardView; import android.os.Build; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.View; import android.view.ViewGroup; import android.view.Window; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.TextView; import com.sunland.securitycheck.MyApplication; import com.sunland.securitycheck.R; import com.sunland.securitycheck.V_config; import com.sunland.securitycheck.bean.BaseRequestBean; import com.sunland.securitycheck.utils.DialogUtils; import com.sunland.securitycheck.utils.WindowInfoUtils; import java.text.SimpleDateFormat; import java.util.Date; import butterknife.ButterKnife; import cn.com.cybertech.pdk.OperationLog; public class Ac_base extends AppCompatActivity { public Toolbar toolbar; public TextView tb_title; public ImageView iv_nav; public FrameLayout container; public KeyboardView keyboard; public MyApplication mApplication; public DialogUtils dialogUtils; ; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.ac_base); mApplication = (MyApplication) getApplication(); toolbar = findViewById(R.id.toolbar); if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP && setImmersive()) { Window window = getWindow(); window.setStatusBarColor(Color.TRANSPARENT); window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); TypedArray actionbarSizeTypedArray = obtainStyledAttributes(new int[]{android.R.attr.actionBarSize}); int actionBarHeight = (int) actionbarSizeTypedArray.getDimension(0, 0); actionbarSizeTypedArray.recycle(); RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, WindowInfoUtils.getStatusBarHeight(this) + actionBarHeight); toolbar.setLayoutParams(lp); } tb_title = findViewById(R.id.toolbar_title); iv_nav = findViewById(R.id.nav_back); container = findViewById(R.id.container); keyboard = findViewById(R.id.myKeyb); iv_nav.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { finish(); } }); dialogUtils = DialogUtils.getInstance(); setSupportActionBar(toolbar); } public boolean setImmersive() { return true; } public void setContentLayout(int layout) { getLayoutInflater().inflate(layout, container, true); ButterKnife.bind(this); } public void setToolbarTitle(String title) { tb_title.setText(title); } public void showNavIcon(boolean isShow) { if (isShow) iv_nav.setVisibility(View.VISIBLE); else iv_nav.setVisibility(View.GONE); } public void saveLog(int operateType, int operationResult, String operateCondition) { try { OperationLog.saveLog(this , "95337103EF738979AE46420631D4A62D" , getApplication().getPackageName() , operateType , OperationLog.OperationResult.CODE_SUCCESS , 1 , operateCondition); } catch (Exception e) { //未适配Fileprovider e.printStackTrace(); } } public String appendString(String... strings) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < strings.length; i++) { sb.append(strings[i]); if (i != strings.length - 1) { sb.append("@"); } } return sb.toString(); } public void assembleBasicRequest(BaseRequestBean requestBean) { requestBean.setYhdm(V_config.YHDM); requestBean.setImei(V_config.imei); requestBean.setImsi(V_config.imsi1); Date date = new Date(); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String pda_time = simpleDateFormat.format(date); requestBean.setPdaTime(pda_time); requestBean.setGpsX(V_config.gpsX); requestBean.setGpsY(V_config.gpsY); } public void hop2Activity(Class<? extends Ac_base> clazz) { Intent intent = new Intent(this, clazz); startActivity(intent); } public void hop2Activity(Class<? extends Ac_base> clazz, Bundle bundle) { Intent intent = new Intent(this, clazz); intent.putExtra("bundle", bundle); startActivity(intent); } }
[ "peitaotom@gmail.com" ]
peitaotom@gmail.com
ab2fbfacf7f5d42ffb37f341024d4fa197e7a74d
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/30/30_01bff55f8af2b7abdf5c88f809ba59bbb4badd3d/AvroSerializer/30_01bff55f8af2b7abdf5c88f809ba59bbb4badd3d_AvroSerializer_s.java
3859dc91e75ea6988b4574a7d51dbc9bab157561
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
3,193
java
// (c) Copyright 2011 Odiago, Inc. package org.apache.avro.io; import java.io.IOException; import java.io.OutputStream; import org.apache.avro.Schema; import org.apache.avro.mapred.AvroWrapper; import org.apache.avro.specific.SpecificDatumWriter; import org.apache.hadoop.io.serializer.Serializer; /** * Serializes AvroWrapper objects within Hadoop. * * <p>Keys and values containing Avro types are more efficiently serialized outside of the * WritableSerialization model, so they are wrapped in {@link * org.apache.avro.mapred.AvroWrapper} objects and serialization is handled by this * class.</p> * * <p>MapReduce jobs that use AvroWrapper objects as keys or values need to be configured * with {@link org.apache.avro.mapreduce.AvroSerialization}. Use {@link * org.apache.avro.mapreduce.AvroJob} to help with Job configuration.</p> * * @param <T> The Java type of the Avro data. */ public class AvroSerializer<T> implements Serializer<AvroWrapper<T>> { /** * The block size for the Avro encoder. * * This number was copied from the AvroSerialization of org.apache.avro.mapred in Avro 1.5.1. * * TODO(gwu): Do some benchmarking with different numbers here to see if it is important. */ private static final int AVRO_ENCODER_BLOCK_SIZE_BYTES = 512; /** An factory for creating Avro datum encoders. */ private static EncoderFactory mEncoderFactory = new EncoderFactory().configureBlockSize(AVRO_ENCODER_BLOCK_SIZE_BYTES); /** The writer schema for the data to serialize. */ private final Schema mWriterSchema; /** The Avro datum writer for serializing. */ private final DatumWriter<T> mAvroDatumWriter; /** The Avro encoder for serializing. */ private BinaryEncoder mAvroEncoder; /** The output stream for serializing. */ private OutputStream mOutputStream; /** * Constructor. * * @param writerSchema The writer schema for the Avro data being serialized. */ public AvroSerializer(Schema writerSchema) { if (null == writerSchema) { throw new IllegalArgumentException("Writer schema may not be null"); } mWriterSchema = writerSchema; mAvroDatumWriter = new SpecificDatumWriter<T>(writerSchema); } /** * Gets the writer schema being used for serialization. * * @return The writer schema. */ public Schema getWriterSchema() { return mWriterSchema; } /** {@inheritDoc} */ @Override public void open(OutputStream outputStream) throws IOException { mOutputStream = outputStream; mAvroEncoder = mEncoderFactory.binaryEncoder(outputStream, mAvroEncoder); } /** {@inheritDoc} */ @Override public void serialize(AvroWrapper<T> avroWrapper) throws IOException { mAvroDatumWriter.write(avroWrapper.datum(), mAvroEncoder); // This would be a lot faster if the Serializer interface had a flush() method and the // Hadoop framework called it when needed. For now, we'll have to flush on every record. mAvroEncoder.flush(); } /** {@inheritDoc} */ @Override public void close() throws IOException { mOutputStream.close(); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
da2647d3ce69457a5da745e6e736327b482b9b2c
c0bb22bdce4d0a7fcdd4ec986857c2e79d20bca4
/src/test/java/io/termd/core/tty/NettyAsciiTelnetTtyTest.java
fccc16d0bd3cbcb01b14fa9c12f7c8bf1bfef0e8
[ "Apache-2.0" ]
permissive
termd/termd
c8ae725c3d9d0c6788125cf15861609d54f64d18
0f4b780a873524329358c4e14366c332e022d8c8
refs/heads/master
2022-12-14T00:08:00.949406
2021-10-29T09:42:56
2021-10-29T09:42:56
23,046,839
225
48
Apache-2.0
2022-12-05T23:56:41
2014-08-17T18:06:55
Java
UTF-8
Java
false
false
1,407
java
/* * Copyright 2015 Julien Viet * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.termd.core.tty; import io.termd.core.telnet.TelnetHandler; import io.termd.core.telnet.TelnetServerRule; import java.io.Closeable; import java.util.function.Function; import java.util.function.Supplier; /** * @author <a href="mailto:julien@julienviet.com">Julien Viet</a> */ public class NettyAsciiTelnetTtyTest extends TelnetTtyTestBase { public NettyAsciiTelnetTtyTest() { binary = false; } @Override protected Function<Supplier<TelnetHandler>, Closeable> serverFactory() { return TelnetServerRule.NETTY_SERVER; } @Override protected void assertThreading(Thread connThread, Thread schedulerThread) throws Exception { assertTrue(connThread.getName().startsWith("nioEventLoopGroup")); assertTrue(schedulerThread.getName().startsWith("nioEventLoopGroup")); } }
[ "julien@julienviet.com" ]
julien@julienviet.com
ea552c5174b8e208b835467bedd707091a34daba
359ffc6bf89f610b1d4a5af0f5d6ea3e6eaab28a
/maven-plugin/src/main/java/org/stjs/maven/FileCopier.java
cbee1201fa52c5e0e7549f7479273bfcd43a1e15
[ "Apache-2.0" ]
permissive
sgml/st-js
d3b29a0649af123910fa2aadb22cb95c4493e531
a97a611b39709477b8f6ddb3a05fa64b1976db17
refs/heads/master
2020-04-15T00:20:20.699194
2018-04-01T16:23:11
2018-04-01T16:23:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,237
java
package org.stjs.maven; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FilenameFilter; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.JarURLConnection; import java.net.URL; import java.net.URLConnection; import java.util.Enumeration; import java.util.jar.JarEntry; import java.util.jar.JarFile; import com.google.common.base.Strings; /** * This class is used to copy files from a folder (inside a jar or on the disk) to another folder. copied from * http://stackoverflow.com/questions/1386809/copy-directory-from-a-jar-file * * @author acraciun * @version $Id: $Id */ public class FileCopier { /** * <p>copyFile.</p> * * @param toCopy a {@link java.io.File} object. * @param destFile a {@link java.io.File} object. * @return a boolean. */ public static boolean copyFile(final File toCopy, final File destFile) { try { return copyStream(new FileInputStream(toCopy), new FileOutputStream(destFile)); } catch (final FileNotFoundException e) { e.printStackTrace(); } return false; } private static boolean copyFilesRecusively(final File toCopy, final File destDir, FilenameFilter filter) { assert destDir.isDirectory(); if (!toCopy.isDirectory()) { if (filter.accept(toCopy.getParentFile(), toCopy.getName())) { return copyFile(toCopy, new File(destDir, toCopy.getName())); } return true; } else { final File newDestDir = new File(destDir, toCopy.getName()); if (!newDestDir.exists() && !newDestDir.mkdir()) { return false; } for (final File child : toCopy.listFiles()) { if (!copyFilesRecusively(child, newDestDir, filter)) { return false; } } } return true; } /** * <p>copyJarResourcesRecursively.</p> * * @param destDir a {@link java.io.File} object. * @param jarConnection a {@link java.net.JarURLConnection} object. * @param filter a {@link java.io.FilenameFilter} object. * @return a boolean. * @throws java.io.IOException if any. */ public static boolean copyJarResourcesRecursively(final File destDir, final JarURLConnection jarConnection, FilenameFilter filter) throws IOException { final JarFile jarFile = jarConnection.getJarFile(); for (final Enumeration<JarEntry> e = jarFile.entries(); e.hasMoreElements();) { final JarEntry entry = e.nextElement(); String startName = jarConnection.getEntryName(); if (startName == null) { startName = ""; } if (entry.getName().startsWith(startName)) { final String filename = removeStart(entry.getName(), // startName); if (!entry.isDirectory()) { final File f = new File(destDir, filename); final InputStream entryInputStream = jarFile.getInputStream(entry); if (filter.accept(destDir, filename)) { if (!ensureDirectoryExists(f.getParentFile())) { throw new IOException("Could not create directory: " + f.getParentFile().getAbsolutePath()); } if (!copyStream(entryInputStream, f)) { return false; } } entryInputStream.close(); } } } return true; } /** * <p>copyResourcesRecursively.</p> * * @param originUrl a {@link java.net.URL} object. * @param destination a {@link java.io.File} object. * @param filter a {@link java.io.FilenameFilter} object. * @return a boolean. */ public static boolean copyResourcesRecursively( // final URL originUrl, final File destination, FilenameFilter filter) { try { final URLConnection urlConnection = originUrl.openConnection(); if (urlConnection instanceof JarURLConnection) { return copyJarResourcesRecursively(destination, (JarURLConnection) urlConnection, filter); } else { return copyFilesRecusively(new File(originUrl.getPath()), destination, filter); } } catch (final IOException e) { e.printStackTrace(); } return false; } private static boolean copyStream(final InputStream is, final File f) { try { return copyStream(is, new FileOutputStream(f)); } catch (final FileNotFoundException e) { e.printStackTrace(); } return false; } private static boolean copyStream(final InputStream is, final OutputStream os) { try { final byte[] buf = new byte[1024]; int len = 0; while ((len = is.read(buf)) > 0) { os.write(buf, 0, len); } is.close(); os.close(); return true; } catch (final IOException e) { e.printStackTrace(); } return false; } private static boolean ensureDirectoryExists(final File f) { return f.exists() || f.mkdirs(); } /** * <p>removeStart.</p> * * @param str a {@link java.lang.String} object. * @param remove a {@link java.lang.String} object. * @return a {@link java.lang.String} object. */ public static String removeStart(String str, String remove) { if (Strings.isNullOrEmpty(str) || Strings.isNullOrEmpty(remove)) { return str; } if (str.startsWith(remove)) { return str.substring(remove.length()); } return str; } }
[ "ax.craciun@gmail.com" ]
ax.craciun@gmail.com
91a6483724d9d94fdc7f54968ec3f59918dac03e
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/5/5_58d3f0c56f6137f58a23cf59f22701e6d79b743a/MethodInvocationPrivilegeEvaluatorTests/5_58d3f0c56f6137f58a23cf59f22701e6d79b743a_MethodInvocationPrivilegeEvaluatorTests_t.java
98afbccd622d3fb682b394a99699a3076078c944
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
5,677
java
/* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited * * 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.acegisecurity.intercept.method; import junit.framework.TestCase; import org.acegisecurity.GrantedAuthority; import org.acegisecurity.GrantedAuthorityImpl; import org.acegisecurity.ITargetObject; import org.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor; import org.acegisecurity.providers.UsernamePasswordAuthenticationToken; import org.acegisecurity.util.MethodInvocationUtils; import org.aopalliance.intercept.MethodInvocation; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; /** * Tests {@link org.acegisecurity.intercept.method.MethodInvocationPrivilegeEvaluator}. * * @author Ben Alex * @version $Id$ */ public class MethodInvocationPrivilegeEvaluatorTests extends TestCase { //~ Constructors =================================================================================================== public MethodInvocationPrivilegeEvaluatorTests() { super(); } public MethodInvocationPrivilegeEvaluatorTests(String arg0) { super(arg0); } //~ Methods ======================================================================================================== private Object lookupTargetObject() { ApplicationContext context = new ClassPathXmlApplicationContext( "org/acegisecurity/intercept/method/aopalliance/applicationContext.xml"); return context.getBean("target"); } public static void main(String[] args) { junit.textui.TestRunner.run(MethodInvocationPrivilegeEvaluatorTests.class); } private MethodSecurityInterceptor makeSecurityInterceptor() { ApplicationContext context = new ClassPathXmlApplicationContext( "org/acegisecurity/intercept/method/aopalliance/applicationContext.xml"); return (MethodSecurityInterceptor) context.getBean("securityInterceptor"); } public void testAllowsAccessUsingCreate() throws Exception { UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken("Test", "Password", new GrantedAuthority[] {new GrantedAuthorityImpl("MOCK_LOWER")}); Object object = lookupTargetObject(); MethodInvocation mi = MethodInvocationUtils.create(object, "makeLowerCase", new Object[] {"foobar"}); MethodSecurityInterceptor interceptor = makeSecurityInterceptor(); MethodInvocationPrivilegeEvaluator mipe = new MethodInvocationPrivilegeEvaluator(); mipe.setSecurityInterceptor(interceptor); mipe.afterPropertiesSet(); assertTrue(mipe.isAllowed(mi, token)); } public void testAllowsAccessUsingCreateFromClass() throws Exception { UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken("Test", "Password", new GrantedAuthority[] {new GrantedAuthorityImpl("MOCK_LOWER")}); MethodInvocation mi = MethodInvocationUtils.createFromClass(ITargetObject.class, "makeLowerCase", new Class[] {String.class}, new Object[] {"Hello world"}); MethodSecurityInterceptor interceptor = makeSecurityInterceptor(); MethodInvocationPrivilegeEvaluator mipe = new MethodInvocationPrivilegeEvaluator(); mipe.setSecurityInterceptor(interceptor); mipe.afterPropertiesSet(); assertTrue(mipe.isAllowed(mi, token)); } public void testDeclinesAccessUsingCreate() throws Exception { UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken("Test", "Password", new GrantedAuthority[] {new GrantedAuthorityImpl("ROLE_NOT_HELD")}); Object object = lookupTargetObject(); MethodInvocation mi = MethodInvocationUtils.create(object, "makeLowerCase", new Object[] {"foobar"}); MethodSecurityInterceptor interceptor = makeSecurityInterceptor(); MethodInvocationPrivilegeEvaluator mipe = new MethodInvocationPrivilegeEvaluator(); mipe.setSecurityInterceptor(interceptor); mipe.afterPropertiesSet(); assertFalse(mipe.isAllowed(mi, token)); } public void testDeclinesAccessUsingCreateFromClass() throws Exception { UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken("Test", "Password", new GrantedAuthority[] {new GrantedAuthorityImpl("ROLE_NOT_HELD")}); MethodInvocation mi = MethodInvocationUtils.createFromClass(ITargetObject.class, "makeLowerCase", new Class[] {String.class}, new Object[] {"helloWorld"}); MethodSecurityInterceptor interceptor = makeSecurityInterceptor(); MethodInvocationPrivilegeEvaluator mipe = new MethodInvocationPrivilegeEvaluator(); mipe.setSecurityInterceptor(interceptor); mipe.afterPropertiesSet(); assertFalse(mipe.isAllowed(mi, token)); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
1e16d084c34fad9de52ac7cef7aa27ceb28b576f
6aa8173702d8d196a3d1884a8e03ecbdaee56f6d
/src/main/java/io/naztech/jobharvestar/scraper/MindTree.java
91736ecf30c5dbdf8b71fc1fdf47fe260f6eef17
[]
no_license
armfahim/Job-Harvester
df762053cf285da87498faa705ec7a099fce1ea9
51dbc836a60b03c27c52cb38db7c19db5d91ddc9
refs/heads/master
2023-08-11T18:30:56.842891
2020-02-27T09:16:56
2020-02-27T09:16:56
243,461,410
3
0
null
2023-07-23T06:59:54
2020-02-27T07:48:57
Java
UTF-8
Java
false
false
699
java
package io.naztech.jobharvestar.scraper; import org.springframework.stereotype.Service; import io.naztech.jobharvestar.crawler.ShortName; import io.naztech.jobharvestar.scraper.linkedin.AbstractLinkedinJobs; /** * MindTree job site parser. <br> * URL: https://www.linkedin.com/jobs/search?locationId=OTHERS.worldwide&f_C=4300&trk=job-results_see-all-jobs-link&redirect=false&position=1&pageNum=0 * * @author tanmoy.tushar * @since 2019-10-20 */ @Service public class MindTree extends AbstractLinkedinJobs { private static final String SITE = ShortName.MINDTREE; @Override public String getSiteName() { return SITE; } @Override protected String getBaseUrl() { return null; } }
[ "armfahim4010@gmail.com" ]
armfahim4010@gmail.com
953e65e2dd317332cfa1bfcea12d01e29423bc51
23c933bf412ced6c4b79e564d1eb8243d4477266
/src/main/java/z3950/ESFormat_PersistResultSet/PersistentResultSet_taskPackage.java
496bf58388f3122e2cb08eb129517eca41b9b8ef
[]
no_license
cul/hrwa_manager
0c8bfa474de7166e51eeb072006ba05e68bdd2b7
c571a05f05ee2242fcf45485fa320f3a5ee830c7
refs/heads/master
2020-04-04T14:23:52.122766
2015-01-22T20:21:31
2015-01-22T20:21:31
8,013,080
0
1
null
null
null
null
UTF-8
Java
false
false
7,117
java
/* * $Source$ * $Date$ * $Revision$ * * Copyright (C) 1998, Hoylen Sue. All Rights Reserved. * <h.sue@ieee.org> * * 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. Refer to * the supplied license for more details. * * Generated by Zebulun ASN1tojava: 1998-09-08 03:15:25 UTC */ //---------------------------------------------------------------- package z3950.ESFormat_PersistResultSet; import asn1.*; import z3950.v3.InternationalString; //================================================================ /** * Class for representing a <code>PersistentResultSet_taskPackage</code> from <code>ESFormat-PersistentResultSet</code> * * <pre> * PersistentResultSet_taskPackage ::= * SEQUENCE { * originPart [1] IMPLICIT NULL * targetPart [2] EXPLICIT TargetPart OPTIONAL * } * </pre> * * @version $Release$ $Date$ */ //---------------------------------------------------------------- public final class PersistentResultSet_taskPackage extends ASN1Any { public final static String VERSION = "Copyright (C) Hoylen Sue, 1998. 199809080315Z"; //---------------------------------------------------------------- /** * Default constructor for a PersistentResultSet_taskPackage. */ public PersistentResultSet_taskPackage() { } //---------------------------------------------------------------- /** * Constructor for a PersistentResultSet_taskPackage from a BER encoding. * <p> * * @param ber the BER encoding. * @param check_tag will check tag if true, use false * if the BER has been implicitly tagged. You should * usually be passing true. * @exception ASN1Exception if the BER encoding is bad. */ public PersistentResultSet_taskPackage(BEREncoding ber, boolean check_tag) throws ASN1Exception { super(ber, check_tag); } //---------------------------------------------------------------- /** * Initializing object from a BER encoding. * This method is for internal use only. You should use * the constructor that takes a BEREncoding. * * @param ber the BER to decode. * @param check_tag if the tag should be checked. * @exception ASN1Exception if the BER encoding is bad. */ public void ber_decode(BEREncoding ber, boolean check_tag) throws ASN1Exception { // PersistentResultSet_taskPackage should be encoded by a constructed BER BERConstructed ber_cons; try { ber_cons = (BERConstructed) ber; } catch (ClassCastException e) { throw new ASN1EncodingException ("Zebulun PersistentResultSet_taskPackage: bad BER form\n"); } // Prepare to decode the components int num_parts = ber_cons.number_components(); int part = 0; BEREncoding p; BERConstructed tagged; // Decoding: originPart [1] IMPLICIT NULL if (num_parts <= part) { // End of record, but still more elements to get throw new ASN1Exception("Zebulun PersistentResultSet_taskPackage: incomplete"); } p = ber_cons.elementAt(part); if (p.tag_get() != 1 || p.tag_type_get() != BEREncoding.CONTEXT_SPECIFIC_TAG) throw new ASN1EncodingException ("Zebulun PersistentResultSet_taskPackage: bad tag in s_originPart\n"); s_originPart = new ASN1Null(p, false); part++; // Remaining elements are optional, set variables // to null (not present) so can return at end of BER s_targetPart = null; // Decoding: targetPart [2] EXPLICIT TargetPart OPTIONAL if (num_parts <= part) { return; // no more data, but ok (rest is optional) } p = ber_cons.elementAt(part); if (p.tag_get() == 2 && p.tag_type_get() == BEREncoding.CONTEXT_SPECIFIC_TAG) { try { tagged = (BERConstructed) p; } catch (ClassCastException e) { throw new ASN1EncodingException ("Zebulun PersistentResultSet_taskPackage: bad BER encoding: s_targetPart tag bad\n"); } if (tagged.number_components() != 1) { throw new ASN1EncodingException ("Zebulun PersistentResultSet_taskPackage: bad BER encoding: s_targetPart tag bad\n"); } s_targetPart = new TargetPart(tagged.elementAt(0), true); part++; } // Should not be any more parts if (part < num_parts) { throw new ASN1Exception("Zebulun PersistentResultSet_taskPackage: bad BER: extra data " + part + "/" + num_parts + " processed"); } } //---------------------------------------------------------------- /** * Returns a BER encoding of the PersistentResultSet_taskPackage. * * @exception ASN1Exception Invalid or cannot be encoded. * @return The BER encoding. */ public BEREncoding ber_encode() throws ASN1Exception { return ber_encode(BEREncoding.UNIVERSAL_TAG, ASN1Sequence.TAG); } //---------------------------------------------------------------- /** * Returns a BER encoding of PersistentResultSet_taskPackage, implicitly tagged. * * @param tag_type The type of the implicit tag. * @param tag The implicit tag. * @return The BER encoding of the object. * @exception ASN1Exception When invalid or cannot be encoded. * @see asn1.BEREncoding#UNIVERSAL_TAG * @see asn1.BEREncoding#APPLICATION_TAG * @see asn1.BEREncoding#CONTEXT_SPECIFIC_TAG * @see asn1.BEREncoding#PRIVATE_TAG */ public BEREncoding ber_encode(int tag_type, int tag) throws ASN1Exception { // Calculate the number of fields in the encoding int num_fields = 1; // number of mandatories if (s_targetPart != null) num_fields++; // Encode it BEREncoding fields[] = new BEREncoding[num_fields]; int x = 0; BEREncoding enc[]; // Encoding s_originPart: NULL fields[x++] = s_originPart.ber_encode(BEREncoding.CONTEXT_SPECIFIC_TAG, 1); // Encoding s_targetPart: TargetPart OPTIONAL if (s_targetPart != null) { enc = new BEREncoding[1]; enc[0] = s_targetPart.ber_encode(); fields[x++] = new BERConstructed(BEREncoding.CONTEXT_SPECIFIC_TAG, 2, enc); } return new BERConstructed(tag_type, tag, fields); } //---------------------------------------------------------------- /** * Returns a new String object containing a text representing * of the PersistentResultSet_taskPackage. */ public String toString() { StringBuffer str = new StringBuffer("{"); int outputted = 0; str.append("originPart "); str.append(s_originPart); outputted++; if (s_targetPart != null) { if (0 < outputted) str.append(", "); str.append("targetPart "); str.append(s_targetPart); outputted++; } str.append("}"); return str.toString(); } //---------------------------------------------------------------- /* * Internal variables for class. */ public ASN1Null s_originPart; public TargetPart s_targetPart; // optional } // PersistentResultSet_taskPackage //---------------------------------------------------------------- //EOF
[ "eric@ejdigitalmedia.com" ]
eric@ejdigitalmedia.com
78eb0fbe512684ecd344496365be4d03a2b76f8a
b3a694913d943bdb565fbf828d6ab8a08dd7dd12
/sources/p002es/gob/radarcovid/models/response/ResponseLabels.java
39c345a5e168c139dc480f27be6808ea15b55553
[]
no_license
v1ckxy/radar-covid
feea41283bde8a0b37fbc9132c9fa5df40d76cc4
8acb96f8ccd979f03db3c6dbfdf162d66ad6ac5a
refs/heads/master
2022-12-06T11:29:19.567919
2020-08-29T08:00:19
2020-08-29T08:00:19
294,198,796
1
0
null
2020-09-09T18:39:43
2020-09-09T18:39:43
null
UTF-8
Java
false
false
2,927
java
package p002es.gob.radarcovid.models.response; import java.util.Collection; import java.util.HashMap; import java.util.Map.Entry; import java.util.Set; /* renamed from: es.gob.radarcovid.models.response.ResponseLabels */ public final class ResponseLabels extends HashMap<String, String> { public final /* bridge */ boolean containsKey(Object obj) { if (obj instanceof String) { return containsKey((String) obj); } return false; } public /* bridge */ boolean containsKey(String str) { return super.containsKey(str); } public final /* bridge */ boolean containsValue(Object obj) { if (obj instanceof String) { return containsValue((String) obj); } return false; } public /* bridge */ boolean containsValue(String str) { return super.containsValue(str); } public final /* bridge */ Set<Entry<String, String>> entrySet() { return getEntries(); } public final /* bridge */ Object get(Object obj) { if (obj instanceof String) { return get((String) obj); } return null; } public /* bridge */ String get(String str) { return (String) super.get(str); } public /* bridge */ Set getEntries() { return super.entrySet(); } public /* bridge */ Set getKeys() { return super.keySet(); } public final /* bridge */ Object getOrDefault(Object obj, Object obj2) { return obj != null ? obj instanceof String : true ? getOrDefault((String) obj, (String) obj2) : obj2; } public /* bridge */ String getOrDefault(String str, String str2) { return (String) super.getOrDefault(str, str2); } public /* bridge */ int getSize() { return super.size(); } public /* bridge */ Collection getValues() { return super.values(); } public final /* bridge */ Set<String> keySet() { return getKeys(); } public final /* bridge */ Object remove(Object obj) { if (obj instanceof String) { return remove((String) obj); } return null; } public /* bridge */ String remove(String str) { return (String) super.remove(str); } public final /* bridge */ boolean remove(Object obj, Object obj2) { boolean z = true; if (obj != null ? obj instanceof String : true) { if (obj2 != null) { z = obj2 instanceof String; } if (z) { return remove((String) obj, (String) obj2); } } return false; } public /* bridge */ boolean remove(String str, String str2) { return super.remove(str, str2); } public final /* bridge */ int size() { return getSize(); } public final /* bridge */ Collection<String> values() { return getValues(); } }
[ "josemmoya@outlook.com" ]
josemmoya@outlook.com
e1ae2ca00facaede80b791bf83676f54e74f6cb5
47bcda7c56634c80ec34656f17b2af988776022b
/demo/src/test/java/com/jsoniter/demo/object_with_15_fields/BenchDslJson.java
936953b3abb6cdf7b557fb772dae502b54d5b33b
[ "MIT" ]
permissive
plokhotnyuk/jsoniter-java
f3298edb3bf89a6f8bcedfc9edc98cdd712a4a91
48aed51a03b052a08d5300da6c374acbc01eb52c
refs/heads/master
2021-07-19T16:00:23.994480
2017-10-24T06:41:55
2017-10-24T06:41:55
107,228,262
2
0
null
null
null
null
UTF-8
Java
false
false
2,114
java
package com.jsoniter.demo.object_with_15_fields; import com.dslplatform.json.CustomJsonReader; import com.dslplatform.json.ExternalSerialization; import com.dslplatform.json.JsonWriter; import org.openjdk.jmh.Main; import org.openjdk.jmh.annotations.*; import org.openjdk.jmh.infra.BenchmarkParams; import org.openjdk.jmh.infra.Blackhole; import org.openjdk.jmh.runner.RunnerException; import java.io.ByteArrayOutputStream; import java.io.IOException; /* Benchmark Mode Cnt Score Error Units BenchDslJson.deser thrpt 5 22328042.432 ± 311925.080 ops/s (3.67x) BenchDslJson.ser thrpt 5 17639416.242 ± 136738.841 ops/s (2.17x) */ @State(Scope.Thread) public class BenchDslJson { private TestObject testObject; private JsonWriter jsonWriter; private ByteArrayOutputStream byteArrayOutputStream; private byte[] testJSON; private CustomJsonReader reader; @Setup(Level.Trial) public void benchSetup(BenchmarkParams params) { testObject = TestObject.createTestObject(); testJSON = TestObject.createTestJSON(); jsonWriter = new JsonWriter(); byteArrayOutputStream = new ByteArrayOutputStream(); reader = new CustomJsonReader(testJSON); } @Benchmark public void ser(Blackhole bh) throws IOException { jsonWriter.reset(); byteArrayOutputStream.reset(); ExternalSerialization.serialize(testObject, jsonWriter, false); jsonWriter.toStream(byteArrayOutputStream); bh.consume(byteArrayOutputStream); } @Benchmark public void deser(Blackhole bh) throws IOException { reader.reset(); reader.read(); reader.getNextToken(); TestObject obj = new TestObject(); ExternalSerialization.deserialize(obj, reader); bh.consume(obj); } public static void main(String[] args) throws IOException, RunnerException { Main.main(new String[]{ "object_with_15_fields.BenchDslJson", "-i", "5", "-wi", "5", "-f", "1", }); } }
[ "taowen@gmail.com" ]
taowen@gmail.com
74e418c5eb7dd4ebdd81d32ca6cb48369a81698f
1e425d8861c4016eb3e379c76f741ddb1d60ed8b
/android/support/design/internal/NavigationMenuView.java
dfd67fe52e19873fd8ebd425b0f339d3f09e0242
[]
no_license
jayarambaratam/Soroush
302ebd5b172e511354969120c89f4e82cdb297bf
21e6b9a1ab415262db1f97a9a6e02a8827e01184
refs/heads/master
2021-01-17T22:50:54.415189
2016-02-04T10:57:55
2016-02-04T10:57:55
52,431,208
2
1
null
2016-02-24T09:42:40
2016-02-24T09:42:40
null
UTF-8
Java
false
false
896
java
package android.support.design.internal; import android.content.Context; import android.support.v7.view.menu.C0047z; import android.support.v7.view.menu.C0049i; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.AttributeSet; public class NavigationMenuView extends RecyclerView implements C0047z { public NavigationMenuView(Context context) { this(context, null); } public NavigationMenuView(Context context, AttributeSet attributeSet) { this(context, attributeSet, 0); } public NavigationMenuView(Context context, AttributeSet attributeSet, int i) { super(context, attributeSet, i); setLayoutManager(new LinearLayoutManager(context, 1, false)); } public int getWindowAnimations() { return 0; } public void initialize(C0049i c0049i) { } }
[ "grayhat@kimo.com" ]
grayhat@kimo.com
89602d530d217a9d6bc5c4f38bfe122aa2c92ba2
4056a52ffc95518bf2b34c3882af798373da129e
/wicket-kendo-ui/src/main/java/com/googlecode/wicket/kendo/ui/renderer/ChoiceRenderer.java
159702ca21a3abb583f6d37b8c609d2f2d700a9c
[ "Apache-2.0" ]
permissive
grathmoualdo/wicket-jquery-ui
962ee45ea5640a70da2cdb26a214a32010659e50
74c32cd6b1a3a6316113d063af02f49fb8858b80
refs/heads/master
2021-01-18T09:25:07.086539
2015-08-13T06:14:01
2015-08-13T06:14:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,950
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.googlecode.wicket.kendo.ui.renderer; import org.apache.wicket.ajax.json.JSONObject; import org.apache.wicket.core.util.lang.PropertyResolver; import com.googlecode.wicket.jquery.core.renderer.IChoiceRenderer; import com.googlecode.wicket.jquery.core.renderer.TextRenderer; /** * Default implementation of {@link IChoiceRenderer}. * * @author Sebastien Briquet - sebfz1 * * @param <T> the model object type */ public class ChoiceRenderer<T> extends TextRenderer<T> implements IChoiceRenderer<T> { private static final long serialVersionUID = 1L; private static final String VALUE_FIELD = "value"; private String valueExpression; /** * Constructor */ public ChoiceRenderer() { super(); this.valueExpression = null; } /** * Constructor * * @param textExpression the property expression that will be resolved for the bean supplied to {@link #getText(Object)} */ public ChoiceRenderer(String textExpression) { super(textExpression); this.valueExpression = null; } /** * Constructor * * @param textExpression the property expression that will be resolved for the bean supplied to {@link #getText(Object)} * @param valueExpression the property expression that will be resolved for the bean supplied to {@link #getValue(Object)} */ public ChoiceRenderer(String textExpression, String valueExpression) { super(textExpression); this.valueExpression = valueExpression; } @Override public String getValueField() { if (this.valueExpression != null) { return this.valueExpression; } return VALUE_FIELD; } @Override public String getValue(T object) { if (this.valueExpression != null) { Object value = PropertyResolver.getValue(this.valueExpression, object); // if the object is null, null is returned if (value != null) { return value.toString(); } } return this.getText(object); } @Override public String render(T object) { return String.format("%s: %s, %s: %s", JSONObject.quote(this.getTextField()), JSONObject.quote(this.getText(object)), JSONObject.quote(this.getValueField()), JSONObject.quote(this.getValue(object))); } }
[ "sebfz1@gmail.com" ]
sebfz1@gmail.com
d629b0a48ebef91d33004a6a87d239c884e708f2
9623f83defac3911b4780bc408634c078da73387
/powercraft v1.4.4/src/minecraft_server/net/minecraft/src/ItemBed.java
04f2c7be83859ffbad4db3cf0b023b39dd9eb6c0
[]
no_license
BlearStudio/powercraft-legacy
42b839393223494748e8b5d05acdaf59f18bd6c6
014e9d4d71bd99823cf63d4fbdb65c1b83fde1f8
refs/heads/master
2021-01-21T21:18:55.774908
2015-04-06T20:45:25
2015-04-06T20:45:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,541
java
package net.minecraft.src; public class ItemBed extends Item { public ItemBed(int par1) { super(par1); this.setCreativeTab(CreativeTabs.tabDecorations); } /** * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return * True if something happen and false if it don't. This is for ITEMS, not BLOCKS */ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { if (par3World.isRemote) { return true; } else if (par7 != 1) { return false; } else { ++par5; BlockBed var11 = (BlockBed)Block.bed; int var12 = MathHelper.floor_double((double)(par2EntityPlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; byte var13 = 0; byte var14 = 0; if (var12 == 0) { var14 = 1; } if (var12 == 1) { var13 = -1; } if (var12 == 2) { var14 = -1; } if (var12 == 3) { var13 = 1; } if (par2EntityPlayer.func_82247_a(par4, par5, par6, par7, par1ItemStack) && par2EntityPlayer.func_82247_a(par4 + var13, par5, par6 + var14, par7, par1ItemStack)) { if (par3World.isAirBlock(par4, par5, par6) && par3World.isAirBlock(par4 + var13, par5, par6 + var14) && par3World.doesBlockHaveSolidTopSurface(par4, par5 - 1, par6) && par3World.doesBlockHaveSolidTopSurface(par4 + var13, par5 - 1, par6 + var14)) { par3World.setBlockAndMetadataWithNotify(par4, par5, par6, var11.blockID, var12); if (par3World.getBlockId(par4, par5, par6) == var11.blockID) { par3World.setBlockAndMetadataWithNotify(par4 + var13, par5, par6 + var14, var11.blockID, var12 + 8); } --par1ItemStack.stackSize; return true; } else { return false; } } else { return false; } } } }
[ "nils.h.emmerich@gmail.com@ed9f5d1b-00bb-0f29-faab-e8ebad1a710c" ]
nils.h.emmerich@gmail.com@ed9f5d1b-00bb-0f29-faab-e8ebad1a710c
310301741cb739e0933db8a3d2fdede8d86e1048
7e9593dd15d6550502e8119d6c7ea5176b61d2a7
/作业/WebWork/src/com/yy/study/web/LoginOutServlet.java
7758e3264421119186c9f9152471a3829c8f7036
[]
no_license
FineDreams/JavaStudy
67ec98fc3a6c086ffb717b19af1dfcc52585e245
b513b9a3df332673f445e2fd2b900b6b123e7460
refs/heads/master
2021-09-10T21:55:45.059112
2018-04-03T01:22:33
2018-04-03T01:22:33
113,833,680
1
0
null
null
null
null
UTF-8
Java
false
false
1,086
java
package com.yy.study.web; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.*; import java.io.IOException; @WebServlet(name = "LoginOutServlet",urlPatterns = "/loginOut") public class LoginOutServlet extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { HttpSession session = request.getSession(false); if(session == null){ response.sendRedirect("http://localhost:8080/login.jsp"); return; } String uname =(String ) session.getAttribute("uname"); Cookie cookie=new Cookie("username",uname); cookie.setMaxAge(60*60*24); response.addCookie(cookie); session.removeAttribute("uname"); // getServletContext().setAttribute("uname",uname); response.sendRedirect("http://localhost:8080/login.jsp"); } }
[ "1411374327@qq.com" ]
1411374327@qq.com
d1fe7a38a54494b29ad020f3d9586fd9265a8857
f6e18c4f0341ed8f66f02a9ce930cf54063fbdf3
/source/mon/lattice/core/DataConsumerInteracter.java
daa7f3602181853a9761492e48b7f84acc666d61
[]
no_license
UCL/lattice-monitoring-framework
d3c1c6a55f310ecc62d735e9dd6f26836d2cfcc6
fb58ad12c61a12b1691327ae09244a28501072c6
refs/heads/master
2023-05-15T06:33:03.103855
2023-05-04T09:11:52
2023-05-04T09:11:52
169,605,080
0
1
null
null
null
null
UTF-8
Java
false
false
511
java
// DataSourceInteracter.java // Author: Stuart Clayman // Email: sclayman@ee.ucl.ac.uk // Date: Sept 2009 package mon.lattice.core; /** * A DataSourceInteracter is responsible interacting with a DataSource. */ public interface DataConsumerInteracter { /** * Get the ControllableDataConsumer */ public ControllableDataConsumer getDataConsumer(); /** * Set the ControllableDataConsumer */ public ControllableDataConsumer setDataConsumer(ControllableDataConsumer ds); }
[ "francesco.tusa@ucl.ac.uk" ]
francesco.tusa@ucl.ac.uk
17890b65be0cecd4944449e1aef9b3de455a9bcd
1104433a0971a02312a9a08f31c4aa75d4b3305b
/src/test/java/io/github/licenta/application/config/WebConfigurerTest.java
fbeb17bfff0257d9af95e5300f42e9f47b753957
[]
no_license
BulkSecurityGeneratorProject/licentaApp
0c5c2e54bbec60cdb5385352a871f0ff846db1b7
113067e36b4ba398e506ef02a61ca3fb4887dc95
refs/heads/master
2022-12-15T16:23:51.590862
2019-06-04T20:51:47
2019-06-04T20:51:47
296,535,349
0
0
null
2020-09-18T06:38:30
2020-09-18T06:38:29
null
UTF-8
Java
false
false
6,975
java
package io.github.licenta.application.config; import io.github.jhipster.config.JHipsterConstants; import io.github.jhipster.config.JHipsterProperties; import io.github.jhipster.web.filter.CachingHttpHeadersFilter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory; import org.springframework.http.HttpHeaders; import org.springframework.mock.env.MockEnvironment; import org.springframework.mock.web.MockServletContext; import org.springframework.test.util.ReflectionTestUtils; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import javax.servlet.*; import java.io.File; import java.util.*; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.*; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.options; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.header; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; /** * Unit tests for the {@link WebConfigurer} class. */ public class WebConfigurerTest { private WebConfigurer webConfigurer; private MockServletContext servletContext; private MockEnvironment env; private JHipsterProperties props; @BeforeEach public void setup() { servletContext = spy(new MockServletContext()); doReturn(mock(FilterRegistration.Dynamic.class)) .when(servletContext).addFilter(anyString(), any(Filter.class)); doReturn(mock(ServletRegistration.Dynamic.class)) .when(servletContext).addServlet(anyString(), any(Servlet.class)); env = new MockEnvironment(); props = new JHipsterProperties(); webConfigurer = new WebConfigurer(env, props); } @Test public void testStartUpProdServletContext() throws ServletException { env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION); webConfigurer.onStartup(servletContext); verify(servletContext).addFilter(eq("cachingHttpHeadersFilter"), any(CachingHttpHeadersFilter.class)); } @Test public void testStartUpDevServletContext() throws ServletException { env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT); webConfigurer.onStartup(servletContext); verify(servletContext, never()).addFilter(eq("cachingHttpHeadersFilter"), any(CachingHttpHeadersFilter.class)); } @Test public void testCustomizeServletContainer() { env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION); UndertowServletWebServerFactory container = new UndertowServletWebServerFactory(); webConfigurer.customize(container); assertThat(container.getMimeMappings().get("abs")).isEqualTo("audio/x-mpeg"); assertThat(container.getMimeMappings().get("html")).isEqualTo("text/html;charset=utf-8"); assertThat(container.getMimeMappings().get("json")).isEqualTo("text/html;charset=utf-8"); if (container.getDocumentRoot() != null) { assertThat(container.getDocumentRoot()).isEqualTo(new File("target/classes/static/")); } } @Test public void testCorsFilterOnApiPath() throws Exception { props.getCors().setAllowedOrigins(Collections.singletonList("*")); props.getCors().setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE")); props.getCors().setAllowedHeaders(Collections.singletonList("*")); props.getCors().setMaxAge(1800L); props.getCors().setAllowCredentials(true); MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController()) .addFilters(webConfigurer.corsFilter()) .build(); mockMvc.perform( options("/api/test-cors") .header(HttpHeaders.ORIGIN, "other.domain.com") .header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "POST")) .andExpect(status().isOk()) .andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, "other.domain.com")) .andExpect(header().string(HttpHeaders.VARY, "Origin")) .andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_METHODS, "GET,POST,PUT,DELETE")) .andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_CREDENTIALS, "true")) .andExpect(header().string(HttpHeaders.ACCESS_CONTROL_MAX_AGE, "1800")); mockMvc.perform( get("/api/test-cors") .header(HttpHeaders.ORIGIN, "other.domain.com")) .andExpect(status().isOk()) .andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, "other.domain.com")); } @Test public void testCorsFilterOnOtherPath() throws Exception { props.getCors().setAllowedOrigins(Collections.singletonList("*")); props.getCors().setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE")); props.getCors().setAllowedHeaders(Collections.singletonList("*")); props.getCors().setMaxAge(1800L); props.getCors().setAllowCredentials(true); MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController()) .addFilters(webConfigurer.corsFilter()) .build(); mockMvc.perform( get("/test/test-cors") .header(HttpHeaders.ORIGIN, "other.domain.com")) .andExpect(status().isOk()) .andExpect(header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN)); } @Test public void testCorsFilterDeactivated() throws Exception { props.getCors().setAllowedOrigins(null); MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController()) .addFilters(webConfigurer.corsFilter()) .build(); mockMvc.perform( get("/api/test-cors") .header(HttpHeaders.ORIGIN, "other.domain.com")) .andExpect(status().isOk()) .andExpect(header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN)); } @Test public void testCorsFilterDeactivated2() throws Exception { props.getCors().setAllowedOrigins(new ArrayList<>()); MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController()) .addFilters(webConfigurer.corsFilter()) .build(); mockMvc.perform( get("/api/test-cors") .header(HttpHeaders.ORIGIN, "other.domain.com")) .andExpect(status().isOk()) .andExpect(header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN)); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
5c51a5d6cc018ae1c1fc2c089b5b839f5fd937f3
0d6800f311072bbd3ee0de305b1145d1040521e8
/src/main/java/org/bukkit/craftbukkit/v1_8_R3/entity/CraftEnderDragon.java
cc8aaed75a98266c952964fcf218529831a2ae1c
[]
no_license
MisterSandFR/LunchBox
52ddc560721f71b5c593f1f53f350bf8c24a42ad
70ddc5432c56668d0e4ad1add9a0742263934dc7
refs/heads/master
2020-12-25T05:03:03.642668
2016-06-09T00:39:43
2016-06-09T00:39:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,361
java
package org.bukkit.craftbukkit.v1_8_R3.entity; import com.google.common.collect.ImmutableSet; import java.util.Set; import net.minecraft.server.v1_8_R3.EntityComplexPart; import net.minecraft.server.v1_8_R3.EntityEnderDragon; import net.minecraft.server.v1_8_R3.EntityLiving; import org.bukkit.craftbukkit.v1_8_R3.CraftServer; import org.bukkit.entity.ComplexEntityPart; import org.bukkit.entity.EnderDragon; import org.bukkit.entity.EntityType; public class CraftEnderDragon extends CraftComplexLivingEntity implements EnderDragon { public CraftEnderDragon(CraftServer server, EntityEnderDragon entity) { super(server, (EntityLiving) entity); } public Set getParts() { ImmutableSet.Builder builder = ImmutableSet.builder(); EntityComplexPart[] aentitycomplexpart; int i = (aentitycomplexpart = this.getHandle().children).length; for (int j = 0; j < i; ++j) { EntityComplexPart part = aentitycomplexpart[j]; builder.add((Object) ((ComplexEntityPart) part.getBukkitEntity())); } return builder.build(); } public EntityEnderDragon getHandle() { return (EntityEnderDragon) this.entity; } public String toString() { return "CraftEnderDragon"; } public EntityType getType() { return EntityType.ENDER_DRAGON; } }
[ "pturchan@yahoo.com" ]
pturchan@yahoo.com
947cbf04f35d36fe340e98666614d2f60bda14d5
0106d23ea81ddd2c46b484fbff833733946050b4
/app/src/main/java/com/xiaobukuaipao/youngmam/adapter/SearchCursorAdapter.java
b1ede449719001c3f6b286df11f9401a1abec204
[]
no_license
wanghaihui/Youngmam
df7c4249cc20765bfc738339630896a1519059fe
64b8ddc1b0b3b791fd9eb32731be4ae147a39db3
refs/heads/master
2021-01-10T01:35:17.707653
2016-02-18T07:54:58
2016-02-18T07:54:58
51,988,276
0
0
null
null
null
null
UTF-8
Java
false
false
2,552
java
package com.xiaobukuaipao.youngmam.adapter; import android.content.Context; import android.database.Cursor; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.CursorAdapter; import android.widget.ImageButton; import android.widget.TextView; import com.xiaobukuaipao.youngmam.R; import com.xiaobukuaipao.youngmam.database.SearchTable; /** * Created by xiaobu1 on 15-5-26. */ public class SearchCursorAdapter extends CursorAdapter { private static final String TAG = SearchCursorAdapter.class.getSimpleName(); private Context context = null; private LayoutInflater inflater = null; private OnDeleteClickListener onDeleteClickListener; public void setOnDeleteClickListener(OnDeleteClickListener onDeleteClickListener) { this.onDeleteClickListener = onDeleteClickListener; } // 缺省的构造函数--构建 public SearchCursorAdapter(Context context, Cursor cursor, int flags) { super(context, cursor, flags); this.context = context; inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @Override public View newView(Context context, Cursor cursor, ViewGroup parent) { // 一般都这样写,返回列表行元素,注意这里返回的就是bindView中的view ViewHolder viewHolder = null; View convertView = null; convertView = inflater.inflate(R.layout.item_latest_search, parent, false); viewHolder = new ViewHolder(); convertView.setTag(viewHolder); viewHolder.word = (TextView) convertView.findViewById(R.id.search); viewHolder.delete = (ImageButton) convertView.findViewById(R.id.delete); return convertView; } @Override public void bindView(final View view, Context context, Cursor cursor) { ViewHolder viewHolder = (ViewHolder) view.getTag(); viewHolder.word.setText(cursor.getString(cursor.getColumnIndex(SearchTable.COLUMN_WORD))); final long id = cursor.getInt(cursor.getColumnIndex(SearchTable.COLUMN_ID)); viewHolder.delete.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { onDeleteClickListener.onDeleteClick(String.valueOf(id)); } }); } private static class ViewHolder { TextView word; ImageButton delete; } public interface OnDeleteClickListener { void onDeleteClick(String id); } }
[ "465495722@qq.com" ]
465495722@qq.com
d60d105b6aa5106a69e59e63d3e5315c1685d780
5173df74af5e06dc88f9a9b644fb2a0c62ad4b8a
/owo/src/com/owo/app/test/AppWidgetActivity.java
42a9f1bdb7928cf7d423766f09553a412e03c104
[]
no_license
leeowenowen/owo
78a98111a577313e8aea932926095ce4afda7d3b
9a6c9f83bb35f7b9e437a3a81a5b51511f1adb4f
refs/heads/master
2021-01-17T10:23:10.870571
2016-04-22T10:04:07
2016-04-22T10:04:07
30,387,282
0
0
null
null
null
null
UTF-8
Java
false
false
7,548
java
package com.owo.app.test; import android.app.Activity; import android.appwidget.AppWidgetHost; import android.appwidget.AppWidgetHostView; import android.appwidget.AppWidgetManager; import android.appwidget.AppWidgetProviderInfo; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; public class AppWidgetActivity extends Activity { private static String TAG = "AddAppWidget" ; private Button btAddShortCut; private LinearLayout linearLayout ; // 装载Appwidget的父视图 private static final int MY_REQUEST_APPWIDGET = 1; private static final int MY_CREATE_APPWIDGET = 2; private static final int HOST_ID = 1024 ; private AppWidgetHost mAppWidgetHost = null ; AppWidgetManager appWidgetManager = null; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); LinearLayout layout = new LinearLayout(this); for(int i = 0; i < 10; ++i) { TextView tView = new TextView(this); tView.setText("___________" + i + "______________"); layout.addView(tView); } btAddShortCut = new Button(this); btAddShortCut.setText("button"); layout.addView(btAddShortCut); setContentView(layout); linearLayout = new LinearLayout(this); //其参数hostid大意是指定该AppWidgetHost 即本Activity的标记Id, 直接设置为一个整数值吧 。 mAppWidgetHost = new AppWidgetHost(AppWidgetActivity.this, HOST_ID) ; //为了保证AppWidget的及时更新 , 必须在Activity的onCreate/onStar方法调用该方法 // 当然可以在onStop方法中,调用mAppWidgetHost.stopListenering() 停止AppWidget更新 mAppWidgetHost.startListening() ; //获得AppWidgetManager对象 appWidgetManager = AppWidgetManager.getInstance(AppWidgetActivity.this) ; btAddShortCut.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //显示所有能创建AppWidget的列表 发送此 ACTION_APPWIDGET_PICK 的Action Intent pickIntent = new Intent(AppWidgetManager.ACTION_APPWIDGET_PICK) ; //向系统申请一个新的appWidgetId ,该appWidgetId与我们发送Action为ACTION_APPWIDGET_PICK // 后所选择的AppWidget绑定 。 因此,我们可以通过这个appWidgetId获取该AppWidget的信息了 //为当前所在进程申请一个新的appWidgetId int newAppWidgetId = mAppWidgetHost.allocateAppWidgetId() ; Log.i(TAG, "The new allocate appWidgetId is ----> " + newAppWidgetId) ; //作为Intent附加值 , 该appWidgetId将会与选定的AppWidget绑定 pickIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, newAppWidgetId) ; //选择某项AppWidget后,立即返回,即回调onActivityResult()方法 startActivityForResult(pickIntent , MY_REQUEST_APPWIDGET) ; } }); } // 如果 protected void onActivityResult(int requestCode, int resultCode, Intent data) { //直接返回,没有选择任何一项 ,例如按Back键 if(resultCode == RESULT_CANCELED) return ; switch(requestCode){ case MY_REQUEST_APPWIDGET : Log.i(TAG, "MY_REQUEST_APPWIDGET intent info is -----> "+data ) ; int appWidgetId = data.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID , AppWidgetManager.INVALID_APPWIDGET_ID) ; Log.i(TAG, "MY_REQUEST_APPWIDGET : appWidgetId is ----> " + appWidgetId) ; //得到的为有效的id if(appWidgetId != AppWidgetManager.INVALID_APPWIDGET_ID){ //查询指定appWidgetId的 AppWidgetProviderInfo对象 , 即在xml文件配置的<appwidget-provider />节点信息 AppWidgetProviderInfo appWidgetProviderInfo = appWidgetManager.getAppWidgetInfo(appWidgetId) ; //如果配置了configure属性 , 即android:configure = "" ,需要再次启动该configure指定的类文件,通常为一个Activity if(appWidgetProviderInfo.configure != null){ Log.i(TAG, "The AppWidgetProviderInfo configure info -----> " + appWidgetProviderInfo.configure ) ; //配置此Action Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_CONFIGURE) ; intent.setComponent(appWidgetProviderInfo.configure) ; intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId); startActivityForResult(intent , MY_CREATE_APPWIDGET) ; } else //直接创建一个AppWidget onActivityResult(MY_CREATE_APPWIDGET , RESULT_OK , data) ; //参数不同,简单回调而已 } break ; case MY_CREATE_APPWIDGET: completeAddAppWidget(data) ; break ; } } //向当前视图添加一个用户选择的 private void completeAddAppWidget(Intent data){ Bundle extra = data.getExtras() ; int appWidgetId = extra.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID , -1) ; //等同于上面的获取方式 //int appWidgetId = data.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID , AppWidgetManager.INVALID_APPWIDGET_ID) ; Log.i(TAG, "completeAddAppWidget : appWidgetId is ----> " + appWidgetId) ; if(appWidgetId == -1){ Toast.makeText(AppWidgetActivity.this, "添加窗口小部件有误", Toast.LENGTH_SHORT) ; return ; } AppWidgetProviderInfo appWidgetProviderInfo = appWidgetManager.getAppWidgetInfo(appWidgetId) ; AppWidgetHostView hostView = mAppWidgetHost.createView(AppWidgetActivity.this, appWidgetId, appWidgetProviderInfo); //linearLayout.addView(hostView) ; int widget_minWidht = appWidgetProviderInfo.minWidth ; int widget_minHeight = appWidgetProviderInfo.minHeight ; //设置长宽 appWidgetProviderInfo 对象的 minWidth 和 minHeight 属性 LinearLayout.LayoutParams linearLayoutParams = new LinearLayout.LayoutParams(widget_minWidht, widget_minHeight); //添加至LinearLayout父视图中 linearLayout.addView(hostView,linearLayoutParams) ; } }
[ "leeowenowen@gmail.com" ]
leeowenowen@gmail.com
8a315dc9059203ab8f305d02ce97076c555d9b51
fb5452e16d2518b472470c29852a193eae0e13f2
/MultiStoreyCarParkingSystem/src/main/java/com/vaani/gojek/mapper/SlotStatusMapper.java
44130427ddfdc6360e19e3fde35adb3cf3b9c683
[]
no_license
kinshuk4/KodingProbs
50af302b9eee9f8e358057360c8c16792b615830
9d060b3bbae3f8c53ec57f7b025dfe65050321a3
refs/heads/master
2022-12-05T00:55:27.018919
2018-12-13T17:13:31
2019-02-14T17:13:31
78,401,566
0
0
null
2022-11-24T05:28:29
2017-01-09T06:47:13
Java
UTF-8
Java
false
false
675
java
package com.vaani.gojek.mapper; import com.vaani.gojek.entity.ParkingStatus; import com.vaani.gojek.entity.Slot; import com.vaani.gojek.entity.Vehicle; /** * Mapper to getParkingStatus object from slot. * @author kchandra * */ public class SlotStatusMapper implements ObjectMapper<Slot,ParkingStatus> { @Override public Object convertObjects(Object o1, Object o2) { Slot s = (Slot)o1; ParkingStatus ps = (ParkingStatus)o2; Vehicle v = s.getVehicle();//s cant be null in current implementation. Avoided if to avoid cluttering if(v!=null){ ps.setColor(v.getColor()); ps.setRegNumber(v.getRegNumber()); } ps.setSlotNo(s.getId()); return ps; } }
[ "kinshuk.ram@gmail.com" ]
kinshuk.ram@gmail.com
bd56fcc52b73bbcb19c9b1fc3d70b9e8eab920ee
e1e5bd6b116e71a60040ec1e1642289217d527b0
/H5/L2Mythras/L2Mythras_2017_07_12/java/l2f/commons/net/utils/Net.java
4186aa5d166b8fbfddd563f4bc3d3e19d87b7f8f
[]
no_license
serk123/L2jOpenSource
6d6e1988a421763a9467bba0e4ac1fe3796b34b3
603e784e5f58f7fd07b01f6282218e8492f7090b
refs/heads/master
2023-03-18T01:51:23.867273
2020-04-23T10:44:41
2020-04-23T10:44:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,114
java
package l2f.commons.net.utils; /** * Presentation of the IPv4 network mask * * Supports both CIDR notation, and Apache-like. * * @author L2Mythras */ public class Net { private final int address; private final int netmask; public Net(int net, int mask) { this.address = net; this.netmask = mask; } public int address() { return this.address; } public int netmask() { return this.netmask; } public boolean isInRange(int address) { return ((address & this.netmask) == this.address); } public boolean isInRange(String address) { return isInRange(parseAddress(address)); } public static Net valueOf(String s) { int address = 0; int netmask = 0; String[] mask = s.trim().split("\\b\\/\\b"); if (mask.length < 1 || mask.length > 2) throw new IllegalArgumentException("For input string: \"" + s + "\""); if (mask.length == 1) { String[] octets = mask[0].split("\\."); if (octets.length < 1 || octets.length > 4) throw new IllegalArgumentException("For input string: \"" + s + "\""); int i; for (i = 1; i <= octets.length; i++) { if (!octets[i - 1].equals("*")) { address |= (Integer.parseInt(octets[i - 1]) << (32 - i * 8)); netmask |= (0xff << (32 - i * 8)); } } } else { address = parseAddress(mask[0]); netmask = parseNetmask(mask[1]); } return new Net(address, netmask); } public static int parseAddress(String s) throws IllegalArgumentException { int ip = 0; String[] octets = s.split("\\."); if (octets.length != 4) throw new IllegalArgumentException("For input string: \"" + s + "\""); for (int i = 1; i <= octets.length; i++) ip |= (Integer.parseInt(octets[i - 1]) << (32 - i * 8)); return ip; } public static int parseNetmask(String s) throws IllegalArgumentException { int mask = 0; String[] octets = s.split("\\."); if (octets.length == 1) { int bitmask = Integer.parseInt(octets[0]); if (bitmask < 0 || bitmask > 32) throw new IllegalArgumentException("For input string: \"" + s + "\""); mask = (0xffffffff << (32 - bitmask)); } else { for (int i = 1; i <= octets.length; i++) mask |= (Integer.parseInt(octets[i - 1]) << (32 - i * 8)); } return mask; } @Override public boolean equals(Object o) { if (o == this) return true; if (o == null) return false; if (o instanceof Net) return (((Net) o).address() == this.address && ((Net) o).netmask() == this.netmask); return false; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(address >>> 24).append("."); sb.append((address << 8) >>> 24).append("."); sb.append((address << 16) >>> 24).append("."); sb.append((address << 24) >>> 24); sb.append("/"); sb.append(netmask >>> 24).append("."); sb.append((netmask << 8) >>> 24).append("."); sb.append((netmask << 16) >>> 24).append("."); sb.append((netmask << 24) >>> 24); return sb.toString(); } }
[ "64197706+L2jOpenSource@users.noreply.github.com" ]
64197706+L2jOpenSource@users.noreply.github.com
ba4b9a2add990d816f20d90575b3b12a9cf23362
0c924da07ca254aab652b67532d8b7e57dc1cf52
/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/RestUrlBuilder.java
4e22ab7527b24ad6eb8920376cf7f2631a613340
[ "Apache-2.0" ]
permissive
qiudaoke/flowable-engine
60c9e11346af7b0dcd35f06a18f66806903a4f88
1a755206b4ced583a77f5c247c7906652b201718
refs/heads/master
2022-12-22T16:27:19.408600
2022-02-22T16:03:08
2022-02-22T16:03:08
148,082,646
2
0
Apache-2.0
2018-09-18T08:01:34
2018-09-10T01:31:14
Java
UTF-8
Java
false
false
2,652
java
/* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.flowable.cmmn.rest.service.api; import java.text.MessageFormat; import javax.servlet.http.HttpServletRequest; import org.apache.commons.lang3.StringUtils; import org.flowable.common.engine.api.FlowableIllegalArgumentException; import org.springframework.web.servlet.support.ServletUriComponentsBuilder; /** * Helper class for building URLs based on a base URL. * * An instance can be created by using {@link #fromRequest(HttpServletRequest)} and {@link #fromCurrentRequest()} which extracts the base URL from the request or by specifying the base URL through * {@link #usingBaseUrl(String)} * * {@link #buildUrl(String[], Object...)} can be called several times to build URLs based on the base URL * * @author Bassam Al-Sarori */ public class RestUrlBuilder { protected String baseUrl = ""; protected RestUrlBuilder() { } protected RestUrlBuilder(String baseUrl) { this.baseUrl = baseUrl; } public String getBaseUrl() { return baseUrl; } public String buildUrl(String[] fragments, Object... arguments) { return new StringBuilder(baseUrl).append("/").append(MessageFormat.format(StringUtils.join(fragments, '/'), arguments)).toString(); } /** Uses baseUrl as the base URL */ public static RestUrlBuilder usingBaseUrl(String baseUrl) { if (baseUrl == null) { throw new FlowableIllegalArgumentException("baseUrl can not be null"); } if (baseUrl.endsWith("/")) { baseUrl = baseUrl.substring(0, baseUrl.length() - 1); } return new RestUrlBuilder(baseUrl); } /** Extracts the base URL from the request */ public static RestUrlBuilder fromRequest(HttpServletRequest request) { return usingBaseUrl(ServletUriComponentsBuilder.fromServletMapping(request).build().toUriString()); } /** Extracts the base URL from current request */ public static RestUrlBuilder fromCurrentRequest() { return usingBaseUrl(ServletUriComponentsBuilder.fromCurrentServletMapping().build().toUriString()); } }
[ "tijs.rademakers@gmail.com" ]
tijs.rademakers@gmail.com
e43b0d91b33e90aca1a8b5143b4b8a7d2a6c2cba
f66e2ad3fc0f8c88278c0997b156f5c6c8f77f28
/JavaEE/SessionManagement/src/main/java/com/ztiany/session/dao/BookDB.java
611af64daf3738166cd80bc29498fac5de0f26eb
[ "Apache-2.0" ]
permissive
flyfire/Programming-Notes-Code
3b51b45f8760309013c3c0cc748311d33951a044
4b1bdd74c1ba0c007c504834e4508ec39f01cd94
refs/heads/master
2020-05-07T18:00:49.757509
2019-04-10T11:15:13
2019-04-10T11:15:13
180,750,568
1
0
Apache-2.0
2019-04-11T08:40:38
2019-04-11T08:40:38
null
UTF-8
Java
false
false
888
java
package com.ztiany.session.dao; import com.ztiany.session.domain.Book; import java.util.HashMap; import java.util.Map; public class BookDB { private static Map<Integer, Book> books = new HashMap<Integer, Book>(); static { books.put(1, new Book(1, "葵花宝典", "岳不群", 5, "欲练此功,必须练好基本功")); books.put(2, new Book(2, "辟邪剑法", "独孤求败", 5, "欲练此功,必须练好基本功")); books.put(3, new Book(3, "欲女心经", "小龙女", 5, "欲练此功,必须清纯")); books.put(4, new Book(4, "JavaWeb", "张孝祥", 5, "经典书籍")); books.put(5, new Book(5, "金瓶梅", "潘金莲", 5, "古典爱情")); } public static Map<Integer, Book> getAllBooks() { return books; } public static Book getBookById(int bookId) { return books.get(bookId); } }
[ "ztiany3@gmail.com" ]
ztiany3@gmail.com
8312e94d3c5cf49d6a6f13cbf5573387749a0076
7f4157724af82cc5c6607b9123b279682eb32cc5
/top-auto-sdk/src/main/java/com/dingtalk/api/request/CorpBlazersRemovemappingRequest.java
69b9d9c6451e01e9d8fe8ab40db9dc12bcffef45
[]
no_license
wangyingjief/dingding
0368880b1471a2bfcfca0611dbc98ff57109ac50
b00fb55451eb7d0f2165f9599a7be66aee02a8a2
refs/heads/master
2020-03-26T00:12:41.233087
2018-08-10T16:43:31
2018-08-10T16:43:31
144,310,543
1
0
null
null
null
null
UTF-8
Java
false
false
1,378
java
package com.dingtalk.api.request; import java.util.Map; import java.util.List; import com.taobao.api.ApiRuleException; import com.dingtalk.api.BaseDingTalkRequest; import com.dingtalk.api.DingTalkConstants; import com.taobao.api.internal.util.TaobaoHashMap; import com.taobao.api.internal.util.TaobaoUtils; import com.dingtalk.api.response.CorpBlazersRemovemappingResponse; /** * TOP DingTalk-API: dingtalk.corp.blazers.removemapping request * * @author top auto create * @since 1.0, 2018.07.25 */ public class CorpBlazersRemovemappingRequest extends BaseDingTalkRequest<CorpBlazersRemovemappingResponse> { /** * 商户唯一标识 */ private String bizId; public void setBizId(String bizId) { this.bizId = bizId; } public String getBizId() { return this.bizId; } public String getApiMethodName() { return "dingtalk.corp.blazers.removemapping"; } public String getApiCallType() { return DingTalkConstants.CALL_TYPE_TOP; } public Map<String, String> getTextParams() { TaobaoHashMap txtParams = new TaobaoHashMap(); txtParams.put("biz_id", this.bizId); if(this.udfParams != null) { txtParams.putAll(this.udfParams); } return txtParams; } public Class<CorpBlazersRemovemappingResponse> getResponseClass() { return CorpBlazersRemovemappingResponse.class; } public void check() throws ApiRuleException { } }
[ "joymting@qq.com" ]
joymting@qq.com
c863158f56f53a2249fbc04456c749ad510f97bc
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/33/33_9df87ba167cc76148cfcfcb079047b84621adf63/RouterVersion/33_9df87ba167cc76148cfcfcb079047b84621adf63_RouterVersion_s.java
7a8ad4fbb6d4ed476ee82203d847639405871174
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
1,114
java
package net.i2p.router; /* * free (adj.): unencumbered; not under the control of others * Written by jrandom in 2003 and released into the public domain * with no warranty of any kind, either expressed or implied. * It probably won't make your computer catch on fire, or eat * your children, but it might. Use at your own risk. * */ import net.i2p.CoreVersion; /** * Expose a version string * n */ public class RouterVersion { /** deprecated */ public final static String ID = "Monotone"; public final static String VERSION = CoreVersion.VERSION; public final static long BUILD = 10; /** for example "-test" */ public final static String EXTRA = "-rc"; public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA; public static void main(String args[]) { System.out.println("I2P Router version: " + FULL_VERSION); System.out.println("Router ID: " + RouterVersion.ID); System.out.println("I2P Core version: " + CoreVersion.VERSION); System.out.println("Core ID: " + CoreVersion.ID); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
b903ef824495b9dbf8a5a9fb5cb9830f95b0c561
6b2a8dd202fdce77c971c412717e305e1caaac51
/solutions_5686275109552128_1/java/Wolfje/Pancakes.java
7e3384b4dfa6d69aa7418ab29447417c561b922b
[]
no_license
alexandraback/datacollection
0bc67a9ace00abbc843f4912562f3a064992e0e9
076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf
refs/heads/master
2021-01-24T18:27:24.417992
2017-05-23T09:23:38
2017-05-23T09:23:38
84,313,442
2
4
null
null
null
null
UTF-8
Java
false
false
2,849
java
import static java.lang.Math.max; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileReader; import java.io.FileWriter; import java.io.PrintWriter; import java.util.Arrays; import java.util.Scanner; import static java.lang.Math.*; public class Pancakes { String PROBLEM_ID = "problemB"; enum TestType { EXAMPLE, SMALL, LARGE } // TestType TYPE = TestType.EXAMPLE; // TestType TYPE = TestType.SMALL; TestType TYPE = TestType.LARGE; public String getFileName() { String result = PROBLEM_ID + "_"; switch (TYPE) { case EXAMPLE: result += "example"; break; case SMALL: result += "small"; break; case LARGE: result += "large"; break; } return result; } public String getInFileName() { return getFileName() + ".in"; } public String getOutFileName() { return getFileName() + ".out"; } public static void main(String[] args) throws Exception { new Pancakes(); } public Pancakes() throws Exception { BufferedReader in = new BufferedReader(new FileReader(getInFileName())); PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter( getOutFileName()))); Scanner scan = new Scanner(in); for ( int[] a: memo) Arrays.fill(a, -1); int tests = scan.nextInt(); for (int test = 0; test < tests; test++) { int d = scan.nextInt(); int[] diners = new int[d]; for ( int i = 0; i < d; i++) diners[i] = scan.nextInt(); Arrays.sort(diners); int result1 = method1(diners); int result2 = method2(diners); int result = min(result1, result2); String resultStr = String.format("Case #%d: %d", test + 1, result); // add answer here System.out.println(resultStr); out.println(resultStr); } out.close(); System.out.println("*** in file = " + getInFileName()); System.out.println("*** out file = " + getOutFileName()); } int[][] memo = new int[1001][1001]; int go(int k, int cutoff) { if ( k <= cutoff) return 0; if ( memo[k][cutoff] >= 0 ) return memo[k][cutoff]; int result = min(go(k - cutoff, cutoff) + 1, 1 + go(k/2, cutoff) + go(k - k/2, cutoff)); return memo[k][cutoff] = result; } int method2(int[] diners) { int result = Integer.MAX_VALUE; for ( int cutoff = 1; cutoff <= diners[diners.length-1]; cutoff++) { int cost = 0; for ( int d: diners) { cost += go(d, cutoff); } result = min(result, cutoff + cost); } return result; } int method3(int[] diners) { return 0; } int method1(int[] diners) { int result = Integer.MAX_VALUE; int special = 0; int[] count = new int[1001]; for ( int d: diners) count[d]++; for ( int i = 1000; i > 0; i--) { if ( count[i] == 0 ) continue; result = min(result, special + i); special += count[i]; int z = i/2; count[z] += count[i]; count[i-z] += count[i]; } return result; } }
[ "eewestman@gmail.com" ]
eewestman@gmail.com
43a7debd5f469de194735fe53c7ad6fa1c7eb516
055165981966b1be4d9fe71c834101c03b9d6529
/OpenWGA/libraries/wga/src/main/java/de/innovationgate/wgpublisher/webtml/actions/MasterDefaultAction.java
c435808902344b7e44cc9c232a23b475468ee9c3
[]
no_license
wwjiang007/OpenWGA
ccd8b2193585373bd16f8175f8046973b1092d35
0db324fcd5822725884603795e634bca783f109e
refs/heads/master
2023-07-22T10:43:35.538439
2023-07-06T19:34:53
2023-07-06T19:34:53
129,056,118
0
0
null
2019-05-18T13:55:32
2018-04-11T07:52:51
Java
UTF-8
Java
false
false
2,081
java
/******************************************************************************* * Copyright 2009, 2010 Innovation Gate GmbH. All Rights Reserved. * * This file is part of the OpenWGA server platform. * * OpenWGA is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * In addition, a special exception is granted by the copyright holders * of OpenWGA called "OpenWGA plugin exception". You should have received * a copy of this exception along with OpenWGA in file COPYING. * If not, see <http://www.openwga.com/gpl-plugin-exception>. * * OpenWGA is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with OpenWGA in file COPYING. * If not, see <http://www.gnu.org/licenses/>. ******************************************************************************/ package de.innovationgate.wgpublisher.webtml.actions; import java.util.Map; import de.innovationgate.webgate.api.WGAPIException; import de.innovationgate.webgate.api.WGException; import de.innovationgate.wgpublisher.webtml.utils.TMLContext; public class MasterDefaultAction extends MasterAction { public MasterDefaultAction(TMLContext context, TMLAction action, TMLActionLink actionLink, Map<String,Object> objects) throws WGAPIException { super(context, action, actionLink, objects); } private Object _returnValue = null; public Object getReturnValue() { return _returnValue; } @Override public void callAction() throws WGException { TMLAction action = new TMLAction(_actionLink.getDefaultAction()); _returnValue = _context.callDefaultAction(action, _actionLink, _objects); } }
[ "ow@innovationgate.com" ]
ow@innovationgate.com
8d0e1b7fcfd5cde7d6c3919195f881d2f93cf126
05e5bee54209901d233f4bfa425eb6702970d6ab
/org/bukkit/help/IndexHelpTopic.java
72fb9b6b71a8d37eaaf9802f229980a9287dcef4
[]
no_license
TheShermanTanker/PaperSpigot-1.7.10
23f51ff301e7eb05ef6a3d6999dd2c62175c270f
ea9d33bcd075e00db27b7f26450f9dc8e6d18262
refs/heads/master
2022-12-24T10:32:09.048106
2020-09-25T15:43:22
2020-09-25T15:43:22
298,614,646
0
1
null
null
null
null
UTF-8
Java
false
false
3,632
java
/* */ package org.bukkit.help; /* */ /* */ import java.util.Collection; /* */ import org.bukkit.ChatColor; /* */ import org.bukkit.command.CommandSender; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public class IndexHelpTopic /* */ extends HelpTopic /* */ { /* */ protected String permission; /* */ protected String preamble; /* */ protected Collection<HelpTopic> allTopics; /* */ /* */ public IndexHelpTopic(String name, String shortText, String permission, Collection<HelpTopic> topics) { /* 26 */ this(name, shortText, permission, topics, (String)null); /* */ } /* */ /* */ public IndexHelpTopic(String name, String shortText, String permission, Collection<HelpTopic> topics, String preamble) { /* 30 */ this.name = name; /* 31 */ this.shortText = shortText; /* 32 */ this.permission = permission; /* 33 */ this.preamble = preamble; /* 34 */ setTopicsCollection(topics); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ protected void setTopicsCollection(Collection<HelpTopic> topics) { /* 43 */ this.allTopics = topics; /* */ } /* */ /* */ public boolean canSee(CommandSender sender) { /* 47 */ if (sender instanceof org.bukkit.command.ConsoleCommandSender) { /* 48 */ return true; /* */ } /* 50 */ if (this.permission == null) { /* 51 */ return true; /* */ } /* 53 */ return sender.hasPermission(this.permission); /* */ } /* */ /* */ /* */ public void amendCanSee(String amendedPermission) { /* 58 */ this.permission = amendedPermission; /* */ } /* */ /* */ public String getFullText(CommandSender sender) { /* 62 */ StringBuilder sb = new StringBuilder(); /* */ /* 64 */ if (this.preamble != null) { /* 65 */ sb.append(buildPreamble(sender)); /* 66 */ sb.append("\n"); /* */ } /* */ /* 69 */ for (HelpTopic topic : this.allTopics) { /* 70 */ if (topic.canSee(sender)) { /* 71 */ String lineStr = buildIndexLine(sender, topic).replace("\n", ". "); /* 72 */ if (sender instanceof org.bukkit.entity.Player && lineStr.length() > 55) { /* 73 */ sb.append(lineStr.substring(0, 52)); /* 74 */ sb.append("..."); /* */ } else { /* 76 */ sb.append(lineStr); /* */ } /* 78 */ sb.append("\n"); /* */ } /* */ } /* 81 */ return sb.toString(); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ protected String buildPreamble(CommandSender sender) { /* 92 */ return ChatColor.GRAY + this.preamble; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ protected String buildIndexLine(CommandSender sender, HelpTopic topic) { /* 104 */ StringBuilder line = new StringBuilder(); /* 105 */ line.append(ChatColor.GOLD); /* 106 */ line.append(topic.getName()); /* 107 */ line.append(": "); /* 108 */ line.append(ChatColor.WHITE); /* 109 */ line.append(topic.getShortText()); /* 110 */ return line.toString(); /* */ } /* */ } /* Location: D:\Paper-1.7.10\PaperSpigot-1.7.10-R0.1-SNAPSHOT-latest.jar!\org\bukkit\help\IndexHelpTopic.class * Java compiler version: 6 (50.0) * JD-Core Version: 1.1.3 */
[ "tanksherman27@gmail.com" ]
tanksherman27@gmail.com
ec4ef9054d9fbaa6e5f04607b6ba87de5d1b86c7
80207bd6ecae96a8dda1ec0577a91b2764564499
/jbatch/src/main/java/org/apache/batchee/container/impl/controller/FlowController.java
a4b6fda37fef2145f0ba1e44a5b95c25f665d39f
[ "Apache-2.0" ]
permissive
apache/incubator-batchee
3f167e4e6c547141c0ef06137d0236ce6373ef0a
b070be3821ef1515bd13d792052953db48d154fe
refs/heads/master
2023-07-02T17:16:47.868640
2019-06-01T14:51:16
2019-06-01T14:51:16
14,135,469
14
27
Apache-2.0
2023-05-22T19:56:21
2013-11-05T08:00:13
Java
UTF-8
Java
false
false
3,243
java
/* * Copyright 2012 International Business Machines Corp. * * See the NOTICE file distributed with this work for additional information * regarding copyright ownership. Licensed under the Apache License, * Version 2.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.batchee.container.impl.controller; import org.apache.batchee.container.Controller; import org.apache.batchee.container.ExecutionElementController; import org.apache.batchee.container.impl.JobContextImpl; import org.apache.batchee.container.impl.jobinstance.RuntimeJobExecution; import org.apache.batchee.container.navigator.ModelNavigator; import org.apache.batchee.container.navigator.NavigatorFactory; import org.apache.batchee.container.services.ServicesManager; import org.apache.batchee.container.status.ExecutionStatus; import org.apache.batchee.container.status.ExtendedBatchStatus; import org.apache.batchee.jaxb.Flow; import javax.batch.runtime.BatchStatus; import java.util.List; public class FlowController implements ExecutionElementController { private final RuntimeJobExecution jobExecution; private final JobContextImpl jobContext; private final ServicesManager manager; protected ModelNavigator<Flow> flowNavigator; protected Flow flow; private long rootJobExecutionId; private ExecutionTransitioner transitioner; public FlowController(final RuntimeJobExecution jobExecution, final Flow flow, final long rootJobExecutionId, final ServicesManager manager) { this.jobExecution = jobExecution; this.jobContext = jobExecution.getJobContext(); this.flowNavigator = NavigatorFactory.createFlowNavigator(flow); this.flow = flow; this.rootJobExecutionId = rootJobExecutionId; this.manager = manager; } @Override public ExecutionStatus execute() { if (!jobContext.getBatchStatus().equals(BatchStatus.STOPPING)) { transitioner = new ExecutionTransitioner(jobExecution, rootJobExecutionId, flowNavigator, manager); return transitioner.doExecutionLoop(); } return new ExecutionStatus(ExtendedBatchStatus.JOB_OPERATOR_STOPPING); } @Override public void stop() { // Since this is not a top-level controller, don't try to filter based on existing status.. just pass // along the stop(). final Controller stoppableElementController = transitioner.getCurrentStoppableElementController(); if (stoppableElementController != null) { stoppableElementController.stop(); } } @Override public List<Long> getLastRunStepExecutions() { return this.transitioner.getStepExecIds(); } }
[ "rmannibucau@apache.org" ]
rmannibucau@apache.org
81d5459c9bcc861794b386aa73b4bf87492621df
76d6c32e95794be4cf14075a1bffdec5bdeb75bd
/Bank/src/project/AccountInfo.java
f80bbcadfdad1bf3e7ac78435ff42f00be95aef3
[]
no_license
bamboo1991/Bank
9ec9581d4bc36e9d75c992a857f6f0361979a875
07517ec2533b224d65f78ce263c2d1d1d0301ede
refs/heads/master
2021-01-07T13:30:34.985022
2020-02-19T19:50:34
2020-02-19T19:50:34
241,710,489
0
0
null
null
null
null
UTF-8
Java
false
false
864
java
package project; public class AccountInfo { private String name; private String lastName; private Integer balance; private String city; public String getName () { return name; } public String getLastName () { return lastName; } public String getCity () { return city; } public Integer getBalance () { return balance; } public void setName (String name){ this.name = name; } public void setLastName (String lastName){ this.lastName = lastName; } public void setBalance (Integer balance){ this.balance = balance; } public void setCity (String city){ this.city = city; } public AccountInfo(String name, String lastName, Integer balance, String city) { this.name = name; this.lastName = lastName; this.balance = balance; this.city = city; } public String toString() { return name+" "+lastName+","+balance+","+city; } }
[ "stamovuber@gmail.com" ]
stamovuber@gmail.com
52948e3402301496480634a315f9f84bf0e40aa9
576b8de5e01605b67d6ca0195627f2fd592c46c9
/src/main/java/com/example/demo/controller/RegistrationController.java
b5cf98ed2d695ba9d40f741cb4b6014abc34102e
[]
no_license
h5dde45/wb230319
459d5e243717af8bebddf7537ba9efc573605299
2fab5534c67ac87b60d5f9f5ff8517bc2aa7bd99
refs/heads/master
2020-05-01T06:27:40.025373
2019-04-12T06:17:50
2019-04-12T06:17:50
177,330,854
0
0
null
null
null
null
UTF-8
Java
false
false
1,485
java
package com.example.demo.controller; import com.example.demo.domain.TempUser; import com.example.demo.service.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; @Controller public class RegistrationController { private final UserService userService; @Autowired public RegistrationController(UserService userService) { this.userService = userService; } @GetMapping("/registration") public String registration() { return "registration"; } @GetMapping("/activate/{code}") public String activate(Model model, @PathVariable String code) { boolean isActivated = userService.activateUser(code); if(isActivated){ model.addAttribute("message","User successfully activated"); }else{ model.addAttribute("message","User has already been activated previously"); } return "login"; } @PostMapping("/registration") public String addUser(TempUser tempUser, Model model) { if (!userService.addUser(tempUser)) { model.addAttribute("message", "User already exists"); return "registration"; } return "redirect:/login"; } }
[ "tmvf@yandex.ru" ]
tmvf@yandex.ru
ae747dd71b64c6d0b9022e64e4889b79b51bb47b
8edee90cb9610c51539e0e6b126de7c9145c57bc
/datastructures-validation/src/main/java/org/xbib/datastructures/validation/core/ViolationDetail.java
fa18e44ce1b6ab037d7ff4bbc9935a25e3f71aca
[ "Apache-2.0" ]
permissive
jprante/datastructures
05f3907c2acba8f743639bd8b64bde1e771bb074
efbce5bd1c67a09b9e07d2f0d4e795531cdc583b
refs/heads/main
2023-08-14T18:44:35.734136
2023-04-25T15:47:23
2023-04-25T15:47:23
295,021,623
2
0
null
null
null
null
UTF-8
Java
false
false
1,434
java
/* * Copyright (C) 2018-2022 Toshiaki Maki <makingx@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.xbib.datastructures.validation.core; import java.util.Arrays; /** * This class is intended to be used for the JSON serialization (such as Jackson) */ public class ViolationDetail { private final Object[] args; private final String defaultMessage; private final String key; public ViolationDetail(String key, Object[] args, String defaultMessage) { this.key = key; this.args = args; this.defaultMessage = defaultMessage; } public Object[] getArgs() { return args; } public String getDefaultMessage() { return defaultMessage; } public String getKey() { return key; } @Override public String toString() { return "ViolationDetail{" + "key='" + key + '\'' + ", args=" + Arrays.toString(args) + ", defaultMessage='" + defaultMessage + '\'' + '}'; } }
[ "joergprante@gmail.com" ]
joergprante@gmail.com
68c063a09e5c172f276af117033fde26e5ca031b
b49026a90363529d254c7818405a09b1c46519c5
/java_to_oracle/src/test/java/com/itheima/test/TestJavaToOracle.java
490e47280f81061d795f40aab51f43f038856e67
[]
no_license
Guo-Johnny/java
294c962ba937e5485f34ca6a6f93e0348dd90a8f
6298f55fda0e2bee569fc425f2ecca125601202b
refs/heads/master
2021-07-05T01:53:50.043877
2019-06-08T11:01:01
2019-06-08T11:01:01
190,877,646
0
0
null
2020-10-13T13:45:41
2019-06-08T11:02:49
Java
UTF-8
Java
false
false
1,686
java
package com.itheima.test; import oracle.jdbc.driver.OracleTypes; import org.junit.Test; import java.sql.*; /** * @author Johnny * @date 2019/6/5 19:49 */ public class TestJavaToOracle { @Test public void testJdbc(){ String driver = "oracle.jdbc.driver.OracleDriver"; String url = "jdbc:oracle:thin:@192.168.85.10:1521:orcl"; String username = "scott"; String password = "scott"; try { Class.forName(driver); Connection connection = DriverManager.getConnection(url, username, password); Statement statement = connection.createStatement(); ResultSet resultSet = statement.executeQuery("SELECT * FROM emp"); while (resultSet.next()){ System.out.println(resultSet.getInt("empno")+","+resultSet.getString("ename")); } } catch (Exception e) { e.printStackTrace(); } } @Test public void testProcedure(){ String driver = "oracle.jdbc.driver.OracleDriver"; String url = "jdbc:oracle:thin:@192.168.85.10:1521:orcl"; String username = "scott"; String password = "scott"; try { Class.forName(driver); Connection connection = DriverManager.getConnection(url, username, password); CallableStatement statement = connection.prepareCall("{call p_yearsal(?, ?)}"); statement.setInt(1, 7788); statement.registerOutParameter(2, OracleTypes.NUMBER); statement.execute(); System.out.println(statement.getObject(2)); } catch (Exception e) { e.printStackTrace(); } } }
[ "admin@163.com" ]
admin@163.com
dc35d659aa4a955507d58f2b56759f15af7e1ea7
2e86b630ca4762a34400670efbd298ad66cb32c3
/src/main/java/elec332/core/item/ItemEnumBased.java
172add3af06c2db6741ae10854f2f91abbc7dffb
[]
no_license
KookykraftMC/ElecCore
420e24f77f533f8c151a6ede81914e3460083c2c
c12994d07420ad9a1318ec9672aa6763f22bb870
refs/heads/master
2020-07-30T08:49:01.011670
2016-11-06T14:35:37
2016-11-06T14:35:37
73,631,855
0
0
null
2016-11-13T17:37:01
2016-11-13T17:37:01
null
UTF-8
Java
false
false
4,440
java
package elec332.core.item; import elec332.core.api.client.IColoredItem; import elec332.core.api.client.IIconRegistrar; import elec332.core.api.client.model.IElecModelBakery; import elec332.core.api.client.model.IElecQuadBakery; import elec332.core.api.client.model.IElecTemplateBakery; import elec332.core.client.RenderHelper; import elec332.core.client.model.loading.INoJsonItem; import net.minecraft.client.renderer.block.model.IBakedModel; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import javax.annotation.Nonnull; import java.util.List; /** * Created by Elec332 on 21-8-2016. */ public class ItemEnumBased<E extends Enum<E> & IEnumItem> extends AbstractItem implements INoJsonItem, IColoredItem { public ItemEnumBased(ResourceLocation rl, Class<E> clazz) { super(rl); this.clazz = clazz; this.values = clazz.getEnumConstants(); this.nji = this.values[0] instanceof INoJsonItem; this.setHasSubtypes(true); this.values[0].initializeItem(this); } @SuppressWarnings("all") protected final Class<E> clazz; protected final E[] values; private final boolean nji; @SideOnly(Side.CLIENT) private TextureAtlasSprite[][] textures; @SideOnly(Side.CLIENT) private IBakedModel[] models; public ItemStack getStackFromType(E type){ return getStackFromType(type, 1); } public ItemStack getStackFromType(E type, int amount){ return new ItemStack(this, amount, type.ordinal()); } @Override public int getColorFromItemStack(ItemStack stack, int tintIndex) { int i = stack.getItemDamage(); return i >= values.length ? -1 : values[i].getColorFromItemStack(stack, tintIndex); } @Override public void getSubItems(@Nonnull Item itemIn, CreativeTabs tab, List<ItemStack> subItems) { for (E e : values){ if (e.shouldShow()){ subItems.add(getStackFromType(e)); } } } @Override @Nonnull public String getUnlocalizedName(ItemStack stack) { E e = get(stack.getItemDamage()); String s = super.getUnlocalizedName(stack); if (e == null){ return s; } return s + "." + e.name().toLowerCase(); } @Override public void registerTextures(IIconRegistrar iconRegistrar) { textures = new TextureAtlasSprite[values.length][]; for (E e : values) { if (nji) { ((INoJsonItem)e).registerTextures(iconRegistrar); } else { ResourceLocation[] rls = e.getTextures(); textures[e.ordinal()] = new TextureAtlasSprite[rls.length]; for (int i = 0; i < rls.length; i++) { textures[e.ordinal()][i] = iconRegistrar.registerSprite(rls[i]); } } } } @Override public IBakedModel getItemModel(ItemStack stack, World world, EntityLivingBase entity) { int i = stack.getItemDamage(); E e = get(i); if (e == null){ return RenderHelper.getMissingModel(); } else { if (nji){ return ((INoJsonItem)e).getItemModel(stack, world, entity); } else { return models[i]; } } } @Override public void registerModels(IElecQuadBakery quadBakery, IElecModelBakery modelBakery, IElecTemplateBakery templateBakery) { models = new IBakedModel[values.length]; for (E e : values) { if (nji) { ((INoJsonItem)e).registerModels(quadBakery, modelBakery, templateBakery); } else { models[e.ordinal()] = modelBakery.itemModelForTextures(textures[e.ordinal()]); } } } @Override public int getDamage(ItemStack stack) { if (values.length <= super.getDamage(stack)) { stack.setItemDamage(0); } return super.getDamage(stack); } private E get(int i){ return i >= values.length ? null : values[i]; } }
[ "arnout1998@gmail.com" ]
arnout1998@gmail.com
2762f408fb8d84bab1a06f4e3489bbf4f8a51898
c9bfc24bccd6e1507db9e0c3e9a29face715be13
/LeetCode/src/com/hbc/LinkedListTest/Test01.java
057fbc26d171b4b56023fb111693dbc3d5f80ac2
[]
no_license
beerNewbie/Data-Structure
3d0158dd35ab964a8b7f9f8ee477fc278c16ec0a
1cc2db18b2ea8f3fe153eef563b097e466d0026e
refs/heads/master
2020-04-23T21:01:36.841506
2019-09-20T15:49:01
2019-09-20T15:49:01
171,457,581
1
0
null
null
null
null
UTF-8
Java
false
false
2,051
java
package com.hbc.LinkedListTest; /** * @Author: Beer * @Date: 2019/3/4 17:36 * @Description:反转一个单链表。 * 输入: 1->2->3->4->5->NULL * 输出: 5->4->3->2->1->NULL */ class ListNode { int val; ListNode next; ListNode(int x) { val = x; } } public class Test01 { public static ListNode reversList(ListNode head) { //方法1 ListNode dummyHead = new ListNode(-1); dummyHead.next = head; if (head == null || head.next == null) { return head; }else{ ListNode f = dummyHead.next; ListNode s = f.next; while(s != null) { f.next = s.next; s.next = dummyHead.next; dummyHead.next = s; s = f.next; } return dummyHead.next; } // 方法2简化版方法一 // ListNode prev = null; // ListNode cur = head; // while(cur != null) { // ListNode temp = cur.next; // cur.next = prev; // prev = cur; // cur = temp; // } // return prev; //方法3:头插法 // ListNode fir = new ListNode(-1); // //fir.next = head; // for (ListNode temp = head; temp != null; temp = temp.next) { // ListNode newNode = new ListNode(temp.val); // newNode.next = fir.next; // fir.next = newNode; // } // return fir.next; } public static void main(String[] args) { ListNode node1 = new ListNode(1); ListNode node2 = new ListNode(2); ListNode node3 = new ListNode(3); ListNode node4 = new ListNode(4); ListNode node5 = new ListNode(5); node1.next = node2; node2.next = node3; node3.next = node4; node4.next = node5; Test01 test = new Test01(); ListNode result = Test01.reversList(node1); for (ListNode temp = result; temp != null; temp = temp.next) { System.out.print(temp.val + "->"); } } }
[ "1479906877@qq.com" ]
1479906877@qq.com
82cf4e6e23e0ea9b15e59d4c7dd2c0525bd393a1
ba2eef5e3c914673103afb944dd125a9e846b2f6
/AL-Game/src/com/aionemu/gameserver/model/templates/housing/BuildingCapabilities.java
346c9316d43eef856c58831b51c9a60b566a0ad5
[]
no_license
makifgokce/Aion-Server-4.6
519d1d113f483b3e6532d86659932a266d4da2f8
0a6716a7aac1f8fe88780aeed68a676b9524ff15
refs/heads/master
2022-10-07T11:32:43.716259
2020-06-10T20:14:47
2020-06-10T20:14:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,723
java
/** * This file is part of Aion-Lightning <aion-lightning.org>. * * Aion-Lightning is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Aion-Lightning is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Aion-Lightning. * If not, see <http://www.gnu.org/licenses/>. */ package com.aionemu.gameserver.model.templates.housing; import javax.xml.bind.annotation.*; /** * @author Rolandas */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") @XmlRootElement(name = "caps") public class BuildingCapabilities { @XmlAttribute(required = true) protected boolean addon; @XmlAttribute(required = true) protected int emblemId; @XmlAttribute(required = true) protected boolean floor; @XmlAttribute(required = true) protected boolean room; @XmlAttribute(required = true) protected int interior; @XmlAttribute(required = true) protected int exterior; public boolean canHaveAddon() { return addon; } public int getEmblemId() { return emblemId; } public boolean canChangeFloor() { return floor; } public boolean canChangeRoom() { return room; } public int canChangeInterior() { return interior; } public int canChangeExterior() { return exterior; } }
[ "Falke_34@080676fd-0f56-412f-822c-f8f0d7cea3b7" ]
Falke_34@080676fd-0f56-412f-822c-f8f0d7cea3b7
cb626da6ba9f022588d561ab35ad9a1e848371d5
395e11531a072ac3f84ab6283a60a2ec9cb0e54f
/src/main/java/com/kayac/lobi/sdk/rec/unity/RecBroadcastReceiver.java
cd3e7210fb6bacce994ee572bb07fb1479a2eb99
[]
no_license
subdiox/senkan
c2b5422064735c8e9dc93907d613d2e7c23f62e4
cbe5bce08abf2b09ea6ed5da09c52c4c1cde3621
refs/heads/master
2020-04-01T20:20:01.021143
2017-07-18T10:24:01
2017-07-18T10:24:01
97,585,160
0
1
null
null
null
null
UTF-8
Java
false
false
4,452
java
package com.kayac.lobi.sdk.rec.unity; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import com.kayac.lobi.libnakamap.rec.LobiRec; import com.kayac.lobi.libnakamap.rec.a.b; import com.kayac.lobi.sdk.utils.UnityUtils; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import org.json.JSONObject; public class RecBroadcastReceiver extends BroadcastReceiver { private static final ArrayList<String> ACTIONS = new ArrayList(Arrays.asList(new String[]{LobiRec.ACTION_DRYING_UP_INSTORAGE, LobiRec.ACTION_FINISH_POST_VIDEO_ACTIVITY, LobiRec.ACTION_MOVIE_CREATED, LobiRec.ACTION_MOVIE_CREATED_ERROR, LobiRec.ACTION_MOVIE_UPLOADED, LobiRec.ACTION_MOVIE_UPLOADED_ERROR})); public static Map<String, UnityActionObserver> sObservers = new HashMap(); private static class UnityActionObserver { public String callbackMethodName; public String gameObjectName; public UnityActionObserver(String str, String str2) { this.gameObjectName = str; this.callbackMethodName = str2; } } private static boolean canReceive(String str) { return ACTIONS.contains(str); } public static void registerObserver(String str, String str2, String str3) { if (canReceive(str)) { sObservers.put(str, new UnityActionObserver(str2, str3)); } } public static void start(Context context) { IntentFilter intentFilter = new IntentFilter(); Iterator it = ACTIONS.iterator(); while (it.hasNext()) { intentFilter.addAction((String) it.next()); } context.registerReceiver(new RecBroadcastReceiver(), intentFilter); } public static void unregisterObserver(String str) { if (canReceive(str)) { sObservers.remove(str); } } public void onReceive(Context context, Intent intent) { if (intent != null) { String action = intent.getAction(); UnityActionObserver unityActionObserver = (UnityActionObserver) sObservers.get(action); if (unityActionObserver != null) { String str = ""; if (LobiRec.ACTION_MOVIE_CREATED.equals(action)) { str = intent.getStringExtra(LobiRec.EXTRA_MOVIE_CREATED_URL); action = intent.getStringExtra(LobiRec.EXTRA_MOVIE_CREATED_VIDEO_ID); JSONObject jSONObject = new JSONObject(); try { jSONObject.put("url", str); jSONObject.put("videoId", action); } catch (Throwable e) { b.a(e); } str = jSONObject.toString(); } else if (LobiRec.ACTION_FINISH_POST_VIDEO_ACTIVITY.equals(action)) { boolean booleanExtra = intent.getBooleanExtra(LobiRec.EXTRA_FINISH_POST_VIDEO_ACTIVITY_TRY_POST, false); boolean booleanExtra2 = intent.getBooleanExtra(LobiRec.EXTRA_FINISH_POST_VIDEO_ACTIVITY_TWITTER_SHARE, false); boolean booleanExtra3 = intent.getBooleanExtra(LobiRec.EXTRA_FINISH_POST_VIDEO_ACTIVITY_FACEBOOK_SHARE, false); boolean booleanExtra4 = intent.getBooleanExtra(LobiRec.EXTRA_FINISH_POST_VIDEO_ACTIVITY_YOUTUBE_SHARE, false); boolean booleanExtra5 = intent.getBooleanExtra(LobiRec.EXTRA_FINISH_POST_VIDEO_ACTIVITY_NICOVIDEO_SHARE, false); JSONObject jSONObject2 = new JSONObject(); try { jSONObject2.put("try_post", booleanExtra ? "1" : "0"); jSONObject2.put("twitter_share", booleanExtra2 ? "1" : "0"); jSONObject2.put("facebook_share", booleanExtra3 ? "1" : "0"); jSONObject2.put("youtube_share", booleanExtra4 ? "1" : "0"); jSONObject2.put("nicovideo_share", booleanExtra5 ? "1" : "0"); } catch (Throwable e2) { b.a(e2); } str = jSONObject2.toString(); } UnityUtils.unitySendMessage(unityActionObserver.gameObjectName, unityActionObserver.callbackMethodName, str); } } } }
[ "subdiox@gmail.com" ]
subdiox@gmail.com
f78a8c09302ea56632626c5c68fcc75d6bf1c246
0575519d38b04c3aaac0294e957e8bb709ba71f3
/BaseContructor/app/src/main/java/com/iblogstreet/basecontructor/activity/layout_effect_total.java
6530b159a454cdcc590a74dbeaab36fe085d5a2f
[]
no_license
sayhellotogithub/MyAndroid
36ff07a936bec245bc93f039e8c76e61a20200da
5767b3fbf9c848b06588f859d1d60f79c6f49619
refs/heads/master
2021-01-10T04:02:47.190375
2016-03-23T16:51:40
2016-03-23T16:51:40
54,399,699
0
0
null
null
null
null
UTF-8
Java
false
false
5,357
java
package com.iblogstreet.basecontructor.activity; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.Toast; import com.iblogstreet.basecontructor.R; import com.iblogstreet.basecontructor.Service.CallListenerService; import com.iblogstreet.basecontructor.activity.network.MulDownActivity; import com.iblogstreet.basecontructor.activity.network.NetSourcecodeActivity; import com.iblogstreet.basecontructor.activity.network.NetworkNewsActivity; import com.iblogstreet.basecontructor.activity.sendmessage.SendMessageActivity; /** * Created by Administrator on 2016/3/16. */ public class layout_effect_total extends Activity implements View.OnClickListener { Button button_three_union_animation, button_network_news, button_mul_down; Button button_send_message; Button button_send_broadcast, button_send_broadcast_order; Button button_phone_watch,button_phone_watch_close; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.layout_effect_total); iniView(); iniValues(); iniListener(); } private void iniView() { button_three_union_animation = (Button) findViewById(R.id.button_three_union_animation); button_network_news = (Button) findViewById(R.id.button_network_news); button_mul_down = (Button) findViewById(R.id.button_mul_down); button_send_message = (Button) findViewById(R.id.button_send_message); button_send_broadcast = (Button) findViewById(R.id.button_send_broadcast); button_send_broadcast_order = (Button) findViewById(R.id.button_send_broadcast_order); button_phone_watch=(Button)findViewById(R.id.button_phone_watch); button_phone_watch_close=(Button)findViewById(R.id.button_phone_watch_close); } private void iniListener() { button_three_union_animation.setOnClickListener(this); button_network_news.setOnClickListener(this); button_mul_down.setOnClickListener(this); button_send_message.setOnClickListener(this); button_send_broadcast.setOnClickListener(this); button_send_broadcast_order.setOnClickListener(this); button_phone_watch.setOnClickListener(this); button_phone_watch_close.setOnClickListener(this); } private void iniValues() { } @Override public void onClick(View v) { Intent intent = new Intent(); switch (v.getId()) { case R.id.button_three_union_animation: intent.setClass(layout_effect_total.this, NetSourcecodeActivity.class); Toast.makeText(layout_effect_total.this, "button_network_watcher", Toast.LENGTH_SHORT).show(); startActivity(intent); break; case R.id.button_network_news: intent.setClass(layout_effect_total.this, NetworkNewsActivity.class); Toast.makeText(layout_effect_total.this, "NetworkNewsActivity", Toast.LENGTH_SHORT).show(); startActivity(intent); break; case R.id.button_mul_down: intent.setClass(layout_effect_total.this, MulDownActivity.class); Toast.makeText(layout_effect_total.this, "MulDownActivity", Toast.LENGTH_SHORT).show(); startActivity(intent); break; case R.id.button_send_message: intent.setClass(layout_effect_total.this, SendMessageActivity.class); Toast.makeText(layout_effect_total.this, "SendMessageActivity", Toast.LENGTH_SHORT).show(); startActivity(intent); break; case R.id.button_send_broadcast://发送无序广播 intent.putExtra("data", "无序广播"); intent.setAction("com.iblogstreet.disorderbroadcast"); sendBroadcast(intent); break; case R.id.button_send_broadcast_order://发送有序广播 intent.putExtra("data", "有序广播"); intent.setAction("com.iblogstreet.orderbroadcast"); /*在 sendOrderedBroadcast 的时候我们指定 OrderReceiver 为 最终广播接收者。那么就算是之前的 MyReceiver3 将该广播终止了,OrderReceiver 依然可以接收到该广播。 这就是最终广播的特点*/ // sendOrderedBroadcast(intent,null,new OrderReceiver(),null,0,"我得到幸运",null); sendOrderedBroadcast(intent, null, null, null, 0, "我得到幸运", null); break; case R.id.button_phone_watch://开启电话监听器服务 //设置Context和服务的字节码 intent.setClass(this, CallListenerService.class); //开启服务 startService(intent); Toast.makeText(this,"开启电话监听器服务",Toast.LENGTH_SHORT).show(); break; case R.id.button_phone_watch_close://关掉电话监听器服务 break; default: break; } } @Override protected void onDestroy() { super.onDestroy(); } }
[ "wang.jun16@163.com" ]
wang.jun16@163.com
9bcea6f8f492b59a5fb2dc4d16baac93283f25a5
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/square--javapoet/5b4f979a54b18b614efd264c2b71d6df38e666a2/before/JavaFile.java
8ba8e505a152007b0c9692b143f16ce0e3690862
[]
no_license
fracz/refactor-extractor
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
dd5e82bfcc376e74a99e18c2bf54c95676914272
refs/heads/master
2021-01-19T06:50:08.211003
2018-11-30T13:00:57
2018-11-30T13:00:57
87,353,478
0
0
null
null
null
null
UTF-8
Java
false
false
2,521
java
/* * Copyright (C) 2015 Square, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.squareup.javawriter.builders; import com.google.common.collect.ImmutableMap; import com.squareup.javawriter.ClassName; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; /** A Java file containing a single top level class. */ public final class JavaFile { public final TypeSpec typeSpec; private JavaFile(Builder builder) { this.typeSpec = checkNotNull(builder.typeSpec); } public String toString() { // First pass: emit the entire class, just to collect the types we'll need to import. ImmutableMap<ClassName, String> noImports = ImmutableMap.of(); CodeWriter importsCollector = new CodeWriter(new StringBuilder(), noImports); emit(noImports, importsCollector); ImmutableMap<ClassName, String> suggestedImports = importsCollector.suggestedImports(); // Second pass: Write the code, taking advantage of the imports. StringBuilder result = new StringBuilder(); CodeWriter codeWriter = new CodeWriter(result, suggestedImports); emit(suggestedImports, codeWriter); return result.toString(); } private void emit(ImmutableMap<ClassName, String> imports, CodeWriter codeWriter) { codeWriter.emit("package $L;\n", typeSpec.name.packageName()); if (!imports.isEmpty()) { codeWriter.emit("\n"); for (ClassName className : imports.keySet()) { codeWriter.emit("import $L;\n", className); } } codeWriter.emit("\n"); typeSpec.emit(codeWriter, null); } public static final class Builder { private TypeSpec typeSpec; public Builder classSpec(TypeSpec typeSpec) { checkArgument(!typeSpec.name.enclosingClassName().isPresent(), "Cannot create a JavaFile for %s", typeSpec.name); this.typeSpec = typeSpec; return this; } public JavaFile build() { return new JavaFile(this); } } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
823fa48e88032a08c8b4169bd6148f83440301c3
471e466790fc5efdf2948d144a10dadf7144b6dc
/gateway-study/src/main/java/com/yicj/study/gateway/factory/predicate/TimeBetweenRoutePredicateFactory.java
758ea6c468b093ee684098365dec1d8ddbc6773d
[]
no_license
yichengjie/spring-cloud-study5
0ac600855aeaf51684b4fe944e996f71524eb871
b32b292067f3764a9db82221928001a8cf2f5a2e
refs/heads/master
2023-02-22T20:52:01.143844
2021-01-27T03:02:45
2021-01-27T03:02:45
324,572,547
0
0
null
null
null
null
UTF-8
Java
false
false
1,409
java
package com.yicj.study.gateway.factory.predicate; import com.yicj.study.gateway.factory.predicate.properties.TimeBetweenConfig; import org.springframework.cloud.gateway.handler.predicate.AbstractRoutePredicateFactory; import org.springframework.stereotype.Component; import org.springframework.web.server.ServerWebExchange; import java.time.LocalTime; import java.util.Arrays; import java.util.List; import java.util.function.Predicate; // 需要实现两个方法shortcutFieldOrder与apply @Component public class TimeBetweenRoutePredicateFactory extends AbstractRoutePredicateFactory<TimeBetweenConfig> { public TimeBetweenRoutePredicateFactory() { super(TimeBetweenConfig.class); } // 配置配置类和配置文件的映射关系的 @Override public List<String> shortcutFieldOrder() { //TimeBetween=9:00, 17:00 //配置TimeBetweenConfig与predicate工厂配置对应关系 // 对应的start属性映射 9:00 , end属性映射17:00 return Arrays.asList("start","end"); } @Override public Predicate<ServerWebExchange> apply(TimeBetweenConfig config) { LocalTime start = config.getStart(); LocalTime end = config.getEnd(); return exchange -> { LocalTime now = LocalTime.now(); return now.isAfter(start) && now.isBefore(end); }; } }
[ "626659321@qq.com" ]
626659321@qq.com
2fa177a59f4f9a8febb644d626bdcfdcdaaa4e0a
e45c1dfb23bca19f3d6f7a566b4c685cafe0aca1
/java_example1/src/java_example_20180525/member.java
374c40d9416704e4e6be273f36925efb020f6d04
[]
no_license
wnguds1/wnguds1
94ce069fe87f562d4282ae3023017a9ee1a20b76
9e1484b9127423995c3efd3516bbc98cc72e2c45
refs/heads/master
2020-03-18T20:59:24.971650
2018-05-29T06:49:33
2018-05-29T06:49:33
135,251,284
0
0
null
null
null
null
UTF-8
Java
false
false
324
java
package java_example_20180525; public class member { String id; int password; boolean login(String id, int password) { if(id.equals("yourid") && password==12345) { return true; }else { return false; } } void logout(String id){ System.out.println("로그아웃되었습니다."); } }
[ "user@user-PC" ]
user@user-PC
32dbfcda79468a875478aba19d83662f342e2ff8
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XCOMMONS-928-1-3-MOEAD-WeightedSum:TestLen:CallDiversity/org/xwiki/extension/repository/internal/installed/DefaultInstalledExtensionRepository_ESTest_scaffolding.java
d8a81504fb7dbd84f1c38006c12c1086eb20bd1f
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
489
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Tue Apr 07 16:25:12 UTC 2020 */ package org.xwiki.extension.repository.internal.installed; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class DefaultInstalledExtensionRepository_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
b42167f145d7d59aa5ec01930c45bd5a9d62ab76
9e20645e45cc51e94c345108b7b8a2dd5d33193e
/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/events/impl/creature/OnElementalSpiritUpgrade.java
018a283d1c530ab76ec953510b18f8af6a133753
[]
no_license
Enryu99/L2jMobius-01-11
2da23f1c04dcf6e88b770f6dcbd25a80d9162461
4683916852a03573b2fe590842f6cac4cc8177b8
refs/heads/master
2023-09-01T22:09:52.702058
2021-11-02T17:37:29
2021-11-02T17:37:29
423,405,362
2
2
null
null
null
null
UTF-8
Java
false
false
1,582
java
/* * This file is part of the L2J Mobius project. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.l2jmobius.gameserver.model.events.impl.creature; import org.l2jmobius.gameserver.model.ElementalSpirit; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.events.EventType; import org.l2jmobius.gameserver.model.events.impl.IBaseEvent; /** * @author JoeAlisson */ public class OnElementalSpiritUpgrade implements IBaseEvent { private final ElementalSpirit _spirit; private final PlayerInstance _player; public OnElementalSpiritUpgrade(PlayerInstance player, ElementalSpirit spirit) { _player = player; _spirit = spirit; } public ElementalSpirit getSpirit() { return _spirit; } public PlayerInstance getPlayer() { return _player; } @Override public EventType getType() { return EventType.ON_ELEMENTAL_SPIRIT_UPGRADE; } }
[ "MobiusDevelopment@7325c9f8-25fd-504a-9f63-8876acdc129b" ]
MobiusDevelopment@7325c9f8-25fd-504a-9f63-8876acdc129b
a8104811ede90c9c83cad6a5d7029a2697f06a73
70f7a06017ece67137586e1567726579206d71c7
/alimama/src/main/java/com/ali/telescope/internal/plugins/startPref/StartUpBeginBean.java
6d36da0587470ec9bfb9dbf7a3e0e8a31caeee92
[]
no_license
liepeiming/xposed_chatbot
5a3842bd07250bafaffa9f468562021cfc38ca25
0be08fc3e1a95028f8c074f02ca9714dc3c4dc31
refs/heads/master
2022-12-20T16:48:21.747036
2020-10-14T02:37:49
2020-10-14T02:37:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
485
java
package com.ali.telescope.internal.plugins.startPref; import com.ali.telescope.base.report.IReportBean; import com.ali.telescope.internal.report.ProtocolConstants; public class StartUpBeginBean implements IReportBean { private long startTime; public StartUpBeginBean(long j) { this.startTime = j; } public long getTime() { return this.startTime; } public short getType() { return ProtocolConstants.EVENT_APP_START_UP_BEGIN; } }
[ "zhangquan@snqu.com" ]
zhangquan@snqu.com
f9b37f943b69b22c5903a09b9781e916ef271a2d
df9cbec0d25686b36a934bedf002534daf039b90
/transport/scp-transport/src/main/java/org/apache/airavata/mft/transport/scp/Main.java
f0d63ebc7d7ac73e2f9c8282f23a54c6ad3ce3bd
[ "Apache-2.0" ]
permissive
isururanawaka/airavata-mft
f00a55919fab424b0236ba3727a0be6e1dcab65f
ce2e3ad27c985acb5bf5fabf5984ef4d9d4aff3f
refs/heads/master
2022-06-04T06:43:35.446364
2019-08-08T15:10:50
2019-08-08T15:10:50
201,394,423
0
0
Apache-2.0
2019-08-09T05:14:08
2019-08-09T05:14:07
null
UTF-8
Java
false
false
3,891
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.airavata.mft.transport.scp; import org.apache.airavata.mft.core.streaming.TransportMetadata; import org.apache.airavata.mft.core.streaming.TransportStream; import org.apache.airavata.mft.transport.s3.S3Receiver; import org.apache.airavata.mft.transport.s3.S3Sender; import org.apache.airavata.mft.transport.s3.S3TransportOperator; import java.io.IOException; public class Main { public static void main(final String[] arg) throws Exception { TransportMetadata metadata = new TransportMetadata(); SCPTransportOperator operator = new SCPTransportOperator(); //S3TransportOperator operator = new S3TransportOperator(); metadata.setLength(operator.getResourceSize("1")); final TransportStream stream = new TransportStream("1", "4", metadata); Runnable r1 = new Runnable() { @Override public void run() { int asInt; try { long read = 0; while (true) { if (stream.getInputStream().available() > 0) { asInt = stream.getInputStream().read(); read++; //char c = (char)asInt; //System.out.print(c); } else { if (stream.isStreamCompleted()) { break; } else { try { Thread.sleep(100); System.out.println("Waiting " + read); } catch (InterruptedException e) { e.printStackTrace(); } } } } } catch (IOException e) { e.printStackTrace(); } } }; Runnable receiverRun = new Runnable() { @Override public void run() { SCPReceiver receiver = new SCPReceiver(); //S3Receiver receiver = new S3Receiver(); try { receiver.receive(stream); } catch (Exception e) { e.printStackTrace(); } } }; Runnable senderRun = new Runnable() { @Override public void run() { //SCPSender sender = new SCPSender(); S3Sender sender = new S3Sender(); try { sender.send(stream); } catch (Exception e) { e.printStackTrace(); } } }; //Thread t1 = new Thread(r1); //t1.start(); Thread senderThread = new Thread(senderRun); senderThread.start(); Thread receiverThread = new Thread(receiverRun); receiverThread.start(); System.out.println("Done"); } }
[ "dimuthu.upeksha2@gmail.com" ]
dimuthu.upeksha2@gmail.com
0f83ce478044b3f6c6901acf041f333784860835
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/9/9_93398814fb622e1a0ccfe7cf9ede463f806544fe/version/9_93398814fb622e1a0ccfe7cf9ede463f806544fe_version_t.java
f87247248e661bfa43395501f8acc9a3bcddec0c
[]
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
363
java
package com.sun.tools.javac.resources; import java.util.ListResourceBundle; public final class version extends ListResourceBundle { protected final Object[][] getContents() { return new Object[][] { { "full", "1.6.0_ceylon" }, { "jdk", "1.6.0_ceylon" }, { "release", "1.6.0_ceylon" }, }; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
fa7318f33602ea7e844fb77becbf1ed3fb7a48f1
ad01d3afcadd5b163ecf8ba60ba556ea268b4827
/deiedrp/trunk/OLAS/src/in/ac/dei/edrp/client/RPCFiles/CM_connectServiceLoader.java
e7e3d853fd0a69a1958d3a69725f0b99be8e060d
[]
no_license
ynsingh/repos
64a82c103f0033480945fcbb567b599629c4eb1b
829ad133367014619860932c146c208e10bb71e0
refs/heads/master
2022-04-18T11:39:24.803073
2020-04-08T09:39:43
2020-04-08T09:39:43
254,699,274
1
2
null
null
null
null
UTF-8
Java
false
false
539
java
package in.ac.dei.edrp.client.RPCFiles; import com.google.gwt.core.client.GWT; import com.google.gwt.user.client.rpc.ServiceDefTarget; public class CM_connectServiceLoader { public static CM_connectAsync getService() { CM_connectAsync calService = (CM_connectAsync) GWT.create(CM_connect.class); ServiceDefTarget target = (ServiceDefTarget) calService; String moduleRelativeURL = GWT.getModuleBaseURL() + "hello1"; target.setServiceEntryPoint(moduleRelativeURL); return calService; } }
[ "ynsingh@0c22728b-0eb9-4c4e-a44d-29de7e55569f" ]
ynsingh@0c22728b-0eb9-4c4e-a44d-29de7e55569f
5f5e1f829fdd1e3d956313d7424e38f71710288c
e14e25c5b4c7c1ffcb4b8af588d811a1ca8791ec
/src/rlgs4/Quick.java
0c5df22642c83fed183796400627db1c9e912627
[]
no_license
BurningBright/algorithms-fourth-edition
6ecd434ebc42449f5f05da1e6d6a94ef64eaab57
46ad5a29154b8094a2cd169308b9922131a74587
refs/heads/master
2021-01-24T07:13:27.408150
2021-01-08T02:42:30
2021-01-08T02:42:30
55,818,397
0
0
null
null
null
null
UTF-8
Java
false
false
5,728
java
package rlgs4; import stdlib.*; /************************************************************************* * Compilation: javac Quick.java * Execution: java Quick < input.txt * Dependencies: StdOut.java StdIn.java * Data files: http://algs4.cs.princeton.edu/23quicksort/tiny.txt * http://algs4.cs.princeton.edu/23quicksort/words3.txt * * Sorts a sequence of strings from standard input using quicksort. * * % more tiny.txt * S O R T E X A M P L E * * % java Quick < tiny.txt * A E E L M O P R S T X [ one string per line ] * * % more words3.txt * bed bug dad yes zoo ... all bad yet * * % java Quick < words3.txt * all bad bed bug dad ... yes yet zoo [ one string per line ] * * * Remark: For a type-safe version that uses static generics, see * * http://algs4.cs.princeton.edu/23quicksort/QuickPedantic.java * *************************************************************************/ /** * The <tt>Quick</tt> class provides static methods for sorting an * array and selecting the ith smallest element in an array using quicksort. * <p> * For additional documentation, see <a href="http://algs4.cs.princeton.edu/21elementary">Section 2.1</a> of * <i>Algorithms, 4th Edition</i> by Robert Sedgewick and Kevin Wayne. * * @author Robert Sedgewick * @author Kevin Wayne */ public class Quick { // This class should not be instantiated. private Quick() { } /** * Rearranges the array in ascending order, using the natural order. * @param a the array to be sorted */ @SuppressWarnings("rawtypes") public static void sort(Comparable[] a) { StdRandom.shuffle(a); sort(a, 0, a.length - 1); } // quicksort the subarray from a[lo] to a[hi] @SuppressWarnings("rawtypes") private static void sort(Comparable[] a, int lo, int hi) { if (hi <= lo) return; int j = partition(a, lo, hi); sort(a, lo, j-1); sort(a, j+1, hi); assert isSorted(a, lo, hi); } // partition the subarray a[lo..hi] so that a[lo..j-1] <= a[j] <= a[j+1..hi] // and return the index j. @SuppressWarnings("rawtypes") private static int partition(Comparable[] a, int lo, int hi) { int i = lo; int j = hi + 1; Comparable v = a[lo]; while (true) { // find item on lo to swap while (less(a[++i], v)) if (i == hi) break; // find item on hi to swap while (less(v, a[--j])) if (j == lo) break; // redundant since a[lo] acts as sentinel // check if pointers cross if (i >= j) break; exch(a, i, j); } // put partitioning item v at a[j] exch(a, lo, j); // now, a[lo .. j-1] <= a[j] <= a[j+1 .. hi] return j; } /** * Rearranges the array so that a[k] contains the kth smallest key; * a[0] through a[k-1] are less than (or equal to) a[k]; and * a[k+1] through a[N-1] are greater than (or equal to) a[k]. * @param a the array * @param k find the kth smallest */ @SuppressWarnings("rawtypes") public static Comparable select(Comparable[] a, int k) { if (k < 0 || k >= a.length) { throw new IndexOutOfBoundsException("Selected element out of bounds"); } StdRandom.shuffle(a); int lo = 0, hi = a.length - 1; while (hi > lo) { int i = partition(a, lo, hi); if (i > k) hi = i - 1; else if (i < k) lo = i + 1; else return a[i]; } return a[lo]; } /*********************************************************************** * Helper sorting functions ***********************************************************************/ // is v < w ? @SuppressWarnings({ "rawtypes", "unchecked" }) private static boolean less(Comparable v, Comparable w) { return (v.compareTo(w) < 0); } // exchange a[i] and a[j] private static void exch(Object[] a, int i, int j) { Object swap = a[i]; a[i] = a[j]; a[j] = swap; } /*********************************************************************** * Check if array is sorted - useful for debugging ***********************************************************************/ @SuppressWarnings({ "rawtypes", "unused" }) private static boolean isSorted(Comparable[] a) { return isSorted(a, 0, a.length - 1); } @SuppressWarnings("rawtypes") private static boolean isSorted(Comparable[] a, int lo, int hi) { for (int i = lo + 1; i <= hi; i++) if (less(a[i], a[i-1])) return false; return true; } // print array to standard output @SuppressWarnings("rawtypes") private static void show(Comparable[] a) { for (int i = 0; i < a.length; i++) { StdOut.println(a[i]); } } /** * Reads in a sequence of strings from standard input; quicksorts them; * and prints them to standard output in ascending order. * Shuffles the array and then prints the strings again to * standard output, but this time, using the select method. */ public static void main(String[] args) { String[] a = StdIn.readAllStrings(); Quick.sort(a); show(a); // shuffle StdRandom.shuffle(a); // display results again using select StdOut.println(); for (int i = 0; i < a.length; i++) { String ith = (String) Quick.select(a, i); StdOut.println(ith); } } }
[ "lcg51271@gmail.com" ]
lcg51271@gmail.com
f0498552dee9bbca7eb04297b852a06249b5cbb4
cbb75ebbee3fb80a5e5ad842b7a4bb4a5a1ec5f5
/org/apache/http/HttpClientConnection.java
c685c3488ec3983c97fab15a9aa06a7183de27fe
[]
no_license
killbus/jd_decompile
9cc676b4be9c0415b895e4c0cf1823e0a119dcef
50c521ce6a2c71c37696e5c131ec2e03661417cc
refs/heads/master
2022-01-13T03:27:02.492579
2018-05-14T11:21:30
2018-05-14T11:21:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
626
java
package org.apache.http; import java.io.IOException; /* compiled from: TbsSdkJava */ public interface HttpClientConnection extends HttpConnection { void flush() throws IOException; boolean isResponseAvailable(int i) throws IOException; void receiveResponseEntity(HttpResponse httpResponse) throws HttpException, IOException; HttpResponse receiveResponseHeader() throws HttpException, IOException; void sendRequestEntity(HttpEntityEnclosingRequest httpEntityEnclosingRequest) throws HttpException, IOException; void sendRequestHeader(HttpRequest httpRequest) throws HttpException, IOException; }
[ "13511577582@163.com" ]
13511577582@163.com
bb66520a34a631af9f1de3e36327e2daa3ee33df
f52d89e3adb2b7f5dc84337362e4f8930b3fe1c2
/com.fudanmed.platform.core.web/src/main/java/com/fudanmed/platform/core/web/client/organization/InputNextOrganizationEvent.java
c7a8513207500d4af8407e3f1f2b9b2066094ea8
[]
no_license
rockguo2015/med
a4442d195e04f77c6c82c4b82b9942b6c5272892
b3db5a4943e190370a20cc4fac8faf38053ae6ae
refs/heads/master
2016-09-08T01:30:54.179514
2015-05-18T10:23:02
2015-05-18T10:23:02
34,060,096
0
0
null
null
null
null
UTF-8
Java
false
false
870
java
package com.fudanmed.platform.core.web.client.organization; import com.fudanmed.platform.core.domain.proxy.RCOrganizationProxy; import com.fudanmed.platform.core.web.client.organization.InputNextOrganizationHandler; import com.google.gwt.event.shared.GwtEvent; import com.google.gwt.event.shared.GwtEvent.Type; public class InputNextOrganizationEvent extends GwtEvent<InputNextOrganizationHandler> { public static Type<InputNextOrganizationHandler> __type__ = new Type<InputNextOrganizationHandler>(); public Type<InputNextOrganizationHandler> getAssociatedType() { return __type__; } public void dispatch(final InputNextOrganizationHandler handler) { handler.InputNextOrganization(parent); } private RCOrganizationProxy parent; public InputNextOrganizationEvent(final RCOrganizationProxy parent) { this.parent=parent; } }
[ "rock.guo@me.com" ]
rock.guo@me.com
571778201af246ed0f812073bae7202860a04595
1be3c58802588e168d02fd40600c996699abaed4
/oap-server/server-configuration/configuration-etcd/src/main/java/org/apache/skywalking/oap/server/configuration/etcd/EtcdConfigException.java
4eaaf3b8aae7c68dbb07000a09e75bbc89d77cc8
[ "Apache-2.0", "BSD-3-Clause" ]
permissive
zhentaoJin/skywalking
e73a4dd612e01d93981345444a462c47096d6ab5
dbce5f5cce2cd8ed26ce6d662f2bd6d5a0886bc1
refs/heads/master
2021-04-09T23:40:19.407603
2020-11-05T15:13:29
2020-11-05T15:13:29
305,288,772
6
0
Apache-2.0
2020-10-19T06:48:38
2020-10-19T06:48:38
null
UTF-8
Java
false
false
1,090
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.skywalking.oap.server.configuration.etcd; /** * exception type throw by Etcd Configuration. */ public class EtcdConfigException extends RuntimeException { public EtcdConfigException(String message, Throwable cause) { super(message, cause); } }
[ "wu.sheng@foxmail.com" ]
wu.sheng@foxmail.com
efa167e2072ef67e5b45fb29a51adfe8ee6a59cc
0d36e8d7aa9727b910cb2ed6ff96eecb4444b782
/pelion-sdk-core/src/main/java/com/arm/mbed/cloud/sdk/common/listing/IdPaginator.java
7398762a976fdd9ea597a57c66abd8564905c828
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
PelionIoT/mbed-cloud-sdk-java
b6d93f7e22c5afa30a51329b60e0f33c042ef00e
cc99c51db43cc9ae36601f20f20b7d8cd7515432
refs/heads/master
2023-08-19T01:25:29.548242
2020-07-01T16:48:16
2020-07-01T16:48:16
95,459,293
0
1
Apache-2.0
2021-01-15T08:44:08
2017-06-26T15:06:56
Java
UTF-8
Java
false
false
2,059
java
package com.arm.mbed.cloud.sdk.common.listing; import com.arm.mbed.cloud.sdk.annotations.Preamble; import com.arm.mbed.cloud.sdk.common.MbedCloudException; /** * Iterator over all the elements of a list without requiring the developer to create and process all the individual * requests. This Paginator should be used as the primary way of listing entities. Paginators can be configured to * return only a maximum number of results if existing (i.e. parameter {@code maxResult}) or to set the page size in * order to tweak underlying http communications (i.e. parameter {@code pageSize}). * <P> * Note: This paginator is an iterator over IDs. * */ @Preamble(description = "ID iterator over an entire result set of a truncated/paginated API operation.") public class IdPaginator extends AbstractPaginator<String, IdListResponse, IdPageRequester> { public IdPaginator(ListOptions options, IdPageRequester requester) throws MbedCloudException { super(options, requester); } public IdPaginator(ListOptions options, IdPageRequester requester, IdListResponse firstPage) throws MbedCloudException { super(options, requester, firstPage); // TODO Auto-generated constructor stub } /* * (non-Javadoc) * * @see java.lang.Object#clone() */ @Override public IdPaginator clone() throws CloneNotSupportedException { try { final IdPaginator clone = new IdPaginator(cloneListOptions(), getRequester(), cloneCurrentPage()); clone.setProperties(this); return clone; } catch (@SuppressWarnings("unused") MbedCloudException exception) { // Nothing to do } throw new CloneNotSupportedException(); } @Override protected String cloneCurrentElement() { final String currentElement = current(); return (currentElement == null) ? null : String.valueOf(currentElement); } @Override protected String fetchAfterId(String last) { return last; } }
[ "adrien.cabarbaye@arm.com" ]
adrien.cabarbaye@arm.com
ba47316906c390d0f19c71481db1228de82db845
31f194c8c897e025e01701ce35dc77dc5bfd275c
/L1J/src/com/lineage/server/model/skill/stop/SkillStopIllusionist.java
e338de1fe6c3ff12c4f0be72a9e1e7c49d287855
[]
no_license
danceking/l1jcn-zwb
6404547566b63e0c0d6e510d45202bba78e010b6
d146a1807fc5b62632f35b87eaf500ecc6c902e9
refs/heads/master
2020-06-26T02:04:35.671127
2012-09-18T08:32:11
2012-09-18T08:32:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,349
java
package com.lineage.server.model.skill.stop; import static com.lineage.server.model.skill.L1SkillId.BONE_BREAK_END; import static com.lineage.server.model.skill.L1SkillId.BONE_BREAK_START; import static com.lineage.server.model.skill.L1SkillId.CONCENTRATION; import static com.lineage.server.model.skill.L1SkillId.ILLUSION_AVATAR; import static com.lineage.server.model.skill.L1SkillId.ILLUSION_DIA_GOLEM; import static com.lineage.server.model.skill.L1SkillId.ILLUSION_LICH; import static com.lineage.server.model.skill.L1SkillId.ILLUSION_OGRE; import static com.lineage.server.model.skill.L1SkillId.INSIGHT; import static com.lineage.server.model.skill.L1SkillId.MIRROR_IMAGE; import static com.lineage.server.model.skill.L1SkillId.PANIC; import static com.lineage.server.model.skill.L1SkillId.STATUS_CUBE_BALANCE; import static com.lineage.server.model.skill.L1SkillId.STATUS_CUBE_IGNITION_TO_ALLY; import static com.lineage.server.model.skill.L1SkillId.STATUS_CUBE_IGNITION_TO_ENEMY; import static com.lineage.server.model.skill.L1SkillId.STATUS_CUBE_QUAKE_TO_ALLY; import static com.lineage.server.model.skill.L1SkillId.STATUS_CUBE_QUAKE_TO_ENEMY; import static com.lineage.server.model.skill.L1SkillId.STATUS_CUBE_SHOCK_TO_ALLY; import static com.lineage.server.model.skill.L1SkillId.STATUS_CUBE_SHOCK_TO_ENEMY; import static com.lineage.server.model.skill.L1SkillId.STATUS_MR_REDUCTION_BY_CUBE_SHOCK; import com.lineage.server.model.L1Character; import com.lineage.server.model.Instance.L1MonsterInstance; import com.lineage.server.model.Instance.L1NpcInstance; import com.lineage.server.model.Instance.L1PcInstance; import com.lineage.server.model.Instance.L1PetInstance; import com.lineage.server.model.Instance.L1SummonInstance; import com.lineage.server.serverpackets.S_OwnCharAttrDef; import com.lineage.server.serverpackets.S_PacketBox; import com.lineage.server.serverpackets.S_Paralysis; import com.lineage.server.serverpackets.S_SPMR; /** * 技能停止:幻术师 * * @author jrwz */ public class SkillStopIllusionist implements L1SkillStop { @Override public void stopSkill(final L1Character cha, final int skillId) { switch (skillId) { case MIRROR_IMAGE: // 镜像 if (cha instanceof L1PcInstance) { final L1PcInstance pc = (L1PcInstance) cha; pc.addDodge((byte) -5); // 闪避率 - 50% // 更新闪避率显示 pc.sendPackets(new S_PacketBox(88, pc.getDodge())); } break; case ILLUSION_OGRE: // 幻觉:欧吉 cha.addDmgup(-4); cha.addHitup(-4); cha.addBowDmgup(-4); cha.addBowHitup(-4); break; case ILLUSION_LICH: // 幻觉:巫妖 cha.addSp(-2); if (cha instanceof L1PcInstance) { final L1PcInstance pc = (L1PcInstance) cha; pc.sendPackets(new S_SPMR(pc)); } break; case ILLUSION_DIA_GOLEM: // 幻觉:钻石高仑 cha.addAc(20); break; case ILLUSION_AVATAR: // 幻觉:化身 cha.addDmgup(-10); cha.addBowDmgup(-10); break; case INSIGHT: // 洞察 cha.addStr((byte) -1); cha.addCon((byte) -1); cha.addDex((byte) -1); cha.addWis((byte) -1); cha.addInt((byte) -1); break; case PANIC: // 恐慌 cha.addStr((byte) 1); cha.addCon((byte) 1); cha.addDex((byte) 1); cha.addWis((byte) 1); cha.addInt((byte) 1); break; case BONE_BREAK_START: // 骷髅毁坏 (发动) if (cha instanceof L1PcInstance) { final L1PcInstance pc = (L1PcInstance) cha; pc.sendPackets(new S_Paralysis(S_Paralysis.TYPE_STUN, true)); pc.setSkillEffect(BONE_BREAK_END, 1 * 1000); } else if ((cha instanceof L1MonsterInstance) || (cha instanceof L1SummonInstance) || (cha instanceof L1PetInstance)) { final L1NpcInstance npc = (L1NpcInstance) cha; npc.setParalyzed(true); npc.setSkillEffect(BONE_BREAK_END, 1 * 1000); } break; case BONE_BREAK_END: // 骷髅毁坏 (结束) if (cha instanceof L1PcInstance) { final L1PcInstance pc = (L1PcInstance) cha; pc.sendPackets(new S_Paralysis(S_Paralysis.TYPE_STUN, false)); } else if ((cha instanceof L1MonsterInstance) || (cha instanceof L1SummonInstance) || (cha instanceof L1PetInstance)) { final L1NpcInstance npc = (L1NpcInstance) cha; npc.setParalyzed(false); } break; case CONCENTRATION: // 专注 if (cha instanceof L1PcInstance) { final L1PcInstance pc = (L1PcInstance) cha; pc.addMpr(-2); } break; case STATUS_CUBE_IGNITION_TO_ALLY: // 立方:燃烧 (友方) cha.addFire(-30); if (cha instanceof L1PcInstance) { final L1PcInstance pc = (L1PcInstance) cha; pc.sendPackets(new S_OwnCharAttrDef(pc)); } break; case STATUS_CUBE_QUAKE_TO_ALLY: // 立方:地裂 (友方) cha.addEarth(-30); if (cha instanceof L1PcInstance) { final L1PcInstance pc = (L1PcInstance) cha; pc.sendPackets(new S_OwnCharAttrDef(pc)); } break; case STATUS_CUBE_SHOCK_TO_ALLY: // 立方:冲击 (友方) cha.addWind(-30); if (cha instanceof L1PcInstance) { final L1PcInstance pc = (L1PcInstance) cha; pc.sendPackets(new S_OwnCharAttrDef(pc)); } break; case STATUS_CUBE_IGNITION_TO_ENEMY: // 立方:燃烧 (敌方) // XXX break; case STATUS_CUBE_QUAKE_TO_ENEMY: // 立方:地裂 (敌方) // XXX break; case STATUS_CUBE_SHOCK_TO_ENEMY: // 立方:冲击 (敌方) // XXX break; case STATUS_MR_REDUCTION_BY_CUBE_SHOCK: // 由于 立方:冲击 (敌方)MR减少 // cha.addMr(10); // if (cha instanceof L1PcInstance) { // L1PcInstance pc = (L1PcInstance) cha; // pc.sendPackets(new S_SPMR(pc)); // } break; case STATUS_CUBE_BALANCE: // 立方:和谐 // XXX break; } } }
[ "zhaowenbing20121013@gmail.com" ]
zhaowenbing20121013@gmail.com
f7629796349d73ec89581657dcc228f0dff72830
a00326c0e2fc8944112589cd2ad638b278f058b9
/src/main/java/000/143/088/CWE789_Uncontrolled_Mem_Alloc__connect_tcp_HashSet_14.java
e47837a30ac3225c2006fb8523bc76cf74e09da3
[]
no_license
Lanhbao/Static-Testing-for-Juliet-Test-Suite
6fd3f62713be7a084260eafa9ab221b1b9833be6
b095b11c7cb6d4a5bb2b76181e35d6ee00e96e68
refs/heads/master
2020-08-24T13:34:04.004149
2019-10-25T09:26:00
2019-10-25T09:26:00
216,822,684
0
1
null
2019-11-08T09:51:54
2019-10-22T13:37:13
Java
UTF-8
Java
false
false
6,484
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE789_Uncontrolled_Mem_Alloc__connect_tcp_HashSet_14.java Label Definition File: CWE789_Uncontrolled_Mem_Alloc.int.label.xml Template File: sources-sink-14.tmpl.java */ /* * @description * CWE: 789 Uncontrolled Memory Allocation * BadSource: connect_tcp Read data using an outbound tcp connection * GoodSource: A hardcoded non-zero, non-min, non-max, even number * BadSink: HashSet Create a HashSet using data as the initial size * Flow Variant: 14 Control flow: if(IO.staticFive==5) and if(IO.staticFive!=5) * * */ import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.IOException; import java.net.Socket; import java.util.logging.Level; import java.util.HashSet; public class CWE789_Uncontrolled_Mem_Alloc__connect_tcp_HashSet_14 extends AbstractTestCase { /* uses badsource and badsink */ public void bad() throws Throwable { int data; if (IO.staticFive == 5) { data = Integer.MIN_VALUE; /* Initialize data */ /* Read data using an outbound tcp connection */ { Socket socket = null; BufferedReader readerBuffered = null; InputStreamReader readerInputStream = null; try { /* Read data using an outbound tcp connection */ socket = new Socket("host.example.org", 39544); /* read input from socket */ readerInputStream = new InputStreamReader(socket.getInputStream(), "UTF-8"); readerBuffered = new BufferedReader(readerInputStream); /* POTENTIAL FLAW: Read data using an outbound tcp connection */ String stringNumber = readerBuffered.readLine(); if (stringNumber != null) /* avoid NPD incidental warnings */ { try { data = Integer.parseInt(stringNumber.trim()); } catch(NumberFormatException exceptNumberFormat) { IO.logger.log(Level.WARNING, "Number format exception parsing data from string", exceptNumberFormat); } } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error with stream reading", exceptIO); } finally { /* clean up stream reading objects */ try { if (readerBuffered != null) { readerBuffered.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing BufferedReader", exceptIO); } try { if (readerInputStream != null) { readerInputStream.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing InputStreamReader", exceptIO); } /* clean up socket objects */ try { if (socket != null) { socket.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing Socket", exceptIO); } } } } else { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run * but ensure data is inititialized before the Sink to avoid compiler errors */ data = 0; } /* POTENTIAL FLAW: Create a HashSet using data as the initial size. data may be very large, creating memory issues */ HashSet intHashSet = new HashSet(data); } /* goodG2B1() - use goodsource and badsink by changing IO.staticFive==5 to IO.staticFive!=5 */ private void goodG2B1() throws Throwable { int data; if (IO.staticFive != 5) { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run * but ensure data is inititialized before the Sink to avoid compiler errors */ data = 0; } else { /* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */ data = 2; } /* POTENTIAL FLAW: Create a HashSet using data as the initial size. data may be very large, creating memory issues */ HashSet intHashSet = new HashSet(data); } /* goodG2B2() - use goodsource and badsink by reversing statements in if */ private void goodG2B2() throws Throwable { int data; if (IO.staticFive == 5) { /* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */ data = 2; } else { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run * but ensure data is inititialized before the Sink to avoid compiler errors */ data = 0; } /* POTENTIAL FLAW: Create a HashSet using data as the initial size. data may be very large, creating memory issues */ HashSet intHashSet = new HashSet(data); } public void good() throws Throwable { goodG2B1(); goodG2B2(); } /* Below is the main(). It is only used when building this testcase on * its own for testing or for building a binary to use in testing binary * analysis tools. It is not used when compiling all the testcases as one * application, which is how source code analysis tools are tested. */ public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException { mainFromParent(args); } }
[ "anhtluet12@gmail.com" ]
anhtluet12@gmail.com
fed628b9b68453cd2e8b8c346e45bd49fc306ea2
e9ad092dfc4efe87fe49e3d3083482311f765731
/lang/src/main/java/nl/knaw/dans/common/lang/mail/DansMailerConfiguration.java
5a86dd64f1b6a0dfc3cdd18c2b4f546c56063acf
[ "Apache-2.0" ]
permissive
DANS-KNAW/dccd-legacy-libs
e0f863cc5953dcceb9b91d4eb6ffdd0d37831bbb
687d2e434359ad80af0b192748475ec4a76529c4
refs/heads/master
2021-01-01T19:35:17.114074
2019-09-03T13:58:30
2019-09-03T13:58:30
37,195,178
0
1
Apache-2.0
2020-10-13T06:53:30
2015-06-10T12:15:06
Java
UTF-8
Java
false
false
4,047
java
/******************************************************************************* * Copyright 2015 DANS - Data Archiving and Networked Services * * 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 nl.knaw.dans.common.lang.mail; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; /** * Configuration of a {@link Mailer} instance. * * @author Joke Pol * */ public final class DansMailerConfiguration extends CommonMailerConfiguration implements MailerConfiguration { /** The default value for the SMTP host. */ public static final String SMTP_HOST_DEFAULT = "mailrelay.knaw.nl"; /** Default value for the senders e-mail address. */ public static final String FROM_ADDRESS_DEFAULT = "info@dans.knaw.nl"; /** Default value for the senders name. */ public static final String FROM_NAME_DEFAULT = "DANS Team"; /** Lazy initialization to catch exceptions */ private static MailerConfiguration defaultInstance = null; /** * Creates a customized instance. * * @param input The customized configuration values. * @throws IOException IOException If an error occurred when reading from the input stream. * @throws IllegalArgumentException If the input stream contains a malformed UniCode escape * sequence. */ public DansMailerConfiguration(final InputStream inputStream) throws IOException { super(inputStream); if (getSmtpHost() == null) setSmtpHost(SMTP_HOST_DEFAULT); if (getSenderName() == null) setSenderName(FROM_NAME_DEFAULT); if (getFromAddress() == null) setFromAddress(FROM_ADDRESS_DEFAULT); } /** * Creates a customized instance. Calls {@link #MailerProperties(InputStream)} with a wrapped * string. * * @param input The customized configuration values. If {@link #SMTP_HOST_KEY} is not specified, * no host will be set and no mails will be sent. * @return A customized instance. * @throws MailerConfiguration.Exception An unexpected {@link IOException} of * {@link #MailerProperties(InputStream)} is turned into a runtime exception. */ public static MailerConfiguration createCustomized(final String input) throws Exception { try { final InputStream inputStream = input == null ? (InputStream) null : new ByteArrayInputStream(input.getBytes()); return new DansMailerConfiguration(inputStream); } catch (final IOException exception) { throw new Exception("Unexpected exception", exception); } } /** * Gets a default instance. Calls {@link #MailerProperties(InputStream)} with a null argument. * * @return A default instance. * @throws MailerConfiguration.Exception An unexpected {@link IOException} of * {@link #MailerProperties(InputStream)} is turned into a runtime exception. */ public static MailerConfiguration getDefaultInstance() throws Exception { if (defaultInstance == null) { try { defaultInstance = new DansMailerConfiguration((InputStream) null); } catch (final IOException e) { throw new Exception("Unexpected exception", e); } } return defaultInstance; } }
[ "jan.van.mansum@dans.knaw.nl" ]
jan.van.mansum@dans.knaw.nl
7e88b99d14b976c8b85710856e7b007bdb4f23cb
b0ae678de708af2569a8d45fc8931f9550f1aa4d
/src/com/javarush/test/level06/lesson11/home01/Solution.java
6ce5de7af73e09635ecfc493ea1a0533286d695b
[]
no_license
solbon/javarush
c09b673f7adab61b8df36fdebd0facca08561af7
4522d99515364536d8efc0b273fb2ff881b66c91
refs/heads/master
2021-01-19T02:48:07.422761
2016-11-01T13:21:04
2016-11-01T13:21:04
53,571,322
0
0
null
2016-03-11T11:53:31
2016-03-10T09:18:32
Java
UTF-8
Java
false
false
1,180
java
package com.javarush.test.level06.lesson11.home01; /* Класс Cat и статическая переменная catCount В классе Cat создай статическую переменную public int catCount. Создай конструктор [public Cat()]. Пусть при каждом создании кота (нового объекта Cat) статическая переменная catCount увеличивается на 1. Создать 10 объектов Cat и вывести значение переменной catCount на экран. */ public class Solution { public static void main(String[] args) { //Cоздай 10 объектов Cat тут for (int i = 0; i < 10; i++) { new Cat(); } // Выведи на экран catCount тут System.out.println(Cat.catCount); } public static class Cat { //Cоздай статическую переменную тут public static int catCount; //создай конструктор тут public Cat() { catCount++; } } }
[ "solbon@gmail.com" ]
solbon@gmail.com
34a4b5d77219db672b8a60369110a3b4bf330c3d
e16b11beb066bb96c168f070ceb7d8cb9ee254bc
/src/main/java/br/gabrielsmartins/healthservice/adapters/persistence/entity/PersonEntity.java
d62e9845724b4af90cf25190931b3c6685dffd1c
[]
no_license
gabrielsmartins/health-service
458c3f5900eeec1f5cd5a66d3dbb216c79b8c13f
969793822e65cc48bb8ca712e0712f02d7b4c3dc
refs/heads/master
2023-04-20T12:54:42.371861
2021-05-16T16:04:17
2021-05-16T16:04:17
361,031,081
4
0
null
null
null
null
UTF-8
Java
false
false
819
java
package br.gabrielsmartins.healthservice.adapters.persistence.entity; import lombok.*; import org.springframework.data.annotation.Id; import org.springframework.data.relational.core.mapping.Column; import org.springframework.data.relational.core.mapping.Table; import java.io.Serializable; import java.time.LocalDate; import java.util.UUID; @Data @EqualsAndHashCode(of = "id") @AllArgsConstructor @NoArgsConstructor @Builder(setterPrefix = "with") @Table("tbl_person") public class PersonEntity implements Serializable { @Id @Column("person_id") private UUID id; @Column("person_first_name") private String firstName; @Column("person_last_name") private String lastName; @Column("person_dob") private LocalDate dob; @Column("person_gender") private String gender; }
[ "ga.smartins94@gmail.com" ]
ga.smartins94@gmail.com
cabddbf0d9a315b40fb17acb0fa57f279bc31942
c742cc5d181dd6105a26d586f513177a18e28250
/src/revision/Graph_lc_evaluation_division.java
474e5c103a0277b295ceaa21613f5b7ecab1d385
[]
no_license
gaurirawat/Coding
a5542f71be5da538cc438a8d4070ce4c748ee044
d69fb40befbf9a30774b723fff90ae7cba384f7a
refs/heads/master
2023-02-20T00:33:31.632223
2021-01-22T11:49:14
2021-01-22T11:49:14
275,333,532
1
1
null
null
null
null
UTF-8
Java
false
false
1,722
java
package revision; import java.util.*; //https://leetcode.com/problems/evaluate-division/ public class Graph_lc_evaluation_division { public double[] calcEquation(List<List<String>> eq, double[] v, List<List<String>> q) { HashMap<String,Integer> map=new HashMap<String, Integer>(); int nov=0; for(int i=0;i<eq.size();++i) { if(map.get(eq.get(i).get(0))==null) map.put(eq.get(i).get(0),nov++); if(map.get(eq.get(i).get(1))==null) map.put(eq.get(i).get(1),nov++); } double[][] g= new double[nov][nov]; for(int i=0;i<eq.size();++i) { int x=map.get(eq.get(i).get(0)); int y=map.get(eq.get(i).get(1)); g[x][y]=v[i]; g[y][x]=1/v[i]; } double[] ans=new double[q.size()]; for(int i=0;i<q.size();++i) { if(map.get(q.get(i).get(0))==null||map.get(q.get(i).get(1))==null) { ans[i]=-1; } else{ int x=map.get(q.get(i).get(0)); int y=map.get(q.get(i).get(1)); boolean[] visited=new boolean[nov]; ans[i]=dfsEq(x,y,1D,g,visited); } } return ans; } public double dfsEq(int s, int d, double prod, double[][]g, boolean[] visited) { if(s==d) { return 1*prod; } visited[s]=true; double ans=-1; for(int i=0;i<g.length;++i) { if(!visited[i] && g[s][i]!=0) { ans=dfsEq( i, d, prod*g[s][i], g, visited); if(ans!=-1) { break; } } } return ans; } }
[ "gaurirawat97@gmail.com" ]
gaurirawat97@gmail.com
3170f5c7467d416f76c1281b0100353177a72197
329307375d5308bed2311c178b5c245233ac6ff1
/src/com/tencent/mm/pluginsdk/wallet/c.java
fae3d8a2164b8a2d0082bcd00b6e9fc1a2a472bd
[]
no_license
ZoneMo/com.tencent.mm
6529ac4c31b14efa84c2877824fa3a1f72185c20
dc4f28aadc4afc27be8b099e08a7a06cee1960fe
refs/heads/master
2021-01-18T12:12:12.843406
2015-07-05T03:21:46
2015-07-05T03:21:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,807
java
package com.tencent.mm.pluginsdk.wallet; import android.content.Context; import android.content.Intent; import android.os.Bundle; import com.tencent.mm.d.a.dl; import com.tencent.mm.d.a.dl.a; import com.tencent.mm.model.v; import com.tencent.mm.sdk.c.a; import com.tencent.mm.sdk.platformtools.bn; import com.tencent.mm.ui.MMActivity; import com.tencent.mm.ui.MMActivity.a; public final class c { public static PayInfo a(String paramString1, String paramString2, String paramString3, String paramString4, int paramInt1, int paramInt2) { paramString3 = new PayInfo(); dlx = paramString1; appId = paramString2; gvU = null; aBU = paramInt1; ayr = null; bQy = 0; return paramString3; } public static boolean a(Context paramContext, int paramInt, String paramString) { Intent localIntent = new Intent(); localIntent.putExtra("scene", paramInt); localIntent.putExtra("receiver_name", paramString); if (v.se()) { com.tencent.mm.aj.c.c(paramContext, "wallet_payu", ".remittance.ui.PayURemittanceAdapterUI", localIntent); } for (;;) { return true; com.tencent.mm.aj.c.c(paramContext, "remittance", ".ui.RemittanceAdapterUI", localIntent); } } public static boolean a(Context paramContext, Bundle paramBundle, boolean paramBoolean) { Intent localIntent = new Intent(); localIntent.putExtra("orderhandlerui_checkapp_result", paramBoolean); if (paramBundle != null) { localIntent.putExtras(paramBundle); } com.tencent.mm.aj.c.c(paramContext, "wallet_index", ".ui.OrderHandlerUI", localIntent); return true; } public static boolean a(Context paramContext, PayInfo paramPayInfo, int paramInt) { return a(paramContext, false, "", paramPayInfo, paramInt); } public static boolean a(Context paramContext, String paramString1, String paramString2, int paramInt1, int paramInt2) { if (bn.iW(paramString1)) { return false; } return a(paramContext, a(paramString1, paramString2, null, null, paramInt1, 0), paramInt2); } public static boolean a(Context paramContext, boolean paramBoolean, String paramString, PayInfo paramPayInfo, int paramInt) { Intent localIntent = new Intent(); if ((2 == aBU) || (1 == aBU) || (4 == aBU) || (36 == aBU)) { hfK = false; if ((aBU != 4) && (aBU != 1) && (36 != aBU)) { break label135; } } label135: for (hfL = true;; hfL = false) { localIntent.putExtra("key_pay_info", paramPayInfo); localIntent.putExtra("key_force_use_bind_serail", bn.iV(paramString)); localIntent.putExtra("key_is_force_use_given_card", paramBoolean); if (!v.se()) { break label143; } com.tencent.mm.aj.c.a(paramContext, "wallet_payu", ".pay.ui.WalletPayUPayUI", localIntent, paramInt); return true; hfK = true; break; } label143: com.tencent.mm.aj.c.a(paramContext, "wallet", ".pay.ui.WalletPayUI", localIntent, paramInt); return true; } public static boolean a(MMActivity paramMMActivity, b paramb, int paramInt, MMActivity.a parama) { Intent localIntent = new Intent(); localIntent.putExtra("appId", appId); localIntent.putExtra("timeStamp", aBQ); localIntent.putExtra("nonceStr", aBP); localIntent.putExtra("packageExt", aBR); localIntent.putExtra("signtype", aBO); localIntent.putExtra("paySignature", aBS); localIntent.putExtra("url", url); localIntent.putExtra("bizUsername", aBT); localIntent.putExtra("pay_channel", aBW); ipR = parama; com.tencent.mm.aj.c.a(paramMMActivity, "wallet_index", ".ui.WalletBrandUI", localIntent, paramInt, false); return true; } public static boolean b(MMActivity paramMMActivity, b paramb, int paramInt, MMActivity.a parama) { Intent localIntent = new Intent(); localIntent.putExtra("appId", appId); localIntent.putExtra("timeStamp", aBQ); localIntent.putExtra("nonceStr", aBP); localIntent.putExtra("packageExt", aBR); localIntent.putExtra("signtype", aBO); localIntent.putExtra("paySignature", aBS); localIntent.putExtra("url", url); localIntent.putExtra("key_bind_scene", aBV); ipR = parama; com.tencent.mm.aj.c.a(paramMMActivity, "wallet", ".bind.ui.WalletBindUI", localIntent, paramInt, false); return true; } public static void cx(Context paramContext) { dl localdl = new dl(); a.hXQ.g(localdl); Intent localIntent = new Intent(); localIntent.putExtra("ftf_receiver_true_name", bn.U(azw.azx, "")); localIntent.putExtra("ftf_pay_url", bn.U(azw.azy, "")); if (!v.se()) {} for (boolean bool = true;; bool = false) { localIntent.putExtra("ftf_can_set_amount", bool); com.tencent.mm.aj.c.c(paramContext, "collect", ".ui.CollectMainUI", localIntent); return; } } public static boolean q(Context paramContext, int paramInt) { Intent localIntent = new Intent(); localIntent.putExtra("key_bind_scene", 5); localIntent.putExtra("key_offline_add_fee", paramInt); com.tencent.mm.aj.c.c(paramContext, "wallet", ".bind.ui.WalletBindUI", localIntent); return true; } public static boolean r(Context paramContext, int paramInt) { Intent localIntent = new Intent(); localIntent.putExtra("key_scene_balance_manager", paramInt); if (v.se()) { com.tencent.mm.aj.c.c(paramContext, "wallet_payu", ".balance.ui.WalletPayUBalanceManagerUI", localIntent); } for (;;) { return true; com.tencent.mm.aj.c.c(paramContext, "wallet", ".balance.ui.WalletBalanceManagerUI", localIntent); } } } /* Location: * Qualified Name: com.tencent.mm.pluginsdk.wallet.c * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "reverseengineeringer@hackeradmin.com" ]
reverseengineeringer@hackeradmin.com
fcfba11691de971284fc8c0b62ea74d299198ac4
b2efa6c35e99114492f86e2dfb086ed60b600dce
/app/src/main/java/com/example/waheguru_ji/finalweather/Helper/Helper.java
05ac0dddc2206d42a0ae147b2d4cfcb436d3f43c
[]
no_license
RishabhShridhar/Weather
2764cacb91d6abc29a43f1461f5236858dfa895d
b7e7b0b52355d4f9fb6374d72cb9908e5874d042
refs/heads/master
2021-01-20T07:13:10.474086
2017-05-02T01:32:34
2017-05-02T01:32:34
89,978,746
0
2
null
2017-10-04T05:10:41
2017-05-02T01:32:31
Java
UTF-8
Java
false
false
1,279
java
package com.example.waheguru_ji.finalweather.Helper; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; /** * Created by WAHEGURU-JI on 20-03-2017. */ public class Helper { static String stream = null; public Helper() { } public String getHTTPData(String urlString){ try { URL url = new URL(urlString); HttpURLConnection httpURLConnection = (HttpURLConnection)url.openConnection(); if(httpURLConnection.getResponseCode() == 200) // OK - 200 { BufferedReader r = new BufferedReader(new InputStreamReader(httpURLConnection.getInputStream())); StringBuilder sb = new StringBuilder(); String line; while((line = r.readLine())!=null) sb.append(line); stream = sb.toString(); httpURLConnection.disconnect(); } } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return stream; } }
[ "you@example.com" ]
you@example.com
3c05822c019ebee795420651cd7785dfe53d8bd4
e4b1d9b159abebe01b934f0fd3920c60428609ae
/src/main/java/org/proteored/miapeapi/xml/ge/autogenerated/FuGECommonProtocolGenericActionType.java
54487ec90842bbe39b4b355ed198846c383771f9
[ "Apache-2.0" ]
permissive
smdb21/java-miape-api
83ba33cc61bf2c43c4049391663732c9cc39a718
5a49b49a3fed97ea5e441e85fe2cf8621b4e0900
refs/heads/master
2022-12-30T15:28:24.384176
2020-12-16T23:48:07
2020-12-16T23:48:07
67,961,174
0
0
Apache-2.0
2022-12-16T03:22:23
2016-09-12T00:01:29
Java
UTF-8
Java
false
false
7,994
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-257 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2011.07.18 at 02:51:38 PM CEST // package org.proteored.miapeapi.xml.ge.autogenerated; 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.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * A GenericAction represents a step within a GenericProtocol. It allows a reference to a sub-GenericProtocol, user entered text to describe the GenericAction or a term from a controlled vocabulary to be given. * * <p>Java class for FuGE.Common.Protocol.GenericActionType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="FuGE.Common.Protocol.GenericActionType"> * &lt;complexContent> * &lt;extension base="{}FuGE.Common.Protocol.ActionType"> * &lt;sequence> * &lt;element name="actionTerm" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element ref="{}cvParam"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;element ref="{}GenericParameter" maxOccurs="unbounded" minOccurs="0"/> * &lt;element ref="{}ParameterPair" maxOccurs="unbounded" minOccurs="0"/> * &lt;/sequence> * &lt;attribute name="actionText" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="Protocol_ref" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "FuGE.Common.Protocol.GenericActionType", propOrder = { "actionTerm", "genericParameter", "parameterPair" }) public class FuGECommonProtocolGenericActionType extends FuGECommonProtocolActionType { protected FuGECommonProtocolGenericActionType.ActionTerm actionTerm; @XmlElement(name = "GenericParameter") protected List<FuGECommonProtocolGenericParameterType> genericParameter; @XmlElement(name = "ParameterPair") protected List<FuGECommonProtocolParameterPairType> parameterPair; @XmlAttribute protected String actionText; @XmlAttribute(name = "Protocol_ref") protected String protocolRef; /** * Gets the value of the actionTerm property. * * @return * possible object is * {@link FuGECommonProtocolGenericActionType.ActionTerm } * */ public FuGECommonProtocolGenericActionType.ActionTerm getActionTerm() { return actionTerm; } /** * Sets the value of the actionTerm property. * * @param value * allowed object is * {@link FuGECommonProtocolGenericActionType.ActionTerm } * */ public void setActionTerm(FuGECommonProtocolGenericActionType.ActionTerm value) { this.actionTerm = value; } /** * The parameters belonging to the GenericAction. Gets the value of the genericParameter 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 genericParameter property. * * <p> * For example, to add a new item, do as follows: * <pre> * getGenericParameter().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link FuGECommonProtocolGenericParameterType } * * */ public List<FuGECommonProtocolGenericParameterType> getGenericParameter() { if (genericParameter == null) { genericParameter = new ArrayList<FuGECommonProtocolGenericParameterType>(); } return this.genericParameter; } /** * ParameterPairs owned by the GenericAction. The TargetParameter should reference a Parameter owned by a child Protocol which is also referenced by the GenericAction. Gets the value of the parameterPair 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 parameterPair property. * * <p> * For example, to add a new item, do as follows: * <pre> * getParameterPair().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link FuGECommonProtocolParameterPairType } * * */ public List<FuGECommonProtocolParameterPairType> getParameterPair() { if (parameterPair == null) { parameterPair = new ArrayList<FuGECommonProtocolParameterPairType>(); } return this.parameterPair; } /** * Gets the value of the actionText property. * * @return * possible object is * {@link String } * */ public String getActionText() { return actionText; } /** * Sets the value of the actionText property. * * @param value * allowed object is * {@link String } * */ public void setActionText(String value) { this.actionText = value; } /** * Gets the value of the protocolRef property. * * @return * possible object is * {@link String } * */ public String getProtocolRef() { return protocolRef; } /** * Sets the value of the protocolRef property. * * @param value * allowed object is * {@link String } * */ public void setProtocolRef(String value) { this.protocolRef = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element ref="{}cvParam"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "cvParam" }) public static class ActionTerm { @XmlElement(required = true) protected FuGECommonOntologyCvParamType cvParam; /** * Gets the value of the cvParam property. * * @return * possible object is * {@link FuGECommonOntologyCvParamType } * */ public FuGECommonOntologyCvParamType getCvParam() { return cvParam; } /** * Sets the value of the cvParam property. * * @param value * allowed object is * {@link FuGECommonOntologyCvParamType } * */ public void setCvParam(FuGECommonOntologyCvParamType value) { this.cvParam = value; } } }
[ "salvador@scripps.edu" ]
salvador@scripps.edu
fccf66b32b5d9dff29cf2c345d820393eb721016
f2a5398b84cfaa46fde61a6e180c9abeb92c1a5f
/demos/geotk-demo-samples/src/main/java/org/geotoolkit/pending/demo/rendering/customgraphicbuilder/LinksGraphicBuilder.java
d57b54aac67fd911b91f22e2def475db26ea5500
[]
no_license
glascaleia/geotoolkit-pending
32b3a15ff0c82508af6fc3ee99033724bf0bc85e
e3908e9dfefc415169f80787cff8c94af4afce17
refs/heads/master
2020-05-20T11:09:44.894361
2012-03-29T14:43:34
2012-03-29T14:43:34
3,219,051
0
0
null
null
null
null
UTF-8
Java
false
false
1,206
java
package org.geotoolkit.pending.demo.rendering.customgraphicbuilder; import java.awt.Image; import java.util.Collection; import java.util.Collections; import org.geotoolkit.display.exception.PortrayalException; import org.geotoolkit.display2d.canvas.J2DCanvas; import org.geotoolkit.display2d.primitive.GraphicJ2D; import org.geotoolkit.map.FeatureMapLayer; import org.geotoolkit.map.GraphicBuilder; import org.geotoolkit.map.MapLayer; import org.opengis.display.canvas.Canvas; public class LinksGraphicBuilder implements GraphicBuilder<GraphicJ2D>{ @Override public Collection<GraphicJ2D> createGraphics(MapLayer layer, Canvas canvas) { if(layer instanceof FeatureMapLayer && canvas instanceof J2DCanvas){ final J2DCanvas rc = (J2DCanvas) canvas; final FeatureMapLayer fl = (FeatureMapLayer) layer; return Collections.singletonList((GraphicJ2D)new LinksGraphic(rc, fl)); } return Collections.emptyList(); } @Override public Class<GraphicJ2D> getGraphicType() { return GraphicJ2D.class; } @Override public Image getLegend(MapLayer layer) throws PortrayalException { return null; } }
[ "johann.sorel@geomatys.fr" ]
johann.sorel@geomatys.fr
f464cdcf33bb3d06e4da65049e6bca3c8b04fb91
4fb4603578010499b0e2ae39497199838d2d072c
/branches/icefaces4_ICE-10145/icefaces/samples/showcase/showcase/src/main/java/org/icefaces/samples/showcase/example/ace/dataTable/DataTableRowState.java
c4247872003dbf2206e45a79973eb7fe93f7df6a
[ "Apache-2.0" ]
permissive
svn2github/icefaces-4-3
5f05a89225a6543725d69ed79e33b695f5d333b8
c6cea194d02b5536256ff7c81a3a697f1890ff74
refs/heads/master
2020-04-08T17:31:09.320358
2018-12-13T23:20:36
2018-12-13T23:20:36
159,570,706
0
0
null
null
null
null
UTF-8
Java
false
false
7,757
java
/* * Copyright 2004-2013 ICEsoft Technologies Canada Corp. * * 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.icefaces.samples.showcase.example.ace.dataTable; import org.icefaces.ace.component.column.Column; import org.icefaces.ace.component.datatable.DataTable; import org.icefaces.ace.model.table.RowState; import org.icefaces.ace.model.table.RowStateMap; import org.icefaces.samples.showcase.example.ace.dataTable.Car; import org.icefaces.samples.showcase.metadata.annotation.ComponentExample; import org.icefaces.samples.showcase.metadata.annotation.ExampleResource; import org.icefaces.samples.showcase.metadata.annotation.ExampleResources; import org.icefaces.samples.showcase.metadata.annotation.ResourceType; import org.icefaces.samples.showcase.metadata.context.ComponentExampleImpl; import javax.annotation.PostConstruct; import javax.faces.bean.CustomScoped; import javax.faces.bean.ManagedBean; import javax.faces.event.ActionEvent; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import java.util.Collection; import org.icefaces.samples.showcase.dataGenerators.utilityClasses.DataTableData; import org.icefaces.samples.showcase.util.FacesUtils; @ComponentExample( parent = DataTableBean.BEAN_NAME, title = "example.ace.dataTable.rowstate.title", description = "example.ace.dataTable.rowstate.description", example = "/resources/examples/ace/dataTable/dataTableRowState.xhtml" ) @ExampleResources( resources ={ // xhtml @ExampleResource(type = ResourceType.xhtml, title="dataTableRowState.xhtml", resource = "/resources/examples/ace/dataTable/dataTableRowState.xhtml"), // Java Source @ExampleResource(type = ResourceType.java, title="DataTableRowState.java", resource = "/WEB-INF/classes/org/icefaces/samples/showcase"+ "/example/ace/dataTable/DataTableRowState.java"), @ExampleResource(type = ResourceType.java, title="Car.java", resource = "/WEB-INF/classes/org/icefaces/samples/showcase"+ "/example/ace/dataTable/Car.java") } ) @ManagedBean(name= DataTableRowState.BEAN_NAME) @CustomScoped(value = "#{window}") public class DataTableRowState extends ComponentExampleImpl<DataTableRowState> implements Serializable { public static final String BEAN_NAME = "dataTableRowState"; private RowStateMap stateMap = new RowStateMap(); private List<Car> selection; private List<Car> carsData; /////////////---- CONSTRUCTOR BEGIN public DataTableRowState() { super(DataTableRowState.class); carsData = new ArrayList<Car>(DataTableData.getDefaultData()); } public Class getClazz() { return getClass(); } @PostConstruct public void initMetaData() { super.initMetaData(); } /////////////---- GETTERS & SETTERS BEGIN public RowStateMap getStateMap() { return stateMap; } public void setStateMap(RowStateMap stateMap) { this.stateMap = stateMap; } public List<Car> getSelection() { return stateMap.getSelected(); } public void setSelection(List<Car> selection) {} public List<Car> getCarsData() { return carsData; } public void setCarsData(List<Car> carsData) { this.carsData = carsData; } /////////////---- ACTION LISTENERS BEGIN public void enableAllSelection(ActionEvent e) { stateMap.setAllSelectable(true); } public void disableSelection(ActionEvent e) { for (Object rowData : stateMap.getSelected()) { RowState s = stateMap.get(rowData); s.setSelectable(false); s.setSelected(false); } } public void disableAllSelection(ActionEvent e) { stateMap.setAllSelectable(false); for (Object rowData : stateMap.getSelected()) { RowState s = stateMap.get(rowData); s.setSelected(false); } } public void enableAllVisibility(ActionEvent e) { stateMap.setAllVisible(true); } public void disableVisibility(ActionEvent e) { for (Object rowData : stateMap.getSelected()) { RowState s = stateMap.get(rowData); s.setVisible(false); s.setSelected(false); } } public void disableAllVisibility(ActionEvent e) { stateMap.setAllVisible(false); } public void enableAllEditing(ActionEvent e) { stateMap.setAllEditable(true); } public void enableEditing(ActionEvent e) { for (Object rowData : stateMap.getSelected()) { RowState s = stateMap.get(rowData); s.setEditable(true); s.setSelected(false); } } public void disableEditing(ActionEvent e) { for (Object rowData : stateMap.getSelected()) { RowState s = stateMap.get(rowData); s.setEditable(false); s.setSelected(false); } } public void disableAllEditing(ActionEvent e) { stateMap.setAllEditable(false); } public void startAllEditing(ActionEvent e) { DataTable table = ((DataTableBindings)(FacesUtils.getManagedBean("dataTableBindings"))).getTable(this.getClass()); Collection<RowState> allRows = stateMap.values(); List<Column> columns = table.getColumns(); // Start by making everything editable for (Column c : columns) { if (c.getCellEditor() != null) { stateMap.setAllEditing(c.getCellEditor(), true); } } // Make any disabled editing rows uneditable for (RowState s : allRows) { if (!s.isEditable()) { for (Column c : columns) { s.removeActiveCellEditor(c.getCellEditor()); } } } } public void startEditing(ActionEvent e) { DataTable table = ((DataTableBindings)(FacesUtils.getManagedBean("dataTableBindings"))).getTable(this.getClass()); List<Column> columns = table.getColumns(); for (Object rowData : stateMap.getSelected()) { RowState s = stateMap.get(rowData); if (s.isEditable()) { for (Column c : columns) { s.addActiveCellEditor(c.getCellEditor()); } } } } public void stopEditing(ActionEvent e) { DataTable table = ((DataTableBindings)(FacesUtils.getManagedBean("dataTableBindings"))).getTable(this.getClass()); List<Column> columns = table.getColumns(); for (Object rowData : stateMap.getSelected()) { RowState s = stateMap.get(rowData); for (Column c : columns) s.removeActiveCellEditor(c.getCellEditor()); } } public void stopAllEditing(ActionEvent e) { DataTable table = ((DataTableBindings)(FacesUtils.getManagedBean("dataTableBindings"))).getTable(this.getClass()); for (Column c : table.getColumns()) if (c.getCellEditor() != null) stateMap.setAllEditing(c.getCellEditor(), false); } }
[ "ken.fyten@8668f098-c06c-11db-ba21-f49e70c34f74" ]
ken.fyten@8668f098-c06c-11db-ba21-f49e70c34f74
8affbb76c0d21cd2332ec6861270f2fe9840b18d
69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e
/methods/Method_6629.java
bc421ac366e6124e715d0a237ea4370afaca65a5
[]
no_license
P79N6A/icse_20_user_study
5b9c42c6384502fdc9588430899f257761f1f506
8a3676bc96059ea2c4f6d209016f5088a5628f3c
refs/heads/master
2020-06-24T08:25:22.606717
2019-07-25T15:31:16
2019-07-25T15:31:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,229
java
public void saveRemoteLocaleStrings(LocaleInfo localeInfo,final TLRPC.TL_langPackDifference difference,int currentAccount){ if (difference == null || difference.strings.isEmpty() || localeInfo == null || localeInfo.isLocal()) { return; } final String langCode=difference.lang_code.replace('-','_').toLowerCase(); int type; if (langCode.equals(localeInfo.shortName)) { type=0; } else if (langCode.equals(localeInfo.baseLangCode)) { type=1; } else { type=-1; } if (type == -1) { return; } File finalFile; if (type == 0) { finalFile=localeInfo.getPathToFile(); } else { finalFile=localeInfo.getPathToBaseFile(); } try { final HashMap<String,String> values; if (difference.from_version == 0) { values=new HashMap<>(); } else { values=getLocaleFileStrings(finalFile,true); } for (int a=0; a < difference.strings.size(); a++) { TLRPC.LangPackString string=difference.strings.get(a); if (string instanceof TLRPC.TL_langPackString) { values.put(string.key,escapeString(string.value)); } else if (string instanceof TLRPC.TL_langPackStringPluralized) { values.put(string.key + "_zero",string.zero_value != null ? escapeString(string.zero_value) : ""); values.put(string.key + "_one",string.one_value != null ? escapeString(string.one_value) : ""); values.put(string.key + "_two",string.two_value != null ? escapeString(string.two_value) : ""); values.put(string.key + "_few",string.few_value != null ? escapeString(string.few_value) : ""); values.put(string.key + "_many",string.many_value != null ? escapeString(string.many_value) : ""); values.put(string.key + "_other",string.other_value != null ? escapeString(string.other_value) : ""); } else if (string instanceof TLRPC.TL_langPackStringDeleted) { values.remove(string.key); } } if (BuildVars.LOGS_ENABLED) { FileLog.d("save locale file to " + finalFile); } BufferedWriter writer=new BufferedWriter(new FileWriter(finalFile)); writer.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"); writer.write("<resources>\n"); for ( HashMap.Entry<String,String> entry : values.entrySet()) { writer.write(String.format("<string name=\"%1$s\">%2$s</string>\n",entry.getKey(),entry.getValue())); } writer.write("</resources>"); writer.close(); boolean hasBase=localeInfo.hasBaseLang(); final HashMap<String,String> valuesToSet=getLocaleFileStrings(hasBase ? localeInfo.getPathToBaseFile() : localeInfo.getPathToFile()); if (hasBase) { valuesToSet.putAll(getLocaleFileStrings(localeInfo.getPathToFile())); } AndroidUtilities.runOnUIThread(() -> { if (localeInfo != null) { if (type == 0) { localeInfo.version=difference.version; } else { localeInfo.baseVersion=difference.version; } } saveOtherLanguages(); try { if (currentLocaleInfo == localeInfo) { Locale newLocale; String[] args; if (!TextUtils.isEmpty(localeInfo.pluralLangCode)) { args=localeInfo.pluralLangCode.split("_"); } else if (!TextUtils.isEmpty(localeInfo.baseLangCode)) { args=localeInfo.baseLangCode.split("_"); } else { args=localeInfo.shortName.split("_"); } if (args.length == 1) { newLocale=new Locale(args[0]); } else { newLocale=new Locale(args[0],args[1]); } if (newLocale != null) { languageOverride=localeInfo.shortName; SharedPreferences preferences=MessagesController.getGlobalMainSettings(); SharedPreferences.Editor editor=preferences.edit(); editor.putString("language",localeInfo.getKey()); editor.commit(); } if (newLocale != null) { localeValues=valuesToSet; currentLocale=newLocale; currentLocaleInfo=localeInfo; if (currentLocaleInfo != null && !TextUtils.isEmpty(currentLocaleInfo.pluralLangCode)) { currentPluralRules=allRules.get(currentLocaleInfo.pluralLangCode); } if (currentPluralRules == null) { currentPluralRules=allRules.get(currentLocale.getLanguage()); if (currentPluralRules == null) { currentPluralRules=allRules.get("en"); } } changingConfiguration=true; Locale.setDefault(currentLocale); Configuration config=new Configuration(); config.locale=currentLocale; ApplicationLoader.applicationContext.getResources().updateConfiguration(config,ApplicationLoader.applicationContext.getResources().getDisplayMetrics()); changingConfiguration=false; } } } catch ( Exception e) { FileLog.e(e); changingConfiguration=false; } recreateFormatters(); NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.reloadInterface); } ); } catch ( Exception ignore) { } }
[ "sonnguyen@utdallas.edu" ]
sonnguyen@utdallas.edu
47483d187926becf0e2792cd2c0f6d4565c4bee6
a569a2a6fde8736ae33467632c75e5b2baa3b38d
/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/FlatMapDataset.java
7135cca057d407a3d3875b0d6f46108ad1f137c7
[ "Apache-2.0" ]
permissive
karllessard/tensorflow-java
c9a44d1c4875a7d8ce9e60496234fe910cfa058b
c8618642dbffe5c672fef3d83edfe3e213142e76
refs/heads/master
2023-06-12T20:10:48.520640
2023-01-11T04:54:18
2023-01-11T04:54:18
209,565,214
0
0
Apache-2.0
2022-11-03T01:37:31
2019-09-19T13:45:36
Java
UTF-8
Java
false
false
6,376
java
/* Copyright 2018-2022 The TensorFlow 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. =======================================================================*/ // This class has been generated, DO NOT EDIT! package org.tensorflow.op.data; import java.util.Arrays; import java.util.List; import org.tensorflow.ConcreteFunction; import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.OpInputsMetadata; import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.proto.framework.DataType; import org.tensorflow.types.family.TType; /** * Creates a dataset that applies {@code f} to the outputs of {@code input_dataset}. * Unlike MapDataset, the {@code f} in FlatMapDataset is expected to return a * Dataset variant, and FlatMapDataset will flatten successive results * into a single Dataset. */ @OpMetadata( opType = FlatMapDataset.OP_NAME, inputsClass = FlatMapDataset.Inputs.class ) @Operator( group = "data" ) public final class FlatMapDataset extends RawOp implements Operand<TType> { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "FlatMapDataset"; private Output<? extends TType> handle; @SuppressWarnings("unchecked") public FlatMapDataset(Operation operation) { super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } /** * Factory method to create a class wrapping a new FlatMapDataset operation. * * @param scope current scope * @param inputDataset The inputDataset value * @param otherArguments The otherArguments value * @param f A function mapping elements of {@code input_dataset}, concatenated with * {@code other_arguments}, to a Dataset variant that contains elements matching * {@code output_types} and {@code output_shapes}. * @param outputTypes The value of the outputTypes attribute * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of FlatMapDataset */ @Endpoint( describeByClass = true ) public static FlatMapDataset create(Scope scope, Operand<? extends TType> inputDataset, Iterable<Operand<?>> otherArguments, ConcreteFunction f, List<Class<? extends TType>> outputTypes, List<Shape> outputShapes, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FlatMapDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInputList(Operands.asOutputs(otherArguments)); opBuilder.setAttr("f", f); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); if (options != null) { for (Options opts : options) { if (opts.metadata != null) { opBuilder.setAttr("metadata", opts.metadata); } } } return new FlatMapDataset(opBuilder.build()); } /** * Sets the metadata option. * * @param metadata the metadata option * @return this Options instance. */ public static Options metadata(String metadata) { return new Options().metadata(metadata); } /** * Gets handle. * * @return handle. */ public Output<? extends TType> handle() { return handle; } @Override @SuppressWarnings("unchecked") public Output<TType> asOutput() { return (Output<TType>) handle; } /** * Optional attributes for {@link org.tensorflow.op.data.FlatMapDataset} */ public static class Options { private String metadata; private Options() { } /** * Sets the metadata option. * * @param metadata the metadata option * @return this Options instance. */ public Options metadata(String metadata) { this.metadata = metadata; return this; } } @OpInputsMetadata( outputsClass = FlatMapDataset.class ) public static class Inputs extends RawOpInputs<FlatMapDataset> { /** * The inputDataset input */ public final Operand<? extends TType> inputDataset; /** * The otherArguments input */ public final Iterable<Operand<?>> otherArguments; /** * The Targuments attribute */ public final DataType[] Targuments; /** * The outputTypes attribute */ public final DataType[] outputTypes; /** * The outputShapes attribute */ public final Shape[] outputShapes; /** * The metadata attribute */ public final String metadata; public Inputs(GraphOperation op) { super(new FlatMapDataset(op), op, Arrays.asList("Targuments", "output_types", "output_shapes", "metadata")); int inputIndex = 0; inputDataset = (Operand<? extends TType>) op.input(inputIndex++); int otherArgumentsLength = op.inputListLength("other_arguments"); otherArguments = Arrays.asList((Operand<?>[]) op.inputList(inputIndex, otherArgumentsLength)); inputIndex += otherArgumentsLength; Targuments = op.attributes().getAttrTypeList("Targuments"); outputTypes = op.attributes().getAttrTypeList("output_types"); outputShapes = op.attributes().getAttrShapeList("output_shapes"); metadata = op.attributes().getAttrString("metadata"); } } }
[ "karl.lessard@gmail.com" ]
karl.lessard@gmail.com
84a73690b61007d3d63ca7f325f1bc722923ef0d
7dfd5e23991f873a2db3c2e19e5c7cac7711698c
/springboot-rabbitmq/src/main/java/com/gds/springboot/rabbitmq/rabbit/topic/TopicSender.java
5d3432b6e5a3263988709fb3cf58498e8c1e44d4
[]
no_license
a514760469/springboot-dev-repository
a330019a61b6bffd6cf749ee0c52b7159606d71b
6a823216418be7d125939299a9a9735fc5e8348f
refs/heads/master
2022-06-23T03:48:14.541317
2021-01-07T09:22:04
2021-01-07T09:22:04
177,550,324
1
0
null
2022-06-21T01:33:16
2019-03-25T09:01:08
Java
UTF-8
Java
false
false
885
java
package com.gds.springboot.rabbitmq.rabbit.topic; import org.springframework.amqp.core.AmqpTemplate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class TopicSender { @Autowired private AmqpTemplate rabbitTemplate; public void send() { String context = "hi, i am message all"; System.out.println("Sender : " + context); this.rabbitTemplate.convertAndSend("topicExchange", "topic.1", context); } public void send1() { String context = "hi, i am message 1"; System.out.println("Sender : " + context); this.rabbitTemplate.convertAndSend("topicExchange", "topic.message", context); } public void send2() { String context = "hi, i am messages 2"; System.out.println("Sender : " + context); this.rabbitTemplate.convertAndSend("topicExchange", "topic.messages", context); } }
[ "514760469@qq.com" ]
514760469@qq.com
63f284f26ac0594c76213edd8c5341657a798b0e
fdf310dbfba95c87066d5c48417f312ac96254c9
/app/src/main/java/cn/zdh/dialogutils/MainActivity.java
a42b3b1191e828cfc436f4bf39d040ecbe116896
[]
no_license
zhudaihao/DialogUtils
644b35a6c62c48b64e7a1b484cfe54c41f52bb83
609d1a8e8b436e90edf99597d0dd4c5b37c3ff20
refs/heads/master
2020-03-19T01:02:12.908491
2018-05-31T01:51:57
2018-05-31T01:51:57
135,517,623
1
0
null
null
null
null
UTF-8
Java
false
false
7,533
java
package cn.zdh.dialogutils; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Toast; import java.util.ArrayList; import java.util.List; import cn.zdh.library_dialog.MyDialog; import cn.zdh.library_dialog.MyToast; import cn.zdh.library_dialog.PriceEntity; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } public void shown0(View view) { MyDialog.getInstance().shownDialogProgress(this); } public void shown1(View view) { MyDialog.getInstance().shownDialog(this, "收货提醒", "18718779900"); MyDialog.getInstance().setOnclickConfirm(new MyDialog.OnclickConfirm() { @Override public void onClick(String content) { Toast.makeText(MainActivity.this, "测试", Toast.LENGTH_SHORT).show(); } }); } public void shown2(View view) { MyDialog.getInstance().shownDialogEdit(this, "充值金额","请输入金额"); MyDialog.getInstance().setOnclickConfirmEdit(new MyDialog.OnclickConfirmEdit() { @Override public void onClick(String content) { Toast.makeText(MainActivity.this, content, Toast.LENGTH_SHORT).show(); } }); } public void shown3(View view) { final List<String> list = new ArrayList<>(); list.add("武汉分公司"); list.add("深圳分公司"); list.add("广州白云公司"); list.add("浑南分公司"); list.add("广西白云公司"); MyDialog.getInstance().shownDialogList(this, list, "收货提醒"); MyDialog.getInstance().setOnclickConfirmList(new MyDialog.OnclickConfirmList() { @Override public void onClick(String content) { Toast.makeText(MainActivity.this, content, Toast.LENGTH_SHORT).show(); } }); } public void shown4(View view) { MyDialog.getInstance().shownDialogCheck(this, "收货提醒","实物奖品将在兑换奖品后一个月时间内发放,注意收货。"); MyDialog.getInstance().setOnclickConfirmCheck(new MyDialog.OnclickConfirmCheck() { @Override public void onClick(String content) { boolean checked = MyDialog.getInstance().checkBox.isChecked(); if (checked) { Toast.makeText(MainActivity.this, "勾选", Toast.LENGTH_SHORT).show(); } else { Toast.makeText(MainActivity.this, "请勾选", Toast.LENGTH_SHORT).show(); } } }); } /** * ----------------------------------------------- */ //选择对话框 public void shown10(View view) { final List<String> list = new ArrayList<>(); list.add("武汉分公司"); list.add("深圳分公司"); list.add("广州白云公司"); list.add("深圳分公司"); list.add("广州白云公司"); list.add("深圳分公司"); list.add("广州白云公司"); list.add("深圳分公司"); list.add("广州白云公司"); list.add("深圳分公司"); list.add("广州白云公司"); MyDialog.getInstance().shownDialogListButton(this, list, "我的竞猜", "提交竞猜"); } //选择对话框 public void shown14(View view) { List<PriceEntity> listDatas = new ArrayList<>();//总的数据源 PriceEntity priceEntity = new PriceEntity(); priceEntity.setBingoTimesStr("测试1"); priceEntity.setAwardItemName("白菜"); priceEntity.setAwardName("111111000"); priceEntity.setRewardCoinNum("明细"); priceEntity.setImageUrl("http://p2.so.qhimgs1.com/bdr/326__/t011d6de038ad0b20b2.jpg"); PriceEntity priceEntity1 = new PriceEntity(); priceEntity1.setBingoTimesStr("测试1"); priceEntity1.setAwardItemName("白菜"); priceEntity1.setAwardName("111111000"); priceEntity1.setRewardCoinNum("明细"); priceEntity1.setImageUrl("http://p2.so.qhimgs1.com/bdr/326__/t011d6de038ad0b20b2.jpg"); PriceEntity priceEntity2 = new PriceEntity(); priceEntity2.setBingoTimesStr("测试1"); priceEntity2.setAwardItemName("白菜"); priceEntity2.setAwardName("111111000"); priceEntity2.setRewardCoinNum("明细"); priceEntity2.setImageUrl("http://p2.so.qhimgs1.com/bdr/326__/t011d6de038ad0b20b2.jpg"); PriceEntity priceEntity3 = new PriceEntity(); priceEntity3.setBingoTimesStr("测试1"); priceEntity3.setAwardItemName("白菜"); priceEntity3.setAwardName("111111000"); priceEntity3.setRewardCoinNum("明细"); priceEntity3.setImageUrl("http://p2.so.qhimgs1.com/bdr/326__/t011d6de038ad0b20b2.jpg"); listDatas.add(priceEntity); listDatas.add(priceEntity1); listDatas.add(priceEntity2); listDatas.add(priceEntity3); MyDialog.getInstance().shownDialogListImage(this, listDatas, "我的竞猜"); } //加载中对话框 public void shown11(View view) { MyDialog.getInstance().shownDialogLoad(this, "加载中..."); } public void shown12(View view) { MyDialog.getInstance().shownDialogMum(this, "加载中..."); } /** * ----------------------------------------------- */ //底部对话框 public void shown5(View view) { List<String> list = new ArrayList<>(); list.add("交易记录"); list.add("支付管理"); list.add("支付安全"); list.add("帮助中心"); MyDialog.getInstance().showPopWindow(this, list, "更多管理"); } public void shown6(View view) { final List<String> listText = new ArrayList<>(); List<Integer> listIcon = new ArrayList<>(); listText.add("微信好友"); listText.add("微信朋友圈"); listText.add("微信收藏"); listText.add("QQ好友"); listText.add("QQ空间"); listText.add("新浪微博"); listIcon.add(R.mipmap.pengyouquan); listIcon.add(R.mipmap.qq); listIcon.add(R.mipmap.qqkongjian); listIcon.add(R.mipmap.weixin); listIcon.add(R.mipmap.weixinshoucang); listIcon.add(R.mipmap.xinlangweibo); MyDialog.getInstance().showPopWindowIcon(this, listText, listIcon); } //普通Toast public void shownToast1(View view) { MyToast.getInstance().shownToast(this, "普通Toast"); } //自定义Toast public void shownToast2(View view) { MyToast.getInstance().showToastShape(this, "+100"); } //自定义Toast public void shownToast13(View view) { MyToast.getInstance().showToastShapeAnimation(this); } public void shown7(View view) { MyToast.getInstance().showToastButton(this, "登录成功登录成功登录成功\n登录成功"); } //仿ISO的Dialog public void shown8(View view) { //带editText MyDialog.getInstance().shownIosDialogEditText(this, "充值", "自定义充值其他金额"); } public void shown9(View view) { //普通对话框 MyDialog.getInstance().shownIosDialog(this, "拨打电话", "1325255"); } }
[ "zhudaihao@wswtz.com" ]
zhudaihao@wswtz.com
988e81e0174e707e78e7f2b4ee5368f4ce974d15
fb94e19690451dd2d1dd6e894fafb884d22046f7
/Project1/src/prWeek9/ex3/Caesar.java
6db7d9549b500c4764413bf4b6b3104d5e0ab64a
[]
no_license
seriferabia/Modul1Projets
2c2d7733f7781d6af87e5379232c3513d982fa2d
7c35c4650b02d98c98721f71ebb6fff80611248f
refs/heads/master
2020-04-25T10:32:44.162780
2019-02-26T13:14:20
2019-02-26T13:14:20
172,712,854
0
0
null
null
null
null
UTF-8
Java
false
false
991
java
package prWeek9.ex3; import java.util.stream.Collectors; import java.util.stream.Stream; public class Caesar { public String cipher(String text, Integer key){ return Stream.of(text.split("")) .map(e-> shift(e,key)) .collect(Collectors.joining("")); } private String shift(String letter, Integer key) { int valueOfLetter =(int) letter.charAt(0); if(!Character.isAlphabetic(valueOfLetter)){ Character sameLetter = (char)valueOfLetter; return sameLetter.toString(); } int shiftedValue = valueOfLetter + key; if(isCapitalLetter(valueOfLetter)){ shiftedValue = (shiftedValue -65)%26 + 65; }else{ shiftedValue = (shiftedValue -97)%26 + 97; } Character newletter = (char)shiftedValue; return newletter.toString(); } private Boolean isCapitalLetter(int valueOfLetter){ return valueOfLetter <=90 ; } }
[ "seriferabia@gmail.com" ]
seriferabia@gmail.com
7dc161d5644bef4e3a855a3864fcd98362a3ba70
c5f4d9d327707e324725bd3262ead28a74c78c00
/cdi-extension/src/main/java/org/gmorling/concurrencyutilities/cdi/internal/ManagedScheduledExecutorServiceBean.java
c312448f699252ad4ce9a70432331aea2e0ca48d
[ "Apache-2.0" ]
permissive
gunnarmorling/concurrency-utilities-cdi
191cc7db2ef5f4b28f0fdd60ea485eaeae575355
039685f2d175ba9de4ef9cfd03ec85b1e9291131
refs/heads/master
2021-05-05T13:48:11.910171
2018-01-22T22:54:26
2018-01-22T23:06:39
118,374,625
3
0
null
null
null
null
UTF-8
Java
false
false
1,166
java
/** * Copyright 2018 The Concurrency Utilities CDI Extension 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.gmorling.concurrencyutilities.cdi.internal; import javax.enterprise.concurrent.ManagedScheduledExecutorService; /** * Bean representing the default {@link ManagedScheduledExecutorService} bound to * java:comp/DefaultManagedScheduledExecutorService. * * @author Gunnar Morling */ public class ManagedScheduledExecutorServiceBean extends CurrencyUtilityBean<ManagedScheduledExecutorService> { @Override public Class<?> getBeanClass() { return ManagedScheduledExecutorService.class; } }
[ "gunnar.morling@googlemail.com" ]
gunnar.morling@googlemail.com
96ec16c3b69a093f63641405d9c76a176783763a
de6b6ab8fa4fd5e4c917c0ece9a7593e5c149b40
/src/main/java/com/gateway/gate/ConvertPostToGetGatewayFilter.java
e20cd5c26741d54f3bbd6b35160029a437e96285
[]
no_license
teevyne/gateway
f032768e20c94e85b89bc7b8e47ddb95c56b51bb
9084029101947b3c9ea8919de64f9997c7bed526
refs/heads/main
2023-08-25T23:09:43.315414
2021-10-25T17:37:33
2021-10-25T17:37:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,783
java
//package com.gateway.gate; // //import org.bouncycastle.util.Strings; //import org.springframework.cloud.gateway.filter.GatewayFilter; //import org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory; //import org.springframework.core.io.buffer.DataBuffer; //import org.springframework.core.io.buffer.DataBufferUtils; //import org.springframework.http.HttpMethod; //import org.springframework.http.server.reactive.ServerHttpRequest; //import org.springframework.http.server.reactive.ServerHttpRequestDecorator; //import org.springframework.stereotype.Component; //import org.springframework.web.util.UriComponentsBuilder; //import reactor.core.publisher.Flux; // //import java.net.URI; //import java.util.concurrent.atomic.AtomicReference; // // //@Component //public class ConvertPostToGetGatewayFilter extends AbstractGatewayFilterFactory<ConvertPostToGetGatewayFilter.Config> { // // private static final String REQUEST_BODY_OBJECT = "requestBodyObject"; // // public ConvertPostToGetGatewayFilter(){ // super(Config.class); // } // // @Override // public GatewayFilter apply(Config config) { // // return (exchange, chain) -> { // // if (exchange.getRequest().getHeaders().getContentType() == null) { // return chain.filter(exchange); // } else { // return DataBufferUtils.join(exchange.getRequest().getBody()) // .flatMap(dataBuffer -> { // // DataBufferUtils.retain(dataBuffer); // Flux<DataBuffer> cachedFlux = Flux.defer(() -> Flux.just(dataBuffer.slice(0, dataBuffer.readableByteCount()))); // // ServerHttpRequest mutatedRequest = new ServerHttpRequestDecorator(exchange.getRequest()) { // // // @Override // public String getMethodValue(){ // return HttpMethod.GET.name(); // } // // // @Override // public URI getURI(){ // return UriComponentsBuilder.fromUri(exchange.getRequest().getURI()) // .queryParams(EncryptDecryptHelper.convertJsonToQueryParamMap(toRaw(cachedFlux))).build().toUri(); // } // // // @Override // public Flux<DataBuffer> getBody() { // return Flux.empty(); // } // // }; // // return chain.filter(exchange.mutate().request(mutatedRequest).build()); // }); // } // // }; // } // // // private static String toRaw(Flux<DataBuffer> body) { // AtomicReference<String> rawRef = new AtomicReference<>(); // body.subscribe(buffer -> { // byte[] bytes = new byte[buffer.readableByteCount()]; // buffer.read(bytes); // DataBufferUtils.release(buffer); // rawRef.set(Strings.fromUTF8ByteArray(bytes)); // }); // return rawRef.get(); // } // // public static class Config { // // } //}
[ "ayemobolatolulope@gmail.com" ]
ayemobolatolulope@gmail.com
274177f58ff560bd7f973c77c60f42503796719a
833ef1d51ee50f0385035c3d2c49a2ea6bfc719a
/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/SimpleJavaLibraryBuilder.java
f7e3ca3f4bf1a1d349d20a5d72fa39f51e505451
[ "Apache-2.0" ]
permissive
joshua0pang/bazel
66be32bc0111c9c14d10885534ddbfa979ab3de9
6c10eac70123104a2b48eaf58075374e155ed12d
refs/heads/master
2021-01-17T22:01:27.640911
2015-09-17T19:17:20
2015-09-17T19:36:15
42,743,287
1
0
null
2015-09-18T19:33:45
2015-09-18T19:33:44
null
UTF-8
Java
false
false
4,920
java
// Copyright 2014 Google Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package com.google.devtools.build.buildjar; import com.google.common.base.Joiner; import com.google.common.collect.ImmutableSet; import com.google.devtools.build.buildjar.javac.JavacRunner; import com.sun.tools.javac.main.Main.Result; import java.io.File; import java.io.IOException; import java.io.OutputStream; import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; /** * An implementation of the JavaBuilder that uses in-process javac to compile java files. */ public class SimpleJavaLibraryBuilder extends AbstractJavaBuilder { @Override Result compileSources(JavaLibraryBuildRequest build, JavacRunner javacRunner, PrintWriter err) throws IOException { String[] javacArguments = makeJavacArguments(build, build.getClassPath()); return javacRunner.invokeJavac(javacArguments, err); } @Override protected void prepareSourceCompilation(JavaLibraryBuildRequest build) throws IOException { super.prepareSourceCompilation(build); // Create sourceGenDir if necessary. if (build.getSourceGenDir() != null) { File sourceGenDir = new File(build.getSourceGenDir()); if (sourceGenDir.exists()) { try { cleanupOutputDirectory(sourceGenDir); } catch (IOException e) { throw new IOException("Cannot clean output directory '" + sourceGenDir + "'", e); } } sourceGenDir.mkdirs(); } } /** * For the build configuration 'build', construct a command line that * can be used for a javac invocation. */ protected String[] makeJavacArguments(JavaLibraryBuildRequest build) { return makeJavacArguments(build, build.getClassPath()); } /** * For the build configuration 'build', construct a command line that * can be used for a javac invocation. */ protected String[] makeJavacArguments(JavaLibraryBuildRequest build, String classPath) { List<String> javacArguments = createInitialJavacArgs(build, classPath); javacArguments.addAll(getAnnotationProcessingOptions(build)); for (String option : build.getJavacOpts()) { if (option.startsWith("-J")) { // ignore the VM options. continue; } if (option.equals("-processor") || option.equals("-processorpath")) { throw new IllegalStateException( "Using " + option + " in javacopts is no longer supported." + " Use a java_plugin() rule instead."); } javacArguments.add(option); } javacArguments.addAll(build.getSourceFiles()); return javacArguments.toArray(new String[0]); } /** * Given a JavaLibraryBuildRequest, computes the javac options for the annotation processing * requested. */ private List<String> getAnnotationProcessingOptions(JavaLibraryBuildRequest build) { List<String> args = new ArrayList<>(); // Javac treats "-processorpath ''" as setting the processor path to an empty list, // whereas omitting the option is treated as not having a processor path (which causes // processor path searches to fallback to the class path). args.add("-processorpath"); args.add( build.getProcessorPath().isEmpty() ? "" : build.getProcessorPath()); if (!build.getProcessors().isEmpty() && !build.getSourceFiles().isEmpty()) { // ImmutableSet.copyOf maintains order ImmutableSet<String> deduplicatedProcessorNames = ImmutableSet.copyOf(build.getProcessors()); args.add("-processor"); args.add(Joiner.on(',').join(deduplicatedProcessorNames)); // Set javac output directory for generated sources. if (build.getSourceGenDir() != null) { args.add("-s"); args.add(build.getSourceGenDir()); } } else { // This is necessary because some jars contain discoverable annotation processors that // previously didn't run, and they break builds if the "-proc:none" option is not passed to // javac. args.add("-proc:none"); } return args; } @Override public void buildGensrcJar(JavaLibraryBuildRequest build, OutputStream err) throws IOException { JarCreator jar = new JarCreator(build.getGeneratedSourcesOutputJar()); jar.setNormalize(true); jar.setCompression(build.compressJar()); jar.addDirectory(build.getSourceGenDir()); jar.execute(); } }
[ "hanwen@google.com" ]
hanwen@google.com
8ce5ddcc8a4f40daac8d325eeb324ba8cc12a695
4cebe0d2407e5737a99d67c99ab84ca093f11cff
/src/multithread/chapter6/demo01HungryMan/Run.java
eafcf61a6e3e817d38902877e610926db855a9ad
[]
no_license
MoXiaogui0301/MultiThread-Program
049be7ca7084955cb2a2372bf5acb3e9584f4086
1492e1add980342fbbcc2aed7866efca119998c9
refs/heads/master
2020-04-28T00:14:37.871448
2019-04-02T04:20:04
2019-04-02T04:20:04
174,808,187
1
0
null
null
null
null
UTF-8
Java
false
false
619
java
package multithread.chapter6.demo01HungryMan; /** * P262 * 单例模式 立即加载/饿汉式 * 在MyObject类中定义实例变量 private static MyObject myObject = new MyObject(); * * Result: * 1721588072 * 1721588072 * 1721588072 * * 哈希码相同,可见三个线程创建的是同一个MyObject对象 * */ public class Run { public static void main(String[] args) { MyThread myThread1 = new MyThread(); MyThread myThread2 = new MyThread(); MyThread myThread3 = new MyThread(); myThread1.start(); myThread2.start(); myThread3.start(); } }
[ "361941176@qq.com" ]
361941176@qq.com
913d80039a3f212b6a24216822bf58f98d422606
0ad530bffa63c7741f57992e0640ad6ee956246f
/moql-engine/src/main/java/org/datayoo/moql/operand/cond/WhenOperand.java
d9635854d09234909ad783f3613602dae62f4137
[ "Apache-2.0" ]
permissive
colorknight/moql
404fb8c04ad84ba295952f1a079d6208296d928f
3d043db699e69b701fdbe77b4739797930640b19
refs/heads/master
2023-08-05T03:56:23.451542
2023-07-28T12:51:20
2023-07-28T12:51:20
60,326,729
48
9
Apache-2.0
2022-05-20T20:46:13
2016-06-03T07:15:08
Java
UTF-8
Java
false
false
2,250
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 * <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 org.datayoo.moql.operand.cond; import org.apache.commons.lang3.Validate; import org.datayoo.moql.EntityMap; import org.datayoo.moql.Operand; import org.datayoo.moql.OperandType; import org.datayoo.moql.core.Condition; import org.datayoo.moql.operand.AbstractOperand; /** * @author Tang Tadin */ public class WhenOperand extends AbstractOperand { { operandType = OperandType.WHEN; } protected Operand condition; protected Operand operand; public WhenOperand(Operand condition, Operand operand) { Validate.notNull(condition, "Parameter 'condition' is null!"); Validate.notNull(operand, "Parameter 'operand' is null!"); this.condition = condition; this.operand = operand; } public boolean isMatch(EntityMap entityMap) { return condition.booleanOperate(entityMap); } public boolean isMatch(Object[] entityArray) { return condition.booleanOperate(entityArray); } @Override public Object operate(EntityMap entityMap) { return operand.operate(entityMap); } @Override public void clear() { operand.clear(); } public Operand getCondition() { return condition; } public Operand getOperand() { return operand; } @Override public Object operate(Object[] entityArray) { return operand.operate(entityArray); } @Override public void bind(String[] entityNames) { condition.bind(entityNames); operand.bind(entityNames); } }
[ "ttd_ttt@sina.com.cn" ]
ttd_ttt@sina.com.cn
8a31a450a2c4f493dbb1b111e9609be6b4ec060e
ad52ff39d2d91ce5e637b9f736b98271dab5c346
/src/com/comp/codeforces/TwoPlatforms.java
cbcea524fe6dca1ddca449184cf7c534c3fcbe78
[]
no_license
Am-Coder/Competitive-Coding
af52e198ec9d595bbcce533658b5bb8d78c8136b
1500cd3f453f6586b5630707abeb59f692a3a14f
refs/heads/master
2023-06-12T14:37:55.417713
2021-03-12T14:46:12
2021-06-19T14:46:12
198,250,303
5
0
null
null
null
null
UTF-8
Java
false
false
6,340
java
package com.comp.codeforces; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.util.ArrayList; import java.util.Collections; import java.util.Random; import java.util.StringTokenizer; public class TwoPlatforms { static final int MAXN = 1000_006; static final long MOD = (long) 1e9 + 7; public static void main(String[] args) throws IOException { MyScanner s = new MyScanner(); Print p = new Print(); int t = s.nextInt(); while (t-- > 0) { int n = s.nextInt(); int k = s.nextInt(); ArrayList<Integer> x = new ArrayList<>(); int[] y = new int[n]; for (int i = 0; i < n; i++) { x.add(s.nextInt()); } for (int i = 0; i < n; i++) { y[i] = s.nextInt(); } Collections.sort(x); int[] pref = new int[n]; int[] suf = new int[n]; int j = n - 1; for (int i = n - 1; i >= 0; i--) { while (j >= 0 && x.get(i) - x.get(j) <= k) j--; pref[i] = i - j; } for (int i = 1; i < n; i++) { pref[i] = Math.max(pref[i], pref[i - 1]); } j = 0; for (int i = 0; i < n; i++) { while (j < n && x.get(j) - x.get(i) <= k) j++; suf[i] = j - i; } for (int i = n - 2; i >= 0; i--) suf[i] = Math.max(suf[i], suf[i + 1]); int ans = 1; for (int i = 0; i < n - 1; i++) ans = Math.max(ans, pref[i] + suf[i + 1]); p.println(ans); } p.close(); } public static class Pair implements Comparable<Pair> { int first; int second; public Pair(int a, int b) { this.first = a; this.second = b; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + first; result = prime * result + second; return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Pair other = (Pair) obj; if (first != other.first) return false; if (second != other.second) return false; return true; } @Override public int compareTo(Pair o) { // TODO Auto-generated method stub return o.first - first; } } public static class Helper { long MOD = (long) 1e9 + 7; int MAXN = 1000_006;; Random rnd; public Helper(long mod, int maxn) { MOD = mod; MAXN = maxn; rnd = new Random(); } public Helper() { } public static int[] sieve; public static ArrayList<Integer> primes; public void setSieve() { primes = new ArrayList<>(); sieve = new int[MAXN]; int i, j; for (i = 2; i < MAXN; ++i) if (sieve[i] == 0) { primes.add(i); for (j = i; j < MAXN; j += i) { sieve[j] = i; } } } public static long[] factorial; public void setFactorial() { factorial = new long[MAXN]; factorial[0] = 1; for (int i = 1; i < MAXN; ++i) factorial[i] = factorial[i - 1] * i % MOD; } public long getFactorial(int n) { if (factorial == null) setFactorial(); return factorial[n]; } public long ncr(int n, int r) { if (r > n) return 0; if (factorial == null) setFactorial(); long numerator = factorial[n]; long denominator = factorial[r] * factorial[n - r] % MOD; return numerator * pow(denominator, MOD - 2, MOD) % MOD; } public long[] getLongArray(int size, MyScanner s) throws Exception { long[] ar = new long[size]; for (int i = 0; i < size; ++i) ar[i] = s.nextLong(); return ar; } public int[] getIntArray(int size, MyScanner s) throws Exception { int[] ar = new int[size]; for (int i = 0; i < size; ++i) ar[i] = s.nextInt(); return ar; } public int[] getIntArray(String s) throws Exception { s = s.trim().replaceAll("\\s+", " "); String[] strs = s.split(" "); int[] arr = new int[strs.length]; for (int i = 0; i < strs.length; i++) { arr[i] = Integer.parseInt(strs[i]); } return arr; } public long gcd(long a, long b) { return b == 0 ? a : gcd(b, a % b); } public int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); } public long max(long[] ar) { long ret = ar[0]; for (long itr : ar) ret = Math.max(ret, itr); return ret; } public int max(int[] ar) { int ret = ar[0]; for (int itr : ar) ret = Math.max(ret, itr); return ret; } public long min(long[] ar) { long ret = ar[0]; for (long itr : ar) ret = Math.min(ret, itr); return ret; } public int min(int[] ar) { int ret = ar[0]; for (int itr : ar) ret = Math.min(ret, itr); return ret; } public long sum(long[] ar) { long sum = 0; for (long itr : ar) sum += itr; return sum; } public long sum(int[] ar) { long sum = 0; for (int itr : ar) sum += itr; return sum; } public long pow(long base, long exp, long MOD) { base %= MOD; long ret = 1; while (exp > 0) { if ((exp & 1) == 1) ret = ret * base % MOD; base = base * base % MOD; exp >>= 1; } return ret; } } static class Print { private BufferedWriter bw; public Print() { this.bw = new BufferedWriter(new OutputStreamWriter(System.out)); } public void print(Object object) throws IOException { bw.append("" + object); } public void println(Object object) throws IOException { print(object); bw.append("\n"); } public void close() throws IOException { bw.close(); } } public static class MyScanner { BufferedReader br; StringTokenizer st; public MyScanner() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } String nextLine() { String str = ""; try { str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } } }
[ "mishraaman2210@gmail.com" ]
mishraaman2210@gmail.com
6c59c246766bb389299f8cdceee1d1ba6466138e
7f1c1e9a27327e507a712025f35485fdaa62dad7
/IOCProj43-Spring-I18N/src/com/mac/test/I18NApp.java
f3a926431567177dc0f8f0f78dfc53a318ac9f55
[]
no_license
asmitlade/Spring_Workspace_Final
c2e2b985bd69cd819503ff17708832c265503628
5a9c0fd088be9c23bc7d331feee77b8e3e9c87e0
refs/heads/master
2021-07-03T00:32:18.935380
2019-05-25T15:24:04
2019-05-25T15:24:04
183,057,081
0
0
null
2020-10-13T22:49:13
2019-04-23T16:43:33
Java
UTF-8
Java
false
false
1,564
java
package com.mac.test; import java.util.Locale; import javax.swing.JButton; import javax.swing.JFrame; import org.springframework.context.support.ClassPathXmlApplicationContext; public class I18NApp { public static void main(String[] args) { //create IOC container try(ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("com/mac/cfgs/applicationContext.xml")){ Locale locale = null; JFrame frame = new JFrame(); frame.setBounds(100, 100, 450, 300); frame.getContentPane().setLayout(null); // create Locale object locale = new Locale(args[0], args[1]); frame.setTitle("Internationlization Application (I18N)"); JButton btnSave = new JButton(ctx.getMessage("btn.cap1", new Object[] {"emp"}, "msg1", locale)); btnSave.setBounds(52, 150, 89, 23); frame.getContentPane().add(btnSave); JButton btnModify = new JButton(ctx.getMessage("btn.cap2", new Object[] {}, "msg2", locale)); btnModify.setBounds(52, 202, 89, 23); frame.getContentPane().add(btnModify); JButton btnDelete = new JButton(ctx.getMessage("btn.cap3", new Object[] {}, "msg3", locale)); btnDelete.setBounds(250, 150, 89, 23); frame.getContentPane().add(btnDelete); JButton btnView = new JButton(ctx.getMessage("btn.cap4", new Object[] {}, "msg4", locale)); btnView.setBounds(250, 202, 89, 23); frame.getContentPane().add(btnView); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); ctx.close(); }//try }//main }//class
[ "Mac@Mac-PC" ]
Mac@Mac-PC