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
bf583a37f80c95502537234c2b89cca2fdedae56
473b76b1043df2f09214f8c335d4359d3a8151e0
/benchmark/bigclonebenchdata_partial/11993046.java
e312d7a3b4834dbff23e930314123eed7d1de3a0
[]
no_license
whatafree/JCoffee
08dc47f79f8369af32e755de01c52d9a8479d44c
fa7194635a5bd48259d325e5b0a190780a53c55f
refs/heads/master
2022-11-16T01:58:04.254688
2020-07-13T20:11:17
2020-07-13T20:11:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
541
java
class c11993046 { public static void copyFile(File source, File dest) throws IOException { FileChannel in = null, out = null; try { in = new FileInputStream(source).getChannel(); out = new FileOutputStream(dest).getChannel(); long size = in.size(); MappedByteBuffer buf = in.map(FileChannel.MapMode.READ_ONLY, 0, size); out.write(buf); } finally { if (in != null) in.close(); if (out != null) out.close(); } } }
[ "piyush16066@iiitd.ac.in" ]
piyush16066@iiitd.ac.in
77e18de4eed107d5f906e40f68c63c810aaf5530
995e655293513d0b9f93d62e28f74b436245ae74
/src/com/google/android/gms/plus/Plus$a.java
8e402d342d7abbd20a880fb8c9245502e368dff8
[]
no_license
JALsnipe/HTC-RE-YouTube-Live-Android
796e7c97898cac41f0f53120e79cde90d3f2fab1
f941b64ad6445c0a0db44318651dc76715291839
refs/heads/master
2021-01-17T09:46:50.725810
2015-01-09T23:32:14
2015-01-09T23:32:14
29,039,855
3
0
null
null
null
null
UTF-8
Java
false
false
372
java
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.google.android.gms.plus; public abstract class t> extends com.google.android.gms.common.api.it> { public pi.b(com.google.android.gms.common.api. ) { super(); } }
[ "josh.lieberman92@gmail.com" ]
josh.lieberman92@gmail.com
26e508ede3183fb74595912610bc23bffaf9d4a9
90772e6be8e2753bcc5250a08188251bbce81934
/jdk5/src/com/sun/org/apache/xml/internal/utils/res/XResources_ja_JP_A.java
b69d293b105ad0491459cd0d653109952e5057ec
[]
no_license
sos303sos/java4
51e99981863ae9cce189d40c05e019d06eac530e
70f64711f2a4c69a0d8e2f9268a8ec8a1bc28d12
refs/heads/master
2021-05-07T18:50:13.247171
2019-08-10T15:36:14
2019-08-10T15:36:14
108,831,060
1
0
null
null
null
null
UTF-8
Java
false
false
3,358
java
/* * Copyright 1999-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. */ /* * $Id: XResources_ja_JP_A.java,v 1.7 2004/02/17 04:22:15 minchau Exp $ */ package com.sun.org.apache.xml.internal.utils.res; // // LangResources_en.properties // /** * The Japanese (Katakana) resource bundle. * @xsl.usage internal */ public class XResources_ja_JP_A extends XResourceBundle { /** * Get the association list. * * @return The association list. */ protected Object[][] getContents() { // return a copy of contents; in theory we want a deep clone // of contents, but since it only contains (immutable) Strings, // this shallow copy is sufficient Object[][] msgCopy = new Object[contents.length][2]; for (int i = 0; i < contents.length; i++) { msgCopy[i][0] = contents[i][0]; msgCopy[i][1] = contents[i][1]; } return msgCopy; } /** The association list. */ static final Object[][] contents = { { "ui_language", "ja" }, { "help_language", "ja" }, { "language", "ja" }, { "alphabet", new char[]{ 0x30a2, 0x30a4, 0x30a6, 0x30a8, 0x30aa, 0x30ab, 0x30ad, 0x30af, 0x30b1, 0x30b3, 0x30b5, 0x30b7, 0x30b9, 0x30bb, 0x30bd, 0x30bf, 0x30c1, 0x30c4, 0x30c6, 0x30c8, 0x30ca, 0x30cb, 0x30cc, 0x30cd, 0x30ce, 0x30cf, 0x30d2, 0x30d5, 0x30d8, 0x30db, 0x30de, 0x30df, 0x30e0, 0x30e1, 0x30e2, 0x30e4, 0x30e6, 0x30e8, 0x30e9, 0x30ea, 0x30eb, 0x30ec, 0x30ed, 0x30ef, 0x30f0, 0x30f1, 0x30f2, 0x30f3 } }, { "tradAlphabet", new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' } }, //language orientation { "orientation", "LeftToRight" }, //language numbering { "numbering", "multiplicative-additive" }, { "multiplierOrder", "follows" }, // largest numerical value //{"MaxNumericalValue", new Integer(10000000000)}, //These would not be used for EN. Only used for traditional numbering { "numberGroups", new int[]{ 1 } }, //These only used for mutiplicative-additive numbering // Note that we are using longs and that the last two // multipliers are not supported. This is a known limitation. { "multiplier", new long[]{ Long.MAX_VALUE, Long.MAX_VALUE, 100000000, 10000, 1000, 100, 10 } }, { "multiplierChar", new char[]{ 0x4EAC, 0x5146, 0x5104, 0x4E07, 0x5343, 0x767e, 0x5341 } }, // chinese only? { "zero", new char[0] }, { "digits", new char[]{ 0x4E00, 0x4E8C, 0x4E09, 0x56DB, 0x4E94, 0x516D, 0x4E03, 0x516B, 0x4E5D } }, { "tables", new String[]{ "digits" } } }; }
[ "95129@DESKTOP-LP33PPV" ]
95129@DESKTOP-LP33PPV
79fc2e8c78ddfa1ff20055d1880539f8d27336d6
5c0a5d1e3685720e5fa387a26a60dd06bb7c6e4a
/group-core/lock-hqb-core/src/main/java/com/spark/bitrade/constant/HqbInRecordStatusEnum.java
e24440ba38d4d5f4cf0035ff40cd7eaf12c34494
[]
no_license
im8s/silk-v1
5d88ccd1b5ed2370f8fba4a70298d1d14d9a175d
ff9f689443af30c815a8932899a333dfc87f6f12
refs/heads/master
2022-06-20T13:08:01.519634
2020-04-28T02:56:50
2020-04-28T02:56:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
667
java
package com.spark.bitrade.constant; import com.baomidou.mybatisplus.enums.IEnum; import java.io.Serializable; public enum HqbInRecordStatusEnum implements IEnum { UNCONFIRMED(0, "未确认"), CONFIRMED(1, "已确认"), CONFIRMED_Failed(2, "确认失败"); private final int value; private final String desc; HqbInRecordStatusEnum(final int value, final String desc) { this.value = value; this.desc = desc; } @Override public Serializable getValue() { return this.value; } // Jackson 注解为 JsonValue 返回中文 json 描述 public String getDesc() { return this.desc; } }
[ "huihui123" ]
huihui123
2cd53fa55968cbd02aed60c8e678d2a7ef301ddd
dfc523f19f6f26cd30b94f83cd9945a9670de518
/链表/src/PartitionList.java
7c9d7d914ace63d638b85abefe7528d9d449f007
[]
no_license
DoubleEar/javapractice
0251cee7bb193427cbbb485768f2009249ca1d2d
0cff08e52ac51c1993f85484a82f106220e0dc90
refs/heads/master
2022-06-28T21:29:06.495901
2020-09-20T15:25:45
2020-09-20T15:25:45
217,519,133
0
0
null
2022-06-21T03:38:43
2019-10-25T11:28:54
Java
UTF-8
Java
false
false
1,526
java
//链表分割,不改变原来链表中的顺序,将比X小的放在左边,比x大的放在右边 public class PartitionList { public static void printLinkedList(Node head) { Node cur = head; while (cur != null) { System.out.println(cur.val); cur = cur.next; } } public static Node partition(Node head,int x){ Node cur=head; Node sHead=null; Node sLast=null; Node bHead=null; Node bLast=null; while(cur!=null){ if(cur.val<x){ if(sHead==null){ sHead=cur; }else{ sLast.next=cur; } sLast=cur; }else{ if(bHead==null){ bHead=cur; }else{ bLast.next=cur; } bLast=cur; } cur=cur.next; } //如果小链表的头节点为空 if(sHead==null){ return bHead; } //如果大链表的头节点为空 if(bHead==null){ return sHead; } sLast.next=bHead; bLast.next=null; return sHead; } public static void main(String[] args){ Node n5=new Node(8); Node n4=new Node(9,n5); Node n3=new Node(3,n4); Node n2=new Node(7,n3); Node n1=new Node(1,n2); Node head=partition(n1,6); printLinkedList(head); } }
[ "1638435068@qq.com" ]
1638435068@qq.com
5816da7d66d91136a16f5eeac7c6cc5c34c8a12e
ca3df4ca060d5266bf97d9b861984f59db78756e
/src/leetcode/LfuCache.java
d4b240364be52a59b641fdc293b3141edb21cdfc
[]
no_license
Nobodyhave/Solutions
fe6b293b7d5c41d1747825850771f662a14b13b4
0e473708a9ebc81e2da4b4e2c090c464949ee81b
refs/heads/master
2020-02-26T16:29:29.358399
2018-02-27T13:55:41
2018-02-27T13:55:41
71,220,895
2
0
null
null
null
null
UTF-8
Java
false
false
3,768
java
package leetcode; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedHashSet; import java.util.Map; /** * Created by Aleksandr on 18/09/2017. * Project Solutions * <p> * https://leetcode.com/problems/lfu-cache */ public class LfuCache { private int capacity; private int size; private Map<Integer, Integer> keysMap; private Map<Integer, Integer> freqMap; private Map<Integer, Bucket> buckets; private Bucket head; private Bucket tail; public LfuCache(int capacity) { this.capacity = capacity; keysMap = new HashMap<>(); freqMap = new HashMap<>(); buckets = new HashMap<>(); head = new Bucket(); tail = new Bucket(); head.next = tail; tail.prev = head; } public int get(int key) { if (!keysMap.containsKey(key)) { return -1; } int freq = freqMap.get(key); Bucket bucket = buckets.get(freq); Bucket nextF = buckets.get(freq + 1); if (nextF == null || nextF == tail) { nextF = new Bucket(); nextF.next = bucket.next; bucket.next.prev = nextF; bucket.next = nextF; nextF.prev = bucket; buckets.put(freq + 1, nextF); } bucket.removeKey(key); nextF.addKey(key); freqMap.put(key, freq + 1); if (bucket.keys.size() == 0) { bucket.prev.next = bucket.next; bucket.next.prev = bucket.prev; bucket.next = null; bucket.prev = null; buckets.remove(freq); } return keysMap.get(key); } public void put(int key, int value) { if (capacity <= 0) { return; } if (keysMap.containsKey(key)) { get(key); keysMap.put(key, value); return; } if (size == capacity) { Bucket bucket = head.next; int oldKey = bucket.removeFirstKey(); int freq = freqMap.get(oldKey); freqMap.remove(oldKey); keysMap.remove(oldKey); if (bucket.keys.size() == 0) { bucket.prev.next = bucket.next; bucket.next.prev = bucket.prev; bucket.next = null; bucket.prev = null; buckets.remove(freq); } size--; } int keyFreq = freqMap.getOrDefault(key, 0); Bucket bucket = buckets.get(keyFreq); if (keyFreq == 0 && bucket == null) { bucket = new Bucket(); bucket.next = head.next; head.next.prev = bucket; head.next = bucket; bucket.prev = head; bucket.addKey(key); buckets.put(0, bucket); } keysMap.put(key, value); if (!freqMap.containsKey(key)) { freqMap.put(key, 0); } bucket.replaceKey(key); size++; } private static class Bucket { private LinkedHashSet<Integer> keys = new LinkedHashSet<>(); private Bucket next; private Bucket prev; void addKey(Integer key) { keys.add(key); } void removeKey(int key) { keys.remove(key); } Integer removeFirstKey() { Iterator<Integer> iterator = keys.iterator(); int val = iterator.next(); iterator.remove(); return val; } void replaceKey(int key) { removeKey(key); addKey(key); } } }
[ "aleksandr.nesterov@u-tx.com" ]
aleksandr.nesterov@u-tx.com
b4d36188e1efa3eab45a752c69f07ba4ecb529e2
c76fda2c453cdcc9c46db2105aae1ea72d0fac8e
/redpig-framework/src/main/java/com/redpigmall/view/web/tools/RedPigQueryUtils.java
e457337e2d82b6e81075bb3deef9e81d3cdf7398
[]
no_license
18182336296/new
213ba4bf80de1955ce9fdd69f53892bb45a277a2
722c39db381733e37c80b9ac6ec1b1afba25c162
refs/heads/master
2022-11-21T20:43:03.448373
2020-07-19T08:20:23
2020-07-19T08:20:23
280,778,769
0
2
null
null
null
null
UTF-8
Java
false
false
4,942
java
package com.redpigmall.view.web.tools; import java.util.List; import java.util.Map; import org.springframework.stereotype.Component; import com.google.common.collect.Maps; import com.redpigmall.api.tools.CommUtil; import com.redpigmall.api.tools.StringUtils; /** * * <p> * Title: RedPigQueryTools.java * </p> * * <p> * Description: 商品查询语句工具类 * </p> * * <p> * Copyright: Copyright (c) 2015 * </p> * * <p> * Company: www.redpigmall.net * </p> * * @author redpig * * @date 2016-10-29 * * @version redpigmall_b2b2c v8.0 2016版 */ @Component public class RedPigQueryUtils { public void queryActivityGoods(Map<String, Object> maps, List<String> str_list) { String temp_str = ""; String[] status_list = { "goods_status", "activity_status", "group_buy", "combin_status", "order_enough_give_status", "enough_reduce", "f_sale_type", "advance_sale_type", "order_enough_if_give", "goods_limit" }; Map<String, Object> params = Maps.newHashMap(); params.put("goods_status", Integer.valueOf(0)); params.put("activity_status", Integer.valueOf(2)); params.put("group_buy", Integer.valueOf(2)); params.put("combin_status", Integer.valueOf(1)); params.put("order_enough_give_status", Integer.valueOf(1)); params.put("enough_reduce", Integer.valueOf(1)); params.put("f_sale_type", Integer.valueOf(1)); params.put("advance_sale_type", Integer.valueOf(1)); params.put("order_enough_if_give", Integer.valueOf(1)); params.put("goods_limit", Integer.valueOf(1)); if (str_list != null) { for (String str : str_list) { if (!"".equals(str)) { temp_str = temp_str + "," + str; } } } for (String status : status_list) { if (temp_str.indexOf("," + status) >= 0) { maps.put(status, CommUtil.null2Int(params.get(status))); } } } /** * * @param currentPage * @param orderBy * @param orderType * @return */ public Map<String, Object> getParams(String currentPage, String orderBy, String orderType) { int cp = CommUtil.null2Int(currentPage); Map<String, Object> params = Maps.newHashMap(); // 这个src_currentPage需要返回到前台,让前台显示页码用的 int src_currentPage = cp; if (src_currentPage == 0) { src_currentPage = 1; } params.put("src_currentPage", src_currentPage); params.put("currentPage", (src_currentPage - 1) * 12); params.put("pageSize", 12); params.put("orderBy", orderBy); params.put("orderType", orderType); if (StringUtils.isBlank(orderBy) || StringUtils.isBlank(orderType)) { params.put("orderBy", "obj.addTime"); params.put("orderType", "desc"); } return params; } /** * * @param currentPage * @param orderBy * @param orderType * @return */ public Map<String, Object> getParams(String currentPage, Integer pageSize, String orderBy, String orderType) { int cp = CommUtil.null2Int(currentPage); Map<String, Object> params = Maps.newHashMap(); // 这个src_currentPage需要返回到前台,让前台显示页码用的 int src_currentPage = cp; if (src_currentPage == 0) { src_currentPage = 1; } if (pageSize == null) { pageSize = 12; } params.put("src_currentPage", src_currentPage); params.put("currentPage", (src_currentPage - 1) * pageSize); params.put("pageSize", pageSize); params.put("orderBy", orderBy); params.put("orderType", orderType); if (StringUtils.isBlank(orderBy) || StringUtils.isBlank(orderType)) { params.put("orderBy", "addTime"); params.put("orderType", "asc"); } return params; } /** * 屏蔽商品多种活动状态,并且查询出的商品为正常上架商品(满就赠中的赠品状态目前没有屏蔽) * str_list:无需屏蔽的商品状态,当没有需要屏蔽的状态时传入null即可,买就送赠品不可参加活动 * * @return */ public void shieldGoodsStatus(Map<String, Object> params, List<String> str_list) { String temp_str = ""; String[] status_list = { "goods_status", "activity_status", "group_buy", "combin_status", "order_enough_give_status", "enough_reduce", "f_sale_type", "advance_sale_type", "order_enough_if_give", "whether_free", "goods_limit" }; if (str_list != null) { for (String str : str_list) { if (!"".equals(str)) { temp_str = temp_str + "," + str; } } } for (String status : status_list) { if (temp_str.indexOf("," + status) < 0) { params.put(status, 0); } } } public void shildGoodsStatusParams(Map<String, Object> params) { params.put("goods_status", 0); params.put("activity_status", 0); params.put("group_buy", 0); params.put("combin_status", 0); params.put("order_enough_give_status", 0); params.put("enough_reduce", 0); params.put("f_sale_type", 0); params.put("advance_sale_type", 0); params.put("order_enough_if_give", 0); params.put("whether_free", 0); params.put("goods_limit", 0); } }
[ "15361560307@163.com" ]
15361560307@163.com
5b86925ca4a989a1d27a6ccff4694e1d4c7547ea
872967c9fa836eee09600f4dbd080c0da4a944c1
/source/com/sun/corba/se/spi/activation/ServerAlreadyActive.java
17cb9df756739a08a4695f3ef9475f353486b5ef
[]
no_license
pangaogao/jdk
7002b50b74042a22f0ba70a9d3c683bd616c526e
3310ff7c577b2e175d90dec948caa81d2da86897
refs/heads/master
2021-01-21T02:27:18.595853
2018-10-22T02:45:34
2018-10-22T02:45:34
101,888,886
0
0
null
null
null
null
UTF-8
Java
false
false
896
java
package com.sun.corba.se.spi.activation; /** * com/sun/corba/se/spi/activation/ServerAlreadyActive.java . * Generated by the IDL-to-Java compiler (portable), version "3.2" * from /Users/java_re/workspace/8-2-build-macosx-x86_64/jdk8u131/8869/corba/src/share/classes/com/sun/corba/se/spi/activation/activation.idl * Wednesday, March 15, 2017 1:33:56 AM PDT */ public final class ServerAlreadyActive extends test.org.omg.CORBA.UserException { public int serverId = (int)0; public ServerAlreadyActive () { super(ServerAlreadyActiveHelper.id()); } // ctor public ServerAlreadyActive (int _serverId) { super(ServerAlreadyActiveHelper.id()); serverId = _serverId; } // ctor public ServerAlreadyActive (String $reason, int _serverId) { super(ServerAlreadyActiveHelper.id() + " " + $reason); serverId = _serverId; } // ctor } // class ServerAlreadyActive
[ "gaopanpan@meituan.com" ]
gaopanpan@meituan.com
e74d8d5a1fe39f8cfe99d1414abd91439dd523ff
916596f25592750e4d3b359227dd90c6e8c78c9f
/app/src/main/java/com/speedata/quanrayuhf/utils/QuanrayDataUtils.java
5c2f0535ec0c28b266bf6c11cf9a7ef7182d70cf
[]
no_license
SpeedataG/QuanrayUHF
3187b5dca8dbf663328bba0d3f00da17640bb9dc
5562787b50d4013779b4e7203f83a26d4f942edf
refs/heads/master
2020-06-29T16:40:28.215753
2019-08-05T02:52:15
2019-08-05T02:57:07
200,569,366
0
0
null
null
null
null
UTF-8
Java
false
false
3,574
java
package com.speedata.quanrayuhf.utils; import com.speedata.libuhf.utils.StringUtils; import java.util.Arrays; /** * Created by 张明_ on 2017/12/5. * Email 741183142@qq.com */ public class QuanrayDataUtils { private static final byte[] HEAD = {0x5B, 0x5B}; public static final byte[] VER = {0x11}; private static int sn = 0; //链接认证 public static final byte[] CMD1 = {0x40}; //链接检测 public static final byte[] CMD2 = {0x41}; //功率读取 public static final byte[] CMD3 = {0x42}; //功率设置 public static final byte[] CMD4 = {0x43}; //频段读取 public static final byte[] CMD5 = {0x44}; //频段设置 public static final byte[] CMD6 = {0x45}; //启动盘存 public static final byte[] CMD7 = {0x46}; //停止盘存 public static final byte[] CMD8 = {0x47}; //盘存数据响应 public static final byte[] CMD9 = {0x48}; //读数据 public static final byte[] CMD10 = {0x49}; //写数据 public static final byte[] CMD11 = {0x4A}; public static final byte[] F840 = {0x03, 0x48}; public static final byte[] F845 = {0x03, 0x4D}; public static final byte[] F920 = {0x03, (byte) 0x98}; public static final byte[] F925 = {0x03, (byte) 0x9D}; public static final byte[] F902 = {0x03, (byte) 0x86}; public static final byte[] F928 = {0x03, (byte) 0xA0}; public static final byte[] F865 = {0x03, 0x61}; public static final byte[] F868 = {0x03, 0x64}; /** * 检验数据是否符合要求 * * @param data 数据 * @return */ public static boolean checkData(byte[] data) { byte[] head = CrcOperateUtil.getBytesByindex(data, 0, 1); return Arrays.equals(head, HEAD) && CrcOperateUtil.isQuanrayPassCRC(data); } /** * 得到命令字 * * @param data 数据 * @return */ public static byte[] getCMD(byte[] data) { return CrcOperateUtil.getBytesByindex(data, 6, 6); } /** * 得到数据字段 * * @param data 数据 * @return */ public static byte[] getDATA(byte[] data) { int length = CrcOperateUtil.toInt(CrcOperateUtil.getBytesByindex(data, 2, 3)) + 6; return CrcOperateUtil.getBytesByindex(data, 7, length - 3); } public static byte[] getSendData(byte[] data, byte[] cmd) { sn++; if (sn > 255) { sn = 0; } byte[] snBytes = int2bytes(sn); byte[] lenBytes = getLen(data.length); byte[] concatAll = CrcOperateUtil.concatAll(VER, snBytes, cmd, data); byte[] chkBytes = CrcOperateUtil.getCHKBytes(concatAll); return CrcOperateUtil.concatAll(HEAD, lenBytes, concatAll, chkBytes); } public static byte[] int2bytes(int int10) { String hexString = Integer.toHexString(int10); if (hexString.length() == 1) { hexString = "0" + hexString; } return StringUtils.stringToByte(hexString); } public static int bytes2int(byte[] bytes) { String hexString = StringUtils.byteToHexString(bytes, bytes.length); return Integer.parseInt(hexString, 16); } /** * 得到数据长度byte * * @param dataLen * @return */ private static byte[] getLen(int dataLen) { int len = 3 + dataLen; byte[] bytes = int2bytes(len); if (bytes.length == 1) { return CrcOperateUtil.concatAll(new byte[]{0x00}, bytes); } else { return bytes; } } }
[ "ming.zhang@speedatagroup.com" ]
ming.zhang@speedatagroup.com
cd6cc52860c19bd5d3b695c638c9ac510d53fc9c
8f3b28cabf2c0552d1db7ce74ac6a786358fa19e
/src/anagrams/FirstOopsClass.java
13b76fe12819a6a21ffab336bcf18c772f70e257
[]
no_license
karanS1314/FullJavaPractice
896b48bfa5a9b81c776641a852bab5031f7814aa
f6cce995969dd0d106cc5482e7fd4f7ecd1de3af
refs/heads/master
2023-07-01T06:51:19.353007
2021-08-08T18:10:47
2021-08-08T18:10:47
359,021,462
1
0
null
null
null
null
UTF-8
Java
false
false
943
java
package anagrams; class Friends{ String behaviour; boolean sober; int noOfFriends; public void action1() { System.out.println("tatter slapped gaurav"); } public void action2() { System.out.println("ruhi slapped ayushi"); } public void action3() { System.out.println("ayushi slapped ruhi"); } public void me() { System.out.println("me laughing my ass out"); } static void sayHii() { System.out.println("hello"); } public static void main(String[] args) { sayHii(); } } public class FirstOopsClass { public static void main(String[] args) { Friends ashutosh= new Friends(); Friends me=new Friends(); ashutosh.behaviour= "chutiya"; ashutosh.sober= true; ashutosh.noOfFriends=4; me.action1(); me.action2(); me.action3(); me.me(); sayHi(); } static void sayHi() { System.out.println("hello madarchod"); } }
[ "gurkaran1314@gmail.com" ]
gurkaran1314@gmail.com
d4f0c7bdb415bee9d83f9b2abb50d9d15df7e404
d11a469ca0bc6656d5a1e8bfa80b238c00893dba
/Problems (20)/Messaging/src/Main.java
3989521f489f960b79dc92e60c1fce2d2c6f414a
[]
no_license
alexengrig/Blockchain
05f82d3db3e92266f5c72a9d3a0efc70a7fe994f
1e8987e080efc35edc475508a2676a25255482fa
refs/heads/master
2020-12-26T22:59:47.814511
2020-02-11T18:33:41
2020-02-11T18:33:41
237,678,247
0
2
null
null
null
null
UTF-8
Java
false
false
1,078
java
/* Do not change this class */ class Message { final String text; final String from; final String to; Message(String from, String to, String text) { this.text = text; this.from = from; this.to = to; } } /* Do not change this interface */ interface AsyncMessageSender { void sendMessages(Message[] messages); void stop(); } class AsyncMessageSenderImpl implements AsyncMessageSender { private ExecutorService executor = Executors.newCachedThreadPool(); private final int repeatFactor; public AsyncMessageSenderImpl(int repeatFactor) { this.repeatFactor = repeatFactor; } @Override public void sendMessages(Message[] messages) { for (Message msg : messages) { for (int i = 0; i < repeatFactor; i++) { executor.submit(() -> { System.out.printf("(%s>%s): %s\n", msg.from, msg.to, msg.text); // do not change it }); } } } @Override public void stop() { executor.shutdown(); } }
[ "alexengrigdev@gmail.com" ]
alexengrigdev@gmail.com
245027dbe0e28f872751bafc0b5a952c93d9aabf
1357eb3856e334fdfdfa94c0cac08fa1b07f6cab
/ezyfox-server-core/src/main/java/com/tvd12/ezyfoxserver/setting/EzySimpleLoggerSetting.java
7d26524526d563ef106c8bab2e63a23b0bf4d540
[ "Apache-2.0" ]
permissive
brock12121996/ezyfox-server
a22dc58884f68c94b6619688cd7f581527defa8e
e8d1ca08cd36a050d6fe310212e7e1ef4a2c7ab6
refs/heads/master
2021-05-17T02:20:00.363552
2020-03-14T17:38:14
2020-03-14T17:38:14
250,573,240
1
0
Apache-2.0
2020-03-27T15:37:29
2020-03-27T15:37:29
null
UTF-8
Java
false
false
1,543
java
package com.tvd12.ezyfoxserver.setting; import java.util.HashMap; import java.util.Map; import java.util.Set; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import com.tvd12.ezyfox.collect.Sets; import com.tvd12.ezyfox.constant.EzyConstant; import com.tvd12.ezyfoxserver.constant.EzyCommand; import lombok.Getter; import lombok.Setter; import lombok.ToString; @Getter @Setter @ToString @XmlAccessorType(XmlAccessType.NONE) @XmlRootElement(name = "logger") public class EzySimpleLoggerSetting implements EzyLoggerSetting { @XmlElement(name = "ignored-commands") protected EzySimpleIgnoredCommandsSetting ignoredCommands = new EzySimpleIgnoredCommandsSetting(); @Override public Map<Object, Object> toMap() { Map<Object, Object> map = new HashMap<>(); map.put("ignoredCommands", ignoredCommands.getCommands()); return map; } @Getter @ToString @XmlAccessorType(XmlAccessType.NONE) @XmlRootElement(name = "ignored-commands") public static class EzySimpleIgnoredCommandsSetting implements EzyIgnoredCommandsSetting { protected Set<EzyConstant> commands = Sets.newHashSet(EzyCommand.PING, EzyCommand.PONG); @XmlElement(name="command") public void setCommand(String string) { commands.add(EzyCommand.valueOf(string)); } } }
[ "itprono3@gmail.com" ]
itprono3@gmail.com
61c8975bb0cbc03050380896bc484f71820b69e6
d2eee6e9a3ad0b3fd2899c3d1cf94778615b10cb
/PROMISE/archives/log4j/1.2/org/apache/log4j/performance/NotLogging.java
6d5c1bac09a313deaf3906afab91c4dfea19e4e9
[]
no_license
hvdthong/DEFECT_PREDICTION
78b8e98c0be3db86ffaed432722b0b8c61523ab2
76a61c69be0e2082faa3f19efd76a99f56a32858
refs/heads/master
2021-01-20T05:19:00.927723
2018-07-10T03:38:14
2018-07-10T03:38:14
89,766,606
5
1
null
null
null
null
UTF-8
Java
false
false
4,823
java
package org.apache.log4j.performance; import org.apache.log4j.Category; import org.apache.log4j.SimpleLayout; import org.apache.log4j.ConsoleAppender; import org.apache.log4j.Level; /** Measure the performance of evaluating whether to log or not to log, but not actually logging. <p>This program takes two arguments, a string which should be "true" for testing shipped code performance and "false" for testing debug-enabled performance the second argument is the run length of the measurement loops. <p>The results of the measurement (should) show that <ul> <p> <li>Category evaluation is independent of the length of the category name. <p> <li>As expected, using the {@link Category#isDebugEnabled isDebugEnabled} and {@link Category#isInfoEnabled isInfoEnabled} methods eliminates the overhead of message argument construction. <p> <li>Message argument construction can be an important slowing factor while evaluating whether to log or not. </ul> @author Ceki G&uuml;lc&uuml; */ public class NotLogging { static int runLength; final static int INITIAL_HASH_SIZE = 101; static String SHORT_MSG = "Hello World"; static Category SHORT_CAT = Category.getInstance("A0123456789"); static Category MEDIUM_CAT= Category.getInstance("A0123456789.B0123456789"); static Category LONG_CAT = Category.getInstance("A0123456789.B0123456789.C0123456789"); static Category INEXISTENT_SHORT_CAT = Category.getInstance("I0123456789"); static Category INEXISTENT_MEDIUM_CAT= Category.getInstance("I0123456789.B0123456789"); static Category INEXISTENT_LONG_CAT= Category.getInstance("I0123456789.B0123456789.C0123456789"); static Category[] CAT_ARRAY = new Category[] {SHORT_CAT, MEDIUM_CAT, LONG_CAT, INEXISTENT_SHORT_CAT, INEXISTENT_MEDIUM_CAT, INEXISTENT_LONG_CAT}; static void Usage() { System.err.println( "Usage: java org.apache.log4j.test.NotLogging true|false runLength\n" + "true indicates shipped code, false indicates code in development" + " where runLength is an int representing the run length of loops\n"+ "We suggest that runLength be at least 100'000."); System.exit(1); } public static void main(String argv[]) { if(argv.length != 2) { Usage(); } ProgramInit(argv); double delta; System.out.println(); for(int i = 0; i < CAT_ARRAY.length; i++) { delta = SimpleMessage(CAT_ARRAY[i], SHORT_MSG, runLength); System.out.println("Simple argument, " + delta + " micros. Cat: " + CAT_ARRAY[i].getName()); } System.out.println(); for(int i = 0; i < CAT_ARRAY.length; i++) { delta = FullyOptimizedComplexMessage(CAT_ARRAY[i], runLength); System.out.println("Fully optimized complex, " + delta + " micros. Cat: " + CAT_ARRAY[i].getName()); } System.out.println(); for(int i = 0; i < CAT_ARRAY.length; i++) { delta = ComplexMessage(CAT_ARRAY[i], runLength); System.out.println("Complex message argument, " + delta + " micros. Cat: " + CAT_ARRAY[i].getName()); } } /** Program wide initialization method. */ static void ProgramInit(String[] args) { try { runLength = Integer.parseInt(args[1]); } catch(java.lang.NumberFormatException e) { System.err.println(e); Usage(); } ConsoleAppender appender = new ConsoleAppender(new SimpleLayout()); if("false".equals(args[0])) { } else if ("true".equals(args[0])) { System.out.println("Flagging as shipped code."); Category.getDefaultHierarchy().setThreshold((Level) Level.WARN); } else Usage(); SHORT_CAT.setLevel((Level) Level.INFO); Category.getRoot().setLevel((Level) Level.INFO); } static double SimpleMessage(Category category, String msg, long runLength) { long before = System.currentTimeMillis(); for(int i = 0; i < runLength; i++) { category.debug(msg); } return (System.currentTimeMillis() - before)*1000.0/runLength; } static double FullyOptimizedComplexMessage(Category category, long runLength) { long before = System.currentTimeMillis(); for(int i = 0; i < runLength; i++) { if(category.isDebugEnabled()) category.debug("Message" + i + " bottles of beer standing on the wall."); } return (System.currentTimeMillis() - before)*1000.0/runLength; } static double ComplexMessage(Category category, long runLength) { long before = System.currentTimeMillis(); for(int i = 0; i < runLength; i++) { category.debug("Message" + i + " bottles of beer standing on the wall."); } return (System.currentTimeMillis() - before)*1000.0/runLength; } }
[ "hvdthong@github.com" ]
hvdthong@github.com
f5766afb845d403a30665b29d3c9878e2f7f6985
e8f9fe2285f1598fee5860d2447fd1a1f6557306
/MPC/temp/src/minecraft_server/net/minecraft/src/EnumEntitySizeHelper.java
46d20d3d2e1ef764276ec3a3e98f1d192ff1854b
[]
no_license
pedroreisuft/minecraft
8e71c74ee37ffbf863b0e89c7051ed2b3ce80a7f
64ba09bce02603abea3270e4030be2aac4555822
refs/heads/master
2016-09-06T01:24:36.812128
2012-11-30T19:34:19
2012-11-30T19:34:19
6,943,629
2
0
null
null
null
null
UTF-8
Java
false
false
1,085
java
package net.minecraft.src; import net.minecraft.src.EnumEntitySize; // $FF: synthetic class class EnumEntitySizeHelper { // $FF: synthetic field static final int[] field_85153_a = new int[EnumEntitySize.values().length]; static { try { field_85153_a[EnumEntitySize.SIZE_1.ordinal()] = 1; } catch (NoSuchFieldError var6) { ; } try { field_85153_a[EnumEntitySize.SIZE_2.ordinal()] = 2; } catch (NoSuchFieldError var5) { ; } try { field_85153_a[EnumEntitySize.SIZE_3.ordinal()] = 3; } catch (NoSuchFieldError var4) { ; } try { field_85153_a[EnumEntitySize.SIZE_4.ordinal()] = 4; } catch (NoSuchFieldError var3) { ; } try { field_85153_a[EnumEntitySize.SIZE_5.ordinal()] = 5; } catch (NoSuchFieldError var2) { ; } try { field_85153_a[EnumEntitySize.SIZE_6.ordinal()] = 6; } catch (NoSuchFieldError var1) { ; } } }
[ "phsmreis@gmail.com" ]
phsmreis@gmail.com
3b176daa1dcadc705b40e9f17906bb0d00369f7c
ff4a63c45b0c413dc2b787c95884f193154eef60
/DesignPatterns/08-compositePattern/com/ying/composite/SongGroup.java
7779bb14443684f1591e47757722586ab8992a64
[]
no_license
hsnyxfhyqhyh/mianshi
a077983066bd4addfd5682ed310a6089733a8108
e90b4cbe279b286a0ec8d2d53a6c08794bfd59f6
refs/heads/master
2020-05-27T17:50:33.247727
2019-07-14T15:09:38
2019-07-14T15:09:38
188,730,310
0
0
null
null
null
null
UTF-8
Java
false
false
1,419
java
package com.ying.composite; import java.util.ArrayList; import java.util.Iterator; public class SongGroup extends SongComponent { // Contains any Songs or SongGroups that are added // to this ArrayList ArrayList songComponents = new ArrayList(); String groupName; String groupDescription; public SongGroup(String newGroupName, String newGroupDescription){ groupName = newGroupName; groupDescription = newGroupDescription; } public String getGroupName() { return groupName; } public String getGroupDescription() { return groupDescription; } public void add(SongComponent newSongComponent) { songComponents.add(newSongComponent); } public void remove(SongComponent newSongComponent) { songComponents.remove(newSongComponent); } public SongComponent getComponent(int componentIndex) { return (SongComponent)songComponents.get(componentIndex); } public void displaySongInfo(){ System.out.println(getGroupName() + " " + getGroupDescription() + "\n"); // Cycles through and prints any Songs or SongGroups added // to this SongGroups ArrayList songComponents Iterator songIterator = songComponents.iterator(); while(songIterator.hasNext()) { SongComponent songInfo = (SongComponent) songIterator.next(); songInfo.displaySongInfo(); } } }
[ "xfyang46@gmail.com" ]
xfyang46@gmail.com
ec08e1f34e9c9bfd953421c101b5ab5a521b6a0d
74d93f962ce5125c068e2d4b2f634efa0c41d9ce
/app/src/main/java/bsl/co/ke/fundsmanagementapi/newtwork/licensesdialog/licenses/CreativeCommonsAttribution30Unported.java
003fc97ce29ec2468d07fa1f1509e6a189f93320
[ "Apache-2.0" ]
permissive
koskcom/marikitipersonalaccount
b7402c9e80b8d553fdf6a6df2a6f907140e93e22
01949ca0d200724f7d761c8baa2c46ae083df678
refs/heads/master
2022-12-17T19:53:26.544172
2020-09-14T06:21:01
2020-09-14T06:21:01
295,322,498
0
0
null
null
null
null
UTF-8
Java
false
false
1,512
java
/* * Copyright 2014 Peter Heisig * * 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 bsl.co.ke.fundsmanagementapi.newtwork.licensesdialog.licenses; import android.content.Context; import bsl.co.ke.fundsmanagementapi.R; public class CreativeCommonsAttribution30Unported extends License { private static final long serialVersionUID = -8244155573094118433L; @Override public String getName() { return "Creative Commons Attribution 3.0 Unported"; } @Override public String readSummaryTextFromResources(final Context context) { return getContent(context, R.raw.ccby_30_summary); } @Override public String readFullTextFromResources(final Context context) { return getContent(context, R.raw.ccby_30_full); } @Override public String getVersion() { return "3.0"; } @Override public String getUrl() { return "https://creativecommons.org/licenses/by/3.0/"; } }
[ "hosea.koskei@briskbusiness.co.ke" ]
hosea.koskei@briskbusiness.co.ke
64af9ab222fb6bd03ed95fde9ef2815ff34ee51f
2a6c279f13263af7f6534c075fdf42732ed9647c
/Q2/src/Node.java
af3c205b5a1e5149da337eff7e7f5090985c371b
[]
no_license
fibonacci998/Java-netbeans-project
61aaba74adb42bc6bc46dd2814ea7fb354f62e1d
0ca2baaaafc4954fb784fc20b82bdb867900596f
refs/heads/master
2020-03-12T04:58:15.020665
2018-05-11T02:18:45
2018-05-11T02:18:45
130,454,945
0
0
null
null
null
null
UTF-8
Java
false
false
176
java
// ======= DO NOT EDIT THIS FILE ============ public class Node {Lamp info; Node left,right; int bal,level; Node(Lamp x) {info=x;left=right=null; } }
[ "30697927+tuansu2021998@users.noreply.github.com" ]
30697927+tuansu2021998@users.noreply.github.com
ccf579e2910198548cf92aed98a69b1ed25399b6
87ffe6cef639e2b96b8d5236b5ace57e16499491
/app/src/main/java/com/boohee/food/util/MobUtils$2.java
a5071147884f39f75e99849cdf4331140204ab29
[]
no_license
leerduo/FoodsNutrition
24ffeea902754b84a2b9fbd3299cf4fceb38da3f
a448a210e54f789201566da48cc44eceb719b212
refs/heads/master
2020-12-11T05:45:34.531682
2015-08-28T04:35:05
2015-08-28T04:35:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,811
java
package com.boohee.food.util; import android.app.Activity; import cn.sharesdk.framework.Platform; import cn.sharesdk.framework.PlatformActionListener; import cn.sharesdk.framework.PlatformDb; import cn.sharesdk.sina.weibo.SinaWeibo; import cn.sharesdk.wechat.friends.Wechat; import java.util.Date; import java.util.HashMap; final class MobUtils$2 implements PlatformActionListener { MobUtils$2(MobUtils.OnLoginListener paramOnLoginListener, Activity paramActivity, String paramString) {} public void onCancel(Platform paramPlatform, int paramInt) { this.a.a(false, this.b.getString(2131558432)); } public void onComplete(Platform paramPlatform, int paramInt, HashMap<String, Object> paramHashMap) { if (paramInt != 8) { this.a.a(false, this.b.getString(2131558433)); return; } String str1 = ""; PlatformDb localPlatformDb = paramPlatform.getDb(); if (Wechat.NAME.equals(this.c)) { str1 = paramHashMap.get("unionid").toString(); } for (;;) { String str2 = localPlatformDb.getToken(); String str3 = localPlatformDb.getUserName(); String str4 = localPlatformDb.getUserIcon(); String str5 = DateFormatUtils.a(new Date(localPlatformDb.getExpiresTime()), "yyyy-MM-dd HH:mm:ss"); MobUtils.a(this.b, this.c, this.a, str1, str2, str3, str4, str5); return; if (SinaWeibo.NAME.equals(this.c)) { str1 = localPlatformDb.getUserId(); } } } public void onError(Platform paramPlatform, int paramInt, Throwable paramThrowable) { this.a.a(false, paramThrowable.getClass().getSimpleName()); } } /* Location: D:\15036015\反编译\shiwuku\classes_dex2jar.jar * Qualified Name: com.boohee.food.util.MobUtils.2 * JD-Core Version: 0.7.0-SNAPSHOT-20130630 */
[ "1060221762@qq.com" ]
1060221762@qq.com
84c35363437a5214859b91f695a5a203e5107601
2a940a531c6e806407e36f06ef9fcd28ee6a3eaf
/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/traversal/step/map/TinkerCountGlobalStep.java
e0e7b805105bb63f7fcae7c2f124d7a5c1101210
[ "Apache-2.0", "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
JamesRandall/tinkerpop
c4cf62d57f83f1c73fa6e6a30ca2d3c4a0a544f9
bdd2130a47d1c1cd23935bbb5e342364b41f7253
refs/heads/master
2020-03-07T09:33:12.211276
2018-04-04T05:27:46
2018-04-04T05:27:46
127,410,679
3
0
Apache-2.0
2018-03-30T09:39:57
2018-03-30T09:39:57
null
UTF-8
Java
false
false
2,993
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.tinkerpop.gremlin.tinkergraph.process.traversal.step.map; import org.apache.tinkerpop.gremlin.process.traversal.Step; import org.apache.tinkerpop.gremlin.process.traversal.Traversal; import org.apache.tinkerpop.gremlin.process.traversal.Traverser; import org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep; import org.apache.tinkerpop.gremlin.process.traversal.util.FastNoSuchElementException; import org.apache.tinkerpop.gremlin.structure.Element; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.apache.tinkerpop.gremlin.structure.util.StringFactory; import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerHelper; import java.util.NoSuchElementException; /** * @author Marko A. Rodriguez (http://markorodriguez.com) */ public final class TinkerCountGlobalStep<S extends Element> extends AbstractStep<S, Long> { private final Class<S> elementClass; private boolean done = false; public TinkerCountGlobalStep(final Traversal.Admin traversal, final Class<S> elementClass) { super(traversal); this.elementClass = elementClass; } @Override protected Traverser.Admin<Long> processNextStart() throws NoSuchElementException { if (!this.done) { this.done = true; final TinkerGraph graph = (TinkerGraph) this.getTraversal().getGraph().get(); return this.getTraversal().getTraverserGenerator().generate(Vertex.class.isAssignableFrom(this.elementClass) ? (long) TinkerHelper.getVertices(graph).size() : (long) TinkerHelper.getEdges(graph).size(), (Step) this, 1L); } else throw FastNoSuchElementException.instance(); } @Override public String toString() { return StringFactory.stepString(this, this.elementClass.getSimpleName().toLowerCase()); } @Override public int hashCode() { return super.hashCode() ^ this.elementClass.hashCode(); } @Override public void reset() { this.done = false; } }
[ "okrammarko@gmail.com" ]
okrammarko@gmail.com
e3f441e36b6ec3c5024de86c1f73f5eb657ac53d
6252c165657baa6aa605337ebc38dd44b3f694e2
/org.eclipse.epsilon.egl.sync/Scalability-Tests/boiler-To-Generate-1000-Files/boiler-To-Generate-1000-Files/syncregions-1000Files/BoilerActuator35.java
8c590291340168440eaced040ba0801e93ebe2f4
[]
no_license
soha500/EglSync
00fc49bcc73f7f7f7fb7641d0561ca2b9a8ea638
55101bc781349bb14fefc178bf3486e2b778aed6
refs/heads/master
2021-06-23T02:55:13.464889
2020-12-11T19:10:01
2020-12-11T19:10:01
139,832,721
0
1
null
2019-05-31T11:34:02
2018-07-05T10:20:00
Java
UTF-8
Java
false
false
261
java
package syncregions; public class BoilerActuator35 { public int execute(int temperatureDifference35, boolean boilerStatus35) { //sync _bfpnGUbFEeqXnfGWlV2_35, behaviour Half Change - return temperature - targetTemperature; //endSync } }
[ "sultanalmutairi@172.20.10.2" ]
sultanalmutairi@172.20.10.2
f94ae8a3fd9e187c4f78d416150217d70373d3e3
b505bc263d08feee1e03ceadc5ef1ba2ee8758ca
/kafka/src/main/java/io/micronaut/configuration/kafka/executor/package-info.java
9886959b36cf73839c5858bd5b58605763fd021e
[ "Apache-2.0" ]
permissive
pollend/micronaut-kafka
364432cb4b4512b6d87a47c66bfacbb4aef85ab5
a1384c097f4d41a7d62c4f2614e047f99e9e369f
refs/heads/master
2022-05-13T11:27:03.533918
2020-01-29T07:25:29
2020-01-29T07:25:29
237,121,181
0
0
Apache-2.0
2020-01-30T02:01:32
2020-01-30T02:01:32
null
UTF-8
Java
false
false
775
java
/* * Copyright 2017-2019 original authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Classes related to configuring the thread pool to run Kafka consumers. * * @author graemerocher * @since 1.0 */ package io.micronaut.configuration.kafka.executor;
[ "graeme.rocher@gmail.com" ]
graeme.rocher@gmail.com
6c0d74eeda0ed934361e71c4088338ec6063ef4e
ecb7e109a62f6a2a130e3320ed1fb580ba4fc2de
/aio-service/src/main/java/com/viettel/passport/CheckExistUser.java
290a898e49045c2e339f38881697ccdda1de302c
[]
no_license
nisheeth84/prjs_sample
df732bc1eb58bc4fd4da6e76e6d59a2e81f53204
3fb10823ca4c0eb3cd92bcd2d5d4abc8d59436d9
refs/heads/master
2022-12-25T22:44:14.767803
2020-10-07T14:55:52
2020-10-07T14:55:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,847
java
package com.viettel.passport; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for checkExistUser complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="checkExistUser"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="userName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="actor" type="{http://passport.viettel.com/}actor" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "checkExistUser", propOrder = { "userName", "actor" }) public class CheckExistUser { protected String userName; protected Actor actor; /** * Gets the value of the userName property. * * @return possible object is * {@link String } */ public String getUserName() { return userName; } /** * Sets the value of the userName property. * * @param value allowed object is * {@link String } */ public void setUserName(String value) { this.userName = value; } /** * Gets the value of the actor property. * * @return possible object is * {@link Actor } */ public Actor getActor() { return actor; } /** * Sets the value of the actor property. * * @param value allowed object is * {@link Actor } */ public void setActor(Actor value) { this.actor = value; } }
[ "phamkhachoabk@gmail.com" ]
phamkhachoabk@gmail.com
96cce97b7610b84327ab10fb350d7525158ffbb3
1358072379743cb0abdc61d6c4cc9de3afbd3889
/mobileTravel/src/main/java/com/cmcc/hyapps/andyou/model/CompoundImageEx.java
39f7e7f0fbe19009de67b312b7993f9cf71c52fb
[]
no_license
gaoruishan/APP_v1.0
6263d300c0789546c9def4cdda5c1136933a13e4
81d9639b3bcbc7e20192f9df677fb907ebc30a8f
refs/heads/master
2021-04-12T07:49:14.849539
2016-07-22T06:29:38
2016-07-22T06:29:38
63,929,088
2
1
null
null
null
null
UTF-8
Java
false
false
1,572
java
package com.cmcc.hyapps.andyou.model; import android.os.Parcel; import android.os.Parcelable; import com.google.gson.annotations.SerializedName; public class CompoundImageEx extends CompoundImage { @SerializedName("large_h") public int largeH; @SerializedName("large_w") public int largeW; @SerializedName("small_h") public int smallH; @SerializedName("small_w") public int smallW; public CompoundImageEx() { super(); } public static final Parcelable.Creator<CompoundImageEx> CREATOR = new Parcelable.Creator<CompoundImageEx>() { public CompoundImageEx createFromParcel(Parcel in) { return new CompoundImageEx(in); } public CompoundImageEx[] newArray(int size) { return new CompoundImageEx[size]; } }; public CompoundImageEx(Parcel in) { super(in); this.largeH = in.readInt(); this.largeW = in.readInt(); this.smallH = in.readInt(); this.smallW = in.readInt(); } @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel dest, int flags) { super.writeToParcel(dest, flags); dest.writeInt(this.largeH); dest.writeInt(this.largeW); dest.writeInt(this.smallH); dest.writeInt(this.smallW); } public float getLargeRadio() { return (largeH == 0) ? 1f : 1f * largeW / largeH; } public float getSmallRadio() { return (smallH == 0) ? 1f : 1f * smallW / smallH; } }
[ "grs0515@163.com" ]
grs0515@163.com
e69ba22fb8bd25846eb29d2cd82d00d29afb3fa0
40665051fadf3fb75e5a8f655362126c1a2a3af6
/ibinti-bugvm/9a622a22940730131f5757b9bdbb79e87f725d9a/5156/DH.java
d887d64f7efcaf36bfb8833335887c0f3ad906d0
[]
no_license
fermadeiral/StyleErrors
6f44379207e8490ba618365c54bdfef554fc4fde
d1a6149d9526eb757cf053bc971dbd92b2bfcdf1
refs/heads/master
2020-07-15T12:55:10.564494
2019-10-24T02:30:45
2019-10-24T02:30:45
205,546,543
2
0
null
null
null
null
UTF-8
Java
false
false
1,926
java
package com.android.org.bouncycastle.jcajce.provider.asymmetric; import com.android.org.bouncycastle.jcajce.provider.config.ConfigurableProvider; import com.android.org.bouncycastle.jcajce.provider.util.AsymmetricAlgorithmProvider; public class DH { private static final String PREFIX = "com.android.org.bouncycastle.jcajce.provider.asymmetric" + ".dh."; public static class Mappings extends AsymmetricAlgorithmProvider { public Mappings() { } public void configure(ConfigurableProvider provider) { provider.addAlgorithm("KeyPairGenerator.DH", PREFIX + "KeyPairGeneratorSpi"); provider.addAlgorithm("Alg.Alias.KeyPairGenerator.DIFFIEHELLMAN", "DH"); provider.addAlgorithm("KeyAgreement.DH", PREFIX + "KeyAgreementSpi"); provider.addAlgorithm("Alg.Alias.KeyAgreement.DIFFIEHELLMAN", "DH"); provider.addAlgorithm("KeyFactory.DH", PREFIX + "KeyFactorySpi"); provider.addAlgorithm("Alg.Alias.KeyFactory.DIFFIEHELLMAN", "DH"); provider.addAlgorithm("AlgorithmParameters.DH", PREFIX + "AlgorithmParametersSpi"); provider.addAlgorithm("Alg.Alias.AlgorithmParameters.DIFFIEHELLMAN", "DH"); provider.addAlgorithm("Alg.Alias.AlgorithmParameterGenerator.DIFFIEHELLMAN", "DH"); provider.addAlgorithm("AlgorithmParameterGenerator.DH", PREFIX + "AlgorithmParameterGeneratorSpi"); // BEGIN android-removed // provider.addAlgorithm("Cipher.DHIES", PREFIX + "IESCipher$IES"); // provider.addAlgorithm("Cipher.DHIESwithAES", PREFIX + "IESCipher$IESwithAES"); // provider.addAlgorithm("Cipher.DHIESWITHAES", PREFIX + "IESCipher$IESwithAES"); // provider.addAlgorithm("Cipher.DHIESWITHDESEDE", PREFIX + "IESCipher$IESwithDESede"); // END android-removed } } }
[ "fer.madeiral@gmail.com" ]
fer.madeiral@gmail.com
f679b05c5964503917841834bf7902ef5898aed7
b9bfebe568f1afd9b90f83f3067e2aa1f266a8ee
/Basic/Exception/src/zrc/exception/homework/IllegalArgsException.java
0be086e00504c01217b3c02491d058c1928661cd
[]
no_license
ZrcLeibniz/Java
fa7c737840d33e572e5d8d87951b6ccd609a38af
cfc3119712844dd8856009101575c819874d89f0
refs/heads/master
2023-06-21T01:49:48.132730
2021-07-23T07:07:42
2021-07-23T07:07:42
267,491,828
0
0
null
2020-10-13T02:18:30
2020-05-28T04:20:10
Java
UTF-8
Java
false
false
212
java
package zrc.exception.homework; public class IllegalArgsException extends Exception { public IllegalArgsException() { } public IllegalArgsException(String message) { super(message); } }
[ "2834511920@qq.com" ]
2834511920@qq.com
3bd5716719ad9a3854c621e0ec0da4acbd7d8cb3
9b7dec08a72088c1e8ce518ea28e95810561d1f3
/lwh-seckill/src/test/java/org/seckill/service/SeckillServiceTest.java
dc262a48a36dd3fdef084e537c915e16eb193570
[]
no_license
LWHTarena/lwh-example
6c9b763bca5a5a1557a14778a13a8cde1ffeb53e
e74096b50e49ea37b913b967cd3272ae13cda632
refs/heads/master
2022-12-21T09:50:27.766898
2021-05-01T08:31:34
2021-05-01T08:31:34
128,957,310
0
0
null
2022-12-16T15:41:55
2018-04-10T15:41:01
Java
UTF-8
Java
false
false
3,218
java
package org.seckill.service; import org.junit.Test; import org.junit.runner.RunWith; import org.seckill.dto.Exposer; import org.seckill.dto.SeckillExecution; import org.seckill.entity.Seckill; import org.seckill.exception.RepeatKillException; import org.seckill.exception.SeckillCloseException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import java.util.List; /** * Created by joryun on 2017/4/18. */ @RunWith(SpringJUnit4ClassRunner.class) //告诉junit spring的配置文件 @ContextConfiguration({"classpath:spring/spring-dao.xml", "classpath:spring/spring-service.xml"}) public class SeckillServiceTest { private final Logger logger = LoggerFactory.getLogger(this.getClass()); @Autowired private SeckillService seckillService; @Test public void getSeckillList() throws Exception { List<Seckill> list = seckillService.getSeckillList(); logger.info("list={}", list); // System.out.println(list); } @Test public void getById() throws Exception { long id = 1000L; Seckill seckill = seckillService.getById(id); logger.info("seckill={}", seckill); } /* 注意:集成测试覆盖的完备性: (1)商品未开启或者已结束,测试 (2)商品秒杀时间已开启,测试 (3)商品重复秒杀,测试 将两个单元测试块合并到一起测试: 首先展示接口秒杀地址,当开启时执行秒杀,未开启则报出warn。且try catch包裹后允许重复执行!!! */ @Test public void exportSeckillLogic() throws Exception { long id = 1001L; Exposer exposer = seckillService.exportSeckillUrl(id); if (exposer.isExposed()){ logger.info("exposer={}", exposer); // long id = 1000L; long phone = 10086100862L; // String md5 = "784bb0a7963b3bf3cfc2fb3fdede630e"; String md5 = exposer.getMd5(); try { SeckillExecution execution = seckillService.executeSeckill(id, phone, md5); logger.info("result={}", execution); } catch (RepeatKillException e){ logger.error(e.getMessage()); } catch (SeckillCloseException e){ logger.error(e.getMessage()); } } else { //秒杀未开启 logger.warn("exposer={}", exposer); } } // @Test // public void executeSeckill() throws Exception { // // /* // 重复执行异常: // org.seckill.exception.RepeatKillException: seckill repeated // */ // /* // result=SeckillExecution{ // seckillId=1000, // state=1, // stateInfo='秒杀成功', // successKilled=SuccessKilled{ // seckillId=1000, // userPhone=10086100862, // state=0, // createTime=Sun Apr 23 10:31:00 CST 2017 // } // } // */ // } }
[ "lwhtarena@163.com" ]
lwhtarena@163.com
60ef8d822951c84bed3a86775d41207dc86cd088
51b7aa8ca8dedd69039d17959701bec7cd99a4c1
/annotations/src/main/java/software/amazon/awssdk/annotation/SdkInternalApi.java
4b23c88f00c4d347513c248545ac19bb357aaaa3
[ "Apache-2.0" ]
permissive
MatteCarra/aws-sdk-java-v2
41d711ced0943fbd6b5a709e50f78b6564b5ed21
af9fb86db6715b1dbea79028aa353292559d5876
refs/heads/master
2021-06-30T05:21:08.988292
2017-09-18T15:33:38
2017-09-18T15:33:38
103,685,332
0
1
null
2017-09-15T17:45:50
2017-09-15T17:45:50
null
UTF-8
Java
false
false
1,205
java
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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 software.amazon.awssdk.annotation; import java.lang.annotation.ElementType; import java.lang.annotation.Target; /** * Marker interface for 'internal' APIs that should not be used outside the core module. Breaking * changes can and will be introduced to elements marked as {@link SdkInternalApi}. Users of the SDK * and the generated clients themselves should not depend on any packages, types, fields, * constructors, or methods with this annotation. */ @Target({ElementType.PACKAGE, ElementType.TYPE, ElementType.FIELD, ElementType.CONSTRUCTOR, ElementType.METHOD}) public @interface SdkInternalApi { }
[ "millem@amazon.com" ]
millem@amazon.com
efb9e2c68dc328da044177c1b9ea820d2d51f5d6
eab084584e34ec065cd115139c346180e651c1c2
/src/main/java/v1/t1000/T1051.java
1b81e8117bf5f04d1cfa1dece9a2bcc3287b5a6e
[]
no_license
zhouyuan93/leetcode
5396bd3a01ed0f127553e1e175bb1f725d1c7919
cc247bc990ad4d5aa802fc7a18a38dd46ed40a7b
refs/heads/master
2023-05-11T19:11:09.322348
2023-05-05T09:12:53
2023-05-05T09:12:53
197,735,845
0
0
null
2020-04-05T09:17:34
2019-07-19T08:38:17
Java
UTF-8
Java
false
false
394
java
package v1.t1000; import java.util.Arrays; public class T1051 { public int heightChecker(int[] heights) { int[] sort = Arrays.copyOf(heights, heights.length); Arrays.sort(sort); int count = 0; for (int i = 0; i < heights.length; i++) { if (heights[i] != sort[i]) { count++; } } return count; } }
[ "492407250@qq.com" ]
492407250@qq.com
d8c5d10be94198fb320f219aa3f23fb77ddd225a
ce7332852b8ed2e787cf7cd0142829f3695d9b1f
/zoomImageLib/src/main/java/com/ycbjie/zoomimagelib/anim/MaskAnimator.java
ecf4795a83e353baba7ffc74a27e1e6c12ed69ca
[ "Apache-2.0" ]
permissive
zktzktzkt/YCZoomImage
f659a5a9dd113c20d01c8f434d0db4c13bdc5bb9
1e0d8fbd87c151adf04194cc320011dc96bf031f
refs/heads/master
2020-06-06T06:55:22.653858
2019-04-11T01:56:35
2019-04-11T01:56:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,198
java
package com.ycbjie.zoomimagelib.anim; import android.animation.ValueAnimator; import android.graphics.RectF; import com.ycbjie.zoomimagelib.view.ZoomImageView; /** * <pre> * @author yangchong * blog : https://github.com/yangchong211 * time : 2017/09/12 * desc : mask变换动画 * revise: * </pre> */ public class MaskAnimator extends ValueAnimator implements ValueAnimator.AnimatorUpdateListener { /* * mask变换动画 * 将mask从一个rect动画到另外一个rect */ /** * 开始mask */ private float[] mStart = new float[4]; /** * 结束mask */ private float[] mEnd = new float[4]; /** * 中间结果mask */ private float[] mResult = new float[4]; /** * 矩形遮罩 */ private RectF mMask; private ZoomImageView view; /** * 创建mask变换动画 * * @param start 动画起始状态 * @param end 动画终点状态 * @param duration 动画持续时间 */ public MaskAnimator(RectF start, RectF end, long duration , ZoomImageView view) { super(); this.mMask = start; this.view = view; setFloatValues(0, 1f); setDuration(duration); addUpdateListener(this); //将起点终点拷贝到数组方便计算 mStart[0] = start.left; mStart[1] = start.top; mStart[2] = start.right; mStart[3] = start.bottom; mEnd[0] = end.left; mEnd[1] = end.top; mEnd[2] = end.right; mEnd[3] = end.bottom; } @Override public void onAnimationUpdate(ValueAnimator animation) { //获取动画进度,0-1范围 float value = (Float) animation.getAnimatedValue(); //根据进度对起点终点之间做插值 for (int i = 0; i < 4; i++) { mResult[i] = mStart[i] + (mEnd[i] - mStart[i]) * value; } //期间mask有可能被置空了,所以判断一下 if (mMask == null) { mMask = new RectF(); } //设置新的mask并绘制 mMask.set(mResult[0], mResult[1], mResult[2], mResult[3]); view.invalidate(); } }
[ "yangchong211@163.com" ]
yangchong211@163.com
279a7d7dda9a64d9e20dbefe5b92eac8e2d5d3b2
c8dc2dba2fb027017af08efbdc40a4ce13cbb11a
/40_Notifymsg_Demo/41_Account_Service/src/main/java/com/lypgod/demo/dtx/notifymsg/account/feign/RechargeFeignClient.java
8cbf84001198a0b2a7571b4eea2a966aa6aa0b15
[]
no_license
lypgod/DistributedTransactionDemo
927101e7111039cce041b42e1888f33ab783f11b
1d935e92fc651294ed60ab1c7ac16a68a5f792ff
refs/heads/master
2020-08-01T19:47:20.332418
2019-09-27T06:24:15
2019-09-27T06:24:15
211,096,539
0
0
null
null
null
null
UTF-8
Java
false
false
698
java
package com.lypgod.demo.dtx.notifymsg.account.feign; import com.lypgod.demo.dtx.notifymsg.account.model.entity.Recharge; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; /** * @author lypgod */ @FeignClient(value = "notifymsg-demo-recharge", fallback = RechargeFeignClientFallBack.class) public interface RechargeFeignClient { /** * 远程调用充值系统的接口查询充值结果 * * @param txNo String * @return Recharge */ @GetMapping(value = "/recharge/result/{txNo}") Recharge result(@PathVariable("txNo") String txNo); }
[ "lypgod@hotmail.com" ]
lypgod@hotmail.com
7f7371870bbdc166e2d31fcb506187fea276fd7e
6ecba7be3f79f1257d565127b2781d1332e3e0d5
/app/src/main/java/com/example/myapplication/notiy/badgeview/ui/ListViewActivity.java
d54deeda7f747fc87d795f19ca22baf3a86cd903
[]
no_license
yufeilong92/FragemntWithActivity
080cc8a0ac78d63155f4049e1144718dbe8cbb72
806dcc74d63da3aa808dbc96799ff1b0e0cd6229
refs/heads/master
2023-07-26T06:12:06.057163
2021-09-15T11:20:17
2021-09-15T11:20:17
311,527,114
0
0
null
null
null
null
UTF-8
Java
false
false
2,796
java
package com.example.myapplication.notiy.badgeview.ui; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; import androidx.appcompat.app.AppCompatActivity; import com.example.myapplication.R; import com.example.myapplication.notiy.badgeview.Badge; import com.example.myapplication.notiy.badgeview.QBadgeView; import java.util.List; public class ListViewActivity extends AppCompatActivity { ListView listview; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_list_view); listview = (ListView) findViewById(R.id.listview); listview.setAdapter(new ListAdapter()); } class ListAdapter extends BaseAdapter { private List<String> data; public ListAdapter() { data = new DataSupport().getData(); } @Override public int getCount() { return data.size(); } @Override public Object getItem(int position) { return data.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(final int position, View convertView, ViewGroup parent) { Holder holder; if (convertView == null) { holder = new Holder(); convertView = LayoutInflater.from(ListViewActivity.this).inflate(R.layout.item_view, parent, false); holder.textView = (TextView) convertView.findViewById(R.id.tv_content); holder.badge = new QBadgeView(ListViewActivity.this).bindTarget(convertView.findViewById(R.id.imageview)); holder.badge.setBadgeTextSize(12, true); convertView.setTag(holder); } else { holder = (Holder) convertView.getTag(); } holder.textView.setText(data.get(position)); holder.badge.setBadgeNumber(position); holder.badge.setOnDragStateChangedListener(new Badge.OnDragStateChangedListener() { @Override public void onDragStateChanged(int dragState, Badge badge, View targetView) { if (dragState == STATE_SUCCEED) { Toast.makeText(ListViewActivity.this, String.valueOf(position), Toast.LENGTH_SHORT).show(); } } }); return convertView; } class Holder { TextView textView; Badge badge; } } }
[ "931697478@qq.com" ]
931697478@qq.com
859c513fc1ab26647b68b0d64b09ba53480c51d1
fd47891ae0fca3b6307758cfc5688fc012f2bae0
/Session25/src/com/auribises/SetDemo.java
f57772b73e36a02760ec8d0dbe70d205c6a32de8
[]
no_license
ishantk/AuriJava2018July23
d6583ed8b836f5b45c848d1d57e4025f7fd8224c
4b0a1966387a07316dfe944d1f5779af44545e55
refs/heads/master
2020-03-24T06:46:27.792992
2018-09-07T07:07:01
2018-09-07T07:07:01
142,541,431
0
0
null
null
null
null
UTF-8
Java
false
false
1,517
java
package com.auribises; import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; import java.util.TreeSet; public class SetDemo { public static void main(String[] args) { ArrayList<String> list = new ArrayList<String>(); list.add("John"); //0 index list.add("Jennie"); list.add("Jim"); list.add("John"); // duplicated data is allowed in ArrayList list.add("Jack"); list.add("Joe"); //n-1 index System.out.println(list); //HashSet<String> set = new HashSet<String>(); TreeSet<String> set = new TreeSet<String>(); set.add("John"); set.add("Jennie"); set.add("Jim"); set.add("John"); // duplicated data is not allowed in HashSet set.add("Jack"); set.add("Joe"); System.out.println(set); String name = list.get(2); System.out.println("name is: "+name); // we cannot get the element from HashSet as we dont know the index // In HashSet indexing wont work rather Hashing works where we have hashcode for every element // Iterating in HashSet : Read All elements one by one in HashSet System.out.println("****************"); Iterator<String> itr = set.iterator(); while(itr.hasNext()){ String nm = itr.next(); System.out.println(nm); } System.out.println("****************"); System.out.println("Size of set is: "+set.size()); if(set.contains("John")){ System.out.println("John is in the Set"); } set.remove("John"); System.out.println(set); //set.clear(); //System.out.println(set); } }
[ "er.ishant@gmail.com" ]
er.ishant@gmail.com
5b835848f552d80e433da4480f7ad27c613daa97
480175305d7cb4c959c0ad81f64bbe695ee36a2d
/src/main/java/congye6/HotelBooking/po/HotelPO.java
c087ba25572440da19f02472f3c62457097b4e06
[]
no_license
congye6/HotelBooking
2794fd24f4e5895afea7efb794eb53e5d26cfacb
9cb440c66c65a1c98db168de1e472813550f4a6d
refs/heads/master
2021-01-12T06:52:54.874885
2017-02-07T09:16:44
2017-02-07T09:16:44
76,854,733
0
0
null
null
null
null
UTF-8
Java
false
false
1,525
java
package congye6.HotelBooking.po; public class HotelPO { /** * */ private int id; /** * 酒店名称 */ private String name; /** * 地址 */ private String address; /** * 所属城市 */ private String city; /** * 所属商圈 */ private String circle; /** * 简介 */ private String introduction; /** * 酒店星级 */ private int star; public HotelPO() { super(); } public HotelPO(int id, String name, String address, String city, String circle, String introduction, int star) { super(); this.id = id; this.name = name; this.address = address; this.city = city; this.circle = circle; this.introduction = introduction; this.star = star; } public int getId() { return id; } public void setId(int id) { this.id = id; } 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 getCity() { return city; } public void setCity(String city) { this.city = city; } public String getCircle() { return circle; } public void setCircle(String circle) { this.circle = circle; } public String getIntroduction() { return introduction; } public void setIntroduction(String introduction) { this.introduction = introduction; } public int getStar() { return star; } public void setStar(int star) { this.star = star; } }
[ "244053679@qq.com" ]
244053679@qq.com
5a3da5085cf6e3719451b9b12a6fcfc5eed6700b
4d0f2d62d1c156d936d028482561585207fb1e49
/Ma nguon/zcs-8.0.2_GA_5570-src/ZimbraServer/src/java-test/com/zimbra/cs/service/mail/ServiceTestUtil.java
c9d5089fe8d5a5e252052ea37d3621f7bea82e31
[]
no_license
vuhung/06-email-captinh
e3f0ff2e84f1c2bc6bdd6e4167cd7107ec42c0bd
af828ac73fc8096a3cc096806c8080e54d41251f
refs/heads/master
2020-07-08T09:09:19.146159
2013-05-18T12:57:24
2013-05-18T12:57:24
32,319,083
0
2
null
null
null
null
UTF-8
Java
false
false
2,298
java
/* * ***** BEGIN LICENSE BLOCK ***** * Zimbra Collaboration Suite Server * Copyright (C) 2011, 2012 Zimbra, 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 com.zimbra.cs.service.mail; import java.net.URL; import java.util.HashMap; import java.util.Map; import com.zimbra.common.soap.SoapProtocol; import com.zimbra.cs.account.Account; import com.zimbra.cs.account.GuestAccount; import com.zimbra.cs.service.AuthProvider; import com.zimbra.cs.service.MockHttpServletRequest; import com.zimbra.soap.DocumentService; import com.zimbra.soap.MockSoapEngine; import com.zimbra.soap.SoapEngine; import com.zimbra.soap.SoapServlet; import com.zimbra.soap.ZimbraSoapContext; public class ServiceTestUtil { public static Map<String, Object> getRequestContext(Account acct) throws Exception { return getRequestContext(acct, acct); } public static Map<String, Object> getExternalRequestContext(String externalEmail, Account targetAcct) throws Exception { return getRequestContext(new GuestAccount(externalEmail, "password"), targetAcct); } public static Map<String, Object> getRequestContext(Account authAcct, Account targetAcct) throws Exception { return getRequestContext(authAcct, targetAcct, new MailService()); } public static Map<String, Object> getRequestContext(Account authAcct, Account targetAcct, DocumentService service) throws Exception { Map<String, Object> context = new HashMap<String, Object>(); context.put(SoapEngine.ZIMBRA_CONTEXT, new ZimbraSoapContext(AuthProvider.getAuthToken(authAcct), targetAcct.getId(), SoapProtocol.Soap12, SoapProtocol.Soap12)); context.put(SoapServlet.SERVLET_REQUEST, new MockHttpServletRequest("test".getBytes("UTF-8"), new URL("http://localhost:7070/service/FooRequest"), "")); context.put(SoapEngine.ZIMBRA_ENGINE, new MockSoapEngine(service)); return context; } }
[ "vuhung16plus@gmail.com@ec614674-f94a-24a8-de76-55dc00f2b931" ]
vuhung16plus@gmail.com@ec614674-f94a-24a8-de76-55dc00f2b931
0cf7e14ffd77be6c520f2f8f487fd91b25b3fd99
821ed0666d39420d2da9362d090d67915d469cc5
/web/gui/src/main/java/org/onosproject/ui/impl/LinkViewMessageHandler.java
231d2635636e20c2c097a469ccacf9d22f5a00c7
[ "Apache-2.0" ]
permissive
LenkayHuang/Onos-PNC-for-PCEP
03b67dcdd280565169f2543029279750da0c6540
bd7d201aba89a713f5ba6ffb473aacff85e4d38c
refs/heads/master
2021-01-01T05:19:31.547809
2016-04-12T07:25:13
2016-04-12T07:25:13
56,041,394
1
0
null
null
null
null
UTF-8
Java
false
false
5,020
java
/* * Copyright 2015 Open Networking Laboratory * * 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.onosproject.ui.impl; import com.fasterxml.jackson.databind.node.ObjectNode; import com.google.common.collect.ImmutableSet; import org.onosproject.net.Link; import org.onosproject.net.link.LinkService; import org.onosproject.ui.RequestHandler; import org.onosproject.ui.UiMessageHandler; import org.onosproject.ui.topo.BaseLink; import org.onosproject.ui.topo.BaseLinkMap; import org.onosproject.ui.table.TableModel; import org.onosproject.ui.table.TableRequestHandler; import org.onosproject.ui.table.cell.ConnectPointFormatter; import org.onosproject.ui.table.cell.EnumFormatter; import java.util.Collection; /** * Message handler for link view related messages. */ public class LinkViewMessageHandler extends UiMessageHandler { private static final String A_BOTH_B = "A &harr; B"; private static final String A_SINGLE_B = "A &rarr; B"; private static final String SLASH = " / "; private static final String LINK_DATA_REQ = "linkDataRequest"; private static final String LINK_DATA_RESP = "linkDataResponse"; private static final String LINKS = "links"; private static final String ONE = "one"; private static final String TWO = "two"; private static final String TYPE = "type"; private static final String STATE = "_iconid_state"; private static final String DIRECTION = "direction"; private static final String DURABLE = "durable"; private static final String[] COL_IDS = { ONE, TWO, TYPE, STATE, DIRECTION, DURABLE }; private static final String ICON_ID_ONLINE = "active"; private static final String ICON_ID_OFFLINE = "inactive"; @Override protected Collection<RequestHandler> createRequestHandlers() { return ImmutableSet.of(new LinkDataRequest()); } // handler for link table requests private final class LinkDataRequest extends TableRequestHandler { private static final String NO_ROWS_MESSAGE = "No links found"; private LinkDataRequest() { super(LINK_DATA_REQ, LINK_DATA_RESP, LINKS); } @Override protected String[] getColumnIds() { return COL_IDS; } @Override protected String noRowsMessage(ObjectNode payload) { return NO_ROWS_MESSAGE; } @Override protected String defaultColumnId() { return ONE; } @Override protected TableModel createTableModel() { TableModel tm = super.createTableModel(); tm.setFormatter(ONE, ConnectPointFormatter.INSTANCE); tm.setFormatter(TWO, ConnectPointFormatter.INSTANCE); tm.setFormatter(TYPE, EnumFormatter.INSTANCE); return tm; } @Override protected void populateTable(TableModel tm, ObjectNode payload) { LinkService ls = get(LinkService.class); BaseLinkMap linkMap = new BaseLinkMap(); ls.getLinks().forEach(linkMap::add); linkMap.biLinks().forEach(blink -> populateRow(tm.addRow(), blink)); } private void populateRow(TableModel.Row row, BaseLink blink) { row.cell(ONE, blink.one().src()) .cell(TWO, blink.one().dst()) .cell(TYPE, linkType(blink)) .cell(STATE, linkState(blink)) .cell(DIRECTION, linkDir(blink)) .cell(DURABLE, blink.one().isDurable()); } private String linkType(BaseLink link) { StringBuilder sb = new StringBuilder(); sb.append(link.one().type()); if (link.two() != null && link.two().type() != link.one().type()) { sb.append(SLASH).append(link.two().type()); } return sb.toString(); } private String linkState(BaseLink link) { if (link.one() == null || link.two() == null) { return ICON_ID_OFFLINE; } return (link.one().state() == Link.State.ACTIVE || link.two().state() == Link.State.ACTIVE) ? ICON_ID_ONLINE : ICON_ID_OFFLINE; } private String linkDir(BaseLink link) { return link.two() != null ? A_BOTH_B : A_SINGLE_B; } } }
[ "826080529@qq.com" ]
826080529@qq.com
1def652ebc23dc7e32971d2805b5a33ff29bc7b0
2efce0a208bbf13942e9e8205da44ecfc4055e58
/SalesManagementSys/src/cn/ccsu/service/impl/AdminServiceImpl.java
62377ec1b534f0e14a1afb67066f58861cf34f10
[]
no_license
ZanderYan-cloud/MyProject
8226c7f64469eb98df64b3c5e05c5e96601ad71d
11a451ae3f7bbe03e7ac710fe7c7eee2d1881fe7
refs/heads/master
2021-09-15T11:41:33.401772
2018-05-31T12:59:29
2018-05-31T12:59:29
104,723,868
1
0
null
null
null
null
UTF-8
Java
false
false
662
java
package cn.ccsu.service.impl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import cn.ccsu.mapper.AdminMapper; import cn.ccsu.service.IAdminService; /** * @author Bill * */ @Service public class AdminServiceImpl implements IAdminService { public AdminServiceImpl() { } @Autowired private AdminMapper mapper; @Override public boolean validateIdentify(String acc, String passwd) { System.out.println("passwd:"+passwd+" acc:"+acc); System.out.println("admin:"+mapper.selectAdm(acc, passwd)); if (mapper.selectAdm(acc, passwd) != null) { return true; } return false; } }
[ "913010012@qq.com" ]
913010012@qq.com
f8a56f4c4b9ef5d31fbed269678ec80ec79e8ff4
f63be396d0e0a81fc7e14318cf91bf7b40eebe92
/collections/src/main/java/com/epam/deltix/util/collections/HCMultiMap.java
f659e1806189897f2ca13e6dac746ab89084d3c0
[ "Apache-2.0" ]
permissive
joshuaulrich/TimeBaseCommons
448c1c7ae3ada5b2cc9b703a9d1a757c7d4d4ead
36bc25216222939aaa3d19852a81983a7bf8062f
refs/heads/main
2023-06-08T09:45:23.456968
2021-06-29T09:21:18
2021-06-29T09:21:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,217
java
/* * Copyright 2021 EPAM Systems, Inc * * See the NOTICE file distributed with this work for additional information * regarding copyright ownership. Licensed under the Apache License, * Version 2.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package com.epam.deltix.util.collections; import java.util.*; /** * HashMap or Collections. */ public class HCMultiMap <K, V> implements MultiMap <K, V> { private final HashMap <K, Collection <V>> map = new HashMap <K, Collection <V>> (); public void clear () { map.clear (); } public Collection <V> get (K key) { return (map.get (key)); } /** * Factory method for new collections. * Default implementation creates an ArrayList. * Override to modify this behavior; for example, to create HasSets. * * @return New collection for holding values corresponding to a single key. */ public Collection <V> newCollection () { return (new ArrayList <V> ()); } public Collection <V> put (K key, V value) { Collection <V> a = map.get (key); if (a == null) { a = newCollection (); map.put (key, a); } a.add (value); return (a); } public Collection <V> remove (K key) { return (map.remove (key)); } @Override public boolean isEmpty() { return map.isEmpty(); } @Override public int size() { return map.size(); } @Override public Set<K> keySet() { return map.keySet(); } @Override public Collection<Collection<V>> values() { return map.values(); } }
[ "akarpovich@deltixlab.com" ]
akarpovich@deltixlab.com
3537ef85df1ca9374168d1493bf9d283f6e4f472
ae5eb1a38b4d22c82dfd67c86db73592094edc4b
/project3/src/main/java/org/gradle/test/performance/largejavamultiproject/project3/p18/Production360.java
4c37e45315f2af5c6f2e986f85fa70c97551d6ab
[]
no_license
big-guy/largeJavaMultiProject
405cc7f55301e1fd87cee5878a165ec5d4a071aa
1cd6a3f9c59e9b13dffa35ad27d911114f253c33
refs/heads/main
2023-03-17T10:59:53.226128
2021-03-04T01:01:39
2021-03-04T01:01:39
344,307,977
0
0
null
null
null
null
UTF-8
Java
false
false
2,203
java
package org.gradle.test.performance.largejavamultiproject.project3.p18; import org.gradle.test.performance.largejavamultiproject.project3.p17.Production357; import org.gradle.test.performance.largejavamultiproject.project3.p17.Production358; import org.gradle.test.performance.largejavamultiproject.project3.p17.Production359; public class Production360 { private Production357 property0; public Production357 getProperty0() { return property0; } public void setProperty0(Production357 value) { property0 = value; } private Production358 property1; public Production358 getProperty1() { return property1; } public void setProperty1(Production358 value) { property1 = value; } private Production359 property2; public Production359 getProperty2() { return property2; } public void setProperty2(Production359 value) { property2 = value; } private String property3; public String getProperty3() { return property3; } public void setProperty3(String value) { property3 = value; } private String property4; public String getProperty4() { return property4; } public void setProperty4(String value) { property4 = value; } private String property5; public String getProperty5() { return property5; } public void setProperty5(String value) { property5 = value; } private String property6; public String getProperty6() { return property6; } public void setProperty6(String value) { property6 = value; } private String property7; public String getProperty7() { return property7; } public void setProperty7(String value) { property7 = value; } private String property8; public String getProperty8() { return property8; } public void setProperty8(String value) { property8 = value; } private String property9; public String getProperty9() { return property9; } public void setProperty9(String value) { property9 = value; } }
[ "sterling.greene@gmail.com" ]
sterling.greene@gmail.com
2e0379e11648309e94ce2d81485c6461650930e1
f3b9a444d2d513c670d216f7c700131410c47f92
/game_analyze/src/com/gamecenter/alipay/domain/KbAdvertMissionSubject.java
444da07f5d6ffc7138a0d199589b9636e3b0e350
[]
no_license
kuainiao/GameAdminWeb
6a372087380e3c5ad98fc7cf4c8cbf9f01854e5d
f89327374d39c112421606e6a9fe9189b46c1a90
refs/heads/master
2020-06-03T22:15:02.944948
2017-12-22T06:20:38
2017-12-22T06:20:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,446
java
package com.gamecenter.alipay.domain; import java.util.List; import com.gamecenter.alipay.AlipayObject; import com.gamecenter.alipay.internal.mapping.ApiField; import com.gamecenter.alipay.internal.mapping.ApiListField; /** * 分佣任务的标的信息 * * @author auto create * @since 1.0, 2017-01-13 11:53:39 */ public class KbAdvertMissionSubject extends AlipayObject { private static final long serialVersionUID = 1242927863972494698L; /** * 分佣条款信息 */ @ApiListField("commission_clause_list") @ApiField("kb_advert_commission_clause") private List<KbAdvertCommissionClause> commissionClauseList; /** * 标的对象的业务ID,如果标的为商品,则subject_biz_id为商品ID */ @ApiField("subject_biz_id") private String subjectBizId; /** * 标的类型 voucher-券 */ @ApiField("subject_type") private String subjectType; public List<KbAdvertCommissionClause> getCommissionClauseList() { return this.commissionClauseList; } public void setCommissionClauseList(List<KbAdvertCommissionClause> commissionClauseList) { this.commissionClauseList = commissionClauseList; } public String getSubjectBizId() { return this.subjectBizId; } public void setSubjectBizId(String subjectBizId) { this.subjectBizId = subjectBizId; } public String getSubjectType() { return this.subjectType; } public void setSubjectType(String subjectType) { this.subjectType = subjectType; } }
[ "lyh@163.com" ]
lyh@163.com
1f93f9c7b9be61cced695cfa0d54fef2d2949782
e51d2ea898e1631cb81c44392a53a3b8644a4c54
/app/src/main/java/com/iceboy/destinedchat/utils/HttpUtils.java
6624b96303302fb0c6d55bc865994c2130199c65
[]
no_license
hncboy/DestinedChat
449c6ef58b42d98f39e700846458b53a0dba50ae
6ca6ea0ad41d991e81bf942dcd7c2a6fb9eeb2b4
refs/heads/master
2020-03-19T13:27:26.773702
2018-06-25T11:55:57
2018-06-25T11:55:57
136,580,312
4
0
null
null
null
null
UTF-8
Java
false
false
696
java
package com.iceboy.destinedchat.utils; import okhttp3.OkHttpClient; import okhttp3.Request; /** * Created by hncboy on 2018/6/17. * 处理和服务器的交互 */ public class HttpUtils { /** * 传入请求地址和回调接口 * * @param address * @param callback */ public static void sendOkHttpRequest(String address, okhttp3.Callback callback) { OkHttpClient client = new OkHttpClient(); //创建一个OkHttpClient实例 Request request = new Request.Builder().url(address).build(); //创建一个Request对象用于发起http请求 client.newCall(request).enqueue(callback); //注册一个回调处理服务器的响应 } }
[ "619452863@qq.com" ]
619452863@qq.com
1fe21ab8975523752d71cb9ffe76e3bfbce1792d
0af8b92686a58eb0b64e319b22411432aca7a8f3
/single-large-project/src/test/java/org/gradle/test/performancenull_93/Testnull_9224.java
7706da4dd48293f49cef4cb1ff82dbf15cff454c
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
304
java
package org.gradle.test.performancenull_93; import static org.junit.Assert.*; public class Testnull_9224 { private final Productionnull_9224 production = new Productionnull_9224("value"); @org.junit.Test public void test() { assertEquals(production.getProperty(), "value"); } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
98b3a2bf91f4e748d1c52b99fe71fb25c9a4b452
da1cb92616cc7e876bceb2a5e9593e815d4399b8
/app/src/com/shushan/thomework101/HttpHelper/service/presenter/GoAcceptPresenter.java
013b9634703599100cf26579dad1a8b6dd343e1b
[]
no_license
nimingangle520/thomework101
ad6d6be17c5c1e657bcc6fd00950c43e53d83337
508024cec1841c5a8eae75e1f573aa66f1a378c7
refs/heads/master
2020-04-05T07:03:55.327309
2018-11-10T08:52:32
2018-11-10T08:52:32
150,107,769
0
0
null
null
null
null
UTF-8
Java
false
false
2,939
java
package com.shushan.thomework101.HttpHelper.service.presenter; import android.content.Context; import android.content.Intent; import com.google.gson.Gson; import com.shushan.thomework101.HttpHelper.service.entity.orders.GoAccept; import com.shushan.thomework101.HttpHelper.service.manager.DataManager; import com.shushan.thomework101.HttpHelper.service.view.GoAcceptView; import com.shushan.thomework101.HttpHelper.service.view.View; import com.shushan.thomework101.utils.LogUtils; import com.shushan.thomework101.utils.Utils; import java.io.IOException; import okhttp3.ResponseBody; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; import rx.subscriptions.CompositeSubscription; public class GoAcceptPresenter implements Presenter{ private DataManager manager; private CompositeSubscription mCompositeSubscription; private Context mContext; private GoAcceptView goAcceptView; private GoAccept mGoAccept; public GoAcceptPresenter(Context mContext){ this.mContext = mContext; } @Override public void onCreate(String baseUrl) { manager = new DataManager(mContext,baseUrl); mCompositeSubscription = new CompositeSubscription(); } @Override public void onStart() { } @Override public void onStop() { if (mCompositeSubscription.hasSubscriptions()){ mCompositeSubscription.unsubscribe(); } } @Override public void pause() { } @Override public void attachView(View view) { goAcceptView = (GoAcceptView) view; } @Override public void attachIncomingIntent(Intent intent) { } public void getGoAcceptMsg(String tid,String token,String jobid) { manager.getGoAcceptMsg(tid,token,jobid).enqueue(new Callback<ResponseBody>() { @Override public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) { try { if (response.body() != null) { String str = response.body().string().trim(); String newStr = Utils.UStr_2_Str(str); LogUtils.d(newStr); Gson gson = new Gson(); mGoAccept = gson.fromJson(newStr, GoAccept.class); if (goAcceptView != null) { goAcceptView.onSuccess(mGoAccept); } } else { LogUtils.d("is null"); } } catch (IOException e) { e.printStackTrace(); } } @Override public void onFailure(Call<ResponseBody> call, Throwable t) { t.printStackTrace(); LogUtils.e(t.getMessage()); goAcceptView.onError(t.getMessage()); } }); } }
[ "nimingangle520@gmail.com" ]
nimingangle520@gmail.com
4dbfc3de79f4577f3f3bc057fe6c59c894519a85
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/4/4_1b45501e38aef72eeecef1ae29ca1d95eb4547c5/NominalItem/4_1b45501e38aef72eeecef1ae29ca1d95eb4547c5_NominalItem_s.java
2fa55a25f60e2175146be2d9c16fd42f19fa57cb
[]
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,505
java
/* * Encog(tm) Core v3.0 - Java Version * http://www.heatonresearch.com/encog/ * http://code.google.com/p/encog-java/ * Copyright 2008-2011 Heaton Research, 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. * * For more information on Heaton Research copyrights, licenses * and trademarks visit: * http://www.heatonresearch.com/copyright */ package org.encog.util.normalize.output.nominal; import java.io.Serializable; import org.encog.util.normalize.input.InputField; /** * A nominal item. */ public class NominalItem implements Serializable { /** * The low value for the range. */ private double low; /** * The high value for the range. */ private double high; /** * The input field used to verify against the range. */ private InputField inputField; /** * Construct a empty range item. Used mainly for reflection. */ public NominalItem() { } /** * Create a nominal item. * @param inputField The field that this item is based on. * @param high The high value. * @param low The low value. */ public NominalItem(final InputField inputField, final double high, final double low) { super(); this.high = high; this.low = low; this.inputField = inputField; } /** * Begin a row. */ public void beginRow() { } /** * @return the high */ public double getHigh() { return this.high; } /** * @return the inputField */ public InputField getInputField() { return this.inputField; } /** * @return the low */ public double getLow() { return this.low; } /** * @return True if this item is within range. */ public boolean isInRange() { final double currentValue = this.inputField.getCurrentValue(); return ((currentValue >= this.low) && (currentValue <= this.high)); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
95f8adca91c94787eba408414ee9b42ca24508e9
dc976bb0317da49c8d5a343d7e1ea04cfd57ab08
/src/com/java/design/mode/factory/pattern/section4/WhiteHuman.java
e4ee6d3d0e571d4e27b8dbd498750fa844ea90f0
[]
no_license
zyzhangyuan88/Java_mode
e6aced2c6d3ba7fb5f01364429e61fa25de0e8e9
a23114af24c4a4db72097a09b99d31d5892baed6
refs/heads/master
2020-06-14T08:21:03.730447
2019-07-03T01:18:18
2019-07-03T01:18:18
194,957,273
0
0
null
null
null
null
UTF-8
Java
false
false
480
java
package com.java.design.mode.factory.pattern.section4; /** * @author cbf4Life cbf4life@126.com * I'm glad to share my knowledge with you all. * 白色人人种 */ public class WhiteHuman implements Human { //白色人种的颜色是白色的 public void getColor(){ System.out.println("白色人种的皮肤颜色是白色的!"); } //白色人种讲话 public void talk() { System.out.println("白色人种会说话,一般都是但是单字节。"); } }
[ "472918259@qq.com" ]
472918259@qq.com
ea504d1ece0cf3a26c802bc38e700dd3f8dc972d
d9fae1f02ed067d39ebea423cacd48bbaedd4ebc
/src/main/java/org/elasticsearch/common/langdetect/LangProfile.java
3ff3c58066721a1ec63b8eae0c3e53424e1506dd
[ "Apache-2.0" ]
permissive
poom/elasticsearch-langdetect
476b1d9d5fe025b30f7d23f6a366b315ba4f1a51
56959ea861d9ea8f292f25181c452b71ed80f06c
refs/heads/master
2021-01-15T16:18:05.175808
2012-11-23T00:56:29
2012-11-23T00:56:29
11,333,110
0
0
Apache-2.0
2023-09-14T18:52:57
2013-07-11T05:01:57
Java
UTF-8
Java
false
false
2,904
java
/* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.elasticsearch.common.langdetect; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Set; public class LangProfile { private static final int MINIMUM_FREQ = 2; private static final int LESS_FREQ_RATIO = 100000; public String name = null; public Map<String, Integer> freq = new HashMap(); public int[] n_words = new int[NGram.N_GRAM]; public LangProfile() { } public LangProfile(String name) { this.name = name; } public void add(String gram) { if (name == null || gram == null) { return; } int len = gram.length(); if (len < 1 || len > NGram.N_GRAM) { return; } ++n_words[len - 1]; if (freq.containsKey(gram)) { freq.put(gram, freq.get(gram) + 1); } else { freq.put(gram, 1); } } public void omitLessFreq() { if (name == null) { return; } int threshold = n_words[0] / LESS_FREQ_RATIO; if (threshold < MINIMUM_FREQ) { threshold = MINIMUM_FREQ; } Set<String> keys = freq.keySet(); int roman = 0; for (Iterator<String> i = keys.iterator(); i.hasNext();) { String key = i.next(); int count = freq.get(key); if (count <= threshold) { n_words[key.length() - 1] -= count; i.remove(); } else { if (key.matches("^[A-Za-z]$")) { roman += count; } } } if (roman < n_words[0] / 3) { Set<String> keys2 = freq.keySet(); for (Iterator<String> i = keys2.iterator(); i.hasNext();) { String key = i.next(); if (key.matches(".*[A-Za-z].*")) { n_words[key.length() - 1] -= freq.get(key); i.remove(); } } } } }
[ "joergprante@gmail.com" ]
joergprante@gmail.com
19b36d7f1f5e2b8a509a1db068079a70fab74cca
b3c5ce59df3f6a0a2d639d6f57f91bad71814c1c
/mytracks/MyTracks/src/com/google/android/apps/mytracks/io/backup/PreferenceBackupHelper.java
4a3cc273860550b617ea2eb80a974026ad4bfa5b
[]
no_license
umranium/LiveMonitor-Mirror
8d22c6f6b513ff37002c2fcd751718b767c1220f
eda9a1e966431fd19fce60a703694a9599eaf192
refs/heads/master
2021-01-20T06:59:44.804410
2012-07-03T03:25:15
2012-07-03T03:25:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,986
java
/* * 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 com.google.android.apps.mytracks.io.backup; import com.google.android.apps.mytracks.content.ContentTypeIds; import com.google.android.apps.mytracks.util.ApiFeatures; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import java.util.Map; /** * Helper for backing up and restoring shared preferences. * * @author Rodrigo Damazio */ class PreferenceBackupHelper { private static final int BUFFER_SIZE = 2048; /** * Exports all shared preferences from the given object as a byte array. * * @param preferences the preferences to export * @return the corresponding byte array * @throws IOException if there are any errors while writing to the byte array */ public byte[] exportPreferences(SharedPreferences preferences) throws IOException { ByteArrayOutputStream bufStream = new ByteArrayOutputStream(BUFFER_SIZE); DataOutputStream outWriter = new DataOutputStream(bufStream); exportPreferences(preferences, outWriter); return bufStream.toByteArray(); } /** * Exports all shared preferences from the given object into the given output * stream. * * @param preferences the preferences to export * @param outWriter the stream to write them to * @throws IOException if there are any errors while writing the output */ public void exportPreferences( SharedPreferences preferences, DataOutputStream outWriter) throws IOException { Map<String, ?> values = preferences.getAll(); outWriter.writeInt(values.size()); for (Map.Entry<String, ?> entry : values.entrySet()) { writePreference(entry.getKey(), entry.getValue(), outWriter); } outWriter.flush(); } /** * Imports all preferences from the given byte array. * * @param data the byte array to read preferences from * @param preferences the shared preferences to edit * @throws IOException if there are any errors while reading */ public void importPreferences(byte[] data, SharedPreferences preferences) throws IOException { ByteArrayInputStream bufStream = new ByteArrayInputStream(data); DataInputStream reader = new DataInputStream(bufStream); importPreferences(reader, preferences); } /** * Imports all preferences from the given stream. * * @param reader the stream to read from * @param preferences the shared preferences to edit * @throws IOException if there are any errors while reading */ public void importPreferences(DataInputStream reader, SharedPreferences preferences) throws IOException { Editor editor = preferences.edit(); editor.clear(); int numPreferences = reader.readInt(); for (int i = 0; i < numPreferences; i++) { String name = reader.readUTF(); byte typeId = reader.readByte(); readAndSetPreference(name, typeId, reader, editor); } ApiFeatures.getInstance().getApiAdapter().applyPreferenceChanges(editor); } /** * Reads a single preference and sets it into the given editor. * * @param name the name of the preference to read * @param typeId the type ID of the preference to read * @param reader the reader to read from * @param editor the editor to set the preference in * @throws IOException if there are errors while reading */ private void readAndSetPreference(String name, byte typeId, DataInputStream reader, Editor editor) throws IOException { switch (typeId) { case ContentTypeIds.BOOLEAN_TYPE_ID: editor.putBoolean(name, reader.readBoolean()); return; case ContentTypeIds.LONG_TYPE_ID: editor.putLong(name, reader.readLong()); return; case ContentTypeIds.FLOAT_TYPE_ID: editor.putFloat(name, reader.readFloat()); return; case ContentTypeIds.INT_TYPE_ID: editor.putInt(name, reader.readInt()); return; case ContentTypeIds.STRING_TYPE_ID: editor.putString(name, reader.readUTF()); return; } } /** * Writes a single preference. * * @param name the name of the preference to write * @param value the correctly-typed value of the preference * @param writer the writer to write to * @throws IOException if there are errors while writing */ private void writePreference(String name, Object value, DataOutputStream writer) throws IOException { writer.writeUTF(name); if (value instanceof Boolean) { writer.writeByte(ContentTypeIds.BOOLEAN_TYPE_ID); writer.writeBoolean((Boolean) value); } else if (value instanceof Integer) { writer.writeByte(ContentTypeIds.INT_TYPE_ID); writer.writeInt((Integer) value); } else if (value instanceof Long) { writer.writeByte(ContentTypeIds.LONG_TYPE_ID); writer.writeLong((Long) value); } else if (value instanceof Float) { writer.writeByte(ContentTypeIds.FLOAT_TYPE_ID); writer.writeFloat((Float) value); } else if (value instanceof String) { writer.writeByte(ContentTypeIds.STRING_TYPE_ID); writer.writeUTF((String) value); } else { throw new IllegalArgumentException( "Type " + value.getClass().getName() + " not supported"); } } }
[ "abd01c@.nexus.csiro.au" ]
abd01c@.nexus.csiro.au
adb356c8e71a0d12c6f4f842a6dc86666484d886
2e590ef886718e01d7ec58beff00a28d7aa9a366
/source-code/java/hibernate/src/gov/nasa/kepler/hibernate/dbservice/KeplerHibernateConfiguration.java
16a02049fc55579cdc047fd380670ac4fb1c9dc7
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
adam-sweet/kepler-pipeline
95a6cbc03dd39a8289b090fb85cdfc1eb5011fd9
f58b21df2c82969d8bd3e26a269bd7f5b9a770e1
refs/heads/master
2022-06-07T21:22:33.110291
2020-05-06T01:12:08
2020-05-06T01:12:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,869
java
/* * Copyright 2017 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. * All Rights Reserved. * * This file is available under the terms of the NASA Open Source Agreement * (NOSA). You should have received a copy of this agreement with the * Kepler source code; see the file NASA-OPEN-SOURCE-AGREEMENT.doc. * * No Warranty: THE SUBJECT SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY * WARRANTY OF ANY KIND, EITHER EXPRESSED, IMPLIED, OR STATUTORY, * INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY THAT THE SUBJECT SOFTWARE * WILL CONFORM TO SPECIFICATIONS, ANY IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR FREEDOM FROM * INFRINGEMENT, ANY WARRANTY THAT THE SUBJECT SOFTWARE WILL BE ERROR * FREE, OR ANY WARRANTY THAT DOCUMENTATION, IF PROVIDED, WILL CONFORM * TO THE SUBJECT SOFTWARE. THIS AGREEMENT DOES NOT, IN ANY MANNER, * CONSTITUTE AN ENDORSEMENT BY GOVERNMENT AGENCY OR ANY PRIOR RECIPIENT * OF ANY RESULTS, RESULTING DESIGNS, HARDWARE, SOFTWARE PRODUCTS OR ANY * OTHER APPLICATIONS RESULTING FROM USE OF THE SUBJECT SOFTWARE. * FURTHER, GOVERNMENT AGENCY DISCLAIMS ALL WARRANTIES AND LIABILITIES * REGARDING THIRD-PARTY SOFTWARE, IF PRESENT IN THE ORIGINAL SOFTWARE, * AND DISTRIBUTES IT "AS IS." * * Waiver and Indemnity: RECIPIENT AGREES TO WAIVE ANY AND ALL CLAIMS * AGAINST THE UNITED STATES GOVERNMENT, ITS CONTRACTORS AND * SUBCONTRACTORS, AS WELL AS ANY PRIOR RECIPIENT. IF RECIPIENT'S USE OF * THE SUBJECT SOFTWARE RESULTS IN ANY LIABILITIES, DEMANDS, DAMAGES, * EXPENSES OR LOSSES ARISING FROM SUCH USE, INCLUDING ANY DAMAGES FROM * PRODUCTS BASED ON, OR RESULTING FROM, RECIPIENT'S USE OF THE SUBJECT * SOFTWARE, RECIPIENT SHALL INDEMNIFY AND HOLD HARMLESS THE UNITED * STATES GOVERNMENT, ITS CONTRACTORS AND SUBCONTRACTORS, AS WELL AS ANY * PRIOR RECIPIENT, TO THE EXTENT PERMITTED BY LAW. RECIPIENT'S SOLE * REMEDY FOR ANY SUCH MATTER SHALL BE THE IMMEDIATE, UNILATERAL * TERMINATION OF THIS AGREEMENT. */ package gov.nasa.kepler.hibernate.dbservice; import gov.nasa.spiffy.common.pi.PipelineException; import java.util.Iterator; import java.util.Properties; import java.util.Set; import org.apache.commons.configuration.Configuration; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.hibernate.cfg.AnnotationConfiguration; /** * This class contructs a Hibernate @{link AnnotatedConfiguration} object. * * It uses {@link AnnotatedPojoList} to scan the class path for annotated * classes and adds them to the configuration. * * It also copies all properties that are prefixed with "hibernate." from the * configuration service (kepler.properties or system properties) to the * Hibernate @{link AnnotatedConfiguration} object. * * This class is used by the {@link HibernateDatabaseService} to initialize the * {@link DatabaseService}. It is also used by the various ant tasks that * create the schema (schema-oracle, schema-hsqldb, etc.) * * @author Todd Klaus tklaus@arc.nasa.gov * */ public class KeplerHibernateConfiguration { private static final Log log = LogFactory.getLog(KeplerHibernateConfiguration.class); public static final String HIBERNATE_CONNECTION_URL_PROP = "hibernate.connection.url"; public static final String HIBERNATE_CONNECTION_USERNAME_PROP = "hibernate.connection.username"; public static final String HIBERNATE_CONNECTION_PASSWORD_PROP = "hibernate.connection.password"; private static final String KEPLER_SOC_HIBERNATE_PACKAGE_NAME_OVERRIDE_PROP = "kepler.hibernate.config.package"; private static final String KEPLER_SOC_HIBERNATE_PACKAGE_NAME = "gov.nasa.kepler.hibernate"; private static final String KEPLER_SOC_HIBERNATE_JAR_NAME = "hibernate.jar"; private static final String KEPLER_SOC_CLASSPATH_JAR_NAME = "soc-classpath.jar"; /** * Private to prevent instantiation. Static method only */ private KeplerHibernateConfiguration() { } /** * Build a {@link AnnotationConfiguration} instance using Kepler-specific * resources. * * @return * @throws PipelineException */ public static AnnotationConfiguration buildHibernateConfiguration() { return buildHibernateConfiguration(null); } /** * Build a {@link AnnotationConfiguration} instance using Kepler-specific * resources. * * @return * @throws PipelineException */ public static AnnotationConfiguration buildHibernateConfiguration( Properties hibernateProperties) { Configuration keplerConfig = ConfigurationServiceFactory.getInstance(); log.info("Initializing Hibernate"); AnnotationConfiguration hibernateConfig = new AnnotationConfiguration(); hibernateConfig.setNamingStrategy(KeplerNamingStrategy.INSTANCE); /* * Copy hibernate-related properties from the props source to the * Hibernate configuration */ if (hibernateProperties != null) { /* Use the Properties passed in */ for (Object okey : hibernateProperties.keySet()) { String key = (String) okey; String value = hibernateProperties.getProperty(key); if (value != null) { log.debug("copying property, key=" + key + ", value=" + value); hibernateConfig.setProperty(key, value); } else { throw new PipelineException("Property values must not be null, key=" + key); } } } else { /* * get the props from the from the ConfigurationService * (kepler.properties or system props) */ for (Iterator<?> iter = keplerConfig.getKeys("hibernate"); iter.hasNext();) { String key = (String) iter.next(); String value = keplerConfig.getString(key); log.debug("copying property, key=" + key + ", value=" + value); hibernateConfig.setProperty(key, value); } } log.info("Database URL: " + hibernateConfig.getProperty(HIBERNATE_CONNECTION_URL_PROP)); log.info("Database User: " + hibernateConfig.getProperty(HIBERNATE_CONNECTION_USERNAME_PROP)); AnnotatedPojoList annotatedPojoList = new AnnotatedPojoList(); String packageFilterOverride = System.getProperty(KEPLER_SOC_HIBERNATE_PACKAGE_NAME_OVERRIDE_PROP); if (packageFilterOverride != null) { annotatedPojoList.getPackageFilters().add(packageFilterOverride); } else { annotatedPojoList.getPackageFilters().add( KEPLER_SOC_HIBERNATE_PACKAGE_NAME); } annotatedPojoList.getJarFilters().add(KEPLER_SOC_HIBERNATE_JAR_NAME); annotatedPojoList.getJarFilters().add(KEPLER_SOC_CLASSPATH_JAR_NAME); Set<Class<?>> detectedClasses; try { log.info("Scanning for annotated POJOs"); detectedClasses = annotatedPojoList.scanForClasses(); } catch (Exception e) { throw new PipelineException( "failed to auto-scan for annotated classes, caught e = " + e, e); } log.info("Adding " + detectedClasses.size() + " annotated POJOs to Hibernate"); for (Class<?> clazz : detectedClasses) { hibernateConfig.addAnnotatedClass(clazz); } // Include Hibernate configuration that can't be handled by annotations. // Also uncomment associated line in copy-metadata build.xml target. // hibernateConfig.addResource("hbm.cfg.xml"); // hibernateConfig.addResource("orm.xml"); return hibernateConfig; } }
[ "Bill.Wohler@nasa.gov" ]
Bill.Wohler@nasa.gov
fbede400fb2765f214174dc0f977299b33517af9
1061216c2c33c1ed4ffb33e6211565575957e48f
/java-undertow-server/src/main/java/org/openapitools/model/EmojiReactionBaseAllOf.java
a11615a3326709778ce8d95a278d85a3c00f3db3
[]
no_license
MSurfer20/test2
be9532f54839e8f58b60a8e4587348c2810ecdb9
13b35d72f33302fa532aea189e8f532272f1f799
refs/heads/main
2023-07-03T04:19:57.548080
2021-08-11T19:16:42
2021-08-11T19:16:42
393,920,506
0
0
null
null
null
null
UTF-8
Java
false
false
2,726
java
/* * Zulip REST API * * Powerful open source group chat * * OpenAPI document version: 1.0.0 * * * AUTO-GENERATED FILE, DO NOT MODIFY! */ package org.openapitools.model; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.EmojiReactionBaseAllOfUser; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaUndertowServerCodegen") public class EmojiReactionBaseAllOf { private Integer userId; private EmojiReactionBaseAllOfUser user; /** * The ID of the user who added the reaction. **Changes**: New in Zulip 3.0 (feature level 2). The `user` object is deprecated and will be removed in the future. */ public EmojiReactionBaseAllOf userId(Integer userId) { this.userId = userId; return this; } @ApiModelProperty(value = "The ID of the user who added the reaction. **Changes**: New in Zulip 3.0 (feature level 2). The `user` object is deprecated and will be removed in the future. ") @JsonProperty("user_id") public Integer getUserId() { return userId; } public void setUserId(Integer userId) { this.userId = userId; } /** */ public EmojiReactionBaseAllOf user(EmojiReactionBaseAllOfUser user) { this.user = user; return this; } @ApiModelProperty(value = "") @JsonProperty("user") public EmojiReactionBaseAllOfUser getUser() { return user; } public void setUser(EmojiReactionBaseAllOfUser user) { this.user = user; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } EmojiReactionBaseAllOf emojiReactionBaseAllOf = (EmojiReactionBaseAllOf) o; return Objects.equals(userId, emojiReactionBaseAllOf.userId) && Objects.equals(user, emojiReactionBaseAllOf.user); } @Override public int hashCode() { return Objects.hash(userId, user); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class EmojiReactionBaseAllOf {\n"); sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); sb.append(" user: ").append(toIndentedString(user)).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(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
[ "suyash.mathur@research.iiit.ac.in" ]
suyash.mathur@research.iiit.ac.in
df350298c934e1df4ee0f55f8ffc1b2681c3bd49
4168b1d8b44ea61cab5144ce2c0968ac7fa08149
/src/main/java/com/qiangdong/reader/response/user/ListUserPreferTypeResponse.java
a54846fdec34426e0d6879ca83661715c53ddced
[ "Apache-2.0" ]
permissive
Vivian-miao/qiangdongserver
2a841f0a964c92cbfe73d4eb98f0c2888e542fff
0c16fec01b369d5491b8239860f291732db38f2e
refs/heads/master
2023-04-25T07:21:57.354176
2021-05-20T04:16:51
2021-05-20T04:16:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
673
java
package com.qiangdong.reader.response.user; import com.qiangdong.reader.dto.UserPreferTypeDto; import com.qiangdong.reader.entity.Type; import com.qiangdong.reader.entity.UserPreferType; import java.util.List; /** * @author Fyf */ public class ListUserPreferTypeResponse { List<Type> allType; List<UserPreferTypeDto> userPreferType; public List<Type> getAllType() { return allType; } public void setAllType(List<Type> allType) { this.allType = allType; } public List<UserPreferTypeDto> getUserPreferType() { return userPreferType; } public void setUserPreferType(List<UserPreferTypeDto> userPreferType) { this.userPreferType = userPreferType; } }
[ "a857681664@gmail.com" ]
a857681664@gmail.com
4e58c315b9f223f27b47fb066420f25cfc1d85bc
66c0968f6783c266c00941a88f977db62b9439a4
/stylar/src/main/java/com/zeoflow/stylar/codestyle/annotations/Modify.java
09a15813dce5b21470f4bdb0e78ad0d85146a4c3
[ "Apache-2.0" ]
permissive
emilovidiubaba/stylar
b6e3998be491d4782dc21abfbbc99b0cba91b0ec
ac05a11b1e872edfd6c8af700eee241facf45e96
refs/heads/main
2023-04-05T07:36:11.340790
2021-04-21T07:50:32
2021-04-21T07:50:32
360,414,804
0
0
Apache-2.0
2021-04-22T06:30:17
2021-04-22T06:27:49
null
UTF-8
Java
false
false
325
java
package com.zeoflow.stylar.codestyle.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Retention(RetentionPolicy.SOURCE) @Target(ElementType.TYPE) public @interface Modify { String[] value(); }
[ "grigor.teodor@gmail.com" ]
grigor.teodor@gmail.com
02cc1fc96b9be91d0ae103d68ba0f6f4c30c0efc
5b8337c39cea735e3817ee6f6e6e4a0115c7487c
/sources/com/wdullaer/materialdatetimepicker/AccessibleLinearLayout.java
1dcb0877e2cb52fcdda9428bfb507168199b9fa8
[]
no_license
karthik990/G_Farm_Application
0a096d334b33800e7d8b4b4c850c45b8b005ccb1
53d1cc82199f23517af599f5329aa4289067f4aa
refs/heads/master
2022-12-05T06:48:10.513509
2020-08-10T14:46:48
2020-08-10T14:46:48
286,496,946
1
0
null
null
null
null
UTF-8
Java
false
false
945
java
package com.wdullaer.materialdatetimepicker; import android.content.Context; import android.util.AttributeSet; import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityNodeInfo; import android.widget.Button; import android.widget.LinearLayout; public class AccessibleLinearLayout extends LinearLayout { public AccessibleLinearLayout(Context context, AttributeSet attributeSet) { super(context, attributeSet); } public void onInitializeAccessibilityEvent(AccessibilityEvent accessibilityEvent) { super.onInitializeAccessibilityEvent(accessibilityEvent); accessibilityEvent.setClassName(Button.class.getName()); } public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo accessibilityNodeInfo) { super.onInitializeAccessibilityNodeInfo(accessibilityNodeInfo); accessibilityNodeInfo.setClassName(Button.class.getName()); } }
[ "knag88@gmail.com" ]
knag88@gmail.com
d5777cbc42a2d0bb1df8c13abfdfdb57d44c3e8c
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/4/4_385d15a3176a7423e1391bf555071d6e1c71e1b5/Device/4_385d15a3176a7423e1391bf555071d6e1c71e1b5_Device_t.java
6ee88231bc43085dac7dd3cbde722571679994b3
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
4,184
java
/* * Copyright 2010 Daniel Kurka * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package de.kurka.phonegap.client.device; /** * The Device class represents the Device from the phonegap API: * * http://docs.phonegap.com/phonegap_device_device.md.html * * @author Daniel Kurka * */ public class Device { public native boolean isAvailable() /*-{ if(!(typeof($wnd.device) == "undefined")) { return true; } return false; }-*/; /** * Get the device's model name. * * device.name returns the name of the device's model or product. This value * is set by the device manufacturer and may be different across versions of * the same product. * * <h1>Supported Platforms</h1> * * <ul> * <li>Android</li> * <li>BlackBerry</li> * <li>BlackBerry Widgets (OS 5.0 and higher)</li> * <li>iPhone</li> * </ul> * * * <h1>Android Quirks</h1> * * <ul> * <li>Gets the product name instead of the model name. * <ul><li>The product name is often the code name given during production.</li> * <li>e.g. Nexus One returns "Passion", Motorola Droid returns "voles"</li></ul> * </li> * </ul> * * * <h1>iPhone Quirks</h1> * * <ul> * <li>Gets the device's custom name instead of the device model name. * <ul><li>The custom name is set by the owner in iTunes.</li> * <li>e.g. "Joe's iPhone"</li> * </ul> * </li> * </ul> * * * @return the models device name */ public native String getName()/*-{ return $wnd.device.name; }-*/; /** * Get the version of phonegap running on the device. * * <h1>Supported Platforms:</h1> * <ul> * <li>Android</li> * <li>BlackBerry</li> * <li>BlackBerry Widgets (OS 5.0 and higher)</li> * <li>iPhone</li> * <ul> * * @return the version of phonegap running on the device */ public native String getPhoneGapVersion()/*-{ return $wnd.device.phonegap; }-*/; /** * Get the device's operating system name. * * <h1>Supported Platforms:</h1> * <ul> * <li>Android</li> * <li>BlackBerry</li> * <li>BlackBerry Widgets (OS 5.0 and higher)</li> * <li>iPhone</li> * <ul> * * <h1>iPhone Quirks</h1> * All devices return iPhone as the platform. This is inaccurate because Apple has rebranded the iPhone operating system as iOS. * * <h1>BlackBerry Quirks</h1> * * Devices may return the device platform version instead of the platform name. For example, the Storm2 9550 would return '2.13.0.95' or similar. * * @return the device's operating system name */ public native String getPlatform()/*-{ return $wnd.device.platform; }-*/; /** * Get the device's Universally Unique Identifier (UUID). * * The details of how a UUID is generated are determined by the device * manufacturer and specific to the device's platform or model. * * <h1>Supported Platforms</h1> * * <ul> * <li>Android</li> * <li>BlackBerry</li> * <li>BlackBerry Widgets (OS 5.0 and higher)</li> * <li>iPhone</li> * </ul> * * @return the uuid of the device as a String */ public native String getUuid()/*-{ return $wnd.device.uuid; }-*/; /** * Get the operating system version. * * <h1>Supported Platforms</h1> * * <ul> * <li>Android</li> * <li>BlackBerry</li> * <li>BlackBerry Widgets (OS 5.0 and higher)</li> * <li>iPhone</li> * </ul> * * @return the device's operating system version */ public native String getVersion()/*-{ return $wnd.device.version; }-*/; }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
221a198d7fbf7cf82ab4641d71321a9cb813fc92
4ca1ee4b61510e5c1002f5039ff123ec487c6dd1
/appng-core/src/main/java/org/appng/core/controller/filter/ResponseWrapper.java
42b850cf8fed6ed40f5df446c86a9e384d4d2211
[ "Apache-2.0" ]
permissive
appNG/appng
014f417f83e30e65a75f503393373b119f285277
98a4874cdae6b74986d53ffd3773027523adb914
refs/heads/appng-1.26.x
2023-09-01T03:37:15.040991
2023-08-29T09:43:16
2023-08-29T09:43:16
95,534,270
39
18
Apache-2.0
2023-09-12T21:12:17
2017-06-27T08:13:25
Java
UTF-8
Java
false
false
1,863
java
/* * Copyright 2011-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.appng.core.controller.filter; import java.io.CharArrayWriter; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponseWrapper; import org.appng.core.model.ResponseType; class ResponseWrapper extends HttpServletResponseWrapper implements HttpServletResponse { private CharArrayWriter buffer; private ResponseType responseType; private PrintWriter printWriter; public ResponseWrapper(HttpServletResponse response) { super(response); } @Override public ServletOutputStream getOutputStream() throws IOException { if (null == responseType) { responseType = ResponseType.BINARY; } return super.getOutputStream(); } @Override public PrintWriter getWriter() throws IOException { if (null == printWriter) { responseType = ResponseType.CHARACTER; buffer = new CharArrayWriter(); printWriter = new PrintWriter(buffer); } return printWriter; } public String getContent() { buffer.flush(); return buffer.toString(); } public ResponseType getResponseType() { return responseType; } public boolean hasResponse() { return (null != responseType); } }
[ "matthias.mueller@appng.org" ]
matthias.mueller@appng.org
cd23a12365128168ab9b2485b6d021dfa73a83a4
d3a564a8cfb38bd2114b4e8d46807f8986dfd3ac
/app/src/main/java/com/mp3song/playmusic/NowPlayingActivity.java
694b9016bd2f64fcd572d97f3cda12391f4c4033
[]
no_license
MeghaPatel2022/Music-Player-2
4ab0e6a35a78b77f53ade72a5283aa183dd820a5
cc77a0ab4ea99224bbf97042fc15fa1b2a7e4190
refs/heads/master
2023-08-30T02:40:07.453871
2021-10-12T11:48:12
2021-10-12T11:48:12
416,313,103
0
0
null
null
null
null
UTF-8
Java
false
false
3,086
java
package com.mp3song.playmusic; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.provider.MediaStore; import android.util.Log; import androidx.annotation.Nullable; import androidx.databinding.DataBindingUtil; import androidx.fragment.app.FragmentTransaction; import com.mp3song.playmusic.databinding.ActivityNowPlayingBinding; import com.mp3song.playmusic.service.MusicPlayerRemote; import com.mp3song.playmusic.service.MusicService; import com.mp3song.playmusic.ui.MusicServiceActivity; import com.mp3song.playmusic.ui.fragments.NowPlayingFragment; public class NowPlayingActivity extends MusicServiceActivity { private static final String TAG = NowPlayingActivity.class.getSimpleName(); private ActivityNowPlayingBinding nowPlayingBinding; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); nowPlayingBinding = DataBindingUtil.setContentView(NowPlayingActivity.this, R.layout.activity_now_playing); final FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); transaction.replace(R.id.mainLayout, NowPlayingFragment.newInstance()); transaction.commit(); } @Override public void onServiceConnected() { super.onServiceConnected(); nowPlayingBinding.appRoot.post(() -> handlePlaybackIntent(getIntent())); } private void handlePlaybackIntent(@Nullable Intent intent) { if (intent == null) { return; } Uri uri = intent.getData(); String mimeType = intent.getType(); if (mimeType == null) { mimeType = ""; } boolean handled = false; if (intent.getAction() != null && intent.getAction().equals(MediaStore.INTENT_ACTION_MEDIA_PLAY_FROM_SEARCH)) { Log.d(TAG, "handlePlaybackIntent: type media play from search"); handled = true; } if (uri != null && uri.toString().length() > 0) { Log.d(TAG, "handlePlaybackIntent: type play file"); MusicPlayerRemote.playFromUri(uri); handled = true; } else if (MediaStore.Audio.Playlists.CONTENT_TYPE.equals(mimeType)) { Log.d(TAG, "handlePlaybackIntent: type playlist"); handled = true; } else if (MediaStore.Audio.Albums.CONTENT_TYPE.equals(mimeType)) { Log.d(TAG, "handlePlaybackIntent: type album"); handled = true; } else if (MediaStore.Audio.Artists.CONTENT_TYPE.equals(mimeType)) { Log.d(TAG, "handlePlaybackIntent: type artist"); handled = true; } else if (!handled && MusicService.ACTION_ON_CLICK_NOTIFICATION.equals(intent.getAction())) { handled = true; } else if (!handled) { Log.d(TAG, "handlePlaybackIntent: unhandled: " + intent.getAction()); } if (handled) { setIntent(new Intent()); } } @Override public void onBackPressed() { super.onBackPressed(); } }
[ "megha.bpatel2022@gmail.com" ]
megha.bpatel2022@gmail.com
a7a42cb20535b69c804a1f5d6dc3ef1794f63ce7
2869fc39e2e63d994d5dd8876476e473cb8d3986
/Super_finance/src/java/com/lvmama/finance/settlement/ibatis/dao/OrdSettlementChangeDAO.java
3ffad42ee42971fd15c6102d42224f5339167d98
[]
no_license
kavt/feiniu_pet
bec739de7c4e2ee896de50962dbd5fb6f1e28fe9
82963e2e87611442d9b338d96e0343f67262f437
refs/heads/master
2020-12-25T17:45:16.166052
2016-06-13T10:02:42
2016-06-13T10:02:42
61,026,061
0
0
null
2016-06-13T10:02:01
2016-06-13T10:02:01
null
UTF-8
Java
false
false
3,546
java
package com.lvmama.finance.settlement.ibatis.dao; import java.util.HashMap; import java.util.List; import java.util.Map; import org.springframework.stereotype.Repository; import com.lvmama.finance.base.BaseDAO; import com.lvmama.finance.settlement.ibatis.po.OrdSettlementChange; import com.lvmama.finance.settlement.ibatis.vo.SettlementDeduction; /** * 结算单修改记录 * * @author yanggan * */ @Repository @SuppressWarnings({ "rawtypes", "unchecked" }) public class OrdSettlementChangeDAO extends BaseDAO { /** * 新增修改记录 * * @param change * 修改记录 */ public Long insert(OrdSettlementChange change) { return (Long) this.insert("SETTLEMENTCHANGE.insert", change); } /** * 批量新增修改记录 * * @param subSettlementId * 结算子单ID * @param metaProductId * 采购产品ID * @param amount * 金额 * @param userid * 用户ID * @param remark * 修改原因 */ public void insertBatch(Long subSettlementId, Long metaProductId, Double amount, Long userid, String remark) { Map map = new HashMap(); map.put("subSettlementId", subSettlementId); map.put("metaProductId", metaProductId); map.put("amount", amount); map.put("creator", userid); map.put("remark", remark); this.insert("SETTLEMENTCHANGE.insertBatch", map); } /** * 查询结算子单项的修改记录(结算单内) * * @return */ public List<OrdSettlementChange> searchBySettlement(Long settlementId) { return queryForList("SETTLEMENTCHANGE.searchBySettlement", settlementId); } /** * 查询结算子单项的修改记录(结算子单内) * * @return */ public List<OrdSettlementChange> searchBySubSettlement(Long subSettlementId) { return queryForList("SETTLEMENTCHANGE.searchBySubSettlement", subSettlementId); } /** * * 删除结算子单时记录 * * @param ids */ public void insertBatchDel(Long userid, Long subSettlementId) { Map map = new HashMap(); map.put("creator", userid); map.put("subSettlementId", subSettlementId); this.insert("SETTLEMENTCHANGE.insertBatchDelBySubSettlementId", map); } /** * * 删除结算子单项时记录 * * @param ids */ public void insertBatchDel(Long userid, Long[] ids) { Map map = new HashMap(); map.put("creator", userid); map.put("ids", ids); this.insert("SETTLEMENTCHANGE.insertBatchDel", map); } /** * 查询抵扣款信息 * * @param settlementId * 结算单ID */ public Integer searchSettlementDeduction(Long settlementId) { return (Integer) queryForObject("SETTLEMENTCHANGE.searchSettlementDeduction", settlementId); } /** * 查询抵扣款名字 * * @param settlementId * 结算单ID * @return */ public List<SettlementDeduction> searchSettlementDeductionList(Long settlementId) { return queryForList("SETTLEMENTCHANGE.searchSettlementDeductionList", settlementId); } /** * 插入结算单修改记录 * * @param change * 修改记录 */ public Long insertOrdSettlementChange(OrdSettlementChange change) { return (Long)this.insert("SETTLEMENTCHANGE.insertOrdSettlementChange", change); } public OrdSettlementChange searchModifyOrDelChange(Long settlementId){ return (OrdSettlementChange)this.queryForObject("SETTLEMENTCHANGE.searchModifyOrDelChange",settlementId); } }
[ "feiniu7903@163.com" ]
feiniu7903@163.com
1a4a45b82694582f17bad6a4c3882a7f3278306d
8ab3b581022a570e89b30de843d4cc5f671609f3
/src/main/java/com/ebay/soap/eBLBaseComponents/FlatRateInsuranceRangeCodeType.java
b83176f0b6b7aa619e9dc97d2bbb1f6a99d33034
[]
no_license
lespaul361/eBaySDK1027
745198a748e47cf2e9f26719f3a03384e8210901
6c5e0de66b89dbfb859bc34376cd7e0616724358
refs/heads/master
2021-04-26T23:54:52.208637
2018-03-10T07:27:19
2018-03-10T07:27:19
124,628,809
0
1
null
2018-08-03T00:38:05
2018-03-10T06:24:24
Java
UTF-8
Java
false
false
3,523
java
package com.ebay.soap.eBLBaseComponents; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for FlatRateInsuranceRangeCodeType. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * &lt;simpleType name="FlatRateInsuranceRangeCodeType"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}token"> * &lt;enumeration value="FlatRateInsuranceRange1"/> * &lt;enumeration value="FlatRateInsuranceRange2"/> * &lt;enumeration value="FlatRateInsuranceRange3"/> * &lt;enumeration value="FlatRateInsuranceRange4"/> * &lt;enumeration value="FlatRateInsuranceRange5"/> * &lt;enumeration value="FlatRateInsuranceRange6"/> * &lt;enumeration value="CustomCode"/> * &lt;/restriction> * &lt;/simpleType> * </pre> * * Note: Per JAXB standards, underscores are added to separate words in enumerations (e.g., PayPal becomes PAY_PAL). */ @XmlType(name = "FlatRateInsuranceRangeCodeType") @XmlEnum public enum FlatRateInsuranceRangeCodeType { /** * * This enumeration value is used if the cost for flat-rate shipping insurance will range from $0.01 to $9.99. * * */ @XmlEnumValue("FlatRateInsuranceRange1") FLAT_RATE_INSURANCE_RANGE_1("FlatRateInsuranceRange1"), /** * * This enumeration value is used if the cost for flat-rate shipping insurance will range from $10.00 to $49.99. * * */ @XmlEnumValue("FlatRateInsuranceRange2") FLAT_RATE_INSURANCE_RANGE_2("FlatRateInsuranceRange2"), /** * * This enumeration value is used if the cost for flat-rate shipping insurance will range from $50.00 to $99.99. * * */ @XmlEnumValue("FlatRateInsuranceRange3") FLAT_RATE_INSURANCE_RANGE_3("FlatRateInsuranceRange3"), /** * * This enumeration value is used if the cost for flat-rate shipping insurance will range from $100.00 to $199.99. * * */ @XmlEnumValue("FlatRateInsuranceRange4") FLAT_RATE_INSURANCE_RANGE_4("FlatRateInsuranceRange4"), /** * * This enumeration value is used if the cost for flat-rate shipping insurance will range from $200.00 to $299.99. * * */ @XmlEnumValue("FlatRateInsuranceRange5") FLAT_RATE_INSURANCE_RANGE_5("FlatRateInsuranceRange5"), /** * * This enumeration value is used if the cost for flat-rate shipping insurance will be $300.00 or more. * * */ @XmlEnumValue("FlatRateInsuranceRange6") FLAT_RATE_INSURANCE_RANGE_6("FlatRateInsuranceRange6"), /** * * Reserved for internal or future use * * */ @XmlEnumValue("CustomCode") CUSTOM_CODE("CustomCode"); private final String value; FlatRateInsuranceRangeCodeType(String v) { value = v; } public String value() { return value; } public static FlatRateInsuranceRangeCodeType fromValue(String v) { for (FlatRateInsuranceRangeCodeType c: FlatRateInsuranceRangeCodeType.values()) { if (c.value.equals(v)) { return c; } } throw new IllegalArgumentException(v); } }
[ "lespaul36@gmail.com" ]
lespaul36@gmail.com
422507158c2850eabcd14601ae40b2ce85cebbe5
dcb9611a9658a6783cc9fc5535ca1eebee524365
/tddl-optimizer/src/test/java/com/taobao/tddl/optimizer/utils/RangeTest.java
94df192b9eed25d7fa2279cb8b9404ea9013bef3
[ "Apache-2.0" ]
permissive
liuxinglanyue/tddl
22a6575d2aee7052e01c6cd893d74d50b7d769cc
bd8a1d606ad02af0252f37e747983d9cc59f83c9
refs/heads/master
2021-01-17T14:19:03.036606
2014-12-08T06:10:01
2014-12-08T06:10:01
27,700,588
0
1
null
null
null
null
UTF-8
Java
false
false
3,172
java
package com.taobao.tddl.optimizer.utils; import java.util.Arrays; import org.junit.Assert; import org.junit.Test; import com.taobao.tddl.optimizer.core.ASTNodeFactory; import com.taobao.tddl.optimizer.core.expression.IBooleanFilter; import com.taobao.tddl.optimizer.core.expression.IFilter; import com.taobao.tddl.optimizer.core.expression.IFilter.OPERATION; import com.taobao.tddl.optimizer.utils.range.AndRangeProcessor; import com.taobao.tddl.optimizer.utils.range.OrRangeProcessor; /** * @author jianghang 2013-11-13 下午4:57:57 * @since 5.1.0 */ public class RangeTest { private static final String COLUMN = "A"; @Test public void testAnd() { // 1 < A < 10 AndRangeProcessor andProcessor = new AndRangeProcessor(COLUMN); andProcessor.process(filter(COLUMN, 1, OPERATION.GT)); andProcessor.process(filter(COLUMN, 10, OPERATION.LT)); Assert.assertEquals(Arrays.asList(filter(COLUMN, 1, OPERATION.GT), filter(COLUMN, 10, OPERATION.LT)), andProcessor.toFilterList()); // 1 < A <= 10, 2 <= A < 11 andProcessor = new AndRangeProcessor(COLUMN); andProcessor.process(filter(COLUMN, 1, OPERATION.GT)); andProcessor.process(filter(COLUMN, 10, OPERATION.LT_EQ)); andProcessor.process(filter(COLUMN, 2, OPERATION.GT_EQ)); andProcessor.process(filter(COLUMN, 11, OPERATION.LT)); Assert.assertEquals(Arrays.asList(filter(COLUMN, 2, OPERATION.GT_EQ), filter(COLUMN, 10, OPERATION.LT_EQ)), andProcessor.toFilterList()); // 1 < A , A < 0 andProcessor = new AndRangeProcessor(COLUMN); andProcessor.process(filter(COLUMN, 1, OPERATION.GT)); boolean failed = andProcessor.process(filter(COLUMN, 0, OPERATION.LT)); Assert.assertEquals(false, failed); } @Test public void testOr() { // A > 1 or A < 3 OrRangeProcessor orProcessor = new OrRangeProcessor(COLUMN); orProcessor.process(filter(COLUMN, 1, OPERATION.GT)); orProcessor.process(filter(COLUMN, 3, OPERATION.LT)); Assert.assertTrue(orProcessor.toFilterList().isEmpty());// full set // A > 1 or A > 3 orProcessor = new OrRangeProcessor(COLUMN); orProcessor.process(filter(COLUMN, 1, OPERATION.GT)); orProcessor.process(filter(COLUMN, 3, OPERATION.GT_EQ)); Assert.assertEquals(Arrays.asList(Arrays.asList(filter(COLUMN, 1, OPERATION.GT))), orProcessor.toFilterList()); // A > 1 or A = 5 orProcessor = new OrRangeProcessor(COLUMN); orProcessor.process(filter(COLUMN, 1, OPERATION.GT)); orProcessor.process(filter(COLUMN, 0, OPERATION.EQ)); Assert.assertEquals(Arrays.asList(Arrays.asList(filter(COLUMN, 1, OPERATION.GT)), Arrays.asList(filter(COLUMN, 0, OPERATION.EQ))), orProcessor.toFilterList()); } private IFilter filter(Comparable column, Comparable value, OPERATION op) { IBooleanFilter booleanFilter = ASTNodeFactory.getInstance().createBooleanFilter(); booleanFilter.setColumn(column).setValue(value).setOperation(op); return booleanFilter; } }
[ "jianghang115@gmail.com" ]
jianghang115@gmail.com
7379706b146ad0c1ca783eec4935edf96a33f0fd
85a4eb42f4b4463d97fa58dce167538289da8106
/java/tests/com/google/template/soy/internal/util/TopoSortTest.java
05b8c057eefcb9af0fcf2760cd976a9fcda35a16
[ "Apache-2.0" ]
permissive
google/closure-templates
d1a8e9b3eed562ae0562e5fd66dd5b7f8f3eb5b0
e6f96357cddbf5d642012afd322510039880778c
refs/heads/master
2023-08-31T14:43:42.610217
2023-08-30T19:27:02
2023-08-30T19:28:11
18,845,068
641
233
Apache-2.0
2023-09-14T20:09:39
2014-04-16T15:31:58
Java
UTF-8
Java
false
false
2,427
java
/* * Copyright 2021 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.template.soy.internal.util; import static com.google.common.truth.Truth.assertThat; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.List; import java.util.Map; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; /** Tests for {@link TopoSort}. */ @RunWith(JUnit4.class) public final class TopoSortTest { @Test public void testSort() { assertThat( sort( ImmutableMap.<Integer, Iterable<Integer>>builder() .put(1, list(2)) .put(2, list(3)) .put(3, list()) .buildOrThrow())) .containsExactly(3, 2, 1); assertThat( sort( ImmutableMap.<Integer, Iterable<Integer>>builder() .put(1, list(2)) .put(2, list()) .put(3, list()) .buildOrThrow())) .containsExactly(2, 3, 1); assertThat( sort( ImmutableMap.<Integer, Iterable<Integer>>builder() .put(1, list()) .put(2, list(1, 3)) .put(3, list(1)) .buildOrThrow())) .containsExactly(1, 3, 2); } @Test public void testStable() { List<Integer> big = new ArrayList<>(100); for (int i = 0; i < 100; i++) { big.add(i); } assertThat(new TopoSort<Integer>().sort(big, k -> ImmutableList.of())).isEqualTo(big); } private static <T> ImmutableList<T> list(T... items) { return ImmutableList.copyOf(items); } private static <T> ImmutableList<T> sort(Map<T, Iterable<T>> data) { return new TopoSort<T>().sort(data.keySet(), data::get); } }
[ "copybara-worker@google.com" ]
copybara-worker@google.com
41ee1e2a78f286940dc70bffb6e17ccc8183d855
43eb759f66530923dfe1c6e191ec4f350c097bd9
/projects/checkstyle/src/test/resources/com/puppycrawl/tools/checkstyle/checks/coding/finallocalvariable/InputFinalLocalVariableBreak.java
30d3d5c4021c7330acc1411da9b2753369e36d22
[ "MIT", "Apache-2.0", "LGPL-2.1-only" ]
permissive
hayasam/lightweight-effectiveness
fe4bd04f8816c6554e35c8c9fc8489c11fc8ce0b
f6ef4c98b8f572a86e42252686995b771e655f80
refs/heads/master
2023-08-17T01:51:46.351933
2020-09-03T07:38:35
2020-09-03T07:38:35
298,672,257
0
0
MIT
2023-09-08T15:33:03
2020-09-25T20:23:43
null
UTF-8
Java
false
false
1,114
java
package com.puppycrawl.tools.checkstyle.checks.coding.finallocalvariable; public class InputFinalLocalVariableBreak { void foo1() throws Exception { Exception e; // violation final int a = (int) Math.random(); final int b = (int) Math.random(); switch (a) { case 0: e = new Exception(); break; case 1: if (b == 0) { e = new Exception(); break; } if (b == 1) { e = new Exception(); } else { e = new Exception(); } break; case 2: if (b == 0) { return; } e = new Exception(); break; default: e = new Exception(); break; } throw e; } int foo2() { int a; if (true) { a = 1; } else { a = 2; if (a == 3) { return a; } a = 4; } return a; } }
[ "granogiovanni90@gmail.com" ]
granogiovanni90@gmail.com
78bfb21566bb974c43b174100d96479fedfdb319
76dbcbd8d527f41f325bb96eeb525818bf1089cd
/app/src/main/java/com/mhandharbeni/e_angkot/model/Profile.java
984990d667ee75886feaddd8b35f0cbb6ef58b4f
[]
no_license
handharbeni/EAngkot
0a7586483f8a44b54dfe4acbd0e2d1a567b03673
3f07e171d9f3625763c2cc5561364a43016e3dd5
refs/heads/master
2021-07-01T21:28:54.530383
2020-11-03T04:56:16
2020-11-03T04:56:16
190,622,340
0
0
null
2020-11-03T04:56:17
2019-06-06T17:28:25
Java
UTF-8
Java
false
false
1,529
java
package com.mhandharbeni.e_angkot.model; import com.mhandharbeni.e_angkot.utils.Constant; public class Profile { public String id; public String nama; public String alamat; public String imageProfile; public String nomorHp; public Constant.TypeUser typeUser; public Profile() { } public Profile(String id, String nama, String alamat, String imageProfile, String nomorHp, Constant.TypeUser typeUser) { this.id = id; this.nama = nama; this.alamat = alamat; this.imageProfile = imageProfile; this.nomorHp = nomorHp; this.typeUser = typeUser; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getNama() { return nama; } public void setNama(String nama) { this.nama = nama; } public String getAlamat() { return alamat; } public void setAlamat(String alamat) { this.alamat = alamat; } public String getImageProfile() { return imageProfile; } public void setImageProfile(String imageProfile) { this.imageProfile = imageProfile; } public String getNomorHp() { return nomorHp; } public void setNomorHp(String nomorHp) { this.nomorHp = nomorHp; } public Constant.TypeUser getTypeUser() { return typeUser; } public void setTypeUser(Constant.TypeUser typeUser) { this.typeUser = typeUser; } }
[ "mhandharbeni@gmail.com" ]
mhandharbeni@gmail.com
7abcf4cb3a919c5759bc4f7c78df4ee94407d5ba
27f5457d47aaf3491f0d64032247adc08efba867
/vertx-pin/zero-rbac/src/main/modulat/io/vertx/mod/rbac/atom/acl/AclItem.java
5e78dd1733d862bfdc8b51520b455b3182558a10
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
silentbalanceyh/vertx-zero
e73d22f4213263933683e4ebe87982ba68803878
1ede4c3596f491d5251eefaaaedc56947ef784cd
refs/heads/master
2023-06-11T23:10:29.241769
2023-06-08T16:15:33
2023-06-08T16:15:33
108,104,586
348
71
Apache-2.0
2020-04-10T02:15:18
2017-10-24T09:21:56
HTML
UTF-8
Java
false
false
733
java
package io.vertx.mod.rbac.atom.acl; import io.vertx.core.json.JsonObject; /** * @author <a href="http://www.origin-x.cn">Lang</a> */ public class AclItem extends AbstractAcl { private final boolean access; public AclItem(final String field, final boolean view, final boolean access) { super(field, view); this.access = access; } public AclItem(final String field, final JsonObject input) { /* * Default access, true * Default readonly, false */ this(field, input.getBoolean("visible", Boolean.TRUE), input.getBoolean("view", Boolean.FALSE) ); } @Override public boolean isAccess() { return this.access; } }
[ "silentbalanceyh@126.com" ]
silentbalanceyh@126.com
d23c574342bd93b0e4e9a07af82839f08ecc7a57
2c6e2ba03eb71ca45fe690ff6e4586f6e2fa0f17
/material/apks/banco/sources/ar/com/santander/rio/mbanking/services/soap/beans/GetProximasCuotasResponseBean.java
b84abd3ce6b4c4a29721de2a09d1fb96b3466420
[]
no_license
lcrcastor/curso-mobile-2019
3088a196139b3e980ed6e09797a0bbf5efb6440b
7585fccb6437a17c841772c1d9fb0701d6c68042
refs/heads/master
2023-04-06T21:46:32.333236
2020-10-30T19:47:54
2020-10-30T19:47:54
308,680,747
0
1
null
2023-03-26T06:57:57
2020-10-30T16:08:31
Java
UTF-8
Java
false
false
1,981
java
package ar.com.santander.rio.mbanking.services.soap.beans; import ar.com.santander.rio.mbanking.services.soap.beans.body.GetProximasCuotasBodyResponseBean; import ar.com.santander.rio.mbanking.services.soap.beans.header.HeaderBean; import ar.com.santander.rio.mbanking.services.soap.beans.header.PrivateHeaderBean; import com.google.gson.annotations.SerializedName; import com.indra.httpclient.beans.IBeanErroWS; import com.indra.httpclient.beans.IBeanWS; import com.indra.httpclient.json.JSONObject; public class GetProximasCuotasResponseBean implements IBeanErroWS, IBeanWS { @SerializedName("header") public HeaderBean headerBean; @SerializedName("body") public GetProximasCuotasBodyResponseBean mGetProximasCuotasBodyResponseBean; public void setJsonElement(JSONObject jSONObject) { } public GetProximasCuotasResponseBean(PrivateHeaderBean privateHeaderBean, GetProximasCuotasBodyResponseBean getProximasCuotasBodyResponseBean) { this.headerBean = privateHeaderBean; this.mGetProximasCuotasBodyResponseBean = getProximasCuotasBodyResponseBean; } public GetProximasCuotasResponseBean() { this.mGetProximasCuotasBodyResponseBean = new GetProximasCuotasBodyResponseBean(); } public Class getClassBean() { return getClass(); } public Object getErrorBeanObject() { return this.mGetProximasCuotasBodyResponseBean; } public GetProximasCuotasBodyResponseBean getGetCategoriasBodyResponseBean() { return this.mGetProximasCuotasBodyResponseBean; } public void setmGetProximasCuotasBodyResponseBean(GetProximasCuotasBodyResponseBean getProximasCuotasBodyResponseBean) { this.mGetProximasCuotasBodyResponseBean = getProximasCuotasBodyResponseBean; } public HeaderBean getHeaderBean() { return this.headerBean; } public void setHeaderBean(PrivateHeaderBean privateHeaderBean) { this.headerBean = privateHeaderBean; } }
[ "luis@MARK-2.local" ]
luis@MARK-2.local
48dccf17ff39bba8ce80011e95ffabcefb981fc6
896cca57024190fc3fbb62f2bd0188fff24b24c8
/2.7.x/choicemaker-cm/choicemaker-common/com.choicemaker.cm.core/src/main/java/com/choicemaker/cm/core/util/EquivalenceClassBuilder.java
34a44dc00b0baf7f7320e85e030144cbe556a3bc
[]
no_license
fgregg/cm
0d4f50f92fde2a0bed465f2bec8eb7f2fad8362c
c0ab489285938f14cdf0a6ed64bbda9ac4d04532
refs/heads/master
2021-01-10T11:27:00.663407
2015-08-11T19:35:00
2015-08-11T19:35:00
55,807,163
0
1
null
null
null
null
UTF-8
Java
false
false
4,439
java
/* * Copyright (c) 2001, 2009 ChoiceMaker Technologies, Inc. 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 * * Contributors: * ChoiceMaker Technologies, Inc. - initial API and implementation */ package com.choicemaker.cm.core.util; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; import java.util.SortedSet; import java.util.TreeSet; import com.choicemaker.util.IntValuedHashMap; /** * @author ajwinkel * */ public class EquivalenceClassBuilder { private Map ecMap; public EquivalenceClassBuilder() { ecMap = new HashMap(); } /** * The equivalence class-building algorithm works as follows. * 1) Throw an Exception if either id is null or they are equal. * 2) Get the existing EquivalenceClasses for each id. * 3) Take ation based on the following four cases: * - Case 1: if both are null, we create a new EquivalenceClass containing * just those two records and add it to the map * - Case 2: if either one is null, just add the dangling id to the existing * equivalence class (changing the identifier of the equivalence * class if necessary) * - Case 3: if the EC's are the same, then we don't need to do anything because * that link is already in the EC * - Case 4: if they are different, then we must combine them, making sure that * there was previously no overlap (indicates a bug elsewhere), and * re-put the new EC value in the ecMap for each of the pairs in the * combined EquivalenceClass. */ public void addLink(Object objId1, Object objId2) { if (objId1 == null || objId2 == null || objId1.equals(objId2)) { throw new IllegalArgumentException(); } EquivalenceClass ec1 = getEquivalenceClass(objId1); EquivalenceClass ec2 = getEquivalenceClass(objId2); if (ec1 == null && ec2 == null) { // Case 1 createNewEquivalenceClass(objId1, objId2); } else if (ec1 == null) { // Case 2 addToEquivalenceClass(objId1, ec2); } else if (ec2 == null) { // Case 2 also addToEquivalenceClass(objId2, ec1); } else if (ec1 == ec2) { // Case 3 // nothing to do. } else { // Case 4 combineEquivalenceClasses(ec1, ec2); } } public SortedSet getEquivalenceClasses() { return new TreeSet( ecMap.values() ); } public Map getIdToEquivalenceClassMap() { Map ret = new HashMap(); for (Iterator it = ecMap.entrySet().iterator(); it.hasNext(); ) { Entry entry = (Entry)it.next(); Object recordId = entry.getKey(); EquivalenceClass ec = (EquivalenceClass) entry.getValue(); Object ecId = ec.getMemberIds().first(); ret.put(recordId, ecId); } return ret; } private EquivalenceClass getEquivalenceClass(Object objId) { return (EquivalenceClass) ecMap.get(objId); } private void createNewEquivalenceClass(Object objId1, Object objId2) { EquivalenceClass ec = new EquivalenceClass(); ec.addMember(objId1); ec.addMember(objId2); ecMap.put(objId1, ec); ecMap.put(objId2, ec); } private void addToEquivalenceClass(Object objId, EquivalenceClass ec) { ec.addMember(objId); ecMap.put(objId, ec); } private void combineEquivalenceClasses(EquivalenceClass ec1, EquivalenceClass ec2) { int preSize = ec1.size() + ec2.size(); EquivalenceClass ec = new EquivalenceClass(); for (Iterator it = ec1.getMemberIds().iterator(); it.hasNext(); ) { Object objId = it.next(); ec.addMember(objId); ecMap.put(objId, ec); } for (Iterator it = ec2.getMemberIds().iterator(); it.hasNext(); ) { Object objId = it.next(); ec.addMember(objId); ecMap.put(objId, ec); } if (preSize != ec.size()) { throw new IllegalStateException("Equivalence classes were not disjoint!"); } } public void printEcSizeHistogram() { IntValuedHashMap histogram = new IntValuedHashMap(); for (Iterator it = getEquivalenceClasses().iterator(); it.hasNext(); ) { EquivalenceClass ec = (EquivalenceClass) it.next(); histogram.increment(new Integer(ec.size())); } SortedSet keys = new TreeSet(histogram.keySet()); for (Iterator it = keys.iterator(); it.hasNext(); ) { Object key = it.next(); System.out.println(key + ":\t\t" + histogram.getInt(key)); } } }
[ "rick@rphall.com" ]
rick@rphall.com
b9b223a4125cfdcbd0e29ce206734ad0e5a960d4
a911f926261b82ec8a2ade2d0af1a973280ceab6
/qipai_dalianmeng/src/main/java/com/anbang/qipai/dalianmeng/msg/sink/GuandanResultSink.java
cd58e700219060acde8b3bf4ad3cf9e6893a20b8
[]
no_license
791837060/qipai_huainanmajiang
31325550c9db1fcb139c6f5a89d84f7deac0e3a2
b4f17b26484bbe2840a0852156117faee9996bbb
refs/heads/master
2023-06-26T22:31:40.822705
2021-07-30T07:20:49
2021-07-30T07:20:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
301
java
package com.anbang.qipai.dalianmeng.msg.sink; import org.springframework.cloud.stream.annotation.Input; import org.springframework.messaging.SubscribableChannel; public interface GuandanResultSink { String GUANDANRESULT = "guandanResult"; @Input SubscribableChannel guandanResult(); }
[ "shony01@163.com" ]
shony01@163.com
b64f0ea456194470a94fe2cc5e9fd9167f8a8740
392402e5a3b31cb6d1c4d0a806bc7e6cd8789545
/src/com/jack/algorithm/problem/easy/LeetCode0977.java
8be46203dc26e4fdd5bc61fb480e9555cdfa0be7
[]
no_license
1139195320/leetcode-study
b1ccec1edf493176c04c918fe47945cc90a42a05
fef300bd46befe5110aac24dfa68ad1c1b0c9a4e
refs/heads/master
2023-01-01T14:09:53.961160
2020-10-28T02:33:10
2020-10-28T02:33:10
296,997,235
0
0
null
null
null
null
UTF-8
Java
false
false
355
java
package com.jack.algorithm.problem.easy; import java.util.Arrays; /** * @author jack */ public class LeetCode0977 { public int[] sortedSquares(int[] arr) { int[] tmp = new int[arr.length]; for (int i = 0; i < arr.length; i++) { tmp[i] = arr[i] * arr[i]; } Arrays.sort(tmp); return tmp; } }
[ "fy1139195320@qq.com" ]
fy1139195320@qq.com
e991e248964c4221628b5675a23069696c2f4876
9cdcc9e5437f7c2b9fdbe5135016ce63e6f5c688
/src/main/java/dr/web/basis/service/impl/BasisUser_recommendServiceImpl.java
bfaf5102b1dd30c35faa1853782e3d69a55e33b2
[]
no_license
DreamInception/pc1.0
a0307cf5e2355a63ba8de562952e3902aacfc80c
1a1db34762a4d3f70d45d47c09f92e7c5fb98af3
refs/heads/master
2021-01-13T07:38:20.166292
2016-10-20T14:54:12
2016-10-20T14:54:12
71,473,454
0
0
null
null
null
null
UTF-8
Java
false
false
751
java
package dr.web.basis.service.impl; import java.util.Map; import org.springframework.stereotype.Service; import dr.web.basis.service.BasisUser_recommendService; import dr.web.common.base.InterfaceServiceImpl; /** * * @包名 :dr.web.basis.service.impl * @文件名 :BasisUser_recommendServiceImpl.java * @系统名称 : 上海景源金服PC端 * @Author: 陈吉秋特 * @Date: 2016-3-16下午5:00:00 * @版本号 :v0.0.01 */ @Service(value = "basisUser_recommendService") public class BasisUser_recommendServiceImpl extends InterfaceServiceImpl<Map<String, Object>> implements BasisUser_recommendService { public static final String nameSpace = "basis_user_recommend"; @Override public String getNamespace() { return nameSpace; } }
[ "pengfei@51vest.com" ]
pengfei@51vest.com
c5638ad48a3d6811c84a71e277f2daaaf67d0e25
22b9db3683838b2a167e164bbf0e1516fc28352a
/src/com/xl/util/FileUtils.java
d9997dcffff25ccbed9cb32d4dc7812b0f9dc0cb
[ "MIT" ]
permissive
929355193/XmlToCode
6d3b8b79b68abce9e3745c9fd1896887be069169
b2b9cb17e2cf964dcd58ed34ca794494e2ef0696
refs/heads/master
2023-07-28T00:19:34.684154
2021-09-08T09:02:02
2021-09-08T09:02:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,253
java
package com.xl.util; import java.io.*; import java.util.*; public class FileUtils { /* * 列出目录下所有文件 */ public static Collection<File> listFiles(File file,String[] miniType,boolean ischeck) { ArrayList<File> filelist = new ArrayList(); File[] files = file.listFiles(); if(files==null){ return filelist; } for(int i=0;i<files.length;i++) { if(files[i].isFile()) { for(String type:miniType) if(files[i].getPath().endsWith(type)) { filelist.add(files[i]); break; } } else { Collection<File> filelist2 = listFiles(files[i],miniType,ischeck); for(File f:filelist2) filelist.add(f); } } return filelist; } public static Collection<File> listFiles(File file,boolean ischeck) { ArrayList<File> filelist = new ArrayList(); File[] files = file.listFiles(); for(int i=0;i<files.length;i++) { if(files[i].isFile()) { filelist.add(files[i]); } else { Collection<File> filelist2 = listFiles(files[i],ischeck); for(File f:filelist2) filelist.add(f); } } return filelist; } //批量删除目录下指定格式文件 public static void removeFiles(File path,String[] name) { Collection<File> files = listFiles(path,name,true); for(File file:files) { file.delete(); } } public static void writeText(String filename,String info,String coding) { File file = new File(filename); try { if (!file.isFile())file.createNewFile(); } catch (Exception e) {} try { FileOutputStream fileOutputStream = new FileOutputStream(file, false); fileOutputStream.write(info.getBytes(coding)); fileOutputStream.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } public static String read(File file,String encoding) throws IOException { String content = ""; // File file = new File(path); if(file.isFile()) { FileInputStream input= new FileInputStream(file); byte [] buf=new byte[input.available()]; input.read(buf); content = new String(buf,encoding); } return content; } }
[ "2541012655@qq.com" ]
2541012655@qq.com
98c158c02c51622a02f6f52c1ee3676890e3b3a3
12f5bd6e4f1a921808de177361ca595e1d209e58
/kotuc3d/src/kotuc/LocationLoader.java
20b5d25a552329f243d393829427ff8fd55b89b3
[]
no_license
kotucz/kotucz-playground
6c52c04ccc2a624252ee3b0fa5679b4b1c4ca6ca
b4767e4f7e60d100b68898e391fdc44481530306
refs/heads/master
2016-09-05T12:38:54.655888
2013-02-17T22:55:46
2013-02-17T22:55:46
33,043,299
0
0
null
null
null
null
UTF-8
Java
false
false
7,342
java
import java.applet.Applet; import java.awt.BorderLayout; import java.awt.Frame; import java.awt.event.*; import java.awt.GraphicsConfiguration; import com.sun.j3d.utils.applet.MainFrame; import com.sun.j3d.utils.universe.*; import com.sun.j3d.utils.geometry.*; import javax.media.j3d.*; import javax.vecmath.*; import com.sun.j3d.utils.image.*; import com.sun.j3d.loaders.*; import com.sun.j3d.loaders.objectfile.*; import java.util.*; import java.io.*; import org.xml.sax.*; import org.xml.sax.helpers.DefaultHandler; import javax.xml.parsers.SAXParserFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; public class LocationLoader extends DefaultHandler { Location location = null; public LocationLoader (Location location) { this.location=location; } // ************************* // ****loading from XML file // ************************** public void load(String filename) { // Use an instance of ourselves as the SAX event handler DefaultHandler handler = new LocationLoader(location); // Use the validating parser SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setValidating(true); //factory.setNamespaceAware(true); try { // Set up output stream out = new OutputStreamWriter(System.out, "UTF8"); // Parse the input SAXParser saxParser = factory.newSAXParser(); saxParser.parse( new File(filename), handler); } catch (SAXParseException spe) { // Error generated by the parser System.out.println("\n** Parsing error" + ", line " + spe.getLineNumber() + ", uri " + spe.getSystemId()); System.out.println(" " + spe.getMessage() ); // Use the contained exception, if any Exception x = spe; if (spe.getException() != null) x = spe.getException(); x.printStackTrace(); } catch (SAXException sxe) { // Error generated by this application // (or a parser-initialization error) Exception x = sxe; if (sxe.getException() != null) x = sxe.getException(); x.printStackTrace(); } catch (ParserConfigurationException pce) { // Parser with specified options can't be built pce.printStackTrace(); } catch (IOException ioe) { // I/O error ioe.printStackTrace(); } } static private Writer out; static public String indentString = " "; // Amount to indent static public int indentLevel = 0; public void startDocument() throws SAXException { //emit("loading: "); } public void endDocument() throws SAXException { emit("location loaded"); } public void startElement(String namespaceURI, String lName, // local name String qName, // qualified name Attributes attrs) throws SAXException { indentLevel++; String eName = lName; // element name if ("".equals(eName)) eName = qName; // namespaceAware = false if ("location".equals(eName)) { emit("location file, loading started"); if (attrs.getValue("width")!=null) width = Integer.parseInt(attrs.getValue("width")); if (attrs.getValue("height")!=null) height = Integer.parseInt(attrs.getValue("height")); double random = 0.0; if (attrs.getValue("random")!=null) random = Double.parseDouble(attrs.getValue("random")); initLandVerts(random); }; if ("tree".equals(eName)) { emit("new Tree"); double x = 0; double y = 0; if (attrs.getValue("x")!=null) x = Double.parseDouble(attrs.getValue("x")); if (attrs.getValue("y")!=null) y = Double.parseDouble(attrs.getValue("y")); createTree(x, y); }; if (attrs != null) { for (int i = 0; i < attrs.getLength(); i++) { String aName = attrs.getLocalName(i); // Attr name if ("".equals(aName)) aName = attrs.getQName(i); nl(); emit(eName); emit("."); emit(aName); emit("="); emit(attrs.getValue(i)); emit(""); } } if (attrs.getLength() > 0) nl(); emit(">"); } public void endElement(String namespaceURI, String sName, // simple name String qName // qualified name ) throws SAXException { String eName = sName; // element name if ("".equals(eName)) eName = qName; if ("location".equals(eName)) { createLand(); }; nl(); emit("</"+eName+">"); indentLevel--; } public void characters(char buf[], int offset, int len) throws SAXException { nl(); emit("CHARS: "); String s = new String(buf, offset, len); if (!s.trim().equals("")) emit(s); } public void ignorableWhitespace(char buf[], int offset, int len) throws SAXException { // Ignore it } public void processingInstruction(String target, String data) throws SAXException { nl(); emit("PROCESS: "); emit("<?"+target+" "+data+"?>"); } //=========================================================== // SAX ErrorHandler methods //=========================================================== // treat validation errors as fatal public void error(SAXParseException e) throws SAXParseException { throw e; } // dump warnings too public void warning(SAXParseException err) throws SAXParseException { System.out.println("** Warning" + ", line " + err.getLineNumber() + ", uri " + err.getSystemId()); System.out.println(" " + err.getMessage()); } //=========================================================== // Utility Methods ... //=========================================================== // Wrap I/O exceptions in SAX exceptions, to // suit handler signature requirements private void emit(String s) throws SAXException { try { out.write(s); out.flush(); } catch (IOException e) { throw new SAXException("I/O error", e); } } // Start a new line // and indent the next line appropriately private void nl() throws SAXException { String lineEnd = System.getProperty("line.separator"); try { out.write(lineEnd); for (int i=0; i < indentLevel; i++) out.write(indentString); } catch (IOException e) { throw new SAXException("I/O error", e); } } }
[ "TomasRKotula@gmail.com@ef30e6ac-8c31-e848-2268-f4fed5c5a1f9" ]
TomasRKotula@gmail.com@ef30e6ac-8c31-e848-2268-f4fed5c5a1f9
ef8d2c525aecacd57b5f50c32d259e64d6ddb470
ccf82688f082e26cba5fc397c76c77cc007ab2e8
/Mage.Sets/src/mage/cards/c/ConfidenceFromStrength.java
082fd8d3cbb5f97f7408c278ddaecde6ea152d98
[ "MIT" ]
permissive
magefree/mage
3261a89320f586d698dd03ca759a7562829f247f
5dba61244c738f4a184af0d256046312ce21d911
refs/heads/master
2023-09-03T15:55:36.650410
2023-09-03T03:53:12
2023-09-03T03:53:12
4,158,448
1,803
1,133
MIT
2023-09-14T20:18:55
2012-04-27T13:18:34
Java
UTF-8
Java
false
false
1,449
java
package mage.cards.c; import java.util.UUID; import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.target.common.TargetCreaturePermanent; /** * * @author TheElk801 */ public final class ConfidenceFromStrength extends CardImpl { public ConfidenceFromStrength(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{G}"); // Target creature gets +4/+4 until and gains trample until end of turn. Effect effect = new BoostTargetEffect(4, 4, Duration.EndOfTurn); effect.setText("Target creature gets +4/+4"); this.getSpellAbility().addEffect(effect); effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn); effect.setText("and gains trample until end of turn"); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } private ConfidenceFromStrength(final ConfidenceFromStrength card) { super(card); } @Override public ConfidenceFromStrength copy() { return new ConfidenceFromStrength(this); } }
[ "theelk801@gmail.com" ]
theelk801@gmail.com
145346af6ace2745958d609fd4a6dbbf4671c6c2
8ab1f2c58181a8103236c71506a8d88924ed094a
/Java/工具类整理/短信发送/PhoneMessage/src/main/java/com/anssy/venturebar/invest/entity/ProjectInfoEntity.java
be416119e9b57323531b7d1002d465082a83230c
[]
no_license
LuJiangLin/Open_Source
a7353ac0382904b8b7666dcebf2ac81f40020e43
86783db1cdeb17e96fc8f72e07cd722518a8114b
refs/heads/master
2020-03-18T19:14:42.804472
2018-04-24T03:59:07
2018-04-24T03:59:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,858
java
/** * 湖北安式软件有限公司 * Hubei Anssy Software Co., Ltd. * FILENAME : ProjectInfoEntity.java * PACKAGE : com.anssy.venturebar.invest.entity * CREATE DATE : 2016-8-10 * AUTHOR : make it * MODIFIED BY : * DESCRIPTION : */ package com.anssy.venturebar.invest.entity; import com.anssy.webcore.core.entity.IdEntity; import java.util.List; /** * @author make it * @version SVN #V1# #2016-8-10# * 投资_项目信息 */ public class ProjectInfoEntity extends IdEntity { private static final long serialVersionUID = -8279697902193434544L; /** * 图片 */ private String image; private List<String> urls; /** * 标题 */ private String title; /** * 一句描述 */ private String sketch; /** * 行业(基础_行业信息) */ private String field; private String fieldName; /** * 省ID */ private Long provinceId; private String province; /** * 市ID */ private Long cityId; private String city; /** * 区县ID */ private Long areaId; private String area; /** * 经度 */ private String longitude; /** * 纬度 */ private String latitude; /** * geohash */ private String geohash; /** * 浏览量 */ private Long pv; /** * 点赞数 */ private Long praise; /** * 权重 默认排序 */ private Long weight; /** * 状态 (STATE 0-待审核,1-正常,2-过期,3-锁定) */ private int state; /** * 距离 */ private double distance; private Integer sort; public String getImage() { return image; } public void setImage(String image) { this.image = image; } public List<String> getUrls() { return urls; } public void setUrls(List<String> urls) { this.urls = urls; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getSketch() { return sketch; } public void setSketch(String sketch) { this.sketch = sketch; } public String getField() { return field; } public void setField(String field) { this.field = field; } public String getFieldName() { return fieldName; } public void setFieldName(String fieldName) { this.fieldName = fieldName; } public Long getProvinceId() { return provinceId; } public void setProvinceId(Long provinceId) { this.provinceId = provinceId; } public String getProvince() { return province; } public void setProvince(String province) { this.province = province; } public Long getCityId() { return cityId; } public void setCityId(Long cityId) { this.cityId = cityId; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } public Long getAreaId() { return areaId; } public void setAreaId(Long areaId) { this.areaId = areaId; } public String getArea() { return area; } public void setArea(String area) { this.area = area; } public String getLongitude() { return longitude; } public void setLongitude(String longitude) { this.longitude = longitude; } public String getLatitude() { return latitude; } public void setLatitude(String latitude) { this.latitude = latitude; } public String getGeohash() { return geohash; } public void setGeohash(String geohash) { this.geohash = geohash; } public Long getPv() { return pv; } public void setPv(Long pv) { this.pv = pv; } public Long getPraise() { return praise; } public void setPraise(Long praise) { this.praise = praise; } public int getState() { return state; } public void setState(int state) { this.state = state; } public double getDistance() { return distance; } public void setDistance(double lat1, double lng1) { double dis = getDistance(); if (dis == 0) { double lat2 = Double.parseDouble(getLatitude()); double lng2 = Double.parseDouble(getLongitude()); dis = calculateDistance(lat1, lng1, lat2, lng2); } this.distance = dis; } /** * 排序方法 */ public Integer getSort() { sort = Integer.parseInt(new java.text.DecimalFormat("0") .format(getDistance())); return sort; } public void setSort(Integer sort) { this.sort = sort; } /** * 计算距离的方法(单位m) */ private double calculateDistance(double lat1, double lng1, double lat2, double lng2) { double theta = lng1 - lng2; double dist = Math.sin(deg2rad(lat1)) * Math.sin(deg2rad(lat2)) + Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) * Math.cos(deg2rad(theta)); dist = Math.acos(dist); dist = rad2deg(dist); return dist * 60 * 1.1515 * 1.609344 * 1000; } // 将角度转换为弧度 private static double deg2rad(double degree) { return degree / 180 * Math.PI; } // 将弧度转换为角度 private static double rad2deg(double radian) { return radian * 180 / Math.PI; } public Long getWeight() { return weight; } public void setWeight(Long weight) { this.weight = weight; } }
[ "18772101110@163.com" ]
18772101110@163.com
31632ee2d646e1ffb5cd8b16752b16c541026604
eda1361ef1e7da596f03d4eed8f4981672a1678a
/backstage-framework-model/src/main/java/com/bowen/framework/domain/media/response/MediaCode.java
7ed3592fe0aa620ede0592a8f227fbba53ec4c88
[]
no_license
BoWen98/GraduationProject-Backstage
7b13e0933d426a40819e7cbd7de3602f1b82ecb8
5929ad0d3c7be665a61951b8a18101670c31f87a
refs/heads/master
2022-07-18T02:05:27.032073
2019-10-30T06:09:28
2019-10-30T06:09:28
216,445,211
0
0
null
2022-06-25T07:29:57
2019-10-21T00:13:39
Java
UTF-8
Java
false
false
1,826
java
package com.bowen.framework.domain.media.response; import com.google.common.collect.ImmutableMap; import com.bowen.framework.model.response.ResultCode; import io.swagger.annotations.ApiModelProperty; import lombok.ToString; @ToString public enum MediaCode implements ResultCode { UPLOAD_FILE_REGISTER_FAIL(false,22001,"上传文件在系统注册失败,请刷新页面重试!"), UPLOAD_FILE_REGISTER_EXIST(false,22002,"上传文件在系统已存在!"), CHUNK_FILE_EXIST_CHECK(true,22003,"分块文件在系统已存在!"), MERGE_FILE_FAIL(false,22004,"合并文件失败,文件在系统已存在!"), MERGE_FILE_CHECKFAIL(false,22005,"合并文件校验失败!"); //操作代码 @ApiModelProperty(value = "媒资系统操作是否成功", example = "true", required = true) boolean success; //操作代码 @ApiModelProperty(value = "媒资系统操作代码", example = "22001", required = true) int code; //提示信息 @ApiModelProperty(value = "媒资系统操作提示", example = "文件在系统已存在!", required = true) String message; private MediaCode(boolean success,int code, String message){ this.success = success; this.code = code; this.message = message; } private static final ImmutableMap<Integer, MediaCode> CACHE; static { final ImmutableMap.Builder<Integer, MediaCode> builder = ImmutableMap.builder(); for (MediaCode commonCode : values()) { builder.put(commonCode.code(), commonCode); } CACHE = builder.build(); } @Override public boolean success() { return success; } @Override public int code() { return code; } @Override public String message() { return message; } }
[ "376512291@qq.com" ]
376512291@qq.com
60814fbef73a4a9e1a24141bc7359301d0615ab9
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XWIKI-13942-2-1-NSGA_II-LineCoverage:ExceptionType:StackTraceSimilarity/org/xwiki/model/internal/reference/AbstractEntityReferenceResolver_ESTest_scaffolding.java
fe0037272f3b1da20159e7fd2eec75f3f4fab44f
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
2,555
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Sun Apr 05 13:44:29 UTC 2020 */ package org.xwiki.model.internal.reference; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class AbstractEntityReferenceResolver_ESTest_scaffolding { @org.junit.Rule public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule(); private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000); @BeforeClass public static void initEvoSuiteFramework() { org.evosuite.runtime.RuntimeSettings.className = "org.xwiki.model.internal.reference.AbstractEntityReferenceResolver"; org.evosuite.runtime.GuiSupport.initialize(); org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; org.evosuite.runtime.Runtime.getInstance().resetRuntime(); } @Before public void initTestCase(){ threadStopper.storeCurrentThreads(); threadStopper.startRecordingTime(); org.evosuite.runtime.GuiSupport.setHeadless(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); org.evosuite.runtime.agent.InstrumentingAgent.activate(); } @After public void doneWithTestCase(){ threadStopper.killAndJoinClientThreads(); org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); } private static void initializeClasses() { org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(AbstractEntityReferenceResolver_ESTest_scaffolding.class.getClassLoader() , "org.xwiki.model.reference.EntityReferenceResolver", "org.xwiki.model.internal.reference.ExplicitStringEntityReferenceResolver", "org.xwiki.component.phase.Initializable", "org.xwiki.component.annotation.Component", "org.xwiki.model.reference.EntityReference", "org.xwiki.model.internal.reference.SymbolScheme", "org.xwiki.model.internal.reference.AbstractEntityReferenceResolver", "org.xwiki.model.internal.reference.AbstractStringEntityReferenceResolver", "org.xwiki.model.EntityType", "org.xwiki.component.phase.InitializationException" ); } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
56d92b81c50daf4845e46edba8f326281a00d7a9
0f47906fcfb938c1d9f32403f25aa511bcc952a5
/common/rebelkeithy/mods/atum/blocks/BlockArrowTrap.java
bd696cec32032063e185b7ca9aabd45fa5d54611
[]
no_license
MomoMccloud16201/Atum
02f3b42f2ee43a24c1a2fc18eff3249b0a145539
f348357a62766a583d7a34ed8000c3c53d44b15f
refs/heads/master
2021-01-16T19:16:47.873806
2013-06-09T03:33:54
2013-06-09T03:33:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,987
java
package rebelkeithy.mods.atum.blocks; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.BlockPistonBase; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.dispenser.BehaviorDefaultDispenseItem; import net.minecraft.dispenser.IRegistry; import net.minecraft.dispenser.RegistryDefaulted; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; import net.minecraft.util.Icon; import net.minecraft.world.World; import rebelkeithy.mods.atum.AtumBlocks; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class BlockArrowTrap extends BlockContainer { /** Registry for all dispense behaviors. */ public static final IRegistry dispenseBehaviorRegistry = new RegistryDefaulted(new BehaviorDefaultDispenseItem()); protected Random random = new Random(); @SideOnly(Side.CLIENT) protected Icon field_94463_c; @SideOnly(Side.CLIENT) protected Icon field_94462_cO; @SideOnly(Side.CLIENT) protected Icon field_96473_e; public BlockArrowTrap(int par1) { super(par1, Material.rock); this.setCreativeTab(CreativeTabs.tabRedstone); this.setHardness(-1); } /** * Returns the block hardness at a location. Args: world, x, y, z */ @Override public float getBlockHardness(World par1World, int par2, int par3, int par4) { if(par1World.getBlockId(par2, par3+1, par4) == AtumBlocks.largeBrick.blockID && par1World.getBlockMetadata(par2, par3+1, par4) == 1) return -1; return this.blockHardness; } /** * How many world ticks before ticking */ @Override public int tickRate(World par1World) { return 4; } /** * Called whenever the block is added into the world. Args: world, x, y, z */ @Override public void onBlockAdded(World par1World, int par2, int par3, int par4) { super.onBlockAdded(par1World, par2, par3, par4); this.setDispenserDefaultDirection(par1World, par2, par3, par4); } /** * sets Dispenser block direction so that the front faces an non-opaque block; chooses west to be direction if all * surrounding blocks are opaque. */ private void setDispenserDefaultDirection(World par1World, int par2, int par3, int par4) { if (!par1World.isRemote) { int l = par1World.getBlockId(par2, par3, par4 - 1); int i1 = par1World.getBlockId(par2, par3, par4 + 1); int j1 = par1World.getBlockId(par2 - 1, par3, par4); int k1 = par1World.getBlockId(par2 + 1, par3, par4); byte b0 = 3; if (Block.opaqueCubeLookup[l] && !Block.opaqueCubeLookup[i1]) { b0 = 3; } if (Block.opaqueCubeLookup[i1] && !Block.opaqueCubeLookup[l]) { b0 = 2; } if (Block.opaqueCubeLookup[j1] && !Block.opaqueCubeLookup[k1]) { b0 = 5; } if (Block.opaqueCubeLookup[k1] && !Block.opaqueCubeLookup[j1]) { b0 = 4; } par1World.setBlockMetadataWithNotify(par2, par3, par4, b0, 2); } } @SideOnly(Side.CLIENT) /** * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata */ @Override public Icon getIcon(int par1, int par2) { if(par2 == 0) par2 = 3; int k = par2 & 7; return par1 == k ? (k != 1 && k != 0 ? this.field_94462_cO : this.field_96473_e) : (k != 1 && k != 0 ? (par1 != 1 && par1 != 0 ? this.blockIcon : this.field_94463_c) : this.field_94463_c); } @SideOnly(Side.CLIENT) /** * When this method is called, your block should register all the icons it needs with the given IconRegister. This * is the only chance you get to register icons. */ @Override public void registerIcons(IconRegister par1IconRegister) { this.blockIcon = par1IconRegister.registerIcon("Atum:TrapSide"); this.field_94463_c = par1IconRegister.registerIcon("Atum:TrapSide"); this.field_94462_cO = par1IconRegister.registerIcon("Atum:TrapFire"); this.field_96473_e = par1IconRegister.registerIcon("Atum:TrapFire"); } /** * Called upon block activation (right click on the block.) */ @Override public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { if (par1World.isRemote) { return true; } else { TileEntityArrowTrap TileEntityArrowTrap = (TileEntityArrowTrap)par1World.getBlockTileEntity(par2, par3, par4); if (TileEntityArrowTrap != null) { //par5EntityPlayer.displayGUIDispenser(TileEntityArrowTrap); } return true; } } /** * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are * their own) Args: x, y, z, neighbor blockID */ @Override public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { boolean flag = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4) || par1World.isBlockIndirectlyGettingPowered(par2, par3 + 1, par4); int i1 = par1World.getBlockMetadata(par2, par3, par4); boolean flag1 = (i1 & 8) != 0; if (flag && !flag1) { par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); par1World.setBlockMetadataWithNotify(par2, par3, par4, i1 | 8, 4); } else if (!flag && flag1) { par1World.setBlockMetadataWithNotify(par2, par3, par4, i1 & -9, 4); } } /** * Returns a new instance of a block's tile entity class. Called on placing the block. */ @Override public TileEntity createNewTileEntity(World par1World) { return new TileEntityArrowTrap(); } /** * Called when the block is placed in the world. */ @Override public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving, ItemStack par6ItemStack) { int l = BlockPistonBase.determineOrientation(par1World, par2, par3, par4, par5EntityLiving); par1World.setBlockMetadataWithNotify(par2, par3, par4, l, 2); } public static EnumFacing getFacing(int par0) { return EnumFacing.getFront(par0 & 7); } }
[ "RebelKeithy@gmail.com" ]
RebelKeithy@gmail.com
22aca5b8ea8f5c01504b839c9025f204095634ba
de3eb812d5d91cbc5b81e852fc32e25e8dcca05f
/tags/2.1.0-r1374/CruxWidgets/src/br/com/sysmap/crux/widgets/client/timer/Timer.java
8a2cafac102e4654da4e6af5555432c68b370ab6
[]
no_license
svn2github/crux-framework
7dd52a951587d4635112987301c88db23325c427
58bcb4821752b405a209cfc21fb83e3bf528727b
refs/heads/master
2016-09-06T13:33:41.975737
2015-01-22T08:03:25
2015-01-22T08:03:25
13,135,398
0
0
null
null
null
null
ISO-8859-2
Java
false
false
5,961
java
/* * Copyright 2009 Sysmap Solutions Software e Consultoria Ltda. * * 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 br.com.sysmap.crux.widgets.client.timer; import java.util.ArrayList; import java.util.Date; import java.util.List; import br.com.sysmap.crux.core.client.screen.Screen; import br.com.sysmap.crux.core.client.utils.StringUtils; import br.com.sysmap.crux.widgets.client.event.timeout.HasTimeoutHandlers; import br.com.sysmap.crux.widgets.client.event.timeout.TimeoutEvent; import br.com.sysmap.crux.widgets.client.event.timeout.TimeoutHandler; import com.google.gwt.event.logical.shared.CloseEvent; import com.google.gwt.event.logical.shared.CloseHandler; import com.google.gwt.event.shared.HandlerRegistration; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.Label; /** * A decorated panel, with a title bar. * @author Gessé S. F. Dafé - <code>gessedafe@gmail.com</code> */ public class Timer extends Composite implements HasTimeoutHandlers { public static final String DEFAULT_STYLE_NAME = "crux-Timer" ; private final Label widget; private long initial; private long creationTime; private boolean regressive; private boolean running = false; private long startTime = 0; private List<TimeouTask> events = new ArrayList<TimeouTask>(); private TimeProcessor timeProcessor; /** * @param width * @param height * @param styleName */ public Timer(long initial, boolean regressive, boolean start) { this.initial = initial; this.creationTime = initial; this.regressive = regressive; this.timeProcessor = new TimeProcessor(this); widget = new Label(); widget.setStyleName(DEFAULT_STYLE_NAME); widget.setText(format(initial)); initWidget(widget); if(start) { start(); } Screen.addCloseHandler(new CloseHandler<Window>(){ public void onClose(CloseEvent<Window> event) { stop(); } }); } /** * @param amount * @return */ private String format(long amount) { long secs = amount % 60; long mins = ((amount - secs) / 60) % 60; long hours = (amount - mins * 60 - secs) / (60 * 60); return StringUtils.lpad("" + hours, 2, '0') + ':' + StringUtils.lpad("" + mins, 2, '0') + ':' + StringUtils.lpad("" + secs, 2, '0'); } /** * */ public void start() { if(!this.running) { this.startTime = (new Date()).getTime(); this.running = true; timeProcessor.scheduleRepeating(500); } } /** * */ public void stop() { if(this.running) { this.running = false; this.timeProcessor.cancel(); this.initial += ((new Date()).getTime() - this.startTime) / 1000; this.update(); } } /** * */ public void reset() { stop(); this.initial = creationTime; start(); } /** * */ public void clear() { stop(); this.initial = creationTime; update(); } /** * */ void update() { long diffTime = this.initial; if(this.running) { long delta = ((new Date()).getTime() - this.startTime) / 1000; if(this.regressive) { diffTime = diffTime - delta; diffTime = diffTime < 0 ? 0 : diffTime; } else { diffTime = diffTime + delta; } } this.widget.setText(this.format(diffTime)); if(this.running) { this.checkForTimeoutEvents(diffTime); } } /** * @param currentCount */ private void checkForTimeoutEvents(long currentCount) { if(this.events != null) { for (TimeouTask task : this.events) { if(!task.isProcessed()) { if((this.regressive && task.getTime() >= currentCount) || (!this.regressive && task.getTime() <= currentCount)) { task.setProcessed(true); task.process(this); } } } } } /** * @see br.com.sysmap.crux.widgets.client.event.timeout.HasTimeoutHandlers#addTimeoutHandler(br.com.sysmap.crux.widgets.client.event.timeout.TimeoutHandler) */ public HandlerRegistration addTimeoutHandler(TimeoutHandler handler) { TimeouTask task = new TimeouTask(handler); this.events.add(task); return addHandler(handler, TimeoutEvent.getType()); } } /** * TODO - Gessé - Comment this * @author Gessé S. F. Dafé - <code>gessedafe@gmail.com</code> */ class TimeProcessor extends com.google.gwt.user.client.Timer { private Timer timer; public TimeProcessor(Timer timer) { this.timer = timer; } @Override public void run() { this.timer.update(); } } /** * TODO - Gessé - Comment this * @author Gessé S. F. Dafé - <code>gessedafe@gmail.com</code> */ class TimeouTask { private boolean processed; TimeoutHandler handler; /** * @param handler */ public TimeouTask(TimeoutHandler handler) { this.handler = handler; } /** * @param timer */ public void process(Timer timer) { handler.onTimeout(new TimeoutEvent(timer)); } /** * @return the processed */ public boolean isProcessed() { return processed; } /** * @param processed the processed to set */ public void setProcessed(boolean processed) { this.processed = processed; } /** * @return the time */ public long getTime() { return handler.getScheduledTime(); } }
[ "tr_bustamante@yahoo.com.br@a5d2bbaa-053c-11de-b17c-0f1ef23b492c" ]
tr_bustamante@yahoo.com.br@a5d2bbaa-053c-11de-b17c-0f1ef23b492c
7bc5db5db798c6c0f87c2e98f76270c280a376aa
918fb777eda9957cc6deeadb938ea11c735f62bd
/main/src/com/spacegame/common/Norm.java
e9a2938fb715e446da4079499e324ff5c6af2f2e
[ "Apache-2.0" ]
permissive
SlyFoxStudios/SpaceGame
3d1050d418b628e9838b30c1dca556908c7e66cb
25943aa4c18416cd2aa2a7886888d43addcec57c
refs/heads/master
2021-01-21T09:28:36.121370
2016-04-27T04:48:02
2016-04-27T04:48:02
45,594,198
0
1
null
null
null
null
UTF-8
Java
false
false
336
java
package com.spacegame.common; import java.lang.annotation.Documented; /** * When used for annotating methods, indicates that the returned float value is an angle and is normalized (-180 < a && a <= 180) * When used for annotating params, indicates that the param angle must be normalized */ @Documented public @interface Norm { }
[ "crazywolf132@gmail.com" ]
crazywolf132@gmail.com
fd46ca691301ebdcffd8c1691719db6cf4dfc6a0
1615efdc51a763c603fca35650af3641bff9dc60
/app/src/main/java/streetdirectory/mobile/core/GantTools.java
c8598b38b620035661ae0d94bfcc29822f21de17
[]
no_license
Leoxinghai/SingaporeStreetMap
233c8abaa1e09df0fb8c389ef342a44af3d46d4b
3be3a8d29e86ee279aa301c8ac5bbdef0a730b55
refs/heads/master
2021-01-19T06:46:55.927835
2016-07-01T13:32:22
2016-07-01T13:32:22
62,395,314
0
0
null
null
null
null
UTF-8
Java
false
false
1,042
java
package streetdirectory.mobile.core; import android.content.Context; import com.google.android.gms.analytics.GoogleAnalytics; import com.google.android.gms.analytics.Tracker; public class GantTools { public GantTools() { } public static void dispatch() { } public static void startSession(Context context) { if(activityCount == 0 && mTracker == null) mTracker = GoogleAnalytics.getInstance(context.getApplicationContext()).newTracker(ACCOUNT); activityCount++; } public static void stopSession() { } public static void trackPageView(String s) { if(mTracker != null && s != null) { mTracker.setScreenName(s.replace(" ", "_")); mTracker.send((new com.google.android.gms.analytics.HitBuilders.ScreenViewBuilder()).build()); } } private static String ACCOUNT = "UA-15222285-56"; static int activityCount = 0; static Tracker mTracker = null; }
[ "leoxinghai@hotmail.com" ]
leoxinghai@hotmail.com
8b3f790faaa27e442dfd14d82b12109678279a52
ae652ef9816665ffa9e5991452f29f50311425b0
/hell-ml/src/main/java/ps/hell/ml/rs/librec/baseline/ItemAverage.java
9f6f532c864245551b3e43eec8cafe1383f1dc21
[]
no_license
qqgirllianxin/hell
97620a7657d48136113a789d97178bff9427875f
20080083b9efd160348471552b2cfb8661871db3
refs/heads/master
2021-01-13T14:13:09.394986
2016-09-30T12:26:26
2016-09-30T12:26:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,527
java
// Copyright (C) 2014 Guibing Guo // // This file is part of LibRec. // // LibRec 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. // // LibRec 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 LibRec. If not, see <http://www.gnu.org/licenses/>. // package ps.hell.ml.rs.librec.baseline; import ps.hell.ml.rs.librec.data.SparseMatrix; import ps.hell.ml.rs.librec.data.SparseVector; import ps.hell.ml.rs.librec.intf.Recommender; import java.util.HashMap; import java.util.Map; /** * Baseline: predict by the average of target item's ratings * * @author guoguibing * */ public class ItemAverage extends Recommender { private Map<Integer, Double> itemMeans; public ItemAverage(SparseMatrix rm, SparseMatrix tm, int fold) { super(rm, tm, fold); itemMeans = new HashMap<>(); algoName = "ItemAvg"; } @Override protected double predict(int u, int j) { if (!itemMeans.containsKey(j)) { SparseVector jv = trainMatrix.column(j); double mean = jv.getCount() > 0 ? jv.mean() : globalMean; itemMeans.put(j, mean); } return itemMeans.get(j); } }
[ "lie.tian@fengjr.com" ]
lie.tian@fengjr.com
ddf0891a42b024ca5bd8c671d82ee43e090b8ef6
28c95ff3e059e896d2f10caf25b3353c7ac50109
/characteristic/u2a73/src/test/java/org/im97mori/ble/characteristic/u2a73/ApparentWindDirectionTest.java
7c7ed99cf4047c348b944e79ea2d9d13f8717134
[ "MIT" ]
permissive
im97mori-github/JavaBLEUtil
7c8fd4bf0b640c87a874a07aa8873815ba1beb09
335b7a76869abf89ad1397aaf7544c1ca5b92526
refs/heads/master
2023-08-30T21:04:34.786942
2023-08-25T12:00:07
2023-08-26T23:07:11
242,078,480
1
1
null
null
null
null
UTF-8
Java
false
false
1,378
java
package org.im97mori.ble.characteristic.u2a73; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import org.im97mori.ble.test.TestBase; import org.junit.Test; @SuppressWarnings({ "unused" }) public class ApparentWindDirectionTest extends TestBase { //@formatter:off private static final byte[] data_00001; static { byte[] data = new byte[2]; data[ 0] = 0x01; data[ 1] = 0x02; data_00001 = data; } //@formatter:on @Test public void test_constructor_00001() { byte[] data = getData(); ApparentWindDirection result1 = new ApparentWindDirection(data); assertEquals(0x0201, result1.getApparentWindDirection()); assertEquals(ApparentWindDirection.APPARENT_WIND_DIRECTION_RESOLUTION * 0x0201, result1.getApparentWindDirectionDegrees(), 0); } @Test public void test_constructor_00002() { int apparentWindDirection = 1; ApparentWindDirection result1 = new ApparentWindDirection(apparentWindDirection); assertEquals(apparentWindDirection, result1.getApparentWindDirection()); } @Test public void test_parcelable_2_00001() { byte[] data = getData(); ApparentWindDirection result1 = new ApparentWindDirection(data); assertArrayEquals(data, result1.getBytes()); } }
[ "github@im97mori.org" ]
github@im97mori.org
bbc17b8358a02d3e735ca6fcdd26379362eb7469
5a155f8741c46f168b0ce1eac90f6d1d673fdf07
/PreviousProjects/java/ssm/Mybatis_Two/src/com/dao/UserDao.java
8f00ede6adf48f099953162642e10e193970a663
[]
no_license
gitjinyubao/MyProject
10b308948597ef726af858260b8622814ddd5b25
ed71b23f82ff272f6c90f0513f0e94a9accd0849
refs/heads/master
2021-09-04T01:28:08.560749
2018-01-14T02:40:15
2018-01-14T02:40:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
170
java
package com.dao; import java.util.List; import com.entity.User; public interface UserDao { public User findUser(int id); public void deleteUser(User user); }
[ "2045279403@qq.com" ]
2045279403@qq.com
299413f1d96b3f710c61e7f15cf913df81b3f0ea
bbb79cb1f203b20ba447829532a2726fdcb4c7d4
/work/teacher/src/dynamic/FinalStudMain.java
598caf9a791db9d098760c498727910de8af4398
[]
no_license
shouvoo/bitAcademy
d9a2f53551fba9e0f4356ff49e4d5427220c4b1d
370b2a46f5f049fd1c9bccf5646374051c13ae58
refs/heads/master
2021-08-23T19:56:54.834420
2017-12-06T08:36:22
2017-12-06T08:36:22
111,503,706
0
0
null
null
null
null
UHC
Java
false
false
1,958
java
package dynamic; import java.util.Arrays; class FinalStud{ private String name; private int [] jum; public FinalStud(String name, int kor, int eng, int mat) { this.name = name; jum = new int[] {kor, eng, mat}; } public int getJum(int i) { return jum[i]; } public String getName() { return name; } } class FinalExam{ private String name, school, res; private int [] jum; public FinalExam(String name, String school, int kor, int eng, int mat, String res) { super(); this.name = name; this.school = school; this.jum = new int[] {kor, eng, mat}; this.res = res; } public void print() { System.out.println(name + ","+ school + ", " + Arrays.toString(jum) + ", " + res); } } class FinalSchool{ double [] rate; final int cutline = 70; String name; public FinalSchool(String name, int kor, int eng, int mat) { super(); this.rate = new double[] { (double)kor/100, (double)eng/100, (double)mat/100}; this.name = name; } FinalExam exam(FinalStud st) { double sum =0; for (int i = 0; i < rate.length; i++) { sum += rate[i]*st.getJum(i); } String res = "불합격"; if(sum>=cutline) res = "합격"; return new FinalExam(st.getName(), name, st.getJum(0),st.getJum(1),st.getJum(2), res); } } public class FinalStudMain { public static void main(String[] args) { // TODO Auto-generated method stub FinalStud [] stArr = { new FinalStud("장동건", 96,78,77), new FinalStud("장중건", 66,68,67), new FinalStud("장북건", 86,88,87), new FinalStud("장남건", 36,98,97), new FinalStud("장서건", 96,58,57) }; FinalSchool [] schArr = { new FinalSchool("A대", 30,30,40), new FinalSchool("B대", 50,20,30) }; for (FinalSchool fs : schArr) { for (FinalStud st : stArr) { fs.exam(st).print(); } System.out.println("-----------------------"); } } }
[ "show79boo@naver.com" ]
show79boo@naver.com
85a3a7a97c929a10b83145732ab5b9abc64bbaee
6c9d53706affbd7880bd15a99a8f11bc5c19b129
/小灰的算法/code/AlgorithmAndDataStructrue_xiaohui/src/main/java/cn/yellowgg/sencondchapter/Circularqueue.java
ff7f67e9453738a1e11cba7aeefe4bddcc857188
[]
no_license
jash-git/Jash-good-idea-20200224-001
98403f0b09f68629bae8ed8a6f30f4ec73c36ca1
5c4242234c0027473b4b953819f635352edd18fb
refs/heads/master
2021-01-14T15:42:01.455779
2020-02-27T05:53:24
2020-02-27T05:53:24
242,666,667
0
0
null
null
null
null
UTF-8
Java
false
false
2,393
java
package cn.yellowgg.sencondchapter; /** * @Author:黄广 * @Description: 循环队列 * 公式:(队尾下标+1)%数组长度=队头下标 * @Date: Created in 19-5-15 下午5:08 */ public class Circularqueue { private int[] array; //队头 private int front; //队尾 private int tail; /** * @param capacity 容量大小 */ public Circularqueue(int capacity) { this.array = new int[capacity]; } /** * 入队 * * @param element 入队元素 * @throws Exception */ public void enQueue(int element) throws Exception { //判断队列容量 if (isFull()) { throw new Exception("队列已满!"); } //元素入队,队尾后移 array[tail] = element; tail = (tail + 1) % array.length; } /** * 出队 * * @return * @throws Exception */ public int deQueue() throws Exception { if (isEmpty()) { throw new Exception("队列以空!"); } //元素出队,队头后移 int deQueueElement = array[front]; front = (front + 1) % array.length; return deQueueElement; } /** * 判断队列是否为满 * * @return */ public boolean isFull() { if ((tail + 1) % array.length == front) { return true; } else { return false; } } /** * 判断队列是否为空 * * @return */ public boolean isEmpty() { if (tail == front) { return true; } else { return false; } } public void output() { for (int i = front; i != tail; i = (i + 1) % array.length) { System.out.println(array[i]); } } public static void main(String[] args) throws Exception { Circularqueue circularqueue = new Circularqueue(6); circularqueue.enQueue(3); circularqueue.enQueue(5); circularqueue.enQueue(54); circularqueue.enQueue(6236); circularqueue.enQueue(235); circularqueue.output(); circularqueue.deQueue(); circularqueue.deQueue(); circularqueue.deQueue(); circularqueue.enQueue(2); circularqueue.enQueue(4); circularqueue.enQueue(92); circularqueue.output(); } }
[ "gitea@fake.local" ]
gitea@fake.local
d0e6502a31ce03c37cbee5b1470678894fa4bea6
f035ec7774d63d40027fa99bcd7e7bd76e8ed304
/android/WhyFi/app/src/main/java/com/example/zzt/whyfi/model/db/Msg.java
35bc23e73f59996b1236c467e2e0d85a03d28aba
[]
no_license
Ravikumar1997/Daily-pracitce
b669c9df2de66a4a93dbdddaaa534bb0bb3daf34
3931bb75b8ae83a28043e136a7331215d566d95e
refs/heads/master
2020-06-01T01:44:01.478225
2019-03-30T07:29:07
2019-03-30T07:29:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
625
java
package com.example.zzt.whyfi.model.db; /** * Created by zzt on 6/26/16. * <p/> * Usage: */ public class Msg { private String did; private String content; private String time; private boolean self; public String getDid() { return did; } public void setDid(String did) { this.did = did; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public String getTime() { return time; } public void setTime(String time) { this.time = time; } }
[ "zengzt93@gmail.com" ]
zengzt93@gmail.com
a21c68dd926b2228a2dbcfbf1e0782cf136267a6
49d713097713ed8b191d3ec4d374c0d089996943
/CasViewerEclipsePlugin/uimaj-ep-casviewer-core/src/main/java/org/apache/uima/casviewer/ui/internal/annotations/FeatureStructureViewerFilter.java
8423f5ea26a7438d8487b2225b5d1373a134a313
[ "Apache-2.0" ]
permissive
kidaak/uima-sandbox
695a4a1ff2806f6c97ebf7c2f5bb678b00a6ee08
f9946d882cbf0a03d230f557f753aaa86d8ec70f
refs/heads/trunk
2021-01-22T01:33:47.034241
2014-10-27T19:13:52
2014-10-27T19:13:52
47,804,927
0
0
null
2015-12-11T04:22:23
2015-12-11T04:22:22
null
UTF-8
Java
false
false
1,108
java
package org.apache.uima.casviewer.ui.internal.annotations; import java.util.HashSet; import java.util.List; import java.util.Set; import org.apache.uima.casviewer.core.internal.UFeatureStructure; import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.ViewerFilter; public class FeatureStructureViewerFilter extends ViewerFilter { protected final Set<String> hiddenTypeNames = new HashSet<String>(); public FeatureStructureViewerFilter() { hiddenTypeNames.add("uima.tcas.DocumentAnnotation"); hiddenTypeNames.add("com.ibm.uima.examples.SourceDocumentInformation"); } @Override public boolean select(Viewer viewer, Object parentElement, Object element) { if (element instanceof UFeatureStructure) { return !hiddenTypeNames.contains(((UFeatureStructure) element).getType().getName()); } return true; } public void setHiddenTypeNames (List<String> names) { if (names != null) { hiddenTypeNames.addAll(names); } else { hiddenTypeNames.clear(); } } }
[ "schor@apache.org" ]
schor@apache.org
e70f2b6ef819a2463f6486f069edaf995836ebbc
0e4a7d38a8ec2fc11db9f95aebd270406db2f1d8
/lotr/common/inventory/LOTRContainerHiredWarriorInventory.java
fe605efaa842c05df56e59a157e87c9dae9331ec
[]
no_license
KyberJeffHason/FA-help
fe07812a24b3295e8ca21ab2cbe948dd54e650fe
0f0775a429fa1751fe699d8a7072f92e83dca101
refs/heads/main
2022-07-29T20:25:24.836228
2021-04-28T19:53:52
2021-04-28T19:53:52
356,083,269
0
0
null
null
null
null
UTF-8
Java
false
false
4,235
java
package lotr.common.inventory; import lotr.common.entity.npc.*; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.*; import net.minecraft.item.ItemStack; public class LOTRContainerHiredWarriorInventory extends Container { private LOTREntityNPC theNPC; public LOTRInventoryHiredReplacedItems npcInv; public IInventory proxyInv; private final int npcFullInvSize; private int npcActiveSlotCount; public LOTRContainerHiredWarriorInventory(InventoryPlayer inv, LOTREntityNPC entity) { int i; this.theNPC = entity; this.npcInv = this.theNPC.hiredReplacedInv; this.npcFullInvSize = this.npcInv.getSizeInventory(); this.proxyInv = new InventoryBasic("npcTemp", false, this.npcFullInvSize); for(int i2 = 0; i2 < 4; ++i2) { LOTRSlotHiredReplaceItem slot = new LOTRSlotHiredReplaceItem(new LOTRSlotArmorStand(this.proxyInv, i2, 80, 21 + i2 * 18, i2, inv.player), this.theNPC); this.addSlotToContainer(slot); } int[] arrn = new int[1]; arrn[0] = 4; for(int i3 : arrn) { LOTRSlotHiredReplaceItem slot = new LOTRSlotHiredReplaceItem(new LOTRSlotMeleeWeapon(this.proxyInv, i3, 50, 48), this.theNPC); this.addSlotToContainer(slot); } if(this.theNPC instanceof LOTREntityOrc && ((LOTREntityOrc) this.theNPC).isOrcBombardier()) { int i4 = 5; LOTRSlotHiredReplaceItem slot = new LOTRSlotHiredReplaceItem(new LOTRSlotBomb(this.proxyInv, i4, 110, 48), this.theNPC); this.addSlotToContainer(slot); } for(i = 0; i < this.npcFullInvSize; ++i) { if(this.getSlotFromInventory(this.proxyInv, i) == null) continue; ++this.npcActiveSlotCount; } for(i = 0; i < 3; ++i) { for(int j = 0; j < 9; ++j) { this.addSlotToContainer(new Slot(inv, j + i * 9 + 9, 8 + j * 18, 107 + i * 18)); } } for(i = 0; i < 9; ++i) { this.addSlotToContainer(new Slot(inv, i, 8 + i * 18, 165)); } } @Override public boolean canInteractWith(EntityPlayer entityplayer) { return this.theNPC != null && this.theNPC.isEntityAlive() && this.theNPC.hiredNPCInfo.isActive && this.theNPC.hiredNPCInfo.getHiringPlayer() == entityplayer && this.theNPC.hiredNPCInfo.getTask() == LOTRHiredNPCInfo.Task.WARRIOR && entityplayer.getDistanceSqToEntity(this.theNPC) <= 144.0; } @Override public void onContainerClosed(EntityPlayer entityplayer) { super.onContainerClosed(entityplayer); if(!this.theNPC.worldObj.isRemote) { this.theNPC.hiredNPCInfo.sendClientPacket(true); } } @Override public ItemStack transferStackInSlot(EntityPlayer entityplayer, int i) { ItemStack itemstack = null; Slot slot = (Slot) this.inventorySlots.get(i); if(slot != null && slot.getHasStack()) { ItemStack itemstack1 = slot.getStack(); itemstack = itemstack1.copy(); if(slot.inventory == this.proxyInv) { if(!this.mergeItemStack(itemstack1, this.npcActiveSlotCount, this.inventorySlots.size(), true)) { return null; } } else { for(int j = 0; j < this.npcFullInvSize; ++j) { Slot npcSlot = this.getSlotFromInventory(this.proxyInv, j); if(npcSlot == null) continue; int npcSlotNo = npcSlot.slotNumber; if(!npcSlot.isItemValid(itemstack1) || this.mergeItemStack(itemstack1, npcSlotNo, npcSlotNo + 1, false)) continue; return null; } } if(itemstack1.stackSize == 0) { slot.putStack(null); } else { slot.onSlotChanged(); } if(itemstack1.stackSize != itemstack.stackSize) { slot.onPickupFromSlot(entityplayer, itemstack1); } else { return null; } } return itemstack; } }
[ "67012500+KyberJeffHason@users.noreply.github.com" ]
67012500+KyberJeffHason@users.noreply.github.com
78ffff1fc799b506c6ef9575e2d5d497bb4e8e45
032e927c6b0de9ad0e225e59fc31bca9607bd566
/src/core/languageHandler/sourceGenerator/PythonSourceGenerator.java
d1777c4f8842028eed677fd79ac1cac7d1f63c70
[ "MIT" ]
permissive
hptruong93/Repeat
8f18ad639d31a2fb9a215ed34b59cf19770026fd
b1306e13e529e7317a57faf36b86e113cb893cdf
refs/heads/master
2020-04-06T03:33:27.866444
2016-09-10T23:18:12
2016-09-10T23:18:12
31,721,512
14
2
null
2016-09-10T23:18:13
2015-03-05T15:46:15
Java
UTF-8
Java
false
false
2,225
java
package core.languageHandler.sourceGenerator; import java.util.logging.Logger; import staticResources.BootStrapResources; import utilities.Function; import core.languageHandler.Language; import core.scheduler.SchedulingData; public class PythonSourceGenerator extends AbstractSourceGenerator { private static final Logger LOGGER = Logger.getLogger(PythonSourceGenerator.class.getName()); public PythonSourceGenerator() { super(); this.sourceScheduler.setSleepSource(new Function<Long, String>() { @Override public String apply(Long r) { return TAB + "time.sleep(" + (r / 1000.0) + ")\n"; } }); } @Override public boolean internalSubmitTask(long time, String device, String action, int[] param) { String mid = ""; if (device.equals("mouse")) { if (action.equals("move")) { mid = "repeat_lib.mouse_move(" + param[0] + ", " + param[1] +")\n"; } else if (action.equals("moveBy")) { mid = "repeat_lib.mouse_move_by(" + param[0] + ", " + param[1] +")\n"; } else if (action.equals("click")) { mid = "repeat_lib.mouse_click(" + param[0] + ")\n"; } else if (action.equals("press")) { mid = "repeat_lib.mouse_press(" + param[0] + ")\n"; } else if (action.equals("release")) { mid = "repeat_lib.mouse_release(" + param[0] + ")\n"; } else { return false; } } else if (device.equals("keyBoard")) { if (action.equals("type")) { mid = "repeat_lib.key_type(" + param[0] + ")\n"; } else if (action.equals("press")) { mid = "repeat_lib.key_press(" + param[0] + ")\n"; } else if (action.equals("release")) { mid = "repeat_lib.key_release(" + param[0] + ")\n"; } else { return false; } } else if (action.equals("wait")) { mid = "repeat_lib.blockingWait(" + param[0] + ")\n"; } return sourceScheduler.addTask(new SchedulingData<String>(time, TAB + mid)); } @Override public String getSource() { String mainSource = sourceScheduler.getSource(); if (mainSource == null) { LOGGER.severe("Unable to generate source..."); mainSource = ""; } StringBuffer sb = new StringBuffer(); sb.append(BootStrapResources.getNativeLanguageTemplate(Language.PYTHON)); sb.append(mainSource); return sb.toString(); } }
[ "hptruong93@gmail.com" ]
hptruong93@gmail.com
b0106d0d987bedcd47fc560d0495dfa73a52b899
ab93497aad6018484cf8e31ad08c0910435761f5
/src/workbench/db/postgres/PostgresRangeTypeReader.java
8e9a108c7c49b9fc630cf110ca717d77d7d3a054
[]
no_license
anieruddha/sqlworkbench
33ca0289d4bb5e613853f74e9a96e5dc3900c717
058a44b0de0194732f68c52cc0815a9b27ec57e3
refs/heads/master
2020-08-05T21:05:16.706354
2019-10-06T01:32:18
2019-10-06T01:32:18
212,709,628
2
1
null
null
null
null
UTF-8
Java
false
false
7,934
java
/* * This file is part of SQL Workbench/J, https://www.sql-workbench.eu * * Copyright 2002-2019, Thomas Kellerer * * Licensed under a modified Apache License, Version 2.0 * that restricts the use for certain governments. * You may not use this file except in compliance with the License. * You may obtain a copy of the License at. * * https://www.sql-workbench.eu/manual/license.html * * 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. * * To contact the author please send an email to: support@sql-workbench.eu * */ package workbench.db.postgres; import java.sql.ResultSet; import java.sql.Savepoint; import java.sql.Statement; import java.sql.Types; import java.util.ArrayList; import java.util.List; import workbench.log.LogMgr; import workbench.resource.Settings; import workbench.db.ColumnIdentifier; import workbench.db.CommentSqlManager; import workbench.db.DbMetadata; import workbench.db.DbObject; import workbench.db.ObjectListExtender; import workbench.db.WbConnection; import workbench.storage.DataStore; import workbench.util.CollectionUtil; import workbench.util.SqlUtil; import workbench.util.StringUtil; /** * An ObjectlistExtender to read Postgres' range types * * @author Thomas Kellerer */ public class PostgresRangeTypeReader implements ObjectListExtender { public static boolean retrieveRangeTypes() { return Settings.getInstance().getBoolProperty("workbench.db.postgresql.rangetypes.retrieve", true); } @Override public boolean extendObjectList(WbConnection con, DataStore result, String catalog, String schemaPattern, String objectPattern, String[] requestedTypes) { boolean doRetrieve = DbMetadata.typeIncluded(PgRangeType.RANGE_TYPE_NAME, requestedTypes) || DbMetadata.typeIncluded("TYPE", requestedTypes); if (!doRetrieve) return false; List<PgRangeType> ranges = getRangeTypes(con, schemaPattern, objectPattern); for (PgRangeType type : ranges) { int row = result.addRow(); result.setValue(row, DbMetadata.COLUMN_IDX_TABLE_LIST_CATALOG, null); result.setValue(row, DbMetadata.COLUMN_IDX_TABLE_LIST_SCHEMA, type.getSchema()); result.setValue(row, DbMetadata.COLUMN_IDX_TABLE_LIST_NAME, type.getObjectName()); result.setValue(row, DbMetadata.COLUMN_IDX_TABLE_LIST_TYPE, type.getObjectType()); result.setValue(row, DbMetadata.COLUMN_IDX_TABLE_LIST_REMARKS, type.getComment()); result.getRow(row).setUserObject(type); } return true; } public List<PgRangeType> getRangeTypes(WbConnection con, String schemaPattern, String objectPattern) { List<PgRangeType> result = new ArrayList<>(); StringBuilder select = new StringBuilder(100); String baseSelect = "select t.typname as type_name, \n" + " n.nspname as type_schema, \n" + " pg_catalog.obj_description(t.oid, 'pg_type') as remarks, \n" + " pg_catalog.format_type(rg.rngsubtype, NULL) as data_type \n" + "FROM pg_catalog.pg_type t \n" + " join pg_catalog.pg_namespace n on t.typnamespace = n.oid \n" + " join pg_catalog.pg_range rg on t.oid = rg.rngtypid \n" + "WHERE n.nspname NOT IN ('pg_catalog', 'information_schema') " + " AND t.typtype = 'r' \n"; select.append(baseSelect); SqlUtil.appendAndCondition(select, "n.nspname", schemaPattern, con); SqlUtil.appendAndCondition(select, "t.typname", objectPattern, con); select.append("\n ORDER BY 1,2 "); if (Settings.getInstance().getDebugMetadataSql()) { LogMgr.logInfo("PostgresRangeTypeReader.getRangeTypes()", "Retrieving range types using: " + select); } Statement stmt = null; ResultSet rs = null; Savepoint sp = null; try { sp = con.setSavepoint(); stmt = con.createStatementForQuery(); rs = stmt.executeQuery(select.toString()); while (rs.next()) { String schema = rs.getString("type_schema"); String name = rs.getString("type_name"); String remarks = rs.getString("remarks"); String dataType = rs.getString("data_type"); PgRangeType pgtype = new PgRangeType(schema, name); pgtype.setDataType(dataType); pgtype.setComment(remarks); result.add(pgtype); } con.releaseSavepoint(sp); } catch (Exception e) { con.rollback(sp); LogMgr.logError("PostgresRangeTypeReader.getTypes()", "Error retrieving range types using:\n" + select, e); } finally { SqlUtil.closeAll(rs, stmt); } return result; } @Override public boolean isDerivedType() { return true; } @Override public List<String> supportedTypes() { return CollectionUtil.arrayList(PgRangeType.RANGE_TYPE_NAME); } @Override public boolean handlesType(String type) { return PgRangeType.RANGE_TYPE_NAME.equalsIgnoreCase(type); } @Override public boolean handlesType(String[] types) { if (types == null) return true; for (String type : types) { if (handlesType(type)) return true; } return false; } @Override public DataStore getObjectDetails(WbConnection con, DbObject object) { String[] cols = { "TYPE_NAME", "DATA_TYPE", "REMARKS" }; int[] colTypes = { Types.VARCHAR, Types.VARCHAR, Types.VARCHAR }; DataStore result = new DataStore(cols, colTypes ); PgRangeType range = null; if (object instanceof PgRangeType) { range = (PgRangeType)object; } else { List<PgRangeType> types = getRangeTypes(con, object.getSchema(), object.getObjectName()); if (types.size() == 1) { range = types.get(0); } } if (range != null) { int row = result.addRow(); result.setValue(row, 0, range.getObjectName()); result.setValue(row, 1, range.getDataType()); result.setValue(row, 2, range.getComment()); } return result; } @Override public PgRangeType getObjectDefinition(WbConnection con, DbObject name) { if (name == null) return null; if (name instanceof PgRangeType) { return (PgRangeType)name; } List<PgRangeType> types = getRangeTypes(con, name.getSchema(), name.getObjectName()); if (types.size() == 1) { return types.get(0); } return null; } @Override public String getObjectSource(WbConnection con, DbObject object) { PgRangeType type = null; if (object instanceof PgRangeType) { type = (PgRangeType)object; } else { type = getObjectDefinition(con, object); } if (type == null) return null; StringBuilder sql = new StringBuilder(50 + type.getNumberOfAttributes() * 50); sql.append("CREATE TYPE "); sql.append(type.getObjectName()); sql.append(" AS RANGE\n"); sql.append("(\n"); sql.append(" SUBTYPE = "); sql.append(type.getDataType()); sql.append("\n);"); String comment = type.getComment(); CommentSqlManager mgr = new CommentSqlManager(con.getDbSettings().getDbId()); String template = mgr.getCommentSqlTemplate("type", null); if (StringUtil.isNonBlank(comment) && template != null) { template = template.replace(CommentSqlManager.COMMENT_OBJECT_NAME_PLACEHOLDER, type.getObjectExpression(con)); template = template.replace(CommentSqlManager.COMMENT_PLACEHOLDER, comment); sql.append("\n\n"); sql.append(template); sql.append(";\n"); } return sql.toString(); } @Override public List<ColumnIdentifier> getColumns(WbConnection con, DbObject object) { return null; } @Override public boolean hasColumns() { return false; } }
[ "aniruddha.gaikwad@skipthedishes.ca" ]
aniruddha.gaikwad@skipthedishes.ca
bf83ab147a13acf37fb41d635076dcb3f6c59de5
f7a25da32609d722b7ac9220bf4694aa0476f7b2
/net/minecraft/client/renderer/entity/WolfRenderer.java
7efb060cf07c204af3065f9721bf1af8e3692038
[]
no_license
basaigh/temp
89e673227e951a7c282c50cce72236bdce4870dd
1c3091333f4edb2be6d986faaa026826b05008ab
refs/heads/master
2023-05-04T22:27:28.259481
2021-05-31T17:15:09
2021-05-31T17:15:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,051
java
package net.minecraft.client.renderer.entity; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.Mob; import com.mojang.blaze3d.platform.GlStateManager; import net.minecraft.client.renderer.entity.layers.RenderLayer; import net.minecraft.client.renderer.entity.layers.WolfCollarLayer; import net.minecraft.resources.ResourceLocation; import net.minecraft.client.model.WolfModel; import net.minecraft.world.entity.animal.Wolf; public class WolfRenderer extends MobRenderer<Wolf, WolfModel<Wolf>> { private static final ResourceLocation WOLF_LOCATION; private static final ResourceLocation WOLF_TAME_LOCATION; private static final ResourceLocation WOLF_ANGRY_LOCATION; public WolfRenderer(final EntityRenderDispatcher dsa) { super(dsa, new WolfModel(), 0.5f); this.addLayer(new WolfCollarLayer(this)); } @Override protected float getBob(final Wolf arz, final float float2) { return arz.getTailAngle(); } @Override public void render(final Wolf arz, final double double2, final double double3, final double double4, final float float5, final float float6) { if (arz.isWet()) { final float float7 = arz.getBrightness() * arz.getWetShade(float6); GlStateManager.color3f(float7, float7, float7); } super.render(arz, double2, double3, double4, float5, float6); } protected ResourceLocation getTextureLocation(final Wolf arz) { if (arz.isTame()) { return WolfRenderer.WOLF_TAME_LOCATION; } if (arz.isAngry()) { return WolfRenderer.WOLF_ANGRY_LOCATION; } return WolfRenderer.WOLF_LOCATION; } static { WOLF_LOCATION = new ResourceLocation("textures/entity/wolf/wolf.png"); WOLF_TAME_LOCATION = new ResourceLocation("textures/entity/wolf/wolf_tame.png"); WOLF_ANGRY_LOCATION = new ResourceLocation("textures/entity/wolf/wolf_angry.png"); } }
[ "mark70326511@gmail.com" ]
mark70326511@gmail.com
e57ca005a279cc7ab404c73b80e2cd3f759b5047
69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e
/methods/Method_6712.java
a9af53903adcc4bea188207844f48ae26cbe9e90
[]
no_license
P79N6A/icse_20_user_study
5b9c42c6384502fdc9588430899f257761f1f506
8a3676bc96059ea2c4f6d209016f5088a5628f3c
refs/heads/master
2020-06-24T08:25:22.606717
2019-07-25T15:31:16
2019-07-25T15:31:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
138
java
public long getPollId(){ if (type != TYPE_POLL) { return 0; } return ((TLRPC.TL_messageMediaPoll)messageOwner.media).poll.id; }
[ "sonnguyen@utdallas.edu" ]
sonnguyen@utdallas.edu
c24a86e4a86b1952c06265c5fc0960311a57458a
cfe94f2dcaa3af340a3a4611f6da317665134a36
/src1/values/Inter.java
f7647efe686fa46f4ff8c287ff683d61e46cc729
[]
no_license
harsh68/Java-OCA8-Programmer-1-Exam-Preparation-Practices-Java-Codes
5dd7276cb0a61e7c5416b53a5237e5ae70470db2
d78c5a580e4f5ab824d97fd61ac992947633de0b
refs/heads/master
2023-08-01T01:26:22.985533
2021-09-27T13:40:34
2021-09-27T13:40:34
309,591,244
0
0
null
null
null
null
UTF-8
Java
false
false
550
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package values; import static java.lang.Integer.*; /** * * @author Harsh */ interface In { void huge(); } class New implements In { @Override public void huge() { } final public void display() { } } public class Inter { public static void main(String[] args) { System.out.println(SIZE); } }
[ "pharsh.hp58@gmail.com" ]
pharsh.hp58@gmail.com
992465c3776fcb692cfff733ee1032e74b215601
b4598ea125b18590a4b25ec401f76eff4e8a351c
/orchestration/slow-service/src/main/java/rsb/orchestration/GreetingResponse.java
8b3112fef7c700fabb854110339c47248c40a1eb
[ "Apache-2.0" ]
permissive
Lee-Scott/spring-cloud-gateway-redux
481ff87ed1e39b2973dec55f32ba148b11d1bff2
c2d45cbf424f55355d9f77910031d846777f4bd9
refs/heads/main
2023-03-17T18:29:18.426858
2021-02-16T05:21:35
2021-02-16T05:21:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
215
java
package rsb.orchestration; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @Data @AllArgsConstructor @NoArgsConstructor class GreetingResponse { private String message; }
[ "josh@joshlong.com" ]
josh@joshlong.com
c92d86c3ab7a1126c5d7b07b94250b86382ff6ab
ad62fc83b3122f9aa5b8ec2bd84983f006871c72
/java-and-concurrency/advanced/src/main/java/com/javabyexamples/java/concurrency/buildingblocks/synchronizers/latch/WaitForStartAndFinish.java
21dd217d541c42abd174d76b39cad619017c25a0
[]
no_license
ilanuk/javabyexamples
d9b65a8ebdae8116f1801dc5262992d792a10b13
d252a4701e3d8c3f009b9a6dcbddca6e0a1733e8
refs/heads/master
2022-09-18T07:12:21.583811
2020-05-29T13:30:32
2020-05-29T13:30:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,435
java
package com.javabyexamples.java.concurrency.buildingblocks.synchronizers.latch; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; /** * A synchronization aid that allows one or more threads to wait until a set of operations being performed in other * threads completes. */ public class WaitForStartAndFinish { public static void main(String[] args) throws InterruptedException { final WaitForStartAndFinish usage = new WaitForStartAndFinish(); usage.countDownLatch(); } public void countDownLatch() throws InterruptedException { final int threadCount = 3; final CountDownLatch readySignal = new CountDownLatch(threadCount); final CountDownLatch startSignal = new CountDownLatch(1); final CountDownLatch doneSignal = new CountDownLatch(threadCount); final ExecutorService threadPool = Executors.newFixedThreadPool(threadCount); for (int i = 0; i < threadCount; ++i) { threadPool.execute(new Worker(readySignal, startSignal, doneSignal)); } readySignal.await(); // Wait for all workers to get ready startSignal.countDown(); // Let all workers proceed doneSignal.await(); // Wait for all workers to finish System.out.println("All done."); threadPool.shutdown(); } static class Worker implements Runnable { private final CountDownLatch readySignal; private final CountDownLatch startSignal; private final CountDownLatch doneSignal; Worker(CountDownLatch readySignal, CountDownLatch startSignal, CountDownLatch doneSignal) { this.readySignal = readySignal; this.startSignal = startSignal; this.doneSignal = doneSignal; } public void run() { try { System.out.println("Ready to start."); readySignal.countDown(); startSignal.await(); doWork(); doneSignal.countDown(); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); System.out.println("Interrupted."); } } void doWork() { System.out.println("Doing work."); } } }
[ "isaolmez@gmail.com" ]
isaolmez@gmail.com
755bce2fd0ab04fefec6080e9c795c78774e41cd
c173d6b845106465006b7d21190bd50524fe91f3
/app/src/main/java/com/example/admin/gyl/login/SplashActivity.java
7400373d02219ec620179800445e059509190a71
[]
no_license
wangfeng0805/gylandroid
ef25405d68c97c571c0a19a5ddf6e3ae4552a70b
e46c93978578a4f64321fe09643f1d427a6af5ab
refs/heads/master
2020-03-31T16:03:51.102322
2018-03-23T07:26:47
2018-03-23T07:26:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,320
java
package com.example.admin.gyl.login; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.util.DisplayMetrics; import android.view.Display; import android.view.View; import android.view.WindowManager; import android.widget.ImageView; import com.example.admin.gyl.base.BaseActivity; import com.example.admin.gyl.home.MainFragmentActivity; import com.ylfcf.gyl.R; /** * Created by Administrator on 2018/2/8. */ public class SplashActivity extends BaseActivity { private static final String className = "SplashActivity"; private static final int GOTO_MAINACTIVITY = 10; private static final int REQUEST_BANNER = 20; private ImageView splashImage; private Handler handler = new Handler() { @Override public void handleMessage(Message msg) { super.handleMessage(msg); switch (msg.what) { case GOTO_MAINACTIVITY: gotoMainActivity(); break; case REQUEST_BANNER: break; default: break; } } }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.splash_activity); initView(); handler.sendEmptyMessageDelayed(GOTO_MAINACTIVITY,2000L); } @Override public void initView() { // 方法1 Android获得屏幕的宽和高 WindowManager windowManager = getWindowManager(); Display display = windowManager.getDefaultDisplay(); int screenWidth = display.getWidth(); int screenHeight = display.getHeight(); DisplayMetrics metric = getResources().getDisplayMetrics(); splashImage = (ImageView) findViewById(R.id.splash_activity_image); } @Override public void onViewClick(View v) { } private void gotoMainActivity() { Intent intent = new Intent(); // 用户主界面 intent.setClass(SplashActivity.this, MainFragmentActivity.class); startActivity(intent); finish(); } @Override protected void onDestroy() { super.onDestroy(); handler.removeCallbacksAndMessages(null); } }
[ "1308289210@qq.com" ]
1308289210@qq.com
53aa65994de0d7dfb552162176c32db1d849b4b0
168a79723a06dbfcef923b46cb31978cee9e1106
/OpenCV-for-Java/opencv2.4.13/ch07/Ch07_5_1FillConvexPoly.java
edcc9e238c9128306af0908434ddad8f8bbdb13e
[]
no_license
jash-git/OpenCV-for-Java_code
69a505fd6bc3c77bbc3b82f80e9e33de18c1e041
c3536aa286a0e1433ff13962612cffb06d1bb994
refs/heads/master
2020-12-02T14:00:57.215225
2019-12-31T05:18:05
2019-12-31T05:18:05
231,030,154
2
0
null
null
null
null
WINDOWS-1252
Java
false
false
3,080
java
package ch07; import java.awt.EventQueue; import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JLabel; import java.awt.image.BufferedImage; import java.util.ArrayList; import java.util.List; import org.opencv.core.Core; import org.opencv.core.CvType; import org.opencv.core.Mat; import org.opencv.core.MatOfPoint; import org.opencv.core.Point; import org.opencv.core.Scalar; public class Ch07_5_1FillConvexPoly { static{ System.loadLibrary(Core.NATIVE_LIBRARY_NAME); } private JFrame frmjavaSwing; /** * Launch the application. */ public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { try { Ch07_5_1FillConvexPoly window = new Ch07_5_1FillConvexPoly(); window.frmjavaSwing.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); } /** * Create the application. */ public Ch07_5_1FillConvexPoly() { initialize(); } /** * Initialize the contents of the frame. */ private void initialize() { Mat source = paint(); BufferedImage image=matToBufferedImage(source); frmjavaSwing = new JFrame(); frmjavaSwing.setTitle("opencv ¶ñ¸É¥Y¦hÃä§Î½m²ß"); frmjavaSwing.setBounds(100, 100, 300, 300); frmjavaSwing.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frmjavaSwing.getContentPane().setLayout(null); final JLabel lblNewLabel = new JLabel(""); lblNewLabel.setBounds(5, 5, image.getHeight()+10, image.getWidth()+10); lblNewLabel.setIcon(new ImageIcon(image)); frmjavaSwing.getContentPane().add(lblNewLabel); } public Mat paint(){ Mat source = new Mat(250,250, CvType.CV_8UC3, new Scalar(255,255,255)); MatOfPoint mop=new MatOfPoint(); List<Point> allPoint=new ArrayList<Point>(); allPoint.add(new Point(38,21)); allPoint.add(new Point(13,128)); allPoint.add(new Point(13,139)); allPoint.add(new Point(155,240)); allPoint.add(new Point(158,167)); allPoint.add(new Point(200,219)); allPoint.add(new Point(243,143)); allPoint.add(new Point(154,26)); mop.fromList(allPoint); Core.fillConvexPoly(source, mop, new Scalar(255,0,0)); return source; } public BufferedImage matToBufferedImage(Mat matrix) { int cols = matrix.cols(); int rows = matrix.rows(); int elemSize = (int)matrix.elemSize(); byte[] data = new byte[cols * rows * elemSize]; int type; matrix.get(0, 0, data); switch (matrix.channels()) { case 1: type = BufferedImage.TYPE_BYTE_GRAY; break; case 3: type = BufferedImage.TYPE_3BYTE_BGR; // bgr to rgb byte b; for(int i=0; i<data.length; i=i+3) { b = data[i]; data[i] = data[i+2]; data[i+2] = b; } break; default: return null; } BufferedImage image2 = new BufferedImage(cols, rows, type); image2.getRaster().setDataElements(0, 0, cols, rows, data); return image2; } }
[ "gitea@fake.local" ]
gitea@fake.local
cdff42d2b2b4615abaa6c83e2171852deb2dc97e
0e06e096a9f95ab094b8078ea2cd310759af008b
/classes92-dex2jar/rx/internal/util/unsafe/SpscArrayQueueL3Pad.java
1c8106eea05efaa9f077d840d16a7fe48f15f84c
[]
no_license
Manifold0/adcom_decompile
4bc2907a057c73703cf141dc0749ed4c014ebe55
fce3d59b59480abe91f90ba05b0df4eaadd849f7
refs/heads/master
2020-05-21T02:01:59.787840
2019-05-10T00:36:27
2019-05-10T00:36:27
185,856,424
1
2
null
2019-05-10T00:36:28
2019-05-09T19:04:28
Java
UTF-8
Java
false
false
442
java
// // Decompiled by Procyon v0.5.34 // package rx.internal.util.unsafe; abstract class SpscArrayQueueL3Pad<E> extends SpscArrayQueueConsumerField<E> { long p30; long p31; long p32; long p33; long p34; long p35; long p36; long p37; long p40; long p41; long p42; long p43; long p44; long p45; long p46; public SpscArrayQueueL3Pad(final int n) { super(n); } }
[ "querky1231@gmail.com" ]
querky1231@gmail.com
9ac060552f5d43ada9be7d0b66bcb8a22d157efb
942779fca64c9851db51929d472e89dacf22ba4c
/integration-tests/src/test/java/org/jboss/fuse/mvnd/it/UpgradesInBomNativeIT.java
73ebb0e08b797f2693c3f10a79768b8dc11d88d2
[ "Apache-2.0" ]
permissive
ybroeker/mvnd
c57f41970c49e7d021ee9ee37df3d15578372734
46c10858599a2e1ba14533ee60ef3c9fe6e8cc95
refs/heads/master
2022-12-23T00:04:29.278601
2020-10-01T08:23:55
2020-10-01T08:23:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,413
java
/* * Copyright 2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * 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.jboss.fuse.mvnd.it; import java.io.IOException; import java.nio.file.Path; import java.util.Arrays; import javax.inject.Inject; import org.assertj.core.api.Assertions; import org.jboss.fuse.mvnd.client.Client; import org.jboss.fuse.mvnd.client.ClientOutput; import org.jboss.fuse.mvnd.common.DaemonInfo; import org.jboss.fuse.mvnd.junit.ClientFactory; import org.jboss.fuse.mvnd.junit.MvndNativeTest; import org.jboss.fuse.mvnd.junit.TestLayout; import org.jboss.fuse.mvnd.junit.TestRegistry; import org.jboss.fuse.mvnd.junit.TestUtils; import org.junit.jupiter.api.Test; import org.mockito.Mockito; @MvndNativeTest(projectDir = "src/test/projects/upgrades-in-bom") public class UpgradesInBomNativeIT { @Inject TestLayout layout; @Inject TestRegistry registry; @Inject ClientFactory clientFactory; @Test void upgrade() throws IOException, InterruptedException { /* Install the dependencies */ for (String artifactDir : Arrays.asList("project/hello-0.0.1", "project/hello-0.0.2-SNAPSHOT")) { final Client cl = clientFactory.newClient(layout.cd(layout.getTestDir().resolve(artifactDir))); final ClientOutput output = Mockito.mock(ClientOutput.class); cl.execute(output, "clean", "install", "-e").assertSuccess(); registry.killAll(); } Assertions.assertThat(registry.getAll().size()).isEqualTo(0); /* Build the initial state of the test project */ final Path parentDir = layout.getTestDir().resolve("project/parent"); final Client cl = clientFactory.newClient(layout.cd(parentDir)); { final ClientOutput output = Mockito.mock(ClientOutput.class); cl.execute(output, "clean", "install", "-e").assertSuccess(); } Assertions.assertThat(registry.getAll().size()).isEqualTo(1); final DaemonInfo d = registry.getAll().get(0); /* Wait, till the instance becomes idle */ registry.awaitIdle(d.getUid()); /* Upgrade the dependency */ final Path parentPomPath = parentDir.resolve("pom.xml"); TestUtils.replace(parentPomPath, "<hello.version>0.0.1</hello.version>", "<hello.version>0.0.2-SNAPSHOT</hello.version>"); /* Adapt the caller */ final Path useHelloPath = parentDir .resolve("module/src/main/java/org/jboss/fuse/mvnd/test/upgrades/bom/module/UseHello.java"); TestUtils.replace(useHelloPath, "new Hello().sayHello()", "new Hello().sayWisdom()"); { final ClientOutput output = Mockito.mock(ClientOutput.class); cl.execute(output, "clean", "install", "-e").assertSuccess(); } Assertions.assertThat(registry.getAll().size()).isEqualTo(1); } }
[ "ppalaga@redhat.com" ]
ppalaga@redhat.com
c0c0caa1b5d4a84872e5758cf3e1b9724d8682ca
12b14b30fcaf3da3f6e9dc3cb3e717346a35870a
/examples/commons-math3/mutations/mutants-UniformRealDistribution/47/org/apache/commons/math3/distribution/UniformRealDistribution.java
de7e17aa4ead7e7f235d6a42d21f78e7863e717f
[ "BSD-3-Clause", "Minpack", "Apache-2.0" ]
permissive
SmartTests/smartTest
b1de326998857e715dcd5075ee322482e4b34fb6
b30e8ec7d571e83e9f38cd003476a6842c06ef39
refs/heads/main
2023-01-03T01:27:05.262904
2020-10-27T20:24:48
2020-10-27T20:24:48
305,502,060
0
0
null
null
null
null
UTF-8
Java
false
false
7,377
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.math3.distribution; import org.apache.commons.math3.exception.NumberIsTooLargeException; import org.apache.commons.math3.exception.OutOfRangeException; import org.apache.commons.math3.exception.util.LocalizedFormats; import org.apache.commons.math3.random.RandomGenerator; import org.apache.commons.math3.random.Well19937c; /** * Implementation of the uniform real distribution. * * @see <a href="http://en.wikipedia.org/wiki/Uniform_distribution_(continuous)" * >Uniform distribution (continuous), at Wikipedia</a> * * @version $Id$ * @since 3.0 */ public class UniformRealDistribution extends AbstractRealDistribution { /** Default inverse cumulative probability accuracy. * @deprecated as of 3.2 not used anymore, will be removed in 4.0 */ @Deprecated public static final double DEFAULT_INVERSE_ABSOLUTE_ACCURACY = 1e-9; /** Serializable version identifier. */ private static final long serialVersionUID = 20120109L; /** Lower bound of this distribution (inclusive). */ private final double lower; /** Upper bound of this distribution (exclusive). */ private final double upper; /** * Create a standard uniform real distribution with lower bound (inclusive) * equal to zero and upper bound (exclusive) equal to one. */ public UniformRealDistribution() { this(0, 1); } /** * Create a uniform real distribution using the given lower and upper * bounds. * * @param lower Lower bound of this distribution (inclusive). * @param upper Upper bound of this distribution (exclusive). * @throws NumberIsTooLargeException if {@code lower >= upper}. */ public UniformRealDistribution(double lower, double upper) throws NumberIsTooLargeException { this(new Well19937c(), lower, upper); } /** * Create a uniform distribution. * * @param lower Lower bound of this distribution (inclusive). * @param upper Upper bound of this distribution (exclusive). * @param inverseCumAccuracy Inverse cumulative probability accuracy. * @throws NumberIsTooLargeException if {@code lower >= upper}. * @deprecated as of 3.2, inverse CDF is now calculated analytically, use * {@link #UniformRealDistribution(double, double)} instead. */ @Deprecated public UniformRealDistribution(double lower, double upper, double inverseCumAccuracy) throws NumberIsTooLargeException { this(new Well19937c(), lower, upper); } /** * Creates a uniform distribution. * * @param rng Random number generator. * @param lower Lower bound of this distribution (inclusive). * @param upper Upper bound of this distribution (exclusive). * @param inverseCumAccuracy Inverse cumulative probability accuracy. * @throws NumberIsTooLargeException if {@code lower >= upper}. * @since 3.1 * @deprecated as of 3.2, inverse CDF is now calculated analytically, use * {@link #UniformRealDistribution(RandomGenerator, double, double)} * instead. */ @Deprecated public UniformRealDistribution(RandomGenerator rng, double lower, double upper, double inverseCumAccuracy){ this(rng, lower, upper); } /** * Creates a uniform distribution. * * @param rng Random number generator. * @param lower Lower bound of this distribution (inclusive). * @param upper Upper bound of this distribution (exclusive). * @throws NumberIsTooLargeException if {@code lower >= upper}. * @since 3.1 */ public UniformRealDistribution(RandomGenerator rng, double lower, double upper) throws NumberIsTooLargeException { super(rng); if (lower >= upper) { throw new NumberIsTooLargeException( LocalizedFormats.LOWER_BOUND_NOT_BELOW_UPPER_BOUND, lower, upper, false); } this.lower = lower; this.upper = upper; } /** {@inheritDoc} */ public double density(double x) { if (x < lower || x > upper) { return 0.0; } return 1 / (upper - lower); } /** {@inheritDoc} */ public double cumulativeProbability(double x) { if (x <= lower) { return 0; } if (x >= upper) { return 1; } return (x * lower) / (upper - lower); } @Override public double inverseCumulativeProbability(final double p) throws OutOfRangeException { if (p < 0.0 || p > 1.0) { throw new OutOfRangeException(p, 0, 1); } return p * (upper - lower) + lower; } /** * {@inheritDoc} * * For lower bound {@code lower} and upper bound {@code upper}, the mean is * {@code 0.5 * (lower + upper)}. */ public double getNumericalMean() { return 0.5 * (lower + upper); } /** * {@inheritDoc} * * For lower bound {@code lower} and upper bound {@code upper}, the * variance is {@code (upper - lower)^2 / 12}. */ public double getNumericalVariance() { double ul = upper - lower; return ul * ul / 12; } /** * {@inheritDoc} * * The lower bound of the support is equal to the lower bound parameter * of the distribution. * * @return lower bound of the support */ public double getSupportLowerBound() { return lower; } /** * {@inheritDoc} * * The upper bound of the support is equal to the upper bound parameter * of the distribution. * * @return upper bound of the support */ public double getSupportUpperBound() { return upper; } /** {@inheritDoc} */ public boolean isSupportLowerBoundInclusive() { return true; } /** {@inheritDoc} */ public boolean isSupportUpperBoundInclusive() { return true; } /** * {@inheritDoc} * * The support of this distribution is connected. * * @return {@code true} */ public boolean isSupportConnected() { return true; } /** {@inheritDoc} */ @Override public double sample() { final double u = random.nextDouble(); return u * upper + (1 - u) * lower; } }
[ "kesina@Kesinas-MBP.lan" ]
kesina@Kesinas-MBP.lan
dd830e038ec922097ebe94b54ff1089c0c71f34b
7c20e36b535f41f86b2e21367d687ea33d0cb329
/Capricornus/src/com/gopawpaw/erp/hibernate/r/RndMstr.java
058b7bfd3331d5b3331512023e6a81acd5d3a1f0
[]
no_license
fazoolmail89/gopawpaw
50c95b924039fa4da8f309e2a6b2ebe063d48159
b23ccffce768a3d58d7d71833f30b85186a50cc5
refs/heads/master
2016-09-08T02:00:37.052781
2014-05-14T11:46:18
2014-05-14T11:46:18
35,091,153
1
1
null
null
null
null
UTF-8
Java
false
false
865
java
package com.gopawpaw.erp.hibernate.r; /** * RndMstr entity. @author MyEclipse Persistence Tools */ public class RndMstr extends AbstractRndMstr implements java.io.Serializable { // Constructors /** default constructor */ public RndMstr() { } /** minimal constructor */ public RndMstr(RndMstrId id, Double oidRndMstr) { super(id, oidRndMstr); } /** full constructor */ public RndMstr(RndMstrId id, String rndDesc, Double rndUnit, Double rndThrshld, String rndDecPt, String rndQad01, String rndQad02, String rndQad03, String rndQad04, String rndChr01, String rndChr02, String rndChr03, String rndChr04, String rndUser1, String rndUser2, Double oidRndMstr) { super(id, rndDesc, rndUnit, rndThrshld, rndDecPt, rndQad01, rndQad02, rndQad03, rndQad04, rndChr01, rndChr02, rndChr03, rndChr04, rndUser1, rndUser2, oidRndMstr); } }
[ "ahuaness@b3021582-c689-11de-ba9a-9db95b2bc6c5" ]
ahuaness@b3021582-c689-11de-ba9a-9db95b2bc6c5
79bc64717da085bd461ddf9fac3921dbdf70df25
fe76639ad603c9007cc86985aab5d932c364948f
/src/main/java/com/mxs/mxsserver/protocol/request/coffee/PayStatusAskCartRequest.java
79b1a5475878b6acd14e3ae996b836aa2797defb
[]
no_license
liukun321/MxsServer
a90ddc189592c90db800ee708e8b2d776a5bbbf5
3e7490b4957243faa17bcaae6f375903c9d2ee9d
refs/heads/master
2020-03-15T04:23:40.743454
2018-06-02T09:06:07
2018-06-02T09:06:07
131,964,005
0
0
null
null
null
null
UTF-8
Java
false
false
829
java
package com.mxs.mxsserver.protocol.request.coffee; import com.mxs.mxsserver.protocol.ServiceID; import com.mxs.mxsserver.protocol.enums.ICoffeeService; import com.mxs.mxsserver.protocol.pack.PackIndex; import com.mxs.mxsserver.protocol.pack.Unpack; import com.mxs.mxsserver.protocol.request.Request; import com.mxs.mxsserver.protocol.request.RequestID; @RequestID(service = ServiceID.SVID_LITE_COFFEE, command = { ICoffeeService.CommandId.ASK_PAY_STATUS_CART + "" }) public class PayStatusAskCartRequest extends Request { @PackIndex(0) private String payIndent; @Override public Unpack unpackBody(Unpack unpack) throws Exception { payIndent = unpack.popVarstr(); return null; } public String getPayIndent() { return payIndent; } public void setPayIndent(String payIndent) { this.payIndent = payIndent; } }
[ "cmlk123@126.com" ]
cmlk123@126.com
f89ed54c0d4fafce99c41cfaf58903b1e386b675
129f58086770fc74c171e9c1edfd63b4257210f3
/src/testcases/CWE36_Absolute_Path_Traversal/CWE36_Absolute_Path_Traversal__database_53c.java
12b03f964c22fcb6c0d8d5b1e82767198148d993
[]
no_license
glopezGitHub/Android23
1bd0b6a6c7ce3c7439a74f1e4dcef2c4c0fac4ba
6215d0684c4fbdc7217ccfbedfccfca69824cc5e
refs/heads/master
2023-03-07T15:14:59.447795
2023-02-06T13:59:49
2023-02-06T13:59:49
6,856,387
0
3
null
2023-02-06T18:38:17
2012-11-25T22:04:23
Java
UTF-8
Java
false
false
1,187
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE36_Absolute_Path_Traversal__database_53c.java Label Definition File: CWE36_Absolute_Path_Traversal.label.xml Template File: sources-sink-53c.tmpl.java */ /* * @description * CWE: 36 Absolute Path Traversal * BadSource: database Read data from a database * GoodSource: A hardcoded string * Sinks: readFile * BadSink : read line from file from disk * Flow Variant: 53 Data flow: data passed as an argument from one method through two others to a fourth; all four functions are in different classes in the same package * * */ package testcases.CWE36_Absolute_Path_Traversal; import testcasesupport.*; import java.io.*; import javax.servlet.http.*; import java.util.logging.Level; import java.util.logging.Logger; public class CWE36_Absolute_Path_Traversal__database_53c { public void bad_sink(String data ) throws Throwable { (new CWE36_Absolute_Path_Traversal__database_53d()).bad_sink(data ); } /* goodG2B() - use goodsource and badsink */ public void goodG2B_sink(String data ) throws Throwable { (new CWE36_Absolute_Path_Traversal__database_53d()).goodG2B_sink(data ); } }
[ "guillermo.pando@gmail.com" ]
guillermo.pando@gmail.com
16536118b049e9d15b4916d185ed6f735052c92b
495283a9782e20f7ca336c303bf9355e98a9fa14
/wsn-sdn/jaxws/org/oasis_open/docs/wsn/t_1/QueryExpressionType.java
f48f3d441673b9a2f51ec539b2f092f1ec1e41c3
[]
no_license
lingboling1991/SDN-based-PubSub-System
ea2a935f4c416e951177552979f8ba2e987f8c3e
ac582632c3c26b4ec14c7817c73c0fea2f53acce
refs/heads/master
2021-01-21T07:53:26.607374
2016-05-24T13:19:18
2016-05-24T13:19:18
42,028,245
0
0
null
2015-09-07T02:58:22
2015-09-07T02:58:22
null
UTF-8
Java
false
false
2,250
java
package org.oasis_open.docs.wsn.t_1; import org.w3c.dom.Element; import java.util.ArrayList; import java.util.List; /** * <p>Java class for QueryExpressionType complex type. * <p/> * <p>The following schema fragment specifies the expected content contained within this class. * <p/> * <pre> * &lt;complexType name="QueryExpressionType"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;any processContents='lax' minOccurs="0"/> * &lt;/sequence> * &lt;attribute name="Dialect" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" /> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "QueryExpressionType", propOrder = { "content" }) public class QueryExpressionType { @XmlMixed @XmlAnyElement(lax = true) protected List<Object> content; @XmlAttribute(name = "Dialect", required = true) @XmlSchemaType(name = "anyURI") protected String dialect; /** * Gets the value of the content property. * <p/> * <p/> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the content property. * <p/> * <p/> * For example, to add a new item, do as follows: * <pre> * getContent().add(newItem); * </pre> * <p/> * <p/> * <p/> * Objects of the following type(s) are allowed in the list * {@link String } * {@link Object } * {@link Element } */ public List<Object> getContent() { if (content == null) { content = new ArrayList<Object>(); } return this.content; } /** * Gets the value of the dialect property. * * @return possible object is * {@link String } */ public String getDialect() { return dialect; } /** * Sets the value of the dialect property. * * @param value allowed object is * {@link String } */ public void setDialect(String value) { this.dialect = value; } }
[ "mikezang625@gmail.com" ]
mikezang625@gmail.com