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
cb5aaec7406e28770edca4bc717c4949a03600ee
e9c83b0b9954d5f9f825df2fe4c0a1f25aa3c576
/src/by/bntu/fitr/povt/task20/dao/impl/UserDAO.java
1d2d823a8c534f143b7605cbee591c63a718d11f
[]
no_license
Alexis-Dia/Hibernate-lessons-basic-level
8598364641980887af7f0f0dd711e10869f85c39
ab3e80f067ad65db481cc5907df9e51a14d05e2b
refs/heads/master
2022-01-12T19:59:16.157731
2019-07-18T09:11:31
2019-07-18T09:11:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
153
java
package by.bntu.fitr.povt.task20.dao.impl; import by.bntu.fitr.povt.task20.pojos.Employee; public class UserDAO extends AbstractUserDAO<Employee> { }
[ "alexeydruzik@inbox.ru" ]
alexeydruzik@inbox.ru
d1ffae1dd367eee42b59574f3a299edd8b80052a
038a65290dfde603569ddf9a9c79aa2984244871
/DataStructure/src/main/java/com/alex/dijkstra/DijkstraAlgorithm.java
7dd85e24d2e7908e42ddbc978c5af3fb9c3512d5
[]
no_license
MyAmbitious/java-
9e969bf0ad2af810176e3a06895166b85bef05b8
13d94a34555d9c05b20e3180311d54da18b41fa1
refs/heads/master
2021-06-27T22:37:47.853177
2019-11-29T10:01:19
2019-11-29T10:01:19
219,614,320
0
0
null
2021-04-26T19:39:52
2019-11-04T23:12:39
Java
UTF-8
Java
false
false
5,199
java
package com.alex.dijkstra; import java.util.Arrays; public class DijkstraAlgorithm { public static void main(String[] args) { char[] vertex = { 'A', 'B', 'C', 'D', 'E', 'F', 'G' }; //邻接矩阵 int[][] matrix = new int[vertex.length][vertex.length]; final int N = 65535;// 表示不可以连接 matrix[0]=new int[]{N,5,7,N,N,N,2}; matrix[1]=new int[]{5,N,N,9,N,N,3}; matrix[2]=new int[]{7,N,N,N,8,N,N}; matrix[3]=new int[]{N,9,N,N,N,4,N}; matrix[4]=new int[]{N,N,8,N,N,5,4}; matrix[5]=new int[]{N,N,N,4,5,N,6}; matrix[6]=new int[]{2,3,N,N,4,6,N}; //创建 Graph对象 Graph graph = new Graph(vertex, matrix); //测试, 看看图的邻接矩阵是否ok graph.showGraph(); //测试迪杰斯特拉算法 graph.dsj(2);//C graph.showDijkstra(); } } class Graph { private char[] vertex; // 顶点数组 private int[][] matrix; // 邻接矩阵 private VisitedVertex vv; //已经访问的顶点的集合 // 构造器 public Graph(char[] vertex, int[][] matrix) { this.vertex = vertex; this.matrix = matrix; } //显示结果 public void showDijkstra() { vv.show(); } // 显示图 public void showGraph() { for (int[] link : matrix) { System.out.println(Arrays.toString(link)); } } //迪杰斯特拉算法实现 /** * * @param index 表示出发顶点对应的下标 */ public void dsj(int index) { vv = new VisitedVertex(vertex.length, index); update(index);//更新index顶点到周围顶点的距离和前驱顶点 for(int j = 1; j <vertex.length; j++) { index = vv.updateArr();// 选择并返回新的访问顶点 update(index); // 更新index顶点到周围顶点的距离和前驱顶点 } } //更新index下标顶点到周围顶点的距离和周围顶点的前驱顶点, private void update(int index) { int len = 0; //根据遍历我们的邻接矩阵的 matrix[index]行 for(int j = 0; j < matrix[index].length; j++) { // len 含义是 : 出发顶点到index顶点的距离 + 从index顶点到j顶点的距离的和 len = vv.getDis(index) + matrix[index][j]; // 如果j顶点没有被访问过,并且 len 小于出发顶点到j顶点的距离,就需要更新 if(!vv.in(j) && len < vv.getDis(j)) { vv.updatePre(j, index); //更新j顶点的前驱为index顶点 vv.updateDis(j, len); //更新出发顶点到j顶点的距离 } } } } // 已访问顶点集合 class VisitedVertex { // 记录各个顶点是否访问过 1表示访问过,0未访问,会动态更新 public int[] already_arr; // 每个下标对应的值为前一个顶点(这个index)下标, 会动态更新 public int[] pre_visited; // 记录出发顶点到其他所有顶点的距离,比如G为出发顶点,就会记录G到其它顶点的距离,会动态更新,求的最短距离就会存放到dis public int[] dis; //构造器 /** * * @param length :表示顶点的个数 * @param index: 出发顶点对应的下标, 比如G顶点,下标就是6 */ public VisitedVertex(int length, int index) { this.already_arr = new int[length]; this.pre_visited = new int[length]; this.dis = new int[length]; //初始化 dis数组 Arrays.fill(dis, 65535); this.already_arr[index] = 1; //设置出发顶点被访问过 this.dis[index] = 0;//设置出发顶点的访问距离为0 } /** * 功能: 判断index顶点是否被访问过 * @param index * @return 如果访问过,就返回true, 否则访问false */ public boolean in(int index) { return already_arr[index] == 1; } /** * 功能: 更新出发顶点到index顶点的距离 * @param index * @param len */ public void updateDis(int index, int len) { dis[index] = len; } /** * 功能: 更新pre这个顶点的前驱顶点为index顶点 * @param pre * @param index */ public void updatePre(int pre, int index) { pre_visited[pre] = index; } /** * 功能:返回出发顶点到index顶点的距离 * @param index */ public int getDis(int index) { return dis[index]; } /** * 继续选择并返回新的访问顶点, 比如这里的G 完后,就是 A点作为新的访问顶点(注意不是出发顶点) * @return */ public int updateArr() { int min = 65535, index = 0; for(int i = 0; i < already_arr.length; i++) { if(already_arr[i] == 0 && dis[i] < min ) { min = dis[i]; index = i; } } //更新 index 顶点被访问过 already_arr[index] = 1; return index; } //显示最后的结果 //即将三个数组的情况输出 public void show() { System.out.println("=========================="); //输出already_arr for(int i : already_arr) { System.out.print(i + " "); } System.out.println(); //输出pre_visited for(int i : pre_visited) { System.out.print(i + " "); } System.out.println(); //输出dis for(int i : dis) { System.out.print(i + " "); } System.out.println(); //为了好看最后的最短距离,我们处理 char[] vertex = { 'A', 'B', 'C', 'D', 'E', 'F', 'G' }; int count = 0; for (int i : dis) { if (i != 65535) { System.out.print(vertex[count] + "("+i+") "); } else { System.out.println("N "); } count++; } System.out.println(); } }
[ "429384379@qq.com" ]
429384379@qq.com
f716c81cd808e011cc38286baaef9e394540bfd0
56d533031135c90daed25c050d52373cc4ef44e3
/ready-work-cloud/src/main/java/work/ready/cloud/jdbc/olap/proto/SqlTypedParamValue.java
bdea596fe4a28caf940a9538dc8dc16047e0e23d
[ "Apache-2.0" ]
permissive
LyuWeihua/ReadyWork
519736b4c7e2c8515f655f6b25772300155a796a
d85d294c739d04052b6b4b365f0d3670564fc05e
refs/heads/main
2023-08-19T09:10:21.558128
2021-09-29T18:20:54
2021-09-29T18:20:54
411,740,933
2
0
null
null
null
null
UTF-8
Java
false
false
3,084
java
/* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ package work.ready.cloud.jdbc.olap.proto; import work.ready.cloud.jdbc.common.ParseField; import work.ready.cloud.jdbc.common.xcontent.*; import java.io.IOException; import java.util.Objects; import static work.ready.cloud.jdbc.olap.proto.ProtoUtils.parseFieldsValue; import static work.ready.cloud.jdbc.common.xcontent.ConstructingObjectParser.constructorArg; public class SqlTypedParamValue implements ToXContentObject { private static final ConstructingObjectParser<SqlTypedParamValue, Void> PARSER = new ConstructingObjectParser<>("params", true, objects -> new SqlTypedParamValue((String) objects[1], objects[0] )); private static final ParseField VALUE = new ParseField("value"); private static final ParseField TYPE = new ParseField("type"); static { PARSER.declareField(constructorArg(), (p, c) -> parseFieldsValue(p), VALUE, ObjectParser.ValueType.VALUE); PARSER.declareString(constructorArg(), TYPE); } public final Object value; public final String type; private boolean hasExplicitType; private XContentLocation tokenLocation; public SqlTypedParamValue(String type, Object value) { this(type, value, true); } public SqlTypedParamValue(String type, Object value, boolean hasExplicitType) { this.value = value; this.type = type; this.hasExplicitType = hasExplicitType; } public boolean hasExplicitType() { return hasExplicitType; } public void hasExplicitType(boolean hasExplicitType) { this.hasExplicitType = hasExplicitType; } public XContentLocation tokenLocation() { return tokenLocation; } public void tokenLocation(XContentLocation tokenLocation) { this.tokenLocation = tokenLocation; } @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.value(value); return builder; } public static SqlTypedParamValue fromXContent(XContentParser parser) { return PARSER.apply(parser, null); } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SqlTypedParamValue that = (SqlTypedParamValue) o; return Objects.equals(value, that.value) && Objects.equals(type, that.type) && Objects.equals(hasExplicitType, that.hasExplicitType); } @Override public int hashCode() { return Objects.hash(value, type, hasExplicitType); } @Override public String toString() { return String.valueOf(value) + " [" + type + "][" + hasExplicitType + "][" + tokenLocation + "]"; } }
[ "cleverbug@163.com" ]
cleverbug@163.com
5f3ca15e0395c965ba961494b98d52a881241d2d
b203bbf64ac3bde4827fa484c5d96a50d8874a90
/src/com/neeraj/design_patterns/behavioural/chain_of_responsibility/Authenticator.java
b356bb84a9671385a0292e7ce5610122e9973b70
[]
no_license
neerajjain92/DesignPatterns
e4921bea47f3bd3013b4f9bf4a8487d92b5d3e6e
48af00b0c9f46ff5f1ec1c8fb2629453a427c836
refs/heads/master
2022-11-24T00:18:59.265574
2020-07-30T19:17:39
2020-07-30T19:17:39
283,839,611
0
0
null
null
null
null
UTF-8
Java
false
false
955
java
package com.neeraj.design_patterns.behavioural.chain_of_responsibility; /** * @author neeraj on 13/07/20 * Copyright (c) 2019, DesignPatterns. * All rights reserved. */ public class Authenticator extends Handler { public Authenticator(Handler next) { super(next); } public boolean authenticate(HttpRequest httpRequest) { var isValid = httpRequest.getUsername() == "neeraj" && httpRequest.getPassword() == "1234"; System.out.println("Authenticating the request... and isValidUser ? " + isValid); // Now since if we want this request to go forward, we need to send false to handler // and if the username and password didn't match we need to stop processing and return // back to user so let's pass true in that scenario. return !isValid; } @Override public boolean doHandle(HttpRequest httpRequest) { return authenticate(httpRequest); } }
[ "neeraj_jain@apple.com" ]
neeraj_jain@apple.com
1e40e72e9c39b53220f79f51c5c35f1ecadaf062
7cae5761732aff27269b35a002df2228d4ab0cfd
/src/com/events/bean/common/conversation/UserConversationBean.java
2b4952469ccd4e24633e9d908d013c94031a72f2
[]
no_license
kensenjohn/IsMyPlanner
2a823f28594e092f8ce1015b8f65e413a33a7ef6
38d0f1072875ac603ac41becf08699e21725ff71
refs/heads/master
2021-01-14T08:35:15.996542
2015-08-17T20:47:38
2015-08-17T20:47:38
15,654,415
0
0
null
null
null
null
UTF-8
Java
false
false
3,761
java
package com.events.bean.common.conversation; import com.events.common.Constants; import com.events.common.ParseUtil; import org.json.JSONException; import org.json.JSONObject; import java.util.HashMap; /** * Created with IntelliJ IDEA. * User: root * Date: 6/2/14 * Time: 11:34 AM * To change this template use File | Settings | File Templates. */ public class UserConversationBean { // GTUSERCONVERSATION( USERCONVERSATIONID VARCHAR(45) NOT NULL, FK_CONVERSATIONID VARCHAR(45) NOT NULL , // FK_USERID VARCHAR(45) NOT NULL, PRIMARY KEY (USERCONVERSATIONID) ) ENGINE = MyISAM DEFAULT CHARSET = utf8; // IS_CONVERSATION_HIDDEN INT(1) NOT NULL DEFAULT 0, IS_CONVERSATION_DELETED INT(1) NOT NULL DEFAULT 0, IS_READ private String userConversationId = Constants.EMPTY; private String conversationId = Constants.EMPTY; private String userId = Constants.EMPTY; boolean isConversationHidden = false; boolean isConversationDeleted = false; boolean isRead = false; public UserConversationBean() { } public UserConversationBean(HashMap<String,String> hmResult) { this.userConversationId = ParseUtil.checkNull(hmResult.get("USERCONVERSATIONID")); this.conversationId = ParseUtil.checkNull(hmResult.get("FK_CONVERSATIONID")); this.userId = ParseUtil.checkNull(hmResult.get("FK_USERID")); this.isConversationHidden = ParseUtil.sTob(hmResult.get("IS_CONVERSATION_HIDDEN")); this.isConversationDeleted = ParseUtil.sTob(hmResult.get("IS_CONVERSATION_DELETED")); this.isRead = ParseUtil.sTob(hmResult.get("IS_READ")); } public boolean isConversationHidden() { return isConversationHidden; } public void setConversationHidden(boolean conversationHidden) { isConversationHidden = conversationHidden; } public boolean isConversationDeleted() { return isConversationDeleted; } public void setConversationDeleted(boolean conversationDeleted) { isConversationDeleted = conversationDeleted; } public boolean isRead() { return isRead; } public void setRead(boolean read) { isRead = read; } public String getUserConversationId() { return userConversationId; } public void setUserConversationId(String userConversationId) { this.userConversationId = userConversationId; } public String getConversationId() { return conversationId; } public void setConversationId(String conversationId) { this.conversationId = conversationId; } public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } @Override public String toString() { final StringBuilder sb = new StringBuilder("UserConversationBean{"); sb.append("userConversationId='").append(userConversationId).append('\''); sb.append(", conversationId='").append(conversationId).append('\''); sb.append(", userId='").append(userId).append('\''); sb.append('}'); return sb.toString(); } public JSONObject toJson() { JSONObject jsonObject = new JSONObject(); try { jsonObject.put("user_conversation_id", this.userConversationId ); jsonObject.put("conversation_id", this.conversationId ); jsonObject.put("user_id", this.userId ); jsonObject.put("is_conversation_hidden", this.isConversationHidden ); jsonObject.put("is_conversation_deleted", this.isConversationDeleted ); jsonObject.put("is_read", this.isRead ); } catch (JSONException e) { e.printStackTrace(); } return jsonObject; } }
[ "kensenjohn@gmail.com" ]
kensenjohn@gmail.com
a7c322c2dfff91bece13af042031abc39227d513
de0e24c1cbb823b16d5a4316d4be5ca6b8bf78d0
/qa/src/main/java/org/apache/river/test/spec/javaspace/conformance/TransactionNotifyLeaseANYTest.java
8ee58140551f01eba2443e7d928267d1b7acacde
[ "BSD-3-Clause", "Apache-2.0", "MIT" ]
permissive
dreedyman/apache-river
2812ffe56bd9070c56c92c04de917472d9b5ddd9
d2829fb82ba552e2f90ad8d42667fd7be49be777
refs/heads/master
2022-11-28T16:50:40.117022
2020-08-10T17:16:51
2020-08-10T17:16:51
279,403,665
0
0
Apache-2.0
2020-08-10T17:16:53
2020-07-13T20:21:36
Java
UTF-8
Java
false
false
7,069
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.river.test.spec.javaspace.conformance; // net.jini import net.jini.core.lease.Lease; import net.jini.core.transaction.Transaction; import net.jini.core.event.EventRegistration; // org.apache.river import org.apache.river.qa.harness.TestException; /** * TransactionNotifyLeaseANYTest asserts, that for notify with * <code>Lease.ANY</code> lease time within the non null transaction: * 1) A notify request's matching is done as it is for read * 2) Writing an entry into a space might generate notifications * to registered objects. * 3) When matching entries arrive, the specified RemoteEventListener will * eventually be notified by invoking listener's notify method. * * @author Mikhail A. Markov */ public class TransactionNotifyLeaseANYTest extends TransactionTest { /** * This method asserts, that for notify with <code>Lease.ANY</code> * lease time within the non null transaction: * 1) A notify request's matching is done as it is for read * 2) Writing an entry into a space might generate notifications * to registered objects. * 3) When matching entries arrive, the specified RemoteEventListener will * eventually be notified by invoking listener's notify method. * * <P>Notes:<BR>For more information see the JavaSpaces specification * section 2.7.</P> */ public void run() throws Exception { NotifyCounter[] ncs = new NotifyCounter[12]; EventRegistration[] ers = new EventRegistration[12]; boolean[] failMatrix = new boolean[12]; boolean failed = false; long[] evMatrix = new long[] { 3, 3, 3, 0, 0, 0, 0, 0, 9, 6, 6, 9 }; SimpleEntry sampleEntry1 = new SimpleEntry("TestEntry #1", 1); SimpleEntry sampleEntry2 = new SimpleEntry("TestEntry #2", 2); SimpleEntry sampleEntry3 = new SimpleEntry("TestEntry #1", 2); SimpleEntry template; Transaction txn; int i; // first check that space is empty if (!checkSpace(space)) { throw new TestException( "Space is not empty in the beginning."); } // create the non null transaction txn = getTransaction(); // init 3 RemoteEvent counters for each of sample entries ncs[0] = new NotifyCounter(sampleEntry1, Lease.ANY); ncs[1] = new NotifyCounter(sampleEntry2, Lease.ANY); ncs[2] = new NotifyCounter(sampleEntry3, Lease.ANY); // init 5 counters with wrong templates template = new SimpleEntry("TestEntry #3", 1); ncs[3] = new NotifyCounter(template, Lease.ANY); // 2-nd wrong template template = new SimpleEntry("TestEntry #1", 3); ncs[4] = new NotifyCounter(template, Lease.ANY); // 3-rd wrong template template = new SimpleEntry("TestEntry #3", 3); ncs[5] = new NotifyCounter(template, Lease.ANY); // 4-th wrong template template = new SimpleEntry(null, 3); ncs[6] = new NotifyCounter(template, Lease.ANY); // 5-th wrong template template = new SimpleEntry("TestEntry #3", null); ncs[7] = new NotifyCounter(template, Lease.ANY); // init counter with null entry as a template ncs[8] = new NotifyCounter(null, Lease.ANY); // init 3 counters with null values for different fields template = new SimpleEntry("TestEntry #1", null); ncs[9] = new NotifyCounter(template, Lease.ANY); // 2-nd template template = new SimpleEntry(null, 2); ncs[10] = new NotifyCounter(template, Lease.ANY); // 3-rd template template = new SimpleEntry(null, null); ncs[11] = new NotifyCounter(template, Lease.ANY); // now register all counters for (i = 0; i < 12; i++) { ers[i] = space.notify(ncs[i].getTemplate(), txn, ncs[i], ncs[i].getLeaseTime(), null); ers[i] = prepareRegistration(ers[i]); } // sleep for a while to let all listeners register properly Thread.sleep(timeout1); logDebugText("now sleeping for " + timeout1 + " to let all listeners register properly."); /* * write 3 sample entries to the space 3 times * within the transaction */ space.write(sampleEntry1, txn, leaseForeverTime); space.write(sampleEntry1, txn, leaseForeverTime); space.write(sampleEntry1, txn, leaseForeverTime); space.write(sampleEntry2, txn, leaseForeverTime); space.write(sampleEntry2, txn, leaseForeverTime); space.write(sampleEntry2, txn, leaseForeverTime); space.write(sampleEntry3, txn, leaseForeverTime); space.write(sampleEntry3, txn, leaseForeverTime); space.write(sampleEntry3, txn, leaseForeverTime); logDebugText("3 sample entries have been written" + " to the space 3 times."); // wait for a while to let all listeners get notifications logDebugText("now sleeping for " + timeout1 + " to let all listeners get notifications."); Thread.sleep(timeout1); // check, that listeners got required number of notifications for (i = 0; i < 12; i++) { if (ncs[i].getEventsNum(ers[i]) != evMatrix[i]) { failed = true; failMatrix[i] = true; } else { failMatrix[i] = false; } } for (i = 0; i < 12; i++) { if (failMatrix[i]) { logDebugText("FAILED: " + ncs[i] + " has got " + ncs[i].getEventsNum(ers[i]) + " notifications instead of " + evMatrix[i] + " required."); } else { logDebugText(ncs[i].toString() + " has got " + ncs[i].getEventsNum(ers[i]) + " notifications as expected"); } } // commit the transaction txnCommit(txn); // check: we fail of pass if (failed) { throw new TestException( "Not all listeners've got expected number of events."); } } }
[ "zkuti@chemaxon.com" ]
zkuti@chemaxon.com
69804698d3f9d6aacfc9b05b29690ecc2f615f3d
34221f3f7738d7a33c693e580dc6a99789349cf3
/app/src/main/java/defpackage/djd.java
2d518820c5b39dd20e8fdb5e923dc77174fc0d86
[]
no_license
KobeGong/TasksApp
0c7b9f3f54bc4be755b1f605b41230822d6f9850
aacdd5cbf0ba073460797fa76f1aaf2eaf70f08e
refs/heads/master
2023-08-16T07:11:13.379876
2021-09-25T17:38:57
2021-09-25T17:38:57
374,659,931
0
0
null
null
null
null
UTF-8
Java
false
false
4,836
java
package defpackage; /* renamed from: djd reason: default package */ /* compiled from: PG */ final class djd extends defpackage.dgs implements defpackage.diq, defpackage.djy, java.util.RandomAccess { private long[] b; private int c; djd() { this(new long[10], 0); } private djd(long[] jArr, int i) { this.b = jArr; this.c = i; } /* access modifiers changed from: protected */ public final void removeRange(int i, int i2) { c(); if (i2 < i) { throw new java.lang.IndexOutOfBoundsException("toIndex < fromIndex"); } java.lang.System.arraycopy(this.b, i2, this.b, i, this.c - i2); this.c -= i2 - i; this.modCount++; } public final boolean equals(java.lang.Object obj) { if (this == obj) { return true; } if (!(obj instanceof defpackage.djd)) { return super.equals(obj); } defpackage.djd djd = (defpackage.djd) obj; if (this.c != djd.c) { return false; } long[] jArr = djd.b; for (int i = 0; i < this.c; i++) { if (this.b[i] != jArr[i]) { return false; } } return true; } public final int hashCode() { int i = 1; for (int i2 = 0; i2 < this.c; i2++) { i = (i * 31) + defpackage.dim.a(this.b[i2]); } return i; } public final long b(int i) { c(i); return this.b[i]; } public final int size() { return this.c; } public final void a(long j) { a(this.c, j); } private final void a(int i, long j) { c(); if (i < 0 || i > this.c) { throw new java.lang.IndexOutOfBoundsException(d(i)); } if (this.c < this.b.length) { java.lang.System.arraycopy(this.b, i, this.b, i + 1, this.c - i); } else { long[] jArr = new long[(((this.c * 3) / 2) + 1)]; java.lang.System.arraycopy(this.b, 0, jArr, 0, i); java.lang.System.arraycopy(this.b, i, jArr, i + 1, this.c - i); this.b = jArr; } this.b[i] = j; this.c++; this.modCount++; } public final boolean addAll(java.util.Collection collection) { c(); defpackage.dim.a((java.lang.Object) collection); if (!(collection instanceof defpackage.djd)) { return super.addAll(collection); } defpackage.djd djd = (defpackage.djd) collection; if (djd.c == 0) { return false; } if (Integer.MAX_VALUE - this.c < djd.c) { throw new java.lang.OutOfMemoryError(); } int i = this.c + djd.c; if (i > this.b.length) { this.b = java.util.Arrays.copyOf(this.b, i); } java.lang.System.arraycopy(djd.b, 0, this.b, this.c, djd.c); this.c = i; this.modCount++; return true; } public final boolean remove(java.lang.Object obj) { c(); for (int i = 0; i < this.c; i++) { if (obj.equals(java.lang.Long.valueOf(this.b[i]))) { java.lang.System.arraycopy(this.b, i + 1, this.b, i, this.c - i); this.c--; this.modCount++; return true; } } return false; } private final void c(int i) { if (i < 0 || i >= this.c) { throw new java.lang.IndexOutOfBoundsException(d(i)); } } private final java.lang.String d(int i) { return "Index:" + i + ", Size:" + this.c; } public final /* synthetic */ java.lang.Object set(int i, java.lang.Object obj) { long longValue = ((java.lang.Long) obj).longValue(); c(); c(i); long j = this.b[i]; this.b[i] = longValue; return java.lang.Long.valueOf(j); } public final /* synthetic */ java.lang.Object remove(int i) { c(); c(i); long j = this.b[i]; if (i < this.c - 1) { java.lang.System.arraycopy(this.b, i + 1, this.b, i, this.c - i); } this.c--; this.modCount++; return java.lang.Long.valueOf(j); } public final /* synthetic */ void add(int i, java.lang.Object obj) { a(i, ((java.lang.Long) obj).longValue()); } public final /* synthetic */ defpackage.diq a(int i) { if (i >= this.c) { return new defpackage.djd(java.util.Arrays.copyOf(this.b, i), this.c); } throw new java.lang.IllegalArgumentException(); } public final /* synthetic */ java.lang.Object get(int i) { return java.lang.Long.valueOf(b(i)); } static { new defpackage.djd().a = false; } }
[ "droidevapp1023@gmail.com" ]
droidevapp1023@gmail.com
a2797dc5f3f0202fee5ac0b06400cc7ed1575482
e2e986e296a21b0e5685a7d9016e699a24113100
/schoolApp/src/main/java/com/champs21/schoolapp/utils/ClickSpan.java
ca34ec3390ea80963097fc554e61627cfca37d0d
[]
no_license
tcse9/DummySchoolApp
28e8875e82118ac5626003ddc6c8655e93406542
2cf12949b64fc174dea29632f3c7a3f4ef07b661
refs/heads/master
2016-09-01T18:45:05.208048
2015-03-19T09:41:22
2015-03-19T09:41:22
32,510,557
0
0
null
null
null
null
UTF-8
Java
false
false
462
java
package com.champs21.schoolapp.utils; import android.text.style.ClickableSpan; import android.view.View; public class ClickSpan extends ClickableSpan { private OnClickListener mListener; public ClickSpan(OnClickListener listener) { mListener = listener; } @Override public void onClick(View widget) { if (mListener != null) mListener.onClick(); } public interface OnClickListener { void onClick(); } }
[ "ovioviovi@gmail.com" ]
ovioviovi@gmail.com
09dfac43acae9c5bd2b13c27e12c84da07094a6a
f46ccfd712520cc53db30efc60dd6f335c7bf95f
/trueupdate-manager/trueupdate-manager-jms/src/main/java/net/java/trueupdate/manager/jms/JmsUpdateManagerParameters.java
2339116638497ba7d40945b3e9668316e3cad4aa
[ "Apache-2.0" ]
permissive
christian-schlichtherle/trueupdate
0abb4964a29d93ebf82b0fff79432506e2c70fe4
2f2dc9963c44130cdaaa210b67f6d7180a0a4bc2
refs/heads/master
2020-03-23T20:17:41.259358
2018-07-23T15:42:35
2018-07-23T15:42:35
142,033,169
0
0
null
null
null
null
UTF-8
Java
false
false
4,458
java
/* * Copyright (C) 2013 Schlichtherle IT Services & Stimulus Software. * All rights reserved. Use is subject to license terms. */ package net.java.trueupdate.manager.jms; import net.java.trueupdate.jms.JmsParameters; import net.java.trueupdate.manager.core.TimerParameters; import net.java.trueupdate.manager.core.UpdateServiceParameters; import net.java.trueupdate.manager.jms.ci.JmsUpdateManagerParametersCi; import net.java.trueupdate.util.builder.AbstractBuilder; import javax.annotation.CheckForNull; import javax.annotation.Nullable; import javax.annotation.concurrent.Immutable; import javax.xml.bind.JAXB; import java.net.URL; import java.util.Locale; import java.util.ServiceConfigurationError; import static java.util.Objects.requireNonNull; /** * JMS update manager parameters. * * @author Christian Schlichtherle */ @Immutable public final class JmsUpdateManagerParameters { private static final String CONFIGURATION = "update/manager.xml"; private final UpdateServiceParameters updateService; private final TimerParameters updateTimer; private final JmsParameters messaging; JmsUpdateManagerParameters(final Builder<?> b) { this.updateService = requireNonNull(b.updateService); this.updateTimer = requireNonNull(b.updateTimer); this.messaging = requireNonNull(b.messaging); } /** * Loads JMS update manager parameters from the configuration resource * file with the name {@code update/manager.xml}. */ public static JmsUpdateManagerParameters load() { return load(net.java.trueupdate.util.Resources.locate(CONFIGURATION)); } static JmsUpdateManagerParameters load(final URL source) { try { return parse(JAXB.unmarshal(source, JmsUpdateManagerParametersCi.class)); } catch (RuntimeException ex) { throw new ServiceConfigurationError(String.format(Locale.ENGLISH, "Failed to load configuration from %s .", source), ex); } } /** Parses the given configuration item. */ public static JmsUpdateManagerParameters parse( JmsUpdateManagerParametersCi ci) { return builder().parse(ci).build(); } /** Returns a new builder for JMS update manager parameters. */ public static Builder<Void> builder() { return new Builder<>(); } /** Returns the update service parameters. */ public UpdateServiceParameters updateService() { return updateService; } /** Returns the timer parameters for checking for artifact updates. */ public TimerParameters updateTimer() { return updateTimer; } /** Returns the messaging parameters. */ public JmsParameters messaging() { return messaging; } /** * A builder for JMS update manager parameters. * * @param <P> The type of the parent builder, if defined. */ @SuppressWarnings("PackageVisibleField") public static class Builder<P> extends AbstractBuilder<P> { @CheckForNull UpdateServiceParameters updateService; @CheckForNull TimerParameters updateTimer; @CheckForNull JmsParameters messaging; protected Builder() { } /** Selectively parses the given configuration item. */ public final Builder<P> parse(final JmsUpdateManagerParametersCi ci) { if (null != ci.updateService) updateService = UpdateServiceParameters.parse(ci.updateService); if (null != ci.updateTimer) updateTimer = TimerParameters.parse(ci.updateTimer); if (null != ci.messaging) messaging = JmsParameters.parse(ci.messaging); return this; } public final Builder<P> updateService( final @Nullable UpdateServiceParameters updateService) { this.updateService = updateService; return this; } public final Builder<P> updateTimer( final @Nullable TimerParameters updateTimer) { this.updateTimer = updateTimer; return this; } public final Builder<P> messaging( final @Nullable JmsParameters messaging) { this.messaging = messaging; return this; } @Override public final JmsUpdateManagerParameters build() { return new JmsUpdateManagerParameters(this); } } // Builder }
[ "christian@schlichtherle.de" ]
christian@schlichtherle.de
34fe19b73f97054422797ac9ec0e7a05dcb5699e
1fc89c80068348031fdd012453d081bac68c85b0
/FEST/org/fest/swing/driver/JFileChooserSelectFileTask.java
55cf6eacf2933f3c65ed3ac8e90cb8e028a83a90
[]
no_license
Jose-R-Vieira/WorkspaceEstudosJava
e81858e295972928d3463f23390d5d5ee67966c9
7ba374eef760ba2c3ee3e8a69657a96f9adec5c1
refs/heads/master
2020-03-26T16:47:26.846023
2018-08-17T14:06:57
2018-08-17T14:06:57
145,123,028
0
0
null
null
null
null
UTF-8
Java
false
false
3,019
java
/* * Created on Aug 8, 2008 * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under * the License. * * Copyright @2008-2010 the original author or authors. */ package org.fest.swing.driver; import static javax.swing.JFileChooser.DIRECTORIES_ONLY; import static javax.swing.JFileChooser.FILES_ONLY; import static org.fest.swing.driver.ComponentStateValidator.validateIsEnabledAndShowing; import static org.fest.swing.edt.GuiActionRunner.execute; import static org.fest.swing.format.Formatting.format; import static org.fest.util.Strings.concat; import java.io.File; import javax.swing.JFileChooser; import org.fest.swing.annotation.RunsInCurrentThread; import org.fest.swing.annotation.RunsInEDT; import org.fest.swing.edt.GuiTask; /** * Understands a task that selects a file in a <code>{@link JFileChooser}</code>. This task is executed in the event * dispatch thread. * * @author Alex Ruiz */ final class JFileChooserSelectFileTask { @RunsInEDT static void validateAndSelectFile(final JFileChooser fileChooser, final File file) { execute(new GuiTask() { protected void executeInEDT() { validateIsEnabledAndShowing(fileChooser); validateFileToChoose(fileChooser, file); fileChooser.setSelectedFile(file); } }); } @RunsInEDT static void validateAndSelectFiles(final JFileChooser fileChooser, final File[] files) { execute(new GuiTask() { protected void executeInEDT() { validateIsEnabledAndShowing(fileChooser); if (files.length > 1 && !fileChooser.isMultiSelectionEnabled()) throw new IllegalStateException( concat("Expecting file chooser ", format(fileChooser), " to handle multiple selection")); for (File file : files) validateFileToChoose(fileChooser, file); fileChooser.setSelectedFiles(files); } }); } @RunsInCurrentThread private static void validateFileToChoose(JFileChooser fileChooser, File file) { int mode = fileChooser.getFileSelectionMode(); boolean isFolder = file.isDirectory(); if (mode == FILES_ONLY && isFolder) throw cannotSelectFile(file, "the file chooser cannot open directories"); if (mode == DIRECTORIES_ONLY && !isFolder) throw cannotSelectFile(file, "the file chooser can only open directories"); } private static IllegalArgumentException cannotSelectFile(File file, String reason) { return new IllegalArgumentException(concat("Unable to select file ", file, ": ", reason)); } private JFileChooserSelectFileTask() {} }
[ "jose.rodrigues@rsinet.com.br" ]
jose.rodrigues@rsinet.com.br
d13006a10452c6a12d6ff4830d424894cc3e3280
0ceafc2afe5981fd28ce0185e0170d4b6dbf6241
/AlgoKit (3rdp)/Code-store v1.0/yaal/archive/2012.10/2012.10.28 - ACM ICPC NEERC Western Subregional/TaskA.java
a9c6f3cd52e9176825ec65c2476d66d08657335a
[]
no_license
brainail/.happy-coooding
1cd617f6525367133a598bee7efb9bf6275df68e
cc30c45c7c9b9164095905cc3922a91d54ecbd15
refs/heads/master
2021-06-09T02:54:36.259884
2021-04-16T22:35:24
2021-04-16T22:35:24
153,018,855
2
1
null
null
null
null
UTF-8
Java
false
false
1,376
java
package net.egork; import net.egork.utils.io.InputReader; import net.egork.utils.io.OutputWriter; public class TaskA { public void solve(int testNumber, InputReader in, OutputWriter out) { String pattern = in.readString(); String sample = in.readString(); String big = sample + sample; String[] tokens = pattern.split("[*]+", -1); int[] answer = new int[big.length() + 1]; for (int i = 0; i < answer.length; i++) answer[i] = i; int[] next = new int[answer.length]; for (int i = tokens.length - 1; i >= 0; i--) { int last = Integer.MAX_VALUE; for (int k = answer.length - 1; k >= 0; k--) { if (startsWith(big, k, tokens[i])) last = answer[k + tokens[i].length()]; next[k] = last; } int[] temp = next; next = answer; answer = temp; } int result = 0; for (int i = 0; i < sample.length(); i++) { if (answer[i] <= i + sample.length() && big.substring(i).startsWith(tokens[0]) && big.substring(0, i + sample.length()).endsWith(tokens[tokens.length - 1]) && (tokens.length != 1 || sample.length() == tokens[0].length())) result++; } out.printLine(result); } private boolean startsWith(String big, int k, String token) { if (k + token.length() > big.length()) return false; for (int i = 0; i < token.length(); i++) { if (big.charAt(i + k) != token.charAt(i)) return false; } return true; } }
[ "wsemirz@gmail.com" ]
wsemirz@gmail.com
421e61473d5df0d54aeaa5527cbce801364a91b2
5342fa9f27c83805e92e867a5c14744edd795792
/src/com/gdssoft/oa/service/system/SnGeneratorService.java
ac14702226be96c93a2a0dda0d7af684603ae058
[]
no_license
Beyond-yan/OA
52edb9ad6e115dc397fc5c444f095aab7da531f1
c0f452b241a60d30f29c283b2484e96346e7b9cb
refs/heads/master
2020-03-31T11:32:48.036713
2018-10-09T04:14:54
2018-10-09T04:14:54
152,181,201
0
0
null
null
null
null
UTF-8
Java
false
false
518
java
package com.gdssoft.oa.service.system; import com.gdssoft.core.service.BaseService; import com.gdssoft.oa.model.system.SnGenerator; public interface SnGeneratorService extends BaseService<SnGenerator> { /** * 根据前缀产生完整的编号 * @param prefix 前缀 * @param suffix 后缀 * @param snLength 序号长度 * @return */ public String nextSNByPrefix(String prefix, String suffix, int snLength); /** * 获取最新的SNNumber */ public SnGenerator nextSNNumber(String prefix); }
[ "1406123562@qq.com" ]
1406123562@qq.com
5ede75287d6c3586a3347fb32070cbf4fd3531be
e709ec9e5cf6e9732b53e1d0d0e9f9eca3f23eb3
/core/src/main/java/com/yinmimoney/web/p2pnew/enums/EnumApiTokenStatus.java
0180f2418da5793d384dd0396d40c4f010e7dce1
[]
no_license
OrmFor/coc
0ebeab287508c64ff6aec354c2388471bfcc19b4
970d3d2838be73395e630938ab6efa2abaf41ae4
refs/heads/master
2022-12-22T05:01:32.558308
2019-10-25T01:45:47
2019-10-25T01:45:47
217,427,407
0
0
null
2022-12-16T03:16:12
2019-10-25T01:39:11
JavaScript
UTF-8
Java
false
false
643
java
package com.yinmimoney.web.p2pnew.enums; /** * * @Description token状态枚举类 * @author wzq * @date 2018年6月7日 上午11:34:43 */ public enum EnumApiTokenStatus { /** 有效 **/ STATUS_NORMAL(0, "有效"), /** 过期 **/ STATUS_EXPIRED(1, "过期"), /** 失效 **/ STATUS_DISABLED(2, "失效"), /** 另外设备登录 **/ STATUS_OTHER_DEVICE_LOGIN(3, "另外设备登录"); private int status; private String name; private EnumApiTokenStatus(int status, String name) { this.name = name; this.status = status; } public String getName() { return name; } public int getStatus() { return status; } }
[ "34675763+OrmFor@users.noreply.github.com" ]
34675763+OrmFor@users.noreply.github.com
ce05fc5ae910c5dd9cdc928c648b38b648b7c376
e1e5bd6b116e71a60040ec1e1642289217d527b0
/H5/L2jSunrise_com/L2jSunrise_com_2019_09_16/L2J_SunriseProject_Core/java/l2r/gameserver/model/actor/stat/VehicleStat.java
3295524473209aa83724ae0ac89cfa1dc5c49342
[]
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
1,350
java
/* * Copyright (C) 2004-2015 L2J Server * * This file is part of L2J Server. * * L2J Server 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. * * L2J Server 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 l2r.gameserver.model.actor.stat; import l2r.gameserver.model.actor.L2Vehicle; public class VehicleStat extends CharStat { private float _moveSpeed = 0; private int _rotationSpeed = 0; public VehicleStat(L2Vehicle activeChar) { super(activeChar); } @Override public double getMoveSpeed() { return _moveSpeed; } public final void setMoveSpeed(float speed) { _moveSpeed = speed; } public final double getRotationSpeed() { return _rotationSpeed; } public final void setRotationSpeed(int speed) { _rotationSpeed = speed; } }
[ "64197706+L2jOpenSource@users.noreply.github.com" ]
64197706+L2jOpenSource@users.noreply.github.com
eeddea8f11d865fee763e0388bcadab414f5530b
c19f5c8ed706f655d39ec135ea90a2ffc45c87ce
/app/src/main/java/com/example/xj/ownproject/presenter/BasePresenter.java
5acb27d4ce00045676921fd599dd100875539119
[]
no_license
androidxiejun/OwnProject
b58fdf022bb8bb722e5cc98b1cfdf4762a811d0a
2cc70a43d578b9550fa461a4d4f1374cfa6e7558
refs/heads/master
2020-05-31T07:07:10.180227
2019-06-10T09:34:47
2019-06-10T09:34:47
190,158,764
0
0
null
null
null
null
UTF-8
Java
false
false
660
java
package com.example.xj.ownproject.presenter; import com.example.xj.ownproject.view.IBaseView; /** * Created by AndroidXJ on 2019/6/10. */ public class BasePresenter<V extends IBaseView> { private V mView; public void attechView(V view) { this.mView = view; } public void dettechView() { this.mView = null; } public V getView() { if (mView == null) { try { throw new Exception("view can not be null"); } catch (Exception e) { e.printStackTrace(); } return null; } else { return mView; } } }
[ "1019163135@qq.com" ]
1019163135@qq.com
81c59d60d518013ffc036116aac106f432a565ee
594dbe9ad659263e560e2d84d02dae411e3ff2ca
/glaf/workspace/glaf-base/src/main/java/com/glaf/base/online/service/UserOnlineLogService.java
b82ed2fed18f84401c9987ca61f9083279495c4c
[]
no_license
eosite/openyourarm
670b3739f9abb81b36a7d90846b6d2e68217b443
7098657ee60bf6749a13c0ea19d1ac1a42a684a0
refs/heads/master
2021-05-08T16:38:30.406098
2018-01-24T03:38:45
2018-01-24T03:38:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,958
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.glaf.base.online.service; import java.util.*; import org.springframework.transaction.annotation.Transactional; import com.glaf.base.online.domain.*; import com.glaf.base.online.query.*; @Transactional(readOnly = true) public interface UserOnlineLogService { /** * 获取用户当天登录次数 * @param actorId * @return */ int getLoginCount(String actorId); /** * 根据查询参数获取记录总数 * * @return */ int getUserOnlineLogCountByQueryCriteria(UserOnlineLogQuery query); /** * 根据主键获取一条记录 * * @return */ List<UserOnlineLog> getUserOnlineLogs(String actorId); /** * 根据查询参数获取一页的数据 * * @return */ List<UserOnlineLog> getUserOnlineLogsByQueryCriteria(int start, int pageSize, UserOnlineLogQuery query); /** * 根据查询参数获取记录列表 * * @return */ List<UserOnlineLog> list(UserOnlineLogQuery query); /** * 记录在线用户 * * @param model */ @Transactional void login(UserOnlineLog model); /** * 退出系统 * * @param actorId */ @Transactional void logout(String actorId); }
[ "weishang80@qq.com" ]
weishang80@qq.com
6f74f4127a9050807853a87bb7f7032b470be50b
8534ea766585cfbd6986fd845e59a68877ecb15b
/com/actionbarsherlock/internal/nineoldandroids/widget/NineLinearLayout.java
5b0eaef9583862e564be3a54de1e20a269481e3a
[]
no_license
Shanzid01/NanoTouch
d7af94f2de686f76c2934b9777a92b9949b48e10
6d51a44ff8f719f36b880dd8d1112b31ba75bfb4
refs/heads/master
2020-04-26T17:39:53.196133
2019-03-04T10:23:51
2019-03-04T10:23:51
173,720,526
0
0
null
null
null
null
UTF-8
Java
false
false
1,549
java
package com.actionbarsherlock.internal.nineoldandroids.widget; import android.content.Context; import android.util.AttributeSet; import android.widget.LinearLayout; import com.actionbarsherlock.internal.nineoldandroids.view.animation.AnimatorProxy; public class NineLinearLayout extends LinearLayout { private final AnimatorProxy mProxy; public NineLinearLayout(Context context, AttributeSet attributeSet) { super(context, attributeSet); this.mProxy = AnimatorProxy.NEEDS_PROXY ? AnimatorProxy.wrap(this) : null; } public void setVisibility(int i) { if (this.mProxy != null) { if (i == 8) { clearAnimation(); } else if (i == 0) { setAnimation(this.mProxy); } } super.setVisibility(i); } public float getAlpha() { if (AnimatorProxy.NEEDS_PROXY) { return this.mProxy.getAlpha(); } return super.getAlpha(); } public void setAlpha(float f) { if (AnimatorProxy.NEEDS_PROXY) { this.mProxy.setAlpha(f); } else { super.setAlpha(f); } } public float getTranslationX() { if (AnimatorProxy.NEEDS_PROXY) { return this.mProxy.getTranslationX(); } return super.getTranslationX(); } public void setTranslationX(float f) { if (AnimatorProxy.NEEDS_PROXY) { this.mProxy.setTranslationX(f); } else { super.setTranslationX(f); } } }
[ "shanzid.shaiham@gmail.com" ]
shanzid.shaiham@gmail.com
9664a8f3ad847577a2368035c2869482e8b81ee9
92ca0999ead1bb0d4dbd93ccd16a6b6c276b0396
/src/main/java/com/highguard/Wisdom/struts/service/impl/DeviceServiceImpl.java
87212529b937f9a94a6ddf69248489e32be1e1f7
[]
no_license
soybean217/locker_g
f39a4e124c39bc280571dfee79ed4f8cf2b6d777
4b658abf6db4e73fc97711c348ecbc6313724361
refs/heads/master
2021-07-04T15:39:41.326070
2019-03-22T02:52:55
2019-03-22T02:52:55
146,378,804
0
0
null
null
null
null
UTF-8
Java
false
false
1,045
java
package com.highguard.Wisdom.struts.service.impl; import java.util.List; import javax.annotation.Resource; import org.hibernate.Criteria; import org.hibernate.SessionFactory; import org.hibernate.classic.Session; import org.hibernate.criterion.Expression; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.highguard.Wisdom.exception.WisdomException; import com.highguard.Wisdom.mgmt.hibernate.beans.Device; import com.highguard.Wisdom.struts.service.DeviceService; @Service @Transactional(rollbackFor = { Exception.class, WisdomException.class }) public class DeviceServiceImpl implements DeviceService{ @Resource SessionFactory factory; @Override public List<Device> getDeviceList(String location) { Session session = factory.getCurrentSession(); Criteria criteria = session.createCriteria(Device.class); if(null!=location){ criteria.add(Expression.like("location", "%"+location+"%")); } List <Device> list = criteria.list(); return list; } }
[ "13565644@qq.com" ]
13565644@qq.com
eaf97114e66ba68c9c73df1a5de0e2366c5e5af5
784017131b5eadffd3bec254f9304225e648d3a3
/app/src/main/java/android/support/p001v4/app/OneShotPreDrawListener.java
ba277b700a74adda512d728fe6809d135fcf0bad
[]
no_license
Nienter/kdshif
e6126b3316f4b6e15a7dc6a67253f5729515fb4c
4d65454bb331e4439ed948891aa0173655d66934
refs/heads/master
2022-12-03T19:57:04.981078
2020-08-06T11:28:14
2020-08-06T11:28:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,610
java
package android.support.p001v4.app; import android.view.View; import android.view.ViewTreeObserver; /* renamed from: android.support.v4.app.OneShotPreDrawListener */ class OneShotPreDrawListener implements View.OnAttachStateChangeListener, ViewTreeObserver.OnPreDrawListener { private final Runnable mRunnable; private final View mView; private ViewTreeObserver mViewTreeObserver; private OneShotPreDrawListener(View view, Runnable runnable) { this.mView = view; this.mViewTreeObserver = view.getViewTreeObserver(); this.mRunnable = runnable; } public static OneShotPreDrawListener add(View view, Runnable runnable) { OneShotPreDrawListener oneShotPreDrawListener = new OneShotPreDrawListener(view, runnable); view.getViewTreeObserver().addOnPreDrawListener(oneShotPreDrawListener); view.addOnAttachStateChangeListener(oneShotPreDrawListener); return oneShotPreDrawListener; } public boolean onPreDraw() { removeListener(); this.mRunnable.run(); return true; } public void removeListener() { if (this.mViewTreeObserver.isAlive()) { this.mViewTreeObserver.removeOnPreDrawListener(this); } else { this.mView.getViewTreeObserver().removeOnPreDrawListener(this); } this.mView.removeOnAttachStateChangeListener(this); } public void onViewAttachedToWindow(View view) { this.mViewTreeObserver = view.getViewTreeObserver(); } public void onViewDetachedFromWindow(View view) { removeListener(); } }
[ "niu@eptonic.com" ]
niu@eptonic.com
4ba8e588497e7cd89cf9dbf1af92fd366765f40b
cb5e302cbbb3da0d6d6b0011768cd7466efa6183
/src/com/handmark/pulltorefresh/library/PullToRefreshBase$OnPullEventListener.java
a02e1e3239a4cfc79f27dd61e9a438867ecc9362
[]
no_license
marcusrogerio/miband-1
e6cdcfce00d7186e25e184ca4c258a72b0aba097
b3498784582eb30eb2b06c3d054bcf80b04138d0
refs/heads/master
2021-05-06T23:33:01.192152
2014-08-30T11:42:00
2014-08-30T11:42:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
518
java
package com.handmark.pulltorefresh.library; import android.view.View; public abstract interface PullToRefreshBase$OnPullEventListener<V extends View> { public abstract void onPullEvent(PullToRefreshBase<V> paramPullToRefreshBase, PullToRefreshBase.State paramState, PullToRefreshBase.Mode paramMode); } /* Location: C:\Users\Fernando\Desktop\Mibandesv2.3\classes-dex2jar.jar * Qualified Name: com.handmark.pulltorefresh.library.PullToRefreshBase.OnPullEventListener * JD-Core Version: 0.6.2 */
[ "kilfer.zgz@gmail.com" ]
kilfer.zgz@gmail.com
bafbb0d35a11fed7c27e72ec339136f5cda9ca41
52e18ef3dfd838a06449e1df56889fef05e84c41
/IloveSeoul_source_from_JADX/gnu/xml/MappingInfo.java
99739657ee8c3248e144c8078a34849edc4efe12
[ "MIT" ]
permissive
MobileSeoul/2017seoul-55
75dda8bbcd51f4648e7f44e80b46a6d543d57b14
55f8f8a97bf954b47753e2d750dac723354bcbab
refs/heads/master
2021-05-05T01:57:26.306068
2018-02-01T01:23:36
2018-02-01T01:23:36
119,765,284
5
1
null
null
null
null
UTF-8
Java
false
false
2,144
java
package gnu.xml; import gnu.mapping.Symbol; /* compiled from: XMLFilter */ final class MappingInfo { int index = -1; String local; NamespaceBinding namespaces; MappingInfo nextInBucket; String prefix; Symbol qname; int tagHash; XName type; String uri; MappingInfo() { } static int hash(String prefix, String local) { int hash = local.hashCode(); if (prefix != null) { return hash ^ prefix.hashCode(); } return hash; } static int hash(char[] data, int start, int length) { int hash = 0; int prefixHash = 0; int colonPos = -1; for (int i = 0; i < length; i++) { char ch = data[start + i]; if (ch != ':' || colonPos >= 0) { hash = (hash * 31) + ch; } else { colonPos = i; prefixHash = hash; hash = 0; } } return prefixHash ^ hash; } boolean match(char[] data, int start, int length) { if (this.prefix == null) { return equals(this.local, data, start, length); } int localLength = this.local.length(); int prefixLength = this.prefix.length(); return length == (prefixLength + 1) + localLength && data[prefixLength] == ':' && equals(this.prefix, data, start, prefixLength) && equals(this.local, data, (start + prefixLength) + 1, localLength); } static boolean equals(String tag, StringBuffer sbuf) { int length = sbuf.length(); if (tag.length() != length) { return false; } for (int i = 0; i < length; i++) { if (sbuf.charAt(i) != tag.charAt(i)) { return false; } } return true; } static boolean equals(String tag, char[] data, int start, int length) { if (tag.length() != length) { return false; } for (int i = 0; i < length; i++) { if (data[start + i] != tag.charAt(i)) { return false; } } return true; } }
[ "mobile@seoul.go.kr" ]
mobile@seoul.go.kr
448a8ccefafe88b292e8783562dcf27b4aa54d99
eafbf6397530f6dc87a334859fd02791c713e533
/integration-tests/it-common/src/main/java/org/apache/servicecomb/it/schema/generic/AbstractBaseService.java
9bdae500f2babaef053045878431cfdccba1d5e6
[ "Apache-2.0" ]
permissive
KangZhiDong/servicecomb-java-chassis
e4dacb377245e2fec107ccd08b74a13e5f3b2453
098da0d5fb99268603348d87ca83f51d021a0464
refs/heads/master
2020-07-15T15:58:46.696910
2019-08-31T22:19:13
2019-08-31T22:19:13
205,601,438
1
0
Apache-2.0
2019-08-31T22:12:29
2019-08-31T22:12:29
null
UTF-8
Java
false
false
1,371
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.servicecomb.it.schema.generic; import java.util.List; public class AbstractBaseService<T extends AbstractBean> implements IBaseService<T> { private IBaseService<T> target; protected AbstractBaseService(IBaseService<T> t) { target = t; } @Override public T hello(T a) { return target.hello(a); } @Override public T[] helloBody(T[] a) { return target.helloBody(a); } @Override public List<T> helloList(List<T> a) { return a; } @Override public PersonBean actual() { return target.actual(); } }
[ "bismy@qq.com" ]
bismy@qq.com
805a6c2d20cef0ec2127695c67883a5ee65089fb
03ade53b9b2a2c775b5c7d39be2d96b551f98cae
/app/src/main/java/com/sshy/yjy/strore/mate/detail/shopDetail/comment/CommentFields.java
83bb22fe79c94ab97908153216d7fc5bc199f7a7
[]
no_license
JoeyChow1989/YiShanHome-master
09b110728d0e2ecc50cf5ed94015717af62670ef
85501b2fb422e3d5c104077212c8d7db560607f4
refs/heads/master
2020-06-02T21:13:50.334139
2019-06-11T07:06:00
2019-06-11T07:06:00
191,311,279
0
0
null
null
null
null
UTF-8
Java
false
false
324
java
package com.sshy.yjy.strore.mate.detail.shopDetail.comment; /** * create date:2018/9/7 * create by:周正尧 */ public enum CommentFields { ID, TAB, NUM, ONTIME, CID, MID, COMMENT_ID, NAME, HEAD, QSTAR, ASTAR, PSTAR, TIME, TITLE, PICS, POS, DEL }
[ "100360258@qq.com" ]
100360258@qq.com
7693724e35ea1aecddd58802e6b9df15446e0e0f
23f841f1dda59b4621672d9e69ca53f1a6180729
/src/RGiesecke/DllExport/DllExportAttribute.java
587875659e857889d6a3e2033b7f27341ab6687a
[]
no_license
Javonet-io-user/f9c3dd3f-d120-4d96-b07f-2f2d4c8afc2a
79fdaf10d8fa87e585ba6f21f28765c5f9014e5c
267e296e2e2a0413ebae46270038d3307aa5eaf6
refs/heads/master
2020-05-15T03:24:56.716267
2019-04-18T10:30:27
2019-04-18T10:30:27
182,067,585
0
0
null
null
null
null
UTF-8
Java
false
false
3,870
java
package RGiesecke.DllExport; import Common.Activation; import static Common.JavonetHelper.Convert; import static Common.JavonetHelper.getGetObjectName; import static Common.JavonetHelper.getReturnObjectName; import static Common.JavonetHelper.ConvertToConcreteInterfaceImplementation; import Common.JavonetHelper; import Common.MethodTypeAnnotation; import com.javonet.Javonet; import com.javonet.JavonetException; import com.javonet.JavonetFramework; import com.javonet.api.NObject; import com.javonet.api.NEnum; import com.javonet.api.keywords.NRef; import com.javonet.api.keywords.NOut; import com.javonet.api.NControlContainer; import java.util.concurrent.atomic.AtomicReference; import java.util.Iterator; import java.lang.*; import jio.System.*; import RGiesecke.DllExport.*; import jio.System.Runtime.InteropServices.*; public class DllExportAttribute extends Attribute implements _Attribute { protected NObject javonetHandle; /** SetProperty */ @MethodTypeAnnotation(type = "SetField") public void setCallingConvention(CallingConvention value) { try { javonetHandle.set("CallingConvention", NEnum.fromJavaEnum(value)); } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); } } /** GetProperty */ @MethodTypeAnnotation(type = "GetField") public CallingConvention getCallingConvention() { try { Object res = javonetHandle.<NEnum>get("CallingConvention"); if (res == null) return null; return CallingConvention.valueOf(((NEnum) res).getValueName()); } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); return null; } } /** SetProperty */ @MethodTypeAnnotation(type = "SetField") public void setExportName(java.lang.String value) { try { javonetHandle.set("ExportName", value); } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); } } /** GetProperty */ @MethodTypeAnnotation(type = "GetField") public java.lang.String getExportName() { try { java.lang.String res = javonetHandle.get("ExportName"); if (res == null) return ""; return (java.lang.String) res; } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); return ""; } } public DllExportAttribute() { super((NObject) null); try { javonetHandle = Javonet.New("RGiesecke.DllExport.DllExportAttribute"); super.setJavonetHandle(javonetHandle); } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); } } public DllExportAttribute(java.lang.String exportName) { super((NObject) null); try { javonetHandle = Javonet.New("RGiesecke.DllExport.DllExportAttribute", exportName); super.setJavonetHandle(javonetHandle); } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); } } public DllExportAttribute(java.lang.String exportName, CallingConvention callingConvention) { super((NObject) null); try { javonetHandle = Javonet.New( "RGiesecke.DllExport.DllExportAttribute", exportName, NEnum.fromJavaEnum(callingConvention)); super.setJavonetHandle(javonetHandle); } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); } } public DllExportAttribute(NObject handle) { super(handle); this.javonetHandle = handle; } public void setJavonetHandle(NObject handle) { this.javonetHandle = handle; } static { try { Activation.initializeJavonet(); } catch (java.lang.Exception e) { e.printStackTrace(); } } }
[ "support@javonet.com" ]
support@javonet.com
5499b3cf344cbd48bef705b0d3c3314d9c27e236
edfb435ee89eec4875d6405e2de7afac3b2bc648
/tags/selenium-2.0.alpha-5/android/server/src/java/org/openqa/selenium/android/events/SendKeys.java
19a949e95f05f1dcda9d0a8e689bad3a52b8a7b7
[ "Apache-2.0" ]
permissive
Escobita/selenium
6c1c78fcf0fb71604e7b07a3259517048e584037
f4173df37a79ab6dd6ae3f1489ae0cd6cc7db6f1
refs/heads/master
2021-01-23T21:01:17.948880
2012-12-06T22:47:50
2012-12-06T22:47:50
8,271,631
1
0
null
null
null
null
UTF-8
Java
false
false
3,506
java
/* Copyright 2010 WebDriver committers Copyright 2010 Google Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.openqa.selenium.android.events; import org.openqa.selenium.Keys; import org.openqa.selenium.android.RunnableWithArgs; //import org.openqa.selenium.android.intents.DoNativeActionIntent; import android.os.Bundle; import android.util.Log; import android.view.KeyCharacterMap; import android.view.KeyEvent; import android.webkit.WebView; public class SendKeys implements RunnableWithArgs { private String text; private boolean last; private static final String LOG_TAG = SendKeys.class.getName(); public void init(Bundle bundle) { text = bundle.getString("arg_0"); last = bundle.getBoolean("arg_1"); } public void run(WebView webView) { Log.d(LOG_TAG, "SendKeys :: preparing to send " + text); if (text == null) { return; } if (text.contains(Keys.SPACE)) { text = text.replace(Keys.SPACE, " "); } KeyCharacterMap keyCharacterMap = KeyCharacterMap.load(KeyCharacterMap.BUILT_IN_KEYBOARD); KeyEvent[] events = null; if (text.length() == 1) { for (Keys key : Keys.values()) { if (key.charAt(0) == text.charAt(0)) { Log.d(LOG_TAG, "Code " + key.name()); events = new KeyEvent[2]; int code = getAndroidKeyEventCode(key); if (code != -1) { events[0] = new KeyEvent(KeyEvent.ACTION_DOWN, code); events[1] = new KeyEvent(KeyEvent.ACTION_UP, code); Log.d(LOG_TAG, "Key: " + code); } else { Log.d(LOG_TAG, "Key was detected, but Android analogue was not found"); return; } break; } } } if (events == null) { events = keyCharacterMap.getEvents(text.toCharArray()); } if (events != null) { for (KeyEvent event : events) { webView.dispatchKeyEvent(event); } } // TODO(berrada): This is slightly out of kilter with the main webdriver APIs. Might be okay, though if (last) { NativeUtil.clearFocus(webView); } } public static int getAndroidKeyEventCode(Keys key) { switch (key) { case ARROW_DOWN: return KeyEvent.KEYCODE_DPAD_DOWN; case DOWN: return KeyEvent.KEYCODE_DPAD_DOWN; case ARROW_LEFT: return KeyEvent.KEYCODE_DPAD_LEFT; case LEFT: return KeyEvent.KEYCODE_DPAD_LEFT; case ARROW_RIGHT: return KeyEvent.KEYCODE_DPAD_RIGHT; case RIGHT: return KeyEvent.KEYCODE_DPAD_RIGHT; case ARROW_UP: return KeyEvent.KEYCODE_DPAD_UP; case UP: return KeyEvent.KEYCODE_DPAD_UP; case BACK_SPACE: return KeyEvent.KEYCODE_DEL; case ENTER: return KeyEvent.KEYCODE_ENTER; case SPACE: return KeyEvent.KEYCODE_SPACE; default: return -1; } } }
[ "simon.m.stewart@07704840-8298-11de-bf8c-fd130f914ac9" ]
simon.m.stewart@07704840-8298-11de-bf8c-fd130f914ac9
f78fbb3e0c03d74154c712f47dad2e6247998e58
573a66e4f4753cc0f145de8d60340b4dd6206607
/JS-CS-Detection-byExample/Dataset (ALERT 5 GB)/410152/FileBot v2/filebot-code-2500-trunk/source/net/filebot/cli/CLILogging.java
2e416bd90af35b3e5c3ea9e2e08594546da111fd
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
mkaouer/Code-Smells-Detection-in-JavaScript
3919ec0d445637a7f7c5f570c724082d42248e1b
7130351703e19347884f95ce6d6ab1fb4f5cfbff
refs/heads/master
2023-03-09T18:04:26.971934
2022-03-23T22:04:28
2022-03-23T22:04:28
73,915,037
8
3
null
2023-02-28T23:00:07
2016-11-16T11:47:44
null
UTF-8
Java
false
false
1,431
java
package net.filebot.cli; import static java.lang.System.*; import java.io.PrintStream; import java.util.logging.Handler; import java.util.logging.Level; import java.util.logging.LogRecord; import java.util.logging.Logger; import org.codehaus.groovy.runtime.StackTraceUtils; class CLILogging extends Handler { public static final Logger CLILogger = createCommandlineLogger("net.filebot.logger.cli"); private static Logger createCommandlineLogger(String name) { Logger log = Logger.getLogger(name); log.setLevel(Level.ALL); // don't use parent handlers log.setUseParentHandlers(false); // CLI handler log.addHandler(new CLILogging()); return log; } @Override public void publish(LogRecord record) { if (record.getLevel().intValue() <= getLevel().intValue()) return; // make sure all previous messages are already flushed System.out.flush(); System.err.flush(); // use either System.out or System.err depending on the severity of the error PrintStream out = record.getLevel().intValue() < Level.WARNING.intValue() ? System.out : System.err; // print messages out.println(record.getMessage()); if (record.getThrown() != null) { StackTraceUtils.deepSanitize(record.getThrown()).printStackTrace(out); } // flush every message immediately out.flush(); } @Override public void close() throws SecurityException { } @Override public void flush() { out.flush(); } }
[ "mmkaouer@umich.edu" ]
mmkaouer@umich.edu
48d741f0fb4989407e2d2c3222ef0e952ff52dd9
b9c37f8afb13cff6d347f2461fdc9663775cfc69
/src/demo/src/main/java/demo/DemoUserAuthenticationConverter.java
1a5178b8efd64c92acdcab87180a1ca82e25ef85
[ "Apache-2.0" ]
permissive
honoraryrangers/inception
9e8042ac3ae067a19c9e0792fe3af27529085f49
5cde2cfab5a85c4269dc936959525dca17e6e6d1
refs/heads/master
2023-07-18T01:18:49.491898
2021-09-06T10:21:59
2021-09-06T10:21:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,396
java
/// * // * Copyright 2021 Marcus Portmann // * // * 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 digital.inception.demo; // // // // import digital.inception.security.ISecurityService; // import java.util.ArrayList; // import java.util.Collection; // import java.util.LinkedHashMap; // import java.util.Map; // import org.springframework.beans.factory.annotation.Autowired; // import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; // import org.springframework.security.core.Authentication; // import org.springframework.security.core.GrantedAuthority; // import org.springframework.security.core.authority.AuthorityUtils; // import org.springframework.security.oauth2.provider.token.UserAuthenticationConverter; // import org.springframework.util.StringUtils; // // // /// ** // * The <b>DemoUserAuthenticationConverter</b> class. // * // * @author Marcus Portmann // */ // public class DemoUserAuthenticationConverter implements UserAuthenticationConverter { // // @Autowired private ISecurityService securityService; // // @Override // public Map<String, ?> convertUserAuthentication(Authentication authentication) { // Map<String, Object> response = new LinkedHashMap<>(); // response.put(USERNAME, authentication.getName()); // // if ((authentication.getAuthorities() != null) && !authentication.getAuthorities().isEmpty()) { // response.put(AUTHORITIES, // AuthorityUtils.authorityListToSet(authentication.getAuthorities())); // } // // return response; // } // // @Override // public Authentication extractAuthentication(Map<String, ?> map) { // if (map.containsKey(USERNAME)) { // Object principal = map.get(USERNAME); // Collection<? extends GrantedAuthority> authorities = getAuthorities(map); // // // if (userDetailsService != null) { // // UserDetails user = userDetailsService.loadUserByUsername((String) // map.get(USERNAME)); // // authorities = user.getAuthorities(); // // principal = user; // // } // return new UsernamePasswordAuthenticationToken(principal, "N/A", authorities); // } // // return null; // } // // private Collection<? extends GrantedAuthority> getAuthorities(Map<String, ?> map) { // if (!map.containsKey(AUTHORITIES)) { // return new ArrayList<>(); // } // // Object authorities = map.get(AUTHORITIES); // if (authorities instanceof String) { // return AuthorityUtils.commaSeparatedStringToAuthorityList((String) authorities); // } // // if (authorities instanceof Collection) { // return AuthorityUtils.commaSeparatedStringToAuthorityList( // StringUtils.collectionToCommaDelimitedString((Collection<?>) authorities)); // } // // throw new IllegalArgumentException("Authorities must be either a String or a Collection"); // } // }
[ "marcus@mmp.guru" ]
marcus@mmp.guru
14150656a6d7e2e068984415c4fe63078234bb67
f494ed72f830aa29a9613f76ca3d8e70c5f1153e
/i-jetty-ui/src/org/mortbay/ijetty/SocketClient.java
a5a765916b36f3b6f75607e2b2ed9d9183efde93
[]
no_license
huanghengmin/i-jetty
ad23e22f41d219cb5ddd20f8aa61dcf390251ac6
4d54df75d0aa3d38504b5ab13fa2c23605305ed9
refs/heads/master
2021-01-01T05:08:54.414748
2016-04-16T03:26:55
2016-04-16T03:26:55
56,363,510
0
1
null
null
null
null
UTF-8
Java
false
false
1,184
java
package org.mortbay.ijetty; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.Socket; import java.net.UnknownHostException; public class SocketClient { private final String localhost = "127.0.0.1"; private final int port = 7505; static Socket client; public SocketClient() { try { client = new Socket(localhost,port); } catch (UnknownHostException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } public String sendMsg(String msg) { try { BufferedReader in = new BufferedReader(new InputStreamReader(client.getInputStream())); PrintWriter out = new PrintWriter(client.getOutputStream()); out.println(msg); out.flush(); return in.readLine(); } catch (IOException e) { e.printStackTrace(); } return ""; } public void closeSocket() { try { client.close(); } catch (IOException e) { e.printStackTrace(); } } }
[ "465805947@QQ.com" ]
465805947@QQ.com
d93623a741f99725d437bb57d122cc0d5b0b49d6
b280a34244a58fddd7e76bddb13bc25c83215010
/scmv6/center-merge/src/main/java/com/smate/center/merge/dao/group/GroupDynamicAwardsDao.java
d7ae41f9f742cd594bff817b531e27dfdc719189
[]
no_license
hzr958/myProjects
910d7b7473c33ef2754d79e67ced0245e987f522
d2e8f61b7b99a92ffe19209fcda3c2db37315422
refs/heads/master
2022-12-24T16:43:21.527071
2019-08-16T01:46:18
2019-08-16T01:46:18
202,512,072
2
3
null
2022-12-16T05:31:05
2019-08-15T09:21:04
Java
UTF-8
Java
false
false
722
java
package com.smate.center.merge.dao.group; import java.util.List; import org.springframework.stereotype.Repository; import com.smate.center.merge.model.sns.group.GroupDynamicAwards; import com.smate.core.base.utils.data.SnsHibernateDao; /** * 群组动态赞 记录 dao * * @author tsz * */ @Repository public class GroupDynamicAwardsDao extends SnsHibernateDao<GroupDynamicAwards, Long> { /** * 得到当前人的动态赞 * * @param awardPsnId * @return */ public List<GroupDynamicAwards> getListByPsnId(Long awardPsnId) { String hql = "from GroupDynamicAwards g where g.awardPsnId =:awardPsnId "; return this.createQuery(hql).setParameter("awardPsnId", awardPsnId).list(); } }
[ "zhiranhe@irissz.com" ]
zhiranhe@irissz.com
079b454743417d74cbc3bffec283b9ca3debc967
754f866cfd3d633af4f88d35dc76f26ab892cb1d
/src/main/java/club/crazypenguin/modules/cms/entity/Category.java
e567fc94f320f59acb80f0a011d3a9a2e861e660
[]
no_license
jamiebolton/Heracles
c6d395e7701a298835e9e89a6d453f3303174013
6dba6f18cb53cc8df094a1ad6f918dd87e78b48e
refs/heads/master
2020-12-31T05:09:51.162885
2016-06-07T06:41:20
2016-06-07T06:41:20
58,625,554
0
0
null
null
null
null
UTF-8
Java
false
false
7,373
java
/** * Copyright &copy; 2012-2014 <a href="https://github.com/jamiebolton/Heracles">Heracles</a> All rights reserved. */ package club.crazypenguin.modules.cms.entity; import java.util.Date; import java.util.List; import club.crazypenguin.common.persistence.TreeEntity; import club.crazypenguin.modules.cms.utils.CmsUtils; import org.hibernate.validator.constraints.Length; import com.google.common.collect.Lists; import club.crazypenguin.common.config.Global; import club.crazypenguin.modules.sys.entity.Office; /** * 栏目Entity * @author crazypenguin * @version 2013-05-15 */ public class Category extends TreeEntity<Category> { public static final String DEFAULT_TEMPLATE = "frontList"; private static final long serialVersionUID = 1L; private Site site; // 归属站点 private Office office; // 归属部门 // private Category parent;// 父级菜单 // private String parentIds;// 所有父级编号 private String module; // 栏目模型(article:文章;picture:图片;download:下载;link:链接;special:专题) // private String name; // 栏目名称 private String image; // 栏目图片 private String href; // 链接 private String target; // 目标( _blank、_self、_parent、_top) private String description; // 描述,填写有助于搜索引擎优化 private String keywords; // 关键字,填写有助于搜索引擎优化 // private Integer sort; // 排序(升序) private String inMenu; // 是否在导航中显示(1:显示;0:不显示) private String inList; // 是否在分类页中显示列表(1:显示;0:不显示) private String showModes; // 展现方式(0:有子栏目显示栏目列表,无子栏目显示内容列表;1:首栏目内容列表;2:栏目第一条内容) private String allowComment;// 是否允许评论 private String isAudit; // 是否需要审核 private String customListView; // 自定义列表视图 private String customContentView; // 自定义内容视图 private String viewConfig; // 视图参数 private Date beginDate; // 开始时间 private Date endDate; // 结束时间 private String cnt;//信息量 private String hits;//点击量 private List<Category> childList = Lists.newArrayList(); // 拥有子分类列表 public Category(){ super(); this.module = ""; this.sort = 30; this.inMenu = Global.HIDE; this.inList = Global.SHOW; this.showModes = "0"; this.allowComment = Global.NO; this.delFlag = DEL_FLAG_NORMAL; this.isAudit = Global.NO; } public Category(String id){ this(); this.id = id; } public Category(String id, Site site){ this(); this.id = id; this.setSite(site); } public Site getSite() { return site; } public String getHits() { return hits; } public void setHits(String hits) { this.hits = hits; } public void setSite(Site site) { this.site = site; } public Office getOffice() { return office; } public void setOffice(Office office) { this.office = office; } // @JsonBackReference // @NotNull public Category getParent() { return parent; } public void setParent(Category parent) { this.parent = parent; } // @Length(min=1, max=255) // public String getParentIds() { // return parentIds; // } // // public void setParentIds(String parentIds) { // this.parentIds = parentIds; // } @Length(min=0, max=20) public String getModule() { return module; } public void setModule(String module) { this.module = module; } // @Length(min=0, max=100) // public String getName() { // return name; // } // // public void setName(String name) { // this.name = name; // } @Length(min=0, max=255) public String getImage() { return image; } public void setImage(String image) { this.image = image; } @Length(min=0, max=255) public String getHref() { return href; } public void setHref(String href) { this.href = href; } @Length(min=0, max=20) public String getTarget() { return target; } public Date getBeginDate() { return beginDate; } public void setBeginDate(Date beginDate) { this.beginDate = beginDate; } public Date getEndDate() { return endDate; } public void setEndDate(Date endDate) { this.endDate = endDate; } public void setTarget(String target) { this.target = target; } @Length(min=0, max=255) public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } @Length(min=0, max=255) public String getKeywords() { return keywords; } public void setKeywords(String keywords) { this.keywords = keywords; } // @NotNull // public Integer getSort() { // return sort; // } // // public void setSort(Integer sort) { // this.sort = sort; // } @Length(min=1, max=1) public String getInMenu() { return inMenu; } public void setInMenu(String inMenu) { this.inMenu = inMenu; } @Length(min=1, max=1) public String getInList() { return inList; } public void setInList(String inList) { this.inList = inList; } @Length(min=1, max=1) public String getShowModes() { return showModes; } public void setShowModes(String showModes) { this.showModes = showModes; } @Length(min=1, max=1) public String getAllowComment() { return allowComment; } public void setAllowComment(String allowComment) { this.allowComment = allowComment; } @Length(min=1, max=1) public String getIsAudit() { return isAudit; } public void setIsAudit(String isAudit) { this.isAudit = isAudit; } public String getCustomListView() { return customListView; } public void setCustomListView(String customListView) { this.customListView = customListView; } public String getCustomContentView() { return customContentView; } public void setCustomContentView(String customContentView) { this.customContentView = customContentView; } public String getViewConfig() { return viewConfig; } public void setViewConfig(String viewConfig) { this.viewConfig = viewConfig; } public List<Category> getChildList() { return childList; } public void setChildList(List<Category> childList) { this.childList = childList; } public String getCnt() { return cnt; } public void setCnt(String cnt) { this.cnt = cnt; } public static void sortList(List<Category> list, List<Category> sourcelist, String parentId){ for (int i=0; i<sourcelist.size(); i++){ Category e = sourcelist.get(i); if (e.getParent()!=null && e.getParent().getId()!=null && e.getParent().getId().equals(parentId)){ list.add(e); // 判断是否还有子节点, 有则继续获取子节点 for (int j=0; j<sourcelist.size(); j++){ Category child = sourcelist.get(j); if (child.getParent()!=null && child.getParent().getId()!=null && child.getParent().getId().equals(e.getId())){ sortList(list, sourcelist, e.getId()); break; } } } } } public String getIds() { return (this.getParentIds() !=null ? this.getParentIds().replaceAll(",", " ") : "") + (this.getId() != null ? this.getId() : ""); } public boolean isRoot(){ return isRoot(this.id); } public static boolean isRoot(String id){ return id != null && id.equals("1"); } public String getUrl() { return CmsUtils.getUrlDynamic(this); } }
[ "crazypenguin@aliyun.com" ]
crazypenguin@aliyun.com
357cab152eb8e9e3f0410aea8445e59f0a30ba77
ef38d70d9b0c20da068d967e089046e626b60dea
/apache-ant/AntBugResults/59/Between/Add nested mapp 6dbabcb77_diff.java
1b053026be0d121a0c6ba10b283c9dcfa68f264b
[]
no_license
martapanc/SATD-replication-package
0ea0e8a27582750d39f8742b3b9b2e81bb7ec25d
e3235d25235b3b46416239ee9764bfeccd2d7433
refs/heads/master
2021-07-18T14:28:24.543613
2020-07-10T09:04:40
2020-07-10T09:04:40
94,113,844
1
0
null
null
null
null
UTF-8
Java
false
false
4,789
java
diff --git a/src/testcases/org/apache/tools/ant/taskdefs/StyleTest.java b/src/testcases/org/apache/tools/ant/taskdefs/StyleTest.java index 220ec9683..595543f1a 100644 --- a/src/testcases/org/apache/tools/ant/taskdefs/StyleTest.java +++ b/src/testcases/org/apache/tools/ant/taskdefs/StyleTest.java @@ -1,123 +1,137 @@ /* * Copyright 2003-2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.apache.tools.ant.taskdefs; import org.apache.tools.ant.BuildFileTest; import org.apache.tools.ant.util.FileUtils; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.io.Reader; import java.io.FileWriter; /** * TestCases for <style> / <xslt> task. * @version 2003-08-05 */ public class StyleTest extends BuildFileTest { public StyleTest(String s) { super(s); } protected void setUp() throws Exception { configureProject("src/etc/testcases/taskdefs/style/build.xml"); //executeTarget("setup"); //commented out for performance while target is empty } protected void tearDown() throws Exception { executeTarget("teardown"); } public void testStyleIsSet() throws Exception { expectBuildException("testStyleIsSet", "no stylesheet specified"); } public void testTransferParameterSet() throws Exception { expectFileContains("testTransferParameterSet", // target "out/out.xml", // file "set='myvalue'"); // exptected string } public void testTransferParameterEmpty() throws Exception { expectFileContains("testTransferParameterEmpty", "out/out.xml", "empty=''"); } public void testTransferParameterUnset() throws Exception { expectFileContains("testTransferParameterUnset", "out/out.xml", "undefined='${value}'"); } public void testTransferParameterUnsetWithIf() throws Exception { expectFileContains("testTransferParameterUnsetWithIf", "out/out.xml", "undefined='undefined default value'"); } public void testNewerStylesheet() throws Exception { expectFileContains("testNewerStylesheet", "out/out.xml", "new-value"); } + public void testDefaultMapper() throws Exception { + assertTrue(!getProject().resolveFile("out/data.html").exists()); + expectFileContains("testDefaultMapper", + "out/data.html", + "set='myvalue'"); + } + + public void testCustomMapper() throws Exception { + assertTrue(!getProject().resolveFile("out/out.xml").exists()); + expectFileContains("testCustomMapper", + "out/out.xml", + "set='myvalue'"); + } + // ************* copied from ConcatTest ************* // ------------------------------------------------------ // Helper methods - should be in BuildFileTest // ----------------------------------------------------- private String getFileString(String filename) throws IOException { Reader r = null; try { r = new FileReader(getProject().resolveFile(filename)); return FileUtils.newFileUtils().readFully(r); } finally { try {r.close();} catch (Throwable ignore) {} } } private String getFileString(String target, String filename) throws IOException { executeTarget(target); return getFileString(filename); } private void expectFileContains( String target, String filename, String contains) throws IOException { String content = getFileString(target, filename); assertTrue( "expecting file " + filename + " to contain " + contains + " but got " + content, content.indexOf(contains) > -1); } }
[ "marta.pancaldi@stud-inf.unibz.it" ]
marta.pancaldi@stud-inf.unibz.it
bbd86bc419ed1cb9447adbd9e8e8f6c07a7de643
ebd10a9cc65cd041b26234e5801e804c241e64d9
/mytask-controller/src/main/java/com/qjxs/config/webpage/ErrorConfigurar.java
995990f0681988ba0e0a0ae3b9a0832abc5674f3
[]
no_license
fanrencainiao/mytask
4ff5e3fec6cedadb6b99ec81e1160210a3b03b59
29bd54f99b6f2bc2d84d080aaa5333da3d1a55a3
refs/heads/master
2022-07-06T01:19:54.128676
2020-06-09T06:45:23
2020-06-09T06:45:23
189,853,756
0
1
null
2022-06-17T02:10:15
2019-06-02T14:04:51
JavaScript
UTF-8
Java
false
false
773
java
package com.qjxs.config.webpage; import org.springframework.boot.web.server.ErrorPage; import org.springframework.boot.web.server.ErrorPageRegistrar; import org.springframework.boot.web.server.ErrorPageRegistry; import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpStatus; @Configuration public class ErrorConfigurar implements ErrorPageRegistrar { @Override public void registerErrorPages(ErrorPageRegistry registry) { ErrorPage[] errorPages = new ErrorPage[2]; errorPages[0] = new ErrorPage(HttpStatus.NOT_FOUND, "/templates/404"); errorPages[1] = new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/templates/500"); registry.addErrorPages(errorPages); } }
[ "Administrator@windows10.microdone.cn" ]
Administrator@windows10.microdone.cn
b820c940cdd70716f6b1cddf1586b20cb08b2680
88110cc3b0dfaf36263e98aa691d71e62be3f028
/zywork-app/src/main/java/top/zywork/dao/AccountDetailDAO.java
34d86d20c073e58ba0ee77c92f958c4e8f6220d4
[]
no_license
hyx-jetbrains/zywork-bid-system
9f515f3383afd7e730775804f14149addac17b39
f0b74ace8813082c462ff9a5f58be78112844569
refs/heads/master
2022-02-20T07:47:27.726850
2019-08-15T06:13:10
2019-08-15T06:13:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
631
java
package top.zywork.dao; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; import top.zywork.query.PageQuery; import java.util.List; /** * AccountDetailDAO数据访问接口<br/> * * 创建于2018-12-25<br/> * * @author http://zywork.top 王振宇 * @version 1.0 */ @Repository public interface AccountDetailDAO extends BaseDAO { @Override List<Object> listAllByCondition(@Param("query") Object queryObj); @Override List<Object> listPageByCondition(@Param("query") Object queryObj); @Override Long countByCondition(@Param("query") Object queryObj); }
[ "847315251@qq.com" ]
847315251@qq.com
6ed379fd0d6be727401a94234c06c58fed76ea99
cbd008fd2a51bdce386bba16190869a75e897f6c
/java/src/PartOne/Tree/q129/求根到叶子节点数字之和/Solution.java
8846d94d9d71228bcb129678e1a99c9b4862981c
[]
no_license
Archer-Fang/algorithm
06e0ba598bc128bb28aca88ae6514976769bf411
6c3eb27998c1f21ecb5d65c422ad8d4da67ebf90
refs/heads/master
2022-03-09T09:45:56.365126
2022-03-09T09:09:06
2022-03-09T09:09:06
230,906,996
1
0
null
null
null
null
UTF-8
Java
false
false
855
java
package PartOne.Tree.q129.求根到叶子节点数字之和; class Solution { int total_sum=0; public int sumNumbers(TreeNode root) { obtainPaths(root,0); return total_sum; } public void obtainPaths(TreeNode root,int sum) { sum+=root.val; if(root.right==null&root.left==null){ total_sum+=sum; } if(root.left!=null){ obtainPaths(root.left,sum*10); } if(root.right!=null){ obtainPaths(root.right,sum*10); } } } class Main{ public static void main(String[] args) { TreeNode t1=new TreeNode(1); TreeNode t2=new TreeNode(2); TreeNode t3=new TreeNode(3); t1.left=t2; t1.right=t3; Solution solution=new Solution(); System.out.println(solution.sumNumbers(t1)); } }
[ "1091053002@qq.com" ]
1091053002@qq.com
5db8c7806f0cb243f62eddf5ed7d2d275feb9a93
a4da60b6d4e717ac1d2923539ab1f8075a377a39
/ocPortal/src/main/java/com/online/portal/controller/PortalController.java
385a37596c4736014d7bd600d5478818a826e615
[]
no_license
SsrDs/ocProject
889aa772a13dc21dc784645b114b22610fdcacdd
f9c038b4e3e20fdc9f6930d249e3b6adb4140200
refs/heads/master
2020-05-05T03:28:10.151092
2019-04-11T13:41:00
2019-04-11T13:41:00
179,673,671
0
0
null
null
null
null
UTF-8
Java
false
false
3,848
java
package com.online.portal.controller; import com.online.core.auth.domain.AuthUser; import com.online.core.auth.service.IAuthUserService; import com.online.core.consts.CourseEnum; import com.online.core.consts.domain.ConstsSiteCarousel; import com.online.core.consts.service.ISiteCarouselService; import com.online.core.course.domain.Course; import com.online.core.course.domain.CourseQueryDto; import com.online.core.course.service.ICourseService; import com.online.core.user.domain.User; import com.online.core.user.service.IUserTest; import com.online.portal.business.IPortalBusiness; import com.online.portal.vo.ConstsClassifyVO; 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.RequestParam; import org.springframework.web.servlet.ModelAndView; import java.util.List; @Controller @RequestMapping() public class PortalController { @Autowired private IUserTest userTest; @Autowired private ISiteCarouselService siteCarouselService; @Autowired private IPortalBusiness portalBusiness; @Autowired private ICourseService courseService; @Autowired private IAuthUserService authUserService; /** * 进入主页 * @return */ @RequestMapping("/index") public ModelAndView index(){ ModelAndView mv = new ModelAndView("index"); //加载轮播图片 List<ConstsSiteCarousel> carouselList = siteCarouselService.queryCarousels(4); mv.addObject("carouselList",carouselList); //课程分类(一级分类) List<ConstsClassifyVO> classifies = portalBusiness.queryAllClassify(); //课程推荐 portalBusiness.prepareRecomdCourses(classifies); mv.addObject("classifies",classifies); //获取5门实战课程推荐,根据(weight)进行排序 CourseQueryDto queryDto = new CourseQueryDto(); queryDto.setCount(5); //5门 queryDto.setFree(CourseEnum.FREE_NOT.value()); //非免费的课: 实战课 queryDto.descSortField("weight"); //按照weight排序 List<Course> actionCourseList = courseService.queryList(queryDto); // for (Course c: // actionCourseList) { // System.out.println(c.getName()+":\n"+c.getPicture()); // } mv.addObject("actionCourseList",actionCourseList); //获取5门免费课推荐,根据(weight)进行排序 queryDto.setFree(CourseEnum.FREE.value()); //免费的课 List<Course> freeCourseList = courseService.queryList(queryDto); mv.addObject("freeCourseList",freeCourseList); //获取7门java课程,根据(学习数量studyCount)进行排序 queryDto.setCount(7); queryDto.setFree(null); queryDto.setSubClassify("java"); queryDto.descSortField("studyCount"); //按照studyCount降序排列 List<Course> javaCourseList = courseService.queryList(queryDto); mv.addObject("javaCourseList",javaCourseList); //获取名校讲师 List<AuthUser> authUserList = authUserService.selectTeacher(); mv.addObject("authUserList",authUserList); return mv; } /** * 测试代码 * @param username * @param password * @return */ @RequestMapping(value = "/test") public ModelAndView register(@RequestParam("username") String username, @RequestParam("password") String password){ System.out.println("111111111111"+username); User user = new User(); user.setUsername(username); user.setPassword(password); userTest.register(user); ModelAndView mv = new ModelAndView("index"); return mv; } }
[ "email@example.com" ]
email@example.com
637564f8a595e18404884e096e6d77ae292448b8
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/JetBrains--kotlin/cce59aab7328fd7df97e2005e7ddb4cbfa21e518/before/NamespaceTranslator.java
b208eb21d5ed2565b494690562f3b736a8eda018
[]
no_license
fracz/refactor-extractor
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
dd5e82bfcc376e74a99e18c2bf54c95676914272
refs/heads/master
2021-01-19T06:50:08.211003
2018-11-30T13:00:57
2018-11-30T13:00:57
87,353,478
0
0
null
null
null
null
UTF-8
Java
false
false
4,069
java
/* * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.jetbrains.k2js.translate.declaration; import com.google.dart.compiler.backend.js.ast.*; import com.google.dart.compiler.util.AstUtil; import org.jetbrains.annotations.NotNull; import org.jetbrains.jet.lang.descriptors.NamespaceDescriptor; import org.jetbrains.k2js.translate.context.Namer; import org.jetbrains.k2js.translate.context.TranslationContext; import org.jetbrains.k2js.translate.general.AbstractTranslator; import org.jetbrains.k2js.translate.general.Translation; import org.jetbrains.k2js.translate.utils.BindingUtils; import java.util.ArrayList; import java.util.List; /** * @author Pavel.Talanov * <p/> * Genereate code for a single descriptor. */ public final class NamespaceTranslator extends AbstractTranslator { @NotNull private final NamespaceDescriptor descriptor; @NotNull private final JsName namespaceName; @NotNull private final ClassDeclarationTranslator classDeclarationTranslator; /*package*/ NamespaceTranslator(@NotNull NamespaceDescriptor descriptor, @NotNull ClassDeclarationTranslator classDeclarationTranslator, @NotNull TranslationContext context) { super(context.newDeclaration(descriptor)); this.descriptor = descriptor; this.namespaceName = context.getNameForDescriptor(descriptor); this.classDeclarationTranslator = classDeclarationTranslator; } //TODO: at the moment this check is very ineffective, possible solution is to cash the result of getDFN // other solution is to determine it's not affecting performance :D public boolean isNamespaceEmpty() { return BindingUtils.getDeclarationsForNamespace(context().bindingContext(), descriptor).isEmpty(); } @NotNull public JsStatement getInitializeStatement() { JsNameRef initializeMethodReference = Namer.initializeMethodReference(); AstUtil.setQualifier(initializeMethodReference, namespaceName.makeRef()); return AstUtil.newInvocation(initializeMethodReference).makeStmt(); } @NotNull private JsInvocation namespaceCreateMethodInvocation() { return AstUtil.newInvocation(context().namer().namespaceCreationMethodReference()); } @NotNull public JsStatement getDeclarationStatement() { JsInvocation namespaceDeclaration = namespaceCreateMethodInvocation(); addMemberDeclarations(namespaceDeclaration); addClassesDeclarations(namespaceDeclaration); return AstUtil.newVar(namespaceName, namespaceDeclaration); } private void addClassesDeclarations(@NotNull JsInvocation namespaceDeclaration) { namespaceDeclaration.getArguments().add(classDeclarationTranslator.classDeclarationsForNamespace(descriptor)); } private void addMemberDeclarations(@NotNull JsInvocation jsNamespace) { JsObjectLiteral jsClassDescription = translateNamespaceMemberDeclarations(); jsNamespace.getArguments().add(jsClassDescription); } @NotNull private JsObjectLiteral translateNamespaceMemberDeclarations() { List<JsPropertyInitializer> propertyList = new ArrayList<JsPropertyInitializer>(); propertyList.add(Translation.generateNamespaceInitializerMethod(descriptor, context())); propertyList.addAll(new DeclarationBodyVisitor().traverseNamespace(descriptor, context())); return new JsObjectLiteral(propertyList); } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
81bbebcefa0c1453e3e67efbe41fbd1bac851c08
afc757cc5283b27982958d48fc41fa366a961c28
/src/main/java/com/el/betting/sdk/v2/betline/bettype/moneyline/MoneyLineBetLineInfo.java
e3e39c1c77b4ce93f542ce44e9646930245b6968
[]
no_license
davithbul/sport-betting-api
c75b63013a1460d390e9c67923af88fd5c7fcd7a
943fc6defc2ead6e1e7767379f8ae1fa7bbd483c
refs/heads/master
2020-03-10T03:20:33.071695
2018-04-11T22:40:02
2018-04-11T22:40:02
129,162,169
0
0
null
null
null
null
UTF-8
Java
false
false
4,888
java
package com.el.betting.sdk.v2.betline.bettype.moneyline; import com.el.betting.sdk.v2.*;import com.el.betting.sdk.v4.*; import com.el.betting.sdk.v2.betline.api.BetLineInfo; import com.el.betting.sdk.v2.betoption.bettype.moneyline.MoneyLineBetOptionInfoBuilder; import com.el.betting.sdk.v2.betoption.bettype.moneyline.MoneyLineBetOptionInfo; import com.el.betting.sdk.v2.common.PropertyHelper; import com.el.betting.sdk.v2.pages.BettingPage; import com.el.betting.sdk.v4.Participant; import org.springframework.data.annotation.PersistenceConstructor; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Optional; import static com.el.betting.sdk.v2.PropertyType.*; public class MoneyLineBetLineInfo extends BetLineInfo<MoneyLineBetOptionInfo> { private final Team homeTeam; private final String homeTeamSelectionId; private final String drawSelectionId; private final Team awayTeam; private final String awayTeamSelectionId; @PersistenceConstructor protected MoneyLineBetLineInfo(long eventID, String lineID, Period period, BetType betType, Stake maxStake, OddsFormat oddsFormat, LocalDateTime startTime, Map<String, Object> additionalProperties, Team homeTeam, String homeTeamSelectionId, String drawSelectionId, Team awayTeam, String awayTeamSelectionId) { super(eventID, lineID, period, betType, maxStake, oddsFormat, startTime, additionalProperties); this.homeTeam = homeTeam; this.homeTeamSelectionId = homeTeamSelectionId; this.drawSelectionId = drawSelectionId; this.awayTeam = awayTeam; this.awayTeamSelectionId = awayTeamSelectionId; } public MoneyLineBetLineInfo(MoneyLineBetLineInfo betLineInfo) { super(betLineInfo); this.homeTeam = betLineInfo.getHomeTeam(); this.homeTeamSelectionId = betLineInfo.getHomeTeamSelectionId(); this.drawSelectionId = betLineInfo.getDrawSelectionId(); this.awayTeam = betLineInfo.getAwayTeam(); this.awayTeamSelectionId = betLineInfo.getAwayTeamSelectionId(); } public Team getHomeTeam() { return homeTeam; } public String getHomeTeamSelectionId() { return homeTeamSelectionId; } public String getDrawSelectionId() { return drawSelectionId; } public Team getAwayTeam() { return awayTeam; } public String getAwayTeamSelectionId() { return awayTeamSelectionId; } @Override public List<MoneyLineBetOptionInfo> getBetOptionsInfoList() { PropertyHelper propertyHelper = new PropertyHelper(getAdditionalProperties()); List<MoneyLineBetOptionInfo> betOptionsMeta = new ArrayList<>(); Event<? extends Participant> event = (Event) propertyHelper.getProperty("event", GLOBAL).orElse(null); MoneyLineBetOptionInfo homeBetOptionInfo = new MoneyLineBetOptionInfoBuilder().setEvent(event).setEventID(getEventID()).setSelectionID(getHomeTeamSelectionId()).setLineID(getLineID()).setPeriod(getPeriod()).setTeam(homeTeam).setBettingPage((BettingPage) propertyHelper.getProperty("bettingPage", HOME).orElse(null)).setMinStake(null).setMaxStake(null).setAdditionalProperties(propertyHelper.getProperties(HOME, GLOBAL)).createMoneyLineBetOptionInfo(); betOptionsMeta.add(homeBetOptionInfo); if (drawSelectionId != null) { MoneyLineBetOptionInfo drawBetOptionInfo = new MoneyLineBetOptionInfoBuilder().setEvent(event).setEventID(getEventID()).setSelectionID(getDrawSelectionId()).setLineID(getLineID()).setPeriod(getPeriod()).setTeam(Team.DRAW).setBettingPage((BettingPage) propertyHelper.getProperty("bettingPage", DRAW).orElse(null)).setMinStake(null).setMaxStake(null).setAdditionalProperties(propertyHelper.getProperties(DRAW, GLOBAL)).createMoneyLineBetOptionInfo(); betOptionsMeta.add(drawBetOptionInfo); } MoneyLineBetOptionInfo awayBetLine = new MoneyLineBetOptionInfoBuilder().setEvent(event).setEventID(getEventID()).setSelectionID(getAwayTeamSelectionId()).setLineID(getLineID()).setPeriod(getPeriod()).setTeam(awayTeam).setBettingPage((BettingPage) propertyHelper.getProperty("bettingPage", AWAY).orElse(null)).setMinStake(null).setMaxStake(null).setAdditionalProperties(propertyHelper.getProperties(AWAY, GLOBAL)).createMoneyLineBetOptionInfo(); betOptionsMeta.add(awayBetLine); return betOptionsMeta; } @Override public String toString() { return "MoneyLineBetLineInfo{" + "homeTeam=" + homeTeam + ", homeTeamSelectionId='" + homeTeamSelectionId + '\'' + ", drawSelectionId='" + drawSelectionId + '\'' + ", awayTeam=" + awayTeam + ", awayTeamSelectionId='" + awayTeamSelectionId + '\'' + "} " + super.toString(); } }
[ "davithbul@gmail.com" ]
davithbul@gmail.com
fbae6bc1ea8605eb43fab9ea6dbef90890591cbe
7368ce306f6e8c4eab99aad6a4b2cc56f011bacc
/play-services-core/src/main/java/org/microg/gms/icing/IndexService.java
6a980e347255c75c64bf015285c539be50775032
[ "Apache-2.0" ]
permissive
cuihujun/android_packages_apps_GmsCore
011efe1942e2e874d6b3555400ed38ff61cfcd3c
3519d337096d7e3f0fcfc1dda102d152320b048e
refs/heads/master
2021-01-17T05:34:37.771032
2015-08-29T15:49:52
2015-08-29T15:49:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,726
java
/* * Copyright 2013-2015 µg Project Team * * 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.microg.gms.icing; import android.os.RemoteException; import com.google.android.gms.common.api.CommonStatusCodes; import com.google.android.gms.common.internal.GetServiceRequest; import com.google.android.gms.common.internal.IGmsCallbacks; import org.microg.gms.BaseService; import org.microg.gms.common.Services; public class IndexService extends BaseService { private AppDataSearchImpl appDataSearch = new AppDataSearchImpl(); private GlobalSearchAdminImpl globalSearchAdmin = new GlobalSearchAdminImpl(); private SearchCorporaImpl searchCorpora = new SearchCorporaImpl(); private SearchQueriesImpl searchQueries = new SearchQueriesImpl(); public IndexService() { super("GmsIcingIndexSvc", Services.INDEX.SERVICE_ID, Services.SEARCH_ADMINISTRATION.SERVICE_ID, Services.SEARCH_CORPORA.SERVICE_ID, Services.SEARCH_GLOBAL.SERVICE_ID, Services.SEARCH_IME.SERVICE_ID, Services.SEARCH_QUERIES.SERVICE_ID); } @Override public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request) throws RemoteException { switch (request.serviceId) { case Services.INDEX.SERVICE_ID: callback.onPostInitComplete(0, appDataSearch.asBinder(), null); break; case Services.SEARCH_ADMINISTRATION.SERVICE_ID: callback.onPostInitComplete(CommonStatusCodes.ERROR, null, null); break; case Services.SEARCH_QUERIES.SERVICE_ID: callback.onPostInitComplete(0, searchQueries.asBinder(), null); break; case Services.SEARCH_GLOBAL.SERVICE_ID: callback.onPostInitComplete(0, globalSearchAdmin.asBinder(), null); break; case Services.SEARCH_CORPORA.SERVICE_ID: callback.onPostInitComplete(0, searchCorpora.asBinder(), null); break; case Services.SEARCH_IME.SERVICE_ID: callback.onPostInitComplete(CommonStatusCodes.ERROR, null, null); break; } } }
[ "github@rvin.mooo.com" ]
github@rvin.mooo.com
043525a079ecdb9b84a6aea660ec965dff672fa1
8adc4e0536ebf07054ba0acdbf0b2c2b987c267a
/xmy/xmy-activity-service/src/main/java/com/zfj/xmy/activity/service/wap/WapCouponService.java
6ca1a5281f1b95fde6f792dd14557f927a59a291
[]
no_license
haifeiforwork/xmy
f53c9e5f8d345326e69780c9ae6d7cf44e951016
abcf424be427168f9a9dac12a04f5a46224211ab
refs/heads/master
2020-05-03T02:05:40.499935
2018-03-06T09:21:15
2018-03-06T09:21:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,014
java
package com.zfj.xmy.activity.service.wap; import java.util.List; import com.appdev.db.common.CriteriaParameter; import com.appdev.db.common.pojo.PageBean; import com.zfj.xmy.activity.persistence.app.pojo.dto.AppCouponOutDto; import com.zfj.xmy.activity.persistence.app.pojo.dto.CouponSearchInDto; import com.zfj.xmy.common.ReqData; import com.zfj.xmy.common.persistence.pojo.Coupon; import com.zfj.xmy.common.persistence.pojo.CouponUser; import com.zfj.xmy.common.persistence.pojo.EntityCoupon; import com.zfj.xmy.common.persistence.pojo.TermData; import com.zfj.xmy.common.persistence.pojo.Vocabulary; import com.zfj.xmy.common.persistence.pojo.app.AppCouponInDto; public interface WapCouponService { /** * * @Description 插入一条优惠券信息 * @param coupon * @return * @Author liuw * @Date 2017年7月6日下午8:31:19 */ int insertCoupon(Coupon coupon); /** * * @Description 查找优惠券列表分页 * @param reqData * @param pageBean * @Author liuw * @Date 2017年7月6日下午8:33:10 */ void findCouponsAndPage(ReqData reqData,PageBean pageBean); /** * * @Description 根据主键删除 * @param string * @return * @Author liuw * @Date 2017年7月7日上午11:02:23 */ int deleteByPrimeryKey(Object string); /** * * @Description 根据Id查找coupon(优惠券) * @param id * @return * @Author liuw * @Date 2017年7月10日上午9:38:28 */ Coupon findCouponById(Object id); /** * * @Description 更新coupon * @param coupon * @return * @Author liuw * @Date 2017年7月10日下午4:04:26 */ int updateCoupon(Coupon coupon); /** /** * * @Description 根据IDs集合,转化得到supplierNames(供应商名字集合) * @param couponSupplierIds * @param supplierTermDatas * @return * @Author liuw * @Date 2017年7月10日下午4:17:56 */ String getCouponSupplierNames(String couponSupplierIds,List<TermData> supplierTermDatas ); /** * * @Description 计算出供应商名字集合 * @param useRangeType * @param useRangeIds * @param vocabularyByMark * @param categoryTermDatas * @param pageBeanGoods * @return * @Author liuw * @Date 2017年7月11日下午2:30:45 */ String getRangesNames(Integer useRangeType,String useRangeIds,Vocabulary vocabularyByMark ,List<TermData> categoryTermDatas,PageBean pageBeanGoods); /** * * @Description 根据条件,查找符合条件的优惠券(app) * @param reqData * @return * @Author liuw * @Date 2017年7月25日下午5:54:56 */ List<CouponUser> findCoupons(ReqData reqData); /** * * @Description 根据couponuser关系表中的couponid,查找出coupon记录 * @param couponUsers * @return * @Author liuw * @Date 2017年7月25日下午7:34:23 */ List<Coupon> transformByCouponUser(List<CouponUser> couponUsers); // /** // * // * @Description APP端根据条件查询优惠券详情<br> // * <pre> // * 查询类型:1 已过期 ;2 使用记录;3 未使用 // * private int useType; // * 使用范围 (1:全场通用;2:分类使用;3:限定商品;4:排队商品) // * private int useRange; // * 排序方法 1 过期时间 ; 2 最优惠 // * private int order; // * </pre> // * @param couponSearchInDto // * @return // * @Author liuw // * @Date 2017年8月1日下午8:37:18 // */ // List<EntityCoupon> findCoupon(Long userId,CouponSearchInDto couponSearchInDto); /** * * @Description 根据条件查询所有coupon(优惠券)列表 * @param criteriaParameter * @return * @Author liuw * @Date 2017年8月2日上午9:20:39 */ List<Coupon> findsCoupon(CriteriaParameter criteriaParameter); // /** // * 绑定实体券 // * @Description // * @param entityCoupon // * @param couponUser // * @Author liuw // * @Date 2017年8月4日下午2:27:45 // */ // void setEntityCouponBinding(EntityCoupon entityCoupon,CouponUser couponUser); /** * 根据id查询实体纸质优惠券 * @Description * @param id * @return * @Author liuw * @Date 2017年8月4日下午5:00:55 */ EntityCoupon findEntityCouponById(Long id); /** * 根据条件查找实体优惠券 * @Description * @param parameter * @return * @Author liuw * @Date 2017年8月4日下午5:29:26 */ List<EntityCoupon> findEntityCoupon(CriteriaParameter parameter); // /** // * 根据couponId查找该电子优惠券的已领取个数 // * @Description // * @param couponId // * @return // * @Author liuw // * @Date 2017年8月7日上午9:47:58 // */ // Integer countByCouponId(Long couponId); // /** // * 判断可用的优惠券 // * @Description // * @param userId // * @return // * @Author liuw // * @Date 2017年8月7日上午10:45:25 // */ // List<AppCouponOutDto> findsAllUsableCoupon(Long userId); // /** // * 领取电子优惠券 // * @Description // * @param coupon // * @Author liuw // * @Date 2017年9月11日下午5:23:33 // */ // void updateCouponReceive(AppCouponInDto coupon); }
[ "359479295@qq.com" ]
359479295@qq.com
b351417a24d0f985f70efc39c1df7655e44d738d
30ddf5223e6541a3f0249a3f898518a01d9e781a
/5.soap-web-services/src/main/java/com/in28minutes/soap/webservices/soapcoursemanagement/soap/CourseDetailsEndpoint.java
0603e75913a665451b2ebea6484860d8cc035830
[ "MIT" ]
permissive
cryptonkid/spring-interview-guide
7cac050a648a5fc5534e51ce52c56e8d1cf16f7c
b43687a1af8a5939329df1fafacec690aa86ad22
refs/heads/master
2022-11-06T00:45:41.259468
2022-07-31T01:16:12
2022-07-31T01:16:12
133,797,163
3
0
MIT
2019-10-28T09:30:34
2018-05-17T10:24:03
JavaScript
UTF-8
Java
false
false
3,650
java
package com.in28minutes.soap.webservices.soapcoursemanagement.soap; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.ws.server.endpoint.annotation.Endpoint; import org.springframework.ws.server.endpoint.annotation.PayloadRoot; import org.springframework.ws.server.endpoint.annotation.RequestPayload; import org.springframework.ws.server.endpoint.annotation.ResponsePayload; import com.in28minutes.courses.CourseDetails; import com.in28minutes.courses.DeleteCourseDetailsRequest; import com.in28minutes.courses.DeleteCourseDetailsResponse; import com.in28minutes.courses.GetAllCourseDetailsRequest; import com.in28minutes.courses.GetAllCourseDetailsResponse; import com.in28minutes.courses.GetCourseDetailsRequest; import com.in28minutes.courses.GetCourseDetailsResponse; import com.in28minutes.soap.webservices.soapcoursemanagement.soap.bean.Course; import com.in28minutes.soap.webservices.soapcoursemanagement.soap.exception.CourseNotFoundException; import com.in28minutes.soap.webservices.soapcoursemanagement.soap.service.CourseDetailsService; import com.in28minutes.soap.webservices.soapcoursemanagement.soap.service.CourseDetailsService.Status; @Endpoint public class CourseDetailsEndpoint { @Autowired CourseDetailsService service; // method // input - GetCourseDetailsRequest // output - GetCourseDetailsResponse // http://in28minutes.com/courses // GetCourseDetailsRequest @PayloadRoot(namespace = "http://in28minutes.com/courses", localPart = "GetCourseDetailsRequest") @ResponsePayload public GetCourseDetailsResponse processCourseDetailsRequest(@RequestPayload GetCourseDetailsRequest request) { Course course = service.findById(request.getId()); if (course == null) throw new CourseNotFoundException("Invalid Course Id " + request.getId()); return mapCourseDetails(course); } private GetCourseDetailsResponse mapCourseDetails(Course course) { GetCourseDetailsResponse response = new GetCourseDetailsResponse(); response.setCourseDetails(mapCourse(course)); return response; } private GetAllCourseDetailsResponse mapAllCourseDetails(List<Course> courses) { GetAllCourseDetailsResponse response = new GetAllCourseDetailsResponse(); for (Course course : courses) { CourseDetails mapCourse = mapCourse(course); response.getCourseDetails().add(mapCourse); } return response; } private CourseDetails mapCourse(Course course) { CourseDetails courseDetails = new CourseDetails(); courseDetails.setId(course.getId()); courseDetails.setName(course.getName()); courseDetails.setDescription(course.getDescription()); return courseDetails; } @PayloadRoot(namespace = "http://in28minutes.com/courses", localPart = "GetAllCourseDetailsRequest") @ResponsePayload public GetAllCourseDetailsResponse processAllCourseDetailsRequest( @RequestPayload GetAllCourseDetailsRequest request) { List<Course> courses = service.findAll(); return mapAllCourseDetails(courses); } @PayloadRoot(namespace = "http://in28minutes.com/courses", localPart = "DeleteCourseDetailsRequest") @ResponsePayload public DeleteCourseDetailsResponse deleteCourseDetailsRequest(@RequestPayload DeleteCourseDetailsRequest request) { Status status = service.deleteById(request.getId()); DeleteCourseDetailsResponse response = new DeleteCourseDetailsResponse(); response.setStatus(mapStatus(status)); return response; } private com.in28minutes.courses.Status mapStatus(Status status) { if (status == Status.FAILURE) return com.in28minutes.courses.Status.FAILURE; return com.in28minutes.courses.Status.SUCCESS; } }
[ "rangaraokaranam@Rangas-MacBook-Pro.local" ]
rangaraokaranam@Rangas-MacBook-Pro.local
c5e4940c5d6033b002ed422b26fd616841143a97
f6dc042aa4cdfe9bdc1c604b3968c1216cd76b3a
/xlmmlibrary/src/main/java/com/jimei/library/widget/zxing/encode/EncodingHandler.java
05136e8216edc1261782be2373e29add577dcdfc
[]
no_license
xiaolusys/xlmm-android
f730ccddeda6b9cd76811e1b222a511afae87fbe
2161c2ff3453b397f5512bb12b1f353f935130b9
refs/heads/master
2022-01-15T04:49:00.416802
2017-03-30T04:14:23
2017-03-30T04:14:23
188,804,952
0
0
null
null
null
null
UTF-8
Java
false
false
3,229
java
package com.jimei.library.widget.zxing.encode; import android.graphics.Bitmap; import android.util.Log; import com.google.zxing.BarcodeFormat; import com.google.zxing.EncodeHintType; import com.google.zxing.MultiFormatWriter; import com.google.zxing.WriterException; import com.google.zxing.common.BitMatrix; import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; import java.io.UnsupportedEncodingException; import java.util.Hashtable; /** * @author 刘红亮 2015年4月29日 下午3:27:08 * 用于生成二维码 */ public final class EncodingHandler { static final int BLACK = 0xff000000; static final int WHITE = 0xFFFFFFFF; /** * 生成二维码图片 * * @param str 要往二维码中写入的内容,需要utf-8格式 * @param widthAndHeight 图片的宽高,正方形 * @return 返回一个二维码bitmap * @throws WriterException * @throws UnsupportedEncodingException */ public static Bitmap create2Code(String str, int widthAndHeight) throws WriterException, UnsupportedEncodingException { BitMatrix matrix = new MultiFormatWriter().encode(str, BarcodeFormat.QR_CODE, widthAndHeight, widthAndHeight, getEncodeHintMap()); return BitMatrixToBitmap(matrix); } /** * 生成条形码图片 * @param str 要往二维码中写入的内容,需要utf-8格式 * @param width 图片的宽 * @param height 图片的高 * @return 返回一个条形bitmap * @throws Exception */ public static Bitmap createBarCode(String str, Integer width, Integer height) throws Exception{ BitMatrix bitMatrix = new MultiFormatWriter().encode(str, BarcodeFormat.CODE_128, width, height, getEncodeHintMap()); return BitMatrixToBitmap(bitMatrix); } /** * 获得设置好的编码参数 * @return 编码参数 */ private static Hashtable<EncodeHintType, Object> getEncodeHintMap() { Hashtable<EncodeHintType, Object> hints= new Hashtable<EncodeHintType, Object>(); //设置编码为utf-8 hints.put(EncodeHintType.CHARACTER_SET, "utf-8"); // 设置QR二维码的纠错级别——这里选择最高H级别 hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H); return hints; } /** * BitMatrix转换成Bitmap * * @param matrix * @return */ private static Bitmap BitMatrixToBitmap(BitMatrix matrix) { int width = matrix.getWidth(); int height = matrix.getHeight(); int[] pixels = new int[width * height]; for (int y = 0; y < height; y++) { int offset = y * width; for (int x = 0; x < width; x++) { if(matrix.get(x,y)){ pixels[offset + x] =BLACK; //上面图案的颜色 }else{ pixels[offset + x] =WHITE;//底色 } } } Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); bitmap.setPixels(pixels, 0, width, 0, 0, width, height); Log.e("hongliang","width:"+bitmap.getWidth()+" height:"+bitmap.getHeight()); return bitmap; } }
[ "1131027649@qq.com" ]
1131027649@qq.com
ee8d8981cee0bb1566bfc1d9347e28691a3b0503
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Math/27/org/apache/commons/math3/distribution/ChiSquaredDistribution_getDegreesOfFreedom_91.java
f8b0a7e2e63e543582eac980f998dbdb512ef1e3
[]
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
618
java
org apach common math3 distribut implement chi squar distribut href http wikipedia org wiki chi squar distribut chi squar distribut wikipedia href http mathworld wolfram chi squar distribut squareddistribut html chi squar distribut math world mathworld version chi squar distribut chisquareddistribut abstract real distribut abstractrealdistribut access number degre freedom degre freedom degre freedom getdegreesoffreedom gamma alpha getalpha
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
f2c4e776830969c1fbe83b01c28ebdacef3c40ea
25e99a0af5751865bce1702ee85cc5c080b0715c
/opencv/src/OpenCV-for-Java/opencv3.1/ch12/Ch12_3_2OpticalFlowFarneback.java
0b72015442369a7065f7d016bc1f601312aed275
[]
no_license
jasonblog/note
215837f6a08d07abe3e3d2be2e1f183e14aa4a30
4471f95736c60969a718d854cab929f06726280a
refs/heads/master
2023-05-31T13:02:27.451743
2022-04-04T11:28:06
2022-04-04T11:28:06
35,311,001
130
67
null
2023-02-10T21:26:36
2015-05-09T02:04:40
C
BIG5
Java
false
false
4,649
java
package ch12; import java.awt.Graphics; import java.awt.image.BufferedImage; import java.util.ArrayList; import java.util.List; import java.util.Random; import javax.swing.JFrame; import javax.swing.JPanel; import org.opencv.core.Core; import org.opencv.core.Mat; import org.opencv.core.MatOfByte; import org.opencv.core.MatOfFloat; import org.opencv.core.MatOfInt; import org.opencv.core.MatOfInt4; import org.opencv.core.MatOfPoint; import org.opencv.core.MatOfPoint2f; import org.opencv.core.Point; import org.opencv.core.Range; import org.opencv.core.Rect; import org.opencv.core.Scalar; import org.opencv.core.Size; import org.opencv.imgproc.Imgproc; import org.opencv.video.Video; import org.opencv.videoio.VideoCapture; import org.opencv.core.CvType; import javax.sound.midi.MidiSystem; import javax.sound.midi.Synthesizer; import javax.sound.midi.MidiChannel; public class Ch12_3_2OpticalFlowFarneback { static{ System.loadLibrary(Core.NATIVE_LIBRARY_NAME); } public static void main(String arg[]) throws Exception{ JFrame frame2 = new JFrame("OpticalFlowFarneback"); frame2.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame2.setSize(640, 480); frame2.setBounds(300, 100, frame2.getWidth() + 50, 50 + frame2.getHeight()); Panel panel2 = new Panel(); frame2.setContentPane(panel2); frame2.setVisible(true); //-- 2. Read the video stream VideoCapture capture = new VideoCapture(); capture.open(0); //0表第1支CCD,1是第2支 Mat webcam_image = new Mat(); Mat matOpFlowThis = new Mat(); Mat matOpFlowPrev = new Mat(); Mat mRgba; System.out.println("OPTFLOW_USE_INITIAL_FLOW=" + Video.OPTFLOW_USE_INITIAL_FLOW); System.out.println("OPTFLOW_FARNEBACK_GAUSSIAN=" + Video.OPTFLOW_FARNEBACK_GAUSSIAN); capture.read(webcam_image); frame2.setSize(webcam_image.width() + 40, webcam_image.height() + 60); if (capture.isOpened()) { while (true) { Thread.sleep(200); capture.read(webcam_image); if (!webcam_image.empty()) { mRgba = webcam_image.clone(); if (matOpFlowPrev.rows() == 0) { // first time through the loop so we need prev and this mats // plus prev points // get this mat Imgproc.cvtColor(mRgba, matOpFlowThis, Imgproc.COLOR_RGBA2GRAY); // copy that to prev mat matOpFlowThis.copyTo(matOpFlowPrev); } else { // we've been through before so // this mat is valid. Copy it to prev mat matOpFlowThis.copyTo(matOpFlowPrev); // get this mat Imgproc.cvtColor(mRgba, matOpFlowThis, Imgproc.COLOR_RGBA2GRAY); } // Parameters: Mat flow = new Mat(mRgba.size(), CvType.CV_8UC1); //Video.calcOpticalFlowFarneback(matOpFlowPrev, matOpFlowThis, flow, 0.5,1,1,1,7,1.5,1); Video.calcOpticalFlowFarneback(matOpFlowPrev, matOpFlowThis, flow, 0.5, 3, 15, 3, 5, 1.2, 0); //System.out.println(flow.dump()); float[] fdata = new float[2]; for (int i = 0; i < matOpFlowPrev.cols(); i = i + 10) { for (int j = 0; j < matOpFlowPrev.rows(); j = j + 10) { flow.get(j, i, fdata); //0.Core.circle(mRgba, new Point(j,i), 1, new Scalar(0, 0, 255), 1); Imgproc.circle(mRgba, new Point(i + (int)fdata[0], j + (int)fdata[1]), 1, new Scalar(0, 0, 255), 1); //0.Core.line(mRgba, new Point(j,i), new Point(j+(int)fdata[0],i+(int)fdata[1]), new Scalar(0, 255, 255) , 1); Imgproc.line(mRgba, new Point(i, j), new Point(i + (int)fdata[0], j + (int)fdata[1]), new Scalar(0, 255, 255), 1); } } panel2.setimagewithMat(mRgba); // frame2.repaint(); } else { System.out.println("無補抓任何畫面!"); break; } } } return; } }
[ "jason_yao" ]
jason_yao
b70e8f5093e634f65e220a7dcf22801c0c6a27d0
c47c254ca476c1f9969f8f3e89acb4d0618c14b6
/datasets/github_java_10/2/115.java
a3664de79d181fb67b03bf44a4fade8e52be7d9e
[ "BSD-2-Clause" ]
permissive
yijunyu/demo
5cf4e83f585254a28b31c4a050630b8f661a90c8
11c0c84081a3181494b9c469bda42a313c457ad2
refs/heads/master
2023-02-22T09:00:12.023083
2021-01-25T16:51:40
2021-01-25T16:51:40
175,939,000
3
6
BSD-2-Clause
2021-01-09T23:00:12
2019-03-16T07:13:00
C
UTF-8
Java
false
false
871
java
void mergeSort(int[] array, int low, int high){ if(low < high){ int middle = (low + high) / 2; mergeSort(array, low, middle); mergeSort(array, middle + 1, high); mergeSort(array, low, middle, high); } } void merge(int[] array, int low, int middle, int high){ int[] helper = new int[array, lenght]; for (int i = low ; i <= high ; i++){ helper[i] = array[i]; } int helper = low; int helperRight = middle + 1; int current = low; while (helperLeft <= middle && helperRight <= high){ if (helper[helperLeft] <= helper[helperRight]){ array[current] = helper[helperLeft]; helperLeft++ ; } else{ array[current] = helper[helperRight]; helper++; } current++; } int remaining = middle - helper; for (int i = 0 <= remaining; i++){ array[current + i] = helper[helperLeft + i]; } }
[ "y.yu@open.ac.uk" ]
y.yu@open.ac.uk
063ae0c56317f7866eee04e2ae92199487a04771
97234cc88017ee0b5898403e73ab3f5f5814cdf2
/bitcamp-project/Backup/v24_1/src/main/java/com/eomcs/util/ListIterator.java
47122a4c1f4630f7c996b631fbcba01a0f8f5f90
[]
no_license
joeunseong/bitcamp-study
1454ffdeb275c06be63781cff57c88a501fc57d3
cf205293e18c7ae1c37e7a59f90a7c3b53bb2695
refs/heads/master
2020-09-23T12:38:53.989478
2020-05-29T05:52:44
2020-05-29T05:52:44
225,501,863
0
0
null
null
null
null
UTF-8
Java
false
false
422
java
package com.eomcs.util; // ArrayList 객체에서 Iterator 규칙에 따라 값을 꺼내주는 클래스를 정의 public class ListIterator<E> implements Iterator<E> { List<E> list; int cursor; public ListIterator(List<E> list) { this.list = list; } @Override public boolean hasNext() { return cursor < list.size(); } @Override public E next() { return list.get(cursor++); } }
[ "euns29@naver.com" ]
euns29@naver.com
5de065e3397201f0ba90fd40afb3bdd17c844538
3a517f7cf8e9183cde34f345459a6828c15c3317
/src/main/java/ch/alpine/tensor/mat/re/Inverse.java
dfc5410e69b92d0dcbdc3790fd61049ccd7bc794
[]
no_license
datahaki/tensor
766b3f8ad6bc0756edfd2e0f10ecbc27fa7cefa2
8b29f8c43ed8305accf0a6a5378213f38adb0a61
refs/heads/master
2023-09-03T05:51:04.681055
2023-08-24T11:04:53
2023-08-24T11:04:53
294,003,258
23
1
null
2022-09-15T00:43:39
2020-09-09T04:34:22
Java
UTF-8
Java
false
false
943
java
// code by jph package ch.alpine.tensor.mat.re; import ch.alpine.tensor.Tensor; import ch.alpine.tensor.mat.IdentityMatrix; import ch.alpine.tensor.mat.pi.PseudoInverse; /** inspired by * <a href="https://reference.wolfram.com/language/ref/Inverse.html">Inverse</a> * * @see PseudoInverse */ public enum Inverse { ; /** @param matrix with square dimensions * @return inverse of given matrix * @throws Exception if given matrix is not invertible */ public static Tensor of(Tensor matrix) { return of(matrix, Pivots.selection(matrix)); } /** function doesn't invoke Scalar::abs but pivots at the first non-zero column entry * * @param matrix with square dimensions * @param pivot * @return inverse of given matrix * @throws Exception if given matrix is not invertible */ public static Tensor of(Tensor matrix, Pivot pivot) { return LinearSolve.of(matrix, IdentityMatrix.of(matrix), pivot); } }
[ "jan.hakenberg@gmail.com" ]
jan.hakenberg@gmail.com
0903a7f522ecc46415f1eb8dc137e579072185aa
6361e8c2df285a7b725ff211505296007111e50d
/src/main/java/com/tinkerpop/gremlin/compiler/functions/g/lme/DeduplicateFunction.java
7c07597dd76922f92358df4d0742d3bd1577ae15
[ "BSD-3-Clause" ]
permissive
jakewins/gremlin
4be969734f1d379bdeb2bf4ff60b996c08c8a219
82a56d2f471e10e91d41a73f6d2e86f0f2fbc0fe
refs/heads/master
2021-01-17T22:07:13.250364
2010-07-09T12:41:49
2010-07-09T12:41:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,321
java
package com.tinkerpop.gremlin.compiler.functions.g.lme; import com.tinkerpop.gremlin.compiler.Atom; import com.tinkerpop.gremlin.compiler.functions.AbstractFunction; import com.tinkerpop.gremlin.compiler.operations.Operation; import java.util.HashSet; import java.util.List; import java.util.Set; /** * @author Marko A. Rodriguez (http://markorodriguez.com) */ public class DeduplicateFunction extends AbstractFunction<Iterable<Atom>> { private static final String FUNCTION_NAME = "dedup"; public Atom<Iterable<Atom>> compute(final List<Operation> parameters) throws RuntimeException { if (parameters.size() == 0) { throw new RuntimeException(this.createUnsupportedArgumentMessage()); } else { final Set<Atom> set = new HashSet<Atom>(); for (Operation operation : parameters) { final Atom atom = operation.compute(); if (atom.isIterable()) { for (Object object : (Iterable) atom.getValue()) { set.add(new Atom(object)); } } else { set.add(atom); } } return new Atom<Iterable<Atom>>(set); } } public String getFunctionName() { return FUNCTION_NAME; } }
[ "okrammarko@gmail.com" ]
okrammarko@gmail.com
ccc6c3e31cf2626c831e79aa9d1f63183dbefca6
421f0a75a6b62c5af62f89595be61f406328113b
/generated_tests/model_seeding/3_gaj-brain.ga.GAEnumAllelesSet-0.5-2/brain/ga/GAEnumAllelesSet_ESTest_scaffolding.java
c1f89503b59fc1cf99c2d1278bfd5fd9c00d18a0
[]
no_license
tigerqiu712/evosuite-model-seeding-empirical-evaluation
c78c4b775e5c074aaa5e6ca56bc394ec03c2c7c6
11a920b8213d9855082d3946233731c843baf7bc
refs/heads/master
2020-12-23T21:04:12.152289
2019-10-30T08:02:29
2019-10-30T08:02:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
531
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Tue Oct 29 09:18:47 GMT 2019 */ package brain.ga; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; import org.evosuite.runtime.sandbox.Sandbox; import org.evosuite.runtime.sandbox.Sandbox.SandboxMode; @EvoSuiteClassExclude public class GAEnumAllelesSet_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pderakhshanfar@bsr01.win.tue.nl" ]
pderakhshanfar@bsr01.win.tue.nl
ec13e5a5036fc95ec53cacbddcb96a41c69858fc
7e97bd64199d987913fa5a700eb74c3e49256d6c
/liquibase-core/src/main/java/liquibase/change/core/DropForeignKeyConstraintChange.java
5bda9e6bc06841c7224235b50011fd029fdd43d0
[ "Apache-2.0" ]
permissive
propersoft-cn/liquibase
59ca79d50b26760894d108aca05e28ee5b5eb055
8054ac3fc00d4b81520685b9264d98fb04f261f1
refs/heads/proper-3.6.1
2020-03-18T00:58:07.813396
2018-05-20T06:06:34
2018-05-20T06:06:34
134,121,344
0
2
Apache-2.0
2018-05-20T06:06:35
2018-05-20T05:05:13
Java
UTF-8
Java
false
false
3,104
java
package liquibase.change.core; import liquibase.change.*; import liquibase.database.Database; import liquibase.snapshot.SnapshotGeneratorFactory; import liquibase.statement.SqlStatement; import liquibase.statement.core.DropForeignKeyConstraintStatement; import liquibase.structure.core.ForeignKey; /** * Drops an existing foreign key constraint. */ @DatabaseChange(name="dropForeignKeyConstraint", description = "Drops an existing foreign key", priority = ChangeMetaData.PRIORITY_DEFAULT, appliesTo = "foreignKey") public class DropForeignKeyConstraintChange extends AbstractChange { private String baseTableCatalogName; private String baseTableSchemaName; private String baseTableName; private String constraintName; @DatabaseChangeProperty(mustEqualExisting ="foreignKey.table.catalog", since = "3.0") public String getBaseTableCatalogName() { return baseTableCatalogName; } public void setBaseTableCatalogName(String baseTableCatalogName) { this.baseTableCatalogName = baseTableCatalogName; } @DatabaseChangeProperty(mustEqualExisting ="foreignKey.table.schema") public String getBaseTableSchemaName() { return baseTableSchemaName; } public void setBaseTableSchemaName(String baseTableSchemaName) { this.baseTableSchemaName = baseTableSchemaName; } @DatabaseChangeProperty(mustEqualExisting = "foreignKey.table", description = "Name of the table containing the column constrained by the foreign key") public String getBaseTableName() { return baseTableName; } public void setBaseTableName(String baseTableName) { this.baseTableName = baseTableName; } @DatabaseChangeProperty(mustEqualExisting = "foreignKey", description = "Name of the foreign key constraint to drop", exampleValue = "fk_address_person") public String getConstraintName() { return constraintName; } public void setConstraintName(String constraintName) { this.constraintName = constraintName; } @Override public SqlStatement[] generateStatements(Database database) { return new SqlStatement[]{ new DropForeignKeyConstraintStatement( getBaseTableCatalogName(), getBaseTableSchemaName(), getBaseTableName(), getConstraintName()), }; } @Override public ChangeStatus checkStatus(Database database) { try { return new ChangeStatus().assertComplete(!SnapshotGeneratorFactory.getInstance().has(new ForeignKey(getConstraintName(), getBaseTableCatalogName(), getBaseTableSchemaName(), getBaseTableCatalogName()), database), "Foreign key exists"); } catch (Exception e) { return new ChangeStatus().unknown(e); } } @Override public String getConfirmationMessage() { return "Foreign key " + getConstraintName() + " dropped"; } @Override public String getSerializedObjectNamespace() { return STANDARD_CHANGELOG_NAMESPACE; } }
[ "nathan@voxland.net" ]
nathan@voxland.net
a3b0ca3730d50599deaaeb3034ae5d52e67891f4
0eeea8f93b4f154db22e98a1b1a72ae5adba8dba
/src/cn/osworks/aos/web/tag/impl/ext/panel/PanelTag.java
a43cc7196b995f860676a69a442261697adb97e4
[]
no_license
atguigu2020dfbb/aosyb
497dc3b79b3f73441338e97b2f7072644c984efb
16c031ac63cc30235ed114a8b0a4b8870ece2328
refs/heads/master
2023-01-10T08:16:20.744253
2020-11-16T08:16:35
2020-11-16T08:16:35
313,138,331
0
0
null
null
null
null
UTF-8
Java
false
false
1,613
java
package cn.osworks.aos.web.tag.impl.ext.panel; import java.io.IOException; import javax.servlet.jsp.JspException; import cn.osworks.aos.core.asset.AOSUtils; import cn.osworks.aos.core.typewrap.Dto; import cn.osworks.aos.web.tag.asset.Xtypes; import cn.osworks.aos.web.tag.core.model.TagDto; import cn.osworks.aos.web.tag.impl.ext.PanelTagSupport; /** * <b>Panel标签实现类</b> * * @author OSWorks-XC * @date 2014-03-06 */ public class PanelTag extends PanelTagSupport { private static final long serialVersionUID = 1L; /** * 预处理和标签逻辑校验 * * @throws JspException */ private void doPrepare() throws JspException { doBorderPrepare(); doWidthPrepare(); doCenterIt(); setXtype(Xtypes.PANEL); resetListenerContainer(); resetObjInContainerTag(); if (AOSUtils.isEmpty(getLayout())) { setLayout("fit"); } } /** * 开始标签 */ public int doStartTag() throws JspException { doPrepare(); return EVAL_BODY_INCLUDE; } /** * 结束标签 */ public int doEndTag() throws JspException { Dto tagDto = new TagDto(); super.pkgProperties(tagDto); String jspString = mergeFileTemplate(EXTVM + "panelTag.vm", tagDto); try { pageContext.getOut().write(jspString); } catch (IOException e) { throw new JspException(e); } // Items组件处理 addCur2ParentItems(); doClear(); return EVAL_PAGE; } /** * 后处理标签现场 * * @throws JspException */ public void doClear() throws JspException { super.doClear(); setId(null); } /** * 释放资源 */ public void release() { super.release(); } }
[ "eclipse_user@atguigu.com" ]
eclipse_user@atguigu.com
dadd6388ab245fed5b5a82852c5ee27eb5de5a92
8692972314994b8923b6f12b7ae9e76b30a36391
/memory_managment/ClassesList/src/Class844.java
183d179d9740761b5ba68d6545ea97595b8e5fda
[]
no_license
Petrash-Samoilenka/2017W-D2D3-ST-Petrash-Samoilenka
d2cd65c1d10bec3c4d1b69b124d4f0aeef1d7308
214fbb3682ef6714514af86cc9eaca62f02993e1
refs/heads/master
2020-05-27T15:04:52.163194
2017-06-16T14:19:38
2017-06-16T14:19:38
82,560,968
1
0
null
null
null
null
UTF-8
Java
false
false
3,746
java
public class Class844 extends Class1 { private String _s1; private String _s2; private String _s3; private String _s4; private String _s5; private String _s6; private String _s7; private String _s8; public Class844() { } public void getValue1(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) { _s1 = s1; _s2 = s2; _s3 = s3; _s4 = s4; } public void getValue2(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) { _s1 = s1; _s2 = s2; _s3 = s3; _s4 = s4; } public void getValue3(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) { _s1 = s1; _s2 = s2; _s3 = s3; _s4 = s4; } public void getValue4(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) { _s1 = s1; _s2 = s2; _s3 = s3; _s4 = s4; } public void getValue5(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) { _s1 = s1; _s2 = s2; _s3 = s3; _s4 = s4; } public void getValue6(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) { _s1 = s1; _s2 = s2; _s3 = s3; _s4 = s4; } public void getValue7(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) { _s1 = s1; _s2 = s2; _s3 = s3; _s4 = s4; } public void getValue8(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) { _s1 = s1; _s2 = s2; _s3 = s3; _s4 = s4; } public void getValue9(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) { _s1 = s1; _s2 = s2; _s3 = s3; _s4 = s4; } public void getValue10(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) { _s1 = s1; _s2 = s2; _s3 = s3; _s4 = s4; } public void getValue11(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) { _s1 = s1; _s2 = s2; _s3 = s3; _s4 = s4; } public void getValue12(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) { _s1 = s1; _s2 = s2; _s3 = s3; _s4 = s4; } public void getValue13(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) { _s1 = s1; _s2 = s2; _s3 = s3; _s4 = s4; } public void getValue14(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) { _s1 = s1; _s2 = s2; _s3 = s3; _s4 = s4; } public void getValue15(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) { _s1 = s1; _s2 = s2; _s3 = s3; _s4 = s4; } public void getValue16(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) { _s1 = s1; _s2 = s2; _s3 = s3; _s4 = s4; } public void getValue17(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) { _s1 = s1; _s2 = s2; _s3 = s3; _s4 = s4; } public void getValue18(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) { _s1 = s1; _s2 = s2; _s3 = s3; _s4 = s4; } public void getValue19(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) { _s1 = s1; _s2 = s2; _s3 = s3; _s4 = s4; } public void getValue20(String s1, String s2, String s3, String s4, String s5, String s6, String s7, String s8) { _s1 = s1; _s2 = s2; _s3 = s3; _s4 = s4; } }
[ "rn.samoylenko@gmail.com" ]
rn.samoylenko@gmail.com
f09b48760101e8233e53976ed1d33b0f2631f8e9
995f73d30450a6dce6bc7145d89344b4ad6e0622
/DVC-AN20_EMUI10.1.1/src/main/java/vendor/huawei/hardware/radio/V2_0/RILUnsolMsgPayload.java
33c01589e0614050e969f71f8bd732e5fafa8078
[]
no_license
morningblu/HWFramework
0ceb02cbe42585d0169d9b6c4964a41b436039f5
672bb34094b8780806a10ba9b1d21036fd808b8e
refs/heads/master
2023-07-29T05:26:14.603817
2021-09-03T05:23:34
2021-09-03T05:23:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,881
java
package vendor.huawei.hardware.radio.V2_0; import android.os.HidlSupport; import android.os.HwBlob; import android.os.HwParcel; import java.util.ArrayList; import java.util.Objects; public final class RILUnsolMsgPayload { public int nData; public ArrayList<Integer> nDatas = new ArrayList<>(); public String strData = new String(); public ArrayList<String> strDatas = new ArrayList<>(); public final boolean equals(Object otherObject) { if (this == otherObject) { return true; } if (otherObject == null || otherObject.getClass() != RILUnsolMsgPayload.class) { return false; } RILUnsolMsgPayload other = (RILUnsolMsgPayload) otherObject; if (this.nData == other.nData && HidlSupport.deepEquals(this.nDatas, other.nDatas) && HidlSupport.deepEquals(this.strData, other.strData) && HidlSupport.deepEquals(this.strDatas, other.strDatas)) { return true; } return false; } public final int hashCode() { return Objects.hash(Integer.valueOf(HidlSupport.deepHashCode(Integer.valueOf(this.nData))), Integer.valueOf(HidlSupport.deepHashCode(this.nDatas)), Integer.valueOf(HidlSupport.deepHashCode(this.strData)), Integer.valueOf(HidlSupport.deepHashCode(this.strDatas))); } public final String toString() { return "{" + ".nData = " + this.nData + ", .nDatas = " + this.nDatas + ", .strData = " + this.strData + ", .strDatas = " + this.strDatas + "}"; } public final void readFromParcel(HwParcel parcel) { readEmbeddedFromParcel(parcel, parcel.readBuffer(56), 0); } public static final ArrayList<RILUnsolMsgPayload> readVectorFromParcel(HwParcel parcel) { ArrayList<RILUnsolMsgPayload> _hidl_vec = new ArrayList<>(); HwBlob _hidl_blob = parcel.readBuffer(16); int _hidl_vec_size = _hidl_blob.getInt32(8); HwBlob childBlob = parcel.readEmbeddedBuffer((long) (_hidl_vec_size * 56), _hidl_blob.handle(), 0, true); _hidl_vec.clear(); for (int _hidl_index_0 = 0; _hidl_index_0 < _hidl_vec_size; _hidl_index_0++) { RILUnsolMsgPayload _hidl_vec_element = new RILUnsolMsgPayload(); _hidl_vec_element.readEmbeddedFromParcel(parcel, childBlob, (long) (_hidl_index_0 * 56)); _hidl_vec.add(_hidl_vec_element); } return _hidl_vec; } public final void readEmbeddedFromParcel(HwParcel parcel, HwBlob _hidl_blob, long _hidl_offset) { this.nData = _hidl_blob.getInt32(_hidl_offset + 0); int _hidl_vec_size = _hidl_blob.getInt32(_hidl_offset + 8 + 8); HwBlob childBlob = parcel.readEmbeddedBuffer((long) (_hidl_vec_size * 4), _hidl_blob.handle(), _hidl_offset + 8 + 0, true); this.nDatas.clear(); for (int _hidl_index_0 = 0; _hidl_index_0 < _hidl_vec_size; _hidl_index_0++) { this.nDatas.add(Integer.valueOf(childBlob.getInt32((long) (_hidl_index_0 * 4)))); } this.strData = _hidl_blob.getString(_hidl_offset + 24); parcel.readEmbeddedBuffer((long) (this.strData.getBytes().length + 1), _hidl_blob.handle(), _hidl_offset + 24 + 0, false); int _hidl_vec_size2 = _hidl_blob.getInt32(_hidl_offset + 40 + 8); HwBlob childBlob2 = parcel.readEmbeddedBuffer((long) (_hidl_vec_size2 * 16), _hidl_blob.handle(), _hidl_offset + 40 + 0, true); this.strDatas.clear(); for (int _hidl_index_02 = 0; _hidl_index_02 < _hidl_vec_size2; _hidl_index_02++) { new String(); String _hidl_vec_element = childBlob2.getString((long) (_hidl_index_02 * 16)); parcel.readEmbeddedBuffer((long) (_hidl_vec_element.getBytes().length + 1), childBlob2.handle(), (long) ((_hidl_index_02 * 16) + 0), false); this.strDatas.add(_hidl_vec_element); } } public final void writeToParcel(HwParcel parcel) { HwBlob _hidl_blob = new HwBlob(56); writeEmbeddedToBlob(_hidl_blob, 0); parcel.writeBuffer(_hidl_blob); } public static final void writeVectorToParcel(HwParcel parcel, ArrayList<RILUnsolMsgPayload> _hidl_vec) { HwBlob _hidl_blob = new HwBlob(16); int _hidl_vec_size = _hidl_vec.size(); _hidl_blob.putInt32(8, _hidl_vec_size); _hidl_blob.putBool(12, false); HwBlob childBlob = new HwBlob(_hidl_vec_size * 56); for (int _hidl_index_0 = 0; _hidl_index_0 < _hidl_vec_size; _hidl_index_0++) { _hidl_vec.get(_hidl_index_0).writeEmbeddedToBlob(childBlob, (long) (_hidl_index_0 * 56)); } _hidl_blob.putBlob(0, childBlob); parcel.writeBuffer(_hidl_blob); } public final void writeEmbeddedToBlob(HwBlob _hidl_blob, long _hidl_offset) { _hidl_blob.putInt32(_hidl_offset + 0, this.nData); int _hidl_vec_size = this.nDatas.size(); _hidl_blob.putInt32(_hidl_offset + 8 + 8, _hidl_vec_size); _hidl_blob.putBool(_hidl_offset + 8 + 12, false); HwBlob childBlob = new HwBlob(_hidl_vec_size * 4); for (int _hidl_index_0 = 0; _hidl_index_0 < _hidl_vec_size; _hidl_index_0++) { childBlob.putInt32((long) (_hidl_index_0 * 4), this.nDatas.get(_hidl_index_0).intValue()); } _hidl_blob.putBlob(_hidl_offset + 8 + 0, childBlob); _hidl_blob.putString(_hidl_offset + 24, this.strData); int _hidl_vec_size2 = this.strDatas.size(); _hidl_blob.putInt32(_hidl_offset + 40 + 8, _hidl_vec_size2); _hidl_blob.putBool(_hidl_offset + 40 + 12, false); HwBlob childBlob2 = new HwBlob(_hidl_vec_size2 * 16); for (int _hidl_index_02 = 0; _hidl_index_02 < _hidl_vec_size2; _hidl_index_02++) { childBlob2.putString((long) (_hidl_index_02 * 16), this.strDatas.get(_hidl_index_02)); } _hidl_blob.putBlob(_hidl_offset + 40 + 0, childBlob2); } }
[ "dstmath@163.com" ]
dstmath@163.com
0fba10d6c78f2a78502f96c16d0ac29a34120f92
589479f111c710e5bbd398c4437b61fff98e5f41
/Java/design-pattern/command/src/main/java/com/zjc/demo2/ShrinkSpell.java
85063b1c61de62efede495444232e2ca00607e2b
[]
no_license
Daniel49zhu/StudyNotes
cc4a4e13048222c5148645842179ebcc4b7bd9ed
6df5fb5e7e6634c42ea1dfa52043d91c9a10496b
refs/heads/master
2023-04-27T21:05:50.429825
2023-02-24T15:13:31
2023-02-24T15:13:31
168,356,932
0
1
null
2023-04-17T19:46:31
2019-01-30T14:32:03
Java
UTF-8
Java
false
false
1,767
java
/** * The MIT License * Copyright (c) 2014-2016 Ilkka Seppälä * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package com.zjc.demo2; /** * * ShrinkSpell is a concrete command * */ public class ShrinkSpell extends Command { private Size oldSize; private Target target; @Override public void execute(Target target) { oldSize = target.getSize(); target.setSize(Size.SMALL); this.target = target; } @Override public void undo() { if (oldSize != null && target != null) { Size temp = target.getSize(); target.setSize(oldSize); oldSize = temp; } } @Override public void redo() { undo(); } @Override public String toString() { return "Shrink spell"; } }
[ "zhujiacheng94@163.com" ]
zhujiacheng94@163.com
bda56390adf30167328243bf6ff1f59621bd4861
b8336502cca4e79672e948da2e982af15dd26dd7
/core/src/main/java/de/chkal/jeti/core/ProviderRegistry.java
13634ffbcef575c0416b9e3e9d529889b847be42
[]
no_license
chkal/jeti
fefe79230aa965aa505c17cec09d1aa2ee9f4ec2
44f51effdcf10f9a6ced4f08dd59c66f49003dcb
refs/heads/master
2021-09-10T17:48:29.741173
2018-03-30T12:32:37
2018-03-30T12:32:44
124,658,549
8
0
null
null
null
null
UTF-8
Java
false
false
677
java
package de.chkal.jeti.core; import java.util.ArrayList; import java.util.List; import java.util.Optional; public class ProviderRegistry { private final List<MetricProvider> providers = new ArrayList<>(); public void register(MetricProvider provider) { this.providers.add(provider); } public List<MetricProvider> getProviders() { return providers; } public <T extends MetricProvider> Optional<T> getProviderByType(Class<T> type) { return Optional.ofNullable( type.cast( providers.stream() .filter(p -> p.getClass().equals(type)) .findFirst() .orElse(null) ) ); } }
[ "christian@kaltepoth.de" ]
christian@kaltepoth.de
6f9a9d39ac2dc9b349abb705a051e029a74e0840
c3445da9eff3501684f1e22dd8709d01ff414a15
/LIS/sinosoft-parents/lis-business/src/main/java/com/sinosoft/lis/fininterface/FIFinItemDefBL.java
b925c5f9e8c7d02b13fdaad845e5cae36c9b6b0f
[]
no_license
zhanght86/HSBC20171018
954403d25d24854dd426fa9224dfb578567ac212
c1095c58c0bdfa9d79668db9be4a250dd3f418c5
refs/heads/master
2021-05-07T03:30:31.905582
2017-11-08T08:54:46
2017-11-08T08:54:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,723
java
package com.sinosoft.lis.fininterface; import org.apache.log4j.Logger; import com.sinosoft.utility.*; import com.sinosoft.lis.pubfun.*; import com.sinosoft.lis.schema.FIFinItemDefSchema; /** * <p> * ClassName: FIFinItemDefBL * </p> * <p> * Description: 财务接口-财务规则参数管理-科目类型定义BL * </p> * <p> * Copyright: Copyright (c) 2002 * </p> * <p> * Company: sinosoft * </p> * @Database: 财务接口 * @author:ZhongYan * @version:1.0 * @CreateDate:2008-08-11 */ public class FIFinItemDefBL { private static Logger logger = Logger.getLogger(FIFinItemDefBL.class); /** 错误处理类,每个需要错误处理的类中都放置该类 */ public CErrors mErrors = new CErrors(); /** 往后面传输数据的容器 */ private VData mInputData = new VData(); /** 往界面传输数据的容器 */ private VData mResult = new VData(); /** 数据操作字符串 */ private String mOperate; private MMap mMMap = new MMap(); // private String CurrentDate = PubFun.getCurrentDate(); // private String CurrentTime = PubFun.getCurrentTime(); /** 全局数据 */ private GlobalInput mGlobalInput = new GlobalInput(); // private TransferData mTransferData = new TransferData(); // private Reflections mReflections = new Reflections(); // private JdbcUrl mJdbcUrl = new JdbcUrl(); // private ExeSQL mExeSQL = new ExeSQL(); /** 业务处理相关变量 */ private FIFinItemDefSchema mFIFinItemDefSchema = new FIFinItemDefSchema(); // private FIFinItemDefSet mFIFinItemDefSet = new // FIFinItemDefSet(); private String mVersionNo = ""; private String mFinItemID = ""; public FIFinItemDefBL() { } public String getVersionNo() { return mVersionNo; } public String getFinItemID() { return mFinItemID; } /** * 传输数据的公共方法 * @param: cInputData 输入的数据 cOperate 数据操作 * @return: */ public boolean submitData(VData cInputData, String cOperate) { // 将操作数据拷贝到本类中 this.mOperate = cOperate; // 得到外部传入的数据,将数据备份到本类中 if (!getInputData(cInputData)) { return false; } if (!checkdata()) { return false; } // 进行业务处理 if (!dealData()) { // @@错误处理 CError tError = new CError(); tError.moduleName = "FIFinItemDefBL"; tError.functionName = "submitData"; tError.errorMessage = "数据处理失败FIFinItemDefBL-->dealData!"; this.mErrors.addOneError(tError); return false; } // 准备往后台的数据 if (!prepareOutputData()) { return false; } // if (this.mOperate.equals("QUERY||MAIN")) // { // this.submitquery(); // } if (!pubSubmit()) { return false; } mInputData = null; return true; } /** * 从输入数据中得到所有对象 输出:如果没有得到足够的业务数据对象,则返回false,否则返回true * @param cInputData VData * @return boolean */ private boolean getInputData(VData cInputData) { this.mFIFinItemDefSchema.setSchema((FIFinItemDefSchema) cInputData.getObjectByObjectName("FIFinItemDefSchema", 0)); this.mGlobalInput.setSchema((GlobalInput) cInputData.getObjectByObjectName("GlobalInput", 0)); if (this.mGlobalInput == null) { CError tError = new CError(); tError.moduleName = "FIFinItemDefBL"; tError.functionName = "getInputData"; tError.errorMessage = "您输入的管理机构或者操作员代码为空!"; this.mErrors.addOneError(tError); return false; } if (this.mFIFinItemDefSchema == null) { CError tError = new CError(); tError.moduleName = "FIFinItemDefBL"; tError.functionName = "getInputData"; tError.errorMessage = "mFIFinItemDefSchema为空!"; this.mErrors.addOneError(tError); return false; } return true; } private boolean checkdata() { return true; } /** * 根据前面的输入数据,进行BL逻辑处理 如果在处理过程中出错,则返回false,否则返回true * @return */ private boolean dealData() { if (this.mOperate.equals("INSERT||MAIN")) { logger.debug("进入新增模块!"); mMMap.put(mFIFinItemDefSchema, "INSERT"); } else if (this.mOperate.equals("UPDATE||MAIN")) { logger.debug("进入修改模块!"); mMMap.put(mFIFinItemDefSchema, "UPDATE"); } else if (this.mOperate.equals("DELETE||MAIN")) { logger.debug("进入删除模块!"); mMMap.put(mFIFinItemDefSchema, "DELETE"); } return true; } /** * 准备往后层输出所需要的数据 输出:如果准备数据时发生错误则返回false,否则返回true * @return */ // private boolean submitquery() // { // this.mResult.clear(); // logger.debug("Start FIFinItemDefBLQuery Submit..."); // FIFinItemDefDB tFIFinItemDefDB = new // FIFinItemDefDB(); // tFIFinItemDefDB.setSchema(this.mFIFinItemDefSchema); // this.mFIFinItemDefSet = tFIFinItemDefDB.query(); // this.mResult.add(this.mFIFinItemDefSet); // logger.debug("End FIFinItemDefBLQuery Submit..."); // // 如果有需要处理的错误,则返回 // if (tFIFinItemDefDB.mErrors.needDealError()) // { // // @@错误处理 // this.mErrors.copyAllErrors(tFIFinItemDefDB.mErrors); // CError tError = new CError(); // tError.moduleName = "FIFinItemDefBL"; // tError.functionName = "submitData"; // tError.errorMessage = "数据提交失败!"; // this.mErrors.addOneError(tError); // return false; // } // mInputData = null; // return true; // } /** * 准备需要保存的数据 * @return boolean */ private boolean prepareOutputData() { try { // this.mInputData = new VData(); // this.mInputData.add(this.mGlobalInput); // this.mInputData.add(this.mFIFinItemDefSchema); mInputData.add(mMMap); } catch (Exception ex) { // @@错误处理 CError tError = new CError(); tError.moduleName = "FIFinItemDefBL"; tError.functionName = "prepareData"; tError.errorMessage = "在准备往后层处理所需要的数据时出错。"; this.mErrors.addOneError(tError); return false; } return true; } /** * 提交数据 * @return */ private boolean pubSubmit() { // 进行数据提交 PubSubmit tPubSubmit = new PubSubmit(); if (!tPubSubmit.submitData(mInputData, "")) { // @@错误处理 this.mErrors.copyAllErrors(tPubSubmit.mErrors); CError tError = new CError(); tError.moduleName = "FIFinItemDefBL"; tError.functionName = "PubSubmit.submitData"; tError.errorMessage = "数据提交失败FIFinItemDefBL-->pubSubmit!"; this.mErrors.addOneError(tError); return false; } return true; } public VData getResult() { return this.mResult; } public static void main(String[] args) { } }
[ "dingzansh@sinosoft.com.cn" ]
dingzansh@sinosoft.com.cn
c189b29d071ce9aef7e4a239e40f9efe4b564244
995f73d30450a6dce6bc7145d89344b4ad6e0622
/P40_HarmonyOS_2.0.0_Developer_Beta1/src/main/java/ohos/global/icu/impl/number/parse/RequireNumberValidator.java
44789f44cd098b3f2286144fbc65694e7d737295
[]
no_license
morningblu/HWFramework
0ceb02cbe42585d0169d9b6c4964a41b436039f5
672bb34094b8780806a10ba9b1d21036fd808b8e
refs/heads/master
2023-07-29T05:26:14.603817
2021-09-03T05:23:34
2021-09-03T05:23:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
406
java
package ohos.global.icu.impl.number.parse; public class RequireNumberValidator extends ValidationMatcher { public String toString() { return "<RequireNumber>"; } @Override // ohos.global.icu.impl.number.parse.NumberParseMatcher public void postProcess(ParsedNumber parsedNumber) { if (!parsedNumber.seenNumber()) { parsedNumber.flags |= 256; } } }
[ "dstmath@163.com" ]
dstmath@163.com
69c0e7711c61e9c1d28e6d9c69c2120a50765d5f
4438e0d6d65b9fd8c782d5e13363f3990747fb60
/mobile-test/src/test/java/com/cencosud/mobile/test/core/CuadraturaVentaVerdeServicesTest.java
660fa553d062936f9986fd98fae27847956fcbf7
[]
no_license
cencosudweb/mobile
82452af7da189ed6f81637f8ebabea0dbd241b4a
37a3a514b48d09b9dc93e90987715d979e5414b6
refs/heads/master
2021-09-01T21:41:24.713624
2017-12-28T19:34:28
2017-12-28T19:34:28
115,652,291
0
0
null
null
null
null
UTF-8
Java
false
false
2,493
java
package com.cencosud.mobile.test.core; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import java.util.List; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.transaction.TransactionConfiguration; import org.springframework.transaction.annotation.Transactional; import com.cencosud.mobile.core.CuadraturaVentaVerdeServices; import com.cencosud.mobile.dto.users.CuadraturaVentaVerdeDTO; /** * @description Clase ChannelTest que implementa pruebas Unitarias */ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = { "/mobile-testContext.xml" }) @TransactionConfiguration(transactionManager = "transactionManager", defaultRollback = false) public class CuadraturaVentaVerdeServicesTest { @Autowired private CuadraturaVentaVerdeServices CuadraturaVentaVerdeServicesImpl ; //@Ignore @Test @Transactional public void getEcommerceSoporteVentaTest() { String estadoRelacion = "1"; String fechaIni = "2017-10-10 00:00:00"; String fechaTer = "2017-10-10 23:59:59"; List<CuadraturaVentaVerdeDTO> cuadraturaVentaVerde = CuadraturaVentaVerdeServicesImpl.getCuadraturaVentaVerde(fechaIni,fechaTer, estadoRelacion, 0, 100); assertNotNull("Listado de CuadraturaVentaVerde es null", cuadraturaVentaVerde); assertFalse("No hay CuadraturaVentaVerde", cuadraturaVentaVerde.isEmpty()); // for(int i=0; i<ecommerceSoporteVentas.size(); i++){ // System.out.println(ecommerceSoporteVentas.get(i).getId()); // } } //@Ignore @Test @Transactional public void getgetCuadraturaVentaVerdeContarTest() { String fechaIni = "2017-10-10 00:00:00"; String fechaTer = "2017-10-10 23:59:59"; int calls = CuadraturaVentaVerdeServicesImpl.getCuadraturaVentaVerdeContar(fechaIni,fechaTer, "0"); assertNotNull("Cantidad de llamadas es null", calls); System.out.println("=" + calls); } //@Ignore @Test @Transactional public void getCuadraturaVentaVerdePaginadorTest() { String fechaIni = "2017-10-10 00:00:00"; String fechaTer = "2017-10-10 23:59:59"; int calls = CuadraturaVentaVerdeServicesImpl.getCuadraturaVentaVerdePaginador(fechaIni,fechaTer, "0"); assertNotNull("Cantidad de llamadas es null", calls); System.out.println("=" + calls); } }
[ "cencosudweb.panel@gmail.com" ]
cencosudweb.panel@gmail.com
29847c0ceeb7f89729dce719e7efeab1de0fc7a7
50c6f82a1be9b9838988eab73fce40438c322887
/utils-gwt/src/com/xenoage/utils/gwt/io/GwtInputStream.java
6800a4b806a7621dbe5ab7540d37e7910ea06aee
[ "Zlib" ]
permissive
mcolletta/Utils
33917232e3bb5a502d89e3a0a2bab2c5aa7e0fac
5c3c854345210dce6bf22dbaa701eb39e06eddcd
refs/heads/master
2022-01-14T09:54:39.108874
2016-03-10T20:29:48
2016-03-10T20:29:48
62,504,000
0
0
null
2016-07-03T15:55:20
2016-07-03T15:55:20
null
UTF-8
Java
false
false
2,356
java
package com.xenoage.utils.gwt.io; import java.io.IOException; import com.google.gwt.http.client.Request; import com.google.gwt.http.client.RequestBuilder; import com.google.gwt.http.client.RequestCallback; import com.google.gwt.http.client.RequestException; import com.google.gwt.http.client.Response; import com.xenoage.utils.async.AsyncResult; import com.xenoage.utils.io.InputStream; /** * {@link InputStream} implementation of GWT. * * Currently, this input stream only works with text files. * * @author Andreas Wenger */ public class GwtInputStream implements InputStream { private String data; private ByteArrayInputStream stream; /** * Opens the given file asynchronously. * The given callback methods are used to indicate success or failure. */ public static void open(String file, final AsyncResult<InputStream> callback) { try { new RequestBuilder(RequestBuilder.GET, file).sendRequest("", new RequestCallback() { @Override public void onResponseReceived(Request req, Response resp) { try { if (resp.getStatusCode() == Response.SC_OK) { //file could be read. success. String data = resp.getText(); ByteArrayInputStream stream = new ByteArrayInputStream(data.getBytes("UTF-8")); GwtInputStream result = new GwtInputStream(data, stream); callback.onSuccess(result); } else { callback.onFailure(new IOException("HTTP status code " + resp.getStatusCode())); } } catch (Exception ex) { callback.onFailure(new IOException(ex)); } } @Override public void onError(Request res, Throwable throwable) { callback.onFailure(new IOException(throwable)); } }); } catch (RequestException ex) { callback.onFailure(new IOException(ex)); } } private GwtInputStream(String data, ByteArrayInputStream stream) { this.data = data; this.stream = stream; } /** * Gets the whole file data as a string. */ public String getData() { return data; } @Override public int read() throws IOException { return stream.read(); } @Override public int read(byte[] b) throws IOException { return stream.read(b, 0, b.length); } @Override public int read(byte[] b, int off, int len) throws IOException { return stream.read(b, off, len); } @Override public void close() { stream = null; } }
[ "andi@xenoage.com" ]
andi@xenoage.com
c52a74159a03ffa16b7c4c7d6ef8f97c38f40643
5095c94365c79436e0f1c98a50405ae8e27a89eb
/atomicobjects-gui/src/main/java/net/catchpole/scene/Milieu.java
8eab029fa21547230e1ab877b11cc3349b98518e
[ "Apache-2.0" ]
permissive
slipperyseal/atomicobjects
f5da8a832681550d8efc84d03e6c64b5f7a3bf49
212f9d830386fe9947f7770ab673273c007dc88d
refs/heads/slippery
2023-03-10T18:40:25.499262
2023-02-26T01:27:55
2023-02-26T01:27:55
20,993,244
3
1
Apache-2.0
2022-06-13T03:48:50
2014-06-19T08:25:25
Java
UTF-8
Java
false
false
1,298
java
package net.catchpole.scene; // Copyright 2014 catchpole.net // // 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. import javax.media.opengl.GL; import javax.media.opengl.glu.GLU; /** */ public interface Milieu { /** * The JOGL GL instance to render against. * @return GL */ public GL getGL(); public GLU getGLU(); /** * Returns a time value on which to base rendering positions and transitions. * It may or may not be based on the current time. * It is supplied via this interface so that non-real time rendering can occur. * The time value may not be real time. * The time may be equal to or greater than the time returned on the last render. * @return time */ public long getRenderTime(); }
[ "christian@catchpole.net" ]
christian@catchpole.net
078ac92dab551c615687be975bea1b63f3856d63
3d0987d1872a35b8cb34c8b394be8bbedf60b335
/src/test/java/org/dependencytrack/model/LicenseTest.java
bb91d71919efae766e28234250e5a170289dae00
[ "Apache-2.0" ]
permissive
PeterMosmans/dependency-track
b7521ad5643292e65eb197b232c4aa2ead8cde19
791faa52168d1968edf6380e41e8bca68e52ca40
refs/heads/master
2020-04-25T15:39:45.490290
2019-02-18T05:49:07
2019-02-18T05:49:07
172,885,919
0
1
Apache-2.0
2019-02-27T09:35:29
2019-02-27T09:35:29
null
UTF-8
Java
false
false
3,325
java
/* * This file is part of Dependency-Track. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Copyright (c) Steve Springett. All Rights Reserved. */ package org.dependencytrack.model; import org.junit.Assert; import org.junit.Test; import java.util.UUID; public class LicenseTest { @Test public void testId() { License license = new License(); license.setId(111L); Assert.assertEquals(111L, license.getId()); } @Test public void testName() { License license = new License(); license.setName("Apache License 2.0"); Assert.assertEquals("Apache License 2.0", license.getName()); } @Test public void testText() { License license = new License(); license.setText("License text"); Assert.assertEquals("License text", license.getText()); } @Test public void testTemplate() { License license = new License(); license.setTemplate("License template"); Assert.assertEquals("License template", license.getTemplate()); } @Test public void testHeader() { License license = new License(); license.setHeader("License header"); Assert.assertEquals("License header", license.getHeader()); } @Test public void testComment() { License license = new License(); license.setComment("License comment"); Assert.assertEquals("License comment", license.getComment()); } @Test public void testLicenseId() { License license = new License(); license.setLicenseId("Apache-2.0"); Assert.assertEquals("Apache-2.0", license.getLicenseId()); } @Test public void tesOsiApproved() { License license = new License(); license.setOsiApproved(true); Assert.assertTrue(license.isOsiApproved()); } @Test public void tesFsfLibre() { License license = new License(); license.setFsfLibre(true); Assert.assertTrue(license.isFsfLibre()); } @Test public void testDeprecatedLicenseId() { License license = new License(); license.setDeprecatedLicenseId(true); Assert.assertTrue(license.isDeprecatedLicenseId()); } @Test public void testSeeAlso() { License license = new License(); license.setSeeAlso("url #1", "url #2"); Assert.assertEquals(2, license.getSeeAlso().length); Assert.assertEquals("url #1", license.getSeeAlso()[0]); Assert.assertEquals("url #2", license.getSeeAlso()[1]); } @Test public void testUuid() { UUID uuid = UUID.randomUUID(); License license = new License(); license.setUuid(uuid); Assert.assertEquals(uuid.toString(), license.getUuid().toString()); } }
[ "steve@springett.us" ]
steve@springett.us
100b676f6c5088f6ff7235631d52979776d2d02c
d199897d6ff5c884831041690f13393e99ab1249
/src/socket_programming/step03/Chatting.java
3daaeeca08deac422f20313261c09b75d082b249
[]
no_license
DaeguIT-MinSuKim/socket_program
1dca09d2bc23759429e0dd47514f51e85dd9651f
d4c78c55830396ce67086514b9f13d2049e57a60
refs/heads/master
2021-07-02T04:33:32.875289
2017-09-19T05:06:31
2017-09-19T05:06:31
104,027,419
0
0
null
null
null
null
UTF-8
Java
false
false
5,908
java
package socket_programming.step03; import java.awt.BorderLayout; import java.awt.EventQueue; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStream; import java.net.Socket; import java.net.UnknownHostException; import javax.swing.ButtonGroup; import javax.swing.DefaultListModel; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JPanel; import javax.swing.JRadioButton; import javax.swing.JScrollPane; import javax.swing.JTextArea; import javax.swing.JTextField; import javax.swing.border.EmptyBorder; public class Chatting extends JFrame implements ActionListener, Runnable { private JPanel contentPane; private JTextField tFNickName; private JTextField tFTalk; private final ButtonGroup buttonGroup = new ButtonGroup(); private JButton btnConnect; private JTextArea tAView; private Socket soc; private OutputStream os; private BufferedReader br; private Thread currentTh; private DefaultListModel<String> model; private JLabel lblCnt; public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { try { Chatting frame = new Chatting(); frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); } public Chatting() { setTitle("채팅"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 489, 300); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); contentPane.setLayout(new BorderLayout(0, 0)); setContentPane(contentPane); JPanel pEast = new JPanel(); contentPane.add(pEast, BorderLayout.EAST); pEast.setLayout(new BorderLayout(0, 0)); JPanel pCnt = new JPanel(); pEast.add(pCnt, BorderLayout.NORTH); JLabel lblCntTitle = new JLabel("인원 : "); pCnt.add(lblCntTitle); lblCnt = new JLabel("0"); pCnt.add(lblCnt); JLabel lblCntUnit = new JLabel("명"); pCnt.add(lblCntUnit); JPanel pList = new JPanel(); pEast.add(pList, BorderLayout.CENTER); pList.setLayout(new BorderLayout(0, 0)); model = new DefaultListModel<>(); JList<String> list = new JList<>(model); list.setVisibleRowCount(10); pList.add(list, BorderLayout.NORTH); JPanel pRadio = new JPanel(); pList.add(pRadio, BorderLayout.SOUTH); pRadio.setLayout(new GridLayout(0, 1, 0, 0)); JRadioButton rdbtnHide = new JRadioButton("귓속말 설정"); buttonGroup.add(rdbtnHide); pRadio.add(rdbtnHide); JRadioButton rdbtnShow = new JRadioButton("귓속말 해제"); buttonGroup.add(rdbtnShow); pRadio.add(rdbtnShow); JButton btnClose = new JButton("끝내기"); pEast.add(btnClose, BorderLayout.SOUTH); JPanel pMain = new JPanel(); contentPane.add(pMain, BorderLayout.CENTER); pMain.setLayout(new BorderLayout(0, 0)); JPanel pNorth = new JPanel(); pMain.add(pNorth, BorderLayout.NORTH); pNorth.setLayout(new BorderLayout(0, 0)); JLabel lblNickName = new JLabel("대화명 : "); pNorth.add(lblNickName, BorderLayout.WEST); tFNickName = new JTextField(); tFNickName.addActionListener(this); pNorth.add(tFNickName, BorderLayout.CENTER); tFNickName.setColumns(20); btnConnect = new JButton("접속"); btnConnect.addActionListener(this); pNorth.add(btnConnect, BorderLayout.EAST); JPanel pView = new JPanel(); pMain.add(pView, BorderLayout.CENTER); pView.setLayout(new BorderLayout(0, 0)); JScrollPane scrollPane = new JScrollPane(); pView.add(scrollPane); tAView = new JTextArea(); tAView.setEditable(false); scrollPane.setViewportView(tAView); JPanel pSouth = new JPanel(); pMain.add(pSouth, BorderLayout.SOUTH); pSouth.setLayout(new BorderLayout(0, 0)); JLabel lblTalk = new JLabel("대 화 : "); pSouth.add(lblTalk, BorderLayout.WEST); tFTalk = new JTextField(); pSouth.add(tFTalk, BorderLayout.CENTER); tFTalk.setColumns(20); JButton btnSend = new JButton("전송"); pSouth.add(btnSend, BorderLayout.EAST); } public void actionPerformed(ActionEvent e) { if (e.getSource() == btnConnect || e.getSource() == tFNickName) { String str = tFNickName.getText().trim(); if (str==null||str.length()==0){ tFNickName.setText(""); tFNickName.requestFocus(); tAView.setText("대화명을 적으세요"); return; } try { soc = new Socket("192.168.0.18", 1234); os = soc.getOutputStream(); br = new BufferedReader(new InputStreamReader(soc.getInputStream())); os.write((str+"\n").getBytes());//서버에게 닉네임을 전송 currentTh = new Thread(this); currentTh.start(); } catch (UnknownHostException e1) { e1.printStackTrace(); } catch (IOException e1) { tAView.setText("서버와 연결이 되지 않았습니다."); return; } } } @Override public void run() { tFNickName.setEnabled(false); btnConnect.setEnabled(false); tFTalk.requestFocus(); tAView.setText("*** 대화에 참여 하셨네요!! ***\n\n\n"); String message = null; while(true){ //서버와 통신 try { message = br.readLine(); if (message == null){ continue; } if (message.charAt(0) == '/'){ if (message.charAt(1) == 'p'){ String imsi = message.substring(2).trim(); model.addElement(imsi); int xx = Integer.parseInt(lblCnt.getText())+1; lblCnt.setText(xx+""); } }else{ tAView.append(message + "\n"); } } catch (IOException e) { e.printStackTrace(); } } } }
[ "net94@naver.com" ]
net94@naver.com
cdeaf641f181e5079e2c42183ed4c4a20c3ffbc8
5b243a29a89adb5ea5c186daaf6b2df54b693534
/src/main/java/com/bow/camptotheca/mr/SequentialWorkflow.java
1cc19ce4d525f0945f320924101eae1b699b4d1c
[]
no_license
williamxww/camptotheca
3dfbff8e78b1f2db14030cbbaf3ea36ae0a6856c
2d56b510c600ca3f6434e0cf71c870418f92054f
refs/heads/master
2021-01-22T11:12:17.554288
2017-06-07T16:11:33
2017-06-07T16:11:33
92,675,143
0
0
null
null
null
null
UTF-8
Java
false
false
4,091
java
package com.bow.camptotheca.mr; import java.util.Map; import java.util.Set; /** * Coordinates the execution of a map-reduce job in a single thread. This means * that the data source is fed tuple by tuple to the mapper, the output tuples * are collected, split according to their keys, and each list is sent to the * reducer, again in a sequential fashion. As such, the SequentialWorkflow * reproduces exactly the processing done by map-reduce, without the * distribution of computation. It is best suited to pedagogical and debugging * purposes. * * @author Sylvain Hallé * @version 1.1 * */ public class SequentialWorkflow<K, V> implements Workflow<K, V> { private Mapper<K, V> mapper = null; private Reducer<K, V> reducer = null; private InCollector<K, V> source = null; /** * The total number of tuples that the mappers will produce. This is only * necessary for gathering statistics, and is not required in the MapReduce * processing <i>per se</i>. */ protected long totalTuples = 0; /** * The maximum number of tuples that a single reducer will process. This is * used as a measure of the "linearity" of the MapReduce job: assuming all * reducers worked on a separate thread, this value is proportional to the * time the longest reducer would take. Intuitively, the ratio * maxTuples/totalTuples indicates the "speedup" incurred by the use of * parallel reducers compared to a strictly linear processing. */ protected long maxTuples = 0; /** * Create an instance of SequentialWorkflow. * * @param m The {@link Mapper} to use in the map phase * @param r The {@link Reducer} to use in the reduce phase * @param c The {@link InCollector} to use as the input source of tuples */ public SequentialWorkflow(Mapper<K, V> m, Reducer<K, V> r, InCollector<K, V> c) { super(); setMapper(m); setReducer(r); setSource(c); } public void setMapper(Mapper<K, V> m) { mapper = m; } public void setReducer(Reducer<K, V> r) { reducer = r; } public void setSource(InCollector<K, V> c) { source = c; } public InCollector<K, V> run() { if (mapper == null || reducer == null || source == null) { return null; } assert mapper != null; assert reducer != null; assert source != null; Collector<K, V> tempCollector = new Collector<K, V>(); source.rewind(); while (source.hasNext()) { Tuple<K, V> t = source.next(); //对原始数据进行处理获取想要的数据格式 mapper.map(tempCollector, t); } // 分组,key相同的tuple放到一个集合里面 Map<K, Collector<K, V>> shuffle = tempCollector.subCollectors(); Set<K> keys = shuffle.keySet(); Collector<K, V> out = new Collector<K, V>(); for (K key : keys) { Collector<K, V> sameKeyCollector = shuffle.get(key); int tupleNum = sameKeyCollector.count(); totalTuples += tupleNum; maxTuples = Math.max(maxTuples, tupleNum); //对一组key相同的tuple进行合并 reducer.reduce(out, key, sameKeyCollector); } return out; } /** * Returns the maximum number of tuples processed by a single reducer in the * process. This method returns 0 if the MapReduce job hasn't executed yet * (i.e. you should call it only after a call to * {@link SequentialWorkflow#run()}). * * @return The number of tuples */ public long getMaxTuples() { return maxTuples; } /** * Returns the total number of tuples processed by all reducers. This method * returns 0 if the MapReduce job hasn't executed yet (i.e. you should call * it only after a call to {@link SequentialWorkflow#run()}). * * @return The number of tuples */ public long getTotalTuples() { return totalTuples; } }
[ "vivid_xiang@163.com" ]
vivid_xiang@163.com
d958240244d52f471218546dc28f5f28123bdf23
092f1d73113ff0d591d2ab69b704f83e81ce8b06
/common/src/main/java/com/mujirenben/android/common/datapackage/http/imageLoader/glide/ImageConfigImpl.java
108f4db680f8e09febeee5d9e9e70f5e3e7e7fba
[]
no_license
MrCodeSniper/HrzComponent
1e2b58f589c00d45dc641e17a43e529c2818563a
e7dce92af79ed773e7461d31e510890457c1a578
refs/heads/master
2020-04-08T10:33:16.059264
2018-12-07T03:47:55
2018-12-07T03:47:55
159,273,628
1
1
null
null
null
null
UTF-8
Java
false
false
7,690
java
package com.mujirenben.android.common.datapackage.http.imageLoader.glide; import android.widget.ImageView; import com.bumptech.glide.load.resource.bitmap.BitmapTransformation; import com.mujirenben.android.common.datapackage.http.imageLoader.BaseImageLoaderStrategy; import com.mujirenben.android.common.datapackage.http.imageLoader.ImageConfig; import com.mujirenben.android.common.datapackage.http.imageLoader.ImageLoader; /** * ================================================ * 这里存放图片请求的配置信息,可以一直扩展字段,如果外部调用时想让图片加载框架 * 做一些操作,比如清除缓存或者切换缓存策略,则可以定义一个 int 类型的变量,内部根据 switch(int) 做不同的操作 * 其他操作同理 * ================================================ */ public class ImageConfigImpl extends ImageConfig { private int cacheStrategy;//0对应DiskCacheStrategy.all,1对应DiskCacheStrategy.NONE,2对应DiskCacheStrategy.SOURCE,3对应DiskCacheStrategy.RESULT private int fallback; //请求 url 为空,则使用此图片作为占位符 private int imageRadius;//图片每个圆角的大小 private int blurValue;//高斯模糊值, 值越大模糊效果越大 /** * @see {@link Builder#transformation(BitmapTransformation)} */ @Deprecated private BitmapTransformation transformation;//glide用它来改变图形的形状 private ImageView[] imageViews; private boolean isCrossFade;//是否使用淡入淡出过渡动画 private boolean isCenterCrop;//是否将图片剪切为 CenterCrop private boolean isCircle;//是否将图片剪切为圆形 private boolean isClearMemory;//清理内存缓存 private boolean isClearDiskCache;//清理本地缓存 private ImageConfigImpl(Builder builder) { this.url = builder.url; this.imageView = builder.imageView; this.placeholder = builder.placeholder; this.errorPic = builder.errorPic; this.fallback = builder.fallback; this.cacheStrategy = builder.cacheStrategy; this.imageRadius = builder.imageRadius; this.blurValue = builder.blurValue; this.transformation = builder.transformation; this.imageViews = builder.imageViews; this.isCrossFade = builder.isCrossFade; this.isCenterCrop = builder.isCenterCrop; this.isCircle = builder.isCircle; this.isClearMemory = builder.isClearMemory; this.isClearDiskCache = builder.isClearDiskCache; } public int getCacheStrategy() { return cacheStrategy; } public BitmapTransformation getTransformation() { return transformation; } public ImageView[] getImageViews() { return imageViews; } public boolean isClearMemory() { return isClearMemory; } public boolean isClearDiskCache() { return isClearDiskCache; } public int getFallback() { return fallback; } public int getBlurValue() { return blurValue; } public boolean isBlurImage() { return blurValue > 0; } public int getImageRadius() { return imageRadius; } public boolean isImageRadius() { return imageRadius > 0; } public boolean isCrossFade() { return isCrossFade; } public boolean isCenterCrop() { return isCenterCrop; } public boolean isCircle() { return isCircle; } public static Builder builder() { return new Builder(); } public static final class Builder { private String url; private ImageView imageView; private int placeholder; private int errorPic; private int fallback; //请求 url 为空,则使用此图片作为占位符 private int cacheStrategy;//0对应DiskCacheStrategy.all,1对应DiskCacheStrategy.NONE,2对应DiskCacheStrategy.SOURCE,3对应DiskCacheStrategy.RESULT private int imageRadius;//图片每个圆角的大小 private int blurValue;//高斯模糊值, 值越大模糊效果越大 /** * @see {@link Builder#transformation(BitmapTransformation)} */ @Deprecated private BitmapTransformation transformation;//glide用它来改变图形的形状 private ImageView[] imageViews; private boolean isCrossFade;//是否使用淡入淡出过渡动画 private boolean isCenterCrop;//是否将图片剪切为 CenterCrop private boolean isCircle;//是否将图片剪切为圆形 private boolean isClearMemory;//清理内存缓存 private boolean isClearDiskCache;//清理本地缓存 private Builder() { } public Builder url(String url) { this.url = url; return this; } public Builder placeholder(int placeholder) { this.placeholder = placeholder; return this; } public Builder errorPic(int errorPic) { this.errorPic = errorPic; return this; } public Builder fallback(int fallback) { this.fallback = fallback; return this; } public Builder imageView(ImageView imageView) { this.imageView = imageView; return this; } public Builder cacheStrategy(int cacheStrategy) { this.cacheStrategy = cacheStrategy; return this; } public Builder imageRadius(int imageRadius) { this.imageRadius = imageRadius; return this; } public Builder blurValue(int blurValue) { //blurValue 建议设置为 15 this.blurValue = blurValue; return this; } /** * 给图片添加 Glide 独有的 BitmapTransformation * <p> * 因为 BitmapTransformation 是 Glide 独有的类, 所以如果 BitmapTransformation 出现在 {@link ImageConfigImpl} 中 * 会使 {@link ImageLoader} 难以切换为其他图片加载框架, 在 {@link ImageConfigImpl} 中只能配置基础类型和 Android 包里的类 * 此 API 会在后面的版本中被删除, 请使用其他 API 替代 * * @param transformation {@link BitmapTransformation} * @deprecated 请使用 {@link #isCircle()}, {@link #isCenterCrop()}, {@link #isImageRadius()} 替代 * 如果有其他自定义 BitmapTransformation 的需求, 请自行扩展 {@link BaseImageLoaderStrategy} */ @Deprecated public Builder transformation(BitmapTransformation transformation) { this.transformation = transformation; return this; } public Builder imageViews(ImageView... imageViews) { this.imageViews = imageViews; return this; } public Builder isCrossFade(boolean isCrossFade) { this.isCrossFade = isCrossFade; return this; } public Builder isCenterCrop(boolean isCenterCrop) { this.isCenterCrop = isCenterCrop; return this; } public Builder isCircle(boolean isCircle) { this.isCircle = isCircle; return this; } public Builder isClearMemory(boolean isClearMemory) { this.isClearMemory = isClearMemory; return this; } public Builder isClearDiskCache(boolean isClearDiskCache) { this.isClearDiskCache = isClearDiskCache; return this; } public ImageConfigImpl build() { return new ImageConfigImpl(this); } } }
[ "15168264355@163.com" ]
15168264355@163.com
80017ea2b092d087d9752014f469217a2244597e
e21d17cdcd99c5d53300a7295ebb41e0f876bbcb
/22_Chapters_Edition/src/main/java/com/lypgod/test/tij4/practices/Ch17_Containers/Practice16/MapEntry.java
1fdd2fe928b205bbb6e7791119c02730d4af8fc6
[]
no_license
lypgod/Thinking_In_Java_4th_Edition
dc42a377de28ae51de2c4000a860cd3bc93d0620
5dae477f1a44b15b9aa4944ecae2175bd5d8c10e
refs/heads/master
2020-04-05T17:39:55.720961
2018-11-11T12:07:56
2018-11-11T12:08:26
157,070,646
0
0
null
null
null
null
UTF-8
Java
false
false
1,080
java
package com.lypgod.test.tij4.practices.Ch17_Containers.Practice16;//: containers/MapEntry.java // A simple Map.Entry for sample Map implementations. import java.util.Map; public class MapEntry<K, V> implements Map.Entry<K, V> { private K key; private V value; public MapEntry(K key, V value) { this.key = key; this.value = value; } public K getKey() { return key; } public V getValue() { return value; } public V setValue(V v) { V result = value; value = v; return result; } public int hashCode() { return (key == null ? 0 : key.hashCode()) ^ (value == null ? 0 : value.hashCode()); } public boolean equals(Object o) { if (!(o instanceof MapEntry)) return false; MapEntry me = (MapEntry) o; return (key == null ? me.getKey() == null : key.equals(me.getKey())) && (value == null ? me.getValue() == null : value.equals(me.getValue())); } public String toString() { return key + "=" + value; } } ///:~
[ "lypgod@hotmail.com" ]
lypgod@hotmail.com
3abb321f88f5b50242c8cf7aed15b2ead3e90bbe
677197bbd8a9826558255b8ec6235c1e16dd280a
/src/fm/qingting/framework/data/IMonitorMobAgent.java
1620e684c5630f98375837e397c4b9b00a7b5408
[]
no_license
xiaolongyuan/QingTingCheat
19fcdd821650126b9a4450fcaebc747259f41335
989c964665a95f512964f3fafb3459bec7e4125a
refs/heads/master
2020-12-26T02:31:51.506606
2015-11-11T08:12:39
2015-11-11T08:12:39
45,967,303
0
1
null
2015-11-11T07:47:59
2015-11-11T07:47:59
null
UTF-8
Java
false
false
999
java
package fm.qingting.framework.data; public abstract interface IMonitorMobAgent { public abstract void sendMobAgentAPI(String paramString1, String paramString2, Object paramObject); public abstract void sendMobAgentAPIERROR(String paramString1, String paramString2, Object paramObject); public abstract void sendMobAgentAPITIMEOUT(String paramString, Object paramObject); public abstract void sendMobAgentAPIUNKNOWHOST(String paramString, Object paramObject); public abstract void sendMobAgentEvent(String paramString); public abstract void sendMobAgentEvent(String paramString1, String paramString2); public abstract void sendMobAgentEventDuration(String paramString, Long paramLong); public abstract void sendMobAgentEventDuration(String paramString1, String paramString2, Long paramLong); } /* Location: /Users/zhangxun-xy/Downloads/qingting2/classes_dex2jar.jar * Qualified Name: fm.qingting.framework.data.IMonitorMobAgent * JD-Core Version: 0.6.2 */
[ "cnzx219@qq.com" ]
cnzx219@qq.com
616b4f87e6e3d116139788ba377c74caff5e6fc2
5728f50a394b62394587b0b255a57dcf4d13d20d
/src/java/org/jsimpledb/core/Tuple4FieldType.java
d256778d57b9b525c2ef014b6c7d6553962cff2d
[ "Apache-2.0" ]
permissive
mayoricodevault/jsimpledb
3d905744c7a5e55c1fe530dd6d91c99c4c730f1e
9ee8301a6cda92a2d85ec1b0d94cfde6a78e5e38
refs/heads/master
2021-06-13T06:30:51.209136
2015-05-08T15:56:55
2015-05-08T15:56:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,177
java
/* * Copyright (C) 2014 Archie L. Cobbs. All rights reserved. * * $Id$ */ package org.jsimpledb.core; import com.google.common.reflect.TypeParameter; import com.google.common.reflect.TypeToken; import org.jsimpledb.tuple.Tuple4; class Tuple4FieldType<V1, V2, V3, V4> extends TupleFieldType<Tuple4<V1, V2, V3, V4>> { @SuppressWarnings("serial") Tuple4FieldType(FieldType<V1> value1Type, FieldType<V2> value2Type, FieldType<V3> value3Type, FieldType<V4> value4Type) { super(new TypeToken<Tuple4<V1, V2, V3, V4>>() { } .where(new TypeParameter<V1>() { }, value1Type.typeToken.wrap()) .where(new TypeParameter<V2>() { }, value2Type.typeToken.wrap()) .where(new TypeParameter<V3>() { }, value3Type.typeToken.wrap()) .where(new TypeParameter<V4>() { }, value4Type.typeToken.wrap()), value1Type, value2Type, value3Type, value4Type); } @Override @SuppressWarnings("unchecked") protected Tuple4<V1, V2, V3, V4> createTuple(Object[] values) { assert values.length == 4; return new Tuple4<V1, V2, V3, V4>((V1)values[0], (V2)values[1], (V3)values[2], (V4)values[3]); } }
[ "archie.cobbs@3d3da37c-52f5-b908-f4a3-ab77ce6ea90f" ]
archie.cobbs@3d3da37c-52f5-b908-f4a3-ab77ce6ea90f
820285b1b7bd9fd227cbfee3ddeb0e823a11901e
82eba08b9a7ee1bd1a5f83c3176bf3c0826a3a32
/ZmailSoap/src/wsdl-test/generated/zcsclient/mail/testModifyContactRequest.java
8e3fbf71bb40cd109d3a45e0e9af549ca610a102
[ "MIT" ]
permissive
keramist/zmailserver
d01187fb6086bf3784fe180bea2e1c0854c83f3f
762642b77c8f559a57e93c9f89b1473d6858c159
refs/heads/master
2021-01-21T05:56:25.642425
2013-10-21T11:27:05
2013-10-22T12:48:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,298
java
/* * ***** BEGIN LICENSE BLOCK ***** * * Zimbra Collaboration Suite Server * Copyright (C) 2011, 2012 VMware, Inc. * * The contents of this file are subject to the Zimbra Public License * Version 1.3 ("License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.zimbra.com/license. * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. * * ***** END LICENSE BLOCK ***** */ package generated.zcsclient.mail; 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; /** * <p>Java class for modifyContactRequest complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="modifyContactRequest"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="cn" type="{urn:zmailMail}modifyContactSpec"/> * &lt;/sequence> * &lt;attribute name="replace" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;attribute name="verbose" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "modifyContactRequest", propOrder = { "cn" }) public class testModifyContactRequest { @XmlElement(required = true) protected testModifyContactSpec cn; @XmlAttribute(name = "replace") protected Boolean replace; @XmlAttribute(name = "verbose") protected Boolean verbose; /** * Gets the value of the cn property. * * @return * possible object is * {@link testModifyContactSpec } * */ public testModifyContactSpec getCn() { return cn; } /** * Sets the value of the cn property. * * @param value * allowed object is * {@link testModifyContactSpec } * */ public void setCn(testModifyContactSpec value) { this.cn = value; } /** * Gets the value of the replace property. * * @return * possible object is * {@link Boolean } * */ public Boolean isReplace() { return replace; } /** * Sets the value of the replace property. * * @param value * allowed object is * {@link Boolean } * */ public void setReplace(Boolean value) { this.replace = value; } /** * Gets the value of the verbose property. * * @return * possible object is * {@link Boolean } * */ public Boolean isVerbose() { return verbose; } /** * Sets the value of the verbose property. * * @param value * allowed object is * {@link Boolean } * */ public void setVerbose(Boolean value) { this.verbose = value; } }
[ "bourgerie.quentin@gmail.com" ]
bourgerie.quentin@gmail.com
c207cb9c4bf0992eb98dbebd2418038f7bce6216
96f8d42c474f8dd42ecc6811b6e555363f168d3e
/budejie/sources/cn/v6/sixrooms/utils/phone/HistoryDbTool.java
694000b2ee32807079995394827cdda3f5d6f7ed
[]
no_license
aheadlcx/analyzeApk
050b261595cecc85790558a02d79739a789ae3a3
25cecc394dde4ed7d4971baf0e9504dcb7fabaca
refs/heads/master
2020-03-10T10:24:49.773318
2018-04-13T09:44:45
2018-04-13T09:44:45
129,332,351
6
2
null
null
null
null
UTF-8
Java
false
false
5,670
java
package cn.v6.sixrooms.utils.phone; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import cn.v6.sixrooms.pojo.HistroyWatch; import java.util.ArrayList; import java.util.List; public class HistoryDbTool { private static SQLiteDatabase a; /* JADX WARNING: inconsistent code. */ /* Code decompiled incorrectly, please refer to instructions dump. */ public static void delete(android.content.Context r4, java.lang.String r5) { /* JADX: method processing error */ /* Error: jadx.core.utils.exceptions.JadxRuntimeException: Can't find block by offset: 0x0029 in list [B:5:0x0024] at jadx.core.utils.BlockUtils.getBlockByOffset(BlockUtils.java:43) at jadx.core.dex.instructions.IfNode.initBlocks(IfNode.java:60) at jadx.core.dex.visitors.blocksmaker.BlockFinish.initBlocksInIfNodes(BlockFinish.java:48) at jadx.core.dex.visitors.blocksmaker.BlockFinish.visit(BlockFinish.java:33) at jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31) at jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17) at jadx.core.ProcessClass.process(ProcessClass.java:34) at jadx.core.ProcessClass.processDependencies(ProcessClass.java:56) at jadx.core.ProcessClass.process(ProcessClass.java:39) at jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282) at jadx.api.JavaClass.decompile(JavaClass.java:62) at jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200) */ /* a(r4); r0 = a; Catch:{ SQLiteException -> 0x002a, all -> 0x0038 } r1 = "HistoryWatchData"; Catch:{ SQLiteException -> 0x002a, all -> 0x0038 } r2 = new java.lang.StringBuilder; Catch:{ SQLiteException -> 0x002a, all -> 0x0038 } r3 = "rid in("; Catch:{ SQLiteException -> 0x002a, all -> 0x0038 } r2.<init>(r3); Catch:{ SQLiteException -> 0x002a, all -> 0x0038 } r2 = r2.append(r5); Catch:{ SQLiteException -> 0x002a, all -> 0x0038 } r3 = ")"; Catch:{ SQLiteException -> 0x002a, all -> 0x0038 } r2 = r2.append(r3); Catch:{ SQLiteException -> 0x002a, all -> 0x0038 } r2 = r2.toString(); Catch:{ SQLiteException -> 0x002a, all -> 0x0038 } r3 = 0; Catch:{ SQLiteException -> 0x002a, all -> 0x0038 } r0.delete(r1, r2, r3); Catch:{ SQLiteException -> 0x002a, all -> 0x0038 } r0 = a; if (r0 == 0) goto L_0x0029; L_0x0024: r0 = a; r0.close(); L_0x0029: return; L_0x002a: r0 = move-exception; r0.printStackTrace(); Catch:{ SQLiteException -> 0x002a, all -> 0x0038 } r0 = a; if (r0 == 0) goto L_0x0029; L_0x0032: r0 = a; r0.close(); goto L_0x0029; L_0x0038: r0 = move-exception; r1 = a; if (r1 == 0) goto L_0x0042; L_0x003d: r1 = a; r1.close(); L_0x0042: throw r0; */ throw new UnsupportedOperationException("Method not decompiled: cn.v6.sixrooms.utils.phone.HistoryDbTool.delete(android.content.Context, java.lang.String):void"); } private static void a(Context context) { a = new HistoryOpenHelper(context).getWritableDatabase(); } public static void add(Context context, HistroyWatch histroyWatch) { a(context); ContentValues contentValues = new ContentValues(); contentValues.put("rid", histroyWatch.getRid()); contentValues.put("pic", histroyWatch.getPic()); contentValues.put(HistoryOpenHelper.COLUMN_USERNAME, histroyWatch.getUsername()); contentValues.put(HistoryOpenHelper.COLUMN_LEVEL, histroyWatch.getLevel()); contentValues.put(HistoryOpenHelper.COLUMN_DATE, Long.valueOf(histroyWatch.getDate())); contentValues.put(HistoryOpenHelper.COLUMN_UID, histroyWatch.getUid()); a.insert(HistoryOpenHelper.TABLE_NAME, null, contentValues); a.close(); } public static void deleteAll(Context context) { a(context); a.delete(HistoryOpenHelper.TABLE_NAME, null, null); a.close(); } public static List<HistroyWatch> query(Context context) { List<HistroyWatch> list = null; a(context); Cursor query = a.query(HistoryOpenHelper.TABLE_NAME, null, null, null, null, null, null); if (query.getCount() == 0) { query.close(); a.close(); } else { List arrayList = new ArrayList(); while (query.moveToNext()) { HistroyWatch histroyWatch = new HistroyWatch(); histroyWatch.setRid(query.getString(query.getColumnIndex("rid"))); histroyWatch.setPic(query.getString(query.getColumnIndex("pic"))); histroyWatch.setUsername(query.getString(query.getColumnIndex(HistoryOpenHelper.COLUMN_USERNAME))); histroyWatch.setLevel(query.getString(query.getColumnIndex(HistoryOpenHelper.COLUMN_LEVEL))); histroyWatch.setDate(Long.parseLong(query.getString(query.getColumnIndex(HistoryOpenHelper.COLUMN_DATE)))); histroyWatch.set_id(query.getLong(query.getColumnIndex(HistoryOpenHelper.COLUMN_ID))); histroyWatch.setUid(query.getString(query.getColumnIndex(HistoryOpenHelper.COLUMN_UID))); arrayList.add(histroyWatch); } query.close(); a.close(); list = new ArrayList(); for (int size = arrayList.size() - 1; size >= 0; size--) { list.add(arrayList.get(size)); } } return list; } }
[ "aheadlcxzhang@gmail.com" ]
aheadlcxzhang@gmail.com
809c0c6dfbe79669a8e8f117fbc556443649789c
dec6bd85db1d028edbbd3bd18fe0ca628eda012e
/eclipse-projects/credito/servico-c/src/main/java/br/com/app/rastreioevtspessoafisica/dao/RastreioEvtsPessoaFisicaRepository.java
20fe8eded335d5473646bad12cb54db2489d9b0e
[]
no_license
MatheusGrenfell/java-projects
21b961697e2c0c6a79389c96b588e142c3f70634
93c7bfa2e4f73a232ffde2d38f30a27f2a816061
refs/heads/master
2022-12-29T12:55:00.014296
2020-10-16T00:54:30
2020-10-16T00:54:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
275
java
package br.com.app.rastreioevtspessoafisica.dao; import org.springframework.stereotype.Repository; import br.com.app.infra.database.RepositoryBase; @Repository public interface RastreioEvtsPessoaFisicaRepository extends RepositoryBase<RastreioEvtsPessoaFisicaEntity> { }
[ "caiohobus@gmail.com" ]
caiohobus@gmail.com
b4f4e96bf2f3b73825c39175c3fc80795bbdc34a
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/28/28_f2341fb0f31485535acea211ef2872cce3c57fb8/Hashtag/28_f2341fb0f31485535acea211ef2872cce3c57fb8_Hashtag_t.java
deee6749aee7036676c2b9c2ed5c9bb57aca3d42
[]
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,020
java
package dal; import java.util.HashSet; import java.util.Set; public class Hashtag { private int id; private String hashtag; private Set<PictureData> pictures; public Hashtag(String hashtag){ this.hashtag = hashtag; pictures = new HashSet<PictureData>(); } public Set<PictureData> getPictures(){ return pictures; } public void setPictures(Set<PictureData> pics){ this.pictures = pics; } public void addPicToHashtag(PictureData pd){ pictures.add(pd); pd.getHashtags().add(this); } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getHashtag() { return hashtag; } public void setHashtag(String hashtag) { this.hashtag = hashtag; } @Override public int hashCode() { return hashtag.hashCode(); } @Override public boolean equals(Object o) { if(o instanceof Hashtag){ Hashtag h = (Hashtag)o; if(h.hashtag.equals(hashtag)) return true; } return false; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
928e3d2ab1643f91f5c1dd8a4dffd9adb1a99388
fa1408365e2e3f372aa61e7d1e5ea5afcd652199
/src/testcases/CWE400_Resource_Exhaustion/s03/CWE400_Resource_Exhaustion__sleep_max_value_67a.java
57631396e35604301394f58200652ec368847280
[]
no_license
bqcuong/Juliet-Test-Case
31e9c89c27bf54a07b7ba547eddd029287b2e191
e770f1c3969be76fdba5d7760e036f9ba060957d
refs/heads/master
2020-07-17T14:51:49.610703
2019-09-03T16:22:58
2019-09-03T16:22:58
206,039,578
1
2
null
null
null
null
UTF-8
Java
false
false
2,853
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE400_Resource_Exhaustion__sleep_max_value_67a.java Label Definition File: CWE400_Resource_Exhaustion__sleep.label.xml Template File: sources-sinks-67a.tmpl.java */ /* * @description * CWE: 400 Resource Exhaustion * BadSource: max_value Set count to a hardcoded value of Integer.MAX_VALUE * GoodSource: A hardcoded non-zero, non-min, non-max, even number * Sinks: * GoodSink: Validate count before using it as a parameter in sleep function * BadSink : Use count as the parameter for sleep withhout checking it's size first * Flow Variant: 67 Data flow: data passed in a class from one method to another in different source files in the same package * * */ package testcases.CWE400_Resource_Exhaustion.s03; import testcasesupport.*; public class CWE400_Resource_Exhaustion__sleep_max_value_67a extends AbstractTestCase { static class Container { public int containerOne; } public void bad() throws Throwable { int count; /* POTENTIAL FLAW: Set count to Integer.MAX_VALUE */ count = Integer.MAX_VALUE; Container countContainer = new Container(); countContainer.containerOne = count; (new CWE400_Resource_Exhaustion__sleep_max_value_67b()).badSink(countContainer ); } public void good() throws Throwable { goodG2B(); goodB2G(); } /* goodG2B() - use goodsource and badsink */ private void goodG2B() throws Throwable { int count; /* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */ count = 2; Container countContainer = new Container(); countContainer.containerOne = count; (new CWE400_Resource_Exhaustion__sleep_max_value_67b()).goodG2BSink(countContainer ); } /* goodB2G() - use badsource and goodsink */ private void goodB2G() throws Throwable { int count; /* POTENTIAL FLAW: Set count to Integer.MAX_VALUE */ count = Integer.MAX_VALUE; Container countContainer = new Container(); countContainer.containerOne = count; (new CWE400_Resource_Exhaustion__sleep_max_value_67b()).goodB2GSink(countContainer ); } /* Below is the main(). It is only used when building this testcase on * its own for testing or for building a binary to use in testing binary * analysis tools. It is not used when compiling all the testcases as one * application, which is how source code analysis tools are tested. */ public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException { mainFromParent(args); } }
[ "bqcuong2212@gmail.com" ]
bqcuong2212@gmail.com
c06ac70c5f65221318034df01faa1f013a66b54a
36155fc6d1b1cd36edb4b80cb2fc2653be933ebd
/lc/src/LC/SOL/NextClosestTime.java
cf5a63864ff1ba83ae0458202594499458cce66b
[]
no_license
Delon88/leetcode
c9d46a6e29749f7a2c240b22e8577952300f2b0f
84d17ee935f8e64caa7949772f20301ff94b9829
refs/heads/master
2021-08-11T05:52:28.972895
2021-08-09T03:12:46
2021-08-09T03:12:46
96,177,512
0
0
null
null
null
null
UTF-8
Java
false
false
1,638
java
package LC.SOL; public class NextClosestTime { class Solution { int target; int minDiff = Integer.MAX_VALUE; String ret = ""; int DayInMinutes = 60 * 24; public String nextClosestTime(String time) { time = time.replace(":", ""); target = toMinutes(time); char[] digits = time.toCharArray(); dfs(new StringBuilder(), digits, 0); return ret; } void dfs(StringBuilder tmp, char[] digits, int level) { if (level == digits.length) { String time = new String(tmp); if (isValid(time)) { int curDiff = target < toMinutes(time) ? toMinutes(time) - target : toMinutes(time) + DayInMinutes - target; if (curDiff < minDiff) { minDiff = curDiff; StringBuilder b = new StringBuilder(); b.append(tmp).insert(2, ":"); ret = b.toString(); } } return; } for (int i = 0; i < digits.length; i++) { tmp.append(digits[i]); dfs(tmp, digits, level + 1); tmp.deleteCharAt(tmp.length() - 1); } } boolean isValid(String time) { return Integer.parseInt(time.substring(0, 2)) < 24 && Integer.parseInt(time.substring(2)) < 60; } int toMinutes(String time) { return Integer.parseInt(time.substring(0, 2)) * 60 + Integer.parseInt(time.substring(2)); } } }
[ "Mr.AlainDelon@gmail.com" ]
Mr.AlainDelon@gmail.com
e08913702cac5821a4195fe59350b6c45963461e
cf7c928d6066da1ce15d2793dcf04315dda9b9ed
/Baekjoon_Online_Judge/단계/24 DFS와 BFS/Main_BOJ_2667_단지번호붙이기_BFS.java
bed828d63b222c140e42f08bfd63a57e3b7ecf7d
[]
no_license
refresh6724/APS
a261b3da8f53de7ff5ed687f21bb1392046c98e5
945e0af114033d05d571011e9dbf18f2e9375166
refs/heads/master
2022-02-01T23:31:42.679631
2021-12-31T14:16:04
2021-12-31T14:16:04
251,617,280
0
0
null
null
null
null
UTF-8
Java
false
false
2,417
java
import java.util.Arrays; import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; import java.util.StringTokenizer; //Olympiad > 한국정보올림피아드 > KOI 1996 > 초등부 1번 public class Main { // 제출일 2019-08-28 14:01 static StringBuilder sb = new StringBuilder(); static int answer; static int[][] input; static int[][] map; static int num; static int N; public static void main(String[] args) throws Exception { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); // 테스트케이스 N = Integer.parseInt(sc.nextLine()); input = new int[N][N]; map = new int[N][N]; StringTokenizer st; for (int i = 0; i < N; i++) { String str = sc.nextLine(); for (int j = 0; j < N; j++) { // System.out.print(str.charAt(j)); input[i][j] = str.charAt(j) - '0'; } // System.out.println(Arrays.toString(input[i])); // System.out.println(); } // 입력 종료 num = 1; for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { if (input[i][j] == 1 && map[i][j] == 0) { paint(i, j); num++; } } } // 단지 칠하기 종료 int[] list = new int[num]; // 1에서 num-1까지 사용 for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { list[map[i][j]]++; } } // 숫자 세기 종료 int[] sortList = Arrays.copyOfRange(list, 1, num); Arrays.sort(sortList); // 오름차순 정렬 sb.append(num - 1).append("\n"); for (int i = 0; i < num - 1; i++) { sb.append(sortList[i]).append("\n"); } System.out.println(sb); } private static void paint(int i, int j) { Queue<Node> q = new LinkedList<Node>(); q.add(new Node(i, j)); map[i][j] = num; while (!q.isEmpty()) { Node tmp = q.poll(); i = tmp.r; j = tmp.c; if (i - 1 >= 0 && input[i - 1][j] == 1 && map[i - 1][j] == 0) { q.add(new Node(i - 1, j)); map[i-1][j] = num; } if (i + 1 < N && input[i + 1][j] == 1 && map[i + 1][j] == 0) { q.add(new Node(i + 1, j)); map[i+1][j] = num; } if (j - 1 >= 0 && input[i][j - 1] == 1 && map[i][j - 1] == 0) { q.add(new Node(i, j - 1)); map[i][j-1] = num; } if (j + 1 < N && input[i][j + 1] == 1 && map[i][j + 1] == 0) { q.add(new Node(i, j + 1)); map[i][j+1] = num; } } } } class Node { int r; int c; public Node(int r, int c) { this.r = r; this.c = c; } }
[ "refresh6724@gmail.com" ]
refresh6724@gmail.com
93a1573919a6b290ee96d22986fa33c364004771
c6d8dd7aba171163214253a3da841056ea2f6c87
/serenity-maven-plugin/src/main/java/net/serenitybdd/maven/plugins/SerenityReportMojo.java
ef6cc273e56d874312bd48c9337f50b790b90ba2
[ "LicenseRef-scancode-warranty-disclaimer", "Apache-2.0" ]
permissive
serenity-bdd/serenity-core
602b8369f9527bea21a30104a45ba9b6e4d48238
ab6eaa5018e467b43e4f099e7682ce2924a9b12f
refs/heads/main
2023-09-01T22:37:02.079831
2023-09-01T17:24:41
2023-09-01T17:24:41
26,201,720
738
656
NOASSERTION
2023-09-08T14:33:06
2014-11-05T03:44:57
HTML
UTF-8
Java
false
false
5,224
java
package net.serenitybdd.maven.plugins; import com.google.common.base.Splitter; import net.serenitybdd.core.Serenity; import net.thucydides.model.ThucydidesSystemProperty; import net.thucydides.model.environment.SystemEnvironmentVariables; import net.serenitybdd.core.di.SerenityInfrastructure; import net.thucydides.core.reports.ExtendedReports; import net.thucydides.model.util.EnvironmentVariables; import net.thucydides.model.webdriver.Configuration; import org.apache.commons.lang3.StringUtils; import org.apache.maven.execution.MavenSession; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; import org.apache.maven.project.MavenProject; import java.io.File; import java.nio.file.Path; import java.util.List; import java.util.Locale; import java.util.Optional; /** * Generate extended reports. * This allows extended reports to be generated independently of the full aggregate report, and opens the possibility * of more tailored next-generation reporting. */ @Mojo(name = "reports", requiresProject = false, requiresDependencyResolution = ResolutionScope.COMPILE_PLUS_RUNTIME) public class SerenityReportMojo extends AbstractMojo { /** * Reports are generated here */ @Parameter(property = "serenity.outputDirectory", defaultValue = "${basedir}/target/site/serenity") public File outputDirectory; /** * Serenity test reports are read from here */ @Parameter(property = "serenity.sourceDirectory", defaultValue = "${basedir}/target/site/serenity") public File sourceDirectory; /** * Base directory for requirements. */ @Parameter public String requirementsBaseDir; EnvironmentVariables environmentVariables; Configuration configuration; @Parameter(defaultValue = "${session}") protected MavenSession session; @Parameter(property = "tags") public String tags; @Parameter(defaultValue = "${project}") public MavenProject project; /** * Serenity project key */ @Parameter(property = "thucydides.project.key", defaultValue = "default") public String projectKey; @Parameter(property = "serenity.reports") public String reports; public void prepareExecution() throws MojoExecutionException { MavenProjectHelper.propagateBuildDir(session); configureOutputDirectorySettings(); if (!outputDirectory.exists()) { outputDirectory.mkdirs(); } configureEnvironmentVariables(); UpdatedClassLoader.withProjectClassesFrom(project); } private void configureOutputDirectorySettings() { if (outputDirectory == null) { outputDirectory = getConfiguration().getOutputDirectory(); } if (sourceDirectory == null) { sourceDirectory = getConfiguration().getOutputDirectory(); } final Path projectDir = session.getCurrentProject().getBasedir().toPath(); if (!outputDirectory.isAbsolute()) { outputDirectory = projectDir.resolve(outputDirectory.toPath()).toFile(); } if (!sourceDirectory.isAbsolute()) { sourceDirectory = projectDir.resolve(sourceDirectory.toPath()).toFile(); } } private EnvironmentVariables getEnvironmentVariables() { return SystemEnvironmentVariables.currentEnvironmentVariables(); } private Configuration getConfiguration() { if (configuration == null) { configuration = SerenityInfrastructure.getConfiguration(); } return configuration; } private void configureEnvironmentVariables() { Locale.setDefault(Locale.ENGLISH); updateSystemProperty(ThucydidesSystemProperty.SERENITY_PROJECT_KEY.getPropertyName(), projectKey, Serenity.getDefaultProjectKey()); updateSystemProperty(ThucydidesSystemProperty.SERENITY_TEST_REQUIREMENTS_BASEDIR.toString(), requirementsBaseDir); } private void updateSystemProperty(String key, String value, String defaultValue) { getEnvironmentVariables().setProperty(key, Optional.ofNullable(value).orElse(defaultValue)); } private void updateSystemProperty(String key, String value) { Optional.ofNullable(value).ifPresent( propertyValue -> getEnvironmentVariables().setProperty(key, propertyValue) ); } public void execute() throws MojoExecutionException { prepareExecution(); generateExtraReports(); } private void generateExtraReports() { if (StringUtils.isEmpty(reports)) { return; } List<String> extendedReportTypes = Splitter.on(",").splitToList(reports); ExtendedReports.named(extendedReportTypes).forEach( report -> { report.setSourceDirectory(sourceDirectory.toPath()); report.setOutputDirectory(outputDirectory.toPath()); Path generatedReport = report.generateReport(); } ); } }
[ "john.smart@wakaleo.com" ]
john.smart@wakaleo.com
b11e55218de4726b723f315e1df290ed27d0eeb0
a8eb13e507d8c3c0bbf515dc757dd12d5b86c6c1
/aimxcel-motion/src/main/java/com/aimxcel/abclearn/motion/graphs/GraphTimeControlNode.java
0fd526da2c61c4fd26eead6f571c2ab971a38a97
[]
no_license
venkat-thota/java-simulations
41bb30375c1a2dedff1e1d64fade90c0ab2eac6a
d4c94d9cc84c9ee57c7b541843f8235352726f5e
refs/heads/master
2020-12-04T01:33:55.211161
2020-01-24T16:26:12
2020-01-24T16:26:12
231,548,090
0
0
null
2020-10-13T18:37:51
2020-01-03T08:47:26
Java
UTF-8
Java
false
false
6,101
java
package com.aimxcel.abclearn.motion.graphs; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.ImageIcon; import javax.swing.JButton; import com.aimxcel.abclearn.common.aimxcelcommon.resources.AimxcelCommonResources; import com.aimxcel.abclearn.timeseries.model.TimeSeriesModel; import com.aimxcel.abclearn.timeseries.ui.TimeseriesResources; import com.aimxcel.abclearn.aimxcel2dcore.PNode; import com.aimxcel.abclearn.aimxcel2dextra.pswing.PSwing; public class GraphTimeControlNode extends PNode { /** * */ private static final long serialVersionUID = 1L; private PSwing goStopButton; private PSwing clearButton; private PNode seriesLayer = new PNode(); private boolean editable = true; private boolean constructed = false; public GraphTimeControlNode( TimeSeriesModel timeSeriesModel ) { addChild( seriesLayer ); goStopButton = new PSwing( new GoStopButton( timeSeriesModel ) ); addChild( goStopButton ); clearButton = new PSwing( new ClearButton( timeSeriesModel ) ); addChild( clearButton ); constructed = true; relayout(); } public GraphControlSeriesNode addVariable( ControlGraphSeries series ) { GraphControlSeriesNode seriesNode = createGraphControlSeriesNode( series ); seriesNode.setEditable( editable ); seriesNode.setOffset( 0, seriesLayer.getFullBounds().getHeight() + 5 ); seriesLayer.addChild( seriesNode ); relayout(); return seriesNode; } protected GraphControlSeriesNode createGraphControlSeriesNode( ControlGraphSeries series ) { return new GraphControlSeriesNode( series ); } private void relayout() { if ( constructed ) { double dy = 5; seriesLayer.setOffset( 0, 0 ); for ( int i = 0; i < seriesLayer.getChildrenCount(); i++ ) { GraphControlSeriesNode child = (GraphControlSeriesNode) seriesLayer.getChild( i ); child.relayout( dy ); } goStopButton.setOffset( 0, seriesLayer.getFullBounds().getMaxY() + dy ); clearButton.setOffset( 0, goStopButton.getFullBounds().getMaxY() + dy ); } } public void setEditable( boolean editable ) { this.editable = editable; for ( int i = 0; i < seriesLayer.getChildrenCount(); i++ ) { GraphControlSeriesNode child = (GraphControlSeriesNode) seriesLayer.getChild( i ); child.setEditable( editable ); } setHasChild( goStopButton, editable ); setHasChild( clearButton, editable ); } private void setHasChild( PNode child, boolean addChild ) { if ( addChild && !getChildrenReference().contains( child ) ) { addChild( child ); } else if ( !addChild && getChildrenReference().contains( child ) ) { removeChild( child ); } } public static class ClearButton extends JButton { /** * */ private static final long serialVersionUID = 1L; private TimeSeriesModel graphTimeSeries; public ClearButton( final TimeSeriesModel graphTimeSeries ) { super( AimxcelCommonResources.getString( "Common.clear" ) ); this.graphTimeSeries = graphTimeSeries; addActionListener( new ActionListener() { public void actionPerformed( ActionEvent e ) { graphTimeSeries.clear(); } } ); graphTimeSeries.addListener( new TimeSeriesModel.Adapter() { public void dataSeriesChanged() { updateEnabledState(); } } ); updateEnabledState(); } private void updateEnabledState() { setEnabled( graphTimeSeries.isThereRecordedData() ); } } public static class GoStopButton extends JButton { /** * */ private static final long serialVersionUID = 1L; private boolean goButton = true; private TimeSeriesModel timeSeriesModel; public GoStopButton( final TimeSeriesModel timeSeriesModel ) { super( AimxcelCommonResources.getString( "chart-time-control.go" ) ); this.timeSeriesModel = timeSeriesModel; addActionListener( new ActionListener() { public void actionPerformed( ActionEvent e ) { if ( isGoButton() ) { //if the charts are filled up, then we must go to live mode, since switching to record mode entails restoring the last recorded state first //see #2088 if ( timeSeriesModel.getRecordTime() >= timeSeriesModel.getMaxRecordTime() ) { timeSeriesModel.startLiveMode(); } else { timeSeriesModel.startRecording(); } } else { timeSeriesModel.setPaused( true ); } } } ); timeSeriesModel.addListener( new TimeSeriesModel.Adapter() { public void modeChanged() { updateGoState(); } public void pauseChanged() { updateGoState(); } } ); updateGoState(); } private void updateGoState() { setGoButton( !( timeSeriesModel.isRecording() || timeSeriesModel.isLiveAndNotPaused() ) ); } private void setGoButton( boolean go ) { this.goButton = go; setText( goButton ? AimxcelCommonResources.getString( "chart-time-control.go" ) : AimxcelCommonResources.getString( "Common.StopwatchPanel.stop" ) ); setIcon( new ImageIcon( TimeseriesResources.loadBufferedImage( goButton ? "icons/go.png" : "icons/stop.png" ) ) ); } private boolean isGoButton() { return goButton; } } }
[ "59469892+venkat-thota@users.noreply.github.com" ]
59469892+venkat-thota@users.noreply.github.com
fc2dd3d0b00b7586dcbac4808e6763fca789cc1c
6732796da80d70456091ec1c3cc1ee9748b97cc5
/yasjf4j/fastjson-over-yasjf4j/src/test/java/com/alibaba/json/test/performance/IntegerArrayEncodePerformanceTest.java
0a10c41fc237b36feb91761fdee6378c342df2b3
[ "Apache-2.0" ]
permissive
nharrand/argo
f88c13a1fb759f44fab6dbc6614de3c0c0554549
c09fccba668e222a1b349b95d34177b5964e78e1
refs/heads/main
2023-08-13T10:39:48.526694
2021-10-13T09:40:19
2021-10-13T09:40:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,443
java
package com.alibaba.json.test.performance; import java.text.NumberFormat; import java.util.ArrayList; import java.util.List; import junit.framework.TestCase; import com.alibaba.json.test.codec.Codec; import com.alibaba.json.test.codec.FastjsonCodec; import com.alibaba.json.test.codec.JacksonCodec; import org.junit.Ignore; @Ignore public class IntegerArrayEncodePerformanceTest extends TestCase { final int COUNT = 10; protected List<Codec> codecList = new ArrayList<Codec>(); protected void setUp() throws Exception { codecList.add(new JacksonCodec()); codecList.add(new FastjsonCodec()); } public void test_0() throws Exception { int len = 1000 * 1000; Integer[] array = new Integer[len]; for (int i = 0; i < len; ++i) { array[i] = i; } // Arrays.asList(array); for (Codec codec : codecList) { for (int i = 0; i < COUNT; ++i) { encode(array, codec); } } } private void encode(Object object, Codec decoder) throws Exception { long startNano = System.nanoTime(); for (int i = 0; i < COUNT; ++i) { decoder.encode(object); } long nano = System.nanoTime() - startNano; System.out.println(decoder.getName() + " : \t" + NumberFormat.getInstance().format(nano)); } }
[ "nicolas.harrand@gmail.com" ]
nicolas.harrand@gmail.com
03d075780784154556b9c58b9a387c63dca0052b
10c96edfa12e1a7eef1caf3ad1d0e2cdc413ca6f
/src/main/resources/projs/Collection_4.1_parent/src/main/java/org/apache/commons/collections4/functors/ExceptionFactory.java
6656b8da25da4df5422586e777dcc09f45fcf44a
[ "Apache-2.0" ]
permissive
Gu-Youngfeng/EfficiencyMiner
c17c574e41feac44cc0f483135d98291139cda5c
48fb567015088f6e48dfb964a4c63f2a316e45d4
refs/heads/master
2020-03-19T10:06:33.362993
2018-08-01T01:17:40
2018-08-01T01:17:40
136,343,802
0
0
Apache-2.0
2018-08-01T01:17:41
2018-06-06T14:51:55
Java
UTF-8
Java
false
false
2,259
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.commons.collections4.functors; import java.io.Serializable; import org.apache.commons.collections4.Factory; import org.apache.commons.collections4.FunctorException; /** * Factory implementation that always throws an exception. * * @since 3.0 * @version $Id: ExceptionFactory.java 1543950 2013-11-20 21:13:35Z tn $ */ public final class ExceptionFactory<T> implements Factory<T>, Serializable { /** Serial version UID */ private static final long serialVersionUID = 7179106032121985545L; /** Singleton predicate instance */ @SuppressWarnings("rawtypes") // the static instance works for all types public static final Factory INSTANCE = new ExceptionFactory<Object>(); /** * Factory returning the singleton instance. * * @param <T> the type the factory creates * @return the singleton instance * @since 3.1 */ @SuppressWarnings("unchecked") // the static instance works for all types public static <T> Factory<T> exceptionFactory() { return (Factory<T>) INSTANCE; } /** * Restricted constructor. */ private ExceptionFactory() { super(); } /** * Always throws an exception. * * @return never * @throws FunctorException always */ public T create() { throw new FunctorException("ExceptionFactory invoked"); } private Object readResolve() { return INSTANCE; } }
[ "yongfeng_gu@163.com" ]
yongfeng_gu@163.com
b53dafeb17308103df3df7359898458119b69b22
377e5e05fb9c6c8ed90ad9980565c00605f2542b
/bin/ext-integration/sap/synchronousOM/sapordermgmtbol/testsrc/de/hybris/platform/sap/sapordermgmtbol/transaction/salesdocument/backend/impl/erp/strategy/ItemTextMapperJCoRecTest.java
3ddf9c3f8107963f9e8cb8d3b3ee648ec56625df
[]
no_license
automaticinfotech/HybrisProject
c22b13db7863e1e80ccc29774f43e5c32e41e519
fc12e2890c569e45b97974d2f20a8cbe92b6d97f
refs/heads/master
2021-07-20T18:41:04.727081
2017-10-30T13:24:11
2017-10-30T13:24:11
108,957,448
0
0
null
null
null
null
UTF-8
Java
false
false
2,809
java
/* * [y] hybris Platform * * Copyright (c) 2000-2016 SAP SE or an SAP affiliate company. * All rights reserved. * * This software is the confidential and proprietary information of SAP * ("Confidential Information"). You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of the * license agreement you entered into with SAP. */ package de.hybris.platform.sap.sapordermgmtbol.transaction.salesdocument.backend.impl.erp.strategy; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import de.hybris.platform.sap.core.common.TechKey; import de.hybris.platform.sap.core.jco.mock.JCoMockRepository; import de.hybris.platform.sap.core.jco.rec.JCoRecException; import de.hybris.platform.sap.sapordermgmtbol.constants.SapordermgmtbolConstants; import de.hybris.platform.sap.sapordermgmtbol.order.businessobject.interf.Text; import de.hybris.platform.sap.sapordermgmtbol.transaction.item.businessobject.impl.ItemListImpl; import de.hybris.platform.sap.sapordermgmtbol.transaction.item.businessobject.interf.Item; import de.hybris.platform.sap.sapordermgmtbol.transaction.item.businessobject.interf.ItemList; import de.hybris.platform.sap.sapordermgmtbol.unittests.base.JCORecTestBase; import org.junit.Test; import com.sap.conn.jco.JCoTable; @SuppressWarnings("javadoc") public class ItemTextMapperJCoRecTest extends JCORecTestBase { public ItemTextMapper cutItems; @Override public void setUp() { super.setUp(); cutItems = (ItemTextMapper) genericFactory.getBean(SapordermgmtbolConstants.ALIAS_BEAN_ITEM_TEXT_MAPPER); cutItems.setConfigLangIso("D"); cutItems.setConfigTextId("0"); } @Test public void testRead() throws JCoRecException { final JCoMockRepository testRepository = getJCORepository("jcoErpWecModel2DMapperTextTest"); final JCoTable table = testRepository.getTable("ET_ITEM_TEXT_COMV"); final JCoTable ttObjInst = testRepository.getTable("TT_OBJINST"); final Item item[] = new Item[2]; final ItemList itemsList = new ItemListImpl(); for (int i = 0; i < item.length; i++) { item[i] = (Item) genericFactory.getBean(SapordermgmtbolConstants.ALIAS_BEAN_ITEM); item[i].setHandle("I" + i); item[i].setTechKey(new TechKey(item[i].getHandle())); final Text text = item[i].createText(); text.setHandle("T" + i); item[i].setText(text); itemsList.add(item[i]); } final ObjectInstances objInst = new ObjectInstances(ttObjInst); cutItems.read(table, objInst, itemsList); for (int i = 0; i < item.length; i++) { final String loc = "item " + i; final Text text = item[i].getText(); assertNotNull(loc, text); assertEquals(loc, "The Item " + i + " Text", text.getText()); assertEquals(loc, "T" + i, text.getHandle()); } } }
[ "santosh.kshirsagar@automaticinfotech.com" ]
santosh.kshirsagar@automaticinfotech.com
91b6b6139e907f508dab9cdce3bd25683c8d8da7
1c8cd2c826cd999908e8b4549dc263bd491f1b4c
/app/src/main/java/com/michaelfotiadis/demorecyclerview/ui/core/imagefetcher/ImageFetcher.java
59355c207facb09f71334b1e14fe73298a1fb3c2
[]
no_license
MikeFot/Android--Demo-RecyclerView
fff381c49252cc6f5a2dadea7dc1265483d90cc2
2a37c2fd6e9de85c2737cbf1ed2ea73b7b4e4f08
refs/heads/master
2020-05-29T14:40:28.310499
2016-05-31T10:17:49
2016-05-31T10:17:49
59,828,187
0
0
null
null
null
null
UTF-8
Java
false
false
249
java
package com.michaelfotiadis.demorecyclerview.ui.core.imagefetcher; import android.widget.ImageView; /** * */ public interface ImageFetcher { void loadIntoImageView(final String imagePath, final int placeholder, final ImageView imageView); }
[ "michaelfotiadis@gmail.com" ]
michaelfotiadis@gmail.com
ab43174cef7824e92be96bf02cb756459cce751f
5e3c1ab9af46dad0e224901957201b73eceb6aa8
/src/com/example/utils/Utils.java
b89fef0ae98920ac0e8a669938a2095accde43b9
[]
no_license
a1266143/MyYouKuPlayer
cbc8cdd6fa9863ec8c181ed828184294b3b690f6
24feefc7402d3d351f3575c05ff03cadd8d19dd5
refs/heads/master
2016-08-12T08:51:18.974226
2016-01-04T10:33:20
2016-01-04T10:33:20
48,686,016
0
0
null
null
null
null
UTF-8
Java
false
false
853
java
package com.example.utils; import android.app.Activity; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; public class Utils { private static final Utils utils = new Utils(); private Utils(){}; public static Utils getInstance(){ return utils; } @SuppressWarnings("deprecation") public void showQuitDialog(final Activity activity){ AlertDialog ad = new AlertDialog.Builder(activity).create(); ad.setMessage("确定退出吗?"); ad.setButton2("确定", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface arg0, int arg1) { activity.finish(); } }); ad.setButton("取消", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface arg0, int arg1) { return; } }); ad.show(); } }
[ "603820467@qq.com" ]
603820467@qq.com
2d904a58841f3f4779c181ce5ef5a0b0a7a42c7f
401c228cf3672c8754330711af7a7e5128f1cf19
/kie-wb-common-dmn/kie-wb-common-dmn-client/src/main/java/org/kie/workbench/common/dmn/client/editors/expressions/types/function/kindselector/KindPopoverImpl.java
6ba29205bd4c2d9552ba0935d36e7a113c324312
[ "Apache-2.0" ]
permissive
gitgabrio/kie-wb-common
f2fb145536a2c5bd60ddbaf1cb41dec5e93912ec
57ffa0afc6819d784e60bd675bbdee5d0660ad1b
refs/heads/master
2020-03-21T08:00:52.572728
2019-05-13T13:03:14
2019-05-13T13:03:14
138,314,007
0
0
Apache-2.0
2019-09-27T12:27:30
2018-06-22T14:46:16
Java
UTF-8
Java
false
false
2,094
java
/* * Copyright 2018 Red Hat, Inc. and/or its affiliates. * * 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.kie.workbench.common.dmn.client.editors.expressions.types.function.kindselector; import java.util.Optional; import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; import org.jboss.errai.common.client.dom.HTMLElement; import org.kie.workbench.common.dmn.api.definition.v1_1.FunctionDefinition; @ApplicationScoped public class KindPopoverImpl implements KindPopoverView.Presenter { private KindPopoverView view; private Optional<HasKindSelectControl> binding = Optional.empty(); public KindPopoverImpl() { //CDI proxy } @Inject public KindPopoverImpl(final KindPopoverView view) { this.view = view; view.init(this); view.setFunctionKinds(FunctionDefinition.Kind.values()); } @Override public void show(final Optional<String> editorTitle) { binding.ifPresent(b -> view.show(editorTitle)); } @Override public void hide() { binding.ifPresent(b -> view.hide()); } @Override public void bind(final HasKindSelectControl bound, final int uiRowIndex, final int uiColumnIndex) { binding = Optional.ofNullable(bound); } @Override public HTMLElement getElement() { return view.getElement(); } @Override public void onFunctionKindSelected(final FunctionDefinition.Kind kind) { binding.ifPresent(b -> { b.setFunctionKind(kind); view.hide(); }); } }
[ "manstis@users.noreply.github.com" ]
manstis@users.noreply.github.com
44f3ca86e1db45c159bad21229537f97d0b3eabd
000e9ddd9b77e93ccb8f1e38c1822951bba84fa9
/java/classes2/com/ziroom/commonlibrary/a/a.java
a371434e4736ea7b41997ef5eaf909107568a76c
[ "Apache-2.0" ]
permissive
Paladin1412/house
2bb7d591990c58bd7e8a9bf933481eb46901b3ed
b9e63db1a4975b614c422fed3b5b33ee57ea23fd
refs/heads/master
2021-09-17T03:37:48.576781
2018-06-27T12:39:38
2018-06-27T12:41:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,508
java
package com.ziroom.commonlibrary.a; import android.app.Activity; import android.content.Context; import android.os.Handler; public class a<T> extends com.freelxl.baselibrary.d.c.a<T> { protected Context b; public a(Context paramContext, com.freelxl.baselibrary.d.f.a<T> parama) { super(parama); this.b = paramContext; } public void dismissProgress() { if (this.b == null) {} while ((com.freelxl.baselibrary.widget.a.getDialog() == null) || (!com.freelxl.baselibrary.widget.a.isShowing())) { return; } com.freelxl.baselibrary.widget.a.dismiss(); } public void onFailure(Throwable paramThrowable) { dismissProgress(); } public void onStart() { super.onStart(); a.post(new Runnable() { public void run() { a.this.showProgress(); } }); } public void onSuccess(int paramInt, T paramT) { dismissProgress(); } public boolean showProgress() { if (this.b == null) { return false; } if ((com.freelxl.baselibrary.widget.a.getDialog() != null) && (com.freelxl.baselibrary.widget.a.isShowing()) && ((this.b instanceof Activity))) { com.freelxl.baselibrary.widget.a.dismiss(); } com.freelxl.baselibrary.widget.a.show(this.b, null, false, true); return true; } } /* Location: /Users/gaoht/Downloads/zirom/classes2-dex2jar.jar!/com/ziroom/commonlibrary/a/a.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "ght163988@autonavi.com" ]
ght163988@autonavi.com
f2e77a58ef65bc99edde52f98d9715aa0c2ef11e
9f5fcbf93a1772b4efd5b57bd4735921408b50ad
/runtime/testsrc/com/exedio/cope/pattern/DispatcherConfigTest.java
c247d77e938facb6c5ee26c243d074ed8c8dd2f1
[]
no_license
exedio/persistence
0a99c5f5c6c4bf52e2976fddf533ef3857be5319
1e122e105f3ed3837b09828315525c708e754b95
refs/heads/master
2023-08-18T01:09:07.221399
2023-08-15T10:32:32
2023-08-15T10:32:32
32,997,177
8
2
null
2022-12-08T13:10:29
2015-03-27T16:31:03
Java
UTF-8
Java
false
false
5,936
java
/* * Copyright (C) 2004-2015 exedio GmbH (www.exedio.com) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package com.exedio.cope.pattern; import static com.exedio.cope.tojunit.Assert.assertFails; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotSame; import static org.junit.jupiter.api.Assertions.assertSame; import com.exedio.cope.Condition; import com.exedio.cope.IntegerField; import com.exedio.cope.pattern.Dispatcher.Config; import org.junit.jupiter.api.Test; public class DispatcherConfigTest { @Test void testDefault() { final Config config = new Config(); assertEquals(5, config.getFailureLimit()); assertEquals(1000, config.getSearchSize()); assertEquals(15, config.getSessionLimit()); assertSame(TRUE, config.getNarrowCondition()); } @Test void testOk() { final Config config = new Config(3, 2); assertEquals(3, config.getFailureLimit()); assertEquals(2, config.getSearchSize()); assertEquals(15, config.getSessionLimit()); assertSame(TRUE, config.getNarrowCondition()); } @Test void testMinimal() { final Config config = new Config(1, 1); assertEquals(1, config.getFailureLimit()); assertEquals(1, config.getSearchSize()); assertEquals(15, config.getSessionLimit()); assertSame(TRUE, config.getNarrowCondition()); } @Test void testFailureLimitZero() { assertFails(() -> new Config(0, 0), IllegalArgumentException.class, "failureLimit must be greater zero, but was 0"); } @Test void testFailureLimitNegative() { assertFails(() -> new Config(-10, 0), IllegalArgumentException.class, "failureLimit must be greater zero, but was -10"); } @Test void testSearchSizeZero() { assertFails(() -> new Config(1000, 0), IllegalArgumentException.class, "searchSize must be greater zero, but was 0"); } @Test void testSearchSizeNegative() { assertFails(() -> new Config(1000, -10), IllegalArgumentException.class, "searchSize must be greater zero, but was -10"); } @Test void testSessionLimit() { final Config config0 = new Config(); assertEquals(5, config0.getFailureLimit()); assertEquals(1000, config0.getSearchSize()); assertEquals(15, config0.getSessionLimit()); assertSame(TRUE, config0.getNarrowCondition()); final Config config1 = config0.sessionLimit(88); assertEquals(5, config1.getFailureLimit()); assertEquals(1000, config1.getSearchSize()); assertEquals(88, config1.getSessionLimit()); assertSame(TRUE, config1.getNarrowCondition()); } @Test void testSessionLimitZero() { final Config config = new Config(); assertFails(() -> config.sessionLimit(0), IllegalArgumentException.class, "sessionLimit must be greater zero, but was 0"); } @Test void testSessionLimitNegative() { final Config config = new Config(); assertFails(() -> config.sessionLimit(-10), IllegalArgumentException.class, "sessionLimit must be greater zero, but was -10"); } @Test void testNarrow() { final Config config0 = new Config(55, 66); assertEquals(55, config0.getFailureLimit()); assertEquals(66, config0.getSearchSize()); assertEquals(15, config0.getSessionLimit()); assertSame(TRUE, config0.getNarrowCondition()); final IntegerField f = new IntegerField(); final Condition condition1 = f.equal(1); final Config config1 = config0.narrow(condition1); assertNotSame(config0, config1); assertEquals(55, config1.getFailureLimit()); assertEquals(66, config1.getSearchSize()); assertEquals(15, config1.getSessionLimit()); assertSame(condition1, config1.getNarrowCondition()); assertEquals(f+"='1'", config1.getNarrowCondition().toString()); final Condition condition2 = f.equal(2); final Config config2 = config1.narrow(condition2); assertNotSame(config1, config2); assertEquals(55, config2.getFailureLimit()); assertEquals(66, config2.getSearchSize()); assertEquals(15, config2.getSessionLimit()); assertEquals(condition1.and(condition2), config2.getNarrowCondition()); assertEquals("("+f+"='1' and "+f+"='2')", config2.getNarrowCondition().toString()); } @Test void testNarrowReset() { final Config config0 = new Config(55, 66); assertEquals(55, config0.getFailureLimit()); assertEquals(66, config0.getSearchSize()); assertEquals(15, config0.getSessionLimit()); assertSame(TRUE, config0.getNarrowCondition()); final Condition condition = new IntegerField().equal(1); final Config config1 = config0.narrow(condition); assertNotSame(config0, config1); assertEquals(55, config1.getFailureLimit()); assertEquals(66, config1.getSearchSize()); assertEquals(15, config1.getSessionLimit()); assertSame(condition, config1.getNarrowCondition()); final Config configR = config1.resetNarrow(); assertNotSame(config1, configR); assertNotSame(config0, configR); assertEquals(55, configR.getFailureLimit()); assertEquals(66, configR.getSearchSize()); assertEquals(15, configR.getSessionLimit()); assertSame(TRUE, configR.getNarrowCondition()); } @Test void testNarrowNull() { final Config c = new Config(); assertFails(() -> c.narrow(null), NullPointerException.class, "other"); } private static final Condition TRUE = Condition.ofTrue(); }
[ "ralf.wiebicke@exedio.com" ]
ralf.wiebicke@exedio.com
61aa20ae3be4e16f4e05eed17977ba44846c9843
355900d41b86b5f164d910312c9e47349c731193
/src/main/java/pixelitor/filters/jhlabsproxies/JHKaleidoscope.java
bec2a7249ddca8d4969c6f6e1e23dececd70e057
[]
no_license
ws-os/Pixelitor
49df73650bee04af3a640ccc9588ed72a1d393c8
fcbc7603491c87ab92f397e87a5a1141655f2418
refs/heads/master
2021-06-16T11:38:58.639857
2017-04-18T17:16:11
2017-04-20T10:00:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,992
java
/* * Copyright 2017 Laszlo Balazs-Csiki * * This file is part of Pixelitor. Pixelitor is free software: you * can redistribute it and/or modify it under the terms of the GNU * General Public License, version 3 as published by the Free * Software Foundation. * * Pixelitor 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 Pixelitor. If not, see <http://www.gnu.org/licenses/>. */ package pixelitor.filters.jhlabsproxies; import com.jhlabs.image.KaleidoscopeFilter; import pixelitor.filters.FilterWithParametrizedGUI; import pixelitor.filters.gui.AngleParam; import pixelitor.filters.gui.ImagePositionParam; import pixelitor.filters.gui.IntChoiceParam; import pixelitor.filters.gui.ParamSet; import pixelitor.filters.gui.RangeParam; import pixelitor.filters.gui.ShowOriginal; import java.awt.image.BufferedImage; /** * A kaleidoscope based on the JHLabs KaleidoscopeFilter */ public class JHKaleidoscope extends FilterWithParametrizedGUI { public static final String NAME = "Kaleidoscope"; private final AngleParam angle = new AngleParam("Angle", 0); private final AngleParam rotateResult = new AngleParam("Rotate Result", 0); private final ImagePositionParam center = new ImagePositionParam("Center"); private final RangeParam sides = new RangeParam("Sides", 0, 3, 10); // private final RangeParam radius = new RangeParam("Radius", 0, 999, 0); private final RangeParam zoom = new RangeParam("Zoom (%)", 1, 100, 500); private final IntChoiceParam edgeAction = IntChoiceParam.forEdgeAction(true); private final IntChoiceParam interpolation = IntChoiceParam.forInterpolation(); private KaleidoscopeFilter filter; public JHKaleidoscope() { super(ShowOriginal.YES); setParamSet(new ParamSet( center, angle, sides, // radius, zoom, rotateResult, edgeAction, interpolation )); } @Override public BufferedImage doTransform(BufferedImage src, BufferedImage dest) { if (filter == null) { filter = new KaleidoscopeFilter(NAME); } filter.setAngle((float) angle.getValueInRadians()); filter.setAngle2((float) rotateResult.getValueInRadians()); filter.setCentreX(center.getRelativeX()); filter.setCentreY(center.getRelativeY()); // filter.setRadius(radius.getValue()); filter.setSides(sides.getValue()); filter.setEdgeAction(edgeAction.getValue()); filter.setInterpolation(interpolation.getValue()); filter.setZoom(zoom.getValueAsPercentage()); dest = filter.filter(src, dest); return dest; } }
[ "lbalazscs@users.noreply.github.com" ]
lbalazscs@users.noreply.github.com
fa18feda645778e02c70858555895208936000ca
4cc268d636124368cb0314e8fb2342e35fbbdf75
/java-algo/src/note/Method.java
73cf8a73f6ba4eafc23b9c48ec83ed637d695eef
[]
no_license
gaechan111187/java-algo
af5b39d185322de7c4643a05c813772fb254dc53
9e4716a779cde1c94c30806ff07e5b3458c70ad7
refs/heads/master
2021-01-13T01:28:30.021086
2015-10-08T08:43:50
2015-10-08T08:43:50
42,429,218
0
0
null
null
null
null
UTF-8
Java
false
false
582
java
package note; /** * @file_name : Method.java * @author : chanhok61@daum.net * @date : 2015. 9. 15. * @story : 메소드 */ public class Method { /** * 자바에서 메소드는 엑셀에서 함수와 같은 기능을 한다. * 하지만 차이점은 함수는 상위개념이 없고, * 자바는 메소드 상위에 클래스가 존재한다는 점이 * 다르다. */ void main() { /** * 메소드를 구성하는 필요요소 총 4가지 이다. * 리턴타입 + 식별자 + (파라미터) + 메소드블록 */ } }
[ "user@user-PC" ]
user@user-PC
e84b272924411235996948e4433e3bb5d61e6a72
ac9abcb25dfeb41df2dffb4608d0d69795526d1a
/src/com/toolbox/cms/manager/assist/CmsVoteReplyMng.java
78242949a52c4cedeb9944647f6ec976f22475a5
[]
no_license
nextflower/toolbox
d7716f1a1b838b217aba08c76eac91005f56092a
d002c6db442fb1078ae5356fe577d4ec63309b19
refs/heads/master
2016-09-05T13:04:34.875755
2015-05-12T10:47:40
2015-05-12T10:47:40
35,481,909
1
0
null
null
null
null
UTF-8
Java
false
false
487
java
package com.toolbox.cms.manager.assist; import com.toolbox.cms.entity.assist.CmsVoteReply; import com.toolbox.common.page.Pagination; public interface CmsVoteReplyMng { public Pagination getPage(Integer subTopicId, int pageNo, int pageSize); public CmsVoteReply findById(Integer id); public CmsVoteReply save(CmsVoteReply bean); public CmsVoteReply update(CmsVoteReply bean); public CmsVoteReply deleteById(Integer id); public CmsVoteReply[] deleteByIds(Integer[] ids); }
[ "dv3333@163.com" ]
dv3333@163.com
6b0b68136c470fe3d8114cf58e28ac56b28a9306
9fd51b70f80f9ab4483d63d5abc705516fe26c1e
/sandbox/wsat/src/test/java/com/kylin/jaxws/wsat/Client.java
b00fb32509e07e8ad7911b3a3b0a0e4b9219fdad
[]
no_license
kylinsoong/jaxws
5e28b5bbdcab8a15a3862b615571cf9eae19a21b
0a6144b6fcc7713f009a9fab00178914f20afa56
refs/heads/master
2021-01-22T14:02:07.682167
2014-09-16T07:41:32
2014-09-16T07:41:32
5,725,884
0
1
null
null
null
null
UTF-8
Java
false
false
2,169
java
package com.kylin.jaxws.wsat; import com.arjuna.mw.wst11.client.JaxWSHeaderContextProcessor; import com.kylin.jaxws.wsat.RestaurantException; import com.kylin.jaxws.wsat.ws.RestaurantServiceAT; import javax.xml.namespace.QName; import javax.xml.ws.BindingProvider; import javax.xml.ws.Service; import javax.xml.ws.handler.Handler; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.List; /** * A Client stub to the restaurant service. * */ @ClientStub public class Client implements RestaurantServiceAT { private RestaurantServiceAT restaurant; /** * Default constructor with hard-coded values for the RestaurantServiceAT endpoint details (wsdl url, service name & port * name) * * @throws MalformedURLException if the WSDL url is malformed. */ public Client() throws MalformedURLException { URL wsdlLocation = new URL("http://localhost:8080/wsat-simple/RestaurantServiceAT?wsdl"); QName serviceName = new QName("https://github.com/kylinsoong/jaxws", "RestaurantServiceATService"); QName portName = new QName("https://github.com/kylinsoong/jaxws", "RestaurantServiceAT"); Service service = Service.create(wsdlLocation, serviceName); restaurant = service.getPort(portName, RestaurantServiceAT.class); /* * Add client handler chain */ BindingProvider bindingProvider = (BindingProvider) restaurant; List<Handler> handlers = new ArrayList<Handler>(1); handlers.add(new JaxWSHeaderContextProcessor()); bindingProvider.getBinding().setHandlerChain(handlers); } /** * Create a new booking */ @Override public void makeBooking() throws RestaurantException { restaurant.makeBooking(); } /** * obtain the number of existing bookings * * @return the number of current bookings */ @Override public int getBookingCount() { return restaurant.getBookingCount(); } /** * Reset the booking count to zero */ @Override public void reset() { restaurant.reset(); } }
[ "songzhiqi_1214@yahoo.com.cn" ]
songzhiqi_1214@yahoo.com.cn
e295c5b0b3b2e739910034bb7dc2c6ae8c01c24c
24c7837b72da7c5b17af84e2e590832729ef753d
/lesson-demo/src/main/java/com/github/dalianghe/entity/VacationEntity.java
4107047846c93ebd7c59dc7fbdcfcb0c87eb15ea
[]
no_license
dalianghe/activiti-learn
e33aaeedec6005e197ee5d31bd0c3958d013d0a5
79f144c32ad7cc97a0dfe7703d744d70753b81ba
refs/heads/master
2020-03-23T00:19:40.599400
2018-08-09T13:48:41
2018-08-09T13:48:51
140,856,565
0
0
null
null
null
null
UTF-8
Java
false
false
1,186
java
package com.github.dalianghe.entity; import java.io.Serializable; import java.util.Date; public class VacationEntity implements Serializable{ private Integer id; private Date startDate; private Date endDate; private Integer days; private Integer vacationType; private String reason; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public Date getStartDate() { return startDate; } public void setStartDate(Date startDate) { this.startDate = startDate; } public Date getEndDate() { return endDate; } public void setEndDate(Date endDate) { this.endDate = endDate; } public Integer getDays() { return days; } public void setDays(Integer days) { this.days = days; } public Integer getVacationType() { return vacationType; } public void setVacationType(Integer vacationType) { this.vacationType = vacationType; } public String getReason() { return reason; } public void setReason(String reason) { this.reason = reason; } }
[ "276420284@qq.com" ]
276420284@qq.com
fd56876f7f7f3fb56664a40da2bdbbf032b466bc
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/16/16_147aa19c56388091972d002e4eafd79b8908eaf3/RepositoryOfflineAction/16_147aa19c56388091972d002e4eafd79b8908eaf3_RepositoryOfflineAction_s.java
8dac0611b7bc8773d3e244bb270ded32721baafc
[]
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
2,477
java
/******************************************************************************* * Copyright (c) 2004 - 2006 Mylar committers and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html *******************************************************************************/ package org.eclipse.mylyn.internal.tasks.ui.views; import org.eclipse.jface.action.Action; import org.eclipse.jface.action.IAction; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; import org.eclipse.mylyn.tasks.core.TaskRepository; import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; /** * @author Steffen Pingel */ public class RepositoryOfflineAction extends Action implements ISelectionChangedListener { private static final String ID = "org.eclipse.mylyn.tasklist.repositories.offline"; private TaskRepository repository; public RepositoryOfflineAction() { super("Offline", Action.AS_CHECK_BOX); setId(ID); setEnabled(false); } @Override public void run() { repository.setOffline(isChecked()); TasksUiPlugin.getRepositoryManager().notifyRepositorySettingsChagned(repository); TasksUiPlugin.getRepositoryManager().saveRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath()); } public void selectionChanged(IAction action, ISelection selection) { } public void selectionChanged(SelectionChangedEvent event) { ISelection selection = event.getSelection(); if (selection instanceof IStructuredSelection) { Object selectedObject = ((IStructuredSelection)selection).getFirstElement(); if (selectedObject instanceof TaskRepository) { AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector( ((TaskRepository) selectedObject).getConnectorKind()); if (connector.isUserManaged()) { this.repository = (TaskRepository) selectedObject; setChecked(this.repository.isOffline()); setEnabled(true); return; } } } this.repository = null; setChecked(false); setEnabled(false); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
bfbf0db3efac4c371c9e77f21853f21c9b4e6f00
851661eca03de234183e55fcece100131392e6dc
/lbs/src/main/java/com/kk/geo/baidu/model/element/Point.java
26bb18a77e1f185681d4b499830c3176cf897357
[]
no_license
kongzhidea/lbs
4ef615aef07de8ec00c1b464f4aa8818bddc4be3
ff456287c3259c0b05521df68d46cd5cc63a12f9
refs/heads/master
2021-04-15T15:16:17.279797
2016-07-11T05:53:29
2016-07-11T05:53:29
63,035,789
0
0
null
null
null
null
UTF-8
Java
false
false
523
java
package com.kk.geo.baidu.model.element; /** * 百度经纬度坐标值 */ public class Point { private double x; private double y; public double getX() { return x; } public void setX(double x) { this.x = x; } public double getY() { return y; } public void setY(double y) { this.y = y; } @Override public String toString() { return "Point{" + "x=" + x + ", y=" + y + '}'; } }
[ "563150913@qq.com" ]
563150913@qq.com
5e8bc95a1dd0d3c4cfe466bfc2a1f9a688fb3c2c
18d73e7b9b93a45054a68c96a2400562fd1480a5
/app/src/main/java/com/season/algorithm/algorithm/Algorithm002.java
8185ff5f7195d34a75893cf220f4ec4018c55469
[]
no_license
Seasonallan/Algorithm
76956d026016ba39285a06ea5ceb790cd763b668
84603003e0f5780aad26d426d2ee8341f20d880f
refs/heads/master
2023-01-21T14:16:46.843436
2023-01-15T04:25:29
2023-01-15T04:25:29
276,288,124
0
0
null
null
null
null
UTF-8
Java
false
false
1,150
java
package com.season.algorithm.algorithm; import com.season.algorithm.AlgorithmOther; public class Algorithm002 extends AlgorithmOther { @Override public String getName() { return "002-替换空格"; } @Override public String getDesc() { return "请实现一个函数,将一个字符串中的每个空格替换成“%20”。" + "例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy。"; } String input = "We Are Happy"; @Override public String prepare() { return input; } @Override public void execute() { res = input.replaceAll(" ", "%20"); res = replaceSpace(input); } String res; @Override public String verify() { return res; } public String replaceSpace(String str) { StringBuilder sb = new StringBuilder(); for(int i = 0; i < str.length(); i++) { if(str.charAt(i) == ' ') { sb.append("%20"); } else { sb.append(str.charAt(i)); } } return sb.toString(); } }
[ "451360508@qq.com" ]
451360508@qq.com
ebc76ff294ce828bbfa9b2588d52ab46017befc4
73267be654cd1fd76cf2cb9ea3a75630d9f58a41
/services/iotedge/src/main/java/com/huaweicloud/sdk/iotedge/v2/model/BatchListDcPointsRequest.java
dd7c8ea3be023e075868dac3cb9746d38963516c
[ "Apache-2.0" ]
permissive
huaweicloud/huaweicloud-sdk-java-v3
51b32a451fac321a0affe2176663fed8a9cd8042
2f8543d0d037b35c2664298ba39a89cc9d8ed9a3
refs/heads/master
2023-08-29T06:50:15.642693
2023-08-24T08:34:48
2023-08-24T08:34:48
262,207,545
91
57
NOASSERTION
2023-09-08T12:24:55
2020-05-08T02:27:00
Java
UTF-8
Java
false
false
6,296
java
package com.huaweicloud.sdk.iotedge.v2.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Objects; /** * Request Object */ public class BatchListDcPointsRequest { @JsonInclude(JsonInclude.Include.NON_NULL) @JsonProperty(value = "edge_node_id") private String edgeNodeId; @JsonInclude(JsonInclude.Include.NON_NULL) @JsonProperty(value = "ds_id") private String dsId; @JsonInclude(JsonInclude.Include.NON_NULL) @JsonProperty(value = "point_id") private String pointId; @JsonInclude(JsonInclude.Include.NON_NULL) @JsonProperty(value = "name") private String name; @JsonInclude(JsonInclude.Include.NON_NULL) @JsonProperty(value = "property") private String property; @JsonInclude(JsonInclude.Include.NON_NULL) @JsonProperty(value = "device_id") private String deviceId; @JsonInclude(JsonInclude.Include.NON_NULL) @JsonProperty(value = "offset") private Integer offset; @JsonInclude(JsonInclude.Include.NON_NULL) @JsonProperty(value = "limit") private Integer limit; public BatchListDcPointsRequest withEdgeNodeId(String edgeNodeId) { this.edgeNodeId = edgeNodeId; return this; } /** * 边缘节点ID * @return edgeNodeId */ public String getEdgeNodeId() { return edgeNodeId; } public void setEdgeNodeId(String edgeNodeId) { this.edgeNodeId = edgeNodeId; } public BatchListDcPointsRequest withDsId(String dsId) { this.dsId = dsId; return this; } /** * 采集数据源id,创建数据源配置时设置,节点下唯一。 * @return dsId */ public String getDsId() { return dsId; } public void setDsId(String dsId) { this.dsId = dsId; } public BatchListDcPointsRequest withPointId(String pointId) { this.pointId = pointId; return this; } /** * 采集点位表id,创建点位表时设置,数据源下唯一。 * @return pointId */ public String getPointId() { return pointId; } public void setPointId(String pointId) { this.pointId = pointId; } public BatchListDcPointsRequest withName(String name) { this.name = name; return this; } /** * 点位名称,允许中、数字、英文大小写、下划线、中划线、#%()*特殊字符.模糊查询 * @return name */ public String getName() { return name; } public void setName(String name) { this.name = name; } public BatchListDcPointsRequest withProperty(String property) { this.property = property; return this; } /** * 属性,允许中、数字、英文大小写、下划线、中划线,精确查询 * @return property */ public String getProperty() { return property; } public void setProperty(String property) { this.property = property; } public BatchListDcPointsRequest withDeviceId(String deviceId) { this.deviceId = deviceId; return this; } /** * 设备标识,精确查询 * @return deviceId */ public String getDeviceId() { return deviceId; } public void setDeviceId(String deviceId) { this.deviceId = deviceId; } public BatchListDcPointsRequest withOffset(Integer offset) { this.offset = offset; return this; } /** * 查询的起始位置,取值范围为非负整数,默认为0 * minimum: 0 * maximum: 1000000 * @return offset */ public Integer getOffset() { return offset; } public void setOffset(Integer offset) { this.offset = offset; } public BatchListDcPointsRequest withLimit(Integer limit) { this.limit = limit; return this; } /** * 每页记录数,默认值为10,取值区间为1-1000 * minimum: 0 * maximum: 1000000 * @return limit */ public Integer getLimit() { return limit; } public void setLimit(Integer limit) { this.limit = limit; } @Override public boolean equals(java.lang.Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } BatchListDcPointsRequest that = (BatchListDcPointsRequest) obj; return Objects.equals(this.edgeNodeId, that.edgeNodeId) && Objects.equals(this.dsId, that.dsId) && Objects.equals(this.pointId, that.pointId) && Objects.equals(this.name, that.name) && Objects.equals(this.property, that.property) && Objects.equals(this.deviceId, that.deviceId) && Objects.equals(this.offset, that.offset) && Objects.equals(this.limit, that.limit); } @Override public int hashCode() { return Objects.hash(edgeNodeId, dsId, pointId, name, property, deviceId, offset, limit); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class BatchListDcPointsRequest {\n"); sb.append(" edgeNodeId: ").append(toIndentedString(edgeNodeId)).append("\n"); sb.append(" dsId: ").append(toIndentedString(dsId)).append("\n"); sb.append(" pointId: ").append(toIndentedString(pointId)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" property: ").append(toIndentedString(property)).append("\n"); sb.append(" deviceId: ").append(toIndentedString(deviceId)).append("\n"); sb.append(" offset: ").append(toIndentedString(offset)).append("\n"); sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
[ "hwcloudsdk@huawei.com" ]
hwcloudsdk@huawei.com
061fd0556b60d896eaab391b494d94cf9850636d
ec33e7941c00b49eca4033603e5a0b008b949163
/Chap13_Collections/PriorityQueueDemo.java
0f306f8ce0bb442e00e4c1a73b13ba3e45e98cb9
[]
no_license
surani-hub/java_durga
5c5a505225fdc1636b1e40f4d897cdcaca595677
c2f027563ae4823de8f69b529fa75f3249b2852a
refs/heads/master
2023-08-13T01:21:30.650767
2021-09-13T08:52:47
2021-09-13T08:52:47
405,895,279
0
0
null
null
null
null
UTF-8
Java
false
false
828
java
import java.util.PriorityQueue; import java.util.Comparator; public class PriorityQueueDemo{ public static void main(String[] args){ PriorityQueue pq = new PriorityQueue(new MyComparator()); System.out.println(pq.peek()); System.out.println(pq.poll()); //pq.offer(null); //System.out.println(pq.element()); //System.out.println(pq.remove()); pq.add("a"); pq.add("b"); pq.add("c"); pq.add("d"); pq.add("e"); pq.add("f"); pq.add("g"); pq.add("h"); System.out.println(pq); System.out.println(pq.peek()); System.out.println(pq); System.out.println(pq.poll()); System.out.println(pq); } } class MyComparator implements Comparator{ public int compare(Object obj1, Object obj2){ String s1 = obj1.toString(); String s2 = obj2.toString(); return s2.compareTo(s1); } }
[ "skmali1357@gmail.com" ]
skmali1357@gmail.com
e604b10b2419b171d824b109d1404070baf0d54b
97d3938eee8036d0c923573d8bbbc764651cec48
/src/com/alee/examples/groups/futurico/FuturicoTextAreaExample.java
c8afe3e1fdc82380b7201229da25d2f73356465e
[]
no_license
HaDinhViet/weblaf
31a0e123bb4e35c80d3d4eb3e6acdb6b1ee6d654
90df46b13e4dbf2ea4a3d586972d699f4c4bc83e
refs/heads/master
2020-12-25T04:55:27.093658
2014-06-09T07:28:00
2014-06-09T07:28:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,973
java
/* * This file is part of WebLookAndFeel library. * * WebLookAndFeel library 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. * * WebLookAndFeel library 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 WebLookAndFeel library. If not, see <http://www.gnu.org/licenses/>. */ package com.alee.examples.groups.futurico; import com.alee.examples.WebLookAndFeelDemo; import com.alee.examples.content.DefaultExample; import com.alee.examples.content.FeatureState; import com.alee.laf.text.WebTextArea; import com.alee.utils.XmlUtils; import java.awt.*; /** * User: mgarin Date: 14.03.12 Time: 14:48 */ public class FuturicoTextAreaExample extends DefaultExample { @Override public String getTitle () { return "Futurico text area"; } @Override public String getDescription () { return "Futurico-styled text area"; } @Override public FeatureState getFeatureState () { return FeatureState.beta; } @Override public boolean isFillWidth () { return true; } @Override public Component getPreview ( WebLookAndFeelDemo owner ) { // Text area styled with nine-patch state painter WebTextArea textArea = new WebTextArea (); textArea.setRows ( 2 ); textArea.setText ( "Multiline\nStyled\nTextarea" ); textArea.setPainter ( XmlUtils.loadNinePatchStatePainter ( getResource ( "area.xml" ) ) ); textArea.setForeground ( Color.WHITE ); return textArea; } }
[ "mgarin@alee.com" ]
mgarin@alee.com
2564c617f7bb503e3ee1aa21dcf704db2483e8fb
1b8a226a3f15c3459f819ebe752d6165e1522a93
/Certificacao Java/Certificacao java 11/1 - basic/src/Testes/HasTail.java
11685acd992c774bed1c4b21b086c006faf5ef6e
[]
no_license
alexandreximenes/java
832d4e708dd3122c1fbf0ab9e4007f2f8c38d509
5cef77703bda6a5106734abc32093c0abb29bd5b
refs/heads/master
2022-12-23T21:48:56.717760
2021-04-14T05:19:36
2021-04-14T05:19:36
128,485,600
1
0
null
2022-12-16T04:26:13
2018-04-07T01:16:29
JavaScript
UTF-8
Java
false
false
372
java
package Testes; interface HasTail { int getTailLength(); } abstract class Puma implements HasTail { protected int getTailLength() { return 4; } } public class Cougar implements HasTail { public static void main(String[] args) { var puma = new Puma(); System.out.println(puma.getTailLength()); } public int getTailLength(int length) { return 2; } }
[ "xyymenes@gmail.com" ]
xyymenes@gmail.com
25829c5b4991a774763930d8c346066d2863dff6
fc286da6f87c15618f67012fbfb34f00fc38df25
/src/main/java/io/fabulos/application/config/CacheConfiguration.java
be85710ed36493d0899aeba3b14bdb86c6824ca7
[]
no_license
AndrewRotary/FabulosSix
03cc6c8a5ef395aab469ffc907d54e782cb5e8b8
d6b2a89fdb90c5fdad9c0c43f199061fdb82fab7
refs/heads/master
2021-07-17T18:43:59.411225
2017-10-24T16:49:07
2017-10-24T16:49:07
108,156,336
0
0
null
null
null
null
UTF-8
Java
false
false
2,317
java
package io.fabulos.application.config; import io.github.jhipster.config.JHipsterProperties; import org.ehcache.config.builders.CacheConfigurationBuilder; import org.ehcache.config.builders.ResourcePoolsBuilder; import org.ehcache.expiry.Duration; import org.ehcache.expiry.Expirations; import org.ehcache.jsr107.Eh107Configuration; import java.util.concurrent.TimeUnit; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.cache.JCacheManagerCustomizer; import org.springframework.cache.annotation.EnableCaching; import org.springframework.cloud.client.ServiceInstance; import org.springframework.cloud.client.discovery.DiscoveryClient; import org.springframework.cloud.client.serviceregistry.Registration; import org.springframework.context.annotation.*; @Configuration @EnableCaching @AutoConfigureAfter(value = { MetricsConfiguration.class }) @AutoConfigureBefore(value = { WebConfigurer.class, DatabaseConfiguration.class }) public class CacheConfiguration { private final javax.cache.configuration.Configuration<Object, Object> jcacheConfiguration; public CacheConfiguration(JHipsterProperties jHipsterProperties) { JHipsterProperties.Cache.Ehcache ehcache = jHipsterProperties.getCache().getEhcache(); jcacheConfiguration = Eh107Configuration.fromEhcacheCacheConfiguration( CacheConfigurationBuilder.newCacheConfigurationBuilder(Object.class, Object.class, ResourcePoolsBuilder.heap(ehcache.getMaxEntries())) .withExpiry(Expirations.timeToLiveExpiration(Duration.of(ehcache.getTimeToLiveSeconds(), TimeUnit.SECONDS))) .build()); } @Bean public JCacheManagerCustomizer cacheManagerCustomizer() { return cm -> { cm.createCache("users", jcacheConfiguration); cm.createCache(io.fabulos.application.domain.User.class.getName(), jcacheConfiguration); cm.createCache(io.fabulos.application.domain.Authority.class.getName(), jcacheConfiguration); cm.createCache(io.fabulos.application.domain.User.class.getName() + ".authorities", jcacheConfiguration); // jhipster-needle-ehcache-add-entry }; } }
[ "jhipster-bot@users.noreply.github.com" ]
jhipster-bot@users.noreply.github.com
170805edbc63063311b2830a6905596b083157e3
1d98bc887b16936c49a2b3517aaa8194594042d1
/pvmanager/pvmanager-integration/src/main/java/org/diirt/datasource/integration/OutageTestPhase.java
35578a8d5d4412fca8dfba191167d7a6900d9532
[ "MIT" ]
permissive
richardfearn/diirt
b4b15df50505bff3cf302441c605e9227829c847
eff3d3a090f24951bc602747edbc3b9f39449842
refs/heads/master
2021-01-23T23:04:12.585007
2014-11-30T21:16:19
2014-11-30T21:16:19
27,381,540
0
0
null
null
null
null
UTF-8
Java
false
false
916
java
/** * Copyright (C) 2010-14 diirt developers. See COPYRIGHT.TXT * All rights reserved. Use is subject to license terms. See LICENSE.TXT */ package org.diirt.datasource.integration; import org.diirt.datasource.PVManager; import org.diirt.datasource.ca.JCADataSourceBuilder; /** * Tests reconnects caused by a network outage. * * @author carcassi */ public class OutageTestPhase extends DisconnectTestPhase { @Override public void disconnectCycle() { // Pause network pauseNetwork(35); } public static void main(String[] args) { PVManager.setDefaultDataSource(new JCADataSourceBuilder().dbePropertySupported(true).build()); //LogManager.getLogManager().readConfiguration(new FileInputStream(new File("logging.properties"))); TestPhase phase1 = new OutageTestPhase(); phase1.execute(); PVManager.getDefaultDataSource().close(); } }
[ "gabriele.carcassi@gmail.com" ]
gabriele.carcassi@gmail.com
56c5cf2e1013909130c5aed9b54a9225e6fb3a21
98306ed90cd04d18c9474f31d82e4c0d762b885b
/12-Activities/LunchList/src/apt/tutorial/Restaurant.java
bac79bef410d9238c6b3d174e05f6153e6baa091
[ "Apache-2.0" ]
permissive
bhkang/cw-andtutorials
dc985df711a114ae623ca5cc6261060e75197986
476d407ef0c71e1b27b4e4b1fb5140858241bbea
refs/heads/master
2021-01-17T23:07:10.070570
2010-06-11T11:20:07
2010-06-11T11:20:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,937
java
package apt.tutorial; import android.content.ContentValues; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; public class Restaurant { private String name=""; private String address=""; private String type=""; private String notes=""; static Cursor getAll(SQLiteDatabase db) { return(db.rawQuery("SELECT * FROM restaurants ORDER BY name", null)); } static Restaurant getById(String id, SQLiteDatabase db) { String[] args={id}; Cursor c=db.rawQuery("SELECT * FROM restaurants WHERE _id=?", args); c.moveToFirst(); Restaurant result=new Restaurant().loadFrom(c); c.close(); return(result); } Restaurant loadFrom(Cursor c) { name=c.getString(c.getColumnIndex("name")); address=c.getString(c.getColumnIndex("address")); type=c.getString(c.getColumnIndex("type")); notes=c.getString(c.getColumnIndex("notes")); return(this); } public String getName() { return(name); } public void setName(String name) { this.name=name; } public String getAddress() { return(address); } public void setAddress(String address) { this.address=address; } public String getType() { return(type); } public void setType(String type) { this.type=type; } public String getNotes() { return(notes); } public void setNotes(String notes) { this.notes=notes; } public String toString() { return(getName()); } void save(SQLiteDatabase db) { ContentValues cv=new ContentValues(); cv.put("name", name); cv.put("address", address); cv.put("type", type); cv.put("notes", notes); db.insert("restaurants", "name", cv); } void update(String id, SQLiteDatabase db) { ContentValues cv=new ContentValues(); String[] args={id}; cv.put("name", name); cv.put("address", address); cv.put("type", type); cv.put("notes", notes); db.update("restaurants", cv, "_id=?", args); } }
[ "mmurphy@commonsware.com" ]
mmurphy@commonsware.com
d117e7a87f6ccee01ef356879afa7de4cc8599f1
b280a34244a58fddd7e76bddb13bc25c83215010
/scmv6/center-mail-client/src/main/java/com/smate/center/mail/client/exception/MailSendException.java
38a8f042856b0a04735b94db516bd453474f9a28
[]
no_license
hzr958/myProjects
910d7b7473c33ef2754d79e67ced0245e987f522
d2e8f61b7b99a92ffe19209fcda3c2db37315422
refs/heads/master
2022-12-24T16:43:21.527071
2019-08-16T01:46:18
2019-08-16T01:46:18
202,512,072
2
3
null
2022-12-16T05:31:05
2019-08-15T09:21:04
Java
UTF-8
Java
false
false
601
java
package com.smate.center.mail.client.exception; /** * 邮件发送异常 * * @author tsz * */ public class MailSendException extends MailClientException { /** * */ private static final long serialVersionUID = -7570297986830829086L; private static final String msg = "邮件发送异常->"; public MailSendException() { super(msg); } public MailSendException(String arg0) { super(msg + arg0); } public MailSendException(Throwable arg1) { super(msg, arg1); } public MailSendException(String arg0, Throwable arg1) { super(msg + arg0, arg1); } }
[ "zhiranhe@irissz.com" ]
zhiranhe@irissz.com
d916242daa251c50671b3aa914099cba827722a4
024446c5014a9a029eecd293a384ce2b21bdd821
/module-wechat/src/main/java/com/minlia/module/wechat/mp/endpoint/WechatMpEndpoint.java
7271fcc067fb336648f21ce2ca353772e1f3d2ff
[]
no_license
future1314/minlia-modules
7b692c0ccbd90abbb0a253260a9395aae70cc8cd
46f08a3f12d61c9fb58882743fc26900b43d3c33
refs/heads/master
2020-04-23T07:38:58.899195
2019-01-20T14:25:24
2019-01-20T14:25:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,333
java
package com.minlia.module.wechat.mp.endpoint; import com.google.gson.Gson; import com.minlia.cloud.body.Response; import com.minlia.cloud.code.SystemCode; import com.minlia.cloud.constant.ApiPrefix; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import me.chanjar.weixin.common.error.WxError; import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.common.util.json.WxGsonBuilder; import me.chanjar.weixin.mp.api.WxMpMaterialService; import me.chanjar.weixin.mp.api.WxMpMessageRouter; import me.chanjar.weixin.mp.api.WxMpService; import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; import me.chanjar.weixin.mp.bean.result.WxMpQrCodeTicket; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.*; import java.util.HashMap; import java.util.Map; /** * 微信后台 * Created by laidu on 2017/5/4. */ @Slf4j @RestController @Api(tags = "Wechat MP", description = "微信公众号") @RequestMapping(ApiPrefix.API + "wechat") public class WechatMpEndpoint { public static final Integer EXPIRE_SECONDS = 2592000; @Autowired(required = false) private WxMpService wxMpService; @Autowired(required = false) private WxMpMessageRouter router; @ApiOperation(value = "获取素材列表", notes = "获取素材列表", httpMethod = "GET", produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(value = "material/{type}/{offset}/{count}", method = RequestMethod.GET, produces = {MediaType.APPLICATION_JSON_VALUE}) public Response material(@PathVariable String type, @PathVariable int offset, @PathVariable int count) throws WxErrorException { // WxMpMaterialFileBatchGetResult result = wxMpService.getMaterialService().materialFileBatchGet(type, offset, count); Map<String, Object> params = new HashMap<>(); params.put("type", type); params.put("offset", offset); params.put("count", count); String responseText = this.wxMpService.post(WxMpMaterialService.MATERIAL_BATCHGET_URL, WxGsonBuilder.create().toJson(params)); WxError wxError = WxError.fromJson(responseText); if (wxError.getErrorCode() != 0) { throw new WxErrorException(wxError); } return Response.success(new Gson().fromJson(responseText, HashMap.class)); } @ApiOperation(value = "临时二维码", notes = "临时二维码", httpMethod = "GET", produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(value = "tempqrcode/{scene}/{seconds}", method = RequestMethod.GET, produces = {MediaType.APPLICATION_JSON_VALUE}) public Response qrcode(@PathVariable String scene, @PathVariable Integer seconds) throws WxErrorException { WxMpQrCodeTicket ticket = wxMpService.getQrcodeService().qrCodeCreateTmpTicket(scene, seconds); String qrcode = wxMpService.getQrcodeService().qrCodePictureUrl(ticket.getTicket(), true); log.debug("QRCODE {}", qrcode); return Response.success(SystemCode.Message.SUCCESS, qrcode); } @ApiOperation(value = "永久二维码", notes = "永久二维码", httpMethod = "GET", produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(value = "lastqrcode/{scene}", method = RequestMethod.GET, produces = {MediaType.APPLICATION_JSON_VALUE}) public Response qrcode(@PathVariable String scene) throws WxErrorException { WxMpQrCodeTicket ticket = wxMpService.getQrcodeService().qrCodeCreateLastTicket(scene); String qrcode = wxMpService.getQrcodeService().qrCodePictureUrl(ticket.getTicket(), true); log.debug("QRCODE {}", qrcode); return Response.success(SystemCode.Message.SUCCESS, qrcode); } /** * 微信后台配置token校验 * * @param signature * @param timestamp * @param nonce * @param echostr * @return */ @GetMapping(produces = "text/plain;charset=utf-8") public String authGet( @RequestParam(name = "signature", required = false) String signature, @RequestParam(name = "timestamp", required = false) String timestamp, @RequestParam(name = "nonce", required = false) String nonce, @RequestParam(name = "echostr", required = false) String echostr) { log.info("接收到来自微信服务器的认证消息:[{}, {}, {}, {}]", signature, timestamp, nonce, echostr); if (StringUtils.isAnyBlank(signature, timestamp, nonce, echostr)) { throw new IllegalArgumentException("请求参数非法,请核实!"); } if (this.wxMpService.checkSignature(timestamp, nonce, signature)) { return echostr; } return "非法请求"; } /** * 微信回调处理 * * @param requestBody * @param signature * @param timestamp * @param nonce * @param encType * @param msgSignature * @return */ @PostMapping(produces = "application/xml; charset=UTF-8") public String callBack(@RequestBody String requestBody, @RequestParam("signature") String signature, @RequestParam("timestamp") String timestamp, @RequestParam("nonce") String nonce, @RequestParam(name = "encrypt_type", required = false) String encType, @RequestParam(name = "msg_signature", required = false) String msgSignature) { log.info("接收微信请求:[signature=[{}], encType=[{}], msgSignature=[{}]," + " timestamp=[{}], nonce=[{}], requestBody=[\n{}\n] ", signature, encType, msgSignature, timestamp, nonce, requestBody); if (!this.wxMpService.checkSignature(timestamp, nonce, signature)) { throw new IllegalArgumentException("非法请求,可能属于伪造的请求!"); } String out = null; if (encType == null) { // 明文传输的消息 WxMpXmlMessage inMessage = WxMpXmlMessage.fromXml(requestBody); WxMpXmlOutMessage outMessage = this.route(inMessage); if (outMessage == null) { return ""; } out = outMessage.toXml(); } else if ("aes".equals(encType)) { // aes加密的消息 WxMpXmlMessage inMessage = WxMpXmlMessage.fromEncryptedXml( requestBody, this.wxMpService.getWxMpConfigStorage(), timestamp, nonce, msgSignature); log.debug("\n消息解密后内容为:\n{} ", inMessage.toString()); WxMpXmlOutMessage outMessage = this.route(inMessage); if (outMessage == null) { return ""; } out = outMessage.toEncryptedXml(this.wxMpService.getWxMpConfigStorage()); } log.debug("\n组装回复信息:{}", out); return out; } private WxMpXmlOutMessage route(WxMpXmlMessage message) { try { return this.router.route(message); } catch (Exception e) { log.error(e.getMessage(), e); } return null; } }
[ "191285052@qq.com" ]
191285052@qq.com