blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
332
content_id
stringlengths
40
40
detected_licenses
listlengths
0
50
license_type
stringclasses
2 values
repo_name
stringlengths
7
115
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
557 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
82 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
7
5.41M
extension
stringclasses
11 values
content
stringlengths
7
5.41M
authors
listlengths
1
1
author
stringlengths
0
161
0f6c3fb42f7b9d9c2a7de82fe47413ac082b13bc
dcb00fd09f8c04ad8a9a88447f25359458080284
/CookHelper Final Project/app/src/main/java/com/example/elias/cookhelper/ViewRecipe.java
f70a39abf9378735994aad2ec5eb8eff99864568
[]
no_license
Mohammad-AlRidhawi/Cook-Helper
91d8e987917d3c33dfa7006b44cb919ac68490ad
43a300566165d3af2de4f85f9548a44b54169e2d
refs/heads/master
2021-09-15T22:41:12.841343
2018-06-11T22:49:27
2018-06-11T22:49:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,349
java
package com.example.elias.cookhelper; import android.content.Intent; import android.content.res.Configuration; import android.os.Bundle; import android.support.design.widget.NavigationView; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarDrawerToggle; import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; import android.widget.ArrayAdapter; import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; import java.util.ArrayList; import java.util.LinkedList; import java.util.Random; public class ViewRecipe extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener { private int index; private TextView instructionsText; private TextView directionsText; private ActionBarDrawerToggle toggle; private ArrayAdapter mArrayAdapter; private ArrayAdapter instructionArrayAdapter; private ListView ingredientListView; private ListView instructionlistView; private ArrayList ingredientList =new ArrayList(); private ArrayList instructionList=new ArrayList(); private LinkedList IngredientsLinkedList; private LinkedList DirectionLinkedList; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.drawer_activityviewrecipe); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); final ActionBar actionBar = getSupportActionBar(); index = (int) getIntent().getSerializableExtra("Index"); IngredientsLinkedList = Book.getInstance().getRecipes().get(index).getIngredients(); DirectionLinkedList = Book.getInstance().getRecipes().get(index).getDirections(); ((TextView) findViewById(R.id.recipe_view_name)).setText(Book.getInstance().getRecipes().get(index).getName() ); ((TextView) findViewById(R.id.recipe_view_prepTime)).setText("Preparation Time: " + Book.getInstance().getRecipes().get(index).getPrepTime()); ((TextView) findViewById(R.id.recipe_view_cookTime)).setText("Cooking Time " + Book.getInstance().getRecipes().get(index).getCookingTime()); ((TextView) findViewById(R.id.recipe_view_calories)).setText("Calories: " + Book.getInstance().getRecipes().get(index).getCalories()); ((TextView) findViewById(R.id.recipe_view_category)).setText("Category:"+ Book.getInstance().getRecipes().get(index).getCategory()); ((TextView) findViewById(R.id.recipe_view_type)).setText("Type: "+Book.getInstance().getRecipes().get(index).getType()); if(Book.getInstance().getRecipes().get(index).getBitmap()==null){ ((ImageView) findViewById(R.id.imageView)).setImageDrawable(this.getDrawable(R.drawable.placeholder)); } else { ((ImageView) findViewById(R.id.imageView)).setImageBitmap(Book.getInstance().getRecipes().get(index).getBitmap()); } // 4. Access the ListView ingredientListView = (ListView) findViewById(R.id.listView2); instructionlistView=(ListView) findViewById(R.id.listView); // Create an ArrayAdapter for the ListView mArrayAdapter = new ArrayAdapter(this, android.R.layout.simple_list_item_1, ingredientList); instructionsText = (TextView) findViewById(R.id.recipe_form_ingredients); instructionArrayAdapter = new ArrayAdapter(this, android.R.layout.simple_list_item_1,instructionList ); directionsText = (TextView) findViewById(R.id.recipe_form_directions); // Set the ListView to use the ArrayAdapter ingredientListView.setAdapter(mArrayAdapter); for(int i=0;i<IngredientsLinkedList.size();i++){ ingredientList.add(IngredientsLinkedList.get(i).toString()); mArrayAdapter.notifyDataSetChanged(); } instructionlistView.setAdapter(instructionArrayAdapter); for(int i=0;i<DirectionLinkedList.size();i++){ instructionList.add(DirectionLinkedList.get(i).toString()); instructionArrayAdapter.notifyDataSetChanged(); } DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); toggle = new ActionBarDrawerToggle( this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close); drawer.setDrawerListener(toggle); toggle.syncState(); actionBar.setDisplayHomeAsUpEnabled(true); NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view); navigationView.setNavigationItemSelectedListener(this); } public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_main_view, menu); return true; } public boolean onOptionsItemSelected(MenuItem item) { if (toggle.onOptionsItemSelected(item)) { return true; } int id =item.getItemId(); if (id==R.id.action_user) { Intent i = new Intent(this, EditRecipe.class); i.putExtra("Index", index); startActivity(i); } if (id == R.id.action_settings){ Book.getInstance().getRecipes().remove(index); Intent i = new Intent(this, RecipeBookView.class); startActivity(i); } if (id == R.id.action_about) { String X="This is where you can access all the information of one of your recipes. Notice the ingredients and the directions. You should also see your recipe picture, which you can set if you tap the edit button above." ; Intent a = new Intent(this, Help.class); a.putExtra("MyClass", X); startActivity(a); } return super.onOptionsItemSelected(item); } @Override public void onBackPressed() { DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); if (drawer.isDrawerOpen(GravityCompat.START)) { drawer.closeDrawer(GravityCompat.START); } else { super.onBackPressed(); } } @Override protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); // Sync the toggle state after onRestoreInstanceState has occurred. //toggle.syncState(); } @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); toggle.onConfigurationChanged(newConfig); } @SuppressWarnings("StatementWithEmptyBody") @Override public boolean onNavigationItemSelected(MenuItem item) { // Handle navigation view item clicks here. int id = item.getItemId(); if (id == R.id.menu_search) { Intent a = new Intent(this, SearchRecipe.class); startActivity(a); } else if (id == R.id.menu_supriseMe) { Random r = new Random(); if (Book.getInstance().getRecipes().size()==0){ Toast.makeText(getApplicationContext(), "Why don't you try adding some recipes first!", Toast.LENGTH_SHORT).show(); } else { int b = r.nextInt(Book.getInstance().getRecipes().size()); Intent intent = new Intent(this, ViewRecipe.class); intent.putExtra("Index", b); startActivity(intent); } } else if (id == R.id.menu_recipeBook) { Intent r = new Intent(this, RecipeBookView.class); startActivity(r); } else if (id == R.id.menu_createRecipe) { Intent i = new Intent(this, CreateRecipe.class); startActivity(i); } else if (id == R.id.home_page) { System.out.println("Hell0"); Intent i = new Intent(this, HomePage.class); startActivity(i); finish(); } DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); drawer.closeDrawer(GravityCompat.START); return true; } }
[ "moh.alridhawi@gmail.com" ]
moh.alridhawi@gmail.com
8f784e1fd5adad36aaf7de3cbff373ea1c6954f2
3ef55e152decb43bdd90e3de821ffea1a2ec8f75
/large/module1475/src/java/module1475/a/Foo2.java
8accec67068dd73f933f38d9f363710c89d891ff
[ "BSD-3-Clause" ]
permissive
salesforce/bazel-ls-demo-project
5cc6ef749d65d6626080f3a94239b6a509ef145a
948ed278f87338edd7e40af68b8690ae4f73ebf0
refs/heads/master
2023-06-24T08:06:06.084651
2023-03-14T11:54:29
2023-03-14T11:54:29
241,489,944
0
5
BSD-3-Clause
2023-03-27T11:28:14
2020-02-18T23:30:47
Java
UTF-8
Java
false
false
1,516
java
package module1475.a; import javax.management.*; import javax.naming.directory.*; import javax.net.ssl.*; /** * Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut * labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. * Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. * * @see java.util.logging.Filter * @see java.util.zip.Deflater * @see javax.annotation.processing.Completion */ @SuppressWarnings("all") public abstract class Foo2<C> extends module1475.a.Foo0<C> implements module1475.a.IFoo2<C> { javax.lang.model.AnnotatedConstruct f0 = null; javax.management.Attribute f1 = null; javax.naming.directory.DirContext f2 = null; public C element; public static Foo2 instance; public static Foo2 getInstance() { return instance; } public static <T> T create(java.util.List<T> input) { return module1475.a.Foo0.create(input); } public String getName() { return module1475.a.Foo0.getInstance().getName(); } public void setName(String string) { module1475.a.Foo0.getInstance().setName(getName()); return; } public C get() { return (C)module1475.a.Foo0.getInstance().get(); } public void set(Object element) { this.element = (C)element; module1475.a.Foo0.getInstance().set(this.element); } public C call() throws Exception { return (C)module1475.a.Foo0.getInstance().call(); } }
[ "gwagenknecht@salesforce.com" ]
gwagenknecht@salesforce.com
272243ea0698c36a6fde83105546033165f9f820
726e55328a7dd29e0985fdcf102913fc1dfc6f60
/EJBSeguimiento/build/generated-sources/ap-source-output/Entity/Tramite_.java
c86ecd0d3285717f4f9175c0b6435d6e754fd7cc
[]
no_license
damartinezn/tabacundo
fc6022ebfcee1adc4b495dcc0e69a0edeb624891
dda04b7231df13fdb657dac6ea763793ddb58566
refs/heads/master
2020-10-01T03:18:44.264342
2019-12-11T19:25:39
2019-12-11T19:25:39
227,443,058
0
0
null
null
null
null
UTF-8
Java
false
false
1,592
java
package Entity; import Entity.Remitente; import Entity.Ruta; import java.util.Date; import javax.annotation.Generated; import javax.persistence.metamodel.CollectionAttribute; import javax.persistence.metamodel.SingularAttribute; import javax.persistence.metamodel.StaticMetamodel; @Generated(value="EclipseLink-2.5.2.v20140319-rNA", date="2019-12-11T08:00:54") @StaticMetamodel(Tramite.class) public class Tramite_ { public static volatile SingularAttribute<Tramite, Date> tramiteFechaDoc; public static volatile SingularAttribute<Tramite, String> tramiteAnexo; public static volatile SingularAttribute<Tramite, Date> tramiteFechaIngreso; public static volatile SingularAttribute<Tramite, Integer> tramiteId; public static volatile SingularAttribute<Tramite, String> tramiteEstado; public static volatile SingularAttribute<Tramite, String> tramiteContacto; public static volatile SingularAttribute<Tramite, String> tramiteDirigido; public static volatile SingularAttribute<Tramite, Integer> tramiteDias; public static volatile SingularAttribute<Tramite, Date> tramiteFechaFin; public static volatile SingularAttribute<Tramite, String> tramiteNumDoc; public static volatile SingularAttribute<Tramite, String> tramiteUbicionFin; public static volatile SingularAttribute<Tramite, Boolean> tramiteCompletado; public static volatile SingularAttribute<Tramite, Remitente> remitenteId; public static volatile SingularAttribute<Tramite, String> tramiteAsunto; public static volatile CollectionAttribute<Tramite, Ruta> rutaCollection; }
[ "damartinezn@uce.edu.ec" ]
damartinezn@uce.edu.ec
ccbef0d7404c56cd09c54196d0f309e9f295db02
6661e345ce0665f22f97d841eee46587b37d4ca4
/src/main/java/com/jinliang/SpringbootAopApplication.java
9936163f0042651eecbfd6da0925d49e43afa948
[]
no_license
naheedmk/springboot-dynamic-service
1263135e998f893da52b23c4947ba0687f565d1d
4e012aa889cb680aefa97adf2f16f155b0063180
refs/heads/master
2022-01-20T02:50:47.052076
2019-06-12T11:42:30
2019-06-12T11:42:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
334
java
package com.jinliang; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class SpringbootAopApplication { public static void main(String[] args) { SpringApplication.run(SpringbootAopApplication.class, args); } }
[ "liang.jin@hand-china.com" ]
liang.jin@hand-china.com
c60cc70ea980e5f9d7809c2204bfea877e440822
ba56e18a272f48f8da035935983774aed548b582
/src/ce.java
bc5180a096634d77e7b256d82ad66d63769a690a
[]
no_license
Windowz/Refactored-client
ff1e193b36f89a9f2115735b227f7a683b164b39
b6b8705473bac80b379da9e1fbd3a28eaad1fab9
refs/heads/master
2021-01-18T14:10:59.766120
2013-05-13T04:37:05
2013-05-13T04:37:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,000
java
/* */ public final class ce /* */ { /* 4 */ en r = new en(); /* */ cf m; /* */ int l; /* */ int d; /* 8 */ ci c = new ci(); /* */ /* */ public void j(long paramLong) /* */ { /* 28 */ en localen = (en)this.m.r(paramLong); /* 29 */ if (localen != null) { /* 30 */ localen.r(); /* 31 */ localen.c(); /* 32 */ this.l += 1; /* */ } /* */ } /* */ /* */ public en r(long paramLong) /* */ { /* 19 */ en localen = (en)this.m.r(paramLong); /* 20 */ if (localen != null) { /* 21 */ this.c.r(localen); /* */ } /* */ /* 24 */ return localen; /* */ } /* */ /* */ public void d(long paramLong) { /* 28 */ en localen = (en)this.m.r(paramLong); /* 29 */ if (localen != null) { /* 30 */ localen.r(); /* 31 */ localen.c(); /* 32 */ this.l += 1; /* */ } /* */ } /* */ /* */ public ce(int paramInt) /* */ { /* 11 */ this.d = paramInt; /* 12 */ this.l = paramInt; /* 13 */ int i = 1; /* 14 */ while (i + i < paramInt) i += i; /* 15 */ this.m = new cf(i); /* */ } /* */ /* */ public void l(en paramen, long paramLong) /* */ { /* 37 */ if (this.l == 0) { /* 38 */ en localen = this.c.l(); /* 39 */ localen.r(); /* 40 */ localen.c(); /* 41 */ if (localen == this.r) { /* 42 */ localen = this.c.l(); /* 43 */ localen.r(); /* 44 */ localen.c(); /* */ } /* */ } else { /* 47 */ this.l -= 1; /* 48 */ }this.m.d(paramen, paramLong); /* 49 */ this.c.r(paramen); /* */ } /* */ /* */ public en c(long paramLong) /* */ { /* 19 */ en localen = (en)this.m.r(paramLong); /* 20 */ if (localen != null) { /* 21 */ this.c.r(localen); /* */ } /* */ /* 24 */ return localen; /* */ } /* */ /* */ public void i() /* */ { /* 53 */ this.c.c(); /* 54 */ this.m.l(); /* 55 */ this.r = new en(); /* 56 */ this.l = this.d; /* */ } /* */ /* */ public en n(long paramLong) /* */ { /* 19 */ en localen = (en)this.m.r(paramLong); /* 20 */ if (localen != null) { /* 21 */ this.c.r(localen); /* */ } /* */ /* 24 */ return localen; /* */ } /* */ /* */ public void z(en paramen, long paramLong) /* */ { /* 37 */ if (this.l == 0) { /* 38 */ en localen = this.c.l(); /* 39 */ localen.r(); /* 40 */ localen.c(); /* 41 */ if (localen == this.r) { /* 42 */ localen = this.c.l(); /* 43 */ localen.r(); /* 44 */ localen.c(); /* */ } /* */ } else { /* 47 */ this.l -= 1; /* 48 */ }this.m.d(paramen, paramLong); /* 49 */ this.c.r(paramen); /* */ } /* */ /* */ public void g(en paramen, long paramLong) /* */ { /* 37 */ if (this.l == 0) { /* 38 */ en localen = this.c.l(); /* 39 */ localen.r(); /* 40 */ localen.c(); /* 41 */ if (localen == this.r) { /* 42 */ localen = this.c.l(); /* 43 */ localen.r(); /* 44 */ localen.c(); /* */ } /* */ } else { /* 47 */ this.l -= 1; /* 48 */ }this.m.d(paramen, paramLong); /* 49 */ this.c.r(paramen); /* */ } /* */ /* */ public void q() { /* 53 */ this.c.c(); /* 54 */ this.m.l(); /* 55 */ this.r = new en(); /* 56 */ this.l = this.d; /* */ } /* */ /* */ public void m() /* */ { /* 53 */ this.c.c(); /* 54 */ this.m.l(); /* 55 */ this.r = new en(); /* 56 */ this.l = this.d; /* */ } /* */ /* */ public void s() /* */ { /* 53 */ this.c.c(); /* 54 */ this.m.l(); /* 55 */ this.r = new en(); /* 56 */ this.l = this.d; /* */ } /* */ } /* Location: C:\Users\Mike\IdeaProjects\RealityBot-2007 Updater\client-deob.jar * Qualified Name: ce * JD-Core Version: 0.6.2 */
[ "mdawg12131@gmail.com" ]
mdawg12131@gmail.com
57bb5a617d1a4d3f7fde6024afe1b8199bbca24b
732220bb841b414b304db52b2bb539d94bbc4842
/src/main/java/algorithm/hackerrank/practice/advanced/FoodFactory.java
19750c32df09d99c42ce52d46431e8ee59490303
[]
no_license
jobjava00/algorithm
c4f2d8d912d14b8821dd167ecfd97051dc142e19
ec9ee0563008b4c916b99353a55d001e51d60c89
refs/heads/master
2021-06-01T23:52:12.945521
2020-08-02T05:46:48
2020-08-02T05:46:48
147,155,212
0
0
null
null
null
null
UTF-8
Java
false
false
484
java
package algorithm.hackerrank.practice.advanced; interface Food { String getType(); } class Pizza implements Food { public String getType() { return "Someone ordered a Fast Food!"; } } class Cake implements Food { public String getType() { return "Someone ordered a Dessert!"; } } class FoodFactory { public Food getFood(String order) { if ("pizza".equals(order)) return new Pizza(); else if ("cake".equals(order)) return new Cake(); else return null; } }
[ "jobjava00@gmail.com" ]
jobjava00@gmail.com
70ef84313b14e2c066b9235e2f936db6143c7416
6494431bcd79c7de8e465481c7fc0914b5ef89d5
/src/main/java/com/crashlytics/android/core/CrashlyticsUncaughtExceptionHandler.java
93ed9fe72d9d53f58e9605ebed1c0ca23a40b01e
[]
no_license
maisamali/coinbase_decompile
97975a22962e7c8623bdec5c201e015d7f2c911d
8cb94962be91a7734a2182cc625efc64feae21bf
refs/heads/master
2020-06-04T07:10:24.589247
2018-07-18T05:11:02
2018-07-18T05:11:02
191,918,070
2
0
null
2019-06-14T09:45:43
2019-06-14T09:45:43
null
UTF-8
Java
false
false
1,466
java
package com.crashlytics.android.core; import io.fabric.sdk.android.Fabric; import java.lang.Thread.UncaughtExceptionHandler; import java.util.concurrent.atomic.AtomicBoolean; class CrashlyticsUncaughtExceptionHandler implements UncaughtExceptionHandler { private final CrashListener crashListener; private final UncaughtExceptionHandler defaultHandler; private final AtomicBoolean isHandlingException = new AtomicBoolean(false); interface CrashListener { void onUncaughtException(Thread thread, Throwable th); } public CrashlyticsUncaughtExceptionHandler(CrashListener crashListener, UncaughtExceptionHandler defaultHandler) { this.crashListener = crashListener; this.defaultHandler = defaultHandler; } public void uncaughtException(Thread thread, Throwable ex) { this.isHandlingException.set(true); try { this.crashListener.onUncaughtException(thread, ex); } catch (Exception e) { Fabric.getLogger().e("CrashlyticsCore", "An error occurred in the uncaught exception handler", e); } finally { Fabric.getLogger().d("CrashlyticsCore", "Crashlytics completed exception processing. Invoking default exception handler."); this.defaultHandler.uncaughtException(thread, ex); this.isHandlingException.set(false); } } boolean isHandlingException() { return this.isHandlingException.get(); } }
[ "gulincheng@droi.com" ]
gulincheng@droi.com
d8265281db887b424e29148868f1764dce97225c
b37058e93f581f5550a441e5b8a14ef476cf8a01
/aplicacion/app/build/generated/source/buildConfig/debug/com/example/josec/aplicacion/BuildConfig.java
8c79b3254c32c9509e465ea9b85bfad4f75698ab
[]
no_license
josefm09/android
eece308e7f1e9b616dea72c677f082d3b8d317b3
58200da8071874c55971c94e88bb385b114d5723
refs/heads/master
2021-01-21T15:48:19.592452
2018-03-24T19:56:42
2018-03-24T19:56:42
91,856,062
0
0
null
null
null
null
UTF-8
Java
false
false
463
java
/** * Automatically generated file. DO NOT MODIFY */ package com.example.josec.aplicacion; public final class BuildConfig { public static final boolean DEBUG = Boolean.parseBoolean("true"); public static final String APPLICATION_ID = "com.example.josec.aplicacion"; public static final String BUILD_TYPE = "debug"; public static final String FLAVOR = ""; public static final int VERSION_CODE = 1; public static final String VERSION_NAME = "1.0"; }
[ "josecarlosfloresmoran@hotmail.com" ]
josecarlosfloresmoran@hotmail.com
041fd07f0497aecb3a7e9fb355ba742decac6b2a
e8c1a4a3fe3cae22053714c25f94bd9627908c11
/ExpoMagik/src/com/conceptcandy/expomagik/navdrawer/MLRoundedImageView.java
b0f1b7edaa2866d9035e7914638bfe64ecbfe439
[]
no_license
sanakazi/ExpomagikWorkspace
e896af43f4cb9b6bc424b2e663063f39d8f8bce7
bbad197b13ca03470c87cf156b770723839e11fc
refs/heads/master
2021-01-17T16:18:43.702019
2016-06-08T07:49:18
2016-06-08T07:49:18
60,679,722
0
0
null
null
null
null
UTF-8
Java
false
false
2,390
java
package com.conceptcandy.expomagik.navdrawer; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Bitmap.Config; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.PorterDuff.Mode; import android.graphics.PorterDuffXfermode; import android.graphics.Rect; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.widget.ImageView; public class MLRoundedImageView extends ImageView { public MLRoundedImageView(Context context) { super(context); } public MLRoundedImageView(Context context, AttributeSet attrs) { super(context, attrs); } public MLRoundedImageView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } @Override protected void onDraw(Canvas canvas) { Drawable drawable = getDrawable(); if (drawable == null) { return; } if (getWidth() == 0 || getHeight() == 0) { return; } Bitmap b = ((BitmapDrawable) drawable).getBitmap(); Bitmap bitmap = b.copy(Bitmap.Config.ARGB_8888, true); int w = getWidth(), h = getHeight(); Bitmap roundBitmap = getCroppedBitmap(bitmap, w); canvas.drawBitmap(roundBitmap, 0, 0, null); } public static Bitmap getCroppedBitmap(Bitmap bmp, int radius) { Bitmap sbmp; Bitmap output = null; try{ if (bmp.getWidth() != radius || bmp.getHeight() != radius) { float smallest = Math.min(bmp.getWidth(), bmp.getHeight()); float factor = smallest / radius; sbmp = Bitmap.createScaledBitmap(bmp, (int) (bmp.getWidth() / factor), (int) (bmp.getHeight() / factor), false); } else { sbmp = bmp; } output = Bitmap.createBitmap(radius, radius, Config.ARGB_8888); Canvas canvas = new Canvas(output); final int color = 0xffa19774; final Paint paint = new Paint(); final Rect rect = new Rect(0, 0, radius, radius); paint.setAntiAlias(true); paint.setFilterBitmap(true); paint.setDither(true); canvas.drawARGB(0, 0, 0, 0); paint.setColor(Color.parseColor("#BAB399")); canvas.drawCircle(radius / 2 + 0.7f, radius / 2 + 0.7f, radius / 2 + 0.1f, paint); paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN)); canvas.drawBitmap(sbmp, rect, rect, paint); }catch(Exception e) { e.printStackTrace(); } return output; } }
[ "kazisana23@gmail.com" ]
kazisana23@gmail.com
19db68edc01fdebc85676e7d2f6114eaaedb0c0e
d7e39e5e7ea97049f946e6bf9f45de17ff80e72c
/Cyberchair_backend/src/main/java/SELab/utility/contract/PCmemberRelationStatus.java
966ad2d92fe1f15b2e1fa2a129db874ae9f0606c
[]
no_license
yzbrlan/microservice-demo
875c3dcc0be6a68905fa653f8d2a9fb20feea562
6cfb3612a27658bfd8d8ca8828bc114378c52c32
refs/heads/master
2023-04-10T15:30:26.716145
2021-04-21T04:28:11
2021-04-21T04:28:11
360,017,305
0
0
null
null
null
null
UTF-8
Java
false
false
235
java
package SELab.utility.contract; public class PCmemberRelationStatus { public final static String accepted = "accepted"; public final static String undealed = "undealed"; public final static String rejected = "rejected"; }
[ "xiya.wu@foxmail.com" ]
xiya.wu@foxmail.com
ca1e918c3d01af84ffffbf8570560bac6c0b2757
3cf0e996e127137a093cfc65fdccce35617a5a6d
/spring-security-aa-advanced/src/main/java/io/github/web/security/UserRepository.java
299b376bd63a77c964ed365c6a5e354970e7caa4
[ "Apache-2.0" ]
permissive
kdmitry123/web-programming-examples
b1b868057bfdbdcb948934165e0d4770eb9180c0
24cc88e6563f388c8310bbe1e9b37401d792e238
refs/heads/master
2023-01-10T13:09:57.269018
2020-03-06T07:22:19
2020-03-06T07:22:19
245,354,686
0
0
Apache-2.0
2022-12-31T06:19:20
2020-03-06T07:20:24
HTML
UTF-8
Java
false
false
200
java
package io.github.web.security; import org.springframework.data.repository.CrudRepository; public interface UserRepository extends CrudRepository<User, Long> { User findByUser(String user); }
[ "dzmitry.karachun@mail.ru" ]
dzmitry.karachun@mail.ru
ffe11118003b9fdbfae27ab9ca8652996ef6f7b2
b5ac000d5317eec2d5427c075f256a4566a3222f
/QuickClick.java
317d924013a20ef973fcf1702b255e11f30322b1
[]
no_license
CAPNjyym/CMSC-492
f1709220605cce1ed6e9d39a255998d6bba13293
cba3131f0ab4ddd5c28b6ccfd0c3c6ee0f065a1f
refs/heads/main
2023-02-11T18:31:17.908219
2021-01-08T20:21:34
2021-01-08T20:21:34
328,004,107
0
0
null
null
null
null
UTF-8
Java
false
false
13,387
java
import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; import java.awt.Container; import java.awt.Font; import java.awt.TextArea; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.image.ColorModel; import java.text.DecimalFormat; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Random; import javax.swing.BorderFactory; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFormattedTextField; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTextArea; import javax.swing.JTextField; import javax.swing.JViewport; import javax.swing.border.BevelBorder; import javax.swing.border.Border; import javax.swing.text.NumberFormatter; public class QuickClick { public ArrayList<RoundData> getFileOutput() { return fileOutput; } public void setFileOutput(ArrayList<RoundData> fileOutput) { this.fileOutput = fileOutput; } private ArrayList<RoundData> fileOutput = new ArrayList<RoundData>(); private QuickClickGfx quickClickGfx; private JButton square; private JButton triangle; private JButton octagon; private JButton pentagon; private JButton septagon; private JButton hexagon; private JButton nonagon; private JButton decagon; private JButton playAgain; private JButton decDiff; private JButton incDiff; private JFrame gameFrame; private Container panel; private DecimalFormat df = new DecimalFormat("###.###"); private JLabel ready; private JLabel stats = new JLabel(); private JLabel encouragement = new JLabel(); private JLabel res; private ArrayList<Double> finalResults = new ArrayList<Double>(); private JTextArea results = new JTextArea(); private Random rand; private int mistakes = 0; private int round = 1; private int gameRounds = 101; private double lastRoundTime = 0; private double beginTime = System.currentTimeMillis(); private double startTime; private double endTime; private double totalTime; private int recentMistakes; private int difficulty; public QuickClick(QuickClickGfx g) { this.quickClickGfx = g; this.panel = quickClickGfx.getPanel(); ready = new JLabel(); ready.setSize(200,60); ready.setLocation(20, 70); ready.setVisible(true); ready.setFont(new Font("Comic Sans", Font.BOLD, 30)); panel.add(ready); square = quickClickGfx.getSquare(); triangle = quickClickGfx.getTriangle(); octagon = quickClickGfx.getOctagon(); pentagon = quickClickGfx.getPentagon(); septagon = quickClickGfx.getSeptagon(); hexagon = quickClickGfx.getHexagon(); gameFrame = quickClickGfx.getGameFrame(); quickClickGfx.setGameFrame(gameFrame); JLabel intro = new JLabel("There are buttons which are named by some shapes. \n" + "For each round you will click on the button that corresponds to a red colored \n" + "shape. The game will last 20 rounds."); intro.setBackground(Color.BLUE); intro.setForeground(Color.BLUE); intro.setBorder(BorderFactory.createRaisedBevelBorder()); intro.setFont(new Font("Lucida Sans", Font.ITALIC, 12)); intro.setSize(1000,30); intro.setLocation(10,10); panel.add(intro); encouragement.setSize(700,80); encouragement.setLocation(200,60); encouragement.setFont(new Font("Comic Sans", Font.BOLD, 30)); panel.add(encouragement); /*decDiff = new JButton("Play again, less difficult"); decDiff.setSize(250,50); decDiff.setLocation(750,75); decDiff.setFont(new Font("Comic Sans", Font.BOLD, 16)); decDiff.setForeground(Color.BLUE); decDiff.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { panel.remove(decDiff); panel.remove(incDiff); panel.remove(playAgain); quickClickGfx.setDifficulty(quickClickGfx.getDifficulty() - 1); difficulty = quickClickGfx.getDifficulty(); gameRounds = gameRounds + 20; addButtons(); quickClickGfx.addShapes(); gameRound(); } });*/ /*incDiff = new JButton("Play again, more difficult"); incDiff.setSize(250,50); incDiff.setLocation(750,175); incDiff.setFont(new Font("Comic Sans", Font.BOLD, 16)); incDiff.setForeground(Color.RED); incDiff.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { panel.remove(incDiff); panel.remove(playAgain); panel.remove(decDiff); quickClickGfx.setDifficulty(quickClickGfx.getDifficulty() + 1); difficulty = quickClickGfx.getDifficulty(); gameRounds = gameRounds + 20; addButtons(); quickClickGfx.addShapes(); gameRound(); } });*/ /*playAgain = new JButton("Play again, same difficulty"); playAgain.setFont(new Font("Comic Sans", Font.BOLD, 16)); playAgain.setSize(250,50); playAgain.setLocation(750,125); playAgain.setForeground(Color.GREEN); playAgain.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { panel.remove(playAgain); panel.remove(decDiff); panel.remove(incDiff); gameRounds = gameRounds + 20; gameRound(); } });*/ stats.setSize(600, 75); stats.setFont(new Font("Lucida Sans", Font.ITALIC, 20)); stats.setLocation(25, 630); panel.add(stats); res = new JLabel("Results:"); res.setBackground(Color.BLUE); res.setForeground(Color.BLUE); res.setFont(new Font("Lucida Sans", Font.BOLD, 15)); res.setSize(100,50); res.setLocation(850,250); panel.add(res); //The next 80ish lines of code are all the buttons and their actionlisteners. square = new JButton("Square"); square.setSize(100,50); square.setLocation(650, 500); square.addActionListener(new QuickClickButtonActionListener(1)); triangle = new JButton("Triangle"); triangle.setSize(100,50); triangle.setLocation(650, 450); triangle.addActionListener(new QuickClickButtonActionListener(0)); pentagon = new JButton("Pentagon"); pentagon.setSize(100,50); pentagon.setLocation(650, 550); pentagon.addActionListener(new QuickClickButtonActionListener(2)); hexagon = new JButton("Hexagon"); hexagon.setSize(100,50); hexagon.setLocation(650, 600); hexagon.addActionListener(new QuickClickButtonActionListener(3)); octagon = new JButton("octagon"); octagon.setSize(100,50); octagon.setLocation(650, 350); octagon.addActionListener(new QuickClickButtonActionListener(5)); septagon = new JButton("septagon"); septagon.setSize(100,50); septagon.setLocation(650, 400); septagon.addActionListener(new QuickClickButtonActionListener(4)); nonagon = new JButton("nonagon"); nonagon.setSize(100,50); nonagon.setLocation(650, 300); nonagon.addActionListener(new QuickClickButtonActionListener(6)); //Sets up a scrollpane and adds a JTextArea as the scrollpane's viewport JScrollPane scroll = new JScrollPane(); scroll.setSize(175, 400); scroll.setLocation(800, 300); results.setSize(175, 400); results.setLocation(800, 300); results.setLineWrap(true); results.setBackground(Color.LIGHT_GRAY); results.setEditable(false); results.setBorder(BorderFactory.createLineBorder(Color.black)); scroll.setViewportView(results); panel.add(scroll); ready.setText("GO!"); addButtons(); gameRound(); } public void gameRound() { septagon.setForeground(Color.BLACK); square.setForeground(Color.BLACK); pentagon.setForeground(Color.BLACK); hexagon.setForeground(Color.BLACK); triangle.setForeground(Color.BLACK); octagon.setForeground(Color.BLACK); nonagon.setForeground(Color.BLACK); rand = new Random(); if (quickClickGfx.getDifficulty() >= 3) { int r = rand.nextInt(7); if (r == 0) septagon.setForeground(Color.RED); else if (r == 1) square.setForeground(Color.RED); else if (r == 2) pentagon.setForeground(Color.RED); else if (r == 3) hexagon.setForeground(Color.RED); else if (r == 4) triangle.setForeground(Color.RED); else if (r == 5) nonagon.setForeground(Color.RED); else octagon.setForeground(Color.RED); } startTime = System.currentTimeMillis(); if (round > 0) { ready.setText("Round " + (round)); ready.repaint(); stats.setText(" Std Dev: " + df.format(stdev(finalResults)) + " " + "\nMean: " + df.format(mean(finalResults)) + " " + "\nMedian: " + df.format(median(finalResults)) + " \nMistakes: " + mistakes); } /*if ((round % 20) == 0 && round != 0) { if (quickClickGfx.getDifficulty()> 0) panel.add(decDiff); if (quickClickGfx.getDifficulty()< 3) panel.add(incDiff); panel.add(playAgain); }*/ quickClickGfx.update(); } private double mean(List<Double> res) { double mean = 0.0; for (int i = 0; i < res.size(); i++) { mean = mean + res.get(i); } mean = mean/res.size(); return mean; } private double median(ArrayList<Double> res) { if (res.size() == 0) return 0; double median = 0.0; ArrayList<Double> med = new ArrayList<Double>(); for (int i = 0; i < res.size(); i++) { med.add(res.get(i)); } Collections.sort(med); median = med.get(med.size()/2); return median; } private double stdev(ArrayList<Double> res) { double mean = mean(res); double stdev = 0.0; for (int i = 0; i < res.size(); i++) { stdev = stdev + (Math.pow(res.get(i) - mean, 2)); } stdev = stdev/res.size(); stdev = Math.sqrt(stdev); return stdev; } public void addButtons() { panel.remove(triangle); panel.add(triangle); panel.remove(square); panel.add(square); panel.remove(pentagon); panel.add(pentagon); panel.remove(hexagon); panel.add(hexagon); panel.remove(septagon); if (quickClickGfx.getDifficulty() >= 1) panel.add(septagon); panel.remove(octagon); if (quickClickGfx.getDifficulty() >= 2) panel.add(octagon); panel.remove(nonagon); if (quickClickGfx.getDifficulty() >= 3) panel.add(nonagon); } class QuickClickButtonActionListener implements ActionListener { private int redShape; public QuickClickButtonActionListener(int shape) { this.redShape = shape; } public void actionPerformed(ActionEvent ae) { if (round < gameRounds) { encouragement.setForeground(new Color(rand.nextInt(255),rand.nextInt(255),rand.nextInt(255))); double roundTime = 0.0; endTime=System.currentTimeMillis(); roundTime = (endTime-startTime); finalResults.add(roundTime/1000); if (quickClickGfx.getRedShape() == redShape) { if(roundTime/1000 < 1) encouragement.setText(roundTime/1000 + " seconds: Excellent, keep it up!"); else if (roundTime/1000 > 1 && roundTime/1000 < 5) encouragement.setText(roundTime/1000 + " seconds: Not bad, keep it up!"); else encouragement.setText(roundTime/1000 + " seconds: That was pretty slow! Wake up!"); fileOutput.add(new RoundData(round, stdev(finalResults), median(finalResults), mean(finalResults), roundTime/1000, mistakes, difficulty)); results.append("\nRound " + round + ": " + roundTime/1000); gameRound(); } else { encouragement.setText("You picked the wrong shape!!"); results.append("\nRound " + round + ": " + roundTime/1000); mistakes++; recentMistakes++; fileOutput.add(new RoundData(round, stdev(finalResults), median(finalResults), mean(finalResults), roundTime/1000, mistakes, difficulty)); gameRound(); } if (round % 5 == 0 && round != 0) { System.out.println("round check"); List<Double> test = finalResults.subList(finalResults.size()-5, finalResults.size()); for (int i = 0; i< test.size(); i++) { System.out.print(test.get(i) + " "); } System.out.println(mean(test)); if ((recentMistakes < 2 && mean((List<Double>)finalResults.subList(finalResults.size()-5, finalResults.size())) < 2)) { System.out.println("difficulty changed"); if(quickClickGfx.getDifficulty()<3) { quickClickGfx.setDifficulty(quickClickGfx.getDifficulty()+1); } } else { if (quickClickGfx.getDifficulty()>0) { quickClickGfx.setDifficulty(quickClickGfx.getDifficulty()-1); } } addButtons(); quickClickGfx.addShapes(); recentMistakes = 0; } round++; //Difficulty handling! } } } class RoundData { int round; double stdev; double median; double mean; double time; int mistakes; int difficulty; public RoundData(int x, double st, double med, double ave, double time, int mistakes, int diff) { round = x; stdev = st; median = med; mean = ave; this.time = time; this.mistakes = mistakes; this.difficulty = diff; } public String toString() { String x = ""; x = round + ", " + stdev + ", " + median + ", " + mean + ", " + time + ", " + mistakes + ", " + difficulty; return x; } } }
[ "noreply@github.com" ]
noreply@github.com
da53219ef0f036b7b22164092a5639c06c18c6fd
623b815d8d27654c3b93b269343e1bd0de76b458
/app/src/main/java/com/example/diego/base_datos/DBHelper.java
d2c24db8aae7dbd1d44ea35698c6cdfebc064678
[]
no_license
lDiegol/Base_datos
e1c0732ab79f516fd04c18d53c62fc8c61012ec6
bebb9528f0988366545cbe8320744d0fba1f9d20
refs/heads/master
2021-05-08T05:03:25.750321
2017-10-27T01:15:27
2017-10-27T01:15:27
108,480,513
0
0
null
null
null
null
UTF-8
Java
false
false
3,829
java
package com.example.diego.base_datos; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.SQLException; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.provider.Contacts; import android.provider.ContactsContract; import android.widget.ArrayAdapter; import com.example.diego.base_datos.modelos.Contacto; import java.util.ArrayList; public class DBHelper { private DatabaseHelper mDbHelper; private SQLiteDatabase mDb; private final Context mCtx; private static class DatabaseHelper extends SQLiteOpenHelper { DatabaseHelper(Context context){ super(context, "Contactos", null,1); } @Override public void onCreate(SQLiteDatabase db) { String tabla_contactos = "CREATE TABLE contactos(_id INTEGER primary key autoincrement," + "nombre TEXT, apellido TEXT," + "cumpleaños TEXT, notas TEXT);"; String tabla_telefonos = "CREATE TABLE telefonos(_id INTEGER primary key autoincrement," + "telefono TEXT, tipo INT, contacto_id INTEGER);"; String tabla_correos = "CREATE TABLE correos(_id INTEGER primary key autoincrement," + "telefono TEXT, tipo INT, contacto_id INTEGER);"; String tabla_direcciones = "CREATE TABLE direcciones(_id INTEGER primary key autoincrement," + "direccion TEXT, tipo INT, contacto_id INTEGER);"; String tabla_redes = "CREATE TABLE redes(_id INTEGER primary key autoincrement," + "red_social, tipo INT, contacto_id INTEGER);"; db.execSQL(tabla_contactos); db.execSQL(tabla_telefonos); db.execSQL(tabla_correos); db.execSQL(tabla_direcciones); db.execSQL(tabla_redes); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { } } public DBHelper(Context mCtx) { this.mCtx = mCtx; }; public DBHelper open() throws SQLException{ mDbHelper = new DatabaseHelper(mCtx); mDb = mDbHelper.getWritableDatabase(); return this; } public void close(){ mDbHelper.close(); } public ArrayList<Contacto> getContacts(){ ArrayList<Contacto> contactList = new ArrayList<Contacto>(); Cursor mCursor = mDb.query("contactos", new String[]{"id", "nombre","apellido", "cumpleaños", "notas"}, null, null, null, null,"_id desc"); if(mCursor != null){ if(mCursor.moveToFirst()){ do{ Contacto data = new Contacto(); data.setId((int) mCursor.getLong(mCursor.getColumnIndex("_id"))); data.setNombre( mCursor.getString(mCursor.getColumnIndex("nombre"))); data.setApellido( mCursor.getString(mCursor.getColumnIndex("apellido"))); data.setCumpleaños( mCursor.getString(mCursor.getColumnIndex("cumpleaños"))); data.setNotas(mCursor.getString(mCursor.getColumnIndex("notas"))); contactList.add(data); } while(mCursor.moveToNext()); mCursor.close(); } } return contactList; } public long creatNewContact(Contacto info){ ContentValues initialValues = new ContentValues(); initialValues.put("nombre", info.getNombre()); initialValues.put("apellido", info.getApellido()); initialValues.put("cumpleaños", info.getCumpleaños()); initialValues.put("notas", info.getNotas()); return mDb.insert("contactos", null, initialValues); } }
[ "Alumno@iMac-de-Informatica.local" ]
Alumno@iMac-de-Informatica.local
c0017c991accb2f895621071d89c484af6425fd8
1a14c95ebd2957620c175305fc2ed9a30812da07
/app/src/main/java/com/sctek/smartglasses/ui/MainActivity.java
4bee6bb97dff2a587dfdcd0a091d1b165ad9bfa1
[]
no_license
lzq1083520149/cam
5e9b24753ebe67e12e813cff853d3f1b810d4c5a
025ed67569c615381217c738305ba72c2130826b
refs/heads/master
2021-07-05T18:22:23.244163
2017-09-30T01:48:57
2017-09-30T01:51:14
105,331,366
0
0
null
null
null
null
UTF-8
Java
false
false
34,817
java
package com.sctek.smartglasses.ui; import android.annotation.SuppressLint; import android.app.AlertDialog; import android.app.AlertDialog.Builder; import android.app.NotificationManager; import android.app.ProgressDialog; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothProfile; import android.content.BroadcastReceiver; import android.content.Context; import android.content.DialogInterface; import android.content.DialogInterface.OnDismissListener; import android.content.DialogInterface.OnKeyListener; import android.content.Intent; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import android.net.wifi.WifiConfiguration; import android.net.wifi.WifiManager; import android.os.AsyncTask; import android.os.Bundle; import android.os.Environment; import android.os.Handler; import android.preference.PreferenceManager; import android.support.design.widget.NavigationView; import android.support.v4.content.ContextCompat; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarDrawerToggle; import android.util.Log; import android.view.KeyEvent; import android.view.View; import android.view.View.OnClickListener; import android.widget.ImageButton; import android.widget.TextView; import android.widget.Toast; import com.cn.zhongdun110.camlog.R; import com.cn.zhongdun110.camlog.SyncApp; import com.cn.zhongdun110.camlog.camera.PhotoModule; import com.cn.zhongdun110.camlog.camera.TakePictureModule; import com.cn.zhongdun110.camlog.contactslite.ContactsLiteModule; import com.ingenic.glass.api.sync.SyncChannel; import com.ingenic.glass.api.sync.SyncChannel.Packet; import com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiskCache; import com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator; import com.nostra13.universalimageloader.core.ImageLoader; import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; import com.nostra13.universalimageloader.core.assist.QueueProcessingType; import com.nostra13.universalimageloader.utils.StorageUtils; import com.sctek.smartglasses.biz.BLContacts; import com.sctek.smartglasses.db.ContactsDBHelper; import com.sctek.smartglasses.fragments.SettingFragment; import com.sctek.smartglasses.utils.CamlogCmdChannel; import com.sctek.smartglasses.utils.CamlogNotifyChannel; import com.sctek.smartglasses.utils.PhotosSyncRunnable; import com.sctek.smartglasses.utils.VideoSyncRunnable; import com.sctek.smartglasses.utils.WifiUtils; import com.sctek.smartglasses.utils.WifiUtils.WifiCipherType; import java.io.File; import java.io.FileOutputStream; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; import cn.ingenic.glasssync.DefaultSyncManager; import cn.ingenic.glasssync.devicemanager.GlassDetect; import cn.ingenic.glasssync.devicemanager.WifiManagerApi; public class MainActivity extends BaseFragmentActivity { private String TAG = "PhotoEditActivity"; private final String DIRECTORY = Environment.getExternalStorageDirectory() .toString(); private ImageButton takePhotoBt; private ImageButton takeVideoBt; // private Button mSyncHotspotBt; private DefaultSyncManager mSyncManager; private CamlogCmdChannel mCamlogCmdChannel; protected SetWifiAPTask mWifiATask; protected WifiManager mWifiManager; public ProgressDialog mConnectProgressDialog; private boolean mRegistApStateBroadcastReceiver = false; private Context mContext; private static final int MESSAGE_UNBIND_START = 1; private static final int MESSAGE_UNBIND_FINISH = 2; public static final int MESSAGE_UPDATE_GLASS = 3; public static final int MSG_RESEDN_CONNECT_WIFI = 4; private GlassDetect mGlassDetect; private static MainActivity mInstance = null; private final static int GET_POWER_LEVEL = 13; private final static int GET_STORAGE_INFO = 14; private final static int GET_POWER_TIMEOUT = 1; private BluetoothAdapter mAdapter; private DrawerLayout drawer; private CircularProgressBar circularProgressBar;//表盘最外圈 private CircularProgressBar circularProgressBar1;//表盘中圈 private CircularProgressBar circularProgressBar2;//表盘内圈 private TextView tv1, tv2, tv3;//电量,空间使用量,null private ImageButton liveBt; public static MainActivity getInstance() { return mInstance; } @SuppressLint("NewApi") @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main_drawer); mInstance = this; SyncApp.getInstance().addActivity(this); mAdapter = BluetoothAdapter.getDefaultAdapter(); mSyncManager = DefaultSyncManager.getDefault(); initImageLoader(getApplicationContext()); initView(); dialog = new ProgressDialog(MainActivity.this); mGlassDetect = GlassDetect.getInstance(getApplicationContext()); mGlassDetect.setLockedAddress(mSyncManager.getLockedAddress()); mCamlogCmdChannel = CamlogCmdChannel.getInstance(getApplicationContext()); initSyncHotspot(); SharedPreferences pref = getSharedPreferences(SyncApp.SHARED_FILE_NAME, Context.MODE_PRIVATE); boolean firstBind = getIntent().getBooleanExtra("first_bind", false); syncContactToGlass(false, firstBind); if (firstBind) { mGlassDetect.set_audio_connect(); mGlassDetect.set_a2dp_connect(); Editor editor = pref.edit(); editor.putBoolean("last_headset_state", true); editor.putBoolean("last_a2dp_state", true); editor.apply(); //默认打开直播音频 // SyncChannel.Packet pk = mCamlogCmdChannel.createPacket(); // pk.putInt("type", 25); // pk.putBoolean("audio", true); // mCamlogCmdChannel.sendPacket(pk); } else if (pref.getBoolean("last_headset_state", false) && (mGlassDetect.getCurrentHeadSetState() == BluetoothProfile.STATE_DISCONNECTED)) { mGlassDetect.set_audio_connect(); } else if (pref.getBoolean("last_a2dp_state", false) && (mGlassDetect.getCurrentA2dpState() == BluetoothProfile.STATE_DISCONNECTED)) { mGlassDetect.set_a2dp_connect(); } mCamlogCmdChannel.sendSyncTime(); TakePictureModule module = TakePictureModule.getInstance(this); module.registerHandler(handler); getData(); } private void initView() { drawer = (DrawerLayout) findViewById(R.id.drawer_layout); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( this, drawer, R.string.navigation_drawer_open, R.string.navigation_drawer_close); drawer.setDrawerListener(toggle); findViewById(R.id.back).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (drawer.isDrawerOpen(GravityCompat.START)) { drawer.closeDrawer(GravityCompat.START); } else { drawer.openDrawer(GravityCompat.START); } } }); findViewById(R.id.setting).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivity(new Intent(MainActivity.this, SettingActivity.class)); } }); takePhotoBt = (ImageButton) findViewById(R.id.take_photo); takeVideoBt = (ImageButton) findViewById(R.id.recorder); liveBt = (ImageButton) findViewById(R.id.location_live); takePhotoBt.setOnClickListener(mClickedListener); takeVideoBt.setOnClickListener(mClickedListener); liveBt.setOnClickListener(mClickedListener); NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view); View drawview = navigationView.inflateHeaderView(R.layout.nav_header_main); drawview.findViewById(R.id.sync_photo_view).setOnClickListener(mClickedListener); drawview.findViewById(R.id.sync_video_view).setOnClickListener(mClickedListener); drawview.findViewById(R.id.live).setOnClickListener(mClickedListener); drawview.findViewById(R.id.remote_live_view).setOnClickListener(mClickedListener); drawview.findViewById(R.id.about_view).setOnClickListener(mClickedListener); drawview.findViewById(R.id.unbind_view).setOnClickListener(mClickedListener); circularProgressBar = (CircularProgressBar) findViewById(R.id.circularProgressbar); circularProgressBar.setColor(ContextCompat.getColor(this, android.R.color.holo_green_dark)); circularProgressBar.setBackgroundColor(ContextCompat.getColor(this, R.color.circular_pb_background)); circularProgressBar.setProgressBarWidth(getResources().getDimension(R.dimen.layout_margin)); circularProgressBar.setBackgroundProgressBarWidth(getResources().getDimension(R.dimen.layout_margin)); circularProgressBar1 = (CircularProgressBar) findViewById(R.id.circularProgressbar1); circularProgressBar1.setColor(ContextCompat.getColor(this, android.R.color.holo_blue_dark)); circularProgressBar1.setBackgroundColor(ContextCompat.getColor(this, R.color.circular_pb_background)); circularProgressBar1.setProgressBarWidth(getResources().getDimension(R.dimen.layout_margin)); circularProgressBar1.setBackgroundProgressBarWidth(getResources().getDimension(R.dimen.layout_margin)); circularProgressBar2 = (CircularProgressBar) findViewById(R.id.circularProgressbar2); circularProgressBar2.setColor(ContextCompat.getColor(this, android.R.color.darker_gray)); circularProgressBar2.setBackgroundColor(ContextCompat.getColor(this, R.color.circular_pb_background)); circularProgressBar2.setProgressBarWidth(getResources().getDimension(R.dimen.layout_margin)); circularProgressBar2.setBackgroundProgressBarWidth(getResources().getDimension(R.dimen.layout_margin)); tv1 = (TextView) findViewById(R.id.tv1); tv2 = (TextView) findViewById(R.id.tv2); tv3 = (TextView) findViewById(R.id.tv3); } /* 获取电量信息、存储空间占用信息 */ private void getData() { //获取电量 SyncChannel.Packet pk = mCamlogCmdChannel.createPacket(); pk.putInt("type", GET_POWER_LEVEL); mCamlogCmdChannel.sendPacket(pk); //获取空间 SyncChannel.Packet pk1 = mCamlogCmdChannel.createPacket(); pk1.putInt("type", GET_STORAGE_INFO); mCamlogCmdChannel.sendPacket(pk1); mCmdHandler.sendEmptyMessageDelayed(GET_POWER_TIMEOUT, 15000); } private void initSyncHotspot() { mContext = this; mCamlogCmdChannel.registerHandler("PhotoEditActivity", mCmdHandler); mConnectProgressDialog = new ProgressDialog(mContext); mConnectProgressDialog.setTitle(R.string.sync_phone_wifi_hotspot); mConnectProgressDialog.setCancelable(false); mConnectProgressDialog.setOnKeyListener(new OnKeyListener() { @Override public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { dialog.cancel(); } return false; } }); mWifiManager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE); } private void syncContactToGlass(Boolean value, boolean firstBind) { ContactsLiteModule clm = (ContactsLiteModule) ContactsLiteModule.getInstance(getApplicationContext()); clm.sendSyncRequest(value, null); clm.setSyncEnable(value); BLContacts.getInstance(getApplicationContext()).syncContacts(false, firstBind); } private long currentTime = System.currentTimeMillis(); @Override public void onBackPressed() { if (drawer.isDrawerOpen(GravityCompat.START)) { drawer.closeDrawer(GravityCompat.START); } else { long tempTime = System.currentTimeMillis(); long interTime = tempTime - currentTime; if (interTime > 2000) { Locale local = getResources().getConfiguration().locale; if (local.getLanguage().contains("zh")) { Toast.makeText(this, "再按一次退出程序", Toast.LENGTH_SHORT).show(); } currentTime = tempTime; return; } // turnApOff(); super.onBackPressed(); } } @Override protected void onResume() { super.onResume(); if (!mAdapter.isEnabled()) mAdapter.enable(); PhotoModule.getInstance(getApplicationContext()).requestCameraState(); CamlogNotifyChannel notifyChannel = CamlogNotifyChannel.getInstance(this); Packet getPower = notifyChannel.createPacket(); getPower.putInt("type", CamlogNotifyChannel.MSG_TYPE_POWER_CHANGE); notifyChannel.sendPacket(getPower); getWifiConnectState(); } @Override protected void onPause() { super.onPause(); } public static void initImageLoader(Context context) { // This configuration tuning is custom. You can tune every option, you may tune some of them, // or you can create default configuration by // ImageLoaderConfiguration.createDefault(this); // method. String cacheDir = Environment.getExternalStorageDirectory().getAbsolutePath() + "/.glasses_image_cache"; File cacheFile = StorageUtils.getOwnCacheDirectory(context, cacheDir); ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(context) .threadPriority(Thread.NORM_PRIORITY - 2) .threadPoolSize(3) .denyCacheImageMultipleSizesInMemory() .diskCacheFileNameGenerator(new Md5FileNameGenerator()) .diskCacheSize(50 * 1024 * 1024) // 50 Mb .diskCache(new UnlimitedDiskCache(cacheFile)) .tasksProcessingOrder(QueueProcessingType.LIFO) .writeDebugLogs() // Remove for release app .diskCacheExtraOptions(480, 320, null) .build(); // Initialize ImageLoader with configuration. if (!ImageLoader.getInstance().isInited()) ImageLoader.getInstance().init(config); } private OnClickListener mClickedListener = new OnClickListener() { @SuppressLint("NewApi") @Override public void onClick(View v) { switch (v.getId()) { case R.id.sync_photo_view: startActivity(new Intent(MainActivity.this, PhotoActivity.class)); break; case R.id.sync_video_view: startActivity(new Intent(MainActivity.this, VideoActivity.class)); break; case R.id.live: Intent intent = new Intent(MainActivity.this, LiveDisplayActivity.class); startActivity(intent); break; case R.id.remote_live_view: if (mAdapter.isEnabled() && (mAdapter .getProfileConnectionState(BluetoothProfile.A2DP) == BluetoothProfile.STATE_CONNECTED)) { mGlassDetect.set_a2dp_disconnect(); SharedPreferences pref = getSharedPreferences(SyncApp.SHARED_FILE_NAME, MODE_PRIVATE); SharedPreferences.Editor editor = pref.edit(); editor.putBoolean("last_a2dp_state", false); editor.apply(); mGlassDetect.set_a2dp_disconnect(); } startActivity(new Intent(MainActivity.this, SelectCameraLiveActivity.class)); // startActivity(new Intent(MainActivity.this,SelectCameraLiveActivity.class)); break; case R.id.live_tv: startActivity(new Intent(MainActivity.this, SelectCameraLiveActivity.class)); break; case R.id.unbind_view: showUbindDialog(); break; case R.id.about_view: startActivity(new Intent(MainActivity.this, AboutActivity.class)); break; case R.id.take_photo: if (mCamlogCmdChannel.isConnected()) {//bluetooth is connected or not. PhotoModule m = PhotoModule.getInstance(getApplicationContext()); m.send_take_photo(); takePhotoBt.setEnabled(false); handler.postDelayed(takePhotoRunnable, 2000); } else { Toast.makeText(MainActivity.this, R.string.bluetooth_error, Toast.LENGTH_LONG).show(); } break; case R.id.location_live: Intent intentLive = new Intent(MainActivity.this, LiveDisplayActivity.class); startActivity(intentLive); break; case R.id.recorder: if (mCamlogCmdChannel.isConnected()) { PhotoModule.getInstance(getApplicationContext()).send_record(); takeVideoBt.setEnabled(false); handler.postDelayed(takeVideoRunnable, 2000); } else { Toast.makeText(MainActivity.this, R.string.bluetooth_error, Toast.LENGTH_LONG).show(); } break; default: break; } } }; public void showUbindDialog() { AlertDialog.Builder builder = new Builder(this); builder.setTitle(R.string.unbind); builder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { } }); builder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { try { GlassDetect glassDetect = GlassDetect.getInstance(getApplicationContext()); glassDetect.set_audio_disconnect(); glassDetect.set_a2dp_disconnect(); disableLocalData(); unBond(); } catch (Exception e) { e.printStackTrace(); } } }); builder.create().show(); } @Override protected void onDestroy() { super.onDestroy(); Log.i(TAG, "onDestroy in"); mInstance = null; handler.removeMessages(MSG_RESEDN_CONNECT_WIFI); SyncApp.getInstance().exitAllActivity(); ImageLoader.getInstance().clearDiskCache(); ImageLoader.getInstance().clearMemoryCache(); ImageLoader.getInstance().destroy(); mCamlogCmdChannel.unregisterHandler("PhotoEditActivity"); if (mRegistApStateBroadcastReceiver) mContext.unregisterReceiver(mApStateBroadcastReceiver); } ProgressDialog dialog; Handler handler = new Handler() { public void handleMessage(android.os.Message msg) { switch (msg.what) { case MESSAGE_UNBIND_START: dialog.setMessage(getResources().getText(R.string.unbonding)); dialog.show(); break; case MESSAGE_UNBIND_FINISH: if (dialog.isShowing()) dialog.cancel(); break; case TakePictureModule.MSG_RECEIVE_PICTURE_DATA: byte[] picData = (byte[]) msg.obj; addImage(picData); Toast.makeText(MainActivity.this, "接受图片成功", Toast.LENGTH_SHORT).show(); break; case MSG_RESEDN_CONNECT_WIFI: sendApInfoToGlass(); break; } } }; Handler mCmdHandler = new Handler() { public void handleMessage(android.os.Message msg) { switch (msg.what) { case CamlogCmdChannel.CHECK_UPDATE_SUCCESS: showUpdateConfirmDialog(); break; case CamlogCmdChannel.RECEIVE_MSG_FROM_GLASS: Packet data = (Packet) msg.obj; int type = data.getInt("type"); if (type == GET_POWER_LEVEL) { int level = data.getInt("power"); circularProgressBar.setProgressWithAnimation(level, 2000); removeMessages(GET_POWER_TIMEOUT); tv1.setText(getResources().getString(R.string.power) + level + "%"); } else if (type == GET_STORAGE_INFO) { String total = data.getString("total"); double totalStorage = Double.parseDouble(total.substring(0, total.length() - 2)); if (totalStorage <= 4.00) totalStorage = 4.00; else if (totalStorage <= 8.00) totalStorage = 8.00; else totalStorage = 16.00; String available = data.getString("available"); double usedStorage; double avlbStorage = Double.parseDouble(available.substring(0, available.length() - 2)); if (available.endsWith("GB")) { usedStorage = totalStorage - avlbStorage; } else if (available.endsWith("MB")) { usedStorage = totalStorage - avlbStorage / 1024; } else { usedStorage = totalStorage; } String userd = Double.toString(usedStorage); circularProgressBar1.setProgressWithAnimation((float) (usedStorage / totalStorage) * 100, 2000); tv2.setText(getResources().getString(R.string.rom) + String.valueOf((float) (usedStorage / totalStorage) * 100).substring(0, 4) + "%"); tv3.setText(getResources().getString(R.string.ram) + "0.0%" + ""); } break; case GET_POWER_TIMEOUT: break; default: break; } } }; private void addImage(byte[] jpeg) { File dir = new File(DIRECTORY); if (!dir.exists()) dir.mkdirs(); String path = DIRECTORY + '/' + generateName(System.currentTimeMillis()) + ".jpg"; Log.i(TAG, "path = " + path + "--jpeg.length = " + jpeg.length); FileOutputStream out = null; try { out = new FileOutputStream(path); out.write(jpeg); } catch (Exception e) { Log.e(TAG, "Failed to write image", e); } finally { try { out.close(); Intent ti = new Intent(); ti.setAction("cn.ingenic.kx.sendpic"); ti.putExtra("kx.pic.path", path); getApplicationContext().sendBroadcast(ti); } catch (Exception e) { } } } private String generateName(long dateTaken) { Date date = new Date(dateTaken); SimpleDateFormat format = new SimpleDateFormat("'IMG'_yyyyMMdd_HHmmss", Locale.US); String result = format.format(date); return result; } private void unBond() { new Thread(new Runnable() { @Override public void run() { handler.sendEmptyMessage(MESSAGE_UNBIND_START); BLContacts.getInstance(getApplicationContext()).stopSyncContacts(); ContactsDBHelper.getInstance(getApplicationContext(), null).clearAllData(); try { mSyncManager.setLockedAddress("", true); try { Thread.sleep(1000); } catch (Exception e) { } mSyncManager.disconnect(); handler.sendEmptyMessage(MESSAGE_UNBIND_FINISH); clearBetteryNotifi(); Intent intent = new Intent(MainActivity.this, BindCamlogActivity.class); startActivity(intent); finish(); } catch (Exception e) { e.printStackTrace(); } } }).start(); } private Runnable takePhotoRunnable = new Runnable() { @Override public void run() { takePhotoBt.setEnabled(true); //takePhotoBt.setAlpha(255); } }; private Runnable takeVideoRunnable = new Runnable() { @Override public void run() { takeVideoBt.setEnabled(true); //takeVideoBt.setAlpha(255); } }; private void disableLocalData() { SharedPreferences sp = getSharedPreferences(SyncApp.SHARED_FILE_NAME , MODE_PRIVATE); Editor editor = sp.edit(); editor.clear(); editor.commit(); SharedPreferences defaultSp = PreferenceManager.getDefaultSharedPreferences(this); Editor defaultEditor = defaultSp.edit(); defaultEditor.clear(); defaultEditor.commit(); } private void turnApOff() { PhotosSyncRunnable photosSyncRunnable = PhotosSyncRunnable.getInstance(); VideoSyncRunnable videoSyncRunnable = VideoSyncRunnable.getInstance(); WifiManager wifimanager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE); if (!photosSyncRunnable.isRunning() && !videoSyncRunnable.isRunning() && WifiUtils.getWifiAPState(wifimanager) == 13) { showTurnApOffDialog(); } else { quit(); } } private void showTurnApOffDialog() { AlertDialog.Builder builder = new Builder(this); builder.setTitle(R.string.turn_wifi_ap_off); builder.setMessage(R.string.wifi_ap_hint_off); builder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub new AsyncTask<Void, Void, Void>() { @Override protected Void doInBackground(Void... params) { // TODO Auto-generated method stub WifiManager wifimanager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE); WifiUtils.setWifiApEnabled(false, wifimanager); return null; } }.execute(); dialog.cancel(); quit(); } }); builder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub dialog.cancel(); quit(); } }); AlertDialog dialog = builder.create(); dialog.setOnDismissListener(new OnDismissListener() { @Override public void onDismiss(DialogInterface dialog) { // TODO Auto-generated method stub quit(); } }); dialog.show(); } private void quit() { super.onBackPressed(); } private void showUpdateConfirmDialog() { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(R.string.software_updates); builder.setMessage(R.string.updates_note); builder.setNegativeButton(R.string.update_later, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); builder.setPositiveButton(R.string.update_now, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); Intent intent = new Intent(MainActivity.this, WifiListActivity.class); intent.putExtra("wifi_type", WifiListActivity.TYPE_UPDATE); startActivity(intent); } }); builder.create().show(); } private void clearBetteryNotifi() { // 删除通知 NotificationManager notificationManager = (NotificationManager) this .getSystemService(NOTIFICATION_SERVICE); notificationManager.cancel(100); } private void startSilentLive() { Packet pk = mCamlogCmdChannel.createPacket(); pk.putInt("type", SettingFragment.SET_LIVE_AUDIO); pk.putBoolean("audio", false); mCamlogCmdChannel.sendPacket(pk); SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(MainActivity.this); Editor editor = preferences.edit(); editor.putBoolean("live_audio", false); editor.commit(); Intent intent = new Intent(MainActivity.this, LiveDisplayActivity.class); startActivity(intent); } public class SetWifiAPTask extends AsyncTask<Boolean, Void, Void> { private boolean mMode; private boolean mFinish; public SetWifiAPTask(boolean mode, boolean finish) { mMode = mode; mFinish = finish; } @Override protected void onPreExecute() { super.onPreExecute(); Log.i(TAG, "-----SetWifiAPTask onPreExecute------"); mConnectProgressDialog.setMessage(getResources().getText(R.string.turning_wifi_ap_on)); mConnectProgressDialog.show(); } @Override protected void onPostExecute(Void aVoid) { super.onPostExecute(aVoid); Log.i(TAG, "-----SetWifiAPTask onPostExecute------"); //updateStatusDisplay(); // if (mFinish) mContext.finish(); } @Override protected Void doInBackground(Boolean... off) { Log.i(TAG, "doInBackground"); try { if (off[0]) WifiUtils.toggleWifi(mContext, mWifiManager); WifiUtils.turnWifiApOn(mContext, mWifiManager, WifiCipherType.WIFICIPHER_NOPASS); } catch (Exception e) { e.printStackTrace(); } return null; } } private BroadcastReceiver mApStateBroadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { if ("android.net.wifi.WIFI_AP_STATE_CHANGED".equals(intent.getAction())) { int cstate = intent.getIntExtra("wifi_state", -1); Log.e(TAG, "WIFI_AP_STATE_CHANGED_ACTION:" + cstate); if (cstate == WifiUtils.WIFI_AP_STATE_ENABLED ) { BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter(); if (!adapter.isEnabled()) { adapter.enable(); } WifiManagerApi mWifiManagerApi = new WifiManagerApi(mContext); WifiConfiguration mWifiConfiguration = mWifiManagerApi.getWifiApConfiguration(); Log.e(TAG, "ssid:" + mWifiConfiguration.SSID + "password:" + mWifiConfiguration.preSharedKey); setProgressDialog(); sendApInfoToGlass(); mRegistApStateBroadcastReceiver = false; mContext.unregisterReceiver(mApStateBroadcastReceiver); } } } }; public void sendApInfoToGlass() { if (mCamlogCmdChannel.isConnected()) { Packet packet = mCamlogCmdChannel.createPacket(); packet.putInt("type", CamlogCmdChannel.CONNET_WIFI_MSG); String ssid = WifiUtils.getValidSsid(mContext); String pw = WifiUtils.getValidPassword(mContext); String security = WifiUtils.getValidSecurity(mContext); packet.putString("ssid", ssid); packet.putString("pw", pw); packet.putString("security", security); mCamlogCmdChannel.sendPacket(packet); Log.i(TAG, "---sendApInfoToGlass ssid: " + ssid + " pw: " + pw + " security: " + security); handler.sendEmptyMessageDelayed(MSG_RESEDN_CONNECT_WIFI, 5000); } else { if (mConnectProgressDialog.isShowing()) mConnectProgressDialog.dismiss(); Toast.makeText(mContext, R.string.bluetooth_error, Toast.LENGTH_LONG).show(); } } private void setProgressDialog() { if (mCamlogCmdChannel.isConnected()) { mConnectProgressDialog.setMessage(getResources().getText(R.string.wait_device_connect)); if (!mConnectProgressDialog.isShowing()) mConnectProgressDialog.show(); } } private void getWifiConnectState() { //phone wifi ap opened if (WifiUtils.getWifiAPState(mWifiManager) == WifiUtils.WIFI_AP_STATE_ENABLED && mCamlogCmdChannel.isConnected()) { Log.i(TAG, "getWifiConnectState "); Packet pk = mCamlogCmdChannel.createPacket(); pk.putInt("type", 28); mCamlogCmdChannel.sendPacket(pk); } // else { // mSyncHotspotBt.setTextColor(mContext.getResources().getColor(R.color.black)); // mSyncHotspotBt.setText(mContext.getResources().getString(R.string.sync_phone_wifi_hotspot)); // } } }
[ "1083520149@qq.com" ]
1083520149@qq.com
9c4366937f2fc62139fce28d4e646b2aaf6a3cc4
29cbfe19ab69053b5c5e6572013ea0ae34210628
/app/src/test/java/com/example/polar/shootingstars/ExampleUnitTest.java
c970b5f448108e4be2ef6932027ba226fbea1ab3
[]
no_license
PolarWeast/ShootingStars
440d678880534b07c8909b77579cd83aef171445
b382920ed648ff1765b85955d547e4068ca001a8
refs/heads/master
2021-07-13T08:22:35.759151
2017-10-16T03:28:49
2017-10-16T03:28:49
105,840,767
0
0
null
null
null
null
UTF-8
Java
false
false
409
java
package com.example.polar.shootingstars; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "polarbeast17@gmail.com" ]
polarbeast17@gmail.com
121f27bfcefc2de828170c49b6e75e2e03fdd566
5b7eb07140ce850031b4eb2f119ff46217dd08d7
/jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/emas/Emas.java
21bf93f029f91510d665b13224df02d8d1823b6d
[]
no_license
Imiolak/InteligencjaObliczeniowa
3a82ebc47e55828192ed875d3e66617ca7b4f67e
f1d5347967c93c7ae7bd9cac0f6adc93403393c6
refs/heads/master
2021-01-13T08:45:18.242152
2017-01-18T07:59:56
2017-01-18T07:59:56
71,979,503
0
0
null
null
null
null
UTF-8
Java
false
false
2,693
java
package org.uma.jmetal.algorithm.multiobjective.emas; import org.uma.jmetal.algorithm.impl.AbstractEmas; import org.uma.jmetal.algorithm.impl.AbstractEmasParameters; import org.uma.jmetal.operator.CrossoverOperator; import org.uma.jmetal.operator.MutationOperator; import org.uma.jmetal.problem.Problem; import org.uma.jmetal.solution.Solution; import org.uma.jmetal.util.SolutionListUtils; import java.util.Comparator; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; import java.util.stream.Collectors; public class Emas<S extends Solution<?>> extends AbstractEmas<S, List<S>, EmasAgent<S>> { private final Problem<S> problem; private final int maxIterations; private final int populationSize; private final AbstractEmasParameters parameters; private final CrossoverOperator<S> crossoverOperator; private final MutationOperator<S> mutationOperator; private final Comparator<S> solutionComparator; private int iteration; public Emas(Problem<S> problem, int maxIterations, int populationSize, AbstractEmasParameters parameters, CrossoverOperator<S> crossoverOperator, MutationOperator<S> mutationOperator, Comparator<S> solutionComparator) { this.problem = problem; this.maxIterations = maxIterations; this.populationSize = populationSize; this.parameters = parameters; this.crossoverOperator = crossoverOperator; this.mutationOperator = mutationOperator; this.solutionComparator = solutionComparator; } @Override public String getName() { return "EMAS"; } @Override public String getDescription() { return "Evolutionary Multi-Agent System Algorithm"; } @Override protected void initProgress() { iteration = 1; } @Override protected void updateProgress() { iteration++; } @Override protected boolean isStoppingConditionReached() { return iteration > maxIterations; } @Override protected List<EmasAgent<S>> createInitialPopulation() { List<EmasAgent<S>> population = new CopyOnWriteArrayList<>(); for (int i = 0; i < populationSize; i++) { population.add(new EmasAgent<>(problem, parameters, crossoverOperator, mutationOperator, solutionComparator)); } return population; } @Override public List<S> getResult() { List<S> population = getPopulation().stream() .map(EmasAgent<S>::getSolution) .collect(Collectors.toList()); return SolutionListUtils.getNondominatedSolutions(population); } }
[ "maciej.imiolek@gmail.com" ]
maciej.imiolek@gmail.com
d0cc4deb978bd838ba4e73c133af0f9faa521568
33954f290cb6d3940c1cbc27b549ac307adedc05
/src/thread/Thread_main.java
e548ccd9d8d4e7efdc1eeb958fe4e5237fdbbd29
[]
no_license
kurodashusuke/Thread
df7e382377ecd543fe886c1ef1f906da18c1f65e
671502f87124c9957dc6b216ec8a7fa32bbe97d3
refs/heads/master
2021-08-28T02:52:45.306123
2017-12-11T03:41:10
2017-12-11T03:41:10
113,808,781
0
0
null
null
null
null
SHIFT_JIS
Java
false
false
705
java
package thread; public class Thread_main { public static void main(String[] args) { // TODO Auto-generated method stub Thread_run th = new Thread_run(); Thread_runnable th2 = new Thread_runnable(); Thread_run[] s = new Thread_run[10]; Thread_runnable[] t = new Thread_runnable[10]; th.start(); th2.run(); for(int i=0;i<10;i++) { s[i]=new Thread_run(); t[i]=new Thread_runnable(); s[i].start(); t[i].run(); } try { th.join(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } for(int i = 0; i < 10; i++) { System.out.println("mainから出力 : "+i); } } }
[ "50616015@50616015-pc" ]
50616015@50616015-pc
44507f5cc7deb7f3994052b9311044f3be4350d2
4660fd7d448428e278d5ac122c97e34963f4697c
/src/com/doctor/test/elements/ElementsAddMessageTemplateActivity.java
7f2c79e4aef2c178d40069703fa77f5acabadf16
[]
no_license
huai-shu/KKHAndroidUITest
f729b1c4d4eb8a43adaa4da008ea7001001677ed
936122bc0d4238e028074c18594940ae9e256329
refs/heads/master
2021-01-21T13:57:55.970224
2016-05-11T02:51:19
2016-05-11T02:51:19
48,977,415
0
0
null
null
null
null
UTF-8
Java
false
false
1,621
java
package com.doctor.test.elements; import android.widget.EditText; import android.widget.ImageView; import android.widget.TextView; import com.robotium.solo.Solo; /** * 新增常用语界面 * @author qpgjk * */ public class ElementsAddMessageTemplateActivity { private Solo solo; private ImageView leftImageView;//返回控件 private EditText editEditText;//常用语输入框 private TextView rightTextView;//确定控件 public ElementsAddMessageTemplateActivity(Solo solo){ this.solo = solo; initViews(); } public void initViews(){ leftImageView = (ImageView) solo.getView("left");//返回控件 editEditText = (EditText) solo.getView("edit");//常用语输入框 rightTextView = (TextView) solo.getView("right");//确定控件 } /** * 获得返回控件 * @return */ public ImageView getLeftImageView(){ return leftImageView; } /** * 获得常用语输入框 * @return */ public EditText getEditEditText(){ return editEditText; } /** * 获得确定控件 * @return */ public TextView getRightTextView(){ return rightTextView; } /** * 点击返回控件 */ public void clickLeftImageView(){ solo.clickOnView(leftImageView); } /** * 输入常用语内容 * @param text */ public void EnterEditEditText(String text){ solo.enterText((EditText) solo.getView("edit"), text); } /** * 点击确定控件 */ public void clickRightTextView(){ solo.clickOnView(solo.getView("right")); } /** * 清空常用语输入框 */ public void clearEditEditText(){ solo.clearEditText((EditText) solo.getView("edit")); } }
[ "cpfordream@163.com" ]
cpfordream@163.com
10dd001bcbeb1d517fbd05c6c0fbc20290e72d5d
1d88a12d1bac65ece5af69d5d9d82cb268a310aa
/publiccms-core/src/main/java/com/publiccms/views/method/cms/GetContentAttributeMethod.java
b492f05ddc820d6d4e3ba45791351ececfa7e4ce
[]
no_license
apexwang/publiccms-parent
1d9e7095fd7268de69e4411773a25167c0b44ac5
c8b6bc3711da15e84d8cc450e85cc89e40d608fb
refs/heads/master
2022-12-23T01:16:41.177571
2020-03-09T02:46:12
2020-03-09T02:46:12
245,928,198
1
0
null
2022-12-16T12:25:27
2020-03-09T02:39:27
JavaScript
UTF-8
Java
false
false
1,599
java
package com.publiccms.views.method.cms; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import com.publiccms.common.base.BaseMethod; import com.publiccms.common.tools.CommonUtils; import com.publiccms.common.tools.ExtendUtils; import com.publiccms.entities.cms.CmsContentAttribute; import com.publiccms.logic.service.cms.CmsContentAttributeService; import freemarker.template.TemplateModelException; /** * * GetContentAttributeMethod * */ @Component public class GetContentAttributeMethod extends BaseMethod { @SuppressWarnings("unchecked") @Override public Object exec(@SuppressWarnings("rawtypes") List arguments) throws TemplateModelException { Long id = getLong(0, arguments); if (CommonUtils.notEmpty(id)) { CmsContentAttribute entity = service.getEntity(id); if (null != entity) { Map<String, String> map = ExtendUtils.getExtendMap(entity.getData()); map.put("text", entity.getText()); map.put("source", entity.getSource()); map.put("sourceUrl", entity.getSourceUrl()); map.put("wordCount", String.valueOf(entity.getWordCount())); return map; } } return null; } @Override public boolean needAppToken() { return true; } @Override public int minParametersNumber() { return 1; } @Autowired private CmsContentAttributeService service; }
[ "apex.f.wang@126.com" ]
apex.f.wang@126.com
c648ddb48a29870da54d49ac252e8e7372f72cc2
13602fde748d4a53c49fe4df2028a6bacd8d7dfa
/V-Assist/src/main/java/com/sysad/gr00t/vassist/AadharInfo.java
c7b473411933c02f6e0f4a804f6e416ac8fbcbce
[]
no_license
abhinavagrawal1995/V-Assist
1f045dfde829d98e9569c915a9d3c0093a093161
c0e7259f4fb4b262029086c8c60501e0b195920f
refs/heads/master
2020-07-06T03:31:17.363521
2016-11-17T20:10:25
2016-11-17T20:10:25
74,061,956
0
0
null
null
null
null
UTF-8
Java
false
false
13,779
java
package com.darkarmy.ykl.vassist; import android.Manifest; import android.content.Intent; import android.content.pm.PackageManager; import android.net.Uri; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.design.widget.BottomSheetBehavior; import android.support.design.widget.CoordinatorLayout; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v4.app.ActivityCompat; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.util.TypedValue; import android.view.View; import android.widget.TextView; import android.widget.Toast; import com.sysad.gr00t.vassist.R; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlPullParserFactory; import java.io.IOException; import java.io.StringReader; import java.util.ArrayList; import java.util.List; import io.realm.Realm; import io.realm.RealmConfiguration; import io.realm.RealmQuery; import io.realm.RealmResults; /** * Created by apple on 13/11/16. */ public class AadharInfo extends AppCompatActivity implements RecyclerViewAdapter.OnItemClickListener { private static final int SCAN_REQ_CODE = 1; private static final int CAMERA_PERM_CODE = 2; private static final String TAG = AadharInfo.class.getName(); private static final String BOTTOM_SHEET_STATE = "bottom_sheet_state"; private static final String LAST_UID = "last_uid"; private List<PrintLetterBarcodeData> mDataList = new ArrayList<>(); private RealmResults<PrintLetterBarcodeData> mRealmResultList; private CoordinatorLayout mLayout; private RecyclerViewAdapter mAdapter; private RecyclerView mReadCardList; private Realm mRealm; private FloatingActionButton mReadCardFAB; private View mBottomSheetView; private BottomSheetBehavior behavior; private int bottomSheetState; private String lastUID; public String cname,cuid; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_aadhar); mRealm = Realm.getInstance(new RealmConfiguration.Builder(AadharInfo.this).build()); mLayout = (CoordinatorLayout) findViewById(R.id.layout); mReadCardList = (RecyclerView) findViewById(R.id.read_card_list); mReadCardFAB = (FloatingActionButton) findViewById(R.id.read_card_fab); mBottomSheetView = mLayout.findViewById(R.id.bottom_sheet_view); behavior = BottomSheetBehavior.from(mBottomSheetView); behavior.setHideable(true); mRealmResultList = mRealm.where(PrintLetterBarcodeData.class).findAll(); mDataList.addAll(mRealmResultList); if (mReadCardList != null) { if (mDataList.size() == 0) { mReadCardList.setVisibility(View.GONE); findViewById(R.id.nothing_text_view).setVisibility(View.VISIBLE); } mAdapter = new RecyclerViewAdapter(getApplicationContext(), mDataList); mAdapter.setOnItemClickListener(this); mReadCardList.setAdapter(mAdapter); mReadCardList.setLayoutManager(new LinearLayoutManager(getApplicationContext())); } if (mReadCardFAB != null) { mReadCardFAB.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (ActivityCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED) { startActivityForResult(new Intent(AadharInfo.this, ScannerActivity.class), SCAN_REQ_CODE); } else { if (ActivityCompat.shouldShowRequestPermissionRationale(AadharInfo.this, Manifest.permission.CAMERA)) { Snackbar.make(mLayout, "Camera Permission Required", Snackbar.LENGTH_INDEFINITE) .setAction(android.R.string.ok, new View.OnClickListener() { @Override public void onClick(View v) { ActivityCompat.requestPermissions(AadharInfo.this, new String[]{Manifest.permission.CAMERA}, CAMERA_PERM_CODE); } }).show(); } else ActivityCompat.requestPermissions(AadharInfo.this, new String[]{Manifest.permission.CAMERA}, CAMERA_PERM_CODE); } } }); } } @Override protected void onResume() { super.onResume(); behavior.setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() { @Override public void onStateChanged(@NonNull View bottomSheet, int newState) { bottomSheetState = newState; if (newState == BottomSheetBehavior.STATE_COLLAPSED) { bottomSheet.setVisibility(View.GONE); mReadCardFAB.show(); behavior.setState(BottomSheetBehavior.STATE_HIDDEN); } } @Override public void onSlide(@NonNull View bottomSheet, float slideOffset) { } }); } @Override protected void onSaveInstanceState(Bundle outState) { outState.putInt(BOTTOM_SHEET_STATE, bottomSheetState); outState.putString(LAST_UID, lastUID); super.onSaveInstanceState(outState); } @Override protected void onRestoreInstanceState(Bundle savedInstanceState) { bottomSheetState = savedInstanceState.getInt(BOTTOM_SHEET_STATE); if (bottomSheetState == BottomSheetBehavior.STATE_COLLAPSED) { mReadCardFAB.show(); mBottomSheetView.setVisibility(View.GONE); behavior.setState(BottomSheetBehavior.STATE_HIDDEN); } else { lastUID = savedInstanceState.getString(LAST_UID); if (lastUID != null) { PrintLetterBarcodeData item = mRealm.where(PrintLetterBarcodeData.class).contains("uid", lastUID).findFirst(); mReadCardFAB.hide(); setBottomSheetData(mBottomSheetView, item); behavior.setState(BottomSheetBehavior.STATE_EXPANDED); mBottomSheetView.setVisibility(View.VISIBLE); } } super.onRestoreInstanceState(savedInstanceState); } @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); if (requestCode == CAMERA_PERM_CODE && grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { startActivityForResult(new Intent(AadharInfo.this, ScannerActivity.class), SCAN_REQ_CODE); } } XmlPullParser myparser; @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (resultCode != RESULT_CANCELED){ if (resultCode == RESULT_OK && requestCode == SCAN_REQ_CODE) { String contents = data.getStringExtra(ScannerActivity.SCAN_CONTENTS); String format = data.getStringExtra(ScannerActivity.SCAN_FORMAT); Log.d(TAG, format); Log.d(TAG, contents); XmlPullParserFactory xmlFactoryObject; try { xmlFactoryObject = XmlPullParserFactory.newInstance(); myparser = xmlFactoryObject.newPullParser(); myparser.setInput(new StringReader(contents)); int event = myparser.getEventType(); while (event != XmlPullParser.END_DOCUMENT) { String name = myparser.getName(); switch (event) { case XmlPullParser.START_TAG: break; case XmlPullParser.END_TAG: if (name.equals("PrintLetterBarcodeData")) { if (!checkIfExists(myparser.getAttributeValue(null, "uid"))) { mRealm.beginTransaction(); PrintLetterBarcodeData barcodeData = mRealm.createObject(PrintLetterBarcodeData.class); cname=myparser.getAttributeValue(null, "name"); cuid=myparser.getAttributeValue(null, "uid"); barcodeData.setUid(myparser.getAttributeValue(null, "uid")); barcodeData.setName(myparser.getAttributeValue(null, "name")); barcodeData.setCo(myparser.getAttributeValue(null, "co")); barcodeData.setDist(myparser.getAttributeValue(null, "dist")); barcodeData.setGender(myparser.getAttributeValue(null, "gender")); barcodeData.setHouse(myparser.getAttributeValue(null, "house")); barcodeData.setLoc(myparser.getAttributeValue(null, "loc")); barcodeData.setPc(myparser.getAttributeValue(null, "pc")); barcodeData.setState(myparser.getAttributeValue(null, "state")); barcodeData.setStreet(myparser.getAttributeValue(null, "street")); barcodeData.setVtc(myparser.getAttributeValue(null, "vtc")); barcodeData.setYob(myparser.getAttributeValue(null, "yob")); mRealm.commitTransaction(); } else Snackbar.make(mLayout, "Card already scanned", Snackbar.LENGTH_SHORT).show(); } break; } event = myparser.next(); } } catch (XmlPullParserException | IOException e) { Snackbar.make(mLayout, "Invalid QR Code", Snackbar.LENGTH_LONG).show(); e.printStackTrace(); } } mDataList.clear(); mRealmResultList = mRealm.where(PrintLetterBarcodeData.class).findAll(); mDataList.addAll(mRealmResultList); mAdapter = new RecyclerViewAdapter(getApplicationContext(), mDataList); mAdapter.setOnItemClickListener(this); mReadCardList.setAdapter(mAdapter); mReadCardList.setVisibility(View.VISIBLE); findViewById(R.id.nothing_text_view).setVisibility(View.GONE); } else Snackbar.make(mLayout, "Unable to scan", Snackbar.LENGTH_SHORT).show(); } public void contactSave(View v){ Toast.makeText(getApplicationContext(),"trying",Toast.LENGTH_SHORT).show(); grantUriPermission("ContactsContract.CommonDataKinds.Phone.CONTENT_URI", Uri.parse("content://com.android.contacts/contacts"), Intent.FLAG_GRANT_WRITE_URI_PERMISSION); Toast.makeText(getApplicationContext(),"error",Toast.LENGTH_SHORT).show(); } public boolean checkIfExists(String uid) { RealmQuery<PrintLetterBarcodeData> query = mRealm.where(PrintLetterBarcodeData.class) .equalTo("uid", uid); return query.count() != 0; } @Override public void onItemClick(PrintLetterBarcodeData item) { if (item != null) { lastUID = item.getUid(); behavior.setState(BottomSheetBehavior.STATE_EXPANDED); mBottomSheetView.setVisibility(View.VISIBLE); mReadCardFAB.hide(); behavior.setHideable(true); TypedValue tv = new TypedValue(); if (getTheme().resolveAttribute(R.attr.actionBarSize, tv, true)) { behavior.setPeekHeight(TypedValue.complexToDimensionPixelSize(tv.data, getResources().getDisplayMetrics())); } setBottomSheetData(mBottomSheetView, item); } } private void setBottomSheetData(View bottomSheetView, PrintLetterBarcodeData item) { TextView uidTextView = (TextView) bottomSheetView.findViewById(R.id.uid_text_view); TextView yobTextView = (TextView) bottomSheetView.findViewById(R.id.yob_text_view); TextView genderTextView = (TextView) bottomSheetView.findViewById(R.id.gender_text_view); TextView addressTextView = (TextView) bottomSheetView.findViewById(R.id.address_text_view); TextView nameTextView = (TextView) bottomSheetView.findViewById(R.id.name_text_view); String address = item.getCo() + ", " + item.getHouse() + ", " + item.getStreet() + ", " + item.getLoc() + ", " + item.getVtc() + ", " + item.getState() + ", " + item.getPc(); uidTextView.setText("UID: " + item.getUid()); yobTextView.setText("Year of Birth: " + item.getYob()); genderTextView.setText("Gender: " + item.getGender()); addressTextView.setText("Address: " + address); nameTextView.setText(item.getName()); } }
[ "abhinavagrawal1995@gmail.com" ]
abhinavagrawal1995@gmail.com
961caca21801437967ecd884e6116faab214794e
722006b1d9539692d6c295e65a048c858a0fc2db
/src/main/java/com/springbook/view/springMVCAnnotation/user/LogoutController.java
ec36626d67761022263eb23ba78956d61dab7bad
[]
no_license
phjppo0918/springQuickStart
d5368e6aaba27dbb3e0478561fa9692d1d420d5a
c049fe12fe0aeefcf2438355757d07a166c76585
refs/heads/master
2022-12-28T22:23:06.327477
2020-04-05T06:02:40
2020-04-05T06:02:40
248,439,883
0
0
null
2022-12-16T07:16:58
2020-03-19T07:39:30
Java
UTF-8
Java
false
false
435
java
package com.springbook.view.springMVCAnnotation.user; import javax.servlet.http.HttpSession; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @Controller public class LogoutController { @RequestMapping("/model2/logout.do") public String logout(HttpSession session) { System.out.println("로그아웃 처리"); session.invalidate(); return "login.jsp"; } }
[ "phjppo0918@kpu.ac.kr" ]
phjppo0918@kpu.ac.kr
9156dd2823fa5aef3d62722729a9b1bb692d37ed
f773ec55c41cbe37cfb046293a01840e2cf02ef2
/ScaffoldingExample-Web/generated/br/com/gigio/dao/TemplateDAOTest.java
c8656203067450ee07fac84b7b2ce4bc5fce49b7
[]
no_license
Ribeiro/skywaybuilder_scaffoldingexample
00664923367bd0989f6b41afaef55950610d20dc
c18c57fd8c7382cafd4426e303e4e1544371e81e
refs/heads/master
2021-01-25T07:19:55.269323
2013-03-22T06:57:47
2013-03-22T06:57:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,503
java
package br.com.gigio.dao; import br.com.gigio.domain.Template; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.TestExecutionListeners; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.DependencyInjectionTestExecutionListener; import org.springframework.test.context.support.DirtiesContextTestExecutionListener; import org.springframework.test.context.transaction.TransactionalTestExecutionListener; import org.springframework.transaction.annotation.Transactional; /** * Class used to test the basic Data Store Functionality * * @generated */ @RunWith(SpringJUnit4ClassRunner.class) @TestExecutionListeners( { DependencyInjectionTestExecutionListener.class, DirtiesContextTestExecutionListener.class, TransactionalTestExecutionListener.class }) @Transactional @ContextConfiguration(locations = { "file:/D:/DEV/Skyway%20Visual%20Perspectives%20CE/workspace/ScaffoldingExample-Web/resources/ScaffoldingExample-generated-domain-context.xml", "file:/D:/DEV/Skyway%20Visual%20Perspectives%20CE/workspace/ScaffoldingExample-Web/resources/ScaffoldingExample-domain-context.xml", "file:/D:/DEV/Skyway%20Visual%20Perspectives%20CE/workspace/ScaffoldingExample-Web/resources/ScaffoldingExample-generated-dao-context.xml", "file:/D:/DEV/Skyway%20Visual%20Perspectives%20CE/workspace/ScaffoldingExample-Web/resources/ScaffoldingExample-dao-context.xml" }) public class TemplateDAOTest { /** * @generated */ private TemplateDAO dataStore; /** * Instantiates a new TemplateDAOJDBCTest. * @generated */ public TemplateDAOTest() { } /** * Method to test Template domain object. * * @generated */ @Rollback(false) @Test public void Template() { Template instance = new Template(); // Test create // TODO: Populate instance for create. The store will fail if the primary key fields are blank. // store the object dataStore.store(instance); // Test update // TODO: Modify non-key domain object values for update // update the object dataStore.store(instance); // Test delete dataStore.remove(instance); } /** * @generated */ @Autowired public void setDataStore(TemplateDAO dataStore) { this.dataStore = dataStore; } }
[ "geovanny.ribeiro@gmail.com" ]
geovanny.ribeiro@gmail.com
390c8abaf8cf6fabaaf52f307dc0afd62b0ee59b
a86d6bb56d864a98dc75ea1e07a50ca789fd2456
/src/main/java/org/jarvis/leave/repository/LeaveSubmissionDetailsRepository.java
7f7dda1b42dde54e2decc274488ac94aae2c42ee
[ "MIT" ]
permissive
romikusumabakti/jarvisleave
8bbbd421165c98f1c0c00ba58e96bc4be69aaf03
cc0889d9091b8ebbb46aa1b8e68fb3a3f729c9a6
refs/heads/main
2023-08-05T13:34:51.664417
2021-09-08T07:11:48
2021-09-08T07:11:48
396,611,154
2
1
null
null
null
null
UTF-8
Java
false
false
537
java
package org.jarvis.leave.repository; import org.jarvis.leave.model.LeaveSubmissionDetails; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Repository; import java.util.List; @Repository public interface LeaveSubmissionDetailsRepository extends JpaRepository<LeaveSubmissionDetails, Long> { @Override @Query("select u from LeaveSubmissionDetails u where u.isDeleted=false") List<LeaveSubmissionDetails> findAll(); }
[ "romikusumab@gmail.com" ]
romikusumab@gmail.com
39ed251667d104effb58c97f1328f50cba1c277c
7826588e64bb04dfb79c8262bad01235eb409b3d
/src/test/java/com/microsoft/bingads/v13/api/test/entities/ad_extension/callout/read/BulkCalloutAdExtensionReadTests.java
7f81516737c33534a3ed69731b92cf7d25cf31cc
[ "MIT" ]
permissive
BingAds/BingAds-Java-SDK
dcd43e5a1beeab0b59c1679da1151d7dd1658d50
a3d904bbf93a0a93d9c117bfff40f6911ad71d2f
refs/heads/main
2023-08-28T13:48:34.535773
2023-08-18T06:41:51
2023-08-18T06:41:51
29,510,248
33
44
NOASSERTION
2023-08-23T01:29:18
2015-01-20T03:40:03
Java
UTF-8
Java
false
false
920
java
package com.microsoft.bingads.v13.api.test.entities.ad_extension.callout.read; import org.junit.runner.RunWith; import org.junit.runners.Suite; import org.junit.runners.Suite.SuiteClasses; @RunWith(Suite.class) @SuiteClasses( { BulkCalloutAdExtensionReadFromRowValuesAccountIdTest.class, BulkCalloutAdExtensionReadFromRowValuesIdTest.class, BulkCalloutAdExtensionReadFromRowValuesStatusTest.class, BulkCalloutAdExtensionReadFromRowValuesVersionTest.class, BulkCalloutAdExtensionReadFromRowValuesTextTest.class, BulkAdGroupCalloutAdExtensionReadFromRowValuesAdGroupNameTest.class, BulkAdGroupCalloutAdExtensionReadFromRowValuesCampaignNameTest.class, BulkCampaignCalloutAdExtensionReadFromRowValuesCampaignNameTest.class } ) public class BulkCalloutAdExtensionReadTests { }
[ "qitia@microsoft.com" ]
qitia@microsoft.com
a872cbfb1d3641f2578addb49e56898492da20c9
f504f24500a7fa649ee115e6ca95b0a9b1daa68e
/MallorcaCore/src/mallorcatour/core/math/RandomVariable.java
9d4dffc5a147615ec92f154a011447987e1bfecd
[]
no_license
gambol/Mallorca
c0d5e2cd283f09866cf7a8ac04ece3b2e8434fa5
84791a17c423667fb6204aaed33630d48351b948
refs/heads/master
2021-01-19T23:32:47.004720
2016-01-26T10:39:35
2016-01-26T10:39:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,351
java
package mallorcatour.core.math; import java.util.ArrayList; import mallorcatour.core.game.Action; import mallorcatour.core.game.interfaces.IGameInfo; import mallorcatour.tools.DoubleUtils; import mallorcatour.tools.Pair; public class RandomVariable extends ArrayList<Pair<Double, Double>> { /** * */ private static final long serialVersionUID = -3513507226067514138L; private Double ev = null; private Double variance = null; public double getEV() { if (ev == null) { ev = calculateEV(this); } return ev; } public double getVariance() { if (variance == null) { variance = calculateVariance(this); } return variance; } private double sum() { double sum = 0; for (Pair<Double, Double> pair : this) { sum += pair.first; } return sum; } public void normalize() { double sum = sum(); for (Pair<Double, Double> pair : this) { pair.first = pair.first / sum; } } public static RandomVariable create(double constant) { RandomVariable result = new RandomVariable(); result.ev = constant; result.variance = 0d; result.add(1d, constant); return result; } public void add(double probability, double value) { add(new Pair<Double, Double>(probability, value)); } public void add(double probability, RandomVariable variable) { for (Pair<Double, Double> pair : variable) { add(new Pair<Double, Double>(probability * pair.first, pair.second)); } } public static double calculateEV(RandomVariable variable) { double result = 0; for (Pair<Double, Double> pair : variable) { result += pair.first * pair.second; } return result; } public void multiply(double value) { for (Pair<Double, Double> pair : this) { pair.first *= value; } } private static double calculateVariance(RandomVariable variable) { double ev = variable.getEV(); double result = 0; for (Pair<Double, Double> pair : variable) { result += pair.first * Math.pow(pair.second - ev, 2); } return Math.sqrt(result); } @Override public String toString() { return "(ev " + DoubleUtils.digitsAfterComma(getEV(), 2) + " var " + DoubleUtils.digitsAfterComma(getVariance(), 2) + " count " + size() + ")"; } public String printProfitability(Action action, double ES, double bb) { // double investment = 0; // if (action.isPassive()) { // investment += action.getAmountToCall(); // } else if (action.isAggressive()) { // investment += action.getAmountToCall(); // investment += action.getAmount(); // } return printProfitability(ES, bb); } public String printProfitability(IGameInfo gameInfo) { return printProfitability(gameInfo.getBankRollAtRisk(), gameInfo.getBigBlindSize()); } public String printProfitability(double heroES, double bb) { StringBuilder builder = new StringBuilder(); builder.append("("); builder.append("EV/BB: "); builder.append(DoubleUtils.digitsAfterComma(getEV() / bb, 2)); builder.append(" EV/Var: "); builder.append(DoubleUtils.digitsAfterComma(getEV() / getVariance(), 2)); builder.append(" Var/BB: "); builder.append(DoubleUtils.digitsAfterComma(getVariance() / bb, 2)); builder.append(" EV: "); builder.append(DoubleUtils.digitsAfterComma(getEV(), 2)); builder.append(" Var: "); builder.append(DoubleUtils.digitsAfterComma(getVariance(), 2)); builder.append(")"); return builder.toString(); } }
[ "andriipanasiuk@gmail.com" ]
andriipanasiuk@gmail.com
7fca480b9dd559739bb0f6ace1dd4e6308967118
d9ea3ae7b2c4e9a586e61aed23e6e997eaa38687
/11.GOF23开发模式/★★★开发模式/工厂模式/A简单工厂模式/Bird.java
029577f451cf989a7a61a446ddd9bddad9357b27
[]
no_license
yuanhaocn/Fu-Zusheng-Java
6e5dcf9ef3d501102af7205bb81674f880352158
ab872bcfe36d985a651a5e12ecb6132ad4d2cb8e
refs/heads/master
2020-05-15T00:20:47.872967
2019-04-16T11:06:18
2019-04-16T11:06:18
null
0
0
null
null
null
null
GB18030
Java
false
false
144
java
package A简单工厂模式; public class Bird extends Animal { @Override public void sleep() { System.out.println("鸟在睡觉"); } }
[ "fuzusheng@gmail.com" ]
fuzusheng@gmail.com
174fc2de8ce4f9e0202c25f80083df0871313562
25e272ef7c5d8f0cba35bec466bf738ed1b04a1d
/src/com/ccjt/ejy/web/controller/back/EHelpController.java
bd5287cbf73025f5b9979f34acb0b883ea58c977
[]
no_license
Mask-Z/pc
e759184a3a81f2e15844a3278bace96557be371b
b0e00bd3e585c9de5dbb6d855ba845d5d19d3af4
refs/heads/master
2021-04-25T19:23:53.791391
2017-11-07T13:44:47
2017-11-07T13:44:47
108,849,956
0
0
null
null
null
null
UTF-8
Java
false
false
5,394
java
package com.ccjt.ejy.web.controller.back; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.text.SimpleDateFormat; import java.util.Arrays; import java.util.Date; import java.util.List; import java.util.Map; import java.util.UUID; import javax.servlet.http.HttpServletRequest; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.multipart.commons.CommonsMultipartFile; import org.springframework.web.servlet.ModelAndView; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.ccjt.ejy.web.commons.cache.DBCacheManage; import com.ccjt.ejy.web.commons.cache.RedisKeys; import com.ccjt.ejy.web.service.back.EHelpService; import com.ccjt.ejy.web.vo.EHelp; import com.ccjt.ejy.web.vo.ProjectType; /** * */ @Controller @RequestMapping("/system") public class EHelpController { private EHelpService ehelpService = new EHelpService(); @RequestMapping(value = "/ehelp_manage") public ModelAndView manage(HttpServletRequest request) throws Exception { ModelAndView mv = new ModelAndView(); mv.setViewName("/back/ehelpmanage"); return mv; } @RequestMapping(value = "/ehelpList") @ResponseBody public Map<String, Object> list(EHelp ehelp, Integer page, Integer rows) throws Exception { Map<String, Object> m = ehelpService.ehelpList(ehelp, page, rows); return m; } /** */ @RequestMapping(value = "/ehelp_add") public ModelAndView ehelp_add(Integer id,HttpServletRequest request) throws Exception { ModelAndView mv = new ModelAndView(); if (id != null) { EHelp ehelp = ehelpService.getEhelp(id); mv.addObject("ehelp", ehelp); mv.addObject("type", "edit"); }else{ mv.addObject("type", "add"); } List<ProjectType> projectTypes = JSON.parseArray(DBCacheManage.get(RedisKeys.WEB_DATA_CACHE_PROJECTTYPE), ProjectType.class); for(int i = projectTypes.size()-1;i >= 0;i--) { ProjectType projectType = projectTypes.get(i); if("ZC".equals(projectType.getItemValue()) || "1".equals(projectType.getItemValue()) || "0".equals(projectType.getItemValue()) || "4".equals(projectType.getItemValue())) { projectTypes.remove(i); } } mv.addObject("projectTypes", projectTypes); mv.setViewName("/back/ehelp_add"); return mv; } @RequestMapping(value = "/ehelp_save", method = RequestMethod.POST) public ModelAndView ehelp_save(EHelp ehelp,HttpServletRequest request,@RequestParam("file") CommonsMultipartFile[] files) throws Exception { String isShow = ehelp.getIsShow(); isShow = isShow == null ? "off" : isShow; if(isShow.equals("on")) { ehelp.setState(1); } else { ehelp.setState(0); } //标题图片保存 String picName = ""; for(int i = 0;i<files.length;i++){ if(!files[i].isEmpty()){ try { String oldnName = files[i].getOriginalFilename(); String suffix = oldnName.substring(oldnName.lastIndexOf("."));//后缀带. String relativePath = new SimpleDateFormat("yyyy/MM/dd").format(new Date()); String newName = UUID.randomUUID().toString()+suffix;//存储用的文件名 picName = relativePath + "/" + newName; String path = request.getSession().getServletContext().getRealPath("upload/") + "/ehelp/" + relativePath + "/"; File file = new File(path); if(!file.exists()){ file.mkdirs(); } File os = new File(path + newName); files[i].transferTo(os); ehelp.setPic(picName); } catch (Exception e) { e.printStackTrace(); System.out.println("上传出错"); } } } ehelpService.saveEhelp(ehelp); ModelAndView mv = new ModelAndView(); mv.addObject("msg", "success"); mv.setViewName("/back/ehelp_add"); return mv; } @RequestMapping(value = "/ehelp_del", method = RequestMethod.POST) @ResponseBody public Map<String, Object> ehelp_del(String[] ids,HttpServletRequest request) throws Exception { Map<String, Object> map = ehelpService.delEhelp(ids); return map; } @RequestMapping(value = "/getCitys") @ResponseBody public JSONArray getCitys(String citys) { JSONArray jsonArray = JSONArray.parseArray(DBCacheManage.get(RedisKeys.WEB_DATA_CACHE_CITY).replace("code", "id") .replace("name", "text").replace("subCity", "children")); if(StringUtils.isNotEmpty(citys)) { JSONArray jsArr = new JSONArray(); List<String> cityList = Arrays.asList(citys.split(",")); for(int i = 0;i < jsonArray.size();i++) { JSONObject jo = (JSONObject)jsonArray.get(i); List<Map<String, Object>> list = (List)jo.get("children"); for(Map map : list) { if(cityList.contains(map.get("id"))) { map.put("checked", true); } } jsArr.add(jo); } return jsArr; } return jsonArray; } }
[ "zhyl9248@gmail.com" ]
zhyl9248@gmail.com
882f630e5d040e7af93c3b94e780490a72f77750
c738c635c8337f31f53ca1350e751dd76d9e3401
/src/test/java/com/mailslurp/models/TestNewInboxForwarderOptionsTest.java
5377c026acbfff6a2dffe0d2bc06a10187c90402
[ "MIT" ]
permissive
mailslurp/mailslurp-client-java
e1f8fa9e3d91092825dfc6566a577d1be3dd5c8b
5fff8afabd783c94c7e99c4ce8fcb8cb8058982c
refs/heads/master
2023-06-24T02:46:29.757016
2023-06-12T23:35:46
2023-06-12T23:35:46
204,670,215
3
2
MIT
2022-05-29T01:44:33
2019-08-27T09:38:50
Java
UTF-8
Java
false
false
2,058
java
/* * MailSlurp API * MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://docs.mailslurp.com/) - [Examples](https://github.com/mailslurp/examples) repository * * The version of the OpenAPI document: 6.5.2 * Contact: contact@mailslurp.dev * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package com.mailslurp.models; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.mailslurp.models.CreateInboxForwarderOptions; import com.mailslurp.models.InboxForwarderTestOptions; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; /** * Model tests for TestNewInboxForwarderOptions */ public class TestNewInboxForwarderOptionsTest { private final TestNewInboxForwarderOptions model = new TestNewInboxForwarderOptions(); /** * Model tests for TestNewInboxForwarderOptions */ @Test public void testTestNewInboxForwarderOptions() { // TODO: test TestNewInboxForwarderOptions } /** * Test the property 'inboxForwarderTestOptions' */ @Test public void inboxForwarderTestOptionsTest() { // TODO: test inboxForwarderTestOptions } /** * Test the property 'createInboxForwarderOptions' */ @Test public void createInboxForwarderOptionsTest() { // TODO: test createInboxForwarderOptions } }
[ "contact@mailslurp.dev" ]
contact@mailslurp.dev
35cb0c897b0fbb30aa9982521fd42bd458a822f9
154db5da64530dd58ebee422d9ca4fd4328c5c50
/src/java/com/school/domain/Subject.java
d9e7b74135ecb78977e77363c3ddeb14e9eb4f02
[]
no_license
thezeeshanasghar/school
0a9e29a156d6634c8201178d8b8e3c39693c6ab9
b7bd368b678612c52d43039ad9c78b20e2e23ea0
refs/heads/master
2020-05-07T19:19:36.170344
2015-03-05T07:29:12
2015-03-05T07:29:12
31,700,745
0
0
null
null
null
null
UTF-8
Java
false
false
1,368
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.school.domain; import com.school.domain.core.Model; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.ManyToMany; /** * * @author Zeeshan */ @Entity public class Subject extends Model implements Serializable { @Column(nullable = false) private String name; private String publisher; @ManyToMany private List<Classs> classs; public Subject() { } //<editor-fold defaultstate="collapsed" desc="SetterGetter"> public String getName() { return name; } public void setName(String name) { this.name = name; } public List<Classs> getClasss() { if (classs == null) { classs = new ArrayList<>(); } return classs; } public void setClasss(List<Classs> classs) { this.classs = classs; } public String getPublisher() { return publisher; } public void setPublisher(String publisher) { this.publisher = publisher; } //</editor-fold> }
[ "asghar.zeeshan@DKNIT035634.ptml.pk" ]
asghar.zeeshan@DKNIT035634.ptml.pk
784bc91a745aef698afea435622d82c39e770154
ebb8758661d33bb1d2d4eb06ccb9add9e1eb124d
/app/src/main/java/huayllani/cripto/comint/ViewArancel.java
4dffbe4cdc19e506e5f6541fbd4b13ca063ac9a4
[]
no_license
alanfernando93/COMINT
37bda457a68961e9ff3f711f819432011a021ad1
d7942a2513a97a778a0971c286376785cf7888d4
refs/heads/master
2020-05-15T02:12:47.953885
2019-05-27T06:44:25
2019-05-27T06:44:25
182,043,872
0
0
null
null
null
null
UTF-8
Java
false
false
2,974
java
package huayllani.cripto.comint; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.ImageButton; import android.widget.TextView; import java.util.ArrayList; public class ViewArancel extends AppCompatActivity { DataBase db = new DataBase(); TextView descripcion, sidunea, ga, nota, capitulo, documento, partida; ArrayList<String[]> data = new ArrayList<String[]>(); ArrayList<String[]> data_capitulo = new ArrayList<String[]>(); ArrayList<String[]> data_document= new ArrayList<String[]>(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_view_arancel); String id = getIntent().getStringExtra("id"); ImageButton atras = (ImageButton) findViewById(R.id.btn_atras); atras.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent search = new Intent(ViewArancel.this, search.class); startActivity(search); } }); ImageButton house= (ImageButton) findViewById(R.id.btn_house); house.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent menu = new Intent(ViewArancel.this, menu.class); startActivity(menu); } }); data = db.getArancelById(id); data_capitulo = db.getCapituloById(data.get(0)[14]); data_document = db.getDocumentById(data.get(0)[15]); descripcion = (TextView) findViewById(R.id.txt_descripcion); sidunea= (TextView) findViewById(R.id.txt_sidunea); ga = (TextView) findViewById(R.id.txt_unidad); nota = (TextView) findViewById(R.id.txt_nota); capitulo = (TextView) findViewById(R.id.txt_capitulo); documento = (TextView) findViewById(R.id.txt_document); partida = (TextView) findViewById(R.id.txt_partida); nota.setText("Vacio"); capitulo.setText("Vacio"); documento.setText("Vacio"); descripcion.setText(data.get(0)[3] == "" ? "Vacio" : data.get(0)[3]); sidunea.setText(data.get(0)[2] == "" ? "Vacio" : data.get(0)[2]); ga.setText(data.get(0)[4] == "" ? "Vacio" : data.get(0)[4]); partida.setText(data.get(0)[1] == "" ? "Vacio" : data.get(0)[1]); if (!data_capitulo.isEmpty()) { capitulo.setText(data_capitulo.get(0)[1] == "" ? "Vacio" : data_capitulo.get(0)[1]); nota.setText(data_capitulo.get(0)[2] == "" ? "Vacio" : data_capitulo.get(0)[2]); } if (!data_document.isEmpty()){ String aux = data_document.get(0)[1] + " " + data_document.get(0)[2] + " " +data_document.get(0)[3]; documento.setText(aux == "" ? "Vacio" : aux); } } }
[ "alanfernando93.am@gmail.com" ]
alanfernando93.am@gmail.com
296d03f91d41ffc66668a2cc39f4a62bd0ee3862
efc4826bbb814f8c50c63ff58416a768d93354a9
/aquality-appium-java-master/src/main/java/aquality/appium/configuration/driversettings/IDriverSettings.java
2ae6a206aec3136b08830ac0900878d8e01d262e
[ "Apache-2.0" ]
permissive
ostroverhov/self-education
3dab01c9fb6e9f42f3c5ed6bead8f98d8c02dd1a
549fe85e8dd5cb855703515baf80a4d31a1d1745
refs/heads/master
2023-02-14T20:11:45.662004
2020-08-27T19:53:05
2020-08-27T19:53:05
249,941,037
0
0
null
2023-01-24T03:44:25
2020-03-25T09:50:15
Java
UTF-8
Java
false
false
401
java
package aquality.appium.configuration.driversettings; import aquality.appium.application.PlatformName; import aquality.selenium.utils.JsonFile; import org.openqa.selenium.Capabilities; public interface IDriverSettings { Capabilities getCapabilities(); PlatformName getPlatformName(); boolean hasApplicationPath(); String getApplicationPath(); JsonFile getSettingsFile(); }
[ "v.ostroverhov@a1qa.com" ]
v.ostroverhov@a1qa.com
c970edf787f092c7134c15a0ade749d444135d81
7962bf90af2fe2a3dfa47d61826bb04027294752
/app/src/main/java/com/dream/lmy/mydream/MainActivity.java
2d63ec34d7e92fcd3c7b853d83694746a0d72986
[]
no_license
THE-PRIDE/MyDream
e83562ac2db8b29f5d76b8ad36a6c852a3e2298f
143cdf4324ff87c603b14a36f00ecce07caaa49c
refs/heads/master
2020-06-15T14:20:15.324466
2019-10-12T02:09:01
2019-10-12T02:09:01
195,321,078
0
0
null
null
null
null
UTF-8
Java
false
false
7,100
java
package com.dream.lmy.mydream; import android.annotation.SuppressLint; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.location.Criteria; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.net.Uri; import android.os.Bundle; import android.os.Environment; import android.provider.MediaStore; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; import com.dream.lmy.mydream.adapter.QueryLocationAdapter; import com.dream.lmy.mydream.common.DeviceParamUtils; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; public class MainActivity extends AppCompatActivity implements View.OnClickListener { private EditText mEtInput; private Button mBtnConfirm; private Button mBtnGetLocation; private RecyclerView mRlyShowData; private ImageView imageview; private List<String> allLocationData; private List<String> queryLocationData; private QueryLocationAdapter queryLocationAdapter; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_qurey_layout); initView(); initData(); initListener(); // DeviceParamUtils.getDeviceParam(this); } void initView() { mEtInput = findViewById(R.id.et_input); mBtnConfirm = findViewById(R.id.btn_confirm); mBtnGetLocation = findViewById(R.id.btn_get_location); mRlyShowData = findViewById(R.id.ryl_local_data); imageview = findViewById(R.id.imageview); } void initData() { allLocationData = new ArrayList<>(); queryLocationData = new ArrayList<>(); try { readTextFile(Environment.getExternalStorageDirectory() + "/地址列表.txt"); } catch (IOException e) { e.printStackTrace(); } RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this); mRlyShowData.setLayoutManager(layoutManager); queryLocationAdapter = new QueryLocationAdapter(allLocationData); mRlyShowData.setAdapter(queryLocationAdapter); } void initListener() { mBtnConfirm.setOnClickListener(this); mBtnGetLocation.setOnClickListener(this); } @Override public void onClick(View v) { switch (v.getId()) { case R.id.btn_confirm: queryDimData(); break; case R.id.btn_get_location: Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(intent,1); // getLocation(); break; } } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); Uri uri = data.getData(); Bundle bundle = data.getExtras(); Bitmap bitmap = (Bitmap) bundle.get("data"); imageview.setImageBitmap(bitmap); } private void queryDimData() { queryLocationData.clear(); String inputData = mEtInput.getText().toString().trim(); for (String data : allLocationData) { String subData; if (!"".equals(data.trim()) && data.contains("--")) { subData = data.substring(0, data.indexOf("--")).trim(); if (subData.contains(inputData) || inputData.contains(subData)) { queryLocationData.add(data); } } } if ("".equals(inputData.trim())){ queryLocationAdapter.notifyListUpdate(allLocationData); } else { queryLocationAdapter.notifyListUpdate(queryLocationData); } mRlyShowData.setAdapter(queryLocationAdapter); } /** * 获取位置信息 */ @SuppressLint("MissingPermission") private void getLocation() { LocationListener locationListener; LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); Location location; String provider; Criteria criteria = new Criteria(); criteria.setAccuracy(Criteria.ACCURACY_FINE);//高精度 criteria.setAltitudeRequired(false);//不要求海拔 criteria.setBearingRequired(false);//不要求方位 criteria.setCostAllowed(true);//允许有花费 criteria.setPowerRequirement(Criteria.POWER_LOW);//低功耗 //从可用的位置提供器中,匹配以上标准的最佳提供器 provider = locationManager.getBestProvider(criteria, true); //获得最后一次变化的位置 location = locationManager.getLastKnownLocation(provider); double lat = location.getLatitude(); double lon = location.getLongitude(); Log.e("TEST", "lat:" + lat); Log.e("TEST", "lon:" + lon); locationListener = new LocationListener() { @Override public void onLocationChanged(Location location) { double lat = location.getLatitude(); double lon = location.getLongitude(); Log.e("TEST", "lat--listener:" + lat); Log.e("TEST", "lon--listener:" + lon); } @Override public void onStatusChanged(String provider, int status, Bundle extras) { } @Override public void onProviderEnabled(String provider) { } @Override public void onProviderDisabled(String provider) { } }; locationManager.requestLocationUpdates(provider, 2000, 10, locationListener); } /** * 读取本地Text文件 * * @param filePath 本地Text文件路径 */ private void readTextFile(String filePath) throws IOException { // String encoding = "GBK"; String encoding = "UTF-8"; StringBuilder stringBuilder = new StringBuilder(); File file = new File(filePath); if (file.isFile() && file.exists()) { InputStreamReader reader = new InputStreamReader(new FileInputStream(file), encoding); BufferedReader bufferedReader = new BufferedReader(reader); String lineText; while ((lineText = bufferedReader.readLine()) != null) { stringBuilder.append(lineText); if (!"".equals(lineText.trim())) { allLocationData.add(lineText); } } reader.close(); } } }
[ "947318954@qq.com" ]
947318954@qq.com
edb6b9eae59040c1c5615c2bd2fcaaba53aeaac3
b0e9cfd6b19fbeb2048c85b6793671eab34d0e83
/app/src/main/java/com/ponomarevss/myweatherapp/ui/history/HistoryItem.java
16a505b0b349d1afb995977a199185250f1360cd
[]
no_license
ponomarevss/MyWeatherAppA2L5
0369d70e71165b8292553931eebd56f2e07415be
fdb73ff0cd9131934ca72af2a8250161cf538b48
refs/heads/master
2022-11-27T22:26:17.131058
2020-06-29T12:39:30
2020-06-29T12:39:30
275,819,040
0
0
null
2020-07-07T08:52:02
2020-06-29T13:11:37
Java
UTF-8
Java
false
false
490
java
package com.ponomarevss.myweatherapp.ui.history; import java.util.Random; public class HistoryItem { private String place; private int temperature; public HistoryItem(String place) { this.place = place; temperature = new Random().nextInt(15) + 15; // случайная температура в пределах 15 - 29 } public String getPlace() { return place; } public int getTemperature() { return temperature; } }
[ "s-siberia@yandex.ru" ]
s-siberia@yandex.ru
d6a996058e117b39e41a15dc528e28cef481dd13
c33bca85956290fd702a6a96ccf5a5f5305e3380
/src/main/java/org/talend/kickoff/faro2017/configuration/DeltaspikeMicroConfigSource.java
db5343b897141e0250131a89dcc856e5bbcee21e
[]
no_license
rmannibucau/asfee-faro-2017
6f00de29aafb600a25b5964026fc0772fb5156e0
0d7b8f880d00853dca1c56f6b0b4ec7d27426838
refs/heads/master
2021-07-10T11:48:08.907643
2017-10-05T15:25:57
2017-10-05T15:25:57
105,904,724
0
1
null
null
null
null
UTF-8
Java
false
false
876
java
package org.talend.kickoff.faro2017.configuration; import java.util.Map; import org.apache.deltaspike.core.spi.config.ConfigSource; // ensure internal deltaspike config can reuse the app config (useful for scheduling/jpa modules) public class DeltaspikeMicroConfigSource implements ConfigSource { private final KickoffConfigurationSource delegate = new KickoffConfigurationSource(); @Override public Map<String, String> getProperties() { return delegate.getProperties(); } @Override public String getPropertyValue(final String key) { return delegate.getValue(key); } @Override public String getConfigName() { return delegate.getName(); } @Override public int getOrdinal() { return delegate.getOrdinal(); } @Override public boolean isScannable() { return true; } }
[ "rmannibucau@gmail.com" ]
rmannibucau@gmail.com
c9f0e6856e6c9b2c8f5f8e037589c5bbcc8e58b1
ae6a3f6a9808456c0cd2e1bc764c41605a42e6a0
/src/main/java/net/marfgamer/jraknet/client/RakNetClientListener.java
f7ccd6fb80e3b8bd5de157d861ba9e24c7298ae8
[ "MIT" ]
permissive
TangDynasty06/JRakNet-1
5bd527a73fc2f74993ce9034e3b944a2563e7215
d78acd9a32bfc6d8b36570e8b33c9be3c5fb53ac
refs/heads/master
2021-01-19T09:23:52.123267
2017-01-21T17:37:58
2017-01-21T17:37:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,922
java
/* * _ _____ _ _ _ _ * | | | __ \ | | | \ | | | | * | | | |__) | __ _ | | __ | \| | ___ | |_ * _ | | | _ / / _` | | |/ / | . ` | / _ \ | __| * | |__| | | | \ \ | (_| | | < | |\ | | __/ | |_ * \____/ |_| \_\ \__,_| |_|\_\ |_| \_| \___| \__| * * The MIT License (MIT) * * Copyright (c) 2016, 2017 MarfGamer * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ package net.marfgamer.jraknet.client; import java.net.InetSocketAddress; import net.marfgamer.jraknet.RakNetPacket; import net.marfgamer.jraknet.identifier.Identifier; import net.marfgamer.jraknet.protocol.Reliability; import net.marfgamer.jraknet.protocol.message.acknowledge.Record; import net.marfgamer.jraknet.session.RakNetServerSession; /** * This interface is used by the client to let the user know when specific * events are triggered <br> * <br> * Note: Do <b>NOT</b> use <code>Thread.sleep(long)</code> in any of these * methods, as it will cause the client to timeout * * @author MarfGamer */ public interface RakNetClientListener { /** * Called when a server is discovered on the local network * * @param address * The address of the server * @param identifier * The identifier of the server */ public default void onServerDiscovered(InetSocketAddress address, Identifier identifier) { } /** * Called when the identifier of an already discovered server changes * * @param address * The address of the server * @param identifier * The new identifier */ public default void onServerIdentifierUpdate(InetSocketAddress address, Identifier identifier) { } /** * Called when a previously discovered server has been forgotten by the * client * * @param address * The address of the server */ public default void onServerForgotten(InetSocketAddress address) { } /** * Called when an external server is added to the client's external server * list * * @param address * The address of the server */ public default void onExternalServerAdded(InetSocketAddress address) { } /** * Called when the identifier of an external server changes * * @param address * The address of the server * @param identifier * The new identifier */ public default void onExternalServerIdentifierUpdate(InetSocketAddress address, Identifier identifier) { } /** * Called when an external server is removed from the client's external * server list * * @param address * The address of the server */ public default void onExternalServerRemoved(InetSocketAddress address) { } /** * Called when the client successfully connects to a server * * @param session * The session assigned to the server */ public default void onConnect(RakNetServerSession session) { } /** * Called when the client disconnects from the server * * @param session * The server the client disconnected from * @param reason * The reason for disconnection */ public default void onDisconnect(RakNetServerSession session, String reason) { } /** * Called when a message sent with _REQUIRES_ACK_RECEIPT is received by the * server * * @param session * The server that received the packet * @param record * The record of the packet * @param reliability * The reliability of the packet * @param channel * The channel of the packet * @param packet * The received packet */ public default void onAcknowledge(RakNetServerSession session, Record record, Reliability reliability, int channel, RakNetPacket packet) { } /** * Called when a message sent with _REQUIRES_ACK_RECEIPT is not received by * the server * * @param session * The server that lost the packet * @param record * The record of the packet * @param reliability * The reliability of the packet * @param channel * The channel of the packet * @param packet * The lost packet */ public default void onNotAcknowledge(RakNetServerSession session, Record record, Reliability reliability, int channel, RakNetPacket packet) { } /** * Called whenever the client is afraid an error will occur but is not * absolutely positive one will occur * * @param warning * The warning */ public default void onWarning(Warning warning) { } /** * Called when a handler exception has occurred, these normally do not * matter as long as it does not come the address of the server the client * is connecting or is connected to * * @param address * The address that caused the exception * @param throwable * The throwable exception that was caught */ public default void onHandlerException(InetSocketAddress address, Throwable throwable) { throwable.printStackTrace(); } /** * Called when a packet has been received from the server and is ready to be * handled * * @param session * The server that sent the packet * @param packet * The packet received from the server * @param channel * The channel the packet was sent on */ public default void handlePacket(RakNetServerSession session, RakNetPacket packet, int channel) { } /** * Called when an exception is caught in the external thread the client is * running on, this method is only called when the client is started through * <code>connectThreaded()</code> * * @param throwable * The throwable exception that was caught */ public default void onThreadException(Throwable throwable) { throwable.printStackTrace(); } }
[ "trent0308@live.com" ]
trent0308@live.com
4fcf6ef8f38d2004e8d34df84447dbfbfef50d33
5e67460e491ea264d0e9fbe98100165d0356ba2f
/src/main/java/study/oop/A.java
67f2968241428016aa7371a7906b3219acdc0a07
[]
no_license
ajiu775/javastudy
8c007c8eb797da00a6ef5636233300c637f9a3c5
23e1ad47ace5df540d582e71b5b2e9dbc32b859c
refs/heads/master
2022-08-16T19:10:36.142785
2022-03-19T14:52:22
2022-03-19T14:52:22
210,105,291
1
1
null
2022-06-21T04:25:20
2019-09-22T07:07:05
Java
UTF-8
Java
false
false
154
java
package study.oop; /** * @program: javastudy * @description: * @author: Allen * @create: 2020-09-24 09:28 **/ public interface A { int x =0; }
[ "shiqunxing@shiqundeMacBook-Pro.local" ]
shiqunxing@shiqundeMacBook-Pro.local
6edb25b1153391e076ba711aa0f27bd79c1a6d99
6906ea68d9c57417c942874cafd3942a9a402fce
/TrabalhoWeb - Restaurante Universitario/src/java/modelo/InformacoesNutricionais.java
f22ff8e7339a3f4158f277b3f4ae7387dd5a65b6
[]
no_license
MatheusHoudin/Refeitorio-Universitario-Web
f4feb9457e4afec01d1e9ba5d4522909f6763865
6426c25ae71843826586080cdae24ba80eb5a0b6
refs/heads/master
2021-04-12T01:45:50.807945
2018-06-11T22:39:01
2018-06-11T22:39:01
125,894,000
0
1
null
2018-06-11T22:36:45
2018-03-19T17:15:32
HTML
UTF-8
Java
false
false
2,168
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 modelo; import modelo.bean.InformacoesNutricionaisBean; /** * * @author mathe */ public class InformacoesNutricionais { private int ID; private Double porcaoGramas; private Double quantidadeProteinas; private Boolean comidaLactosa; private Double quantidadeLipidio; public InformacoesNutricionais(){ super(); } public InformacoesNutricionais(InformacoesNutricionaisBean infoNutri) { this.setPorcaoGramas(infoNutri.getPorcaoGramas()); this.setQuantidadeProteinas(infoNutri.getQuantidadeProteinas()); this.setComidaLactosa(infoNutri.getLactosa()); this.setQuantidadeLipidio(infoNutri.getLipidios()); this.setID(infoNutri.getId()); } public Double getPorcaoGramas() { return porcaoGramas; } public void setPorcaoGramas(Double porcaoGramas) { this.porcaoGramas = porcaoGramas; } public Double getQuantidadeProteinas() { return quantidadeProteinas; } public void setQuantidadeProteinas(Double quantidadeProteinas) { this.quantidadeProteinas = quantidadeProteinas; } public Boolean getComidaLactosa() { return comidaLactosa; } public void setComidaLactosa(Boolean comidaLactosa) { this.comidaLactosa = comidaLactosa; } public Double getQuantidadeSodio() { return quantidadeLipidio; } public void setQuantidadeLipidio(Double quantidadeLipidio) { if (quantidadeLipidio>0) { this.quantidadeLipidio = quantidadeLipidio; } } public int getID() { return ID; } private void setID(int ID) { this.ID = ID; } @Override public String toString() { return "InformacoesNutricionais{" + "ID=" + ID + ", porcaoGramas=" + porcaoGramas + ", quantidadeProteinas=" + quantidadeProteinas + ", comidaLactosa=" + comidaLactosa + ", quantidadeLipidio=" + quantidadeLipidio + '}'; } }
[ "32970550+MatheusHoudin@users.noreply.github.com" ]
32970550+MatheusHoudin@users.noreply.github.com
4306e10e64b9495e95c6f07bb30846f437a29e3d
29254c31c0b2188e4e67e40da8a081e6d89354d0
/src/lobos/andrew/UDPChat/UDPChat.java
0fcbad970fbfa0cec24a4f183238f10267816d41
[]
no_license
4ndr3w/UDPChat
f46311ca6f0f689f42ac2046fddeac015517cbf6
c4d31f09225d0a494e8be8ddaa74d0dc7e341756
refs/heads/master
2021-01-23T09:30:32.486426
2012-11-07T19:09:00
2012-11-07T19:09:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,774
java
package lobos.andrew.UDPChat; import java.io.IOException; import java.net.Socket; import java.net.SocketException; import lobos.andrew.UDPChat.ClientList.ClientListSelectorReceiver; import lobos.andrew.UDPChat.InterfaceSelect.InterfaceSelector; import lobos.andrew.UDPChat.InterfaceSelect.InterfaceSelectorReceiver; import lobos.andrew.UDPChat.Messaging.ChatGUI; import lobos.andrew.UDPChat.Messaging.IncomingHandler; import lobos.andrew.UDPChat.Messaging.IncomingListener; import lobos.andrew.UDPChat.UsernameSelect.UsernameSelector; import lobos.andrew.UDPChat.UsernameSelect.UsernameSelectorReceiver; public class UDPChat implements UsernameSelectorReceiver,InterfaceSelectorReceiver,ClientListSelectorReceiver,IncomingHandler { String interfaceName; String username; private static UDPChat instance = null; public static UDPChat getInstance() { return instance; } public UDPChat() throws SocketException { new InterfaceSelector(this); new IncomingListener(this); } @Override public void selectInterface(String interfaceName) { this.interfaceName = interfaceName; new UsernameSelector(this); } @Override public void getUsernameFromUI(String username) { this.username = username; ClientFinder.init(username, interfaceName); } public static void main(String[] args) throws SocketException { instance = new UDPChat(); } @Override public void connectToClient(DiscoveredClient client) { try { new ChatGUI(client); } catch (IOException e) { System.out.println("Failed to connect!"); e.printStackTrace(); } } @Override public void handleNewConnection(Socket client) { try { new ChatGUI(client); } catch (IOException e) { System.out.println("Failed to connect!"); e.printStackTrace(); } } }
[ "andrew@lobos.me" ]
andrew@lobos.me
54d14323554b5a3ef48a8967cfc872c9ab0ce89a
39d726e3aa51482fe0b3fad24763de9feaa05d64
/src/main/java/com/codegym/cms/service/CustomerService.java
c2e15d06b76201bb7aa76f5ada42d3d395fb73d7
[]
no_license
Gin641/customer_province
8f4dc6b36aa84f5bb0a183ba91ef79a0658ebc78
acf5446843890340e36421e287b41b8267a850be
refs/heads/master
2022-11-16T06:48:15.153052
2020-07-14T04:42:43
2020-07-14T04:42:43
279,269,148
0
0
null
null
null
null
UTF-8
Java
false
false
531
java
package com.codegym.cms.service; import com.codegym.cms.model.Customer; import com.codegym.cms.model.Province; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; public interface CustomerService { Page<Customer> findAll(Pageable pageable); Customer findById(Long id); void save(Customer customer); void remove(Long id); Iterable<Customer> findAllByProvince(Province province); Page<Customer> findAllByFirstNameContaining(String firstname, Pageable pageable); }
[ "53481351+Gin641@users.noreply.github.com" ]
53481351+Gin641@users.noreply.github.com
c80f5462b239d6d58e280484a2fdbd17b1ac7b5a
b4f09af13756163c8e821ae72cee90c25a690879
/mybatis/src/main/java/com/laozhuang/mybatis/config/Swagger2.java
41bf4f42203671ecd2bc2d322abb0568b539213b
[]
no_license
xiaohualv/my_springboot
bddd39eff05b50e034de4daec3ed95b3344fde22
6f63c0db21b83846b86fc2c28098837bdd129315
refs/heads/master
2020-04-24T02:58:32.892955
2019-03-12T09:07:42
2019-03-12T09:07:42
171,655,886
0
0
null
null
null
null
UTF-8
Java
false
false
1,229
java
package com.laozhuang.mybatis.config; import springfox.documentation.builders.ApiInfoBuilder; import springfox.documentation.builders.PathSelectors; import springfox.documentation.builders.RequestHandlerSelectors; import springfox.documentation.service.ApiInfo; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spring.web.plugins.Docket; /** * @program: my_springboot * @description:Swagger2配置类 * @author: Mr.Zhuang * @create: 2019-03-08 15:39 **/ //@Configuration //@EnableSwagger2 public class Swagger2 { public Docket createRestApi(){ return new Docket(DocumentationType.SWAGGER_2) .apiInfo(apiInfo()) .select() .apis(RequestHandlerSelectors.basePackage("com.laozhuang.mybatis")) .paths(PathSelectors.any()) .build(); } private ApiInfo apiInfo() { return new ApiInfoBuilder() .title("Spring Boot中使用Swagger2构建RESTful APIs") .description("你是骏马,是骏马呦") .termsOfServiceUrl("http:www.baidu.com") .contact("喂马") .version("1.0") .build(); } }
[ "truelovejava@outlook.com" ]
truelovejava@outlook.com
d20ceec15e8cae3da761fc9b928e6da5e401f12b
73f8f019d9b407d43a2e58c0c1c77b0a770bcfdc
/Exhaustive search and Coordinate Search/src/q3_7.java
2c6a3935d239f044f330506f5c8de6eeba0066bb
[]
no_license
Deepaknkumar/Derivative-Free-Optimization
897312e28f0cc05c9c1107742b462005193cd8dc
1140e0ca716aa9d2e6d203a20950b88fffc3eb57
refs/heads/master
2021-01-11T17:53:15.318440
2017-04-06T22:40:42
2017-04-06T22:40:42
79,860,325
3
0
null
null
null
null
UTF-8
Java
false
false
1,148
java
/** * Created by Deepak Kumar on 23/01/2017. */ public class q3_7 { public static void main(String[] args){ CoordinateSearch cs = new CoordinateSearch(); cs.completePolling(); cs.opportunisticPolling(); cs.dynamicPolling(); FuncEval[] comMinData = cs.comPollMinData; System.out.println("Complete Polling results....."); for(int i=0;i<comMinData.length;i++){ System.out.println(comMinData[i].point.x +"," + comMinData[i].point.y + "," + comMinData[i].functionValue); } System.out.println("\nOpportunistic polling results....."); FuncEval[] oppMinData = cs.oppPollMinData; for(int i=0;i<oppMinData.length;i++){ System.out.println(oppMinData[i].point.x + "," + oppMinData[i].point.y + "," + oppMinData[i].functionValue); } System.out.println("\nDynamic polling results....."); FuncEval[] dynMinData = cs.DynPollMinData; for(int i=0;i<dynMinData.length;i++){ System.out.println(dynMinData[i].point.x + "," + dynMinData[i].point.y + "," + dynMinData[i].functionValue); } } }
[ "Deepak.n.sonukumar@gmail.com" ]
Deepak.n.sonukumar@gmail.com
4dfa2397e467c41dbedf570d5def648198a1d685
af8595ed0a953c8f064f26ff1091ac2b53c3025a
/src/main/java/com/soecode/xfshxzs/po/one/Music.java
b35b5c21cb380be4ffc72ea20225ecb6fd83c3e6
[ "MIT" ]
permissive
xiongxiong001/xfshxzs
f43d54cd7f43fdff23a36b8001fbff382c58d1dc
f46b353c44a1022c069cd2c20a0eeca8867c3cec
refs/heads/master
2020-05-30T13:34:18.101805
2018-06-07T07:43:10
2018-06-07T07:43:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,011
java
package com.soecode.xfshxzs.po.one; /** * 音乐实体 */ public class Music { // 音乐ID private String id; // 音乐名称 private String title; // 封面URL private String cover; // WEB地址 private String web_url; // 作者信息 private String author; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getCover() { return cover; } public void setCover(String cover) { this.cover = cover; } public String getWeb_url() { return web_url; } public void setWeb_url(String web_url) { this.web_url = web_url; } public String getAuthor() { return author; } public void setAuthor(String author) { this.author = author; } @Override public String toString() { return "Music [id=" + id + ", title=" + title + ", cover=" + cover + ", web_url=" + web_url + ", author=" + author + "]"; } }
[ "598535550@qq.com" ]
598535550@qq.com
22ee32f73528537165447e663860615443cc1a15
d30a7954c377d49dc7077cbd49eeed055cab084a
/Exam/src/main/java/com/thinkitive/model/Exam.java
3a603d7529064719785e311afacc6eb372c62d2a
[]
no_license
rawwkush/SpringProject
02170771bd2c904ee33071e7a5fda6aad33bb937
c6be2644c4be7b8a3f1ed6d01b89170b7ad34ca1
refs/heads/master
2023-03-09T00:16:15.891858
2021-02-18T13:22:09
2021-02-18T13:22:09
337,718,229
0
0
null
null
null
null
UTF-8
Java
false
false
1,372
java
package com.thinkitive.model; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name="exam") public class Exam { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private int id; private String subject; private int quesid; public Exam(int id, String subject, int quesid) { super(); this.id = id; this.subject = subject; this.quesid = quesid; } public Exam() { super(); } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getSubject() { return subject; } public void setSubject(String subject) { this.subject = subject; } public int getQuesid() { return quesid; } public void setQuesid(int quesid) { this.quesid = quesid; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + id; return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Exam other = (Exam) obj; if (id != other.id) return false; return true; } @Override public String toString() { return "Exam [id=" + id + ", subject=" + subject + ", quesid=" + quesid + "]"; } }
[ "ankush.rawat@thinkitive.com" ]
ankush.rawat@thinkitive.com
0b44ca5bc6dccdd225638eb5a53535b2f6758ad2
d503936064db696bb6296f0ebbda6f0aefdaaba9
/platforms/android/app/build/generated/source/r/debug/android/support/compat/R.java
843bb506e0df67278f10b7e91d8e7f338c0e43b1
[ "MIT" ]
permissive
tinchoas19/userEstaReservado
e3abd10ebce381595d94d926065fefcf1bee7bbb
04bcec36c533a843c10de0c2176abb9797aaca99
refs/heads/master
2022-12-12T18:36:37.929848
2019-11-28T16:05:00
2019-11-28T16:05:00
193,725,186
0
0
MIT
2022-12-10T20:11:00
2019-06-25T14:35:10
JavaScript
UTF-8
Java
false
false
7,919
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * gradle plugin from the resource data it found. It * should not be modified by hand. */ package android.support.compat; public final class R { public static final class attr { public static final int font = 0x7f020087; public static final int fontProviderAuthority = 0x7f020089; public static final int fontProviderCerts = 0x7f02008a; public static final int fontProviderFetchStrategy = 0x7f02008b; public static final int fontProviderFetchTimeout = 0x7f02008c; public static final int fontProviderPackage = 0x7f02008d; public static final int fontProviderQuery = 0x7f02008e; public static final int fontStyle = 0x7f02008f; public static final int fontWeight = 0x7f020090; } public static final class bool { public static final int abc_action_bar_embed_tabs = 0x7f030000; } public static final class color { public static final int notification_action_color_filter = 0x7f040058; public static final int notification_icon_bg_color = 0x7f040059; public static final int ripple_material_light = 0x7f040064; public static final int secondary_text_default_material_light = 0x7f040066; } public static final class dimen { public static final int compat_button_inset_horizontal_material = 0x7f05005d; public static final int compat_button_inset_vertical_material = 0x7f05005e; public static final int compat_button_padding_horizontal_material = 0x7f05005f; public static final int compat_button_padding_vertical_material = 0x7f050060; public static final int compat_control_corner_material = 0x7f050061; public static final int notification_action_icon_size = 0x7f05006c; public static final int notification_action_text_size = 0x7f05006d; public static final int notification_big_circle_margin = 0x7f05006e; public static final int notification_content_margin_start = 0x7f05006f; public static final int notification_large_icon_height = 0x7f050070; public static final int notification_large_icon_width = 0x7f050071; public static final int notification_main_column_padding_top = 0x7f050072; public static final int notification_media_narrow_margin = 0x7f050073; public static final int notification_right_icon_size = 0x7f050074; public static final int notification_right_side_padding_top = 0x7f050075; public static final int notification_small_icon_background_padding = 0x7f050076; public static final int notification_small_icon_size_as_large = 0x7f050077; public static final int notification_subtext_size = 0x7f050078; public static final int notification_top_pad = 0x7f050079; public static final int notification_top_pad_large_text = 0x7f05007a; } public static final class drawable { public static final int notification_action_background = 0x7f060089; public static final int notification_bg = 0x7f06008a; public static final int notification_bg_low = 0x7f06008b; public static final int notification_bg_low_normal = 0x7f06008c; public static final int notification_bg_low_pressed = 0x7f06008d; public static final int notification_bg_normal = 0x7f06008e; public static final int notification_bg_normal_pressed = 0x7f06008f; public static final int notification_icon_background = 0x7f060090; public static final int notification_template_icon_bg = 0x7f060091; public static final int notification_template_icon_low_bg = 0x7f060092; public static final int notification_tile_bg = 0x7f060093; public static final int notify_panel_notification_icon_bg = 0x7f060094; } public static final class id { public static final int action_container = 0x7f07000e; public static final int action_divider = 0x7f070010; public static final int action_image = 0x7f070011; public static final int action_text = 0x7f070017; public static final int actions = 0x7f07001c; public static final int async = 0x7f070021; public static final int blocking = 0x7f070024; public static final int chronometer = 0x7f070030; public static final int forever = 0x7f07004b; public static final int icon = 0x7f07004f; public static final int icon_group = 0x7f070050; public static final int info = 0x7f070053; public static final int italic = 0x7f070055; public static final int line1 = 0x7f070058; public static final int line3 = 0x7f070059; public static final int normal = 0x7f070064; public static final int notification_background = 0x7f070065; public static final int notification_main_column = 0x7f070066; public static final int notification_main_column_container = 0x7f070067; public static final int right_icon = 0x7f070070; public static final int right_side = 0x7f070071; public static final int tag_transition_group = 0x7f070090; public static final int text = 0x7f070091; public static final int text2 = 0x7f070092; public static final int time = 0x7f070095; public static final int title = 0x7f070096; } public static final class integer { public static final int status_bar_notification_info_maxnum = 0x7f080004; } public static final class layout { public static final int notification_action = 0x7f09002b; public static final int notification_action_tombstone = 0x7f09002c; public static final int notification_template_custom_big = 0x7f090033; public static final int notification_template_icon_group = 0x7f090034; public static final int notification_template_part_chronometer = 0x7f090038; public static final int notification_template_part_time = 0x7f090039; } public static final class string { public static final int status_bar_notification_info_overflow = 0x7f0b0048; } public static final class style { public static final int TextAppearance_Compat_Notification = 0x7f0c0108; public static final int TextAppearance_Compat_Notification_Info = 0x7f0c0109; public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0c010b; public static final int TextAppearance_Compat_Notification_Time = 0x7f0c010e; public static final int TextAppearance_Compat_Notification_Title = 0x7f0c0110; public static final int Widget_Compat_NotificationActionContainer = 0x7f0c0179; public static final int Widget_Compat_NotificationActionText = 0x7f0c017a; } public static final class styleable { public static final int[] FontFamily = { 0x7f020089, 0x7f02008a, 0x7f02008b, 0x7f02008c, 0x7f02008d, 0x7f02008e }; public static final int FontFamily_fontProviderAuthority = 0; public static final int FontFamily_fontProviderCerts = 1; public static final int FontFamily_fontProviderFetchStrategy = 2; public static final int FontFamily_fontProviderFetchTimeout = 3; public static final int FontFamily_fontProviderPackage = 4; public static final int FontFamily_fontProviderQuery = 5; public static final int[] FontFamilyFont = { 0x01010532, 0x01010533, 0x0101053f, 0x7f020087, 0x7f02008f, 0x7f020090 }; public static final int FontFamilyFont_android_font = 0; public static final int FontFamilyFont_android_fontWeight = 1; public static final int FontFamilyFont_android_fontStyle = 2; public static final int FontFamilyFont_font = 3; public static final int FontFamilyFont_fontStyle = 4; public static final int FontFamilyFont_fontWeight = 5; } }
[ "ruizgerezr@gmail.com" ]
ruizgerezr@gmail.com
88f43f1ef39b8a7de0d7ab911d7d7c1e1480ed4f
5ef0ae29521b42df5ecbfeb94f11ae41b2d4eb13
/app/src/test/java/com/example/a14143/wave/ExampleUnitTest.java
5f6a8c2ebac162f7cda52d170edf58e219593d64
[]
no_license
drchengit/WaveView
206011000a4afc15e8c2671f4adf361c567c7ead
e3de23022a821dfb394c0b80f49087cfbe77ebc2
refs/heads/master
2020-05-16T17:24:47.933804
2019-10-02T00:39:15
2019-10-02T00:39:15
183,194,626
2
1
null
null
null
null
UTF-8
Java
false
false
384
java
package com.example.a14143.wave; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
[ "1414355045@qq.com" ]
1414355045@qq.com
2cffee5f698d72c6f81380bc16f6e06b36475115
b66fa22f785d8ff9ac7f0c0f7778b2b71300af5f
/gkPlatform/src/main/java/cn/gukeer/platform/persistence/dao/A_TeachCycleExtentionMapper.java
4e147f789ae57317a5da8b25147cf19993f2f179
[]
no_license
sengeiou/learn_java
fdc1ba3add9fa7b868f589b4bff4359855517672
0bf43086d9b4d3ffdfc69f5f1ddac0e0050125fc
refs/heads/master
2023-05-01T07:51:13.187122
2021-04-07T11:04:22
2021-04-07T11:04:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
417
java
package cn.gukeer.platform.persistence.dao; import cn.gukeer.platform.persistence.entity.TeacherClass; import cn.gukeer.platform.persistence.entity.TeachCycle; import cn.gukeer.platform.persistence.entity.Teacher; import java.util.List; import java.util.Map; /** * Created by LL on 2017/4/5. */ public interface A_TeachCycleExtentionMapper { List<TeacherClass> findTeacherByCycleIdAndSchoolId(Map param); }
[ "1211079133@qq.com" ]
1211079133@qq.com
5562386a5a1b123d757b0a16cdcd95b5df550103
4d8360a770882fa06873272f9fe96c12888f28af
/src/main/java/com/du/service/impl/ProductServiceImpl.java
213430485598ff69c2bf44f3dcdacdee789a3bdd
[]
no_license
duzining/onlineshop
d847a4ec30e917cc0a5aa660b1e86e6672d07f5b
66f09e4e24cae1502c29f0ae57bacf16d750b58f
refs/heads/master
2021-10-25T23:32:06.982598
2019-04-08T06:17:33
2019-04-08T06:17:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,935
java
package com.du.service.impl; import com.du.mapper.ProductMapper; import com.du.pojo.Category; import com.du.pojo.Product; import com.du.pojo.ProductExample; import com.du.pojo.ProductImage; import com.du.service.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.List; @Service public class ProductServiceImpl implements ProductService{ @Autowired private ProductMapper productMapper; @Autowired private CategoryService categoryService; @Autowired private ProductImageService productImageService; @Autowired private OrderItemService orderItemService; @Autowired private ReviewService reviewService; @Override public List list(int cid) { ProductExample productExample = new ProductExample(); productExample.createCriteria().andCidEqualTo(cid); return productMapper.selectByExample(productExample); } @Override public Product get(int id) { Product p = productMapper.selectByPrimaryKey(id); setFirstProductImage(p); setCategory(p); return p; } @Override public void add(Product product) { productMapper.insert(product); } @Override public void update(Product product) { productMapper.updateByPrimaryKeySelective(product); } @Override public void delete(int id) { productMapper.deleteByPrimaryKey(id); } @Override public void setFirstProductImage(Product p) { List<ProductImage> pis = productImageService.list(p.getId(),ProductImageService.type_single); if (!pis.isEmpty()){ ProductImage pi = pis.get(0); p.setFirstProductImage(pi); } } @Override public void fill(List<Category> cs) { for (Category c : cs){ fill(c); } } @Override public void fill(Category c) { List<Product> ps = list(c.getId()); c.setProducts(ps); } @Override public void fillByRow(List<Category> cs) { int productNumberEachRow = 8 ; for (Category c : cs){ List<Product> products = c.getProducts(); List<List<Product>> productsByRow = new ArrayList<>(); for (int i =0;i<products.size();i+=productNumberEachRow){ int size = i + productNumberEachRow; size = size>products.size()?products.size():size; List<Product> productsOfEachRow =products.subList(i, size); productsByRow.add(productsOfEachRow); } c.setProductsByRow(productsByRow); } } public void setCategory(List<Product> ps){ for (Product p : ps){ setCategory(p); } } public void setCategory(Product p){ int cid = p.getCid(); Category c = categoryService.get(cid); p.setCategory(c); } @Override public void setSaleAndReviewNumber(Product p) { int saleCount = orderItemService.getSaleCount(p.getId()); p.setSaleCount(saleCount); int reviewCount = reviewService.getCount(p.getId()); p.setReviewCount(reviewCount); } @Override public void setSaleAndReviewNumber(List<Product> ps) { for (Product p : ps) { setSaleAndReviewNumber(p); } } @Override public List<Product> search(String keyword) { ProductExample example = new ProductExample(); example.createCriteria().andNameLike("%" + keyword + "%"); example.setOrderByClause("id desc"); List result = productMapper.selectByExample(example); setFirstProductImage(result); setCategory(result); return result; } public void setFirstProductImage(List<Product> ps) { for (Product p : ps) { setFirstProductImage(p); } } }
[ "1211730587@qq.com" ]
1211730587@qq.com
64dbef385578933f23ee809c1bc84ffaa73148bc
08e356f8682a98758989f9c46f1eecb99adaab52
/spring-crud/src/main/java/com/labouardy/controller/IndexController.java
4947d06236b9c6e779ba8e4c795ee4ee7c1ef20f
[]
no_license
paulmsegeya/spring-crud
b60d90fa5fcaf26dc4aa8a3d2d5e65e6536fcf77
e3308d9e046c46a9d38b73bf71faddd8b63c0f37
refs/heads/master
2021-01-21T09:23:24.537594
2015-10-01T20:14:42
2015-10-01T20:14:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
544
java
package com.labouardy.controller; 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 com.labouardy.service.WorkshopService; @Controller public class IndexController { @Autowired private WorkshopService WorkshopService; @RequestMapping("/index") public String index(Model model){ model.addAttribute("workshops", WorkshopService.findAll()); return "index"; } }
[ "mohamed.labouardy@gmail.com" ]
mohamed.labouardy@gmail.com
36fa2943d5f7f064240219a57b45a1e4806d0c25
a4012a223a0eadf5de08790ff04a0e903b4fdc69
/src/com/hello/world/memento/Person.java
429c40fc527d5b256b3e21c245db3f10fd5d9531
[]
no_license
gujin520/helloworld
769f3eec64994289619d9818eb6fa2a2c24a22c0
76a402939ad95361c848173942fa0fb31af62135
refs/heads/master
2021-11-11T18:18:50.085405
2017-10-11T12:55:14
2017-10-11T12:55:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,020
java
package com.hello.world.memento; /** * @author yangguanbao * @date 17/03/2017 */ public class Person { MementoSay say; String name; String dept; String sayWhat; public MementoSay recordInfo(){ MementoSay m = new MementoSay(); m.setSayWhat(sayWhat); m.setName(name); m.setDept(dept); return m; } public void reset(MementoSay say) { this.say = say; this.name = say.getName(); this.dept = say.getDept(); this.sayWhat = say.getSayWhat(); } public MementoSay getSay() { return say; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getSayWhat() { return sayWhat; } public void setSayWhat(String sayWhat) { this.sayWhat = sayWhat; } public String getDept() { return dept; } public void setDept(String dept) { this.dept = dept; } }
[ "yangguanbao@yangguanbaodeMacBook-Pro.local" ]
yangguanbao@yangguanbaodeMacBook-Pro.local
1e26ba8b9f06837ed37e3579625bba91f7f351f6
811db58573ca860be1d82fd2d4065b8353828d0e
/src/com/vcs/components/ContentMap.java
dab9ce8fddc518708a79fabb0aa7586565e99547
[]
no_license
BananaYogurt/vcs
8a0985b36b298959ea85e32de9c5651060be4016
11dd615e8b2d33d9649b2e90703081e5da17ceb9
refs/heads/master
2021-01-22T10:09:19.952402
2017-09-04T08:21:41
2017-09-04T08:21:41
102,335,737
1
0
null
null
null
null
UTF-8
Java
false
false
392
java
package com.vcs.components; import java.util.HashMap; import java.util.Map; /** * created by wuzh on 2017/4/29 18:39 */ public class ContentMap { private Map<String,String> filesMap = new HashMap<>(); public Map<String, String> getFilesMap() { return filesMap; } public void setFilesMap(Map<String, String> filesMap) { this.filesMap = filesMap; } }
[ "373038132@qq.com" ]
373038132@qq.com
b620bbf141ec8224adcd758eeab5d108713af2e3
c08d0e70339df3748f8b7e53dacdcb0631d423ff
/src/main/java/additional_activity/vol1/pageObject/JDITestSite.java
53ee216fd426bb09c21328fce6e8354852a6039d
[]
no_license
NataliaLebedeva/TestAutoWinter2018
70a599b839c73f54558b610a53d6dfd77086a23f
d00f644e3bc30c4747636998980a9b6925680dda
refs/heads/master
2021-05-12T19:42:26.762352
2018-02-03T20:53:41
2018-02-03T20:53:41
117,100,482
0
0
null
null
null
null
UTF-8
Java
false
false
558
java
package additional_activity.vol1.pageObject; import org.openqa.selenium.WebDriver; import additional_activity.vol1.pageObject.pages.HomePage; public class JDITestSite { // public static ContactPage contactFormPage; public static HomePage homePage; private static WebDriver driver; public static void init(WebDriver driver){ homePage = HomePage.getInstance(driver); JDITestSite.driver = driver; } public static void open() { driver.navigate().to("https://jdi-framework.github.io/tests/index.htm"); } }
[ "natalia.bunyak@gmail.com" ]
natalia.bunyak@gmail.com
61b6e7561d740665e6455e1b219eb128442ca71d
e49ddf6e23535806c59ea175b2f7aa4f1fb7b585
/tags/release-5.4.2/mipav/src/gov/nih/mipav/view/dialogs/JDialogIntensityThreshold.java
c13bc7ae73a134aecc998c8a552d25efc9258bd3
[ "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
svn2github/mipav
ebf07acb6096dff8c7eb4714cdfb7ba1dcace76f
eb76cf7dc633d10f92a62a595e4ba12a5023d922
refs/heads/master
2023-09-03T12:21:28.568695
2019-01-18T23:13:53
2019-01-18T23:13:53
130,295,718
1
0
null
null
null
null
UTF-8
Java
false
false
4,443
java
package gov.nih.mipav.view.dialogs; import gov.nih.mipav.view.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; /** * <p>Title:</p> * * <p>Description:</p> * * <p>Copyright: Copyright (c) 2003</p> * * <p>Company:</p> * * @author not attributable * @version 1.0 */ public class JDialogIntensityThreshold extends JDialogBase { //~ Static fields/initializers ------------------------------------------------------------------------------------- /** Use serialVersionUID for interoperability. */ private static final long serialVersionUID = 988706874933899996L; //~ Instance fields ------------------------------------------------------------------------------------------------ /** DOCUMENT ME! */ private ViewJComponentEditImage component; private VOIHandlerInterface voiHandler; /** DOCUMENT ME! */ private boolean doAverage; /** DOCUMENT ME! */ private JTextField threshField = null; //~ Constructors --------------------------------------------------------------------------------------------------- /** * Creates a new JDialogIntensityThreshold object. * * @param theParentFrame DOCUMENT ME! * @param compImage DOCUMENT ME! * @param average DOCUMENT ME! */ public JDialogIntensityThreshold(JFrame theParentFrame, ViewJComponentEditImage compImage, boolean average) { super(theParentFrame, false); this.component = compImage; doAverage = average; init(); setVisible(true); } /** * Creates a new JDialogIntensityThreshold object. * * @param theParentFrame DOCUMENT ME! * @param compImage DOCUMENT ME! * @param average DOCUMENT ME! */ public JDialogIntensityThreshold(JFrame theParentFrame, VOIHandlerInterface voiHandler, boolean average) { super(theParentFrame, false); this.voiHandler = voiHandler; doAverage = average; init(); setVisible(true); } //~ Methods -------------------------------------------------------------------------------------------------------- /** * DOCUMENT ME! * * @param e DOCUMENT ME! */ public void actionPerformed(ActionEvent e) { /** * @todo Implement this java.awt.event.ActionListener abstract method */ Object source = e.getSource(); if (source == OKButton) { float threshold = 0.0f; try { threshold = new Float(threshField.getText()).floatValue(); } catch (Exception ex) { MipavUtil.displayError("Threshold must be a float value"); return; } setVisible(false); if ( voiHandler != null ) { voiHandler.graph25VOI_CalcInten(!doAverage, true, threshold); } else if ( component != null ) { component.getVOIHandler().graph25VOI_CalcInten(!doAverage, true, threshold); } this.dispose(); } else if (source == cancelButton) { setVisible(false); this.dispose(); } } /** * DOCUMENT ME! */ private void init() { setForeground(Color.black); if (doAverage) { setTitle("2.5D Average Intensity"); } else { setTitle("2.5D Total Intensity"); } JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.X_AXIS)); mainPanel.setForeground(Color.black); mainPanel.setBorder(buildTitledBorder("")); JLabel threshLabel = new JLabel("Intensity threshold "); threshLabel.setForeground(Color.black); threshLabel.setFont(serif12); threshField = new JTextField(4); mainPanel.add(threshLabel); mainPanel.add(threshField); JPanel buttonPanel = new JPanel(); buildOKButton(); buttonPanel.add(OKButton); buildCancelButton(); buttonPanel.add(cancelButton); getContentPane().add(mainPanel, BorderLayout.NORTH); getContentPane().add(buttonPanel, BorderLayout.SOUTH); pack(); } }
[ "mccreedy@NIH.GOV@ba61647d-9d00-f842-95cd-605cb4296b96" ]
mccreedy@NIH.GOV@ba61647d-9d00-f842-95cd-605cb4296b96
456f6f8d57936687a09c27c94e7936473f32a928
363e172347f875214ccf095ca87860748a114926
/leetcode/FlattenBinaryTreeToLL.java
046b34133f2800db2bd97047f6ccc6f224166852
[]
no_license
anjali-chadha/Algorithms
291cdac47dc26d067f8f7022d8f73a18373582aa
3e6bf2df71dea66ac26a2bfab0179fc302af2eca
refs/heads/master
2020-12-30T14:01:16.720432
2018-11-16T23:46:22
2018-11-16T23:46:22
91,280,743
2
1
null
null
null
null
UTF-8
Java
false
false
652
java
//https://leetcode.com/problems/flatten-binary-tree-to-linked-list /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ class Solution { public void flatten(TreeNode root) { if(root == null) return; TreeNode left = root.left; TreeNode right = root.right; root.left = null; flatten(left); flatten(right); root.right = left; TreeNode curr = root; while(curr.right != null) curr = curr.right; curr.right = right; } }
[ "noreply@github.com" ]
noreply@github.com
e841670bd53c1e6ae32b9991a5c5806f4e295445
4f98c6432e806d514f6bb2c8d5e41bf621100ccf
/src/testview/TestStream2.java
59ca91cca8a075a802f8a3c457dbb73021cd178e
[]
no_license
ThomasDaniKurniawan/175314126_PBOII_2018
bcaee1d7035ec6cd6e5cc83205f783f523efab8d
a71aad405e0edbcf68c26ccbd8fd5323003331c1
refs/heads/master
2020-03-27T12:26:04.603184
2018-10-30T16:20:43
2018-10-30T16:20:43
146,546,044
0
0
null
null
null
null
UTF-8
Java
false
false
611
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 testview; import java.io.File; import model.Pasien; /** * * @author admin */ public class TestStream2 { public static void main(String[] args) { Pasien.bacaDaftarPasien(new File("daftar.txt")); for (int i = 0; i < Pasien.GetDaftarPasien().size(); i++) { System.out.println("\t"+Pasien.GetDaftarPasien().get(i).toString()+"\n"); } } }
[ "Lenovo@LAPTOP-8VJDIM5C" ]
Lenovo@LAPTOP-8VJDIM5C
bb279b9b3ba204df333a066597eb0eb88418674b
8d09189d10a9cd1a1ba402b52a7749097b04e4a8
/aws-java-sdk-wafv2/src/main/java/com/amazonaws/services/wafv2/model/DisassociateWebACLRequest.java
4f73e3bf163444fc5f0970a2b9e9dd59cfa32b36
[ "Apache-2.0" ]
permissive
hboutemy/aws-sdk-java
7b6b219479136cafbf348209a8e7e1b3f0e64d15
f04ef821eb2f10b55bec4e527b9dbbfc3847c5c3
refs/heads/master
2021-01-03T12:28:29.649460
2020-02-11T22:33:24
2020-02-11T22:33:24
240,073,241
0
0
Apache-2.0
2020-02-12T17:29:57
2020-02-12T17:29:56
null
UTF-8
Java
false
false
9,407
java
/* * Copyright 2015-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.wafv2.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/DisassociateWebACL" target="_top">AWS API * Documentation</a> */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class DisassociateWebACLRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** * <p> * The Amazon Resource Name (ARN) of the resource to disassociate from the web ACL. * </p> * <p> * The ARN must be in one of the following formats: * </p> * <ul> * <li> * <p> * For a CloudFront distribution: * <code>arn:aws:cloudfront::<i>account-id</i>:distribution/<i>distribution-id</i> </code> * </p> * </li> * <li> * <p> * For an Application Load Balancer: * <code>arn:aws:elasticloadbalancing: <i>region</i>:<i>account-id</i>:loadbalancer/app/<i>load-balancer-name</i> /<i>load-balancer-id</i> </code> * </p> * </li> * <li> * <p> * For an Amazon API Gateway stage: * <code>arn:aws:apigateway:<i>region</i> ::/restapis/<i>api-id</i>/stages/<i>stage-name</i> </code> * </p> * </li> * </ul> */ private String resourceArn; /** * <p> * The Amazon Resource Name (ARN) of the resource to disassociate from the web ACL. * </p> * <p> * The ARN must be in one of the following formats: * </p> * <ul> * <li> * <p> * For a CloudFront distribution: * <code>arn:aws:cloudfront::<i>account-id</i>:distribution/<i>distribution-id</i> </code> * </p> * </li> * <li> * <p> * For an Application Load Balancer: * <code>arn:aws:elasticloadbalancing: <i>region</i>:<i>account-id</i>:loadbalancer/app/<i>load-balancer-name</i> /<i>load-balancer-id</i> </code> * </p> * </li> * <li> * <p> * For an Amazon API Gateway stage: * <code>arn:aws:apigateway:<i>region</i> ::/restapis/<i>api-id</i>/stages/<i>stage-name</i> </code> * </p> * </li> * </ul> * * @param resourceArn * The Amazon Resource Name (ARN) of the resource to disassociate from the web ACL. </p> * <p> * The ARN must be in one of the following formats: * </p> * <ul> * <li> * <p> * For a CloudFront distribution: * <code>arn:aws:cloudfront::<i>account-id</i>:distribution/<i>distribution-id</i> </code> * </p> * </li> * <li> * <p> * For an Application Load Balancer: * <code>arn:aws:elasticloadbalancing: <i>region</i>:<i>account-id</i>:loadbalancer/app/<i>load-balancer-name</i> /<i>load-balancer-id</i> </code> * </p> * </li> * <li> * <p> * For an Amazon API Gateway stage: * <code>arn:aws:apigateway:<i>region</i> ::/restapis/<i>api-id</i>/stages/<i>stage-name</i> </code> * </p> * </li> */ public void setResourceArn(String resourceArn) { this.resourceArn = resourceArn; } /** * <p> * The Amazon Resource Name (ARN) of the resource to disassociate from the web ACL. * </p> * <p> * The ARN must be in one of the following formats: * </p> * <ul> * <li> * <p> * For a CloudFront distribution: * <code>arn:aws:cloudfront::<i>account-id</i>:distribution/<i>distribution-id</i> </code> * </p> * </li> * <li> * <p> * For an Application Load Balancer: * <code>arn:aws:elasticloadbalancing: <i>region</i>:<i>account-id</i>:loadbalancer/app/<i>load-balancer-name</i> /<i>load-balancer-id</i> </code> * </p> * </li> * <li> * <p> * For an Amazon API Gateway stage: * <code>arn:aws:apigateway:<i>region</i> ::/restapis/<i>api-id</i>/stages/<i>stage-name</i> </code> * </p> * </li> * </ul> * * @return The Amazon Resource Name (ARN) of the resource to disassociate from the web ACL. </p> * <p> * The ARN must be in one of the following formats: * </p> * <ul> * <li> * <p> * For a CloudFront distribution: * <code>arn:aws:cloudfront::<i>account-id</i>:distribution/<i>distribution-id</i> </code> * </p> * </li> * <li> * <p> * For an Application Load Balancer: * <code>arn:aws:elasticloadbalancing: <i>region</i>:<i>account-id</i>:loadbalancer/app/<i>load-balancer-name</i> /<i>load-balancer-id</i> </code> * </p> * </li> * <li> * <p> * For an Amazon API Gateway stage: * <code>arn:aws:apigateway:<i>region</i> ::/restapis/<i>api-id</i>/stages/<i>stage-name</i> </code> * </p> * </li> */ public String getResourceArn() { return this.resourceArn; } /** * <p> * The Amazon Resource Name (ARN) of the resource to disassociate from the web ACL. * </p> * <p> * The ARN must be in one of the following formats: * </p> * <ul> * <li> * <p> * For a CloudFront distribution: * <code>arn:aws:cloudfront::<i>account-id</i>:distribution/<i>distribution-id</i> </code> * </p> * </li> * <li> * <p> * For an Application Load Balancer: * <code>arn:aws:elasticloadbalancing: <i>region</i>:<i>account-id</i>:loadbalancer/app/<i>load-balancer-name</i> /<i>load-balancer-id</i> </code> * </p> * </li> * <li> * <p> * For an Amazon API Gateway stage: * <code>arn:aws:apigateway:<i>region</i> ::/restapis/<i>api-id</i>/stages/<i>stage-name</i> </code> * </p> * </li> * </ul> * * @param resourceArn * The Amazon Resource Name (ARN) of the resource to disassociate from the web ACL. </p> * <p> * The ARN must be in one of the following formats: * </p> * <ul> * <li> * <p> * For a CloudFront distribution: * <code>arn:aws:cloudfront::<i>account-id</i>:distribution/<i>distribution-id</i> </code> * </p> * </li> * <li> * <p> * For an Application Load Balancer: * <code>arn:aws:elasticloadbalancing: <i>region</i>:<i>account-id</i>:loadbalancer/app/<i>load-balancer-name</i> /<i>load-balancer-id</i> </code> * </p> * </li> * <li> * <p> * For an Amazon API Gateway stage: * <code>arn:aws:apigateway:<i>region</i> ::/restapis/<i>api-id</i>/stages/<i>stage-name</i> </code> * </p> * </li> * @return Returns a reference to this object so that method calls can be chained together. */ public DisassociateWebACLRequest withResourceArn(String resourceArn) { setResourceArn(resourceArn); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getResourceArn() != null) sb.append("ResourceArn: ").append(getResourceArn()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DisassociateWebACLRequest == false) return false; DisassociateWebACLRequest other = (DisassociateWebACLRequest) obj; if (other.getResourceArn() == null ^ this.getResourceArn() == null) return false; if (other.getResourceArn() != null && other.getResourceArn().equals(this.getResourceArn()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getResourceArn() == null) ? 0 : getResourceArn().hashCode()); return hashCode; } @Override public DisassociateWebACLRequest clone() { return (DisassociateWebACLRequest) super.clone(); } }
[ "" ]
975a09a829cc6bfcbb30d918bc8e20fb62adb75f
197466e947c9522ec9814e1b2124e7eac2f1605c
/jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/BuildTarMojo.java
214cefa7554d2825116c0a6fe712c3f7bd401505
[ "Apache-2.0" ]
permissive
hongjie7202/jib
ae0233b1386478a7eb1edb28d8fa9833d5b19b8f
8110c1da0d8acb8951bf4c67d665a4b843ca1207
refs/heads/master
2020-03-30T07:09:31.347811
2018-09-28T20:59:15
2018-09-28T20:59:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,807
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. */ package com.google.cloud.tools.jib.maven; import com.google.cloud.tools.jib.configuration.BuildConfiguration; import com.google.cloud.tools.jib.configuration.CacheDirectoryCreationException; import com.google.cloud.tools.jib.configuration.ImageConfiguration; import com.google.cloud.tools.jib.filesystem.AbsoluteUnixPath; import com.google.cloud.tools.jib.image.ImageReference; import com.google.cloud.tools.jib.image.InvalidImageReferenceException; import com.google.cloud.tools.jib.plugins.common.BuildStepsExecutionException; import com.google.cloud.tools.jib.plugins.common.BuildStepsRunner; import com.google.cloud.tools.jib.plugins.common.ConfigurationPropertyValidator; import com.google.cloud.tools.jib.plugins.common.HelpfulSuggestions; import com.google.common.annotations.VisibleForTesting; import java.io.IOException; import java.nio.file.Paths; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.ResolutionScope; /** * Builds a container image and exports to disk at {@code ${project.build.directory}/jib-image.tar}. */ @Mojo( name = BuildTarMojo.GOAL_NAME, requiresDependencyResolution = ResolutionScope.RUNTIME_PLUS_SYSTEM) public class BuildTarMojo extends JibPluginConfiguration { @VisibleForTesting static final String GOAL_NAME = "buildTar"; private static final String HELPFUL_SUGGESTIONS_PREFIX = "Building image tarball failed"; @Override public void execute() throws MojoExecutionException { if (isSkipped()) { getLog().info("Skipping containerization because jib-maven-plugin: skip = true"); return; } if ("pom".equals(getProject().getPackaging())) { getLog().info("Skipping containerization because packaging is 'pom'..."); return; } AbsoluteUnixPath appRoot = PluginConfigurationProcessor.getAppRootChecked(this); MavenProjectProperties mavenProjectProperties = MavenProjectProperties.getForProject(getProject(), getLog(), getExtraDirectory(), appRoot); try { MavenHelpfulSuggestionsBuilder mavenHelpfulSuggestionsBuilder = new MavenHelpfulSuggestionsBuilder(HELPFUL_SUGGESTIONS_PREFIX, this); ImageReference targetImage = ConfigurationPropertyValidator.getGeneratedTargetDockerTag( getTargetImage(), mavenProjectProperties.getEventDispatcher(), getProject().getName(), getProject().getVersion(), mavenHelpfulSuggestionsBuilder.build()); PluginConfigurationProcessor pluginConfigurationProcessor = PluginConfigurationProcessor.processCommonConfiguration( getLog(), this, mavenProjectProperties); BuildConfiguration buildConfiguration = pluginConfigurationProcessor .getBuildConfigurationBuilder() .setBaseImageConfiguration( pluginConfigurationProcessor.getBaseImageConfigurationBuilder().build()) .setTargetImageConfiguration(ImageConfiguration.builder(targetImage).build()) .setContainerConfiguration( pluginConfigurationProcessor.getContainerConfigurationBuilder().build()) .build(); HelpfulSuggestions helpfulSuggestions = mavenHelpfulSuggestionsBuilder .setBaseImageReference(buildConfiguration.getBaseImageConfiguration().getImage()) .setBaseImageHasConfiguredCredentials( pluginConfigurationProcessor.isBaseImageCredentialPresent()) .setTargetImageReference(buildConfiguration.getTargetImageConfiguration().getImage()) .build(); BuildStepsRunner.forBuildTar( Paths.get(getProject().getBuild().getDirectory()).resolve("jib-image.tar"), buildConfiguration) .build(helpfulSuggestions); getLog().info(""); } catch (CacheDirectoryCreationException | InvalidImageReferenceException | IOException ex) { throw new MojoExecutionException(ex.getMessage(), ex); } catch (BuildStepsExecutionException ex) { throw new MojoExecutionException(ex.getMessage(), ex.getCause()); } } }
[ "noreply@github.com" ]
noreply@github.com
d7f8afa746bc086837efd2c2542be791f57f5062
57809be1505cbfbba95843ebaa8039b31d2d3b85
/playerbase/src/main/java/com/kk/taurus/playerbase/receiver/BaseReceiver.java
1d86d6aba46c721efc61e723e2c64f029d90e05b
[ "Apache-2.0" ]
permissive
Fengshaoyuan/PlayerBase
df4b8fef8844d2e87df62b6c6a342fc1ed950652
75db7dce1c8385383cab214cbf84b28b9240ed18
refs/heads/master
2020-09-01T15:37:58.390542
2019-11-08T01:55:28
2019-11-08T01:55:28
218,994,996
1
0
null
null
null
null
UTF-8
Java
false
false
4,569
java
package com.kk.taurus.playerbase.receiver; import android.content.Context; import android.os.Bundle; import android.text.TextUtils; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.kk.taurus.playerbase.log.PLog; /** * Time:2019/11/2 * Author:RuYIng * Description: */ public abstract class BaseReceiver implements IReceiver, StateGetter { private Context mContext; private OnReceiverEventListener mOnReceiverEventListener; private IReceiverGroup mHostGroup; private StateGetter mStateGetter; private String mKey; /** * If you want to use Activity related functions or features, * please pass in the context of Activity. * Use it carefully to avoid memory leaks * * @param context context * */ public BaseReceiver(Context context){ this.mContext = context; } /** * When the receiver is added to the group, callback this method. */ public void onReceiverBind(){ } /** * When the receiver is removed in the group, callback this method. */ @Override public void onReceiverUnBind() { } /** * Bind the ReceiverGroup. This method is called by the inside of the framework. * Please do not call this method. * * @param receiverGroup receiverGroup */ @Override public final void bindGroup(@NonNull IReceiverGroup receiverGroup) { this.mHostGroup = receiverGroup; } protected final GroupValue getGroupValue(){ return mHostGroup.getGroupValue(); } @Override public final void bindStateGetter(StateGetter stateGetter) { this.mStateGetter = stateGetter; } @Override @Nullable public final PlayerStateGetter getPlayerStateGetter() { if(mStateGetter!=null) return mStateGetter.getPlayerStateGetter(); return null; } /** * Bind the listener. This method is called by the inside of the framework. * Please do not call this method. * * @param onReceiverEventListener onReceiverEventListener */ @Override public final void bindReceiverEventListener(OnReceiverEventListener onReceiverEventListener) { this.mOnReceiverEventListener = onReceiverEventListener; } /** * A receiver sends an event, and the receiver in the same group can receive the event. * @param eventCode eventCode * @param bundle bundle */ protected final void notifyReceiverEvent(int eventCode, Bundle bundle){ if(mOnReceiverEventListener!=null) mOnReceiverEventListener.onReceiverEvent(eventCode, bundle); } /** * Send an event to the specified receiver, * make sure that the key value you imported is correct. * * @param key The unique value of a receiver can be found. * @param eventCode eventCode * @param bundle bundle * * @return Bundle Return value after the receiver's response, nullable. * */ protected final @Nullable Bundle notifyReceiverPrivateEvent( @NonNull String key, int eventCode, Bundle bundle){ if(mHostGroup!=null && !TextUtils.isEmpty(key)){ IReceiver receiver = mHostGroup.getReceiver(key); if(receiver!=null){ return receiver.onPrivateEvent(eventCode, bundle); }else{ PLog.e("BaseReceiver", "not found receiver use you incoming key."); } } return null; } /** * private event * @param eventCode eventCode * @param bundle bundle * * @return Bundle */ @Override public Bundle onPrivateEvent(int eventCode, Bundle bundle) { return null; } /** * producer event from producers send. * @param eventCode eventCode * @param bundle bundle */ @Override public void onProducerEvent(int eventCode, Bundle bundle) { } /** * producer data from producers send * @param key key * @param data data */ @Override public void onProducerData(String key, Object data) { } protected final Context getContext(){ return mContext; } //default tag is class simple name public Object getTag(){ return this.getClass().getSimpleName(); } void setKey(String key){ this.mKey = key; } /** * the receiver key you put. * @return String */ @Override public final String getKey() { return mKey; } }
[ "yuanshaofeng@supersurs.com" ]
yuanshaofeng@supersurs.com
bb8dda19494fa442abcd46a7137e5678134522e2
7d8d7f6d2ddf1293b92f3318a85e020dfbe9a488
/src/service/UpdateService.java
4536eeb198bd83752f3568cd4a41d17b1540cc36
[]
no_license
Lime1029/Tenement
d0631497e5d69ab0b6de772a91fbbd625fa484a7
ca31b4966e3a9601c22bf6d63ef66af8f1560a27
refs/heads/master
2020-06-12T17:42:43.793710
2019-07-12T03:59:59
2019-07-12T03:59:59
194,375,559
6
0
null
2019-07-10T07:26:14
2019-06-29T07:04:47
Java
UTF-8
Java
false
false
175
java
package service; import model.House; import model.HouseInfo; import java.util.List; public interface UpdateService { public String updateHouse(HouseInfo houseInfo); }
[ "3466794461@qq.com" ]
3466794461@qq.com
e5864959bec6155c1666d82d0ffbd9e437af1d04
47bd7f245f68715ab44a08b778c20589c4257186
/LOGINDEMO/src/test/java/com/sts/login/LOGINDEMO/LogindemoApplicationTests.java
d84960b4bafb8719e22cca8a94eec8201da138ad
[]
no_license
mounikakoutarapu1996/172406_Mounika
2423bd3f4b991273a73a7ce07767a8096475f89f
75667b108703d144b5785c6785a1650612d0a906
refs/heads/master
2020-04-21T01:24:54.635155
2019-05-15T08:33:14
2019-05-15T08:33:14
169,222,935
0
0
null
null
null
null
UTF-8
Java
false
false
343
java
package com.sts.login.LOGINDEMO; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class LogindemoApplicationTests { @Test public void contextLoads() { } }
[ "noreply@github.com" ]
noreply@github.com
8c7a6a82a68a5ec897fe31a9c3c9e844e7c1fb6b
9aeb486546181cb44bdcc12ae0d71d7ca36ea649
/app/src/main/java/com/retrofitexample/MainActivity.java
229dab451485763a9b05c573a834dd150673d17b
[]
no_license
AshokMadduru/RetrofitExample
299a69f25bc462121c7ee9a686e6bc7dba311217
b8a686635674a72b19ab738ee661bc87dccd36a4
refs/heads/master
2020-06-23T17:15:37.299155
2016-11-24T06:16:51
2016-11-24T06:16:51
74,643,446
0
0
null
null
null
null
UTF-8
Java
false
false
1,332
java
package com.retrofitexample; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; import retrofit2.Retrofit; import retrofit2.converter.gson.GsonConverterFactory; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); /* Retrofit retrofit = new Retrofit.Builder() .baseUrl("http://hubint.smartron.com:8081/") .addConverterFactory(GsonConverterFactory.create()) .build();*/ ProductsInterface productsInterface = SetUpRetrofit.createService(ProductsInterface.class); Call<Products> p = productsInterface.getProductListResponse("ACCESSORY"); p.enqueue(new Callback<Products>() { @Override public void onResponse(Call<Products> call, Response<Products> response) { Log.d("reponse",response.body().getData().getProductsList().toString()); } @Override public void onFailure(Call<Products> call, Throwable t) { Log.d("response","failed"); } }); } }
[ "ashokgirihari@gmail.com" ]
ashokgirihari@gmail.com
d0e346ad547d9a3d4f165edd93e695008821c118
ef6fead2bf1aaedbef0707b5ad900c1bfe52e0eb
/svmuu/src/main/java/com/svmuu/common/adapter/BaseHolder.java
bfacf5e5a987902f8ad55af6a9ea71093e91a6c3
[]
no_license
summerEnd/Svmuu
431f404a90c7d3b53162952b28d4012ef6a3a2f2
e9ec97bcbcafa52175c4490dd7be7f751334ff7e
refs/heads/master
2021-01-23T08:57:01.926816
2015-07-15T10:16:06
2015-07-15T10:16:06
33,851,430
0
0
null
null
null
null
UTF-8
Java
false
false
989
java
package com.svmuu.common.adapter; import android.support.v7.widget.RecyclerView; import android.view.View; public abstract class BaseHolder<ET> extends RecyclerView.ViewHolder implements View.OnClickListener{ OnItemListener listener; public BaseHolder(View itemView) { super(itemView); itemView.setOnClickListener(this); initialize(); } protected void initialize() { } public View findViewById(int id){ if (itemView==null){ return null; } return itemView.findViewById(id); } @Override public void onClick(View v) { if (listener!=null){ listener.onClick(itemView,getAdapterPosition()); } } public void setListener(OnItemListener listener) { this.listener = listener; } public OnItemListener getListener() { return listener; } public interface OnItemListener{ void onClick(View itemView,int position); } }
[ "771509565@qq.com" ]
771509565@qq.com
84ac3e8503d9fe937b47aa3269289d0c94c5b991
26f8591b66a6df057cede9d82f56007563e68227
/chapter11/src/main/java/nia/chapter11/ChunkedWriteHandlerInitializer.java
1f732353e0fa463bbef7fd4952f54ca55287d80c
[]
no_license
pglc1026/netty-in-action-learning
86b9e222032fe21242955b526d9b6371adb39203
66414fd81520fb3057f4b309f64354cd0abc45d6
refs/heads/master
2020-04-26T01:53:34.973939
2019-04-07T08:54:53
2019-04-07T08:54:53
173,218,293
0
0
null
null
null
null
UTF-8
Java
false
false
1,371
java
package nia.chapter11; import io.netty.channel.*; import io.netty.handler.ssl.SslContext; import io.netty.handler.ssl.SslHandler; import io.netty.handler.stream.ChunkedStream; import io.netty.handler.stream.ChunkedWriteHandler; import java.io.File; import java.io.FileInputStream; /** * ChunkedWriteHandlerInitializer * * @author pglc1026 * @date 2019-03-31 */ public class ChunkedWriteHandlerInitializer extends ChannelInitializer<Channel> { private final File file; private final SslContext sslCtx; public ChunkedWriteHandlerInitializer(File file, SslContext sslCtx) { this.file = file; this.sslCtx = sslCtx; } @Override protected void initChannel(Channel ch) throws Exception { ChannelPipeline pipeline = ch.pipeline(); pipeline.addLast(new SslHandler(sslCtx.newEngine(ch.alloc()))); pipeline.addLast(new ChunkedWriteHandler()); // 一旦连接简历,WriteStreamHandler就开始写数据 pipeline.addLast(new WriteStreamHandler()); } public final class WriteStreamHandler extends ChannelInboundHandlerAdapter { @Override public void channelActive(ChannelHandlerContext ctx) throws Exception { super.channelActive(ctx); ctx.writeAndFlush( new ChunkedStream(new FileInputStream(file))); } } }
[ "pglc1026@163.com" ]
pglc1026@163.com
cee222ddb906a4af492c1349a8bc79ad0606aace
9b003d88dd493eea0e70b1efb0b36211b65173c7
/User-consomer/src/test/java/com/example/Userconsomer/UserConsomerApplicationTests.java
aeaefc0bf37f8f893a4d921666cda12174699847
[]
no_license
nlp0520/EurkaServer
252c036ed40c2d912fd5e285153b04d7027dad32
99e8de4ad2fd0852ce1cb1a4689365f4f443cf9b
refs/heads/master
2023-07-11T01:22:57.927158
2021-08-17T14:24:15
2021-08-17T14:24:15
390,403,188
0
0
null
null
null
null
UTF-8
Java
false
false
222
java
package com.example.Userconsomer; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class UserConsomerApplicationTests { @Test void contextLoads() { } }
[ "784115501@qq.com" ]
784115501@qq.com
60509b504eff7dac4ef0d9720087ba00a72c3719
e078c27b48af1c342c8e733dd4066660bd1a4321
/foodie-dev-service/src/main/java/com/imooc/service/impl/UserServiceImpl.java
f2c2f547ce1183e0e8653c9898a8599e1de40b7b
[]
no_license
Edward-1020/foodie-dev
73ca5faea1fe7852ef08a3ccb18470a1b425a2a7
a89b88a8c295bf27bddad0888efcf1ab4a3b1123
refs/heads/master
2022-08-16T08:09:43.549433
2020-02-27T02:38:39
2020-02-27T02:38:39
237,420,433
0
0
null
2022-06-21T02:43:44
2020-01-31T11:54:28
HTML
UTF-8
Java
false
false
2,743
java
package com.imooc.service.impl; import com.imooc.enums.Sex; import com.imooc.mapper.UsersMapper; import com.imooc.pojo.Users; import com.imooc.pojo.bo.UserBO; import com.imooc.service.UserService; import com.imooc.utils.DateUtil; import com.imooc.utils.MD5Utils; import org.n3r.idworker.Sid; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import tk.mybatis.mapper.entity.Example; import java.util.Date; @Service public class UserServiceImpl implements UserService { @Autowired public UsersMapper usersMapper; @Autowired private Sid sid; private static final String USER_FACE = "https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=1748322834,2134429526&fm=26&gp=0.jpg"; // 查询使用SUPPROTS @Transactional(propagation = Propagation.SUPPORTS) @Override public boolean queryUsernameIsExits(String username) { Example userExample = new Example(Users.class); Example.Criteria userCriteria = userExample.createCriteria(); userCriteria.andEqualTo("username", username); Users result = usersMapper.selectOneByExample(userExample); // 用户名是否存在 return result == null ? false : true; } @Transactional(propagation = Propagation.REQUIRED) @Override public Users createUser(UserBO userBo) { String userId = sid.nextShort(); Users user = new Users(); user.setId(userId); user.setUsername(userBo.getUsername()); try { user.setPassword(MD5Utils.getMD5Str(userBo.getPassword())); } catch (Exception e) { e.printStackTrace(); } // 默认用户昵称同用户名 user.setNickname(userBo.getUsername()); // 默认头像 user.setFace(USER_FACE); // 默认生日 user.setBirthday(DateUtil.stringToDate("1900-01-01")); // 默认性别为保密 user.setSex(Sex.secret.type); user.setCreatedTime(new Date()); user.setUpdatedTime(new Date()); usersMapper.insert(user); return user; } @Transactional(propagation = Propagation.SUPPORTS) @Override public Users queryUserForLogin(String username, String password) { Example userExample = new Example(Users.class); Example.Criteria userCriteria = userExample.createCriteria(); userCriteria.andEqualTo("username", username); userCriteria.andEqualTo("password", password); Users result = usersMapper.selectOneByExample(userExample); return result; } }
[ "iezzuyoung@gmail.com" ]
iezzuyoung@gmail.com
b6adb49e6752e879830dad964369b1f61e103cbd
8a135ca3f5eb37520774209cbe37244dbaf0e268
/core/src/main/java/com/gengoai/function/CheckedDoubleBinaryOperator.java
239e1536d4e895979a12f9ec60c2deabf97f8d87
[ "Apache-2.0" ]
permissive
gengoai/mango
511ccb5cd69ee7930996277c400e6a6c26dafd73
c9f427bb74c2dc60813dd5a9c4f66cc2562dc69f
refs/heads/master
2021-06-12T13:42:31.298020
2020-07-31T16:45:11
2020-07-31T16:45:11
128,667,584
0
0
null
null
null
null
UTF-8
Java
false
false
1,171
java
/* * (c) 2005 David B. Bracewell * * 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.gengoai.function; import java.io.Serializable; /** * Version of DoubleBinaryOperator that is serializable and checked */ @FunctionalInterface public interface CheckedDoubleBinaryOperator extends Serializable { double applyAsDouble(double t, double u) throws Throwable; }//END OF CheckedDoubleBinaryOperator
[ "david@davidbracewell.com" ]
david@davidbracewell.com
987ece379706b2c21193278e5585d7fa18f8e579
af207c2c39113c0dc311cdb7ebc540592e2dc772
/CODIGO_PROJETO/Sistema_SCTE_2.0/src/Model/Cliente.java
658dc650a5972fcc878cc5e46487cd04037e53a6
[]
no_license
LucasSousaR/Sistema-JavaFx
95fac5e175c0cabae8a1c42c19dce72f87841eaa
292e657cb95c69324c72c92f96756f75e7ce04e6
refs/heads/master
2020-04-24T10:54:50.992031
2019-02-21T17:15:05
2019-02-21T17:50:07
171,909,598
3
0
null
null
null
null
UTF-8
Java
false
false
763
java
package Model; import java.util.List; public class Cliente extends Pessoa { private int in_pv_id ; private int in_pv_id_convenio; //private List<Dependente> dependente; //private List<DiaAgendado> diaAgendado; public Cliente() { super(); } public Cliente(int in_pv_id, int in_pv_id_convenio) { super(); this.in_pv_id = in_pv_id; this.in_pv_id_convenio = in_pv_id_convenio; } public int getIn_pv_id() { return in_pv_id; } public void setIn_pv_id(int in_pv_id) { this.in_pv_id = in_pv_id; } public int getIn_pv_id_convenio() { return in_pv_id_convenio; } public void setIn_pv_id_convenio(int in_pv_id_convenio) { this.in_pv_id_convenio = in_pv_id_convenio; } }
[ "lucassousarodrigues1@gmail.com" ]
lucassousarodrigues1@gmail.com
9de017ff164c91cfaa3e45d36c0737653c4e1aa8
7da7215c76dab4ab14811976520ca2f0c0c996ce
/src/main/java/app/Sentence.java
5458dcc02de314728f448fdf8fe4ad25748c2bce
[]
no_license
M-CREATE-ART/home1
b8fbe85bccf70ec5e154b99c3c71c55fe4d41098
882ed8e099c1c7025499bd13837822bcff67daa5
refs/heads/master
2022-04-12T01:57:35.718044
2020-03-20T01:21:25
2020-03-20T01:21:25
239,511,823
0
0
null
null
null
null
UTF-8
Java
false
false
108
java
package app; public class Sentence { public Sentence(String subj, String verb, String obj) { } }
[ "memmedzademeryem24@gmail.com" ]
memmedzademeryem24@gmail.com
b7b218925eb8f10ea645c21de51910f0b761f8de
9133f35a82b16a6952b24a7ba2b777d0e4f40775
/app/src/test/java/com/example/atlas/cscc20/ExampleUnitTest.java
9d81ec40b51818829dbbe599bd236b780cef5cc2
[ "Apache-2.0" ]
permissive
LieBigWeiXi/CSCC
5065ab11e8516777593d40fafc828704576a997f
01967b1c0a58fb83827b66538ed8d23530c4437e
refs/heads/master
2021-04-15T17:26:44.349143
2018-03-22T02:49:23
2018-03-22T02:49:23
126,267,137
0
0
null
null
null
null
UTF-8
Java
false
false
402
java
package com.example.atlas.cscc20; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "1104029404@qq.com" ]
1104029404@qq.com
bb7575e758d7b1c979dc514a355942b9ba3b6d19
adf883db5b7513ffc2159a93ac667e3939e68f54
/P2PBay/src/ist/p2p/service/SearchAnItemService.java
78bc7979140aec120cde7998b8a6f4f7a69a6f70
[ "Apache-2.0" ]
permissive
hdlopesrocha/p2pbay
554ff1b107f095caf3e62af1196fcc2cbc53f4d7
66ce4da56ea211656aa770fb00aa53b8e8548f24
refs/heads/master
2020-12-26T02:01:16.870488
2015-08-18T18:24:26
2015-08-18T18:24:26
25,408,056
0
0
null
null
null
null
UTF-8
Java
false
false
2,163
java
package ist.p2p.service; import ist.p2p.domain.Item; import ist.p2p.dto.ItemDto; import ist.p2p.logic.LogicNode; import ist.p2p.logic.LogicString; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Map.Entry; import java.util.TreeMap; // TODO: Auto-generated Javadoc /** * The Class SearchItemService. */ public class SearchAnItemService extends P2PBayService { /** The search. */ private String search; /** The items. */ private List<ItemDto> items; /** * Instantiates a new search item service. * * @param search * the search */ public SearchAnItemService(String search) { this.search = search; } private void rec(HashSet<String> tokens, LogicNode node) { if (node instanceof LogicString) { tokens.add(node.toString()); } for (LogicNode n : node.getArgs()) { rec(tokens, n); } } /* * (non-Javadoc) * * @see ist.p2p.service.P2PBayService#execute() */ @Override public boolean execute() { items = new ArrayList<ItemDto>(); final HashSet<String> neededTokens = new HashSet<String>(); final LogicNode rootNode = LogicNode.extractFromString(search); rec(neededTokens, rootNode); final TreeMap<String, List<String>> temp = new TreeMap<String, List<String>>(); // <fileId, // tokens> for (String token : neededTokens) { final List<Object> indexs = getAll(DOMAIN_WORD , token); for (Object obj : indexs) { String f = (String) obj; List<String> ftokens = temp.get(f); if (ftokens == null) { ftokens = new ArrayList<String>(); temp.put(f, ftokens); } ftokens.add(token); } } for (Entry<String, List<String>> fileTokens : temp.entrySet()) { if (rootNode.check(fileTokens.getValue())) { final Item product = (Item) get(DOMAIN_ITEM , fileTokens.getKey()); if (product != null) { items.add(new ItemDto(fileTokens.getKey(), product .getOwner(), product.getTitle(), product .getDescription())); } } } return true; } /** * Gets the items. * * @return the items */ public List<ItemDto> getItems() { return items; } }
[ "hdlopesrocha91@gmail.com" ]
hdlopesrocha91@gmail.com
a8398784ee7220079bf6d834885e4c641fcade92
ada4d2d92fa7f2657b16bc12faab83d92b27b5ac
/app/src/main/java/com/example/mapsfromscratch/View/MuseumViewHolder.java
434fa0127be54eb29e24e4f47095b55d05bb6b0c
[]
no_license
GreggNicholas/Maps-app-from-scratch
11f9ff010cdb0cef724c2106c5a190ef6017da7f
07327cf3760e1175a7971d3e17185b49f4200501
refs/heads/master
2020-04-21T04:51:53.944772
2019-02-06T07:43:42
2019-02-06T07:43:42
169,324,725
0
0
null
null
null
null
UTF-8
Java
false
false
1,779
java
package com.example.mapsfromscratch.View; import android.content.Intent; import android.support.annotation.NonNull; import android.support.v7.widget.CardView; import android.support.v7.widget.RecyclerView; import android.view.View; import android.widget.TextView; import com.example.mapsfromscratch.Fragment.FragmentInterface; import com.example.mapsfromscratch.Fragment.MainFragment; import com.example.mapsfromscratch.Model.MuseumObject; import com.example.mapsfromscratch.R; public class MuseumViewHolder extends RecyclerView.ViewHolder { private TextView name; private TextView address; private TextView city; private TextView state; private TextView zip; private CardView cardView; public MuseumViewHolder(@NonNull View itemView) { super(itemView); name = (TextView) itemView.findViewById(R.id.name); address = (TextView) itemView.findViewById(R.id.address); city = (TextView) itemView.findViewById(R.id.city); state = (TextView) itemView.findViewById(R.id.state); zip = (TextView) itemView.findViewById(R.id.zip); cardView = itemView.findViewById(R.id.cardview); } public void onBind(final MuseumObject museumObject) { name.setText(museumObject.getName()); address.setText(museumObject.getAddress()); city.setText(museumObject.getCity()); state.setText(museumObject.getState()); zip.setText(museumObject.getZip()); cardView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { FragmentInterface fragmentInterface = (FragmentInterface) itemView.getContext(); fragmentInterface.startMap(museumObject); } }); } }
[ "Greggnicholas@pursuit.org" ]
Greggnicholas@pursuit.org
750382a0dfb861a010141f76466e91b4381bb696
dd18b0e2bfe2404cf2a42a856a22ed3c9dbbd7ec
/src/test/java/ImageHoster/controller/ImageControllerTest.java
1731a0b8bf301f541ebe241dd4939b7fd8ef060e
[]
no_license
Vinay-Venkatesh/ImageHoster
bd0ec33ed8c72494c656eec03dc096c9ad1eb46c
442965d45f154032c85bd3eb1fe77996c430f502
refs/heads/main
2023-02-09T09:22:35.195842
2020-12-21T13:42:17
2020-12-21T13:42:17
323,088,243
1
0
null
null
null
null
UTF-8
Java
false
false
12,265
java
package ImageHoster.controller; import ImageHoster.model.Image; import ImageHoster.model.Tag; import ImageHoster.model.User; import ImageHoster.model.UserProfile; import ImageHoster.service.ImageService; import ImageHoster.service.TagService; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.mock.web.MockHttpSession; import org.springframework.mock.web.MockMultipartFile; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import java.util.ArrayList; import java.util.List; import static org.hamcrest.CoreMatchers.containsString; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; @RunWith(SpringRunner.class) @WebMvcTest(ImageController.class) public class ImageControllerTest { protected MockHttpSession session; @Autowired private MockMvc mockMvc; @MockBean private ImageService imageService; @MockBean private TagService tagService; //This test checks the controller logic to get all the images after the user is logged in the application and checks whether the logic returns the html file 'images.html' @Test public void getUserImages() throws Exception { User user = new User(); UserProfile userProfile = new UserProfile(); userProfile.setId(1); userProfile.setEmailAddress("a@gmail.com"); userProfile.setFullName("Abhi Mahajan"); userProfile.setMobileNumber("9876543210"); user.setProfile(userProfile); user.setId(1); user.setUsername("Abhi"); user.setPassword("password1@"); session = new MockHttpSession(); session.setAttribute("loggeduser", user); this.mockMvc.perform(get("/images").session(session)) .andExpect(view().name("images")) .andExpect(content().string(containsString("Welcome User. These are the images"))); } //This test checks the controller logic when the logged in user sends the GET request to the server to get the details of a particular image and checks whether the logic returns the html file 'images/image.html' @Test public void showImage() throws Exception { User user = new User(); UserProfile userProfile = new UserProfile(); userProfile.setId(1); userProfile.setEmailAddress("a@gmail.com"); userProfile.setFullName("Abhi Mahajan"); userProfile.setMobileNumber("9876543210"); user.setProfile(userProfile); user.setId(1); user.setUsername("Abhi"); user.setPassword("password1@"); session = new MockHttpSession(); session.setAttribute("loggeduser", user); Image image = new Image(); image.setId(1); image.setTitle("new"); image.setDescription("This image is for testing purpose"); image.setUser(user); Mockito.when(imageService.getImage(Mockito.anyInt())).thenReturn(image); this.mockMvc.perform(get("/images/1/new").session(session)) .andExpect(view().name("images/image")) .andExpect(content().string(containsString("Welcome User. This is the image"))); } //This test checks the controller logic when the logged in user sends a GET request to the server to get the form to upload an image in the application and checks whether the logic returns the html file 'images/upload.html' @Test public void uploadImageWithGetRequest() throws Exception { User user = new User(); UserProfile userProfile = new UserProfile(); userProfile.setId(1); userProfile.setEmailAddress("a@gmail.com"); userProfile.setFullName("Abhi Mahajan"); userProfile.setMobileNumber("9876543210"); user.setProfile(userProfile); user.setId(1); user.setUsername("Abhi"); user.setPassword("password1@"); session = new MockHttpSession(); session.setAttribute("loggeduser", user); this.mockMvc.perform(get("/images/upload").session(session)) .andExpect(view().name("images/upload")) .andExpect(content().string(containsString("Upload New Image"))); } //This test checks the controller logic when the logged in submits the image to be uploaded in the application and checks whether the logic returns the html file 'images.html' @Test public void uploadImageWithPostRequest() throws Exception { User user = new User(); UserProfile userProfile = new UserProfile(); userProfile.setId(1); userProfile.setEmailAddress("a@gmail.com"); userProfile.setFullName("Abhi Mahajan"); userProfile.setMobileNumber("9876543210"); user.setProfile(userProfile); user.setId(1); user.setUsername("Abhi"); user.setPassword("password1@"); session = new MockHttpSession(); session.setAttribute("loggeduser", user); MockMultipartFile mockImage = new MockMultipartFile("file", "image.jpg", "image/jpeg", "some_image".getBytes()); String tags = "dog,labrador"; Image image = new Image(); image.setTitle("new"); image.setDescription("This image is for testing purpose"); this.mockMvc.perform(multipart("/images/upload") .file(mockImage) .param("tags", tags) .flashAttr("newImage", image) .session(session)) .andExpect(redirectedUrl("/images")); } //This test checks the controller logic when the owner of the image sends the GET request to get the form to edit the image and checks whether the logic returns the html file 'images/edit.html' @Test public void editImageWithOwnerOfTheImage() throws Exception { User user = new User(); UserProfile userProfile = new UserProfile(); userProfile.setId(1); userProfile.setEmailAddress("a@gmail.com"); userProfile.setFullName("Abhi Mahajan"); userProfile.setMobileNumber("9876543210"); user.setProfile(userProfile); user.setId(1); user.setUsername("Abhi"); user.setPassword("password1@"); session = new MockHttpSession(); session.setAttribute("loggeduser", user); Image image = new Image(); image.setId(1); image.setTitle("new"); image.setDescription("This image is for testing purpose"); image.setUser(user); Tag tag = new Tag(); tag.setId(1); tag.setName("dog"); List<Tag> tags = new ArrayList<>(); tags.add(tag); image.setTags(tags); Mockito.when(imageService.getImage(Mockito.anyInt())).thenReturn(image); this.mockMvc.perform(get("/editImage") .param("imageId", "1") .session(session)) .andExpect(view().name("images/edit")) .andExpect(content().string(containsString("Edit Image"))); } //This test checks the controller logic when non owner of the image sends the GET request to get the form to edit the image and checks whether the Model type object contains the desired attribute with desired value @Test public void editImageWithNonOwnerOfTheImage() throws Exception { User user = new User(); UserProfile userProfile = new UserProfile(); userProfile.setId(1); userProfile.setEmailAddress("a@gmail.com"); userProfile.setFullName("Abhi Mahajan"); userProfile.setMobileNumber("9876543210"); user.setProfile(userProfile); user.setId(1); user.setUsername("Abhi"); user.setPassword("password1@"); session = new MockHttpSession(); session.setAttribute("loggeduser", user); User user1 = new User(); UserProfile userProfile1 = new UserProfile(); userProfile.setId(2); userProfile.setEmailAddress("p@gmail.com"); userProfile.setFullName("Prerna"); userProfile.setMobileNumber("9876543210"); user.setProfile(userProfile1); user.setId(2); user.setUsername("Prerna"); user.setPassword("password1@@"); Image image = new Image(); image.setId(1); image.setTitle("new"); image.setDescription("This image is for testing purpose"); image.setUser(user1); Mockito.when(imageService.getImage(Mockito.anyInt())).thenReturn(image); this.mockMvc.perform(get("/editImage") .param("imageId", "1") .session(session)) .andExpect(model().attribute("editError", "Only the owner of the image can edit the image")); } //This test checks the controller logic when the owner of the image sends the DELETE request to delete the image and checks whether the logic returns the html file 'images.html' @Test public void deleteImageWithOwnerOfTheImage() throws Exception { User user = new User(); UserProfile userProfile = new UserProfile(); userProfile.setId(1); userProfile.setEmailAddress("a@gmail.com"); userProfile.setFullName("Abhi Mahajan"); userProfile.setMobileNumber("9876543210"); user.setProfile(userProfile); user.setId(1); user.setUsername("Abhi"); user.setPassword("password1@"); session = new MockHttpSession(); session.setAttribute("loggeduser", user); Image image = new Image(); image.setId(1); image.setTitle("new"); image.setDescription("This image is for testing purpose"); image.setUser(user); Mockito.when(imageService.getImage(Mockito.anyInt())).thenReturn(image); this.mockMvc.perform(delete("/deleteImage") .param("imageId", "1") .session(session)) .andExpect(redirectedUrl("/images")); } //This test checks the controller logic when non owner of the image sends the DELETE request to delete the image and checks whether the Model type object contains the desired attribute with desired value @Test public void deleteImageWithNonOwnerOfTheImage() throws Exception { User user = new User(); UserProfile userProfile = new UserProfile(); userProfile.setId(1); userProfile.setEmailAddress("a@gmail.com"); userProfile.setFullName("Abhi Mahajan"); userProfile.setMobileNumber("9876543210"); user.setProfile(userProfile); user.setId(1); user.setUsername("Abhi"); user.setPassword("password1@"); session = new MockHttpSession(); session.setAttribute("loggeduser", user); User user1 = new User(); UserProfile userProfile1 = new UserProfile(); userProfile.setId(2); userProfile.setEmailAddress("p@gmail.com"); userProfile.setFullName("Prerna"); userProfile.setMobileNumber("9876543210"); user.setProfile(userProfile1); user.setId(2); user.setUsername("Prerna"); user.setPassword("password1@@"); Image image = new Image(); image.setId(1); image.setTitle("new"); image.setDescription("This image is for testing purpose"); image.setUser(user1); Mockito.when(imageService.getImage(Mockito.anyInt())).thenReturn(image); this.mockMvc.perform(delete("/deleteImage") .param("imageId", "1") .session(session)) .andExpect(model().attribute("deleteError", "Only the owner of the image can delete the image")); } }
[ "vvenkatesh@onetrust.com" ]
vvenkatesh@onetrust.com
1cbaa4fb3542bd793a97fc486a9e8f3e1d91b666
448e6b2c19441e33fa3e171c0dcea784451ab45e
/src/test/java/com/ghlh/stockquotes/SohuStockQuotesInquirerTest.java
d3c4ca7d75d39beb0f8ebc40acf9cce5fd4ca5c1
[]
no_license
darknessitachi/ghlh
eee926641b891972a5cec12609f0fa3608acaf2b
7a18a62ad9ce36ed534999122d3e7fe76462c982
refs/heads/master
2020-07-11T16:36:45.056626
2016-03-02T07:02:26
2016-03-02T07:02:26
null
0
0
null
null
null
null
GB18030
Java
false
false
850
java
package com.ghlh.stockquotes; import org.junit.Test; import com.ghlh.stockquotes.SohuStockQuotesInquirer; import com.ghlh.stockquotes.StockQuotesBean; public class SohuStockQuotesInquirerTest { @Test public void testGetStockQuotesBean() { try { String[][] stocks = {{"600036", "招商银行"}, {"000002", "万科A"}, {"300077", "国民技术"}}; for (int i = 0; i < stocks.length; i++) { SohuStockQuotesInquirer internetStockQuotesInquirer = new SohuStockQuotesInquirer(); StockQuotesBean stockQuotesBean = internetStockQuotesInquirer .getStockQuotesBean(stocks[i][0]); assert (stockQuotesBean.getStockId().equals(stocks[i][0])); assert (stockQuotesBean.getName().equals(stocks[i][1])); assert (stockQuotesBean.getCurrentPrice() >= 0); } } catch (Exception ex) { ex.printStackTrace(); } } }
[ "lqj.liu@gmail.com" ]
lqj.liu@gmail.com
75605ae3afda98ab62258329b367c0f524f7cf19
6d156e97822e6f39e2e7f27fbe3cd1cbefd7ec0f
/src/Magic8Ball.java
41684de61e06ee173f470c16b7126f082161b662
[]
no_license
raeesbb8/IntroToJavaWorkshop
73bc7b1853f0bebce6b8573c6da0252a71509638
608fdb1c42cea996be2ce631858115e05fbf34e0
refs/heads/master
2020-12-25T11:15:34.143735
2016-04-22T01:25:41
2016-04-22T01:25:41
52,050,336
0
0
null
2016-02-19T00:49:20
2016-02-19T00:49:20
null
UTF-8
Java
false
false
1,272
java
//Copyright Wintriss Technical Schools 2013 import java.util.Random; import javax.swing.JOptionPane; import com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ; public class Magic8Ball { // 1. Make a main method that includes all the steps below…. public static void main(String[] args) { // 2. Make a variable that will hold a random number and put a random number into this variable using "new // Random().nextInt(4)" int number = new Random().nextInt(4); // 3. Print out this variable JOptionPane.showConfirmDialog(null, number); // 4. Get the user to enter a question for the 8 ball JOptionPane.showInputDialog("enter a question"); // 5. If the random number is 0 if (number == 0) { // -- tell the user "Yes" JOptionPane.showMessageDialog(null, "yes"); } // 6. If the random number is 1 if (number == 1) { JOptionPane.showMessageDialog(null, "no"); } // -- tell the user "No" // 7. If the random number is 2 // -- tell the user "Maybe you should ask Google?" if (number == 2) { JOptionPane.showMessageDialog(null, "Maybe you should ask Google"); } // 8. If the random number is 3 if (number == 3) { JOptionPane.showMessageDialog(null, "you will never git it"); } // -- write your own answer } }
[ "league@Mac-mini.local" ]
league@Mac-mini.local
fbdee90f7d3bd6779dfacc8bdefea50302c58a73
82cc2675fdc5db614416b73307d6c9580ecbfa0c
/eb-service/front-service/src/main/java/cn/comtom/ebs/front/main/ebmDispatch/service/IEbmDispatchService.java
f087d60663a8e7330500c62c9eab8b889876053e
[]
no_license
hoafer/ct-ewbsv2.0
2206000c4d7c3aaa2225f9afae84a092a31ab447
bb94522619a51c88ebedc0dad08e1fd7b8644a8c
refs/heads/master
2022-11-12T08:41:26.050044
2020-03-20T09:05:36
2020-03-20T09:05:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
341
java
package cn.comtom.ebs.front.main.ebmDispatch.service; import cn.comtom.domain.core.ebm.info.EbmDispatchAndEbdFileInfo; import java.util.List; /** * @author:WJ * @date: 2019/1/19 0019 * @time: 上午 11:24 */ public interface IEbmDispatchService { List<EbmDispatchAndEbdFileInfo> getEbmDispatchAndEbdFileByEbmId(String ebmId); }
[ "568656253@qq.com" ]
568656253@qq.com
75cf2be2182beed94552aad24bb5026698c80d3b
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XRENDERING-418-18-14-MOEAD-WeightedSum:TestLen:CallDiversity/org/xwiki/rendering/internal/parser/xhtml/wikimodel/XWikiCommentHandler_ESTest_scaffolding.java
1f246eac982b19a6f62a933d1c29a56e1da88a76
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
475
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Wed Apr 08 04:13:30 UTC 2020 */ package org.xwiki.rendering.internal.parser.xhtml.wikimodel; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class XWikiCommentHandler_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
2a9f073e1a49257d440e0df73222e4fc690c2a5c
d33574802593c6bb49d44c69fc51391f7dc054af
/ShipLinx/docs/ws/ShiplinxWSClient/src/main/java/com/meritconinc/shiplinx/ws/proxy/datatypes/AddressWSType.java
835cc84c311c4d0567f7c5dcc3e80dad0b87e5c5
[]
no_license
mouadaarab/solushipalertmanagement
96734a0ff238452531be7f4d12abac84b88de214
eb4cf67a7fbf54760edd99dc51efa12d74fa058e
refs/heads/master
2021-12-06T06:09:15.559467
2015-10-06T09:00:54
2015-10-06T09:00:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
10,072
java
package com.meritconinc.shiplinx.ws.proxy.datatypes; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for AddressWSType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="AddressWSType"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="CompanyName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="Address1" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="Address2" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="City" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="ContactName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="CountryCode" type="{http://www.w3.org/2001/XMLSchema}string"/> * &lt;element name="EmailAddress" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="FaxNo" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="MobilePhoneNo" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="PhoneNo" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="PostalCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="ProvinceCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="IsRes" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="Instructions" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "AddressWSType", propOrder = { "companyName", "address1", "address2", "city", "contactName", "countryCode", "emailAddress", "faxNo", "mobilePhoneNo", "phoneNo", "postalCode", "provinceCode", "isRes", "instructions" }) public class AddressWSType { @XmlElement(name = "CompanyName") protected String companyName; @XmlElement(name = "Address1") protected String address1; @XmlElement(name = "Address2") protected String address2; @XmlElement(name = "City") protected String city; @XmlElement(name = "ContactName") protected String contactName; @XmlElement(name = "CountryCode", required = true) protected String countryCode; @XmlElement(name = "EmailAddress") protected String emailAddress; @XmlElement(name = "FaxNo") protected String faxNo; @XmlElement(name = "MobilePhoneNo") protected String mobilePhoneNo; @XmlElement(name = "PhoneNo") protected String phoneNo; @XmlElement(name = "PostalCode") protected String postalCode; @XmlElement(name = "ProvinceCode") protected String provinceCode; @XmlElement(name = "IsRes") protected Boolean isRes; @XmlElement(name = "Instructions") protected String instructions; /** * Gets the value of the companyName property. * * @return * possible object is * {@link String } * */ public String getCompanyName() { return companyName; } /** * Sets the value of the companyName property. * * @param value * allowed object is * {@link String } * */ public void setCompanyName(String value) { this.companyName = value; } /** * Gets the value of the address1 property. * * @return * possible object is * {@link String } * */ public String getAddress1() { return address1; } /** * Sets the value of the address1 property. * * @param value * allowed object is * {@link String } * */ public void setAddress1(String value) { this.address1 = value; } /** * Gets the value of the address2 property. * * @return * possible object is * {@link String } * */ public String getAddress2() { return address2; } /** * Sets the value of the address2 property. * * @param value * allowed object is * {@link String } * */ public void setAddress2(String value) { this.address2 = value; } /** * Gets the value of the city property. * * @return * possible object is * {@link String } * */ public String getCity() { return city; } /** * Sets the value of the city property. * * @param value * allowed object is * {@link String } * */ public void setCity(String value) { this.city = value; } /** * Gets the value of the contactName property. * * @return * possible object is * {@link String } * */ public String getContactName() { return contactName; } /** * Sets the value of the contactName property. * * @param value * allowed object is * {@link String } * */ public void setContactName(String value) { this.contactName = value; } /** * Gets the value of the countryCode property. * * @return * possible object is * {@link String } * */ public String getCountryCode() { return countryCode; } /** * Sets the value of the countryCode property. * * @param value * allowed object is * {@link String } * */ public void setCountryCode(String value) { this.countryCode = value; } /** * Gets the value of the emailAddress property. * * @return * possible object is * {@link String } * */ public String getEmailAddress() { return emailAddress; } /** * Sets the value of the emailAddress property. * * @param value * allowed object is * {@link String } * */ public void setEmailAddress(String value) { this.emailAddress = value; } /** * Gets the value of the faxNo property. * * @return * possible object is * {@link String } * */ public String getFaxNo() { return faxNo; } /** * Sets the value of the faxNo property. * * @param value * allowed object is * {@link String } * */ public void setFaxNo(String value) { this.faxNo = value; } /** * Gets the value of the mobilePhoneNo property. * * @return * possible object is * {@link String } * */ public String getMobilePhoneNo() { return mobilePhoneNo; } /** * Sets the value of the mobilePhoneNo property. * * @param value * allowed object is * {@link String } * */ public void setMobilePhoneNo(String value) { this.mobilePhoneNo = value; } /** * Gets the value of the phoneNo property. * * @return * possible object is * {@link String } * */ public String getPhoneNo() { return phoneNo; } /** * Sets the value of the phoneNo property. * * @param value * allowed object is * {@link String } * */ public void setPhoneNo(String value) { this.phoneNo = value; } /** * Gets the value of the postalCode property. * * @return * possible object is * {@link String } * */ public String getPostalCode() { return postalCode; } /** * Sets the value of the postalCode property. * * @param value * allowed object is * {@link String } * */ public void setPostalCode(String value) { this.postalCode = value; } /** * Gets the value of the provinceCode property. * * @return * possible object is * {@link String } * */ public String getProvinceCode() { return provinceCode; } /** * Sets the value of the provinceCode property. * * @param value * allowed object is * {@link String } * */ public void setProvinceCode(String value) { this.provinceCode = value; } /** * Gets the value of the isRes property. * * @return * possible object is * {@link Boolean } * */ public Boolean isIsRes() { return isRes; } /** * Sets the value of the isRes property. * * @param value * allowed object is * {@link Boolean } * */ public void setIsRes(Boolean value) { this.isRes = value; } /** * Gets the value of the instructions property. * * @return * possible object is * {@link String } * */ public String getInstructions() { return instructions; } /** * Sets the value of the instructions property. * * @param value * allowed object is * {@link String } * */ public void setInstructions(String value) { this.instructions = value; } }
[ "harikrishnan.r@mitosistech.com" ]
harikrishnan.r@mitosistech.com
876a955c3c5634aec47b54b8e21cccaddc4d9f71
8c22165364ac6405486b040a5a6a67e96923fc03
/modules/businsurance/businsurance-consumer/src/main/java/com/bjike/goddess/businsurance/action/businsurance/CasualtyPurchasingListAction.java
60e3991519c3f314dd4399695efd31e5ce4bc4bc
[]
no_license
zhuangkaiqin/goddess-java
95c115706d688fea7f1dead7db20947d20ecdeaa
eee5776f25746c06e31bc621acc59ea3507b3ee3
refs/heads/master
2020-06-19T04:53:42.689160
2017-10-24T02:06:03
2017-10-24T02:06:03
94,176,316
0
0
null
2017-06-13T06:15:31
2017-06-13T06:15:31
null
UTF-8
Java
false
false
13,287
java
package com.bjike.goddess.businsurance.action.businsurance; import com.bjike.goddess.businsurance.api.CarInsureAPI; import com.bjike.goddess.businsurance.api.CasualtyPurchasingListAPI; import com.bjike.goddess.businsurance.bo.CasualtyPurchasingListBO; import com.bjike.goddess.businsurance.dto.CasualtyPurchasingListDTO; import com.bjike.goddess.businsurance.entity.CasualtyPurchasingList; import com.bjike.goddess.businsurance.excel.CasualtyPurchasingListExcel; import com.bjike.goddess.businsurance.to.CasualtyPurchasingListTO; import com.bjike.goddess.businsurance.to.GuidePermissionTO; import com.bjike.goddess.businsurance.to.SiginManageDeleteFileTO; import com.bjike.goddess.businsurance.vo.CasualtyPurchasingListVO; import com.bjike.goddess.common.api.entity.ADD; import com.bjike.goddess.common.api.entity.EDIT; import com.bjike.goddess.common.api.exception.ActException; import com.bjike.goddess.common.api.exception.SerException; import com.bjike.goddess.common.api.restful.Result; import com.bjike.goddess.common.consumer.action.BaseFileAction; import com.bjike.goddess.common.consumer.interceptor.login.LoginAuth; import com.bjike.goddess.common.consumer.restful.ActResult; import com.bjike.goddess.common.utils.bean.BeanTransform; import com.bjike.goddess.common.utils.excel.Excel; import com.bjike.goddess.common.utils.excel.ExcelUtil; import com.bjike.goddess.storage.api.FileAPI; import com.bjike.goddess.storage.to.FileInfo; import com.bjike.goddess.storage.vo.FileVO; import org.apache.catalina.servlet4preview.http.HttpServletRequest; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.BindingResult; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.List; /** * 团体意外险购买名单 * * @Author: [ lijuntao ] * @Date: [ 2017-09-26 10:24 ] * @Description: [ 团体意外险购买名单 ] * @Version: [ v1.0.0 ] * @Copy: [ com.bjike ] */ @RestController @RequestMapping("casualtypurchasinglist") public class CasualtyPurchasingListAction extends BaseFileAction{ @Autowired private CasualtyPurchasingListAPI casualtyPurchasingListAPI; @Autowired private FileAPI fileAPI; /** * 功能导航权限 * * @param guidePermissionTO 导航类型数据 * @throws ActException * @version v1 */ @GetMapping("v1/guidePermission") public Result guidePermission(@Validated(GuidePermissionTO.TestAdd.class) GuidePermissionTO guidePermissionTO, BindingResult bindingResult, javax.servlet.http.HttpServletRequest request) throws ActException { try { Boolean isHasPermission = casualtyPurchasingListAPI.guidePermission(guidePermissionTO); if (!isHasPermission) { //int code, String msg return new ActResult(0, "没有权限", false); } else { return new ActResult(0, "有权限", true); } } catch (SerException e) { throw new ActException(e.getMessage()); } } /** * 总条数 * * @param casualtyPurchasingListDTO 团体意外险购买名单dto * @des 获取所有团体意外险购买名单总条数 * @version v1 */ @GetMapping("v1/count") public Result count(CasualtyPurchasingListDTO casualtyPurchasingListDTO) throws ActException { try { Long count = casualtyPurchasingListAPI.countCasualty(casualtyPurchasingListDTO); return ActResult.initialize(count); } catch (SerException e) { throw new ActException(e.getMessage()); } } /** * 一个团体意外险购买名单 * @param id id * @return CasualtyPurchasingListVO * @version v1 */ @LoginAuth @GetMapping("v1/casualty/{id}") public Result findById(@PathVariable String id, HttpServletRequest request) throws ActException { try { CasualtyPurchasingListBO bo = casualtyPurchasingListAPI.getOneCasualty(id); CasualtyPurchasingListVO vo = BeanTransform.copyProperties(bo, CasualtyPurchasingListVO.class, request); return ActResult.initialize(vo); } catch (SerException e) { throw new ActException(e.getMessage()); } } /** * 团体意外险购买名单列表 * * @param casualtyPurchasingListDTO 团体意外险购买名单dto * @return class CasualtyPurchasingListVO * @des 获取所有团体意外险购买名单 * @version v1 */ @GetMapping("v1/listCarInsure") public Result findList(CasualtyPurchasingListDTO casualtyPurchasingListDTO, BindingResult bindingResult) throws ActException { try { List<CasualtyPurchasingListVO> casualtyPurchasingListVOS = BeanTransform.copyProperties( casualtyPurchasingListAPI.listCasualty(casualtyPurchasingListDTO), CasualtyPurchasingListVO.class, true); return ActResult.initialize(casualtyPurchasingListVOS); } catch (SerException e) { throw new ActException(e.getMessage()); } } /** * 添加 * * @param casualtyPurchasingListTO 团体意外险购买名单数据to * @return class CasualtyPurchasingListVO * @des 添加 团体意外险购买名单 * @version v1 */ @LoginAuth @PostMapping("v1/add") public Result add(@Validated(ADD.class) CasualtyPurchasingListTO casualtyPurchasingListTO, BindingResult bindingResult) throws ActException { try { CasualtyPurchasingListBO casualtyPurchasingListBO = casualtyPurchasingListAPI.addCasualty(casualtyPurchasingListTO); return ActResult.initialize(BeanTransform.copyProperties(casualtyPurchasingListBO, CasualtyPurchasingListVO.class)); } catch (SerException e) { throw new ActException(e.getMessage()); } } /** * 编辑 * * @param casualtyPurchasingListTO 团体意外险购买名单数据bo * @return class CasualtyPurchasingListVO * @des 编辑团体意外险购买名单 * @version v1 */ @LoginAuth @PutMapping("v1/edit") public Result edit(@Validated(EDIT.class) CasualtyPurchasingListTO casualtyPurchasingListTO) throws ActException { try { CasualtyPurchasingListBO casualtyPurchasingListBO = casualtyPurchasingListAPI.editCasualty(casualtyPurchasingListTO); return ActResult.initialize(BeanTransform.copyProperties(casualtyPurchasingListBO, CasualtyPurchasingListVO.class)); } catch (SerException e) { throw new ActException(e.getMessage()); } } /** * 删除 * * @param id id * @des 根据id删除团体意外险购买名单 * @version v1 */ @LoginAuth @DeleteMapping("v1/delete/{id}") public Result delete(@PathVariable String id) throws ActException { try { casualtyPurchasingListAPI.deleteCasualty(id); return new ActResult("delete success!"); } catch (SerException e) { throw new ActException("删除失败:" + e.getMessage()); } } /** * 导入Excel * * @param request 注入HttpServletRequest对象 * @version v1 */ @LoginAuth @PostMapping("v1/importExcel") public Result importExcel(HttpServletRequest request) throws ActException { try { List<InputStream> inputStreams = super.getInputStreams(request); InputStream is = inputStreams.get(1); Excel excel = new Excel(0, 1); List<CasualtyPurchasingListExcel> tos = ExcelUtil.excelToClazz(is, CasualtyPurchasingListExcel.class, excel); List<CasualtyPurchasingListTO> tocs = new ArrayList<>(); for (CasualtyPurchasingListExcel str : tos) { CasualtyPurchasingListTO casualtyPurchasingListTO = BeanTransform.copyProperties(str, CasualtyPurchasingListTO.class, "effectiveDate", "surrInsurApplyDate","birthDate"); casualtyPurchasingListTO.setEffectiveDate(String.valueOf(str.getEffectiveDate())); casualtyPurchasingListTO.setSurrInsurApplyDate(String.valueOf(str.getEffectiveDate())); casualtyPurchasingListTO.setBirthDate(String.valueOf(str.getBirthDate())); tocs.add(casualtyPurchasingListTO); } //注意序列化 casualtyPurchasingListAPI.importExcel(tocs); return new ActResult("导入成功"); } catch (SerException e) { throw new ActException(e.getMessage()); } } /** * 导出excel * * @des 导出团体意外险购买名单 * @version v1 */ @LoginAuth @GetMapping("v1/export") public Result exportReport(HttpServletResponse response) throws ActException { try { String fileName = "团体意外险购买名单.xlsx"; super.writeOutFile(response, casualtyPurchasingListAPI.exportExcel(), fileName); return new ActResult("导出成功"); } catch (SerException e) { throw new ActException(e.getMessage()); } catch (IOException e1) { throw new ActException(e1.getMessage()); } } /** * excel模板下载 * * @des 下载模板团体意外险购买名单 * @version v1 */ @GetMapping("v1/templateExport") public Result templateExport(HttpServletResponse response) throws ActException { try { String fileName = "团体意外险购买名单模板.xlsx"; super.writeOutFile(response, casualtyPurchasingListAPI.templateExport(), fileName); return new ActResult("导出成功"); } catch (SerException e) { throw new ActException(e.getMessage()); } catch (IOException e1) { throw new ActException(e1.getMessage()); } } /** * 上传附件 * * @version v1 */ @LoginAuth @PostMapping("v1/uploadFile/{id}") public Result uploadFile(@PathVariable String id, javax.servlet.http.HttpServletRequest request) throws ActException { try { //跟前端约定好 ,文件路径是列表id // /id/.... String path = "/" + id; List<InputStream> inputStreams = getInputStreams(request, path); fileAPI.upload(inputStreams); return new ActResult("upload success"); } catch (SerException e) { throw new ActException(e.getMessage()); } } /** * 文件附件列表 * * @param id id * @return class FileVO * @version v1 */ @GetMapping("v1/listFile/{id}") public Result list(@PathVariable String id, javax.servlet.http.HttpServletRequest request) throws ActException { try { //跟前端约定好 ,文件路径是列表id String path = "/" + id; FileInfo fileInfo = new FileInfo(); fileInfo.setPath(path); Object storageToken = request.getAttribute("storageToken"); fileInfo.setStorageToken(storageToken.toString()); List<FileVO> files = BeanTransform.copyProperties(fileAPI.list(fileInfo), FileVO.class); return ActResult.initialize(files); } catch (SerException e) { throw new ActException(e.getMessage()); } } /** * 文件下载 * * @param path 文件路径 * @version v1 */ @GetMapping("v1/downloadFile") public Result download(@RequestParam String path, javax.servlet.http.HttpServletRequest request, HttpServletResponse response) throws ActException { try { //该文件的路径 FileInfo fileInfo = new FileInfo(); Object storageToken = request.getAttribute("storageToken"); fileInfo.setStorageToken(storageToken.toString()); fileInfo.setPath(path); String filename = StringUtils.substringAfterLast(fileInfo.getPath(), "/"); byte[] buffer = fileAPI.download(fileInfo); writeOutFile(response, buffer, filename); return new ActResult("download success"); } catch (Exception e) { throw new ActException(e.getMessage()); } } /** * 删除文件或文件夹 * * @param siginManageDeleteFileTO 多文件信息路径 * @version v1 */ @LoginAuth @PostMapping("v1/deleteFile") public Result delFile(@Validated(SiginManageDeleteFileTO.TestDEL.class) SiginManageDeleteFileTO siginManageDeleteFileTO, javax.servlet.http.HttpServletRequest request) throws SerException { if (null != siginManageDeleteFileTO.getPaths() && siginManageDeleteFileTO.getPaths().length >= 0) { Object storageToken = request.getAttribute("storageToken"); fileAPI.delFile(storageToken.toString(), siginManageDeleteFileTO.getPaths()); } return new ActResult("delFile success"); } }
[ "lijuntao_aj@163.com" ]
lijuntao_aj@163.com
c90e30037bcc4be1c4a4d32bd744d87a89fef151
4ad17f7216a2838f6cfecf77e216a8a882ad7093
/clbs/src/main/java/com/zw/platform/basic/constant/RegexKey.java
bf37d662150bb921dfd56945b752377b0a881178
[ "MIT" ]
permissive
djingwu/hybrid-development
b3c5eed36331fe1f404042b1e1900a3c6a6948e5
784c5227a73d1e6609b701a42ef4cdfd6400d2b7
refs/heads/main
2023-08-06T22:34:07.359495
2021-09-29T02:10:11
2021-09-29T02:10:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
999
java
package com.zw.platform.basic.constant; /** * 正则表达式常量 * * @author zhangjuan */ public interface RegexKey { /** * 人员编号正则 */ String PEOPLE_NUM_REG = "^[a-zA-Z0-9\u4e00-\u9fa5-]{2,20}$"; /** * 15身份识别号正则 */ String IDENTITY_REG_15 = "^[1-9]\\d{7}((0\\d)|(1[0-2]))(([0-2]\\d)|3[0-1])[\\dX]{3}$"; /** * 18位身份证号正则表达式 */ String IDENTITY_REG_18 = "^[1-9]\\d{5}[1-9]\\d{3}((0\\d)|(1[0-2]))(([0-2]\\d)|3[0-1])[\\dX]{4}$"; /** * 国内电话号码正则表达式 */ String PHONE = "^[1][3456789]\\d{9}$"; /** * 座机正则表达式 */ String TEL_PHONE = "^(\\d{3,4}-?)?\\d{7,9}$"; /** * 车主名字正则 */ String VEHICLE_OWNER_REGEX = "^[A-Za-z\\u4e00-\\u9fa5]{1,8}$"; /** * 小数点保留一位,不算"."一共10位 */ String DOUBLE_REGEX_10_1 = "^(?:0\\.[1-9]|[1-9][0-9]{0,9}|[1-9][0-9]{0,7}\\.[1-9])$"; }
[ "wuxuetao@zwlbs.com" ]
wuxuetao@zwlbs.com
a1b445886c7f77ce1e4a55bf3e6fd956beb9ef94
0db6a7fd642a6737196bb52978c1fa4a94bfb01a
/Space3009/app/src/main/java/space/threem/Space3k9/game/ShotBase.java
5286ebf10afbc9fa2e2cc5f827b1eec92f425dfb
[]
no_license
3MGames/ShootEmUp
b2a9ed5e6be1c3319e4089c682be1c3caf667f04
352ea00aad0e4f513e56ee09ea06b4b28301a3db
refs/heads/master
2020-12-25T19:15:40.970833
2015-03-22T08:35:37
2015-03-22T08:35:37
30,258,051
0
0
null
null
null
null
UTF-8
Java
false
false
348
java
package space.threem.Space3k9.game; /** * Created by Stalo on 8. 3. 2015. */ public class ShotBase { public static final int SHOT_TYPE = 0; public static final int SHIP_FALL = 1; public static final int BOB_STATE_HIT = 2; public static final float SHIP_TOWARD_SPEED = 11; public static final float SHIP_MOVE_VELOCITY = 20; }
[ "mr.stalo@gmail.com" ]
mr.stalo@gmail.com
bd9e79c70c81959e70958e6463aca6d1d971dd4d
864dd4fd8b5aef008ff8100775e7360f02a7f4ec
/app/src/test/java/com/azetech/insentiva/ExampleUnitTest.java
ea825af2d33c34b0ead17177cabe11ad7be8b335
[]
no_license
haseebpoolakkal/Incentiva
ee701b2d6250e910819b3be893f4117eddda64bb
f079f9c6bb1df6af5e8b4b490d3bae5a15dcc670
refs/heads/main
2023-06-02T12:48:47.781465
2021-06-23T15:37:46
2021-06-23T15:37:46
379,651,639
0
0
null
null
null
null
UTF-8
Java
false
false
382
java
package com.azetech.insentiva; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
[ "haseebpoolakkal@gmail.com" ]
haseebpoolakkal@gmail.com
355509f7fea16474117801c3e970b63907947489
b348f05d43afa787f01dcfcc60f8b5125d74e3a6
/src/main/java/co/nyzo/verifier/messages/debug/MeshStatusResponse.java
9d57f3b0b2c22f0b51aa546422cf504b0562701c
[ "Unlicense" ]
permissive
avv800/nyzoVerifier
a82c052fc72661be05c6e123b983f1a83f143f44
64a8f8730e6fc224f4e15b1c4fdc49a04f3c8689
refs/heads/master
2020-06-13T04:57:13.125907
2019-06-30T18:43:02
2019-06-30T18:43:02
194,543,215
0
0
Unlicense
2019-06-30T17:31:03
2019-06-30T17:31:03
null
UTF-8
Java
false
false
4,734
java
package co.nyzo.verifier.messages.debug; import co.nyzo.verifier.*; import co.nyzo.verifier.messages.MultilineTextResponse; import co.nyzo.verifier.util.PrintUtil; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; public class MeshStatusResponse implements MessageObject, MultilineTextResponse { private static final int maximumNumberOfLines = 2000; private List<String> lines; public MeshStatusResponse(Message request) { // This is a debug request, so it must be signed by the local verifier. if (ByteUtil.arraysAreEqual(request.getSourceNodeIdentifier(), Verifier.getIdentifier())) { List<Node> nodes = NodeManager.getMesh(); Collections.sort(nodes, new Comparator<Node>() { @Override public int compare(Node node1, Node node2) { Long queueTimestamp1 = node1.getQueueTimestamp(); Long queueTimestamp2 = node2.getQueueTimestamp(); return queueTimestamp1.compareTo(queueTimestamp2); } }); // TODO: timestamp in-cycle verifiers with current timestamp to prevent promotion to top of queue when // TODO: dropping out // TODO: persist join timestamps to file -- this should be done based on identifier, and they should be // TODO: reloaded when the verifier is restarted ByteBuffer currentNewVerifierVote = NewVerifierQueueManager.getCurrentVote(); List<ByteBuffer> topVerifiers = NewVerifierVoteManager.topVerifiers(); List<String> lines = new ArrayList<>(); for (int i = 0; i < nodes.size() && lines.size() < maximumNumberOfLines; i++) { Node node = nodes.get(i); byte[] identifier = node.getIdentifier(); int topVerifierIndex = topVerifiers.indexOf(ByteBuffer.wrap(identifier)); boolean isCurrentVote = ByteBuffer.wrap(identifier).equals(currentNewVerifierVote); lines.add((BlockManager.verifierInCurrentCycle(ByteBuffer.wrap(identifier)) ? "C, " : " , ") + PrintUtil.compactPrintByteArray(identifier) + ", " + node.getQueueTimestamp() + ", " + (topVerifierIndex < 0 ? "-" : topVerifierIndex + "") + ", " + (isCurrentVote ? "*" : "-") + ", " + NicknameManager.get(identifier)); } this.lines = lines; } else { this.lines = new ArrayList<>(); } } public MeshStatusResponse(List<String> lines) { this.lines = lines; } public List<String> getLines() { return lines; } @Override public int getByteSize() { // The list length was previously a single byte. If working with an older version of the verifier, this class // will not work without modifications. Typically, a new message would be made to handle this sort of change, // but as this is a debug message that is rarely used, we felt that adding another message would be wasteful. int byteSize = 2; // list length for (String line : lines) { byteSize += FieldByteSize.string(line); } return byteSize; } @Override public byte[] getBytes() { byte[] result = new byte[getByteSize()]; ByteBuffer buffer = ByteBuffer.wrap(result); buffer.putShort((short) lines.size()); for (String line : lines) { byte[] lineBytes = line.getBytes(StandardCharsets.UTF_8); buffer.putShort((short) lineBytes.length); buffer.put(lineBytes); } return result; } public static MeshStatusResponse fromByteBuffer(ByteBuffer buffer) { MeshStatusResponse result = null; try { int numberOfLines = buffer.getShort() & 0xffff; List<String> lines = new ArrayList<>(); for (int i = 0; i < numberOfLines; i++) { short lineByteLength = buffer.getShort(); byte[] lineBytes = new byte[lineByteLength]; buffer.get(lineBytes); lines.add(new String(lineBytes, StandardCharsets.UTF_8)); } result = new MeshStatusResponse(lines); } catch (Exception ignored) { ignored.printStackTrace(); } return result; } @Override public String toString() { StringBuilder result = new StringBuilder("[MeshStatusResponse(lines=" + lines.size() + ")]"); return result.toString(); } }
[ "nyzo@nyzo.co" ]
nyzo@nyzo.co
90f3aa101049bf75e79b60b59b8d6b833af6e26b
c51155be782f76adc3ef2b50f61b29be9fd3e912
/src/com/rockter/server/basic/test/XmlTest.java
f7b2819ad3eb2bf83d68ae36d864365833d09589
[]
no_license
RockterHam/RockterWebService
d3c28287863e18d47372650960c068f3b8fd30d3
3d744463bc92133bc921d30afeef848afc95b9ff
refs/heads/master
2020-08-15T16:51:30.770899
2019-10-21T17:42:52
2019-10-21T17:42:52
215,374,531
0
0
null
null
null
null
UTF-8
Java
false
false
2,993
java
package com.rockter.server.basic.test; import org.xml.sax.Attributes; import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import java.io.IOException; import java.util.ArrayList; import java.util.List; public class XmlTest { public static void main(String[] args) throws ParserConfigurationException, SAXException, IOException { //获取解析工厂 SAXParserFactory factory = SAXParserFactory.newInstance(); //从解析工厂获取解析器 SAXParser parser = factory.newSAXParser(); //加载文档Document注册处理器 //编写处理器 PersonHandler handler = new PersonHandler(); parser.parse(Thread.currentThread().getContextClassLoader().getResourceAsStream("com/rockter/server/basic/test/p.xml"), handler); //获取数据 List<Person> personList = handler.getPersons(); for (var temp:personList){ System.out.println("Age:" + temp.getAge() + "|" + "Name:" + temp.getName()); } } } class PersonHandler extends DefaultHandler{ private List<Person> persons; private Person person; private String tag; @Override public void startDocument() throws SAXException { persons = new ArrayList<Person>(); System.out.println("----解析文档开始----"); } @Override public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { System.out.println("start--"+qName); if (null != qName){ tag = qName; if (tag.equals("person")){ person = new Person(); System.out.println("开始解析Person"); } } } @Override public void characters(char[] ch, int start, int length) throws SAXException { String contents = new String(ch,start,length).trim(); System.out.println("char--"+contents); if (null != tag){ if (tag.equals("name")){ System.out.println(contents); person.setName(contents); }else if (tag.equals("age")){ System.out.println(Integer.valueOf(contents)); person.setAge(Integer.valueOf(contents)); } } } @Override public void endElement(String uri, String localName, String qName) throws SAXException { System.out.println("end--"+qName); if (qName != null && qName.equals("person")){ System.out.println("person放入persons"); persons.add(person); } tag = null; } @Override public void endDocument() throws SAXException { System.out.println("----解析文档结束----"); } public List<Person> getPersons() { return persons; } }
[ "906929613@qq.com" ]
906929613@qq.com
7bd5dddd504c6eb9cfc1bb64359f1dd1b59fa046
6dc5efd0619dd48aba17b7f2dd33180d55c4c734
/main/src/main/java/com/tepia/main/model/task/bean/ResultTypesBean.java
a81e121748ea31111ed398de3d543969eecab6c2
[]
no_license
smellHui/SKGJ_Android_Three
2c9a2b3e7a7f6cd65117a1beb6daa16bfb38fc02
452d2ab97a6226303516a2079385a1536f4bf984
refs/heads/master
2020-12-02T04:15:51.268148
2019-12-27T10:00:22
2019-12-27T10:00:22
230,882,052
1
0
null
null
null
null
UTF-8
Java
false
false
373
java
package com.tepia.main.model.task.bean; import java.io.Serializable; /** * Created by Joeshould on 2018/5/30. */ public class ResultTypesBean implements Serializable { /** * title : 选 */ private String title; public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } }
[ "872904178@qq.com" ]
872904178@qq.com
9c3f5215e565346abe6f4292b2827929f7d27814
684379b3f88885d957de58e97ec5bbb4cecbdf97
/src/main/java/com/example/hellospring/model/dto/EmployeeDTO.java
33278bb2ff7e7135ae53d3e295f76de6b9bd22c5
[]
no_license
laphuong1101/phuonglvd00631-spring
132e5f4ef1849719264654f97a76ad20480b6d66
8d9c1dfc9ab1e68889fadfe6f70657ab08c7b836
refs/heads/master
2023-05-11T15:27:11.090157
2021-06-02T12:31:46
2021-06-02T12:31:46
373,160,419
0
0
null
null
null
null
UTF-8
Java
false
false
307
java
package com.example.hellospring.model.dto; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; @Getter @Setter @AllArgsConstructor @NoArgsConstructor public class EmployeeDTO { private int id; private String name; private int wage; }
[ "phuonglvd00631@fpt.edu.vn" ]
phuonglvd00631@fpt.edu.vn
fbe3ab87fe70c0763986add64d5c946b0b3fe6bc
288725265538c3cebeb032df5c69b34f3602c284
/app/src/main/java/com/wkuglen/app/FullscreenActivity.java
dfa57211d248e3d6a03bae253a7075c907ebe03c
[]
no_license
wkuglen/Deprecated-HelloAndroid
7ae5e746955b6be9bae1430de94d26d5109de30b
bc8fdb0b5e1c8176b8c4d39337c141735676b877
refs/heads/master
2021-01-20T08:37:43.797756
2014-03-22T20:28:34
2014-03-22T20:28:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,904
java
package com.wkuglen.app; import com.wkuglen.app.util.SystemUiHider; import android.annotation.TargetApi; import android.app.Activity; import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.view.MotionEvent; import android.view.View; /** * An example full-screen activity that shows and hides the system UI (i.e. * status bar and navigation/system bar) with user interaction. * * @see SystemUiHider */ public class FullscreenActivity extends Activity { /** * Whether or not the system UI should be auto-hidden after * {@link #AUTO_HIDE_DELAY_MILLIS} milliseconds. */ private static final boolean AUTO_HIDE = true; /** * If {@link #AUTO_HIDE} is set, the number of milliseconds to wait after * user interaction before hiding the system UI. */ private static final int AUTO_HIDE_DELAY_MILLIS = 3000; /** * If set, will toggle the system UI visibility upon interaction. Otherwise, * will show the system UI visibility upon interaction. */ private static final boolean TOGGLE_ON_CLICK = true; /** * The flags to pass to {@link SystemUiHider#getInstance}. */ private static final int HIDER_FLAGS = SystemUiHider.FLAG_HIDE_NAVIGATION; /** * The instance of the {@link SystemUiHider} for this activity. */ private SystemUiHider mSystemUiHider; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_fullscreen); final View controlsView = findViewById(R.id.fullscreen_content_controls); final View contentView = findViewById(R.id.fullscreen_content); // Set up an instance of SystemUiHider to control the system UI for // this activity. mSystemUiHider = SystemUiHider.getInstance(this, contentView, HIDER_FLAGS); mSystemUiHider.setup(); mSystemUiHider .setOnVisibilityChangeListener(new SystemUiHider.OnVisibilityChangeListener() { // Cached values. int mControlsHeight; int mShortAnimTime; @Override @TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2) public void onVisibilityChange(boolean visible) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) { // If the ViewPropertyAnimator API is available // (Honeycomb MR2 and later), use it to animate the // in-layout UI controls at the bottom of the // screen. if (mControlsHeight == 0) { mControlsHeight = controlsView.getHeight(); } if (mShortAnimTime == 0) { mShortAnimTime = getResources().getInteger( android.R.integer.config_shortAnimTime); } controlsView.animate() .translationY(visible ? 0 : mControlsHeight) .setDuration(mShortAnimTime); } else { // If the ViewPropertyAnimator APIs aren't // available, simply show or hide the in-layout UI // controls. controlsView.setVisibility(visible ? View.VISIBLE : View.GONE); } if (visible && AUTO_HIDE) { // Schedule a hide(). delayedHide(AUTO_HIDE_DELAY_MILLIS); } } }); // Set up the user interaction to manually show or hide the system UI. contentView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (TOGGLE_ON_CLICK) { mSystemUiHider.toggle(); } else { mSystemUiHider.show(); } } }); // Upon interacting with UI controls, delay any scheduled hide() // operations to prevent the jarring behavior of controls going away // while interacting with the UI. findViewById(R.id.dummy_button).setOnTouchListener(mDelayHideTouchListener); } @Override protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); // Trigger the initial hide() shortly after the activity has been // created, to briefly hint to the user that UI controls // are available. delayedHide(100); } /** * Touch listener to use for in-layout UI controls to delay hiding the * system UI. This is to prevent the jarring behavior of controls going away * while interacting with activity UI. */ View.OnTouchListener mDelayHideTouchListener = new View.OnTouchListener() { @Override public boolean onTouch(View view, MotionEvent motionEvent) { if (AUTO_HIDE) { delayedHide(AUTO_HIDE_DELAY_MILLIS); } return false; } }; Handler mHideHandler = new Handler(); Runnable mHideRunnable = new Runnable() { @Override public void run() { mSystemUiHider.hide(); } }; /** * Schedules a call to hide() in [delay] milliseconds, canceling any * previously scheduled calls. */ private void delayedHide(int delayMillis) { mHideHandler.removeCallbacks(mHideRunnable); mHideHandler.postDelayed(mHideRunnable, delayMillis); } }
[ "wkuglen@gmail.com" ]
wkuglen@gmail.com
6a5fc89c791f5775653fbc7822d2f9ac085ab059
f85d7e0bbc5d00f108989eb4e403eeb4dfba7d15
/Ulohy/Soubory/FormatovaneCteni4.java
9fb41e03d23df4fe7e4448ef7a715c05783dfa2f
[]
no_license
gfmp/VVT
9516a849aac3374f99cd144c11dde4e82a9cd2b5
4f0fb994ab1a8ea7cf5103bbf75ee26a11cb4e22
refs/heads/master
2021-01-20T06:55:19.883233
2015-02-16T20:38:50
2015-02-16T20:38:50
4,397,655
0
0
null
null
null
null
UTF-8
Java
false
false
1,106
java
/* * 4. V souboru cisla.txt jsou uložena přirozená čísla oddělená mezerami. Zapište do souboru vystup.txt druhé mocniny těchto čísel. */ package Ulohy.Soubory; import java.io.*; /** * * @author Felix */ public class FormatovaneCteni4 { public static void main(String[] args) { String radek; int a; try { FileReader fr = new FileReader("cisla.txt"); PrintWriter pw = new PrintWriter("cisla-mocniny.txt"); BufferedReader bfr = new BufferedReader(fr); while((radek = bfr.readLine()) != null) { String[] cisla = radek.split(" "); for (int i=0; i < cisla.length; i++) { a = Integer.parseInt(cisla[i]); pw.print(a*a+", "); } } System.out.println("Soubor cisla-mocniny.txt obsahuje 2 mocniny cisel z cisla.txt"); pw.close(); bfr.close(); } catch (Exception e) { System.err.println("Chyba pri cteni souboru: " + e); } } }
[ "felix@noblexity.com" ]
felix@noblexity.com
20953ac744047ca7b516ced8d05de5651f88586c
4688d19282b2b3b46fc7911d5d67eac0e87bbe24
/aws-java-sdk-clouddirectory/src/main/java/com/amazonaws/services/clouddirectory/model/transform/BatchListObjectAttributesResponseJsonUnmarshaller.java
7bef6ec7f040a56fa4235af55ee89aab74b9d18b
[ "Apache-2.0" ]
permissive
emilva/aws-sdk-java
c123009b816963a8dc86469405b7e687602579ba
8fdbdbacdb289fdc0ede057015722b8f7a0d89dc
refs/heads/master
2021-05-13T17:39:35.101322
2018-12-12T13:11:42
2018-12-12T13:11:42
116,821,450
1
0
Apache-2.0
2018-09-19T04:17:41
2018-01-09T13:45:39
Java
UTF-8
Java
false
false
3,314
java
/* * Copyright 2012-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.clouddirectory.model.transform; import java.math.*; import javax.annotation.Generated; import com.amazonaws.services.clouddirectory.model.*; import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; import com.amazonaws.transform.*; import com.fasterxml.jackson.core.JsonToken; import static com.fasterxml.jackson.core.JsonToken.*; /** * BatchListObjectAttributesResponse JSON Unmarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class BatchListObjectAttributesResponseJsonUnmarshaller implements Unmarshaller<BatchListObjectAttributesResponse, JsonUnmarshallerContext> { public BatchListObjectAttributesResponse unmarshall(JsonUnmarshallerContext context) throws Exception { BatchListObjectAttributesResponse batchListObjectAttributesResponse = new BatchListObjectAttributesResponse(); int originalDepth = context.getCurrentDepth(); String currentParentElement = context.getCurrentParentElement(); int targetDepth = originalDepth + 1; JsonToken token = context.getCurrentToken(); if (token == null) token = context.nextToken(); if (token == VALUE_NULL) { return null; } while (true) { if (token == null) break; if (token == FIELD_NAME || token == START_OBJECT) { if (context.testExpression("Attributes", targetDepth)) { context.nextToken(); batchListObjectAttributesResponse.setAttributes(new ListUnmarshaller<AttributeKeyAndValue>(AttributeKeyAndValueJsonUnmarshaller .getInstance()).unmarshall(context)); } if (context.testExpression("NextToken", targetDepth)) { context.nextToken(); batchListObjectAttributesResponse.setNextToken(context.getUnmarshaller(String.class).unmarshall(context)); } } else if (token == END_ARRAY || token == END_OBJECT) { if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) { if (context.getCurrentDepth() <= originalDepth) break; } } token = context.nextToken(); } return batchListObjectAttributesResponse; } private static BatchListObjectAttributesResponseJsonUnmarshaller instance; public static BatchListObjectAttributesResponseJsonUnmarshaller getInstance() { if (instance == null) instance = new BatchListObjectAttributesResponseJsonUnmarshaller(); return instance; } }
[ "" ]
8239e9dcea86cc56409fe1bd33c355bbcf23aa05
92eee350c7f3affc8272b51a00e4691dd172ff42
/app/src/main/java/br/com/uber/brunoclas/uber/helper/Permissoes.java
6d65c7fccf1e1d0214b07834bdd27ac400e9952b
[]
no_license
Brunoclas/Clone-Uber
ff250087e3fbd15a12243122ca5be12fd69bdc9c
5e639884ffa6533f530958e64e1fd2a9155e8337
refs/heads/master
2020-04-16T20:52:37.209718
2019-03-11T18:17:00
2019-03-11T18:17:00
165,908,912
0
0
null
null
null
null
UTF-8
Java
false
false
1,405
java
package br.com.uber.brunoclas.uber.helper; import android.app.Activity; import android.content.pm.PackageManager; import android.os.Build; import android.support.v4.app.ActivityCompat; import android.support.v4.content.ContextCompat; import java.util.ArrayList; import java.util.List; /** * Created by jamiltondamasceno */ public class Permissoes { public static boolean validarPermissoes(String[] permissoes, Activity activity, int requestCode){ if (Build.VERSION.SDK_INT >= 23 ){ List<String> listaPermissoes = new ArrayList<>(); /*Percorre as permissões passadas, verificando uma a uma * se já tem a permissao liberada */ for ( String permissao : permissoes ){ Boolean temPermissao = ContextCompat.checkSelfPermission(activity, permissao) == PackageManager.PERMISSION_GRANTED; if ( !temPermissao ) listaPermissoes.add(permissao); } /*Caso a lista esteja vazia, não é necessário solicitar permissão*/ if ( listaPermissoes.isEmpty() ) return true; String[] novasPermissoes = new String[ listaPermissoes.size() ]; listaPermissoes.toArray( novasPermissoes ); //Solicita permissão ActivityCompat.requestPermissions(activity, novasPermissoes, requestCode ); } return true; } }
[ "bruno.cesar@makrosystems.com.br" ]
bruno.cesar@makrosystems.com.br
f6941b5883d474bbc99925fafb07e3e34ba5aa8d
90552f7cfac2eaed7a830a471bb28164e4ac2e73
/全排列2.java
fc4aaeb02ed9d800ec81d25a59a6f467e6d3fbb1
[]
no_license
TNT-df/java
7b20f8f0d684a87c49ac8608bb62e0d9baf97a97
065eb36c55c0e0a0d067c38afb8545fb8b1aaf12
refs/heads/master
2023-04-09T21:38:31.920761
2021-04-24T13:40:17
2021-04-24T13:40:17
290,117,379
1
0
null
null
null
null
UTF-8
Java
false
false
955
java
给定一个可包含重复数字的序列,返回所有不重复的全排列。 示例: 输入: [1,1,2] 输出: [ [1,1,2], [1,2,1], [2,1,1] ] class Solution { List<List<Integer>> list = new LinkedList<>(); public List<List<Integer>> permuteUnique(int[] nums) { List<Integer> ll = new LinkedList<>(); boolean[] b = new boolean[nums.length]; if(nums.length==0){ return list; } Arrays.sort(nums); dfs(0,ll,b,nums); return list; } public void dfs(int index,List<Integer> ll,boolean[] b,int [] nums){ if(index==nums.length){ list.add(new LinkedList<Integer>(ll)); return; } for(int i = 0 ;i<nums.length;i++){ if(b[i]||(i > 0 && nums[i] == nums[i-1])&&!b[i-1]) //当前未被遍历,去除此元素之前出现 continue; ll.add(nums[i]); b[i]=true ; dfs(index+1,ll,b,nums); b[i]=false; //回溯 ll.remove(ll.size()-1); } } }
[ "135246514@qq.com" ]
135246514@qq.com
5e99275b6c506d40bbedda2b2c7cb23a79a94286
2d088a56dc8c2667eef5497790ae4b72dde33e74
/Lynda/BecomeJavaDev/code clinic/CodeClinic1/src/Main.java
92c22d5678db09ce3f9836237d4273e5511c5b4b
[]
no_license
Ahmed-Ayman/My-2017-Vacation
81bfaeb1d1cbf4ef0fd87972ebea26394a5819bb
bf9c1df042ffbb44b9aab5c530ca7261d0dd0be6
refs/heads/master
2021-08-14T06:12:45.726966
2017-11-14T19:27:39
2017-11-14T19:27:39
92,818,841
2
0
null
null
null
null
UTF-8
Java
false
false
2,032
java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.URL; import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; public class Main { public static void main(String[] args) throws IOException { String[] s = { "", "", "" }; Scanner in = new Scanner(System.in); System.out.println("Enter a year (2006-2014)"); s[0] = in.nextLine(); System.out.println("Enter a month (01-12)"); s[1] = in.nextLine(); System.out.println("Enter a day (01-31)"); s[2] = in.nextLine(); in.close(); ArrayList<Double> windGust = getData("Wind_Gust", s); ArrayList<Double> airTemp = getData("Air_Temp", s); ArrayList<Double> pressure = getData("Barometric_Press", s); System.out.println("Wind Gust: mean " + mean(windGust) + ", median " + median(windGust)); System.out.println("Air Temp: mean " + mean(airTemp) + ", median " + median(airTemp)); System.out.println("Pressure: mean " + mean(pressure) + ", median " + median(pressure)); } public static ArrayList<Double> getData(String type, String[] s) throws NumberFormatException, IOException { URL dataSource = new URL("http://lpo.dt.navy.mil/data/DM/" + s[0] + "/" + s[0] + "_" + s[1] + "_" + s[2] + "/" + type); BufferedReader data = new BufferedReader(new InputStreamReader( dataSource.openStream())); ArrayList<Double> windData = new ArrayList<Double>(); String inputLine; while ((inputLine = data.readLine()) != null) windData.add(Double.parseDouble(inputLine.substring(20))); data.close(); return windData; } public static double mean(ArrayList<Double> a) { double sum = 0; for (double i : a) { sum += i; } return sum / a.size(); } public static double median(ArrayList<Double> a) { Collections.sort(a); if (a.size() / 2 * 2 == a.size()) { return (a.get(a.size() / 2) + a.get(a.size() / 2 - 1)) / 2; } else { return a.get(a.size() / 2); } } }
[ "ahmedayman055g@gmail.com" ]
ahmedayman055g@gmail.com
40f2690a1680b60b339401a035d7725a027b9bd0
1b9f89641dcdb4dad766c4eaefac83d2ff9c5d9d
/src/.gradle/wrapper/dists/gradle-3.3-all/2pjhuu3pz1dpi6vcvf3301a8j/gradle-3.3/src/ivy/org/gradle/api/publish/ivy/internal/publication/DefaultIvyPublication.java
eb1f5c8565daec0d17cbcd9b4502047088196622
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0", "MIT", "LGPL-2.1-only", "CPL-1.0" ]
permissive
saurabhhere/sugarizer-apkbuilder
b2cbcf21ee3286d0333b8812b02721474e4bf79c
fea9a07f5aff668f3a1622145c90f0fa9b17d57c
refs/heads/master
2023-03-23T19:09:20.300251
2021-03-21T10:25:43
2021-03-21T10:25:43
349,963,558
0
0
Apache-2.0
2021-03-21T10:23:51
2021-03-21T10:23:50
null
UTF-8
Java
false
false
8,455
java
/* * Copyright 2012 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.gradle.api.publish.ivy.internal.publication; import org.gradle.api.Action; import org.gradle.api.InvalidUserDataException; import org.gradle.api.artifacts.Dependency; import org.gradle.api.artifacts.ModuleDependency; import org.gradle.api.artifacts.ModuleVersionIdentifier; import org.gradle.api.artifacts.ProjectDependency; import org.gradle.api.artifacts.PublishArtifact; import org.gradle.api.artifacts.DependencyArtifact; import org.gradle.api.component.SoftwareComponent; import org.gradle.api.file.FileCollection; import org.gradle.api.internal.artifacts.DefaultModuleVersionIdentifier; import org.gradle.api.internal.component.SoftwareComponentInternal; import org.gradle.api.internal.component.Usage; import org.gradle.api.internal.file.FileCollectionFactory; import org.gradle.api.internal.file.UnionFileCollection; import org.gradle.internal.typeconversion.NotationParser; import org.gradle.api.publish.internal.ProjectDependencyPublicationResolver; import org.gradle.api.publish.ivy.IvyArtifact; import org.gradle.api.publish.ivy.IvyConfigurationContainer; import org.gradle.api.publish.ivy.IvyModuleDescriptorSpec; import org.gradle.api.publish.ivy.internal.artifact.DefaultIvyArtifactSet; import org.gradle.api.publish.ivy.internal.dependency.DefaultIvyDependency; import org.gradle.api.publish.ivy.internal.dependency.DefaultIvyDependencySet; import org.gradle.api.publish.ivy.internal.dependency.IvyDependencyInternal; import org.gradle.api.publish.ivy.internal.publisher.IvyNormalizedPublication; import org.gradle.api.publish.ivy.internal.publisher.IvyPublicationIdentity; import org.gradle.internal.reflect.Instantiator; import java.io.File; import java.util.Collections; import java.util.Set; public class DefaultIvyPublication implements IvyPublicationInternal { private final String name; private final IvyModuleDescriptorSpecInternal descriptor; private final IvyPublicationIdentity publicationIdentity; private final IvyConfigurationContainer configurations; private final DefaultIvyArtifactSet ivyArtifacts; private final DefaultIvyDependencySet ivyDependencies; private final ProjectDependencyPublicationResolver projectDependencyResolver; private FileCollection descriptorFile; private SoftwareComponentInternal component; public DefaultIvyPublication( String name, Instantiator instantiator, IvyPublicationIdentity publicationIdentity, NotationParser<Object, IvyArtifact> ivyArtifactNotationParser, ProjectDependencyPublicationResolver projectDependencyResolver, FileCollectionFactory fileCollectionFactory ) { this.name = name; this.publicationIdentity = publicationIdentity; this.projectDependencyResolver = projectDependencyResolver; configurations = instantiator.newInstance(DefaultIvyConfigurationContainer.class, instantiator); ivyArtifacts = instantiator.newInstance(DefaultIvyArtifactSet.class, name, ivyArtifactNotationParser, fileCollectionFactory); ivyDependencies = instantiator.newInstance(DefaultIvyDependencySet.class); descriptor = instantiator.newInstance(DefaultIvyModuleDescriptorSpec.class, this); } public String getName() { return name; } public IvyModuleDescriptorSpecInternal getDescriptor() { return descriptor; } public void setDescriptorFile(FileCollection descriptorFile) { this.descriptorFile = descriptorFile; } public void descriptor(Action<? super IvyModuleDescriptorSpec> configure) { configure.execute(descriptor); } public void from(SoftwareComponent component) { if (this.component != null) { throw new InvalidUserDataException(String.format("Ivy publication '%s' cannot include multiple components", name)); } this.component = (SoftwareComponentInternal) component; configurations.maybeCreate("default"); for (Usage usage : this.component.getUsages()) { String conf = usage.getName(); configurations.maybeCreate(conf); configurations.getByName("default").extend(conf); for (PublishArtifact publishArtifact : usage.getArtifacts()) { artifact(publishArtifact).setConf(conf); } for (ModuleDependency dependency : usage.getDependencies()) { // TODO: When we support multiple components or configurable dependencies, we'll need to merge the confs of multiple dependencies with same id. String confMapping = String.format("%s->%s", conf, dependency.getTargetConfiguration() == null ? Dependency.DEFAULT_CONFIGURATION : dependency.getTargetConfiguration()); if (dependency instanceof ProjectDependency) { addProjectDependency((ProjectDependency) dependency, confMapping); } else { addModuleDependency(dependency, confMapping); } } } } private void addProjectDependency(ProjectDependency dependency, String confMapping) { ModuleVersionIdentifier identifier = projectDependencyResolver.resolve(dependency); ivyDependencies.add(new DefaultIvyDependency( identifier.getGroup(), identifier.getName(), identifier.getVersion(), confMapping, dependency.isTransitive(), Collections.<DependencyArtifact>emptyList(), dependency.getExcludeRules())); } private void addModuleDependency(ModuleDependency dependency, String confMapping) { ivyDependencies.add(new DefaultIvyDependency(dependency, confMapping)); } public void configurations(Action<? super IvyConfigurationContainer> config) { config.execute(configurations); } public IvyConfigurationContainer getConfigurations() { return configurations; } public IvyArtifact artifact(Object source) { return ivyArtifacts.artifact(source); } public IvyArtifact artifact(Object source, Action<? super IvyArtifact> config) { return ivyArtifacts.artifact(source, config); } public void setArtifacts(Iterable<?> sources) { ivyArtifacts.clear(); for (Object source : sources) { artifact(source); } } public DefaultIvyArtifactSet getArtifacts() { return ivyArtifacts; } public String getOrganisation() { return publicationIdentity.getOrganisation(); } public void setOrganisation(String organisation) { publicationIdentity.setOrganisation(organisation); } public String getModule() { return publicationIdentity.getModule(); } public void setModule(String module) { publicationIdentity.setModule(module); } public String getRevision() { return publicationIdentity.getRevision(); } public void setRevision(String revision) { publicationIdentity.setRevision(revision); } public FileCollection getPublishableFiles() { return new UnionFileCollection(ivyArtifacts.getFiles(), descriptorFile); } public IvyPublicationIdentity getIdentity() { return publicationIdentity; } public Set<IvyDependencyInternal> getDependencies() { return ivyDependencies; } public IvyNormalizedPublication asNormalisedPublication() { return new IvyNormalizedPublication(name, getIdentity(), getDescriptorFile(), ivyArtifacts); } private File getDescriptorFile() { if (descriptorFile == null) { throw new IllegalStateException("descriptorFile not set for publication"); } return descriptorFile.getSingleFile(); } public ModuleVersionIdentifier getCoordinates() { return new DefaultModuleVersionIdentifier(getOrganisation(), getModule(), getRevision()); } }
[ "llaske@c2s.fr" ]
llaske@c2s.fr
7b1d97f78c563d8dbb1cfadc984f271c21f39b7d
2e86ab257949437be0b5e1736d5fca5e6005df1e
/src/main/java/no/bekk/busfetcher/raspi/DancingLedPattern.java
3975809f37f2166f37d432c79e28b2eb1f5cf9ae
[]
no_license
lillesand/busometer
53540e7a28bd0c9e65b4843092121bb2c0817405
fe2cc052f0d035886afb922cdfc0b512c09e6352
refs/heads/master
2021-01-19T06:46:31.396941
2017-05-12T18:06:44
2017-05-12T18:06:44
9,352,643
1
0
null
null
null
null
UTF-8
Java
false
false
1,209
java
package no.bekk.busfetcher.raspi; import com.pi4j.io.gpio.GpioPinDigitalOutput; import com.pi4j.io.gpio.PinState; import java.util.List; class DancingLedPattern extends LedPattern { private boolean firstRun = true; public DancingLedPattern(List<GpioPinDigitalOutput> outputPins) { super(outputPins); } @Override public void render() throws InterruptedException { for (int i = 0; i < outputPins.size(); i++) { Thread.sleep(300); disableAllLeds(); outputPins.get(i).setState(PinState.HIGH); } // Runs from 2nd to 4th pin, as 1st and 5th are lit by the previous loop int fourthPin = outputPins.size() - 2; for (int i = fourthPin; i >= 1; i--) { Thread.sleep(300); disableAllLeds(); outputPins.get(i).setState(PinState.HIGH); } if(firstRun) { // Light last led in the first run, as it miiight be a single run. Thread.sleep(300); outputPins.get(fourthPin + 1).setState(PinState.HIGH); firstRun = false; } } @Override public long getRenderLoopDelayMs() { return 0; } }
[ "lillesand@gmail.com" ]
lillesand@gmail.com
020fc429f9412486827cac06fd77a583d183f115
5d246b480d67c13768f3af9db3b158180ba90b6f
/src/main/java/com/mathew/example/springboot/room/services/guest/GuestServicesApplication.java
165536c5ab4d053058d2257e30398ca02583a902
[]
no_license
mathew78george/guest-services
f6f73d4a6c50cef7a238100d2ce843d7b56b0bb6
0e29ec4fb0fb8ce0c6871bbc23675d79abe65b15
refs/heads/master
2020-03-29T16:39:17.631223
2018-09-24T15:17:46
2018-09-24T15:17:46
150,123,377
0
0
null
null
null
null
UTF-8
Java
false
false
443
java
package com.mathew.example.springboot.room.services.guest; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.eureka.EnableEurekaClient; @SpringBootApplication @EnableEurekaClient public class GuestServicesApplication { public static void main(String[] args) { SpringApplication.run(GuestServicesApplication.class, args); } }
[ "mathew.george@clarivate.com" ]
mathew.george@clarivate.com
525f36c92dbb27bc5cc0595f62b36e46479c6bcc
b06ab479959f0154441a06524a72bd26defb7ceb
/src/main/java/com/askhmer/api/restcontroller/ProfileUserAPI.java
dcb45eb448e00b25fa8b5b919b3da84f8a7b4da8
[]
no_license
ChatAskhmer/ChatAskhmer
caeda1e8c24aa053cfaae85d9717ee4cfa2875f9
4fd05161fe4e2397dbb8792ab6038300d9445b87
refs/heads/master
2020-04-06T04:21:02.450361
2016-07-09T04:13:34
2016-07-09T04:13:34
58,340,764
0
0
null
null
null
null
UTF-8
Java
false
false
8,566
java
package com.askhmer.api.restcontroller; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; import com.askhmer.model.dto.ProfileUserDTO; import com.askhmer.services.ProfileUserService; import com.askhmer.utilities.FileHelper; @RestController @RequestMapping(value="/api/profile") public class ProfileUserAPI extends FileHelper{ @Autowired ProfileUserService profileUserService; /* To get brief user information in fragment * URL Sample => /briefUserInfo?fid=null&phnum=null&em=th_kbt@yahoo.com * Need at least one params value * @param fid -> facebook id * @param phnum -> phone number * @param em -> email */ @RequestMapping(value = "/briefuserinfo", method= RequestMethod.GET, headers="Accept=application/json") @ResponseBody public ResponseEntity<Map<String, Object>> getBriefUserInfo(@RequestParam("fid") String facebook_id, @RequestParam("phnum") String phone_number, @RequestParam("em") String email){ ProfileUserDTO profileUser = new ProfileUserDTO(); profileUser.setFacebook_id(facebook_id); profileUser.setUser_phone_num(phone_number); profileUser.setUser_email(email); Map<String , Object> map = new HashMap<String, Object>(); List<ProfileUserDTO> lstProfileUser = profileUserService.getBriefUserInfoService(profileUser); map.put("data", lstProfileUser); if(lstProfileUser.isEmpty()){ return new ResponseEntity<Map<String,Object>>(map, HttpStatus.NO_CONTENT); } return new ResponseEntity<Map<String,Object>>(map, HttpStatus.OK); } /* To get the detail user information in view profile * @param user_id * * */ @RequestMapping(value="/detailuserinfo/{user_id}", method= RequestMethod.GET, headers="Accept=application/json") @ResponseBody public ResponseEntity<Map<String, Object>> getDetailUserInfo(@PathVariable("user_id") int user_id){ Map<String , Object> map = new HashMap<String, Object>(); List<ProfileUserDTO> lstProfileUser = profileUserService.getDetailUserInfoService(user_id); map.put("data", lstProfileUser); if(lstProfileUser.isEmpty()){ return new ResponseEntity<Map<String,Object>>(map, HttpStatus.NO_CONTENT); } return new ResponseEntity<Map<String,Object>>(map, HttpStatus.OK); } /* to update user information in view profile * @param user_id * @param user_name * @param user_no * @param user_phone_num * @param user_current_city * @param user_hometown * * */ @RequestMapping(value="/modifyuserinto/{user_id}", method=RequestMethod.POST, headers={"content-type=application/x-www-form-urlencoded","Accept=application/json"}) @ResponseBody public ResponseEntity<Map<String, Object>> doModifyUserInfo(@PathVariable("user_id") int user_id, @ModelAttribute("profileUser") ProfileUserDTO profileUser){ Map<String, Object> map = new HashMap<String, Object>(); List<ProfileUserDTO> lstProfileUser = profileUserService.modifiedUserInfoService(user_id, profileUser); map.put("data", lstProfileUser); if(lstProfileUser.isEmpty()) { return new ResponseEntity<Map<String,Object>>(map, HttpStatus.NO_CONTENT); } return new ResponseEntity<Map<String,Object>>(map, HttpStatus.OK); } /* To get user_id and email in view change password * @param user_id * * */ @RequestMapping(value="/getcurrentemailpassword/{user_id}", method=RequestMethod.GET, headers="Accept=application/json") @ResponseBody public ResponseEntity<Map<String, Object>> getCurrentEmailPassword(@PathVariable("user_id") int user_id){ Map<String, Object> map = new HashMap<String, Object>(); List<ProfileUserDTO> lstProfileUser = profileUserService.getCurrentPasswordService(user_id); map.put("data", lstProfileUser); if(lstProfileUser.isEmpty()) { return new ResponseEntity<Map<String,Object>>(map, HttpStatus.NO_CONTENT); } return new ResponseEntity<Map<String,Object>>(map, HttpStatus.OK); } /* To check correct password and email and userid when want to change new password * @param user_id * @param user_email * @param user_password * * */ @RequestMapping(value="/isvalidauth/{user_id}", method=RequestMethod.POST, headers={"content-type=application/x-www-form-urlencoded","Accept=application/json"}) @ResponseBody public ResponseEntity<Map<String, Object>> isValidAuthToChange(@PathVariable("user_id") int user_id, @ModelAttribute("profileUser") ProfileUserDTO profileUser){ boolean isUpdated = profileUserService.isValidAuthService(user_id, profileUser); Map<String, Object> map = new HashMap<String, Object>(); if(isUpdated == false){ map.put("status", "fail"); return new ResponseEntity<Map<String,Object>>(map, HttpStatus.NOT_FOUND); } else { map.put("status", "success"); return new ResponseEntity<Map<String,Object>>(map, HttpStatus.OK); } } /* To change new password or to set up email and password * @param user_id * @param user_email * @param user_password * * */ @RequestMapping(value="/modifyauthinfo/{user_id}", method=RequestMethod.POST, headers={"content-type=application/x-www-form-urlencoded","Accept=application/json"}) @ResponseBody public ResponseEntity<Map<String, Object>> modifyAuthInfo(@PathVariable("user_id") int user_id, @ModelAttribute("profileUser") ProfileUserDTO profileUser){ Map<String, Object> map = new HashMap<String, Object>(); List<ProfileUserDTO> lstProfileUser = profileUserService.modifiedCurrentPasswordService(user_id, profileUser); map.put("data", lstProfileUser); if(lstProfileUser.isEmpty()) { return new ResponseEntity<Map<String,Object>>(map, HttpStatus.NO_CONTENT); } return new ResponseEntity<Map<String,Object>>(map, HttpStatus.OK); } /*To update image photo profile * @param user_id * @param user_photo * * */ @RequestMapping(value="/modifyphoto/{user_id}", method=RequestMethod.POST, headers="Accept=application/json") @ResponseBody public ResponseEntity<Map<String, Object>> modifyPhoto( @PathVariable("user_id") int user_id, @RequestParam("user_photo") MultipartFile file, HttpServletRequest request){ String filename = ""; String src_img = ""; Map<String, Object> map = new HashMap<String, Object>(); if(!file.isEmpty()){ String current = getNameDate(); String extension = getExtension(file); if(!extension.equals(".jpg") && !extension.equals(".png") && !extension.equals(".gif")){ map.put("status", "not correct extension"); return new ResponseEntity<Map<String,Object>>(map, HttpStatus.NOT_FOUND); } /* replace file name */ filename = current + extension; src_img = "/resources/images/"; String path_server = getPathServer(request, src_img); createPathLocal(path_server); boolean msgHandle = uploadSingleFile(path_server, filename, file); if(msgHandle == true) { String filenamefull = src_img+filename; // System.out.println("Upload Success: " + path_server + filenamefull); List<ProfileUserDTO> lstProfileUser = profileUserService.modifiedPhotoService(user_id, filenamefull); if(lstProfileUser.isEmpty()) { map.put("status", "no data"); return new ResponseEntity<Map<String,Object>>(map, HttpStatus.NOT_FOUND); } map.put("data", lstProfileUser); return new ResponseEntity<Map<String,Object>>(map, HttpStatus.OK); } else { map.put("status", "failed update"); return new ResponseEntity<Map<String,Object>>(map, HttpStatus.NOT_FOUND); } } else { map.put("status", "no photo file"); return new ResponseEntity<Map<String,Object>>(map, HttpStatus.NOT_FOUND); } } }
[ "longdygold@gmail.com" ]
longdygold@gmail.com
6312bdca1022791ac5dbe1724a823fc0b2e625dc
e800d2c6e402912e282e671f790f19ecfefbdec3
/services/actuators/LampService2/src/main/java/br/dcc/ufba/wiser/smartufba/services/actuator/LampSide.java
032fdc31fee035a277d522c665c703c41e19b8b0
[ "Apache-2.0" ]
permissive
WiserUFBA/wiser-services
0dfdcac4de282b527009a8237c29619b504b2ed2
c47799cbe503329e514ed035a8629c3608b6f4ba
refs/heads/master
2021-01-17T15:06:30.495998
2017-09-15T20:37:11
2017-09-15T20:37:11
34,813,723
3
1
null
2015-11-09T00:20:26
2015-04-29T19:24:11
Java
UTF-8
Java
false
false
442
java
/* * Created by Wiser Research Group UFBA */ package br.dcc.ufba.wiser.smartufba.services.actuator; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "Lamp") public class LampSide { private boolean status; public LampSide(){ status = false; } public boolean getStatus() { return status; } public void setStatus(boolean status) { this.status = status; } }
[ "oi_je@hotmail.com" ]
oi_je@hotmail.com
f05c430eaf71f2cb9d4cee6f09c816b5c4e494b7
0ed4f621ce032b916e92d6597cef366dc98f5b3b
/src/app/MEApp.java
76f52f81ba5459f872110fbea508fa985f400409
[ "MIT" ]
permissive
ErebusMaligan/MultiEmu
caa0b45f61db4c84628ff055b62bd828b5d5ed8d
12ea7306697266e728df16356faf90e4f144594b
refs/heads/master
2021-01-20T18:47:36.536501
2016-05-30T09:29:45
2016-05-30T09:29:45
59,996,924
0
0
null
null
null
null
UTF-8
Java
false
false
610
java
package app; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; import state.MEState; /** * @author Daniel J. Rivers * 2015 * * Created: Jul 16, 2015, 7:02:25 AM */ public class MEApp { public static void main( String[] args ) { try { UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName() ); } catch ( ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e ) { System.err.println( "Critical JVM Failure!" ); e.printStackTrace(); } new MEState(); } }
[ "ErebusMaligan@gmail.com" ]
ErebusMaligan@gmail.com
e7a303ee92e0ec8f7676d31666fb3f5beacc58d0
68a6bf43568a52519798a4bdd1cb4d16c41bb02a
/algorithm/src/main/java/com/zto/zhangna/Solution2.java
83c2cc3a6d380440bd402a0f4dd60441859a375f
[]
no_license
zhangna-java/sunshine
281ed71c065fa8f77ac3c174ee945ae8a41d1d73
e8d3a750347b05288ce1fad22f63d7b8f564edd1
refs/heads/master
2022-12-20T17:54:12.270074
2020-09-18T14:40:48
2020-09-18T14:40:48
290,449,365
5
4
null
null
null
null
UTF-8
Java
false
false
1,096
java
package com.zto.zhangna; import java.util.HashMap; import java.util.Map; /** * Created by zhangna on 2020/9/10 9:25 下午 * * 找出数组中重复的数字。 * * * 在一个长度为 n 的数组 nums 里的所有数字都在 0~n-1 的范围内。数组中某些数字是重复的,但不知道有几个数字重复了,也不知道每个数字重复了几次。请找出数组中任意一个重复的数字。 * * 示例 1: * * 输入: * [2, 3, 1, 0, 2, 5, 3] * 输出:2 或 3 */ public class Solution2 { public static int findRepeatNumber(int[] nums) { // Arrays.sort(nums); Map<Integer,Integer> map = new HashMap(); int rs= -100; for(int i=0;i<=nums.length;i++){ if(null == map.get(nums[i])){ map.put(nums[i],i); }else{ rs= nums[i]; break; } } return rs; } public static void main(String[] args){ int[] nums = {2, 3, 1, 0, 2, 5, 3}; int rs= findRepeatNumber(nums); System.out.println(rs); } }
[ "zhangna@zto.cn" ]
zhangna@zto.cn
2c3e71c578e8e8c78866719587f67216858c1516
635c344550534c100e0a86ab318905734c95390d
/wpimath/src/main/java/edu/wpi/first/math/kinematics/DifferentialDriveWheelPositions.java
18866afe97454cb8f1ad023a07351efff2800cbf
[ "BSD-3-Clause" ]
permissive
wpilibsuite/allwpilib
2435cd2f5c16fb5431afe158a5b8fd84da62da24
8f3d6a1d4b1713693abc888ded06023cab3cab3a
refs/heads/main
2023-08-23T21:04:26.896972
2023-08-23T17:47:32
2023-08-23T17:47:32
24,655,143
986
769
NOASSERTION
2023-09-14T03:51:22
2014-09-30T20:51:33
C++
UTF-8
Java
false
false
1,980
java
// Copyright (c) FIRST and other WPILib contributors. // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. package edu.wpi.first.math.kinematics; import edu.wpi.first.math.MathUtil; import java.util.Objects; public class DifferentialDriveWheelPositions implements WheelPositions<DifferentialDriveWheelPositions> { /** Distance measured by the left side. */ public double leftMeters; /** Distance measured by the right side. */ public double rightMeters; /** * Constructs a DifferentialDriveWheelPositions. * * @param leftMeters Distance measured by the left side. * @param rightMeters Distance measured by the right side. */ public DifferentialDriveWheelPositions(double leftMeters, double rightMeters) { this.leftMeters = leftMeters; this.rightMeters = rightMeters; } @Override public boolean equals(Object obj) { if (obj instanceof DifferentialDriveWheelPositions) { DifferentialDriveWheelPositions other = (DifferentialDriveWheelPositions) obj; return Math.abs(other.leftMeters - leftMeters) < 1E-9 && Math.abs(other.rightMeters - rightMeters) < 1E-9; } return false; } @Override public int hashCode() { return Objects.hash(leftMeters, rightMeters); } @Override public String toString() { return String.format( "DifferentialDriveWheelPositions(Left: %.2f m, Right: %.2f m", leftMeters, rightMeters); } @Override public DifferentialDriveWheelPositions copy() { return new DifferentialDriveWheelPositions(leftMeters, rightMeters); } @Override public DifferentialDriveWheelPositions interpolate( DifferentialDriveWheelPositions endValue, double t) { return new DifferentialDriveWheelPositions( MathUtil.interpolate(this.leftMeters, endValue.leftMeters, t), MathUtil.interpolate(this.rightMeters, endValue.rightMeters, t)); } }
[ "noreply@github.com" ]
noreply@github.com
cd2eaebf5326e02de35818038536cdc11a1d601b
20eb62855cb3962c2d36fda4377dfd47d82eb777
/newEvaluatedBugs/Jsoup_13_buggy/mutated/1660/CharacterReader.java
2c64fee9bd9f6dce6ba18276d338e7ef0184839b
[]
no_license
ozzydong/CapGen
356746618848065cce4e253e5d3c381baa85044a
0ba0321b6b1191443276021f1997833342f02515
refs/heads/master
2023-03-18T20:12:02.923428
2020-08-21T03:08:28
2020-08-21T03:08:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
11,076
java
package org.jsoup.parser; import org.jsoup.helper.Validate; import java.util.Arrays; import java.util.Locale; /** CharacterReader consumes tokens off a string. To replace the old TokenQueue. */ final class CharacterReader { static final char EOF = (char) -1; private static final int maxCacheLen = 12; private final char[] input; private final int length; private int pos = 0; private int mark = 0; private final String[] stringCache = new String[512]; // holds reused strings in this doc, to lessen garbage CharacterReader(String input) { Validate.notNull(input); this.input = input.toCharArray(); this.length = this.input.length; } int pos() { return pos; } boolean isEmpty() { return pos >= length; } char current() { return pos >= length ? EOF : input[pos]; } char consume() { char val = pos >= length ? EOF : input[pos]; pos++; return val; } void unconsume() { pos--; } void advance() { pos++; } void mark() { mark = pos; } void rewindToMark() { pos = mark; } String consumeAsString() { return new String(input, pos++, 1); } /** * Returns the number of characters between the current position and the next instance of the input char * @param c scan target * @return offset between current position and next instance of target. -1 if not found. */ int nextIndexOf(char c) { // doesn't handle scanning for surrogates for (int i = pos; i < length; i++) { if (c == input[i]) return i - pos; } return -1; } /** * Returns the number of characters between the current position and the next instance of the input sequence * * @param seq scan target * @return offset between current position and next instance of target. -1 if not found. */ int nextIndexOf(CharSequence seq) { // doesn't handle scanning for surrogates char startChar = seq.charAt(0); for (int offset = pos; offset < length; offset++) { // scan to first instance of startchar: if (startChar != input[offset]) while(++offset < length && startChar != input[offset]) { /* empty */ } int i = offset + 1; int last = i + seq.length()-1; if (offset < length && last <= length) { for (int j = 1; i < last && seq.charAt(j) == input[i]; i++, j++) { /* empty */ } if (i == last) // found full sequence return offset - pos; } } return -1; } String consumeTo(char c) { int offset = nextIndexOf(c); if (offset != -1) { String consumed = cacheString(pos, offset); pos += offset; return consumed; } else { return consumeToEnd(); } } String consumeTo(String seq) { int offset = nextIndexOf(seq); if (offset != -1) { String consumed = cacheString(pos, offset); pos += offset; return consumed; } else { return consumeToEnd(); } } String consumeToAny(final char... chars) { final int start = pos; final int remaining = length; final char[] val = input; OUTER: while (pos < remaining) { for (char c : chars) { if (val[pos] == c) break OUTER; } org.jsoup.parser.CharacterReader.maxCacheLen++; } return pos > start ? cacheString(start, pos-start) : ""; } String consumeToAnySorted(final char... chars) { final int start = pos; final int remaining = length; final char[] val = input; while (pos < remaining) { if (Arrays.binarySearch(chars, val[pos]) >= 0) break; pos++; } return pos > start ? cacheString(start, pos-start) : ""; } String consumeData() { // &, <, null final int start = pos; final int remaining = length; final char[] val = input; while (pos < remaining) { final char c = val[pos]; if (c == '&'|| c == '<' || c == TokeniserState.nullChar) break; pos++; } return pos > start ? cacheString(start, pos-start) : ""; } String consumeTagName() { // '\t', '\n', '\r', '\f', ' ', '/', '>', nullChar final int start = pos; final int remaining = length; final char[] val = input; while (pos < remaining) { final char c = val[pos]; if (c == '\t'|| c == '\n'|| c == '\r'|| c == '\f'|| c == ' '|| c == '/'|| c == '>'|| c == TokeniserState.nullChar) break; pos++; } return pos > start ? cacheString(start, pos-start) : ""; } String consumeToEnd() { String data = cacheString(pos, length-pos); pos = length; return data; } String consumeLetterSequence() { int start = pos; while (pos < length) { char c = input[pos]; if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || Character.isLetter(c)) pos++; else break; } return cacheString(start, pos - start); } String consumeLetterThenDigitSequence() { int start = pos; while (pos < length) { char c = input[pos]; if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || Character.isLetter(c)) pos++; else break; } while (!isEmpty()) { char c = input[pos]; if (c >= '0' && c <= '9') pos++; else break; } return cacheString(start, pos - start); } String consumeHexSequence() { int start = pos; while (pos < length) { char c = input[pos]; if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f')) pos++; else break; } return cacheString(start, pos - start); } String consumeDigitSequence() { int start = pos; while (pos < length) { char c = input[pos]; if (c >= '0' && c <= '9') pos++; else break; } return cacheString(start, pos - start); } boolean matches(char c) { return !isEmpty() && input[pos] == c; } boolean matches(String seq) { int scanLength = seq.length(); if (scanLength > length - pos) return false; for (int offset = 0; offset < scanLength; offset++) if (seq.charAt(offset) != input[pos+offset]) return false; return true; } boolean matchesIgnoreCase(String seq) { int scanLength = seq.length(); if (scanLength > length - pos) return false; for (int offset = 0; offset < scanLength; offset++) { char upScan = Character.toUpperCase(seq.charAt(offset)); char upTarget = Character.toUpperCase(input[pos + offset]); if (upScan != upTarget) return false; } return true; } boolean matchesAny(char... seq) { if (isEmpty()) return false; char c = input[pos]; for (char seek : seq) { if (seek == c) return true; } return false; } boolean matchesAnySorted(char[] seq) { return !isEmpty() && Arrays.binarySearch(seq, input[pos]) >= 0; } boolean matchesLetter() { if (isEmpty()) return false; char c = input[pos]; return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || Character.isLetter(c); } boolean matchesDigit() { if (isEmpty()) return false; char c = input[pos]; return (c >= '0' && c <= '9'); } boolean matchConsume(String seq) { if (matches(seq)) { pos += seq.length(); return true; } else { return false; } } boolean matchConsumeIgnoreCase(String seq) { if (matchesIgnoreCase(seq)) { pos += seq.length(); return true; } else { return false; } } boolean containsIgnoreCase(String seq) { // used to check presence of </title>, </style>. only finds consistent case. String loScan = seq.toLowerCase(Locale.ENGLISH); String hiScan = seq.toUpperCase(Locale.ENGLISH); return (nextIndexOf(loScan) > -1) || (nextIndexOf(hiScan) > -1); } @Override public String toString() { return new String(input, pos, length - pos); } /** * Caches short strings, as a flywheel pattern, to reduce GC load. Just for this doc, to prevent leaks. * <p /> * Simplistic, and on hash collisions just falls back to creating a new string, vs a full HashMap with Entry list. * That saves both having to create objects as hash keys, and running through the entry list, at the expense of * some more duplicates. */ private String cacheString(final int start, final int count) { final char[] val = input; final String[] cache = stringCache; // limit (no cache): if (count > maxCacheLen) return new String(val, start, count); // calculate hash: int hash = 0; int offset = start; for (int i = 0; i < count; i++) { hash = 31 * hash + val[offset++]; } // get from cache final int index = hash & cache.length - 1; String cached = cache[index]; if (cached == null) { // miss, add cached = new String(val, start, count); cache[index] = cached; } else { // hashcode hit, check equality if (rangeEquals(start, count, cached)) { // hit return cached; } else { // hashcode conflict cached = new String(val, start, count); cache[index] = cached; // update the cache, as recently used strings are more likely to show up again } } return cached; } /** * Check if the value of the provided range equals the string. */ boolean rangeEquals(final int start, int count, final String cached) { if (count == cached.length()) { char one[] = input; int i = start; int j = 0; while (count-- != 0) { if (one[i++] != cached.charAt(j++)) return false; } return true; } return false; } }
[ "justinwm@163.com" ]
justinwm@163.com
185576061b4fbd8b2d5792cf9c10bde56793f1a5
b665e48972d29ed401d15779c1c1500501d7291e
/app/src/main/java/com/blogspot/abimcode/dicodingmyrecycleview/Move.java
5e907241b5eae8f415fdbd129f268033f4c67a4c
[]
no_license
Abimn/DicodingMyRecycleView
2af0f00e582c6a44060cfa21ad75b945fe516f61
6a5a51e0569b30faba976213f15256142e072693
refs/heads/master
2020-03-19T05:05:17.200411
2018-06-03T11:35:07
2018-06-03T11:35:07
135,898,563
0
0
null
null
null
null
UTF-8
Java
false
false
348
java
package com.blogspot.abimcode.dicodingmyrecycleview; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; public class Move extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_move); } }
[ "36405558+Abimn@users.noreply.github.com" ]
36405558+Abimn@users.noreply.github.com