blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 332 | content_id stringlengths 40 40 | detected_licenses listlengths 0 50 | license_type stringclasses 2 values | repo_name stringlengths 7 115 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 557 values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 17 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 82 values | src_encoding stringclasses 28 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 7 5.41M | extension stringclasses 11 values | content stringlengths 7 5.41M | authors listlengths 1 1 | author stringlengths 0 161 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
537f4d581e6abdd64c8b67959c2f0b6091e5a851 | 939dc5cd3529035b02a9eb47e1b224ce7661c1bf | /ion/src/com/koushikdutta/ion/Ion.java | aaaaabc7a600039a47e90405fb8b1190f39e66bb | [
"Apache-2.0"
] | permissive | lauren7249/android-smsmms | 326c781af3f72bd8ea97c3242a9d6cdb54258871 | 2e8036c0841b4625f4f4bc4febb719924755ef6a | refs/heads/master | 2016-09-10T09:11:57.154523 | 2014-07-02T18:21:27 | 2014-07-02T18:21:27 | 26,021,088 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 12,157 | java | package com.koushikdutta.ion;
import java.io.File;
import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import java.util.WeakHashMap;
import android.content.Context;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import android.view.ContextThemeWrapper;
import android.widget.ImageView;
import com.google.gson.Gson;
import com.koushikdutta.async.AsyncServer;
import com.koushikdutta.async.future.Future;
import com.koushikdutta.async.future.FutureCallback;
import com.koushikdutta.async.http.AsyncHttpClient;
import com.koushikdutta.async.http.AsyncHttpRequest;
import com.koushikdutta.async.http.ResponseCacheMiddleware;
import com.koushikdutta.async.http.libcore.RawHeaders;
import com.koushikdutta.async.util.HashList;
import com.koushikdutta.ion.bitmap.BitmapInfo;
import com.koushikdutta.ion.bitmap.IonBitmapCache;
import com.koushikdutta.ion.builder.Builders;
import com.koushikdutta.ion.builder.FutureBuilder;
import com.koushikdutta.ion.builder.LoadBuilder;
import com.koushikdutta.ion.cookie.CookieMiddleware;
import com.koushikdutta.ion.loader.AsyncHttpRequestFactory;
import com.koushikdutta.ion.loader.ContentLoader;
import com.koushikdutta.ion.loader.FileLoader;
import com.koushikdutta.ion.loader.HttpLoader;
/**
* Created by koush on 5/21/13.
*/
public class Ion {
public static final Handler mainHandler = new Handler(Looper.getMainLooper());
/**
* Get the default Ion object instance and begin building a request
* with the given uri
* @param context
* @param uri
* @return
*/
public static Builders.Any.B with(Context context, String uri) {
return getDefault(context).build(context, uri);
}
/**
* Get the default Ion object instance and begin building a request
* @param context
* @return
*/
public static LoadBuilder<Builders.Any.B> with(Context context) {
return getDefault(context).build(context);
}
/**
* Get the default Ion object instance and begin building an operation
* on the given file
* @param context
* @param file
* @return
*/
public static FutureBuilder with(Context context, File file) {
return getDefault(context).build(context, file);
}
/**
* Begin building an operation on the given file
* @param context
* @param file
* @return
*/
public FutureBuilder build(Context context, File file) {
return new IonRequestBuilder(context, this).load(file);
}
/**
* Get the default Ion instance
* @param context
* @return
*/
public static Ion getDefault(Context context) {
if (instance == null)
instance = new Ion(context, "ion");
return instance;
}
/**
* Create a ImageView bitmap request builder
* @param imageView
* @return
*/
public static Builders.ImageView.F<? extends Builders.ImageView.F<?>> with(ImageView imageView) {
Ion ion = getDefault(imageView.getContext());
return ion.build(imageView);
}
/**
* Begin building a request with the given uri
* @param context
* @param uri
* @return
*/
public Builders.Any.B build(Context context, String uri) {
return new IonRequestBuilder(context, this).load(uri);
}
/**
* Begin building a request
* @param context
* @return
*/
public LoadBuilder<Builders.Any.B> build(Context context) {
return new IonRequestBuilder(context, this);
}
IonBitmapRequestBuilder bitmapBuilder = new IonBitmapRequestBuilder(this);
/**
* Create a builder that can be used to build an network request
* @param imageView
* @return
*/
public Builders.ImageView.F<? extends Builders.ImageView.F<?>> build(ImageView imageView) {
if (Thread.currentThread() != Looper.getMainLooper().getThread())
throw new IllegalStateException("must be called from UI thread");
bitmapBuilder.reset();
bitmapBuilder.ion = this;
return bitmapBuilder.withImageView(imageView);
}
/**
* Cancel all pending requests associated with the request group
* @param group
*/
public void cancelAll(Object group) {
FutureSet members;
synchronized (this) {
members = inFlight.remove(group);
}
if (members == null)
return;
for (Future future: members.keySet()) {
if (future != null)
future.cancel();
}
}
/**
* Route all http requests through the given proxy.
* @param host
* @param port
*/
public void proxy(String host, int port) {
httpClient.getSocketMiddleware().enableProxy(host, port);
}
/**
* Route all https requests through the given proxy.
* Note that https proxying requires that the Android device has the appropriate
* root certificate installed to function properly.
* @param host
* @param port
*/
public void proxySecure(String host, int port) {
httpClient.getSSLSocketMiddleware().enableProxy(host, port);
}
/**
* Disable routing of http requests through a previous provided proxy
*/
public void disableProxy() {
httpClient.getSocketMiddleware().disableProxy();
}
/**
* Disable routing of https requests through a previous provided proxy
*/
public void disableSecureProxy() {
httpClient.getSocketMiddleware().disableProxy();
}
void removeFutureInFlight(Future future, Object group) {
}
void addFutureInFlight(Future future, Object group) {
if (group == null || future == null || future.isDone() || future.isCancelled())
return;
FutureSet members;
synchronized (this) {
members = inFlight.get(group);
if (members == null) {
members = new FutureSet();
inFlight.put(group, members);
}
}
members.put(future, true);
}
/**
* Cancel all pending requests
*/
public void cancelAll() {
ArrayList<Object> groups;
synchronized (this) {
groups = new ArrayList<Object>(inFlight.keySet());
}
for (Object group: groups)
cancelAll(group);
}
/**
* Cancel all pending requests associated with the given context
* @param context
*/
public void cancelAll(Context context) {
cancelAll((Object)context);
}
public int getPendingRequestCount(Object group) {
synchronized (this) {
FutureSet members = inFlight.get(group);
if (members == null)
return 0;
int ret = 0;
for (Future future: members.keySet()) {
if (!future.isCancelled() && !future.isDone())
ret++;
}
return ret;
}
}
public void dump() {
bitmapCache.dump();
Log.i(LOGTAG, "Pending bitmaps: " + bitmapsPending.size());
Log.i(LOGTAG, "Groups: " + inFlight.size());
for (FutureSet futures: inFlight.values()) {
Log.i(LOGTAG, "Group size: " + futures.size());
}
}
/**
* Get the application Context object in use by this Ion instance
* @return
*/
public Context getContext() {
return context;
}
private static class AsyncHttpRequestFactoryImpl implements AsyncHttpRequestFactory {
@Override
public AsyncHttpRequest createAsyncHttpRequest(URI uri, String method, RawHeaders headers) {
return new AsyncHttpRequest(uri, method, headers);
}
}
AsyncHttpClient httpClient;
CookieMiddleware cookieMiddleware;
ResponseCacheMiddleware responseCache;
static class FutureSet extends WeakHashMap<Future, Boolean> {
}
// maintain a list of futures that are in being processed, allow for bulk cancellation
WeakHashMap<Object, FutureSet> inFlight = new WeakHashMap<Object, FutureSet>();
private void addCookieMiddleware() {
httpClient.insertMiddleware(cookieMiddleware = new CookieMiddleware(context, name));
}
HttpLoader httpLoader;
ContentLoader contentLoader;
FileLoader fileLoader;
public HttpLoader getHttpLoader() {
return httpLoader;
}
public ContentLoader getContentLoader() {
return contentLoader;
}
public FileLoader getFileLoader() {
return fileLoader;
}
String name;
public String getName() {
return name;
}
Context context;
private Ion(Context context, String name) {
httpClient = new AsyncHttpClient(new AsyncServer());
this.context = context = context.getApplicationContext();
this.name = name;
try {
responseCache = ResponseCacheMiddleware.addCache(httpClient, new File(context.getCacheDir(), name), 10L * 1024L * 1024L);
}
catch (Exception e) {
IonLog.w("unable to set up response cache", e);
}
// TODO: Support pre GB?
if (Build.VERSION.SDK_INT >= 9)
addCookieMiddleware();
httpClient.getSocketMiddleware().setConnectAllAddresses(true);
httpClient.getSSLSocketMiddleware().setConnectAllAddresses(true);
bitmapCache = new IonBitmapCache(this);
configure()
.addLoader(httpLoader = new HttpLoader())
.addLoader(contentLoader = new ContentLoader())
.addLoader(fileLoader = new FileLoader());
}
/**
* Get the Cookie middleware that is attached to the AsyncHttpClient instance.
* @return
*/
public CookieMiddleware getCookieMiddleware() {
return cookieMiddleware;
}
/**
* Get the AsyncHttpClient object in use by this Ion instance
* @return
*/
public AsyncHttpClient getHttpClient() {
return httpClient;
}
/**
* Get the AsyncServer reactor in use by this Ion instance
* @return
*/
public AsyncServer getServer() {
return httpClient.getServer();
}
public static class Config {
AsyncHttpRequestFactory asyncHttpRequestFactory = new AsyncHttpRequestFactoryImpl();
public AsyncHttpRequestFactory getAsyncHttpRequestFactory() {
return asyncHttpRequestFactory;
}
public Config setAsyncHttpRequestFactory(AsyncHttpRequestFactory asyncHttpRequestFactory) {
this.asyncHttpRequestFactory = asyncHttpRequestFactory;
return this;
}
ArrayList<Loader> loaders = new ArrayList<Loader>();
public Config addLoader(int index, Loader loader) {
loaders.add(index, loader);
return this;
}
public Config insertLoader(Loader loader) {
loaders.add(0, loader);
return this;
}
public Config addLoader(Loader loader) {
loaders.add(loader);
return this;
}
public List<Loader> getLoaders() {
return loaders;
}
}
String LOGTAG;
int logLevel;
/**
* Set the log level for all requests made by Ion.
* @param logtag
* @param logLevel
*/
public void setLogging(String logtag, int logLevel) {
LOGTAG = logtag;
this.logLevel = logLevel;
}
Config config = new Config();
public Config configure() {
return config;
}
HashList<FutureCallback<BitmapInfo>> bitmapsPending = new HashList<FutureCallback<BitmapInfo>>();
IonBitmapCache bitmapCache;
/**
* Return the bitmap cache used by this Ion instance
* @return
*/
public IonBitmapCache getBitmapCache() {
return bitmapCache;
}
Gson gson = new Gson();
/**
* Get the Gson object in use by this Ion instance.
* This can be used to customize serialization and deserialization
* from java objects.
* @return
*/
public Gson getGson() {
return gson;
}
static Ion instance;
}
| [
"jklinker1@gmail.com"
] | jklinker1@gmail.com |
2ad483158ec2b50d1d045fd87ee370cb96ab8a33 | 95c49f466673952b465e19a5ee3ae6eff76bee00 | /src/main/java/com/zhihu/android/apm/p990a/ANRRecorder.java | 5bff5de3f8367a2ed5e0e3cb1f11b07b95cd28e5 | [] | no_license | Phantoms007/zhihuAPK | 58889c399ae56b16a9160a5f48b807e02c87797e | dcdbd103436a187f9c8b4be8f71bdf7813b6d201 | refs/heads/main | 2023-01-24T01:34:18.716323 | 2020-11-25T17:14:55 | 2020-11-25T17:14:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,601 | java | package com.zhihu.android.apm.p990a;
import android.os.Build;
import android.os.FileObserver;
import android.os.Process;
import android.text.TextUtils;
import com.secneo.apkwrapper.C6969H;
import com.zhihu.android.apm.DroidAPM;
import com.zhihu.android.apm.p1002j.C10393a;
import com.zhihu.android.apm.p990a.ANRWatchDog;
import com.zhihu.android.apm.p994d.JsonLog;
/* renamed from: com.zhihu.android.apm.a.b */
/* compiled from: ANRRecorder */
public class ANRRecorder implements ANRWatchDog.AbstractC10370a {
/* renamed from: a */
private static final String f40702a = "com.zhihu.android.apm.a.b";
/* renamed from: b */
private final int f40703b = Build.VERSION.SDK_INT;
@Override // com.zhihu.android.apm.p990a.ANRWatchDog.AbstractC10370a
/* renamed from: a */
public void mo63353a() {
if (this.f40703b >= 24) {
long currentTimeMillis = System.currentTimeMillis();
JsonLog b = m56181b();
long currentTimeMillis2 = System.currentTimeMillis() - currentTimeMillis;
C10393a.m56409b(C6969H.m41409d("G688DC75AAD35A826F40AD05CFBE8C68D33D98F40E56EF577A6") + currentTimeMillis2);
DroidAPM.m56248a().mo63378a(b);
return;
}
new FileObserverC10368a().startWatching();
Process.sendSignal(Process.myPid(), 3);
}
/* renamed from: b */
private JsonLog m56181b() {
ANRLog a = TracesGenerator.m56204a();
JsonLog aVar = new JsonLog();
aVar.mo63369a(C6969H.m41409d("G688DC725B33FAC"));
aVar.put(C6969H.m41409d("G7D91D419BA23942FF4019D"), C6969H.m41409d("G6A96C60EB03D"));
aVar.put(C6969H.m41409d("G688DC725AB22AA2AE31D"), a.mo63349a());
if (!TextUtils.isEmpty(a.mo63351b())) {
aVar.put(C6969H.m41409d("G688DC725BC31BF2CE1018251"), a.mo63351b());
}
return aVar;
}
/* access modifiers changed from: private */
/* access modifiers changed from: public */
/* renamed from: c */
private JsonLog m56182c() {
ANRLog a = TracesFileParser.m56199a();
String a2 = a.mo63349a();
if (TextUtils.isEmpty(a2)) {
return null;
}
JsonLog aVar = new JsonLog();
aVar.mo63369a(C6969H.m41409d("G688DC725B33FAC"));
aVar.put(C6969H.m41409d("G7D91D419BA23942FF4019D"), C6969H.m41409d("G7A9AC60EBA3D942FEF0295"));
aVar.put(C6969H.m41409d("G688DC725AB22AA2AE31D"), a2);
if (!TextUtils.isEmpty(a.mo63351b())) {
aVar.put(C6969H.m41409d("G688DC725BC31BF2CE1018251"), a.mo63351b());
}
return aVar;
}
/* renamed from: com.zhihu.android.apm.a.b$a */
/* compiled from: ANRRecorder */
private class FileObserverC10368a extends FileObserver {
/* renamed from: b */
private boolean f40705b = false;
FileObserverC10368a() {
super("/data/anr/traces.txt", 24);
}
public void onEvent(int i, String str) {
if (!this.f40705b) {
int i2 = i & 4095;
if (i2 == 8 || i2 == 16) {
this.f40705b = true;
stopWatching();
m56184a();
}
}
}
/* renamed from: a */
private void m56184a() {
JsonLog c = ANRRecorder.this.m56182c();
if (c != null) {
DroidAPM.m56248a().mo63378a(c);
} else {
C10393a.m56411c(C6969H.m41409d("G2687D40EBE7FAA27F441845AF3E6C6C42797CD0EFF20AA3BF50BD04EF3ECCF96"));
}
}
}
}
| [
"seasonpplp@qq.com"
] | seasonpplp@qq.com |
c9dffa1a9bf57a8cde940426e6c6b942646cc759 | 7df9cecfa4a013e163f06d0839fd9b813e78c368 | /src/raytracer/utilities/Point3D.java | 96f15eab330d3cff5210b265283ef2c450c2f279 | [] | no_license | manishsinghrawat/Realistic-Ray-Tracer | 95c7fe251ff988af18321703991f503462a7da9a | 99c2c280ce164bccb6d345c62ef6fc04ab4bf283 | refs/heads/master | 2016-09-01T17:12:36.692250 | 2014-11-10T09:08:23 | 2014-11-10T09:08:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,755 | java | package raytracer.utilities;
public class Point3D {
public double x, y, z;
public Point3D(){
x = y = z = 0;
}
public Point3D(double a){
x = y = z = a;
}
public Point3D(double a, double b, double c){
x = a;
y = b;
z = c;
}
public Point3D(Point3D p){
this.x = p.x;
this.y = p.y;
this.z = p.z;
}
public Point3D(Vector3D p){
this.x = p.x;
this.y = p.y;
this.z = p.z;
}
public void set (Point3D p) {
if (this != p) {
x = p.x; y = p.y; z = p.z;
}
}
public double distance(Point3D p) {
return (Math.sqrt( (x - p.x) * (x - p.x)
+ (y - p.y) * (y - p.y)
+ (z - p.z) * (z - p.z) ));
}
public Point3D minus() {
return new Point3D(-x, -y, -z);
}
public Vector3D subtract(Point3D p){
return new Vector3D(x - p.x,y - p.y,z - p.z);
}
public Point3D add(Vector3D v) {
return new Point3D(x + v.x, y + v.y, z + v.z);
}
public Point3D subtract(Vector3D v) {
return new Point3D(x - v.x, y - v.y, z - v.z);
}
public Point3D multiply(double a) {
return new Point3D(x * a,y * a,z * a);
}
public double d_squared(Point3D p) {
return ( (x - p.x) * (x - p.x)
+ (y - p.y) * (y - p.y)
+ (z - p.z) * (z - p.z) );
}
public boolean equals(Object obj) {
if (obj == null || this.getClass() != obj.getClass()) {
return false;
}
else {
Point3D other = (Point3D)obj;
return (this.x==other.x && this.y==other.y && this.z==other.z);
}
}
public String toString() {
return "Point3D: (" + x + "," + y + "," + z + ")";
}
// static methods
// non-member function
// -------------------------------------------------------------- operator*
// multiplication by a double on the left
public static Point3D multiply (double a, Point3D p) {
return new Point3D(a * p.x, a * p.y, a * p.z);
}
public static Point3D multiply (Matrix mat, Point3D p) {
return new Point3D(mat.m[0][0] * p.x + mat.m[0][1] * p.y + mat.m[0][2] * p.z + mat.m[0][3],
mat.m[1][0] * p.x + mat.m[1][1] * p.y + mat.m[1][2] * p.z + mat.m[1][3],
mat.m[2][0] * p.x + mat.m[2][1] * p.y + mat.m[2][2] * p.z + mat.m[2][3]);
}
public static Point3D add(Point3D p, Vector3D p2) {
return new Point3D(p.x + p2.x,
p.y + p2.y,
p.z + p2.z);
}
public static Vector3D subtract(Point3D p1, Point3D p2) {
return new Vector3D(p1.x - p2.x,
p1.y - p2.y,
p1.z - p2.z);
}
public static Point3D subtract(Point3D p, Vector3D v) {
return new Point3D(p.x - v.x,
p.y - v.y,
p.z - v.z);
}
public static Point3D minus(Point3D p) {
return new Point3D(-p.x, -p.y, -p.z);
}
public static double d_squared(Point3D p1, Point3D p2) {
return ( (p1.x - p2.x) * (p1.x - p2.x)
+ (p1.y - p2.y) * (p1.y - p2.y)
+ (p1.z - p2.z) * (p1.z - p2.z) );
}
}
| [
"coolpuneet0007@gmail.com"
] | coolpuneet0007@gmail.com |
129ea051f7af8592e4c1d1563cdc9ce1f7a0f9bd | ae5eb1a38b4d22c82dfd67c86db73592094edc4b | /project313/src/test/java/org/gradle/test/performance/largejavamultiproject/project313/p1565/Test31314.java | 143ce38dda0d09caee5f4cd03387f26b323b6da6 | [] | no_license | big-guy/largeJavaMultiProject | 405cc7f55301e1fd87cee5878a165ec5d4a071aa | 1cd6a3f9c59e9b13dffa35ad27d911114f253c33 | refs/heads/main | 2023-03-17T10:59:53.226128 | 2021-03-04T01:01:39 | 2021-03-04T01:01:39 | 344,307,977 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,113 | java | package org.gradle.test.performance.largejavamultiproject.project313.p1565;
import org.junit.Test;
import static org.junit.Assert.*;
public class Test31314 {
Production31314 objectUnderTest = new Production31314();
@Test
public void testProperty0() {
String value = "value";
objectUnderTest.setProperty0(value);
assertEquals(value, objectUnderTest.getProperty0());
}
@Test
public void testProperty1() {
String value = "value";
objectUnderTest.setProperty1(value);
assertEquals(value, objectUnderTest.getProperty1());
}
@Test
public void testProperty2() {
String value = "value";
objectUnderTest.setProperty2(value);
assertEquals(value, objectUnderTest.getProperty2());
}
@Test
public void testProperty3() {
String value = "value";
objectUnderTest.setProperty3(value);
assertEquals(value, objectUnderTest.getProperty3());
}
@Test
public void testProperty4() {
String value = "value";
objectUnderTest.setProperty4(value);
assertEquals(value, objectUnderTest.getProperty4());
}
@Test
public void testProperty5() {
String value = "value";
objectUnderTest.setProperty5(value);
assertEquals(value, objectUnderTest.getProperty5());
}
@Test
public void testProperty6() {
String value = "value";
objectUnderTest.setProperty6(value);
assertEquals(value, objectUnderTest.getProperty6());
}
@Test
public void testProperty7() {
String value = "value";
objectUnderTest.setProperty7(value);
assertEquals(value, objectUnderTest.getProperty7());
}
@Test
public void testProperty8() {
String value = "value";
objectUnderTest.setProperty8(value);
assertEquals(value, objectUnderTest.getProperty8());
}
@Test
public void testProperty9() {
String value = "value";
objectUnderTest.setProperty9(value);
assertEquals(value, objectUnderTest.getProperty9());
}
} | [
"sterling.greene@gmail.com"
] | sterling.greene@gmail.com |
8a18a736b702f6f3e0e57971ad75bd0aa9201419 | 0f190ca465d255c68ee4929370260eea0c68b13d | /productFactory/src/com/neusoft/unieap/techcomp/ria/individual/bo/impl/PageIndividualBOImpl.java | d456410a7180a70bd6c6dff583528e6b049264bc | [] | no_license | Abbyli/productFactory | d20e01bd73d00db4934ca2f68e0b37d28ba0d6e7 | 06d21f37161f14b26bb10e59d9525a5323a9cc02 | refs/heads/master | 2020-05-27T21:19:34.439297 | 2017-12-17T13:56:44 | 2017-12-17T13:56:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,234 | java | package com.neusoft.unieap.techcomp.ria.individual.bo.impl;
import com.neusoft.unieap.core.annotation.ModelFile;
import com.neusoft.unieap.core.base.model.DCRepository;
import com.neusoft.unieap.core.base.model.DevelopmentComponent;
import com.neusoft.unieap.core.base.model.SCActivator;
import com.neusoft.unieap.core.base.model.SCRepository;
import com.neusoft.unieap.core.base.model.SoftwareComponent;
import com.neusoft.unieap.core.exception.UniEAPBusinessException;
import com.neusoft.unieap.core.validation.i18n.I18nGlobalContext;
import com.neusoft.unieap.techcomp.ria.individual.bo.PageIndividualBO;
import com.neusoft.unieap.techcomp.ria.individual.dao.PageIndividualDAO;
import com.neusoft.unieap.techcomp.ria.individual.dto.PageDTO;
import com.neusoft.unieap.techcomp.ria.individual.entity.Page;
import com.neusoft.unieap.techcomp.ria.individual.entity.PageIndividual;
import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.UUID;
import javax.servlet.ServletContext;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.filefilter.FileFilterUtils;
@ModelFile("pageIndividualBO.bo")
public class PageIndividualBOImpl
implements PageIndividualBO
{
private PageIndividualDAO pageIndividualDAO;
public void setPageIndividualDAO(PageIndividualDAO paramPageIndividualDAO)
{
this.pageIndividualDAO = paramPageIndividualDAO;
}
public Page savePage(Page paramPage)
{
String str = paramPage.getCircumstanceId();
if (this.pageIndividualDAO.isCircumstanceExist(str)) {
throw new UniEAPBusinessException("EAPTECHRIA1003",
new Object[] { str });
}
return this.pageIndividualDAO.savePage(paramPage);
}
public Page updatePage(Page paramPage)
{
String str1 = paramPage.getCircumstanceId();
String str2 = paramPage.getId();
if (this.pageIndividualDAO.isCircumstanceExistExceptCurrId(str2,
str1)) {
throw new UniEAPBusinessException("EAPTECHRIA1003",
new Object[] { str1 });
}
Page localPage = getPageById(str2);
if (localPage != null) {
if (!(localPage.getCircumstanceId().equals(str1)))
{
this.pageIndividualDAO.updatePageIndividualInfo(localPage
.getCircumstanceId(), str1);
}
localPage.setCircumstanceId(str1);
localPage.setDescription(paramPage.getDescription());
}
return this.pageIndividualDAO.updatePage(localPage);
}
public void deletePage(String paramString)
{
this.pageIndividualDAO.deletePage(paramString);
this.pageIndividualDAO.deletePageIndividualInfo(paramString);
}
public List getSCs()
{
List localList = SCRepository.getSoftwareComponents();
ArrayList localArrayList = new ArrayList();
if ((localList != null) && (localList.size() > 0)) {
for (int i = 0; i < localList.size(); ++i) {
PageDTO localPageDTO = new PageDTO();
localPageDTO.setId(((SCActivator)localList.get(i)).getId());
localPageDTO.setLabel(((SCActivator)localList.get(i)).getId());
localPageDTO.setParentID("-1");
localPageDTO.setUrl("");
localPageDTO.setType("SC");
localArrayList.add(localPageDTO);
}
}
return localArrayList;
}
public List getDCsBySCId(String paramString)
{
List localList = DCRepository.getAvailableDevelopmentComponent();
ArrayList localArrayList = new ArrayList();
if ((localList != null) && (localList.size() > 0)) {
DevelopmentComponent localDevelopmentComponent = null;
for (int i = 0; i < localList.size(); ++i) {
localDevelopmentComponent = (DevelopmentComponent)localList.get(i);
if (paramString.equals(localDevelopmentComponent.getSoftwareComponent().getId())) {
PageDTO localPageDTO = new PageDTO();
localPageDTO.setId(localDevelopmentComponent.getId());
localPageDTO.setLabel(localDevelopmentComponent.getId());
localPageDTO.setParentID(paramString);
localPageDTO.setUrl("");
localPageDTO.setType("DC");
localArrayList.add(localPageDTO);
}
}
}
return localArrayList;
}
public List getChildFilesByDCId(String paramString)
{
if (DCRepository.getDevelopmentComponent(paramString) == null)
return null;
String str1 = DCRepository.getDevelopmentComponent(paramString)
.getSoftwareComponent().getId();
String str2 = I18nGlobalContext.getInstance()
.getServletContext().getRealPath(File.separator);
str2 =
str2 + File.separator;
File localFile1 = new File(str2 + str1 + File.separator + paramString);
ArrayList localArrayList = new ArrayList();
if (localFile1.isDirectory()) {
File[] arrayOfFile2;
File[] arrayOfFile1 = localFile1.listFiles();
int j = (arrayOfFile2 = arrayOfFile1).length; for (int i = 0; i < j; ++i) { Object localObject;
File localFile2 = arrayOfFile2[i];
if (localFile2.isDirectory()) {
localObject = FileUtils.listFiles(localFile2,
FileFilterUtils.suffixFileFilter("-view.jsp"),
FileFilterUtils.directoryFileFilter());
if ((localObject != null) && (((Collection)localObject).size() > 0)) {
PageDTO localPageDTO = new PageDTO();
localPageDTO.setId(UUID.randomUUID().toString());
localPageDTO.setLabel(localFile2.getName());
localPageDTO.setParentID(paramString);
localPageDTO.setType("Folder");
localPageDTO.setUrl(localFile2.getPath().substring(
str2.length() - 1).replace(
File.separator, "/"));
localArrayList.add(localPageDTO);
}
} else if (localFile2.getName().endsWith("-view.jsp")) {
localObject = new PageDTO();
((PageDTO)localObject).setId(UUID.randomUUID().toString());
((PageDTO)localObject).setLabel(localFile2.getName());
((PageDTO)localObject).setParentID(paramString);
((PageDTO)localObject).setType("Page");
((PageDTO)localObject).setUrl(localFile2.getPath().substring(
str2.length() - 1).replace(File.separator,
"/"));
localArrayList.add(localObject);
}
}
}
return ((List)localArrayList);
}
public List getChildFilesByFolder(String paramString1, String paramString2)
{
String str = I18nGlobalContext.getInstance()
.getServletContext().getRealPath(File.separator);
str =
str + File.separator;
File localFile1 = new File(str + paramString2.replace("/", File.separator));
ArrayList localArrayList = new ArrayList();
if (localFile1.isDirectory()) {
File[] arrayOfFile2;
File[] arrayOfFile1 = localFile1.listFiles();
int j = (arrayOfFile2 = arrayOfFile1).length; for (int i = 0; i < j; ++i) { Object localObject;
File localFile2 = arrayOfFile2[i];
if (localFile2.isDirectory()) {
localObject = FileUtils.listFiles(localFile2,
FileFilterUtils.suffixFileFilter("-view.jsp"),
FileFilterUtils.directoryFileFilter());
if ((localObject != null) && (((Collection)localObject).size() > 0)) {
PageDTO localPageDTO = new PageDTO();
localPageDTO.setId(UUID.randomUUID().toString());
localPageDTO.setLabel(localFile2.getName());
localPageDTO.setParentID(paramString1);
localPageDTO.setType("Folder");
localPageDTO.setUrl(localFile2.getPath().substring(
str.length() - 1).replace(
File.separator, "/"));
localArrayList.add(localPageDTO);
}
} else if (localFile2.getName().endsWith("-view.jsp")) {
localObject = new PageDTO();
((PageDTO)localObject).setId(UUID.randomUUID().toString());
((PageDTO)localObject).setLabel(localFile2.getName());
((PageDTO)localObject).setParentID(paramString1);
((PageDTO)localObject).setType("Page");
((PageDTO)localObject).setUrl(localFile2.getPath().substring(
str.length() - 1).replace(File.separator,
"/"));
localArrayList.add(localObject);
}
}
}
return ((List)localArrayList);
}
public List getCircumstancesByPage(String paramString1, String paramString2)
{
List localList = this.pageIndividualDAO.getPagesByURL(paramString2);
ArrayList localArrayList = new ArrayList();
if ((localList != null) && (localList.size() > 0)) {
for (int i = 0; i < localList.size(); ++i) {
PageDTO localPageDTO = new PageDTO();
localPageDTO.setId(((Page)localList.get(i)).getId());
localPageDTO.setLabel(((Page)localList.get(i)).getCircumstanceId());
localPageDTO.setParentID(paramString1);
localPageDTO.setUrl(((Page)localList.get(i)).getUrl());
localPageDTO.setType("Circumstance");
localPageDTO.setIsLeaf(Boolean.valueOf(true));
localArrayList.add(localPageDTO);
}
}
return localArrayList;
}
public Page getPageById(String paramString)
{
return this.pageIndividualDAO.getPageById(paramString);
}
public List getPageIndividualList(String paramString1, String paramString2)
{
return this.pageIndividualDAO.getPageIndividualList(paramString1,
paramString2);
}
public List savePageIndividualList(List paramList)
{
ArrayList localArrayList = new ArrayList();
if (paramList != null) {
for (Iterator localIterator = paramList.iterator(); localIterator.hasNext(); ) { Object localObject = localIterator.next();
PageIndividual localPageIndividual = (PageIndividual)localObject;
String str1 = localPageIndividual.getId();
String str2 = localPageIndividual.getIndividualType();
if (str1 == null) {
if (!(str2.equals("writely"))) {
localPageIndividual = this.pageIndividualDAO
.savePageIndividual(localPageIndividual);
}
}
else if (str2.equals("writely"))
localArrayList.add(localPageIndividual);
else {
this.pageIndividualDAO.updatePageIndividual(localPageIndividual);
}
}
}
if (localArrayList.size() > 0) {
this.pageIndividualDAO.deletePageIndividualList(localArrayList);
paramList.removeAll(localArrayList);
}
return paramList;
}
public String getSCIds()
{
StringBuilder localStringBuilder = new StringBuilder();
List localList = SCRepository.getSoftwareComponents();
if ((localList == null) || (localList.size() == 0)) {
return "";
}
int i = localList.size();
for (int j = 0; j < i; ++j) {
localStringBuilder.append(((SoftwareComponent)localList.get(j)).getId());
if (j != i - 1) {
localStringBuilder.append(",");
}
}
return localStringBuilder.toString();
}
} | [
"Administrator@XB-20160814PUNO"
] | Administrator@XB-20160814PUNO |
104ef918a95deec1e44099864f6683f4da18cb8c | cda86941684b7e0c964c065e14683ba5321ec724 | /src/main/java/com/example/demo/controller/UserController.java | e2e5a26e2b3563db554eb02013f2a3a06cf56c13 | [] | no_license | SanjithSivapuram/InvoiceBeneficiary-SpringBoot | 907cac608024912c4f466cac35b5dc52cb47106e | b49f37e5c8afddb900f26f64875c86d68e0bf61c | refs/heads/master | 2023-07-13T20:45:35.362536 | 2021-08-20T11:22:12 | 2021-08-20T11:22:12 | 397,659,165 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,588 | java | package com.example.demo.controller;
import java.security.Principal;
import java.util.Base64;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.example.demo.model.User;
import com.example.demo.repository.UserRepository;
@RestController
@CrossOrigin(origins = "http://localhost:59279", methods = {RequestMethod.POST, RequestMethod.GET, RequestMethod.PUT, RequestMethod.DELETE})
public class UserController {
@Autowired
private UserRepository userRepository;
@Autowired
private PasswordEncoder passwordEncoder;
@PostMapping("/sign-up")
public void postUser(@RequestBody User user) {
String code = user.getUsername();
String username = new String(Base64.getDecoder().decode(code)).split(":")[0];
String password = new String(Base64.getDecoder().decode(code)).split(":")[1];
user.setUsername(username);
user.setPassword(password);
String encPassword = passwordEncoder.encode(password);
user.setPassword(encPassword);
userRepository.save(user);
}
@GetMapping("/login")
public Principal login(Principal p) {
if (p.getName() == null) {
throw new Error("Invalid Credentials");
}
return p;
}
}
| [
"sanjithsivapuram@gmail.com"
] | sanjithsivapuram@gmail.com |
ccf5e94ce6eff6dfc71f2b0e73a1411da745ce8b | 03a1e0b9f9557cb2d8bb59dd82f35bb208da90c5 | /app/src/main/java/com/xnf/henghenghui/logic/BaseManager.java | 48db0fa816c4aa9c78d98099aa69555c92b68960 | [] | no_license | chenshunyao/PigCollege | 4db3334a2851e0cf3d9bf7cd5c52dbd0e3970b33 | e5e5bf6147c22863fc8de7b23a87ff95d7a764cc | refs/heads/master | 2021-01-20T06:12:57.599344 | 2017-04-30T14:54:22 | 2017-04-30T14:54:22 | 89,855,899 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 603 | java | package com.xnf.henghenghui.logic;
import com.xnf.henghenghui.ui.utils.HenghenghuiHandler;
import com.xnf.henghenghui.util.L;
import java.util.logging.Handler;
/**
* Created by Administrator on 2016/1/22.
*/
public class BaseManager {
public static int sRequestNum = 20;
protected static HenghenghuiHandler mHandler;
public static void setHandler(HenghenghuiHandler handler){
mHandler=handler;
}
public static String getRequestBody(String jsonString){
L.d("csy", "jsonString:" + jsonString);
return "{"+"\"request\""+":" + jsonString + "}";
}
}
| [
"chenshun_310@163.com"
] | chenshun_310@163.com |
1c8267260d575878fddb04d36575e87b545cc0f9 | da5a2d2050ac529a19e14a8ea3f9f21714cc2b5d | /app/src/main/java/com/fasterxml/jackson/databind/node/POJONode.java | afef421070ddb12e489ab0f07db919201015aaf4 | [] | no_license | F0rth/Izly | 851bf22e53ea720fd03f03269d015efd7d8de5a4 | 89af45cedfc38e370a64c9fa341815070cdf49d6 | refs/heads/master | 2021-07-17T15:39:25.947444 | 2017-10-21T10:05:58 | 2017-10-21T10:05:58 | 108,004,099 | 1 | 1 | null | 2017-10-23T15:51:00 | 2017-10-23T15:51:00 | null | UTF-8 | Java | false | false | 2,952 | java | package com.fasterxml.jackson.databind.node;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonToken;
import com.fasterxml.jackson.databind.JsonSerializable;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.util.RawValue;
import java.io.IOException;
public class POJONode extends ValueNode {
protected final Object _value;
public POJONode(Object obj) {
this._value = obj;
}
protected boolean _pojoEquals(POJONode pOJONode) {
return this._value == null ? pOJONode._value == null : this._value.equals(pOJONode._value);
}
public boolean asBoolean(boolean z) {
return (this._value == null || !(this._value instanceof Boolean)) ? z : ((Boolean) this._value).booleanValue();
}
public double asDouble(double d) {
return this._value instanceof Number ? ((Number) this._value).doubleValue() : d;
}
public int asInt(int i) {
return this._value instanceof Number ? ((Number) this._value).intValue() : i;
}
public long asLong(long j) {
return this._value instanceof Number ? ((Number) this._value).longValue() : j;
}
public String asText() {
return this._value == null ? "null" : this._value.toString();
}
public String asText(String str) {
return this._value == null ? str : this._value.toString();
}
public JsonToken asToken() {
return JsonToken.VALUE_EMBEDDED_OBJECT;
}
public byte[] binaryValue() throws IOException {
return this._value instanceof byte[] ? (byte[]) this._value : super.binaryValue();
}
public boolean equals(Object obj) {
return obj == this ? true : (obj == null || !(obj instanceof POJONode)) ? false : _pojoEquals((POJONode) obj);
}
public JsonNodeType getNodeType() {
return JsonNodeType.POJO;
}
public Object getPojo() {
return this._value;
}
public int hashCode() {
return this._value.hashCode();
}
public final void serialize(JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
if (this._value == null) {
serializerProvider.defaultSerializeNull(jsonGenerator);
} else if (this._value instanceof JsonSerializable) {
((JsonSerializable) this._value).serialize(jsonGenerator, serializerProvider);
} else {
jsonGenerator.writeObject(this._value);
}
}
public String toString() {
if (this._value instanceof byte[]) {
return String.format("(binary value of %d bytes)", new Object[]{Integer.valueOf(((byte[]) this._value).length)});
} else if (!(this._value instanceof RawValue)) {
return String.valueOf(this._value);
} else {
return String.format("(raw value '%s')", new Object[]{((RawValue) this._value).toString()});
}
}
}
| [
"baptiste.robert@sigma.se"
] | baptiste.robert@sigma.se |
e2ef578c415d181d9ad9a3ed67947b80e34bebd8 | c359beff19d9fbb944ef04e28b3e7f9e59a742a2 | /sources/com/android/systemui/statusbar/phone/BarTransitions.java | 26caa77bf4e0a1fd42ac934590f41c548123a001 | [] | no_license | minz1/MIUISystemUI | 872075cae3b18a86f58c5020266640e89607ba17 | 5cd559e0377f0e51ad4dc0370cac445531567c6d | refs/heads/master | 2020-07-16T05:43:35.778470 | 2019-09-01T21:12:11 | 2019-09-01T21:12:11 | 205,730,364 | 3 | 1 | null | null | null | null | UTF-8 | Java | false | false | 9,111 | java | package com.android.systemui.statusbar.phone;
import android.animation.TimeInterpolator;
import android.app.ActivityManager;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.SystemClock;
import android.util.Log;
import android.view.View;
import android.view.animation.LinearInterpolator;
import com.android.systemui.Constants;
import com.android.systemui.R;
import miui.util.CustomizeUtil;
public class BarTransitions {
private static final boolean DEBUG = Constants.DEBUG;
public static final boolean HIGH_END = ActivityManager.isHighEndGfx();
private final BarBackgroundDrawable mBarBackground;
private int mMode;
private final String mTag;
private final View mView;
private static class BarBackgroundDrawable extends Drawable {
private boolean mAnimating;
private Context mAppContext;
private int mColor;
private int mColorStart;
private boolean mDisableChangeBg;
private long mEndTime;
private int mForceBgColor;
private final Drawable mGradient;
private int mGradientAlpha;
private int mGradientAlphaStart;
private final TimeInterpolator mInterpolator;
private int mMode = -1;
private int mOpaqueColor;
private final int mOpaqueColorId;
private final int mSemiTransparent;
private long mStartTime;
private final int mTransparent;
private final int mWarning;
public BarBackgroundDrawable(Context context, int gradientResourceId, int opaqueColorResId) {
this.mAppContext = context.getApplicationContext();
Resources resources = context.getResources();
this.mOpaqueColorId = opaqueColorResId;
this.mOpaqueColor = context.getColor(opaqueColorResId);
this.mSemiTransparent = context.getColor(R.color.system_bar_background_semi_transparent);
this.mTransparent = context.getColor(R.color.system_bar_background_transparent);
this.mWarning = -65536;
this.mGradient = context.getDrawable(gradientResourceId);
this.mInterpolator = new LinearInterpolator();
}
public void setForceBgColor(int color) {
if (this.mForceBgColor != color) {
this.mForceBgColor = color;
invalidateSelf();
}
}
public void disableChangeBg(boolean disable) {
if (this.mDisableChangeBg != disable) {
this.mDisableChangeBg = disable;
invalidateSelf();
}
}
public void setAlpha(int alpha) {
}
public void setColorFilter(ColorFilter colorFilter) {
}
/* access modifiers changed from: protected */
public void onBoundsChange(Rect bounds) {
super.onBoundsChange(bounds);
this.mGradient.setBounds(bounds);
}
public void applyModeBackground(int oldMode, int newMode, boolean animate) {
if (this.mMode != newMode) {
this.mMode = newMode;
this.mAnimating = animate;
if (animate) {
long now = SystemClock.elapsedRealtime();
this.mStartTime = now;
this.mEndTime = 200 + now;
this.mGradientAlphaStart = this.mGradientAlpha;
this.mColorStart = this.mColor;
}
invalidateSelf();
}
}
public int getOpacity() {
return -3;
}
public void finishAnimation() {
if (this.mAnimating) {
this.mAnimating = false;
invalidateSelf();
}
}
public void darkModeChanged() {
this.mOpaqueColor = this.mAppContext.getColor(this.mOpaqueColorId);
}
public void draw(Canvas canvas) {
int targetColor;
if (this.mMode == 5) {
targetColor = this.mWarning;
} else if (this.mMode == 1) {
targetColor = this.mSemiTransparent;
} else if (this.mMode == 4 || this.mMode == 2 || this.mMode == 6) {
targetColor = this.mTransparent;
} else {
targetColor = this.mOpaqueColor;
}
if (CustomizeUtil.needChangeSize() && !this.mDisableChangeBg) {
targetColor = this.mForceBgColor;
}
if (!this.mAnimating) {
this.mColor = targetColor;
this.mGradientAlpha = 0;
} else {
long now = SystemClock.elapsedRealtime();
if (now >= this.mEndTime) {
this.mAnimating = false;
this.mColor = targetColor;
this.mGradientAlpha = 0;
} else {
float v = Math.max(0.0f, Math.min(this.mInterpolator.getInterpolation(((float) (now - this.mStartTime)) / ((float) (this.mEndTime - this.mStartTime))), 1.0f));
this.mGradientAlpha = (int) ((((float) 0) * v) + (((float) this.mGradientAlphaStart) * (1.0f - v)));
this.mColor = Color.argb((int) ((((float) Color.alpha(targetColor)) * v) + (((float) Color.alpha(this.mColorStart)) * (1.0f - v))), (int) ((((float) Color.red(targetColor)) * v) + (((float) Color.red(this.mColorStart)) * (1.0f - v))), (int) ((((float) Color.green(targetColor)) * v) + (((float) Color.green(this.mColorStart)) * (1.0f - v))), (int) ((((float) Color.blue(targetColor)) * v) + (((float) Color.blue(this.mColorStart)) * (1.0f - v))));
}
}
if (this.mGradientAlpha > 0) {
this.mGradient.setAlpha(this.mGradientAlpha);
this.mGradient.draw(canvas);
}
if (Color.alpha(this.mColor) > 0) {
canvas.drawColor(this.mColor);
}
if (this.mAnimating) {
invalidateSelf();
}
}
}
public BarTransitions(View view, int gradientResourceId, int opaqueColorResId) {
this.mTag = "BarTransitions." + view.getClass().getSimpleName();
this.mView = view;
this.mBarBackground = new BarBackgroundDrawable(this.mView.getContext(), gradientResourceId, opaqueColorResId);
if (HIGH_END) {
this.mView.setBackground(this.mBarBackground);
}
}
public int getMode() {
return this.mMode;
}
public void transitionTo(int mode, boolean animate) {
if (!HIGH_END && (mode == 1 || mode == 2 || mode == 4)) {
mode = 0;
}
if (!HIGH_END && mode == 6) {
mode = 3;
}
if (this.mMode != mode) {
int oldMode = this.mMode;
this.mMode = mode;
if (DEBUG) {
Log.d(this.mTag, String.format("%s -> %s animate=%s", new Object[]{modeToString(oldMode), modeToString(mode), Boolean.valueOf(animate)}));
}
onTransition(oldMode, this.mMode, animate);
}
}
/* access modifiers changed from: protected */
public void onTransition(int oldMode, int newMode, boolean animate) {
if (HIGH_END) {
applyModeBackground(oldMode, newMode, animate);
}
}
/* access modifiers changed from: protected */
public void applyModeBackground(int oldMode, int newMode, boolean animate) {
if (DEBUG) {
Log.d(this.mTag, String.format("applyModeBackground oldMode=%s newMode=%s animate=%s", new Object[]{modeToString(oldMode), modeToString(newMode), Boolean.valueOf(animate)}));
}
this.mBarBackground.applyModeBackground(oldMode, newMode, animate);
}
public void setForceBgColor(int color) {
this.mBarBackground.setForceBgColor(color);
}
public void disableChangeBg(boolean disable) {
this.mBarBackground.disableChangeBg(disable);
}
public void darkModeChanged() {
this.mBarBackground.darkModeChanged();
}
public static String modeToString(int mode) {
if (mode == 0) {
return "MODE_OPAQUE";
}
if (mode == 1) {
return "MODE_SEMI_TRANSPARENT";
}
if (mode == 2) {
return "MODE_TRANSLUCENT";
}
if (mode == 3) {
return "MODE_LIGHTS_OUT";
}
if (mode == 4) {
return "MODE_TRANSPARENT";
}
if (mode == 5) {
return "MODE_WARNING";
}
if (mode == 6) {
return "MODE_LIGHTS_OUT_TRANSPARENT";
}
return "Unknown mode " + mode;
}
public void finishAnimations() {
this.mBarBackground.finishAnimation();
}
/* access modifiers changed from: protected */
public boolean isLightsOut(int mode) {
return false;
}
}
| [
"emerytang@gmail.com"
] | emerytang@gmail.com |
e2f7e7395f5a9e153269f382f963a359bc53db2d | a4cd716b2ca29324888102e610455fb65d352079 | /src/MovieDriver.java | ec907d66953b2517a90bc2c56c9b5898d2f8585c | [] | no_license | morriscasey/SetHelper | 5954e510b31b6ccff137b06e28eba48e8ac22616 | 2c201bf56b51d948dc8e6b250d5b5c6db86c3674 | refs/heads/master | 2021-01-19T19:31:15.574340 | 2015-01-31T05:57:31 | 2015-01-31T05:57:31 | 30,103,623 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,801 | java | import com.sun.tools.javac.util.Name;
import java.io.*;
import java.util.*;
/**
* Description: This driver is to test the Movie class and SetHelper class.
* Created by Casey Morris on 1/22/15.
*/
public class MovieDriver {
public static void main(String[] args)
{
System.out.println("Welcome to Moviefone");
Set<Movie> library = new HashSet<Movie>(); // HashSet or TreeSet
Set<Movie> favorites = new HashSet<Movie>();
Set<Movie> watched = new HashSet<Movie>();
Set<Movie> recentlyWatched = new HashSet<Movie>();
Set<Movie> comedies = new HashSet<Movie>();
Set<Movie> dramas = new HashSet<Movie>();
Set<Movie> action = new HashSet<Movie>();
Movie m1 = new Movie("Seven Samurai",1954);
Movie m2 = new Movie("Spirited Away",2001);
Movie m3 = new Movie("Amélie",2001);
Movie m4 = new Movie("Toy Story 3",2010);
Movie m5 = new Movie("Taxi Driver",1976);
library.add(m1);
library.add(m2);
library.add(m3);
library.add(m4);
library.add(m5);
watched.add(m1);
watched.add(m2);
watched.add(m2);
recentlyWatched.add(m1);
recentlyWatched.add(m3);
favorites.add(m3);
favorites.add(m1);
favorites.add(m4);
comedies.add(m4);
System.out.println("Library contains " + library);
System.out.println("Favorites contains " + favorites);
SetHelper helper = new SetHelper();
Set<Movie> watchedDramas = new HashSet<Movie>(watched);
watchedDramas.retainAll(favorites);
//What movies have I not watched?
Set<Movie> unwatched = helper.difference(library, watched);
//Which of my favorite movies are comedies?
Set<Movie> favoriteComedies = helper.intersect(favorites,comedies);
//Which comedies have I not watched yet?
Set<Movie> unwatchedComedies = helper.intersect(comedies, unwatched);
//Are there any action-comedy movies I haven’t seen yet?
Set<Movie> actionComedies = helper.intersect(action, comedies);
System.out.println(watchedDramas);
favorites.clear();
/*
Map<Movie, Integer> watchedCount = new HashMap<Movie, Integer>();
watchedCount.put(m3,5);
watchedCount.put(m2,2);
watchedCount.put(m1,2);
//watchedCount.put(m1,8); // Can't do this only one item in the set
//View Map
System.out.println("Key: " + watchedCount.keySet()+ " " + "Value" + watchedCount.values());
*/
// A map that associates number of views of a movie
Map<Movie, Integer> movieViews = new HashMap<Movie, Integer>();
// Example of putting two views of movie m1
movieViews.put(m1,2);
movieViews.put(m2,6);
movieViews.put(m3,3);
Queue<Movie> playList = new LinkedList<Movie>();
// adds movie m1 to the end of playList
playList.add(m1);
playList.add(m2);
playList.add(m3);
// peek at the first movie in the playList
Movie firstToPlay = playList.element();
System.out.println("First movie to play: "+ firstToPlay);
// removes the first movie in the playList
System.out.println("Remove: "+ playList.remove());
// peek at the first movie in the playList
firstToPlay = playList.element();
System.out.println("First movie to play: "+ firstToPlay);
// removes the second movie which is now the first in the playList
System.out.println("Remove: "+ playList.remove());
// peek at the first movie in the playList
firstToPlay = playList.element();
System.out.println("First movie to play: "+ firstToPlay);
}
}
| [
"casemorris@hotmail.com"
] | casemorris@hotmail.com |
350c0894049439177aa277f1198b0eddea725a07 | df63c38c8fd5cea2a6dd8b0682d3e6fe84a3ab70 | /IntelliJ/SciFi Name Gen/BlueJ Starter/UserInput.java | 296e2d41572e5c75f32f6f6149adc895ae38921d | [] | no_license | samchihak/CSA | 5a0ef17185cc07cc62a9c8d928a03b745894c380 | a0fdf1358412d0d175008729357d183c7c301d44 | refs/heads/master | 2020-03-28T02:13:23.817981 | 2019-02-26T18:55:46 | 2019-02-26T18:55:46 | 147,555,861 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 233 | java |
import java.util.Scanner;
/**
* Convenience class for getting input from a user
*/
public class UserInput
{
public static String getString() {
Scanner in = new Scanner(System.in);
return in.next();
}
} | [
"samchihak17@gmail.com"
] | samchihak17@gmail.com |
7c0db23589bb55aa0e535c32dd72d03e68d8f9e5 | c1362a8a76dbb0b28f63caedf40afc8c9cc907b6 | /src/main/java/za/co/paygate/payhost/DeleteVaultResponseType.java | 08b10b11e250b4f8578356dde07571dbb968660f | [] | no_license | assertion-enterprise/payhost-common | 4e34a23d3ac1dced0ab71bf6cdd90b79c151c92f | 867309bc89703eeee38f9afffc57a5adc39477c9 | refs/heads/master | 2023-05-04T03:09:54.705822 | 2021-05-22T18:08:58 | 2021-05-22T18:08:58 | 369,875,855 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,037 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2021.05.22 at 06:53:12 PM SAST
//
package za.co.paygate.payhost;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for DeleteVaultResponseType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="DeleteVaultResponseType">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Status" type="{http://www.paygate.co.za/PayHOST}StatusType"/>
* <element name="UserDefinedFields" type="{http://www.paygate.co.za/PayHOST}KeyValueType" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "DeleteVaultResponseType", propOrder = {
"status",
"userDefinedFields"
})
public class DeleteVaultResponseType {
@XmlElement(name = "Status", required = true)
protected StatusType status;
@XmlElement(name = "UserDefinedFields")
protected List<KeyValueType> userDefinedFields;
/**
* Gets the value of the status property.
*
* @return
* possible object is
* {@link StatusType }
*
*/
public StatusType getStatus() {
return status;
}
/**
* Sets the value of the status property.
*
* @param value
* allowed object is
* {@link StatusType }
*
*/
public void setStatus(StatusType value) {
this.status = value;
}
/**
* Gets the value of the userDefinedFields property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the userDefinedFields property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getUserDefinedFields().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link KeyValueType }
*
*
*/
public List<KeyValueType> getUserDefinedFields() {
if (userDefinedFields == null) {
userDefinedFields = new ArrayList<KeyValueType>();
}
return this.userDefinedFields;
}
}
| [
"assertion-enterprise@outlook.com"
] | assertion-enterprise@outlook.com |
4c1ab8cd1cad34af3c1416ecb920a1fb53707a65 | 6d4b9e760be0bfeb695813970bb356f2d455f639 | /kafka-basics/src/main/java/kafka/tutorial1/ProducerWithCallback.java | 546b7be033d2d4a0efc3fda984f376b61dc86dfb | [] | no_license | saleco/kafka-beginners-course | ffe80619d37951553ab5963fb7dd85044c06ce94 | 44c6e265cef62a4107aa4165ac5cdcf74b61b7eb | refs/heads/master | 2023-01-06T02:52:22.994938 | 2020-10-30T16:49:14 | 2020-10-30T16:49:14 | 308,413,579 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,884 | java | package kafka.tutorial1;
import org.apache.kafka.clients.producer.*;
import org.apache.kafka.common.serialization.StringSerializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Properties;
public class ProducerWithCallback {
private static final Logger logger = LoggerFactory.getLogger(ProducerWithCallback.class);
public static void main(String[] args) {
String bootstrapServers = "127.0.0.1:9092";
//create Producer properties
Properties properties = new Properties();
properties.setProperty(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);
properties.setProperty(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());
properties.setProperty(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());
//create the producer
KafkaProducer<String, String> producer = new KafkaProducer<String, String>(properties);
for (int i = 0; i < 10; i++) {
//create a producer record
final ProducerRecord<String, String> record = new ProducerRecord<String, String>("first_topic", "hello world" + i);
//send data -asynchronous
producer.send(record, new Callback() {
public void onCompletion(RecordMetadata recordMetadata, Exception e) {
//executes every time record is successfully sent or an exception is thrown
if(e == null) {
logger.info("Received new metadata. \n " +
"Topic: " + recordMetadata.topic() + "\n" +
"Partition: " + recordMetadata.partition() + "\n" +
"Offset: " + recordMetadata.offset() + "\n" +
"Timestamp: " + recordMetadata.timestamp() + "\n");
} else {
logger.error("Error while producing", e);
}
}
});
}
producer.flush();
producer.close();
}
}
| [
"salloszrajbman@hotmail.com"
] | salloszrajbman@hotmail.com |
b69cd839c68172a3b7e66dd5247110d77a90e6d2 | fbda4404e152e537567a1f78e1b585eb7ee135bb | /app/src/main/java/venkov/vladimir/myapplication/services/base/SuperheroesService.java | 68fcf3517b767d0a6d1c684373fb927aa381bf27 | [] | no_license | vladimirVenkov/MyApplicationSuperheroes | e3b2e9d6bda188cac129ab4f0a877d6fe10761ba | e7669da7ae4a42ceb18a3a5a056ad65dc5ef75e2 | refs/heads/master | 2020-03-25T11:42:01.613783 | 2018-09-04T09:52:06 | 2018-09-04T09:52:06 | 143,743,775 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 464 | java | package venkov.vladimir.myapplication.services.base;
import java.io.IOException;
import java.util.List;
import venkov.vladimir.myapplication.models.Superhero;
public interface SuperheroesService {
List<Superhero> getAllSuperheroes() throws Exception;
Superhero getDetailsById(int id) throws Exception;
List<Superhero> getFilteredSuperheroes(String pattern) throws Exception;
Superhero createSuperhero(Superhero superhero) throws Exception;
}
| [
"vladimir.ognyanov.venkov@gmail.com"
] | vladimir.ognyanov.venkov@gmail.com |
9605054550e4fd04fc77ff6da4e58f9b40ad9ecc | fad219ceac0faf4e405469345970245f7f85103a | /Kuurv/android/TrackerApp/app/src/main/java/com/benjaminshamoilia/trackerapp/fragment/FragmentPhoneAlertSetting.java | eb2b8b806fb79d574ecf3ff40aeee073c033087c | [] | no_license | VinayTShetty/ProjectsWorked_2019-2021 | f092e8b01e1707c82058acad572a6bfce77421d7 | 70c80b9ad681b099c6de9a718e103d362e9f453d | refs/heads/main | 2023-06-02T17:26:34.669354 | 2021-06-26T02:06:23 | 2021-06-26T02:06:23 | 380,391,756 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 19,530 | java | package com.benjaminshamoilia.trackerapp.fragment;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.ContentValues;
import android.content.DialogInterface;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.appcompat.widget.SwitchCompat;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CompoundButton;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.Switch;
import com.benjaminshamoilia.trackerapp.MainActivity;
import com.benjaminshamoilia.trackerapp.R;
import com.benjaminshamoilia.trackerapp.interfaces.DeviceDisconnectionCallback;
import com.benjaminshamoilia.trackerapp.interfaces.onAlertDialogCallBack;
import com.clj.fastble.BleManager;
import com.clj.fastble.data.BleDevice;
import java.util.Iterator;
import java.util.Map;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
/**
* Created by Jaydeep on 22-12-2017.
*/
public class FragmentPhoneAlertSetting extends Fragment {
MainActivity mActivity;
View mViewRoot;
private Unbinder unbinder;
@BindView(R.id.frg_phone_alert_sw_silent_mode)
Switch mSwitchCompatSilentMode;
@BindView(R.id.frg_phone_alert_sw_separated_alert)
Switch mSwitchCompatSeparatedAlert;
@BindView(R.id.frg_phone_alert_sw_repeat_alert)
Switch mSwitchCompatRepeatAlert;
@BindView(R.id.frg_phone_alert_rg_buzzer_volume)
RadioGroup mRadioGroupVolume;
@BindView(R.id.frg_phone_alert_rb_volume_high)
RadioButton mRadioButtonVolumeHigh;
@BindView(R.id.frg_phone_alert_rb_volume_low)
RadioButton mRadioButtonVolumeLow;
String bleAddresspassed="";
String convertBleAddres="";
String silentmode="-1";
String buzzervolume="-1";
String separationAlert="-1";
String repeatAlert="-1";
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mActivity = (MainActivity) getActivity();
}
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
mViewRoot = inflater.inflate(R.layout.fragment_phone_alert_setting, container, false);
unbinder = ButterKnife.bind(this, mViewRoot);
mActivity.mTextViewTitle.setText(R.string.str_title_phone_alert);
mActivity.mTextViewTitle.setTextColor(Color.WHITE);
mActivity.mTextViewTitle.setGravity(Gravity.CENTER);
mActivity.mTextViewTitle.setTextSize(20);
mActivity.mImageViewBack.setVisibility(View.GONE);
mActivity.mImageViewAddDevice.setVisibility(View.GONE);
mActivity.mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
mActivity.showBackButton(true);
Bundle b = getArguments();
bleAddresspassed=b.getString("connectedBleAddress");
convertBleAddres=bleAddresspassed.replace(":", "").toLowerCase();
mActivity.mImageViewBack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
mActivity.onBackPressed();
}
});
getDetailsfromDB(bleAddresspassed.replace(":", "").toLowerCase());
// updateUIinFragment();
mSwitchCompatSilentMode.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if(checkDeviceConnectionStatusEverytime()){
if (isChecked) {
silentModeOn();
} else {
silentModeOff();
}
}else{
updateUIFragmentIfDisconnected();
mActivity.mUtility.errorDialog("KUURV","Tracker is disconnected.\nPlease connect in order to\n change settings.", 3, true);
}
}
});
mSwitchCompatSilentMode.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// System.out.println("silentmode clicked");
}
});
mSwitchCompatSeparatedAlert.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
separationAlertOn();
} else {
separationAlertoff();
}
}
});
mSwitchCompatRepeatAlert.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
repeatAlerrton();
}
else{
repeatAlertOff();
}
}
});
mRadioButtonVolumeHigh.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(checkDeviceConnectionStatusEverytime()){
updateBuzzerVolumeHighinDB();
if(mActivity.getMainActivityBluetoothAdapter()!=null){
BluetoothAdapter bluetoothAdapter=mActivity.getMainActivityBluetoothAdapter();
if(bluetoothAdapter.isEnabled()){
final BluetoothDevice bluetoothDevice= bluetoothAdapter.getRemoteDevice(bleAddresspassed);
mActivity.writeBuzzerVolumeHighorLow(true,new BleDevice(bluetoothDevice));
}
}
}else {
updateUIFragmentIfDisconnected();
mActivity.mUtility.errorDialog("KUURV","Tracker is disconnected.\nPlease connect in order to\n change settings.", 3, true);
}
}
});
mRadioButtonVolumeLow.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(checkDeviceConnectionStatusEverytime()){
updateBuzzerVolumeLowinDB();
if(mActivity.getMainActivityBluetoothAdapter()!=null){
BluetoothAdapter bluetoothAdapter=mActivity.getMainActivityBluetoothAdapter();
if(bluetoothAdapter.isEnabled()){
final BluetoothDevice bluetoothDevice= bluetoothAdapter.getRemoteDevice(bleAddresspassed);
mActivity.writeBuzzerVolumeHighorLow(false,new BleDevice(bluetoothDevice));
}
}
}else{
updateUIFragmentIfDisconnected();
mActivity.mUtility.errorDialog("KUURV","Tracker is disconnected.\nPlease connect in order to\n change settings.", 3, true);
}
}
});
mActivity.setDeviceDisconnectionCallback(new DeviceDisconnectionCallback() {
@Override
public void callbackWhenDeviceIsActuallyDisconnected(String BleAddress, String ConnectionStatus, BleDevice bleDevice) {
mActivity.mUtility.errorDialogWithCallBack_Connect_Disconnect_1(mActivity.getDeviceNameFromDB(bleDevice.getMac().replace(":", "").toLowerCase().toString()) + " has been Disconnected or out of range", 3, false, new onAlertDialogCallBack() {
@Override
public void PositiveMethod(DialogInterface dialog, int id) {
mActivity.stopPlayingsound();
}
@Override
public void NegativeMethod(DialogInterface dialog, int id) {
}
});
}
});
updateUIinFragment();
return mViewRoot;
}
@Override
public void onDestroyView() {
super.onDestroyView();
mActivity.getDBDeviceList();
unbinder.unbind();
mActivity.mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED);
mActivity.mImageViewAddDevice.setVisibility(View.GONE);
mActivity.mImageViewBack.setVisibility(View.GONE);
mActivity.mUtility.ShowProgress("Saving Setting", false);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
mActivity.mUtility.HideProgress();
}
}, 1000);
}
@Override
public void onResume() {
super.onResume();
}
@Override
public void onPause() {
super.onPause();
}
private void silentModeOn(){
mSwitchCompatSeparatedAlert.setChecked(false);
mSwitchCompatRepeatAlert.setChecked(false);
mSwitchCompatSeparatedAlert.setClickable(false);
mSwitchCompatRepeatAlert.setClickable(false);
mSwitchCompatSilentMode.setChecked(true);
updatesilentmodeOnStatusinDb();
}
private void silentModeOff(){
mSwitchCompatSeparatedAlert.setChecked(true);
mSwitchCompatRepeatAlert.setChecked(true);
mSwitchCompatSeparatedAlert.setClickable(true);
mSwitchCompatRepeatAlert.setClickable(true);
mSwitchCompatSilentMode.setChecked(false);
updatesilentmodeOffStatusinDb();
}
private void separationAlertoff(){
mSwitchCompatRepeatAlert.setChecked(false);
mSwitchCompatRepeatAlert.setClickable(false);
mSwitchCompatSeparatedAlert.setChecked(false);
updateSeprationAlertOffStatusinDB();
}
private void separationAlertOn(){
mSwitchCompatRepeatAlert.setClickable(true);
mSwitchCompatSeparatedAlert.setChecked(true);
updateSeprationAlertOnStatusinDB();
}
private void repeatAlerrton(){
mSwitchCompatRepeatAlert.setChecked(true);
updateRepeatAlertOnStatusinDB();
}
private void repeatAlertOff(){
mSwitchCompatRepeatAlert.setChecked(false);
updateRepeatAlertOffStatusinDB();
}
private void buzzerVolumeHigh(){
mRadioButtonVolumeLow.setChecked(false);
mRadioButtonVolumeHigh.setChecked(true);
updateBuzzerVolumeHighinDB();
}
private void buzzervolumeLow(){
mRadioButtonVolumeLow.setChecked(true);
mRadioButtonVolumeHigh.setChecked(false);
updateBuzzerVolumeLowinDB();
}
private void getDetailsfromDB(String bleaddress){
Map<String,String> getUSer_info= mActivity.mDbHelper.getBLE_Set_Info(mActivity.mDbHelper.getReadableDatabase(),
mActivity.mDbHelper.Device_Table,
"ble_address",
bleaddress
);
Iterator<Map.Entry<String, String>> itr = getUSer_info.entrySet().iterator();
while(itr.hasNext())
{
Map.Entry<String, String> entry = itr.next();
System.out.println("Key = " + entry.getKey() + ", Value = " + entry.getValue());
if(entry.getValue()==null)
{
// System.out.println("Fragment_Configure_Device>>>>>Its NUll");
} else
{
silentmode=(String) getUSer_info.get("is_silent_mode");
buzzervolume=(String) getUSer_info.get("buzzer_volume");
separationAlert=(String) getUSer_info.get("seperate_alert");
repeatAlert=(String) getUSer_info.get("repeat_alert");
}
}
}
private void updateUIinFragment(){
if(silentmode.equalsIgnoreCase("1")){
silentModeOff();
}else{
silentModeOn();
}
//----------silent mode---------------
if(buzzervolume.equalsIgnoreCase("1")){
buzzerVolumeHigh();
}else{
buzzervolumeLow();
}
//---------------Buzzer Volume------------------------
if(!silentmode.equalsIgnoreCase("0")){
if(separationAlert.equalsIgnoreCase("0")){
mSwitchCompatSeparatedAlert.setChecked(true);
}else{
mSwitchCompatSeparatedAlert.setChecked(false);
}
//---------------Separation Alert------------------------
if(repeatAlert.equalsIgnoreCase("0")){
mSwitchCompatRepeatAlert.setChecked(true);
}else{
mSwitchCompatRepeatAlert.setChecked(false);
}
}
//----------------Repeat Alert-------------------------------
}
private void updatesilentmodeOnStatusinDb(){
// System.out.println("Alert_Setting updatesilentmodeOnStatusinDb ");
ContentValues mContentValues = new ContentValues();
mContentValues.put(mActivity.mDbHelper.DeviceFiledSilentMode, "0"); // getPositionofBleObjectInArrayList
mContentValues.put(mActivity.mDbHelper.DeviceFiledSeperateAlert,"1" );
mContentValues.put(mActivity.mDbHelper.DeviceFiledRepeatAlert, "1"); // "_id = ?"
UpdateRecordinTable(mContentValues);
sendSilentModeOntoBleDevice("0");
}
private void updatesilentmodeOffStatusinDb(){
ContentValues mContentValues = new ContentValues();
mContentValues.put(mActivity.mDbHelper.DeviceFiledSilentMode, "1");
if(mSwitchCompatSeparatedAlert.isChecked()){
mContentValues.put(mActivity.mDbHelper.DeviceFiledSeperateAlert,"0" );
}else{
mContentValues.put(mActivity.mDbHelper.DeviceFiledSeperateAlert,"1" );
}
if(mSwitchCompatSeparatedAlert.isChecked()){
mContentValues.put(mActivity.mDbHelper.DeviceFiledSeperateAlert,"0" );
}else{
mContentValues.put(mActivity.mDbHelper.DeviceFiledSeperateAlert,"1" );
}
UpdateRecordinTable(mContentValues);
sendSilentModeOfftoBleDevice("1");
}
//Separation Alert part.
private void updateSeprationAlertOnStatusinDB(){
ContentValues mContentValues = new ContentValues();
mContentValues.put(mActivity.mDbHelper.DeviceFiledSeperateAlert,"0" );
UpdateRecordinTable(mContentValues);
}
private void updateSeprationAlertOffStatusinDB(){
ContentValues mContentValues = new ContentValues();
mContentValues.put(mActivity.mDbHelper.DeviceFiledSeperateAlert,"1" );
mContentValues.put(mActivity.mDbHelper.DeviceFiledRepeatAlert,"1" );
UpdateRecordinTable(mContentValues);
}
//--Repeat Alert Part.
private void updateRepeatAlertOnStatusinDB(){
ContentValues mContentValues = new ContentValues();
mContentValues.put(mActivity.mDbHelper.DeviceFiledRepeatAlert,"0" );
UpdateRecordinTable(mContentValues);
}
private void updateRepeatAlertOffStatusinDB(){
ContentValues mContentValues = new ContentValues();
mContentValues.put(mActivity.mDbHelper.DeviceFiledRepeatAlert,"1" );
UpdateRecordinTable(mContentValues);
}
//--Buzzer Volume part
private void updateBuzzerVolumeHighinDB(){
ContentValues mContentValues = new ContentValues();
mContentValues.put(mActivity.mDbHelper.DeviceFiledBuzzerVolume,"1" );
UpdateRecordinTable(mContentValues);
}
private void updateBuzzerVolumeLowinDB(){
ContentValues mContentValues = new ContentValues();
mContentValues.put(mActivity.mDbHelper.DeviceFiledBuzzerVolume,"0" );
UpdateRecordinTable(mContentValues);
}
private void UpdateRecordinTable(ContentValues mContentValues){
mActivity.mDbHelper.updateRecord(mActivity.mDbHelper.Device_Table, mContentValues, "ble_address = ?",new String[]{convertBleAddres});
String result= mActivity.mDbHelper.getTableAsString(mActivity.mDbHelper.getReadableDatabase(),"Device_Table");
System.out.println(result);
}
private String silentmodeonDisconnect="-1";
private String buzzervolumeonDiscoonect="-1";
private void updateUIFragmentIfDisconnected(){
getDetailsfromDBwhenDisconnected(bleAddresspassed.replace(":", "").toLowerCase());
if(silentmodeonDisconnect.equalsIgnoreCase("1")){
silentModeOff();
}else{
silentModeOn();
}
if(buzzervolumeonDiscoonect.equalsIgnoreCase("1")){
buzzerVolumeHigh();
}else{
buzzervolumeLow();
}
}
private void getDetailsfromDBwhenDisconnected(String bleaddress){
Map<String,String> getUSer_info= mActivity.mDbHelper.getBLE_Set_Info(mActivity.mDbHelper.getReadableDatabase(),
mActivity.mDbHelper.Device_Table,
"ble_address",
bleaddress
);
Iterator<Map.Entry<String, String>> itr = getUSer_info.entrySet().iterator();
while(itr.hasNext())
{
Map.Entry<String, String> entry = itr.next();
System.out.println("Key = " + entry.getKey() + ", Value = " + entry.getValue());
if(entry.getValue()==null)
{
// System.out.println("Fragment_Configure_Device>>>>>Its NUll");
} else
{
silentmodeonDisconnect=(String) getUSer_info.get("is_silent_mode");
buzzervolumeonDiscoonect=(String) getUSer_info.get("buzzer_volume");
}
}
}
private boolean checkDeviceConnectionStatusEverytime(){
boolean result=false;
if(mActivity.getMainActivityBluetoothAdapter()!=null){
BluetoothAdapter bluetoothAdapterAlertSetting=mActivity.getMainActivityBluetoothAdapter();
if(bluetoothAdapterAlertSetting.isEnabled()){
boolean connectionStatus = BleManager.getInstance().isConnected(bleAddresspassed);
if(connectionStatus){
result=true;
}else{
result=false;
}
}else{
result=false;
}
}else{
result=false;
}
return result;
}
private void sendSilentModeOntoBleDevice(String silentmode){
if(mActivity.getMainActivityBluetoothAdapter()!=null){
BluetoothAdapter bluetoothAdapter=mActivity.getMainActivityBluetoothAdapter();
if(bluetoothAdapter.isEnabled()){
final BluetoothDevice bluetoothDevice= bluetoothAdapter.getRemoteDevice(bleAddresspassed);
mActivity.writeSilentModeOnSwitchisON(new BleDevice(bluetoothDevice));
}
}
}
private void sendSilentModeOfftoBleDevice(String silentmode){
if(mActivity.getMainActivityBluetoothAdapter()!=null){
BluetoothAdapter bluetoothAdapter=mActivity.getMainActivityBluetoothAdapter();
if(bluetoothAdapter.isEnabled()){
final BluetoothDevice bluetoothDevice= bluetoothAdapter.getRemoteDevice(bleAddresspassed);
mActivity.writeSilentModeOFFSwitchisOFF(new BleDevice(bluetoothDevice));
}
}
}
}
| [
"vinay@succorfish.com"
] | vinay@succorfish.com |
21ac9aa6fc25f65a1683259a26a1aafabe6b2957 | b00c54389a95d81a22e361fa9f8bdf5a2edc93e3 | /frameworks/ex/common/java/com/android/common/widget/CompositeCursorAdapter.java | dddbcf6f1ce77154fb9906591622cb9d2d28516d | [] | no_license | mirek190/x86-android-5.0 | 9d1756fa7ff2f423887aa22694bd737eb634ef23 | eb1029956682072bb7404192a80214189f0dc73b | refs/heads/master | 2020-05-27T01:09:51.830208 | 2015-10-07T22:47:36 | 2015-10-07T22:47:36 | 41,942,802 | 15 | 20 | null | 2020-03-09T00:21:03 | 2015-09-05T00:11:19 | null | UTF-8 | Java | false | false | 16,186 | java | /*
* Copyright (C) 2010 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.common.widget;
import android.content.Context;
import android.database.Cursor;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import java.util.ArrayList;
/**
* A general purpose adapter that is composed of multiple cursors. It just
* appends them in the order they are added.
*/
public abstract class CompositeCursorAdapter extends BaseAdapter {
private static final int INITIAL_CAPACITY = 2;
public static class Partition {
boolean showIfEmpty;
boolean hasHeader;
Cursor cursor;
int idColumnIndex;
int count;
public Partition(boolean showIfEmpty, boolean hasHeader) {
this.showIfEmpty = showIfEmpty;
this.hasHeader = hasHeader;
}
/**
* True if the directory should be shown even if no contacts are found.
*/
public boolean getShowIfEmpty() {
return showIfEmpty;
}
public boolean getHasHeader() {
return hasHeader;
}
public boolean isEmpty() {
return count == 0;
}
}
private final Context mContext;
private ArrayList<Partition> mPartitions;
private int mCount = 0;
private boolean mCacheValid = true;
private boolean mNotificationsEnabled = true;
private boolean mNotificationNeeded;
public CompositeCursorAdapter(Context context) {
this(context, INITIAL_CAPACITY);
}
public CompositeCursorAdapter(Context context, int initialCapacity) {
mContext = context;
mPartitions = new ArrayList<Partition>();
}
public Context getContext() {
return mContext;
}
/**
* Registers a partition. The cursor for that partition can be set later.
* Partitions should be added in the order they are supposed to appear in the
* list.
*/
public void addPartition(boolean showIfEmpty, boolean hasHeader) {
addPartition(new Partition(showIfEmpty, hasHeader));
}
public void addPartition(Partition partition) {
mPartitions.add(partition);
invalidate();
notifyDataSetChanged();
}
public void addPartition(int location, Partition partition) {
mPartitions.add(location, partition);
invalidate();
notifyDataSetChanged();
}
public void removePartition(int partitionIndex) {
Cursor cursor = mPartitions.get(partitionIndex).cursor;
if (cursor != null && !cursor.isClosed()) {
cursor.close();
}
mPartitions.remove(partitionIndex);
invalidate();
notifyDataSetChanged();
}
/**
* Removes cursors for all partitions.
*/
// TODO: Is this really what this is supposed to do? Just remove the cursors? Not close them?
// Not remove the partitions themselves? Isn't this leaking?
public void clearPartitions() {
for (Partition partition : mPartitions) {
partition.cursor = null;
}
invalidate();
notifyDataSetChanged();
}
/**
* Closes all cursors and removes all partitions.
*/
public void close() {
for (Partition partition : mPartitions) {
Cursor cursor = partition.cursor;
if (cursor != null && !cursor.isClosed()) {
cursor.close();
}
}
mPartitions.clear();
invalidate();
notifyDataSetChanged();
}
public void setHasHeader(int partitionIndex, boolean flag) {
mPartitions.get(partitionIndex).hasHeader = flag;
invalidate();
}
public void setShowIfEmpty(int partitionIndex, boolean flag) {
mPartitions.get(partitionIndex).showIfEmpty = flag;
invalidate();
}
public Partition getPartition(int partitionIndex) {
return mPartitions.get(partitionIndex);
}
protected void invalidate() {
mCacheValid = false;
}
public int getPartitionCount() {
return mPartitions.size();
}
protected void ensureCacheValid() {
if (mCacheValid) {
return;
}
mCount = 0;
for (Partition partition : mPartitions) {
Cursor cursor = partition.cursor;
int count = cursor != null ? cursor.getCount() : 0;
if (partition.hasHeader) {
if (count != 0 || partition.showIfEmpty) {
count++;
}
}
partition.count = count;
mCount += count;
}
mCacheValid = true;
}
/**
* Returns true if the specified partition was configured to have a header.
*/
public boolean hasHeader(int partition) {
return mPartitions.get(partition).hasHeader;
}
/**
* Returns the total number of list items in all partitions.
*/
public int getCount() {
ensureCacheValid();
return mCount;
}
/**
* Returns the cursor for the given partition
*/
public Cursor getCursor(int partition) {
return mPartitions.get(partition).cursor;
}
/**
* Changes the cursor for an individual partition.
*/
public void changeCursor(int partition, Cursor cursor) {
Cursor prevCursor = mPartitions.get(partition).cursor;
if (prevCursor != cursor) {
if (prevCursor != null && !prevCursor.isClosed()) {
prevCursor.close();
}
mPartitions.get(partition).cursor = cursor;
if (cursor != null) {
mPartitions.get(partition).idColumnIndex = cursor.getColumnIndex("_id");
}
invalidate();
notifyDataSetChanged();
}
}
/**
* Returns true if the specified partition has no cursor or an empty cursor.
*/
public boolean isPartitionEmpty(int partition) {
Cursor cursor = mPartitions.get(partition).cursor;
return cursor == null || cursor.getCount() == 0;
}
/**
* Given a list position, returns the index of the corresponding partition.
*/
public int getPartitionForPosition(int position) {
ensureCacheValid();
int start = 0;
for (int i = 0, n = mPartitions.size(); i < n; i++) {
int end = start + mPartitions.get(i).count;
if (position >= start && position < end) {
return i;
}
start = end;
}
return -1;
}
/**
* Given a list position, return the offset of the corresponding item in its
* partition. The header, if any, will have offset -1.
*/
public int getOffsetInPartition(int position) {
ensureCacheValid();
int start = 0;
for (Partition partition : mPartitions) {
int end = start + partition.count;
if (position >= start && position < end) {
int offset = position - start;
if (partition.hasHeader) {
offset--;
}
return offset;
}
start = end;
}
return -1;
}
/**
* Returns the first list position for the specified partition.
*/
public int getPositionForPartition(int partition) {
ensureCacheValid();
int position = 0;
for (int i = 0; i < partition; i++) {
position += mPartitions.get(i).count;
}
return position;
}
@Override
public int getViewTypeCount() {
return getItemViewTypeCount() + 1;
}
/**
* Returns the overall number of item view types across all partitions. An
* implementation of this method needs to ensure that the returned count is
* consistent with the values returned by {@link #getItemViewType(int,int)}.
*/
public int getItemViewTypeCount() {
return 1;
}
/**
* Returns the view type for the list item at the specified position in the
* specified partition.
*/
protected int getItemViewType(int partition, int position) {
return 1;
}
@Override
public int getItemViewType(int position) {
ensureCacheValid();
int start = 0;
for (int i = 0, n = mPartitions.size(); i < n; i++) {
int end = start + mPartitions.get(i).count;
if (position >= start && position < end) {
int offset = position - start;
if (mPartitions.get(i).hasHeader) {
offset--;
}
if (offset == -1) {
return IGNORE_ITEM_VIEW_TYPE;
} else {
return getItemViewType(i, offset);
}
}
start = end;
}
throw new ArrayIndexOutOfBoundsException(position);
}
public View getView(int position, View convertView, ViewGroup parent) {
ensureCacheValid();
int start = 0;
for (int i = 0, n = mPartitions.size(); i < n; i++) {
int end = start + mPartitions.get(i).count;
if (position >= start && position < end) {
int offset = position - start;
if (mPartitions.get(i).hasHeader) {
offset--;
}
View view;
if (offset == -1) {
view = getHeaderView(i, mPartitions.get(i).cursor, convertView, parent);
} else {
if (!mPartitions.get(i).cursor.moveToPosition(offset)) {
throw new IllegalStateException("Couldn't move cursor to position "
+ offset);
}
view = getView(i, mPartitions.get(i).cursor, offset, convertView, parent);
}
if (view == null) {
throw new NullPointerException("View should not be null, partition: " + i
+ " position: " + offset);
}
return view;
}
start = end;
}
throw new ArrayIndexOutOfBoundsException(position);
}
/**
* Returns the header view for the specified partition, creating one if needed.
*/
protected View getHeaderView(int partition, Cursor cursor, View convertView,
ViewGroup parent) {
View view = convertView != null
? convertView
: newHeaderView(mContext, partition, cursor, parent);
bindHeaderView(view, partition, cursor);
return view;
}
/**
* Creates the header view for the specified partition.
*/
protected View newHeaderView(Context context, int partition, Cursor cursor,
ViewGroup parent) {
return null;
}
/**
* Binds the header view for the specified partition.
*/
protected void bindHeaderView(View view, int partition, Cursor cursor) {
}
/**
* Returns an item view for the specified partition, creating one if needed.
*/
protected View getView(int partition, Cursor cursor, int position, View convertView,
ViewGroup parent) {
View view;
if (convertView != null) {
view = convertView;
} else {
view = newView(mContext, partition, cursor, position, parent);
}
bindView(view, partition, cursor, position);
return view;
}
/**
* Creates an item view for the specified partition and position. Position
* corresponds directly to the current cursor position.
*/
protected abstract View newView(Context context, int partition, Cursor cursor, int position,
ViewGroup parent);
/**
* Binds an item view for the specified partition and position. Position
* corresponds directly to the current cursor position.
*/
protected abstract void bindView(View v, int partition, Cursor cursor, int position);
/**
* Returns a pre-positioned cursor for the specified list position.
*/
public Object getItem(int position) {
ensureCacheValid();
int start = 0;
for (Partition mPartition : mPartitions) {
int end = start + mPartition.count;
if (position >= start && position < end) {
int offset = position - start;
if (mPartition.hasHeader) {
offset--;
}
if (offset == -1) {
return null;
}
Cursor cursor = mPartition.cursor;
cursor.moveToPosition(offset);
return cursor;
}
start = end;
}
return null;
}
/**
* Returns the item ID for the specified list position.
*/
public long getItemId(int position) {
ensureCacheValid();
int start = 0;
for (Partition mPartition : mPartitions) {
int end = start + mPartition.count;
if (position >= start && position < end) {
int offset = position - start;
if (mPartition.hasHeader) {
offset--;
}
if (offset == -1) {
return 0;
}
if (mPartition.idColumnIndex == -1) {
return 0;
}
Cursor cursor = mPartition.cursor;
if (cursor == null || cursor.isClosed() || !cursor.moveToPosition(offset)) {
return 0;
}
return cursor.getLong(mPartition.idColumnIndex);
}
start = end;
}
return 0;
}
/**
* Returns false if any partition has a header.
*/
@Override
public boolean areAllItemsEnabled() {
for (Partition mPartition : mPartitions) {
if (mPartition.hasHeader) {
return false;
}
}
return true;
}
/**
* Returns true for all items except headers.
*/
@Override
public boolean isEnabled(int position) {
ensureCacheValid();
int start = 0;
for (int i = 0, n = mPartitions.size(); i < n; i++) {
int end = start + mPartitions.get(i).count;
if (position >= start && position < end) {
int offset = position - start;
if (mPartitions.get(i).hasHeader && offset == 0) {
return false;
} else {
return isEnabled(i, offset);
}
}
start = end;
}
return false;
}
/**
* Returns true if the item at the specified offset of the specified
* partition is selectable and clickable.
*/
protected boolean isEnabled(int partition, int position) {
return true;
}
/**
* Enable or disable data change notifications. It may be a good idea to
* disable notifications before making changes to several partitions at once.
*/
public void setNotificationsEnabled(boolean flag) {
mNotificationsEnabled = flag;
if (flag && mNotificationNeeded) {
notifyDataSetChanged();
}
}
@Override
public void notifyDataSetChanged() {
if (mNotificationsEnabled) {
mNotificationNeeded = false;
super.notifyDataSetChanged();
} else {
mNotificationNeeded = true;
}
}
}
| [
"mirek190@gmail.com"
] | mirek190@gmail.com |
45b43d86065ab8da7d2f700dfad60c16f62faf9c | e9affefd4e89b3c7e2064fee8833d7838c0e0abc | /aws-java-sdk-codebuild/src/main/java/com/amazonaws/services/codebuild/model/ReportGroupTrendStats.java | 189028ca420545c40342ca41215957563e7533a7 | [
"Apache-2.0"
] | permissive | aws/aws-sdk-java | 2c6199b12b47345b5d3c50e425dabba56e279190 | bab987ab604575f41a76864f755f49386e3264b4 | refs/heads/master | 2023-08-29T10:49:07.379135 | 2023-08-28T21:05:55 | 2023-08-28T21:05:55 | 574,877 | 3,695 | 3,092 | Apache-2.0 | 2023-09-13T23:35:28 | 2010-03-22T23:34:58 | null | UTF-8 | Java | false | false | 6,776 | java | /*
* Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.codebuild.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
* <p>
* Contains trend statistics for a set of reports. The actual values depend on the type of trend being collected. For
* more information, see .
* </p>
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ReportGroupTrendStats" target="_top">AWS
* API Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ReportGroupTrendStats implements Serializable, Cloneable, StructuredPojo {
/**
* <p>
* Contains the average of all values analyzed.
* </p>
*/
private String average;
/**
* <p>
* Contains the maximum value analyzed.
* </p>
*/
private String max;
/**
* <p>
* Contains the minimum value analyzed.
* </p>
*/
private String min;
/**
* <p>
* Contains the average of all values analyzed.
* </p>
*
* @param average
* Contains the average of all values analyzed.
*/
public void setAverage(String average) {
this.average = average;
}
/**
* <p>
* Contains the average of all values analyzed.
* </p>
*
* @return Contains the average of all values analyzed.
*/
public String getAverage() {
return this.average;
}
/**
* <p>
* Contains the average of all values analyzed.
* </p>
*
* @param average
* Contains the average of all values analyzed.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ReportGroupTrendStats withAverage(String average) {
setAverage(average);
return this;
}
/**
* <p>
* Contains the maximum value analyzed.
* </p>
*
* @param max
* Contains the maximum value analyzed.
*/
public void setMax(String max) {
this.max = max;
}
/**
* <p>
* Contains the maximum value analyzed.
* </p>
*
* @return Contains the maximum value analyzed.
*/
public String getMax() {
return this.max;
}
/**
* <p>
* Contains the maximum value analyzed.
* </p>
*
* @param max
* Contains the maximum value analyzed.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ReportGroupTrendStats withMax(String max) {
setMax(max);
return this;
}
/**
* <p>
* Contains the minimum value analyzed.
* </p>
*
* @param min
* Contains the minimum value analyzed.
*/
public void setMin(String min) {
this.min = min;
}
/**
* <p>
* Contains the minimum value analyzed.
* </p>
*
* @return Contains the minimum value analyzed.
*/
public String getMin() {
return this.min;
}
/**
* <p>
* Contains the minimum value analyzed.
* </p>
*
* @param min
* Contains the minimum value analyzed.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ReportGroupTrendStats withMin(String min) {
setMin(min);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getAverage() != null)
sb.append("Average: ").append(getAverage()).append(",");
if (getMax() != null)
sb.append("Max: ").append(getMax()).append(",");
if (getMin() != null)
sb.append("Min: ").append(getMin());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ReportGroupTrendStats == false)
return false;
ReportGroupTrendStats other = (ReportGroupTrendStats) obj;
if (other.getAverage() == null ^ this.getAverage() == null)
return false;
if (other.getAverage() != null && other.getAverage().equals(this.getAverage()) == false)
return false;
if (other.getMax() == null ^ this.getMax() == null)
return false;
if (other.getMax() != null && other.getMax().equals(this.getMax()) == false)
return false;
if (other.getMin() == null ^ this.getMin() == null)
return false;
if (other.getMin() != null && other.getMin().equals(this.getMin()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAverage() == null) ? 0 : getAverage().hashCode());
hashCode = prime * hashCode + ((getMax() == null) ? 0 : getMax().hashCode());
hashCode = prime * hashCode + ((getMin() == null) ? 0 : getMin().hashCode());
return hashCode;
}
@Override
public ReportGroupTrendStats clone() {
try {
return (ReportGroupTrendStats) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.codebuild.model.transform.ReportGroupTrendStatsMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}
| [
""
] | |
248263cc8ef2c1d35642b10de957adb56e2b9e25 | 7b14fe6fe7124feb1148dbdc4049b8cbe35c5429 | /fszn-common/src/main/java/com/fszn/common/utils/YamlUtil.java | 1abf9cfc96849412dd5883b0f95189cd52433a24 | [
"MIT"
] | permissive | zhou-jiang-git/LeYouYiXiu | 3b05ddfa37eddc8fd49dbd6c7a1525970c6337a0 | 015bb38e1e7e76c6a826869363e39bd90e0be9f5 | refs/heads/master | 2023-01-02T12:04:11.691822 | 2020-10-22T02:22:04 | 2020-10-22T02:22:04 | 305,240,054 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,804 | java | package com.fszn.common.utils;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.util.LinkedHashMap;
import java.util.Map;
import org.yaml.snakeyaml.DumperOptions;
import org.yaml.snakeyaml.Yaml;
/**
* 配置处理工具类
*
* @author yml
*/
public class YamlUtil
{
public static Map<?, ?> loadYaml(String fileName) throws FileNotFoundException
{
InputStream in = YamlUtil.class.getClassLoader().getResourceAsStream(fileName);
return StringUtils.isNotEmpty(fileName) ? (LinkedHashMap<?, ?>) new Yaml().load(in) : null;
}
public static void dumpYaml(String fileName, Map<?, ?> map) throws IOException
{
if (StringUtils.isNotEmpty(fileName))
{
FileWriter fileWriter = new FileWriter(YamlUtil.class.getResource(fileName).getFile());
DumperOptions options = new DumperOptions();
options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
Yaml yaml = new Yaml(options);
yaml.dump(map, fileWriter);
}
}
public static Object getProperty(Map<?, ?> map, Object qualifiedKey)
{
if (map != null && !map.isEmpty() && qualifiedKey != null)
{
String input = String.valueOf(qualifiedKey);
if (!"".equals(input))
{
if (input.contains("."))
{
int index = input.indexOf(".");
String left = input.substring(0, index);
String right = input.substring(index + 1, input.length());
return getProperty((Map<?, ?>) map.get(left), right);
}
else if (map.containsKey(input))
{
return map.get(input);
}
else
{
return null;
}
}
}
return null;
}
@SuppressWarnings("unchecked")
public static void setProperty(Map<?, ?> map, Object qualifiedKey, Object value)
{
if (map != null && !map.isEmpty() && qualifiedKey != null)
{
String input = String.valueOf(qualifiedKey);
if (!input.equals(""))
{
if (input.contains("."))
{
int index = input.indexOf(".");
String left = input.substring(0, index);
String right = input.substring(index + 1, input.length());
setProperty((Map<?, ?>) map.get(left), right, value);
}
else
{
((Map<Object, Object>) map).put(qualifiedKey, value);
}
}
}
}
} | [
"zj18770988063@163.com"
] | zj18770988063@163.com |
7fe1e95b560f67f60ca0393e83a88f3fbc23cf85 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/10/10_ac7d9e193eef7db13608a02c58d4e184ec5f30b7/NonlinearEquationSystem/10_ac7d9e193eef7db13608a02c58d4e184ec5f30b7_NonlinearEquationSystem_t.java | 33e997921704f6133fe0d916b2e601e48173a419 | [] | 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 | 3,834 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package edu.gatech.statics.modes.equation.solver;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
/**
*
* @author Calvin Ashmore
*/
public class NonlinearEquationSystem implements EquationSystem {
private Map<Integer, Polynomial> system = new HashMap<Integer, Polynomial>();
private Map<String, Float> solution;
private boolean processed;
private Polynomial getRow(int equation) {
Polynomial row = system.get(equation);
if (row == null) {
row = new Polynomial();
system.put(equation, row);
}
return row;
}
public void addTerm(int equationId, EquationTerm term) {
Polynomial row = getRow(equationId);
Polynomial.Term polyTerm;
if (term instanceof EquationTerm.Constant) {
polyTerm = new Polynomial.Term(Collections.<Polynomial.Symbol>emptyList());
} else if (term instanceof EquationTerm.Symbol) {
String symbolName = ((EquationTerm.Symbol) term).getName();
polyTerm = new Polynomial.Term(Arrays.asList(new Polynomial.Symbol(symbolName, 1)));
} else if (term instanceof EquationTerm.Polynomial) {
Map<String, Integer> powers = ((EquationTerm.Polynomial) term).getPowers();
polyTerm = new Polynomial.Term(powers);
} else {
throw new IllegalArgumentException("Invalid equation term provided: " + term.getClass());
}
row.addTerm(polyTerm, term.getCoefficient());
}
private void process() {
List<Polynomial> polys = new ArrayList<Polynomial>(system.values());
List<Polynomial> basis = null;
try {
basis = new BuchbergerAlgorithm().findBasis(polys);
} catch (ArithmeticException ex) {
Logger.getLogger("Statics").info("Could not process system due to arithmetic error: " + ex.getMessage());
}
if (basis == null) {
processed = true;
return;
}
List<Polynomial> linearPolys = new ArrayList<Polynomial>();
for (Polynomial polynomial : basis) {
if (polynomial.getMaxDegree() == 1) {
linearPolys.add(polynomial);
}
}
// we have a list of linear polynomials. Attempt to build linear system from them...
LinearEquationSystem linearSystem = new LinearEquationSystem();
int row = 0;
for (Polynomial polynomial : linearPolys) {
for (Polynomial.Term term : polynomial.getAllTerms()) {
double coefficient = polynomial.getCoefficient(term);
if (term.degree() == 1) {
// term is linear
linearSystem.addTerm(row, new EquationTerm.Symbol(coefficient, term.getSymbols().get(0).getName()));
} else {
// term is constant (it must be due to linearity)
linearSystem.addTerm(row, new EquationTerm.Constant(coefficient));
}
}
row++;
}
solution = linearSystem.solve();
processed = true;
}
public boolean isSolvable() {
if (!processed) {
process();
}
return solution != null;
}
public Map<String, Float> solve() {
if (!processed) {
process();
}
return solution;
}
public void resetTerms() {
system.clear();
solution = null;
processed = false;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
08bbc3d4aade5a492dac3c54539d682e96894bce | a1b8aa04dd1d96a7775c57943a562c07a5bd83f8 | /app/src/main/java/com/example/gw/usbprint/common/utils/AppUtil.java | d357366910617e14553d073088e1e5f9a6892f3f | [] | no_license | YMY980828/usb-print | fd2ca4307bf76fa76b461b1d5ac42560260c2ba9 | a1d12ffaed74029642742d1fe7bc034a2ad62f2b | refs/heads/master | 2023-01-18T22:13:40.419904 | 2020-12-01T09:24:43 | 2020-12-01T09:24:43 | 317,488,561 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 470 | java | package com.example.gw.usbprint.common.utils;
import android.app.Application;
import android.os.Environment;
import com.example.gw.usbprint.FrmApplication;
/**
* Created by guwei on 15/4/15.
*/
public class AppUtil {
public static Application getApplicationContext() {
return FrmApplication.getInstance();
}
public static String getStoragePath() {
return Environment.getExternalStorageDirectory().getPath() + "/certificate";
}
}
| [
"990116502@qq.com"
] | 990116502@qq.com |
3e64a7e0fff4da20b0a80c591936fb3c94ec0b34 | 982d5a71996bf35f743b8c674b3550034955b1f2 | /lims/src/cn/edu/buaa/leochrist/dao/hibernate/ResultDaoHibernate.java | 7a694d32e50039056b246c80cf87971aca8045f4 | [] | no_license | jaydi2014/leochrist-lims | ab57ab23a9e4b90747013e55aefbf47074a5dd20 | 823c3cc00f19ce85122a1ced1ddc0c25d7a0c6ce | refs/heads/master | 2021-01-01T20:10:11.175500 | 2010-07-01T02:52:00 | 2010-07-01T02:52:00 | 36,537,185 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 358 | java | package cn.edu.buaa.leochrist.dao.hibernate;
import cn.edu.buaa.leochrist.dao.ResultDao;
import cn.edu.buaa.leochrist.dao.generic.GenericDaoHibernate;
import cn.edu.buaa.leochrist.model.Result;
public class ResultDaoHibernate extends
GenericDaoHibernate<Result, Integer> implements ResultDao {
public ResultDaoHibernate() {
super(Result.class);
}
} | [
"leo.christ@hotmail.com"
] | leo.christ@hotmail.com |
00b099a04bf933d8388a06b054daca7e0e894113 | 16aece6efa4a83a23a4bf6e37748188a5fb37afd | /src/fr/tolc/jahia/intellij/plugin/cnd/model/ViewModel.java | fe6be1d0ca7603909911de0b0f8baa265e1c8eb3 | [
"Apache-2.0"
] | permissive | Tolc/IntelliJ_Jahia_plugin | 59184535f06b1e4c96e6881df8ae47a3c3a3a881 | 29e9e635b1bf3a8067135e3c8c50659b30601678 | refs/heads/master | 2023-02-20T16:31:21.582500 | 2023-02-16T18:55:09 | 2023-02-16T18:55:09 | 45,263,129 | 23 | 7 | Apache-2.0 | 2023-02-16T18:55:10 | 2015-10-30T16:31:23 | Java | UTF-8 | Java | false | false | 2,193 | java | package fr.tolc.jahia.intellij.plugin.cnd.model;
import org.apache.commons.lang.StringUtils;
public class ViewModel {
public static final String DEFAULT = "default";
private NodeTypeModel nodeType;
private String name;
private String type; //html/json/rss/xml/...
private String language; //jsp/groovy/...
private String tagName; //include/module, only used for tags completions and references
public ViewModel(NodeTypeModel nodeType, String name, String type, String language) {
this.nodeType = nodeType;
this.name = name;
this.type = type;
this.language = language;
}
public ViewModel(String namespace, String nodeTypeName, String name, String type, String language) {
this.nodeType = new NodeTypeModel(namespace, nodeTypeName);
this.name = name;
this.type = type;
this.language = language;
}
public NodeTypeModel getNodeType() {
return nodeType;
}
public void setNodeType(NodeTypeModel nodeType) {
this.nodeType = nodeType;
}
public String getName() {
return name;
}
public String getFormattedName() {
return (isDefault())? DEFAULT : name;
}
public void setName(String name) {
this.name = name;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getLanguage() {
return language;
}
public void setLanguage(String language) {
this.language = language;
}
public boolean isHidden() {
return this.name.contains("hidden.") || this.name.contains(".hidden");
}
public boolean isDefault() {
return StringUtils.isBlank(this.name) || (DEFAULT + ".").equals(this.name);
}
public boolean isSameView(ViewModel viewModel) {
return this.nodeType.equals(viewModel.nodeType) && this.name.equals(viewModel.name) && this.type.equals(viewModel.type);
}
public String getTagName() {
return tagName;
}
public void setTagName(String tagName) {
this.tagName = tagName;
}
}
| [
"thomas.coquel117@gmail.com"
] | thomas.coquel117@gmail.com |
dea43d10381f2dc14955dc1c346b8f693725f487 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/10/10_6ee2681059ac9c8f578105e527fb9ca956c445f3/JSONObjectComparator/10_6ee2681059ac9c8f578105e527fb9ca956c445f3_JSONObjectComparator_t.java | 21376fb6bc350f702ab9a37c833a5f4a80730a85 | [] | 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 | 964 | java | package autotest.common.table;
import autotest.common.table.DataSource.SortSpec;
import com.google.gwt.json.client.JSONObject;
import java.util.Comparator;
public class JSONObjectComparator implements Comparator<JSONObject> {
SortSpec[] sortSpecs;
public JSONObjectComparator(SortSpec[] specs) {
sortSpecs = new SortSpec[specs.length];
System.arraycopy(specs, 0, sortSpecs, 0, specs.length);
}
public int compare(JSONObject arg0, JSONObject arg1) {
int compareValue = 0;
for (SortSpec sortSpec : sortSpecs) {
String key0 = arg0.get(sortSpec.getField()).toString().toLowerCase();
String key1 = arg1.get(sortSpec.getField()).toString().toLowerCase();
compareValue = key0.compareTo(key1) * sortSpec.getDirectionMultiplier();
if (compareValue != 0) {
break;
}
}
return compareValue;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
49958461c6be585c7306277dc563d7a03088bafd | fb1b04a30c6ec803328aa5451b542f601444383d | /app/src/main/java/com/techexchange/mobileapps/recyclerdemo/MainActivity.java | f756385496bacf77e40f15e2d9bd8adfa0236415 | [] | no_license | kristalys47/MobileApp-Lab7 | a189c6e4bff9e8ec8b949936c4d2155754288353 | ccdf5d8e39c19737a011bdc0233b1158771ac9f2 | refs/heads/master | 2020-03-28T17:07:37.820400 | 2018-09-15T20:48:10 | 2018-09-15T20:48:10 | 148,760,580 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,381 | java | package com.techexchange.mobileapps.recyclerdemo;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.util.Preconditions;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;
import android.widget.Toast;
import com.techexchange.mobileapps.recyclerdemo.SingleQuestionFragment.OnQuestionAnsweredListener;
import java.util.ArrayList;
import java.util.List;
public class MainActivity extends AppCompatActivity implements OnQuestionAnsweredListener {
static final String KEY_SCORE = "Score";
private int currentScore = 0;
private List<Question> questions;
private int attempt = 0;
private ViewPager viewPager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
FragmentManager fm = getSupportFragmentManager();
questions = initQuestionList();
viewPager = findViewById(R.id.question_pager);
viewPager.setAdapter(new QuestionFragmentAdapter(fm, questions));
}
private List<Question> initQuestionList() {
Resources res = getResources();
String[] questions = res.getStringArray(R.array.questions);
String[] correctAnswers = res.getStringArray(R.array.correct_answers);
String[] wrongAnswers = res.getStringArray(R.array.incorrect_answers);
List<Question> qList = new ArrayList<>();
for (int i = 0; i < questions.length; ++i) {
qList.add(new Question(questions[i], correctAnswers[i], wrongAnswers[i]));
}
return qList;
}
@Override
public void onQuestionAnswered(String selectedAnswer, int questionId) {
System.out.println("The " + selectedAnswer + " button was pressed!");
System.out.println("Current answer: " + questionId);
TextView mTextView;
if (questions.get(questionId).getSelectedAnswer() == null) {
if (selectedAnswer.contentEquals(questions.get(questionId).getCorrectAnswer())) {
currentScore++;
System.out.println(currentScore);
questions.get(questionId).setSelectedAnswer(selectedAnswer);
}
attempt++;
if (attempt == questions.size()) {
System.out.println("Enters the intent");
Intent scoreIntent = new Intent(this, ScoreActivity.class);
scoreIntent.putExtra(KEY_SCORE, currentScore);
startActivityForResult(scoreIntent, 0);
}
}
}
@Override
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
boolean repeat = data.getBooleanExtra(ScoreActivity.KEY_RESTART_QUIZ, true);
if (resultCode != Activity.RESULT_OK || requestCode != 0 || data == null) {
finish();
}
else if(repeat){
currentScore = 0;
attempt = 0;
for(Question q: questions){
q.setSelectedAnswer(null);
}
viewPager.setAdapter(new QuestionFragmentAdapter(getSupportFragmentManager(), questions));
}
else
finish();
}
private static final class QuestionFragmentAdapter
extends FragmentStatePagerAdapter {
private List<Question> questions;
public QuestionFragmentAdapter(FragmentManager fm, List<Question> questions) {
super(fm);
this.questions = questions;
}
@Override
public Fragment getItem(int position) {
return SingleQuestionFragment.createFragmentFromQuestion(questions.get(position), position);
}
@Override
public int getCount() {
return questions.size();
}
}
} | [
"kristalys@google.com"
] | kristalys@google.com |
8e902de06ab44f1f47f0250f3f2561f7f55b2906 | 678de3b11eb0d9292eb52eb75f63115460fc02cb | /data/asia-tuning/ground-truth-codes/11/30204.java | 01fefd61d9f7c47882692da7841aa63f48627d2a | [] | no_license | ADANAPaper/replication_package | c531978931104fcae5e82fd27d7c3e47f4d748ab | 643e0cb9d42023dcc703a7c00af7627d9a08e720 | refs/heads/master | 2021-01-19T17:31:36.290361 | 2020-05-08T15:14:46 | 2020-05-08T15:14:46 | 101,067,182 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 278 | java | Intent intent = new Intent(this, TheServiceYouWantToStart.class);
PendingIntent pending = PendingIntent.getService(this, 0, intent, 0);
AlarmManager alarm = (AlarmManager) this.getSystemService(Context.ALARM_SERVICE);
alarm.set(AlarmManager.RTC_WAKEUP, Time_To_wake, pending);;
| [
"Anonymous"
] | Anonymous |
d6da9a858326e81dcf90fe00a5f674b2246a8322 | fe632383e59c105c760c4367a4f4fcabbe7995d2 | /src/main/java/br/ucb/filtro/ProdAcFiltro.java | 3720c7039290e877662ea89e51f00817829f2850 | [
"Apache-2.0"
] | permissive | GusAraujos/prodAcad | ebb4dc50d2398cede986b0f4d3fc7d67ac9a605a | 132efb4a33b900ed74f125e6cf941ba9f0b0f731 | refs/heads/master | 2020-05-01T17:19:49.617332 | 2019-03-25T14:01:14 | 2019-03-25T14:01:14 | 177,596,486 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,132 | java | package br.ucb.filtro;
import java.util.Date;
public class ProdAcFiltro {
private String titulo;
private String descricao;
private Date dataCadastro;
private Integer codigo;
private Integer codigoParticipante;
private String tipoAutor;
public String getTipoAutor() {
return this.tipoAutor;
}
public void setTipoAutor(String tipoAutor) {
this.tipoAutor = tipoAutor;
}
public Integer getCodigoParticipante() {
return this.codigoParticipante;
}
public void setCodigoParticipante(Integer codigoParticipante) {
this.codigoParticipante = codigoParticipante;
}
public String getTitulo() {
return this.titulo;
}
public void setTitulo(String titulo) {
this.titulo = titulo;
}
public String getDescricao() {
return this.descricao;
}
public void setDescricao(String descricao) {
this.descricao = descricao;
}
public Date getDataCadastro() {
return this.dataCadastro;
}
public void setDataCadastro(Date dataCadastro) {
this.dataCadastro = dataCadastro;
}
public Integer getCodigo() {
return this.codigo;
}
public void setCodigo(Integer codigo) {
this.codigo = codigo;
}
}
| [
"ovatsug12@hotmail.com"
] | ovatsug12@hotmail.com |
165493997ecfbbe7c054f940b73ae1cba0841961 | 334ea5de57a9d67bfb4dba383277d2842ab29db3 | /Java Back-End/src/main/java/be/pxl/AON11/basicsecurity/service/FileService.java | ef1c24258faf322c32a4c568ba57d8beaf6817bc | [] | no_license | heerenjasper/Basic-Security_2018 | 974c1644b1d1706101c27c2f9b21bd5cbba75a0a | 7712f5e4d56db9bd76a9b8a7896c6f93bae9bf04 | refs/heads/master | 2021-01-25T11:43:53.281078 | 2018-05-24T09:04:27 | 2018-05-24T09:04:27 | 123,424,311 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 478 | java | package be.pxl.AON11.basicsecurity.service;
import be.pxl.AON11.basicsecurity.model.File;
import java.util.List;
import java.util.Optional;
/**
* Created by Ebert Joris on 24/03/2018.
*/
public interface FileService {
Optional<File> findFileById(Integer id);
void saveFile(File file);
void updateFile(File file);
void deleteFileById(Integer id);
void deleteAllFiles();
List<File> findAllFiles();
boolean doesFileExist(Integer FileId);
}
| [
"ebert-joris@hotmail.com"
] | ebert-joris@hotmail.com |
8ccd9f15a3937c0306b142a83d0f2534249f8fef | 5c5bad358e2d84dfc0236e9fe9e4509a7e79b17d | /src/main/java/com/webservice/app/converters/PersonaConverter.java | 7d3ea0e7016305583c99e785e78699eb0e2752c3 | [] | no_license | NRomeroO/Grupo-7-OO2-2021 | 01ca0ec3aaf09a3be4ffe951aa053c1c9c8a8669 | 8a0ba461242bc2eb6e8143f17506b4a186f00eed | refs/heads/master | 2023-05-02T13:42:46.833301 | 2021-05-24T22:38:46 | 2021-05-24T22:38:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 717 | java | package com.webservice.app.converters;
import org.springframework.stereotype.Component;
import com.webservice.app.entities.Persona;
import com.webservice.app.models.PersonaModel;
@Component("personaModel")
public class PersonaConverter {
public PersonaModel entityToModel(Persona persona){
return new PersonaModel(persona.getId(), persona.getNombre(), persona.getApellido(),persona.getTipoDocumento(), persona.getDni(), persona.getEmail());
}
public Persona modelToEntity(PersonaModel personaModel){
return new Persona(personaModel.getId(),personaModel.getNombre(), personaModel.getApellido() ,personaModel.getTipoDocumento(),personaModel.getDni(),personaModel.getEmail());
}
}
| [
"sofiasa@live.com.ar"
] | sofiasa@live.com.ar |
16765d77244f7213e0cdc47c52771505bfd9432e | 2d9687f827b72d418d595ec90498d1ae896b08ef | /GiftCard/src/com/iiht/giftcard/controller/GiftCardStatusController.java | d7f152a8db40231f4f282653cae0460694f42831 | [] | no_license | NiteenGhodke/FinGift | 241492ef6422b9b999b90b13e1290711000cd947 | 0e77a8f09a3a12e9081eb82856e122a52d1e7736 | refs/heads/master | 2022-09-07T10:09:43.124895 | 2020-05-22T12:17:16 | 2020-05-22T12:17:16 | 266,100,365 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,072 | java | package com.iiht.giftcard.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.iiht.giftcard.dao.GiftCardDao;
import com.iiht.giftcard.model.Order;
@Controller
public class GiftCardStatusController {
@Autowired
GiftCardDao viewUndeliveredOrder;//will inject dao from XML file
@RequestMapping(value="/order",method = RequestMethod.POST)
public String viewUndeliveredOrder(Model m){
List<Order> orderList=viewUndeliveredOrder.viewUndeliveredOrder();
if(CollectionUtils.isEmpty(orderList)) {
m.addAttribute("message","Data Not Found");
return "error";
}
else {
m.addAttribute("undeliveredOrderList", orderList);
return "viewundeliveredorder";
}
}
}
| [
"nitt.ghodke@gmail.com"
] | nitt.ghodke@gmail.com |
fa3ead0c1261105aaf9dac0d283c6b457b58db4a | 3ef55e152decb43bdd90e3de821ffea1a2ec8f75 | /large/module1074/src/java/module1074/a/Foo3.java | f64287dbb5d57b28681f2d458b2f93da76084424 | [
"BSD-3-Clause"
] | permissive | salesforce/bazel-ls-demo-project | 5cc6ef749d65d6626080f3a94239b6a509ef145a | 948ed278f87338edd7e40af68b8690ae4f73ebf0 | refs/heads/master | 2023-06-24T08:06:06.084651 | 2023-03-14T11:54:29 | 2023-03-14T11:54:29 | 241,489,944 | 0 | 5 | BSD-3-Clause | 2023-03-27T11:28:14 | 2020-02-18T23:30:47 | Java | UTF-8 | Java | false | false | 1,494 | java | package module1074.a;
import java.rmi.*;
import java.nio.file.*;
import java.sql.*;
/**
* Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
* labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
* Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
*
* @see java.util.logging.Filter
* @see java.util.zip.Deflater
* @see javax.annotation.processing.Completion
*/
@SuppressWarnings("all")
public abstract class Foo3<D> extends module1074.a.Foo2<D> implements module1074.a.IFoo3<D> {
javax.lang.model.AnnotatedConstruct f0 = null;
javax.management.Attribute f1 = null;
javax.naming.directory.DirContext f2 = null;
public D element;
public static Foo3 instance;
public static Foo3 getInstance() {
return instance;
}
public static <T> T create(java.util.List<T> input) {
return module1074.a.Foo2.create(input);
}
public String getName() {
return module1074.a.Foo2.getInstance().getName();
}
public void setName(String string) {
module1074.a.Foo2.getInstance().setName(getName());
return;
}
public D get() {
return (D)module1074.a.Foo2.getInstance().get();
}
public void set(Object element) {
this.element = (D)element;
module1074.a.Foo2.getInstance().set(this.element);
}
public D call() throws Exception {
return (D)module1074.a.Foo2.getInstance().call();
}
}
| [
"gwagenknecht@salesforce.com"
] | gwagenknecht@salesforce.com |
4c69df4f7a7c91661df98f7deec60cdce0f44d1d | 333ade37fa73f481dbabde1bbc6e84db2909aa75 | /nqs-common/src/main/java/com/acsno/common/dao/RoleResourceDao.java | 6857bb31acbd74f24d57db17679954fcf6b2a1c1 | [] | no_license | sunjiyongtc0/cloud-nqs-web | 3eeba476c615a2513833396d30d37f908546fa47 | 1fd93ea34089114b9a160224e38bc71782c45150 | refs/heads/master | 2023-01-31T14:12:25.374502 | 2020-12-04T06:34:39 | 2020-12-04T06:34:39 | 304,198,315 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 394 | java | package com.acsno.common.dao;
import com.acsno.common.entity.RoleResourceEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface RoleResourceDao extends BaseMapper<RoleResourceEntity> {
void RomeByIdNotIn(@Param("roleId") long roleId, @Param("Ids") String Ids);
}
| [
"315541219@qq.com"
] | 315541219@qq.com |
a6fdb29e07264982199cfcca52158c2ac87dfc78 | e53b7a02300de2b71ac429d9ec619d12f21a97cc | /src/com/coda/efinance/schemas/currency/CurrencyExchangeRate.java | da6f4e06314e1ce183607fc039223ae309a8ef76 | [] | no_license | phi2039/coda_xmli | 2ad13c08b631d90a26cfa0a02c9c6c35416e796f | 4c391b9a88f776c2bf636e15d7fcc59b7fcb7531 | refs/heads/master | 2021-01-10T05:36:22.264376 | 2015-12-03T16:36:23 | 2015-12-03T16:36:23 | 47,346,047 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,149 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2015.12.03 at 01:43:12 AM EST
//
package com.coda.efinance.schemas.currency;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* This element holds exchange rate information for one particular currency.
*
* <p>Java class for CurrencyExchangeRate complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="CurrencyExchangeRate">
* <complexContent>
* <extension base="{http://www.coda.com/efinance/schemas/currency}CurrExchangeRate">
* <sequence>
* <element name="ExchangeRates" type="{http://www.coda.com/efinance/schemas/currency}ExchangeRateData"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CurrencyExchangeRate", propOrder = {
"exchangeRates"
})
public class CurrencyExchangeRate
extends CurrExchangeRate
implements Serializable
{
@XmlElement(name = "ExchangeRates", required = true)
protected ExchangeRateData exchangeRates;
/**
* Gets the value of the exchangeRates property.
*
* @return
* possible object is
* {@link ExchangeRateData }
*
*/
public ExchangeRateData getExchangeRates() {
return exchangeRates;
}
/**
* Sets the value of the exchangeRates property.
*
* @param value
* allowed object is
* {@link ExchangeRateData }
*
*/
public void setExchangeRates(ExchangeRateData value) {
this.exchangeRates = value;
}
}
| [
"climber2039@gmail.com"
] | climber2039@gmail.com |
cd9462f43aa78577d432f9a95ff56f9190d8d72e | 88ab82476c4e07b0686e772f7aec672c395e01d9 | /DAO/StudentDao.java | 7a58a16f427f5cbb60846cc26d78fd977c95505f | [] | no_license | lismsdh2/projectF | 72bf29495a8f3c97711ba28b7534899ef447f4ce | 0e1666f0fb2d30148c066a517c47f4cf0f87ab85 | refs/heads/master | 2022-11-16T13:14:01.258566 | 2020-07-10T00:18:52 | 2020-07-10T00:18:52 | 261,232,831 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,314 | java | package DAO;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Types;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import DTO.StudentDto;
import DTO.TaskDto;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import util.JdbcUtil;
/**
* @author 김지현
*/
public class StudentDao {
private Connection connection;
private PreparedStatement pstmt;
private ResultSet rs;
private JdbcUtil ju;
// private int i = 1;
// DB연결
private void connectionJDBC() {
try {
ju = new JdbcUtil();
connection = ju.getConnection();
System.out.println("드라이버 로딩 성공 :StudentDao");
} catch (Exception e) {
// e.printStackTrace();
System.out.println("[SQL Error : " + e.getMessage() + "]");
System.out.println("드라이버 로딩 실패 : StudentDao");
}
}
public ObservableList<StudentDto> selectUserStudentList(int classno) {
// DB연결
connectionJDBC();
ObservableList<StudentDto> list = FXCollections.observableArrayList();
try {
String sql = "select * from class_student where class_no=? order by user_name";
pstmt = connection.prepareStatement(sql);
pstmt.setInt(1, classno);
ResultSet re = pstmt.executeQuery();
int i = 1;
while (re.next()) {
StudentDto st = new StudentDto();
st.setStNo(i);
st.setStTitle(re.getString("user_name"));
st.setStDesc(re.getString("student_id"));
// st.setStFile("sdfsdf");
// st.setstRegdate(LocalDate.parse(re.getString("reg_date"), DateTimeFormatter.ISO_DATE));
// if (re.getString("expire_date") == null) {
// System.out.println("selectList-expireDate-null");
// } else {
// st.setstExpireDate(LocalDate.parse(re.getString("expire_date"), DateTimeFormatter.ISO_DATE));
// }
//
// st.setstFile(re.getString("attachedFile_name"));
// st.setPerfectScore((Integer) re.getObject("perfect_score"));
// st.setClassNo(re.getInt("class_no"));
list.add(st);
i++;
}
} catch (SQLException e) {
e.printStackTrace();
} finally {
// 접속종료
ju.disconnect(connection, pstmt, rs);
}
return list;
}
} | [
"noreply@github.com"
] | noreply@github.com |
1df2dbcc5094182b77cbf558d3a26a1cd4e0cab3 | 4aa90348abcb2119011728dc067afd501f275374 | /app/src/main/java/com/tencent/mm/plugin/sns/ui/h.java | b15267e97f57e0af8e4fca8e58863412f883f34b | [] | no_license | jambestwick/HackWechat | 0d4ceb2d79ccddb45004ca667e9a6a984a80f0f6 | 6a34899c8bfd50d19e5a5ec36a58218598172a6b | refs/heads/master | 2022-01-27T12:48:43.446804 | 2021-12-29T10:36:30 | 2021-12-29T10:36:30 | 249,366,791 | 0 | 0 | null | 2020-03-23T07:48:32 | 2020-03-23T07:48:32 | null | UTF-8 | Java | false | false | 3,926 | java | package com.tencent.mm.plugin.sns.ui;
import com.tencent.mm.modelsfs.FileOp;
import com.tencent.mm.protocal.c.aji;
import com.tencent.mm.protocal.c.aqr;
import com.tencent.mm.protocal.c.cf;
import com.tencent.mm.protocal.c.dp;
import com.tencent.mm.sdk.platformtools.x;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
public final class h extends e<aqr> {
private List<aqr> list = new ArrayList();
private String nQA = "";
private String path = "";
private dp rqI;
private cf rqJ;
private a rqK;
private int rqr = 0;
private int rqs = 0;
public interface a {
void a(List<aqr> list, Map<Integer, Integer> map, Map<Integer, Integer> map2, int i, int i2, dp dpVar);
void byU();
}
public h(a aVar) {
this.rqK = aVar;
}
public final void bT(List<aqr> list) {
if (this.rqK == null) {
return;
}
if (list != null) {
Map hashMap = new HashMap();
Map hashMap2 = new HashMap();
hashMap.clear();
hashMap2.clear();
int size = list.size();
x.d("MicroMsg.ArtistAdapterHelper", "initFixType " + size);
int i = 0;
int i2 = 0;
int i3;
for (int i4 = 0; i4 < size; i4 = i3 + i4) {
String str = ((aqr) list.get(i4)).nfe;
i3 = i4 + 1 < size ? !str.equals(((aqr) list.get(i4 + 1)).nfe) ? 1 : i4 + 2 < size ? !str.equals(((aqr) list.get(i4 + 2)).nfe) ? 2 : 3 : 2 : 1;
hashMap.put(Integer.valueOf(i), Integer.valueOf(i2));
hashMap2.put(Integer.valueOf(i), Integer.valueOf(i3));
i2 += i3;
i++;
}
this.rqr = i + 1;
this.rqs = list.size();
x.d("MicroMsg.ArtistAdapterHelper", "icount " + this.rqr);
this.list = list;
this.rqK.a(this.list, hashMap, hashMap2, this.rqs, this.rqr, this.rqI);
return;
}
this.rqK.byU();
}
public final List<aqr> byT() {
List<aqr> arrayList = new ArrayList();
try {
arrayList.clear();
this.rqJ = null;
String str = this.path + this.nQA + "_ARTISTF.mm";
if (FileOp.bO(str)) {
this.rqJ = (cf) new cf().aF(FileOp.d(str, 0, -1));
}
if (this.rqJ == null) {
String str2 = this.path + this.nQA + "_ARTIST.mm";
this.rqJ = com.tencent.mm.plugin.sns.g.a.KQ(new String(FileOp.d(str2, 0, (int) FileOp.me(str2))));
if (this.rqJ == null) {
FileOp.deleteFile(str2);
return null;
}
FileOp.deleteFile(str);
FileOp.j(str, this.rqJ.toByteArray());
}
if (this.rqJ == null) {
return null;
}
Iterator it = this.rqJ.vHz.iterator();
while (it.hasNext()) {
aji com_tencent_mm_protocal_c_aji = (aji) it.next();
String str3 = com_tencent_mm_protocal_c_aji.nfp;
Iterator it2 = com_tencent_mm_protocal_c_aji.vYd.iterator();
while (it2.hasNext()) {
aqr com_tencent_mm_protocal_c_aqr = (aqr) it2.next();
com_tencent_mm_protocal_c_aqr.nfe = str3;
arrayList.add(com_tencent_mm_protocal_c_aqr);
}
}
this.rqI = this.rqJ.vHy;
return arrayList;
} catch (Throwable e) {
x.printErrStackTrace("MicroMsg.ArtistAdapterHelper", e, "loadData failed.", new Object[0]);
return null;
}
}
public final void eo(String str, String str2) {
this.nQA = str;
this.path = str2;
fC(true);
}
}
| [
"malin.myemail@163.com"
] | malin.myemail@163.com |
da9ec22e27a718fbd08d6c589950e0f9f62ae367 | 2f7790c9b179c5ce05c589e5f116bf2c15a3cdeb | /app/src/test/java/com/galileoguzman/semovi06/ExampleUnitTest.java | 98911c896cdfe9e7c9a15d387b095a48f895e8c9 | [] | no_license | galileoguzman/semovi06 | 66fbad53ce52d8efc44d9bf3ec628ce6ed18f0d9 | 4778ff72a606b5fcc4bdeda1256702c8e5a2d2de | refs/heads/master | 2020-08-13T02:50:28.354050 | 2019-10-13T20:59:08 | 2019-10-13T20:59:08 | 214,892,997 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 387 | java | package com.galileoguzman.semovi06;
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() {
assertEquals(4, 2 + 2);
}
} | [
"galileoguzman@gmail.com"
] | galileoguzman@gmail.com |
9d14916cdf895335ca864a46c30a88682779d98b | 69e480ba3ee92d5c4501c90e86eb25ef8eb3f781 | /jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/message/handle/enums/SendMsgTypeEnum.java | a47b7e2711ded620fcacee04f6635072db50206e | [
"Apache-2.0"
] | permissive | xlj44400/jeecg-boot | 92358143e21e4ec9d45af8153bc143b0fb9d8a7b | 03429f398799fbb63025ce3abc769dae374c516b | refs/heads/master | 2022-12-10T19:03:36.408720 | 2022-12-08T06:38:26 | 2022-12-08T06:38:26 | 189,201,872 | 4 | 1 | Apache-2.0 | 2020-03-13T09:05:32 | 2019-05-29T10:15:31 | Java | UTF-8 | Java | false | false | 1,242 | java | package org.jeecg.modules.message.handle.enums;
import org.jeecg.common.util.oConvertUtils;
/**
* 发送消息类型枚举
* @author: jeecg-boot
*/
public enum SendMsgTypeEnum {
/**
* 短信
*/
SMS("1", "org.jeecg.modules.message.handle.impl.SmsSendMsgHandle"),
/**
* 邮件
*/
EMAIL("2", "org.jeecg.modules.message.handle.impl.EmailSendMsgHandle"),
/**
* 微信
*/
WX("3","org.jeecg.modules.message.handle.impl.WxSendMsgHandle"),
/**
* 系统消息
*/
SYSTEM_MESSAGE("4","org.jeecg.modules.message.handle.impl.SystemSendMsgHandle");
private String type;
private String implClass;
private SendMsgTypeEnum(String type, String implClass) {
this.type = type;
this.implClass = implClass;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getImplClass() {
return implClass;
}
public void setImplClass(String implClass) {
this.implClass = implClass;
}
public static SendMsgTypeEnum getByType(String type) {
if (oConvertUtils.isEmpty(type)) {
return null;
}
for (SendMsgTypeEnum val : values()) {
if (val.getType().equals(type)) {
return val;
}
}
return null;
}
}
| [
"zhangdaiscott@163.com"
] | zhangdaiscott@163.com |
50e7816ba560eff387ae55b678e8a333ae4c2e5e | fccef82a5b1baeaab525e913179aada3cc607d95 | /net.sf.eclipsefp.haskell.debug.ui/src/net/sf/eclipsefp/haskell/debug/ui/internal/launch/LaunchUpdater.java | 31cbc93aa02c5a7d07fa1161beb060c4cf5930cf | [] | no_license | serras/eclipsefp | 251b634ce15d42a6cdfb92f3f24a182f047e3c56 | b16089b3e8b95e276f86155c743884f8efedf844 | refs/heads/master | 2021-01-15T18:30:54.538215 | 2014-02-14T12:58:55 | 2014-02-14T12:58:55 | 1,850,041 | 5 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,421 | java | package net.sf.eclipsefp.haskell.debug.ui.internal.launch;
import java.util.ArrayList;
import java.util.List;
import net.sf.eclipsefp.haskell.debug.core.internal.launch.ILaunchAttributes;
import net.sf.eclipsefp.haskell.ui.HaskellUIPlugin;
import net.sf.eclipsefp.haskell.ui.util.CabalFileChangeListener;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
/**
* Listener to update launch configurations when Cabal file changes
* @author JP Moresmau
*
*/
public class LaunchUpdater implements CabalFileChangeListener {
@Override
public void cabalFileChanged( final IFile cabalF ) {
try {
// final ClassLoader cl=getClass().getClassLoader();
String projectName=cabalF.getProject().getName();
for(ILaunchConfiguration c:LaunchOperation.getConfigurationsForProject(LaunchOperation.getConfigType( InteractiveLaunchOperation.INTERACTIVE_CONFIG_TYPE ), projectName )){
String delegateClass=InteractiveLaunchOperation.getDelegate( c );
if (delegateClass!=null){
try {
//IInteractiveLaunchOperationDelegate delegate=(IInteractiveLaunchOperationDelegate)cl.loadClass( delegateClass).newInstance();
List<?> fileNames=c.getAttribute( ILaunchAttributes.FILES, new ArrayList<Object>() );
//IFile[] files=new IFile[fileNames.size()];
List<IFile> files=new ArrayList<IFile>(fileNames.size());
for(Object o:fileNames){
IFile f=(IFile)cabalF.getProject().findMember( (String )o);
//file may have been moved or deleted
if (f!=null){
files.add(f);
}
}
if (files.size()>0){
//String args=InteractiveLaunchOperation.getArguments(delegate,cabalF.getProject(),files.toArray( new IFile[files.size()]));
ILaunchConfigurationWorkingCopy wc=c.getWorkingCopy();
//wc.setAttribute( ILaunchAttributes.ARGUMENTS,args);
wc.doSave();
} else {
// we do not find any of the files to launch: remove the configuration
c.delete();
}
} catch (Throwable t){
HaskellUIPlugin.log( t );
}
}
}
} catch (CoreException ce){
HaskellUIPlugin.log( ce );
}
}
}
| [
"jp@moresmau.fr"
] | jp@moresmau.fr |
12ceed3b6af2dd05c316b364303b906ccaab6594 | d264191c29200a7103bf4efbaaf36a96d41e0eb7 | /app/src/main/java/com/sts/teacher/NotificationActivity.java | b817565276151a10fefdca098ad683f0bf0eba86 | [
"Apache-2.0"
] | permissive | SarathTharayil/ClassPortal | 1c7be670430f18130c094283ac7ef269d2381e4e | f43e5b86fc359e53d31a11f3eed0815b64a7dfd7 | refs/heads/master | 2020-05-07T19:02:32.931747 | 2020-01-01T17:44:14 | 2020-01-01T17:44:14 | 180,794,316 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,813 | java | package com.sts.teacher;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import com.google.firebase.database.ChildEventListener;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import java.util.ArrayList;
import java.util.List;
public class NotificationActivity extends BaseActivity {
List<Notification> notifications = new ArrayList<>();
RecyclerView recyclerView;
NotificationAdapter notificationAdapter = new NotificationAdapter();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_notification);
if(getSupportActionBar()!=null){
getSupportActionBar().setTitle("Notifications");
}
recyclerView = findViewById(R.id.recycler_view);
recyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL,false));
recyclerView.setAdapter(notificationAdapter);
mDbRef.child("notifications").addChildEventListener(new ChildEventListener() {
@Override
public void onChildAdded(@NonNull DataSnapshot dataSnapshot, @Nullable String s) {
if (dataSnapshot.getValue()!=null){
Notification notification = dataSnapshot.getValue(Notification.class);
if (notification!=null){
notifications.add(notification);
notificationAdapter.update(notifications);
}
}
}
@Override
public void onChildChanged(@NonNull DataSnapshot dataSnapshot, @Nullable String s) {
}
@Override
public void onChildRemoved(@NonNull DataSnapshot dataSnapshot) {
}
@Override
public void onChildMoved(@NonNull DataSnapshot dataSnapshot, @Nullable String s) {
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
}
});
FloatingActionButton floatingActionButton =findViewById(R.id.fab);
floatingActionButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(NotificationActivity.this,NotificationAddActivity.class));
}
});
}
}
| [
"saraththarayil@gmail.com"
] | saraththarayil@gmail.com |
44982eb283a8473bac1df1425e6b432434520920 | 6e73cae0b3a2adef8378b6860a9528cabdae6857 | /src/Pages/POM/Loginpagenew.java | 8a1ab0347c489f26156566e358801c239ac047f5 | [] | no_license | aneesh-sharma1991/TestNG-project | d96f428d0a3362601ce28a00bd340a068a9174fc | 972f0c30a8e8cf25c282d2dfc77a91478f765735 | refs/heads/master | 2022-12-01T19:48:29.393868 | 2020-08-11T07:44:38 | 2020-08-11T07:44:38 | 286,676,685 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 636 | java | package Pages.POM;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.How;
public class Loginpagenew {
WebDriver driver;
public Loginpagenew(WebDriver ldriver) {
this.driver = ldriver;
}
@FindBy(id="Username")
WebElement username;
@FindBy(how=How.ID,using="Password")
WebElement password;
@FindBy(how=How.CLASS_NAME,using="btn_submit")
WebElement submitbutton;
public void loginlilavati(String uname,String pass)
{
username.sendKeys(uname);
password.sendKeys(pass);
submitbutton.click();
}
}
| [
"e040669@epidomain.com"
] | e040669@epidomain.com |
5e226f8e1c314994cd5b62889e875f324020381c | f9f7f5ae0392c5cd8ed13b17e68349ae0296178f | /Trial-FXML/src/trial/fxml/TrialFXML.java | 666faea6a03133f6fae7e64a7f7a19c2c91fc5d6 | [] | no_license | Georgina7/Ligimoja-Project | c61ad1692df6013cda8485357957942ddd2d59b4 | f26230e452f231afe30dd1c40c8a943eb2036f8d | refs/heads/main | 2023-03-21T05:11:23.836295 | 2021-03-11T10:07:42 | 2021-03-11T10:07:42 | 342,205,399 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 886 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package trial.fxml;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
/**
*
* @author Chumba
*/
public class TrialFXML extends Application {
@Override
public void start(Stage stage) throws Exception {
Parent root = FXMLLoader.load(getClass().getResource("FXMLDocument.fxml"));
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
launch(args);
}
}
| [
"noreply@github.com"
] | noreply@github.com |
de059e9cb2389204473f1ec19a257b03dd61653b | 166a4615c0bb8a0759860955476ccd05cee61b67 | /TestJava/src/utility/TestBlob.java | a5f6af5eea6dc7f6aa59010a8d5c9fb822551252 | [] | no_license | prasenjit-biswas/TestJava | b89bdf70391a50ab8bf99638f83caa8a5625e510 | 5634ff97faa71a605d2bc551ac5e1ce00d53647c | refs/heads/master | 2020-05-17T16:28:55.487381 | 2015-05-08T09:23:29 | 2015-05-08T09:23:29 | 35,270,509 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,736 | java | package utility;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Timestamp;
import Dataretrieval.util.DBConnection;
import Dataretrieval.util.OracleConnection;
public class TestBlob {
public static void main(String[] args) {
Connection con = null;
PreparedStatement pst = null;
ResultSet rs = null;
InputStream is = null;
try{
con = OracleConnection.getConnection();
pst = con.prepareStatement("SELECT * FROM tests WHERE testid = ?");
pst.setString(1, "12485782279706112");
rs = pst.executeQuery();
if(rs.next()){
is = rs.getBinaryStream("data");
}
DBConnection.releaseResources(con, pst, rs);
if(is != null){
System.out.println("#### before byte operation : " + new Timestamp(System.currentTimeMillis()));
System.out.println("#### is.available : " + is.available());
InputStream dbin= new DataInputStream(is);
ByteArrayOutputStream bout= new ByteArrayOutputStream();
byte[] buffer = new byte[32768];
for(;;) {
int size = dbin.read(buffer);
if (size == -1) break;
bout.write(buffer,0,size);
}
dbin.close();
bout.flush();
byte barray[]= bout.toByteArray();
bout.close();
InputStream bin= new ByteArrayInputStream(barray);
DataInputStream input= new DataInputStream(bin);
System.out.println("#### after byte operation : " + new Timestamp(System.currentTimeMillis()));
}
}catch(Exception ex){
ex.printStackTrace();
}
}
}
| [
"biswas.prasenjit@tcs.com"
] | biswas.prasenjit@tcs.com |
3400b1a4232f8af66d9f821383e285a1d6ca4853 | 4b5350a4167f78be8e6210d597413ba00e872212 | /code/AwtDemo.java | 4859163ef94b6a58b3b97ac4594e7adefd5129c1 | [] | no_license | jullyjelly/JavaStudy | 7a51d803d459429c9428887fec952057e409e7b6 | 969cd1f0f5307e50b025dec5f714f6920413f1c9 | refs/heads/master | 2020-09-16T20:03:30.585379 | 2020-03-15T14:29:44 | 2020-03-15T14:29:44 | 223,876,012 | 0 | 0 | null | null | null | null | WINDOWS-1252 | Java | false | false | 835 | java | package aban;
import java.awt.*;
import java.awt.event.*;
public class AwtDemo {
public static void main(String[] args)
{
Frame f=new Frame("my fram");
f.setSize(500,400);
f.setLocation(300,200);
f.setLayout(new FlowLayout());
Button b=new Button("°´Å¥");
f.add(b);
// f.addWindowListener(new MyWin());
f.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.out.println("close");
System.exit(0);
}
public void windowActivated(WindowEvent e)
{
System.out.println("act");
}
public void windowOpened(WindowEvent e)
{
System.out.println("open");
}
});
f.setVisible(true);
}
}
//class MyWin extends WindowAdapter
//{
// public void windowClosing(WindowEvent e)
// {
// System.out.println("close");
// System.exit(0);
// }
//}
| [
"525851351@qq.com"
] | 525851351@qq.com |
c52a45fc3954121ea2879a505a9abe69aafd904f | 5d3bc28ac85ee83ea201d49be061994efc78bfc9 | /app/src/main/java/com/norihirosunada/rajawalitest/MainActivity.java | 356c4bf59ea5fd74253159e243adada1a90c50cb | [] | no_license | norihirosunada/RajawaliTest | 9c096d4982e2d02194edf07d6eebb1e6934c382f | a7989faaeecc8673a52561013666661b3f13266d | refs/heads/master | 2021-01-20T19:59:54.744103 | 2016-06-19T08:07:11 | 2016-06-19T08:07:11 | 61,470,040 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,365 | java | package com.norihirosunada.rajawalitest;
import android.app.ActionBar;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.Menu;
import android.view.MenuItem;
import android.view.ViewGroup;
import org.rajawali3d.surface.IRajawaliSurface;
import org.rajawali3d.surface.RajawaliSurfaceView;
public class MainActivity extends AppCompatActivity implements View.OnTouchListener {
Renderer renderer;
public RajawaliSurfaceView rajawaliSurfaceView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});
// rajawaliSurfaceView = (RajawaliSurfaceView)findViewById(R.id.rajawali_surface);
// rajawaliSurfaceView.setOnTouchListener(this);
// renderer = new Renderer(this);
// rajawaliSurfaceView.setSurfaceRenderer(renderer);
final RajawaliSurfaceView surface = new RajawaliSurfaceView(this);
surface.setFrameRate(60.0);
surface.setRenderMode(IRajawaliSurface.RENDERMODE_WHEN_DIRTY);
surface.setOnTouchListener(this);
addContentView(surface, new ActionBar.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT));
renderer = new Renderer(this);
surface.setSurfaceRenderer(renderer);
}
@Override
public boolean onTouch(View v, MotionEvent event){
switch (event.getAction()){
case MotionEvent.ACTION_DOWN:
renderer.getObjectAt(event.getX(), event.getY(),event);
Log.d("onTouched","ACTION_DOWN");
break;
case MotionEvent.ACTION_MOVE:
renderer.getObjectAt(event.getX(),event.getY(),event);
Log.d("onTouched", "ACTION_MOVE");
break;
default:break;
}
return true;
// return super.onTouchEvent(event);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
| [
"norisuna1201@gmail.com"
] | norisuna1201@gmail.com |
404c3718fd3b088110f7fcf5568d8207e45b3980 | d9ff1a7807b9c08d45f62f442d7388623a656f95 | /target/tomcat/work/Tomcat/localhost/SpringWeb/org/apache/jsp/type_jsp.java | 2e6eab789cce881f8c4be48fedeafda7fb69f106 | [] | no_license | haolutong199725/java11_neuedu | 3a4a12f8ed24703006e0c1fdb40ad37decf09b0a | d9894963431a16f3bc9ce10af0cae7b47d9c7c05 | refs/heads/master | 2020-03-07T09:07:17.381069 | 2018-03-30T08:22:55 | 2018-03-30T08:22:55 | 127,398,922 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,530 | java | /*
* Generated by the Jasper component of Apache Tomcat
* Version: Apache Tomcat/7.0.47
* Generated at: 2018-03-30 07:23:12 UTC
* Note: The last modified time of this file was set to
* the last modified time of the source file after
* generation to assist with modification tracking.
*/
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class type_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final javax.servlet.jsp.JspFactory _jspxFactory =
javax.servlet.jsp.JspFactory.getDefaultFactory();
private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005fforEach_0026_005fvar_005fitems;
private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.tomcat.InstanceManager _jsp_instancemanager;
public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
return _jspx_dependants;
}
public void _jspInit() {
_005fjspx_005ftagPool_005fc_005fforEach_0026_005fvar_005fitems = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
_jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
}
public void _jspDestroy() {
_005fjspx_005ftagPool_005fc_005fforEach_0026_005fvar_005fitems.release();
}
public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response)
throws java.io.IOException, javax.servlet.ServletException {
final javax.servlet.jsp.PageContext pageContext;
javax.servlet.http.HttpSession session = null;
final javax.servlet.ServletContext application;
final javax.servlet.ServletConfig config;
javax.servlet.jsp.JspWriter out = null;
final java.lang.Object page = this;
javax.servlet.jsp.JspWriter _jspx_out = null;
javax.servlet.jsp.PageContext _jspx_page_context = null;
try {
response.setContentType("text/html; charset=UTF-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
out.write("\r\n");
out.write("<!DOCTYPE HTML>\r\n");
out.write("<html>\r\n");
out.write("<head>\r\n");
out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\r\n");
out.write("<title>Insert title here</title>\r\n");
out.write("<link href=\"https://cdn.bootcss.com/bootstrap/3.0.1/css/bootstrap.min.css\" rel=\"stylesheet\">\r\n");
out.write("</head>\r\n");
out.write("<body>\r\n");
out.write(" <div class=\"container\">\r\n");
out.write("\t<div class=\"row clearfix\">\r\n");
out.write("\t\t<div class=\"col-md-12 column\">\r\n");
out.write("\t\t\t<table class=\"table\">\r\n");
out.write("\t\t\t\t<thead>\r\n");
out.write("\t\t\t\t\t<tr>\r\n");
out.write("\t\t <th>ID</th>\r\n");
out.write("\t\t <th>父类ID</th>\r\n");
out.write("\t\t\t<th>类型</th>\r\n");
out.write("\t\t\t<th>状态</th>\r\n");
out.write("\t\t\t\t\t</tr>\r\n");
out.write("\t\t\t\t</thead>\r\n");
out.write("\t\t\t\t<tbody>\r\n");
out.write("\t\t\t\t\t");
if (_jspx_meth_c_005fforEach_005f0(_jspx_page_context))
return;
out.write("\r\n");
out.write("\t\t\t\t</tbody>\r\n");
out.write("\t\t\t</table>\r\n");
out.write("\t\t</div>\r\n");
out.write("\t</div>\r\n");
out.write("</div>\r\n");
out.write("</body>\r\n");
out.write("</html>");
} catch (java.lang.Throwable t) {
if (!(t instanceof javax.servlet.jsp.SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try { out.clearBuffer(); } catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
else throw new ServletException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
private boolean _jspx_meth_c_005fforEach_005f0(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:forEach
org.apache.taglibs.standard.tag.rt.core.ForEachTag _jspx_th_c_005fforEach_005f0 = (org.apache.taglibs.standard.tag.rt.core.ForEachTag) _005fjspx_005ftagPool_005fc_005fforEach_0026_005fvar_005fitems.get(org.apache.taglibs.standard.tag.rt.core.ForEachTag.class);
_jspx_th_c_005fforEach_005f0.setPageContext(_jspx_page_context);
_jspx_th_c_005fforEach_005f0.setParent(null);
// /type.jsp(25,5) name = items type = javax.el.ValueExpression reqTime = true required = false fragment = false deferredValue = true expectedTypeName = java.lang.Object deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f0.setItems(new org.apache.jasper.el.JspValueExpression("/type.jsp(25,5) '${type}'",_el_expressionfactory.createValueExpression(_jspx_page_context.getELContext(),"${type}",java.lang.Object.class)).getValue(_jspx_page_context.getELContext()));
// /type.jsp(25,5) name = var type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f0.setVar("address");
int[] _jspx_push_body_count_c_005fforEach_005f0 = new int[] { 0 };
try {
int _jspx_eval_c_005fforEach_005f0 = _jspx_th_c_005fforEach_005f0.doStartTag();
if (_jspx_eval_c_005fforEach_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\r\n");
out.write("\r\n");
out.write("\t\t\t<tr>\r\n");
out.write("\t\t\t\t<td>");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${address.id}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
out.write("</td>\r\n");
out.write("\t\t\t\t<td>");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${address.parent_id}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
out.write("</td>\t\t\r\n");
out.write("\t\t\t\t<td>");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${address.type}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
out.write("</td>\t\r\n");
out.write("\t\t\t\t<td>");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${address.statu}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
out.write("</td>\t\t\t\t\t\t\r\n");
out.write("\t\t\t\t<td><a href=\"#\">删除</a> <a\r\n");
out.write("\t\t\t\t\thref=\"#\">修改</a></td>\r\n");
out.write("\t\t\t</tr>\r\n");
out.write("\r\n");
out.write("\t\t");
int evalDoAfterBody = _jspx_th_c_005fforEach_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
}
if (_jspx_th_c_005fforEach_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
return true;
}
} catch (java.lang.Throwable _jspx_exception) {
while (_jspx_push_body_count_c_005fforEach_005f0[0]-- > 0)
out = _jspx_page_context.popBody();
_jspx_th_c_005fforEach_005f0.doCatch(_jspx_exception);
} finally {
_jspx_th_c_005fforEach_005f0.doFinally();
_005fjspx_005ftagPool_005fc_005fforEach_0026_005fvar_005fitems.reuse(_jspx_th_c_005fforEach_005f0);
}
return false;
}
}
| [
"2427545193@qq.com"
] | 2427545193@qq.com |
613c410c077ad104153e009c39ba9d16f05134f3 | 61993825803bb1de54ba2a752d4c7a83ccfe134f | /build/project/src/main/java/com/andwari/util/ResourceBundleKeys.java | ea7811f20714acf28aa141da233069df64e7b521 | [] | no_license | AndwariAciel/TournamentManagerOld | 65b84d95c7c89bfe51e1d4f527882b17bb6100ce | c2182d72dc0ff33dcab80578c626723a98a3b464 | refs/heads/master | 2020-09-26T21:11:23.882469 | 2019-11-05T16:27:42 | 2019-11-05T16:27:42 | 226,344,402 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 265 | java | package com.andwari.util;
public enum ResourceBundleKeys {
EVENT("event");
private String key;
ResourceBundleKeys(String key) {
this.key = key;
}
public String getKey() {
return key;
}
@Override
public String toString() {
return key;
}
}
| [
"andwariaciel@gmail.com"
] | andwariaciel@gmail.com |
088c1598ca72c8121ba9ae7f5142ce733f7ac6ff | 8ee42a114608a9f8479eaa0e1cba5579fe9c2e73 | /src/main/generated-java/com/keba/demo/web/domain/support/GenericEnumController.java | 0bd02e00fec5c6801d39b5cd2402f460ffc61f08 | [] | no_license | alexp82/myproject | 6414387b33da2b51fe65a00cf9111b3154e09625 | 827e11879f5fdaf9f2841d059ae44c9d4cb30f19 | refs/heads/master | 2016-09-03T06:41:59.139841 | 2014-07-15T14:39:05 | 2014-07-15T14:39:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,130 | java | /*
* (c) Copyright 2005-2014 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/GenericEnumController.p.vm.java
*/
package com.keba.demo.web.domain.support;
import static com.google.common.collect.Lists.newArrayList;
import static org.apache.commons.lang.StringUtils.containsIgnoreCase;
import java.util.List;
import com.keba.demo.domain.LabelizedEnum;
public abstract class GenericEnumController<T extends Enum<? extends Enum<?>> & LabelizedEnum> {
private final T[] values;
public GenericEnumController(T[] values) {
this.values = values;
}
public List<T> complete(String text) {
List<T> ret = newArrayList();
for (T value : values) {
if (containsIgnoreCase(value.name(), text) || containsIgnoreCase(value.getLabel(), text)) {
ret.add(value);
}
}
return ret;
}
} | [
"alexandru.pave.82@gmail.com"
] | alexandru.pave.82@gmail.com |
0896377e6d7e8a578ad43f918467e0d20679c1f8 | b4fcdaf36cba7926ef5ab0385f555c8b8a1aeaf9 | /algorithmsandme/src/main/java/algorithmsandme/FindIncreasingStopPointInArray.java | ffa09d82878e9a4d68bc68a36152026f2c2950af | [] | no_license | webNinja24/algorithmics | 21d0e37e7f04ea1a3a1e9c304306472c6385ad61 | 9d2b5b7ee7ff87a7e0b0f081aec70319587a199f | refs/heads/master | 2021-06-09T18:40:35.685223 | 2016-11-27T23:34:56 | 2016-11-27T23:34:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,211 | java | package algorithmsandme;
import org.junit.Test;
/**
* A array is increasing and then decreasing find the point where it stops increasing
*/
public class FindIncreasingStopPointInArray {
public int findIncreasingStopIndex(int[] a) {
for (int i = 1; i < a.length; i++) {
if (a[i] < a[i - 1]) return i - 1;
}
return -1;
}
public int findIncreasingStopIndexDivideAndConquer(int[] a, int start, int end) {
if (start == end) return -1;
if (start + 1 == end) {
if (a[start] > a[end]) return start;
else return -1;
}
int mid = (start + end) / 2;
if (a[mid - 1] < a[mid]) {
return findIncreasingStopIndexDivideAndConquer(a, mid, end);
} else {
return findIncreasingStopIndexDivideAndConquer(a, start, mid);
}
}
@Test
public void testAccuracy() {
int[] a = new int[]{1, 2, 3, 4, 5, 4, 3, 2, 1};
int index = findIncreasingStopIndex(a);
System.out.println(index + " - " + a[index]);
index = findIncreasingStopIndexDivideAndConquer(a, 0, a.length - 1);
System.out.println(index + " - " + a[index]);
}
}
| [
"mariusneo@gmail.com"
] | mariusneo@gmail.com |
4c23c29bce0b134ebee7ec8cc26d58d659f87954 | c9e96a38580c6f5acf9ec2e5f94adf5aa8d7adce | /src/main/java/chapter15/Solid2.java | cc1b103afe67ecbdc32adc248171f93f95fc0da8 | [] | no_license | hklv/thinkinjava | 5af1b6ee28cdbd12ab1b2aaee41136640e4d7511 | b4c38479ba81e478d025481dc9e68e06e2787132 | refs/heads/master | 2022-11-19T02:57:42.506039 | 2020-03-26T04:34:12 | 2020-03-26T04:34:12 | 73,045,307 | 0 | 0 | null | 2022-11-16T05:00:02 | 2016-11-07T05:31:16 | Java | UTF-8 | Java | false | false | 312 | java | package chapter15;
/**
* @author LvHuiKang mailTo lv.huikang@zte.com.cn.
* @Date 2016/11/26 17:47.
*/
public class Solid2<T extends Dimension & HasColor & Weight> extends ColoredDimension<T> {
public Solid2(T item) {
super(item);
}
int weight() {
return item.weight();
}
}
| [
"lv.huikang@zte.com.cn"
] | lv.huikang@zte.com.cn |
a0efb23c1f86924e4a253ad9adcde2758b6780f3 | 2ec7d0dcaf91073a957c25a3786157f1c90d7e56 | /JavaSE/imooc_IO/src/com/imooc/io/DosDemo.java | f76b566bed80efcc6a2bba341c1d114eebd93764 | [] | no_license | winxblast/myJavaLearn | 8eef13b404f072dbc5b6497fe34e3294b1eae18f | 04a178fe0924e1162052177bf8a0db1b82f99336 | refs/heads/master | 2021-01-23T16:17:51.222350 | 2017-09-09T02:26:47 | 2017-09-09T02:26:47 | 93,256,878 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 604 | java | package com.imooc.io;
import java.io.DataOutputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
public class DosDemo {
public static void main(String[] args) throws IOException {
String file = "demo/dos.dat";
DataOutputStream dos = new DataOutputStream(new FileOutputStream(file));
dos.writeInt(10);
dos.writeInt(-10);
dos.writeLong(10l);
dos.writeDouble(10.5);
//采用UTF-8编码写出
dos.writeUTF("中国");
//采用UTF-16be编码写出
dos.writeChars("中国");
dos.close();
IOUtil.printHex(file);
}
}
| [
"winxblast@163.com"
] | winxblast@163.com |
2eb39e214ca807289782c2d2bde1a38882e7ee41 | 81d1ec9485eb93a3aa24db839ccba1e6dc4f0788 | /src/main/java/com/mycompany/hibernate/simple/persist/Ranking.java | dc9103a96e8b313d9bf65ada8c5fa127d19a69cd | [] | no_license | Ivan-Masli-GDP/hibernate-tuts | 9da1dfda08691f2c54140f62c5332a531074bbdc | c41382e6ac37b631b5a57cd4c88792bb76515149 | refs/heads/master | 2016-09-08T00:30:56.202756 | 2015-03-18T10:12:28 | 2015-03-18T10:12:28 | 32,402,010 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,576 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.mycompany.hibernate.simple.persist;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
/**
*
* @author ivan.masli
*/
@Entity
public class Ranking {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@ManyToOne
private Person subject;
@ManyToOne
private Person observer;
@ManyToOne
private Skill skill;
@Column
private Integer ranking;
public Ranking() {
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Person getSubject() {
return subject;
}
public void setSubject(Person subject) {
this.subject = subject;
}
public Person getObserver() {
return observer;
}
public void setObserver(Person observer) {
this.observer = observer;
}
public Skill getSkill() {
return skill;
}
public void setSkill(Skill skill) {
this.skill = skill;
}
public Integer getRanking() {
return ranking;
}
public void setRanking(Integer ranking) {
this.ranking = ranking;
}
}
| [
"ivan.masli@GDP-LTP-337"
] | ivan.masli@GDP-LTP-337 |
054d594d0dc8d8e1d5d06f51918b09aeb2dfacd9 | 0584073a918f1fe6c8df26797fdc363e2f7f93d1 | /joinarrays.java | c88b4ca95f04fb2cdfe2e97699491f16c65fb980 | [] | no_license | Sai-Durga-purella/16-07-2021-pgm-1-join-arrays | 225534b1f033f85ecde807f5ac2e2cd470d8b961 | d6bb16042d771d14b00251c1b7d208a9fb5f7164 | refs/heads/main | 2023-06-17T19:05:31.374380 | 2021-07-16T07:59:06 | 2021-07-16T07:59:06 | 386,556,767 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 736 | java | import java.util.*;
public class solution
{
public static void main(String args[])
{
ArrayList<Integer>a1=new ArrayList<Integer>();
a1.add(10);
a1.add(20);
a1.add(30);
a1.add(40);
System.out.println("List a1" +a1);
ArrayList<Integer>a2=new ArrayList<Integer>();
a2.add(100);
a2.add(200);
a2.add(300);
a2.add(400);
System.out.println("List a2" +a2);
ArrayList<Integer>a3=new ArrayList<Integer>();
a3.addAll(a1);
a3.addAll(a2);
System.out.println(a3);
}
}
.......................................
output: List a1[10,20,320,40]
List a2[100, 200, 300, 400]
[10, 20, 30, 40, 100, 200, 300, 400]
| [
"noreply@github.com"
] | noreply@github.com |
d8bc14f9b6a96e31fb788ccbdd288ce81e0e66f6 | b3d89119afec24cef96f047dfb903532beeb602f | /src/main/java/com/mycompany/task/domain/User.java | 59759a0ce03af97ede25156c5956fbc83ebb0f70 | [] | no_license | jlabeaga/task-jh-jwt | 7a6f173b6274602a6daeb57d68167122e02024ef | 0ff46bbef424da0541b95554716fe1f5f1eec80c | refs/heads/master | 2022-12-04T20:17:01.820049 | 2020-08-06T09:18:07 | 2020-08-06T09:18:07 | 285,384,108 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,612 | java | package com.mycompany.task.domain;
import com.mycompany.task.config.Constants;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.annotations.BatchSize;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import javax.persistence.*;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.Instant;
import java.util.HashSet;
import java.util.Locale;
import java.util.Set;
/**
* A user.
*/
@Entity
@Table(name = "jhi_user")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class User extends AbstractAuditingEntity implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
private Long id;
@NotNull
@Pattern(regexp = Constants.LOGIN_REGEX)
@Size(min = 1, max = 50)
@Column(length = 50, unique = true, nullable = false)
private String login;
@JsonIgnore
@NotNull
@Size(min = 60, max = 60)
@Column(name = "password_hash", length = 60, nullable = false)
private String password;
@Size(max = 50)
@Column(name = "first_name", length = 50)
private String firstName;
@Size(max = 50)
@Column(name = "last_name", length = 50)
private String lastName;
@Email
@Size(min = 5, max = 254)
@Column(length = 254, unique = true)
private String email;
@NotNull
@Column(nullable = false)
private boolean activated = false;
@Size(min = 2, max = 10)
@Column(name = "lang_key", length = 10)
private String langKey;
@Size(max = 256)
@Column(name = "image_url", length = 256)
private String imageUrl;
@Size(max = 20)
@Column(name = "activation_key", length = 20)
@JsonIgnore
private String activationKey;
@Size(max = 20)
@Column(name = "reset_key", length = 20)
@JsonIgnore
private String resetKey;
@Column(name = "reset_date")
private Instant resetDate = null;
@JsonIgnore
@ManyToMany
@JoinTable(
name = "jhi_user_authority",
joinColumns = {@JoinColumn(name = "user_id", referencedColumnName = "id")},
inverseJoinColumns = {@JoinColumn(name = "authority_name", referencedColumnName = "name")})
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@BatchSize(size = 20)
private Set<Authority> authorities = new HashSet<>();
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getLogin() {
return login;
}
// Lowercase the login before saving it in database
public void setLogin(String login) {
this.login = StringUtils.lowerCase(login, Locale.ENGLISH);
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
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;
}
public String getImageUrl() {
return imageUrl;
}
public void setImageUrl(String imageUrl) {
this.imageUrl = imageUrl;
}
public boolean getActivated() {
return activated;
}
public void setActivated(boolean activated) {
this.activated = activated;
}
public String getActivationKey() {
return activationKey;
}
public void setActivationKey(String activationKey) {
this.activationKey = activationKey;
}
public String getResetKey() {
return resetKey;
}
public void setResetKey(String resetKey) {
this.resetKey = resetKey;
}
public Instant getResetDate() {
return resetDate;
}
public void setResetDate(Instant resetDate) {
this.resetDate = resetDate;
}
public String getLangKey() {
return langKey;
}
public void setLangKey(String langKey) {
this.langKey = langKey;
}
public Set<Authority> getAuthorities() {
return authorities;
}
public void setAuthorities(Set<Authority> authorities) {
this.authorities = authorities;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof User)) {
return false;
}
return id != null && id.equals(((User) o).id);
}
@Override
public int hashCode() {
return 31;
}
// prettier-ignore
@Override
public String toString() {
return "User{" +
"login='" + login + '\'' +
", firstName='" + firstName + '\'' +
", lastName='" + lastName + '\'' +
", email='" + email + '\'' +
", imageUrl='" + imageUrl + '\'' +
", activated='" + activated + '\'' +
", langKey='" + langKey + '\'' +
", activationKey='" + activationKey + '\'' +
"}";
}
}
| [
"jlabeaga@hotmail.com"
] | jlabeaga@hotmail.com |
a8b27ab66d6dbfb97209cc80721f25c02e4ca2c1 | 0dab916442fdec48986cfffbebc54e7f2b687b23 | /app/src/main/java/com/otitan/dclz/util/TimeUtil.java | 9dc7d18c713d5120e47ec390d9bd69224ed95f08 | [] | no_license | joker91083/DCLZ | 20620fde47d5b9808d435152aa2d63c7d220a360 | 16b462345494bde6a063ced96928716f5c3593cc | refs/heads/master | 2023-03-03T07:05:57.029657 | 2019-03-07T05:54:30 | 2019-03-07T05:54:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,572 | java | package com.otitan.dclz.util;
import java.net.URL;
import java.net.URLConnection;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
/**
* Created by sp on 2018/10/16.
* 时间转换工具
*/
public class TimeUtil {
private static final String WEBURL_BAIDU = "http://www.beijing-time.org";
private static TimeUtil instence = null;
public synchronized static TimeUtil getInstence() {
if (instence == null) {
instence = new TimeUtil();
}
return instence;
}
/**
* 获取网络上的时间
*/
public static String getTime() {
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss", Locale.CHINA);
return getConnect(sdf);
}
/**
* 获取中央时区时间,北京时间是在东八区,所以北京时间= 格林时间+8小时
*/
public static String getGMT() {
Calendar cd = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("EEE d MMM yyyy HH:mm:ss 'GMT'", Locale.CHINA);
sdf.setTimeZone(TimeZone.getTimeZone("GMT")); // 设置时区为GMT
String str = sdf.format(cd.getTime());
return str;
}
/**
* 将毫秒数转为小时数据
*/
public static double getMisToHours(long mis) {
return (mis % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60);
}
/**
* 将毫秒数转为天数
*/
public static double getMisToDays(long mis) {
return (mis / (1000 * 60 * 60 * 24));
}
//毫秒转秒
public static String long2String(long time) {
//毫秒转秒
int sec = (int) time / 1000;
int min = sec / 60; // 分钟
sec = sec % 60; // 秒
if (min < 10) { // 分钟补0
if (sec < 10) { // 秒补0
return "0" + min + ":0" + sec;
} else {
return "0" + min + ":" + sec;
}
} else {
if (sec < 10) { // 秒补0
return min + ":0" + sec;
} else {
return min + ":" + sec;
}
}
}
/**
* 返回当前时间
* 时间格式: yyyy-MM-dd HH:mm:ss
*/
public static String getCurrentTime() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd", Locale.CHINA);
return getConnect(sdf);
}
/**
* 将时间转化成毫秒
* 时间格式: yyyy-MM-dd HH:mm:ss
*/
public static long getLonfromStr(String time) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return timeStrToSecond(time, format);
}
/**
* 将时间转化成毫秒
* 时间格式: yyyy-MM-dd HH:mm
*/
public static long getLonfromNyrsf(String time) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
return timeStrToSecond(time, format);
}
/**
* 将时间转化成毫秒
* 时间格式: yyyy-MM-dd
*/
public static long getLonfromYyr(String time) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
return timeStrToSecond(time, format);
}
/**
* 将时间转化成毫秒
* 时间格式: HH:mm:ss
*/
public static long getLonfromSfm(String time) {
SimpleDateFormat format = new SimpleDateFormat("HH:mm");
return timeStrToSecond(time, format);
}
/**
* 将不同格式时间转化成毫秒
* 时间格式: SimpleDateFormat sdf
*/
private static Long timeStrToSecond(String time, SimpleDateFormat sdf) {
if (time.equals("")) {
return -0l;
}
try {
Long second = sdf.parse(time).getTime();
return second;
} catch (Exception e) {
e.printStackTrace();
}
return -0l;
}
private static String getConnect(final SimpleDateFormat sdf) {
try {
URL url = new URL(WEBURL_BAIDU); // 取得资源对象
URLConnection uc = url.openConnection(); // 生成连接对象
uc.connect(); // 发出连接
long ld = uc.getDate(); // 取得网站日期时间
Date date = new Date(ld); // 转换为标准时间对象
// SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss",Locale.CHINA);
String nowtime = sdf.format(date);
return nowtime;
} catch (Exception e) {
return sdf.format(new Date());
}
}
}
| [
"2517178889@qq.com"
] | 2517178889@qq.com |
d2c1f442aad0ff24fab0b7e21e5596aad43ce044 | 2a35580cd7c44885e4de8756d99063e841a79d76 | /Numbers/Rand7From5.java | 0d23f231a47fdd8650e2c0362d03f3ed46e47048 | [] | no_license | npipaliya10/CodeSnippets | ae22cb7a2632bf30bbcda15060dc383230efe344 | f1fa01a3b1063ef352724d808f1d25f95ab5f10c | refs/heads/master | 2023-03-18T04:51:19.049706 | 2018-06-03T02:36:05 | 2018-06-03T02:36:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 520 | java |
/**
Given a number that generates rand5(): numbers in the range 1 to 5.
Write a method that implements rand7().
**/
public static int rand7()
{
// intiailize a 2 dimensional vector that has equal number of non-zero elements that are divisible by 7.
int[] [] vals= {{1,2,3,4,5},
{6,7,1,2,3},
{4,5,6,7,1},
{2,3,4,5,6}
{7,0,0,0,0}};
int i,j;
int result =0;
while (result ==0)
{
int i=rand5();
int j= rand5();
result=vals[i][j];// randomly selected value in the range 1-7.
}
return result;
}
| [
"Vivek_Veeramani@intuit.com"
] | Vivek_Veeramani@intuit.com |
d78b041e75f02aafdeacc3f5fec0d5a67a33e743 | 507bff6330eabd8942850568634e1a8fbf08e20a | /Java_013_method/src/com/callor/method/Method_04.java | bcf89d43ccca69efe76cf0a5bc5492244b97c754 | [] | no_license | inqu0302/Biz_403_2021_03_Java | a6f6e805bfa18529c471ec4076260004fa3884f3 | 187100cf2a9e0623516784cc21f0496b0199ee50 | refs/heads/master | 2023-04-18T06:13:45.672749 | 2021-04-26T07:40:56 | 2021-04-26T07:40:56 | 348,223,471 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,054 | java | package com.callor.method;
import java.util.Scanner;
public class Method_04 {
public static void main(String[] args) {
/*
* 입력을 받는데 정수 0 ~ 100 또는 문자열 QUIT
* 다른 type의 데이터를 동시에 취급하기 위해서는
* 기본 type을 String 형으로 설정 하는것이 편하다
*/
Scanner scan = new Scanner(System.in);
System.out.println("0 ~ 100 까지 중 정수입력");
System.out.println("QUIT 입력하면 종료");
System.out.println(">> ");
// 모든입력을 문자열type으로 하라
// 입력받은 문자열을 strNum에 저장하라.
String strNum = scan.nextLine();
if(strNum.equals("QUIT")) {
System.out.println("종료합니다.");
} else {
//QUIT가 아닌 다른 값이 입력됬으면 일단 입력된 값을 정수형으로 변환해 보자
//변환된 정수값을 변수에 저장
int intNum1 = Integer.valueOf(strNum);
Integer intNum2 = Integer.valueOf(strNum);
System.out.println("입력된 정수 : " + intNum2);
}
}
}
| [
"inqu0302@naver.com"
] | inqu0302@naver.com |
991b7da9973734063e9549f8209418bb0fede0ad | 16401e7a46ecbd90e05d9ba95f5b7eb2f15e8b0e | /src/main/java/com/fly/modules/sys/service/impl/SysUserRoleServiceImpl.java | df0fe82cc978ad221b98d21d17c50e107042b35c | [] | no_license | Heart998/flt-fast | 0095ab6924b6ec2256defcbd649b33253b4472f5 | c3cdd88b537f97682fafbbca1f77e390aace87c3 | refs/heads/master | 2023-02-04T20:41:43.406909 | 2020-12-22T15:14:09 | 2020-12-22T15:14:09 | 323,653,188 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,448 | java | /**
* Copyright (c) 2016-2019 人人开源 All rights reserved.
*
* https://www.renren.io
*
* 版权所有,侵权必究!
*/
package com.fly.modules.sys.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fly.common.utils.MapUtils;
import com.fly.modules.sys.dao.SysUserRoleDao;
import com.fly.modules.sys.entity.SysUserRoleEntity;
import com.fly.modules.sys.service.SysUserRoleService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 用户与角色对应关系
*
* @author Mark sunlightcs@gmail.com
*/
@Service("sysUserRoleService")
public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleDao, SysUserRoleEntity> implements SysUserRoleService {
@Override
public void saveOrUpdate(Long userId, List<Long> roleIdList) {
//先删除用户与角色关系
this.removeByMap(new MapUtils().put("user_id", userId));
if(roleIdList == null || roleIdList.size() == 0){
return ;
}
//保存用户与角色关系
for(Long roleId : roleIdList){
SysUserRoleEntity sysUserRoleEntity = new SysUserRoleEntity();
sysUserRoleEntity.setUserId(userId);
sysUserRoleEntity.setRoleId(roleId);
this.save(sysUserRoleEntity);
}
}
@Override
public List<Long> queryRoleIdList(Long userId) {
return baseMapper.queryRoleIdList(userId);
}
@Override
public int deleteBatch(Long[] roleIds){
return baseMapper.deleteBatch(roleIds);
}
}
| [
"1793566207@qq.com"
] | 1793566207@qq.com |
8a86fac15a58ff6aa55e3ecf2b148dad18f9f792 | bda3d596f1e776e2866079061060f42fcd1ce00f | /src/main/java/spring_mvc_and_hiber/config/WebConfig.java | e07b3e4b04cddc29f6f0d62e905ccc5eb20d9ba5 | [] | no_license | javapushka/SpringMvcAndHibernate | 6ebe48c9fdc1e1a4448fab62d89a4e17ac21c18e | b2e9e60dd0ef79953b16da50d6f823ceace1a7f6 | refs/heads/master | 2023-08-25T10:17:57.930627 | 2021-10-16T13:55:44 | 2021-10-16T13:55:44 | 417,254,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,989 | java | package spring_mvc_and_hiber.config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ViewResolverRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.thymeleaf.spring5.SpringTemplateEngine;
import org.thymeleaf.spring5.templateresolver.SpringResourceTemplateResolver;
import org.thymeleaf.spring5.view.ThymeleafViewResolver;
@Configuration
@EnableWebMvc
@ComponentScan("spring_mvc_and_hiber")
public class WebConfig implements WebMvcConfigurer {
private final ApplicationContext applicationContext;
@Autowired
public WebConfig(ApplicationContext applicationContext) {
this.applicationContext = applicationContext;
}
@Bean
public SpringResourceTemplateResolver templateResolver() {
SpringResourceTemplateResolver templateResolver = new SpringResourceTemplateResolver();
templateResolver.setApplicationContext(applicationContext);
templateResolver.setPrefix("/WEB-INF/pages/");
templateResolver.setSuffix(".html");
return templateResolver;
}
@Bean
public SpringTemplateEngine templateEngine() {
SpringTemplateEngine templateEngine = new SpringTemplateEngine();
templateEngine.setTemplateResolver(templateResolver());
templateEngine.setEnableSpringELCompiler(true);
return templateEngine;
}
@Override
public void configureViewResolvers(ViewResolverRegistry registry) {
ThymeleafViewResolver resolver = new ThymeleafViewResolver();
resolver.setTemplateEngine(templateEngine());
registry.viewResolver(resolver);
}
}
| [
"87712859+javapushka@users.noreply.github.com"
] | 87712859+javapushka@users.noreply.github.com |
c976be1bdf1a8293ea59bd72cc727fafa412b4ae | e38081fb72338c207aa7c2ea8d40953822d0ed06 | /app/src/main/java/sse/bupt/cn/translator/adapter/EnglishTextAdapter.java | dd8ee3a030b59e191ed864565ce879b4c16a2a73 | [] | no_license | leeshun/translator | 228a8b956b78efc4f2e9251060447e1fafeb3d22 | 77282920d24fd9514d1c7355031c776cbf77e3e7 | refs/heads/master | 2020-03-11T07:50:35.113609 | 2018-05-20T08:51:49 | 2018-05-20T08:51:49 | 129,864,974 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,690 | java | package sse.bupt.cn.translator.adapter;
import android.content.Context;
import android.net.Uri;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.facebook.drawee.backends.pipeline.Fresco;
import com.facebook.drawee.view.SimpleDraweeView;
import java.util.List;
import sse.bupt.cn.translator.R;
import sse.bupt.cn.translator.constants.UrlConstant;
import sse.bupt.cn.translator.model.Text;
public class EnglishTextAdapter extends BaseAdapter {
private static final String TAG = "TextAdapter";
private List<Text> texts;
private LayoutInflater inflater;
public EnglishTextAdapter(List<Text> texts, Context context) {
this.texts = texts;
if (!Fresco.hasBeenInitialized()) {
Fresco.initialize(context);
}
inflater = LayoutInflater.from(context);
}
@Override
public int getCount() {
return texts.size();
}
@Override
public Object getItem(int position) {
return texts.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
EnglishTextHolder holder;
if (convertView == null) {
holder = new EnglishTextHolder();
convertView = inflater.inflate(R.layout.text_item, parent, false);
holder.imageView = convertView.findViewById(R.id.text_image_view);
holder.textView = convertView.findViewById(R.id.text_text_view);
convertView.setTag(holder);
} else {
holder = (EnglishTextHolder) convertView.getTag();
}
holder.textView.setTextSize(18);
holder.textView.setText(Text.makePara(texts.get(position).getParaId(), texts.get(position).getEnglishText()));
if (texts.get(position).isOnlyText()) {
holder.imageView.setVisibility(View.GONE);
holder.imageView.setAspectRatio(1.3f);
} else {
Uri uri = Uri.parse(UrlConstant.GETIMAGE + "/" + texts.get(position).getPictureUrl());
Log.i(TAG, "---english text adapter,the picture url is " + texts.get(position).getPictureUrl());
holder.imageView.setVisibility(View.VISIBLE);
holder.imageView.setImageURI(uri);
//holder.imageView.setController(FrescoUtil.getController(holder.imageView,uri));
}
return convertView;
}
private class EnglishTextHolder {
SimpleDraweeView imageView;
TextView textView;
}
}
| [
"leeshun1230@gmail.com"
] | leeshun1230@gmail.com |
7f64caf2a8587bd1554d98869f7206f49dd62fa3 | 5e2c86f515584f161f69966f387245e8b3320138 | /fromMM-NEAT/src/edu/southwestern/util/PythonUtil.java | 773ce2d200a8761bf1da1bce7f86624e5546ec67 | [
"MIT"
] | permissive | cappsb/TOAD-GAN | c34a4fcddbe294c814f1bda15362cc2bbc294619 | 9a4e89ec9189aa9191adc2074b1dbfdba454a31a | refs/heads/master | 2023-04-13T02:57:02.794128 | 2021-04-28T18:32:20 | 2021-04-28T18:32:20 | 340,740,321 | 0 | 0 | MIT | 2021-04-17T23:17:26 | 2021-02-20T19:51:28 | Python | UTF-8 | Java | false | false | 894 | java | package edu.southwestern.util;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
/**
* Utility class used for launching Python programs from Java.
*
* @author jacobschrum
*/
public class PythonUtil {
public static String PYTHON_EXECUTABLE = ""; // Overwritten by setting the python executable
/**
* Specify the path to the Python executable that will be used
*/
public static void setPythonProgram() {
try {
PYTHON_EXECUTABLE = Files.readAllLines(Paths.get("my_python_path.txt")).get(0); // Should only have one line, get first
} catch (IOException e) {
System.err.println("Can not find the my_python_path.txt which specifies the python program and should be in the main MM-NEAT directory.");
e.printStackTrace();
System.exit(1);
}
}
}
| [
"63438571+cappsb@users.noreply.github.com"
] | 63438571+cappsb@users.noreply.github.com |
99cdec52d29c4ba4cf19142a68a0f18585e423aa | 70a2a54e5af0d646719f52b6971a1a049bddafb3 | /src/com/hxdq/xedsms/db/model/InstockExample.java | 855483425fb8c10d333d598f9cde4d901ac51fff | [] | no_license | lesterli2010/xedsms | ac91fd2474e59a98dc1cfdbcc887ee62d6b6dbec | 584d0de5c6e0d11d8f10e3452a3a7af4f36bd729 | refs/heads/master | 2020-03-19T04:22:11.611971 | 2018-06-02T13:36:14 | 2018-06-02T13:36:14 | 135,820,393 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,473 | java | package com.hxdq.xedsms.db.model;
import com.hxdq.xedsms.db.Example;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class InstockExample extends Example {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public InstockExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andInIdIsNull() {
addCriterion("in_id is null");
return (Criteria) this;
}
public Criteria andInIdIsNotNull() {
addCriterion("in_id is not null");
return (Criteria) this;
}
public Criteria andInIdEqualTo(Integer value) {
addCriterion("in_id =", value, "inId");
return (Criteria) this;
}
public Criteria andInIdNotEqualTo(Integer value) {
addCriterion("in_id <>", value, "inId");
return (Criteria) this;
}
public Criteria andInIdGreaterThan(Integer value) {
addCriterion("in_id >", value, "inId");
return (Criteria) this;
}
public Criteria andInIdGreaterThanOrEqualTo(Integer value) {
addCriterion("in_id >=", value, "inId");
return (Criteria) this;
}
public Criteria andInIdLessThan(Integer value) {
addCriterion("in_id <", value, "inId");
return (Criteria) this;
}
public Criteria andInIdLessThanOrEqualTo(Integer value) {
addCriterion("in_id <=", value, "inId");
return (Criteria) this;
}
public Criteria andInIdIn(List<Integer> values) {
addCriterion("in_id in", values, "inId");
return (Criteria) this;
}
public Criteria andInIdNotIn(List<Integer> values) {
addCriterion("in_id not in", values, "inId");
return (Criteria) this;
}
public Criteria andInIdBetween(Integer value1, Integer value2) {
addCriterion("in_id between", value1, value2, "inId");
return (Criteria) this;
}
public Criteria andInIdNotBetween(Integer value1, Integer value2) {
addCriterion("in_id not between", value1, value2, "inId");
return (Criteria) this;
}
public Criteria andInTimeIsNull() {
addCriterion("in_time is null");
return (Criteria) this;
}
public Criteria andInTimeIsNotNull() {
addCriterion("in_time is not null");
return (Criteria) this;
}
public Criteria andInTimeEqualTo(Date value) {
addCriterion("in_time =", value, "inTime");
return (Criteria) this;
}
public Criteria andInTimeNotEqualTo(Date value) {
addCriterion("in_time <>", value, "inTime");
return (Criteria) this;
}
public Criteria andInTimeGreaterThan(Date value) {
addCriterion("in_time >", value, "inTime");
return (Criteria) this;
}
public Criteria andInTimeGreaterThanOrEqualTo(Date value) {
addCriterion("in_time >=", value, "inTime");
return (Criteria) this;
}
public Criteria andInTimeLessThan(Date value) {
addCriterion("in_time <", value, "inTime");
return (Criteria) this;
}
public Criteria andInTimeLessThanOrEqualTo(Date value) {
addCriterion("in_time <=", value, "inTime");
return (Criteria) this;
}
public Criteria andInTimeIn(List<Date> values) {
addCriterion("in_time in", values, "inTime");
return (Criteria) this;
}
public Criteria andInTimeNotIn(List<Date> values) {
addCriterion("in_time not in", values, "inTime");
return (Criteria) this;
}
public Criteria andInTimeBetween(Date value1, Date value2) {
addCriterion("in_time between", value1, value2, "inTime");
return (Criteria) this;
}
public Criteria andInTimeNotBetween(Date value1, Date value2) {
addCriterion("in_time not between", value1, value2, "inTime");
return (Criteria) this;
}
public Criteria andOperatorIsNull() {
addCriterion("operator is null");
return (Criteria) this;
}
public Criteria andOperatorIsNotNull() {
addCriterion("operator is not null");
return (Criteria) this;
}
public Criteria andOperatorEqualTo(String value) {
addCriterion("operator =", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotEqualTo(String value) {
addCriterion("operator <>", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThan(String value) {
addCriterion("operator >", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThanOrEqualTo(String value) {
addCriterion("operator >=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThan(String value) {
addCriterion("operator <", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThanOrEqualTo(String value) {
addCriterion("operator <=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLike(String value) {
addCriterion("operator like", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotLike(String value) {
addCriterion("operator not like", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorIn(List<String> values) {
addCriterion("operator in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotIn(List<String> values) {
addCriterion("operator not in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorBetween(String value1, String value2) {
addCriterion("operator between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotBetween(String value1, String value2) {
addCriterion("operator not between", value1, value2, "operator");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
} | [
"lesterli2010@gmail.com"
] | lesterli2010@gmail.com |
dde8dd43f61be01c27645b9b9ceb5d3c20d109a5 | 5f62a328a82bc30585c31be7c14d4526e16b108a | /src/main/java/com/xpinjection/java8/extensions/Permission.java | a7163bffee37940a63c96751782260cad31f8b6c | [] | no_license | xpinjection/java8-extensions | 4499069af785e41efc302d09e3424a88b7d5b1e2 | a514b61b7f2d0ef2d89bbcf0bbf33bf39ee8f5d8 | refs/heads/master | 2021-01-20T10:32:10.852479 | 2017-11-01T08:39:19 | 2017-11-01T08:39:19 | 101,643,171 | 13 | 4 | null | null | null | null | UTF-8 | Java | false | false | 99 | java | package com.xpinjection.java8.extensions;
public enum Permission {
READ, WRITE, EDIT, ADMIN
}
| [
"mikalai.alimenkou@epam.com"
] | mikalai.alimenkou@epam.com |
a9fa13e168be958426795196663ed50184d748a3 | b01fc3bc171a0f5989659c561b3c6b3847a7e90a | /src/base/BaseTest.java | e3ccdbfcc4ea43cefab5c201544a8760c763d48a | [] | no_license | KrishnaSakinala/StanfordUniversity- | 498eb2d8bd0ed58fe9abe8178fe7c9b0ec44a0c5 | 2a71e853da31b78baa3eec3e08d61b703bb8124e | refs/heads/master | 2022-04-30T01:25:34.618797 | 2017-03-23T10:36:02 | 2017-03-23T10:36:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,171 | java | package base;
import java.io.File;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;
import org.apache.commons.io.FileUtils;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.testng.ITestResult;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.AfterSuite;
import org.testng.annotations.BeforeSuite;
import org.testng.annotations.Parameters;
import com.relevantcodes.extentreports.ExtentReports;
import com.relevantcodes.extentreports.ExtentTest;
import com.relevantcodes.extentreports.LogStatus;
import config.ConstantsClass;
public class BaseTest
{
public static WebDriver driver;
public static ExtentReports report;
public static ExtentTest logger;
@BeforeSuite
@Parameters("browser")
public void setUp(String browserName)
{
report=new ExtentReports(System.getProperty("user.dir") +"/test-output/HTMLResultReport.html");
report.addSystemInfo("Host Name", "Automation User");
report.addSystemInfo("Environment", "QA");
report.addSystemInfo("User Name", "Selenium User");
report.loadConfig(new File(System.getProperty("user.dir") + "\\extent-config.xml"));
if(driver==null)
{
if(browserName.equalsIgnoreCase("firefox"))
{
System.setProperty("webdriver.gecko.driver", System.getProperty("user.dir") + "\\drivers\\geckodriver.exe");
driver=new FirefoxDriver();
}
else if(browserName.equalsIgnoreCase("chrome"))
{
System.setProperty("webdriver.chrome.driver", System.getProperty("user.dir") + "\\drivers\\chromedriver.exe");
driver= new ChromeDriver();
}
driver.manage().window().maximize();
driver.get(ConstantsClass.APP_URL);
}
}
@AfterMethod
public void generateReport(ITestResult result) throws Exception
{
if(ITestResult.FAILURE==result.getStatus())
{
String screenPath=captureFailedScreenshot(result.getName());
String image=logger.addScreenCapture(screenPath);
logger.log(LogStatus.FAIL, result.getName(), image);
logger.log(LogStatus.FAIL, result.getThrowable());
}
report.endTest(logger);
}
@AfterSuite
public void reportClose()
{
report.flush();
report.close();
driver.close();
}
public String captureFailedScreenshot(String screenName) throws IOException
{
String currentDateTime= getDateTime();
/*Random rand= new Random();
int number=rand.nextInt(10000);*/
TakesScreenshot ts=(TakesScreenshot)driver;
File srcFile=ts.getScreenshotAs(OutputType.FILE) ;
String destination=System.getProperty("user.dir")+"\\Screenshots\\"+screenName+" "+currentDateTime+".png";
File dest=new File(destination);
FileUtils.copyFile(srcFile, dest);
return destination;
}
public String getDateTime()
{
DateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
Date date = new Date();
String currentDateTime = dateFormat.format(date);
return currentDateTime;
}
}
| [
"kkabap@gmail.com"
] | kkabap@gmail.com |
174766f4de0f674daf9820d9c0c5a8dab7ce489c | 0b86b536e2c48872a1671a285b862145e54d3463 | /app/src/main/java/customclasses/Repayment.java | 479d418a2fae66ff426acd8030c8f03f6c22e213 | [] | no_license | sheryarAli/Safco | e237643cad8bc0b362395eb6d60e74efb2f724d7 | 19ed71f92537664de53dfdcc445d86f6a7c7ad6b | refs/heads/master | 2021-05-08T08:21:18.924162 | 2017-10-16T05:15:26 | 2017-10-16T05:15:26 | 107,079,513 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,235 | java | package customclasses;
import com.google.gson.annotations.SerializedName;
import java.io.Serializable;
/**
* Created by shery on 8/11/2017.
*/
public class Repayment implements Serializable {
/* [LoanID] => 27919
[custFullName] => Faiz Muhammad Qambrani
[EmoloyeeId] =>
[StatoinName] => Tando Adam Branch
[ChequeNumber] => 0
[iOtherFees] => 0.0000
[dRegistrationFees] => 150
[dEmergencyFund] => 50
[dTotalLoanAmount] => 5900.0000
[Approve_amount] => 5000.0000
[dServiceChargesRate] => 18.00*/
public static final String REPAYMENT_TABLE = "Repayment";
public static final String KEY_ID = "id";
public static final String KEY_LOAN_ID = "loanId";
public static final String KEY_EMPLOYEE_ID = "employeeId";
public static final String KEY_CHEQ_NUMBER = "chequeNumber";
public static final String KEY_CUSTOMER_NAME = "customerName";
public static final String KEY_NIC_NUMBER = "NICNumber";
public static final String KEY_STATION_NAME = "stationName";
public static final String KEY_OTHER_FEES = "otherFees";
public static final String KEY_REG_FEES = "registrtaionFees";
public static final String KEY_EMERGENCY_FUND = "emergencyFund";
public static final String KEY_TOTAL_LOAN_AMOUNT = "totalLoanAmount";
public static final String KEY_APP_AMOUNT = "approveAmount";
public static final String KEY_SERVICE_CHARGES_RATE = "serviceChargesRate";
public static final String KEY_REP_START_DATE = "repaymentStartDate";
public static final String KEY_FP_IMAGE_TEMP = "fPImageTemp";
public static final String KEY_CUSTOMER_GROUP_ID = "customerGroupId";
public static final String KEY_TOTAL_PAID = "Totalpaid";
public static final String KEY_LAST_REP_AMOUNT = "LastRepaymentAmount";
public static final String KEY_LAST_REP_DT = "LastRepaymentDateTime";
public static final String KEY_CURRENT_REP_AMOUNT = "CurrentRepaymentAmount";
public static final String KEY_CURRENT_REP_DT = "CurrentRepaymentDateTime";
public static final String KEY_REP_AMOUNT = "RepaymentAmount";
public static final String KEY_REP_DT = "RepaymentDateTime";
public static final String KEY_PENALTY = "Penalty";
public static final String KEY_PROCESSING_FEES = "ProccessingFees";
public static final String KEY_DATA_SYNCUP = "IsSyncedUp";
public static final String createRepaymentTable = "Create Table If Not Exists Repayment (\n" +
" id integer primary key autoincrement,\n" +
" loanId int(11),\n" +
" employeeId int(11),\n" +
" StationId integer,\n" +
" chequeNumber text,\n" +
" customerName text,\n" +
" NICNumber text,\n" +
" stationName text,\n" +
" otherFees text,\n" +
" registrtaionFees text,\n" +
" emergencyFund text,\n" +
" totalLoanAmount text,\n" +
" approveAmount text,\n" +
" serviceChargesRate text,\n" +
" repaymentStartDate text,\n" +
" fPImageTemp text,\n" +
" customerGroupId text,\n" +
" Totalpaid text, " +
" LastRepaymentAmount text, " +
" LastRepaymentDateTime text, " +
" CurrentRepaymentAmount text, " +
" CurrentRepaymentDateTime text, " +
" RepaymentAmount text, " +
" RepaymentDateTime text, " +
" Penalty text, " +
" ProccessingFees text, " +
" IsSyncedUp smallint(6) DEFAULT '0' " +
")";
@SerializedName("LoanId")
private int loanId;
@SerializedName("EmoloyeeId")
private int employeeId;
@SerializedName("ChequeNumber")
private String chequeNumber;
@SerializedName("custFullName")
private String customerName;
@SerializedName("NICNumber")
private String NICNumber;
@SerializedName("StatoinName")
private String stationName;
@SerializedName("iOtherFees")
private String otherFees;
@SerializedName("dRegistrationFees")
private String registrtaionFees;
@SerializedName("dEmergencyFund")
private String emergencyFund;
@SerializedName("dTotalLoanAmount")
private String totalLoanAmount;
@SerializedName("Approve_amount")
private String approveAmount;
@SerializedName("dServiceChargesRate")
private String serviceChargesRate;
@SerializedName("RepaymentStartDate")
private String repaymentStartDate;
@SerializedName("FPImageTemp")
private String fPImageTemp;
@SerializedName("CustomerGroupId")
private String customerGroupId;
@SerializedName("Totalpaid")
private String Totalpaid;
@SerializedName("LastRepaymentAmount")
private String lastRepaymentAmount;
@SerializedName("LastRepaymentDateTime")
private String lastRepaymentDateTime;
@SerializedName("CurrentRepaymentAmount")
private String currentRepaymentAmount;
@SerializedName("CurrentRepaymentDateTime")
private String currentRepaymentDateTime;
@SerializedName("StaionId")
private int stationId;
private int isSyncedUp;
private String RepaymentAmount, RepaymentDateTime, ProccessingFees, Penalty;
public int getLoanId() {
return loanId;
}
public void setLoanId(int loanId) {
this.loanId = loanId;
}
public int getEmployeeId() {
return employeeId;
}
public void setEmployeeId(int employeeId) {
this.employeeId = employeeId;
}
public String getChequeNumber() {
return chequeNumber;
}
public void setChequeNumber(String chequeNumber) {
this.chequeNumber = chequeNumber;
}
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public String getStationName() {
return stationName;
}
public void setStationName(String stationName) {
this.stationName = stationName;
}
public String getOtherFees() {
return otherFees;
}
public void setOtherFees(String otherFees) {
this.otherFees = otherFees;
}
public String getRegistrtaionFees() {
return registrtaionFees;
}
public void setRegistrtaionFees(String registrtaionFees) {
this.registrtaionFees = registrtaionFees;
}
public String getEmergencyFund() {
return emergencyFund;
}
public void setEmergencyFund(String emergencyFund) {
this.emergencyFund = emergencyFund;
}
public String getTotalLoanAmount() {
return totalLoanAmount;
}
public void setTotalLoanAmount(String totalLoanAmount) {
this.totalLoanAmount = totalLoanAmount;
}
public String getApproveAmount() {
return approveAmount;
}
public void setApproveAmount(String approveAmount) {
this.approveAmount = approveAmount;
}
public String getServiceChargesRate() {
return serviceChargesRate;
}
public void setServiceChargesRate(String serviceChargesRate) {
this.serviceChargesRate = serviceChargesRate;
}
public String getRepaymentStartDate() {
return repaymentStartDate;
}
public void setRepaymentStartDate(String repaymentStartDate) {
this.repaymentStartDate = repaymentStartDate;
}
public String getfPImageTemp() {
return fPImageTemp;
}
public void setfPImageTemp(String fPImageTemp) {
this.fPImageTemp = fPImageTemp;
}
public String getCustomerGroupId() {
return customerGroupId;
}
public void setCustomerGroupId(String customerGroupId) {
this.customerGroupId = customerGroupId;
}
public String getTotalpaid() {
return Totalpaid;
}
public void setTotalpaid(String totalpaid) {
Totalpaid = totalpaid;
}
public String getLastRepaymentAmount() {
return lastRepaymentAmount;
}
public void setLastRepaymentAmount(String lastRepaymentAmount) {
this.lastRepaymentAmount = lastRepaymentAmount;
}
public String getLastRepaymentDateTime() {
return lastRepaymentDateTime;
}
public void setLastRepaymentDateTime(String lastRepaymentDateTime) {
this.lastRepaymentDateTime = lastRepaymentDateTime;
}
public String getCurrentRepaymentAmount() {
return currentRepaymentAmount;
}
public void setCurrentRepaymentAmount(String currentRepaymentAmount) {
this.currentRepaymentAmount = currentRepaymentAmount;
}
public String getCurrentRepaymentDateTime() {
return currentRepaymentDateTime;
}
public void setCurrentRepaymentDateTime(String currentRepaymentDateTime) {
this.currentRepaymentDateTime = currentRepaymentDateTime;
}
public String getRepaymentAmount() {
return RepaymentAmount;
}
public void setRepaymentAmount(String repaymentAmount) {
RepaymentAmount = repaymentAmount;
}
public String getRepaymentDateTime() {
return RepaymentDateTime;
}
public void setRepaymentDateTime(String repaymentDateTime) {
RepaymentDateTime = repaymentDateTime;
}
public String getProccessingFees() {
return ProccessingFees;
}
public void setProccessingFees(String proccessingFees) {
ProccessingFees = proccessingFees;
}
public String getPenalty() {
return Penalty;
}
public void setPenalty(String penalty) {
Penalty = penalty;
}
public String getNICNumber() {
return NICNumber;
}
public void setNICNumber(String NICNumber) {
this.NICNumber = NICNumber;
}
public int getStationId() {
return stationId;
}
public void setStationId(int stationId) {
this.stationId = stationId;
}
public int getIsSyncedUp() {
return isSyncedUp;
}
public void setIsSyncedUp(int isSyncedUp) {
this.isSyncedUp = isSyncedUp;
}
}
| [
"sheri.abhati@gmail.com"
] | sheri.abhati@gmail.com |
aeb7ab90d06512df194ebeb11e5ec0aff3136a2f | fbadaeab2f78ede5d91013e77817836f319c56c3 | /src/magic/card/Sphinx_of_Lost_Truths.java | 5dd28ad6087e856ad9e9ff5b06b4394141e29aaa | [] | no_license | neoedmund/neoedmund-magarena | 181b340fc3a25cf8e99ebd21fb4dd05de727708c | abe5f43288b88286a4a539fb0357bac8201b2568 | refs/heads/master | 2016-09-06T05:17:18.761950 | 2012-03-20T12:51:52 | 2012-03-20T12:51:52 | 32,125,604 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,840 | java | package magic.card;
import magic.model.MagicCard;
import magic.model.MagicGame;
import magic.model.MagicManaCost;
import magic.model.MagicPayedCost;
import magic.model.MagicPermanent;
import magic.model.MagicPermanentState;
import magic.model.MagicPlayer;
import magic.model.action.MagicDrawAction;
import magic.model.action.MagicPlayCardFromStackAction;
import magic.model.choice.MagicKickerChoice;
import magic.model.event.MagicDiscardEvent;
import magic.model.event.MagicEvent;
import magic.model.event.MagicSpellCardEvent;
import magic.model.stack.MagicCardOnStack;
import magic.model.trigger.MagicWhenComesIntoPlayTrigger;
public class Sphinx_of_Lost_Truths {
public static final MagicSpellCardEvent E = new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
final MagicPlayer player=cardOnStack.getController();
final MagicCard card=cardOnStack.getCard();
return new MagicEvent(
card,
player,
new MagicKickerChoice(MagicManaCost.ONE_BLUE,false),
new Object[]{cardOnStack,player},
this,
"$Play " + card + ". When " + card +
" enters the battlefield, draw three cards. Then if it wasn't kicked$, discard three cards.");
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object[] data,
final Object[] choiceResults) {
final MagicPlayCardFromStackAction action=new MagicPlayCardFromStackAction((MagicCardOnStack)data[0]);
action.setKicked(((Integer)choiceResults[1])>0);
game.doAction(action);
}
};
public static final MagicWhenComesIntoPlayTrigger T = new MagicWhenComesIntoPlayTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicPlayer player) {
final boolean kicked=permanent.hasState(MagicPermanentState.Kicked);
return new MagicEvent(
permanent,
player,
new Object[]{player,permanent,kicked},
this,
kicked ? player + " draws three cards." :
player + " draws three cards. Then discards three cards.");
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object data[],
final Object[] choiceResults) {
final MagicPlayer player=(MagicPlayer)data[0];
game.doAction(new MagicDrawAction(player,3));
final boolean kicked=(Boolean)data[2];
if (!kicked) {
game.addEvent(new MagicDiscardEvent((MagicPermanent)data[1],player,3,false));
}
}
};
}
| [
"neoedmund@gmail.com"
] | neoedmund@gmail.com |
e5b90523e8b0b57ea684bc40779ead7fa6eb0209 | dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9 | /data_defect4j/preprossed_method_corpus/Lang/53/org/apache/commons/lang/builder/ToStringStyle_appendDetail_1125.java | 9a42e489b434456fe7187152e6ac4a083d3a234f | [] | no_license | hvdthong/NetML | dca6cf4d34c5799b400d718e0a6cd2e0b167297d | 9bb103da21327912e5a29cbf9be9ff4d058731a5 | refs/heads/master | 2021-06-30T15:03:52.618255 | 2020-10-07T01:58:48 | 2020-10-07T01:58:48 | 150,383,588 | 1 | 1 | null | 2018-09-26T07:08:45 | 2018-09-26T07:08:44 | null | UTF-8 | Java | false | false | 3,592 | java |
org apach common lang builder
control code string code format link string builder tostringbuild
main code string builder tostringbuild code
class intend code singleton code
instanti style time program
gener predefin constant
altern link standard string style standardtostringstyl
set individu set style achiev
subclass
requir subclass overrid
method requir object type code code
code code code object code code code
method output version detail summari
detail version arrai base method
output arrai summari method output
arrai length
format output object date
creat subclass overrid method
pre
style mystyl string style tostringstyl
append detail appenddetail string buffer stringbuff buffer string field fieldnam object
date
simpl date format simpledateformat yyyi format
buffer append
pre
author stephen colebourn
author gari gregori
author pete gieser
author masato tezuka
version
string style tostringstyl serializ
append code string tostr code detail
code code arrai
param buffer code string buffer stringbuff code popul
param field fieldnam field typic append
param arrai arrai add code string tostr code
code code
append detail appenddetail string buffer stringbuff buffer string field fieldnam arrai
buffer append arrai start arraystart
arrai length
buffer append arrai separ arraysepar
append detail appenddetail buffer field fieldnam arrai
buffer append arrai end arrayend
| [
"hvdthong@gmail.com"
] | hvdthong@gmail.com |
927225e6968fa89b9fbd177a0499cfe75cb5ac2d | 9cb5117f8ca5ec5c054de23a1a66dfbdb5c22623 | /Cube_srv/src/com/cube/data/count/CountInfoMapper.java | 630ca6d25105056c8d008bda5fd302ce9e78bc72 | [] | no_license | Rynax/cube | 05cf9ba4792cc512946bae837789e5601e1bbe16 | f359bd0cee835148a1899882cad70ef521aa91ab | refs/heads/master | 2021-08-19T07:19:22.348960 | 2017-11-25T05:22:36 | 2017-11-25T05:22:36 | 111,860,711 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 427 | java | package com.cube.data.count;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.springframework.jdbc.core.RowMapper;
public class CountInfoMapper implements RowMapper<CountInfoEntity> {
public CountInfoEntity mapRow(ResultSet rs, int rownum) throws SQLException {
CountInfoEntity card = new CountInfoEntity();
card.set_tid(rs.getInt("tid"));
card.set_tcount(rs.getInt("tcount"));
return card;
}
}
| [
"emilq@163.com"
] | emilq@163.com |
95aa5a633360d57c366255f94d244638b771be74 | 5cdfb81efd3165f2dd6b8181826bc30fcc807c89 | /learn-design-patterns-app/src/main/java/com/learning/designpatterns/behavioral/memento/example2/Memento.java | 439d317f92a4141e78381fc5f09368a80569eebd | [] | no_license | rod082/java-learning | fbcfea9036065771c4816bc6983be94f2d0b36a7 | e7cdd3959e6088459a2a0424e5afb1fcfd6e72b8 | refs/heads/main | 2023-06-26T21:17:57.848028 | 2021-07-12T02:31:24 | 2021-07-12T02:31:24 | 379,109,587 | 0 | 0 | null | 2021-07-12T02:31:25 | 2021-06-22T01:40:00 | null | UTF-8 | Java | false | false | 222 | java | package com.learning.designpatterns.behavioral.memento.example2;
public class Memento {
private String state;
public Memento(String state) {
this.state = state;
}
public String getState() {
return state;
}
}
| [
"rdakka@cisco.com"
] | rdakka@cisco.com |
2c315ca2519094d0b17a6e2354ff12c83c59c604 | 2b56dcc620946bcd2dd2a738726f5ba097364556 | /Test03/app/src/main/java/com/example/user/test03/Test03.java | b0a58f21c4715a862074e2b663a70557e7cc92ee | [] | no_license | Satirev1/project | 6c9ed27c672c27747dd9ae7b5c90497583ae4e59 | 164fd4019db7b4ff065956ae8e25a58f23a2067b | refs/heads/master | 2020-03-27T23:23:53.168596 | 2018-09-04T08:33:41 | 2018-09-04T08:33:41 | 147,314,320 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 548 | java | package com.example.user.test03;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
public class Test03 extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_test03);
}
public void onClick01(View v){
Intent intent_01 = new Intent(getApplicationContext(), SubActivity.class);
startActivity(intent_01);
}
}
| [
"wlsrpxk@naver.com"
] | wlsrpxk@naver.com |
cd9776f81154d7340f6a2f0d65aa490955e3cdde | d0ea392eb8fa238440cd78902a29f21779bc5e44 | /app/src/main/java/com/github/mikephil/charting/charts/Chart.java | a62ac051e24fe208647316ccda7bf2e118ac223e | [] | no_license | fclehly/WifiMonitor | 744364e39440c6b4051e52675fd218476b8882f1 | 4a5130874fe1186b863b577d188411b5d3240ef6 | refs/heads/master | 2021-01-21T06:47:21.214928 | 2017-02-27T08:29:43 | 2017-02-27T08:29:43 | 83,285,524 | 3 | 1 | null | null | null | null | UTF-8 | Java | false | false | 51,645 | java |
package com.github.mikephil.charting.charts;
import android.animation.ValueAnimator;
import android.animation.ValueAnimator.AnimatorUpdateListener;
import android.annotation.SuppressLint;
import android.content.ContentValues;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Paint.Align;
import android.graphics.RectF;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.os.Environment;
import android.provider.MediaStore.Images;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import com.github.mikephil.charting.animation.ChartAnimator;
import com.github.mikephil.charting.animation.Easing;
import com.github.mikephil.charting.animation.EasingFunction;
import com.github.mikephil.charting.components.Description;
import com.github.mikephil.charting.components.IMarker;
import com.github.mikephil.charting.components.Legend;
import com.github.mikephil.charting.components.XAxis;
import com.github.mikephil.charting.data.ChartData;
import com.github.mikephil.charting.data.Entry;
import com.github.mikephil.charting.formatter.DefaultValueFormatter;
import com.github.mikephil.charting.formatter.IValueFormatter;
import com.github.mikephil.charting.highlight.ChartHighlighter;
import com.github.mikephil.charting.highlight.Highlight;
import com.github.mikephil.charting.highlight.IHighlighter;
import com.github.mikephil.charting.interfaces.dataprovider.ChartInterface;
import com.github.mikephil.charting.interfaces.datasets.IDataSet;
import com.github.mikephil.charting.listener.ChartTouchListener;
import com.github.mikephil.charting.listener.OnChartGestureListener;
import com.github.mikephil.charting.listener.OnChartValueSelectedListener;
import com.github.mikephil.charting.renderer.DataRenderer;
import com.github.mikephil.charting.renderer.LegendRenderer;
import com.github.mikephil.charting.utils.MPPointF;
import com.github.mikephil.charting.utils.Utils;
import com.github.mikephil.charting.utils.ViewPortHandler;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
/**
* Baseclass of all Chart-Views.
*
* @author Philipp Jahoda
*/
@SuppressLint("NewApi")
public abstract class Chart<T extends ChartData<? extends IDataSet<? extends Entry>>> extends
ViewGroup
implements ChartInterface {
public static final String LOG_TAG = "MPAndroidChart";
/**
* flag that indicates if logging is enabled or not
*/
protected boolean mLogEnabled = false;
/**
* object that holds all data that was originally set for the chart, before
* it was modified or any filtering algorithms had been applied
*/
protected T mData = null;
/**
* Flag that indicates if highlighting per tap (touch) is enabled
*/
protected boolean mHighLightPerTapEnabled = true;
/**
* If set to true, chart continues to scroll after touch up
*/
private boolean mDragDecelerationEnabled = true;
/**
* Deceleration friction coefficient in [0 ; 1] interval, higher values
* indicate that speed will decrease slowly, for example if it set to 0, it
* will stop immediately. 1 is an invalid value, and will be converted to
* 0.999f automatically.
*/
private float mDragDecelerationFrictionCoef = 0.9f;
/**
* default value-formatter, number of digits depends on provided chart-data
*/
protected DefaultValueFormatter mDefaultValueFormatter = new DefaultValueFormatter(0);
/**
* paint object used for drawing the description text in the bottom right
* corner of the chart
*/
protected Paint mDescPaint;
/**
* paint object for drawing the information text when there are no values in
* the chart
*/
protected Paint mInfoPaint;
/**
* the object representing the labels on the x-axis
*/
protected XAxis mXAxis;
/**
* if true, touch gestures are enabled on the chart
*/
protected boolean mTouchEnabled = true;
/**
* the object responsible for representing the description text
*/
protected Description mDescription;
/**
* the legend object containing all data associated with the legend
*/
protected Legend mLegend;
/**
* listener that is called when a value on the chart is selected
*/
protected OnChartValueSelectedListener mSelectionListener;
protected ChartTouchListener mChartTouchListener;
/**
* text that is displayed when the chart is empty
*/
private String mNoDataText = "No chart data available.";
/**
* Gesture listener for custom callbacks when making gestures on the chart.
*/
private OnChartGestureListener mGestureListener;
protected LegendRenderer mLegendRenderer;
/**
* object responsible for rendering the data
*/
protected DataRenderer mRenderer;
protected IHighlighter mHighlighter;
/**
* object that manages the bounds and drawing constraints of the chart
*/
protected ViewPortHandler mViewPortHandler = new ViewPortHandler();
/**
* object responsible for animations
*/
protected ChartAnimator mAnimator;
/**
* Extra offsets to be appended to the viewport
*/
private float mExtraTopOffset = 0.f,
mExtraRightOffset = 0.f,
mExtraBottomOffset = 0.f,
mExtraLeftOffset = 0.f;
/**
* default constructor for initialization in code
*/
public Chart(Context context) {
super(context);
init();
}
/**
* constructor for initialization in xml
*/
public Chart(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
/**
* even more awesome constructor
*/
public Chart(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init();
}
/**
* initialize all paints and stuff
*/
protected void init() {
setWillNotDraw(false);
// setLayerType(View.LAYER_TYPE_HARDWARE, null);
if (android.os.Build.VERSION.SDK_INT < 11)
mAnimator = new ChartAnimator();
else
mAnimator = new ChartAnimator(new AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
// ViewCompat.postInvalidateOnAnimation(Chart.this);
postInvalidate();
}
});
// initialize the utils
Utils.init(getContext());
mMaxHighlightDistance = Utils.convertDpToPixel(500f);
mDescription = new Description();
mLegend = new Legend();
mLegendRenderer = new LegendRenderer(mViewPortHandler, mLegend);
mXAxis = new XAxis();
mDescPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mInfoPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mInfoPaint.setColor(Color.rgb(247, 189, 51)); // orange
mInfoPaint.setTextAlign(Align.CENTER);
mInfoPaint.setTextSize(Utils.convertDpToPixel(12f));
if (mLogEnabled)
Log.i("", "Chart.init()");
}
// public void initWithDummyData() {
// ColorTemplate template = new ColorTemplate();
// template.addColorsForDataSets(ColorTemplate.COLORFUL_COLORS,
// getContext());
//
// setColorTemplate(template);
// setDrawYValues(false);
//
// ArrayList<String> xVals = new ArrayList<String>();
// Calendar calendar = Calendar.getInstance();
// for (int i = 0; i < 12; i++) {
// xVals.add(calendar.getDisplayName(Calendar.MONTH, Calendar.SHORT,
// Locale.getDefault()));
// }
//
// ArrayList<DataSet> dataSets = new ArrayList<DataSet>();
// for (int i = 0; i < 3; i++) {
//
// ArrayList<Entry> yVals = new ArrayList<Entry>();
//
// for (int j = 0; j < 12; j++) {
// float val = (float) (Math.random() * 100);
// yVals.add(new Entry(val, j));
// }
//
// DataSet set = new DataSet(yVals, "DataSet " + i);
// dataSets.add(set); // add the datasets
// }
// // create a data object with the datasets
// ChartData data = new ChartData(xVals, dataSets);
// setData(data);
// invalidate();
// }
/**
* Sets a new data object for the chart. The data object contains all values
* and information needed for displaying.
*
* @param data
*/
public void setData(T data) {
mData = data;
mOffsetsCalculated = false;
if (data == null) {
return;
}
// calculate how many digits are needed
setupDefaultFormatter(data.getYMin(), data.getYMax());
for (IDataSet set : mData.getDataSets()) {
if (set.needsFormatter() || set.getValueFormatter() == mDefaultValueFormatter)
set.setValueFormatter(mDefaultValueFormatter);
}
// let the chart know there is new data
notifyDataSetChanged();
if (mLogEnabled)
Log.i(LOG_TAG, "Data is set.");
}
/**
* Clears the chart from all data (sets it to null) and refreshes it (by
* calling invalidate()).
*/
public void clear() {
mData = null;
mOffsetsCalculated = false;
mIndicesToHighlight = null;
invalidate();
}
/**
* Removes all DataSets (and thereby Entries) from the chart. Does not set the data object to null. Also refreshes the
* chart by calling invalidate().
*/
public void clearValues() {
mData.clearValues();
invalidate();
}
/**
* Returns true if the chart is empty (meaning it's data object is either
* null or contains no entries).
*
* @return
*/
public boolean isEmpty() {
if (mData == null)
return true;
else {
if (mData.getEntryCount() <= 0)
return true;
else
return false;
}
}
/**
* Lets the chart know its underlying data has changed and performs all
* necessary recalculations. It is crucial that this method is called
* everytime data is changed dynamically. Not calling this method can lead
* to crashes or unexpected behaviour.
*/
public abstract void notifyDataSetChanged();
/**
* Calculates the offsets of the chart to the border depending on the
* position of an eventual legend or depending on the length of the y-axis
* and x-axis labels and their position
*/
protected abstract void calculateOffsets();
/**
* Calculates the y-min and y-max value and the y-delta and x-delta value
*/
protected abstract void calcMinMax();
/**
* Calculates the required number of digits for the values that might be
* drawn in the chart (if enabled), and creates the default-value-formatter
*/
protected void setupDefaultFormatter(float min, float max) {
float reference = 0f;
if (mData == null || mData.getEntryCount() < 2) {
reference = Math.max(Math.abs(min), Math.abs(max));
} else {
reference = Math.abs(max - min);
}
int digits = Utils.getDecimals(reference);
// setup the formatter with a new number of digits
mDefaultValueFormatter.setup(digits);
}
/**
* flag that indicates if offsets calculation has already been done or not
*/
private boolean mOffsetsCalculated = false;
@Override
protected void onDraw(Canvas canvas) {
// super.onDraw(canvas);
if (mData == null) {
boolean hasText = !TextUtils.isEmpty(mNoDataText);
if (hasText) {
MPPointF c = getCenter();
canvas.drawText(mNoDataText, c.x, c.y, mInfoPaint);
}
return;
}
if (!mOffsetsCalculated) {
calculateOffsets();
mOffsetsCalculated = true;
}
}
/**
* Draws the description text in the bottom right corner of the chart (per default)
*/
protected void drawDescription(Canvas c) {
// check if description should be drawn
if (mDescription != null && mDescription.isEnabled()) {
MPPointF position = mDescription.getPosition();
mDescPaint.setTypeface(mDescription.getTypeface());
mDescPaint.setTextSize(mDescription.getTextSize());
mDescPaint.setColor(mDescription.getTextColor());
mDescPaint.setTextAlign(mDescription.getTextAlign());
float x, y;
// if no position specified, draw on default position
if (position == null) {
x = getWidth() - mViewPortHandler.offsetRight() - mDescription.getXOffset();
y = getHeight() - mViewPortHandler.offsetBottom() - mDescription.getYOffset();
} else {
x = position.x;
y = position.y;
}
c.drawText(mDescription.getText(), x, y, mDescPaint);
}
}
/**
* ################ ################ ################ ################
*/
/** BELOW THIS CODE FOR HIGHLIGHTING */
/**
* array of Highlight objects that reference the highlighted slices in the
* chart
*/
protected Highlight[] mIndicesToHighlight;
/**
* The maximum distance in dp away from an entry causing it to highlight.
*/
protected float mMaxHighlightDistance = 0f;
@Override
public float getMaxHighlightDistance() {
return mMaxHighlightDistance;
}
/**
* Sets the maximum distance in screen dp a touch can be away from an entry to cause it to get highlighted.
* Default: 500dp
*
* @param distDp
*/
public void setMaxHighlightDistance(float distDp) {
mMaxHighlightDistance = Utils.convertDpToPixel(distDp);
}
/**
* Returns the array of currently highlighted values. This might a null or
* empty array if nothing is highlighted.
*
* @return
*/
public Highlight[] getHighlighted() {
return mIndicesToHighlight;
}
/**
* Returns true if values can be highlighted via tap gesture, false if not.
*
* @return
*/
public boolean isHighlightPerTapEnabled() {
return mHighLightPerTapEnabled;
}
/**
* Set this to false to prevent values from being highlighted by tap gesture.
* Values can still be highlighted via drag or programmatically. Default: true
*
* @param enabled
*/
public void setHighlightPerTapEnabled(boolean enabled) {
mHighLightPerTapEnabled = enabled;
}
/**
* Returns true if there are values to highlight, false if there are no
* values to highlight. Checks if the highlight array is null, has a length
* of zero or if the first object is null.
*
* @return
*/
public boolean valuesToHighlight() {
return mIndicesToHighlight == null || mIndicesToHighlight.length <= 0
|| mIndicesToHighlight[0] == null ? false
: true;
}
/**
* Sets the last highlighted value for the touchlistener.
*
* @param highs
*/
protected void setLastHighlighted(Highlight[] highs) {
if (highs == null || highs.length <= 0 || highs[0] == null) {
mChartTouchListener.setLastHighlighted(null);
} else {
mChartTouchListener.setLastHighlighted(highs[0]);
}
}
/**
* Highlights the values at the given indices in the given DataSets. Provide
* null or an empty array to undo all highlighting. This should be used to
* programmatically highlight values.
* This method *will not* call the listener.
*
* @param highs
*/
public void highlightValues(Highlight[] highs) {
// set the indices to highlight
mIndicesToHighlight = highs;
setLastHighlighted(highs);
// redraw the chart
invalidate();
}
/**
* Highlights any y-value at the given x-value in the given DataSet.
* Provide -1 as the dataSetIndex to undo all highlighting.
* This method will call the listener.
* @param x The x-value to highlight
* @param dataSetIndex The dataset index to search in
*/
public void highlightValue(float x, int dataSetIndex) {
highlightValue(x, dataSetIndex, true);
}
/**
* Highlights the value at the given x-value and y-value in the given DataSet.
* Provide -1 as the dataSetIndex to undo all highlighting.
* This method will call the listener.
* @param x The x-value to highlight
* @param y The y-value to highlight. Supply `NaN` for "any"
* @param dataSetIndex The dataset index to search in
*/
public void highlightValue(float x, float y, int dataSetIndex) {
highlightValue(x, y, dataSetIndex, true);
}
/**
* Highlights any y-value at the given x-value in the given DataSet.
* Provide -1 as the dataSetIndex to undo all highlighting.
* @param x The x-value to highlight
* @param dataSetIndex The dataset index to search in
* @param callListener Should the listener be called for this change
*/
public void highlightValue(float x, int dataSetIndex, boolean callListener) {
highlightValue(x, Float.NaN, dataSetIndex, callListener);
}
/**
* Highlights any y-value at the given x-value in the given DataSet.
* Provide -1 as the dataSetIndex to undo all highlighting.
* @param x The x-value to highlight
* @param y The y-value to highlight. Supply `NaN` for "any"
* @param dataSetIndex The dataset index to search in
* @param callListener Should the listener be called for this change
*/
public void highlightValue(float x, float y, int dataSetIndex, boolean callListener) {
if (dataSetIndex < 0 || dataSetIndex >= mData.getDataSetCount()) {
highlightValue(null, callListener);
} else {
highlightValue(new Highlight(x, y, dataSetIndex), callListener);
}
}
/**
* Highlights the values represented by the provided Highlight object
* This method *will not* call the listener.
*
* @param highlight contains information about which entry should be highlighted
*/
public void highlightValue(Highlight highlight) {
highlightValue(highlight, false);
}
/**
* Highlights the value selected by touch gesture. Unlike
* highlightValues(...), this generates a callback to the
* OnChartValueSelectedListener.
*
* @param high - the highlight object
* @param callListener - call the listener
*/
public void highlightValue(Highlight high, boolean callListener) {
Entry e = null;
if (high == null)
mIndicesToHighlight = null;
else {
if (mLogEnabled)
Log.i(LOG_TAG, "Highlighted: " + high.toString());
e = mData.getEntryForHighlight(high);
if (e == null) {
mIndicesToHighlight = null;
high = null;
} else {
// set the indices to highlight
mIndicesToHighlight = new Highlight[]{
high
};
}
}
setLastHighlighted(mIndicesToHighlight);
if (callListener && mSelectionListener != null) {
if (!valuesToHighlight())
mSelectionListener.onNothingSelected();
else {
// notify the listener
mSelectionListener.onValueSelected(e, high);
}
}
// redraw the chart
invalidate();
}
/**
* Returns the Highlight object (contains x-index and DataSet index) of the
* selected value at the given touch point inside the Line-, Scatter-, or
* CandleStick-Chart.
*
* @param x
* @param y
* @return
*/
public Highlight getHighlightByTouchPoint(float x, float y) {
if (mData == null) {
Log.e(LOG_TAG, "Can't select by touch. No data set.");
return null;
} else
return getHighlighter().getHighlight(x, y);
}
/**
* Set a new (e.g. custom) ChartTouchListener NOTE: make sure to
* setTouchEnabled(true); if you need touch gestures on the chart
*
* @param l
*/
public void setOnTouchListener(ChartTouchListener l) {
this.mChartTouchListener = l;
}
/**
* Returns an instance of the currently active touch listener.
*
* @return
*/
public ChartTouchListener getOnTouchListener() {
return mChartTouchListener;
}
/**
* ################ ################ ################ ################
*/
/** BELOW CODE IS FOR THE MARKER VIEW */
/**
* if set to true, the marker view is drawn when a value is clicked
*/
protected boolean mDrawMarkers = true;
/**
* the view that represents the marker
*/
protected IMarker mMarker;
/**
* draws all MarkerViews on the highlighted positions
*/
protected void drawMarkers(Canvas canvas) {
// if there is no marker view or drawing marker is disabled
if (mMarker == null || !isDrawMarkersEnabled() || !valuesToHighlight())
return;
for (int i = 0; i < mIndicesToHighlight.length; i++) {
Highlight highlight = mIndicesToHighlight[i];
IDataSet set = mData.getDataSetByIndex(highlight.getDataSetIndex());
Entry e = mData.getEntryForHighlight(mIndicesToHighlight[i]);
int entryIndex = set.getEntryIndex(e);
// make sure entry not null
if (e == null || entryIndex > set.getEntryCount() * mAnimator.getPhaseX())
continue;
float[] pos = getMarkerPosition(highlight);
// check bounds
if (!mViewPortHandler.isInBounds(pos[0], pos[1]))
continue;
// callbacks to update the content
mMarker.refreshContent(e, highlight);
// draw the marker
mMarker.draw(canvas, pos[0], pos[1]);
}
}
/**
* Returns the actual position in pixels of the MarkerView for the given
* Highlight object.
*
* @param high
* @return
*/
protected float[] getMarkerPosition(Highlight high) {
return new float[]{high.getDrawX(), high.getDrawY()};
}
/**
* ################ ################ ################ ################
* ANIMATIONS ONLY WORK FOR API LEVEL 11 (Android 3.0.x) AND HIGHER.
*/
/** CODE BELOW THIS RELATED TO ANIMATION */
/**
* Returns the animator responsible for animating chart values.
*
* @return
*/
public ChartAnimator getAnimator() {
return mAnimator;
}
/**
* If set to true, chart continues to scroll after touch up default: true
*/
public boolean isDragDecelerationEnabled() {
return mDragDecelerationEnabled;
}
/**
* If set to true, chart continues to scroll after touch up. Default: true.
*
* @param enabled
*/
public void setDragDecelerationEnabled(boolean enabled) {
mDragDecelerationEnabled = enabled;
}
/**
* Returns drag deceleration friction coefficient
*
* @return
*/
public float getDragDecelerationFrictionCoef() {
return mDragDecelerationFrictionCoef;
}
/**
* Deceleration friction coefficient in [0 ; 1] interval, higher values
* indicate that speed will decrease slowly, for example if it set to 0, it
* will stop immediately. 1 is an invalid value, and will be converted to
* 0.999f automatically.
*
* @param newValue
*/
public void setDragDecelerationFrictionCoef(float newValue) {
if (newValue < 0.f)
newValue = 0.f;
if (newValue >= 1f)
newValue = 0.999f;
mDragDecelerationFrictionCoef = newValue;
}
/**
* ################ ################ ################ ################
* ANIMATIONS ONLY WORK FOR API LEVEL 11 (Android 3.0.x) AND HIGHER.
*/
/** CODE BELOW FOR PROVIDING EASING FUNCTIONS */
/**
* Animates the drawing / rendering of the chart on both x- and y-axis with
* the specified animation time. If animate(...) is called, no further
* calling of invalidate() is necessary to refresh the chart. ANIMATIONS
* ONLY WORK FOR API LEVEL 11 (Android 3.0.x) AND HIGHER.
*
* @param durationMillisX
* @param durationMillisY
* @param easingX a custom easing function to be used on the animation phase
* @param easingY a custom easing function to be used on the animation phase
*/
public void animateXY(int durationMillisX, int durationMillisY, EasingFunction easingX,
EasingFunction easingY) {
mAnimator.animateXY(durationMillisX, durationMillisY, easingX, easingY);
}
/**
* Animates the rendering of the chart on the x-axis with the specified
* animation time. If animate(...) is called, no further calling of
* invalidate() is necessary to refresh the chart. ANIMATIONS ONLY WORK FOR
* API LEVEL 11 (Android 3.0.x) AND HIGHER.
*
* @param durationMillis
* @param easing a custom easing function to be used on the animation phase
*/
public void animateX(int durationMillis, EasingFunction easing) {
mAnimator.animateX(durationMillis, easing);
}
/**
* Animates the rendering of the chart on the y-axis with the specified
* animation time. If animate(...) is called, no further calling of
* invalidate() is necessary to refresh the chart. ANIMATIONS ONLY WORK FOR
* API LEVEL 11 (Android 3.0.x) AND HIGHER.
*
* @param durationMillis
* @param easing a custom easing function to be used on the animation phase
*/
public void animateY(int durationMillis, EasingFunction easing) {
mAnimator.animateY(durationMillis, easing);
}
/**
* ################ ################ ################ ################
* ANIMATIONS ONLY WORK FOR API LEVEL 11 (Android 3.0.x) AND HIGHER.
*/
/** CODE BELOW FOR PREDEFINED EASING OPTIONS */
/**
* Animates the drawing / rendering of the chart on both x- and y-axis with
* the specified animation time. If animate(...) is called, no further
* calling of invalidate() is necessary to refresh the chart. ANIMATIONS
* ONLY WORK FOR API LEVEL 11 (Android 3.0.x) AND HIGHER.
*
* @param durationMillisX
* @param durationMillisY
* @param easingX a predefined easing option
* @param easingY a predefined easing option
*/
public void animateXY(int durationMillisX, int durationMillisY, Easing.EasingOption easingX,
Easing.EasingOption easingY) {
mAnimator.animateXY(durationMillisX, durationMillisY, easingX, easingY);
}
/**
* Animates the rendering of the chart on the x-axis with the specified
* animation time. If animate(...) is called, no further calling of
* invalidate() is necessary to refresh the chart. ANIMATIONS ONLY WORK FOR
* API LEVEL 11 (Android 3.0.x) AND HIGHER.
*
* @param durationMillis
* @param easing a predefined easing option
*/
public void animateX(int durationMillis, Easing.EasingOption easing) {
mAnimator.animateX(durationMillis, easing);
}
/**
* Animates the rendering of the chart on the y-axis with the specified
* animation time. If animate(...) is called, no further calling of
* invalidate() is necessary to refresh the chart. ANIMATIONS ONLY WORK FOR
* API LEVEL 11 (Android 3.0.x) AND HIGHER.
*
* @param durationMillis
* @param easing a predefined easing option
*/
public void animateY(int durationMillis, Easing.EasingOption easing) {
mAnimator.animateY(durationMillis, easing);
}
/**
* ################ ################ ################ ################
* ANIMATIONS ONLY WORK FOR API LEVEL 11 (Android 3.0.x) AND HIGHER.
*/
/** CODE BELOW FOR ANIMATIONS WITHOUT EASING */
/**
* Animates the rendering of the chart on the x-axis with the specified
* animation time. If animate(...) is called, no further calling of
* invalidate() is necessary to refresh the chart. ANIMATIONS ONLY WORK FOR
* API LEVEL 11 (Android 3.0.x) AND HIGHER.
*
* @param durationMillis
*/
public void animateX(int durationMillis) {
mAnimator.animateX(durationMillis);
}
/**
* Animates the rendering of the chart on the y-axis with the specified
* animation time. If animate(...) is called, no further calling of
* invalidate() is necessary to refresh the chart. ANIMATIONS ONLY WORK FOR
* API LEVEL 11 (Android 3.0.x) AND HIGHER.
*
* @param durationMillis
*/
public void animateY(int durationMillis) {
mAnimator.animateY(durationMillis);
}
/**
* Animates the drawing / rendering of the chart on both x- and y-axis with
* the specified animation time. If animate(...) is called, no further
* calling of invalidate() is necessary to refresh the chart. ANIMATIONS
* ONLY WORK FOR API LEVEL 11 (Android 3.0.x) AND HIGHER.
*
* @param durationMillisX
* @param durationMillisY
*/
public void animateXY(int durationMillisX, int durationMillisY) {
mAnimator.animateXY(durationMillisX, durationMillisY);
}
/**
* ################ ################ ################ ################
*/
/** BELOW THIS ONLY GETTERS AND SETTERS */
/**
* Returns the object representing all x-labels, this method can be used to
* acquire the XAxis object and modify it (e.g. change the position of the
* labels, styling, etc.)
*
* @return
*/
public XAxis getXAxis() {
return mXAxis;
}
/**
* Returns the default IValueFormatter that has been determined by the chart
* considering the provided minimum and maximum values.
*
* @return
*/
public IValueFormatter getDefaultValueFormatter() {
return mDefaultValueFormatter;
}
/**
* set a selection listener for the chart
*
* @param l
*/
public void setOnChartValueSelectedListener(OnChartValueSelectedListener l) {
this.mSelectionListener = l;
}
/**
* Sets a gesture-listener for the chart for custom callbacks when executing
* gestures on the chart surface.
*
* @param l
*/
public void setOnChartGestureListener(OnChartGestureListener l) {
this.mGestureListener = l;
}
/**
* Returns the custom gesture listener.
*
* @return
*/
public OnChartGestureListener getOnChartGestureListener() {
return mGestureListener;
}
/**
* returns the current y-max value across all DataSets
*
* @return
*/
public float getYMax() {
return mData.getYMax();
}
/**
* returns the current y-min value across all DataSets
*
* @return
*/
public float getYMin() {
return mData.getYMin();
}
@Override
public float getXChartMax() {
return mXAxis.mAxisMaximum;
}
@Override
public float getXChartMin() {
return mXAxis.mAxisMinimum;
}
@Override
public float getXRange() {
return mXAxis.mAxisRange;
}
/**
* Returns a recyclable MPPointF instance.
* Returns the center point of the chart (the whole View) in pixels.
*
* @return
*/
public MPPointF getCenter() {
return MPPointF.getInstance(getWidth() / 2f, getHeight() / 2f);
}
/**
* Returns a recyclable MPPointF instance.
* Returns the center of the chart taking offsets under consideration.
* (returns the center of the content rectangle)
*
* @return
*/
@Override
public MPPointF getCenterOffsets() {
return mViewPortHandler.getContentCenter();
}
/**
* Sets extra offsets (around the chart view) to be appended to the
* auto-calculated offsets.
*
* @param left
* @param top
* @param right
* @param bottom
*/
public void setExtraOffsets(float left, float top, float right, float bottom) {
setExtraLeftOffset(left);
setExtraTopOffset(top);
setExtraRightOffset(right);
setExtraBottomOffset(bottom);
}
/**
* Set an extra offset to be appended to the viewport's top
*/
public void setExtraTopOffset(float offset) {
mExtraTopOffset = Utils.convertDpToPixel(offset);
}
/**
* @return the extra offset to be appended to the viewport's top
*/
public float getExtraTopOffset() {
return mExtraTopOffset;
}
/**
* Set an extra offset to be appended to the viewport's right
*/
public void setExtraRightOffset(float offset) {
mExtraRightOffset = Utils.convertDpToPixel(offset);
}
/**
* @return the extra offset to be appended to the viewport's right
*/
public float getExtraRightOffset() {
return mExtraRightOffset;
}
/**
* Set an extra offset to be appended to the viewport's bottom
*/
public void setExtraBottomOffset(float offset) {
mExtraBottomOffset = Utils.convertDpToPixel(offset);
}
/**
* @return the extra offset to be appended to the viewport's bottom
*/
public float getExtraBottomOffset() {
return mExtraBottomOffset;
}
/**
* Set an extra offset to be appended to the viewport's left
*/
public void setExtraLeftOffset(float offset) {
mExtraLeftOffset = Utils.convertDpToPixel(offset);
}
/**
* @return the extra offset to be appended to the viewport's left
*/
public float getExtraLeftOffset() {
return mExtraLeftOffset;
}
/**
* Set this to true to enable logcat outputs for the chart. Beware that
* logcat output decreases rendering performance. Default: disabled.
*
* @param enabled
*/
public void setLogEnabled(boolean enabled) {
mLogEnabled = enabled;
}
/**
* Returns true if log-output is enabled for the chart, fals if not.
*
* @return
*/
public boolean isLogEnabled() {
return mLogEnabled;
}
/**
* Sets the text that informs the user that there is no data available with
* which to draw the chart.
*
* @param text
*/
public void setNoDataText(String text) {
mNoDataText = text;
}
/**
* Sets the color of the no data text.
*
* @param color
*/
public void setNoDataTextColor(int color) {
mInfoPaint.setColor(color);
}
/**
* Sets the typeface to be used for the no data text.
*
* @param tf
*/
public void setNoDataTextTypeface(Typeface tf) {
mInfoPaint.setTypeface(tf);
}
/**
* Set this to false to disable all gestures and touches on the chart,
* default: true
*
* @param enabled
*/
public void setTouchEnabled(boolean enabled) {
this.mTouchEnabled = enabled;
}
/**
* sets the marker that is displayed when a value is clicked on the chart
*
* @param marker
*/
public void setMarker(IMarker marker) {
mMarker = marker;
}
/**
* returns the marker that is set as a marker view for the chart
*
* @return
*/
public IMarker getMarker() {
return mMarker;
}
@Deprecated
public void setMarkerView(IMarker v) {
setMarker(v);
}
@Deprecated
public IMarker getMarkerView() {
return getMarker();
}
/**
* Sets a new Description object for the chart.
*
* @param desc
*/
public void setDescription(Description desc) {
this.mDescription = desc;
}
/**
* Returns the Description object of the chart that is responsible for holding all information related
* to the description text that is displayed in the bottom right corner of the chart (by default).
*
* @return
*/
public Description getDescription() {
return mDescription;
}
/**
* Returns the Legend object of the chart. This method can be used to get an
* instance of the legend in order to customize the automatically generated
* Legend.
*
* @return
*/
public Legend getLegend() {
return mLegend;
}
/**
* Returns the renderer object responsible for rendering / drawing the
* Legend.
*
* @return
*/
public LegendRenderer getLegendRenderer() {
return mLegendRenderer;
}
/**
* Returns the rectangle that defines the borders of the chart-value surface
* (into which the actual values are drawn).
*
* @return
*/
@Override
public RectF getContentRect() {
return mViewPortHandler.getContentRect();
}
/**
* disables intercept touchevents
*/
public void disableScroll() {
ViewParent parent = getParent();
if (parent != null)
parent.requestDisallowInterceptTouchEvent(true);
}
/**
* enables intercept touchevents
*/
public void enableScroll() {
ViewParent parent = getParent();
if (parent != null)
parent.requestDisallowInterceptTouchEvent(false);
}
/**
* paint for the grid background (only line and barchart)
*/
public static final int PAINT_GRID_BACKGROUND = 4;
/**
* paint for the info text that is displayed when there are no values in the
* chart
*/
public static final int PAINT_INFO = 7;
/**
* paint for the description text in the bottom right corner
*/
public static final int PAINT_DESCRIPTION = 11;
/**
* paint for the hole in the middle of the pie chart
*/
public static final int PAINT_HOLE = 13;
/**
* paint for the text in the middle of the pie chart
*/
public static final int PAINT_CENTER_TEXT = 14;
/**
* paint used for the legend
*/
public static final int PAINT_LEGEND_LABEL = 18;
/**
* set a new paint object for the specified parameter in the chart e.g.
* Chart.PAINT_VALUES
*
* @param p the new paint object
* @param which Chart.PAINT_VALUES, Chart.PAINT_GRID, Chart.PAINT_VALUES,
* ...
*/
public void setPaint(Paint p, int which) {
switch (which) {
case PAINT_INFO:
mInfoPaint = p;
break;
case PAINT_DESCRIPTION:
mDescPaint = p;
break;
}
}
/**
* Returns the paint object associated with the provided constant.
*
* @param which e.g. Chart.PAINT_LEGEND_LABEL
* @return
*/
public Paint getPaint(int which) {
switch (which) {
case PAINT_INFO:
return mInfoPaint;
case PAINT_DESCRIPTION:
return mDescPaint;
}
return null;
}
@Deprecated
public boolean isDrawMarkerViewsEnabled() {
return isDrawMarkersEnabled();
}
@Deprecated
public void setDrawMarkerViews(boolean enabled) {
setDrawMarkers(enabled);
}
/**
* returns true if drawing the marker is enabled when tapping on values
* (use the setMarker(IMarker marker) method to specify a marker)
*
* @return
*/
public boolean isDrawMarkersEnabled() {
return mDrawMarkers;
}
/**
* Set this to true to draw a user specified marker when tapping on
* chart values (use the setMarker(IMarker marker) method to specify a
* marker). Default: true
*
* @param enabled
*/
public void setDrawMarkers(boolean enabled) {
mDrawMarkers = enabled;
}
/**
* Returns the ChartData object that has been set for the chart.
*
* @return
*/
public T getData() {
return mData;
}
/**
* Returns the ViewPortHandler of the chart that is responsible for the
* content area of the chart and its offsets and dimensions.
*
* @return
*/
public ViewPortHandler getViewPortHandler() {
return mViewPortHandler;
}
/**
* Returns the Renderer object the chart uses for drawing data.
*
* @return
*/
public DataRenderer getRenderer() {
return mRenderer;
}
/**
* Sets a new DataRenderer object for the chart.
*
* @param renderer
*/
public void setRenderer(DataRenderer renderer) {
if (renderer != null)
mRenderer = renderer;
}
public IHighlighter getHighlighter() {
return mHighlighter;
}
/**
* Sets a custom highligher object for the chart that handles / processes
* all highlight touch events performed on the chart-view.
*
* @param highlighter
*/
public void setHighlighter(ChartHighlighter highlighter) {
mHighlighter = highlighter;
}
/**
* Returns a recyclable MPPointF instance.
*
* @return
*/
@Override
public MPPointF getCenterOfView() {
return getCenter();
}
/**
* Returns the bitmap that represents the chart.
*
* @return
*/
public Bitmap getChartBitmap() {
// Define a bitmap with the same size as the view
Bitmap returnedBitmap = Bitmap.createBitmap(getWidth(), getHeight(), Bitmap.Config.RGB_565);
// Bind a canvas to it
Canvas canvas = new Canvas(returnedBitmap);
// Get the view's background
Drawable bgDrawable = getBackground();
if (bgDrawable != null)
// has background drawable, then draw it on the canvas
bgDrawable.draw(canvas);
else
// does not have background drawable, then draw white background on
// the canvas
canvas.drawColor(Color.WHITE);
// draw the view on the canvas
draw(canvas);
// return the bitmap
return returnedBitmap;
}
/**
* Saves the current chart state with the given name to the given path on
* the sdcard leaving the path empty "" will put the saved file directly on
* the SD card chart is saved as a PNG image, example:
* saveToPath("myfilename", "foldername1/foldername2");
*
* @param title
* @param pathOnSD e.g. "folder1/folder2/folder3"
* @return returns true on success, false on error
*/
public boolean saveToPath(String title, String pathOnSD) {
Bitmap b = getChartBitmap();
OutputStream stream = null;
try {
stream = new FileOutputStream(Environment.getExternalStorageDirectory().getPath()
+ pathOnSD + "/" + title
+ ".png");
/*
* Write bitmap to file using JPEG or PNG and 40% quality hint for
* JPEG.
*/
b.compress(CompressFormat.PNG, 40, stream);
stream.close();
} catch (Exception e) {
e.printStackTrace();
return false;
}
return true;
}
/**
* Saves the current state of the chart to the gallery as an image type. The
* compression must be set for JPEG only. 0 == maximum compression, 100 = low
* compression (high quality). NOTE: Needs permission WRITE_EXTERNAL_STORAGE
*
* @param fileName e.g. "my_image"
* @param subFolderPath e.g. "ChartPics"
* @param fileDescription e.g. "Chart details"
* @param format e.g. Bitmap.CompressFormat.PNG
* @param quality e.g. 50, min = 0, max = 100
* @return returns true if saving was successful, false if not
*/
public boolean saveToGallery(String fileName, String subFolderPath, String fileDescription, CompressFormat
format, int quality) {
// restrain quality
if (quality < 0 || quality > 100)
quality = 50;
long currentTime = System.currentTimeMillis();
File extBaseDir = Environment.getExternalStorageDirectory();
File file = new File(extBaseDir.getAbsolutePath() + "/DCIM/" + subFolderPath);
if (!file.exists()) {
if (!file.mkdirs()) {
return false;
}
}
String mimeType = "";
switch (format) {
case PNG:
mimeType = "image/png";
if (!fileName.endsWith(".png"))
fileName += ".png";
break;
case WEBP:
mimeType = "image/webp";
if (!fileName.endsWith(".webp"))
fileName += ".webp";
break;
case JPEG:
default:
mimeType = "image/jpeg";
if (!(fileName.endsWith(".jpg") || fileName.endsWith(".jpeg")))
fileName += ".jpg";
break;
}
String filePath = file.getAbsolutePath() + "/" + fileName;
FileOutputStream out = null;
try {
out = new FileOutputStream(filePath);
Bitmap b = getChartBitmap();
b.compress(format, quality, out);
out.flush();
out.close();
} catch (IOException e) {
e.printStackTrace();
return false;
}
long size = new File(filePath).length();
ContentValues values = new ContentValues(8);
// store the details
values.put(Images.Media.TITLE, fileName);
values.put(Images.Media.DISPLAY_NAME, fileName);
values.put(Images.Media.DATE_ADDED, currentTime);
values.put(Images.Media.MIME_TYPE, mimeType);
values.put(Images.Media.DESCRIPTION, fileDescription);
values.put(Images.Media.ORIENTATION, 0);
values.put(Images.Media.DATA, filePath);
values.put(Images.Media.SIZE, size);
return getContext().getContentResolver().insert(Images.Media.EXTERNAL_CONTENT_URI, values) != null;
}
/**
* Saves the current state of the chart to the gallery as a JPEG image. The
* filename and compression can be set. 0 == maximum compression, 100 = low
* compression (high quality). NOTE: Needs permission WRITE_EXTERNAL_STORAGE
*
* @param fileName e.g. "my_image"
* @param quality e.g. 50, min = 0, max = 100
* @return returns true if saving was successful, false if not
*/
public boolean saveToGallery(String fileName, int quality) {
return saveToGallery(fileName, "", "MPAndroidChart-Library Save", CompressFormat.JPEG, quality);
}
/**
* tasks to be done after the view is setup
*/
protected ArrayList<Runnable> mJobs = new ArrayList<Runnable>();
public void removeViewportJob(Runnable job) {
mJobs.remove(job);
}
public void clearAllViewportJobs() {
mJobs.clear();
}
/**
* Either posts a job immediately if the chart has already setup it's
* dimensions or adds the job to the execution queue.
*
* @param job
*/
public void addViewportJob(Runnable job) {
if (mViewPortHandler.hasChartDimens()) {
post(job);
} else {
mJobs.add(job);
}
}
/**
* Returns all jobs that are scheduled to be executed after
* onSizeChanged(...).
*
* @return
*/
public ArrayList<Runnable> getJobs() {
return mJobs;
}
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
for (int i = 0; i < getChildCount(); i++) {
getChildAt(i).layout(left, top, right, bottom);
}
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
int size = (int) Utils.convertDpToPixel(50f);
setMeasuredDimension(
Math.max(getSuggestedMinimumWidth(),
resolveSize(size,
widthMeasureSpec)),
Math.max(getSuggestedMinimumHeight(),
resolveSize(size,
heightMeasureSpec)));
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
if (mLogEnabled)
Log.i(LOG_TAG, "OnSizeChanged()");
if (w > 0 && h > 0 && w < 10000 && h < 10000) {
mViewPortHandler.setChartDimens(w, h);
if (mLogEnabled)
Log.i(LOG_TAG, "Setting chart dimens, width: " + w + ", height: " + h);
for (Runnable r : mJobs) {
post(r);
}
mJobs.clear();
}
notifyDataSetChanged();
super.onSizeChanged(w, h, oldw, oldh);
}
/**
* Setting this to true will set the layer-type HARDWARE for the view, false
* will set layer-type SOFTWARE.
*
* @param enabled
*/
public void setHardwareAccelerationEnabled(boolean enabled) {
if (android.os.Build.VERSION.SDK_INT >= 11) {
if (enabled)
setLayerType(View.LAYER_TYPE_HARDWARE, null);
else
setLayerType(View.LAYER_TYPE_SOFTWARE, null);
} else {
Log.e(LOG_TAG,
"Cannot enable/disable hardware acceleration for devices below API level 11.");
}
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
//Log.i(LOG_TAG, "Detaching...");
if (mUnbind)
unbindDrawables(this);
}
/**
* unbind flag
*/
private boolean mUnbind = false;
/**
* Unbind all drawables to avoid memory leaks.
* Link: http://stackoverflow.com/a/6779164/1590502
*
* @param view
*/
private void unbindDrawables(View view) {
if (view.getBackground() != null) {
view.getBackground().setCallback(null);
}
if (view instanceof ViewGroup) {
for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {
unbindDrawables(((ViewGroup) view).getChildAt(i));
}
((ViewGroup) view).removeAllViews();
}
}
/**
* Set this to true to enable "unbinding" of drawables. When a View is detached
* from a window. This helps avoid memory leaks.
* Default: false
* Link: http://stackoverflow.com/a/6779164/1590502
*
* @param enabled
*/
public void setUnbindEnabled(boolean enabled) {
this.mUnbind = enabled;
}
}
| [
"ffwzz@outlook.com"
] | ffwzz@outlook.com |
4d7bfbde2ce9b0af8567c52097d45b19a8963dc4 | 7feb1a4195150ac73cdaa9e46a9da254d1e8b50b | /src/java/types/Genre.java | e7d650ebe592bc95321ad0f403ab4ca7d6ff19c9 | [] | no_license | wellocean/MusiBoy | 38dc92f7003d39f5e63ea8616ae24b6f4bdfd9f3 | 4e3883357eb54d4210277854d0eb0bc6e3f09a85 | refs/heads/master | 2021-01-18T21:36:26.510277 | 2015-07-05T11:02:02 | 2015-07-05T11:02:02 | 34,373,044 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 749 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package types;
import java.io.Serializable;
/**
*
* @author Purevsuren
*/
public class Genre implements Serializable {
String genreID;
String title;
public Genre(String genreID, String title) {
this.genreID = genreID;
this.title = title;
}
public String getGenreID() {
return genreID;
}
public String getTitle() {
return title;
}
public void setGenreID(String genreID) {
this.genreID = genreID;
}
public void setTitle(String title) {
this.title = title;
}
}
| [
"wellocean@163.com"
] | wellocean@163.com |
5624d36ad886fdc8c81100017d81d7d44885204d | 2aaaf214f44513dc4f20d7673c67ce2c3fed3efc | /hw_sol/Fa18HW5/src/test/java/edu/berkeley/cs186/database/concurrency/TestLockUtil.java | b7c87eb6cd9e8b60757354b9df9c8796f72efa31 | [] | no_license | ultrox/cs186_19 | fb97b06fb36cf41c1231efcb711440bd82e61ed4 | 9f835e58e012a5fa3341f81e35feb52f660a324e | refs/heads/master | 2021-07-10T23:38:52.827014 | 2019-07-15T20:05:50 | 2019-07-15T20:05:50 | 196,753,524 | 5 | 2 | null | 2020-10-13T14:36:05 | 2019-07-13T18:25:18 | Java | UTF-8 | Java | false | false | 3,199 | java | package edu.berkeley.cs186.database.concurrency;
import edu.berkeley.cs186.database.BaseTransaction;
import edu.berkeley.cs186.database.LoggingLockManager;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.DisableOnDebug;
import org.junit.rules.TestRule;
import org.junit.rules.Timeout;
import java.util.Arrays;
import java.util.concurrent.locks.Lock;
import static org.junit.Assert.*;
public class TestLockUtil {
LoggingLockManager lockManager;
BaseTransaction[] transactions;
LockContext dbContext;
LockContext tableContext;
LockContext[] pageContexts;
@Rule
public TestRule globalTimeout = new DisableOnDebug(Timeout.seconds(1));
@Before
public void setUp() {
lockManager = new LoggingLockManager();
transactions = new BaseTransaction[8];
dbContext = lockManager.databaseContext();
tableContext = dbContext.childContext("table1");
pageContexts = new LockContext[8];
for (int i = 0; i < transactions.length; ++i) {
transactions[i] = new DummyTransaction(lockManager, i);
pageContexts[i] = tableContext.childContext((long) i);
}
}
@Test
public void testRequestNullTransaction() {
lockManager.startLog();
LockUtil.requestLocks(null, pageContexts[4], LockType.S);
assertEquals(Arrays.asList(), lockManager.log);
}
@Test
public void testSimpleAcquire() {
lockManager.startLog();
LockUtil.requestLocks(transactions[0], pageContexts[4], LockType.S);
assertEquals(Arrays.asList(
"acquire 0 database IS",
"acquire 0 database/table1 IS",
"acquire 0 database/table1/4 S"
), lockManager.log);
}
@Test
public void testSimplePromote() {
LockUtil.requestLocks(transactions[0], pageContexts[4], LockType.S);
lockManager.startLog();
LockUtil.requestLocks(transactions[0], pageContexts[4], LockType.X);
assertEquals(Arrays.asList(
"promote 0 database IX",
"promote 0 database/table1 IX",
"promote 0 database/table1/4 X"
), lockManager.log);
}
@Test
public void testSimpleEscalate() {
LockUtil.requestLocks(transactions[0], pageContexts[4], LockType.S);
lockManager.startLog();
LockUtil.requestLocks(transactions[0], tableContext, LockType.S);
assertEquals(Arrays.asList(
"acquire/t 0 database/table1 S",
"release/t 0 database/table1",
"release/t 0 database/table1/4"
), lockManager.log);
}
@Test
public void testIXBeforeIS() {
LockUtil.requestLocks(transactions[0], pageContexts[3], LockType.X);
lockManager.startLog();
LockUtil.requestLocks(transactions[0], pageContexts[4], LockType.S);
assertEquals(Arrays.asList(
"acquire 0 database/table1/4 S"
), lockManager.log);
}
}
| [
"crashxx@gmail.com"
] | crashxx@gmail.com |
c8fa3b1f76463fb09fe6af96757859d2201d59e0 | 322994e68e818f7e4aa0d4b8f648c3ddc2231add | /org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/gbl/GridBagRowTest.java | bb321b606dd402813b8c4508c85e22e25e735a7f | [] | no_license | urna/windowbuilder-eclipse | 55e74f075e3eafdd4914d7607965332a815e3a6c | 47e9177ee99229551055602303376566e933b136 | refs/heads/master | 2021-04-15T13:44:13.385372 | 2017-11-24T14:20:56 | 2018-02-21T09:21:00 | 126,906,772 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 17,810 | java | /*******************************************************************************
* Copyright (c) 2011 Google, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Google, Inc. - initial API and implementation
*******************************************************************************/
package org.eclipse.wb.tests.designer.swing.model.layout.gbl;
import org.eclipse.wb.internal.core.utils.execution.ExecutionUtils;
import org.eclipse.wb.internal.core.utils.execution.RunnableEx;
import org.eclipse.wb.internal.swing.model.component.ContainerInfo;
import org.eclipse.wb.internal.swing.model.layout.gbl.GridBagLayoutInfo;
import org.eclipse.wb.internal.swing.model.layout.gbl.RowInfo;
import java.awt.GridBagConstraints;
/**
* Test for {@link RowInfo}.
*
* @author scheglov_ke
*/
public class GridBagRowTest extends AbstractGridBagLayoutTest {
////////////////////////////////////////////////////////////////////////////
//
// getAlignment(), setAlignment()
//
////////////////////////////////////////////////////////////////////////////
/**
* Test for {@link RowInfo#getAlignment()}.<br>
* No components, so unknown alignment.
*/
public void test_getAlignment_1() throws Exception {
ContainerInfo panel =
parseContainer(
"class Test extends JPanel {",
" public Test() {",
" GridBagLayout layout = new GridBagLayout();",
" layout.rowHeights = new int[]{0};",
" setLayout(layout);",
" }",
"}");
panel.refresh();
GridBagLayoutInfo layout = (GridBagLayoutInfo) panel.getLayout();
assertEquals(1, layout.getRows().size());
assertSame(RowInfo.Alignment.UNKNOWN, layout.getRows().get(0).getAlignment());
}
/**
* Test for {@link RowInfo#getAlignment()}.<br>
* Single component with {@link GridBagConstraints#NORTH}, so "top" alignment.
*/
public void test_getAlignment_2() throws Exception {
ContainerInfo panel =
parseContainer(
"class Test extends JPanel {",
" public Test() {",
" GridBagLayout layout = new GridBagLayout();",
" setLayout(layout);",
" {",
" JButton button = new JButton();",
" GridBagConstraints gbc = new GridBagConstraints();",
" gbc.gridx = 0;",
" gbc.gridy = 0;",
" gbc.anchor = GridBagConstraints.NORTH;",
" add(button, gbc);",
" }",
" }",
"}");
panel.refresh();
GridBagLayoutInfo layout = (GridBagLayoutInfo) panel.getLayout();
assertEquals(1, layout.getRows().size());
assertSame(RowInfo.Alignment.TOP, layout.getRows().get(0).getAlignment());
}
/**
* Test for {@link RowInfo#getAlignment()}.<br>
* Two components with different alignments, so "unknown" alignment for {@link RowInfo}.
*/
public void test_getAlignment_3() throws Exception {
ContainerInfo panel =
parseContainer(
"class Test extends JPanel {",
" public Test() {",
" GridBagLayout layout = new GridBagLayout();",
" setLayout(layout);",
" {",
" JButton button = new JButton();",
" GridBagConstraints gbc = new GridBagConstraints();",
" gbc.gridx = 0;",
" gbc.gridy = 0;",
" gbc.anchor = GridBagConstraints.NORTH;",
" add(button, gbc);",
" }",
" {",
" JButton button = new JButton();",
" GridBagConstraints gbc = new GridBagConstraints();",
" gbc.gridx = 1;",
" gbc.gridy = 0;",
" gbc.anchor = GridBagConstraints.SOUTH;",
" add(button, gbc);",
" }",
" }",
"}");
panel.refresh();
GridBagLayoutInfo layout = (GridBagLayoutInfo) panel.getLayout();
// prepare row
RowInfo row;
{
assertEquals(1, layout.getRows().size());
row = layout.getRows().get(0);
}
// no common alignment
assertSame(RowInfo.Alignment.UNKNOWN, row.getAlignment());
// set alignment
row.setAlignment(RowInfo.Alignment.BOTTOM);
assertSame(RowInfo.Alignment.BOTTOM, row.getAlignment());
assertEditor(
"class Test extends JPanel {",
" public Test() {",
" GridBagLayout layout = new GridBagLayout();",
" setLayout(layout);",
" {",
" JButton button = new JButton();",
" GridBagConstraints gbc = new GridBagConstraints();",
" gbc.gridx = 0;",
" gbc.gridy = 0;",
" gbc.anchor = GridBagConstraints.SOUTH;",
" add(button, gbc);",
" }",
" {",
" JButton button = new JButton();",
" GridBagConstraints gbc = new GridBagConstraints();",
" gbc.gridx = 1;",
" gbc.gridy = 0;",
" gbc.anchor = GridBagConstraints.SOUTH;",
" add(button, gbc);",
" }",
" }",
"}");
}
////////////////////////////////////////////////////////////////////////////
//
// DELETE
//
////////////////////////////////////////////////////////////////////////////
/**
* Delete first row, component in next row moved.
*/
public void test_DELETE_1() throws Exception {
ContainerInfo panel =
parseContainer(
"class Test extends JPanel {",
" public Test() {",
" GridBagLayout layout = new GridBagLayout();",
" layout.columnWidths = new int[] {1, 2, 3};",
" layout.rowHeights = new int[] {1, 2, 3};",
" layout.columnWeights = new double[] {0.1, 0.2, Double.MIN_VALUE};",
" layout.rowWeights = new double[] {0.1, 0.2, Double.MIN_VALUE};",
" setLayout(layout);",
" {",
" JButton button_1 = new JButton();",
" GridBagConstraints gbc = new GridBagConstraints();",
" gbc.gridx = 0;",
" gbc.gridy = 0;",
" add(button_1, gbc);",
" }",
" {",
" JButton button_2 = new JButton();",
" GridBagConstraints gbc = new GridBagConstraints();",
" gbc.gridx = 1;",
" gbc.gridy = 1;",
" add(button_2, gbc);",
" }",
" }",
"}");
panel.refresh();
GridBagLayoutInfo layout = (GridBagLayoutInfo) panel.getLayout();
assertEquals(2, layout.getColumns().size());
assertEquals(2, layout.getRows().size());
// do delete
layout.getRowOperations().delete(0);
assertEquals(2, layout.getColumns().size());
assertEquals(1, layout.getRows().size());
assertEditor(
"class Test extends JPanel {",
" public Test() {",
" GridBagLayout layout = new GridBagLayout();",
" layout.columnWidths = new int[] {1, 2, 3};",
" layout.rowHeights = new int[] {2, 3};",
" layout.columnWeights = new double[] {0.1, 0.2, Double.MIN_VALUE};",
" layout.rowWeights = new double[] {0.2, Double.MIN_VALUE};",
" setLayout(layout);",
" {",
" JButton button_2 = new JButton();",
" GridBagConstraints gbc = new GridBagConstraints();",
" gbc.gridx = 1;",
" gbc.gridy = 0;",
" add(button_2, gbc);",
" }",
" }",
"}");
}
/**
* When delete row, height of spanned components may be decreased.
*/
public void test_DELETE_2() throws Exception {
ContainerInfo panel =
parseContainer(
"class Test extends JPanel {",
" public Test() {",
" GridBagLayout layout = new GridBagLayout();",
" layout.columnWidths = new int[] {1, 2, 3};",
" layout.rowHeights = new int[] {1, 2, 3};",
" layout.columnWeights = new double[] {0.1, 0.2, Double.MIN_VALUE};",
" layout.rowWeights = new double[] {0.1, 0.2, Double.MIN_VALUE};",
" setLayout(layout);",
" {",
" JButton button_0 = new JButton();",
" GridBagConstraints gbc = new GridBagConstraints();",
" gbc.insets = new Insets(0, 0, 5, 5);",
" gbc.gridx = 0;",
" gbc.gridy = 0;",
" gbc.gridheight = 2;",
" add(button_0, gbc);",
" }",
" {",
" JButton button_1 = new JButton();",
" GridBagConstraints gbc = new GridBagConstraints();",
" gbc.gridx = 1;",
" gbc.gridy = 1;",
" add(button_1, gbc);",
" }",
" }",
"}");
panel.refresh();
GridBagLayoutInfo layout = (GridBagLayoutInfo) panel.getLayout();
assertEquals(2, layout.getColumns().size());
assertEquals(2, layout.getRows().size());
// do delete
layout.getRowOperations().delete(1);
assertEquals(2, layout.getColumns().size());
assertEquals(1, layout.getRows().size());
assertEditor(
"class Test extends JPanel {",
" public Test() {",
" GridBagLayout layout = new GridBagLayout();",
" layout.columnWidths = new int[] {1, 2, 3};",
" layout.rowHeights = new int[] {1, 3};",
" layout.columnWeights = new double[] {0.1, 0.2, Double.MIN_VALUE};",
" layout.rowWeights = new double[] {0.1, Double.MIN_VALUE};",
" setLayout(layout);",
" {",
" JButton button_0 = new JButton();",
" GridBagConstraints gbc = new GridBagConstraints();",
" gbc.insets = new Insets(0, 0, 0, 5);",
" gbc.gridx = 0;",
" gbc.gridy = 0;",
" add(button_0, gbc);",
" }",
" }",
"}");
}
////////////////////////////////////////////////////////////////////////////
//
// MOVE
//
////////////////////////////////////////////////////////////////////////////
/**
* Move row backward.
*/
public void test_MOVE_backward() throws Exception {
ContainerInfo panel =
parseContainer(
"class Test extends JPanel {",
" public Test() {",
" GridBagLayout layout = new GridBagLayout();",
" layout.columnWidths = new int[] {1, 2, 3, 4};",
" layout.rowHeights = new int[] {1, 2, 3, 4};",
" layout.columnWeights = new double[] {0.1, 0.2, 0.3, Double.MIN_VALUE};",
" layout.rowWeights = new double[] {0.1, 0.2, 0.3, Double.MIN_VALUE};",
" setLayout(layout);",
" {",
" JButton button_0 = new JButton();",
" GridBagConstraints gbc = new GridBagConstraints();",
" gbc.insets = new Insets(0, 0, 5, 5);",
" gbc.gridx = 0;",
" gbc.gridy = 0;",
" add(button_0, gbc);",
" }",
" {",
" JButton button_1 = new JButton();",
" GridBagConstraints gbc = new GridBagConstraints();",
" gbc.insets = new Insets(0, 0, 5, 5);",
" gbc.gridx = 1;",
" gbc.gridy = 1;",
" add(button_1, gbc);",
" }",
" {",
" JButton button_2 = new JButton();",
" GridBagConstraints gbc = new GridBagConstraints();",
" gbc.gridx = 2;",
" gbc.gridy = 2;",
" add(button_2, gbc);",
" }",
" }",
"}");
panel.refresh();
final GridBagLayoutInfo layout = (GridBagLayoutInfo) panel.getLayout();
assertEquals(3, layout.getRows().size());
// do move
ExecutionUtils.run(panel, new RunnableEx() {
public void run() throws Exception {
layout.getRowOperations().move(2, 0);
}
});
assertEquals(3, layout.getRows().size());
assertEditor(
"class Test extends JPanel {",
" public Test() {",
" GridBagLayout layout = new GridBagLayout();",
" layout.columnWidths = new int[] {1, 2, 3, 4};",
" layout.rowHeights = new int[] {3, 1, 2, 4};",
" layout.columnWeights = new double[] {0.1, 0.2, 0.3, Double.MIN_VALUE};",
" layout.rowWeights = new double[] {0.3, 0.1, 0.2, Double.MIN_VALUE};",
" setLayout(layout);",
" {",
" JButton button_2 = new JButton();",
" GridBagConstraints gbc = new GridBagConstraints();",
" gbc.insets = new Insets(0, 0, 5, 0);",
" gbc.gridx = 2;",
" gbc.gridy = 0;",
" add(button_2, gbc);",
" }",
" {",
" JButton button_0 = new JButton();",
" GridBagConstraints gbc = new GridBagConstraints();",
" gbc.insets = new Insets(0, 0, 5, 5);",
" gbc.gridx = 0;",
" gbc.gridy = 1;",
" add(button_0, gbc);",
" }",
" {",
" JButton button_1 = new JButton();",
" GridBagConstraints gbc = new GridBagConstraints();",
" gbc.insets = new Insets(0, 0, 0, 5);",
" gbc.gridx = 1;",
" gbc.gridy = 2;",
" add(button_1, gbc);",
" }",
" }",
"}");
}
/**
* Move row forward.
*/
public void test_MOVE_forward() throws Exception {
ContainerInfo panel =
parseContainer(
"class Test extends JPanel {",
" public Test() {",
" GridBagLayout layout = new GridBagLayout();",
" layout.columnWidths = new int[] {1, 2, 3, 4};",
" layout.rowHeights = new int[] {1, 2, 3, 4};",
" layout.columnWeights = new double[] {0.1, 0.2, 0.3, Double.MIN_VALUE};",
" layout.rowWeights = new double[] {0.1, 0.2, 0.3, Double.MIN_VALUE};",
" setLayout(layout);",
" {",
" JButton button_0 = new JButton();",
" GridBagConstraints gbc = new GridBagConstraints();",
" gbc.insets = new Insets(0, 0, 5, 5);",
" gbc.gridx = 0;",
" gbc.gridy = 0;",
" add(button_0, gbc);",
" }",
" {",
" JButton button_1 = new JButton();",
" GridBagConstraints gbc = new GridBagConstraints();",
" gbc.insets = new Insets(0, 0, 5, 5);",
" gbc.gridx = 1;",
" gbc.gridy = 1;",
" add(button_1, gbc);",
" }",
" {",
" JButton button_2 = new JButton();",
" GridBagConstraints gbc = new GridBagConstraints();",
" gbc.gridx = 2;",
" gbc.gridy = 2;",
" add(button_2, gbc);",
" }",
" }",
"}");
panel.refresh();
final GridBagLayoutInfo layout = (GridBagLayoutInfo) panel.getLayout();
assertEquals(3, layout.getRows().size());
// do move
ExecutionUtils.run(panel, new RunnableEx() {
public void run() throws Exception {
layout.getRowOperations().move(0, 3);
}
});
assertEquals(3, layout.getRows().size());
assertEditor(
"class Test extends JPanel {",
" public Test() {",
" GridBagLayout layout = new GridBagLayout();",
" layout.columnWidths = new int[] {1, 2, 3, 4};",
" layout.rowHeights = new int[] {2, 3, 1, 4};",
" layout.columnWeights = new double[] {0.1, 0.2, 0.3, Double.MIN_VALUE};",
" layout.rowWeights = new double[] {0.2, 0.3, 0.1, Double.MIN_VALUE};",
" setLayout(layout);",
" {",
" JButton button_1 = new JButton();",
" GridBagConstraints gbc = new GridBagConstraints();",
" gbc.insets = new Insets(0, 0, 5, 5);",
" gbc.gridx = 1;",
" gbc.gridy = 0;",
" add(button_1, gbc);",
" }",
" {",
" JButton button_2 = new JButton();",
" GridBagConstraints gbc = new GridBagConstraints();",
" gbc.insets = new Insets(0, 0, 5, 0);",
" gbc.gridx = 2;",
" gbc.gridy = 1;",
" add(button_2, gbc);",
" }",
" {",
" JButton button_0 = new JButton();",
" GridBagConstraints gbc = new GridBagConstraints();",
" gbc.insets = new Insets(0, 0, 0, 5);",
" gbc.gridx = 0;",
" gbc.gridy = 2;",
" add(button_0, gbc);",
" }",
" }",
"}");
}
}
| [
"eclayberg@f1f5f5c2-2e22-11e0-a36a-49c83f4898e7"
] | eclayberg@f1f5f5c2-2e22-11e0-a36a-49c83f4898e7 |
bdac2b96de53658d4183af0aabfb795b8150ab2b | eca4a253fe0eba19f60d28363b10c433c57ab7a1 | /apps/jacob.heccadmin/java/jacob/event/ui/vdn/VdnNewRecordButton.java | e6b8c8001cd3620f713da01f51317337c91524f9 | [] | no_license | freegroup/Open-jACOB | 632f20575092516f449591bf6f251772f599e5fc | 84f0a6af83876bd21c453132ca6f98a46609f1f4 | refs/heads/master | 2021-01-10T11:08:03.604819 | 2015-05-25T10:25:49 | 2015-05-25T10:25:49 | 36,183,560 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,848 | java | /*
* jACOB event handler created with the jACOB Application Designer
*
* Created on Wed Jan 28 16:51:21 CET 2009
*/
package jacob.event.ui.vdn;
import de.tif.jacob.screen.IActionEmitter;
import de.tif.jacob.screen.IClientContext;
import de.tif.jacob.screen.IGuiElement;
import de.tif.jacob.screen.event.IActionButtonEventHandler;
import de.tif.jacob.security.IUser;
import jacob.common.AppLogger;
import org.apache.commons.logging.Log;
import com.hecc.jacob.ldap.Role;
/**
* The event handler for the VdnNewRecordButton new button.<br>
*
* @author R.Spoor
*/
public class VdnNewRecordButton extends IActionButtonEventHandler
{
static public final transient String RCS_ID = "$Id: VdnNewRecordButton.java,v 1.1 2009/02/17 15:23:40 R.Spoor Exp $";
static public final transient String RCS_REV = "$Revision: 1.1 $";
/**
* Use this logger to write messages and NOT the <code>System.out.println(..)</code> ;-)
*/
static private final transient Log logger = AppLogger.getLogger();
/**
* This event handler will be called, if the corresponding button has been pressed.
* You can prevent the execution of the NEW action if you return <code>false</code>.<br>
*
* @param context The current context of the application
* @param button The action button (the emitter of the event)
* @return Return <code>false</code>, if you want to avoid the execution of the action else return <code>true</code>.
*/
@Override
public boolean beforeAction(IClientContext context, IActionEmitter button) throws Exception
{
return true;
}
/**
* This event method will be called, if the NEW action has been successfully executed.<br>
*
* @param context The current context of the application
* @param button The action button (the emitter of the event)
*/
@Override
public void onSuccess(IClientContext context, IGuiElement button)
{
}
/**
* The status of the parent group (TableAlias) has been changed.<br>
* <br>
* This is a good place to enable/disable the button on relation to the
* group state or the selected record.<br>
* <br>
* Possible values for the different states are defined in IGuiElement<br>
* <ul>
* <li>IGuiElement.UPDATE</li>
* <li>IGuiElement.NEW</li>
* <li>IGuiElement.SEARCH</li>
* <li>IGuiElement.SELECTED</li>
* </ul>
*
* @param context The current client context
* @param status The new group state. The group is the parent of the corresponding event button.
* @param button The corresponding button to this event handler
*/
@Override
public void onGroupStatusChanged(IClientContext context, IGuiElement.GroupState status, IGuiElement button) throws Exception
{
IUser user = context.getUser();
if (!user.hasRole(Role.ADMIN.getName()))
{
button.setVisible(false);
}
}
}
| [
"a.herz@freegroup.de"
] | a.herz@freegroup.de |
c419d1fc828f89d222a786ce9df4e45ac1786440 | 6b9559535268d3d933769632b2227aba68794711 | /Leetcode/@基本数据类型与封装类 值传递和引用传递/main.java | df79ba593031b678e3baf47f982af097de18ccb7 | [] | no_license | lobsterllj/LeetCodeAnswer | 8761d97ffc650111ef2b02b96fa6203e5c86031d | 2c06228309984861fefb05d6473fe6bca7559677 | refs/heads/master | 2023-04-11T04:51:47.523677 | 2021-04-17T07:11:41 | 2021-04-17T07:11:41 | 343,424,701 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,927 | java | import java.util.*;
import java.util.stream.Stream;
public class main {
public static void main(String[] args) {
main main = new main();
MyInterface mi = (a, b) -> (int) (b - a);
foo((a, b) -> (int) (b - a));
int[] nums = new int[10];
for (int i = 0; i < 10; ++i) nums[i] = i + 1;
Arrays.stream(nums).filter(a -> a % 2 == 1).filter(a -> a > 5).forEach(a -> System.out.println(a));
List<Integer> list = new LinkedList<>();
int a = 1;
list.add(a);
int b = list.get(0);
String s1 = "abc";
String s2 = "abc";
Integer i1 = 1;
Integer i2 = 1;
Integer i3 = 666;
Integer i4 = 666;
i3 += i4;
//Integer i5 = i3 + i4;
int ii5 = i3.intValue() + i4.intValue();
Integer i5 = new Integer(ii5);
i3 = i5;
System.out.println(i1 == i2); //guess: false
System.out.println(i3 == i4); //guess: false
System.out.println(i1.equals(i2)); //guess: true
System.out.println(i3.equals(i4)); //guess: true
mai();
}
public static void foo(MyInterface a){
}
static void mai(){
int[] arr = new int[3];
edit(arr, 2, 1);
System.out.println(arr[2]);
}
static void edit(int[] arr, int pos, int a){
arr[pos] = a;
}
int cal(int x, int y){
x += 100;
y += 100;
return x + y;
}
// public int[] sortArray(Integer[] nums) {
//// Arrays.sort(nums, (a, b) -> b -a);
// class ComImpl implements Comparator<Integer>{
// @Override
// public int compare(Integer o1, Integer o2){
// return o2 - o1;
// }
// }
// Arrays.sort(nums, new ComImpl());
//
// int[] a=new int[5];
// Arrays.sort(a,new Comparator<>());
//
//
// return null;
// }
}
| [
"1781419859@qq.com"
] | 1781419859@qq.com |
83d71f4a6d3a3d4b530960f4fb65844fab23df63 | 16864e07e1d0e51f44b8d4727504f63012784524 | /app/src/main/java/com/example/bong/rxjava/rxandroiddemo/HomeActivity.java | 6f51dbd0e044eb7744814942e05a294c7cb7a836 | [] | no_license | huangdashun/RxJava | 4b2628fb8794d9c2c837d09c547adaf9c769f8e0 | 8f0594c4b537a7b0f1ca06606f3493f0283fde41 | refs/heads/master | 2021-01-17T04:19:52.003958 | 2017-12-16T08:30:59 | 2017-12-16T08:30:59 | 82,939,782 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,950 | java | package com.example.bong.rxjava.rxandroiddemo;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import com.example.bong.rxjava.R;
import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;
public class HomeActivity extends AppCompatActivity {
private Button mButton;
private ImageView mImg;
String path = "https://ss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/img/logo/bd_logo1_31bdc765.png";
private DownloadUtils utils = new DownloadUtils();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
mButton = (Button) findViewById(R.id.btn);
mImg = (ImageView) findViewById(R.id.img);
initListener();
}
private void initListener() {
mButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
utils.downloadImage(path).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(new Subscriber<byte[]>() {
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
}
@Override
public void onNext(byte[] bytes) {
Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
mImg.setImageBitmap(bitmap);
}
});
}
});
}
}
| [
"406846759@qq.com"
] | 406846759@qq.com |
1d7c2f7bfe4f72072e138cc35450009007fcfda0 | 78cdf57d221ba4282891d2a28239d82f152b8a5d | /taskscheduler-sample/src/main/java/me/passin/taskscheduler/sample/task/TaskL.java | b15c23f0384b24303627cbcb980588d89617f7e9 | [
"Apache-2.0"
] | permissive | passin95/TaskScheduler | c8065aaea3bed89e6eaf4aecd068650160f48776 | 537a34576926873cb0e9c8bc29a521d3f9d1a192 | refs/heads/master | 2020-05-05T08:02:06.030924 | 2019-04-23T01:31:00 | 2019-04-23T01:31:00 | 179,847,597 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,026 | java | package me.passin.taskscheduler.sample.task;
import android.support.annotation.Nullable;
import android.util.Log;
import java.util.List;
import me.passin.taskscheduler.Task;
import me.passin.taskscheduler.TaskScheduler;
import me.passin.taskscheduler.sample.TaskNameConstant;
/**
* @author: zbb 33775
* @date: 2019/4/7 15:20
* @desc:
*/
public class TaskL extends Task {
@Override
public String getTaskName() {
return TaskNameConstant.TASKL;
}
@Nullable
@Override
public List<String> getDependsTaskNames() {
return null;
}
@Override
public void configure() {
Log.i(TaskScheduler.TAG, "configure:" + getTaskName());
}
@Override
public void execute() {
try {
Thread.sleep(80);
} catch (InterruptedException e) {
e.printStackTrace();
}
Log.i(TaskScheduler.TAG, "execute:" + getTaskName() + " Thread:" + Thread.currentThread().getName() + " Sleep"
+ ":80ms");
}
}
| [
"zengbinbinpassin@foxmail.com"
] | zengbinbinpassin@foxmail.com |
43275a9db8e3dbcfbecf22cc73332316f1c054b9 | 56ed91cb0f1586ddfc67bc4fa90868ad49d9cb72 | /src/main/java/org/projectlarp/test/cucumber/CucumberHookTimeoutFailure.java | ec20498ca6cc3b563c8b5237536410da945f7b25 | [] | no_license | ProjectLarpOrg/project-larp-test | e44c83cc2dd01cfdde8b2c3a9c0222280f161bc6 | d7d2858d37dd5bff0c20b3d9b3ee19b90fd2ba34 | refs/heads/master | 2021-08-30T15:11:43.886550 | 2017-12-18T11:54:57 | 2017-12-18T11:54:57 | 114,029,353 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 579 | java | package org.projectlarp.test.cucumber;
import static org.assertj.core.api.Assertions.assertThat;
import org.joda.time.Duration;
import org.joda.time.Instant;
import cucumber.api.java.en.Then;
public class CucumberHookTimeoutFailure {
private Instant t1 = Instant.now();
@Deprecated
@Then("test duration should be less than (\\d+) seconds")
public void test_duration(Integer expected) {
Instant t2 = Instant.now();
Duration duration = new Duration(t1.getMillis(), t2.getMillis());
long s = duration.getStandardSeconds();
assertThat(s).isLessThan(expected);
}
}
| [
"damien.fremont@gmail.com"
] | damien.fremont@gmail.com |
6df0cea0723e670448a3b978a87c5507bdcda164 | 183971c7803a11320821097129681bf73739ee28 | /src/cardsequence/package-info.java | b5cbf202b6bd9040370f147a98c1ce20bb7c6b13 | [] | no_license | dtanaji75/assignment | 2eb07148d1c885c467681300b084b48b96ab70ca | cccfc23332852a68cb16b022409243d2a737babd | refs/heads/master | 2022-11-09T11:36:11.264170 | 2020-06-26T13:01:41 | 2020-06-26T13:01:41 | 275,156,406 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 21 | java | package cardsequence; | [
"dtanaji75@gmail.com"
] | dtanaji75@gmail.com |
de9bbbf6d15a1823fd63e1dff4d7c2405dfc0f32 | e352c97d847c875a6478436ae1785c168e50dd09 | /POO/projeto/AnaoBarbaLongaTest.java | 1745eb06305efd274362990d6a70dcac8dc6c635 | [] | no_license | marcoshs90/jornada-curso | aaa77f813f92f908c1ec2ef9ce0bb1db00b8685a | 2a3a883d37a13f496e91d6b48ab7b652ec706eba | refs/heads/master | 2023-08-27T23:52:11.840279 | 2021-10-23T19:30:51 | 2021-10-23T19:30:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 712 | java | import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class AnaoBarbaLongaTest {
@Test
public void anaoDevePerderVida33PorCento() {
DadoFalso dado = new DadoFalso();
dado.simularValor(2);
AnaoBarbaLonga anao = new AnaoBarbaLonga( "Balin", dado );
anao.sofrerDano();
assertEquals( 100.0, anao.getVida(), 0.001 );
}
@Test
public void anaoNaoDevePerderVida66PorCento() {
DadoFalso dado = new DadoFalso();
dado.simularValor(3);
AnaoBarbaLonga anao = new AnaoBarbaLonga( "Balin", dado );
anao.sofrerDano();
assertEquals( 110.0, anao.getVida(), 0.001 );
}
}
| [
"contato@comentandocodigo.com.br"
] | contato@comentandocodigo.com.br |
54c739100f6a5919d34754ca7b8525184b5c4efb | fa3e3a8883544c1452439b68593d4a77695290a1 | /src/main/java/com/ara/recipeplanner/dto/MeasureUnitDto.java | 14f226779a4f9acf365f64bd8c2ec701f1385d66 | [
"Apache-2.0"
] | permissive | azrobles/recipe-planner | b152a43b69c2a2b805ed83cbe5a999e85d56c695 | cad9ed868c32faf30866029ac4831a1d7337dbd5 | refs/heads/main | 2023-08-01T01:37:34.054024 | 2021-09-20T07:40:15 | 2021-09-20T07:40:15 | 352,051,393 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 559 | java | package com.ara.recipeplanner.dto;
import java.io.Serializable;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
public class MeasureUnitDto implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
@NotBlank
@Size(min = 1, max = 30)
private String name;
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;
}
}
| [
"kalea_yue@yahoo.es"
] | kalea_yue@yahoo.es |
224e0071030d91de44e90eec60d838b1e6937b77 | 7dda8b79d1e92b8292f551e52784f6005999b601 | /rts/src/ghcvm/runtime/exception/StgException.java | 3bdecffec4348b8c7323d53c7c1fb3edc5017569 | [
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause"
] | permissive | NCrashed/ghcvm | c7597dac654a0123b702292132dd50b806f6dff2 | aa4436758642157dd46dcb21bd0f93ca36bf2f24 | refs/heads/master | 2021-01-13T07:16:51.957825 | 2016-10-21T04:08:00 | 2016-10-21T04:08:00 | 71,643,504 | 0 | 0 | null | 2016-10-22T14:15:44 | 2016-10-22T14:15:44 | null | UTF-8 | Java | false | false | 8,820 | java | package ghcvm.runtime.exception;
import java.util.ListIterator;
import ghcvm.runtime.stg.Stg;
import ghcvm.runtime.stg.Capability;
import ghcvm.runtime.stg.StgTSO;
import ghcvm.runtime.stg.StackFrame;
import ghcvm.runtime.stg.StgEnter;
import ghcvm.runtime.stg.StgClosure;
import ghcvm.runtime.stg.StgContext;
import ghcvm.runtime.stg.RtsFun;
import ghcvm.runtime.apply.Apply;
import ghcvm.runtime.apply.ApV;
import ghcvm.runtime.message.MessageThrowTo;
import static ghcvm.runtime.stg.StgTSO.TSO_BLOCKEX;
import static ghcvm.runtime.stg.StgTSO.TSO_INTERRUPTIBLE;
import static ghcvm.runtime.stg.StgTSO.WhatNext.ThreadKilled;
import static ghcvm.runtime.stg.StgTSO.WhyBlocked.BlockedOnMsgThrowTo;
public class StgException extends RuntimeException {
@Override
public Throwable fillInStackTrace() {
return null;
}
/* TODO: Should this be volatile/atomic? */
public static boolean noBreakOnException = false;
public static StgException stgReturnException = new StgReturnException();
public static StgException threadYieldException = new ThreadYieldException();
public static StgException stackReloadException = new StackReloadException();
public static RtsFun getMaskingState = new RtsFun() {
@Override
public void enter(StgContext context) {
StgTSO tso = context.currentTSO;
context.I(1, ((tso.hasFlag(TSO_BLOCKEX)? 1: 0) +
(tso.hasFlag(TSO_INTERRUPTIBLE)? 1: 0)));
}
};
public static RtsFun maskAsyncExceptions = new RtsFun() {
@Override
public void enter(StgContext context) {
StgTSO tso = context.currentTSO;
ListIterator<StackFrame> sp = tso.sp;
if (tso.hasFlag(TSO_BLOCKEX)) {
if (!tso.hasFlag(TSO_INTERRUPTIBLE)) {
sp.add(new MaskUninterruptibleFrame());
}
} else {
StackFrame top = tso.stack.peek();
if (top.getClass() == MaskAsyncExceptionsFrame.class) {
sp.previous();
sp.remove();
} else {
sp.add(new UnmaskAsyncExceptionsFrame());
}
}
tso.addFlags(TSO_BLOCKEX | TSO_INTERRUPTIBLE);
/* TODO: Ensure that R1 is preserved */
Apply.ap_v_fast.enter(context);
}
};
public static RtsFun maskUninterruptible = new RtsFun() {
@Override
public void enter(StgContext context) {
StgTSO tso = context.currentTSO;
ListIterator<StackFrame> sp = tso.sp;
if (tso.hasFlag(TSO_BLOCKEX)) {
if (tso.hasFlag(TSO_INTERRUPTIBLE)) {
sp.add(new MaskAsyncExceptionsFrame());
}
} else {
StackFrame top = tso.stack.peek();
if (top.getClass() == MaskUninterruptibleFrame.class) {
sp.previous();
sp.remove();
} else {
sp.add(new UnmaskAsyncExceptionsFrame());
}
}
tso.addFlags(TSO_BLOCKEX);
tso.removeFlags(TSO_INTERRUPTIBLE);
/* TODO: Ensure that R1 is preserved */
Apply.ap_v_fast.enter(context);
}
};
public static RtsFun unmaskAsyncExceptions = new RtsFun() {
@Override
public void enter(StgContext context) {
Capability cap = context.myCapability;
StgTSO tso = context.currentTSO;
StgClosure io = context.R(1);
ListIterator<StackFrame> sp = tso.sp;
if (tso.hasFlag(TSO_BLOCKEX)) {
StackFrame top = tso.stack.peek();
if (top.getClass() == UnmaskAsyncExceptionsFrame.class) {
sp.previous();
sp.remove();
} else {
if (tso.hasFlag(TSO_INTERRUPTIBLE)) {
sp.add(new MaskAsyncExceptionsFrame());
} else {
sp.add(new MaskUninterruptibleFrame());
}
}
tso.removeFlags(TSO_BLOCKEX | TSO_INTERRUPTIBLE);
if (!tso.blockedExceptions.isEmpty()) {
sp.add(new ApV());
sp.add(new StgEnter(io));
boolean performed = cap.maybePerformBlockedException(tso);
if (performed) {
if (tso.whatNext == ThreadKilled) {
Stg.threadFinished.enter(context);
} else {
/* TODO: Verify R1 is conserved on the next
stack reload. */
throw StgException.stackReloadException;
}
} else {
sp.previous();
sp.remove();
sp.previous();
sp.remove();
}
}
}
Apply.ap_v_fast.enter(context);
}
};
public static RtsFun killThread = new RtsFun() {
@Override
public void enter(StgContext context) {
StgTSO target = (StgTSO) context.R(1);
StgTSO tso = context.currentTSO;
if (target == tso) {
killMyself.enter(context);
} else {
StgClosure exception = context.R(2);
Capability cap = context.myCapability;
MessageThrowTo msg = cap.throwTo(tso, target, exception);
if (msg == null) {
return;
} else {
tso.whyBlocked = BlockedOnMsgThrowTo;
tso.blockInfo = msg;
block_throwto.enter(context);
}
}
}
};
public static RtsFun killMyself = new RtsFun() {
@Override
public void enter(StgContext context) {
Capability cap = context.myCapability;
StgTSO tso = context.currentTSO;
StgTSO target = (StgTSO) context.R(1);
StgClosure exception = context.R(2);
cap.throwToSingleThreaded(target, exception);
if (tso.whatNext == ThreadKilled) {
Stg.threadFinished.enter(context);
} else {
throw StgException.stackReloadException;
}
}
};
public static RtsFun catch_ = new RtsFun() {
@Override
public void enter(StgContext context) {
StgClosure handler = context.R(2);
StgTSO tso = context.currentTSO;
ListIterator<StackFrame> sp = tso.sp;
int exceptionsBlocked = tso.showIfFlags(TSO_BLOCKEX | TSO_INTERRUPTIBLE);
sp.add(new StgCatchFrame(exceptionsBlocked, handler));
Apply.ap_v_fast.enter(context);
}
};
public static RtsFun raise = new RtsFun() {
@Override
public void enter(StgContext context) {
Capability cap = context.myCapability;
StgTSO tso = context.currentTSO;
StgClosure exception = context.R(1);
boolean retry = false;
do {
StackFrame frame = cap.raiseExceptionHelper(tso, exception);
retry = frame.doRaise(context, cap, tso, exception);
} while (retry);
}
};
public static RtsFun raiseIO = new RtsFun() {
@Override
public void enter(StgContext context) {
raise.enter(context);
}
};
public static RtsFun block_throwto = new RtsFun() {
@Override
public void enter(StgContext context) {
StgTSO tso = (StgTSO) context.R(1);
StgClosure exception = context.R(2);
tso.sp.add(new BlockThrowToFrame(tso, exception));
MessageThrowTo msg = (MessageThrowTo) tso.blockInfo;
if (msg.isLocked()) {
msg.unlock();
}
throw stgReturnException;
}
};
}
| [
"rahulmutt@gmail.com"
] | rahulmutt@gmail.com |
af5abef8195b5b884452af3f3bf83f3c1b060e1d | 6edab1bf61608c9a3acb84a52bba38149ef55f2a | /repast-admin/src/main/java/com/aaa/repast/admin/framework/config/CaptchaConfig.java | cc1bdc0a23b5409e0f8129f966178346c23cf9d8 | [] | no_license | xiangyang-wang/repast-master | d1218717566087f90d61486608a1acc3b25b8181 | 35af3cc6e1ce74cc0a25077f1973d2121bcca838 | refs/heads/master | 2022-12-23T09:52:10.398850 | 2020-01-08T08:01:37 | 2020-01-08T08:01:37 | 230,433,994 | 1 | 1 | null | 2022-12-06T00:40:00 | 2019-12-27T11:43:43 | JavaScript | UTF-8 | Java | false | false | 4,376 | java | package com.aaa.repast.admin.framework.config;
import com.google.code.kaptcha.impl.DefaultKaptcha;
import com.google.code.kaptcha.util.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.Properties;
/**
* 验证码配置
*
* @author Seven Lee
*/
@Configuration
public class CaptchaConfig
{
@Bean(name = "captchaProducer")
public DefaultKaptcha getKaptchaBean()
{
DefaultKaptcha defaultKaptcha = new DefaultKaptcha();
Properties properties = new Properties();
// 是否有边框 默认为true 我们可以自己设置yes,no
properties.setProperty("kaptcha.border", "yes");
// 边框颜色 默认为Color.BLACK
properties.setProperty("kaptcha.border.color", "105,179,90");
// 验证码文本字符颜色 默认为Color.BLACK
properties.setProperty("kaptcha.textproducer.font.color", "blue");
// 验证码图片宽度 默认为200
properties.setProperty("kaptcha.image.width", "160");
// 验证码图片高度 默认为50
properties.setProperty("kaptcha.image.height", "60");
// 验证码文本字符大小 默认为40
properties.setProperty("kaptcha.textproducer.font.size", "30");
// KAPTCHA_SESSION_KEY
properties.setProperty("kaptcha.session.key", "kaptchaCode");
// 验证码文本字符间距 默认为2
properties.setProperty("kaptcha.textproducer.char.space", "3");
// 验证码文本字符长度 默认为5
properties.setProperty("kaptcha.textproducer.char.length", "5");
// 验证码文本字体样式 默认为new Font("Arial", 1, fontSize), new Font("Courier", 1, fontSize)
properties.setProperty("kaptcha.textproducer.font.names", "Arial,Courier");
// 验证码噪点颜色 默认为Color.BLACK
properties.setProperty("kaptcha.noise.color", "white");
Config config = new Config(properties);
defaultKaptcha.setConfig(config);
return defaultKaptcha;
}
@Bean(name = "captchaProducerMath")
public DefaultKaptcha getKaptchaBeanMath()
{
DefaultKaptcha defaultKaptcha = new DefaultKaptcha();
Properties properties = new Properties();
// 是否有边框 默认为true 我们可以自己设置yes,no
properties.setProperty("kaptcha.border", "yes");
// 边框颜色 默认为Color.BLACK
properties.setProperty("kaptcha.border.color", "105,179,90");
// 验证码文本字符颜色 默认为Color.BLACK
properties.setProperty("kaptcha.textproducer.font.color", "blue");
// 验证码图片宽度 默认为200
properties.setProperty("kaptcha.image.width", "160");
// 验证码图片高度 默认为50
properties.setProperty("kaptcha.image.height", "60");
// 验证码文本字符大小 默认为40
properties.setProperty("kaptcha.textproducer.font.size", "35");
// KAPTCHA_SESSION_KEY
properties.setProperty("kaptcha.session.key", "kaptchaCodeMath");
// 验证码文本生成器
properties.setProperty("kaptcha.textproducer.impl", "com.aaa.repast.admin.framework.config.KaptchaTextCreator");
// 验证码文本字符间距 默认为2
properties.setProperty("kaptcha.textproducer.char.space", "3");
// 验证码文本字符长度 默认为5
properties.setProperty("kaptcha.textproducer.char.length", "6");
// 验证码文本字体样式 默认为new Font("Arial", 1, fontSize), new Font("Courier", 1, fontSize)
properties.setProperty("kaptcha.textproducer.font.names", "Arial,Courier");
// 验证码噪点颜色 默认为Color.BLACK
properties.setProperty("kaptcha.noise.color", "white");
// 干扰实现类
properties.setProperty("kaptcha.noise.impl", "com.google.code.kaptcha.impl.NoNoise");
// 图片样式 水纹com.google.code.kaptcha.impl.WaterRipple 鱼眼com.google.code.kaptcha.impl.FishEyeGimpy 阴影com.google.code.kaptcha.impl.ShadowGimpy
properties.setProperty("kaptcha.obscurificator.impl", "com.google.code.kaptcha.impl.ShadowGimpy");
Config config = new Config(properties);
defaultKaptcha.setConfig(config);
return defaultKaptcha;
}
}
| [
"1356161332@qq.com"
] | 1356161332@qq.com |
7c06cf8ee85668bd4c336067a85ece20990c8a9a | 0e49eee4f85024e0857b77bce1e78030beb47b1f | /src/main/java/com/tencentcloudapi/cat/v20180409/models/GetDailyAvailRatioResponse.java | 3423f0a7fa8df191eedd286faf6faf10a1d571a9 | [
"Apache-2.0"
] | permissive | arbing/tencentcloud-sdk-java | 7b880af16540fac10a785a1bef0d529eec89c525 | c1bdd3f711c92f950ffe15e6506426a8e340a638 | refs/heads/master | 2021-03-31T15:58:36.276205 | 2020-03-18T00:28:16 | 2020-03-18T00:28:16 | 248,117,938 | 1 | 0 | Apache-2.0 | 2020-03-18T02:15:34 | 2020-03-18T02:15:33 | null | UTF-8 | Java | false | false | 8,321 | java | /*
* Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. 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.tencentcloudapi.cat.v20180409.models;
import com.tencentcloudapi.common.AbstractModel;
import com.google.gson.annotations.SerializedName;
import com.google.gson.annotations.Expose;
import java.util.HashMap;
public class GetDailyAvailRatioResponse extends AbstractModel{
/**
* 整体平均可用率
*/
@SerializedName("AvgAvailRatio")
@Expose
private Float AvgAvailRatio;
/**
* 各省份最低可用率
*/
@SerializedName("LowestAvailRatio")
@Expose
private Float LowestAvailRatio;
/**
* 可用率最低的省份
*/
@SerializedName("LowestProvince")
@Expose
private String LowestProvince;
/**
* 分省份的可用率数据
*/
@SerializedName("ProvinceData")
@Expose
private ProvinceDetail [] ProvinceData;
/**
* 国内平均耗时,单位毫秒
*/
@SerializedName("AvgTime")
@Expose
private Float AvgTime;
/**
* 国外平均可用率
*/
@SerializedName("AvgAvailRatio2")
@Expose
private Float AvgAvailRatio2;
/**
* 国外平均耗时,单位毫秒
*/
@SerializedName("AvgTime2")
@Expose
private Float AvgTime2;
/**
* 国外最低可用率
*/
@SerializedName("LowestAvailRatio2")
@Expose
private Float LowestAvailRatio2;
/**
* 国外可用率最低的区域
*/
@SerializedName("LowestProvince2")
@Expose
private String LowestProvince2;
/**
* 国外分区域的可用率数据
*/
@SerializedName("ProvinceData2")
@Expose
private ProvinceDetail [] ProvinceData2;
/**
* 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
*/
@SerializedName("RequestId")
@Expose
private String RequestId;
/**
* Get 整体平均可用率
* @return AvgAvailRatio 整体平均可用率
*/
public Float getAvgAvailRatio() {
return this.AvgAvailRatio;
}
/**
* Set 整体平均可用率
* @param AvgAvailRatio 整体平均可用率
*/
public void setAvgAvailRatio(Float AvgAvailRatio) {
this.AvgAvailRatio = AvgAvailRatio;
}
/**
* Get 各省份最低可用率
* @return LowestAvailRatio 各省份最低可用率
*/
public Float getLowestAvailRatio() {
return this.LowestAvailRatio;
}
/**
* Set 各省份最低可用率
* @param LowestAvailRatio 各省份最低可用率
*/
public void setLowestAvailRatio(Float LowestAvailRatio) {
this.LowestAvailRatio = LowestAvailRatio;
}
/**
* Get 可用率最低的省份
* @return LowestProvince 可用率最低的省份
*/
public String getLowestProvince() {
return this.LowestProvince;
}
/**
* Set 可用率最低的省份
* @param LowestProvince 可用率最低的省份
*/
public void setLowestProvince(String LowestProvince) {
this.LowestProvince = LowestProvince;
}
/**
* Get 分省份的可用率数据
* @return ProvinceData 分省份的可用率数据
*/
public ProvinceDetail [] getProvinceData() {
return this.ProvinceData;
}
/**
* Set 分省份的可用率数据
* @param ProvinceData 分省份的可用率数据
*/
public void setProvinceData(ProvinceDetail [] ProvinceData) {
this.ProvinceData = ProvinceData;
}
/**
* Get 国内平均耗时,单位毫秒
* @return AvgTime 国内平均耗时,单位毫秒
*/
public Float getAvgTime() {
return this.AvgTime;
}
/**
* Set 国内平均耗时,单位毫秒
* @param AvgTime 国内平均耗时,单位毫秒
*/
public void setAvgTime(Float AvgTime) {
this.AvgTime = AvgTime;
}
/**
* Get 国外平均可用率
* @return AvgAvailRatio2 国外平均可用率
*/
public Float getAvgAvailRatio2() {
return this.AvgAvailRatio2;
}
/**
* Set 国外平均可用率
* @param AvgAvailRatio2 国外平均可用率
*/
public void setAvgAvailRatio2(Float AvgAvailRatio2) {
this.AvgAvailRatio2 = AvgAvailRatio2;
}
/**
* Get 国外平均耗时,单位毫秒
* @return AvgTime2 国外平均耗时,单位毫秒
*/
public Float getAvgTime2() {
return this.AvgTime2;
}
/**
* Set 国外平均耗时,单位毫秒
* @param AvgTime2 国外平均耗时,单位毫秒
*/
public void setAvgTime2(Float AvgTime2) {
this.AvgTime2 = AvgTime2;
}
/**
* Get 国外最低可用率
* @return LowestAvailRatio2 国外最低可用率
*/
public Float getLowestAvailRatio2() {
return this.LowestAvailRatio2;
}
/**
* Set 国外最低可用率
* @param LowestAvailRatio2 国外最低可用率
*/
public void setLowestAvailRatio2(Float LowestAvailRatio2) {
this.LowestAvailRatio2 = LowestAvailRatio2;
}
/**
* Get 国外可用率最低的区域
* @return LowestProvince2 国外可用率最低的区域
*/
public String getLowestProvince2() {
return this.LowestProvince2;
}
/**
* Set 国外可用率最低的区域
* @param LowestProvince2 国外可用率最低的区域
*/
public void setLowestProvince2(String LowestProvince2) {
this.LowestProvince2 = LowestProvince2;
}
/**
* Get 国外分区域的可用率数据
* @return ProvinceData2 国外分区域的可用率数据
*/
public ProvinceDetail [] getProvinceData2() {
return this.ProvinceData2;
}
/**
* Set 国外分区域的可用率数据
* @param ProvinceData2 国外分区域的可用率数据
*/
public void setProvinceData2(ProvinceDetail [] ProvinceData2) {
this.ProvinceData2 = ProvinceData2;
}
/**
* Get 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
* @return RequestId 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
*/
public String getRequestId() {
return this.RequestId;
}
/**
* Set 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
* @param RequestId 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
*/
public void setRequestId(String RequestId) {
this.RequestId = RequestId;
}
/**
* Internal implementation, normal users should not use it.
*/
public void toMap(HashMap<String, String> map, String prefix) {
this.setParamSimple(map, prefix + "AvgAvailRatio", this.AvgAvailRatio);
this.setParamSimple(map, prefix + "LowestAvailRatio", this.LowestAvailRatio);
this.setParamSimple(map, prefix + "LowestProvince", this.LowestProvince);
this.setParamArrayObj(map, prefix + "ProvinceData.", this.ProvinceData);
this.setParamSimple(map, prefix + "AvgTime", this.AvgTime);
this.setParamSimple(map, prefix + "AvgAvailRatio2", this.AvgAvailRatio2);
this.setParamSimple(map, prefix + "AvgTime2", this.AvgTime2);
this.setParamSimple(map, prefix + "LowestAvailRatio2", this.LowestAvailRatio2);
this.setParamSimple(map, prefix + "LowestProvince2", this.LowestProvince2);
this.setParamArrayObj(map, prefix + "ProvinceData2.", this.ProvinceData2);
this.setParamSimple(map, prefix + "RequestId", this.RequestId);
}
}
| [
"tencentcloudapi@tencent.com"
] | tencentcloudapi@tencent.com |
5ffb5905fe6bce6ffd3bc624eea7dfeae9ec178e | ce17ccab569b7efde4958dcd5e6030d25567aa7d | /src/main/java/io/github/batman/client/handler/outbound/PublishPromise.java | fd9634407dc6f4c0cc382560a865735ee62591f3 | [
"Apache-2.0"
] | permissive | devilyard/typhoon-mqtt-batman | 7d6e8693dc07a2cef3d256f8e8bda13a8d9f6856 | 4ff1023598ebb48abdd3520dd2077f12e509fd5b | refs/heads/master | 2023-06-06T14:38:24.534502 | 2021-06-25T08:08:12 | 2021-06-25T08:08:12 | 272,942,441 | 0 | 0 | Apache-2.0 | 2021-06-25T08:08:12 | 2020-06-17T10:15:14 | Java | UTF-8 | Java | false | false | 1,036 | java | /*
* Copyright (c) 2019. All rights reserved.
* PublishPromise.java created at 2019-10-08 11:33:12
* This file is for internal use only, it is belong to TYPHOON,
* you cannot redistribute it nor modify it for any purpose.
*/
package io.github.batman.client.handler.outbound;
import io.github.batman.MqttQoS;
import io.github.batman.client.message.MqttMessage;
/**
* @author C.
*/
public interface PublishPromise<Message extends MqttMessage> extends ActionPromise<Message> {
/**
* Returns the topic name of the PUBLISH message.
*
* @return topic name
*/
String getTopicName();
/**
* Returns the mqtt qos level of the PUBLISH message.
*
* @return qos
*/
MqttQoS getQosLevel();
/**
* Returns the packetId of the PUBLISH message.
* <p>For qos 0, -1 will be returned.</p>
*
* @return packetId
*/
int getPacketId();
/**
* Returns the payload of the PUBLISH message.
*
* @return payload
*/
byte[] getPayload();
}
| [
""
] | |
061d1dfd513e11772a192abf586230c16b110d62 | 2c0d3eb4919fffb06590770d6016ede3af2ca723 | /Chapter-12 and 15/src/Task11.java | 538e1370bf749970aeaf27eb94c26427bb1a73a4 | [] | no_license | Hellosakib/Java-Programming | 75e5ad3712dc86dea1a6a44d948d4422e1f0bdbf | 6a64836664f087668b213a3b029cabe06ddbdffe | refs/heads/master | 2020-03-18T20:18:48.486836 | 2018-05-28T21:04:53 | 2018-05-28T21:04:53 | 135,202,435 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,032 | java | import java.io.*;
import java.util.*;
public class Task11 {
public static void main(String[] args) throws FileNotFoundException {
Scanner in = new Scanner(System.in);
System.out.println("Enter a File: ");
File f = new File(in.nextLine()); //Enter the file name that you store your data
if(!f.exists()) {
System.out.println("File Doesn't Exists.");
System.exit(1);
}
int count = 0;
int total = 0;
try (Scanner input = new Scanner(f)) // this line means: it reads data from the file that you store at line 13
{
while(input.hasNext()) {
total += input.nextInt();
count++;
}
}
catch(Exception ex) {
System.out.println("Error !!!!!!!!!! \nPlease Enter the Correct File name and Path.");
System.exit(0);
}
System.out.println("\nFile Name: " + f.getName());
System.out.println("Total scores: " +total);
System.out.println("Average scores: " + (total / count));
in.close();
}
}
| [
"noreply@github.com"
] | noreply@github.com |
862910e3fbc5484843c8ad3b5b861ef7028d643a | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/JetBrains--intellij-community/972b1e10244b389f547ae7432acd9d8ede5a1d54/after/BaseStreamApiMigration.java | 962bca1fcbe9659719210e10aa70ff4f793eee6b | [] | 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 | 5,805 | java | /*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.codeInspection.streamMigration;
import com.intellij.openapi.project.Project;
import com.intellij.psi.*;
import com.intellij.psi.controlFlow.*;
import com.intellij.psi.util.PsiTreeUtil;
import com.siyeh.ig.psiutils.ControlFlowUtils;
import com.siyeh.ig.psiutils.ControlFlowUtils.InitializerUsageStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* @author Tagir Valeev
*/
abstract class BaseStreamApiMigration {
private final boolean myShouldWarn;
private final String myReplacement;
protected BaseStreamApiMigration(boolean shouldWarn, String replacement) {
myShouldWarn = shouldWarn;
myReplacement = replacement;
}
public String getReplacement() {
return myReplacement;
}
abstract PsiElement migrate(@NotNull Project project, @NotNull PsiStatement body, @NotNull TerminalBlock tb);
public boolean isShouldWarn() {
return myShouldWarn;
}
static PsiElement replaceWithOperation(PsiLoopStatement loopStatement,
PsiVariable var,
String streamText,
PsiType expressionType,
OperationReductionMigration.ReductionOperation reductionOperation) {
PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(loopStatement.getProject());
restoreComments(loopStatement, loopStatement.getBody());
InitializerUsageStatus status = ControlFlowUtils.getInitializerUsageStatus(var, loopStatement);
if (status != InitializerUsageStatus.UNKNOWN) {
PsiExpression initializer = var.getInitializer();
if (initializer != null && reductionOperation.getInitializerExpressionRestriction().test(initializer)) {
PsiType type = var.getType();
String replacement = (type.isAssignableFrom(expressionType) ? "" : "(" + type.getCanonicalText() + ") ") + streamText;
return replaceInitializer(loopStatement, var, initializer, replacement, status);
}
}
return loopStatement
.replace(elementFactory.createStatementFromText(var.getName() + reductionOperation.getOperation() + "=" + streamText + ";",
loopStatement));
}
static PsiElement replaceInitializer(PsiLoopStatement loopStatement,
PsiVariable var,
PsiExpression initializer,
String replacement,
InitializerUsageStatus status) {
Project project = loopStatement.getProject();
PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(project);
if (status == ControlFlowUtils.InitializerUsageStatus.DECLARED_JUST_BEFORE) {
initializer.replace(elementFactory.createExpressionFromText(replacement, loopStatement));
removeLoop(loopStatement);
return var;
}
else {
if (status == ControlFlowUtils.InitializerUsageStatus.AT_WANTED_PLACE_ONLY) {
initializer.delete();
}
return
loopStatement.replace(elementFactory.createStatementFromText(var.getName() + " = " + replacement + ";", loopStatement));
}
}
static PsiElement replaceWithFindExtremum(@NotNull PsiLoopStatement loopStatement,
@NotNull PsiVariable extremumHolder,
@NotNull String streamText,
@Nullable PsiVariable keyExtremum) {
PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(loopStatement.getProject());
restoreComments(loopStatement, loopStatement.getBody());
removeLoop(loopStatement);
if(keyExtremum != null) {
keyExtremum.delete(); // TODO check this
}
PsiExpression initializer = extremumHolder.getInitializer();
if(initializer != null) {
PsiExpression streamExpression = elementFactory.createExpressionFromText(streamText, extremumHolder); // TODO cast expression if needed
return initializer.replace(streamExpression);
} else {
return null; // TODO remove extremum holder and create on this place all
}
}
static void restoreComments(PsiLoopStatement loopStatement, PsiStatement body) {
final PsiElement parent = loopStatement.getParent();
for (PsiElement comment : PsiTreeUtil.findChildrenOfType(body, PsiComment.class)) {
parent.addBefore(comment, loopStatement);
}
}
static void removeLoop(@NotNull PsiLoopStatement statement) {
PsiElement parent = statement.getParent();
if (parent instanceof PsiLabeledStatement) {
parent.delete();
}
else {
statement.delete();
}
}
static boolean isReachable(PsiReturnStatement target) {
ControlFlow flow;
try {
flow = ControlFlowFactory.getInstance(target.getProject())
.getControlFlow(target.getParent(), LocalsOrMyInstanceFieldsControlFlowPolicy.getInstance());
}
catch (AnalysisCanceledException e) {
return true;
}
return ControlFlowUtil.isInstructionReachable(flow, flow.getStartOffset(target), 0);
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
ba1944562b985f0a13440475065625e642cc19d7 | c55db8895d64fcf430cad4c99433ff0c0ff5a1b6 | /OpenSourceProject/src/main/java/javacoretech/v2ch06/ProgressBarTest/ProgressBarTest.java | 5785e975d32d26f9771488bc7d38d3dfc79ef5de | [] | no_license | hwp0710/javabread | 388238f687552dd7f27f4c2236275b4a62251398 | 830744e095c99f8a4f4f443e245a1463db09099e | refs/heads/master | 2020-03-27T19:30:47.226558 | 2018-11-16T06:30:37 | 2018-11-16T06:30:37 | 11,274,934 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,639 | java | package javacoretech.v2ch06.ProgressBarTest;
import java.awt.*;
import java.awt.event.*;
import java.util.List;
import javax.swing.*;
/**
* This program demonstrates the use of a progress bar to monitor the progress of a thread.
* @version 1.04 2007-08-01
* @author Cay Horstmann
*/
public class ProgressBarTest
{
public static void main(String[] args)
{
EventQueue.invokeLater(new Runnable()
{
public void run()
{
JFrame frame = new ProgressBarFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
});
}
}
/**
* A frame that contains a button to launch a simulated activity, a progress bar, and a text area
* for the activity output.
*/
class ProgressBarFrame extends JFrame
{
public ProgressBarFrame()
{
setTitle("ProgressBarTest");
setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);
// this text area holds the activity output
textArea = new JTextArea();
// set up panel with button and progress bar
final int MAX = 1000;
JPanel panel = new JPanel();
startButton = new JButton("Start");
progressBar = new JProgressBar(0, MAX);
progressBar.setStringPainted(true);
panel.add(startButton);
panel.add(progressBar);
checkBox = new JCheckBox("indeterminate");
checkBox.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent event)
{
progressBar.setIndeterminate(checkBox.isSelected());
progressBar.setStringPainted(!progressBar.isIndeterminate());
}
});
panel.add(checkBox);
add(new JScrollPane(textArea), BorderLayout.CENTER);
add(panel, BorderLayout.SOUTH);
// set up the button action
startButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent event)
{
startButton.setEnabled(false);
activity = new SimulatedActivity(MAX);
activity.execute();
}
});
}
private JButton startButton;
private JProgressBar progressBar;
private JCheckBox checkBox;
private JTextArea textArea;
private SimulatedActivity activity;
public static final int DEFAULT_WIDTH = 400;
public static final int DEFAULT_HEIGHT = 200;
class SimulatedActivity extends SwingWorker<Void, Integer>
{
/**
* Constructs the simulated activity that increments a counter from 0 to a
* given target.
* @param t the target value of the counter.
*/
public SimulatedActivity(int t)
{
current = 0;
target = t;
}
protected Void doInBackground() throws Exception
{
try
{
while (current < target)
{
Thread.sleep(100);
current++;
publish(current);
}
}
catch (InterruptedException e)
{
}
return null;
}
protected void process(List<Integer> chunks)
{
for (Integer chunk : chunks)
{
textArea.append(chunk + "\n");
progressBar.setValue(chunk);
}
}
protected void done()
{
startButton.setEnabled(true);
}
private int current;
private int target;
}
} | [
"weiping-he@PB1ZGB3.na.odcorp.net"
] | weiping-he@PB1ZGB3.na.odcorp.net |
c4d489df6f52cad2de720d9d31e55a757d63b4b8 | 877f5d612fb0bdfd7d588b2540294c3f75011f3a | /project/src/com/yczc/ssm/pojo/PlayerExample.java | 3758e7c359d6a385d5096fb13021c15620d0e56c | [] | no_license | h657280346/baodanwang | 9e8925cb5e61b8cb7ae58629bbe5bdddc6dac130 | 602ffb12f29e43bef3efc52a1f087ab08795dee4 | refs/heads/master | 2020-03-12T15:33:18.340315 | 2018-04-23T12:03:02 | 2018-04-23T12:03:02 | 130,685,897 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 25,836 | java | package com.yczc.ssm.pojo;
import java.util.ArrayList;
import java.util.List;
public class PlayerExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public PlayerExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(String value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(String value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(String value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(String value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(String value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(String value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdLike(String value) {
addCriterion("id like", value, "id");
return (Criteria) this;
}
public Criteria andIdNotLike(String value) {
addCriterion("id not like", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<String> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<String> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(String value1, String value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(String value1, String value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andOpenidIsNull() {
addCriterion("openid is null");
return (Criteria) this;
}
public Criteria andOpenidIsNotNull() {
addCriterion("openid is not null");
return (Criteria) this;
}
public Criteria andOpenidEqualTo(String value) {
addCriterion("openid =", value, "openid");
return (Criteria) this;
}
public Criteria andOpenidNotEqualTo(String value) {
addCriterion("openid <>", value, "openid");
return (Criteria) this;
}
public Criteria andOpenidGreaterThan(String value) {
addCriterion("openid >", value, "openid");
return (Criteria) this;
}
public Criteria andOpenidGreaterThanOrEqualTo(String value) {
addCriterion("openid >=", value, "openid");
return (Criteria) this;
}
public Criteria andOpenidLessThan(String value) {
addCriterion("openid <", value, "openid");
return (Criteria) this;
}
public Criteria andOpenidLessThanOrEqualTo(String value) {
addCriterion("openid <=", value, "openid");
return (Criteria) this;
}
public Criteria andOpenidLike(String value) {
addCriterion("openid like", value, "openid");
return (Criteria) this;
}
public Criteria andOpenidNotLike(String value) {
addCriterion("openid not like", value, "openid");
return (Criteria) this;
}
public Criteria andOpenidIn(List<String> values) {
addCriterion("openid in", values, "openid");
return (Criteria) this;
}
public Criteria andOpenidNotIn(List<String> values) {
addCriterion("openid not in", values, "openid");
return (Criteria) this;
}
public Criteria andOpenidBetween(String value1, String value2) {
addCriterion("openid between", value1, value2, "openid");
return (Criteria) this;
}
public Criteria andOpenidNotBetween(String value1, String value2) {
addCriterion("openid not between", value1, value2, "openid");
return (Criteria) this;
}
public Criteria andNicknameIsNull() {
addCriterion("nickname is null");
return (Criteria) this;
}
public Criteria andNicknameIsNotNull() {
addCriterion("nickname is not null");
return (Criteria) this;
}
public Criteria andNicknameEqualTo(String value) {
addCriterion("nickname =", value, "nickname");
return (Criteria) this;
}
public Criteria andNicknameNotEqualTo(String value) {
addCriterion("nickname <>", value, "nickname");
return (Criteria) this;
}
public Criteria andNicknameGreaterThan(String value) {
addCriterion("nickname >", value, "nickname");
return (Criteria) this;
}
public Criteria andNicknameGreaterThanOrEqualTo(String value) {
addCriterion("nickname >=", value, "nickname");
return (Criteria) this;
}
public Criteria andNicknameLessThan(String value) {
addCriterion("nickname <", value, "nickname");
return (Criteria) this;
}
public Criteria andNicknameLessThanOrEqualTo(String value) {
addCriterion("nickname <=", value, "nickname");
return (Criteria) this;
}
public Criteria andNicknameLike(String value) {
addCriterion("nickname like", value, "nickname");
return (Criteria) this;
}
public Criteria andNicknameNotLike(String value) {
addCriterion("nickname not like", value, "nickname");
return (Criteria) this;
}
public Criteria andNicknameIn(List<String> values) {
addCriterion("nickname in", values, "nickname");
return (Criteria) this;
}
public Criteria andNicknameNotIn(List<String> values) {
addCriterion("nickname not in", values, "nickname");
return (Criteria) this;
}
public Criteria andNicknameBetween(String value1, String value2) {
addCriterion("nickname between", value1, value2, "nickname");
return (Criteria) this;
}
public Criteria andNicknameNotBetween(String value1, String value2) {
addCriterion("nickname not between", value1, value2, "nickname");
return (Criteria) this;
}
public Criteria andLogourlIsNull() {
addCriterion("logourl is null");
return (Criteria) this;
}
public Criteria andLogourlIsNotNull() {
addCriterion("logourl is not null");
return (Criteria) this;
}
public Criteria andLogourlEqualTo(String value) {
addCriterion("logourl =", value, "logourl");
return (Criteria) this;
}
public Criteria andLogourlNotEqualTo(String value) {
addCriterion("logourl <>", value, "logourl");
return (Criteria) this;
}
public Criteria andLogourlGreaterThan(String value) {
addCriterion("logourl >", value, "logourl");
return (Criteria) this;
}
public Criteria andLogourlGreaterThanOrEqualTo(String value) {
addCriterion("logourl >=", value, "logourl");
return (Criteria) this;
}
public Criteria andLogourlLessThan(String value) {
addCriterion("logourl <", value, "logourl");
return (Criteria) this;
}
public Criteria andLogourlLessThanOrEqualTo(String value) {
addCriterion("logourl <=", value, "logourl");
return (Criteria) this;
}
public Criteria andLogourlLike(String value) {
addCriterion("logourl like", value, "logourl");
return (Criteria) this;
}
public Criteria andLogourlNotLike(String value) {
addCriterion("logourl not like", value, "logourl");
return (Criteria) this;
}
public Criteria andLogourlIn(List<String> values) {
addCriterion("logourl in", values, "logourl");
return (Criteria) this;
}
public Criteria andLogourlNotIn(List<String> values) {
addCriterion("logourl not in", values, "logourl");
return (Criteria) this;
}
public Criteria andLogourlBetween(String value1, String value2) {
addCriterion("logourl between", value1, value2, "logourl");
return (Criteria) this;
}
public Criteria andLogourlNotBetween(String value1, String value2) {
addCriterion("logourl not between", value1, value2, "logourl");
return (Criteria) this;
}
public Criteria andTimeIsNull() {
addCriterion("time is null");
return (Criteria) this;
}
public Criteria andTimeIsNotNull() {
addCriterion("time is not null");
return (Criteria) this;
}
public Criteria andTimeEqualTo(String value) {
addCriterion("time =", value, "time");
return (Criteria) this;
}
public Criteria andTimeNotEqualTo(String value) {
addCriterion("time <>", value, "time");
return (Criteria) this;
}
public Criteria andTimeGreaterThan(String value) {
addCriterion("time >", value, "time");
return (Criteria) this;
}
public Criteria andTimeGreaterThanOrEqualTo(String value) {
addCriterion("time >=", value, "time");
return (Criteria) this;
}
public Criteria andTimeLessThan(String value) {
addCriterion("time <", value, "time");
return (Criteria) this;
}
public Criteria andTimeLessThanOrEqualTo(String value) {
addCriterion("time <=", value, "time");
return (Criteria) this;
}
public Criteria andTimeLike(String value) {
addCriterion("time like", value, "time");
return (Criteria) this;
}
public Criteria andTimeNotLike(String value) {
addCriterion("time not like", value, "time");
return (Criteria) this;
}
public Criteria andTimeIn(List<String> values) {
addCriterion("time in", values, "time");
return (Criteria) this;
}
public Criteria andTimeNotIn(List<String> values) {
addCriterion("time not in", values, "time");
return (Criteria) this;
}
public Criteria andTimeBetween(String value1, String value2) {
addCriterion("time between", value1, value2, "time");
return (Criteria) this;
}
public Criteria andTimeNotBetween(String value1, String value2) {
addCriterion("time not between", value1, value2, "time");
return (Criteria) this;
}
public Criteria andMatchidIsNull() {
addCriterion("matchid is null");
return (Criteria) this;
}
public Criteria andMatchidIsNotNull() {
addCriterion("matchid is not null");
return (Criteria) this;
}
public Criteria andMatchidEqualTo(String value) {
addCriterion("matchid =", value, "matchid");
return (Criteria) this;
}
public Criteria andMatchidNotEqualTo(String value) {
addCriterion("matchid <>", value, "matchid");
return (Criteria) this;
}
public Criteria andMatchidGreaterThan(String value) {
addCriterion("matchid >", value, "matchid");
return (Criteria) this;
}
public Criteria andMatchidGreaterThanOrEqualTo(String value) {
addCriterion("matchid >=", value, "matchid");
return (Criteria) this;
}
public Criteria andMatchidLessThan(String value) {
addCriterion("matchid <", value, "matchid");
return (Criteria) this;
}
public Criteria andMatchidLessThanOrEqualTo(String value) {
addCriterion("matchid <=", value, "matchid");
return (Criteria) this;
}
public Criteria andMatchidLike(String value) {
addCriterion("matchid like", value, "matchid");
return (Criteria) this;
}
public Criteria andMatchidNotLike(String value) {
addCriterion("matchid not like", value, "matchid");
return (Criteria) this;
}
public Criteria andMatchidIn(List<String> values) {
addCriterion("matchid in", values, "matchid");
return (Criteria) this;
}
public Criteria andMatchidNotIn(List<String> values) {
addCriterion("matchid not in", values, "matchid");
return (Criteria) this;
}
public Criteria andMatchidBetween(String value1, String value2) {
addCriterion("matchid between", value1, value2, "matchid");
return (Criteria) this;
}
public Criteria andMatchidNotBetween(String value1, String value2) {
addCriterion("matchid not between", value1, value2, "matchid");
return (Criteria) this;
}
public Criteria andNotesIsNull() {
addCriterion("notes is null");
return (Criteria) this;
}
public Criteria andNotesIsNotNull() {
addCriterion("notes is not null");
return (Criteria) this;
}
public Criteria andNotesEqualTo(String value) {
addCriterion("notes =", value, "notes");
return (Criteria) this;
}
public Criteria andNotesNotEqualTo(String value) {
addCriterion("notes <>", value, "notes");
return (Criteria) this;
}
public Criteria andNotesGreaterThan(String value) {
addCriterion("notes >", value, "notes");
return (Criteria) this;
}
public Criteria andNotesGreaterThanOrEqualTo(String value) {
addCriterion("notes >=", value, "notes");
return (Criteria) this;
}
public Criteria andNotesLessThan(String value) {
addCriterion("notes <", value, "notes");
return (Criteria) this;
}
public Criteria andNotesLessThanOrEqualTo(String value) {
addCriterion("notes <=", value, "notes");
return (Criteria) this;
}
public Criteria andNotesLike(String value) {
addCriterion("notes like", value, "notes");
return (Criteria) this;
}
public Criteria andNotesNotLike(String value) {
addCriterion("notes not like", value, "notes");
return (Criteria) this;
}
public Criteria andNotesIn(List<String> values) {
addCriterion("notes in", values, "notes");
return (Criteria) this;
}
public Criteria andNotesNotIn(List<String> values) {
addCriterion("notes not in", values, "notes");
return (Criteria) this;
}
public Criteria andNotesBetween(String value1, String value2) {
addCriterion("notes between", value1, value2, "notes");
return (Criteria) this;
}
public Criteria andNotesNotBetween(String value1, String value2) {
addCriterion("notes not between", value1, value2, "notes");
return (Criteria) this;
}
public Criteria andIdentityIsNull() {
addCriterion("identity is null");
return (Criteria) this;
}
public Criteria andIdentityIsNotNull() {
addCriterion("identity is not null");
return (Criteria) this;
}
public Criteria andIdentityEqualTo(String value) {
addCriterion("identity =", value, "identity");
return (Criteria) this;
}
public Criteria andIdentityNotEqualTo(String value) {
addCriterion("identity <>", value, "identity");
return (Criteria) this;
}
public Criteria andIdentityGreaterThan(String value) {
addCriterion("identity >", value, "identity");
return (Criteria) this;
}
public Criteria andIdentityGreaterThanOrEqualTo(String value) {
addCriterion("identity >=", value, "identity");
return (Criteria) this;
}
public Criteria andIdentityLessThan(String value) {
addCriterion("identity <", value, "identity");
return (Criteria) this;
}
public Criteria andIdentityLessThanOrEqualTo(String value) {
addCriterion("identity <=", value, "identity");
return (Criteria) this;
}
public Criteria andIdentityLike(String value) {
addCriterion("identity like", value, "identity");
return (Criteria) this;
}
public Criteria andIdentityNotLike(String value) {
addCriterion("identity not like", value, "identity");
return (Criteria) this;
}
public Criteria andIdentityIn(List<String> values) {
addCriterion("identity in", values, "identity");
return (Criteria) this;
}
public Criteria andIdentityNotIn(List<String> values) {
addCriterion("identity not in", values, "identity");
return (Criteria) this;
}
public Criteria andIdentityBetween(String value1, String value2) {
addCriterion("identity between", value1, value2, "identity");
return (Criteria) this;
}
public Criteria andIdentityNotBetween(String value1, String value2) {
addCriterion("identity not between", value1, value2, "identity");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("status is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("status is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(String value) {
addCriterion("status =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(String value) {
addCriterion("status <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(String value) {
addCriterion("status >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(String value) {
addCriterion("status >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(String value) {
addCriterion("status <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(String value) {
addCriterion("status <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLike(String value) {
addCriterion("status like", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotLike(String value) {
addCriterion("status not like", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<String> values) {
addCriterion("status in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<String> values) {
addCriterion("status not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(String value1, String value2) {
addCriterion("status between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(String value1, String value2) {
addCriterion("status not between", value1, value2, "status");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
} | [
"657280346@qq.com"
] | 657280346@qq.com |
bca631c632044a72dc5820e805256b0808b92df8 | 12fb5ed3b6311e2d8ef6de3d986c07f2ad544905 | /src/main/java/spring/bean/core/resolvable/ABService.java | 9ca9f73859af5bdd20f7c2a0bee2d57991d17e79 | [] | no_license | DanielDai0805/springIntegate | 642d33f8c1eff20c8f214f141f9f989eb7df62e0 | a5be38b1493fb154473f392086f61ddb2a99626a | refs/heads/master | 2021-01-10T17:58:32.896627 | 2015-07-01T15:10:29 | 2015-07-01T15:10:29 | 36,805,884 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 189 | java | package spring.bean.core.resolvable;
/**
* Created by ddai on 6/4/2015.
*/
@org.springframework.stereotype.Service
public class ABService implements Service<ABCDClass.A,ABCDClass.B>{
}
| [
"DanielDai0805@gmail.com"
] | DanielDai0805@gmail.com |
a629672a36d9d7c8ba10c7db8b3efea723be3aa7 | 3a505654f37c0a943de830dacea51680c4151133 | /KnowMoreWords/src/com/gini/coign/HowTo.java | 24a7d4fe1a55814eaa5fc2e3dbfdf18b78aa91b4 | [] | no_license | ptdeveloper1/AndroidPrograms | fd0a280a0283107909650e74b4663fabc4e7d31c | 262aab1a9ede6c4d7a14d31b311dcf4230a0e8d2 | refs/heads/master | 2020-03-11T07:00:13.827704 | 2018-04-17T06:42:47 | 2018-04-17T06:42:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 781 | java | package com.gini.coign;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
public class HowTo extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView(R.layout.howto);
Button b=(Button)findViewById(R.id.startb);
b.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent it=new Intent(HowTo.this,MainActivity.class);
startActivity(it);
}
});
}
}
| [
"pravalika.tirumala@outlook.com"
] | pravalika.tirumala@outlook.com |
bf1f84653624ef80585c4ef9b843977e7dfd4033 | 61c1e1c4ca22e48c19c3afb3849fc1807066b0ab | /sz-kernel/sz-common/src/main/java/com/lunz/fin/constant/MdcConstant.java | bc829f157fc21d17dc48eb282dcded0da2e1429b | [] | no_license | Cj951122/sz_cloud_backend | 24605114cc38254fe8e158d26dd4f4b1379e036e | b26766a2e838c279e565eee8dbc1c02c8504b4b5 | refs/heads/master | 2022-10-19T00:55:25.816307 | 2020-06-15T01:12:20 | 2020-06-15T01:12:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 542 | java | package com.lunz.fin.constant;
/**
* Slf4j MDC常量
*/
public class MdcConstant {
/**
* trace_id
*/
public static final String TRACE_ID= "trace_id";
/**
* baseInfo
*/
public static final String BASEINFO = "base_info";
/**
* clientId
*/
public static final String CLIENTID = "client_id";
/**
* Redis loginmodel key
*/
public static final String LOGINMODEL_KEY="LOGINMODEL_KEY";
/**
* appKey
*/
public static final String APPKEY = "app_key";
}
| [
"zhaoyue@e-trans.com"
] | zhaoyue@e-trans.com |
214c8956dc1906afcd6ac70f6ac87097293629e0 | ed865190ed878874174df0493b4268fccb636a29 | /PuridiomGraphs/src/org/jfree/chart/demo/servlet/NoDataException.java | 0774c9443feb0112f70024475ab8bd3c847325a5 | [] | no_license | zach-hu/srr_java8 | 6841936eda9fdcc2e8185b85b4a524b509ea4b1b | 9b6096ba76e54da3fe7eba70989978edb5a33d8e | refs/heads/master | 2021-01-10T00:57:42.107554 | 2015-11-06T14:12:56 | 2015-11-06T14:12:56 | 45,641,885 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 512 | java | /*
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* ---------------------------
* NoDataException.java
* ---------------------------
* (C) Copyright 2002-2004, by Richard Atkinson.
*
* Original Author: Richard Atkinson;
*/
package org.jfree.chart.demo.servlet;
public class NoDataException extends Exception {
public NoDataException() {
super();
}
} | [
"brickerz@9227675a-84a3-4efe-bc6c-d7b3a3cf6466"
] | brickerz@9227675a-84a3-4efe-bc6c-d7b3a3cf6466 |
1b1ba4a2461ab230de0d2ba9bc6c9c9bc9b46432 | 238fc6aac6d8f395087af2366d8542d0e3367ad1 | /ProyectoDiseño2/src/Controller/EscribirXML.java | d68591feb50664b58b79304de3693a9852639aa2 | [] | no_license | and951/Proyecto-Dise-o-2 | 603b7a40689a6aa99a609dc2e1c098efade8ee63 | 6b38f706dc55da8dea87ca37a86c5c081893e5f0 | refs/heads/master | 2021-01-09T20:26:53.728627 | 2016-06-15T05:52:14 | 2016-06-15T05:52:14 | 60,926,888 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 500 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Controller;
/**
*
* @author Andres
*/
public class EscribirXML implements EscribirArchivo{
@Override
public void Escribir() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
}
| [
"Andres@Andy-PC.Home"
] | Andres@Andy-PC.Home |
6b9ca1bb4e82cc1eb7d26aab786df65d94d619a8 | 182e2061ae7e36ce4c6ffacb71b2fdf4c6f01a01 | /common/src/main/java/com/topjet/common/utils/PopupAlphaAnimatorUtil.java | cb534ba2b068fa683010b14cc331abf130b633c9 | [] | no_license | yygood1000/ph_project | 6e7918cde4aa18b30a935981c99a5f63d231ebdd | 7f0454240dec6fd308faf7192b96f5b90ae462c8 | refs/heads/master | 2020-04-05T04:02:42.515525 | 2018-11-07T11:24:38 | 2018-11-07T11:24:38 | 156,535,754 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,743 | java | package com.topjet.common.utils;
import android.animation.ValueAnimator;
import android.app.Activity;
import android.view.Window;
import android.view.WindowManager;
import com.topjet.common.R;
/**
* Created by tsj-004 on 2017/9/3.
* popupwindow渐变动画类
*/
public class PopupAlphaAnimatorUtil {
private static float MIN_ALPHA = 0.4f;
/**
* 背景透明度渐变动画
* tsj-004 2017年8月10日 22:23:49
*/
public static void setAlphaAnim(Activity activity, float startValue, float toValue)
{
final Window activityWindow = activity.getWindow();
final WindowManager.LayoutParams lp = activityWindow.getAttributes();
ValueAnimator valueAnimator = ValueAnimator.ofFloat(startValue, toValue);
int duration = activity.getResources().getInteger(R.integer.activity_animation_time);
valueAnimator.setDuration(duration);
valueAnimator.setRepeatCount(0);
valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
lp.alpha = (float)animation.getAnimatedValue();
activityWindow.addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
activityWindow.setAttributes(lp);
}
});
valueAnimator.start();
}
/**
* 进入动画--透明色变成MIN_ALPHA
*/
public static void setInAlphaAnim(Activity activity)
{
setAlphaAnim(activity, 1.0f, MIN_ALPHA);
}
/**
* 退出动画--透明色MIN_ALPHA变成1.0
*/
public static void setOutAlphaAnim(Activity activity)
{
setAlphaAnim(activity, MIN_ALPHA, 1.0f);
}
}
| [
"yygood1000@163.com"
] | yygood1000@163.com |
7e187ac26ab3378551d2a47d589ccddec4b8fec7 | 58dd6ddfc41208ca610ff0b02515fa43081e8456 | /Java/Exercices/workspaces/smells-mf-longmethod-start/src/main/java/zenika/smells/mf/longmethod/exo2/lib/DomSnippet.java | 17797206e9c49745977f5407e422e9d0659746fb | [] | no_license | yanncourtel/CleanCode-katas | 331f3e1d44614fcc25635014fb9f21624b99d29d | f1eba786352a4556781c6fe49197821970820d3b | refs/heads/main | 2023-06-21T18:57:22.025990 | 2021-07-19T06:47:09 | 2021-07-19T06:47:09 | 386,553,907 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 322 | java | package zenika.smells.mf.longmethod.exo2.lib;
import java.util.List;
public class DomSnippet {
public static Object NullSnippet;
public DomSnippet(List<DomNode> childNodes) {
}
public void addNode(DomSnippet domSnippet) {
}
public void addChild(Object nullSnippet) {
}
}
| [
"yann.courtel@ext.cdiscount.com"
] | yann.courtel@ext.cdiscount.com |
d1609a12126f1072b27e5e72da7bf7667c824e32 | 1ee2d2ff81cc5f4dbd45964184f21d03bf4b56cb | /vitro-core/webapp/src/edu/cornell/mannlib/vitro/webapp/auth/requestedAction/propstmt/EditDataPropStmt.java | 1f54c3f8bfdefdf076989d68ff4cf9388e1f3560 | [] | no_license | arockwell/vivoweb_ufl_mods | d689e0e467c64e5b349f04485f412fb0ec151442 | e5a1e9d15f47e85e48604544bead10814f2a11e3 | refs/heads/master | 2021-03-12T23:00:19.435131 | 2011-06-28T14:43:35 | 2011-06-28T14:46:15 | 859,154 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,543 | java | /*
Copyright (c) 2011, Cornell University
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of Cornell University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt;
import edu.cornell.mannlib.vitro.webapp.auth.identifier.IdentifierBundle;
import edu.cornell.mannlib.vitro.webapp.auth.policy.ifaces.PolicyDecision;
import edu.cornell.mannlib.vitro.webapp.auth.policy.ifaces.VisitingPolicyIface;
import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement;
public class EditDataPropStmt extends AbstractDataPropertyAction {
private final DataPropertyStatement dataPropStmt;
public EditDataPropStmt(DataPropertyStatement dps){
super(dps.getIndividualURI(), dps.getDatapropURI());
this.dataPropStmt = dps;
}
@Override
public PolicyDecision accept(VisitingPolicyIface policy, IdentifierBundle whoToAuth) {
return policy.visit(whoToAuth,this);
}
public String data(){ return dataPropStmt.getData(); }
public String lang(){ return dataPropStmt.getLanguage(); }
public String datatype(){return dataPropStmt.getDatatypeURI(); }
}
| [
"alexhr@ufl.edu"
] | alexhr@ufl.edu |
2cdae3ef10f6578925174bb833301ce75e07e92c | fc8c70cf99815d5de1079fe2e0873d0ecb0d6fe4 | /src/main/java/com/myhome/myhome/exception/CustomizeErrorCode.java | fb7c12770088fba914e3cbe2c4ecc4467c159a75 | [] | no_license | whathes/myhome | 2cdd8f3347381e9fd6bfadb96c3b1c5437217bb2 | 2e2e5ea28bff86ffdb0db6654082231a69182676 | refs/heads/master | 2022-06-22T02:08:23.874097 | 2019-09-14T07:55:31 | 2019-09-14T07:55:31 | 203,315,199 | 1 | 0 | null | 2022-06-17T02:24:42 | 2019-08-20T06:39:20 | Java | UTF-8 | Java | false | false | 801 | java | package com.myhome.myhome.exception;
public enum CustomizeErrorCode implements ICustomizeErrorCode{
QUESTION_NOT_FOUND(2001,"该问题不存在or已被删除!"),
TARGET_PARAM_NOT_FOUND(2002,"未选中问题或评论!"),
NO_LOGIN(2003,"未登录,不能评论!"),
COMMENT_NOT_FOUND(2004,"评论未找到,请重试!" ),
SYS_ERROR(2005,"系统错误,请重试!" ),
COMMENT_IS_EMPTY(2006,"回复不能为空!请重试!" )
;
private String message;
private Integer code;
CustomizeErrorCode(Integer code,String message) {
this.code = code;
this.message = message;
}
@Override
public String getMessage() {
return message;
}
@Override
public Integer getCode() {
return code;
}
}
| [
"1563124347@qq.com"
] | 1563124347@qq.com |
992beecc159296be2e25f85c67e32decb8c4a2ce | 66bb0143cb7a836a81f99d03e75a6468cecfd1b1 | /app/controllers/Accounts.java | a64986447b4e80272f9b2423bc7915769a5231cd | [] | no_license | cathalduffy/weathertop-versioned | 953511cf27b943cf9ad895282c2d5c838d6f651c | cd04394f447832e5977c4954adff873fb91d62d9 | refs/heads/master | 2023-05-09T01:38:45.262399 | 2021-05-22T23:35:29 | 2021-05-22T23:35:29 | 367,002,608 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,616 | java | package controllers;
import models.Member;
import play.Logger;
import play.mvc.Controller;
public class Accounts extends Controller {
public static void signup() {
render("signup.html");
}
public static void login() {
render("login.html");
}
public static void register(String firstname, String lastname, String email, String password) //signing up for an account
{
Logger.info("Registering new user " + email);
Member member = new Member(firstname, lastname, email, password);
member.save();
redirect("/");
}
public static void authenticate(String email, String password) //authenticating if the account is valid
{
Logger.info("Attempting to authenticate with " + email + ":" + password);
Member member = Member.findByEmail(email);
if ((member != null) && (member.checkPassword(password) == true)) {
Logger.info("Authentication successful");
session.put("logged_in_Memberid", member.id);
redirect("/dashboard");
} else {
Logger.info("Authentication failed");
redirect("/login");
}
}
public static Member getLoggedInMember() {
Member member = null;
if (session.contains("logged_in_Memberid")) {
String memberId = session.get("logged_in_Memberid");
member = Member.findById(Long.parseLong(memberId));
} else {
login();
}
return member;
}
public static void logout() {
session.clear();
redirect("/");
}
}
| [
"cathalduffy89@gmail.com"
] | cathalduffy89@gmail.com |
aa745d98a55f45f2730f644f08a3941935038e8e | 3c2a88fdb5acc08e2214de772f0a8251f0bf52ae | /1st ANDROID PROJECT/app/src/main/java/Network/NetWorkInsert.java | df60acf092bc4e9c40319edc39282947e269a2cd | [] | no_license | hyj21028/ANDROID_PROJECT | 6f8808d1bf515072bbfa5c0b5912cb38b387dd66 | e7fabd6304c2077e40cf939c06d63bdea3ddedab | refs/heads/master | 2020-07-15T19:34:35.198086 | 2019-09-01T11:04:30 | 2019-09-01T11:04:30 | 205,634,698 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,747 | java | package Network;
import android.os.AsyncTask;
import com.example.dbinterlockandroid.Custom_Adapter;
import org.json.JSONException;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
public class NetWorkInsert extends AsyncTask<String, Void, String> {
private URL Url;
private String URL_Address = "http://192.168.0.76:8080/0620/testDB_insert.jsp";
private Custom_Adapter adapter;
public NetWorkInsert(Custom_Adapter adapter){this.adapter =adapter;}
@Override
protected void onPreExecute() {
super.onPreExecute();
}
@Override
protected String doInBackground(String... strings) {
String res = "";
try {
Url = new URL(URL_Address);
HttpURLConnection conn = (HttpURLConnection) Url.openConnection();
conn.setDefaultUseCaches(false);
conn.setDoInput(true);
conn.setDoOutput(true);
conn.setRequestMethod("POST");
//content-type 설정
conn.setRequestProperty("Content-type","application/x-www-form-urlencoded; charset=utf-8");
StringBuffer buffer = new StringBuffer();
buffer.append("id").append("=").append(strings[0]);
buffer.append("&name").append("=").append(strings[1]);
buffer.append("&phone").append("=").append(strings[2]);
buffer.append("&grade").append("=").append(strings[3]);
//서버전송
OutputStreamWriter outStream = new OutputStreamWriter(conn.getOutputStream(), "utf-8");
PrintWriter writer = new PrintWriter(outStream);
writer.write(buffer.toString());
writer.flush();
StringBuilder builder = new StringBuilder();
BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream(),"utf-8"));
String line;
while ((line = in.readLine())!=null){
builder.append(line + "\n");
}
res = builder.toString();
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return res;
}
@Override
protected void onPostExecute(String s) {
super.onPostExecute(s);
int res = 0;
try{
res =JasonParser.getResultJson(s);
} catch (JSONException e) {
e.printStackTrace();
}
if (res == 0) {
}else{
new NetWorkGet(adapter).execute("");
}
}
}
| [
"hyj21028@gmail.com"
] | hyj21028@gmail.com |
57f5bbaa8cbc98b4b354f2ca47d348bbf77a96b0 | f4477d0e6e6a78157733206ed3116bcf6c3f4bd7 | /Engine.java | 97147f3d1efe955f02ee0240456c43575b06df9a | [] | no_license | dat17v1/23_ExerciseBuildaCarwithanEngine | cdd8d84fce4cb89165829b070d129ff6452c9c02 | bd5103411ffa661d1ed22d5d8020beddcdebfb3f | refs/heads/master | 2020-05-23T09:55:51.595072 | 2017-03-12T22:25:27 | 2017-03-12T22:25:27 | 84,761,069 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 314 | java | public class Engine {
private double size;
private String code;
private int horsepower;
public Engine(double eS, String eC, int hp) {
size = eS;
code = eC;
horsepower = hp;
}
public String toString() {
return "Size: " + size + ", code: " + code +
", horse: " + horsepower;
}
} | [
"ckirschberg@gmail.com"
] | ckirschberg@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.