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
2a07b0f1b4646b15797e75ca7748d02c15938f46
8cf468781cdea5f9c2c8ae3148dae91a0bd6331a
/src/main/java/com/example/dao/KotaMapper.java
eaba2dd90705b335fefb602773de3f61d0636535
[]
no_license
apap-2017/tugas1_1406623631
61cf4eb3642feadb6bea447a80aa010f66adef49
9b5f72d4e63fe0859229d2985d17ff7c82562bb8
refs/heads/master
2021-07-21T08:23:29.177848
2017-10-22T14:37:55
2017-10-22T14:37:55
106,100,526
0
0
null
null
null
null
UTF-8
Java
false
false
732
java
package com.example.dao; import java.math.BigInteger; import java.util.List; import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Results; import org.apache.ibatis.annotations.Result; import org.apache.ibatis.annotations.Many; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Update; import com.example.model.KotaModel; @Mapper public interface KotaMapper { @Select("select * from kota where id = #{id}") KotaModel selectKotaById (@Param("id") BigInteger id); @Select("select * from kota") List<KotaModel> selectAllKota (); }
[ "adilkrisnadi@gmail.com" ]
adilkrisnadi@gmail.com
7160d09bd53544d7bb6f1a672552026307f7daa0
3b1112e6d5d57bad698b9ce255d9bbd25606ae04
/src/test/java/_239_SlidingWindowMaximum/Practice.java
eb556ee577171c8fe4f86b616e347a0a57ea2e10
[]
no_license
jchanghong/leetcode-java-Test
dbd9cd52e834ea528cbe5b8d734ec1249f466013
f84c80f1b609ad2cf3323fb32261b7435d46cbaa
refs/heads/master
2021-06-23T10:51:31.964246
2017-08-15T07:42:14
2017-08-15T07:42:18
100,351,439
2
0
null
null
null
null
UTF-8
Java
false
false
1,365
java
/** *************************************************************************** * Description: * * Given an array nums, there is a sliding window of size k which is moving * from the very left of the array to the very right. You can only see the * k numbers in the window. Each time the sliding window moves right by * one position. * For example, Given nums = [1,3,-1,-3,5,3,6,7], and k = 3. * Window position Max * --------------- ----- * [1 3 -1] -3 5 3 6 7 3 * 1 [3 -1 -3] 5 3 6 7 3 * 1 3 [-1 -3 5] 3 6 7 5 * 1 3 -1 [-3 5 3] 6 7 5 * 1 3 -1 -3 [5 3 6] 7 6 * 1 3 -1 -3 5 [3 6 7] 7 * Therefore, return the max sliding window as [3,3,5,5,6,7]. * * Note: * You may assume k is always valid, ie: 1 ≤ k ≤ input array's size for non-empty array. * * Follow up: Could you solve it in linear time? * *************************************************************************** * @tag : Heap * {@link https://leetcode.com/problems/sliding-window-maximum/ } */ package _239_SlidingWindowMaximum; /** see test {@link _239_SlidingWindowMaximum.PracticeTest } */ public class Practice { public int[] maxSlidingWindow(int[] nums, int k) { // TODO Auto-generated method stub return null; } }
[ "3200601@qq.com" ]
3200601@qq.com
b2dd0cb60188ae90a9352a78b21114ccb97c2b01
4397d0e2bde56940056ad7ccffa66256b22bea79
/src/main/java/com/example/demo/dao/DangKyHocPhanDao.java
8c418113638c7c248d93e3d567a2efe02920eab8
[]
no_license
bridgecrew-perf7/KLTN_deploy
65a11c905d750215258ae12d7ccd95bc9c848e17
1134e7df4af2e38c4766b55e481b93808ba148a4
refs/heads/master
2023-05-30T02:13:16.297776
2021-06-16T08:17:37
2021-06-16T08:17:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
251
java
package com.example.demo.dao; import java.util.List; import com.example.demo.model.DangKyLopHocPhan; public interface DangKyHocPhanDao { boolean addDKHP(DangKyLopHocPhan dkhp); boolean huyDKHP(Long id); List<DangKyLopHocPhan> getAllDKHP(); }
[ "daiviet1023@gmail.com" ]
daiviet1023@gmail.com
2e6526818d44f5a0af21e966e83caff46ded1eb4
7bda7971c5953d65e33bdf054360bdf4488aa7eb
/src/com/arcsoft/office/common/picture/PictureKit.java
b4006d790a60ffcb929493acafba6bcb394f9237
[ "Apache-2.0" ]
permissive
daddybh/iOffice
ee5dd5938f258d7dcfc0757b1809d31662dd07ef
d1d6b57fb0d496db5c5649f5bc3751b2a1539f83
refs/heads/master
2021-12-10T20:47:15.238083
2016-09-20T12:14:17
2016-09-20T12:14:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
18,934
java
/* * 文件名称: PictureKit.java * * 编译器: android2.2 * 时间: 下午4:12:38 */ package com.arcsoft.office.common.picture; import java.io.FileInputStream; import java.io.InputStream; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.BitmapFactory.Options; import android.graphics.Canvas; import android.graphics.ColorMatrix; import android.graphics.ColorMatrixColorFilter; import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.Rect; import com.arcsoft.office.common.pictureefftect.PictureCroppedInfo; import com.arcsoft.office.common.pictureefftect.PictureEffectInfo; import com.arcsoft.office.common.pictureefftect.PictureEffectUtil; import com.arcsoft.office.constant.EventConstant; import com.arcsoft.office.fc.hslf.blip.JPEG; import com.arcsoft.office.fc.pdf.PDFLib; import com.arcsoft.office.pg.animate.IAnimation; import com.arcsoft.office.pg.animate.ShapeAnimation; import com.arcsoft.office.system.IControl; /** * 图片处理工具类 * <p> * <p> * Read版本: Read V1.0 * <p> * 作者: ljj8494 * <p> * 日期: 2011-11-16 * <p> * 负责人: ljj8494 * <p> * 负责小组: * <p> * <p> */ public class PictureKit { private static final String FAIL = "Fail"; // private static final PictureKit kit = new PictureKit(); private static int VectorMaxZOOM = 3; private static int VectorMaxSize = 1024 * 1024; /** * * @return */ public static PictureKit instance() { return kit; } /** * */ private PictureKit() { paint.setAntiAlias(true);; } /** * * * @param canvas 画布 * @param pic 绘制图片对象 * @param x x值 * @param y y值 * @param zoom 是否缩放 * @param destWidth 如果缩放,指定缩放后的宽度 * @param destHeight 如果缩放,指定缩放后的高度 * * @throws OutOfMemoryError */ public synchronized void drawPicture(Canvas canvas, IControl control, int viewIndex, Picture pic, float x, float y, float zoom, float destWidth, float destHeight, PictureEffectInfo effectInfor) throws OutOfMemoryError { drawPicture(canvas, control, viewIndex, pic, x, y, zoom, destWidth, destHeight, effectInfor, null); } private void applyEffect(Paint paint, PictureEffectInfo effectInfor) { if(effectInfor != null) { ColorMatrix cMatrix = new ColorMatrix(); //black&white if(effectInfor.getBlackWhiteThreshold() != null) { cMatrix.set(PictureEffectUtil.getBlackWhiteArray(effectInfor.getBlackWhiteThreshold())); } else if(effectInfor.isGrayScale() != null && effectInfor.isGrayScale()) { cMatrix.set(PictureEffectUtil.getGrayScaleArray()); } //brightness and contrast Float brightness = effectInfor.getBrightness(); Float contrast = effectInfor.getContrast(); if(brightness != null && contrast != null) { ColorMatrix cm = new ColorMatrix(); cm.set(PictureEffectUtil.getBrightAndContrastArray(brightness.intValue(), contrast)); cMatrix.preConcat(cm); } else if(brightness != null) { ColorMatrix cm = new ColorMatrix(); cm.set(PictureEffectUtil.getBrightnessArray(brightness.intValue())); cMatrix.preConcat(cm); } else if(contrast != null) { ColorMatrix cm = new ColorMatrix(); cm.set(PictureEffectUtil.getContrastArray(contrast)); cMatrix.preConcat(cm); } paint.setColorFilter(new ColorMatrixColorFilter(cMatrix)); } } /** * @param canvas 画布 * @param pic 绘制图片对象 * @param x x值 * @param y y值 * @param zoom 是否缩放 * @param destWidth 如果缩放,指定缩放后的宽度 * @param destHeight 如果缩放,指定缩放后的高度 * * @throws OutOfMemoryError */ public synchronized void drawPicture(Canvas canvas, IControl control, int viewIndex, Picture pic, float x, float y, float zoom, float destWidth, float destHeight, PictureEffectInfo effectInfor, IAnimation animation) throws OutOfMemoryError { if (pic != null && pic.getTempFilePath() != null) { if(animation != null && animation.getCurrentAnimationInfor().getAlpha() == 0) { return; } String ret = drawPicture(canvas, control, viewIndex, pic.getTempFilePath(), pic.getPictureType(), null, x, y, zoom, destWidth, destHeight, effectInfor, animation); if(ret != null) { if(ret.equalsIgnoreCase(FAIL)) { //picture is too large, do not decode it any more pic.setTempFilePath(null); } else { //wmf image to jpg pic.setPictureType(Picture.PNG); pic.setTempFilePath(ret); } } } } private boolean drawCropedPicture(Canvas canvas, float x, float y, float destWidth, float destHeight, Bitmap sBitmap, PictureCroppedInfo croppedInfor) { if(croppedInfor != null) { Rect destCrop = null; Rect srcCrop = null; int srcWidth = sBitmap.getWidth(); int srcHeight = sBitmap.getHeight(); int left = (int)(srcWidth * croppedInfor.getLeftOff()); int top = (int)(srcHeight * croppedInfor.getTopOff()); int right = (int)(srcWidth * (1 - croppedInfor.getRightOff())); int bottom = (int)(srcHeight * (1 - croppedInfor.getBottomOff())); destCrop = new Rect(left, top, right, bottom); left = left >= 0 ? left : 0; top = top >= 0 ? top : 0; right = right >= srcWidth ? srcWidth : right; bottom = bottom >= srcHeight ? srcHeight : bottom; srcCrop = new Rect(left, top, right, bottom); canvas.save(); Matrix matrix = new Matrix(); float zoomX = ((float)destWidth) / (destCrop.width()); float zoomY = ((float)destHeight) / (destCrop.height()); matrix.postScale(zoomX, zoomY); float offX = destCrop.left * zoomX; float offY = destCrop.top * zoomY; matrix.postTranslate(x - offX, y - offY); offX = offX >= 0 ? 0 : offX; offY = offY >= 0 ? 0 : offY; canvas.clipRect(x - offX, y - offY, x - offX + srcCrop.width() * zoomX, y - offY+ srcCrop.height() * zoomY); canvas.drawBitmap(sBitmap, matrix, paint); canvas.restore(); } return true; } /** * * @param canvas 画布 * @param data byte数组的图片数据 * @param offset 数组的开始位置 * @param len 长度 * @param x x值 * @param y y值 * @param zoom 是否缩放 * @param destWidth 如果缩放,指定缩放后的宽度 * @param destHeight 如果缩放,指定缩放后的高度 * @return F 单个文件都会OOM, decode失败; Null not drawing picture ; other content: wmf2Jpg file path */ private String drawPicture(Canvas canvas, IControl control, int viewIndex, String path, byte imageType, Options options, float x, float y, float zoom, float destWidth, float destHeight, PictureEffectInfo effectInfor, IAnimation animation) { try { Bitmap sBitmap = control.getSysKit().getPictureManage().getBitmap(path); if (sBitmap == null) { if (!isDrawPictrue()) { return null; } if(control.getSysKit().getPictureManage().isConverting(path)) { control.getSysKit().getPictureManage().appendViewIndex(path, viewIndex); return null; } if( imageType == Picture.WMF || imageType == Picture.EMF) { if(control.isSlideShow()) { control.getSysKit().getAnimationManager().killAnimationTimer(); } int w = (int)(destWidth / zoom); int h = (int)(destHeight / zoom); if(w * h < VectorMaxSize) { double z = Math.sqrt(VectorMaxSize / (w * h)); if(z > VectorMaxZOOM) { z = VectorMaxZOOM; } w = (int)Math.round(w * z); h = (int)Math.round(h * z); } String dst = control.getSysKit().getPictureManage().convertVectorgraphToPng(viewIndex, imageType, path, w, h, control.isSlideShow()); if(control.isSlideShow()) { control.getSysKit().getAnimationManager().restartAnimationTimer(); control.actionEvent(EventConstant.TEST_REPAINT_ID, null); } return dst; } else { try { InputStream in = new FileInputStream(path); sBitmap = BitmapFactory.decodeStream(in, null, options); if(sBitmap == null) { //load fail, so call library to convert it to normal png image if(control.isSlideShow()) { control.getSysKit().getAnimationManager().killAnimationTimer(); } String dst = null; if(imageType == Picture.JPEG) { // android only supports RGB color space, but some JPEG picture is // CMYK color space, it returns null when call BitmapFactory.decodeStream, // so call lib to load picture dst = control.getSysKit().getPictureManage().convertToPng(viewIndex, path, Picture.JPEG_TYPE, control.isSlideShow()); } else if(imageType == Picture.PNG) { dst = control.getSysKit().getPictureManage().convertToPng(viewIndex, path, Picture.PNG_TYPE, control.isSlideShow()); } if(control.isSlideShow()) { control.getSysKit().getAnimationManager().restartAnimationTimer(); control.actionEvent(EventConstant.TEST_REPAINT_ID, null); } return dst; } } catch(Exception e) { return FAIL; } } if (sBitmap == null) { return FAIL; } control.getSysKit().getPictureManage().addBitmap(path, sBitmap); } if(animation != null) { ShapeAnimation shapeAnim = animation.getShapeAnimation(); int paraBegin = shapeAnim.getParagraphBegin(); int paraEnd = shapeAnim.getParagraphEnd(); if(paraBegin == ShapeAnimation.Para_All && paraEnd == ShapeAnimation.Para_All || (paraBegin == ShapeAnimation.Para_BG && paraEnd == ShapeAnimation.Para_BG)) { int a = animation.getCurrentAnimationInfor().getAlpha(); paint.setAlpha(a); float rate = a / 255f * 0.5f; float centerX = x + destWidth / 2; float centerY = y + destHeight / 2; x = centerX - destWidth * rate; y = centerY - destHeight * rate; destWidth *= rate * 2; destHeight *= rate * 2; } } //picture effect //transparent boolean isTransparentBMP = false; if(effectInfor != null && effectInfor.getTransparentColor() != null) { Bitmap bmp = createTransparentBitmapFromBitmap(sBitmap, effectInfor.getTransparentColor()); if(bmp != null) { sBitmap = bmp; isTransparentBMP = true; } } //alpha if(effectInfor != null && effectInfor.getAlpha() != null) { paint.setAlpha(effectInfor.getAlpha()); } //other effect applyEffect(paint, effectInfor); paint.setAntiAlias(true); paint.setFilterBitmap(true); if(effectInfor == null || effectInfor.getPictureCroppedInfor() == null) { Matrix matrix = new Matrix(); matrix.postScale(((float)destWidth) / sBitmap.getWidth(), ((float)destHeight) / sBitmap.getHeight()); matrix.postTranslate(x, y); canvas.drawBitmap(sBitmap, matrix, paint); } else { drawCropedPicture(canvas, x, y, destWidth, destHeight, sBitmap, effectInfor.getPictureCroppedInfor()); } paint.reset(); if(isTransparentBMP) { sBitmap.recycle(); } return null; } catch(OutOfMemoryError e) { if(control.getSysKit().getPictureManage().hasBitmap()) { control.getSysKit().getPictureManage().clearBitmap(); return drawPicture(canvas, control, viewIndex, path, imageType, options, x, y, zoom, destWidth, destHeight, effectInfor, animation); } else { if(options == null) { options = new Options(); options.inSampleSize = 2; } else { options.inSampleSize *= 2; } return drawPicture(canvas, control, viewIndex, path, imageType, options, x, y, zoom, destWidth, destHeight, effectInfor, animation); } } catch(Exception e) { return FAIL; } } /** * create a transparent bitmap from an existing bitmap by replacing certain * color with transparent * * @param bitmap * the original bitmap with a color you want to replace * @return a replaced color immutable bitmap */ public Bitmap createTransparentBitmapFromBitmap(Bitmap bitmap, int replaceThisColor) { if (bitmap != null) { final int diff = 10; int picw = bitmap.getWidth(); int pich = bitmap.getHeight(); int[] pix = new int[picw * pich]; bitmap.getPixels(pix, 0, picw, 0, 0, picw, pich); for (int y = 0; y < pich; y++) { // from left to right for (int x = 0; x < picw; x++) { int index = y * picw + x; int r = (pix[index] >> 16) & 0xff; int g = (pix[index] >> 8) & 0xff; int b = pix[index] & 0xff; int tr = (replaceThisColor >> 16) & 0xff; int tg = (replaceThisColor >> 8) & 0xff; int tb = replaceThisColor & 0xff; if (Math.abs(tr - r) <= diff && Math.abs(tg - g) <= diff && Math.abs(tb - b) <= diff) { pix[index] = 0; } } } return Bitmap.createBitmap(pix, picw, pich, Bitmap.Config.ARGB_4444); } return null; } /** * * @param canvas * @param bitmap * @param x * @param y * @param zoom * @param destWidth * @param destHeight */ public void drawPicture(Canvas canvas, IControl control, Bitmap bitmap, float x, float y, boolean zoom, float destWidth, float destHeight) { try { if (bitmap == null) { return; } Matrix matrix = new Matrix(); matrix.postScale(((float)destWidth) / bitmap.getWidth(), ((float)destHeight) / bitmap.getHeight()); matrix.postTranslate(x, y); canvas.drawBitmap(bitmap, matrix, paint); } catch(OutOfMemoryError e) { control.getSysKit().getErrorKit().writerLog(e); } } /** * * @param pic * @return */ public boolean isVectorPicture(Picture pic) { if (pic != null) { byte imageType = pic.getPictureType(); if(imageType == Picture.WMF || imageType == Picture.EMF) { return true; } } return false; } /** * @return Returns the isDrawPictrue. */ public boolean isDrawPictrue() { return isDrawPictrue; } /** * @param isDrawPictrue The isDrawPictrue to set. */ public void setDrawPictrue(boolean isDrawPictrue) { this.isDrawPictrue = isDrawPictrue; } // private Paint paint = new Paint(); // private boolean isDrawPictrue = true; // //private String filePath; }
[ "ljj@xinlonghang.cn" ]
ljj@xinlonghang.cn
079c7987330f2a0c77df5cf81b07a6ec46f63dd5
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.mm/classes.jar/com/tencent/mm/ui/widget/a/j$7.java
b655500ef4756cfa79448ca4c38f2f3f21793742
[]
no_license
tsuzcx/qq_apk
0d5e792c3c7351ab781957bac465c55c505caf61
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
refs/heads/main
2022-07-02T10:32:11.651957
2022-02-01T12:41:38
2022-02-01T12:41:38
453,860,108
36
9
null
2022-01-31T09:46:26
2022-01-31T02:43:22
Java
UTF-8
Java
false
false
1,002
java
package com.tencent.mm.ui.widget.a; import android.view.View; import android.view.View.OnClickListener; import com.tencent.matrix.trace.core.AppMethodBeat; import com.tencent.mm.hellhoundlib.a.a; import com.tencent.mm.hellhoundlib.b.b; final class j$7 implements View.OnClickListener { j$7(j paramj) {} public final void onClick(View paramView) { AppMethodBeat.i(251824); b localb = new b(); localb.cH(paramView); a.c("com/tencent/mm/ui/widget/dialog/MMHalfBottomDialog$7", "android/view/View$OnClickListener", "onClick", "(Landroid/view/View;)V", this, localb.aYj()); this.agfU.cyW(); a.a(this, "com/tencent/mm/ui/widget/dialog/MMHalfBottomDialog$7", "android/view/View$OnClickListener", "onClick", "(Landroid/view/View;)V"); AppMethodBeat.o(251824); } } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes.jar * Qualified Name: com.tencent.mm.ui.widget.a.j.7 * JD-Core Version: 0.7.0.1 */
[ "98632993+tsuzcx@users.noreply.github.com" ]
98632993+tsuzcx@users.noreply.github.com
b0ada1d275d928d7de69b5106e101fa7a83eaef1
27c921006000eda189a6b71ba90ae0647400cbfb
/src/test/java/tqs/homework/airquality/model/KeysTest.java
bae35a0723a90692aee7c7d80d63cac397c70789
[ "MIT" ]
permissive
vascoalramos/air-quality-service
1e33df4abc2092883fd9c9567a445201008fcf1e
860e8d1be8aabf40fcb89283469ef0de60ac3d37
refs/heads/master
2022-09-26T13:14:41.909925
2020-06-07T11:13:52
2020-06-07T11:13:52
255,937,189
1
0
MIT
2020-06-07T11:13:53
2020-04-15T14:10:41
Java
UTF-8
Java
false
false
580
java
package tqs.homework.airquality.model; import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; public class KeysTest { @Test public void testSetDay() { Keys keys = new Keys(); String day = "day1"; keys.setDay(day); assertThat(keys.getDay()).isEqualTo(day); } @Test public void testSetCity() { City city = new City(1L, "Viseu,PT", "Portugal", "222", "-1.2"); Keys keys = new Keys(); keys.setCity(city); assertThat(keys.getCity()).isEqualTo(city); } }
[ "vascoalramos@outlook.pt" ]
vascoalramos@outlook.pt
4c973ba7bc9f3ad450c6968f44eb8b93a9b5e882
3ddab988a7181869e687e3a227d6762ba20f55e8
/gameclient/network test code client/src/sharedResources/playerName.java
d618b0e40e0be4739c25903e60f7a3569ffc63b0
[]
no_license
gjcchan/multiplayer-game-engine
59b719e171dfe623df3192c56b6a4babe84ced23
e88a11ab42b8d53cf51c5328ccc0871662a37b52
refs/heads/master
2021-01-10T10:51:10.874456
2016-10-10T05:38:13
2016-10-10T05:38:13
50,549,372
0
0
null
null
null
null
UTF-8
Java
false
false
324
java
package sharedResources; public class playerName { public int index; public String name; public playerName(String userName, int newIndex) { index = newIndex; name = userName; } public playerName(String userName, String newIndex) throws Exception { index = Integer.parseInt(newIndex); name = userName; } }
[ "gjchan@sfu.ca" ]
gjchan@sfu.ca
3967588d948e99372bc003778372bd906d86179e
2a2638cff1e7822e45f9ed913e8a0bf01fbc05b4
/src/main/java/android/support/v4/app/FragmentState.java
82a14787aaf884af70a9f1e0972b734a0d5ca96a
[]
no_license
TaintBench/samsapo
df726299056c058e77379a5a6707fa9853f0b945
8813a3dd5764fc8eaf5a5302533d2c4410e6c0ef
refs/heads/master
2021-07-21T22:26:02.689487
2021-07-16T11:39:36
2021-07-16T11:39:36
234,356,959
0
0
null
null
null
null
UTF-8
Java
false
false
4,428
java
package android.support.v4.app; import android.content.Context; import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; import android.os.Parcelable.Creator; import android.util.Log; /* compiled from: Fragment */ final class FragmentState implements Parcelable { public static final Creator<FragmentState> CREATOR; final Bundle mArguments; final String mClassName; final int mContainerId; final boolean mDetached; final int mFragmentId; final boolean mFromLayout; final int mIndex; Fragment mInstance; final boolean mRetainInstance; Bundle mSavedFragmentState; final String mTag; public FragmentState(Fragment fragment) { Fragment fragment2 = fragment; this.mClassName = fragment2.getClass().getName(); this.mIndex = fragment2.mIndex; this.mFromLayout = fragment2.mFromLayout; this.mFragmentId = fragment2.mFragmentId; this.mContainerId = fragment2.mContainerId; this.mTag = fragment2.mTag; this.mRetainInstance = fragment2.mRetainInstance; this.mDetached = fragment2.mDetached; this.mArguments = fragment2.mArguments; } public FragmentState(Parcel parcel) { Parcel parcel2 = parcel; this.mClassName = parcel2.readString(); this.mIndex = parcel2.readInt(); this.mFromLayout = parcel2.readInt() != 0; this.mFragmentId = parcel2.readInt(); this.mContainerId = parcel2.readInt(); this.mTag = parcel2.readString(); this.mRetainInstance = parcel2.readInt() != 0; this.mDetached = parcel2.readInt() != 0; this.mArguments = parcel2.readBundle(); this.mSavedFragmentState = parcel2.readBundle(); } public Fragment instantiate(FragmentActivity fragmentActivity, Fragment fragment) { Context context = fragmentActivity; Fragment fragment2 = fragment; if (this.mInstance != null) { return this.mInstance; } if (this.mArguments != null) { this.mArguments.setClassLoader(context.getClassLoader()); } this.mInstance = Fragment.instantiate(context, this.mClassName, this.mArguments); if (this.mSavedFragmentState != null) { this.mSavedFragmentState.setClassLoader(context.getClassLoader()); this.mInstance.mSavedFragmentState = this.mSavedFragmentState; } this.mInstance.setIndex(this.mIndex, fragment2); this.mInstance.mFromLayout = this.mFromLayout; this.mInstance.mRestored = true; this.mInstance.mFragmentId = this.mFragmentId; this.mInstance.mContainerId = this.mContainerId; this.mInstance.mTag = this.mTag; this.mInstance.mRetainInstance = this.mRetainInstance; this.mInstance.mDetached = this.mDetached; this.mInstance.mFragmentManager = context.mFragments; if (FragmentManagerImpl.DEBUG) { StringBuilder stringBuilder = r7; StringBuilder stringBuilder2 = new StringBuilder(); int v = Log.v("FragmentManager", stringBuilder.append("Instantiated fragment ").append(this.mInstance).toString()); } return this.mInstance; } public int describeContents() { return 0; } public void writeToParcel(Parcel parcel, int i) { Parcel parcel2 = parcel; int i2 = i; parcel2.writeString(this.mClassName); parcel2.writeInt(this.mIndex); parcel2.writeInt(this.mFromLayout ? 1 : 0); parcel2.writeInt(this.mFragmentId); parcel2.writeInt(this.mContainerId); parcel2.writeString(this.mTag); parcel2.writeInt(this.mRetainInstance ? 1 : 0); parcel2.writeInt(this.mDetached ? 1 : 0); parcel2.writeBundle(this.mArguments); parcel2.writeBundle(this.mSavedFragmentState); } static { AnonymousClass1 anonymousClass1 = r2; AnonymousClass1 anonymousClass12 = new Creator<FragmentState>() { public FragmentState createFromParcel(Parcel parcel) { FragmentState fragmentState = r5; FragmentState fragmentState2 = new FragmentState(parcel); return fragmentState; } public FragmentState[] newArray(int i) { return new FragmentState[i]; } }; CREATOR = anonymousClass1; } }
[ "malwareanalyst1@gmail.com" ]
malwareanalyst1@gmail.com
838024e9cd02e818ed608c4974d6c6837f1839d1
786d426d404ece478fa99ba4caf1c07dc9177531
/src/org/mustbe/consulo/unity3d/module/Unity3dModuleExtensionUtil.java
8a71ab19c0d57007da96bea4196eacf15ee35815
[ "Apache-2.0" ]
permissive
mefilt/consulo-unity3d
a4818e1ef320b0f744517c26d539dbaaac27f98c
9dc98cee2362c3e4c6f71679e10208b79f2e7991
refs/heads/master
2021-01-17T08:48:12.543321
2015-10-26T18:53:07
2015-10-26T18:53:07
46,150,303
0
1
null
2015-11-13T22:18:09
2015-11-13T22:18:09
null
UTF-8
Java
false
false
1,818
java
/* * Copyright 2013-2015 must-be.org * * 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.mustbe.consulo.unity3d.module; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.mustbe.consulo.RequiredReadAction; import com.intellij.openapi.module.Module; import com.intellij.openapi.module.ModuleManager; import com.intellij.openapi.module.ModuleUtilCore; import com.intellij.openapi.project.Project; import com.intellij.openapi.vfs.VirtualFile; /** * @author VISTALL * @since 29.03.2015 */ public class Unity3dModuleExtensionUtil { @Nullable @RequiredReadAction public static Module getRootModule(@NotNull Project project) { ModuleManager moduleManager = ModuleManager.getInstance(project); for(Module module : moduleManager.getModules()) { VirtualFile baseDir = project.getBaseDir(); if(baseDir == null) { continue; } if(baseDir.equals(module.getModuleDir())) { return module; } } return null; } @Nullable @RequiredReadAction public static Unity3dRootModuleExtension getRootModuleExtension(@NotNull Project project) { Module rootModule = getRootModule(project); if(rootModule == null) { return null; } return ModuleUtilCore.getExtension(rootModule, Unity3dRootModuleExtension.class); } }
[ "vistall.valeriy@gmail.com" ]
vistall.valeriy@gmail.com
7660344ff225f871be803c3cabb12ae4a4f52e78
243b12f7bbcf8ad1e2f337dda6c7dbd336d45434
/Minimum Difference Element.java
c65baf4faeb15f0788c9b2f3fbb3c6ebbc365e62
[]
no_license
riaing/leetcode
0aa37d95d65a56c29e35d2836857f5639eb5b8e8
c28d9214de87707531795cac189119a1a102330b
refs/heads/master
2022-11-06T14:37:59.414637
2022-10-28T20:20:36
2022-10-28T20:20:36
64,333,812
0
0
null
null
null
null
UTF-8
Java
false
false
1,862
java
https://www.educative.io/courses/grokking-the-coding-interview/mymvP915LY9 Given an array of numbers sorted in ascending order, find the element in the array that has the minimum difference with the given ‘key’. Example 1: Input: [4, 6, 10], key = 7 Output: 6 Explanation: The difference between the key '7' and '6' is minimum than any other number in the array Example 2: Input: [4, 6, 10], key = 4 Output: 4 Example 3: Input: [1, 3, 8, 10, 15], key = 12 Output: 10 Example 4: Input: [4, 6, 10], key = 17 Output: 10 -----------------------------------------特性:while 之后 start 会比 end 大。start 可能 > index, end 可能< 0 ---------------------- class MinimumDifference { public static int searchMinDiffElement(int[] arr, int key) { int start = 0, end = arr.length - 1; while (start <= end) { int mid = start + (end - start) / 2; if (key < arr[mid]) { end = mid - 1; } else if (key > arr[mid]) { start = mid + 1; } else { return arr[mid]; } } // 特殊处理一下,出 while 后肯定 start就>end 了 if (start > arr.length - 1) { return arr[end]; } if (end < 0) { return arr[start]; } if ((arr[start] - key) < (key - arr[end])) { return arr[start]; } return arr[end]; } public static void main(String[] args) { System.out.println(MinimumDifference.searchMinDiffElement(new int[] { 4, 6, 10 }, -1)); System.out.println(MinimumDifference.searchMinDiffElement(new int[] { 4, 6, 10 }, 7)); System.out.println(MinimumDifference.searchMinDiffElement(new int[] { 4, 6, 10 }, 4)); System.out.println(MinimumDifference.searchMinDiffElement(new int[] { 1, 3, 8, 10, 15 }, 12)); System.out.println(MinimumDifference.searchMinDiffElement(new int[] { 4, 6, 10 }, 17)); } }
[ "noreply@github.com" ]
noreply@github.com
50f8d7e665ac9f2adf3b3696b53f8f4237eff380
099b739b7c9b7a4c90c7810b593ade462027a0db
/src/main/java/ch/noser/uek223/domain/purchase_product/PurchaseProduct.java
94c44b043bc9d151d16c131f822e255b59d23b20
[]
no_license
chas1e/helloWorldSonar
ff37e61655566524cf2425c618a27a0b991788fe
29e52e481ef5438874d9928e510987ef65553403
refs/heads/master
2023-03-28T05:52:03.989848
2021-03-12T13:38:37
2021-03-12T13:38:37
346,750,881
0
0
null
null
null
null
UTF-8
Java
false
false
1,806
java
package ch.noser.uek223.domain.purchase_product; import ch.noser.uek223.domain.product.Product; import ch.noser.uek223.domain.purchase.Purchase; import com.fasterxml.jackson.annotation.JsonBackReference; import com.fasterxml.jackson.annotation.JsonManagedReference; import org.hibernate.annotations.GenericGenerator; import javax.persistence.*; import java.util.UUID; @Entity public class PurchaseProduct { @Id @GeneratedValue(generator = "UUID") @GenericGenerator( name = "UUID", strategy = "org.hibernate.id.UUIDGenerator", parameters = { @org.hibernate.annotations.Parameter( name = "uuid_gen_strategy_class", value = "org.hibernate.id.uuid.CustomVersionOneStrategy" ) } ) @Column(name = "id", updatable = false, nullable = false) private UUID id; @ManyToOne @JsonBackReference private Purchase purchase; @ManyToOne @JsonManagedReference private Product product; @Column(nullable = false) private int amount; public UUID getId() { return id; } public PurchaseProduct setId(UUID id) { this.id = id; return this; } public Purchase getPurchase() { return purchase; } public PurchaseProduct setPurchase(Purchase purchase) { this.purchase = purchase; return this; } public Product getProduct() { return product; } public PurchaseProduct setProduct(Product product) { this.product = product; return this; } public int getAmount() { return amount; } public PurchaseProduct setAmount(int amount) { this.amount = amount; return this; } }
[ "pew.monstaaaa@gmail.com" ]
pew.monstaaaa@gmail.com
b75920f6a9991a719fbcfb05a8ed9b5e00fed2f5
52ca8a921bdeae0ffa863e7e439ece98614525a4
/XO/src/main/java/com/mobilez365/xo/dialogs/PleaseLoginDialog.java
12793a33a4b719e15ea622f1bb504ff2ca849fb1
[]
no_license
YourTradingSystems/XO_Android
3b19a3f84bfe88433bf7e9f1408f7a27e0b3c043
125a925391a18deddfe09b76173bb3e1255a4f84
refs/heads/master
2016-09-10T19:14:44.487123
2014-07-24T08:44:53
2014-07-24T08:44:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
268
java
package com.mobilez365.xo.dialogs; import android.app.Dialog; import android.content.Context; /** * Created by BruSD on 05.05.2014. */ public class PleaseLoginDialog extends Dialog { public PleaseLoginDialog(Context context) { super(context); } }
[ "brusd.com@gmail.com" ]
brusd.com@gmail.com
92ca89720fdc9961dd604a211fb730a453bb9e80
f15538b13685ff2ff07b91f219030003bf7f5528
/OnlyMusic/gen/com/zhakui/OnlyMusic/service/IMusicManagerAIDL.java
7a7bbf11c3414e970b54fe166c5eb377ef7a40c0
[]
no_license
zhakui/OnlyMusic
2601323beec46aa3f15485c5b38a3534d7cfbc22
1dd96e1178cfdbbafef794f0c104a9d5672928f3
refs/heads/master
2021-01-09T21:55:46.776115
2015-10-22T09:37:05
2015-10-22T09:37:05
44,735,424
0
0
null
null
null
null
UTF-8
Java
false
false
22,472
java
/* * This file is auto-generated. DO NOT MODIFY. * Original file: E:\\android\\workspace\\OnlyMusic\\src\\com\\zhakui\\OnlyMusic\\service\\IMusicManagerAIDL.aidl */ package com.zhakui.OnlyMusic.service; public interface IMusicManagerAIDL extends android.os.IInterface { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements com.zhakui.OnlyMusic.service.IMusicManagerAIDL { private static final java.lang.String DESCRIPTOR = "com.zhakui.OnlyMusic.service.IMusicManagerAIDL"; /** Construct the stub at attach it to the interface. */ public Stub() { this.attachInterface(this, DESCRIPTOR); } /** * Cast an IBinder object into an com.zhakui.OnlyMusic.service.IMusicManagerAIDL interface, * generating a proxy if needed. */ public static com.zhakui.OnlyMusic.service.IMusicManagerAIDL asInterface(android.os.IBinder obj) { if ((obj==null)) { return null; } android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR); if (((iin!=null)&&(iin instanceof com.zhakui.OnlyMusic.service.IMusicManagerAIDL))) { return ((com.zhakui.OnlyMusic.service.IMusicManagerAIDL)iin); } return new com.zhakui.OnlyMusic.service.IMusicManagerAIDL.Stub.Proxy(obj); } @Override public android.os.IBinder asBinder() { return this; } @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { switch (code) { case INTERFACE_TRANSACTION: { reply.writeString(DESCRIPTOR); return true; } case TRANSACTION_play: { data.enforceInterface(DESCRIPTOR); this.play(); reply.writeNoException(); return true; } case TRANSACTION_reset: { data.enforceInterface(DESCRIPTOR); this.reset(); reply.writeNoException(); return true; } case TRANSACTION_stop: { data.enforceInterface(DESCRIPTOR); this.stop(); reply.writeNoException(); return true; } case TRANSACTION_pause: { data.enforceInterface(DESCRIPTOR); this.pause(); reply.writeNoException(); return true; } case TRANSACTION_Prev: { data.enforceInterface(DESCRIPTOR); this.Prev(); reply.writeNoException(); return true; } case TRANSACTION_next: { data.enforceInterface(DESCRIPTOR); this.next(); reply.writeNoException(); return true; } case TRANSACTION_isPlaying: { data.enforceInterface(DESCRIPTOR); boolean _result = this.isPlaying(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); return true; } case TRANSACTION_isPause: { data.enforceInterface(DESCRIPTOR); boolean _result = this.isPause(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); return true; } case TRANSACTION_forward: { data.enforceInterface(DESCRIPTOR); int _arg0; _arg0 = data.readInt(); this.forward(_arg0); reply.writeNoException(); return true; } case TRANSACTION_rewind: { data.enforceInterface(DESCRIPTOR); int _arg0; _arg0 = data.readInt(); this.rewind(_arg0); reply.writeNoException(); return true; } case TRANSACTION_getPlayingSong: { data.enforceInterface(DESCRIPTOR); com.zhakui.OnlyMusic.data.Song _result = this.getPlayingSong(); reply.writeNoException(); if ((_result!=null)) { reply.writeInt(1); _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); } else { reply.writeInt(0); } return true; } case TRANSACTION_getPlayingSongIndex: { data.enforceInterface(DESCRIPTOR); int _result = this.getPlayingSongIndex(); reply.writeNoException(); reply.writeInt(_result); return true; } case TRANSACTION_setPlayingSong: { data.enforceInterface(DESCRIPTOR); com.zhakui.OnlyMusic.data.Song _arg0; if ((0!=data.readInt())) { _arg0 = com.zhakui.OnlyMusic.data.Song.CREATOR.createFromParcel(data); } else { _arg0 = null; } this.setPlayingSong(_arg0); reply.writeNoException(); return true; } case TRANSACTION_setMediaPathList: { data.enforceInterface(DESCRIPTOR); java.util.List<com.zhakui.OnlyMusic.data.Song> _arg0; _arg0 = data.createTypedArrayList(com.zhakui.OnlyMusic.data.Song.CREATOR); this.setMediaPathList(_arg0); reply.writeNoException(); return true; } case TRANSACTION_getCurrentTime: { data.enforceInterface(DESCRIPTOR); java.lang.String _result = this.getCurrentTime(); reply.writeNoException(); reply.writeString(_result); return true; } case TRANSACTION_getCurrentPosition: { data.enforceInterface(DESCRIPTOR); int _result = this.getCurrentPosition(); reply.writeNoException(); reply.writeInt(_result); return true; } case TRANSACTION_setPlayMode: { data.enforceInterface(DESCRIPTOR); int _arg0; _arg0 = data.readInt(); this.setPlayMode(_arg0); reply.writeNoException(); return true; } case TRANSACTION_getPlayMode: { data.enforceInterface(DESCRIPTOR); int _result = this.getPlayMode(); reply.writeNoException(); reply.writeInt(_result); return true; } case TRANSACTION_addMediaPathList: { data.enforceInterface(DESCRIPTOR); java.util.List<com.zhakui.OnlyMusic.data.Song> _arg0; _arg0 = data.createTypedArrayList(com.zhakui.OnlyMusic.data.Song.CREATOR); this.addMediaPathList(_arg0); reply.writeNoException(); return true; } case TRANSACTION_removeMediaPath: { data.enforceInterface(DESCRIPTOR); int _arg0; _arg0 = data.readInt(); this.removeMediaPath(_arg0); reply.writeNoException(); return true; } case TRANSACTION_addMediaPath: { data.enforceInterface(DESCRIPTOR); com.zhakui.OnlyMusic.data.Song _arg0; if ((0!=data.readInt())) { _arg0 = com.zhakui.OnlyMusic.data.Song.CREATOR.createFromParcel(data); } else { _arg0 = null; } this.addMediaPath(_arg0); reply.writeNoException(); return true; } case TRANSACTION_getDurationTime: { data.enforceInterface(DESCRIPTOR); java.lang.String _result = this.getDurationTime(); reply.writeNoException(); reply.writeString(_result); return true; } case TRANSACTION_getDuration: { data.enforceInterface(DESCRIPTOR); int _result = this.getDuration(); reply.writeNoException(); reply.writeInt(_result); return true; } case TRANSACTION_sendPlayStateBrocast: { data.enforceInterface(DESCRIPTOR); this.sendPlayStateBrocast(); reply.writeNoException(); return true; } case TRANSACTION_setSourceType: { data.enforceInterface(DESCRIPTOR); int _arg0; _arg0 = data.readInt(); this.setSourceType(_arg0); reply.writeNoException(); return true; } case TRANSACTION_getSourceType: { data.enforceInterface(DESCRIPTOR); int _result = this.getSourceType(); reply.writeNoException(); reply.writeInt(_result); return true; } case TRANSACTION_exit: { data.enforceInterface(DESCRIPTOR); this.exit(); reply.writeNoException(); return true; } } return super.onTransact(code, data, reply, flags); } private static class Proxy implements com.zhakui.OnlyMusic.service.IMusicManagerAIDL { private android.os.IBinder mRemote; Proxy(android.os.IBinder remote) { mRemote = remote; } @Override public android.os.IBinder asBinder() { return mRemote; } public java.lang.String getInterfaceDescriptor() { return DESCRIPTOR; } @Override public void play() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); mRemote.transact(Stub.TRANSACTION_play, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } } @Override public void reset() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); mRemote.transact(Stub.TRANSACTION_reset, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } } @Override public void stop() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); mRemote.transact(Stub.TRANSACTION_stop, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } } @Override public void pause() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); mRemote.transact(Stub.TRANSACTION_pause, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } } @Override public void Prev() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); mRemote.transact(Stub.TRANSACTION_Prev, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } } @Override public void next() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); mRemote.transact(Stub.TRANSACTION_next, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } } @Override public boolean isPlaying() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); mRemote.transact(Stub.TRANSACTION_isPlaying, _data, _reply, 0); _reply.readException(); _result = (0!=_reply.readInt()); } finally { _reply.recycle(); _data.recycle(); } return _result; } @Override public boolean isPause() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); mRemote.transact(Stub.TRANSACTION_isPause, _data, _reply, 0); _reply.readException(); _result = (0!=_reply.readInt()); } finally { _reply.recycle(); _data.recycle(); } return _result; } @Override public void forward(int time) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(time); mRemote.transact(Stub.TRANSACTION_forward, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } } @Override public void rewind(int time) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(time); mRemote.transact(Stub.TRANSACTION_rewind, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } } @Override public com.zhakui.OnlyMusic.data.Song getPlayingSong() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); com.zhakui.OnlyMusic.data.Song _result; try { _data.writeInterfaceToken(DESCRIPTOR); mRemote.transact(Stub.TRANSACTION_getPlayingSong, _data, _reply, 0); _reply.readException(); if ((0!=_reply.readInt())) { _result = com.zhakui.OnlyMusic.data.Song.CREATOR.createFromParcel(_reply); } else { _result = null; } } finally { _reply.recycle(); _data.recycle(); } return _result; } @Override public int getPlayingSongIndex() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); int _result; try { _data.writeInterfaceToken(DESCRIPTOR); mRemote.transact(Stub.TRANSACTION_getPlayingSongIndex, _data, _reply, 0); _reply.readException(); _result = _reply.readInt(); } finally { _reply.recycle(); _data.recycle(); } return _result; } @Override public void setPlayingSong(com.zhakui.OnlyMusic.data.Song path) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); if ((path!=null)) { _data.writeInt(1); path.writeToParcel(_data, 0); } else { _data.writeInt(0); } mRemote.transact(Stub.TRANSACTION_setPlayingSong, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } } @Override public void setMediaPathList(java.util.List<com.zhakui.OnlyMusic.data.Song> pathList) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeTypedList(pathList); mRemote.transact(Stub.TRANSACTION_setMediaPathList, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } } @Override public java.lang.String getCurrentTime() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); java.lang.String _result; try { _data.writeInterfaceToken(DESCRIPTOR); mRemote.transact(Stub.TRANSACTION_getCurrentTime, _data, _reply, 0); _reply.readException(); _result = _reply.readString(); } finally { _reply.recycle(); _data.recycle(); } return _result; } @Override public int getCurrentPosition() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); int _result; try { _data.writeInterfaceToken(DESCRIPTOR); mRemote.transact(Stub.TRANSACTION_getCurrentPosition, _data, _reply, 0); _reply.readException(); _result = _reply.readInt(); } finally { _reply.recycle(); _data.recycle(); } return _result; } @Override public void setPlayMode(int playMode) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(playMode); mRemote.transact(Stub.TRANSACTION_setPlayMode, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } } @Override public int getPlayMode() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); int _result; try { _data.writeInterfaceToken(DESCRIPTOR); mRemote.transact(Stub.TRANSACTION_getPlayMode, _data, _reply, 0); _reply.readException(); _result = _reply.readInt(); } finally { _reply.recycle(); _data.recycle(); } return _result; } @Override public void addMediaPathList(java.util.List<com.zhakui.OnlyMusic.data.Song> pathList) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeTypedList(pathList); mRemote.transact(Stub.TRANSACTION_addMediaPathList, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } } @Override public void removeMediaPath(int index) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(index); mRemote.transact(Stub.TRANSACTION_removeMediaPath, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } } @Override public void addMediaPath(com.zhakui.OnlyMusic.data.Song path) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); if ((path!=null)) { _data.writeInt(1); path.writeToParcel(_data, 0); } else { _data.writeInt(0); } mRemote.transact(Stub.TRANSACTION_addMediaPath, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } } @Override public java.lang.String getDurationTime() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); java.lang.String _result; try { _data.writeInterfaceToken(DESCRIPTOR); mRemote.transact(Stub.TRANSACTION_getDurationTime, _data, _reply, 0); _reply.readException(); _result = _reply.readString(); } finally { _reply.recycle(); _data.recycle(); } return _result; } @Override public int getDuration() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); int _result; try { _data.writeInterfaceToken(DESCRIPTOR); mRemote.transact(Stub.TRANSACTION_getDuration, _data, _reply, 0); _reply.readException(); _result = _reply.readInt(); } finally { _reply.recycle(); _data.recycle(); } return _result; } @Override public void sendPlayStateBrocast() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); mRemote.transact(Stub.TRANSACTION_sendPlayStateBrocast, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } } @Override public void setSourceType(int playMode) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(playMode); mRemote.transact(Stub.TRANSACTION_setSourceType, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } } @Override public int getSourceType() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); int _result; try { _data.writeInterfaceToken(DESCRIPTOR); mRemote.transact(Stub.TRANSACTION_getSourceType, _data, _reply, 0); _reply.readException(); _result = _reply.readInt(); } finally { _reply.recycle(); _data.recycle(); } return _result; } @Override public void exit() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); mRemote.transact(Stub.TRANSACTION_exit, _data, _reply, 0); _reply.readException(); } finally { _reply.recycle(); _data.recycle(); } } } static final int TRANSACTION_play = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_reset = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); static final int TRANSACTION_stop = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2); static final int TRANSACTION_pause = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3); static final int TRANSACTION_Prev = (android.os.IBinder.FIRST_CALL_TRANSACTION + 4); static final int TRANSACTION_next = (android.os.IBinder.FIRST_CALL_TRANSACTION + 5); static final int TRANSACTION_isPlaying = (android.os.IBinder.FIRST_CALL_TRANSACTION + 6); static final int TRANSACTION_isPause = (android.os.IBinder.FIRST_CALL_TRANSACTION + 7); static final int TRANSACTION_forward = (android.os.IBinder.FIRST_CALL_TRANSACTION + 8); static final int TRANSACTION_rewind = (android.os.IBinder.FIRST_CALL_TRANSACTION + 9); static final int TRANSACTION_getPlayingSong = (android.os.IBinder.FIRST_CALL_TRANSACTION + 10); static final int TRANSACTION_getPlayingSongIndex = (android.os.IBinder.FIRST_CALL_TRANSACTION + 11); static final int TRANSACTION_setPlayingSong = (android.os.IBinder.FIRST_CALL_TRANSACTION + 12); static final int TRANSACTION_setMediaPathList = (android.os.IBinder.FIRST_CALL_TRANSACTION + 13); static final int TRANSACTION_getCurrentTime = (android.os.IBinder.FIRST_CALL_TRANSACTION + 14); static final int TRANSACTION_getCurrentPosition = (android.os.IBinder.FIRST_CALL_TRANSACTION + 15); static final int TRANSACTION_setPlayMode = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16); static final int TRANSACTION_getPlayMode = (android.os.IBinder.FIRST_CALL_TRANSACTION + 17); static final int TRANSACTION_addMediaPathList = (android.os.IBinder.FIRST_CALL_TRANSACTION + 18); static final int TRANSACTION_removeMediaPath = (android.os.IBinder.FIRST_CALL_TRANSACTION + 19); static final int TRANSACTION_addMediaPath = (android.os.IBinder.FIRST_CALL_TRANSACTION + 20); static final int TRANSACTION_getDurationTime = (android.os.IBinder.FIRST_CALL_TRANSACTION + 21); static final int TRANSACTION_getDuration = (android.os.IBinder.FIRST_CALL_TRANSACTION + 22); static final int TRANSACTION_sendPlayStateBrocast = (android.os.IBinder.FIRST_CALL_TRANSACTION + 23); static final int TRANSACTION_setSourceType = (android.os.IBinder.FIRST_CALL_TRANSACTION + 24); static final int TRANSACTION_getSourceType = (android.os.IBinder.FIRST_CALL_TRANSACTION + 25); static final int TRANSACTION_exit = (android.os.IBinder.FIRST_CALL_TRANSACTION + 26); } public void play() throws android.os.RemoteException; public void reset() throws android.os.RemoteException; public void stop() throws android.os.RemoteException; public void pause() throws android.os.RemoteException; public void Prev() throws android.os.RemoteException; public void next() throws android.os.RemoteException; public boolean isPlaying() throws android.os.RemoteException; public boolean isPause() throws android.os.RemoteException; public void forward(int time) throws android.os.RemoteException; public void rewind(int time) throws android.os.RemoteException; public com.zhakui.OnlyMusic.data.Song getPlayingSong() throws android.os.RemoteException; public int getPlayingSongIndex() throws android.os.RemoteException; public void setPlayingSong(com.zhakui.OnlyMusic.data.Song path) throws android.os.RemoteException; public void setMediaPathList(java.util.List<com.zhakui.OnlyMusic.data.Song> pathList) throws android.os.RemoteException; public java.lang.String getCurrentTime() throws android.os.RemoteException; public int getCurrentPosition() throws android.os.RemoteException; public void setPlayMode(int playMode) throws android.os.RemoteException; public int getPlayMode() throws android.os.RemoteException; public void addMediaPathList(java.util.List<com.zhakui.OnlyMusic.data.Song> pathList) throws android.os.RemoteException; public void removeMediaPath(int index) throws android.os.RemoteException; public void addMediaPath(com.zhakui.OnlyMusic.data.Song path) throws android.os.RemoteException; public java.lang.String getDurationTime() throws android.os.RemoteException; public int getDuration() throws android.os.RemoteException; public void sendPlayStateBrocast() throws android.os.RemoteException; public void setSourceType(int playMode) throws android.os.RemoteException; public int getSourceType() throws android.os.RemoteException; public void exit() throws android.os.RemoteException; }
[ "zhkui@zhkui.com" ]
zhkui@zhkui.com
f11e15cc8e2c4571f6981a697f596bb3ccb95874
8ab425f401a0f18db472c457942d659bf0872fd3
/src/main/java/com/example/IssueManagement/api/ProjectControllerVersioned.java
a55653876b773bfc12fd9eeca5af894ecd967b99
[]
no_license
erdasonur/IssueManagement
c12ddfa922c55365ac096d18ac940d21767d1dc4
11a238e54a2d789874e28488c2f000e708c56607
refs/heads/master
2023-02-24T07:48:02.706246
2021-01-30T20:51:47
2021-01-30T20:51:47
316,796,801
0
0
null
null
null
null
UTF-8
Java
false
false
1,610
java
package com.example.IssueManagement.api; import com.example.IssueManagement.dto.ProjectDto; import com.example.IssueManagement.impl.ProjectServiceImpl; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("/project/versioning") @Api() public class ProjectControllerVersioned { private final ProjectServiceImpl projectServiceImpl; public ProjectControllerVersioned(ProjectServiceImpl projectServiceImpl) { this.projectServiceImpl = projectServiceImpl; } @ApiOperation(value = "Get By Id Operation V1", response = ProjectDto.class) @GetMapping(value = "/{id}", params = "version=1") public ResponseEntity<ProjectDto> getByIdV1(@PathVariable("id") Long id){ ProjectDto projectDto = projectServiceImpl.getById(id); System.out.println("V1"); return ResponseEntity.ok(projectDto); } //TODO Yeni Dto ve Service layerı eklenecek @ApiOperation(value = "Get By Id Operation V2", response = ProjectDto.class) @GetMapping(value = "/{id}", params = "version=2") public ResponseEntity<ProjectDto> getByIdV2(@PathVariable("id") Long id){ ProjectDto projectDto = projectServiceImpl.getById(id); System.out.println("V2"); return ResponseEntity.ok(projectDto); } }
[ "onur.erdas03@gmail.com" ]
onur.erdas03@gmail.com
8fb3c71e964c47c2d549cabfb9940932d7714ed0
524c1f9259338de92ae63c8eb54ef0a9887823bc
/src/com/owb/playhelp/shared/exceptions/NoUserException.java
cb71bf4eb3cd1fa52460a7dcb305fdbbcc1ee71b
[]
no_license
Ivan78/owb-master
f7894eb70f4f22d5ad2c6796da68ba50c042b8a9
cafa34e16e61d3a10e115273ae2593831c4655cb
refs/heads/master
2021-01-01T06:39:11.589911
2013-10-03T17:58:36
2013-10-03T17:58:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
406
java
package com.owb.playhelp.shared.exceptions; import java.io.Serializable; @SuppressWarnings("serial") public class NoUserException extends Exception implements Serializable{ public NoUserException(){ } public NoUserException(String msg){ super(msg); } public NoUserException(String msg, Throwable th){ super(msg, th); } public NoUserException(Throwable th){ super(th); } }
[ "liberation_point@yahoo.com" ]
liberation_point@yahoo.com
6789ef09cb27df34bf201150a52b9778b24c7c96
a77677897822795d01bcf3d35aee76382e0fbe99
/app/src/main/java/com/testspace/debugkeyboard/service/Bootstrapper.java
47016c9ef8d20f65ef158e71f2b5f822886eacd8
[]
no_license
ilya-t/android_DebugKeyboard
f34efcde518799abb9bf0daec035c14475724d72
e05fb47b20223713b72b1723d12b71c2f5f39110
refs/heads/master
2021-01-13T15:27:01.735472
2020-05-23T10:13:06
2020-05-23T10:45:10
80,198,955
3
0
null
null
null
null
UTF-8
Java
false
false
429
java
package com.testspace.debugkeyboard.service; import com.testspace.debugkeyboard.input.RandowWordInserter; import com.testspace.debugkeyboard.RootViewController; import javax.inject.Inject; import javax.inject.Singleton; /** * Component services bootstrapping. */ @Singleton class Bootstrapper { @Inject Bootstrapper(RootViewController rootViewController, RandowWordInserter randowWordInserter) {} }
[ "extraletters@gmail.com" ]
extraletters@gmail.com
63314f8e7f1fb3511eec2e117edb56e7b75b1e01
86f39b6d8e4cf0edd7292d8e8c3656bc53c656c7
/app/src/main/java/com/example/user/musicplayer/PlayerService.java
78366967d35b68e3da3794cde4e2f0c97fd2b4b4
[]
no_license
royalkonina/MusicPlayer
55ddcbe887a31ddeff96e5a7de46218b7df4d932
806b7e0b34bb77cf8b14ae926bf63db369652fb2
refs/heads/master
2021-01-11T17:38:18.128066
2017-01-30T10:39:19
2017-01-30T10:39:19
79,810,386
0
0
null
null
null
null
UTF-8
Java
false
false
7,200
java
package com.example.user.musicplayer; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.app.Service; import android.content.Context; import android.content.Intent; import android.media.MediaMetadataRetriever; import android.media.MediaPlayer; import android.net.Uri; import android.os.Binder; import android.os.IBinder; import android.support.annotation.Nullable; import android.util.Log; import android.view.View; import android.widget.RemoteViews; import java.io.IOException; public class PlayerService extends Service { private MediaPlayer mediaPlayer; private int status = PlayerActivity.STATUS_IDLE; public static final int NOTIFICATION_ID = 214; private static final Uri MUSIC_FILE = Uri.parse("android.resource://com.example.user.musicplayer/raw/sample_music_file"); private RemoteViews remoteViews; private Notification notification; private NotificationManager notificationManager; @Override public void onCreate() { notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); startForeground(NOTIFICATION_ID, getNotification()); mediaPlayer = new MediaPlayer(); try { mediaPlayer.setDataSource(getApplicationContext(), MUSIC_FILE); } catch (IOException e) { e.printStackTrace(); } mediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { @Override public void onCompletion(MediaPlayer mediaPlayer) { sendBroadcast(new Intent(PlayerActivity.ACTION_STATUS).putExtra(PlayerActivity.EXTRA_STATUS, PlayerActivity.STATUS_STOPPED)); stopForeground(true); } }); super.onCreate(); } @Override public void onDestroy() { mediaPlayer.stop(); mediaPlayer.release(); mediaPlayer = null; super.onDestroy(); } @Override public int onStartCommand(Intent intent, int flags, int startId) { if (intent.getAction() != null && intent.getAction().equals(PlayerActivity.ACTION_STATUS)) { int newStatus = intent.getIntExtra(PlayerActivity.EXTRA_STATUS, PlayerActivity.STATUS_IDLE); switch (newStatus) { case PlayerActivity.STATUS_IDLE: //do nothing break; case PlayerActivity.STATUS_PAUSED: mediaPlayer.pause(); break; case PlayerActivity.STATUS_STOPPED: mediaPlayer.seekTo(0); mediaPlayer.stop(); stopForeground(true); break; case PlayerActivity.STATUS_PLAYING: if (status == PlayerActivity.STATUS_IDLE || status == PlayerActivity.STATUS_STOPPED) { try { Log.d("status", String.valueOf(status)); mediaPlayer.prepare(); } catch (IOException e) { e.printStackTrace(); } } startForeground(NOTIFICATION_ID, getNotification()); mediaPlayer.start(); new Thread(new Runnable() { @Override public void run() { while (mediaPlayer.isPlaying()) { sendBroadcast(new Intent(PlayerActivity.ACTION_PROGRESS).putExtra(PlayerActivity.EXTRA_SEEKBAR_PROGRESS, mediaPlayer.getCurrentPosition() / 1000)); } } }).start(); break; } status = newStatus; updateNotificationViews(); sendBroadcast(new Intent(PlayerActivity.ACTION_STATUS).putExtra(PlayerActivity.EXTRA_STATUS, status)); } else { int currentTime = intent.getIntExtra(PlayerActivity.EXTRA_SEEKBAR_PROGRESS, 0); mediaPlayer.seekTo(currentTime * 1000); } return super.onStartCommand(intent, flags, startId); } private void updateNotificationViews() { switch (status) { case PlayerActivity.STATUS_PLAYING: remoteViews.setViewVisibility(R.id.b_play_notification, View.GONE); remoteViews.setViewVisibility(R.id.b_pause_notification, View.VISIBLE); remoteViews.setViewVisibility(R.id.b_stop_notification, View.VISIBLE); break; case PlayerActivity.STATUS_STOPPED: remoteViews.setViewVisibility(R.id.b_play_notification, View.VISIBLE); remoteViews.setViewVisibility(R.id.b_pause_notification, View.GONE); remoteViews.setViewVisibility(R.id.b_stop_notification, View.GONE); break; case PlayerActivity.STATUS_PAUSED: remoteViews.setViewVisibility(R.id.b_play_notification, View.VISIBLE); remoteViews.setViewVisibility(R.id.b_pause_notification, View.GONE); remoteViews.setViewVisibility(R.id.b_stop_notification, View.VISIBLE); break; default: remoteViews.setViewVisibility(R.id.b_play_notification, View.VISIBLE); remoteViews.setViewVisibility(R.id.b_pause_notification, View.GONE); remoteViews.setViewVisibility(R.id.b_stop_notification, View.GONE); break; } notificationManager.notify(NOTIFICATION_ID, notification); } private Notification getNotification() { if (remoteViews == null || notification == null) { remoteViews = new RemoteViews(getPackageName(), R.layout.notification_panel); Notification.Builder builder = new Notification.Builder(this); builder.setSmallIcon(R.mipmap.ic_launcher) .setContent(remoteViews); notification = builder.build(); Intent stopIntent = new Intent(getApplicationContext(), PlayerService.class); stopIntent.setAction(PlayerActivity.ACTION_STATUS); stopIntent.putExtra(PlayerActivity.EXTRA_STATUS, PlayerActivity.STATUS_STOPPED); remoteViews.setOnClickPendingIntent(R.id.b_stop_notification, PendingIntent.getService(this, 0, stopIntent, 0)); Intent pauseIntent = new Intent(getApplicationContext(), PlayerService.class); pauseIntent.setAction(PlayerActivity.ACTION_STATUS); pauseIntent.putExtra(PlayerActivity.EXTRA_STATUS, PlayerActivity.STATUS_PAUSED); remoteViews.setOnClickPendingIntent(R.id.b_pause_notification, PendingIntent.getService(this, 1, pauseIntent, 0)); Intent playIntent = new Intent(getApplicationContext(), PlayerService.class); playIntent.setAction(PlayerActivity.ACTION_STATUS); playIntent.putExtra(PlayerActivity.EXTRA_STATUS, PlayerActivity.STATUS_PLAYING); remoteViews.setOnClickPendingIntent(R.id.b_play_notification, PendingIntent.getService(this, 2, playIntent, 0)); } updateNotificationViews(); return notification; } @Nullable @Override public IBinder onBind(Intent intent) { return new PlayerBinder(); } class PlayerBinder extends Binder { public PlayerBinder() { } public int getStatus() { return status; } public int getAudioDuration() { MediaMetadataRetriever metaRetriever = new MediaMetadataRetriever(); metaRetriever.setDataSource(getApplicationContext(), MUSIC_FILE); return Integer.parseInt(metaRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION)) / 1000; } } }
[ "royalkonina@gmail.com" ]
royalkonina@gmail.com
4abd6cb109f524c9941ebfc593b927bbc2f4f5fb
9d405e11c62bbf23bc9e60237ffdc41d02b25a22
/EazeChartLibrary/src/org/eazegraph/lib/utils/Utils.java
bfe59a7ac1f3aad38fcac3407665c2916612f26a
[]
no_license
ZhuGongpu/HomeEnergyControl_Android
1694830a5d2c2161b0d02a224823507cb84373b8
54fbee3ae4c685bf55e750212a682f5383d4f62e
refs/heads/master
2020-06-01T23:59:41.030263
2014-09-21T09:11:29
2014-09-21T09:11:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,666
java
/** * * Copyright (C) 2014 Paul Cech * * 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.eazegraph.lib.utils; import android.annotation.SuppressLint; import android.content.res.Resources; import android.graphics.Paint; import android.graphics.Rect; import android.graphics.RectF; import android.os.Build; import android.view.View; import org.eazegraph.lib.models.BaseModel; import org.eazegraph.lib.models.Point2D; import java.util.List; /** * A helper class which consists of static helper methods. */ public class Utils { private static final String LOG_TAG = Utils.class.getSimpleName(); /** * Converts density-independent pixel (dp) to pixel (px) * * @param _Dp the dp value to convert in pixel * @return the converted value in pixels */ public static float dpToPx(float _Dp) { return _Dp * Resources.getSystem().getDisplayMetrics().density; } /** * Calculates the middle point between two points and multiplies its coordinates with the given * smoothness _Mulitplier. * * @param _P1 First point * @param _P2 Second point * @param _Result Resulting point * @param _Multiplier Smoothness multiplier */ public static void calculatePointDiff(Point2D _P1, Point2D _P2, Point2D _Result, float _Multiplier) { float diffX = _P2.getX() - _P1.getX(); float diffY = _P2.getY() - _P1.getY(); _Result.setX(_P1.getX() + (diffX * _Multiplier)); _Result.setY(_P1.getY() + (diffY * _Multiplier)); } /** * Helper method for translating (_X,_Y) scroll vectors into scalar rotation of a circle. * * @param _Dx The _X component of the current scroll vector. * @param _Dy The _Y component of the current scroll vector. * @param _X The _X position of the current touch, relative to the circle center. * @param _Y The _Y position of the current touch, relative to the circle center. * @return The scalar representing the change in angular position for this scroll. */ public static float vectorToScalarScroll(float _Dx, float _Dy, float _X, float _Y) { // get the length of the vector float l = (float) Math.sqrt(_Dx * _Dx + _Dy * _Dy); // decide if the scalar should be negative or positive by finding // the dot product of the vector perpendicular to (_X,_Y). float crossX = -_Y; float crossY = _X; float dot = (crossX * _Dx + crossY * _Dy); float sign = Math.signum(dot); return l * sign; } /** * Calculates the legend positions and which legend title should be displayed or not. * <p/> * Important: the LegendBounds in the _Models should be set and correctly calculated before this * function is called! * * @param _Models The graph data which should have the BaseModel class as parent class. * @param _StartX Left starting point on the screen. Should be the absolute pixel value! * @param _Paint The correctly set Paint which will be used for the text painting in the later process */ public static void calculateLegendInformation(List<? extends BaseModel> _Models, float _StartX, float _EndX, Paint _Paint) { float textMargin = Utils.dpToPx(10.f); float lastX = _StartX; // calculate the legend label positions and check if there is enough space to display the label, // if not the label will not be shown for (BaseModel model : _Models) { if (!model.isIgnore()) { Rect textBounds = new Rect(); RectF legendBounds = model.getLegendBounds(); _Paint.getTextBounds(model.getLegendLabel(), 0, model.getLegendLabel().length(), textBounds); model.setTextBounds(textBounds); float centerX = legendBounds.centerX(); float centeredTextPos = centerX - (textBounds.width() / 2); float textStartPos = centeredTextPos - textMargin; // check if the text is too big to fit on the screen if (centeredTextPos + textBounds.width() > _EndX - textMargin) { model.setShowLabel(false); } else { // check if the current legend label overrides the label before // if the label overrides the label before, the current label will not be shown. // If not the label will be shown and the label position is calculated if (textStartPos < lastX) { if (lastX + textMargin < legendBounds.left) { model.setLegendLabelPosition((int) (lastX + textMargin)); model.setShowLabel(true); lastX = lastX + textMargin + textBounds.width(); } else { model.setShowLabel(false); } } else { model.setShowLabel(true); model.setLegendLabelPosition((int) centeredTextPos); lastX = centerX + (textBounds.width() / 2); } } } } } /** * Returns an string with or without the decimal places. * * @param _value The value which should be converted * @param _showDecimal Indicates whether the decimal numbers should be shown or not * @return A generated string of the value. */ public static String getFloatString(float _value, boolean _showDecimal) { if (_showDecimal) { return _value + ""; } else { return ((int) _value) + ""; } } /** * Calculates the maximum text height which is possible based on the used Paint and its settings. * * @param _Paint Paint object which will be used to display a text. * @return Maximum text height in px. */ public static float calculateMaxTextHeight(Paint _Paint) { Rect height = new Rect(); String text = "MgHITasger"; _Paint.getTextBounds(text, 0, text.length(), height); return height.height(); } /** * Checks if a point is in the given rectangle. * * @param _Rect rectangle which is checked * @param _X x-coordinate of the point * @param _Y y-coordinate of the point * @return True if the points intersects with the rectangle. */ public static boolean intersectsPointWithRectF(RectF _Rect, float _X, float _Y) { return _X > _Rect.left && _X < _Rect.right && _Y > _Rect.top && _Y < _Rect.bottom; } @SuppressLint("NewApi") public static void setLayerToSW(View v) { if (!v.isInEditMode() && Build.VERSION.SDK_INT >= 11) { v.setLayerType(View.LAYER_TYPE_SOFTWARE, null); } } @SuppressLint("NewApi") public static void setLayerToHW(View v) { if (!v.isInEditMode() && Build.VERSION.SDK_INT >= 11) { v.setLayerType(View.LAYER_TYPE_HARDWARE, null); } } }
[ "zhugongpu@hotmail.com" ]
zhugongpu@hotmail.com
a0adab7dfddb9df2b812623139004a6058b94ee8
d29a088cb083bc58f12e930d42572456c0559158
/src/main/java/HighLevelApiSampleJava.java
a62cb547bc432fa2b72c095540e2af69338e087c
[]
no_license
Peranikov/dynamodb-scala-sample
30a7514ebe691849c2d02664984b971b75a82b89
d4a72b35b5ac07b2321b75c8ceb8e3c5445b5edd
refs/heads/master
2020-04-22T02:38:26.517783
2016-09-05T10:26:11
2016-09-05T10:27:38
67,018,875
0
0
null
null
null
null
UTF-8
Java
false
false
534
java
import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient; import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper; public class HighLevelApiSampleJava { public static void exec() { AmazonDynamoDBClient client = (new AmazonDynamoDBClient()) .withEndpoint("http://localhost:8000"); DynamoDBMapper mapper = new DynamoDBMapper(client); MusicItemJava musicItems = mapper.load(MusicItemJava.class, "Rainbow", "Kill the King"); System.out.println(musicItems); } }
[ "matsukubo@socket.co.jp" ]
matsukubo@socket.co.jp
366bd157e221f9cebf043203631acf38a4634dee
7187f68aa2b8fef7ccd03dc5b69dff480323cec2
/model-java/src/main/java/org/commonjava/cartographer/graph/preset/ScopedProjectFilterFactory.java
39e5a9fb2d592eda9267b97e6d299fc752df86df
[]
no_license
jsenko/cartographer
866e67a2793d2e5369e4c9c0a2519fadc99f969a
5164078399d36b67ddb55ed9f7df26b2ef44919d
refs/heads/master
2021-01-13T12:46:36.175479
2016-10-24T20:50:22
2016-10-24T20:50:22
72,440,234
0
0
null
2016-10-31T13:44:22
2016-10-31T13:44:22
null
UTF-8
Java
false
false
1,994
java
/** * Copyright (C) 2013 Red Hat, Inc. (jdcasey@commonjava.org) * * 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.commonjava.cartographer.graph.preset; import java.util.Map; import javax.enterprise.context.ApplicationScoped; import javax.inject.Named; import org.commonjava.atservice.annotation.Service; import org.commonjava.maven.atlas.graph.filter.ProjectRelationshipFilter; import org.commonjava.maven.atlas.ident.DependencyScope; @Named( "scope" ) @ApplicationScoped @Service( PresetFactory.class ) public class ScopedProjectFilterFactory implements PresetFactory { private static final String[] IDS = { "runtime", "test", "provided", "compile", "scope" }; @Override public String[] getPresetIds() { return IDS; } @Override public ProjectRelationshipFilter newFilter( final String presetId, final Map<String, Object> parameters ) { DependencyScope scope = (DependencyScope) parameters.get( CommonPresetParameters.SCOPE ); if ( scope == null ) { scope = DependencyScope.getScope( presetId ); if ( scope == null ) { scope = DependencyScope.runtime; } } Boolean managed = (Boolean) parameters.get( CommonPresetParameters.MANAGED ); if ( managed == null ) { managed = presetId.startsWith( "managed" ); } return new ScopedProjectFilter( scope, managed ); } }
[ "jdcasey@commonjava.org" ]
jdcasey@commonjava.org
8a90d3ca3867eda38d255c782c79f87731b5ab3b
d054dce115a90fac16dab1b1d0fc078b0473e3fa
/src/test/java/com/francislagueu/pets/PetsApplicationTests.java
38630695c6ec01d42e85c3bb379174d4e0673667
[]
no_license
francislagueu/pets
420f76da29ff6ca9cb54214986ce139e0164c149
7994d85ea5fa30ae9b812e22ccb2cab84fba9f23
refs/heads/master
2020-05-16T07:38:31.376168
2019-04-22T23:36:53
2019-04-22T23:36:53
182,884,118
0
0
null
null
null
null
UTF-8
Java
false
false
346
java
package com.francislagueu.pets; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class PetsApplicationTests { @Test public void contextLoads() { } }
[ "lagson6@yahoo.fr" ]
lagson6@yahoo.fr
f6a57f604580409f3786de3d30872174c2de3739
2965375a4e9dfba22e2bf9e4f72c6f45b64ff851
/src/main/java/jooq/performance_schema/tables/records/EventsTransactionsSummaryByHostByEventNameRecord.java
e4a0aae4cefbc3f8fb1531602fd5725a0556ec91
[]
no_license
HashimotoShogo/batch-processing
922af5cebae7b0c418ffcaad8b8dfd896ddfdc45
a5c9884c8b6eea80eae52f5311c0b1b704d2d951
refs/heads/master
2020-08-04T06:34:08.886101
2019-10-29T02:55:09
2019-10-29T02:55:09
212,040,231
0
1
null
2019-10-29T03:25:03
2019-10-01T07:48:55
Java
UTF-8
Java
false
true
22,567
java
/* * This file is generated by jOOQ. */ package jooq.performance_schema.tables.records; import javax.annotation.Generated; import jooq.performance_schema.tables.EventsTransactionsSummaryByHostByEventName; import org.jooq.Field; import org.jooq.Record17; import org.jooq.Row17; import org.jooq.impl.TableRecordImpl; import org.jooq.types.ULong; /** * This class is generated by jOOQ. */ @Generated( value = { "http://www.jooq.org", "jOOQ version:3.11.2" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class EventsTransactionsSummaryByHostByEventNameRecord extends TableRecordImpl<EventsTransactionsSummaryByHostByEventNameRecord> implements Record17<String, String, ULong, ULong, ULong, ULong, ULong, ULong, ULong, ULong, ULong, ULong, ULong, ULong, ULong, ULong, ULong> { private static final long serialVersionUID = 1382502428; /** * Setter for <code>performance_schema.events_transactions_summary_by_host_by_event_name.HOST</code>. */ public void setHost(String value) { set(0, value); } /** * Getter for <code>performance_schema.events_transactions_summary_by_host_by_event_name.HOST</code>. */ public String getHost() { return (String) get(0); } /** * Setter for <code>performance_schema.events_transactions_summary_by_host_by_event_name.EVENT_NAME</code>. */ public void setEventName(String value) { set(1, value); } /** * Getter for <code>performance_schema.events_transactions_summary_by_host_by_event_name.EVENT_NAME</code>. */ public String getEventName() { return (String) get(1); } /** * Setter for <code>performance_schema.events_transactions_summary_by_host_by_event_name.COUNT_STAR</code>. */ public void setCountStar(ULong value) { set(2, value); } /** * Getter for <code>performance_schema.events_transactions_summary_by_host_by_event_name.COUNT_STAR</code>. */ public ULong getCountStar() { return (ULong) get(2); } /** * Setter for <code>performance_schema.events_transactions_summary_by_host_by_event_name.SUM_TIMER_WAIT</code>. */ public void setSumTimerWait(ULong value) { set(3, value); } /** * Getter for <code>performance_schema.events_transactions_summary_by_host_by_event_name.SUM_TIMER_WAIT</code>. */ public ULong getSumTimerWait() { return (ULong) get(3); } /** * Setter for <code>performance_schema.events_transactions_summary_by_host_by_event_name.MIN_TIMER_WAIT</code>. */ public void setMinTimerWait(ULong value) { set(4, value); } /** * Getter for <code>performance_schema.events_transactions_summary_by_host_by_event_name.MIN_TIMER_WAIT</code>. */ public ULong getMinTimerWait() { return (ULong) get(4); } /** * Setter for <code>performance_schema.events_transactions_summary_by_host_by_event_name.AVG_TIMER_WAIT</code>. */ public void setAvgTimerWait(ULong value) { set(5, value); } /** * Getter for <code>performance_schema.events_transactions_summary_by_host_by_event_name.AVG_TIMER_WAIT</code>. */ public ULong getAvgTimerWait() { return (ULong) get(5); } /** * Setter for <code>performance_schema.events_transactions_summary_by_host_by_event_name.MAX_TIMER_WAIT</code>. */ public void setMaxTimerWait(ULong value) { set(6, value); } /** * Getter for <code>performance_schema.events_transactions_summary_by_host_by_event_name.MAX_TIMER_WAIT</code>. */ public ULong getMaxTimerWait() { return (ULong) get(6); } /** * Setter for <code>performance_schema.events_transactions_summary_by_host_by_event_name.COUNT_READ_WRITE</code>. */ public void setCountReadWrite(ULong value) { set(7, value); } /** * Getter for <code>performance_schema.events_transactions_summary_by_host_by_event_name.COUNT_READ_WRITE</code>. */ public ULong getCountReadWrite() { return (ULong) get(7); } /** * Setter for <code>performance_schema.events_transactions_summary_by_host_by_event_name.SUM_TIMER_READ_WRITE</code>. */ public void setSumTimerReadWrite(ULong value) { set(8, value); } /** * Getter for <code>performance_schema.events_transactions_summary_by_host_by_event_name.SUM_TIMER_READ_WRITE</code>. */ public ULong getSumTimerReadWrite() { return (ULong) get(8); } /** * Setter for <code>performance_schema.events_transactions_summary_by_host_by_event_name.MIN_TIMER_READ_WRITE</code>. */ public void setMinTimerReadWrite(ULong value) { set(9, value); } /** * Getter for <code>performance_schema.events_transactions_summary_by_host_by_event_name.MIN_TIMER_READ_WRITE</code>. */ public ULong getMinTimerReadWrite() { return (ULong) get(9); } /** * Setter for <code>performance_schema.events_transactions_summary_by_host_by_event_name.AVG_TIMER_READ_WRITE</code>. */ public void setAvgTimerReadWrite(ULong value) { set(10, value); } /** * Getter for <code>performance_schema.events_transactions_summary_by_host_by_event_name.AVG_TIMER_READ_WRITE</code>. */ public ULong getAvgTimerReadWrite() { return (ULong) get(10); } /** * Setter for <code>performance_schema.events_transactions_summary_by_host_by_event_name.MAX_TIMER_READ_WRITE</code>. */ public void setMaxTimerReadWrite(ULong value) { set(11, value); } /** * Getter for <code>performance_schema.events_transactions_summary_by_host_by_event_name.MAX_TIMER_READ_WRITE</code>. */ public ULong getMaxTimerReadWrite() { return (ULong) get(11); } /** * Setter for <code>performance_schema.events_transactions_summary_by_host_by_event_name.COUNT_READ_ONLY</code>. */ public void setCountReadOnly(ULong value) { set(12, value); } /** * Getter for <code>performance_schema.events_transactions_summary_by_host_by_event_name.COUNT_READ_ONLY</code>. */ public ULong getCountReadOnly() { return (ULong) get(12); } /** * Setter for <code>performance_schema.events_transactions_summary_by_host_by_event_name.SUM_TIMER_READ_ONLY</code>. */ public void setSumTimerReadOnly(ULong value) { set(13, value); } /** * Getter for <code>performance_schema.events_transactions_summary_by_host_by_event_name.SUM_TIMER_READ_ONLY</code>. */ public ULong getSumTimerReadOnly() { return (ULong) get(13); } /** * Setter for <code>performance_schema.events_transactions_summary_by_host_by_event_name.MIN_TIMER_READ_ONLY</code>. */ public void setMinTimerReadOnly(ULong value) { set(14, value); } /** * Getter for <code>performance_schema.events_transactions_summary_by_host_by_event_name.MIN_TIMER_READ_ONLY</code>. */ public ULong getMinTimerReadOnly() { return (ULong) get(14); } /** * Setter for <code>performance_schema.events_transactions_summary_by_host_by_event_name.AVG_TIMER_READ_ONLY</code>. */ public void setAvgTimerReadOnly(ULong value) { set(15, value); } /** * Getter for <code>performance_schema.events_transactions_summary_by_host_by_event_name.AVG_TIMER_READ_ONLY</code>. */ public ULong getAvgTimerReadOnly() { return (ULong) get(15); } /** * Setter for <code>performance_schema.events_transactions_summary_by_host_by_event_name.MAX_TIMER_READ_ONLY</code>. */ public void setMaxTimerReadOnly(ULong value) { set(16, value); } /** * Getter for <code>performance_schema.events_transactions_summary_by_host_by_event_name.MAX_TIMER_READ_ONLY</code>. */ public ULong getMaxTimerReadOnly() { return (ULong) get(16); } // ------------------------------------------------------------------------- // Record17 type implementation // ------------------------------------------------------------------------- /** * {@inheritDoc} */ @Override public Row17<String, String, ULong, ULong, ULong, ULong, ULong, ULong, ULong, ULong, ULong, ULong, ULong, ULong, ULong, ULong, ULong> fieldsRow() { return (Row17) super.fieldsRow(); } /** * {@inheritDoc} */ @Override public Row17<String, String, ULong, ULong, ULong, ULong, ULong, ULong, ULong, ULong, ULong, ULong, ULong, ULong, ULong, ULong, ULong> valuesRow() { return (Row17) super.valuesRow(); } /** * {@inheritDoc} */ @Override public Field<String> field1() { return EventsTransactionsSummaryByHostByEventName.EVENTS_TRANSACTIONS_SUMMARY_BY_HOST_BY_EVENT_NAME.HOST; } /** * {@inheritDoc} */ @Override public Field<String> field2() { return EventsTransactionsSummaryByHostByEventName.EVENTS_TRANSACTIONS_SUMMARY_BY_HOST_BY_EVENT_NAME.EVENT_NAME; } /** * {@inheritDoc} */ @Override public Field<ULong> field3() { return EventsTransactionsSummaryByHostByEventName.EVENTS_TRANSACTIONS_SUMMARY_BY_HOST_BY_EVENT_NAME.COUNT_STAR; } /** * {@inheritDoc} */ @Override public Field<ULong> field4() { return EventsTransactionsSummaryByHostByEventName.EVENTS_TRANSACTIONS_SUMMARY_BY_HOST_BY_EVENT_NAME.SUM_TIMER_WAIT; } /** * {@inheritDoc} */ @Override public Field<ULong> field5() { return EventsTransactionsSummaryByHostByEventName.EVENTS_TRANSACTIONS_SUMMARY_BY_HOST_BY_EVENT_NAME.MIN_TIMER_WAIT; } /** * {@inheritDoc} */ @Override public Field<ULong> field6() { return EventsTransactionsSummaryByHostByEventName.EVENTS_TRANSACTIONS_SUMMARY_BY_HOST_BY_EVENT_NAME.AVG_TIMER_WAIT; } /** * {@inheritDoc} */ @Override public Field<ULong> field7() { return EventsTransactionsSummaryByHostByEventName.EVENTS_TRANSACTIONS_SUMMARY_BY_HOST_BY_EVENT_NAME.MAX_TIMER_WAIT; } /** * {@inheritDoc} */ @Override public Field<ULong> field8() { return EventsTransactionsSummaryByHostByEventName.EVENTS_TRANSACTIONS_SUMMARY_BY_HOST_BY_EVENT_NAME.COUNT_READ_WRITE; } /** * {@inheritDoc} */ @Override public Field<ULong> field9() { return EventsTransactionsSummaryByHostByEventName.EVENTS_TRANSACTIONS_SUMMARY_BY_HOST_BY_EVENT_NAME.SUM_TIMER_READ_WRITE; } /** * {@inheritDoc} */ @Override public Field<ULong> field10() { return EventsTransactionsSummaryByHostByEventName.EVENTS_TRANSACTIONS_SUMMARY_BY_HOST_BY_EVENT_NAME.MIN_TIMER_READ_WRITE; } /** * {@inheritDoc} */ @Override public Field<ULong> field11() { return EventsTransactionsSummaryByHostByEventName.EVENTS_TRANSACTIONS_SUMMARY_BY_HOST_BY_EVENT_NAME.AVG_TIMER_READ_WRITE; } /** * {@inheritDoc} */ @Override public Field<ULong> field12() { return EventsTransactionsSummaryByHostByEventName.EVENTS_TRANSACTIONS_SUMMARY_BY_HOST_BY_EVENT_NAME.MAX_TIMER_READ_WRITE; } /** * {@inheritDoc} */ @Override public Field<ULong> field13() { return EventsTransactionsSummaryByHostByEventName.EVENTS_TRANSACTIONS_SUMMARY_BY_HOST_BY_EVENT_NAME.COUNT_READ_ONLY; } /** * {@inheritDoc} */ @Override public Field<ULong> field14() { return EventsTransactionsSummaryByHostByEventName.EVENTS_TRANSACTIONS_SUMMARY_BY_HOST_BY_EVENT_NAME.SUM_TIMER_READ_ONLY; } /** * {@inheritDoc} */ @Override public Field<ULong> field15() { return EventsTransactionsSummaryByHostByEventName.EVENTS_TRANSACTIONS_SUMMARY_BY_HOST_BY_EVENT_NAME.MIN_TIMER_READ_ONLY; } /** * {@inheritDoc} */ @Override public Field<ULong> field16() { return EventsTransactionsSummaryByHostByEventName.EVENTS_TRANSACTIONS_SUMMARY_BY_HOST_BY_EVENT_NAME.AVG_TIMER_READ_ONLY; } /** * {@inheritDoc} */ @Override public Field<ULong> field17() { return EventsTransactionsSummaryByHostByEventName.EVENTS_TRANSACTIONS_SUMMARY_BY_HOST_BY_EVENT_NAME.MAX_TIMER_READ_ONLY; } /** * {@inheritDoc} */ @Override public String component1() { return getHost(); } /** * {@inheritDoc} */ @Override public String component2() { return getEventName(); } /** * {@inheritDoc} */ @Override public ULong component3() { return getCountStar(); } /** * {@inheritDoc} */ @Override public ULong component4() { return getSumTimerWait(); } /** * {@inheritDoc} */ @Override public ULong component5() { return getMinTimerWait(); } /** * {@inheritDoc} */ @Override public ULong component6() { return getAvgTimerWait(); } /** * {@inheritDoc} */ @Override public ULong component7() { return getMaxTimerWait(); } /** * {@inheritDoc} */ @Override public ULong component8() { return getCountReadWrite(); } /** * {@inheritDoc} */ @Override public ULong component9() { return getSumTimerReadWrite(); } /** * {@inheritDoc} */ @Override public ULong component10() { return getMinTimerReadWrite(); } /** * {@inheritDoc} */ @Override public ULong component11() { return getAvgTimerReadWrite(); } /** * {@inheritDoc} */ @Override public ULong component12() { return getMaxTimerReadWrite(); } /** * {@inheritDoc} */ @Override public ULong component13() { return getCountReadOnly(); } /** * {@inheritDoc} */ @Override public ULong component14() { return getSumTimerReadOnly(); } /** * {@inheritDoc} */ @Override public ULong component15() { return getMinTimerReadOnly(); } /** * {@inheritDoc} */ @Override public ULong component16() { return getAvgTimerReadOnly(); } /** * {@inheritDoc} */ @Override public ULong component17() { return getMaxTimerReadOnly(); } /** * {@inheritDoc} */ @Override public String value1() { return getHost(); } /** * {@inheritDoc} */ @Override public String value2() { return getEventName(); } /** * {@inheritDoc} */ @Override public ULong value3() { return getCountStar(); } /** * {@inheritDoc} */ @Override public ULong value4() { return getSumTimerWait(); } /** * {@inheritDoc} */ @Override public ULong value5() { return getMinTimerWait(); } /** * {@inheritDoc} */ @Override public ULong value6() { return getAvgTimerWait(); } /** * {@inheritDoc} */ @Override public ULong value7() { return getMaxTimerWait(); } /** * {@inheritDoc} */ @Override public ULong value8() { return getCountReadWrite(); } /** * {@inheritDoc} */ @Override public ULong value9() { return getSumTimerReadWrite(); } /** * {@inheritDoc} */ @Override public ULong value10() { return getMinTimerReadWrite(); } /** * {@inheritDoc} */ @Override public ULong value11() { return getAvgTimerReadWrite(); } /** * {@inheritDoc} */ @Override public ULong value12() { return getMaxTimerReadWrite(); } /** * {@inheritDoc} */ @Override public ULong value13() { return getCountReadOnly(); } /** * {@inheritDoc} */ @Override public ULong value14() { return getSumTimerReadOnly(); } /** * {@inheritDoc} */ @Override public ULong value15() { return getMinTimerReadOnly(); } /** * {@inheritDoc} */ @Override public ULong value16() { return getAvgTimerReadOnly(); } /** * {@inheritDoc} */ @Override public ULong value17() { return getMaxTimerReadOnly(); } /** * {@inheritDoc} */ @Override public EventsTransactionsSummaryByHostByEventNameRecord value1(String value) { setHost(value); return this; } /** * {@inheritDoc} */ @Override public EventsTransactionsSummaryByHostByEventNameRecord value2(String value) { setEventName(value); return this; } /** * {@inheritDoc} */ @Override public EventsTransactionsSummaryByHostByEventNameRecord value3(ULong value) { setCountStar(value); return this; } /** * {@inheritDoc} */ @Override public EventsTransactionsSummaryByHostByEventNameRecord value4(ULong value) { setSumTimerWait(value); return this; } /** * {@inheritDoc} */ @Override public EventsTransactionsSummaryByHostByEventNameRecord value5(ULong value) { setMinTimerWait(value); return this; } /** * {@inheritDoc} */ @Override public EventsTransactionsSummaryByHostByEventNameRecord value6(ULong value) { setAvgTimerWait(value); return this; } /** * {@inheritDoc} */ @Override public EventsTransactionsSummaryByHostByEventNameRecord value7(ULong value) { setMaxTimerWait(value); return this; } /** * {@inheritDoc} */ @Override public EventsTransactionsSummaryByHostByEventNameRecord value8(ULong value) { setCountReadWrite(value); return this; } /** * {@inheritDoc} */ @Override public EventsTransactionsSummaryByHostByEventNameRecord value9(ULong value) { setSumTimerReadWrite(value); return this; } /** * {@inheritDoc} */ @Override public EventsTransactionsSummaryByHostByEventNameRecord value10(ULong value) { setMinTimerReadWrite(value); return this; } /** * {@inheritDoc} */ @Override public EventsTransactionsSummaryByHostByEventNameRecord value11(ULong value) { setAvgTimerReadWrite(value); return this; } /** * {@inheritDoc} */ @Override public EventsTransactionsSummaryByHostByEventNameRecord value12(ULong value) { setMaxTimerReadWrite(value); return this; } /** * {@inheritDoc} */ @Override public EventsTransactionsSummaryByHostByEventNameRecord value13(ULong value) { setCountReadOnly(value); return this; } /** * {@inheritDoc} */ @Override public EventsTransactionsSummaryByHostByEventNameRecord value14(ULong value) { setSumTimerReadOnly(value); return this; } /** * {@inheritDoc} */ @Override public EventsTransactionsSummaryByHostByEventNameRecord value15(ULong value) { setMinTimerReadOnly(value); return this; } /** * {@inheritDoc} */ @Override public EventsTransactionsSummaryByHostByEventNameRecord value16(ULong value) { setAvgTimerReadOnly(value); return this; } /** * {@inheritDoc} */ @Override public EventsTransactionsSummaryByHostByEventNameRecord value17(ULong value) { setMaxTimerReadOnly(value); return this; } /** * {@inheritDoc} */ @Override public EventsTransactionsSummaryByHostByEventNameRecord values(String value1, String value2, ULong value3, ULong value4, ULong value5, ULong value6, ULong value7, ULong value8, ULong value9, ULong value10, ULong value11, ULong value12, ULong value13, ULong value14, ULong value15, ULong value16, ULong value17) { value1(value1); value2(value2); value3(value3); value4(value4); value5(value5); value6(value6); value7(value7); value8(value8); value9(value9); value10(value10); value11(value11); value12(value12); value13(value13); value14(value14); value15(value15); value16(value16); value17(value17); return this; } // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- /** * Create a detached EventsTransactionsSummaryByHostByEventNameRecord */ public EventsTransactionsSummaryByHostByEventNameRecord() { super(EventsTransactionsSummaryByHostByEventName.EVENTS_TRANSACTIONS_SUMMARY_BY_HOST_BY_EVENT_NAME); } /** * Create a detached, initialised EventsTransactionsSummaryByHostByEventNameRecord */ public EventsTransactionsSummaryByHostByEventNameRecord(String host, String eventName, ULong countStar, ULong sumTimerWait, ULong minTimerWait, ULong avgTimerWait, ULong maxTimerWait, ULong countReadWrite, ULong sumTimerReadWrite, ULong minTimerReadWrite, ULong avgTimerReadWrite, ULong maxTimerReadWrite, ULong countReadOnly, ULong sumTimerReadOnly, ULong minTimerReadOnly, ULong avgTimerReadOnly, ULong maxTimerReadOnly) { super(EventsTransactionsSummaryByHostByEventName.EVENTS_TRANSACTIONS_SUMMARY_BY_HOST_BY_EVENT_NAME); set(0, host); set(1, eventName); set(2, countStar); set(3, sumTimerWait); set(4, minTimerWait); set(5, avgTimerWait); set(6, maxTimerWait); set(7, countReadWrite); set(8, sumTimerReadWrite); set(9, minTimerReadWrite); set(10, avgTimerReadWrite); set(11, maxTimerReadWrite); set(12, countReadOnly); set(13, sumTimerReadOnly); set(14, minTimerReadOnly); set(15, avgTimerReadOnly); set(16, maxTimerReadOnly); } }
[ "shogo.hashimoto@money-design.com" ]
shogo.hashimoto@money-design.com
ab1341aeb2db8809c7e5630fb453e72117b2d90d
39b6bc2d1b59c419c2f26154f95c1994d9fa8c78
/xpath-lang/src/main/java/org/intellij/lang/xpath/psi/XPathVariableHolder.java
54f08e70b1986a8845f9648800f407d801d5594d
[ "Apache-2.0" ]
permissive
consulo/consulo-xpath
6ab5b854eedfc6cb6952661e65144bc59f1eabeb
a6bfc5b013fde798b20d7ba273962b8b6a833fcf
refs/heads/master
2023-08-16T12:50:11.186300
2023-05-16T18:24:04
2023-05-16T18:24:04
13,907,956
0
0
null
null
null
null
UTF-8
Java
false
false
861
java
/* * Copyright 2000-2011 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.intellij.lang.xpath.psi; import javax.annotation.Nonnull; /* * Created by IntelliJ IDEA. * User: sweinreuter * Date: 28.04.11 */ public interface XPathVariableHolder extends XPathElement { @Nonnull XPathVariableDeclaration[] getVariables(); }
[ "vistall.valeriy@gmail.com" ]
vistall.valeriy@gmail.com
20ee90618b6a868cf68cf9512f3cca087ba97038
c8b3c8cc389bedc3ec03e307f7b55de1c6f9dd91
/Assignment 1/Myproj/src/Task1/SumOfNatural.java
d705f718a7c3eef8c3ea19cece705444a40c8329
[]
no_license
Anwar1804/Homework2-3
85415709dc737b5f2dfcfb352e41489febdf1192
aaea8104c4f5ebe07a905640744e8ab6764726f1
refs/heads/main
2022-12-22T01:48:56.668599
2020-10-05T14:41:34
2020-10-05T14:41:34
301,433,387
0
0
null
null
null
null
UTF-8
Java
false
false
368
java
package Task1; import java.util.Scanner; public class SumOfNatural { public static void main(String[] args) { int sum=0,i,num=0; Scanner sc= new Scanner(System.in); System.out.println("Enter natural number: "); num=sc.nextInt(); for(i=1;i<=num;i++) { sum=sum+i; } System.out.println("Sum of Natural Number is :"+sum); } }
[ "noreply@github.com" ]
noreply@github.com
e12e4fc264b1949e79468a6ba50accf054b6bf22
3e647f56843ab305b5b5f06c5c8ccab4d7f9076e
/iServer/order/src/main/java/com/handsome/order/impl/service/OrderServiceImpl.java
ee758a7de151998bcbd093276173e2a307748e3b
[]
no_license
RisoMi/handsome
89fc7231194a8e9889e600a050883c60fab47503
c06a3f9e63ae6a0a942fbfaa90deebe31f95ada5
refs/heads/master
2021-01-22T04:49:45.635713
2016-11-15T17:02:31
2016-11-15T17:02:31
67,512,585
0
0
null
2016-09-06T13:52:25
2016-09-06T13:52:24
null
UTF-8
Java
false
false
1,773
java
package com.handsome.order.impl.service; import java.util.Date; import java.util.List; import com.handsome.common.bean.PageInfo; import com.handsome.common.util.UUIDTool; import com.handsome.order.api.bean.Order; import com.handsome.order.api.dao.OrderDao; import com.handsome.order.api.service.OrderService; /** * Hello world! * */ public class OrderServiceImpl implements OrderService { private OrderDao orderDao; @Override public void createProduct(Order o) { o.setOrderId(UUIDTool.getUUID32()); o.setCreateDate(new Date()); orderDao.add(o); } @Override public void updateOrder(Order o) { o.setOrderId(UUIDTool.getUUID32()); o.setCreateDate(new Date()); orderDao.update(o); } @Override public Order getOrderById(String orderId) { Order o = new Order(); o.setOrderId(orderId);; return orderDao.find(o); } @Override public List<Order> getOrderList(Order o, PageInfo pi) { int offset; int rows; if (null == pi) { offset = 0; rows = orderDao.count(); } else { offset = pi.getPageNo() * pi.getPageSize(); rows = pi.getPageSize(); } return orderDao.list(o, offset, rows); } @Override public int countOrder() { return orderDao.count(); } @Override public void updateOrderStatus(String orderId, String status) { Order o = new Order(); o.setOrderId(orderId); // 先根据订单Id查询用订单象 o = orderDao.find(o); if (o != null) { o.setStatus(status); o.setUpdateDate(new Date()); // 修改订单 orderDao.update(o); } } @Override public int deleteOrder(String orderId) { return orderDao.delete(orderId); } public OrderDao getOrderDao() { return orderDao; } public void setOrderDao(OrderDao orderDao) { this.orderDao = orderDao; } }
[ "cc411360770@sina.com" ]
cc411360770@sina.com
59235e3e90ab587a9b5ba52726588ed59f65f9f6
12fa2e5bcc97cc16dc14de8d60fa65c4f2fda68b
/src/test/java/net/hp/AppTest.java
f27a41154cde06028137e1fc8427b4e59daece30
[]
no_license
hp21/hpspring
d6cf60beb6282c185ae21c41d5c3d697f0597caf
0eb8f9225f82e761c39bbe170e2c1a19f3f4e4c1
refs/heads/master
2020-06-07T23:37:21.397550
2012-10-25T05:31:43
2012-10-25T05:31:43
1,808,482
0
0
null
null
null
null
UTF-8
Java
false
false
634
java
package net.hp; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Unit test for simple App. */ public class AppTest extends TestCase { /** * Create the test case * * @param testName name of the test case */ public AppTest( String testName ) { super( testName ); } /** * @return the suite of tests being tested */ public static Test suite() { return new TestSuite( AppTest.class ); } /** * Rigourous Test :-) */ public void testApp() { assertTrue( true ); } }
[ "hp@gpgpgp.fff" ]
hp@gpgpgp.fff
3ae9886ba4cf8745fb95379ebb4e1ca8f0214d7d
0b5872b9aab7c897e793974494a91fea70296991
/src/com/demo/Variable_Demo.java
88062e600be2e94b1bf2e5e9217074562871326b
[]
no_license
ripattna/Core_Java
8b815e92fb59d18054e879abc77682d8450b7232
2f8c6f99a9c6ba3951f82376eb1362c74d39b125
refs/heads/main
2023-07-14T06:04:34.522337
2021-08-31T07:33:06
2021-08-31T07:33:06
303,760,388
3
0
null
null
null
null
UTF-8
Java
false
false
576
java
package com.demo; public class Variable_Demo { int data=50; //instance variable static int m=100; //static variable public void method() { final int local_variable=90; //local variable // return local_variable; System.out.println("The local variable value is:" + local_variable); } public static void main(String[] args) { Variable_Demo obj =new Variable_Demo(); System.out.println("The instance variable value is:" + obj.data); System.out.println("The value of static variable is:" + obj.m); } }
[ "ripattna@gmail.com" ]
ripattna@gmail.com
674d170ba2b737b4e0dada2e4975832cfeba5b63
7016cec54fb7140fd93ed805514b74201f721ccd
/src/java/com/echothree/model/control/sequence/server/graphql/SequenceTypeObject.java
bf3f436402bc0424d2d977c8e844c6fbbdfcb2d7
[ "MIT", "Apache-1.1", "Apache-2.0" ]
permissive
echothreellc/echothree
62fa6e88ef6449406d3035de7642ed92ffb2831b
bfe6152b1a40075ec65af0880dda135350a50eaf
refs/heads/master
2023-09-01T08:58:01.429249
2023-08-21T11:44:08
2023-08-21T11:44:08
154,900,256
5
1
null
null
null
null
UTF-8
Java
false
false
4,353
java
// -------------------------------------------------------------------------------- // Copyright 2002-2023 Echo Three, LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // -------------------------------------------------------------------------------- package com.echothree.model.control.sequence.server.graphql; import com.echothree.model.control.graphql.server.graphql.BaseEntityInstanceObject; import com.echothree.model.control.sequence.server.control.SequenceControl; import com.echothree.model.control.user.server.control.UserControl; import com.echothree.model.data.sequence.server.entity.SequenceType; import com.echothree.model.data.sequence.server.entity.SequenceTypeDetail; import com.echothree.util.server.persistence.Session; import graphql.annotations.annotationTypes.GraphQLDescription; import graphql.annotations.annotationTypes.GraphQLField; import graphql.annotations.annotationTypes.GraphQLName; import graphql.annotations.annotationTypes.GraphQLNonNull; import graphql.schema.DataFetchingEnvironment; @GraphQLDescription("sequence type object") @GraphQLName("SequenceType") public class SequenceTypeObject extends BaseEntityInstanceObject { private final SequenceType sequenceType; // Always Present public SequenceTypeObject(SequenceType sequenceType) { super(sequenceType.getPrimaryKey()); this.sequenceType = sequenceType; } private SequenceTypeDetail sequenceTypeDetail; // Optional, sequenceType getSequenceTypeDetail() private SequenceTypeDetail getSequenceTypeDetail() { if(sequenceTypeDetail == null) { sequenceTypeDetail = sequenceType.getLastDetail(); } return sequenceTypeDetail; } @GraphQLField @GraphQLDescription("sequence type name") public String getSequenceTypeName() { return getSequenceTypeDetail().getSequenceTypeName(); } @GraphQLField @GraphQLDescription("prefix") public String getPrefix() { return getSequenceTypeDetail().getPrefix(); } @GraphQLField @GraphQLDescription("suffix") public String getSuffix() { return getSequenceTypeDetail().getSuffix(); } @GraphQLField @GraphQLDescription("sequence encoder type") public SequenceEncoderTypeObject getSequenceEncoderType(final DataFetchingEnvironment env) { return SequenceSecurityUtils.getInstance().getHasSequenceEncoderTypeAccess(env) ? new SequenceEncoderTypeObject(getSequenceTypeDetail().getSequenceEncoderType()) : null; } @GraphQLField @GraphQLDescription("sequence checksum type") public SequenceChecksumTypeObject getSequenceChecksumType(final DataFetchingEnvironment env) { return SequenceSecurityUtils.getInstance().getHasSequenceChecksumTypeAccess(env) ? new SequenceChecksumTypeObject(getSequenceTypeDetail().getSequenceChecksumType()) : null; } @GraphQLField @GraphQLDescription("chunk size") @GraphQLNonNull public int getChunkSize() { return getSequenceTypeDetail().getChunkSize(); } @GraphQLField @GraphQLDescription("is default") @GraphQLNonNull public boolean getIsDefault() { return getSequenceTypeDetail().getIsDefault(); } @GraphQLField @GraphQLDescription("sort order") @GraphQLNonNull public int getSortOrder() { return getSequenceTypeDetail().getSortOrder(); } @GraphQLField @GraphQLDescription("description") @GraphQLNonNull public String getDescription(final DataFetchingEnvironment env) { var sequenceControl = Session.getModelController(SequenceControl.class); var userControl = Session.getModelController(UserControl.class); return sequenceControl.getBestSequenceTypeDescription(sequenceType, userControl.getPreferredLanguageFromUserVisit(getUserVisit(env))); } }
[ "rich@echothree.com" ]
rich@echothree.com
2f1614cae232be5964f13d2efb71d6fe3d080948
e137baa5c35c492a1667561f2742aa8c90ad6470
/src/test/java/Epam_2/MavenDemo/AppTest.java
ee7b11cf67e9b697ebfdde8019831ec4d19933ff
[]
no_license
AnushaReddy1110/task2
7c349c6a7aa1308acd2aba45c466c3d2f36d9070
fc3774977a9da0bf37fd4977e9b97b417d5dccd0
refs/heads/master
2021-01-04T12:37:34.821373
2020-02-14T20:05:51
2020-02-14T20:05:51
240,553,526
0
0
null
2020-10-13T19:33:14
2020-02-14T16:36:20
Java
UTF-8
Java
false
false
644
java
package Epam_2.MavenDemo; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Unit test for simple App. */ public class AppTest extends TestCase { /** * Create the test case * * @param testName name of the test case */ public AppTest( String testName ) { super( testName ); } /** * @return the suite of tests being tested */ public static Test suite() { return new TestSuite( AppTest.class ); } /** * Rigourous Test :-) */ public void testApp() { assertTrue( true ); } }
[ "anushareddy.anu111099@gmail.com" ]
anushareddy.anu111099@gmail.com
2160ac899d3fa5f0aebd75c2cb6c619db4007368
91ff098e0aa96a59add7beba9a3384baae40d2a9
/nguyenthanhtujava/tu/vonglap.java
39a4b5a6d28b03abd20a308371b2e20a2d71c63d
[]
no_license
ntu34543/tunguyen
46b0b72b2f79adbe66782fc6200e2de91e644cbb
5452b3280caf01b453458568670baacd145bf4bf
refs/heads/main
2023-07-11T14:57:51.689343
2021-08-22T03:34:47
2021-08-22T03:34:47
398,705,573
0
0
null
null
null
null
UTF-8
Java
false
false
4,966
java
package tu; import java.util.Scanner; public class vonglap { public static void main (String[] args) { char m; char [] kich_co = {'S','M','L','X'}; float [] gia = {6.99f,8.99f,12.50f,15.00f}; Scanner sc = new Scanner(System.in); System.out.print("Nhập kích cỡ bánh pizza: "); m = sc.nextLine().charAt(0); System.out.print(m); // for (int i=0;i<gia.length;i++){ // } // switch(kich_co){ // case "S": System.out.printf("Bánh pizza kích cỡ %s có giá: $%4.2f", kich_co ,gia[0]);break; // case "M": System.out.printf("Bánh pizza kích cỡ %s có giá: $%4.2f", kich_co ,gia[1]);break; // case "L": System.out.printf("Bánh pizza kích cỡ %s có giá: $%4.2f", kich_co ,gia[2]);break; // case "X": System.out.printf("Bánh pizza kích cỡ %s có giá: $%4.2f", kich_co ,gia[3]);break; // default: System.out.print("Kích cỡ bánh pizza không hợp lệ."); // } // } // } // public static void main(String[] args) { // int a [] = {0,1,2,3,4,5}; // for ( int i =(a.length-1) ; i>=0;i--){ // System.out.printf("%3d",a[i]); // } // } // } //1 // int n,i,j=0; // Scanner sc=new Scanner(System.in); // System.out.print("Nhap so kt: "); // n=sc.nextInt(); // System.out.print("Nhap : "); // i=sc.nextInt(); // while(true){ // if(i==0){break;} // else{ // if(i<=n && i%2 == 0){ // j+=i; // } // System.out.print("Nhap : "); // i=sc.nextInt(); // } // } // System.out.println(j); // int n,talto=0,son; //2 // Scanner cong = new Scanner (System.in); // System.out.print("so de kiem tra: "); // son = cong.nextInt(); // System.out.print("nhap n: "); // n = cong.nextInt(); // while ( true){ // if (n == 0){break;} // else{ // if (n <=son && n%2 != 0){ // talto += n; // } // System.out.print("nhap n: "); // n = cong.nextInt(); // } // } // System.out.println("tổng: "+talto); //3 // int i = 1; // int dem = 0; // do { // dem += 1; // if (dem > 10) { // dem = 1; // System.out.println(); // } // System.out.printf("%5d", i); // i += 2; // } while (i <= 100); //4 // int n=1; // for(int i =1;i<=5;i++){ // for(int j =1;j<=10;j++){ // System.out.printf("%4d",n); // n +=2; // } // System.out.println(); // } //5 // int count = 0; // while (count < 100){ // count++; // if (count % 2 !=0){ // System.out.printf("%4d",count); // if ((count +1) %20==0){ // System.out.println(); // } // } // } //6 // int i =1; // do{ // System.out.printf("%4d",i); // if ((i +1) %20==0){ // System.out.println(); // } // i+=2; // } // while (i < 100); //7 // int count = 0; // for(int i=1;i<=100;i++){ // System.out.printf("%4d",i); // count +=1; // if (count==10) System.out.println(); // if (count==20) System.out.println(); // if (count==30) System.out.println(); // if (count==40) System.out.println(); // if (count==50) System.out.println(); // if (count==60) System.out.println(); // if (count==70) System.out.println(); // if (count==80) System.out.println(); // if (count==90) System.out.println(); // } //8 //for (int i=1;i<=10;i++){ //for (int j=1;j<10;j++) { //System.out.printf("%1d * %2d = %2d |", j, i, j*i); //} //System.out.println(); //} //9 // int n; // Scanner sc= new Scanner(System.in); // System.out.print("Nhap: "); // n = sc.nextInt(); // for(int x=1;x<10;x++){ // for(int y=1;y<10;y++){ // for(int z=1;z<10;z++){ // if (x + y + z == n){ // System.out.printf("%d%d%d\n",x,y,z); // } // } // } // } } }
[ "noreply@github.com" ]
noreply@github.com
fe37298a16405baded497303b34874d66f7689c1
a6e2cd9ea01bdc5cfe58acce25627786fdfe76e9
/src/main/java/com/alipay/api/domain/AlipaySecurityProdSignatureTaskApplyModel.java
838fc2adb9e26a531de8d810820210c6f8f3adfe
[ "Apache-2.0" ]
permissive
cc-shifo/alipay-sdk-java-all
38b23cf946b73768981fdeee792e3dae568da48c
938d6850e63160e867d35317a4a00ed7ba078257
refs/heads/master
2022-12-22T14:06:26.961978
2020-09-23T04:00:10
2020-09-23T04:00:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,343
java
package com.alipay.api.domain; import java.util.List; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.internal.mapping.ApiListField; /** * 支付宝可信电子签名申请 * * @author auto create * @since 1.0, 2017-12-20 15:24:35 */ public class AlipaySecurityProdSignatureTaskApplyModel extends AlipayObject { private static final long serialVersionUID = 5465736796911474794L; /** * 外部应用名称,由支付宝统一分配,无法自助获取。 */ @ApiField("biz_app") private String bizApp; /** * 业务流水号,保证唯一性 */ @ApiField("biz_id") private String bizId; /** * 业务扩展参数 {"key1":"value2"} */ @ApiField("biz_info") private String bizInfo; /** * 业务唯一标识,由支付宝统一分配,无法自助获取 */ @ApiField("biz_product") private String bizProduct; /** * 电子签约类型,目前只支持一种类型电子合同,取值1 */ @ApiField("order_type") private Long orderType; /** * 接口版本信息,目前默认3,由服务提供方指定。 */ @ApiField("service_version") private String serviceVersion; /** * 签约文件列表。具体见SignDataInfo中定义。 */ @ApiListField("sign_data_list") @ApiField("sign_data_info") private List<SignDataInfo> signDataList; /** * 签约子任务,每个任务对应一个签约主体。 */ @ApiListField("sign_task_list") @ApiField("sign_task") private List<SignTask> signTaskList; /** * 制定签约主体执行签约顺序,例如甲乙双方签约,“顺序签约”模式下,甲签约完成后乙才能开始签约;“并行签约”模式下,甲乙可同时进行认证,按照时序顺序在文档上签约。 1 : 顺序签约 2 : 并行签约 */ @ApiField("sign_task_type") private Long signTaskType; public String getBizApp() { return this.bizApp; } public void setBizApp(String bizApp) { this.bizApp = bizApp; } public String getBizId() { return this.bizId; } public void setBizId(String bizId) { this.bizId = bizId; } public String getBizInfo() { return this.bizInfo; } public void setBizInfo(String bizInfo) { this.bizInfo = bizInfo; } public String getBizProduct() { return this.bizProduct; } public void setBizProduct(String bizProduct) { this.bizProduct = bizProduct; } public Long getOrderType() { return this.orderType; } public void setOrderType(Long orderType) { this.orderType = orderType; } public String getServiceVersion() { return this.serviceVersion; } public void setServiceVersion(String serviceVersion) { this.serviceVersion = serviceVersion; } public List<SignDataInfo> getSignDataList() { return this.signDataList; } public void setSignDataList(List<SignDataInfo> signDataList) { this.signDataList = signDataList; } public List<SignTask> getSignTaskList() { return this.signTaskList; } public void setSignTaskList(List<SignTask> signTaskList) { this.signTaskList = signTaskList; } public Long getSignTaskType() { return this.signTaskType; } public void setSignTaskType(Long signTaskType) { this.signTaskType = signTaskType; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
7c3b98c8cfeb024b592d1853c556b97f77e3e71d
c02bfb23ada1a1f51d0a1dde452822f9d3a95702
/src/main/java/com/sminer/service/OPTICS/IOptics.java
a7ca5a50903b539e63068a7d7eb5310f53c02bd4
[]
no_license
annaostroukh/SMiner
733391abd10fb8e7113c69a0618006e90cfed7e9
181a94b562e117c971c35430b2736237770eea29
refs/heads/master
2021-01-24T09:38:23.687067
2018-05-15T20:23:11
2018-05-15T20:23:11
123,024,767
1
0
null
null
null
null
UTF-8
Java
false
false
1,066
java
package com.sminer.service.OPTICS; import com.sminer.model.OpticsPoint; import com.sminer.model.Record; import java.util.List; import java.util.Map; public interface IOptics<T> { /** * Implementation of OPTICS algorithm running on one dimension (Spatial or Temporal) * @param records GPS records * @param epsilon neighbourhood value. Generic type <T> represents spatial or temporal parameter of epsilon * @param minPts minimal amount of points to shape a cluster */ List<OpticsPoint> runOneDimensionOptics(List<Record> records, T epsilon, int minPts); /** * Implementation of OPTICS algorithm running on two dimensions (Spatial and Temporal) * @param records GPS records * @param epsilonTemporal neighbourhood value for temporal dimension * @param epsilonSpatial neighbourhood value for spatial dimension * @param minPts minimal amount of points to shape a cluster */ List<OpticsPoint> runSpatialTemporalOptics(List<Record> records, T epsilonTemporal, Double epsilonSpatial, int minPts); }
[ "annaostroukh@gmail.com" ]
annaostroukh@gmail.com
7845aac02c0c5947b5bf447254b1503dc59be578
fab73396f2420612b4abc047bc40c61532b085df
/api/src/main/java/org/openmrs/module/ncd/hql/Junction.java
954f08eb86141af631a76c24c18f8e34e98402a6
[]
no_license
thomasshunter/openmrs-module-ncd
a0aab89e22436f6c0708e42ba4aab12669b2f8ae
410881f564816b705eb853cfff7ec86cb4273706
refs/heads/master
2021-01-24T11:04:02.073188
2016-10-18T14:10:38
2016-10-18T14:10:38
70,267,817
0
0
null
null
null
null
UTF-8
Java
false
false
1,189
java
package org.openmrs.module.ncd.hql; import java.util.ArrayList; import java.util.List; public class Junction implements Element { private String operator; private List<Element> children = new ArrayList<Element>(); protected Junction(String operator) { this.operator = operator; } public Junction add(Element element) { if (!element.isEmpty()) { this.children.add(element); } return this; } @Override public boolean isEmpty() { return children.size() == 0; } /** Constructs and returns the HQL for this element. * * @return The constructed HQL for this element. */ public String buildHQL(HQL instance) { if (children.size() == 0) { return ""; } else if (children.size() == 1) { Element child = children.get(0); return child.buildHQL(instance); } else { StringBuilder buf = new StringBuilder(); boolean first = true; buf.append("("); for (Element child : children) { if (first) { first = false; } else { buf.append(") "); buf.append(operator); buf.append(" ("); } buf.append(child.buildHQL(instance)); } buf.append(")"); return buf.toString(); } } }
[ "thunter@ihie.org" ]
thunter@ihie.org
dc40335aa40f573b1ddbe5ee1c6e3be4864ccd63
8d6c209666060f0d870d1b93f6a4c58f2d8f9335
/play.with.android/day.5/5.second.screen/app/src/main/java/ua/ho/tolkachov/misha/secondscreen/SecondActivity.java
aa53348768dc232425eece71824f8d883f744dd6
[]
no_license
MishaT/Andro
13d0075e38d102006afe611f3b6344cb54e20cca
8c020943a4e86ad6202480987d42875a9cd7a79a
refs/heads/master
2020-05-21T23:43:54.050688
2019-02-27T12:48:14
2019-02-27T12:48:14
4,921,514
0
0
null
null
null
null
UTF-8
Java
false
false
878
java
package ua.ho.tolkachov.misha.secondscreen; import android.os.Bundle; import android.support.v7.app.ActionBarActivity; import android.widget.TextView; public class SecondActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_second); getSupportActionBar().setDisplayHomeAsUpEnabled(true); String user = "Animal"; String gift = "donut hole"; String sender = "Nobody"; user = getIntent().getExtras().getString("username"); gift = getIntent().getExtras().getString("gift"); sender = getIntent().getStringExtra("sender"); TextView textView = (TextView)findViewById(R.id.infoTextView); textView.setText(user + ", you have got a " + gift + "\n\n" + sender); } }
[ "misha_t@ua.fm" ]
misha_t@ua.fm
5cfbd1aa6bffb5fb595398d3edcf263ba917bde3
a36dce4b6042356475ae2e0f05475bd6aed4391b
/2005/webcommon/com/hps/july/inventory/actionbean/ShowResourceLookupBySerialListAction.java
8176f3c84a30a937aed3f9ad35f64fb339e5fed2
[]
no_license
ildar66/WSAD_NRI
b21dbee82de5d119b0a507654d269832f19378bb
2a352f164c513967acf04d5e74f36167e836054f
refs/heads/master
2020-12-02T23:59:09.795209
2017-07-01T09:25:27
2017-07-01T09:25:27
95,954,234
0
1
null
null
null
null
WINDOWS-1251
Java
false
false
3,014
java
package com.hps.july.inventory.actionbean; import java.util.Enumeration; import java.util.ArrayList; import com.ibm.ivj.ejb.runtime.AccessBeanEnumeration; import com.hps.july.inventory.*; import com.hps.july.cdbc.objects.CDBCResourcesObject; import com.hps.july.constants.*; import com.hps.july.persistence.*; import com.hps.july.web.util.*; import com.hps.july.inventory.formbean.*; import java.io.IOException; import javax.servlet.*; import javax.servlet.http.*; import org.apache.struts.action.*; /** * Обработчик формы выбора оборудования */ public class ShowResourceLookupBySerialListAction extends LookupBrowseAction { public java.lang.String getBrowseBeanName() { // return "com.hps.july.persistence.ResourceAccessBean"; return "com.hps.july.cdbc.objects.CDBCResourcesObject"; } public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { ParamsParser.setState( request, Applications.INVENTORY, APPStates.RESLOOKUPSER ); ResourceLookupBySerialListForm oform = (ResourceLookupBySerialListForm)form; String sn = request.getParameter("snumber"); if(sn!=null && !sn.equals("")){ oform.setSerial(request.getParameter("snumber")); oform.setIsManucode(Boolean.FALSE); oform.setIsManufid(Boolean.FALSE); oform.setIsName(Boolean.FALSE); oform.setIsResourcetype(Boolean.FALSE); oform.setIsManucode(Boolean.FALSE); oform.setIsSign(Boolean.FALSE); oform.setIsSerial(Boolean.TRUE); }else{ if(oform.getResourcesubtype() != null) { try { ResourceSubTypeAccessBean bean = new ResourceSubTypeAccessBean(); bean.setInitKey_resourcesubtype(oform.getResourcesubtype().intValue()); bean.refreshCopyHelper(); oform.setResourcesubtypename(bean.getName()); ResourceTypeAccessBean restype = bean.getResourcetype(); oform.setResourcetype(new Integer(restype.getResourcetype())); oform.setResourcetypename(restype.getName()); } catch (Exception e) { oform.setResourcesubtypename(""); } } else { try { ResourceTypeAccessBean bean = new ResourceTypeAccessBean(); bean.setInitKey_resourcetype(oform.getResourcetype().intValue()); bean.refreshCopyHelper(); oform.setResourcetypename(bean.getName()); } catch (Exception e) { oform.setResourcetypename(""); } } /* try { OrganizationAccessBean bean = new OrganizationAccessBean(); bean.setInitKey_organization(oform.getManufacturer().intValue()); bean.refreshCopyHelper(); oform.setManufacturername(bean.getName()); } catch (Exception e) { oform.setManufacturername(""); } */ oform.setManufacturername(CDBCResourcesObject.getManufnameByManufid(oform.getManufid())); } super.perform( mapping, form, request, response ); return mapping.findForward( "main" ); } }
[ "ildar66@inbox.ru" ]
ildar66@inbox.ru
80a985ecb7af0ce2077e8de74e72ad3292f23b74
e99a3a51fa3eb6a40c5d44eb38efe8874dce38f3
/src/main/java/Selfcheckout.java
50d64648a44492e9ab6f7d5ca003edc8b3915379
[]
no_license
fpfrances/Frances-cop3330-ex10
d4f90b76befdbd93c9e346b6c5a4f4885e01d63d
01aba79ae23bd71e495ecff1ac65228e6c5b8d7c
refs/heads/master
2023-07-24T14:25:01.623013
2021-09-08T04:33:30
2021-09-08T04:33:30
404,211,467
0
0
null
null
null
null
UTF-8
Java
false
false
918
java
/* * UCF COP3330 Fall 2021 Assignment 1 Solution * Copyright 2021 Filipe Frances */ import java.util.Scanner; public class Selfcheckout { public static void main(String[] args) { float price[] = new float[3]; float quantity[] = new float[3]; float subtotal = 0; Scanner sc = new Scanner(System.in); for(int i = 0; i < 3; i++){ System.out.printf("Enter the price of item %d: ", (i+1)); price[i] = sc.nextInt(); System.out.printf("Enter the quantity of items %d: ", (i+1)); quantity[i] = sc.nextInt(); } for(int i = 0; i < 3; i++){ subtotal += price[i] * quantity[i]; } System.out.println("Subtotal: $" + String.format("%.2f",subtotal)); System.out.println("Tax: $" + (subtotal * 0.055)); System.out.println("Total: $" + (subtotal + (subtotal * 0.055))); } }
[ "fpfrances@hotmail.com" ]
fpfrances@hotmail.com
cc3e974ca997b2da060d506286080cf1c52eaa42
9cd600164ff728dd9c0f86d3e1edbe9c65ff23c9
/theme analyzer /openNLPThemeProject2/src/openNLP/trainingCategoryBayesTest.java
4bb9d297b723ac1b769decfdcc83cd82de1b320d
[]
no_license
cre8ture/team-17-files
15f773308be436777927a9cbc3c5ea12d76e2a50
890db7be24e62a51f07f1ba61027502010431b7d
refs/heads/master
2022-09-25T08:58:21.165018
2019-12-06T21:26:00
2019-12-06T21:26:00
225,727,356
0
0
null
2022-09-01T23:16:44
2019-12-03T22:11:42
HTML
UTF-8
Java
false
false
1,073
java
package openNLP; import static org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.Test; class trainingCategoryBayesTest { private String toTest = "If we shadows have offended, Think but this, and all is mended: That you have but slumbered here, While these visions did appear; And this weak and idle theme, No more yielding but a dream, Gentles, do not reprehend. If you pardon, we will mend."; private trainingCategoryBayes ctb; trainingCategoryBayesTest(){ ctb = new trainingCategoryBayes(toTest); } @Test void testTrainingCategoryBayes() { assertEquals(ctb.ranBayes, true); //fail("Not yet implemented"); } @Test void testGetBestCategory() { assertEquals(ctb.getBestCategory(), "betrayal"); //fail("Not yet implemented"); } @Test void categories() { assertEquals(ctb.category1, "love"); } @Test void testGetProbabilityForThree() { assertEquals(ctb.getProbabilityForThree(), 0.4415709938344992); } @Test void testGetProbabilityForBetrayal() { assertEquals(ctb.getProbabilityForBetrayal(), 0.5582603057391264); } }
[ "57405817+cre8ture@users.noreply.github.com" ]
57405817+cre8ture@users.noreply.github.com
fbe6b584e334a725c649bec044522faab0e00f64
f11ada6cbd662d49ba0156c7e5cfe4b92b1d5519
/j2ee/src/main/java/com/epam/efimova/basic/SoftRefExample.java
4353eef1e7a42fa1529f18fbc09cabc5bc4d1ab3
[]
no_license
Efimova/java-orientation-program
5b2396b1837080beb90c2ad4a26d3b395a401360
a97d0292fcc9f6db2dc94c586857ed5b342e8a2d
refs/heads/master
2021-01-10T17:10:39.844981
2016-01-05T15:14:05
2016-01-05T15:14:05
48,027,963
0
0
null
null
null
null
UTF-8
Java
false
false
932
java
package com.epam.efimova.basic; import java.lang.ref.SoftReference; import java.util.HashMap; import java.util.Map; /** * Created by Anna_Efimova on 12/10/2015. */ public class SoftRefExample { private Map<String, String> map = new HashMap<>(); public void setMap(Map<String, String> map) { this.map = map; } public Map getMap() { return map; } public static void main(String[] args) { int i = 0; int j = 0; SoftRefExample app = new SoftRefExample(); SoftReference softReference = new SoftReference(app.getMap()); while (true) { if (i == 10000000) { i = 0; app.setMap(new HashMap<>()); System.out.println("j = " + ++j); } StringBuilder strb = new StringBuilder("str"); strb.append(++i); app.getMap().put(strb, strb); } } }
[ "Anna_Efimova@epam.com" ]
Anna_Efimova@epam.com
f63d7ada6792cffdfda1eb036aa820efb4a15faa
4ca2e35f512358bbeb4f20a1f79a3d3b0dd12f9e
/src/main/java/com/mycompany/mvcvue/service/MetricsRepositoryCustom.java
80a782e6272bf29ede3939b8a0746c2f2c2b6675
[ "Apache-2.0" ]
permissive
vsundesha/FAIRMetrics
e502b6eea6902fe50f16019d9a75ee62333026e5
685fcf3c8d923d276fdca36279ef029f8548c01d
refs/heads/master
2023-08-10T10:35:01.233174
2019-08-12T13:03:18
2019-08-12T13:03:18
194,292,185
0
0
Apache-2.0
2023-07-22T09:32:36
2019-06-28T15:02:42
CSS
UTF-8
Java
false
false
405
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.mycompany.mvcvue.service; import com.mycompany.mvcvue.models.Metric; import java.util.List; /** * * @author Vicky Sundesha <vicky.sundesha@bsc.es> */ public interface MetricsRepositoryCustom { }
[ "me.vicky@hotmail.com" ]
me.vicky@hotmail.com
8f4b4435a136bf6424b89d44f666d0487a133589
32246f8e1eb97e6d4d67bf34d6ec913f6548a511
/src/main/java/dev/example/entities/converters/ZonedDateTimeAttributeConverter.java
51d3227700097c81b7e4d64ca93cdc73e2a6ebcf
[]
no_license
solnce52004/test4
631d64e71e93d349df1ee65c7afecc781a9639f0
771c6ba591cde6b7342183439951ceca7b21d4c5
refs/heads/master
2023-08-23T00:54:09.836154
2021-10-20T15:09:24
2021-10-20T15:09:24
414,747,031
0
0
null
null
null
null
UTF-8
Java
false
false
985
java
package dev.example.entities.converters; import dev.conf.Constants; import javax.persistence.AttributeConverter; import javax.persistence.Converter; import java.sql.Timestamp; import java.time.ZoneId; import java.time.ZonedDateTime; @Converter(autoApply = true) public class ZonedDateTimeAttributeConverter implements AttributeConverter<ZonedDateTime, Timestamp> { @Override public Timestamp convertToDatabaseColumn(ZonedDateTime zoned) { return zoned == null ? null : Timestamp.from(zoned .toLocalDateTime() .atZone(ZoneId.of(Constants.CURRENT_TIMEZONE)) .toInstant() ); } @Override public ZonedDateTime convertToEntityAttribute(Timestamp timestamp) { return timestamp == null ? null : timestamp .toInstant() .atZone(ZoneId.of(Constants.CURRENT_TIMEZONE)); } }
[ "solnce52004@yandex.ru" ]
solnce52004@yandex.ru
9722f10b94d2fd0054d65f91b477878df48ec3cf
5afc1e039d0c7e0e98216fa265829ce2168100fd
/his-inner-interface/src/main/java/cn/honry/inner/inpatient/nurseApply/dao/NurseApplyInInterDao.java
58fe26fa6d8e0275880ace648c8d3dd3c1d71a48
[]
no_license
konglinghai123/his
66dc0c1ecbde6427e70b8c1087cddf60f670090d
3dc3eb064819cb36ce4185f086b25828bb4bcc67
refs/heads/master
2022-01-02T17:05:27.239076
2018-03-02T04:16:41
2018-03-02T04:16:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,121
java
package cn.honry.inner.inpatient.nurseApply.dao; import java.util.List; import cn.honry.base.bean.model.InpatientInfo; import cn.honry.base.bean.model.InpatientShiftApply; import cn.honry.base.bean.model.SysDepartment; import cn.honry.base.dao.EntityDao; @SuppressWarnings({"all"}) public interface NurseApplyInInterDao extends EntityDao<InpatientShiftApply> { /** * 根据登录科室去查询科室的id * @author lyy * @createDate: 2016年3月29日 下午3:04:39 * @modifier lyy * @modifyDate:2016年3月29日 下午3:04:39 * @modifyRmk: * @version 1.0 */ SysDepartment queryState(String deptId); /** * 根据科室的deptId,科室类型type,患者树的Id * @author lyy * @createDate: 2016年3月29日 下午3:05:06 * @modifier lyy * @modifyDate:2016年3月29日 下午3:05:06 * @modifyRmk: id 患者树父节点id deptId 登录科室的Id type 科室的类型 * @version 1.0 */ List<InpatientInfo> infoo(String id, String deptId, String type); }
[ "user3@163.com" ]
user3@163.com
4aa7e497c51ab19f95359019feee08dfa33fbcb2
8473e2db71b84507604f26115e2eddad7218e4f3
/src/stage1/ships/Task.java
b619221a2aed9ee265b620f3ff11070c2671aef8
[]
no_license
AnnDutova/PortSimulation
0df1e4e3c3c9478ea145c8d4e6fcb223d97bcd65
9fd55b09f88c9b5062eb982be7961c02bd06d2ec
refs/heads/main
2023-04-30T08:08:32.197370
2021-05-17T10:25:36
2021-05-17T10:25:36
354,153,721
0
0
null
null
null
null
UTF-8
Java
false
false
5,823
java
package stage1.ships; import org.omg.DynamicAny.DynAnyPackage.InvalidValue; import stage1.enums.ShipState; import stage1.threads.Crane; import stage1.time.Time; import java.util.ArrayList; import java.util.Random; import static stage1.time.Time.MAX_HOURS; public class Task { private final static int COST = 100; private final DockedShip ship; private Time unloadingTimeStart; private Time comingTime; private Time emptyTime; private Time delay; private boolean done; private ArrayList<Crane> executors = new ArrayList<>(); private final Random random = new Random(); public Task(DockedShip ship) { this.ship=ship; if (random.nextBoolean()) { this.comingTime = ship.getComingTime().plus(ship.getDeviationFromTheSchedule()); } else { this.comingTime = ship.getComingTime().minus(ship.getDeviationFromTheSchedule()); } this.unloadingTimeStart = this.comingTime.plus(ship.getWaitingForUnloading()); this.done = false; } Task(DockedShip ship, Time comingTime, Time unloadingTimeStart) { this.ship = ship; this.comingTime = comingTime; this.unloadingTimeStart = unloadingTimeStart; this.done = false; } Task(DockedShip ship, Time comingTime, Time unloadingTimeStart,Time emptyTime, boolean wasDone, Time delay, ArrayList<Crane> executors) { this.ship = ship; this.comingTime = comingTime; this.unloadingTimeStart = unloadingTimeStart; this.emptyTime = emptyTime; this.done = wasDone; this.delay = delay; this.executors = executors; } public DockedShip getShip() { return this.ship; } public Time getComingTime() { return this.comingTime; } public Time getUnloadingTimeStart() { return unloadingTimeStart; } public synchronized int getDelay() { if (delay!=null) { return delay.getTimeInSeconds(); } return 0; } public Time getEmptyTime() { return this.emptyTime; } public int getExpenses() { if(delay!=null) { return delay.getHour() * COST + delay.getDay() * COST * MAX_HOURS; } else return 0; } public synchronized void unload(int weight) { if (!ship.getState().equals(ShipState.EMPTY)) { ship.takePeaceOfCargo(weight); if (ship.getState().equals(ShipState.EMPTY)) { this.done = true; } } } public synchronized boolean isDone() { return done; } public synchronized void setEmptyTime(Time time) { this.emptyTime = time; this.delay = emptyTime.getDifference(comingTime.plus(ship.getParkingTime())); } public synchronized void setEmptyTimeInt(int time) { Time newTime = new Time(); try { newTime = newTime.convertSecondsToTime(time); } catch (InvalidValue invalidValue) { invalidValue.printStackTrace(); } this.emptyTime = newTime; this.delay = emptyTime.getDifference(comingTime.plus(ship.getParkingTime())); } public synchronized void setUnloadingTimeStart(int newUnloadingStart){ Time newTime = new Time(); try { newTime = newTime.convertSecondsToTime(newUnloadingStart); } catch (InvalidValue invalidValue) { invalidValue.printStackTrace(); } this.unloadingTimeStart = newTime; } public Task copy() { return new Task(this.ship.copy(), this.comingTime, this.unloadingTimeStart); } public Task copyForStatistic(int weight) { return new Task(this.ship.copyForStatistic(weight), comingTime, unloadingTimeStart, emptyTime, done, delay, executors); } public void setExecutors(Crane crane){ executors.add(crane); } public int countOfExecutors(){ return executors.size(); } public boolean isExecutor(Crane crane){ if (executors.contains(crane)){ return true; } return false; } private String printExecutorNames(){ if (executors.size() > 0) { if (executors.size() == 2) { return executors.get(0).getName() + " "+ executors.get(1).getName(); } else return executors.get(0).getName(); } else return "No one"; } @Override public String toString() { if (emptyTime != null) { return ship.toString() + "\nDeviation: " + ship.getDeviationFromTheSchedule().toString()+ "\nComing time: (coming + deviation) " + comingTime.toString() + "\nUnloading time start: (coming + CraneWait) " + unloadingTimeStart.toString() + "\nCraneWait "+ship.getWaitingForUnloading().toString()+ "\nEmpty time: " + emptyTime.toString() + "\nNew parking time: (empty - unloading) " + emptyTime.minus(unloadingTimeStart) + "\nCost: " + getExpenses() + "\nDelay: " + getDelay() + "\nWho work: " + printExecutorNames(); } else return ship.toString() + "\nDeviation: " + ship.getDeviationFromTheSchedule().toString()+ "\nComing time: (coming + deviation) " + comingTime.toString() + "\nUnloading time start: (coming + CraneWait) " + unloadingTimeStart.toString() + "\nCraneWait "+ship.getWaitingForUnloading().toString()+ "\nCost: " + getExpenses() + "\nNot unload " + "\nDelay: " + getDelay(); } }
[ "ann.dutova@list.ru" ]
ann.dutova@list.ru
27ac2a10c3fc225c3b996650a6169c31c48fa7ff
7a1fd4caee6e778f39de60f825eaf9f58607cc87
/src/main/java/com/blizzard/cms/commons/supcan/treelist/TreeList.java
9a91d89a7187d3a118fc377babf7932cf52f6ad8
[]
no_license
wanghws/blizzard_cms
d3c8808622361a2cb608a092bafe922830ddcf92
4afff3e852a0308bbf8dd45ad9f0d553fd0d93ed
refs/heads/master
2021-07-18T10:21:53.946734
2018-01-30T06:33:26
2018-01-30T06:33:26
119,469,182
3
0
null
null
null
null
UTF-8
Java
false
false
1,674
java
/** * Copyright &copy; 2017 demo.com All rights reserved. */ package com.blizzard.cms.commons.supcan.treelist; import com.blizzard.cms.commons.supcan.common.Common; import com.blizzard.cms.commons.supcan.common.fonts.Font; import com.blizzard.cms.commons.supcan.common.properties.Properties; import com.blizzard.cms.commons.supcan.common.Common; import com.blizzard.cms.commons.supcan.common.fonts.Font; import com.blizzard.cms.commons.supcan.common.properties.Properties; import com.blizzard.cms.commons.supcan.annotation.common.fonts.SupFont; import com.blizzard.cms.commons.supcan.annotation.treelist.SupTreeList; import com.google.common.collect.Lists; import com.thoughtworks.xstream.annotations.XStreamAlias; import java.util.List; /** * 硕正TreeList * @author WangZhen * @version 2013-11-04 */ @XStreamAlias("TreeList") public class TreeList extends Common { /** * 列集合 */ @XStreamAlias("Cols") private List<Object> cols; public TreeList() { super(); } public TreeList(Properties properties) { this(); this.properties = properties; } public TreeList(SupTreeList supTreeList) { this(); if (supTreeList != null){ if (supTreeList.properties() != null){ this.properties = new Properties(supTreeList.properties()); } if (supTreeList.fonts() != null){ for (SupFont supFont : supTreeList.fonts()){ if (this.fonts == null){ this.fonts = Lists.newArrayList(); } this.fonts.add(new Font(supFont)); } } } } public List<Object> getCols() { if (cols == null){ cols = Lists.newArrayList(); } return cols; } public void setCols(List<Object> cols) { this.cols = cols; } }
[ "wanghws@gmail.com" ]
wanghws@gmail.com
c250e43e48de67a8330aa04eeffac789496231cf
dc7a0d1d223f83849e4d85ea5dae2fa0fa7787be
/KiviPaperiSakset/src/main/java/ohtu/kivipaperisakset/YksinkertainenTekoaly.java
31686e9b1912babe8e1b1250510772185b01f5de
[]
no_license
mshroom/ohtu-viikko2
bf3bee7965c94d589f90b0e1f22c5480d92d208e
01b334ba7fcbfdf3536fc464e675e275db4533f7
refs/heads/master
2020-04-05T04:58:54.748042
2018-12-11T19:56:54
2018-12-11T19:56:54
156,575,650
0
0
null
null
null
null
UTF-8
Java
false
false
506
java
package ohtu.kivipaperisakset; public class YksinkertainenTekoaly implements Tekoaly { int siirto; public YksinkertainenTekoaly() { siirto = 0; } public String annaSiirto() { siirto++; siirto = siirto % 3; if (siirto == 0) { return "k"; } else if (siirto == 1) { return "p"; } else { return "s"; } } public void asetaSiirto(String ekanSiirto) { // ei tehdä mitään } }
[ "32199029+mshroom@users.noreply.github.com" ]
32199029+mshroom@users.noreply.github.com
497d74029b2a66255be95533c15b10dcf473ebd3
f187b8eb37ece3348f565ec38fa7386caa946e36
/src/day3/test/TestMain.java
9c117c1f87d01c7fa28fa82f84289f5180fe97f2
[]
no_license
ChikaraGaston/JAVASE-CORE
c3e97bd53db230a2a601c9a3cb475a6c40b25409
98cf3d89d0bcc81abe8256b7795877d9b7939958
refs/heads/master
2020-12-29T07:16:09.766817
2020-03-10T03:45:07
2020-03-10T03:45:07
238,508,106
1
0
null
null
null
null
UTF-8
Java
false
false
191
java
package day3.test; public class TestMain { public static void main(String[] args) { for (int i=0;i<args.length;i++){ System.out.println(args[i]); } } }
[ "452539786@qq.com" ]
452539786@qq.com
62ca40c7c4353c7e97b8a9d44bf26d3da3b7ce8f
7af846ccf54082cd1832c282ccd3c98eae7ad69a
/ftmap/src/main/java/taxi/nicecode/com/ftmap/generated/package_12/Foo55.java
5c852ad3f00c0cb614327607380e92676e07f3b5
[]
no_license
Kadanza/TestModules
821f216be53897d7255b8997b426b359ef53971f
342b7b8930e9491251de972e45b16f85dcf91bd4
refs/heads/master
2020-03-25T08:13:09.316581
2018-08-08T10:47:25
2018-08-08T10:47:25
143,602,647
0
0
null
null
null
null
UTF-8
Java
false
false
268
java
package taxi.nicecode.com.ftmap.generated.package_12; public class Foo55 { public void foo0(){ new Foo54().foo5(); } public void foo1(){ foo0(); } public void foo2(){ foo1(); } public void foo3(){ foo2(); } public void foo4(){ foo3(); } public void foo5(){ foo4(); } }
[ "1" ]
1
498f8e50a0e8ffd625760a81b12b1a1dea461230
444389c3b80de271f7afa1584ae7b6e9b556de98
/springboot_docxword/src/main/java/com/example/poiutis/model/InvoiceOrder.java
5e58670151b7f3195da85cc937d72758f48d4ebf
[]
no_license
wushaopei/SpringBoot_POIUtils
81727450d6989267cbbbb6481166c7200d5070a1
3feac3af190259d0e1d6e74b6d25c14ce3b13677
refs/heads/master
2022-12-15T08:34:56.100612
2020-09-07T15:08:27
2020-09-07T15:08:27
197,106,972
0
2
null
2022-12-05T23:45:49
2019-07-16T02:36:27
Java
UTF-8
Java
false
false
1,859
java
package com.example.poiutis.model; /** * @ClassName InvoiceOrder * @Description TODO * @Author wushaopei * @Date 2019/7/16 19:35 * @Version 1.0 */ public class InvoiceOrder { private String invoiceOrder; private String companyName; private String taxNumber; private String accountBank; private String companyAddress; private String bankNumber; private String companyTelephone; private String accountName; public String getInvoiceOrder() { return invoiceOrder; } public void setInvoiceOrder(String invoiceOrder) { this.invoiceOrder = invoiceOrder; } public String getCompanyName() { return companyName; } public void setCompanyName(String companyName) { this.companyName = companyName; } public String getTaxNumber() { return taxNumber; } public void setTaxNumber(String taxNumber) { this.taxNumber = taxNumber; } public String getAccountBank() { return accountBank; } public void setAccountBank(String accountBank) { this.accountBank = accountBank; } public String getCompanyAddress() { return companyAddress; } public void setCompanyAddress(String companyAddress) { this.companyAddress = companyAddress; } public String getBankNumber() { return bankNumber; } public void setBankNumber(String bankNumber) { this.bankNumber = bankNumber; } public String getCompanyTelephone() { return companyTelephone; } public void setCompanyTelephone(String companyTelephone) { this.companyTelephone = companyTelephone; } public String getAccountName() { return accountName; } public void setAccountName(String accountName) { this.accountName = accountName; } }
[ "goolMorning_glb@webcode.com" ]
goolMorning_glb@webcode.com
9a6452302acace1d69c6488c96ad7578dd0df965
623433ca325cffd43aea67155d1233df0b90f531
/sso-client/src/main/java/com/wondersgroup/client/controller/MainServlet.java
84b397f37652d5d88b2fe979cbce426eef3676d6
[]
no_license
hbys126878033/sso-parent
2b68ba8cfdb016b6483419f3b915ce0cef935ba5
9d8436d7e9cc4ad46be6dc3ed7907d9c240c9f16
refs/heads/master
2020-05-22T21:20:26.423201
2019-05-14T01:51:23
2019-05-14T01:51:23
186,524,136
0
0
null
null
null
null
UTF-8
Java
false
false
879
java
package com.wondersgroup.client.controller; import com.wondersgroup.client.util.SSOClientUtil; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet(name = "mainServlet", urlPatterns = "/main") public class MainServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { doPost(req, resp); } @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { req.setAttribute("serverLogOutUrl", SSOClientUtil.getServerLogOutUrl()); req.getRequestDispatcher("/WEB-INF/views/main.jsp").forward(req, resp); } }
[ "863533952@qq.com" ]
863533952@qq.com
66b864131945e842fb9cd7a7cbe2d7c94677774d
a967f8364d614f478bbdf124120bd8339a39ba3e
/src/com/vanhelsing/mockbuilders/FeatureDaoMockBuilder.java
4a9a694ce19ca3e2422a128d8056334547da1a75
[]
no_license
aneeshpu/VanHelsingTest
34853f69d7658760249b6a270ee0cff00554e245
79791ffbdbd56c8cb420821acbc167159ea993f5
refs/heads/master
2016-09-06T09:20:26.508607
2011-12-11T13:00:33
2011-12-11T13:00:33
2,303,426
0
0
null
null
null
null
UTF-8
Java
false
false
1,166
java
package com.vanhelsing.mockbuilders; import org.easymock.EasyMock; import org.easymock.IExpectationSetters; import com.vanhelsing.Feature; import com.vanhelsing.contentProvider.IFeatureDao; public class FeatureDaoMockBuilder { private final IFeatureDao featureDaoMock; private FeatureDaoMockBuilder(){ featureDaoMock = EasyMock.createMock(IFeatureDao.class); } public static FeatureDaoMockBuilder featureDaoMock() { return new FeatureDaoMockBuilder(); } public IFeatureDao create() { EasyMock.replay(featureDaoMock); return featureDaoMock; } public FeatureDaoMockBuilder withGet(Times times) { final Feature anyObject = EasyMock.anyObject(Feature.class); final IExpectationSetters<Feature> expectationSetters = EasyMock.expect(featureDaoMock.get(anyObject)).andReturn(anyObject); times.setUpCallNumber(expectationSetters); return this; } public FeatureDaoMockBuilder withPersist(Times times) { final Feature anyObject = EasyMock.anyObject(Feature.class); final IExpectationSetters<Boolean> andReturn = EasyMock.expect(featureDaoMock.persist(anyObject)).andReturn(true); times.setUpCallNumber(andReturn); return this; } }
[ "aneeshpu@gmail.com" ]
aneeshpu@gmail.com
559c1281686dbfe038793597837b85d26a934cfb
c6411963bbd2769460b2a6f0450baef93d39e7a6
/src/iyakushevich/FirstControl/Task3.java
19ee83e00a421b2a4f2bea54fac5978e9524de9b
[]
no_license
Shumski-Sergey/M-JC1-25-19
06b919e91058666bf000a5d9866937e249d552a3
1133dad04ec9bec4bdb8343841657a488365a1ec
refs/heads/master
2022-04-27T14:48:25.457486
2020-04-17T16:24:00
2020-04-17T16:24:00
228,884,905
1
18
null
2020-04-06T12:13:05
2019-12-18T16:57:48
Java
UTF-8
Java
false
false
1,288
java
package iyakushevich.FirstControl; import java.util.*; /** * 3 Создадим список строк, считаем с клавиатуры 5 штук и добавим их в список. * Затем с помощью цикла найдем из списка самую длинную строку (или несколько, если она такая не одна). * Самые длинные строки будут выведены на экран. */ public class Task3 { private static int MAP_LENGTH = 5; private static int MAX_LENGTH = 0; public static void main(String[] args) { Scanner scanner = new Scanner(System.in); Map<String, Integer> stringLengthMap = new HashMap<>(); System.out.println("Введите " + MAP_LENGTH + " строк: "); for (int i = 0; i < MAP_LENGTH; i++) { System.out.print(i + 1 + " строка: "); String line = scanner.nextLine(); stringLengthMap.put(line, line.length()); if (line.length() > MAX_LENGTH) MAX_LENGTH = line.length(); } for (Map.Entry<String, Integer> entry : stringLengthMap.entrySet() ) { if (entry.getValue() == MAX_LENGTH) System.out.println(entry.getKey()); } } }
[ "yavanya92@gmail.com" ]
yavanya92@gmail.com
bd8c9a9912a5c05cddb66e71910b4ce876354bea
ba9bceaef61cbaf164ab1eeb1ab6056db0e04cc0
/onlineshopping/src/main/java/san/com/onlineshopping/controller/CartController.java
8c71227839286debd1e55de5f59f16d7f12e92ff
[]
no_license
Dammaster91/online-shopping
ef0845f6319f53e45913d60cec6e30d1ccb23bcc
2cef9317899aed903a3d0c22c5c0a3fa4085fdb0
refs/heads/master
2022-12-20T15:47:44.111666
2021-11-18T14:57:38
2021-11-18T14:57:38
194,297,752
0
0
null
2022-12-16T06:26:42
2019-06-28T15:42:33
Java
UTF-8
Java
false
false
4,370
java
package san.com.onlineshopping.controller; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.validation.Valid; 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.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; import san.com.onlineshopping.service.CartService; import san.com.onlineshopping.validator.ProductValidator; import san.com.shoppingbackend.dao.CategoryDAO; import san.com.shoppingbackend.dao.ProductDAO; import san.com.shoppingbackend.dto.Category; import san.com.shoppingbackend.dto.Product; @Controller @RequestMapping("/cart") public class CartController { @Autowired private CategoryDAO categoryDAO; @Autowired private ProductDAO productDAO; @Autowired private CartService cartService; @RequestMapping("/show") public ModelAndView showCart(@RequestParam(name="result",required=false)String result) { ModelAndView mv = new ModelAndView("page"); if(result!=null) { switch(result) { case "updated": mv.addObject("message", "CartLine has been Updated Successfully!"); break; case "error": mv.addObject("message", "Something went Wrong!"); break; } } mv.addObject("title", "User Cart"); mv.addObject("userClickShowCart", true); mv.addObject("cartLines", cartService.getCartLine()); return mv; } @RequestMapping(value = "/{cartLineId}/update", method = RequestMethod.GET) public String updateCart(@PathVariable int cartLineId,@RequestParam int count) { String response=cartService.updateCartLine(cartLineId,count); return "redirect:/cart/show?"+response; } @RequestMapping(value = "/{id}/product", method = RequestMethod.GET) public ModelAndView showAddedProduct(@PathVariable int id) { ModelAndView mv = new ModelAndView("page"); mv.addObject("userClickManageProducts", true); mv.addObject("title", "Manage Products"); Product nProduct = productDAO.get(id); // set the product fetch from database mv.addObject("product", nProduct); return mv; } @RequestMapping(value = "/product", method = RequestMethod.POST) public String handleProductSubmission(@Valid @ModelAttribute("product") Product mProduct, BindingResult result, Model model, HttpServletRequest request) { if (mProduct.getId() == 0) { new ProductValidator().validate(mProduct, result); } else { if (!mProduct.getFile().getOriginalFilename().equals("")) { new ProductValidator().validate(mProduct, result); } } if (result.hasErrors()) { model.addAttribute("userClickManageProducts", true); model.addAttribute("title", "Manage Products"); return "page"; } if (mProduct.getId() == 0) { productDAO.add(mProduct); } else { productDAO.update(mProduct); } if (!mProduct.getFile().getOriginalFilename().equals("")) { FileUploadUtility.uploadFile(request, mProduct.getFile(), mProduct.getCode()); } return "redirect:/manage/product?operation=product"; } @RequestMapping(value = "/product/{id}/activation", method = RequestMethod.POST) @ResponseBody public String handleProductActivation(@PathVariable int id) { Product product = productDAO.get(id); boolean isActive = product.isActive(); product.setActive(!product.isActive()); productDAO.update(product); return (isActive) ? "You have Succesfully Deactivated the product with id" + product.getId() : "You have Succesfully activated the product with id" + product.getId() ; } // @RequestMapping(value = "/category", method = RequestMethod.POST) public String handleCategorySubmission(@ModelAttribute Category category) { categoryDAO.add(category); return "redirect:/manage/product?operation=category"; } @ModelAttribute("categories") public List<Category> getCategories() { return categoryDAO.list(); } @ModelAttribute("category") public Category getCategory() { return new Category(); } }
[ "dhamalsandeep199@gmail.com" ]
dhamalsandeep199@gmail.com
54ba4a2454476a36d0b351e9c0c4ddfb72652422
ed1b6206947fa53692876dbd7e4d53098b36a561
/cyberzone-sports/src/main/java/com/safecode/cyberzone/service/impl/ScreenServiceImlp.java
d1f0d67bdb1af93d125e36762508c33a2b302bba
[]
no_license
chenyi136/cyberzone
dcc08abdd7b77851c097614fcc76e5c6c58b14dc
a06be2c39d15e3e0703cc6ac6262853395cd5ea3
refs/heads/master
2020-05-19T06:51:03.459864
2019-05-04T10:59:43
2019-05-04T10:59:43
184,883,681
0
0
null
null
null
null
UTF-8
Java
false
false
12,288
java
package com.safecode.cyberzone.service.impl; import java.io.IOException; import java.util.ArrayList; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.PropertySource; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; import com.safecode.cyberzone.mapper.ScreenMapper; import com.safecode.cyberzone.mapper.SysCorpsMapper; import com.safecode.cyberzone.pojo.DicItem; import com.safecode.cyberzone.pojo.ScreenConfig; import com.safecode.cyberzone.pojo.ScreenCorpsConfig; import com.safecode.cyberzone.pojo.ScreenInfrastructureConfig; import com.safecode.cyberzone.pojo.ScreenInfrastructureTarget; import com.safecode.cyberzone.pojo.ScreenInfrastructureTm; import com.safecode.cyberzone.pojo.SysCorps; import com.safecode.cyberzone.pojo.TargetInfrastructure; import com.safecode.cyberzone.service.ScreenService; import com.safecode.cyberzone.utils.CorpsFileUtils; import com.safecode.cyberzone.utils.ScreenFileUtils; import com.safecode.cyberzone.vo.ScreenCorps; import com.safecode.cyberzone.vo.ScreenInfrastructure; @Service @Transactional @PropertySource(value="classpath:screen.properties") public class ScreenServiceImlp implements ScreenService{ @Value("${screenconfigpath}") private String screenconfigpath; @Value("${screeninfrastructureconfig}") private String screeninfrastructureconfig; @Value("${screencorpsconfig}") private String screencorpsconfig; @Autowired private ScreenMapper screenMapper; @Autowired private SysCorpsMapper sysCorpsMapper; private final static Logger logger = LoggerFactory.getLogger(ScreenService.class); ScreenFileUtils corpsFileUtils = new ScreenFileUtils(); @Override public int insertScreenConfig(String name, MultipartFile logo) { try { String backgroundphoto=corpsFileUtils.headphotoupdownload(logo, screenconfigpath); screenMapper.insertScreenConfig(name, backgroundphoto); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } return 0; } @Override public int insertScreenCorpsConfig(Long corpsid, Long coordinatex, Long coordinatey) { try { screenMapper.insertScreenCorpsConfig(corpsid, coordinatex, coordinatey); } catch (Exception e) { e.printStackTrace(); } return 0; } @Override public ScreenConfig selectScreenConfigName(String name) { // TODO Auto-generated method stub return screenMapper.selectScreenConfigName(name); } @Override public ScreenCorps selectScreenCorpsConfigId(String corpsname) { ScreenCorps screenCorps=new ScreenCorps(); SysCorps sysCorps = sysCorpsMapper.selectCorpsId(corpsname); screenCorps.setName(corpsname); screenCorps.setPhoto(sysCorps.getLogo()); ScreenCorpsConfig screenCorpsConfig=screenMapper.selectScreenCorpsConfigId(sysCorps.getId()); screenCorps.setId(screenCorpsConfig.getId()); screenCorps.setCoordinatex(screenCorpsConfig.getCoordinatex()); screenCorps.setCoordinatey(screenCorpsConfig.getCoordinatey()); screenCorps.setCorpsid(screenCorpsConfig.getCorpsid()); // TODO Auto-generated method stub return screenCorps; } // @Override // public int insertScreenInfrastructureConfig(ScreenInfrastructure screen) { // List<String> list=new ArrayList<String>(); // list.addAll(screen.getTargetname()); // // for(String ss:list){ // try { // String backgroundphoto=corpsFileUtils.headphotoupdownload(screen.getLogo(), screeninfrastructureconfig); // screenMapper.insertScreenInfrastructureConfig(screen.getTmtext(), ss, screen.getCoordinatex(), screen.getCoordinatey(),backgroundphoto); // // } catch (IOException e) { // // TODO Auto-generated catch block // e.printStackTrace(); // } // // } // // return 0; // } /* (non-Javadoc) * @see com.safecode.cyberzone.service.ScreenService#insertScreenInfrastructureConfig2(com.safecode.cyberzone.vo.ScreenInfrastructure) */ @Override public int insertScreenInfrastructureConfig2(ScreenInfrastructure screen) { // TODO Auto-generated method stub Long id=screenMapper.selectAllFromText(screen.getTmtext()).getId(); screenMapper.insertScreenInfrastructureTm(id, screen.getCoordinatex(), screen.getCoordinatey()); List<String> list=new ArrayList<String>(); list.addAll(screen.getTargetname()); for(String ss:list){ screenMapper.updateTargetInfrastructureDicId(id, ss); } return 0; } @Override public List<ScreenInfrastructureConfig> selectScreenInfrastructureConfig(String tmtext) { // TODO Auto-generated method stub return screenMapper.selectScreenInfrastructureConfig(tmtext); } @Override public int updateInfrastructureConfigTargetname(ScreenInfrastructure screen) { String textname=screen.getTmtext(); //数据库中的target List<ScreenInfrastructureConfig> target=new ArrayList<ScreenInfrastructureConfig>(); target.addAll(screenMapper.selectScreenInfrastructureConfig(textname)); for(ScreenInfrastructureConfig tar:target){ screenMapper.deleteInfrastructureConfigTargetnameTrue(tar.getTmtext()); } //修改过后的target List<String> list=new ArrayList<String>(); list.addAll(screen.getTargetname()); for(String ll:list){ if(screenMapper.selectScreenInfrastructureUp(textname,ll)!=null){ screenMapper.deleteInfrastructureConfigTargetnameFalse(textname, ll); continue; } screenMapper.insertScreenInfrastructureConfig(textname, ll, screen.getCoordinatex(), screen.getCoordinatey(),screen.getPhoto()); } return 0; } @Override public int updateConfig(Long id,String name, MultipartFile logo) throws IOException { ScreenFileUtils corpsFileUtils = new ScreenFileUtils(); String a=screenMapper.selectScreenConfigId(id).getBackgroundphoto(); corpsFileUtils.deleteUpLoadFile(a); //String path="/home/hmj/saveFile/screenConfig/"; String backgroundphoto; try { backgroundphoto = corpsFileUtils.headphotoupdownload(logo, screenconfigpath); screenMapper.updateScreenConfig(name,backgroundphoto, id); } catch (IOException e) { throw e; } return 0; } @Override public int updateCorpsConfig(Long corpsid, Long coordinatex, Long coordinatey) { screenMapper.updateScreenCorpsConfig(coordinatex, coordinatey, corpsid); return 0; } /* (non-Javadoc) * @see com.safecode.cyberzone.service.ScreenService#selectAllScreenConfig() */ @Override public List<ScreenConfig> selectAllScreenConfig() { return screenMapper.selectAllScreenConfig(); } /* (non-Javadoc) * @see com.safecode.cyberzone.service.ScreenService#selectAllScreenCorpsConfig() */ @Override public List<ScreenCorps> selectAllScreenCorpsConfig() { List<ScreenCorps> list=new ArrayList<ScreenCorps>(); List<ScreenCorpsConfig> screenCorpsConfig=screenMapper.selectAllScreenCorpsConfig(); for(ScreenCorpsConfig sc:screenCorpsConfig){ ScreenCorps scc=new ScreenCorps(); String corpsphoto=sysCorpsMapper.selectsyscorpsByid(sc.getCorpsid()).getLogo(); String name=sysCorpsMapper.selectsyscorpsByid(sc.getCorpsid()).getName(); Long id=sysCorpsMapper.selectsyscorpsByid(sc.getCorpsid()).getId(); scc.setPhoto(corpsphoto); scc.setName(name); scc.setCorpsid(id); scc.setId(sc.getId()); scc.setCoordinatex(sc.getCoordinatex()); scc.setCoordinatey(sc.getCoordinatey()); list.add(scc); } return list; } /* (non-Javadoc) * @see com.safecode.cyberzone.service.ScreenService#selectAllScreenInfrastructureConfig() */ @Override public List<ScreenInfrastructureConfig> selectAllScreenInfrastructureConfig() { // TODO Auto-generated method stub return screenMapper.selectAllScreenInfrastructureConfig(); } /* (non-Javadoc) * @see com.safecode.cyberzone.service.ScreenService#selectScreenInfrastructureTmByText(java.lang.String) */ @Override public ScreenInfrastructureTm selectScreenInfrastructureTmByText(String tmtext) { // TODO Auto-generated method stub Long id=screenMapper.selectAllFromText(tmtext).getId(); return screenMapper.selectScreenInfrastructureTmByText(id); } @Override public int updateInfrastructure(ScreenInfrastructure screen) { //靶标分类 String tmtext=screen.getTmtext(); Long id=screenMapper.selectAllFromText(tmtext).getId(); //主表修改 screenMapper.updateScreenInfrastructuretm(screen.getCoordinatex(), screen.getCoordinatey(),id); //靶标的关联 //修改后的target List<String> tar=screen.getTargetname(); //修改前的target List<TargetInfrastructure> targetInfrastructure=screenMapper.selectAllFromDicId(id); for(TargetInfrastructure ta:targetInfrastructure){ //附表修改 screenMapper.updateTargetInfrastructureDicIdFalse(ta.getInfrastructureName()); } for(String st:tar){ screenMapper.updateTargetInfrastructureDicId(id, st); } return 0; } @Override public List<ScreenInfrastructure> selectSScreenInfrastructureAll() { List<ScreenInfrastructure> listAll=new ArrayList<ScreenInfrastructure>(); List<ScreenInfrastructureTm> tm=screenMapper.selectScreenInfrastructureTmAll(); for(ScreenInfrastructureTm st1:tm){ ScreenInfrastructure screenInfrastructure=new ScreenInfrastructure(); screenInfrastructure.setCoordinatex(st1.getCoordinatex()); screenInfrastructure.setCoordinatey(st1.getCoordinatey()); screenInfrastructure.setId(st1.getId()); screenInfrastructure.setPhoto(st1.getPhoto()); List<TargetInfrastructure> targetInfrastructure=screenMapper.selectAllFromDicId(st1.getTmid()); List<String> targetname=new ArrayList<String>(); String tmtext=screenMapper.selectAllFromId(st1.getTmid()).getText(); screenInfrastructure.setTmtext(tmtext); for(TargetInfrastructure ta:targetInfrastructure){ targetname.add(ta.getInfrastructureName()); } screenInfrastructure.setTargetname(targetname); listAll.add(screenInfrastructure); } // return listAll; } @Override public List<DicItem> selectAllText() { // TODO Auto-generated method stub return screenMapper.selectAllText(); } @Override public List<TargetInfrastructure> selectAllTarget() { // TODO Auto-generated method stub return screenMapper.selectAllTarget(); } @Override public ScreenInfrastructure screenInfrastructureConfig(String tmtext) { DicItem dicItem = screenMapper.selectAllFromText(tmtext); Long tmid=dicItem.getId(); ScreenInfrastructureTm screenInfrastructureTm=screenMapper.selectScreenInfrastructureTmByText(tmid); ScreenInfrastructure list=new ScreenInfrastructure(); list.setCoordinatex(screenInfrastructureTm.getCoordinatex()); list.setCoordinatey(screenInfrastructureTm.getCoordinatey()); list.setTmtext(tmtext); list.setId(screenInfrastructureTm.getId()); List<String> ll=new ArrayList<String>(); List<TargetInfrastructure> target=screenMapper.selectAllFromDicId(tmid); for(TargetInfrastructure st:target){ ll.add(st.getInfrastructureName()); } list.setTargetname(ll); return list; } @Override public ScreenCorpsConfig selectScreenConfigAllFromCorpsId(Long corpsid) { // TODO Auto-generated method stub return screenMapper.selectScreenCorpsConfigId(corpsid); } @Override public DicItem selectAllFromText(String text) { // TODO Auto-generated method stub return screenMapper.selectAllFromText(text); } @Override public ScreenConfig selectScreenConfigId(Long id) { // TODO Auto-generated method stub return screenMapper.selectScreenConfigId(id); } }
[ "1369495295@qq.com" ]
1369495295@qq.com
21731e9b651b4a7e45a7623c4805115586073d30
28e3eef75c43ae3fab5729b9d7c7528722ce5ead
/src/jdk8/org/omg/IOP/MultipleComponentProfileHelper.java
f05300450204b9ed0f45ffb856d59890df043435
[ "Apache-2.0" ]
permissive
aserendipper/JDK1.8-source-analysis
d23d339584d4d8ca00debedfc351af6644c37095
6e0840fbe524f139656c8e1ac754cedef1274888
refs/heads/main
2023-05-24T13:57:41.028385
2021-06-12T13:14:10
2021-06-12T13:14:10
336,750,273
0
0
null
null
null
null
UTF-8
Java
false
false
2,119
java
package org.omg.IOP; /** * org/omg/IOP/MultipleComponentProfileHelper.java . * Generated by the IDL-to-Java compiler (portable), version "3.2" * from /jenkins/workspace/8-2-build-macosx-x86_64/jdk8u261/295/corba/src/share/classes/org/omg/PortableInterceptor/IOP.idl * Thursday, June 18, 2020 6:39:17 AM GMT */ /** An array of tagged components, forming a multiple component profile. */ abstract public class MultipleComponentProfileHelper { private static String _id = "IDL:omg.org/IOP/MultipleComponentProfile:1.0"; public static void insert (org.omg.CORBA.Any a, org.omg.IOP.TaggedComponent[] that) { org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); a.type (type ()); write (out, that); a.read_value (out.create_input_stream (), type ()); } public static org.omg.IOP.TaggedComponent[] extract (org.omg.CORBA.Any a) { return read (a.create_input_stream ()); } private static org.omg.CORBA.TypeCode __typeCode = null; synchronized public static org.omg.CORBA.TypeCode type () { if (__typeCode == null) { __typeCode = org.omg.IOP.TaggedComponentHelper.type (); __typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode); __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.IOP.MultipleComponentProfileHelper.id (), "MultipleComponentProfile", __typeCode); } return __typeCode; } public static String id () { return _id; } public static org.omg.IOP.TaggedComponent[] read (org.omg.CORBA.portable.InputStream istream) { org.omg.IOP.TaggedComponent value[] = null; int _len0 = istream.read_long (); value = new org.omg.IOP.TaggedComponent[_len0]; for (int _o1 = 0;_o1 < value.length; ++_o1) value[_o1] = org.omg.IOP.TaggedComponentHelper.read (istream); return value; } public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.IOP.TaggedComponent[] value) { ostream.write_long (value.length); for (int _i0 = 0;_i0 < value.length; ++_i0) org.omg.IOP.TaggedComponentHelper.write (ostream, value[_i0]); } }
[ "569482018@qq.com" ]
569482018@qq.com
5f1e0a277bd7bfe767fe4b8c64c8a861c6642212
250e1aac5dd51fe0b8eeb78bede369400ac7f71d
/src/balloons_game/Balloons_game.java
7aa653c2d58a2cbdac2f9158a374dfd34effb424
[]
no_license
urielhdz/balloons_game
1d8d032369cda20e62691668937288a45ae13aeb
0a929375769d5f8ea7429547d00d40a895740e82
refs/heads/master
2021-01-01T19:43:20.607187
2013-09-29T18:06:58
2013-09-29T18:06:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
513
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package balloons_game; import javax.swing.SwingUtilities; /** * * @author Uriel */ public class Balloons_game { /** * @param args the command line arguments */ public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable(){ public void run(){ new Ventana(); } }); } }
[ "uriel.hdzc@gmail.com" ]
uriel.hdzc@gmail.com
bca5f4f8dffbf2f741208a643048178536765624
d9e1a8d7c49718241317c94bd4c386d2cd83f53c
/src/LinkedList/Main.java
985979c1c9119b172fa40401077b17830ddbc75a
[]
no_license
Bohyunnn/DataStructure
e2ce99b1c9b2862826717f8549b98aeb42458f7c
a62ce48f87784235ba8469661d66b9b926b74f02
refs/heads/master
2021-05-10T16:11:25.506070
2018-01-23T07:11:10
2018-01-23T07:11:10
118,571,690
0
0
null
null
null
null
UTF-8
Java
false
false
230
java
package LinkedList; public class Main { public static void main(String[] args) { LinkedList numbers = new LinkedList(); numbers.addLast(10); numbers.addLast(20); numbers.addLast(30); System.out.println(numbers); } }
[ "kbh236@naver.com" ]
kbh236@naver.com
45f018615057193e79f338294d89e4f4c591196f
d4370a213e9dc4c0cb00c3a998af8189ed7adbc7
/trunk/ZxingCoreJ2ME/src/com/google/zxing/qrcode/decoder/Decoder.java
f634cd441faf7082b13ad08eee89f43abf84e02a
[]
no_license
BGCX262/zxing-core-j2me-svn-to-git
066f943eaf0536067201184376dc1b3bc0ffd640
23ea650d314205afb70bd37cab315a08821211f6
refs/heads/master
2021-01-23T18:51:07.768019
2015-08-23T06:58:56
2015-08-23T06:58:56
41,256,715
0
0
null
null
null
null
UTF-8
Java
false
false
6,139
java
/* * Copyright 2007 ZXing authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.zxing.qrcode.decoder; import com.google.zxing.ChecksumException; import com.google.zxing.DecodeHintType; import com.google.zxing.FormatException; import com.google.zxing.common.BitMatrix; import com.google.zxing.common.DecoderResult; import com.google.zxing.common.reedsolomon.GenericGF; import com.google.zxing.common.reedsolomon.ReedSolomonDecoder; import com.google.zxing.common.reedsolomon.ReedSolomonException; import java.util.Hashtable; /** * <p>The main class which implements QR Code decoding -- as opposed to locating * and extracting the QR Code from an image.</p> * * @author Sean Owen */ public final class Decoder { private final ReedSolomonDecoder rsDecoder; public Decoder() { rsDecoder = new ReedSolomonDecoder(GenericGF.QR_CODE_FIELD_256); } public DecoderResult decode(boolean[][] image) throws ChecksumException, FormatException { return decode(image, null); } /** * <p>Convenience method that can decode a QR Code represented as a 2D array * of booleans. "true" is taken to mean a black module.</p> * * @param image booleans representing white/black QR Code modules * @return text and bytes encoded within the QR Code * @throws FormatException if the QR Code cannot be decoded * @throws ChecksumException if error correction fails */ //public DecoderResult decode(boolean[][] image, Map<DecodeHintType,?> hints) public DecoderResult decode(boolean[][] image, Hashtable hints) throws ChecksumException, FormatException { int dimension = image.length; BitMatrix bits = new BitMatrix(dimension); for (int i = 0; i < dimension; i++) { for (int j = 0; j < dimension; j++) { if (image[i][j]) { bits.set(j, i); } } } return decode(bits, hints); } public DecoderResult decode(BitMatrix bits) throws ChecksumException, FormatException { return decode(bits, null); } /** * <p>Decodes a QR Code represented as a {@link BitMatrix}. A 1 or "true" is * taken to mean a black module.</p> * * @param bits booleans representing white/black QR Code modules * @return text and bytes encoded within the QR Code * @throws FormatException if the QR Code cannot be decoded * @throws ChecksumException if error correction fails */ //public DecoderResult decode(BitMatrix bits, Map<DecodeHintType,?> hints) public DecoderResult decode(BitMatrix bits, Hashtable hints) throws FormatException, ChecksumException { // Construct a parser and read version, error-correction level BitMatrixParser parser = new BitMatrixParser(bits); Version version = parser.readVersion(); ErrorCorrectionLevel ecLevel = parser.readFormatInformation().getErrorCorrectionLevel(); // Read codewords byte[] codewords = parser.readCodewords(); // Separate into data blocks DataBlock[] dataBlocks = DataBlock.getDataBlocks(codewords, version, ecLevel); // Count total number of data bytes int totalBytes = 0; for (int i = 0; i < dataBlocks.length; i++) { totalBytes += dataBlocks[i].getNumDataCodewords(); } byte[] resultBytes = new byte[totalBytes]; int resultOffset = 0; // Error-correct and copy data blocks together into a stream of bytes // for (DataBlock dataBlock : dataBlocks) { for (int j = 0; j < dataBlocks.length; j++) { byte[] codewordBytes = dataBlocks[j].getCodewords(); int numDataCodewords = dataBlocks[j].getNumDataCodewords(); correctErrors(codewordBytes, numDataCodewords); for (int i = 0; i < numDataCodewords; i++) { resultBytes[resultOffset++] = codewordBytes[i]; } } // Decode the contents of that stream of bytes return DecodedBitStreamParser.decode(resultBytes, version, ecLevel, hints); } /** * <p>Given data and error-correction codewords received, possibly corrupted * by errors, attempts to correct the errors in-place using Reed-Solomon * error correction.</p> * * @param codewordBytes data and error correction codewords * @param numDataCodewords number of codewords that are data bytes * @throws ChecksumException if error correction fails */ private void correctErrors(byte[] codewordBytes, int numDataCodewords) throws ChecksumException { int numCodewords = codewordBytes.length; // First read into an array of ints int[] codewordsInts = new int[numCodewords]; for (int i = 0; i < numCodewords; i++) { codewordsInts[i] = codewordBytes[i] & 0xFF; } int numECCodewords = codewordBytes.length - numDataCodewords; try { rsDecoder.decode(codewordsInts, numECCodewords); } catch (ReedSolomonException rse) { throw ChecksumException.getChecksumInstance(); } // Copy back into array of bytes -- only need to worry about the bytes that were data // We don't care about errors in the error-correction codewords for (int i = 0; i < numDataCodewords; i++) { codewordBytes[i] = (byte) codewordsInts[i]; } } }
[ "you@example.com" ]
you@example.com
ecc4f1fcf8bc2f3385fe0fb0bc9976e0b01e8bf8
38f7b0188d88500f34c3762980ca429ec2e68f26
/app/src/androidTest/java/com/id/it/pradita/dicoding_pemula/ExampleInstrumentedTest.java
a390ea10c7bb03b4e1c56dcc2bd7e745919c6913
[]
no_license
nosana/Dicoding_android_pemula
02a2cd8f8d136acd0268014bfb1d697134369ee6
bd02a83fc7547573f83c9fe1ab038df2cb06f3ad
refs/heads/master
2020-03-10T10:58:06.589970
2018-04-13T09:14:23
2018-04-13T09:14:23
129,344,931
0
0
null
null
null
null
UTF-8
Java
false
false
750
java
package com.id.it.pradita.dicoding_pemula; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.id.it.pradita.dicoding_pemula", appContext.getPackageName()); } }
[ "novanopan26@gmail.com" ]
novanopan26@gmail.com
310f78bcf7f5cc79f043ba00bd11efabe5765e14
3b239b95535528b66773c8607fb3444e0e0b9c28
/src/main/java/com/leetcode/util/parsers/string/CharParser.java
5004d54083f1446426bbf1de70833b3aab56e0e8
[]
no_license
MichaelJL3/leetcode
233e6434027c6f4d970eb5b527e0483e919074b6
cd7e38a04ec5452c9932e3ec55ab6ac6004742da
refs/heads/master
2020-03-06T21:30:12.931484
2018-04-10T03:51:54
2018-04-10T03:51:54
127,078,970
0
0
null
null
null
null
UTF-8
Java
false
false
282
java
package com.leetcode.util.parsers.string; import com.leetcode.util.parsers.Parser; public class CharParser extends Parser<Character, String> { @Override public Character parse(String val) { return val != null && val.length() > 0 ? val.charAt(0) : null; } }
[ "michael.laucella@ipsoft.com" ]
michael.laucella@ipsoft.com
4518c6f734e454ab3034a3f8ea4714a402a60f66
c25be104d0c4d28f780037efc58b1706e20db376
/contract/src/main/java/com/tinhvan/hd/dto/ResultDisbursementInfo.java
ad7183f47876276410989e78e43bb79431995847
[]
no_license
nthanhdo2610/hd
9a22eca5303b409e3e93dad9c6f5d3a4ab5942ca
efdcd782e01e75976504880bf385b88d7a507267
refs/heads/master
2023-09-03T23:24:36.790002
2020-02-26T14:07:53
2020-02-26T14:07:53
229,775,829
0
0
null
null
null
null
UTF-8
Java
false
false
2,359
java
package com.tinhvan.hd.dto; import java.util.Date; public class ResultDisbursementInfo { private Long id; private String contractCode; private String customerUuid; private String bankName; private String accountNumber; private String brandName; private String accountName; private int isSent; private Date createAt; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getContractCode() { return contractCode; } public void setContractCode(String contractCode) { this.contractCode = contractCode; } public String getCustomerUuid() { return customerUuid; } public void setCustomerUuid(String customerUuid) { this.customerUuid = customerUuid; } public String getBankName() { return bankName; } public void setBankName(String bankName) { this.bankName = bankName; } public String getAccountNumber() { return accountNumber; } public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; } public String getBrandName() { return brandName; } public void setBrandName(String brandName) { this.brandName = brandName; } public String getAccountName() { return accountName; } public void setAccountName(String accountName) { this.accountName = accountName; } public int getIsSent() { return isSent; } public void setIsSent(int isSent) { this.isSent = isSent; } public Date getCreateAt() { return createAt; } public void setCreateAt(Date createAt) { this.createAt = createAt; } @Override public String toString() { return "ResultDisbursementInfo{" + "id=" + id + ", contractCode='" + contractCode + '\'' + ", customerUuid='" + customerUuid + '\'' + ", bankName='" + bankName + '\'' + ", accountNumber='" + accountNumber + '\'' + ", brandName='" + brandName + '\'' + ", accountName='" + accountName + '\'' + ", isSent=" + isSent + ", createdAt=" + createAt + '}'; } }
[ "nthanhdo11110030@gmail.com" ]
nthanhdo11110030@gmail.com
6cc9d7e2b95193d7d0a79214305d6bbd53822d53
6e484face6fc459c40ecdb89b57a86a79a2ec1d1
/src/main/java/com/example/btc/BtcApplication.java
05ee9afc861438f8783fc02224adfd985fc78c9c
[]
no_license
github4n/btc
505623a72376578a3ed2c4d5721a218de2dd9e98
495ca2a5b30c328c706359dbf335fcc834a5921a
refs/heads/master
2023-03-11T08:39:29.861964
2021-02-18T09:29:19
2021-02-18T09:29:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
544
java
package com.example.btc; import com.example.btc.services.MyWebSocketClient; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; //@SpringBootApplication @SpringBootApplication(scanBasePackages={"com.example.btc"}) public class BtcApplication { public static void main(String[] args) { SpringApplication.run(BtcApplication.class, args); } //@Autowired MyWebSocketClient myweb1; //myweb1.createClient() }
[ "dingmark@163.com" ]
dingmark@163.com
09f630dd1bf716046c38dc70e7639cb33e596cb0
ad2c063a603df1cc804540c53a9b492b84892290
/Balanced Stack Algorithm/src/stacks/ArrayBoundedStack.java
5eb2ba6509ba1be53dec1378ef66e5a91f4a3923
[]
no_license
kevin-orellana/Data-Structures
295808aa17a164a85a24bfda3503ac7078e5ffd5
5a9e030d4813b7c1904387ac8ee35cd16968df4a
refs/heads/master
2021-05-13T11:19:02.977049
2018-01-11T15:20:16
2018-01-11T15:20:16
117,116,040
0
0
null
null
null
null
UTF-8
Java
false
false
2,259
java
//---------------------------------------------------------------- // ArrayBoundedStack.java by Dale/Joyce/Weems Chapter 2 // // Implements StackInterface using an array to hold the // stack elements. // // Two constructors are provided: one that creates an array of a // default size and one that allows the calling program to // specify the size. //---------------------------------------------------------------- package stacks; public class ArrayBoundedStack<T> implements StackInterface<T> { protected final int DEFCAP = 100; // default capacity protected T[] elements; // holds stack elements protected int topIndex = -1; // index of top element in stack public ArrayBoundedStack() { elements = (T[]) new Object[DEFCAP]; } public ArrayBoundedStack(int maxSize) { elements = (T[]) new Object[maxSize]; } public void push(T element) // Throws StackOverflowException if this stack is full, // otherwise places element at the top of this stack. { if (isFull()) throw new StackOverflowException("Push attempted on a full stack."); else { topIndex++; elements[topIndex] = element; } } public void pop() // Throws StackUnderflowException if this stack is empty, // otherwise removes top element from this stack. { if (isEmpty()) throw new StackUnderflowException("Pop attempted on an empty stack."); else { elements[topIndex] = null; topIndex--; } } public T top() // Throws StackUnderflowException if this stack is empty, // otherwise returns top element of this stack. { T topOfStack = null; if (isEmpty()) throw new StackUnderflowException("Top attempted on an empty stack."); else topOfStack = elements[topIndex]; return topOfStack; } public boolean isEmpty() // Returns true if this stack is empty, otherwise returns false. { return (topIndex == -1); } public boolean isFull() // Returns true if this stack is full, otherwise returns false. { return (topIndex == (elements.length - 1)); } }
[ "kfo215@nyu.edu" ]
kfo215@nyu.edu
56aff0dc60b3cad77f48ca5853828ca155a57fee
ef8ab6b0829cefc1403b59196dc2563c0c974b60
/src/com/store/model/StrJDBCDAO.java
9a05a406ac590089bd566def5c7174652c262370
[]
no_license
bobo8015/BA103G3_1xxxxxxxxx
5f9d9960d50ed907bcd512a314c0c2fb0de99056
bbe1edad08a37f0a08777cf34413e8159bba73ab
refs/heads/master
2021-07-03T01:02:20.099916
2017-09-21T09:37:14
2017-09-21T09:37:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
14,814
java
package com.store.model; import java.io.IOException; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import java.util.Set; import com.storecategory.model.ShareTool; import com.storecategory.model.StocaVO; public class StrJDBCDAO implements StrDAO_interface { private static final String URL = "jdbc:oracle:thin:@localhost:1521:1521:XE"; private static final String USER = "easyfood"; private static final String PASSWORD = "easyfood"; private static final String DRIVER = "oracle.jdbc.driver.OracleDriver"; private static final String INSERT = "INSERT INTO STORE(STR_NO, STR_NAME, STR_COU, STR_CITY, STR_ADDR, STR_TEL, STR_ATN," + "STR_PRE,STR_SHIP, STOCA_NO, STR_ACC, STR_PAS, STR_MA, STR_LONG, STR_LAT)" + "VALUES ('STR_'||LPAD(STR_SQ.NEXTVAL, 4, '0'), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; private static final String UPDATE = "UPDATE STORE SET STR_NAME = ?, STR_COU = ?, STR_CITY = ?, STR_ADDR = ?, STR_TEL = ?," +"STR_ATN = ?, STR_PRE = ?, STR_SHIP = ?, STR_MA = ?, STR_LONG = ?, STR_LAT = ?" +"WHERE STR_NO = ?"; private static final String UPDATE_INFO = "UPDATE STORE SET STR_IMG = ?, STR_NOTE = ? WHERE STR_NO = ?"; private static final String UPDATE_INFO_IMG = "UPDATE STORE SET STR_IMG = ? WHERE STR_NO = ?"; private static final String UPDATE_PAS = "UPDATE STORE SET STR_PAS = ? WHERE STR_NO = ?"; private static final String UPDATE_STAT = "UPDATE STORE SET STR_STAT = ? WHERE STR_NO = ?"; private static final String GET_ONE = "SELECT * FROM STORE WHERE STR_NO = ?"; private static final String GET_ALL = "SELECT * FROM STORE ORDER BY STR_NO"; private static final String FIND_BY_AREA = "SELECT * FROM STORE WHERE STR_COU||STR_CITY||STR_ADDR LIKE ?"; private static final String FIND_BY_STOCA_NO = "SELECT * FROM STORE WHERE STOCA_NO = ?"; @Override public void insert(StrVO strVO) { Connection con = null; PreparedStatement state = null; try { Class.forName(DRIVER); con = DriverManager.getConnection(URL, USER, PASSWORD); state = con.prepareStatement(INSERT); state.setString(1, strVO.getStr_name()); state.setString(2, strVO.getStr_cou()); state.setString(3, strVO.getStr_city()); state.setString(4, strVO.getStr_addr()); state.setString(5, strVO.getStr_tel()); state.setString(6, strVO.getStr_atn()); state.setInt(7, strVO.getStr_pre()); state.setString(8, strVO.getStr_ship()); state.setString(9, strVO.getStoca_no()); state.setString(10, strVO.getStr_acc()); state.setString(11, strVO.getStr_pas()); state.setString(12, strVO.getStr_ma()); state.setDouble(13, strVO.getStr_long()); state.setDouble(14, strVO.getStr_lat()); state.executeUpdate(); } catch (ClassNotFoundException ce) { throw new RuntimeException("Couldn't load database driver. " + ce.getMessage()); } catch (SQLException se) { throw new RuntimeException("A database error occured. " + se.getMessage()); } finally { try { if(con != null) { con.close(); } } catch (SQLException e) { e.printStackTrace(System.err); } } } @Override public void update(StrVO strVO) { Connection con = null; PreparedStatement state = null; try { Class.forName(DRIVER); con = DriverManager.getConnection(URL, USER, PASSWORD); state = con.prepareStatement(UPDATE); state.setString(1, strVO.getStr_name()); state.setString(2, strVO.getStr_cou()); state.setString(3, strVO.getStr_city()); state.setString(4, strVO.getStr_addr()); state.setString(5, strVO.getStr_tel()); state.setString(6, strVO.getStr_atn()); state.setInt(7, strVO.getStr_pre()); state.setString(8, strVO.getStr_ship()); state.setString(9, strVO.getStr_ma()); state.setDouble(10, strVO.getStr_long()); state.setDouble(11, strVO.getStr_lat()); state.setString(12, strVO.getStr_no()); state.execute(); } catch (ClassNotFoundException ce) { throw new RuntimeException("Couldn't load database driver. " + ce.getMessage()); } catch (SQLException se) { throw new RuntimeException("A database error occured. " + se.getMessage()); } finally { if(con != null) { try { con.close(); } catch (SQLException e) { e.printStackTrace(System.err); } } } } @Override public void updateInfo(StrVO strVO) { Connection con = null; PreparedStatement state = null; try { Class.forName(DRIVER); con = DriverManager.getConnection(URL, USER, PASSWORD); state = con.prepareStatement(UPDATE_INFO); state.setBytes(1, strVO.getStr_img()); state.setString(2, strVO.getStr_note()); state.setString(3, strVO.getStr_no()); state.execute(); } catch (ClassNotFoundException ce) { throw new RuntimeException("Couldn't load database driver. " + ce.getMessage()); } catch (SQLException se) { throw new RuntimeException("A database error occured. " + se.getMessage()); } finally { if(con != null) { try { con.close(); } catch (SQLException e) { e.printStackTrace(System.err); } } } } @Override public void updatePas(String str_no, String str_pas) { Connection con = null; PreparedStatement state = null; try { Class.forName(DRIVER); con = DriverManager.getConnection(URL, USER, PASSWORD); state = con.prepareStatement(UPDATE_PAS); state.setString(1, str_pas); state.setString(2, str_no); state.execute(); } catch (ClassNotFoundException ce) { throw new RuntimeException("Couldn't load database driver. " + ce.getMessage()); } catch (SQLException se) { throw new RuntimeException("A database error occured. " + se.getMessage()); } finally { if(con != null) { try { con.close(); } catch (SQLException e) { e.printStackTrace(System.err); } } } } @Override public void updateStatus(String str_no, String str_stat) { Connection con = null; PreparedStatement state = null; try { Class.forName(DRIVER); con = DriverManager.getConnection(URL, USER, PASSWORD); state = con.prepareStatement(UPDATE_STAT); state.setString(1, str_stat); state.setString(2, str_no); state.execute(); } catch (ClassNotFoundException ce) { throw new RuntimeException("Couldn't load database driver. " + ce.getMessage()); } catch (SQLException se) { throw new RuntimeException("A database error occured. " + se.getMessage()); } finally { if(con != null) { try { con.close(); } catch (SQLException e) { e.printStackTrace(System.err); } } } } @Override public StrVO findByPrimaryKey(String str_no) { Connection con = null; PreparedStatement state = null; ResultSet rs = null; StrVO strVO = null; try { Class.forName(DRIVER); con = DriverManager.getConnection(URL, USER, PASSWORD); state = con.prepareStatement(GET_ONE); state.setString(1, str_no); rs = state.executeQuery(); while(rs.next()) { strVO = new StrVO(); strVO.setStr_no(rs.getString(1)); strVO.setStr_name(rs.getString(2)); strVO.setStr_cou(rs.getString(3)); strVO.setStr_city(rs.getString(4)); strVO.setStr_addr(rs.getString(5)); strVO.setStr_tel(rs.getString(6)); strVO.setStr_atn(rs.getString(7)); strVO.setStr_pre(rs.getInt(8)); strVO.setStr_ship(rs.getString(9)); strVO.setStoca_no(rs.getString(10)); strVO.setStr_acc(rs.getString(11)); strVO.setStr_pas(rs.getString(12)); byte[] pic = rs.getBytes(13); if(pic != null) { strVO.setStr_img(pic); } else { strVO.setStr_img(ShareTool.sendPicture("images/nopic.png")); } strVO.setStr_stat(rs.getString(14)); strVO.setStr_ma(rs.getString(15)); strVO.setStr_rep(rs.getInt(16)); strVO.setStr_long(rs.getDouble(17)); strVO.setStr_lat(rs.getDouble(18)); String text = rs.getString(19); if(text != null) { strVO.setStr_note(text); } else { strVO.setStr_note("Wait......"); } } } catch (ClassNotFoundException ce) { throw new RuntimeException("Couldn't load database driver. " + ce.getMessage()); } catch (SQLException se) { throw new RuntimeException("A database error occured. " + se.getMessage()); } catch (IOException e) { e.printStackTrace(System.err); } finally { try { if(con != null) { con.close(); } } catch (SQLException e) { e.printStackTrace(); } } return strVO; } @Override public List<StrVO> getAll() { Connection con = null; PreparedStatement state = null; ResultSet rs = null; StrVO strVO = null; List<StrVO> strList = new ArrayList<>(); try { Class.forName(DRIVER); con = DriverManager.getConnection(URL, USER, PASSWORD); state = con.prepareStatement(GET_ALL); rs = state.executeQuery(); while(rs.next()) { strVO = new StrVO(); strVO.setStr_no(rs.getString("STR_NO")); strVO.setStr_name(rs.getString("STR_NAME")); strVO.setStr_cou(rs.getString("STR_COU")); strVO.setStr_city(rs.getString("STR_CITY")); strVO.setStr_addr(rs.getString("STR_ADDR")); strVO.setStr_tel(rs.getString("STR_TEL")); strVO.setStr_atn(rs.getString("STR_ATN")); strVO.setStr_pre(rs.getInt("STR_PRE")); strVO.setStr_ship(rs.getString("STR_SHIP")); strVO.setStoca_no(rs.getString("STOCA_NO")); strVO.setStr_acc(rs.getString("STR_ACC")); strVO.setStr_pas(rs.getString("STR_PAS")); byte[] pic = rs.getBytes("STR_IMG"); if(pic != null) { strVO.setStr_img(pic); } else { strVO.setStr_img(ShareTool.sendPicture("images/nopic.png")); } strVO.setStr_stat(rs.getString("STR_STAT")); strVO.setStr_ma(rs.getString("STR_MA")); strVO.setStr_rep(rs.getInt("STR_REP")); strVO.setStr_long(rs.getDouble("STR_LONG")); strVO.setStr_lat(rs.getDouble("STR_LAT")); String text = rs.getString("STR_NOTE"); if(text != null) { strVO.setStr_note(text); } else { strVO.setStr_note(ShareTool.sendInfo("info/noFile.txt")); } strList.add(strVO); } } catch (ClassNotFoundException ce) { throw new RuntimeException("Couldn't load database driver. " + ce.getMessage()); } catch (SQLException se) { throw new RuntimeException("A database error occured. " + se.getMessage()); } catch(IOException e) { e.printStackTrace(System.err); } finally { try { if(con != null) { con.close(); } } catch (SQLException e) { e.printStackTrace(); } } return strList; } @Override public List<StrVO> findByArea(String area) { Connection con = null; PreparedStatement state = null; ResultSet rs = null; StrVO strVO = null; List<StrVO> areaList = new ArrayList<>(); try { Class.forName(DRIVER); con = DriverManager.getConnection(URL, USER, PASSWORD); state = con.prepareStatement(FIND_BY_AREA); state.setString(1, "%" + area + "%"); rs = state.executeQuery(); while(rs.next()) { strVO = new StrVO(); strVO.setStr_no(rs.getString(1)); strVO.setStr_name(rs.getString(2)); strVO.setStr_cou(rs.getString(3)); strVO.setStr_city(rs.getString(4)); strVO.setStr_addr(rs.getString(5)); strVO.setStr_tel(rs.getString(6)); strVO.setStr_atn(rs.getString(7)); strVO.setStr_pre(rs.getInt(8)); strVO.setStr_ship(rs.getString(9)); strVO.setStoca_no(rs.getString(10)); strVO.setStr_acc(rs.getString(11)); strVO.setStr_pas(rs.getString(12)); strVO.setStr_img(rs.getBytes(13)); strVO.setStr_stat(rs.getString(14)); strVO.setStr_ma(rs.getString(15)); strVO.setStr_rep(rs.getInt(16)); strVO.setStr_long(rs.getDouble(17)); strVO.setStr_lat(rs.getDouble(18)); strVO.setStr_note(rs.getString(19)); areaList.add(strVO); } } catch (ClassNotFoundException ce) { throw new RuntimeException("Couldn't load database driver. " + ce.getMessage()); } catch (SQLException se) { throw new RuntimeException("A database error occured. " + se.getMessage()); } finally { try { if(con != null) { con.close(); } } catch (SQLException e) { e.printStackTrace(); } } return areaList; } @Override public List<StrVO> findByStoca(String stoca_no) { Connection con = null; PreparedStatement state = null; ResultSet rs = null; StrVO strVO = null; List<StrVO> stocaList = new ArrayList<>(); try { Class.forName(DRIVER); con = DriverManager.getConnection(URL, USER, PASSWORD); state = con.prepareStatement(FIND_BY_STOCA_NO); state.setString(1, stoca_no); rs = state.executeQuery(); while(rs.next()) { strVO = new StrVO(); strVO.setStr_no(rs.getString(1)); strVO.setStr_name(rs.getString(2)); strVO.setStr_cou(rs.getString(3)); strVO.setStr_city(rs.getString(4)); strVO.setStr_addr(rs.getString(5)); strVO.setStr_tel(rs.getString(6)); strVO.setStr_atn(rs.getString(7)); strVO.setStr_pre(rs.getInt(8)); strVO.setStr_ship(rs.getString(9)); strVO.setStoca_no(rs.getString(10)); strVO.setStr_acc(rs.getString(11)); strVO.setStr_pas(rs.getString(12)); strVO.setStr_img(rs.getBytes(13)); strVO.setStr_stat(rs.getString(14)); strVO.setStr_ma(rs.getString(15)); strVO.setStr_rep(rs.getInt(16)); strVO.setStr_long(rs.getDouble(17)); strVO.setStr_lat(rs.getDouble(18)); strVO.setStr_note(rs.getString(19)); stocaList.add(strVO); } } catch (ClassNotFoundException ce) { throw new RuntimeException("Couldn't load database driver. " + ce.getMessage()); } catch (SQLException se) { throw new RuntimeException("A database error occured. " + se.getMessage()); } finally { try { if(con != null) { con.close(); } } catch (SQLException e) { e.printStackTrace(); } } return stocaList; } @Override public void updateInfo_Img(StrVO strVO) { Connection con = null; PreparedStatement state = null; try { Class.forName(DRIVER); con = DriverManager.getConnection(URL, USER, PASSWORD); state = con.prepareStatement(UPDATE_INFO_IMG); state.setBytes(1, strVO.getStr_img()); state.setString(2, strVO.getStr_no()); state.execute(); } catch (ClassNotFoundException ce) { throw new RuntimeException("Couldn't load database driver. " + ce.getMessage()); } catch (SQLException se) { throw new RuntimeException("A database error occured. " + se.getMessage()); } finally { if(con != null) { try { con.close(); } catch (SQLException e) { e.printStackTrace(System.err); } } } } }
[ "ip8016@yahoo.com.tw" ]
ip8016@yahoo.com.tw
0b85a2a1013c67e6c781cbbb946bb7aab5b04358
21da6ac6d4e1e12a46c54480c2d1893ed397d00b
/app/src/main/java/com/helw/m/anew/ui/tab2/Holder/Tab2TypeOneHolder.java
629b2a5611f427f155ab3c7dcf3f1b29f2b8dce9
[]
no_license
HandsomeBoy11/NewFramework
5befc4ef406d56b17aecdeee986d69ba40089d74
1a7dfc4432cb2a0415beeab370eea836afc3f181
refs/heads/master
2020-03-26T21:18:14.067446
2018-09-19T02:57:37
2018-09-19T02:57:37
145,379,398
0
0
null
null
null
null
UTF-8
Java
false
false
1,301
java
package com.helw.m.anew.ui.tab2.Holder; import android.view.View; import android.widget.TextView; import com.helw.m.anew.R; import com.helw.m.anew.framework.base.BaseViewHolder; import com.helw.m.anew.ui.tab2.adapter.TabTwoAdapter; import com.helw.m.anew.ui.tab2.bean.ItemData; import java.util.List; /** * Created by user on 2018/8/13. */ public class Tab2TypeOneHolder extends BaseViewHolder<ItemData> { private TextView tvTypeName; private View mItemView; public Tab2TypeOneHolder(View itemView) { super(itemView); this.mItemView=itemView; tvTypeName = (TextView) itemView.findViewById(R.id.tv_type_name); } @Override public void bindHolder(final ItemData itemData, final int position, boolean isShow, final TabTwoAdapter.OnItemClickListener listener) { tvTypeName.setText(itemData.title); if(isShow){ tvTypeName.setVisibility(View.VISIBLE); }else{ tvTypeName.setVisibility(View.GONE); } mItemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if(listener!=null){ listener.onItemClickListener(view,itemData,position); } } }); } }
[ "2209119121@qq.com" ]
2209119121@qq.com
9192b086615a7ef4f1affcad59267bcf7b65e995
f96be6a4371766abb9b90b7d6185ee97df1a4adb
/src/gui/popup/Renderer.java
060623522ac428b5f27b4a083cf5c498bed8106f
[]
no_license
ogrady/psqlv
c940350ddc580cb5fb421311f9ee43ce1f848d09
2139c66e1ee4411562598f80121bd86e62fd2dea
refs/heads/master
2016-09-05T09:43:26.435977
2013-12-20T18:19:43
2013-12-20T18:19:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
272
java
package gui.popup; import java.awt.Graphics; abstract public class Renderer<R> { protected R _renderable; public Renderer(final R renderable) { _renderable = renderable; } abstract public void render(final Graphics g, final int x, final int y); }
[ "danielogrady@gmx.de" ]
danielogrady@gmx.de
268d054f61180999efb1015f06b472079442c20b
24e4abc4d5dfb2b6fd33c33c693e4fca0da091a1
/ECsite/src/java/Mapper/Item.java
6f61102228133c49cd5583c49c74d4fa3380ee2d
[]
no_license
dekosuketarou/EC-
50a0bb8ad4690aedfdb3cde1ce49709b939a7c35
c0113b54574463554e26d17848a5a7d5248bc1b4
refs/heads/master
2021-07-15T08:09:37.129086
2017-10-19T06:52:20
2017-10-19T06:52:20
105,131,064
0
0
null
null
null
null
UTF-8
Java
false
false
3,127
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 Mapper; import Data.ShopDataBeans; import ECsiteLogic.LogicBeans; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; /** * * @author guest1Day */ public class Item extends HttpServlet { /** * Processes requests for both HTTP <code>GET</code> and <code>POST</code> * methods. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); try (PrintWriter out = response.getWriter()) { request.setCharacterEncoding("UTF-8"); HttpSession session = request.getSession(); //search.jspで選択した商品をクエストリングを利用してitemCodeを取得、その後LogicBeansクラスメソッドoneSearchにて商品情報を取得 ShopDataBeans sdb=LogicBeans.getInstance().oneSearch(request.getParameter("code")); //単一の商品情報oneSearchを登録 session.setAttribute("oneSearch",sdb); request.getRequestDispatcher("item.jsp").forward(request, response); } catch (Exception e) { System.out.print(e); } } // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> /** * Handles the HTTP <code>GET</code> method. * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Handles the HTTP <code>POST</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Returns a short description of the servlet. * * @return a String containing servlet description */ @Override public String getServletInfo() { return "Short description"; }// </editor-fold> }
[ "dekosuke.tarou@gmail.com" ]
dekosuke.tarou@gmail.com
b19b124409271cc3a9171abae31586ce86625367
8cea44f65d4a0c705bc051921880e7fe667625b3
/src/dbconnection/SearchEngine.java
5ba82a52b5bfd9d465c633da43064ca396a84d2a
[]
no_license
twarm/PCFactory
7d09ae3e2def1ccddeb5ca08cb24937e992eb6d6
8475d37a147ce22df9d0d46247700f491629c646
refs/heads/master
2021-01-01T19:25:22.405132
2014-12-04T07:24:34
2014-12-04T07:24:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,690
java
package dbconnection; import java.lang.reflect.Field; import java.sql.*; import java.util.ArrayList; import java.lang.Boolean; /** * Search Engine is used to deploy sqls in tables by giving an object. The class * name should be same as the table name and all declared public fields should * be exactly same and in the same order to the columns' names. * * @author Jianyu Wang(@jw3236@drexel.edu) */ public class SearchEngine { private Connection conn = null; /** * Get a list by giving an object. Empty object will return all entries in * the table. Every non-empty attribute will be viewed as a search * constraint. * * @param obj * @return */ public ArrayList getObject(Object obj) { ArrayList result = new ArrayList(); try { String sql = getSearchSql(obj); Statement statement = conn.createStatement(); ResultSet rs = statement.executeQuery(sql); Object o, var; Class type = obj.getClass(); Field[] fields = type.getFields(); while (rs.next()) { o = type.newInstance(); for (int i = 0; i < fields.length; i++) { var = rs.getString(i + 1); if (var == null) continue; else { Class vartype = fields[i].getType(); if (vartype == int.class) fields[i].setInt(o, Integer.parseInt(var.toString())); else if (vartype == double.class) fields[i].setDouble(o, Double.parseDouble(var.toString())); else if (vartype == Date.class) { fields[i].set(o, Date.valueOf(var.toString())); } else fields[i].set(o, var.toString()); } } result.add(o); } statement.close(); rs.close(); } catch (Exception e) { e.printStackTrace(); } return result; } public boolean updateObject(Object obj) { String sql = getPrimaryKeySql(obj); try { Statement statement = conn.createStatement(); ResultSet rs = statement.executeQuery(sql); ArrayList list = new ArrayList(); while (rs.next()) { Object o = rs.getString("cname"); list.add(o); } rs.close(); Class type = obj.getClass(); Field[] fields = type.getFields(); StringBuffer query = new StringBuffer(); StringBuffer condition = new StringBuffer(); query.append("UPDATE " + getSimpleName(type.getName()) + " SET "); condition.append(" WHERE 1=1 "); int b = 0; for (int i = 0; i < fields.length; i++) { if (exist(list, fields[i].getName())) { condition.append("AND " + fields[i].getName() + " = "); condition.append(getSqlValue(fields[i].get(obj))); } else { Object o = fields[i].get(obj); if (o != null) { Class tempt = fields[i].getType(); if (tempt == double.class || tempt == int.class) { if (Double.parseDouble(o.toString()) != 0 || fields[i].getName().equals("isDel")) { if (b == 1) { query.append(", "); } else { b = 1; } query.append(fields[i].getName() + " = " + o); } } else { if (b == 1) { query.append(" AND "); } else { b = 1; } query.append(fields[i].getName() + " = '" + o + "'"); } } } } sql = query.append(condition).toString(); statement.execute(sql); statement.close(); } catch (Exception e) { e.printStackTrace(); return false; } return true; } public boolean insertObject(Object obj) { String sql = getPrimaryKeySql(obj); try { Statement statement = conn.createStatement(); ResultSet rs = statement.executeQuery(sql); ArrayList list = new ArrayList(); while (rs.next()) { list.add(rs.getObject("cname")); } rs.close(); Class type = obj.getClass(); Field[] fields = type.getFields(); StringBuffer query = new StringBuffer(); query.append("INSERT INTO " + getSimpleName(type.getName()) + " VALUES( "); for (int i = 0; i < fields.length; i++) { if (exist(list, fields[i].getName())) { continue; } else { query.append(getSqlValue(fields[i].get(obj)) + ","); } } query.deleteCharAt(query.length() - 1); query.append(")"); sql = query.toString(); statement.execute(sql); statement.close(); } catch (Exception e) { e.printStackTrace(); return false; } return true; } public boolean deleteObject(Object obj) { String sql = getPrimaryKeySql(obj); try { Statement statement = conn.createStatement(); ResultSet rs = statement.executeQuery(sql); ArrayList list = new ArrayList(); while (rs.next()) { list.add(rs.getString("cname")); } rs.close(); Class type = obj.getClass(); Field[] fields = type.getFields(); StringBuffer query = new StringBuffer(); StringBuffer condition = new StringBuffer(); query.append("UPDATE " + getSimpleName(type.getName()) + " SET "); condition.append(" WHERE 1=1 "); int b = 0; for (int i = 0; i < fields.length; i++) { if (exist(list, fields[i].getName())) { condition.append("AND " + fields[i].getName() + " = "); condition.append(getSqlValue(fields[i].get(obj))); } else if (fields[i].getName().equals("isdel")) { query.append(" isDel = 1 "); b = 1; } } sql = query.append(condition).toString(); if (b == 1) { statement.execute(sql); } statement.close(); } catch (Exception e) { e.printStackTrace(); return false; } return true; } public String getPrimaryKeySql(Object obj) { StringBuffer builder = new StringBuffer(); builder.append("SELECT cols.table_name, cols.column_name cname, cols.position position, cons.status, cons.owner"); builder.append(" FROM all_constraints cons, all_cons_columns cols"); builder.append(" WHERE cols.table_name = '" + getSimpleName(obj.getClass().getName()).toUpperCase() + "'"); builder.append(" AND cons.constraint_type = 'P'"); builder.append(" AND cons.constraint_name = cols.constraint_name"); builder.append(" AND cons.owner = cols.owner"); builder.append(" ORDER BY cols.table_name, cols.position"); return builder.toString(); } public String getSearchSql(Object obj) { StringBuffer builder = new StringBuffer(); StringBuffer condition = new StringBuffer(); builder.append("SELECT "); condition.append(" WHERE 1=1 "); Class type = obj.getClass(); Field[] fields = type.getFields(); for (int i = 0; i < fields.length; i++) { builder.append(fields[i].getName() + ","); Object o; try { o = fields[i].get(obj); if (o != null) { Class tempt = fields[i].getType(); if (tempt == double.class || tempt == int.class) { if (Double.parseDouble(o.toString()) != 0 || fields[i].getName().equals("isDel")) condition.append(" AND " + fields[i].getName() + " = " + o); } else { condition.append(" AND " + fields[i].getName() + " = '" + o + "'"); } } } catch (Exception e) { e.printStackTrace(); } } builder.deleteCharAt(builder.length() - 1); builder.append(" FROM " + getSimpleName(type.getName())); builder.append(condition); return builder.toString(); } public String getSqlValue(Object obj) { Class type = obj.getClass(); if (type == Integer.class || type == Double.class) return obj.toString(); else return "'" + obj.toString() + "'"; } public String getInsertSql(Object obj) { StringBuffer builder = new StringBuffer(); Class type = obj.getClass(); builder.append("INSERT INTO " + getSimpleName(type.getName()) + " VALUES ("); Field[] fields = type.getFields(); return builder.toString(); } public String getSimpleName(String name) { String result = ""; int flag = 0; for (int i = 0; i < name.length(); i++) { if (name.charAt(i) == '.' && i < name.length() - 1) flag = i + 1; } result = name.substring(flag); return result; } public boolean exist(ArrayList list, String s) { for (int i = 0; i < list.size(); i++) { if (list.get(i).toString().equals(s)) { list.remove(i); return true; } } return false; } public Connection openDBConnection(String user, String pass, String SID, String host, int port) throws SQLException, ClassNotFoundException { String driver = "oracle.jdbc.driver.OracleDriver"; String url = "jdbc:oracle:thin:@" + host + ":" + port + ":" + SID; String username = user; String password = pass; Class.forName(driver); conn = DriverManager.getConnection(url, username, password); return conn; } public void closeDBConnection() { try { conn.close(); } catch (SQLException e) { e.printStackTrace(); } } public void LoadConnection(Connection con) { conn = con; } public SearchEngine() { } public SearchEngine(Connection con) { conn = con; } }
[ "twarm@qq.com" ]
twarm@qq.com
50e42ec1c7a54ca05b4b2caf1ea4002acfd2a10f
1a3cb5941d7e98e4ca18e901266322267255ceed
/DatosDeportivosCarmen/src/main/java/com/acing/eventos/LocalContraVisitante.java
587de50afe4bda5fea553070eb83e6033cfc3be1
[]
no_license
CarmenDC/ddCarmen
fdededeaf79b814b81547e3b044fc02c523efe4d
94d8b33eee568c26cdc4083d678e6c5e0f53e02b
refs/heads/master
2020-04-28T19:12:37.354215
2019-03-17T21:20:22
2019-03-17T21:20:22
175,504,272
0
0
null
null
null
null
UTF-8
Java
false
false
141
java
package com.acing.eventos; public interface LocalContraVisitante { // Participante getLocal(); // Participante getVisitante(); }
[ "noreply@github.com" ]
noreply@github.com
f23b70b996caa80c85bc38f4a63ba9916b7d536b
6ff7c0f40a85af119013c4aa1c423dda2860be13
/src/catchup_4/ThePowerSum.java
24b5bbb449810e417abc42c7bd933e4c6c78e7c0
[]
no_license
juno1985/Softcits201909
89a6691ec6f380d6b8326b2bb6d156f3b306b7d4
a8d19f7b00ac2cf19aea4857866c4df63c80e792
refs/heads/master
2021-06-21T05:12:29.066975
2021-05-09T08:17:44
2021-05-09T08:17:44
211,429,217
1
5
null
null
null
null
UTF-8
Java
false
false
1,292
java
package catchup_4; import java.io.*; import java.math.*; import java.security.*; import java.text.*; import java.util.*; import java.util.concurrent.*; import java.util.regex.*; public class ThePowerSum { // Complete the powerSum function below. static int powerSum(int X, int N) { return findWays(X, 1, N); } static int findWays(int sum, int num, int power) { //如果有num int remains = sum - (int)Math.pow(num, power); if(remains == 0) return 1; else if(remains < 0) return 0; else { return findWays(remains, num+1, power) + findWays(sum, num+1, power); } } private static final Scanner scanner = new Scanner(System.in); public static void main(String[] args) throws IOException { BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(System.getenv("OUTPUT_PATH"))); int X = scanner.nextInt(); scanner.skip("(\r\n|[\n\r\u2028\u2029\u0085])?"); int N = scanner.nextInt(); scanner.skip("(\r\n|[\n\r\u2028\u2029\u0085])?"); int result = powerSum(X, N); bufferedWriter.write(String.valueOf(result)); bufferedWriter.newLine(); bufferedWriter.close(); scanner.close(); } }
[ "wangzhen_tju@126.com" ]
wangzhen_tju@126.com
27a18bcfeb09b7b9055d7bed68305cd59fa663f0
7bee56dc860cd07934fc4282a9e8e29d19797c08
/workspace/org.dafoe.terminologiclevel/src/org/dafoe/terminologiclevel/terminologycard/termautocomplete/AutocompleteTerm.java
519d1dbbf8aaa2be06f321b8b58e5528acd82118
[]
no_license
ics-upmc/Dafoe
789834898719ac301381d7f4a852f9ea887c6ee1
0cacb779bf4b05b85c71b631e934be04455fc982
refs/heads/master
2021-01-17T04:32:16.044849
2012-02-28T19:36:31
2012-02-28T19:36:31
3,574,208
1
0
null
null
null
null
IBM852
Java
false
false
1,792
java
/******************************************************************************************************************************* * (c) Copyright 2007, 2010 CRITT Informatique and INSERM, LISI/ENSMA, MONDECA, LIPN, IRIT, SUPELEC, TÚlÚcom ParisTech, CNRS/UTC. * All rights reserved. * This program has been developed by the CRITT Informatique for the ANR DAFOE4App Project. * This program and the accompanying materials are made available under the terms * of the CeCILL-C Public License v1 which accompanies this distribution, * and is available at http://www.cecill.info/licences/Licence_CeCILL-C_V1-fr.html * * Contributors: * INSERM, LISI/ENSMA, MONDECA, LIPN, IRIT, SUPELEC, TÚlÚcom ParisTech, CNRS/UTC and CRITT Informatique - specifications * CRITT Informatique - initial API and implementation ********************************************************************************************************************************/ package org.dafoe.terminologiclevel.terminologycard.termautocomplete; import java.util.List; import org.dafoe.framework.core.terminological.model.ITerm; import org.eclipse.jface.fieldassist.ContentProposalAdapter; import org.eclipse.jface.fieldassist.TextContentAdapter; import org.eclipse.swt.widgets.Text; public abstract class AutocompleteTerm extends AutocompleteWidget { protected Text text = null; public AutocompleteTerm(Text text, List<ITerm> selectionItems) { if (text != null) { this.text = text; provider = getContentProposalProvider(selectionItems); adapter = new ContentProposalAdapter(text, new TextContentAdapter(), provider, getActivationKeystroke(), getAutoactivationChars()); adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE); } } }
[ "laurent.mazuel@gmail.com" ]
laurent.mazuel@gmail.com
6a19f5b4b17f97b59b57b48c2852f7cf8cbef052
1adcca5e88d8ab087fa03d73bd6c4317bcc6fbb0
/Selenium/src/com/project/reuse/POM_reuse.java
8c664e8b05a2d4337d880ad5f1ed749ca31f9e0a
[]
no_license
AnuragQA/seleniumproject
6473284166a43a6622f8e3c297840540f7e3e132
54344b4a88711aa102b0629b8f0e5a4e15e15301
refs/heads/master
2021-09-01T19:11:58.239415
2017-12-28T10:47:27
2017-12-28T10:47:27
113,830,259
0
0
null
null
null
null
UTF-8
Java
false
false
938
java
package com.project.reuse; import java.io.FileInputStream; import java.io.IOException; import java.util.Properties; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.CacheLookup; import org.openqa.selenium.support.FindBy; import org.testng.annotations.Test; public class POM_reuse { public FileInputStream fs; public Properties pr; @FindBy(id="txtUsername") @CacheLookup WebElement usr; @FindBy(id="txtPassword") @CacheLookup WebElement pas; @FindBy(id="btnLogin") @CacheLookup WebElement btn; @FindBy(xpath="html/body/div[1]/div[1]/a[2]") @CacheLookup WebElement wel; @Test public String login(String user,String passs) throws IOException { usr.sendKeys(user); pas.sendKeys(passs); btn.click(); String exp="Welcome Admin"; String act=wel.getText(); if (exp.equals(act)) { return "PASS"; } else { return "FAIL"; } } }
[ "Anurag@Anurag-PC" ]
Anurag@Anurag-PC
dcaf0babe8591cd3b8e3589f9ee587fc4116b43c
9fdf315ef4bdf2b5fa7ff9c1c496bb4b584d3fb9
/src/main/java/za/ac/cput/chapter5/chainResponsibilityPattern/PersonEnum.java
5d108ac88d7dcd2cafef2833a2d34ddbebf9513d
[]
no_license
molemo53/Chapter5
55373902de7093bdf0a289b515bfda3176b2f78b
d1cc11dfed08f308e7f0b8e5ebe36f10a62d6f13
refs/heads/master
2016-09-08T02:40:23.164761
2015-03-13T11:09:18
2015-03-13T11:09:18
32,151,416
0
0
null
null
null
null
UTF-8
Java
false
false
160
java
package za.ac.cput.chapter5.chainResponsibilityPattern; /** * Created by student on 2015/03/13. */ public enum PersonEnum { Student, FireMan, Police; }
[ "molemo53@gmail.com" ]
molemo53@gmail.com
a6e3972dd782522b720391e049a41687e917cfcc
8a78613828696416c82622e24ed21547502a68dd
/odin-cloud-basic-service/src/main/java/com/pxene/odin/cloud/domain/model/BrandModel.java
0040a3990a6b67a739ab4890e06be6ed4530a325
[]
no_license
odindsp/odin-cloud-aggregator
6cce58057b245064cab0495bef898ad599170fcf
952b52ab0ef47a141950371c9383f5417bedc1f1
refs/heads/master
2021-09-08T10:55:33.140999
2018-03-09T10:41:47
2018-03-09T10:41:47
124,527,209
1
0
null
null
null
null
UTF-8
Java
false
false
396
java
package com.pxene.odin.cloud.domain.model; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @Data @NoArgsConstructor @AllArgsConstructor public class BrandModel { /** * 品牌ID */ private Integer id; /** * 中文名称 */ private String cnName; /** * 英文名称 */ private String enName; /** * 等级 */ private String grade; }
[ "lichunguang@pxene.com" ]
lichunguang@pxene.com
463f027aa92b04681419ae9f8756f6868364c9bf
71071f98d05549b67d4d6741e8202afdf6c87d45
/files/Spring_Data_Commons/DATACMNS-1114/src/main/java/org/springframework/data/repository/config/RepositoryBeanDefinitionRegistrarSupport.java
be814041334b323c77c121be119b493289be890d
[]
no_license
Sun940201/SpringSpider
0adcdff1ccfe9ce37ba27e31b22ca438f08937ad
ff2fc7cea41e8707389cb62eae33439ba033282d
refs/heads/master
2022-12-22T09:01:54.550976
2018-06-01T06:31:03
2018-06-01T06:31:03
128,649,779
1
0
null
2022-12-16T00:51:27
2018-04-08T14:30:30
Java
UTF-8
Java
false
false
3,964
java
/* * Copyright 2012-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * 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.springframework.data.repository.config; import java.lang.annotation.Annotation; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.context.EnvironmentAware; import org.springframework.context.ResourceLoaderAware; import org.springframework.context.annotation.ImportBeanDefinitionRegistrar; import org.springframework.core.env.Environment; import org.springframework.core.io.ResourceLoader; import org.springframework.core.type.AnnotationMetadata; import org.springframework.util.Assert; /** * Base class to implement {@link ImportBeanDefinitionRegistrar}s to enable repository * * @author Oliver Gierke */ public abstract class RepositoryBeanDefinitionRegistrarSupport implements ImportBeanDefinitionRegistrar, ResourceLoaderAware, EnvironmentAware { private ResourceLoader resourceLoader; private Environment environment; /* * (non-Javadoc) * @see org.springframework.context.ResourceLoaderAware#setResourceLoader(org.springframework.core.io.ResourceLoader) */ @Override public void setResourceLoader(ResourceLoader resourceLoader) { this.resourceLoader = resourceLoader; } /* * (non-Javadoc) * @see org.springframework.context.EnvironmentAware#setEnvironment(org.springframework.core.env.Environment) */ @Override public void setEnvironment(Environment environment) { this.environment = environment; } /* * (non-Javadoc) * @see org.springframework.context.annotation.ImportBeanDefinitionRegistrar#registerBeanDefinitions(org.springframework.core.type.AnnotationMetadata, org.springframework.beans.factory.support.BeanDefinitionRegistry) */ public void registerBeanDefinitions(AnnotationMetadata annotationMetadata, BeanDefinitionRegistry registry) { Assert.notNull(resourceLoader, "ResourceLoader must not be null!"); Assert.notNull(annotationMetadata, "AnnotationMetadata must not be null!"); Assert.notNull(registry, "BeanDefinitionRegistry must not be null!"); // Guard against calls for sub-classes if (annotationMetadata.getAnnotationAttributes(getAnnotation().getName()) == null) { return; } AnnotationRepositoryConfigurationSource configurationSource = new AnnotationRepositoryConfigurationSource( annotationMetadata, getAnnotation(), resourceLoader, environment, registry); RepositoryConfigurationExtension extension = getExtension(); RepositoryConfigurationUtils.exposeRegistration(extension, registry, configurationSource); RepositoryConfigurationDelegate delegate = new RepositoryConfigurationDelegate(configurationSource, resourceLoader, environment); delegate.registerRepositoriesIn(registry, extension); } /** * Return the annotation to obtain configuration information from. Will be wrappen into an * {@link AnnotationRepositoryConfigurationSource} so have a look at the constants in there for what annotation * attributes it expects. * * @return */ protected abstract Class<? extends Annotation> getAnnotation(); /** * Returns the {@link RepositoryConfigurationExtension} for store specific callbacks and {@link BeanDefinition} * post-processing. * * @see RepositoryConfigurationExtensionSupport * @return */ protected abstract RepositoryConfigurationExtension getExtension(); }
[ "527474541@qq.com" ]
527474541@qq.com
73a49b634658ec900d6783a4d704d64b3ada603e
bae2b7af18c59edd2601defd9ba66e222eb169eb
/adou-common/src/main/java/adou/common/jedis/JedisClient.java
057687c2e35177a2a36e98835cbd56b982c7df53
[]
no_license
adouhuges/ssmcloud
5cc0c0b87913828bbdd66aa7134f02cd1a6d9248
4b7092f0e71f7c5301a31d61edead21364e09a57
refs/heads/master
2020-05-14T14:55:38.579589
2019-04-17T07:53:01
2019-04-17T07:53:01
181,843,349
0
0
null
null
null
null
UTF-8
Java
false
false
498
java
package adou.common.jedis; import java.util.List; public interface JedisClient { String set(String key, String value); String get(String key); Boolean exists(String key); Long expire(String key, int seconds); Long ttl(String key); Long incr(String key); Long hset(String key, String field, String value); String hget(String key, String field); Long hdel(String key, String... field); Boolean hexists(String key, String field); List<String> hvals(String key); Long del(String key); }
[ "549007747@qq.com" ]
549007747@qq.com
09af8502672606c7352a4c33a75b08f24e1eb825
2d05a12bc03b4cf4021597c8b48ff534fe0a1a4e
/app/src/main/java/org/amoradi/syncopoli/IBackupItemClickHandler.java
1a7452a7e4cc15307f099bc0cfa70720b0664f81
[]
no_license
ajay9889/Syncopoli
b6913e3501720db84a6632197cfbfff25bb7e598
4cc9f79b5cafb38937dc54d169c372d3d1304d8c
refs/heads/master
2023-03-01T06:15:35.630179
2021-02-10T08:00:23
2021-02-10T08:00:23
25,211,935
0
0
null
null
null
null
UTF-8
Java
false
false
234
java
package org.amoradi.syncopoli; interface IBackupItemClickHandler { void onBackupShowLog(int pos); void onBackupEdit(int pos); void onBackupCopy(int pos); void onBackupDelete(int pos); void onBackupRun(int pos); }
[ "“ajay@pndbash.com”" ]
“ajay@pndbash.com”
0ebb48507a479a940040438512728fe2b9a3e05b
504aca8447e765955fd9a3d0ab96e75e11d2df39
/android/src/main/java/com/voxeet/specifics/RNRootViewProvider.java
6d59003e1e5335c982c1408bb1b0c46c5ed44f0c
[ "Apache-2.0" ]
permissive
codlab/react-native-voxeet-conferencekit
16241764808a0fad34e1aeca44b8b5ec68060405
666360d8794d8b908905a0b6fbc9dddeeb00158d
refs/heads/master
2020-03-28T13:13:52.068893
2019-11-18T14:15:54
2019-11-18T14:15:54
148,376,507
0
0
null
null
null
null
UTF-8
Java
false
false
4,371
java
package com.voxeet.specifics; import android.app.Activity; import android.app.Application; import android.os.Bundle; import android.support.annotation.NonNull; import com.voxeet.notification.RNIncomingBundleChecker; import com.voxeet.notification.RNIncomingCallActivity; import com.voxeet.sdk.VoxeetSdk; import com.voxeet.sdk.events.sdk.ConferenceStateEvent; import com.voxeet.sdk.json.ConferenceDestroyedPush; import com.voxeet.sdk.services.SessionService; import com.voxeet.toolkit.controllers.VoxeetToolkit; import com.voxeet.toolkit.providers.rootview.DefaultRootViewProvider; import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; public class RNRootViewProvider extends DefaultRootViewProvider { private final Application mApplication; private RNIncomingBundleChecker mRNIncomingBundleChecker; /** * @param application a valid application which be called to obtain events * @param toolkit */ public RNRootViewProvider(@NonNull Application application, @NonNull VoxeetToolkit toolkit) { super(application, toolkit); mApplication = application; } @Override public void onActivityCreated(Activity activity, Bundle bundle) { super.onActivityCreated(activity, bundle); if (!RNIncomingCallActivity.class.equals(activity.getClass())) { mRNIncomingBundleChecker = new RNIncomingBundleChecker(mApplication, activity.getIntent(), null); mRNIncomingBundleChecker.createActivityAccepted(activity); } } @Override public void onActivityStarted(Activity activity) { super.onActivityStarted(activity); } @Override public void onActivityResumed(Activity activity) { super.onActivityResumed(activity); if (!RNIncomingCallActivity.class.equals(activity.getClass())) { if (null != VoxeetSdk.instance()) { VoxeetSdk.instance().register(this); } if (!EventBus.getDefault().isRegistered(this)) { EventBus.getDefault().register(this); //registering this activity } RNIncomingBundleChecker checker = RNIncomingCallActivity.REACT_NATIVE_ROOT_BUNDLE; if (null != checker && checker.isBundleValid()) { SessionService sessionService = VoxeetSdk.session(); if (null != sessionService && sessionService.isSocketOpen()) { checker.onAccept(); RNIncomingCallActivity.REACT_NATIVE_ROOT_BUNDLE = null; } } //TODO next steps, fix this call here /*mRNIncomingBundleChecker = new CordovaIncomingBundleChecker(mApplication, activity.getIntent(), null); if (mRNIncomingBundleChecker.isBundleValid()) { mRNIncomingBundleChecker.onAccept(); }*/ } } @Override public void onActivityPaused(Activity activity) { super.onActivityPaused(activity); if (EventBus.getDefault().isRegistered(this)) EventBus.getDefault().unregister(this); } @Override public void onActivityStopped(Activity activity) { super.onActivityStopped(activity); } @Override public void onActivitySaveInstanceState(Activity activity, Bundle bundle) { super.onActivitySaveInstanceState(activity, bundle); } @Override public void onActivityDestroyed(Activity activity) { super.onActivityDestroyed(activity); } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Specific event used to manage the current "incoming" call feature * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @Subscribe(threadMode = ThreadMode.MAIN) public void onEvent(ConferenceStateEvent event) { switch (event.state) { case JOINING: case JOINED: case JOINED_ERROR: if (mRNIncomingBundleChecker != null) mRNIncomingBundleChecker.flushIntent(); default: } } @Subscribe(threadMode = ThreadMode.MAIN) public void onEvent(ConferenceDestroyedPush event) { if (mRNIncomingBundleChecker != null) mRNIncomingBundleChecker.flushIntent(); } }
[ "codlabtech@gmail.com" ]
codlabtech@gmail.com
9cb612fd6f84cc33e5d7d6e4ec5b0ede41934411
16554b2951f04335777f2938352bc1b55fd7d724
/src/java/model/TipArticle.java
7d21e668cad7d429f0bb9ef0140c1ebb5cb23ec7
[]
no_license
JovanovicJovan/webproject2
49a6c41edd55f2b2b6fd216b4ed0ec5caec45cca
88a238fe842b799daa9351cb83759f369a456d8e
refs/heads/master
2021-09-16T22:32:08.464846
2018-06-25T14:57:35
2018-06-25T14:57:35
120,785,586
0
0
null
null
null
null
UTF-8
Java
false
false
858
java
package model; // Generated Feb 11, 2018 2:03:32 PM by Hibernate Tools 4.3.1 /** * TipArticle generated by hbm2java */ public class TipArticle implements java.io.Serializable { private Integer id; private Articles articles; private Tips tips; public TipArticle() { } public TipArticle(Articles articles, Tips tips) { this.articles = articles; this.tips = tips; } public Integer getId() { return this.id; } public void setId(Integer id) { this.id = id; } public Articles getArticles() { return this.articles; } public void setArticles(Articles articles) { this.articles = articles; } public Tips getTips() { return this.tips; } public void setTips(Tips tips) { this.tips = tips; } }
[ "jjovanovic24@hotmail.com" ]
jjovanovic24@hotmail.com
f8476c5bba31a8b6e3feb96e5ccbf22ec9719c19
05ec3d799d6cdda4b731ecfe2e641725526ac242
/src/homeWork/_20_task_3/Color.java
afcf0d0bc053f08c6b2b40d6bf7be57901fc9c32
[]
no_license
aishashirin/Attractor
eb749bce5eeb1a69669639066dda92d758269b1a
31a156cf7ee06aca21e7d91f448d190db5c6bde2
refs/heads/master
2023-01-01T07:27:04.103519
2020-10-03T19:13:06
2020-10-03T19:13:06
299,646,563
0
0
null
null
null
null
UTF-8
Java
false
false
66
java
package homeWork._20_task_3; public enum Color { W, B; }
[ "aishashirina@gmail.com" ]
aishashirina@gmail.com
a5046b6f5f7dd5cb8b55bcc9e579b5948520b5d1
383acfed81be60b409740563ff066d470d5f9c21
/FloorDecor/src/main/java/com/floor/decor/demo/security/UserDetailsImpl.java
ad159ac8ecf14db9c7268a345333de508c8987a6
[]
no_license
VarshilPanchal/FloorDecorBackend
b4b7fd1967f602e6d03c5d4d9f2df5243e5b1740
f1b592dc598be20664c5e6a7b2f56d659c6a5c9f
refs/heads/master
2022-12-03T20:47:43.088576
2020-08-23T12:09:12
2020-08-23T12:09:12
262,116,085
0
0
null
null
null
null
UTF-8
Java
false
false
2,290
java
package com.floor.decor.demo.security; import java.util.Collection; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; import com.fasterxml.jackson.annotation.JsonIgnore; import com.floor.decor.demo.entity.User; public class UserDetailsImpl implements UserDetails { private static final long serialVersionUID = 1L; private Long id; private String username; private String email; @JsonIgnore private String password; private Collection<? extends GrantedAuthority> authorities; public UserDetailsImpl(Long id, String username, String email, String password, Collection<? extends GrantedAuthority> authorities) { this.id = id; this.username = username; this.email = email; this.password = password; this.authorities = authorities; } public static UserDetailsImpl build(User user) { List<GrantedAuthority> authorities = user.getRoles().stream() .map(role -> new SimpleGrantedAuthority(role.getName().name())) .collect(Collectors.toList()); return new UserDetailsImpl( user.getId(), user.getUsername(), user.getEmail(), user.getPassword(), authorities); } @Override public Collection<? extends GrantedAuthority> getAuthorities() { return authorities; } public Long getId() { return id; } public String getEmail() { return email; } @Override public String getPassword() { return password; } @Override public String getUsername() { return username; } @Override public boolean isAccountNonExpired() { return true; } @Override public boolean isAccountNonLocked() { return true; } @Override public boolean isCredentialsNonExpired() { return true; } @Override public boolean isEnabled() { return true; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; UserDetailsImpl user = (UserDetailsImpl) o; return Objects.equals(id, user.id); } }
[ "55729000+JSK-Developers@users.noreply.github.com" ]
55729000+JSK-Developers@users.noreply.github.com
75738e14e0a9495054edd49916d1ee3a5c0b5bb8
0ee9e262dbbafafa4764df27b8548d35a64034a5
/src/main/java/io/github/adamwaniak/application/config/JacksonConfiguration.java
6cd9893c42864f708936d74f674a3d67354ba4b4
[]
no_license
awaniak/EQuiz
7a9a5163a5cfb2e4c55cd255bffd0b044bb0c6ff
b1c1cd2d9e55d0e4a503e35ede06266216e2cf29
refs/heads/master
2020-03-26T20:00:00.741649
2019-02-11T12:49:55
2019-02-11T12:49:55
145,298,511
0
0
null
2018-12-12T13:30:51
2018-08-19T11:48:56
TypeScript
UTF-8
Java
false
false
1,246
java
package io.github.adamwaniak.application.config; import com.fasterxml.jackson.datatype.hibernate5.Hibernate5Module; import com.fasterxml.jackson.module.afterburner.AfterburnerModule; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.zalando.problem.ProblemModule; import org.zalando.problem.validation.ConstraintViolationProblemModule; @Configuration public class JacksonConfiguration { /* * Support for Hibernate types in Jackson. */ @Bean public Hibernate5Module hibernate5Module() { return new Hibernate5Module(); } /* * Jackson Afterburner module to speed up serialization/deserialization. */ @Bean public AfterburnerModule afterburnerModule() { return new AfterburnerModule(); } /* * Module for serialization/deserialization of RFC7807 Problem. */ @Bean ProblemModule problemModule() { return new ProblemModule(); } /* * Module for serialization/deserialization of ConstraintViolationProblem. */ @Bean ConstraintViolationProblemModule constraintViolationProblemModule() { return new ConstraintViolationProblemModule(); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
2b3914ab7b4fffac9efcd95b29a7760150cfb2d7
f9668ad4e7ead540cd57ff11f068dca44b772491
/Lesson 8/Ex17/JavaAppiumMaven/src/test/java/lib/UI/MainPageObject.java
8ca04844a4e9c64e2052c2b30b121f1665c46d15
[ "Apache-2.0" ]
permissive
Tolyasher/mobile_automation_training_29
bbe61a7ffa3045a9c1ac3411f210ca0e9b128d9f
b965b9f76ade8aa85c81f1aa1ce01eb141ac4033
refs/heads/master
2022-12-19T23:10:25.936454
2020-09-08T13:27:49
2020-09-08T13:27:49
277,871,709
0
0
Apache-2.0
2020-10-14T00:25:15
2020-07-07T16:44:56
JavaScript
UTF-8
Java
false
false
11,741
java
package lib.UI; import io.appium.java_client.AppiumDriver; import io.appium.java_client.TouchAction; import io.appium.java_client.touch.WaitOptions; import io.appium.java_client.touch.offset.PointOption; import org.junit.Assert; import org.openqa.selenium.By; import org.openqa.selenium.Dimension; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebElement; import org.openqa.selenium.remote.RemoteWebDriver; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; import lib.Platform; import java.time.Duration; import java.util.List; import java.util.concurrent.TimeUnit; import java.util.regex.Pattern; public class MainPageObject { protected RemoteWebDriver driver; public MainPageObject (RemoteWebDriver driver) { this.driver = driver; } public WebElement waitForElementPresent(String locator, String error_message, long timeoutInSeconds) { By by = this.getLocatorByString(locator); WebDriverWait wait = new WebDriverWait(driver, timeoutInSeconds); wait.withMessage(error_message + "\n"); return wait.until( ExpectedConditions.presenceOfElementLocated(by) ); } public WebElement waitForElementPresent(String locator, String error_message) { return waitForElementPresent(locator, error_message, 10); } public WebElement waitForElementAndClick(String locator, String error_message, long timeoutInSeconds) { WebElement element = waitForElementPresent(locator, error_message, timeoutInSeconds); element.click(); return element; } public WebElement waitForElementAndSendKeys(String locator, String value, String error_message, long timeoutInSeconds) { WebElement element = waitForElementPresent(locator, error_message, timeoutInSeconds); element.sendKeys(value); return element; } public boolean waitForElementNotPresent(String locator, String error_message, long timeoutInSeconds) { By by = this.getLocatorByString(locator); WebDriverWait wait = new WebDriverWait(driver, timeoutInSeconds); wait.withMessage(error_message + "\n"); return wait.until( ExpectedConditions.invisibilityOfElementLocated(by) ); } public WebElement waitForElementAndClear(String locator, String error_message, long timeoutInSeconds) { WebElement element = waitForElementPresent(locator, error_message, timeoutInSeconds); element.clear(); return element; } public void assertElementHasText(String locator, String element_text_expected, String error_message, long timeoutInSeconds) { WebElement element = waitForElementPresent(locator, "Cannot find specific element", timeoutInSeconds); String element_text_actual = element.getAttribute("text"); Assert.assertEquals( error_message, element_text_expected, element_text_actual ); } public void assertElementContainsText(String locator, String element_text_expected, String error_message, long timeoutInSeconds) { WebElement element = waitForElementPresent(locator, "Cannot find specific element", timeoutInSeconds); String element_text_actual = element.getAttribute("text"); Assert.assertTrue( "'"+ element_text_actual + "'" + " does not contain word " + "'" +element_text_expected +"'", element_text_actual.contains(element_text_expected) ); } public void swipeUp(int timeOfSwipe) { if (driver instanceof AppiumDriver){ TouchAction action= new TouchAction((AppiumDriver) driver); Dimension size = driver.manage().window().getSize(); int x = (int) (size.width/2); int start_y = (int) (size.height*0.8); int end_y = (int) (size.height*0.2); action .press(PointOption.point(x, start_y)) .waitAction(WaitOptions.waitOptions(Duration.ofMillis(timeOfSwipe))) .moveTo(PointOption.point(x, end_y)) .release() .perform(); }else{ System.out.println("Method swipeUp() does nothing for platform " + Platform.getInstance().getPlatformVar()); } } public void swipeUpQuick() { swipeUp(200); } public void scrollWebPageUp(){ if (Platform.getInstance().isMW()){ JavascriptExecutor JSExecutor = (JavascriptExecutor) driver; JSExecutor.executeScript("window.scrollBy(0, 250)"); } else{ System.out.println("Method scrollWebPageUp() does nothing for platform " + Platform.getInstance().getPlatformVar()); } } public void scrollWebPageTillElementNotVisible(String locator, String error_message, int max_swipes){ int already_swiped = 0; WebElement element = this.waitForElementPresent(locator, error_message); while ( !this.isElementLocatedOnTheScreen(locator)){ scrollWebPageUp(); ++already_swiped; if (already_swiped > max_swipes){ Assert.assertTrue(error_message, element.isDisplayed()); } } } public void swipeUpToFindElement(String locator, String error_message, int max_swipes) { By by = this.getLocatorByString(locator); int already_swiped = 0; while (driver.findElements(by).size() == 0){ if (already_swiped > max_swipes){ waitForElementPresent(locator, "Cannot find element by swiping up. \n" + error_message, 0); return; } swipeUpQuick(); ++already_swiped; } } public void swipeUpTillElementAppear (String locator, String error_message, int max_swipes) { int already_swiped = 0; while (!this.isElementLocatedOnTheScreen(locator)){ if (already_swiped > max_swipes){ Assert.assertTrue(error_message, this.isElementLocatedOnTheScreen(locator)); } swipeUpQuick(); ++already_swiped; } } public boolean isElementLocatedOnTheScreen (String locator) { int element_location_by_y = this.waitForElementPresent(locator, "Cannot find element by locator", 10).getLocation().getY(); if (Platform.getInstance().isMW()){ JavascriptExecutor JSExecutor = (JavascriptExecutor) driver; Object js_result = JSExecutor.executeScript("return window.pageYOffset"); element_location_by_y -= Integer.parseInt(js_result.toString()); } int screen_size_by_y = driver.manage().window().getSize().getHeight(); return element_location_by_y < screen_size_by_y; } public void clickElementToTheRightUpperCorner(String locator, String error_message) { if (driver instanceof AppiumDriver) { WebElement element = this.waitForElementPresent(locator + "/..", error_message); int right_x = element.getLocation().getX(); int upper_y = element.getLocation().getY(); int lower_y = upper_y + element.getSize().getHeight(); int middle_y = (upper_y + lower_y) / 2; int width = element.getSize().getWidth(); int point_to_click_x = (right_x + width) - 3; int point_to_click_y = middle_y; TouchAction action = new TouchAction((AppiumDriver) driver); action.tap(PointOption.point(point_to_click_x, point_to_click_y)).perform(); } else{ System.out.println("Method clickElementToTheRightUpperCorner() does nothing for platform" + Platform.getInstance().getPlatformVar()); } } public void swipeElementToLeft(String locator, String error_message) { if (driver instanceof AppiumDriver) { WebElement element = waitForElementPresent( locator, error_message, 10); int left_x = element.getLocation().getX(); int right_x = left_x + element.getSize().getWidth(); int upper_y = element.getLocation().getY(); int lower_y = upper_y + element.getSize().getHeight(); int middle_y = (upper_y + lower_y) / 2; TouchAction action = new TouchAction( (AppiumDriver) driver); action.press(PointOption.point(right_x, middle_y)); action.waitAction(WaitOptions.waitOptions(Duration.ofMillis(200))); if (Platform.getInstance().isAndroid()) { action.moveTo(PointOption.point(left_x, middle_y)); } else { int offset_x = (-1 * element.getSize().getWidth()); action.moveTo(PointOption.point(offset_x, 0)); } action.release(); action.perform(); }else{ System.out.println("Method swipeElementToLeft() does nothing for platform" + Platform.getInstance().getPlatformVar()); } } public int getAmountOfElements(String locator) { By by = this.getLocatorByString(locator); List elements = driver.findElements(by); return elements.size(); } public boolean isElementPresent(String locator){ return getAmountOfElements(locator)>0; } public void tryClickElementWithFewAttempts(String locator, String error_message, int amount_of_attempts) { int current_attempts = 0; boolean need_more_attempts = true; while (need_more_attempts){ try{ this.waitForElementAndClick(locator, error_message,5); need_more_attempts = false; } catch (Exception e){ if (current_attempts > amount_of_attempts){ this.waitForElementAndClick(locator, error_message,5); } } ++current_attempts; } } public void assertElementNotPresent(String locator, String error_message) { int ammountOfElements = getAmountOfElements(locator); if (ammountOfElements > 0){ String default_message = "An element '" + locator + "' supposed to be not present"; throw new AssertionError(default_message +" " + error_message); } } public String waitForElementAndGetAttribute(String locator, String attribute, String error_message, long timeoutInSeconds) { WebElement element = waitForElementPresent(locator, error_message, timeoutInSeconds); return element.getAttribute(attribute); } public void assertElementPresent(String locator, String error_message) { int ammountOfElements = getAmountOfElements(locator); if (ammountOfElements == 0){ String default_message = "An element '" + locator + "' supposed to be not exists."; throw new AssertionError(default_message +" " + error_message); } } private By getLocatorByString (String locator_with_type) { String[] exploded_locator = locator_with_type.split(Pattern.quote(":"),2); String by_type = exploded_locator[0]; String locator = exploded_locator[1]; if (by_type.equals("xpath")){ return By.xpath(locator); } else if (by_type.equals("id")){ return By.id(locator); } else if (by_type.equals("css")){ return By.cssSelector(locator); }else { throw new IllegalArgumentException("Cannot get type of locator. Locator: " + locator_with_type); } } }
[ "tolyasher2000@mail.ru" ]
tolyasher2000@mail.ru
524c72dc50c6f127db6c0669fe22b1b130a18b6a
4056e1aab67f5ddead85bb11efc0d8fd2dbca858
/java/the voice/CountingProcessor.java
5e7a579c80c9e99c81dc14e04d26c1c48465a995
[]
no_license
zhtk/csboring
a671ec1363ff0c7c7f23c98af7719a9d9ab257ed
496374c1aebecd1e2569a54e74f216dd4d4e905a
refs/heads/master
2022-05-07T04:08:52.925383
2019-07-26T18:38:44
2019-07-26T18:38:50
84,849,260
0
0
null
2022-04-12T21:54:59
2017-03-13T16:25:52
Haskell
UTF-8
Java
false
false
1,503
java
import java.util.ArrayList; import java.util.HashSet; public class CountingProcessor implements Processor { private ArrayList<Result> results; protected class Result { public final String artist; public final int count; Result(String artist, int count) { this.artist = artist; this.count = count; } } public CountingProcessor() { results = new ArrayList<>(); } @Override public void process(String artistName, ArtistData data) { HashSet<String> set = new HashSet<>(); int i = 0; String[] song; while((song = data.getSong(i++)) != null) for(String word: song) if(word.compareTo("") != 0) set.add(word.toLowerCase()); results.add(new Result(artistName, set.size())); } @Override public String toString() { results.sort( (Result r1, Result r2) -> { if(r1.count == r2.count) return 0; else if(r1.count > r2.count) return -1; else return 1; }); StringBuilder sb = new StringBuilder(); sb.append("count:\n"); for(Result r: results) sb.append(r.artist).append(" ").append(r.count).append("\n"); String res = sb.toString(); return res.substring(0, res.length() - 1); } }
[ "pz361374@students.mimuw.edu.pl" ]
pz361374@students.mimuw.edu.pl
64fe32376b3c49f9f45233e375eee0074ce8565a
beebdf843e7d41bdcbd78f5642d89310ed888c6c
/app/src/main/java/br/com/wiltencirdg/ratetattoo/Description.java
8706ea29017a884d761c16c2d404efe34499de36
[]
no_license
WiltencirDG/RateTattoo
9b5b27526184e1463f41fd849f64b055fedb9053
e44fff3dcec9243bee3b5348e9fb6a368e1ecb0e
refs/heads/master
2021-01-10T14:37:02.638879
2018-09-13T18:10:59
2018-09-13T18:10:59
55,601,322
0
0
null
null
null
null
UTF-8
Java
false
false
2,367
java
package br.com.wiltencirdg.ratetattoo; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import android.widget.ImageView; import android.widget.RatingBar; import android.widget.TextView; import com.example.android.ratetattoo.R; public class Description extends AppCompatActivity{ private ImageView ivImage; private TextView tvName; private TextView tvAddress; private TextView tvPhone; private GetStudios studios; private Button btnMap; private ImageView ivToolbar; private Button btnVote; private RatingBar ratebar; protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.description); studios = (GetStudios)getIntent().getSerializableExtra("studio"); setUI(); setData(studios); setMap(); setToolbar(); } private void setUI(){ ivImage = (ImageView) findViewById(R.id.iv_shop); tvName = (TextView) findViewById(R.id.tv_n_shop); tvAddress = (TextView) findViewById(R.id.tv_a_shop); tvPhone = (TextView) findViewById(R.id.tv_p_shop); btnMap = (Button) findViewById(R.id.btn_map); btnVote = (Button) findViewById(R.id.btn_votar); ratebar = (RatingBar) findViewById(R.id.ratebar); } private void setToolbar(){ ivToolbar = (ImageView) findViewById(R.id.ic_tool); ivToolbar.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { onBackPressed(); } }); } private void setData(GetStudios studios){ ivImage.setImageResource(studios.getIdImage()); tvName.setText(studios.getName()); tvAddress.setText(studios.getAddress()); tvPhone.setText(studios.getPhone()); } private void setMap(){ btnMap.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Maps(studios); } }); } private void Maps(GetStudios studios){ Intent intent = new Intent(Description.this, Maps.class); intent.putExtra("studios", studios); startActivity(intent); } }
[ "wiltencir@gmail.com" ]
wiltencir@gmail.com
ffcce612fff44f570bb6b054aa7ab12ced52b910
08648d8fe512996872c86ccc1857923371d4e27a
/code/de.quamoco.qm.docbook/generated-src/de/quamoco/qm/docbook/Corpcredit.java
80d72a979970178b8aa9fa184cb90b8a6ff4d122
[ "Apache-2.0" ]
permissive
SoftwareEngineeringToolDemos/ICSE-2011-Quamoco
09d8a1a096df962ee930cba6d57bba733af93627
e20756ec54ba759fcf8c24c1a78a9a0c5f6adb30
refs/heads/master
2021-01-17T06:54:37.025507
2016-06-24T21:57:23
2016-06-24T21:57:23
44,106,743
0
1
null
null
null
null
UTF-8
Java
false
false
15,697
java
/*-------------------------------------------------------------------------+ | | | Copyright 2012 Technische Universitaet Muenchen and | | Fraunhofer-Institut fuer Experimentelles Software Engineering (IESE) | | | | 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. | | | +-------------------------------------------------------------------------*/ // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2009.11.18 at 02:47:21 PM CET // package de.quamoco.qm.docbook; import java.util.ArrayList; import java.util.List; import javax.xml.bind.JAXBElement; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElementRef; import javax.xml.bind.annotation.XmlElementRefs; import javax.xml.bind.annotation.XmlID; import javax.xml.bind.annotation.XmlMixed; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;group ref="{}docinfo.char.mix" maxOccurs="unbounded" minOccurs="0"/> * &lt;attGroup ref="{}corpcredit.attlist"/> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "content" }) public class Corpcredit { @XmlElementRefs({ @XmlElementRef(name = "emphasis", type = JAXBElement.class), @XmlElementRef(name = "link.char.class", type = JAXBElement.class), @XmlElementRef(name = "inlinegraphic", type = JAXBElement.class), @XmlElementRef(name = "ndxterm.class", type = NdxTerm2 .class), @XmlElementRef(name = "superscript", type = Superscript.class), @XmlElementRef(name = "trademark", type = JAXBElement.class), @XmlElementRef(name = "remark", type = Remark.class), @XmlElementRef(name = "inlinemediaobject", type = JAXBElement.class), @XmlElementRef(name = "replaceable", type = JAXBElement.class), @XmlElementRef(name = "subscript", type = Subscript.class) }) @XmlMixed protected List<Object> content; @XmlAttribute(name = "class") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) protected String clazz; @XmlAttribute(name = "lang") @XmlSchemaType(name = "anySimpleType") protected String attLang; @XmlAttribute @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlID @XmlSchemaType(name = "ID") protected String id; @XmlAttribute @XmlJavaTypeAdapter(CollapsedStringAdapter.class) protected String revisionflag; @XmlAttribute @XmlSchemaType(name = "anySimpleType") protected String vendor; @XmlAttribute @XmlSchemaType(name = "anySimpleType") protected String condition; @XmlAttribute @XmlSchemaType(name = "anySimpleType") protected String security; @XmlAttribute(name = "conformance") @XmlSchemaType(name = "NMTOKENS") protected List<String> conformances; @XmlAttribute @XmlSchemaType(name = "anySimpleType") protected String wordsize; @XmlAttribute @XmlSchemaType(name = "anySimpleType") protected String revision; @XmlAttribute @XmlSchemaType(name = "anySimpleType") protected String os; @XmlAttribute @XmlSchemaType(name = "anySimpleType") protected String arch; @XmlAttribute @XmlSchemaType(name = "anySimpleType") protected String userlevel; @XmlAttribute @XmlSchemaType(name = "anySimpleType") protected String xreflabel; @XmlAttribute @XmlSchemaType(name = "anySimpleType") protected String remap; @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace") @XmlSchemaType(name = "anySimpleType") protected String base; @XmlAttribute @XmlJavaTypeAdapter(CollapsedStringAdapter.class) protected String dir; @XmlAttribute @XmlSchemaType(name = "anySimpleType") protected String role; /** * Gets the value of the content property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the content property. * * <p> * For example, to add a new item, do as follows: * <pre> * getContent().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link JAXBElement }{@code <}{@link Ulink }{@code >} * {@link JAXBElement }{@code <}{@link Emphasis }{@code >} * {@link NdxTerm2 } * {@link Superscript } * {@link JAXBElement }{@code <}{@link Trademark }{@code >} * {@link JAXBElement }{@code <}{@link Inlinemediaobject }{@code >} * {@link JAXBElement }{@code <}{@link Olink }{@code >} * {@link String } * {@link Subscript } * {@link JAXBElement }{@code <}{@link NdxTerm2Type }{@code >} * {@link JAXBElement }{@code <}{@link Object }{@code >} * {@link JAXBElement }{@code <}{@link Inlinegraphic }{@code >} * {@link Remark } * {@link JAXBElement }{@code <}{@link Link }{@code >} * {@link JAXBElement }{@code <}{@link Replaceable }{@code >} * * */ public List<Object> getContent() { if (content == null) { content = new ArrayList<Object>(); } return this.content; } /** * Gets the value of the clazz property. * * @return * possible object is * {@link String } * */ public String getClazz() { return clazz; } /** * Sets the value of the clazz property. * * @param value * allowed object is * {@link String } * */ public void setClazz(String value) { this.clazz = value; } /** * Gets the value of the attLang property. * * @return * possible object is * {@link String } * */ public String getAttLang() { return attLang; } /** * Sets the value of the attLang property. * * @param value * allowed object is * {@link String } * */ public void setAttLang(String value) { this.attLang = value; } /** * Gets the value of the id property. * * @return * possible object is * {@link String } * */ public String getId() { return id; } /** * Sets the value of the id property. * * @param value * allowed object is * {@link String } * */ public void setId(String value) { this.id = value; } /** * Gets the value of the revisionflag property. * * @return * possible object is * {@link String } * */ public String getRevisionflag() { return revisionflag; } /** * Sets the value of the revisionflag property. * * @param value * allowed object is * {@link String } * */ public void setRevisionflag(String value) { this.revisionflag = value; } /** * Gets the value of the vendor property. * * @return * possible object is * {@link String } * */ public String getVendor() { return vendor; } /** * Sets the value of the vendor property. * * @param value * allowed object is * {@link String } * */ public void setVendor(String value) { this.vendor = value; } /** * Gets the value of the condition property. * * @return * possible object is * {@link String } * */ public String getCondition() { return condition; } /** * Sets the value of the condition property. * * @param value * allowed object is * {@link String } * */ public void setCondition(String value) { this.condition = value; } /** * Gets the value of the security property. * * @return * possible object is * {@link String } * */ public String getSecurity() { return security; } /** * Sets the value of the security property. * * @param value * allowed object is * {@link String } * */ public void setSecurity(String value) { this.security = value; } /** * Gets the value of the conformances property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the conformances property. * * <p> * For example, to add a new item, do as follows: * <pre> * getConformances().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link String } * * */ public List<String> getConformances() { if (conformances == null) { conformances = new ArrayList<String>(); } return this.conformances; } /** * Gets the value of the wordsize property. * * @return * possible object is * {@link String } * */ public String getWordsize() { return wordsize; } /** * Sets the value of the wordsize property. * * @param value * allowed object is * {@link String } * */ public void setWordsize(String value) { this.wordsize = value; } /** * Gets the value of the revision property. * * @return * possible object is * {@link String } * */ public String getRevision() { return revision; } /** * Sets the value of the revision property. * * @param value * allowed object is * {@link String } * */ public void setRevision(String value) { this.revision = value; } /** * Gets the value of the os property. * * @return * possible object is * {@link String } * */ public String getOs() { return os; } /** * Sets the value of the os property. * * @param value * allowed object is * {@link String } * */ public void setOs(String value) { this.os = value; } /** * Gets the value of the arch property. * * @return * possible object is * {@link String } * */ public String getArch() { return arch; } /** * Sets the value of the arch property. * * @param value * allowed object is * {@link String } * */ public void setArch(String value) { this.arch = value; } /** * Gets the value of the userlevel property. * * @return * possible object is * {@link String } * */ public String getUserlevel() { return userlevel; } /** * Sets the value of the userlevel property. * * @param value * allowed object is * {@link String } * */ public void setUserlevel(String value) { this.userlevel = value; } /** * Gets the value of the xreflabel property. * * @return * possible object is * {@link String } * */ public String getXreflabel() { return xreflabel; } /** * Sets the value of the xreflabel property. * * @param value * allowed object is * {@link String } * */ public void setXreflabel(String value) { this.xreflabel = value; } /** * Gets the value of the remap property. * * @return * possible object is * {@link String } * */ public String getRemap() { return remap; } /** * Sets the value of the remap property. * * @param value * allowed object is * {@link String } * */ public void setRemap(String value) { this.remap = value; } /** * Gets the value of the base property. * * @return * possible object is * {@link String } * */ public String getBase() { return base; } /** * Sets the value of the base property. * * @param value * allowed object is * {@link String } * */ public void setBase(String value) { this.base = value; } /** * Gets the value of the dir property. * * @return * possible object is * {@link String } * */ public String getDir() { return dir; } /** * Sets the value of the dir property. * * @param value * allowed object is * {@link String } * */ public void setDir(String value) { this.dir = value; } /** * Gets the value of the role property. * * @return * possible object is * {@link String } * */ public String getRole() { return role; } /** * Sets the value of the role property. * * @param value * allowed object is * {@link String } * */ public void setRole(String value) { this.role = value; } }
[ "stefan.wagner@informatik.uni-stuttgart.de" ]
stefan.wagner@informatik.uni-stuttgart.de
53cb6d31c2cae79d9e279a2c29abd846f65b7bf1
96edc5949e884f302f9d2caf4cf488c1f7968146
/cs340/src/gui/Main/GUI.java
83a14a8edde674ab5c54675861549a9799908df3
[]
no_license
jrasm91/byu-projects
f3fc2f422de38b229345dfa2ab9467bd128332dd
c1a2fc0452fdb23092cb61239c9c18b955bd64e1
refs/heads/master
2021-01-25T05:50:57.749808
2017-02-02T05:52:42
2017-02-02T05:52:42
80,695,007
0
0
null
null
null
null
UTF-8
Java
false
false
3,121
java
package gui.Main; import hypeerweb.HyPeerWeb; import java.awt.Dimension; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.JScrollPane; import distributed.GlobalObjectId; import distributed.LocalObjectId; import distributed.ObjectDB; /*** * The central GUI used to display information about the HyPeerWeb and debug information * * @author Matthew Smith * */ public class GUI extends JFrame { private static GUI singleton = null; private GlobalObjectId otherHyPeerWebAddress; private LocalObjectId localObjectId; /** Main Debugger Panel**/ private HyPeerWebDebugger debugger; private HyPeerWeb hypeerweb; private JScrollPane scrollPane; /** * Creates and initializes the GUI as being the root */ private GUI(HyPeerWeb hypeerweb){ this.hypeerweb = hypeerweb; this.setTitle("HyPeerWeb DEBUGGER V 1.1"); localObjectId = new LocalObjectId(-2); ObjectDB.getSingleton().store(new LocalObjectId(-2), this); this.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent we) { shutdown(); System.exit(0); } }); debugger = new HyPeerWebDebugger(this); scrollPane = new JScrollPane(debugger); scrollPane.setPreferredSize(new Dimension(debugger.WIDTH+20, debugger.HEIGHT)); this.getContentPane().add(scrollPane); this.pack(); } private void shutdown(){ hypeerweb.close(); } protected GUI(int i){ // do nothing } public static GUI getSingleton(HyPeerWeb hypeerweb){ if(singleton == null){ try{ singleton = new GUI(hypeerweb); singleton.setVisible(true); } catch(Exception e) { JOptionPane.showMessageDialog(null, e.getMessage(), "ERROR",JOptionPane.ERROR_MESSAGE); e.printStackTrace(); hypeerweb.close(); System.exit(1); } } return singleton; } public static boolean milestone2 = false; public static boolean milestone3 = false; public static boolean disconnected = false; /** * Start Point of the Program */ public static void main (String[] args){ HyPeerWeb hw = HyPeerWeb.getSingleton(); getSingleton(hw); } /** * Retrieves the HyPeerWeb Debugging Panel * @return HyPeerWebDebugger */ public GlobalObjectId getOtherHyPeerWebAddress() { assert otherHyPeerWebAddress != null; return otherHyPeerWebAddress; } public void setOtherHyPeerWebAddress(GlobalObjectId otherHyPeerWebAddress) { this.otherHyPeerWebAddress = otherHyPeerWebAddress; } public HyPeerWebDebugger getHyPeerWebDebugger(){ return this.debugger; } public HyPeerWeb getHyPeerWeb(){ return hypeerweb; } public void printToTracePanel(Object msg){ debugger.getTracePanel().print(msg); } public void finalize(){ hypeerweb.close(); } public void increaseSize(){ getHyPeerWebDebugger().getMapper().getNodeListing().increaseListSize(); } public void decreaseSize(){ getHyPeerWebDebugger().getMapper().getNodeListing().decreaseListSize(); } }
[ "jrasm91@gmail.com" ]
jrasm91@gmail.com
b174ae3ae76667995f287dfcc15f0d1b328c93da
f13145daa3979cf1a0b80436d952694251393d5b
/source/org/helm/editor/layout/utils/DockedSequenceLayouter.java
40439dfcd82bc851f9d96ac850dcf39f7de93228
[ "MIT" ]
permissive
raharjaliu/HELMEditor
acc1500d6243e0a583fd8ca25cbd44b867a6ff90
6d5d2c862fb5751c3159eefa0a9f9ef812d8efe0
refs/heads/master
2020-12-24T18:13:51.496246
2013-06-18T15:08:40
2013-06-18T15:08:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,287
java
/******************************************************************************* * Copyright C 2012, The Pistoia Alliance * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ******************************************************************************/ package org.helm.editor.layout.utils; import java.awt.Point; public class DockedSequenceLayouter extends AbstractSequenceLayouter { private boolean left2right; private int leftvoffset = 0; private int rightvoffset = 0; private Point dock; public DockedSequenceLayouter(Point dockPoint, boolean direction) { this.left2right = direction; this.dock = dockPoint; } @Override protected Point getNextPoint(Point point) { Point result = new Point(point); if (left2right) { result.x += metrics.distanceH; } else { result.x -= metrics.distanceH; } return result; } @Override protected Point getStartingPoint() { int x, y; if (left2right && (rightvoffset > 0)) { left2right = !left2right; } if (left2right) { x = dock.x + metrics.distanceH; y = dock.y + rightvoffset * metrics.distanceV; rightvoffset ++; } else { x = dock.x - metrics.distanceH; y = dock.y + leftvoffset * metrics.distanceV; leftvoffset ++; } return new Point(x, y); } }
[ "zhang.tianhong@gmail.com" ]
zhang.tianhong@gmail.com
a5b40e1307be57a457ab3c03444fdb87a665e26a
dd01c546942fd7971f50bf4fee8d25e01a93f314
/src/search/MySelfScore.java
cefa201011fe6013eeb6747bc1ba70008fe32611
[]
no_license
yinglish1997/luceneSearch
4fd4393eb1f610dacf1242c5921ced0b72953fe8
140b93c8aecf4eb0e3107caa5ee888b262ffdc49
refs/heads/master
2020-03-28T21:05:33.859096
2018-09-17T13:21:00
2018-09-17T13:21:00
149,128,093
1
0
null
null
null
null
UTF-8
Java
false
false
5,887
java
//package search; // ///* //import java.io.IOException; //import java.text.SimpleDateFormat; //import java.util.Date; // //import org.apache.lucene.analysis.standard.StandardAnalyzer; //import org.apache.lucene.document.Document; //import org.apache.lucene.index.AtomicReaderContext; //import org.apache.lucene.index.DirectoryReader; //import org.apache.lucene.index.Term; //import org.apache.lucene.queryparser.classic.QueryParser; ////import org.apache.lucene.queries.CustomScoreProvider; ////import org.apache.lucene.queries.CustomScoreQuery; //import org.apache.lucene.search.FieldCache; //import org.apache.lucene.search.FieldCache.Longs; //import org.apache.lucene.search.IndexSearcher; //import org.apache.lucene.search.Query; //import org.apache.lucene.search.ScoreDoc; //import org.apache.lucene.search.Sort; //import org.apache.lucene.search.TermQuery; //import org.apache.lucene.search.TopDocs; // ////import com.johnny.lucene04.advance_search.FileIndexUtils; // ///** // * 自定义评分第一种写法 // * (1)创建类并继承CustomScoreQuery // (2)覆盖重写类中的getCusomScoreProvider方法 // (3)创建类并继承CustomScoreProvider // (4)覆盖重写类中的customScore确定新的评分规则 // * @author Johnny // * // */ //public class MySelfScore { // public void searchBySelfScore(){ // try{ // IndexSearcher search = new IndexSearcher(DirectoryReader.open(FileIndexUtils.getDirectory())); // Query q = new TermQuery(new Term("content","java")); // MyCustomScoreQuery myQuery = new MyCustomScoreQuery(q); // TopDocs tds = search.search(myQuery, 200); // // SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // // for(ScoreDoc sd:tds.scoreDocs){ // Document d = search.doc(sd.doc); // System.out.println(sd.doc+":("+sd.score+")" + // "["+d.get("filename")+"【"+d.get("path")+"】--->"+ // d.get("size")+"-----"+sdf.format(new Date(Long.valueOf(d.get("date"))))+"]"); // // } // System.out.println("-----------Total result:"+tds.scoreDocs.length); // }catch(Exception e){ // e.printStackTrace(); // } // } // /** // *重写评分的实现方式 // * **/ // private class MyScoreProvider extends CustomScoreProvider{ // private AtomicReaderContext context; // public MyScoreProvider(AtomicReaderContext context) { // super(context); // this.context = context; // } // /**重写评分方法,假定需求为文档size大于1000的评分/1000**/ // @Override // public float customScore(int doc, float subQueryScore, float valSrcScore) // throws IOException { // // 从域缓存中加载索引字段信息 // Longs longs= FieldCache.DEFAULT.getLongs(context.reader(), "size", false); // //doc实际上就是Lucene中得docId // long size = longs.get(doc); // float ff = 1f;//判断加权 // if(size>1000){ // ff = 1f/1000; // } // /* // * 通过得分相乘放大分数 // * 此处可以控制与原有得分结合的方式,加减乘除都可以 // * **/ // return subQueryScore*valSrcScore*ff; // } // } // /** // * 重写CustomScoreQuery 的getCustomScoreProvider方法 // * 引用自定义的Provider // */ // private class MyCustomScoreQuery extends CustomScoreQuery{ // // public MyCustomScoreQuery(Query subQuery) { // super(subQuery); // } // @Override // protected CustomScoreProvider getCustomScoreProvider( // AtomicReaderContext context) throws IOException { // /**注册使用自定义的评分实现方式**/ // return new MyScoreProvider(context); // } // } //} // ////按照评分进行排序: // //public class ScoreSearch { // /** // * 按照评分进行排序 // */ // public void searchByScore(String queryStr,Sort sort){ // try{ // IndexSearcher search = new IndexSearcher(DirectoryReader.open(FileIndexUtils.getDirectory())); // QueryParser qp = new QueryParser(null, "content", new StandardAnalyzer(null)); // Query q = qp.parse(queryStr); // TopDocs tds = null; // if(sort!=null){ // tds = search.search(q, 200,sort); // }else{ // tds = search.search(q, 200); // } // for(ScoreDoc sd :tds.scoreDocs){ // Document d = search.doc(sd.doc); // System.out.println(sd.doc+":("+sd.score+")" + // "["+d.get("filename")+"【"+d.get("path")+"】---"+d.get("score")+"--->"+ // d.get("size")+"]"); // } // }catch(Exception e){ // e.printStackTrace(); // } // } // ////测试方法如下: // //@Test // public void testSearchByScore(){ // ScoreSearch ss = new ScoreSearch(); // /**sort没有set sort时,默认按照关联性进行排序**/ // Sort sort = new Sort(); // //sort.setSort(new SortField("score", Type.INT,true));//true表示倒叙,默认和false表示正序 // sort.setSort(new SortField("size", Type.LONG),new SortField("score",Type.INT)); // ss.searchByScore("java",sort); // } // // @Test // public void testSelfScore(){ // MySelfScore mss = new MySelfScore(); // /** // * 如果使用标准分词器,那么java类中得java.io.IOException会被认为是一个词,不会进行拆分 // */ // mss.searchBySelfScore(); // } // */ // **/
[ "yinglish@foxmail.com" ]
yinglish@foxmail.com
4087139e1516d464dc1d72fa83bf8cc8a652a4ef
20eb62855cb3962c2d36fda4377dfd47d82eb777
/IntroClassJava/dataset/digits/08c7ea4ac39aa6a5ab206393bb4412de9d2c365ecdda9c1b391be963c1811014ed23d2722d7433b8e8a95305eee314d39da4950f31e01f9147f90af91a5c433a/001/mutations/506/digits_08c7ea4a_001.java
5bb5b193dc7c649ddffd59926aa2baa1e479bc75
[]
no_license
ozzydong/CapGen
356746618848065cce4e253e5d3c381baa85044a
0ba0321b6b1191443276021f1997833342f02515
refs/heads/master
2023-03-18T20:12:02.923428
2020-08-21T03:08:28
2020-08-21T03:08:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,697
java
package introclassJava; class IntObj { public int value; public IntObj () { } public IntObj (int i) { value = i; } } class FloatObj { public float value; public FloatObj () { } public FloatObj (float i) { value = i; } } class LongObj { public long value; public LongObj () { } public LongObj (long i) { value = i; } } class DoubleObj { public double value; public DoubleObj () { } public DoubleObj (double i) { value = i; } } class CharObj { public char value; public CharObj () { } public CharObj (char i) { value = i; } } public class digits_08c7ea4a_001 { public java.util.Scanner scanner; public String output = ""; public static void main (String[]args) throws Exception { digits_08c7ea4a_001 mainClass = new digits_08c7ea4a_001 (); String output; if (args.length > 0) { mainClass.scanner = new java.util.Scanner (args[0]); } else { mainClass.scanner = new java.util.Scanner (System.in); } mainClass.exec (); System.out.println (mainClass.output); } public void exec () throws Exception { IntObj num = new IntObj (), numl = new IntObj (), n = new IntObj (), d0 = new IntObj (), d1 = new IntObj (), d2 = new IntObj (), d3 = new IntObj (), d4 = new IntObj (), d5 = new IntObj (), d6 = new IntObj (), d7 = new IntObj (), d8 = new IntObj (), d9 = new IntObj (); output += (String.format ("\nEnter an integer > ")); num.value = scanner.nextInt (); numl.value = num.value; n.value = 0; while (numl.value > 0) { n.value += 1; numl.value = numl.value / 10; } d0.value = num.value % 10; num.value = (num.value - d0.value) / 10; d1.value = num.value % 10; num.value = (num.value - d1.value) / 10; d2.value = num.value % 10; num.value = (num.value - d2.value) / 10; d3.value = num.value % 10; num.value = (num.value - d3.value) / 10; d4.value = num.value % 10; num.value = (num.value - d4.value) / 10; d5.value = num.value % 10; num.value = (num.value - d5.value) / 10; d6.value = num.value % 10; num.value = (num.value - d6.value) / 10; d7.value = num.value % 10; num.value = (num.value - d7.value) / 10; d8.value = num.value % 10; num.value = (num.value - d8.value) / 10; num.value = ((num.value) - (d4.value)) / 10 num.value = (num.value - d9.value) / 10; output += (String.format ("\n%d\n", d0.value)); if (n.value > 1) { output += (String.format ("%d\n", d1.value)); } if (n.value > 2) { output += (String.format ("%d\n", d2.value)); } if (n.value > 3) { output += (String.format ("%d\n", d3.value)); } if (n.value > 4) { output += (String.format ("%d\n", d4.value)); } if (n.value > 5) { output += (String.format ("%d\n", d5.value)); } if (n.value > 6) { output += (String.format ("%d\n", d6.value)); } if (n.value > 7) { output += (String.format ("%d\n", d7.value)); } if (n.value > 8) { output += (String.format ("%d\n", d8.value)); } if (n.value > 9) { output += (String.format ("%d\n", d9.value)); } output += (String.format ("That's all, have a nice day!\n")); if (true) return;; } }
[ "justinwm@163.com" ]
justinwm@163.com
2621889dd18b3aae831821855ad4dc6f68c6f60e
384730e7cb335734b96278b1dadb8d8da5d1de90
/src/test/java/com/kgteknoloji/cargo/CargoApplicationTests.java
9daa0e1a0f374b428f43e42849590ec557cfa8b8
[]
no_license
adundar47/cargo
05af9dbc0f10c9db5877f85c334017f3ba5a8124
fd6cbbab245517ffd4254f565d5fc31b3fc642d5
refs/heads/master
2020-09-06T14:56:47.798071
2019-11-08T12:10:50
2019-11-08T12:10:50
220,458,786
0
0
null
null
null
null
UTF-8
Java
false
false
221
java
package com.kgteknoloji.cargo; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class CargoApplicationTests { @Test void contextLoads() { } }
[ "ahmet.dundar@kgteknoloji.com" ]
ahmet.dundar@kgteknoloji.com
0beaa07de7fd8f8440f35d926e3e9974505c188d
8c2b7febd6a7a0977db055e69992ccd78d5e6621
/Code/bcds-web/src/main/java/gov/va/vba/web/rest/LookupResource.java
5645ddf6d6399573c301994a98fecc499538c65a
[ "Apache-2.0" ]
permissive
dominicyeh/BCDS
53d23b2d4ebf24357783f3513a338e5e556464aa
2d2794a3c09b35105330e0edeb02bc528d2eba90
refs/heads/master
2021-01-17T21:49:16.369346
2016-06-07T15:03:29
2016-06-07T15:03:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,508
java
package gov.va.vba.web.rest; import com.codahale.metrics.annotation.Timed; import gov.va.vba.domain.reference.Lookup; import gov.va.vba.persistence.repository.LookupRepository; import gov.va.vba.service.data.LookupDataService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import javax.inject.Inject; import java.net.URISyntaxException; import java.util.List; /** * REST controller for managing Lookup. */ @RestController @RequestMapping("/api") public class LookupResource { @Inject private LookupDataService lookupDataService; /** * GET /criteria -> get all the criteria. */ @RequestMapping(value = "/lookup", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @Timed public ResponseEntity<List<Lookup>> getAll(@RequestParam(value = "type" , required = false) String type, @RequestParam(value = "referenceId" , required = false) Long referenceId) throws URISyntaxException { if (type != null && referenceId != null){ return new ResponseEntity<>(lookupDataService.findByTypeAndReferenceId(type,referenceId), HttpStatus.OK); } else { return new ResponseEntity<>(lookupDataService.findAll(), HttpStatus.OK); } } }
[ "582163@bah.com" ]
582163@bah.com
e260532538f9730781d1629aa0382308092d652f
61199efc7f64143c38d5b6f4135f0fa2cb3b9c2d
/src/main/java/edu/mum/linkedapp/config/StaticResourceConfiguration.java
92e633590285e7db6ba42fbca201c63a5be259aa
[]
no_license
brhanebt/linkedapp
8d02e9c32263601f3e79ee2e826a98e94ddcbfa3
c9bbba1dad993956f011b2666f1bde32700c129b
refs/heads/master
2020-12-10T18:46:10.825965
2019-12-19T18:05:18
2019-12-19T18:05:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
621
java
package edu.mum.linkedapp.config; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; @Configuration public class StaticResourceConfiguration implements WebMvcConfigurer { @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("/userimg/**").addResourceLocations("file:upload-dir/"); } }
[ "33482700+brhanebt@users.noreply.github.com" ]
33482700+brhanebt@users.noreply.github.com
a5d546559412000d3c109d53386490ee64119ade
d1c053a1c02b783f83c675339aa7417ebfbe9c3f
/src/main/java/de/intarsys/tools/converter/FloatFromStringConverter.java
33e2673503e7eb51ca71cff569bac41064c14f32
[]
no_license
apwfw/isRuntime
6ef010477161464f056e104ee46531f0c9585240
e57d41bc80b5c57b508da50d3098c2f95147155f
refs/heads/master
2021-01-12T11:33:18.997288
2016-11-05T21:39:36
2016-11-05T21:39:36
72,949,402
0
0
null
null
null
null
UTF-8
Java
false
false
2,111
java
/* * Copyright (c) 2012, intarsys consulting GmbH * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of intarsys nor the names of its contributors may be used * to endorse or promote products derived from this software without specific * prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ package de.intarsys.tools.converter; /** * Convert a {@link String} to {@link Float} */ public class FloatFromStringConverter implements IConverter<String, Float> { public Float convert(String source) throws ConversionException { try { return (float) Double.parseDouble(source); } catch (Exception e) { throw new ConversionException(e); } } public Class<?> getSourceType() { return String.class; } public Class<?> getTargetType() { return Float.class; } }
[ "vitalii.naoumov@gmail.com" ]
vitalii.naoumov@gmail.com
fd0acdbd38353a13f72557d932a24b0c31e9f834
8044547a88aef095750838060742e147f1638855
/app/src/main/java/org/pibot/controler/MainActivity.java
1f1733a02ff61278203785e15a83ff18fa9563d0
[]
no_license
s79082/TelerobMobileControler
fe68ba970d39bc0a2caa4b772391c3ffe15c3f28
cfd6053ef881185ab49b915a232d5c15d5df8f65
refs/heads/main
2023-02-21T07:21:31.609798
2021-01-30T18:00:48
2021-01-30T18:00:48
334,475,997
0
0
null
2021-01-30T18:00:49
2021-01-30T17:50:10
null
UTF-8
Java
false
false
4,987
java
package org.pibot.controler; import android.app.Activity; import android.os.Bundle; import android.os.PersistableBundle; import android.util.Log; import android.view.MotionEvent; import android.view.View; import androidx.annotation.Nullable; import org.jivesoftware.smack.AbstractXMPPConnection; import org.jivesoftware.smack.SmackException; import org.jivesoftware.smack.chat.Chat; import org.jivesoftware.smack.chat.ChatManager; import org.jivesoftware.smack.tcp.XMPPTCPConnection; import org.jivesoftware.smack.tcp.XMPPTCPConnectionConfiguration; import org.jxmpp.jid.Jid; import org.jxmpp.jid.impl.JidCreate; import org.jxmpp.stringprep.XmppStringprepException; public class MainActivity extends Activity { AbstractXMPPConnection connection; Chat chat; Jid tojid; boolean claimed; static final String RECEIVER = "pibot@jabbers.one"; @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main_activity); try { this.connection = (new ConnectTask()).execute().get(); this.tojid = JidCreate.from("pibot@jabbers.one"); }catch (Exception e) { e.printStackTrace(); } this.chat = ChatManager.getInstanceFor(connection) .createChat(this.tojid.asEntityJidIfPossible()); /*try { XMPPTCPConnectionConfiguration configuration = XMPPTCPConnectionConfiguration.builder() .setUsernameAndPassword("pibot", "pibot_1234") .setXmppDomain(JidCreate.domainBareFrom("pibot@jabbers.one")) .setHost("jabbers.one") .setConnectTimeout(1000) .build(); //this.connection = new XMPPTCPConnection("pibot@jabbers.one", "pibot_1234"); this.connection = new XMPPTCPConnection(configuration); this.connection.connect(); this.connection.login(); this.tojid = JidCreate.from("pibot@jabbers.one"); Chat chat = ChatManager.getInstanceFor(connection) .createChat(this.tojid.asEntityJidIfPossible()); chat.sendMessage("claimcontrol"); } catch (Exception e) { Log.i("e", "error creating connection"); e.printStackTrace(); } /*try { this.connection = (new ConnectTask()).get(); } catch (Exception e) { e.printStackTrace(); }*/ this.findViewById(R.id.forward).setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { int action = event.getAction(); if (action == MotionEvent.ACTION_DOWN) { sendMessage("a"); } if(action == MotionEvent.ACTION_UP){ sendMessage("c"); } return true; } }); this.findViewById(R.id.side_left).setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { int action = event.getAction(); if(action == MotionEvent.ACTION_DOWN) sendMessage("b"); if(action == MotionEvent.ACTION_UP) sendMessage("c"); return true; } }); this.findViewById(R.id.side_right).setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { int action = event.getAction(); if(action == MotionEvent.ACTION_DOWN) sendMessage("d"); if(action == MotionEvent.ACTION_UP) sendMessage("c"); return true; } }); this.findViewById(R.id.reverse).setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { int action = event.getAction(); if(action == MotionEvent.ACTION_DOWN) sendMessage("e"); if(action == MotionEvent.ACTION_UP) sendMessage("c"); return true; } }); this.findViewById(R.id.stopp).setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { if(event.getAction() == MotionEvent.ACTION_DOWN) sendMessage("claimcontrol"); return true; } }); } public void sendMessage(String s) { try{ this.chat.sendMessage(s); }catch (Exception e) { e.printStackTrace(); } } }
[ "s79082@htw-dresden.de" ]
s79082@htw-dresden.de
1f48d9734de20ccd86f0be531c5f24181d3cb96b
f3998df7e951742160215af5ec831a56887e3ba2
/src/main/java/com/rc/gds/GDSBoxer.java
40defe798b8ab7f7edbf57e101cdd9aeda2d0f02
[ "Apache-2.0" ]
permissive
csz3824/async-elastic-orm
e6f682c9c17bc6996036b648d9eb3f3aac1c88da
0d044e9a2547d3757f5495f39330fd2dfe73da1d
refs/heads/master
2020-09-03T00:48:34.593906
2014-02-12T20:04:59
2014-02-12T20:04:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,935
java
package com.rc.gds; import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.TreeMap; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentSkipListMap; class GDSBoxer { public static Collection<Object> boxArray(Object array) { Collection<Object> collection = new ArrayList<Object>(); Class<?> compClass = array.getClass().getComponentType(); if (compClass == double.class) { double[] arr = (double[]) array; for (double i : arr) { collection.add(i); } } else if (compClass == int.class) { int[] arr = (int[]) array; for (int i : arr) { collection.add(i); } } else if (compClass == char.class) { char[] arr = (char[]) array; for (char i : arr) { collection.add(i); } } else if (compClass == byte.class) { byte[] arr = (byte[]) array; for (byte i : arr) { collection.add(i); } } else if (compClass == boolean.class) { boolean[] arr = (boolean[]) array; for (boolean i : arr) { collection.add(i); } } else if (compClass == short.class) { short[] arr = (short[]) array; for (short i : arr) { collection.add(i); } } else if (compClass == float.class) { float[] arr = (float[]) array; for (float i : arr) { collection.add(i); } } else if (compClass == long.class) { long[] arr = (long[]) array; for (long i : arr) { collection.add(i); } } else { Object[] arr = (Object[]) array; for (Object o : arr) { collection.add(o); } } return collection; } @SuppressWarnings("rawtypes") public static Object createBestFitCollection(Class<?> clazz) throws InstantiationException, IllegalAccessException { if (Modifier.isAbstract(clazz.getModifiers()) || clazz.isInterface()) { if (clazz.isAssignableFrom(ArrayList.class)) { return new ArrayList(); } else if (clazz.isAssignableFrom(HashSet.class)) { return new HashSet(); } else { throw new RuntimeException("Could not create a concrete collection for interface " + clazz.getName()); } } else { return clazz.newInstance(); } } @SuppressWarnings("rawtypes") public static Object createBestFitMap(Class<?> clazz) throws InstantiationException, IllegalAccessException { if (Modifier.isAbstract(clazz.getModifiers()) || clazz.isInterface()) { if (clazz.isAssignableFrom(HashMap.class)) { return new HashMap(); } else if (clazz.isAssignableFrom(TreeMap.class)) { return new TreeMap(); } else if (clazz.isAssignableFrom(ConcurrentHashMap.class)) { return new ConcurrentHashMap(); } else if (clazz.isAssignableFrom(ConcurrentSkipListMap.class)) { return new ConcurrentSkipListMap(); } else { throw new RuntimeException("Could not create a concrete map for interface " + clazz.getName()); } } else { return clazz.newInstance(); } } }
[ "ryanza@gmail.com" ]
ryanza@gmail.com
166d240c8957da3f1b5aa6e9b3d795ef4047d072
b2dbe97bb211f704c854e8a5e97c02059f530c52
/src/main/java/com/lepus/utils/JsonElement.java
657491c7fe7cbe819bef9259294d6266081adc86
[]
no_license
whenguycan/utils
6c72159a0a2cc03e37a1885b808daa26dc4a3465
6e6ee0dc1753d5f90179d2cacb38aad7bf01446e
refs/heads/master
2021-04-26T14:06:44.720747
2019-03-06T09:55:50
2019-03-06T09:55:50
75,913,890
0
0
null
null
null
null
UTF-8
Java
false
false
3,305
java
package com.lepus.utils; import java.io.Serializable; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import org.json.JSONArray; import org.json.JSONObject; /** * * @author whenguycan * @date 2018年1月30日 下午3:58:58 */ public class JsonElement implements Serializable{ private static final long serialVersionUID = 3576370599186573296L; public static JsonElement getData(JSONObject jsonObject){ try { return getElement(jsonObject, "data"); } catch (Exception e) { e.printStackTrace(); } return null; } public static JsonElement getElement(JSONObject jsonObject, String key){ JsonElement element = new JsonElement(); try { JSONObject obj = jsonObject.getJSONObject(key); Iterator<String> iter = obj.keys(); while(iter.hasNext()){ String k = iter.next(); Object v = obj.get(k); if(v instanceof JSONObject){ element.put(k, getElement(obj, k)); }else if(v instanceof JSONArray){ element.put(k, getElementList(obj, k)); }else{ element.put(k, v); } } return element; } catch (Exception e) { e.printStackTrace(); } return null; } public static List<JsonElement> getElementList(JSONObject jsonObject, String key){ List<JsonElement> list = new ArrayList<JsonElement>(); try { JSONArray jsonArr = jsonObject.getJSONArray(key); if(jsonArr != null){ for(int i=0; i<jsonArr.length(); i++){ JsonElement e = new JsonElement(); JSONObject obj = jsonArr.getJSONObject(i); Iterator<String> iter = obj.keys(); while(iter.hasNext()){ String k = iter.next(); Object v = obj.get(k); if(v instanceof JSONObject){ e.put(k, getElement(obj, k)); }else if(v instanceof JSONArray){ e.put(k, getElementList(obj, k)); }else{ e.put(k, v); } } list.add(e); } } return list; } catch (Exception e) { e.printStackTrace(); } return null; } private Map<String, Object> vMap = new HashMap<String, Object>(); private Map<String, JsonElement> eMap = new HashMap<String, JsonElement>(); private Map<String, List<JsonElement>> lMap = new HashMap<String, List<JsonElement>>(); public void put(String key, Object value){ if(value != null){ if(value instanceof JsonElement){ eMap.put(key, (JsonElement)value); }else if(value instanceof Collection){ lMap.put(key, new ArrayList<JsonElement>((Collection)value)); }else{ vMap.put(key, value); } } } public Object getValue(String key){ return vMap.get(key); } public JsonElement getElement(String key){ return eMap.get(key); } public List<JsonElement> getElementList(String key){ return lMap.get(key); } public boolean containsKey(String key){ return isValue(key) || isElement(key) || isList(key); } public boolean isValue(String key){ return vMap.containsKey(key); } public boolean isElement(String key){ return eMap.containsKey(key); } public boolean isList(String key){ return lMap.containsKey(key); } }
[ "jim@cit.com" ]
jim@cit.com
7c694a6b7ed7651a80c1f97e5d185723a58912b6
53ad031ec5ee0c7bd94fb2b2ae6b83b122ff86ad
/Main.java
6bcf4f752c075df5a168de0eb48164459136e375
[ "Apache-2.0" ]
permissive
HeshanSudarshana/git-demo-heshan
7a1e1d4fdbf241f8c8aa63773127ba259091a470
9d1c75b48f105f106a97d25bc8a43da5b5c475f9
refs/heads/master
2021-01-25T05:50:30.117550
2017-02-02T04:22:58
2017-02-02T04:22:58
80,689,911
0
0
null
null
null
null
UTF-8
Java
false
false
937
java
import java.util.Scanner; /** * * @author Heshan Sudarshana */ public class Main { /** * @param args the command line arguments */ public static void main(String[] args) { int a; int b; String operation; int answer; Scanner scanner = new Scanner(System.in); System.out.println("Welocme to my calculator"); System.out.println("Enter first number: "); a = scanner.nextInt(); System.out.println("Enter second number: "); b = scanner.nextInt(); System.out.println("Enter operation: "); operation = scanner.next(); if("+".equals(operation)){ answer = add(a,b); System.out.println("Answer is: "+answer); } else{ System.out.println("Unsupported operation"); } } private static int add(int a, int b){ return a+b; } }
[ "heshan.15@cse.mrt.ac.lk" ]
heshan.15@cse.mrt.ac.lk
c9294a236db0e095d353832a53b95e9a8e2f2230
2b75a6bf0cde61f56f81afd7e710a60f0832ba08
/src/main/java/pl/project/housingcooperative/controller/model/LoginResponse.java
a83385dcdcbdcdab1ae4aad073d9de5102f73642
[]
no_license
sejmir/housingcooperative
51205a8eee5098c658859bf9127c9708f88a8766
7a133ce0a0cfe2741b25dbdf407915360504bfff
refs/heads/master
2020-06-04T10:09:26.697415
2019-06-14T16:45:11
2019-06-14T16:45:11
191,979,749
0
0
null
null
null
null
UTF-8
Java
false
false
513
java
package pl.project.housingcooperative.controller.model; import lombok.Getter; import lombok.ToString; import pl.project.housingcooperative.persistence.model.User; import pl.project.housingcooperative.persistence.model.UserType; @Getter @ToString public class LoginResponse { private UserDTO user; private String authorizationHeader; public LoginResponse(User user, String authorizationHeader) { this.user = new UserDTO(user); this.authorizationHeader = authorizationHeader; } }
[ "marcin.kominek@digitalvirgo.pl" ]
marcin.kominek@digitalvirgo.pl
a26a2071f78f5525d82a5777a6b584dc016c7000
c326f2fdce2f5dd05f7829dca1f152c15f6ee341
/code/iobserve-analysis/common/src/gen/java/org/iobserve/common/record/EJBUndeployedEvent.java
49984bd091594acae9139253a6f67fe6df2240ec
[]
no_license
research-iobserve/iobserve-architectural-runtime-models-JSS-2020
abaeb28ab330368d713565b14400bb00f189929c
4686f27d838b96014433cde9c440267d3242f662
refs/heads/master
2023-01-04T13:14:38.349340
2020-11-02T16:51:51
2020-11-02T16:51:51
276,608,246
1
0
null
null
null
null
UTF-8
Java
false
false
5,800
java
/*************************************************************************** * Copyright 2017 iObserve Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ package org.iobserve.common.record; import java.nio.BufferOverflowException; import org.iobserve.common.record.EJBDeploymentEvent; import kieker.common.record.io.IValueDeserializer; import kieker.common.record.io.IValueSerializer; import kieker.common.util.registry.IRegistry; import org.iobserve.common.record.IUndeploymentRecord; /** * @author Generic Kieker * API compatibility: Kieker 1.13.0 * * @since 1.13 */ public class EJBUndeployedEvent extends EJBDeploymentEvent implements IUndeploymentRecord { private static final long serialVersionUID = 918721494471850423L; /** Descriptive definition of the serialization size of the record. */ public static final int SIZE = TYPE_SIZE_LONG // IEventRecord.timestamp + TYPE_SIZE_STRING // EJBDeploymentEvent.serivce + TYPE_SIZE_STRING // EJBDeploymentEvent.context + TYPE_SIZE_STRING // EJBDeploymentEvent.deploymentId ; public static final Class<?>[] TYPES = { long.class, // IEventRecord.timestamp String.class, // EJBDeploymentEvent.serivce String.class, // EJBDeploymentEvent.context String.class, // EJBDeploymentEvent.deploymentId }; /** property name array. */ private static final String[] PROPERTY_NAMES = { "timestamp", "serivce", "context", "deploymentId", }; /** * Creates a new instance of this class using the given parameters. * * @param timestamp * timestamp * @param serivce * serivce * @param context * context * @param deploymentId * deploymentId */ public EJBUndeployedEvent(final long timestamp, final String serivce, final String context, final String deploymentId) { super(timestamp, serivce, context, deploymentId); } /** * This constructor converts the given array into a record. * It is recommended to use the array which is the result of a call to {@link #toArray()}. * * @param values * The values for the record. * * @deprecated since 1.13. Use {@link #EJBUndeployedEvent(IValueDeserializer)} instead. */ @Deprecated public EJBUndeployedEvent(final Object[] values) { // NOPMD (direct store of values) super(values, TYPES); } /** * This constructor uses the given array to initialize the fields of this record. * * @param values * The values for the record. * @param valueTypes * The types of the elements in the first array. * * @deprecated since 1.13. Use {@link #EJBUndeployedEvent(IValueDeserializer)} instead. */ @Deprecated protected EJBUndeployedEvent(final Object[] values, final Class<?>[] valueTypes) { // NOPMD (values stored directly) super(values, valueTypes); } /** * @param deserializer * The deserializer to use */ public EJBUndeployedEvent(final IValueDeserializer deserializer) { super(deserializer); } /** * {@inheritDoc} * * @deprecated since 1.13. Use {@link #serialize(IValueSerializer)} with an array serializer instead. */ @Override @Deprecated public Object[] toArray() { return new Object[] { this.getTimestamp(), this.getSerivce(), this.getContext(), this.getDeploymentId() }; } /** * {@inheritDoc} */ @Override public void registerStrings(final IRegistry<String> stringRegistry) { // NOPMD (generated code) stringRegistry.get(this.getSerivce()); stringRegistry.get(this.getContext()); stringRegistry.get(this.getDeploymentId()); } /** * {@inheritDoc} */ @Override public void serialize(final IValueSerializer serializer) throws BufferOverflowException { //super.serialize(serializer); serializer.putLong(this.getTimestamp()); serializer.putString(this.getSerivce()); serializer.putString(this.getContext()); serializer.putString(this.getDeploymentId()); } /** * {@inheritDoc} */ @Override public Class<?>[] getValueTypes() { return TYPES; // NOPMD } /** * {@inheritDoc} */ @Override public String[] getValueNames() { return PROPERTY_NAMES; // NOPMD } /** * {@inheritDoc} */ @Override public int getSize() { return SIZE; } /** * {@inheritDoc} * * @deprecated This record uses the {@link kieker.common.record.IMonitoringRecord.Factory} mechanism. Hence, this method is not implemented. */ @Override @Deprecated public void initFromArray(final Object[] values) { throw new UnsupportedOperationException(); } /** * {@inheritDoc} */ @Override public boolean equals(final Object obj) { if (obj == null) return false; if (obj == this) return true; if (obj.getClass() != this.getClass()) return false; final EJBUndeployedEvent castedRecord = (EJBUndeployedEvent) obj; if (this.getLoggingTimestamp() != castedRecord.getLoggingTimestamp()) return false; if (this.getTimestamp() != castedRecord.getTimestamp()) return false; if (!this.getSerivce().equals(castedRecord.getSerivce())) return false; if (!this.getContext().equals(castedRecord.getContext())) return false; if (!this.getDeploymentId().equals(castedRecord.getDeploymentId())) return false; return true; } }
[ "boltz.nicolas@gmx.de" ]
boltz.nicolas@gmx.de
cfacc65fbd6588f7622d7557d9cf72261731983e
94ebb61af8db3599783b751b5dab2178516df596
/setDemo/setDemo/ArrayListDemo.java
51c2af27d5bfe99e49f999da7a78f93b99ee85ae
[]
no_license
razahaider03/Git-Folders-Java
44b0d301f0b08562c803f4b602888be90611cfb7
7c38c1ea826693bd2020b1c8fba735d9b076ec8c
refs/heads/master
2022-11-29T08:07:44.567509
2020-08-16T07:06:08
2020-08-16T07:06:08
263,261,462
1
0
null
null
null
null
UTF-8
Java
false
false
689
java
package setDemo; import java.util.ArrayList; public class ArrayListDemo { public static void main(String[] args) { ArrayList list=new ArrayList(); list.add("raza"); list.add("haider"); list.add("kashif"); list.add("hasan"); list.add("shabina"); list.add("ammi"); System.out.print("family list is: " +list+"\n"); Object o= list.get(4); System.out.print("4th is "+o+"---------\n"); list.set(0,"Abbu"); System.out.print(list+"----------\n"); for(int i=0;i<list.size();i++) { System.out.println(list.get(i)); } System.out.print("\n------------\n"); list.remove(3); System.out.print("new list is; "+list); } }
[ "razahaider0@gmail.com" ]
razahaider0@gmail.com
bd47b081be692b6c871a95f82eabc2201f54c9f9
9d751bca3db53f74c0394f93d789ed4f780b8474
/src/main/java/com/xvhx/btc/service/scheduled/task/BitsoAvailableBooksScheduledTask.java
a1f5d4ea3fc8a920b43bf969f537a2ef7ea4facb
[]
no_license
tlacuache987/btc-trading-javafx
7d0f106341d05f4f62f1f1e1c8a4788f5065e3e4
f8f2c97c31a4ed33bd1d4729ea459ae1d6ef0389
refs/heads/master
2021-07-06T00:21:59.989713
2017-10-01T23:48:41
2017-10-01T23:48:41
104,969,668
0
0
null
null
null
null
UTF-8
Java
false
false
1,780
java
package com.xvhx.btc.service.scheduled.task; import java.net.URI; import java.util.Arrays; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Scope; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Component; import org.springframework.web.client.RestTemplate; import org.springframework.web.util.UriComponentsBuilder; import com.xvhx.btc.api.rest.domain.BitsoAvailableBooksResponse; import javafx.concurrent.Task; import lombok.extern.slf4j.Slf4j; @Slf4j @Component @Scope("prototype") public class BitsoAvailableBooksScheduledTask extends Task<BitsoAvailableBooksResponse> { private static final String URL_BITSO_AVAILABLE_BOOKS = "https://api.bitso.com/v3/available_books/"; @Autowired private RestTemplate restTemplate; @Override protected BitsoAvailableBooksResponse call() throws Exception { HttpHeaders headers = new HttpHeaders(); UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(URL_BITSO_AVAILABLE_BOOKS); headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON)); headers.add("user-agent", "REST-TEMPLATE"); HttpEntity<?> entity = new HttpEntity<>(headers); ResponseEntity<BitsoAvailableBooksResponse> response = null; URI uri = builder.build().encode().toUri(); log.debug("Requesting {} ", uri); try { response = restTemplate.exchange(uri, HttpMethod.GET, entity, BitsoAvailableBooksResponse.class); } catch (Exception ex) { log.error(ex.getMessage()); } if (response != null) return response.getBody(); return null; } }
[ "isc.ivgarcia@gmail.com" ]
isc.ivgarcia@gmail.com