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
2e70b93510e6452afcc53f2bd8b41b7ed75ae119
ae5eb1a38b4d22c82dfd67c86db73592094edc4b
/project463/src/test/java/org/gradle/test/performance/largejavamultiproject/project463/p2317/Test46356.java
9eb7ff0f3b4a8616d889263c3718182c334ee57b
[]
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,182
java
package org.gradle.test.performance.largejavamultiproject.project463.p2317; import org.junit.Test; import static org.junit.Assert.*; public class Test46356 { Production46356 objectUnderTest = new Production46356(); @Test public void testProperty0() { Production46353 value = new Production46353(); objectUnderTest.setProperty0(value); assertEquals(value, objectUnderTest.getProperty0()); } @Test public void testProperty1() { Production46354 value = new Production46354(); objectUnderTest.setProperty1(value); assertEquals(value, objectUnderTest.getProperty1()); } @Test public void testProperty2() { Production46355 value = new Production46355(); 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
3ab2876589aac06d466896f2883085dab3e0d266
189df230213c20e6d63ee16399e623854517f9f8
/ikoda-utils/src/main/java/ikoda/utils/AdministrationPropertiesSingleton.java
e549c18db952f5a606e11951ca531aac066d4d6b
[]
no_license
amerywu/text_repo
00518cb1babb09a2a0be0b94a15b7d5ec3ac58b0
72f0862244b3029feb6d874efb08683d88518475
refs/heads/master
2022-12-22T01:24:01.823736
2019-09-07T19:05:38
2019-09-07T19:05:38
204,588,537
0
0
null
2022-12-16T02:36:13
2019-08-27T00:53:10
Java
UTF-8
Java
false
false
1,311
java
package ikoda.utils; import java.io.InputStream; import java.util.Properties; /*** * Properties management utility * @author jake * */ public class AdministrationPropertiesSingleton { private static AdministrationPropertiesSingleton businessProperties; public static AdministrationPropertiesSingleton getInstance() throws Exception { if (null == businessProperties) { businessProperties = new AdministrationPropertiesSingleton(); } return businessProperties; } private final Properties properties = new Properties(); private AdministrationPropertiesSingleton() throws Exception { try { initializeProperties(); } catch (Exception e) { SSm.getAppLogger().error("\n\n\n\n\n FAILED TO LOAD PROPERTIES: \n\n\n\n\n\n", e); throw new Exception(e.getMessage()); } } public String getPropertyValue(String key) { return properties.getProperty(key); } private void initializeProperties() throws Exception { try { InputStream stream = this.getClass().getResourceAsStream("/administration.properties"); if (null == stream) { throw new Exception("Cannot load business.properties"); } properties.load(stream); } catch (Exception e) { SSm.getAppLogger().error(e.getMessage(), e); throw new Exception(e); } } }
[ "jake@jakestone.net" ]
jake@jakestone.net
b7666b390255e9a9c0575bbb8b15301df07fa5fb
8b0ae134884d6f84217587194a2a0f775866ef55
/Vivo_y93/src/main/java/android/view/animation/Animation.java
35878d1f28e6850a12087e665c1b6bfea66a15b6
[]
no_license
wanbing/VivoFramework
69032750f376178d27d0d1ac170cf89bba907cc7
8d31381ecc788afb023960535bafbfa3b7df7d9b
refs/heads/master
2023-05-11T16:57:04.582985
2019-02-27T04:43:44
2019-02-27T04:43:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
18,133
java
package android.view.animation; import android.content.Context; import android.content.res.TypedArray; import android.graphics.RectF; import android.os.Handler; import android.os.SystemProperties; import android.util.AttributeSet; import android.util.BoostFramework; import android.util.TypedValue; import com.android.internal.R; import dalvik.system.CloseGuard; public abstract class Animation implements Cloneable { public static final int ABSOLUTE = 0; public static final int INFINITE = -1; public static final int RELATIVE_TO_PARENT = 2; public static final int RELATIVE_TO_SELF = 1; public static final int RESTART = 1; public static final int REVERSE = 2; public static final int START_ON_FIRST_FRAME = -1; public static final int ZORDER_BOTTOM = -1; public static final int ZORDER_NORMAL = 0; public static final int ZORDER_TOP = 1; private final CloseGuard guard = CloseGuard.get(); private int mBackgroundColor; boolean mCycleFlip = false; private boolean mDetachWallpaper = false; long mDuration; boolean mEnded = false; boolean mFillAfter = false; boolean mFillBefore = true; boolean mFillEnabled = false; private boolean mInitedPreDraw = false; boolean mInitialized = false; Interpolator mInterpolator; AnimationListener mListener; private Handler mListenerHandler; private boolean mMore = true; private Runnable mOnEnd; private Runnable mOnRepeat; private Runnable mOnStart; private boolean mOneMoreTime = true; private BoostFramework mPerf = new BoostFramework(); private int mPerfDuration; RectF mPreviousRegion = new RectF(); Transformation mPreviousTransformation = new Transformation(); RectF mRegion = new RectF(); int mRepeatCount = 0; int mRepeatMode = 1; int mRepeated = 0; private float mScaleFactor = 1.0f; long mStartOffset; long mStartTime = -1; boolean mStarted = false; Transformation mTransformation = new Transformation(); private int mZAdjustment; public interface AnimationListener { void onAnimationEnd(Animation animation); void onAnimationRepeat(Animation animation); void onAnimationStart(Animation animation); } protected static class Description { public int type; public float value; protected Description() { } static Description parseValue(TypedValue value) { int i = 1; Description d = new Description(); if (value == null) { d.type = 0; d.value = 0.0f; } else if (value.type == 6) { if ((value.data & 15) == 1) { i = 2; } d.type = i; d.value = TypedValue.complexToFloat(value.data); return d; } else if (value.type == 4) { d.type = 0; d.value = value.getFloat(); return d; } else if (value.type >= 16 && value.type <= 31) { d.type = 0; d.value = (float) value.data; return d; } d.type = 0; d.value = 0.0f; return d; } } private static class NoImagePreloadHolder { public static final boolean USE_CLOSEGUARD = SystemProperties.getBoolean("log.closeguard.Animation", false); private NoImagePreloadHolder() { } } public Animation() { ensureInterpolator(); } public Animation(Context context, AttributeSet attrs) { TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.Animation); setDuration((long) a.getInt(2, 0)); setStartOffset((long) a.getInt(5, 0)); setFillEnabled(a.getBoolean(9, this.mFillEnabled)); setFillBefore(a.getBoolean(3, this.mFillBefore)); setFillAfter(a.getBoolean(4, this.mFillAfter)); setRepeatCount(a.getInt(6, this.mRepeatCount)); setRepeatMode(a.getInt(7, 1)); setZAdjustment(a.getInt(8, 0)); setBackgroundColor(a.getInt(0, 0)); setDetachWallpaper(a.getBoolean(10, false)); int resID = a.getResourceId(1, 0); a.recycle(); if (resID > 0) { setInterpolator(context, resID); } ensureInterpolator(); } protected Animation clone() throws CloneNotSupportedException { Animation animation = (Animation) super.clone(); animation.mPreviousRegion = new RectF(); animation.mRegion = new RectF(); animation.mTransformation = new Transformation(); animation.mPreviousTransformation = new Transformation(); return animation; } public void reset() { this.mPreviousRegion.setEmpty(); this.mPreviousTransformation.clear(); this.mInitialized = false; this.mCycleFlip = false; this.mRepeated = 0; this.mMore = true; this.mOneMoreTime = true; this.mListenerHandler = null; this.mInitedPreDraw = false; } public void cancel() { if (this.mStarted && (this.mEnded ^ 1) != 0) { fireAnimationEnd(); this.mEnded = true; this.guard.close(); } this.mStartTime = Long.MIN_VALUE; this.mOneMoreTime = false; this.mMore = false; if (this.mPerf != null) { this.mPerf.perfLockRelease(); } } public void detach() { if (this.mStarted && (this.mEnded ^ 1) != 0) { this.mEnded = true; this.guard.close(); fireAnimationEnd(); } } public boolean isInitialized() { return this.mInitialized; } public void initialize(int width, int height, int parentWidth, int parentHeight) { reset(); this.mInitialized = true; this.mInitedPreDraw = false; } public void setListenerHandler(Handler handler) { if (this.mListenerHandler == null) { this.mOnStart = new Runnable() { public void run() { if (Animation.this.mListener != null) { Animation.this.mListener.onAnimationStart(Animation.this); } } }; this.mOnRepeat = new Runnable() { public void run() { if (Animation.this.mListener != null) { Animation.this.mListener.onAnimationRepeat(Animation.this); } } }; this.mOnEnd = new Runnable() { public void run() { if (Animation.this.mListener != null) { Animation.this.mListener.onAnimationEnd(Animation.this); } } }; } this.mListenerHandler = handler; } public void setInterpolator(Context context, int resID) { setInterpolator(AnimationUtils.loadInterpolator(context, resID)); } public void setInterpolator(Interpolator i) { this.mInterpolator = i; } public void setStartOffset(long startOffset) { this.mStartOffset = startOffset; } public void setDuration(long durationMillis) { if (durationMillis < 0) { throw new IllegalArgumentException("Animation duration cannot be negative"); } this.mDuration = durationMillis; } public void restrictDuration(long durationMillis) { if (this.mStartOffset > durationMillis) { this.mStartOffset = durationMillis; this.mDuration = 0; this.mRepeatCount = 0; return; } long dur = this.mDuration + this.mStartOffset; if (dur > durationMillis) { this.mDuration = durationMillis - this.mStartOffset; dur = durationMillis; } if (this.mDuration <= 0) { this.mDuration = 0; this.mRepeatCount = 0; return; } if (this.mRepeatCount < 0 || ((long) this.mRepeatCount) > durationMillis || ((long) this.mRepeatCount) * dur > durationMillis) { this.mRepeatCount = ((int) (durationMillis / dur)) - 1; if (this.mRepeatCount < 0) { this.mRepeatCount = 0; } } } public void scaleCurrentDuration(float scale) { this.mDuration = (long) (((float) this.mDuration) * scale); this.mStartOffset = (long) (((float) this.mStartOffset) * scale); } public void setStartTime(long startTimeMillis) { this.mStartTime = startTimeMillis; this.mEnded = false; this.mStarted = false; this.mCycleFlip = false; this.mRepeated = 0; this.mMore = true; } public void start() { setStartTime(-1); } public void startNow() { setStartTime(AnimationUtils.currentAnimationTimeMillis()); } public void setRepeatMode(int repeatMode) { this.mRepeatMode = repeatMode; } public void setRepeatCount(int repeatCount) { if (repeatCount < 0) { repeatCount = -1; } this.mRepeatCount = repeatCount; } public boolean isFillEnabled() { return this.mFillEnabled; } public void setFillEnabled(boolean fillEnabled) { this.mFillEnabled = fillEnabled; } public void setFillBefore(boolean fillBefore) { this.mFillBefore = fillBefore; } public void setFillAfter(boolean fillAfter) { this.mFillAfter = fillAfter; } public void setZAdjustment(int zAdjustment) { this.mZAdjustment = zAdjustment; } public void setBackgroundColor(int bg) { this.mBackgroundColor = bg; } protected float getScaleFactor() { return this.mScaleFactor; } public void setDetachWallpaper(boolean detachWallpaper) { this.mDetachWallpaper = detachWallpaper; } public Interpolator getInterpolator() { return this.mInterpolator; } public long getStartTime() { return this.mStartTime; } public long getDuration() { return this.mDuration; } public long getStartOffset() { return this.mStartOffset; } public int getRepeatMode() { return this.mRepeatMode; } public int getRepeatCount() { return this.mRepeatCount; } public boolean getFillBefore() { return this.mFillBefore; } public boolean getFillAfter() { return this.mFillAfter; } public int getZAdjustment() { return this.mZAdjustment; } public int getBackgroundColor() { return this.mBackgroundColor; } public boolean getDetachWallpaper() { return this.mDetachWallpaper; } public boolean willChangeTransformationMatrix() { return true; } public boolean willChangeBounds() { return true; } public void setAnimationListener(AnimationListener listener) { this.mListener = listener; } protected void ensureInterpolator() { if (this.mInterpolator == null) { this.mInterpolator = new AccelerateDecelerateInterpolator(); } } public long computeDurationHint() { return (getStartOffset() + getDuration()) * ((long) (getRepeatCount() + 1)); } public boolean getTransformation(long currentTime, Transformation outTransformation) { if (this.mStartTime == -1) { this.mStartTime = currentTime; } long startOffset = getStartOffset(); long duration = this.mDuration; float normalizedTime = duration != 0 ? ((float) (currentTime - (this.mStartTime + startOffset))) / ((float) duration) : currentTime < this.mStartTime ? 0.0f : 1.0f; int expired = normalizedTime < 1.0f ? isCanceled() : 1; this.mMore = expired ^ 1; if (!this.mFillEnabled) { normalizedTime = Math.max(Math.min(normalizedTime, 1.0f), 0.0f); } if ((normalizedTime >= 0.0f || this.mFillBefore) && (normalizedTime <= 1.0f || this.mFillAfter)) { if (!this.mStarted) { if (this.mPerf != null) { this.mPerfDuration = (int) this.mDuration; if (this.mPerfDuration > 1000) { this.mPerfDuration = 1000; } this.mPerf.perfHint(BoostFramework.VENDOR_HINT_ANIM_BOOST, "", this.mPerfDuration, 2); } fireAnimationStart(); this.mStarted = true; if (NoImagePreloadHolder.USE_CLOSEGUARD) { this.guard.open("cancel or detach or getTransformation"); } } if (this.mFillEnabled) { normalizedTime = Math.max(Math.min(normalizedTime, 1.0f), 0.0f); } if (this.mCycleFlip) { normalizedTime = 1.0f - normalizedTime; } applyTransformation(this.mInterpolator.getInterpolation(normalizedTime), outTransformation); } if (expired != 0) { if (this.mRepeatCount != this.mRepeated && !isCanceled()) { if (this.mRepeatCount > 0) { this.mRepeated++; } if (this.mRepeatMode == 2) { this.mCycleFlip ^= 1; } this.mStartTime = -1; this.mMore = true; fireAnimationRepeat(); } else if (!this.mEnded) { this.mEnded = true; this.guard.close(); fireAnimationEnd(); } } if (this.mMore || !this.mOneMoreTime) { return this.mMore; } this.mOneMoreTime = false; return true; } private boolean isCanceled() { return this.mStartTime == Long.MIN_VALUE; } private void fireAnimationStart() { if (this.mListener == null) { return; } if (this.mListenerHandler == null) { this.mListener.onAnimationStart(this); } else { this.mListenerHandler.postAtFrontOfQueue(this.mOnStart); } } private void fireAnimationRepeat() { if (this.mListener == null) { return; } if (this.mListenerHandler == null) { this.mListener.onAnimationRepeat(this); } else { this.mListenerHandler.postAtFrontOfQueue(this.mOnRepeat); } } private void fireAnimationEnd() { if (this.mPerf != null) { this.mPerf.perfLockRelease(); } if (this.mListener == null) { return; } if (this.mListenerHandler == null) { this.mListener.onAnimationEnd(this); } else { this.mListenerHandler.postAtFrontOfQueue(this.mOnEnd); } } public boolean getTransformation(long currentTime, Transformation outTransformation, float scale) { this.mScaleFactor = scale; return getTransformation(currentTime, outTransformation); } public boolean hasStarted() { return this.mStarted; } public boolean hasEnded() { return this.mEnded; } protected void applyTransformation(float interpolatedTime, Transformation t) { } protected float resolveSize(int type, float value, int size, int parentSize) { switch (type) { case 0: return value; case 1: return ((float) size) * value; case 2: return ((float) parentSize) * value; default: return value; } } public void getInvalidateRegion(int left, int top, int right, int bottom, RectF invalidate, Transformation transformation) { RectF tempRegion = this.mRegion; RectF previousRegion = this.mPreviousRegion; invalidate.set((float) left, (float) top, (float) right, (float) bottom); transformation.getMatrix().mapRect(invalidate); invalidate.inset(-1.0f, -1.0f); tempRegion.set(invalidate); invalidate.union(previousRegion); previousRegion.set(tempRegion); Transformation tempTransformation = this.mTransformation; Transformation previousTransformation = this.mPreviousTransformation; tempTransformation.set(transformation); transformation.set(previousTransformation); previousTransformation.set(tempTransformation); } public void initializeInvalidateRegion(int left, int top, int right, int bottom) { RectF region = this.mPreviousRegion; region.set((float) left, (float) top, (float) right, (float) bottom); region.inset(-1.0f, -1.0f); if (this.mFillBefore) { applyTransformation(this.mInterpolator.getInterpolation(0.0f), this.mPreviousTransformation); } } protected void finalize() throws Throwable { try { if (this.guard != null) { this.guard.warnIfOpen(); } super.finalize(); } catch (Throwable th) { super.finalize(); } } public boolean hasAlpha() { return false; } public void setInitedPreDraw() { this.mInitedPreDraw = true; this.mInitialized = false; } public boolean isInitedPreDraw() { return this.mInitedPreDraw; } public void getTransformationSpecify(Transformation outTransformation, boolean isLastFrame) { if (isLastFrame) { applyTransformation(1.0f, outTransformation); } else { applyTransformation(0.0f, outTransformation); } } public void getTransformationNodraw(long currentTime, Transformation outTransformation) { boolean tmpOneMoreTime = this.mOneMoreTime; getTransformation(currentTime, outTransformation); this.mOneMoreTime = tmpOneMoreTime; } }
[ "lygforbs0@gmail.com" ]
lygforbs0@gmail.com
05665b5e1d0bc526dbec9288c44b55c4f0832a9e
2ec58c7b40287df12a44231fce0ca79411063e39
/MobileOA/src/com/zhjy/iot/mobile/oa/protocol/FileTransInteractProtocol.java
98bee15a4b428362faf4b3c31df1c0c63a3c7ec7
[]
no_license
itsmallsun/working
68b9b2f72033d20e3ac4a64596db6adc03016439
0aa15f8f283bd8e1a5c5e9c3252c024745770d9f
refs/heads/master
2021-01-11T12:25:39.006687
2016-12-01T12:35:27
2016-12-01T12:35:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,693
java
package com.zhjy.iot.mobile.oa.protocol; import org.ksoap2.serialization.SoapObject; import com.zhjy.iot.mobile.oa.Inner.BaseProtocol; import com.zhjy.iot.mobile.oa.entity.FileTransaction; import com.zhjy.iot.mobile.oa.exception.ContentException; import com.zhjy.iot.mobile.oa.exception.JsonParseException; /** * @项目名:MobileOA * @类名称:FileTransInteractProtocol * @类描述:文件传阅中"普通"和重要之间进行互转 * @创建人:zhangyang * @修改人: * @创建时间:2016-4-11下午5:38:09 * @version */ public class FileTransInteractProtocol extends BaseProtocol<FileTransaction> { private String actionName=""; @Override protected FileTransaction parseJson(String jsonStr) throws JsonParseException, ContentException { // TODO Auto-generated method stub return null; } /** * 进行解析内容 */ @Override protected FileTransaction parseJson(SoapObject soapObject) throws JsonParseException, ContentException { System.out.println("FileTransInteractProtocol soapObject toString:"+soapObject.toString()); if(soapObject.hasProperty("status") && soapObject.hasProperty("msg")){ if(soapObject.getProperty("status").toString().equals("1")){ }else{ throw new ContentException(soapObject.getProperty("msg").toString()); } }else{ throw new ContentException("传输数据出错!"); } return null; } /** * @return the actionName */ public String getActionName() { return actionName; } /** * @param actionName the actionName to set */ public void setActionName(String actionName) { this.actionName = actionName; } }
[ "zhangyang520@163.com" ]
zhangyang520@163.com
807d9d6555a5bdbe32e573de4bea935decd5124e
f3c6a07b8154ac31e6b3d81bf8370bcdfaf9c352
/hsweb-easy-orm-rdb/src/test/java/org/hswebframework/ezorm/rdb/Containers.java
f0a33fd68627ce25b326734b720b7d05d94f0f34
[]
no_license
hs-web/hsweb-easy-orm
baf8fbec7b43a091a05499fae1ad6e012dc65cac
8e9c254d932d56332e3c6a4e61978f8cf773d63d
refs/heads/master
2023-08-22T02:08:20.194365
2023-08-11T12:15:07
2023-08-11T12:15:07
60,450,885
287
185
null
2023-09-12T02:36:57
2016-06-05T08:42:02
Java
UTF-8
Java
false
false
2,264
java
package org.hswebframework.ezorm.rdb; import org.testcontainers.containers.GenericContainer; import org.testcontainers.containers.wait.strategy.Wait; import org.testcontainers.utility.DockerImageName; public class Containers { public static GenericContainer<?> newMysql(String version) { return new GenericContainer<>(DockerImageName.parse("mysql:" + System.getProperty("test.mysql.version", version))) .withEnv("TZ", "Asia/Shanghai") .withEnv("MYSQL_ROOT_PASSWORD", "root") .withEnv("MYSQL_DATABASE", "ezorm") .withCommand("--character-set-server=utf8mb4") .withExposedPorts(3306) .waitingFor(Wait.forListeningPort()); // .waitingFor(Wait.forLogMessage(".*ready for connections.*",1)); } public static GenericContainer<?> newPostgresql(String version) { return new GenericContainer<>(DockerImageName.parse("postgres:" + System.getProperty("test.postgres.version", version)) + "-alpine") .withEnv("TZ", "Asia/Shanghai") .withEnv("POSTGRES_PASSWORD", "admin") .withEnv("POSTGRES_DB", "ezorm") .withCommand("postgres", "-c", "max_connections=500") .withExposedPorts(5432) .waitingFor(Wait.forListeningPort()); // .waitingFor(Wait.forLogMessage(".*database system is ready to accept connections.*",1)); } public static GenericContainer<?> newOracle() { return new GenericContainer<>(DockerImageName.parse("iatebes/oracle_11g")) .withEnv("TZ", "Asia/Shanghai") .withExposedPorts(1521) .waitingFor(Wait.forLogMessage(".*opened.*", 1)); } public static GenericContainer<?> newMSSQL() { return new GenericContainer<>(DockerImageName.parse("mcr.microsoft.com/mssql/server:2017-latest-ubuntu")) .withEnv("TZ", "Asia/Shanghai") .withEnv("SA_PASSWORD","ezorm@PasswOrd") .withEnv("ACCEPT_EULA","y") .withEnv("MSSQL_PID","Enterprise") .withExposedPorts(1433) .waitingFor(Wait.forLogMessage(".*Service Broker manager has started.*",1)); } }
[ "zh.sqy@qq.com" ]
zh.sqy@qq.com
00604cf053ac07395888dd05005527d52367cccf
43cc0f8abbe4cee41046b896ceac1b88a10695c8
/mqtt-client-pt/src/main/java/cn/chason678/mqttClientPt/log/Log4jHandler.java
f5ad95947e1c05b19e3b9f773892aa4ad8b2c16a
[]
no_license
chason777777/demo-group
46998fe735f9165a2dc998bdd3bb19f294df3be7
b9f106ed83945b7c2d422978883d55276ff46873
refs/heads/master
2022-11-28T14:32:15.109155
2020-04-15T06:19:08
2020-04-15T06:19:08
220,119,919
0
0
null
2022-11-16T03:39:36
2019-11-07T00:52:21
Java
UTF-8
Java
false
false
1,123
java
package cn.chason678.mqttClientPt.log; import io.vertx.core.eventbus.Message; import org.apache.logging.log4j.Level; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.core.config.Configurator; /** * @author lichao * @version 1.0 * @Description * @date 2019/6/5 */ public class Log4jHandler { private static Logger logger = LogManager.getLogger(Log4jHandler.class); /** * 修改日志级别 * * @param message */ public void updateLogLevel(Message<String> message) { String level = message.body(); logger.info("update log level -> {}", level); switch (level) { case "all": Configurator.setRootLevel(Level.ALL); break; case "info": Configurator.setRootLevel(Level.INFO); break; case "error": Configurator.setRootLevel(Level.ERROR); break; case "debug": Configurator.setRootLevel(Level.DEBUG); break; } } }
[ "lichao@kaadas.com" ]
lichao@kaadas.com
8febd46807e5930fad447807a2b423662aaed957
96c4d3dd2f6c8e3b5d400778157c8f84ccfd3ec9
/app/src/androidTest/java/examples/numberpicker/ApplicationTest.java
9dcc4437b933c6e30793c02d02966741ed60ce13
[]
no_license
taky2/Android-Color-Picker-Assignment
399e47db5328b1853feedc138bb3fb63efe3a09e
3e847b1fd88e663020c189c9984acf202c833c21
refs/heads/master
2021-05-29T20:06:53.437754
2015-09-29T00:19:55
2015-09-29T00:19:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
352
java
package examples.numberpicker; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
[ "ta.kymatica@gmail.com" ]
ta.kymatica@gmail.com
92e605ad98a53d5c32b3ae98a5b7d012c3813aa4
4c9d185af1cbec5fba6c7029741090d15716bc38
/src/PresentacionCliente/Controladores/IControladorIniciarPartida.java
3261029fcfdbbcf87eaea0202c145ae49394abb2
[]
no_license
fysuy/tallerII
a2d35c94ed74d2b79b3f30d9de58b8b12e3e4deb
a0be061c20e8b72feba070124715f8931d9058dd
refs/heads/master
2021-01-22T07:18:12.924802
2014-03-16T00:02:49
2014-03-16T00:02:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
378
java
package PresentacionCliente.Controladores; import java.rmi.Remote; import java.rmi.RemoteException; public interface IControladorIniciarPartida extends Remote { public void IniciarNuevaPartida(String codigoPartida) throws RemoteException; public boolean PartidaYaIniciada(String codigo) throws RemoteException; public boolean HayPartidaIniciada() throws RemoteException; }
[ "uy.sgonzalez@gmail.com" ]
uy.sgonzalez@gmail.com
d0f9d0e909640f3cc6744f5b5c35399e30600c0e
b9ffad7f6ba9f20139e7839a42863cbe3edc923c
/src/com/amazonaws/sns/samples/mobilepush/SNSMobilePush.java
e13ab147f8aa551712f364e82d10884de2799a82
[]
no_license
salbat/AWSSNSMobilePushGCM
68ef32979d9b148c2a50d75f0d7e1f5fee29137f
659dfc415405867a14ec370ecc18162917d92682
refs/heads/master
2021-08-08T22:32:45.113797
2017-11-11T13:24:03
2017-11-11T13:24:03
110,346,768
0
2
null
null
null
null
UTF-8
Java
false
false
4,523
java
package com.amazonaws.sns.samples.mobilepush; /* * Copyright 2014 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. */ import java.io.IOException; import java.util.HashMap; import java.util.Map; import com.amazonaws.AmazonClientException; import com.amazonaws.AmazonServiceException; import com.amazonaws.auth.PropertiesCredentials; import com.amazonaws.services.sns.AmazonSNS; import com.amazonaws.services.sns.AmazonSNSClient; import com.amazonaws.services.sns.model.MessageAttributeValue; import com.amazonaws.sns.samples.tools.AmazonSNSClientWrapper; import com.amazonaws.sns.samples.tools.SampleMessageGenerator.Platform; public class SNSMobilePush { private AmazonSNSClientWrapper snsClientWrapper; public SNSMobilePush(AmazonSNS snsClient) { this.snsClientWrapper = new AmazonSNSClientWrapper(snsClient); } public static final Map<Platform, Map<String, MessageAttributeValue>> attributesMap = new HashMap<Platform, Map<String, MessageAttributeValue>>(); static { attributesMap.put(Platform.ADM, null); attributesMap.put(Platform.GCM, null); attributesMap.put(Platform.APNS, null); attributesMap.put(Platform.APNS_SANDBOX, null); //attributesMap.put(Platform.BAIDU, addBaiduNotificationAttributes()); //attributesMap.put(Platform.WNS, addWNSNotificationAttributes()); //attributesMap.put(Platform.MPNS, addMPNSNotificationAttributes()); } public static void main(String[] args) throws IOException { /* * TODO: Be sure to fill in your AWS access credentials in the * AwsCredentials.properties file before you try to run this sample. * http://aws.amazon.com/security-credentials */ AmazonSNS sns = new AmazonSNSClient(new PropertiesCredentials( SNSMobilePush.class .getResourceAsStream("AwsCredentials.properties"))); sns.setEndpoint("https://sns.us-west-2.amazonaws.com"); System.out.println("===========================================\n"); System.out.println("Getting Started with Amazon SNS"); System.out.println("===========================================\n"); try { SNSMobilePush sample = new SNSMobilePush(sns); /* TODO: Uncomment the services you wish to use. */ sample.demoAndroidAppNotification(); // sample.demoKindleAppNotification(); // sample.demoAppleAppNotification(); // sample.demoAppleSandboxAppNotification(); // sample.demoBaiduAppNotification(); // sample.demoWNSAppNotification(); // sample.demoMPNSAppNotification(); } catch (AmazonServiceException ase) { System.out .println("Caught an AmazonServiceException, which means your request made it " + "to Amazon SNS, but was rejected with an error response for some reason."); System.out.println("Error Message: " + ase.getMessage()); System.out.println("HTTP Status Code: " + ase.getStatusCode()); System.out.println("AWS Error Code: " + ase.getErrorCode()); System.out.println("Error Type: " + ase.getErrorType()); System.out.println("Request ID: " + ase.getRequestId()); } catch (AmazonClientException ace) { System.out .println("Caught an AmazonClientException, which means the client encountered " + "a serious internal problem while trying to communicate with SNS, such as not " + "being able to access the network."); System.out.println("Error Message: " + ace.getMessage()); } } public void demoAndroidAppNotification() { // TODO: Please fill in following values for your application. You can // also change the notification payload as per your preferences using // the method // com.amazonaws.sns.samples.tools.SampleMessageGenerator.getSampleAndroidMessage() String serverAPIKey = "SERVER_API_KEY"; String applicationName = "APP_NAME"; String registrationId = "ADD_THE_REG_KEY"; Platform platform = Platform.GCM; snsClientWrapper.demoNotification(platform, "", serverAPIKey, registrationId, applicationName, attributesMap); } }
[ "0xack13@gmail.com" ]
0xack13@gmail.com
b3ceac585bba3edd8b6454b2019f6f50cecd4b23
0c4169d6e348dae1fa7d9b0698993a480342a810
/src/main/java/com/ai/rti/ic/grp/ci/entity/MarketManageSubDomain.java
8f0ddb74b647ac6f4c8808edfab4a7f98bfba3d3
[]
no_license
AmosGOGOGO/AmosProject
1279489222c5c3c0467df0f1f90c909b772eaed1
0c94853dc5db8b1156b0ee8a7b29b4d0eb710e73
refs/heads/master
2023-04-27T15:05:19.891810
2021-01-05T07:54:26
2021-01-05T07:54:26
366,630,810
0
0
null
null
null
null
UTF-8
Java
false
false
1,295
java
package com.ai.rti.ic.grp.ci.entity; import java.io.Serializable; public class MarketManageSubDomain implements Serializable { private static final long serialVersionUID = 212732276795260400L; private String masterDataCode; private String masterDataName; private String codeValue; private String value; private String illustrate; private String remain; public String getMasterDataCode() { return this.masterDataCode; } public void setMasterDataCode(String masterDataCode) { this.masterDataCode = masterDataCode; } public String getMasterDataName() { return this.masterDataName; } public void setMasterDataName(String masterDataName) { this.masterDataName = masterDataName; } public String getCodeValue() { return this.codeValue; } public void setCodeValue(String codeValue) { this.codeValue = codeValue; } public String getValue() { return this.value; } public void setValue(String value) { this.value = value; } public String getIllustrate() { return this.illustrate; } public void setIllustrate(String illustrate) { this.illustrate = illustrate; } public String getRemain() { return this.remain; } public void setRemain(String remain) { this.remain = remain; } }
[ "914964851@qq.com" ]
914964851@qq.com
984fbf385c5a7f70e6193438b923b8f4fae4ed0b
cc5e946d475588741ec34d5403eb545929e64cc0
/source/FireApp Android App V1.2.5/app/src/main/java/com/devlomi/fireapp/activities/SelectContactNumbersActivity.java
0b2f7b7462f28223fb9affc1aa4379ceeeba24f0
[]
no_license
CoderEslam/Android-ChatApp
5b25a5c7ce8a4d0f7a54dc1ee597187c6435d711
680e92428103e2dd91b044fc43b01988e5cf3f39
refs/heads/master
2022-04-14T20:54:09.685212
2020-03-16T21:30:24
2020-03-16T21:30:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,882
java
package com.devlomi.fireapp.activities; import android.content.Intent; import android.os.Bundle; import android.os.Parcelable; import android.support.design.widget.FloatingActionButton; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.View; import com.devlomi.fireapp.R; import com.devlomi.fireapp.adapters.NumbersForContactAdapter; import com.devlomi.fireapp.model.ExpandableContact; import com.devlomi.fireapp.utils.ContactUtils; import com.devlomi.fireapp.utils.IntentUtils; import com.thoughtbot.expandablecheckrecyclerview.models.MultiCheckExpandableGroup; import java.util.ArrayList; import java.util.List; public class SelectContactNumbersActivity extends AppCompatActivity { private RecyclerView rvNumbersForContactSelector; private FloatingActionButton fabSendContactSelect; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_select_contact_numbers); rvNumbersForContactSelector = findViewById(R.id.rv_numbers_for_contact_selector); fabSendContactSelect = findViewById(R.id.fab_send_contact_select); if (!getIntent().hasExtra(IntentUtils.EXTRA_CONTACT_LIST)) return; getSupportActionBar().setTitle(R.string.select_numbers); List<ExpandableContact> result = getIntent().getParcelableArrayListExtra(IntentUtils.EXTRA_CONTACT_LIST); final NumbersForContactAdapter adapter = new NumbersForContactAdapter(result); //EXPAND ALL GROUPS adapter.toggleAllGroups(); setItemsChecked(adapter); rvNumbersForContactSelector.setLayoutManager(new LinearLayoutManager(this)); rvNumbersForContactSelector.setAdapter(adapter); fabSendContactSelect.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //getting selected numbers from contacts List<ExpandableContact> contactNameList = ContactUtils.getContactsFromExpandableGroups(adapter.getGroups()); Intent intent = new Intent(); intent.putParcelableArrayListExtra(IntentUtils.EXTRA_CONTACT_LIST, (ArrayList<? extends Parcelable>) contactNameList); setResult(RESULT_OK, intent); finish(); } }); } //set all numbers as Checked private void setItemsChecked(NumbersForContactAdapter adapter) { for (int i = 0; i < adapter.getGroups().size(); i++) { MultiCheckExpandableGroup group = (MultiCheckExpandableGroup) adapter.getGroups().get(i); for (int x = 0; x < group.getItems().size(); x++) { group.checkChild(x); } } } }
[ "riverstar1992@gmail.com" ]
riverstar1992@gmail.com
b1fb889114a830ea2f8171da504a2cec3ae42ea8
be0ec983d0b8f66cba24615cc7d0e37fb7ea8a3f
/core/http/src/main/java/org/trellisldp/http/impl/TrellisDataset.java
27e7e8ab131c2958901d3612f90d104e9f78eebf
[ "Apache-2.0" ]
permissive
christopher-johnson/trellis
082f07ef89a42116969d0487533c668b74943951
8dbb1dfa04f491540e227f8060c91920f350858f
refs/heads/master
2021-01-24T13:24:53.589342
2018-05-07T11:36:22
2018-05-07T21:15:53
123,176,110
0
0
Apache-2.0
2018-04-09T14:33:15
2018-02-27T19:16:51
Java
UTF-8
Java
false
false
2,365
java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.trellisldp.http.impl; import static org.slf4j.LoggerFactory.getLogger; import static org.trellisldp.api.RDFUtils.getInstance; import java.util.Optional; import javax.ws.rs.WebApplicationException; import org.apache.commons.rdf.api.Dataset; import org.apache.commons.rdf.api.Graph; import org.apache.commons.rdf.api.IRI; import org.apache.commons.rdf.api.Quad; import org.slf4j.Logger; /** * @author acoburn */ public class TrellisDataset implements AutoCloseable { private static final Logger LOGGER = getLogger(TrellisDataset.class); private final Dataset dataset; /** * Create a new dataset. * * @param dataset the dataset */ public TrellisDataset(final Dataset dataset) { this.dataset = dataset; } @Override public void close() { try { dataset.close(); } catch (final Exception ex) { LOGGER.error("Error closing graph: {}", ex.getMessage()); throw new WebApplicationException("Error closing dataset", ex); } } /** * Add a quad to the dataset. * * @param quad an RDF Quad */ public void add(final Quad quad) { dataset.add(quad); } /** * Get a graph from the dataset. * * @param graphName the graph name * @return the graph */ public Optional<Graph> getGraph(final IRI graphName) { return dataset.getGraph(graphName); } /** * Get the underlying dataset. * * @return the dataset */ public Dataset asDataset() { return dataset; } /** * Create a new dataset. * * @return a dataset */ public static TrellisDataset createDataset() { return new TrellisDataset(getInstance().createDataset()); } }
[ "acoburn@amherst.edu" ]
acoburn@amherst.edu
bd9e5c91015f9850e605b2c586d35beef80f9b5e
01413ebacb12bcd796609fbad06a049b3b2bd947
/OfficeManagement/src/main/java/com/employee/OfficeManagementApplication.java
e32fbdb6cb82eed216493c113dc3bd50f13b0bae
[]
no_license
parthiban7mca/project
749d862e74fa1d8f9c42ea7b4b2691c7afc3972c
841087b59a3b1137eb8d0430c0764348660c2c87
refs/heads/master
2022-03-04T08:14:48.942063
2019-08-06T14:34:31
2019-08-06T14:34:31
191,400,482
1
0
null
null
null
null
UTF-8
Java
false
false
338
java
package com.employee; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class OfficeManagementApplication { public static void main(String[] args) { SpringApplication.run(OfficeManagementApplication.class, args); } }
[ "noreply@github.com" ]
noreply@github.com
6bcc2bc60575583a4509eb59d423fc8c917c1bca
0a1515ca5e1b22643c6d1c7803802d551d902cc6
/ExamMgmtSystem/src/java/sg/edu/nus/iss/ems/service/impl/QuestionBean.java
36378703d766bd19f669f0632ea37905e59bccbc
[]
no_license
wjquery/mtech-ejava-ca
e097f2477666e57ed3e48bf28569ca19759d592e
a9db5b5a72ca5fa6054e283a08f0d75fb64b2ba1
refs/heads/master
2016-09-06T04:04:40.097079
2014-11-26T09:49:30
2014-11-26T09:49:30
32,123,735
0
0
null
null
null
null
UTF-8
Java
false
false
5,067
java
package sg.edu.nus.iss.ems.service.impl; import java.io.Serializable; import java.util.Date; import java.util.List; import javax.ejb.EJB; import javax.ejb.Stateless; import javax.persistence.TypedQuery; import sg.edu.nus.iss.ems.entity.Question; import sg.edu.nus.iss.ems.entity.QuestionType; import sg.edu.nus.iss.ems.entity.SubjectTag; import sg.edu.nus.iss.ems.service.QuestionMgmtService; @Stateless public class QuestionBean extends GenericDataAccessService<Question> implements QuestionMgmtService { private static final String FIND_BY_MODULE = "select q from Question q where q.module.code = :moduleCode"; private static final String FIND_ACTIVE_BY_MODULE = "select q from Question q where q.module.code = :moduleCode and q.status = 1"; private static final String FIND_BY_MODULE_AND_QID = "select q from Question q where q.module.code = :moduleCode and q.qid = :qid and q.status = 1"; private static final String FIND_BY_MODULE_AND_TAG = "select q from Question q join q.subjectTags qt where q.module.code = :moduleCode and qt.tag in (:tags) and q.status = 1"; private static final String FIND_ALL_QUESTION_TYPES = "QuestionType.findAll"; private static final String FIND_ALL_TAGS = "SubjectTag.findAll"; @EJB private QuestionSeqGenerator seqGenerator; @Override public List<Question> findQuestionsByModule(String moduleCode, int offset, int size, boolean activeOnly) { String sql; if (activeOnly) sql = FIND_ACTIVE_BY_MODULE; else sql = FIND_BY_MODULE; TypedQuery<Question> q = em.createQuery(sql, Question.class) .setParameter("moduleCode", moduleCode) .setFirstResult(offset) .setMaxResults(size); return q.getResultList(); } // find potential questions for sub parts @Override public List<Question> findQuestionsByModuleAndTag(String moduleCode, List<SubjectTag> tags) { if (tags != null && !tags.isEmpty()) { String tagStr = ""; for (SubjectTag tag : tags) { tagStr += tag.getTag() + ","; } if (tagStr.length() > 0) { tagStr = tagStr.substring(0, tagStr.length() -1); } TypedQuery<Question> q = em.createQuery(FIND_BY_MODULE_AND_TAG, Question.class) .setParameter("moduleCode", moduleCode) .setParameter("tags", tagStr); return q.getResultList(); } else { TypedQuery<Question> q = em.createQuery(FIND_ACTIVE_BY_MODULE, Question.class) .setParameter("moduleCode", moduleCode); return q.getResultList(); } } @Override public void create(Question question) { int qid = seqGenerator.next(question.getModule().getCode()); question.setQid(qid); question.getModule().setQuestionCount(question.getModule().getQuestionCount() + 1); question.setStatus(1); question.setVersion(1); question.setCreatedOn(new Date()); // clear choices if type is not MCQ if (question.getQuestionType().getId() > 2) question.setChoices(null); // clear parts if type is not Multipart if (question.getQuestionType().getId() != 4) question.setParts(null); super.create(question); } @Override public Question update(Question question) { Question prevQn = em.createQuery(FIND_BY_MODULE_AND_QID, Question.class) .setParameter("moduleCode", question.getModule().getCode()) .setParameter("qid", question.getQid()) .getSingleResult(); prevQn.setStatus(0); super.update(prevQn); question.setVersion(question.getVersion() + 1); question.setStatus(1); question.setCreatedOn(new Date()); // clear choices if type is not MCQ if (question.getQuestionType().getId() > 2) question.setChoices(null); // clear parts if type is not Multipart if (question.getQuestionType().getId() != 4) question.setParts(null); super.create(question); return question; } @Override public List<QuestionType> findAllQuestionTypes() { return em.createNamedQuery(FIND_ALL_QUESTION_TYPES, QuestionType.class).getResultList(); } @Override public QuestionType loadQuestionType(Serializable primaryKey) { return em.find(QuestionType.class, primaryKey); } @Override public List<SubjectTag> findAllSubjectTags() { return em.createNamedQuery(FIND_ALL_TAGS, SubjectTag.class).getResultList(); } @Override public SubjectTag loadSubjectTag(Serializable primaryKey) { return em.find(SubjectTag.class, primaryKey); } }
[ "xiong.gaogao@gmail.com@aa4fa946-59c9-80bb-2eb3-31cc01c2b225" ]
xiong.gaogao@gmail.com@aa4fa946-59c9-80bb-2eb3-31cc01c2b225
4797f469a4585c8bdc0f4f709b2de2b4862e082f
a71d2ef75683a52777cf1c4e1a95817d034de6f2
/Suanfa.java
ed1ecaafeb0a620a4b9b930dbda56efe71080fd5
[]
no_license
maggictang/algorithm
21f75aa45f72a322aa8cabe182767a16457ea08d
0f7b708d27d859b400000150242c1bcd157a48f2
refs/heads/master
2021-09-04T19:08:31.252040
2018-01-21T14:12:15
2018-01-21T14:12:15
105,365,212
0
0
null
null
null
null
GB18030
Java
false
false
5,654
java
public class Suanfa { public static void main(String[] args) { } /** * 数组练习。编写一段程序,创建一个 N×N 的布尔数组 a[][]。其中当 i 和 j 互质时(没有相同 * 因子),a[i][j] 为 true,否则为 false。 */ public static void prime(int m,int n) { boolean[][] a = new boolean[m][n]; for(int i = 0; i < a.length; i++) { for(int j = 0; j < a[0].length; j++) { if(i==0 || j ==0) { a[i][j] = false; } else if(i==1 || j==1) { a[i][j] = true; } else if(isPrime2(i)&&isPrime(j)) { a[i][j] = true; } else { a[i][j] = false; } } } } /** * 判断是否为质数 */ public static boolean isPrime2(int a) { boolean c = false; for(int i = 2; i < a; i++) { if((a % i) == 0) { c = false ; } else { c = true; } } return c; } /** * 编写一个静态方法 histogram(),接受一个整型数组 a[] 和一个整数 M 为参数并返回一个大小 * 为M的数组,其中第i个元素的值为整数i在参数数组中出现的次数。如果a[]中的值均在0到M-1 * 之间,返回数组中所有元素之和应该和 a.length 相等。 */ public static int[] Rehistogram(int[] a,int m) { int[] b = new int[m]; for(int i = 0; i < a.length; i++) { b[a[i]]++; } return b; } /** * 编写一个静态方法 histogram(),接受一个整型数组 a[] 和一个整数 M 为参数并返回一个大小 * 为M的数组,其中第i个元素的值为整数i在参数数组中出现的次数。如果a[]中的值均在0到M-1 * 之间,返回数组中所有元素之和应该和 a.length 相等。 */ public static int[] histogram(int[] a,int m) { int[] b = new int[m]; for(int i = 0; i < b.length; i++) { int k = 0; for(int j = 0; j < a.length; j++) { if(i == a[j]) { k++; } } b[i] = k; } return b; } /** * 编写一段代码,打印出一个 M 行 N 列的二维数组的转置(交换行和列)。 */ public static void trans(int[][] a,int[][] b) { for(int i = 0; i < a.length; i++) { for(int j = 0; j < a[0].length; j++) { b[j][i] = a[i][j]; } } } /** * 编写一段代码,将一个正整数 N 用二进制表示并转换为一个 String 类型的值 s。 */ public static void binary(int n) { String s =""; while(n > 0) { s = (n % 2) + s; n = n / 2; } System.out.println(s); } /** * 编写一个程序,从命令行得到三个整数参数。如果它们都相等则打印 equal,否则打印 not equal。 */ public static void isEquls(int a,int b,int c) { boolean i = false; i = a==b?(a==c?true:false):false; if(i == true) { System.out.println("equals"); } else { System.out.println("not equals"); } } /** * 计算两个非负整数 p 和 q 的最大公约数:若 * q 是 0,则最大公约数为 p。否则,将 p 除以 * q 得到余数 r,p 和 q 的最大公约数即为 q 和 * r 的最大公约数 */ public static int gcd(int p,int q) { if(p < 0 || q < 0) { System.out.println("p或q不能为0"); return -1; } if(q == 0) { return p; } else { int r = p % q; return gcd(q,r); } } /** * 找出数组中最大的元素 */ public static int max(int[] a) { int max = a[0]; for(int i = 1; i <= a.length-1; i++) { if(a[i] > max) { max = a[i]; } } return max; } /** * 计算数组平均值 * @return */ public static int avg(int[] a) { int sum = 0; for(int i = 0; i<a.length; i++) { sum += a[i]; } return (sum/a.length); } /** * 复制数组 */ public static int[] copy(int[] a) { int[] b = new int[a.length]; for(int i = 0; i<a.length; i++) { b[i] = a[i]; } return b; } /** * 颠倒数组的顺序 */ public static int[] reversal(int[] a) { int[] b = new int[a.length]; for(int i = 0; i<a.length; i++) { b[a.length-1-i] = a[i]; } return b; } /** * 计算一个整数的绝对值 */ public static int abs(int a) { if(a>=0) { return a; } else { return -(a); } } /** * 判断一个数是否是素数 * 在大于1的整数中,只能被1和这个数本身整除的数 */ public static boolean isPrime(int a) { boolean c = true; if(a<2) { c = false; } for(int i=2;i<=a-1;a++) { if(a%i == 0) { c = false; break; } } return c; } /** * 用递归实现二分法查找,返回该数在数组中的索引 * @return */ public static int find(int num,int[] a,int start,int end) { if(start > end) { return -1; } int middle = (start + end) / 2; if(num == a[middle]) { return middle; } else { if(num < a[middle]) { end = middle - 1; return find(num,a,start,end); } else { start = middle + 1; return find(num,a,start,end); } } } /** * 调用前面的方法 */ public static int find(int num,int[] a) { return find(num,a,0,a.length-1); } /** * 随机返回 [a,b) 之间的一个 int 值 */ public static int random(int a,int b) { int c = 0; if(a > b) { c = a - b; c = (int)Math.random() * c + b; } if(a < b) { c = b - a; c = (int)Math.random() * c + a; } return c; } /** * 随机返回 [0..N) 之间的一个 int 值 */ public static int random(int n) { return (int)Math.random()*n; } }
[ "noreply@github.com" ]
noreply@github.com
e823c1b74b0970653e7c343f3961af40d6258505
80818f3e5568085653864c5f2d98aec85478bd51
/src/main/java/paasta/delivery/pipeline/api/common/FileInfo.java
c36d52e144f667cc07b2a7d6f4de348a96b30a29
[]
no_license
hrjin/DELIVERY-PIPELINE-API
d8130cb96c30cbd3c43e73f7ae31eeb5b933afee
cb78a6ee5dd3c2c22b4d4e12663c7078cf7e1c02
refs/heads/master
2020-11-24T13:08:16.383343
2017-12-14T07:45:40
2017-12-14T07:45:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,190
java
package paasta.delivery.pipeline.api.common; /** * paastaDeliveryPipelineApi * paasta.delivery.pipeline.api.common * * @author REX * @version 1.0 * @since 6/21/2017 */ public class FileInfo { private long id; private String originalFileName; private String storedFileName; private String fileUrl; private String resultStatus; public long getId() { return id; } public void setId(long id) { this.id = id; } public String getOriginalFileName() { return originalFileName; } public void setOriginalFileName(String originalFileName) { this.originalFileName = originalFileName; } public String getStoredFileName() { return storedFileName; } public void setStoredFileName(String storedFileName) { this.storedFileName = storedFileName; } public String getFileUrl() { return fileUrl; } public void setFileUrl(String fileUrl) { this.fileUrl = fileUrl; } public String getResultStatus() { return resultStatus; } public void setResultStatus(String resultStatus) { this.resultStatus = resultStatus; } }
[ "rexx4314@gmail.com" ]
rexx4314@gmail.com
77a55cf6801d68d2ab9826bdd45d85573df0d8dc
b4fe4e9ff9a5309a80c01cd9fb0e8db53fe81ad2
/src/main/java/ch/uzh/rack/nlp/Lemmatizer/Example.java
ebd797771aa151f507b09ff12b35561ea47a84ba
[]
no_license
jvdassen/rack-lemmatizer
33d03bd958c8161955fbb7db30859ee2b24d9f5b
7192a69ea56a344b8882cb72dd97bfecff5905e1
refs/heads/master
2020-05-01T04:41:28.261613
2019-03-25T15:32:07
2019-03-25T15:32:07
177,281,320
0
0
null
null
null
null
UTF-8
Java
false
false
1,734
java
package ch.uzh.rack.nlp.Lemmatizer; import java.util.List; public class Example { public static void main( String[] args ) { String identifier = "getACarOrMultipleCarsForEachAccount"; ILemmatizer lemmatizer = new IdentifierLemmatizer(); List<String> lemmas; System.out.println("Identifier without lemmatization: " + identifier); System.out.println("Running basic lemmatizer"); lemmas = lemmatizer.lemmatize(identifier); System.out.println(lemmas); System.out.println("Running lemmatizer with duplicate removal"); lemmatizer = new IdentifierLemmatizer() .enableDuplicateRemoval(); lemmas = lemmatizer.lemmatize(identifier); System.out.println(lemmas); System.out.println("Running lemmatizer with cautios stopword and duplicate removal"); lemmatizer = new IdentifierLemmatizer() .enableDuplicateRemoval() .enableStopWordRemoval() .enableCautiosStopWordRemoval(); lemmas = lemmatizer.lemmatize(identifier); System.out.println(lemmas); System.out.println("Running lemmatizer with stopword and duplicate removal"); lemmatizer = new IdentifierLemmatizer() .enableDuplicateRemoval() .enableStopWordRemoval(); lemmas = lemmatizer.lemmatize(identifier); System.out.println(lemmas); lemmas = lemmatizer.lemmatize("getsX"); System.out.println(lemmas); lemmas = lemmatizer.lemmatize("getX"); System.out.println(lemmas); } }
[ "jan.vda@gmx.ch" ]
jan.vda@gmx.ch
d23b1552dc586e0e4cff73d24aaec26caaae9caf
90da2e2294c1c68feb47c9ea6b9c9c817b9e8a26
/pongHApr11/Slider.java
7449a149c4f01b4ff01ae9aa4b36b20709d9a183
[]
no_license
keleme1919/PongGame
b5a2bb5051e66cd5e5954f70075cf07b4940b696
2abcdb8f8a6c678da51480c237e8667c47c7e706
refs/heads/master
2020-03-09T21:57:35.493317
2018-04-17T04:23:19
2018-04-17T04:23:19
129,016,091
0
0
null
null
null
null
UTF-8
Java
false
false
1,101
java
import java.awt.*; import javax.swing.*; /** Class for slider objects */ public class Slider { Rectangle rect1; int x1; int y1; int x2; int y2; /** creates object */ // Do we need to create modifiable coordinates too? /** paints the object */ public Slider(int x1, int y1) { this.rect1 = new Rectangle(x1,y1,12,120); this.x1 = x1; this.y1 = y1; } public void move(int y1Mod) { if (y1Mod == -1 || y1Mod == 1 || y1Mod == 0) { if (y1Mod != 0) { if (y1 > 0 && y1 < 542) { y1Mod = y1Mod * 1; y1 += y1Mod; this.rect1.setLocation(x1, y1); } if (y1 == 0 && y1Mod == 1) { y1 += 1; this.rect1.setLocation(x1, y1); } if (y1 == 542 && y1Mod == -1) { y1 += -1; this.rect1.setLocation(x1,y1); } } } } public Rectangle getRect() { return rect1; } }
[ "shtoonkeyg@gmail.com" ]
shtoonkeyg@gmail.com
a2cf2f5127798d28d01a76396ca0373aef39adaf
d8e8e4e689abe378007b2b9203814c517ca885e9
/Bubble Sort/Main.java
6a2a4211a544978d86669c75357c03a7a6357b7b
[]
no_license
rR2602/Playground
33d9d6944fbff543f5d4f898e33846ac01022751
6d5b68d0f797bd131cfcc8f0a27ce0e2b48e0ac5
refs/heads/master
2020-04-23T16:27:50.325445
2019-07-11T05:57:17
2019-07-11T05:57:17
171,298,961
0
0
null
null
null
null
UTF-8
Java
false
false
385
java
#include<stdio.h> int main() { int n; scanf("%d",&n); int arr[n]; for(int i=0;i<n;i++) scanf("%d",&arr[i]); for(int i=n-1;i>0;i--) { for(int j=0;j<i;j++) { if(arr[j]>arr[j+1]) { int temp=arr[j]; arr[j]=arr[j+1]; arr[j+1]=temp; } } } for(int i=0;i<n;i++) { printf("%d\n",arr[i]); } return 0; }
[ "47747588+rR2602@users.noreply.github.com" ]
47747588+rR2602@users.noreply.github.com
1006e366dcdeb3333e2ef3f0ce22bc6e31782350
3b466ef156bae71051fc90ee0201af977a170a8c
/src/main/java/servicios/ParseRules.java
2c04f5f6779450950405ae58600394ca2ecc8258
[]
no_license
sandrini7263/ApacheJena
0cfaa5b17ec7b9cf0c93d4cbca40552daca229d4
32b584a93fbdc3687e7afd07fd6a2eab8bad9f4a
refs/heads/master
2021-06-30T16:53:58.382540
2017-09-19T21:43:24
2017-09-19T21:43:24
104,120,434
0
0
null
null
null
null
UTF-8
Java
false
false
2,843
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 servicios; import com.sun.jersey.core.header.FormDataContentDisposition; import com.sun.jersey.multipart.FormDataParam; import ejBeans.GestionReglas; import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintStream; import java.util.ArrayList; import java.util.List; import javax.ejb.EJB; import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.core.Context; import javax.ws.rs.core.Response; import org.apache.jena.reasoner.rulesys.Rule; import utilidades.GestionRutas; import javax.ws.rs.Consumes; import javax.ws.rs.core.MediaType; /** * * @author Carlos Sánchez López */ @Path("/v1/parseRules") public class ParseRules { @EJB GestionReglas gestionreglas; @POST @Consumes(MediaType.MULTIPART_FORM_DATA) public Response parseRules(@FormDataParam("file") InputStream ips, @FormDataParam("file") FormDataContentDisposition file, @FormDataParam("token") String token, @FormDataParam("nameResource") String nameResource, @Context HttpServletResponse servletResponse) throws FileNotFoundException { //Obtención de la ruta donde se guardará el fichero subido al servidor GestionRutas gr = new GestionRutas(); // Creación de directorio donde se guardarán los archivos subidos File directorio = new File(gr.getActualPath() + token); if (!directorio.exists()) { directorio.mkdirs(); } String ruta = directorio + "\\"; try { int read; byte[] bytes = new byte[1024]; OutputStream os = new FileOutputStream(new File(ruta + file.getFileName())); while ((read = ips.read(bytes)) != -1) { os.write(bytes, 0, read); } os.flush(); os.close(); } catch (IOException e) { PrintStream s = null; e.printStackTrace(s); } BufferedReader knowledgeBase_rules = new BufferedReader(new FileReader(ruta + "knowledgeBase_rules.txt")); List rules = Rule.parseRules(Rule.rulesParserFromReader(knowledgeBase_rules)); gestionreglas.addRules(token, nameResource, (ArrayList<String>) rules); return Response.ok("File uploaded correctly").build(); } }
[ "Usuario@Usuario-PC" ]
Usuario@Usuario-PC
41616d89e9c721944632177413521f00f17095c0
c7f471c7e97cd2f44e83ba89e8f921004010209c
/algo-java/src/ICT/dfs_bfs/dfs.java
54b275b881870367fe0865d3859343cd89ab6ef1
[]
no_license
gomsk/algo-java
d4c9f9a61824d5b54b9bd95c67a2107ebe1a7193
6f69c3efb7fbdc39fec9941d86b9498724b7c637
refs/heads/main
2023-04-02T15:12:10.020035
2021-04-08T10:07:06
2021-04-08T10:07:06
353,339,908
0
0
null
null
null
null
UTF-8
Java
false
false
1,922
java
package ICT.dfs_bfs; import java.util.ArrayList; //1. 스택에 노드 쌓고, 방문처리한다. // 2. 스택의 최상단에 있는 노드와 가장 인접한 노드를 방문 처리하고 스택에 쌓는다. ( 주로 번호가 낮은 노드 우선 탐색) // 3. 방문할 노드가 없는 경우, 스택을 날리고 2 반복. public class dfs { public static ArrayList<ArrayList<Integer>> graph = new ArrayList<ArrayList<Integer>>(); public static boolean visited[] = new boolean[9]; public static void dfsFunc(int x) { visited[x] = true; System.out.print(x +" "); for(int i=0; i< graph.get(x).size(); i++) { int y = graph.get(x).get(i); if(!visited[y]) { dfsFunc(y); } } } public static void main(String[] args) { for(int i=0; i <9; i++) { graph.add(new ArrayList<Integer>()); } // 노드 1에 연결된 노드 정보 저장 graph.get(1).add(2); graph.get(1).add(3); graph.get(1).add(8); // 노드 2에 연결된 노드 정보 저장 graph.get(2).add(1); graph.get(2).add(7); // 노드 3에 연결된 노드 정보 저장 graph.get(3).add(1); graph.get(3).add(4); graph.get(3).add(5); // 노드 4에 연결된 노드 정보 저장 graph.get(4).add(3); graph.get(4).add(5); // 노드 5에 연결된 노드 정보 저장 graph.get(5).add(3); graph.get(5).add(4); // 노드 6에 연결된 노드 정보 저장 graph.get(6).add(7); // 노드 7에 연결된 노드 정보 저장 graph.get(7).add(2); graph.get(7).add(6); graph.get(7).add(8); // 노드 8에 연결된 노드 정보 저장 graph.get(8).add(1); graph.get(8).add(7); dfsFunc(1); } }
[ "ydy1722@gmail.com" ]
ydy1722@gmail.com
9df79f9d12bee070610a8800d2d97ce5460b3e1b
0f22ef279b6d30605193999a1cb2eea08626ee82
/Screen.java
2e81747806286953649fa53cda22e3c470b37566
[]
no_license
andrewguo5/Per6-Guo-Shi-amazing_project_wow
38b267d0980ae83024f0fc04c85be633886a398c
3877aba438e4c58b84069118a4f36a0a8e00bbfd
refs/heads/master
2021-01-19T10:03:01.505679
2014-06-09T04:51:00
2014-06-09T04:51:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,461
java
import javax.swing.*; import java.awt.*; import java.awt.image.*; import java.io.*; public class Screen extends JPanel implements Runnable{ public static Grid grid; public static int myWidth, myHeight; private static boolean isFirst = true; public Thread thread = new Thread(this); public static Image[] back; public static Image[] food; public Screen(){ thread.start(); } public void define(){ back = new Image[30]; grid= new Grid(); food = new Image[30]; for (int i = 0; i < back.length; i++){ back[i] = new ImageIcon("Res/sprites_column_transparent.png").getImage(); back[i] = createImage(new FilteredImageSource(back[i].getSource(),new CropImageFilter(0,50*i,50,50))); } for (int i = 0; i < food.length; i++){ food[i] = new ImageIcon("Res/sprites_column_transparent.png").getImage(); food[i] = createImage(new FilteredImageSource(food[i].getSource(),new CropImageFilter(0,50*i,50,50))); } } public void paintComponent(Graphics g){ if (isFirst){ myWidth = getWidth(); myHeight = getHeight(); define(); isFirst = false; } g.setColor(new Color(60,60,60)); g.fillRect(0,0,getWidth(),getHeight()); g.setColor(new Color(0,0,0)); grid.draw(g); } public void run(){ while(true){//continuous running if(!isFirst){ } repaint(); try{ Thread.sleep(1);//slows running. }catch(Exception e){} } } }
[ "kig-12345@hotmail.com" ]
kig-12345@hotmail.com
3d7ad59e095db5ecdd212c86494d8aa021c09be1
757ff0e036d1c65d99424abb5601012d525c2302
/sources/com/fimi/libperson/entity/ImageSource.java
734caafec1788912cd3a14840ed61d33d1152ddb
[]
no_license
pk1z/wladimir-computin-FimiX8-RE-App
32179ef6f05efab0cf5af0d4957f0319abe04ad0
70603638809853a574947b65ecfaf430250cd778
refs/heads/master
2020-11-25T21:02:17.790224
2019-12-18T13:28:48
2019-12-18T13:28:48
228,845,415
0
0
null
null
null
null
UTF-8
Java
false
false
1,704
java
package com.fimi.libperson.entity; import android.graphics.Bitmap; import android.net.Uri; import java.io.File; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; public class ImageSource { private final Bitmap bitmap; private final Integer resource; private final boolean tile; private final Uri uri; public static ImageSource asset(String assetName) { if (assetName != null) { return uri("file:///android_asset/" + assetName); } throw new NullPointerException("Asset name must not be null"); } public static ImageSource uri(String uri) { if (uri == null) { throw new NullPointerException("Uri must not be null"); } if (!uri.contains("://")) { if (uri.startsWith("/")) { uri = uri.substring(1); } uri = "file:///" + uri; } return new ImageSource(Uri.parse(uri)); } private ImageSource(Uri uri) { String uriString = uri.toString(); if (uriString.startsWith("file:///") && !new File(uriString.substring("file:///".length() - 1)).exists()) { try { uri = Uri.parse(URLDecoder.decode(uriString, "UTF-8")); } catch (UnsupportedEncodingException e) { } } this.bitmap = null; this.uri = uri; this.resource = null; this.tile = true; } public Bitmap getBitmap() { return this.bitmap; } public Uri getUri() { return this.uri; } public Integer getResource() { return this.resource; } public boolean isTile() { return this.tile; } }
[ "you@example.com" ]
you@example.com
f42a00882171b2157823a205d6dbb9c96cc6c474
997f60135a5f8fc6128213147834125e159701c2
/akka-http-core/src/main/java/akka/http/javadsl/model/headers/TlsSessionInfo.java
d398d0d5c5ce02e93ca67e5706990df7228c955f
[ "Apache-2.0", "LicenseRef-scancode-protobuf" ]
permissive
KushalVenkatesh/akka
b0c4ba380276f40f229c79c492403b9c8c634a72
b14013c44a083facaac89530fa6eda5ceb6359fe
refs/heads/master
2022-08-22T04:17:00.959076
2016-02-22T16:10:20
2016-02-22T16:10:20
52,310,489
0
0
NOASSERTION
2022-07-25T03:48:03
2016-02-22T22:22:11
Scala
UTF-8
Java
false
false
832
java
/** * Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com> */ package akka.http.javadsl.model.headers; import javax.net.ssl.SSLSession; /** * Model for the synthetic `Tls-Session-Info` header which carries the SSLSession of the connection * the message carrying this header was received with. * * This header will only be added if it enabled in the configuration by setting * <code>akka.http.[client|server].parsing.tls-session-info-header = on</code>. */ public abstract class TlsSessionInfo extends CustomHeader { /** * @return the SSLSession this message was received over. */ public abstract SSLSession getSession(); public static TlsSessionInfo create(SSLSession session) { return akka.http.scaladsl.model.headers.Tls$minusSession$minusInfo$.MODULE$.apply(session); } }
[ "johannes.rudolph@gmail.com" ]
johannes.rudolph@gmail.com
00d498bcb122ccb00ddee869c8d3ccbee5f7426a
353b2de9e6fe6cc4c6cd9b2a5f1cb83854704512
/app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/androidx/drawerlayout/R.java
14ae62bc515bbac6aa9cde7a234516de9a28d9a1
[]
no_license
changchingchi/Movie
d8a9d25a7806a8d85dcfce3ecc78241d27157dd2
0da18509d70b5c0143e40dc9cc978e6b18a7458b
refs/heads/master
2020-06-04T01:01:26.780793
2019-06-13T17:23:06
2019-06-13T17:23:06
191,805,285
0
0
null
null
null
null
UTF-8
Java
false
false
10,452
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * gradle plugin from the resource data it found. It * should not be modified by hand. */ package androidx.drawerlayout; public final class R { private R() {} public static final class attr { private attr() {} public static final int alpha = 0x7f030027; public static final int font = 0x7f0300d7; public static final int fontProviderAuthority = 0x7f0300d9; public static final int fontProviderCerts = 0x7f0300da; public static final int fontProviderFetchStrategy = 0x7f0300db; public static final int fontProviderFetchTimeout = 0x7f0300dc; public static final int fontProviderPackage = 0x7f0300dd; public static final int fontProviderQuery = 0x7f0300de; public static final int fontStyle = 0x7f0300df; public static final int fontVariationSettings = 0x7f0300e0; public static final int fontWeight = 0x7f0300e1; public static final int ttcIndex = 0x7f030208; } public static final class color { private color() {} public static final int notification_action_color_filter = 0x7f05006a; public static final int notification_icon_bg_color = 0x7f05006b; public static final int ripple_material_light = 0x7f050075; public static final int secondary_text_default_material_light = 0x7f050077; } public static final class dimen { private dimen() {} public static final int compat_button_inset_horizontal_material = 0x7f06004e; public static final int compat_button_inset_vertical_material = 0x7f06004f; public static final int compat_button_padding_horizontal_material = 0x7f060050; public static final int compat_button_padding_vertical_material = 0x7f060051; public static final int compat_control_corner_material = 0x7f060052; public static final int compat_notification_large_icon_max_height = 0x7f060053; public static final int compat_notification_large_icon_max_width = 0x7f060054; public static final int notification_action_icon_size = 0x7f0600c1; public static final int notification_action_text_size = 0x7f0600c2; public static final int notification_big_circle_margin = 0x7f0600c3; public static final int notification_content_margin_start = 0x7f0600c4; public static final int notification_large_icon_height = 0x7f0600c5; public static final int notification_large_icon_width = 0x7f0600c6; public static final int notification_main_column_padding_top = 0x7f0600c7; public static final int notification_media_narrow_margin = 0x7f0600c8; public static final int notification_right_icon_size = 0x7f0600c9; public static final int notification_right_side_padding_top = 0x7f0600ca; public static final int notification_small_icon_background_padding = 0x7f0600cb; public static final int notification_small_icon_size_as_large = 0x7f0600cc; public static final int notification_subtext_size = 0x7f0600cd; public static final int notification_top_pad = 0x7f0600ce; public static final int notification_top_pad_large_text = 0x7f0600cf; } public static final class drawable { private drawable() {} public static final int notification_action_background = 0x7f07006e; public static final int notification_bg = 0x7f07006f; public static final int notification_bg_low = 0x7f070070; public static final int notification_bg_low_normal = 0x7f070071; public static final int notification_bg_low_pressed = 0x7f070072; public static final int notification_bg_normal = 0x7f070073; public static final int notification_bg_normal_pressed = 0x7f070074; public static final int notification_icon_background = 0x7f070075; public static final int notification_template_icon_bg = 0x7f070076; public static final int notification_template_icon_low_bg = 0x7f070077; public static final int notification_tile_bg = 0x7f070078; public static final int notify_panel_notification_icon_bg = 0x7f070079; } public static final class id { private id() {} public static final int action_container = 0x7f08000d; public static final int action_divider = 0x7f08000f; public static final int action_image = 0x7f080010; public static final int action_text = 0x7f080016; public static final int actions = 0x7f080017; public static final int async = 0x7f08001d; public static final int blocking = 0x7f080021; public static final int chronometer = 0x7f080029; public static final int forever = 0x7f08004d; public static final int icon = 0x7f080054; public static final int icon_group = 0x7f080055; public static final int info = 0x7f080058; public static final int italic = 0x7f08005a; public static final int line1 = 0x7f080060; public static final int line3 = 0x7f080061; public static final int normal = 0x7f08006e; public static final int notification_background = 0x7f08006f; public static final int notification_main_column = 0x7f080070; public static final int notification_main_column_container = 0x7f080071; public static final int right_icon = 0x7f080083; public static final int right_side = 0x7f080084; public static final int tag_transition_group = 0x7f0800b1; public static final int tag_unhandled_key_event_manager = 0x7f0800b2; public static final int tag_unhandled_key_listeners = 0x7f0800b3; public static final int text = 0x7f0800b4; public static final int text2 = 0x7f0800b5; public static final int time = 0x7f0800bd; public static final int title = 0x7f0800be; } public static final class integer { private integer() {} public static final int status_bar_notification_info_maxnum = 0x7f09000e; } public static final class layout { private layout() {} public static final int notification_action = 0x7f0b0032; public static final int notification_action_tombstone = 0x7f0b0033; public static final int notification_template_custom_big = 0x7f0b0034; public static final int notification_template_icon_group = 0x7f0b0035; public static final int notification_template_part_chronometer = 0x7f0b0036; public static final int notification_template_part_time = 0x7f0b0037; } public static final class string { private string() {} public static final int status_bar_notification_info_overflow = 0x7f0e0036; } public static final class style { private style() {} public static final int TextAppearance_Compat_Notification = 0x7f0f0118; public static final int TextAppearance_Compat_Notification_Info = 0x7f0f0119; public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0f011a; public static final int TextAppearance_Compat_Notification_Time = 0x7f0f011b; public static final int TextAppearance_Compat_Notification_Title = 0x7f0f011c; public static final int Widget_Compat_NotificationActionContainer = 0x7f0f01c2; public static final int Widget_Compat_NotificationActionText = 0x7f0f01c3; } public static final class styleable { private styleable() {} public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f030027 }; public static final int ColorStateListItem_android_color = 0; public static final int ColorStateListItem_android_alpha = 1; public static final int ColorStateListItem_alpha = 2; public static final int[] FontFamily = { 0x7f0300d9, 0x7f0300da, 0x7f0300db, 0x7f0300dc, 0x7f0300dd, 0x7f0300de }; public static final int FontFamily_fontProviderAuthority = 0; public static final int FontFamily_fontProviderCerts = 1; public static final int FontFamily_fontProviderFetchStrategy = 2; public static final int FontFamily_fontProviderFetchTimeout = 3; public static final int FontFamily_fontProviderPackage = 4; public static final int FontFamily_fontProviderQuery = 5; public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f0300d7, 0x7f0300df, 0x7f0300e0, 0x7f0300e1, 0x7f030208 }; public static final int FontFamilyFont_android_font = 0; public static final int FontFamilyFont_android_fontWeight = 1; public static final int FontFamilyFont_android_fontStyle = 2; public static final int FontFamilyFont_android_ttcIndex = 3; public static final int FontFamilyFont_android_fontVariationSettings = 4; public static final int FontFamilyFont_font = 5; public static final int FontFamilyFont_fontStyle = 6; public static final int FontFamilyFont_fontVariationSettings = 7; public static final int FontFamilyFont_fontWeight = 8; public static final int FontFamilyFont_ttcIndex = 9; public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 }; public static final int GradientColor_android_startColor = 0; public static final int GradientColor_android_endColor = 1; public static final int GradientColor_android_type = 2; public static final int GradientColor_android_centerX = 3; public static final int GradientColor_android_centerY = 4; public static final int GradientColor_android_gradientRadius = 5; public static final int GradientColor_android_tileMode = 6; public static final int GradientColor_android_centerColor = 7; public static final int GradientColor_android_startX = 8; public static final int GradientColor_android_startY = 9; public static final int GradientColor_android_endX = 10; public static final int GradientColor_android_endY = 11; public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 }; public static final int GradientColorItem_android_color = 0; public static final int GradientColorItem_android_offset = 1; } }
[ "chi.changching@gmail.com" ]
chi.changching@gmail.com
5e7dcfa4410941b8a41fac530c1514c54327f7d7
20ef1253d0e1438b864696c62bb16d62a9dc3942
/thymeleaf-form/src/main/java/com/github/hemoptysisheart/spring/example/thymeleafform/web/controller/IndexControllerImpl.java
0536603974089af4693d670ddcc289af2d866e49
[ "Apache-2.0" ]
permissive
hemoptysisheart/spring-examples
b8b2609ebcfb173db829c1d8f734e2e8c4a14e09
7ab18a062398576dfaf4eeaa6511198b9ed9203f
refs/heads/master
2021-08-22T06:48:46.460103
2019-05-05T10:18:39
2019-05-05T10:18:39
174,765,091
0
0
Apache-2.0
2019-05-05T10:18:41
2019-03-10T01:31:33
JavaScript
UTF-8
Java
false
false
3,616
java
package com.github.hemoptysisheart.spring.example.thymeleafform.web.controller; import com.github.hemoptysisheart.spring.example.thymeleafform.service.SomeException; import com.github.hemoptysisheart.spring.example.thymeleafform.service.SomeService; import com.github.hemoptysisheart.spring.example.thymeleafform.service.cmd.SomeProcessCmd; import com.github.hemoptysisheart.spring.example.thymeleafform.web.configuration.ModelAttributes; import com.github.hemoptysisheart.spring.example.thymeleafform.web.configuration.ViewNames; import com.github.hemoptysisheart.spring.example.thymeleafform.web.controller.input.FormInput; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.validation.BindingResult; import org.springframework.validation.FieldError; import org.springframework.validation.ObjectError; import org.springframework.web.bind.annotation.ModelAttribute; import javax.validation.Valid; import java.util.Arrays; import static org.slf4j.LoggerFactory.getLogger; @Controller class IndexControllerImpl implements IndexController { private static final Logger log = getLogger(IndexControllerImpl.class); @Autowired private SomeService someService; private String doForm(Model model) { if (model.containsAttribute(ModelAttributes.INPUT_NAME)) { ((FormInput) model.asMap().get(ModelAttributes.INPUT_NAME)).clearError(); } else { model.addAttribute(ModelAttributes.INPUT_NAME, new FormInput()); } if (!model.containsAttribute(ModelAttributes.ERROR_SOURCES)) { model.addAttribute(ModelAttributes.ERROR_SOURCES, Arrays.asList("number", "text", "email", "password", "passwordConfirm")); } return ViewNames.FORM; } private String doSubmit(FormInput input, BindingResult result, Model model) { SomeProcessCmd cmd = new SomeProcessCmd(input.getNumber(), input.getText(), input.getEmail(), input.getPassword(), input.isError(), input.getErrSource()); String template; try { this.someService.process(cmd); template = "redirect:/"; } catch (SomeException e) { if (null == e.getField()) { result.addError(new ObjectError(ModelAttributes.INPUT_NAME, e.getMessage())); } else { result.addError(new FieldError(ModelAttributes.INPUT_NAME, e.getField(), e.getMessage())); } template = doForm(model); } return template; } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @Override public String form(Model model) { String template = doForm(model); return template; } @Override public String submit( @ModelAttribute(ModelAttributes.INPUT_NAME) @Valid final FormInput input, final BindingResult result, final Model model) { if (log.isTraceEnabled()) { log.trace("args : input={}, result={}, model={}", input, result, model); } String password = input.getPassword(); if (null != password && !password.equals(input.getPasswordConfirm())) { result.addError(new FieldError(ModelAttributes.INPUT_NAME, "passwordConfirm", "Password confirm does not match.")); } String template = result.hasErrors() ? doForm(model) : doSubmit(input, result, model); if (log.isTraceEnabled()) { log.trace("result : template={}", template); log.trace("result : result={}", result); log.trace("result : model={}", model); } return template; } }
[ "hemoptysisheart@gmail.com" ]
hemoptysisheart@gmail.com
49adfdb7b5453f889a611e0a6e28bcaa00df41e1
ba96f4f8432b0a049dc081f7970b7c222b94325b
/app/src/main/java/com/example/ricardo/santafesacho/RestTresFragment.java
47dd50ac9fa443d7fe6e17ee20095a0b58204e15
[]
no_license
jricardogarciaj/SantafesachoV4
52db75a3e245a2e5dd3cea4e056adced40758f88
f9adf731dae8ad4bbd6e167fb2180790335201b5
refs/heads/master
2021-01-19T03:54:25.804534
2017-04-05T18:25:10
2017-04-05T18:25:10
87,341,256
0
0
null
null
null
null
UTF-8
Java
false
false
672
java
package com.example.ricardo.santafesacho; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; /** * A simple {@link Fragment} subclass. */ public class RestTresFragment extends Fragment { public RestTresFragment() { // Required empty public constructor } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment return inflater.inflate(R.layout.fragment_rest_tres, container, false); } }
[ "jricardo.garcia@udea.edu.co" ]
jricardo.garcia@udea.edu.co
857c03aec40e638584487098b974472f80f75072
edd98d8740e0ae9a739ecc28de128699072ffa8e
/Arrays/SearchInsertPosition/Solution.java
677f929d374836c55cf3697fd39ce241cb85faf2
[]
no_license
mihirpatankar/Java-Code-Samples
624102aa0ee282db4468cae7b61ac058a29ade24
940df7067d6015fa169ce0569e667e611cb88854
refs/heads/master
2021-05-06T22:06:12.007519
2017-12-23T02:42:07
2017-12-23T02:42:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
523
java
//nums = [1,2,3,6,8,9,11] target = 3 --> ans = 2 //nums = [1,2,3,6,8,9,11] target = 7 --> ans = 4 //nums = [1,2,3,6,8,9,11] target = 15 --> ans = 7 class Solution{ public int searchInsert(int[] nums, int target){ int low=0; int high=nums.length-1; while(low<=high){ int mid = low+(high-low)/2; if(nums[mid]==target){ return mid; } else if(nums[mid]>target){ high=mid-1; } else{ low=mid+1; } } return low; } }
[ "noreply@github.com" ]
noreply@github.com
b58dd267cac14bc55f3e06b192c7ac99ef6728cd
af560cbe9dad3df0db7717129b641eb51831c44b
/lab3/src/main/java 3/gui/tabs/DigitalSignatureTab.java
718dd17cbe8129a2c3a45b58fd2d3db28820a625
[ "MIT" ]
permissive
fgulan/nos-fer
0946043de4bfd3823684167af1a7a0f56669fc08
edcd8ca17bbb0f0c48707863940c72e67df9b933
refs/heads/master
2021-04-28T18:44:16.725942
2018-02-17T18:23:23
2018-02-17T18:23:23
121,880,488
0
0
null
null
null
null
UTF-8
Java
false
false
6,962
java
package gui.tabs; import crypto.RSA; import crypto.RSAKeysGenerator; import crypto.SHA1Internal; import javax.swing.*; import java.awt.*; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardOpenOption; import java.util.*; import java.util.List; /** * Created by filipgulan on 06/05/2017. */ public class DigitalSignatureTab extends JPanel { private JTextField inputFileField = new JTextField(20); private JTextField inputKeyField = new JTextField(20); private JTextField signatureOutputField = new JTextField(20); private JTextField outputKeyField = new JTextField(20); private Path inputFilePath; private Path inputKeyPath; private Path signatureOutputPath; private Path outputKeyPath; private String currentDigest; public DigitalSignatureTab() { super(); setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS)); initGUI(); } private void initGUI() { JPanel gridPanel = new JPanel(new GridLayout(0, 3)); gridPanel.add(new JLabel("Ulazna datotoeka")); gridPanel.add(inputFileField); JButton inputFileButton = new JButton("Odaberi"); inputFileButton.addActionListener(e -> { didSelectChooseInputFile(); }); gridPanel.add(inputFileButton); gridPanel.add(new JLabel("Tajni kljuc posiljatelja")); gridPanel.add(inputKeyField); JButton inputKeyButton = new JButton("Odaberi"); inputKeyButton.addActionListener(e -> { didSelectChooseInputKey(); }); gridPanel.add(inputKeyButton); gridPanel.add(new JLabel("Digitalni potpis")); gridPanel.add(signatureOutputField); JButton envelopeButton = new JButton("Odaberi"); envelopeButton.addActionListener(e -> { didSelectChooseSignature(); }); gridPanel.add(envelopeButton); JButton generateSignatureButton = new JButton("Generiraj digitalni potpis"); generateSignatureButton.addActionListener(e -> { try { generateSignature(); } catch (Exception e1) { e1.printStackTrace(); } }); JPanel openPanel = new JPanel(new GridLayout(0, 3)); openPanel.add(new JLabel("Javni kljuc posiljatelja")); openPanel.add(outputKeyField); JButton choosePublicButton = new JButton("Odaberi"); choosePublicButton.addActionListener(e -> { didSelectChooseOutputKey(); }); openPanel.add(choosePublicButton); JButton checkSignatureButton = new JButton("Provjeri digitalni potpis"); checkSignatureButton.addActionListener(e -> { try { checkSignature(); } catch (Exception e1) { e1.printStackTrace(); } }); add(gridPanel); add(generateSignatureButton); add(openPanel); add(checkSignatureButton); } private void checkSignature() throws Exception { if (currentDigest == null || outputKeyPath == null || signatureOutputPath == null) { return; } List<String> lines = Files.readAllLines(signatureOutputPath); byte[] data = Base64.getDecoder().decode(lines.get(0)); RSA rsa = new RSA(); RSAKeysGenerator rsaGenerator = new RSAKeysGenerator(2048); byte[] decryptedData = rsa.decrypt(data, rsaGenerator.loadPublicKey(outputKeyPath)); String digest = new String(decryptedData, StandardCharsets.UTF_8); if (currentDigest.equals(digest)) { JOptionPane.showMessageDialog(null, "Sažetak uspješno provjeren!"); } else { JOptionPane.showMessageDialog(null, "Dobiveni sažetak ne odgovara izračunatom!!!"); } } private void generateSignature() throws Exception { if (inputFilePath == null || inputKeyPath == null || signatureOutputPath == null) { return; } byte[] input = Files.readAllBytes(inputFilePath); String digest = SHA1Internal.digest(input); currentDigest = digest; RSA rsa = new RSA(); RSAKeysGenerator rsaGenerator = new RSAKeysGenerator(2048); byte[] byteDigest = digest.getBytes(StandardCharsets.UTF_8); byte[] encryptedDigest = rsa.encrypt(byteDigest, rsaGenerator.loadPrivateKey(inputKeyPath)); String base64Digest = new String(Base64.getEncoder().encode(encryptedDigest)); ArrayList<String> lines = new ArrayList<>(); lines.add(base64Digest); Files.write(signatureOutputPath, lines, StandardCharsets.UTF_8, StandardOpenOption.CREATE); } void didSelectChooseInputFile() { JFileChooser chooser = new JFileChooser(); chooser.setDialogTitle("Odaberi ulaznu datoteku"); chooser.setFileSelectionMode(JFileChooser.FILES_ONLY); if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) { inputFilePath = chooser.getSelectedFile().toPath(); inputFileField.setText(chooser.getSelectedFile().toPath().toString()); } else { inputFilePath = null; inputFileField.setText(""); } } void didSelectChooseInputKey() { JFileChooser chooser = new JFileChooser(); chooser.setDialogTitle("Odaberi tajni kljuc posiljatelja"); chooser.setFileSelectionMode(JFileChooser.FILES_ONLY); if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) { inputKeyPath = chooser.getSelectedFile().toPath(); inputKeyField.setText(chooser.getSelectedFile().toPath().toString()); } else { inputKeyPath = null; inputKeyField.setText(""); } } void didSelectChooseSignature() { JFileChooser chooser = new JFileChooser(); chooser.setDialogTitle("Odaberi datoteku za potpis"); chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); if (chooser.showSaveDialog(null) == JFileChooser.APPROVE_OPTION) { signatureOutputPath = chooser.getSelectedFile().toPath(); signatureOutputField.setText(chooser.getSelectedFile().toPath().toString()); } else { signatureOutputPath = null; signatureOutputField.setText(""); } } void didSelectChooseOutputKey() { JFileChooser chooser = new JFileChooser(); chooser.setDialogTitle("Odaberi javni kljuc posiljatelja"); chooser.setFileSelectionMode(JFileChooser.FILES_ONLY); if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) { outputKeyPath = chooser.getSelectedFile().toPath(); outputKeyField.setText(chooser.getSelectedFile().toPath().toString()); } else { outputKeyPath = null; outputKeyField.setText(""); } } }
[ "filip.gulan@infinum.hr" ]
filip.gulan@infinum.hr
d964d84e3a3fa07593d09da215576a920a2fa58c
2ec6ea2d6ef36b41f57cf7cb72dad3bb70541a9c
/commbusi_api/src/main/java/com/cnfantasia/server/api/pub/service/PubService.java
b317dcfcff0e846c45002a990b81260f01285be9
[]
no_license
6638112/propertyERP-2
b40dac0e6b96f51b351fcef03c9c530b9fc64938
8240b03f7c3ea195913bae467cac41e006c82c61
refs/heads/master
2023-07-08T17:07:20.127060
2018-03-19T07:13:05
2018-03-19T07:13:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,230
java
/** * Filename: PubService.java * @version: 1.0 * Create at: 2014年5月8日 上午6:29:34 * Description: * * Modification History: * Date Author Version Description * ----------------------------------------------------------------- * 2014年5月8日 shiyl 1.0 1.0 Version */ package com.cnfantasia.server.api.pub.service; import org.springframework.stereotype.Service; import com.cnfantasia.server.business.pub.dao.IDualDao; import com.cnfantasia.server.business.pub.service.IPubService; /** * Filename: PubService.java * @version: 1.0.0 * Create at: 2014年5月8日 上午6:29:34 * Description: * * Modification History: * Date Author Version Description * ------------------------------------------------------------------ * 2014年5月8日 shiyl 1.0 1.0 Version */ @Service public class PubService implements IPubService{ private IDualDao dualDao; public void setDualDao(IDualDao dualDao) { this.dualDao = dualDao; } @Override public String getNowTime() { return dualDao.getNowTime(); } @Override public String getNowDay() { return dualDao.getNowDay(); } }
[ "905373499@qq.com" ]
905373499@qq.com
273ba63dfb3e3e0397796ef0aa6f532b8b58b20b
6d40a559ca0f874ae7ac922a19b5aaac8dec2e93
/src/main/java/ch/uzh/seal/BLogDiff/utils/EditTreeUtils.java
6aebb0dbc3694c8a92dc25ca23d92ce866ab71a8
[]
no_license
noahch/blogdiff
a4cfcd07fd308c9dedeafd7d3e5be0df7e1094b9
c19e9bf5824935ddd607c5cf2b93c4de215036f0
refs/heads/master
2022-11-28T15:08:42.672199
2019-07-30T15:54:20
2019-07-30T15:54:20
184,011,057
0
0
null
2022-11-16T11:48:42
2019-04-29T06:16:37
Java
UTF-8
Java
false
false
2,285
java
package ch.uzh.seal.BLogDiff.utils; import ch.uzh.seal.BLogDiff.model.parsing.EditAction; import ch.uzh.seal.BLogDiff.model.parsing.EditTree; import ch.uzh.seal.BLogDiff.model.parsing.LineActionType; public class EditTreeUtils { public static long getAdditions(EditTree editTree){ long childActionCount = 0; for(EditAction editAction1: editTree.getChildrenActions()){ childActionCount += getActionRec(editAction1, LineActionType.ADD); } return childActionCount; } public static long getDeletions(EditTree editTree){ long childActionCount = 0; for(EditAction editAction1: editTree.getChildrenActions()){ childActionCount += getActionRec(editAction1, LineActionType.DELETE); } return childActionCount; } public static long getMoves(EditTree editTree){ long childActionCount = 0; for(EditAction editAction1: editTree.getChildrenActions()){ childActionCount += getActionRec(editAction1,LineActionType.MOVE); } return childActionCount; } public static long getUpdates(EditTree editTree){ long childActionCount = 0; for(EditAction editAction1: editTree.getChildrenActions()){ childActionCount += getActionRec(editAction1, LineActionType.UPDATE); } return childActionCount; } private static long getActionRec(EditAction editAction, LineActionType type){ if(editAction.getChildrenActions() == null || editAction.getChildrenActions().size() < 1){ return editAction.getLinesBeforeActions().stream().filter(lineAction -> lineAction.getType() == type).count() + editAction.getLinesAfterActions().stream().filter(lineAction -> lineAction.getType() == type).count(); } long childActionCount = 0; for(EditAction editAction1: editAction.getChildrenActions()){ childActionCount += getActionRec(editAction1, type); } return editAction.getLinesBeforeActions().stream().filter(lineAction -> lineAction.getType() == type).count() + editAction.getLinesAfterActions().stream().filter(lineAction -> lineAction.getType() == type).count() + childActionCount; } }
[ "noah.chavannes@gmail.com" ]
noah.chavannes@gmail.com
597bbfcfe27f38c2d55872f48f12badb317d86cd
64b9ffabe34a31414ea08767ec9bd041c91561ba
/test/dao/CorrentistaDaoImplTest.java
20ea93514ebcd397f1784fe271f63962bc74258a
[]
no_license
roussenq/Desktop_hibernate
df68409037701466b9f21e42c06b42daaf40613b
b8e91a43e9b00d65eeeda81fdc57a4dd097dc280
refs/heads/master
2023-04-21T00:52:06.774749
2021-04-22T02:57:58
2021-04-22T02:57:58
353,218,877
0
0
null
null
null
null
UTF-8
Java
false
false
4,179
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 dao; import br.com.utilitario.UtilGerador; import entidade.Cartao; import entidade.Correntista; import java.math.BigDecimal; import java.util.Date; import java.util.List; import org.hibernate.Query; import org.hibernate.Session; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import org.junit.Test; /** * * @author David */ public class CorrentistaDaoImplTest { private Correntista correntista; private CorrentistaDao correntistaDao; private Session sessao; public CorrentistaDaoImplTest() { correntistaDao = new CorrentistaDaoImpl(); } //@Test public void testSalvarCorrentistaComCartao() { System.out.println("Salvar Correntista"); CartaoDaoImplTest cartaoTeste = new CartaoDaoImplTest(); correntista = new Correntista( null, UtilGerador.gerarNome(), new Date(), UtilGerador.gerarNumero(3)+"."+UtilGerador.gerarNumero(3),//+"."+ //UtilGerador.gerarNumero(3)+"-"+UtilGerador.gerarNumero(2), UtilGerador.gerarEmail(), BigDecimal.TEN, "Blablabla" ); Cartao cartao = cartaoTeste.buscaCartaoBd(); correntista.setCartao(cartao); sessao = HibernateUtil.abrirConexao(); correntistaDao.salvarOuAlterar(correntista, sessao); sessao.close(); assertNotNull(correntista.getId()); } //@Test public void testExcluirCorrentista() { System.out.println("Excluir Correntista"); buscaCorrentistaBd(); sessao = HibernateUtil.abrirConexao(); correntistaDao.excluir(correntista, sessao); Correntista correntistaExcluido = correntistaDao.pesquisarPorId(correntista.getId(), sessao); sessao.close(); assertNull(correntistaExcluido); } @Test public void testPesquisarPorId() { System.out.println("pesquisarPorId"); } @Test public void testPesquisarCorrentistaPorNome() { System.out.println("Correntista pesquisar por Nome"); buscaCorrentistaBd(); sessao = HibernateUtil.abrirConexao(); int tamanho = correntista.getNome().length(); String parteDoNome = correntista.getNome().substring(tamanho-5); List<Correntista> correntistas = correntistaDao.pesquisarPorNome(parteDoNome, sessao); sessao.close(); assertTrue(!correntistas.isEmpty()); } @Test public void testAlterarCorrentista() { System.out.println("Alterar correntista"); buscaCorrentistaBd(); correntista.setEmail("david@gmail.com"); sessao = HibernateUtil.abrirConexao(); correntistaDao.salvarOuAlterar(correntista, sessao); Correntista correntistaNovo = correntistaDao.pesquisarPorId(correntista.getId(), sessao); sessao.close(); assertEquals(correntista.getNome(), correntistaNovo.getNome()); } public Correntista buscaCorrentistaBd() { sessao = HibernateUtil.abrirConexao(); Query consulta = sessao.createQuery("from Correntista"); List<Correntista> correntistas = consulta.list(); sessao.close(); if (correntistas.isEmpty()) { testSalvarCorrentistaComCartao(); } else { correntista = correntistas.get(0); System.out.println("================================================"); System.out.println("Resultado da busca:" + correntistas.get(0).getNome()); } return correntista; } }
[ "davidroussenq@hotmail.com" ]
davidroussenq@hotmail.com
407687b25f8c99c300bf5507714860fa933ca1b2
e9affefd4e89b3c7e2064fee8833d7838c0e0abc
/aws-java-sdk-s3outposts/src/main/java/com/amazonaws/services/s3outposts/model/EndpointStatus.java
a7c86cc1cf6cd266b0bb8f0a6a976ae626dfcb32
[ "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
1,882
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.s3outposts.model; import javax.annotation.Generated; /** * */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public enum EndpointStatus { Pending("Pending"), Available("Available"), Deleting("Deleting"), Create_Failed("Create_Failed"), Delete_Failed("Delete_Failed"); private String value; private EndpointStatus(String value) { this.value = value; } @Override public String toString() { return this.value; } /** * Use this in place of valueOf. * * @param value * real value * @return EndpointStatus corresponding to the value * * @throws IllegalArgumentException * If the specified value does not map to one of the known values in this enum. */ public static EndpointStatus fromValue(String value) { if (value == null || "".equals(value)) { throw new IllegalArgumentException("Value cannot be null or empty!"); } for (EndpointStatus enumEntry : EndpointStatus.values()) { if (enumEntry.toString().equals(value)) { return enumEntry; } } throw new IllegalArgumentException("Cannot create enum from " + value + " value!"); } }
[ "" ]
5a72a4f879757e7f78789d0d7c3c3e86df1578c1
d8a9181d988bf59272a0d146eb08eb6c2813cfd9
/app/src/androidTest/java/com/example/bunker/ExampleInstrumentedTest.java
05c990bf5d6f704c2dcd1c5b9626a83641917936
[]
no_license
Shadrag/Bunker
8347b9599b10a4698fba6ca8987c67448652838a
53c8f4b237bd523db60d3c6fa38787951f8f3f40
refs/heads/master
2023-03-17T16:08:43.044363
2020-06-23T17:38:01
2020-06-23T17:38:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
752
java
package com.example.bunker; import android.content.Context; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); assertEquals("com.example.bunker", appContext.getPackageName()); } }
[ "zalipatr1@yandex.ru" ]
zalipatr1@yandex.ru
4fbc014525131f6b04405c2d0fa2aef85b2e7c88
d2bc4c72b7d7fe10c5848c29399c6c9c303cfd2d
/jargon-data-utils/src/main/java/org/irods/jargon/datautils/visitor/IrodsVisitedComposite.java
4c12e24ea929480e4fbde16a77e83ade15ba62b7
[ "LicenseRef-scancode-warranty-disclaimer", "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference" ]
permissive
DICE-UNC/jargon
0fac970241ac541b0e7e963f26e6329e566a45ed
8d949c4ad3fe5bfb8415b2251c6955036225c960
refs/heads/master
2023-08-31T04:11:26.193339
2023-07-18T15:57:52
2023-08-08T20:40:10
17,224,370
26
31
NOASSERTION
2023-08-08T20:40:12
2014-02-26T20:31:20
Java
UTF-8
Java
false
false
3,337
java
/** * */ package org.irods.jargon.datautils.visitor; import java.io.File; import org.irods.jargon.core.exception.JargonException; import org.irods.jargon.core.pub.IRODSFileSystemAO; import org.irods.jargon.core.pub.io.IRODSFileImpl; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Concrete implementation of an iRODS directory as visited by a hierarchical * visitor implementation * * @author conwaymc * */ public class IrodsVisitedComposite extends IrodsFileItem implements HierComposite { public static final Logger log = LoggerFactory.getLogger(IrodsVisitedComposite.class); private static final long serialVersionUID = 2022187755904761797L; /** * @param pathName * {@code String} with dir path * @param irodsFileSystemAO * {@link IRODSFileSystemAO} * * @throws JargonException * {@link JargonException} */ public IrodsVisitedComposite(final String pathName, final IRODSFileSystemAO irodsFileSystemAO) throws JargonException { super(pathName, irodsFileSystemAO); } /** * @param parent * {@code String} with the parent * @param child * {@code String} with the child * @param irodsFileSystemAO * {@link IRODSFileSystemAO} * @throws JargonException * {@link JargonException} */ public IrodsVisitedComposite(final String parent, final String child, final IRODSFileSystemAO irodsFileSystemAO) throws JargonException { super(parent, child, irodsFileSystemAO); } /** * @param parent * {@link File} with the parent * @param child * {@code String} with the child * @param irodsFileSystemAO * {@link IRODSFileSystemAO} * @throws JargonException * {@link JargonException} */ public IrodsVisitedComposite(final File parent, final String child, final IRODSFileSystemAO irodsFileSystemAO) throws JargonException { super(parent, child, irodsFileSystemAO); } public IrodsVisitedComposite(final IRODSFileImpl irodsFile) throws JargonException { this(irodsFile.getAbsolutePath(), irodsFile.getIrodsFileSystemAO()); } /* * (non-Javadoc) * * @see * org.irods.jargon.datautils.visitor.HierComponent#accept(org.irods.jargon. * datautils.visitor.HierVisitor) */ @Override public boolean accept(final HierVisitor visitor) throws JargonException { log.info("accept()"); if (visitor == null) { throw new IllegalArgumentException("null visitor"); } log.debug("check if enter at:{}", getAbsolutePath()); boolean visitorEntered = visitor.visitEnter(this); if (visitorEntered) { // enter this node? log.debug("entering..."); for (File file : this.listFiles()) { if (file.isDirectory()) { IrodsVisitedComposite child = new IrodsVisitedComposite((IRODSFileImpl) file); if (!child.accept(visitor)) { log.info("child doesn't accept, short circuit rest of siblings at:{}", child.getAbsolutePath()); break; } } else { IrodsVisitedLeaf leaf = new IrodsVisitedLeaf((IRODSFileImpl) file); if (!leaf.accept(visitor)) { log.info("child doesn't accept, short circuit rest of siblings at:{}", leaf.getAbsolutePath()); break; } } } } log.debug("done with children..."); return visitor.visitLeave(this, visitorEntered); } }
[ "mike.conway@nih.gov" ]
mike.conway@nih.gov
d0a3235b79b94a028929f50e985bf07f034c38e3
c62447812c47e77006c66825ea9ce31607cbafc9
/concurrence-modules/src/main/java/com/valentine/multithread/volatiledemo/Demo.java
3aad4c6dd50b33880f5de79f4042c09906a69e64
[]
no_license
ValentineLiang/valentine-study-project
5e244ad27471326d32a2a80911f6637de771d3f9
845a84e46e49181a9186d8c5acfecea214195277
refs/heads/master
2020-04-08T12:52:24.338889
2019-03-29T10:10:37
2019-03-29T10:10:37
159,365,121
0
0
null
null
null
null
UTF-8
Java
false
false
1,025
java
package com.valentine.multithread.volatiledemo; public class Demo { private final Object lock = new Object(); private static int count = 0; public void demo() { // 对象锁,这个对象的作用域是大多,这个锁的范围就是多大 synchronized (this) { } // 全局锁 synchronized (Demo.class) { } synchronized (lock) { } } // 全局锁 public synchronized static void incr() { try { Thread.sleep(1); } catch (InterruptedException e) { e.printStackTrace(); } count ++; System.out.println(count); } // 对象锁 public synchronized void incr1() { } public static void main(String[] args) { Demo demo1 = new Demo(); Demo demo2 = new Demo(); demo1.demo(); demo2.demo(); for (int i=0;i<100;i++) { new Thread(()->{ Demo.incr(); }).start(); } } }
[ "ki-love999@163.com" ]
ki-love999@163.com
973dde11fed1e37c0dcd47dd0218abd1db0d456e
87915863aefd9b5d0d777a97066c35aafd91a969
/src/test/java/com/perfectsense/blog/web/rest/AuditResourceIntTest.java
504bd160c57851bd9e886736993070baee996a56
[]
no_license
kleiner617/PerfectSenseBlog
6626d422a6fe6621d521c68ac203033f13ef203f
dc36a634ca180e3f5e3e7ee7fe5099ecd49d3d25
refs/heads/master
2021-07-15T10:18:53.750182
2017-10-20T21:26:33
2017-10-20T21:26:33
107,356,352
0
0
null
null
null
null
UTF-8
Java
false
false
5,997
java
package com.perfectsense.blog.web.rest; import com.perfectsense.blog.PerfectSenseBlogApp; import com.perfectsense.blog.config.audit.AuditEventConverter; import com.perfectsense.blog.domain.PersistentAuditEvent; import com.perfectsense.blog.repository.PersistenceAuditEventRepository; import com.perfectsense.blog.service.AuditEventService; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.MockitoAnnotations; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.data.web.PageableHandlerMethodArgumentResolver; import org.springframework.format.support.FormattingConversionService; import org.springframework.http.MediaType; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.transaction.annotation.Transactional; import java.time.Instant; import java.time.format.DateTimeFormatter; import static org.hamcrest.Matchers.hasItem; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; /** * Test class for the AuditResource REST controller. * * @see AuditResource */ @RunWith(SpringRunner.class) @SpringBootTest(classes = PerfectSenseBlogApp.class) @Transactional public class AuditResourceIntTest { private static final String SAMPLE_PRINCIPAL = "SAMPLE_PRINCIPAL"; private static final String SAMPLE_TYPE = "SAMPLE_TYPE"; private static final Instant SAMPLE_TIMESTAMP = Instant.parse("2015-08-04T10:11:30Z"); private static final long SECONDS_PER_DAY = 60*60*24; @Autowired private PersistenceAuditEventRepository auditEventRepository; @Autowired private AuditEventConverter auditEventConverter; @Autowired private MappingJackson2HttpMessageConverter jacksonMessageConverter; @Autowired private FormattingConversionService formattingConversionService; @Autowired private PageableHandlerMethodArgumentResolver pageableArgumentResolver; private PersistentAuditEvent auditEvent; private MockMvc restAuditMockMvc; @Before public void setup() { MockitoAnnotations.initMocks(this); AuditEventService auditEventService = new AuditEventService(auditEventRepository, auditEventConverter); AuditResource auditResource = new AuditResource(auditEventService); this.restAuditMockMvc = MockMvcBuilders.standaloneSetup(auditResource) .setCustomArgumentResolvers(pageableArgumentResolver) .setConversionService(formattingConversionService) .setMessageConverters(jacksonMessageConverter).build(); } @Before public void initTest() { auditEventRepository.deleteAll(); auditEvent = new PersistentAuditEvent(); auditEvent.setAuditEventType(SAMPLE_TYPE); auditEvent.setPrincipal(SAMPLE_PRINCIPAL); auditEvent.setAuditEventDate(SAMPLE_TIMESTAMP); } @Test public void getAllAudits() throws Exception { // Initialize the database auditEventRepository.save(auditEvent); // Get all the audits restAuditMockMvc.perform(get("/management/audits")) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)) .andExpect(jsonPath("$.[*].principal").value(hasItem(SAMPLE_PRINCIPAL))); } @Test public void getAudit() throws Exception { // Initialize the database auditEventRepository.save(auditEvent); // Get the audit restAuditMockMvc.perform(get("/management/audits/{id}", auditEvent.getId())) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)) .andExpect(jsonPath("$.principal").value(SAMPLE_PRINCIPAL)); } @Test public void getAuditsByDate() throws Exception { // Initialize the database auditEventRepository.save(auditEvent); // Generate dates for selecting audits by date, making sure the period will contain the audit String fromDate = SAMPLE_TIMESTAMP.minusSeconds(SECONDS_PER_DAY).toString().substring(0,10); String toDate = SAMPLE_TIMESTAMP.plusSeconds(SECONDS_PER_DAY).toString().substring(0,10); // Get the audit restAuditMockMvc.perform(get("/management/audits?fromDate="+fromDate+"&toDate="+toDate)) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)) .andExpect(jsonPath("$.[*].principal").value(hasItem(SAMPLE_PRINCIPAL))); } @Test public void getNonExistingAuditsByDate() throws Exception { // Initialize the database auditEventRepository.save(auditEvent); // Generate dates for selecting audits by date, making sure the period will not contain the sample audit String fromDate = SAMPLE_TIMESTAMP.minusSeconds(2*SECONDS_PER_DAY).toString().substring(0,10); String toDate = SAMPLE_TIMESTAMP.minusSeconds(SECONDS_PER_DAY).toString().substring(0,10); // Query audits but expect no results restAuditMockMvc.perform(get("/management/audits?fromDate=" + fromDate + "&toDate=" + toDate)) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)) .andExpect(header().string("X-Total-Count", "0")); } @Test public void getNonExistingAudit() throws Exception { // Get the audit restAuditMockMvc.perform(get("/management/audits/{id}", Long.MAX_VALUE)) .andExpect(status().isNotFound()); } }
[ "kleiner617@gmail.com" ]
kleiner617@gmail.com
9d89d391d53f9f291b7b99192e07e407a083743f
166fcf3c2d466ee75a73b1d411f884121a82e49d
/src/main/java/com/pro/system/controller/DepartmentController.java
a6a78c1f4998ced91ee12849027fca9a37d825f9
[]
no_license
xk2008189/mng
b430184d7768b5f901ea79600382d99a1ba10a32
a5b3f6450e77633c170ebfebcfd2f9c0234c26c8
refs/heads/master
2021-09-05T14:06:50.901969
2018-01-28T14:22:24
2018-01-28T14:22:24
108,933,582
0
0
null
null
null
null
UTF-8
Java
false
false
6,687
java
package com.pro.system.controller; import java.text.ParseException; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import javax.servlet.http.HttpServletRequest; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import com.pro.common.Util.UserUtil; import com.pro.system.entity.Department; import com.pro.system.service.DepartmentService; /** * 用户管理 * * @author xiangkun * */ @Controller @RequestMapping("/department") public class DepartmentController { @Autowired private DepartmentService departmentService; @RequestMapping("/departmentList.do") public String index(Model model, HttpServletRequest request) throws ParseException{ return "system/department/departmentList"; } /** * 获取部门树数据 * @return */ @RequestMapping("/getTreeData.do") @ResponseBody public Map<String,Object> getTreeData(){ Map<String,Object> resultMap = new HashMap<String,Object>(); try { Department department = new Department(); List<Map<String,Object>> treeData = departmentService.getTreeData(department); resultMap.put("OK", 1); resultMap.put("treeData", treeData); } catch (Exception e) { e.printStackTrace(); resultMap.put("OK", -1); resultMap.put("msg", e.getMessage()); } return resultMap; } /** * 获取部门数据 * @return */ @RequestMapping("/getTreeTableData.do") @ResponseBody public Map<String,Object> getTreeTableData(@RequestParam(value="departmentId", required=false) String departmentId){ Map<String,Object> resultMap = new HashMap<String,Object>(); try { if (StringUtils.isBlank(departmentId)) { departmentId = "1"; } List<Department> departmentList = departmentService.getTreeTableData(departmentId); resultMap.put("OK", 1); resultMap.put("departmentList", departmentList); } catch (Exception e) { e.printStackTrace(); resultMap.put("OK", -1); resultMap.put("msg", e.getMessage()); } return resultMap; } @RequestMapping("/departmentAdd.do") public String departmentAdd( Model model, @RequestParam(value="parentId", required=true) String parentId){ model.addAttribute("parentId", parentId); return "system/department/departmentAdd"; } /** * 添加 * @return */ @RequestMapping("/add.do") @ResponseBody public Map<String,Object> add(Department department){ Map<String,Object> resultMap = new HashMap<String,Object>(); try { String parentId = department.getParentId(); if (StringUtils.isBlank(parentId)) { resultMap.put("OK", -1); resultMap.put("msg", "缺少父节点ID"); } Department parentDepartment = departmentService.selectByPrimaryKey(parentId); String parentGrade = parentDepartment.getGrade(); department.setGrade((Integer.parseInt(parentGrade) + 1) + ""); // 更新排序 String parentSort = parentDepartment.getSort(); List<Department> departmentChildList = departmentService.findChildList(parentDepartment); if (departmentChildList != null && departmentChildList.size() > 0) { String lastSort = departmentChildList.get(0).getSort(); String lastIndextStr = lastSort.replace(parentSort + "_", ""); int lastIndex = Integer.parseInt(lastIndextStr); String sort = parentSort + "_" + (lastIndex + 1); department.setSort(sort); } else { String sort = parentSort + "_1"; department.setSort(sort); } String username = UserUtil.getLoginUserName(); Date now = new Date(); department.setId(UUID.randomUUID().toString()); department.setDelFlag("0"); department.setUseable("0"); department.setCreateBy(username); department.setCreateDate(now); department.setUpdateBy(username); department.setUpdateDate(now); departmentService.insert(department); resultMap.put("OK", 1); } catch (Exception e) { e.printStackTrace(); resultMap.put("OK", -1); resultMap.put("msg", e.getMessage()); } return resultMap; } @RequestMapping("/departmentUpdate.do") public String departmentUpdate( Model model, @RequestParam(value="departmentId", required=true) String departmentId){ Department department = departmentService.selectByPrimaryKey(departmentId); model.addAttribute("department", department); return "system/department/departmentUpdate"; } /** * 修改 * @return */ @RequestMapping("/update.do") @ResponseBody public Map<String,Object> update(Department department){ Map<String,Object> resultMap = new HashMap<String,Object>(); try { String departmentname = UserUtil.getLoginUserName(); Date now = new Date(); department.setUpdateBy(departmentname); department.setUpdateDate(now); departmentService.updateByPrimaryKeySelective(department); resultMap.put("OK", 1); } catch (Exception e) { e.printStackTrace(); resultMap.put("OK", -1); resultMap.put("msg", e.getMessage()); } return resultMap; } /** * 删除 * @return */ @RequestMapping("/delete.do") @ResponseBody public Map<String,Object> delete(@RequestParam(value="departmentId", required=true) String departmentId){ Map<String,Object> resultMap = new HashMap<String,Object>(); try { Department department = departmentService.selectByPrimaryKey(departmentId); List<Department> departmentChildList = departmentService.findChildList(department); if (departmentChildList != null && departmentChildList.size() > 0) { resultMap.put("OK", -1); resultMap.put("msg", "请先删除子节点"); } else { departmentService.deleteByPrimaryKey(departmentId); resultMap.put("OK", 1); } } catch (Exception e) { e.printStackTrace(); resultMap.put("OK", -1); resultMap.put("msg", e.getMessage()); } return resultMap; } }
[ "kun.xiang@pinkitec.com" ]
kun.xiang@pinkitec.com
a1345f1e820490ed412db066b9130a7de3812a74
fff3302fe8193d13360f12e5b13d376ef76cf4d6
/AppLock/com/google/firebase/iid/FirebaseInstanceId.java
266368abc0c36381e7b33a2b6d0731afaf36d23c
[]
no_license
shaolin-example-com-my-shopify-com/KidWatcher
2912950b7ca4773c3d29005b9d231ad6035b4912
f67a81b757043159ea358b7f9e4b16fd6be0e0c0
refs/heads/master
2022-04-25T17:19:28.800922
2020-04-30T02:53:20
2020-04-30T02:53:20
260,098,439
0
0
null
2020-04-30T02:51:49
2020-04-30T02:51:48
null
UTF-8
Java
false
false
6,805
java
package com.google.firebase.iid; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager.NameNotFoundException; import android.os.Bundle; import android.support.annotation.Keep; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.annotation.WorkerThread; import android.support.v4.util.ArrayMap; import android.util.Base64; import android.util.Log; import com.google.firebase.C3531b; import com.google.firebase.iid.C3608h.C3607a; import java.io.IOException; import java.security.KeyPair; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.Map; public class FirebaseInstanceId { private static Map<String, FirebaseInstanceId> f12210a = new ArrayMap(); private static C3600e f12211b; private final C3531b f12212c; private final C3599d f12213d; private final String f12214e = m15615b(); private FirebaseInstanceId(C3531b c3531b, C3599d c3599d) { this.f12212c = c3531b; this.f12213d = c3599d; if (this.f12214e == null) { throw new IllegalStateException("IID failing to initialize, FirebaseApp is missing project ID"); } FirebaseInstanceIdService.m15635a(this.f12212c.m15431a(), this); } static int m15603a(Context context) { return m15604a(context, context.getPackageName()); } static int m15604a(Context context, String str) { int i = 0; try { return context.getPackageManager().getPackageInfo(str, 0).versionCode; } catch (NameNotFoundException e) { String valueOf = String.valueOf(e); Log.w("FirebaseInstanceId", new StringBuilder(String.valueOf(valueOf).length() + 23).append("Failed to find package ").append(valueOf).toString()); return i; } } public static FirebaseInstanceId m15605a() { return getInstance(C3531b.m15427d()); } static String m15606a(KeyPair keyPair) { try { byte[] digest = MessageDigest.getInstance("SHA1").digest(keyPair.getPublic().getEncoded()); digest[0] = (byte) (((digest[0] & 15) + 112) & 255); return Base64.encodeToString(digest, 0, 8, 11); } catch (NoSuchAlgorithmException e) { Log.w("FirebaseInstanceId", "Unexpected error, device missing required alghorithms"); return null; } } static String m15607a(byte[] bArr) { return Base64.encodeToString(bArr, 11); } static void m15608a(Context context, C3608h c3608h) { c3608h.m15716c(); Intent intent = new Intent(); intent.putExtra("CMD", "RST"); C3606g.m15695a().m15700a(context, intent); } private void m15609a(Bundle bundle) { bundle.putString("gmp_app_id", this.f12212c.m15436c().m15450b()); } static String m15610b(Context context) { try { return context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName; } catch (NameNotFoundException e) { String valueOf = String.valueOf(e); Log.w("FirebaseInstanceId", new StringBuilder(String.valueOf(valueOf).length() + 38).append("Never happens: can't find own package ").append(valueOf).toString()); return null; } } static void m15611c(Context context) { Intent intent = new Intent(); intent.putExtra("CMD", "SYNC"); C3606g.m15695a().m15700a(context, intent); } @Keep public static synchronized FirebaseInstanceId getInstance(@NonNull C3531b c3531b) { FirebaseInstanceId firebaseInstanceId; synchronized (FirebaseInstanceId.class) { firebaseInstanceId = (FirebaseInstanceId) f12210a.get(c3531b.m15436c().m15450b()); if (firebaseInstanceId == null) { C3599d a = C3599d.m15657a(c3531b.m15431a(), null); if (f12211b == null) { f12211b = new C3600e(a.m15662c()); } firebaseInstanceId = new FirebaseInstanceId(c3531b, a); f12210a.put(c3531b.m15436c().m15450b(), firebaseInstanceId); } } return firebaseInstanceId; } @WorkerThread public String m15612a(String str, String str2) { Bundle bundle = new Bundle(); m15609a(bundle); return this.f12213d.m15660b(str, str2, bundle); } public String m15613a(String str, String str2, Bundle bundle) { m15609a(bundle); return this.f12213d.m15663c(str, str2, bundle); } void m15614a(String str) { C3607a d = m15618d(); if (d == null || d.m15704b(C3599d.f12248e)) { throw new IOException("token not available"); } Bundle bundle = new Bundle(); String str2 = "gcm.topic"; String valueOf = String.valueOf("/topics/"); String valueOf2 = String.valueOf(str); bundle.putString(str2, valueOf2.length() != 0 ? valueOf.concat(valueOf2) : new String(valueOf)); String str3 = d.f12284a; str2 = String.valueOf("/topics/"); valueOf2 = String.valueOf(str); m15613a(str3, valueOf2.length() != 0 ? str2.concat(valueOf2) : new String(str2), bundle); } String m15615b() { String d = this.f12212c.m15436c().m15452d(); if (d != null) { return d; } d = this.f12212c.m15436c().m15450b(); if (!d.startsWith("1:")) { return d; } String[] split = d.split(":"); if (split.length < 2) { return null; } d = split[1]; return d.isEmpty() ? null : d; } void m15616b(String str) { C3607a d = m15618d(); if (d == null || d.m15704b(C3599d.f12248e)) { throw new IOException("token not available"); } Bundle bundle = new Bundle(); String str2 = "gcm.topic"; String valueOf = String.valueOf("/topics/"); String valueOf2 = String.valueOf(str); bundle.putString(str2, valueOf2.length() != 0 ? valueOf.concat(valueOf2) : new String(valueOf)); C3599d c3599d = this.f12213d; String str3 = d.f12284a; valueOf = String.valueOf("/topics/"); valueOf2 = String.valueOf(str); c3599d.m15659a(str3, valueOf2.length() != 0 ? valueOf.concat(valueOf2) : new String(valueOf), bundle); } public String m15617c() { return m15606a(this.f12213d.m15658a()); } @Nullable C3607a m15618d() { return this.f12213d.m15662c().m15710a("", this.f12214e, "*"); } String m15619e() { return m15612a(this.f12214e, "*"); } C3600e m15620f() { return f12211b; } }
[ "Nist@netcompany.com" ]
Nist@netcompany.com
60496a946456e321f82d19bfedfb9746d20e026c
7c8c67fd7990ffde5ce3f42748cf88120ffbdec1
/src/test/java/org/openqa/selenium/htmlunit/junit/package-info.java
aa2e79e6fcd03752f389ed26d5b9299a528a157f
[ "Apache-2.0" ]
permissive
SeleniumHQ/htmlunit-driver
97ec4fee5e039372c73fced0f4122f4e633e7189
9a5797782cbfedbf88b667597880957ac7986d26
refs/heads/master
2023-09-01T01:55:09.528235
2023-08-02T17:11:50
2023-08-02T17:12:57
51,905,729
253
117
Apache-2.0
2022-06-14T16:42:19
2016-02-17T08:07:17
JavaScript
UTF-8
Java
false
false
901
java
// Licensed to the Software Freedom Conservancy (SFC) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The SFC licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. /** * JUnit extensions used for the test suite. */ package org.openqa.selenium.htmlunit.junit;
[ "rbri@rbri.de" ]
rbri@rbri.de
814d3cbe603cc82d6c258f96af24fe050265ac36
a162da8f1bf22c299f1433a19fd8ba9563a9065b
/calendarview/src/main/java/com/haibin/calendarview/DefaultMonthView.java
4ba703fd8639da3270e11939dd7d3a9550b22410
[ "Apache-2.0" ]
permissive
ljl2014/CalendarView-2
78d2397ee989083c47350116d1261dd0ef5e9791
5174b5068f9de399a177558887a61cb6dde3da8c
refs/heads/master
2021-09-05T04:02:00.238674
2018-01-24T02:21:57
2018-01-24T02:21:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,775
java
package com.haibin.calendarview; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; /** * 默认高仿魅族日历布局 * Created by huanghaibin on 2017/11/15. */ public class DefaultMonthView extends MonthView { private Paint mTextPaint = new Paint(); private Paint mSchemeBasicPaint = new Paint(); private float mRadio; private int mPadding; private float mSchemeBaseLine; public DefaultMonthView(Context context) { super(context); mTextPaint.setTextSize(Util.dipToPx(context, 8)); mTextPaint.setColor(0xffFFFFFF); mTextPaint.setAntiAlias(true); mTextPaint.setFakeBoldText(true); mSchemeBasicPaint.setAntiAlias(true); mSchemeBasicPaint.setStyle(Paint.Style.FILL); mSchemeBasicPaint.setTextAlign(Paint.Align.CENTER); mSchemeBasicPaint.setColor(0xffed5353); mSchemeBasicPaint.setFakeBoldText(true); mRadio = Util.dipToPx(getContext(), 7); mPadding = Util.dipToPx(getContext(), 4); Paint.FontMetrics metrics = mSchemeBasicPaint.getFontMetrics(); mSchemeBaseLine = mRadio - metrics.descent + (metrics.bottom - metrics.top) / 2 + Util.dipToPx(getContext(), 1); } /** * * @param canvas canvas * @param calendar 日历日历calendar * @param x 日历Card x起点坐标 * @param y 日历Card y起点坐标 * @param hasScheme hasScheme 非标记的日期 * @return true 则绘制onDrawScheme,因为这里背景色不是是互斥的 */ @Override protected boolean onDrawSelected(Canvas canvas, Calendar calendar, int x, int y, boolean hasScheme) { mSelectedPaint.setStyle(Paint.Style.FILL); mSelectedPaint.setColor(0x80cfcfcf); canvas.drawRect(x + mPadding, y + mPadding, x + mItemWidth - mPadding, y + mItemHeight - mPadding, mSelectedPaint); return true; } @Override protected void onDrawScheme(Canvas canvas, Calendar calendar, int x, int y) { mSchemeBasicPaint.setColor(calendar.getSchemeColor()); canvas.drawCircle(x + mItemWidth - mPadding - mRadio / 2, y + mPadding + mRadio, mRadio, mSchemeBasicPaint); canvas.drawText(calendar.getScheme(), x + mItemWidth - mPadding - mRadio, y + mPadding + mSchemeBaseLine, mTextPaint); } @Override protected void onDrawText(Canvas canvas, Calendar calendar, int x, int y, boolean hasScheme, boolean isSelected) { int cx = x + mItemWidth / 2; int top = y - mItemHeight / 6; if (isSelected) { canvas.drawText(String.valueOf(calendar.getDay()), cx, mTextBaseLine + top, mSelectTextPaint); canvas.drawText(calendar.getLunar(), cx, mTextBaseLine + y + mItemHeight / 10, mSelectedLunarTextPaint); } else if (hasScheme) { canvas.drawText(String.valueOf(calendar.getDay()), cx, mTextBaseLine + top, calendar.isCurrentMonth() ? mSchemeTextPaint : mOtherMonthTextPaint); canvas.drawText(calendar.getLunar(), cx, mTextBaseLine + y + mItemHeight / 10, mSchemeLunarTextPaint); } else { canvas.drawText(String.valueOf(calendar.getDay()), cx, mTextBaseLine + top, calendar.isCurrentDay() ? mCurDayTextPaint : calendar.isCurrentMonth() ? mCurMonthTextPaint : mOtherMonthTextPaint); canvas.drawText(calendar.getLunar(), cx, mTextBaseLine + y + mItemHeight / 10, calendar.isCurrentDay() ? mCurDayLunarTextPaint : calendar.isCurrentMonth() ? mCurMonthLunarTextPaint : mOtherMonthLunarTextPaint); } } }
[ "huanghaibin_dev@163.com" ]
huanghaibin_dev@163.com
1289141867c5dc15bdb34aaafd75bb5d79d474d6
eb04e6d1992b99b4906487663a35e67f6c0b2321
/myFirstProject/src/main/java/com/example/myfirstproject/domain/Greeting.java
75c0e3eafc655dffb3e1d5ba70a2606e96089d69
[]
no_license
atawakol/myFirstProject
320a8a2fa3021840dffcf95e45abf9f80b0e027a
09a59630beaca69aef5b1d80425bbd7abe36186c
refs/heads/master
2021-01-20T20:14:56.658537
2016-07-29T16:52:16
2016-07-29T16:52:16
64,495,968
0
0
null
null
null
null
UTF-8
Java
false
false
1,005
java
package com.example.myfirstproject.domain; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; @Entity public class Greeting { @Id @GeneratedValue(strategy=GenerationType.AUTO) private long id; private String content; private String ndContent; public Greeting(){} public Greeting(String con, String content) { this.ndContent = con; this.content = content; } public Greeting(long con, String content) { this.id = con; this.content = content; } public long getId() { return id; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public String getNdContent() { return ndContent; } public void setNdContent(String ndContent) { this.ndContent = ndContent; } @Override public String toString() { return "Greeting [id=" + id + ", content=" + content + ", ndContent=" + ndContent + "]"; } }
[ "atawakol@localhost" ]
atawakol@localhost
6b1b3f1da88ca49c70eb3d92a5c1197138713281
81c928f0ddbe425f5e78fc70656042a3d5b9a869
/app/src/main/java/com/techuva/councellorapp/contusfly_corporate/views/CircularImageView.java
088fe62cb70999eda365753008d9f5c785f79df7
[]
no_license
nikks-tu/CouncellorApp
a0b46d85036c86ba53c8f4181a699a879fb72b87
11d03376f39607741b24cef16bb68759e74821af
refs/heads/master
2022-05-21T03:36:41.951614
2020-04-20T17:03:16
2020-04-20T17:03:16
257,349,410
1
0
null
null
null
null
UTF-8
Java
false
false
6,764
java
/** * @category ContusMessanger * @package com.contusfly.views * @version 1.0 * @author ContusTeam <developers@contus.in> * @copyright Copyright (C) 2015 <Contus>. All rights reserved. * @license http://www.apache.org/licenses/LICENSE-2.0 */ package com.techuva.councellorapp.contusfly_corporate.views; import android.annotation.SuppressLint; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Bitmap; import android.graphics.BitmapShader; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Shader; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.widget.ImageView; import com.techuva.councellorapp.R; /** * The Class CircularImageView. */ public class CircularImageView extends ImageView { /** The border width. */ private float canvasSize, borderWidth; /** The image. */ private Bitmap image; /** The paint. */ private Paint paint; /** The paint border. */ private Paint paintBorder; /** * Instantiates a new circular image view. * * @param context * the context */ public CircularImageView(final Context context) { this(context, null); } /** * Instantiates a new circular image view. * * @param context * the context * @param attrs * the attrs */ public CircularImageView(Context context, AttributeSet attrs) { this(context, attrs, R.attr.circularImageViewStyle); } /** * Instantiates a new circular image view. * * @param context * the context * @param attrs * the attrs * @param defStyle * the def style */ public CircularImageView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); paint = new Paint(); paint.setAntiAlias(true); paintBorder = new Paint(); paintBorder.setAntiAlias(true); TypedArray attributes = context.obtainStyledAttributes(attrs, R.styleable.CircularImageView, defStyle, 0); if (attributes.getBoolean(R.styleable.CircularImageView_border, true)) { setBorderWidth(attributes.getDimensionPixelOffset( R.styleable.CircularImageView_border_width, 0)); setBorderColor(attributes.getColor( R.styleable.CircularImageView_border_color, Color.WHITE)); } } /** * Sets the border width. * * @param borderWidth * the new border width */ public void setBorderWidth(int borderWidth) { this.borderWidth = borderWidth; this.requestLayout(); this.invalidate(); } /** * Sets the border color. * * @param borderColor * the new border color */ public void setBorderColor(int borderColor) { if (paintBorder != null) paintBorder.setColor(borderColor); this.invalidate(); } /** * Adds the shadow. */ public void addShadow() { setLayerType(LAYER_TYPE_SOFTWARE, paintBorder); paintBorder.setShadowLayer(4.0f, 0.0f, 2.0f, Color.BLACK); } /* * (non-Javadoc) * * @see android.widget.ImageView#onDraw(android.graphics.Canvas) */ @SuppressLint("DrawAllocation") @Override public void onDraw(Canvas canvas) { image = drawableToBitmap(getDrawable()); if (image != null) { canvasSize = canvas.getWidth(); if (canvas.getHeight() < canvasSize) canvasSize = canvas.getHeight(); BitmapShader shader = new BitmapShader(Bitmap.createScaledBitmap( image, (int) canvasSize, (int) canvasSize, false), Shader.TileMode.CLAMP, Shader.TileMode.CLAMP); paint.setShader(shader); float circleCenter = (canvasSize - (borderWidth * 2)) / 2; canvas.drawCircle(circleCenter + borderWidth, circleCenter + borderWidth, ((canvasSize - (borderWidth * 2)) / 2) + borderWidth - 4, paintBorder); canvas.drawCircle(circleCenter + borderWidth, circleCenter + borderWidth, ((canvasSize - (borderWidth * 2)) / 2) - 4, paint); } } /* * (non-Javadoc) * * @see android.widget.ImageView#onMeasure(int, int) */ @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int width = measureWidth(widthMeasureSpec); int height = measureHeight(heightMeasureSpec); setMeasuredDimension(width, height); } /** * Measure width. * * @param measureSpec * the measure spec * @return the int */ private int measureWidth(int measureSpec) { int result = 0; int specMode = MeasureSpec.getMode(measureSpec); int specSize = MeasureSpec.getSize(measureSpec); if (specMode == MeasureSpec.EXACTLY) { result = specSize; } else if (specMode == MeasureSpec.AT_MOST) { result = specSize; } else { result = (int) canvasSize; } return result; } /** * Measure height. * * @param measureSpecHeight * the measure spec height * @return the int */ private int measureHeight(int measureSpecHeight) { int result = 0; int specMode = MeasureSpec.getMode(measureSpecHeight); int specSize = MeasureSpec.getSize(measureSpecHeight); if (specMode == MeasureSpec.EXACTLY) { result = specSize; } else if (specMode == MeasureSpec.AT_MOST) { result = specSize; } else { result = (int) canvasSize; } return result; } /** * Drawable to bitmap. * * @param drawable * the drawable * @return the bitmap */ public Bitmap drawableToBitmap(Drawable drawable) { if (drawable == null) { return null; } else if (drawable instanceof BitmapDrawable) { return ((BitmapDrawable) drawable).getBitmap(); } Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(bitmap); drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight()); drawable.draw(canvas); return bitmap; } }
[ "nikita@vishwakarma7@gmail.com" ]
nikita@vishwakarma7@gmail.com
7badc2166fc64e74d2c669bd1055fb8bee507833
0ceafc2afe5981fd28ce0185e0170d4b6dbf6241
/AlgoKit (3rdp)/Code-store v1.0/yaal/lib/test/on2013_04/on2013_04_07_OpenCup_America_GP/TaskJ/TaskJTestCase.java
55601d06f3dd417953a6542a037a665f4f5732a3
[]
no_license
brainail/.happy-coooding
1cd617f6525367133a598bee7efb9bf6275df68e
cc30c45c7c9b9164095905cc3922a91d54ecbd15
refs/heads/master
2021-06-09T02:54:36.259884
2021-04-16T22:35:24
2021-04-16T22:35:24
153,018,855
2
1
null
null
null
null
UTF-8
Java
false
false
1,467
java
package on2013_04.on2013_04_07_OpenCup_America_GP.TaskJ; import net.egork.chelper.task.Test; import net.egork.chelper.tester.TestProvider; import net.egork.chelper.tester.TestCase; import net.egork.utils.io.OutputWriter; import java.util.*; import java.io.StringWriter; public class TaskJTestCase { @TestCase public Collection<Test> loadTests() { List<Test> tests = new ArrayList<Test>(); Random random = new Random(239); int testCount = 1; for (int testNumber = 0; testNumber < testCount; testNumber++) { StringWriter sw = new StringWriter(); OutputWriter out = new OutputWriter(sw); for (int i = 0; i< 4000; ++i) out.print("("); for (int i = 0; i< 4000; ++i) out.print(")"); out.printLine(); out.printLine(0); tests.add(new Test(sw.toString())); } return tests; } @TestCase public Collection<Test> accuracyTests() { List<Test> tests = new ArrayList<Test>(); Random random = new Random(239); int testCount = 0; for (int testNumber = 0; testNumber < testCount; testNumber++) { StringWriter sw = new StringWriter(); OutputWriter out = new OutputWriter(sw); StringWriter swAnswer = new StringWriter(); OutputWriter outAnswer = new OutputWriter(swAnswer); tests.add(new Test(sw.toString(), swAnswer.toString())); } return tests; } }
[ "wsemirz@gmail.com" ]
wsemirz@gmail.com
4b0cdf00fe32d00adcac055f3a3b185b8ece8158
9a4fd85e98f53a9b47928dff6f9a7011de4c1696
/JDBC1/src/main/java/pl/alx/kurs/jdbc1/Glowna.java
e0a291fa8b769044307bcb2a2be39048a08ae36e
[]
no_license
jowinia/szkoleniowo
acfd293c117cf33c7214fdd00adb726329961dca
f4d3e77f221ea23bb29e70f947d97965dccae43c
refs/heads/master
2021-01-21T15:17:29.929114
2017-05-20T16:24:07
2017-05-20T16:24:07
91,835,942
0
0
null
null
null
null
UTF-8
Java
false
false
2,390
java
package pl.alx.kurs.jdbc1; import java.io.Closeable; import java.io.File; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import javax.swing.JOptionPane; public class Glowna { public static void main(String[] args) throws SQLException { File plik = new File("baza.db"); if (!plik.exists()) { try (Connection polaczenie = DriverManager.getConnection("jdbc:sqlite:baza.db"); Statement createTable = polaczenie.createStatement()) { createTable.executeUpdate("CREATE TABLE `pracownicy` (\n" + " `id` INTEGER,\n" + " `imie` TEXT,\n" + " `waga` INTEGER,\n" + " `wzrost` INTEGER,\n" + " PRIMARY KEY(`id`)\n" + ");"); } } try ( Connection polaczenie = DriverManager.getConnection("jdbc:sqlite:baza.db"); PreparedStatement zapytanieSelect = polaczenie.prepareStatement("select * from pracownicy where imie = ?"); PreparedStatement zapytanieInsert = polaczenie.prepareStatement("insert into pracownicy (imie, waga, wzrost) values (?, ?, ?)")) { String imieDoWstawienia = JOptionPane.showInputDialog("podaj imię nowego pracownika"); String wagaDoWstawienia = JOptionPane.showInputDialog("podaj wagę nowego pracownika"); String wzrostDoWstawienia = JOptionPane.showInputDialog("podaj wzrost nowego pracownika"); zapytanieInsert.setString(1, imieDoWstawienia); zapytanieInsert.setString(2, wagaDoWstawienia); zapytanieInsert.setString(3, wzrostDoWstawienia); zapytanieInsert.executeUpdate(); String szukaneImie = JOptionPane.showInputDialog("podaj szukane imię"); zapytanieSelect.setString(1, szukaneImie); ResultSet wynik = zapytanieSelect.executeQuery(); while (wynik.next()) { String imie = wynik.getString("imie"); int waga = wynik.getInt("waga"); int wzrost = wynik.getInt("wzrost"); System.out.println(imie + " " + " " + waga + " " + wzrost); } } } }
[ "jowinia@gmail.com" ]
jowinia@gmail.com
430025afecde2431ce6cd922da391e9b762e26a4
055b8b3c957bc738e48ab8e701f9574e8a71257b
/src/main/java/top/hellooooo/job/service/impl/FileServiceImpl.java
b443da5e2d566ada09ceb5b3ea199859cd9a0248
[ "MIT" ]
permissive
Q2035/Job
d1a61042fa687d2dbf042342575cc5564f705549
65e898376c0c98ab03e539fb27ea1968c7d0f072
refs/heads/main
2023-02-19T07:20:54.960351
2021-01-21T14:05:16
2021-01-21T14:05:16
328,102,114
1
0
null
null
null
null
UTF-8
Java
false
false
1,275
java
package top.hellooooo.job.service.impl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import top.hellooooo.job.mapper.FileMapper; import top.hellooooo.job.pojo.FileDTO; import top.hellooooo.job.service.FileService; import java.util.List; /** * @Author Q * @Date 2021-01-17 11:19 * @Description */ @Service public class FileServiceImpl implements FileService { @Autowired private FileMapper fileMapper; /** * 进行文件保存 * * @param fileDTO */ @Override public void save(FileDTO fileDTO) { //根据 数据库的 文件标识来查询 文件 是否存在 List<FileDTO> fileDTOS = fileMapper.getFileDTO(fileDTO.getFileKey()); //如果存在就话就修改 if (fileDTOS.size() != 0) { //根据key来修改 fileMapper.updateFileDTO(fileDTO); } else { //不存在就添加 fileMapper.insertFileDTO(fileDTO); } } /** * 检测数据库中是否存在该文件 * * @param key * @return */ @Override public List<FileDTO> check(String key) { List<FileDTO> dtos = fileMapper.getFileDTO(key); return dtos; } }
[ "2383862181@qq.com" ]
2383862181@qq.com
bf71fcd5697ab5cb269010a928c5e8d568334452
c1b8cda202a7c8b55c3a2bc69bd0db8fcaddaa94
/src/test/resources/control-flow/ControlFlowArithmetic.java
65cd8e0544bb619058873d27fbbf94b323ac6626
[]
no_license
DIVERSIFY-project/signal-loops
2095cd85a028ae6e4c2df428946400652a42fd0a
576441c4c52a9510f65d79453bbe2b77fda06846
refs/heads/master
2016-08-13T01:20:51.857764
2015-10-26T09:51:01
2015-10-26T09:51:01
43,301,271
0
0
null
null
null
null
UTF-8
Java
false
false
5,716
java
package fr.inria.juncoprovider.testproject; import java.util.List; /** * Created by marcel on 23/02/14. * <p/> * A class to test some coverage. In some method an "explosive" line is introduced * which will not be tested. */ public class ControlFlowArithmetic { //several constructions one after the other public int mixed(int a, int b) { if (b % 2 == 0) { return a + b; } for (int i = 0; i < a; i++) b += a * b; return a + b * 2; } //several constructions one after the other public int invocation(int a, int b) { if (b % 2 == 0) { return nestedIfs(a,b); } return a + b * 2; } //Some nested ifs public int nestedIfs(int a, int b) { if (a > 0) { if (b > 0) return a * b; } else { if (b < 0) return a * b * b; else { a = a * b; b = b * b; return b; } } return 0; } public void returnVoid(int a) { if (a > 0) return; else System.out.print("A < 0!"); } public int nestedConditional(int a) { int k = a / 2; int b = a > 0 ? k < 4 ? a * a : 8 : -a * a; return b; } public int conditional(int a) { int b = a > 0 ? a * a : -a * a; return b; } /** * A method with a while to test the control flow */ public int ctDoWhile(List<Integer> a) { int b = 0; int i = 0; do b += i++ * b; while (i < a.size()); return b; } /** * A method with a while to test the control flow */ public int ctDoWhileBlock(List<Integer> a) { int b = 0; int i = 0; do { int k = i * i; b += i++ * b; } while (i < a.size()); return b; } /** * A method with a while to test the control flow */ public int ctWhile(List<Integer> a) { int b = 0; int i = 0; while (i < a.size()) b += i++ * b; return b; } /** * A method with a while to test the control flow */ public int ctWhileBlock(List<Integer> a) { int b = 0; int i = 0; while (i < a.size()) { b += i * b; i++; } return b; } /** * A method with a foreach to tes the control flow */ public int ctForEach(List<Integer> a) { int b = 0; for (int i : a) b += i * b; return b; } /** * A method with a foreach to tes the control flow */ public int ctForEachBlock(List<Integer> a) { int b = 0; for (int i : a) { int k = i * i; b += k * b; } return b; } //A For to test the control flow in a for public int ctFor(int a, int b) { for (int i = 0; i < a; i++) b += a * b; return b; } //A For to test the control flow in a for public int ctForBlock(int a, int b) { for (int i = 0; i < a; i++) { int k = i * i; b += a * b + i; } return b; } //Yet another dummy procedure to test some logic branches public int ifThen(int a, int b) { if (b % 2 == 0) return a - b; return 0; } //Yet another dummy procedure to test some logic branches public int ifThenElse(int a, int b) { if (b % 2 == 0) return a - b; else b = b + a; return b * b; } //Yet another dummy procedure to test some logic branches public int ifThenBlock(int a, int b) { if (b % 2 == 0) { a += b * b; return a - b; } return 0; } //Yet another dummy procedure to test some logic branches public int ifThenElseBlock(int a, int b) { if (b % 2 == 0) { a += b * b; return a - b; } else { return a - b * 2; } } //All lines will be tested in this method public int simple(int a) { a = a + a / 2; return 10 * a; } /////////////////////////////////////////////////////////////////////////////////////////// public int testCase1(boolean armed, double inputs1, double inputs2, double THRESHOLD) { int count = 0; double value = inputs1; if (value < -THRESHOLD) { armed = true; } else if (armed & (value > THRESHOLD)) { ++count; armed = false; } value = inputs2; if (value < -THRESHOLD) { armed = true; } else if (armed & (value > THRESHOLD)) { ++count; armed = false; } return count; } double method1() { return 0; } double method2(double a) { return a; } boolean m3() { return true; } public void complex1(double phase, double source, double target, double baseIncrement, boolean starved, int i, double current, double[] outputs,double[] amplitudes, double[] rates) { if ((phase) >= 1.0) { while ((phase) >= 1.0) { source = target; phase -= 1.0; baseIncrement = method1(); } } else if ((i == 0) && ((starved) || (!(m3())))) { source = target = current; phase = 0.0; baseIncrement = method1(); } current = (((target) - (source)) * (phase)) + (source); outputs[i] = (current) * (amplitudes[i]); double phaseIncrement = (baseIncrement) * (rates[i]); phase += method2(phaseIncrement); } }
[ "marcelino.rguez.cancio@gmail.com" ]
marcelino.rguez.cancio@gmail.com
56e550adbea809c6858336f070cf8f6d829162a7
f037bf2bfaf7adf6b1e9332f651306f8641dc032
/graphhopper/src/main/java/be/dispatcher/graphhopper/external_router/RouteInput.java
4b1eae15a2ac14747052e97aebb773bd12e8da3c
[]
no_license
bvanvelsen/dispatcher
d555251bd9cbd761a8206e6a5e37f839b1753603
f485770bab11a21fe698a62f33fbb81df96b63fc
refs/heads/master
2021-06-03T23:50:48.708058
2018-07-13T18:48:44
2018-07-13T18:48:44
122,841,544
0
0
null
null
null
null
UTF-8
Java
false
false
1,598
java
package be.dispatcher.graphhopper.external_router; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; import be.dispatcher.graphhopper.LatLon; public class RouteInput { private double speedprofile; private LatLon startLocation; private LatLon destinationLocation; public RouteInput(double speedprofile, LatLon startLocation, LatLon destinationLocation) { this.speedprofile = speedprofile; this.startLocation = startLocation; this.destinationLocation = destinationLocation; } public LatLon getStartLocation() { return startLocation; } public LatLon getDestinationLocation() { return destinationLocation; } public double getSpeedprofile() { return speedprofile; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; RouteInput routeInput = (RouteInput) o; return new EqualsBuilder() .append(startLocation, routeInput.startLocation) .append(destinationLocation, routeInput.destinationLocation) .append(speedprofile, routeInput.speedprofile) .isEquals(); } @Override public int hashCode() { return new HashCodeBuilder(17, 37) .append(startLocation) .append(destinationLocation) .append(speedprofile) .toHashCode(); } @Override public String toString() { return new ToStringBuilder(this) .append("startLocation", startLocation) .append("destinationLocation", destinationLocation) .toString(); } }
[ "bernd.vanvelsen@aca-it.be" ]
bernd.vanvelsen@aca-it.be
da5a8ef51487c8a6a0666a2cbcf47726895a6bb3
431f7cfbcbf2d75e26f5f28d980371b36e0f9d1d
/app/src/main/java/com/marine/shrimp/culture/marineshrimpculture/utils/IconsAsyncLoader.java
d696b442316cd378882fbec211a3157799070a91
[]
no_license
ayawageeh16/MarineShrimpCulture
f38ec4c15b8e18c008c5739adf81ce3900e918c3
c53e857f7449adb2c5ff2231a55b5bec20a8529b
refs/heads/master
2020-03-17T02:49:02.226030
2018-06-06T17:18:38
2018-06-06T17:18:38
129,460,896
0
0
null
null
null
null
UTF-8
Java
false
false
953
java
package com.marine.shrimp.culture.marineshrimpculture.utils; import android.content.AsyncTaskLoader; import android.content.Context; import com.marine.shrimp.culture.marineshrimpculture.data.IconModel; import com.marine.shrimp.culture.marineshrimpculture.data.IconSet; import java.util.ArrayList; import java.util.List; public class IconsAsyncLoader extends AsyncTaskLoader<List<IconModel>> { Context context; List<IconModel> icons = new ArrayList<>(); IconSet entry; public IconsAsyncLoader(Context context) { super(context); this.context = context; } @Override public List<IconModel> loadInBackground() { entry = new IconSet(context); icons = entry.createList(); return icons; } @Override protected void onStartLoading() { forceLoad(); } @Override public void deliverResult(List<IconModel> data) { super.deliverResult(data); } }
[ "ayawageeh16@gmail.com" ]
ayawageeh16@gmail.com
9f7d1dd62735d506c493bf49605f78f39cfadaaf
bea2094aa565217064b2692406d77e86edd70bdd
/src/main/java/org/ultramine/mods/scripting/ClosureCommandHandler.java
69fd8490f8dd1c476f3724999fe7bef97ffce23e
[]
no_license
TechCatOther/umscripting
d9687549a4b2e9855cab06996652e16deb56c432
37ad3def43a269130454f271c0d0e17827a641b6
refs/heads/master
2020-03-22T03:22:41.096439
2018-07-02T10:29:34
2018-07-02T10:29:34
139,428,282
0
0
null
null
null
null
UTF-8
Java
false
false
590
java
package org.ultramine.mods.scripting; import groovy.lang.Closure; import org.ultramine.commands.CommandContext; import org.ultramine.commands.ICommandHandler; public class ClosureCommandHandler implements ICommandHandler { private final Closure<Void> handler; public ClosureCommandHandler(Closure<Void> handler) { this.handler = handler; // handler.setResolveStrategy(Closure.DELEGATE_FIRST); } @Override public void processCommand(CommandContext context) { handler.setDelegate(context); try { handler.call(); } finally { handler.setDelegate(null); } } }
[ "alone.inbox@gmail.com" ]
alone.inbox@gmail.com
028a371b5261b93889240b2293119c86c5c9e4f0
57720e27e7f8284bc3092792efecdd4467c97bbb
/helper/src/main/java/com/evil/recycler/helper/IHelper.java
e10a79b9518ac9ddfca2b88be09a331fa90f4f4d
[]
no_license
fengxiaocan/RecyclerHelper
55877080ee21419d798cedaef31d30681840e99b
9bc6c99e4d1ceb94d0b9ef9d329d283362290f9e
refs/heads/master
2021-12-22T18:22:18.303958
2021-12-13T06:11:02
2021-12-13T06:11:02
142,435,521
1
0
null
null
null
null
UTF-8
Java
false
false
2,936
java
package com.evil.recycler.helper; import android.content.Context; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.ItemTouchHelper; import androidx.recyclerview.widget.LinearSnapHelper; import androidx.recyclerview.widget.PagerSnapHelper; import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.SnapHelper; import com.evil.recycler.drag.DragOrSwipeCallback; /** * @author noah * @email fengxiaocan@gmail.com * @create 7/6/18 * @desc ... */ public abstract class IHelper { RecyclerView recyclerView; IHelper(RecyclerView recyclerView) { this.recyclerView = recyclerView; } public IHelper animation() { recyclerView.setItemAnimator(new DefaultItemAnimator()); return this; } public IHelper scrollListener(RecyclerView.OnScrollListener l) { recyclerView.addOnScrollListener(l); return this; } public IHelper nestedScroll(boolean enabled) { recyclerView.setNestedScrollingEnabled(enabled); return this; } public IHelper snapLinear() { SnapHelper snapHelper = new LinearSnapHelper(); snapHelper.attachToRecyclerView(recyclerView); return this; } public IHelper snapPager() { SnapHelper snapHelper = new PagerSnapHelper(); snapHelper.attachToRecyclerView(recyclerView); return this; } public IHelper recyclerListener(RecyclerView.RecyclerListener recyclerListener) { recyclerView.setRecyclerListener(recyclerListener); return this; } public IHelper snap(SnapHelper snapHelper) { snapHelper.attachToRecyclerView(recyclerView); return this; } public IHelper itemTouch(ItemTouchHelper.Callback callback) { ItemTouchHelper mItemHelper = new ItemTouchHelper(callback); mItemHelper.attachToRecyclerView(recyclerView); return this; } public IHelper dragOrSwipe(boolean canDrag, boolean canSwipe) { return itemTouch(new DragOrSwipeCallback(canDrag, canSwipe)); } public IHelper dragAndSwipe() { return dragOrSwipe(true,true); } public IHelper dragAndSwipe(DragOrSwipeCallback.SelectAnimation animation) { return itemTouch(new DragOrSwipeCallback(true, true,animation)); } public IHelper drag() { return itemTouch(new DragOrSwipeCallback(true, false)); } public IHelper drag(DragOrSwipeCallback.SelectAnimation animation) { return itemTouch(new DragOrSwipeCallback(true, false,animation)); } public IHelper swipe() { return itemTouch(new DragOrSwipeCallback(false, true,null)); } public IHelper adapter(RecyclerView.Adapter adapter) { recyclerView.setAdapter(adapter); return this; } Context getContext() { return recyclerView.getContext(); } public abstract void init(); }
[ "fengxiaocan@gmail.com" ]
fengxiaocan@gmail.com
2b3ba5e2d4281e4a5ef5fedda06aef34479e3b79
24d8cf871b092b2d60fc85d5320e1bc761a7cbe2
/Jmol/rev11338-12038/right-trunk-12038/src/org/jmol/shapesurface/Isosurface.java
73cc8121ea5b2657003845a25920c26f8d5c6bd4
[]
no_license
joliebig/featurehouse_fstmerge_examples
af1b963537839d13e834f829cf51f8ad5e6ffe76
1a99c1788f0eb9f1e5d8c2ced3892d00cd9449ad
refs/heads/master
2016-09-05T10:24:50.974902
2013-03-28T16:28:47
2013-03-28T16:28:47
9,080,611
3
2
null
null
null
null
UTF-8
Java
false
false
34,386
java
package org.jmol.shapesurface; import org.jmol.shape.Mesh; import org.jmol.shape.MeshCollection; import org.jmol.util.BitSetUtil; import org.jmol.util.Escape; import org.jmol.util.Logger; import org.jmol.util.ColorEncoder; import org.jmol.util.ArrayUtil; import org.jmol.util.Measure; import org.jmol.util.Parser; import org.jmol.util.Point3fi; import org.jmol.util.TextFormat; import org.jmol.viewer.ActionManager; import org.jmol.viewer.JmolConstants; import org.jmol.script.Token; import org.jmol.viewer.Viewer; import org.jmol.viewer.StateManager.Orientation; import org.jmol.jvxl.readers.Parameters; import java.util.BitSet; import java.util.Hashtable; import java.util.Vector; import javax.vecmath.AxisAngle4f; import javax.vecmath.Matrix3f; import javax.vecmath.Point3f; import javax.vecmath.Point3i; import javax.vecmath.Point4f; import javax.vecmath.Vector3f; import org.jmol.g3d.Graphics3D; import org.jmol.jvxl.api.MeshDataServer; import org.jmol.jvxl.data.JvxlCoder; import org.jmol.jvxl.data.JvxlData; import org.jmol.jvxl.data.MeshData; import org.jmol.jvxl.readers.SurfaceGenerator; public class Isosurface extends MeshCollection implements MeshDataServer { private IsosurfaceMesh[] isomeshes = new IsosurfaceMesh[4]; protected IsosurfaceMesh thisMesh; public void allocMesh(String thisID) { int index = meshCount++; meshes = isomeshes = (IsosurfaceMesh[]) ArrayUtil.ensureLength(isomeshes, meshCount * 2); currentMesh = thisMesh = isomeshes[index] = new IsosurfaceMesh( thisID, g3d, colix, index); sg.setJvxlData(jvxlData = thisMesh.jvxlData); } public void initShape() { super.initShape(); myType = "isosurface"; newSg(); } private void newSg() { sg = new SurfaceGenerator(viewer, this, colorEncoder, null, jvxlData = new JvxlData()); sg.setVersion("Jmol " + Viewer.getJmolVersion()); } protected void clearSg() { sg = null; } private int lighting; private boolean iHaveBitSets; private boolean explicitContours; private int atomIndex; private int moNumber; private short defaultColix; private short meshColix; private Point3f center; private Point3f offset; private boolean isPhaseColored; private boolean isColorExplicit; protected SurfaceGenerator sg; protected JvxlData jvxlData; private ColorEncoder colorEncoder = new ColorEncoder(); public void setProperty(String propertyName, Object value, BitSet bs) { if (Logger.debugging) { Logger.debug("Isosurface setProperty: " + propertyName + " = " + value); } if ("navigate" == propertyName) { navigate(((Integer)value).intValue()); return; } if ("delete" == propertyName) { setPropertySuper(propertyName, value, bs); if (!explicitID) nLCAO = nUnnamed = 0; return; } if ("remapcolor" == propertyName) { if (thisMesh != null) remapColors(); return; } if ("thisID" == propertyName) { setPropertySuper("thisID", value, null); return; } if ("map" == propertyName) { setProperty("squareData", Boolean.FALSE, null); return; } if ("color" == propertyName) { if (thisMesh != null) { thisMesh.isColorSolid = true; thisMesh.polygonColixes = null; } else if (!TextFormat.isWild(previousMeshID)){ for (int i = meshCount; --i >= 0;) { isomeshes[i].isColorSolid = true; isomeshes[i].polygonColixes = null; } } setPropertySuper(propertyName, value, bs); return; } if ("fixed" == propertyName) { isFixed = ((Boolean) value).booleanValue(); setModelIndex(); return; } if ("modelIndex" == propertyName) { if (!iHaveModelIndex) { modelIndex = ((Integer) value).intValue(); sg.setModelIndex(modelIndex); isFixed = (modelIndex < 0); } isFixed = (modelIndex < 0); return; } if ("lcaoCartoon" == propertyName || "lonePair" == propertyName || "radical" == propertyName) { Vector3f[] info = (Vector3f[]) value; if (!explicitID) { setPropertySuper("thisID", null, null); } if (!sg.setParameter("lcaoCartoonCenter", info[2])) drawLcaoCartoon(info[0], info[1], info[3], ("lonePair" == propertyName ? 2 : "radical" == propertyName ? 1 : 0)); return; } if ("title" == propertyName) { if (value instanceof String && "-".equals((String) value)) value = null; setPropertySuper(propertyName, value, bs); sg.setParameter("title", title, bs); return; } if ("select" == propertyName) { if (iHaveBitSets) return; } if ("ignore" == propertyName) { if (iHaveBitSets) return; } if ("colorMesh" == propertyName) { int rgb = ((Integer) value).intValue(); meshColix = Graphics3D.getColix(rgb); return; } if ("offset" == propertyName) { offset = new Point3f((Point3f) value); if (offset.equals(JmolConstants.center)) offset = null; if (thisMesh != null) thisMesh.ptOffset = offset; return; } if ("getSurfaceSets" == propertyName) { if (thisMesh != null) thisMesh.thisSet = ((Integer)value).intValue(); } if ("contour" == propertyName) { explicitContours = true; } if ("atomIndex" == propertyName) { atomIndex = ((Integer) value).intValue(); } if ("pocket" == propertyName) { Boolean pocket = (Boolean) value; lighting = (pocket.booleanValue() ? JmolConstants.FULLYLIT : JmolConstants.FRONTLIT); } if ("colorRGB" == propertyName) { int rgb = ((Integer) value).intValue(); defaultColix = Graphics3D.getColix(rgb); } if ("molecularOrbital" == propertyName) { moNumber = ((Integer) value).intValue(); if (!isColorExplicit) isPhaseColored = true; } if (propertyName == "functionXY") { if (sg.isStateDataRead()) setScriptInfo(); } if ("center" == propertyName) { center.set((Point3f) value); } if ("phase" == propertyName) { isPhaseColored = true; } if ("plane" == propertyName) { allowContourLines = false; } if ("functionXY" == propertyName) { allowContourLines = false; } if ("finalize" == propertyName) { thisMesh.setDiscreteColixes(sg.getParams().contoursDiscrete, sg.getParams().contourColixes); setScriptInfo(); setJvxlInfo(); clearSg(); return; } if ("init" == propertyName) { newSg(); } if ("mapColor" == propertyName || "readFile" == propertyName) { if (value == null) { value = viewer.getBufferedReaderOrErrorMessageFromName(sg.getFileName(), null, false); if (value instanceof String) { Logger.error("Isosurface: could not open file " + sg.getFileName() + " -- " + sg.getFileName()); return; } } } if (sg != null && sg.setParameter(propertyName, value, bs)) return; if ("init" == propertyName) { setPropertySuper("thisID", JmolConstants.PREVIOUS_MESH_ID, null); if (value instanceof String && !(iHaveBitSets = getScriptBitSets((String) value, null))) { sg.setParameter("select", bs); } initializeIsosurface(); sg.setModelIndex(modelIndex); return; } if ("clear" == propertyName) { discardTempData(true); return; } if (propertyName == "deleteModelAtoms") { int modelIndex = ((int[]) ((Object[]) value)[2])[0]; BitSet bsModels = new BitSet(); bsModels.set(modelIndex); int firstAtomDeleted = ((int[])((Object[])value)[2])[1]; int nAtomsDeleted = ((int[])((Object[])value)[2])[2]; for (int i = meshCount; --i >= 0;) { Mesh m = meshes[i]; if (m == null) continue; if (m.modelIndex == modelIndex) { meshCount--; if (m == currentMesh) currentMesh = thisMesh = null; meshes = isomeshes = (IsosurfaceMesh[]) ArrayUtil.deleteElements( meshes, i, 1); } else if (m.modelIndex > modelIndex) { m.modelIndex--; if (m.atomIndex >= firstAtomDeleted) m.atomIndex -= nAtomsDeleted; if (m.bitsets != null) { BitSetUtil.deleteBits(m.bitsets[0], bs); BitSetUtil.deleteBits(m.bitsets[1], bs); BitSetUtil.deleteBits(m.bitsets[2], bsModels); } } } return; } setPropertySuper(propertyName, value, bs); } private void setPropertySuper(String propertyName, Object value, BitSet bs) { if (propertyName == "thisID" && currentMesh != null && currentMesh.thisID.equals((String) value)) { checkExplicit((String) value); return; } currentMesh = thisMesh; super.setProperty(propertyName, value, bs); thisMesh = (IsosurfaceMesh) currentMesh; jvxlData = (thisMesh == null ? null : thisMesh.jvxlData); if (sg != null) sg.setJvxlData(jvxlData); } public boolean getProperty(String property, Object[] data) { if (property == "intersectPlane") { IsosurfaceMesh mesh = (IsosurfaceMesh) getMesh((String) data[0]); if (mesh == null) return false; data[3] = new Integer(mesh.modelIndex); return mesh.getIntersection((Point4f) data[1], (Vector) data[2]); } return super.getProperty(property, data); } public Object getProperty(String property, int index) { Object ret = super.getProperty(property, index); if (ret != null) return ret; if (property == "dataRange") return (thisMesh == null || jvxlData.jvxlPlane != null && !jvxlData.jvxlDataIsColorMapped ? null : new float[] { jvxlData.mappedDataMin, jvxlData.mappedDataMax, jvxlData.valueMappedToRed, jvxlData.valueMappedToBlue }); if (property == "moNumber") return new Integer(moNumber); if (property == "area") return (thisMesh == null ? new Float(Float.NaN) : thisMesh.calculateArea()); if (property == "volume") return (thisMesh == null ? new Float(Float.NaN) : thisMesh.calculateVolume()); if (thisMesh == null) return null; if (property == "cutoff") return new Float(jvxlData.cutoff); if (property == "plane") return jvxlData.jvxlPlane; if (property == "jvxlFileData" || property == "jvxlFileDataXml") { MeshData meshData = null; jvxlData.asXml = (property == "jvxlFileDataXml"); if (jvxlData.vertexDataOnly) { meshData = new MeshData(); fillMeshData(meshData, MeshData.MODE_GET_VERTICES, null); meshData.polygonColorData = getPolygonColorData(meshData.polygonCount, meshData.polygonColixes); } return JvxlCoder.jvxlGetFile(jvxlData, meshData, title, "", true, 1, thisMesh .getState(myType), (thisMesh.scriptCommand == null ? "" : thisMesh.scriptCommand)); } if (property == "jvxlFileInfo") return JvxlCoder.jvxlGetInfo(jvxlData, true); return null; } public static String getPolygonColorData(int ccount, short[] colixes) { if (colixes == null) return null; StringBuffer list1 = new StringBuffer(); int count = 0; short colix = 0; boolean done = false; for (int i = 0; i < ccount || (done = true) == true; i++) { if (done || colixes[i] != colix) { if (count != 0) list1.append(" ").append(count).append(" ").append( (colix == 0 ? 0 : Graphics3D.getArgb(colix))); if (done) break; colix = colixes[i]; count = 1; } else { count++; } } list1.append("\n"); return list1.toString(); } protected void getColorState(StringBuffer sb, Mesh mesh) { boolean colorArrayed = (mesh.isColorSolid && ((IsosurfaceMesh) mesh).polygonColixes != null); if (mesh.isColorSolid && !colorArrayed) appendCmd(sb, getColorCommand(myType, mesh.colix)); } private boolean getScriptBitSets(String script, BitSet[] bsCmd) { this.script = script; getModelIndex(script); if (script == null) return false; int i = script.indexOf("# ({"); if (i < 0) return false; int j = script.indexOf("})", i); if (j < 0) return false; BitSet bs = Escape.unescapeBitset(script.substring(i + 3, j + 1)); if (bsCmd == null) sg.setParameter("select", bs); else bsCmd[0] = bs; if ((i = script.indexOf("({", j)) < 0) return true; j = script.indexOf("})", i); if (j < 0) return false; bs = Escape.unescapeBitset(script.substring(i + 1, j + 1)); if (bsCmd == null) sg.setParameter("ignore", bs); else bsCmd[1] = bs; if ((i = script.indexOf("/({", j)) == j + 2) { if ((j = script.indexOf("})", i)) < 0) return false; bs = Escape.unescapeBitset(script.substring(i + 3, j + 1)); if (bsCmd == null) viewer.setTrajectory(bs); else bsCmd[2] = bs; } return true; } private void initializeIsosurface() { lighting = JmolConstants.FRONTLIT; if (!iHaveModelIndex) modelIndex = viewer.getCurrentModelIndex(); isFixed = (modelIndex < 0); if (modelIndex < 0) modelIndex = 0; title = null; explicitContours = false; atomIndex = -1; colix = Graphics3D.ORANGE; defaultColix = meshColix = 0; isPhaseColored = isColorExplicit = false; allowContourLines = true; center = new Point3f(Float.MAX_VALUE, Float.MAX_VALUE, Float.MAX_VALUE); offset = null; linkedMesh = null; initState(); } private void initState() { associateNormals = true; sg.initState(); } private void discardTempData(boolean discardAll) { if (!discardAll) return; title = null; if (thisMesh == null) return; thisMesh.surfaceSet = null; } private int indexColorPositive; private int indexColorNegative; private short getDefaultColix() { if (defaultColix != 0) return defaultColix; if (!sg.isCubeData()) return colix; int argb; if (sg.getCutoff() >= 0) { indexColorPositive = (indexColorPositive % JmolConstants.argbsIsosurfacePositive.length); argb = JmolConstants.argbsIsosurfacePositive[indexColorPositive++]; } else { indexColorNegative = (indexColorNegative % JmolConstants.argbsIsosurfaceNegative.length); argb = JmolConstants.argbsIsosurfaceNegative[indexColorNegative++]; } return Graphics3D.getColix(argb); } private int nLCAO = 0; private void drawLcaoCartoon(Vector3f z, Vector3f x, Vector3f rotAxis, int nElectrons) { String lcaoCartoon = sg.setLcao(); float rotRadians = rotAxis.x + rotAxis.y + rotAxis.z; defaultColix = Graphics3D.getColix(sg.getColor(1)); int colorNeg = sg.getColor(-1); Vector3f y = new Vector3f(); boolean isReverse = (lcaoCartoon.length() > 0 && lcaoCartoon.charAt(0) == '-'); if (isReverse) lcaoCartoon = lcaoCartoon.substring(1); int sense = (isReverse ? -1 : 1); y.cross(z, x); if (rotRadians != 0) { AxisAngle4f a = new AxisAngle4f(); if (rotAxis.x != 0) a.set(x, rotRadians); else if (rotAxis.y != 0) a.set(y, rotRadians); else a.set(z, rotRadians); Matrix3f m = new Matrix3f(); m.set(a); m.transform(x); m.transform(y); m.transform(z); } if (thisMesh == null && nLCAO == 0) nLCAO = meshCount; String id = (thisMesh == null ? (nElectrons > 0 ? "lp" : "lcao") + (++nLCAO) + "_" + lcaoCartoon : thisMesh.thisID); if (thisMesh == null) allocMesh(id); if (lcaoCartoon.equals("px")) { thisMesh.thisID += "a"; Mesh meshA = thisMesh; createLcaoLobe(x, sense, nElectrons); if (nElectrons > 0) return; setProperty("thisID", id + "b", null); createLcaoLobe(x, -sense, nElectrons); thisMesh.colix = Graphics3D.getColix(colorNeg); linkedMesh = thisMesh.linkedMesh = meshA; return; } if (lcaoCartoon.equals("py")) { thisMesh.thisID += "a"; Mesh meshA = thisMesh; createLcaoLobe(y, sense, nElectrons); if (nElectrons > 0) return; setProperty("thisID", id + "b", null); createLcaoLobe(y, -sense, nElectrons); thisMesh.colix = Graphics3D.getColix(colorNeg); linkedMesh = thisMesh.linkedMesh = meshA; return; } if (lcaoCartoon.equals("pz")) { thisMesh.thisID += "a"; Mesh meshA = thisMesh; createLcaoLobe(z, sense, nElectrons); if (nElectrons > 0) return; setProperty("thisID", id + "b", null); createLcaoLobe(z, -sense, nElectrons); thisMesh.colix = Graphics3D.getColix(colorNeg); linkedMesh = thisMesh.linkedMesh = meshA; return; } if (lcaoCartoon.equals("pxa")) { createLcaoLobe(x, sense, nElectrons); return; } if (lcaoCartoon.equals("pxb")) { createLcaoLobe(x, -sense, nElectrons); return; } if (lcaoCartoon.equals("pya")) { createLcaoLobe(y, sense, nElectrons); return; } if (lcaoCartoon.equals("pyb")) { createLcaoLobe(y, -sense, nElectrons); return; } if (lcaoCartoon.equals("pza")) { createLcaoLobe(z, sense, nElectrons); return; } if (lcaoCartoon.equals("pzb")) { createLcaoLobe(z, -sense, nElectrons); return; } if (lcaoCartoon.indexOf("sp") == 0 || lcaoCartoon.indexOf("lp") == 0) { createLcaoLobe(z, sense, nElectrons); return; } createLcaoLobe(null, 1, nElectrons); return; } private Point4f lcaoDir = new Point4f(); private void createLcaoLobe(Vector3f lobeAxis, float factor, int nElectrons) { initState(); if (Logger.debugging) { Logger.debug("creating isosurface ID " + thisMesh.thisID); } thisMesh.colix = defaultColix; if (lobeAxis == null) { setProperty("sphere", new Float(factor / 2f), null); } else { lcaoDir.x = lobeAxis.x * factor; lcaoDir.y = lobeAxis.y * factor; lcaoDir.z = lobeAxis.z * factor; lcaoDir.w = 0.7f; setProperty(nElectrons == 2 ? "lp" : nElectrons == 1 ? "rad" : "lobe", lcaoDir, null); } setScriptInfo(); } public void invalidateTriangles() { thisMesh.invalidatePolygons(); } public void fillMeshData(MeshData meshData, int mode, IsosurfaceMesh mesh) { if (meshData == null) { if (thisMesh == null) allocMesh(null); thisMesh.clear("isosurface", sg.getIAddGridPoints()); thisMesh.colix = getDefaultColix(); thisMesh.meshColix = meshColix; if (isPhaseColored || thisMesh.jvxlData.isBicolorMap) thisMesh.isColorSolid = false; return; } if (mesh == null) mesh = thisMesh; if (mesh == null) return; switch (mode) { case MeshData.MODE_GET_VERTICES: meshData.vertices = mesh.vertices; meshData.vertexValues = mesh.vertexValues; meshData.vertexCount = mesh.vertexCount; meshData.vertexIncrement = mesh.vertexIncrement; meshData.polygonCount = mesh.polygonCount; meshData.polygonIndexes = mesh.polygonIndexes; meshData.polygonColixes = mesh.polygonColixes; return; case MeshData.MODE_GET_COLOR_INDEXES: if (mesh.vertexColixes == null || mesh.vertexCount > mesh.vertexColixes.length) mesh.vertexColixes = new short[mesh.vertexCount]; meshData.vertexColixes = mesh.vertexColixes; meshData.polygonIndexes = null; return; case MeshData.MODE_PUT_SETS: mesh.surfaceSet = meshData.surfaceSet; mesh.vertexSets = meshData.vertexSets; mesh.nSets = meshData.nSets; return; case MeshData.MODE_PUT_VERTICES: mesh.vertices = meshData.vertices; mesh.vertexValues = meshData.vertexValues; mesh.vertexCount = meshData.vertexCount; mesh.vertexIncrement = meshData.vertexIncrement; mesh.polygonCount = meshData.polygonCount; mesh.polygonIndexes = meshData.polygonIndexes; mesh.polygonColixes = meshData.polygonColixes; return; } } public void notifySurfaceGenerationCompleted() { setModelIndex(); thisMesh.insideOut = sg.isInsideOut(); thisMesh.calculatedArea = null; thisMesh.calculatedVolume = null; thisMesh.initialize(sg.getPlane() != null ? JmolConstants.FULLYLIT : lighting); if (thisMesh.jvxlData.jvxlPlane != null) allowContourLines = false; thisMesh.isSolvent = ((sg.getDataType() & Parameters.IS_SOLVENTTYPE) != 0); } public void notifySurfaceMappingCompleted() { setModelIndex(); String schemeName = colorEncoder.getColorSchemeName(); viewer.setPropertyColorScheme(schemeName, false); viewer.setCurrentColorRange(jvxlData.valueMappedToRed, jvxlData.valueMappedToBlue); thisMesh.isColorSolid = false; thisMesh.getContours(); if (thisMesh.jvxlData.jvxlPlane != null) allowContourLines = false; if (thisMesh.jvxlData.nContours != 0 && thisMesh.jvxlData.nContours != -1) explicitContours = true; if (explicitContours && thisMesh.jvxlData.jvxlPlane != null) thisMesh.havePlanarContours = true; setPropertySuper("token", new Integer(explicitContours ? Token.nofill : Token.fill), null); setPropertySuper("token", new Integer(explicitContours ? Token.contourlines : Token.nocontourlines), null); thisMesh.colorCommand = "color $" + thisMesh.thisID + " " + getUserColorScheme(schemeName) + " range " + (jvxlData.isColorReversed ? jvxlData.valueMappedToBlue + " " + jvxlData.valueMappedToRed : jvxlData.valueMappedToRed + " " + jvxlData.valueMappedToBlue); } public Point3f[] calculateGeodesicSurface(BitSet bsSelected, float envelopeRadius) { return viewer.calculateSurface(bsSelected, envelopeRadius); } public int getSurfacePointIndexAndFraction(float cutoff, boolean isCutoffAbsolute, int x, int y, int z, Point3i offset, int vA, int vB, float valueA, float valueB, Point3f pointA, Vector3f edgeVector, boolean isContourType, float[] fReturn) { return 0; } private boolean associateNormals; public int addVertexCopy(Point3f vertexXYZ, float value, int assocVertex) { return thisMesh.addVertexCopy(vertexXYZ, value, assocVertex, associateNormals); } public int addTriangleCheck(int iA, int iB, int iC, int check, int check2, boolean isAbsolute, int color) { if (isAbsolute && !MeshData.checkCutoff(iA, iB, iC, thisMesh.vertexValues)) return -1; return thisMesh.addTriangleCheck(iA, iB, iC, check, check2, color); } private void setModelIndex() { setModelIndex(atomIndex, modelIndex); thisMesh.ptCenter.set(center); thisMesh.ptOffset = offset; } protected void setScriptInfo() { thisMesh.title = sg.getTitle(); String script = sg.getScript(); thisMesh.dataType = sg.getParams().dataType; thisMesh.bitsets = null; if (script != null) { if (script.charAt(0) == ' ') { script = myType + " ID " + Escape.escape(thisMesh.thisID) + script; } else if (sg.getIUseBitSets()) { thisMesh.bitsets = new BitSet[3]; thisMesh.bitsets[0] = sg.getBsSelected(); thisMesh.bitsets[1] = sg.getBsIgnore(); thisMesh.bitsets[2] = viewer.getBitSetTrajectories(); } } int pt; if (!explicitID && script != null && (pt = script.indexOf("# ID=")) >= 0) thisMesh.thisID = Parser.getNextQuotedString(script, pt); thisMesh.scriptCommand = script; Vector v = (Vector) sg.getFunctionXYinfo(); if (thisMesh.data1 == null) thisMesh.data1 = v; else thisMesh.data2 = v; } private void setJvxlInfo() { if (sg.getJvxlData() != jvxlData || sg.getJvxlData() != thisMesh.jvxlData) jvxlData = thisMesh.jvxlData = sg.getJvxlData(); } public Vector getShapeDetail() { Vector V = new Vector(); for (int i = 0; i < meshCount; i++) { Hashtable info = new Hashtable(); IsosurfaceMesh mesh = isomeshes[i]; if (mesh == null || mesh.vertices == null) continue; info.put("ID", (mesh.thisID == null ? "<noid>" : mesh.thisID)); info.put("vertexCount", new Integer(mesh.vertexCount)); if (mesh.ptCenter.x != Float.MAX_VALUE) info.put("center", mesh.ptCenter); info.put("offset", (mesh.ptOffset == null ? new Point3f() : mesh.ptOffset)); info.put("xyzMin", mesh.jvxlData.boundingBox[0]); info.put("xyzMax", mesh.jvxlData.boundingBox[1]); String s = JvxlCoder.jvxlGetInfo(mesh.jvxlData, true); if (s != null) info.put("jvxlInfo", s.replace('\n', ' ')); info.put("modelIndex", new Integer(mesh.modelIndex)); if (mesh.title != null) info.put("title", mesh.title); if (mesh.jvxlData.contourValues != null || mesh.jvxlData.contourValuesUsed != null) info.put("contours", mesh.getContourList(viewer)); V.addElement(info); } return V; } protected void remapColors() { JvxlData jvxlData = thisMesh.jvxlData; float[] vertexValues = thisMesh.vertexValues; short[] vertexColixes = thisMesh.vertexColixes; thisMesh.polygonColixes = null; if (vertexValues == null || jvxlData.isBicolorMap || jvxlData.vertexCount == 0) return; if (vertexColixes == null) vertexColixes = thisMesh.vertexColixes = new short[thisMesh.vertexCount]; boolean isTranslucent = Graphics3D.isColixTranslucent(thisMesh.colix); for (int i = thisMesh.vertexCount; --i >= 0;) { vertexColixes[i] = viewer.getColixForPropertyValue(vertexValues[i]); if (isTranslucent) vertexColixes[i] = Graphics3D.getColixTranslucent(vertexColixes[i], true, translucentLevel); } Vector[] contours = thisMesh.getContours(); if (contours != null) { for (int i = contours.length; --i >= 0; ) { float value = ((Float)contours[i].get(JvxlCoder.CONTOUR_VALUE)).floatValue(); short[] colix = ((short[])contours[i].get(JvxlCoder.CONTOUR_COLIX)); colix[0] = viewer.getColixForPropertyValue(value); int[] color = ((int[])contours[i].get(JvxlCoder.CONTOUR_COLOR)); color[0] = Graphics3D.getArgb(colix[0]); } } if (thisMesh.contourValues != null) { thisMesh.contourColixes = new short[thisMesh.contourValues.length]; for (int i = 0; i < thisMesh.contourValues.length; i++) { thisMesh.contourColixes[i] = viewer.getColixForPropertyValue(thisMesh.contourValues[i]); } thisMesh.setDiscreteColixes(null, null); } float[] range = viewer.getCurrentColorRange(); jvxlData.valueMappedToRed = Math.min(range[0], range[1]); jvxlData.valueMappedToBlue = Math.max(range[0], range[1]); jvxlData.isJvxlPrecisionColor = true; JvxlCoder.jvxlCreateColorData(jvxlData, vertexValues); String schemeName = viewer.getPropertyColorScheme(); thisMesh.colorCommand = "color $" + thisMesh.thisID + " " + getUserColorScheme(schemeName) + " range " + range[0] + " " + range[1]; thisMesh.isColorSolid = false; } private String getUserColorScheme(String schemeName) { String colors = viewer.getColorSchemeList(schemeName, false); return "\"" + (colors.length() == 0 ? schemeName : colors) + "\""; } public float getValue(int x, int y, int z) { return 0; } public boolean checkObjectHovered(int x, int y, BitSet bsVisible) { String s = findValue(x, y, false, bsVisible); if (s == null) return false; if (g3d.isDisplayAntialiased()) { x <<= 1; y <<= 1; } viewer.hoverOn(x, y, s); return true; } private final static int MAX_OBJECT_CLICK_DISTANCE_SQUARED = 10 * 10; private final Point3i ptXY = new Point3i(); public Point3fi checkObjectClicked(int x, int y, int action, BitSet bsVisible) { if (!viewer.isBound(action, ActionManager.ACTION_pickIsosurface)) return null; int dmin2 = MAX_OBJECT_CLICK_DISTANCE_SQUARED; if (g3d.isAntialiased()) { x <<= 1; y <<= 1; dmin2 <<= 1; } int imesh = -1; int jmaxz = -1; int jminz = -1; int maxz = Integer.MIN_VALUE; int minz = Integer.MAX_VALUE; for (int i = 0; i < meshCount && imesh < 0; i++) { IsosurfaceMesh m = isomeshes[i]; if (m.visibilityFlags == 0 || m.modelIndex >= 0 && !bsVisible.get(m.modelIndex)) continue; Point3f[] centers = m.getCenters(); for (int j = centers.length; --j >= 0; ) { Point3f v = centers[j]; int d2 = coordinateInRange(x, y, v, dmin2, ptXY); if (d2 >= 0) { imesh = i; if (ptXY.z < minz) { minz = ptXY.z; jminz = j; } if (ptXY.z > maxz) { maxz = ptXY.z; jmaxz = j; } } } } if (imesh < 0) return null; IsosurfaceMesh pickedMesh = isomeshes[imesh]; setPropertySuper("thisID", pickedMesh.thisID, null); boolean toFront = false; int iface = (toFront ? jminz : jmaxz); Point3fi ptRet = new Point3fi(); ptRet.set(pickedMesh.centers[iface]); ptRet.modelIndex = (short) pickedMesh.modelIndex; Vector3f vNorm = new Vector3f(); pickedMesh.getFacePlane(iface, vNorm); vNorm.scale(-1); setHeading(ptRet, vNorm, 2); return ptRet; } private void navigate(int dz) { if (thisMesh == null) return; Point3f navPt = new Point3f(viewer.getNavigationOffset()); Point3f toPt = new Point3f(); viewer.unTransformPoint(navPt, toPt); navPt.z += dz; viewer.unTransformPoint(navPt, toPt); Point3f ptRet = new Point3f(); Vector3f vNorm = new Vector3f(); if (!getClosestNormal(thisMesh, toPt, ptRet, vNorm)) return; Point3f pt2 = new Point3f(ptRet); pt2.add(vNorm); Point3f pt2s = new Point3f(); viewer.transformPoint(pt2, pt2s); if (pt2s.y > navPt.y) vNorm.scale(-1); setHeading(ptRet, vNorm, 0); } private void setHeading(Point3f pt, Vector3f vNorm, int nSeconds) { Orientation o1 = viewer.getOrientation(); viewer.navigate(0, pt); Point3f toPts = new Point3f(); Point3f toPt = new Point3f(vNorm); toPt.add(pt); viewer.transformPoint(toPt, toPts); Point3f navPt = new Point3f(viewer.getNavigationOffset()); toPts.sub(navPt); toPts.z = 0; float angle = Measure.computeTorsion(JmolConstants.axisNY, JmolConstants.center, JmolConstants.axisZ, toPts, true); viewer.navigate(0, JmolConstants.axisZ, angle); toPt.set(vNorm); toPt.add(pt); viewer.transformPoint(toPt, toPts); toPts.sub(navPt); angle = Measure.computeTorsion(JmolConstants.axisNY, JmolConstants.center, JmolConstants.axisX, toPts, true); viewer.navigate(0, JmolConstants.axisX, 20 - angle); navPt = new Point3f(viewer.getNavigationOffset()); if (nSeconds <= 0) return; viewer.saveOrientation("_navsurf"); o1.restore(0, true); viewer.script("restore orientation _navsurf " + nSeconds); } private boolean getClosestNormal(IsosurfaceMesh m, Point3f toPt, Point3f ptRet, Vector3f normalRet) { Point3f[] centers = m.getCenters(); float d; float dmin = Float.MAX_VALUE; int imin = -1; for (int i = centers.length; --i >= 0; ) { if ((d = centers[i].distance(toPt)) >= dmin) continue; dmin = d; imin = i; } if (imin < 0) return false; getClosestPoint(m, imin, toPt, ptRet, normalRet); return true; } private void getClosestPoint(IsosurfaceMesh m, int imin, Point3f toPt, Point3f ptRet, Vector3f normalRet) { Point4f plane = m.getFacePlane(imin, normalRet); float dist = Measure.distanceToPlane(plane, toPt); normalRet.scale(-dist); ptRet.set(toPt); ptRet.add(normalRet); dist = Measure.distanceToPlane(plane, ptRet); if (m.centers[imin].distance(toPt) < ptRet.distance(toPt)) ptRet.set(m.centers[imin]); } private String findValue(int x, int y, boolean isPicking, BitSet bsVisible) { int dmin2 = MAX_OBJECT_CLICK_DISTANCE_SQUARED; if (g3d.isAntialiased()) { x <<= 1; y <<= 1; dmin2 <<= 1; } Vector pickedContour = null; for (int i = 0; i < meshCount; i++) { IsosurfaceMesh m = isomeshes[i]; if (m.visibilityFlags == 0 || m.modelIndex >= 0 && !bsVisible.get(m.modelIndex)) continue; Vector[] vs = m.jvxlData.vContours; if (vs != null) { for (int j = 0; j < vs.length; j++) { Vector vc = vs[j]; int n = vc.size() - 1; for (int k = JvxlCoder.CONTOUR_POINTS; k < n; k++) { Point3f v = (Point3f) vc.get(k); int d2 = coordinateInRange(x, y, v, dmin2, ptXY); if (d2 >= 0) { dmin2 = d2; pickedContour = vc; } } } if (pickedContour != null) return pickedContour.get(JvxlCoder.CONTOUR_VALUE).toString(); } else if (m.jvxlData.jvxlPlane != null && m.vertexValues != null) { int pickedVertex = -1; for (int k = m.vertexCount; --k >= m.firstRealVertex;) { Point3f v = m.vertices[k]; int d2 = coordinateInRange(x, y, v, dmin2, ptXY); if (d2 >= 0) { dmin2 = d2; pickedVertex = k; } } if (pickedVertex != -1) return "v" + pickedVertex + ": " + m.vertexValues[pickedVertex]; } } return null; } }
[ "joliebig@fim.uni-passau.de" ]
joliebig@fim.uni-passau.de
f91cdf3dc3802ac385b7cfbe278f014e8da1fb86
8199fd408f4d83b2322e0dc1ff16e8e47651c0d2
/src/main/java/com/zzc/rabbitmqdemo/config/RabbitConfig.java
2d9cd04b6d7109e63e19080b81a74b20ec1ed6ae
[]
no_license
13535048320/rabbitmq-demo
055ee61053f14f3156f7afe2f9e3b4af6e572184
3d0639e9afbd0f6d229113e3fcd2309645c0a7f9
refs/heads/master
2020-09-19T23:47:19.952347
2019-11-28T09:33:35
2019-11-28T09:33:35
224,325,804
0
0
null
null
null
null
UTF-8
Java
false
false
303
java
package com.zzc.rabbitmqdemo.config; import org.springframework.amqp.core.Queue; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class RabbitConfig { @Bean public Queue queue() { return new Queue("demo"); } }
[ "zhicheng.zhang@artisantechnologies.cn" ]
zhicheng.zhang@artisantechnologies.cn
e25a407639443234181ca14aeba5166bf53d7271
702e940937c82f0e9b535a7c0492e5b0a22707cf
/atecher-blog-web/src/main/java/com/atecher/blog/web/util/ueditor/hunter/ImageHunter.java
f31833d0856c0141a3f4bc343a378a6cc46c21e5
[]
no_license
atecher/atecher-blog
23e0abcf863f9cbc4e57b2cbb710e929657b13f0
806685e184b5e8797a10f605d3c0b5fbe7f05191
refs/heads/master
2020-12-02T21:23:08.056492
2017-07-11T06:23:37
2017-07-11T06:23:37
96,298,403
0
0
null
null
null
null
UTF-8
Java
false
false
3,136
java
package com.atecher.blog.web.util.ueditor.hunter; import com.atecher.blog.web.util.ueditor.PathFormat; import com.atecher.blog.web.util.ueditor.define.*; import com.atecher.blog.web.util.ueditor.upload.StorageManager; import java.net.HttpURLConnection; import java.net.URL; import java.util.Arrays; import java.util.List; import java.util.Map; /** * 图片抓取器 * @author hancong03@baidu.com * */ public class ImageHunter { private String filename = null; private String savePath = null; private String rootPath = null; private List<String> allowTypes = null; private long maxSize = -1; private List<String> filters = null; public ImageHunter ( Map<String, Object> conf ) { this.filename = (String)conf.get( "filename" ); this.savePath = (String)conf.get( "savePath" ); this.rootPath = (String)conf.get( "rootPath" ); this.maxSize = (Long)conf.get( "maxSize" ); this.allowTypes = Arrays.asList( (String[])conf.get( "allowFiles" ) ); this.filters = Arrays.asList( (String[])conf.get( "filter" ) ); } public State capture ( String[] list ) { MultiState state = new MultiState( true ); for ( String source : list ) { state.addState( captureRemoteData( source ) ); } return state; } public State captureRemoteData ( String urlStr ) { HttpURLConnection connection = null; URL url = null; String suffix = null; try { url = new URL( urlStr ); if ( !validHost( url.getHost() ) ) { return new BaseState( false, AppInfo.PREVENT_HOST ); } connection = (HttpURLConnection) url.openConnection(); connection.setInstanceFollowRedirects( true ); connection.setUseCaches( true ); if ( !validContentState( connection.getResponseCode() ) ) { return new BaseState( false, AppInfo.CONNECTION_ERROR ); } suffix = MIMEType.getSuffix( connection.getContentType() ); if ( !validFileType( suffix ) ) { return new BaseState( false, AppInfo.NOT_ALLOW_FILE_TYPE ); } if ( !validFileSize( connection.getContentLength() ) ) { return new BaseState( false, AppInfo.MAX_SIZE ); } String savePath = this.getPath( this.savePath, this.filename, suffix ); String physicalPath = this.rootPath + savePath; State state = StorageManager.saveFileByInputStream( connection.getInputStream(), physicalPath ); if ( state.isSuccess() ) { state.putInfo( "url", PathFormat.format( savePath ) ); state.putInfo( "source", urlStr ); } return state; } catch ( Exception e ) { return new BaseState( false, AppInfo.REMOTE_FAIL ); } } private String getPath ( String savePath, String filename, String suffix ) { return PathFormat.parse( savePath + suffix, filename ); } private boolean validHost ( String hostname ) { return !filters.contains( hostname ); } private boolean validContentState ( int code ) { return HttpURLConnection.HTTP_OK == code; } private boolean validFileType ( String type ) { return this.allowTypes.contains( type ); } private boolean validFileSize ( int size ) { return size < this.maxSize; } }
[ "atecher@qq.com" ]
atecher@qq.com
7e447e7f47789f4686885936447758e4fa89b4f0
a1017521dafdaa957ff9c230c2c65554340aad50
/feign/src/main/java/com/example/feign/controller/ConsumerFeignClient.java
9287d03fe64b8d265e47c2962e604e03432b6319
[]
no_license
wwhm880218/demo
bc356b5239439e844ac027118e62f35d581c3fd8
1f8f09d8febc8b1f935b8c1db45bd01d2b06cef4
refs/heads/master
2023-03-26T11:33:02.783861
2021-03-25T09:36:44
2021-03-25T09:36:44
304,532,337
0
0
null
null
null
null
UTF-8
Java
false
false
554
java
package com.example.feign.controller; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; /** * @CLASSNAME ConsumerFeignClient * @PROJECTNAME com.example.feign.controller * @Description * @Author 鲁少博 on 2020/10/12 14:57 * @Version V1.0 */ @FeignClient(name = "consumer",fallback = ConsumerFeignHystrixClient.class) public interface ConsumerFeignClient { @GetMapping("/listUsers") public String listUsers(); @GetMapping("/getUser") public String getUser(); }
[ "270767847@qq.com" ]
270767847@qq.com
ec808739a047d56494ce048b1b95621d68500062
a3c37221f724811fd34dbc709a030c0a3fab0edc
/happyBuy 20170221/app/src/main/java/dotc/android/happybuy/config/abtest/bean/UrlInfo.java
912b5d9e35250e9e84b9281a99f36d3e0abec897
[]
no_license
Jackpittywang/happyBuy20170221
6e69a85665a888ff6544a60069ca79847734f712
ff2555f1bc1ede47be5cb0b67fb2e4f9c00dd3a5
refs/heads/master
2021-01-20T12:28:16.159814
2017-02-21T09:34:12
2017-02-21T09:34:12
82,654,418
0
0
null
2017-02-21T08:49:06
2017-02-21T08:20:43
Java
UTF-8
Java
false
false
162
java
package dotc.android.happybuy.config.abtest.bean; /** * Created by wangjun on 16/12/7. */ public class UrlInfo { public String invite_win_coins_detail; }
[ "wei.yan@avazu.net" ]
wei.yan@avazu.net
6fbcda7d893fd3c51152accc1a1983f333dd188a
24ec8f83bcffba72bfc2fb241b2dc79f9deb0e22
/src/main/java/com/jony/jms/activemq/TopicPublisherMain.java
9b875a33280fc529ac39da5046f7a35da3d00aac
[]
no_license
PengfeiLiOnGit/JMS-MQ
eba06d007937f37368698f69669c0569a486ee2d
338df805a2b7d81c045ef72f4e1ffce8de101b2c
refs/heads/master
2022-07-23T08:44:53.202390
2020-04-02T17:36:34
2020-04-02T17:36:34
252,103,541
0
0
null
2022-07-01T21:25:18
2020-04-01T07:30:00
Java
UTF-8
Java
false
false
1,249
java
package com.jony.jms.activemq; import org.apache.activemq.ActiveMQConnection; import org.apache.activemq.ActiveMQConnectionFactory; import javax.jms.*; public class TopicPublisherMain { // 默认用户名 public static final String USER_NAME = ActiveMQConnection.DEFAULT_USER; // 默认密码 public static final String PASSWORD = ActiveMQConnection.DEFAULT_PASSWORD; public static final String BROKER_URL = ActiveMQConnection.DEFAULT_BROKER_URL; public void send(){ // 创建工厂,创建连接、启动连接、创建topic、创建会话、发送 ConnectionFactory factory = new ActiveMQConnectionFactory(); try { Connection connection = factory.createConnection(); connection.start(); Session session = connection.createSession(false,Session.AUTO_ACKNOWLEDGE); Topic topic = session.createTopic("topic-test"); MessageProducer publisher = session.createProducer(topic); TextMessage message = session.createTextMessage("test"); publisher.send(message); session.close(); connection.close(); } catch (JMSException e) { e.printStackTrace(); } } }
[ "jonyonline@sina.com" ]
jonyonline@sina.com
4b233f182e5aeceec83d55c1e2c7960aeb61ce9c
acd68968b4e659f92f5d32f3948052725b99c11b
/core/src/main/java/io/undertow/protocols/http2/Http2DataFrameParser.java
ecc5f0b26d1fee4f22e493649cd1e009859092dd
[ "Apache-2.0" ]
permissive
portofrotterdam/undertow
ccbf928fde90cf33168f58a7f2779f07a01dbb17
62ddd0eedc6c66dba172a790221617846877b476
refs/heads/master
2021-10-01T15:51:09.246254
2018-11-27T13:35:37
2018-11-27T13:35:37
97,053,100
1
1
null
null
null
null
UTF-8
Java
false
false
1,526
java
/* * JBoss, Home of Professional Open Source. * Copyright 2014 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * 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 io.undertow.protocols.http2; import java.nio.ByteBuffer; import org.xnio.Bits; /** * Parses the data frame. If the passing flag has not been set then there is nothing to parse. * * @author Stuart Douglas */ class Http2DataFrameParser extends Http2PushBackParser { private int padding = 0; public Http2DataFrameParser(int frameLength) { super(frameLength); } @Override protected void handleData(ByteBuffer resource, Http2FrameHeaderParser headerParser) { if (Bits.anyAreClear(headerParser.flags, Http2Channel.DATA_FLAG_PADDED)) { finish(); return; } if (resource.remaining() > 0) { padding = resource.get() & 0xFF; finish(); } } int getPadding() { return padding; } }
[ "stuart.w.douglas@gmail.com" ]
stuart.w.douglas@gmail.com
8d60a66d97ad8ad21e28a21b78ade23881e311d9
e6b8781bd0aaac335bd97e2d76003c1bc06e83c7
/2week/Diablo3/Item/Armor.java
07a51723fb0390f2524ac2b56ff7880945cb44ef
[]
no_license
Bo3o2S/java
47cb4f0533b7da95ec8022e89995e4b1b6ba3019
cedeff283767becc0e3d14a95a6eee64508f0d41
refs/heads/master
2021-01-21T10:16:16.439301
2017-06-17T06:03:05
2017-06-17T06:03:05
91,684,332
0
0
null
null
null
null
UTF-8
Java
false
false
298
java
package Item; public class Armor extends Item{ public double Item_Defence; public int Item_Vitality; public int Item_Strength; public int Item_Dex; public int Item_Intelligence; public int Item_Jewelry_Hole_Num; public Item_Jewelry_Hole jewelry_hole = new Item_Jewelry_Hole(); }
[ "honor2008@naver.com" ]
honor2008@naver.com
2ff508446762aeeecfa673ea3658415197c82cd0
989ec52bc364fe597688da3c15b9dcd76a6272a2
/src/main/java/com/igorbarros/curso/entites/Payment.java
b51e37aacb2510f8c4d004e8daac80a66d9e3a85
[]
no_license
igorbarrosrj/Spring_Boot
15215b23570ba3121e67eb6b832f8baca13ebddd
fe3689a1a5df6771127dad46d551b6f5809ffa49
refs/heads/master
2020-09-09T18:03:40.203395
2019-11-13T17:57:41
2019-11-13T17:57:41
221,520,024
0
0
null
null
null
null
UTF-8
Java
false
false
1,564
java
package com.igorbarros.curso.entites; import java.io.Serializable; import java.time.Instant; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.MapsId; import javax.persistence.OneToOne; import javax.persistence.Table; import com.fasterxml.jackson.annotation.JsonIgnore; @Entity @Table(name ="tb_payment") public class Payment implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private Instant moment; @JsonIgnore @OneToOne @MapsId private Order order; public Payment() { } public Payment(Long id, Instant moment, Order order) { super(); this.id = id; this.moment = moment; this.order = order; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Instant getMoment() { return moment; } public void setMoment(Instant moment) { this.moment = moment; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((id == null) ? 0 : id.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Payment other = (Payment) obj; if (id == null) { if (other.id != null) return false; } else if (!id.equals(other.id)) return false; return true; } }
[ "igorbarrosrj@gmail.com" ]
igorbarrosrj@gmail.com
2f074a095570abcce80585731aedd79a5d0cd58b
76cc8530a22a65512ecb3d7d342cfd8f1668cf94
/src/day7/Player.java
b9d60b6cdb7d68dd82c7915ea87a049bf1ac178f
[]
no_license
ivanLisyushkin/JavaMarathonRepo
a139f946d85ca664fda63b06eb5930b72789bb9b
56bf0b8bc6992391b11791d171f0785eafda845a
refs/heads/master
2023-06-08T09:15:21.131162
2020-09-10T15:55:50
2020-09-10T15:55:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,375
java
package day7; public class Player { private int stamina; private static final int MAX_STAMINA = 100; private static final int MIN_STAMINA = 0; private static int countPlayers = 0; public int getStamina() { return stamina; } public Player(int stamina) { this.stamina = stamina; if (countPlayers < 6) countPlayers++; } public void run() { if (stamina == MIN_STAMINA) return; stamina--; if (stamina == MIN_STAMINA) countPlayers--; } public static void info() { switch (countPlayers) { case 1: System.out.println("Команды неполные, еще есть " + (6 - countPlayers) + " свободных мест"); break; case 2: case 3: case 4: System.out.println("Команды неполные, еще есть " + (6 - countPlayers) + " свободных места"); break; case 5: System.out.println("Команды неполные, еще есть " + (6 - countPlayers) + " свободное место"); break; default: System.out.println("Мест в команде больше нет"); break; } } }
[ "gagarincity@gmail.com" ]
gagarincity@gmail.com
51181d829a6363bf80d7330788dc5ecf1a3f4e34
e2877984f8256a5f2ae40c65b0a661d9118274ed
/LeetCode/_0384_Shuffle_an_Array/Solution2.java
ce3221a94af94cbeaa426bd660af30b1e98e6f51
[]
no_license
chenggang0815/algo
6c9fde88066444558fe1ae9a0fd65859f6c769e9
952cde59b87bc1e034c5006fda3a33f848cceec5
refs/heads/master
2022-12-09T08:43:12.274055
2022-11-28T17:47:38
2022-11-28T17:47:38
163,585,525
1
0
null
null
null
null
UTF-8
Java
false
false
1,119
java
package LeetCode._0384_Shuffle_an_Array; import java.util.Random; /* 时间复杂度 : O(n) Fisher-Yates 洗牌算法时间复杂度是线性的,因为算法中生成随机序列,交换两个元素这两种操作都是常数时间复杂度的。 空间复杂度: O(n) 因为要实现重置功能,原始数组必须得保存一份,因此空间复杂度并没有优化 */ public class Solution2 { private int[] array; private int[] original; Random rand = new Random(); private int getRandomIndex(int left, int right){ return rand.nextInt(right - left) + left; } private void swap(int i, int j){ int temp = array[i]; array[i] = array[j]; array[j] = temp; } public Solution2(int[] nums){ array = nums; original = nums.clone(); } public int[] reset(){ array = original; original = original.clone(); return array; } public int[] shuffle(){ for (int i = 0; i < array.length; i++){ swap(i, getRandomIndex(i, array.length)); } return array; } }
[ "954036868@qq.com" ]
954036868@qq.com
9d9588d8e432eb778bda3c2ebea42c54f6b141f5
2e685dbe6353a35fa11ea8a3e7729065a4ca9d20
/A00240110AgileProject/src/test/java/com/example/demo/StudentTest2.java
8fd5d8fb17a9c858517486fe84c9bfa5ed2944de
[]
no_license
A00240110/AgileProHub
a306efefbf1ebed29af2698e5d22d86a05a46cbc
7e8c5a704bee2513a62492434b3d06fca955355e
refs/heads/main
2023-02-09T05:43:15.659212
2021-01-04T19:30:18
2021-01-04T19:30:18
326,732,087
0
0
null
null
null
null
UTF-8
Java
false
false
709
java
package com.example.demo; import static org.assertj.core.api.Assertions.assertThat; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager; @DataJpaTest public class StudentTest2 { @Autowired private TestEntityManager entityManager; @Autowired private StudentRepo repository; @Test public void testSaveNewStudent() { entityManager.persist(new Student("Jake", "Keighery", "1099")); Student student = repository.findByName("Jake"); assertThat(student.getFirstName()).isEqualTo("Jake"); } }
[ "Dunne family@LAPTOP-LBSBOPGG" ]
Dunne family@LAPTOP-LBSBOPGG
2977a5900a4e29ede94317ea72342f183c03fa35
12cc42c14857131eb05047e8b2a0aef04c9da28b
/gisoper/src/main/java/org/gisoper/com/utils/PartnerApiUtil.java
794f2e889f2ef7d2ec7fcbc5fb1192d93d915ac8
[]
no_license
JustDoItQz/RxApp
911c116c324ed4d8a4777220340372235b37ff15
9c66d5bef9ace44accb39e0de8e2d866b14e1f4e
refs/heads/master
2022-12-21T12:45:17.476171
2020-03-27T05:35:00
2020-03-27T05:35:00
103,074,317
1
0
null
2022-12-16T11:44:32
2017-09-11T01:08:48
Java
UTF-8
Java
false
false
6,559
java
package org.gisoper.com.utils; import net.sf.json.JSONObject; import org.apache.commons.lang.StringUtils; import org.common.com.constant.ConstantUtils; import org.common.com.constant.SystemConstant; import org.common.com.utils.DateUtils; import org.dom4j.Document; import org.dom4j.DocumentHelper; import org.dom4j.Element; import org.gisoper.com.vo.PartnerResultBeanVo; import org.gisoper.com.vo.RegisterPartnerBeanVo; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.net.URLDecoder; import java.net.URLEncoder; import java.util.*; public class PartnerApiUtil { private static Logger logger = LoggerFactory.getLogger(PartnerApiUtil.class) ; public static String createXml(String type, RegisterPartnerBeanVo partnerBeanVo,String msids){ String xmlstr = "" ; try{ Document document = DocumentHelper.createDocument() ; document.setXMLEncoding("GB2312"); Element yhjx_init = document.addElement("yhjx_init") ; Element request=yhjx_init.addElement("request") ; Element username = request.addElement("username") ; username.setText(SystemConstant.getPartnerApiUser()); Element password = request.addElement("password") ; password.setText(SystemConstant.getPartnerApiPwd()); Element typement = request.addElement("type") ; typement.setText(type); Element info = request.addElement("info") ; if (ConstantUtils.NEW_REGISTER.equals(type)){ Element msid = info.addElement("msid") ; msid.setText(partnerBeanVo.getMsid()); Element driver_name = info.addElement("driver_name") ; driver_name.setText(partnerBeanVo.getDriverName()); Element idcard = info.addElement("idcard") ; idcard.setText(partnerBeanVo.getIdcard()); }else if (ConstantUtils.DEL_ORG_DRIVER_REL.equals(type)){ Element msid = info.addElement("msid") ; msid.setText(msids); }else if (ConstantUtils.GET_ORG_DRIVER_REL.equals(type)){ Element msid = info.addElement("msid") ; msid.setText(msids); }else if (ConstantUtils.MUIT_EXACT_LOCATION.equals(type)){ Element msid = info.addElement("msid") ; msid.setText(msids); Element datetime = info.addElement("datetime") ; datetime.setText(DateUtils.convert(new Date())); Element external = info.addElement("external_note") ; external.setText("精确定位"); } xmlstr = document.asXML() ; }catch (Exception e){ e.printStackTrace(); Map<String,String> logMap = new HashMap<String, String>() ; logMap.put("msids",msids) ; logMap.put("type",type) ; logMap.put("partnerBeanVo", JSONObject.fromObject(partnerBeanVo).toString()) ; logger.error("创建xml文件失败,{},{}",e,logMap); } return xmlstr ; } public static List<PartnerResultBeanVo> readStringXml(String xmlStr){ List<PartnerResultBeanVo> resultBeanVos = new ArrayList<PartnerResultBeanVo>() ; Document doc = null ; try{ doc = DocumentHelper.parseText(xmlStr) ; Element rootElt = doc.getRootElement() ; Iterator iter = rootElt.elementIterator("response") ; while (iter.hasNext()){ Element recordEle = (Element) iter.next() ; String type = recordEle.elementTextTrim("type") ; Iterator iters = recordEle.elementIterator("result") ; if (type.equals(ConstantUtils.NEW_REGISTER)){ while (iters.hasNext()){ PartnerResultBeanVo partnerResultBeanVo = new PartnerResultBeanVo() ; Element itemEle = (Element) iters.next() ; String result_id = itemEle.elementTextTrim("result_id") ; String result_info = itemEle.elementTextTrim("resultInfo") ; String dateTime = itemEle.elementTextTrim("datetime") ; partnerResultBeanVo.setResultId(result_id); partnerResultBeanVo.setResultInfo(result_info); resultBeanVos.add(partnerResultBeanVo) ; } }else if (ConstantUtils.DEL_ORG_DRIVER_REL.equals(type)){ while (iters.hasNext()){ Element itemEle = (Element) iters.next() ; } }else if (ConstantUtils.GET_ORG_DRIVER_REL.equals(type)){ while (iters.hasNext()){ Element itemEle = (Element) iters.next() ; } }else if (ConstantUtils.MUIT_EXACT_LOCATION.equals(type)){ while (iters.hasNext()){ Element itemEle = (Element) iters.next() ; } } } }catch (Exception e){ e.printStackTrace(); Map<String,String> logMap = new HashMap<String, String>() ; logMap.put("xmlstr",xmlStr) ; logger.error("解析xml文件失败:{},{}",e,logMap); } return resultBeanVos ; } public static String encode(String param) throws Exception{ String encodeParam = URLEncoder.encode(param,"GB2312") ; return encodeParam ; } public static String decode(String param) throws Exception{ String decodeParam = URLDecoder.decode(param,"GB2312") ; return decodeParam ; } public static String paramEncode(String type,RegisterPartnerBeanVo registerPartnerBeanVo,String msids){ String paramStr = "" ; try{ String xmlStr = createXml(type,registerPartnerBeanVo,msids) ; if (StringUtils.isNotBlank(xmlStr)){ paramStr = encode(xmlStr) ; } }catch (Exception e){ e.printStackTrace(); } return paramStr ; } public static List<PartnerResultBeanVo> resultDecode(String xmlStr){ List<PartnerResultBeanVo> resultBeanVos = new ArrayList<PartnerResultBeanVo>() ; try{ String xml = decode(xmlStr) ; resultBeanVos = readStringXml(xml) ; }catch (Exception e){ e.printStackTrace(); } return resultBeanVos ; } }
[ "1820066354@qq.com" ]
1820066354@qq.com
122003f15eb8a8fc6c073b595626aac4734d25c8
bf02ad64f5f944a9fa10ca1a7ad6f36369d5ec33
/ProjetoPratico/src/projetopratico/ContaBanco.java
a6d1b7d19326a565d884f2c8e9b62c4f7650322f
[]
no_license
Leticia12git/Projetos-Java
dd58b2d57d0ec02ef0417838756f6ef69760468e
282b452a33cbb4f1e192281bd49091c669d22bdb
refs/heads/master
2022-03-17T13:56:26.944532
2019-11-08T20:50:15
2019-11-08T20:50:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,663
java
package projetopratico; public class ContaBanco { // ATRIBUTOS public int numConta; protected String tipo; private String dono; private float saldo; private boolean status; // CONSTRUTOR public ContaBanco(){ this.setSaldo(0); this.abrirConta(1, "SEU NOME","CC"); } // MÉTODOS PERSONALIZADOS public void abrirConta(int n,String d,String t){ this.setNumConta(n); this.setDono(d); if(t.equals("CC") || t.equals("cc")){ this.setSaldo(saldo+=50); this.setTipo("CC"); }else if(t.equals("CP") || t.equals("cp")){ this.setSaldo(saldo+=150); this.setTipo("CP"); }else{ System.out.println("NÃO EXISTE ESSA MODALIDADE"); } this.setStatus(true); } public void fecharConta(){ if(this.getSaldo() > 0){ System.out.println("TIRE SEU DINHEIRO"); }else if(this.getSaldo() < 0){ System.out.println("PAGUE O QUE DEVE"); }else{ this.setStatus(false); } } public void depositar(int v){ if(this.getStatus()){ this.setSaldo(saldo+=v); }else{ System.out.println("ESSA CONTA ESTÁ INDISPONÍVEL"); } } public void sacar(int v){ if(this.getStatus()){ if(this.getSaldo() > v){ this.setSaldo(saldo-=v); }else{ System.out.println("NÃO TEM SALDO SUFICIENTE"); } }else{ System.out.println("ESTA CONTA ESTÁ INDISPONÍVEL"); } } public void pagarMensal(){ if(this.getStatus()){ int v; if(this.getTipo() == "CC" ){ v = 12; this.setSaldo(saldo-=v); }else{ v = 20; this.setSaldo(saldo-=v); } }else{ System.out.println("ESTA CONTA ESTÁ INDISPONÍVEL"); } } // GETTERS E SETTERS public int getNumConta() { return numConta; } public void setNumConta(int n) { this.numConta = n; } public String getTipo() { return tipo; } public void setTipo(String t) { this.tipo = t; } public String getDono() { return dono; } public void setDono(String d) { this.dono = d; } public float getSaldo() { return saldo; } public void setSaldo(float s) { this.saldo = s; } public boolean getStatus() { return status; } public void setStatus(boolean st) { this.status = st; } }
[ "drasyck1@gmail.com" ]
drasyck1@gmail.com
388fedbd7212eeed929087d4e4399a5f9511cce1
dcc488ed7075994ea21ae2d88051095bdf78f4eb
/app/src/main/java/com/mobidosoft/testactiviti/LoginFragment.java
8b67d779325407fde53e22c8219bbb2946921995
[]
no_license
ronaldmpd/TareaAppPersonAndroid
81546f37fad801f22f1563537673aed1f89d50e8
7ca171fa03b59834c8e9efe8aab0e75bb61b55f4
refs/heads/master
2016-08-03T14:08:52.575859
2015-03-26T20:00:13
2015-03-26T20:00:13
32,949,230
0
0
null
null
null
null
UTF-8
Java
false
false
5,041
java
package com.mobidosoft.testactiviti; import android.app.AlertDialog; import android.content.Intent; import android.os.AsyncTask; import android.os.Bundle; import android.support.v4.app.Fragment; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.ListView; import com.mobidosoft.testactiviti.utils.UtilityHttp; import org.json.JSONException; import java.util.ArrayList; import java.util.Arrays; /** * A placeholder fragment containing a simple view. */ public class LoginFragment extends Fragment { private static final String LOG_TAG = LoginFragment.class.getSimpleName(); EditText editTextUserName; Button buttonEntrar; private ArrayAdapter<String> arrayAdapter; public LoginFragment() { } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final View rootView = inflater.inflate(R.layout.fragment_main, container, false); editTextUserName =(EditText)rootView.findViewById(R.id.txtUserName); buttonEntrar = (Button)rootView.findViewById(R.id.btnEntrar); buttonEntrar.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Log.d(LOG_TAG, "Start Login"); String usuario = editTextUserName.getText().toString(); Intent intent = new Intent(getActivity(),HomeActivity.class); intent.putExtra("name", usuario); startActivity(intent); Log.d(LOG_TAG,usuario); Log.d(LOG_TAG,"End Login"); } }); Button buttonListar = (Button)rootView.findViewById(R.id.btnListar); buttonListar.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Log.d(LOG_TAG, "Start Listar"); String[] results = {"Wilsterman 1 - Aurora 1", "River Plate 1 - Boca Juniors 1", "River Plate 1 - Boca Juniors 1", "River Plate 1 - Boca Juniors 1", "River Plate 1 - Boca Juniors 1", "River Plate 1 - Boca Juniors 1", "River Plate 1 - Boca Juniors 1", "River Plate 1 - Boca Juniors 1", "Wilsterman 1 - Aurora 1", "River Plate 1 - Boca Juniors 1", "River Plate 1 - Boca Juniors 1", "River Plate 1 - Boca Juniors 1", "River Plate 1 - Boca Juniors 1", "River Plate 1 - Boca Juniors 1", "River Plate 1 - Boca Juniors 1", "River Plate 1 - Boca Juniors 1"}; ArrayList<String> resultList = new ArrayList<>(Arrays.asList(results)); arrayAdapter = new ArrayAdapter<String>(getActivity(), R.layout.result_view, R.id.result_text_view, resultList); final ListView scrollView = (ListView)rootView.findViewById(R.id.result_list_view); scrollView.setAdapter(arrayAdapter); GetResultTask task = new GetResultTask(); task.execute(); Log.d(LOG_TAG,"End Listar"); } }); Button buttonAgregar = (Button)rootView.findViewById(R.id.btnAgregar); buttonAgregar.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Log.d(LOG_TAG, "Start Agregar"); Intent intent = new Intent(getActivity(),SavePersonActivity.class); //intent.putExtra("name", usuario); startActivity(intent); Log.d(LOG_TAG,"End Agregar"); } }); return rootView; } class GetResultTask extends AsyncTask<Void, Void, String[]> { @Override protected String[] doInBackground(Void... params) { Log.v(LOG_TAG,"stat doInBrackGround"); String resultString = UtilityHttp.getJsonStringFromNetwork(); Log.v(LOG_TAG,resultString); try { return UtilityHttp.parseFixtureJson(resultString); } catch (JSONException e) { Log.e(LOG_TAG, "Error parsing" + e.getMessage(), e); e.printStackTrace(); return new String[] {"No DATA"}; } } @Override protected void onPostExecute(String[] strings) { arrayAdapter.clear(); for(String result :strings){ arrayAdapter.add(result); } } } }
[ "ronald.pinto.d@gmail.com" ]
ronald.pinto.d@gmail.com
5615fd06f778ff55ee5bcb113b1dc427417bb589
59f45fa39a3a741a65cffacea08cbece11c1e1b4
/src/Practice/AddtwoNumbers.java
92a83c6a8ea7e192ef56b8e25973a2a9d775dd89
[]
no_license
rmehetre87/javaprogramms
15d9bfb8adaa0a5e18aeaea3015b8310ab52e27e
0a2e6a51015086f14374e0cc4234bd15de081205
refs/heads/master
2023-02-23T19:36:28.483251
2021-01-29T07:26:22
2021-01-29T07:26:22
326,078,312
0
0
null
null
null
null
UTF-8
Java
false
false
479
java
package Practice; public class AddtwoNumbers { public static void main(String[] args) { int num1 = 1234; int num2 = 5678; /*String number = String.valueOf(num1); for(int i = 0; i < number.length(); i++) { int j = Character.digit(number.charAt(i), 10); System.out.println("digit: " + j); }*/ while (num1 > 1) { System.out.println( num1 % 10); num1 = num1 / 10; } System.out.println(num1); } }
[ "rahulmehetre21@gmail.com" ]
rahulmehetre21@gmail.com
f2df2ad40fbaa11093a6195d6aa23985555a6b3f
903a3e8fa42bf2eaeacfcd9accac2cb07142a289
/app/src/main/java/br/com/pondionz/dao/MySQLiteHelper.java
7fbb21bed2636edccb01333782a8a58b320db698
[]
no_license
avnermax/Pondionz
7ff216465a1ff97594c27ff50017585f0a363d8b
0ca1ed5c82b49a2fa8702af68c08681e87e388fc
refs/heads/master
2020-03-10T00:56:41.893865
2018-04-08T11:45:07
2018-04-08T11:45:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,772
java
package br.com.pondionz.dao; import android.content.ContentValues; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.os.AsyncTask; import android.preference.PreferenceManager; import android.support.v7.app.AlertDialog; import android.util.Log; import android.widget.ArrayAdapter; import android.widget.Toast; import java.util.ArrayList; import java.util.List; import br.com.pondionz.R; import br.com.pondionz.model.Ponto; import br.com.pondionz.model.Settings; import br.com.pondionz.wizard.TutorialActivity; /** * Created by Iago on 28/12/2015. */ public class MySQLiteHelper extends SQLiteOpenHelper { // Database Version private static final int DATABASE_VERSION = 31; private Context context; private AlertDialog alerta; private static final String KEY_PREFS_FIRST_LAUNCH = "first_launch"; SQLiteDatabase dbGlobal = null; public MySQLiteHelper(Context context) { super(context, "pondionzi.sql", null, DATABASE_VERSION); this.context = context; } @Override public void onCreate(SQLiteDatabase db) { dbGlobal = db; SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(getContext()); if(sharedPref.getBoolean(KEY_PREFS_FIRST_LAUNCH, true)) { context.startActivity(new Intent(context, TutorialActivity.class)); } // SQL statement to create linha String CREATE_TABLE_LINHA = "CREATE TABLE Linha(idLinha INTEGER PRIMARY KEY,name TEXT,PontoX TEXT,PontoY TEXT,tarifa REAL,empresa TEXT,idCidade INTEGER)"; // SQL statement to create horario String CREATE_TABLE_HORARIO = "CREATE TABLE Horario(idLinha integer,horarioX TEXT,informaçoesAdicionaisX TEXT, horarioY TEXT,informaçoesAdicionaisY TEXT,tipo INTEGER)"; // SQL statement to create Pontos String CREATE_TABLE_PONTOS = "CREATE TABLE Pontos(idPonto INTEGER PRIMARY KEY,idCidade INTEGER,Lat REAL,Lng REAL,Title Text,Description TEXT,direcao Text,tipo INTEGER)"; // SQL statement to create PontosLinha String CREATE_TABLE_PONTOS_USUARIO = "CREATE TABLE IF NOT EXISTS PontosUsuario(idPonto INTEGER PRIMARY KEY AUTOINCREMENT,idCidade INTEGER,Lat REAL,Lng REAL,Title Text,Description TEXT,direcao Text,tipo INTEGER)"; // SQL statement to create PontosLinha String CREATE_TABLE_PontoLinha = "CREATE TABLE PontoLinha(idLinha INTEGER,idPonto INTEGER,sentido TEXT)"; // SQL statement to create PontosLinha String CREATE_TABLE_PontoLinhaUsuario = "CREATE TABLE IF NOT EXISTS PontoLinhaUsuario(idLinha INTEGER,idPonto INTEGER,sentido TEXT)"; // SQL statement to create PontosLinha String CREATE_TABLE_Favorite = "CREATE TABLE IF NOT EXISTS Favorite(idLinha INTEGER PRIMARY KEY)"; String CREATE_TABLE_Cidades = "CREATE TABLE Cidades(IdCidade INTEGER PRIMARY KEY,NomeCidade TEXT)"; String CREATE_TABLE_Settings = "CREATE TABLE IF NOT EXISTS Settings(idCidade INTEGER,mostrarMarker INTERGER)"; // create table db.execSQL(CREATE_TABLE_LINHA); db.execSQL(CREATE_TABLE_HORARIO); db.execSQL(CREATE_TABLE_PONTOS); db.execSQL(CREATE_TABLE_PONTOS_USUARIO); db.execSQL(CREATE_TABLE_PontoLinha); db.execSQL(CREATE_TABLE_PontoLinhaUsuario); db.execSQL(CREATE_TABLE_Favorite); db.execSQL(CREATE_TABLE_Cidades); db.execSQL(CREATE_TABLE_Settings); new DBStorange(dbGlobal); if(db.isOpen()) { verificaConflito(db); } if(sharedPref.getBoolean(KEY_PREFS_FIRST_LAUNCH, true)){ //Lista de itens new DBFSettings(context).InicializeSettings(db); final ArrayList<String> cidades = new DBFCidades(context).getAllCidades(db); //adapter utilizando um layout customizado (TextView) ArrayAdapter<String> adapter = new ArrayAdapter<String>(context, R.layout.item_alerta, cidades); AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle("Escolha a sua cidade!"); //define o diálogo como uma lista, passa o adapter. builder.setSingleChoiceItems(adapter, 0, new DialogInterface.OnClickListener() { public void onClick(DialogInterface arg0, int arg1) { Settings.setIdCidade(new DBFCidades(context).getSelectCidade(cidades.get(arg1))); save(); alerta.dismiss(); } }); alerta = builder.create(); alerta.show(); } } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { // Drop older table if existed db.execSQL("DROP TABLE IF EXISTS Linha"); db.execSQL("DROP TABLE IF EXISTS Horario"); db.execSQL("DROP TABLE IF EXISTS Pontos"); db.execSQL("DROP TABLE IF EXISTS PontoLinha"); db.execSQL("DROP TABLE IF EXISTS Cidades"); //db.execSQL("DROP TABLE IF EXISTS Settings"); //db.execSQL("DROP TABLE IF EXISTS PontosUsuario"); // create fresh table this.onCreate(db); } public Context getContext() { return context; } private boolean verificaTabelaFavorite(SQLiteDatabase db){ /* open database, if doesn't exist, create it */ boolean tableExists = false; /* get cursor on it */ try { db.query("Favorite", null, null, null, null, null, null); tableExists = true; } catch (Exception e) { /* fail */ } return tableExists; } public void addNewLinhaPonto(int ponto, int linha,String sentido) { ContentValues values = new ContentValues(); values.put("idLinha", linha); values.put("idPonto", ponto); values.put("sentido", sentido); SQLiteDatabase db = this.getWritableDatabase(); try { db.insert("PontoLinhaUsuario", null, values); }finally { db.close(); } } //como db ta aberto foi nescessario criar funcoes extras pra verificar esse conflito private void verificaConflito(SQLiteDatabase db) { DBFPonto d = new DBFPonto(context); List<Ponto> allPontosUsuario = d.getAllPontoUsuarioDAO(db); for (Ponto p: allPontosUsuario) { if(d.getTituloExistente2(p.getTitle(),db)){ Log.i("MySQLiteHelper", "Conflito :"+p.toString()); d.deletePointUsuario(p.getTitle(),db); } } } public void save() { ContentValues cv = new ContentValues(); SQLiteDatabase db = this.getReadableDatabase(); cv.put("idCidade",Settings.getIdCidade()); //These Fields should be your String values of actual column names try { db.update("Settings", cv,null, null); } finally { db.close(); // new MarkerSetMap().reloadMarker(); } } public String getDirecaoLinhaPonto(int idLinha,int idPonto) { String direcao=null; SQLiteDatabase db = this.getWritableDatabase(); String query = "SELECT sentido FROM PontoLinha where idLinha="+idLinha+" and idPonto="+idPonto+""; try { /** Fill a cursor with the results. */ Cursor cursor = db.rawQuery(query, null); if(cursor.moveToFirst()) { do { direcao = cursor.getString(0); //Log.i("DAO PontoLinha", direcao); } while (cursor.moveToNext()); } Log.i("DAO PontoLinha", "successfully get sentido PontosLinha."); } finally { db.close(); } if(direcao == null){ SQLiteDatabase db2 = this.getWritableDatabase(); String query2 = "SELECT sentido FROM PontoLinhaUsuario where idLinha="+idLinha+" and idPonto="+idPonto+""; try { /** Fill a cursor with the results. */ Cursor cursor = db2.rawQuery(query2, null); if(cursor.moveToFirst()) { do { direcao = cursor.getString(0); Log.i("DAO PontoLinha", direcao); } while (cursor.moveToNext()); } Log.i("DAO PontoLinha", "successfully get direcao PontosLinha."); } finally { db2.close(); } } return direcao; } }
[ "iagodecastro@yahoo.com.br" ]
iagodecastro@yahoo.com.br
20f694a64b18efac9eb260d23ec28d03fb80125b
c0bbd74203ed569ce1f8197d99bc38e49c8baaee
/src/main/java/com/wladek/pktcard/domain/User.java
80a8e910f61993f42234cbfa46af284165ab8787
[]
no_license
bowuor/pockecard
19012c9519f5acf7e92e9d17e1034cb1b7e4e919
a1535bf78d09fda3e41d8a08c929ff2887f3a0e6
refs/heads/master
2021-01-19T20:03:37.908449
2017-11-28T17:07:13
2017-11-28T17:07:13
88,432,394
0
0
null
null
null
null
UTF-8
Java
false
false
3,501
java
/** * Yobi, Project Hosting SW * * Copyright 2012 NAVER Corp. * http://yobi.io * * @Author Ahn Hyeok Jun * * 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.wladek.pktcard.domain; import com.wladek.pktcard.domain.enumeration.UserRole; import com.wladek.pktcard.domain.enumeration.UserState; import org.hibernate.validator.constraints.Email; import org.hibernate.validator.constraints.NotEmpty; import javax.persistence.*; import javax.validation.constraints.Pattern; /** * */ @Entity @Table(name="users") public class User extends AbstractModel{ public static final String LOGIN_ID_PATTERN = "^[a-zA-Z0-9-]+([_.][a-zA-Z0-9-]+)*$"; private String name; @Column(unique = true, nullable = false) @NotEmpty @Pattern(regexp = LOGIN_ID_PATTERN, message = "Illegal user name") private String loginId; @Column(nullable = false) @Pattern(regexp = LOGIN_ID_PATTERN, message = "Illegal character included") private String password; @Column(unique = true) @Email private String email; private String lang; private String url; private String shortCode; @Enumerated(EnumType.STRING) private UserRole userRole; @Enumerated(EnumType.STRING) private UserState userState; @OneToOne(mappedBy = "user" , fetch = FetchType.LAZY) private School school; @Transient private Long schoolId; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getShortCode() { return shortCode; } public void setShortCode(String shortCode) { this.shortCode = shortCode; } public String getLoginId() { return loginId; } public void setLoginId(String loginId) { this.loginId = loginId; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getLang() { return lang; } public void setLang(String lang) { this.lang = lang; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public UserState getUserState() { return userState; } public UserRole getUserRole() { return userRole; } public void setUserRole(UserRole userRole) { this.userRole = userRole; } public void setUserState(UserState userState) { this.userState = userState; } public School getSchool() { return school; } public void setSchool(School school) { this.school = school; } public Long getSchoolId() { return schoolId; } public void setSchoolId(Long schoolId) { this.schoolId = schoolId; } }
[ "wladek.airo@gmail.com" ]
wladek.airo@gmail.com
d4ae9726af68a95aa8f38d96d580e4057bd69adf
67e22d9a11ddfb36d1d94481c247f76446b77fe9
/node/src/main/java/jp/kusumotolab/kgenprog/project/factory/RawProjectFactory.java
e4fd9122c54561d2e4a170c2a6da8170cb739e78
[]
no_license
kusumotolab/clustered-kGenProg
6f518c6ac87466c851504dab511b678964ce5932
0b49a5c159e7dd25e4d51d026505f8be26fab305
refs/heads/master
2020-04-06T18:13:18.782408
2019-05-17T03:59:08
2019-05-17T03:59:08
157,690,058
1
0
null
null
null
null
UTF-8
Java
false
false
1,371
java
package jp.kusumotolab.kgenprog.project.factory; import java.nio.file.Path; import java.util.List; import java.util.stream.Collectors; import jp.kusumotolab.kgenprog.project.ClassPath; import jp.kusumotolab.kgenprog.project.ProductSourcePath; import jp.kusumotolab.kgenprog.project.TestSourcePath; public class RawProjectFactory implements ProjectFactory { private final Path rootPath; private final List<ProductSourcePath> productSourcePaths; private final List<TestSourcePath> testSourcePaths; private final List<ClassPath> classPaths; public RawProjectFactory(final Path rootPath, final List<Path> pathsForProductSource, final List<Path> pathsForTestSource, final List<Path> pathsForClass) { this.rootPath = rootPath; this.productSourcePaths = pathsForProductSource.stream() .map(p -> new ProductSourcePath(rootPath, p)) .collect(Collectors.toList()); this.testSourcePaths = pathsForTestSource.stream() .map(p -> new TestSourcePath(rootPath, p)) .collect(Collectors.toList()); this.classPaths = pathsForClass.stream() .map(ClassPath::new) .collect(Collectors.toList()); } @Override public TargetProject create() { return new TargetProject(rootPath, productSourcePaths, testSourcePaths, classPaths); } @Override public boolean isApplicable() { return true; } }
[ "r-arima@ist.osaka-u.ac.jp" ]
r-arima@ist.osaka-u.ac.jp
feb47d88424b8eb9febf502aa72675b4fe701c3f
512b47b8727f73cc8da97da3a74154072f2c40f2
/day8/Exer 1/SuperMarketScript.java
7836d10c3bb7f906f13aa0c7ac6c5886c0411d00
[]
no_license
BBK-PiJ-2015-10/PIJ-Exercises
39856171e31cfaa558e94d432817d8164c82c727
34dd2f83c401ecd10362487940aca4b0ac754c3f
refs/heads/master
2021-01-20T20:15:52.132890
2016-04-17T10:33:32
2016-04-17T10:33:32
56,428,253
0
0
null
null
null
null
UTF-8
Java
false
false
550
java
public class SuperMarketScript { public static void main ( String [] args) { SuperMarketScript script = new SuperMarketScript(); script.launch(); } public void launch () { PersonQueue firstQueue = new SuperMarket(); Person person1 = new Person ("Ralph",20); firstQueue.insert(person1); Person person2 = new Person ("John",23); firstQueue.insert(person2); Person person3 = new Person ("Marck",29); firstQueue.insert(person3); firstQueue.retrieve(); firstQueue.retrieve(); } }
[ "yasserpo@hotmail.com" ]
yasserpo@hotmail.com
21976434c482acb9d5303bf697509f49628dc42e
32951767631623672b57e7d2eb60df4c6d916db9
/microservice-webclient/src/main/java/com/aws/web/Account.java
79967fafa379292ad849ca6ba5028e03737b7526
[]
no_license
bozgur87/aws-devops
fd695ec35283ae15560280bd77cc12c965f3f050
6d3958312779dd03e61fc5a349da44e4ff21b1d9
refs/heads/master
2020-03-17T21:46:08.189841
2018-05-18T14:18:18
2018-05-18T14:18:18
133,974,441
0
0
null
null
null
null
UTF-8
Java
false
false
707
java
/** * */ package com.aws.web; import java.io.Serializable; public class Account implements Serializable{ /** * */ private static final long serialVersionUID = 1L; private Long amount; private String number; private String name; public Long getAmount() { return amount; } public void setAmount(Long amount) { this.amount = amount; } public String getNumber() { return number; } public void setNumber(String number) { this.number = number; } public String getName() { return name; } public void setName(String name) { this.name = name; } @Override public String toString() { return "Account [amount=" + amount + ", number=" + number + ", name=" + name + "]"; } }
[ "barisveozgurluk@gmail.com" ]
barisveozgurluk@gmail.com
7c8e0c0d1e5f5130e7b961f6602ce607a00fc3cd
af13fc5758b6caf2e53d2c923c9492f5952eb47e
/restlet.ext.shindig/src/main/java/org/cfr/restlet/ext/shindig/dashboard/resource/IAddGadgetHandler.java
8534f69d05d4f8997eabe42f95c207c4a7d3dc24
[ "Unlicense" ]
permissive
devacfr/spring-restlet
ec709e45408dc6d61749e6faa51794d8133842b9
327b048c3b9e812ad7d8c75f0608e98a019e659f
refs/heads/master
2020-12-24T16:25:38.053219
2019-06-21T15:08:04
2019-06-21T15:08:04
12,956,878
0
1
null
2016-03-09T09:43:33
2013-09-19T19:06:21
null
UTF-8
Java
false
false
2,300
java
package org.cfr.restlet.ext.shindig.dashboard.resource; import org.cfr.restlet.ext.shindig.dashboard.resource.impl.AddGadgetHandlerImpl; import org.restlet.Response; import com.google.inject.ImplementedBy; import com.pmi.restlet.gadgets.GadgetId; import com.pmi.restlet.gadgets.GadgetRequestContext; import com.pmi.restlet.gadgets.dashboard.DashboardId; import com.pmi.restlet.gadgets.dashboard.DashboardState; import com.pmi.restlet.gadgets.representations.GadgetRepresentation; /** * Interface for adding a gadget spec URI to a dashboard. */ @ImplementedBy(AddGadgetHandlerImpl.class) public interface IAddGadgetHandler { /** * Adds the specified gadget to the specified dashboard. * @param dashboardId the ID of the dashboard to add to * @param gadgetRequestContext the context of this request * @param gadgetUrl the URL to the gadget spec */ GadgetRepresentation addGadget(DashboardId dashboardId, GadgetRequestContext gadgetRequestContext, String gadgetUrl, Response response); /** * Adds the specified gadget to the specified dashboard in the specified column. * @param dashboardId the ID of the dashboard to add to * @param gadgetRequestContext the context of this request * @param gadgetUrl the URL to the gadget spec * @param columnIndex the column index to add the gadget to */ GadgetRepresentation addGadget(DashboardId dashboardId, GadgetRequestContext gadgetRequestContext, String gadgetUrl, DashboardState.ColumnIndex columnIndex, Response response); /** * Moves the gadget specified by id from the source dashboard to the target dashboard. * * @param targetDashboardId The dashboard to move the gadget to * @param gadgetId The gadget to move * @param sourceDashboardId The source dashboard where the gadget will be deleted * @param columnIndex The column to add the gadget to * @param rowIndexAsInt The row to insert the gadget in * @param gadgetRequestContext the context of this request */ GadgetRepresentation moveGadget(DashboardId targetDashboardId, GadgetId gadgetId, DashboardId sourceDashboardId, DashboardState.ColumnIndex columnIndex, int rowIndexAsInt, GadgetRequestContext gadgetRequestContext, Response response); }
[ "christophe.friederich@mac.com" ]
christophe.friederich@mac.com
4140690dd1bd3cacdd38a1d29a4fb4de43d1b173
230a97f61f3482c3806215f31fe9d628c09b8cf8
/CurriculumManagementSystem/src/com/imooc/course/dto/ImportExcelParamDto.java
9797750634b15bc2a84cf9cc3db04185e24d4ef3
[]
no_license
Skylab-git/CurriculumManagement
58038350df1676bb062af0dcc2ddb0499762e11b
c1aa3b8cb074de18065897b2c7e74cf2b8ffe9f1
refs/heads/master
2020-04-15T16:52:29.263172
2019-01-09T11:55:36
2019-01-09T11:55:36
164,853,873
0
0
null
null
null
null
UTF-8
Java
false
false
285
java
package com.imooc.course.dto; import org.apache.commons.fileupload.FileItem; public class ImportExcelParamDto { private FileItem excel; public FileItem getExcel() { return excel; } public void setExcel(FileItem excel) { this.excel = excel; } }
[ "337806034@qq.com" ]
337806034@qq.com
5a0d6108336d32ea0c328f0bdb0c7c60a90767ea
cb3a6bbed90919769270ad0130695ac1520fc5e2
/src/main/java/takeshi/service/UserRankingSystemService.java
210eb6faf3d9a336747b5ecf308926262889b930
[]
no_license
Greatmar2/TechtorBot
01c12d850022385e1797b258afae8d743d07553b
b2d486ef7422eab24d1fbc11f1a46310dbf21c8c
refs/heads/TechtorBot
2022-09-17T17:37:26.636622
2020-07-03T12:57:35
2020-07-03T12:57:35
155,679,655
0
0
null
null
null
null
UTF-8
Java
false
false
2,644
java
/* * Copyright 2017 github.com/kaaz * * 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 takeshi.service; import net.dv8tion.jda.api.entities.Guild; import takeshi.core.AbstractService; import takeshi.guildsettings.GSetting; import takeshi.handler.GuildSettings; import takeshi.main.BotContainer; import takeshi.main.DiscordBot; import takeshi.main.Launcher; import takeshi.role.RoleRankings; import java.util.List; import java.util.concurrent.TimeUnit; /** * updates the ranking of members within a guild */ public class UserRankingSystemService extends AbstractService { /** * Instantiates a new User ranking system service. * * @param b the b */ public UserRankingSystemService(BotContainer b) { super(b); } @Override public String getIdentifier() { return "user_role_ranking"; } @Override public long getDelayBetweenRuns() { return TimeUnit.MINUTES.toMillis(15); } @Override public boolean shouldIRun() { return true; } @Override public void beforeRun() { } @Override public void run() { for (DiscordBot discordBot : bot.getShards()) { List<Guild> guilds = discordBot.getJda().getGuilds(); for (Guild guild : guilds) { GuildSettings settings = GuildSettings.get(guild); if (settings != null && settings.getBoolValue(GSetting.USER_TIME_RANKS) && RoleRankings.canModifyRoles(guild, discordBot.getJda().getSelfUser())) { try { handleGuild(discordBot, guild); } catch (Exception e) { Launcher.logToDiscord(e, "guild", guild.getId(), "name", guild.getName()); } } } } } private void handleGuild(DiscordBot bot, Guild guild) { RoleRankings.fixForServer(guild); guild.getMembers().stream().filter(user -> !user.getUser().isBot()).forEach(user -> RoleRankings.assignUserRole(bot, guild, user.getUser())); } @Override public void afterRun() { System.gc(); } }
[ "greatmar2@gmail.com" ]
greatmar2@gmail.com
b8c85693ff5584d91fa068ed63235d982fbc50c4
4b2717d10e558dabe1f74ee721a266b38727cbfd
/core/src/com/alvarpq/GOTF/coreGame/units/vorgasminingcorporation/RedDevil.java
02b0c47a0acd1e6eb4c251c263355ad473120341
[]
no_license
GOTFCodingTeam/GOTFgit
1e57c01f96a33942a1b9c409f7dfdc53da756469
a617ad6ec888271d622ef828a28afea923ed388e
refs/heads/master
2020-03-26T08:24:24.041852
2015-08-04T00:43:41
2015-08-04T00:43:41
39,786,392
2
0
null
null
null
null
UTF-8
Java
false
false
285
java
package com.alvarpq.GOTF.coreGame.units.vorgasminingcorporation; import com.alvarpq.GOTF.coreGame.units.Unit; public class RedDevil extends Unit { public RedDevil(int row, int column) { super("Red Devil", null, 1, 1, 1, 1, true, new String[]{"Goblin"}, row, column); } }
[ "lovbra00@gmail.com" ]
lovbra00@gmail.com
b92c812e2ed6259c4789506c218fe6bd6a485702
e5cd106e602ae0c7cd3ae49633f96d8682f9af6b
/xmpp-extensions/src/main/java/rocks/xmpp/extensions/muc/conference/model/package-info.java
44d65d2ab1fbdc7adfd7aa70ca2e6c526f134964
[ "MIT" ]
permissive
jeozey/XmppServerTester
ae312e20ad4fb766f557c6d0a91c7563315e3d52
6b1966c141073ffcfb6998811460e84ec88663b1
refs/heads/master
2021-01-13T04:08:15.082932
2017-01-05T08:41:44
2017-01-05T08:41:44
78,088,280
0
0
null
null
null
null
UTF-8
Java
false
false
1,853
java
/* * The MIT License (MIT) * * Copyright (c) 2014-2016 Christian Schudt * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ /** * Provides XML schema implementations of <a href="http://xmpp.org/extensions/xep-0249.html">XEP-0249: Direct MUC Invitations</a>. * <p> * It defines a method for inviting a contact to a multi-user chat room directly, instead of sending the invitation through the chat room. * </p> */ @XmlAccessorType(XmlAccessType.FIELD) @XmlSchema(namespace = DirectInvitation.NAMESPACE, elementFormDefault = XmlNsForm.QUALIFIED) package rocks.xmpp.extensions.muc.conference.model; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlSchema;
[ "18960868232@189.cn" ]
18960868232@189.cn
29c1601c32f66bf7f2560a56fee4c88f15e5a891
5ef9a51903d0737b505949ebcaf39a8877dd7b3e
/Houses/src/me/jet315/houses/utils/files/Properties.java
cccd4e695bf2b33b86f848c11ad9f390faa40ff7
[]
no_license
FadeCloudNW/Houses
bfdb2dffe4dffb49a7c3fabc86d64b6aff911110
d276ff90db515972ea179fac4fb85f60f27b4a53
refs/heads/master
2020-03-21T11:49:32.554534
2018-06-19T19:22:06
2018-06-19T19:22:06
138,523,279
0
0
null
2018-06-24T23:42:29
2018-06-24T23:42:29
null
UTF-8
Java
false
false
8,439
java
package me.jet315.houses.utils.files; import me.jet315.houses.Core; import org.bukkit.ChatColor; import java.util.List; /** * Created by Jet on 28/01/2018. */ public abstract class Properties extends DataFiles{ /** * Stores the prefix name */ private String pluginPrefix = "&6&lHOUSES &e&l> "; /** * Stores the Locale being used */ private String locale = "en-US"; /** * Also stores whether GUI items should be shown if the user does not have permission */ private boolean showGUIItemsWithoutPermission = false; /** * Stores the maximum height a player is allowed to build at. * This prevents them from being able to build in there house */ private int getMaxBuildHeight = 63; /** * Whether plays can place/break signs in the plot */ private boolean allowSignsInHouse = true; /** * Whether to show confirmation messages */ private boolean houseConfirmationMessages = true; /** * Max house level allowed */ private int maxHouseLevel = 6; /** * The highest height, from the ground, that we should search for chests */ private int chestSearchLevel = 30; /** * Stores the world name that the plots are in */ private String plotsWorldName = "plots"; /** * Stores the name of the SQLite table */ private String sqliteTable = "Houses"; /** * Stores the commands to block */ private List<String> commandsToBlock; /** * The Economy system that is being used - VAULT or TOKENS accepted */ private String economyTypeToUpgrade = "TOKENS"; private String housePriceAlgorithm = "{CURRENTHOUSELEVEL} * 500"; private int firstHousePrice = 500; private boolean shouldHousesExpire = true; private String economyTypeForRenting = "VAULT"; private int costToRentPerDay = 5000; private int maxAmountOfRentTime = 672; private int givenRentTime = 7; private boolean deleteExpiredHousesOnStartup = true; private int timeToWaitWhenTeleporting = 0; /** * Stores imformation about the schematics */ private int moveSchematicXDirection = 0; private int moveSchematicYDirection = -2; private int moveSchematicZDirection = 0; private boolean shouldPasteFirstHouseOnClaim = true; private String schematicToPasteOnExpiry = "none"; private int moveExpirySchematicXDirection = 0; private int moveExpirySchematicYDirection = 2; private int moveExpirySchematicZDirection = 0; public Properties(Core instance){ super(instance); setupValues(); } private void setupValues(){ /** * Settings */ pluginPrefix = ChatColor.translateAlternateColorCodes('&',super.getConfig().getString("PluginsPrefix")); locale = super.getConfig().getString("Locale"); showGUIItemsWithoutPermission = !super.getConfig().getBoolean("HideGUIItemsIfNoPermission"); getMaxBuildHeight = super.getConfig().getInt("MaxBuildHeight"); plotsWorldName = super.getConfig().getString("PlotWorldName"); maxHouseLevel = super.getConfig().getInt("MaxHouseLevel"); chestSearchLevel = super.getConfig().getInt("ChestSearchLevel"); allowSignsInHouse = super.getConfig().getBoolean("AllowSignsInHouse"); houseConfirmationMessages = super.getConfig().getBoolean("HouseConfirmation"); /** * Table name */ sqliteTable = super.getConfig().getString("SQLiteTable"); /** /** * Economy */ economyTypeToUpgrade = super.getConfig().getString("EconomyTypeToUpgrade"); housePriceAlgorithm = super.getConfig().getString("NextHousePrice"); firstHousePrice = super.getConfig().getInt("FirstHousePrice"); shouldHousesExpire = super.getConfig().getBoolean("ShouldHousesExpire"); economyTypeForRenting = super.getConfig().getString("EconomyTypeToRent"); costToRentPerDay = super.getConfig().getInt("CostToRentPerDay"); maxAmountOfRentTime = super.getConfig().getInt("MaxAmountOfRentTime"); givenRentTime = super.getConfig().getInt("GivenRentTime"); deleteExpiredHousesOnStartup = super.getConfig().getBoolean("DeleteExpiredHousesOnStartup"); /** * Commands to block */ commandsToBlock = super.getConfig().getStringList("CommandsToBlock"); timeToWaitWhenTeleporting = super.getConfig().getInt("TimeToWaitWhenTeleporting"); /** * Schematic values */ moveSchematicXDirection = super.getConfig().getInt("MoveSchematicXDirection"); moveSchematicYDirection = super.getConfig().getInt("MoveSchematicYDirection"); moveSchematicZDirection = super.getConfig().getInt("MoveSchematicZDirection"); shouldPasteFirstHouseOnClaim = super.getConfig().getBoolean("PasteFirstHouseOnClaim"); schematicToPasteOnExpiry = super.getConfig().getString("SchematicOnExpirey"); moveExpirySchematicXDirection = super.getConfig().getInt("MoveExpirySchematicXDirection"); moveExpirySchematicYDirection = super.getConfig().getInt("MoveExpirySchematicYDirection"); moveExpirySchematicZDirection = super.getConfig().getInt("MoveExpirySchematicZDirection"); } /** *Getters for field values */ /** * @return Plugins Prefix */ public String getPluginPrefix() { return pluginPrefix; } /** * @return Max Build Height of the Plot World */ public int getGetMaxBuildHeight() { return getMaxBuildHeight; } /** * @return The plot world name */ public String getPlotsWorldName() { return plotsWorldName; } public String getSqliteTable() { return sqliteTable; } public int getMoveSchematicXDirection() { return moveSchematicXDirection; } public int getMoveSchematicYDirection() { return moveSchematicYDirection; } public int getMoveSchematicZDirection() { return moveSchematicZDirection; } public boolean isShouldPasteFirstHouseOnClaim() { return shouldPasteFirstHouseOnClaim; } public String getEconomyTypeToUpgrade() { return economyTypeToUpgrade; } public String getHousePriceAlgorithm() { return housePriceAlgorithm; } public boolean isShowGUIItemsWithoutPermission() { return showGUIItemsWithoutPermission; } public boolean getDeleteExpiredHousesOnStartup() { return deleteExpiredHousesOnStartup; } public boolean isShouldHousesExpire() { return shouldHousesExpire; } public String getEconomyTypeForRenting() { return economyTypeForRenting; } public int getCostToRentPerDay() { return costToRentPerDay; } public int getMaxAmountOfRentTime() { return maxAmountOfRentTime; } public int getGivenRentTime() { return givenRentTime; } public int getFirstHousePrice() { return firstHousePrice; } public int getMaxHouseLevel() { return maxHouseLevel; } public int getChestSearchLevel() { return chestSearchLevel; } public String getLocale() { return locale; } public boolean isAllowSignsInHouse() { return allowSignsInHouse; } public boolean isHouseConfirmationMessages() { return houseConfirmationMessages; } public List<String> getCommandsToBlock() { return commandsToBlock; } public String getSchematicToPasteonExpiry() { return schematicToPasteOnExpiry; } public int getMoveExpirySchematicXDirection() { return moveExpirySchematicXDirection; } public int getMoveExpirySchematicYDirection() { return moveExpirySchematicYDirection; } public int getMoveExpirySchematicZDirection() { return moveExpirySchematicZDirection; } public int gettimeToWaitWhenTeleporting() { return timeToWaitWhenTeleporting; } }
[ "noreply@github.com" ]
noreply@github.com
00551e5aa19a231e14efd621621781017b3ab230
d045a4e9b1b50c24509f4f300d5c98ed7be1c8b9
/src/ch07/Cat.java
962b8941102f7a716e7f4aa9431d09e616d4cec0
[]
no_license
junwooCha/junwoo
69c088702eb88eb937aece93f5a1e1aec6bd67b0
5f2b70ea426188c937c1c42c09cdeac5e8b9924d
refs/heads/master
2023-08-16T05:31:08.119779
2021-10-05T07:41:40
2021-10-05T07:41:40
411,870,353
0
0
null
null
null
null
UTF-8
Java
false
false
269
java
package ch07; public class Cat extends Animal{ @Override public void crying() { System.out.println("고양이가 야옹야옹"); } @Override public void eat() { System.out.println("고양이가 낼름낼름 먹는다."); } }
[ "chaw510@naver.com" ]
chaw510@naver.com
62c5f9f7ca053c84aff15b679f94f403a3f19c20
1e2cd4db9b9ed0f572120c37f729d4c9d0e47dbd
/Projects/src/M226b/Vererbung/CrashedCar.java
39bc93e500756c5aeaa9962b06ac0d97102822d2
[]
no_license
zmeieb/Ben-Diogo-M326
a429fea9bfeee940a06a9507638c6d3a6d49f9e0
65ae75a9cce9d8827cfc2dd1d812d40d15c258d1
refs/heads/master
2020-04-08T22:26:04.732131
2019-03-01T08:48:19
2019-03-01T08:48:19
159,787,203
0
0
null
null
null
null
UTF-8
Java
false
false
1,299
java
package M226b.Vererbung; public class CrashedCar extends Car { //enum type waere schoener, aber darum geht es hier nicht public static final int DMG_LVL_LOW = 0; public static final int DMG_LVL_MEDIUM = 1; public static final int DMG_LVL_HIGH = 2; public static final int DMG_LVL_TOTAL = 3; private int damageLevel; public CrashedCar(String model, double price, int damageLevel) { super(model, price); this.damageLevel = damageLevel; } public double getPrice() { double pr = super.getCarPrice(); switch (this.damageLevel) { case DMG_LVL_LOW: //case 0: pr *= 0.9; // pr = pr * 0.9 break; case DMG_LVL_MEDIUM: // case 1: pr *= 0.5; break; case DMG_LVL_HIGH: // case 2: pr *= 0.1; break; case DMG_LVL_TOTAL: // case 3: pr = 0; break; } return pr; } /** * @return the damageLevel */ public int getDamageLevel() { return damageLevel; } /** * @param damageLevel the damageLevel to set */ public void setDamageLevel(int damageLevel) { this.damageLevel = damageLevel; } }
[ "ben.meier@bbcag.ch" ]
ben.meier@bbcag.ch
c9cfcfadf00f68823b2ba95cc1b8cfd562e00506
85731ad0692d18d419fbcf9e443bd9ded836fb18
/server/src/main/java/com/studio_projektowe/communicator/security/UnauthorizedException.java
f0ae7990e01cf1282897a54fa0ff7b1d0cf73df6
[]
no_license
krzysiek28/multi-tier-security-communicator
81155efead95ef02421b896a0d51ec21883e5afd
c02ccbd9b2d3adadb7d39211f202468a229f413c
refs/heads/master
2021-04-03T09:32:46.618517
2018-05-06T18:12:25
2018-05-06T18:12:25
125,232,266
1
0
null
null
null
null
UTF-8
Java
false
false
381
java
package com.studio_projektowe.communicator.security; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; @ResponseStatus(value = HttpStatus.UNAUTHORIZED) public class UnauthorizedException extends Exception { public UnauthorizedException(String message) { super(message); this.printStackTrace(); } }
[ "krzysztof.uliasz@gmail.com" ]
krzysztof.uliasz@gmail.com
5828ff3126c29a8b02425429a3c5f0390117bd5a
e485f4e04189a58b5cb28a0fcc7ff62dcec2afd9
/src/answer/ExtractRelation.java
787d25f97cc2188e2f1d6a93a74da326b5b9934a
[]
no_license
kongkaiwen/ana
42509b575fe1d884399507f192330bd25314f702
9ea97bb69efb9212d4454b9927e9beb470595608
refs/heads/master
2021-01-25T10:34:23.890170
2013-12-11T17:38:21
2013-12-11T17:38:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,152
java
package answer; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import kb.KnowledgeBase; import relations.Entity; public class ExtractRelation implements Extract { public static String familyTitles[] = {"daughter", "son", "father", "mother", "grandfather", "grandmother", "neice", "nephew", "cousin", "uncle", "aunt", "wife", "husband", "grandson", "granddaughter", "friend", "brother", "sister"}; @Override public boolean execute( int oid, String object, String attr, KnowledgeBase kb, ArrayList<String> tkns, ArrayList<Entity> ent, ArrayList<String> pos, String val ) throws IOException { String name = ""; String title = ""; boolean found = false; name = kb.getPerson(oid).get("name"); // find relationships for(String tkn: tkns) { for(String tle: familyTitles) { if (tkn.toLowerCase().equals(tle)) { title = tkn; } } } if (!name.equals("") && !title.equals("")) { kb.addRelation(title, kb.getSpeaker().getId(), oid); } if (!name.equals("") && !title.equals("")) { found = true; } // delete buffer kb.delBuffer(); return found; } }
[ "kfquinn@Three.(none)" ]
kfquinn@Three.(none)
beb878c500d67786f0f2bce6236abb89d577eb7e
6932ff33a3488a271797947939ab4defe7df0684
/blok/Java/IceFactory/src/icefactory/IceBrick.java
d0b1fd32d8354946253c952efe79b95d52c6b4a7
[]
no_license
caiovosilva/Design-Patterns
d6aff9faec38433e886d5fb9a043ca910e5e0cdd
81cdd450816d8beb6c3738928eaebac0ed317891
refs/heads/master
2020-03-22T20:42:48.611606
2019-03-29T13:24:48
2019-03-29T13:24:48
140,624,929
0
0
null
2018-10-03T19:56:18
2018-07-11T20:32:52
Java
UTF-8
Java
false
false
844
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 icefactory; import java.awt.Graphics; import java.awt.Image; import java.awt.image.BufferedImage; import javax.swing.ImageIcon; import interfaces.AbstractBrickProduct; /** * * @author caiov */ public class IceBrick implements AbstractBrickProduct { @Override public BufferedImage getImage() { Image im = new ImageIcon(getClass().getResource("/iceImages/brick.png")).getImage(); BufferedImage bi = new BufferedImage (im.getWidth(null),im.getHeight(null),BufferedImage.TYPE_INT_RGB); Graphics bg = bi.getGraphics(); bg.drawImage(im, 0, 0, null); bg.dispose(); return bi; } }
[ "caiovosilva@outlook.com" ]
caiovosilva@outlook.com
c659fa62aa90260444ce4a33cf85d2f233feb01c
21cbe58d433b2a5efb4b6fbcdb5baa7ff53876b8
/src/main/java/com/creditsuisse/covid19/outbreak/OutBreakController.java
dbcd4d3a67d71290f87489278e6dfec0433701d2
[]
no_license
ligotech/covid19
6bb483f86e6387f0d9872cf30273b70462eaec4b
19c0422c4555a390cdff0f93a317eb60457868d7
refs/heads/master
2023-08-15T02:06:21.672749
2021-09-23T15:52:17
2021-09-23T15:52:17
409,300,272
0
0
null
null
null
null
UTF-8
Java
false
false
6,137
java
package com.creditsuisse.covid19.outbreak; import com.creditsuisse.covid19.beans.ReadyToWorkRequestObject; import com.creditsuisse.covid19.beans.TotalCount; import com.creditsuisse.covid19.exception.handler.BadRequestException; import com.creditsuisse.covid19.exception.handler.Covid19Exception; import com.creditsuisse.covid19.exception.handler.NotFoundException; import com.mongodb.MongoException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import javax.validation.Valid; import java.util.ArrayList; import java.util.List; import java.util.Map; @RestController public class OutBreakController { private static final Logger logger = LoggerFactory.getLogger(OutBreakController.class); @Autowired private OutBreakService outBreakService; @GetMapping("outbreak/{column}") public ResponseEntity<Number> getTotalCount(@PathVariable String column){ Number val = null; long start = System.currentTimeMillis(); try{ if(column.equals("active")){ val = outBreakService.getTotalActive(); } if(column.equals("confirmed")){ val = outBreakService.getTotalConfirmed(); } if(column.equals("deaths")){ val = outBreakService.getTotalDeaths(); } if(column.equals("recovered")){ val = outBreakService.getTotalRecovered(); } if(column.equals("incident-rate")){ val = outBreakService.getTotalIncidentRate(); } if(column.equals("case-fatality-ratio")){ val = outBreakService.getTotalCaseFatalityRatio(); } } catch (MongoException ex){ logger.error("Exception:", ex.getMessage(), ex); throw new Covid19Exception(ex.getMessage()); } catch (Exception ex){ logger.error("Exception:", ex.getMessage(), ex); throw new Covid19Exception(ex.getMessage()); } long end = System.currentTimeMillis(); long diff = start - end; logger.info("Total time to get data from url: "+diff); if(val != null){ return new ResponseEntity<>(val, HttpStatus.OK); } throw new NotFoundException("Data not found. " + val); } @GetMapping("query/{column}/") public ResponseEntity<List<TotalCount>> getTotalCount(@PathVariable String column, @RequestParam Map<String, String> params){ List<TotalCount> totalCounts = new ArrayList<>(); try{ if(column.equals("active")){ totalCounts = outBreakService.getTotalActiveWithCriteria(params); } if(column.equals("confirmed")){ totalCounts = outBreakService.getTotalConfirmedWithCriteria(params); } if(column.equals("deaths")){ totalCounts = outBreakService.getTotalDeathsWithCriteria(params); } if(column.equals("recovered")){ totalCounts = outBreakService.getTotalRecoveredWithCriteria(params); } if(column.equals("incident-rate")){ totalCounts = outBreakService.getTotalIncidentRateWithCriteria(params); } if(column.equals("case-fatality-ratio")){ totalCounts = outBreakService.getTotalCaseFatalityRatioWithCriteria(params); } } catch (MongoException ex){ logger.error("Exception:", ex.getMessage(), ex); throw new Covid19Exception(ex.getMessage()); } catch (Exception ex){ logger.error("Exception:", ex.getMessage(), ex); throw new Covid19Exception(ex.getMessage()); } if(!totalCounts.isEmpty()){ return new ResponseEntity<>(totalCounts, HttpStatus.OK); } throw new NotFoundException("Data Not Found: " + totalCounts); } @GetMapping("query/containment-zones") public ResponseEntity<List<String>> getContainmentZones(@RequestParam Map<String, String> params){ List<String> list = new ArrayList<>(); try { String threshold = params.get("threshold"); String date = params.get("date"); if(threshold != null && date !=null){ list = outBreakService.getContainmentZone(Long.valueOf(threshold), Integer.valueOf(date)); } else{ throw new BadRequestException("Request param must contain threshold=?&date=?, found: " + params.keySet()); } } catch (MongoException ex){ logger.error("Exception:", ex.getMessage(), ex); throw new Covid19Exception(ex.getMessage()); } catch (Exception ex){ logger.error("Exception:", ex.getMessage(), ex); throw new Covid19Exception(ex.getMessage()); } if(!list.isEmpty()){ return new ResponseEntity<>(list, HttpStatus.OK); } throw new NotFoundException("Data Not Found: " + list); } @GetMapping("query/ready-to-work") public ResponseEntity<Boolean> getReadyToWork(@Valid ReadyToWorkRequestObject params){ try { return new ResponseEntity<>(outBreakService.getReadyToWork(params), HttpStatus.OK); } catch (MongoException ex){ logger.error("Exception:", ex.getMessage(), ex); throw new Covid19Exception(ex.getMessage()); } catch (Exception ex){ logger.error("Exception:", ex.getMessage(), ex); throw new Covid19Exception(ex.getMessage()); } } }
[ "siddharth.india51088@gmail.com" ]
siddharth.india51088@gmail.com
ee4e3e53afbf3e83e798a91695c8400768a40a98
4d0dabc82fe2f4993b9abe814f547bc3e732717f
/pe4.java
66a918b7ffef87d2dc367c2dab35f97c5d88445a
[]
no_license
pushpithaDilhan/ProjectEulerJava
ad4b661bcd5a7ac0c51cdc4dd069f4edd844d6f3
af78a17a0252a9483c3334392484697c75061e88
refs/heads/master
2021-01-10T04:44:09.997475
2016-03-29T15:56:42
2016-03-29T15:56:42
52,207,065
0
0
null
null
null
null
UTF-8
Java
false
false
517
java
public class pe4{ public static Boolean isPalindromic(String s) { String rev=""; for(int i=s.length()-1;i!=-1;i--) { rev+=s.charAt(i); } if(s.equals(rev)){return true;} else{return false;} } public static void main(String[] args) { int max=0; for(int i=100;i<=999;i++) { for(int j=100;j<=999;j++) { if(isPalindromic(i*j+"")) // integer to string conversions { if(max < i*j) { max = i*j; } } } } System.out.println(max); } }
[ "pushpitha.14@cse.mrt.ac.lk" ]
pushpitha.14@cse.mrt.ac.lk
b4470b34836fb501e4c1cd2d4df194fe42089d0a
0939c3f1a4993e7f2ce09bafac96db3bd9e7cb6d
/de.tub.tfs.muvitor/src/de/tub/tfs/muvitor/actions/TrimViewerAction.java
15878ea593bafe4ce97002e541c9c6c50f2bdd1e
[]
no_license
mubalu/Henshin-Editor
3fecd96dca929e041c0de695743e2d3cab784be3
08fb964c12b715836ebff17a55a935ebc24b9e42
refs/heads/master
2021-01-18T07:57:21.322682
2012-03-01T15:28:49
2012-03-01T15:28:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,997
java
package de.tub.tfs.muvitor.actions; import java.util.Collection; import org.eclipse.draw2d.geometry.Point; import org.eclipse.draw2d.geometry.Rectangle; import org.eclipse.gef.EditPart; import org.eclipse.gef.EditPartViewer; import org.eclipse.gef.GraphicalEditPart; import org.eclipse.gef.NodeEditPart; import org.eclipse.gef.RequestConstants; import org.eclipse.gef.commands.Command; import org.eclipse.gef.commands.CompoundCommand; import org.eclipse.gef.requests.ChangeBoundsRequest; import org.eclipse.gef.ui.actions.SelectionAction; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.ui.IWorkbenchPart; import de.tub.tfs.muvitor.ui.MuvitorActivator; import de.tub.tfs.muvitor.ui.MuvitorConstants; /** * This action trims the viewer containing the currently selected * GraphicalEditPart. All editparts that return an executable command for a move * request will be moved so that the viewers size is minimized but still showing * all figures. In short, all figures will be moved by the same amount to the * upper-left corner as far as possible. * * @author "Tony Modica" */ public class TrimViewerAction extends SelectionAction { public static final String ID = "TrimViewerAction"; /** * the node's spacing from the viewer's border */ private static final int INSETS = 5; /** * the viewer containing the currently selected GraphicalEditPart */ private EditPartViewer viewer; /** * Constructor. */ public TrimViewerAction(final IWorkbenchPart part) { super(part); setText("Trim viewer"); setToolTipText("Trim viewer"); setId(ID); setImageDescriptor(MuvitorActivator .getImageDescriptor(MuvitorConstants.ICON_TRIM_16)); } /** * */ @SuppressWarnings("unchecked") @Override public void run() { // when invoking directly, a viewer must be set manually! if (viewer == null) { return; } // initialize deltas with maximum values int xdelta = Integer.MAX_VALUE, ydelta = Integer.MAX_VALUE; // find x and y deltas to move (least x and y of some nodes) for (final EditPart editPart : (Collection<EditPart>) viewer.getContents().getChildren()) { if (editPart instanceof NodeEditPart) { final Rectangle bounds = ((GraphicalEditPart) editPart).getFigure().getBounds(); xdelta = Math.min(xdelta, bounds.x); ydelta = Math.min(ydelta, bounds.y); } } final CompoundCommand compCommand = new CompoundCommand(); // build commands final ChangeBoundsRequest request = new ChangeBoundsRequest(RequestConstants.REQ_MOVE); request.setMoveDelta(new Point(-xdelta + INSETS, -ydelta + INSETS)); for (final EditPart editPart : (Collection<EditPart>) viewer.getContents().getChildren()) { final Command command = editPart.getCommand(request); // Some editparts may return unexecutable commands if (command != null && command.canExecute()) { compCommand.add(command); } } // this allows to use this action independently from an editor if (getWorkbenchPart() == null || getCommandStack() == null) { compCommand.execute(); } else { execute(compCommand); } } /** * This setter allows universal usage of this action. Just call the * constructor with <code>null</code> and set the viewer to trim manually. * * @param viewer */ public void setViewer(final EditPartViewer viewer) { this.viewer = viewer; } /** * This action is enabled if some graphical edit part is currently selected * from which a viewer can be determined to be trimmed. */ @Override protected boolean calculateEnabled() { if (getSelection() == null) { return false; } if (getSelection() instanceof IStructuredSelection) { final IStructuredSelection selection = (IStructuredSelection) getSelection(); for (final Object selectedObject : selection.toList()) { if (selectedObject instanceof GraphicalEditPart) { viewer = ((GraphicalEditPart) selectedObject).getViewer(); return viewer != null; } } } return false; } }
[ "juergengall@gmx.de" ]
juergengall@gmx.de
c43a9480e46ee97613045ffcdf440ac14a833c2d
3922a511a087e074cba9b888ee3973470b634a92
/source/android/adaptivecards/src/main/java/com/microsoft/adaptivecards/renderer/input/DateInputRenderer.java
7d2d9081d381bef72f3009f0e8e76fbba0ecab1e
[ "MIT" ]
permissive
sap172/AdaptiveCards
7fc41ef18a0ec365ceafea2b42d639c777d21482
96fdcb226020862159ab467dc2ea23f139ae7572
refs/heads/master
2021-04-28T01:15:20.627347
2018-02-20T22:08:13
2018-02-20T22:08:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,111
java
package com.microsoft.adaptivecards.renderer.input; import android.content.Context; import android.os.Bundle; import android.support.v4.app.FragmentManager; import android.view.View; import android.view.ViewGroup; import android.widget.EditText; import com.microsoft.adaptivecards.renderer.inputhandler.DateInputHandler; import com.microsoft.adaptivecards.renderer.inputhandler.IInputHandler; import com.microsoft.adaptivecards.objectmodel.BaseCardElement; import com.microsoft.adaptivecards.objectmodel.DateInput; import com.microsoft.adaptivecards.objectmodel.HostConfig; import java.util.Vector; import static android.text.InputType.TYPE_NULL; public class DateInputRenderer extends TextInputRenderer { private DateInputRenderer() { } public static DateInputRenderer getInstance() { if (s_instance == null) { s_instance = new DateInputRenderer(); } return s_instance; } @Override public View render( Context context, FragmentManager fragmentManager, ViewGroup viewGroup, BaseCardElement baseCardElement, Vector<IInputHandler> inputActionHandlerList, HostConfig hostConfig) { DateInput dateInput = null; if (baseCardElement instanceof DateInput) { dateInput = (DateInput) baseCardElement; } else if ((dateInput = DateInput.dynamic_cast(baseCardElement)) == null) { throw new InternalError("Unable to convert BaseCardElement to DateInput object model."); } setSpacingAndSeparator(context, viewGroup, dateInput.GetSpacing(), dateInput.GetSeparator(), hostConfig, true /* horizontal line */); DateInputHandler dateInputHandler = new DateInputHandler(dateInput, fragmentManager); EditText editText = renderInternal( context, viewGroup, dateInput, dateInput.GetValue(), dateInput.GetPlaceholder(), dateInputHandler, inputActionHandlerList, hostConfig); editText.setRawInputType(TYPE_NULL); editText.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { DateInputHandler dateInputHandler = (DateInputHandler) v.getTag(); DateInput dateInput = (DateInput) dateInputHandler.getBaseInputElement(); DatePickerFragment datePickerFragment = new DatePickerFragment(); datePickerFragment.initialize(dateInput, (EditText) v); Bundle args = new Bundle(); args.putString("title", TITLE); datePickerFragment.setArguments(args); FragmentManager fm = dateInputHandler.getFragmentManager(); datePickerFragment.show(fm, TITLE); } }); return editText; } private static DateInputRenderer s_instance = null; private static final String TITLE = "Set Date"; }
[ "noreply@github.com" ]
noreply@github.com
54d06907c1f7bbab657e7f16d181a5baa34dddb6
179c03ffc4935d8b65d234d5357b80dad957df42
/src/test/java/com/anthem/made/selenium/DriverTest.java
9cc6285947a4e153af003eba338b51cba0d7137a
[]
no_license
madhurimendgule1/java
18d07c3f368fb8e57751a228d45c0c25ae7949e7
f15a7020650054575a9a99796b462c5f02ccc284
refs/heads/master
2020-04-07T11:38:54.950609
2018-11-26T07:33:28
2018-11-26T07:33:28
158,334,804
0
0
null
null
null
null
UTF-8
Java
false
false
1,339
java
package com.anthem.made.selenium; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.htmlunit.HtmlUnitDriver; import java.util.concurrent.TimeUnit; /** * Created by AF11126 on 8/24/2018. */ public class DriverTest { public static void main(String args[]) { testHtmlUnitDriver(); } public static void testHtmlUnitDriver() { WebDriver driver = null; driver= new HtmlUnitDriver(); //System.setProperty("webdriver.chrome.driver", "C:\\Drivers\\chromedriver.exe"); //driver= new ChromeDriver(); driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); // Open "Google.com and search SoftwareTestingMaterial.com" driver.get("https://www.google.com"); WebElement element = driver.findElement(By.name("q")); element.sendKeys("softwaretestingmaterial.com"); element.submit(); //Click on Software Testing Material link driver.findElement(By.linkText("Software Testing Material")).click(); // Get the title of the site and store it in the variable Title String Title = driver.getTitle(); // Print the title System.out.println("I am at " +Title); } }
[ "madhuri.mendgule@anthem.com" ]
madhuri.mendgule@anthem.com
188a07c80360d594e67cb9bac9af2bfabcb16de2
8bdfca96e4ef9ae9d2d0b233c6f66ad7135f80f1
/app/src/main/java/com/blogspot/deniace/mycampus/MainActivity.java
96682da4cc80880032f1afc1bdf396d09675a6e3
[]
no_license
deniace/My-Campus
f545aa0b009b2ace6af18346da11dd3671aa496d
cb9e5597590a8bb6a84d258f61926d5c1b6a1ed5
refs/heads/master
2020-12-30T14:01:35.694537
2017-05-18T14:26:02
2017-05-18T14:26:02
91,282,919
0
0
null
null
null
null
UTF-8
Java
false
false
622
java
package com.blogspot.deniace.mycampus; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.webkit.WebSettings; import android.webkit.WebView; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); WebView webView; webView = (WebView)findViewById(R.id.webview); WebSettings webSettings = webView.getSettings(); webSettings.setJavaScriptEnabled(true); webView.loadUrl("file:///android_asset/index.html"); } }
[ "denisupriyatna01@gmail.com" ]
denisupriyatna01@gmail.com
5b18f694d213ab5c7e7e1cbb2bae2cffce938ae2
0ce16b45c2821fe07c8aabf802b61f89083c7294
/Transition/src/com/example/transition/CameraPreview.java
b0c3b647345f882551b23439480ba68b77c0f151
[]
no_license
chiranthan/AugmentMe
e17727266f7a7ece6eb40c6257a5ac8f3ce4787a
4a284a387ea14329f94a73096392297a9059e5a7
refs/heads/master
2020-06-04T03:27:11.089369
2014-04-28T06:29:21
2014-04-28T06:29:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,224
java
package com.example.transition; import java.io.IOException; import android.content.Context; import android.hardware.Camera; import android.view.SurfaceHolder; import android.view.SurfaceView; public class CameraPreview extends SurfaceView implements SurfaceHolder.Callback { private SurfaceHolder mHolder; private Camera mCamera; public CameraPreview(Context context, Camera camera) { super(context); mCamera = camera; // Install a SurfaceHolder.Callback so we get notified when the // underlying surface is created and destroyed. mHolder = getHolder(); mHolder.addCallback(this); // deprecated setting, but required on Android versions prior to 3.0 mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); } public void surfaceCreated(SurfaceHolder holder) { // The Surface has been created, now tell the camera where to draw the preview. try { mCamera.setDisplayOrientation(90); mCamera.autoFocus(null); mCamera.setPreviewDisplay(holder); mCamera.startPreview(); } catch (IOException e) { } } public void surfaceDestroyed(SurfaceHolder holder) { // empty. Take care of releasing the Camera preview in your activity. } public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) { // If your preview can change or rotate, take care of those events here. // Make sure to stop the preview before resizing or reformatting it. if (mHolder.getSurface() == null){ // preview surface does not exist return; } // stop preview before making changes try { mCamera.stopPreview(); } catch (Exception e){ // ignore: tried to stop a non-existent preview } // set preview size and make any resize, rotate or // reformatting changes here // start preview with new settings try { mCamera.setPreviewDisplay(mHolder); mCamera.startPreview(); } catch (Exception e){ //Log.d(TAG, "Error starting camera preview: " + e.getMessage()); } } }
[ "mrc.chiru@gmail.com" ]
mrc.chiru@gmail.com
c9509bee35e74a4234b335bc60dc4412fa460db7
612fca43500ac11d6d8f4674da242ef3dbf0cc99
/Spring-Autowiring-ByName/src/main/java/com/savan/model/Address.java
5527be0ffc9fff9fd3fbc60a0de14741bbbfeec6
[]
no_license
savan27/Spring-Trainig
97c6e01261f5e0d74c315338702e51754985d589
275815feeed4dea114451485f67a1a531eab3174
refs/heads/master
2022-05-29T05:43:59.928609
2020-05-01T15:33:01
2020-05-01T15:33:01
255,953,859
0
0
null
null
null
null
UTF-8
Java
false
false
311
java
package com.savan.model; /** * @author SAVAN * */ public class Address { /** * default Constructor */ public Address() { System.out.println("Inside Address !!"); } /** * Utility method to print address */ public void printAddress() { System.out.println("Ahmedabad, Gujarat, India"); } }
[ "savan.inexture@gmail.com" ]
savan.inexture@gmail.com
b2fe8f3dab3914d6a4e9281bb3f1f439525892a3
48eeedbd60eeb8c0993d3d0aa45fd71d3a07ffab
/src/ArrayListExample.java
53c2c6e3cfcd188849b789fc95585d0f1f85f5a8
[]
no_license
ajinkya93/Programming_Problems
179d12d4a726768a1bb2528119df8878878e556d
a8cccd264a8f0a61c196a466d22967552eab5c48
refs/heads/master
2021-01-23T07:33:55.158985
2019-07-08T05:24:41
2019-07-08T05:24:41
86,427,830
0
0
null
null
null
null
UTF-8
Java
false
false
1,566
java
import java.util.ArrayList; class Book{ String name; int id; Book(String name, int id){ this.name = name; this.id = id; } public String getName(){ return name; } public int getID(){ return id; } @Override public boolean equals(Object obj){ if(obj == null) return false; if(obj == this) return true; if(!(obj instanceof Book)) return false; Book bookObj = (Book)obj; if((this.name == bookObj.name)&&(this.id == bookObj.id)) return true; return false; } } public class ArrayListExample { public static void main(String[] args) { // TODO Auto-generated method stub ArrayList<Book> books = new ArrayList<Book>(); Book b1 = new Book("Book1",12345); Book b2 = new Book("Book2",22345); Book b3 = new Book("Book3",12345); Book b4 = new Book("Book4",112233); Book b5 = new Book("Book1",12345); Book b[] = new Book[]{b1,b2,b3,b4,b5}; boolean f = true; for(int i = 0 ; i < 5 ; i++){ for(int j = 0 ; j < books.size(); j++){ if(b[i].equals(books.get(j))){ System.out.println("The object with name: "+books.get(j).getName()+" and ID: "+books.get(j).getID()+" already exists and cannot be added."); f = false; break; } } if(f){ books.add(b[i]); //System.out.println("The object with name: "+books.get(j).getName()+" and ID: "+books.get(j).getID()+" was successfully added."); } } System.out.println("Printing the contents of Al books"); for(Book book: books){ System.out.println("Name: "+book.getName()+" ID: "+book.getID()); } } }
[ "Ajiinkkya Bhaalerao" ]
Ajiinkkya Bhaalerao
9789f84b6663006e04f9ca085dc2ef8113b9f618
83593598f21cba234f08eca4dec44d2f73a6052d
/prj/bank/web-otcProcForBank-platform/src/main/java/gnnt/bank/adapter/bankBusiness/message/RSP_F625.java
419b53be65cd97e25bdcaf9dba94e9b64d2243ae
[ "Apache-2.0" ]
permissive
bigstar18/prjs
23a04309a51b0372ddf6c391ee42270e640ec13c
c29da4d0892ce43e074d9e9831f1eedf828cd9d8
refs/heads/master
2021-05-31T19:55:16.217893
2016-06-24T02:35:31
2016-06-24T02:35:31
42,025,473
0
2
null
null
null
null
UTF-8
Java
false
false
431
java
package gnnt.bank.adapter.bankBusiness.message; import java.io.Serializable; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement(name="in") public class RSP_F625 implements Serializable { private static final long serialVersionUID = 1L; @XmlElement public HEAD head = new HEAD(); @XmlElement public RSP_BODY_F625 body = new RSP_BODY_F625(); }
[ "hxx@hxx-PC" ]
hxx@hxx-PC
5900b84e0418a7482ef0d7fd3e1775d839ecb49b
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/5/5_14ecd5f778dedf0622107e55e2219d122632354b/TileFlags/5_14ecd5f778dedf0622107e55e2219d122632354b_TileFlags_t.java
0b398415c00926266bb42953bf78be6f762958c9
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
2,958
java
package org.dynmap.utils; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.dynmap.Log; /** * scalable flags primitive - used for keeping track of potentially huge number of tiles * * Represents a flag for each tile, with 2D coordinates based on 0,0 origin. Flags are grouped * 64 x 64, represented by an array of 64 longs. Each set is stored in a hashmap, keyed by a long * computed by ((x/64)<<32)+(y/64). * */ public class TileFlags { private HashMap<Long, long[]> chunkmap = new HashMap<Long, long[]>(); private long last_key = Long.MAX_VALUE; private long[] last_row; public TileFlags() { } public List<String> save() { ArrayList<String> v = new ArrayList<String>(); StringBuilder sb = new StringBuilder(); for(Map.Entry<Long, long[]> ent : chunkmap.entrySet()) { long v1 = ent.getKey().longValue(); sb.append(String.format("%x/%x", ((v1>>32)&0xFFFFFFFFL), (v1 & 0xFFFFFFFFL) )); long[] val = ent.getValue(); for(long vv : val) { sb.append(String.format(":%x/%x", ((vv>>32) & 0xFFFFFFFFL), (vv & 0xFFFFFFFFL))); } v.add(sb.toString()); sb.setLength(0); } return v; } public void load(List<String> vals) { clear(); for(String v : vals) { String[] tok = v.split(":"); long[] row = new long[64]; try { String ss[] = tok[0].split("/"); long rowaddr = (Long.parseLong(ss[0], 16)<<32) | Long.parseLong(ss[1],16); for(int i = 0; (i < 64) && (i < (tok.length-1)); i++) { ss = tok[i+1].split("/"); row[i] = (Long.parseLong(ss[0], 16)<<32) | Long.parseLong(ss[1],16); } chunkmap.put(rowaddr, row); } catch (NumberFormatException nfx) { Log.info("parse error - " + nfx); } } } public boolean getFlag(int x, int y) { long k = (((long)(x >> 6)) << 32) | (0xFFFFFFFFL & (long)(y >> 6)); long[] row; if(k == last_key) { row = last_row; } else { row = chunkmap.get(k); last_key = k; last_row = row; } if(row == null) return false; else return (row[y & 0x3F] & (1L << (x & 0x3F))) != 0; } public void setFlag(int x, int y, boolean f) { long k = (((long)(x >> 6)) << 32) | (0xFFFFFFFFL & (long)(y >> 6)); long[] row; if(k == last_key) { row = last_row; } else { row = chunkmap.get(k); last_key = k; last_row = row; } if(f) { if(row == null) { row = new long[64]; chunkmap.put(k, row); last_row = row; } row[y & 0x3F] |= (1L << (x & 0x3F)); } else { if(row != null) row[y & 0x3F] &= ~(1L << (x & 0x3F)); } } public void clear() { chunkmap.clear(); last_row = null; last_key = Long.MAX_VALUE; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
601d5330ed8b924c5c1d9a880ddec0e53b4088d9
f683b3bc787cf288bb46ce974f81c9c0f0d7860b
/passage-keycloak-security/src/main/java/com/nm/common/keycloak/auth/DefaultSecurityChecker.java
038d64d1f5c8af8686756ef9c9cb44eedeadb8c5
[]
no_license
kumar130/passage-core
db21b5ac10d18b82d8bac01b65c05098ab53c15f
d433e103e29b2a255369e4f9f0b4d14bb81a50da
refs/heads/master
2021-08-30T20:59:27.644727
2017-12-19T12:34:16
2017-12-19T12:34:16
114,759,095
1
1
null
null
null
null
UTF-8
Java
false
false
301
java
package com.nm.common.keycloak.auth; import org.springframework.security.core.Authentication; /** * Created by kre5335 on 4/19/2017. */ public class DefaultSecurityChecker implements AuthorizationChecker { @Override public boolean check(Authentication auth) { return true; } }
[ "saurav.tech812@gmail.com" ]
saurav.tech812@gmail.com
72e268f6d0f1296f68c110b14e2d43d034b68694
192ef42ee1b474a8ef1e10c3a722ed7dfadd882a
/common/src/main/java/com/rpc/serializer/JsonSerializer.java
81f7eb4ada225f7c2ca2a1eeb6c6156887c60dcb
[]
no_license
slorui/rpc
1d1de80ed14ff4b122524589de3d58cc65e5438c
b5c4ef3ba5b53bcf1e91fc89c8a390f4023d85c0
refs/heads/main
2023-05-30T06:06:35.787973
2021-06-12T07:08:36
2021-06-12T07:08:36
368,851,624
2
1
null
null
null
null
UTF-8
Java
false
false
1,946
java
package com.rpc.serializer; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.rpc.pojo.RpcRequest; import lombok.extern.slf4j.Slf4j; import java.io.IOException; /** * @author slorui * data 2021/5/19 */ @Slf4j public class JsonSerializer implements CommonSerializer{ private ObjectMapper objectMapper = new ObjectMapper(); @Override public byte[] serialize(Object obj) { try { return objectMapper.writeValueAsBytes(obj); } catch (JsonProcessingException e) { log.error("序列化时有错误发生: {}", e.getMessage()); } return null; } @Override public Object deserialize(byte[] bytes, Class<?> clazz) { try { Object obj = objectMapper.readValue(bytes, clazz); if(obj instanceof RpcRequest){ obj = handler(obj); } return obj; } catch (IOException e) { log.error("反序列化时有错误发生: {}", e.getMessage()); } return null; } /** * 这里由于使用JSON序列化和反序列化Object数组,无法保证反序列化后仍然为原实例类型 * 需要重新判断处理 */ private Object handler(Object obj) throws IOException { RpcRequest rpcRequest = (RpcRequest) obj; for (int i = 0; i < rpcRequest.getParamTypes().length; i++) { Class<?> clazz = rpcRequest.getParamTypes()[i]; if(!clazz.isAssignableFrom(rpcRequest.getParameters()[i].getClass())){ byte[] bytes = objectMapper.writeValueAsBytes(rpcRequest.getParameters()[i]); rpcRequest.getParameters()[i] = objectMapper.readValue(bytes, clazz); } } return rpcRequest; } @Override public int getCode() { return SerializerCode.valueOf("JSON").getCode(); } }
[ "zzmmshang@qq.com" ]
zzmmshang@qq.com
db6447946e3e371ba5aaa6c23dd7e843e9330403
d0b3281f3045a84d7fee4d942818209d4fae0e81
/app/src/main/java/nickrout/lenslauncher/util/ColorUtil.java
b057d80c232077857635b693523794bfc93b8d66
[]
no_license
huy-lv/lens-launcher
bae96bdb1385086886fcfb1baeb5214313fd2e81
45fe4e918c75ef89ed09b8d95574e56002451311
refs/heads/master
2021-01-18T17:32:20.490676
2017-03-31T11:14:08
2017-03-31T11:14:08
86,807,765
1
0
null
null
null
null
UTF-8
Java
false
false
1,541
java
package nickrout.lenslauncher.util; import android.graphics.Bitmap; import android.graphics.Color; import android.support.annotation.ColorInt; import android.support.v7.graphics.Palette; import nickrout.lenslauncher.model.App; /** * Created by nicholasrout on 2016/05/28. */ public class ColorUtil { public static @ColorInt int getPaletteColorFromApp(App app) { return getPaletteColorFromBitmap(app.getIcon()); } public static @ColorInt int getPaletteColorFromBitmap(Bitmap bitmap) { Palette palette; try { palette = Palette.from(bitmap).generate(); } catch (IllegalArgumentException e) { e.printStackTrace(); return Color.BLACK; } if (palette.getSwatches().size() > 0) { int swatchIndex = 0; for (int i = 1; i < palette.getSwatches().size(); i++) { if (palette.getSwatches().get(i).getPopulation() > palette.getSwatches().get(swatchIndex).getPopulation()) { swatchIndex = i; } } return palette.getSwatches().get(swatchIndex).getRgb(); } else { return Color.BLACK; } } public static float getHueColorFromApp(App app) { return getHueColorFromColor(app.getPaletteColor()); } public static float getHueColorFromColor(@ColorInt int color) { float[] hsvValues = new float[3]; Color.colorToHSV(color, hsvValues); return hsvValues[0]; } }
[ "nicholasrout@gmail.com" ]
nicholasrout@gmail.com
81f5c2bc3cd83f111cca81ec5fe477bfc9f4caec
7fb7e45083e9f78010a0112da80889202195fa51
/sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/fluent/inner/OperationInner.java
65b78e9fd46b88ae96b9153a757575d9e051d6fb
[ "LicenseRef-scancode-generic-cla", "MIT", "BSD-3-Clause", "LicenseRef-scancode-warranty-disclaimer", "LGPL-2.1-or-later", "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
abouquet/azure-sdk-for-java
1f79d75636ef5c354d1229531583f67d97b104cd
05bcf7062f5bc1bca09eeec36b2ca8fa2c4e3655
refs/heads/master
2023-01-06T04:17:28.305062
2020-09-24T18:47:53
2020-09-24T18:47:53
298,386,196
0
0
MIT
2020-09-24T20:19:37
2020-09-24T20:19:36
null
UTF-8
Java
false
false
1,916
java
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.cdn.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.cdn.models.OperationDisplay; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The Operation model. */ @Fluent public final class OperationInner { @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); /* * Operation name: {provider}/{resource}/{operation} */ @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* * The object that represents the operation. */ @JsonProperty(value = "display") private OperationDisplay display; /** * Get the name property: Operation name: {provider}/{resource}/{operation}. * * @return the name value. */ public String name() { return this.name; } /** * Get the display property: The object that represents the operation. * * @return the display value. */ public OperationDisplay display() { return this.display; } /** * Set the display property: The object that represents the operation. * * @param display the display value to set. * @return the OperationInner object itself. */ public OperationInner withDisplay(OperationDisplay display) { this.display = display; return this; } /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (display() != null) { display().validate(); } } }
[ "noreply@github.com" ]
noreply@github.com
6b1716745e58806bfabfddfaf3210a3ec9c41294
0abc34a1943443cb6108603ce36a7abf22611c0a
/bdd/cucumber/cucumber-master/cucumber-master-cdi/src/test/java/de/dbo/samples/cucumber/master/project/CreditCard.java
4a8f75dbcb1742b6a4ce8a539ed8586ede6725f9
[]
no_license
DmitriBoulanger/samples
71c040c7a70034210a92f81be763784784be5be0
a7fe8a177dc269644e08ff44b707b4f772e940c0
refs/heads/master
2020-05-21T23:00:46.032086
2017-03-04T23:15:37
2017-03-04T23:15:37
13,359,641
1
0
null
null
null
null
UTF-8
Java
false
false
583
java
package de.dbo.samples.cucumber.master.project; public class CreditCard { private boolean valid = true; private boolean inUse = false; protected Account account; public CreditCard() {} public CreditCard(Account account) { this.account = account; } public boolean isValid() { return valid; } public void setAccount(Account account) { this.account = account; } public Account getAccount() { return account; } public void insertCard(){ inUse = true; } public void returnCard(){ inUse = false; } public boolean isInUse() { return inUse; } }
[ "dmitri.boulanger@t-online.de" ]
dmitri.boulanger@t-online.de
c220ad2c12388ab247add49e54902e8236bceda6
8c6240ccb7b274691f121a0f03bb2273be7536dc
/src/main/java/lesson3/Main.java
45923132a31fd4a245f8e22f3ba4b50e1fd6cdb3
[]
no_license
ToXa-1984/ToXa-1984
74eb7a975d4a9255de757b22bb6e8ec2eb84fae7
09dc4e2e1c8cdce3a140f28537a701a89120e4b2
refs/heads/master
2021-01-06T19:16:27.361169
2020-03-06T14:08:16
2020-03-06T14:08:16
241,454,266
1
0
null
null
null
null
UTF-8
Java
false
false
3,677
java
package lesson3; import java.util.Objects; import java.util.Random; import java.util.Scanner; public class Main { public static void main(String[] args) { // System.out.println("Standard method"); // "".equals(""); // User user = new User(); // user.move(); // Внутри данного метода вызывается private метод // String res = user.print(); // Метод с возвращающим параметром String // System.out.println(res); // // Перегрузка метода // Calculate calculate = new Calculate(); // int sum = calculate.sum(5, 10); // System.out.println(sum); // int sum1 = calculate.sum(5, 10,12); // System.out.println(sum1); // innerMethod(); // Внутренний метод // System.out.println(Calculate.minus(10, 5)); // Правильное обращение к статическому методу из вне // Calculate calculate = new Calculate(); // System.out.println(calculate.minus(10, 6)); // Возможен вызов статического метода // // Пример использования не статическиого // User alex = new User(); // alex.age = 18; // alex.name = "Alex"; // alex.surname = "Unknown"; // // alex.introduce(); //Scanner // Scanner scanner = new Scanner(System.in); // System.out.println("Enter some text:"); //// String next = scanner.next(); // Считать строку до пробела // String next = scanner.nextLine(); // Считать строку полностью // System.out.println("Entered text is: " + next); // // System.out.println("How old are you?"); // int age = scanner.nextInt(); // System.out.println("You are " + age); // System.out.println("Enter your weight:"); // double weight = scanner.nextDouble(); // System.out.println("Your weight is: " + weight); // //Math // System.out.println(Math.sqrt(9)); // System.out.println(Math.abs(-15)); // System.out.println(Math.min(5, 7)); // System.out.println(Math.max(15, 7)); // System.out.println(Math.random()); // // int rand = (int) (Math.random() * 100); // System.out.println(rand); //Random // Random random = new Random(); // System.out.println(random.nextInt()); // System.out.println(random.nextDouble()); // System.out.println(random.nextBoolean()); // System.out.println(random.nextInt() + random.nextDouble()); //Для ограничиения диапазона случайных чисел, можно задать лимит: Random random = new Random(); System.out.println(random.nextInt(3)); // Будет выводить от 0 до 2. Отрицательных чисел не будет System.out.println(random.nextInt(3) + 1); // Будет выводить от 1 до 3. Отрицательных чисел не будет //equals and == User user1 = new User(); user1.name = "Bob"; user1.surname = "Bobob"; user1.age = 18; User user2 = new User(); user2.name = "Bob"; user2.surname = "Bobob"; user2.age = 18; System.out.println(user1 == user2); System.out.println(user1.equals(user2)); // user1 == user2 (стандартная реализация) } private static void innerMethod() { System.out.println("Inner method example"); } }
[ "anton1984kostiuchenko@gmail.com" ]
anton1984kostiuchenko@gmail.com