blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 4 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2 values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 689M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 131 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 32 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 313 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7c41bac93f114b968f8af8ad1ee5945e97138695 | c8dfa548a2cb88221002f6ed6bee71a395fde716 | /normals/src/main/java/com/wong/eventflows/event/Event.java | 8924b5ab6fa2719b2285ab1e22409563552428b8 | [
"Apache-2.0"
] | permissive | wongminbin/exercise-demos | 6d530525dee4ed4d95075c3463d7b230990e64a7 | 25f63f669896a78c22c25992c3e46af975d877ad | refs/heads/master | 2022-07-04T15:43:39.417106 | 2019-05-23T01:27:16 | 2019-05-23T01:27:16 | 156,669,651 | 2 | 1 | Apache-2.0 | 2022-06-29T17:02:58 | 2018-11-08T07:49:35 | Java | UTF-8 | Java | false | false | 1,784 | java | package com.wong.eventflows.event;
import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Map;
import java.util.TreeMap;
import com.wong.eventflows.anno.AfterWork;
import com.wong.eventflows.anno.BeforeWork;
import com.wong.eventflows.anno.Working;
/**
* @author HuangZhibin
*
* 2018年7月3日 下午5:45:33
*/
public interface Event<T> {
@SuppressWarnings("unchecked")
default T work() {
Method[] methods = getClass().getDeclaredMethods();
Method before = null, after = null;
Map<Integer, Method> works = new TreeMap<>();
for (Method method : methods) {
method.setAccessible(true);
Annotation[] as = method.getAnnotations();
for (Annotation a : as) {
if (a.annotationType().isAssignableFrom(BeforeWork.class)) {
before = method;
} else if (a.annotationType().isAssignableFrom(AfterWork.class)) {
after = method;
} else if (a.annotationType().isAssignableFrom(Working.class)) {
Working w = (Working)a;
works.put(w.order(), method);
}
}
}
if (before != null) {
try {
before.invoke(this);
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
throw new RuntimeException(e);
}
}
works.forEach((k, v) -> {
try {
v.invoke(this);
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
throw new RuntimeException(e);
}
});
if (after != null) {
try {
return (T)after.invoke(this);
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
throw new RuntimeException(e);
}
}
return null;
}
}
| [
"Administrator@windows10.microdone.cn"
] | Administrator@windows10.microdone.cn |
36741a579057cf125d73a80c1e08bfa86068c727 | 0e96063361b5d4d86af72f13793caf46df33b4fa | /src/main/java/dinodungeons/editor/ui/groups/buttons/StaticObjectButtonGroup.java | 04258dffc9b4614613049f4276943e69f1f111e6 | [] | no_license | AndideBob/DinoDungeons | ba43747d9d736da5f054bbe60d84aea58ba9c9c0 | 798e53a46223b048c8c23a40505bf45351b929a5 | refs/heads/master | 2021-07-07T10:44:57.115215 | 2020-08-18T20:47:23 | 2020-08-18T20:47:23 | 171,297,900 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,524 | java | package dinodungeons.editor.ui.groups.buttons;
import java.util.ArrayList;
import java.util.Collection;
import dinodungeons.editor.Editor;
import dinodungeons.editor.map.change.ImmovablePlacementMapChange.ImmovableType;
import dinodungeons.editor.map.change.MapChangeType;
import dinodungeons.editor.ui.buttons.BaseButton;
import dinodungeons.editor.ui.buttons.mapchange.StaticObjectChangeButton;
import dinodungeons.editor.ui.buttons.mapchange.StaticObjectChangeButton.StaticObjectType;
import dinodungeons.game.data.map.objects.DestructibleMapObject.DestructableType;
import lwjgladapter.logging.Logger;
public class StaticObjectButtonGroup extends UIButtonGroup {
private Editor editorHandle;
public StaticObjectButtonGroup(final Editor editorHandle){
super(editorHandle);
this.editorHandle = editorHandle;
}
@Override
protected Collection<? extends BaseButton> initializeButtons(final Editor editorHandle) {
ArrayList<BaseButton> buttons = new ArrayList<>();
//No Interactions
buttons.add(new StaticObjectChangeButton(256, 208, this, StaticObjectType.IMMOVABLE_BLOCK));
//Destructables
buttons.add(new StaticObjectChangeButton(256, 176, this, StaticObjectType.DESTRUCTABLE_GRASS));
buttons.add(new StaticObjectChangeButton(272, 176, this, StaticObjectType.DESTRUCTABLE_STONE));
//Hurting Objects
buttons.add(new StaticObjectChangeButton(256, 144, this, StaticObjectType.SPIKES_WOOD));
buttons.add(new StaticObjectChangeButton(272, 144, this, StaticObjectType.SPIKES_METAL));
return buttons;
}
public void setObjectType(StaticObjectType staticObjectType) {
switch (staticObjectType) {
case DESTRUCTABLE_GRASS:
editorHandle.setMapChange(MapChangeType.DESTRUCTIBLE_PLACEMENT, DestructableType.BUSH_NORMAL.getStringRepresentation());
return;
case DESTRUCTABLE_STONE:
editorHandle.setMapChange(MapChangeType.DESTRUCTIBLE_PLACEMENT, DestructableType.EXPLODABLE_ROCK.getStringRepresentation());
return;
case SPIKES_METAL:
editorHandle.setMapChange(MapChangeType.SPIKE_PLACEMENT, "0");
return;
case SPIKES_WOOD:
editorHandle.setMapChange(MapChangeType.SPIKE_PLACEMENT, "1");
return;
case IMMOVABLE_BLOCK:
editorHandle.setMapChange(MapChangeType.IMMOVABLE_PLACEMENT, ImmovableType.STONE_BLOCK.getStringRepresentation());
return;
}
Logger.logDebug(staticObjectType.toString() + " not implemented yet!");
}
@Override
protected void onActivate() {
buttons.get(0).setPressed(true);
setObjectType(StaticObjectType.IMMOVABLE_BLOCK);
}
}
| [
"andidebob@gmail.com"
] | andidebob@gmail.com |
661d58cfa0f69372d673a4951e6004d077cf8b46 | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/aosp-mirror--platform_frameworks_base/eeea67b8c3678d882d3774edc41242c63daa60fa/after/PackageDexOptimizer.java | 67d7dc992d09e8e0d614e2d319f0498426f6a0c8 | [] | 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 | 9,965 | java | /*
* Copyright (C) 2015 The Android Open Source Project
*
* 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.android.server.pm;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageParser;
import android.os.UserHandle;
import android.util.ArraySet;
import android.util.Log;
import android.util.Slog;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import dalvik.system.DexFile;
import dalvik.system.StaleDexCacheError;
import static com.android.server.pm.InstructionSets.getAppDexInstructionSets;
import static com.android.server.pm.InstructionSets.getDexCodeInstructionSets;
/**
* Helper class for running dexopt command on packages.
*/
final class PackageDexOptimizer {
static final String TAG = "PackageManager.DexOptimizer";
static final int DEX_OPT_SKIPPED = 0;
static final int DEX_OPT_PERFORMED = 1;
static final int DEX_OPT_DEFERRED = 2;
static final int DEX_OPT_FAILED = -1;
private final PackageManagerService mPackageManagerService;
private ArraySet<PackageParser.Package> mDeferredDexOpt;
PackageDexOptimizer(PackageManagerService packageManagerService) {
this.mPackageManagerService = packageManagerService;
}
/**
* Performs dexopt on all code paths and libraries of the specified package for specified
* instruction sets.
*
* <p>Calls to {@link com.android.server.pm.Installer#dexopt} are synchronized on
* {@link PackageManagerService#mInstallLock}.
*/
int performDexOpt(PackageParser.Package pkg, String[] instructionSets,
boolean forceDex, boolean defer, boolean inclDependencies) {
ArraySet<String> done;
if (inclDependencies && (pkg.usesLibraries != null || pkg.usesOptionalLibraries != null)) {
done = new ArraySet<String>();
done.add(pkg.packageName);
} else {
done = null;
}
synchronized (mPackageManagerService.mInstallLock) {
return performDexOptLI(pkg, instructionSets, forceDex, defer, done);
}
}
private int performDexOptLI(PackageParser.Package pkg, String[] targetInstructionSets,
boolean forceDex, boolean defer, ArraySet<String> done) {
final String[] instructionSets = targetInstructionSets != null ?
targetInstructionSets : getAppDexInstructionSets(pkg.applicationInfo);
if (done != null) {
done.add(pkg.packageName);
if (pkg.usesLibraries != null) {
performDexOptLibsLI(pkg.usesLibraries, instructionSets, forceDex, defer, done);
}
if (pkg.usesOptionalLibraries != null) {
performDexOptLibsLI(pkg.usesOptionalLibraries, instructionSets, forceDex, defer,
done);
}
}
if ((pkg.applicationInfo.flags & ApplicationInfo.FLAG_HAS_CODE) == 0) {
return DEX_OPT_SKIPPED;
}
final boolean vmSafeMode = (pkg.applicationInfo.flags & ApplicationInfo.FLAG_VM_SAFE_MODE) != 0;
final List<String> paths = pkg.getAllCodePathsExcludingResourceOnly();
boolean performedDexOpt = false;
// There are three basic cases here:
// 1.) we need to dexopt, either because we are forced or it is needed
// 2.) we are deferring a needed dexopt
// 3.) we are skipping an unneeded dexopt
final String[] dexCodeInstructionSets = getDexCodeInstructionSets(instructionSets);
for (String dexCodeInstructionSet : dexCodeInstructionSets) {
if (!forceDex && pkg.mDexOptPerformed.contains(dexCodeInstructionSet)) {
continue;
}
for (String path : paths) {
try {
// This will return DEXOPT_NEEDED if we either cannot find any odex file for this
// package or the one we find does not match the image checksum (i.e. it was
// compiled against an old image). It will return PATCHOAT_NEEDED if we can find a
// odex file and it matches the checksum of the image but not its base address,
// meaning we need to move it.
final byte isDexOptNeeded = DexFile.isDexOptNeededInternal(path,
pkg.packageName, dexCodeInstructionSet, defer);
if (forceDex || (!defer && isDexOptNeeded == DexFile.DEXOPT_NEEDED)) {
Log.i(TAG, "Running dexopt on: " + path + " pkg="
+ pkg.applicationInfo.packageName + " isa=" + dexCodeInstructionSet
+ " vmSafeMode=" + vmSafeMode);
final int sharedGid = UserHandle.getSharedAppGid(pkg.applicationInfo.uid);
final int ret = mPackageManagerService.mInstaller.dexopt(path, sharedGid,
!pkg.isForwardLocked(), pkg.packageName, dexCodeInstructionSet,
vmSafeMode);
if (ret < 0) {
// Don't bother running dexopt again if we failed, it will probably
// just result in an error again. Also, don't bother dexopting for other
// paths & ISAs.
return DEX_OPT_FAILED;
}
performedDexOpt = true;
} else if (!defer && isDexOptNeeded == DexFile.PATCHOAT_NEEDED) {
Log.i(TAG, "Running patchoat on: " + pkg.applicationInfo.packageName);
final int sharedGid = UserHandle.getSharedAppGid(pkg.applicationInfo.uid);
final int ret = mPackageManagerService.mInstaller.patchoat(path, sharedGid,
!pkg.isForwardLocked(), pkg.packageName, dexCodeInstructionSet);
if (ret < 0) {
// Don't bother running patchoat again if we failed, it will probably
// just result in an error again. Also, don't bother dexopting for other
// paths & ISAs.
return DEX_OPT_FAILED;
}
performedDexOpt = true;
}
// We're deciding to defer a needed dexopt. Don't bother dexopting for other
// paths and instruction sets. We'll deal with them all together when we process
// our list of deferred dexopts.
if (defer && isDexOptNeeded != DexFile.UP_TO_DATE) {
addPackageForDeferredDexopt(pkg);
return DEX_OPT_DEFERRED;
}
} catch (FileNotFoundException e) {
Slog.w(TAG, "Apk not found for dexopt: " + path);
return DEX_OPT_FAILED;
} catch (IOException e) {
Slog.w(TAG, "IOException reading apk: " + path, e);
return DEX_OPT_FAILED;
} catch (StaleDexCacheError e) {
Slog.w(TAG, "StaleDexCacheError when reading apk: " + path, e);
return DEX_OPT_FAILED;
} catch (Exception e) {
Slog.w(TAG, "Exception when doing dexopt : ", e);
return DEX_OPT_FAILED;
}
}
// At this point we haven't failed dexopt and we haven't deferred dexopt. We must
// either have either succeeded dexopt, or have had isDexOptNeededInternal tell us
// it isn't required. We therefore mark that this package doesn't need dexopt unless
// it's forced. performedDexOpt will tell us whether we performed dex-opt or skipped
// it.
pkg.mDexOptPerformed.add(dexCodeInstructionSet);
}
// If we've gotten here, we're sure that no error occurred and that we haven't
// deferred dex-opt. We've either dex-opted one more paths or instruction sets or
// we've skipped all of them because they are up to date. In both cases this
// package doesn't need dexopt any longer.
return performedDexOpt ? DEX_OPT_PERFORMED : DEX_OPT_SKIPPED;
}
private void performDexOptLibsLI(ArrayList<String> libs, String[] instructionSets,
boolean forceDex, boolean defer, ArraySet<String> done) {
for (String libName : libs) {
PackageParser.Package libPkg = mPackageManagerService.findSharedNonSystemLibrary(
libName);
if (libPkg != null && !done.contains(libName)) {
performDexOptLI(libPkg, instructionSets, forceDex, defer, done);
}
}
}
/**
* Clears set of deferred dexopt packages.
* @return content of dexopt set if it was not empty
*/
public ArraySet<PackageParser.Package> clearDeferredDexOptPackages() {
ArraySet<PackageParser.Package> result = mDeferredDexOpt;
mDeferredDexOpt = null;
return result;
}
public void addPackageForDeferredDexopt(PackageParser.Package pkg) {
if (mDeferredDexOpt == null) {
mDeferredDexOpt = new ArraySet<PackageParser.Package>();
}
mDeferredDexOpt.add(pkg);
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
a74b16c1153421f6d37bc5e163362a8d1fecbfc2 | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/MATH-100b-1-4-PESA_II-WeightedSum:TestLen:CallDiversity/org/apache/commons/math/estimation/AbstractEstimator_ESTest_scaffolding.java | 63f8898813d8057508e65c36b40cdef4b00dd34e | [] | 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 | 3,079 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Sun Jan 19 13:03:12 UTC 2020
*/
package org.apache.commons.math.estimation;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class AbstractEstimator_ESTest_scaffolding {
@org.junit.Rule
public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
@BeforeClass
public static void initEvoSuiteFramework() {
org.evosuite.runtime.RuntimeSettings.className = "org.apache.commons.math.estimation.AbstractEstimator";
org.evosuite.runtime.GuiSupport.initialize();
org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
}
@Before
public void initTestCase(){
threadStopper.storeCurrentThreads();
threadStopper.startRecordingTime();
org.evosuite.runtime.GuiSupport.setHeadless();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
org.evosuite.runtime.agent.InstrumentingAgent.activate();
}
@After
public void doneWithTestCase(){
threadStopper.killAndJoinClientThreads();
org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
}
private static void initializeClasses() {
org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(AbstractEstimator_ESTest_scaffolding.class.getClassLoader() ,
"org.apache.commons.math.estimation.EstimatedParameter",
"org.apache.commons.math.linear.MatrixIndexException",
"org.apache.commons.math.estimation.EstimationException",
"org.apache.commons.math.estimation.WeightedMeasurement",
"org.apache.commons.math.estimation.SimpleEstimationProblem",
"org.apache.commons.math.linear.RealMatrixImpl",
"org.apache.commons.math.MathException",
"org.apache.commons.math.linear.BigMatrix",
"org.apache.commons.math.estimation.Estimator",
"org.apache.commons.math.estimation.LevenbergMarquardtEstimator",
"org.apache.commons.math.estimation.LevenbergMarquardtEstimatorTest$QuadraticProblem$LocalMeasurement",
"org.apache.commons.math.linear.MatrixUtils",
"org.apache.commons.math.estimation.AbstractEstimator",
"org.apache.commons.math.linear.InvalidMatrixException",
"org.apache.commons.math.estimation.LevenbergMarquardtEstimatorTest$QuadraticProblem",
"org.apache.commons.math.estimation.LevenbergMarquardtEstimatorTest",
"org.apache.commons.math.linear.RealMatrix",
"org.apache.commons.math.estimation.EstimationProblem"
);
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
1a54d441a6843b2a8d19abefe20e88bc7c6a9639 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/29/29_3b7d291d2a636415c779b537d84385c579999d4a/TestDataReaderSun1_6_0/29_3b7d291d2a636415c779b537d84385c579999d4a_TestDataReaderSun1_6_0_t.java | 429790964129be360de9a0b0e3b14da4c9d90146 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 30,037 | java | package com.tagtraum.perf.gcviewer.imp;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.junit.Test;
import com.tagtraum.perf.gcviewer.model.ConcurrentGCEvent;
import com.tagtraum.perf.gcviewer.model.GCEvent;
import com.tagtraum.perf.gcviewer.model.GCModel;
public class TestDataReaderSun1_6_0 {
private static final Logger IMP_LOGGER = Logger.getLogger("com.tagtraum.perf.gcviewer.imp");
private static final Logger DATA_READER_FACTORY_LOGGER = Logger.getLogger("com.tagtraum.perf.gcviewer.DataReaderFactory");
private static final SimpleDateFormat dateParser = new SimpleDateFormat(AbstractDataReaderSun.DATE_STAMP_FORMAT);
@Test
public void testPrintGCDateStamps() throws Exception {
final ByteArrayInputStream in = new ByteArrayInputStream(
("2011-10-05T04:23:39.427+0200: 19.845: [GC 19.845: [ParNew: 93184K->5483K(104832K), 0.0384413 secs] 93184K->5483K(1036928K), 0.0388082 secs] [Times: user=0.41 sys=0.06, real=0.04 secs]")
.getBytes());
final DataReader reader = new DataReaderSun1_6_0(in);
GCModel model = reader.read();
assertTrue("hasDateStamp", model.hasDateStamp());
assertEquals("DateStamp",
dateParser.parse("2011-10-05T04:23:39.427+0200"),
model.getFirstDateStamp());
assertEquals("gc pause", 0.0388082, model.getGCPause().getMax(), 0.000001);
}
@Test
public void testCMSPromotionFailed() throws Exception {
final ByteArrayInputStream in = new ByteArrayInputStream(
("2011-10-05T16:05:55.964+0200: 41985.374: [GC 41985.375: [ParNew (promotion failed): 104960K->100764K(104960K), 0.3379238 secs]41985.713: [CMS: 1239589K->897516K(1398144K), 38.3189415 secs] 1336713K->897516K(1503104K), [CMS Perm : 55043K->53511K(91736K)], 38.6583674 secs] [Times: user=39.22 sys=0.06, real=38.66 secs]")
.getBytes());
final DataReader reader = new DataReaderSun1_6_0(in);
GCModel model = reader.read();
assertEquals("gc pause", 38.6583674, model.getFullGCPause().getSum(), 0.000001);
}
@Test
public void testCMSConcurrentModeFailureDate() throws Exception {
final ByteArrayInputStream in = new ByteArrayInputStream(
("2011-10-05T15:53:24.119+0200: 41403.025: [GC 41403.025: [ParNew (promotion failed): 104960K->101572K(104960K), 0.3275017 secs]41403.353: [CMS2011-10-05T15:53:24.629+0200: 41403.534: [CMS-concurrent-abortable-preclean: 1.992/2.650 secs] [Times: user=4.40 sys=0.06, real=2.65 secs]" +
"\n (concurrent mode failure): 1295417K->906090K(1398144K), 32.4123146 secs] 1395643K->906090K(1503104K), [CMS Perm : 54986K->53517K(91576K)], 32.7410609 secs] [Times: user=33.10 sys=0.05, real=32.74 secs]")
.getBytes());
final DataReader reader = new DataReaderSun1_6_0(in);
GCModel model = reader.read();
assertEquals("GC count", 2, model.size());
assertEquals("gc pause", 32.7410609, model.getFullGCPause().getMax(), 0.000001);
}
@Test
public void testCMSConcurrentModeFailure() throws Exception {
final ByteArrayInputStream in = new ByteArrayInputStream(
("25866.053: [GC 25866.054: [ParNew (promotion failed): 458123K->468193K(471872K), 0.9151441 secs]25866.969: [CMS25870.038: [CMS-concurrent-mark: 3.120/4.102 secs] [Times: user=26.00 sys=0.12, real=4.10 secs]" +
"\n (concurrent mode failure): 1143630K->1154547K(1572864K), 40.1744087 secs] 1590086K->1154547K(2044736K), [CMS Perm : 65802K->63368K(109784K)], 41.0904457 secs] [Times: user=60.57 sys=0.07, real=41.09 secs]")
.getBytes());
final DataReader reader = new DataReaderSun1_6_0(in);
GCModel model = reader.read();
assertEquals("GC count", 2, model.size());
assertEquals("gc pause", 41.0904457, model.getFullGCPause().getMax(), 0.000001);
}
@Test
public void testCMSConcurrentModeFailureCmsAbortPreclean() throws Exception {
final ByteArrayInputStream in = new ByteArrayInputStream(
("39323.400: [GC 39323.400: [ParNew (promotion failed): 471871K->457831K(471872K), 10.5045897 secs]39333.905: [CMS CMS: abort preclean due to time 39334.591: [CMS-concurrent-abortable-preclean: 4.924/15.546 secs] [Times: user=24.45 sys=9.40, real=15.55 secs]" +
"\n (concurrent mode failure): 1301661K->1299268K(1572864K), 43.3433234 secs] 1757009K->1299268K(2044736K), [CMS Perm : 64534K->63216K(110680K)], 53.8487115 secs] [Times: user=54.83 sys=9.22, real=53.85 secs]")
.getBytes());
final DataReader reader = new DataReaderSun1_6_0(in);
GCModel model = reader.read();
assertEquals("GC count", 2, model.size());
assertEquals("gc pause", 53.8487115, model.getFullGCPause().getMax(), 0.000001);
}
@Test
public void testCMSFullGcCmsInterrupted() throws Exception {
// TODO CMS (concurrent mode interrupted) not recognised (ignored)
ByteArrayInputStream in = new ByteArrayInputStream(
"78.579: [Full GC (System) 78.579: [CMS (concurrent mode interrupted): 64171K->1538K(107776K), 0.0088356 secs] 75362K->1538K(126912K), [CMS Perm : 2554K->2554K(21248K)], 0.0089351 secs] [Times: user=0.00 sys=0.00, real=0.01 secs]"
.getBytes());
final DataReader reader = new DataReaderSun1_6_0(in);
GCModel model = reader.read();
assertEquals("count", 1, model.getPause().getN());
assertEquals("full gc pause", 0.0089351, model.getFullGCPause().getSum(), 0.00000001);
}
@Test
public void testCMSAbortingPrecleanTimestamp() throws Exception {
ByteArrayInputStream in = new ByteArrayInputStream(
" CMS: abort preclean due to time 12467.886: [CMS-concurrent-abortable-preclean: 5.300/5.338 secs] [Times: user=10.70 sys=0.13, real=5.34 secs]"
.getBytes());
final DataReader reader = new DataReaderSun1_6_0(in);
GCModel model = reader.read();
assertEquals("GC count", 1, model.size());
assertEquals("gc pause", 5.3, ((ConcurrentGCEvent) model.getConcurrentGCEvents().next()).getPause(), 0.001);
}
@Test
public void testCMSAbortingPrecleanDatestamp() throws Exception {
ByteArrayInputStream in = new ByteArrayInputStream(
" CMS: abort preclean due to time 2011-10-07T08:10:25.312+0200: 13454.979: [CMS-concurrent-abortable-preclean: 3.849/5.012 secs] [Times: user=5.58 sys=0.08, real=5.01 secs]"
.getBytes());
final DataReader reader = new DataReaderSun1_6_0(in);
GCModel model = reader.read();
assertEquals("GC count", 1, model.size());
assertEquals("gc pause", 3.849, ((ConcurrentGCEvent) model.getConcurrentGCEvents().next()).getPause(), 0.0001);
}
@Test
public void testFullGcIncrementalTimestamp() throws Exception {
ByteArrayInputStream in = new ByteArrayInputStream(
("42927.215: [Full GC 42927.215: [CMS42927.255: [CMS-concurrent-sweep: 0.416/6.288 secs] [Times: user=17.38 sys=0.44, real=6.29 secs]"
+ "\n (concurrent mode failure): 262166K->215967K(785256K), 7.8308614 secs] 273998K->215967K(800040K), [CMS Perm : 523009K->155678K(524288K)] icms_dc=8 , 7.8320634 secs] [Times: user=4.59 sys=0.04, real=7.83 secs]")
.getBytes());
final DataReader reader = new DataReaderSun1_6_0(in);
GCModel model = reader.read();
assertEquals("GC count", 2, model.size());
assertEquals("full gc pause", 7.8320634, model.getFullGCPause().getSum(), 0.00000001);
}
@Test
public void testFullGcIncrementalTimestamp2() throws Exception {
ByteArrayInputStream in = new ByteArrayInputStream(
("44189.823: [Full GC 44189.824: [CMS: 274825K->223922K(892264K), 8.0594203 secs] 327565K->223922K(992616K), [CMS Perm : 524287K->158591K(524288K)] icms_dc=0 , 8.0600619 secs] [Times: user=4.51 sys=0.05, real=8.06 secs]")
.getBytes());
final DataReader reader = new DataReaderSun1_6_0(in);
GCModel model = reader.read();
assertEquals("GC count", 1, model.size());
assertEquals("full gc pause", 8.0600619, model.getFullGCPause().getSum(), 0.00000001);
}
@Test
public void testCmsRemarkDatestamp() throws Exception {
ByteArrayInputStream in = new ByteArrayInputStream(
("2011-10-05T04:23:39.427+0200: 13455.879: [GC[YG occupancy: 325751 K (471872 K)]13455.879: [Rescan (parallel) , 1.0591220 secs]13456.939: [weak refs processing, 0.0794109 secs] [1 CMS-remark: 1023653K(1572864K)] 1349404K(2044736K), 1.1490033 secs] [Times: user=19.09 sys=0.26, real=1.15 secs]")
.getBytes());
final DataReader reader = new DataReaderSun1_6_0(in);
GCModel model = reader.read();
assertEquals("GC count", 1, model.size());
assertEquals("gc pause", 1.1490033, model.getGCPause().getSum(), 0.00000001);
}
@Test
public void testCmsRemarkTimestamp() throws Exception {
ByteArrayInputStream in = new ByteArrayInputStream(
("13455.879: [GC[YG occupancy: 325751 K (471872 K)]13455.879: [Rescan (parallel) , 1.0591220 secs]13456.939: [weak refs processing, 0.0794109 secs] [1 CMS-remark: 1023653K(1572864K)] 1349404K(2044736K), 1.1490033 secs] [Times: user=19.09 sys=0.26, real=1.15 secs]")
.getBytes());
final DataReader reader = new DataReaderSun1_6_0(in);
GCModel model = reader.read();
assertEquals("GC count", 1, model.size());
assertEquals("gc pause", 1.1490033, model.getGCPause().getSum(), 0.00000001);
}
@Test
public void testCmsRemarkSerial() throws Exception {
ByteArrayInputStream in = new ByteArrayInputStream(
("0.778: [GC[YG occupancy: 2179 K (19136 K)]0.778: [Rescan (non-parallel) 0.778: [grey object rescan, 0.0014243 secs]0.780: [root rescan, 0.0000909 secs], 0.0015484 secs]0.780: [weak refs processing, 0.0000066 secs] [1 CMS-remark: 444198K(444416K)] 446377K(463552K), 0.0015882 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]")
.getBytes());
final DataReader reader = new DataReaderSun1_6_0(in);
GCModel model = reader.read();
assertEquals("GC count", 1, model.size());
assertEquals("gc pause", 0.0015882, model.getGCPause().getSum(), 0.00000001);
}
@Test
public void testFullGcIncrementalDatestamp() throws Exception {
ByteArrayInputStream in = new ByteArrayInputStream(
("2011-10-05T04:23:39.427+0200: 42927.215: [Full GC 42927.215: [CMS2011-10-05T04:23:39.427+0200: 42927.255: [CMS-concurrent-sweep: 0.416/6.288 secs] [Times: user=17.38 sys=0.44, real=6.29 secs]"
+ "\n (concurrent mode failure): 262166K->215967K(785256K), 7.8308614 secs] 273998K->215967K(800040K), [CMS Perm : 523009K->155678K(524288K)] icms_dc=8 , 7.8320634 secs] [Times: user=4.59 sys=0.04, real=7.83 secs]")
.getBytes());
final DataReader reader = new DataReaderSun1_6_0(in);
GCModel model = reader.read();
assertEquals("GC count", 2, model.size());
assertEquals("full gc pause", 7.8320634, model.getFullGCPause().getSum(), 0.00000001);
}
@Test
public void testFullGcIncrementalDatestamp2() throws Exception {
ByteArrayInputStream in = new ByteArrayInputStream(
("2011-10-05T04:23:39.427+0200: 44189.823: [Full GC 44189.824: [CMS: 274825K->223922K(892264K), 8.0594203 secs] 327565K->223922K(992616K), [CMS Perm : 524287K->158591K(524288K)] icms_dc=0 , 8.0600619 secs] [Times: user=4.51 sys=0.05, real=8.06 secs]")
.getBytes());
final DataReader reader = new DataReaderSun1_6_0(in);
GCModel model = reader.read();
assertEquals("GC count", 1, model.size());
assertEquals("full gc pause", 8.0600619, model.getFullGCPause().getSum(), 0.00000001);
}
@Test
public void testMixedLineTimestamp() throws Exception {
ByteArrayInputStream in = new ByteArrayInputStream(
("36628.590: [GC 36628.591: [ParNew36628.625: [CMS-concurrent-abortable-preclean: 0.128/0.873 secs] [Times: user=2.52 sys=0.02, real=0.87 secs]"
+ "\n: 14780K->1041K(14784K), 0.0417590 secs] 304001K->295707K(721240K) icms_dc=56 , 0.0419761 secs] [Times: user=0.81 sys=0.01, real=0.04 secs]")
.getBytes());
final DataReader reader = new DataReaderSun1_6_0(in);
GCModel model = reader.read();
assertEquals("GC count", 2, model.size());
assertEquals("gc pause", 0.0419761, model.getGCPause().getSum(), 0.00000001);
}
@Test
public void testFullGcSystem() throws Exception {
ByteArrayInputStream in = new ByteArrayInputStream(
("164.078: [Full GC (System) 164.078: [Tenured: 107024K->86010K(349568K), 0.7964528 secs] 143983K->86010K(506816K), [Perm : 85883K->85855K(86016K)], 0.7965714 secs] [Times: user=0.84 sys=0.00, real=0.80 secs]")
.getBytes());
final DataReader reader = new DataReaderSun1_6_0(in);
GCModel model = reader.read();
assertEquals("GC count", 1, model.size());
assertEquals("full gc pause", 0.7965714, model.getFullGCPause().getSum(), 0.00000001);
}
@Test
public void testCmsConcurrentMarkStart() throws Exception {
ByteArrayInputStream in = new ByteArrayInputStream(
("2011-10-24T08:12:24.375+0200: 3388.929: [CMS-concurrent-mark-start]")
.getBytes());
final DataReader reader = new DataReaderSun1_6_0(in);
GCModel model = reader.read();
assertEquals("GC count", 1, model.size());
assertEquals("full gc pause", 0.0, model.getFullGCPause().getSum(), 0.01);
}
@Test
public void testCmsInitiatingOccupancyFraction() throws Exception {
ByteArrayInputStream in = new ByteArrayInputStream(
("12460.657: [GC [1 CMS-initial-mark: 789976K(1572864K)] 838178K(2044736K), 0.3114519 secs] [Times: user=0.32 sys=0.00, real=0.31 secs]")
.getBytes());
final DataReader reader = new DataReaderSun1_6_0(in);
GCModel model = reader.read();
assertEquals("GC count", 1, model.size());
assertEquals("iof", 0.5022532145182292, model.getCmsInitiatingOccupancyFraction().average(), 0.0000001);
}
@Test
public void testMixedLineWithEmptyLine() throws Exception {
ByteArrayInputStream in = new ByteArrayInputStream(
("2011-01-25T17:10:16.889+0100: 12076.859: [GC 12076.859: [ParNew2011-01-25T17:10:16.896+0100: 12076.866: [CMS-concurrent-abortable-preclean: 0.929/4.899 secs] [Times: user=2.13 sys=0.04, real=4.90 secs]" +
"\n" +
"\nDesired survivor size 720896 bytes, new threshold 1 (max 4)" +
"\n- age 1: 1058016 bytes, 1058016 total" +
"\n: 13056K->1408K(13056K), 0.0128277 secs] 131480K->122757K(141328K), 0.0131346 secs] [Times: user=0.15 sys=0.00, real=0.01 secs]")
.getBytes());
final DataReader reader = new DataReaderSun1_6_0(in);
GCModel model = reader.read();
assertEquals("GC count", 2, model.size());
assertEquals("event pause", 0.0131346, model.getGCPause().getMax(), 0.0000001);
assertEquals("promotion", 2925, model.getPromotion().getMax());
}
@Test
public void testPrintTenuringDistribution() throws Exception {
ByteArrayInputStream in = new ByteArrayInputStream(
("2011-02-14T13:15:24.164+0100: 31581.748: [GC 31581.748: [ParNew" +
"\nDesired survivor size 5963776 bytes, new threshold 1 (max 4)" +
"\n- age 1: 8317928 bytes, 8317928 total" +
"\n: 92938K->8649K(104832K), 0.0527364 secs] 410416K->326127K(1036928K), 0.0533874 secs] [Times: user=0.46 sys=0.09, real=0.05 secs]")
.getBytes());
final DataReader reader = new DataReaderSun1_6_0(in);
GCModel model = reader.read();
assertEquals("GC count", 1, model.size());
assertEquals("event pause", 0.0533874, model.getGCPause().getMax(), 0.0000001);
assertEquals("promotion", 0, model.getPromotion().getMax());
}
@Test
public void testPrintTenuringDistributionPromotionFailed() throws Exception {
ByteArrayInputStream in = new ByteArrayInputStream(
("2011-02-14T13:14:36.298+0100: 31533.871: [GC 31533.871: [ParNew (promotion failed)" +
"\nDesired survivor size 524288 bytes, new threshold 1 (max 4)" +
"\n- age 1: 703560 bytes, 703560 total" +
"\n- age 2: 342056 bytes, 1045616 total" +
"\n : 9321K->9398K(9792K), 0.0563031 secs]31533.928: [CMS: 724470K->317478K(931248K), 13.5375713 secs] 733688K->317478K(941040K), [CMS Perm : 51870K->50724K(86384K)], 13.5959700 secs] [Times: user=14.03 sys=0.03, real=13.60 secs]")
.getBytes());
final DataReader reader = new DataReaderSun1_6_0(in);
GCModel model = reader.read();
assertEquals("GC count", 1, model.size());
assertEquals("event pause", 13.5959700, model.getFullGCPause().getMax(), 0.0000001);
}
@Test
public void testPrintTenuringDistributionPromotionFailedConcurrentModeFailure() throws Exception {
ByteArrayInputStream in = new ByteArrayInputStream(
("2011-04-18T12:01:14.683+0200: 27401.763: [GC 27401.763: [ParNew (promotion failed)" +
"\nDesired survivor size 557056 bytes, new threshold 1 (max 4)" +
"\n- age 1: 906712 bytes, 906712 total" +
"\n: 9768K->9877K(10240K), 0.0453585 secs]27401.808: [CMS2011-04-18T12:01:20.261+0200: 27407.340: [CMS-concurrent-sweep: 5.738/5.787 secs] [Times: user=6.40 sys=0.02, real=5.79 secs]" +
"\n (concurrent mode failure): 858756K->670276K(932096K), 31.5781426 secs] 868036K->670276K(942336K), [CMS Perm : 54962K->51858K(91608K)], 31.6248756 secs] [Times: user=31.85 sys=0.03, real=31.63 secs]")
.getBytes());
final DataReader reader = new DataReaderSun1_6_0(in);
GCModel model = reader.read();
assertEquals("GC count", 2, model.size());
assertEquals("event pause", 31.6248756, model.getFullGCPause().getMax(), 0.0000001);
}
@Test
public void testLineMixesPrintTenuringDistribution() throws Exception {
ByteArrayInputStream in = new ByteArrayInputStream(
("2011-03-31T06:01:25.675+0200: 5682.440: [GC 5682.441: [ParNew2011-03-31T06:01:25.682+0200: 5682.447: [CMS-concurrent-abortable-preclean: 0.035/0.348 secs]" +
"\nDesired survivor size 557056 bytes, new threshold 4 (max 4)" +
"\n- age 1: 1104 bytes, 1104 total" +
"\n- age 2: 52008 bytes, 53112 total" +
"\n- age 3: 4400 bytes, 57512 total" +
"\n [Times: user=0.59 sys=0.01, real=0.35 secs]" +
"\n: 9405K->84K(10368K), 0.0064674 secs] 151062K->141740K(164296K), 0.0067202 secs] [Times: user=0.11 sys=0.01, real=0.01 secs]")
.getBytes());
final DataReader reader = new DataReaderSun1_6_0(in);
GCModel model = reader.read();
assertEquals("GC count", 2, model.size());
assertEquals("event pause", 0.0067202, model.getGCPause().getMax(), 0.0000001);
}
@Test
public void testCmsMemory() throws Exception {
final InputStream in = getClass().getResourceAsStream("SampleSun1_6_0CMS.txt");
final DataReader reader = new DataReaderSun1_6_0(in);
GCModel model = reader.read();
assertEquals("GC count", 41, model.size());
assertEquals("heap min allocated", 249088, model.getHeapAllocatedSizes().getMin());
assertEquals("heap max allocated", 249088, model.getHeapAllocatedSizes().getMax());
assertEquals("young min allocated", 118016, model.getYoungAllocatedSizes().getMin());
assertEquals("young max allocated", 118016, model.getYoungAllocatedSizes().getMax());
assertEquals("tenured min allocated", 131072, model.getTenuredAllocatedSizes().getMin());
assertEquals("tenured max allocated", 131072, model.getTenuredAllocatedSizes().getMax());
assertEquals("perm min allocated", 21248, model.getPermAllocatedSizes().getMin());
assertEquals("perm max allocated", 21248, model.getPermAllocatedSizes().getMax());
assertEquals("heap min used", 80841, model.getHeapUsedSizes().getMin());
assertEquals("heap max used", 209896, model.getHeapUsedSizes().getMax());
assertEquals("young min used", 104960, model.getYoungUsedSizes().getMin());
assertEquals("young max used", 118010, model.getYoungUsedSizes().getMax());
assertEquals("tenured min used", 65665, model.getTenuredUsedSizes().getMin());
assertEquals("tenured max used", 115034, model.getTenuredUsedSizes().getMax());
assertEquals("perm min used", 2560, model.getPermUsedSizes().getMin());
assertEquals("perm max used", 2561, model.getPermUsedSizes().getMax());
assertEquals("promotion avg", 16998.3846, model.getPromotion().average(), 0.0001);
assertEquals("promotion total", 220979, model.getPromotion().getSum());
}
@Test
public void testPrintCmsStatistics() throws Exception {
// will not be able to extract sense from this line, but must not loop
ByteArrayInputStream in = new ByteArrayInputStream(
("0.521: [GC[YG occupancy: 2234 K (14784 K)]0.522: [Rescan (parallel) (Survivor:0chunks) Finished young gen rescan work in 1th thread: 0.000 sec")
.getBytes());
final DataReader reader = new DataReaderSun1_6_0(in);
GCModel model = reader.read();
assertEquals("GC count", 0, model.size());
}
@Test
public void testPrintHeapAtGC() throws Exception {
TestLogHandler handler = new TestLogHandler();
handler.setLevel(Level.WARNING);
IMP_LOGGER.addHandler(handler);
DATA_READER_FACTORY_LOGGER.addHandler(handler);
final InputStream in = getClass().getResourceAsStream("SampleSun1_6_0PrintHeapAtGC.txt");
final DataReader reader = new DataReaderSun1_6_0(in);
GCModel model = reader.read();
assertEquals("GC count", 2, model.size());
assertEquals("GC pause", 0.0134287, model.getGCPause().getMin(), 0.000000001);
assertEquals("number of errors", 0, handler.getCount());
}
@Test
public void testAdaptiveSizePolicy() throws Exception {
// 0.175: [GCAdaptiveSizePolicy::compute_survivor_space_size_and_thresh: survived: 2721008 promoted: 13580768 overflow: trueAdaptiveSizeStart: 0.186 collection: 1
// PSAdaptiveSizePolicy::compute_generation_free_space: costs minor_time: 0.059538 major_cost: 0.000000 mutator_cost: 0.940462 throughput_goal: 0.990000 live_space: 273821824 free_space: 33685504 old_promo_size: 16842752 old_eden_size: 16842752 desired_promo_size: 16842752 desired_eden_size: 33685504
// AdaptiveSizePolicy::survivor space sizes: collection: 1 (2752512, 2752512) -> (2752512, 2752512)
// AdaptiveSizeStop: collection: 1
// [PSYoungGen: 16420K->2657K(19136K)] 16420K->15919K(62848K), 0.0109211 secs] [Times: user=0.00 sys=0.00, real=0.01 secs]
final InputStream in = getClass().getResourceAsStream("SampleSun1_6_0AdaptiveSizePolicy.txt");
final DataReader reader = new DataReaderSun1_6_0(in);
GCModel model = reader.read();
assertEquals("GC count", 10, model.size());
assertEquals("GC pause", 0.0224480, model.getGCPause().getMax(), 0.00000001);
assertEquals("Full GC pause", 0.0204436, model.getFullGCPause().getMax(), 0.00000001);
}
@Test
public void testAdaptiveSizePolicyFullSystemGc() throws Exception {
// 0.175: [GCAdaptiveSizePolicy::compute_survivor_space_size_and_thresh: survived: 2721008 promoted: 13580768 overflow: trueAdaptiveSizeStart: 0.186 collection: 1
// PSAdaptiveSizePolicy::compute_generation_free_space: costs minor_time: 0.059538 major_cost: 0.000000 mutator_cost: 0.940462 throughput_goal: 0.990000 live_space: 273821824 free_space: 33685504 old_promo_size: 16842752 old_eden_size: 16842752 desired_promo_size: 16842752 desired_eden_size: 33685504
// AdaptiveSizePolicy::survivor space sizes: collection: 1 (2752512, 2752512) -> (2752512, 2752512)
// AdaptiveSizeStop: collection: 1
// [PSYoungGen: 16420K->2657K(19136K)] 16420K->15919K(62848K), 0.0109211 secs] [Times: user=0.00 sys=0.00, real=0.01 secs]
ByteArrayInputStream in = new ByteArrayInputStream(
("2012-03-21T20:49:09.624+0100: 9.993: [Full GC (System)AdaptiveSizeStart: 10.000 collection: 61" +
"\nAdaptiveSizeStop: collection: 61" +
"\n[PSYoungGen: 480K->0K(270976K)] [PSOldGen: 89711K->671K(145536K)] 90191K->671K(416512K) [PSPermGen: 2614K->2614K(21248K)], 0.0070749 secs] [Times: user=0.02 sys=0.00, real=0.01 secs]")
.getBytes());
final DataReader reader = new DataReaderSun1_6_0(in);
GCModel model = reader.read();
assertEquals("GC count", 1, model.size());
assertEquals("Full GC pause", 0.0070749, model.getFullGCPause().getMax(), 0.00000001);
}
@Test
public void testCMSScavengeBeforeRemarkTimeStamp() throws Exception {
ByteArrayInputStream in = new ByteArrayInputStream(
("2.036: [GC[YG occupancy: 235954 K (235968 K)]2.036: [GC 2.036: [ParNew: 235954K->30K(235968K), 0.0004961 secs] 317153K->81260K(395712K), 0.0005481 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]" +
"\n2.037: [Rescan (parallel) , 0.0002425 secs]2.037: [weak refs processing, 0.0000041 secs]2.037: [class unloading, 0.0000938 secs]2.037: [scrub symbol & string tables, 0.0003138 secs] [1 CMS-remark: 81230K(159744K)] 81260K(395712K), 0.0013653 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]")
.getBytes());
final DataReader reader = new DataReaderSun1_6_0(in);
GCModel model = reader.read();
assertEquals("GC count", 2, model.size());
assertEquals("1st event", "GC ParNew:", model.get(0).getTypeAsString());
assertEquals("2nd event", "GC CMS-remark:", model.get(1).getTypeAsString());
}
@Test
public void testCMSScavengeBeforeRemarkDateStamp() throws Exception {
ByteArrayInputStream in = new ByteArrayInputStream(
("2012-03-07T22:19:49.110+0100: 2.479: [GC[YG occupancy: 227872 K (235968 K)]2012-03-07T22:19:49.110+0100: 2.479: [GC 2.479: [ParNew: 227872K->30K(235968K), 0.0005432 secs] 296104K->68322K(395712K), 0.0005809 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]" +
"\n2.480: [Rescan (parallel) , 0.0001934 secs]2.480: [weak refs processing, 0.0000061 secs]2.480: [class unloading, 0.0001131 secs]2.480: [scrub symbol & string tables, 0.0003175 secs] [1 CMS-remark: 68292K(159744K)] 68322K(395712K), 0.0013506 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]")
.getBytes());
final DataReader reader = new DataReaderSun1_6_0(in);
GCModel model = reader.read();
assertEquals("GC count", 2, model.size());
assertEquals("1st event", "GC ParNew:", model.get(0).getTypeAsString());
assertEquals("2nd event", "GC CMS-remark:", model.get(1).getTypeAsString());
}
@Test
public void testCMSScavengeBeforeRemarkWithPrintTenuringDistribution() throws Exception {
ByteArrayInputStream in = new ByteArrayInputStream(
("2012-03-07T22:19:48.736+0100: 2.104: [GC[YG occupancy: 235952 K (235968 K)]2012-03-07T22:19:48.736+0100: 2.104: [GC 2.104: [ParNew" +
"\nDesired survivor size 13402112 bytes, new threshold 4 (max 4)" +
"\n- age 1: 24816 bytes, 24816 total" +
"\n: 235952K->30K(235968K), 0.0005641 secs] 317151K->81260K(395712K), 0.0006030 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]" +
"\n2.105: [Rescan (parallel) , 0.0002003 secs]2.105: [weak refs processing, 0.0000041 secs]2.105: [class unloading, 0.0000946 secs]2.105: [scrub symbol & string tables, 0.0003146 secs] [1 CMS-remark: 81230K(159744K)] 81260K(395712K), 0.0013199 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]")
.getBytes());
final DataReader reader = new DataReaderSun1_6_0(in);
GCModel model = reader.read();
assertEquals("GC count", 2, model.size());
assertEquals("1st event", "GC ParNew:", model.get(0).getTypeAsString());
assertEquals("1st event pause", 0.0006030, ((GCEvent)model.get(0)).getPause(), 0.00000001);
assertEquals("2nd event", "GC CMS-remark:", model.get(1).getTypeAsString());
assertEquals("2nd event pause", 0.0013199, ((GCEvent)model.get(1)).getPause(), 0.00000001);
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
98ea28894748847485e574222c7e86f4b876490a | ddba2334739a8bd3bf4e2e713196ee724b249255 | /src/org/exmaralda/partitureditor/partiture/menus/PartiturMenuBar.java | 110080197438ab177e34e72642d41f7933ede267 | [] | no_license | Herrner/EXMARaLDA | f03e6950ee616fb3a22a794bf035abae12baa319 | 423ae15acad26a2e43025a2bae782adbdaed3ba1 | refs/heads/master | 2022-07-09T17:58:34.622283 | 2022-06-28T14:50:59 | 2022-06-28T14:50:59 | 5,190,149 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,146 | java | /*
* PartiturMenuBar.java
*
* Created on 9. Maerz 2004, 09:31
*/
package org.exmaralda.partitureditor.partiture.menus;
import javax.swing.*;
import org.exmaralda.partitureditor.partiture.*;
/**
*
* @author thomas
*/
public class PartiturMenuBar extends javax.swing.JMenuBar {
/** the file menu */
public FileMenu fileMenu;
/** the edit menu */
public EditMenu editMenu;
/** the view menu */
public ViewMenu viewMenu;
/** the transcription menu */
public TranscriptionMenu transcriptionMenu;
/** the tier menu */
public TierMenu tierMenu;
/** the event menu */
public EventMenu eventMenu;
/** the timeline menu */
public TimelineMenu timelineMenu;
/** the format menu */
public FormatMenu formatMenu;
/** the segmentation menu */
//public SegmentationMenu segmentationMenu;
public CLARINMenu clarinMenu;
/** project specific menus */
public SFB538Menu sfb538Menu;
public SinMenu sinMenu;
public ODTSTDMenu odtstdMenu;
/** Creates a new instance of PartiturMenuBar */
public PartiturMenuBar(PartitureTableWithActions table) {
fileMenu = new FileMenu(table);
editMenu = new EditMenu(table);
viewMenu = new ViewMenu(table);
transcriptionMenu = new TranscriptionMenu(table);
tierMenu = new TierMenu(table);
eventMenu = new EventMenu(table);
timelineMenu = new TimelineMenu(table);
formatMenu = new FormatMenu(table);
//segmentationMenu = new SegmentationMenu(table);
clarinMenu = new CLARINMenu(table);
sfb538Menu = new SFB538Menu(table);
sinMenu = new SinMenu(table);
odtstdMenu = new ODTSTDMenu(table);
add(fileMenu);
add(editMenu);
add(viewMenu);
add(transcriptionMenu);
add(tierMenu);
add(eventMenu);
add(timelineMenu);
add(formatMenu);
add(clarinMenu);
//add(segmentationMenu);
add(sfb538Menu);
add(sinMenu);
add(odtstdMenu);
}
}
| [
"herrner@gmail.com"
] | herrner@gmail.com |
fd69856c8712da9c1e6dcb8dcd3c0d91d63f19d4 | 7f5c09ad10c5c3571d9cc22da2b702761174e6ae | /src/main/java/com/reto5/view/Vista.java | f7f9c3ca2105bf5ce1ba52cf5ca2451100a3360f | [] | no_license | LineerJRE/reto_5 | afd9cb8a2dbbf5996f5da5cda53e9e7b364e6581 | 32b29729125b393ab8ecfc98df8283e03723c86f | refs/heads/main | 2023-07-07T17:42:57.403357 | 2021-08-20T23:04:51 | 2021-08-20T23:04:51 | 398,414,154 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,078 | java | package com.reto5.view;
import com.reto5.controller.*;
import com.reto5.model.Vo.*;
import java.sql.SQLException;
import java.util.ArrayList;
public class Vista {
public static final Controlador controlador = new Controlador();
public void consulta1(String titles[], Object data[][]) {
try {
ArrayList<Consulta1Vo> lista = controlador.realizarConsulta1();
// Encabezado del resultado
titles[0] = "ID Proyecto";
titles[1] = "Fecha Inicio";
titles[2] = "Banco Vinculado";
titles[3] = "Serial";
// Cada VO cargado, mostrarlo en la vista
Integer contador = 0;
for (Object object : data) {
data[contador] = new Object[] { lista.get(contador).getId(), lista.get(contador).getFechaInicio(),
lista.get(contador).getBancoVinculado(), lista.get(contador).getSerial() };
contador++;
}
} catch (SQLException e) {
System.err.println("Ha ocurrido un error!" + e.getMessage());
}
}
public void consulta2(String titles[], Object data[][]) {
try {
ArrayList<Consulta2Vo> lista = controlador.realizarConsulta2();
// Encabezado del resultado
titles[0] = "Nombre";
titles[1] = "Salario";
titles[2] = "Deducible";
titles[3] = "Apellidos";
// Cada VO cargado, mostrarlo en la vista
Integer contador = 0;
for (Object object : data) {
String primerApellido = lista.get(contador).getPrimerApellido();
String segundoApellido = lista.get(contador).getPrimerApellido();
String cocatenado = primerApellido + "-" + segundoApellido;
Double deducible = lista.get(contador).getSalario() * 0.08;
data[contador] = new Object[] { lista.get(contador).getNombre(), lista.get(contador).getSalario(),
deducible, cocatenado };
contador++;
}
} catch (SQLException e) {
System.err.println("Ha ocurrido un error!" + e.getMessage());
}
}
public void consulta3(String titles[], Object data[][]) {
try {
ArrayList<Consulta3Vo> lista = controlador.realizarConsulta3();
// Encabezado del resultado
titles[0] = "ID Proyecto";
titles[1] = "Nom Ape";
// Cada VO cargado, mostrarlo en la vista
Integer contador = 0;
for (Object object : data) {
String nombre = lista.get(contador).getNombre();
String apellido = lista.get(contador).getPrimerApellido();
String cocatenado = nombre + " " + apellido;
data[contador] = new Object[] { lista.get(contador).getId(), cocatenado };
contador++;
}
} catch (SQLException e) {
System.err.println("Ha ocurrido un error!" + e.getMessage());
}
}
}
| [
"87033607+LineerJRE@users.noreply.github.com"
] | 87033607+LineerJRE@users.noreply.github.com |
06ae3246dfd6eacbf5e1aee93dc3e4331086df97 | ecb4330035991967a8308318683f273d06a7d8e3 | /document/OOP/SamplesLecture2/SamplesLecture2/src/com/epam/cdp/cnta2016/module4/lecture2/saples/collections/HashSetDemo.java | aa40e7b51e6249d857e02a24818dd91fe2b18915 | [] | no_license | tomfanxiaojun/automation-test | 9ffa69ff60668a66618080068ea6ed9bb9c18269 | 9324454ff662e9f34ef03dc737ebb3e85cc83393 | refs/heads/master | 2021-01-11T06:35:54.227762 | 2017-01-09T07:13:11 | 2017-01-09T07:13:11 | 71,863,016 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 593 | java | package com.epam.cdp.cnta2016.module4.lecture2.saples.collections;
import java.util.HashSet;
public class HashSetDemo {
public static void main(String[] args) {
// HashSet declaration
HashSet<String> hset = new HashSet<String>();
// Adding elements to the HashSet
hset.add("Apple");
hset.add("Mango");
hset.add("Grapes");
hset.add("Orange");
hset.add("Fig");
// Addition of duplicate elements
hset.add("Apple");
hset.add("Mango");
// Addition of null values
hset.add(null);
hset.add(null);
// Displaying HashSet elements
System.out.println(hset);
}
}
| [
"ivan_fan@epam.com"
] | ivan_fan@epam.com |
bd63d8e98fbf5f4465ff70ae849cb604ae18c709 | f37f2f5ecd0da1a632fc95b86f710bac2d03a2f7 | /src/main/java/vmd/TPoVmd.java | d64a7b16fc5fcf178787f4e38bf98e97f8b3c3cb | [] | no_license | asidosibuea/purchase-order | 72b81d39ac93a96fe44f16f868d602b3cf81a55c | b7b76fae3201f8a687cc22cd5765c77fa69528eb | refs/heads/master | 2022-12-20T21:04:22.002712 | 2019-10-07T18:03:47 | 2019-10-07T18:03:47 | 213,420,735 | 0 | 0 | null | 2022-12-16T03:47:28 | 2019-10-07T15:32:38 | Java | UTF-8 | Java | false | false | 2,970 | java | package vmd;
import java.util.List;
import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.Init;
import org.zkoss.bind.annotation.NotifyChange;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.Sessions;
import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.select.annotation.VariableResolver;
import org.zkoss.zk.ui.select.annotation.WireVariable;
import org.zkoss.zk.ui.util.Clients;
import org.zkoss.zkplus.spring.DelegatingVariableResolver;
import org.zkoss.zul.Messagebox;
import org.zkoss.zul.Messagebox.Button;
import org.zkoss.zul.Messagebox.ClickEvent;
import dto.TPoDto;
import service.TPoSvc;
@VariableResolver(DelegatingVariableResolver.class)
public class TPoVmd {
@WireVariable
private TPoSvc tPoSvc;
private List<TPoDto> listPO;
private TPoDto poDto;
private String pencarian;
public List<TPoDto> getListPO() {
return listPO;
}
public void setListPO(List<TPoDto> listPO) {
this.listPO = listPO;
}
public TPoDto getPoDto() {
return poDto;
}
public void setPoDto(TPoDto poDto) {
this.poDto = poDto;
}
public String getPencarian() {
return pencarian;
}
public void setPencarian(String pencarian) {
this.pencarian = pencarian;
}
@Init
public void loadDataPO(){
this.listPO = tPoSvc.findAllTPo();
}
@NotifyChange("listPO")
@Command
public void cari() {
listPO = tPoSvc.findAllTPoBySearch(this.pencarian);
}
@Command
public void tambah(){
this.poDto = new TPoDto();
Executions.sendRedirect("/page/PO_process.zul");
}
@Command
public void edit(){
if(this.poDto==null){
Messagebox.show("Silahkan Pilih Data");
}else{
Sessions.getCurrent().setAttribute("editSession", this.poDto);
Executions.sendRedirect("/page/PO_process.zul");
}
}
@Command
public void hapus(){
if (this.poDto==null){
Messagebox.show("Silahkan Pilih Data");
}else{
Messagebox.show(String.format("Apakah anda yakin ingin menghapus order dengan ID : %s?", this.poDto.getPoNo()),
"Peringatan",
new Button[] { Button.YES, Button.NO },
Messagebox.QUESTION, Button.NO,
new EventListener<Messagebox.ClickEvent>() {
@Override
public void onEvent(ClickEvent event)
throws Exception {
// TODO Auto-generated method stub
if (Messagebox.ON_YES.equals(event.getName())) {
tPoSvc.delete(poDto);
Executions.sendRedirect("/page/PO_index.zul");
Clients.showNotification(
"Data berhasil di hapus",
Clients.NOTIFICATION_TYPE_INFO, null,
null, 500);
}
}
});
}
}
}
| [
"sibuea.asido@gmail.com"
] | sibuea.asido@gmail.com |
83782ad80ff9e0209a97c66cd3c2147833328f85 | 296fb30878a25461e08c0c666838853d90e89f16 | /Uri1008.java | a99d1d93a820702c3bf8a43cf18b63e2338e3490 | [] | no_license | Annemojano/java | 518d5c3022dd75833a6e37b99b1789fb3f95baa8 | f5e43be7880a42ae3964cb9f57ab43c8debd5ea7 | refs/heads/master | 2023-06-30T23:28:25.777855 | 2021-08-05T12:39:25 | 2021-08-05T12:39:25 | 393,033,310 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 439 | java | import java.util.Scanner;
public class Uri1008{
public static void main (String args[]){
Scanner teclado = new Scanner (System.in);
int NUMBER , horasTrab;
double vlrHora , SALARY;
NUMBER = teclado.nextInt();
horasTrab = teclado.nextInt();
vlrHora = teclado.nextDouble();
SALARY = horasTrab * vlrHora;
//saida
System.out.println ("NUMBER = " + NUMBER);
System.out.printf ("SALARY = U$ %.2f\n", SALARY);
}
}
| [
"anne.nardellimojano@gmail.com"
] | anne.nardellimojano@gmail.com |
b5bb3183e168dd0ce6c1b25d12bca596a54586fd | 9665a17dfcfedfd8140e2d23faab976b5f554577 | /seata-storage-service2002/src/main/java/com/atguigu/springcloud/alibaba/dao/StorageDao.java | 8c28df6de4aec7c46b6d07bd3ba2813fd9390a30 | [] | no_license | Tgrq-6/cloud2020 | 927ad45643196eaaee7a5b04f6ea9c6408bc5e01 | 5583a840240702e0f1b6a7d5c9d93dc3894febaa | refs/heads/master | 2023-03-11T14:19:53.775381 | 2021-02-23T11:16:53 | 2021-02-23T11:16:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 343 | java | package com.atguigu.springcloud.alibaba.dao;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @author LiHui
* @create 2021--02--21--17:45
* @date 2021/2/21--17:45
*/
@Mapper
public interface StorageDao {
void decrease(@Param("productId") Long productId,@Param("count") Integer count);
}
| [
"li@li.com"
] | li@li.com |
cbd777ae4dc6bee563a3b1a01d416270911fcb09 | 26dd074100468f51f791f093f2b29a18d2957829 | /Assessement/movingDiagonally.java | 0db907bf65f05c0f9899208d5bc463a441902691 | [] | no_license | HuydDo/codesignal | 8a649d186a6e47486424bbef4b68b48e6a91ef36 | 6021612e4f4a42a491e67c7092aba0e4fa856003 | refs/heads/master | 2022-12-07T14:01:52.555955 | 2020-08-31T20:42:31 | 2020-08-31T20:42:31 | 288,296,581 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,679 | java | /* code by mishal9 Github
https://github.com/mishal9/Coding-stuff/blob/6384eb9d641f231e60045a67e37b2501e7abf5fd/CodeSignal/movingDiagonally.java
*/
import java.util.*;
class movingDiagonally {
private static int movingDiagonally(int n, int m, int sr, int sc, int er, int ec){
String[][] grid = new String[n][m];
for(int i=0; i<grid.length; i++){
for(int j=0; j<grid[0].length; j++){
grid[i][j] = "";
}
}
int home_x = sr;
int home_y = sc;
int mall_x = er;
int mall_y = ec;
int dx = 1;
int dy = 1;
Map<int[], String> direction_mapping = new HashMap<>();
int[] d_diag = new int[]{1,1};
int[] l = new int[]{-1,1};
int[] d = new int[]{1,-1};
int[] u_diag = new int[]{-1,-1};
direction_mapping.put(d_diag,"0");
direction_mapping.put(l, "1");
direction_mapping.put(d, "2");
direction_mapping.put(u_diag, "3");
int count = 0;
while(true){
StringBuilder dirStr = new StringBuilder();
int[] dir = new int[]{dx, dy};
if(Arrays.equals(dir, d_diag))
dirStr = new StringBuilder("0");
else if(Arrays.equals(dir, l))
dirStr = new StringBuilder("1");
else if(Arrays.equals(dir, d))
dirStr = new StringBuilder("2");
else if(Arrays.equals(dir, u_diag))
dirStr = new StringBuilder("3");
grid[home_x][home_y] += dirStr.toString();
if(home_x == mall_x && home_y == mall_y)
return count;
int new_x = home_x + dx;
int new_y = home_y + dy;
count += 1;
if((new_x > n - 1 || new_x < 0) && (new_y > m-1 || new_y < 0)){
dx *= -1;
dy *= -1;
}else if((new_x > n - 1 || new_x < 0)){
dx *= -1;
}else if((new_y > m - 1 || new_y < 0)){
dy *= -1;
}else{
home_x = new_x;
home_y = new_y;
}
int[] newDir = new int[]{dx, dy};
StringBuilder newDirStr = new StringBuilder();
if(Arrays.equals(newDir, d_diag))
newDirStr = new StringBuilder("0");
else if(Arrays.equals(newDir, l))
newDirStr = new StringBuilder("1");
else if(Arrays.equals(newDir, d))
newDirStr = new StringBuilder("2");
else if(Arrays.equals(newDir, u_diag))
newDirStr = new StringBuilder("3");
if(grid[home_x][home_y].contains(newDirStr.toString()))
return -1;
}
}
public static void main(String[] args) {
System.out.println(movingDiagonally(5, 5, 1, 2, 2, 1));
System.out.println(movingDiagonally(5, 3, 2, 0, 3, 2));
System.out.println(movingDiagonally(5, 2, 0, 0, 0, 1));
System.out.println(movingDiagonally(5, 2, 0, 0, 0, 4));
System.out.println(movingDiagonally(5, 2, 1, 0, 1, 4));
}
}
| [
"huydinhdo@yahoo.com"
] | huydinhdo@yahoo.com |
8d800847b5beea7fb29ddb11bf82ef0099c20ccd | 5e8469e1845b9ddce4b9a5d00d6065438853f71b | /gaming/src/main/java/com/gempukku/gaming/rendering/postprocess/tint/color/ColorTintShader.java | 5f5e368106ea4ebd64badbac1f976367806be0ca | [] | no_license | MarcinSc/jgd-platformer | 64c0cca0fe009d481ee5e94d02716b140fda8454 | d159a0e247fd951446609250530d89c767ec8113 | refs/heads/master | 2020-04-12T09:43:53.093042 | 2016-12-22T06:36:53 | 2016-12-22T06:36:53 | 61,505,879 | 5 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,251 | java | package com.gempukku.gaming.rendering.postprocess.tint.color;
import com.badlogic.gdx.graphics.Camera;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g3d.Renderable;
import com.badlogic.gdx.graphics.g3d.shaders.DefaultShader;
import com.badlogic.gdx.graphics.g3d.utils.RenderContext;
public class ColorTintShader extends DefaultShader {
private final int u_sourceTexture = register("u_sourceTexture");
private final int u_color = register("u_color");
private final int u_factor = register("u_factor");
private int sourceTextureIndex;
private Color color;
private float factor;
public ColorTintShader(Renderable renderable, Config config) {
super(renderable, config);
}
public void setSourceTextureIndex(int sourceTextureIndex) {
this.sourceTextureIndex = sourceTextureIndex;
}
public void setColor(Color color) {
this.color = color;
}
public void setFactor(float factor) {
this.factor = factor;
}
@Override
public void begin(Camera camera, RenderContext context) {
super.begin(camera, context);
set(u_sourceTexture, sourceTextureIndex);
set(u_color, color);
set(u_factor, factor);
}
} | [
"marcins78@gmail.com"
] | marcins78@gmail.com |
aa681a1fc50cd3e684e82a3794c58048d8066a8c | 6e2158a7449efdf24240b04811e6fbe9ec420f08 | /Welcome/src/TheTwinTowers.java | cbcb251c212fb84b8f34a4a6a3b4d028f4686bb4 | [] | no_license | habibahshm/ACM-problems | eb7f0c85cfe5f3a404217b12eb4624100b2a0fd0 | f896196ff00b289511a2522ed40002ec77ab6dfb | refs/heads/master | 2023-05-13T03:53:15.704714 | 2023-05-10T06:32:41 | 2023-05-10T06:32:41 | 99,828,283 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,435 | java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;
public class TheTwinTowers {
static int[] t1;
static int[] t2;
static int[][] memo;
static int n1, n2;
static int LCS(int i, int j) {
if (i == n1 || j == n2)
return 0;
if (memo[i][j] != -1)
return memo[i][j];
if (t1[i] == t2[j])
return memo[i][j] = 1 + LCS(i + 1, j + 1);
int skip1 = LCS(i, j + 1);
int skip2 = LCS(i + 1, j);
return memo[i][j] = Math.max(skip1, skip2);
}
public static void main(String[] args) throws IOException {
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
String s;
for (int c = 1; !(s = bf.readLine()).equals("0 0"); c++) {
StringTokenizer st = new StringTokenizer(s);
n1 = Integer.parseInt(st.nextToken());
n2 = Integer.parseInt(st.nextToken());
t1 = new int[n1];
t2 = new int[n2];
st = new StringTokenizer(bf.readLine());
for (int i = 0; st.hasMoreTokens(); i++)
t1[i] = Integer.parseInt(st.nextToken());
st = new StringTokenizer(bf.readLine());
for (int i = 0; st.hasMoreTokens(); i++)
t2[i] = Integer.parseInt(st.nextToken());
memo = new int[n1][n2];
for (int i = 0; i < n1; i++)
Arrays.fill(memo[i], -1);
System.out.println("Twin Towers #" + c);
System.out.println("Number of Tiles : " + LCS(0, 0));
System.out.println();
}
}
}
| [
"habibahshm@gmail.com"
] | habibahshm@gmail.com |
3820978d0599edb2c60bfdb8506dc4c00c846bdc | fbf9bbfc665865b6cb6a19ec0b9d74fe1bec7b7d | /app/models/Xunjianxiangmu.java | 5489a499d55ebacafb38af6ba132d790924756f0 | [] | no_license | cmingxu/pda_server | bd9cd578248d7ff1c2a3cccdacc72d0db9ca6572 | 4d5d226d31633e04e7815319549134375612d8f4 | refs/heads/master | 2020-04-14T16:25:39.137676 | 2013-12-22T11:27:20 | 2013-12-22T11:27:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 680 | java | package models;
import play.db.jpa.Model;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
* Created with IntelliJ IDEA.
* User: xcm
* Date: 13-4-9
* Time: 下午8:16
* To change this template use File | Settings | File Templates.
*/
@Entity
@Table(name="巡检项目")
public class Xunjianxiangmu extends Model {
public String 巡检点id;
public String 名称;
public String 标准;
public String 说明;
public Xunjianxiangmu(String 巡检点id, String 名称, String 标准, String 说明) {
this.巡检点id = 巡检点id;
this.名称 = 名称;
this.标准 = 标准;
this.说明 = 说明;
}
} | [
"cming.xu@gmail.com"
] | cming.xu@gmail.com |
26f8a7bbe8cf11f9ff44c0bd07c53a40bdf96b5d | d325daec16105a870c0386a5b55518fb2000ac66 | /src/main/java/com/gzzhsl/pcms/vo/OverallNotificationVO.java | 836691fb0963a9354aedb5bcc234a8ca559d06f0 | [] | no_license | melodykke/pcms | d2f3f06e46fdac0aee6d475ccd6fa04c77c5aae5 | 29d942fce9e04ffde4a6ca16e84a597a9eb80bf4 | refs/heads/master | 2020-03-19T23:38:33.009075 | 2018-09-12T01:13:42 | 2018-09-12T01:13:42 | 137,012,611 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 227 | java | package com.gzzhsl.pcms.vo;
import lombok.Data;
import java.util.Map;
@Data
public class OverallNotificationVO {
private Integer allUncheckedNum;
private Map<String, String> article; // key: title value: diffTime
}
| [
"1553649937@qq.com"
] | 1553649937@qq.com |
a60a1986bf315b81b2070d2901cd7e9d91b71f7f | d58fdd61a0de45264f3327d97a00822acedcb0d0 | /Modulo3-04/src/it/itsrizzoli/ifts/geometria/TriangoloEquilatero.java | bb32997c5f73a7a87291fa8256196f39f833ecfc | [
"MIT"
] | permissive | matteolia/itsrizzoli2k17 | dcc62d3068941fce38b07372fc1beb9db074b812 | c1629fb98c29488cdcc8b3442e049181fda089ec | refs/heads/master | 2020-03-20T14:41:48.970130 | 2018-02-14T09:43:06 | 2018-02-14T09:43:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 565 | java | package it.itsrizzoli.ifts.geometria;
public class TriangoloEquilatero extends PoligonoRegolare {
float altezza;
public TriangoloEquilatero() {
super();
this.numeroLati = 3;
}
public TriangoloEquilatero(float lunghezzaLato) {
super();
this.numeroLati = 3;
this.lunghezzaLato = lunghezzaLato;
}
@Override
public boolean equals(Object altroPoligono) {
return super.equals(altroPoligono);
}
@Override
public String toString() {
return "Io sono un triangolo equilatero di lato " + lunghezzaLato;
}
}
| [
"andrea@colleoni.info"
] | andrea@colleoni.info |
370e3dd608a8ca5886c60cd92eb9a0483704f087 | ebd268c4e3a379ab04d3bbcfc87071f47b70bfc0 | /app/src/main/java/com/example/getphonedemo/PhoneUtil.java | 947a0db7171af408f44c40e978d3af4788173845 | [] | no_license | dwj710584317/yutang | 8256d421764d876bd2110193c520edd932d8dd86 | 1fc0b88f9108889e4d2610ae9b1ee91640a2d1c2 | refs/heads/master | 2021-03-08T02:08:38.941894 | 2020-03-11T13:09:21 | 2020-03-11T13:09:21 | 246,309,925 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,253 | java | package com.example.getphonedemo;
import android.content.ContentResolver;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.provider.ContactsContract;
import java.util.ArrayList;
import java.util.List;
public class PhoneUtil {
// 号码
public final static String NUM = ContactsContract.CommonDataKinds.Phone.NUMBER;
// 联系人姓名
public final static String NAME = ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME;
//上下文对象
private Context context;
//联系人提供者的uri
private Uri phoneUri = ContactsContract.CommonDataKinds.Phone.CONTENT_URI;
public PhoneUtil(Context context){
this.context = context;
}
//获取所有联系人
public List<PhoneDto> getPhone(){
List<PhoneDto> phoneDtos = new ArrayList<>();
ContentResolver cr = context.getContentResolver();
Cursor cursor = cr.query(phoneUri,new String[]{NUM,NAME},null,null,null);
while (cursor.moveToNext()){
PhoneDto phoneDto = new PhoneDto(cursor.getString(cursor.getColumnIndex(NAME)),cursor.getString(cursor.getColumnIndex(NUM)));
phoneDtos.add(phoneDto);
}
return phoneDtos;
}
}
| [
"dwj710584317@163.com"
] | dwj710584317@163.com |
c111feee7fa191550816032b49e406b9d9096cf9 | 7bc80cd12269bcee42dec21b5539a11c7f489da2 | /hibernate-eager-vs-lazy/src/com/luv2code/hibernate/demo/entity/Student.java | 1e7b1aa5e1bf5b1de23b070823e07fe14e5304e5 | [] | no_license | djoseph2017/Spring | 5444d351645b414a3c0071503996c5336d201214 | 2e3385b8e174fa2d67ad981e4332cb26ec27f5dc | refs/heads/master | 2022-01-27T09:47:08.131563 | 2019-07-21T02:45:00 | 2019-07-21T02:45:00 | 197,996,408 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,424 | java | package com.luv2code.hibernate.demo.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "student")
public class Student {
@Id
@GeneratedValue(strategy = javax.persistence.GenerationType.IDENTITY)
@Column(name = "id")
private int id;
@Column(name = "first_name")
private String firstName;
@Column(name = "last_name")
private String lastName;
@Column(name = "email")
private String email;
public Student() {
}
public Student(String firstName, String lastName, String email) {
this.firstName = firstName;
this.lastName = lastName;
this.email = email;
}
public int getId() {
return id;
}
@Override
public String toString() {
return "Student [id=" + id + ", firstName=" + firstName + ", lastName=" + lastName + ", email=" + email + "]";
}
public void setId(int 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;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
}
| [
"djoseph2017@my.fit.edu"
] | djoseph2017@my.fit.edu |
4d767eb0830a4f30cff480fd99a0515ce060dc8e | cd6914001ad30cf1b5148f4befe8eecc2ce0a15b | /lession_19_animation/src/main/java/com/skymxc/demo/lession_19_animation/practice/MainActivity.java | 955d567a0e275618b2805ce01e78b708fa6dddda | [] | no_license | skymxc/ytzl | ef1c69b691c425f8e6e4e37e3b6cc6c15d9b5d17 | c62c68466ebbb08bc3def280f68f9a18c1b29dff | refs/heads/master | 2021-06-05T20:27:54.794747 | 2016-11-16T11:05:56 | 2016-11-16T11:05:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,503 | java | package com.skymxc.demo.lession_19_animation.practice;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.CycleInterpolator;
import android.view.animation.TranslateAnimation;
import android.widget.ImageView;
import android.widget.LinearLayout;
import com.skymxc.demo.lession_19_animation.R;
/**
* Created by sky-mxc
*/
public class MainActivity extends AppCompatActivity implements View.OnClickListener{
private ImageView image;
private LinearLayout root;
private TranslateAnimation translateAnimation;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_practice_main);
image = (ImageView) findViewById(R.id.image);
root = (LinearLayout) findViewById(R.id.root);
translateAnimation = (TranslateAnimation) AnimationUtils.loadAnimation(this,R.anim.anim_p1_shake);
translateAnimation.setInterpolator(new CycleInterpolator(0.5f));
translateAnimation.setRepeatCount(2);
translateAnimation.setRepeatMode(Animation.REVERSE);
}
@Override
public void onClick(View view) {
switch (view.getId()){
case R.id.shake:
view.startAnimation(translateAnimation);
break;
case R.id.translate:
TranslateAnimation translateLeft = (TranslateAnimation) AnimationUtils.loadAnimation(this,R.anim.anim_p1_translate_l);
translateLeft.setFillAfter(true);
translateLeft.setAnimationListener(listenterV);
image.startAnimation(translateLeft);
break;
case R.id.image:
view.startAnimation(translateAnimation);
break;
}
}
private Animation.AnimationListener listenterV= new Animation.AnimationListener(){
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) image.getLayoutParams();
params.leftMargin=image.getWidth()*2;
image.setLayoutParams(params);
image.clearAnimation();
TranslateAnimation translateAnimationH = (TranslateAnimation) AnimationUtils.loadAnimation(MainActivity.this,R.anim.anim_p1_tanslate_h);
translateAnimationH.setFillAfter(true);
image.startAnimation(translateAnimationH);
translateAnimationH.setAnimationListener(listenterH);
}
@Override
public void onAnimationRepeat(Animation animation) {
}
};
private Animation.AnimationListener listenterH= new Animation.AnimationListener(){
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) image.getLayoutParams();
params.topMargin=image.getHeight()*2;
image.setLayoutParams(params);
image.clearAnimation();
}
@Override
public void onAnimationRepeat(Animation animation) {
}
};
}
| [
"164443895@qq.com"
] | 164443895@qq.com |
667535c560bfe816080e6f2d903ba90ebc92d82d | df86a98e471857e0330b129cd4b7343bf7e4e7d5 | /src/main/java/com/accelaero/aeroinventory/scheduler/payload/ScheduleResponse.java | 3c48bf915b49203762941f62cf058734dc791840 | [] | no_license | rikaz81/spring-boot-quartz-scheduler | 4da6e4594355f5ca69d8fb534aa916f2dc89241f | 5f09982f1cb72b2fe1de7e280bb50a5f6ee7bc4f | refs/heads/master | 2020-05-02T20:14:01.840403 | 2019-03-28T10:55:42 | 2019-03-28T10:55:42 | 178,184,581 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,247 | java | package com.accelaero.aeroinventory.scheduler.payload;
import com.fasterxml.jackson.annotation.JsonInclude;
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ScheduleResponse {
private boolean success;
private String jobId;
private String jobGroup;
private String message;
public ScheduleResponse(boolean success, String message) {
this.success = success;
this.message = message;
}
public ScheduleResponse(boolean success, String jobId, String jobGroup, String message) {
this.success = success;
this.jobId = jobId;
this.jobGroup = jobGroup;
this.message = message;
}
public boolean isSuccess() {
return success;
}
public void setSuccess(boolean success) {
this.success = success;
}
public String getJobId() {
return jobId;
}
public void setJobId(String jobId) {
this.jobId = jobId;
}
public String getJobGroup() {
return jobGroup;
}
public void setJobGroup(String jobGroup) {
this.jobGroup = jobGroup;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
| [
"mrikaz@accelaero.com"
] | mrikaz@accelaero.com |
5adf3383528177efabd3c467ea5566587c420f19 | 828b5327357d0fb4cb8f3b4472f392f3b8b10328 | /flink-runtime/src/main/java/org/apache/flink/runtime/state/DefaultOperatorStateBackend.java | 5009b1f5f57329eb2254b38657cc5f581b830ef5 | [
"CC-BY-3.0",
"LicenseRef-scancode-unknown-license-reference",
"Unlicense",
"ISC",
"MIT-0",
"GPL-2.0-only",
"BSD-2-Clause-Views",
"OFL-1.1",
"Apache-2.0",
"LicenseRef-scancode-jdom",
"GCC-exception-3.1",
"MPL-2.0",
"CC-PDDC",
"AGPL-3.0-only",
"MPL-2.0-no-copyleft-exception",
"LicenseRef... | permissive | Romance-Zhang/flink_tpc_ds_game | 7e82d801ebd268d2c41c8e207a994700ed7d28c7 | 8202f33bed962b35c81c641a05de548cfef6025f | refs/heads/master | 2022-11-06T13:24:44.451821 | 2019-09-27T09:22:29 | 2019-09-27T09:22:29 | 211,280,838 | 0 | 1 | Apache-2.0 | 2022-10-06T07:11:45 | 2019-09-27T09:11:11 | Java | UTF-8 | Java | false | false | 13,611 | 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.flink.runtime.state;
import org.apache.commons.io.IOUtils;
import org.apache.flink.annotation.Internal;
import org.apache.flink.api.common.ExecutionConfig;
import org.apache.flink.api.common.state.BroadcastState;
import org.apache.flink.api.common.state.ListState;
import org.apache.flink.api.common.state.ListStateDescriptor;
import org.apache.flink.api.common.state.MapStateDescriptor;
import org.apache.flink.api.common.typeutils.TypeSerializer;
import org.apache.flink.api.common.typeutils.TypeSerializerSchemaCompatibility;
import org.apache.flink.core.fs.CloseableRegistry;
import org.apache.flink.runtime.checkpoint.CheckpointOptions;
import org.apache.flink.util.Preconditions;
import org.apache.flink.util.StateMigrationException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.annotation.Nonnull;
import java.io.IOException;
import java.io.Serializable;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.RunnableFuture;
/**
* Default implementation of OperatorStateStore that provides the ability to make snapshots.
*/
@Internal
public class DefaultOperatorStateBackend implements OperatorStateBackend {
private static final Logger LOG = LoggerFactory.getLogger(DefaultOperatorStateBackend.class);
/**
* The default namespace for state in cases where no state name is provided
*/
public static final String DEFAULT_OPERATOR_STATE_NAME = "_default_";
/**
* Map for all registered operator states. Maps state name -> state
*/
private final Map<String, PartitionableListState<?>> registeredOperatorStates;
/**
* Map for all registered operator broadcast states. Maps state name -> state
*/
private final Map<String, BackendWritableBroadcastState<?, ?>> registeredBroadcastStates;
/**
* CloseableRegistry to participate in the tasks lifecycle.
*/
private final CloseableRegistry closeStreamOnCancelRegistry;
/**
* Default typeSerializer. Only used for the default operator state.
*/
private final JavaSerializer<Serializable> deprecatedDefaultJavaSerializer = new JavaSerializer<>();
/**
* The execution configuration.
*/
private final ExecutionConfig executionConfig;
/**
* Cache of already accessed states.
*
* <p>In contrast to {@link #registeredOperatorStates} which may be repopulated
* with restored state, this map is always empty at the beginning.
*
* <p>TODO this map should be moved to a base class once we have proper hierarchy for the operator state backends.
*
* @see <a href="https://issues.apache.org/jira/browse/FLINK-6849">FLINK-6849</a>
*/
private final Map<String, PartitionableListState<?>> accessedStatesByName;
private final Map<String, BackendWritableBroadcastState<?, ?>> accessedBroadcastStatesByName;
private final AbstractSnapshotStrategy<OperatorStateHandle> snapshotStrategy;
public DefaultOperatorStateBackend(
ExecutionConfig executionConfig,
CloseableRegistry closeStreamOnCancelRegistry,
Map<String, PartitionableListState<?>> registeredOperatorStates,
Map<String, BackendWritableBroadcastState<?, ?>> registeredBroadcastStates,
Map<String, PartitionableListState<?>> accessedStatesByName,
Map<String, BackendWritableBroadcastState<?, ?>> accessedBroadcastStatesByName,
AbstractSnapshotStrategy<OperatorStateHandle> snapshotStrategy) {
this.closeStreamOnCancelRegistry = closeStreamOnCancelRegistry;
this.executionConfig = executionConfig;
this.registeredOperatorStates = registeredOperatorStates;
this.registeredBroadcastStates = registeredBroadcastStates;
this.accessedStatesByName = accessedStatesByName;
this.accessedBroadcastStatesByName = accessedBroadcastStatesByName;
this.snapshotStrategy = snapshotStrategy;
}
public ExecutionConfig getExecutionConfig() {
return executionConfig;
}
@Override
public Set<String> getRegisteredStateNames() {
return registeredOperatorStates.keySet();
}
@Override
public Set<String> getRegisteredBroadcastStateNames() {
return registeredBroadcastStates.keySet();
}
@Override
public void close() throws IOException {
closeStreamOnCancelRegistry.close();
}
@Override
public void dispose() {
IOUtils.closeQuietly(closeStreamOnCancelRegistry);
registeredOperatorStates.clear();
registeredBroadcastStates.clear();
}
// -------------------------------------------------------------------------------------------
// State access methods
// -------------------------------------------------------------------------------------------
@SuppressWarnings("unchecked")
@Override
public <K, V> BroadcastState<K, V> getBroadcastState(final MapStateDescriptor<K, V> stateDescriptor) throws StateMigrationException {
Preconditions.checkNotNull(stateDescriptor);
String name = Preconditions.checkNotNull(stateDescriptor.getName());
BackendWritableBroadcastState<K, V> previous =
(BackendWritableBroadcastState<K, V>) accessedBroadcastStatesByName.get(name);
if (previous != null) {
checkStateNameAndMode(
previous.getStateMetaInfo().getName(),
name,
previous.getStateMetaInfo().getAssignmentMode(),
OperatorStateHandle.Mode.BROADCAST);
return previous;
}
stateDescriptor.initializeSerializerUnlessSet(getExecutionConfig());
TypeSerializer<K> broadcastStateKeySerializer = Preconditions.checkNotNull(stateDescriptor.getKeySerializer());
TypeSerializer<V> broadcastStateValueSerializer = Preconditions.checkNotNull(stateDescriptor.getValueSerializer());
BackendWritableBroadcastState<K, V> broadcastState =
(BackendWritableBroadcastState<K, V>) registeredBroadcastStates.get(name);
if (broadcastState == null) {
broadcastState = new HeapBroadcastState<>(
new RegisteredBroadcastStateBackendMetaInfo<>(
name,
OperatorStateHandle.Mode.BROADCAST,
broadcastStateKeySerializer,
broadcastStateValueSerializer));
registeredBroadcastStates.put(name, broadcastState);
} else {
// has restored state; check compatibility of new state access
checkStateNameAndMode(
broadcastState.getStateMetaInfo().getName(),
name,
broadcastState.getStateMetaInfo().getAssignmentMode(),
OperatorStateHandle.Mode.BROADCAST);
RegisteredBroadcastStateBackendMetaInfo<K, V> restoredBroadcastStateMetaInfo = broadcastState.getStateMetaInfo();
// check whether new serializers are incompatible
TypeSerializerSchemaCompatibility<K> keyCompatibility =
restoredBroadcastStateMetaInfo.updateKeySerializer(broadcastStateKeySerializer);
if (keyCompatibility.isIncompatible()) {
throw new StateMigrationException("The new key typeSerializer for broadcast state must not be incompatible.");
}
TypeSerializerSchemaCompatibility<V> valueCompatibility =
restoredBroadcastStateMetaInfo.updateValueSerializer(broadcastStateValueSerializer);
if (valueCompatibility.isIncompatible()) {
throw new StateMigrationException("The new value typeSerializer for broadcast state must not be incompatible.");
}
broadcastState.setStateMetaInfo(restoredBroadcastStateMetaInfo);
}
accessedBroadcastStatesByName.put(name, broadcastState);
return broadcastState;
}
@Override
public <S> ListState<S> getListState(ListStateDescriptor<S> stateDescriptor) throws Exception {
return getListState(stateDescriptor, OperatorStateHandle.Mode.SPLIT_DISTRIBUTE);
}
@Override
public <S> ListState<S> getUnionListState(ListStateDescriptor<S> stateDescriptor) throws Exception {
return getListState(stateDescriptor, OperatorStateHandle.Mode.UNION);
}
// -------------------------------------------------------------------------------------------
// Deprecated state access methods
// -------------------------------------------------------------------------------------------
/**
* @deprecated This was deprecated as part of a refinement to the function names.
* Please use {@link #getListState(ListStateDescriptor)} instead.
*/
@Deprecated
@Override
public <S> ListState<S> getOperatorState(ListStateDescriptor<S> stateDescriptor) throws Exception {
return getListState(stateDescriptor);
}
/**
* @deprecated Using Java serialization for persisting state is not encouraged.
* Please use {@link #getListState(ListStateDescriptor)} instead.
*/
@SuppressWarnings("unchecked")
@Deprecated
@Override
public <T extends Serializable> ListState<T> getSerializableListState(String stateName) throws Exception {
return (ListState<T>) getListState(new ListStateDescriptor<>(stateName, deprecatedDefaultJavaSerializer));
}
// -------------------------------------------------------------------------------------------
// Snapshot
// -------------------------------------------------------------------------------------------
@Nonnull
@Override
public RunnableFuture<SnapshotResult<OperatorStateHandle>> snapshot(
long checkpointId,
long timestamp,
@Nonnull CheckpointStreamFactory streamFactory,
@Nonnull CheckpointOptions checkpointOptions) throws Exception {
long syncStartTime = System.currentTimeMillis();
RunnableFuture<SnapshotResult<OperatorStateHandle>> snapshotRunner =
snapshotStrategy.snapshot(checkpointId, timestamp, streamFactory, checkpointOptions);
snapshotStrategy.logSyncCompleted(streamFactory, syncStartTime);
return snapshotRunner;
}
private <S> ListState<S> getListState(
ListStateDescriptor<S> stateDescriptor,
OperatorStateHandle.Mode mode) throws StateMigrationException {
Preconditions.checkNotNull(stateDescriptor);
String name = Preconditions.checkNotNull(stateDescriptor.getName());
@SuppressWarnings("unchecked")
PartitionableListState<S> previous = (PartitionableListState<S>) accessedStatesByName.get(name);
if (previous != null) {
checkStateNameAndMode(
previous.getStateMetaInfo().getName(),
name,
previous.getStateMetaInfo().getAssignmentMode(),
mode);
return previous;
}
// end up here if its the first time access after execution for the
// provided state name; check compatibility of restored state, if any
// TODO with eager registration in place, these checks should be moved to restore()
stateDescriptor.initializeSerializerUnlessSet(getExecutionConfig());
TypeSerializer<S> partitionStateSerializer = Preconditions.checkNotNull(stateDescriptor.getElementSerializer());
@SuppressWarnings("unchecked")
PartitionableListState<S> partitionableListState = (PartitionableListState<S>) registeredOperatorStates.get(name);
if (null == partitionableListState) {
// no restored state for the state name; simply create new state holder
partitionableListState = new PartitionableListState<>(
new RegisteredOperatorStateBackendMetaInfo<>(
name,
partitionStateSerializer,
mode));
registeredOperatorStates.put(name, partitionableListState);
} else {
// has restored state; check compatibility of new state access
checkStateNameAndMode(
partitionableListState.getStateMetaInfo().getName(),
name,
partitionableListState.getStateMetaInfo().getAssignmentMode(),
mode);
RegisteredOperatorStateBackendMetaInfo<S> restoredPartitionableListStateMetaInfo =
partitionableListState.getStateMetaInfo();
// check compatibility to determine if new serializers are incompatible
TypeSerializer<S> newPartitionStateSerializer = partitionStateSerializer.duplicate();
TypeSerializerSchemaCompatibility<S> stateCompatibility =
restoredPartitionableListStateMetaInfo.updatePartitionStateSerializer(newPartitionStateSerializer);
if (stateCompatibility.isIncompatible()) {
throw new StateMigrationException("The new state typeSerializer for operator state must not be incompatible.");
}
partitionableListState.setStateMetaInfo(restoredPartitionableListStateMetaInfo);
}
accessedStatesByName.put(name, partitionableListState);
return partitionableListState;
}
private static void checkStateNameAndMode(
String actualName,
String expectedName,
OperatorStateHandle.Mode actualMode,
OperatorStateHandle.Mode expectedMode) {
Preconditions.checkState(
actualName.equals(expectedName),
"Incompatible state names. " +
"Was [" + actualName + "], " +
"registered with [" + expectedName + "].");
Preconditions.checkState(
actualMode.equals(expectedMode),
"Incompatible state assignment modes. " +
"Was [" + actualMode + "], " +
"registered with [" + expectedMode + "].");
}
}
| [
"1003761104@qq.com"
] | 1003761104@qq.com |
476123bac940f683fa557e7f6fe0fdc61cf4a91f | c1ee63c4913316f368ad3a47ff101e768aa36d24 | /app/src/main/java/com/juny/cashiersystem/business/formstab/presenter/FormsPresenter.java | 19815c4ba3967ca4be6eb9d429f05f172d29d98e | [
"Apache-2.0"
] | permissive | Juny4541/Cashier | ac8895c9aa6abbc32e09b266f315e3fbbd7274fd | db7ea595bd206b70d328908e3d57d02a04ca170a | refs/heads/master | 2020-03-13T20:42:38.302497 | 2018-05-28T18:54:58 | 2018-05-28T18:54:58 | 131,280,403 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 438 | java | package com.juny.cashiersystem.business.formstab.presenter;
import com.juny.cashiersystem.base.BasePresenter;
import com.juny.cashiersystem.business.formstab.contract.IFormsContract;
/**
* <br> ClassName: FormsPresenter
* <br> Description:
* <br>
* <br> Author: chenrunfang
* <br> Date: 2018/4/11 16:35
*/
public class FormsPresenter extends BasePresenter<IFormsContract.IView>
implements IFormsContract.IPresenter {
}
| [
"1107674541@qq.com"
] | 1107674541@qq.com |
e95f89a5a353755f638b1a42ad64bbfd452a5b21 | e7ee311e20b40c87bf6d23a53a1d7b11fd29d2c3 | /src/chosun/ciis/fc/acct/dm/FC_ACCT_5600_MDM.java | 20432fd9a116208fca386e52a602a4659c09f355 | [] | no_license | nosmoon/misdevteam | 4e3695ef7bbdcd231bb84d7d8d7df54a23ff0a60 | 1829d5bd489eb6dd307ca244f0e183a31a1de773 | refs/heads/master | 2020-04-15T15:57:05.480056 | 2019-01-10T01:12:01 | 2019-01-10T01:12:01 | 164,812,547 | 1 | 0 | null | null | null | null | UHC | Java | false | false | 3,439 | java | /***************************************************************************************************
* 파일명 : .java
* 기능 : 독자우대-구독신청
* 작성일자 : 2007-05-22
* 작성자 : 김대섭
***************************************************************************************************/
/***************************************************************************************************
* 수정내역 :
* 수정자 :
* 수정일자 :
* 백업 :
***************************************************************************************************/
package chosun.ciis.fc.acct.dm;
import java.sql.*;
import oracle.jdbc.driver.*;
import somo.framework.db.*;
import somo.framework.util.*;
import chosun.ciis.fc.acct.ds.*;
import chosun.ciis.fc.acct.rec.*;
/**
*
*/
public class FC_ACCT_5600_MDM extends somo.framework.db.BaseDM implements java.io.Serializable{
public String cmpy_cd;
public FC_ACCT_5600_MDM(){}
public FC_ACCT_5600_MDM(String cmpy_cd){
this.cmpy_cd = cmpy_cd;
}
public void setCmpy_cd(String cmpy_cd){
this.cmpy_cd = cmpy_cd;
}
public String getCmpy_cd(){
return this.cmpy_cd;
}
public String getSQL(){
return "{ call MISFNC.SP_FC_ACCT_5600_M(? ,? ,? ,?) }";
}
public void setParams(CallableStatement cstmt, BaseDM bdm) throws SQLException{
FC_ACCT_5600_MDM dm = (FC_ACCT_5600_MDM)bdm;
cstmt.registerOutParameter(1, Types.VARCHAR);
cstmt.registerOutParameter(2, Types.VARCHAR);
cstmt.setString(3, dm.cmpy_cd);
cstmt.registerOutParameter(4, OracleTypes.CURSOR);
}
public BaseDataSet createDataSetObject(){
return new chosun.ciis.fc.acct.ds.FC_ACCT_5600_MDataSet();
}
public void print(){
System.out.println("SQL = " + this.getSQL());
System.out.println("cmpy_cd = [" + getCmpy_cd() + "]");
}
}
/*----------------------------------------------------------------------------------------------------
Web Tier에서 req.getParameter() 처리 및 결과확인 검사시 사용하십시오.
String cmpy_cd = req.getParameter("cmpy_cd");
if( cmpy_cd == null){
System.out.println(this.toString+" : cmpy_cd is null" );
}else{
System.out.println(this.toString+" : cmpy_cd is "+cmpy_cd );
}
----------------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------------
Web Tier에서 req.getParameter() 처리시 사용하십시오.
String cmpy_cd = Util.checkString(req.getParameter("cmpy_cd"));
----------------------------------------------------------------------------------------------------*//*----------------------------------------------------------------------------------------------------
Web Tier에서 한글처리와 동시에 req.getParameter() 처리시 사용하십시오.
String cmpy_cd = Util.Uni2Ksc(Util.checkString(req.getParameter("cmpy_cd")));
----------------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------------
Web Tier에서 DM 파일의 변수를 설정시 사용하십시오.
dm.setCmpy_cd(cmpy_cd);
----------------------------------------------------------------------------------------------------*/
/* 작성시간 : Tue Jun 23 11:30:12 KST 2009 */ | [
"DLCOM000@172.16.30.11"
] | DLCOM000@172.16.30.11 |
80eb7cc3b34ad40171583b4ddf43df2e9cd2a37d | 30e1f156de8fc15a1f7f647b8508b610a04f84cb | /src/com/shariful/jul18/thiskeyword/TestThisDemo2.java | 0ea0b0503882af1306cdb91779869f58540ffa4c | [] | no_license | sharifulislam21/corejavapractice | a7b613580ce0fe071da32deb56d92157863b402b | e9abbec00dbe1b72fd1125bc0fc4196a567327fe | refs/heads/master | 2020-03-28T03:26:24.427123 | 2019-01-25T09:18:33 | 2019-01-25T09:18:33 | 147,645,465 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 565 | java | package com.shariful.jul18.thiskeyword;
public class TestThisDemo2 {
int a, b;
TestThisDemo2() {
System.out.println("Default Const");
}
TestThisDemo2(int a, int b){
// We can use this keyword in constructor overloading
// To call one constructor from another we need this();;
// and this() call should be first statement of the constructor
this();
this.a = a;
this.b = b;
}
public static void main(String[] args) {
TestThisDemo2 obj = new TestThisDemo2(3,4);
System.out.println(obj.a);
System.out.println(obj.b);
}
}
| [
"sharifulislammallik@gmail.com"
] | sharifulislammallik@gmail.com |
692dbe004b3dad680e0e23a115b86786fd3bb9c4 | c4bafb3477bd4640f5ea13c601472c6c0f51d211 | /Cracking_The_Coding/src/SortingAndSearching/SelectionSort.java | 31671f3526f09898ccb15ba66880cd7f4316f244 | [] | no_license | Sakmatz/CrackingTheCoding | 0fccc57eae294c4fce6da0cde2d6a095d98c335b | 097741fe1dc1b854e9d1aa062eea0bb46a8d8206 | refs/heads/master | 2023-01-12T10:17:12.985005 | 2020-11-20T01:50:11 | 2020-11-20T01:50:11 | 314,416,475 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 660 | java | package SortingAndSearching;
import java.util.Arrays;
public class SelectionSort {
public static int[] sSort(int[] array) {
int n = array.length;
for(int i=0;i<n-1;i++) {
int min =i;//need to initialize after pass loop
for(int j=i+1;j<n;j++) {
if(array[min]>array[j]) {
min = j;
}
}
if(min!=i) {
//swap(array[min],array[i]);
int temp = array[min];
array[min]=array[i];
array[i]=temp;
}
}
return array;
}
public static void main(String args[]) {
int[] array = {7,4,8,3,1};
int[] sortedArray=sSort(array);
System.out.println(Arrays.toString(sortedArray));
}
}
| [
"ms.sakshi.mathur@gmail.com"
] | ms.sakshi.mathur@gmail.com |
04584a9031bebc69f883798e038ee1da969d2c06 | b56c4cff821208f67598143d5c4b816bbfccde07 | /app/src/main/java/com/topunion/chili/paylib/config/PayHelperConfig.java | b84e7fe75eb83a40720800da1f48ca5e317baf0b | [] | no_license | ren5wind/chili | 638434345bdbd7c30384d07f550019a6768372a9 | 26d07de7c165ae6685a18cf2e9f772dbca253316 | refs/heads/master | 2021-01-01T18:19:58.016850 | 2017-12-06T16:33:57 | 2017-12-06T16:33:57 | 98,074,944 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,700 | java | package com.topunion.chili.paylib.config;
/**
* PayHelper的配置
*/
public class PayHelperConfig {
private String createPayOrderUrl;//创建订单url
private String payUrl;//支付url(暂同创建订单url)
private String cancelPayUrl;//取消支付url
private String obtainWechatPayConfigUrl;//获取微信支付配置url
private String obtainAliPayConfigUrl;//获取支付宝配置url
private String obtainPayResultUrl;//获取支付结果url
public String getObtainPayResultUrl() {
return obtainPayResultUrl;
}
public void setObtainPayResultUrl(String obtainPayResultUrl) {
this.obtainPayResultUrl = obtainPayResultUrl;
}
public String getCreatePayOrderUrl() {
return createPayOrderUrl;
}
public void setCreatePayOrderUrl(String createPayOrderUrl) {
this.createPayOrderUrl = createPayOrderUrl;
}
public String getPayUrl() {
return payUrl;
}
public void setPayUrl(String payUrl) {
this.payUrl = payUrl;
}
public String getCancelPayUrl() {
return cancelPayUrl;
}
public void setCancelPayUrl(String cancelPayUrl) {
this.cancelPayUrl = cancelPayUrl;
}
public String getObtainWechatPayConfigUrl() {
return obtainWechatPayConfigUrl;
}
public void setObtainWechatPayConfigUrl(String obtainWechatPayConfigUrl) {
this.obtainWechatPayConfigUrl = obtainWechatPayConfigUrl;
}
public String getObtainAliPayConfigUrl() {
return obtainAliPayConfigUrl;
}
public void setObtainAliPayConfigUrl(String obtainAliPayConfigUrl) {
this.obtainAliPayConfigUrl = obtainAliPayConfigUrl;
}
}
| [
"renxiaoming@caiyitech.com"
] | renxiaoming@caiyitech.com |
d167ef71b9c53ea472c15ca09b9f9ad13245a6c3 | ebaac6f6ddae038473855798051d434fed598540 | /src/us/_donut_/skuniversal/shopkeepers/ExprKeeperAmount.java | ce75f715cbba3a58cfd711d9ac914962c47134f0 | [] | no_license | JiveOff/SkUniversal | d36a50d99e3ee8ff210b0698b4cd4fd0c407d40d | d199a89266e6587f36d66cd5ad4173d5d2f0fc55 | refs/heads/master | 2021-05-05T09:05:31.023740 | 2018-01-27T15:33:22 | 2018-01-27T15:33:22 | 119,176,419 | 0 | 0 | null | 2018-01-27T15:31:52 | 2018-01-27T15:31:51 | null | UTF-8 | Java | false | false | 1,756 | java | package us._donut_.skuniversal.shopkeepers;
import ch.njol.skript.Skript;
import ch.njol.skript.doc.Description;
import ch.njol.skript.doc.Examples;
import ch.njol.skript.doc.Name;
import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser;
import ch.njol.skript.lang.util.SimpleExpression;
import ch.njol.util.Kleenean;
import com.nisovin.shopkeepers.ShopkeepersPlugin;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import javax.annotation.Nullable;
@Name("Shopkeepers - Shopkeeper Amount")
@Description("Returns the amount of shopkeepers a player has.")
@Examples({"send \"%the amount of shopkeepers of player\""})
public class ExprKeeperAmount extends SimpleExpression<Number> {
private Expression<Player> player;
@Override
public boolean isSingle() {
return true;
}
@Override
public Class<? extends Number> getReturnType() {
return Number.class;
}
@SuppressWarnings("unchecked")
@Override
public boolean init(Expression<?>[] e, int i, Kleenean kl, SkriptParser.ParseResult pr) {
player = (Expression<Player>) e[0];
return true;
}
@Override
public String toString(@Nullable Event e, boolean arg1) {
return "amount of keepers of player " + player.getSingle(e);
}
@Override
@Nullable
protected Number[] get(Event e) {
if (player.getSingle(e) != null) {
ShopkeepersPlugin skp = ShopkeepersPlugin.getInstance();
return new Number[]{skp.countShopsOfPlayer(player.getSingle(e))};
} else {
Skript.error("Must provide a player, please refer to the syntax");
return null;
}
}
} | [
"noreply@github.com"
] | JiveOff.noreply@github.com |
afc1e293630008e2763e18f9a293234de8876a71 | 9d32980f5989cd4c55cea498af5d6a413e08b7a2 | /A72n_10_0_0/src/main/java/android/net/UidRangeParcel.java | 93488d03c880aef5c9297f74edd7ec725f3283ab | [] | no_license | liuhaosource/OppoFramework | e7cc3bcd16958f809eec624b9921043cde30c831 | ebe39acabf5eae49f5f991c5ce677d62b683f1b6 | refs/heads/master | 2023-06-03T23:06:17.572407 | 2020-11-30T08:40:07 | 2020-11-30T08:40:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,295 | java | package android.net;
import android.os.Parcel;
import android.os.Parcelable;
public class UidRangeParcel implements Parcelable {
public static final Parcelable.Creator<UidRangeParcel> CREATOR = new Parcelable.Creator<UidRangeParcel>() {
/* class android.net.UidRangeParcel.AnonymousClass1 */
@Override // android.os.Parcelable.Creator
public UidRangeParcel createFromParcel(Parcel _aidl_source) {
UidRangeParcel _aidl_out = new UidRangeParcel();
_aidl_out.readFromParcel(_aidl_source);
return _aidl_out;
}
@Override // android.os.Parcelable.Creator
public UidRangeParcel[] newArray(int _aidl_size) {
return new UidRangeParcel[_aidl_size];
}
};
public int start;
public int stop;
public final void writeToParcel(Parcel _aidl_parcel, int _aidl_flag) {
int _aidl_start_pos = _aidl_parcel.dataPosition();
_aidl_parcel.writeInt(0);
_aidl_parcel.writeInt(this.start);
_aidl_parcel.writeInt(this.stop);
int _aidl_end_pos = _aidl_parcel.dataPosition();
_aidl_parcel.setDataPosition(_aidl_start_pos);
_aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
_aidl_parcel.setDataPosition(_aidl_end_pos);
}
public final void readFromParcel(Parcel _aidl_parcel) {
int _aidl_start_pos = _aidl_parcel.dataPosition();
int _aidl_parcelable_size = _aidl_parcel.readInt();
if (_aidl_parcelable_size >= 0) {
try {
this.start = _aidl_parcel.readInt();
if (_aidl_parcel.dataPosition() - _aidl_start_pos < _aidl_parcelable_size) {
this.stop = _aidl_parcel.readInt();
if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
_aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
} else {
_aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
}
}
} finally {
_aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
}
}
}
public int describeContents() {
return 0;
}
}
| [
"dstmath@163.com"
] | dstmath@163.com |
8f782c34f1f5ea535a6f80019fcac32b095784cd | c8343d226e80ca271a53835d22c3640b65f1d868 | /app/build/generated/source/buildConfig/debug/com/example/uass/BuildConfig.java | 27ea6aa0932194ec763da88fae886feb7f3d67ad | [] | no_license | ryan256/UAS-database-Firebase | 87a8a4ccc7ffbfcfd82837608daa707f3445eba3 | d304c866162d68da3fe740ffe24ff75c83024cc4 | refs/heads/master | 2020-12-07T17:31:33.133941 | 2020-01-09T14:11:47 | 2020-01-09T14:11:47 | 232,761,117 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 439 | java | /**
* Automatically generated file. DO NOT MODIFY
*/
package com.example.uass;
public final class BuildConfig {
public static final boolean DEBUG = Boolean.parseBoolean("true");
public static final String APPLICATION_ID = "com.example.uass";
public static final String BUILD_TYPE = "debug";
public static final String FLAVOR = "";
public static final int VERSION_CODE = 1;
public static final String VERSION_NAME = "1.0";
}
| [
"ryannovanda25@gmail.com"
] | ryannovanda25@gmail.com |
afe3555a2b510761d0fba5749da0c8a8632dc68f | d275d5b323f6d8ecdbfb357a24f51baf6f922363 | /513-找树左下角的值.java | 64a10cfdae3a769302a99a56936dee920c49df60 | [] | no_license | ZeromaXHe/LeetcodeCN | cf052c4b70ac2dffce53ed4a38aba887b257dcc6 | 55028e9915589ac9d3859411cacec894f53d7387 | refs/heads/master | 2020-05-15T09:49:46.950265 | 2019-07-12T13:27:32 | 2019-07-12T13:27:32 | 182,182,750 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 2,123 | java | //执行用时 :5 ms, 在所有Java提交中击败了46.79%的用户
//内存消耗 :38.5 MB, 在所有Java提交中击败了61.43%的用户
/**
* Definition for a binary tree node.
* public class TreeNode {
* int val;
* TreeNode left;
* TreeNode right;
* TreeNode(int x) { val = x; }
* }
*/
class Solution {
public int findBottomLeftValue(TreeNode root) {
LinkedList<TreeNode> queue = new LinkedList<>();
int added = 0;
int polled = 1;
queue.add(root);
if(root.left!=null) {
queue.add(root.left);
added++;
}
if(root.right!=null){
queue.add(root.right);
added++;
}
TreeNode tmp = null;
int temp = added;
while(added>0){
temp=added;
added=0;
for(int i=0;i<polled;i++) {
tmp=queue.poll();
if(tmp.left!=null) {
queue.add(tmp.left);
added++;
}
if(tmp.right!=null){
queue.add(tmp.right);
added++;
}
}
polled=temp;
}
return queue.poll().val;
}
}
//执行用时 :4 ms, 在所有Java提交中击败了71.08%的用户
//内存消耗 :38.7 MB, 在所有Java提交中击败了57.62%的用户
class Solution {
public int findBottomLeftValue(TreeNode root) {
LinkedList<TreeNode> queue = new LinkedList<>();
int added = 1;
int polled = 1;
queue.add(root);
TreeNode tmp = null;
TreeNode res = root;
while(added>0){
added=0;
res=queue.peek();
for(int i=0;i<polled;i++) {
tmp=queue.poll();
if(tmp.left!=null) {
queue.add(tmp.left);
added++;
}
if(tmp.right!=null){
queue.add(tmp.right);
added++;
}
}
polled=added;
}
return res.val;
}
} | [
"zhuxiaohe95@163.com"
] | zhuxiaohe95@163.com |
ea3f0f596a55c8a449dfb6faf1e61ebf4707cf1e | 3a983a824ec42311340c1f6d06dc8fa998e0a968 | /src/main/java/santatecla/itinerarios/service/ImageService.java | b75424d4e2b10439af6e4942baf0d28ddec5651a | [
"Apache-2.0"
] | permissive | Ruben98Z/santatecla-itinerarios-1 | 0b1b5645647592fc654dfc073287d41351a1667b | 23b37e183d32b4a03f11fd55bfe73187f139fe44 | refs/heads/master | 2023-03-15T19:08:29.748985 | 2019-04-11T12:35:01 | 2019-04-11T12:35:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 683 | java | package santatecla.itinerarios.service;
import org.springframework.stereotype.Service;
import santatecla.itinerarios.model.Image;
import santatecla.itinerarios.repo.ImageRepository;
import java.util.Optional;
@Service
public class ImageService {
private ImageRepository repository;
public ImageService(ImageRepository repository) {
this.repository = repository;
}
public Optional<Image> findById(String id) {
final int index = id.indexOf("_");
Long formId = Long.parseLong(id.substring(0, index));
String filename = id.substring(index + 1);
return this.repository.findById_FilenameAndId_Form_Id(filename, formId);
}
}
| [
"dalao1002@gmail.com"
] | dalao1002@gmail.com |
83558619e3916a8b873e89ae3075061a10fbea07 | 1cae4b6b150f0e72c8fc0dc2a60d9cd63c6273df | /src/main/java/com/hqu/modules/basedata/worktype/service/WorkTypeService.java | 3835b29c401a19321b56a8b2f6b5c439f3452807 | [] | no_license | huangzhibing/softwareComponents | fb5f6752c46c5d2b0d502e4fed93c761a3ecdae7 | df6351b7851a4c4fdf36a32935c9a564ff1d8605 | refs/heads/master | 2020-04-25T22:23:50.345700 | 2019-03-04T08:12:16 | 2019-03-04T08:12:16 | 173,110,129 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,266 | java | /**
* Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
*/
package com.hqu.modules.basedata.worktype.service;
import java.util.List;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.jeeplus.core.persistence.Page;
import com.jeeplus.core.service.CrudService;
import com.hqu.modules.basedata.worktype.entity.WorkType;
import com.hqu.modules.basedata.worktype.mapper.WorkTypeMapper;
/**
* 工种定义Service
* @author zb
* @version 2018-04-07
*/
@Service
@Transactional(readOnly = true)
public class WorkTypeService extends CrudService<WorkTypeMapper, WorkType> {
public WorkType get(String id) {
return super.get(id);
}
public List<WorkType> findList(WorkType workType) {
return super.findList(workType);
}
public Page<WorkType> findPage(Page<WorkType> page, WorkType workType) {
return super.findPage(page, workType);
}
@Transactional(readOnly = false)
public void save(WorkType workType) {
super.save(workType);
}
@Transactional(readOnly = false)
public void delete(WorkType workType) {
super.delete(workType);
}
public Integer getCodeNum(String workTypeCode) {
return mapper.getCodeNum(workTypeCode);
}
} | [
"745216570@qq.com"
] | 745216570@qq.com |
6c89ff932cf3b88523437b72912d441c2d6aa113 | f72136b1def245de66d02375c258c1b735ecc721 | /src/main/java/com/kakao/pay/constant/Constants.java | a6eb9a98ffc7d1aa56acfd106baddc772a5efe30 | [] | no_license | june2/payment-system | 51a0a71f03b2dddf7b4693606c01cfbc631ada72 | 6d695df2dd4e9ac89b99e60926e286ff3c308de3 | refs/heads/master | 2023-02-07T16:42:09.911778 | 2021-01-04T02:26:10 | 2021-01-04T02:26:10 | 325,479,003 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 263 | java | package com.kakao.pay.constant;
import lombok.experimental.UtilityClass;
@UtilityClass
public class Constants {
public static final String PAYLOAD_ID = "UNIQUEID";
public static final int ID_SIZE = 20;
public static final int PAYLOAD_SIZE = 450;
} | [
"kimjy4536@hotmail.com"
] | kimjy4536@hotmail.com |
d3bf60420f89d002556740faad84c5d943c4c581 | 59d19ed837f519ee4413e6fe748afadaafce7bc4 | /jsf2-primefaces-spring/src/main/generated-java/com/jaxio/web/domain/support/GenericController.java | f0f22863d382ced3d8f65bebb2851abe021ab3f2 | [] | no_license | rbung/generated-projects | 9355a6d9b4d5247430bad7498219561d17429fa5 | c58b3baf1f84a4031f05798d3a49776319fbb759 | refs/heads/master | 2021-01-16T19:22:06.466460 | 2013-05-31T13:20:13 | 2013-05-31T13:20:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 18,339 | java | /*
* (c) Copyright 2005-2013 JAXIO, http://www.jaxio.com
* Source code generated by Celerio, a Jaxio product
* Want to purchase Celerio ? email us at info@jaxio.com
* Follow us on twitter: @springfuse
* Documentation: http://www.jaxio.com/documentation/celerio/
* Template pack-jsf2-spring-conversation:src/main/java/domain/support/GenericController.p.vm.java
*/
package com.jaxio.web.domain.support;
import static com.jaxio.web.conversation.ConversationHolder.getCurrentConversation;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.collect.Lists.newArrayList;
import static com.google.common.collect.Maps.newHashMap;
import static com.google.common.collect.Sets.newHashSet;
import java.io.IOException;
import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.inject.Inject;
import org.apache.commons.beanutils.PropertyUtils;
import org.apache.commons.lang.WordUtils;
import com.jaxio.dao.support.JpaUniqueUtil;
import com.jaxio.dao.support.SearchParameters;
import com.jaxio.domain.Identifiable;
import com.jaxio.printer.TypeAwarePrinter;
import com.jaxio.repository.support.GenericRepository;
import com.jaxio.web.util.MessageUtil;
import com.jaxio.util.ResourcesUtil;
import com.jaxio.web.conversation.ConversationCallBack;
import com.jaxio.web.conversation.ConversationContext;
import com.jaxio.web.conversation.ConversationManager;
import com.jaxio.web.permission.support.GenericPermission;
import com.jaxio.context.UserContext;
/**
* Base controller for JPA entities providing helper methods to:
* <ul>
* <li>start conversations</li>
* <li>create conversation context</li>
* <li>support autoComplete component</li>
* <li>perform actions</li>
* <li>support excel export</li>
* </ul>
*/
public abstract class GenericController<E extends Identifiable<PK>, PK extends Serializable> {
private static final String PERMISSION_DENIED = "/error/accessdenied";
private String selectUri;
private String editUri;
@Inject
protected ConversationManager conversationManager;
@Inject
protected JpaUniqueUtil jpaUniqueUtil;
@Inject
protected MessageUtil messageUtil;
@Inject
protected TypeAwarePrinter printer;
protected GenericRepository<E, PK> repository;
protected GenericPermission<E> permission;
public GenericController(GenericRepository<E, PK> repository, GenericPermission<E> permission, String selectUri, String editUri) {
this.repository = checkNotNull(repository);
this.permission = checkNotNull(permission);
this.selectUri = checkNotNull(selectUri);
this.editUri = checkNotNull(editUri);
}
public GenericRepository<E, PK> getRepository() {
return repository;
}
public GenericPermission<E> getPermission() {
return permission;
}
public MessageUtil getMessageUtil() {
return messageUtil;
}
public String getPermissionDenied() {
return PERMISSION_DENIED;
}
public String getSelectUri() {
return selectUri;
}
public String getEditUri() {
return editUri;
}
// ----------------------------------------
// START CONVERSATION PROGRAMATICALY
// ----------------------------------------
/**
* Start a new {@link Conversation} that allows the user to search an existing entity.
* This method can be invoked from an h:commandLink's action attribute.
* @return the implicit first view for the newly created conversation.
*/
public String beginSearch() {
if (!permission.canSearch()) {
return getPermissionDenied();
}
return beginConversation(newSearchContext(getSearchLabelKey()));
}
/**
* Start a new {@link Conversation} that allows the user to create a new entity.
* This method can be invoked from an h:commandLink's action attribute.
* @return the implicit first view for the newly created conversation.
*/
public String beginCreate() {
if (!permission.canCreate()) {
return getPermissionDenied();
}
return beginConversation(newEditContext(getCreateLabelKey(), repository.getNewWithDefaults()));
}
/**
* Start a new {@link Conversation} using the passed ctx as the first conversation context.
* @return the implicit first view for the newly created conversation.
*/
public String beginConversation(ConversationContext<E> ctx) {
return conversationManager.beginConversation(ctx).nextView();
}
// ----------------------------------------
// AUTO COMPLETE SUPPORT
// ----------------------------------------
/**
* Auto-complete support. This method is used by primefaces autoComplete component.
*/
public List<E> complete(String value) {
return repository.find(completeSearchParameters(value));
}
public List<E> completeFullText(String value) {
return repository.find(completeFullTextSearchParameters(value));
}
/**
* A simple auto-complete that returns exactly the input. It is used in search forms with PropertySelector.
*/
public List<String> completeSame(String value) {
return newArrayList(value);
}
public List<String> completePropertyFullText(String term) throws Exception {
String property = parameter("property", String.class);
Integer maxResults = parameter("maxResults", Integer.class);
Set<String> ret = newHashSet(term);
for (E object : repository.find(new SearchParameters().termOn(term, property).orderBy(property).maxResults(maxResults - 1))) {
ret.add((String) PropertyUtils.getProperty(object, property));
}
return newArrayList(ret);
}
public List<String> completeProperty(String value) throws Exception {
String property = parameter("property", String.class);
Integer maxResults = parameter("maxResults", Integer.class);
E template = repository.getNew();
PropertyUtils.setProperty(template, property, value);
Set<String> ret = newHashSet(value);
for (E object : repository.find(template, new SearchParameters().anywhere().orderBy(property).maxResults(maxResults - 1))) {
ret.add((String) PropertyUtils.getProperty(object, property));
}
return newArrayList(ret);
}
@SuppressWarnings("unchecked")
private <T> T parameter(String propertyName, Class<T> expectedType) {
return (T) UIComponent.getCurrentComponent(FacesContext.getCurrentInstance()).getAttributes().get(propertyName);
}
protected SearchParameters completeSearchParameters(String value) {
return searchParameters().searchPattern(value);
}
protected SearchParameters searchParameters() {
return defaultOrder(new SearchParameters().anywhere());
}
protected SearchParameters completeFullTextSearchParameters(String value) {
return searchParameters().term(value);
}
protected SearchParameters defaultOrder(SearchParameters searchParameters) {
return searchParameters;
}
/**
* Decision helper used when handling ajax autoComplete event and regular page postback.
*/
public boolean shouldReplace(E currentEntity, E selectedEntity) {
if (currentEntity == selectedEntity) {
return false;
}
if (currentEntity != null && selectedEntity != null && currentEntity.isIdSet() && selectedEntity.isIdSet()) {
if (selectedEntity.getId().equals(currentEntity.getId())) {
Comparable<Object> currentVersion = repository.getVersion(currentEntity);
if (currentVersion == null) {
// assume no version at all is available
// let's stick with current entity.
return false;
}
Comparable<Object> selectedVersion = repository.getVersion(selectedEntity);
if (currentVersion.compareTo(selectedVersion) == 0) {
// currentEntity could have been edited and not yet saved, we keep it.
return false;
} else {
// we could have an optimistic locking exception at save time
// TODO: what should we do here?
return false;
}
}
}
return true;
}
// ----------------------------------------
// CREATE IMPLICIT EDIT VIEW
// ----------------------------------------
/**
* Helper to create a new {@link ConversationContext} to view the passed entity and set it as the current conversation's next context.
* The vars <code>sub</code> <code>readonly</code> are set to true.
* The permission {@link GenericPermission#canView()} is checked.
*
* @param labelKey label key for breadCrumb and conversation menu.
* @param e the entity to view.
* @return the implicit view to access this context.
*/
public String editSubReadOnlyView(String labelKey, E e) {
if (!permission.canView(e)) {
return getPermissionDenied();
}
ConversationContext<E> ctx = newEditContext(labelKey, e).sub().readonly();
return getCurrentConversation().nextContext(ctx).view();
}
/**
* Helper to create a new {@link ConversationContext} to edit the passed entity and set it as the current conversation's next context.
* The var <code>sub</code> is set to true.
* The permission {@link GenericPermission#canEdit()} is checked.
*
* @param labelKey label key for breadCrumb and conversation menu.
* @param e the entity to edit.
* @return the implicit view to access this context.
*/
public String editSubView(String labelKey, E e, ConversationCallBack<E> editCallBack) {
if (!permission.canEdit(e)) {
return getPermissionDenied();
}
ConversationContext<E> ctx = newEditContext(labelKey, e, editCallBack).sub();
return getCurrentConversation().nextContext(ctx).view();
}
/**
* Helper to create a new {@link ConversationContext} to create a new entity and set it as the current conversation's next context.
* The var <code>sub</code> is set to true.
*
* @param labelKey label key for breadCrumb and conversation menu.
* @return the implicit view to access this context.
*/
public String createSubView(String labelKey, ConversationCallBack<E> createCallBack) {
return createSubView(labelKey, repository.getNewWithDefaults(), createCallBack);
}
/**
* Helper to create a new {@link ConversationContext} to edit the passed new entity and set it as the current conversation's next context.
* The var <code>sub</code> is set to true.
* The permission {@link GenericPermission#canCreate()} is checked.
*
* @param labelKey label key for breadCrumb and conversation menu.
* @param e the entity to edit.
* @return the implicit view to access this context.
*/
public String createSubView(String labelKey, E e, ConversationCallBack<E> createCallBack) {
if (!permission.canCreate()) {
return getPermissionDenied();
}
ConversationContext<E> ctx = newEditContext(labelKey, e, createCallBack).sub();
return getCurrentConversation().nextContext(ctx).view();
}
// ----------------------------------------
// CREATE IMPLICIT SELECT VIEW
// ----------------------------------------
public String selectSubView(String labelKey, ConversationCallBack<E> selectCallBack) {
if (!permission.canSelect()) {
return getPermissionDenied();
}
ConversationContext<E> ctx = newSearchContext(labelKey, selectCallBack).sub();
return getCurrentConversation().nextContext(ctx).view();
}
public String multiSelectSubView(String labelKey, ConversationCallBack<E> selectCallBack) {
if (!permission.canSelect()) {
return getPermissionDenied();
}
ConversationContext<E> ctx = newSearchContext(labelKey, selectCallBack).sub();
ctx.setVar("multiCheckboxSelection", true);
return getCurrentConversation().nextContext(ctx).view();
}
// ----------------------------------------
// CREATE EDIT CONVERSATION CONTEXT
// ----------------------------------------
/**
* Helper to construct a new {@link ConversationContext} to edit an entity.
* @param e the entity to edit.
*/
public ConversationContext<E> newEditContext(E e) {
return new ConversationContext<E>().entity(e).isNewEntity(!e.isIdSet()).viewUri(getEditUri());
}
public ConversationContext<E> newEditContext(String labelKey, E e) {
return newEditContext(e).labelKey(labelKey);
}
public ConversationContext<E> newEditContext(String labelKey, E e, ConversationCallBack<E> callBack) {
return newEditContext(labelKey, e).callBack(callBack);
}
// ----------------------------------------
// CREATE SEARCH CONVERSATION CONTEXT
// ----------------------------------------
/**
* Helper to construct a new {@link ConversationContext} for search/selection.
*/
public ConversationContext<E> newSearchContext() {
return new ConversationContext<E>(getSelectUri());
}
public ConversationContext<E> newSearchContext(String labelKey) {
return newSearchContext().labelKey(labelKey);
}
public ConversationContext<E> newSearchContext(String labelKey, ConversationCallBack<E> callBack) {
return newSearchContext(labelKey).callBack(callBack);
}
// ----------------------------------------
// ACTIONS INVOKED FORM THE VIEW
// ----------------------------------------
public ConversationContext<E> getSelectedContext(E selected) {
return newEditContext(getEditUri(), selected);
}
/**
* Action to create a new entity.
*/
public String create() {
if (!permission.canCreate()) {
return getPermissionDenied();
}
E newEntity = repository.getNewWithDefaults();
ConversationContext<E> ctx = getSelectedContext(newEntity).labelKey(getCreateLabelKey());
return getCurrentConversation().nextContext(ctx).view();
}
/**
* Support for {@link GenericLazyDataModel.#edit()} and {@link GenericLazyDataModel#onRowSelect(org.primefaces.event.SelectEvent)} methods
*/
public String edit(E entity) {
if (!permission.canEdit(entity)) {
return getPermissionDenied();
}
ConversationContext<E> ctx = getSelectedContext(entity).labelKey(getEditLabelKey(), printer.print(entity));
return getCurrentConversation().nextContext(ctx).view();
}
/**
* Support for the {@link GenericLazyDataModel.#view()} method
*/
public String view(E entity) {
if (!permission.canView(entity)) {
return getPermissionDenied();
}
ConversationContext<E> ctx = getSelectedContext(entity).sub().readonly().labelKey(getViewLabelKey(), printer.print(entity));
return getCurrentConversation().nextContext(ctx).view();
}
/**
* Return the print friendly view for the passed entity. I can be invoked directly from the view.
*/
public String print(E entity) {
if (!permission.canView(entity)) {
return getPermissionDenied();
}
ConversationContext<E> ctx = getSelectedContext(entity).readonly().print().labelKey(getViewLabelKey(), printer.print(entity));
return getCurrentConversation().nextContext(ctx).view();
}
protected String select(E entity) {
if (!permission.canSelect()) {
return getPermissionDenied();
}
return getCurrentConversation() //
.<ConversationContext<E>> getCurrentContext() //
.getCallBack() //
.selected(entity);
}
protected String getSearchLabelKey() {
return getLabelName() + "_search";
}
protected String getCreateLabelKey() {
return getLabelName() + "_create";
}
protected String getEditLabelKey() {
return getLabelName() + "_edit";
}
protected String getViewLabelKey() {
return getLabelName() + "_view";
}
protected String getLabelName() {
return WordUtils.uncapitalize(getEntityName());
}
private String getEntityName() {
return repository.getType().getSimpleName();
}
// ----------------------------------------
// EXCEL RELATED
// ----------------------------------------
@Inject
private ExcelExportService excelExportService;
@Inject
private ExcelExportSupport excelExportSupport;
@Inject
private ResourcesUtil resourcesUtil;
public void onExcel(SearchParameters searchParameters) throws IOException {
Map<String, Object> model = newHashMap();
model.put("msg", resourcesUtil);
model.put("search_date", excelExportSupport.dateToString(new Date()));
model.put("search_by", UserContext.getUsername());
model.put("searchParameters", searchParameters);
model.put("printer", printer);
excelObjects(model, searchParameters);
excelExportService.export("excel/" + getEntityName().toLowerCase() + ".xlsx", model, getExcelOutputname());
}
protected String getExcelOutputname() {
return getEntityName() + "-" + new SimpleDateFormat("MM-dd-yyyy_HH-mm-ss").format(new Date()) + ".xlsx";
}
protected void excelObjects(Map<String, Object> model, SearchParameters searchParameters) {
excelExportSupport.convertSearchParametersToMap(model, searchParameters);
int count = repository.findCount(searchParameters);
model.put("search_nb_results", count);
if (count > 65535) {
searchParameters.maxResults(65535);
}
model.put(WordUtils.uncapitalize(getEntityName()), repository.find(searchParameters));
}
}
| [
"nromanetti@jaxio.com"
] | nromanetti@jaxio.com |
531e98923489a5c9e3cab42f0361b4d5eef84c66 | 22fa426c263232527ef6bad305ac8967987d271f | /src/controller/PlayerKeyListener.java | 4f69316191fee309b15a4da09d1dc5f507cf3273 | [] | no_license | liam619/wheelgame_A2 | dc29fab8c7c84681480202de73806ef7aab6dafa | 25daa2080f8a2480c9b73c7cb053de94f8c2cf4d | refs/heads/master | 2020-05-19T05:47:51.197433 | 2019-06-26T20:38:37 | 2019-06-26T20:38:37 | 184,855,822 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 671 | java | package controller;
import java.awt.Toolkit;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
public class PlayerKeyListener implements KeyListener {
/** Prevent user key in non numeric character **/
@Override
public void keyTyped(KeyEvent e) {
char c = e.getKeyChar();
if (!(Character.isDigit(c) || c == KeyEvent.VK_BACK_SPACE || c == KeyEvent.VK_DELETE)) {
e.consume();
Toolkit.getDefaultToolkit().beep(); // Alert sound when invalid character capture!
}
}
@Override
public void keyPressed(KeyEvent e) {
}
@Override
public void keyReleased(KeyEvent e) {
}
}
| [
"s3697652@student.rmit.edu.au"
] | s3697652@student.rmit.edu.au |
4239a3acc33d60b881ac9aaf55b54976e15f0005 | 89e1d556417ffe87a1b9980d0ab246f66b0fcef3 | /src/test/java/com/rita/chatII/ChatPage.java | c2ee5ed270fe920da043979adf6eb6f7c558db1a | [] | no_license | yuxiRen/JavaWebChat | bed74dfbedbf59cd21fc9ec9a6f4c74e1a2f8aae | b3b166de290532a4d9c0e9d270fa288f3aa5f682 | refs/heads/master | 2022-12-17T16:50:28.054204 | 2020-09-17T05:19:08 | 2020-09-17T05:19:08 | 292,472,090 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,015 | java | package com.rita.chatII;
import com.rita.chatII.Model.ChatMessage;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
public class ChatPage {
@FindBy(id="messageText")
private WebElement textField;
@FindBy(id="submitMessage")
private WebElement submitButton;
@FindBy(id = "chatMessageUsername")
private WebElement firstMessageUsername;
@FindBy(id = "chatMessageText")
private WebElement firstMessageText;
public ChatPage(WebDriver driver) {
PageFactory.initElements(driver, this);
}
public void sendChatMessage(String text) {
this.textField.sendKeys(text);
this.submitButton.click();
}
public ChatMessage getFirstMessage() {
ChatMessage result = new ChatMessage();
result.setMsg(firstMessageText.getText());
result.setName(firstMessageUsername.getText());
return result;
}
}
| [
"rita.ren.yuxi@gmail.com"
] | rita.ren.yuxi@gmail.com |
fa14bd0aa529a9b14ab3c1acb0ca73d201d7bda1 | 97fd3386724af5187b9df1f57733ee7a6f525204 | /apm-sniffer/apm-toolkit-activation/apm-toolkit-logback-1.x-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/log/logback/v1/x/mdc/MDCConverterActivation4SessionId.java | 9ddb73d37e116df3718b0ec4e9a6a26a926fe083 | [
"Apache-2.0"
] | permissive | meixinbin/incubator-skywalking | c91f726c7f5561ed7fb26f8bca8236b36ec4ccc8 | da2e810bc69134fd5a165663474d4a1248c77247 | refs/heads/master | 2020-03-18T13:50:54.593525 | 2018-12-03T03:20:55 | 2018-12-03T03:20:55 | 134,812,948 | 0 | 0 | null | 2018-05-25T06:27:23 | 2018-05-25T06:27:22 | null | UTF-8 | Java | false | false | 2,915 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.apache.skywalking.apm.toolkit.activation.log.logback.v1.x.mdc;
import net.bytebuddy.description.method.MethodDescription;
import net.bytebuddy.matcher.ElementMatcher;
import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;
import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
import org.apache.skywalking.apm.agent.core.plugin.match.NameMatch;
import static net.bytebuddy.matcher.ElementMatchers.named;
/**
* Support MDC https://logback.qos.ch/manual/mdc.html
* @author: zhangkewei
*/
public class MDCConverterActivation4SessionId extends ClassInstanceMethodsEnhancePluginDefine {
public static final String INTERCEPT_CLASS = "org.apache.skywalking.apm.toolkit.activation.log.logback.v1.x.mdc.PrintMDCSessionIdInterceptor";
public static final String ENHANCE_CLASS = "org.apache.skywalking.apm.toolkit.log.logback.v1.x.mdc.LogbackMDCPatternConverter4SessionId";
public static final String ENHANCE_METHOD = "convertSessionId";
@Override
protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
return null;
}
@Override
protected InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
return new InstanceMethodsInterceptPoint[] {
new InstanceMethodsInterceptPoint() {
@Override
public ElementMatcher<MethodDescription> getMethodsMatcher() {
return named(ENHANCE_METHOD);
}
@Override
public String getMethodsInterceptor() {
return INTERCEPT_CLASS;
}
@Override public boolean isOverrideArgs() {
return false;
}
}
};
}
@Override
protected ClassMatch enhanceClass() {
return NameMatch.byName(ENHANCE_CLASS);
}
}
| [
"meixinbin@qq.com"
] | meixinbin@qq.com |
5b98b2916140593a6e732c9280e139b85e11dfb7 | bacaf0c46c9e6fe5ea41157c9288b316ebe33f74 | /Covid19India/app/src/main/java/com/example/covid19india/Covid19Service.java | af5f722ae06a92c1336a9f4c77eb81071b47cdc0 | [] | no_license | AP-Skill-Development-Corporation/SEITK-Android-Offlineworkshop-march-29-2021 | 14984388a8d66dc9489f7615e91eeed13f542c42 | 62eb24a86cf41156e96cfb342041a647818cb482 | refs/heads/master | 2023-04-01T14:00:12.114172 | 2021-04-03T09:52:40 | 2021-04-03T09:52:40 | 354,245,467 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 186 | java | package com.example.covid19india;
import retrofit2.Call;
import retrofit2.http.GET;
public interface Covid19Service {
@GET("dayone/country/IN")
Call<String> getCovidData();
}
| [
"mastanvali.p@apssdc.in"
] | mastanvali.p@apssdc.in |
afa508234e0533f30f8a24171642ff89eff525c4 | 69c234a75cb5bc51c45ad079d96be3e80e0da4c2 | /app/src/main/java/com/randomappsinc/simpleloginexample/api/callbacks/GoogleLoginCallback.java | 6251d4c1ebe5b73edac9d24b8c8319a1dcda8dd8 | [] | no_license | Gear61/SimpleLoginExample | 5403775d1519ce2151dfc16996350bdd027045ad | d0646a86109441f3f9841170f28eca4f802be696 | refs/heads/master | 2021-01-24T03:57:47.737032 | 2019-09-18T04:49:34 | 2019-09-18T04:49:34 | 122,913,636 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,037 | java | package com.randomappsinc.simpleloginexample.api.callbacks;
import com.randomappsinc.simpleloginexample.api.ApiConstants;
import com.randomappsinc.simpleloginexample.api.models.UserProfileInfo;
import com.randomappsinc.simpleloginexample.onboarding.GoogleLoginManager;
import com.randomappsinc.simpleloginexample.persistence.PreferencesManager;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
public class GoogleLoginCallback implements Callback<UserProfileInfo> {
@Override
public void onResponse(Call<UserProfileInfo> call, Response<UserProfileInfo> response) {
if (response.code() == ApiConstants.HTTP_STATUS_OK) {
PreferencesManager.get().setUserProfile(response.body());
GoogleLoginManager.get().onGoogleLoginSuccess();
} else {
GoogleLoginManager.get().onGoogleLoginError();
}
}
@Override
public void onFailure(Call<UserProfileInfo> call, Throwable t) {
GoogleLoginManager.get().onGoogleLoginError();
}
}
| [
"chessnone@yahoo.com"
] | chessnone@yahoo.com |
8377a83c79142067ae64076be0fd55c6cf98334f | 16dac1df4775fdb43723a875dc16ed2d55cf5f8f | /src/ro/ctrln/polymorphism/StarPort.java | a9c5662c0f51bf0d660ce5c220e1bef6de1e87ad | [] | no_license | razvanbcr/ObjectOrientedProgrammingPrinciples | 389bbe59e940cf0c082617fefb9c92456474809b | b271841cbb5e186244d8cf61af937dd5d1a3fed9 | refs/heads/master | 2023-06-29T19:24:07.940410 | 2021-07-22T18:37:30 | 2021-07-22T18:37:30 | 387,544,575 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 498 | java | package ro.ctrln.polymorphism;
import ro.ctrln.inheritance.Starship;
public class StarPort {
private Starship starship;
public void setStarship(Starship starship) {
this.starship = starship;
}
public Starship getStarship() {
return this.starship;
}
public void flyToSpace() {
starship.warp();
}
@Override
public String toString() {
return "StarPort{" +
"starship=" + starship +
'}';
}
}
| [
"razvanbcr@gmail.com"
] | razvanbcr@gmail.com |
fcf69d23a7983a15f52a6eceafc2cf9d8b916660 | 6aba7dceb37079abc6ef00d5524a4b986f82e2e8 | /src/algorithmization/arrays of arrays/mulArr9.java | 158af46c5f809d5e2c372a13f27b513d58206b02 | [] | no_license | Kenarius/IntroductionJavaOnline | 601027f9779a9fac00cea7b636abe63a0cc9aa32 | 84af553962a042009a36a5a845a63c254f73f8b8 | refs/heads/main | 2023-08-07T03:27:57.912653 | 2021-09-18T19:28:43 | 2021-09-18T19:28:43 | 335,709,087 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,782 | java | import java.util.Scanner;
public class mulArr9 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("Введите количество строк матрицы");
int n = scanner.nextInt();
System.out.println("Введите количество столбцов матрицы");
int m = scanner.nextInt();
int[][] arr = new int[n][m];
System.out.println("Введите элементы матрицы");
for (int i = 0; i < arr.length; i++) {
for (int j = 0; j < arr[i].length; j++) {
System.out.println("Элемент[" + (i + 1) + "][" + (j + 1) + "] = ");
arr[i][j] = scanner.nextInt();
}
}
int maxSum = 0;
int maxSumCol = 0;
for (int j = 0; j < arr[0].length; j++ ){
int sum = 0;
for (int i = 0; i < arr.length; i++){
sum += arr[i][j];
}
System.out.println("Сумма элементво в "+(j+1)+" столбце равна "+sum);
if (sum>maxSum){
maxSum = sum;
maxSumCol = j+1;
}
}
for (int j = 0; j < arr[0].length; j++ ){ //Для того, чтобы в случае наличия максимальной суммы у нескольких столбцов, выводились все столбцы
int sum = 0;
for (int i = 0; i < arr.length; i++){
sum += arr[i][j];
}
if (sum==maxSum){
System.out.println("Максимальная сумма ("+maxSum+") у столбца номер "+(j+1));
}
}
}
} | [
"kennariuss@gmail.com"
] | kennariuss@gmail.com |
27841afbfc0bcf04bd2a2ba0fe41c6be88db9b67 | 2839a7c59cc91cd5efbfbf98f3d1e945cd245d02 | /app/src/main/java/com/helloandroid/project3_chatbot/ChatActivity.java | 41f2e9b09131f622e575a157cd516fe04b316825 | [] | no_license | ChoHnA/MyPhotoDiary | 5f13eaf0a8defb7e4c49efd5416a022b848540ab | 6b26c36b230c96a1775301d9b673521272af1285 | refs/heads/master | 2020-04-16T06:49:39.020601 | 2019-01-12T07:58:55 | 2019-01-12T07:58:55 | 165,362,311 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,440 | java | package com.helloandroid.project3_chatbot;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.KeyEvent;
import android.view.View;
import android.view.inputmethod.EditorInfo;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public class ChatActivity extends AppCompatActivity {
EditText userInput;
ImageView button_send;
RecyclerView recyclerView;
List<ResponseMessage> responseMessageList;
MessageAdeapter messageAdeapter;
private Bitmap bitmap;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_chat);
init();
userInput.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_SEND){
responseAction();
}
return true;
}
});
}
private void init() {
userInput = (EditText) findViewById(R.id.userInput);
button_send = (ImageView) findViewById(R.id.button_send);
recyclerView = findViewById(R.id.conversation);
responseMessageList = new ArrayList<>();
messageAdeapter = new MessageAdeapter(responseMessageList);
recyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
recyclerView.setAdapter(messageAdeapter);
buttonAction();
}
private void buttonAction() {
button_send.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
responseAction();
}
});
}
private void responseAction() {
String currentData = userInput.getText().toString();
String resultData = null;
if ("안녕".equals(currentData) || "하이".equals(currentData) || "반가워".equals(currentData) || "헬로".equals(currentData)) {
resultData = SelectWelcome();
} else if ("끝끝끝".equals(currentData)) {
selectPhoto();
resultData = "일기 저장 완료. 오늘 하루도 수고 많았어. 내일 또 봐. 안녕!";
} else {
resultData = "일기를 저장할까? 저장하려면 '끝끝끝'이라고 보내고 사진을 선택해줘.";
}
ResponseMessage message = new ResponseMessage(currentData, true);
responseMessageList.add(message);
ResponseMessage message2 = new ResponseMessage(resultData, false);
responseMessageList.add(message2);
messageAdeapter.notifyDataSetChanged();
userInput.setText("");
if(!isVisivle()){
recyclerView.smoothScrollToPosition(messageAdeapter.getItemCount()-1);
}
}
private void selectPhoto() {
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(intent, 1);
}
private String SelectWelcome() {
String[] Welcomelist = {"반가워! 오늘 너의 하루는 어땠는지 들려줘.", "안녕, 오늘 하루 어땠어?",
"보고싶었어! 오늘 하루 어떻게 보냈어?", "헬로! 오늘은 어떤 일이 있었어?", "하이! 오늘은 어땠어, 재미있는 하루였어?"};
Random random = new Random();
String selectWelcome = Welcomelist[random.nextInt(Welcomelist.length)];
return selectWelcome;
}
public boolean isVisivle(){
LinearLayoutManager LinearlayoutManager = (LinearLayoutManager) recyclerView.getLayoutManager();
int positionOfLastVisivleItem = LinearlayoutManager.findLastCompletelyVisibleItemPosition();
int itemCount = recyclerView.getAdapter().getItemCount();
return (positionOfLastVisivleItem>=itemCount);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// Check which request we're responding to
if (requestCode == 1) {
// Make sure the request was successful
if (resultCode == RESULT_OK) {
try {
// 선택한 이미지에서 비트맵 생성
InputStream in = getContentResolver().openInputStream(data.getData());
bitmap = BitmapFactory.decodeStream(in);
in.close();
Drawable drawable = new BitmapDrawable(bitmap);
//ArrayList<CalendarDay> dates = new ArrayList<>();
//dates.add(new CalendarDay(Year,Month,Day));
//materialCalendarView.addDecorator(new EventDecorator(drawable, dates,MainActivity.this));
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
}
| [
"zzznd3@naver.com"
] | zzznd3@naver.com |
0bee293bd0453b429a4e3b89b5608356dc35c9ec | 30790e8b33f37f118f81c5b73696a12615b9f805 | /src/main/java/adapter/advancedPlayer/VlcPlayer.java | 1257809d4968f99f57c9d5364ac5f7b4596b5ff0 | [] | no_license | veklyyev/patterns | c31cb2e9e3bc81a6c77a9e5046d351a2d5bb39e9 | 3cf66b9ecb67fa96262fde9df8d5d4f258ffb534 | refs/heads/master | 2020-03-13T09:32:54.476944 | 2018-05-02T12:50:51 | 2018-05-02T12:50:51 | 131,066,524 | 2 | 0 | null | 2018-05-02T12:50:52 | 2018-04-25T21:38:07 | Java | UTF-8 | Java | false | false | 343 | java | package adapter.advancedPlayer;
/**
* Created by Yevhen_Veklyn on 10/25/2015.
*/
public class VlcPlayer implements AdvancedMediaPlayer {
@Override
public void playVlc(String filename) {
System.out.println("playing Vlc: " + filename);
}
@Override
public void playMp4(String filename) {
//nothing
}
}
| [
"1111111q"
] | 1111111q |
945b328898bb281ebef51fff1f90dd2f199f349b | f487532281c1c6a36a5c62a29744d8323584891b | /sdk/java/src/main/java/com/pulumi/azure/apimanagement/inputs/IdentityProviderFacebookState.java | ac17017db51603692760c471cbd6f725a401241b | [
"BSD-3-Clause",
"MPL-2.0",
"Apache-2.0"
] | permissive | pulumi/pulumi-azure | a8f8f21c46c802aecf1397c737662ddcc438a2db | c16962e5c4f5810efec2806b8bb49d0da960d1ea | refs/heads/master | 2023-08-25T00:17:05.290397 | 2023-08-24T06:11:55 | 2023-08-24T06:11:55 | 103,183,737 | 129 | 57 | Apache-2.0 | 2023-09-13T05:44:10 | 2017-09-11T20:19:15 | Java | UTF-8 | Java | false | false | 5,846 | java | // *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.azure.apimanagement.inputs;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;
public final class IdentityProviderFacebookState extends com.pulumi.resources.ResourceArgs {
public static final IdentityProviderFacebookState Empty = new IdentityProviderFacebookState();
/**
* The Name of the API Management Service where this Facebook Identity Provider should be created. Changing this forces a new resource to be created.
*
*/
@Import(name="apiManagementName")
private @Nullable Output<String> apiManagementName;
/**
* @return The Name of the API Management Service where this Facebook Identity Provider should be created. Changing this forces a new resource to be created.
*
*/
public Optional<Output<String>> apiManagementName() {
return Optional.ofNullable(this.apiManagementName);
}
/**
* App ID for Facebook.
*
*/
@Import(name="appId")
private @Nullable Output<String> appId;
/**
* @return App ID for Facebook.
*
*/
public Optional<Output<String>> appId() {
return Optional.ofNullable(this.appId);
}
/**
* App Secret for Facebook.
*
*/
@Import(name="appSecret")
private @Nullable Output<String> appSecret;
/**
* @return App Secret for Facebook.
*
*/
public Optional<Output<String>> appSecret() {
return Optional.ofNullable(this.appSecret);
}
/**
* The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.
*
*/
@Import(name="resourceGroupName")
private @Nullable Output<String> resourceGroupName;
/**
* @return The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.
*
*/
public Optional<Output<String>> resourceGroupName() {
return Optional.ofNullable(this.resourceGroupName);
}
private IdentityProviderFacebookState() {}
private IdentityProviderFacebookState(IdentityProviderFacebookState $) {
this.apiManagementName = $.apiManagementName;
this.appId = $.appId;
this.appSecret = $.appSecret;
this.resourceGroupName = $.resourceGroupName;
}
public static Builder builder() {
return new Builder();
}
public static Builder builder(IdentityProviderFacebookState defaults) {
return new Builder(defaults);
}
public static final class Builder {
private IdentityProviderFacebookState $;
public Builder() {
$ = new IdentityProviderFacebookState();
}
public Builder(IdentityProviderFacebookState defaults) {
$ = new IdentityProviderFacebookState(Objects.requireNonNull(defaults));
}
/**
* @param apiManagementName The Name of the API Management Service where this Facebook Identity Provider should be created. Changing this forces a new resource to be created.
*
* @return builder
*
*/
public Builder apiManagementName(@Nullable Output<String> apiManagementName) {
$.apiManagementName = apiManagementName;
return this;
}
/**
* @param apiManagementName The Name of the API Management Service where this Facebook Identity Provider should be created. Changing this forces a new resource to be created.
*
* @return builder
*
*/
public Builder apiManagementName(String apiManagementName) {
return apiManagementName(Output.of(apiManagementName));
}
/**
* @param appId App ID for Facebook.
*
* @return builder
*
*/
public Builder appId(@Nullable Output<String> appId) {
$.appId = appId;
return this;
}
/**
* @param appId App ID for Facebook.
*
* @return builder
*
*/
public Builder appId(String appId) {
return appId(Output.of(appId));
}
/**
* @param appSecret App Secret for Facebook.
*
* @return builder
*
*/
public Builder appSecret(@Nullable Output<String> appSecret) {
$.appSecret = appSecret;
return this;
}
/**
* @param appSecret App Secret for Facebook.
*
* @return builder
*
*/
public Builder appSecret(String appSecret) {
return appSecret(Output.of(appSecret));
}
/**
* @param resourceGroupName The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.
*
* @return builder
*
*/
public Builder resourceGroupName(@Nullable Output<String> resourceGroupName) {
$.resourceGroupName = resourceGroupName;
return this;
}
/**
* @param resourceGroupName The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.
*
* @return builder
*
*/
public Builder resourceGroupName(String resourceGroupName) {
return resourceGroupName(Output.of(resourceGroupName));
}
public IdentityProviderFacebookState build() {
return $;
}
}
}
| [
"noreply@github.com"
] | pulumi.noreply@github.com |
e02d12cffcb5fc869408a583635c4a1b0ffa3def | 5e7bbfdc1e767ea9e10b9369e9d0c29552a76cec | /src/main/java/uk/gov/pay/connector/wallets/applepay/InvalidApplePayPaymentDataException.java | 057fe136fc1df5955ed83a1a8b7ca986a9a6535c | [
"LicenseRef-scancode-proprietary-license",
"MIT"
] | permissive | alphagov/pay-connector | ec78a56ca64d1958db9e94f437724817219ced6f | 197c2e5c85f1a1ed3a02bc6927cd2fecc94ce81e | refs/heads/master | 2023-09-01T12:02:57.312143 | 2023-08-31T12:51:43 | 2023-08-31T12:51:43 | 39,890,257 | 18 | 19 | MIT | 2023-09-14T08:01:53 | 2015-07-29T11:38:35 | Java | UTF-8 | Java | false | false | 265 | java | package uk.gov.pay.connector.wallets.applepay;
import javax.ws.rs.BadRequestException;
public class InvalidApplePayPaymentDataException extends BadRequestException {
public InvalidApplePayPaymentDataException(String message) {
super(message);
}
}
| [
"40598480+kbottla@users.noreply.github.com"
] | 40598480+kbottla@users.noreply.github.com |
8ad5942a141550ada3c37ae763e7fcdd08da8649 | e867751f2c0348175fc67bec7ba32ef25bfc8391 | /core/src/com/mygdx/game/Screens/MenuScreen.java | 28ee7dab10b9d484cc1e09831dd4a56fb794d83d | [] | no_license | Joloso01/JolososAdventureFinal | 0d5cc8954a3967d07b1427ebfcc404c6cfd40e6a | 20c9e0bb11c37ba263d69c98a1c6dfd6204c25ef | refs/heads/master | 2023-05-03T19:31:14.834309 | 2021-05-28T17:43:33 | 2021-05-28T17:43:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,850 | java | package com.mygdx.game.Screens;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.scenes.scene2d.ui.Table;
import com.mygdx.game.JadventureMain;
import com.mygdx.game.MyWidgets.MyScreen;
import com.mygdx.game.MyWidgets.MyTextButton;
import com.mygdx.game.NakamaController.NakamaSessionManager;
public class MenuScreen extends MyScreen {
Table table = new Table();
NakamaSessionManager nakamaSessionManager;
SpriteBatch spriteBatch = new SpriteBatch();
Texture fondo =new Texture("backgound/battleback9.png");
public MenuScreen(JadventureMain game, NakamaSessionManager nakamaSessionManager) {
super(game);
this.nakamaSessionManager = nakamaSessionManager;
}
@Override
public void show(){
MyTextButton unirseALaPartida = new MyTextButton("Unirse a la partida");
MyTextButton logOut = new MyTextButton("Cerrar Sesion");
table.add(unirseALaPartida);
table.row().spaceTop(20);
table.add(logOut);
unirseALaPartida.onClick(() -> {
nakamaSessionManager.unirsePartida();
nakamaSessionManager.unirseChat();
setScreen(new GameScreen(game,nakamaSessionManager));
});
logOut.onClick(() -> System.exit(1));
stage.addActor(table);
}
@Override
public void render(float delta) {
super.render(delta);
table.setPosition(320,240);
Gdx.gl.glClearColor(0.5f, 0.7f, 1, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
spriteBatch.setProjectionMatrix(camera.combined);
spriteBatch.begin();
spriteBatch.draw(fondo, 0, 0, 640, 480);
table.draw(spriteBatch,1f);
spriteBatch.end();
}
} | [
"jbermejop01@elpuig.xeill.net"
] | jbermejop01@elpuig.xeill.net |
3652fa2a6e4b438510528d61bac52f7ac3ea7b60 | dfcd3a0bfe457bd44a2997285a23b1f185de8fe3 | /spring-boot-security-db/src/main/java/com/paralun/app/config/SecurityConfiguration.java | 639d1d5f5674ceab0350078ad6fbe77614eb39a7 | [] | no_license | paralun/spring-security | f06eeaf3526f9e812ff4c42b6aca76e9e4e1b357 | fa844d3512341f7bfec81c8a372a179d67821a8a | refs/heads/master | 2020-04-27T05:47:45.369803 | 2019-03-28T09:48:33 | 2019-03-28T09:48:33 | 174,090,418 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,689 | java | package com.paralun.app.config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
import javax.sql.DataSource;
@Configuration
@EnableWebSecurity
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
@Autowired
private BCryptPasswordEncoder bCryptPasswordEncoder;
@Autowired
private DataSource dataSource;
@Value("${spring.queries.users-query}")
private String userQuery;
@Value("${spring.queries.roles-query}")
private String rolesQuery;
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.jdbcAuthentication()
.usersByUsernameQuery(userQuery)
.authoritiesByUsernameQuery(rolesQuery)
.dataSource(dataSource)
.passwordEncoder(bCryptPasswordEncoder);
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
.antMatchers("/", "/login", "/registration").permitAll()
.antMatchers("/admin").hasAuthority("ADMIN").anyRequest()
.authenticated().and().csrf().disable().formLogin()
.loginPage("/login").failureUrl("/login?error=true")
.defaultSuccessUrl("/admin/home")
.usernameParameter("email").passwordParameter("password")
.and().logout()
.logoutRequestMatcher(new AntPathRequestMatcher("/logout"))
.logoutSuccessUrl("/").and().exceptionHandling().accessDeniedPage("/access-denied");
}
@Override
public void configure(WebSecurity web) throws Exception {
web.ignoring()
.antMatchers("/resources/**", "/static/**", "/css/**", "/js/**", "/images/**");
}
@Bean
public BCryptPasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
}
| [
"kusmambang@gmail.com"
] | kusmambang@gmail.com |
0a6a99c9c1f4412d245728113e5204e49dafbf20 | dac81dba47bed920c133e1a4dc2e9486ea8fffc0 | /src/main/java/com/example/onboarding/products/application/port/out/CreateProductPort.java | 98c20d57c03fe146c957fb02861d2d640eb9d135 | [] | no_license | SindyFuentesG/onboardingLatam | 8e768aeb678e7f1bd77e6fa8fb1b80f4f42c136e | 364e9ba7ea24433b87ef8a411cfda0c97d7f7462 | refs/heads/master | 2022-12-28T12:17:01.791010 | 2020-10-01T19:47:50 | 2020-10-01T19:47:50 | 299,609,754 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 334 | java | package com.example.onboarding.products.application.port.out;
import com.example.onboarding.products.application.domain.Product;
import com.example.onboarding.products.application.domain.ProductNotCreated;
import io.vavr.control.Try;
public interface CreateProductPort {
Try<Product> createProduct(ProductNotCreated product);
}
| [
"sindy.fuentes@globant.com"
] | sindy.fuentes@globant.com |
5c03699448d420dd5b48119813223690b89b6b53 | 53d677a55e4ece8883526738f1c9d00fa6560ff7 | /com/tencent/ttpic/gles/Drawable2d.java | d3709290ef4164f1d1abbad6312bbea6eb48c91f | [] | no_license | 0jinxing/wechat-apk-source | 544c2d79bfc10261eb36389c1edfdf553d8f312a | f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d | refs/heads/master | 2020-06-07T20:06:03.580028 | 2019-06-21T09:17:26 | 2019-06-21T09:17:26 | 193,069,132 | 9 | 4 | null | null | null | null | UTF-8 | Java | false | false | 4,528 | java | package com.tencent.ttpic.gles;
import com.tencent.matrix.trace.core.AppMethodBeat;
import java.nio.FloatBuffer;
public class Drawable2d
{
private static final FloatBuffer FULL_RECTANGLE_BUF;
private static final float[] FULL_RECTANGLE_COORDS;
private static final FloatBuffer FULL_RECTANGLE_TEX_BUF;
private static final float[] FULL_RECTANGLE_TEX_COORDS;
private static final FloatBuffer RECTANGLE_BUF;
private static final float[] RECTANGLE_COORDS;
private static final FloatBuffer RECTANGLE_TEX_BUF;
private static final float[] RECTANGLE_TEX_COORDS;
private static final int SIZEOF_FLOAT = 4;
private static final FloatBuffer TRIANGLE_BUF;
private static final float[] TRIANGLE_COORDS;
private static final FloatBuffer TRIANGLE_TEX_BUF;
private static final float[] TRIANGLE_TEX_COORDS;
private int mCoordsPerVertex;
private Drawable2d.Prefab mPrefab;
private FloatBuffer mTexCoordArray;
private int mTexCoordStride;
private FloatBuffer mVertexArray;
private int mVertexCount;
private int mVertexStride;
static
{
AppMethodBeat.i(49954);
TRIANGLE_COORDS = new float[] { 0.0F, 0.5773503F, -0.5F, -0.2886751F, 0.5F, -0.2886751F };
TRIANGLE_TEX_COORDS = new float[] { 0.5F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F };
TRIANGLE_BUF = GlUtil.createFloatBuffer(TRIANGLE_COORDS);
TRIANGLE_TEX_BUF = GlUtil.createFloatBuffer(TRIANGLE_TEX_COORDS);
RECTANGLE_COORDS = new float[] { -0.5F, -0.5F, 0.5F, -0.5F, -0.5F, 0.5F, 0.5F, 0.5F };
RECTANGLE_TEX_COORDS = new float[] { 0.0F, 1.0F, 1.0F, 1.0F, 0.0F, 0.0F, 1.0F, 0.0F };
RECTANGLE_BUF = GlUtil.createFloatBuffer(RECTANGLE_COORDS);
RECTANGLE_TEX_BUF = GlUtil.createFloatBuffer(RECTANGLE_TEX_COORDS);
FULL_RECTANGLE_COORDS = new float[] { -1.0F, -1.0F, 1.0F, -1.0F, -1.0F, 1.0F, 1.0F, 1.0F };
FULL_RECTANGLE_TEX_COORDS = new float[] { 0.0F, 0.0F, 1.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F };
FULL_RECTANGLE_BUF = GlUtil.createFloatBuffer(FULL_RECTANGLE_COORDS);
FULL_RECTANGLE_TEX_BUF = GlUtil.createFloatBuffer(FULL_RECTANGLE_TEX_COORDS);
AppMethodBeat.o(49954);
}
public Drawable2d(Drawable2d.Prefab paramPrefab)
{
AppMethodBeat.i(49952);
switch (Drawable2d.1.$SwitchMap$com$tencent$ttpic$gles$Drawable2d$Prefab[paramPrefab.ordinal()])
{
default:
paramPrefab = new RuntimeException("Unknown shape ".concat(String.valueOf(paramPrefab)));
AppMethodBeat.o(49952);
throw paramPrefab;
case 1:
this.mVertexArray = TRIANGLE_BUF;
this.mTexCoordArray = TRIANGLE_TEX_BUF;
this.mCoordsPerVertex = 2;
this.mVertexStride = (this.mCoordsPerVertex * 4);
this.mVertexCount = (TRIANGLE_COORDS.length / this.mCoordsPerVertex);
case 2:
case 3:
}
while (true)
{
this.mTexCoordStride = 8;
this.mPrefab = paramPrefab;
AppMethodBeat.o(49952);
return;
this.mVertexArray = RECTANGLE_BUF;
this.mTexCoordArray = RECTANGLE_TEX_BUF;
this.mCoordsPerVertex = 2;
this.mVertexStride = (this.mCoordsPerVertex * 4);
this.mVertexCount = (RECTANGLE_COORDS.length / this.mCoordsPerVertex);
continue;
this.mVertexArray = FULL_RECTANGLE_BUF;
this.mTexCoordArray = FULL_RECTANGLE_TEX_BUF;
this.mCoordsPerVertex = 2;
this.mVertexStride = (this.mCoordsPerVertex * 4);
this.mVertexCount = (FULL_RECTANGLE_COORDS.length / this.mCoordsPerVertex);
}
}
public int getCoordsPerVertex()
{
return this.mCoordsPerVertex;
}
public FloatBuffer getTexCoordArray()
{
return this.mTexCoordArray;
}
public int getTexCoordStride()
{
return this.mTexCoordStride;
}
public FloatBuffer getVertexArray()
{
return this.mVertexArray;
}
public int getVertexCount()
{
return this.mVertexCount;
}
public int getVertexStride()
{
return this.mVertexStride;
}
public String toString()
{
AppMethodBeat.i(49953);
String str;
if (this.mPrefab != null)
{
str = "[Drawable2d: " + this.mPrefab + "]";
AppMethodBeat.o(49953);
}
while (true)
{
return str;
str = "[Drawable2d: ...]";
AppMethodBeat.o(49953);
}
}
}
/* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes6-dex2jar.jar
* Qualified Name: com.tencent.ttpic.gles.Drawable2d
* JD-Core Version: 0.6.2
*/ | [
"172601673@qq.com"
] | 172601673@qq.com |
15f2eae5e1cc949735b90378dc0e86eca0d086aa | 38f1a348ef285eec7f76ba98630a37ecc370f830 | /webLesson01/webLesson01/src/webLesson01/NoteDAO.java | 5c0aa8548aa3a8a3a5cb50d2ea404e32b811d8c8 | [] | no_license | takupoku/weblesson01 | ba5fa82f36c408ad6e2ebc6770ec3cc3f4d58651 | 4ad87c9efcc2851a3065539aaf9e29e41002c860 | refs/heads/master | 2021-07-02T05:36:19.468316 | 2017-09-24T09:40:56 | 2017-09-24T09:40:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,887 | java | package webLesson01;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
public class NoteDAO {
Connection con = null;
PreparedStatement st = null;
ResultSet rs = null;
static final String URL = "jdbc:mysql://localhost/dictionaly";
static final String USER = "root";
static final String PW = "";
//insert
public int registNote(List<Note> note){
int result = 0;
try {
//ドライバーのロード
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection("jdbc:mysql://localhost/dictionary?useUnicode=true&characterEncoding=utf8", "root", "");
//DB接続
if( con != null ){
System.out.println("DB接続完了 \r\n---");
}
else{
System.out.println("DB接続失敗\r\n---");
return result;
}
for(int i = 0 ; i < note.size() ; i++){
String SQL = "INSERT INTO word(english, japanese, exe) VALUES(?, ?, ?)";
Note nt = note.get(i);
st = con.prepareStatement(SQL);
st.setString(1, nt.getEnglish());
st.setString(2, nt.getJapanese());
st.setString(3, nt.getExe());
result = result + st.executeUpdate();
}
}
catch (ClassNotFoundException e) {
e.printStackTrace();
}
catch (SQLException e) {
e.printStackTrace();
}
finally {
if ( st != null) {
try {
st.close();
}
catch (SQLException e) {
e.printStackTrace();
}
}
if ( con != null) {
try {
con.close();
}
catch (SQLException e) {
e.printStackTrace();
}
}
}
return result; // 結果を返す
}
//単語一覧 select
public List<Note> getWords(){
List<Note> lists = new ArrayList<Note>();
try {
//ドライバーのロード
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection("jdbc:mysql://localhost/dictionary", "root", "");
//DB接続
if( con != null ){
System.out.println("登録済み単語一覧");
}
else{
System.out.println("DB接続失敗\r\n---");
return lists;
}
// 単語の読み出し
String SQL = "SELECT * FROM word";
st = con.prepareStatement(SQL);
rs = st.executeQuery();
while(rs.next()){
Note nt = new Note(rs.getString("english"), rs.getString("japanese"), rs.getString("exe"));
lists.add( nt );
}
System.out.println(lists);
}
catch (ClassNotFoundException e) {
e.printStackTrace();
}
catch (SQLException e) {
e.printStackTrace();
}
finally {
if ( st != null) {
try {
st.close();
}
catch (SQLException e) {
e.printStackTrace();
}
}
if ( con != null) {
try {
con.close();
}
catch (SQLException e) {
e.printStackTrace();
}
}
}
return lists; // 結果を返す
}
}
| [
"smspring0426@gmail.com"
] | smspring0426@gmail.com |
e65f3a0e9d4efc82d8eeb182d05b69487410b054 | f8e05f5f48b02716656d1760ebc084990bf0c8e6 | /chanzorweb/src/main/java/com/chanzor/office/common/xstream/DateTimeConverter.java | c616281affaf9c2a38b386bbeb19bed802a763a8 | [] | no_license | wgy1109/Office-web | 792965645918570b1b9634511096bb73ca6f7403 | 85cb072a7399cae76e6467e5f6533c0b45a1695f | refs/heads/master | 2021-06-13T16:19:48.178080 | 2017-05-09T06:06:35 | 2017-05-09T06:06:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,106 | java | package com.chanzor.office.common.xstream;
import java.util.Date;
import com.chanzor.office.common.utils.DateUtils;
import com.thoughtworks.xstream.converters.Converter;
import com.thoughtworks.xstream.converters.MarshallingContext;
import com.thoughtworks.xstream.converters.UnmarshallingContext;
import com.thoughtworks.xstream.io.HierarchicalStreamReader;
import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
/**
* XStream 日期转换类
* @author WangZhen
*/
public class DateTimeConverter implements Converter {
public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context) {
Date date = (Date) source;
if (date != null){
writer.setValue(DateUtils.formatDateTime(date));
}else{
writer.setValue("");
}
}
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) {
try{
Date date = DateUtils.parseDate(reader.getValue());
return date;
}catch (Exception e) {
return null;
}
}
@SuppressWarnings("rawtypes")
public boolean canConvert(Class type) {
return type.equals(Date.class);
}
}
| [
"wangguangyuan@uccc.cc"
] | wangguangyuan@uccc.cc |
82dab13fd19b894aa2a794483bb9fbe63330bcd8 | a672292d00f7540e7c75fccec690bf0d75e5cc5b | /src/main/java/com/schoolmanagementsystem/db/schoolmanagementsystem_db/entity/base/ExamBase.java | 272c9e38a839347d247881c4d9fce266d0e5bc9f | [] | no_license | mboutallaka/SchoolManagementSystem | ae5bc49d879f614d0a91599d0cbf816bcf8363fc | d4767173e191a6cb9ab9eb3812bd1d19fff76ae0 | refs/heads/master | 2023-03-30T10:30:40.205636 | 2021-04-05T00:04:36 | 2021-04-05T00:04:36 | 354,669,268 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,077 | java | package com.schoolmanagementsystem.db.schoolmanagementsystem_db.entity.base;
/**
*
*
_____ _ _ _ _ _ _ _ __ _ _
| __ \ | | | (_) | | | | | (_) / _(_) |
| | | | ___ _ __ ___ | |_ ___ __| |_| |_ | |_| |__ _ ___ | |_ _| | ___
| | | |/ _ \ | '_ \ / _ \| __| / _ \/ _` | | __| | __| '_ \| / __| | _| | |/ _ \
| |__| | (_) | | | | | (_) | |_ | __/ (_| | | |_ | |_| | | | \__ \ | | | | | __/
|_____/ \___/ |_| |_|\___/ \__| \___|\__,_|_|\__| \__|_| |_|_|___/ |_| |_|_|\___|
* DO NOT EDIT THIS FILE!!
*
* FOR CUSTOMIZE ExamBase PLEASE EDIT ../Exam.java
*
* -- THIS FILE WILL BE OVERWRITTEN ON THE NEXT SKAFFOLDER CODE GENERATION --
*
*/
/**
* This is the model of Exam object
*
*/
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Date;
import java.math.BigDecimal;
import org.springframework.jdbc.core.RowMapper;
import com.schoolmanagementsystem.db.schoolmanagementsystem_db.entity.Exam;
public class ExamBase implements RowMapper<Exam>{
private Long _id;
// Attributes
private String place;
private Double score;
private Boolean valid;
// Relations _course
private String _course;
// Relations _student
private String _student;
// Relations _teacher
private String _teacher;
@Override
public Exam mapRow(ResultSet rs, int rowNum) throws SQLException {
Exam obj = new Exam();
try {
obj.set_id(rs.getLong("id"));
obj.setPlace(rs.getString("place"));
obj.setScore(rs.getDouble("score"));
obj.setValid(rs.getBoolean("valid"));
// Relations 1:m _course
obj.set_course(rs.getString("_course"));
// Relations 1:m _student
obj.set_student(rs.getString("_student"));
// Relations 1:m _teacher
obj.set_teacher(rs.getString("_teacher"));
}
catch(Exception e) {
e.printStackTrace();
}
return obj;
}
public Long get_id() {
return _id;
}
public void set_id(Long _id) {
this._id = _id;
}
public String getPlace() {
return place;
}
public void setPlace(String place) {
this.place = place;
}
public Double getScore() {
return score;
}
public void setScore(Double score) {
this.score = score;
}
public Boolean getValid() {
return valid;
}
public void setValid(Boolean valid) {
this.valid = valid;
}
// Relations 1:m _course
public String get_course() {
return _course;
}
public void set_course(String _course) {
this._course = _course;
}
// Relations 1:m _student
public String get_student() {
return _student;
}
public void set_student(String _student) {
this._student = _student;
}
// Relations 1:m _teacher
public String get_teacher() {
return _teacher;
}
public void set_teacher(String _teacher) {
this._teacher = _teacher;
}
} | [
"mboutallaka4@gmail.com"
] | mboutallaka4@gmail.com |
8b25fb74330430a5c276d3d49ff0c5b763543239 | 96372cd2d740a2dcc3272acb97077eda9336ef03 | /2019-4-20/Scanner/src/StringStore.java | 3ab91ff93e107b4fcaf1549205aec9cd1fd4a2b3 | [] | no_license | pc-v2/JavaOOPDasar | fb6cc084bf52637da4aafbcc7e9fb605e250d819 | 7237d0479e1b603bcace11da1f346652e59845aa | refs/heads/master | 2023-06-10T13:19:04.809165 | 2021-07-04T07:43:47 | 2021-07-04T07:43:47 | 318,773,736 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 779 | java | import java.util.Scanner;
public class StringStore {
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);
System.out.println("Masukan Jumlah String");
int jmlString = Integer.parseInt(scan.nextLine());
// Buat String buat nyimpen nilai di array
String[] arrayNya = new String[jmlString];
for (int i = 0; i<arrayNya.length; i++)
{
System.out.println("Masukan Stringnya" + (i+1) + " : ");
arrayNya[i] = scan.nextLine();
}
// Show up nilai yang kita simpen
for (int i = 0 ; i<arrayNya.length ; i++)
{
System.out.println("Stting : " +(i+1) +" : ");
System.out.println(arrayNya[i]+"\n");
}
}
}
| [
"meguminxkazuma@protonmail.com"
] | meguminxkazuma@protonmail.com |
b05f183a90f28172ff7c1c4bf0e242c44bb3ebc2 | 20febc270ed848cc3986f7b7712d8346f8cff810 | /mail-app-business/src/main/java/com/test/mail/app/business/managers/UserDetailsValidator.java | 70e7988e112f3b2e89da3fb3f9ed2d3ec5646d37 | [] | no_license | tigrankhojoyan/MailApp | 5e51f86aefd02f49b6161b94d6249a087ac68167 | 11c1ddc4d0d9d753e27deae4ed6a6ade084b27e2 | refs/heads/master | 2021-01-09T23:35:40.514175 | 2019-03-15T14:21:52 | 2019-03-15T14:21:52 | 73,214,700 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,976 | java | package com.test.mail.app.business.managers;
import com.test.mail.app.business.exceptions.BusinessException;
import com.test.mail.app.business.exceptions.InvalidUserDetailsBusinessException;
import com.test.mail.app.dao.entities.UserDetails;
import org.apache.commons.validator.routines.LongValidator;
import org.joda.time.LocalDate;
import java.util.Calendar;
/**
* Created by tigran on 12/14/16.
*/
public final class UserDetailsValidator {
/**
* Validates the details of the (userDetails parameter).
*
* @param userDetails
* @throws BusinessException
*/
public static void validateUserDetails(UserDetails userDetails) throws InvalidUserDetailsBusinessException {
if(userDetails == null) {
throw new InvalidUserDetailsBusinessException("UserDetails can't be NULL");
}
// validateId(userDetails.getUserDataId());
validateBirthDate(userDetails.getBirthDate());
}
/**
* Checks if the 'id' parameter is valid.
*
* @param id
* @throws BusinessException
*/
private static void validateId(Long id) throws InvalidUserDetailsBusinessException {
if (id != null && !LongValidator.getInstance().isInRange(id, 0, Long.MAX_VALUE)) {
throw new InvalidUserDetailsBusinessException(
String.format("The userID must be between %d and %d", 0, Long.MAX_VALUE));
}
}
/**
* Validates the age of user.
*
* @param date
* @throws BusinessException
*/
private static void validateBirthDate(LocalDate date) throws InvalidUserDetailsBusinessException {
if(date != null && date.getYear() > Calendar.getInstance().get(Calendar.YEAR) - 10 ||
date.getYear() < Calendar.getInstance().get(Calendar.YEAR) - 100) {
throw new InvalidUserDetailsBusinessException(
String.format("Invalid age of user(%s)", date.toDate().toString()));
}
}
}
| [
"tigrankhojoyan@mail.ru"
] | tigrankhojoyan@mail.ru |
487f047040f48389d4d1026f2d19f6f4b47102f6 | 4a497bd4160800dcaca6f1ebba97aab853c3ffca | /ch04/item_19/ex19-3.java | 42766352a81c02765a76e6bb15cdce872bdc86a8 | [] | no_license | freebz/Effective-Java-2-E | 09e0ed512d719ace3870fccf0d1af3db97e72c17 | fc42a121611cc059fe07fe3a7f5dc579ce3ba9a2 | refs/heads/master | 2020-03-17T09:12:18.971356 | 2019-08-12T01:59:54 | 2019-08-12T01:59:54 | 133,465,611 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 326 | java | // 정적 임포트 기능을 활용해 상수 이름 앞의 클래스명 제거
import static com.effectivejava.science.PhysicalConstants.*;
public class Test {
double atoms(double mols) {
return AVOGADROS_NUMBER * mols;
}
...
// PhysicalConstants을 사용할 일이 많다면 정적 임포트가 적절
}
| [
"freebz@hananet.net"
] | freebz@hananet.net |
67145cfbbe62224be1ce7c1e9474695bcfe23450 | 83bba2f7f6a712901af336d6de0bd810ff55888a | /app/src/main/java/com/example/arvaria/UpdateRecordActivity.java | 2c5c0e96cba514c8566755c381e6007e590495ec | [] | no_license | Ritik8937/Inventory-Management-App | 282764f625900bc4f3b6a5f761323678695e524c | 8110b055429b1dd102dc79c82a0e50f9417ce9fc | refs/heads/master | 2022-12-04T10:23:54.957282 | 2020-09-01T19:42:04 | 2020-09-01T19:42:04 | 292,091,129 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,585 | java | package com.example.arvaria;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
public class UpdateRecordActivity extends AppCompatActivity {
private EditText mNameEditText;
private EditText mAgeEditText;
private EditText mOccupationEditText;
// private EditText mImageEditText;
private Button mUpdateBtn;
private PersonDBHelper dbHelper;
private long receivedPersonId;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_update_record);
//init
mNameEditText = (EditText)findViewById(R.id.userNameUpdate);
mAgeEditText = (EditText)findViewById(R.id.userAgeUpdate);
mOccupationEditText = (EditText)findViewById(R.id.userOccupationUpdate);
// mImageEditText = (EditText)findViewById(R.id.userProfileImageLinkUpdate);
mUpdateBtn = (Button)findViewById(R.id.updateUserButton);
dbHelper = new PersonDBHelper(this);
try {
//get intent to get person id
receivedPersonId = getIntent().getLongExtra("USER_ID", 1);
} catch (Exception e) {
e.printStackTrace();
}
/***populate user data before update***/
Person queriedPerson = dbHelper.getPerson(receivedPersonId);
//set field to this user data
mNameEditText.setText(queriedPerson.getName());
mAgeEditText.setText(queriedPerson.getAge());
mOccupationEditText.setText(queriedPerson.getOccupation());
// mImageEditText.setText(queriedPerson.getImage());
//listen to add button click to update
mUpdateBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//call the save person method
updatePerson();
}
});
}
private void updatePerson(){
String name = mNameEditText.getText().toString().trim();
String age = mAgeEditText.getText().toString().trim();
String occupation = mOccupationEditText.getText().toString().trim();
// String image = mImageEditText.getText().toString().trim();
if(name.isEmpty()){
//error name is empty
Toast.makeText(this, "You must enter a name", Toast.LENGTH_SHORT).show();
}
if(age.isEmpty()){
//error name is empty
Toast.makeText(this, "You must enter an age", Toast.LENGTH_SHORT).show();
}
if(occupation.isEmpty()){
//error name is empty
Toast.makeText(this, "You must enter an occupation", Toast.LENGTH_SHORT).show();
}
// if(image.isEmpty()){
// //error name is empty
// Toast.makeText(this, "You must enter an image link", Toast.LENGTH_SHORT).show();
// }
//create updated person
// Person updatedPerson = new Person(name, age, occupation, image);
Person updatedPerson = new Person(name, age, occupation);
//call dbhelper update
dbHelper.updatePersonRecord(receivedPersonId, this, updatedPerson);
//finally redirect back home
// NOTE you can implement an sqlite callback then redirect on success delete
goBackHome();
}
private void goBackHome(){
startActivity(new Intent(this, fortune_refined.class));
}
}
| [
"ritiksharmars987@gmail.com"
] | ritiksharmars987@gmail.com |
02e44a5c5c8ce8f8aea361b090af119f97663433 | 83be0285e4d4a129d7b58dff8387e7c44fbc9e85 | /src/main/java/com/vendenet/web/HistoricoBorrados.java | 7a0ca749edefbace644b4449d598bfd4ee7f8a64 | [] | no_license | jgamann/vendenet | 1a797a8a72b32db3ae44877de64fe67b1851be4b | aff5751bbbd140faa203df9a46537f247e1c0e00 | refs/heads/master | 2020-05-29T15:42:38.326808 | 2013-06-23T13:24:11 | 2013-06-23T13:24:11 | 33,147,402 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,769 | java | /*
* Creado el 06-jul-06
*
* Para cambiar la plantilla para este archivo generado vaya a
* Ventana>Preferencias>Java>Generaci�n de c�digo>C�digo y comentarios
*/
package com.vendenet.web;
import java.util.Hashtable;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.apache.log4j.Logger;
import org.hibernate.Session;
import org.hibernate.Transaction;
import com.vendenet.negocio.entidad.Usuario;
import com.vendenet.negocio.error.ErrorVendenet;
import com.vendenet.negocio.negocio.NegoHistoricoBorrados;
import com.vendenet.utilidades.HibernateUtil;
import com.vendenet.utilidades.ProcesoWebPadre;
import com.vendenet.utilidades.constantes.ConstantesVendenet;
import com.vendenet.utilidades.constantes.TextConstant;
/**
* @author TXUS
*
* Para cambiar la plantilla para este comentario de tipo generado vaya a
* Ventana>Preferencias>Java>Generaci�n de c�digo>C�digo y comentarios
*/
public class HistoricoBorrados implements ProcesoWebPadre {
private Logger logger = Logger.getLogger(HistoricoBorrados.class);
private HistoricoBorrados inicio=null;
private Hashtable hsResultados = new Hashtable();
private String strPaginaDestino="";
private final String strErrPagina = ConstantesVendenet.PAG_ERRORES;
public HistoricoBorrados(){
}
public HistoricoBorrados(HttpServletRequest req) {
Session session=HibernateUtil.getSessionFactory().openSession();
Transaction transaction = null;
try{
HttpSession sesion = req.getSession();
NegoHistoricoBorrados negoHistoricoBorrados = new NegoHistoricoBorrados();
transaction = session.beginTransaction();
Usuario usuario = null;
String fechainicio=req.getParameter("fechainicio");
String fechafin=req.getParameter("fechafin");
if(sesion.getAttribute(TextConstant.KEY_USUARIO)!=null)
usuario=(Usuario)sesion.getAttribute(TextConstant.KEY_USUARIO);
if(usuario!=null){
negoHistoricoBorrados.recogerHistorico(session,fechainicio,fechafin);
hsResultados = negoHistoricoBorrados.getHsResultados();
sesion.setAttribute(TextConstant.KEY_USUARIO, usuario);
strPaginaDestino="jsp/historico_borrados_intranet.jsp";
}else strPaginaDestino="jsp/login_intranet.jsp";
transaction.commit();
session.close();
}catch(ErrorVendenet e){
if(transaction!=null)transaction.rollback();
logger.error(e);
strPaginaDestino=strErrPagina;
}
}
public ProcesoWebPadre getInstance(HttpServletRequest req)
{
inicio = new HistoricoBorrados(req);
return inicio;
}
public Hashtable getResultados() {
return hsResultados;
}
public String getPagina() {
return strPaginaDestino;
}
}
| [
"jgamann@gmail.com@b443cb97-cc48-29f4-b756-aede5b31b882"
] | jgamann@gmail.com@b443cb97-cc48-29f4-b756-aede5b31b882 |
e9500dbe1c11e6cf8c2ce97ef0eda8b4c1950d4f | 0776156214becdab6d5ae59cd926c734ae1cc26f | /week-04/day-2_Classes/src/TeacherStudents/Main.java | bca7a9c099027a29b744091d4ae52df7d2115ba8 | [] | no_license | BPAndrea/BPAndrea | 27940087477abbe5a51904bb21980cbad1cca1a5 | 59535af20cd5cf7d5a232ff3f3a338693426a5d2 | refs/heads/master | 2020-08-07T12:20:13.422834 | 2019-05-09T15:09:57 | 2019-05-09T15:09:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 297 | java | package TeacherStudents;
public class Main {
public static void main(String[] args) {
//Test case:
Student firstStudent=new Student();
Teacher firstTeacher=new Teacher();
firstStudent.guestion(firstTeacher);
firstTeacher.teach(firstStudent);
}
}
| [
"bonnyaipap.andrea@gmail.com"
] | bonnyaipap.andrea@gmail.com |
ff02f453b3366b74841ad2d4f448f3af7eb43633 | 28236696e5608093faea0b1afa9a16d565a3ac1c | /src/main/java/com/vietage/lang17/interpreter/state/Break.java | 3d957085349d006d3afd411cfc752ae4b957d49b | [] | no_license | vietage/lang17 | 9e1c32a94b34fcd59e48d794fa5e585d63fdbd65 | f099cd8849026fc770b5f762583ec4ec7873f15e | refs/heads/master | 2021-05-23T05:47:30.218815 | 2018-10-29T17:26:41 | 2018-10-29T17:26:41 | 94,923,166 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 903 | java | package com.vietage.lang17.interpreter.state;
import com.vietage.lang17.interpreter.Runtime;
import com.vietage.lang17.lexer.Position;
import com.vietage.lang17.parser.ast.PositionalElement;
import com.vietage.lang17.parser.ast.statement.BreakStatement;
public class Break implements State, PositionalElement {
private final BreakStatement breakStatement;
public Break(BreakStatement breakStatement) {
this.breakStatement = breakStatement;
}
@Override
public void run(Runtime runtime) {
while (runtime.hasState()) {
State state = runtime.getState();
if (state instanceof WhileBody) {
runtime.exitState();
return;
} else {
runtime.exitState();
}
}
}
@Override
public Position getPosition() {
return breakStatement.getPosition();
}
}
| [
"vietopk@gmail.com"
] | vietopk@gmail.com |
2f1faebd307774458c69141220977b281dfa3404 | 5062e1660d52a035ab5f64ed4e8cfe00596c2543 | /core/src/com/mygdx/game/Exercise_1.java | c5f310b87520b089c5aa5acef0f80a7bb1f5849e | [] | no_license | mikkel21/ProgArk-1 | f9326e88ae34945c0669de4eabfa5ed97b73a383 | 22c4f9e8a6b8081cc2c96324795490d9cc0e60fe | refs/heads/master | 2020-04-19T04:29:08.523724 | 2019-02-11T09:23:09 | 2019-02-11T09:23:09 | 167,963,825 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 868 | java | package com.mygdx.game;
import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.mygdx.game.states.GameStateManager;
import com.mygdx.game.states.MenuState;
public class Exercise_1 extends ApplicationAdapter {
public static final int WIDTH=800;
public static final int HEIGHT=800;
public static final String TITLE="Exercise 1";
private GameStateManager gsm;
private SpriteBatch batch;
@Override
public void create () {
batch = new SpriteBatch();
gsm = new GameStateManager();
Gdx.gl.glClearColor(0,0,0,1);
gsm.push(new MenuState(gsm));
}
@Override
public void render () {
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
gsm.update(Gdx.graphics.getDeltaTime());
gsm.render(batch);
}
@Override
public void dispose () {
}
}
| [
"mbnygard@stud.ntnu.no"
] | mbnygard@stud.ntnu.no |
f8bfb1a40101c69da6b823358ae8074e9aa59ec8 | c6b7697a3f2011e84fd466b8e6500e73ae33fe34 | /src/java/com/entities/MunicipiosConverter.java | 016221f966c8cdf73ae5ba71b99eb5c9976d5ca2 | [] | no_license | chepex/test1 | ee2d99e33e14eaeffefb029329de11cfc9a8977a | 3e295c9040fd7836fb2cfec6402a6269ba893d38 | refs/heads/master | 2021-01-01T05:39:43.097536 | 2014-04-11T14:27:50 | 2014-04-11T14:27:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,395 | java | package com.entities;
import com.entities.Municipios;
import com.entities.MunicipiosFacade;
import com.entities.util.JsfUtil;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
@ManagedBean
public class MunicipiosConverter implements Converter {
@EJB
private MunicipiosFacade ejbFacade;
private static final String SEPARATOR = "#";
private static final String SEPARATOR_ESCAPED = "\\#";
@Override
public Object getAsObject(FacesContext facesContext, UIComponent component, String value) {
if (value == null || value.length() == 0 || JsfUtil.isDummySelectItem(component, value)) {
return null;
}
return this.ejbFacade.find(getKey(value));
}
com.entities.MunicipiosPK getKey(String value) {
com.entities.MunicipiosPK key;
String values[] = value.split(SEPARATOR_ESCAPED);
key = new com.entities.MunicipiosPK();
key.setCodPais(Short.parseShort(values[0]));
key.setCodDepto(Short.parseShort(values[1]));
key.setCodMuni(Short.parseShort(values[2]));
key.setCodZona(Integer.parseInt(values[3]));
return key;
}
String getStringKey(com.entities.MunicipiosPK value) {
StringBuffer sb = new StringBuffer();
sb.append(value.getCodPais());
sb.append(SEPARATOR);
sb.append(value.getCodDepto());
sb.append(SEPARATOR);
sb.append(value.getCodMuni());
sb.append(SEPARATOR);
sb.append(value.getCodZona());
return sb.toString();
}
@Override
public String getAsString(FacesContext facesContext, UIComponent component, Object object) {
if (object == null
|| (object instanceof String && ((String) object).length() == 0)) {
return null;
}
if (object instanceof Municipios) {
Municipios o = (Municipios) object;
return getStringKey(o.getMunicipiosPK());
} else {
Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "object {0} is of type {1}; expected type: {2}", new Object[]{object, object.getClass().getName(), Municipios.class.getName()});
return null;
}
}
}
| [
"mmixco@mmixco-OptiPlex-790"
] | mmixco@mmixco-OptiPlex-790 |
4d6b73aeb66112edb7ecb6858afb0d87af115d76 | 2255f14624f426795e467465188d33f23868d045 | /api/pacman-api-compliance/src/main/java/com/tmobile/pacman/api/compliance/domain/IssueExceptionResponse.java | 950068469ae239c452656d6d66b9a6ee00101bdb | [
"Apache-2.0"
] | permissive | sajeer-nooh/pacbot | 078a5178e08ccdfbca6c3a5d94b2ef19d9b40944 | aa9afde5072ed19fe37a04ab25b5f87342b3f5ae | refs/heads/master | 2020-04-30T22:57:14.193272 | 2020-01-21T08:15:00 | 2020-01-21T08:15:00 | 177,132,203 | 1 | 1 | Apache-2.0 | 2020-01-21T08:15:01 | 2019-03-22T11:59:19 | Java | UTF-8 | Java | false | false | 1,304 | java | /*******************************************************************************
* Copyright 2018 T Mobile, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. 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.tmobile.pacman.api.compliance.domain;
import java.util.List;
public class IssueExceptionResponse {
List<String> failedIssueIds;
String Status;
public List<String> getFailedIssueIds() {
return failedIssueIds;
}
public void setFailedIssueIds(List<String> failedIssueIds) {
this.failedIssueIds = failedIssueIds;
}
public String getStatus() {
return Status;
}
public void setStatus(String status) {
Status = status;
}
}
| [
"kumar.kamal@gmail.com"
] | kumar.kamal@gmail.com |
06bd87f71589f8564524e3f1cb4e1255653c49aa | 8501e286832a36ed033b4220fb5e281f4b57e585 | /SampleB_6_7_弹簧质点模型模拟球网/app/src/main/java/com/bn/Sample6_7/Sample6_7Activity.java | dae8b8028ed60573c5bf43f9139a82da978b4002 | [] | no_license | CatDroid/OpenGLES3xGame | f8b2e88dffdbac67078c04f166f2fc42cf92cc67 | 6e066ceeb238836c623135871674337b4a8b4992 | refs/heads/master | 2021-05-16T15:30:08.674603 | 2020-12-20T09:32:28 | 2020-12-20T09:32:28 | 119,228,042 | 24 | 9 | null | null | null | null | UTF-8 | Java | false | false | 939 | java | package com.bn.Sample6_7;
import android.os.Bundle;
import android.app.Activity;
import android.content.pm.ActivityInfo;
import android.view.Window;
import android.view.WindowManager;
public class Sample6_7Activity extends Activity {
MysurfaceView mysurfaceView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//设置为全屏
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN ,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
//设置为竖屏模式
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
mysurfaceView=new MysurfaceView(this);
mysurfaceView.requestFocus();
mysurfaceView.setFocusableInTouchMode(true);
setContentView(mysurfaceView);
}
@Override
protected void onPause() {
super.onPause();
mysurfaceView.onPause();
}
}
| [
"1198432354@qq.com"
] | 1198432354@qq.com |
4f1a0ed063bf010e47c3ba748a25c6821ee1a92c | 68b6c4ac1d87e36ed1e1a0efcadc097433bed47d | /eclipse-emf-udima/es.udima.cesarlaso.tfm/src/es/udima/cesarlaso/tfm/timers/Cron.java | 8a1acd59f8108cb5fed21dfca4f0044d8a2cbd66 | [
"Apache-2.0"
] | permissive | cesarlaso/tfm-udima-arquitectura-del-software-dsl-ecore-xtext-emf | 32fd212957a2236dce54be6756e887f0e9b69995 | 62c3198a36466f90b248a141b5b76e4cc460abb0 | refs/heads/master | 2020-03-20T23:43:50.001164 | 2018-06-19T08:08:53 | 2018-06-19T08:08:53 | 137,860,164 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,254 | java | /**
*/
package es.udima.cesarlaso.tfm.timers;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Cron</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* </p>
* <ul>
* <li>{@link es.udima.cesarlaso.tfm.timers.Cron#getValue <em>Value</em>}</li>
* </ul>
*
* @see es.udima.cesarlaso.tfm.timers.TimersPackage#getCron()
* @model
* @generated
*/
public interface Cron extends Timer {
/**
* Returns the value of the '<em><b>Value</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Value</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Value</em>' attribute.
* @see #setValue(String)
* @see es.udima.cesarlaso.tfm.timers.TimersPackage#getCron_Value()
* @model required="true"
* @generated
*/
String getValue();
/**
* Sets the value of the '{@link es.udima.cesarlaso.tfm.timers.Cron#getValue <em>Value</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Value</em>' attribute.
* @see #getValue()
* @generated
*/
void setValue(String value);
} // Cron
| [
"cesar@cesarlaso.com"
] | cesar@cesarlaso.com |
7918808f8da3e2b1628284f8338a57827730a81e | d3ca37ee8946e1d45affc5fc285e7cd51aca4747 | /src/test/java/com/xiao/sweb/algorithm/advancedSctructure/binarySearchTree/RecoverTree.java | 6278c3b440bd450885f3e8917905b20710c009a0 | [] | no_license | Carry-on/sweb | e0c577483b70435986ab16e33f835d000d48ba4c | db3dd28ecb933c5c587e90dae00c303d214adaf5 | refs/heads/master | 2023-08-31T23:52:39.691771 | 2023-08-31T07:45:07 | 2023-08-31T07:45:07 | 242,160,181 | 0 | 0 | null | 2022-04-27T21:48:55 | 2020-02-21T14:38:47 | Java | UTF-8 | Java | false | false | 1,591 | java | package com.xiao.sweb.algorithm.advancedSctructure.binarySearchTree;
import com.xiao.sweb.algorithm.TreeNode;
import java.util.LinkedList;
import java.util.List;
/**
* 99. 恢复二叉搜索树
*/
public class RecoverTree {
public void recoverTree(TreeNode root) {
List<Integer> nums = new LinkedList<>();
inorder(root, nums);
int[] swaped = findTwoSwaped(nums);
recover(root, 2, swaped[0], swaped[1]);
}
private void recover(TreeNode root, int count, int x, int y) {
if (root != null) {
if (root.val == x || root.val == y) {
root.val = root.val == x ? y : x;
if (--count == 0){
return;
}
}
recover(root.right, count, x, y);
recover(root.left, count, x, y);
}
}
private int[] findTwoSwaped(List<Integer> nums) {
int index1 = -1, index2 = -1;
for (int i = 0; i < nums.size() - 1; i++) {
if (nums.get(i + 1) < nums.get(i)) {
index2 = i + 1;
if (index1 == -1) {
index1 = i;
} else {
break;
}
}
}
return new int[]{nums.get(index1), nums.get(index2)};
}
private void inorder(TreeNode root, List<Integer> nums) {
if (root == null) {
return;
}
inorder(root.left, nums);
nums.add(root.val);
inorder(root.right, nums);
}
}
| [
"xiaoyu@lrhealth.com"
] | xiaoyu@lrhealth.com |
358785acc9663ba352460b8cdd8306ecc09432fd | c816ff9dc4960fc5f2ac9fc747823f11b5e815c6 | /DiffJ/src/org/incava/diffj/params/ParameterNoMatch.java | f5ff202f05f434f863d5959ee41db6342e1953eb | [] | no_license | danielcalencar/raszzprime | 11ee9f2cd00e3478a522c50199533018e15dd1a0 | 10d624008a8f1f446bcbcbc4bf1e052e3f4c00c1 | refs/heads/master | 2022-10-25T23:20:20.180943 | 2022-10-04T01:15:24 | 2022-10-04T01:15:24 | 207,686,552 | 9 | 11 | null | 2023-09-14T03:44:07 | 2019-09-11T00:15:56 | Java | UTF-8 | Java | false | false | 659 | java | package org.incava.diffj.params;
import net.sourceforge.pmd.ast.ASTFormalParameter;
import net.sourceforge.pmd.ast.Token;
import org.incava.diffj.element.Differences;
public class ParameterNoMatch extends ParameterMatch {
public ParameterNoMatch(ASTFormalParameter fromFormalParam, int index, int typeMatch, int nameMatch, Parameters toParams) {
super(fromFormalParam, index, typeMatch, nameMatch, toParams);
}
public void diff(Differences differences) {
Token fromNameTk = getParameterName();
differences.changed(fromFormalParam, toParams.getFormalParameters(), Parameters.PARAMETER_REMOVED, fromNameTk.image);
}
}
| [
"daniel.calencar@gmail.com"
] | daniel.calencar@gmail.com |
3109a8e238d46187b68ddd6b8ebcbd869126a24b | ecdfb2677d41ad2c405d663a3a21526b0897597e | /src/com/jiandande/review/transcation/LoginAction.java | b4669be8426018ebed974191c6fce3b4ef9cffae | [] | no_license | jiandande/fans | 504c9a1abc222e131695e5ab75d4344a520945d8 | 0826c585e7802a77a97e56b2fb0ea1fc6f98779a | refs/heads/master | 2020-03-19T09:07:36.148771 | 2018-06-06T09:09:19 | 2018-06-06T09:09:19 | 136,261,694 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,023 | java | package com.jiandande.review.transcation;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONException;
import org.json.JSONObject;
//import com.palmpay.realname.util.TestData;
import com.jiandande.review.transfer.HttpCodeHelper;
import com.jiandande.review.util.LogUtil;
import com.jiandande.review.util.Constants.ParamName;
import com.jiandande.review.util.Constants.ServerUrl;
/**
* @author shimingzheng
* @version 创建时间:2013-12-18 下午4:49:26 说明:
*/
public class LoginAction extends AbstractTransaction {
class LoginActionSend {
String password;// 密码
String loginName;// 登录名或者手机号码
String ip;
}
public class LoginActionRespond {
public String respCode;
public String respDesc;
public String custId;
public String realName;
public String phoneNum;
public String hxMerchantId;
public String currentPsam;
public String sessionId;// 会话id
public String status;// 状态
public String accountStatus;
public String authStatus;
public String settleAccountType;
}
private static final String XML_TAG = "LoginAction";
public LoginAction() {
url = ServerUrl.clientLogin;
sendData = new LoginActionSend();
respondData = new LoginActionRespond();
}
private LoginActionSend sendData;
public LoginActionRespond respondData;
@Override
protected ArrayList<NameValuePair> transPackage() {
ArrayList<NameValuePair> params = new ArrayList<NameValuePair>();
super.initParamData(params);
NameValuePair namePair = new BasicNameValuePair(ParamName.USERNAME,
sendData.loginName);
params.add(namePair);
NameValuePair passwordPair = new BasicNameValuePair(ParamName.PASSWORD,
sendData.password);
params.add(passwordPair);
NameValuePair ipPair = new BasicNameValuePair("ip",
sendData.ip);
params.add(ipPair);
return params;
}
@Override
protected boolean transParse(InputStream inputStream) {
LogUtil.i(XML_TAG, "开始解析inputStream");
/**
* 采用pull解析方式:XmlPullParser采用驱动解析,占用内存少,无需一次性加载数据
*/
String json = null;
if (inputStream == null) {
//json = TestData.creatLoginData();
respondData.respCode = HttpCodeHelper.ERROR;
return false;
} else {
json = readInputStream(inputStream);
}
LogUtil.i(XML_TAG, "json:" + json);
try {
resloveLoginResult(json);
} catch (JSONException e) {
e.printStackTrace();
return false;
} catch (Exception e) {
e.printStackTrace();
return false;
}
return true;
}
void resloveLoginResult(String response) throws JSONException, IOException {
JSONObject object = super.processResult(response);
if (object == null) {
respondData.respCode = HttpCodeHelper.HTTP_REQUEST_ERROR;
} else {
try {
respondData.respCode = object.getString(ParamName.RESD_CODE);
respondData.respDesc = object.getString(ParamName.RESD_DESC);
if(HttpCodeHelper.RESPONSE_SUCCESS.equals(respondData.respCode)){
respondData.custId = object.getString("custId");
respondData.phoneNum = object.getString("phoneNum");
respondData.realName = object.getString("realName");
respondData.sessionId = object.getString("sessionId");
respondData.status = object.getString("status");
respondData.accountStatus = object.getString("accountStatus");
respondData.authStatus = object.getString("authStatus");
respondData.currentPsam = object.getString("currentPsam");
respondData.hxMerchantId = object.getString("hxMerchantId");
respondData.settleAccountType = object.getString("settleAccountType");
}
} catch (JSONException e) {
e.printStackTrace();
}
}
}
public void setUserName(String userName) {
sendData.loginName = userName;
}
public void setPassword(String password) {
sendData.password = password;
}
public void setIp(String ip) {
sendData.ip = ip;
}
}
| [
"admin@jiandande.com"
] | admin@jiandande.com |
e40a4f7acbbaf2cac9c5b435f9667ebc2a77bb3f | ae425be2bf1fff26d5ce49364dcdfc818627486c | /src/main/java/com/can/config/ShiroConfig.java | 106089e65c4a8ae59ae595ccc624df73f9436b45 | [] | no_license | hhhChan/jave_shrdingJDBC | 39a7e455f59c59a1ae0ab161de71dd30e987418f | 5cc5c45a62f8777cd77127a1a14031d11b821acc | refs/heads/master | 2023-06-11T07:15:51.776466 | 2021-07-08T05:21:13 | 2021-07-08T05:21:13 | 326,892,840 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,007 | java | package com.can.config;
import com.can.shiro.UserRealm;
import org.apache.shiro.spring.web.ShiroFilterFactoryBean;
import org.apache.shiro.web.mgt.DefaultWebSecurityManager;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.LinkedHashMap;
import java.util.Map;
@Configuration
public class ShiroConfig {
//shiroFilterFactoryBean
@Bean
public ShiroFilterFactoryBean getShiroFilterFactoryBean(@Qualifier("securityManager") DefaultWebSecurityManager defaultWebSecurityManager){
ShiroFilterFactoryBean bean = new ShiroFilterFactoryBean();
//设置安全管理器
bean.setSecurityManager(defaultWebSecurityManager);
//添加shiro内置过滤器 anon无需认证 authc必须认证 user拥有记住我功能才能用 perms 拥有某个权限 role拥有某个角色权限
//拦截
Map<String, String> filterMap = new LinkedHashMap<>();
//授权
filterMap.put("/emps","perms[user:xx]");
filterMap.put("/emps/**","perms[user:xx]");
filterMap.put("/","anon");
filterMap.put("/user/login","anon");
filterMap.put("/user/logout", "logout");
filterMap.put("/**","authc");
bean.setFilterChainDefinitionMap(filterMap);
//设置登录请求
bean.setLoginUrl("/");
//未授权页面
bean.setUnauthorizedUrl("/noauth");
return bean;
}
//DefaultWebSecurityManager
@Bean(name="securityManager")
public DefaultWebSecurityManager getDefaultWebSecurityManager(@Qualifier("userRealm") UserRealm userRealm){
DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager();
//关联realm
securityManager.setRealm(userRealm);
return securityManager;
}
//realm
@Bean
public UserRealm userRealm(){
return new UserRealm();
}
}
| [
"767811890@qq.com"
] | 767811890@qq.com |
782c8ce71b4fe6a128037e3905d90d8f7c7e9150 | 1a5306ccc7998cec91fe59cf5a25455db1ce5c88 | /BakingAppProject/BakingTime/app/src/test/java/com/bt/bakingtime/ExampleUnitTest.java | 19282f24903f0a0f41ae56c25899ba9b57bfabd1 | [] | no_license | im-aditya/learning-android | df49da0758ac1c213804918da8119fa3472fa957 | 036776d64a3b8c9d8af7ae2a59dc2c043c3e782a | refs/heads/master | 2021-08-22T02:35:55.951339 | 2017-11-29T03:46:24 | 2017-11-29T03:46:24 | 105,340,654 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 399 | java | package com.bt.bakingtime;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest
{
@Test
public void addition_isCorrect() throws Exception
{
assertEquals(4, 2 + 2);
}
} | [
"im.aditya0689@gmail.com"
] | im.aditya0689@gmail.com |
264f132b47fc7b81a7794282d01dd1572ccf5c58 | 3d93cf3df15ba2b101af2942cb72bf4d9136d1b1 | /app/src/test/java/com/highgreat/sven/encryption/RSA.java | 0724151a0d638ca7a20f79f7e96bf5196cec961c | [] | no_license | games2sven/encryption_algorithm | c63b32cbd46fded333307f63b1c05d41e0aabb8a | cc51b0ace398d2786e554625cb7ed04a15f0adc4 | refs/heads/master | 2022-07-19T11:51:42.099617 | 2020-05-22T08:48:54 | 2020-05-22T08:48:54 | 265,993,243 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,524 | java | package com.highgreat.sven.encryption;
import org.junit.Test;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.security.Key;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.SecureRandom;
import java.util.Base64;
import javax.crypto.Cipher;
public class RSA {
public static String ALGORITHM = "RSA";
//指定key的位数
public static int KEYSIZE = 1024;//65536
//指定公钥的存放文件
public static String PUBLIC_KEY_FILE = "public_key.dat";
//指定私钥的存放文件
public static String PRIVATE_KEY_FILE = "private_key.dat";
@Test
public void test() throws Exception{
//客户端用公钥加密
String content = "sven";
String encrypt = encrypt(content);
System.out.println("密文:"+encrypt);
//到了服务器后,用私钥解密
String target = decrypt(encrypt);
System.out.println("明文:"+target);
}
/**
* 生成秘钥对 公 私
*
* @throws Exception
*/
public static void generateKeyPair() throws Exception {
SecureRandom sr = new SecureRandom();
//需要一个KeyPairGenerator对象
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(ALGORITHM);
keyPairGenerator.initialize(KEYSIZE, sr);
//生成密钥对
KeyPair keyPair = keyPairGenerator.generateKeyPair();
//得到公钥
PublicKey keyPublic = keyPair.getPublic();
//得到私钥
PrivateKey keyPrivate = keyPair.getPrivate();
//可以写入文件后,这两个文件分别放到服务器和客户端
ObjectOutputStream objectOutputStream = new ObjectOutputStream(new FileOutputStream(PUBLIC_KEY_FILE));
ObjectOutputStream objectOutputStream1 = new ObjectOutputStream(new FileOutputStream(PRIVATE_KEY_FILE));
objectOutputStream.writeObject(keyPublic);
objectOutputStream1.writeObject(keyPrivate);
objectOutputStream.close();
objectOutputStream1.close();
}
/**
* 加密
*/
public static String encrypt(String source) throws Exception {
generateKeyPair();
//取出公钥
ObjectInputStream ois = new ObjectInputStream(new FileInputStream(PUBLIC_KEY_FILE));
Key key = (Key) ois.readObject();
ois.close();
//开始用公钥
Cipher cipher = Cipher.getInstance(ALGORITHM);
cipher.init(Cipher.ENCRYPT_MODE, key);
byte[] bytes = source.getBytes();
byte[] aFinal = cipher.doFinal(bytes);
Base64.Encoder encoder = Base64.getEncoder();
return encoder.encodeToString(aFinal);
}
/**
* 解密
* @param cryptText
* @return
* @throws Exception
*/
public static String decrypt(String cryptText) throws Exception {
//读文件,取到私钥
ObjectInputStream ois = new ObjectInputStream(new FileInputStream(PRIVATE_KEY_FILE));
Key key = (Key) ois.readObject();
ois.close();
//解密
Cipher cipher = Cipher.getInstance(ALGORITHM);
cipher.init(Cipher.DECRYPT_MODE, key);
Base64.Decoder decoder = Base64.getDecoder();
byte[] decode = decoder.decode(cryptText);
byte[] bytes = cipher.doFinal(decode);
return new String(bytes);
}
} | [
"zhouli@hg-fly.com"
] | zhouli@hg-fly.com |
8f5d642dbbbb688c72faf6c3daff3598e048bc24 | 67ace774d8ca01e571c02c745661b3879dce9b2d | /src/main/java/com/isacore/quality/model/Problem.java | 63a090fa816cd1b07090d691e92dafbb376944cc | [] | no_license | sistemas-imptek/ISA-Core | 0dd8f9f11322e99338fa37a043fab477960356ef | 591ebb19886e321ef4a6311099e9de82ee50cb09 | refs/heads/master | 2022-07-05T05:48:33.832936 | 2019-10-30T17:21:19 | 2019-10-30T17:21:19 | 111,817,761 | 0 | 0 | null | 2022-06-29T16:47:03 | 2017-11-23T14:16:45 | Java | UTF-8 | Java | false | false | 1,706 | java | package com.isacore.quality.model;
import java.beans.Transient;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity(name = "problem")
@Table(name = "PROBLEM")
public class Problem {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "PROBLEM_ID")
private Integer idProblem;
@Column(name = "PROBLEM_DESCRIPTION", nullable = true, length = 1024)
private String description;
@Column(name = "PROBLEM_PICTURE", nullable = true)
private String pictureStringB64;
@Column(name = "PROBLEM_NAME_FILE", nullable = true, length = 128)
private String nameFileP;
@Column(name = "PROBLEM_EXTEN_FILE", nullable = true, length = 8)
private String extensionFileP;
public Integer getIdProblem() {
return idProblem;
}
public void setIdProblem(Integer idProblem) {
this.idProblem = idProblem;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getPictureStringB64() {
return pictureStringB64;
}
public void setPictureStringB64(String pictureStringB64) {
this.pictureStringB64 = pictureStringB64;
}
public String getNameFileP() {
return nameFileP;
}
public void setNameFileP(String nameFileP) {
this.nameFileP = nameFileP;
}
public String getExtensionFileP() {
return extensionFileP;
}
public void setExtensionFileP(String extensionFileP) {
this.extensionFileP = extensionFileP;
}
}
| [
"dalpala@astsecuador.com"
] | dalpala@astsecuador.com |
b4353e032c249cb71083fab1e7bca29c19ebea92 | 4945f811df58558e1c3abd7cdcb88c35f9a4cf11 | /app/src/main/java/com/example/app/tool/MyDatabaseHelper.java | 38b89f29723e3e4b528cf5b9a2e3d4dca656bbda | [] | no_license | qzxl1314/App | 8eed52a9dbbc9b9669fcef0f19458e1bd887d10b | 4ad3100dd8b6c120794c49b0456605faed6f9af9 | refs/heads/main | 2023-03-22T03:09:46.219474 | 2021-03-16T09:45:07 | 2021-03-16T09:45:07 | 311,560,390 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 996 | java | package com.example.app.tool;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.widget.Toast;
import androidx.annotation.Nullable;
public class MyDatabaseHelper extends SQLiteOpenHelper {
private Context mContext;
public static final String CREATE_BOOK = "create table info( id integer primary key autoincrement, iBeaconid text, deviceid text, starttime datetime, endtime datetime)";
public MyDatabaseHelper(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) {
super(context, name, factory, version);
mContext = context;
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL(CREATE_BOOK);
Toast.makeText(mContext, "创建完成!", Toast.LENGTH_SHORT).show();
}
}
| [
"970595181@qq.com"
] | 970595181@qq.com |
55847cdabf4f5a49b655c9102f431fd75201ac5c | e675b01ae45562f0a3227bdf6eb1986eac568d5c | /main/src/main/java/com/uber/lobbydobem/model/Candidates.java | 8266c98ef3e7e035c12445871bd903f7d6675d4b | [] | no_license | GochiFelipe/LobbyDoBemApi | a54736a32a78669a54b7532f65fbdff476898524 | e68bd01e6cd32fbe9960416b530e267c1eb23104 | refs/heads/master | 2020-03-23T15:18:19.113465 | 2018-08-13T19:25:23 | 2018-08-13T19:25:23 | 141,736,871 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,042 | java | package com.uber.lobbydobem.model;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
@Entity
@Table(name="CANDIDATOS")
public class Candidates {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long candidatoId;
@Column
private String nome;
@OneToOne
@JoinColumn(name="partidoId")
private Partido partido;
@Column(name="url_foto")
private String urlFoto;
@Column
private String telefone;
@Column
private String fax;
@Column
private String email;
@Column
private String site;
@Column
private String facebook;
@Column
private String twitter;
@Column
private String instagram;
@Column
private String endereco;
@Column
private String andar;
@Column
private String sala;
@Column
private String state;
@ManyToMany(mappedBy="candidates")
private List<Activity> activity;
public Long getCandidatoId() {
return candidatoId;
}
public void setCandidatoId(Long candidatoId) {
this.candidatoId = candidatoId;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public Partido getPartido() {
return partido;
}
public void setPartido(Partido partido) {
this.partido = partido;
}
public String getUrlFoto() {
return urlFoto;
}
public void setUrlFoto(String urlFoto) {
this.urlFoto = urlFoto;
}
public String getTelefone() {
return telefone;
}
public void setTelefone(String telefone) {
this.telefone = telefone;
}
public String getFax() {
return fax;
}
public void setFax(String fax) {
this.fax = fax;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getSite() {
return site;
}
public void setSite(String site) {
this.site = site;
}
public String getFacebook() {
return facebook;
}
public void setFacebook(String facebook) {
this.facebook = facebook;
}
public String getTwitter() {
return twitter;
}
public void setTwitter(String twitter) {
this.twitter = twitter;
}
public String getInstagram() {
return instagram;
}
public void setInstagram(String instagram) {
this.instagram = instagram;
}
public String getEndereco() {
return endereco;
}
public void setEndereco(String endereco) {
this.endereco = endereco;
}
public String getAndar() {
return andar;
}
public void setAndar(String andar) {
this.andar = andar;
}
public String getSala() {
return sala;
}
public void setSala(String sala) {
this.sala = sala;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
}
| [
"felipeud@gmail.com"
] | felipeud@gmail.com |
3fa37ec9e81cb29c79cec384a2b8924732ab5b8f | 8fbe0030bd6e9670d20a4a9c167094483cfc8445 | /app/src/main/java/com/retrofitApi/UserRecordActivity.java | 3bcb7fb53d882236bcea4caab4fd00a14c3b1721 | [] | no_license | honeykumar8826/RetrofitApi | 538d20f96942c49040477c1e59025102c2653db0 | 2468a69cc5b903f5866353dd4f31eed24278ee98 | refs/heads/master | 2020-05-17T06:26:14.098900 | 2019-04-26T04:48:04 | 2019-04-26T04:48:04 | 183,558,728 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,366 | java | package com.retrofitApi;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.google.gson.JsonObject;
import com.retrofitApi.modal.UserInfo;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
public class UserRecordActivity extends AppCompatActivity {
private EditText etName,etSalary,etAge,etGenId;
private Button postReq;
private String uName,uSalary,uAge;
public static final String TAG ="UserRecordActivity";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_user_record);
// initialize the id
inItId();
// listener for button
postReq.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// get the value from the user
getUserInput();
if(!uName.isEmpty() && !uAge.isEmpty() && !uSalary.isEmpty())
{
// send the post reqest on the server
sendPostReq();
}
else {
Toast.makeText(UserRecordActivity.this, "Fill all field", Toast.LENGTH_SHORT).show();
}
}
});
}
private void sendPostReq() {
// create the object of the Retrofit
Retrofit retrofit = new Retrofit.Builder().baseUrl(Api.BASE_URL2)
.addConverterFactory(GsonConverterFactory.create())
.build();
Api api = retrofit.create(Api.class);
UserInfo userInfo = new UserInfo(uName,uSalary,uAge);
Call<ResponseBody> call = api.createRecord(userInfo);
call.enqueue(new Callback<ResponseBody>() {
@Override
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
try {
Log.i(TAG, "onResponse: "+response.isSuccessful());
if(response.code()==200)
{
String result = response.body().string();
JSONObject jsonObject = new JSONObject(result);
String age = jsonObject.getString("age");
String name = jsonObject.getString("name");
String salary = jsonObject.getString("salary");
String generatedId = jsonObject.getString("id");
Toast.makeText(UserRecordActivity.this, "Request Proceed Successfully", Toast.LENGTH_SHORT).show();
etName.setText(name);
etAge.setText(age);
etSalary.setText(salary);
etGenId.setText(generatedId);
etName.setEnabled(false);
etAge.setEnabled(false);
etSalary.setEnabled(false);
}
else {
Toast.makeText(UserRecordActivity.this, " Request Not Successfully Send ", Toast.LENGTH_SHORT).show();
}
} catch (IOException e) {
e.printStackTrace();
} catch (JSONException e) {
e.printStackTrace();
}
}
@Override
public void onFailure(Call<ResponseBody> call, Throwable t) {
Log.i(TAG, "onFailure: "+t.getMessage());
}
});
}
private void getUserInput() {
uName = etName.getText().toString();
uAge = etAge.getText().toString();
uSalary = etSalary.getText().toString();
}
private void inItId() {
etName = findViewById(R.id.et_name);
etAge = findViewById(R.id.et_age);
etSalary = findViewById(R.id.et_salary);
postReq = findViewById(R.id.btn_create_record);
etGenId = findViewById(R.id.et_generated_id);
}
}
| [
"harishkumar8826@gmail.com"
] | harishkumar8826@gmail.com |
5b5a69c640692f4f2766b4f3ccb3ba96c9b25ef5 | 7b59235e5cff8eae9af7cff468b7cdc188be9585 | /util/src/main/java/com/ftx/solution/kata/HumanReadableTime.java | 783a2a1e9fb75188217d3487e62653549336dbb4 | [] | no_license | paWnup/spring-cloud-demo | b688b1d249d2e5cc275470035bbafb5334dd1db9 | 4e379701422692e660e1511523ad70314460c98c | refs/heads/master | 2020-04-25T08:02:24.155902 | 2019-04-26T05:43:26 | 2019-04-26T05:43:26 | 172,633,077 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,211 | java | package com.ftx.solution.kata;
/**
* Write a function, which takes a non-negative integer (seconds) as
* input and returns the time in a human-readable format (HH:MM:SS)
* <p>
* HH = hours, padded to 2 digits, range: 00 - 99
* MM = minutes, padded to 2 digits, range: 00 - 59
* SS = seconds, padded to 2 digits, range: 00 - 59
* The maximum time never exceeds 359999 (99:59:59)
*
* @author puan
* @date 2019-04-10 13:49
**/
public class HumanReadableTime {
public static String makeReadable(int seconds) {
return String.format("%02d:%02d:%02d", seconds / 3600, (seconds / 60) % 60, seconds % 60);
}
public static String makeReadable1(int seconds) {
// Do something
if (seconds > 359999) {
return "";
}
int minutes = seconds / 60;
int second = seconds % 60;
int hour = minutes / 60;
int minute = minutes % 60;
return getTimeString(hour) + ":" + getTimeString(minute) + ":" + getTimeString(second);
}
private static String getTimeString(int timeNumber) {
if (timeNumber < 10) {
return "0" + timeNumber;
} else {
return "" + timeNumber;
}
}
}
| [
"302560960@qq.com"
] | 302560960@qq.com |
860312d7e30728266c00f062ce83bff2c69e7b58 | da2031c7781826f9f171a1def8e6deae055266bf | /penopc/src/gui/views/DebugDisplay.java | c33e540acd9e7fb1a6bc40c298688e25cec5154a | [] | no_license | SamuelLannoy/penocw-teamgeel | 239eedc01691012631a0020fda99b26028b28bac | 1d0e0c3e9fb5819730762f0206f93f2ce48df429 | refs/heads/master | 2021-01-02T22:37:49.293931 | 2013-05-20T18:17:59 | 2013-05-20T18:17:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,199 | java | package gui.views;
import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.Timer;
import javax.swing.border.EmptyBorder;
import robot.DebugBuffer;
import robot.Robot;
public class DebugDisplay extends JFrame {
private JPanel contentPane;
private Robot robot;
private Main parent;
private JTextArea robot_current_action;
private JTextArea debugwindow;
private Timer debugTimer;
private Thread debugthread = new Thread(new Runnable() {
public void run() {
debugTimer = new Timer(100, new ActionListener() {
public void actionPerformed(ActionEvent evt) {
if (robot != null) {
robot_current_action.setText(robot.getCurrentAction());
try {
// update debug info.
synchronized(DebugBuffer.getDebuginfo()) {
for(String debuginfo : DebugBuffer.getDebuginfo()) {
debugwindow.append(""+debuginfo+"\n");
}
DebugBuffer.getDebuginfo().clear();
}
}
catch (NullPointerException e) {
}
}
}
});
debugTimer.start();
}
});
/**
* Create the frame.
*/
public DebugDisplay(Robot robot, Main parent) {
this.robot = robot;
this.parent = parent;
setTitle("Debug Display");
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setBounds(500, 196, 300, 360);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
contentPane.setLayout(new BorderLayout(0, 0));
setContentPane(contentPane);
robot_current_action = new JTextArea();
robot_current_action.setBounds(10, 310, 280, 40);
contentPane.add(robot_current_action);
JScrollPane scrollPane_debugwindow = new JScrollPane();
scrollPane_debugwindow.setBounds(10, 10, 280, 280);
contentPane.add(scrollPane_debugwindow);
debugwindow = new JTextArea();
scrollPane_debugwindow.setViewportView(debugwindow);
debugthread.start();
this.setVisible(true);
}
}
| [
"Ruben@10.43.0.45"
] | Ruben@10.43.0.45 |
b567ea58e782498b47792402258c9ea009909bec | a326034d0b150368ec77888ece15b4ff3817a974 | /chapter3/FregmentTest/app/src/androidTest/java/example/anika/fregmenttest/ExampleInstrumentedTest.java | 29de69e8699156ec75cf0f0b2f725cc0256349a8 | [
"Apache-2.0"
] | permissive | anikahuo/android-learning | 4f5b861b4c0e2020c1eece4d73facf13727b7626 | 92c9146ffe0079b39f147ad94b09afac26185100 | refs/heads/master | 2021-05-09T04:25:07.682049 | 2018-01-28T16:26:18 | 2018-01-28T16:26:18 | 119,272,566 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 753 | java | package example.anika.fregmenttest;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("example.anika.fregmenttest", appContext.getPackageName());
}
}
| [
"kaiyue.huo@gmail.com"
] | kaiyue.huo@gmail.com |
b9b44a1eb3926a4b69bf70d983cf01dfbac81575 | 5127e83fb6f2c76c673a0a9d076c2ae97f2e420b | /bingo_annotation_lean/src/main/java/com/bingo/bean/Persion.java | 63f4f83dc24add8d4544bd143d3982cce7b1d90a | [] | no_license | bingbinggo/FlinkExample | 1423f641917f4fd43106ef913c924a732f9ad2ed | e115f3beb94e02589c0cbd04918ae99a9afbd3b2 | refs/heads/master | 2020-05-27T16:38:15.436098 | 2019-06-09T16:01:00 | 2019-06-09T16:01:00 | 188,705,506 | 0 | 0 | null | 2019-05-26T16:16:34 | 2019-05-26T16:16:34 | null | GB18030 | Java | false | false | 1,229 | java | package com.bingo.bean;
import org.springframework.beans.factory.annotation.Value;
public class Persion {
//使用@Value赋值;
//1、基本数值
//2、可以写SpEL; #{}
//3、可以写${};取出配置文件【properties】中的值(在运行环境变量里面的值)
@Value("张三")
private String name;
@Value("#{20-9}")
private Integer age;
@Value("${persion.nickNmae}")
private String nickName;
public Persion() {
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public Persion(String name, Integer age) {
this.name = name;
this.age = age;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
@Override
public String toString() {
return "Persion{" +
"name='" + name + '\'' +
", age=" + age +
", nickName='" + nickName + '\'' +
'}';
}
}
| [
"38630708+bingbinggo@users.noreply.github.com"
] | 38630708+bingbinggo@users.noreply.github.com |
364258a29fe4da2292ea60672a663470823134ec | 1a0501bc43b071073f166157e849fcac3792b2b4 | /src/saved/T153.java | e0ad1c405555524620bf79ea94bb7dc8d67e4aeb | [] | no_license | lzlz123/leetcode | 2972742661a8e4d9d723b645c2e3b34eff1b4798 | be0e440ec08dfff5224f06e442c9434d5e1117d5 | refs/heads/master | 2022-12-01T06:42:45.239948 | 2020-08-07T12:57:51 | 2020-08-07T12:57:51 | 285,829,115 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 442 | java | package saved;
public class T153 {
class Solution {
public int findMin(int[] nums) {
if (nums.length == 1) return nums[0];
int two = Integer.MAX_VALUE;
for (int i = 1; i < nums.length; i++) {
if (nums[i] < nums[i - 1]) {
two = nums[i];
break;
}
}
return Math.min(nums[0], two);
}
}
}
| [
"15162120501@163.com"
] | 15162120501@163.com |
f977814ddec79bdf75339601463dcbb4c15bcc6b | 2dc611030ec757dad282e852ebf2433b5535bea1 | /toolkit/src/main/java/com/xb/toolkit/utils/messenger/WeakAction.java | 7f3677a6bdbaab4c066b88b159252e7b0e093669 | [] | no_license | tunshicanyue/Tookit | d26e0197807c4094ed8460fa997cf2d3342e768d | ce946d147cdb46fe23d9c8bb40fa492fd3f36210 | refs/heads/master | 2021-06-03T15:25:31.502064 | 2020-03-03T14:56:30 | 2020-03-03T14:56:30 | 138,693,475 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,508 | java | package com.xb.toolkit.utils.messenger;
import java.lang.ref.WeakReference;
/**
* Created by zhangbw(biaoweizh@gmail.com) on 2017-12-18
* Description :
*/
public class WeakAction<T> {
private Action0 action;
private Action1<T> action1;
private boolean isLive;
private Object target;
private WeakReference reference;
public WeakAction(Object target, Action0 action) {
reference = new WeakReference(target);
this.action = action;
}
public WeakAction(Object target, Action1<T> action1) {
reference = new WeakReference(target);
this.action1 = action1;
}
public void execute() {
if (action != null && isLive()) {
action.call();
}
}
public void execute(T parameter) {
if (action1 != null
&& isLive()) {
action1.call(parameter);
}
}
public void markForDeletion() {
reference.clear();
reference = null;
action = null;
action1 = null;
}
public Action0 getAction() {
return action;
}
public Action1 getAction1() {
return action1;
}
public boolean isLive() {
if (reference == null) {
return false;
}
if (reference.get() == null) {
return false;
}
return true;
}
public Object getTarget() {
if (reference != null) {
return reference.get();
}
return null;
}
}
| [
"wubo@zhphfinance.com"
] | wubo@zhphfinance.com |
2301770a73f7402e74218506cafb73f3cbdf8caf | 316e742214d044f5cc3c430d635854ec0f0a2238 | /gmall-api/src/main/java/com/atguigu/gmall/ums/service/MemberTaskService.java | fa7d40d2f06382eab522848304a3ca3a97b6c8c8 | [] | no_license | chengxulaohan/gmall-1111 | bba45c4b1dbb0f241be389efda54d3c432d8abf7 | cdec0c63c044d95ed805159a85185160c1330233 | refs/heads/master | 2022-07-05T19:41:04.326299 | 2019-12-10T05:06:50 | 2019-12-10T05:06:50 | 227,030,095 | 0 | 0 | null | 2022-06-21T02:25:06 | 2019-12-10T04:37:34 | Java | UTF-8 | Java | false | false | 325 | java | package com.atguigu.gmall.ums.service;
import com.atguigu.gmall.ums.entity.MemberTask;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 会员任务表 服务类
* </p>
*
* @author Lfy
* @since 2019-12-08
*/
public interface MemberTaskService extends IService<MemberTask> {
}
| [
"992238879@qq.com"
] | 992238879@qq.com |
237d46ac0278f5373a2849534423402f4047a46f | 16e847161033ef18d976fc59d2d6958e727f1835 | /src/com/neco4j/graph/Operations.java | 7b544584663f4f9d5c831545116869583094d39c | [
"MIT"
] | permissive | necatikartal/leader-election-in-wireless-environments | 618b7a38d59695fefc2238ddf66984ca7a0cbf49 | 1edaf94e332da72cc85cf41a9eb4895767f58d08 | refs/heads/master | 2016-09-10T09:29:05.203941 | 2015-01-17T23:56:50 | 2015-01-17T23:56:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,122 | java | package com.neco4j.graph;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.Random;
/**
* Operations class that implements operations interface
* @author Necati Kartal
*/
public class Operations implements IOperations {
/**
* Initialize the graph
* @Each vertex has to have at least 3 edges on the graph
* @return graph
*/
@Override
public Graph initialGraph(){
Graph gr = new Graph();
Random rand = new Random();
int randomCapacity;
// create 4 vertex with random capacity between 1-100
randomCapacity = rand.nextInt(100) + 1;
gr.addVertex("1",randomCapacity);
randomCapacity = rand.nextInt(100) + 1;
gr.addVertex("2",randomCapacity);
randomCapacity = rand.nextInt(100) + 1;
gr.addVertex("3",randomCapacity);
randomCapacity = rand.nextInt(100) + 1;
gr.addVertex("4",randomCapacity);
// add the vertices to the graph and add at least 3 edge between them
gr.addEdge("1", "2");
gr.addEdge("2", "1");
gr.addEdge("1", "3");
gr.addEdge("3", "1");
gr.addEdge("1", "4");
gr.addEdge("4", "1");
gr.addEdge("2", "3");
gr.addEdge("3", "2");
gr.addEdge("2", "4");
gr.addEdge("4", "2");
gr.addEdge("3", "4");
gr.addEdge("4", "3");
return gr;
}
/**
* Build graph by using graph capacity and growth percentage
* @param graphCapacity
* @param growthPercentage
* @return graph
*/
@Override
public Graph buildGraph(int graphCapacity, int growthPercentage){
Graph gr = initialGraph(); // initialize the graph
int vertexCounter = gr.vertexCount(); // it will use for giving name of nodes
int minEdge = 3; // connection condition between vertices
// create random growth, capacity and vertex
Random rand = new Random();
int randomGrowth; // it will use for growth percentage condition
int randomCapacity; // it will use for vertex capacity
int randomVertex; // it will use random vertex value from the graph
// start building the graph
while(gr.vertexCount() < graphCapacity) {
// rand.nextInt(100) will give value from 0 to 99. For 1 to 100: rand.nextInt(100) + 1
randomGrowth = rand.nextInt(100) + 1;
randomCapacity = rand.nextInt(100) + 1;
// add a random vertex to the graph
if(randomGrowth<growthPercentage) {
gr.addVertex(String.valueOf(vertexCounter), randomCapacity);
// add at least 3 connection for the vertex
while(gr.inDegree(String.valueOf(vertexCounter)) < minEdge || gr.outDegree(String.valueOf(vertexCounter)) < minEdge){
randomVertex = rand.nextInt(gr.vertexCount()) + 1; //This will give random vertex number from the graph.
while(randomVertex == vertexCounter || gr.isAdjacent(String.valueOf(vertexCounter),String.valueOf(randomVertex)))
randomVertex = rand.nextInt(gr.vertexCount()) + 1; //This will give random vertex number from the graph.
gr.addEdge(String.valueOf(vertexCounter), String.valueOf(randomVertex));
gr.addEdge(String.valueOf(randomVertex), String.valueOf(vertexCounter));
}
vertexCounter++; // increase vertex count for next vertex
}else // delete a random vertex from the graph
{
// Handle a random vertex number from the graph.
randomVertex = rand.nextInt(gr.vertexCount()) + 1;
Vertex v = gr.findVertex(String.valueOf(randomVertex));
if (v != null)
{
// before removing find all connected vertices and make them new connections
Edge e = v.getNextEdge();
while (e != null)
{
randomVertex = rand.nextInt(gr.vertexCount()) + 1; // This will give random vertex number from the graph
while(gr.isAdjacent(e.getVertexValue(),String.valueOf(randomVertex)) || v.getVertexValue().compareTo(String.valueOf(randomVertex)) == 0 )
randomVertex = rand.nextInt(gr.vertexCount()) + 1; // This will give random vertex number from the graph
// add edges between them
gr.addEdge(e.getVertexValue(), String.valueOf(randomVertex));
gr.addEdge(String.valueOf(randomVertex), e.getVertexValue());
e = e.getNextEdge();
}
gr.removeVertex(v.getVertexValue()); // remove the random vertex
}
}
}
return gr;
}
/**
* Build graph by reading data from nodes.txt and edges.txt
* @param nodesPath
* @param edgesPath
* @return graph
* @throws IOException
*/
@Override
public Graph buildGraph (String verticesPath, String edgesPath) throws IOException {
Graph gr = new Graph(); // initialize the graph
// read vertices data and add them to graph
BufferedReader br = new BufferedReader(new FileReader(verticesPath));
try {
StringBuilder sb = new StringBuilder();
String line = br.readLine();
while (line != null) {
sb.append(line);
sb.append(System.lineSeparator());
if(line!=null){
String[] parts = line.split(" ");
String vertexName = parts[0];
String vertexSize = parts[1];
gr.addVertex(vertexName, Integer.valueOf(vertexSize));
}
line = br.readLine();
}
} finally {
br.close();
}
// read edges data and make connections between the vertices
br = new BufferedReader(new FileReader(edgesPath));
try {
StringBuilder sb = new StringBuilder();
String line = br.readLine();
while (line != null) {
sb.append(line);
sb.append(System.lineSeparator());
if(line!=null){
String[] parts = line.split(" ");
String vertex1 = parts[0];
String vertex2 = parts[1];
gr.addEdge(vertex1, vertex2);
gr.addEdge(vertex2, vertex1);
}
line = br.readLine();
}
} finally {
br.close();
}
return gr;
}
} | [
"nctkrtl@hotmail.com"
] | nctkrtl@hotmail.com |
f763c43743679d4ef74e644798e695a15633d35b | b5480493a10c468ef3b0037fd2807dd77def9ad7 | /broadcastmanager/src/main/java/com/ofek/dev/broadcastmanager/GlobalBroadcastManager.java | 9e75e1f7f2327e6436a8765200b13caff4510c88 | [
"Apache-2.0"
] | permissive | ofekron/broadcastmanager | e3a93675faae26d2965fc98267a4486679394780 | e44d17318b1ecf547fcba9c4f773aef852e2910d | refs/heads/main | 2023-02-25T15:30:05.598665 | 2021-02-04T00:16:27 | 2021-02-04T00:17:39 | 327,530,469 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 283 | java | package com.ofek.dev.broadcastmanager;
public class GlobalBroadcastManager extends BroadcastManager {
private GlobalBroadcastManager(String name){ super(name); }
public final static GlobalBroadcastManager instance = new GlobalBroadcastManager("GlobalBroadcastManager");
}
| [
"ofek.ron@servicenow.com"
] | ofek.ron@servicenow.com |
7ce3ff4831e65b9c2eb41a2b5e80f7f608e15049 | 5fbce901212a407000a4b0a3b3d78098132f3456 | /app/src/main/java/com/codegene/femicodes/cscprojectadmin/utils/Constants.java | 606c65bce1be82f3a874873374cf01df081c9fae | [] | no_license | josephsarz/CSCProjectAdmin | 4ee18aad9bcf0aaa973c3ec933da776ac0d0b2e0 | a762ec4aab6674bc06e633a20f12760aecde1eec | refs/heads/master | 2021-01-25T13:23:34.218831 | 2018-03-25T07:25:34 | 2018-03-25T07:25:34 | 123,561,725 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 414 | java | package com.codegene.femicodes.cscprojectadmin.utils;
/**
* Created by femicodes on 2/15/2018.
*/
public class Constants {
public static final String REFERENCE_CHILD_REPORTS = "reports";
public static final String REFERENCE_CHILD_NEWS = "news";
public static final String REFERENCE_CHILD_PRODUCTS = "products";
public final static String REFERENCE_CHILD_MANUFACTURER = "manufacturers";
}
| [
"aghedojoe007@gmail.com"
] | aghedojoe007@gmail.com |
e8b601a69bb8276abcaccd75b38b7d5cad1b1fc6 | 7dbbe21b902fe362701d53714a6a736d86c451d7 | /BzenStudio-5.6/Source/com/zend/ide/o/c/r.java | fb15c9201fcdee7baac8e01a39b28964b5028928 | [] | no_license | HS-matty/dev | 51a53b4fd03ae01981549149433d5091462c65d0 | 576499588e47e01967f0c69cbac238065062da9b | refs/heads/master | 2022-05-05T18:32:24.148716 | 2022-03-20T16:55:28 | 2022-03-20T16:55:28 | 196,147,486 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,032 | java | package com.zend.ide.o.c;
import com.zend.ide.o.a;
import java.awt.Component;
import javax.swing.Icon;
import javax.swing.JTree;
import javax.swing.text.JTextComponent;
import javax.swing.tree.DefaultTreeCellEditor;
import javax.swing.tree.DefaultTreeCellRenderer;
class r extends DefaultTreeCellEditor
{
final bq a;
public r(bq parambq)
{
super(parambq, (DefaultTreeCellRenderer)parambq.getCellRenderer());
}
public Component getTreeCellEditorComponent(JTree paramJTree, Object paramObject, boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3, int paramInt)
{
Component localComponent = super.getTreeCellEditorComponent(paramJTree, paramObject, paramBoolean1, paramBoolean2, paramBoolean3, paramInt);
if ((this.editingComponent != null) && ((this.editingComponent instanceof JTextComponent)))
{
o localo = (o)this.a.getLastSelectedPathComponent();
a locala = (a)localo.getUserObject();
String str = locala.c();
JTextComponent localJTextComponent = (JTextComponent)this.editingComponent;
localJTextComponent.setText(str);
localJTextComponent.selectAll();
}
return localComponent;
}
public boolean stopCellEditing()
{
boolean bool = super.stopCellEditing();
return bool;
}
protected void determineOffset(JTree paramJTree, Object paramObject, boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3, int paramInt)
{
if (this.renderer != null)
{
m localm = (m)this.a.getLastSelectedPathComponent();
if (localm != null)
this.editingIcon = localm.e();
if (this.editingIcon != null)
this.offset = (this.renderer.getIconTextGap() + this.editingIcon.getIconWidth());
else
this.offset = this.renderer.getIconTextGap();
}
else
{
this.editingIcon = null;
this.offset = 0;
}
}
}
/* Location: C:\Program Files\Zend\ZendStudio-5.5.1\bin\ZendIDE.jar
* Qualified Name: com.zend.ide.o.c.r
* JD-Core Version: 0.6.0
*/ | [
"byqdes@gmail.com"
] | byqdes@gmail.com |
5e60a30f922133728dadcf315dd1377502ae45f1 | f98af097b024f044fc8614a3be5493e95f8474bb | /src/main/java/mpp/standard/PracticeForStandard2017July/prob2/CheckoutRecordEntry.java | a0e3867711297b82f7543c38ae1f520d85ce69af | [] | no_license | gZack/learning | 127466117591f1bc761e3708dc6e9e28764fbe48 | a6bd297cab8b9c562e1c5e940b2a4859fb98ca83 | refs/heads/master | 2021-07-07T13:40:17.796368 | 2017-10-01T15:21:36 | 2017-10-01T15:21:36 | 104,681,790 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 888 | java | package mpp.standard.PracticeForStandard2017July.prob2;
import java.time.LocalDate;
public class CheckoutRecordEntry {
private LendingItem lendingItem;
private ItemType itemType;
private LocalDate checkOutDate;
private LocalDate dudeDate;
public CheckoutRecordEntry(final LendingItem item, final LocalDate chDate,
final LocalDate dueDate, final ItemType itemType){
this.checkOutDate = chDate;
this.dudeDate = dueDate;
this.itemType = itemType;
this.lendingItem = item;
}
public LendingItem getLendingItem() {
return lendingItem;
}
public ItemType getItemType() {
return itemType;
}
public LocalDate getCheckOutDate() {
return checkOutDate;
}
public LocalDate getDudeDate() {
return dudeDate;
}
}
| [
"code.zkg@gmail.com"
] | code.zkg@gmail.com |
16fb78993487bc2d2f1dc1ca0ee7b42145e0bd11 | ac8d4d18eb42bf79272fbcf9ba191d247df7c68d | /EasyDaoFramework/src/main/java/com/elminster/easydao/db/dialect/Dialect.java | fb4d20fd1e8a4f086a1018470aac8b41c6138431 | [] | no_license | elminsterjimmy/javaEasyDao | 2777d5133b8095ac3486069e0bbda094dc10e920 | e801423a26e6ef811b86b13ab012879504956e94 | refs/heads/master | 2016-09-06T19:39:56.433910 | 2015-03-05T05:08:47 | 2015-03-05T05:08:47 | 25,282,850 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,526 | java | package com.elminster.easydao.db.dialect;
import java.sql.CallableStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
public class Dialect implements IDialect {
/**
* Given a limit and an offset, apply the limit clause to the query.
*
* @param query
* The query to which to apply the limit.
* @param offset
* The offset of the limit
* @param limit
* The limit of the limit ;)
* @return The modified query statement with the limit applied.
*/
@Override
public String getLimitSql(String sql, boolean hasOffset) {
throw new UnsupportedOperationException("query result paged is not supported.");
}
/**
* Get test connection query.
*
* @return The test connection query
*/
@Override
public String getTestConnectionSql() {
throw new UnsupportedOperationException("query test connection is not supported.");
}
/**
* Does this dialect's LIMIT support (if any) additionally support specifying
* an offset?
*
* @return True if the dialect supports an offset within the limit support.
*/
@Override
public boolean supportOffset() {
return false;
}
/**
* Does this dialect support some form of limiting query results via a SQL
* clause?
*
* @return True if this dialect supports some form of LIMIT.
*/
@Override
public boolean supportPaged() {
return false;
}
/**
* Does the <tt>LIMIT</tt> clause take a "maximum" row number instead of a
* total number of returned rows?
* <p/>
* This is easiest understood via an example. Consider you have a table with
* 20 rows, but you only want to retrieve rows number 11 through 20.
* Generally, a limit with offset would say that the offset = 11 and the limit
* = 10 (we only want 10 rows at a time); this is specifying the total number
* of returned rows. Some dialects require that we instead specify offset = 11
* and limit = 20, where 20 is the "last" row we want relative to offset (i.e.
* total number of rows = 20 - 11 = 9)
* <p/>
* So essentially, is limit relative from offset? Or is limit absolute?
*
* @return True if limit is relative from offset; false otherwise.
*/
public boolean useMaxForLimit() {
return false;
}
/**
* setFirstResult() should be a zero-based offset. Here we allow the Dialect a
* chance to convert that value based on what the underlying db or driver will
* expect.
* <p/>
* NOTE: what gets passed into {@link #getLimitString(String,int,int)} is the
* zero-based offset. Dialects which do not {@link #supportsVariableLimit}
* should take care to perform any needed {@link #convertToFirstRowValue}
* calls prior to injecting the limit values into the SQL string.
*
* @param zeroBasedFirstResult
* The user-supplied, zero-based first row offset.
*
* @return The corresponding db/dialect specific offset.
*/
public int convertToFirstRowValue(int zeroBasedFirstResult) {
return zeroBasedFirstResult;
}
/**
* Registers an OUT parameter which will be returing a
* {@link java.sql.ResultSet}. How this is accomplished varies greatly from DB
* to DB, hence its inclusion (along with {@link #getResultSet}) here.
*
* @param statement
* The callable statement.
* @param position
* The bind position at which to register the OUT param.
* @return The number of (contiguous) bind positions used.
* @throws SQLException
* Indicates problems registering the OUT param.
*/
public int registerResultSetOutParameter(CallableStatement statement, int position) throws SQLException {
throw new UnsupportedOperationException(getClass().getName() + " does not support resultsets via stored procedures");
}
/**
* Given a callable statement previously processed by
* {@link #registerResultSetOutParameter}, extract the
* {@link java.sql.ResultSet} from the OUT parameter.
*
* @param statement
* The callable statement.
* @return The extracted result set.
* @throws SQLException
* Indicates problems extracting the result set.
*/
public ResultSet getResultSet(CallableStatement statement) throws SQLException {
throw new UnsupportedOperationException(getClass().getName() + " does not support resultsets via stored procedures");
}
/**
* Generate the appropriate select statement to to retrieve the next value of
* a sequence.
* <p/>
* This should be a "stand alone" select statement.
*
* @param sequenceName
* the name of the sequence
* @return String The "nextval" select string.
* @throws MappingException
* If sequences are not supported.
*/
public String getSequenceNextValueSql(String sequenceName) {
throw new UnsupportedOperationException(getClass().getName() + " does not support sequences");
}
/**
* Get the command used to select a GUID from the underlying database.
* <p/>
* Optional operation.
*
* @return The appropriate command.
*/
public String getGUIdSql() {
throw new UnsupportedOperationException( getClass().getName() + " does not support GUIDs" );
}
/**
* Retrieve the command used to retrieve the current timestamp from the
* database.
*
* @return The command.
*/
public String getCurrentTimestampSql() {
throw new UnsupportedOperationException( "Database not known to define a current timestamp function" );
}
}
| [
"Jinglei.Gu@kisters.cn"
] | Jinglei.Gu@kisters.cn |
cedc651b1d2ddc002a7d1ea05638638fb86d823d | 6f96599e01bfe70a407358459b657a89bd9fbd76 | /example/src/main/java/com/xwc/open/example/Application.java | 32c4df596be0515cef73b7e8e2a0bd52488e59cf | [] | no_license | endlessc/easybatis-example | de11bda271e87d63a2c5b07ee66afc7df17e81d1 | 632878c706420b70192470eff1682861bd2ad5eb | refs/heads/master | 2020-09-21T09:29:47.171577 | 2019-10-17T11:07:12 | 2019-10-17T11:07:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 375 | java | package com.xwc.open.example;
import com.xwc.open.easybatis.EnableEasyBatis;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
@EnableEasyBatis
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
| [
"wcxu@incarcloud.com"
] | wcxu@incarcloud.com |
f0984893e4eb34cbd7639afc74fc9ed202201544 | f2692edf4fcbdee3baf404aff6b493f86ed81c0e | /app/src/main/java/com/example/uxbertfavoritesbooks/MyApplication.java | 15e60378e2967584bf32389b54ffac1dead49804 | [] | no_license | willbrom/UXBERTfavoritesbooks | a0765534ffaf234c2cd9ba62df030645dc859177 | 7f75044c63558fa7e979a14659aa263b2603b613 | refs/heads/master | 2020-05-20T08:42:06.572906 | 2019-05-07T22:20:06 | 2019-05-07T22:20:06 | 185,478,829 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 322 | java | package com.example.uxbertfavoritesbooks;
import android.app.Application;
import com.example.uxbertfavoritesbooks.utils.MyNotification;
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
MyNotification.createNotificationChannel(this);
}
}
| [
"alisajid552@yahoo.com"
] | alisajid552@yahoo.com |
8551fcbf91e5b5189457b6927975a0cac690d397 | 0f1f7332b8b06d3c9f61870eb2caed00aa529aaa | /ebean/tags/ebean-2.8.1/src/main/java/com/avaje/ebean/config/dbplatform/RowNumberSqlLimiter.java | e1821096750f94efb7ba3040bedb42520511173f | [] | no_license | rbygrave/sourceforge-ebean | 7e52e3ef439ed64eaf5ce48e0311e2625f7ee5ed | 694274581a188be664614135baa3e4697d52d6fb | refs/heads/master | 2020-06-19T10:29:37.011676 | 2019-12-17T22:09:29 | 2019-12-17T22:09:29 | 196,677,514 | 1 | 0 | null | 2019-12-17T22:07:13 | 2019-07-13T04:21:16 | Java | UTF-8 | Java | false | false | 1,730 | java | package com.avaje.ebean.config.dbplatform;
/**
* Adds the ROW_NUMBER() OVER function to a query.
*/
public class RowNumberSqlLimiter implements SqlLimiter {
/**
* ROW_NUMBER() OVER (ORDER BY
*/
private static final String ROW_NUMBER_OVER = "row_number() over (order by ";
/**
* ) as rn,
*/
private static final String ROW_NUMBER_AS = ") as rn, ";
final String rowNumberWindowAlias;
/**
* Specify the name of the rowNumberWindowAlias.
*/
public RowNumberSqlLimiter(String rowNumberWindowAlias) {
this.rowNumberWindowAlias = rowNumberWindowAlias;
}
public RowNumberSqlLimiter() {
this("as limitresult");
}
public SqlLimitResponse limit(SqlLimitRequest request) {
StringBuilder sb = new StringBuilder(500);
int firstRow = request.getFirstRow();
int lastRow = request.getMaxRows();
if (lastRow > 0) {
lastRow = lastRow + firstRow + 1;
}
sb.append("select * from (").append(NEW_LINE);
sb.append("select ");
if (request.isDistinct()) {
sb.append("distinct ");
}
sb.append(ROW_NUMBER_OVER);
sb.append(request.getDbOrderBy());
sb.append(ROW_NUMBER_AS);
sb.append(request.getDbSql());
sb.append(NEW_LINE).append(") ");
sb.append(rowNumberWindowAlias);
sb.append(" where ");
if (firstRow > 0) {
sb.append(" rn > ").append(firstRow);
if (lastRow > 0) {
sb.append(" and ");
}
}
if (lastRow > 0) {
sb.append(" rn <= ").append(lastRow);
}
String sql = request.getDbPlatform().completeSql(sb.toString(), request.getOrmQuery());
return new SqlLimitResponse(sql, true);
}
}
| [
"208973+rbygrave@users.noreply.github.com"
] | 208973+rbygrave@users.noreply.github.com |
505f44a07b9e7cdefa81c7e773cc50e8215695e6 | 79b39b39365970b7f150d76682cc1b4fcf9a5b3d | /src/com/java/games/gameobjects/EnemyShip.java | c8f4eb022beaadf206fd6bbec21654407aa0673e | [] | no_license | juris-97/GameSpaceInvaders | fdeba7f16fecd91057927f05428c254c320c4b6a | 1911351783a0c2e187fa4cb0d82508654b0bff08 | refs/heads/master | 2023-03-11T04:55:37.962971 | 2021-02-26T23:11:32 | 2021-02-26T23:11:32 | 342,521,824 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 984 | java | package com.java.games.gameobjects;
import com.java.games.Direction;
import com.java.games.ShapeMatrix;
public class EnemyShip extends Ship{
public int score = 15;
public EnemyShip(double x, double y){
super(x,y);
setStaticView(ShapeMatrix.ENEMY);
}
public void move(Direction direction, double speed){
if(direction.equals(Direction.RIGHT))
x += speed;
if(direction.equals(Direction.LEFT))
x -= speed;
if(direction.equals(Direction.DOWN))
y += 2;
}
@Override
public Bullet fire(){
return new Bullet(x + 1, y + height, Direction.DOWN);
}
@Override
public void kill() {
if(isAlive){
isAlive = false;
setAnimatedView(false,
ShapeMatrix.KILL_ENEMY_ANIMATION_FIRST,
ShapeMatrix.KILL_ENEMY_ANIMATION_SECOND,
ShapeMatrix.KILL_ENEMY_ANIMATION_THIRD);
}
}
}
| [
"juris-97@yandex.ru"
] | juris-97@yandex.ru |
0a2c9b85f0171e53e503fa63d6c9a2b39067000c | 98c6014f7f8037d900543ca4e15b26c9633933dd | /src/main/java/com/eccweb/security/UserAuthentication.java | c7ac38b8e81e8330ed10d0fba0ec63f74c496ff1 | [] | no_license | projectecc16/ECCWeb | c0ad048a4ba79fb4bdb69189876d84437fa38501 | 218825f00b915c92c5aba5935224354ee617dfda | refs/heads/master | 2020-03-09T07:35:22.701913 | 2018-04-08T18:04:35 | 2018-04-08T18:04:35 | 128,667,916 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,020 | java | package com.eccweb.security;
import java.util.Collection;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;
import com.eccweb.entity.Account;
public class UserAuthentication implements Authentication {
private final Account account;
private boolean authenticated = true;
public UserAuthentication(Account account) {
this.account = account;
}
@Override
public String getName() {
return account.getUsername();
}
@Override
public Collection<? extends GrantedAuthority> getAuthorities() {
return account.getAuthorities();
}
@Override
public Object getCredentials() {
return account.getPassword();
}
@Override
public Account getDetails() {
return account;
}
@Override
public Object getPrincipal() {
return account.getUsername();
}
@Override
public boolean isAuthenticated() {
return authenticated;
}
@Override
public void setAuthenticated(boolean authenticated) {
this.authenticated = authenticated;
}
}
| [
"kamaldkannan@gmail.com"
] | kamaldkannan@gmail.com |
cedc3e2e570495a458b4c48e554cc63dd1f92ef9 | 1674ca79ea253a41872ed8cdf1a321dbbb53d14d | /crediline-core/src/main/java/com/crediline/model/City.java | 2e1737bd857b085dc31084b5457c1e6e2f1d5064 | [] | no_license | bsdimer/crediline | 41c34e7fb0bf5139d47c3c3b3bdfa750b15cfec1 | 69953cc3a624383685d60bc2749f922e013b1a5b | refs/heads/master | 2023-01-29T00:32:31.965991 | 2023-01-20T20:51:19 | 2023-01-20T20:51:19 | 150,694,626 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,461 | java | package com.crediline.model;
import com.crediline.dataimport.CSVEntity;
import com.crediline.utils.PrintFlag;
import com.crediline.utils.PrintUtils;
import javax.persistence.*;
import java.io.Serializable;
/**
* Created by dimer on 1/4/14.
*/
@Entity
@Table(name = "cities", uniqueConstraints = {
@UniqueConstraint(columnNames = {"name", "oblast", "obshtina"})
})
public class City extends PersistedVersional implements Identifiable, Serializable {
private static final long serialVersionUID = 5064001811112654811L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false, length = 100)
private String name;
@Column(length = 100)
private String oblast;
@Column(length = 100)
private String obshtina;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getOblast() {
return oblast;
}
public void setOblast(String oblast) {
this.oblast = oblast;
}
public String getObshtina() {
return obshtina;
}
public void setObshtina(String obshtina) {
this.obshtina = obshtina;
}
@Override
public String toString() {
return PrintUtils.print(this, PrintFlag.PRINT_PRETY);
}
}
| [
"dimitar.dimitrov@aossia.com"
] | dimitar.dimitrov@aossia.com |
6d760c78a3c49e83a7ecab5a6e8eca070edc43b1 | 170cb0ccbd2380bdb3b8e80985ffa45424f25561 | /Cookie.java | 9c126c95907d845a4ca38cb5877f232da9ce0cbc | [] | no_license | beagle910/Object-paradigm | ad3ddc8e266f572cebe49df252cd79f6777e02e5 | 9769cf9dba48677d9c868e80553b6a02981d41fd | refs/heads/master | 2021-01-08T09:32:17.038534 | 2020-02-20T20:56:17 | 2020-02-20T20:56:17 | 241,987,826 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 260 | java | package mypackage;
public class Cookie extends DessertItem {
private int price;
private int quantity;
public Cookie(String n, int i, int p) {
super(n);
price = p;
quantity = i;
}
@Override
public int getCost() {
return price * quantity;
}
}
| [
"noreply@github.com"
] | beagle910.noreply@github.com |
96bffc25b287cd805c1f56b62490e2217feaf635 | 5741045375dcbbafcf7288d65a11c44de2e56484 | /reddit-decompilada/com/reddit/frontpage/ui/profile/profilesettings/view/ProfileSettingsScreen$bannerPreloader$2.java | 8cf730911a4248de6148eadf8d702c78593fe479 | [] | no_license | miarevalo10/ReporteReddit | 18dd19bcec46c42ff933bb330ba65280615c281c | a0db5538e85e9a081bf268cb1590f0eeb113ed77 | refs/heads/master | 2020-03-16T17:42:34.840154 | 2018-05-11T10:16:04 | 2018-05-11T10:16:04 | 132,843,706 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,189 | java | package com.reddit.frontpage.ui.profile.profilesettings.view;
import android.view.View;
import android.widget.ProgressBar;
import com.reddit.frontpage.C1761R;
import kotlin.Metadata;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Lambda;
@Metadata(bv = {1, 0, 2}, d1 = {"\u0000\n\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0000\u001a\n \u0002*\u0004\u0018\u00010\u00010\u0001H\n¢\u0006\u0002\b\u0003"}, d2 = {"<anonymous>", "Landroid/widget/ProgressBar;", "kotlin.jvm.PlatformType", "invoke"}, k = 3, mv = {1, 1, 9})
/* compiled from: ProfileSettingsScreen.kt */
final class ProfileSettingsScreen$bannerPreloader$2 extends Lambda implements Function0<ProgressBar> {
final /* synthetic */ ProfileSettingsScreen f37349a;
ProfileSettingsScreen$bannerPreloader$2(ProfileSettingsScreen profileSettingsScreen) {
this.f37349a = profileSettingsScreen;
super(0);
}
public final /* synthetic */ Object invoke() {
View c = this.f37349a.K;
if (c == null) {
Intrinsics.m26842a();
}
return (ProgressBar) c.findViewById(C1761R.id.banner_preloader);
}
}
| [
"mi.arevalo10@uniandes.edu.co"
] | mi.arevalo10@uniandes.edu.co |
cfb46ede513a6111843096b3b0938ed9020ca4de | 0caeb2d82e95945bb63d3860b4a82cf6ac1d1706 | /src/main/java/com/flansmod/common/driveables/EnumPlaneMode.java | e2061744697d500c4673680323979df8bad68dfd | [] | no_license | RuHalfBlood/python | 2513fedd798410b2a02661cfc63d8c1dae041501 | 6a96101c62071ad6792f7530555bd86b024821bb | refs/heads/master | 2020-03-07T17:34:02.473458 | 2018-04-01T10:16:44 | 2018-04-01T10:16:44 | 127,614,890 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 509 | java | package com.flansmod.common.driveables;
public enum EnumPlaneMode {
PLANE("PLANE", 0),
VTOL("VTOL", 1),
HELI("HELI", 2),
SIXDOF("SIXDOF", 3);
// $FF: synthetic field
private static final EnumPlaneMode[] $VALUES = new EnumPlaneMode[]{PLANE, VTOL, HELI, SIXDOF};
private EnumPlaneMode(String var1, int var2) {}
public static EnumPlaneMode getMode(String s) {
return s.toLowerCase().equals("vtol")?VTOL:(s.toLowerCase().equals("heli")?HELI:PLANE);
}
}
| [
"Людмила@TVIN-PIKS"
] | Людмила@TVIN-PIKS |
847cdf0f1614c9efdd6937ca91ff74df3cbc3a17 | 0b264fe22a5e2347d909720ae6a9d147b9313c8a | /ChineseParserServer/source/edu/stanford/nlp/trees/tregex/CoordinationPattern.java | 730abdf29c00a39b3a2ea9a6486b29106c7521c3 | [] | no_license | ideasiii/PearSynthesizer | 76c3539824669ae07d664f21b1266c785dfb92fc | 953ffe1e0e440c42d889f280ff4f7724e88fcd1d | refs/heads/master | 2020-03-27T12:15:52.541792 | 2018-08-31T02:32:42 | 2018-08-31T02:32:42 | 146,535,922 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,782 | java | /* */ package edu.stanford.nlp.trees.tregex;
/* */
/* */ import edu.stanford.nlp.trees.Tree;
/* */ import java.util.Iterator;
/* */ import java.util.List;
/* */ import java.util.Map;
/* */
/* */ class CoordinationPattern
/* */ extends TregexPattern
/* */ {
/* */ private boolean isConj;
/* */ private List children;
/* */
/* */ public CoordinationPattern(List children, boolean isConj)
/* */ {
/* 16 */ if (children.size() < 2) {
/* 17 */ throw new RuntimeException("Coordination node must have at least 2 children.");
/* */ }
/* 19 */ this.children = children;
/* 20 */ this.isConj = isConj;
/* */ }
/* */
/* */ public List getChildren()
/* */ {
/* 25 */ return this.children;
/* */ }
/* */
/* */ public String localString() {
/* 29 */ return this.isConj ? "and" : "or";
/* */ }
/* */
/* */ public String toString() {
/* 33 */ StringBuffer sb = new StringBuffer();
/* 34 */ Iterator iter; if (this.isConj) {
/* 35 */ for (iter = this.children.iterator(); iter.hasNext();) {
/* 36 */ TregexPattern node = (TregexPattern)iter.next();
/* 37 */ sb.append(node.toString());
/* */ }
/* */ } else {
/* 40 */ sb.append('[');
/* 41 */ for (Iterator iter = this.children.iterator(); iter.hasNext();) {
/* 42 */ TregexPattern node = (TregexPattern)iter.next();
/* 43 */ sb.append(node.toString());
/* 44 */ if (iter.hasNext()) {
/* 45 */ sb.append(" |");
/* */ }
/* */ }
/* 48 */ sb.append(']');
/* */ }
/* 50 */ return sb.toString();
/* */ }
/* */
/* */ public TregexMatcher matcher(Tree root, Tree tree, Map<Object, Tree> namesToNodes, VariableStrings variableStrings) {
/* 54 */ return new CoordinationMatcher(this, root, tree, namesToNodes, variableStrings);
/* */ }
/* */
/* */ private static class CoordinationMatcher extends TregexMatcher
/* */ {
/* */ private TregexMatcher[] children;
/* */ private final CoordinationPattern myNode;
/* */ private int currChild;
/* */ private final boolean considerAll;
/* */
/* */ public CoordinationMatcher(CoordinationPattern n, Tree root, Tree tree, Map<Object, Tree> namesToNodes, VariableStrings variableStrings)
/* */ {
/* 66 */ super(tree, namesToNodes, variableStrings);
/* 67 */ this.myNode = n;
/* 68 */ this.children = new TregexMatcher[this.myNode.children.size()];
/* 69 */ for (int i = 0; i < this.children.length; i++) {
/* 70 */ TregexPattern node = (TregexPattern)this.myNode.children.get(i);
/* 71 */ this.children[i] = node.matcher(root, tree, namesToNodes, variableStrings);
/* */ }
/* 73 */ this.currChild = 0;
/* 74 */ this.considerAll = (this.myNode.isConj ^ this.myNode.isNegated());
/* */ }
/* */
/* */ void resetChildIter() {
/* 78 */ this.currChild = 0;
/* 79 */ for (int i = 0; i < this.children.length; i++) {
/* 80 */ this.children[i].resetChildIter();
/* */ }
/* */ }
/* */
/* */ void resetChildIter(Tree tree) {
/* 85 */ this.tree = tree;
/* 86 */ this.currChild = 0;
/* 87 */ for (int i = 0; i < this.children.length; i++) {
/* 88 */ this.children[i].resetChildIter(tree);
/* */ }
/* */ }
/* */
/* */ public boolean matches()
/* */ {
/* 94 */ if (this.considerAll)
/* */ {
/* 99 */ for (;
/* */
/* */
/* 99 */ (this.currChild >= 0) &&
/* 100 */ (this.myNode.isNegated() == this.children[this.currChild].matches()); this.currChild -= 1)
/* */ {
/* */
/* */
/* 103 */ this.children[this.currChild].resetChildIter();
/* */ }
/* */
/* 106 */ if (this.currChild < 0) {
/* 107 */ return this.myNode.isOptional();
/* */ }
/* */
/* */
/* 111 */ while (this.currChild + 1 < this.children.length) {
/* 112 */ this.currChild += 1;
/* 113 */ if (this.myNode.isNegated() == this.children[this.currChild].matches()) {
/* 114 */ this.currChild = -1;
/* 115 */ return this.myNode.isOptional();
/* */ }
/* */ }
/* */
/* */
/* 120 */ if (this.myNode.isNegated()) {
/* 121 */ this.currChild = -1;
/* */ }
/* 123 */ return true;
/* */ }
/* 126 */ for (;
/* 126 */ this.currChild < this.children.length; this.currChild += 1) {
/* 127 */ if (this.myNode.isNegated() != this.children[this.currChild].matches())
/* */ {
/* 129 */ if (this.myNode.isNegated()) {
/* 130 */ this.currChild = this.children.length;
/* */ }
/* 132 */ return true;
/* */ }
/* */ }
/* 135 */ if (this.myNode.isNegated()) {
/* 136 */ this.currChild = this.children.length;
/* */ }
/* 138 */ return this.myNode.isOptional();
/* */ }
/* */
/* */
/* */ public Tree getMatch()
/* */ {
/* 144 */ throw new UnsupportedOperationException();
/* */ }
/* */ }
/* */ }
/* Location: D:\Project\TTS\PearSynthesizer(HMM)\ChineseParserServer\lib\Stanford.jar!\edu\stanford\nlp\trees\tregex\CoordinationPattern.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"louisju@iii.org.tw"
] | louisju@iii.org.tw |
991a69ed0b3e08df7d94d89a6f94befcab982630 | dd0978fc18aabf7449c00e86c4193da9aa936e31 | /GR82.15.Practica1/src/es/uc3m/tiw/controller/SoldTicketsHandler.java | a930dbb2b135cf7187843a0c4b3879952c4c1edc | [] | no_license | omdelafuente/tiw | 893f2a487396d4bf978a3c2d88a32c8afd0d4312 | 43ff317faca6713b08c901714303596be81de5c0 | refs/heads/master | 2021-08-09T03:13:21.557949 | 2017-11-12T04:16:32 | 2017-11-12T04:16:32 | 105,543,397 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,291 | java | package es.uc3m.tiw.controller;
import java.io.IOException;
import java.util.List;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import es.uc3m.tiw.model.Event;
import es.uc3m.tiw.model.EventManager;
import es.uc3m.tiw.model.Purchase;
import es.uc3m.tiw.model.PurchaseManager;
public class SoldTicketsHandler implements IRequestHandler {
@Override
//devuelve la lista de entradas que se han vendido para un evento
public String handleRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
int eventId = Integer.parseInt(request.getParameter("id"));
Event event;
EntityManagerFactory factory = Persistence.createEntityManagerFactory("GR82.15.Practica1");
EventManager manager = new EventManager();
manager.setEntityManagerFactory(factory);
event = manager.findEventByID(eventId);
PurchaseManager pManager = new PurchaseManager();
pManager.setEntityManagerFactory(factory);
List<Purchase> purchases = pManager.findPurchasesByEvent(event);
request.setAttribute("purchases", purchases);
return "soldTickets.jsp";
}
}
| [
"mrooskitar@gmail.com"
] | mrooskitar@gmail.com |
3352b22c87c9b3d964e1f40986d7a1aca21d22e0 | 7e1511cdceeec0c0aad2b9b916431fc39bc71d9b | /flakiness-predicter/input_data/original_tests/square-okhttp/nonFlakyMethods/com.squareup.okhttp.internal.http.HeadersTest-toNameValueBlock.java | 40bb214e410328c5c0d8b08fb399e51a2a88518b | [
"BSD-3-Clause"
] | permissive | Taher-Ghaleb/FlakeFlagger | 6fd7c95d2710632fd093346ce787fd70923a1435 | 45f3d4bc5b790a80daeb4d28ec84f5e46433e060 | refs/heads/main | 2023-07-14T16:57:24.507743 | 2021-08-26T14:50:16 | 2021-08-26T14:50:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 611 | java | @Test public void toNameValueBlock(){
Request request=new Request.Builder().url("http://square.com/").header("cache-control","no-cache, no-store").addHeader("set-cookie","Cookie1").addHeader("set-cookie","Cookie2").header(":status","200 OK").build();
List<Header> headerBlock=SpdyTransport.writeNameValueBlock(request,Protocol.SPDY_3,"HTTP/1.1");
List<Header> expected=headerEntries(":method","GET",":path","/",":version","HTTP/1.1",":host","square.com",":scheme","http","cache-control","no-cache, no-store","set-cookie","Cookie1\u0000Cookie2",":status","200 OK");
assertEquals(expected,headerBlock);
}
| [
"aalsha2@masonlive.gmu.edu"
] | aalsha2@masonlive.gmu.edu |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.