blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
132 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
28 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
352
a55ce4ead09175116835afc82dca21d54575e687
95e1ddd7adc76bd08249d784cf346e9b8cddcc9f
/1.JavaSyntax/src/com/javarush/task/task09/task0906/Solution.java
50ad24c21a25456d2bc10761e25648e239154bd9
[]
no_license
script972/JavaRush
2f7190e1ce20826bfab6045aee23c6b9e36d3a72
225b5802bd2116f41e2e1ccc57c7427b05ef9a07
refs/heads/master
2021-01-19T18:32:38.809418
2017-10-07T21:44:26
2017-10-07T21:44:26
78,306,557
0
0
null
null
null
null
UTF-8
Java
false
false
470
java
package com.javarush.task.task09.task0906; /* Логирование стек трейса */ public class Solution { public static void main(String[] args) { log("In main method"); } public static void log(String s) { //напишите тут ваш код StackTraceElement[] elem = Thread.currentThread().getStackTrace(); System.out.println(elem[2].getClassName() + ": " + elem[2].getMethodName() + ": " + s); } }
[ "script972@gmail.com" ]
script972@gmail.com
6135df6e44f6e033020527e7387268abd7a1b9e7
9dab5c69697b7dd8a7bfab4cc8c2f6d580ef2d1a
/JavaSE/src/Day21/GetReflectClassInstanceInfo.java
4abbdd62023327df0ac849a085d7fde79f21db3c
[]
no_license
Jexn/MyCode
f7b7eee50c28161c11d047ebac5ddd7d8a4a1833
23a2833f82534a65a816ed2424ff80f4af94dab5
refs/heads/master
2022-12-23T12:06:45.266482
2019-08-20T00:37:25
2019-08-20T00:37:25
185,705,380
0
0
null
2022-12-16T05:04:07
2019-05-09T01:38:16
Java
UTF-8
Java
false
false
5,644
java
package Day21; import org.junit.Test; import java.lang.reflect.*; public class GetReflectClassInstanceInfo { // 创建运行时类的对象 @Test public void method1() { try { Class getClass = Class.forName("Day21.Person"); Person person = (Person) getClass.newInstance(); System.out.println("person = " + person); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (InstantiationException e) { e.printStackTrace(); } } // 获取运行时类声明为Public的构造器 @Test public void getConstructor() throws ClassNotFoundException { Class myClass = Class.forName("Day21.Person"); // 获取运行时类声明为Public的构造器 System.out.println("获取运行时类声明为Public的构造器:"); Constructor[] constructors = myClass.getConstructors(); for (Constructor constructor : constructors) { System.out.println(constructor); } System.out.println("获取运行时类中所有的构造器:"); // 获取运行时类中所有的构造器 Constructor[] constructors1 = myClass.getDeclaredConstructors(); for (Constructor constructor : constructors1) { System.out.println(constructor); } } // 获取类的属性信息 @Test public void method2() { Class myClass = Person.class; System.out.println("获取公共属性:"); Field[] fields = myClass.getFields(); for (Field field : fields) { System.out.println(field); } System.out.println("获取所有有属性:"); Field[] fields1 = myClass.getDeclaredFields(); for (Field field : fields1) { System.out.println(field); } } // 获取当前类属性详细情况 @Test public void method3() { Class myClass = Person.class; Field[] fields = myClass.getDeclaredFields(); for (Field field : fields) { // 1. 权限修饰符 int modifier = field.getModifiers(); System.out.print(Modifier.toString(modifier) + '\t'); // 2. 类型 Class type = field.getType(); System.out.print(type.getName() + '\t'); // 3. 变量名 System.out.println(field.getName()); } } // 获取运行类所声明的方法 @Test public void method4() { try { Class myClass = Class.forName("Day21.Person"); // 获取当前运行类及其父类中所声明的方法 Method[] methods = myClass.getMethods(); for (Method method : methods) { System.out.println(method); } System.out.println("获取当前类所有方法:"); // 获取当前运行类中声明的所有方法,不论权限大小 Method[] methods1 = myClass.getDeclaredMethods(); for (Method method : methods1) { System.out.println(method); } } catch (ClassNotFoundException e) { e.printStackTrace(); } } // 获取当前类的接口信息 @Test public void method5() throws ClassNotFoundException { ClassLoader classLoader = GetReflectClassInstanceInfo.class.getClassLoader(); Class myClass = classLoader.loadClass("Day21.Person"); Class[] classes = myClass.getInterfaces(); for (Class aClass : classes) { System.out.println(aClass); } } //获取运行时类的带泛型的父类的泛型 //逻辑性代码 功能性代码 @Test public void method6() { Class clazz = Person.class; Type genericSuperClass = clazz.getGenericSuperclass(); ParameterizedType paramsType = (ParameterizedType) genericSuperClass; Type[] arguments = paramsType.getActualTypeArguments(); System.out.println(((Class) arguments[0]).getName()); } // 动态获取运行时类带泛型父类的泛型 public String getGenericSuperClassParam(String className){ try { Class targetClass = Class.forName(className); Type genericSuperClass = targetClass.getGenericSuperclass(); ParameterizedType parameterizedType = (ParameterizedType) genericSuperClass; Type[] arguments = parameterizedType.getActualTypeArguments(); return ((Class) arguments[0]).getName(); } catch (ClassNotFoundException e) { e.printStackTrace(); } return null; } @Test public void getGenericSuperClassParamTest(){ String type = getGenericSuperClassParam("Day21.Person"); System.out.println(type); } //获取运行时类的带泛型的父类 @Test public void method7() { Class clazz = Person.class; Type genericSuperClass = clazz.getGenericSuperclass(); System.out.println(genericSuperClass); } //获取运行时类的父类 @Test public void method8() { Class clazz = Person.class; Class superClass = clazz.getSuperclass(); System.out.println(superClass); Class superClass1 = superClass.getSuperclass(); System.out.println(superClass1); } //获取运行时类所属的包 @Test public void method9() { Class clazz = Person.class; Package pack = clazz.getPackage(); System.out.println(pack); } }
[ "cube-root@outlook.com" ]
cube-root@outlook.com
a081e1febfb99a796b79261317f5f22518f95ca1
5b303da11f72c6acc2c946c9f2b248643e753004
/src/leetcodeproblems/ShuffleAnArray.java
b967d07259f1f19b70a6579b693ea2c6b6e3482c
[]
no_license
MauriPastorini/my-competitive-programming-repo
4687ceaa1fb6b44b49bd1a449e7c33f14915bef6
a851c29eeef03e6d22289acfb75fc4107271d841
refs/heads/master
2020-03-18T20:28:32.374744
2018-06-01T18:51:45
2018-06-01T18:51:45
135,218,302
0
0
null
null
null
null
UTF-8
Java
false
false
1,513
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 leetcodeproblems; import java.util.ArrayList; import java.util.List; import java.util.Random; import java.util.concurrent.ThreadLocalRandom; /** * * @author Mauri-Laptop */ public class ShuffleAnArray { int[] nums; int[] originalNums; public ShuffleAnArray() { this.nums = nums; this.originalNums = nums; } public void Solution(int[] nums) { this.nums = nums; this.originalNums = nums; } /** * Resets the array to its original configuration and return it. */ public void test() { // int[] nums = {1, 3, 2, 5}; // Solution(nums); // int[] res = shuffle(); // for (int i : res) { // System.out.println(i); // } Random rand = new Random(); System.out.println(rand.nextInt(1)); } public int[] reset() { this.nums = this.originalNums; return this.nums; } /** * Returns a random shuffling of the array. */ public int[] shuffle() { Random rand = ThreadLocalRandom.current(); for (int i = nums.length - 1; i >= 1; i--) { int posRand = rand.nextInt(i); int aux = nums[posRand]; nums[posRand] = nums[i]; nums[i] = aux; } return this.nums; } }
[ "mauri295@gmail.com" ]
mauri295@gmail.com
59df80d834f7d6ca5f3cfd629504bcdc1e2ce71b
3f62e1c6e6e7153bde24673bd02cea3ef3a21075
/src/main/java/com/example/userservice/domain/Role.java
d016b68519d682a7d372d72960bf1f2bdacda390
[]
no_license
Testoni/userjwt
7a807d589893a08a7dd7510c34bd123bb01476a6
09a9c56806feaa041eabf77d37a42231606f6bf1
refs/heads/main
2023-06-29T01:23:20.622370
2021-08-01T16:11:07
2021-08-01T16:11:07
390,921,509
0
0
null
null
null
null
UTF-8
Java
false
false
457
java
package com.example.userservice.domain; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; @Data @Entity @NoArgsConstructor @AllArgsConstructor public class Role { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; private String name; }
[ "gabriel.testoni@gmail.com" ]
gabriel.testoni@gmail.com
56d1759100b1d804b9628564382ba5127d84247e
37d0b71618c04bff9db134590e05de47e5f057f7
/app/src/main/java/smartparadise/ridewithme/Adapters/HistoryAdapter.java
cdc81c83a48fca837fcd1e2f69f5b5d9e64acac3
[]
no_license
spankaj713/RideWithMe-Online-Cab-Booking-System
d8d477ca2532906be9af8fa35991deed4857a490
53bcb7ecf196b7d90568b829bfdb91189ac7201b
refs/heads/master
2020-03-20T11:10:35.143708
2018-06-14T19:34:46
2018-06-14T19:34:46
137,394,979
0
0
null
null
null
null
UTF-8
Java
false
false
2,422
java
package smartparadise.ridewithme.Adapters; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.support.v7.widget.CardView; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import java.util.List; import java.util.zip.Inflater; import smartparadise.ridewithme.Activities.HistorySinglePageActivity; import smartparadise.ridewithme.DataModels.HistoryModels; import smartparadise.ridewithme.R; /** * Created by HP on 12-05-2018. */ public class HistoryAdapter extends RecyclerView.Adapter<HistoryAdapter.MyViewHolder> { List<HistoryModels> itemList; Context context; public HistoryAdapter(List<HistoryModels> itemList,Context context){ this.itemList=itemList; this.context=context; } @Override public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view= LayoutInflater.from(parent.getContext()) .inflate(R.layout.history_recycler_item,parent,false); return new MyViewHolder(view); } @Override public void onBindViewHolder(MyViewHolder holder, int position) { holder.rideIdItem.setText(itemList.get(position).getRideId()); holder.timeView.setText(itemList.get(position).getTime()); } @Override public int getItemCount() { return itemList.size(); } public class MyViewHolder extends RecyclerView.ViewHolder { TextView rideIdItem,timeView; CardView historyCard; public MyViewHolder(View itemView) { super(itemView); timeView=(TextView)itemView.findViewById(R.id.timeView); rideIdItem=(TextView)itemView.findViewById(R.id.rideIdView); historyCard=(CardView)itemView.findViewById(R.id.historyCard); historyCard.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent intent=new Intent(view.getContext(), HistorySinglePageActivity.class); Bundle b=new Bundle(); b.putString("rideId",rideIdItem.getText().toString()); intent.putExtras(b); view.getContext().startActivity(intent); } }); } } }
[ "spankaj713@gmail.com" ]
spankaj713@gmail.com
ef9bcff5dfa6ac0292dae3ed376fd38fc1445b09
c9cba33410c7c79c54ae1d5f1da21b2358ccd220
/app/src/main/java/com/example/fingerprintdemo/FingerPrintActivity.java
03259a2a8af065a8af5b2a1fdfda697c8f46bbb5
[]
no_license
CodeReveal/Finger_Authentication_Android
1341286e0425a6af082e7832e8d4bd27b443e1c8
821ce2b519e019b5de4af4fdca481f20939b2ad4
refs/heads/master
2022-11-15T20:35:45.089412
2020-06-08T23:48:05
2020-06-08T23:48:05
270,857,186
0
0
null
null
null
null
UTF-8
Java
false
false
6,607
java
package com.example.fingerprintdemo; import androidx.appcompat.app.AppCompatActivity; import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; import android.Manifest; import android.annotation.TargetApi; import android.app.KeyguardManager; import android.content.pm.PackageManager; import android.hardware.fingerprint.FingerprintManager; import android.os.Build; import android.os.Bundle; import android.security.keystore.KeyGenParameterSpec; import android.security.keystore.KeyPermanentlyInvalidatedException; import android.security.keystore.KeyProperties; import android.widget.ImageView; import android.widget.TextView; import java.io.IOException; import java.security.InvalidAlgorithmParameterException; import java.security.InvalidKeyException; import java.security.KeyStore; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; import java.security.NoSuchProviderException; import java.security.UnrecoverableKeyException; import java.security.cert.CertificateException; import javax.crypto.Cipher; import javax.crypto.KeyGenerator; import javax.crypto.NoSuchPaddingException; import javax.crypto.SecretKey; public class FingerPrintActivity extends AppCompatActivity { private KeyStore keyStore; // Variable used for storing the key in the Android Keystore container private static final String KEY_NAME = "androidHive"; private Cipher cipher; private TextView textView; private ImageView icon; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_finger_print); // Initializing both Android Keyguard Manager and Fingerprint Manager KeyguardManager keyguardManager = (KeyguardManager) getSystemService(KEYGUARD_SERVICE); FingerprintManager fingerprintManager = (FingerprintManager) getSystemService(FINGERPRINT_SERVICE); textView = (TextView) findViewById(R.id.errorText); icon = findViewById(R.id.icon); // Check whether the device has a Fingerprint sensor. if(!fingerprintManager.isHardwareDetected()){ /** * An error message will be displayed if the device does not contain the fingerprint hardware. * However if you plan to implement a default authentication method, * you can redirect the user to a default authentication activity from here. * Example: * Intent intent = new Intent(this, DefaultAuthenticationActivity.class); * startActivity(intent); */ textView.setText("Your Device does not have a Fingerprint Sensor"); icon.setColorFilter(ContextCompat.getColor(this, R.color.errorText)); }else { // Checks whether fingerprint permission is set on manifest if (ActivityCompat.checkSelfPermission(this, Manifest.permission.USE_FINGERPRINT) != PackageManager.PERMISSION_GRANTED) { textView.setText("Fingerprint authentication permission not enabled"); icon.setColorFilter(ContextCompat.getColor(this, R.color.errorText)); }else{ // Check whether at least one fingerprint is registered if (!fingerprintManager.hasEnrolledFingerprints()) { textView.setText("Register at least one fingerprint in Settings"); icon.setColorFilter(ContextCompat.getColor(this, R.color.errorText)); }else{ // Checks whether lock screen security is enabled or not if (!keyguardManager.isKeyguardSecure()) { textView.setText("Lock screen security not enabled in Settings"); icon.setColorFilter(ContextCompat.getColor(this, R.color.errorText)); }else{ generateKey(); if (cipherInit()) { FingerprintManager.CryptoObject cryptoObject = new FingerprintManager.CryptoObject(cipher); FingerprintHandler helper = new FingerprintHandler(this); helper.startAuth(fingerprintManager, cryptoObject); } } } } } } @TargetApi(Build.VERSION_CODES.M) protected void generateKey() { try { keyStore = KeyStore.getInstance("AndroidKeyStore"); } catch (Exception e) { e.printStackTrace(); } KeyGenerator keyGenerator; try { keyGenerator = KeyGenerator.getInstance(KeyProperties.KEY_ALGORITHM_AES, "AndroidKeyStore"); } catch (NoSuchAlgorithmException | NoSuchProviderException e) { throw new RuntimeException("Failed to get KeyGenerator instance", e); } try { keyStore.load(null); keyGenerator.init(new KeyGenParameterSpec.Builder(KEY_NAME, KeyProperties.PURPOSE_ENCRYPT | KeyProperties.PURPOSE_DECRYPT) .setBlockModes(KeyProperties.BLOCK_MODE_CBC) .setUserAuthenticationRequired(true) .setEncryptionPaddings( KeyProperties.ENCRYPTION_PADDING_PKCS7) .build()); keyGenerator.generateKey(); } catch (NoSuchAlgorithmException | InvalidAlgorithmParameterException | CertificateException | IOException e) { throw new RuntimeException(e); } } @TargetApi(Build.VERSION_CODES.M) public boolean cipherInit() { try { cipher = Cipher.getInstance(KeyProperties.KEY_ALGORITHM_AES + "/" + KeyProperties.BLOCK_MODE_CBC + "/" + KeyProperties.ENCRYPTION_PADDING_PKCS7); } catch (NoSuchAlgorithmException | NoSuchPaddingException e) { throw new RuntimeException("Failed to get Cipher", e); } try { keyStore.load(null); SecretKey key = (SecretKey) keyStore.getKey(KEY_NAME, null); cipher.init(Cipher.ENCRYPT_MODE, key); return true; } catch (KeyPermanentlyInvalidatedException e) { return false; } catch (KeyStoreException | CertificateException | UnrecoverableKeyException | IOException | NoSuchAlgorithmException | InvalidKeyException e) { throw new RuntimeException("Failed to init Cipher", e); } } }
[ "ratanakpek088@gmail.com" ]
ratanakpek088@gmail.com
ab73266f344b2cb8213f383cf0e5d947f5c7ab75
4746dfc69ef9033dfbcf6551ef246709c66f5ffb
/submission-phase5/java/action/ProvideDegreeDiscAction.java
86c3d936b173249ca062b838845b5c3c6b8f5bbd
[]
no_license
tassapola/cse135putttassapol
c32f451dc7d13279baeffae8ca3c0b9868f13de2
70f34bf6071d228686561daca4765611b6756c84
refs/heads/master
2021-01-20T09:09:23.432990
2010-12-05T00:25:42
2010-12-05T00:25:42
32,342,564
0
0
null
null
null
null
UTF-8
Java
false
false
1,824
java
package action; import java.sql.*; import java.util.*; import javax.servlet.http.*; import model.*; import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.FileItemFactory; import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.fileupload.servlet.ServletFileUpload; import org.apache.struts.action.*; import form.*; public class ProvideDegreeDiscAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { //System.out.println("excuting provide degree disc action"); ProvideDegreeDiscForm f = (ProvideDegreeDiscForm) form; /* System.out.println("form = " + f); System.out.println("discipline = " + f.getDiscipline()); System.out.println("otherDiscipline = " + f.getOtherDiscipline()); System.out.println("degreeMonth = " + f.getDegreeMonth()); System.out.println("degreeYear = " + f.getDegreeYear()); System.out.println("degreeGpa = " + f.getDegreeGpa()); System.out.println("degreeTitle = " + f.getDegreeTitle()); System.out.println("transcriptFile = " + f.getTranscriptFile()); */ HttpSession s = request.getSession(); s.setAttribute(Constants.SESS_DISCIPLINE, f.getDiscipline()); s.setAttribute(Constants.SESS_OTHER_DISCIPLINE, f.getOtherDiscipline()); s.setAttribute(Constants.SESS_DEG_MONTH, f.getDegreeMonth()); s.setAttribute(Constants.SESS_DEG_YEAR, f.getDegreeYear()); s.setAttribute(Constants.SESS_DEG_GPA, f.getDegreeGpa()); s.setAttribute(Constants.SESS_DEG_TITLE, f.getDegreeTitle()); s.setAttribute(Constants.SESS_DEG_TRANSCRIPT, (String) f.getTranscriptFile()); return mapping.findForward(Constants.FORWARD_SUCCESS); } }
[ "chilltassapola@16fcbdfc-56bc-7f80-26f2-9ba74a5772c8" ]
chilltassapola@16fcbdfc-56bc-7f80-26f2-9ba74a5772c8
0dcb2b1985a26bd2edc2de1df2840bb181498031
25fe82ea0e1ccb330890191806a8bb35e4043358
/phone/src/main/java/com/example/phone/TouchImageView.java
369566394dbc72064f9bead16e97abff09abc52e
[]
no_license
suhuMM/AriportTv
3e9b029cd4bfc06de1abfb8cde9f99b3a715fa2e
38118b6d809771f8fba26ddb15d1ec82100d6fc9
refs/heads/master
2021-05-04T19:15:47.401075
2018-01-03T13:35:26
2018-01-03T13:35:26
106,654,449
1
0
null
2017-11-13T02:20:14
2017-10-12T06:38:38
Java
UTF-8
Java
false
false
12,575
java
package com.example.phone; /** * Created by suhu on 2017/8/2. */ import android.content.Context; import android.graphics.Bitmap; import android.graphics.Bitmap.Config; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.PointF; import android.support.v7.widget.AppCompatImageView; import android.util.AttributeSet; import android.util.DisplayMetrics; import android.view.MotionEvent; import java.util.ArrayList; import java.util.List; public class TouchImageView extends AppCompatImageView { /** * 小圆的半径 */ private static final int RADIUS = 10; /** * 基础缩放比例,不能比这个更小 */ private float basis_scale = 1.0f; /** * 放缩后图片宽度 */ private float scalingW; /** * 放缩后图片高度 */ private float scalingH; /** * 经度与宽度比例 */ private double ratioX; /** * 纬度与高度比例 */ private double ratioY; /** * 亦庄图 * 116.507807,39.814279 * <p> * 云狐图 * 116.57792,39.796808 */ private Latitude origin = new Latitude(116.507807, 39.814279); /** * 亦庄图 * 116.671515,39.814168 * <p> * 云狐图 * 116.588206,39.796794 */ private Latitude point_x = new Latitude(116.671515, 39.814168); /** * 亦庄图 * 116.508095,39.749625 * <p> * 云狐图 * 116.577947,39.792678 */ private Latitude point_Y = new Latitude(116.508095, 39.749625); /** * 亦庄图 * 锋创科技园坐标 * 116.584559,39.785231 * <p> * 京东大厦坐标 * 116.570042,39.792439 * <p> * 同济南路 * 116.546385,39.77919 * <p> * 徐庄桥 * 116.636153,39.802102 * <p> * <p> * 云狐图 * 云狐时代D座 * 116.582088,39.794569 * <p> * 云时代A座 * 116.583072,39.796032 */ private Latitude test = new Latitude(116.584559, 39.785231); /** * 背景图片的宽度 */ private int width; /** * 背景图片的高度 */ private int height; /** * 画笔 */ private Paint paint; private float x_down = 0; private float y_down = 0; private PointF start = new PointF(); private PointF mid = new PointF(); private float oldDist = 1f; private float oldRotation = 0; private Matrix matrix = new Matrix(); private Matrix matrix1 = new Matrix(); private Matrix savedMatrix = new Matrix(); /** *基础的矩阵 */ private Matrix basicsMatrix = new Matrix(); private static final int NONE = 0; private static final int DRAG = 1; private static final int ZOOM = 2; private int mode = NONE; private boolean matrixCheck = false; private int widthScreen; private int heightScreen; private Bitmap gintama, bitmap; public TouchImageView(Context context) { super(context); init(); } public TouchImageView(Context context, AttributeSet attrs) { super(context, attrs); init(); } public TouchImageView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); init(); } private void init() { paint = new Paint(); paint.setColor(Color.RED); gintama = BitmapFactory.decodeResource(getResources(), R.mipmap.yizhuang); DisplayMetrics display = getResources().getDisplayMetrics(); widthScreen = display.widthPixels; heightScreen = display.heightPixels; width = gintama.getWidth(); height = gintama.getHeight(); if (width > widthScreen || height > heightScreen) { float scaleW = width * 1.0f / widthScreen; float scaleH = height * 1.0f /heightScreen; //按照宽边进行放缩 if (scaleW > scaleH) { basis_scale = 1/scaleW; matrix.postTranslate(0,(heightScreen-height*basis_scale)/2); } else { basis_scale = 1/scaleH; //平移指的是将坐标原点平移 matrix.postTranslate((widthScreen-width*basis_scale)/2,0); } }else { float scaleW = widthScreen*1.0f/(width*1.0f); float scaleH = heightScreen*1.0f/(height*1.0f); if (scaleW<scaleH){ basis_scale = scaleW; matrix.postTranslate(0,(heightScreen-height*basis_scale)/2); }else { basis_scale = scaleH; matrix.postTranslate((widthScreen-width*basis_scale)/2,0); } } //获得变化后宽高 scalingW = width*basis_scale; scalingH = height*basis_scale; //缩放图片大小,得到新图片 basicsMatrix.postScale(basis_scale,basis_scale); gintama = Bitmap.createBitmap(gintama,0,0,width,height,basicsMatrix,true); //获得比例 measureRatio(point_x,point_Y,scalingW,scalingH); bitmap = gintama; } protected void onDraw(Canvas canvas) { canvas.save(); canvas.drawBitmap(bitmap, matrix, null); canvas.restore(); } /** * @method 触碰按键(手机,pad端) * @author suhu * @time 2017/10/12 13:27 */ public boolean onTouchEvent(MotionEvent event) { switch (event.getAction() & MotionEvent.ACTION_MASK) { case MotionEvent.ACTION_DOWN: mode = DRAG; x_down = event.getX(); y_down = event.getY(); savedMatrix.set(matrix); break; case MotionEvent.ACTION_POINTER_DOWN: mode = ZOOM; oldDist = spacing(event); oldRotation = rotation(event); savedMatrix.set(matrix); midPoint(mid, event); break; case MotionEvent.ACTION_MOVE: if (mode == ZOOM) { matrix1.set(savedMatrix); float newDist = spacing(event); float scale = newDist / oldDist; matrix1.postScale(scale, scale, mid.x, mid.y);// 縮放 matrixCheck = matrixCheck(); if (matrixCheck == false) { matrix.set(matrix1); invalidate(); } } else if (mode == DRAG) { matrix1.set(savedMatrix); matrix1.postTranslate(event.getX() - x_down, event.getY() - y_down);// 平移 matrixCheck = matrixCheck(); if (matrixCheck == false) { matrix.set(matrix1); invalidate(); } } break; case MotionEvent.ACTION_UP: case MotionEvent.ACTION_POINTER_UP: mode = NONE; break; default: } return true; } /** * @method 边界计算 * @author suhu * @time 2017/10/12 13:26 */ private boolean matrixCheck() { float[] f = new float[9]; matrix1.getValues(f); // 图片4个顶点的坐标 float x1 = f[0] * 0 + f[1] * 0 + f[2]; float y1 = f[3] * 0 + f[4] * 0 + f[5]; float x2 = f[0] * gintama.getWidth() + f[1] * 0 + f[2]; float y2 = f[3] * gintama.getWidth() + f[4] * 0 + f[5]; float x3 = f[0] * 0 + f[1] * gintama.getHeight() + f[2]; float y3 = f[3] * 0 + f[4] * gintama.getHeight() + f[5]; float x4 = f[0] * gintama.getWidth() + f[1] * gintama.getHeight() + f[2]; float y4 = f[3] * gintama.getWidth() + f[4] * gintama.getHeight() + f[5]; // 图片现宽度 double width = Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)); // 缩放比率判断 if (width < widthScreen / 3 || width > widthScreen * 3) { return true; } // 出界判断 if ((x1 < widthScreen / 3 && x2 < widthScreen / 3 && x3 < widthScreen / 3 && x4 < widthScreen / 3) || (x1 > widthScreen * 2 / 3 && x2 > widthScreen * 2 / 3 && x3 > widthScreen * 2 / 3 && x4 > widthScreen * 2 / 3) || (y1 < heightScreen / 3 && y2 < heightScreen / 3 && y3 < heightScreen / 3 && y4 < heightScreen / 3) || (y1 > heightScreen * 2 / 3 && y2 > heightScreen * 2 / 3 && y3 > heightScreen * 2 / 3 && y4 > heightScreen * 2 / 3)) { return true; } return false; } /** * @param event * @method 触碰两点间距离 * @author suhu * @time 2017/10/12 13:25 */ private float spacing(MotionEvent event) { float x = event.getX(0) - event.getX(1); float y = event.getY(0) - event.getY(1); return (float) Math.sqrt(x * x + y * y); } /** * @param point * @param event * @method 取手势中心点 * @author suhu * @time 2017/10/12 13:25 */ private void midPoint(PointF point, MotionEvent event) { float x = event.getX(0) + event.getX(1); float y = event.getY(0) + event.getY(1); point.set(x / 2, y / 2); } /** * @param event * @method 取旋转角度 * @author suhu * @time 2017/10/12 13:25 */ private float rotation(MotionEvent event) { double delta_x = (event.getX(0) - event.getX(1)); double delta_y = (event.getY(0) - event.getY(1)); double radians = Math.atan2(delta_y, delta_x); return (float) Math.toDegrees(radians); } /** * @param point_x :x轴坐标点 * @param point_y :y轴坐标点 * @param width :图像宽度 * @param height :图像高度 * @method 获得XY比例 * @author suhu * @time 2017/8/3 14:27 */ private void measureRatio(Latitude point_x, Latitude point_y, float width, float height) { ratioX = width / (point_x.x - point_y.x); ratioY = height / (point_y.y - point_x.y); } /** * @param oldPoint :要转换的点 * @method 单点坐标转换 * @author suhu * @time 2017/8/3 14:38 */ private Latitude coordinateTransformation(Latitude oldPoint) { Latitude newPoint = new Latitude(); newPoint.x = Math.abs((oldPoint.x - origin.x) * ratioX); newPoint.y = Math.abs((oldPoint.y - origin.y) * ratioY); return newPoint; } /** * @param list * @method 整个集合转换 * @author suhu * @time 2017/8/3 14:47 */ private List<Latitude> transformationList(List<Latitude> list) { List<Latitude> newList = new ArrayList<>(); for (Latitude point : list) { newList.add(coordinateTransformation(point)); } return newList; } /** * @param point * @method 绘画单点 * @author suhu * @time 2017/8/4 11:16 */ public void drawPoint(Latitude point) { Bitmap bm = Bitmap.createBitmap(width, height, Config.ARGB_8888); Canvas canvas = new Canvas(bm); canvas.drawBitmap(gintama, 0, 0, null); Latitude latitude = coordinateTransformation(point); canvas.drawCircle((float) latitude.x, (float) latitude.y, RADIUS, paint); canvas.save(); bitmap = bm; invalidate(); } /** * @param pointList * @method 绘画点集 * @author suhu * @time 2017/8/4 11:20 */ public void drawPoint(List<Latitude> pointList) { Bitmap bm = Bitmap.createBitmap(gintama.getWidth(),gintama.getHeight(),Config.ARGB_8888); //Bitmap mm = BitmapFactory.decodeResource(getResources(),R.mipmap.ic_launcher); Canvas canvas = new Canvas(bm); canvas.drawBitmap(gintama, 0, 0, null); List<Latitude> list = transformationList(pointList); for (Latitude latitude : list) { canvas.drawCircle((float) latitude.x, (float) latitude.y, RADIUS, paint); //canvas.drawBitmap(mm,(float) latitude.x, (float) latitude.y,paint); } canvas.save(); bitmap = bm; //通知重绘 invalidate(); } }
[ "suhu0824@sina.com" ]
suhu0824@sina.com
c8de26880f974d1c23e6db6a890d5aa063fcbaf7
dd80a584130ef1a0333429ba76c1cee0eb40df73
/external/apache-http/src/org/apache/http/impl/io/ContentLengthInputStream.java
3b19c5b62f4574b6b542397842d13d5bd6d438cd
[ "MIT", "Apache-2.0" ]
permissive
karunmatharu/Android-4.4-Pay-by-Data
466f4e169ede13c5835424c78e8c30ce58f885c1
fcb778e92d4aad525ef7a995660580f948d40bc9
refs/heads/master
2021-03-24T13:33:01.721868
2017-02-18T17:48:49
2017-02-18T17:48:49
81,847,777
0
2
MIT
2020-03-09T00:02:12
2017-02-13T16:47:00
null
UTF-8
Java
false
false
7,778
java
/* * $HeadURL: http://svn.apache.org/repos/asf/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/ContentLengthInputStream.java $ * $Revision: 652091 $ * $Date: 2008-04-29 13:41:07 -0700 (Tue, 29 Apr 2008) $ * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * */ package org.apache.http.impl.io; import java.io.IOException; import java.io.InputStream; import org.apache.http.io.SessionInputBuffer; /** * Stream that cuts off after a specified number of bytes. * Note that this class NEVER closes the underlying stream, even when close * gets called. Instead, it will read until the "end" of its chunking on * close, which allows for the seamless execution of subsequent HTTP 1.1 * requests, while not requiring the client to remember to read the entire * contents of the response. * * <p>Implementation note: Choices abound. One approach would pass * through the {@link InputStream#mark} and {@link InputStream#reset} calls to * the underlying stream. That's tricky, though, because you then have to * start duplicating the work of keeping track of how much a reset rewinds. * Further, you have to watch out for the "readLimit", and since the semantics * for the readLimit leave room for differing implementations, you might get * into a lot of trouble.</p> * * <p>Alternatively, you could make this class extend * {@link java.io.BufferedInputStream} * and then use the protected members of that class to avoid duplicated effort. * That solution has the side effect of adding yet another possible layer of * buffering.</p> * * <p>Then, there is the simple choice, which this takes - simply don't * support {@link InputStream#mark} and {@link InputStream#reset}. That choice * has the added benefit of keeping this class very simple.</p> * * @author Ortwin Glueck * @author Eric Johnson * @author <a href="mailto:mbowler@GargoyleSoftware.com">Mike Bowler</a> * * @since 4.0 */ public class ContentLengthInputStream extends InputStream { private static final int BUFFER_SIZE = 2048; /** * The maximum number of bytes that can be read from the stream. Subsequent * read operations will return -1. */ private long contentLength; /** The current position */ private long pos = 0; /** True if the stream is closed. */ private boolean closed = false; /** * Wrapped input stream that all calls are delegated to. */ private SessionInputBuffer in = null; /** * Creates a new length limited stream * * @param in The session input buffer to wrap * @param contentLength The maximum number of bytes that can be read from * the stream. Subsequent read operations will return -1. */ public ContentLengthInputStream(final SessionInputBuffer in, long contentLength) { super(); if (in == null) { throw new IllegalArgumentException("Input stream may not be null"); } if (contentLength < 0) { throw new IllegalArgumentException("Content length may not be negative"); } this.in = in; this.contentLength = contentLength; } /** * <p>Reads until the end of the known length of content.</p> * * <p>Does not close the underlying socket input, but instead leaves it * primed to parse the next response.</p> * @throws IOException If an IO problem occurs. */ public void close() throws IOException { if (!closed) { try { byte buffer[] = new byte[BUFFER_SIZE]; while (read(buffer) >= 0) { } } finally { // close after above so that we don't throw an exception trying // to read after closed! closed = true; } } } /** * Read the next byte from the stream * @return The next byte or -1 if the end of stream has been reached. * @throws IOException If an IO problem occurs * @see java.io.InputStream#read() */ public int read() throws IOException { if (closed) { throw new IOException("Attempted read from closed stream."); } if (pos >= contentLength) { return -1; } pos++; return this.in.read(); } /** * Does standard {@link InputStream#read(byte[], int, int)} behavior, but * also notifies the watcher when the contents have been consumed. * * @param b The byte array to fill. * @param off Start filling at this position. * @param len The number of bytes to attempt to read. * @return The number of bytes read, or -1 if the end of content has been * reached. * * @throws java.io.IOException Should an error occur on the wrapped stream. */ public int read (byte[] b, int off, int len) throws java.io.IOException { if (closed) { throw new IOException("Attempted read from closed stream."); } if (pos >= contentLength) { return -1; } if (pos + len > contentLength) { len = (int) (contentLength - pos); } int count = this.in.read(b, off, len); pos += count; return count; } /** * Read more bytes from the stream. * @param b The byte array to put the new data in. * @return The number of bytes read into the buffer. * @throws IOException If an IO problem occurs * @see java.io.InputStream#read(byte[]) */ public int read(byte[] b) throws IOException { return read(b, 0, b.length); } /** * Skips and discards a number of bytes from the input stream. * @param n The number of bytes to skip. * @return The actual number of bytes skipped. <= 0 if no bytes * are skipped. * @throws IOException If an error occurs while skipping bytes. * @see InputStream#skip(long) */ public long skip(long n) throws IOException { if (n <= 0) { return 0; } byte[] buffer = new byte[BUFFER_SIZE]; // make sure we don't skip more bytes than are // still available long remaining = Math.min(n, this.contentLength - this.pos); // skip and keep track of the bytes actually skipped long count = 0; while (remaining > 0) { int l = read(buffer, 0, (int)Math.min(BUFFER_SIZE, remaining)); if (l == -1) { break; } count += l; remaining -= l; } this.pos += count; return count; } }
[ "karun.matharu@gmail.com" ]
karun.matharu@gmail.com
9d5155b45be002e6da9c1ca515a29eddeb1c231b
b04e82d070ec21c9d2bd554ad3e2f2066de0e06d
/app/controllers/CurrentOffer.java
644ce3800e865372f729d651a50fcd4463c14d7d
[]
no_license
rward/BookSkateMate
ab6732b779fcc7da5c8e863a4cb1e9a04eb79370
a46158b895b017bca817d3ef0e5943ea10a6cd2f
refs/heads/master
2020-05-21T11:34:23.166823
2013-05-07T21:21:17
2013-05-07T21:21:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,405
java
package controllers; import play.Logger; import play.data.DynamicForm; import play.data.Form; import play.mvc.Controller; import play.mvc.Result; import views.html.myOffers; import java.util.List; import models.Book; import models.Condition; import models.Student; import static play.data.Form.form; /** * Controller for offers that are currently active. * @author Robert Ward * */ public class CurrentOffer extends Controller { public static Result myOffers() { List<models.CurrentOffer> offerList = models.CurrentOffer.find().findList(); List<models.Book> bookList = models.Book.find().findList(); List<models.Condition> conditions = models.Condition.find().findList(); return ok(myOffers.render("",bookList,conditions,offerList,bookList.get(0).primaryKey," ",0L)); } public static Result myOffers(String message, boolean returnCode, Long selectedBook, Double price , Long conditionIndex ) { List<models.CurrentOffer> offerList = models.CurrentOffer.find().findList(); List<models.Book> bookList = models.Book.find().findList(); List<models.Condition> conditions = models.Condition.find().findList(); if (returnCode) { return ok(myOffers.render(message,bookList,conditions,offerList, selectedBook, price.toString(), conditionIndex)); } else { return badRequest(myOffers.render(message,bookList,conditions,offerList, selectedBook, price.toString(), conditionIndex)); } } /** * Response for a request the creation of a new request. * @return OK or badRequest based on whether new request created */ public static Result newOffer() { DynamicForm form = form().bindFromRequest(); Long bid = -1L; Long cid = -1L; if(form.data().get("bookKey") != null) { bid = Long.parseLong(form.data().get("bookKey")); } if(form.data().get("conditionKey") != null) { cid = Long.parseLong(form.data().get("conditionKey")); } Double price = 0.0; if(form.data().get("price") != null) { price = Double.parseDouble(form.data().get("price")); } Book dbBook = Book.find().byId(bid); Condition dbCondition = Condition.find().byId(cid); Student dbStudent = Student.find().findList().get(0); models.CurrentOffer newOffer = new models.CurrentOffer(price,dbCondition,dbBook, dbStudent); if(dbBook == null || dbStudent == null || dbStudent == null ) { return myOffers("The request StudetnId, BookId and Condtion name required.",false,bid,price,cid ); } try { newOffer.save(); } catch (Exception e) { return myOffers("The request StudetnId, BookId and Condtion name required.",false,bid,price ,cid ); } return myOffers("Offer Created.",true,bid,price,cid ); } /** * Response for a request for all the CurrentOffers available. * @return Either the string with list of CurrentOffers or the string "No Offers" */ public static Result index() { List<models.CurrentOffer> offers = models.CurrentOffer.find().findList(); return ok(offers.isEmpty() ? "No Offers" : offers.toString()); } /** * Response for a request the details CurrentOffers available. * @return Either the string details of an Offers or the string "No offer found" */ public static Result details(String studentId, String bookId) { models.CurrentOffer offer = models.CurrentOffer.find().where() .eq("student.studentId", studentId).eq("book.bookId", bookId).findUnique(); return (offer == null) ? notFound("No offer found") : ok(offer.toString()); } /** * Response for a request the deletion of an offer. * @return OK or badRequest based on whether it was deleted or not if offer does * not exist returns OK. * */ public static Result delete(String studentId, String bookId) { models.CurrentOffer offer = models.CurrentOffer.find().where().eq("student.studentId", studentId).eq("book.bookId", bookId).findUnique(); if (offer != null) { models.RemovedOffer removed = new models.RemovedOffer(offer); try { removed.save(); offer.delete(); } catch (Exception e) { return badRequest(" Request not removed."); } } return ok(); } }
[ "rward@hawaii.edu" ]
rward@hawaii.edu
3e23330f68d674af5974c5c1611bdafd20f7c409
891ae74be3edd5625a235af573b3d82a7b2cb797
/server/src/main/java/com/tuofan/core/TimeUtils.java
f8d2fb13e69038af2082cf0abe30aafa5bc4b15c
[]
no_license
wangyongst/billStar
87bfc8d7405d6b04639e040d5140b582fc56ac38
0519cff9b08539974adcfbe0b51b926a06bb3a1b
refs/heads/master
2022-12-22T03:44:22.394837
2020-03-16T09:39:56
2020-03-16T09:39:56
240,644,022
0
0
null
2022-12-10T08:08:14
2020-02-15T04:22:21
Vue
UTF-8
Java
false
false
1,090
java
package com.tuofan.core; import java.util.Calendar; import java.util.Date; public class TimeUtils { public static Date month(Integer before) { Calendar calendar = Calendar.getInstance();// 获取当前日期 calendar.add(Calendar.YEAR, 0); calendar.add(Calendar.MONTH, -before); calendar.set(Calendar.DAY_OF_MONTH, 1);// 设置为1号,当前日期既为本月第一天 calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); return new Date(calendar.getTimeInMillis()); } public static Date day(int before) { Calendar calendar = Calendar.getInstance();// 获取当前日期 calendar.add(Calendar.YEAR, 0); calendar.add(Calendar.MONTH, 0); calendar.add(Calendar.DAY_OF_MONTH, -before);// 设置为1号,当前日期既为本月第一天 calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); return new Date(calendar.getTimeInMillis()); } }
[ "wangyongst@gmail.com" ]
wangyongst@gmail.com
fcb75fe5f2746d9959684ea740641097d4b06af6
b369e3f8258bfbc635fb9d56626301ca6431a673
/src/main/java/com/example/service/UserService.java
c284cddb98f18b0d280c457d540d493a982f503b
[]
no_license
ynfatal/springboot2mybaitsdemo
46a01a4777f5948ba374897a141e68ab90a249df
66699cfcf554a1c63ee53ed7ccdef3082db9ade2
refs/heads/master
2020-03-26T13:28:26.850929
2018-08-17T09:39:53
2018-08-17T09:39:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
282
java
package com.example.service; import com.example.entity.User; import com.github.pagehelper.PageInfo; /** * @author: Fatal * @date: 2018/8/16 0016 11:55 */ public interface UserService { int addUser(User user); PageInfo<User> findAllUser(int pageNum, int pageSize); }
[ "63413763@qq.com" ]
63413763@qq.com
e7e1d8edd21dddea71d3202daa1e056b85ccce89
0c11dbb4b4b82f3b4c8a28e4ed8bba1529541e61
/BookCollection-Swing-Hsqldb/src/de/seipler/bookcollection/NamedEntity.java
8cab29590918650597b05953bb017ad0fd77fc17
[]
no_license
tecbeast/misc
706b7dfc4af4b9127d5f1fc19e118a4cc97d05f2
cf6a99e7dce0150b923695c7b2c425793e17effa
refs/heads/master
2021-03-22T05:02:03.423522
2016-08-22T13:51:10
2016-08-22T13:51:10
31,893,137
0
0
null
null
null
null
UTF-8
Java
false
false
1,255
java
package de.seipler.bookcollection; /** * * @author Georg Seipler */ public abstract class NamedEntity extends Entity implements Comparable { private String name; public NamedEntity() { this(ID_UNDEFINED); } public NamedEntity(int id) { super(id); setName(""); } public String getName() { return this.name; } public int compareTo(Object obj) { int result = 0; if (obj instanceof NamedEntity) { NamedEntity anotherEntity = (NamedEntity) obj; result = getName().compareToIgnoreCase(anotherEntity.getName()); } return result; } public boolean equals(Object obj) { boolean result = false; if (obj instanceof NamedEntity) { NamedEntity anotherEntity = (NamedEntity) obj; if ( ((getName() == null) && (anotherEntity.getName() != null)) || (getName().compareToIgnoreCase(anotherEntity.getName()) != 0) ) { result = false; } else { result = true; } } return result; } public String toString() { return getName(); } public void setName(String name) { if (name == null) { throw new IllegalArgumentException("Parameter name must not be null"); } this.name = name; } }
[ "georg@seipler.de" ]
georg@seipler.de
4afb004a82edc4be640f087837de46ef658d2981
5b9a4c4a2cd7250d29ff5833c83efc5be136d668
/ClinicRepresentations/target/generated-sources/edu/stevens/cs548/clinic/service/web/rest/data/RadiologyType.java
c2b74433ff2a3eebd331c365b59f9b4d6a017160
[]
no_license
ShristiH/Clinic-App
931b5d793cef6d826f78fca6f008f50e816904d1
c77c1bc28b80d27ddcc3c0e3cabcb1aadd4a0bcf
refs/heads/master
2021-01-10T15:43:12.726224
2016-01-02T23:56:21
2016-01-02T23:56:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,398
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2015.11.14 at 01:10:56 AM EST // package edu.stevens.cs548.clinic.service.web.rest.data; import java.util.ArrayList; import java.util.Date; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; /** * <p>Java class for RadiologyType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="RadiologyType"&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="date" type="{http://www.w3.org/2001/XMLSchema}date" maxOccurs="unbounded"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "RadiologyType", propOrder = { "date" }) public class RadiologyType { @XmlElement(required = true, type = String.class) @XmlJavaTypeAdapter(Adapter1 .class) @XmlSchemaType(name = "date") protected List<Date> date; /** * Gets the value of the date 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 date property. * * <p> * For example, to add a new item, do as follows: * <pre> * getDate().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link String } * * */ public List<Date> getDate() { if (date == null) { date = new ArrayList<Date>(); } return this.date; } }
[ "shingle@stevens.edu" ]
shingle@stevens.edu
608bfa37e952faf0b5bd4e3ee59d1b9ecc4f16c7
e3f340cc5040b1a40f2c7e965c3c6062f4e77494
/test/africa/semicolon/deitelExercises/tddTest/chapter_4/GasMileageTest.java
d22b88e5851454f95d56b19c489f73bcec81630b
[]
no_license
IfeanyiOsuji/Semicolon_Cohort-7-Exercises
cfde5470f4b4ed33197ca26fee29ecc0fa256518
1eb444df5c341dfcf114c899c7cd632f4cb7dec2
refs/heads/main
2023-07-30T19:57:18.496037
2021-09-12T19:54:53
2021-09-12T19:54:53
366,236,390
0
0
null
null
null
null
UTF-8
Java
false
false
1,043
java
package africa.semicolon.deitelExercises.tddTest.chapter_4; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; @DisplayName("Gas Mileage") public class GasMileageTest { @BeforeEach void setUp(){ GasMileage gasMileage = new GasMileage(); } @Test void testMethodToCalculateMilesPerGallon(){ GasMileage gasMileage = new GasMileage(); assertEquals(25.0, gasMileage.calculateGasPerGallon(500, 20)); } @Test void showMilesPerGallonWhenMilesDrivenIs1000AndGallonUsedIs25(){ GasMileage gasMileage = new GasMileage(); assertEquals(40, gasMileage.calculateGasPerGallon(1000, 25)); } @Test void showMilesPerGallonWhenMilesDrivenIs2000AndGallonUsedIs30(){ GasMileage gasMileage = new GasMileage(); assertEquals(66.66666666666667, gasMileage.calculateGasPerGallon(2000, 30)); } }
[ "oindubuisi@gmail.com" ]
oindubuisi@gmail.com
cb8195bd3874da897b90f84cce4897d25b2fe126
126737f19665eb481721835078e9c0eed8188b98
/common-contentlang/src/main/java/jade/content/OntoACLMessage.java
c8e6a9d3fd5640b4595b2a361a59a5c5c9894154
[]
no_license
Maatary/ocean
dbf9ca093fbbb3350c9fb951cb9c6c06847846c2
975275d895d49983e15a3994107fe7f233dfc360
refs/heads/master
2021-03-12T19:55:15.712623
2015-03-25T00:44:42
2015-03-25T00:45:22
32,831,722
0
0
null
null
null
null
UTF-8
Java
false
false
4,232
java
/** * *************************************************************** * JADE - Java Agent DEvelopment Framework is a framework to develop * multi-agent systems in compliance with the FIPA specifications. * Copyright (C) 2000 CSELT S.p.A. * * GNU Lesser General Public License * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation, * version 2.1 of the License. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * ************************************************************** *//* package jade.content; import jade.lang.acl.ACLMessage; import jade.core.AID; import jade.util.leap.List; import jade.util.leap.Iterator; import jade.content.abs.*; import jade.content.onto.*; *//** * Utility class that allow using an <code>ACLMessage</code> object * as an ontological agent action. * @author Giovanni Caire - TILAB *//* public class OntoACLMessage extends ACLMessage implements AgentAction { *//** * Construct an ontological ACL message whose performative * is ACLMessage.NOT_UNDERSTOOD *//* public OntoACLMessage() { super(ACLMessage.NOT_UNDERSTOOD); } *//** * Construct an ontological ACL message with a given * performative * @param performative the performative of this ACL message. * @see ACLMessage#ACLMessage(int) *//* public OntoACLMessage(int performative) { super(performative); } *//** * Create an ontological ACL message that wraps an existing * <code>ACLMessage</code>. * @param msg the <code>ACLMessage</code>to be wrapped. If * <code>msg</code> * is already an ontological ACL message no new object is * created and <code>msg</code> is returned with the sender * and receivers properly wrapped if necessary. *//* public static OntoACLMessage wrap(ACLMessage msg) { OntoACLMessage wrapper = null; if (msg != null) { if (msg instanceof OntoACLMessage) { wrapper = (OntoACLMessage) msg; } else { wrapper = new OntoACLMessage(msg.getPerformative()); // This automatically performs the wrapping wrapper.setSender(msg.getSender()); Iterator it = msg.getAllReceiver(); while (it.hasNext()) { // This automatically performs the wrapping wrapper.addReceiver((AID) it.next()); } it = msg.getAllReplyTo(); while (it.hasNext()) { // This automatically performs the wrapping wrapper.addReplyTo((AID) it.next()); } wrapper.setLanguage(msg.getLanguage()); wrapper.setOntology(msg.getOntology()); wrapper.setProtocol(msg.getProtocol()); wrapper.setInReplyTo(msg.getInReplyTo()); wrapper.setReplyWith(msg.getReplyWith()); wrapper.setConversationId(msg.getConversationId()); wrapper.setReplyByDate(msg.getReplyByDate()); if (msg.hasByteSequenceContent()) { wrapper.setByteSequenceContent(msg.getByteSequenceContent()); } else { wrapper.setContent(msg.getContent()); } wrapper.setEncoding(msg.getEncoding()); //FIXME: Message Envelope is missing } } return wrapper; } *//** * This method is redefined so that the sender AID is automatically * wrapped into an OntoAID *//* public void setSender(AID aid) { super.setSender(OntoAID.wrap(aid)); } *//** * This method is redefined so that the receiver AID is automatically * wrapped into an OntoAID *//* public void addReceiver(AID aid) { super.addReceiver(OntoAID.wrap(aid)); } *//** * This method is redefined so that the replyTo AID is automatically * wrapped into an OntoAID *//* public void addReplyTo(AID aid) { super.addReplyTo(OntoAID.wrap(aid)); } // FIXME: clone method should be redefined too } */
[ "okouyamaatari@gmail.com" ]
okouyamaatari@gmail.com
695ecb9faaee2fe438d1573224c71881ce0d1d16
7fcb1bf31b2d952249378d477f74e21d73dc8bf3
/src/P339BXeniaAndRingroad.java
ce9738585018f39dea6ff36c17ffad05225ffcfa
[]
no_license
rebeckao/CodeForcesProblems
2e186889ca5534c19065c7fd4ffa26365e802a05
765c771809de3c4f55d2063ddb33ee997e4ed2a4
refs/heads/master
2021-09-11T00:13:52.776591
2018-03-19T16:47:19
2018-03-19T16:47:19
115,915,870
0
0
null
null
null
null
UTF-8
Java
false
false
1,050
java
import java.math.BigInteger; import java.util.Scanner; public class P339BXeniaAndRingroad { public static void main(String[] args) { Scanner in = new Scanner(System.in); int numberOfHouses = in.nextInt(); int numberOfTasks = in.nextInt(); int previousHouse = 1; BigInteger totalTime = BigInteger.ZERO; for (int i = 0; i < numberOfTasks; i++) { int nextHouse = in.nextInt(); if (nextHouse > previousHouse) { totalTime = totalTime .add(BigInteger.valueOf(nextHouse)) .subtract(BigInteger.valueOf(previousHouse)); } else if (nextHouse < previousHouse) { totalTime = totalTime .add(BigInteger.valueOf(numberOfHouses)) .subtract(BigInteger.valueOf(previousHouse)) .add(BigInteger.valueOf(nextHouse)); } previousHouse = nextHouse; } System.out.println(totalTime); } }
[ "jkvastad@gmail.com" ]
jkvastad@gmail.com
8ba95ae7e3d93d6de4e970eb135b97b8c63e1e35
88a6154c5090f7f9b2cd8b275e086968b05081d6
/src/main/java/dev/wuffs/itshallnottick/ItShallNotTick.java
de427d8b521e682c165da4b03171534ba5d63028
[]
no_license
nanite/ItShallNotTick
be619f0c337475c7e795b4f4127349a9b8702e79
f0f1d4fe13416ee87b8c3e2650822b2af48df638
refs/heads/main
2023-06-10T15:42:57.749694
2022-08-24T21:26:21
2022-08-24T21:26:21
487,550,995
0
3
null
null
null
null
UTF-8
Java
false
false
2,068
java
package dev.wuffs.itshallnottick; import dev.wuffs.itshallnottick.integration.FTBChunks; import dev.wuffs.itshallnottick.network.PacketHandler; import dev.wuffs.itshallnottick.network.SendMinPlayerPacket; import net.minecraft.server.level.ServerPlayer; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.PlayerEvent; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.ModList; import net.minecraftforge.fml.ModLoadingContext; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.config.ModConfig; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @Mod(ItShallNotTick.MODID) public class ItShallNotTick { public static final String MODID = "itshallnottick"; public static final Logger LOGGER = LogManager.getLogger("ISNT"); public static boolean isFTBChunksLoaded = false; public static int minPlayer; public ItShallNotTick() { IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, Config.CONFIG); isFTBChunksLoaded = ModList.get().isLoaded("ftbchunks"); if (isFTBChunksLoaded) { FTBChunks.setup(); } PacketHandler.regsiter(); modEventBus.addListener(this::commonSetup); MinecraftForge.EVENT_BUS.register(this); } public void commonSetup(FMLCommonSetupEvent event){ minPlayer = Config.minPlayers.get(); } @SubscribeEvent @OnlyIn(Dist.DEDICATED_SERVER) public void onPlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent event) { PacketHandler.sendToClient(new SendMinPlayerPacket(minPlayer), (ServerPlayer) event.getEntity()); } }
[ "gaz492@gmail.com" ]
gaz492@gmail.com
197d04c2db7e820b0ce0290d59372a64ae0d741a
8af73b97c606d5ad0b0acba3463cbb4a4bbf2eef
/src/com/javarush/test/level08/lesson11/home02/Solution.java
08c26e3fabfa8799991ef7e59f5b4b1260894772
[]
no_license
alimogh/JavaRush
4d93d9b363344ea98ed3143c221b0f8107156ffb
6e164e50bc326d832d613639a4946a5c5af91f77
refs/heads/master
2021-05-31T07:36:29.760973
2016-03-04T11:31:11
2016-03-04T11:31:11
294,372,520
1
0
null
2020-09-10T10:04:29
2020-09-10T10:04:28
null
UTF-8
Java
false
false
3,131
java
package com.javarush.test.level08.lesson11.home02; import java.util.HashSet; import java.util.Iterator; import java.util.Set; /* Множество всех животных 1. Внутри класса Solution создать public static классы Cat, Dog.+ 2. Реализовать метод createCats, котороый должен возвращать множество с 4 котами.+ 3. Реализовать метод createDogs, котороый должен возвращать множество с 3 собаками.+ 4. Реализовать метод join, котороый должен возвращать объединенное множество всех животных - всех котов и собак. 5. Реализовать метод removeCats, котороый должен удалять из множества pets всех котов, которые есть в множестве cats. 6. Реализовать метод printPets, котороый должен выводить на экран всех животных, которые в нем есть. Каждое животное с новой строки */ public class Solution { public static class Cat { } public static class Dog { } public static void main(String[] args) { Set<Cat> cats = createCats(); Set<Dog> dogs = createDogs(); Set<Object> pets = join(cats, dogs); printPets(pets); removeCats(pets, cats); printPets(pets); } public static Set<Cat> createCats() { HashSet<Cat> result = new HashSet<Cat>(); result.add(new Cat()); result.add(new Cat()); result.add(new Cat()); result.add(new Cat()); //напишите тут ваш код return result; } public static Set<Dog> createDogs() { HashSet<Dog> dog = new HashSet<Dog>(); dog.add(new Dog()); dog.add(new Dog()); dog.add(new Dog()); //напишите тут ваш код return dog; } public static Set<Object> join(Set<Cat> cats, Set<Dog> dogs) { Set<Object> pets = new HashSet<Object>(); //Написать тут ваш код Iterator<Cat>literator=cats.iterator(); while(literator.hasNext()){ Cat t = literator.next(); pets.add(t); } Iterator<Dog>iterator=dogs.iterator(); while(iterator.hasNext()){ Dog t = iterator.next(); pets.add(t); } return pets; } public static void removeCats(Set<Object> pets, Set<Cat> cats) { Iterator<Cat> qwer = cats.iterator(); while (qwer.hasNext()) { Cat d = qwer.next(); pets.remove(d); } //напишите тут ваш код } public static void printPets(Set<Object> pets) { for (Object p : pets) { System.out.println(p); } //напишите тут ваш код } //напишите тут ваш код }
[ "kolyannow@gmail.com" ]
kolyannow@gmail.com
a67b4d9afc70b668d4e1cbd9e1a8a514f5702926
53ad8c9f75de09a1335dd0adfc6f7cd19d3a88fe
/src/main/java/com/chupin/ibanvalidator/validator/IbanFileListReader.java
7aa5ca2e87dfea9a0139ca199fccc242944601fc
[]
no_license
Hleb-Chupin/ibanValidator
485b47c5ff91e3997f8366aca26fa5a3f158add5
d047acc47df9a4ec966a01ae3caafcd8a945e7ac
refs/heads/master
2020-09-09T19:04:04.284065
2019-11-13T19:37:36
2019-11-13T19:37:36
221,536,595
0
0
null
null
null
null
UTF-8
Java
false
false
1,785
java
package com.chupin.ibanvalidator.validator; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import javax.xml.bind.ValidationException; import java.io.FileWriter; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; @Component public class IbanFileListReader { @Autowired private IbanValidator ibanValidator; private String inputFileName; public String getInputFileName() { return inputFileName; } public void setInputFileName(String inputFileName) { this.inputFileName = inputFileName; } public List<String> readFile(String path) { this.inputFileName = path; try (Stream<String> stream = Files.lines(Paths.get(inputFileName))) { return stream.collect(Collectors.toList()); } catch (IOException e) { e.printStackTrace(); } return null; } public List<String> validateListIban(List<String> ibanList) { for (int i = 0; i < ibanList.size(); i++) { try { ibanList.set(i, ibanList.get(i) + ";" + ibanValidator.validate(ibanList.get(i))); } catch (ValidationException e) { e.printStackTrace(); } } System.out.println(ibanList); return ibanList; } public void writeFile(List<String> ibanList) { try (FileWriter writer = new FileWriter(inputFileName + ".out")) { for (String str : ibanList) { writer.write(str + System.lineSeparator()); } } catch (IOException e) { e.printStackTrace(); } } }
[ "chupin.gleb@me.com" ]
chupin.gleb@me.com
d27a4655ce95b8e95de2ed661e998ee0450a06d7
596f96b33b8d4e20dabab73e2da665c3d455a0f2
/sofa-ark-parent/core/spi/src/main/java/com/alipay/sofa/ark/spi/constant/Constants.java
4836c51ea71a904e74ccad9e1fc771832f52b286
[ "Apache-2.0" ]
permissive
jackge007/sofa-ark
5f5f68c55c8c0dc9b80225ae1e723d32bbce00a9
5d15c3fa1ae5e57778febfcec78ac5ccf8926cdc
refs/heads/master
2020-04-25T13:51:04.199821
2019-02-25T09:52:13
2019-02-25T09:52:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,409
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.alipay.sofa.ark.spi.constant; /** * @author qilong.zql * @since 0.1.0 */ public class Constants { /** * String Constants */ public final static String SPACE_SPLIT = "\\s+"; public final static String STRING_COLON = ":"; public final static String TELNET_STRING_END = new String(new byte[] { (byte) 13, (byte) 10 }); public final static String COMMA_SPLIT = ","; /** * ark conf */ public final static String CONF_BASE_DIR = "conf/"; public final static String ARK_CONF_BASE_DIR = "conf/ark"; public final static String ARK_CONF_FILE = "bootstrap.properties"; public final static String ARK_CONF_FILE_FORMAT = "bootstrap-%s.properties"; public final static String DEFAULT_PROFILE = ""; /** * plugin conf, multi value is split by comma. */ public final static String PLUGIN_ACTIVE_INCLUDE = "ark.plugin.active.include"; public final static String PLUGIN_ACTIVE_EXCLUDE = "ark.plugin.active.exclude"; /** * biz conf, multi value is split by comma. */ public final static String BIZ_ACTIVE_INCLUDE = "ark.biz.active.include"; public final static String BIZ_ACTIVE_EXCLUDE = "ark.biz.active.exclude"; /** * Archiver Marker */ public final static String ARK_CONTAINER_MARK_ENTRY = "com/alipay/sofa/ark/container/mark"; public final static String ARK_PLUGIN_MARK_ENTRY = "com/alipay/sofa/ark/plugin/mark"; public final static String ARK_BIZ_MARK_ENTRY = "com/alipay/sofa/ark/biz/mark"; /** * Ark Plugin Attribute */ public final static String PRIORITY_ATTRIBUTE = "priority"; public final static String GROUP_ID_ATTRIBUTE = "groupId"; public final static String ARTIFACT_ID_ATTRIBUTE = "artifactId"; public final static String PLUGIN_NAME_ATTRIBUTE = "pluginName"; public final static String PLUGIN_VERSION_ATTRIBUTE = "version"; public final static String ACTIVATOR_ATTRIBUTE = "activator"; public final static String IMPORT_CLASSES_ATTRIBUTE = "import-classes"; public final static String IMPORT_PACKAGES_ATTRIBUTE = "import-packages"; public final static String EXPORT_CLASSES_ATTRIBUTE = "export-classes"; public final static String EXPORT_PACKAGES_ATTRIBUTE = "export-packages"; /** * Ark Biz Attribute */ public final static String MAIN_CLASS_ATTRIBUTE = "Main-Class"; public final static String ARK_BIZ_NAME = "Ark-Biz-Name"; public final static String ARK_BIZ_VERSION = "Ark-Biz-Version"; public final static String DENY_IMPORT_CLASSES = "deny-import-classes"; public final static String DENY_IMPORT_PACKAGES = "deny-import-packages"; public final static String DENY_IMPORT_RESOURCES = "deny-import-resources"; public final static String PACKAGE_PREFIX_MARK = "*"; public final static String DEFAULT_PACKAGE = "."; public final static String MANIFEST_VALUE_SPLIT = COMMA_SPLIT; public final static String IMPORT_RESOURCES_ATTRIBUTE = "import-resources"; public final static String EXPORT_RESOURCES_ATTRIBUTE = "export-resources"; public final static String SUREFIRE_BOOT_CLASSPATH = "Class-Path"; public final static String SUREFIRE_BOOT_CLASSPATH_SPLIT = " "; /** * Telnet Server */ public final static String TELNET_SERVER_ENABLE = "sofa.ark.telnet.server.enable"; public final static String TELNET_PORT_ATTRIBUTE = "sofa.ark.telnet"; public final static int DEFAULT_TELNET_PORT = 1234; public final static int DEFAULT_SELECT_PORT_SIZE = 100; public final static String TELNET_SERVER_WORKER_THREAD_POOL_NAME = "telnet-server-worker"; public final static String TELNET_SESSION_PROMPT = "sofa-ark>"; public final static int BUFFER_CHUNK = 128; /** * Event */ public final static String BIZ_EVENT_TOPIC_AFTER_INVOKE_BIZ_START = "AFTER-INVOKE-BIZ-START"; public final static String BIZ_EVENT_TOPIC_AFTER_INVOKE_BIZ_STOP = "AFTER-INVOKE-BIZ-STOP"; /** * Environment Properties */ public final static String SPRING_BOOT_ENDPOINTS_JMX_ENABLED = "endpoints.jmx.enabled"; public final static String LOG4J_IGNORE_TCL = "log4j.ignoreTCL"; /** * Command Provider */ public final static String PLUGIN_COMMAND_UNIQUE_ID = "plugin-command-provider"; /** * Ark SPI extension */ public final static String EXTENSION_FILE_DIR = "META-INF/services/sofa-ark/"; public final static String PLUGIN_CLASS_LOADER_HOOK = "plugin-classloader-hook"; public final static String BIZ_CLASS_LOADER_HOOK = "biz-classloader-hook"; }
[ "abby.zh@antfin.com" ]
abby.zh@antfin.com
f9cb1cfe0c0ce4750008811ae29c7247b87235ee
c99f445a9e71103eb824e718ab01a322e241844d
/SD2x Homework7/src/RandomizedMazeGame.java
19a193bebc059362d50a6c5a69f393a7b25bb96e
[]
no_license
Afrim124/SD2x_Data-Structures-and-Software-Design
489ea32a75027fe3065bbf36063475bdfd3e427c
8da224aee40de175b64304617db46e0efedb3cdb
refs/heads/master
2022-11-09T00:18:16.111358
2020-06-30T15:10:53
2020-06-30T15:10:53
276,129,986
1
0
null
null
null
null
UTF-8
Java
false
false
358
java
import java.util.Collections; import java.util.Random; public class RandomizedMazeGame extends MazeGame { public RandomizedMazeGame() { super(); } public Maze randomize(int roomNumbers) { Random r = new Random(roomNumbers); MazeGame mazegame = new MazeGame(roomNumbers); //Collections.shuffle(mazegame.maze.rooms); return mazegame.maze; } }
[ "afrimbesten@gmail.com" ]
afrimbesten@gmail.com
a4764bae4a4375d9d7c13eba12c132ff614d3217
fa51a28c045621912eb1dc08416070d0f8c9cb78
/src/main/java/com/subra/model/CustomerRepository.java
05a5eac45204d2b800762cc005b153b3687fe1b0
[]
no_license
sdass/spring-mongo
2b8124e58458b9492cf47c9a069c76d34bafc8c4
a3e11d641bd68d3d83c6b07cae67ae1538ef1e01
refs/heads/master
2020-08-29T03:23:17.891158
2019-10-27T20:05:43
2019-10-27T20:05:43
217,909,325
0
0
null
null
null
null
UTF-8
Java
false
false
600
java
package com.subra.model; import java.util.List; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.mongodb.repository.MongoRepository; import org.springframework.data.mongodb.repository.Query; import org.springframework.stereotype.Repository; @Repository public interface CustomerRepository extends MongoRepository<Customer, String>{ @Query Customer findByFname(String fname); @Query List<Customer> findByLname(String lname); // works @Query Page<Customer> findByLname(String lname, Pageable pageable); }
[ "sdass@drf.com" ]
sdass@drf.com
6d51d2190d3e35b14ad77c7829cd0ea043aeb5ad
6453f9f46528830e53442af2fcba1a4942b8d87c
/6_collections/oefeningen/COL_Oef3/src/ui/CryptoGraphieApplicatie.java
57763fc1d2a4124087ee177ecdef927406751f9b
[]
no_license
henridev/object-oriented-programming-II
6bcd10853d17a6df4411046ef69ebd6c0310c461
40101121ae4856dd8f87478339d6b923ecc2632c
refs/heads/main
2023-04-16T08:24:31.045475
2021-04-25T16:10:25
2021-04-25T16:10:25
337,959,771
0
0
null
null
null
null
UTF-8
Java
false
false
613
java
package ui; import domein.DomeinController; public class CryptoGraphieApplicatie { private DomeinController dc; public CryptoGraphieApplicatie(DomeinController dc) { this.dc = dc; } public void start() { dc.codeerBericht("angstschreeuw"); System.out.println(dc.getGecodeerdBericht()); dc.codeerBericht("de pannenkoek"); System.out.println(dc.getGecodeerdBericht()); dc.codeerBericht("bravo"); System.out.println(dc.getGecodeerdBericht()); dc.codeerBericht("aap"); System.out.println(dc.getGecodeerdBericht()); } }
[ "henri.de-bel@capgemini.com" ]
henri.de-bel@capgemini.com
04fbf24d59d3ccbd0f7f5c79d89df05aaabfb291
086df42272528be7b414dcd6c05d74e04a939aef
/src/main/java/esprit/fgsc/PROJETMICROSERVICES/services/ProjetService.java
e6ab9300962d170ce392314ddcb1fd3eb407c48a
[]
no_license
ESPRIT-TWIN-MICROSERVICES-FGSC/PROJET_MICROSERVICE
b02be086a5aadfe1ada08b186422e443e9b591ac
cc2a288fa03902ad2a87ed0311c4c162e9027610
refs/heads/main
2023-08-24T04:46:14.391618
2021-10-28T00:28:42
2021-10-28T00:28:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,520
java
package esprit.fgsc.PROJETMICROSERVICES.services; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import esprit.fgsc.PROJETMICROSERVICES.entities.Projet; import esprit.fgsc.PROJETMICROSERVICES.repository.IProjetRepository; @Service public class ProjetService { private static final DateFormat sdf = new SimpleDateFormat("dd/MM/YYYY"); @Autowired private IProjetRepository projetRepository; public Projet addProjet(Projet projet) { return projetRepository.save(projet); } public List<Projet>getAllProjet(){ return projetRepository.findAll(); } public void deleteProjet(String id) { projetRepository.deleteById(id); } public Projet updateProjet(String id,Projet newProjet) { if(projetRepository.findById(id).isPresent()) { Projet existingProjet = projetRepository.findById(id).get(); existingProjet.setClientEmail(newProjet.getClientEmail()); existingProjet.setClientName(newProjet.getClientName()); existingProjet.setProjectName(newProjet.getProjectName()); existingProjet.setTeamSize(newProjet.getTeamSize()); existingProjet.setStartDate( newProjet.getStartDate()); existingProjet.setEndDate(newProjet.getEndDate()); return projetRepository.save(existingProjet); }else { return null; } } public Projet getProjetById(String id) { return projetRepository.findById(id).get(); } }
[ "ghada.khedri1@esprit.tn" ]
ghada.khedri1@esprit.tn
b21dc54dfeca12a2fbc6ff5619fb18ff92e7883b
336db3411a181742710b4e135cdeb58cad706f26
/gis_game/src/File_format/Csv2Game.java
7dfe38c4f53031ccaed668f6ae40ad5dedb48923
[]
no_license
8onlichtman/gis
cc496c13c14b7b347d42660752e181e55527768d
78f497599d4711df4cdf49db107be9817fbed794
refs/heads/master
2020-04-08T11:26:10.491890
2018-12-30T12:36:15
2018-12-30T12:36:15
159,303,883
0
0
null
null
null
null
UTF-8
Java
false
false
2,427
java
package File_format; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import Coords.Lat_lon_alt; import game_elements.Fruit; import game_elements.Game; import game_elements.Packman; /** * This class converts a csv file to a game. * @author Eitan Lichtman, Netanel Indik */ public class Csv2Game { /** * This constructor initiates the BufferedReader by a given input file path. * @param input */ public Csv2Game(String input) { try { reader = new BufferedReader(new FileReader(input)); } catch (IOException e) { System.out.println("invalid input folder!"); } } /** * This method reads the csv file, creates and returns a game. * @return game * @throws IOException */ public Game run() throws IOException{ try { String tl = reader.readLine(); String[] titles = tl.split(","); Game game = to_game(titles); reader.close(); return game; } catch (IOException e) { e.printStackTrace(); return null; } } //********************private data and methods******************** private BufferedReader reader; private Game to_game(String[] titles) { int sum_p = Integer.parseInt(titles[7]); int sum_f = Integer.parseInt(titles[8]); ArrayList<Packman> packmans = new ArrayList<Packman>(); ArrayList<Fruit> fruits = new ArrayList<Fruit>(); String thisLine; try { for(int i = 0; i < sum_p; i++) { thisLine = reader.readLine(); String [] current = thisLine.split(","); double lat=Double.parseDouble(current[2]); double lon=Double.parseDouble(current[3]); double alt=Double.parseDouble(current[4]); Lat_lon_alt gps_point = new Lat_lon_alt(lat,lon,alt); double weight=Double.parseDouble(current[5]); double radius=Double.parseDouble(current[6]); Packman p = new Packman(gps_point, weight, radius); packmans.add(p); } for(int i = 0; i < sum_f; i++) { thisLine = reader.readLine(); String [] current = thisLine.split(","); double lat=Double.parseDouble(current[2]); double lon=Double.parseDouble(current[3]); double alt=Double.parseDouble(current[4]); Lat_lon_alt gps_point = new Lat_lon_alt(lat,lon,alt); Fruit f = new Fruit(gps_point); fruits.add(f); } Game game = new Game(packmans, fruits); return game; } catch (IOException e) { e.printStackTrace(); return null; } } }
[ "8onlichtman@gmail.com" ]
8onlichtman@gmail.com
9443d04cc51be151ae15e998926b2cda136b8a37
6c0ed5bd14412605f06513f620792bf293504202
/poverenik/src/main/java/rs/pijz/server/poverenik/soap/client/IzvestajClient.java
6d9e75abf994cc1c3396f111f2c49d9796f6f09b
[]
no_license
gagi3/XML-2020
af05b1f3df1f73ef3c83398c869d968c490ff960
1d3b8b5f91f2e4b2a74deed24143a78b90e06625
refs/heads/dev
2023-03-01T21:50:16.732434
2021-02-06T22:07:35
2021-02-06T22:07:35
319,427,300
0
1
null
2021-02-06T16:34:17
2020-12-07T19:48:09
Java
UTF-8
Java
false
false
1,643
java
package rs.pijz.server.poverenik.soap.client; import org.springframework.ws.client.core.support.WebServiceGatewaySupport; import org.springframework.ws.soap.client.core.SoapActionCallback; import rs.pijz.server.poverenik.model.izvestaj.Izvestaj; import rs.pijz.server.poverenik.soap.communication.izvestaj.ExchangeIzvestajRequest; import rs.pijz.server.poverenik.soap.communication.izvestaj.ExchangeIzvestajResponse; import rs.pijz.server.poverenik.soap.communication.izvestaj.GetIzvestajRequest; import rs.pijz.server.poverenik.soap.communication.izvestaj.GetIzvestajResponse; public class IzvestajClient extends WebServiceGatewaySupport { private static String WSDL_URL = "http://localhost:8082/ws/izvestaj-soap.wsdl"; private static String GET_REQUEST_CALLBACK = "http://www.pijz.rs/izvestaj/GetIzvestajRequest"; private static String EXCHANGE_REQUEST_CALLBACK = "http://www.pijz.rs/izvestaj/ExchangeIzvestajRequest"; public GetIzvestajResponse getIzvestaj(String id) { GetIzvestajRequest request = new GetIzvestajRequest(); request.setId(id); GetIzvestajResponse response = (GetIzvestajResponse) getWebServiceTemplate().marshalSendAndReceive(WSDL_URL, request, new SoapActionCallback(GET_REQUEST_CALLBACK)); return response; } public ExchangeIzvestajResponse exchangeIzvestaj(Izvestaj izvestaj) { ExchangeIzvestajRequest request = new ExchangeIzvestajRequest(); request.setIzvestaj(izvestaj); ExchangeIzvestajResponse response = (ExchangeIzvestajResponse) getWebServiceTemplate().marshalSendAndReceive(WSDL_URL, request, new SoapActionCallback(EXCHANGE_REQUEST_CALLBACK)); return response; } }
[ "djordjesevic@gmail.com" ]
djordjesevic@gmail.com
3d0b49a569955b714450448162c0bbbf1bf50428
0655766295c16f9d82036c17cb1e051957f3a6cc
/src/main/java/fr/insa/fmc/javaback/wrapper/AuthentificationTokenWrapper.java
9abe439e12005b6e98c6ebbc576ba008cebc65b2
[]
no_license
hexif2019/fmc-java-back
f86096f49bf2354cd52058e21e716180c8bad5dc
ead72d8bed0195b17f5b8b14673448820080755b
refs/heads/master
2020-03-13T12:17:35.815888
2018-05-04T07:20:58
2018-05-04T07:20:58
131,116,298
0
0
null
2018-05-04T02:44:58
2018-04-26T07:22:17
Java
UTF-8
Java
false
false
409
java
package fr.insa.fmc.javaback.wrapper; public class AuthentificationTokenWrapper { private String email; private String token; public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getToken() { return token; } public void setToken(String token) { this.token = token; } }
[ "wsr10000@hotmail.com" ]
wsr10000@hotmail.com
c54f3383fade56f4606ef8b15d02f294cc72bef9
33b333ac9411247f544724fd90ef907eeea4ab4e
/src/com/elecfreaks/bleexample/MyArray.java
8fef6e971ae7399009610c77f515c76738b22b74
[]
no_license
varoteamulya/Final-Year-Bachelor-of-Engineering-project-2016
9ebca3285f5b8b02dfe5d4ff9076fc99014aaf38
845ae5e6a377aa463cfabb8e2a8dd1234a4712c6
refs/heads/master
2021-04-09T10:22:15.318216
2018-03-15T05:00:05
2018-03-15T05:00:05
125,314,369
0
0
null
null
null
null
UTF-8
Java
false
false
524
java
package com.elecfreaks.bleexample; public class MyArray { static public byte[] arrayCat(byte[] buf1,byte[] buf2){ byte[] bufret=null; int len1 = 0; int len2 = 0; if(buf1 != null) len1 = buf1.length; if(buf2 != null) len2 = buf2.length; if(len1+len2 > 0) bufret = new byte[len1+len2]; if(len1 > 0) System.arraycopy(buf1, 0, bufret, 0, len1); if(len2 > 0) System.arraycopy(buf2, 0, bufret, len1, len2); return bufret; } }
[ "varoteamulya" ]
varoteamulya
819a6a5bc7c6009d4623f47b4ccbb566e6384ea4
db6859dc99912ece5f9333aa7ab1d4d50c9a146c
/src/main/java/com/example/algamoney/api/token/RefreshTokenCookiePreProcessorFilter.java
af891a5b5eacc2ede6c695dfdefbc9e74be2b962
[]
no_license
vjmp06/algamoney-api-04
918df74ac91fc4abfa559f4a0988f36ee845e83b
458b086491996ea046e4f6ff45e3aa7828aa6d42
refs/heads/master
2020-04-07T17:56:15.538357
2018-11-21T23:57:31
2018-11-21T23:57:31
158,590,074
0
0
null
null
null
null
UTF-8
Java
false
false
2,021
java
package com.example.algamoney.api.token; import java.io.IOException; import java.util.Map; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; import org.apache.catalina.util.ParameterMap; import org.springframework.core.Ordered; import org.springframework.core.annotation.Order; import org.springframework.stereotype.Component; @Component @Order(Ordered.HIGHEST_PRECEDENCE) public class RefreshTokenCookiePreProcessorFilter implements Filter { @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest req = (HttpServletRequest) request; if("/oauth/token".equalsIgnoreCase(req.getRequestURI()) && "refresh_token".equals(req.getParameter("grant_type")) && req.getCookies() != null){ for(Cookie cookie : req.getCookies()) { if(cookie.getName().equals("refreshToken")) { String refreshToken = cookie.getValue(); req = new MyServletRequestWrapper(req, refreshToken); } } } chain.doFilter(req, response); } @Override public void destroy() { } @Override public void init(FilterConfig filterConfig) throws ServletException { } static class MyServletRequestWrapper extends HttpServletRequestWrapper{ private String refreshToken; public MyServletRequestWrapper(HttpServletRequest request, String refreshToken) { super(request); this.refreshToken = refreshToken; } @Override public Map<String, String[]> getParameterMap() { ParameterMap<String, String[]> map = new ParameterMap<>(getRequest().getParameterMap()); map.put("refresh_token", new String[] {refreshToken}); map.setLocked(true); return map; } } }
[ "vinicius_moreira06@hotmail.com" ]
vinicius_moreira06@hotmail.com
3f2ba8350e2284d8507999652b1372e2a8d6f4d7
1f207999be869a53c773c4b3dc4cff3d78f60aca
/ybg_base_jar/src/main/java/com/alipay/api/response/ZhimaMerchantOrderRentModifyResponse.java
a1c221b6680e639427549a804eba36cd1eb16bf7
[]
no_license
BrendaHub/quanmin_admin
8b4f1643112910b728adc172324b8fb8a2f672dc
866548dc219a2eaee0a09efbc3b6410eb3c2beb9
refs/heads/master
2021-05-09T04:17:03.818182
2018-01-28T15:00:12
2018-01-28T15:00:12
119,267,872
1
1
null
null
null
null
UTF-8
Java
false
false
355
java
package com.alipay.api.response; import com.alipay.api.AlipayResponse; /** * ALIPAY API: zhima.merchant.order.rent.modify response. * * @author auto create * @since 1.0, 2017-05-25 14:35:11 */ public class ZhimaMerchantOrderRentModifyResponse extends AlipayResponse { private static final long serialVersionUID = 6528341665672394269L; }
[ "13552666934@139.com" ]
13552666934@139.com
8cc969570cb70d17c0ac0372316896db0f597fe9
15809c170be102b04c93617d8912944795480c8c
/src/main/java/com/excelsiormc/excelsiorsponge/excelsiorcore/services/chat/ChatPlayerTitle.java
b6a9ee26ab0640aa0e808ab68054c620902f9706
[]
no_license
Jimmeh94/ExcelsiorSponge
0de39e619bf35accf0d66e061667ccbabb080665
24b94332c883d68ee98a5818e2a09bab3ebf8f31
refs/heads/master
2020-03-28T16:29:26.750255
2018-10-18T21:33:59
2018-10-18T21:33:59
148,700,769
0
0
null
null
null
null
UTF-8
Java
false
false
289
java
package com.excelsiormc.excelsiorsponge.excelsiorcore.services.chat; public enum ChatPlayerTitle { TEST("Test"); private String display; ChatPlayerTitle(String display){this.display = display;} public String getDisplay(){ return "[" + display + "] "; } }
[ "jimmy.walters94@yahoo.com" ]
jimmy.walters94@yahoo.com
c166267424f114816a669b61dcb5deaac8823a1e
de91657cdaf0d5f582beda30274c01675899b9f5
/JavaProgramming/src/ch04/exma02/DowhileExample.java
b35d690e209b3b9ab90c78a0ecb5d4287c23e238
[]
no_license
JinByeungKu/MyRepository
98722e827e5cae9029efd146d289ad7e132371f1
e478ba492d069de53fe5a6151bb296fd2daed9d4
refs/heads/master
2020-04-12T08:49:45.275190
2016-11-16T06:12:53
2016-11-16T06:12:53
65,832,475
0
0
null
null
null
null
UTF-8
Java
false
false
222
java
package ch04.exma02; public class DowhileExample { public static void main(String[] args) throws Exception { int num =0; do{ num = System.in.read(); System.out.println(num); } while(num !=113); } }
[ "splendid1014@naver.com" ]
splendid1014@naver.com
c0f58a0e8d95e6c4c7527477c5d1b99d643f083f
ba90ba9bcf91c4dbb1121b700e48002a76793e96
/com-gameportal-admin/src/main/java/com/gameportal/manage/order/controller/CCAndGroupController.java
574e29b3dcf18acdf7d25d2dd8d9e3696995316a
[]
no_license
portalCMS/xjw
1ab2637964fd142f8574675bd1c7626417cf96d9
f1bdba0a0602b8603444ed84f6d7afafaa308b63
refs/heads/master
2020-04-16T13:33:21.792588
2019-01-18T02:29:40
2019-01-18T02:29:40
165,632,513
0
9
null
null
null
null
UTF-8
Java
false
false
3,541
java
package com.gameportal.manage.order.controller; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import net.sf.json.JSONObject; import org.apache.commons.lang.ObjectUtils; import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import com.gameportal.manage.order.model.CCAndGroup; import com.gameportal.manage.order.service.ICCAndGroupService; import com.gameportal.manage.order.service.ICCGroupService; import com.gameportal.manage.pojo.ExceptionReturn; import com.gameportal.manage.pojo.ExtReturn; import com.gameportal.manage.pojo.GridPanel; import com.gameportal.manage.redis.service.IRedisService; import com.gameportal.manage.system.service.ISystemService; @Controller @RequestMapping(value = "/manage/ccandgroup") public class CCAndGroupController { private static final Logger logger = Logger .getLogger(CCAndGroupController.class); @Resource(name = "cCAndGroupServiceImpl") private ICCAndGroupService cCAndGroupService = null; @Resource(name = "cCGroupServiceImpl") private ICCGroupService cCGroupService = null; @Resource(name = "systemServiceImpl") private ISystemService systemService = null; @Resource(name = "redisServiceImpl") private IRedisService iRedisService = null; public CCAndGroupController() { super(); } @RequestMapping(value = "/index") public String index( @RequestParam(value = "id", required = false) String id, HttpServletRequest request, HttpServletResponse response) { response.setHeader("Pragma", "No-cache"); response.setHeader("Cache-Control", "no-cache"); response.setDateHeader("Expires", 0); request.setAttribute("id", id); // `status` int(2) default NULL COMMENT '状态 0未锁定 1锁定', JSONObject map = new JSONObject(); map.put("0", "未锁定"); map.put("1", "锁定"); request.setAttribute("statusMap", map.toString()); return "com.gameportal.manage.order/cCAndGroup"; } @RequestMapping(value = "/queryCCAndGroup") public @ResponseBody Object queryCCAndGroup( @RequestParam(value = "status", required = false) Integer status, @RequestParam(value = "start", required = false) Integer startNo, @RequestParam(value = "limit", required = false) Integer pageSize, HttpServletRequest request, HttpServletResponse response) { Map<String, Object> params = new HashMap<String, Object>(); if (null!=status) { params.put("status", status); } Long count = cCAndGroupService.queryCCAndGroupCount(params); List<CCAndGroup> list = cCAndGroupService.queryCCAndGroup(params, startNo, pageSize); return new GridPanel(count, list, true); } @RequestMapping("/del/{id}") @ResponseBody public Object delCCAndGroup(@PathVariable Long id) { try { if (!StringUtils.isNotBlank(ObjectUtils.toString(id))) { return new ExtReturn(false, "主键不能为空!"); } if (cCAndGroupService.deleteCCAndGroup(id)) { return new ExtReturn(true, "删除成功!"); } else { return new ExtReturn(false, "删除失败!"); } } catch (Exception e) { logger.error("Exception: ", e); return new ExceptionReturn(e); } } }
[ "sunny@gmail.com" ]
sunny@gmail.com
09c8b0f547eaf2434c3591ac4098b67eb21a92a0
481de44bdac308b02beef3fa6f4f4e576c44c5ff
/src/main/resources/archetype-resources/core/src/main/java/core/cache/HealthCheckResourceHystrixClientCache.java
8107acc6dea7fbded5d6352d3c2b15ff85ac45f1
[]
no_license
biins/microservice-archetype
82931baf8c74b433b691e67069e52fde132e6cb3
e3fa3e081527ce858d67b6062c98200cdcbd4f1a
refs/heads/master
2021-06-07T21:11:28.381899
2016-09-28T19:01:01
2016-09-28T19:10:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,086
java
package ${package}.core.cache; import java.util.Optional; import javax.inject.Inject; import ${package}.client.api.test.Message; import ${package}.client.http.HealthCheckResourceHystrixClient; import org.biins.commons.hystrix.HystrixCacheLoader; import org.springframework.cache.Cache; import org.springframework.cache.CacheManager; import org.springframework.cache.interceptor.SimpleKey; import org.springframework.stereotype.Component; @Component public class HealthCheckResourceHystrixClientCache { private final HealthCheckResourceHystrixClient client; private final Cache cache; @Inject public HealthCheckResourceHystrixClientCache(HealthCheckResourceHystrixClient client, CacheManager cacheManager) { this.client = client; this.cache = cacheManager.getCache("hello"); } public Optional<Message> sayHello(String name, String origin) { return HystrixCacheLoader.of(new SimpleKey(name, origin), Message.class) .with(cache) .getAndSet(() -> client.sayHelloToHystrixCommand(name, origin)); } }
[ "martinjanys@gmail.com" ]
martinjanys@gmail.com
b2ce1d04c2c75e12b5d307caf4dc8102be7d5635
344c15ec4918269b972fdc520d25d5739f5f12b3
/Java I Primeiros passos/Aula4/src/exercicio4/Funcionario.java
736524ac1570d362e0f06ff0a30b04a786996223
[]
no_license
ordnaelmedeiros/alura
ffe63ea17d64abf2288c041d6a2f98cbe7775fe3
199f48b8338022f93ff85de8e4a93291eeda113e
refs/heads/master
2020-04-09T04:59:17.872037
2018-08-29T09:19:24
2018-08-29T09:19:24
60,308,573
0
0
null
null
null
null
UTF-8
Java
false
false
117
java
package exercicio4; public class Funcionario { int salario; void mostra() { System.out.println(salario); } }
[ "lrmarkanjo@gmail.com" ]
lrmarkanjo@gmail.com
7dce088cd645ac66d8fd646aad26c00c2a1f5df6
5cb62785f0ae34c8be9ee9770238d40f30633901
/kodilla-testing/src/main/java/com/kodilla/testing/statistics/CalculateStatistics.java
7102b7c8230003716cdc51415c473b70feb5e85d
[]
no_license
laperacarlos/kg_kodilla_java
85a0840a965d4b304931e2220b97b9c9ac7db471
e904129c7e84907d149a66ce1bc8b9d016eaaa6d
refs/heads/master
2023-06-07T13:58:15.304245
2021-07-07T11:10:34
2021-07-07T11:10:34
317,491,703
0
0
null
null
null
null
UTF-8
Java
false
false
1,801
java
package com.kodilla.testing.statistics; public class CalculateStatistics { private Statistics statistics; private double usersNumber; private double postsNumber; private double commentsNumber; private double postPerUser; private double commentPerUser; private double commentsPerPost; public CalculateStatistics(Statistics statistics) { this.statistics = statistics; } public void calculateAdvStatistics(Statistics statistics) { usersNumber = statistics.usersNames().size(); postsNumber = statistics.postCount(); commentsNumber = statistics.commentsCount(); if (usersNumber == 0) { postPerUser = 0; } else { postPerUser = postsNumber / usersNumber; } if (usersNumber == 0) { commentPerUser = 0; } else { commentPerUser = commentsNumber / usersNumber; } if (postsNumber == 0) { commentsPerPost = 0; } else { commentsPerPost = commentsNumber / postsNumber; } } public void showStatistics(){ System.out.println("Forum statistics \nNumber of users: " + usersNumber); System.out.println("Number of posts: " + postsNumber); System.out.println("Number of comments: " + commentsNumber); System.out.println("Number of posts per user: " + postPerUser); System.out.println("Number of comments per user: " + commentPerUser); System.out.println("Number of comments per post: " + commentsPerPost); } public double getPostPerUser() { return postPerUser; } public double getCommentPerUser() { return commentPerUser; } public double getCommentsPerPost() { return commentsPerPost; } }
[ "lapera.carlos@gmail.com" ]
lapera.carlos@gmail.com
be47a172206105c28f5a6fa47ccd3fa807354c54
eb858f8e0782c9e6844377e9aa72f352cba3ad2c
/src/main/java/ydw/services/TuitionCalculatorNationalImpl.java
769437b90924a84e8d96216659a15e5f06629c4e
[]
no_license
davidye811/CS548_HW
984a1866cb72280a5f305c8e77ea401bf121d824
f5013167a6ca4be31541261b4a6c1372534641af
refs/heads/master
2021-07-18T05:46:04.195746
2017-10-23T06:03:04
2017-10-23T06:03:04
107,938,165
2
0
null
null
null
null
UTF-8
Java
false
false
1,322
java
package ydw.services; import java.util.List; import org.springframework.stereotype.Component; import ydw.domain.Course; import ydw.domain.Student; import ydw.services.TuitionCalculatorService; @Component("TuitionCalculatorNational") public class TuitionCalculatorNationalImpl implements TuitionCalculatorService { double totalPrices; int totalUnits; public double getTotalPrices() { return totalPrices; } public void setTotalPrices(double totalPrices) { this.totalPrices = totalPrices; } public int getTotalUnits() { return totalUnits; } public void setTotalUnits(int totalUnits) { this.totalUnits = totalUnits; } public int getChemicalUnits() { return chemicalUnits; } public void setChemicalUnits(int chemicalUnits) { this.chemicalUnits = chemicalUnits; } int chemicalUnits; public double computeTutition(Student student, List<Course> courses) { // TODO Auto-generated method stub totalPrices=0.0; totalUnits = 0; chemicalUnits=0; for(Course course:courses){ if(course.getDepartmentName()=="Chemistry"){ chemicalUnits+=course.getNumberOfUnit(); } totalUnits+=course.getNumberOfUnit(); } totalPrices+=chemicalUnits*50.0; if(student.isInternational()){ return totalPrices+totalUnits*500.0; }else{ return totalPrices+totalUnits*230.0; } } }
[ "davidye811@gmail.com" ]
davidye811@gmail.com
23d5629d8647a18ddeef7e1d4697ae3c381df56e
5ff40c6e3cd0423cfc5a90d8e1402881ad374126
/src/main/java/utils/LongsRef.java
3b35562ec550ccace7050c697a8bbd2d35080c92
[]
no_license
tanfengtiantian/fst
fd23b255caa641b34e372a0d7192eb0f21511943
026336978ea15aa8a95662d7527d1b315de4c2a7
refs/heads/master
2022-01-25T06:55:31.051191
2019-07-10T09:56:28
2019-07-10T09:56:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,055
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package utils; /** Represents long[], as a slice (offset + length) into an * existing long[]. The {@link #longs} member should never be null; use * {@link #EMPTY_LONGS} if necessary. * * @lucene.internal */ public final class LongsRef implements Comparable<LongsRef>, Cloneable { /** An empty long array for convenience */ public static final long[] EMPTY_LONGS = new long[0]; /** The contents of the LongsRef. Should never be {@code null}. */ public long[] longs; /** Offset of first valid long. */ public int offset; /** Length of used longs. */ public int length; /** Create a LongsRef with {@link #EMPTY_LONGS} */ public LongsRef() { longs = EMPTY_LONGS; } /** * Create a LongsRef pointing to a new array of size <code>capacity</code>. * Offset and length will both be zero. */ public LongsRef(int capacity) { longs = new long[capacity]; } /** This instance will directly reference longs w/o making a copy. * longs should not be null */ public LongsRef(long[] longs, int offset, int length) { this.longs = longs; this.offset = offset; this.length = length; assert isValid(); } /** * Returns a shallow clone of this instance (the underlying longs are * <b>not</b> copied and will be shared by both the returned object and this * object. * * @see #deepCopyOf */ @Override public LongsRef clone() { return new LongsRef(longs, offset, length); } @Override public int hashCode() { final int prime = 31; int result = 0; final long end = offset + length; for(int i = offset; i < end; i++) { result = prime * result + (int) (longs[i] ^ (longs[i]>>>32)); } return result; } @Override public boolean equals(Object other) { if (other == null) { return false; } if (other instanceof LongsRef) { return this.longsEquals((LongsRef) other); } return false; } public boolean longsEquals(LongsRef other) { return FutureArrays.equals(this.longs, this.offset, this.offset + this.length, other.longs, other.offset, other.offset + other.length); } /** Signed int order comparison */ @Override public int compareTo(LongsRef other) { return FutureArrays.compare(this.longs, this.offset, this.offset + this.length, other.longs, other.offset, other.offset + other.length); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append('['); final long end = offset + length; for(int i=offset;i<end;i++) { if (i > offset) { sb.append(' '); } sb.append(Long.toHexString(longs[i])); } sb.append(']'); return sb.toString(); } /** * Creates a new LongsRef that points to a copy of the longs from * <code>other</code> * <p> * The returned IntsRef will have a length of other.length * and an offset of zero. */ public static LongsRef deepCopyOf(LongsRef other) { return new LongsRef(ArrayUtil.copyOfSubArray(other.longs, other.offset, other.offset + other.length), 0, other.length); } /** * Performs internal consistency checks. * Always returns true (or throws IllegalStateException) */ public boolean isValid() { if (longs == null) { throw new IllegalStateException("longs is null"); } if (length < 0) { throw new IllegalStateException("length is negative: " + length); } if (length > longs.length) { throw new IllegalStateException("length is out of bounds: " + length + ",longs.length=" + longs.length); } if (offset < 0) { throw new IllegalStateException("offset is negative: " + offset); } if (offset > longs.length) { throw new IllegalStateException("offset out of bounds: " + offset + ",longs.length=" + longs.length); } if (offset + length < 0) { throw new IllegalStateException("offset+length is negative: offset=" + offset + ",length=" + length); } if (offset + length > longs.length) { throw new IllegalStateException("offset+length out of bounds: offset=" + offset + ",length=" + length + ",longs.length=" + longs.length); } return true; } }
[ "wangshihan@lvwan.com" ]
wangshihan@lvwan.com
c1450ca20f832a3dced05b78da8f88a9602321a3
c470426361a33e5a9b1e222cffc22fff06982beb
/webshelf-business/src/main/java/org/webshelf/business/data/CassandraCluster.java
ccbc5a6c9f2eae7bdef3f84cb6ad7adcd638a7a0
[ "Apache-2.0" ]
permissive
monteirocicero/webshelf
16d8db0890c5b47669b586c1b15dfa2e01e20296
ca066541d962ba8e260576b77a59794c7da1f324
refs/heads/master
2021-01-19T05:15:56.679314
2016-08-17T00:53:46
2016-08-17T00:53:46
63,489,008
0
0
null
null
null
null
UTF-8
Java
false
false
2,562
java
package org.webshelf.business.data; import java.util.HashMap; import java.util.Map; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import javax.ejb.Lock; import javax.ejb.LockType; import javax.ejb.Singleton; import javax.ejb.TransactionAttribute; import javax.ejb.TransactionAttributeType; import org.webshelf.business.model.User; import com.datastax.driver.core.BoundStatement; import com.datastax.driver.core.Cluster; import com.datastax.driver.core.PreparedStatement; import com.datastax.driver.core.ResultSet; import com.datastax.driver.core.Session; import com.datastax.driver.core.Statement; import com.datastax.driver.mapping.Mapper; import com.datastax.driver.mapping.MappingManager; @Singleton @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) public class CassandraCluster { private Cluster cluster; private Session session; private MappingManager mappingManager; private Map<String, PreparedStatement> preparedStatementCache = new HashMap(); @PostConstruct public void init() { this.cluster = Cluster.builder().addContactPoint("localhost").build(); this.session = cluster.connect(); this.mappingManager = new MappingManager(session); } private BoundStatement prepare(String cql) { if (!preparedStatementCache.containsKey(cql)) { this.preparedStatementCache.put(cql, session.prepare(cql)); } return this.preparedStatementCache.get(cql).bind(); } @Lock(LockType.READ) public ResultSet execute(Statement stmt) { return session.execute(stmt); } public BoundStatement boundInsertUser() { return prepare("INSERT INTO webshelf.user(isbn, title, password) VALUES (?, ?, ?) IF NOT EXISTS;"); } public BoundStatement boundInsertBookByISBN() { return prepare("INSERT INTO webshelf.book_by_isbn(isbn, title, author, country, publisher, image) VALUES (?, ?, ?, ?, ?, ?) IF NOT EXISTS;"); } public BoundStatement boundInsertBookByTitle() { return prepare("INSERT INTO webshelf.book_by_title(isbn, title, author, country, publisher, image) VALUES (?, ?, ?, ?, ?, ?) IF NOT EXISTS;"); } public BoundStatement boundInsertBookByAuthor() { return prepare("INSERT INTO webshelf.book_by_author(isbn, title, author, country, publisher, image) VALUES (?, ?, ?, ?, ?, ?) IF NOT EXISTS;"); } public Mapper<User> mapper(Class<User> clazz) { return mappingManager.mapper(clazz); } @PreDestroy public void destroy() { this.session.close(); this.cluster.close(); } }
[ "cicerolmonteiro@gmail.com" ]
cicerolmonteiro@gmail.com
56162b319401cddf1a76b7aeea6409b3a4296f81
4fde206d2b86e7426677db808c91fa590840bb03
/src/notusedclasses/MyPanel.java
fcbfc812a991c0fa4fcf4cdc5c7f6d95379ac1ea
[]
no_license
helghast79/WheelOfDeath
feccea640c56aa125b825925656ee698a90632a8
4e36f052bb14a7589d5e7835f18b8fc7ba17ea48
refs/heads/master
2021-01-10T11:36:22.207635
2016-04-28T12:06:31
2016-04-28T12:06:31
55,557,236
0
0
null
null
null
null
UTF-8
Java
false
false
2,212
java
package notusedclasses; import javax.swing.*; import javax.swing.text.FlowView; import java.awt.*; import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.RenderingHints; import java.awt.Shape; import java.awt.font.FontRenderContext; import java.awt.font.GlyphVector; import java.awt.geom.AffineTransform; import java.awt.geom.Point2D; /** * Created by macha on 14/03/2016. */ public class MyPanel extends JPanel{ private String text; private Graphics2D g2; public MyPanel(String text) { this.text=text; } public void paint(Graphics g){ Graphics2D g2 = (Graphics2D) g; // local variable not an instance one g2.setColor(Color.green); int x= 50; int y = 50; int angle = 45; g2.translate((float)x,(float)y); g2.rotate(Math.toRadians(angle)); g2.drawString(text,0,0); g2.rotate(-Math.toRadians(angle)); g2.translate(-(float)x,-(float)y); } @Override public void paintComponent(Graphics g) { g2 = (Graphics2D) g; g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); String s = text; Font font = new Font("Serif", Font.PLAIN, 24); FontRenderContext frc = g2.getFontRenderContext(); g2.translate(40, 80); GlyphVector gv = font.createGlyphVector(frc, s); int length = gv.getNumGlyphs(); for (int i = 0; i < length; i++) { Point2D p = gv.getGlyphPosition(i); double theta = 0;//(double) i / (double) (length - 1) * Math.PI / 4; AffineTransform at = AffineTransform.getTranslateInstance(p.getX(), p.getY()); at.rotate(theta); Shape glyph = gv.getGlyphOutline(i); Shape transformedGlyph = at.createTransformedShape(glyph); g2.fill(transformedGlyph); } } public void drawRotate(double x, double y, int angle, String text) { g2.translate((float)x,(float)y); g2.rotate(Math.toRadians(angle)); g2.drawString(text,0,0); g2.rotate(-Math.toRadians(angle)); g2.translate(-(float)x,-(float)y); } }
[ "m.a.chambel@gmail.com" ]
m.a.chambel@gmail.com
a5113b92385606499bcb99b96694ea9066fb6a24
243d49f85eef4a64851dbe30571a7dbe74f393fb
/src/com/situ/mall/controller/back/UploadController.java
bde86f3d4099b981bddb0e4681ccc8660b3fdc32
[]
no_license
lsskaixinwudi/Java1707Mall
35e4605cf930c5d528616802bd52eab4215789c4
7333e7719fab8dfc3df9f264353a9e9c7268c442
refs/heads/master
2021-07-24T12:51:19.795642
2017-11-06T09:15:58
2017-11-06T09:15:58
105,109,672
0
0
null
null
null
null
GB18030
Java
false
false
3,003
java
package com.situ.mall.controller.back; import java.io.File; import java.io.IOException; import java.util.HashMap; import java.util.Map; import java.util.UUID; import org.apache.commons.io.FilenameUtils; import org.springframework.http.MediaType; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.multipart.MultipartFile; import com.situ.mall.constant.MallConstant; import com.situ.mall.util.JsonUtils; @Controller @RequestMapping("/upload") public class UploadController { /** * kindeditor上传使用 * @param pictureFile * @return */ @RequestMapping(value="/pic", produces=MediaType.TEXT_PLAIN_VALUE+";charset=utf-8") @ResponseBody public String uploadFile(MultipartFile pictureFile) { try { //为了防止重名生成一个随机的名字:aa4fb86a7896458a8c5b34c634011ae3 String name = UUID.randomUUID().toString().replace("-", ""); //jpg,png String ext = FilenameUtils.getExtension(pictureFile.getOriginalFilename()); String fileName = name + "." + ext; String filePath1 = "E:\\pic\\" + fileName; String filePath = MallConstant.SERVER_ADDRES + fileName; try { pictureFile.transferTo(new File(filePath1)); } catch (IllegalStateException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } //封装到map中返回 Map result = new HashMap<>(); result.put("error", 0); result.put("url", filePath); //将object转换成json return JsonUtils.objectToJson(result); } catch (Exception e) { e.printStackTrace(); Map result = new HashMap<>(); result.put("error", 1); result.put("message", "图片上传失败"); return JsonUtils.objectToJson(result); } } /** * 自定义图片上传使用 * @param pictureFile * @return */ @RequestMapping(value="/uploadPic") @ResponseBody public Map<String, Object> uploadPic(MultipartFile pictureFile) { return upload(pictureFile); //上传到七牛 //return uploadByQiniu(pictureFile); } private Map<String, Object> upload(MultipartFile pictureFile) { //为了防止重名生成一个随机的名字:aa4fb86a7896458a8c5b34c634011ae3 String name = UUID.randomUUID().toString().replace("-", ""); //jpg,png String ext = FilenameUtils.getExtension(pictureFile.getOriginalFilename()); String fileName = name + "." + ext; String filePath = "E:\\pic\\" + fileName; try { pictureFile.transferTo(new File(filePath)); } catch (IllegalStateException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } Map<String, Object> map = new HashMap<String, Object>(); map.put("fileName", fileName); map.put("filePath", MallConstant.SERVER_ADDRES + fileName); return map; } public static void main(String[] args) { String name = UUID.randomUUID().toString().replace("-", ""); System.out.println(name); } }
[ "17862123983@163.com" ]
17862123983@163.com
1c39a9e9f19d64109a64f39bac09ed15fae7959c
acde8cfd552f63a3087f7a50bd82570d7c0c4209
/src/main/java/com/merit/assignment6/exceptions/copy/ExceedsCombinedBalanceLimitException.java
0115ef9720a32894f765d072da5e9f396ee96529
[]
no_license
lifefromashes/assignment6_updates
c8ffbd41edfa07de83be1ce3cb5d8c4acff3c749
c68d356fd98f1a122c55c9e9e2b9a581cec3a5b9
refs/heads/master
2022-07-18T11:15:41.549868
2020-05-16T20:34:08
2020-05-16T20:34:08
264,521,092
0
0
null
null
null
null
UTF-8
Java
false
false
346
java
package com.merit.assignment6.exceptions.copy; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; @ResponseStatus(HttpStatus.NOT_FOUND) public class ExceedsCombinedBalanceLimitException extends Exception { public ExceedsCombinedBalanceLimitException(String msg) { super(msg); } }
[ "kskipper.03@gmail.com" ]
kskipper.03@gmail.com
7ec33f768b08d2bf1b6f0bb81e29d2e95f4538c2
0c6f4a7ff7201a490e106c8fcfc121b4d8696bba
/src/mHUD/mGraphicEntity/GMonsterEntity.java
c5a95155a903551f7f4a6db5d202ddde67a3bfdf
[]
no_license
Hyper-Miiko/TowerDefence
683325b3dc3275f81be86a41f3d748dcfb6c90d5
8bc2bc0612a9de12246d3e7060684d3c8794d820
refs/heads/main
2023-03-11T13:38:51.479931
2021-02-11T14:18:40
2021-02-11T14:18:40
322,524,575
0
0
null
null
null
null
UTF-8
Java
false
false
1,415
java
package mHUD.mGraphicEntity; import java.awt.AlphaComposite; import java.awt.Image; import java.awt.image.BufferedImage; import mHUD.geometric.Vector; public class GMonsterEntity extends GPictureEntity { int spX = -1; public GMonsterEntity() { setPosition(0,0); } public GMonsterEntity(double x, double y, String imageName) { setPicture(imageName); setPosition(x,y); } protected Vector getPosition() { return new Vector(super.getPosition().x+(int)(size.x/2),super.getPosition().y+(int)(size.y/2)); } protected Image getImage() { int directionX = 0; int directionY = 0; double r = 2*Math.PI-getRotation(); if((r < Math.PI/4 && r >= 0) || (r < 5*Math.PI/4 && r >= 3*Math.PI/4) || (r < 2*Math.PI && r >= 7*Math.PI/4))directionX = 68; if(r > 3*Math.PI/4 && r < 7*Math.PI/4)directionY = 50; if(System.nanoTime()%500000000 > 250000000)spX = 34; else spX = 0; imageEdit.setComposite(AlphaComposite.getInstance(AlphaComposite.CLEAR)); imageEdit.fillRect(0,0,hyp,hyp); imageEdit.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER)); imageEdit.drawImage(image,-directionX-spX,-directionY, null); return imageBuffer; } protected void reloadCanvas() { imageBuffer = new BufferedImage((int)(size.x)/4,(int)(size.y)/2, BufferedImage.TYPE_INT_ARGB); imageEdit = imageBuffer.createGraphics(); } }
[ "lodla@LAPTOP-QI3E77K6.home" ]
lodla@LAPTOP-QI3E77K6.home
4da1615725995b22cdca0b2b5c572f73d2822fdb
395fdaed6042b4f85663f95b8ce181305bf75968
/java/intelijidea/chegg-i73/src/DoubleListException.java
15f6e7f68e8e2dd2e2faee00a56109f649207b72
[]
no_license
amitkumar-panchal/ChQuestiions
88b6431d3428a14b0e5619ae6a30b8c851476de7
448ec1368eca9544fde0c40f892d68c3494ca209
refs/heads/master
2022-12-09T18:03:14.954130
2020-09-23T01:58:17
2020-09-23T01:58:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
288
java
/** * DoubleListException class */ public class DoubleListException extends IndexOutOfBoundsException { DoubleListException(){ } /** * constructor with parameter * @param msg of exception */ DoubleListException(String msg){ super(msg); } }
[ "=" ]
=
1dbbec673dac1e935312d336081bb3eab0d8bc3d
776346472cdc9a3f32e01c334354daf39c47e993
/project/DuncansProject/mygooey.java
c416d4b8d22e535eac1c9423c3eabca8c4a026c5
[]
no_license
DuncanMilne/Fourth-year-project
1e65e57b84e67c9bff1e9e233be49870a1bc9393
802f477ed2f7dbd412130a827a594c88890092ea
refs/heads/master
2021-01-11T05:20:51.409514
2017-03-09T17:48:56
2017-03-09T17:48:56
71,918,892
0
0
null
null
null
null
UTF-8
Java
false
false
4,979
java
import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Text; import gurobi.GRBException; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.events.MouseAdapter; import org.eclipse.swt.events.MouseEvent; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; public class mygooey { protected Shell shell; private Text text; private Text text_1; private Text text_2; private Text text_3; private Text text_4; private Text text_5; /** * Launch the application. * @param args */ public static void main(String[] args) { try { mygooey window = new mygooey(); window.open(); } catch (Exception e) { e.printStackTrace(); } } /** * Open the window. */ public void open() { Display display = Display.getDefault(); createContents(); shell.open(); shell.layout(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } } /** * Create contents of the window. */ protected void createContents() { shell = new Shell(); shell.setSize(450, 300); shell.setText("SWT Application"); Label lblNumberOfStudents = new Label(shell, SWT.NONE); lblNumberOfStudents.setBounds(10, 10, 144, 15); lblNumberOfStudents.setText("Number of Students"); Label lblNumberOfProjects = new Label(shell, SWT.NONE); lblNumberOfProjects.setBounds(151, 10, 109, 15); lblNumberOfProjects.setText("Number of Projects"); Label lblNumberOfLecturers = new Label(shell, SWT.NONE); lblNumberOfLecturers.setBounds(283, 10, 163, 15); lblNumberOfLecturers.setText("Number of Lecturers"); Label lblAdditionalCapacityFor = new Label(shell, SWT.NONE); lblAdditionalCapacityFor.setBounds(10, 58, 190, 15); lblAdditionalCapacityFor.setText("Additional Capacity for Lecturers"); Label lblAdditionalCapacityFor_1 = new Label(shell, SWT.NONE); lblAdditionalCapacityFor_1.setBounds(206, 58, 190, 15); lblAdditionalCapacityFor_1.setText("Additional Capacity for Projects"); text = new Text(shell, SWT.BORDER); text.setBounds(30, 31, 76, 21); text_1 = new Text(shell, SWT.BORDER); text_1.setBounds(172, 31, 76, 21); text_2 = new Text(shell, SWT.BORDER); text_2.setBounds(293, 31, 76, 21); text_3 = new Text(shell, SWT.BORDER); text_3.setBounds(48, 79, 76, 21); text_4 = new Text(shell, SWT.BORDER); text_4.setBounds(253, 79, 76, 21); Button btnRunAlgorithm = new Button(shell, SWT.NONE); btnRunAlgorithm.setBounds(158, 236, 102, 25); btnRunAlgorithm.setText("Run Algorithm"); Label lblHowManyTimes = new Label(shell, SWT.NONE); lblHowManyTimes.setBounds(84, 187, 285, 16); lblHowManyTimes.setText("How many times would you like the algorithm to run?"); text_5 = new Text(shell, SWT.BORDER); text_5.setBounds(172, 209, 76, 21); Button btnSpapapprox = new Button(shell, SWT.RADIO); btnSpapapprox.setBounds(68, 112, 102, 16); btnSpapapprox.setText("SPA-P-APPROX"); Button btnSpapapproxpromotion = new Button(shell, SWT.RADIO); btnSpapapproxpromotion.setBounds(68, 134, 185, 16); btnSpapapproxpromotion.setText("SPA-P-APPROX-PROMOTION"); Button btnBoth = new Button(shell, SWT.RADIO); btnBoth.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { } }); btnBoth.setBounds(254, 112, 90, 16); btnBoth.setText("Both"); Button btnIpProgrammingModel = new Button(shell, SWT.RADIO); btnIpProgrammingModel.setBounds(250, 134, 146, 16); btnIpProgrammingModel.setText("IP programming model"); btnRunAlgorithm.addMouseListener(new MouseAdapter() { @Override public void mouseDown(MouseEvent e) { int numberOfStudents = Integer.parseInt(text.getText()); int numberOfProjects = Integer.parseInt(text_1.getText()); int numberOfLecturers = Integer.parseInt(text_2.getText()); int lecturerCapacity = Integer.parseInt(text_3.getText()); int projectCapacity = Integer.parseInt(text_4.getText()); int numberOfInstances = Integer.parseInt(text_5.getText()); int[] arguments = new int[] {numberOfProjects, numberOfStudents, numberOfLecturers, lecturerCapacity, projectCapacity, numberOfInstances}; Main main = new Main(); try { if (btnBoth.getSelection()){ main.go(arguments, 0); main.go(arguments, 1); } else if (btnSpapapproxpromotion.getSelection()) { main. go(arguments, 0); } else if (btnSpapapprox.getSelection()) { main.go(arguments, 1); } else if (btnIpProgrammingModel.getSelection()){ main.go(arguments, 2); } else { System.out.println("Please select which algorithm you would like to run"); } } catch (GRBException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } }}); } }
[ "duncan.milne@outlook.com" ]
duncan.milne@outlook.com
455c437ca6c0c4a080f1ee3119314fa0cd2b18e3
410c3edff13b40190e3ef38aa60a42a4efc4ad67
/base/src/main/java/io/vproxy/vfd/windows/WindowsFDs.java
505a7e7a6d969709d5c1e7762af06ae8ab697b05
[ "MIT" ]
permissive
wkgcass/vproxy
f3d783531688676932f60f3df57e89ddabf3f720
6c891d43d6b9f2d2980a7d4feee124b054fbfdb5
refs/heads/dev
2023-08-09T04:03:10.839390
2023-07-31T08:28:56
2023-08-04T12:04:11
166,255,932
129
53
MIT
2022-09-15T08:35:53
2019-01-17T16:14:58
Java
UTF-8
Java
false
false
4,170
java
package io.vproxy.vfd.windows; import io.vproxy.base.util.Logger; import io.vproxy.base.util.Utils; import io.vproxy.vfd.*; import io.vproxy.vfd.jdk.ChannelFDs; import io.vproxy.vfd.posix.Posix; import java.io.IOException; import java.lang.reflect.Proxy; public class WindowsFDs implements FDs, FDsWithTap { private final ChannelFDs channelFDs; private final Windows windows; public WindowsFDs() { channelFDs = ChannelFDs.get(); assert VFDConfig.vfdlibname != null; String lib = VFDConfig.vfdlibname; try { Utils.loadDynamicLibrary(lib); } catch (UnsatisfiedLinkError e) { System.out.println(lib + " not found, requires lib" + lib + ".dylib or lib" + lib + ".so or " + lib + ".dll on java.library.path"); e.printStackTrace(System.out); Utils.exit(1); } if (VFDConfig.vfdtrace) { // make it difficult for graalvm native image initializer to detect the Posix.class // however we cannot use -Dvfdtrace=1 flag when using native image String clsStr = this.getClass().getPackage().getName() + "." + this.getClass().getSimpleName().substring(0, "Windows".length()); // clsStr should be vfd.posix.Posix Class<?> cls; try { cls = Class.forName(clsStr); } catch (ClassNotFoundException e) { // should not happen throw new RuntimeException(e); } windows = (Windows) Proxy.newProxyInstance(Posix.class.getClassLoader(), new Class[]{cls}, new TraceInvocationHandler(new GeneralWindows())); } else { windows = new GeneralWindows(); } } @Override public SocketFD openSocketFD() throws IOException { return channelFDs.openSocketFD(); } @Override public ServerSocketFD openServerSocketFD() throws IOException { return channelFDs.openServerSocketFD(); } @Override public DatagramFD openDatagramFD() throws IOException { return channelFDs.openDatagramFD(); } @Override public FDSelector openSelector() throws IOException { return channelFDs.openSelector(); } @Override public long currentTimeMillis() { return channelFDs.currentTimeMillis(); } @Override public boolean isV4V6DualStack() { return true; } @Override public TapDatagramFD openTap(String dev) throws IOException { long handle = windows.createTapHandle(dev); long readOverlapped; try { readOverlapped = windows.allocateOverlapped(); } catch (IOException e) { try { windows.closeHandle(handle); } catch (Throwable t) { Logger.shouldNotHappen("close handle " + handle + " failed when allocating readOverlapped failed", t); } throw e; } long writeOverlapped; try { writeOverlapped = windows.allocateOverlapped(); } catch (IOException e) { try { windows.closeHandle(handle); } catch (Throwable t) { Logger.shouldNotHappen("close handle " + handle + " failed when allocating writeOverlapped failed", t); } try { windows.releaseOverlapped(readOverlapped); } catch (Throwable t) { Logger.shouldNotHappen("releasing readOverlapped " + readOverlapped + " failed when allocating writeOverlapped failed", t); } throw e; } return new WindowsTapDatagramFD(windows, handle, new TapInfo(dev, (int) handle), readOverlapped, writeOverlapped); } @Override public boolean tapNonBlockingSupported() throws IOException { return windows.tapNonBlockingSupported(); } @Override public TapDatagramFD openTun(String devPattern) throws IOException { throw new IOException("tun unsupported"); } @Override public boolean tunNonBlockingSupported() throws IOException { throw new IOException("tun unsupported"); } }
[ "wkgcass@hotmail.com" ]
wkgcass@hotmail.com
4e437d67ec810e200dd1e519192f40b1f53f104c
198c4894cea5e82732f30c77f294e50ef448ab59
/src/main/java/io/xmljim/retirement/calculator/entity/algorithms/ParameterInfo.java
5c50ba3fdf69497fdc40b5cc6d3af128f35e7e51
[]
no_license
xmljim/calculator
d4deccc317e83fe381cfcfe2cbf64cf90e8d6d41
88806ec94793781fe2b871a160ca73a45676bf30
refs/heads/main
2023-07-17T13:21:52.807975
2021-09-07T19:34:14
2021-09-07T19:34:14
403,198,659
0
0
null
null
null
null
UTF-8
Java
false
false
595
java
package io.xmljim.retirement.calculator.entity.algorithms; import io.xmljim.algorithms.model.Parameter; import lombok.Getter; import lombok.Setter; import lombok.ToString; @Getter @Setter @ToString public class ParameterInfo { private String name; private String variable; private String parameterType; private Object value; public ParameterInfo(Parameter<?> parameter) { setName(parameter.getName()); setVariable(parameter.getVariable()); setParameterType(parameter.getParameterType().toString()); setValue(parameter.getValue()); } }
[ "jearley@captechconsulting.com" ]
jearley@captechconsulting.com
5f2f9ddc92fd52d4f7c125b460edd056071776e7
b7cbb3cd7a25a1dcd976f596befec4b76cd43d15
/src/main/java/com/netty/im/common/Attributes.java
326e36dd5158f2c48c508fbc265737d6c89c3b95
[]
no_license
TimmaWang/netty-learn-im
22e6cbf6485babf375559caebba86d82c982dc6d
e16f11f4761eb7ef6d282876a62df723f21e4359
refs/heads/master
2020-04-15T05:30:48.144283
2019-01-15T09:07:40
2019-01-15T09:07:40
164,426,359
0
0
null
null
null
null
UTF-8
Java
false
false
351
java
package com.netty.im.common; import com.netty.im.auth.Session; import io.netty.util.AttributeKey; /** * Created by timma on 2018/12/11. */ public interface Attributes { public static final AttributeKey<Boolean> LOGIN = AttributeKey.valueOf("login"); public static final AttributeKey<Session> SESSION = AttributeKey.valueOf("session"); }
[ "hzwangzhichao1@corp.netease.com" ]
hzwangzhichao1@corp.netease.com
f22f895d69ddd72433b29e395918d4785dcf4b63
30194346834c2e5b4042e5dc0fbcbd187ae69bea
/app/src/main/java/timeline/lizimumu/com/log/FileLogManager.java
d7b45204230eb87f25f6693bbf142370a8b366e7
[ "MIT" ]
permissive
GeorgyYakunin/AppUsageLimit
318598294e0bff8b812236e5959a66db118dbaf5
7aae3aa42c2fc60707e84be55a4de46d01368d40
refs/heads/master
2021-01-06T12:25:08.903525
2020-02-18T09:49:03
2020-02-18T09:49:03
241,325,075
0
1
null
null
null
null
UTF-8
Java
false
false
2,335
java
package timeline.lizimumu.com.log; import android.os.Environment; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.PrintWriter; import timeline.lizimumu.com.AppConst; /** * Log to file * Created by zb on 02/01/2018. */ public class FileLogManager { private static final String ALARM_LOG = "alarm.log"; private static final String LOG_PATH = Environment.getExternalStorageDirectory() + File.separator + AppConst.LOG_DIR; private static final String LOG_FILE = LOG_PATH + File.separator + ALARM_LOG; private static FileLogManager mInstance = new FileLogManager(); private FileLogManager() { } public static void init() { new Thread(new Runnable() { @Override public void run() { mInstance.doPrepare(); } }).run(); } public static FileLogManager getInstance() { return mInstance; } private void doPrepare() { File d = new File(LOG_PATH); boolean m = true; if (!d.exists()) { m = d.mkdirs(); } if (m) { File f = new File(LOG_FILE); if (!f.exists()) { try { boolean c = f.createNewFile(); if (!c) { System.err.println("create file error"); } } catch (IOException e) { e.printStackTrace(); } } } } public void log(String message) { doPrepare(); if (!message.endsWith("\n")) { message += "\n"; } FileOutputStream outputStream = null; PrintWriter writer = null; try { outputStream = new FileOutputStream(LOG_FILE, true); writer = new PrintWriter(outputStream); writer.write(message); } catch (FileNotFoundException e) { e.printStackTrace(); } finally { if (writer != null) writer.close(); if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { e.printStackTrace(); } } } } }
[ "jrayg95@gmail.com" ]
jrayg95@gmail.com
9122263cd423da62d91e822b22f7c5b788d53709
479f01152146181f9c582719f08a8018c2a748a8
/List5/src/main/java/com/inter/admin/AdminController.java
d4f710f20a340252dd89bda438bb41baaf75dcdf
[]
no_license
YeonWooSeong/set19
c78107834860bba738e7be86c68944a012875910
587c6ff71e6b4a29654406ee31210a33f4bd3419
refs/heads/master
2021-05-30T12:07:17.791847
2016-02-25T08:05:45
2016-02-25T08:05:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,658
java
package com.inter.admin; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.SessionAttributes; import org.springframework.web.bind.support.SessionStatus; import com.inter.app.ArticleServiceImpl; import com.inter.app.ArticleVO; import com.inter.member.MemberServiceImpl; import com.inter.member.MemberVO; @Controller @SessionAttributes("admin") @RequestMapping("/admin") public class AdminController { private static final Logger logger = LoggerFactory.getLogger(AdminController.class); @Autowired MemberVO member; @Autowired ArticleVO article; @Autowired MemberServiceImpl memberService; @Autowired AdminServiceImpl adminService; @Autowired ArticleServiceImpl articleService; @RequestMapping("") public String home(){ logger.info("AdminController-login() 진입"); System.out.println("ㅁㅁㅁㅁㅁㅁㅁㅁㅁㅁㅁ"); return "admin/admin/login.tiles"; } @RequestMapping("/main") public String main(){ logger.info("AdminController-home() 진입"); return "admin/admin/main.tiles"; } @RequestMapping("/member") public String member(Model model){ logger.info("AdminController-home() 진입"); List<MemberVO> members = adminService.getMemberList(); model.addAttribute("list", members); return "admin/admin/member.tiles"; } @RequestMapping("/chart") public String chart(){ logger.info("AdminController-home() 진입"); return "admin/admin/chart.tiles"; } @RequestMapping("/board") public String board(Model model){ logger.info("AdminController-home() 진입"); List<ArticleVO> articles = articleService.getAllList(); model.addAttribute("list", articles); return "admin/admin/board.tiles"; } @RequestMapping("/member_list") public void memberList( Model model ){ List<MemberVO> members = adminService.getMemberList(); model.addAttribute("list", members); } @RequestMapping("/member_profile") public Model memberProfile( String id,Model model ){ logger.info("개인 프로필 진입"); logger.info("가져온 아이디{}",id); member = memberService.selectById(id); model.addAttribute("member", member); return model; } @RequestMapping("/insert") public void insert( @RequestParam("id") String id, @RequestParam("password") String password, String email, String phone, Model model){ logger.info("insert 진입"); logger.info("id{}",id); logger.info("password{}",password); logger.info("email{}",email); logger.info("phone{}",phone); member = memberService.selectById(id); member.setPassword(password); member.setEmail(email); member.setPhone(phone); int result = memberService.change(member); model.addAttribute("result", id + " 님의 정보수정을 완료했습니다."); } @RequestMapping("/delete") public Model delete(String id,Model model){ memberService.remove(id); model.addAttribute("result",id+"님의 탈퇴를 완료했습니다."); return model; } @RequestMapping("/logout") public void logout(SessionStatus status){ status.setComplete(); } @RequestMapping("/login") public void login( String id, String password, Model model ) { System.out.println("아이디 : " + id ); System.out.println("비번 : " + password ); member = memberService.login(id, password); if (member == null) { System.out.println("로그인 실패"); model.addAttribute("result", "fail"); } else { if (member.getId().equals("choa")) { System.out.println("로그인 성공"); model.addAttribute("admin", member); model.addAttribute("result", "success"); } else { System.out.println("로그인 실패"); model.addAttribute("result", "fail"); } } } @RequestMapping("/notice") public String notice() { return "admin/admin/notice.tiles"; } @RequestMapping("/write_notice") public void writeNotice( String title, String content ) { article.setUsrSubject(title); article.setUsrContent(content); article.setUsrName("관리자"); articleService.write(article); } @RequestMapping("/delete_writing") public void deleteWriting(String code) { articleService.delete(Integer.parseInt(code)); } }
[ "Administrator@MSDN-SPECIAL" ]
Administrator@MSDN-SPECIAL
e9bdeb6dd74dda9f56d92ad3e1e06b101e064de7
e866bd9d56d6faee468745a6adf68ffcdd3591bc
/src/main/java/org/kungfu/classAttendance/Class_Attendance.java
9afcd7e359c0bdf09d5f45a998d747f08c875e8b
[]
no_license
eshan-gill/Kung-Fu
7a0c334954fb3d4bf155134dabe56716e62015ab
9b228d0bcb2ecf62b2c3dfefad5b9553f525b00c
refs/heads/master
2020-03-27T21:19:34.089985
2018-09-03T01:13:38
2018-09-03T01:13:38
147,135,172
0
0
null
null
null
null
UTF-8
Java
false
false
1,947
java
package org.kungfu.classAttendance; import java.sql.Date; import java.util.ArrayList; import java.util.Collection; import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; import javax.persistence.Temporal; import javax.persistence.TemporalType; import org.kungfu.classMain.Class; import org.kungfu.classSchedule.Class_Schedule; import org.kungfu.student.Student; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonIdentityInfo; import com.fasterxml.jackson.annotation.ObjectIdGenerators; @Entity public class Class_Attendance { @Id @GeneratedValue int cls_att_num; @ManyToOne(cascade = CascadeType.PERSIST) @JoinColumn(name ="std_num") //@JsonIdentityInfo(generator=ObjectIdGenerators.IntSequenceGenerator.class, property="@stdNum") public Student studentFee; @ManyToOne(cascade = CascadeType.PERSIST) @JoinColumn(name ="cls_code") public Class classs; @ManyToOne(cascade = CascadeType.PERSIST) @JoinColumn(name ="sch_num") public Class_Schedule classSch; @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="yyyy-MM-dd",timezone="EST") Date att_date; //Getter and Setters public int getCls_serial_num() { return cls_att_num; } public void setCls_serial_num(int cls_serial_num) { this.cls_att_num = cls_serial_num; } public Student getStudentFee() { return studentFee; } public void setStudentFee(Student studentFee) { this.studentFee = studentFee; } public Class getClasss() { return classs; } public void setClasss(Class classs) { this.classs = classs; } public Date getAtt_date() { return att_date; } public void setAtt_date(Date att_date) { this.att_date = att_date; } }
[ "eshangill93@gmail.com" ]
eshangill93@gmail.com
c52d28dab173883d4908b097cd5975cde3ffa219
da546bfec1fcacfce81005a794a9ca1ad535d38e
/src/com/JVComponents/Plugin/JVPluginElementToolbar.java
23c9031032365f4353a1bfb6d6cf16fbd4b5b1bc
[]
no_license
453897806/JavaVisualComponents
40abb31dc787c9abd9c33e548ebff0a079e14e9b
54b227a72922d17a6f9199396abdb840d4ffc66b
refs/heads/master
2020-03-28T20:37:49.372874
2019-01-30T08:30:49
2019-01-30T08:30:49
149,088,864
0
0
null
null
null
null
UTF-8
Java
false
false
922
java
package com.JVComponents.Plugin; import org.dom4j.Element; import com.JVComponents.core.JVConfigXMLAttribute; import com.JVComponents.core.JVConfigXMLFile; import com.JVComponents.core.JVConsts; import com.JVComponents.core.JVException; public class JVPluginElementToolbar extends JVPluginElement { private JVConfigXMLAttribute id; /** * id属性 * * @throws JVException */ public JVConfigXMLAttribute getId() { return id; } public JVPluginElementToolbar(JVConfigXMLFile configXMLFile, Element element) throws JVException { super(configXMLFile, element); } @Override protected void readAttributes(Element element) throws JVException { //忽略基类 //super.readAttributes(element); //特殊属性 id = getXMLAttribute(JVPluginConsts.JVPluginRoot.id, JVConsts.emptyString); } @Override public void matchPluginElement() throws JVException { //无需要匹配的对象 } }
[ "bob@localhost" ]
bob@localhost
31d561e67883b53893e497008c73e47c995734ab
c18c3f3bdc51f048f662344d032f9388dfecbd9d
/ddf-parent/ddf-service-student/src/main/java/com/ddf/student/api/BaseApi.java
bd139d34fdc8d560458aa340bd816248fbe9d451
[]
no_license
soldiers1989/my_dev
88d62e4f182ac68db26be3d5d3ddc8a68e36c852
4250267f6d6d1660178518e71b1f588b4f3926f7
refs/heads/master
2020-03-27T19:39:28.191729
2018-02-12T02:29:51
2018-02-12T02:29:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,245
java
package com.ddf.student.api; import java.beans.PropertyEditorSupport; import java.util.Date; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.web.bind.WebDataBinder; import org.springframework.web.bind.annotation.InitBinder; import com.ddf.util.DateUtil; /** * 控制器支持类 * @author ThinkGem * @version 2013-3-23 */ public abstract class BaseApi { /** * 日志对象 */ protected Logger logger = LoggerFactory.getLogger(getClass()); @InitBinder protected void initBinder(WebDataBinder binder) { binder.registerCustomEditor(Date.class, new DateEditor()); //binder.registerCustomEditor(Double.class, new DoubleEditor()); //binder.registerCustomEditor(Integer.class, new IntegerEditor()); } private class DateEditor extends PropertyEditorSupport { @Override public void setAsText(String text) throws IllegalArgumentException { Date date = null; try { date = DateUtil.StringToDate(text, DateUtil.yyyy_MM_dd_HH_mm_ss); } catch (Exception e) { date = DateUtil.StringToDate(text, DateUtil.yyyy_MM_dd); } setValue(date); } } }
[ "huayan333" ]
huayan333
f459f75d774c28aa27126e7340d823ca7b915f11
f82b6c599b85f46a93a28193e2f465acc350735b
/src/test/java/com/whatslly/rest/api/testing_project/NegativeTestWrongEndpoint.java
78b588eceed99b38046385c39ffefebe31a53976
[]
no_license
Hodiya2929/REST-API-testing-project
ffa72ecfd7a664a95288600d5bef1367558cc7de
6ab09440f5a784c545c9ee2c14103ab5c1f564ce
refs/heads/main
2023-04-15T21:22:16.609452
2021-04-21T09:44:46
2021-04-21T09:44:46
359,945,585
0
0
null
2021-04-21T09:44:47
2021-04-20T20:41:12
HTML
UTF-8
Java
false
false
867
java
package com.whatslly.rest.api.testing_project; import org.testng.annotations.Test; import io.restassured.RestAssured; import io.restassured.config.SSLConfig; import tests.data.DataProviders; public class NegativeTestWrongEndpoint extends AbstractTest { @Test(dataProvider = "unvalidEndpoints", dataProviderClass = DataProviders.class) public void verifyWrongEndpointStatusCode(String unvalidEndpoint) { String url = initializeEndpoint(unvalidEndpoint); System.out.println(url); io.restassured.RestAssured.given() .config(RestAssured.config().sslConfig(new SSLConfig().allowAllHostnames())) .when().get(url) .then().statusCode(404); /*RestAssured.config().sslConfig(new SSLConfig().allowAllHostnames()) - this to allow insecure get request - to bypass the SSL certificate - in order to reach to server and get the status response */ } }
[ "hodiya.eyal@gmail.com" ]
hodiya.eyal@gmail.com
768fceb7072084ed5e8e16b215b412c038c8ee5e
282465c815ff20165481197bf5287341baf42311
/webapp.bak/src/main/java/com/cloudlbs/web/client/composite/RegisterUserSuccess.java
97533ebce90887609bda4e3f60961faf83a84577
[ "MIT" ]
permissive
dmascenik/cloudlbs
d47276919c8f5f9764d0e0cf3bdf7ca48a34a3b8
97d3493e82edd9cb0a7995d588b26a4808b4f79f
refs/heads/master
2020-05-09T14:28:44.279834
2015-09-07T15:51:15
2015-09-07T15:51:15
42,061,241
0
0
null
null
null
null
UTF-8
Java
false
false
1,376
java
package com.cloudlbs.web.client.composite; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.VerticalPanel; import com.google.gwt.user.client.ui.Label; import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.HasHorizontalAlignment; import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.event.dom.client.ClickEvent; /** * @author Dan Mascenik * */ public class RegisterUserSuccess extends Composite { public RegisterUserSuccess(String email) { VerticalPanel verticalPanel = new VerticalPanel(); initWidget(verticalPanel); Label lblSuccess = new Label("Success!"); lblSuccess.setStyleName("title"); verticalPanel.add(lblSuccess); Label lblAnEmailHas = new Label("An email has been sent to " + email + " with a link to activate your account."); lblAnEmailHas.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); verticalPanel.add(lblAnEmailHas); lblAnEmailHas.setWidth("450px"); Button btnOk = new Button("Ok"); btnOk.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { // TODO return to the home page } }); verticalPanel.add(btnOk); verticalPanel.setCellHorizontalAlignment(btnOk, HasHorizontalAlignment.ALIGN_CENTER); btnOk.setWidth("92px"); } }
[ "dan@cloud-lbs.com" ]
dan@cloud-lbs.com
aad650ab8121f5ebd4e476da497ac8821f627d5e
acfa94fa53b1f78501153614132e7c671f815ae9
/src/main/java/com/ync365/oa/repository/PeControllerDao.java
267f6a3514f6623fe53e30c3e87665499ad6a2bb
[]
no_license
haagensensusanne53/ync_kpi
9e6bddcb688aa5e1b9413119c018b29d0cb0d8d5
e3a82158d64f3a9cdb571f04f1ede55755416f21
refs/heads/master
2023-07-20T19:13:41.120040
2017-07-17T13:27:05
2017-07-17T13:27:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
604
java
package com.ync365.oa.repository; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.repository.PagingAndSortingRepository; import com.ync365.oa.entity.PeController; public interface PeControllerDao extends PagingAndSortingRepository<PeController, Long>, JpaSpecificationExecutor<PeController> { PeController findByPeDateDepartment(String peDateDepartment); Page<PeController> findByDepartmentId(Long departmentId,Pageable pageable); }
[ "lianok2008@163.com" ]
lianok2008@163.com
e304114215c6df6669c08c22fc7ce008494da78d
fa1408365e2e3f372aa61e7d1e5ea5afcd652199
/src/testcases/CWE197_Numeric_Truncation_Error/s01/CWE197_Numeric_Truncation_Error__int_console_readLine_to_byte_71b.java
a1adebb08d30fa135f080b6b4ec80ff3456fe7d2
[]
no_license
bqcuong/Juliet-Test-Case
31e9c89c27bf54a07b7ba547eddd029287b2e191
e770f1c3969be76fdba5d7760e036f9ba060957d
refs/heads/master
2020-07-17T14:51:49.610703
2019-09-03T16:22:58
2019-09-03T16:22:58
206,039,578
1
2
null
null
null
null
UTF-8
Java
false
false
1,435
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE197_Numeric_Truncation_Error__int_console_readLine_to_byte_71b.java Label Definition File: CWE197_Numeric_Truncation_Error__int.label.xml Template File: sources-sink-71b.tmpl.java */ /* * @description * CWE: 197 Numeric Truncation Error * BadSource: console_readLine Read data from the console using readLine * GoodSource: A hardcoded non-zero, non-min, non-max, even number * Sinks: to_byte * BadSink : Convert data to a byte * Flow Variant: 71 Data flow: data passed as an Object reference argument from one method to another in different classes in the same package * * */ package testcases.CWE197_Numeric_Truncation_Error.s01; import testcasesupport.*; public class CWE197_Numeric_Truncation_Error__int_console_readLine_to_byte_71b { public void badSink(Object dataObject ) throws Throwable { int data = (Integer)dataObject; { /* POTENTIAL FLAW: Convert data to a byte, possibly causing a truncation error */ IO.writeLine((byte)data); } } /* goodG2B() - use goodsource and badsink */ public void goodG2BSink(Object dataObject ) throws Throwable { int data = (Integer)dataObject; { /* POTENTIAL FLAW: Convert data to a byte, possibly causing a truncation error */ IO.writeLine((byte)data); } } }
[ "bqcuong2212@gmail.com" ]
bqcuong2212@gmail.com
25cbddfa0a2d0a1db9074db86dd5fc0387bdb8f1
f91017917be578a0a490dbf7c8553c26459beaf3
/fw-core/src/main/java/com/seeyu/core/utils/BaseJsonData.java
2fea27899956b1ed24457fd0c72204ff1d0ef9dc
[]
no_license
zhaoyongchao1991/seeyu-framework
63195e62ec1ca823b73f468d175706ddf1554fbe
0a3c43c5d4383926190ec7303ba2e03f4c9e28a5
refs/heads/master
2022-12-22T03:32:02.432110
2019-12-10T12:13:54
2019-12-10T12:13:54
210,003,953
0
0
null
2022-12-10T05:21:23
2019-09-21T14:57:34
Java
UTF-8
Java
false
false
1,755
java
package com.seeyu.core.utils; import lombok.Getter; import lombok.ToString; @ToString public class BaseJsonData<T> extends ServiceData<T> { protected Exception exception; protected String exceptionMessage; protected Integer code; @Getter protected Long timestamp; public BaseJsonData() { this(false); } protected BaseJsonData(boolean success) { super(success); this.timestamp = System.currentTimeMillis(); } public static BaseJsonData SUCCESS() { return new BaseJsonData(true); } public static BaseJsonData ERROR() { return new BaseJsonData(false); } @Override public BaseJsonData setSuccess(boolean success) { this.success = success; return this; } @Override public BaseJsonData setData(T data) { this.data = data; return this; } public Exception getException() { return exception; } public BaseJsonData setException(Exception exception) { this.exception = exception; return this; } @Override public String getMessage() { return message; } @Override public BaseJsonData setMessage(String message, Object...messageArgs) { this.message = message; this.messageArgs = messageArgs; return this; } public String getExceptionMessage() { return exceptionMessage; } public BaseJsonData setExceptionMessage(String exceptionMessage) { this.exceptionMessage = exceptionMessage; return this; } public Integer getCode() { return code; } public BaseJsonData setCode(Integer code) { this.code = code; return this; } }
[ "zhaoyc@jieyundata.com" ]
zhaoyc@jieyundata.com
d591e0ef1e84078bf2ba39afdd7611187c822ce8
e7403e990fa6f023bd20980b35f3e5518d585542
/JSP/myweb2/src/listo/bbs/model/BbsDAO.java
7d23b5278a66abce8bb3a3c944299f7c850da92b
[]
no_license
fivingo/ildream_jsp
1e76e931d61be66580e8ed6de1507e3b667933cd
fef74d5780bf43946085b8abeedcdd3de0be04b1
refs/heads/master
2022-03-15T14:20:24.630824
2019-11-17T14:45:56
2019-11-17T14:45:56
222,226,434
0
0
null
null
null
null
UTF-8
Java
false
false
6,403
java
package listo.bbs.model; import java.sql.*; import java.util.ArrayList; import oracle.net.aso.s; public class BbsDAO { private Connection conn; private PreparedStatement ps; private ResultSet rs; public static final int ERROR = -1; public BbsDAO() { } /** 총 게시글 개수 관련 메서드 */ public int getTotalCount() { try { conn = listo.db.ListoDb.getConn(); String sql = "SELECT COUNT(*) FROM jsp_bbs"; ps = conn.prepareStatement(sql); rs = ps.executeQuery(); rs.next(); int count = rs.getInt(1); return count == 0 ? 1 : count; } catch (Exception e) { e.printStackTrace(); return ERROR; } finally { try { if (rs != null) rs.close(); if (ps != null) ps.close(); if (conn != null) conn.close(); } catch (Exception e2) {} } } /** 목록 관련 메서드 */ public ArrayList<BbsDTO> bbsList(int cPage, int listSize) { try { conn = listo.db.ListoDb.getConn(); int startNumber = (cPage - 1) * listSize + 1; int endNumber = cPage * listSize; String sql = "SELECT * FROM " + "(SELECT ROWNUM AS rnum, a.* FROM " + "(SELECT * FROM jsp_bbs ORDER BY breference DESC, brank ASC) a) b " + "WHERE rnum >= ? and rnum <= ?"; ps = conn.prepareStatement(sql); ps.setInt(1, startNumber); ps.setInt(2, endNumber); rs = ps.executeQuery(); ArrayList<BbsDTO> arr = new ArrayList<BbsDTO>(); while (rs.next()) { int bidx = rs.getInt("bidx"); String bwriter = rs.getString("bwriter"); String bpwd = rs.getString("bpwd"); String bsubject = rs.getString("bsubject"); String bcontent = rs.getString("bcontent"); Date bwriteDate = rs.getDate("bwriteDate"); int breadCount = rs.getInt("breadCount"); int breference = rs.getInt("breference"); int blevel = rs.getInt("blevel"); int brank = rs.getInt("brank"); int brecommend = rs.getInt("brecommend"); BbsDTO dto = new BbsDTO(bidx, bwriter, bpwd, bsubject, bcontent, bwriteDate, breadCount, breference, blevel, brank, brecommend); arr.add(dto); } return arr; } catch (Exception e) { e.printStackTrace(); return null; } finally { try { if (rs != null) rs.close(); if (ps != null) ps.close(); if (conn != null) conn.close(); } catch (Exception e2) {} } } /** 페이징 관련 메서드 */ /** breference 마지막값 구하는 메서드 */ public int getMaxRef() { try { String sql = "SELECT MAX(breference) FROM jsp_bbs"; ps = conn.prepareStatement(sql); rs = ps.executeQuery(); int max = 0; if (rs.next()) { max = rs.getInt(1); } return max; } catch (Exception e) { e.printStackTrace(); return ERROR; } finally { try { } catch (Exception e2) {} } } /** 글쓰기 관련 메서드 */ public int bbsWrite(BbsDTO dto) { try { conn = listo.db.ListoDb.getConn(); int ref = getMaxRef(); String sql = "INSERT INTO jsp_bbs " + "VALUES (jsp_bbs_idx.nextval, ?, ?, ?, ?, SYSDATE, 0, ?, 0, 0, 0)"; ps = conn.prepareStatement(sql); ps.setString(1, dto.getBwriter()); ps.setString(2, dto.getBpwd()); ps.setString(3, dto.getBsubject()); ps.setString(4, dto.getBcontent()); ps.setInt(5, ref + 1); int count = ps.executeUpdate(); return count; } catch (Exception e) { e.printStackTrace(); return ERROR; } finally { try { if (ps != null) ps.close(); if (rs != null) rs.close(); } catch (Exception e2) {} } } /** 본문 관련 메서드 */ public BbsDTO bbsContent(int bidx) { try { conn = listo.db.ListoDb.getConn(); String sql = "SELECT * FROM jsp_bbs WHERE bidx = ?"; ps = conn.prepareStatement(sql); ps.setInt(1, bidx); rs = ps.executeQuery(); BbsDTO dto = null; while (rs.next()) { String bwriter = rs.getString("bwriter"); String bpwd = rs.getString("bpwd"); String bsubject = rs.getString("bsubject"); String bcontent = rs.getString("bcontent"); Date bwriteDate = rs.getDate("bwriteDate"); int breadCount = rs.getInt("breadCount"); int breference = rs.getInt("breference"); int blevel = rs.getInt("blevel"); int brank = rs.getInt("brank"); int brecommend = rs.getInt("brecommend"); dto = new BbsDTO(bidx, bwriter, bpwd, bsubject, bcontent, bwriteDate, breadCount, breference, blevel, brank, brecommend); } return dto; } catch (Exception e) { e.printStackTrace(); return null; } finally { try { if (rs != null) rs.close(); if (ps != null) ps.close(); if (conn != null) conn.close(); } catch (Exception e2) {} } } /** 게시글 조회수 관련 메서드 */ public void readCount(int bidx, int breadCount) { try { conn = listo.db.ListoDb.getConn(); String sql = "UPDATE jsp_bbs SET breadcount = ? WHERE bidx = ?"; ps = conn.prepareStatement(sql); ps.setInt(2, bidx); ps.setInt(1, breadCount + 1); ps.executeUpdate(); } catch (Exception e) { e.printStackTrace(); } finally { try { if (ps != null) ps.close(); if (conn != null) conn.close(); } catch (Exception e2) {} } } /** 순번변경 관련 메서드 */ public void setRankUpdate(int breference, int brank) { try { String sql = "UPDATE jsp_bbs SET brank = brank + 1 WHERE breference = ? and brank >= ?"; ps = conn.prepareStatement(sql); ps.setInt(1, breference); ps.setInt(2, brank); ps.executeQuery(); } catch (Exception e) { e.printStackTrace(); } finally { try { if (ps != null) ps.close(); } catch (Exception e2) {} } } /** 답변쓰기 관련 메서드 */ public int bbsReWrite(BbsDTO dto) { try { conn = listo.db.ListoDb.getConn(); setRankUpdate(dto.getBreference(), dto.getBrank() + 1); String sql = "INSERT INTO jsp_bbs VALUES(jsp_bbs_idx.nextval, ?, ?, ?, ?, SYSDATE, 0, ?, ?, ?, 0)"; ps = conn.prepareStatement(sql); ps.setString(1, dto.getBwriter()); ps.setString(2, dto.getBpwd()); ps.setString(3, dto.getBsubject()); ps.setString(4, dto.getBcontent()); ps.setInt(5, dto.getBreference()); ps.setInt(6, dto.getBlevel() + 1); ps.setInt(7, dto.getBrank() + 1); int count = ps.executeUpdate(); return count; } catch (Exception e) { e.printStackTrace(); return ERROR; } finally { try { if (ps != null) ps.close(); if (conn != null) conn.close(); } catch (Exception e2) {} } } }
[ "fiving@naver.com" ]
fiving@naver.com
b7e93963b965b520c6376d8769b13c25a9d68aa1
1518c5b0007498020cd63df585d9d296be892b24
/src/main/java/com/nhat/naschool/dto/UserRegistrationDto.java
3c2420a9083d6562059b95919facd65d73717ce1
[]
no_license
NguyenNhat98/NaSchool
ea3c2fce932101f02e1062e75b07775a829b749a
449e949f79ca1970cf544a65b1920e07cebdead4
refs/heads/master
2023-05-25T22:37:08.153440
2021-06-01T10:57:08
2021-06-01T10:57:08
281,342,301
0
0
null
2021-06-01T10:51:17
2020-07-21T08:36:43
CSS
UTF-8
Java
false
false
679
java
package com.nhat.naschool.dto; public class UserRegistrationDto { private String name; private String email; private String password; public UserRegistrationDto(){ } public UserRegistrationDto( String name, String email, String password) { this.name = name; this.email = email; this.password = password; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } }
[ "NhatNV62@wru.vn" ]
NhatNV62@wru.vn
e3a0bf8829785daa3cd9e642a8a317456d0d99f3
a01906e1949c482f18447874c534826099f7d951
/src/main/java/org/shannon/function/ExceptionalSupplier.java
27f97576e66fe889801a07b14f3ba10a1cf62319
[ "Apache-2.0" ]
permissive
Lwelch45/ShardAllocator
1a2c8b673b79c6caacf46d5597777bb294e2b12b
904b11c628a8e19b4ebaa97cdf22aff29f8a0a03
refs/heads/master
2020-12-30T16:02:07.042203
2017-05-10T23:39:24
2017-05-10T23:39:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
150
java
package org.shannon.function; @FunctionalInterface public interface ExceptionalSupplier<E extends Throwable, T> { public T get() throws E; }
[ "smonasco@gmail.com" ]
smonasco@gmail.com
9cc90ea21543ed7673ed27bdb5efab9b69941854
e6e3bc6aaaae82d346fdb8acb51ee87e907bdaa8
/src/main/java/com/fiona/test/App.java
993f3d30702bdd1aaa472105abf989ecff3b3d20
[]
no_license
linafeng/test
cb563322ba7c65efd1f0aacd1e7e999b829d4256
a925a96b2bb09e2b8e041c37ddf207f625f39dd9
refs/heads/master
2020-03-19T09:26:53.923314
2018-06-06T10:00:13
2018-06-06T10:00:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
177
java
package com.fiona.test; /** * Hello world! * */ public class App { public static void main( String[] args ) { System.out.println( "Hello World!" ); } }
[ "lina.feng@gentinghk.com" ]
lina.feng@gentinghk.com
aa6265f8569efdf3cf63e887c48541369dcafa24
85ff83205299a337f9912abe3b1d08d90afa4416
/MLKit-Sample/module-text/src/main/java/com/huawei/mlkit/sample/camera/LensEnginePreview.java
c518def83f0bd4172a979b73c818e2372ba188e1
[ "Apache-2.0" ]
permissive
Hasnainninesol/hms-ml-demo
3b3d694431b5d2db45a4c4a4293f73a58dbd2543
a672a2dd4bae002f92c684980b9815f64f302bf3
refs/heads/master
2023-01-14T04:47:30.970599
2020-11-19T07:50:59
2020-11-19T07:50:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
12,095
java
/** * Copyright 2018 Google 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. * 2020.2.21-Changed name from CameraSourcePreview to LensEnginePreview, in addition, the onTouchEvent, handleZoom, handleFocusMetering method is added. * Huawei Technologies Co., Ltd. */ package com.huawei.mlkit.sample.camera; import android.annotation.SuppressLint; import android.content.Context; import android.content.res.Configuration; import android.graphics.Rect; import android.graphics.RectF; import android.hardware.Camera; import android.os.Build; import android.util.AttributeSet; import android.util.Log; import android.view.MotionEvent; import android.view.SurfaceHolder; import android.view.SurfaceView; import android.view.ViewGroup; import java.io.IOException; import java.util.ArrayList; import java.util.List; import com.huawei.hms.common.size.Size; public class LensEnginePreview extends ViewGroup { private static final String TAG = "LensEnginePreview"; private Context context; private SurfaceView surfaceView; private boolean startRequested; private LensEngine lensEngine; private float oldDist = 1f; /** * Determines whether the camera preview frame and detection result display frame are synchronous or asynchronous. */ private boolean isSynchronous = false; public LensEnginePreview(Context context, AttributeSet attrs) { super(context, attrs); this.context = context; this.startRequested = false; this.surfaceView = new SurfaceView(context); this.surfaceView.getHolder().addCallback(new SurfaceCallback()); this.addView(this.surfaceView); } public SurfaceHolder getSurfaceHolder() { return this.surfaceView.getHolder(); } public void start(LensEngine lensEngine, boolean isSynchronous) throws IOException { this.isSynchronous = isSynchronous; if (lensEngine == null) { this.stop(); } this.lensEngine = lensEngine; if (this.lensEngine != null) { this.startRequested = true; this.startLensEngine(); } } public void stop() { if (this.lensEngine != null) { this.lensEngine.stop(); } } public void release() { if (this.lensEngine != null) { this.lensEngine.release(); this.lensEngine = null; } } @SuppressLint("MissingPermission") private void startLensEngine() throws IOException { if (this.startRequested) { this.lensEngine.run(); this.startRequested = false; } } public void takePicture(Camera.PictureCallback pictureCallback) { if (this.lensEngine != null) { this.lensEngine.takePicture(pictureCallback); } } private class SurfaceCallback implements SurfaceHolder.Callback { @Override public void surfaceCreated(SurfaceHolder surface) { try { LensEnginePreview.this.startLensEngine(); } catch (IOException e) { Log.e(LensEnginePreview.TAG, "Could not start lensEngine.", e); } } @Override public void surfaceDestroyed(SurfaceHolder surface) { } @Override public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { Log.d(LensEnginePreview.TAG, "surfaceChanged"); Camera camera = LensEnginePreview.this.lensEngine.getCamera(); if (camera == null) { return; } try { camera.setPreviewDisplay(LensEnginePreview.this.surfaceView.getHolder()); } catch (IOException e) { Log.e(LensEnginePreview.TAG, "IOException", e); } } } @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { try { this.startLensEngine(); } catch (IOException e) { Log.e(LensEnginePreview.TAG, "Could not start LensEngine.", e); } if (this.lensEngine == null) { return; } Size size = this.lensEngine.getPreviewSize(); if (size == null) { return; } int width = size.getWidth(); int height = size.getHeight(); // When the phone is in portrait orientation, the width and height dimensions are interchangeable. if (this.isVertical()) { int tmp = width; width = height; height = tmp; } final int viewWidth = right - left; final int viewHeight = bottom - top; int childWidth; int childHeight; int childXOffset = 0; int childYOffset = 0; float widthRatio = (float) viewWidth / (float) width; float heightRatio = (float) viewHeight / (float) height; // To fill the view with the camera preview, while also preserving the correct aspect ratio, // it is usually necessary to slightly oversize the child and to crop off portions along one // of the dimensions. We scale up based on the dimension requiring the most correction, and // compute a crop offset for the other dimension. if (widthRatio > heightRatio) { childWidth = viewWidth; childHeight = (int) ((float) height * widthRatio); childYOffset = (childHeight - viewHeight) / 2; } else { childWidth = (int) ((float) width * heightRatio); childHeight = viewHeight; childXOffset = (childWidth - viewWidth) / 2; } for (int i = 0; i < this.getChildCount(); ++i) { // One dimension will be cropped. We shift child over or up by this offset and adjust // the size to maintain the proper aspect ratio. this.getChildAt(i) .layout(-1 * childXOffset, -1 * childYOffset, childWidth - childXOffset, childHeight - childYOffset); } } private boolean isVertical() { int orientation = this.context.getResources().getConfiguration().orientation; return orientation == Configuration.ORIENTATION_PORTRAIT; } @Override public boolean onTouchEvent(MotionEvent event) { if (CameraConfiguration.getCameraFacing() == CameraConfiguration.CAMERA_FACING_FRONT) { return true; } if (this.lensEngine == null) { return true; } if (event.getPointerCount() == 1) { switch (event.getAction()) { case MotionEvent.ACTION_UP: this.handleFocusMetering(event, this.lensEngine.getCamera()); break; } } else { switch (event.getAction() & MotionEvent.ACTION_MASK) { case MotionEvent.ACTION_POINTER_DOWN: this.oldDist = LensEnginePreview.getFingerSpacing(event); break; case MotionEvent.ACTION_MOVE: Log.d(LensEnginePreview.TAG, "toby onTouch: ACTION_MOVE"); float newDist = LensEnginePreview.getFingerSpacing(event); if (newDist > this.oldDist) { this.handleZoom(true, this.lensEngine.getCamera()); } else if (newDist < this.oldDist) { this.handleZoom(false, this.lensEngine.getCamera()); } this.oldDist = newDist; break; default: break; } } return true; } private void handleZoom(boolean isZoomIn, Camera camera) { Camera.Parameters params = camera.getParameters(); if (params.isZoomSupported()) { int maxZoom = params.getMaxZoom(); int zoom = params.getZoom(); if (isZoomIn && zoom < maxZoom) { zoom++; } else if (zoom > 0) { zoom--; } params.setZoom(zoom); camera.setParameters(params); } else { Log.i(LensEnginePreview.TAG, "zoom not supported"); } } private void handleFocusMetering(MotionEvent event, Camera camera) { int viewWidth = this.getWidth(); int viewHeight = this.getHeight(); Rect focusRect = LensEnginePreview.calculateTapArea(event.getX(), event.getY(), 1f, viewWidth, viewHeight); Rect meteringRect = LensEnginePreview.calculateTapArea(event.getX(), event.getY(), 1.5f, viewWidth, viewHeight); camera.cancelAutoFocus(); Camera.Parameters params = camera.getParameters(); if (params.getMaxNumFocusAreas() > 0) { List<Camera.Area> focusAreas = new ArrayList<>(); focusAreas.add(new Camera.Area(focusRect, 800)); params.setFocusAreas(focusAreas); } else { Log.i(LensEnginePreview.TAG, "focus areas not supported"); } if (params.getMaxNumMeteringAreas() > 0) { List<Camera.Area> meteringAreas = new ArrayList<>(); meteringAreas.add(new Camera.Area(meteringRect, 800)); params.setMeteringAreas(meteringAreas); } else { Log.i(LensEnginePreview.TAG, "metering areas not supported"); } final String currentFocusMode = params.getFocusMode(); Log.d(LensEnginePreview.TAG, "toby onTouch:" + currentFocusMode); params.setFocusMode(Camera.Parameters.FOCUS_MODE_AUTO); camera.setParameters(params); camera.autoFocus(new Camera.AutoFocusCallback() { @Override public void onAutoFocus(boolean success, Camera camera) { Camera.Parameters params = camera.getParameters(); params.setFocusMode(currentFocusMode); camera.setParameters(params); } }); } private static float getFingerSpacing(MotionEvent event) { float x = event.getX(0) - event.getX(1); float y = event.getY(0) - event.getY(1); return (float) Math.sqrt(x * x + y * y); } private static Rect calculateTapArea(float x, float y, float coefficient, int width, int height) { float focusAreaSize = 300; int areaSize = Float.valueOf(focusAreaSize * coefficient).intValue(); int centerX = (int) (x / width * 2000 - 1000); int centerY = (int) (y / height * 2000 - 1000); int halfAreaSize = areaSize / 2; RectF rectF = new RectF(LensEnginePreview.clamp(centerX - halfAreaSize, -1000, 1000), LensEnginePreview.clamp(centerY - halfAreaSize, -1000, 1000), LensEnginePreview.clamp(centerX + halfAreaSize, -1000, 1000), LensEnginePreview.clamp(centerY + halfAreaSize, -1000, 1000)); return new Rect(Math.round(rectF.left), Math.round(rectF.top), Math.round(rectF.right), Math.round(rectF.bottom)); } private static int clamp(int x, int min, int max) { if (x > max) { return max; } if (x < min) { return min; } return x; } }
[ "niechaopeng@huawei.com" ]
niechaopeng@huawei.com
3823339870ef491577305348282f72531257cdc4
fadfbc8894fbde6a92cd630cf7ae80678520a670
/app/src/main/java/com/testapp/krish/firstapp/Day3/User.java
01e0f8af2adf2fc052f94f24b09612dd2929607e
[]
no_license
anuvhab/AndroidCS473
ff84ab56f8dbbc2595a30e2757afd35d72a31329
3e1d3cc3dfc598ec551145b452e7737725b2c54c
refs/heads/master
2020-03-08T07:39:05.959599
2018-04-09T16:08:44
2018-04-09T16:08:44
127,999,713
0
0
null
null
null
null
UTF-8
Java
false
false
603
java
package com.testapp.krish.firstapp.Day3; public class User { private String firstName, lastName, eMail, password; public User(String firstName, String lastName, String eMail, String password) { this.firstName = firstName; this.lastName = lastName; this.eMail = eMail; this.password = password; } public String getFirstName() { return firstName; } public String getLastName() { return lastName; } public String geteMail() { return eMail; } public String getPassword() { return password; } }
[ "krishna.k.kc@gmail.com" ]
krishna.k.kc@gmail.com
24de8db036be30d267d101cc85aa7b249553b61a
014df7612f49a590c5927ddaff8eae529bf1f111
/src/com/wolfgames/framework/impl/AndroidGraphics.java
ea88f56a4af1d65538f018f312bdfe900139eb90
[]
no_license
vvolkov-dev/tutorial
f95f593b2bc655bc0e754bd95aa4c99fac27baee
91def5583ad1a5dbf9ad6ff0bca796bc4cffbd5e
refs/heads/master
2021-05-31T16:02:14.766114
2015-11-05T16:42:15
2015-11-05T16:42:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,709
java
package com.wolfgames.framework.impl; import java.io.IOException; import java.io.InputStream; import com.wolfgames.framework.Graphics; import com.wolfgames.framework.Pixmap; import android.content.res.AssetManager; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Rect; import android.graphics.Bitmap.Config; import android.graphics.BitmapFactory.Options; import android.graphics.Paint.Style; public class AndroidGraphics implements Graphics{ AssetManager assets; Bitmap frameBuffer; Canvas canvas; Paint paint; Rect sqrRect = new Rect(); Rect dstRect = new Rect(); public AndroidGraphics(AssetManager assets, Bitmap frameBuffer) { // TODO Auto-generated constructor stub this.assets = assets; this.frameBuffer = frameBuffer; this.canvas = new Canvas(frameBuffer); this.paint = new Paint(); } @Override public Pixmap newPixmap(String fileName, PixmapFormat format) { Config config = null; if (format == PixmapFormat.RGB565) config = Config.RGB_565; else if (format == PixmapFormat.ARGB4444) { config = Config.ARGB_4444; } else { config = Config.ARGB_8888; } Options options = new Options(); options.inPreferredConfig = config; InputStream in = null; Bitmap bitmap = null; try { in = assets.open(fileName); bitmap = BitmapFactory.decodeStream(in); if (bitmap == null) { throw new RuntimeException("Couldn't load bitmap from asset '" + fileName + "'"); } } catch (IOException e) { // TODO: handle exception throw new RuntimeException("Couldn't load bitmap from asset '" + fileName + "'"); } finally { if (in != null) { try { in.close(); } catch (IOException e2) { // TODO: handle exception } } } if (bitmap.getConfig() == Config.RGB_565) { format = PixmapFormat.RGB565; } else if (bitmap.getConfig() == Config.ARGB_4444) { format = PixmapFormat.ARGB4444; } else { format = PixmapFormat.ARGB8888; } return new AndroidPixmap(bitmap, format); } @Override public void clear(int color) { // TODO Auto-generated method stub canvas.drawRGB((color & 0xff0000) >> 16, (color & 0xff00) >>8, (color & 0xff)); } @Override public void drawPixel(int x, int y, int color) { paint.setColor(color); canvas.drawPoint(x, y, paint); } @Override public void drawLine(int x, int y, int x2, int y2, int color) { // TODO Auto-generated method stub paint.setColor(color); canvas.drawLine(x, y, x2, y2, paint); } @Override public void drawRect(int x, int y, int width, int height, int color) { // TODO Auto-generated method stub paint.setColor(color); paint.setStyle(Style.FILL); canvas.drawRect(x, y, x + width - 1, y + height - 1, paint); } @Override public void drawPixmap(Pixmap pixmap, int x, int y, int srcX, int srcY, int srcWidth, int srcHeight) { // TODO Auto-generated method stub sqrRect.left = srcX; sqrRect.top = srcY; sqrRect.right = srcX + srcWidth - 1; sqrRect.bottom = srcY + srcHeight - 1; dstRect.left = x; dstRect.top = y; dstRect.right = x + srcWidth - 1; dstRect.bottom = y + srcHeight - 1; canvas.drawBitmap(((AndroidPixmap) pixmap).bitmap, sqrRect, dstRect, paint); } @Override public void drawPixmap(Pixmap pixmap, int x, int y) { // TODO Auto-generated method stub canvas.drawBitmap(((AndroidPixmap) pixmap).bitmap, x, y, null); } @Override public int getWidth() { // TODO Auto-generated method stub return frameBuffer.getWidth(); } @Override public int getHeight() { // TODO Auto-generated method stub return frameBuffer.getHeight(); } }
[ "murdoc50@gmail.com" ]
murdoc50@gmail.com
1984fe4bfdeda9edb356a219ecc2aec01c8123a3
8467168a1c6e238070431d71363e4012f7741642
/src/main/java/org/primefaces/model/charts/optionconfig/elements/Elements.java
cdbaf30babcb37c7912ade17bf6ca2d0fba82d7f
[ "Apache-2.0" ]
permissive
vmmang/primefaces
d19d2497f73806abda53af0032f77abf5a3064b4
8da74386842343a4eb60ebb219e18b422553eec8
refs/heads/master
2020-04-01T18:07:16.918398
2018-10-19T10:28:49
2018-10-19T10:28:49
153,472,523
0
0
Apache-2.0
2018-10-22T09:47:53
2018-10-17T14:37:32
Java
UTF-8
Java
false
false
3,837
java
/** * Copyright 2009-2018 PrimeTek. * * 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.primefaces.model.charts.optionconfig.elements; import java.io.IOException; import java.io.Serializable; import org.primefaces.util.FastStringWriter; /** * Used to configure element option under chart options * While chart types provide settings to configure the styling of each dataset, * you sometimes want to style all datasets the same way. */ public class Elements implements Serializable { private ElementsPoint point; private ElementsLine line; private ElementsRectangle rectangle; private ElementsArc arc; /** * Gets the point * * @return point */ public ElementsPoint getPoint() { return point; } /** * Sets the point * * @param point the {@link ElementsPoint} object */ public void setPoint(ElementsPoint point) { this.point = point; } /** * Gets the line * * @return line */ public ElementsLine getLine() { return line; } /** * Sets the line * * @param line the {@link ElementsLine} object */ public void setLine(ElementsLine line) { this.line = line; } /** * Gets the rectangle * * @return rectangle */ public ElementsRectangle getRectangle() { return rectangle; } /** * Sets the rectangle * * @param rectangle the {@link ElementsRectangle} object */ public void setRectangle(ElementsRectangle rectangle) { this.rectangle = rectangle; } /** * Gets the arc * * @return arc */ public ElementsArc getArc() { return arc; } /** * Sets the arc * * @param arc the {@link ElementsArc} object */ public void setArc(ElementsArc arc) { this.arc = arc; } /** * Write the options of Elements * * @return options as JSON object * @throws java.io.IOException If an I/O error occurs */ public String encode() throws IOException { FastStringWriter fsw = new FastStringWriter(); boolean hasComma = false; String preString; try { if (this.point != null) { fsw.write("\"point\":{"); fsw.write(this.point.encode()); fsw.write("}"); hasComma = true; } if (this.line != null) { preString = hasComma ? "," : ""; fsw.write(preString + "\"line\":{"); fsw.write(this.line.encode()); fsw.write("}"); hasComma = true; } if (this.rectangle != null) { preString = hasComma ? "," : ""; fsw.write(preString + "\"rectangle\":{"); fsw.write(this.rectangle.encode()); fsw.write("}"); hasComma = true; } if (this.arc != null) { preString = hasComma ? "," : ""; fsw.write(preString + "\"arc\":{"); fsw.write(this.arc.encode()); fsw.write("}"); } } finally { fsw.close(); } return fsw.toString(); } }
[ "sincan.mert@gmail.com" ]
sincan.mert@gmail.com
eb3492b9cb1d7469c8b412ac78aed884030b2666
6f367ae346b8b433e5ab881e96b55018c5c22b13
/src/main/org/repastbs/xml/XMLSerializable.java
c94335f570632704d003f182a48d0be4318552ee
[]
no_license
blackaceatzworg/repastbs
e6447c6fd1f459dd24d7bd7703e32968d1c3b81f
d353621b4d9a31210fd8cb4d54a7039f31d9e538
refs/heads/master
2020-05-19T18:46:21.055952
2013-10-23T23:34:11
2013-10-23T23:34:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
779
java
/** * File: XMLSerializable.java * Program: Repast BS * Author: Ľudovít Hajzer, Zdenko Osina * Master's Thesis: System Repast * Supervisor: Ing. Ladislav Samuelis, CSc. * Consultant: László Gulyás, Ph.D. */ package org.repastbs.xml; import org.dom4j.Node; import org.xml.sax.ContentHandler; /** * XML Serializable represents clas that can be saved/loaded to XML file * @author Ľudovít Hajzer * */ public interface XMLSerializable { /** * Write to xml * @param handler * @throws XMLSerializationException */ public void writeToXML(ContentHandler handler) throws XMLSerializationException; /** * Load from xml * @param node * @throws XMLSerializationException */ public void createFromXML(Node node) throws XMLSerializationException; }
[ "zdeno.osina@gmail.com" ]
zdeno.osina@gmail.com
31dcdd9a3dda2ab0ab510b8447f499c17ac4b755
962f77f9aa7feb069a814f8fbc7caf0165f1c736
/src/main/java/net/porillo/ChatVariable.java
292976c3373b74ad4e409ac1c665aae279d3bce1
[]
no_license
nsporillo/ColoredGroups
2aae2b8294cd40572f7881e3192937fff2a2d0ff
5662d4c4493707829861d7b4569fc256a4d1c3af
refs/heads/master
2021-01-18T22:41:40.519922
2019-09-29T14:02:03
2019-09-29T14:02:03
6,397,776
1
1
null
null
null
null
UTF-8
Java
false
false
463
java
package net.porillo; import lombok.AllArgsConstructor; import lombok.Data; import org.bukkit.entity.Player; @Data @AllArgsConstructor class ChatVariable { private String root, replace, permission; ChatVariable(String root, String replace) { this(root, replace, "coloredgroups.variables." + root.replace("%", "")); } String run(Player player) { return player != null && player.hasPermission(permission) ? replace : ""; } }
[ "nsporillo@gmail.com" ]
nsporillo@gmail.com
537abb9a625efb477316e03e7dbc8a59bd1c160c
97f1ca22560bafb2421855a0009808d0735cb288
/wk03/src/d03ws02.java
6b8c0e71014de710c0b3f510eb2b36acfbb44ed0
[]
no_license
greenfox-zerda-raptors/bncbodrogi
588efd106b47c99a68dfeeffbe2eabc1ec2cf064
c5f2166222690cf7783e8b22777d8b2afbf5d09a
refs/heads/master
2021-01-12T18:15:12.653456
2017-02-17T08:54:31
2017-02-17T08:54:31
71,352,001
0
0
null
null
null
null
UTF-8
Java
false
false
382
java
public class d03ws02 { public static void main(String[] args) { int[] p1 = new int[] { 1, 2, 3 }; int[] p2 = new int[] {4, 5 }; // tell if p2 has more elements than p1 int l1 = p1.length; int l2 = p2.length; if (l1 > l2) { System.out.println(l1); }else { System.out.println(l2); } } }
[ "bncbodrogi@gmail.com" ]
bncbodrogi@gmail.com
b7fa51dc7d1ed336a4906e691603006c57e4a618
f10666ba6c1c5d04f7362b3ec79ed8c4df358c86
/platform/monitor/src/main/java/com/cola/platform/monitor/MonitorServerRunner.java
8342de5f55d3a5d9ada6fbafe02a6cfd682947a1
[ "Apache-2.0" ]
permissive
liuzuolin/cola
366c8d5bfb7db46b50fe67096e0ae162aa0093db
ed6af470d4879fd703996ef0c6b1d553af2b65dc
refs/heads/master
2020-03-30T05:50:23.207520
2018-09-28T09:22:24
2018-09-28T09:22:24
150,822,739
1
0
Apache-2.0
2018-09-29T03:56:51
2018-09-29T03:56:51
null
UTF-8
Java
false
false
1,509
java
/* * Copyright 2002-${Year} the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.cola.platform.monitor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.eureka.EnableEurekaClient; import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard; import org.springframework.cloud.netflix.turbine.EnableTurbine; /** * cola * Created by jiachen.shi on 6/16/2016. */ @SpringBootApplication @EnableEurekaClient @EnableHystrixDashboard @EnableTurbine public class MonitorServerRunner { private static Logger logger = LoggerFactory.getLogger(MonitorServerRunner.class); public static void main(String[] args) { SpringApplication app = new SpringApplication(MonitorServerRunner.class); //app.setShowBanner(false); app.run(args); } }
[ "jiachen.shi@accenture.com" ]
jiachen.shi@accenture.com
a5f1e815c5ce82c2a5ccef46f5d508e011226948
bb36d9d84564f52bd8408d6e877a55574ad65948
/Q1.java
3f725ef97b067ef4e92dc5821f4d500fda2f8211
[]
no_license
Mohamed-Razan/Hackerrank-Java
20e52bc98199d230a7b4287f4f92c5e8e10470d9
b0fe097527315fac63257f2aa210b2143b5ae0e8
refs/heads/master
2023-04-24T03:01:47.000207
2021-05-16T13:03:38
2021-05-16T13:03:38
367,032,721
1
0
null
null
null
null
UTF-8
Java
false
false
340
java
// Question: https://www.hackerrank.com/challenges/welcome-to-java/problem public class Solution { public static void main(String[] args) { /* Enter your code here. Print output to STDOUT. Your class should be named Solution. */ System.out.println("Hello, World."); System.out.println("Hello, Java."); } }
[ "mhdrazan7@gmail.com" ]
mhdrazan7@gmail.com
3b37e0be3797c220d9c1226b4c86893bedd3b9ed
55e5757d7a4eee6c4d27b08985f4b9171713b06d
/src/com/imooc/page/servlet/SublistServlet.java
3828c6669334fc72bf4a04d6af963a914382744f
[]
no_license
511733119/Paging
bd6e39751c660639a9cd04b5619b2a342c17b604
b329835e36593e510ae96371ecec71c81c2af0a7
refs/heads/master
2020-12-31T04:07:16.351513
2017-03-07T15:51:54
2017-03-07T15:51:54
69,638,757
1
1
null
null
null
null
GB18030
Java
false
false
2,264
java
package com.imooc.page.servlet; 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 com.imooc.page.dao.SublistStudentDaoImpl; import com.imooc.page.model.Pager; import com.imooc.page.model.Student; import com.imooc.page.server.Constant; import com.imooc.page.server.StudentService; import com.imooc.page.server.SublistStudentServiceImpl; public class SublistServlet extends HttpServlet { private static final long serialVersionUID = 1L; private StudentService studentService = new SublistStudentServiceImpl(); public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response); } public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { //接收request里的参数 //学生姓名 String stuName = request.getParameter("stuName"); //获取学生性别 int gender = Constant.DEFAULT_GENDER; String genderStr = request.getParameter("gender"); if(genderStr!=null && !"".equals(genderStr.trim())){ gender = Integer.parseInt(genderStr); } //显示第几页数据 int pageNum = Constant.DEFAULT_PAGE_NUM; String pageNumStr = request.getParameter("pageNum"); if(pageNumStr!=null && !"".equals(pageNumStr.trim())){ pageNum = Integer.parseInt(pageNumStr); } //每页显示多少条记录 int pageSize = Constant.DEFAULT_PAGE_SIZE; String pageSizeStr = request.getParameter("pageSize"); if(pageSizeStr!=null && !"".equals(pageSizeStr.trim())){ pageSize = Integer.parseInt(pageSizeStr); } //组装查询条件 Student searchModel = new Student(); searchModel.setStuName(stuName); searchModel.setGender(gender); //调用service获取查询结果 Pager<Student> result = studentService.findStudent(searchModel, pageNum, pageSize); //返回结果到页面 request.setAttribute("result", result); request.getRequestDispatcher("/sublistStudent.jsp").forward(request, response);; } }
[ "chjcal511733119@gmail.com" ]
chjcal511733119@gmail.com
d924721309651043e694e11acc8dda3f265edcd3
0806a7984f340fed66db1fca723ce79ede258d6e
/transfuse-bootstrap/src/main/java/org/androidtransfuse/bootstrap/Bootstraps.java
da4e361fb450a83a4bdecd8d387b0594ef5415c9
[ "Apache-2.0" ]
permissive
jschmid/transfuse
59322fbb22790afad799cff71b20b7f26858cb98
8856e059d972e023fb30d5bed5575423d5bc3a67
refs/heads/master
2021-01-21T00:05:20.613394
2013-07-14T22:15:59
2013-07-14T22:15:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,727
java
/** * Copyright 2013 John Ericksen * * 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.androidtransfuse.bootstrap; import org.androidtransfuse.scope.Scope; import org.androidtransfuse.scope.ScopeKey; import org.androidtransfuse.scope.Scopes; import org.androidtransfuse.util.GeneratedCodeRepository; import org.androidtransfuse.util.Providers; import java.lang.annotation.Annotation; import java.util.HashMap; import java.util.Map; /** * @author John Ericksen */ public final class Bootstraps { public static final String BOOTSTRAPS_INJECTOR_PACKAGE = "org.androidtransfuse.bootstrap"; public static final String BOOTSTRAPS_INJECTOR_NAME = "Bootstraps$Factory"; public static final String BOOTSTRAPS_INJECTOR_METHOD = "inject"; public static final String BOOTSTRAPS_INJECTOR_GET = "get"; public static final String IMPL_EXT = "$Bootstrap"; private static final GeneratedCodeRepository<BootstrapInjector> REPOSITORY = new GeneratedCodeRepository<BootstrapInjector>(BOOTSTRAPS_INJECTOR_PACKAGE, BOOTSTRAPS_INJECTOR_NAME) { @Override public BootstrapInjector findClass(Class clazz) { try { Class bootstrapClass = Class.forName(clazz.getName() + IMPL_EXT); return new BootstrapInjectorReflectionProxy(bootstrapClass); } catch (ClassNotFoundException e) { return null; } } }; private Bootstraps(){ //private utility constructor } @SuppressWarnings("unchecked") public static <T> void inject(T input){ REPOSITORY.get(input.getClass()).inject(input); } @SuppressWarnings("unchecked") public static <T> BootstrapInjector<T> getInjector(Class<T> clazz){ return REPOSITORY.get(clazz); } public interface BootstrapInjector<T>{ void inject(T input); <S> BootstrapInjector<T> add(Class<? extends Annotation> scope, Class<S> singletonClass, S singleton); } public abstract static class BootstrapsInjectorAdapter<T> implements BootstrapInjector<T>{ private final Map<Class<? extends Annotation> , Map<Class, Object>> scoped = new HashMap<Class<? extends Annotation> , Map<Class, Object>>(); public <S> BootstrapInjector<T> add(Class<? extends Annotation> scope, Class<S> bindType, S instance){ if(!scoped.containsKey(scope)){ scoped.put(scope, new HashMap<Class, Object>()); } scoped.get(scope).put(bindType, instance); return this; } protected void scopeSingletons(Scopes scopes){ for (Map.Entry<Class<? extends Annotation>, Map<Class, Object>> scopedEntry : scoped.entrySet()) { Scope scope = scopes.getScope(scopedEntry.getKey()); if(scope != null){ for (Map.Entry<Class, Object> scopingEntry : scopedEntry.getValue().entrySet()) { scope.getScopedObject(ScopeKey.of(scopingEntry.getKey()), Providers.of(scopingEntry.getValue())); } } } } } }
[ "johncarl81@gmail.com" ]
johncarl81@gmail.com
5f2591e394bc9110dfbf46b9714cf686517a3a91
175e7e6723533cbda44ebd066355b5148875aace
/core/src/main/java/org/projectfloodlight/db/data/IterableLeafListDataNode.java
12c27cc20b55b3c6ab5ab225187aadf98cdd93e6
[ "Apache-2.0" ]
permissive
kwanggithub/floodlight-floodlight
582a87623b3cad3909ef71ad92a2c52f66a6f0c9
48082ff4680768818ed3e83a776b04b5cd0f429d
refs/heads/master
2021-01-15T20:52:28.730025
2013-08-07T22:37:53
2013-08-07T22:37:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,357
java
package org.projectfloodlight.db.data; import java.util.Iterator; import org.projectfloodlight.db.schema.LeafListSchemaNode; import org.projectfloodlight.db.schema.SchemaNode; public class IterableLeafListDataNode extends AbstractLeafListDataNode { private LeafListSchemaNode leafListSchemaNode; private Iterable<?> iterable; private IterableLeafListDataNode(SchemaNode leafListSchemaNode, Iterable<?> iterable) { super(); assert leafListSchemaNode != null; assert leafListSchemaNode instanceof LeafListSchemaNode; assert iterable != null; this.leafListSchemaNode = (LeafListSchemaNode) leafListSchemaNode; this.iterable = iterable; } public static IterableLeafListDataNode from(SchemaNode leafListSchemaNode, Iterable<?> iterable) { return new IterableLeafListDataNode(leafListSchemaNode, iterable); } @Override public DigestValue computeDigestValue() { // Computing the digest values for logical data nodes would be // expensive so for now we just don't support it. // We'll see if it's needed. return null; } @Override public Iterator<DataNode> iterator() { return new DataNodeMappingIterator(iterable.iterator(), leafListSchemaNode.getLeafSchemaNode()); } }
[ "rob.adams@bigswitch.com" ]
rob.adams@bigswitch.com
817e7b45a57fe2f1fa2254bfa53781ded3784587
58e586ecdae559729dcc59ba2ecb084efa82b647
/src/epfl/project/faults/RedundantWorkers.java
55afeb8930e7313a581b47bd2426927e4b0f685e
[ "MIT" ]
permissive
ciolben/hydra-j
4620e4d8be50e768e6c25a4c0028e48ca6f0eb0d
c5b6043e313a242dbe0cb63b3d73531784da3477
refs/heads/master
2021-01-10T13:41:55.980729
2012-06-10T17:22:51
2012-06-10T17:22:51
55,334,634
0
0
null
null
null
null
UTF-8
Java
false
false
5,656
java
package epfl.project.faults; import epfl.project.common.AbstractDataCollectorSet; import epfl.project.common.OutOfMemory; import epfl.project.common.Tuple; import epfl.project.nodes.ThreadManager; import epfl.project.nodes.Worker; import epfl.project.scheduler.TaskDescription; import java.util.ArrayList; import java.util.Arrays; import java.util.concurrent.ConcurrentLinkedQueue; public class RedundantWorkers<K extends Comparable<K>, V, KR extends Comparable<KR>, VR> extends Thread { private final int WAIT_TIME = 500; final double PERCENT;//percentual of the result that have to be correct in order to accept the result final int RUN_JOB_TIMES; final int MIN_WORKERS_SAME_RESULT; private ConcurrentLinkedQueue<ArrayList<Worker<K, V, KR, VR>>> jobsWorkersList = new ConcurrentLinkedQueue<>(); private AbstractDataCollectorSet dataCollectorSet; private boolean stop = false; private boolean end = false; private final Object lock = new Object(); private TaskDescription taskDescription; public RedundantWorkers(TaskDescription<K, V, KR, VR> taskDescription, AbstractDataCollectorSet dataCollectorSet ) { Tuple<Integer, Double> t = taskDescription.getRedundantErrorDetector(); this.taskDescription = taskDescription; PERCENT = t.getValue(); RUN_JOB_TIMES =t.getKey(); MIN_WORKERS_SAME_RESULT = (int) Math.ceil(RUN_JOB_TIMES * PERCENT / 100); this.dataCollectorSet = dataCollectorSet; // this.setPriority(Thread.MIN_PRIORITY); } @Override public void run() { while (!stop || !jobsWorkersList.isEmpty()) { if (ThreadManager.isStop() || OutOfMemory.madeError()){ throw new Error("con't finish doing te job, the cause is mostly to be researched in another error"); } try { synchronized (lock) { if (!stop) {//if i'm waiting the end no reason to keep this thread waiting so much lock.wait(WAIT_TIME); } else { lock.wait(WAIT_TIME / 5); } } } catch (InterruptedException e) { e.printStackTrace(); } for (ArrayList<Worker<K, V, KR, VR>> job : jobsWorkersList) { //System.out.println(check(job)); check(job); } } //TODO stock somewhere these stats data before end synchronized (lock) { end = true; lock.notifyAll(); } } private boolean check(ArrayList<Worker<K, V, KR, VR>> jobWorkers) { ConcurrentLinkedQueue<Worker<K, V, KR, VR>> doneWorkers = new ConcurrentLinkedQueue<>(); //ArrayList <Worker<K, V,KR, VR>> doneWorkers = new ArrayList<>(); for (Worker<K, V, KR, VR> worker : jobWorkers) { if (worker.getRunnedTime() != null) { doneWorkers.add(worker); } } int size = doneWorkers.size(); if (size >= MIN_WORKERS_SAME_RESULT) { all: for (Worker<K, V, KR, VR> worker : doneWorkers) { int sameResult = 1;//because clearly it is equal to himself for (Worker<K, V, KR, VR> w : doneWorkers) { if (worker != w) { if (Arrays.equals(worker.getCollector().getHash(), w.getCollector().getHash())) { sameResult++; } if (sameResult >= MIN_WORKERS_SAME_RESULT) { dataCollectorSet.addCollector(worker.getCollector()); jobWorkers.remove(worker); doneWorkers.clear(); break all; } } } } if (size != 1 && !doneWorkers.isEmpty()) { if (taskDescription.stopOnRedundantError()) { throw new Error("Inconsistency Found in redundant computing"); } else { System.err.println("Inconsistency Found, will continue doing the job, but ONLY PARTIAL RESULT will be available at the end"); } } for (Worker<K, V, KR, VR> worker : jobWorkers) { ThreadManager.removeRunnable(worker); worker.killworker(); //I can do that because i've already removed a worker from the list: jobWorkers.remove(worker); worker.clearCollector();//useless already done in killworker } jobWorkers.clear(); jobsWorkersList.remove(jobWorkers); return true; } return false; } public void add(Worker<K, V, KR, VR> worker) { if (worker == null) { return; } ArrayList<Worker<K, V, KR, VR>> workers = null; if (taskDescription != null) { workers = worker.clone(RUN_JOB_TIMES, taskDescription); } if (workers == null) { return; } for (Worker<K, V, KR, VR> w : workers) { try { ThreadManager.addRunnable(w); } catch (InterruptedException e) { e.printStackTrace(); } } jobsWorkersList.add(workers); } public synchronized boolean end() throws InterruptedException { stop = true; synchronized (lock) { lock.notifyAll(); } if (!end) { this.join(); } return end; } }
[ "loic.barben@epfl.ch" ]
loic.barben@epfl.ch
7abd5c3715d3f74c7a09f0ecf8cad72f6cd639e1
3eb360b54c646b2bdf9239696ddd7ce8409ece8d
/lm_terminal/src/com/lauvan/resource/service/impl/LegalServiceImpl.java
e56a61586ffa07c9eecaf864e6305135c3484b93
[]
no_license
amoydream/workspace
46a8052230a1eeede2c51b5ed2ca9e4c3f8fc39e
72f0f1db3e4a63916634929210d0ab3512a69df5
refs/heads/master
2021-06-11T12:05:24.524282
2017-03-01T01:43:35
2017-03-01T01:43:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
356
java
package com.lauvan.resource.service.impl; import org.springframework.stereotype.Service; import com.lauvan.base.dao.BaseDAOSupport; import com.lauvan.resource.entity.R_Legal; import com.lauvan.resource.service.LegalService; @Service("legalService") public class LegalServiceImpl extends BaseDAOSupport<R_Legal> implements LegalService{ }
[ "jason.ss.tao@qq.com" ]
jason.ss.tao@qq.com
cb57d711a403f7e9c0be123c3e8d84f7b71590f7
1a759dd79a427c3ec541b3fedb120c1dc976e718
/src/test/java/fr/game/advent/day08/trial/GameTwoBisTest.java
5d89ff9c958f90a58c1ac0a51a2768c2fb8e2e8c
[]
no_license
mika44/advent-of-code-2018
1db2841817bad1a7374359e745aa8a8518abd6ad
fc2d30337744c5ecee8e8bb2c1e4eaa5ba911c0e
refs/heads/master
2020-04-09T07:54:57.368391
2018-12-10T06:07:40
2018-12-10T06:07:40
160,175,396
0
0
null
null
null
null
UTF-8
Java
false
false
450
java
package fr.game.advent.day08.trial; import java.util.Arrays; import org.junit.Assert; import org.junit.Test; public class GameTwoBisTest { private GameTwoBis gameTwoBis = new GameTwoBis(); @Test public void testExemple1() { Assert.assertEquals(new Integer(66), gameTwoBis.play(Arrays.asList("2 3 0 3 10 11 12 1 1 0 1 99 2 1 1 2"))); } @Test public void testGame() { Assert.assertEquals(new Integer(19276), gameTwoBis.play()); } }
[ "michaelgenet@192.168.0.14" ]
michaelgenet@192.168.0.14
3bf85d4c18ecfdab581c806e7760a1a4611edfd8
b89eb13a43cd9668393de0ee00366b160808234a
/app/src/main/java/com/aier/ardemo/http/basis/BaseSubscriber.java
ca7c144bc16298207b162bd79930b378b1b22470
[]
no_license
xiaohualaila/demo
c01b7387c2d3b036d8d9e8fb4782f7e7d1854b8e
2be2efcfdad53ac5cf903c72f85671b5ccb461e8
refs/heads/master
2020-05-16T17:12:59.793540
2019-05-05T11:26:05
2019-05-05T11:26:05
183,186,090
0
0
null
null
null
null
UTF-8
Java
false
false
1,504
java
package com.aier.ardemo.http.basis; import com.aier.ardemo.http.basis.callback.RequestCallback; import com.aier.ardemo.http.basis.callback.RequestMultiplyCallback; import com.aier.ardemo.holder.ToastHolder; import com.aier.ardemo.http.basis.config.HttpCode; import com.aier.ardemo.http.basis.exception.base.BaseException; import io.reactivex.observers.DisposableObserver; /** * 作者:leavesC * 时间:2018/10/27 20:52 * 描述: * GitHub:https://github.com/leavesC * Blog:https://www.jianshu.com/u/9df45b87cfdf */ public class BaseSubscriber<T> extends DisposableObserver<T> { private RequestCallback<T> requestCallback; BaseSubscriber(RequestCallback<T> requestCallback) { this.requestCallback = requestCallback; } @Override public void onNext(T t) { if (requestCallback != null) { requestCallback.onSuccess(t); } } @Override public void onError(Throwable e) { e.printStackTrace(); if (requestCallback instanceof RequestMultiplyCallback) { RequestMultiplyCallback callback = (RequestMultiplyCallback) requestCallback; if (e instanceof BaseException) { callback.onFail((BaseException) e); } else { callback.onFail(new BaseException(HttpCode.CODE_UNKNOWN, e.getMessage())); } } else { ToastHolder.showToast(e.getMessage()); } } @Override public void onComplete() { } }
[ "380129462@qq.com" ]
380129462@qq.com
7a544d3ff835b4feb360954b546b53fdf96bf81b
69311ed74923aaa73393289bbdbe2e00f10a0034
/src/main/java/com/mjj/travelling/service/Impl/TeamPostServiceImpl.java
d732dbb4da21080f8f0e921e374453b8903083af
[]
no_license
majj1995/HaiJiao_Backend
a1487a111e0f6d4e1d8dcd353369fd46bf28b17d
529bc466a3ecdc96feaaee254d0b92c03ecd1108
refs/heads/master
2020-04-20T15:16:03.482691
2019-02-03T08:17:37
2019-02-03T08:17:37
168,923,538
0
0
null
null
null
null
UTF-8
Java
false
false
2,408
java
package com.mjj.travelling.service.Impl; import com.mjj.travelling.dao.TeamPostRepository; import com.mjj.travelling.model.Post; import com.mjj.travelling.model.TeamPost; import com.mjj.travelling.model.User; import com.mjj.travelling.service.TeamPostService; import com.mjj.travelling.service.VO.TeamPostVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; import java.util.List; @Service public class TeamPostServiceImpl implements TeamPostService { @Autowired private TeamPostRepository teamPostRepository; @Autowired private TeamServiceImpl teamService; private final static Integer PAGE_SIZE = 10; @Override public TeamPost save(TeamPost teamPost) { return teamPostRepository.save(teamPost); } @Override public void delete(Integer teamPostId) { teamPostRepository.deleteById(teamPostId); } @Override public Page<TeamPost> load(Integer page) { return load(page, PAGE_SIZE); } @Override public Page<TeamPost> load(Integer page, Integer size) { if (page == null) { page = 0; } if (size == null || size == 0) { size = PAGE_SIZE; } Pageable pageable = PageRequest.of(page, size); Page<TeamPost> teamPosts = teamPostRepository.findAll(pageable); return teamPosts; } @Override public TeamPostVO loadByTeamPostId(Integer teamPostId) { TeamPost teamPost = teamPostRepository.findById(teamPostId).orElse(null); TeamPostVO teamPostVO = new TeamPostVO(); List<User> members = teamService.loadByTeamPostId(teamPostId); teamPostVO.setTeamPost(teamPost); teamPostVO.setMembers(members); return teamPostVO; } @Override public void incLikesNum(Integer teamPostId) { TeamPost teamPost = teamPostRepository.findById(teamPostId).orElse(null); teamPost.setLikes(teamPost.getLikes() + 1); save(teamPost); } @Override public void decLikesNum(Integer teamPostId) { TeamPost teamPost = teamPostRepository.findById(teamPostId).orElse(null); teamPost.setLikes(teamPost.getLikes() - 1); save(teamPost); } }
[ "595641927@qq.com" ]
595641927@qq.com
a697d90d5d12c88e343b044203e4d1f72e09068e
93c99ee9770362d2917c9494fd6b6036487e2ebd
/server/decompiled_apps/2b7122657dcb75ede8840eff964dd94a/com.bankeen.ui.addingbankaccount/h.java
5c62c113d2488fd59994d79056ac2fee97e30090
[]
no_license
YashJaveri/Satic-Analysis-Tool
e644328e50167af812cb2f073e34e6b32279b9ce
d6f3be7d35ded34c6eb0e38306aec0ec21434ee4
refs/heads/master
2023-05-03T14:29:23.611501
2019-06-24T09:01:23
2019-06-24T09:01:23
192,715,309
0
1
null
2023-04-21T20:52:07
2019-06-19T11:00:47
Smali
UTF-8
Java
false
false
821
java
package com.bankeen.ui.addingbankaccount; import android.content.Context; import com.bankeen.data.repository.ao; import dagger.a.c; import javax.inject.Provider; /* compiled from: AddingBankAccountManager_Factory */ public final class h implements c<g> { private final Provider<Context> a; private final Provider<ao> b; public h(Provider<Context> provider, Provider<ao> provider2) { this.a = provider; this.b = provider2; } /* renamed from: a */ public g b() { return a(this.a, this.b); } public static g a(Provider<Context> provider, Provider<ao> provider2) { return new g((Context) provider.b(), (ao) provider2.b()); } public static h b(Provider<Context> provider, Provider<ao> provider2) { return new h(provider, provider2); } }
[ "root@localhost.localdomain" ]
root@localhost.localdomain
ca21c625b01292f87f53dee5f2250ba548d71b3c
d5c52dbb0a72427608e2042825495a8f1747e036
/ExampleProject/src/main/java/com/application/example/logging/service/impl/LoggingManagerServiceImpl.java
8cdd1ad12073f88b08c03ab07e38b778f514a3c1
[]
no_license
PilouUnic/ExampleProject
f0858367577d85ba2ef3151db6d6805e2575e035
d1514cd914adedf5306fbdede158032e4e7746ff
refs/heads/master
2021-01-22T09:58:00.278967
2015-06-10T07:47:20
2015-06-10T07:47:20
24,961,276
0
0
null
null
null
null
UTF-8
Java
false
false
15,375
java
package com.application.example.logging.service.impl; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.List; import java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.apache.poi.hssf.usermodel.HSSFCellStyle; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.util.HSSFColor; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.Font; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; import com.application.example.logging.entity.LogRowElement; import com.application.example.logging.entity.LoggingException; import com.application.example.logging.service.LoggingManagerService; @Service public class LoggingManagerServiceImpl implements LoggingManagerService { static Logger logger = LoggerFactory.getLogger(LoggingManagerServiceImpl.class); private static final Charset DEFAULT_ENCODING = Charset.forName("ISO-8859-15"); private static final String regexForInfoLevel = "<[0-9]{4}-[0-9]{2}-[0-9]{2}\\s[0-9]{2}:[0-9]{2}:[0-9]{2}>\\s\\|\\s(I|E|W)\\s\\|"; /** * * @param deployedApplicationName * @return */ private List<LogRowElement> loadLogFile(final String deployedApplicationName) { StringBuilder sbLogFilePath = new StringBuilder(); sbLogFilePath.append("G:\\ACO\\TEST_LOG.log"); final File logFile = new File(sbLogFilePath.toString()); if(logFile == null || !logFile.exists()) { // TODO Exception } try { Scanner sc = new Scanner(logFile); String currentLine = null; try { while (sc.hasNextLine()) { currentLine = sc.nextLine(); System.out.println(currentLine); } } finally { if(sc != null) { sc.close(); } } } catch(IOException ex){ } return null; } /** * Initilise le style de l'en-tete. * @param workbook Objet Workbook representant le fichier Excel. * @Return Un objet de type CellStyle. */ private CellStyle headerCellStyleInitialisation(final Workbook workbook) { // Creation d'un nouveau style de cellule logger.trace("Creation of cellstyle for header line..."); final CellStyle headerCellStyle = workbook.createCellStyle(); // Valorisation de la bordure haute logger.trace("Initialisation of top border line..."); headerCellStyle.setBorderTop(CellStyle.BORDER_MEDIUM); // Valorisation de la bordure basse logger.trace("Initialisation of bottom border line..."); headerCellStyle.setBorderBottom(CellStyle.BORDER_MEDIUM); // Valorisation de la bordure de droite logger.trace("Initialisation of left border line..."); headerCellStyle.setBorderLeft(CellStyle.BORDER_MEDIUM); // Valorisation de la bordure de gauche logger.trace("Initialisation of right border line..."); headerCellStyle.setBorderRight(CellStyle.BORDER_MEDIUM); // Valorisation de l'alignement du contenu logger.trace("Initialisation cell content alignement..."); headerCellStyle.setAlignment(CellStyle.ALIGN_LEFT); // Valorisation de la couleur de fond logger.trace("Initialisation cell background color..."); headerCellStyle.setFillForegroundColor(HSSFColor.LIME.index); headerCellStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); return headerCellStyle; } /** * Initilise le style de l'en-tete. * @param workbook Objet Workbook representant le fichier Excel. * @Return Un objet de type CellStyle. */ private CellStyle contentCellStyleInitialisationForWarn(final Workbook workbook) { // Creation d'un nouveau style de cellule logger.trace("Creation of cellstyle for header line..."); final CellStyle contentCellStyle = workbook.createCellStyle(); final Font font = workbook.createFont(); // Valorisation de l'alignement du contenu logger.trace("Initialisation cell content alignement..."); contentCellStyle.setAlignment(CellStyle.ALIGN_LEFT); font.setColor(HSSFColor.ORANGE.index); contentCellStyle.setFont(font); return contentCellStyle; } /** * Initilise le style de l'en-tete. * @param workbook Objet Workbook representant le fichier Excel. * @Return Un objet de type CellStyle. */ private CellStyle contentCellStyleInitialisationForError(final Workbook workbook) { // Creation d'un nouveau style de cellule logger.trace("Creation of cellstyle for header line..."); final CellStyle contentCellStyle = workbook.createCellStyle(); final Font font = workbook.createFont(); // Valorisation de l'alignement du contenu logger.trace("Initialisation cell content alignement..."); contentCellStyle.setAlignment(CellStyle.ALIGN_LEFT); font.setColor(HSSFColor.RED.index); contentCellStyle.setFont(font); return contentCellStyle; } /** * Initilise le style de l'en-tete. * @param workbook Objet Workbook representant le fichier Excel. * @Return Un objet de type CellStyle. */ private CellStyle contentCellStyleInitialisationForInfo(final Workbook workbook) { // Creation d'un nouveau style de cellule logger.trace("Creation of cellstyle for header line..."); final CellStyle contentCellStyle = workbook.createCellStyle(); final Font font = workbook.createFont(); // Valorisation de l'alignement du contenu logger.trace("Initialisation cell content alignement..."); contentCellStyle.setAlignment(CellStyle.ALIGN_LEFT); font.setColor(HSSFColor.BLACK.index); contentCellStyle.setFont(font); return contentCellStyle; } /** * Permet d'ecrire le contenu d'un objet workbook dans un fichier Excel passe en parametre. * @param xlsResultFile Fichier de resultat de l'extraction. * @param workbook Objet Workbook de POI. * @throws ExtractionException */ private void writtingExcelFileContent(final File xlsResultFile, final Workbook workbook) throws LoggingException { OutputStream xlsOutput = null; try { try { xlsOutput = new FileOutputStream(xlsResultFile); if (xlsOutput != null) { workbook.write(xlsOutput); } } finally { if (xlsOutput != null) { xlsOutput.close(); } } } catch (final IOException ex) { throw new LoggingException(); } } /** * Methode de construction de la ligne d'en-tete a partir des objets resultant du parsing CSV. * @param csvElement List d'objet RowElement representant le contenu des divers CSV parcourus. * @param workbook Objet Workbook. * @throws ExtractionException */ private void buildHeaderRow(final Workbook workbook, final Sheet sheet) throws LoggingException { // Creation d'une premiere ligne d'en-tete logger.debug("Creation first row header"); final Row headerRow = sheet.createRow(0); // Mise en forme des bordures de l'en-tete logger.debug("Initialisation of header style"); logger.trace("Calling 'headerCellStyleInitialisation' method"); final CellStyle headerCellStyle = headerCellStyleInitialisation(workbook); Cell cell = null; final String dateLabel = "DATE"; final String critivityLabel = "CRITICITY"; final String messageLabel = "MESSAGE"; logger.debug("Creating cell in header with value: {} ", dateLabel); cell = headerRow.createCell(0); cell.setCellValue(new String(dateLabel.getBytes(DEFAULT_ENCODING), DEFAULT_ENCODING)); logger.trace("Creating cell style for cell with value: {} ", dateLabel); cell.setCellStyle(headerCellStyle); logger.debug("Creating cell in header with value: {} ", critivityLabel); cell = headerRow.createCell(1); cell.setCellValue(new String(critivityLabel.getBytes(DEFAULT_ENCODING), DEFAULT_ENCODING)); logger.trace("Creating cell style for cell with value: {} ", critivityLabel); cell.setCellStyle(headerCellStyle); logger.debug("Creating cell in header with value: {} ", messageLabel); cell = headerRow.createCell(2); cell.setCellValue(new String(messageLabel.getBytes(DEFAULT_ENCODING), DEFAULT_ENCODING)); logger.trace("Creating cell style for cell with value: {} ", messageLabel); cell.setCellStyle(headerCellStyle); } /** * Methode de construction du contenu du fichier XLS. * @param csvElement List d'objet RowElement representant le contenu des divers CSV parcourus. * @param workbook Objet Workbook. * @throws ExtractionException */ private void buildContentRow(final List<LogRowElement> logRowElement, final Workbook workbook, final Sheet sheet) throws LoggingException { logger.debug("Building content os XLS file"); // Recuperation des elements non HEADER logger.debug("Recovering all content lines"); int rowIndex = 1; final CellStyle contentCellStyleforInfo = contentCellStyleInitialisationForInfo(workbook); final CellStyle contentCellStyleforWarn = contentCellStyleInitialisationForWarn(workbook); final CellStyle contentCellStyleforError = contentCellStyleInitialisationForError(workbook); Cell cell = null; for (final LogRowElement element : logRowElement) { // Creation d'une premiere ligne d'en-tete logger.debug("Creation first row header"); final Row contentRow = sheet.createRow(rowIndex); if("E".equals(element.getCriticity())) { // Valorisation de la cellule logger.debug("Populating cell with value: {}", element.getDate()); cell = contentRow.createCell(0); cell.setCellValue(element.getDate()); cell.setCellStyle(contentCellStyleforError); // Valorisation de la cellule logger.debug("Populating cell with value: {}", element.getCriticity()); cell = contentRow.createCell(1); cell.setCellValue("ERROR"); cell.setCellStyle(contentCellStyleforError); // Valorisation de la cellule logger.debug("Populating cell with value: {}", element.getMessage()); cell = contentRow.createCell(2); cell.setCellValue(element.getMessage()); cell.setCellStyle(contentCellStyleforError); } else if("I".equals(element.getCriticity())) { // Valorisation de la cellule logger.debug("Populating cell with value: {}", element.getDate()); cell = contentRow.createCell(0); cell.setCellValue(element.getDate()); cell.setCellStyle(contentCellStyleforInfo); // Valorisation de la cellule logger.debug("Populating cell with value: {}", element.getCriticity()); cell = contentRow.createCell(1); cell.setCellValue("INFORMATION"); cell.setCellStyle(contentCellStyleforInfo); // Valorisation de la cellule logger.debug("Populating cell with value: {}", element.getMessage()); cell = contentRow.createCell(2); cell.setCellValue(element.getMessage()); cell.setCellStyle(contentCellStyleforInfo); } else if("W".equals(element.getCriticity())) { // Valorisation de la cellule logger.debug("Populating cell with value: {}", element.getDate()); cell = contentRow.createCell(0); cell.setCellValue(element.getDate()); cell.setCellStyle(contentCellStyleforWarn); // Valorisation de la cellule logger.debug("Populating cell with value: {}", element.getCriticity()); cell = contentRow.createCell(1); cell.setCellValue("WARNING"); cell.setCellStyle(contentCellStyleforWarn); // Valorisation de la cellule logger.debug("Populating cell with value: {}", element.getMessage()); cell = contentRow.createCell(2); cell.setCellValue(element.getMessage()); cell.setCellStyle(contentCellStyleforWarn); } rowIndex++; } // Ajustement de la largeur des colonnes. logger.trace("Ajusting columns width..."); final Row row = sheet.getRow(0); for (int colNum = 0; colNum < row.getLastCellNum(); colNum++) { workbook.getSheetAt(0).autoSizeColumn(colNum); } } private void generateXlsResultFile(final File resultFile, final List<LogRowElement> logRowElement) throws LoggingException { Workbook workbook = null; try { // Suppression du fichier si il existe deja if (resultFile.exists()) { resultFile.delete(); } resultFile.createNewFile(); // Creation du Workbook necessaire pour la generation du fichier // de resultat Excel. logger.debug("Creation of Workbook object"); workbook = new HSSFWorkbook(); } catch (final IOException ex) { throw new LoggingException(); } // Creation d'une feuille de calcul logger.debug("Creation sheet object from workbook"); final Sheet sheet = workbook.createSheet(); // Construction de la ligne d'en-tete logger.trace("Calling 'buildHeaderRow' method"); buildHeaderRow(workbook, sheet); // Construction du contenu logger.trace("Calling 'buildContentRow' method"); buildContentRow(logRowElement, workbook, sheet); // Ecriture du fichier logger.trace("Calling 'write' method"); writtingExcelFileContent(resultFile, workbook); } @Override public File generateExcelLogFile(final File initialLogFile) throws LoggingException { File excelLogFile = new File("C:\\DEV\\DATA\\LOG\\TEST_LOG.xls"); StringBuilder sbLogFilePath = new StringBuilder(); sbLogFilePath.append("C:\\DEV\\DATA\\LOG\\TEST_LOG.log"); Pattern pattern = Pattern.compile(regexForInfoLevel); Matcher matcher = null; final File logFile = new File(sbLogFilePath.toString()); if(logFile == null || !logFile.exists()) { // TODO Exception } String currentDate; String currentCriticity; String currentMessage; String[] splittedCurrentLine; LogRowElement logRowElement = null; List<LogRowElement> result = new ArrayList<LogRowElement>(); try { String currentLine = null; InputStream ips = new FileInputStream(logFile); InputStreamReader ipsr = new InputStreamReader(ips); BufferedReader br = new BufferedReader(ipsr); try { while ((currentLine = br.readLine()) != null){ matcher = pattern.matcher(currentLine); if(matcher.find()) { splittedCurrentLine = currentLine.split("\\|"); currentDate = splittedCurrentLine[0].trim(); currentCriticity = splittedCurrentLine[1].trim(); currentMessage = splittedCurrentLine[2].trim(); System.out.println(currentLine); System.out.println(" - " + currentDate); System.out.println(" - " + currentCriticity); System.out.println(" - " + currentMessage); logRowElement = new LogRowElement(currentDate, currentCriticity, currentMessage); result.add(logRowElement); } } } finally { if(br != null) { br.close(); } if(ipsr != null) { ipsr.close(); } if(ips != null) { ips.close(); } } } catch(IOException ex){ } generateXlsResultFile(excelLogFile, result); logger.info("End of convertion"); return excelLogFile; } }
[ "cortial_aurelien@hotmail.com" ]
cortial_aurelien@hotmail.com
996f1924d3855835a5ffae654196e4b4d8f51203
d528fe4f3aa3a7eca7c5ba4e0aee43421e60857f
/src/xsgzgl/wjcf/general/GlobalsValue.java
0863d14fbd0be9d202666fc140273beae869f015
[]
no_license
gxlioper/xajd
81bd19a7c4b9f2d1a41a23295497b6de0dae4169
b7d4237acf7d6ffeca1c4a5a6717594ca55f1673
refs/heads/master
2022-03-06T15:49:34.004924
2019-11-19T07:43:25
2019-11-19T07:43:25
null
0
0
null
null
null
null
GB18030
Java
false
false
641
java
package xsgzgl.wjcf.general; import xgxt.action.Base; public class GlobalsValue { public static String xxpymc;// 学校拼音名称 public static String[] xxdmValue = new String[] {};// 学校代码 public static String[] xxmcValue = new String[] {};// 学校 // ###########################end##################################### public static String getXxpymc(String xxdm) { for (int i = 0; i < xxdmValue.length; i++) { if (xxdm.equalsIgnoreCase(xxdmValue[i])) { xxpymc = xxmcValue[i]; break; } } if (Base.isNull(xxpymc)) { xxpymc = "general"; } return xxpymc; } }
[ "1398796456@qq.com" ]
1398796456@qq.com
2029eeb4ede6f32e5ffbb37c924481db7dbc667f
5039317afe0b5d6e901ddc7e465af488597db42b
/WEB-INF/src/com/skymiracle/wpx/models/WpxMdo_X.java
c4438f452f9a0e6ae94f3058bddcf57979b5b636
[]
no_license
neorayer/wpx
774b7f05c84a293d099db05033817a03e0cbbe7c
8d34e9e74a79aea776d2ea9bfde7754ba416fbca
refs/heads/master
2021-01-10T07:05:53.087756
2016-02-24T04:49:30
2016-02-24T04:49:30
52,413,781
1
0
null
null
null
null
UTF-8
Java
false
false
264
java
package com.skymiracle.wpx.models; import static com.skymiracle.wpx.Singletons.*; import com.skymiracle.mdo5.Mdo_X; public abstract class WpxMdo_X<T extends WpxMdo<T>> extends Mdo_X<T>{ public WpxMdo_X(Class<T> mdoClass) { super(mdoClass, appStore); } }
[ "neorayer@gmail.com" ]
neorayer@gmail.com
2c7cc28ced722940a63f5e0003a56e0ecffea974
fe83da963d2eeaf3f4fe2a5c1db6438b42f1d5cd
/com.bitcoin.dy.2.0.0/src/com/mvc/controller/PayController.java
d562840c6d1e009151479a1cd16fd1cc71c9d626
[]
no_license
fantianmi/coins.new
36804da687e816f2b12faa705b71ae699c5d688d
baae38d04dd2c16617e79d6418474fadbdb3824b
refs/heads/master
2020-05-31T21:43:44.618516
2014-10-09T16:28:44
2014-10-09T16:28:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,050
java
package com.mvc.controller; import java.io.IOException; import java.math.BigDecimal; import java.util.ResourceBundle; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; import com.mvc.entity.Btc_profit; import com.mvc.entity.Btc_rechargeCNY_order; import com.mvc.entity.Btc_user; import com.mvc.service.ProfitService; import com.mvc.service.RechargeService; import com.mvc.util.DataUtil; import com.mvc.util.MD5Util; import com.mvc.vo.pay.Yeepay; import com.mvc.vo.pay.Zhifu; @Controller @RequestMapping("/pay.do") public class PayController { @Autowired private RechargeService rs = new RechargeService(); @Autowired private ProfitService profitService = new ProfitService(); @Autowired private MD5Util md5util; @Autowired private DataUtil datautil; ResourceBundle payres = ResourceBundle.getBundle("zhifu"); ResourceBundle msgres = ResourceBundle.getBundle("msg"); protected final transient Log log = LogFactory .getLog(RechargeController.class); @RequestMapping public String load(ModelMap modelMap, HttpServletRequest request) { return "index"; } @RequestMapping(params = "CNY") public String rechargeCNY (ModelMap modelMap, HttpServletRequest request,HttpServletResponse response) throws IOException { HttpSession session = request.getSession(); String code = (String) session .getAttribute(com.google.code.kaptcha.Constants.KAPTCHA_SESSION_KEY); if (session.getAttribute("globaluser") == null) { request.setAttribute("msg", "登陆后才能进行此操作!"); request.setAttribute("href", "index.do?recharge2bank"); return "redirect"; } Btc_user user = (Btc_user)session.getAttribute("globaluser"); if (user.getUstatus().equals("frozen")) { request.setAttribute("msg", "您的账户已被冻结,无法进行任何操作,请尽快联系客服人员解冻"); request.setAttribute("href", "index.do?recharge2bank"); return "redirect"; } if (!user.getUstatus().equals("active")) { request.setAttribute("msg", "您的账户未激活,请查看您的注册邮箱点击链接激活,或者联系客服进行人工激活"); request.setAttribute("href", "index.do?userdetail"); return "redirect"; } Btc_profit btc_profit = profitService.getConfig(); BigDecimal bro_recharge_acount = new BigDecimal(request.getParameter("order_amount").toString()); BigDecimal rechargeCNY_limit = btc_profit.getBtc_profit_rechargeCNY_limit(); if (bro_recharge_acount.compareTo(rechargeCNY_limit) == -1) { request.setAttribute("msg", "充值金额少于最低限制,系统不予受理,请重新输入"); request.setAttribute("href", "index.do?recharge2bank"); return "redirect"; } //以前充值功能参数 String bro_recharge_way = request.getParameter("bro_recharge_way"); //save order String bro_recharge_time=datautil.getTimeNow("second"); BigDecimal bro_factorage = bro_recharge_acount.multiply(btc_profit.getBtc_profit_rechargeCNY_poundage()); bro_factorage.setScale(2, BigDecimal.ROUND_HALF_UP); String billNo= String.valueOf(System.currentTimeMillis()); Btc_rechargeCNY_order bro = new Btc_rechargeCNY_order(); bro.setBro_recharge_acount(bro_recharge_acount); bro.setBro_recharge_time(bro_recharge_time); bro.setBro_sname(user.getUname()); bro.setBro_rname(payres.getString("payway")); bro.setBro_recharge_way(bro_recharge_way); bro.setUid(user.getUid()); bro.setBro_remark("等待支付"); bro.setBro_factorage(bro_factorage); bro.setBillNo(billNo); rs.rechargeCNY(bro); Zhifu zhifu = new Zhifu(bro_recharge_acount, billNo); request.setAttribute("zhifu", zhifu); return "gotopay4"+payres.getString("payway")+""; } }
[ "fantianmi@163.com" ]
fantianmi@163.com
c84146119223b8f088d3db5cc2acbd0afbbf6d8b
bb97256378f8b107c8fcf27c9593a833dbff65e5
/src/ncs/test15/Book.java
68d66e629553b50933c5bb2b19fef3a3013bd658
[]
no_license
jazzhong1/javaTest3
652e2e6ad7803fc84100e751217db6443aac8fe9
a3a8b0d54728e3eb734d94a59cd3ae354fa7069c
refs/heads/master
2021-04-15T11:49:36.010800
2018-04-05T23:39:34
2018-04-05T23:39:34
126,347,155
0
0
null
null
null
null
UTF-8
Java
false
false
1,282
java
package ncs.test15; public class Book { private String title; private String author; private int price; private String publisher; private double discountRate; public Book() { // TODO Auto-generated constructor stub } public Book(String title,String author,int price, String publisher,double discountRate) { this.title=title; this.author=author; this.price=price; this.publisher=publisher; this.discountRate=discountRate; } @Override public String toString() { String result=this.getTitle()+","+this.getAuthor()+","+this.getPrice()+","+this.getPublisher()+","+(int)(this.getDiscountRate()*100)+" %할인"; return result; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getAuthor() { return author; } public void setAuthor(String author) { this.author = author; } public int getPrice() { return price; } public void setPrice(int price) { this.price = price; } public String getPublisher() { return publisher; } public void setPublisher(String publisher) { this.publisher = publisher; } public double getDiscountRate() { return discountRate; } public void setDiscountRate(double discountRate) { this.discountRate = discountRate; } }
[ "jazzhong1@naver.com" ]
jazzhong1@naver.com
4d6dbe43548d9477582090f55aa093d7c8d9a9ca
48cbc2c384d0f279bbe6713fbdee6167c0cb64be
/app/src/main/java/net/bndy/ad/service/DbHelper.java
cc899478ccaed158e1f7f0bdbca514a27285a803
[ "MIT" ]
permissive
bndynet/android-starter
1d6257aead017c1b2fe38048432239ff8a12423b
30e0894121f1adb713e49a9c56696d6cc391e3b3
refs/heads/master
2020-03-30T04:13:36.671235
2019-03-31T02:31:41
2019-03-31T02:31:41
150,730,972
0
2
null
null
null
null
UTF-8
Java
false
false
340
java
package net.bndy.ad.service; import android.content.Context; import net.bndy.ad.framework.data.SQLiteForEntityProvider; public class DbHelper extends SQLiteForEntityProvider { private static final String DB_NAME = "LOG"; public DbHelper(Context context, Class<?>... clazzes) { super(context, DB_NAME, clazzes); } }
[ "zb@bndy.net" ]
zb@bndy.net
2c22f3bd36ad6b6223d47b33aa734fec51e54548
942c5021817d284f47382433eee4a5c24ca781bf
/extensions/cli/landsat8/src/test/java/mil/nga/giat/geowave/format/landsat8/SceneFeatureIteratorTest.java
ada98c55667bfd5b6ba9ccc4b2c9218e0001d02f
[ "Apache-2.0", "LicenseRef-scancode-free-unknown", "LicenseRef-scancode-public-domain" ]
permissive
rfecher/geowave
9e41c93ec474db7b3c32e75ebb7c30f6f1f19c1a
b5dfb64abb6efdcdc75f46222ffd2d4c3f7d64a5
refs/heads/master
2022-06-28T02:03:32.509352
2017-02-15T17:56:32
2017-02-15T17:56:32
39,567,101
0
2
Apache-2.0
2018-07-23T12:23:08
2015-07-23T12:50:18
Java
UTF-8
Java
false
false
2,920
java
package mil.nga.giat.geowave.format.landsat8; import static org.junit.Assert.*; import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.geotools.filter.text.cql2.CQL; import org.geotools.filter.text.cql2.CQLException; import org.geotools.geometry.DirectPosition2D; import org.geotools.geometry.Envelope2D; import org.junit.Test; import org.opengis.feature.simple.SimpleFeature; import org.opengis.filter.Filter; import org.opengis.geometry.BoundingBox; import org.hamcrest.BaseMatcher; import org.hamcrest.Description; import org.hamcrest.Matcher; import static org.hamcrest.core.Every.everyItem; import static org.hamcrest.core.AllOf.allOf; public class SceneFeatureIteratorTest { private Matcher<SimpleFeature> hasProperties() { return new BaseMatcher<SimpleFeature>() { @Override public boolean matches( Object item ) { SimpleFeature feature = (SimpleFeature) item; return feature.getProperty("entityId") != null && feature.getProperty("acquisitionDate") != null && feature.getProperty("cloudCover") != null && feature.getProperty("processingLevel") != null && feature.getProperty("path") != null && feature.getProperty("row") != null && feature.getProperty("sceneDownloadUrl") != null; } @Override public void describeTo( Description description ) { description .appendText("feature should have properties {entityId, acquisitionDate, cloudCover, processingLevel, path, row, sceneDownloadUrl}"); } }; } private Matcher<SimpleFeature> inBounds( BoundingBox bounds ) { return new BaseMatcher<SimpleFeature>() { @Override public boolean matches( Object item ) { SimpleFeature feature = (SimpleFeature) item; return feature.getBounds().intersects( bounds); } @Override public void describeTo( Description description ) { description.appendText("feature should be in bounds " + bounds); } }; } @Test public void testIterate() throws IOException, CQLException { boolean onlyScenesSinceLastRun = false; boolean useCachedScenes = true; boolean nBestScenesByPathRow = false; int nBestScenes = 1; Filter cqlFilter = CQL.toFilter("BBOX(shape,-76.6,42.34,-76.4,42.54) and band='BQA'"); String workspaceDir = Tests.WORKSPACE_DIR; List<SimpleFeature> features = new ArrayList<>(); try (SceneFeatureIterator iterator = new SceneFeatureIterator( onlyScenesSinceLastRun, useCachedScenes, nBestScenesByPathRow, nBestScenes, cqlFilter, workspaceDir)) { while (iterator.hasNext()) { features.add(iterator.next()); } } assertEquals( features.size(), 1); assertThat( features, everyItem(allOf( hasProperties(), inBounds(new Envelope2D( new DirectPosition2D( -76.6, 42.34), new DirectPosition2D( -76.4, 42.54)))))); } }
[ "rfecher@gmail.com" ]
rfecher@gmail.com
138bb0cee1b198c9d4f4af28797d409a7287a0e6
b55fff51aba2f734f5b12d17bb947fe0f835ac4e
/org/w3c/css/atrules/css3/media/MediaResolution.java
3f23c6553c06195888c3c704ce3526d8eae7abf0
[ "W3C-20150513", "W3C" ]
permissive
Handig-Eekhoorn/css-validator
ca27249b95b76d013702d9470581370ce7778bcb
f6841dadfe5ca98c891d239a3d481347bdb34502
refs/heads/heek-master
2023-03-23T02:54:33.121767
2020-01-07T22:00:37
2020-01-07T22:00:37
215,892,548
1
0
NOASSERTION
2022-06-07T14:46:11
2019-10-17T21:58:07
Java
UTF-8
Java
false
false
5,088
java
// $Id$ // // (c) COPYRIGHT MIT, ECRIM and Keio University, 2011 // Please first read the full copyright statement in file COPYRIGHT.html package org.w3c.css.atrules.css3.media; import org.w3c.css.atrules.css.media.MediaFeature; import org.w3c.css.atrules.css.media.MediaRangeFeature; import org.w3c.css.util.ApplContext; import org.w3c.css.util.InvalidParamException; import org.w3c.css.values.CssComparator; import org.w3c.css.values.CssExpression; import org.w3c.css.values.CssResolution; import org.w3c.css.values.CssTypes; import org.w3c.css.values.CssValue; /** * @spec https://www.w3.org/TR/2017/CR-mediaqueries-4-20170905/#descdef-media-resolution */ public class MediaResolution extends MediaRangeFeature { /** * Create a new MediaResolution */ public MediaResolution() { } /** * Create a new MediaResolution * * @param expression The expression for this media feature * @throws org.w3c.css.util.InvalidParamException * Values are incorrect */ public MediaResolution(ApplContext ac, String modifier, CssExpression expression, boolean check) throws InvalidParamException { if (expression != null) { if (expression.getCount() > 2) { throw new InvalidParamException("unrecognize", ac); } if (expression.getCount() == 0) { throw new InvalidParamException("few-value", getFeatureName(), ac); } CssValue val = expression.getValue(); // it must be a >=0 integer only switch (val.getType()) { case CssTypes.CSS_COMPARATOR: if (modifier != null) { throw new InvalidParamException("nomodifierrangemedia", getFeatureName(), ac); } CssComparator p = (CssComparator) val; value = checkValue(ac, p.getParameters(), getFeatureName()); comparator = p.toString(); expression.next(); if (!expression.end()) { val = expression.getValue(); if (val.getType() != CssTypes.CSS_COMPARATOR) { throw new InvalidParamException("unrecognize", ac); } CssComparator p2; p2 = (CssComparator) val; otherValue = checkValue(ac, p2.getParameters(), getFeatureName()); otherComparator = p2.toString(); checkComparators(ac, p, p2, getFeatureName()); } break; case CssTypes.CSS_RESOLUTION: value = checkValue(ac, expression, getFeatureName()); break; default: throw new InvalidParamException("unrecognize", ac); } expression.next(); setModifier(ac, modifier); } else { if (modifier != null) { throw new InvalidParamException("nomodifiershortmedia", getFeatureName(), ac); } } } static CssValue checkValue(ApplContext ac, CssExpression expression, String caller) throws InvalidParamException { if (expression.getCount() == 0) { throw new InvalidParamException("few-value", caller, ac); } CssValue val = expression.getValue(); CssValue value = null; // it must be a >=0 integer only if (val.getType() == CssTypes.CSS_RESOLUTION) { CssResolution valnum = (CssResolution) val; if (valnum.getFloatValue() < 0.f) { throw new InvalidParamException("negative-value", val.toString(), ac); } value = valnum; } else { throw new InvalidParamException("unrecognize", ac); } return value; } public MediaResolution(ApplContext ac, String modifier, CssExpression expression) throws InvalidParamException { this(ac, modifier, expression, false); } /** * Returns the value of this media feature. */ public Object get() { return value; } /** * Returns the name of this media feature. */ public final String getFeatureName() { return "resolution"; } /** * Compares two media features for equality. * * @param other The other media features. */ public boolean equals(MediaFeature other) { try { MediaResolution mr = (MediaResolution) other; return (((value == null) && (mr.value == null)) || ((value != null) && value.equals(mr.value))) && (((modifier == null) && (mr.modifier == null)) || ((modifier != null) && modifier.equals(mr.modifier))); } catch (ClassCastException cce) { return false; } } }
[ "ylafon@w3.org" ]
ylafon@w3.org
95587993145c0d5ddae706325fdc467cf70044ff
77a4aeaf5126a36fc50edae128571a1638866ffa
/sample/src/main/java/codetoart/sampleanimations/LoadingButtonActivity.java
f91e2d08a2dd72dd918d490111603da3e895fc8e
[]
no_license
codetoart/C2AAnimations
5ead8b83fe3925aeb308500420dda2840f3e6032
37fb0482e33d79eb3618b7396b97b930352064bc
refs/heads/master
2021-01-23T08:00:02.109986
2017-03-07T14:02:30
2017-03-07T14:02:30
80,525,947
0
0
null
null
null
null
UTF-8
Java
false
false
3,012
java
package codetoart.sampleanimations; import android.os.Bundle; import android.os.Handler; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.MenuItem; import android.view.View; import android.widget.EditText; import android.widget.LinearLayout; import android.widget.TextView; import com.android.codetoart.c2aanimations.widget.C2AAnimationLoadingButton; public class LoadingButtonActivity extends AppCompatActivity { private EditText mEditUsername, mEditPassword; private C2AAnimationLoadingButton mButton; private LinearLayout mRootLayout; private Toolbar mToolbar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_loading_button); initView(); } private void initView() { mToolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(mToolbar); TextView toolbarTitle = (TextView) mToolbar.findViewById(R.id.toolbar_title); toolbarTitle.setText("Loading Button"); getSupportActionBar().setTitle(""); getSupportActionBar().setDisplayHomeAsUpEnabled(true); mEditUsername = (EditText) findViewById(R.id.edit_username); mEditPassword = (EditText) findViewById(R.id.edit_password); mRootLayout = (LinearLayout) findViewById(R.id.activity_loading_button); mButton = (C2AAnimationLoadingButton) findViewById(R.id.button_login); mButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mButton.startLoading(); new Handler().postDelayed(new Runnable() { @Override public void run() { String username = mEditUsername.getText().toString(); String password = mEditPassword.getText().toString(); if (isValid(username, password)) { mButton.loadingSuccess(new C2AAnimationLoadingButton.AnimationSuccess() { @Override public void success() { finish(); } }); } else mButton.loadingFail(); } }, 5000); } }); } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: onBackPressed(); return true; default: return super.onOptionsItemSelected(item); } } private boolean isValid(String username, String password) { if (username.trim().equals("admin") && password.trim().equals("admin")) { return true; } return false; } }
[ "sameerkhader018@gmail.com" ]
sameerkhader018@gmail.com
5fa0e8ae2fb0bc611f0200eb41669407457ff26b
d767ecbb2bad9bb0358b2931097ed9164a92ec13
/src/test/java/com/invillia/acme/provider/service/ProviderServiceTest.java
b8ac5fcafe6e0df4cd305188c52e9c0fa2aab8ff
[]
no_license
caiogallo/backend-challange
90b33ab8e639dfd7aec00ec9b3e12400a999bb10
ecdd621a6ce3820730d64b62dcda1f8303e87b35
refs/heads/master
2020-04-08T08:46:46.706669
2018-11-28T20:44:40
2018-11-28T20:44:40
159,193,601
1
1
null
2018-11-26T15:45:44
2018-11-26T15:45:43
null
UTF-8
Java
false
false
3,843
java
package com.invillia.acme.provider.service; import br.com.six2six.fixturefactory.Fixture; import br.com.six2six.fixturefactory.loader.FixtureFactoryLoader; import com.invillia.acme.address.model.Address; import com.invillia.acme.address.model.service.AddressSearchRequest; import com.invillia.acme.provider.controller.v1.request.ProviderRequest; import com.invillia.acme.provider.model.Provider; import com.invillia.acme.provider.repository.ProviderRepository; import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import java.util.List; @RunWith(SpringRunner.class) @SpringBootTest public class ProviderServiceTest { @Autowired private ProviderService providerService; @Autowired private ProviderRepository repository; @BeforeClass public static void setUpClass(){ FixtureFactoryLoader.loadTemplates("com.invillia.acme.fixtures"); } @Before public void setUp(){ repository.deleteAll(); Address address = new Address("Av Ipiranga", 123, 18099000); repository.save(new Provider("My Provider")); repository.save(Fixture.from(Provider.class).gimme("valid")); repository.save(Fixture.from(Provider.class).gimme("valid")); repository.save(Fixture.from(Provider.class).gimme("valid")); repository.save(new Provider("Provider 1", address)); repository.save(new Provider("Provider 2", address)); repository.save(new Provider("Provider 3", address)); repository.save(new Provider("1", "Provider One")); } @Test public void when_create_new_provider_return_success(){ Provider createdProvider = providerService.create(Fixture.from(Provider.class).gimme("valid-without-id")); Assert.assertNotNull(createdProvider); Assert.assertNotNull(createdProvider.getId()); } @Test public void when_update_provider_by_id_1_return_success(){ String providerName = "updated provider"; Provider provider = Fixture.from(Provider.class).gimme("valid"); provider.setName(providerName); boolean update = providerService.update("1", provider); Assert.assertEquals(true, update); } @Test public void when_find_provider_by_id_1_return_notnull(){ Provider foundProvider = providerService.get("1"); Assert.assertNotNull(foundProvider); Assert.assertNotNull(foundProvider.getId()); } @Test public void when_find_by_name_and_return_one_provider(){ String providerName = "My Provider"; List<Provider> foundProviders = providerService.find( ProviderSearchRequest .builder() .name(providerName) .build()); Assert.assertNotNull(foundProviders); Assert.assertEquals(1, foundProviders.size()); } @Test public void when_find_by_address_and_return_success(){ String streetName = "Av Ipiranga"; Integer zipCode = 18099000; List<Provider> providers = providerService.find( ProviderSearchRequest .builder() .address( AddressSearchRequest .builder() .street(streetName) .zipCode(zipCode) .build()) .build()); Assert.assertNotNull(providers); Assert.assertEquals(3, providers.size()); } }
[ "caio.gallo@gmail.com" ]
caio.gallo@gmail.com
17959d268c54f1e9154cc5f73330e8ee25cae0f5
7933a54177ef16052648edfd377626c72e6d5d4b
/throw-common-msg/src/com/playmore/dbobject/staticdb/BossstageS.java
39f1193946b039799c004cd32b6162a7d4df8084
[]
no_license
China-Actor/Throw-Server
0e6377e875409ff1133dd3e64c6d034005a75c25
0571ba6c78842b3674913162b6fb2bfcc5274e9c
refs/heads/master
2022-10-12T22:25:55.963855
2020-04-18T09:55:55
2020-04-18T09:55:55
252,702,013
0
1
null
2022-10-04T23:57:17
2020-04-03T10:34:28
Java
UTF-8
Java
false
false
1,628
java
package com.playmore.dbobject.staticdb; import java.io.Serializable; import com.playmore.database.DBFieldName; import java.util.Date; import org.springframework.format.annotation.DateTimeFormat; /** * Do not touch! Close it Now! */ @SuppressWarnings("serial") public class BossstageS implements Serializable { @DBFieldName(fieldName="阶段id", isNullable="columnNoNulls") private int id; @DBFieldName(fieldName="bossid", isNullable="columnNullable") private int bossid; @DBFieldName(fieldName="血量", isNullable="columnNullable") private int hp; @DBFieldName(fieldName="货币掉落包", isNullable="columnNullable") private int drop1; @DBFieldName(fieldName="掉落装备包", isNullable="columnNullable") private int drop2; @DBFieldName(fieldName="掉落钻石包", isNullable="columnNullable") private int drop3; public BossstageS(){ } public void setId(int id) { this.id=id; } public int getId() { return id; } public void setBossid(int bossid) { this.bossid=bossid; } public int getBossid() { return bossid; } public void setHp(int hp) { this.hp=hp; } public int getHp() { return hp; } public void setDrop1(int drop1) { this.drop1=drop1; } public int getDrop1() { return drop1; } public void setDrop2(int drop2) { this.drop2=drop2; } public int getDrop2() { return drop2; } public void setDrop3(int drop3) { this.drop3=drop3; } public int getDrop3() { return drop3; } public String toString() { return "BossstageS [id=" + id + " ,bossid=" + bossid + " ,hp=" + hp + " ,drop1=" + drop1 + " ,drop2=" + drop2 + " ,drop3=" + drop3+ "]"; } }
[ "1584992167@qq.com" ]
1584992167@qq.com
ea60966133e5660b1d1b9b7553481dd1f4b55afd
afaeacf76ee1e146963544fae91c261c6df09fa0
/src/main/java/org/example/RadioButtonPage.java
22d9d8087a66927dbc1c1fb245ecbc27551b869f
[]
no_license
nirmohpatel/ToolaQA123
340ee805c6c57a9d76cb83f0308761e4d25f985a
b29e560d2a61e810a242a455568ff22903cdcad4
refs/heads/main
2023-03-02T22:39:29.195920
2021-02-15T16:13:49
2021-02-15T16:13:49
339,132,800
0
0
null
null
null
null
UTF-8
Java
false
false
2,392
java
package org.example; import javafx.scene.control.RadioButton; import org.openqa.selenium.By; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.testng.asserts.SoftAssert; public class RadioButtonPage extends Util { SoftAssert softAssert = new SoftAssert(); public static LoadProperty loadProperty = new LoadProperty(); public static String RadioButton = loadProperty.getProperty("RadioButton"); private String expectedText4 = "Radio Button"; private String expectedTextMassageForYes = "You have selected Yes"; private String expectedTextMassageForImpressive = "You have selected Impressive"; private By _actualText4 = By.xpath("//div[@class=\"main-header\"]"); private By _selectYes = By.xpath("//label[@for=\"yesRadio\"] "); private By _selectImpressive = By.xpath("//label[@for=\"impressiveRadio\"] "); private By _actualTextMassageForYes = By.xpath("//p[@class=\"mt-3\"]"); private By _actualTextMassageForImpressive = By.xpath("//p[@class=\"mt-3\"]"); public void toVerifyThatUserIsOnRadioButtonPage() { softAssert.assertEquals(getTextFromElement(_actualText4), expectedText4); softAssert.assertAll("User is not on Radio button Page"); } public void selectRadioButton () { if (RadioButton.equalsIgnoreCase("yes")) { clickOnElement(_selectYes); } else if (RadioButton.equalsIgnoreCase("Impressive")) { clickOnElement(_selectImpressive); } else { System.out.println(" Please select Radio button"); } } public void toVerifyThatUserSuccessfullySelectRadioButton() { if (RadioButton.equalsIgnoreCase("yes")) { softAssert.assertEquals(getTextFromElement(_actualTextMassageForYes), expectedTextMassageForYes); softAssert.assertAll("User have not click on check box successfully"); }else if(RadioButton.equalsIgnoreCase("Impressive")) { softAssert.assertEquals(getTextFromElement(_actualTextMassageForImpressive), expectedTextMassageForImpressive); softAssert.assertAll("User have not click on check box successfully"); } else { System.out.println("User have not click on check box successfully"); } } }
[ "nirmohpatelunique1@gmail.com" ]
nirmohpatelunique1@gmail.com
0bab26552e896ef2b660bb9931d653d796f873db
7165a598196001af2534020e7bd63d727b264f40
/app/src/main/java/com/tehike/client/dtc/single/app/project/execption/compat/ActivityKillerV24_V25.java
e87d21c9cc48df898ab2b0e2ae33d752b21ade3d
[]
no_license
wpfsean/Dtc_F
65ee0105ea5b0b33a8dce14d495bc86ff8348f50
486a20b0a7a06136e66bbe021d39069213d8b787
refs/heads/master
2020-05-04T07:52:40.319849
2019-04-08T01:55:11
2019-04-08T01:55:11
171,991,661
0
0
null
null
null
null
UTF-8
Java
false
false
2,538
java
package com.tehike.client.dtc.single.app.project.execption.compat; import android.app.Activity; import android.content.Intent; import android.os.IBinder; import android.os.Message; import java.lang.reflect.Field; import java.lang.reflect.Method; /** * Created by wanjian on 2018/5/24. * <p> * android 7.1.1 * <p> * ActivityManagerNative.getDefault().finishActivity(mToken, resultCode, resultData, finishTask)) */ public class ActivityKillerV24_V25 implements IActivityKiller { @Override public void finishLaunchActivity(Message message) { try { Object activityClientRecord = message.obj; Field tokenField = activityClientRecord.getClass().getDeclaredField("token"); tokenField.setAccessible(true); IBinder binder = (IBinder) tokenField.get(activityClientRecord); finish(binder); } catch (Exception e) { e.printStackTrace(); } } @Override public void finishResumeActivity(Message message) { finishSomeArgs(message); } @Override public void finishPauseActivity(Message message) { finishSomeArgs(message); } @Override public void finishStopActivity(Message message) { finishSomeArgs(message); } private void finishSomeArgs(Message message) { try { Object someArgs = message.obj; Field arg1Field = someArgs.getClass().getDeclaredField("arg1"); arg1Field.setAccessible(true); IBinder binder = (IBinder) arg1Field.get(someArgs); finish(binder); } catch (Throwable throwable) { throwable.printStackTrace(); } } private void finish(IBinder binder) throws Exception { /* ActivityManagerNative.getDefault() .finishActivity(r.token, Activity.RESULT_CANCELED, null, Activity.DONT_FINISH_TASK_WITH_ACTIVITY); */ Class activityManagerNativeClass = Class.forName("android.app.ActivityManagerNative"); Method getDefaultMethod = activityManagerNativeClass.getDeclaredMethod("getDefault"); Object activityManager = getDefaultMethod.invoke(null); Method finishActivityMethod = activityManager.getClass().getDeclaredMethod("finishActivity", IBinder.class, int.class, Intent.class, int.class); int DONT_FINISH_TASK_WITH_ACTIVITY = 0; finishActivityMethod.invoke(activityManager, binder, Activity.RESULT_CANCELED, null, DONT_FINISH_TASK_WITH_ACTIVITY); } }
[ "wpfsean@126.com" ]
wpfsean@126.com
fe3d72e059ca8b6b1b60520285e42126cba3f173
66884071bc8928313136ef6766407832b1a13361
/src/main/java/mf/uz/services/RoleService.java
907deea427e6c0d5967778024f6d2d22f52cc755
[]
no_license
Qurbonov/UserManagementAngular
53b41752b103ddec092fa6434a684ef586a17b3e
fd77355733e611b6e4e297ba0e845fca9f80d65f
refs/heads/master
2021-01-10T16:11:44.513135
2016-04-06T17:12:04
2016-04-06T17:12:04
49,048,154
0
0
null
null
null
null
UTF-8
Java
false
false
651
java
package mf.uz.services; import mf.uz.domain.Role; import mf.uz.repositories.RoleRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Sort; import org.springframework.stereotype.Service; import java.util.List; /** * Created by qurbonov on 10/6/2015. */ @Service public class RoleService { @Autowired RoleRepository roleRepository; public List<Role> findAll() { return roleRepository.findAll(new Sort(new Sort.Order(Sort.Direction.ASC, "id"))); } public Role findOne(Long id) { return roleRepository.findOne(id); } }
[ "Qurbonov@myPC" ]
Qurbonov@myPC
948038b9eac5bc27af2253d1421389c9b3b255dd
68e0cdd5365490b27b91d514d21395b727447ff4
/src/main/java/com/niule/znxj/web/dao/KnowledgeMapper.java
635f0140943c7847bf4c44d0a6322e0dbd309da5
[]
no_license
caidaoyu/znxj_app
80bfa5dac339b77880c9a8251dcdcc935fe9b300
aa8504168845383e72f12a5662ed65c05f37d9b0
refs/heads/master
2022-04-22T17:47:48.201562
2020-04-16T11:02:10
2020-04-16T11:02:10
256,189,475
1
0
null
2020-04-16T11:02:35
2020-04-16T11:02:34
null
UTF-8
Java
false
false
1,057
java
package com.niule.znxj.web.dao; import com.niule.znxj.web.model.Knowledge; import com.niule.znxj.web.model.KnowledgeExample; import java.util.HashMap; import java.util.List; import org.apache.ibatis.annotations.Param; public interface KnowledgeMapper { int countByExample(KnowledgeExample example); int deleteByExample(KnowledgeExample example); int deleteByPrimaryKey(Integer id); int insert(Knowledge record); int insertSelective(Knowledge record); List<Knowledge> selectByExample(HashMap<String, Object> map); Knowledge selectByPrimaryKey(Integer id); int updateByExampleSelective(@Param("record") Knowledge record, @Param("example") KnowledgeExample example); int updateByExample(@Param("record") Knowledge record, @Param("example") KnowledgeExample example); int updateByPrimaryKeySelective(Knowledge record); int updateByPrimaryKey(Knowledge record); List<Knowledge>getKnowledgeByTypeid(int typeid); List<Knowledge>getKnowledgeByParam(String str); }
[ "dabin543@163.com" ]
dabin543@163.com
afd84775115f44a45cf123a0820443e1faf2c912
f4ccc91a720594015963755df5bc6890739fbba2
/app/src/main/java/com/example/tugassqlite/Adapter/SiswaAdapter.java
482857728cb9728167678475f08c319d2d345b3c
[]
no_license
M-Alfi/PWPB_DataMahasiswa
2305a6a7ad7c789a767bc0b03c6c30ae39e273ee
96c912ff723e555f19794f673ee026401f03f9a7
refs/heads/master
2020-07-25T18:15:09.180302
2019-09-14T03:28:20
2019-09-14T03:28:20
208,383,241
0
0
null
null
null
null
UTF-8
Java
false
false
3,560
java
package com.example.tugassqlite.Adapter; import android.app.AlertDialog; import android.content.Context; import android.content.Intent; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import android.widget.Toast; import com.example.tugassqlite.DetailDataActivity; import com.example.tugassqlite.Helper.DatabaseHelper; import com.example.tugassqlite.Models.Siswa; import com.example.tugassqlite.R; import com.example.tugassqlite.ShowDataActivity; import java.util.List; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; public class SiswaAdapter extends RecyclerView.Adapter<SiswaAdapter.viewHolder> { List<Siswa> siswaList; Context context; OnUserClickListener listener; public SiswaAdapter(List<Siswa> siswaList, OnUserClickListener listener) { this.siswaList = siswaList; this.listener = listener; } public interface OnUserClickListener{ void onUserClick(Siswa currentSiswa, String action); } @NonNull @Override public viewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_row_data,parent,false); viewHolder holder= new viewHolder(view); context = parent.getContext(); return holder; } @Override public void onBindViewHolder(@NonNull viewHolder holder, int position) { final Siswa siswa = siswaList.get(position); holder.nama.setText(siswa.getNama()); holder.nama.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { AlertDialog.Builder dialog = new AlertDialog.Builder(context); View dialogView = LayoutInflater.from(context).inflate(R.layout.alert_dialog,null); dialog.setView(dialogView); TextView lihat = dialogView.findViewById(R.id.lihatData); TextView update = dialogView.findViewById(R.id.updateData); TextView delete = dialogView.findViewById(R.id.deleteData); final AlertDialog alertDialog = dialog.create(); alertDialog.show(); lihat.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { listener.onUserClick(siswa,"Lihat"); alertDialog.dismiss(); } }); delete.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { listener.onUserClick(siswa,"Delete"); alertDialog.dismiss(); } }); update.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { listener.onUserClick(siswa,"Update"); alertDialog.dismiss(); } }); } }); } @Override public int getItemCount() { return siswaList.size(); } public class viewHolder extends RecyclerView.ViewHolder { TextView nama; public viewHolder(@NonNull View itemView) { super(itemView); nama = itemView.findViewById(R.id.txtNama); } } }
[ "homedaisys@gmail.com" ]
homedaisys@gmail.com
c997a6b50f1ce4e0ac8d63f4b11704ce6f64fb2c
a75b8e1f4927cffec0478c3575142943a02170f7
/src/test/java/neflis/UserServiceTest.java
7fd47dd0007dbfdf2e257eb8cea56e5b57e51961
[]
no_license
namcent/Neflis2.0
1234dbbd5d3e3ea44729f83798e10bdfbb5a898a
cc920d71557c86de7e0443ef5ff3bafb153c649b
refs/heads/master
2022-11-23T19:21:25.288903
2020-07-09T20:16:25
2020-07-09T20:16:25
278,493,462
0
1
null
2020-07-09T23:50:02
2020-07-09T23:36:23
Java
UTF-8
Java
false
false
2,086
java
package neflis; import neflis.neflisdemo.controller.UserController; import neflis.neflisdemo.model.Contenido; import neflis.neflisdemo.model.UserApi; import neflis.neflisdemo.service.UserService; import neflis.neflisdemo.util.Util; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.List; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; public class UserServiceTest { private UserController userController; private UserService userService; private UserApi userApi; UserApi yaz; UserApi noe; UserApi nadia; Contenido titanic; Contenido brave_heart; Contenido breaking_bad; List<Contenido> contenidoList; List<String> contenidoPorgenreList; @BeforeEach void setUp() { yaz = new UserApi("1L", "yaz"); noe = new UserApi("2L", "noe"); nadia = new UserApi("3L", "nadia"); titanic = mock(Contenido.class); brave_heart = mock(Contenido.class); breaking_bad = mock(Contenido.class); contenidoList = new ArrayList<>(); contenidoList.add(titanic); contenidoList.add(brave_heart); contenidoList.add(breaking_bad); contenidoPorgenreList = new ArrayList<>(); contenidoPorgenreList.add(titanic.getGenre()); contenidoPorgenreList.add(brave_heart.getGenre()); contenidoPorgenreList.add(breaking_bad.getGenre()); when(titanic.getGenre()).thenReturn("romance"); when(brave_heart.getGenre()).thenReturn("drama"); when(brave_heart.getGenre()).thenReturn("drama"); when(titanic.getRuntime()).thenReturn("180 min"); when(breaking_bad.getRuntime()).thenReturn("1500 min"); when(brave_heart.getRuntime()).thenReturn("120 min"); } /* @Test public void testGetUsuarios(){ userService.usuarios(); System.out.println(userService.usuarios()); //assertEquals(3, userService.usuarios().size()); }*/ }
[ "yaz_01@hotmail.com" ]
yaz_01@hotmail.com
e810d4be39ec01bf63370e4762be55ab06615d74
d2cb1f4f186238ed3075c2748552e9325763a1cb
/methods_all/nonstatic_methods/jdk_nashorn_api_scripting_NashornScriptEngineFactory_hashCode.java
cb93e28c16636c695921283d7b49cab9e7ceb259
[]
no_license
Adabot1/data
9e5c64021261bf181b51b4141aab2e2877b9054a
352b77eaebd8efdb4d343b642c71cdbfec35054e
refs/heads/master
2020-05-16T14:22:19.491115
2019-05-25T04:35:00
2019-05-25T04:35:00
183,001,929
4
0
null
null
null
null
UTF-8
Java
false
false
235
java
class jdk_nashorn_api_scripting_NashornScriptEngineFactory_hashCode{ public static void function() {jdk.nashorn.api.scripting.NashornScriptEngineFactory obj = new jdk.nashorn.api.scripting.NashornScriptEngineFactory();obj.hashCode();}}
[ "peter2008.ok@163.com" ]
peter2008.ok@163.com
06707624b415a142a57e45ffe5b5438e6b1f2ef5
1ef43fd13dd1546d9860cdec158efadbb08cd7d5
/src/main/java/cz/cuni/mff/d3s/trupple/parser/identifierstable/types/complex/TextFileDescriptor.java
78fa134d19850a6d85bcc56bb9a4e86861ead4c3
[]
no_license
Aspect26/TrufflePascal
8f399462bc7e7de4804ed5f3a9225cd1cc594c3d
99c801edbacd13bf5129e5db836257ef293774ce
refs/heads/master
2021-05-24T03:17:07.139935
2017-07-20T21:12:20
2017-07-20T21:12:20
56,541,527
11
5
null
2021-02-05T21:01:17
2016-04-18T20:56:28
Java
UTF-8
Java
false
false
842
java
package cz.cuni.mff.d3s.trupple.parser.identifierstable.types.complex; import cz.cuni.mff.d3s.trupple.language.runtime.customvalues.TextFileValue; import cz.cuni.mff.d3s.trupple.parser.identifierstable.types.TypeDescriptor; /** * Specialized type descriptor for text-file values. */ public class TextFileDescriptor extends FileDescriptor { private TextFileDescriptor() { super(null); } private static TextFileDescriptor SINGLETON = new TextFileDescriptor(); public static TextFileDescriptor getInstance() { return SINGLETON; } @Override public Object getDefaultValue() { return new TextFileValue(); } @Override public boolean convertibleTo(TypeDescriptor typeDescriptor) { return super.convertibleTo(typeDescriptor) || typeDescriptor == getInstance(); } }
[ "flimmelj@gmail.com" ]
flimmelj@gmail.com