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
f2d33c2a90886249887a93707bdbada497f08447
1ce518b09521578e26e79a1beef350e7485ced8c
/source/app/src/main/java/com/google/mygson/internal/bind/ObjectTypeAdapter.java
b8517ce69abb0bbae818ad0782282f0ad073fc16
[]
no_license
yash2710/AndroidStudioProjects
7180eb25e0f83d3f14db2713cd46cd89e927db20
e8ba4f5c00664f9084f6154f69f314c374551e51
refs/heads/master
2021-01-10T01:15:07.615329
2016-04-03T09:19:01
2016-04-03T09:19:01
55,338,306
1
1
null
null
null
null
UTF-8
Java
false
false
2,609
java
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.google.mygson.internal.bind; import com.google.mygson.Gson; import com.google.mygson.TypeAdapter; import com.google.mygson.TypeAdapterFactory; import com.google.mygson.internal.LinkedTreeMap; import com.google.mygson.stream.JsonReader; import com.google.mygson.stream.JsonToken; import com.google.mygson.stream.JsonWriter; import java.util.ArrayList; import java.util.List; import java.util.Map; // Referenced classes of package com.google.mygson.internal.bind: // g, h public final class ObjectTypeAdapter extends TypeAdapter { public static final TypeAdapterFactory FACTORY = new g(); private final Gson a; private ObjectTypeAdapter(Gson gson) { a = gson; } ObjectTypeAdapter(Gson gson, byte byte0) { this(gson); } public final Object read(JsonReader jsonreader) { JsonToken jsontoken = jsonreader.peek(); switch (h.a[jsontoken.ordinal()]) { default: throw new IllegalStateException(); case 1: // '\001' ArrayList arraylist = new ArrayList(); jsonreader.beginArray(); for (; jsonreader.hasNext(); arraylist.add(read(jsonreader))) { } jsonreader.endArray(); return arraylist; case 2: // '\002' LinkedTreeMap linkedtreemap = new LinkedTreeMap(); jsonreader.beginObject(); for (; jsonreader.hasNext(); linkedtreemap.put(jsonreader.nextName(), read(jsonreader))) { } jsonreader.endObject(); return linkedtreemap; case 3: // '\003' return jsonreader.nextString(); case 4: // '\004' return Double.valueOf(jsonreader.nextDouble()); case 5: // '\005' return Boolean.valueOf(jsonreader.nextBoolean()); case 6: // '\006' jsonreader.nextNull(); return null; } } public final void write(JsonWriter jsonwriter, Object obj) { if (obj == null) { jsonwriter.nullValue(); return; } TypeAdapter typeadapter = a.getAdapter(obj.getClass()); if (typeadapter instanceof ObjectTypeAdapter) { jsonwriter.beginObject(); jsonwriter.endObject(); return; } else { typeadapter.write(jsonwriter, obj); return; } } }
[ "13bce123@nirmauni.ac.in" ]
13bce123@nirmauni.ac.in
4648a94a3998c17330b024c48273f835e562b826
63405be9a9047666a02583a839cf1ae258e66742
/fest-swing/src/testBackUp/org/fest/swing/fixture/DialogFixture_constructor_withDialog_Test.java
91b1b3a2842a6844be2bb4069cf927d4609c2077
[ "Apache-2.0" ]
permissive
CyberReveal/fest-swing-1.x
7884201dde080a6702435c0f753e32f004fea0f8
670fac718df72486b6177ce5d406421b3290a7f8
refs/heads/master
2020-12-24T16:35:44.180425
2017-02-17T15:15:43
2017-02-17T15:15:43
8,160,798
0
0
null
null
null
null
UTF-8
Java
false
false
1,506
java
/* * Created on Nov 17, 2009 * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. * * Copyright @2009-2013 the original author or authors. */ package org.fest.swing.fixture; import static org.fest.assertions.Assertions.assertThat; import static org.fest.swing.test.builder.JDialogs.dialog; import java.awt.Dialog; import org.fest.swing.test.core.EDTSafeTestCase; import org.junit.After; import org.junit.Test; /** * Tests for {@link DialogFixture#DialogFixture(Dialog)}. * * @author Alex Ruiz * @author Yvonne Wang */ public class DialogFixture_constructor_withDialog_Test extends EDTSafeTestCase { private DialogFixture fixture; @After public void tearDown() { if (fixture != null) { fixture.cleanUp(); } } @Test public void should_create_new_Robot_and_use_given_dialog_as_target() { Dialog target = dialog().createNew(); fixture = new DialogFixture(target); assertThat(fixture.robot).isNotNull(); assertThat(fixture.target()).isSameAs(target); } }
[ "colin.goodheart-smithe@ISVGREPC0000714.Imp.net" ]
colin.goodheart-smithe@ISVGREPC0000714.Imp.net
51c21fc6a55537e283445f2bfb993e96c577cf5c
71975999c9d702a0883ec9038ce3e76325928549
/src2.4.0/src/main/java/com/amap/api/mapcore/util/oOOO0o00.java
203ba45ab13f3d1a0d8b0d3b876808e51aa8de08
[]
no_license
XposedRunner/PhysicalFitnessRunner
dc64179551ccd219979a6f8b9fe0614c29cd61de
cb037e59416d6c290debbed5ed84c956e705e738
refs/heads/master
2020-07-15T18:18:23.001280
2019-09-02T04:21:34
2019-09-02T04:21:34
205,620,387
3
2
null
null
null
null
UTF-8
Java
false
false
6,330
java
package com.amap.api.mapcore.util; import android.content.Context; import android.text.TextUtils; import com.amap.api.maps.AMapException; /* compiled from: StatisticsEntity */ public class oOOO0o00 { private Context O000000o; private String O00000Oo; private String O00000o; private String O00000o0; private String O00000oO; public oOOO0o00(Context context, String str, String str2, String str3) throws o0O0oo0o { if (TextUtils.isEmpty(str3) || str3.length() > 256) { throw new o0O0oo0o(AMapException.ERROR_INVALID_PARAMETER); } this.O000000o = context.getApplicationContext(); this.O00000o0 = str; this.O00000o = str2; this.O00000Oo = str3; } public void O000000o(String str) throws o0O0oo0o { if (TextUtils.isEmpty(str) || str.length() > 65536) { throw new o0O0oo0o(AMapException.ERROR_INVALID_PARAMETER); } this.O00000oO = str; } /* JADX WARNING: Removed duplicated region for block: B:24:0x0067 A:{SYNTHETIC, Splitter:B:24:0x0067} */ /* JADX WARNING: Removed duplicated region for block: B:30:0x0073 A:{SYNTHETIC, Splitter:B:30:0x0073} */ /* JADX WARNING: Removed duplicated region for block: B:36:? A:{SYNTHETIC, RETURN} */ /* JADX WARNING: Removed duplicated region for block: B:11:0x004c A:{SYNTHETIC, Splitter:B:11:0x004c} */ /* JADX WARNING: Missing exception handler attribute for start block: B:8:0x002d */ /* JADX WARNING: Removed duplicated region for block: B:15:0x0055 A:{Splitter:B:3:0x0009, ExcHandler: all (th java.lang.Throwable)} */ /* JADX WARNING: Failed to process nested try/catch */ /* JADX WARNING: Missing block: B:15:0x0055, code skipped: r0 = th; */ /* JADX WARNING: Missing block: B:16:0x0057, code skipped: r0 = th; */ /* JADX WARNING: Missing block: B:17:0x0058, code skipped: r2 = r3; */ /* JADX WARNING: Missing block: B:31:?, code skipped: r3.close(); */ /* JADX WARNING: Missing block: B:32:0x0077, code skipped: r1 = move-exception; */ /* JADX WARNING: Missing block: B:33:0x0078, code skipped: r1.printStackTrace(); */ public byte[] O000000o() { /* r8 = this; r0 = 0; r1 = new byte[r0]; r2 = 0; r3 = new java.io.ByteArrayOutputStream; Catch:{ Throwable -> 0x005d } r3.<init>(); Catch:{ Throwable -> 0x005d } r2 = r8.O00000o0; Catch:{ Throwable -> 0x0057, all -> 0x0055 } com.amap.api.mapcore.util.o0OOOO00.O000000o(r3, r2); Catch:{ Throwable -> 0x0057, all -> 0x0055 } r2 = r8.O00000o; Catch:{ Throwable -> 0x0057, all -> 0x0055 } com.amap.api.mapcore.util.o0OOOO00.O000000o(r3, r2); Catch:{ Throwable -> 0x0057, all -> 0x0055 } r2 = r8.O00000Oo; Catch:{ Throwable -> 0x0057, all -> 0x0055 } com.amap.api.mapcore.util.o0OOOO00.O000000o(r3, r2); Catch:{ Throwable -> 0x0057, all -> 0x0055 } r2 = r8.O000000o; Catch:{ Throwable -> 0x0057, all -> 0x0055 } r2 = com.amap.api.mapcore.util.o0O0o000.O0000oO0(r2); Catch:{ Throwable -> 0x0057, all -> 0x0055 } r2 = java.lang.String.valueOf(r2); Catch:{ Throwable -> 0x0057, all -> 0x0055 } com.amap.api.mapcore.util.o0OOOO00.O000000o(r3, r2); Catch:{ Throwable -> 0x0057, all -> 0x0055 } r4 = java.lang.System.currentTimeMillis(); Catch:{ Throwable -> 0x002d, all -> 0x0055 } r6 = 1000; // 0x3e8 float:1.401E-42 double:4.94E-321; r4 = r4 / r6; r0 = (int) r4; L_0x002d: r0 = r8.O000000o(r0); Catch:{ Throwable -> 0x0057, all -> 0x0055 } r3.write(r0); Catch:{ Throwable -> 0x0057, all -> 0x0055 } r0 = r8.O00000oO; Catch:{ Throwable -> 0x0057, all -> 0x0055 } r0 = r8.O00000Oo(r0); Catch:{ Throwable -> 0x0057, all -> 0x0055 } r3.write(r0); Catch:{ Throwable -> 0x0057, all -> 0x0055 } r0 = r8.O00000oO; Catch:{ Throwable -> 0x0057, all -> 0x0055 } r0 = com.amap.api.mapcore.util.o0OOOO00.O000000o(r0); Catch:{ Throwable -> 0x0057, all -> 0x0055 } r3.write(r0); Catch:{ Throwable -> 0x0057, all -> 0x0055 } r0 = r3.toByteArray(); Catch:{ Throwable -> 0x0057, all -> 0x0055 } if (r3 == 0) goto L_0x0070; L_0x004c: r3.close(); Catch:{ Throwable -> 0x0050 } goto L_0x0070; L_0x0050: r1 = move-exception; r1.printStackTrace(); goto L_0x0070; L_0x0055: r0 = move-exception; goto L_0x0071; L_0x0057: r0 = move-exception; r2 = r3; goto L_0x005e; L_0x005a: r0 = move-exception; r3 = r2; goto L_0x0071; L_0x005d: r0 = move-exception; L_0x005e: r3 = "se"; r4 = "tds"; com.amap.api.mapcore.util.ooOOOOoo.O00000o0(r0, r3, r4); Catch:{ all -> 0x005a } if (r2 == 0) goto L_0x006f; L_0x0067: r2.close(); Catch:{ Throwable -> 0x006b } goto L_0x006f; L_0x006b: r0 = move-exception; r0.printStackTrace(); L_0x006f: r0 = r1; L_0x0070: return r0; L_0x0071: if (r3 == 0) goto L_0x007b; L_0x0073: r3.close(); Catch:{ Throwable -> 0x0077 } goto L_0x007b; L_0x0077: r1 = move-exception; r1.printStackTrace(); L_0x007b: throw r0; */ throw new UnsupportedOperationException("Method not decompiled: com.amap.api.mapcore.util.oOOO0o00.O000000o():byte[]"); } public byte[] O000000o(int i) { return new byte[]{(byte) ((i >> 24) & 255), (byte) ((i >> 16) & 255), (byte) ((i >> 8) & 255), (byte) (i & 255)}; } public byte[] O00000Oo(String str) { if (TextUtils.isEmpty(str)) { return new byte[]{(byte) 0, (byte) 0}; } byte[] O000000o = o0OOOO00.O000000o(this.O00000oO); if (O000000o == null) { return new byte[]{(byte) 0, (byte) 0}; } byte length = (byte) (O000000o.length % 256); return new byte[]{(byte) (r4 / 256), length}; } }
[ "xr_master@mail.com" ]
xr_master@mail.com
7974ffb30be538581779ae76f99293e427a947b4
180e78725121de49801e34de358c32cf7148b0a2
/dataset/protocol1/repairnator/learning/50/InputBuildId.java
ed124e2a1064c71489c3ff9261374743dc108f05
[]
no_license
ASSERT-KTH/synthetic-checkstyle-error-dataset
40e8d1e0a7ebe7f7711def96a390891a6922f7bd
40c057e1669584bfc6fecf789b5b2854660222f3
refs/heads/master
2023-03-18T12:50:55.410343
2019-01-25T09:54:39
2019-01-25T09:54:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
781
java
package fr.inria.spirals.repairnator; /** * This class represents a Build input for both Repairnator and BEARS * For repairnator it's only a buggy build id, but for BEARS it's a pair of buggy build id and patched build id. */ public class InputBuildId { public static final int NO_PATCH = -1; private long buggyBuildId; private long patchedBuildId = NO_PATCH; public InputBuildId(long buggyBuildId) { this.buggyBuildId = buggyBuildId; } public InputBuildId(long buggyBuildId, long patchedBuildId) { this(buggyBuildId); this.patchedBuildId = patchedBuildId; } public long getBuggyBuildId() { return this.buggyBuildId; } public long getPatchedBuildId() { return this.patchedBuildId; } }
[ "bloriot97@gmail.com" ]
bloriot97@gmail.com
3122d61c70acef2f826ae1be89d3396d55202b70
dd80a584130ef1a0333429ba76c1cee0eb40df73
/external/guava/guava/src/com/google/common/base/Throwables.java
793c5f9436e1fe0d7301e9e206c318e319872887
[ "Apache-2.0", "MIT" ]
permissive
karunmatharu/Android-4.4-Pay-by-Data
466f4e169ede13c5835424c78e8c30ce58f885c1
fcb778e92d4aad525ef7a995660580f948d40bc9
refs/heads/master
2021-03-24T13:33:01.721868
2017-02-18T17:48:49
2017-02-18T17:48:49
81,847,777
0
2
MIT
2020-03-09T00:02:12
2017-02-13T16:47:00
null
UTF-8
Java
false
false
7,759
java
/* * Copyright (C) 2007 The Guava Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.common.base; import static com.google.common.base.Preconditions.checkNotNull; import com.google.common.annotations.Beta; import java.io.PrintWriter; import java.io.StringWriter; import java.util.ArrayList; import java.util.Collections; import java.util.List; import javax.annotation.Nullable; /** * Static utility methods pertaining to instances of {@link Throwable}. * * @author Kevin Bourrillion * @author Ben Yu * @since 1.0 */ public final class Throwables { private Throwables() {} /** * Propagates {@code throwable} exactly as-is, if and only if it is an * instance of {@code declaredType}. Example usage: * <pre> * try { * someMethodThatCouldThrowAnything(); * } catch (IKnowWhatToDoWithThisException e) { * handle(e); * } catch (Throwable t) { * Throwables.propagateIfInstanceOf(t, IOException.class); * Throwables.propagateIfInstanceOf(t, SQLException.class); * throw Throwables.propagate(t); * } * </pre> */ public static <X extends Throwable> void propagateIfInstanceOf( @Nullable Throwable throwable, Class<X> declaredType) throws X { // Check for null is needed to avoid frequent JNI calls to isInstance(). if (throwable != null && declaredType.isInstance(throwable)) { throw declaredType.cast(throwable); } } /** * Propagates {@code throwable} exactly as-is, if and only if it is an * instance of {@link RuntimeException} or {@link Error}. Example usage: * <pre> * try { * someMethodThatCouldThrowAnything(); * } catch (IKnowWhatToDoWithThisException e) { * handle(e); * } catch (Throwable t) { * Throwables.propagateIfPossible(t); * throw new RuntimeException("unexpected", t); * } * </pre> */ public static void propagateIfPossible(@Nullable Throwable throwable) { propagateIfInstanceOf(throwable, Error.class); propagateIfInstanceOf(throwable, RuntimeException.class); } /** * Propagates {@code throwable} exactly as-is, if and only if it is an * instance of {@link RuntimeException}, {@link Error}, or * {@code declaredType}. Example usage: * <pre> * try { * someMethodThatCouldThrowAnything(); * } catch (IKnowWhatToDoWithThisException e) { * handle(e); * } catch (Throwable t) { * Throwables.propagateIfPossible(t, OtherException.class); * throw new RuntimeException("unexpected", t); * } * </pre> * * @param throwable the Throwable to possibly propagate * @param declaredType the single checked exception type declared by the * calling method */ public static <X extends Throwable> void propagateIfPossible( @Nullable Throwable throwable, Class<X> declaredType) throws X { propagateIfInstanceOf(throwable, declaredType); propagateIfPossible(throwable); } /** * Propagates {@code throwable} exactly as-is, if and only if it is an * instance of {@link RuntimeException}, {@link Error}, {@code declaredType1}, * or {@code declaredType2}. In the unlikely case that you have three or more * declared checked exception types, you can handle them all by invoking these * methods repeatedly. See usage example in {@link * #propagateIfPossible(Throwable, Class)}. * * @param throwable the Throwable to possibly propagate * @param declaredType1 any checked exception type declared by the calling * method * @param declaredType2 any other checked exception type declared by the * calling method */ public static <X1 extends Throwable, X2 extends Throwable> void propagateIfPossible(@Nullable Throwable throwable, Class<X1> declaredType1, Class<X2> declaredType2) throws X1, X2 { checkNotNull(declaredType2); propagateIfInstanceOf(throwable, declaredType1); propagateIfPossible(throwable, declaredType2); } /** * Propagates {@code throwable} as-is if it is an instance of * {@link RuntimeException} or {@link Error}, or else as a last resort, wraps * it in a {@code RuntimeException} then propagates. * <p> * This method always throws an exception. The {@code RuntimeException} return * type is only for client code to make Java type system happy in case a * return value is required by the enclosing method. Example usage: * <pre> * T doSomething() { * try { * return someMethodThatCouldThrowAnything(); * } catch (IKnowWhatToDoWithThisException e) { * return handle(e); * } catch (Throwable t) { * throw Throwables.propagate(t); * } * } * </pre> * * @param throwable the Throwable to propagate * @return nothing will ever be returned; this return type is only for your * convenience, as illustrated in the example above */ public static RuntimeException propagate(Throwable throwable) { propagateIfPossible(checkNotNull(throwable)); throw new RuntimeException(throwable); } /** * Returns the innermost cause of {@code throwable}. The first throwable in a * chain provides context from when the error or exception was initially * detected. Example usage: * <pre> * assertEquals("Unable to assign a customer id", * Throwables.getRootCause(e).getMessage()); * </pre> */ public static Throwable getRootCause(Throwable throwable) { Throwable cause; while ((cause = throwable.getCause()) != null) { throwable = cause; } return throwable; } /** * Gets a {@code Throwable} cause chain as a list. The first entry in the * list will be {@code throwable} followed by its cause hierarchy. Note * that this is a snapshot of the cause chain and will not reflect * any subsequent changes to the cause chain. * * <p>Here's an example of how it can be used to find specific types * of exceptions in the cause chain: * * <pre> * Iterables.filter(Throwables.getCausalChain(e), IOException.class)); * </pre> * * @param throwable the non-null {@code Throwable} to extract causes from * @return an unmodifiable list containing the cause chain starting with * {@code throwable} */ @Beta // TODO(kevinb): decide best return type public static List<Throwable> getCausalChain(Throwable throwable) { checkNotNull(throwable); List<Throwable> causes = new ArrayList<Throwable>(4); while (throwable != null) { causes.add(throwable); throwable = throwable.getCause(); } return Collections.unmodifiableList(causes); } /** * Returns a string containing the result of * {@link Throwable#toString() toString()}, followed by the full, recursive * stack trace of {@code throwable}. Note that you probably should not be * parsing the resulting string; if you need programmatic access to the stack * frames, you can call {@link Throwable#getStackTrace()}. */ public static String getStackTraceAsString(Throwable throwable) { StringWriter stringWriter = new StringWriter(); throwable.printStackTrace(new PrintWriter(stringWriter)); return stringWriter.toString(); } }
[ "karun.matharu@gmail.com" ]
karun.matharu@gmail.com
66d8f42246564b1275418bbdb426527ef479aa60
8b44c0554aafba8e58fcac8442bab81eff79f976
/usr/router/command/MonitoringStartCommand.java
a597fb7619822850bd6f7beb3c1425c0eeca04dc
[]
no_license
stuartclayman/VLSP
0fe24f872f1acd9e251405632a524c5c005eb0fb
66da2a1da69c2c3ab240be6d63099ce10eeef890
refs/heads/master
2022-06-16T16:47:46.781448
2022-06-13T13:41:15
2022-06-13T13:41:15
187,882,422
0
0
null
null
null
null
UTF-8
Java
false
false
4,584
java
package usr.router.command; import java.io.IOException; import java.io.PrintStream; import java.net.InetSocketAddress; import java.util.Scanner; import org.simpleframework.http.Request; import org.simpleframework.http.Response; import us.monoid.json.JSONException; import us.monoid.json.JSONObject; import usr.logging.Logger; import usr.logging.USR; import usr.protocol.MCRP; /** * The MONITORING_START command starts monitoring on specified address * and port, with Measurements every N seconds. * * MONITORING_START 192.168.7.23:4545 10 */ public class MonitoringStartCommand extends RouterCommand { /** * Construct a MonitoringStartCommand */ public MonitoringStartCommand() { super(MCRP.MONITORING_START.CMD, MCRP.MONITORING_START.CODE, MCRP.ERROR.CODE); } /** * Evaluate the Command. */ @Override public boolean evaluate(Request request, Response response) { try { PrintStream out = response.getPrintStream(); // get full request string String path = java.net.URLDecoder.decode(request.getPath().getPath(), "UTF-8"); // strip off /command String value = path.substring(9); // strip off COMMAND String rest = value.substring(MCRP.MONITORING_START.CMD.length()).trim(); String [] parts = rest.split(" "); if (parts.length != 2) { response.setCode(302); JSONObject jsobj = new JSONObject(); jsobj.put("error", "Expected request: MONITORING_START address:port seconds"); out.println(jsobj.toString()); response.close(); return false; } else { // get address and port // check ip addr spec String[] ipParts = parts[0].split(":"); if (ipParts.length != 2) { Logger.getLogger("log").logln(USR.ERROR, leadin() + "INVALID MONITORING_START ip address: " + parts[0]); response.setCode(302); JSONObject jsobj = new JSONObject(); jsobj.put("error", "MONITORING_START invalid address: " + parts[0]); out.println(jsobj.toString()); response.close(); return false; } else { // process host and port String host = ipParts[0]; Scanner sc = new Scanner(ipParts[1]); int portNumber; try { portNumber = sc.nextInt(); sc.close(); } catch (Exception e) { response.setCode(302); JSONObject jsobj = new JSONObject(); jsobj.put("error", "MONITORING_START invalid port: " + ipParts[1]); out.println(jsobj.toString()); response.close(); return false; } // get timeout for Probe int timeout; // get timeout sc = new Scanner(parts[1]); try { timeout = sc.nextInt(); } catch (Exception e) { response.setCode(302); JSONObject jsobj = new JSONObject(); jsobj.put("error", "MONITORING_START invalid timeout: " + parts[1]); out.println(jsobj.toString()); response.close(); sc.close(); return false; } // if we get here all the args seem OK InetSocketAddress socketAddress = new InetSocketAddress(host, portNumber); controller.startMonitoring(socketAddress, timeout); JSONObject jsobj = new JSONObject(); jsobj.put("response", "Monitoring Started"); out.println(jsobj.toString()); response.close(); sc.close(); return true; } } } catch (IOException ioe) { Logger.getLogger("log").logln(USR.ERROR, leadin() + ioe.getMessage()); } catch (JSONException jex) { Logger.getLogger("log").logln(USR.ERROR, leadin() + jex.getMessage()); } return false; } }
[ "s.clayman@ucl.ac.uk" ]
s.clayman@ucl.ac.uk
208d65754dd410f7935db8b5fb62eba380652b38
c94f888541c0c430331110818ed7f3d6b27b788a
/blockchain/java/src/main/java/com/antgroup/antchain/openapi/blockchain/models/UpdateChainDataexportTaskRequest.java
c84056a2c6b73a2ffeeae16a141a370c6d797eb5
[ "MIT", "Apache-2.0" ]
permissive
alipay/antchain-openapi-prod-sdk
48534eb78878bd708a0c05f2fe280ba9c41d09ad
5269b1f55f1fc19cf0584dc3ceea821d3f8f8632
refs/heads/master
2023-09-03T07:12:04.166131
2023-09-01T08:56:15
2023-09-01T08:56:15
275,521,177
9
10
MIT
2021-03-25T02:35:20
2020-06-28T06:22:14
PHP
UTF-8
Java
false
false
2,466
java
// This file is auto-generated, don't edit it. Thanks. package com.antgroup.antchain.openapi.blockchain.models; import com.aliyun.tea.*; public class UpdateChainDataexportTaskRequest extends TeaModel { // OAuth模式下的授权token @NameInMap("auth_token") public String authToken; @NameInMap("product_instance_id") public String productInstanceId; // 联盟id @NameInMap("consortium_id") @Validation(required = true) public String consortiumId; // 链id @NameInMap("ant_chain_id") @Validation(required = true) public String antChainId; // 任务名称 @NameInMap("trigger_name") @Validation(required = true) public String triggerName; // 导出任务接口体 @NameInMap("trigger") @Validation(required = true) public TriggerDTOStructBody trigger; public static UpdateChainDataexportTaskRequest build(java.util.Map<String, ?> map) throws Exception { UpdateChainDataexportTaskRequest self = new UpdateChainDataexportTaskRequest(); return TeaModel.build(map, self); } public UpdateChainDataexportTaskRequest setAuthToken(String authToken) { this.authToken = authToken; return this; } public String getAuthToken() { return this.authToken; } public UpdateChainDataexportTaskRequest setProductInstanceId(String productInstanceId) { this.productInstanceId = productInstanceId; return this; } public String getProductInstanceId() { return this.productInstanceId; } public UpdateChainDataexportTaskRequest setConsortiumId(String consortiumId) { this.consortiumId = consortiumId; return this; } public String getConsortiumId() { return this.consortiumId; } public UpdateChainDataexportTaskRequest setAntChainId(String antChainId) { this.antChainId = antChainId; return this; } public String getAntChainId() { return this.antChainId; } public UpdateChainDataexportTaskRequest setTriggerName(String triggerName) { this.triggerName = triggerName; return this; } public String getTriggerName() { return this.triggerName; } public UpdateChainDataexportTaskRequest setTrigger(TriggerDTOStructBody trigger) { this.trigger = trigger; return this; } public TriggerDTOStructBody getTrigger() { return this.trigger; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
b0a91140a2d92d7b7932a9fb51f9b00995559148
6f0153e023510efcd6508043fe0d2eb393c9785f
/src/discoverer/crossvalidation/SampleSplitter.java
d61433412d227546c05b89de168cae760dd4d652
[]
no_license
wmatex/Neurologic
2379bb9a18cb1ee17ac536db491c0682433181d4
4a698e34a59ec562ec450ab841e4c8085329238a
refs/heads/master
2021-01-18T22:29:44.056061
2017-02-01T15:19:14
2017-02-01T15:19:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,700
java
package discoverer.crossvalidation; import discoverer.construction.example.Example; import discoverer.global.Global; import discoverer.global.Glogger; import discoverer.learning.Sample; import java.io.BufferedWriter; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.io.Serializable; import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Set; import java.util.HashSet; import java.util.LinkedList; import java.util.logging.Level; import java.util.logging.Logger; /** * Splitter for performing stratified n-fold crossval */ public class SampleSplitter implements Serializable { public int foldCount; public int testFold = 0; public List<List<Sample>> folds; public List<Sample> samples; public SampleSplitter(List<Sample> train, List<Sample> test) { folds = new ArrayList<>(); folds.add(train); folds.add(test); testFold = 1; foldCount = 2; //should be checked samples = new ArrayList<>(train.size() + test.size()); samples.addAll(train); samples.addAll(test); } /** * stratified split of examples(same #positive examples) for k-fold * cross-validation * * @param k * @param ex */ public SampleSplitter(int k, List<Sample> ex) { numberSamples(ex); Collections.shuffle(ex, Global.getRg()); //omg!! folds = new ArrayList<>(); samples = new ArrayList<>(); samples.addAll(ex); List<Sample> positives = getPositives(ex); List<Sample> negatives = getNegatives(ex); if (ex.size() < k) { Glogger.err("Too many fold and too few examples!!"); return; } int foldLen = (int) Math.floor((double) ex.size() / k); //repaired fold count - extra fold for remaining samples foldCount = k; //foldCount = (int) Math.floor((double) ex.size() / foldLen); int positivesInFold = (int) Math.ceil((double) positives.size() / ex.size() * foldLen); int n = 0; int p = 0; while (n < negatives.size() || p < positives.size()) { List<Sample> fold = new ArrayList<>(); for (int pNeeded = 0; pNeeded < positivesInFold && p < positives.size(); pNeeded++) { fold.add(positives.get(p++)); } while (fold.size() < foldLen && n < negatives.size()) { fold.add(negatives.get(n++)); } Collections.shuffle(fold, Global.getRg()); folds.add(fold); } //distribute the last corrupted fold if (folds.size() > k) { int i = 0; for (Sample negative : folds.get(k)) { List<Sample> ff = folds.get(i++); //problem with retypeing ff.add(negative); } folds.remove(k); } if (Global.isOutputFolds()) { outputSplits(); } } final void outputSplits() { Glogger.createDir("folds"); int i = 1; for (List<Sample> fold : folds) { try { BufferedWriter pw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("folds/fold" + i++), "utf-8")); for (Sample exa : fold) { pw.write(exa.position + " : " + exa.getExample().hash + "\n"); pw.flush(); } } catch (FileNotFoundException ex1) { Logger.getLogger(SampleSplitter.class.getName()).log(Level.SEVERE, null, ex1); } catch (UnsupportedEncodingException ex1) { Logger.getLogger(SampleSplitter.class.getName()).log(Level.SEVERE, null, ex1); } catch (IOException ex1) { Logger.getLogger(SampleSplitter.class.getName()).log(Level.SEVERE, null, ex1); } } } private List<Sample> getPositives(List<Sample> ex) { List<Sample> positives = new ArrayList<>(); for (Sample e : ex) { if (e.getExample().getExpectedValue() == 1) { positives.add(e); } } return positives; } private List<Sample> getNegatives(List<Sample> ex) { List<Sample> negatives = new ArrayList<>(); for (Sample e : ex) { if (e.getExample().getExpectedValue() == 0) { negatives.add(e); } } return negatives; } public boolean hasNext() { return testFold < foldCount; } public void next() { testFold++; } public List<Sample> getTrain() { List<Sample> tmp = new ArrayList<Sample>(); int i = 0; for (List<Sample> fold : folds) { if (i++ != testFold || foldCount == 1) { //or just a training set (that shouldnt cause anything in crossval) tmp.addAll(fold); } } Collections.shuffle(tmp, Global.getRg()); return tmp; } public List<Sample> getTest() { return folds.get(testFold); } private void numberSamples(List<Sample> ex) { if (Global.isOutputFolds()) { Glogger.process("---------------------------whole sample set------------------------------"); } for (int i = 0; i < ex.size(); i++) { ex.get(i).position = i; if (Global.isOutputFolds()) { Glogger.info("sample " + i + " : " + ex.get(i).toString()); } } } public static List<List<Example>> splitExampleList(List<Example> examples1, int folds) { List<List<Example>> workFolds = new LinkedList<>(); for (int i = 0; i < folds; i++) { workFolds.add(new LinkedList<>()); } for (int i = 0; i < examples1.size(); i++) { workFolds.get(i % folds).add(examples1.get(i)); } return workFolds; } public static List<List<Sample>> splitSampleList(List<Sample> examples1, int folds) { List<List<Sample>> workFolds = new LinkedList<>(); for (int i = 0; i < folds; i++) { workFolds.add(new LinkedList<>()); } for (int i = 0; i < examples1.size(); i++) { workFolds.get(i % folds).add(examples1.get(i)); } return workFolds; } }
[ "souregus@gmail.com" ]
souregus@gmail.com
cf78237a4329feac23996807f1185843be2030d5
6482753b5eb6357e7fe70e3057195e91682db323
/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java
3e3941e2f8700c86ac3edb48ee3f91ac08ba6ef7
[]
no_license
TheShermanTanker/Server-1.16.3
45cf9996afa4cd4d8963f8fd0588ae4ee9dca93c
48cc08cb94c3094ebddb6ccfb4ea25538492bebf
refs/heads/master
2022-12-19T02:20:01.786819
2020-09-18T21:29:40
2020-09-18T21:29:40
296,730,962
0
1
null
null
null
null
UTF-8
Java
false
false
5,891
java
package net.minecraft.world.entity.projectile; import net.minecraft.network.protocol.game.ClientboundAddEntityPacket; import net.minecraft.network.protocol.Packet; import net.minecraft.world.damagesource.DamageSource; import net.minecraft.nbt.ListTag; import net.minecraft.nbt.Tag; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.phys.Vec3; import net.minecraft.core.particles.ParticleOptions; import net.minecraft.core.particles.ParticleTypes; import net.minecraft.world.phys.HitResult; import java.util.function.Predicate; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.LivingEntity; import net.minecraft.util.Mth; import net.minecraft.world.level.Level; import net.minecraft.world.entity.EntityType; public abstract class AbstractHurtingProjectile extends Projectile { public double xPower; public double yPower; public double zPower; protected AbstractHurtingProjectile(final EntityType<? extends AbstractHurtingProjectile> aqb, final Level bru) { super(aqb, bru); } public AbstractHurtingProjectile(final EntityType<? extends AbstractHurtingProjectile> aqb, final double double2, final double double3, final double double4, final double double5, final double double6, final double double7, final Level bru) { this(aqb, bru); this.moveTo(double2, double3, double4, this.yRot, this.xRot); this.reapplyPosition(); final double double8 = Mth.sqrt(double5 * double5 + double6 * double6 + double7 * double7); if (double8 != 0.0) { this.xPower = double5 / double8 * 0.1; this.yPower = double6 / double8 * 0.1; this.zPower = double7 / double8 * 0.1; } } public AbstractHurtingProjectile(final EntityType<? extends AbstractHurtingProjectile> aqb, final LivingEntity aqj, final double double3, final double double4, final double double5, final Level bru) { this(aqb, aqj.getX(), aqj.getY(), aqj.getZ(), double3, double4, double5, bru); this.setOwner(aqj); this.setRot(aqj.yRot, aqj.xRot); } @Override protected void defineSynchedData() { } @Override public void tick() { final Entity apx2 = this.getOwner(); if (!this.level.isClientSide && ((apx2 != null && apx2.removed) || !this.level.hasChunkAt(this.blockPosition()))) { this.remove(); return; } super.tick(); if (this.shouldBurn()) { this.setSecondsOnFire(1); } final HitResult dci3 = ProjectileUtil.getHitResult(this, (Predicate<Entity>)this::canHitEntity); if (dci3.getType() != HitResult.Type.MISS) { this.onHit(dci3); } this.checkInsideBlocks(); final Vec3 dck4 = this.getDeltaMovement(); final double double5 = this.getX() + dck4.x; final double double6 = this.getY() + dck4.y; final double double7 = this.getZ() + dck4.z; ProjectileUtil.rotateTowardsMovement(this, 0.2f); float float11 = this.getInertia(); if (this.isInWater()) { for (int integer12 = 0; integer12 < 4; ++integer12) { final float float12 = 0.25f; this.level.addParticle(ParticleTypes.BUBBLE, double5 - dck4.x * 0.25, double6 - dck4.y * 0.25, double7 - dck4.z * 0.25, dck4.x, dck4.y, dck4.z); } float11 = 0.8f; } this.setDeltaMovement(dck4.add(this.xPower, this.yPower, this.zPower).scale(float11)); this.level.addParticle(this.getTrailParticle(), double5, double6 + 0.5, double7, 0.0, 0.0, 0.0); this.setPos(double5, double6, double7); } @Override protected boolean canHitEntity(final Entity apx) { return super.canHitEntity(apx) && !apx.noPhysics; } protected boolean shouldBurn() { return true; } protected ParticleOptions getTrailParticle() { return ParticleTypes.SMOKE; } protected float getInertia() { return 0.95f; } public void addAdditionalSaveData(final CompoundTag md) { super.addAdditionalSaveData(md); md.put("power", (Tag)this.newDoubleList(this.xPower, this.yPower, this.zPower)); } public void readAdditionalSaveData(final CompoundTag md) { super.readAdditionalSaveData(md); if (md.contains("power", 9)) { final ListTag mj3 = md.getList("power", 6); if (mj3.size() == 3) { this.xPower = mj3.getDouble(0); this.yPower = mj3.getDouble(1); this.zPower = mj3.getDouble(2); } } } @Override public boolean isPickable() { return true; } @Override public float getPickRadius() { return 1.0f; } @Override public boolean hurt(final DamageSource aph, final float float2) { if (this.isInvulnerableTo(aph)) { return false; } this.markHurt(); final Entity apx4 = aph.getEntity(); if (apx4 != null) { final Vec3 dck5 = apx4.getLookAngle(); this.setDeltaMovement(dck5); this.xPower = dck5.x * 0.1; this.yPower = dck5.y * 0.1; this.zPower = dck5.z * 0.1; this.setOwner(apx4); return true; } return false; } @Override public float getBrightness() { return 1.0f; } @Override public Packet<?> getAddEntityPacket() { final Entity apx2 = this.getOwner(); final int integer3 = (apx2 == null) ? 0 : apx2.getId(); return new ClientboundAddEntityPacket(this.getId(), this.getUUID(), this.getX(), this.getY(), this.getZ(), this.xRot, this.yRot, this.getType(), integer3, new Vec3(this.xPower, this.yPower, this.zPower)); } }
[ "tanksherman27@gmail.com" ]
tanksherman27@gmail.com
42e7ba2153025c5c4253bc845a7a27347dc67683
b7f3edb5b7c62174bed808079c3b21fb9ea51d52
/services/device/usb/android/java/src/org/chromium/device/usb/ChromeUsbInterface.java
cd4f49270edead7572e387577e17edf090c1dab9
[ "BSD-3-Clause" ]
permissive
otcshare/chromium-src
26a7372773b53b236784c51677c566dc0ad839e4
64bee65c921db7e78e25d08f1e98da2668b57be5
refs/heads/webml
2023-03-21T03:20:15.377034
2020-11-16T01:40:14
2020-11-16T01:40:14
209,262,645
18
21
BSD-3-Clause
2023-03-23T06:20:07
2019-09-18T08:52:07
null
UTF-8
Java
false
false
1,881
java
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package org.chromium.device.usb; import android.hardware.usb.UsbEndpoint; import android.hardware.usb.UsbInterface; import org.chromium.base.Log; import org.chromium.base.annotations.CalledByNative; import org.chromium.base.annotations.JNINamespace; /** * Exposes android.hardware.usb.UsbInterface as necessary for C++ * device::UsbInterfaceAndroid. * * Lifetime is controlled by device::UsbInterfaceAndroid. */ @JNINamespace("device") final class ChromeUsbInterface { private static final String TAG = "Usb"; final UsbInterface mInterface; private ChromeUsbInterface(UsbInterface iface) { mInterface = iface; Log.v(TAG, "ChromeUsbInterface created."); } @CalledByNative private static ChromeUsbInterface create(UsbInterface iface) { return new ChromeUsbInterface(iface); } @CalledByNative private int getInterfaceNumber() { return mInterface.getId(); } @CalledByNative private int getAlternateSetting() { return mInterface.getAlternateSetting(); } @CalledByNative private int getInterfaceClass() { return mInterface.getInterfaceClass(); } @CalledByNative private int getInterfaceSubclass() { return mInterface.getInterfaceSubclass(); } @CalledByNative private int getInterfaceProtocol() { return mInterface.getInterfaceProtocol(); } @CalledByNative private UsbEndpoint[] getEndpoints() { int count = mInterface.getEndpointCount(); UsbEndpoint[] endpoints = new UsbEndpoint[count]; for (int i = 0; i < count; ++i) { endpoints[i] = mInterface.getEndpoint(i); } return endpoints; } }
[ "commit-bot@chromium.org" ]
commit-bot@chromium.org
22133539364a1dd273661900233abf1795b49a0f
95d03ed71a9db3cb7b4c81dbd33feb9a5b08b951
/extra/customer-client/src/test/java/com/example/client/CustomerClientContractStubDiscoveryTest.java
bb5a0408d4f8a6890445448d94e96a8d88f4f478
[ "Apache-2.0" ]
permissive
applied-continuous-delivery-livelessons/cdct
f622a2693e0c2901b1e3e86daafc83676e7a4256
91c97a3966c9193d349fccf8d340154cbb995054
refs/heads/master
2021-01-15T22:01:53.776908
2017-08-14T20:04:26
2017-08-14T20:04:26
99,882,843
4
1
null
null
null
null
UTF-8
Java
false
false
2,337
java
package com.example.client; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.client.loadbalancer.LoadBalanced; import org.springframework.cloud.contract.stubrunner.spring.AutoConfigureStubRunner; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.web.client.RestTemplate; import java.util.Collection; import static org.hamcrest.Matchers.contains; /** * @author <a href="josh@joshlong.com">Josh Long</a> */ @RunWith(SpringRunner.class) @ActiveProfiles("discovery") @AutoConfigureStubRunner(ids = "com.example:customer-service-restdocs-messaging-discovery", workOffline = true) @SpringBootTest(classes = {CustomerClientConfiguration.class, DiscoveryAwareCustomerClientConfiguration.class}, properties = {"customer-service.host=http://customer-service"}) public class CustomerClientContractStubDiscoveryTest { @Autowired private CustomerClient client; @Test public void getCustomers() throws Exception { Collection<Customer> customers = this.client.getCustomers(); Assert.assertThat(customers, contains( new com.example.client.Customer(1L, "first", "last", "email@email.com"), new com.example.client.Customer(2L, "first", "last", "email@email.com"))); } @Test public void getCustomerById() { Customer customerById = this.client.getCustomerById(1L); Assert.assertThat(customerById, org.hamcrest.Matchers.notNullValue()); } } /** * @author <a href="josh@joshlong.com">Josh Long</a> */ @Configuration @EnableDiscoveryClient @EnableAutoConfiguration class DiscoveryAwareCustomerClientConfiguration { @Bean @LoadBalanced @Profile("discovery") RestTemplate restTemplate() { return new RestTemplate(); } }
[ "josh@joshlong.com" ]
josh@joshlong.com
5cba516c116e72a1f2746b315fcdbe455b5cce5f
d71e879b3517cf4fccde29f7bf82cff69856cfcd
/ExtractedJars/RT_News_com.rt.mobile.english/javafiles/com/google/android/gms/cast/CastRemoteDisplayLocalService$zzb.java
73279c33c41cc2361cbabb6cc1dd919136528a0c
[ "MIT" ]
permissive
Andreas237/AndroidPolicyAutomation
b8e949e072d08cf6c6166c3f15c9c63379b8f6ce
c1ed10a2c6d4cf3dfda8b8e6291dee2c2a15ee8a
refs/heads/master
2020-04-10T02:14:08.789751
2019-05-16T19:29:11
2019-05-16T19:29:11
160,739,088
5
1
null
null
null
null
UTF-8
Java
false
false
2,127
java
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.kpdus.com/jad.html // Decompiler options: packimports(3) annotate safe package com.google.android.gms.cast; import android.content.*; // Referenced classes of package com.google.android.gms.cast: // CastRemoteDisplayLocalService, zzu private static final class CastRemoteDisplayLocalService$zzb extends BroadcastReceiver { public final void onReceive(Context context, Intent intent) { if(intent.getAction().equals("com.google.android.gms.cast.remote_display.ACTION_NOTIFICATION_DISCONNECT")) //* 0 0:aload_2 //* 1 1:invokevirtual #22 <Method String Intent.getAction()> //* 2 4:ldc1 #24 <String "com.google.android.gms.cast.remote_display.ACTION_NOTIFICATION_DISCONNECT"> //* 3 6:invokevirtual #30 <Method boolean String.equals(Object)> //* 4 9:ifeq 16 { CastRemoteDisplayLocalService.stopService(); // 5 12:invokestatic #33 <Method void CastRemoteDisplayLocalService.stopService()> return; // 6 15:return } if(intent.getAction().equals("com.google.android.gms.cast.remote_display.ACTION_SESSION_ENDED")) //* 7 16:aload_2 //* 8 17:invokevirtual #22 <Method String Intent.getAction()> //* 9 20:ldc1 #35 <String "com.google.android.gms.cast.remote_display.ACTION_SESSION_ENDED"> //* 10 22:invokevirtual #30 <Method boolean String.equals(Object)> //* 11 25:ifeq 32 CastRemoteDisplayLocalService.zzd(false); // 12 28:iconst_0 // 13 29:invokestatic #39 <Method void CastRemoteDisplayLocalService.zzd(boolean)> // 14 32:return } private CastRemoteDisplayLocalService$zzb() { // 0 0:aload_0 // 1 1:invokespecial #11 <Method void BroadcastReceiver()> // 2 4:return } CastRemoteDisplayLocalService$zzb(zzu zzu) { this(); // 0 0:aload_0 // 1 1:invokespecial #14 <Method void CastRemoteDisplayLocalService$zzb()> // 2 4:return } }
[ "silenta237@gmail.com" ]
silenta237@gmail.com
3cc5f3a3e5b6b825f0531db6dc9ed03859857b04
7b12f67da8c10785efaebe313547a15543a39c77
/jjg-common-db/src/main/java/com/jjg/member/model/domain/EsCommentCategoryClassifyDO.java
08fedef38a5245a8528056a083bcfc932ce79d1c
[]
no_license
liujinguo1994/xdl-jjg
071eaa5a8fb566db6b47dbe046daf85dd2b9bcd8
051da0a0dba18e6e5021ecb4ef3debca16b01a93
refs/heads/master
2023-01-06T09:11:30.487559
2020-11-06T14:42:45
2020-11-06T14:42:45
299,525,315
1
3
null
null
null
null
UTF-8
Java
false
false
662
java
package com.jjg.member.model.domain; import com.jjg.member.model.domain.EsCommentCategoryDO; import lombok.Data; import java.io.Serializable; import java.util.List; /** * <p> * 商品评论标签关联分类 * </p> * * @author lins 1220316142@qq.com * @since 2019-06-04 */ @Data public class EsCommentCategoryClassifyDO implements Serializable { private static final long serialVersionUID = 1L; /** * 0商品 */ private List<EsCommentCategoryDO> goodLabels; /** * 1物流 */ private List<EsCommentCategoryDO> expressLabels; /** * 2服务 */ private List<EsCommentCategoryDO> serviceLabels; }
[ "344009799@qq.com" ]
344009799@qq.com
40671bb595de5bc708597150417e8f86120e8e76
3bb9e1a187cb72e2620a40aa208bf94e5cee46f5
/mobile_catalog/src/ong/eu/soon/mobile/json/ifx/element/ResponsibleBank.java
ad1600a87cde7344dc29ab28c3dff6f968d5b124
[]
no_license
eusoon/Mobile-Catalog
2e6f766864ea25f659f87548559502358ac5466c
869d7588447117b751fcd1387cd84be0bd66ef26
refs/heads/master
2021-01-22T23:49:12.717052
2013-12-10T08:22:20
2013-12-10T08:22:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
196
java
package ong.eu.soon.mobile.json.ifx.element; import ong.eu.soon.mobile.json.ifx.basetypes.IFXString; public class ResponsibleBank extends IFXString { protected ResponsibleBank(){ } }
[ "eusoon@gmail.com" ]
eusoon@gmail.com
8057142394a83fd693af8f32e695c191baea8a4e
ab224e3b32239be3d9473f1874e26a522d504e99
/LBPractice/DynamicProgramming/LargestIndependentSetProblem.java
363a9db4598401dc7417575792399216219ca7d8
[]
no_license
ShivamPorwal02/Data-Structures-and-Algorithms
244042b42cf89262550263586c3191a83a85789e
871f1a57c27391eb69e01ed8a1e3a306e24efe7a
refs/heads/master
2023-06-28T19:48:55.472935
2021-08-09T17:29:56
2021-08-09T17:29:56
393,118,805
0
0
null
null
null
null
UTF-8
Java
false
false
789
java
package LoveBabbar.DynamicProgramming; public class LargestIndependentSetProblem { class Node { int data; Node left, right; public Node(int data){ this.data = data; } } public int LISS(Node node){ //Write your code here if(node==null) return 0; int lft = LISS(node.left); int rgt = LISS(node.right); int size_incl = 1; if (node.left!=null) size_incl += LISS(node.left.left) + LISS(node.left.right); if (node.right!=null) size_incl += LISS(node.right.left) + LISS(node.right.right); return Math.max(lft+rgt,size_incl); } // isko hm hashmap node aur int ka bna k save krk bhi krr skte hai }
[ "porwal1234shivam@gmail.com" ]
porwal1234shivam@gmail.com
e4a7fa315e074733e24e525364318a97c11c8911
e56f8a02c22c4e9d851df4112dee0c799efd7bfe
/vip/trade/src/main/java/com/alipay/api/request/AlipayCommerceCityfacilitatorDepositConfirmRequest.java
1c6d452271709110610f6660c51d3a3b47c2b113
[]
no_license
wu-xian-da/vip-server
8a07e2f8dc75722328a3fa7e7a9289ec6ef1d1b1
54a6855224bc3ae42005b341a2452f25cfeac2c7
refs/heads/master
2020-12-31T00:29:36.404038
2017-03-27T07:00:02
2017-03-27T07:00:02
85,170,395
0
0
null
null
null
null
UTF-8
Java
false
false
2,698
java
package com.alipay.api.request; import com.alipay.api.domain.AlipayCommerceCityfacilitatorScardcenterDepositConfirmModel; import java.util.Map; import com.alipay.api.AlipayRequest; import com.alipay.api.internal.util.AlipayHashMap; import com.alipay.api.response.AlipayCommerceCityfacilitatorDepositConfirmResponse; /** * ALIPAY API: alipay.commerce.cityfacilitator.deposit.confirm request * * @author auto create * @since 1.0, 2015-12-18 21:36:24 */ public class AlipayCommerceCityfacilitatorDepositConfirmRequest implements AlipayRequest<AlipayCommerceCityfacilitatorDepositConfirmResponse> { private AlipayHashMap udfParams; // add user-defined text parameters private String apiVersion="1.0"; /** * 合作渠道可通过该接口补登单笔圈存确认扣款请求,以帮助支付宝将用户的资金结算给指定的渠道,不支持单笔拆分 */ private String bizContent; public void setBizContent(String bizContent) { this.bizContent = bizContent; } public String getBizContent() { return this.bizContent; } private String terminalType; private String terminalInfo; private String prodCode; private String notifyUrl; public String getNotifyUrl() { return this.notifyUrl; } public void setNotifyUrl(String notifyUrl) { this.notifyUrl = notifyUrl; } public String getApiVersion() { return this.apiVersion; } public void setApiVersion(String apiVersion) { this.apiVersion = apiVersion; } public void setTerminalType(String terminalType){ this.terminalType=terminalType; } public String getTerminalType(){ return this.terminalType; } public void setTerminalInfo(String terminalInfo){ this.terminalInfo=terminalInfo; } public String getTerminalInfo(){ return this.terminalInfo; } public void setProdCode(String prodCode) { this.prodCode=prodCode; } public String getProdCode() { return this.prodCode; } public String getApiMethodName() { return "alipay.commerce.cityfacilitator.deposit.confirm"; } public Map<String, String> getTextParams() { AlipayHashMap txtParams = new AlipayHashMap(); txtParams.put("biz_content", this.bizContent); if(udfParams != null) { txtParams.putAll(this.udfParams); } return txtParams; } public void putOtherTextParam(String key, String value) { if(this.udfParams == null) { this.udfParams = new AlipayHashMap(); } this.udfParams.put(key, value); } public Class<AlipayCommerceCityfacilitatorDepositConfirmResponse> getResponseClass() { return AlipayCommerceCityfacilitatorDepositConfirmResponse.class; } }
[ "programboy@126.com" ]
programboy@126.com
e794995dbe61219f74e86262323143c63647e90b
7361f1f26adfbdb78cb96db18cd83c5a4374e7b4
/src/main/java/io/vertx/lang/ruby/Helper.java
cc990fc7d0462f15dd9348af949584f3024db19a
[]
no_license
cescoffier/vertx-lang-ruby
7817c0ba4e9f741c4470aaa77862e6472579a3d9
c729a14055fc08275a6d27804d6f7236ff4dc3f4
refs/heads/master
2021-01-16T21:45:07.038070
2015-06-09T20:03:09
2015-06-09T20:03:09
37,303,555
0
0
null
2015-06-12T05:21:56
2015-06-12T05:21:56
null
UTF-8
Java
false
false
365
java
package io.vertx.lang.ruby; import java.util.Map; import java.util.function.Function; /** * @author <a href="mailto:julien@julienviet.com">Julien Viet</a> */ public class Helper { public static Map adaptingMap(Map map, Function toRuby, Function toJava) { if (map == null) { return null; } return new AdaptingMap(map, toRuby, toJava); } }
[ "julien@julienviet.com" ]
julien@julienviet.com
2e933e834029814cdd2c8162dd2820d81669c260
d46558b01a692657aa3c8dd9e51d871e50b50896
/src/main/java/com/gene/mobilemaster/model/Forumclass.java
f6ed1376ebb0650b18b809579ba44a3e287422b0
[]
no_license
quweijun/cms_order_zgmall_bak
c5355740d409038f1676f6c60542edc7c68f86fe
57335178214eba5ef7f31148a10e71cddcf1409d
refs/heads/master
2023-08-03T11:43:50.133601
2018-12-12T07:37:29
2018-12-12T07:37:29
158,420,844
0
0
null
2023-07-20T04:45:02
2018-11-20T16:38:10
Java
UTF-8
Java
false
false
1,462
java
package com.gene.mobilemaster.model; import java.util.Date; public class Forumclass { private Integer classid; private String classname; private String creater; private Date adddate; private Integer isquestion; private Integer islogin; private Integer memberGrade; public Integer getClassid() { return classid; } public void setClassid(Integer classid) { this.classid = classid; } public String getClassname() { return classname; } public void setClassname(String classname) { this.classname = classname == null ? null : classname.trim(); } public String getCreater() { return creater; } public void setCreater(String creater) { this.creater = creater == null ? null : creater.trim(); } public Date getAdddate() { return adddate; } public void setAdddate(Date adddate) { this.adddate = adddate; } public Integer getIsquestion() { return isquestion; } public void setIsquestion(Integer isquestion) { this.isquestion = isquestion; } public Integer getIslogin() { return islogin; } public void setIslogin(Integer islogin) { this.islogin = islogin; } public Integer getMemberGrade() { return memberGrade; } public void setMemberGrade(Integer memberGrade) { this.memberGrade = memberGrade; } }
[ "29048829@qq.com" ]
29048829@qq.com
38c8e0fd5c194dfd0ec5d2711d66ed2d32700d20
5d3d9098df3cf4d62e2885642758345bb5893ed7
/src/main/java/com/example/alg/arraypkg/ClosestLocations.java
98eaa25f59496129110d95f8dcad060eb8031ced
[]
no_license
eight9080/test
75e682795412d17a0edcfad9aa73106b79b9cf70
ebe6d50bf50a837f3857957cddef323c96dc8128
refs/heads/master
2021-07-08T13:12:55.294995
2021-04-23T19:53:24
2021-04-23T19:53:24
78,650,101
0
0
null
2021-03-31T19:35:24
2017-01-11T15:06:16
Java
UTF-8
Java
false
false
1,668
java
package com.example.alg.arraypkg; import java.util.*; public class ClosestLocations { public static List<List<Integer>> closestLocations(int totalCrates, List<List<Integer>> allLocations, int truckCapacity) { if (allLocations == null || allLocations.isEmpty() || truckCapacity == 0) { return null; } Map<Double, List<Integer>> positionsByDistances = new HashMap<>(); for (int i = 0; i < allLocations.size(); i++) { final List<Integer> location = allLocations.get(i); final double distance = calculateDistance(location); positionsByDistances.putIfAbsent(distance, new ArrayList<>()); positionsByDistances.get(distance).add(i); } final ArrayList<Double> distances = new ArrayList<>(positionsByDistances.keySet()); Collections.sort(distances); List<List<Integer>> result = new ArrayList<>(); for (Double distance : distances) { if (truckCapacity > result.size()) { final List<Integer> positions = positionsByDistances.get(distance); for (Integer position : positions) { if (truckCapacity > result.size()) { result.add(allLocations.get(position)); } } } } return result; } private static double calculateDistance(List<Integer> location) { final Double sumSquares = location.stream().map(pos -> Math.pow(pos, 2)) .reduce(0d, (a, b) -> a + b); return Math.sqrt(sumSquares); } }
[ "eight9080@gmail.com" ]
eight9080@gmail.com
a428d2898fbb2d0d188a718e0ebcd7e62c09d8c8
37278ea984120d20661bd568a8908d696c0062f7
/javamalls/platform/service/IOrderFormCancelAuditService.java
3cf2249a97323b9cf60f4279423ec8ba6a0a9634
[]
no_license
cjp472/dinghuobao
412f13b142e57b5868d609fdced51b9ee707ddb7
1d36ef79282955d308c07482e6443648202eb243
refs/heads/master
2020-03-19T09:48:21.018770
2018-05-05T07:18:48
2018-05-05T07:18:48
136,318,589
2
3
null
2018-06-06T11:23:23
2018-06-06T11:23:23
null
UTF-8
Java
false
false
935
java
package com.javamalls.platform.service; import java.io.Serializable; import java.util.List; import java.util.Map; import com.javamalls.base.query.support.IPageList; import com.javamalls.base.query.support.IQueryObject; import com.javamalls.platform.domain.OrderFormCancelAudit; public abstract interface IOrderFormCancelAuditService { public abstract boolean save(OrderFormCancelAudit paramOrderFormCancelAudit); public abstract OrderFormCancelAudit getObjById(Long paramLong); public abstract boolean delete(Long paramLong); public abstract boolean batchDelete(List<Serializable> paramList); public abstract IPageList list(IQueryObject paramIQueryObject); public abstract boolean update(OrderFormCancelAudit paramOrderFormCancelAudit); public abstract List<OrderFormCancelAudit> query(String paramString, Map paramMap, int paramInt1, int paramInt2); }
[ "huyang3868@163.com" ]
huyang3868@163.com
c7af7cfc66d6c9ff96891842aedc3b4214637dbe
7aa02f902ad330c70b0b34ec2d4eb3454c7a3fc1
/com/github/mikephil/charting/p036b/C0469a.java
03c6065fe1e8f8e0b6fb8ad02260bc5fc20252b7
[]
no_license
hisabimbola/andexpensecal
5e42c7e687296fae478dfd39abee45fae362bc5b
c47e6f0a1a6e24fe1377d35381b7e7e37f1730ee
refs/heads/master
2021-01-19T15:20:25.262893
2016-08-11T16:00:49
2016-08-11T16:00:49
100,962,347
1
0
null
2017-08-21T14:48:33
2017-08-21T14:48:33
null
UTF-8
Java
false
false
984
java
package com.github.mikephil.charting.p036b; /* renamed from: com.github.mikephil.charting.b.a */ public abstract class C0469a<T> { protected int f5565a; public final float[] f5566b; protected float f5567c; protected float f5568d; protected int f5569e; protected int f5570f; public C0469a(int i) { this.f5565a = 0; this.f5567c = 1.0f; this.f5568d = 1.0f; this.f5569e = 0; this.f5570f = 0; this.f5565a = 0; this.f5566b = new float[i]; } public void m4256a() { this.f5565a = 0; } public void m4257a(float f, float f2) { this.f5567c = f; this.f5568d = f2; } public void m4258a(int i) { if (i < 0) { i = 0; } this.f5569e = i; } public int m4259b() { return this.f5566b.length; } public void m4260b(int i) { if (i < 0) { i = 0; } this.f5570f = i; } }
[ "m.ravinther@yahoo.com" ]
m.ravinther@yahoo.com
4792fc0e59117133b37f4fb1c8475510a8ecadd8
ab9387a1505654d8ae714d2fd138a9eeb824f4de
/src/magic/model/event/MagicPopulateEvent.java
3eed48883b325dc762b315858ddd2283aaef738e
[]
no_license
hixio-mh/Magarena
d33b98aeff766c1828e998fada9a76b1c943baaf
97be52ee82bc7526caa079ca33e42ea521a490bc
refs/heads/master
2022-12-21T00:33:09.565690
2020-09-26T14:31:49
2020-09-26T14:31:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,173
java
package magic.model.event; import magic.model.MagicGame; import magic.model.MagicSource; import magic.model.MagicPermanent; import magic.model.action.MagicPermanentAction; import magic.model.action.MagicPlayTokenAction; import magic.model.choice.MagicTargetChoice; import magic.model.target.MagicCopyTargetPicker; public class MagicPopulateEvent extends MagicEvent { public MagicPopulateEvent(final MagicSource source) { super( source, MagicTargetChoice.CREATURE_TOKEN_YOU_CONTROL, MagicCopyTargetPicker.create(), EA, "Put a token onto the battlefield that's a copy of a creature token$ you control." ); } private static final MagicEventAction EA = new MagicEventAction() { @Override public void executeEvent(final MagicGame game, final MagicEvent event) { event.processTargetPermanent(game,new MagicPermanentAction() { public void doAction(final MagicPermanent creature) { game.doAction(new MagicPlayTokenAction(event.getPlayer(), creature.getCardDefinition())); } }); } }; }
[ "iargosyi@gmail.com" ]
iargosyi@gmail.com
6db54e415241e0d1369b7c240cc34f609214152d
e9d1b2db15b3ae752d61ea120185093d57381f73
/mytcuml-src/src/java/components/properties_panel/trunk/src/java/tests/com/topcoder/gui/panels/properties/failuretests/propertypanel/links/ActionLinkPropertyPanelFailureTests.java
e32d5066f3e508ab0ed50f2b48e30a02709e106c
[]
no_license
kinfkong/mytcuml
9c65804d511ad997e0c4ba3004e7b831bf590757
0786c55945510e0004ff886ff01f7d714d7853ab
refs/heads/master
2020-06-04T21:34:05.260363
2014-10-21T02:31:16
2014-10-21T02:31:16
25,495,964
1
0
null
null
null
null
UTF-8
Java
false
false
938
java
/* * Copyright (C) 2007 TopCoder Inc., All Rights Reserved. */ package com.topcoder.gui.panels.properties.failuretests.propertypanel.links; import com.topcoder.gui.panels.properties.propertypanel.links.ActionLinkPropertyPanel; import junit.framework.TestCase; /** * Failure tests for ActionLinkPropertyPanel class. * * @author Yeung * @version 1.0 */ public class ActionLinkPropertyPanelFailureTests extends TestCase { /** * Tests the constructor ActionLinkPropertyPanel(PropertiesPanel) with null propertiesPanel, expected * IllegalArgumentException. * * @throws Exception * if any error occurred when set up */ public void testCtor_NullPropertiesPanel() throws Exception { try { new ActionLinkPropertyPanel(null); fail("Expect IllegalArgumentException."); } catch (IllegalArgumentException iae) { // expect } } }
[ "kinfkong@126.com" ]
kinfkong@126.com
13482c750ea4536c76ca03a651a92776f7b703fc
7fc5566131b73eba0afc71cb2a73bc2a39da16d7
/app/src/main/java/com/mananwason/dcluttr/dcluttr/SubActivity.java
13e99b588b3d5526e410d1b2e7298fb690095d32
[]
no_license
mananwason/DCluttR
487eda8890e5c4fc462dde4bb3e67fde5ee3737b
cf1d53f31b0acad7e1c06be339c2a92c1db45883
refs/heads/master
2020-12-11T09:02:29.142776
2015-11-07T17:34:25
2015-11-07T17:34:25
45,746,518
0
0
null
null
null
null
UTF-8
Java
false
false
6,596
java
package com.mananwason.dcluttr.dcluttr; import android.content.Context; import android.graphics.Color; import android.net.Uri; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.Toast; import com.squareup.picasso.Picasso; import java.util.ArrayList; import java.util.List; /** * Created by Manan Wason on 31/10/15. */ public class SubActivity extends AppCompatActivity { List<List<String>> mDataList; private RecyclerView mVerticalList; private ImageView image1; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_sub); //image1= (ImageView) findViewById(R.id.im) prepareData(); initListView(); } private void prepareData() { mDataList = new ArrayList<>(); int vItemCount = 25; int hItemCount = 20; for (int i = 0; i < vItemCount; i++) { List<String> hList = new ArrayList<>(); for (int j = 0; j < hItemCount; j++) { hList.add("Item." + j); } mDataList.add(hList); } } private void initListView() { mVerticalList = (RecyclerView) findViewById(R.id.vertical_list); mVerticalList.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)); VerticalAdapter verticalAdapter = new VerticalAdapter(); verticalAdapter.setData(mDataList); mVerticalList.setAdapter(verticalAdapter); } private static class VerticalAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { private List<List<String>> mDataList; public VerticalAdapter() { } public void setData(List<List<String>> data) { mDataList = data; notifyDataSetChanged(); } private class HorizontalListViewHolder extends RecyclerView.ViewHolder { // private TextView title; private RecyclerView horizontalList; private HorizontalAdapter horizontalAdapter; public HorizontalListViewHolder(View itemView) { super(itemView); Context context = itemView.getContext(); // title = (TextView) itemView.findViewById(R.id.item_title); horizontalList = (RecyclerView) itemView.findViewById(R.id.item_horizontal_list); horizontalList.setLayoutManager(new LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false)); horizontalAdapter = new HorizontalAdapter(); horizontalList.setAdapter(horizontalAdapter); } } @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { Context context = parent.getContext(); View itemView = LayoutInflater.from(context).inflate(R.layout.vertical_list_item, parent, false); HorizontalListViewHolder holder = new HorizontalListViewHolder(itemView); return holder; } @Override public void onBindViewHolder(RecyclerView.ViewHolder rawHolder, int position) { HorizontalListViewHolder holder = (HorizontalListViewHolder) rawHolder; // holder.title.setText("Horizontal List No." + position); holder.horizontalAdapter.setData(mDataList.get(position)); holder.horizontalAdapter.setRowIndex(position); } @Override public int getItemCount() { return mDataList.size(); } } private static class HorizontalAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { private List<String> mDataList; private int mRowIndex = -1; private int[] mColors = new int[]{Color.RED, Color.BLUE, Color.GREEN, Color.MAGENTA, Color.DKGRAY}; public HorizontalAdapter() { } public void setData(List<String> data) { if (mDataList != data) { mDataList = data; notifyDataSetChanged(); } } public void setRowIndex(int index) { mRowIndex = index; } private class ItemViewHolder extends RecyclerView.ViewHolder { private ImageView image; public ItemViewHolder(View itemView) { super(itemView); image = (ImageView) itemView.findViewById(R.id.image1); itemView.setOnClickListener(mItemClickListener); } } @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { Context context = parent.getContext(); View itemView = LayoutInflater.from(context).inflate(R.layout.horizontal_list_item, parent, false); ItemViewHolder holder = new ItemViewHolder(itemView); return holder; } @Override public void onBindViewHolder(RecyclerView.ViewHolder rawHolder, int position) { ItemViewHolder holder = (ItemViewHolder) rawHolder; Uri uri = Uri.parse("http://pctechmag.com/wp-content/uploads/2013/09/android-double-down.jpg"); Picasso.with(holder.image.getContext()).load(uri).error(R.drawable.github).into(holder.image); // holder.image.set("ABC"); // holder.itemView.setBackgroundColor(mColors[position % mColors.length]); holder.itemView.setTag(position); } @Override public int getItemCount() { return mDataList.size(); } private View.OnClickListener mItemClickListener = new View.OnClickListener() { @Override public void onClick(View v) { int columnIndex = (int) v.getTag(); int rowIndex = mRowIndex; String text = String.format("rowIndex:%d ,columnIndex:%d", rowIndex, columnIndex); showToast(v.getContext(), text); Log.d("test", text); } }; } private static Toast sToast; public static void showToast(Context context, String text) { if (sToast != null) { sToast.cancel(); } sToast = Toast.makeText(context, text, Toast.LENGTH_LONG); sToast.show(); } }
[ "manan13056@iiitd.ac.in" ]
manan13056@iiitd.ac.in
32268e04082cb2cf793d95e4f1f68fd2a45dd7a9
63b9289fe4395b599545de10de7f1b46d3c367d3
/ch8/src/collection/StackEx1.java
7dcc529db42e3a7be3e0b843b41633d621e95f75
[]
no_license
glglgl45/javasource
7d83499a3e22cb0b5ce1651ff9a0f01e32650980
b89a599db48ddd098a7951ae7ad2d83450ebcecf
refs/heads/master
2022-06-20T10:55:14.829371
2020-05-08T08:18:43
2020-05-08T08:18:43
261,990,856
0
0
null
null
null
null
UTF-8
Java
false
false
703
java
package collection; import java.util.LinkedList; import java.util.Queue; import java.util.Stack; public class StackEx1 { public static void main(String[] args) { Stack<String> stack = new Stack<String>(); // 스택에 요소 담기 stack.push("사과"); stack.push("배"); stack.push("포도"); stack.push("키위"); // 요소 가져오기 while (!stack.isEmpty()) { System.out.print(stack.pop() + "\t"); } System.out.println(); Queue<String> queue = new LinkedList<String>(); queue.offer("박보검"); queue.offer("송중기"); queue.offer("방탄"); queue.offer("워너원"); while (!queue.isEmpty()) { System.out.print(queue.poll() + "\t"); } } }
[ "glglgl47@naver.com" ]
glglgl47@naver.com
c2b1f1435ab89a80891b27ccb511f5c32f230e0d
5d753de81747447e8b44b38a1ec2620cf5d11f01
/service-cloud-test/src/main/java/demo/serve/entity/User.java
115c8c4142562674ef88dc248ce7c0e15c1cd277
[]
no_license
yanping1/cloud-demo
d7477e99aba23167e696e5dd94a9d29f21dcb93d
0434130c3f47d15ff6cac10a6f07fd226168bc5a
refs/heads/master
2022-06-26T15:55:54.543945
2020-01-06T03:18:41
2020-01-06T03:18:41
232,015,002
0
0
null
2022-06-21T02:35:08
2020-01-06T03:14:33
Java
UTF-8
Java
false
false
321
java
package demo.serve.entity; import lombok.Data; /** * @author liq * @Title: User * @ProjectName lcn-demo * @Description: TODO * @date 2019-06-0409:11 */ @Data public class User { private Integer id; private String name; private String username; private String password; private String index; }
[ "1822117257@qq.com" ]
1822117257@qq.com
705a3e4dd1e88b1b8098f4ddc350aedefcdf7b9a
fe4935ae3230e99701183a028f4570275e4ec37b
/app/src/main/java/com/mao/cn/learnRxJava2/contants/ValueMaps.java
69861b50c556803475130aba81c7d18f576f1e2b
[]
no_license
maoai-xianyu/LearnRxJava2
186e33775336a1952ac825b5ff6b54764a3dad6f
caf97c4a0f8a1876a3dd2fadb8b294eaa8d5b772
refs/heads/master
2021-06-14T20:55:01.092045
2020-07-24T00:33:44
2020-07-24T00:33:44
137,331,842
0
0
null
null
null
null
UTF-8
Java
false
false
1,212
java
package com.mao.cn.learnRxJava2.contants; /** * Created by zhangkun on 2017/6/9. */ public class ValueMaps { public static final class Time { public static final int BREAK_TIME_MILLISECOND = 500; } public static final class AppChannel { public static final String UNKNOWN = "UNKNOWN"; } public static final class ResponeCode{ public static final int TYPE_CODE_404 = 404; public static final int TYPE_CODE_401 = 401; public static final int TYPE_CODE_400 = 400; public static final int TYPE_CODE_409 = 409; public static final int TYPE_CODE_500 = 500; public static final int TYPE_CODE_501 = 501; public static final int TYPE_CODE_502 = 502; public static final int TYPE_CODE_503 = 503; public static final int TYPE_CODE_304 = 304; public static final int TYPE_CODE_403 = 403; public static final int TYPE_CODE_200 = 200; } public static final class ClickTime{ public static final int BREAK_TIME_MILLISECOND = 500; } public static final class ImagePath{ public static final String IMAGE_RES = "res://com.mao.cn.learnDevelopProject/"; } }
[ "194264514@qq.com" ]
194264514@qq.com
3813c4a6e87ddd440673f5fb7f10ee453f6e531e
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XRENDERING-418-19-1-NSGA_II-LineCoverage:ExceptionType:StackTraceSimilarity/org/xwiki/rendering/internal/parser/xhtml/wikimodel/XWikiCommentHandler_ESTest.java
8699c32362044635a109bfe72d1ec07156268436
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
596
java
/* * This file was automatically generated by EvoSuite * Mon Apr 06 00:30:02 UTC 2020 */ package org.xwiki.rendering.internal.parser.xhtml.wikimodel; 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(useVFS = true, useJEE = true) public class XWikiCommentHandler_ESTest extends XWikiCommentHandler_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
840a3bf0a21f43cd4dbcc57d7e6e569c5429faa3
47a6dd4cba8d41ddf287db27405503b663d0fd85
/psse/csv/RawFixedShuntList.java
963a9f4610b1ad96f558b97aeaa0644827f0d09d
[]
no_license
xpli521us/com.powerdata.openpa
47ece434840b6ac71b92437c26d6800e2f67f3e8
108d33c9b793bf7168a2f8c459cbd3807ed4ed98
refs/heads/master
2020-12-25T20:20:43.646522
2014-04-26T18:45:55
2014-04-26T18:45:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,419
java
package com.powerdata.openpa.psse.csv; import java.io.File; import java.io.IOException; import com.powerdata.openpa.psse.PsseModelException; import com.powerdata.openpa.psse.ShuntList; import com.powerdata.openpa.tools.LoadArray; import com.powerdata.openpa.tools.SimpleCSV; public class RawFixedShuntList extends ShuntList { String[] _i, _id; float[] _g, _b; int _size; int[] _stat; public RawFixedShuntList(PsseRawModel model) throws PsseModelException { super(model); File dbfile = new File(model.getDir(), "FixedShunt.csv"); try { SimpleCSV shunts = new SimpleCSV(dbfile); _size = shunts.getRowCount(); _i = shunts.get("I"); _id = LoadArray.String(shunts, "ID", this, "getDeftID"); _g = LoadArray.Float(shunts, "G", this, "getDeftG"); _b = LoadArray.Float(shunts, "B", this, "getDeftB"); _stat = LoadArray.Int(shunts, "STAT", this, "getDeftSTAT"); } catch (IOException | ReflectiveOperationException e) { throw new PsseModelException(e); } } public String getDeftID(int ndx) throws PsseModelException {return super.getID(ndx);} public float getDeftG(int ndx) throws PsseModelException {return super.getG(ndx);} public float getDeftB(int ndx) throws PsseModelException {return super.getB(ndx);} public float getDeftSTAT(int ndx) throws PsseModelException {return super.isInSvc(ndx)?1:0;} @Override public String getI(int ndx) throws PsseModelException {return _i[ndx];} @Override public String getObjectID(int ndx) throws PsseModelException { String rv = String.format("%s-FXDSH", getBus(ndx).getObjectID()); String id = getID(ndx); if (!id.isEmpty()) rv = String.format("%s-%s", rv, id); return rv; } @Override public String getObjectName(int ndx) throws PsseModelException { String rv = getBus(ndx).getObjectName(); String id = getID(ndx); if (!id.isEmpty()) rv = String.format("%s-%s", rv, id); return rv; } @Override public int size() {return _size;} @Override public float getB(int ndx) throws PsseModelException {return _b[ndx];} @Override public float getG(int ndx) throws PsseModelException {return _g[ndx];} @Override public String getID(int ndx) throws PsseModelException {return _id[ndx];} @Override public boolean isInSvc(int ndx) throws PsseModelException {return _stat[ndx] == 1;} @Override public void setInSvc(int ndx, boolean state) throws PsseModelException {_stat[ndx] = state ? 1 : 0;} }
[ "chris@powerdata.com" ]
chris@powerdata.com
58acfbfdaa2f3a4eaa9ac842f9affa6c1171ce39
89c78d0621f8bbbeb065c768916a21036f456414
/src/minecraft/mattparks/mods/starcraft/pluto/GCPlutoConfigManager.java
d11f1b2f60834a0cc0432927064ecef977c48168
[]
no_license
fogss/Starcraft-2
2badc40152f8fe0cfd9844d26a81bc01651b620c
5362fd5a4fbee02cc62d689a85c6a389d389a3bd
refs/heads/master
2021-05-28T15:16:04.251209
2013-11-02T14:41:03
2013-11-02T14:41:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,124
java
package mattparks.mods.starcraft.pluto; import java.io.File; import java.util.logging.Level; import micdoodle8.mods.galacticraft.core.GCCoreConfigManager; import net.minecraft.item.Item; import net.minecraftforge.common.Configuration; import cpw.mods.fml.common.FMLLog; public class GCPlutoConfigManager { public static boolean loaded; static Configuration configuration; public GCPlutoConfigManager(File file) { if (!GCPlutoConfigManager.loaded) { GCPlutoConfigManager.configuration = new Configuration(file); this.setDefaultValues(); } } // DIMENSIONS public static int dimensionIDPluto; // BLOCKS public static int idBlockPluto; // ITEMS public static int idItemPlutoBasic; // ARMOR // TOOLS // ENTITIES // GUI // SCHEMATIC // ACHIEVEMENTS // GENERAL public static boolean generateOtherMods; private void setDefaultValues() { try { GCPlutoConfigManager.configuration.load(); GCPlutoConfigManager.dimensionIDPluto = GCPlutoConfigManager.configuration.get("Dimensions", "Venus Dimension ID", -48).getInt(-48); GCPlutoConfigManager.idBlockPluto = GCPlutoConfigManager.configuration.get(Configuration.CATEGORY_BLOCK, "idBlockVenus", 7653).getInt(7653); GCPlutoConfigManager.idItemPlutoBasic = GCPlutoConfigManager.configuration.get(Configuration.CATEGORY_ITEM, "idItemvenusItemBasic", 7654).getInt(7654); //Block id's 7755-7756 are used by Starcraft mercury GCPlutoConfigManager.generateOtherMods = GCPlutoConfigManager.configuration.get(Configuration.CATEGORY_GENERAL, "Generate other mod's features on Pluto", false).getBoolean(false); } catch (final Exception e) { FMLLog.log(Level.SEVERE, e, "Galacticraft Pluto has a problem loading it's configuration"); } finally { GCPlutoConfigManager.configuration.save(); GCPlutoConfigManager.loaded = true; } } }
[ "mattparks5855@gmail.com" ]
mattparks5855@gmail.com
eee8460db52d74e03f5610e2ec9ed4b6d36d922c
863acb02a064a0fc66811688a67ce3511f1b81af
/sources/com/google/android/gms/internal/ads/zzaqg.java
ec23705fdb2021ea90c1a44298070219339381c5
[ "MIT" ]
permissive
Game-Designing/Custom-Football-Game
98d33eb0c04ca2c48620aa4a763b91bc9c1b7915
47283462b2066ad5c53b3c901182e7ae62a34fc8
refs/heads/master
2020-08-04T00:02:04.876780
2019-10-06T06:55:08
2019-10-06T06:55:08
211,914,568
1
1
null
null
null
null
UTF-8
Java
false
false
949
java
package com.google.android.gms.internal.ads; import android.content.Intent; import android.os.Bundle; import android.os.IInterface; import android.os.RemoteException; import com.google.android.gms.dynamic.IObjectWrapper; public interface zzaqg extends IInterface { void onActivityResult(int i, int i2, Intent intent) throws RemoteException; void onBackPressed() throws RemoteException; void onCreate(Bundle bundle) throws RemoteException; void onDestroy() throws RemoteException; void onPause() throws RemoteException; void onRestart() throws RemoteException; void onResume() throws RemoteException; void onSaveInstanceState(Bundle bundle) throws RemoteException; void onStart() throws RemoteException; void onStop() throws RemoteException; void zzac(IObjectWrapper iObjectWrapper) throws RemoteException; void zzdd() throws RemoteException; boolean zztg() throws RemoteException; }
[ "tusharchoudhary0003@gmail.com" ]
tusharchoudhary0003@gmail.com
85ee04564afc72411dd49c85020a34ed0f4297ff
d07865921167373009a8bfdcfe14a672e14f4243
/gea-core/src/main/java/com/github/terefang/gea/GeaFile.java
e2f95daf1efe1beda635769d4559e60505e7b487
[ "Apache-2.0" ]
permissive
terefang/gea-loader
674752571a05668487f4356f3fa0a30217b4414d
4174d5b21f93489c001ce9e74f0670bd0d1c194b
refs/heads/master
2023-01-31T22:33:54.373834
2020-12-08T03:49:50
2020-12-08T03:49:50
319,166,593
0
0
null
null
null
null
UTF-8
Java
false
false
1,658
java
package com.github.terefang.gea; import java.io.IOException; import java.io.InputStream; import java.util.LinkedHashMap; import java.util.Map; public abstract class GeaFile<T extends GeaFileEntry> { long size; long offset; String filepath; Map<String, T> fileEntries = new LinkedHashMap<String, T>(); public GeaFile() { super(); } public GeaFile(String filepath) { this(); this.filepath = filepath; } public long getSize() { return size; } public void setSize(long size) { this.size = size; } public long getOffset() { return offset; } public void setOffset(long offset) { this.offset = offset; } public String getFilepath() { return filepath; } public void setFilepath(String filepath) { this.filepath = filepath; } public Map<String, T> getFileEntries() { return fileEntries; } public void setFileEntries(Map<String, T> fileEntries) { this.fileEntries = fileEntries; } public T getFileEntry(String _entry) { return this.fileEntries.get(_entry); } public void addFileEntry(String _path, T _entry) { this.fileEntries.put(_path, _entry); } public void addFileEntry(T _entry) { this.fileEntries.put(_entry.getName(), _entry); } public InputStream getFileStream(String _path) throws IOException { return this.getFileStream(this.getFileEntry(_path)); } public abstract InputStream getFileStream(T _entry) throws IOException; public abstract void close() throws IOException; }
[ "unconfigured@null.spigotmc.org" ]
unconfigured@null.spigotmc.org
f67d0c4394c40a07b07fdd060b128105b1c20b40
32984b74a284a98c43b593914d71a30a8827fe76
/test4j.testng/src/test/java/org/test4j/hamcrest/TestNumberAssert.java
915da3095770ac7738b97846ba10205a73b79f44
[]
no_license
hexq/test4j
cd38cf9c2308b5854706d305a93f3884340ed2cc
84b117dcc31143f6da9473016b26ac8107f4e5ce
refs/heads/master
2020-03-20T04:30:47.617949
2018-06-28T13:00:55
2018-06-28T13:01:19
137,186,024
0
0
null
2018-06-13T08:28:44
2018-06-13T08:28:44
null
UTF-8
Java
false
false
1,048
java
package org.test4j.hamcrest; import org.test4j.testng.Test4J; import org.testng.annotations.Test; @Test(groups = { "test4j", "assertion" }) public class TestNumberAssert extends Test4J { @Test public void test1() { want.number(3).isBetween(2, 5); want.number(3).isGreaterEqual(3); want.number(3).isGreaterThan(2); want.number(3).isLessEqual(3); want.number(3).isLessThan(4); want.number(3).isEqualTo(3); } @Test(expectedExceptions = { AssertionError.class }) public void test2() { want.number(3).isBetween(5, 2); } public void test3() { want.number(5d).isGreaterEqual(4d); } // /** // * the.wanted(Class<T> claz)的类型转换 // */ // @SuppressWarnings( { "unchecked", "unused" }) // @Test(expectedExceptions = Test4JException.class) // public void testTheNumber() { // Long l = the.doublenum().isEqualTo(3d).wanted(Long.class); // Double db = (Double) the.number().isEqualTo(3d).wanted(Double.class); // } }
[ "darui.wu@163.com" ]
darui.wu@163.com
b65675790b186fb115229dadb6a502e98c7b7ce2
4c6adf0ce6ef3f02dcef9c345e0e5e4ff139d886
/Core/fi-commons/src/main/java/com/pay/fi/commons/SystemAlarmStatusEnum.java
dd3e3b40d82a6d7f8d9994995823634321b0d8d6
[]
no_license
happyjianguo/pay-1
8631906be62707316f0ed3eb6b2337c90d213bc0
40ae79738cfe4e5d199ca66468f3a33e9d8f2007
refs/heads/master
2020-07-27T19:51:54.958859
2016-12-19T07:34:24
2016-12-19T07:34:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,038
java
package com.pay.fi.commons; public enum SystemAlarmStatusEnum { CREATE(0,"创建"), PROCESS(1, "处理中"), SUCCESS(2, "处理成功"); private final int code; private final String description; private SystemAlarmStatusEnum(int code, String description) { this.code = code; this.description = description; } public int getCode() { return code; } public String getDescription() { return description; } /** * 通过枚举<code>code</code>获得枚举 * * @param code * @return */ public static SystemAlarmStatusEnum getByCode(int code) { for (SystemAlarmStatusEnum status : values()) { if (status.getCode() == code) { return status; } } return null; } /** * 通过枚举<code>description</code>获得枚举 * * @param code * @return */ public static SystemAlarmStatusEnum getByDescription(String description) { for (SystemAlarmStatusEnum status : values()) { if (status.getDescription().equals(description)) { return status; } } return null; } }
[ "stanley.zou@hrocloud.com" ]
stanley.zou@hrocloud.com
4ba09d07c07510761ad2afadca51c130f8974c1f
ee9aa986a053e32c38d443d475d364858db86edc
/src/main/java/com/springrain/erp/modules/psi/entity/PsiOutOfStockInfo.java
14820637880a64ff319d56e5e6da978949bb9376
[ "Apache-2.0" ]
permissive
modelccc/springarin_erp
304db18614f69ccfd182ab90514fc1c3a678aaa8
42eeb70ee6989b4b985cfe20472240652ec49ab8
refs/heads/master
2020-05-15T13:10:21.874684
2018-05-24T15:39:20
2018-05-24T15:39:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,161
java
package com.springrain.erp.modules.psi.entity; import java.util.Date; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import com.fasterxml.jackson.annotation.JsonFormat; @Entity @Table(name = "psi_out_of_stock_info") public class PsiOutOfStockInfo { private Integer id; private String productName; private String color; private String country; private Integer fbaQuantity; private Integer quantityDay31; private Float beforePrice; private Float afterPrice; private Date createDate; private Date actualDate; private String sku; private String info1;//在途 private String info2;//在产 private String info3;//在库(CN) private String info4;//在库(海外) @Id @GeneratedValue(strategy = GenerationType.AUTO) public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getSku() { return sku; } public void setSku(String sku) { this.sku = sku; } public String getProductName() { return productName; } public void setProductName(String productName) { this.productName = productName; } public String getColor() { return color; } public void setColor(String color) { this.color = color; } public String getCountry() { return country; } public void setCountry(String country) { this.country = country; } public Integer getFbaQuantity() { return fbaQuantity; } public void setFbaQuantity(Integer fbaQuantity) { this.fbaQuantity = fbaQuantity; } public Integer getQuantityDay31() { return quantityDay31; } public void setQuantityDay31(Integer quantityDay31) { this.quantityDay31 = quantityDay31; } public Float getBeforePrice() { return beforePrice; } public void setBeforePrice(Float beforePrice) { this.beforePrice = beforePrice; } public Float getAfterPrice() { return afterPrice; } public void setAfterPrice(Float afterPrice) { this.afterPrice = afterPrice; } @Temporal(TemporalType.TIMESTAMP) @JsonFormat(pattern = "yyyy-MM-dd hh:mm") public Date getCreateDate() { return createDate; } public void setCreateDate(Date createDate) { this.createDate = createDate; } @Temporal(TemporalType.TIMESTAMP) @JsonFormat(pattern = "yyyy-MM-dd hh:mm") public Date getActualDate() { return actualDate; } public void setActualDate(Date actualDate) { this.actualDate = actualDate; } public String getInfo1() { return info1; } public void setInfo1(String info1) { this.info1 = info1; } public String getInfo2() { return info2; } public void setInfo2(String info2) { this.info2 = info2; } public String getInfo3() { return info3; } public void setInfo3(String info3) { this.info3 = info3; } public String getInfo4() { return info4; } public void setInfo4(String info4) { this.info4 = info4; } }
[ "601906911@qq.com" ]
601906911@qq.com
80707d3526d1183ea85f08d20bd6eec3048a9fd5
d927e590652c08d73b9659a5317a74d603184edd
/chat-app-sample/api/src/main/java/com/example/api/MessageApi.java
744c1a53bfa0d9246f42a7bfb6af698bbf28116b
[]
no_license
mike-neck/spring-til
8d93694fff820d826ea9fcfc44ba4a9507cc2f9c
b97c47f656e16ee9281cc256ef8cf4f09f7b0b95
refs/heads/master
2021-01-20T13:16:55.342684
2018-04-05T13:47:12
2018-04-05T13:47:12
90,466,665
0
0
null
null
null
null
UTF-8
Java
false
false
1,539
java
/* * Copyright 2017 Shinya Mochida * * Licensed under the Apache License,Version2.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.example.api; import com.example.api.data.Message; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.Optional; @RestController @RequestMapping(path = "message") public class MessageApi { private final DatabaseServiceImpl databaseService; public MessageApi(final DatabaseServiceImpl databaseService) { this.databaseService = databaseService; } @GetMapping("{id}") ResponseEntity<Message> getMessage(@PathVariable("id") long messageId) { final Optional<Message> messageById = databaseService.getMessageById(messageId); return messageById.map(ResponseEntity::ok) .orElse(ResponseEntity.notFound().build()); } }
[ "jkrt3333@gmail.com" ]
jkrt3333@gmail.com
40ba3cf4cfd9c89f42d78ab38bc6361dae57bedd
76d8664f9365652b1081a8f10dd0b6afd59cb47e
/YiXiuGe/app/src/main/java/com/hyphenate/chatuidemo/ui/EditActivity.java
e9001406526e8aa71df980cfa6a7532e14d5d4e8
[]
no_license
xiongkai888/YiXiuGe
987d0dab7908d346c497be94b0211558b95394eb
aea99deefc4b765738284ad02682b360da5cfdd5
refs/heads/master
2020-03-27T22:12:28.090815
2019-01-18T07:28:46
2019-01-18T07:28:46
147,213,237
0
0
null
null
null
null
UTF-8
Java
false
false
1,082
java
package com.hyphenate.chatuidemo.ui; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.EditText; import android.widget.TextView; import com.medui.yixiu.R; public class EditActivity extends BaseActivity{ private EditText editText; @Override protected void onCreate(Bundle arg0) { super.onCreate(arg0); setContentView(R.layout.em_activity_edit); editText = (EditText) findViewById(R.id.edittext); String title = getIntent().getStringExtra("title"); String data = getIntent().getStringExtra("data"); Boolean editable = getIntent().getBooleanExtra("editable", false); if(title != null) ((TextView)findViewById(R.id.tv_title)).setText(title); if(data != null) editText.setText(data); editText.setEnabled(editable); editText.setSelection(editText.length()); findViewById(R.id.btn_save).setEnabled(editable); } public void save(View view){ setResult(RESULT_OK, new Intent().putExtra("data", editText.getText().toString())); finish(); } public void back(View view) { finish(); } }
[ "173422042@qq.com" ]
173422042@qq.com
b3f817e029936becc04c0512c7dcc38e8030dafb
878bece606bb57e4bf1d3bc57e70bc2bd46dab63
/server-api/src/main/java/org/jboss/lhotse/server/api/servlet/HttpServletResponseManager.java
58cacd0a16bbfb701d1045f41370e75d7075f264
[]
no_license
matejonnet/lhotse
a1830194638bb599294b8bb0fa4342244a2b8220
6e2b0a98d7c897345674c99518677fe4060f4fd9
refs/heads/master
2021-01-20T23:24:27.016026
2011-04-15T14:03:35
2011-04-15T14:03:35
1,590,828
0
0
null
null
null
null
UTF-8
Java
false
false
1,616
java
/* * JBoss, Home of Professional Open Source. * Copyright 2011, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.lhotse.server.api.servlet; import javax.enterprise.context.RequestScoped; import javax.enterprise.inject.Produces; import javax.servlet.http.HttpServletResponse; /** * Exposes response. * * @author <a href="mailto:ales.justin@jboss.org">Ales Justin</a> */ @RequestScoped class HttpServletResponseManager { private HttpServletResponse response; @Produces @RequestScoped public HttpServletResponse getResponse() { return response; } public void setResponse(HttpServletResponse response) { this.response = response; } }
[ "ales.justin@gmail.com" ]
ales.justin@gmail.com
3692fac42558e3908198eebe69413b0f45a417cc
76f3f97eea31c6993b2d9ab2739e8858d8a3fe6e
/consumer/src/main/java/com/xzxx/decorate/o2o/requests/address/AddressDetailRequest.java
a26997770d7b687ce2a3d3921eae4095cc37503d
[]
no_license
shanghaif/o2o-android-app
4309dc88047ca16c7ae0bc2477e420070bcb486a
a883287a00d91c62eee4d7d5847b544828402973
refs/heads/master
2022-03-04T08:35:58.649521
2019-11-04T07:40:35
2019-11-04T07:42:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
374
java
package com.xzxx.decorate.o2o.requests.address; import com.kiun.modelcommonsupport.network.MCBaseRequest; /** * Created by kiun_2007 on 2018/8/8. * 获取地址,根据地址ID. */ public class AddressDetailRequest extends MCBaseRequest { /** * 地址ID. */ public String id; @Override public String requestPath() { return "user/customer/addressDetail"; } }
[ "kiun_2007@aliyun.com" ]
kiun_2007@aliyun.com
0b712193fbce4587d60640b7ff07d19ecc007d9b
a10c5a9b7b853de63524404b89e54f0b37178cbb
/src/finalkeyword/extended/Password.java
7b83142ba8714a5c8bba5b4df5f7fe1628acbe8a
[]
no_license
Arasefe/SoftwareEngineer
1837b9975ab1d4281f090f19059a0693ea194446
20747b5604b6fe2b3b0e5f65a483ae0bac412810
refs/heads/master
2022-10-15T21:39:30.906710
2020-06-13T19:57:13
2020-06-13T20:01:39
272,074,744
0
0
null
null
null
null
UTF-8
Java
false
false
831
java
package finalkeyword.extended; public class Password { private static final int key = 748576362; private final int encryptedPassword; public Password(int password) { this.encryptedPassword = encryptDecrypt(password); } private int encryptDecrypt(int password) { return password ^ key; } public final void storePassword() { System.out.println("Saving password as " + this.encryptedPassword); } public boolean letMeIn(int password) { if(encryptDecrypt(password) == this.encryptedPassword) { System.out.println("Welcome"); return true; } else { System.out.println("Nope, you cannot come in"); return false; } } }
[ "arasefe@users.noreply.github.com" ]
arasefe@users.noreply.github.com
d41cae3ca7c7d60d59d804b3e808c342af740ef9
d2db02c94767b128a2e09cfffe443306633d6918
/manifold-deps-parent/manifold-preprocessor-test/src/test/java/manifold/preprocessor/ExpressionTest.java
be0bdaedc5804e29059c0daa71524aede38b4057
[ "Apache-2.0" ]
permissive
depie/manifold
d5087165b06c04405c518d7476953e4eae33e089
13011b8e520e617510ecfef21b003ad95968b54e
refs/heads/master
2022-11-16T16:22:04.601397
2020-07-14T20:43:27
2020-07-14T20:43:27
279,688,030
0
0
Apache-2.0
2020-07-14T20:37:13
2020-07-14T20:37:12
null
UTF-8
Java
false
false
6,680
java
/* * Copyright (c) 2019 - Manifold Systems 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 manifold.preprocessor; import org.junit.Test; import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; #define TRUE #define FOO public class ExpressionTest { @Test public void testBaseline() { boolean success = false; #if FALSE fail(); #endif #if TRUE success = true; #endif assertTrueAndFlip(success); } public void testAnd() { boolean success = false; #if FALSE fail(); #endif #if TRUE success = true; #endif success = assertTrueAndFlip(success); #if TRUE && TRUE success = true; #endif success = assertTrueAndFlip(success); #if TRUE && TRUE && TRUE success = true; #endif success = assertTrueAndFlip(success); #if TRUE && FALSE fail(); #endif #if FALSE && TRUE fail(); #endif #if TRUE && FALSE && TRUE fail(); #endif #if FALSE && TRUE && FALSE fail(); #endif #if FALSE && FALSE && FALSE fail(); #endif } public void testOr() { boolean success = false; #if TRUE || TRUE success = true; #endif success = assertTrueAndFlip(success); #if FALSE || TRUE success = true; #endif success = assertTrueAndFlip(success); #if TRUE || FALSE success = true; #endif success = assertTrueAndFlip(success); #if FALSE || FALSE fail(); #endif #if TRUE || FALSE || TRUE success = true; #endif success = assertTrueAndFlip(success); #if FALSE || TRUE || FALSE success = true; #endif success = assertTrueAndFlip(success); #if FALSE || FALSE || FALSE fail(); #endif } @Test public void testPrecedence() { boolean success = false; #if TRUE || TRUE && FALSE success = true; #endif success = assertTrueAndFlip(success); #if TRUE || FALSE && TRUE success = true; #endif success = assertTrueAndFlip(success); #if TRUE || FALSE && FALSE success = true; #endif success = assertTrueAndFlip(success); #if FALSE || TRUE && FALSE fail(); #endif #if FALSE || FALSE && TRUE fail(); #endif #if FALSE && FALSE || FALSE fail(); #endif #if FALSE && TRUE || FALSE fail(); #endif #if FALSE && TRUE || FALSE fail(); #endif #if FALSE && FALSE || TRUE success = true; #endif success = assertTrueAndFlip(success); #if FALSE && (FALSE || TRUE) fail(); #endif } @Test public void testNot() { boolean success = false; #if !FALSE success = true; #endif success = assertTrueAndFlip(success); #if !(FALSE) success = true; #endif success = assertTrueAndFlip(success); #if !FALSE && TRUE success = true; #endif success = assertTrueAndFlip(success); #if !!FALSE fail(); #endif #if !TRUE fail(); #endif #if !(TRUE) fail(); #endif #if !!TRUE success = true; #endif success = assertTrueAndFlip(success); } @Test public void testEquality() { boolean success = false; #if FALSE == FALSE success = true; #endif success = assertTrueAndFlip(success); #if TRUE == TRUE success = true; #endif success = assertTrueAndFlip(success); #if TRUE == FOO success = true; #endif success = assertTrueAndFlip(success); #if TRUE == FALSE fail(); #endif #if FALSE == TRUE fail(); #endif #if FALSE == FOO fail(); #endif #if FALSE == FALSE || FALSE success = true; #endif success = assertTrueAndFlip(success); #if FALSE || FALSE == FALSE success = true; #endif success = assertTrueAndFlip(success); #if FALSE == FALSE && TRUE success = true; #endif success = assertTrueAndFlip(success); #if FALSE == TRUE || TRUE success = true; #endif success = assertTrueAndFlip(success); #if TRUE || TRUE == FALSE success = true; #endif success = assertTrueAndFlip(success); #if (TRUE || FALSE) == FALSE fail(); #endif #if TRUE || (FALSE == FALSE) success = true; #endif } @Test public void testNotEquality() { boolean success = false; #if FALSE != FALSE fail(); #endif #if TRUE != TRUE fail(); #endif #if TRUE != FOO fail(); #endif #if TRUE != FALSE success = true; #endif success = assertTrueAndFlip(success); #if FALSE != TRUE success = true; #endif success = assertTrueAndFlip(success); #if FALSE != FOO success = true; #endif success = assertTrueAndFlip(success); #if FALSE != FALSE || FALSE fail(); #endif #if FALSE || FALSE != FALSE fail(); #endif #if FALSE != FALSE && TRUE fail(); #endif } @Test public void testStrings() { #if "abc" == "abc" String abc = "abc"; #else String abc = "xyz"; #endif assertEquals( "abc", abc ); #if "abc" != "abc" abc = "abc"; #else abc = "xyz"; #endif assertEquals( "xyz", abc ); #if MY_PROP1 == "abc" abc = "abc"; #else abc = "xyz"; #endif assertEquals( "abc", abc ); #if MY_PROP1 == MY_PROP1 abc = "abc"; #else abc = "xyz"; #endif assertEquals( "abc", abc ); #if MY_PROP1 != MY_PROP1 abc = "abc"; #else abc = "xyz"; #endif assertEquals( "xyz", abc ); #if MY_PROP1 == MY_PROP2 abc = "abc"; #else abc = "xyz"; #endif assertEquals( "xyz", abc ); #if MY_BUILD_PROP == "" abc = "abc"; #else abc = "xyz"; #endif assertEquals( "abc", abc ); } private boolean assertTrueAndFlip( boolean cond ) { assertTrue( cond ); return false; } }
[ "rsmckinney@hotmail.com" ]
rsmckinney@hotmail.com
cfc077bfab064e13a53c95174de99075b14bbf35
b60db6d5b65796710ba0e7e3caaec9fed244f4e8
/OSalesSystem/src/cn/zying/osales/service/baseinfo/imples/ProductCategoryServiceImple.java
0d4a3d8a6c93bcdfe4de5c57f1163188a8aff138
[]
no_license
pzzying20081128/OSales_System
cb5e56ed9d096bfb3f3915bd280732f5f16ffb3b
ed5a1cd53c68460653f82c2c6bdff24bea5db9e4
refs/heads/master
2021-01-10T04:47:46.861972
2016-01-23T17:33:59
2016-01-23T17:33:59
50,175,928
0
0
null
null
null
null
UTF-8
Java
false
false
2,977
java
package cn.zying.osales.service.baseinfo.imples ; import java.util.List ; import org.springframework.beans.factory.annotation.Autowired ; import org.springframework.beans.factory.annotation.Qualifier ; import org.springframework.stereotype.Component ; import cn.zy.apps.tools.units.CommSearchBean ; import cn.zy.apps.tools.web.SelectPage ; import cn.zying.osales.OSalesConfigProperties.OptType ; import cn.zying.osales.pojos.ProductCategory ; import cn.zying.osales.service.ABCommonsService ; import cn.zying.osales.service.SystemOptServiceException ; import cn.zying.osales.service.baseinfo.IProductCategoryService ; import cn.zying.osales.service.baseinfo.units.ProductCategoryRemoveUnits ; import cn.zying.osales.service.baseinfo.units.ProductCategorySaveUpdateUnits ; import cn.zying.osales.service.baseinfo.units.ProductCategorySearchUnits ; import cn.zying.osales.units.search.bean.ProductCategorySearchBean ; @Component(IProductCategoryService.name) public class ProductCategoryServiceImple extends ABCommonsService implements IProductCategoryService { //@Resource(name="ProductCategorySearchUnits") @Autowired @Qualifier("ProductCategorySearchUnits") private ProductCategorySearchUnits iProductCategorySearchUnits ; //@Resource(name=" ProductCategorySaveUpdateUnits") @Autowired @Qualifier("ProductCategorySaveUpdateUnits") private ProductCategorySaveUpdateUnits iProductCategorySaveUpdateUnits ; @Autowired @Qualifier("ProductCategoryRemoveUnits") private ProductCategoryRemoveUnits iProductCategoryRemoveUnits ; @Override public ProductCategory saveUpdate(OptType optType, ProductCategory optProductCategory) throws SystemOptServiceException { ProductCategory productCategory = iProductCategorySaveUpdateUnits.saveUpdate(optType, optProductCategory) ; prpertiesAutoWriteObjectService.cacheObject(productCategory.getId().toString(), productCategory) ; return productCategory ; } @Override public SelectPage<ProductCategory> search(OptType optType, ProductCategorySearchBean searchBean, CommSearchBean commSearchBean, int... startLimit) throws SystemOptServiceException { return iProductCategorySearchUnits.search(optType, searchBean, commSearchBean, startLimit) ; } @Override public List<ProductCategory> searchList(OptType optType, ProductCategorySearchBean searchBean, CommSearchBean commSearchBean, int... startLimit) throws SystemOptServiceException { return iProductCategorySearchUnits.list(optType, searchBean, commSearchBean, startLimit) ; } @Override public ProductCategory remove(OptType optType, ProductCategory optProductCategory) throws SystemOptServiceException { return iProductCategoryRemoveUnits.remove(optType, optProductCategory) ; } @Override public ProductCategory get(Integer id) throws SystemOptServiceException { return baseService.get(id, ProductCategory.class) ; } }
[ "pzzying20081128@163.com" ]
pzzying20081128@163.com
c52028c368fd64b0f6cfa928c040b0a0d546f6d4
65a09e9f4450c6133e6de337dbba373a5510160f
/naifg26/src/main/java/co/simasoft/Setup/FileUploadEntities.java
d4521fb383c12e8c0c7f97c5ea1b94fbd9814690
[]
no_license
nelsonjava/simasoft
c0136cdf0c208a5e8d01ab72080330e4a15b1261
be83eb8ef67758be82bbd811b672572eff1910ee
refs/heads/master
2021-01-23T15:21:01.981277
2017-04-27T12:46:16
2017-04-27T12:46:16
27,980,384
0
0
null
null
null
null
UTF-8
Java
false
false
5,932
java
package co.simasoft.setup; import co.simasoft.beans.*; import co.simasoft.utils.*; import co.simasoft.models.*; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.Iterator; import java.util.*; import java.util.Calendar; import java.util.Random; import javax.ejb.LocalBean; import javax.ejb.Singleton; import javax.inject.Named; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import org.jboss.logging.Logger; import org.json.simple.JSONArray; import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; import javax.servlet.http.Part; import javax.faces.application.FacesMessage; import javax.faces.bean.ManagedBean; import javax.faces.context.FacesContext; import org.primefaces.event.FileUploadEvent; import org.primefaces.model.UploadedFile; import javax.ejb.LocalBean; import javax.ejb.Singleton; import javax.inject.Named; @Singleton @LocalBean @Named("fileUploadEntities") public class FileUploadEntities { private String filePath = ""; @PersistenceContext(unitName = "naifg26PU-JTA") private EntityManager em; FindBean findBean = new FindBean(); private UploadedFile file; public UploadedFile getFile() { return file; } public void setFile(UploadedFile file) { this.file = file; } public void upload() throws IOException { try { if(file != null) { filePath = "\\docs\\"+file.getFileName(); FacesMessage message = new FacesMessage("Succesful", filePath + " is uploaded."); FacesContext.getCurrentInstance().addMessage(null, message); FileTxt f = new FileTxt(); // read the json file FileReader reader = new FileReader(filePath); JSONParser jsonParser = new JSONParser(); JSONObject jsonObject = (JSONObject) jsonParser.parse(reader); // get an array from the JSON object JSONArray arrayEntities = (JSONArray) jsonObject.get("Entities"); Iterator iteEntities = arrayEntities.iterator(); while (iteEntities.hasNext()) { JSONObject entityObj = (JSONObject) iteEntities.next(); String entityName = (String)entityObj.get("name"); GroupIds groupIds = new GroupIds(); groupIds = findBean.artifactIdGroupIds("tem",em); Entities entity = new Entities(); entity.setName(entityName); entity.setGroupIds(groupIds); f.line("name:"+entity.getName()); em.persist(entity); em.flush(); } // while f.line(""); JSONArray arrayAttributes = (JSONArray) jsonObject.get("Attributes"); Iterator iteAttribute = arrayAttributes.iterator(); while (iteAttribute.hasNext()) { JSONObject attributeObj = (JSONObject) iteAttribute.next(); String attributeEntity = (String)attributeObj.get("entity"); String attributeName = (String)attributeObj.get("name"); Boolean attributeIsNullable = (Boolean)attributeObj.get("isNullable"); Boolean attributeIsUnique = (Boolean)attributeObj.get("isUnique"); String attributeAttributesTypes = (String)attributeObj.get("AttributesTypes"); Boolean attributeIsSimplified = (Boolean)attributeObj.get("isSimplified"); Boolean attributeIsCreate = (Boolean)attributeObj.get("isCreate"); Boolean attributeIsSearch = (Boolean)attributeObj.get("isSearch"); Boolean attributeIsView = (Boolean)attributeObj.get("isView"); Boolean attributeIsViewRelation = (Boolean)attributeObj.get("isViewRelation"); Boolean attributeIsViewColumn = (Boolean)attributeObj.get("isViewColumn"); f.line("entity:"+attributeEntity); f.line("name:"+attributeName); f.line("isNullable:"+String.valueOf(attributeIsNullable)); f.line("isUnique:"+String.valueOf(attributeIsUnique)); f.line("AttributesTypes:"+attributeAttributesTypes); f.line(""); Attributes attributes = new Attributes(); attributes.setName(attributeName); attributes.setIsNullable(attributeIsNullable); attributes.setIsUnique(attributeIsUnique); attributes.setIsSimplified(attributeIsSimplified); attributes.setIsCreate(attributeIsCreate); attributes.setIsSearch(attributeIsSearch); attributes.setIsView(attributeIsView); attributes.setIsViewRelation(attributeIsViewRelation); attributes.setIsViewColumn(attributeIsViewColumn); Entities entity1 = new Entities(); entity1 = findBean.nameEntities(attributeEntity,em); attributes.setEntities(entity1); AttributesTypes attributesTypes = new AttributesTypes(); attributesTypes = findBean.nameAttributesTypes(attributeAttributesTypes,em); attributes.setAttributesTypes(attributesTypes); em.persist(attributes); em.flush(); } // while f.saveFile("\\docs", "Entities.txt"); } // if } catch (FileNotFoundException ex) { ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } catch (ParseException ex) { ex.printStackTrace(); } catch (NullPointerException ex) { ex.printStackTrace(); } catch(Exception ioe) { ioe.printStackTrace(); } } // upload() }
[ "nelsonjava@gmail.com" ]
nelsonjava@gmail.com
f9a7e04f9fd783e6a03601d1c3938b0ffef2be22
5efc61cf2e85660d4c809662e34acefe27e57338
/jasperreports-5.6.0/src/net/sf/jasperreports/crosstabs/xml/JRCrosstabMeasureFactory.java
92dc7340b1cb84a1cc1c71564cc578b6b1830a58
[ "Apache-2.0", "LGPL-3.0-only" ]
permissive
ferrinsp/kbellfireapp
b2924c0a18fcf93dd6dc33168bddf8840f811326
751cc81026f27913e31f5b1f14673ac33cbf2df1
refs/heads/master
2022-12-22T10:01:39.525208
2019-06-22T15:33:58
2019-06-22T15:33:58
135,739,120
0
1
Apache-2.0
2022-12-15T23:23:53
2018-06-01T16:14:53
Java
UTF-8
Java
false
false
3,174
java
/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2013 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with JasperReports. If not, see <http://www.gnu.org/licenses/>. */ package net.sf.jasperreports.crosstabs.xml; import net.sf.jasperreports.crosstabs.design.JRDesignCrosstabMeasure; import net.sf.jasperreports.crosstabs.type.CrosstabPercentageEnum; import net.sf.jasperreports.engine.type.CalculationEnum; import net.sf.jasperreports.engine.xml.JRBaseFactory; import net.sf.jasperreports.engine.xml.JRXmlConstants; import org.xml.sax.Attributes; /** * @author Lucian Chirita (lucianc@users.sourceforge.net) * @version $Id: JRCrosstabMeasureFactory.java 5877 2013-01-07 19:51:14Z teodord $ */ public class JRCrosstabMeasureFactory extends JRBaseFactory { public static final String ELEMENT_measure = "measure"; public static final String ELEMENT_measureExpression = "measureExpression"; public static final String ATTRIBUTE_name = "name"; public static final String ATTRIBUTE_class = "class"; public static final String ATTRIBUTE_calculation = "calculation"; public static final String ATTRIBUTE_incrementerFactoryClass = "incrementerFactoryClass"; public static final String ATTRIBUTE_percentageOf = "percentageOf"; public static final String ATTRIBUTE_percentageCalculatorClass = "percentageCalculatorClass"; public Object createObject(Attributes attributes) { JRDesignCrosstabMeasure measure = new JRDesignCrosstabMeasure(); measure.setName(attributes.getValue(ATTRIBUTE_name)); measure.setValueClassName(attributes.getValue(ATTRIBUTE_class)); measure.setIncrementerFactoryClassName(attributes.getValue(ATTRIBUTE_incrementerFactoryClass)); String calcAttr = attributes.getValue(ATTRIBUTE_calculation); if (calcAttr != null) { CalculationEnum calculation = CalculationEnum.getByName(attributes.getValue(JRXmlConstants.ATTRIBUTE_calculation)); measure.setCalculation(calculation); } CrosstabPercentageEnum percentage = CrosstabPercentageEnum.getByName(attributes.getValue(ATTRIBUTE_percentageOf)); if (percentage != null) { measure.setPercentageType(percentage); } String percentageCalcAttr = attributes.getValue(ATTRIBUTE_percentageCalculatorClass); if (percentageCalcAttr != null) { measure.setPercentageCalculatorClassName(percentageCalcAttr); } return measure; } }
[ "ferrinsp@gmail.com" ]
ferrinsp@gmail.com
869e33982ffc6bd54b1f77579e90479f5b37314e
16bd29d56e7c722f1f5fca21626b3359a40baf36
/arqoid/arqoid-module/src/main/java/com/hp/hpl/jena/sparql/core/QueryCompare.java
2b07c0eaa410c96862fb2d5b3d9cbd3bbd1db4f6
[ "Apache-2.0" ]
permissive
william-vw/android-reasoning
948d6a39372e29e5eff8c4851899d4dfc986ca62
eb1668b88207a8e3a174361562efa066f2c75978
refs/heads/master
2023-02-07T20:50:25.015940
2023-01-24T19:26:37
2023-01-24T19:26:37
138,166,750
1
1
null
null
null
null
UTF-8
Java
false
false
6,786
java
/* * (c) Copyright 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP * All rights reserved. * [See end of file] */ package com.hp.hpl.jena.sparql.core ; import com.hp.hpl.jena.query.Query; import com.hp.hpl.jena.query.QueryVisitor; import com.hp.hpl.jena.sparql.util.NodeIsomorphismMap; import com.hp.hpl.jena.sparql.util.Utils; // Two queries comparison public class QueryCompare implements QueryVisitor { private Query query2 ; private boolean result = true ; static public boolean PrintMessages = false ; public static boolean equals(Query query1, Query query2) { if ( query1 == query2 ) return true ; query1.setResultVars() ; query2.setResultVars() ; QueryCompare visitor = new QueryCompare(query1) ; try { query2.visit(visitor) ; } catch ( ComparisonException ex) { return false ; } return visitor.isTheSame() ; } public QueryCompare(Query query2) { this.query2 = query2 ; } public void startVisit(Query query1) { } public void visitResultForm(Query query1) { check("Query result form", query1.getQueryType() == query2.getQueryType()) ; } public void visitPrologue(Prologue query1) { // This is after parsing so all IRIs in the query have been made absolute. // For two queries to be equal, their explicitly set base URIs must be the same. String b1 = query1.explicitlySetBaseURI() ? query1.getBaseURI() : null ; String b2 = query2.explicitlySetBaseURI() ? query2.getBaseURI() : null ; check("Base URIs", b1, b2) ; if ( query1.getPrefixMapping() == null && query2.getPrefixMapping() == null ) return ; check("Prefixes", query1.getPrefixMapping().samePrefixMappingAs(query2.getPrefixMapping())) ; } public void visitSelectResultForm(Query query1) { check("Not both SELECT queries", query2.isSelectType()) ; check("DISTINCT modifier", query1.isDistinct() == query2.isDistinct()) ; check("SELECT *", query1.isQueryResultStar() == query2.isQueryResultStar()) ; check("Result variables", query1.getProject(), query2.getProject() ) ; } public void visitConstructResultForm(Query query1) { check("Not both CONSTRUCT queries", query2.isConstructType()) ; check("CONSTRUCT templates", query1.getConstructTemplate().equalIso(query2.getConstructTemplate(), new NodeIsomorphismMap()) ) ; } public void visitDescribeResultForm(Query query1) { check("Not both DESCRIBE queries", query2.isDescribeType()) ; check("Result variables", query1.getResultVars(), query2.getResultVars() ) ; check("Result URIs", query1.getResultURIs(), query2.getResultURIs() ) ; } public void visitAskResultForm(Query query1) { check("Not both ASK queries", query2.isAskType()) ; } public void visitDatasetDecl(Query query1) { boolean b1 = Utils.equalsListAsSet(query1.getGraphURIs(), query2.getGraphURIs()) ; check("Default graph URIs", b1 ) ; boolean b2 = Utils.equalsListAsSet(query1.getNamedGraphURIs(), query2.getNamedGraphURIs()) ; check("Named graph URIs", b2 ) ; } public void visitQueryPattern(Query query1) { if ( query1.getQueryPattern() == null && query2.getQueryPattern() == null ) return ; if ( query1.getQueryPattern() == null ) throw new ComparisonException("Missing pattern") ; if ( query2.getQueryPattern() == null ) throw new ComparisonException("Missing pattern") ; // The checking for patterns (elements) involves a potential // remapping of system-allocated variable names. // Assumes blank node variables only appear in patterns. check("Pattern", query1.getQueryPattern().equalTo(query2.getQueryPattern(), new NodeIsomorphismMap())) ; } public void visitGroupBy(Query query1) { check("GROUP BY", query1.getGroupBy(), query2.getGroupBy()) ; } public void visitHaving(Query query1) { check("HAVING", query1.getHavingExprs(), query2.getHavingExprs()) ; } public void visitLimit(Query query1) { check("LIMIT", query1.getLimit() == query2.getLimit() ) ; } public void visitOrderBy(Query query1) { check("ORDER BY", query1.getOrderBy(), query2.getOrderBy() ) ; } public void visitOffset(Query query1) { check("OFFSET", query1.getOffset() == query2.getOffset() ) ; } public void finishVisit(Query query1) {} private void check(String msg, Object obj1, Object obj2) { check(msg, Utils.equal(obj1,obj2)) ; } private void check(String msg, boolean b) { if ( !b ) { if ( PrintMessages && msg != null ) System.out.println("Different: "+msg) ; result = false ; throw new ComparisonException(msg) ; } } public boolean isTheSame() { return result ; } } /* * (c) Copyright 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
[ "william.van.woensel@gmail.com" ]
william.van.woensel@gmail.com
8fceb4ccd614175cbc2f995da497788cca3df12d
3615b84df1d2556a6a2c45b4e9064d3dc60f1e2d
/src/main/java/com/mycompany/myapp/AppTestApp.java
19ef6a9e689ce62d7bed0396e8e1ec54a9bc28ff
[]
no_license
cesard90/jhTestApp
71da01ee1f2b88ceea8487ea5e6d9452373a80c7
f9247ad4b5d44b3679f402a26bcad72a73e00d4b
refs/heads/master
2022-12-25T12:55:52.561848
2019-10-29T05:17:07
2019-10-29T05:17:07
218,209,442
0
0
null
2022-12-16T04:40:45
2019-10-29T05:16:53
Java
UTF-8
Java
false
false
4,035
java
package com.mycompany.myapp; import com.mycompany.myapp.config.ApplicationProperties; import com.mycompany.myapp.config.DefaultProfileUtil; import io.github.jhipster.config.JHipsterConstants; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.InitializingBean; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.liquibase.LiquibaseProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.core.env.Environment; import java.net.InetAddress; import java.net.UnknownHostException; import java.util.Arrays; import java.util.Collection; @SpringBootApplication @EnableConfigurationProperties({LiquibaseProperties.class, ApplicationProperties.class}) public class AppTestApp implements InitializingBean { private static final Logger log = LoggerFactory.getLogger(AppTestApp.class); private final Environment env; public AppTestApp(Environment env) { this.env = env; } /** * Initializes appTest. * <p> * Spring profiles can be configured with a program argument --spring.profiles.active=your-active-profile * <p> * You can find more information on how profiles work with JHipster on <a href="https://www.jhipster.tech/profiles/">https://www.jhipster.tech/profiles/</a>. */ @Override public void afterPropertiesSet() throws Exception { Collection<String> activeProfiles = Arrays.asList(env.getActiveProfiles()); if (activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT) && activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_PRODUCTION)) { log.error("You have misconfigured your application! It should not run " + "with both the 'dev' and 'prod' profiles at the same time."); } if (activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT) && activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_CLOUD)) { log.error("You have misconfigured your application! It should not " + "run with both the 'dev' and 'cloud' profiles at the same time."); } } /** * Main method, used to run the application. * * @param args the command line arguments. */ public static void main(String[] args) { SpringApplication app = new SpringApplication(AppTestApp.class); DefaultProfileUtil.addDefaultProfile(app); Environment env = app.run(args).getEnvironment(); logApplicationStartup(env); } private static void logApplicationStartup(Environment env) { String protocol = "http"; if (env.getProperty("server.ssl.key-store") != null) { protocol = "https"; } String serverPort = env.getProperty("server.port"); String contextPath = env.getProperty("server.servlet.context-path"); if (StringUtils.isBlank(contextPath)) { contextPath = "/"; } String hostAddress = "localhost"; try { hostAddress = InetAddress.getLocalHost().getHostAddress(); } catch (UnknownHostException e) { log.warn("The host name could not be determined, using `localhost` as fallback"); } log.info("\n----------------------------------------------------------\n\t" + "Application '{}' is running! Access URLs:\n\t" + "Local: \t\t{}://localhost:{}{}\n\t" + "External: \t{}://{}:{}{}\n\t" + "Profile(s): \t{}\n----------------------------------------------------------", env.getProperty("spring.application.name"), protocol, serverPort, contextPath, protocol, hostAddress, serverPort, contextPath, env.getActiveProfiles()); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
f010fe66813dd2c6cc7cf32a6078ecd8081acac1
07581e79d855bfabd33b733f88bca7a94a447dea
/client-svm/src/edu/clarkson/cs/clientlib/svm/DataSet.java
89dcec6ccdaf92e23182ac47b4e680e032153809
[]
no_license
harperjiang/research-client-library
621be927282dc0e1d68706acc993270eac712206
8b65683113ebb2fcc3eb8311653fe77ae31440eb
refs/heads/master
2020-04-14T12:32:31.610508
2015-03-05T21:59:46
2015-03-05T21:59:46
32,114,079
0
0
null
null
null
null
UTF-8
Java
false
false
205
java
package edu.clarkson.cs.clientlib.svm; import edu.clarkson.cs.clientlib.svm.DataSet.Row; public interface DataSet extends Iterable<Row> { public interface Row { public Object get(int column); } }
[ "harperjiang@msn.com" ]
harperjiang@msn.com
6cc76a6b3d164692d6a94dfd0ef04b170423625c
e48bbaf1bd1089f256a4832d4e45f45ef87bd585
/p2psys-core/src/main/java/com/rongdu/p2psys/crowdfunding/model/LeaderFactoryModel.java
5aac2389bbeaa3e7a72defe5d47e95a1c7590d92
[]
no_license
rebider/pro_bank
330d5d53913424d8629622f045fc9b26ad893591
37799f63d63e8a2df1f63191a92baf5b01e88a3f
refs/heads/master
2021-06-17T21:15:58.363591
2017-05-25T09:45:38
2017-05-25T09:45:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,552
java
package com.rongdu.p2psys.crowdfunding.model; import org.springframework.beans.BeanUtils; import com.rongdu.common.util.Page; import com.rongdu.p2psys.crowdfunding.domain.LeaderFactory; /** * 自定义领投人仓库 * @author Jinx * */ public class LeaderFactoryModel extends LeaderFactory{ private static final long serialVersionUID = -2931589645895218409L; // 当前页码 private int page; // 每页页数 private int rows = Page.ROWS; //产品标签 private String flagNames; //已领投项目 private String projectNames; public static LeaderFactoryModel instance(LeaderFactory leader) { LeaderFactoryModel model = new LeaderFactoryModel(); BeanUtils.copyProperties(leader, model); return model; } public LeaderFactory prototype() { LeaderFactory leader = new LeaderFactory(); BeanUtils.copyProperties(this, leader); return leader; } public int getPage() { return page; } public void setPage(int page) { this.page = page; } public int getRows() { return rows; } public void setRows(int rows) { this.rows = rows; } public String getProjectNames() { return projectNames; } public void setProjectNames(String projectNames) { this.projectNames = projectNames; } public String getFlagNames() { return flagNames; } public void setFlagNames(String flagNames) { this.flagNames = flagNames; } }
[ "jinxlovejinx@vip.qq.com" ]
jinxlovejinx@vip.qq.com
8ecd23433dc2a952d19de5e3df0d304d4651bf82
57e57f2634944d0595258a14af5e20b6df59185d
/bitcamp-java-application4-server/v58_3/src/main/java/com/eomcs/lms/controller/MemberDeleteController.java
8e267ffcfd3faa8dbdf25e1c44d4051fc73ad75f
[]
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
779
java
package com.eomcs.lms.controller; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.stereotype.Component; import org.springframework.web.bind.annotation.RequestMapping; import com.eomcs.lms.dao.MemberDao; @Component("/member/delete") public class MemberDeleteController { @Resource private MemberDao memberDao; @RequestMapping public String execute(HttpServletRequest request, HttpServletResponse response) throws Exception { int no = Integer.parseInt(request.getParameter("no")); if (memberDao.delete(no) == 0) { throw new Exception("해당 데이터가 없습니다."); } return "redirect:list"; } }
[ "shimsh3@naver.com" ]
shimsh3@naver.com
79242d52db639294a74e7ed4477350fe9b7cf98e
20a68bc8842f2de6f241da165f99650639dcf3f8
/006Spring/SpringRPCServiceSpittrCauchoTechnology/src/main/java/config/WebAppInitializer.java
1836e3a6fde21e1793defdba12ed4d1584c81393
[]
no_license
kinoko67/learning-area
6c7af64b677f60f0aa690348da7738615cf81711
6cf460938624833f6c7d586ffaae5c68fbbdae61
refs/heads/master
2023-02-17T14:17:11.059096
2019-10-23T05:39:13
2019-10-23T05:39:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,235
java
package config; import org.springframework.context.annotation.Bean; import org.springframework.web.servlet.HandlerMapping; import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping; import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; import java.util.Properties; /** * 配置Spring * @Date 2019-04-18 * @Author lifei */ public class WebAppInitializer extends AbstractAnnotationConfigDispatcherServletInitializer { /** * 配置 ContextLoaderListener 上下文 * @return */ @Override protected Class<?>[] getRootConfigClasses() { return new Class[]{RootConfig.class}; } /** * 配置DispatcherServlet 上下文 * @return */ @Override protected Class<?>[] getServletConfigClasses() { return new Class[]{WebConfig.class}; } /** * 为了处理Hession服务,DispatcherServlet 还需要配置一个Servlet映射来拦截后缀为 *.service 的URL * 为了保证请求转给hessionSpitterService 处理,还需要配置一个URL映射。 * @return */ @Override protected String[] getServletMappings() { return new String[]{"/", "*.service"}; } }
[ "hefrankeleyn@gamil.com" ]
hefrankeleyn@gamil.com
f3bac8723b270d101b73528c1c600f9afe75c1b3
a243a1c53100b491cd44da967b88ddd3e1412dbf
/03_spring_ssm/src/main/java/com/issac/spring/designpattern/decorate/Phone.java
83e3bd80b531e5f39f64f14b01526bce2e191d32
[]
no_license
IssacYoung2013/daily
b6cbf272bf71ece61698427e822817d618b028bc
d9fa1d1cf8ea3ff69ee968061b16ba88c34199ab
refs/heads/master
2022-12-25T12:15:39.063763
2020-04-16T01:10:24
2020-04-16T01:10:24
222,570,708
0
0
null
2022-12-16T14:50:58
2019-11-19T00:15:50
Java
UTF-8
Java
false
false
155
java
package com.issac.spring.designpattern.decorate; /** * * * @author: ywy * @date: 2019-10-31 * @desc: */ public interface Phone { void call(); }
[ "issacyoung@msn.cn" ]
issacyoung@msn.cn
f59cf70d5b63914d230124c70b5418d89ef44334
3735a07d455d7b40613c3c4160aa8b1cb1b3472a
/platform/platform-impl/src/com/intellij/ide/lightEdit/actions/LightEditOpenFileInProjectAction.java
5a0fb7eea9c6e8b7cfb9460783c018f4e345608c
[ "Apache-2.0" ]
permissive
caofanCPU/intellij-community
ede9417fc4ccb4b5efefb099906e4abe6871f3b4
5ad3e2bdf3c83d86e7c4396f5671929768d76999
refs/heads/master
2023-02-27T21:38:33.416107
2021-02-05T06:37:40
2021-02-05T06:37:40
321,209,485
1
0
Apache-2.0
2021-02-05T06:37:41
2020-12-14T02:22:32
null
UTF-8
Java
false
false
1,790
java
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.ide.lightEdit.actions; import com.intellij.ide.lightEdit.LightEdit; import com.intellij.ide.lightEdit.LightEditCompatible; import com.intellij.ide.lightEdit.LightEditUtil; import com.intellij.ide.lightEdit.intentions.openInProject.LightEditOpenInProjectIntention; import com.intellij.idea.ActionsBundle; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.CommonDataKeys; import com.intellij.openapi.actionSystem.Presentation; import com.intellij.openapi.project.DumbAwareAction; import com.intellij.openapi.project.Project; import com.intellij.openapi.vfs.VirtualFile; import org.jetbrains.annotations.NotNull; public class LightEditOpenFileInProjectAction extends DumbAwareAction implements LightEditCompatible { public LightEditOpenFileInProjectAction() { super(ActionsBundle.messagePointer("action.LightEditOpenFileInProjectAction.text")); } @Override public void update(@NotNull AnActionEvent e) { final Presentation presentation = e.getPresentation(); if (!LightEdit.owns(e.getProject())) { presentation.setEnabledAndVisible(false); } else { presentation.setVisible(true); VirtualFile file = e.getData(CommonDataKeys.VIRTUAL_FILE); presentation.setEnabled(file != null && file.isInLocalFileSystem()); } } @Override public void actionPerformed(@NotNull AnActionEvent e) { VirtualFile file = e.getData(CommonDataKeys.VIRTUAL_FILE); Project project = LightEditUtil.requireLightEditProject(e.getProject()); if (file != null) { LightEditOpenInProjectIntention.performOn(project, file); } } }
[ "intellij-monorepo-bot-no-reply@jetbrains.com" ]
intellij-monorepo-bot-no-reply@jetbrains.com
6de9d01a06fefdba54755a783f19b1005d8640e3
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/alibaba--fastjson/d50929cbdc45eb2c01fac37fc19cdf69e83d4693/before/DateFormatSerializer.java
cd36db44fa87df3f26585ebac9bd1a139f902435
[]
no_license
fracz/refactor-extractor
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
dd5e82bfcc376e74a99e18c2bf54c95676914272
refs/heads/master
2021-01-19T06:50:08.211003
2018-11-30T13:00:57
2018-11-30T13:00:57
87,353,478
0
0
null
null
null
null
UTF-8
Java
false
false
1,703
java
/* * Copyright 1999-2101 Alibaba Group. * * 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.alibaba.fastjson.serializer; import java.io.IOException; import java.lang.reflect.Type; import java.text.SimpleDateFormat; /** * @author wenshao<szujobs@hotmail.com> */ public class DateFormatSerializer implements ObjectSerializer { public final static DateFormatSerializer instance = new DateFormatSerializer(); public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType) throws IOException { SerializeWriter out = serializer.getWriter(); if (object == null) { out.writeNull(); return; } String pattern = ((SimpleDateFormat) object).toPattern(); if (out.isEnabled(SerializerFeature.WriteClassName)) { if (object.getClass() != fieldType) { out.write('{'); out.writeFieldName("@type"); serializer.write(object.getClass().getName()); out.writeFieldValue(',', "val", pattern); out.write('}'); return; } } out.writeString(pattern); } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
b08f109fcb81dea9cf960ddbbb02f3e8886de821
afd43df2f44ff35dbc3c96afade725e23035b1e5
/javatests/dagger/android/support/functional/AllControllersAreDirectChildrenOfApplication.java
2813ccce5d9b28c75d9b34b29c69c8c742b02536
[ "Apache-2.0" ]
permissive
rjrjr/dagger
e9058557d71e769b9892750ba82bc14d57ce8eb3
cdff29ba11c92921fc44b9c57dda30a19c016fd6
refs/heads/master
2020-04-06T03:58:17.835523
2017-02-24T14:40:45
2017-02-24T21:01:10
83,093,890
1
0
null
2017-02-25T00:17:47
2017-02-25T00:17:47
null
UTF-8
Java
false
false
4,409
java
/* * Copyright (C) 2017 The Dagger Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package dagger.android.support.functional; import android.app.Activity; import android.app.Application; import android.support.v4.app.Fragment; import dagger.Binds; import dagger.Component; import dagger.Module; import dagger.Provides; import dagger.Subcomponent; import dagger.android.ActivityKey; import dagger.android.AndroidInjector; import dagger.android.DispatchingAndroidInjector; import dagger.android.HasDispatchingActivityInjector; import dagger.android.support.AndroidSupportInjectionModule; import dagger.android.support.FragmentKey; import dagger.multibindings.IntoMap; import dagger.multibindings.IntoSet; import javax.inject.Inject; public final class AllControllersAreDirectChildrenOfApplication extends Application implements HasDispatchingActivityInjector { @Inject DispatchingAndroidInjector<Activity> activityInjector; @Override public void onCreate() { super.onCreate(); DaggerAllControllersAreDirectChildrenOfApplication_ApplicationComponent.create().inject(this); } @Override public DispatchingAndroidInjector<Activity> activityInjector() { return activityInjector; } @Component( modules = {ApplicationComponent.ApplicationModule.class, AndroidSupportInjectionModule.class} ) interface ApplicationComponent { void inject(AllControllersAreDirectChildrenOfApplication application); @Module( subcomponents = { ActivitySubcomponent.class, ParentFragmentSubcomponent.class, ChildFragmentSubcomponent.class } ) abstract class ApplicationModule { @Provides @IntoSet static Class<?> addToComponentHierarchy() { return ApplicationComponent.class; } @Binds @IntoMap @ActivityKey(TestActivity.class) abstract AndroidInjector.Factory<? extends Activity> bindFactoryForTestActivity( ActivitySubcomponent.Builder builder); @Binds @IntoMap @FragmentKey(TestParentFragment.class) abstract AndroidInjector.Factory<? extends Fragment> bindFactoryForParentFragment( ParentFragmentSubcomponent.Builder builder); @Binds @IntoMap @FragmentKey(TestChildFragment.class) abstract AndroidInjector.Factory<? extends Fragment> bindFactoryForChildFragment( ChildFragmentSubcomponent.Builder builder); } @Subcomponent(modules = ActivitySubcomponent.ActivityModule.class) interface ActivitySubcomponent extends AndroidInjector<TestActivity> { @Module abstract class ActivityModule { @Provides @IntoSet static Class<?> addToComponentHierarchy() { return ActivitySubcomponent.class; } } @Subcomponent.Builder abstract class Builder extends AndroidInjector.Builder<TestActivity> {} } @Subcomponent(modules = ParentFragmentSubcomponent.ParentFragmentModule.class) interface ParentFragmentSubcomponent extends AndroidInjector<TestParentFragment> { @Module abstract class ParentFragmentModule { @Provides @IntoSet static Class<?> addToComponentHierarchy() { return ParentFragmentSubcomponent.class; } } @Subcomponent.Builder abstract class Builder extends AndroidInjector.Builder<TestParentFragment> {} } @Subcomponent(modules = ChildFragmentSubcomponent.ChildFragmentModule.class) interface ChildFragmentSubcomponent extends AndroidInjector<TestChildFragment> { @Module abstract class ChildFragmentModule { @Provides @IntoSet static Class<?> addToComponentHierarchy() { return ChildFragmentSubcomponent.class; } } @Subcomponent.Builder abstract class Builder extends AndroidInjector.Builder<TestChildFragment> {} } } }
[ "shapiro.rd@gmail.com" ]
shapiro.rd@gmail.com
eb9ac73fb7a5ec52db36c430787c4ee31d5fa22c
180e78725121de49801e34de358c32cf7148b0a2
/dataset/protocol1/kylin/validation/783/QueryMetrics2Facade.java
0dc22feb121ebaf19afcac822cb64fdeda213d0f
[]
no_license
ASSERT-KTH/synthetic-checkstyle-error-dataset
40e8d1e0a7ebe7f7711def96a390891a6922f7bd
40c057e1669584bfc6fecf789b5b2854660222f3
refs/heads/master
2023-03-18T12:50:55.410343
2019-01-25T09:54:39
2019-01-25T09:54:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,381
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.kylin.rest.metrics; import static org.apache.kylin.common.metrics.common.MetricsConstant.TOTAL; import static org.apache.kylin.common.metrics.common.MetricsNameBuilder.buildCubeMetricPrefix; import java.util.concurrent.TimeUnit; import javax.annotation.concurrent.ThreadSafe; import org.apache.kylin.common.KylinConfig; import org.apache.kylin.common.metrics.common.Metrics; import org.apache.kylin.common.metrics.common.MetricsConstant; import org.apache.kylin.common.metrics.common.MetricsFactory; import org.apache.kylin.common.metrics.common.MetricsNameBuilder; import org.apache.kylin.rest.request.SQLRequest; import org .apache.kylin.rest.response.SQLResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * The entrance of metrics features. */ @ThreadSafe public class QueryMetrics2Facade { private static final Logger logger = LoggerFactory.getLogger(QueryMetrics2Facade.class); private static Metrics metrics; private static boolean enabled = false; public static void init() { enabled = KylinConfig.getInstanceFromEnv().getQueryMetrics2Enabled(); } public static void updateMetrics(SQLRequest sqlRequest, SQLResponse sqlResponse) { if (!enabled) { return; } if (metrics == null) { metrics = MetricsFactory.getInstance(); } String projectName = sqlRequest.getProject(); String cube = sqlResponse.getCube(); if (cube == null) { return; } String cubeName = cube.replace("=", "->"); // update(getQueryMetrics("Server_Total"), sqlResponse); update(buildCubeMetricPrefix(TOTAL), sqlResponse); update(buildCubeMetricPrefix(projectName), sqlResponse); String cubeMetricName = buildCubeMetricPrefix(projectName, cubeName); update(cubeMetricName, sqlResponse); } private static void update(String name, SQLResponse sqlResponse) { try { incrQueryCount(name, sqlResponse); incrCacheHitCount(name, sqlResponse); if (!sqlResponse.getIsException()) { metrics.updateTimer(MetricsNameBuilder.buildMetricName(name, MetricsConstant.QUERY_DURATION), sqlResponse.getDuration(), TimeUnit.MILLISECONDS); metrics.updateHistogram(MetricsNameBuilder.buildMetricName(name, MetricsConstant.QUERY_RESULT_ROWCOUNT), sqlResponse.getResults().size()); metrics.updateHistogram(MetricsNameBuilder.buildMetricName(name, MetricsConstant.QUERY_SCAN_ROWCOUNT), sqlResponse.getTotalScanCount()); } } catch (Exception e) { logger.error(e.getMessage()); } } private static void incrQueryCount(String name, SQLResponse sqlResponse) { if (!sqlResponse.isHitExceptionCache() && !sqlResponse.getIsException()) { metrics.incrementCounter(MetricsNameBuilder.buildMetricName(name, MetricsConstant.QUERY_SUCCESS_COUNT)); } else { metrics.incrementCounter(MetricsNameBuilder.buildMetricName(name, MetricsConstant.QUERY_FAIL_COUNT)); } metrics.incrementCounter(MetricsNameBuilder.buildMetricName(name, MetricsConstant.QUERY_COUNT)); } private static void incrCacheHitCount(String name, SQLResponse sqlResponse) { if (sqlResponse.isStorageCacheUsed()) { metrics.incrementCounter(MetricsNameBuilder.buildMetricName(name, MetricsConstant.QUERY_CACHE_COUNT)); } } }
[ "bloriot97@gmail.com" ]
bloriot97@gmail.com
2bdcae0d4747a471d43b86f75ce57dd92b256b60
b1c1f87e19dec3e06b66b60ea32943ca9fceba81
/spring-beans/src/test/java/org/springframework/beans/propertyeditors/URLEditorTests.java
a5d2acf6a1dcae1cc864d8f066c8eaa5ddedffed
[ "Apache-2.0" ]
permissive
JunMi/SpringFramework-SourceCode
d50751f79803690301def6478e198693e2ff7348
4918e0e6a0676a62fd2a9d95acf6eb4fa5edb82b
refs/heads/master
2020-06-19T10:55:34.451834
2019-07-13T04:32:14
2019-07-13T13:11:54
196,678,387
1
0
null
null
null
null
UTF-8
Java
false
false
2,925
java
/* * Copyright 2002-2016 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.beans.propertyeditors; import java.beans.PropertyEditor; import java.net.URL; import org.junit.Test; import org.springframework.util.ClassUtils; import static org.junit.Assert.*; /** * @author Rick Evans * @author Chris Beams */ public class URLEditorTests { @Test(expected = IllegalArgumentException.class) public void testCtorWithNullResourceEditor() throws Exception { new URLEditor(null); } @Test public void testStandardURI() throws Exception { PropertyEditor urlEditor = new URLEditor(); urlEditor.setAsText("mailto:juergen.hoeller@interface21.com"); Object value = urlEditor.getValue(); assertTrue(value instanceof URL); URL url = (URL) value; assertEquals(url.toExternalForm(), urlEditor.getAsText()); } @Test public void testStandardURL() throws Exception { PropertyEditor urlEditor = new URLEditor(); urlEditor.setAsText("https://www.springframework.org"); Object value = urlEditor.getValue(); assertTrue(value instanceof URL); URL url = (URL) value; assertEquals(url.toExternalForm(), urlEditor.getAsText()); } @Test public void testClasspathURL() throws Exception { PropertyEditor urlEditor = new URLEditor(); urlEditor.setAsText("classpath:" + ClassUtils.classPackageAsResourcePath(getClass()) + "/" + ClassUtils.getShortName(getClass()) + ".class"); Object value = urlEditor.getValue(); assertTrue(value instanceof URL); URL url = (URL) value; assertEquals(url.toExternalForm(), urlEditor.getAsText()); assertTrue(!url.getProtocol().startsWith("classpath")); } @Test(expected = IllegalArgumentException.class) public void testWithNonExistentResource() throws Exception { PropertyEditor urlEditor = new URLEditor(); urlEditor.setAsText("gonna:/freak/in/the/morning/freak/in/the.evening"); } @Test public void testSetAsTextWithNull() throws Exception { PropertyEditor urlEditor = new URLEditor(); urlEditor.setAsText(null); assertNull(urlEditor.getValue()); assertEquals("", urlEditor.getAsText()); } @Test public void testGetAsTextReturnsEmptyStringIfValueNotSet() throws Exception { PropertyEditor urlEditor = new URLEditor(); assertEquals("", urlEditor.getAsText()); } }
[ "648326357@qq.com" ]
648326357@qq.com
ac25b46d4c7fba1c9478016e578745fe9a4cfd2c
1841aa601635a7cfa272010b8cdf122a8af5d6a6
/dm-uap-common/src/main/java/com/dm/uap/controller/RoleGroupController.java
bebd04a943bc85888672a6a32ad241841afa72ac
[]
no_license
SuperRookieMam/dm-parent
6a5b5c6fba4e2c71534cb70448fa2b5da7df379d
e0e4dbdf577343da07669075928ba633c6f87935
refs/heads/master
2020-06-02T20:43:45.808802
2019-05-25T11:54:02
2019-05-25T11:54:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,070
java
package com.dm.uap.controller; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Pageable; import org.springframework.data.web.PageableDefault; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; import com.dm.uap.converter.RoleGroupConverter; import com.dm.uap.dto.RoleGroupDto; import com.dm.uap.service.RoleGroupService; import static org.springframework.http.HttpStatus.*; @RestController @RequestMapping("roleGroups") public class RoleGroupController { @Autowired private RoleGroupService roleGroupService; @Autowired private RoleGroupConverter roleGroupConverter; @GetMapping public List<RoleGroupDto> listAll(@PageableDefault(size = 1000) Pageable pageable) { return roleGroupConverter.toDto(roleGroupService.search(null, pageable)); } @PostMapping @ResponseStatus(CREATED) public RoleGroupDto save(@RequestBody RoleGroupDto data) { return roleGroupConverter.toDto(roleGroupService.save(data)); } @DeleteMapping("{id}") @ResponseStatus(NO_CONTENT) public void delete(@PathVariable("id") Long id) { roleGroupService.deleteById(id); } @PutMapping @ResponseStatus(CREATED) public RoleGroupDto update( @PathVariable("id") Long id, @RequestBody RoleGroupDto data) { return roleGroupConverter.toDto(roleGroupService.update(id, data)); } @GetMapping("{id}") public RoleGroupDto findById(@PathVariable("id") Long id) { return roleGroupConverter.toDto(roleGroupService.findById(id)); } }
[ "ldwqh0@outlook.com" ]
ldwqh0@outlook.com
5996c1543675a9270bc69670809d49d943269f36
7dd2de1fc260c1c570140efb0afdd119226b2e1e
/packages/internal/distributedWekaSpark3Dev/src/main/java/weka/distributed/spark/ParquetDataSink.java
4c3d93e5bd9d79e687c7f5c8421afbb97db316e1
[]
no_license
Waikato/weka-3.8
489f7f6feb505c7f77d8a5f151e9b7b201938fb4
04804ccd6dff03534cbf3f2a71a35c73eef24fe8
refs/heads/master
2022-08-16T10:09:53.720693
2022-08-10T01:25:51
2022-08-10T01:25:51
135,419,657
198
144
null
2022-07-06T20:07:39
2018-05-30T09:25:20
Java
UTF-8
Java
false
false
3,652
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/>. */ /* * ParquetDataSink * Copyright (C) 2016 University of Waikato, Hamilton, New Zealand * */ package weka.distributed.spark; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; import org.apache.spark.api.java.JavaSparkContext; import org.apache.spark.sql.Dataset; import org.apache.spark.sql.Row; import weka.distributed.DistributedWekaException; /** * DataSink for writing to Parquet files from {@code Dataset<Row>}s * * @author Mark Hall (mhall{[at]}pentaho{[dot]}com) * @version $Revision: $ */ public class ParquetDataSink extends FileDataSink { protected static final String OUTPUT_SUBDIR = "parquet"; private static final long serialVersionUID = -6072669888962657860L; /** * Constructor */ public ParquetDataSink() { setJobName("Parquet data sink"); setJobDescription("Save data frames to a parquet files"); } /** * Run the job * * @param sparkContext the spark context to use * @return true if successful * @throws IOException if a problem occurs * @throws DistributedWekaException if a problem occurs */ @Override public boolean runJobWithContext(JavaSparkContext sparkContext) throws IOException, DistributedWekaException { super.runJobWithContext(sparkContext); String outputPath = environmentSubstitute(m_sjConfig.getOutputDir()); outputPath = addSubdirToPath(outputPath, OUTPUT_SUBDIR); String outputFilename = environmentSubstitute(getOutputSubDir()); if (!outputFilename.toLowerCase().endsWith(".parquet")) { outputFilename = outputFilename + ".parquet"; } outputPath += (outputPath.toLowerCase().contains("://") ? "/" : File.separator); outputPath = SparkUtils.resolveLocalOrOtherFileSystemPath(outputPath); cleanOutputSubdirectory(outputPath); List<String> datasetTypes = new ArrayList<String>(); Iterator<Map.Entry<String, WDDataset>> datasetIterator = m_datasetManager.getDatasetIterator(); List<Dataset<Row>> dataFrames = new ArrayList<Dataset<Row>>(); while (datasetIterator.hasNext()) { Map.Entry<String, WDDataset> ne = datasetIterator.next(); if (ne.getValue().getDataFrame() != null) { dataFrames.add(ne.getValue().getDataFrame()); datasetTypes.add(ne.getKey()); } else if (ne.getValue().getRDD() != null) { // TODO convert the RDD back into a data frame } } dataFrames = applyColumnNamesOrNamesFile(dataFrames); for (int i = 0; i < dataFrames.size(); i++) { Dataset<Row> df = dataFrames.get(i); df = coalesceToOnePartitionIfNecessary(df); df = cleanseColumnNames(df); String datasetType = datasetTypes.get(i); df.write().save(outputPath + datasetType + "_" + outputFilename); /* df.write().format("parquet") .save(outputPath + datasetType + "_" + outputFilename); */ } return true; } }
[ "mhall@e0a1b77d-ad91-4216-81b1-defd5f83fa92" ]
mhall@e0a1b77d-ad91-4216-81b1-defd5f83fa92
ffc81bf157c7278d7856763e86e733f6a99759a6
9d6089379238e00c0a5fb2949c1a6e7c19b50958
/bin/ext-integration/sap/core/sapcore/src/de/hybris/platform/sap/core/runtime/SAPHybrisSessionProvider.java
d4b07883f2ec33c4a633a508c9791ac9e90065f5
[]
no_license
ChintalaVenkat/learning_hybris
55ce582b4796a843511d0ea83f4859afea52bd88
6d29f59578512f9fa44a3954dc67d0f0a5216f9b
refs/heads/master
2021-06-18T17:47:12.173132
2021-03-26T11:00:09
2021-03-26T11:00:09
193,689,090
0
0
null
2019-06-25T10:46:40
2019-06-25T10:46:39
null
UTF-8
Java
false
false
5,700
java
/* * [y] hybris Platform * * Copyright (c) 2000-2014 hybris AG * All rights reserved. * * This software is the confidential and proprietary information of hybris * ("Confidential Information"). You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of the * license agreement you entered into with hybris. * * */ package de.hybris.platform.sap.core.runtime; import de.hybris.platform.regioncache.ConcurrentHashSet; import de.hybris.platform.sap.core.common.util.GenericFactory; import de.hybris.platform.servicelayer.event.events.BeforeSessionCloseEvent; import de.hybris.platform.servicelayer.event.impl.AbstractEventListener; import de.hybris.platform.servicelayer.session.Session; import de.hybris.platform.servicelayer.session.SessionService; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; /** * SAP Hybris Session Provider. */ public class SAPHybrisSessionProvider extends AbstractEventListener<BeforeSessionCloseEvent> { /** * Alias of the SAP hybris session. */ public static String SAP_HYBRIS_SESSION_ALIAS = "sapCoreHybrisSession"; //NOPMD /** * Session attribute to store the SAP hybris session. */ public static String SAP_HYBRIS_SESSION_ATTRIBUTE = "SAPHybrisSession"; //NOPMD /** * hybris {@link SessionService}. */ protected SessionService sessionService; //NOPMD /** * {@link GenericFactory} reference. */ protected GenericFactory genericFactory; //NOPMD /** * Set of listeners which listens to the {@link SAPHybrisSessionEventListener} interface. */ protected Set<SAPHybrisSessionEventListener> eventListener = new ConcurrentHashSet<SAPHybrisSessionEventListener>(); //NOPMD /** * Session which are about to be deleted. */ protected final Map<Session, SAPHybrisSession> sessionsToBeDeleted = new ConcurrentHashMap<Session, SAPHybrisSession>(); //NOPMD /** * Injection setter for the hybris {@link SessionService}. * * @param sessionService * hybris {@link SessionService} */ public void setSessionService(final SessionService sessionService) { this.sessionService = sessionService; } /** * Injection setter for the {@link GenericFactory}. * * @param genericFactory * the {@link GenericFactory} to set */ public void setGenericFactory(final GenericFactory genericFactory) { this.genericFactory = genericFactory; } /** * Gets the current {@link SAPHybrisSession}. * * @return {@link SAPHybrisSession} */ public SAPHybrisSession getSAPHybrisSession() { return getSAPHybrisSessionInternal(); } /** * Destroys the current {@link SAPHybrisSession}. */ public void destroySAPHybrisSession() { destroySAPHybrisSessionInternal(sessionService.getCurrentSession()); } /** * Checks if a {@link SAPHybrisSession} exists within the hybris {@link Session}. * * @return true, if session exists */ public boolean existsSAPHybrisSession() { final Session defaultSession = sessionService.getCurrentSession(); SAPHybrisSession sapHybrisSession = defaultSession.getAttribute(SAP_HYBRIS_SESSION_ATTRIBUTE); if (sapHybrisSession == null) { // Check if this is a session to be deleted sapHybrisSession = sessionsToBeDeleted.get(defaultSession); } return (sapHybrisSession != null); } /** * Registers a {@link SAPHybrisSessionEventListener}. * * @param listener * Event listener */ public void registerEventListener(final SAPHybrisSessionEventListener listener) { eventListener.add(listener); } /** * Unregisters a {@link SAPHybrisSessionEventListener}. * * @param listener * Event listener */ public void unregisterEventListener(final SAPHybrisSessionEventListener listener) { eventListener.remove(listener); } @Override protected void onEvent(final BeforeSessionCloseEvent event) { // BeforeSessionCloseEvent if (event instanceof BeforeSessionCloseEvent) { final Session toBeClosedSession = sessionService.getBoundSession(event.getSource()); destroySAPHybrisSessionInternal(toBeClosedSession); } } /** * Creates the {@link SAPHybrisSession} if it does not exist yet and returns it. * * @return {@link SAPHybrisSession} */ protected SAPHybrisSession getSAPHybrisSessionInternal() { final Session defaultSession = sessionService.getCurrentSession(); SAPHybrisSession sapHybrisSession = defaultSession.getAttribute(SAP_HYBRIS_SESSION_ATTRIBUTE); if (sapHybrisSession == null) { if (sessionsToBeDeleted.containsKey(defaultSession)) { return sessionsToBeDeleted.get(defaultSession); } sapHybrisSession = (SAPHybrisSession) genericFactory.getBean(SAP_HYBRIS_SESSION_ALIAS); sapHybrisSession.setSessionId(defaultSession.getSessionId()); defaultSession.setAttribute(SAP_HYBRIS_SESSION_ATTRIBUTE, sapHybrisSession); } return sapHybrisSession; } /** * Destroys the current {@link SAPHybrisSession} if exists. * * @param session * hybris {@link Session} */ protected void destroySAPHybrisSessionInternal(final Session session) { final SAPHybrisSession sapHybrisSession = (SAPHybrisSession) session.getAttribute(SAP_HYBRIS_SESSION_ATTRIBUTE); if (sapHybrisSession != null) { sessionsToBeDeleted.put(sessionService.getCurrentSession(), sapHybrisSession); sapHybrisSession.destroy(); sessionsToBeDeleted.remove(sessionService.getCurrentSession()); for (final SAPHybrisSessionEventListener sapHybrisSessionEventListener : eventListener) { sapHybrisSessionEventListener.onAfterDestroy(sapHybrisSession); } session.removeAttribute(SAP_HYBRIS_SESSION_ATTRIBUTE); } } }
[ "a.basov@aimprosoft.com" ]
a.basov@aimprosoft.com
04e3c59e96aa4447a372894c5c6f54b158099a7a
e235e7e9e59bdffe730b3ae6f937de5fb174c8ef
/mineplex/minecraft/game/classcombat/shop/salespackage/SkillSalesPackage.java
d2cd5c12dceb01355f998adc35b23c673f8a8e46
[]
no_license
gabrielvicenteYT/MineplexHub
cbc2b3800d9ac8ade7b587414d2d5f27f80c74ec
a724d5bc92e9b3197bca013863e06e7c93c339f4
refs/heads/master
2022-11-21T02:56:52.851248
2020-07-26T00:59:09
2020-07-26T00:59:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
620
java
package mineplex.minecraft.game.classcombat.shop.salespackage; import mineplex.core.common.CurrencyType; import mineplex.core.shop.item.SalesPackageBase; import mineplex.minecraft.game.classcombat.Skill.ISkill; import org.bukkit.Material; import org.bukkit.entity.Player; public class SkillSalesPackage extends SalesPackageBase { public SkillSalesPackage(ISkill skill) { super("Champions " + skill.GetName(), Material.BOOK, (byte)0, skill.GetDesc(0), skill.GetGemCost()); this.Free = skill.IsFree(); this.KnownPackage = false; } public void Sold(Player player, CurrencyType currencyType) {} }
[ "48403150+ItsNeverAlan@users.noreply.github.com" ]
48403150+ItsNeverAlan@users.noreply.github.com
5dd20a74d412395d4aa6ead040c1696c712bb933
7e512d95c474399d054a165e082c72277f13089b
/legacy-core/src/main/java/archimedes/model/IndexMetaData.java
5c1d30467e714f30ceb682bddfd46ed1629a4d81
[ "Apache-2.0" ]
permissive
greifentor/archimedes-legacy
d8ec4baa38d6c55c1d3e3177cc6964598541ad1e
996ec2a9d97ba684574849472a8b5b28beaa1825
refs/heads/master
2023-09-01T06:08:45.643685
2023-08-29T09:43:33
2023-08-29T09:43:33
214,502,614
0
0
Apache-2.0
2023-08-29T09:43:35
2019-10-11T18:15:48
Java
UTF-8
Java
false
false
4,218
java
/* * IndexModel.java * * 14.12.2011 * * (c) by O.Lieshoff * */ package archimedes.model; import gengen.metadata.*; /** * Dieses Interface definiert die Schnittstelle eines Index-Objekte. Mit Index ist in diesem * Fall ein Index auf ein Feld (oder mehrere) der Datenbank gemeint. * * <P>Die Implementierungen des Interfaces sollten alphabetisch nach Indexnamen sortierbar sein. * * @author O.lieshoff * * @changed OLI 14.12.2011 - Hinzugef&uuml;gt. * @changed OLI 18.12.2011 - Umstellung auf Tabellen- und Tabellenspaltenobjekte. */ public interface IndexMetaData extends Comparable, NamedObject { /** * F&uuml;gt eine Tabellenspalte in den Index ein, die in dem Index ber&uuml;cksichtigt * werden soll. * * @param column Die Tabellenspalte, der an den Index angef&uuml;gt werden soll. * @throws IllegalArgumentException Falls ein der Vorbedingungen verletzt wird. * @precondition column != <CODE>null</CODE> * * @changed OLI 14.12.2011 - Hinzugef&uuml;gt. */ abstract public void addColumn(AttributeMetaData column) throws IllegalArgumentException; /** * L&ouml;scht alle Spaltenzuordnungen f&uuml;r den Index. * * @changed OLI 16.12.2011 - Hinzugef&uuml;gt. */ abstract public void clearColumns(); /** * Liefert eine Liste der in dem Index ber&uuml;cksichtigten Tabellenspalten. * * @return Eine Liste der in dem Index ber&uuml;cksichtigten Tabellenspalten. * * @changed OLI 14.12.2011 - Hinzugef&uuml;gt. */ abstract public AttributeMetaData[] getColumns(); /** * Liefert den Namen des Index. * * @return Der Name des Index. * * @changed OLI 14.12.2011 - Hinzugef&uuml;gt. */ abstract public String getName(); /** * Liefert die Tabelle, f&uuml;r die der Index erstellt werden soll. * * @return Die Tabelle, f&uuml;r die der Index erstellt werden soll * * @changed OLI 14.12.2011 - Hinzugef&uuml;gt. */ abstract public ClassMetaData getTable(); /** * Pr&uuml;ft, ob die Tabellenspalte mit dem angegebenen Namen durch den Index referenziert * wird. * * @param name Der Name der Tabellenspalte, auf die gepr&uuml;ft werden soll. * @return <CODE>true</CODE>, wenn die Tabellenspalte mit dem angegebenen Namen durch den * Index referenziert wird, <CODE>false</CODE>. * @throws IllegaleArgumentException Falls eine der Vorbedingungen verletzt wird. * @precondition name != <CODE>null</CODE> * @precondition !name.isEmpty() * * @changed OLI 20.12.2011 - Hinzugef&uuml;gt. */ abstract public boolean isMember(String name) throws IllegalArgumentException; /** * L&oumkl;scht eine Tabellenspalte aus der Liste der f&uuml;r den Index zu * ber&uuml;cksichtigenden Tabellenspalten. * * @param column Die Tabellenspalte, die aus dem Index entfernt werden soll. * @throws IllegalArgumentException Falls ein der Vorbedingungen verletzt wird. * @precondition column != <CODE>null</CODE> * * @changed OLI 14.12.2011 - Hinzugef&uuml;gt. */ abstract public void removeColumn(AttributeMetaData column) throws IllegalArgumentException; /** * Setzt einen neuen Namen f&uuml;r den Index ein. * * @param name Der neue Name zum Index. * @throws IllegalArgumentException Falls eine der Vorbedingungen verletzt wird. * @precondition name != <CODE>null</CODE> * @precondition !name.isEmpty() * * @changed OLI 14.12.2011 - Hinzugef&uuml;gt. */ abstract public void setName(String name) throws IllegalArgumentException; /** * Setzt die angegebene Tabelle als neue Tabelle ein, f&uuml;r die der Index erzeugt werden * soll. * * @param table Die neue Tabelle, f&uuml;r die der Index erzeugt werden soll. * @throws IllegalArgumentException Falls eine der Vorbedingungen verletzt wird. * @precondition table != <CODE>null</CODE> * * @changed OLI 14.12.2011 - Hinzugef&uuml;gt. */ abstract public void setTable(ClassMetaData table) throws IllegalArgumentException; }
[ "lieshoff@gmx.de" ]
lieshoff@gmx.de
f07697869a0d98efcb65f8a89a1ac06a8f5b7d2c
488c1e7f4b52e23aa0cdc4c7258509228982e809
/src/sample/connectToDb/Const.java
23b8f31d18b72d2fcbdad26714a9c3dee5d258c5
[]
no_license
Reshko/desktop_application
aa1d9060f8f6ac78ae7a34cc323e74ab409cf4e3
13007958b199f737a4f34ee977b0d61c33125a12
refs/heads/master
2023-02-21T13:03:00.682647
2021-01-26T18:15:37
2021-01-26T18:15:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
335
java
package sample.connectToDb; public class Const { public static final String USER_TABLE = "users"; public static final String USER_ID = "idusers"; public static final String USER_TYPE = "userstype"; public static final String USER_LOGIN = "userslogin"; public static final String USER_PASSWORD = "userspassword"; }
[ "you@example.com" ]
you@example.com
2dc2d0fd0774144aae82b15e4cd4537cdffa72f4
e75ac9b79be8de091dbc4dbd745bea06993d1cd1
/src/main/java/de/julielab/costosys/configuration/ConfigBase.java
60a09c317f06b3065a1617b2c989f3fe42814a20
[ "BSD-2-Clause" ]
permissive
JULIELab/costosys
922c837bd2edf60a448c645bf134289af9e1434c
ad15cdcd4b5607c336ff3db6614e461f3b25757b
refs/heads/master
2023-06-24T05:35:42.166521
2023-03-09T20:38:16
2023-03-09T20:38:16
119,691,155
2
1
BSD-2-Clause
2023-06-14T22:44:12
2018-01-31T13:32:02
Java
UTF-8
Java
false
false
1,498
java
package de.julielab.costosys.configuration; import com.ximpleware.*; import de.julielab.costosys.dbconnection.DataBaseConnector; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; import java.util.ArrayList; import java.util.List; public abstract class ConfigBase { /** * Used to determine which of the elements in the configuration file * is set as active. * * @param data - the configuration file * @param activePath - xpath to the element which defines the active configuration * @return - the name of the active configuration * @throws IOException * @throws VTDException */ public static String getActiveConfig(byte[] data, String activePath) throws VTDException { VTDGen vg = new VTDGen(); vg.setDoc(data); vg.parse(true); VTDNav vn = vg.getNav(); AutoPilot ap = new AutoPilot(vn); ap.selectXPath(activePath); if (ap.evalXPath() != -1) { int textNodeIndex = vn.getText(); if (textNodeIndex != -1) return vn.toRawString(textNodeIndex); } return null; } /** * Used to get an element by its relative xpath. * * @param ap - a vtd autopilot * @param xpath - xpath to the element which shall be returned * @return - String representation of the element * @throws XPathParseException */ protected String stringFromXpath(AutoPilot ap, String xpath) throws XPathParseException { ap.selectXPath(xpath); String string = ap.evalXPathToString(); ap.resetXPath(); return string; } }
[ "chew@gmx.net" ]
chew@gmx.net
e296a2efdd476f4df9aefe105f53302d30c1bfd5
0af8b92686a58eb0b64e319b22411432aca7a8f3
/single-large-project/src/main/java/org/gradle/test/performancenull_66/Productionnull_6541.java
840f0193d1c5d74af3b59daf25357b9fb94d843c
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
585
java
package org.gradle.test.performancenull_66; public class Productionnull_6541 { private final String property; public Productionnull_6541(String param) { this.property = param; } public String getProperty() { return property; } private String prop0; public String getProp0() { return prop0; } public void setProp0(String value) { prop0 = value; } private String prop1; public String getProp1() { return prop1; } public void setProp1(String value) { prop1 = value; } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
1a395621a0216cd9841cfa1706c6f15f6b3d633e
c6bb6f275d6ba2fdc7f1a659cd466f1877c1aa33
/src/main/java/com/gmail/antonsyzko/doctoradministrationpanel/dao/AbstractDao.java
fca6add347bf0475e388f40987ed5479e5b6a0b6
[ "MIT" ]
permissive
AntonSyzko/antonsyzkodemo
e6ad3e7276dcb6a45d48b88e294959114f643c71
a8d53b7b53e1f076ad453ded803843f9083ad15a
refs/heads/master
2020-09-16T17:55:15.341049
2016-10-24T11:14:56
2016-10-24T11:14:56
66,774,564
0
0
null
null
null
null
UTF-8
Java
false
false
1,154
java
package com.gmail.antonsyzko.doctoradministrationpanel.dao; import org.hibernate.Criteria; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; import java.io.Serializable; import java.lang.reflect.ParameterizedType; public abstract class AbstractDao<PK extends Serializable, T> { private final Class<T> persistentClass; @SuppressWarnings("unchecked") public AbstractDao(){ this.persistentClass =(Class<T>) ((ParameterizedType) this.getClass().getGenericSuperclass()).getActualTypeArguments()[1]; } @Autowired private SessionFactory sessionFactory; protected Session getSession(){ return sessionFactory.getCurrentSession(); } @SuppressWarnings("unchecked") public T getByKey(PK key) { return (T) getSession().get(persistentClass, key); } public void persist(T entity) { getSession().persist(entity); } public void update(T entity) { getSession().update(entity); } public void delete(T entity) { getSession().delete(entity); } protected Criteria createEntityCriteria(){ return getSession().createCriteria(persistentClass); } }
[ "antonio.shizko@gmail.com" ]
antonio.shizko@gmail.com
f9393953aa52b73cfa4a8250215e86785c18d18f
910bf441426e25bb12d402b08e78d18a02257076
/wave/src/main/java/com/magicsoft/wave/design/adapter/test_one/test_two/class_adapter/HKOutlet.java
a1af0413640536b024837ab4982e442e9eb89a28
[]
no_license
KiWiLss/ViewPagerTransform
48eac36581fdce1a77fbcee03aee368c2a8a7026
3259ff581a7a1a78f9673c7c58364cb5de8f1c32
refs/heads/master
2021-08-30T12:59:48.856649
2017-12-18T03:05:08
2017-12-18T03:05:08
109,917,253
0
0
null
null
null
null
UTF-8
Java
false
false
756
java
package com.magicsoft.wave.design.adapter.test_one.test_two.class_adapter; /** * ----------------------------------------------------------------- * Copyright (C) 2014-2016, by your company, All rights reserved. * ----------------------------------------------------------------- * * @File: HKOutlet.java * @Author: winding.kiwi.lss * @Version: V100R001C01 * @Create: 2017/11/29 13:08 * @Changes (from 2017/11/29) * ----------------------------------------------------------------- * 2017/11/29 : Create HKOutlet.java (winding); * ----------------------------------------------------------------- * @description ${DESCRIPTION} */ public class HKOutlet { public String getHKType() { return "British three - pin socket"; } }
[ "m15205622327@163.com" ]
m15205622327@163.com
1bd278be955ace5bd7485303786bef7902a208fc
0408d9c970ebf010654c30d36aceb1b4022dd6cf
/java/src/generated/java/net/asam/openscenario/v1_0/parser/xml/WaypointXmlParser.java
7a2cd9d016fa3ea47d5ff2065576544cc9334d3d
[ "Apache-2.0", "BSD-3-Clause", "MIT", "Zlib" ]
permissive
aprilrain0505/openscenario.api.test
d7c9de1a05437b64bcbff6ee7f953c7218d892fc
a1a373e4a893892f953397af282b01ef774271da
refs/heads/master
2023-06-12T18:50:19.289307
2021-07-02T13:21:12
2021-07-02T13:21:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,147
java
/* * Copyright 2020 RA Consulting * * RA Consulting GmbH licenses this file 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 net.asam.openscenario.v1_0.parser.xml; import java.util.ArrayList; import java.util.Hashtable; import java.util.List; import java.util.Map; import net.asam.openscenario.common.ErrorLevel; import net.asam.openscenario.common.FileContentMessage; import net.asam.openscenario.common.IParserMessageLogger; import net.asam.openscenario.common.Textmarker; import net.asam.openscenario.parser.ParserContext; import net.asam.openscenario.parser.modelgroup.XmlSequenceParser; import net.asam.openscenario.parser.type.XmlComplexTypeParser; import net.asam.openscenario.simple.struct.IndexedElement; import net.asam.openscenario.v1_0.api.RouteStrategy; import net.asam.openscenario.v1_0.common.OscConstants; import net.asam.openscenario.v1_0.impl.PositionImpl; import net.asam.openscenario.v1_0.impl.WaypointImpl; import net.asam.xml.indexer.Position; /** * This is a automatic generated file according to the OpenSCENARIO specification version 1.0 * Filling a WaypointImpl instance from an xml tree. * * @author RA Consulting OpenSCENARIO generation facility */ public class WaypointXmlParser extends XmlComplexTypeParser<WaypointImpl> { /** * Constructor * * @param messageLogger to log messages during parsing * @param filename to locate the messages in a file */ public WaypointXmlParser(IParserMessageLogger messageLogger, String filename) { super(messageLogger, filename); this.subElementParser = new SubElementParser(messageLogger, filename); } @Override protected Map<String, IAttributeParser<WaypointImpl>> getAttributeNameToAttributeParserMap() { Map<String, IAttributeParser<WaypointImpl>> result = new Hashtable<>(); result.put( OscConstants.ATTRIBUTE__ROUTE_STRATEGY, new IAttributeParser<WaypointImpl>() { @SuppressWarnings("synthetic-access") @Override public void parse( Position startPosition, Position endPosition, String attributeName, String attributeValue, WaypointImpl object) { Textmarker startMarker = new Textmarker( startPosition.getLine(), startPosition.getColumn(), WaypointXmlParser.this.filename); Textmarker endMarker = new Textmarker( endPosition.getLine(), endPosition.getColumn(), WaypointXmlParser.this.filename); if (isParametrized(attributeValue)) { object.setAttributeParameter( OscConstants.ATTRIBUTE__ROUTE_STRATEGY, stripDollarSign(attributeValue), startMarker); } else { // Parse value // Enumeration Type RouteStrategy result = RouteStrategy.getFromLiteral(attributeValue); if (result != null) { object.setRouteStrategy(result); } else { WaypointXmlParser.this.messageLogger.logMessage( new FileContentMessage( "Value '" + attributeValue + "' is not allowed.", ErrorLevel.ERROR, startMarker)); } } object.putPropertyStartMarker(OscConstants.ATTRIBUTE__ROUTE_STRATEGY, startMarker); object.putPropertyEndMarker(OscConstants.ATTRIBUTE__ROUTE_STRATEGY, endMarker); } @Override public int getMinOccur() { return 1; } }); return result; } /** Parser for all subelements */ private class SubElementParser extends XmlSequenceParser<WaypointImpl> { /** * Constructor * * @param messageLogger to log messages during parsing * @param filename to locate the messages in a file */ public SubElementParser(IParserMessageLogger messageLogger, String filename) { super(messageLogger, filename); } /* * Creates a list of parser */ @Override protected List<IElementParser<WaypointImpl>> createParserList() { List<IElementParser<WaypointImpl>> result = new ArrayList<>(); result.add(new SubElementPositionParser()); return result; } } /** A parser for subelement position */ @SuppressWarnings("synthetic-access") private class SubElementPositionParser implements IElementParser<WaypointImpl> { /** Constructor */ public SubElementPositionParser() { super(); this.positionXmlParser = new PositionXmlParser( WaypointXmlParser.this.messageLogger, WaypointXmlParser.this.filename); } private PositionXmlParser positionXmlParser; @Override public void parse( IndexedElement indexedElement, ParserContext parserContext, WaypointImpl object) { PositionImpl position = new PositionImpl(); // Setting the parent position.setParent(object); this.positionXmlParser.parseElement(indexedElement, parserContext, position); object.setPosition(position); } @Override public int getMinOccur() { return 1; } @Override public int getMaxOccur() { return 1; } @Override public boolean doesMatch(String elementName) { return elementName.equals(OscConstants.ELEMENT__POSITION); } @Override public String[] getExpectedTagNames() { return new String[] {OscConstants.ELEMENT__POSITION}; } } }
[ "a.hege@rac.de" ]
a.hege@rac.de
1abf774772d80196bd252084faa01b21846383aa
c79a207f5efdc03a2eecea3832b248ca8c385785
/com.googlecode.jinahya/mhp-1.1.2/1.1/src/main/java/com/sun/tv/si/SIRequestImpl.java
f0e3fd41a48159abb6f431a63e57cac8287ba0a2
[]
no_license
jinahya/jinahya
977e51ac2ad0af7b7c8bcd825ca3a576408f18b8
5aef255b49da46ae62fb97bffc0c51beae40b8a4
refs/heads/master
2023-07-26T19:08:55.170759
2015-12-02T07:32:18
2015-12-02T07:32:18
32,245,127
2
1
null
2023-07-12T19:42:46
2015-03-15T04:34:19
Java
UTF-8
Java
false
false
7,001
java
/* * @(#)SIRequestImpl.java 1.15 00/01/19 * * Copyright 1998-2000 by Sun Microsystems, Inc., * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. * All rights reserved. * * This software is the confidential and proprietary information * of Sun Microsystems, Inc. ("Confidential Information"). You * shall not disclose such Confidential Information and shall use * it only in accordance with the terms of the license agreement * you entered into with Sun. */ package com.sun.tv.si; import javax.tv.locator.*; import javax.tv.service.*; import javax.tv.service.guide.*; import javax.tv.service.navigation.*; import com.sun.tv.*; import com.sun.tv.receiver.*; /** * * This interface is implemented by application classes in order to * receive the results of asynchronous SI retrieval requests. The * <code>SIRequestImpl</code> registers itself at the time of the * asynchronous call for a single request and is automatically * unregistered when the request is completed. Applications may * identify individual requests when the methods of this interface are * called by registering a unique <code>SIRequestImpl</code> for each * simultaneous asynchronous request.<p> * * The asynchronous SI retrieval mechanisms invoke the methods of this * interface using system threads that are guaranteed to not hold * locks on application objects. */ public class SIRequestImpl implements SIRequest { long requestTime = System.currentTimeMillis(); SIRequestor requestor = null; Locator locator = null; int requestKind = Settings.REQ_GENERAL; Object userData[] = null; public SIRequestImpl(SIRequestor requestor, Locator locator) { this.requestor = requestor; this.locator = locator; this.requestKind = Settings.REQ_GENERAL; this.userData = null; ((SIManagerImpl)SIManager.createInstance()).makeRequest(this); } public SIRequestImpl(SIRequestor requestor, Locator locator, int requestKind) { this.requestor = requestor; this.locator = locator; this.requestKind = requestKind; this.userData = null; ((SIManagerImpl)SIManager.createInstance()).makeRequest(this); } public SIRequestImpl(SIRequestor requestor, Locator locator, int requestKind, Object userData) { this.requestor = requestor; this.locator = locator; this.requestKind = requestKind; this.userData = new Object[1]; this.userData[0] = userData; ((SIManagerImpl)SIManager.createInstance()).makeRequest(this); } public SIRequestImpl(SIRequestor requestor, Locator locator, int requestKind, Object userData1, Object userData2) { this.requestor = requestor; this.locator = locator; this.requestKind = requestKind; this.userData = new Object[2]; this.userData[0] = userData1; this.userData[1] = userData2; ((SIManagerImpl)SIManager.createInstance()).makeRequest(this); } public SIRequestImpl(SIRequestor requestor, Locator locator, int requestKind, Object userData[]) { this.requestor = requestor; this.locator = locator; this.requestKind = requestKind; this.userData = userData; ((SIManagerImpl)SIManager.createInstance()).makeRequest(this); } public Locator getLocator() { return locator; } public int getRequestKind() { return requestKind; } public Object getUserData(int slot) { if (slot < 0 || slot >= userData.length) { return null; } return userData[slot]; } public boolean isExpired() { return ((System.currentTimeMillis() - requestTime) > Settings.REQUEST_DURATION); } /** * Notifies the <code>SIRequestImpl</code> of successful asynchronous * SI retrieval. * * @param result The previously requested data. */ public void notifySuccess(SIRetrievable[] result) { requestor.notifySuccess(result); } /** * Notifies the <code>SIRequestImpl</code> of unsuccessful asynchronous * SI retrieval. * * @param reason The reason why the asynchronous request failed. */ public void notifyFailure(SIRequestFailureType reason) { requestor.notifyFailure(reason); } /** * * Cancels a pending request. If the request is still pending and * can be canceled then the <code>notifyFailture</code> method of * the <code>SIRequestor</code> that initiated the asynchronous * retrieval will be called with the * <code>SIRequestFailureType</code> code of * <code>CANCELED</code>. If the request is no longer pending then no * action is performed. * * @return <code>True</code> if the request was pending and * successfully canceled; <code>false</code> otherwise. * * @see SIRequestor#notifyFailure * @see SIRequestFailureType#CANCELED */ public boolean cancel() { return ((SIManagerImpl)SIManager.createInstance()).cancel(this); } public boolean equals(SIElement element) { switch (requestKind) { case Settings.REQ_GENERAL: case Settings.REQ_SERVICE_DESCRIPTION: case Settings.REQ_PROGRAM_EVENT: default: String locatorStr2 = locator.toExternalForm(); if (LocatorImpl.isSameProtocol(element.getLocator(), locator) && locatorStr2.endsWith(":/*")) return true; return LocatorImpl.equals(element.getLocator(), locator); case Settings.REQ_SERVICE_COMPONENT: { if (!(element instanceof ServiceComponentImpl)) return false; Locator locator1 = locator; Locator locator2 = element.getLocator(); String serviceName1 = LocatorImpl.getServiceName(locator1); String serviceName2 = LocatorImpl.getServiceName(locator2); if (equals(serviceName1, serviceName2) == false) return false; String compName1 = LocatorImpl.getServiceComponentName(locator1); String compName2 = LocatorImpl.getServiceComponentName(locator2); if (compName1 == null) return true; return equals(compName1, compName2); } case Settings.REQ_CURRENT_PROGRAM_EVENT: case Settings.REQ_FUTURE_PROGRAM_EVENT: case Settings.REQ_FUTURE_PROGRAM_EVENTS: case Settings.REQ_NEXT_PROGRAM_EVENT: { if (!(element instanceof ProgramEventImpl)) return false; ProgramEventImpl pe = (ProgramEventImpl)element; Locator locator1 = locator; Locator locator2 = pe.getService().getLocator(); String serviceName1 = LocatorImpl.getServiceName(locator1); String serviceName2 = LocatorImpl.getServiceName(locator2); return equals(serviceName1, serviceName2); } case Settings.REQ_TRANSPORT_STREAM: { if (!(element instanceof TransportStreamImpl)) return false; TransportStreamImpl transportStream = (TransportStreamImpl) element; NetworkImpl network = (NetworkImpl)getUserData(0); return (network != null && network.getNetworkID() == transportStream.getNetworkID()); } } } private boolean equals(String str1, String str2) { if (str1 == null || str2 == null) return false; return str1.equals(str2); } }
[ "onacit@e3df469a-503a-0410-a62b-eff8d5f2b914" ]
onacit@e3df469a-503a-0410-a62b-eff8d5f2b914
d529b73a891ce0e4eda3f3c9f84c8a97a7c1f187
e852f4e9421ec7ceaf077abb07562ac7d012ec63
/mark1/trunk/doc/www.cafeconleche.org/books/xmljava/examples/04/Agency.java
3ef9503d1dfcbb32ab2b89becec274cebb35e40b
[]
no_license
webdsl/webdsl-legacy-repo
e181f0d9f6874f88db1d870dd7000e8f6513b3a1
0a78926ff988ed8d56ae90aed782aa16072be87d
refs/heads/master
2021-01-21T12:43:37.550267
2015-06-19T16:05:29
2015-06-19T16:05:29
37,973,923
0
1
null
null
null
null
UTF-8
Java
false
false
1,614
java
import java.util.*; public class Agency { private String code; private String name; private String treasuryCode; private String year; private List bureaus = new ArrayList(); private static Map instances = new HashMap(); // A private constructor so instantiators // have to use the factory method private Agency(String name, String code, String treasuryCode, String year) { this.name = name; this.code = code; this.treasuryCode = treasuryCode; this.year = year; } public static Agency getInstance(String name, String code, String treasuryCode, String year) { // Agencies can be uniquely identified by code alone String key = code+" "+year; Agency agency = (Agency) instances.get(key); if (agency == null) { agency = new Agency(name, code, treasuryCode, year); instances.put(key, agency); } return agency; } public void add(Bureau b) { if (!bureaus.contains(b)) { bureaus.add(b); } } public String getXML() { StringBuffer result = new StringBuffer(" <Agency>\r\n"); result.append(" <Name>" + name + "</Name>\r\n"); result.append(" <Code>" + code + "</Code>\r\n"); result.append(" <TreasuryAgencyCode>" + treasuryCode + "</TreasuryAgencyCode>\r\n"); Iterator iterator = bureaus.iterator(); while (iterator.hasNext()) { Bureau bureau = (Bureau) iterator.next(); result.append(bureau.getXML()); } result.append(" </Agency>\r\n"); return result.toString(); } }
[ "eelcovis@gmail.com" ]
eelcovis@gmail.com
a078971bc1327662187d1a1a0fdc78771ae333da
1ec73a5c02e356b83a7b867580a02b0803316f0a
/java/bj/bigData/Storm/ex02/ClusterTopologyFieldgrouping.java
77d96774c499b6907b3f6304f67e3e8502d07656
[]
no_license
jxsd0084/JavaTrick
f2ee8ae77638b5b7654c3fcf9bceea0db4626a90
0bb835fdac3c2f6d1a29d1e6e479b553099ece35
refs/heads/master
2021-01-20T18:54:37.322832
2016-06-09T03:22:51
2016-06-09T03:22:51
60,308,161
0
1
null
null
null
null
UTF-8
Java
false
false
3,342
java
package bj.bigData.Storm.ex02; import backtype.storm.Config; import backtype.storm.StormSubmitter; import backtype.storm.generated.AlreadyAliveException; import backtype.storm.generated.AuthorizationException; import backtype.storm.generated.InvalidTopologyException; import backtype.storm.spout.SpoutOutputCollector; import backtype.storm.task.OutputCollector; import backtype.storm.task.TopologyContext; import backtype.storm.topology.OutputFieldsDeclarer; import backtype.storm.topology.TopologyBuilder; import backtype.storm.topology.base.BaseRichBolt; import backtype.storm.topology.base.BaseRichSpout; import backtype.storm.tuple.Fields; import backtype.storm.tuple.Tuple; import backtype.storm.tuple.Values; import backtype.storm.utils.Utils; import java.util.Map; public class ClusterTopologyFieldgrouping { public static class DataSpout extends BaseRichSpout { private Map conf; private TopologyContext context; private SpoutOutputCollector collector; /** * 本实例运行的时,首先被执行一次,并且只能执行一次 */ @Override public void open( Map conf, TopologyContext context, SpoutOutputCollector collector ) { this.conf = conf; this.context = context; this.collector = collector; } /** * 死循环,可以认为是一个while循环 */ int i = 0; @Override public void nextTuple() { System.out.println( "spout:" + i ); this.collector.emit( new Values( i % 2, i++ ) ); Utils.sleep( 1000 ); } /** * 表示对发射出去的数据使用字段进行对应 */ @Override public void declareOutputFields( OutputFieldsDeclarer declarer ) { //声明输出字段 declarer.declare( new Fields( "flag", "num" ) ); } } public static class Sumbolt extends BaseRichBolt { private Map stormConf; private TopologyContext context; private OutputCollector collector; @Override public void prepare( Map stormConf, TopologyContext context, OutputCollector collector ) { this.stormConf = stormConf; this.context = context; this.collector = collector; } int sum = 0; @Override public void execute( Tuple input ) { //input.getInteger(0); Integer value = input.getIntegerByField( "num" ); sum += value; System.out.println( "当前线程ID:" + Thread.currentThread().getId() + "-----" + value ); } @Override public void declareOutputFields( OutputFieldsDeclarer declarer ) { } } /** * 测试 * * @param args */ public static void main( String[] args ) { TopologyBuilder topologyBuilder = new TopologyBuilder(); topologyBuilder.setSpout( "spout_id", new DataSpout() ); topologyBuilder.setBolt( "bolt_id", new Sumbolt(), 3 ).fieldsGrouping( "spout_id", new Fields( "flag" ) ); String simpleName = ClusterTopologyFieldgrouping.class.getSimpleName(); try { Config stormConf = new Config(); //设置worker进程使用的数量 //stormConf.setNumWorkers(2); StormSubmitter.submitTopology( simpleName, stormConf, topologyBuilder.createTopology() ); } catch ( AlreadyAliveException e ) { e.printStackTrace(); } catch ( InvalidTopologyException e ) { e.printStackTrace(); } catch ( AuthorizationException e ) { e.printStackTrace(); } } }
[ "chenlong88882001@163.com" ]
chenlong88882001@163.com
34b28ea7ba3a7a8940b5c9dbe19b4c9d6494dd6e
3ebc16af2ccb7a10855ec1008669ebce3c6f7af3
/jfinal_maven/src/main/java/com/demo/controller/RoleController.java
edae45a2455d2f11aae0d9017f23ba5da4d8ef62
[]
no_license
abook23/maven
4c5e5333f3ece1ba0104643cd7218e20a71f0dfb
1d84375e6db9fe8a2a96fccbd1b43ed2ae2e86c9
refs/heads/master
2021-01-12T05:48:22.383169
2016-12-23T09:12:37
2016-12-23T09:12:39
77,202,475
0
0
null
null
null
null
UTF-8
Java
false
false
919
java
package com.demo.controller; import java.util.HashMap; import java.util.Map; import com.demo.common.model.Role; import com.demo.controller.base.BaseController; import com.demo.controller.model.DatabTable; import com.demo.service.RoleService; import com.jfinal.plugin.activerecord.Page; public class RoleController extends BaseController { @Override public void add() { // TODO Auto-generated method stub } @Override public void list() { // TODO Auto-generated method stub render("list.html"); } public void listData() { // TODO Auto-generated method stub DatabTable dt = getDataTable(); Page<Role> page = RoleService.list(dt.getPageNumber(), dt.getPageSize()); dt.setData(page.getList()); renderJson(dt.getResponseData()); } @Override public void updat() { // TODO Auto-generated method stub } @Override public void delete() { // TODO Auto-generated method stub } }
[ "abook23@163.com" ]
abook23@163.com
7a24a75281e8306556f27d95f248181a3c7da1af
d59659decc96ff98f3ac12eade4c211d743e7265
/app/src/main/java/com/example/haoss/ui/classification/adapter/ClassifyChildAdapter.java
9dc0930173ddea09cd8291ae94991d67d2db2123
[]
no_license
chentt521520/Hss_FuLi_full
7a76b2fa78bc3f6776a2e81730a0276fdc5dcf95
cf926c4bbe5065409b722348ae4285b72b4994bb
refs/heads/master
2020-07-03T03:31:51.000165
2019-09-20T08:46:17
2019-09-20T08:46:17
201,770,085
0
1
null
null
null
null
UTF-8
Java
false
false
2,219
java
package com.example.haoss.ui.classification.adapter; import android.content.Context; import android.graphics.Color; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import com.bumptech.glide.Glide; import com.example.applibrary.entity.GoodClassify; import com.example.haoss.R; import java.util.List; //分类子数据适配器 public class ClassifyChildAdapter extends BaseAdapter { private Context context; private List<GoodClassify.Child> list; //数据 public ClassifyChildAdapter(Context context, List<GoodClassify.Child> list) { this.context = context; this.list = list; } public void refresh(List<GoodClassify.Child> list) { this.list = list; notifyDataSetChanged(); } @Override public int getCount() { if (list != null) return list.size(); return 0; } @Override public Object getItem(int position) { return list.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View view, ViewGroup parent) { Info info; if (view == null) { view = LayoutInflater.from(context).inflate(R.layout.item_brand, null); info = new Info(); info.image = view.findViewById(R.id.item_brand_image); info.text = view.findViewById(R.id.item_brand_text); info.item_brand_linear = view.findViewById(R.id.item_brand_linear); info.item_brand_linear.setBackgroundColor(Color.parseColor("#ffffff")); view.setTag(info); } info = (Info) view.getTag(); GoodClassify.Child item = list.get(position); Glide.with(context).load(item.getPic()).into(info.image); info.text.setText(item.getCate_name()); return view; } class Info { ImageView image; //图片 TextView text; //文字 TextView buttn; //按钮 LinearLayout item_brand_linear; // } }
[ "15129858157@163.com" ]
15129858157@163.com
e0b319f3ff09ffbc2e30866d4e910ca6b7b1b607
5ade3f1d3d3429e90025035cb49bf1bba5ad52e8
/compass-statistics/src/test/java/com/shifeng/demo/TestJob.java
8646eefe7b086d7acf0bfa0e70ea2c9f74b61d10
[]
no_license
0dayso/dataCompass
2270523fc793b231ffa08a33b6fd96257529a1b6
2c64fb7033fc8fb452fa12a65d8eff9f2b9d671a
refs/heads/master
2021-06-23T23:21:18.104730
2017-09-09T14:53:49
2017-09-09T14:53:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
508
java
package com.shifeng.demo; import com.shifeng.job.DetailedJob; import com.shifeng.job.VisitDetailJob; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; public class TestJob { public static void main(String[] args) { ApplicationContext context = new ClassPathXmlApplicationContext("spring/applicationContext.xml"); DetailedJob visitDetailJob= (DetailedJob)context.getBean("detailedJob"); visitDetailJob.execute(); } }
[ "tw l" ]
tw l
db4fb2755611f261750c765f41f6fd8bbd810c48
ebb1ac96c6f70bd22dde5a3f8ebec91e10b46cb6
/src/main/java/com/luo/ibatis/annotations/InsertProvider.java
a7ce065ec7652e287f1d238ff82a89e619bfb79e
[]
no_license
RononoaZoro/customize-mybatis
025cca308329dc2914acfebc3b577dc8d2f54e47
9f6d8321ea4396050573c3db385f60e3b234983e
refs/heads/master
2023-06-15T09:23:12.396807
2021-07-13T07:12:15
2021-07-13T07:12:15
375,922,905
0
0
null
null
null
null
UTF-8
Java
false
false
904
java
/** * Copyright 2009-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.luo.ibatis.annotations; import java.lang.annotation.*; /** * @author Clinton Begin */ @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface InsertProvider { Class<?> type(); String method(); }
[ "luoxz@akulaku.com" ]
luoxz@akulaku.com
ce487e68d9a7d2ad8f35e05f73678b27bcd81d83
bee994d337b02c9885e40a50078e2026c42772dc
/SearchTest-portlet/docroot/WEB-INF/service/com/portlet/sample/model/SampleEntryModel.java
6dbc27ff49dbb219c58d93a94f3fe0d322d81918
[]
no_license
mmehral/Liferay_Applications
3387fd7dd3fe348a8f78d927dedb408b949f92a3
ac0d314771ac6dba5db8c0b07ca88ae4c2636332
refs/heads/master
2021-05-06T13:47:41.349798
2017-12-19T13:09:41
2017-12-19T13:09:41
113,277,187
0
0
null
null
null
null
UTF-8
Java
false
false
7,438
java
/** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. */ package com.portlet.sample.model; import aQute.bnd.annotation.ProviderType; import com.liferay.expando.kernel.model.ExpandoBridge; import com.liferay.portal.kernel.bean.AutoEscape; import com.liferay.portal.kernel.model.BaseModel; import com.liferay.portal.kernel.model.CacheModel; import com.liferay.portal.kernel.model.GroupedModel; import com.liferay.portal.kernel.model.ShardedModel; import com.liferay.portal.kernel.model.StagedAuditedModel; import com.liferay.portal.kernel.service.ServiceContext; import java.io.Serializable; import java.util.Date; /** * The base model interface for the SampleEntry service. Represents a row in the &quot;Sample_SampleEntry&quot; database table, with each column mapped to a property of this class. * * <p> * This interface and its corresponding implementation {@link com.portlet.sample.model.impl.SampleEntryModelImpl} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link com.portlet.sample.model.impl.SampleEntryImpl}. * </p> * * @author CloverLiferay01 * @see SampleEntry * @see com.portlet.sample.model.impl.SampleEntryImpl * @see com.portlet.sample.model.impl.SampleEntryModelImpl * @generated */ @ProviderType public interface SampleEntryModel extends BaseModel<SampleEntry>, GroupedModel, ShardedModel, StagedAuditedModel { /* * NOTE FOR DEVELOPERS: * * Never modify or reference this interface directly. All methods that expect a sample entry model instance should use the {@link SampleEntry} interface instead. */ /** * Returns the primary key of this sample entry. * * @return the primary key of this sample entry */ public long getPrimaryKey(); /** * Sets the primary key of this sample entry. * * @param primaryKey the primary key of this sample entry */ public void setPrimaryKey(long primaryKey); /** * Returns the uuid of this sample entry. * * @return the uuid of this sample entry */ @AutoEscape @Override public String getUuid(); /** * Sets the uuid of this sample entry. * * @param uuid the uuid of this sample entry */ @Override public void setUuid(String uuid); /** * Returns the entry ID of this sample entry. * * @return the entry ID of this sample entry */ public long getEntryId(); /** * Sets the entry ID of this sample entry. * * @param entryId the entry ID of this sample entry */ public void setEntryId(long entryId); /** * Returns the company ID of this sample entry. * * @return the company ID of this sample entry */ @Override public long getCompanyId(); /** * Sets the company ID of this sample entry. * * @param companyId the company ID of this sample entry */ @Override public void setCompanyId(long companyId); /** * Returns the group ID of this sample entry. * * @return the group ID of this sample entry */ @Override public long getGroupId(); /** * Sets the group ID of this sample entry. * * @param groupId the group ID of this sample entry */ @Override public void setGroupId(long groupId); /** * Returns the user ID of this sample entry. * * @return the user ID of this sample entry */ @Override public long getUserId(); /** * Sets the user ID of this sample entry. * * @param userId the user ID of this sample entry */ @Override public void setUserId(long userId); /** * Returns the user uuid of this sample entry. * * @return the user uuid of this sample entry */ @Override public String getUserUuid(); /** * Sets the user uuid of this sample entry. * * @param userUuid the user uuid of this sample entry */ @Override public void setUserUuid(String userUuid); /** * Returns the user name of this sample entry. * * @return the user name of this sample entry */ @AutoEscape @Override public String getUserName(); /** * Sets the user name of this sample entry. * * @param userName the user name of this sample entry */ @Override public void setUserName(String userName); /** * Returns the title of this sample entry. * * @return the title of this sample entry */ @AutoEscape public String getTitle(); /** * Sets the title of this sample entry. * * @param title the title of this sample entry */ public void setTitle(String title); /** * Returns the content of this sample entry. * * @return the content of this sample entry */ @AutoEscape public String getContent(); /** * Sets the content of this sample entry. * * @param content the content of this sample entry */ public void setContent(String content); /** * Returns the create date of this sample entry. * * @return the create date of this sample entry */ @Override public Date getCreateDate(); /** * Sets the create date of this sample entry. * * @param createDate the create date of this sample entry */ @Override public void setCreateDate(Date createDate); /** * Returns the modified date of this sample entry. * * @return the modified date of this sample entry */ @Override public Date getModifiedDate(); /** * Sets the modified date of this sample entry. * * @param modifiedDate the modified date of this sample entry */ @Override public void setModifiedDate(Date modifiedDate); /** * Returns the status of this sample entry. * * @return the status of this sample entry */ public boolean getStatus(); /** * Returns <code>true</code> if this sample entry is status. * * @return <code>true</code> if this sample entry is status; <code>false</code> otherwise */ public boolean isStatus(); /** * Sets whether this sample entry is status. * * @param status the status of this sample entry */ public void setStatus(boolean status); @Override public boolean isNew(); @Override public void setNew(boolean n); @Override public boolean isCachedModel(); @Override public void setCachedModel(boolean cachedModel); @Override public boolean isEscapedModel(); @Override public Serializable getPrimaryKeyObj(); @Override public void setPrimaryKeyObj(Serializable primaryKeyObj); @Override public ExpandoBridge getExpandoBridge(); @Override public void setExpandoBridgeAttributes(BaseModel<?> baseModel); @Override public void setExpandoBridgeAttributes(ExpandoBridge expandoBridge); @Override public void setExpandoBridgeAttributes(ServiceContext serviceContext); @Override public Object clone(); @Override public int compareTo(SampleEntry sampleEntry); @Override public int hashCode(); @Override public CacheModel<SampleEntry> toCacheModel(); @Override public SampleEntry toEscapedModel(); @Override public SampleEntry toUnescapedModel(); @Override public String toString(); @Override public String toXmlString(); }
[ "mehral.mohit09@gmail.com" ]
mehral.mohit09@gmail.com
e3f2af040ec060ab6d31b7c099aefbacc5b543d9
13c2d3db2d49c40c74c2e6420a9cd89377f1c934
/program_data/JavaProgramData/54/1587.java
f281424bc5647588ac0e2d8fba1ab96d9d01b04f
[ "MIT" ]
permissive
qiuchili/ggnn_graph_classification
c2090fefe11f8bf650e734442eb96996a54dc112
291ff02404555511b94a4f477c6974ebd62dcf44
refs/heads/master
2021-10-18T14:54:26.154367
2018-10-21T23:34:14
2018-10-21T23:34:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
640
java
package <missing>; public class GlobalMembers { public static int Main() { int n; int k; int m; int i = 1; String tempVar = ConsoleInput.scanfRead(); if (tempVar != null) { n = Integer.parseInt(tempVar); } String tempVar2 = ConsoleInput.scanfRead(" "); if (tempVar2 != null) { k = Integer.parseInt(tempVar2); } int[] pg = new int[100]; pg[n] = n + k; while (i != 0) { for (i = n - 1;i >= 0;i--) { if (pg[i + 1] % (n - 1) != 0) { break; } pg[i] = pg[i + 1] / (n - 1) * n + k; } //if(i==0) break; pg[n] += n; } System.out.printf("%d\n",pg[1]); return 0; } }
[ "y.yu@open.ac.uk" ]
y.yu@open.ac.uk
8d343a7f0404b61314ddeedd14c5db3c96a72ecd
f95a858a3782e67ff5d10699af52170187352ac6
/Xtext-XML/ch.vorburger.xtext.xml/src/ch/vorburger/xtext/xml/NameURISwapper.java
1b357708be84908056e331e96d41b748ae709078
[]
no_license
vorburger/xtext-sandbox
286475c5f47e073ce45e5dccd3257861dccacc10
35da849a7cf73b05870dd2cc49745eb1a7ea5d8f
refs/heads/master
2021-01-01T18:22:52.979926
2016-02-18T11:29:04
2016-02-18T11:29:04
4,622,929
2
5
null
2020-10-13T07:07:26
2012-06-11T09:06:09
Java
UTF-8
Java
false
false
1,410
java
/******************************************************************************* * Copyright (c) 2012 Michael Vorburger (http://www.vorburger.ch). * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html *******************************************************************************/ package ch.vorburger.xtext.xml; import org.eclipse.emf.ecore.EObject; /** * Util which deals with name:/Something URI Proxies. * This is used to transform EMF XML containing name-based cross references into real Xtext objects, and vice versa. * * @see NameURISwapperImpl#getNameFromProxy(EObject) to access the content of name:/ URI Proxies * * @author Michael Vorburger */ public interface NameURISwapper { /** * Replaces xText's internal xtextLink_::0::3::/15 Proxy URIs with name:/Something URI Proxies. * This is used before writing XML. */ <T extends EObject> T cloneAndReplaceAllReferencesByNameURIProxies(T rootObject); /** * Replaces our name:/Something URI Proxies by valid xText's referenced objects or internal xtextLink_::0::3::/15-style proxies. * This is used after having read XML containing name:/Something URI Proxies. */ void replaceAllNameURIProxiesByReferences(EObject rootObject); }
[ "mike@vorburger.ch" ]
mike@vorburger.ch
4c3f1361e1219d833f7f6598ede6effa55e69fc2
2e9cefe7ff4ad13c8ef88f1e35671e56dea0d46a
/app/src/main/java/com/huirong/base/NiceSpinnerBaseAdapter.java
94d91a2609912b1846b01a0c7fcbf6be0351eb21
[]
no_license
kinbod/HRERP
3420a54538bdc45c37be32a7003671fda83a72a5
f1927bfb4c8fa8a9101aed908641b2830cf6cdba
refs/heads/master
2021-06-25T04:26:58.340626
2017-08-07T01:35:17
2017-08-07T01:35:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,190
java
package com.huirong.base; import android.content.Context; import android.os.Build; import android.support.v4.content.ContextCompat; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.TextView; import com.huirong.R; /** * @author angelo.marchesin */ @SuppressWarnings("unused") public abstract class NiceSpinnerBaseAdapter<T> extends BaseAdapter { protected Context mContext; protected int mSelectedIndex; protected int mTextColor; protected int mBackgroundSelector; public NiceSpinnerBaseAdapter(Context context, int textColor, int backgroundSelector) { mContext = context; mTextColor = textColor; mBackgroundSelector = backgroundSelector; } @Override @SuppressWarnings("unchecked") public View getView(int position, View convertView, ViewGroup parent) { TextView textView; if (convertView == null) { convertView = View.inflate(mContext, R.layout.spinner_list_item, null); textView = (TextView) convertView.findViewById(R.id.tv_tinted_spinner); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { textView.setBackground(ContextCompat.getDrawable(mContext, mBackgroundSelector)); } convertView.setTag(new ViewHolder(textView)); } else { textView = ((ViewHolder) convertView.getTag()).textView; } textView.setText(getItem(position).toString()); textView.setTextColor(mTextColor); return convertView; } public int getSelectedIndex() { return mSelectedIndex; } public void notifyItemSelected(int index) { mSelectedIndex = index; } @Override public long getItemId(int position) { return position; } @Override public abstract T getItem(int position); @Override public abstract int getCount(); public abstract T getItemInDataset(int position); protected static class ViewHolder { public TextView textView; public ViewHolder(TextView textView) { this.textView = textView; } } }
[ "sjy0118atsn@163.com" ]
sjy0118atsn@163.com
f05d92d650ada2c2adb3f84084b0c8555378b33e
4b319acc3393ede6ad6ee5e299d5f8a58518f1df
/app/src/main/java/codingwithmitch/com/googlemapsgoogleplaces/MainActivity.java
4253486c4b7020633557bb2ca307c4733ffafac1
[]
no_license
saubhagyamapps/GooglePlacePicker
5273755c890b0854471c79bdddb5132f0d911530
3718e62ba3fa6269ccd28e2797dfd824ee029c94
refs/heads/master
2020-06-11T20:27:53.604200
2019-06-27T11:34:12
2019-06-27T11:34:12
194,075,519
0
0
null
null
null
null
UTF-8
Java
false
false
2,171
java
package codingwithmitch.com.googlemapsgoogleplaces; import android.app.Dialog; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.Toast; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.GoogleApiAvailability; public class MainActivity extends AppCompatActivity { private static final String TAG = "MainActivity"; private static final int ERROR_DIALOG_REQUEST = 9001; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if(isServicesOK()){ init(); } } private void init(){ Button btnMap = (Button) findViewById(R.id.btnMap); btnMap.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent intent = new Intent(MainActivity.this, MapActivity.class); startActivity(intent); } }); } public boolean isServicesOK(){ Log.d(TAG, "isServicesOK: checking google services version"); int available = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(MainActivity.this); if(available == ConnectionResult.SUCCESS){ //everything is fine and the user can make map requests Log.d(TAG, "isServicesOK: Google Play Services is working"); return true; } else if(GoogleApiAvailability.getInstance().isUserResolvableError(available)){ //an error occured but we can resolve it Log.d(TAG, "isServicesOK: an error occured but we can fix it"); Dialog dialog = GoogleApiAvailability.getInstance().getErrorDialog(MainActivity.this, available, ERROR_DIALOG_REQUEST); dialog.show(); }else{ Toast.makeText(this, "You can't make map requests", Toast.LENGTH_SHORT).show(); } return false; } }
[ "keshuvodedara@gmail.com" ]
keshuvodedara@gmail.com
a30de879188a591a8e9d4e7b76aa6e22b6fb635e
aa56508933103734752cbd276ba20fb13adf20e1
/src/main/java/ru/job4j/collection/SimpleQueue.java
b655acd1e52ddd6ed2a31084df54d8fedbea81eb
[]
no_license
evgenkolesman/job4j_design
b7953b4ff2623c9afd30c6eeb350e3beba0dd34e
c08f4b5df90ab9171425ae226d7c2e436d7ba077
refs/heads/master
2023-07-20T05:25:27.853357
2021-08-08T06:44:33
2021-08-08T06:44:33
331,615,623
1
1
null
null
null
null
UTF-8
Java
false
false
1,013
java
package ru.job4j.collection; public class SimpleQueue<T> { private final SimpleStack<T> in = new SimpleStack<>(); private final SimpleStack<T> out = new SimpleStack<>(); public T poll() { if (out.isEmpty()) { while (!in.isEmpty()) { out.push(in.pop()); } } return out.pop(); } // мой вариант /*public T poll() { if (index == 0) { throw new NoSuchElementException(); } if (index1 == 0) { //if(out.isEmpty()) { while (index != 0) { while (!in.isEmpty()) { out.push(in.pop()); index--; index1++; } } } T temp = null; if (index1 != 0) { //if (out.isEmpty()) { temp = out.pop(); index1--; } return temp; }*/ public void push(T value) { in.push(value); //index++; //out.push(value); } }
[ "glavstroi_e@mail.ru" ]
glavstroi_e@mail.ru
9f578f88388626df4c16e1e2eff6b4a7a6a02f71
01449369d33ba7648ec5f34b8d2fc6fa1aceacf3
/src/com/facebook/buck/cli/BuildCommandOptions.java
ad5500334de16fd3f0fafba42f4054c46ba353a1
[ "Apache-2.0" ]
permissive
yunshan/buck
8ddb92314ee16490c9fc3711b62abc033d5e4037
95f6b56b1923e9a3b9a52715f07104649e795a47
refs/heads/master
2021-01-24T01:10:36.586369
2019-05-21T03:46:21
2019-05-21T03:46:21
11,759,589
0
0
null
null
null
null
UTF-8
Java
false
false
5,236
java
/* * Copyright 2012-present Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain * a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package com.facebook.buck.cli; import com.facebook.buck.command.Build; import com.facebook.buck.event.BuckEventBus; import com.facebook.buck.rules.ArtifactCache; import com.facebook.buck.rules.BuildDependencies; import com.facebook.buck.rules.DependencyGraph; import com.facebook.buck.step.TargetDevice; import com.facebook.buck.util.Console; import com.facebook.buck.util.HumanReadableException; import com.facebook.buck.util.ProjectFilesystem; import com.facebook.buck.util.Verbosity; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Optional; import com.google.common.base.Supplier; import com.google.common.base.Suppliers; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.google.common.util.concurrent.ListeningExecutorService; import com.google.common.util.concurrent.MoreExecutors; import org.kohsuke.args4j.Argument; import org.kohsuke.args4j.Option; import java.util.List; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; public class BuildCommandOptions extends AbstractCommandOptions { @Option(name = "--num-threads", usage = "Default is 1.25 * num processors") private int numThreads = (int)(Runtime.getRuntime().availableProcessors() * 1.25); @Option(name = "--build-dependencies", aliases = "-b", usage = "How to handle including dependencies") private BuildDependencies buildDependencies = null; private ListeningExecutorService listeningExecutorService; @Argument private List<String> arguments = Lists.newArrayList(); public BuildCommandOptions(BuckConfig buckConfig) { super(buckConfig); setNumThreadsFromConfig(buckConfig); } private Supplier<BuildDependencies> buildDependenciesSupplier = Suppliers.memoize(new Supplier<BuildDependencies>() { @Override public BuildDependencies get() { if (buildDependencies != null) { return buildDependencies; } else if (getBuckConfig().getBuildDependencies().isPresent()) { return getBuckConfig().getBuildDependencies().get(); } else { return BuildDependencies.getDefault(); } } }); private void setNumThreadsFromConfig(BuckConfig buckConfig) { ImmutableMap<String,String> build = buckConfig.getEntriesForSection("build"); if (build.containsKey("threads")) { try { numThreads = Integer.parseInt(build.get("threads")); } catch (NumberFormatException e) { throw new HumanReadableException( "Unable to determine number of threads to use from building from buck config file. " + "Value used was '%s'", build.get("threads")); } } } public List<String> getArguments() { return arguments; } public void setArguments(List<String> arguments) { this.arguments = arguments; } public List<String> getArgumentsFormattedAsBuildTargets() { return CommandLineBuildTargetNormalizer.normalizeAll(getBuckConfig(), getArguments()); } public boolean isCodeCoverageEnabled() { return false; } public boolean isDebugEnabled() { return false; } @VisibleForTesting int getNumThreads() { return numThreads; } public BuildDependencies getBuildDependencies() { return buildDependenciesSupplier.get(); } public ListeningExecutorService getListeningExecutorService() { if (listeningExecutorService == null) { listeningExecutorService = createListeningExecutorService(); } return listeningExecutorService; } public ListeningExecutorService createListeningExecutorService() { ExecutorService executorService = Executors.newFixedThreadPool(numThreads); return MoreExecutors.listeningDecorator(executorService); } Build createBuild(BuckConfig buckConfig, DependencyGraph graph, ProjectFilesystem projectFilesystem, ArtifactCache artifactCache, Console console, BuckEventBus eventBus, Optional<TargetDevice> targetDevice) { if (console.getVerbosity() == Verbosity.ALL) { console.getStdErr().printf("Creating a build with %d threads.\n", numThreads); } return new Build(graph, findAndroidSdkDir(), findAndroidNdkDir(), targetDevice, projectFilesystem, artifactCache, getListeningExecutorService(), getBuckConfig().createDefaultJavaPackageFinder(), console, buckConfig.getDefaultTestTimeoutMillis(), isCodeCoverageEnabled(), isDebugEnabled(), getBuildDependencies(), eventBus); } }
[ "mbolin@fb.com" ]
mbolin@fb.com
51efb5ca1a7cb7f67b5a359c1c8c269a22587fa0
d4dafb381a9c5930918db8bedf403944df918884
/src/main/java/cn/com/sky/collections/TestEnumaration.java
28f9d9fca4239a09cc047ce486ebae604b3fc7cc
[]
no_license
git-sky/javabasics
3f307d33876e17b260740492fcd6c33bdf91bddb
25bf3ddbe6c08b77b499450cfdbd75e4eb81b51d
refs/heads/master
2022-12-25T12:01:04.569153
2021-06-20T14:48:55
2021-06-20T14:48:55
97,925,787
0
0
null
null
null
null
UTF-8
Java
false
false
546
java
package cn.com.sky.collections; import java.util.Enumeration; /** * Enumeration 与 Iterator 功能类似, 属于遗留接口。 */ public class TestEnumaration { public static void main(String[] args) { Enumeration<Object> e = new Enumeration<Object>() { @Override public boolean hasMoreElements() { return false; } @Override public Object nextElement() { return null; } }; e.hasMoreElements(); } }
[ "linkme2008@sina.com" ]
linkme2008@sina.com
5480dc0865023c1c19e3bace44e208a6622beb1a
99dc3e127e976c3c7f676de6250d38d6e59b86e8
/src/main/java/hello/jdbc/Customer.java
4d02f9a21c2e7c346547415bf8cc1385ae763d28
[]
no_license
h5dde45/Spring_180518
8365e9a803d789e6397739137ac451cc6486522a
5b2077fdfcd6fc965fffc7f4f6ae499f669a2049
refs/heads/master
2020-03-17T20:20:44.307852
2018-05-18T18:22:52
2018-05-18T18:22:52
133,904,877
0
0
null
null
null
null
UTF-8
Java
false
false
910
java
package hello.jdbc; public class Customer { private long id; private String firstName; private String lastName; public Customer(long id, String firstName, String lastName) { this.id = id; this.firstName = firstName; this.lastName = lastName; } public long getId() { return id; } public void setId(long id) { this.id = id; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } @Override public String toString() { return String.format( "Customer[id=%d, firstName='%s', lastName='%s']", id, firstName, lastName); } }
[ "tmvf@yandex.ru" ]
tmvf@yandex.ru
39c064ede1f171ed3c81b639a541281ea8fe5b87
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
/benchmark/training/org/terasology/logic/delay/DelayedActionSystemTest.java
a66f8603ddc41cd2e6d92e26246f6e8732f000fc
[]
no_license
STAMP-project/dspot-experiments
f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5
121487e65cdce6988081b67f21bbc6731354a47f
refs/heads/master
2023-02-07T14:40:12.919811
2019-11-06T07:17:09
2019-11-06T07:17:09
75,710,758
14
19
null
2023-01-26T23:57:41
2016-12-06T08:27:42
null
UTF-8
Java
false
false
5,612
java
/** * Copyright 2016 MovingBlocks * * 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.terasology.logic.delay; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.junit.Test; import org.terasology.TerasologyTestingEnvironment; import org.terasology.engine.Time; public class DelayedActionSystemTest extends TerasologyTestingEnvironment { long nextFakeEntityId = 1; int lookingForId;// Use this for ordering the time events. 0 is earliest. private DelayedActionSystem delayedActionSystem; private List<Integer> vals;// Use this for ordering the expected values. private Time time; @Test public void test1DelayedAction() { ArbritaryDelayActionComponent a1 = new ArbritaryDelayActionComponent(); a1.value = 3; vals = new ArrayList<Integer>(Arrays.asList(3)); delayedActionSystem.addDelayedAction(createFakeEntityWith(a1), "Blah Blah", (((time.getGameTimeInMs()) + 1000) - (time.getGameTimeInMs()))); (nextFakeEntityId)++; } @Test public void test2DelayedActionsInChronoOrder() { ArbritaryDelayActionComponent a1 = new ArbritaryDelayActionComponent(); ArbritaryDelayActionComponent a2 = new ArbritaryDelayActionComponent(); a1.value = 3; a2.value = 2; vals = new ArrayList<Integer>(Arrays.asList(3, 2)); delayedActionSystem.addDelayedAction(createFakeEntityWith(a1), "First", (((time.getGameTimeInMs()) + 1000) - (time.getGameTimeInMs()))); delayedActionSystem.addDelayedAction(createFakeEntityWith(a2), "Second", (((time.getGameTimeInMs()) + 1500) - (time.getGameTimeInMs()))); } @Test public void test2DelayedActionsInReverseChronoOrder() { ArbritaryDelayActionComponent a1 = new ArbritaryDelayActionComponent(); ArbritaryDelayActionComponent a2 = new ArbritaryDelayActionComponent(); a1.value = 5; a2.value = 8; vals = new ArrayList<Integer>(Arrays.asList(5, 8)); delayedActionSystem.addDelayedAction(createFakeEntityWith(a2), "Second", (((time.getGameTimeInMs()) + 1500) - (time.getGameTimeInMs()))); delayedActionSystem.addDelayedAction(createFakeEntityWith(a1), "First", (((time.getGameTimeInMs()) + 1000) - (time.getGameTimeInMs()))); } @Test public void testMultipleDelayedActionsInChronoOrder() { ArbritaryDelayActionComponent a1 = new ArbritaryDelayActionComponent(); ArbritaryDelayActionComponent a2 = new ArbritaryDelayActionComponent(); ArbritaryDelayActionComponent a3 = new ArbritaryDelayActionComponent(); ArbritaryDelayActionComponent a4 = new ArbritaryDelayActionComponent(); ArbritaryDelayActionComponent a5 = new ArbritaryDelayActionComponent(); a1.value = 13; a2.value = 22; a3.value = 10; a4.value = 50; a5.value = 1; vals = new ArrayList<Integer>(Arrays.asList(13, 22, 10, 50, 1)); delayedActionSystem.addDelayedAction(createFakeEntityWith(a1), "First", (((time.getGameTimeInMs()) + 1000) - (time.getGameTimeInMs()))); delayedActionSystem.addDelayedAction(createFakeEntityWith(a2), "Second", (((time.getGameTimeInMs()) + 1500) - (time.getGameTimeInMs()))); delayedActionSystem.addDelayedAction(createFakeEntityWith(a3), "Third", (((time.getGameTimeInMs()) + 2000) - (time.getGameTimeInMs()))); delayedActionSystem.addDelayedAction(createFakeEntityWith(a4), "Fourth", (((time.getGameTimeInMs()) + 2500) - (time.getGameTimeInMs()))); delayedActionSystem.addDelayedAction(createFakeEntityWith(a5), "Fifth", (((time.getGameTimeInMs()) + 3000) - (time.getGameTimeInMs()))); } @Test public void testMultipleDelayedActionsInRandomOrder() { ArbritaryDelayActionComponent a3 = new ArbritaryDelayActionComponent(); ArbritaryDelayActionComponent a5 = new ArbritaryDelayActionComponent(); ArbritaryDelayActionComponent a2 = new ArbritaryDelayActionComponent(); ArbritaryDelayActionComponent a1 = new ArbritaryDelayActionComponent(); ArbritaryDelayActionComponent a4 = new ArbritaryDelayActionComponent(); a1.value = 100; a2.value = 200; a3.value = 314; a4.value = 12; a5.value = 51; vals = new ArrayList<Integer>(Arrays.asList(100, 200, 314, 12, 51)); delayedActionSystem.addDelayedAction(createFakeEntityWith(a3), "Third", (((time.getGameTimeInMs()) + 2000) - (time.getGameTimeInMs()))); delayedActionSystem.addDelayedAction(createFakeEntityWith(a5), "Fifth", (((time.getGameTimeInMs()) + 3000) - (time.getGameTimeInMs()))); delayedActionSystem.addDelayedAction(createFakeEntityWith(a2), "Second", (((time.getGameTimeInMs()) + 1500) - (time.getGameTimeInMs()))); delayedActionSystem.addDelayedAction(createFakeEntityWith(a1), "First", (((time.getGameTimeInMs()) + 1000) - (time.getGameTimeInMs()))); delayedActionSystem.addDelayedAction(createFakeEntityWith(a4), "Fourth", (((time.getGameTimeInMs()) + 2500) - (time.getGameTimeInMs()))); } }
[ "benjamin.danglot@inria.fr" ]
benjamin.danglot@inria.fr
a2d1a5e21cf2d228df08f56fba18fe4f7e9e691e
000c96eb393da2d706deec3df75a9a04ee4fcf91
/androidClass/day01/HelloAndroid(1)/src/com/helloandroid/MainActivity.java
e3b79204d44888cf73c1063ae7b2fbe66a2dd8e5
[]
no_license
sonyi/androidClass
08d3899dc8d6a273998b8c5402e05e5f324e1567
d443cfba074cfbbccfc7685b20449aec7ac3eb02
refs/heads/master
2020-05-29T20:01:47.934270
2014-09-03T08:19:46
2014-09-03T08:19:46
null
0
0
null
null
null
null
GB18030
Java
false
false
1,200
java
package com.helloandroid; import android.app.Activity; import android.os.Bundle; import android.view.Menu; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.TextView; public class MainActivity extends Activity implements OnClickListener { private TextView tvInfo; private Button btnBlue; private Button btnRed; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // 引用布局资源的方式 setContentView(R.layout.activity_main); // 在setContentView()方法后加载控件实例 tvInfo = (TextView) findViewById(R.id.tv_text); btnBlue = (Button) findViewById(R.id.btn_blue); btnRed = (Button) findViewById(R.id.btn_red); btnBlue.setOnClickListener(this); btnRed.setOnClickListener(this); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main, menu); return true; } @Override public void onClick(View v) { switch (v.getId()) { case R.id.btn_blue: tvInfo.setBackgroundResource(R.color.blue); break; case R.id.btn_red: tvInfo.setBackgroundResource(R.color.pink); break; } } }
[ "wxy15105957760" ]
wxy15105957760
084dd4fa21210969841ba3625d6f27d79551510d
ab2678c3d33411507d639ff0b8fefb8c9a6c9316
/jgralab/src/de/uni_koblenz/jgralab/gretl/SysErr.java
cb476d4cdf0cb84d5c52bb73aaaaa1ce47b3d0cc
[]
no_license
dmosen/wiki-analysis
b58c731fa2d66e78fe9b71699bcfb228f4ab889e
e9c8d1a1242acfcb683aa01bfacd8680e1331f4f
refs/heads/master
2021-01-13T01:15:10.625520
2013-10-28T13:27:16
2013-10-28T13:27:16
8,741,553
2
0
null
null
null
null
UTF-8
Java
false
false
570
java
/** * */ package de.uni_koblenz.jgralab.gretl; /** * @author Tassilo Horn &lt;horn@uni-koblenz.de&gt; * */ public class SysErr extends SysOut { public SysErr(Context c, String greqlExpression) { super(c, greqlExpression); } public SysErr(Context c, Object result) { super(c, result); } public static SysErr parseAndCreate(ExecuteTransformation et) { et.matchTransformationArrow(); String semExp = et.matchSemanticExpression(); return new SysErr(et.context, semExp); } @Override protected void doPrint() { System.err.println(result); } }
[ "dmosen@uni-koblenz.de" ]
dmosen@uni-koblenz.de
4decb8f2a7f4ea2836ec660d799caa3287e0e103
8e67fdab6f3a030f38fa127a79050b8667259d01
/JavaStudyHalUk/src/TECHNOSTUDY_USA/day4/Ex1.java
a2d5b8c8e28e2aa67df50fe4ae799d38310b9a67
[]
no_license
mosmant/JavaStudyHalUk
07e38ade6c7a31d923519a267a63318263c5910f
a41e16cb91ef307b50cfc497535126aa1e4035e5
refs/heads/master
2023-07-27T13:31:11.004490
2021-09-12T14:59:25
2021-09-12T14:59:25
405,671,965
0
0
null
null
null
null
UTF-8
Java
false
false
1,301
java
package TECHNOSTUDY_USA.day4; public class Ex1 { // Narrowing Casting (manually) - converting a larger type to a smaller size type // double -> float -> long -> int -> char -> short -> byte public static void main(String[] args) { // int integerNumber = 100; // byte byteNumber = (byte) integerNumber; int ten = 10; int three = 3; double result = (double) ten / three; // (double) ten / three ; // ten / (double)three ; // (double) ten / (double) three; System.out.println( result ); System.out.println( 10 / 3 ); // result only int : 3 System.out.println( 10.0 / 3 ); // results decimal 3.333 System.out.println( 10 / 3.0 ); // results decimal 3.333 System.out.println( 10.0 / 3.0 ); // results decimal 3.333 // byte byteNumber = 10; // double doubleNumber = byteNumber; // System.out.println(byteNumber); // System.out.println(doubleNumber); // System.out.println( "Exam Results:" ); // // int studentA = 90; // int studentB = 80; // int studentC = 50; // // double avg = (studentA + studentB + studentC) / 3.0; // // System.out.println( "Average result" ); // System.out.println(avg); } }
[ "mottnr@gmail.com" ]
mottnr@gmail.com
b85d15bd01d8da718ac0c2adcbe2e510cdb108fc
3e355a798304584431e5e5a1f1bc141e16c330fc
/AL-Game/data/scripts/system/handlers/ai/instance/dragonLordsRefuge/CalindiFlamelordAI2.java
3a744dadd3cbb5499606b3c31a00449a7b1e4f7e
[]
no_license
webdes27/Aion-Lightning-4.6-SRC
db0b2b547addc368b7d5e3af6c95051be1df8d69
8899ce60aae266b849a19c3f93f47be9485c70ab
refs/heads/master
2021-09-14T19:16:29.368197
2018-02-27T16:05:28
2018-02-27T16:05:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,273
java
/** * This file is part of Aion-Lightning <aion-lightning.org>. * * Aion-Lightning is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Aion-Lightning is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Aion-Lightning. * If not, see <http://www.gnu.org/licenses/>. */ package ai.instance.dragonLordsRefuge; import java.util.concurrent.Future; import java.util.concurrent.atomic.AtomicBoolean; import ai.AggressiveNpcAI2; import com.aionemu.commons.network.util.ThreadPoolManager; import com.aionemu.commons.utils.Rnd; import com.aionemu.gameserver.ai2.AI2Actions; import com.aionemu.gameserver.ai2.AIName; import com.aionemu.gameserver.model.gameobjects.Creature; import com.aionemu.gameserver.model.gameobjects.player.Player; import com.aionemu.gameserver.model.templates.spawns.SpawnTemplate; import com.aionemu.gameserver.skillengine.SkillEngine; import com.aionemu.gameserver.spawnengine.SpawnEngine; /** * @author Cheatkiller * */ @AIName("calindiflamelord60") // 219359 public class CalindiFlamelordAI2 extends AggressiveNpcAI2 { private AtomicBoolean isHome = new AtomicBoolean(true); private Future<?> trapTask; private boolean isFinalBuff; @Override protected void handleAttack(Creature creature) { super.handleAttack(creature); if (isHome.compareAndSet(true, false)) { startSkillTask(); } if (!isFinalBuff) { blazeEngraving(); if (getOwner().getLifeStats().getHpPercentage() <= 12) { isFinalBuff = true; cancelTask(); AI2Actions.useSkill(this, 20915); } } } private void startSkillTask() { trapTask = ThreadPoolManager.getInstance().scheduleAtFixedRate(new Runnable() { @Override public void run() { if (isAlreadyDead()) { cancelTask(); } else { startHallucinatoryVictoryEvent(); } } }, 5000, 80000); } private void cancelTask() { if (trapTask != null && !trapTask.isCancelled()) { trapTask.cancel(true); } } private void startHallucinatoryVictoryEvent() { if (getPosition().getWorldMapInstance().getNpc(730695) == null && getPosition().getWorldMapInstance().getNpc(730696) == null) { AI2Actions.useSkill(this, 20911); SkillEngine.getInstance().applyEffectDirectly(20590, getOwner(), getOwner(), 0); SkillEngine.getInstance().applyEffectDirectly(20591, getOwner(), getOwner(), 0); spawn(730695, 482.21f, 458.06f, 427.42f, (byte) 98); spawn(730696, 482.21f, 571.16f, 427.42f, (byte) 22); rndSpawn(283132, 10); } } private void blazeEngraving() { if (Rnd.get(0, 100) < 2 && getPosition().getWorldMapInstance().getNpc(283130) == null) { SkillEngine.getInstance().getSkill(getOwner(), 20913, 60, getOwner().getTarget()).useNoAnimationSkill(); Player target = getRandomTarget(); if (target == null) { return; } spawn(283130, target.getX(), target.getY(), target.getZ(), (byte) 0); } } private void rndSpawn(int npcId, int count) { for (int i = 0; i < count; i++) { SpawnTemplate template = rndSpawnInRange(npcId); SpawnEngine.spawnObject(template, getPosition().getInstanceId()); } } private SpawnTemplate rndSpawnInRange(int npcId) { float direction = Rnd.get(0, 199) / 100f; int range = Rnd.get(5, 20); float x1 = (float) (Math.cos(Math.PI * direction) * range); float y1 = (float) (Math.sin(Math.PI * direction) * range); return SpawnEngine.addNewSingleTimeSpawn(getPosition().getMapId(), npcId, getPosition().getX() + x1, getPosition().getY() + y1, getPosition().getZ(), getPosition().getHeading()); } @Override protected void handleDied() { super.handleDied(); cancelTask(); } @Override protected void handleDespawned() { super.handleDespawned(); cancelTask(); } @Override protected void handleBackHome() { super.handleBackHome(); cancelTask(); isFinalBuff = false; isHome.set(true); } }
[ "michelgorter@outlook.com" ]
michelgorter@outlook.com
fff56a5ad1c485a3ef91fa32bae85af85c8178cc
9e38b74e80d32e088fb188212da0bbe32e099e8a
/src/main/java/io/github/jhipster/areaapp/web/rest/errors/ExceptionTranslator.java
5104a4b8991604c7ddd32f65796328f695e0a5bc
[]
no_license
BulkSecurityGeneratorProject/areaApp
2878e75d7ba6cb93949f9a35326d6e1f12a55ab1
8010983638aeb6c4095994b265eb22090734c414
refs/heads/master
2022-12-15T13:33:09.793172
2019-05-15T10:23:45
2019-05-15T10:23:45
296,585,810
0
0
null
2020-09-18T10:12:21
2020-09-18T10:12:20
null
UTF-8
Java
false
false
5,225
java
package io.github.jhipster.areaapp.web.rest.errors; import io.github.jhipster.web.util.HeaderUtil; import org.springframework.beans.factory.annotation.Value; import org.springframework.dao.ConcurrencyFailureException; import org.springframework.http.ResponseEntity; import org.springframework.validation.BindingResult; import org.springframework.web.bind.MethodArgumentNotValidException; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.context.request.NativeWebRequest; import org.zalando.problem.DefaultProblem; import org.zalando.problem.Problem; import org.zalando.problem.ProblemBuilder; import org.zalando.problem.Status; import org.zalando.problem.spring.web.advice.ProblemHandling; import org.zalando.problem.violations.ConstraintViolationProblem; import javax.annotation.Nonnull; import javax.annotation.Nullable; import javax.servlet.http.HttpServletRequest; import java.util.List; import java.util.NoSuchElementException; import java.util.stream.Collectors; /** * Controller advice to translate the server side exceptions to client-friendly json structures. * The error response follows RFC7807 - Problem Details for HTTP APIs (https://tools.ietf.org/html/rfc7807). */ @ControllerAdvice public class ExceptionTranslator implements ProblemHandling { private static final String FIELD_ERRORS_KEY = "fieldErrors"; private static final String MESSAGE_KEY = "message"; private static final String PATH_KEY = "path"; private static final String VIOLATIONS_KEY = "violations"; @Value("${jhipster.clientApp.name}") private String applicationName; /** * Post-process the Problem payload to add the message key for the front-end if needed. */ @Override public ResponseEntity<Problem> process(@Nullable ResponseEntity<Problem> entity, NativeWebRequest request) { if (entity == null) { return entity; } Problem problem = entity.getBody(); if (!(problem instanceof ConstraintViolationProblem || problem instanceof DefaultProblem)) { return entity; } ProblemBuilder builder = Problem.builder() .withType(Problem.DEFAULT_TYPE.equals(problem.getType()) ? ErrorConstants.DEFAULT_TYPE : problem.getType()) .withStatus(problem.getStatus()) .withTitle(problem.getTitle()) .with(PATH_KEY, request.getNativeRequest(HttpServletRequest.class).getRequestURI()); if (problem instanceof ConstraintViolationProblem) { builder .with(VIOLATIONS_KEY, ((ConstraintViolationProblem) problem).getViolations()) .with(MESSAGE_KEY, ErrorConstants.ERR_VALIDATION); } else { builder .withCause(((DefaultProblem) problem).getCause()) .withDetail(problem.getDetail()) .withInstance(problem.getInstance()); problem.getParameters().forEach(builder::with); if (!problem.getParameters().containsKey(MESSAGE_KEY) && problem.getStatus() != null) { builder.with(MESSAGE_KEY, "error.http." + problem.getStatus().getStatusCode()); } } return new ResponseEntity<>(builder.build(), entity.getHeaders(), entity.getStatusCode()); } @Override public ResponseEntity<Problem> handleMethodArgumentNotValid(MethodArgumentNotValidException ex, @Nonnull NativeWebRequest request) { BindingResult result = ex.getBindingResult(); List<FieldErrorVM> fieldErrors = result.getFieldErrors().stream() .map(f -> new FieldErrorVM(f.getObjectName(), f.getField(), f.getCode())) .collect(Collectors.toList()); Problem problem = Problem.builder() .withType(ErrorConstants.CONSTRAINT_VIOLATION_TYPE) .withTitle("Method argument not valid") .withStatus(defaultConstraintViolationStatus()) .with(MESSAGE_KEY, ErrorConstants.ERR_VALIDATION) .with(FIELD_ERRORS_KEY, fieldErrors) .build(); return create(ex, problem, request); } @ExceptionHandler public ResponseEntity<Problem> handleNoSuchElementException(NoSuchElementException ex, NativeWebRequest request) { Problem problem = Problem.builder() .withStatus(Status.NOT_FOUND) .with(MESSAGE_KEY, ErrorConstants.ENTITY_NOT_FOUND_TYPE) .build(); return create(ex, problem, request); } @ExceptionHandler public ResponseEntity<Problem> handleBadRequestAlertException(BadRequestAlertException ex, NativeWebRequest request) { return create(ex, request, HeaderUtil.createFailureAlert(applicationName, true, ex.getEntityName(), ex.getErrorKey(), ex.getMessage())); } @ExceptionHandler public ResponseEntity<Problem> handleConcurrencyFailure(ConcurrencyFailureException ex, NativeWebRequest request) { Problem problem = Problem.builder() .withStatus(Status.CONFLICT) .with(MESSAGE_KEY, ErrorConstants.ERR_CONCURRENCY_FAILURE) .build(); return create(ex, problem, request); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
bb8b11a31e3cdba987daf947896624e03b5cfad0
ac09d0891be7990a373fdb77ec597c4795f3c8e7
/src/main/java/com/intuit/developer/sampleapp/webhooks/DataLoader.java
489d343b1a0e3fbe92fb0b9e647ddf14354ed60d
[ "Apache-2.0" ]
permissive
Dithn/SampleApp-Webhooks-Java
110e6aa33028207e18485de6c4663b920b91bcbf
fa8e6306e3d7174141119b668d61651fbdabb6ae
refs/heads/master
2021-08-02T04:58:07.957123
2021-07-30T03:48:12
2021-07-30T03:48:12
225,882,936
0
0
null
2021-07-31T14:53:45
2019-12-04T14:13:05
Java
UTF-8
Java
false
false
3,021
java
package com.intuit.developer.sampleapp.webhooks; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.ApplicationListener; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; import com.intuit.developer.sampleapp.webhooks.domain.CompanyConfig; import com.intuit.developer.sampleapp.webhooks.service.CompanyConfigService; import com.intuit.developer.sampleapp.webhooks.service.qbo.QBODataService; import com.intuit.ipp.util.DateUtils; import com.intuit.ipp.util.Logger; /** * @author dderose * */ @Component @Configuration @PropertySource(value="classpath:/application.properties", ignoreResourceNotFound=true) public class DataLoader implements ApplicationListener<ContextRefreshedEvent> { private static final org.slf4j.Logger LOG = Logger.getLogger(); @Autowired private Environment env; @Autowired private CompanyConfigService companyConfigService; @Autowired @Qualifier("QueryAPI") private QBODataService queryService; @Override public void onApplicationEvent(ContextRefreshedEvent event) { // Load CompanyConfig table with realmIds and access tokens loadCompanyConfig(); //get list of companyConfigs Iterable<CompanyConfig> companyConfigs = companyConfigService.getAllCompanyConfigs(); //run findQuery for all entities for each realmId // and update the timestamp in the database // This is done so that the app is synced before it listens to event notifications for (CompanyConfig config : companyConfigs) { try { String lastQueryTimestamp = DateUtils.getStringFromDateTime(DateUtils.getCurrentDateTime()); queryService.callDataService(config); //update timestamp data in table config.setLastCdcTimestamp(lastQueryTimestamp); companyConfigService.save(config); } catch (Exception ex) { LOG.error("Error loading company configs" , ex.getCause()); } } } /** * Read access tokens and other properties from the configuration file and load it in the in-memory h2 database * */ private void loadCompanyConfig() { final CompanyConfig companyConfig = new CompanyConfig(env.getProperty("company1.id"), env.getProperty("company1.accessToken"), env.getProperty("company1.accessTokenSecret"), env.getProperty("company1.webhooks.subscribed.entities"), env.getProperty("company1.oauth2.accessToken")); companyConfigService.save(companyConfig); final CompanyConfig company2 = new CompanyConfig(env.getProperty("company2.id"), env.getProperty("company2.accessToken"), env.getProperty("company2.accessTokenSecret"), env.getProperty("company2.webhooks.subscribed.entities"), env.getProperty("company2.oauth2.accessToken")); companyConfigService.save(company2); } }
[ "diana_derose@intuit.com" ]
diana_derose@intuit.com
74b2fa87462653e959f55306bf415e864f43fc93
690b6b00cd868f648b293e9cdac95d796f158c03
/responsibility_pattern/src/main/java/com.liudehuang.responsibility/controller/HandlerController.java
2f56cc0f8abc5a1406a8fc21fc913299fa9442af
[]
no_license
8Liu/design_pattern
9d83a9cf9a6ed5a00237543423a8bf4bcb420c34
c517a3545ccfd1bd3a9e72b44097e549d05d29d2
refs/heads/master
2021-07-10T08:10:52.571729
2020-08-20T15:21:48
2020-08-20T15:21:48
171,411,392
0
0
null
null
null
null
UTF-8
Java
false
false
620
java
package com.liudehuang.responsibility.controller; import com.liudehuang.responsibility.factory.HandlerFactory; import com.liudehuang.responsibility.handler.GatewayHandler; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; /** * @Author liudehuang * @Description //TODO * @Date 2019/5/9 **/ @RestController public class HandlerController { @GetMapping("/handler") public String client(){ GatewayHandler gatewayHandler = HandlerFactory.getGatewayHandler(); gatewayHandler.service(); return "success"; } }
[ "2969878315@qq.com" ]
2969878315@qq.com
603a5443e3f6f6a6cdf2ea0c1810961f010c7cc5
a15a361d36013823a3dbbcb6e28d688f663670c1
/my-net-buddha/code-generator1/src/main/java/com/luomengan/code/generator/swagger/SwaggerConfigration.java
5a0634e3fce72fcb7f4053d8fdc9ace68a8c40be
[]
no_license
sunliang123/surprised_two
f86890ee290e9a7b916fc6b678bbe568123a46d4
91ec0f912e625743f6fb5d8a4fa223b91da86ae8
refs/heads/master
2020-04-12T02:35:27.705174
2018-12-18T07:25:01
2018-12-18T07:25:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,173
java
package com.luomengan.code.generator.swagger; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import springfox.documentation.builders.ApiInfoBuilder; import springfox.documentation.builders.PathSelectors; import springfox.documentation.builders.RequestHandlerSelectors; import springfox.documentation.service.ApiInfo; import springfox.documentation.service.Contact; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger2.annotations.EnableSwagger2; @Configuration @EnableSwagger2 public class SwaggerConfigration { @Bean public Docket createRestApi() { return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).select() .apis(RequestHandlerSelectors.basePackage("com.luomengan.code.generator.controller")) .paths(PathSelectors.any()).build(); } private ApiInfo apiInfo() { Contact contact = new Contact("luomengan", "http://localhost:8080/code-generator/", "493671072@qq.com"); return new ApiInfoBuilder().title("代码生成器Api").contact(contact).version("1.0").build(); } }
[ "sunliang_s666@163.com" ]
sunliang_s666@163.com
2c6624848ecb0756f418c5d2a734a446186aa616
225011bbc304c541f0170ef5b7ba09b967885e95
/com/unit/three/p138b/C4055e.java
1c887b8f5945349749d9985d1014e21ae355ae11
[]
no_license
sebaudracco/bubble
66536da5367f945ca3318fecc4a5f2e68c1df7ee
e282cda009dfc9422594b05c63e15f443ef093dc
refs/heads/master
2023-08-25T09:32:04.599322
2018-08-14T15:27:23
2018-08-14T15:27:23
140,444,001
1
1
null
null
null
null
UTF-8
Java
false
false
905
java
package com.unit.three.p138b; import android.content.Context; import com.unit.three.p140d.C4083a; import com.unit.three.p141c.C4078f; final class C4055e implements Runnable { private /* synthetic */ Context f9369a; private /* synthetic */ C4053c f9370b; C4055e(C4053c c4053c, Context context) { this.f9370b = c4053c; this.f9369a = context; } public final void run() { try { C4053c.m12503a().m12516c(this.f9369a); String h = C4078f.m12572h(); int i = C4078f.m12573i(); if (C4053c.m12506a(this.f9370b, h, i)) { long c = C4053c.m12510c(); C4083a.m12599a(this.f9369a); Thread.sleep(c + C4083a.m12597a().m12583g()); C4053c.m12509b(this.f9370b, h, i); } } catch (Throwable th) { th.printStackTrace(); } } }
[ "sebaudracco@gmail.com" ]
sebaudracco@gmail.com
204afc8bbe543ecda0f1f5ef230dd421c6e11d7d
20f97e85627032f6036976b8fefe62c40a79aca1
/app/assertion/src/main/java/sav/java/parser/cfg/CfgProperty.java
a4ecadb49a2d79bc581eeb975d50901241c7912d
[]
no_license
sunjun-group/Ziyuan
d0279366ac896042a7a79f7cc0402fd60545cb0b
8922ff1f3781139c619790f49d0e79632ab753fa
refs/heads/master
2020-04-09T06:04:30.796500
2018-01-03T08:43:57
2018-01-03T08:43:57
20,321,407
1
10
null
2016-11-07T07:16:04
2014-05-30T07:52:13
Java
UTF-8
Java
false
false
273
java
/* * Copyright (C) 2013 by SUTD (Singapore) * All rights reserved. * * Author: SUTD * Version: $Revision: 1 $ */ package sav.java.parser.cfg; /** * @author LLT * */ public enum CfgProperty { PARAMETER, AST_NODE, LOOP_DECISION_NODE; }
[ "lylypp6987@gmail.com" ]
lylypp6987@gmail.com
114e663e472f889c3f12aa6335c07c15c3b60b90
052f08166a914725ae294c86969ce6e4e927085b
/design-patterns/src/main/java/com/mageddo/designpatterns/cap_11_2/MyRemoteClient.java
c43d61c77373eb5da1c66d6baf5f7762615c9a5c
[]
no_license
mageddo/head-first
1ef18c16a2ba390992af95d9cfec5f6b4929db1f
6688ed2af6e46235c0944a7408bad3a7fa1bd4be
refs/heads/master
2021-01-02T22:48:14.028689
2018-03-25T16:41:11
2018-03-25T16:41:11
99,394,936
0
0
null
null
null
null
UTF-8
Java
false
false
420
java
package com.mageddo.designpatterns.cap_11_2; import java.rmi.Naming; public class MyRemoteClient { public static void main(String[] args) { new MyRemoteClient().go(); } void go(){ try{ MyRemote service = (MyRemote) Naming.lookup("rmi://127.0.0.1/RemoteHello"); String s = service.sayHello(); System.out.println(s); }catch(Exception e){ e.printStackTrace(); } } }
[ "edigitalb@gmail.com" ]
edigitalb@gmail.com
22732a7056c1a0b915fe80ab1d645eac4ad70a89
7cb9e5ef036d9b79641588843329f2534d8f3dac
/Horstman/Chapter10/Ex5/src/Example.java
20836fd7ca778b4136f95f2be8877142f2c1d814
[]
no_license
WiPeK/java
d444f76840e0b65159ef46f34a4587dd96c15694
be6229dde2ddf7a916faede19f2f2a796ee69e36
refs/heads/master
2021-01-22T04:53:42.405222
2017-10-27T21:27:41
2017-10-27T21:27:41
81,595,754
0
0
null
null
null
null
UTF-8
Java
false
false
250
java
import java.io.File; import java.util.HashSet; import java.util.Set; import java.util.stream.Stream; /** * Created by Acer on 06.04.2017. */ public class Example { public static void main(String[] args) { Set<File> files = ; } }
[ "wipekxxx@gmail.com" ]
wipekxxx@gmail.com
3cd91d7581c259b17faf13f85b6b33efc332f2e9
3e3d1b318af36d56b9929c7157b6290f58b9e215
/troy-commons/src/main/java/com/troy/commons/constraints/Log.java
ec76362079861658e71d8643fb0b1c64d298bb60
[]
no_license
troyproject/troy-baseline-public
bed5867d11596be2d7202320e880e60f3df816ba
cfd726a692f96a7cb4dd86fa64c3666b87da948a
refs/heads/master
2022-07-03T06:52:33.194833
2020-01-10T08:55:05
2020-01-10T08:55:05
232,982,208
0
0
null
2022-06-21T02:36:47
2020-01-10T06:35:22
Java
UTF-8
Java
false
false
664
java
package com.troy.commons.constraints; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * controller统一日志 * * @author ydp * */ @Retention(RetentionPolicy.RUNTIME) @Target({ ElementType.METHOD }) public @interface Log { /** * 用于输出日志前缀 * @return */ String value(); /** * 是否打印入参,默认:打印 * @return */ boolean inputPrint() default true; /** * 是否打印出参,默认:打印 * @return */ boolean outputPrint() default true; }
[ "376704341@qq.com" ]
376704341@qq.com
63bc7f12a841de96d080c9baed59fac956aa3162
99116cb337da8a7d45387dc4bf34bca6e18b8dc5
/src/main/java/com/youyuan/plus/datetime/LocalDateTime10.java
07376f55fb36fc98ba3ff469af7f3a7ee83ef41f
[]
no_license
zhangyu2046196/jdk8_demo
46a051ebb43d077ebdf4e477a9d1f8e48d06d2de
3accf898fef4859b8b92ab094f7762fe19f75583
refs/heads/master
2021-01-26T09:15:15.171819
2020-08-31T08:20:30
2020-08-31T08:20:30
243,399,225
0
0
null
null
null
null
UTF-8
Java
false
false
576
java
package com.youyuan.plus.datetime; import java.time.LocalDateTime; /** * 类名称:LocalDateTime10 <br> * 类描述: 时间大小比较 <br> * * @author zhangyu * @version 1.0.0 * @date 创建时间:2020/8/31 16:15<br> */ public class LocalDateTime10 { public static void main(String[] args) { LocalDateTime ldt4 = LocalDateTime.now(); LocalDateTime ldt5 = ldt4.plusMinutes(10); System.out.println("当前时间是否大于:"+ldt4.isAfter(ldt5)); System.out.println("当前时间是否小于"+ldt4.isBefore(ldt5)); } }
[ "zhangyu2046196@163.com" ]
zhangyu2046196@163.com
f028a63eb9b56a78a8dbdf1e802ec70cabb6889c
3016374f9ee1929276a412eb9359c0420d165d77
/InstrumentAPK/sootOutput/com.waze_source_from_JADX/com/google/android/gms/internal/zzu.java
05c93145c784ec02b38ed178da51ccda5c08386d
[]
no_license
DulingLai/Soot_Instrumenter
190cd31e066a57c0ddeaf2736a8d82aec49dadbf
9b13097cb426b27df7ba925276a7e944b469dffb
refs/heads/master
2021-01-02T08:37:50.086354
2018-04-16T09:21:31
2018-04-16T09:21:31
99,032,882
4
3
null
null
null
null
UTF-8
Java
false
false
2,094
java
package com.google.android.gms.internal; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.LinkedList; import java.util.List; /* compiled from: dalvik_source_com.waze.apk */ public class zzu { protected static final Comparator<byte[]> zzbu = new C08611(); private List<byte[]> zzbq = new LinkedList(); private List<byte[]> zzbr = new ArrayList(64); private int zzbs = 0; private final int zzbt; /* compiled from: dalvik_source_com.waze.apk */ class C08611 implements Comparator<byte[]> { C08611() throws { } public /* synthetic */ int compare(Object $r1, Object $r2) throws { return zza((byte[]) $r1, (byte[]) $r2); } public int zza(byte[] $r1, byte[] $r2) throws { return $r1.length - $r2.length; } } public zzu(int $i0) throws { this.zzbt = $i0; } private synchronized void zzx() throws { while (this.zzbs > this.zzbt) { byte[] $r3 = (byte[]) this.zzbq.remove(0); this.zzbr.remove($r3); this.zzbs -= $r3.length; } } public synchronized void zza(byte[] $r1) throws { if ($r1 != null) { if ($r1.length <= this.zzbt) { this.zzbq.add($r1); int $i0 = Collections.binarySearch(this.zzbr, $r1, zzbu); int $i1 = $i0; if ($i0 < 0) { $i1 = (-$i0) - 1; } this.zzbr.add($i1, $r1); this.zzbs += $r1.length; zzx(); } } } public synchronized byte[] zzb(int $i0) throws { byte[] $r3; for (int $i1 = 0; $i1 < this.zzbr.size(); $i1++) { $r3 = (byte[]) this.zzbr.get($i1); if ($r3.length >= $i0) { this.zzbs -= $r3.length; this.zzbr.remove($i1); this.zzbq.remove($r3); break; } } $r3 = new byte[$i0]; return $r3; } }
[ "laiduling@alumni.ubc.ca" ]
laiduling@alumni.ubc.ca
3a4576a91fe248d9c43380c759e9fa7b6c7b563f
83c6e015b0b1feba54ff1e14d6bad4dbc0163c1b
/com.centurylink.mdw.designer.ui/src/com/centurylink/mdw/plugin/designer/properties/AttributesSection.java
355a7d86caf15bf05043b38190e898e60316e642
[]
no_license
oakesville/mdw-designer
b4d8ae37f992e2f38c033fb469c6796d348b2719
0d6dd7c4c55163c5f358c267856d76c57928fa76
refs/heads/master
2020-03-23T15:44:49.599144
2018-07-20T16:49:00
2018-07-20T16:49:00
141,771,764
1
0
null
2018-07-21T01:31:30
2018-07-21T01:31:30
null
UTF-8
Java
false
false
5,425
java
/* * Copyright (C) 2017 CenturyLink, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.centurylink.mdw.plugin.designer.properties; import java.util.ArrayList; import java.util.List; import org.eclipse.jface.viewers.IFilter; import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.ITableLabelProvider; import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jface.viewers.Viewer; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.widgets.Composite; import com.centurylink.mdw.plugin.designer.dialogs.AttributeDialog; import com.centurylink.mdw.plugin.designer.model.Activity; import com.centurylink.mdw.plugin.designer.model.ActivityImpl; import com.centurylink.mdw.plugin.designer.model.EmbeddedSubProcess; import com.centurylink.mdw.plugin.designer.model.WorkflowProcess; import com.centurylink.mdw.plugin.designer.model.Transition; import com.centurylink.mdw.plugin.designer.model.WorkflowElement; import com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec; import com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor; import com.centurylink.mdw.plugin.designer.properties.editor.TableEditor; import com.centurylink.mdw.model.value.attribute.AttributeVO; public class AttributesSection extends PropertySection implements IFilter { private WorkflowElement element; public WorkflowElement getElement() { return element; } private TableEditor tableEditor; @Override public void setSelection(WorkflowElement selection) { this.element = selection; tableEditor.setElement(element); tableEditor.setValue(element.getAttributes()); } @Override public void drawWidgets(Composite composite, WorkflowElement selection) { this.element = selection; tableEditor = new TableEditor(element, TableEditor.TYPE_TABLE); List<ColumnSpec> columnSpecs = new ArrayList<>(); columnSpecs.add(new ColumnSpec(PropertyEditor.TYPE_TEXT, "Attribute Name", "name")); columnSpecs.add(new ColumnSpec(PropertyEditor.TYPE_TEXT, "Value", "value")); tableEditor.setColumnSpecs(columnSpecs); tableEditor.setReadOnly(true); tableEditor.setContentProvider(new AttributeContentProvider()); tableEditor.setLabelProvider(new AttributeLabelProvider()); tableEditor.render(composite); tableEditor.getTable().addSelectionListener(new SelectionAdapter() { @Override public void widgetDefaultSelected(SelectionEvent e) { AttributeVO attributeVO = (AttributeVO) e.item.getData(); AttributeDialog dialog = new AttributeDialog(getShell(), attributeVO); dialog.open(); } }); } class AttributeContentProvider implements IStructuredContentProvider { @SuppressWarnings("unchecked") public Object[] getElements(Object inputElement) { List<AttributeVO> rows = (List<AttributeVO>) inputElement; return rows.toArray(new AttributeVO[0]); } @Override public void dispose() { //do nothing } @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { //do nothing } } class AttributeLabelProvider extends LabelProvider implements ITableLabelProvider { public Image getColumnImage(Object element, int columnIndex) { return null; } public String getColumnText(Object element, int columnIndex) { AttributeVO attributeVO = (AttributeVO) element; switch (columnIndex) { case 0: return attributeVO.getAttributeName(); case 1: return attributeVO.getAttributeValue(); default: return null; } } } public boolean select(Object toTest) { if (!(toTest instanceof Activity) && !(toTest instanceof WorkflowProcess) && !(toTest instanceof Transition) && !(toTest instanceof ActivityImpl) && !(toTest instanceof EmbeddedSubProcess)) return false; if (toTest instanceof Activity && ((Activity) toTest).isForProcessInstance()) return false; if (toTest instanceof Transition && ((Transition) toTest).isForProcessInstance()) return false; if (toTest instanceof EmbeddedSubProcess && ((EmbeddedSubProcess) toTest).isForProcessInstance()) return false; return !((WorkflowElement) toTest).hasInstanceInfo(); } }
[ "donald.oakes@centurylink.com" ]
donald.oakes@centurylink.com