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
f324f83335d66d6f18139a528dfee33489165e24
e14e25c5b4c7c1ffcb4b8af588d811a1ca8791ec
/src/rlgs4/Selection.java
599e6573fa5482dbcb4d82bb21ea23d74a4dd46c
[]
no_license
BurningBright/algorithms-fourth-edition
6ecd434ebc42449f5f05da1e6d6a94ef64eaab57
46ad5a29154b8094a2cd169308b9922131a74587
refs/heads/master
2021-01-24T07:13:27.408150
2021-01-08T02:42:30
2021-01-08T02:42:30
55,818,397
0
0
null
null
null
null
UTF-8
Java
false
false
3,963
java
package rlgs4; import stdlib.*; import java.util.Comparator; /** * The <tt>Selection</tt> class provides static methods for sorting an * array using selection sort. * <p> * For additional documentation, see <a href="http://algs4.cs.princeton.edu/21elementary">Section 2.1</a> of * <i>Algorithms, 4th Edition</i> by Robert Sedgewick and Kevin Wayne. * * @author Robert Sedgewick * @author Kevin Wayne */ public class Selection { // This class should not be instantiated. private Selection() { } /** * Rearranges the array in ascending order, using the natural order. * @param a the array to be sorted */ @SuppressWarnings("rawtypes") public static void sort(Comparable[] a) { int N = a.length; for (int i = 0; i < N; i++) { int min = i; for (int j = i+1; j < N; j++) { if (less(a[j], a[min])) min = j; } exch(a, i, min); assert isSorted(a, 0, i); } assert isSorted(a); } /** * Rearranges the array in ascending order, using a comparator. * @param a the array * @param c the comparator specifying the order */ @SuppressWarnings("rawtypes") public static void sort(Object[] a, Comparator c) { int N = a.length; for (int i = 0; i < N; i++) { int min = i; for (int j = i+1; j < N; j++) { if (less(c, a[j], a[min])) min = j; } exch(a, i, min); assert isSorted(a, c, 0, i); } assert isSorted(a, c); } /*********************************************************************** * Helper sorting functions ***********************************************************************/ // is v < w ? @SuppressWarnings({ "rawtypes", "unchecked" }) private static boolean less(Comparable v, Comparable w) { return (v.compareTo(w) < 0); } // is v < w ? @SuppressWarnings({ "rawtypes", "unchecked" }) private static boolean less(Comparator c, Object v, Object w) { return (c.compare(v, w) < 0); } // exchange a[i] and a[j] private static void exch(Object[] a, int i, int j) { Object swap = a[i]; a[i] = a[j]; a[j] = swap; } /*********************************************************************** * Check if array is sorted - useful for debugging ***********************************************************************/ // is the array a[] sorted? @SuppressWarnings("rawtypes") private static boolean isSorted(Comparable[] a) { return isSorted(a, 0, a.length - 1); } // is the array sorted from a[lo] to a[hi] @SuppressWarnings("rawtypes") private static boolean isSorted(Comparable[] a, int lo, int hi) { for (int i = lo + 1; i <= hi; i++) if (less(a[i], a[i-1])) return false; return true; } // is the array a[] sorted? @SuppressWarnings("rawtypes") private static boolean isSorted(Object[] a, Comparator c) { return isSorted(a, c, 0, a.length - 1); } // is the array sorted from a[lo] to a[hi] @SuppressWarnings("rawtypes") private static boolean isSorted(Object[] a, Comparator c, int lo, int hi) { for (int i = lo + 1; i <= hi; i++) if (less(c, a[i], a[i-1])) return false; return true; } // print array to standard output @SuppressWarnings("rawtypes") private static void show(Comparable[] a) { for (int i = 0; i < a.length; i++) { StdOut.println(a[i]); } } /** * Reads in a sequence of strings from standard input; selection sorts them; * and prints them to standard output in ascending order. */ public static void main(String[] args) { String[] a = StdIn.readAllStrings(); Selection.sort(a); show(a); } }
[ "lcg51271@gmail.com" ]
lcg51271@gmail.com
b20ea4cdc8e6a068de59495bcdbc36893f3aa18b
cf52b3064d536af626339ddd30b28c0b8e15aaee
/gameserver/src/main/java/org/l2junity/gameserver/model/effects/effecttypes/pump/PumpLimitMp.java
d90167c37ce3b7f8eb28f2433ae7d91bb2b5b634
[]
no_license
LegacyofAden/emu-ungp
7aaa7d9fd60698cb784d8c2c1eaaa20ef0a8d59b
b76dc91157e43d67f886b6926afd11b110ed5dce
refs/heads/master
2021-01-01T18:21:03.529671
2017-04-08T23:08:37
2017-04-08T23:08:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,142
java
/* * Copyright (C) 2004-2015 L2J Unity * * This file is part of L2J Unity. * * L2J Unity is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * L2J Unity is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.l2junity.gameserver.model.effects.effecttypes.pump; import org.l2junity.gameserver.model.StatsSet; import org.l2junity.gameserver.model.effects.AbstractDoubleStatEffect; import org.l2junity.gameserver.model.stats.DoubleStat; /** * @author Sdw */ public class PumpLimitMp extends AbstractDoubleStatEffect { public PumpLimitMp(StatsSet params) { super(params, DoubleStat.MAX_RECOVERABLE_MP); } }
[ "RaaaGEE@users.noreply.github.com" ]
RaaaGEE@users.noreply.github.com
bbe9a685b1e38252410ef5bc791f57cfdf75b843
cbdd81e6b9cf00859ce7169df36cf566417e4c8b
/1.JavaSyntax/src/com/javarush/task/task05/task0526_my/Solution.java
7e4fd98653708391b1ce4e866672894dbee58cac
[]
no_license
id2k1149/JavaRushTasks
3f13cd5d37977e38e8933e581f17fd48597f90d8
450a432649aa20608e6e9a46ada35123056480cf
refs/heads/master
2023-03-31T21:03:06.944109
2021-03-19T00:58:45
2021-03-19T00:58:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,354
java
package com.javarush.task.task05.task0526_my; /* Мужчина и женщина */ public class Solution { public static void main(String[] args) { //напишите тут ваш код Man man1 = new Man("name_1", 18, "US"); System.out.println(man1.name + " " + man1.age + " " + man1.address); Man man2 = new Man("name_2", 19, "US"); System.out.println(man2.name + " " + man2.age + " " + man2.address); Woman woman1 = new Woman("name_3", 20, "US"); System.out.println(woman1.name + " " + woman1.age + " " + woman1.address); Woman woman2 = new Woman("name_4", 21, "US"); System.out.println(woman2.name + " " + woman2.age + " " + woman2.address); } //напишите тут ваш код public static class Man { public String name; public int age; public String address; public Man(String name, int age, String address){ this.name = name; this.age = age; this.address = address; } } public static class Woman { public String name; public int age; public String address; public Woman(String name, int age, String address){ this.name = name; this.age = age; this.address = address; } } }
[ "id2k1149@gmail.com" ]
id2k1149@gmail.com
d86f7ec892cdf3fdd1fe22ab92b2da9b254ec1fa
3cae6b7fe0a2dc4a3a9b64d9805bbd0bf9013844
/src/main/java/com/commonjava/reptoro/remoterepos/RemoteRepositoryVerticle.java
a842aea62cb8b636aff6548f7c63ec0d0df60407
[ "Apache-2.0" ]
permissive
Commonjava/reptoro
6df71f4d642e42708697ca59fc75437a12a570c7
a880996501c936c050e3b07f8db00e7f4f1c0da8
refs/heads/master
2022-11-24T04:27:55.214407
2022-09-08T02:57:23
2022-09-08T02:57:23
221,725,328
1
3
Apache-2.0
2023-09-14T01:50:55
2019-11-14T15:10:07
CSS
UTF-8
Java
false
false
1,963
java
package com.commonjava.reptoro.remoterepos; import io.vertx.core.AbstractVerticle; import io.vertx.core.DeploymentOptions; import io.vertx.core.eventbus.MessageConsumer; import io.vertx.core.json.JsonObject; import io.vertx.ext.web.client.WebClient; import io.vertx.ext.web.client.WebClientOptions; import io.vertx.serviceproxy.ServiceBinder; import java.util.concurrent.TimeUnit; import java.util.logging.Logger; public class RemoteRepositoryVerticle extends AbstractVerticle { Logger logger = Logger.getLogger(this.getClass().getName()); @Override public void start() throws Exception { WebClientOptions webOptions = new WebClientOptions() .setKeepAlive(true) .setTrustAll(true) .setConnectTimeout(60000); RemoteRepositoryServiceImpl remoteRepositoryService = new RemoteRepositoryServiceImpl(vertx, WebClient.create(vertx, webOptions), config()); MessageConsumer<JsonObject> service = new ServiceBinder(vertx) .setAddress("repo.service") .setTimeoutSeconds(TimeUnit.SECONDS.toMillis(60)) // .addInterceptor(msg -> { }) .register(RemoteRepositoryService.class, remoteRepositoryService); vertx.setTimer(TimeUnit.SECONDS.toMillis(1) , time -> { DeploymentOptions repositoryOptions = new DeploymentOptions().setWorker(true).setConfig(config()); vertx.deployVerticle("com.commonjava.reptoro.remoterepos.ProcessingRepositoriesVerticle",repositoryOptions , res -> { if(res.succeeded()) { logger.info(">>> Processing Repo Verticle Deployed! ID: " + res.result()); } else { logger.info(">>> Problem Deploying Repo Processing Verticle: " + res.cause()); } }); }); } }
[ "ggeorgie@redhat.com" ]
ggeorgie@redhat.com
85e3dfd1f43e6d47c4ec07cda2706f251454aa55
c885ef92397be9d54b87741f01557f61d3f794f3
/results/JacksonCore-19/com.fasterxml.jackson.core.json.ReaderBasedJsonParser/BBC-F0-opt-70/tests/30/com/fasterxml/jackson/core/json/ReaderBasedJsonParser_ESTest_scaffolding.java
aa88edf81c39e5e53dc3c30c7771d54544d83dbb
[ "CC-BY-4.0", "MIT" ]
permissive
pderakhshanfar/EMSE-BBC-experiment
f60ac5f7664dd9a85f755a00a57ec12c7551e8c6
fea1a92c2e7ba7080b8529e2052259c9b697bbda
refs/heads/main
2022-11-25T00:39:58.983828
2022-04-12T16:04:26
2022-04-12T16:04:26
309,335,889
0
1
null
2021-11-05T11:18:43
2020-11-02T10:30:38
null
UTF-8
Java
false
false
7,443
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Sat Oct 23 12:52:51 GMT 2021 */ package com.fasterxml.jackson.core.json; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; import org.evosuite.runtime.sandbox.Sandbox; import org.evosuite.runtime.sandbox.Sandbox.SandboxMode; import static org.evosuite.shaded.org.mockito.Mockito.*; @EvoSuiteClassExclude public class ReaderBasedJsonParser_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 = "com.fasterxml.jackson.core.json.ReaderBasedJsonParser"; org.evosuite.runtime.GuiSupport.initialize(); org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100; org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED; org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT(); org.evosuite.runtime.classhandling.JDKClassResetter.init(); setSystemProperties(); initializeClasses(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); try { initMocksToAvoidTimeoutsInTheTests(); } catch(ClassNotFoundException e) {} } @Before public void initTestCase(){ threadStopper.storeCurrentThreads(); threadStopper.startRecordingTime(); org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler(); org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode(); 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.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks(); org.evosuite.runtime.classhandling.JDKClassResetter.reset(); resetClasses(); org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode(); org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); } public static void setSystemProperties() { /*No java.lang.System property to set*/ } private static void initializeClasses() { org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(ReaderBasedJsonParser_ESTest_scaffolding.class.getClassLoader() , "com.fasterxml.jackson.core.JsonParser$NumberType", "com.fasterxml.jackson.core.json.ReaderBasedJsonParser", "com.fasterxml.jackson.core.io.CharTypes", "com.fasterxml.jackson.core.JsonLocation", "com.fasterxml.jackson.core.sym.CharsToNameCanonicalizer", "com.fasterxml.jackson.core.JsonGenerator", "com.fasterxml.jackson.core.SerializableString", "com.fasterxml.jackson.core.Versioned", "com.fasterxml.jackson.core.ObjectCodec", "com.fasterxml.jackson.core.json.JsonReadContext", "com.fasterxml.jackson.core.type.ResolvedType", "com.fasterxml.jackson.core.JsonFactory$Feature", "com.fasterxml.jackson.core.util.InternCache", "com.fasterxml.jackson.core.JsonParser$Feature", "com.fasterxml.jackson.core.JsonPointer", "com.fasterxml.jackson.core.io.SerializedString", "com.fasterxml.jackson.core.JsonEncoding", "com.fasterxml.jackson.core.json.DupDetector", "com.fasterxml.jackson.core.JsonToken", "com.fasterxml.jackson.core.type.TypeReference", "com.fasterxml.jackson.core.JsonParseException", "com.fasterxml.jackson.core.util.BufferRecycler", "com.fasterxml.jackson.core.TreeNode", "com.fasterxml.jackson.core.TreeCodec", "com.fasterxml.jackson.core.io.JsonStringEncoder", "com.fasterxml.jackson.core.JsonParser", "com.fasterxml.jackson.core.Version", "com.fasterxml.jackson.core.JsonProcessingException", "com.fasterxml.jackson.core.JsonStreamContext", "com.fasterxml.jackson.core.util.TextBuffer", "com.fasterxml.jackson.core.sym.CharsToNameCanonicalizer$Bucket", "com.fasterxml.jackson.core.Base64Variant", "com.fasterxml.jackson.core.Base64Variants", "com.fasterxml.jackson.core.JsonFactory", "com.fasterxml.jackson.core.base.ParserMinimalBase", "com.fasterxml.jackson.core.io.NumberInput", "com.fasterxml.jackson.core.util.ByteArrayBuilder", "com.fasterxml.jackson.core.io.IOContext", "com.fasterxml.jackson.core.FormatSchema", "com.fasterxml.jackson.core.base.ParserBase" ); } private static void initMocksToAvoidTimeoutsInTheTests() throws ClassNotFoundException { mock(Class.forName("com.fasterxml.jackson.core.ObjectCodec", false, ReaderBasedJsonParser_ESTest_scaffolding.class.getClassLoader())); mock(Class.forName("com.fasterxml.jackson.core.io.IOContext", false, ReaderBasedJsonParser_ESTest_scaffolding.class.getClassLoader())); mock(Class.forName("com.fasterxml.jackson.core.type.TypeReference", false, ReaderBasedJsonParser_ESTest_scaffolding.class.getClassLoader())); } private static void resetClasses() { org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(ReaderBasedJsonParser_ESTest_scaffolding.class.getClassLoader()); org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses( "com.fasterxml.jackson.core.JsonParser", "com.fasterxml.jackson.core.base.ParserMinimalBase", "com.fasterxml.jackson.core.base.ParserBase", "com.fasterxml.jackson.core.io.CharTypes", "com.fasterxml.jackson.core.json.ReaderBasedJsonParser", "com.fasterxml.jackson.core.JsonParser$Feature", "com.fasterxml.jackson.core.JsonToken", "com.fasterxml.jackson.core.util.BufferRecycler", "com.fasterxml.jackson.core.io.IOContext", "com.fasterxml.jackson.core.TreeCodec", "com.fasterxml.jackson.core.ObjectCodec", "com.fasterxml.jackson.core.sym.CharsToNameCanonicalizer", "com.fasterxml.jackson.core.JsonFactory$Feature", "com.fasterxml.jackson.core.util.TextBuffer", "com.fasterxml.jackson.core.JsonStreamContext", "com.fasterxml.jackson.core.json.JsonReadContext", "com.fasterxml.jackson.core.io.SerializedString", "com.fasterxml.jackson.core.json.DupDetector", "com.fasterxml.jackson.core.Base64Variant", "com.fasterxml.jackson.core.JsonLocation", "com.fasterxml.jackson.core.type.TypeReference", "com.fasterxml.jackson.core.JsonProcessingException", "com.fasterxml.jackson.core.JsonParseException", "com.fasterxml.jackson.core.util.InternCache", "com.fasterxml.jackson.core.Base64Variants", "com.fasterxml.jackson.core.io.JsonStringEncoder", "com.fasterxml.jackson.core.util.ByteArrayBuilder", "com.fasterxml.jackson.core.io.NumberInput" ); } }
[ "pderakhshanfar@serg2.ewi.tudelft.nl" ]
pderakhshanfar@serg2.ewi.tudelft.nl
20c6dc4365febc49bc4bc957e80bb6f7189540e1
134d718dcad9a1947f7958a898a7fa1ed508db38
/src/test/java/com/opencredo/proxology/handlers/ProxiesTest.java
8ab10737e209334b25b9e7c0741092016f422a36
[ "MIT" ]
permissive
opencredo/proxology
fc74d21e62e5a4956bbfd61d25bd9ef8cb7c1917
7ea754388a17db6e1be007c99c178c3b36e5c4df
refs/heads/master
2022-08-12T11:55:34.398883
2022-08-02T14:53:07
2022-08-02T14:53:07
38,746,108
66
21
null
2017-05-21T08:01:14
2015-07-08T09:54:57
Java
UTF-8
Java
false
false
5,710
java
package com.opencredo.proxology.handlers; import com.opencredo.proxology.proxies.Proxies; import org.junit.Test; import java.util.*; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; public class ProxiesTest { public interface Person { long getId(); void setId(long id); String getName(); void setName(String name); int getAge(); void setAge(int age); default String display() { return String.format("%s (%s)", getName(), getAge()); } } public static final class PersonImpl implements Person { private long id; private String name; private int age; public PersonImpl() { } public PersonImpl(long id, String name, int age) { this.id = id; this.name = name; this.age = age; } @Override public long getId() { return id; } @Override public void setId(long id) { this.id = id; } @Override public String getName() { return name; } @Override public int getAge() { return age; } @Override public void setName(String name) { this.name = name; } @Override public void setAge(int age) { this.age = age; } @Override public boolean equals(Object o) { if (!(o instanceof Person)) { return false; } Person otherPerson = (Person) o; return Objects.equals(id, otherPerson.getId()) && Objects.equals(name, otherPerson.getName()) && Objects.equals(age, otherPerson.getAge()); } @Override public int hashCode() { return Objects.hash(id, name, age); } @Override public String toString() { return "PersonImpl{" + "id='" + id + '\'' + "name='" + name + '\'' + ", age=" + age + '}'; } } @Test public void interceptsCalls() { Person instance = new PersonImpl(); List<String> callDetails = new ArrayList<>(); MethodCallInterceptor interceptor = (proxy, method, args, handler) -> { Object result = handler.invoke(proxy, args); callDetails.add(String.format("%s: %s -> %s", method.getName(), Arrays.toString(args), result)); return result; }; Person proxy = Proxies.interceptingProxy(instance, Person.class, interceptor); proxy.setId(13); proxy.setName("Arthur Putey"); proxy.setAge(42); assertThat(proxy.display(), equalTo("Arthur Putey (42)")); System.out.println(callDetails); assertThat(callDetails, contains( "setId: [13] -> null", "setName: [Arthur Putey] -> null", "setAge: [42] -> null", "getName: null -> Arthur Putey", "getAge: null -> 42", "display: null -> Arthur Putey (42)")); } @SuppressWarnings("unchecked") @Test public void handlesObjectMethods() { Person instance1 = new PersonImpl(1, "Arthur Putey", 42); Person instance2 = new PersonImpl(1, "Arthur Putey", 42); List<String> callDetails = new ArrayList<>(); MethodCallInterceptor interceptor = (proxy, method, args, handler) -> { Object result = handler.invoke(proxy, args); callDetails.add(String.format("%s: %s -> %s", method.getName(), Arrays.toString(args), result)); return result; }; Person proxy = Proxies.interceptingProxy(instance1, Person.class, interceptor); assertThat(proxy, equalTo(instance2)); assertThat(proxy.hashCode(), equalTo(instance2.hashCode())); assertThat(proxy.toString(), equalTo(instance2.toString())); assertThat(callDetails, hasItems(containsString("equals"), containsString("hashCode"), containsString("toString"))); } @Test public void equality() { Person instance1 = new PersonImpl(1, "Arthur Putey", 42); Person instance2 = new PersonImpl(1, "Arthur Putey", 42); List<String> callDetails = new ArrayList<>(); MethodCallInterceptor interceptor = (proxy, method, args, handler) -> { Object result = handler.invoke(proxy, args); callDetails.add(String.format("%s: %s -> %s", method.getName(), Arrays.toString(args), result)); return result; }; Person proxy1 = Proxies.interceptingProxy(instance1, Person.class, interceptor); assertThat(proxy1, equalTo(instance1)); assertThat(instance1, equalTo(proxy1)); assertThat(proxy1, equalTo(instance2)); assertThat(instance2, equalTo(proxy1)); } @Test public void beanMappingProxies() { Map<String, Object> propertyMap = new HashMap<>(); propertyMap.put("id", 1L); propertyMap.put("name", "Arthur Putey"); propertyMap.put("age", 42); Person proxy1 = Proxies.propertyMapping(Person.class, propertyMap); Person proxy2 = Proxies.propertyMapping(Person.class, propertyMap); assertThat(proxy1, equalTo(proxy2)); assertThat(proxy1.getId(), equalTo(1L)); assertThat(proxy1.getName(), equalTo("Arthur Putey")); assertThat(proxy1.getAge(), equalTo(42)); proxy1.setName("Alice Cowley"); assertThat(proxy2.getName(), equalTo("Alice Cowley")); } }
[ "dominic.fox@opencredo.com" ]
dominic.fox@opencredo.com
fb61898e3955761b84c2ec46929673678e015299
e5e46ac27edef7410fd1d36741e8cbf01d704a10
/src/CosTrading/UnknownMaxLeft.java
ec10b704849d662df66653963cc942a203ea3ce3
[]
no_license
thradexIT/tmf814
4cc5be43145137f5d58693a5d2e3a60968541799
20688a799d5b20ec7e9adbc33ca69cc63347b2a9
refs/heads/master
2021-12-25T00:00:44.914802
2017-12-21T22:01:40
2017-12-21T22:01:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
490
java
package CosTrading; /** * CosTrading/UnknownMaxLeft.java . * Generated by the IDL-to-Java compiler (portable), version "3.2" * from CosTrading.idl * Wednesday, June 15, 2016 7:24:33 PM COT */ public final class UnknownMaxLeft extends org.omg.CORBA.UserException { public UnknownMaxLeft () { super(UnknownMaxLeftHelper.id()); } // ctor public UnknownMaxLeft (String $reason) { super(UnknownMaxLeftHelper.id() + " " + $reason); } // ctor } // class UnknownMaxLeft
[ "miplanmobile@gmail.com" ]
miplanmobile@gmail.com
b93f642e3b175dc2349c33ccb8dfaf9dcd5584dc
d205fa60eb9dadc37394eaa3b8478fafd2000534
/aCis_gameserver/java/net/sf/l2j/gameserver/model/L2Macro.java
c7f3fe2c06ef7b9311a478c840fda5b3c5140130
[]
no_license
D3XV/D3X
9569922d6a0c84f65a40bc4e2c93d42309bab891
fa86fa848225865e98fac4a5b3806d34c247761e
refs/heads/master
2021-01-10T17:38:03.350085
2016-02-16T15:43:44
2016-02-16T15:43:44
51,845,799
1
0
null
null
null
null
UTF-8
Java
false
false
1,612
java
/* * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see <http://www.gnu.org/licenses/>. */ package net.sf.l2j.gameserver.model; public class L2Macro { public final static int CMD_TYPE_SKILL = 1; public final static int CMD_TYPE_ACTION = 3; public final static int CMD_TYPE_SHORTCUT = 4; public int id; public final int icon; public final String name; public final String descr; public final String acronym; public final L2MacroCmd[] commands; public static class L2MacroCmd { public final int entry; public final int type; public final int d1; // skill_id or page for shortcuts public final int d2; // shortcut public final String cmd; public L2MacroCmd(int pEntry, int pType, int pD1, int pD2, String pCmd) { entry = pEntry; type = pType; d1 = pD1; d2 = pD2; cmd = pCmd; } } public L2Macro(int pId, int pIcon, String pName, String pDescr, String pAcronym, L2MacroCmd[] pCommands) { id = pId; icon = pIcon; name = pName; descr = pDescr; acronym = pAcronym; commands = pCommands; } }
[ "dhmhtrhs.vou@gmail.com" ]
dhmhtrhs.vou@gmail.com
febde513269e15b20ac78b7134c4c29dd51726f6
d504110d2237650b4a445417c80131915f303fe0
/netbeans/gas/msa/src/com/gas/msa/ui/common/ITree.java
3f8807f6732f09da614f9e9a45ac2ee8af3ce83d
[]
no_license
duncan1201/VF
ab8741163bbff03962818cc1076cc35c1252bb03
095478313d2580925f7417dae6eb083d09636a30
refs/heads/master
2021-03-22T00:26:13.276478
2016-09-08T11:48:01
2016-09-08T11:48:01
32,251,044
0
0
null
null
null
null
UTF-8
Java
false
false
1,795
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.gas.msa.ui.common; /** * * @author dq */ public interface ITree { public enum SHAPE { NONE, CIRCLE, SQUARE; public static SHAPE get(String str){ SHAPE ret = null; if(str.equalsIgnoreCase(NONE.toString())){ ret = NONE; }else if(str.equalsIgnoreCase(CIRCLE.toString())){ ret = CIRCLE; }else if(str.equalsIgnoreCase(SQUARE.toString())){ ret = SQUARE; }else{ throw new IllegalArgumentException(String.format("Unknown argument:%s", str)); } return ret; } }; public enum TRANSFORM { NONE, EQUAL, CLADOGRAM; public static TRANSFORM get(String str){ TRANSFORM ret = null; if(str.equalsIgnoreCase(NONE.toString())){ ret = NONE; }else if(str.equalsIgnoreCase(EQUAL.toString())){ ret = EQUAL; }else if(str.equalsIgnoreCase(CLADOGRAM.toString())){ ret = CLADOGRAM; } return ret; } } void setTransform(TRANSFORM transform); void setLineWidth(int lineWidth); void setEdgeLabelVisible(boolean visible); String[] getLengthAttributeNames(); void setSelectedLengthAttribute(String selectedNameAttribute); void setSigDigits(Integer sigDigits); void setNodeShape(SHAPE nodeShape); void setNodeLabelVisible(boolean nodeLabelVisible); String[] getNameAttributeNames(); void setSelectedNameAttribute(String selectedNameAttribute); void setFontSize(Float fontSize); }
[ "dunqiang.liao@vectorfriends.com" ]
dunqiang.liao@vectorfriends.com
7d38204f861609db73b3565dc5f2177e59c26d99
902564d740bee866d7798df985a25f0f664f6240
/src/trunk/mywar-game-admin/src/main/java/com/dataconfig/dao/BaTipsConstantDao.java
2ca79f1689b0045b0903000dbf7c596b3e9eb4a7
[]
no_license
hw233/Server-java
539b416821ad67d22120c7146b4c3c7d4ad15929
ff74787987f146553684bd823d6bd809eb1e27b6
refs/heads/master
2020-04-29T04:46:03.263306
2016-05-20T12:45:44
2016-05-20T12:45:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
185
java
package com.dataconfig.dao; import com.dataconfig.bo.BaTipsConstant; import com.framework.dao.BaseEntityDao; public class BaTipsConstantDao extends BaseEntityDao<BaTipsConstant> { }
[ "dogdog7788@qq.com" ]
dogdog7788@qq.com
d9909eede897dd91785ad1506d17da21eb45745b
b461d55da32ceee6bb2c2842bc162cf98650f279
/org.kevoree.modeling.cpp.generator/src/main/java/org/kevoree/modeling/cpp/generator/utils/FileManager.java
f107b2e052a2682505d5753fff650d9a8a6f3772
[]
no_license
kevoree/kmfcpp
73e275b65a34b995dc816f65819d738e4fb97f50
967f83be6377b66a25a23ace10346afdbd2faab4
refs/heads/master
2021-01-16T18:45:21.107074
2014-11-03T19:23:06
2014-11-03T19:23:06
26,134,470
2
1
null
null
null
null
UTF-8
Java
false
false
7,560
java
/** * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE, Version 3, 29 June 2007; * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.gnu.org/licenses/lgpl-3.0.txt * * 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.kevoree.modeling.cpp.generator.utils; import java.io.*; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; import java.util.jar.JarEntry; import java.util.jar.JarFile; /** * Created with IntelliJ IDEA. * User: jed * Date: 03/10/12 * Time: 17:21 * To change this templates use File | Settings | File Templates. */ public class FileManager { public static byte[] load(InputStream reader) throws IOException { int c; ArrayList<Byte> tab = new ArrayList<Byte>(); while((c = reader.read()) != -1) { tab.add((byte)c); } if (reader!=null) reader.close(); return toByteArray(tab); } public static void copyDirectory(File sourceLocation , File targetLocation) throws IOException { if (sourceLocation.isDirectory()) { if (!targetLocation.exists()) { targetLocation.mkdir(); } String[] children = sourceLocation.list(); for (int i=0; i<children.length; i++) { copyDirectory(new File(sourceLocation, children[i]), new File(targetLocation, children[i])); } } else { InputStream in = new FileInputStream(sourceLocation); OutputStream out = new FileOutputStream(targetLocation); // Copy the bits from instream to outstream byte[] buf = new byte[1024]; int len; while ((len = in.read(buf)) > 0) { out.write(buf, 0, len); } in.close(); out.close(); } } public static void unzipJar( String jarPath,String destinationDir) throws IOException { File file = new File(jarPath); JarFile jar = new JarFile(file); // fist get all directories, // then make those directory on the destination Path for (Enumeration<JarEntry> enums = jar.entries(); enums.hasMoreElements();) { JarEntry entry = (JarEntry) enums.nextElement(); String fileName = destinationDir + File.separator + entry.getName(); File f = new File(fileName); if (fileName.endsWith("/") && !fileName.contains("META-INF")) { f.mkdirs(); } } //now create all files for (Enumeration<JarEntry> enums = jar.entries(); enums.hasMoreElements();) { JarEntry entry = (JarEntry) enums.nextElement(); String fileName = destinationDir + File.separator + entry.getName(); File f = new File(fileName); if (!fileName.endsWith("/") && !fileName.contains("META-INF")) { InputStream is = jar.getInputStream(entry); FileOutputStream fos = new FileOutputStream(f); // write contents of 'is' to 'fos' while (is.available() > 0) { fos.write(is.read()); } fos.close(); is.close(); } } } public static void writeFile(String path,String data,Boolean append) throws IOException { File file = new File(path.substring(0,path.lastIndexOf(File.separatorChar))); file.mkdirs(); FileWriter fileWriter = new FileWriter(path,append); BufferedWriter out_j = new BufferedWriter(fileWriter); out_j.write(data); out_j.close(); } public static String copyFileFromStream( InputStream inputStream , String path, String targetName,boolean replace) throws IOException { if (inputStream != null) { File copy = new File(path + File.separator + targetName); copy.mkdirs(); if(replace) { if(copy.exists()){ if(!copy.delete()){ throw new IOException("delete file "+copy.getPath()); } if(!copy.createNewFile()){ throw new IOException("createNewFile file "+copy.getPath()); } } } //copy.deleteOnExit(); OutputStream outputStream = new FileOutputStream(copy); byte[] bytes = new byte[1024]; int length = inputStream.read(bytes); while (length > -1) { outputStream.write(bytes, 0, length); length = inputStream.read(bytes); } inputStream.close(); outputStream.flush(); outputStream.close(); return copy.getAbsolutePath(); } return null; } public static byte[] toByteArray(List<Byte> in) { final int n = in.size(); byte ret[] = new byte[n]; for (int i = 0; i < n; i++) { ret[i] = in.get(i); } return ret; } public static byte[] load(String pathfile) { File file = new File(pathfile); FileInputStream fis = null; BufferedInputStream bis = null; DataInputStream dis = null; ArrayList<Byte> tab = new ArrayList<Byte>(); try { fis = new FileInputStream(file); bis = new BufferedInputStream(fis); dis = new DataInputStream(bis); while (dis.available() != 0) { tab.add((byte)dis.read()); } } catch (IOException e) { e.printStackTrace(); return null; } finally { try { fis.close(); bis.close(); dis.close(); } catch (IOException ex) { ex.printStackTrace(); } } return toByteArray(tab); } /* Utility fonctions */ public static void deleteOldFile(File folder) { if (folder.isDirectory()) { for (File f : folder.listFiles()) { if (f.isFile()) { f.delete(); } else { deleteOldFile(f); } } } folder.delete(); } public static String copyFileFromStream(String inputFile, String path, String targetName) throws IOException { InputStream inputStream = FileManager.class.getClassLoader().getResourceAsStream(inputFile); if (inputStream != null) { File copy = new File(path + File.separator + targetName); copy.deleteOnExit(); OutputStream outputStream = new FileOutputStream(copy); byte[] bytes = new byte[1024]; int length = inputStream.read(bytes); while (length > -1) { outputStream.write(bytes, 0, length); length = inputStream.read(bytes); } inputStream.close(); outputStream.flush(); outputStream.close(); return copy.getAbsolutePath(); } return null; } }
[ "jedartois@gmail.com" ]
jedartois@gmail.com
13785cc0f0d8e4b2c58c0343c3aed5fa4cd654d9
08bdd164c174d24e69be25bf952322b84573f216
/opencores/client/foundation classes/j2sdk-1_4_2-src-scsl/j2se/src/share/classes/sun/misc/UUEncoder.java
6fca5399833e45748087643ea837fd4e2cb4862d
[]
no_license
hagyhang/myforthprocessor
1861dcabcf2aeccf0ab49791f510863d97d89a77
210083fe71c39fa5d92f1f1acb62392a7f77aa9e
refs/heads/master
2021-05-28T01:42:50.538428
2014-07-17T14:14:33
2014-07-17T14:14:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,190
java
/* * @(#)UUEncoder.java 1.18 03/01/23 * * Copyright 2003 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ package sun.misc; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintStream; import java.io.IOException; /** * This class implements a Berkeley uu character encoder. This encoder * was made famous by uuencode program. * * The basic character coding is algorithmic, taking 6 bits of binary * data and adding it to an ASCII ' ' (space) character. This converts * these six bits into a printable representation. Note that it depends * on the ASCII character encoding standard for english. Groups of three * bytes are converted into 4 characters by treating the three bytes * a four 6 bit groups, group 1 is byte 1's most significant six bits, * group 2 is byte 1's least significant two bits plus byte 2's four * most significant bits. etc. * * In this encoding, the buffer prefix is: * <pre> * begin [mode] [filename] * </pre> * * This is followed by one or more lines of the form: * <pre> * (len)(data)(data)(data) ... * </pre> * where (len) is the number of bytes on this line. Note that groupings * are always four characters, even if length is not a multiple of three * bytes. When less than three characters are encoded, the values of the * last remaining bytes is undefined and should be ignored. * * The last line of data in a uuencoded file is represented by a single * space character. This is translated by the decoding engine to a line * length of zero. This is immediately followed by a line which contains * the word 'end[newline]' * * @version 1.18, 01/23/03 * @author Chuck McManis * @see CharacterEncoder * @see UUDecoder */ public class UUEncoder extends CharacterEncoder { /** * This name is stored in the begin line. */ private String bufferName; /** * Represents UNIX(tm) mode bits. Generally three octal digits representing * read, write, and execute permission of the owner, group owner, and * others. They should be interpreted as the bit groups: * (owner) (group) (others) * rwx rwx rwx (r = read, w = write, x = execute) * * By default these are set to 644 (UNIX rw-r--r-- permissions). */ private int mode; /** * Default - buffer begin line will be: * <pre> * begin 644 encoder.buf * </pre> */ public UUEncoder() { bufferName = "encoder.buf"; mode = 644; } /** * Specifies a name for the encoded bufer, begin line will be: * <pre> * begin 644 [FNAME] * </pre> */ public UUEncoder(String fname) { bufferName = fname; mode = 644; } /** * Specifies a name and mode for the encoded bufer, begin line will be: * <pre> * begin [MODE] [FNAME] * </pre> */ public UUEncoder(String fname, int newMode) { bufferName = fname; mode = newMode; } /** number of bytes per atom in uuencoding is 3 */ protected int bytesPerAtom() { return (3); } /** number of bytes per line in uuencoding is 45 */ protected int bytesPerLine() { return (45); } /** * encodeAtom - take three bytes and encodes them into 4 characters * If len is less than 3 then remaining bytes are filled with '1'. * This insures that the last line won't end in spaces and potentiallly * be truncated. */ protected void encodeAtom(OutputStream outStream, byte data[], int offset, int len) throws IOException { byte a, b = 1, c = 1; int c1, c2, c3, c4; a = data[offset]; if (len > 1) { b = data[offset+1]; } if (len > 2) { c = data[offset+2]; } c1 = (a >>> 2) & 0x3f; c2 = ((a << 4) & 0x30) | ((b >>> 4) & 0xf); c3 = ((b << 2) & 0x3c) | ((c >>> 6) & 0x3); c4 = c & 0x3f; outStream.write(c1 + ' '); outStream.write(c2 + ' '); outStream.write(c3 + ' '); outStream.write(c4 + ' '); return; } /** * Encode the line prefix which consists of the single character. The * lenght is added to the value of ' ' (32 decimal) and printed. */ protected void encodeLinePrefix(OutputStream outStream, int length) throws IOException { outStream.write((length & 0x3f) + ' '); } /** * The line suffix for uuencoded files is simply a new line. */ protected void encodeLineSuffix(OutputStream outStream) throws IOException { pStream.println(); } /** * encodeBufferPrefix writes the begin line to the output stream. */ protected void encodeBufferPrefix(OutputStream a) throws IOException { super.pStream = new PrintStream(a); super.pStream.print("begin "+mode+" "); if (bufferName != null) { super.pStream.println(bufferName); } else { super.pStream.println("encoder.bin"); } super.pStream.flush(); } /** * encodeBufferSuffix writes the single line containing space (' ') and * the line containing the word 'end' to the output stream. */ protected void encodeBufferSuffix(OutputStream a) throws IOException { super.pStream.println(" \nend"); super.pStream.flush(); } }
[ "blue@cmd.nu" ]
blue@cmd.nu
514ce2987afdd6c333293e783bc3fefb07654eaa
ddcf75561b40464bdfa36b6208b8ae1f1f43dd93
/utilcode/src/main/java/com/blankj/utilcode/utils/SPUtils.java
7fdf2282d347303192d272ec4771c4173a188b39
[ "Apache-2.0" ]
permissive
zhutengfei/AndroidUtilCode
343d10c5f89b6b07e47e5aa48223f25232fb8e04
481f98cc7d4dfba7779dbf7005222eaedacb651e
refs/heads/master
2021-01-11T12:01:16.025301
2016-12-13T15:04:04
2016-12-13T15:04:04
76,612,755
1
0
null
2016-12-16T02:08:33
2016-12-16T02:08:32
null
UTF-8
Java
false
false
5,260
java
package com.blankj.utilcode.utils; import android.content.Context; import android.content.SharedPreferences; import java.util.Map; /** * <pre> * author: Blankj * blog : http://blankj.com * time : 2016/8/2 * desc : SP相关工具类 * </pre> */ public class SPUtils { private SharedPreferences sp; private SharedPreferences.Editor editor; /** * SPUtils构造函数 * <p>在Application中初始化</p> * * @param spName spName */ public SPUtils(String spName) { sp = Utils.context.getSharedPreferences(spName, Context.MODE_PRIVATE); editor = sp.edit(); editor.apply(); } /** * SP中写入String类型value * * @param key 键 * @param value 值 */ public void putString(String key, String value) { editor.putString(key, value).apply(); } /** * SP中读取String * * @param key 键 * @return 存在返回对应值,不存在返回默认值{@code null} */ public String getString(String key) { return getString(key, null); } /** * SP中读取String * * @param key 键 * @param defaultValue 默认值 * @return 存在返回对应值,不存在返回默认值{@code defaultValue} */ public String getString(String key, String defaultValue) { return sp.getString(key, defaultValue); } /** * SP中写入int类型value * * @param key 键 * @param value 值 */ public void putInt(String key, int value) { editor.putInt(key, value).apply(); } /** * SP中读取int * * @param key 键 * @return 存在返回对应值,不存在返回默认值-1 */ public int getInt(String key) { return getInt(key, -1); } /** * SP中读取int * * @param key 键 * @param defaultValue 默认值 * @return 存在返回对应值,不存在返回默认值{@code defaultValue} */ public int getInt(String key, int defaultValue) { return sp.getInt(key, defaultValue); } /** * SP中写入long类型value * * @param key 键 * @param value 值 */ public void putLong(String key, long value) { editor.putLong(key, value).apply(); } /** * SP中读取long * * @param key 键 * @return 存在返回对应值,不存在返回默认值-1 */ public long getLong(String key) { return getLong(key, -1L); } /** * SP中读取long * * @param key 键 * @param defaultValue 默认值 * @return 存在返回对应值,不存在返回默认值{@code defaultValue} */ public long getLong(String key, long defaultValue) { return sp.getLong(key, defaultValue); } /** * SP中写入float类型value * * @param key 键 * @param value 值 */ public void putFloat(String key, float value) { editor.putFloat(key, value).apply(); } /** * SP中读取float * * @param key 键 * @return 存在返回对应值,不存在返回默认值-1 */ public float getFloat(String key) { return getFloat(key, -1f); } /** * SP中读取float * * @param key 键 * @param defaultValue 默认值 * @return 存在返回对应值,不存在返回默认值{@code defaultValue} */ public float getFloat(String key, float defaultValue) { return sp.getFloat(key, defaultValue); } /** * SP中写入boolean类型value * * @param key 键 * @param value 值 */ public void putBoolean(String key, boolean value) { editor.putBoolean(key, value).apply(); } /** * SP中读取boolean * * @param key 键 * @return 存在返回对应值,不存在返回默认值{@code false} */ public boolean getBoolean(String key) { return getBoolean(key, false); } /** * SP中读取boolean * * @param key 键 * @param defaultValue 默认值 * @return 存在返回对应值,不存在返回默认值{@code defaultValue} */ public boolean getBoolean(String key, boolean defaultValue) { return sp.getBoolean(key, defaultValue); } /** * SP中获取所有键值对 * * @return Map对象 */ public Map<String, ?> getAll() { return sp.getAll(); } /** * SP中移除该key * * @param key 键 */ public void remove(String key) { editor.remove(key).apply(); } /** * SP中是否存在该key * * @param key 键 * @return {@code true}: 存在<br>{@code false}: 不存在 */ public boolean contains(String key) { return sp.contains(key); } /** * SP中清除所有数据 */ public void clear() { editor.clear().apply(); } }
[ "625783482@qq.com" ]
625783482@qq.com
d05e9fcfd9ff506fabcbeee5b0946230b337f7e9
07922981808fef42103825c888bf5367160589a6
/drools-wb-screens/drools-wb-guided-dtable-editor/drools-wb-guided-dtable-editor-client/src/test/java/org/drools/workbench/screens/guided/dtable/client/widget/table/popovers/definitions/ActionRetractFactCol52DefinitionBuilderTest.java
8ce39270b5fba59ab136cfef71b4f079b9e96c49
[ "Apache-2.0" ]
permissive
tedbai/drools-wb
05591026406139ff223781b434ca3cfda472b72c
c8b3a6be5987a0fa137d0ab76bd8a64d0be0fb98
refs/heads/master
2020-06-10T19:57:52.803885
2016-12-05T12:41:46
2016-12-05T12:41:46
75,890,619
1
0
null
2016-12-08T01:23:32
2016-12-08T01:23:32
null
UTF-8
Java
false
false
2,729
java
/* * Copyright 2016 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.drools.workbench.screens.guided.dtable.client.widget.table.popovers.definitions; import java.util.concurrent.atomic.AtomicBoolean; import org.drools.workbench.models.guided.dtable.shared.model.ActionRetractFactCol52; import org.drools.workbench.models.guided.dtable.shared.model.BaseColumn; import org.drools.workbench.models.guided.dtable.shared.model.RowNumberCol52; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.runners.MockitoJUnitRunner; import static org.junit.Assert.*; @RunWith(MockitoJUnitRunner.class) public class ActionRetractFactCol52DefinitionBuilderTest extends BaseColumnDefinitionBuilderTest { @Override protected ColumnDefinitionBuilder getBuilder() { return new ActionRetractFactCol52DefinitionBuilder( serviceCaller ); } @Test public void checkColumnType() { assertEquals( ActionRetractFactCol52.class, builder.getSupportedColumnType() ); } @Test public void unknownColumnTypeDoesNotTriggerBuilder() { final BaseColumn column = new RowNumberCol52(); builder.generateDefinition( dtPresenter, column, ( String definition ) -> { fail( "RowNumberCol52 should not be handled by ActionRetractFactCol52DefinitionBuilder" ); } ); } @Test public void simpleAction() { final AtomicBoolean calledBack = new AtomicBoolean( false ); final ActionRetractFactCol52 arf = new ActionRetractFactCol52(); model.getActionCols().add( arf ); builder.generateDefinition( dtPresenter, arf, ( String definition ) -> { calledBack.set( true ); assertEquals( "retract( x );", definition ); } ); assertTrue( calledBack.get() ); } }
[ "christian.sadilek@gmail.com" ]
christian.sadilek@gmail.com
dff5ee9206d3373a3a760944145c7d222d640f2c
7991248e6bccacd46a5673638a4e089c8ff72a79
/storage/common/src/main/java/org/artifactory/model/xstream/security/UserGroupImpl.java
94d375fd1e6aeac73c1c1d76b25780cb13634a11
[]
no_license
theoriginalshaheedra/artifactory-oss
69b7f6274cb35c79db3a3cd613302de2ae019b31
415df9a9467fee9663850b4b8b4ee5bd4c23adeb
refs/heads/master
2023-04-23T15:48:36.923648
2021-05-05T06:15:24
2021-05-05T06:15:24
364,455,815
1
0
null
2021-05-05T07:11:40
2021-05-05T03:57:33
Java
UTF-8
Java
false
false
2,396
java
/* * * Artifactory is a binaries repository manager. * Copyright (C) 2018 JFrog Ltd. * * Artifactory is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Artifactory is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with Artifactory. If not, see <http://www.gnu.org/licenses/>. * */ package org.artifactory.model.xstream.security; import com.thoughtworks.xstream.annotations.XStreamAlias; import com.thoughtworks.xstream.annotations.XStreamOmitField; import org.artifactory.sapi.security.SecurityConstants; import org.artifactory.security.UserGroupInfo; import java.io.Serializable; /** * An object representing the resolved groups of a user, including the external realm the group may belong to * * @author Fred Simon */ @XStreamAlias("userGroup") public class UserGroupImpl implements Serializable, UserGroupInfo { final String groupName; @XStreamOmitField String realm = SecurityConstants.DEFAULT_REALM; public UserGroupImpl(String groupName) { this(groupName, SecurityConstants.DEFAULT_REALM); } public UserGroupImpl(String groupName, String realm) { this.groupName = groupName; this.realm = realm; } @Override public String getGroupName() { return groupName; } @Override public String getRealm() { return realm; } @Override public boolean isExternal() { return !SecurityConstants.DEFAULT_REALM.equals(realm); } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } UserGroupImpl info = (UserGroupImpl) o; return groupName.equals(info.groupName); } @Override public int hashCode() { return groupName.hashCode(); } @Override public String toString() { return groupName; } }
[ "david.monichi@gmail.com" ]
david.monichi@gmail.com
6b1bf12df3ba4027864084aba6618a08fa57412b
b1f73bf6842e7419c574ef47c9cabd42f861b569
/fuga-event/src/main/java/fuga/event/support/DefaultEventBus.java
9ea71fbbace529dc461f283688e41b85405615d7
[ "Apache-2.0" ]
permissive
bunjlabs/fuga
c69d91076561dec025269a5cd7136ee0fd0bab58
d675b7f9bcb08a8e8f68f1eabf03e0e66ee2d3a4
refs/heads/master
2022-02-07T15:07:52.996817
2022-02-03T09:20:37
2022-02-03T09:20:37
180,796,347
9
0
null
null
null
null
UTF-8
Java
false
false
2,244
java
package fuga.event.support; import fuga.common.Key; import fuga.event.DeadEvent; import fuga.event.EventBus; import fuga.event.Subscriber; import fuga.event.Subscription; import fuga.util.concurrent.CurrentThreadExecutor; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.Executor; public class DefaultEventBus implements EventBus { private final ConcurrentMap<Key<?>, EventAgent<?>> events = new ConcurrentHashMap<>(); private final Executor defaultExecutor; public DefaultEventBus() { this.defaultExecutor = CurrentThreadExecutor.INSTANCE; } public DefaultEventBus(Executor executor) { this.defaultExecutor = executor; } @Override public <T> Subscription<T> subscribe(Class<T> event, Subscriber<T> subscriber) { return subscribe(Key.of(event), subscriber, defaultExecutor); } @Override public <T> Subscription<T> subscribe(Key<T> eventType, Subscriber<T> subscriber) { return subscribe(eventType, subscriber, defaultExecutor); } @Override public <T> Subscription<T> subscribe(Class<T> event, Subscriber<T> subscriber, Executor executor) { return subscribe(Key.of(event), subscriber, executor); } @Override public <T> Subscription<T> subscribe(Key<T> eventType, Subscriber<T> subscriber, Executor executor) { var agent = getEvent(eventType); return agent.subscribe(subscriber, executor); } @Override public void post(Object event) { var eventKey = Key.of(event.getClass()); @SuppressWarnings("unchecked") var agent = (EventAgent<Object>) getEvent(eventKey); if (agent.ensureSubscribers()) { agent.fire(event); } else if (!(event instanceof DeadEvent)) { post(new DeadEvent(this, event)); } } private <T> EventAgent<T> getEvent(Key<T> eventType) { @SuppressWarnings("unchecked") var agent = (EventAgent<T>) events.get(eventType); if (agent == null) { events.put(eventType, agent = new EventAgent<>()); } return agent; } }
[ "show.vars@gmail.com" ]
show.vars@gmail.com
e5735f9f8423798042b5238bb46b54113e093504
bc26f0f299dc564e9d88ef321575333d8e7f1766
/Exams/Exam Prep/app/Cells/Cell.java
62a5fe0dafd1da2dfbb9e602541834654ed83ba5
[]
no_license
vanshianec/Java-OOP-Basics
5d04a952c811d1f0df961a7b6fdf6a043590607f
913f00112c1bb89d917f1aa3093e74457b715bde
refs/heads/master
2020-04-03T16:36:33.234192
2019-06-26T18:21:55
2019-06-26T18:21:55
155,411,708
1
0
null
null
null
null
UTF-8
Java
false
false
686
java
package app.Cells; public abstract class Cell { private String id; private int health; private int positionRow; private int positionCol; public Cell(String id, int health, int positionRow, int positionCol) { this.id = id; this.health = health; this.positionRow = positionRow; this.positionCol = positionCol; } public int getHealth(){ return this.health; } public String toString(){ StringBuilder sb = new StringBuilder(); sb.append(String.format("------Cell %s [%d,%d]",this.id,this.positionRow,this.positionCol)).append(System.lineSeparator()); return sb.toString(); } }
[ "ivaniovov@abv.bg" ]
ivaniovov@abv.bg
b051e837b0e47868e687b874b1bf1cfdadaa2578
ee104c76dad0fd95bfcbf5be97e5b0badf28f24f
/src/main/java/org/erpmicroservices/e_commerce/endpoint/rest/repositories/SubscriptionRepository.java
3797b26bad943803deb2619e366958c20ae24c37
[]
no_license
ErpMicroServices/e_commerce-endpoint-rest
22b76c210d15300b837825c2801f80ceddb90551
efb11e65921163f0f2b6fd85d40cb2346dee65e2
refs/heads/main
2023-04-21T09:46:05.108943
2021-05-08T11:22:39
2021-05-08T11:22:39
352,755,752
0
0
null
null
null
null
UTF-8
Java
false
false
440
java
package org.erpmicroservices.e_commerce.endpoint.rest.repositories; import org.erpmicroservices.e_commerce.endpoint.rest.models.Subscription; import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.data.rest.core.annotation.RepositoryRestResource; import java.util.UUID; @RepositoryRestResource public interface SubscriptionRepository extends PagingAndSortingRepository<Subscription, UUID> { }
[ "Jim.Barrows@gmail.com" ]
Jim.Barrows@gmail.com
9ad2adf68f58a972474b82186f7630faa76fb70e
64797505889192c725d048cf93465cca359ab920
/flyway-core/src/main/java/org/flywaydb/core/internal/database/cockroachdb/CockroachDBSchema.java
3d7b0c26d3cba94b2d6e3be193fb6e56d68a8d70
[ "Apache-2.0" ]
permissive
david-days/flyway
dc4ea9c791411b6153851512eb345c6d2310af2a
571f26c834c4cbbed8248a42e4bf65cc608d1a43
refs/heads/master
2021-08-19T14:12:15.539114
2017-11-26T15:33:38
2017-11-26T15:33:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,619
java
/* * Copyright 2010-2017 Boxfuse GmbH * * 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.flywaydb.core.internal.database.cockroachdb; import org.flywaydb.core.internal.database.JdbcTemplate; import org.flywaydb.core.internal.database.Schema; import org.flywaydb.core.internal.database.Table; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; /** * CockroachDB implementation of Schema. */ public class CockroachDBSchema extends Schema<CockroachDBDatabase> { /** * Creates a new PostgreSQL schema. * * @param jdbcTemplate The Jdbc Template for communicating with the DB. * @param database The database-specific support. * @param name The name of the schema. */ CockroachDBSchema(JdbcTemplate jdbcTemplate, CockroachDBDatabase database, String name) { super(jdbcTemplate, database, name); } @Override protected boolean doExists() throws SQLException { return jdbcTemplate.queryForInt("SELECT COUNT(*) FROM pg_namespace WHERE nspname=?", name) > 0; } @Override protected boolean doEmpty() throws SQLException { int objectCount = jdbcTemplate.queryForInt( "SELECT count(*) FROM information_schema.tables WHERE table_schema=? AND table_type='BASE TABLE'", name); return objectCount == 0; } @Override protected void doCreate() throws SQLException { jdbcTemplate.execute("CREATE DATABASE " + database.quote(name)); } @Override protected void doDrop() throws SQLException { jdbcTemplate.execute("DROP DATABASE " + database.quote(name)); } @Override protected void doClean() throws SQLException { for (String statement : generateDropStatementsForViews()) { jdbcTemplate.execute(statement); } for (Table table : allTables()) { table.drop(); } } /** * Generates the statements for dropping the views in this schema. * * @return The drop statements. * @throws SQLException when the clean statements could not be generated. */ private List<String> generateDropStatementsForViews() throws SQLException { List<String> viewNames = jdbcTemplate.queryForStringList( // Search for all views "SELECT relname FROM pg_catalog.pg_class c JOIN pg_namespace n ON n.oid = c.relnamespace" + // that don't depend on an extension " LEFT JOIN pg_depend dep ON dep.objid = c.oid AND dep.deptype = 'e'" + " WHERE c.relkind = 'v' AND n.nspname = ? AND dep.objid IS NULL", name); List<String> statements = new ArrayList<>(); for (String domainName : viewNames) { statements.add("DROP VIEW IF EXISTS " + database.quote(name, domainName) + " CASCADE"); } return statements; } @Override protected Table[] doAllTables() throws SQLException { List<String> tableNames = jdbcTemplate.queryForStringList( //Search for all the table names "SELECT table_name FROM information_schema.tables" + //in this schema " WHERE table_schema=?" + //that are real tables (as opposed to views) " AND table_type='BASE TABLE'", name ); //Views and child tables are excluded as they are dropped with the parent table when using cascade. Table[] tables = new Table[tableNames.size()]; for (int i = 0; i < tableNames.size(); i++) { tables[i] = new CockroachDBTable(jdbcTemplate, database, this, tableNames.get(i)); } return tables; } @Override public Table getTable(String tableName) { return new CockroachDBTable(jdbcTemplate, database, this, tableName); } }
[ "business@axelfontaine.com" ]
business@axelfontaine.com
9717786502d5cf8b5498e84ff426f76ab54fe161
6a5e1c7fd25e38251c19b74ab719f659d767c416
/core/src/main/java/org/apache/hop/i18n/AbstractMessageHandler.java
025ec874cb916f443da1044bd5acc27b55dd7dd1
[ "Apache-2.0" ]
permissive
marciojv/hopOLD
d734576991460ee9275602a505a4d806c166b1a3
461d0608069fd5c66ac3113ca03f94417353a0c4
refs/heads/master
2022-04-13T23:14:29.027246
2020-04-08T17:19:13
2020-04-08T17:19:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,960
java
/*! ****************************************************************************** * * Pentaho Data Integration * * Copyright (C) 2002-2017 by Hitachi Vantara : http://www.pentaho.com * ******************************************************************************* * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ******************************************************************************/ package org.apache.hop.i18n; import java.util.Locale; /** * Standard Message handler that takes a root package, plus key and resolves that into one/more resultant messages. This * Handler is used by all message types to enable flexible look and feel as well as i18n to be implemented in variable * ways. * * @author dhushon */ public abstract class AbstractMessageHandler implements MessageHandler { /** * forced override to allow singleton instantiation through dynamic class loader * * @return MessageHandler * @see org.apache.hop.i18n.GlobalMessages for sample */ public static synchronized MessageHandler getInstance() { return null; } /** * forced override, concrete implementations must provide implementation * * @return Locale */ public static synchronized Locale getLocale() { return null; } /** * forced override, concrete implementations must provide implementation * * @param newLocale */ public static synchronized void setLocale( Locale newLocale ) { } }
[ "mattcasters@gmail.com" ]
mattcasters@gmail.com
6686484fa82e9115ea1155d009296f400129a7a5
7585bbcfad09b1236d00f0d62cd0109b9b27e706
/lishiMobile/src/main/java/com/lis99/mobile/club/newtopic/series/ApplySeriesManagerItem1.java
c3a617c6cd48323ec6b45ff33e8100c6fc7375da
[]
no_license
xiaxiao1/Lis99Test
d7c943e25456bf341b43cd9da1a67bfe29fc55b2
43c3b2bb0b53dcee80d990a7ef8b5de44b5e9144
refs/heads/master
2020-06-30T23:44:50.990863
2016-11-21T09:41:37
2016-11-21T09:41:37
74,347,642
0
0
null
null
null
null
UTF-8
Java
false
false
1,519
java
package com.lis99.mobile.club.newtopic.series; import android.app.Activity; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import com.lis99.mobile.R; import com.lis99.mobile.util.MyBaseAdapter; import java.util.ArrayList; import java.util.HashMap; /** * Created by yy on 15/11/19. */ public class ApplySeriesManagerItem1 extends MyBaseAdapter { public ApplySeriesManagerItem1(Activity c, ArrayList listItem) { super(c, listItem); } @Override public View setView(int i, View view, ViewGroup viewGroup) { Holder holder = null; if ( view == null ) { view = View.inflate(mContext, R.layout.apply_manager_list_item1, null ); holder = new Holder(); holder.tv_name = (TextView) view.findViewById(R.id.tv_name); holder.tv_value = (TextView) view.findViewById(R.id.tv_value); view.setTag(holder); } else { holder = (Holder) view.getTag(); } HashMap<String, String> map = (HashMap<String, String>) getItem(i); if ( map != null ) { if ( map.containsKey("name")) { holder.tv_name.setText(map.get("name")); } if ( map.containsKey("value")) { holder.tv_value.setText(map.get("value")); } } return view; } class Holder { TextView tv_name, tv_value; } }
[ "yangyang@lis99.com" ]
yangyang@lis99.com
2d1ab29ed73b84ad99fe4128f348e656569d71e1
d2402ea937a0330e92ccaf6e1bfd8fc02e1b29c9
/src/com/ms/silverking/cloud/toporing/meta/RingConfigurationZK.java
5ad085ab28d96f729079519da4e8442c432dfae4
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
duyangzhou/SilverKing
b8880e0527eb6b5d895da4dbcf7a600b8a7786d8
b1b582f96d3771c01bf8239c64e99869f54bb3a1
refs/heads/master
2020-04-29T19:34:13.958262
2019-07-25T17:48:17
2019-07-25T17:48:17
176,359,498
0
0
Apache-2.0
2019-03-18T19:55:08
2019-03-18T19:55:08
null
UTF-8
Java
false
false
1,475
java
package com.ms.silverking.cloud.toporing.meta; import java.io.File; import java.io.IOException; import org.apache.zookeeper.CreateMode; import org.apache.zookeeper.KeeperException; import com.ms.silverking.cloud.management.MetaToolModuleBase; import com.ms.silverking.cloud.management.MetaToolOptions; import com.ms.silverking.io.StreamParser; public class RingConfigurationZK extends MetaToolModuleBase<RingConfiguration,MetaPaths> { public RingConfigurationZK(MetaClient mc) throws KeeperException { super(mc, mc.getMetaPaths().getConfigPath()); } @Override public RingConfiguration readFromFile(File file, long version) throws IOException { return RingConfiguration.parse(StreamParser.parseLine(file), version); } @Override public RingConfiguration readFromZK(long version, MetaToolOptions options) throws KeeperException { return RingConfiguration.parse(zk.getString(getVBase(version)), version); } @Override public void writeToFile(File file, RingConfiguration instance) throws IOException { throw new RuntimeException("writeToFile not implemented for WeightSpecifications"); } @Override public String writeToZK(RingConfiguration ringConfig, MetaToolOptions options) throws IOException, KeeperException { String path; path = zk.createString(base +"/" , ringConfig.toString(), CreateMode.PERSISTENT_SEQUENTIAL); return path; } }
[ "Benjamin.Holst@morganstanley.com" ]
Benjamin.Holst@morganstanley.com
16423322762885947b08691d39d8abd753f3818d
4fc5c337959217bfdc5d4971874b721d566d05ab
/compatibility/src/main/java/com/intellij/util/ui/UIClientPropertyKey.java
a450d13d537ad6035e461aadf408303fc139006a
[ "MIT" ]
permissive
weisJ/darklaf
dffd809b86d451bb088150df03bc5d54c7efa846
0622af33ba287b33f415e062158dfe4cc7b0d763
refs/heads/master
2023-07-27T06:08:22.902495
2023-05-26T07:22:31
2023-05-29T18:38:27
207,628,269
439
53
MIT
2023-08-27T19:41:22
2019-09-10T18:00:09
Java
UTF-8
Java
false
false
1,202
java
/* * MIT License * * Copyright (c) 2019-2021 Jannis Weis * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and * associated documentation files (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, publish, distribute, * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or * substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package com.intellij.util.ui; public interface UIClientPropertyKey { }
[ "31143295+weisJ@users.noreply.github.com" ]
31143295+weisJ@users.noreply.github.com
8f828e36e390fa0cf9b1f1611939a14a390dab50
d0afe7213e0b22fb9c2c3e71b6febc4053edfb7c
/permission/src/main/java/com/mmall/filter/LoginFilter.java
27aacfbe985dcd240e25e270de865b6171efa772
[]
no_license
liuhouer/securityManagement
1246c39753a33fc56b7d8c61e9a5403e87849667
58aeb429ec965d9d725047ecff33d74a9ca5bc34
refs/heads/master
2020-04-15T14:41:05.370955
2019-01-09T01:39:22
2019-01-09T01:39:22
164,762,512
2
0
null
null
null
null
UTF-8
Java
false
false
1,304
java
package com.mmall.filter; import com.mmall.common.RequestHolder; import com.mmall.model.SysUser; import lombok.extern.slf4j.Slf4j; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; @Slf4j public class LoginFilter implements Filter { public void init(FilterConfig filterConfig) throws ServletException { } public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { HttpServletRequest req = (HttpServletRequest) servletRequest; HttpServletResponse resp = (HttpServletResponse) servletResponse; SysUser sysUser = (SysUser)req.getSession().getAttribute("user"); if (sysUser == null) { String path = "/signin.jsp"; resp.sendRedirect(path); return; } RequestHolder.add(sysUser); RequestHolder.add(req); filterChain.doFilter(servletRequest, servletResponse); return; } public void destroy() { } }
[ "654714226@qq.com" ]
654714226@qq.com
773a748f615a1e35fc83c7b31ed396a2ad17ed41
66220fbb2b7d99755860cecb02d2e02f946e0f23
/src/net/sourceforge/plantuml/command/CommandFactorySprite.java
879be0d18b80da46fe13319c217af01a9fa73e42
[ "MIT" ]
permissive
isabella232/plantuml-mit
27e7c73143241cb13b577203673e3882292e686e
63b2bdb853174c170f304bc56f97294969a87774
refs/heads/master
2022-11-09T00:41:48.471405
2020-06-28T12:42:10
2020-06-28T12:42:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,095
java
/* ======================================================================== * PlantUML : a free UML diagram generator * ======================================================================== * * (C) Copyright 2009-2020, Arnaud Roques * * Project Info: https://plantuml.com * * If you like this project or if you find it useful, you can support us at: * * https://plantuml.com/patreon (only 1$ per month!) * https://plantuml.com/paypal * * This file is part of PlantUML. * * Licensed under The MIT License (Massachusetts Institute of Technology License) * * See http://opensource.org/licenses/MIT * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * * Original Author: Arnaud Roques */ package net.sourceforge.plantuml.command; import java.util.Arrays; import java.util.List; import net.sourceforge.plantuml.LineLocation; import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.WithSprite; import net.sourceforge.plantuml.command.note.SingleMultiFactoryCommand; import net.sourceforge.plantuml.command.regex.IRegex; import net.sourceforge.plantuml.command.regex.RegexConcat; import net.sourceforge.plantuml.command.regex.RegexLeaf; import net.sourceforge.plantuml.command.regex.RegexOptional; import net.sourceforge.plantuml.command.regex.RegexResult; import net.sourceforge.plantuml.sprite.Sprite; import net.sourceforge.plantuml.sprite.SpriteColorBuilder4096; import net.sourceforge.plantuml.sprite.SpriteGrayLevel; public final class CommandFactorySprite implements SingleMultiFactoryCommand<WithSprite> { private IRegex getRegexConcatMultiLine() { return RegexConcat.build(CommandFactorySprite.class.getName() + "multi", RegexLeaf.start(), // new RegexLeaf("sprite"), // RegexLeaf.spaceOneOrMore(), // new RegexLeaf("\\$?"), // new RegexLeaf("NAME", "([-.\\p{L}0-9_]+)"), // RegexLeaf.spaceZeroOrMore(), // new RegexOptional(new RegexLeaf("DIM", "\\[(\\d+)x(\\d+)/(?:(\\d+)(z)?|(color))\\]")), // RegexLeaf.spaceZeroOrMore(), // new RegexLeaf("\\{"), RegexLeaf.end()); } private IRegex getRegexConcatSingleLine() { return RegexConcat.build(CommandFactorySprite.class.getName() + "single", RegexLeaf.start(), // new RegexLeaf("sprite"), // RegexLeaf.spaceOneOrMore(), // new RegexLeaf("\\$?"), // new RegexLeaf("NAME", "([-.\\p{L}0-9_]+)"), // RegexLeaf.spaceZeroOrMore(), // new RegexOptional(new RegexLeaf("DIM", "\\[(\\d+)x(\\d+)/(?:(\\d+)(z)|(color))\\]")), // RegexLeaf.spaceOneOrMore(), // new RegexLeaf("DATA", "([-_A-Za-z0-9]+)"), RegexLeaf.end()); } public Command<WithSprite> createSingleLine() { return new SingleLineCommand2<WithSprite>(getRegexConcatSingleLine()) { @Override protected CommandExecutionResult executeArg(final WithSprite system, LineLocation location, RegexResult arg) { return executeInternal(system, arg, Arrays.asList((String) arg.get("DATA", 0))); } }; } public Command<WithSprite> createMultiLine(boolean withBracket) { return new CommandMultilines2<WithSprite>(getRegexConcatMultiLine(), MultilinesStrategy.REMOVE_STARTING_QUOTE) { @Override public String getPatternEnd() { return "(?i)^end[%s]?sprite|\\}$"; } protected CommandExecutionResult executeNow(final WithSprite system, BlocLines lines) { lines = lines.trim().removeEmptyLines(); final RegexResult line0 = getStartingPattern().matcher(lines.getFirst().getTrimmed().getString()); lines = lines.subExtract(1, 1); lines = lines.removeEmptyColumns(); if (lines.size() == 0) { return CommandExecutionResult.error("No sprite defined."); } return executeInternal(system, line0, lines.getLinesAsStringForSprite()); } }; } private CommandExecutionResult executeInternal(WithSprite system, RegexResult line0, final List<String> strings) { final Sprite sprite; if (line0.get("DIM", 0) == null) { sprite = SpriteGrayLevel.GRAY_16.buildSprite(-1, -1, strings); } else { final int width = Integer.parseInt(line0.get("DIM", 0)); final int height = Integer.parseInt(line0.get("DIM", 1)); if (line0.get("DIM", 4) == null) { final int nbLevel = Integer.parseInt(line0.get("DIM", 2)); if (nbLevel != 4 && nbLevel != 8 && nbLevel != 16) { return CommandExecutionResult.error("Only 4, 8 or 16 graylevel are allowed."); } final SpriteGrayLevel level = SpriteGrayLevel.get(nbLevel); if (line0.get("DIM", 3) == null) { sprite = level.buildSprite(width, height, strings); } else { sprite = level.buildSpriteZ(width, height, concat(strings)); if (sprite == null) { return CommandExecutionResult.error("Cannot decode sprite."); } } } else { sprite = SpriteColorBuilder4096.buildSprite(strings); } } system.addSprite(line0.get("NAME", 0), sprite); return CommandExecutionResult.ok(); } private String concat(final List<String> strings) { final StringBuilder sb = new StringBuilder(); for (String s : strings) { sb.append(StringUtils.trin(s)); } return sb.toString(); } }
[ "plantuml@gmail.com" ]
plantuml@gmail.com
3d1c30a451714b862cbcb38ae94224e6804eb5ce
8238bc5b3398bca1bdfab9a18225eb3fbd893cfd
/baselibrary/src/main/java/com/fy/custom/swiperefreshlayout/SwipyRefreshLayoutDirection.java
f5d3117c0fc9abcd756dbb7ceaf46190839e7ca1
[]
no_license
SetAdapter/MoveNurse
2a890ff9a456b9284df69f44fe2616bb306de386
c4770363d3b136cbe1a3cf1237d39c07151be2af
refs/heads/master
2020-04-23T14:02:05.946825
2019-02-18T05:12:30
2019-02-18T05:12:30
171,218,203
0
0
null
null
null
null
UTF-8
Java
false
false
524
java
package com.fy.custom.swiperefreshlayout; /** * */ public enum SwipyRefreshLayoutDirection { TOP(0), // 只有下拉刷新 BOTTOM(1), // 只有加载更多 BOTH(2);// 全都有 private int mValue; SwipyRefreshLayoutDirection(int value) { this.mValue = value; } public static SwipyRefreshLayoutDirection getFromInt(int value) { for (SwipyRefreshLayoutDirection direction : SwipyRefreshLayoutDirection .values()) { if (direction.mValue == value) { return direction; } } return BOTH; } }
[ "383411934@qq.com" ]
383411934@qq.com
87949790b4d59755d43cfcf64c9639b298e87c3b
2e5a0808dc68d74b53d4bddc26d63c301a2dd7ad
/bc-log/src/main/java/cn/bc/log/web/struts2/SyslogsAction.java
fb9da5ac2de25d1470e030f895928be1a1ef962c
[]
no_license
bcsoft/bc-framework
64ab6902e85a6b1082925cc7c5b48391fa693e8c
50d8dc96f5602608c66f434a36eeb9f9398ecf11
refs/heads/master
2023-05-10T16:22:07.931356
2023-05-05T07:20:43
2023-05-05T07:20:43
1,870,998
12
15
null
2023-04-14T18:20:29
2011-06-09T14:10:06
Java
UTF-8
Java
false
false
6,708
java
/** * */ package cn.bc.log.web.struts2; import cn.bc.BCConstants; import cn.bc.core.query.condition.Condition; import cn.bc.core.query.condition.Direction; import cn.bc.core.query.condition.impl.EqualsCondition; import cn.bc.core.query.condition.impl.OrderCondition; import cn.bc.db.jdbc.SqlObject; import cn.bc.identity.domain.ActorHistory; import cn.bc.identity.web.SystemContext; import cn.bc.log.domain.Syslog; import cn.bc.web.formater.CalendarFormater; import cn.bc.web.struts2.ViewAction; import cn.bc.web.ui.html.grid.Column; import cn.bc.web.ui.html.grid.IdColumn4MapKey; import cn.bc.web.ui.html.grid.TextColumn; import cn.bc.web.ui.html.grid.TextColumn4MapKey; import cn.bc.web.ui.html.page.PageOption; import cn.bc.web.ui.html.toolbar.Toolbar; import cn.bc.web.ui.html.toolbar.ToolbarButton; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * 系统日志视图Action * * @author dragon */ @Scope(BeanDefinition.SCOPE_PROTOTYPE) @Controller public class SyslogsAction extends ViewAction<Map<String, Object>> { private static final long serialVersionUID = 1L; public boolean my = false; @Override protected String getFormActionName() { return my ? "mysyslog" : "syslog"; } @Override protected OrderCondition getGridDefaultOrderCondition() { return new OrderCondition("l.file_date", Direction.Desc); } @Override protected SqlObject<Map<String, Object>> getSqlObject() { SqlObject<Map<String, Object>> sqlObject = new SqlObject<Map<String, Object>>(); // 构建查询语句,where和order by不要包含在sql中(要统一放到condition中) StringBuffer sql = new StringBuffer(); sql.append("select l.id as id,l.type_ as type,l.subject as subject,l.file_date as fileDate"); sql.append(",l.author_id as authorId,h.actor_name as authorName,h.pname as authorDepart"); sql.append(",l.c_ip as clientIp,l.c_info as clientInfo,l.s_ip as serverIp"); sql.append(" from bc_log_system as l"); sql.append(" inner join bc_identity_actor_history as h on h.id=l.author_id"); sqlObject.setSql(sql.toString()); // 注入参数 sqlObject.setArgs(null); // 数据映射器 sqlObject.setRowMapper((rs, rowNum) -> { Map<String, Object> map = new HashMap<>(); int i = 0; map.put("id", rs[i++]); map.put("type", rs[i++]); map.put("subject", rs[i++]); map.put("fileDate", rs[i++]); map.put("authorId", rs[i++]); map.put("authorName", rs[i++]); map.put("authorDepart", rs[i++]); map.put("clientIp", rs[i++]); map.put("clientInfo", rs[i++]); map.put("serverIp", rs[i++]); return map; }); return sqlObject; } @Override protected List<Column> getGridColumns() { List<Column> columns = new ArrayList<>(); columns.add(new IdColumn4MapKey("l.id", "id")); columns.add(new TextColumn4MapKey("l.file_date", "fileDate", getText("syslog.createDate"), 130).setSortable(true) .setDir(Direction.Desc) .setValueFormater(new CalendarFormater("yyyy-MM-dd HH:mm"))); columns.add(new TextColumn4MapKey("l.type_", "type", getText("syslog.type"), 60).setSortable(true).setValueFormater( new SyslogTypeFormater(getSyslogTypes()))); columns.add(new TextColumn4MapKey("h.actor_name", "authorName", getText("syslog.userName"), 80).setSortable(true)); columns.add(new TextColumn4MapKey("l.c_ip", "clientIp", getText("syslog.clientIp"), 110).setSortable(true)); columns.add(new TextColumn4MapKey("h.pname", "authorDepart", getText("syslog.departName"), 200).setSortable(true) .setUseTitleFromLabel(true)); if (!my) columns.add(new TextColumn4MapKey("l.s_ip", "serverIp", getText("syslog.serverIp"), 240) .setSortable(true).setUseTitleFromLabel(true)); columns.add(new TextColumn4MapKey("l.c_info", "clientInfo", getText("syslog.clientInfo"), 800).setSortable(true) .setUseTitleFromLabel(true)); columns.add(new TextColumn()); return columns; } /** * 获取系统日志分类值转换列表 * * @return */ private Map<String, String> getSyslogTypes() { Map<String, String> types = new HashMap<String, String>(); types = new HashMap<String, String>(); types.put(String.valueOf(Syslog.TYPE_LOGIN), getText("syslog.type.login")); types.put(String.valueOf(Syslog.TYPE_LOGOUT), getText("syslog.type.logout")); types.put(String.valueOf(Syslog.TYPE_LOGIN_TIMEOUT), getText("syslog.type.logout2")); types.put(String.valueOf(Syslog.TYPE_RELOGIN), getText("syslog.type.relogin")); return types; } @Override protected String getGridRowLabelExpression() { return "['subject']"; } @Override protected String[] getGridSearchFields() { return new String[]{"l.subject", "l.c_ip", "l.c_info", "l.s_ip", "h.actor_name", "h.pname"}; } @Override protected PageOption getHtmlPageOption() { return super.getHtmlPageOption().setWidth(800).setHeight(400) .setMinWidth(300).setMinHeight(300); } @Override protected Condition getGridSpecalCondition() { if (!my) {// 查看所有用户的日志信息 return null; } else {// 仅查看自己的日志信息 ActorHistory curUser = (ActorHistory) ((SystemContext) this .getContext()).getUserHistory(); return new EqualsCondition("l.author_id", curUser.getId()); } } @Override protected String getHtmlPageJs() { return this.getContextPath() + "/bc/log/syslog/list.js"; } @Override protected String getHtmlPageTitle() { return this.getText(this.getFormActionName() + ".title"); } @Override protected Toolbar getHtmlPageToolbar(boolean useDisabledReplaceDelete) { Toolbar tb = new Toolbar(); // 查看按钮 tb.addButton(this.getDefaultOpenToolbarButton().setAction(null) .setClick("bc.syslogList.checkWork")); // 按日统计登录帐号数按钮 tb.addButton(new ToolbarButton().setIcon("ui-icon-check") .setText(getText("syslog.statsByDay")) .setClick("bc.syslogList.statsByDay")); // 搜索按钮 tb.addButton(this.getDefaultSearchToolbarButton()); return tb; } // ==高级搜索代码开始== @Override protected boolean useAdvanceSearch() { return true; } @Override public String getAdvanceSearchConditionsJspPath() { return BCConstants.NAMESPACE + "/log/" + this.getFormActionName(); } // ==高级搜索代码结束== }
[ "rongjihuang@gmail.com" ]
rongjihuang@gmail.com
9081982fa026c13573888a3549739bde4faacbde
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/16/16_4ae023611822f469efdb95bef43a44cd84ca0ad4/PropertiesLoaderTest/16_4ae023611822f469efdb95bef43a44cd84ca0ad4_PropertiesLoaderTest_s.java
0afb838db8d6cec239fcddb213379dea94561095
[]
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,671
java
package org.jboss.tools.common.model.test; import java.io.IOException; import junit.framework.TestCase; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.Path; import org.jboss.tools.common.model.XModelObject; import org.jboss.tools.common.model.util.EclipseResourceUtil; import org.jboss.tools.test.util.JobUtils; import org.jboss.tools.test.util.TestProjectProvider; /** * * @author V.Kabanovich * */ public class PropertiesLoaderTest extends TestCase { static String BUNDLE_NAME = "org.jboss.tools.common.model.test"; TestProjectProvider provider = null; IProject project = null; public PropertiesLoaderTest() {} public void setUp() throws Exception { provider = new TestProjectProvider(BUNDLE_NAME, null, "Test1", true); project = provider.getProject(); project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor()); JobUtils.waitForIdle(); } public void testMalformedPropertiesFile() throws CoreException, IOException { IFile f = project.getFile(new Path("src/x.properties")); assertNotNull(f); XModelObject p = EclipseResourceUtil.createObjectForResource(f); assertNotNull(p); XModelObject a = p.getChildByPath("a"); assertNotNull(a); assertEquals(a.getAttributeValue("value"), "valueA"); XModelObject b = p.getChildByPath("b"); assertNull(b); XModelObject c = p.getChildByPath("c"); assertNotNull(c); assertEquals(c.getAttributeValue("value"), "valueC"); } public void testPropertiesThatEndWithMultipleBackslash() throws CoreException, IOException { IFile f = project.getFile(new Path("src/backslash.properties")); assertNotNull(f); XModelObject p = EclipseResourceUtil.createObjectForResource(f); assertNotNull(p); XModelObject p1 = p.getChildByPath("no_backslash"); assertNotNull(p1); assertEquals(p1.getAttributeValue("value"), "one line"); XModelObject p2 = p.getChildByPath("one_backslash"); assertNotNull(p2); assertEquals(p2.getAttributeValue("value"), "first line second line"); XModelObject p3 = p.getChildByPath("two_backslash"); assertNotNull(p3); assertEquals(p3.getAttributeValue("value"), "also one line \\"); XModelObject p4 = p.getChildByPath("three_backslash"); assertNotNull(p4); assertEquals(p4.getAttributeValue("value"), "again first line \\again second line"); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
047de8c39e5212103f7b69467c0d191cc0dd6f6f
4c203fad5692f08889a7bfdd2fc0a684def5bbc7
/optaplanner-examples/src/main/java/org/optaplanner/examples/common/persistence/AbstractXmlSolutionExporter.java
88836022697a9fbafaab8b60e705b7ef711638b1
[ "Apache-2.0" ]
permissive
sshyran/optaplanner
2101f90dde84666fb933b2672202e51c74bc91f9
e16df589aae47bfdef57de8074092abb956f5aab
refs/heads/main
2023-04-16T17:29:42.837191
2022-06-17T08:05:35
2022-06-17T08:05:35
342,868,463
1
0
Apache-2.0
2021-02-27T13:55:06
2021-02-27T13:55:05
null
UTF-8
Java
false
false
2,386
java
package org.optaplanner.examples.common.persistence; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import org.jdom.Document; import org.jdom.JDOMException; import org.jdom.output.Format; import org.jdom.output.XMLOutputter; import org.optaplanner.core.api.domain.solution.PlanningSolution; /** * @param <Solution_> the solution type, the class with the {@link PlanningSolution} annotation */ public abstract class AbstractXmlSolutionExporter<Solution_> extends AbstractSolutionExporter<Solution_> { protected static final String DEFAULT_OUTPUT_FILE_SUFFIX = "xml"; @Override public String getOutputFileSuffix() { return DEFAULT_OUTPUT_FILE_SUFFIX; } public abstract XmlOutputBuilder<Solution_> createXmlOutputBuilder(); @Override public void writeSolution(Solution_ solution, File outputFile) { try (OutputStream out = new BufferedOutputStream(new FileOutputStream(outputFile))) { Document document = new Document(); XmlOutputBuilder<Solution_> xmlOutputBuilder = createXmlOutputBuilder(); xmlOutputBuilder.setDocument(document); xmlOutputBuilder.setSolution(solution); xmlOutputBuilder.writeSolution(); XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat()); outputter.output(document, out); logger.info("Exported: {}", outputFile); } catch (IOException e) { throw new IllegalArgumentException("Could not write the file (" + outputFile.getName() + ").", e); } catch (JDOMException e) { throw new IllegalArgumentException("Could not format the XML file (" + outputFile.getName() + ").", e); } } public static abstract class XmlOutputBuilder<Solution_> extends OutputBuilder { protected Document document; public void setDocument(Document document) { this.document = document; } public abstract void setSolution(Solution_ solution); public abstract void writeSolution() throws IOException, JDOMException; // ************************************************************************ // Helper methods // ************************************************************************ } }
[ "gds.geoffrey.de.smet@gmail.com" ]
gds.geoffrey.de.smet@gmail.com
de8a01879f4582ff0f72f1124e7ac242ed641e31
696da830769051312eb277b4378b3653c3b71f93
/LeeExcelConPOI/src/excelOperations/ReadingExcelIteratorBacklog.java
40708646ac6017f3dcbd1ffb7d871ab9e2407fa3
[]
no_license
AxelCCp/EditorExcelConJavaYApachePOI
7a7065e9ea22de77e3ee3b29fe5ecd12d3aafc7d
789c53ca4b9aa5eafee3f9f99d925321446b6df1
refs/heads/master
2023-07-25T13:03:38.863469
2021-09-03T14:04:15
2021-09-03T14:04:15
402,623,020
0
0
null
null
null
null
UTF-8
Java
false
false
1,634
java
package excelOperations; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Iterator; import org.apache.poi.xssf.usermodel.XSSFCell; import org.apache.poi.xssf.usermodel.XSSFRow; import org.apache.poi.xssf.usermodel.XSSFSheet; import org.apache.poi.xssf.usermodel.XSSFWorkbook; public class ReadingExcelIteratorBacklog { public static void main(String[] args) throws IOException { // TODO Auto-generated method stub String excelFilePath = ".\\datafiles\\BackLog_V21 (1).xlsx"; FileInputStream file = new FileInputStream(excelFilePath); XSSFWorkbook workbook = new XSSFWorkbook(file); //XSSFSheet sheet = workbook.getSheet("Sheet1"); //it's the same. XSSFSheet sheet = workbook.getSheetAt(2); //NOW WE USE ITERATOR Iterator iterator = sheet.iterator(); while(iterator.hasNext()) { XSSFRow row = (XSSFRow) iterator.next(); Iterator cellIterator = row.cellIterator(); while(cellIterator.hasNext()) { XSSFCell cell = (XSSFCell) cellIterator.next(); switch(cell.getCellType()) { case STRING: System.out.print(cell.getStringCellValue()); break; case NUMERIC: System.out.print(cell.getNumericCellValue()); break; case BOOLEAN: System.out.print(cell.getBooleanCellValue()); break; case FORMULA: System.out.println(cell.getCachedFormulaResultType()); break; case ERROR: System.out.println(cell.getErrorCellValue()); break; } System.out.print(" / "); } System.out.println(""); } } }
[ "hpmajin@outlook.es" ]
hpmajin@outlook.es
0ea3e3a1ddebebb5657f11bcea13b068875e8f55
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_72d8becb5675089935a9dc1b57973fa5e2c796bc/Constants/2_72d8becb5675089935a9dc1b57973fa5e2c796bc_Constants_t.java
af236f849ceaa72dce1d5c7d1b6afb681b4d2176
[]
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,995
java
/* * Copyright (C) 2011 Dominik Schürmann <dominik@dominikschuermann.de> * * This file is part of AdAway. * * AdAway 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. * * AdAway 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 AdAway. If not, see <http://www.gnu.org/licenses/>. * */ package org.adaway.util; public class Constants { /* DEBUG enables Log.d outputs wrapped in org.adaway.util.Log and RootTools Debug Mode */ public static final boolean DEBUG = false; public static final boolean DEBUG_UPDATE_CHECK_SERVICE = false; public static final boolean DEBUG_DISABLE_ROOT_CHECK = false; public static final String TAG = "AdAway"; public static final String PREFS_NAME = "preferences"; public static final String LOCALHOST_IPv4 = "127.0.0.1"; public static final String LOCALHOST_IPv6 = "::1"; public static final String BOGUS_IPv4 = "0.0.0.0"; public static final String LOCALHOST_HOSTNAME = "localhost"; public static final String DOWNLOADED_HOSTS_FILENAME = "hosts_downloaded"; public static final String HOSTS_FILENAME = "hosts"; public static final String LINE_SEPERATOR = System.getProperty("line.separator", "\n"); public static final String FILE_SEPERATOR = System.getProperty("file.separator", "/"); public static final String COMMAND_COPY = "busybox cp -f"; public static final String COMMAND_CHOWN = "busybox chown 0:0"; public static final String COMMAND_CHMOD_644 = "busybox chmod 644"; public static final String COMMAND_CHMOD_666 = "busybox chmod 666"; public static final String COMMAND_LN = "busybox ln -s"; public static final String COMMAND_RM = "busybox rm -f"; public static final String WEBSERVER_EXECUTEABLE = "mongoose"; public static final String ANDROID_SYSTEM_PATH = System.getProperty("java.home", "/system"); public static final String ANDROID_SYSTEM_ETC_HOSTS = ANDROID_SYSTEM_PATH + FILE_SEPERATOR + "etc" + FILE_SEPERATOR + HOSTS_FILENAME; public static final String ANDROID_DATA_DATA_HOSTS = FILE_SEPERATOR + "data" + FILE_SEPERATOR + "data" + FILE_SEPERATOR + HOSTS_FILENAME; public static final String HEADER1 = "# This hosts file is generated by AdAway."; public static final String HEADER2 = "# Please do not modify it directly, it will be overwritten when AdAway is applied again."; public static final String HEADER_SOURCES = "# This file is generated from the following sources:"; }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
2ea977e84391af45308c5f20897c05f775787a0f
388241a3173c5e228627fbd00ff5d02b372cb9d9
/anan-cloudadviced/anan-platformserver/src/main/java/top/fosin/anan/platform/service/RolePermissionServiceImpl.java
bd575aa0677892591f3ee2a15dc178a82e555cad
[ "Apache-2.0" ]
permissive
open-framework/anan-cloud
bdf65bd5f78b01235d56ffdbc3038ee8222107ac
945e62c1b8c7254dae03c58eb1c6447136937a86
refs/heads/master
2023-08-07T12:57:08.256544
2021-10-03T04:40:46
2021-10-03T04:40:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,774
java
package top.fosin.anan.platform.service; import org.springframework.cache.annotation.CacheEvict; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.Assert; import top.fosin.anan.cloudresource.constant.RedisConstant; import top.fosin.anan.cloudresource.dto.res.AnanRolePermissionRespDto; import top.fosin.anan.core.util.BeanUtil; import top.fosin.anan.platform.dto.req.AnanRolePermissionCreateDto; import top.fosin.anan.platform.entity.AnanRolePermissionEntity; import top.fosin.anan.platform.repository.RolePermissionRepository; import top.fosin.anan.platform.service.inter.RolePermissionService; import java.util.Collection; import java.util.List; /** * @author fosin * @date 2017/12/29 * */ @Service @Lazy public class RolePermissionServiceImpl implements RolePermissionService { private final RolePermissionRepository rolePermissionRepository; public RolePermissionServiceImpl(RolePermissionRepository rolePermissionRepository) { this.rolePermissionRepository = rolePermissionRepository; } @Override public List<AnanRolePermissionEntity> findByRoleId(Long roleId) { return rolePermissionRepository.findByRoleId(roleId); } @Override public long countByPermissionId(Long permissionId) { return rolePermissionRepository.countByPermissionId(permissionId); } /** * 根据实体集合批量删除 * * @param deleteCol 实体类中属性名称, * @param aLong 属性值 */ @Override @Transactional(rollbackFor = Exception.class) public void deleteInBatch(String deleteCol, Long aLong) { RolePermissionService.super.deleteInBatch(deleteCol, aLong); } @Override @CacheEvict(value = RedisConstant.ANAN_USER_ALL_PERMISSIONS, allEntries = true) @Transactional(rollbackFor = Exception.class) public List<AnanRolePermissionRespDto> updateInBatch(String deleteCol, Long roleId, Collection<AnanRolePermissionCreateDto> dtos) { Assert.notNull(roleId, "传入的角色ID不能为空!"); Assert.isTrue(dtos.stream().allMatch(entity -> entity.getRoleId().equals(roleId)), "需要更新的数据集中有与版本ID不匹配的数据!"); Collection<AnanRolePermissionEntity> saveEntities = BeanUtil.copyCollectionProperties(dtos, AnanRolePermissionEntity.class); rolePermissionRepository.deleteByRoleId(roleId); return BeanUtil.copyCollectionProperties(rolePermissionRepository.saveAll(saveEntities), AnanRolePermissionRespDto.class); } @Override public RolePermissionRepository getRepository() { return rolePermissionRepository; } }
[ "28860823@qq.com" ]
28860823@qq.com
56a7da06171608bf2b46c59dd851db1092422285
678bf3d29debc535cbe458b62231b148913975bf
/src/main/java/articlemanagementsystem/services/createrole/CreateRoleImpl.java
4cf1a4a5bab615c5c5b119a4407af5ebcd48a772
[]
no_license
ahmadmolla1995/Project10
4109c465605a1b78455cbcb2f12e68469f9850d2
e17377c74c9dc380c557fd322bba05989547fa00
refs/heads/master
2022-07-16T02:34:30.966079
2020-02-17T22:55:04
2020-02-17T22:55:04
241,224,220
0
0
null
2022-06-21T02:49:11
2020-02-17T22:49:31
Java
UTF-8
Java
false
false
1,299
java
package articlemanagementsystem.services.createrole; import articlemanagementsystem.config.annotation.Service; import articlemanagementsystem.exceptions.InvalidCommandException; import articlemanagementsystem.exceptions.RoleAlreadyExistsException; import articlemanagementsystem.exceptions.UserSessionNotExistsException; import articlemanagementsystem.model.Role; import articlemanagementsystem.repositories.RoleRepository; import articlemanagementsystem.util.AuthenticationService; @Service public class CreateRoleImpl implements CreateRoleUseCase { @Override public void createRole(String role) throws InvalidCommandException, UserSessionNotExistsException, RoleAlreadyExistsException { if (AuthenticationService.getCurrentUser() == null) throw new UserSessionNotExistsException("The user is not logged in! Please log in first"); if (!AuthenticationService.getCurrentUser().getUserRole().equals("admin")) throw new InvalidCommandException("Only admin can create new role!"); try { RoleRepository repository = RoleRepository.getInstance(); repository.save(new Role(null, role)); } catch (Exception e) { throw new RoleAlreadyExistsException("The role title already exists!"); } } }
[ "=" ]
=
5a35c4014808ddc70e48b43922c208811e3cfb46
8494c17b608e144370ee5848756b7c6ae38e8046
/gulimall-ware/src/main/java/com/atguigu/gulimall/ware/service/impl/WareSkuServiceImpl.java
04290cd5e3380ad168f75b18f361c6acb1e8d092
[ "Apache-2.0" ]
permissive
cchaoqun/SideProject1_GuliMall
b235ee01df30bc207c747cf281108006482a778a
aef4c26b7ed4b6d17f7dcadd62e725f5ee68b13e
refs/heads/main
2023-06-11T02:23:28.729831
2021-07-07T11:56:13
2021-07-07T11:56:13
375,354,919
0
0
null
null
null
null
UTF-8
Java
false
false
2,954
java
package com.atguigu.gulimall.ware.service.impl; import com.atguigu.common.utils.R; import com.atguigu.gulimall.ware.feign.ProductFeignService; import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; import java.util.Map; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.atguigu.common.utils.PageUtils; import com.atguigu.common.utils.Query; import com.atguigu.gulimall.ware.dao.WareSkuDao; import com.atguigu.gulimall.ware.entity.WareSkuEntity; import com.atguigu.gulimall.ware.service.WareSkuService; import org.springframework.transaction.annotation.Transactional; @Service("wareSkuService") public class WareSkuServiceImpl extends ServiceImpl<WareSkuDao, WareSkuEntity> implements WareSkuService { @Autowired WareSkuDao wareSkuDao; @Autowired ProductFeignService productFeignService; @Override public PageUtils queryPage(Map<String, Object> params) { QueryWrapper<WareSkuEntity> queryWrapper = new QueryWrapper<>(); String skuId = (String) params.get("skuId"); if(!StringUtils.isEmpty(skuId)){ queryWrapper.eq("sku_id", skuId); } String wareId = (String) params.get("wareId"); if(!StringUtils.isEmpty(wareId)){ queryWrapper.eq("ware_id", wareId); } IPage<WareSkuEntity> page = this.page( new Query<WareSkuEntity>().getPage(params), queryWrapper ); return new PageUtils(page); } @Override public void addStock(Long skuId, Long wareId, Integer skuNum) { // 1. 判断如果还没有这个库存记录新增 List<WareSkuEntity> entities = wareSkuDao.selectList(new QueryWrapper<WareSkuEntity>().eq("sku_id", skuId).eq("ware_id", wareId)); if(entities==null || entities.size()==0){ WareSkuEntity skuEntity = new WareSkuEntity(); skuEntity.setSkuId(skuId); skuEntity.setStock(skuNum); skuEntity.setWareId(wareId); skuEntity.setStockLocked(0); //TODO 远程查询sku的名字, 如果失败, 整个事务无需回滚 //1. 自己catch异常 // TODO 除了catch还有什么方法 try{ R info = productFeignService.info(skuId); Map<String, Object> data =(Map<String, Object>) info.get("skuInfo"); if(info.getCode()==0){ skuEntity.setSkuName((String) data.get("skuName")); } }catch (Exception e){ } skuEntity.setSkuName(""); wareSkuDao.insert(skuEntity); }else{ wareSkuDao.addStock(skuId,wareId, skuNum); } } }
[ "chengchaoqun@hotmail.com" ]
chengchaoqun@hotmail.com
daaf58808ca77c0562753e29f5d3494982560730
2a3f19a4a2b91d9d715378aadb0b1557997ffafe
/sources/com/mcdonalds/app/customer/TermsOfServiceActivity.java
d4be02ff313ee0565c7354f7465e9c1e775cfd45
[]
no_license
amelieko/McDonalds-java
ce5062f863f7f1cbe2677938a67db940c379d0a9
2fe00d672caaa7b97c4ff3acdb0e1678669b0300
refs/heads/master
2022-01-09T22:10:40.360630
2019-04-21T14:47:20
2019-04-21T14:47:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,206
java
package com.mcdonalds.app.customer; import android.os.Build.VERSION; import android.os.Bundle; import android.support.p000v4.app.FragmentTransaction; import com.ensighten.Ensighten; import com.mcdonalds.app.p043ui.URLActionBarActivity; import com.mcdonalds.app.util.LanguageUtil; public class TermsOfServiceActivity extends URLActionBarActivity { /* Access modifiers changed, original: protected */ public boolean shouldAutoSetParentIntent() { Ensighten.evaluateEvent(this, "shouldAutoSetParentIntent", null); return false; } /* Access modifiers changed, original: protected */ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); transaction.replace(getContainerResource(), passIntentExtrasAsArgument(new TermsOfServiceFragment())); transaction.commit(); } /* Access modifiers changed, original: protected */ public void onResume() { super.onResume(); if (VERSION.SDK_INT >= 24) { LanguageUtil.changeAppLanguage(getResources(), LanguageUtil.getAppLanguage()); } } }
[ "makfc1234@gmail.com" ]
makfc1234@gmail.com
8140cf9d645fb6313e72c860c7df3209a6c3c685
421f0a75a6b62c5af62f89595be61f406328113b
/generated_tests/model_seeding/18_jsecurity-org.jsecurity.crypto.hash.Sha512Hash-1.0-10/org/jsecurity/crypto/hash/Sha512Hash_ESTest.java
e193f3a0db87794e54d076f1788e134c83a7c3a5
[]
no_license
tigerqiu712/evosuite-model-seeding-empirical-evaluation
c78c4b775e5c074aaa5e6ca56bc394ec03c2c7c6
11a920b8213d9855082d3946233731c843baf7bc
refs/heads/master
2020-12-23T21:04:12.152289
2019-10-30T08:02:29
2019-10-30T08:02:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
651
java
/* * This file was automatically generated by EvoSuite * Sat Oct 26 01:39:00 GMT 2019 */ package org.jsecurity.crypto.hash; import org.junit.Test; import static org.junit.Assert.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true, useJEE = true) public class Sha512Hash_ESTest extends Sha512Hash_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pderakhshanfar@bsr01.win.tue.nl" ]
pderakhshanfar@bsr01.win.tue.nl
e5f99a76e28a1e72b57c7c9b69abc5cb73b83a68
7bf70fc36fba72ba183aa035fc81bc654e916267
/src/main/java/com/rafabene/demos/deltaspike/infra/ResourcesProducer.java
7a10a9fe9458ffe03f7570068a428ecfe71e8f13
[]
no_license
rafaelpevidor/demo_deltaspike
973da1fba213482e2ba7822412cd2b4a9a76d267
a3cad2359e6df0f3bdf85dc8fd71d59096b1cfb5
refs/heads/master
2022-04-18T09:09:52.966809
2016-02-26T15:35:42
2016-02-26T15:35:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,439
java
package com.rafabene.demos.deltaspike.infra; import java.util.logging.Logger; import javax.enterprise.context.ApplicationScoped; import javax.enterprise.context.RequestScoped; import javax.enterprise.inject.Disposes; import javax.enterprise.inject.Produces; import javax.enterprise.inject.spi.InjectionPoint; import javax.faces.context.FacesContext; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.PersistenceUnit; import org.apache.deltaspike.scheduler.spi.Scheduler; import org.quartz.Job; public class ResourcesProducer { @PersistenceUnit private EntityManagerFactory emf; @Produces @RequestScoped public EntityManager createEntityManager() { return emf.createEntityManager(); } @Produces public Logger produceLog(InjectionPoint injectionPoint) { return Logger.getLogger(injectionPoint.getMember().getDeclaringClass().getName()); } @Produces @RequestScoped public FacesContext produceFacesContext(){ return FacesContext.getCurrentInstance(); } @Produces @ApplicationScoped @SuppressWarnings({"unchecked", "rawtypes", "cdi-ambiguous-dependency"}) public Scheduler<Job> produceScheduler(Scheduler scheduler) { return scheduler; } public void close(@Disposes EntityManager em) { if (em.isOpen()) { em.close(); } } }
[ "rafabene@gmail.com" ]
rafabene@gmail.com
c505a09ca54ed16411297d514151cb499ebefdf9
26d459097a814cf68985748dded27ec0ad17e6e9
/cdst-business/cdst_be_marche/src/main/java/cdst_be_marche/DTO/RispostaConferenceTemplateListDTO.java
e072f4fc990514b73ede04f7ef0cd296ea495a35
[]
no_license
christiandeangelis/meetpad-public
096af0f7d058a1dd78ce3ca667e8077302f4b20a
d7bac39cc93056859ac34cda2aa1e85cec3f73ea
refs/heads/main
2023-07-13T20:34:52.657949
2021-09-01T12:19:32
2021-09-01T12:19:32
402,055,182
0
0
null
2021-09-01T12:37:26
2021-09-01T12:37:26
null
UTF-8
Java
false
false
256
java
package cdst_be_marche.DTO; import cdst_be_marche.DTO.bean.Risposta; import io.swagger.annotations.ApiModel; @ApiModel(value="ConferenceTemplateListResponse") public class RispostaConferenceTemplateListDTO extends Risposta<ConferenceTemplateListDTO>{ }
[ "antonio.genghi@regione.emilia-romagna.it" ]
antonio.genghi@regione.emilia-romagna.it
60b3c9cbe0c475cf9335b47ff641073dee9f050c
c45b325fade73ecce94bdc225de766979b89e7bf
/src/main/java/ru/vacancies/parser/metadata/MetaData.java
b1e5d1d2801c2ddae156101b4cf3370da6481106
[]
no_license
vinsmain/git-repo-vacancies
cd8ef439655487c35003eb0576ef8112eed44b7a
433e962b9ba60f804de828a8594060599653bdc1
refs/heads/master
2020-12-30T12:44:08.001755
2017-08-08T10:39:57
2017-08-08T10:39:57
91,352,489
0
0
null
null
null
null
UTF-8
Java
false
false
341
java
package ru.vacancies.parser.metadata; import com.google.gson.annotations.SerializedName; public class MetaData { @SerializedName("resultset") private ResultSet resultSet; public MetaData(ResultSet resultSet) { this.resultSet = resultSet; } public ResultSet getResultSet() { return resultSet; } }
[ "vinsmain@gmail.com" ]
vinsmain@gmail.com
d9846fdd85fe7f6af752e0ba229be168297cfcb4
14ba89d545d118d09ffaa232939810f97b60f7b6
/spring-kata/src/main/java/io/erenkaya/akaldiroglu/_04_example/domain/StandartOutputProvider.java
6d24e3699dca7975893c9879a9c7a20e142927f4
[]
no_license
ErenKaya/code-practices
dc48ec896d50af6b9dfa88764b7bcba93f8c6d88
c21373e6c5a79fd535d1e84270de335f02f9d65a
refs/heads/master
2022-10-17T22:04:30.331438
2022-10-10T03:29:07
2022-10-10T03:29:07
132,752,781
5
1
null
2022-08-01T10:45:05
2018-05-09T12:21:17
Java
UTF-8
Java
false
false
398
java
package io.erenkaya.akaldiroglu._04_example.domain; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Component; @Component(value = "provider1") @Qualifier("standart") public class StandartOutputProvider implements GreetingProvider { private String greeting = "Hello World!"; @Override public String getGreeting() { return greeting; } }
[ "erenkaya1993@gmail.com" ]
erenkaya1993@gmail.com
4721a1dd22af7aef2b77b7af1a3ef54beb050c81
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_41f94b1295992c25d96353b386be359596dbf2c3/Sheep/2_41f94b1295992c25d96353b386be359596dbf2c3_Sheep_t.java
88a062ee738778c524e8a9b03bf833ad788f3865
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
1,115
java
package models; import java.util.List; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; import play.data.validation.Constraints.Required; import play.db.ebean.Model; @Entity @Table(name = "Sheep") public class Sheep extends Model { @Id public long id; public long producerId; public long sheepId; @Required public long rfid; public String name; public long timeOfBirth; public double birthWeight; public String notes; public boolean attacked; public long timeAdded; public static Model.Finder<Long, Sheep> find = new Model.Finder<Long, Sheep>(Long.class, Sheep.class); public static Model.Finder<String, Sheep> findByName = new Model.Finder<String, Sheep>(String.class, Sheep.class); public static Sheep create(long id, long rfid, long producerId) { return new Sheep(); } public static List<Sheep> findAll() { return find.all(); } public static List<Sheep> findByName(String name) { return findByName.where().eq("name", name).findList(); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
4e3174548b4da28322ce1dfe409af433839722a6
0c653cda261d9256dc24736c50ac9070d11d513a
/plugin_ide.ui/src/com/github/rustdt/ide/ui/preferences/RustToolchainConfigurationPage.java
87043c918421b7aae686d22613dbb9f99f67658b
[]
no_license
rutsky/RustDT
e14d8e440f5e0092adebea7905c46e3c73bc43d4
69687c918b9bfbc3bdd98640741b9f350611252b
refs/heads/master
2021-01-17T19:59:05.498780
2015-10-09T18:29:52
2015-10-09T18:29:52
44,029,566
0
0
null
2015-10-10T21:46:18
2015-10-10T21:46:17
null
UTF-8
Java
false
false
1,814
java
/******************************************************************************* * Copyright (c) 2015 Bruno Medeiros and other Contributors. * 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: * Bruno Medeiros - initial API and implementation *******************************************************************************/ package com.github.rustdt.ide.ui.preferences; import static com.github.rustdt.ide.core.operations.RustSDKPreferences.RACER_PATH; import static com.github.rustdt.ide.core.operations.RustSDKPreferences.SDK_SRC_PATH2; import org.eclipse.core.resources.IProject; import melnorme.lang.ide.core.operations.ToolchainPreferences; import melnorme.lang.ide.ui.dialogs.AbstractLangPropertyPage; import melnorme.lang.ide.ui.preferences.ProjectSDKSettingsBlock; import melnorme.lang.ide.ui.preferences.common.IPreferencesWidgetComponent; public class RustToolchainConfigurationPage extends AbstractLangPropertyPage { @Override protected IPreferencesWidgetComponent createProjectConfigComponent(IProject project) { return new ProjectSDKSettingsBlock(project, ToolchainPreferences.USE_PROJECT_SETTINGS, ToolchainPreferences.SDK_PATH.getProjectPreference()) { @Override protected RustToolsConfigBlock init_createSDKLocationGroup() { RustToolsConfigBlock rustToolsConfigBlock = new RustToolsConfigBlock(); addFieldBinding(rustToolsConfigBlock.sdkSrcLocation, SDK_SRC_PATH2); addFieldBinding(rustToolsConfigBlock.racerLocation, RACER_PATH); return rustToolsConfigBlock; } }; } }
[ "bruno.do.medeiros@gmail.com" ]
bruno.do.medeiros@gmail.com
e00e40fbba1ce6470cd7f6a692f8445aa9359982
6996f2ba88aa329aa34a970a83f477ae70eb876f
/src/com/lcc/zerenlian/impl/ProjectManager.java
99623b0206d10781ff527d8eeeedabb733d644c6
[]
no_license
liangchengcheng/23project
b95553a0483687770afc27258844357a3aa3529b
fc209852c677883413e87b8db11930e392e68069
refs/heads/master
2021-09-04T04:39:21.036039
2018-01-15T22:55:52
2018-01-15T22:55:52
108,776,259
0
0
null
null
null
null
UTF-8
Java
false
false
716
java
package com.lcc.zerenlian.impl; public class ProjectManager extends Handler{ @Override public String handleFeeRequest(String user, double fee) { String str = ""; //项目经理的权限比较小,只能在500之内 if (fee < 500){ //为了测试,只要是我请求的就直接过 if ("梁铖城".equals(user)){ str = "成功了"; }else { str = "失败了"; } }else { //超过了500就直接传递给更高级的经理 if (getSuccessor() != null){ return getSuccessor().handleFeeRequest(user,fee); } } return str; } }
[ "1038127753@qq.com" ]
1038127753@qq.com
32fb679451595914cf1a3ffd43c5062ce942c2ee
be5c86e8fe3f5836b7d2097dd5272c72b5b28f15
/backtracking/Java/0127-word-ladder/src/Solution.java
eabe52d49f97fee08ad5d43adc9906b5f28545f2
[ "Apache-2.0" ]
permissive
lemonnader/LeetCode-Solution-Well-Formed
d24674898ceb5441c036016dc30afc58e4a1247a
baabdb1990fd49ab82a712e121f49c4f68b29459
refs/heads/master
2021-04-23T18:49:40.337569
2020-03-24T04:50:27
2020-03-24T04:50:27
249,972,064
1
0
Apache-2.0
2020-03-25T12:26:25
2020-03-25T12:26:24
null
UTF-8
Java
false
false
3,078
java
import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Queue; import java.util.Set; public class Solution { private List<String> wordList; /** * 广度优先遍历要记录结点被遍历的情况,所以要使用一个 Set */ private Set<String> visited = new HashSet<>(); private class Pair { private String word; private Integer step; public Pair(String word, Integer step) { this.word = word; this.step = step; } } public int ladderLength(String beginWord, String endWord, List<String> wordList) { this.wordList = wordList; // 遇到最短路径问题,想都不要想,先来一个队列,写成栈就全部错误了 Queue<Pair> queue = new LinkedList<>(); queue.offer(new Pair(beginWord, 1)); visited.add(beginWord); while (!queue.isEmpty()) { Pair curPair = queue.poll(); String curWord = curPair.word; Integer step = curPair.step; step++; List<String> nextWords = onlyChangeOne(curWord); for (String nextWord : nextWords) { if (nextWord.equals(endWord)) { return step; } queue.offer(new Pair(nextWord, step)); // 千万不要忘了 visited.add(nextWord); } } return 0; } /** * 与 word 相差一个字母的 wordList 的元素有哪些,并且要保证没有使用过 * * @param word * @return */ private List<String> onlyChangeOne(String word) { List<String> res = new ArrayList<>(); int len = word.length(); for (String match : wordList) { // assert match.length() == len; int count = 0; for (int i = 0; i < len; i++) { if (word.charAt(i) != match.charAt(i)) { count++; // 如果不同的字母的数量已经大于 1 个,那么它就肯定不是我们要找的单词 if (count >= 2) { break; } } } if (count == 1 && !visited.contains(match)) { res.add(match); } } return res; } public static void main(String[] args) { List<String> wordList = new ArrayList<>(); String[] words = {"hot", "dot", "dog", "lot", "log", "cog"}; Collections.addAll(wordList, words); Solution solution = new Solution(); String beginWord = "hit"; String endWord = "cog"; int ladderLength = solution.ladderLength(beginWord, endWord, wordList); System.out.println(String.format("从 %s 到 %s 的最短转换序列的长度:%d。", beginWord, endWord, ladderLength)); } }
[ "liweiwei1419@gmail.com" ]
liweiwei1419@gmail.com
86afad7a16d3099c7e78fa1916c70ca269e6d08c
1d11d02630949f18654d76ed8d5142520e559b22
/TreeGrow/src/org/tolweb/treegrow/page/DeleteTableItemButton.java
7bbc323ba24261a571a3eb9e654ca9d07ae8c551
[]
no_license
tolweb/tolweb-app
ca588ff8f76377ffa2f680a3178351c46ea2e7ea
3a7b5c715f32f71d7033b18796d49a35b349db38
refs/heads/master
2021-01-02T14:46:52.512568
2012-03-31T19:22:24
2012-03-31T19:22:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,936
java
/* * DeleteTableItemButton.java * * Created on July 29, 2003, 5:13 PM */ package org.tolweb.treegrow.page; import java.awt.event.*; import javax.swing.*; import org.tolweb.treegrow.main.*; import org.tolweb.treegrow.page.undo.*; /** * Button that removes the currently selected table item from a table and * fires the undoable edit */ public class DeleteTableItemButton extends JButton implements ActionListener { /** * */ private static final long serialVersionUID = -6271207552844712515L; private AbstractPageEditorPanel panel; private ToLJFrame frame; protected AbstractDraggableTable table; /** Creates a new instance of DeleteTableItemButton */ public DeleteTableItemButton(AbstractPageEditorPanel p, AbstractDraggableTable t) { super("Delete"); panel = p; table = t; addActionListener(this); } /** Creates a new instance of DeleteTableItemButton */ public DeleteTableItemButton(ToLJFrame f, AbstractDraggableTable t) { super("Delete"); frame = f; table = t; addActionListener(this); } public void actionPerformed(ActionEvent e) { if (table.getSelectedRow() != -1 && okToDelete()) { PageFrame pageFrame = panel != null ? panel.getPageFrame() : null; RemoveTableItemUndoableEdit edit = new RemoveTableItemUndoableEdit(pageFrame, panel, (ChangedFromServerProvider) table.getList().get(table.getSelectedRow()), table, table.getSelectedRow()); if (panel != null) { panel.updateUndoStuff(edit); } else { frame.updateUndoStuff(edit); } } } /** * Can be overridden by subclasses to perform additional delete checking * * @return Whether it is ok to delete the selected item */ protected boolean okToDelete() { return true; } }
[ "lenards@iplantcollaborative.org" ]
lenards@iplantcollaborative.org
9426fbd9eeea91b9ea8082429ae2054be9b0a9fd
885c0991689149962b25a8e2c2600bdee4471116
/server/services/entitlement/src/main/java/org/keycloak/authz/server/entitlement/resource/EntitlementToken.java
690837a5b525914f448cb206ebcc6efb0ff3c099
[]
no_license
thomasdarimont/keycloak-authz
ecdfba28bcc021c30da28af00feb7e8d907c5f56
bae70aac7341394cd77281ce592dfcee01185405
refs/heads/master
2021-01-24T20:13:34.753925
2015-11-07T06:13:08
2015-11-07T06:13:08
48,201,475
0
1
null
2015-12-17T22:25:44
2015-12-17T22:25:43
null
UTF-8
Java
false
false
1,265
java
/* * JBoss, Home of Professional Open Source * * Copyright 2015 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.keycloak.authz.server.entitlement.resource; import java.util.List; import org.keycloak.representations.JsonWebToken; /** * @author <a href="mailto:psilva@redhat.com">Pedro Igor</a> */ public class EntitlementToken extends JsonWebToken { private final List<EntitledResource> permissions; public EntitlementToken() { this(null); } public EntitlementToken(List<EntitledResource> permissions) { this.permissions = permissions; type("kc_ett"); } public List<EntitledResource> getPermissions() { return this.permissions; } }
[ "pigor.craveiro@gmail.com" ]
pigor.craveiro@gmail.com
ed609a365a45370c4180db15309c073cca475c4b
30ce31989513fe03ca0736555adf6e8b80b1c093
/src/com/cisco/axl/api/_8/XMessageWaiting.java
065cd826e7d9ff776e7c1b7b2ac03512675eb1a2
[]
no_license
axenlarde/Woot
21374d0c29e9d6e0b6f0f91f2cbb455f2e2a875e
447728a2793f42530884bb0f3f388d33b3708bc1
refs/heads/master
2022-04-09T19:19:33.826592
2020-02-07T10:36:55
2020-02-07T10:36:55
115,440,477
4
1
null
null
null
null
UTF-8
Java
false
false
4,951
java
package com.cisco.axl.api._8; import javax.xml.bind.JAXBElement; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementRef; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for XMessageWaiting complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="XMessageWaiting"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence minOccurs="0"> * &lt;element name="pattern" type="{http://www.w3.org/2001/XMLSchema}string"/> * &lt;element name="routePartitionName" type="{http://www.cisco.com/AXL/API/8.5}XFkType"/> * &lt;element name="description" type="{http://www.cisco.com/AXL/API/8.5}String128" minOccurs="0"/> * &lt;element name="messageWaitingIndicator" type="{http://www.cisco.com/AXL/API/8.5}boolean"/> * &lt;element name="callingSearchSpaceName" type="{http://www.cisco.com/AXL/API/8.5}XFkType" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "XMessageWaiting", propOrder = { "pattern", "routePartitionName", "description", "messageWaitingIndicator", "callingSearchSpaceName" }) public class XMessageWaiting { protected String pattern; @XmlElementRef(name = "routePartitionName", type = JAXBElement.class) protected JAXBElement<XFkType> routePartitionName; protected String description; @XmlElement(defaultValue = "false") protected String messageWaitingIndicator; @XmlElementRef(name = "callingSearchSpaceName", type = JAXBElement.class) protected JAXBElement<XFkType> callingSearchSpaceName; /** * Gets the value of the pattern property. * * @return * possible object is * {@link String } * */ public String getPattern() { return pattern; } /** * Sets the value of the pattern property. * * @param value * allowed object is * {@link String } * */ public void setPattern(String value) { this.pattern = value; } /** * Gets the value of the routePartitionName property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link XFkType }{@code >} * */ public JAXBElement<XFkType> getRoutePartitionName() { return routePartitionName; } /** * Sets the value of the routePartitionName property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link XFkType }{@code >} * */ public void setRoutePartitionName(JAXBElement<XFkType> value) { this.routePartitionName = ((JAXBElement<XFkType> ) value); } /** * Gets the value of the description property. * * @return * possible object is * {@link String } * */ public String getDescription() { return description; } /** * Sets the value of the description property. * * @param value * allowed object is * {@link String } * */ public void setDescription(String value) { this.description = value; } /** * Gets the value of the messageWaitingIndicator property. * * @return * possible object is * {@link String } * */ public String getMessageWaitingIndicator() { return messageWaitingIndicator; } /** * Sets the value of the messageWaitingIndicator property. * * @param value * allowed object is * {@link String } * */ public void setMessageWaitingIndicator(String value) { this.messageWaitingIndicator = value; } /** * Gets the value of the callingSearchSpaceName property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link XFkType }{@code >} * */ public JAXBElement<XFkType> getCallingSearchSpaceName() { return callingSearchSpaceName; } /** * Sets the value of the callingSearchSpaceName property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link XFkType }{@code >} * */ public void setCallingSearchSpaceName(JAXBElement<XFkType> value) { this.callingSearchSpaceName = ((JAXBElement<XFkType> ) value); } }
[ "Alexandre@NANALENO" ]
Alexandre@NANALENO
a875a3583c9259bd237998f777325e5def5b90da
319a371ab83c04a9a2466b0ec1e2a67b93fa7f2f
/zj-chongqi-salary/src/main/java/com/apih5/mybatis/pojo/ZjXmCqjxProjectStaffAssistantDetailed.java
ffa7c88811bed5a72c4f699bab73d144db97a0f7
[]
no_license
zhangrenyi666/apih5-2
0232faa65e2968551d55db47fb35f689e5a03996
afd9b7d574fab11410aab5e0465a0bd706bcf942
refs/heads/master
2023-08-01T13:11:51.678508
2021-09-10T05:52:34
2021-09-10T05:52:34
406,647,352
0
0
null
null
null
null
UTF-8
Java
false
false
4,889
java
package com.apih5.mybatis.pojo; import java.math.BigDecimal; import java.util.Date; import java.util.List; import cn.hutool.json.JSONObject; import com.apih5.framework.entity.BasePojo; public class ZjXmCqjxProjectStaffAssistantDetailed extends BasePojo { private String staffId; private String managerId; private String executiveId; private String workPlan; private String workType; private String workTarget; private String completion; private String delFlag; private Date createTime; private String createUser; private String createUserName; private Date modifyTime; private String modifyUser; private String modifyUserName; private double assessmentScore; private double chargeLeaderScore; private double executiveLeaderScore; private double executiveScore; private String lastScore; public String getLastScore() { return lastScore; } public void setLastScore(String lastScore) { this.lastScore = lastScore; } public double getAssessmentScore() { return assessmentScore; } public void setAssessmentScore(double assessmentScore) { this.assessmentScore = assessmentScore; } public double getChargeLeaderScore() { return chargeLeaderScore; } public void setChargeLeaderScore(double chargeLeaderScore) { this.chargeLeaderScore = chargeLeaderScore; } public double getExecutiveLeaderScore() { return executiveLeaderScore; } public void setExecutiveLeaderScore(double executiveLeaderScore) { this.executiveLeaderScore = executiveLeaderScore; } public double getExecutiveScore() { return executiveScore; } public void setExecutiveScore(double executiveScore) { this.executiveScore = executiveScore; } public String getStaffId() { return staffId == null ? "" : staffId.trim(); } public void setStaffId(String staffId) { this.staffId = staffId == null ? null : staffId.trim(); } public String getManagerId() { return managerId == null ? "" : managerId.trim(); } public void setManagerId(String managerId) { this.managerId = managerId == null ? null : managerId.trim(); } public String getExecutiveId() { return executiveId == null ? "" : executiveId.trim(); } public void setExecutiveId(String executiveId) { this.executiveId = executiveId == null ? null : executiveId.trim(); } public String getWorkPlan() { return workPlan == null ? "" : workPlan.trim(); } public void setWorkPlan(String workPlan) { this.workPlan = workPlan == null ? null : workPlan.trim(); } public String getWorkType() { return workType == null ? "" : workType.trim(); } public void setWorkType(String workType) { this.workType = workType == null ? null : workType.trim(); } public String getWorkTarget() { return workTarget == null ? "" : workTarget.trim(); } public void setWorkTarget(String workTarget) { this.workTarget = workTarget == null ? null : workTarget.trim(); } public String getCompletion() { return completion == null ? "" : completion.trim(); } public void setCompletion(String completion) { this.completion = completion == null ? null : completion.trim(); } public String getDelFlag() { return delFlag == null ? "" : delFlag.trim(); } public void setDelFlag(String delFlag) { this.delFlag = delFlag == null ? null : delFlag.trim(); } public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } public String getCreateUser() { return createUser == null ? "" : createUser.trim(); } public void setCreateUser(String createUser) { this.createUser = createUser == null ? null : createUser.trim(); } public String getCreateUserName() { return createUserName == null ? "" : createUserName.trim(); } public void setCreateUserName(String createUserName) { this.createUserName = createUserName == null ? null : createUserName.trim(); } public Date getModifyTime() { return modifyTime; } public void setModifyTime(Date modifyTime) { this.modifyTime = modifyTime; } public String getModifyUser() { return modifyUser == null ? "" : modifyUser.trim(); } public void setModifyUser(String modifyUser) { this.modifyUser = modifyUser == null ? null : modifyUser.trim(); } public String getModifyUserName() { return modifyUserName == null ? "" : modifyUserName.trim(); } public void setModifyUserName(String modifyUserName) { this.modifyUserName = modifyUserName == null ? null : modifyUserName.trim(); } }
[ "2267843676@qq.com" ]
2267843676@qq.com
cec8cfc576cc637e378ad31f1bcbab75064d2b90
8048dc07dbbe351a8624eb8870958e20b24d9141
/spring-restdocs-restassured/src/main/java/org/springframework/restdocs/restassured3/RestAssuredResponseConverter.java
8308ba907bae516c55abedd1661f30e668908acb
[ "Apache-2.0" ]
permissive
hubelias/spring-restdocs
b985749a18ecfddc7788645e69de5ce3a30da39a
080156432142bae24861c19b0805bb36dd7642c9
refs/heads/master
2022-02-21T06:09:14.119190
2019-08-13T09:16:53
2019-08-13T09:16:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,821
java
/* * Copyright 2014-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.restdocs.restassured3; import io.restassured.http.Header; import io.restassured.response.Response; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.restdocs.operation.OperationResponse; import org.springframework.restdocs.operation.OperationResponseFactory; import org.springframework.restdocs.operation.ResponseConverter; /** * A converter for creating an {@link OperationResponse} from a REST Assured * {@link Response}. * * @author Andy Wilkinson */ class RestAssuredResponseConverter implements ResponseConverter<Response> { @Override public OperationResponse convert(Response response) { return new OperationResponseFactory().create( HttpStatus.valueOf(response.getStatusCode()), extractHeaders(response), extractContent(response)); } private HttpHeaders extractHeaders(Response response) { HttpHeaders httpHeaders = new HttpHeaders(); for (Header header : response.getHeaders()) { httpHeaders.add(header.getName(), header.getValue()); } return httpHeaders; } private byte[] extractContent(Response response) { return response.getBody().asByteArray(); } }
[ "awilkinson@pivotal.io" ]
awilkinson@pivotal.io
34faf386fbb4b3053b15fec9b7390004c4682afb
bc9fc5001b06317472df5fa465dc8469862acd77
/backend/src/test/java/am/ik/ldap/LdapSimpleUiApplicationTests.java
8958600e5b09641a1f671a55ef70e48fdae9b2c1
[ "Apache-2.0" ]
permissive
making/ldap-simple-ui
4f0d0de6f350912022cff80a3ab0f0dfde977076
957c57d5b7d36534d3af04726b07b0cf254accb1
refs/heads/master
2021-07-26T12:35:59.738011
2020-05-09T05:29:40
2020-05-09T05:29:40
165,528,508
6
0
null
null
null
null
UTF-8
Java
false
false
343
java
package am.ik.ldap; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class LdapSimpleUiApplicationTests { @Test public void contextLoads() { } }
[ "tmaki@pivotal.io" ]
tmaki@pivotal.io
adfdb9c9aaa5b2413df141099e0b786c2299d2cc
b39927cc44925204f0e13091cab82d0a6e971e2c
/src/lesson2/chat_app/chat-librarry/src/chat/common/Common.java
cdd00ec46e15fd678a7f507fff923fd1c93ee77f
[]
no_license
lazarevspb/Java3
a19ee3e75b93f0a839039f795886a53dc426f038
4ae5a88ed9e524d7b99168a6984322dd7242912a
refs/heads/master
2023-03-29T11:17:14.009746
2021-03-27T05:58:54
2021-03-27T05:58:54
297,764,839
0
0
null
2021-03-27T06:01:27
2020-09-22T20:30:21
Java
UTF-8
Java
false
false
2,421
java
package chat.common; public class Common { /* /auth_request±login±password // Запрос авторизации /auth_accept±nickname // подтверждение авторизации /auth_error // ошибка авторизации /broadcast±msg // бродкаст сообщение /msg_format_error±msg // ошибка сообщения * */ public static final String DELIMITER = "±"; public static final String AUTH_REQUEST = "/auth_request"; public static final String AUTH_ACCEPT = "/auth_accept"; public static final String AUTH_DENIED = "/auth_denied"; public static final String MSG_FORMAT_ERROR = "/msg_format_error"; // если мы вдруг не поняли, что за сообщение и не смогли разобрать public static final String TYPE_BROADCAST = "/bcast"; // то есть сообщение, которое будет посылаться всем public static final String USER_LIST = "/user_list"; public static final String CHANGE_LOGIN = "/cng_lgn"; public static final String TYPE_BCAST_CLIENT = "/client_msg"; public static final String TYPE_CLIENT_PRIVATE = "/private"; public static String getAuthRequest(String login, String password) { return AUTH_REQUEST + DELIMITER + login + DELIMITER + password; } public static String getAuthAccept(String nickname) { return AUTH_ACCEPT + DELIMITER + nickname; } public static String getAuthDenied() { return AUTH_DENIED; } public static String getMsgFormatError(String message) { return MSG_FORMAT_ERROR + DELIMITER + message; } public static String getTypeBroadcast(String src, String message) { return TYPE_BROADCAST + DELIMITER + System.currentTimeMillis() + DELIMITER + src + DELIMITER + message; } public static String getUserList(String users) { return USER_LIST + DELIMITER + users; } public static String getTypeBcastClient(String msg) { return TYPE_BCAST_CLIENT + DELIMITER + msg; } public static String getTypeClientPrivate(String sender, String recipient, String msg) { return TYPE_CLIENT_PRIVATE + DELIMITER + sender + DELIMITER + recipient + DELIMITER + msg; } }
[ "v.lazarev.spb@gmail.com" ]
v.lazarev.spb@gmail.com
4a27cebeef8649a05ef3a8cde532816cee1f6ab5
e82c1473b49df5114f0332c14781d677f88f363f
/MED-CLOUD/med-service/src/main/java/nta/med/service/ihis/handler/xrts/XRT0101U00GrdMcodeHandler.java
b9e4cb94b02aa7bc8cf28af386a99b5a2afefba1
[]
no_license
zhiji6/mih
fa1d2279388976c901dc90762bc0b5c30a2325fc
2714d15853162a492db7ea8b953d5b863c3a8000
refs/heads/master
2023-08-16T18:35:19.836018
2017-12-28T09:33:19
2017-12-28T09:33:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,331
java
package nta.med.service.ihis.handler.xrts; import java.util.List; import javax.annotation.Resource; import nta.med.data.dao.medi.xrt.Xrt0101Repository; import nta.med.data.model.ihis.xrts.XRT0101U00GrdMcodeInfo; import nta.med.core.infrastructure.socket.handler.ScreenHandler; import nta.med.service.ihis.proto.XrtsModelProto; import nta.med.service.ihis.proto.XrtsServiceProto; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; import org.vertx.java.core.Vertx; @Service @Scope("prototype") public class XRT0101U00GrdMcodeHandler extends ScreenHandler<XrtsServiceProto.XRT0101U00GrdMcodeRequest, XrtsServiceProto.XRT0101U00GrdMcodeResponse> { private static final Log LOGGER = LogFactory.getLog(XRT0101U00GrdMcodeHandler.class); @Resource private Xrt0101Repository xrt0101Repositoty; @Override @Transactional(readOnly = true) public XrtsServiceProto.XRT0101U00GrdMcodeResponse handle(Vertx vertx, String clientId, String sessionId, long contextId, XrtsServiceProto.XRT0101U00GrdMcodeRequest request) throws Exception { XrtsServiceProto.XRT0101U00GrdMcodeResponse.Builder response = XrtsServiceProto.XRT0101U00GrdMcodeResponse.newBuilder(); //list GrdM Code List<XRT0101U00GrdMcodeInfo> listGrdMCode = xrt0101Repositoty.getXRT0101U00GrdMCodeListItemInfo(getHospitalCode(vertx, sessionId), request.getCodeType(), getLanguage(vertx, sessionId)); if (!CollectionUtils.isEmpty(listGrdMCode)) { for (XRT0101U00GrdMcodeInfo item : listGrdMCode) { XrtsModelProto.XRT0101U00GrdMcodeInfo.Builder info = XrtsModelProto.XRT0101U00GrdMcodeInfo.newBuilder(); if (!StringUtils.isEmpty(item.getCodeType())) { info.setCodeType(item.getCodeType()); } if (!StringUtils.isEmpty(item.getCodeTypeName())) { info.setCodeTypeName(item.getCodeTypeName()); } response.addMcodeItem(info); } } return response.build(); } }
[ "duc_nt@nittsusystem-vn.com" ]
duc_nt@nittsusystem-vn.com
1afd5b4276e752562459b862b64bd545d572d4f0
67204b235db0a42b45a21cee78c8cb6118201837
/src/com/fengling/cms/entity/assist/base/BaseCmsScoreItem.java
93f43ed5e0d4d86da22cbe65204671042a369165
[]
no_license
nextflower/fengling
ed5d6f636587c2cd427fb10b12f29a807c7f7f7f
11b6536f6d3c1faf3e8e6629e8cef7f90cb6c7c2
refs/heads/master
2021-01-25T05:35:44.356765
2015-05-05T15:00:41
2015-05-05T15:00:41
33,312,953
0
0
null
null
null
null
UTF-8
Java
false
false
4,901
java
package com.fengling.cms.entity.assist.base; import java.io.Serializable; /** * This is an object that contains data related to the jc_score_item table. * Do not modify this class because it will be overwritten if the configuration file * related to this class is modified. * * @hibernate.class * table="jc_score_item" */ public abstract class BaseCmsScoreItem implements Serializable { public static String REF = "CmsScoreItem"; public static String PROP_NAME = "name"; public static String PROP_ID = "id"; public static String PROP_SCORE = "score"; public static String PROP_GROUP = "group"; public static String PROP_IMAGE_PATH = "imagePath"; public static String PROP_PRIORITY = "priority"; // constructors public BaseCmsScoreItem () { initialize(); } /** * Constructor for primary key */ public BaseCmsScoreItem (java.lang.Integer id) { this.setId(id); initialize(); } /** * Constructor for required fields */ public BaseCmsScoreItem ( java.lang.Integer id, com.fengling.cms.entity.assist.CmsScoreGroup group, java.lang.String name, java.lang.Integer score, java.lang.Integer priority) { this.setId(id); this.setGroup(group); this.setName(name); this.setScore(score); this.setPriority(priority); initialize(); } protected void initialize () {} private int hashCode = Integer.MIN_VALUE; // primary key private java.lang.Integer id; // fields private java.lang.String name; private java.lang.Integer score; private java.lang.String imagePath; private java.lang.Integer priority; // many to one private com.fengling.cms.entity.assist.CmsScoreGroup group; // collections private java.util.Set<com.fengling.cms.entity.assist.CmsScoreRecord> records; /** * Return the unique identifier of this class * @hibernate.id * generator-class="sequence" * column="score_item_id" */ public java.lang.Integer getId () { return id; } /** * Set the unique identifier of this class * @param id the new ID */ public void setId (java.lang.Integer id) { this.id = id; this.hashCode = Integer.MIN_VALUE; } /** * Return the value associated with the column: name */ public java.lang.String getName () { return name; } /** * Set the value related to the column: name * @param name the name value */ public void setName (java.lang.String name) { this.name = name; } /** * Return the value associated with the column: score */ public java.lang.Integer getScore () { return score; } /** * Set the value related to the column: score * @param score the score value */ public void setScore (java.lang.Integer score) { this.score = score; } /** * Return the value associated with the column: image_path */ public java.lang.String getImagePath () { return imagePath; } /** * Set the value related to the column: image_path * @param imagePath the image_path value */ public void setImagePath (java.lang.String imagePath) { this.imagePath = imagePath; } /** * Return the value associated with the column: priority */ public java.lang.Integer getPriority () { return priority; } /** * Set the value related to the column: priority * @param priority the priority value */ public void setPriority (java.lang.Integer priority) { this.priority = priority; } /** * Return the value associated with the column: score_group_id */ public com.fengling.cms.entity.assist.CmsScoreGroup getGroup () { return group; } /** * Set the value related to the column: score_group_id * @param group the score_group_id value */ public void setGroup (com.fengling.cms.entity.assist.CmsScoreGroup group) { this.group = group; } /** * Return the value associated with the column: records */ public java.util.Set<com.fengling.cms.entity.assist.CmsScoreRecord> getRecords () { return records; } /** * Set the value related to the column: records * @param records the records value */ public void setRecords (java.util.Set<com.fengling.cms.entity.assist.CmsScoreRecord> records) { this.records = records; } public boolean equals (Object obj) { if (null == obj) return false; if (!(obj instanceof com.fengling.cms.entity.assist.CmsScoreItem)) return false; else { com.fengling.cms.entity.assist.CmsScoreItem cmsScoreItem = (com.fengling.cms.entity.assist.CmsScoreItem) obj; if (null == this.getId() || null == cmsScoreItem.getId()) return false; else return (this.getId().equals(cmsScoreItem.getId())); } } public int hashCode () { if (Integer.MIN_VALUE == this.hashCode) { if (null == this.getId()) return super.hashCode(); else { String hashStr = this.getClass().getName() + ":" + this.getId().hashCode(); this.hashCode = hashStr.hashCode(); } } return this.hashCode; } public String toString () { return super.toString(); } }
[ "dv3333@163.com" ]
dv3333@163.com
41f3ed22511903ad8a5262f7beead42ad3b4ddec
68a8a36b9dfb928a9c1e36c48b89e6b47a8a8a9c
/BuilderDesignPattern-Solution/src/com/jit/test/IndianCitizen.java
f4674863deaa0c2c8f3734fbeec5ff89401d3f8e
[]
no_license
jitendrakr93/DesignPattern
02086b06aead5b9d47ceae2e4a14de3bd8b280db
9c20555b31f6361454294558438fa629e71f0e86
refs/heads/master
2023-07-03T03:15:43.489774
2021-08-03T17:41:03
2021-08-03T17:41:03
369,131,309
0
0
null
null
null
null
UTF-8
Java
false
false
250
java
package com.jit.test; import com.jit.factory.HouseFactory; import com.jit.product.House; public class IndianCitizen { public static void main(String[] args) { House house = HouseFactory.getInstance("concrete"); System.out.println(house); } }
[ "jk93.161@gmail.com" ]
jk93.161@gmail.com
d180a2442c7d2cb86a0d6ce579675dafd09391c5
b39d7e1122ebe92759e86421bbcd0ad009eed1db
/sources/com/android/ims/internal/uce/presence/PresCmdId.java
bce6b8d71344b4d463dc01c3ab88ab0d335686ab
[]
no_license
AndSource/miuiframework
ac7185dedbabd5f619a4f8fc39bfe634d101dcef
cd456214274c046663aefce4d282bea0151f1f89
refs/heads/master
2022-03-31T11:09:50.399520
2020-01-02T09:49:07
2020-01-02T09:49:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,740
java
package com.android.ims.internal.uce.presence; import android.annotation.UnsupportedAppUsage; import android.os.Parcel; import android.os.Parcelable; import android.os.Parcelable.Creator; public class PresCmdId implements Parcelable { public static final Creator<PresCmdId> CREATOR = new Creator<PresCmdId>() { public PresCmdId createFromParcel(Parcel source) { return new PresCmdId(source, null); } public PresCmdId[] newArray(int size) { return new PresCmdId[size]; } }; public static final int UCE_PRES_CMD_GETCONTACTCAP = 2; public static final int UCE_PRES_CMD_GETCONTACTLISTCAP = 3; public static final int UCE_PRES_CMD_GET_VERSION = 0; public static final int UCE_PRES_CMD_PUBLISHMYCAP = 1; public static final int UCE_PRES_CMD_REENABLE_SERVICE = 5; public static final int UCE_PRES_CMD_SETNEWFEATURETAG = 4; public static final int UCE_PRES_CMD_UNKNOWN = 6; private int mCmdId; /* synthetic */ PresCmdId(Parcel x0, AnonymousClass1 x1) { this(x0); } public int getCmdId() { return this.mCmdId; } @UnsupportedAppUsage public void setCmdId(int nCmdId) { this.mCmdId = nCmdId; } @UnsupportedAppUsage public PresCmdId() { this.mCmdId = 6; } public int describeContents() { return 0; } public void writeToParcel(Parcel dest, int flags) { dest.writeInt(this.mCmdId); } private PresCmdId(Parcel source) { this.mCmdId = 6; readFromParcel(source); } public void readFromParcel(Parcel source) { this.mCmdId = source.readInt(); } }
[ "shivatejapeddi@gmail.com" ]
shivatejapeddi@gmail.com
0ba6cc0135f76d4310fefe1ed0bbd12d4963f10d
e6fff39054fc394395d38c5bcd4c3275b3bbdef5
/VisionPlusX/src/com/sv/visionplus/transaction/invoice/NumberListDAO.java
30d1eea48d336c3cc9416c8e493651e1b5ce2408
[]
no_license
supervisiontec/Specs-Shop---Vision-Plus
0ea7111046d49b9631a9e574137822f429e95de4
5a76f10dba14d0befeb6a06f67c6a984b552684a
refs/heads/master
2023-03-06T09:40:48.508328
2021-02-17T19:50:54
2021-02-17T19:50:54
107,935,028
0
0
null
null
null
null
UTF-8
Java
false
false
1,970
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 com.sv.visionplus.transaction.invoice; import com.sv.visionplus.transaction.invoice.model.MNumberList; import com.sv.visionplus.util.database.DatabaseUtil; import com.sv.visionplus.util.database.QueryUtil; import java.sql.Connection; import java.sql.SQLException; import java.util.logging.Level; import java.util.logging.Logger; /** * * @author Supervision */ public class NumberListDAO { private static NumberListDAO INSTANCE; private final QueryUtil<MNumberList> Query; private Connection connection; public static NumberListDAO getInstance() { if (INSTANCE == null) { INSTANCE = new NumberListDAO(); } return INSTANCE; } public NumberListDAO() { Query = QueryUtil.getInstance(MNumberList.class); try { connection = DatabaseUtil.getInstance().openConnection(); } catch (SQLException ex) { Logger.getLogger(NumberListDAO.class.getName()).log(Level.SEVERE, null, ex); } } public MNumberList searchLastNumber(Integer itemId) { MNumberList lastNo = new MNumberList(); try { lastNo = (MNumberList) Query.executeUniqueSelect(connection, "index_no=?", new Object[]{itemId}); } catch (SQLException ex) { Logger.getLogger(ItemDAO.class.getName()).log(Level.SEVERE, null, ex); } return lastNo; } public int saveNewNumber(Connection connection, MNumberList numberList) { int indexNo = 0; try { indexNo = Query.executeUpdate(connection, numberList, "index_no=?",numberList.getIndexNo() ); } catch (SQLException ex) { Logger.getLogger(InvoiceDAO.class.getName()).log(Level.SEVERE, null, ex); } return indexNo; } }
[ "chamara.kaza@gmail.com" ]
chamara.kaza@gmail.com
8fb356fd6844b053158397dae231fbef90c4441e
82bda3ed7dfe2ca722e90680fd396935c2b7a49d
/app-meipai/src/main/java/e/d/a/r/h/d.java
2f354bcc0bad4e7e1b0b4c681f3f32aed6fad436
[]
no_license
cvdnn/PanoramaApp
86f8cf36d285af08ba15fb32348423af7f0b7465
dd6bbe0987a46f0b4cfb90697b38f37f5ad47cfc
refs/heads/master
2023-03-03T11:15:40.350476
2021-01-29T09:14:06
2021-01-29T09:14:06
332,968,433
1
1
null
null
null
null
UTF-8
Java
false
false
356
java
package e.d.a.r.h; import android.graphics.drawable.Drawable; import android.widget.ImageView; /* compiled from: DrawableImageViewTarget */ public class d extends e<Drawable> { public d(ImageView imageView) { super(imageView); } public void a(Object obj) { ((ImageView) this.f7887a).setImageDrawable((Drawable) obj); } }
[ "cvvdnn@gmail.com" ]
cvvdnn@gmail.com
79f3b3a890259f1667c671be69284b7be1254de8
327d0b0500612617f3d832a3b90d7afff4684fbe
/java/org/apache/tomcat/websocket/pojo/PojoMessageHandlerWholeBase.java
4fdb87c480ff58c2e8303cac75c0a116fb045156
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference", "bzip2-1.0.6", "Zlib", "CPL-1.0", "LZMA-exception", "LicenseRef-scancode-public-domain", "EPL-2.0", "CDDL-1.0" ]
permissive
cklein05/tomcat
8216e939aa06e1afe7db3f62796cb5c68930c079
fd0775cbd47793b98e5479b3e319fa86b4105a30
refs/heads/main
2023-03-09T22:43:39.626635
2022-02-08T14:27:00
2022-02-08T14:27:00
240,064,845
0
1
Apache-2.0
2022-01-11T08:25:20
2020-02-12T16:50:48
Java
UTF-8
Java
false
false
4,661
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.tomcat.websocket.pojo; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; import javax.naming.NamingException; import jakarta.websocket.DecodeException; import jakarta.websocket.Decoder; import jakarta.websocket.MessageHandler; import jakarta.websocket.Session; import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; import org.apache.tomcat.InstanceManager; import org.apache.tomcat.util.res.StringManager; import org.apache.tomcat.websocket.WsSession; /** * Common implementation code for the POJO whole message handlers. All the real * work is done in this class and in the superclass. * * @param <T> The type of message to handle */ public abstract class PojoMessageHandlerWholeBase<T> extends PojoMessageHandlerBase<T> implements MessageHandler.Whole<T> { private final Log log = LogFactory.getLog(PojoMessageHandlerWholeBase.class); // must not be static private static final StringManager sm = StringManager.getManager(PojoMessageHandlerWholeBase.class); protected final List<Decoder> decoders = new ArrayList<>(); public PojoMessageHandlerWholeBase(Object pojo, Method method, Session session, Object[] params, int indexPayload, boolean convert, int indexSession, long maxMessageSize) { super(pojo, method, session, params, indexPayload, convert, indexSession, maxMessageSize); } protected Decoder createDecoderInstance(Class<? extends Decoder> clazz) throws ReflectiveOperationException, NamingException { InstanceManager instanceManager = ((WsSession) session).getInstanceManager(); if (instanceManager == null) { return clazz.getConstructor().newInstance(); } else { return (Decoder) instanceManager.newInstance(clazz); } } @Override public final void onMessage(T message) { if (params.length == 1 && params[0] instanceof DecodeException) { ((WsSession) session).getLocal().onError(session, (DecodeException) params[0]); return; } // Can this message be decoded? Object payload; try { payload = decode(message); } catch (DecodeException de) { ((WsSession) session).getLocal().onError(session, de); return; } if (payload == null) { // Not decoded. Convert if required. if (convert) { payload = convert(message); } else { payload = message; } } Object[] parameters = params.clone(); if (indexSession != -1) { parameters[indexSession] = session; } parameters[indexPayload] = payload; Object result = null; try { result = method.invoke(pojo, parameters); } catch (IllegalAccessException | InvocationTargetException e) { handlePojoMethodException(e); } processResult(result); } protected void onClose() { InstanceManager instanceManager = ((WsSession) session).getInstanceManager(); for (Decoder decoder : decoders) { decoder.destroy(); if (instanceManager != null) { try { instanceManager.destroyInstance(decoder); } catch (IllegalAccessException | InvocationTargetException e) { log.warn(sm.getString("pojoMessageHandlerWholeBase.decodeDestoryFailed", decoder.getClass()), e); } } } } protected Object convert(T message) { return message; } protected abstract Object decode(T message) throws DecodeException; }
[ "markt@apache.org" ]
markt@apache.org
0c28ff181e585649c4a1c5f01cc5db5b6e5cbd56
9d2df3745581dbc828ff4475a547fcdcc15c0b6b
/src/test/java/com/fasterxml/jackson/failing/JsonPointerOOME736Test.java
8710f0755ce7077b646c55b1628e8eaa042520a5
[ "Apache-2.0" ]
permissive
jhaber/jackson-core
7b76907b009ec2b61090c9e761f809ffee7b8e91
cd12b954a629ec6b9b24aa048044d31c58ab896b
refs/heads/master
2022-02-01T08:17:39.541124
2022-01-17T02:27:15
2022-01-17T02:27:15
451,667,409
0
0
Apache-2.0
2022-01-24T23:23:36
2022-01-24T23:23:35
null
UTF-8
Java
false
false
1,098
java
package com.fasterxml.jackson.failing; import com.fasterxml.jackson.core.*; import com.fasterxml.jackson.core.exc.StreamReadException; public class JsonPointerOOME736Test extends BaseTest { // such as https://github.com/nst/JSONTestSuite/blob/master/test_parsing/n_structure_100000_opening_arrays.json public void testDeepJsonPointer() throws Exception { int MAX_DEPTH = 100000; String INPUT = new String(new char[MAX_DEPTH]).replace("\0", "["); JsonParser parser = createParser(MODE_READER, INPUT); try { while (true) { parser.nextToken(); } } catch (StreamReadException e) { verifyException(e, "Unexpected end"); TokenStreamContext parsingContext = parser.streamReadContext(); JsonPointer jsonPointer = parsingContext.pathAsPointer(); // OOME String pointer = jsonPointer.toString(); String expected = new String(new char[MAX_DEPTH - 1]).replace("\0", "/0"); assertEquals(expected, pointer); } parser.close(); } }
[ "tatu.saloranta@iki.fi" ]
tatu.saloranta@iki.fi
57b1cb416840fbb6b85cb592cea8ed8586c90c55
a46f309d68a9e2d9026ca90357f1c947cbf043ff
/java_02_ex/src/day17_ex/Dice.java
6110b5c8c4c125cd56d039fc851356501a21c974
[]
no_license
aaaaaandohee/bit_java
e84322927340f48647f372b17616a0ac62b86717
9a2a85f071890ec14cf7766656dabc850ea29fe1
refs/heads/master
2022-01-20T16:30:55.622591
2019-08-27T05:10:14
2019-08-27T05:10:14
201,861,788
0
0
null
null
null
null
UTF-8
Java
false
false
218
java
package day17_ex; public class Dice { int size; Dice(int size){ this.size = size; } int play(){ int number = (int)(Math.random() * size) + 1; return number; } }
[ "user@DESKTOP-V882PTR" ]
user@DESKTOP-V882PTR
b46dabae200548eb97631095c0ff3db95c91298f
13cbb329807224bd736ff0ac38fd731eb6739389
/sun/net/httpserver/StreamClosedException.java
1b8e4cca5168821e0bd2347748adbd37e67ad545
[]
no_license
ZhipingLi/rt-source
5e2537ed5f25d9ba9a0f8009ff8eeca33930564c
1a70a036a07b2c6b8a2aac6f71964192c89aae3c
refs/heads/master
2023-07-14T15:00:33.100256
2021-09-01T04:49:04
2021-09-01T04:49:04
401,933,858
0
0
null
null
null
null
UTF-8
Java
false
false
373
java
package sun.net.httpserver; import java.io.IOException; class StreamClosedException extends IOException { private static final long serialVersionUID = -4485921499356327937L; } /* Location: D:\software\jd-gui\jd-gui-windows-1.6.3\rt.jar!\sun\net\httpserver\StreamClosedException.class * Java compiler version: 8 (52.0) * JD-Core Version: 1.0.7 */
[ "michael__lee@yeah.net" ]
michael__lee@yeah.net
8f1b54014cfe125855675ae6c5d6c20bf11ac4d0
57e57f2634944d0595258a14af5e20b6df59185d
/bitcamp-java-basic/src/main/java/ch26/h/Test02.java
aa8c7aa6471fb042220eda7cdf445f3fa69057a2
[]
no_license
Soo77/bitcamp-java-20190527
f169431aafde5bf97c69484694560af14c246b97
655fc4fb5aedcac805da715def70bab1ed616d96
refs/heads/master
2020-06-13T20:16:02.844148
2019-10-02T11:29:06
2019-10-02T11:29:06
194,775,332
1
0
null
2020-04-30T11:49:50
2019-07-02T02:41:01
Java
UTF-8
Java
false
false
2,235
java
// 조인 데이터 다루기 - join 사용 후 package ch26.h; import java.io.InputStream; import java.util.Scanner; import org.apache.ibatis.io.Resources; import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSessionFactory; import org.apache.ibatis.session.SqlSessionFactoryBuilder; public class Test02 { public static void main(String[] args) throws Exception { InputStream inputStream = Resources.getResourceAsStream( "ch26/h/mybatis-config.xml"); SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream); SqlSession sqlSession = sqlSessionFactory.openSession(); Scanner keyboard = new Scanner(System.in); System.out.print("게시물 번호? "); int no = Integer.parseInt(keyboard.nextLine()); keyboard.close(); // 조인을 사용할 경우 부모 객체 안에 자식 테이블의 정보를 받을 수 있다. // 작업: // 1) 부모 테이블의 데이터를 받는 클래스(ex: Board)에 // 자식 테이블의 데이터를 받는 필드(attachFiles)를 선언하라! // 2) SQL 매퍼 파일에서 <resultMap> 태그에 조인 정보를 정의한다. // // => 조인을 이용할 경우 다음과 같이 한 번만 SQL을 실행하면 된다. // mybatis가 SQL 매퍼에 정의된 대로 자식 테이블의 데이터까지 인스턴스로 만들어 리턴해준다. Board board = sqlSession.selectOne("board.selectBoardWithAttachFile", no); System.out.println(board); System.out.println("[첨부파일]"); for (AttachFile f : board.getAttachFiles()) { System.out.println(" => " + f); } System.out.println("-------------------------------"); } } /*select * b.board_id, * b.title, * b.contents, * b.created_date, * b.view_count, * f.board_file_id, * f.file_path, * from x_boad b * inner join x_board_file f on b.board_id=f.board_id */ /* select b.board_id, b.title, b.contents, b.created_date, b.view_count, f.board_file_id, f.file_path from x_board b left outer join x_board_file f on b.board_id=f.board_id */
[ "shimsh3@naver.com" ]
shimsh3@naver.com
05b92af39cae139735f92a63da336022380596c3
412bebe4fba0256c34490f62c5bd75ad804081ba
/presto-main/src/main/java/com/facebook/presto/sql/planner/iterative/rule/TransformExistsApplyToScalarApply.java
0849ecff7e11acb922c4bc37052da72ebed8154d
[ "Apache-2.0" ]
permissive
aschepis/presto
a43fc45eb3b3e8bd27ee4e289db380f53125e2df
8767759448075d9caf5b504ce0f1d2e854c59576
refs/heads/master
2021-01-09T05:36:09.267150
2017-01-25T23:31:57
2017-02-02T19:38:55
80,766,985
0
0
null
2017-02-02T20:44:14
2017-02-02T20:44:14
null
UTF-8
Java
false
false
4,975
java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.facebook.presto.sql.planner.iterative.rule; import com.facebook.presto.metadata.FunctionRegistry; import com.facebook.presto.metadata.Signature; import com.facebook.presto.sql.planner.PlanNodeIdAllocator; import com.facebook.presto.sql.planner.Symbol; import com.facebook.presto.sql.planner.SymbolAllocator; import com.facebook.presto.sql.planner.iterative.Lookup; import com.facebook.presto.sql.planner.iterative.Rule; import com.facebook.presto.sql.planner.plan.AggregationNode; import com.facebook.presto.sql.planner.plan.ApplyNode; import com.facebook.presto.sql.planner.plan.Assignments; import com.facebook.presto.sql.planner.plan.LimitNode; import com.facebook.presto.sql.planner.plan.PlanNode; import com.facebook.presto.sql.planner.plan.ProjectNode; import com.facebook.presto.sql.tree.Cast; import com.facebook.presto.sql.tree.ComparisonExpression; import com.facebook.presto.sql.tree.ExistsPredicate; import com.facebook.presto.sql.tree.Expression; import com.facebook.presto.sql.tree.FunctionCall; import com.facebook.presto.sql.tree.LongLiteral; import com.facebook.presto.sql.tree.QualifiedName; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import java.util.Optional; import static com.facebook.presto.spi.type.BigintType.BIGINT; import static com.facebook.presto.sql.tree.ComparisonExpressionType.GREATER_THAN; import static com.google.common.collect.Iterables.getOnlyElement; import static java.util.Objects.requireNonNull; /** * Exists is modeled as: * <pre> * - Project($0 > 0) * - Aggregation(COUNT(*)) * - Limit(1) * -- subquery * </pre> */ public class TransformExistsApplyToScalarApply implements Rule { private static final QualifiedName COUNT = QualifiedName.of("count");; private static final FunctionCall COUNT_CALL = new FunctionCall(COUNT, ImmutableList.of()); private final Signature countSignature; public TransformExistsApplyToScalarApply(FunctionRegistry functionRegistry) { requireNonNull(functionRegistry, "functionRegistry is null"); countSignature = functionRegistry.resolveFunction(COUNT, ImmutableList.of()); } @Override public Optional<PlanNode> apply(PlanNode node, Lookup lookup, PlanNodeIdAllocator idAllocator, SymbolAllocator symbolAllocator) { if (!(node instanceof ApplyNode)) { return Optional.empty(); } ApplyNode parent = (ApplyNode) node; if (parent.getSubqueryAssignments().size() != 1) { return Optional.empty(); } Expression expression = getOnlyElement(parent.getSubqueryAssignments().getExpressions()); if (!(expression instanceof ExistsPredicate)) { return Optional.empty(); } Symbol count = symbolAllocator.newSymbol(COUNT.toString(), BIGINT); Symbol exists = getOnlyElement(parent.getSubqueryAssignments().getSymbols()); return Optional.of( new ApplyNode( node.getId(), parent.getInput(), new ProjectNode( idAllocator.getNextId(), new AggregationNode( idAllocator.getNextId(), new LimitNode( idAllocator.getNextId(), parent.getSubquery(), 1, false), ImmutableMap.of(count, COUNT_CALL), ImmutableMap.of(count, countSignature), ImmutableMap.of(), ImmutableList.of(ImmutableList.of()), AggregationNode.Step.SINGLE, Optional.empty(), Optional.empty()), Assignments.of(exists, new ComparisonExpression(GREATER_THAN, count.toSymbolReference(), new Cast(new LongLiteral("0"), BIGINT.toString())))), Assignments.of(exists, exists.toSymbolReference()), parent.getCorrelation())); } }
[ "mtraverso@gmail.com" ]
mtraverso@gmail.com
d74060d8b2b47d47691b645afe9a1eb999a2e4ca
20eb62855cb3962c2d36fda4377dfd47d82eb777
/IntroClassJava/dataset/median/0cea42f9680f35f5a84c724c396d4d588b65c303453f9585562f2e2af8db74f5096a83a70b17c5126538222b111a0795a34e9fb6db95d62d771d01592abe3ff6/003/mutations/2/median_0cea42f9_003.java
92c60c8b4583697a1fae14beb05bea4da29bcc92
[]
no_license
ozzydong/CapGen
356746618848065cce4e253e5d3c381baa85044a
0ba0321b6b1191443276021f1997833342f02515
refs/heads/master
2023-03-18T20:12:02.923428
2020-08-21T03:08:28
2020-08-21T03:08:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,167
java
package introclassJava; class IntObj { public int value; public IntObj () { } public IntObj (int i) { value = i; } } class FloatObj { public float value; public FloatObj () { } public FloatObj (float i) { value = i; } } class LongObj { public long value; public LongObj () { } public LongObj (long i) { value = i; } } class DoubleObj { public double value; public DoubleObj () { } public DoubleObj (double i) { value = i; } } class CharObj { public char value; public CharObj () { } public CharObj (char i) { value = i; } } public class median_0cea42f9_003 { public java.util.Scanner scanner; public String output = ""; public static void main (String[]args) throws Exception { median_0cea42f9_003 mainClass = new median_0cea42f9_003 (); String output; if (args.length > 0) { mainClass.scanner = new java.util.Scanner (args[0]); } else { mainClass.scanner = new java.util.Scanner (System.in); } mainClass.exec (); System.out.println (mainClass.output); } public void exec () throws Exception { IntObj a = new IntObj (), b = new IntObj (), c = new IntObj (); output += (String.format ("Please enter 3 numbers separated by spaces > ")); a.value = scanner.nextInt (); b.value = scanner.nextInt (); c.value = scanner.nextInt (); if (((a.value > b.value) && (a.value < c.value)) || ((a.value < b.value) && (a.value > c.value))) { output += (String.format ("%d is the median\n", a.value)); } else if (((b.value > a.value) && (b.value < c.value)) || ((b.value < a.value) && (b.value > c.value))) { output += (String.format ("%d is the median\n", b.value)); } else if (((c.value > a.value) && (c.value < c.value)) || ((c.value < a.value) && (c.value > b.value))) { output += (String.format ("%d is the median\n", c.value)); } if (true) return;; } }
[ "justinwm@163.com" ]
justinwm@163.com
27c27c36d5018300f5d95da6e483bded53e0d17c
a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb
/datatrust-20220801/src/main/java/com/aliyun/datatrust20220801/models/GetModelingResponse.java
4049185f6e9561181153823f5c5618ee1c537def
[ "Apache-2.0" ]
permissive
aliyun/alibabacloud-java-sdk
83a6036a33c7278bca6f1bafccb0180940d58b0b
008923f156adf2e4f4785a0419f60640273854ec
refs/heads/master
2023-09-01T04:10:33.640756
2023-09-01T02:40:45
2023-09-01T02:40:45
288,968,318
40
45
null
2023-06-13T02:47:13
2020-08-20T09:51:08
Java
UTF-8
Java
false
false
1,333
java
// This file is auto-generated, don't edit it. Thanks. package com.aliyun.datatrust20220801.models; import com.aliyun.tea.*; public class GetModelingResponse extends TeaModel { @NameInMap("headers") @Validation(required = true) public java.util.Map<String, String> headers; @NameInMap("statusCode") @Validation(required = true) public Integer statusCode; @NameInMap("body") @Validation(required = true) public GetModelingResponseBody body; public static GetModelingResponse build(java.util.Map<String, ?> map) throws Exception { GetModelingResponse self = new GetModelingResponse(); return TeaModel.build(map, self); } public GetModelingResponse setHeaders(java.util.Map<String, String> headers) { this.headers = headers; return this; } public java.util.Map<String, String> getHeaders() { return this.headers; } public GetModelingResponse setStatusCode(Integer statusCode) { this.statusCode = statusCode; return this; } public Integer getStatusCode() { return this.statusCode; } public GetModelingResponse setBody(GetModelingResponseBody body) { this.body = body; return this; } public GetModelingResponseBody getBody() { return this.body; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
b692a2bcd2cc37994e9459ab624f890dba34dbe1
0d3ff17c75d95e4353fb18999d5444fee09bb616
/ThreadDemo/src/main/java/com/river/thread/condition/ConditionDemo.java
8217ae6b5561a6ecb91e3bd16d3bbc02e238d016
[]
no_license
luchangjiang/RiverDemo
c6c85ec765794392ff77ed1548996dd0cb8d4287
4b43ebcac1f767729af58fe2038ad1a8b6fc314b
refs/heads/master
2022-12-26T20:09:06.079715
2021-02-16T02:28:28
2021-02-16T02:28:28
177,542,057
0
0
null
2019-11-14T13:31:14
2019-03-25T08:09:40
Java
UTF-8
Java
false
false
3,690
java
package com.river.thread.condition; import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; public class ConditionDemo { public static void main(String[] args) { final BoundedBuffer boundedBuffer = new BoundedBuffer(); Thread t0 = new Thread(new Runnable() { @Override public void run() { System.out.println("t0 run"); for (int i=0;i<20;i++) { try { System.out.println("putting.."); boundedBuffer.put(Integer.valueOf(i)); } catch (InterruptedException e) { e.printStackTrace(); } } } }) ; Thread t1 = new Thread(new Runnable() { @Override public void run() { System.out.println("t1 run"); for (int i=0;i<20;i++) { try { System.out.println("putting.."); boundedBuffer.put(Integer.valueOf(i)); } catch (InterruptedException e) { e.printStackTrace(); } } } }) ; Thread t2 = new Thread(new Runnable() { @Override public void run() { for (int i=0;i<20;i++) { try { Object val = boundedBuffer.take(); System.out.println(val); } catch (InterruptedException e) { e.printStackTrace(); } } } }) ; t1.start(); t2.start(); // t0.start(); } /** * BoundedBuffer 是一个定长100的集合,当集合中没有元素时,take方法需要等待,直到有元素时才返回元素 * 当其中的元素数达到最大值时,要等待直到元素被take之后才执行put的操作 * @author yukaizhao * */ static class BoundedBuffer { final Lock lock = new ReentrantLock(); final Condition notFull = lock.newCondition(); final Condition notEmpty = lock.newCondition(); final Object[] items = new Object[100]; int putptr, takeptr, count; public void put(Object x) throws InterruptedException { System .out.println("put wait lock"); lock.lock(); System.out.println("put get lock"); try { while (count == items.length) { System.out.println("buffer full, please wait"); notFull.await(); } items[putptr] = x; if (++putptr == items.length) putptr = 0; ++count; notEmpty.signal(); } finally { lock.unlock(); } } public Object take() throws InterruptedException { System.out.println("take wait lock"); lock.lock(); System.out.println("take get lock"); try { while (count == 0) { System.out.println("no elements, please wait"); notEmpty.await(); } Object x = items[takeptr]; if (++takeptr == items.length) takeptr = 0; --count; notFull.signal(); return x; } finally { lock.unlock(); } } } }
[ "20207075@qq.com" ]
20207075@qq.com
4b12434701e11c996e7404139a685c4da00a2be3
059e3236ed871bae0b4c5a6d0496d58bbe321102
/app/src/main/java/app/manaper/base/constantsutils/Codes.java
443e12ffe9fe9af224d4d6c0bc4450b7d08da36b
[]
no_license
Mostafaelnagar/manaper-Elsudaa
e935cbb116f845e93f12ffc12b95f6ff1b83c1b1
98b067e3a9af9264fad909b97e334bcd0536c4bd
refs/heads/master
2020-07-02T07:50:44.869665
2019-08-09T12:42:57
2019-08-09T12:42:57
201,462,783
1
0
null
null
null
null
UTF-8
Java
false
false
1,750
java
package app.manaper.base.constantsutils; public class Codes { //RequestsCodes public static int FILE_TYPE_IMAGE = 10; public static int FILE_TYPE_VIDEO = 11; public static int FILE_TYPE_PDF = 12; //ACTIONS public static int ADD_FIRST_CITY = 20; public static int ADD_SECOND_CITY = 21; public static int SHOW_MESSAGE = 22; public static int ADD_THIRD_CITY = 23; public static int ADD_Fourth_CITY = 24; public static int REGISTER_SCREEN = 25; public static int FORGOT_PASSWORD_SCREEN = 26; public static int ENTER_CODE_SCREEN = 27; public static int CHANGE_PASSWORD_SCREEN = 28; public static int SEND_CODE_SCREEN = 29; public static int HOME_SCREEN = 30; public static int LOGIN_SCREEN = 31; public static int TRIP_DETAILS = 229; public static int SELECT_PROFILE_IMAGE = 210; public static int SELECT_CITIES = 211; public static int SELECT_TRANSPORT_TYPE = 212; public static int SELECT_TIME_PICKER = 213; public static int SELECT_DATE_PICKER = 214; public static int ADD_NEW_PLACE = 215; public static int PROFILE = 216; //userTypes public static int MANAPER_TRANSPORTATION = 1; public static int OTHER = 0; public static int DOWNLOAD_FILE = 217; public static int BACK = 218; public static int DELEGATE_TRIP_ARRIVAL = 219; public static int DELEGATE_TRIP_SEC = 220; public static int DELEGATE_TRIP_FIR = 221; public static int DELEGATE_TRIP_DEP = 222; public static int GRAND_INFO = 223; public static int PLAYING_VIDEO = 224; public static int FROM_FIRST_TRIP = 225; public static int To_FIRST_TRIP = 226; public static final String DATE_IS_REFUSED = "date_is_refused" ; // }
[ "melnagar271@gmail.com" ]
melnagar271@gmail.com
660eaf0c7839f89fab60de9b0c64c40e32de63d5
c95b26c2f7dd77f5e30e2d1cd1a45bc1d936c615
/azureus-core/src/main/java/org/gudy/azureus2/core3/category/CategoryManagerListener.java
bcb0df7c7e422d1301d657b1fcdc2d722175a3c4
[]
no_license
ostigter/testproject3
b918764f5c7d4c10d3846411bd9270ca5ba2f4f2
2d2336ef19631148c83636c3e373f874b000a2bf
refs/heads/master
2023-07-27T08:35:59.212278
2023-02-22T09:10:45
2023-02-22T09:10:45
41,742,046
2
1
null
2023-07-07T22:07:12
2015-09-01T14:02:08
Java
UTF-8
Java
false
false
1,481
java
/* * File : CategoryManagerListener.java * Created : 08-Feb-2004 * By : TuxPaper * * Azureus - a Java Bittorrent client * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details ( see the LICENSE file ). * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package org.gudy.azureus2.core3.category; /** * A listener informed of changes to Categories */ public interface CategoryManagerListener { /** * A category has been added to the CategoryManager * * @param category * the category that was added */ public void categoryAdded(Category category); /** * A category has been removed from the CategoryManager * * @param category * Category that was removed */ public void categoryRemoved(Category category); public void categoryChanged(Category category); }
[ "oscar.stigter@e0aef87a-ea4e-0410-81cd-4b1fdc67522b" ]
oscar.stigter@e0aef87a-ea4e-0410-81cd-4b1fdc67522b
ef946471bd775ed855cd28e426db220ff9a3c314
139960e2d7d55e71c15e6a63acb6609e142a2ace
/mobile_app1/module208/src/main/java/module208packageJava0/Foo48.java
dd8c0d16b0a01f174abf9cad228ff2eda8c8258f
[ "Apache-2.0" ]
permissive
uber-common/android-build-eval
448bfe141b6911ad8a99268378c75217d431766f
7723bfd0b9b1056892cef1fef02314b435b086f2
refs/heads/master
2023-02-18T22:25:15.121902
2023-02-06T19:35:34
2023-02-06T19:35:34
294,831,672
83
7
Apache-2.0
2021-09-24T08:55:30
2020-09-11T23:27:37
Java
UTF-8
Java
false
false
292
java
package module208packageJava0; import java.lang.Integer; public class Foo48 { Integer int0; public void foo0() { new module208packageJava0.Foo47().foo3(); } public void foo1() { foo0(); } public void foo2() { foo1(); } public void foo3() { foo2(); } }
[ "oliviern@uber.com" ]
oliviern@uber.com
b2e8b5930d4803caa9d98874e8dc171912a00481
c97b08464d899fd3031010513aa8954a734120b9
/Pattern/src/com/yc/facade/Control.java
da6d3377654626706ece2380d09b048e4ecc787d
[]
no_license
YC-YC/Java
70de59084b7d14b7e2902cef22b49262e3a1c6ab
f45e6ab2d14c4ac419c8772bc86ce4720a60104b
refs/heads/master
2021-07-15T07:45:41.628419
2017-10-21T04:06:16
2017-10-21T04:06:16
107,685,511
0
0
null
null
null
null
GB18030
Java
false
false
225
java
package com.yc.facade; /** *@Author Administrator *@Time 2016-4-13 上午12:36:30 */ public class Control { void play(){ System.out.println("播放电影"); } void stop(){ System.out.println("停止电影"); } }
[ "yellowc.yc@aliyun.com" ]
yellowc.yc@aliyun.com
95bdc284e0623b2609a928f907e4072521b7f613
7aeace6f380bf09d8c821b00e4eea397f3ec6523
/gallery-backend/src/main/java/com/marom/gallerybackend/controllers/UserController.java
f9a7dc785b3f0d53a6adc72ea1f4efeadb53f949
[]
no_license
marom/TinkeringSandbox
04d5de0ce8e35df2e1aaa566bef02b67348135bc
e266285dade9c987ace830e53f6f020f4d1cff69
refs/heads/master
2020-05-02T04:44:39.247401
2019-06-09T09:28:31
2019-06-09T09:28:31
177,757,037
0
0
null
null
null
null
UTF-8
Java
false
false
1,831
java
package com.marom.gallerybackend.controllers; import com.marom.gallerybackend.model.User; import com.marom.gallerybackend.services.UserService; import io.jsonwebtoken.Jwts; import io.jsonwebtoken.SignatureAlgorithm; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.servlet.ServletException; import java.util.Date; import java.util.Map; @RestController @RequestMapping("/user") public class UserController { private UserService userService; public UserController(UserService userService) { this.userService = userService; } @PostMapping("/login") public String login(@RequestBody Map<String, String> json) throws ServletException { if (json.get("username") == null || json.get("password") == null) { throw new ServletException("Please fill in username and password"); } String userName = json.get("username"); String password = json.get("password"); User user = userService.findByUserName(userName); if (user == null) { throw new ServletException("User name not found."); } String pwd = user.getPassword(); if (!password.equals(pwd)) { throw new ServletException("Invalid login. Please check your name and password"); } String toReturn = Jwts.builder().setSubject(userName).claim("roles", "user").setIssuedAt(new Date()) .signWith(SignatureAlgorithm.HS256, "secretkey").compact(); return toReturn; } @PostMapping("/register") public User register(@RequestBody User user) { return userService.save(user); } }
[ "maro.muszynski@gmail.com" ]
maro.muszynski@gmail.com
b697c723ed613c6bd5acd36479d2082eba9ad653
96dbc89d82534473c8568fd6af9b4e5f99584f2a
/g2gapp/src/main/java/com/usu/mobileservice/g2gapp/UITools.java
01d42b2acee3a025d481e06599a70e0b23e4c15f
[]
no_license
minhld/MobileServiceMiddleware
63fffb63e4a4ccf5824ff80cb560e01751ea51e7
d18decbbef9aacdb2d2c2812d8d82bd41bda4f02
refs/heads/master
2021-01-23T17:04:00.581429
2018-06-23T05:59:51
2018-06-23T05:59:51
102,755,721
0
0
null
null
null
null
UTF-8
Java
false
false
4,837
java
package com.usu.mobileservice.g2gapp; import android.app.Activity; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.text.SpannableStringBuilder; import android.view.LayoutInflater; import android.view.View; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; /** * Created by minhld on 01/28/2016. */ public class UITools { public static void printLog(Activity c, final TextView log, final String msg) { c.runOnUiThread(new Runnable() { @Override public void run() { log.append(msg + "\r\n"); } }); } public static void printLog(Activity c, final TextView log, final Object msg) { c.runOnUiThread(new Runnable() { @Override public void run() { log.append((SpannableStringBuilder) msg); } }); } public static void printMsg(Context c, String msg) { Toast.makeText(c, msg, Toast.LENGTH_LONG); } /** * open a dialog to prompt text * * @param c * @param listener */ public static void showInputDialog2(Context c, final InputDialogListener listener, String... defs) { // get prompts.xml view LayoutInflater layoutInflater = LayoutInflater.from(c); View promptView = layoutInflater.inflate(R.layout.input_dialog_2, null); AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(c); alertDialogBuilder.setView(promptView); final EditText localBrokerIpText = (EditText) promptView.findViewById(R.id.localBrokerIpText); final EditText remoteBrokerIpText = (EditText) promptView.findViewById(R.id.remoteBrokerIpText); if (defs.length > 0) { localBrokerIpText.setText(defs[0]); remoteBrokerIpText.setText(defs[0]); } final EditText localWorkerPortText = (EditText) promptView.findViewById(R.id.localWorkerPortText); final EditText remoteClientPortText = (EditText) promptView.findViewById(R.id.remoteClientPortText); // setup a dialog window alertDialogBuilder.setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { listener.inputDone(localBrokerIpText.getText().toString(), Integer.parseInt(localWorkerPortText.getText().toString()), remoteBrokerIpText.getText().toString(), Integer.parseInt(remoteClientPortText.getText().toString())); } }) .setNegativeButton("Cancel", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); // create an alert dialog AlertDialog alert = alertDialogBuilder.create(); alert.show(); } /** * open a dialog to prompt text * * @param c * @param listener */ public static void showInputDialog(Context c, final InputDialogListener listener, String... defs) { // get prompts.xml view LayoutInflater layoutInflater = LayoutInflater.from(c); View promptView = layoutInflater.inflate(R.layout.input_dialog, null); AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(c); alertDialogBuilder.setView(promptView); final EditText editText = (EditText) promptView.findViewById(R.id.edittext); if (defs.length > 0) editText.setText(defs[0]); // setup a dialog window alertDialogBuilder.setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { listener.inputDone(editText.getText().toString()); } }) .setNegativeButton("Cancel", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); // create an alert dialog AlertDialog alert = alertDialogBuilder.create(); alert.show(); } public interface InputDialogListener { void inputDone(String resultStr); void inputDone(String localBrokerIpText, int localWorkerPort, String remoteBrokerIp, int remoteClientPort); } }
[ "ledinhminh3883@gmail.com" ]
ledinhminh3883@gmail.com
d8cfa0bb1a2a9f72c29a95f01a4b63a522db5dfe
b4b62c5c77ec817db61820ccc2fee348d1d7acc5
/src/main/java/com/alipay/api/response/AlipayOpenAgentCreateResponse.java
fb14e6a01a3787830da7c26c1487e5ed9e11b8fa
[ "Apache-2.0" ]
permissive
zhangpo/alipay-sdk-java-all
13f79e34d5f030ac2f4367a93e879e0e60f335f7
e69305d18fce0cc01d03ca52389f461527b25865
refs/heads/master
2022-11-04T20:47:21.777559
2020-06-15T08:31:02
2020-06-15T08:31:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,731
java
package com.alipay.api.response; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.AlipayResponse; /** * ALIPAY API: alipay.open.agent.create response. * * @author auto create * @since 1.0, 2019-10-18 16:57:20 */ public class AlipayOpenAgentCreateResponse extends AlipayResponse { private static final long serialVersionUID = 3849795324933517687L; /** * 本次代商户操作的全局唯一事务编号,后续代商户创建小程序、代签约当面付等产品、提交事务等接口都需要传递该batch_no值,且要确认只有 init 状态的batch_no才能发起调用。 */ @ApiField("batch_no") private String batchNo; /** * ISV 代商户操作事务状态,事务状态包括: init=初始状态,本接口alipay.open.agent.create返回 init 状态,只有init状态允许进行各种业务接口调用; submit=提交状态,事务已经到达终态,调用alipay.open.agent.confirm接口可以提交init状态的事务 cancel=取消状态,事务已经到达终态,调用alipay.open.agent.cancel接口可以取消init状态的事务 timeout=超时状态,事务已经到达终态,init状态的事务,在【1个小时】后会自动超时 注意:只有 init 状态才允许进行接口调用,其它状态都是终态,不允许继续进行接口调用。 */ @ApiField("batch_status") private String batchStatus; public void setBatchNo(String batchNo) { this.batchNo = batchNo; } public String getBatchNo( ) { return this.batchNo; } public void setBatchStatus(String batchStatus) { this.batchStatus = batchStatus; } public String getBatchStatus( ) { return this.batchStatus; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
8b6a8374765cb32081684e3746c1cefc901f490d
87b26ef4eae250e00115202f2522b550661cc79f
/bootique-di/src/test/java/io/bootique/di/mock/MockInterface1Provider.java
85bf551018352553c4aee8b1493ddf8759f74365
[ "Apache-2.0" ]
permissive
elena-bondareva/bootique-di
a805de2740d7eeb7c53b3954d63d071bafcd1c09
1c7d6456609ad97570724c6151453afd47d49bf7
refs/heads/master
2020-03-19T11:54:40.619448
2018-06-07T10:44:52
2018-06-07T10:44:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
222
java
package io.bootique.di.mock; import javax.inject.Provider; public class MockInterface1Provider implements Provider<MockInterface1> { public MockInterface1 get() { return new MockImplementation1(); } }
[ "andrus@objectstyle.com" ]
andrus@objectstyle.com
60875409b3c435690d2f2708e1c94cfd51122db3
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.mm/classes.jar/com/tencent/mm/plugin/appbrand/Plugin.java
5ef30f1623dba11e1a20eeb9c617108448149352
[]
no_license
tsuzcx/qq_apk
0d5e792c3c7351ab781957bac465c55c505caf61
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
refs/heads/main
2022-07-02T10:32:11.651957
2022-02-01T12:41:38
2022-02-01T12:41:38
453,860,108
36
9
null
2022-01-31T09:46:26
2022-01-31T02:43:22
Java
UTF-8
Java
false
false
844
java
package com.tencent.mm.plugin.appbrand; import com.tencent.matrix.trace.core.AppMethodBeat; import com.tencent.mm.model.be; import com.tencent.mm.pluginsdk.c.c; import com.tencent.mm.pluginsdk.c.d; @Deprecated public final class Plugin implements d { public final com.tencent.mm.pluginsdk.n createApplication() { return null; } public final be createSubCore() { AppMethodBeat.i(43979); com.tencent.mm.plugin.appbrand.app.n localn = new com.tencent.mm.plugin.appbrand.app.n(); AppMethodBeat.o(43979); return localn; } public final c getContactWidgetFactory() { return null; } } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes.jar * Qualified Name: com.tencent.mm.plugin.appbrand.Plugin * JD-Core Version: 0.7.0.1 */
[ "98632993+tsuzcx@users.noreply.github.com" ]
98632993+tsuzcx@users.noreply.github.com
98ff6390c968db149398b2e9a88e15abadefc83f
f1b39c85dfa176c82a241fb0da39c482ce5e5725
/src/jp/or/med/orca/qkan/affair/qs/qs001/QS001OtherItemListBox.java
445c0109d75b6e6d562b699ecd80665bb62e1a49
[]
no_license
linuxmaniajp/qkan
114bb9665a6b2e6b278d2fd7ed5619d74e5c2337
30c0513399e49828ca951412e21a22a058868729
refs/heads/master
2021-05-23T18:48:48.477599
2018-04-23T04:27:09
2018-04-23T04:27:09
null
0
0
null
null
null
null
SHIFT_JIS
Java
false
false
5,644
java
package jp.or.med.orca.qkan.affair.qs.qs001; import java.awt.Component; import java.util.List; import java.util.Set; import java.util.Vector; import javax.swing.ListModel; import jp.nichicom.ac.component.ACListBox; import jp.nichicom.vr.component.AbstractVRListBox; /** * その他や日常生活上の活動に使用するリストボックスです。 * <p> * Copyright (c) 2005 Nippon Computer Corpration. All Rights Reserved. * </p> * * @author Tozo Tanaka * @version 1.0 2006/03/31 */ public class QS001OtherItemListBox extends ACListBox { /** * Creates an empty (no viewport view) <code>JScrollPane</code> where both * horizontal and vertical scrollbars appear when needed. */ public QS001OtherItemListBox() { super(); } /** * Creates a <code>JScrollPane</code> that displays the contents of the * specified component, where both horizontal and vertical scrollbars appear * whenever the component's contents are larger than the view. * * @see #setViewportView * @param view the component to display in the scrollpane's viewport */ public QS001OtherItemListBox(Component view) { super(view); } /** * Creates a <code>JScrollPane</code> that displays the view component in * a viewport whose view position can be controlled with a pair of * scrollbars. The scrollbar policies specify when the scrollbars are * displayed, For example, if <code>vsbPolicy</code> is * <code>VERTICAL_SCROLLBAR_AS_NEEDED</code> then the vertical scrollbar * only appears if the view doesn't fit vertically. The available policy * settings are listed at {@link #setVerticalScrollBarPolicy} and * {@link #setHorizontalScrollBarPolicy}. * * @see #setViewportView * @param view the component to display in the scrollpanes viewport * @param vsbPolicy an integer that specifies the vertical scrollbar policy * @param hsbPolicy an integer that specifies the horizontal scrollbar * policy */ public QS001OtherItemListBox(Component view, int vsbPolicy, int hsbPolicy) { super(view, vsbPolicy, hsbPolicy); } /** * Constructs a <code>JList</code> that displays the elements in the * specified, non-<code>null</code> model. All <code>JList</code> * constructors delegate to this one. * * @param dataModel the data model for this list * @exception IllegalArgumentException if <code>dataModel</code> is * <code>null</code> */ public QS001OtherItemListBox(ListModel dataModel) { super(dataModel); } /** * Constructs a <code>JList</code> that displays the elements in the * specified array. This constructor just delegates to the * <code>ListModel</code> constructor. * * @param listData the array of Objects to be loaded into the data model */ public QS001OtherItemListBox(Object[] listData) { super(listData); } /** * Constructs a <code>JList</code> that displays the elements in the * specified <code>Vector</code>. This constructor just delegates to the * <code>ListModel</code> constructor. * * @param listData the <code>Vector</code> to be loaded into the data * model */ public QS001OtherItemListBox(Vector listData) { super(listData); } /** * バインド対象のキー集合を返します。 * * @return バインド対象のキー集合 */ public String[] getBindPathes() { if (getMainContent() instanceof QS001BindModelValueListBox) { return ((QS001BindModelValueListBox) getMainContent()) .getBindPathes(); } return null; } /** * バインド対象のキー集合を設定します。 * * @param bindPathes バインド対象のキー集合 */ public void setBindPathes(List bindPathes) { if (getMainContent() instanceof QS001BindModelValueListBox) { ((QS001BindModelValueListBox) getMainContent()) .setBindPathes(bindPathes); } } /** * バインド対象のキー集合を設定します。 * * @param bindPathes バインド対象のキー集合 */ public void setBindPathes(Object[] bindPathes) { if (getMainContent() instanceof QS001BindModelValueListBox) { ((QS001BindModelValueListBox) getMainContent()) .setBindPathes(bindPathes); } } /** * バインド対象のキー集合を設定します。 * * @param bindPathes バインド対象のキー集合 */ public void setBindPathes(Set bindPathes) { if (getMainContent() instanceof QS001BindModelValueListBox) { ((QS001BindModelValueListBox) getMainContent()) .setBindPathes(bindPathes); } } /** * バインド対象のキー集合を設定します。 * * @param bindPathes バインド対象のキー集合 */ public void setBindPathes(String[] bindPathes) { if (getMainContent() instanceof QS001BindModelValueListBox) { ((QS001BindModelValueListBox) getMainContent()) .setBindPathes(bindPathes); } } protected AbstractVRListBox createMainContent() { return new QS001BindModelValueListBox(); } }
[ "yoshida@cvs.orca.med.or.jp" ]
yoshida@cvs.orca.med.or.jp
c00e6cafd64751359e048accb0944c7698614969
9623f83defac3911b4780bc408634c078da73387
/powercraft_15/src/minecraft/net/minecraft/world/gen/structure/ComponentNetherBridgeEnd.java
eb87904d0c50336ac729a24cb5834fbc4fb1b95b
[]
no_license
BlearStudio/powercraft-legacy
42b839393223494748e8b5d05acdaf59f18bd6c6
014e9d4d71bd99823cf63d4fbdb65c1b83fde1f8
refs/heads/master
2021-01-21T21:18:55.774908
2015-04-06T20:45:25
2015-04-06T20:45:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,782
java
package net.minecraft.world.gen.structure; import java.util.List; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.world.World; public class ComponentNetherBridgeEnd extends ComponentNetherBridgePiece { private int fillSeed; public ComponentNetherBridgeEnd(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { super(par1); this.coordBaseMode = par4; this.boundingBox = par3StructureBoundingBox; this.fillSeed = par2Random.nextInt(); } public static ComponentNetherBridgeEnd func_74971_a(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, -3, 0, 5, 10, 8, par5); return isAboveGround(structureboundingbox) && StructureComponent.findIntersecting(par0List, structureboundingbox) == null ? new ComponentNetherBridgeEnd(par6, par1Random, structureboundingbox, par5) : null; } /** * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at * the end, it adds Fences... */ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { Random random1 = new Random((long)this.fillSeed); int i; int j; int k; for (i = 0; i <= 4; ++i) { for (j = 3; j <= 4; ++j) { k = random1.nextInt(8); this.fillWithBlocks(par1World, par3StructureBoundingBox, i, j, 0, i, j, k, Block.netherBrick.blockID, Block.netherBrick.blockID, false); } } i = random1.nextInt(8); this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 0, 0, 5, i, Block.netherBrick.blockID, Block.netherBrick.blockID, false); i = random1.nextInt(8); this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 5, 0, 4, 5, i, Block.netherBrick.blockID, Block.netherBrick.blockID, false); for (i = 0; i <= 4; ++i) { j = random1.nextInt(5); this.fillWithBlocks(par1World, par3StructureBoundingBox, i, 2, 0, i, 2, j, Block.netherBrick.blockID, Block.netherBrick.blockID, false); } for (i = 0; i <= 4; ++i) { for (j = 0; j <= 1; ++j) { k = random1.nextInt(3); this.fillWithBlocks(par1World, par3StructureBoundingBox, i, j, 0, i, j, k, Block.netherBrick.blockID, Block.netherBrick.blockID, false); } } return true; } }
[ "nils.h.emmerich@googlemail.com@ed9f5d1b-00bb-0f29-faab-e8ebad1a710c" ]
nils.h.emmerich@googlemail.com@ed9f5d1b-00bb-0f29-faab-e8ebad1a710c
bf2951d6462fbec98da4de5fa53c831c16cd9179
f3aec68bc48dc52e76f276fd3b47c3260c01b2a4
/core/referencebook/src/main/java/ru/korus/tmis/pix/AdministrativeContactRoleType.java
d073b7a5cef61596cbb882256298dd6e420afd03
[]
no_license
MarsStirner/core
c9a383799a92e485e2395d81a0bc95d51ada5fa5
6fbf37af989aa48fabb9c4c2566195aafd2b16ab
refs/heads/master
2020-12-03T00:39:51.407573
2016-04-29T12:28:32
2016-04-29T12:28:32
96,041,573
0
1
null
null
null
null
UTF-8
Java
false
false
864
java
package ru.korus.tmis.pix; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for AdministrativeContactRoleType. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * &lt;simpleType name="AdministrativeContactRoleType"> * &lt;restriction base="{urn:hl7-org:v3}cs"> * &lt;enumeration value="BILL"/> * &lt;enumeration value="PAYOR"/> * &lt;enumeration value="ORG"/> * &lt;/restriction> * &lt;/simpleType> * </pre> * */ @XmlType(name = "AdministrativeContactRoleType") @XmlEnum public enum AdministrativeContactRoleType { BILL, PAYOR, ORG; public String value() { return name(); } public static AdministrativeContactRoleType fromValue(String v) { return valueOf(v); } }
[ "szgrebelny@korusconsulting.ru" ]
szgrebelny@korusconsulting.ru
b7f5534bc41d3ba37294a07aa4d762f1a1488b92
16b5d51ab0409cbb5a1da9eacb9948a54acd6258
/app/build/generated/source/apt/debug/com/study/sangerzhong/studyapp/MyEventBusIndex.java
4dafe97d96bd37069d11d89550eae6131fc415b8
[]
no_license
liyq1406/haochebang
c3405a537d4f695ca51cb26d7889e952c6965eea
12727fcca80c85aa9586bd58fe9b16c98fa1bf5b
refs/heads/master
2021-01-17T21:20:31.261785
2017-02-28T04:52:06
2017-02-28T04:52:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,980
java
package com.study.sangerzhong.studyapp; import org.greenrobot.eventbus.meta.SimpleSubscriberInfo; import org.greenrobot.eventbus.meta.SubscriberMethodInfo; import org.greenrobot.eventbus.meta.SubscriberInfo; import org.greenrobot.eventbus.meta.SubscriberInfoIndex; import org.greenrobot.eventbus.ThreadMode; import java.util.HashMap; import java.util.Map; /** This class is generated by EventBus, do not edit. */ public class MyEventBusIndex implements SubscriberInfoIndex { private static final Map<Class<?>, SubscriberInfo> SUBSCRIBER_INDEX; static { SUBSCRIBER_INDEX = new HashMap<Class<?>, SubscriberInfo>(); putIndex(new SimpleSubscriberInfo(com.haoche51.checker.fragment.channel.FindCarFragment.class, true, new SubscriberMethodInfo[] { new SubscriberMethodInfo("onMainEventBus", com.haoche51.checker.entity.FindCarEntity.class, ThreadMode.MAIN), })); putIndex(new SimpleSubscriberInfo(com.haoche51.checker.activity.DownloadDialogActivity.class, true, new SubscriberMethodInfo[] { new SubscriberMethodInfo("onMainEventBus", com.haoche51.checker.entity.UpdateVersionEntity.class, ThreadMode.MAIN), })); putIndex(new SimpleSubscriberInfo(com.haoche51.checker.service.AutoUpdateVersionService.class, true, new SubscriberMethodInfo[] { new SubscriberMethodInfo("onEventMainThread", com.haoche51.checker.entity.UpdateServiceEntity.class, ThreadMode.MAIN), })); } private static void putIndex(SubscriberInfo info) { SUBSCRIBER_INDEX.put(info.getSubscriberClass(), info); } @Override public SubscriberInfo getSubscriberInfo(Class<?> subscriberClass) { SubscriberInfo info = SUBSCRIBER_INDEX.get(subscriberClass); if (info != null) { return info; } else { return null; } } }
[ "pengxianglin@haoche51.com" ]
pengxianglin@haoche51.com
28450586acc72827b0af93c8b49008969f4cbe2c
fb9ee00025b9e4b19bd7c9d009094d088f481125
/stfxss_high_school_life_programming_practice/SCHOOL/ICS4U1/crazyObject/Book.java
8dd3b2324f27bf117e4a662003aa048a11b78d73
[]
no_license
wonjohnchoi/competitions
e382e3e544915b57e48bbb826120ef40b99b9843
4ba5be75a5b36b56de68d4a4ab8912d89eb73a0e
refs/heads/master
2021-01-16T00:28:33.446271
2015-09-12T16:53:25
2015-09-12T16:53:25
2,786,296
1
1
null
null
null
null
UTF-8
Java
false
false
388
java
package crazyObject; /** * The "Book" class. */ public class Book { String title; String course; public Book() { } public void setTitle(String thisTitle) { title=thisTitle; } public void setCourse(String thisCourse) { course=thisCourse; } public String toString() { return null; } } // Book class
[ "wonjohn.choi@gmail.com" ]
wonjohn.choi@gmail.com
e3117a5c6035edba4afb101405a633da3a4dce3d
32b72e1dc8b6ee1be2e80bb70a03a021c83db550
/ast_results/Sensirion_SmartGadget-Android/app/src/main/java/com/sensirion/smartgadget/view/history/graph/value_formatter/DaysElapsedTimeFormat.java
aba23633dc9a9b19ea8dd8ffa6c72b6d789f5f25
[]
no_license
cmFodWx5YWRhdjEyMTA5/smell-and-machine-learning
d90c41a17e88fcd99d543124eeb6e93f9133cb4a
0564143d92f8024ff5fa6b659c2baebf827582b1
refs/heads/master
2020-07-13T13:53:40.297493
2019-01-11T11:51:18
2019-01-11T11:51:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,668
java
// isComment package com.sensirion.smartgadget.view.history.graph.value_formatter; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import java.text.FieldPosition; import java.text.Format; import java.text.ParsePosition; import java.util.Date; /** * isComment */ public class isClassOrIsInterface extends Format { @NonNull @Override public StringBuffer isMethod(@NonNull final Object isParameter, @NonNull final StringBuffer isParameter, @Nullable final FieldPosition isParameter) { final Long isVariable = ((Number) isNameExpr).isMethod(); final int isVariable = (new Date(isNameExpr)).isMethod(); isNameExpr.isMethod(isMethod(isNameExpr)); return isNameExpr; } @Nullable @Override public Object isMethod(final String isParameter, @Nullable final ParsePosition isParameter) { return null; } private String isMethod(final int isParameter) { switch(isNameExpr) { case isIntegerConstant: return "isStringConstant"; case isIntegerConstant: return "isStringConstant"; case isIntegerConstant: return "isStringConstant"; case isIntegerConstant: return "isStringConstant"; case isIntegerConstant: return "isStringConstant"; case isIntegerConstant: return "isStringConstant"; case isIntegerConstant: return "isStringConstant"; default: throw new IllegalArgumentException("isStringConstant" + isNameExpr); } } }
[ "matheus@melsolucoes.net" ]
matheus@melsolucoes.net
dd2af3ea4fa600db2c5f2c8ddbd36e96a4e1686b
bcf6c76bf3cdf5a644c0f8220d2cf583cc16da08
/enterprise/payara.common/src/org/netbeans/modules/payara/spi/ExecSupport.java
70766da5643b3d4d27cea88bf33e99608958c072
[ "Apache-2.0" ]
permissive
aljohn368/first
d2d47aa0c9d15576e9c394c2bbc7a41a905939ff
7f9bd8dbe05de61c90526b32551550ab15342977
refs/heads/master
2020-12-07T21:38:45.632077
2020-01-09T09:43:47
2020-01-09T09:43:47
232,807,057
2
0
Apache-2.0
2020-01-09T17:16:26
2020-01-09T12:45:17
null
UTF-8
Java
false
false
4,604
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.netbeans.modules.payara.spi; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.Reader; import java.io.Writer; import org.openide.ErrorManager; import org.openide.windows.InputOutput; import org.openide.windows.OutputWriter; public class ExecSupport { /** Creates a new instance of ExecSupport */ public ExecSupport() { } /** * Redirect the standard output and error streams of the child * process to an output window. */ public void displayProcessOutputs(final Process child, String displayName, String initialMessage) throws IOException, InterruptedException { // Get a tab on the output window. If this client has been // executed before, the same tab will be returned. InputOutput io = org.openide.windows.IOProvider.getDefault().getIO(displayName, false); OutputWriter ow = io.getOut(); try { io.getOut().reset(); } catch (IOException e) { // not a critical error, continue ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e); } // io.select(); ow.println(initialMessage); final Thread[] copyMakers = new Thread[3]; (copyMakers[0] = new OutputCopier(new InputStreamReader(child.getInputStream()), ow, true)).start(); (copyMakers[1] = new OutputCopier(new InputStreamReader(child.getErrorStream()), io.getErr(), true)).start(); (copyMakers[2] = new OutputCopier(io.getIn(), new OutputStreamWriter(child.getOutputStream()), true)).start(); new Thread() { @Override public void run() { try { child.waitFor(); Thread.sleep(2000); // time for copymakers } catch (InterruptedException e) { } finally { try { copyMakers[0].interrupt(); copyMakers[1].interrupt(); copyMakers[2].interrupt(); } catch (Exception e) { ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e); } } } }.start(); } /** This thread simply reads from given Reader and writes read chars to given Writer. */ static public class OutputCopier extends Thread { final Writer os; final Reader is; /** while set to false at streams that writes to the OutputWindow it must be * true for a stream that reads from the window. */ final boolean autoflush; private boolean done = false; public OutputCopier(Reader is, Writer os, boolean b) { this.os = os; this.is = is; autoflush = b; } /* Makes copy. */ @Override public void run() { int read; char[] buff = new char[256]; try { while ((read = read(is, buff, 0, 256)) > 0x0) { if (os != null) { os.write(buff, 0, read); if (autoflush) { os.flush(); } } } } catch (IOException | InterruptedException ex) { } } @Override public void interrupt() { super.interrupt(); done = true; } private int read(Reader is, char[] buff, int start, int count) throws InterruptedException, IOException { while (!is.ready() && !done) { sleep(100); } return is.read(buff, start, count); } } }
[ "neilcsmith.net@googlemail.com" ]
neilcsmith.net@googlemail.com
ec2178fd32db75735f41b132e73890af1909a4e5
9ab5247515ee18cca2153b53a659cd16093938ea
/ec-traffic-persist/src/main/java/com/ecarinfo/traffic/dao/ProvinceInfoDao.java
cc1bb84b30e8c6fe0257bd99f705a3ccde6f8ac9
[]
no_license
xiaobbbbbbb/ec-traffic
58bc804ad131bf80ab54f0092b7de99785a6449c
0a7bb578cc84f44dc61a4688e1e8ea2998c3d1d9
refs/heads/master
2020-04-28T07:51:14.244055
2014-04-24T01:56:01
2014-04-24T01:56:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
196
java
package com.ecarinfo.traffic.dao; import com.ecarinfo.persist.exdao.ECDao; import com.ecarinfo.traffic.po.ProvinceInfo; public interface ProvinceInfoDao extends ECDao<ProvinceInfo> { }
[ "6454166@qq.com" ]
6454166@qq.com
0ecc22459407d36a79df530eb8f713cc260ebc53
be2a68ba7c779301817f86c83694ca7fe8e46bce
/miaosha-2version/miaosha-service/src/main/java/com/geekq/miaosha/rabbitmq/MQReceiver.java
8c7fbc7b90ee9cb95d677ed858540e73d6e4c556
[]
no_license
inkzuji/miaosha
550e2f8ca1eca1c68059616aeb05862ff6b38461
72841606f954f9a7a2aa642e7303ca48f0a92363
refs/heads/master
2020-05-16T04:58:53.387316
2019-10-10T03:45:43
2019-10-10T03:45:43
182,797,650
1
0
null
2019-10-10T03:45:44
2019-04-22T13:51:47
Java
UTF-8
Java
false
false
2,756
java
package com.geekq.miaosha.rabbitmq; import com.geekq.api.entity.GoodsVoOrder; import com.geekq.api.utils.AbstractResultOrder; import com.geekq.api.utils.ResultGeekQOrder; import com.geekq.miaosha.redis.RedisService; import com.geekq.miaosha.service.GoodsService; import com.geekq.miaosha.service.MiaoshaService; import com.geekq.miaosha.service.OrderService; import com.geekq.miasha.entity.MiaoshaOrder; import com.geekq.miasha.entity.MiaoshaUser; import com.geekq.miasha.enums.enums.ResultStatus; import com.geekq.miasha.exception.GlobleException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.amqp.rabbit.annotation.RabbitListener; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service public class MQReceiver { private static Logger log = LoggerFactory.getLogger(MQReceiver.class); @Autowired RedisService redisService; @Autowired GoodsService goodsService; @Autowired OrderService orderService; @Autowired MiaoshaService miaoshaService; @Autowired private com.geekq.api.service.GoodsService goodsServiceRpc; // @Autowired // MiaoShaMessageService messageService ; @RabbitListener(queues=MQConfig.MIAOSHA_QUEUE) public void receive(String message) { log.info("receive message:"+message); MiaoshaMessage mm = RedisService.stringToBean(message, MiaoshaMessage.class); MiaoshaUser user = mm.getUser(); long goodsId = mm.getGoodsId(); // GoodsVo goods = goodsService.getGoodsVoByGoodsId(goodsId); ResultGeekQOrder<GoodsVoOrder> goodsVoOrderResultGeekQOrder = goodsServiceRpc.getGoodsVoByGoodsId(goodsId); if(!AbstractResultOrder.isSuccess(goodsVoOrderResultGeekQOrder)){ throw new GlobleException(ResultStatus.SESSION_ERROR); } GoodsVoOrder goods= goodsVoOrderResultGeekQOrder.getData(); int stock = goods.getStockCount(); if(stock <= 0) { return; } //判断是否已经秒杀到了 MiaoshaOrder order = orderService.getMiaoshaOrderByUserIdGoodsId(Long.valueOf(user.getNickname()), goodsId); if(order != null) { return; } //减库存 下订单 写入秒杀订单 miaoshaService.miaosha(user, goods); } // @RabbitListener(queues=MQConfig.MIAOSHATEST) // public void receiveMiaoShaMessage(Message message, Channel channel) throws IOException { // log.info("接受到的消息为:{}",message); // String messRegister = new String(message.getBody(), "UTF-8"); // channel.basicAck(message.getMessageProperties().getDeliveryTag(), true); // MiaoShaMessageVo msm = RedisService.stringToBean(messRegister, MiaoShaMessageVo.class); // messageService.insertMs(msm); // } }
[ "qiurunze@youxin.com" ]
qiurunze@youxin.com
1b18d0b5ce352d529d162881c8065a74e8daddc9
2cd5d009ab64b875aba660c939f05532ea8a4e78
/src/com/commonsware/cwac/prefs/SQLCipherStrategy.java
7a89f506abbeea676aff69f079371dc2d7a0b9e8
[ "Apache-2.0" ]
permissive
mimoccc/cwac-prefs
015c8fa1d9555cb8029ab451830e47274673e93a
f41b7d18f0f81c9cde9cd5a401f5b70fbe48eb58
refs/heads/master
2020-12-01T01:14:30.922000
2012-12-12T15:23:47
2012-12-12T15:23:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,789
java
/*** Copyright (c) 2012 CommonsWare, LLC 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.commonsware.cwac.prefs; import android.content.Context; import java.io.File; import java.util.Collection; import java.util.Map; import com.commonsware.cwac.prefs.CWSharedPreferences.LoadPolicy; import net.sqlcipher.database.SQLiteDatabase; import net.sqlcipher.database.SQLiteOpenHelper; public class SQLCipherStrategy extends AbstractSQLStrategy implements CWSharedPreferences.StorageStrategy { private SQLiteDatabase db=null; public static boolean exists(Context ctxt, String key) { File path=ctxt.getDatabasePath(key); return(path.exists()); } public SQLCipherStrategy(Context ctxt, String key, String password, LoadPolicy loadPolicy) { super(loadPolicy); SQLiteDatabase.loadLibs(ctxt); db=new Helper(ctxt, key).getWritableDatabase(password); } public void close() { db.close(); db=null; } public void persist(Map<String, Object> cache, Collection<String> changedKeys) { db.beginTransaction(); try { for (String key : changedKeys) { String args[]=buildPersistArgs(cache, key); if (args != null) { db.execSQL("INSERT OR REPLACE INTO prefs (key, value, type) VALUES (?, ?, ?)", args); } else { String[] deleteArgs= { key }; db.delete("prefs", "key=?", deleteArgs); } } db.setTransactionSuccessful(); } finally { db.endTransaction(); } } public void load(Map<String, Object> cache) { load(db.rawQuery("SELECT key, value, type FROM prefs", null), cache); } private static class Helper extends SQLiteOpenHelper { private static final int SCHEMA_VERSION=1; public Helper(Context ctxt, String name) { super(ctxt, name, null, SCHEMA_VERSION); } @Override public void onCreate(SQLiteDatabase db) { db.execSQL("CREATE TABLE prefs (key TEXT NOT NULL PRIMARY KEY, value TEXT, type INTEGER NOT NULL)"); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { throw new RuntimeException("You cannot be serious!"); } } }
[ "mmurphy@commonsware.com" ]
mmurphy@commonsware.com
a4cd07e5afd6e1eb27df9a39e683c9028aedf9ad
bf4122f5ae3a9f9b9c2cc94ef87cdb9dcadc9dc9
/Transfer/TYSS_PROJECTS/retailermaintenencesystem/src/main/java/com/tyss/retailermaintenencesystem/service/ProductServiceImpl.java
78dbfc3303c95c5b2a742c56a8421a4ce93b2183
[]
no_license
haren7474/TY_ELF_JFS_HarendraKumar
7ef8b9a0bb6d6bdddb94b88ab2db4e0aef0fbc1d
f99ef30b40d0877167c8159e8b7f322af7cc87b9
refs/heads/master
2023-01-11T01:01:10.458037
2020-01-23T18:20:20
2020-01-23T18:20:20
225,845,989
0
0
null
2023-01-07T22:01:21
2019-12-04T11:00:37
HTML
UTF-8
Java
false
false
1,119
java
package com.tyss.retailermaintenencesystem.service; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.tyss.retailermaintenencesystem.dto.ProductBean; import com.tyss.retailermaintenencesystem.dto.UserBean; import com.tyss.retailermaintenencesystem.exception.UserException; import com.tyss.retailermaintenencesystem.repository.ProductRepository; @Service public class ProductServiceImpl implements ProductService { @Autowired private ProductRepository repository; @Override public ProductBean searchProduct(int id) { ProductBean bean = repository.findByproductId(id); if (bean != null) { return bean; } else { throw new UserException("Id does not exist"); } } @Override public boolean addProduct(ProductBean bean) { ProductBean productBean = null; try { productBean = repository.save(bean); } catch (Exception e) { System.out.println(e.getMessage()); return false; } return true; } @Override public List<ProductBean> getAllProducts() { return repository.findAll(); } }
[ "harendra10104698@gmail.com" ]
harendra10104698@gmail.com
f1b0cb00271bec3262f8647d01ccaca7f6b93f90
e75cf3fc4e6569583270ac0f3626453c464fe020
/Android/第三方完整APP源码/TPshop-master/soubaoShopMobile/src/main/java/com/soubao/tpshop/view/SPClearEditText.java
3fd3522c26bce89c6166ae2a91f6a6d4da8df392
[]
no_license
hailongfeng/zhishiku
c87742e8819c1a234f68f3be48108b244e8a265f
b62bb845a88248855d118bc571634cc94f34efcb
refs/heads/master
2022-12-26T00:00:48.455098
2020-02-26T09:22:05
2020-02-26T09:22:05
133,133,919
1
9
null
2022-12-16T00:35:57
2018-05-12T09:56:41
Java
UTF-8
Java
false
false
4,642
java
package com.soubao.tpshop.view; import android.content.Context; import android.graphics.drawable.Drawable; import android.text.Editable; import android.text.TextWatcher; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import android.view.View.OnFocusChangeListener; import android.view.animation.Animation; import android.view.animation.CycleInterpolator; import android.view.animation.TranslateAnimation; import android.widget.EditText; public class SPClearEditText extends EditText implements OnFocusChangeListener, TextWatcher { /** * 删除按钮的引用 */ private Drawable mClearDrawable; /** * 控件是否有焦点 */ private boolean hasFoucs; public SPClearEditText(Context context) { this(context, null); } public SPClearEditText(Context context, AttributeSet attrs) { //这里构造方法也很重要,不加这个很多属性不能再XML里面定义 this(context, attrs, android.R.attr.editTextStyle); } public SPClearEditText(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); init(); } private void init() { //获取EditText的DrawableRight,假如没有设置我们就使用默认的图片 mClearDrawable = getCompoundDrawables()[2]; if (mClearDrawable == null) { // throw new NullPointerException("You can add drawableRight attribute in XML"); // mClearDrawable = getResources().getDrawable(R.drawable.delete_selector); } else{ mClearDrawable.setBounds(0, 0, mClearDrawable.getIntrinsicWidth(), mClearDrawable.getIntrinsicHeight()); } //默认设置隐藏图标 //setClearIconVisible(false); //设置焦点改变的监听 setOnFocusChangeListener(this); //设置输入框里面内容发生改变的监听 //addTextChangedListener(this); } /** * 因为我们不能直接给EditText设置点击事件,所以我们用记住我们按下的位置来模拟点击事件 * 当我们按下的位置 在 EditText的宽度 - 图标到控件右边的间距 - 图标的宽度 和 * EditText的宽度 - 图标到控件右边的间距之间我们就算点击了图标,竖直方向就没有考虑 */ @Override public boolean onTouchEvent(MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_UP) { if (getCompoundDrawables()[2] != null) { boolean touchable = event.getX() > (getWidth() - getTotalPaddingRight()) && (event.getX() < ((getWidth() - getPaddingRight()))); if (touchable) { this.setText(""); } } } return super.onTouchEvent(event); } /** * 当ClearEditText焦点发生变化的时候,判断里面字符串长度设置清除图标的显示与隐藏 */ @Override public void onFocusChange(View v, boolean hasFocus) { // this.hasFoucs = hasFocus; // if (hasFocus) { // setClearIconVisible(getText().length() > 0); // } else { // setClearIconVisible(false); // } } /** * 设置清除图标的显示与隐藏,调用setCompoundDrawables为EditText绘制上去 * @param visible */ protected void setClearIconVisible(boolean visible) { Drawable right = visible ? mClearDrawable : null; setCompoundDrawables(getCompoundDrawables()[0], getCompoundDrawables()[1], right, getCompoundDrawables()[3]); } /** * 当输入框里面内容发生变化的时候回调的方法 */ @Override public void onTextChanged(CharSequence s, int start, int count, int after) { if(hasFoucs){ setClearIconVisible(s.length() > 0); } } @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void afterTextChanged(Editable s) { } /** * 设置晃动动画 */ public void setShakeAnimation(){ this.setAnimation(shakeAnimation(5)); } /** * 晃动动画 * @param counts 1秒钟晃动多少下 * @return */ public static Animation shakeAnimation(int counts){ Animation translateAnimation = new TranslateAnimation(0, 10, 0, 0); translateAnimation.setInterpolator(new CycleInterpolator(counts)); translateAnimation.setDuration(1000); return translateAnimation; } }
[ "no_1hailong@yeah.net" ]
no_1hailong@yeah.net
62874741aa5c6fb7cbd69c16a403b5394a76238f
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
/benchmark/training/org/apache/hadoop/hdfs/TestLargeBlock.java
3b9a631a64b55b190ddd82cf902c4f96c3b974f1
[]
no_license
STAMP-project/dspot-experiments
f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5
121487e65cdce6988081b67f21bbc6731354a47f
refs/heads/master
2023-02-07T14:40:12.919811
2019-11-06T07:17:09
2019-11-06T07:17:09
75,710,758
14
19
null
2023-01-26T23:57:41
2016-12-06T08:27:42
null
UTF-8
Java
false
false
2,201
java
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.hadoop.hdfs; import java.io.IOException; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * This class tests that blocks can be larger than 2GB */ public class TestLargeBlock { /** * { * GenericTestUtils.setLogLevel(DataNode.LOG, Level.ALL); * GenericTestUtils.setLogLevel(LeaseManager.LOG, Level.ALL); * GenericTestUtils.setLogLevel(FSNamesystem.LOG, Level.ALL); * GenericTestUtils.setLogLevel(DFSClient.LOG, Level.ALL); * GenericTestUtils.setLogLevel(TestLargeBlock.LOG, Level.ALL); * } */ private static final Logger LOG = LoggerFactory.getLogger(TestLargeBlock.class); // should we verify the data read back from the file? (slow) static final boolean verifyData = true; static final byte[] pattern = new byte[]{ 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; static final int numDatanodes = 3; /** * Test for block size of 2GB + 512B. This test can take a rather long time to * complete on Windows (reading the file back can be slow) so we use a larger * timeout here. * * @throws IOException * in case of errors */ @Test(timeout = 1800000) public void testLargeBlockSize() throws IOException { final long blockSize = (((2L * 1024L) * 1024L) * 1024L) + 512L;// 2GB + 512B runTest(blockSize); } }
[ "benjamin.danglot@inria.fr" ]
benjamin.danglot@inria.fr
64829a2625fc65536fc87306c384cb18875c6cc4
c81dd37adb032fb057d194b5383af7aa99f79c6a
/java/com/facebook/ads/redexgen/X/AnonymousClass75.java
f6e030a22fa8ffb845b4f006fa86f5784480944a
[]
no_license
hongnam207/pi-network-source
1415a955e37fe58ca42098967f0b3307ab0dc785
17dc583f08f461d4dfbbc74beb98331bf7f9e5e3
refs/heads/main
2023-03-30T07:49:35.920796
2021-03-28T06:56:24
2021-03-28T06:56:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,876
java
package com.facebook.ads.redexgen.X; import java.util.Arrays; import kotlin.jvm.internal.ByteCompanionObject; /* JADX WARN: Init of enum A04 can be incorrect */ /* renamed from: com.facebook.ads.redexgen.X.75 reason: invalid class name */ public enum AnonymousClass75 { A06(A00(8, 7, 115)), A05(A00(3, 5, 19)), A04(r0); public static byte[] A01; public static String[] A02; public String A00; public static String A00(int i, int i2, int i3) { byte[] copyOfRange = Arrays.copyOfRange(A01, i, i + i2); int i4 = 0; while (true) { int length = copyOfRange.length; if (A02[0].length() != 29) { String[] strArr = A02; strArr[1] = ""; strArr[1] = ""; if (i4 >= length) { return new String(copyOfRange); } copyOfRange[i4] = (byte) ((copyOfRange[i4] ^ i3) ^ 17); i4++; } else { throw new RuntimeException(); } } } public static void A01() { A01 = new byte[]{61, 52, 69, 81, 74, 67, 47, 51, 49, 42, 35, 79, 80, 87, 84, 36, 63, 54, 70, 25, 2, 11, 120, ByteCompanionObject.MAX_VALUE, 124}; } public static void A02() { A02 = new String[]{"fU4XiUh", "4ASLCGhodwv3fY7yqE", "BFhkWaiQLcBXUQO4Yi7KFwSjCE1nMNEL", "IBfibZ8IWoONy44J9jH8jZ0p3ibNlB3T", "FmTm3wR2K52Lz7zbwKhVmki4cB", "JxTEYV1Vluo7DhPyeTARHiExSqxbiuYf", "t7Mb3YBBhyhswQ5hXIhgNczDQ93Q9bzO", "oX4F1jUgCDnefIZx9v8TRjWfCJBhCFOT"}; } /* access modifiers changed from: public */ static { A02(); A01(); A00(0, 3, 97); } /* access modifiers changed from: public */ AnonymousClass75(String str) { this.A00 = str; } public final String A03() { return this.A00; } }
[ "nganht2@vng.com.vn" ]
nganht2@vng.com.vn
61feb074eaa96799b9916422c2b3c74878975a44
329b2cb3c91a0c953458efd253c4fcdce6f539c4
/graphsdk/src/main/java/com/microsoft/graph/extensions/WorkbookFunctionsIsErrorRequestBuilder.java
3bd59a595bf9167921d15202f585b7d19598375d
[ "MIT" ]
permissive
sbolotovms/msgraph-sdk-android
255eeddf19c1b15f04ee3b1549f0cae70d561fdd
1320795ba1c0b5eb36ef8252b73799d15fc46ba1
refs/heads/master
2021-01-20T05:09:00.148739
2017-04-28T23:20:23
2017-04-28T23:20:23
89,751,501
1
0
null
2017-04-28T23:20:37
2017-04-28T23:20:37
null
UTF-8
Java
false
false
1,463
java
// ------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. // ------------------------------------------------------------------------------ package com.microsoft.graph.extensions; import com.microsoft.graph.concurrency.*; import com.microsoft.graph.core.*; import com.microsoft.graph.extensions.*; import com.microsoft.graph.http.*; import com.microsoft.graph.generated.*; import com.microsoft.graph.options.*; import com.microsoft.graph.serializer.*; import java.util.Arrays; import java.util.List; // This file is available for extending, afterwards please submit a pull request. /** * The class for the Workbook Functions Is Error Request Builder. */ public class WorkbookFunctionsIsErrorRequestBuilder extends BaseWorkbookFunctionsIsErrorRequestBuilder implements IWorkbookFunctionsIsErrorRequestBuilder { /** * The request builder for this WorkbookFunctionsIsError * * @param requestUrl The request url * @param client The service client * @param requestOptions The options for this request */ public WorkbookFunctionsIsErrorRequestBuilder(final String requestUrl, final IBaseClient client, final List<Option> requestOptions, final com.google.gson.JsonElement value) { super(requestUrl, client, requestOptions, value); } }
[ "brianmel@microsoft.com" ]
brianmel@microsoft.com
cd637e9e88d250a78efb128ba8ff0d9a0f88e3e4
e5fdec9df80b4958f49250f90fd05c13e3bda8b7
/org.servicifi.gelato.language.cobol/src-gen/org/servicifi/gelato/language/cobol/handlers/impl/OnSizeErrorImpl.java
a09c9e69423594bb58f5ef3c0cf40a163ca858d4
[]
no_license
amirms/gelato
9125e6ac3a56e5bcfd032db855a4c269bdfc5152
972d7309dc37c57d17d2b1486a49f00830983eb8
refs/heads/master
2021-06-03T22:07:12.010077
2019-03-10T11:54:27
2019-03-10T11:54:27
27,443,539
0
0
null
null
null
null
UTF-8
Java
false
false
789
java
/** */ package org.servicifi.gelato.language.cobol.handlers.impl; import org.eclipse.emf.ecore.EClass; import org.servicifi.gelato.language.cobol.handlers.HandlersPackage; import org.servicifi.gelato.language.cobol.handlers.OnSizeError; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>On Size Error</b></em>'. * <!-- end-user-doc --> * * @generated */ public class OnSizeErrorImpl extends HandlerImpl implements OnSizeError { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected OnSizeErrorImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return HandlersPackage.Literals.ON_SIZE_ERROR; } } //OnSizeErrorImpl
[ "amir.iust@gmail.com" ]
amir.iust@gmail.com
71e4ad8d85d5d74c75dd08c315a60ef4e5d8f3a8
096e862f59cf0d2acf0ce05578f913a148cc653d
/code/apps/ValidationTools/src/com/sprd/validationtools/itemstest/ScreenColorTest.java
22397e65fb16c7dd218c12298ddcc84a5cbb69eb
[]
no_license
Phenix-Collection/Android-6.0-packages
e2ba7f7950c5df258c86032f8fbdff42d2dfc26a
ac1a67c36f90013ac1de82309f84bd215d5fdca9
refs/heads/master
2021-10-10T20:52:24.087442
2017-05-27T05:52:42
2017-05-27T05:52:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,926
java
package com.sprd.validationtools.itemstest; import android.content.Intent; import android.graphics.Color; import android.os.Bundle; import android.os.Handler; import android.util.Log; import android.view.Gravity; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import com.sprd.validationtools.BaseActivity; import com.sprd.validationtools.R; public class ScreenColorTest extends BaseActivity { private String TAG = "ScreenColorTest"; TextView mContent; int mIndex = 0, mCount = 0; private Handler mUiHandler = new Handler();; private Runnable mRunnable; private static final int[] COLOR_ARRAY = new int[] { Color.WHITE, Color.RED, Color.GREEN, Color.BLUE, Color.YELLOW }; private static final int TIMES = 4; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mContent = new TextView(this); mRunnable = new Runnable() { public void run() { mContent.setBackgroundColor(COLOR_ARRAY[mIndex]); mIndex++; mCount++; setBackground(); } }; setBackground(); setTitle(R.string.lcd_test); setContentView(mContent); mContent.setGravity(Gravity.CENTER); mContent.setTextSize(35); super.removeButton(); } private void setBackground() { if (mIndex >= COLOR_ARRAY.length) { //showResultDialog(getString(R.string.lcd_max)); super.createButton(true); super.createButton(false); return; } mContent.setBackgroundColor(COLOR_ARRAY[mIndex]); mUiHandler.postDelayed(mRunnable, 600); } @Override public void onDestroy() { mUiHandler.removeCallbacks(mRunnable); super.onDestroy(); } }
[ "wangjicong6403660@126.com" ]
wangjicong6403660@126.com
b72fa227744f0a64b7f7b2fa1f4b6c8ecf421a58
2f92dfff9b9929b64e645fdc254815d06bf2b8d2
/src/test/test/lee/codetest/code_35__Search_Insert_Position/CodeTest.java
eb1de113139234d701a8c7de965117ecbdbaa3d2
[ "MIT" ]
permissive
code543/leetcodequestions
fc5036d63e4c3e1b622fe73552fb33c039e63fb0
44cbfe6718ada04807b6600a5d62b9f0016d4ab2
refs/heads/master
2020-04-05T19:43:15.530768
2018-12-07T04:09:07
2018-12-07T04:09:07
157,147,529
1
0
null
null
null
null
UTF-8
Java
false
false
886
java
package lee.codetest.code_35__Search_Insert_Position; import org.junit.Test; /** testcase:[1,3,5,6] 5 */ public class CodeTest { @Test public void testSolution() throws Exception { //new Solution() lee.code.code_35__Search_Insert_Position.C35_MainClass.main(null);; } } /** * * * 35.Search Insert Position * * difficulty: Easy * @see https://leetcode.com/problems/search-insert-position/description/ * @see description_35.md * @Similiar Topics * -->Array https://leetcode.com//tag/array * -->Binary Search https://leetcode.com//tag/binary-search * @Similiar Problems * -->First Bad Version https://leetcode.com//problems/first-bad-version * Run solution from Unit Test: * @see lee.codetest.code_35__Search_Insert_Position.CodeTest * Run solution from Main Judge Class: * @see lee.code.code_35__Search_Insert_Position.C35_MainClass * */
[ "santoschenwbu@gmail.com" ]
santoschenwbu@gmail.com
8eafb35e5fd301e44dd2fbb866f7f530c150a35d
c32d1d567d12928ffe7b52ffe09de9a64db0b39e
/new/201909/src/day190909/web/servlet/ProvinceServlet.java
71bb41724980f48220d61f6f3337e4fd8f154449
[]
no_license
madokast/JavaLearning
fdafb1f1770ff4839898bbfacaec25dd651a72e6
b6c419e152f13c2d8688644b102b80624ae8b433
refs/heads/master
2022-12-24T13:14:44.659868
2020-01-03T07:10:18
2020-01-03T07:10:18
159,938,675
0
0
null
2022-12-16T06:44:43
2018-12-01T11:40:59
HTML
UTF-8
Java
false
false
1,115
java
package day190909.web.servlet; import com.fasterxml.jackson.databind.ObjectMapper; import day190909.doamin.Province; import day190909.service.ProvinceService; import day190909.service.impl.ProvinceServiceImpl; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.List; @WebServlet("/provinceServlet") public class ProvinceServlet extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("application/json;charset=utf-8"); request.setCharacterEncoding("UTF-8"); ProvinceService provinceService = new ProvinceServiceImpl(); response.getWriter().write(provinceService.findAllJson()); } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { this.doPost(request, response); } }
[ "578562554@qq.com" ]
578562554@qq.com
fd67bc0415c6796d788d1fe00958c739a0c5604b
c2e6f7c40edce79fd498a5bbaba4c2d69cf05e0c
/src/main/java/kotlin/comparisons/ComparisonsKt__ComparisonsKt$compareBy$1.java
608e031da16936a0c73cb12495d0ed818e7affe6
[]
no_license
pengju1218/decompiled-apk
7f64ee6b2d7424b027f4f112c77e47cd420b2b8c
b60b54342a8e294486c45b2325fb78155c3c37e6
refs/heads/master
2022-03-23T02:57:09.115704
2019-12-28T23:13:07
2019-12-28T23:13:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
978
java
package kotlin.comparisons; import java.util.Comparator; import kotlin.Metadata; import kotlin.jvm.functions.Function1; @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\n\n\u0000\n\u0002\u0010\b\n\u0002\b\u0006\u0010\u0000\u001a\u00020\u0001\"\u0004\b\u0000\u0010\u00022\u000e\u0010\u0003\u001a\n \u0004*\u0004\u0018\u0001H\u0002H\u00022\u000e\u0010\u0005\u001a\n \u0004*\u0004\u0018\u0001H\u0002H\u0002H\n¢\u0006\u0004\b\u0006\u0010\u0007"}, d2 = {"<anonymous>", "", "T", "a", "kotlin.jvm.PlatformType", "b", "compare", "(Ljava/lang/Object;Ljava/lang/Object;)I"}, k = 3, mv = {1, 1, 15}) final class ComparisonsKt__ComparisonsKt$compareBy$1<T> implements Comparator<T> { final /* synthetic */ Function1[] a; ComparisonsKt__ComparisonsKt$compareBy$1(Function1[] function1Arr) { this.a = function1Arr; } public final int compare(T t, T t2) { return ComparisonsKt__ComparisonsKt.compareValuesByImpl$ComparisonsKt__ComparisonsKt(t, t2, this.a); } }
[ "apoorwaand@gmail.com" ]
apoorwaand@gmail.com
f63e6bd85ff4d27fe60370ecd8ba9b5b0065e58a
79fa5527063fb900216eea9cf31f31fccd2e9e77
/service/src/main/java/com/gmail/vpshulgaa/service/dto/ItemDto.java
70a64ba03c40afd953354775081151dcce760df4
[]
no_license
vpshulga/shop
3d53dd1e71a958c7e6dc8b9dc7802f1442eae20d
23fe1bebdb6b392bd4609313f77ae7f59e4a5f6a
refs/heads/master
2020-03-27T13:14:57.612412
2019-03-26T20:45:46
2019-03-26T20:45:46
146,598,977
0
0
null
2018-10-17T13:33:33
2018-08-29T12:49:03
Java
UTF-8
Java
false
false
2,095
java
package com.gmail.vpshulgaa.service.dto; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import java.util.Objects; public class ItemDto { private Long id; private String name; private String description; private String uniqueNumber; private BigDecimal price; private Boolean deleted; private List<DiscountDto> discounts = new ArrayList<>(); public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getUniqueNumber() { return uniqueNumber; } public void setUniqueNumber(String uniqueNumber) { this.uniqueNumber = uniqueNumber; } public BigDecimal getPrice() { return price; } public void setPrice(BigDecimal price) { this.price = price; } public List<DiscountDto> getDiscounts() { return discounts; } public void setDiscounts(List<DiscountDto> discounts) { this.discounts = discounts; } public Boolean getDeleted() { return deleted; } public void setDeleted(Boolean deleted) { this.deleted = deleted; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ItemDto itemDto = (ItemDto) o; return Objects.equals(id, itemDto.id) && Objects.equals(name, itemDto.name) && Objects.equals(description, itemDto.description) && Objects.equals(uniqueNumber, itemDto.uniqueNumber) && Objects.equals(price, itemDto.price); } @Override public int hashCode() { return Objects.hash(id, name, description, uniqueNumber, price); } }
[ "vpshulgaa@gmail.com" ]
vpshulgaa@gmail.com
d8674d336b214b97e3583640b9f666b438ba2103
d3eba076ce93204880f9c32536c10019840ef043
/src/com/hubahuma/mobile/LoadingDialog.java
db7589c41fc5c7e8377c5ede71ef26ce3049b268
[]
no_license
jianbingfang/huba-huma
4603514446f9c42831a8859231f55eb7cd41c223
95d898f2f988bc8b833b9046a671526cfe3ebbe6
refs/heads/master
2021-01-10T21:01:41.466705
2014-09-13T17:06:32
2014-09-13T17:06:32
22,061,075
1
1
null
null
null
null
UTF-8
Java
false
false
783
java
package com.hubahuma.mobile; import org.androidannotations.annotations.AfterViews; import org.androidannotations.annotations.Click; import org.androidannotations.annotations.EFragment; import org.androidannotations.annotations.UiThread; import org.androidannotations.annotations.ViewById; import com.hubahuma.mobile.utils.UtilTools; import android.os.Bundle; import android.support.v4.app.DialogFragment; import android.view.View; import android.view.Window; import android.widget.Button; import android.widget.TextView; @EFragment(R.layout.fragment_dialog_loading) public class LoadingDialog extends DialogFragment { @AfterViews void init() { getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE); getDialog().setCanceledOnTouchOutside(false); } }
[ "jianbingfang@gmail.com" ]
jianbingfang@gmail.com
34c6910d67c8391bf400f522a79a1a21e2b0716b
3e21e436130a0c8f0223de7b68307ef7692795bf
/MapAPI2/app/src/main/java/Model/BenhViens.java
f8b888b92ff4e593fd2ac3a82570fccf1cd24a59
[]
no_license
nguyenbahung94/use-google-api
8c22361909a78e26549a67350e99a6b9d3a1cf80
3ab9ad9c4c5a58a7d7ec6aab78544b89a3a83df0
refs/heads/master
2021-01-21T21:29:13.072592
2017-06-27T18:30:56
2017-06-27T18:30:56
94,854,124
0
0
null
null
null
null
UTF-8
Java
false
false
1,294
java
package Model; /** * Created by Adam on 11/21/2016. */ public class BenhViens { private String name; private String mabv; // private String placeid; // private Double kinhdo; // private Double vido; public BenhViens() { } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getMabv() { return mabv; } public void setMabv(String mabv) { this.mabv = mabv; } // public String getPlaceid() { // return placeid; // } // // public void setPlaceid(String placeid) { // this.placeid = placeid; // } // // public Double getKinhdo() { // return kinhdo; // } // // public void setKinhdo(Double kinhdo) { // this.kinhdo = kinhdo; // } // // public Double getVido() { // return vido; // } // // public void setVido(Double vido) { // this.vido = vido; // } @Override public String toString() { return "BenhViens{" + "name='" + name + '\'' + ", mabv='" + mabv + '\'' + // ", placeid='" + placeid + '\'' + // ", kinhdo=" + kinhdo + // ", vido=" + vido + '}'; } }
[ "mr.hungcity@gmail.com" ]
mr.hungcity@gmail.com
4ee083e419fc78dca8887a2fb589da8c77ff59dc
056371473ba8a9b5ddae60c91cbfc8d6624396c3
/any-adapter/src/test/java/com/github/boybeak/adapter/AnyAdapterTest.java
db76f632d137ec8a0cd5508d5b5c96c22acd8728
[]
no_license
boybeak/AnyAdapter
876cfb5aab6ba91f6ad78bdaee4da464ca04e060
2b726773097029c96f30c26207ba827cdf4f5f80
refs/heads/master
2022-08-04T13:27:48.740201
2022-07-21T06:43:02
2022-07-21T06:43:02
231,913,281
4
0
null
null
null
null
UTF-8
Java
false
false
1,606
java
package com.github.boybeak.adapter; import android.util.SparseArray; import org.junit.Assert; import org.junit.Test; import org.mockito.Mockito; import java.util.HashMap; import java.util.Map; public class AnyAdapterTest { @Test public void testMapSpeed() { SparseArray<Class<?>> sMap = new SparseArray<>(); long start1 = System.currentTimeMillis(); for (int i = 0; i < 1000000; i++) { sMap.put(i, String.class); } long d1 = System.currentTimeMillis() - start1; System.out.println(System.currentTimeMillis() - start1); Map<Integer, Class<?>> hMap = new HashMap<>(); long start2 = System.currentTimeMillis(); for (int i = 0; i < 1000000; i++) { hMap.put(i, String.class); } long d2 = System.currentTimeMillis() - start2; System.out.println(d2); System.out.println(); Assert.assertTrue(d1 < d2); long start3 = System.currentTimeMillis(); for (int i = 0; i < sMap.size(); i++) { sMap.get(i); } long d3 = System.currentTimeMillis() - start3; System.out.println(d3); long start4 = System.currentTimeMillis(); for (int i = 0; i < hMap.size(); i++) { hMap.get(i); } long d4 = System.currentTimeMillis() - start4; System.out.println(d4); Assert.assertTrue(d3 < d4); } @Test public void testGetItemCount() { AnyAdapter adapter = Mockito.mock(AnyAdapter.class); Mockito.when(adapter.getItemCount()).thenReturn(0); } }
[ "boybeak@gmail.com" ]
boybeak@gmail.com
2c6241282f9c17eb319d7ba54219690bd54a1092
f3bb9e8806db3db77a8079988d74ffce847593f9
/org.alloytools.kodkod.core/src/main/java/kodkod/ast/UnaryExpression.java
a9f3a40435ed64ba326adebf4dfbd7015f0a63f6
[ "MIT", "Apache-2.0" ]
permissive
danielleberre/org.alloytools.alloy
de673f3d078083f3a3d8c6e55b5d067404c4420d
dcc3d4d04ef7970dca35047cb3f51945922f9e8f
refs/heads/master
2021-04-03T04:49:03.932626
2018-03-12T07:35:13
2018-03-12T07:35:13
125,003,790
0
1
Apache-2.0
2018-03-13T06:34:15
2018-03-13T06:34:15
null
UTF-8
Java
false
false
3,261
java
/* * Kodkod -- Copyright (c) 2005-present, Emina Torlak * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package kodkod.ast; import kodkod.ast.operator.ExprOperator; import kodkod.ast.visitor.ReturnVisitor; import kodkod.ast.visitor.VoidVisitor; /** * An {@link kodkod.ast.Expression expression} with one child. * * @specfield expression: Expression * @specfield op: ExprOperator * @invariant op.unary() * @invariant children = 0->Expression * @author Emina Torlak */ public final class UnaryExpression extends Expression { private final Expression expression; private final ExprOperator op; private final int arity; /** * Constructs a new unary expression: op expression * * @ensures this.expression' = expression && this.op' = op * @throws NullPointerException expression = null || op = null * @throws IllegalArgumentException op in {TRANSPOSE, CLOSURE, * REFLEXIVE_CLOSURE} && child.arity != 2 */ UnaryExpression(ExprOperator op, Expression child) { if (!op.unary()) { throw new IllegalArgumentException("Not a unary operator: " + op); } if (child.arity() != 2 && op != ExprOperator.PRE) { throw new IllegalArgumentException("Invalid arity: " + child + "::" + child.arity()); } this.expression = child; this.op = op; this.arity = child.arity(); } /** * Returns the arity of this expression. * * @return this.arity * @see kodkod.ast.Expression#arity() */ public int arity() { return arity; } /** * Returns this.expression. * * @return this.expression */ public Expression expression() { return expression; } /** * Returns this.op. * * @return this.op */ public ExprOperator op() { return op; } /** * {@inheritDoc} * * @see kodkod.ast.Expression#accept(kodkod.ast.visitor.ReturnVisitor) */ public <E, F, D, I> E accept(ReturnVisitor<E,F,D,I> visitor) { return visitor.visit(this); } /** * {@inheritDoc} * * @see kodkod.ast.Node#accept(kodkod.ast.visitor.VoidVisitor) */ public void accept(VoidVisitor visitor) { visitor.visit(this); } /** * {@inheritDoc} * * @see kodkod.ast.Node#toString() */ public String toString() { return op.toString() + expression.toString(); } }
[ "peter.kriens@aqute.biz" ]
peter.kriens@aqute.biz