blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
sequencelengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
131 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
32 values
content
stringlengths
3
9.45M
authors
sequencelengths
1
1
author_id
stringlengths
0
313
143b19803ccf18b17027a4ee16392c6e7adf0ed4
74836ca51df5e01a8a54caefd027c5ce7efa4bdb
/ex1-hello-jpa/target/generated-sources/java/proxyPractice/QLazyTeam.java
9eed4e248c22e8bc407c687627d75ba1d227a4b2
[]
no_license
blackbutterfly0852/JPA_BASIC
05f8f20007a4a204eebd81a4eddd6cc97571e218
8ef20f384509c8f5f122b36f46254f188a5e8372
refs/heads/master
2023-02-03T22:59:42.598125
2020-12-11T18:54:33
2020-12-11T18:54:33
302,410,694
0
0
null
null
null
null
UTF-8
Java
false
false
990
java
package proxyPractice; import static com.querydsl.core.types.PathMetadataFactory.*; import com.querydsl.core.types.dsl.*; import com.querydsl.core.types.PathMetadata; import javax.annotation.Generated; import com.querydsl.core.types.Path; /** * QLazyTeam is a Querydsl query type for LazyTeam */ @Generated("com.querydsl.codegen.EntitySerializer") public class QLazyTeam extends EntityPathBase<LazyTeam> { private static final long serialVersionUID = -778611050L; public static final QLazyTeam lazyTeam = new QLazyTeam("lazyTeam"); public final NumberPath<Long> id = createNumber("id", Long.class); public final StringPath name = createString("name"); public QLazyTeam(String variable) { super(LazyTeam.class, forVariable(variable)); } public QLazyTeam(Path<? extends LazyTeam> path) { super(path.getType(), path.getMetadata()); } public QLazyTeam(PathMetadata metadata) { super(LazyTeam.class, metadata); } }
6a32c7b2b4e751b959b00d629dc07daf4308ce02
df9cc21e8b8a1b3a6d446f4cc6f39ae74cae940f
/src/main/java/com/github/fjtorres/deckOfCards/Main.java
9d721b550b92cfd5d686a8926c149f2a7b263acd
[]
no_license
fjtorres/deck-of-cards
ae2914492bab66580bac987c9d983083a0046181
41c7fd3c5101634dc51839100b249d06770991c0
refs/heads/main
2023-01-24T02:38:55.765113
2020-11-17T18:54:57
2020-11-17T18:54:57
312,867,101
0
0
null
null
null
null
UTF-8
Java
false
false
477
java
package com.github.fjtorres.deckOfCards; /** * Application class to execute a deck. */ public class Main { public static void main(String[] args) { System.out.println("Poker deck: Start"); Deck<PokerCard> pokerDeck = new Deck<>(PokerCard.allCards()); pokerDeck.shuffle(); while(!pokerDeck.isEmpty()) { pokerDeck.dealOneCard().ifPresent(System.out::println); } System.out.println("Poker deck: End"); } }
cf29b3d2c06a41430bdedc083c713d9fff62d86a
9d647a86d41484d8da6f1497374cc2d8df4b5353
/app/src/main/java/net/elshaarawy/smartpan/Data/SmartPanDbHelper.java
c5f2c7d266ac4037bd0e9faa30e631f4a132fed1
[]
no_license
IAmShaarawy/SmartPan
7886ffac63aa33e2acda941be1bf0109cee58cb4
95be96c74786168780bdd9f832314c346f71af3b
refs/heads/master
2022-01-20T23:08:45.823722
2017-06-27T18:46:57
2017-06-27T18:46:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,337
java
package net.elshaarawy.smartpan.Data; import android.content.Context; import android.database.DatabaseErrorHandler; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import static net.elshaarawy.smartpan.Data.SmartPanContract.*; /** * Created by elshaarawy on 25-Jun-17. */ public class SmartPanDbHelper extends SQLiteOpenHelper { private static final String DATABASE_NAME = "smartpan.db"; private static final int DATABASE_VERSION = 1; public SmartPanDbHelper(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); } @Override public void onCreate(SQLiteDatabase db) { final String CREATE_COUNTRIES_TABLE = "CREATE TABLE " + COUNTRIES_COLUMNS.C_TABLE_NAME + "( " + COUNTRIES_COLUMNS._ID + " INTEGER PRIMARY KEY AUTOINCREMENT , "+ COUNTRIES_COLUMNS.C_NAME + " TEXT , "+ COUNTRIES_COLUMNS.C_ALPHA2CODE + " TEXT , "+ COUNTRIES_COLUMNS.C_CAPITAL + " TEXT );"; db.execSQL(CREATE_COUNTRIES_TABLE); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { db.execSQL("DROP TABLE IF EXIST"+ COUNTRIES_COLUMNS.C_TABLE_NAME); this.onCreate(db); } private interface SQLTableCreator{ } }
7355dcf9ea9d964bd55a9a894d751d8450109612
50cadf826e78f1a17cdceeb6be636c6132503034
/src/test/java/xyz/isatimur/course/application/config/WebConfigurerTestController.java
8820e2dffd20c48ca9aa85e30c204b48af3be2d6
[]
no_license
isatimur/course-application
4abdc0f704aa5fd4f5d673bc8fb4864f8c1ace87
a89bd43608492eedef0813282212e9443d2d5faa
refs/heads/master
2021-06-30T06:06:52.963069
2017-09-16T11:55:01
2017-09-16T11:55:01
103,737,317
0
0
null
null
null
null
UTF-8
Java
false
false
394
java
package xyz.isatimur.course.application.config; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class WebConfigurerTestController { @GetMapping("/api/test-cors") public void testCorsOnApiPath() { } @GetMapping("/test/test-cors") public void testCorsOnOtherPath() { } }
fff24251a456d740f74da1427ea3d8520d72509c
e2ac3fdc5ad13255cc0f3686d287bf7b7b06a657
/MYCHANGE/java/change-request-service/src/main/java/com/example/mirai/mychange/changerequestservice/shared/exception/NotAllowedToAddSelfAsDependentException.java
88b9a801610b9a9d8034ed3e3cb8f8234a65e51d
[]
no_license
Suresh918/mySpringbootMicroServices
c483d876c8b436b8388f5ff7f4b8c1a7f903282d
378b020c6cf3fdd742f5935f86c3a4821055af7a
refs/heads/main
2023-06-27T21:15:44.507233
2021-07-17T15:28:08
2021-07-17T15:28:08
379,893,287
0
1
null
null
null
null
UTF-8
Java
false
false
213
java
package com.example.mirai.projectname.changerequestservice.shared.exception; public class NotAllowedToAddSelfAsDependentException extends RuntimeException { private static final long serialVersionUID = 1L; }
77e104e215411164a4da093195ee5b9b1f148cf3
d023a51c734ecf9ee20812329824a2767b5f8eb7
/LittleSisterServer2/src/main/java/at/htl/entity/Session.java
ca767af118a32293b55cdadc47f989ea5ba8c79f
[ "Apache-2.0" ]
permissive
htl-leonding/2015_LittleSister
1fcec75202c9fb44dab7d2d2ef21bafc59bf6ac4
a0656d72a7fe9f5716b114b82b4c019599f7498a
refs/heads/master
2021-01-01T04:51:45.140467
2016-04-22T07:38:01
2016-04-22T07:38:01
56,835,420
0
0
null
null
null
null
UTF-8
Java
false
false
1,920
java
package at.htl.entity; public class Session { // ----- FIELDS ----- private String name; private String schoolClass; private ClientSettings clientSettings; private String logDirectory; private String relevantFilesPath; private String retrieveData; private boolean isCorrect; public String getRetrieveData() { return retrieveData; } public void setRetrieveData(String retrieveData) { this.retrieveData = retrieveData; } public boolean isIsCorrect() { return isCorrect; } public void setIsCorrect(boolean isCorrect) { this.isCorrect = isCorrect; } // ----- GETTER && SETTER ----- public String getName() { return name; } public void setName(String name) { this.name = name; } public String getSchoolClass() { return schoolClass; } public void setSchoolClass(String schoolClass) { this.schoolClass = schoolClass; } public ClientSettings getClientSettings() { return clientSettings; } public void setClientSettings(ClientSettings clientSettings) { this.clientSettings = clientSettings; } public String getLogDirectory() { return logDirectory; } public void setLogDirectory(String logDirectory) { this.logDirectory = logDirectory; } public String getRelevantFilesPath() { return relevantFilesPath; } public void setRelevantFilesPath(String relevantFilesPath) { this.relevantFilesPath = relevantFilesPath; } // ----- CONSTRUCTORS ----- public Session() { } public Session(String name, String schoolClass, ClientSettings settings, String logDirectory) { this.name = name; this.schoolClass = schoolClass; this.clientSettings = settings; this.logDirectory = logDirectory; } }
44fa1c8a4821bdf3c5db758d734c30c4ef7b3c8e
ce349ee3e655a8397f2c3bbd37e75ccb26a625ad
/src/test/java/pl/matadini/hipsterwebapp/context/person/PersonTestSampleFactory.java
0149e9b2e7ab1e2e7a761b79d5fbc281c0aa1a2c
[]
no_license
matadini/hipster-webapp
45ad4172da4ea36f580fe4f527e0fb41cb310650
d3a04da875843575942683950e3de985f5093f23
refs/heads/master
2022-06-09T07:14:30.396416
2019-05-24T14:27:10
2019-05-24T14:27:10
187,991,944
0
0
null
null
null
null
UTF-8
Java
false
false
721
java
package pl.matadini.hipsterwebapp.context.person; import lombok.AccessLevel; import lombok.NoArgsConstructor; import pl.matadini.hipsterwebapp.context.person.dto.PersonSaveDto; @NoArgsConstructor(access = AccessLevel.PRIVATE) class PersonTestSampleFactory { static PersonSaveDto createPersonSaveDtoSampleJanuszNosacz() { PersonSaveDto build = PersonSaveDto.builder() .name("Janusz") .surname("Nosacz") .email("[email protected]") .build(); return build; } static PersonSaveDto createPersonSaveDtoSampleJanuszNosaczUpdate() { PersonSaveDto build = PersonSaveDto.builder() .name("Janusz-Update") .surname("Nosacz-update") .email("[email protected]") .build(); return build; } }
085e124bea02f4cee13ce1c85559d3cbd6a63dd2
3be7ea4dc37afa81854f2a6c4793e354c47d8797
/java/com/cbitss/careforu/MainActivity.java
98d082dc8129bfb4f9748602dfec7394dc23aaa6
[]
no_license
madhurpatle/Healthcare
204bafd96e5526a7247bfb05e210b0be250cf067
bdf8fa25c404aa13a9d0ab62383ed255355156e1
refs/heads/main
2022-12-30T21:46:01.035943
2020-10-23T16:47:21
2020-10-23T16:47:21
306,686,797
3
0
null
null
null
null
UTF-8
Java
false
false
8,240
java
package com.cbitss.careforu; import android.app.ActivityManager; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; 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.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.ImageView; import android.widget.TextView; public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener , FragmentReminder.OnFragmentInteractionListener ,Nearbyhosp.OnFragmentInteractionListener, FirstAidTips.OnFragmentInteractionListener,Knowmed.OnFragmentInteractionListener,AboutUs.OnFragmentInteractionListener ,HealthTips.OnFragmentInteractionListener,Home.OnFragmentInteractionListener,FirstAidTipsHome.OnFragmentInteractionListener ,FirstAidOffline.OnFragmentInteractionListener { public ImageView iv; TextView tv; @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Bitmap bitmap = BitmapFactory.decodeResource(getResources(),R.mipmap.ic_launcher); setTaskDescription( new ActivityManager.TaskDescription("Care For U",bitmap)); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); setTitle("Care for U"); NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view); Intent intent = getIntent(); if(intent.getExtras()!=null) { if(intent.getExtras().getInt("id")!=0) { int i = intent.getExtras().getInt("id"); String s=intent.getExtras().getString("text"); View headerView =navigationView.inflateHeaderView(R.layout.nav_header_main); iv=(ImageView)headerView.findViewById(R.id.nav_imageView) ; tv=(TextView) headerView.findViewById(R.id.nav_tv); tv.setText("Hi, "+s); iv.setImageResource(i); SharedPreferences sp=getSharedPreferences("Shpr", Context.MODE_PRIVATE); SharedPreferences.Editor ed=sp.edit(); ed.putBoolean("logged",true); ed.putString("User",s); ed.putInt("imgRes",i); ed.commit(); Home hm = new Home(); getSupportFragmentManager().beginTransaction().replace(R.id.container, hm).commit(); } else { FragmentReminder rm = new FragmentReminder(); getSupportFragmentManager().beginTransaction().replace(R.id.container, rm).commit(); SharedPreferences sp=getSharedPreferences("Shpr", Context.MODE_PRIVATE); int i = sp.getInt("imgRes",0); String s=sp.getString("User",null); View headerView =navigationView.inflateHeaderView(R.layout.nav_header_main); iv=(ImageView)headerView.findViewById(R.id.nav_imageView) ; tv=(TextView) headerView.findViewById(R.id.nav_tv); tv.setText("Hi, "+s); iv.setImageResource(i); } } else { Home hm = new Home(); getSupportFragmentManager().beginTransaction().replace(R.id.container, hm).commit(); SharedPreferences sp=getSharedPreferences("Shpr", Context.MODE_PRIVATE); Boolean loggedin=sp.getBoolean("logged",false); if(!loggedin) { CustomDialogClass cdd = new CustomDialogClass(this, getApplicationContext()); cdd.show(); } else { int i = sp.getInt("imgRes",0); String s=sp.getString("User",null); View headerView =navigationView.inflateHeaderView(R.layout.nav_header_main); iv=(ImageView)headerView.findViewById(R.id.nav_imageView) ; tv=(TextView) headerView.findViewById(R.id.nav_tv); tv.setText("Hi, "+s); iv.setImageResource(i); } } DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close); drawer.setDrawerListener(toggle); toggle.syncState(); navigationView.setNavigationItemSelectedListener(this); } @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 public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } @SuppressWarnings("StatementWithEmptyBody") @Override public boolean onNavigationItemSelected(MenuItem item) { Log.d("Item:",item.toString()); // Handle navigation view item clicks here. int id = item.getItemId(); if (id == R.id.nav_medrem) { FragmentReminder rm=new FragmentReminder(); getSupportFragmentManager().beginTransaction().replace(R.id.container,rm).commit(); // Handle the camera action } else if (id == R.id.nav_firstaid) { FirstAidTipsHome ft=new FirstAidTipsHome(); getSupportFragmentManager().beginTransaction().replace(R.id.container,ft).commit(); } else if (id == R.id.nav_hosp) { Nearbyhosp nh=new Nearbyhosp(); getSupportFragmentManager().beginTransaction().replace(R.id.container,nh).commit(); } else if (id == R.id.nav_medinfo) { Knowmed km=new Knowmed(); getSupportFragmentManager().beginTransaction().replace(R.id.container,km).commit(); } else if (id == R.id.nav_abtus) { AboutUs au=new AboutUs(); getSupportFragmentManager().beginTransaction().replace(R.id.container,au).commit(); } else if (id == R.id.nav_chgname) { SharedPreferences sp=getSharedPreferences("Shpr", Context.MODE_PRIVATE); SharedPreferences.Editor ed=sp.edit(); ed.putBoolean("logged",false); ed.putString("User",null); ed.putInt("imgRes",0); ed.commit(); CustomDialogClass cdd = new CustomDialogClass(this, getApplicationContext()); cdd.show(); } else if (id == R.id.nav_healthtips) { HealthTips ht=new HealthTips(); getSupportFragmentManager().beginTransaction().replace(R.id.container,ht).commit(); } DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); drawer.closeDrawer(GravityCompat.START); return true; } @Override public void onFragmentInteraction(Uri uri) { } }
c04efefa68545e462d7fc438f226b49261fe9221
479922f758514e7d8e87c4bac948d11ccbe89e91
/src/EmployeeLog.java
8a11d8f7b91873713fbf83ce6c2d3e00d5d660ac
[]
no_license
orodas1/TMT
b4f95ed46d7f22725fd08421d4863f772e4cfea1
64430e3da992577be4a06701c748abc0459204be
refs/heads/master
2020-12-03T19:29:18.875000
2016-11-11T21:46:48
2016-11-11T21:46:48
73,506,434
0
0
null
2016-11-11T19:45:00
2016-11-11T19:45:00
null
UTF-8
Java
false
false
1,243
java
import java.sql.Date; import java.sql.Time; /** * Created by Hugo Lucas on 10/29/2016. */ public class EmployeeLog { private Time clockIn; private Time clockOut; private Date logDate; private int taskID; private int employeeID; public EmployeeLog(Time ci, Time co, Date ld, int id){ this.clockIn = ci; this.clockOut = co; this.logDate = ld; this.taskID = id; this.employeeID = -1; } public EmployeeLog(Time ci, Time co, Date ld, int id, int eid){ this.clockIn = ci; this.clockOut = co; this.logDate = ld; this.taskID = id; this.employeeID = eid; } public String printLog(){ String out = null; String clockProxy = null; if(clockOut != null) clockProxy = clockOut.toString(); else clockProxy = "PENDING"; if(employeeID == -1) out = String.format("IN: %s OUT: %s DATE: %s TASK: %d",clockIn.toString(), clockProxy, logDate.toString(), taskID); else out = String.format("IN: %s OUT: %s DATE: %s TASK: %d EmployeeID: %d",clockIn.toString(), clockProxy, logDate.toString(), taskID, employeeID); return out; } }
43dc997cdb283b57f97d2630d9c5bcd3de902fcd
c8dd21029c8f74df9be06a8768e167a7876848d9
/src/com/ra4king/opengl/util/GLProgram.java
776484ff76f9d7525285a20786eb51328b57a303
[]
no_license
binaryaaron/lamegame
0a6101fef904585355055081d64a509dfc8cc3b1
e5e484d47c321e692186a6cda8096bdfd10cf2fb
refs/heads/master
2021-05-29T09:46:07.285228
2015-04-18T02:56:34
2015-04-18T02:56:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,240
java
package com.ra4king.opengl.util; import static org.lwjgl.opengl.GL11.*; import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.ContextAttribs; import org.lwjgl.opengl.Display; import org.lwjgl.opengl.DisplayMode; import org.lwjgl.opengl.PixelFormat; /** * @author Roi Atalla */ public abstract class GLProgram { private int fps; public GLProgram(boolean vsync) { try { Display.setFullscreen(true); Display.setVSyncEnabled(vsync); } catch(Exception exc) { exc.printStackTrace(); } } public GLProgram(String name, int width, int height, boolean resizable) { Display.setTitle(name); try { Display.setDisplayMode(new DisplayMode(width, height)); } catch(Exception exc) { exc.printStackTrace(); } Display.setResizable(resizable); fps = 60; } public void setFPS(int fps) { this.fps = fps; } public int getFPS() { return fps; } public final void run() { run(false); } public final void run(boolean core) { run(core, new PixelFormat()); } public final void run(boolean core, PixelFormat format) { run(format, core ? new ContextAttribs(3, 3).withProfileCore(true) : null); } public final void run(int major, int minor) { run(major, minor, false); } public final void run(int major, int minor, boolean core) { run(major, minor, core, new PixelFormat()); } public final void run(int major, int minor, boolean core, PixelFormat format) { run(format, core ? new ContextAttribs(major, minor).withProfileCore(core) : new ContextAttribs(major, minor)); } public final void run(PixelFormat format) { run(format, null); } public final void run(ContextAttribs attribs) { run(new PixelFormat(), attribs); } public final void run(PixelFormat format, ContextAttribs attribs) { try { Display.create(format, attribs); } catch(Exception exc) { exc.printStackTrace(); System.exit(1); } gameLoop(); } private void gameLoop() { try { init(); Utils.checkGLError("init"); resized(); Utils.checkGLError("resized"); long lastTime, lastFPS; lastTime = lastFPS = System.nanoTime(); int frames = 0; long updateTime = 0, renderTime = 0; while(!Display.isCloseRequested() && !shouldStop()) { long deltaTime = System.nanoTime() - lastTime; lastTime += deltaTime; if(Display.wasResized()) resized(); while(Keyboard.next()) { if(Keyboard.getEventKeyState()) keyPressed(Keyboard.getEventKey(), Keyboard.getEventCharacter()); else keyReleased(Keyboard.getEventKey(), Keyboard.getEventCharacter()); } long initial = System.nanoTime(); update(deltaTime); updateTime += System.nanoTime() - initial; Utils.checkGLError("update"); initial = System.nanoTime(); render(); Display.update(); renderTime += System.nanoTime() - initial; Utils.checkGLError("render"); frames++; if(System.nanoTime() - lastFPS >= 1e9) { System.out.println("FPS: ".concat(String.valueOf(frames)) + "\tUpdate: " + (updateTime / frames) + "ns/" + String.format("%.2fms", updateTime / (frames * 1e6)) + "\tRender: " + (renderTime / frames) + "ns/" + String.format("%.2fms", renderTime / (frames * 1e6))); lastFPS += 1e9; updateTime = renderTime = 0; frames = 0; } Display.sync(fps); } } catch(Throwable exc) { exc.printStackTrace(); } finally { destroy(); } } public int getWidth() { return Display.getWidth(); } public int getHeight() { return Display.getHeight(); } public abstract void init(); public void resized() { glViewport(0, 0, getWidth(), getHeight()); } public boolean shouldStop() { return Keyboard.isKeyDown(Keyboard.KEY_ESCAPE); } public void keyPressed(int key, char c) {} public void keyReleased(int key, char cs) {} public void update(long deltaTime) {} public abstract void render(); public void destroy() { Display.destroy(); System.exit(0); } protected String readFromFile(String file) { try { return Utils.readFully(getClass().getResourceAsStream(file)); } catch(Exception exc) { throw new RuntimeException("Failure reading file " + file, exc); } } }
2af7f018bf99f10a1edf77975f9e4e20b597fe76
396577905a32de28157e72f89e2410ae2ccad6d0
/apollo/apollo-backend/src/main/java/io/logz/apollo/controllers/DeploymentGroupsController.java
f9e21e3c0f5819e259bcd6538e0907848611b364
[ "Apache-2.0" ]
permissive
seigneurcui/sanctuaire
91499e8d3781da4cbc58771bbf2f98fd7f9066e0
2339d47356b2d90289c3d00b81e412642bda3fb3
refs/heads/master
2022-12-13T18:27:55.872876
2018-07-04T08:53:57
2018-07-04T08:53:57
139,694,900
0
2
null
2022-11-16T07:31:12
2018-07-04T08:47:56
Go
UTF-8
Java
false
false
3,063
java
package io.logz.apollo.controllers; import com.google.common.base.Splitter; import io.logz.apollo.deployment.DeploymentHandler; import io.logz.apollo.models.MultiDeploymentResponseObject; import io.logz.apollo.excpetions.ApolloDeploymentException; import io.logz.apollo.models.Deployment; import io.logz.apollo.models.Group; import io.logz.apollo.dao.GroupDao; import org.rapidoid.annotation.Controller; import org.rapidoid.annotation.POST; import org.rapidoid.http.Req; import org.rapidoid.security.annotation.LoggedIn; import javax.inject.Inject; import static io.logz.apollo.common.ControllerCommon.assignJsonResponseToReq; import static java.util.Objects.requireNonNull; import io.logz.apollo.common.HttpStatus; import java.util.Optional; @Controller public class DeploymentGroupsController { private final DeploymentHandler deploymentHandler; private final GroupDao groupDao; private final static String GROUP_IDS_DELIMITER = ","; @Inject public DeploymentGroupsController(DeploymentHandler deploymentHandler, GroupDao groupDao) { this.deploymentHandler = requireNonNull(deploymentHandler); this.groupDao = requireNonNull(groupDao); } @LoggedIn @POST("/deployment-groups") public void addDeployment(int environmentId, int serviceId, int deployableVersionId, String groupIdsCsv, String deploymentMessage, Req req) throws NumberFormatException { MultiDeploymentResponseObject responseObject = new MultiDeploymentResponseObject(); Iterable<String> groupIds = Splitter.on(GROUP_IDS_DELIMITER).omitEmptyStrings().trimResults().split(groupIdsCsv); for (String groupIdString : groupIds) { int groupId = Integer.parseInt(groupIdString); Group group = groupDao.getGroup(groupId); if (group == null) { responseObject.addUnsuccessful(groupId, new ApolloDeploymentException("Non existing group.")); continue; } if (group.getServiceId() != serviceId) { responseObject.addUnsuccessful(groupId, new ApolloDeploymentException("The deployment service ID " + serviceId + " doesn't match the group service ID " + group.getServiceId())); continue; } if (group.getEnvironmentId() != environmentId) { responseObject.addUnsuccessful(groupId, new ApolloDeploymentException("The deployment environment ID " + environmentId + " doesn't match the group environment ID " + group.getEnvironmentId())); continue; } try { Deployment deployment = deploymentHandler.addDeployment(environmentId, serviceId, deployableVersionId, deploymentMessage, Optional.of(group), req); responseObject.addSuccessful(groupId, deployment); } catch (ApolloDeploymentException e) { responseObject.addUnsuccessful(groupId, e); } } assignJsonResponseToReq(req, HttpStatus.CREATED, responseObject); } }
38671a0b7383f303148d372d145612fc4f906ae9
cecc479932fe48f48ac4668859d13f470aed9576
/websiteDB.java
c778e1b8dc7dda5476b6398a0e09434588a644ff
[]
no_license
rsashna/sqLiteProj
d47a921bccd3460892c9eeb6c5110ac08fcd4429
424b1ff57c8ffae6b99673fdf8f3dffb7e789442
refs/heads/master
2023-07-13T12:23:48.233404
2021-08-20T03:26:12
2021-08-20T03:26:12
291,330,056
0
0
null
2020-08-29T19:02:42
2020-08-29T18:49:49
TSQL
UTF-8
Java
false
false
14,676
java
// made for websiteDB import java.sql.*; import java.util.Scanner; import java.text.SimpleDateFormat; import java.util.Date; import java.text.DateFormat; //usage //java -classpath ".:sqlite-jdbc-3.30.1.jar" websiteDB // import java.sql.Connection; // import java.sql.DriverManager; // import java.sql.ResultSet; // import java.sql.SQLException; // import java.sql.Statement; public class websiteDB{ public static void main(String args[]) { System.out.println("Checking Connection..."); Connection c = null; Statement stmt = null; try { Class.forName("org.sqlite.JDBC"); c = DriverManager.getConnection("jdbc:sqlite:websiteCompanies.db"); // c = DriverManager.getConnection("jdbc:sqlite:websiteCompanies.db"); } catch ( Exception e ) { System.err.println("Problem Encountered."); } System.out.println("Opened database successfully.\n\n"); // create a scanner Scanner scanner = new Scanner(System.in); // prompt for the user's name System.out.print("--WEBSITE COMPANIES DATABASE--"); System.out.print("\n\n To list all companies and their URLs select A \n To list all companies and their multimedia select B \n To list publishing dates for each company select C \n To list the country where each company was founded select D \n To list all types of websites on the database select E \n To list all types and their websites select F \n To list all tools with their website select G \n To list all types of websites on the database select H \n To list all types of websites on the database select I \n To list websites by order of publication dates select J \n To list how many devs per company select K \n To list devs per company in ascending order select L\n\n"); // get their input as a String String sel = scanner.next(); switch(sel) { case "A": try { stmt = c.createStatement(); } catch(SQLException e) { // do something appropriate with the exception, *at least*: e.printStackTrace(); } try { ResultSet rs = stmt.executeQuery( "select website.url, company.registeredName from website inner join company where website.companyID=company.companyID;"); System.out.printf("\n---\n"); while ( rs.next() ) { //code to access rows goes here String url = rs.getString("url"); String registeredName = rs.getString("registeredName"); System.out.printf("%s, %s\n", registeredName, url); } } catch (SQLException e) { // do something appropriate with the exception, *at least*: e.printStackTrace(); } break; case "B": try { stmt = c.createStatement(); } catch(SQLException e) { // do something appropriate with the exception, *at least*: e.printStackTrace(); } try { ResultSet rs = stmt.executeQuery( "select website.url, websiteMedia.type from website inner join websiteMedia where website.url=websiteMedia.url; "); System.out.printf("\n---\n"); while ( rs.next() ) { //code to access rows goes here String url = rs.getString("url"); String type = rs.getString("type"); System.out.printf("%s, %s\n", url, type); } } catch (SQLException e) { // do something appropriate with the exception, *at least*: e.printStackTrace(); } break; case "C": try { stmt = c.createStatement(); } catch(SQLException e) { // do something appropriate with the exception, *at least*: e.printStackTrace(); } try { ResultSet rs = stmt.executeQuery( "select url, pubDate from website; "); System.out.printf("\n---\n"); while ( rs.next() ) { //code to access rows goes here String url = rs.getString("url"); java.sql.Date date = rs.getDate("pubDate"); System.out.printf("%s, %s\n", url, date); } } catch (SQLException e) { // do something appropriate with the exception, *at least*: e.printStackTrace(); } break; case "D": try { stmt = c.createStatement(); } catch(SQLException e) { // do something appropriate with the exception, *at least*: e.printStackTrace(); } try { ResultSet rs = stmt.executeQuery( "select countryOrigin, registeredName from company;"); System.out.printf("\n---\n"); while ( rs.next() ) { //code to access rows goes here String registeredName = rs.getString("registeredName"); String countryOrigin = rs.getString("countryOrigin"); System.out.printf("%s, %s\n", registeredName, countryOrigin); } } catch (SQLException e) { // do something appropriate with the exception, *at least*: e.printStackTrace(); } break; case "E": try { stmt = c.createStatement(); } catch(SQLException e) { // do something appropriate with the exception, *at least*: e.printStackTrace(); } try { ResultSet rs = stmt.executeQuery( "select webType from websiteClassified;"); System.out.printf("\n---\n"); while ( rs.next() ) { //code to access rows goes here String webType = rs.getString("webType"); System.out.printf("%s\n", webType); } } catch (SQLException e) { // do something appropriate with the exception, *at least*: e.printStackTrace(); } break; case "F": try { stmt = c.createStatement(); } catch(SQLException e) { // do something appropriate with the exception, *at least*: e.printStackTrace(); } try { ResultSet rs = stmt.executeQuery( "select webType, url from websiteClassified;"); System.out.printf("\n---\n"); while ( rs.next() ) { //code to access rows goes here String webType = rs.getString("webType"); String url = rs.getString("url"); System.out.printf("%s\t%s\n", url, webType); } } catch (SQLException e) { // do something appropriate with the exception, *at least*: e.printStackTrace(); } break; case "G": try { stmt = c.createStatement(); } catch(SQLException e) { // do something appropriate with the exception, *at least*: e.printStackTrace(); } try { ResultSet rs = stmt.executeQuery( "select toolName, url from websiteTools"); System.out.printf("\n---\n"); while ( rs.next() ) { //code to access rows goes here String toolName = rs.getString("toolName"); String url = rs.getString("url"); System.out.printf("%s\t%s\n", url, toolName); } } catch (SQLException e) { // do something appropriate with the exception, *at least*: e.printStackTrace(); } break; case "H": try { stmt = c.createStatement(); } catch(SQLException e) { // do something appropriate with the exception, *at least*: e.printStackTrace(); } try { ResultSet rs = stmt.executeQuery( "select language, url from tools inner join websiteTools where tools.toolName=websiteTools.toolName;"); System.out.printf("\n---\n"); while ( rs.next() ) { //code to access rows goes here String url = rs.getString("url"); String language = rs.getString("language"); System.out.printf("%s\t%s\n", url, language); } } catch (SQLException e) { // do something appropriate with the exception, *at least*: e.printStackTrace(); } break; case "I": try { stmt = c.createStatement(); } catch(SQLException e) { // do something appropriate with the exception, *at least*: e.printStackTrace(); } try { ResultSet rs = stmt.executeQuery( "select developer.firstName, developer.lastName, company.registeredName from developer inner join company where company.companyID=developer.companyID"); System.out.printf("\n---\n"); while ( rs.next() ) { //code to access rows goes here String firstName = rs.getString("firstName"); String lastName = rs.getString("lastName"); String registeredName = rs.getString("registeredName"); System.out.printf("%s\t%s\t%s\n", registeredName, firstName, lastName); } } catch (SQLException e) { // do something appropriate with the exception, *at least*: e.printStackTrace(); } break; case "J": try { stmt = c.createStatement(); } catch(SQLException e) { // do something appropriate with the exception, *at least*: e.printStackTrace(); } try { ResultSet rs = stmt.executeQuery( "select url from website order by pubDate;"); System.out.printf("\n---\n"); while ( rs.next() ) { //code to access rows goes here String url = rs.getString("url"); System.out.printf("%s\n", url); } } catch (SQLException e) { // do something appropriate with the exception, *at least*: e.printStackTrace(); } break; case "K": try { stmt = c.createStatement(); } catch(SQLException e) { // do something appropriate with the exception, *at least*: e.printStackTrace(); } try { ResultSet rs = stmt.executeQuery( "select registeredName, COUNT(*) AS C from developer inner join company where company.companyID=developer.companyID group by company.companyID; "); System.out.printf("\n---\n"); while ( rs.next() ) { //code to access rows goes here String registeredName = rs.getString("registeredName"); Integer C = rs.getInt("C"); System.out.printf("%s\t%d\n", registeredName, C); } } catch (SQLException e) { // do something appropriate with the exception, *at least*: e.printStackTrace(); } break; case "L": try { stmt = c.createStatement(); } catch(SQLException e) { // do something appropriate with the exception, *at least*: e.printStackTrace(); } try { ResultSet rs = stmt.executeQuery( "select registeredName, COUNT(*) as count from developer inner join company where company.companyID=developer.companyID group by company.companyID order by count asc "); System.out.printf("\n---\n"); while ( rs.next() ) { //code to access rows goes here String registeredName = rs.getString("registeredName"); Integer C = rs.getInt("count"); System.out.printf("%s\t%d\n", registeredName, C); } } catch (SQLException e) { // do something appropriate with the exception, *at least*: e.printStackTrace(); } break; default: System.out.println("\nSELECTION NOT RECOGNISED"); } } }
5b7cb1d594a70ad04df5a9462269021b5d947d99
1bdd1ed4acfba08a9f0d8ab38cc91256efb45e02
/entropiahof/src/studio/coldstream/entropiahof/NewsHandler.java
0ec163f987bf59b7a4ec49f4881e41fcec11d2ce
[]
no_license
majakk/entropiahof
4158130c283158b6db6198b53f84da2d3125a4d8
4dd8df082d019a6ac6a32cc485c172535912d878
refs/heads/master
2021-01-16T02:45:38.564206
2012-12-18T21:02:05
2012-12-18T21:02:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,162
java
package studio.coldstream.entropiahof; import java.util.LinkedList; import java.util.List; import org.xml.sax.Attributes; import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; //import android.util.Log; public class NewsHandler extends DefaultHandler{ // =========================================================== // Fields // =========================================================== static final String TAG = "EH"; // for Log /*boolean in_itemtag = false; boolean in_titletag = false; boolean in_descriptiontag = false; boolean in_pubdatetag = false;*/ boolean in_divtag = false; boolean in_strongtag = false; boolean in_title = false; boolean in_content = false; String tableClass = ""; String tableClassTitle = "entryTitle"; String tableClassContent = "entryContent"; int counter = 0; //int trcounter = 0; //int indexer[] = new int[5]; private ParsedHofDataSet myParsedHofDataSet = new ParsedHofDataSet("", "", ""); private List<ParsedHofDataSet> myData = new LinkedList<ParsedHofDataSet>(); // =========================================================== // Getter & Setter // =========================================================== public ParsedHofDataSet getParsedData(int index) { //return this.myParsedExampleDataSet; return this.myData.get(index); } public int getCounterValue() { return counter; } // =========================================================== // Methods // =========================================================== @Override public void startDocument() throws SAXException { //this.myParsedHofDataSet = new ParsedHofDataSet(null, null, null); } @Override public void endDocument() throws SAXException { // Nothing to do } /** Gets be called on opening tags like: * <tag> * Can provide attribute(s), when xml was like: * <tag attribute="attributeValue">*/ @Override public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException { if (localName.equals("div")) { /*if(counter > 0){ indexer[counter] = myData.size(); Log.v(TAG, String.valueOf(indexer[counter])); }*/ this.in_divtag = true; tableClass = atts.getValue("class"); if(tableClass != null){ if(tableClass.equalsIgnoreCase(tableClassTitle)){ this.in_title = true; this.in_content = false; //Log.v(TAG, tableClass); counter++; }else if(tableClass.equalsIgnoreCase(tableClassContent)){ this.in_title = false; this.in_content = true; } //Log.v(TAG, String.valueOf(counter)); } }else if (localName.equals("strong")) { this.in_strongtag = true; } /*else if (localName.equals("description")) { this.in_descriptiontag = true; }else if (localName.equals("pubDate")) { this.in_pubdatetag = true;*/ //}else if (localName.equals("tagwithnumber")) { // Extract an Attribute //String attrValue = atts.getValue("thenumber"); //int i = Integer.parseInt(attrValue); //myParsedExampleDataSet.setExtractedInt(i); //} } /** Gets be called on closing tags like: * </tag> */ @Override public void endElement(String namespaceURI, String localName, String qName) throws SAXException { if (localName.equals("div")) { //counter++; this.in_divtag = false; this.in_title = false; this.in_content = false; /*this.myData.add(new ParsedHofDataSet(myParsedHofDataSet.getNameString(), myParsedHofDataSet.getResourceString(), myParsedHofDataSet.getValueString()));*/ }else if (localName.equals("strong")) { this.in_strongtag = false; this.myData.add(new ParsedHofDataSet(myParsedHofDataSet.getNameString(), myParsedHofDataSet.getResourceString(), myParsedHofDataSet.getValueString())); myParsedHofDataSet.setNameString(""); } /*else if (localName.equals("description")) { this.in_descriptiontag = false; }else if (localName.equals("pubDate")) { this.in_pubdatetag = false;*/ //}else if (localName.equals("tagwithnumber")) { // Nothing to do here //} } /** Gets be called on the following structure: * <tag>characters</tag> */ @Override public void characters(char ch[], int start, int length) { if(this.in_divtag){ if(this.in_title){ //myParsedHofDataSet.setNameString(""); myParsedHofDataSet.addToNameString(new String(ch, start, length)); //Log.v(TAG, String.valueOf(length)); } /*if(this.in_descriptiontag){ //myParsedHofDataSet.setNameString(""); myParsedHofDataSet.addToResourceString(new String(ch, start, length)); //Log.v(TAG, String.valueOf(length)); }*/ if(this.in_content && this.in_strongtag){ //myParsedHofDataSet.setNameString(""); myParsedHofDataSet.setValueString(new String(ch, start, length)); //Log.v(TAG, String.valueOf(length)); } /*if(this.in_fonttag){ myParsedHofDataSet.addToResourceString(new String(ch, start, length)); //Log.v(TAG, String.valueOf(length)); } if(this.in_tdtag){ myParsedHofDataSet.setValueString(new String(ch, start, length)); }*/ } } }
533359a9d468438d22d836cb3ba7f3678c486145
ce04225203faaeeae507eafec1f8216fa38ac40c
/app/src/main/java/com/gymnast/view/widget/photoview/scrollerproxy/IcsScroller.java
36560ad3c3cb2fa4fa4675a5bc1b15efa609d5b3
[ "Apache-2.0" ]
permissive
928902646/Gymnast
4a7062ee5bc910652f92d6789e0fb431701237c4
aefab7bdb47a7a81e8ecaa6e3f3650fdb795c7d1
refs/heads/master
2020-05-23T08:16:14.842151
2016-10-18T02:23:49
2016-10-18T02:23:49
70,256,549
0
0
null
null
null
null
UTF-8
Java
false
false
378
java
package com.gymnast.view.widget.photoview.scrollerproxy; import android.annotation.TargetApi; import android.content.Context; @TargetApi(14) public class IcsScroller extends GingerScroller { public IcsScroller(Context context) { super(context); } @Override public boolean computeScrollOffset() { return mScroller.computeScrollOffset(); } }
b33a1d640a78f4351d0312adaf9b025c2a41a044
d7c1917f50f7a9b02144668206dbfd6d7afcd34c
/springBootSample/datasearch/datasearch-core/src/main/java/com/aaron/datasearch/core/service/conference/IConferenceService.java
2dc3d18dceefbf382184013f974d3cef99d51367
[]
no_license
qsunny/j2ee
2d7339ee43e6bb2b97ed243f42cfd19e6e4627c3
2ad0c7c1895962a31454061625986c77d9dfbfb9
refs/heads/master
2022-01-13T17:30:03.448848
2022-01-01T15:18:00
2022-01-01T15:18:00
49,404,782
2
2
null
2021-06-07T16:53:00
2016-01-11T05:42:02
Java
UTF-8
Java
false
false
595
java
package com.aaron.datasearch.core.service.conference; import com.aaron.datasearch.bean.Conference; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import java.util.List; /** * Created by Administrator on 2018/6/2. */ public interface IConferenceService { Conference save(Conference conference); void delete(Conference conference); Conference findOne(String id); Iterable<Conference> findAll(); public Page<Conference> findByName(String name, PageRequest pageRequest); List<Conference> findByName(String name); }
c266996d233296cbce8b94d6487a01ed9ec9a117
0deb56bdcf91ca229bf61da0cf3cf3406223fb2c
/iot-channel-app/app/channel-tv/src/main/java/swaiotos/channel/iot/tv/iothandle/data/LocalMediaParams.java
56dc84f43fe18fca92bcbcf9b94652a70d099951
[]
no_license
soulcure/airplay
2ceb0a6707b2d4a69f85dd091b797dcb6f2c9d46
37dd3a890148a708d8aa6f95ac84355606af6a18
refs/heads/master
2023-04-11T03:49:15.246072
2021-04-16T09:15:03
2021-04-16T09:15:03
357,804,553
1
2
null
null
null
null
UTF-8
Java
false
false
181
java
package swaiotos.channel.iot.tv.iothandle.data; import java.io.Serializable; public class LocalMediaParams implements Serializable { public String name;//媒体文件名称 }
c32a31cc1f31217b8cad487f7110b47fa6cd9353
495f51577bb66289a798f1ee4671cd5cb9d3c3c8
/Crypto/Proyecto/BancoCrypto 1000/BancoCrypto/src/bancocliente/Hash.java
47030723cb2762dc9de51cc50a4e510688dacc86
[]
no_license
charlis397/proyectosMOCSE
433cce9ccd8a4330f5af486e66918886c8cd1226
1011489388288582e285121791c67d16f6057d7d
refs/heads/master
2021-04-27T13:13:57.306522
2018-02-26T02:08:17
2018-02-26T02:08:17
122,435,306
0
0
null
null
null
null
UTF-8
Java
false
false
1,376
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 bancocliente; /** * @author Samu */ public class Hash { private String llave; private String iv; public Hash(String punto_key, String punto_iv ) { llave=Hash.sha256(punto_key,24); iv=Hash.sha256(punto_iv,16); } public String getLlave() { return llave; } public String getIv() { return iv; } public static String getHash(String txt, String hashType, int tam){ try{ java.security.MessageDigest md = java.security.MessageDigest.getInstance(hashType); byte[] array = md.digest(txt.getBytes()); StringBuffer sb = new StringBuffer(); for (int i = 0; i < array.length; ++i) { sb.append(Integer.toHexString((array[i] & 0xFF) | 0x100).substring(1, 3)); } return sb.toString().substring(0,tam); } catch (java.security.NoSuchAlgorithmException e) { System.out.println(e.getMessage()); } return null; } public static String sha256(String txt, int tamano){ return Hash.getHash(txt, "SHA-256", tamano); } }
6c2ae3a79eaab2422ccd5effa964e3555c6ab504
c40efb977101232d91e99af0b78778bad3e0950a
/game_db/src/com/hifun/soul/gamedb/entity/HumanTechnologyEntity.java
de7c60bfbb9812f025df7cf57702b459019fc30e
[]
no_license
cietwwl/server
2bca79a17be6d5e6fee65e57d0df1fc753fb35e3
d18804f8c182eaa2509666aec10a2212ababc13c
refs/heads/master
2020-06-14T15:12:16.679591
2014-11-19T14:48:04
2014-11-19T14:48:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,081
java
package com.hifun.soul.gamedb.entity; import java.io.Serializable; import com.hifun.soul.core.orm.BaseProtobufEntity; import com.hifun.soul.core.orm.annotation.AutoCreateHumanEntityHolder; import com.hifun.soul.gamedb.IHumanSubEntity; import com.hifun.soul.proto.data.entity.Entity.HumanTechnology; import com.hifun.soul.proto.data.entity.Entity.HumanTechnology.Builder; /** * 角色科技实体; * * @author magicstone * */ @AutoCreateHumanEntityHolder(EntityHolderClass = "CollectionEntityHolder") public class HumanTechnologyEntity extends BaseProtobufEntity<HumanTechnology.Builder> implements IHumanSubEntity { public HumanTechnologyEntity(Builder builder) { super(builder); } public HumanTechnologyEntity() { this(HumanTechnology.newBuilder()); } @Override public long getHumanGuid() { return this.builder.getHumanGuid(); } @Override public Integer getId() { return this.builder.getTechnology().getTechnologyId(); } @Override public void setId(Serializable id) { this.builder.getTechnologyBuilder().setTechnologyId((Integer) id); } }
773dd9f57f6257075f55f3775bc49a04c3147bee
3e0a4e03908aa0b4611cefa9261808c6adceb63f
/src/main/java/MethodContractInspection.java
577ba1e923ef9643a86b0064a1371db72c9aa860
[ "Apache-2.0" ]
permissive
Charmik/IDEAInspections
689a2db237471b40a1554963880af5f2dde7bf82
b07e23090dc96639cc79280904306def0b8d194f
refs/heads/master
2020-12-27T16:00:49.966668
2020-02-03T13:19:22
2020-02-03T13:19:22
237,961,838
0
0
null
null
null
null
UTF-8
Java
false
false
4,994
java
import com.intellij.codeInspection.AbstractBaseUastLocalInspectionTool; import com.intellij.codeInspection.InspectionManager; import com.intellij.codeInspection.LocalQuickFix; import com.intellij.codeInspection.ProblemDescriptor; import com.intellij.codeInspection.ProblemHighlightType; import com.intellij.psi.JavaRecursiveElementVisitor; import com.intellij.psi.PsiAnnotation; import com.intellij.psi.PsiClass; import com.intellij.psi.PsiCodeBlock; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiExpression; import com.intellij.psi.PsiExpressionList; import com.intellij.psi.PsiMethod; import com.intellij.psi.PsiMethodCallExpression; import com.intellij.psi.PsiPrimitiveType; import com.intellij.psi.PsiType; import com.intellij.psi.impl.source.tree.java.PsiIdentifierImpl; import com.intellij.psi.impl.source.tree.java.PsiReferenceExpressionImpl; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.uast.UMethod; import org.jetbrains.uast.UParameter; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * Check that arguments have contracts. * @author Charm */ public class MethodContractInspection extends AbstractBaseUastLocalInspectionTool { @Nullable @Override public ProblemDescriptor[] checkMethod(@NotNull UMethod method, @NotNull InspectionManager manager, boolean isOnTheFly) { final PsiClass clazz = method.getContainingClass(); if (clazz == null) { return ProblemDescriptor.EMPTY_ARRAY; } final List<UParameter> uastParameters = method.getUastParameters(); final Map<String, PsiElement> paramNameCheckedByContract = new HashMap<>(); for (UParameter parameter : uastParameters) { final PsiAnnotation[] annotations = parameter.getPsi().getAnnotations(); boolean isNullableParameter = false; for (PsiAnnotation annotation : annotations) { if (annotation.getQualifiedName() != null && annotation.getQualifiedName().contains("Nullable")) { isNullableParameter = true; } } final PsiType type = parameter.getType(); if (!isNullableParameter && !(type instanceof PsiPrimitiveType)) { paramNameCheckedByContract.put(parameter.getName(), parameter.getJavaPsi()); } } final PsiCodeBlock body = method.getJavaPsi().getBody(); if (body != null) { body.accept(new JavaRecursiveElementVisitor() { @Override public void visitMethodCallExpression(PsiMethodCallExpression invoke) { super.visitMethodCallExpression(invoke); final PsiMethod invokedMethod = invoke.resolveMethod(); if (invokedMethod != null) { final String methodName = invokedMethod.getName(); if (invokedMethod.getContainingClass() != null && "Contracts".equals(invokedMethod.getContainingClass().getName()) && ("ensureNonNull".equals(methodName) || "ensureNonNullArgument".equals(methodName) || "requireNonNullArgument".equals(methodName))) { final PsiExpressionList arguments = invoke.getArgumentList(); final PsiExpression[] expressions = arguments.getExpressions(); for (PsiExpression expression : expressions) { if (expression instanceof PsiReferenceExpressionImpl) { final PsiElement[] exprChildren = expression.getChildren(); for (PsiElement exprChild : exprChildren) { if (exprChild instanceof PsiIdentifierImpl) { final PsiIdentifierImpl psiParam = (PsiIdentifierImpl) exprChild; paramNameCheckedByContract.remove(psiParam.getText()); } } } } } } } }); } List<ProblemDescriptor> result = new ArrayList<>(); for (Map.Entry<String, PsiElement> entry : paramNameCheckedByContract.entrySet()) { final ProblemDescriptor problem = manager.createProblemDescriptor( entry.getValue(), "Need to check it by contract", isOnTheFly, new LocalQuickFix[0], ProblemHighlightType.WARNING); result.add(problem); } return result.toArray(new ProblemDescriptor[0]); } }
21ea5b816cb013eab3b5dae3442ddd0e512ffc5e
1f3cdd68a7c24460e4b33f59fc6701e2c4599e9b
/app/src/main/java/cn/com/xibeiuniversity/xibeiuniversity/function/wheelview/OnWheelChangedListener.java
4cf38a2b00dfd15243c19db2688a7b349019b52f
[]
no_license
sun529417168/XiBeiUniversity
7c3e5336d646c68e3115c2f6ff4bee8e1e904cf2
7e8f21a56fed59b5b018eadc975997a0d4ccfb11
refs/heads/master
2021-01-19T13:08:44.937372
2017-04-21T07:05:36
2017-04-21T07:05:36
83,405,504
0
1
null
null
null
null
UTF-8
Java
false
false
1,263
java
/* * Copyright 2011 Yuri Kanivets * * 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 cn.com.xibeiuniversity.xibeiuniversity.function.wheelview; import cn.com.xibeiuniversity.xibeiuniversity.weight.WheelView; /** * Wheel changed listener interface. * <p>The onChanged() method is called whenever current wheel positions is changed: * <li> New Wheel position is set * <li> Wheel view is scrolled */ public interface OnWheelChangedListener { /** * Callback method to be invoked when current item changed * @param wheel the wheel view whose state has changed * @param oldValue the old value of current item * @param newValue the new value of current item */ void onChanged(WheelView wheel, int oldValue, int newValue); }
4d9368e8e0b6465eb13593496a2707da64037e6f
caa1aa2e43f477afd6d2092022bf97ec4a26c0a7
/Recommend.java
9977fedd9944d3496654fb12af9f4768b3fb6fae
[]
no_license
WeightControlBeteam/JavaFile
b7e3b05ab7398aeead7be023303fa767759b5e67
fcfd43132b62d33d1c787985efed3d8ad27911bb
refs/heads/master
2020-12-03T13:22:55.987785
2016-09-01T01:01:26
2016-09-01T01:01:26
67,054,023
0
1
null
null
null
null
UTF-8
Java
false
false
3,891
java
package com.example.tuananh.manhinhchinh; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import java.util.Calendar; /** * Created by SidaFPT on 8/18/2016. */ public class Recommend extends Fragment { static TextView ngay,gio,sang, trua_chinh,trua_phu, trua_canh, trua_rau, toi_chinh, toi_phu, toi_canh, toi_rau; static String ngaythang; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final View recommendView = inflater.inflate(R.layout.select, container, false); Calendar c = Calendar.getInstance(); int day = c.get(Calendar.DAY_OF_WEEK); int sogio = c.get(Calendar.HOUR_OF_DAY); String mYear = String.valueOf(c.get(Calendar.YEAR)); String mMonth = String.valueOf(c.get(Calendar.MONTH)+1); String mDay = String.valueOf(c.get(Calendar.DAY_OF_MONTH)); int mDate = c.get(Calendar.DATE); String songay = String.valueOf(day); //ketnoi data btDatabaseAdapter btdatabase = new btDatabaseAdapter(getActivity()); btdatabase.open(); SQLiteDatabase databt = btdatabase.getMyDatabase(); //define items ngay = (TextView) recommendView.findViewById(R.id.txt_goiy_ngay); sang = (TextView) recommendView.findViewById(R.id.txt_goiy_monsang); trua_chinh = (TextView) recommendView.findViewById(R.id.txt_goiy_tr_chinh); trua_phu = (TextView) recommendView.findViewById(R.id.txt_goiy_tr_phu); trua_canh = (TextView) recommendView.findViewById(R.id.txt_goiy_tr_canh); trua_rau = (TextView) recommendView.findViewById(R.id.txt_goiy_tr_rau); toi_chinh = (TextView) recommendView.findViewById(R.id.txt_goiy_t_chinh); toi_phu = (TextView) recommendView.findViewById(R.id.txt_goiy_t_phu); toi_canh = (TextView) recommendView.findViewById(R.id.txt_goiy_t_canh); toi_rau = (TextView) recommendView.findViewById(R.id.txt_goiy_t_rau); //defile value ngaythang = mDay+"/"+mMonth+"/"+mYear; ngay.setText(ngaythang); Cursor cursorS = databt.rawQuery("SELECT * FROM sang WHERE id = '"+songay+"'",null); if(cursorS.moveToFirst()) { sang.setText(cursorS.getString(cursorS.getColumnIndex("tenmon"))); } Cursor cursorTr = databt.rawQuery("SELECT * FROM trua WHERE id = '"+songay+"'",null); if(cursorTr.moveToFirst()) { trua_chinh.setText(cursorTr.getString(cursorTr.getColumnIndex("monchinh"))); trua_phu.setText(cursorTr.getString(cursorTr.getColumnIndex("monphu"))); trua_canh.setText(cursorTr.getString(cursorTr.getColumnIndex("canh"))); trua_rau.setText(cursorTr.getString(cursorTr.getColumnIndex("rau"))); if(cursorTr.getString(cursorTr.getColumnIndex("monphu"))==null){ trua_phu.setVisibility(View.GONE); } if(cursorTr.getString(cursorTr.getColumnIndex("canh"))==null){ trua_canh.setVisibility(View.GONE); } } Cursor cursorT = databt.rawQuery("SELECT * FROM toi WHERE id = '"+songay+"'",null); if(cursorT.moveToFirst()) { toi_chinh.setText(cursorT.getString(cursorT.getColumnIndex("monchinh"))); toi_phu.setText(cursorT.getString(cursorT.getColumnIndex("monphu"))); toi_canh.setText(cursorT.getString(cursorT.getColumnIndex("canh"))); toi_rau.setText(cursorT.getString(cursorT.getColumnIndex("rau"))); } return recommendView; } }
bd680451682707c49e7430a6a906da9208c7965d
23bdbd82c73d20f53d7a5a683121dec83a9b1293
/src/test/java/com/example/admins/AdminsApplicationTests.java
9497880c2982b9ff7ecf7e8bf811b963bbd9ec7c
[]
no_license
zfx1101804091/admins
646e192927245914462f2b4b0b276969dc4852b8
9544c6f83e77c43ca850beb24d48340412069d27
refs/heads/master
2022-07-01T11:54:41.987300
2020-03-03T17:06:54
2020-03-03T17:06:54
244,107,890
0
0
null
2022-06-17T02:57:15
2020-03-01T07:43:42
JavaScript
UTF-8
Java
false
false
650
java
//package com.example.admins; // //import com.example.admins.Bean.UserBean_a; //import com.example.admins.Bean.UserVar; //import com.example.admins.Dao.UserDao; //import com.example.admins.Dao.UserVarMapper; //import org.junit.jupiter.api.Test; //import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.boot.test.context.SpringBootTest; // //@SpringBootTest //class AdminsApplicationTests { // @Autowired // private UserDao userVarMapper; // @Test // void contextLoads() { // UserBean_a userVar= userVarMapper.userLogin("root"); // System.out.println(userVar.getId()); // }/**/ // //}
95ae4d40b6628c483c518a1e7561a6e4642c31d9
2d0cf3d7da024daa19e33364c137d9efd7df5fe2
/src/main/java/org/opengis/cite/cdb10/cdbStructure/MovingModelCodesXml.java
06af9ac6d5155ae84cbb1c71a916c3712004cd73
[ "LicenseRef-scancode-warranty-disclaimer", "Apache-2.0" ]
permissive
sarasaeedi/ets-cdb10-1
afada3c8634bf3493a279738be68e76943dd8ed2
9df2781abea8497b0b3fc50e29f10449b8fa348d
refs/heads/master
2020-03-23T07:37:34.775245
2018-03-20T06:03:55
2018-03-20T06:03:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,745
java
package org.opengis.cite.cdb10.cdbStructure; import org.opengis.cite.cdb10.metadataAndVersioning.MetadataXmlFile; import org.opengis.cite.cdb10.util.XMLUtils; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class MovingModelCodesXml extends MetadataXmlFile { public MovingModelCodesXml(String path) { super(path, "Moving_Model_Codes.xml", "Moving_Model_Codes.xsd"); } public boolean isValidCategoryCode(Integer code) { NodeList matches = XMLUtils.getNodeList("/Moving_Model_Codes/Kind/Domain/Category[@code = \"" + code.toString() + "\"]", this.xmlFile.toPath()); return (matches.getLength() > 0); } public boolean isValidDomainCode(Integer code) { NodeList matches = XMLUtils.getNodeList("/Moving_Model_Codes/Kind/Domain[@code = \"" + code.toString() + "\"]", this.xmlFile.toPath()); return (matches.getLength() > 0); } public boolean isValidKindCode(Integer code) { NodeList matches = XMLUtils.getNodeList("/Moving_Model_Codes/Kind[@code = \"" + code.toString() + "\"]", this.xmlFile.toPath()); return (matches.getLength() > 0); } public boolean isValidCategoryName(String name) { NodeList matches = XMLUtils.getNodeList("/Moving_Model_Codes/Kind/Domain/Category[@name = \"" + name + "\"]", this.xmlFile.toPath()); return (matches.getLength() > 0); } public boolean isValidDomainName(String name) { NodeList matches = XMLUtils.getNodeList("/Moving_Model_Codes/Kind/Domain[@name = \"" + name + "\"]", this.xmlFile.toPath()); return (matches.getLength() > 0); } public boolean isValidKindName(String name) { NodeList matches = XMLUtils.getNodeList("/Moving_Model_Codes/Kind[@name = \"" + name + "\"]", this.xmlFile.toPath()); return (matches.getLength() > 0); } public String categoryNameForCode(Integer code) { NodeList matches = XMLUtils.getNodeList("/Moving_Model_Codes/Kind/Domain/Category[@code = \"" + code.toString() + "\"]", this.xmlFile.toPath()); Node currentItem = matches.item(0); String name = currentItem.getAttributes().getNamedItem("name").getNodeValue(); return name; } public String domainNameForCode(Integer code) { NodeList matches = XMLUtils.getNodeList("/Moving_Model_Codes/Kind/Domain[@code = \"" + code.toString() + "\"]", this.xmlFile.toPath()); Node currentItem = matches.item(0); String name = currentItem.getAttributes().getNamedItem("name").getNodeValue(); return name; } public String kindNameForCode(Integer code) { NodeList matches = XMLUtils.getNodeList("/Moving_Model_Codes/Kind[@code = \"" + code.toString() + "\"]", this.xmlFile.toPath()); Node currentItem = matches.item(0); String name = currentItem.getAttributes().getNamedItem("name").getNodeValue(); return name; } }
f8e079021ba2f44caea8e0176c80d4f46f8d93c4
ea8fb2ba093fe8ad8d2b73bcabe580df84841ac3
/Chapter11/DeadlockDemo.java
ea1308474453f72de8740fa10cca51c7ecf71a97
[]
no_license
adarshvee/Java-9-A-Complete-Reference
134d8edb86b73f3b201f0d0bbb972642dbe81b54
7132288b211d90b2d3effc1f9c21effc51eccf89
refs/heads/master
2020-03-18T08:09:59.857277
2018-06-05T14:50:09
2018-06-05T14:50:09
134,494,008
0
0
null
null
null
null
UTF-8
Java
false
false
1,668
java
/* * This class shows a deadlock condition. Need to exit manually. Force deadlock using sleep */ package Chapter11; /** * * @author Adarsh V */ public class DeadlockDemo implements Runnable { A a = new A(); B b = new B(); DeadlockDemo() { Thread.currentThread().setName("Main thread"); Thread t = new Thread(this, "Racing thread"); t.start(); a.foo(b); // get a lock on a in main thread } public void run() { b.bar(a); // Get a lock on b in second thread System.out.println("Race thread"); } public static void main(String[] args) { new DeadlockDemo(); } } class A { synchronized void foo (B b) { String name = Thread.currentThread().getName(); System.out.println(name + "entered A.foo"); try { Thread.sleep(1000); } catch (InterruptedException ex) { System.out.println("A interrupted"); } System.out.println(name + " trying to call B.last()"); b.last(); } synchronized void last() { System.out.println("Chapter11.A.last"); } } class B { synchronized void bar (A b) { String name = Thread.currentThread().getName(); System.out.println(name + "entered B.bar"); try { Thread.sleep(1000); } catch (InterruptedException ex) { System.out.println("B interrupted"); } System.out.println(name + " trying to call A.last()"); b.last(); } synchronized void last() { System.out.println("Chapter11.B.last"); } }
1ae60d9d40ecfab98e5c40b7a37e7101f6e90dd1
5a8f0a86d59f529f1950c6458f7ab9f69e3c987e
/.svn/pristine/1f/1ff63c7fceb83756774d8d0840d5bc0540365473.svn-base
94d08d9b2acb4c13016841a69ad8d6ba36387b05
[]
no_license
P79N6A/robot
d0fb43a626c70e970ed537ed21164bccc4819bd1
ebe2930998fce48d0f4041ab077f7c5f014b85ee
refs/heads/master
2020-05-02T20:32:52.614929
2019-03-28T11:54:56
2019-03-28T11:54:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
11,291
package com.bossbutler.controller; import java.util.HashMap; import java.util.Map; import javax.servlet.http.HttpServletRequest; import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import com.bossbutler.common.AppElementManagerInterceptor; import com.bossbutler.exception.TransitListException; import com.bossbutler.pojo.ControllerView; import com.bossbutler.pojo.apk.upgrade.ApkNoticeDto; import com.bossbutler.pojo.apk.upgrade.ApkNoticeVo; import com.bossbutler.service.apk.notice.ApkNoticeUpgradeService; import com.bossbutler.service.system.AccountService; import com.bossbutler.service.system.InvitationService; import com.bossbutler.util.IfConstant; import com.bossbutler.util.WriteToPage; import com.company.util.BeanUtility; /** * <p> * 不需要参数token的系统功能. * </p> * * @author wq * */ @RestController @RequestMapping("") public class LoginController extends BaseController { private static Logger logger = Logger.getLogger(LoginController.class); @Autowired AccountService accountService; @Autowired private InvitationService invitationService; @Autowired private ApkNoticeUpgradeService apkNoticeUpgradeService; /** * 用户登录 * @param ControllerView * data实体为user * @return */ @RequestMapping(value = "/login", method = RequestMethod.POST) public String login(HttpServletRequest request, @ModelAttribute ControllerView view) { try { String appCodeName = request.getAttribute(AppElementManagerInterceptor.globalAppNameParamKey).toString(); return accountService.queryUserForLogin02(view, logger,appCodeName); } catch (Exception e) { logger.error("login参数obj转换json报错:" + e.getMessage(), e); return WriteToPage.setResponseMessage("{}", IfConstant.UNKNOWN_ERROR, null); } } /** * 用户登录 * @param ControllerView * data实体为user * @return */ @RequestMapping(value = "/login02", method = RequestMethod.POST) public String login02(HttpServletRequest request, @ModelAttribute ControllerView view) { try { String appCodeName = request.getAttribute(AppElementManagerInterceptor.globalAppNameParamKey).toString(); return accountService.queryUserForLogin02(view, logger,appCodeName); } catch (Exception e) { logger.error("login参数obj转换json报错:" + e.getMessage(), e); return WriteToPage.setResponseMessage("{}", IfConstant.UNKNOWN_ERROR, null); } } /** * 用户注册 * @param ControllerView * data实体为user * @return */ @RequestMapping(value = "/register", method = RequestMethod.POST) public String register(HttpServletRequest request, @ModelAttribute ControllerView view) { try { String appCodeName = request.getAttribute(AppElementManagerInterceptor.globalAppNameParamKey).toString(); String registerUser = accountService.registerUser(view, logger, appCodeName); //accountService.synTransit(view); return registerUser; } catch(TransitListException e){ return WriteToPage.setResponseMessageForError("有等同步名单,请稍后重试!", IfConstant.UNKNOWN_ERROR.getCode()); } catch (Exception e) { logger.error("login参数obj转换json报错:" + e.getMessage(), e); return WriteToPage.setResponseMessage("{}", IfConstant.UNKNOWN_ERROR, null); } } /** * 用户邀请码登录 * * @param loginView * @param request * @return */ @RequestMapping(value = "/inviLogin", method = RequestMethod.POST) @ResponseBody public String inviLogin(HttpServletRequest request, @ModelAttribute ControllerView view) { try { String appCodeName = request.getAttribute(AppElementManagerInterceptor.globalAppNameParamKey).toString(); String inviLogin = accountService.inviLogin(view, logger, appCodeName); //accountService.synTransit(view); return inviLogin; } catch(TransitListException e){ return WriteToPage.setResponseMessageForError("有等同步名单,请稍后重试!", IfConstant.UNKNOWN_ERROR.getCode()); } catch (Exception e) { logger.error("login参数obj转换json报错:" + e.getMessage(), e); return WriteToPage.setResponseMessage("{}", IfConstant.UNKNOWN_ERROR, null); } } /** * 用户邀请码登录下一步 * * @param loginView * @param request * @return */ @RequestMapping(value = "/inviLoginNext", method = RequestMethod.POST) @ResponseBody public String inviLoginNext(HttpServletRequest request, @ModelAttribute ControllerView view) { try { String appCodeName = request.getAttribute(AppElementManagerInterceptor.globalAppNameParamKey).toString(); return accountService.inviLoginNext(view, logger, appCodeName); } catch (Exception e) { logger.error("login参数obj转换json报错:" + e.getMessage(), e); return WriteToPage.setResponseMessage("{}", IfConstant.UNKNOWN_ERROR, null); } } /** * 用户登录 * * @param ControllerView * data实体为user * @return */ @RequestMapping(value = "/check/account/exist", method = RequestMethod.POST) public String checkAccountExit(@ModelAttribute ControllerView view) { try { return accountService.checkAccountExist(view, logger); } catch (Exception e) { logger.error("login参数obj转换json报错:" + e.getMessage(), e); return WriteToPage.setResponseMessage("{}", IfConstant.UNKNOWN_ERROR, null); } } /** * 访客机登录 返回项目列表 * @param request * @return */ @RequestMapping(value = "/machinelogin", method = RequestMethod.POST) @ResponseBody public String getContents(HttpServletRequest request) { try { String data = request.getParameter("data"); Map<String, String> parmap = BeanUtility.jsonStrToObject(data, Map.class, false); String name = parmap.get("name"); String password = parmap.get("password"); String mackAddress = parmap.get("mackAddress"); return accountService.checMechinekUser(name,password,mackAddress); } catch (Exception e) { logger.error("login参数obj转换json报错:" + e.getMessage(), e); return WriteToPage.setResponseMessage("请正确输入项目代码", IfConstant.UNKNOWN_ERROR, null); } } /** * 手持机登录 返回项目列表 * @param request * @return */ @RequestMapping(value = "/handset/login", method = RequestMethod.POST) @ResponseBody public String handsetLogin(HttpServletRequest request,@ModelAttribute ControllerView view) { try { String data = request.getParameter("data"); Map<String, String> parmap = BeanUtility.jsonStrToObject(data, Map.class, false); String name = parmap.get("name"); String password = parmap.get("password"); String mackAddress = parmap.get("mackAddress"); return accountService.checMechinekUser(name,password,mackAddress); } catch (Exception e) { logger.error("login参数obj转换json报错:" + e.getMessage(), e); return WriteToPage.setResponseMessage("请正确输入项目代码", IfConstant.UNKNOWN_ERROR, null); } } /** * ios升级兼容版本· 1.1.0 后不再使用 * @param view * @return */ @SuppressWarnings("unchecked") @RequestMapping(value = "/version/ios", method = RequestMethod.POST) @Deprecated public String checkVersionIOS(@ModelAttribute ControllerView view) { String url ="itms-apps://itunes.apple.com/app/id1150851306?mt=8"; try { Map<String, String> parmap = BeanUtility.jsonStrToObject(view.getData(), Map.class, false); String version = parmap.get("version"); String appCode = parmap.get("appCode"); logger.error("manage Apk: loginController: checkVersionIOS请求参数版本:version=" + version + "|appCode=" + appCode); if("IBB".equals(appCode)){ String newVersion = "1.1.0";// 升级分界版本 if (StringUtils.isBlank(version) || StringUtils.isBlank(appCode)) { return WriteToPage.setResponseMessage("{}", IfConstant.PARA_FAIL, null); } ApkNoticeVo vo = new ApkNoticeVo(); vo.setAppSystem("02"); vo.setAppVersion(version); vo.setCode(appCode); ApkNoticeDto dto = apkNoticeUpgradeService.getHighestNoticeTypeTbApkNotice(vo); HashMap<String, String> ret = new HashMap<>(); if(dto != null) { version = version.replace(".", ""); newVersion = dto.getVersionName(); newVersion = newVersion.replace(".", ""); if (Integer.parseInt(version) >= Integer.parseInt(newVersion)) { return WriteToPage.setResponseMessage("{}", IfConstant.UNKNOWN_ERROR, null); } if ("IBB".equals(appCode)) { url ="https://itunes.apple.com/cn/app/%E7%88%B1%E5%8C%85%E5%8A%9E/id1150851301?mt=8&t=" + System.currentTimeMillis(); } ret.put("versionName", dto.getVersionName()); ret.put("url", url); ret.put("describe", dto.getNoticeContent()); } return WriteToPage.setResponseMessage(BeanUtility.objectToJsonStr(ret, true), IfConstant.SERVER_SUCCESS, "" + System.currentTimeMillis()); } else {// 非IBB String newVersion = "1.0.8"; if (StringUtils.isBlank(version) || StringUtils.isBlank(appCode)) { return WriteToPage.setResponseMessage("{}", IfConstant.PARA_FAIL, null); } version = version.replace(".", ""); newVersion = newVersion.replace(".", ""); if (Integer.parseInt(version)>=Integer.parseInt(newVersion)) { return WriteToPage.setResponseMessage("{}", IfConstant.UNKNOWN_ERROR, null); } if ("IBB".equals(appCode)) { url ="itms-apps://itunes.apple.com/app/id1150851301?mt=8"; } HashMap<String, String> ret = new HashMap<>(); ret.put("versionName", newVersion); ret.put("url", url); ret.put("describe", "修改 页面 Bug "); return WriteToPage.setResponseMessage(BeanUtility.objectToJsonStr(ret, true), IfConstant.SERVER_SUCCESS, "" + System.currentTimeMillis()); } } catch (Exception e) { logger.error("检查版本报错:" + e.getMessage(), e); return WriteToPage.setResponseMessage("{}", IfConstant.UNKNOWN_ERROR, null); } } @RequestMapping(value = "/refresh/account", method = RequestMethod.POST) public String refreshAccount(HttpServletRequest request, @ModelAttribute ControllerView view) { try { String appCodeName = request.getAttribute(AppElementManagerInterceptor.globalAppNameParamKey).toString(); return accountService.refreshAccount02(view, appCodeName); } catch (Exception e) { logger.error("刷新用户信息出错:" + e.getMessage(), e); return WriteToPage.setResponseMessage("{}", IfConstant.UNKNOWN_ERROR, null); } } @RequestMapping(value = "/refresh/account02", method = RequestMethod.POST) public String refreshAccount02(HttpServletRequest request, @ModelAttribute ControllerView view) { try { String appCodeName = request.getAttribute(AppElementManagerInterceptor.globalAppNameParamKey).toString(); return accountService.refreshAccount02(view, appCodeName); } catch (Exception e) { logger.error("刷新用户信息出错:" + e.getMessage(), e); return WriteToPage.setResponseMessage("{}", IfConstant.UNKNOWN_ERROR, null); } } }
b9aa4207c2301ad765238eebc38ad9f36678abec
551e3aa6bbac57f416c16622d9f4e9081c52aa38
/cloud-provider-payment8002/src/main/java/com/pro/springcloud/service/PaymentService.java
a8ffb7978583b9cf19c1234c7d702aca130e50b6
[]
no_license
1070841863/cloud2020
87377778d3aeaa18216e58cbbfa09e2c3d4cdba2
63a7f16ee667aa66022235daae622bddc9e08cd9
refs/heads/master
2022-07-02T12:28:00.476860
2020-03-30T14:03:59
2020-03-30T14:03:59
247,728,465
0
0
null
2022-06-21T03:00:17
2020-03-16T14:43:51
Java
UTF-8
Java
false
false
330
java
package com.pro.springcloud.service; import com.pro.springcloud.pojo.Payment; import org.apache.ibatis.annotations.Param; /** * @author study * @create 2020-03-18 15:43 */ public interface PaymentService { //写操作 public int create(Payment payment); public Payment getPaymentById(@Param("id") Integer id); }
94630627a651a7cc84f89de363e488fb91751f83
ca569d3cae860ac0f9f646dcfb2fa74d33cd6677
/src/main/java/com/cs4227/framework/strategy/StrategyContext.java
9d07982b18286824608981a45afc377e6e058989
[]
no_license
ShaneMckenna23/cs4227-client
2334503fcd1d7b62c1dc6d139d97eb1a779827d7
6f4a387e918382ffe99ad90707371ca7a9ec25e7
refs/heads/master
2021-05-07T09:18:30.946503
2017-11-22T08:30:23
2017-11-22T08:30:23
109,497,920
0
1
null
2017-11-07T23:32:18
2017-11-04T13:42:29
Java
UTF-8
Java
false
false
546
java
package com.cs4227.framework.strategy; import com.cs4227.framework.state.StateContext; import java.awt.image.BufferedImage; public class StrategyContext { private SaveAsStrategy saveStrategy; public SaveAsStrategy getSaveStrategy() { return saveStrategy; } public void setSaveStrategy(SaveAsStrategy saveStrategy) { this.saveStrategy = saveStrategy; } public void save(String destination, BufferedImage image, StateContext context) { saveStrategy.save(destination, image, context); } }
dac59a87b84142537bef8f62a44e0c2dd5036c83
623ffe6e26031068678ab554286d2756476b1d5d
/src/main/java/net/ldcc/playground/config/SwaggerConfig.java
23df7eb7945b064d8847d4534685ec57831491cb
[]
no_license
dragon20002/playground
157e92134d624ac00334a83c881866be17595b60
f37ed2434b1dd0b03cb38b544ecf0e6ccc8ba74f
refs/heads/main
2023-04-30T12:09:57.688120
2021-05-06T14:37:32
2021-05-06T14:37:32
301,621,976
4
0
null
null
null
null
UTF-8
Java
false
false
799
java
package net.ldcc.playground.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import springfox.documentation.builders.PathSelectors; import springfox.documentation.builders.RequestHandlerSelectors; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger2.annotations.EnableSwagger2; @Configuration @EnableSwagger2 public class SwaggerConfig { @Bean public Docket api() { return new Docket(DocumentationType.SWAGGER_2) .select() .apis(RequestHandlerSelectors.basePackage("net.ldcc.playground")) .paths(PathSelectors.ant("/api/**")) .build(); } }
b3158ce38e02aec9cef16395abb0081519e9e702
703f828a38e30bf967f634c9c921265e8ff55968
/src/sample/UserLoginScreenController.java
0e8234320da0e82e42bfb04fde4c2165693e5d1a
[]
no_license
rvid2w/Gym-Management-System
4740ba2a9cb53b9a42f10c79a983b736f0e2536d
32117ae7be5d418476044e025cd1f9ee4cf70409
refs/heads/master
2022-10-19T20:28:38.097270
2020-06-10T11:30:43
2020-06-10T11:30:43
271,257,519
0
1
null
null
null
null
UTF-8
Java
false
false
2,754
java
package sample; import com.jfoenix.controls.JFXButton; import com.jfoenix.controls.JFXPasswordField; import com.jfoenix.controls.JFXTextField; import javafx.animation.FadeTransition; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.input.MouseEvent; import javafx.scene.layout.Pane; import javafx.util.Duration; import javax.swing.*; import java.io.IOException; import java.util.HashMap; import java.util.logging.Level; import java.util.logging.Logger; public class UserLoginScreenController { public Pane UserPane; public JFXPasswordField UserPasswordField; public JFXTextField UserUsernameField; public JFXButton UserLoginButton; public JFXButton UserBackButton; HashMap<String, String> usernameToPasswordHashmap = Database.UserNameToPasswordHashmap; int flag=0; public void UserLoginButtonHandler(MouseEvent mouseEvent) { String u = UserUsernameField.getText(); String p = UserPasswordField.getText(); try{ u.charAt(0); p.charAt(0); } catch(Exception e){ JFrame f = new JFrame(); JOptionPane.showMessageDialog(f, "Username or password empty!"); } for (String users : usernameToPasswordHashmap.keySet()) { if (users.equals(u)) { if (p.equals(usernameToPasswordHashmap.get(u))) { System.out.println("User Name: " + u + " logged in!"); flag = 1; UserPageController.User_name=u; loadNextScene("UserPage.fxml"); } } } if(flag==0){ JFrame f = new JFrame(); JOptionPane.showMessageDialog(f, "Username or password incorrect!"); } } public void UserBackButtonHandler(MouseEvent mouseEvent) { UserBackButton.setOnMouseClicked(e -> { FadeOut("LoginScreen.fxml"); }); } private void FadeOut(String fxmlFileName) { FadeTransition ft = new FadeTransition(); ft.setDuration(Duration.millis(300)); ft.setNode(UserPane); ft.setFromValue(1); ft.setToValue(0); ft.setOnFinished(e -> { loadNextScene(fxmlFileName); }); ft.play(); } private void loadNextScene(String fxmlFileName) { try { FXMLLoader loader = new FXMLLoader(getClass().getResource(fxmlFileName)); Parent root = loader.load(); Scene newScene = new Scene(root); Main.primaryStage.setScene(newScene); } catch (IOException ex) { Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex); } } }
cc919f59f2dc5123b68f1390c581932479074e23
2acb72aae4b7970b394f64885ef849f4569779e3
/library/src/main/java/com/blunderer/materialdesignlibrary/interfaces/ListView.java
e6661581512eb535c828b04799014669d8027b92
[]
no_license
Cloud-Concept/DWC-Final-Android
a66c4defd3d1cb181d9a7ee21e0aa9ac4a491f00
e19e79c3597d6b21c3c891c8b7298b97897ed9bd
refs/heads/master
2020-04-19T08:39:41.021658
2016-08-22T16:09:42
2016-08-22T16:09:42
66,248,361
0
1
null
null
null
null
UTF-8
Java
false
false
668
java
package com.blunderer.materialdesignlibrary.interfaces; import android.view.View; import android.widget.AdapterView; import android.widget.ListAdapter; public interface ListView { void setRefreshing(boolean refreshing); ListAdapter getListAdapter(); boolean useCustomContentView(); int getCustomContentView(); boolean pullToRefreshEnabled(); boolean LoadMoreEnabled(); int[] getPullToRefreshColorResources(); void onRefresh(); void loadMore(); void onItemClick(AdapterView<?> adapterView, View view, int position, long l); boolean onItemLongClick(AdapterView<?> adapterView, View view, int position, long l); }
[ "AbanoubWagdy" ]
AbanoubWagdy
d21303fc8da984cde1490c972ea0f0ead0cb133f
251139fc877e3760d2c7a4093fe7c9bba3ce2ad7
/UserProvider02/src/main/java/com/offcn/service/UserService.java
b8dd6f9764ee8dc268617bd2f0c6c7cc9db97e4f
[]
no_license
qifentudu/apartenproject
9ffff933551cdd4a3737e114e694ae6e055dc980
0d9adad51079cd3f58cbac0ad3599eb6f2e2fbd1
refs/heads/master
2020-09-12T10:54:50.375585
2019-11-20T12:07:00
2019-11-20T12:07:00
222,401,032
1
0
null
null
null
null
UTF-8
Java
false
false
361
java
package com.offcn.service; import com.offcn.po.User; import java.util.List; public interface UserService { //新增 public void add(User user); //修改 public void update(User user); //删除 public void delete(Long id); //查询全部 public List<User> findAll(); //根据ID查询 public User findOne(Long id); }
b48d8d51faf131a161d79bc2067ed55b6590f837
6272a913fb1dc228ba294967da54a1a4934be22d
/cardmerchantfront-system/src/main/java/com/pay/typay/system/mapper/SysUserRoleMapper.java
a0abf569003a3daa1e52d046ac78c7c1deb67359
[]
no_license
ikv163/CardMerchantFront
485b3a80e776a3c9d8e908d918ae461f593dd294
02b41eede4edc7f245df9ff39df59ae8ff4f149e
refs/heads/master
2022-12-04T02:41:13.430299
2020-08-22T08:44:10
2020-08-22T08:44:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,574
java
package com.pay.typay.system.mapper; import com.pay.typay.common.core.domain.Ztree; import com.pay.typay.system.domain.SysUserRole; import org.apache.ibatis.annotations.Param; import java.util.List; /** * 用户与角色关联表 数据层 * * @author js-oswald */ public interface SysUserRoleMapper { /** * 通过用户ID删除用户和角色关联 * * @param userId 用户ID * @return 结果 */ int deleteUserRoleByUserId(Long userId); /** * 批量删除用户和角色关联 * * @param ids 需要删除的数据ID * @return 结果 */ int deleteUserRole(Long[] ids); /** * 通过角色ID查询角色使用数量 * * @param roleId 角色ID * @return 结果 */ int countUserRoleByRoleId(Long roleId); /** * 批量新增用户角色信息 * * @param userRoleList 用户角色列表 * @return 结果 */ int batchUserRole(List<SysUserRole> userRoleList); /** * 删除用户和角色关联信息 * * @param userRole 用户和角色关联信息 * @return 结果 */ int deleteUserRoleInfo(SysUserRole userRole); /** * 批量取消授权用户角色 * * @param roleId 角色ID * @param userIds 需要删除的用户数据ID * @return 结果 */ int deleteUserRoleInfos(@Param("roleId") Long roleId, @Param("userIds") Long[] userIds); List<Ztree> userRoleTree(SysUserRole sysUserRole); List<Ztree> userRoleTreeMultiple(SysUserRole sysUserRole); }
174dcfd8f51c44b989dec33302e1314e036448ca
f45ce754926b41c0fd6fac8cff82523e3ea0475a
/LeftBullet.java
1c7eb590622641aabaa57d324414468a398502e1
[]
no_license
chasnolte/cs-261-programming-assignment-1-chasnolte-master
f21fed32aaee2bbb292a06ca38395ffbf46729ec
3f01fcaf8230a153d6390df8a89b8da8e8a1cdb2
refs/heads/master
2021-01-02T21:56:53.569281
2020-02-11T16:59:18
2020-02-11T16:59:18
239,816,489
0
0
null
null
null
null
UTF-8
Java
false
false
776
java
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * The left bullet actor is created when a player fires a gun, and will kill zombies on impact * * @author Chas Nolte * @version February 11 2020 */ public class LeftBullet extends Actor { /** * Act - do whatever the LeftBullet wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ public void act() { //Sets the location of the bullet to where the player is, and constantly moves left when fired setLocation(getX()-30, getY()); //Bullet is killed if it hits the edge of the world if (isAtEdge()) { getWorld().removeObject(this); } } }
0758a5c6007d458fde095d4246b6a180db421e0e
3884b64b3f227d7a0e335965431c54792d82fe5d
/vertx-lang-js/src/test/java/io/vertx/test/it/discovery/service/HelloServiceVertxEBProxy.java
26d49b7a479d739c32416bf1ba0c781bbb5bc741
[ "Apache-2.0" ]
permissive
vietj/vertx-lang-js
a7ab22876ea5cf7e0c0111f47e3fa7e302488efa
07e359121c1a650bc28774dcddaddde2eca265c2
refs/heads/master
2021-01-23T23:56:21.329694
2019-06-17T16:46:34
2019-06-17T16:46:34
21,736,084
0
0
null
null
null
null
UTF-8
Java
false
false
2,716
java
/* * Copyright 2014 Red Hat, Inc. * * Red Hat 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 io.vertx.test.it.discovery.service; import io.vertx.core.eventbus.DeliveryOptions; import io.vertx.core.Vertx; import io.vertx.core.Future; import io.vertx.core.json.JsonObject; import io.vertx.core.json.JsonArray; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import java.util.stream.Collectors; import java.util.function.Function; import io.vertx.serviceproxy.ServiceException; import io.vertx.serviceproxy.ServiceExceptionMessageCodec; import io.vertx.serviceproxy.ProxyUtils; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; /* Generated Proxy code - DO NOT EDIT @author Roger the Robot */ @SuppressWarnings({"unchecked", "rawtypes"}) public class HelloServiceVertxEBProxy implements HelloService { private Vertx _vertx; private String _address; private DeliveryOptions _options; private boolean closed; public HelloServiceVertxEBProxy(Vertx vertx, String address) { this(vertx, address, null); } public HelloServiceVertxEBProxy(Vertx vertx, String address, DeliveryOptions options) { this._vertx = vertx; this._address = address; this._options = options; try{ this._vertx.eventBus().registerDefaultCodec(ServiceException.class, new ServiceExceptionMessageCodec()); } catch (IllegalStateException ex) {} } @Override public void hello(JsonObject name, Handler<AsyncResult<String>> resultHandler){ if (closed) { resultHandler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed"))); return; } JsonObject _json = new JsonObject(); _json.put("name", name); DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions(); _deliveryOptions.addHeader("action", "hello"); _vertx.eventBus().<String>send(_address, _json, _deliveryOptions, res -> { if (res.failed()) { resultHandler.handle(Future.failedFuture(res.cause())); } else { resultHandler.handle(Future.succeededFuture(res.result().body())); } }); } }
cf4bad2068a400b354320f1282a9b76649375750
90dc85e44c4ebd26f2c1f4af2f92d79538d40d81
/gmall-search-service/src/test/java/com/atguigu/gmall/search/GmallSearchServiceApplicationTests.java
80142e3b4f5a5c7fc0cc46f85421141d641e0c3e
[]
no_license
eurekaribbon/gmall
b562e83fa20448d405f5d149b081eb69c30bea94
8573e770079924ac67b545362f0be064f6424a42
refs/heads/master
2022-09-29T09:36:28.172130
2020-02-19T04:17:48
2020-02-19T04:17:48
229,066,732
0
0
null
2022-09-01T23:17:47
2019-12-19T14:03:48
CSS
UTF-8
Java
false
false
4,369
java
package com.atguigu.gmall.search; import com.alibaba.dubbo.config.annotation.Reference; import com.atguigu.gmall.bean.PmsSerachSkuInfo; import com.atguigu.gmall.bean.PmsSkuInfo; import com.atguigu.gmall.service.SkuService; import io.searchbox.client.JestClient; import io.searchbox.core.Index; import io.searchbox.core.Search; import io.searchbox.core.SearchResult; import org.apache.commons.beanutils.BeanUtils; import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.MatchQueryBuilder; import org.elasticsearch.index.query.TermQueryBuilder; import org.elasticsearch.search.builder.SearchSourceBuilder; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.util.List; @SpringBootTest @RunWith(SpringRunner.class) public class GmallSearchServiceApplicationTests { @Reference SkuService skuService; @Autowired JestClient jestClient; @Test public void search() throws IOException { SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder(); //bool BoolQueryBuilder boolQueryBuilder = new BoolQueryBuilder(); //term TermQueryBuilder termQueryBuilder = new TermQueryBuilder("skuAttrValueList.attrId", "25"); //filter boolQueryBuilder.filter(termQueryBuilder); //match MatchQueryBuilder matchQueryBuilder = new MatchQueryBuilder("skuName", "华为"); //must boolQueryBuilder.must(matchQueryBuilder); //query searchSourceBuilder.query(boolQueryBuilder); //from searchSourceBuilder.from(0); //size searchSourceBuilder.size(20); //highlight searchSourceBuilder.highlight(null); String s = searchSourceBuilder.toString(); System.out.println(s); String json = "{\n" + " \"query\": {\n" + " \"bool\": {\n" + " \"filter\": [\n" + " {\n" + " \"term\": {\n" + " \"skuAttrValueList.attrId\": \"25\"\n" + " }\n" + " },\n" + " {\n" + " \"term\": {\n" + " \"skuAttrValueList.valueId\": \"39\"\n" + " }\n" + " \n" + " }\n" + " ],\n" + " \"must\": [\n" + " {\n" + " \"match\": {\n" + " \"skuName\": \"华为\"\n" + " }\n" + " }\n" + " ]\n" + " }\n" + " }\n" + "}"; Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex("gmallpms").addType("PmsSkuInfo").build(); SearchResult result = jestClient.execute(search); List<SearchResult.Hit<PmsSerachSkuInfo, Void>> hits = result.getHits(PmsSerachSkuInfo.class); for (SearchResult.Hit<PmsSerachSkuInfo, Void> hit : hits) { PmsSerachSkuInfo pmsSerachSkuInfo = hit.source; } } //同步mysql库与elasticsearch库 @Test public void contextLoads() throws InvocationTargetException, IllegalAccessException, IOException { //查询mysql List<PmsSerachSkuInfo> lists = new java.util.ArrayList<>(); List<PmsSkuInfo> skuInfoList = skuService.getAllSku(); //转化为es数据结构 for (PmsSkuInfo pmsSkuInfo : skuInfoList) { PmsSerachSkuInfo serachSkuInfo = new PmsSerachSkuInfo(); BeanUtils.copyProperties(serachSkuInfo,pmsSkuInfo); lists.add(serachSkuInfo); } //导入es for (PmsSerachSkuInfo list : lists) { Index index = new Index.Builder(list).index("gmallpms").type("PmsSkuInfo").id(list.getId()).build(); jestClient.execute(index); } } }
7e131a49a66dfadd8e581ac92c638395ca3c412b
3745b8362a76dde7da181b7a53f59005dc2909f4
/Game/Test1/app/src/main/java/com/hoadt/test1/customview/GameLoopThread.java
ffc23d40f4b599ea36f72ae55fe25ff479b870d5
[]
no_license
MTA-NAM4/PTPMDD
b50cc49cd4c9c881bcf6ae123f853fb83e7f49ba
edf5b3ca70390fd668234964d6ff62cad5d6c3ea
refs/heads/master
2020-04-14T07:57:59.640349
2019-01-06T15:56:13
2019-01-06T15:56:13
163,726,137
0
0
null
null
null
null
UTF-8
Java
false
false
1,485
java
package com.hoadt.test1.customview; import android.graphics.Canvas; /** * Created by HoaDT on 10/19/2018. * đảm nhiệm việc điều khiển hiển thị các đối tượng view */ public class GameLoopThread extends Thread { private DrawView drawView; private boolean running = false; public GameLoopThread(DrawView view) { this.drawView = view; } public void setRunning(boolean running) { this.running = running; } @Override public void run() { super.run(); while (running) { Canvas canvas = null; try { canvas = drawView.getHolder().lockCanvas(); //lockCanvas: //tránh việc canvas có nhiều luồng can thiệp vào //synchronized: toàn bộ công việc trong này thực hiện xong thì mới thực hiện cái khác synchronized (drawView.getHolder()) { if (canvas != null) { drawView.draw(canvas); } } } finally {//luôn thực hiện khối này if (canvas != null) { //mở khóa canvas drawView.getHolder().unlockCanvasAndPost(canvas); } } try { Thread.sleep(30); } catch (InterruptedException e) { e.printStackTrace(); } } } }
1762d501bffb8a0c0d3619fe61cbfbb8e779c94a
8adca8f049c8bc9494fedc57aa5aea09e77d3ffa
/jdbc_TemplateDemo/src/main/java/com/myCompany/jdbc_templateDemo_Dao/CustomerService.java
5312c007e2d7192f52b5ba4d26c8a4eeb5a49659
[]
no_license
dhiraj515151/Core_java_Training
9406c315f59f7c2f3f4319b18c439cd819c92a11
76fa6738dbd6da0f80bce9f7d7d179d9b7a9bb77
refs/heads/master
2022-12-22T08:32:17.776099
2020-03-14T12:13:17
2020-03-14T12:13:17
232,235,581
0
0
null
2022-12-16T15:24:28
2020-01-07T03:34:06
Java
UTF-8
Java
false
false
389
java
package com.myCompany.jdbc_templateDemo_Dao; import java.sql.SQLException; import java.util.List; import com.myCompany.jdbc_templateDemo_Example.Customer; public interface CustomerService { public Customer createCustomer(Customer customer) throws SQLException, Exception; public List<Customer> getAllCustomers()throws SQLException; public List<Customer> getCustomerById(); }
66aa3176a02c565ac24c5330dfd53d552b1e27af
fe86a5a01922c2c72df131f2f5970d3c4c6ec6e4
/src/main/java/com/kdgc/model/GoJsNode.java
503193e4dba379b8a2c87766ebd3c83be331f56c
[]
no_license
miki-hmt/blood-analysis
e807eae94e4c6dc932b44fc8772d25b6a83f7219
50144a52028b5e67ee73a9f62bd8d10cb4abb2da
refs/heads/master
2023-08-10T07:30:59.129851
2021-09-10T01:55:57
2021-09-10T01:55:57
329,489,492
4
1
null
null
null
null
UTF-8
Java
false
false
498
java
package com.kdgc.model; import lombok.Builder; import lombok.Getter; import lombok.Setter; import java.io.Serializable; import java.util.List; /** * @author jczhou * @description * @date 2020/7/24 **/ @Setter @Getter @Builder public class GoJsNode implements Serializable { private Long nodeId; private String dbUrl; private String key; private String srType; private List<GoJsNodeField> fields; /** * 位置 如: 321 -98 */ private String loc; }
14be2f3bb12a0e2455bd1affdfffa0425afd5c5a
7096288718c53a96db43374e7f7fb2038d6540d8
/common/java/router/src/net/i2p/router/transport/udp/OutboundRefiller.java
078105a4a7b1c00a471c9c758167879cdd1c7f37
[ "Unlicense", "LicenseRef-scancode-public-domain" ]
permissive
mhatta/Nightweb
5ea1a4cec12393e0fd7fccafe1b116402e2cafd5
b6e58eec6722dfb9df0e3de2de600c222729c96b
refs/heads/master
2021-08-22T05:14:06.870860
2019-02-05T10:27:26
2019-02-05T10:27:26
151,987,810
10
0
Unlicense
2020-04-01T03:15:26
2018-10-07T21:40:45
Clojure
UTF-8
Java
false
false
2,325
java
package net.i2p.router.transport.udp; import net.i2p.router.OutNetMessage; import net.i2p.router.RouterContext; import net.i2p.util.I2PThread; import net.i2p.util.Log; /** * Blocking thread to grab new messages off the outbound queue and * plopping them into our active pool. * * WARNING - UNUSED since 0.6.1.11 * */ class OutboundRefiller implements Runnable { private RouterContext _context; private Log _log; private OutboundMessageFragments _fragments; private MessageQueue _messages; private boolean _alive; // private Object _refillLock; public OutboundRefiller(RouterContext ctx, OutboundMessageFragments fragments, MessageQueue messages) { _context = ctx; _log = ctx.logManager().getLog(OutboundRefiller.class); _fragments = fragments; _messages = messages; // _refillLock = this; _context.statManager().createRateStat("udp.timeToActive", "Message lifetime until it reaches the outbound fragment queue", "udp", UDPTransport.RATES); } public void startup() { _alive = true; I2PThread t = new I2PThread(this, "UDP outbound refiller", true); t.start(); } public void shutdown() { _alive = false; } public void run() { while (_alive) { if (_log.shouldLog(Log.DEBUG)) _log.debug("Check the fragments to see if we can add more..."); boolean wantMore = _fragments.waitForMoreAllowed(); if (wantMore) { if (_log.shouldLog(Log.DEBUG)) _log.debug("Want more fragments..."); OutNetMessage msg = _messages.getNext(-1); if (msg != null) { if (_log.shouldLog(Log.DEBUG)) _log.debug("New message found to fragments: " + msg); _context.statManager().addRateData("udp.timeToActive", msg.getLifetime(), msg.getLifetime()); _fragments.add(msg); } else { if (_log.shouldLog(Log.DEBUG)) _log.debug("No message found to fragment"); } } else { if (_log.shouldLog(Log.WARN)) _log.warn("No more fragments allowed, looping"); } } } }
424883eea2fbea9dde2ff09ffea11c6e6b797d52
61a6bd24d93e4dc9ac11944d56e53843a3780c27
/src/mapper/TopMenuMapper.java
42639aae783af48e847cfbf71c3a0b8a930af1d4
[]
no_license
qkrqudcks7/SpringFramework_springMVC
86f364ec5baf474debce231fa142024b7e87e629
2df74b1f28baeae0846ae2dbd115d3f521fa9f98
refs/heads/master
2023-04-26T16:09:20.170511
2021-05-25T14:44:58
2021-05-25T14:44:58
292,471,520
0
0
null
null
null
null
UTF-8
Java
false
false
357
java
package mapper; import java.util.List; import org.apache.ibatis.annotations.Select; import beans.BoardInfoBean; public interface TopMenuMapper { // 상단 바 같이 모든 화면에 나오는 것은 인터페이스로 작성하면 편하다 @Select("select * from board_info_table order by board_info_idx") List<BoardInfoBean> getTopMenuList(); }
289e2464a82aba02dd09358b8fe77b0ff25cb2ae
fb4405e24ffd9fc8405497fa0fa1724bfe7b3211
/src/Spec.java
c5fb950c25c6b3e0e8a6b4969e31c5c09df86c26
[]
no_license
MageMasher/AbstractHelloWorld
3df159f6510cfe0b0523667d266e97c3cce69d0e
3461570c010d80ff0017a990599faeede8e6091e
refs/heads/master
2020-07-27T01:46:28.033300
2019-09-16T14:56:42
2019-09-16T14:56:42
208,827,354
0
0
null
null
null
null
UTF-8
Java
false
false
168
java
abstract class Spec { private String rootFile = "Im the string that represents rootFile"; public String getRootFile() { return this.rootFile; } }
a7395b255878df8d36eb16db9562b96a11c79826
4f52c9889f8b9e50bc077131c5f4dd62c844285d
/plugin/src/main/groovy/heavy/test/plugin/model/wrapper/testable/TestableWrapper.java
dcc4fb3883dedb288bd66463bca738b4f0b56cb4
[ "Apache-2.0" ]
permissive
heavy-james/AndroidTestPlugin
1915a2aa0b16786b0b922df9fb63e64dbdeca5fd
86ddaf2221a8898ee35b9f06d6670ba1783b6c66
refs/heads/master
2021-05-02T12:06:35.476253
2018-02-25T06:40:53
2018-02-25T06:40:53
120,736,709
0
0
null
null
null
null
UTF-8
Java
false
false
11,487
java
package heavy.test.plugin.model.wrapper.testable; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import groovy.lang.Closure; import heavy.test.plugin.model.data.Action; import heavy.test.plugin.model.data.TestBlock; import heavy.test.plugin.model.data.TestContext; import heavy.test.plugin.model.data.TestObject; import heavy.test.plugin.model.data.Testable; import heavy.test.plugin.model.data.testable.global.ConditionedTestable; import heavy.test.plugin.model.data.testable.global.Delay; import heavy.test.plugin.model.data.testable.global.MakeToast; import heavy.test.plugin.model.data.testable.global.SendMessage; import heavy.test.plugin.model.data.testable.global.StopTest; import heavy.test.plugin.model.data.testable.global.ThrowException; import heavy.test.plugin.model.data.testable.view.TestableAdapterView; import heavy.test.plugin.model.data.testable.view.TestableRecyclerView; import heavy.test.plugin.model.data.testable.view.TestableView; import heavy.test.plugin.model.wrapper.ContextWrapper; import heavy.test.plugin.model.wrapper.TestObjectWrapper; import heavy.test.plugin.model.wrapper.action.ActionWrapper; import heavy.test.plugin.model.wrapper.interf.IKeyEventWrapper; import heavy.test.plugin.model.wrapper.interf.ITestableWrapper; import heavy.test.plugin.model.wrapper.testable.global.ConditionedTestableWrapper; import heavy.test.plugin.model.wrapper.testable.view.TestableAdapterViewWrapper; import heavy.test.plugin.model.wrapper.testable.view.TestableRecyclerViewWrapper; import heavy.test.plugin.model.wrapper.testable.view.TestableViewWrapper; import heavy.test.plugin.util.TextUtil; /** * Created by heavy on 2017/5/31. */ public class TestableWrapper extends TestObjectWrapper implements ITestableWrapper, IKeyEventWrapper { public static final String TAG = "TestableWrapper"; private static List<TestContext> savedTestContexts = new ArrayList<>(); private static Map<String, TestObject> cachedVars = new HashMap<>(); public TestableWrapper(TestContext testContext, TestObject testObject) { super(testContext, testObject); } public static void defVar(String name, TestObject testObject) { cachedVars.put(name, testObject); } public void context(Closure closure) { ContextWrapper contextWrapper = new ContextWrapper(new TestContext()); closure.setDelegate(contextWrapper); closure.setResolveStrategy(Closure.DELEGATE_ONLY); closure.call(); savedTestContexts.add(contextWrapper.getTestContext()); } public void useContext(String name) { for (TestContext testContext : savedTestContexts) { if (TextUtil.equals(testContext.getContextName(), name)) { mTestContext.setParentTestContext(testContext); } } } public TestObject useVar(String name) { return cachedVars.get(name); } @Override public Testable withView(Closure closure) { TestableViewWrapper wrapper = new TestableViewWrapper(new TestableView()); closure.setResolveStrategy(Closure.DELEGATE_ONLY); closure.setDelegate(wrapper); closure.call(); Testable testable = wrapper.getTestableView(); if (mTestObject != null) { mTestObject.addContentObject(testable); } return testable; } @Override public Testable withAdapterView(Closure closure) { TestableAdapterViewWrapper wrapper = new TestableAdapterViewWrapper(new TestableAdapterView()); closure.setResolveStrategy(Closure.DELEGATE_ONLY); closure.setDelegate(wrapper); closure.call(); Testable testable = wrapper.getTestableView(); if (mTestObject != null) { mTestObject.addContentObject(testable); } return testable; } @Override public Testable withRecyclerView(Closure closure) { TestableRecyclerViewWrapper wrapper = new TestableRecyclerViewWrapper(new TestableRecyclerView()); closure.setResolveStrategy(Closure.DELEGATE_ONLY); closure.setDelegate(wrapper); closure.call(); Testable testable = wrapper.getTestableView(); if (mTestObject != null) { mTestObject.addContentObject(testable); } return testable; } @Override public Testable addView(String name, Closure closure) { TestableViewWrapper wrapper = new TestableViewWrapper(new TestableView()); closure.setResolveStrategy(Closure.DELEGATE_ONLY); closure.setDelegate(wrapper); closure.call(); Testable testable = wrapper.getTestableView(); if (mTestContext != null) { mTestContext.addTestObject(name, testable); } return testable; } @Override public Testable addAdapterView(String name, Closure closure) { TestableAdapterViewWrapper wrapper = new TestableAdapterViewWrapper(new TestableAdapterView()); closure.setResolveStrategy(Closure.DELEGATE_ONLY); closure.setDelegate(wrapper); closure.call(); Testable testable = wrapper.getTestableView(); if (mTestContext != null) { mTestContext.addTestObject(name, testable); } return testable; } @Override public Testable addRecyclerView(String name, Closure closure) { TestableRecyclerViewWrapper wrapper = new TestableRecyclerViewWrapper(new TestableRecyclerView()); closure.setResolveStrategy(Closure.DELEGATE_ONLY); closure.setDelegate(wrapper); closure.call(); Testable testable = wrapper.getTestableView(); if (mTestContext != null) { mTestContext.addTestObject(name, testable); } return testable; } @Override public Testable getAdapterView(String name, Closure closure) { TestObject testObject = mTestContext.getTestObject(name).clean(); TestableAdapterView result = (TestableAdapterView) testObject; closure.setDelegate(new TestableAdapterViewWrapper(result)); closure.setResolveStrategy(Closure.DELEGATE_ONLY); closure.call(); if (mTestObject != null) { mTestObject.addContentObject(result); } return result; } @Override public Testable getRecyclerView(String name, Closure closure) { TestObject testObject = mTestContext.getTestObject(name).clean(); TestableRecyclerView result = (TestableRecyclerView) testObject; closure.setDelegate(new TestableAdapterViewWrapper(result)); closure.setResolveStrategy(Closure.DELEGATE_ONLY); closure.call(); if (mTestObject != null) { mTestObject.addContentObject(result); } return result; } @Override public Testable getView(String name, Closure closure) { TestObject testObject = mTestContext.getTestObject(name).clean(); TestableView result = (TestableView) testObject; closure.setDelegate(new TestableViewWrapper(result)); closure.setResolveStrategy(Closure.DELEGATE_ONLY); closure.call(); if (mTestObject != null) { mTestObject.addContentObject(result); } return result; } @Override public Testable makeToast(String msg, long time) { Testable testable = new MakeToast(msg, time); if (mTestObject != null) { mTestObject.addContentObject(testable); } return testable; } @Override public Testable makeToast(String msg) { return makeToast(msg, 2000); } @Override public Testable printMessage(String msg) { Testable testable = new SendMessage(msg); if (mTestObject != null) { mTestObject.addContentObject(testable); } return testable; } @Override public Testable stopTest(String msg) { Testable testable = new StopTest(msg); if (mTestObject != null) { mTestObject.addContentObject(testable); } return testable; } @Override public Testable throwException(String msg) { Testable testable = new ThrowException(msg); if (mTestObject != null) { mTestObject.addContentObject(testable); } return testable; } @Override public Testable delay(long time) { Testable testable = new Delay(time); if (mTestObject != null) { mTestObject.addContentObject(testable); } return testable; } public TestObject doIf(Closure closure) { ConditionedTestableWrapper wrapper = new ConditionedTestableWrapper(mTestContext, new ConditionedTestable(mTestContext)); closure.setResolveStrategy(Closure.DELEGATE_ONLY); closure.setDelegate(wrapper); closure.call(); TestObject testObject = wrapper.getConditionedTestable(); if (mTestObject != null) { mTestObject.addContentObject(testObject); } return testObject; } public TestObject doIfNot(Closure closure) { ConditionedTestable testable = (ConditionedTestable) doIf(closure); testable.setConversed(true); return testable; } public TestObject block(Closure closure) { TestObject testObject = new TestBlock(); TestableWrapper testableWrapper = new TestableWrapper(mTestContext, testObject); closure.setResolveStrategy(Closure.DELEGATE_ONLY); closure.setDelegate(testableWrapper); closure.call(); if (mTestObject != null) { mTestObject.addContentObject(testObject); } return testObject; } public TestObject waitUntil(Closure closure) { return doIf(closure); } public TestObject getTestObject() { return mTestObject; } @Override public Action keyEvent(int keyCode, String eventAction) { return new ActionWrapper(mTestObject).keyEvent(keyCode, eventAction); } @Override public Action pressKey(int keyCode) { return new ActionWrapper(mTestObject).pressKey(keyCode); } @Override public Action pressBack() { return new ActionWrapper(mTestObject).pressBack(); } @Override public Action pressMenu() { return new ActionWrapper(mTestObject).pressMenu(); } @Override public Action pressDpadCenter() { return new ActionWrapper(mTestObject).pressDpadCenter(); } @Override public Action pressDpadUp() { return new ActionWrapper(mTestObject).pressDpadUp(); } @Override public Action pressDpadDown() { return new ActionWrapper(mTestObject).pressDpadDown(); } @Override public Action pressDpadLeft() { return new ActionWrapper(mTestObject).pressDpadLeft(); } @Override public Action pressDpadRight() { return new ActionWrapper(mTestObject).pressDpadRight(); } @Override public Action pressVolumeDown() { return new ActionWrapper(mTestObject).pressVolumeDown(); } @Override public Action pressHome() { return new ActionWrapper(mTestObject).pressHome(); } @Override public Action pressPower() { return new ActionWrapper(mTestObject).pressPower(); } @Override public Action pressVolumeUp() { return new ActionWrapper(mTestObject).pressVolumeUp(); } }
b2b5280160d78176c3506ca4cdee6d4d86e26b1c
f7da203780fa15df1ad33bc4be37ddf52ebd3070
/FootballScores/app/src/main/java/barqsoft/footballscores/service/myFetchService.java
ae289ca1c3f1b6f05169fdc045117a6320ac5cb2
[]
no_license
PedramVeisi/SuperDuo
b5de59a37f13ff94337261b0a300575b3b201a85
a1d8590f634763ed749edb01c4eabf543a745b1c
refs/heads/master
2021-01-10T16:03:16.638136
2016-03-09T02:23:11
2016-03-09T02:23:11
43,734,472
0
0
null
null
null
null
UTF-8
Java
false
false
11,823
java
package barqsoft.footballscores.service; import android.app.IntentService; import android.content.ContentValues; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.util.Log; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; import java.util.Vector; import barqsoft.footballscores.DatabaseContract; import barqsoft.footballscores.R; /** * Created by yehya khaled on 3/2/2015. */ public class myFetchService extends IntentService { public static final String LOG_TAG = "myFetchService"; public myFetchService() { super("myFetchService"); } @Override protected void onHandleIntent(Intent intent) { getData("n2"); getData("p2"); return; } private void getData (String timeFrame) { //Creating fetch URL final String BASE_URL = "http://api.football-data.org/alpha/fixtures"; //Base URL final String QUERY_TIME_FRAME = "timeFrame"; //Time Frame parameter to determine days //final String QUERY_MATCH_DAY = "matchday"; Uri fetch_build = Uri.parse(BASE_URL).buildUpon(). appendQueryParameter(QUERY_TIME_FRAME, timeFrame).build(); //Log.v(LOG_TAG, "The url we are looking at is: "+fetch_build.toString()); //log spam HttpURLConnection m_connection = null; BufferedReader reader = null; String JSON_data = null; //Opening Connection try { URL fetch = new URL(fetch_build.toString()); m_connection = (HttpURLConnection) fetch.openConnection(); m_connection.setRequestMethod("GET"); m_connection.addRequestProperty("X-Auth-Token",getString(R.string.api_key)); m_connection.connect(); // Read the input stream into a String InputStream inputStream = m_connection.getInputStream(); StringBuffer buffer = new StringBuffer(); if (inputStream == null) { // Nothing to do. return; } reader = new BufferedReader(new InputStreamReader(inputStream)); String line; while ((line = reader.readLine()) != null) { // Since it's JSON, adding a newline isn't necessary (it won't affect parsing) // But it does make debugging a *lot* easier if you print out the completed // buffer for debugging. buffer.append(line + "\n"); } if (buffer.length() == 0) { // Stream was empty. No point in parsing. return; } JSON_data = buffer.toString(); } catch (Exception e) { Log.e(LOG_TAG,"Exception here" + e.getMessage()); } finally { if(m_connection != null) { m_connection.disconnect(); } if (reader != null) { try { reader.close(); } catch (IOException e) { Log.e(LOG_TAG,"Error Closing Stream"); } } } try { if (JSON_data != null) { //This bit is to check if the data contains any matches. If not, we call processJson on the dummy data JSONArray matches = new JSONObject(JSON_data).getJSONArray("fixtures"); if (matches.length() == 0) { //if there is no data, call the function on dummy data //this is expected behavior during the off season. processJSONdata(getString(R.string.dummy_data), getApplicationContext(), false); return; } processJSONdata(JSON_data, getApplicationContext(), true); } else { //Could not Connect Log.d(LOG_TAG, "Could not connect to server."); } } catch(Exception e) { Log.e(LOG_TAG,e.getMessage()); } } private void processJSONdata (String JSONdata,Context mContext, boolean isReal) { //JSON data // This set of league codes is for the 2015/2016 season. In fall of 2016, they will need to // be updated. Feel free to use the codes final String BUNDESLIGA1 = "394"; final String BUNDESLIGA2 = "395"; final String LIGUE1 = "396"; final String LIGUE2 = "397"; final String PREMIER_LEAGUE = "398"; final String PRIMERA_DIVISION = "399"; final String SEGUNDA_DIVISION = "400"; final String SERIE_A = "401"; final String PRIMERA_LIGA = "402"; final String Bundesliga3 = "403"; final String EREDIVISIE = "404"; final String SEASON_LINK = "http://api.football-data.org/alpha/soccerseasons/"; final String MATCH_LINK = "http://api.football-data.org/alpha/fixtures/"; final String FIXTURES = "fixtures"; final String LINKS = "_links"; final String SOCCER_SEASON = "soccerseason"; final String SELF = "self"; final String MATCH_DATE = "date"; final String HOME_TEAM = "homeTeamName"; final String AWAY_TEAM = "awayTeamName"; final String RESULT = "result"; final String HOME_GOALS = "goalsHomeTeam"; final String AWAY_GOALS = "goalsAwayTeam"; final String MATCH_DAY = "matchday"; //Match data String League = null; String mDate = null; String mTime = null; String Home = null; String Away = null; String Home_goals = null; String Away_goals = null; String match_id = null; String match_day = null; try { JSONArray matches = new JSONObject(JSONdata).getJSONArray(FIXTURES); //ContentValues to be inserted Vector<ContentValues> values = new Vector <ContentValues> (matches.length()); for(int i = 0;i < matches.length();i++) { JSONObject match_data = matches.getJSONObject(i); League = match_data.getJSONObject(LINKS).getJSONObject(SOCCER_SEASON). getString("href"); League = League.replace(SEASON_LINK,""); //This if statement controls which leagues we're interested in the data from. //add leagues here in order to have them be added to the DB. // If you are finding no data in the app, check that this contains all the leagues. // If it doesn't, that can cause an empty DB, bypassing the dummy data routine. if( League.equals(PREMIER_LEAGUE) || League.equals(SERIE_A) || League.equals(BUNDESLIGA1) || League.equals(BUNDESLIGA2) || League.equals(PRIMERA_DIVISION) || League.equals(LIGUE1) || League.equals(LIGUE2) || League.equals(SEGUNDA_DIVISION) || League.equals(PRIMERA_LIGA) || League.equals(Bundesliga3) || League.equals(EREDIVISIE) ) { match_id = match_data.getJSONObject(LINKS).getJSONObject(SELF). getString("href"); match_id = match_id.replace(MATCH_LINK, ""); if(!isReal){ //This if statement changes the match ID of the dummy data so that it all goes into the database match_id=match_id+Integer.toString(i); } mDate = match_data.getString(MATCH_DATE); mTime = mDate.substring(mDate.indexOf("T") + 1, mDate.indexOf("Z")); mDate = mDate.substring(0,mDate.indexOf("T")); SimpleDateFormat match_date = new SimpleDateFormat("yyyy-MM-ddHH:mm:ss"); match_date.setTimeZone(TimeZone.getTimeZone("UTC")); try { Date parseddate = match_date.parse(mDate+mTime); SimpleDateFormat new_date = new SimpleDateFormat("yyyy-MM-dd:HH:mm"); new_date.setTimeZone(TimeZone.getDefault()); mDate = new_date.format(parseddate); mTime = mDate.substring(mDate.indexOf(":") + 1); mDate = mDate.substring(0,mDate.indexOf(":")); if(!isReal){ //This if statement changes the dummy data's date to match our current date range. Date fragmentdate = new Date(System.currentTimeMillis()+((i-2)*86400000)); SimpleDateFormat mformat = new SimpleDateFormat("yyyy-MM-dd"); mDate=mformat.format(fragmentdate); } } catch (Exception e) { Log.d(LOG_TAG, "error here!"); Log.e(LOG_TAG,e.getMessage()); } Home = match_data.getString(HOME_TEAM); Away = match_data.getString(AWAY_TEAM); Home_goals = match_data.getJSONObject(RESULT).getString(HOME_GOALS); Away_goals = match_data.getJSONObject(RESULT).getString(AWAY_GOALS); match_day = match_data.getString(MATCH_DAY); ContentValues match_values = new ContentValues(); match_values.put(DatabaseContract.scores_table.MATCH_ID,match_id); match_values.put(DatabaseContract.scores_table.DATE_COL,mDate); match_values.put(DatabaseContract.scores_table.TIME_COL,mTime); match_values.put(DatabaseContract.scores_table.HOME_COL,Home); match_values.put(DatabaseContract.scores_table.AWAY_COL,Away); match_values.put(DatabaseContract.scores_table.HOME_GOALS_COL,Home_goals); match_values.put(DatabaseContract.scores_table.AWAY_GOALS_COL,Away_goals); match_values.put(DatabaseContract.scores_table.LEAGUE_COL,League); match_values.put(DatabaseContract.scores_table.MATCH_DAY,match_day); //log spam //Log.v(LOG_TAG,match_id); //Log.v(LOG_TAG,mDate); //Log.v(LOG_TAG,mTime); //Log.v(LOG_TAG,Home); //Log.v(LOG_TAG,Away); //Log.v(LOG_TAG,Home_goals); //Log.v(LOG_TAG,Away_goals); values.add(match_values); } } int inserted_data = 0; ContentValues[] insert_data = new ContentValues[values.size()]; values.toArray(insert_data); inserted_data = mContext.getContentResolver().bulkInsert( DatabaseContract.BASE_CONTENT_URI,insert_data); //Log.v(LOG_TAG,"Succesfully Inserted : " + String.valueOf(inserted_data)); } catch (JSONException e) { Log.e(LOG_TAG,e.getMessage()); } } }
6cfbe340d8aa0390c77ad0a6309da9ee33dfa651
c61fb44af5a306f9c06bfa98d29ffd6c529c317d
/src/XMSEngine/src/main/java/com/huawei/generator/ast/CatchNode.java
901795df6df8bc2bfd023b3a45a235f7aa9f6936
[ "Apache-2.0" ]
permissive
cughmy/hms-toolkit-convertor
8014f3fffa2eaeb2d8a4c6c33940db126007455f
3bf3aca95302cc3f0d5d00479c293af9ff7df9ba
refs/heads/master
2022-11-01T03:10:07.262534
2020-06-17T13:41:46
2020-06-17T13:41:46
272,872,493
2
1
null
2020-06-17T03:50:22
2020-06-17T03:50:21
null
UTF-8
Java
false
false
1,636
java
/* * Copyright 2020. Huawei Technologies Co., Ltd. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.huawei.generator.ast; import java.util.List; /** * CatchNode class * * @since 2019-11-16 */ public final class CatchNode extends BraceNode { private String value; private BlockNode body; public BlockNode getBody() { return body; } private CatchNode() { } public String getValue() { return value; } @Override public void accept(AstVisitor visitor) { visitor.visit(this); } public static CatchNode create(String value, BlockNode body) { CatchNode catchNode = new CatchNode(); catchNode.value = value; catchNode.body = body; return catchNode; } public static CatchNode create(String value, List<StatementNode> body) { CatchNode catchNode = new CatchNode(); catchNode.value = value; catchNode.body = BlockNode.create(body); return catchNode; } }
d088da0bcab5ebedd8a9b523a7d2e3693c5a8240
dbe638b961de01f75e6144393e477912c0c1f898
/ProjetApi/src/TourOperator/Gestion/modele/ModeleDeplacementDB.java
32793a459ed349cd42a88bbe983b163cd0813589
[]
no_license
romeombende/ProjetApi
80f83d3cd54253cb2afc71d963b4780cab6ebc67
bb0a1676c003852dab909ac657299397178ea9c0
refs/heads/master
2022-12-01T00:38:59.237054
2020-08-15T07:07:27
2020-08-15T07:14:35
287,696,733
0
0
null
null
null
null
UTF-8
Java
false
false
11,817
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 TourOperator.Gestion.modele; import java.math.BigDecimal; import java.sql.Connection; import java.sql.Date; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.time.LocalDate; import java.util.ArrayList; import java.util.List; import myconnections.DBConnection; import TourOperator.Metier.Classement; import TourOperator.Metier.Deplacement; import TourOperator.Metier.Voyage; import TourOperator.Metier.Ville; import TourOperator.Metier.Pays; import TourOperator.Metier.db.ClassementDB; /** * * @author Romeo Mbende */ public class ModeleDeplacementDB implements DAODeplacement { protected Connection dbConnect; /** * méthode permettant d'injecter la connexion à la DB venue de l'application * principale */ public ModeleDeplacementDB() { dbConnect = DBConnection.getConnection(); } /** * création d'un deplacement sur base des valeurs de son objet métier * * @param obj commande à créer * @return créé */ @Override public Deplacement create(Deplacement obj) { String req1 = "insert into api_deplacement(dateHeureDebut, dateHeureFin, cout,idvilleDepart,idvilleArrivee) values(?,?,?,?,?)"; String req2 = "select * from api_deplacement where idvilleDepart=? and idvilleArrivee=?"; try ( PreparedStatement pstm1 = dbConnect.prepareStatement(req1); PreparedStatement pstm2 = dbConnect.prepareStatement(req2)) { pstm1.setDate(1, Date.valueOf(obj.getDateHeureDebut())); pstm1.setDate(2, Date.valueOf(obj.getDateHeureFin())); pstm1.setBigDecimal(3, obj.getCout()); pstm1.setInt(4, obj.getDeparts().getIdville()); pstm1.setInt(5, obj.getArrivees().getIdville()); int n = pstm1.executeUpdate(); if (n == 0) { return null; } pstm2.setInt(1, obj.getDeparts().getIdville()); pstm2.setInt(2, obj.getArrivees().getIdville()); ResultSet rs2 = pstm2.executeQuery(); if (rs2.next()) { int iddeplacement = rs2.getInt(1); obj.setIddeplacement(iddeplacement); return obj; } else { return null; } } catch (Exception e) { return null; } } /** * récupération des données d'un deplacement sur base de son identifiant * * @param dprech deplacement recherchée * @return deplacement trouvé */ @Override public Deplacement read(Deplacement dprech) { int iddeplacement = dprech.getIddeplacement(); String req = "select * from api_deplacement deplacement left join api_ville ville on ville.idville=deplacement.idvilledepart left join api_ville ville on ville.idville=deplacement.idvillearrivee left join api_pays pays on pays.idpays=ville.idpays left join api_classement classement on deplacement.iddeplacement=classement.iddeplacement left join api_voyage voyage on voyage.idvoyage=classement.idvoyage where deplacement.iddeplacement=?"; //String req = "select * from api_deplacement where iddeplacement=?"; try ( PreparedStatement pstm = dbConnect.prepareStatement(req)) { pstm.setInt(1, iddeplacement); ResultSet rs = pstm.executeQuery(); if (rs.next()) { LocalDate dateHeureDebut = rs.getDate("DATEHEUREDEBUT").toLocalDate(); LocalDate dateHeureFin = rs.getDate("DATEHEUREFIN").toLocalDate(); BigDecimal cout = rs.getBigDecimal("COUT"); int idvilledepart =rs.getInt("IDVILLEARRIVEE"); int idvillearrivee =rs.getInt("IDVILLEDEPART"); int idville = rs.getInt("IDVILLE"); String description = rs.getString("DESCRIPTION"); String nomv = rs.getString("NOM"); Double lattitude = rs.getDouble("LATTITUDE"); Double longitude = rs.getDouble("LONGITUDE"); int idpays = rs.getInt("IDPAYS"); String codeP = rs.getString("CODE"); String nomp = rs.getString("NOMP"); String langue = rs.getString("LANGUE"); String monnaie = rs.getString("MONNAIE"); Pays py = new Pays(idpays, codeP, nomp, langue, monnaie); Ville vl = new Ville(idville, nomv, description, lattitude, longitude,py); Ville departs=new Ville(idvilledepart,nomv, description, lattitude, longitude,py); Ville arrivees=new Ville(idvillearrivee,nomv, description, lattitude, longitude,py); Deplacement dp = new Deplacement(iddeplacement, dateHeureDebut, dateHeureFin, cout , departs, arrivees); List<Classement> lc = new ArrayList<>(); int idclassement = rs.getInt("IDCLASSEMENT"); if (idclassement != 0) { int idvoyage = rs.getInt("IDVOYAGE"); int position = rs.getInt("POSITION"); String code = rs.getString("CODE"); String nom = rs.getString("NOM"); LocalDate dateDebut = rs.getDate("DATEDEBUT").toLocalDate(); LocalDate dateFin = rs.getDate("DATEFIN").toLocalDate(); BigDecimal coutTotal = rs.getBigDecimal("COUTTOTAL"); Voyage vy = new Voyage(idvoyage, code, nom, dateDebut, dateFin, coutTotal); //Voyage vy = new VoyageDB(idvoyage,"","",null,null,new BigDecimal(0)); //TODO instancer un voyage sur base des infos de la jointure à 3 tables et l.setVoyage(voyage); Classement c = new ClassementDB(idclassement,position , dprech.getIddeplacement(),idvoyage ); lc.add(c); while (rs.next()) { idvoyage = rs.getInt("IDVOYAGE"); position = rs.getInt("POSITION"); code = rs.getString("CODE"); nom = rs.getString("NOM"); dateDebut = rs.getDate("DATEDEBUT").toLocalDate(); dateFin = rs.getDate("DATEFIN").toLocalDate(); coutTotal = rs.getBigDecimal("COUTTOTAL"); vy = new Voyage(idvoyage,code,nom,dateDebut, dateFin, coutTotal); c = new ClassementDB(idclassement,position , dprech.getIddeplacement(),idvoyage ); lc.add(c); } } dp.setClassements(lc); return dp; } else { return null; } } catch (Exception e) { return null; } } /** * mise à jour des données d'un classement sur base de son identifiant * * @return deplacement * @param obj deplacement à mettre à jour */ @Override public Deplacement update(Deplacement obj) { String req = "update api_deplacement set cout=? where iddeplacement = ?"; try ( PreparedStatement pstm = dbConnect.prepareStatement(req)) { pstm.setInt(2, obj.getIddeplacement()); //pstm.setDate(2, Date.valueOf(obj.getDateHeureDebut())); //pstm.setDate(3, Date.valueOf(obj.getDateHeureFin())); pstm.setBigDecimal(1, obj.getCout()); //pstm.setInt(4, obj.getDeparts().getIdville()); //pstm.setInt(5, obj.getArrivees().getIdville()); int n = pstm.executeUpdate(); if (n == 0) { return null; } return read(obj); } catch (Exception e) { return null; } } public boolean add(Deplacement dp,Classement cl){ String req= "insert into api_classement(position,iddeplacement,idvoyage) values(?,?,?)"; try ( PreparedStatement pstm = dbConnect.prepareStatement(req)) { Voyage vy = (Voyage)cl.getVoyage(); int idvoyage = vy.getIdvoyage(); pstm.setInt(2, dp.getIddeplacement()); pstm.setInt(3, idvoyage); pstm.setInt(1, cl.getPosition()); int n = pstm.executeUpdate(); if (n == 0) { return false; } else { return true; } } catch (Exception e) { return false; } } /** * effacement du classement sur base de son identifiant * * @param obj ville à effacer */ @Override public boolean delete(Deplacement obj) { String req = "delete from api_deplacement where iddeplacement= ?"; try ( PreparedStatement pstm = dbConnect.prepareStatement(req)) { pstm.setInt(1, obj.getIddeplacement()); int n = pstm.executeUpdate(); if (n == 0) { return false; } else { return true; } } catch (Exception e) { return false; } } @Override public List<Deplacement> readAll() { //String req ="select * from api_deplacement"; String req ="select * from api_deplacement deplacement left join api_ville ville on deplacement.idvilledepart=ville.idville left join api_ville ville on deplacement.idvillearrivee=ville.idville left join api_ville ville on deplacement.idvilledepart=ville.idville left join api_pays pays on ville.idpays=pays.idpays left join api_classement classement on classement.iddeplacement=deplacement.iddeplacement"; List<Deplacement> ldp = new ArrayList<>(); try ( PreparedStatement pstm = dbConnect.prepareStatement(req);ResultSet rs = pstm.executeQuery();) { while (rs.next()) { int iddeplacement = rs.getInt("IDDEPLACEMENT"); LocalDate dateHeureDebut = rs.getDate("DATEHEUREDEBUT").toLocalDate(); LocalDate dateHeureFin = rs.getDate("DATEHEUREFIN").toLocalDate(); BigDecimal cout = rs.getBigDecimal("COUT"); int idvillearrivee =rs.getInt("IDVILLEARRIVEE"); int idvilledepart =rs.getInt("IDVILLEDEPART"); int idville = rs.getInt("IDVILLE"); String nom = rs.getString("NOM"); String description = rs.getString("DESCRIPTION"); Double lattitude = rs.getDouble("LATTITUDE"); Double longitude = rs.getDouble("LONGITUDE"); //Pays pays = new Pays("","","",""); int idpays = rs.getInt("IDPAYS"); String nomp = rs.getString("NOMP"); String code = rs.getString("CODE"); String langue = rs.getString("LANGUE"); String monnaie = rs.getString("MONNAIE"); Pays pays = new Pays(idpays, code, nomp, langue, monnaie); Ville departs=new Ville(idvilledepart,nom,description,lattitude,longitude,pays); Ville arrivees=new Ville(idvillearrivee,nom,description,lattitude,longitude,pays); //Deplacement dp = new Deplacement(dateHeureDebut, dateHeureFin, cout, departs, arrivees); //ldp.add(dp); ldp.add(new Deplacement(iddeplacement,dateHeureDebut, dateHeureFin, cout, departs, arrivees)); } return ldp; } catch (Exception e) { return ldp; } } }
[ "" ]
bae5889a9c766178e1061b90ae8de855b02345e2
b0737f00db34c74e0d9c413bbef4809f582f8580
/src/main/java/services/ActorService.java
fba59cdb000b551202d9bf83423db74a17579467
[]
no_license
Sprouts-Framework/Acme-Barter
4524dcaea3fa5c7213ada54502606d8d8dd9aa62
a3c7652cae64892077323132ac4684602d611b9a
refs/heads/master
2021-01-20T04:53:50.274726
2016-06-24T09:13:54
2017-04-29T20:49:55
89,746,953
1
0
null
null
null
null
WINDOWS-1250
Java
false
false
2,259
java
package services; import java.util.Collection; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.Assert; import repositories.ActorRepository; import domain.Actor; import es.us.lsi.dp.domain.UserAccount; import es.us.lsi.dp.services.AbstractService; import es.us.lsi.dp.services.SignInService; import es.us.lsi.dp.services.contracts.ListService; @Service @Transactional public class ActorService extends AbstractService<Actor, ActorRepository> implements ListService<Actor> { // Managed repository -------------------- @Autowired private ActorRepository actorRepository; // Supporting services -------------------- // Constructors -------------------- public ActorService() { super(); } // Simple CRUD methods ------------------ // Encuentra un actor dado un id public Actor findOne(int actorId) { Actor result; result = actorRepository.findOne(actorId); Assert.notNull(result); return result; } // Encuentra todos los actores registrados en el sistema public Collection<Actor> findAll() { Collection<Actor> result; result = actorRepository.findAll(); Assert.notNull(result); return result; } // Other business methods --------------------- // Encuentra en actor asociado al nombre de usuario que recibe como // parámetro public Actor findActorByUserAccount(String userAccount) { Actor result; result = actorRepository.findActorByUserAccount(userAccount); Assert.notNull(result); return result; } // Devuelve un Actor que se encuentre logueado actualmente en el sistema. public Actor findActorByPrincipal() { Actor result; UserAccount userAccount; userAccount = SignInService.getPrincipal(); Assert.notNull(userAccount); result = actorRepository.findActorByPrincipal(userAccount.getId()); Assert.notNull(result); return result; } @Override public Page<Actor> findPage(Pageable page, String searchCriteria) { return repository.findAll(page); } }
1d3b1a043872515b7a4457ad353d07c6f8e011d1
9f936699f192745f9312780132b05399ba97b158
/src/com/video/tutorial/my/dao/OffersDAO.java
0abf1fa132c7533a6da2f82960fee30b5fe64a83
[]
no_license
jgsadang/TutorialRecommenderSystem
6c2c93abaae5151fd6e60a964e43064afeba268f
4b43a7c29416708b3aa27efe32cd3a959ea927b4
refs/heads/master
2021-01-10T09:04:09.398374
2015-10-07T19:02:24
2015-10-07T19:02:24
43,837,274
0
0
null
null
null
null
UTF-8
Java
false
false
1,955
java
package com.video.tutorial.my.dao; import java.sql.ResultSet; import java.sql.SQLException; import java.util.List; import javax.sql.DataSource; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.RowMapper; import org.springframework.jdbc.core.namedparam.BeanPropertySqlParameterSource; import org.springframework.jdbc.core.namedparam.MapSqlParameterSource; import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; import org.springframework.stereotype.Component; @Component("offersDAO") public class OffersDAO { private NamedParameterJdbcTemplate jdbc; @Autowired public void setDataSource(DataSource jdbc) { this.jdbc = new NamedParameterJdbcTemplate(jdbc); } public List<Offer> getOffers() { return jdbc.query("select * from offers", new RowMapper<Offer>() { public Offer mapRow(ResultSet rs, int rowNum) throws SQLException { Offer offer = new Offer(); offer.setId(rs.getInt("id")); offer.setName(rs.getString("name")); offer.setText(rs.getString("text")); offer.setEmail(rs.getString("email")); return offer; } }); } public boolean createOffer(Offer offer) { BeanPropertySqlParameterSource params = new BeanPropertySqlParameterSource(offer); return jdbc.update("insert into offers (name, email, text) values (:name, :email, :text)", params) == 1; } public Offer getOffer(int id) { MapSqlParameterSource params = new MapSqlParameterSource(); params.addValue("id", id); return jdbc.queryForObject("select * from offers where id=:id", params, new RowMapper<Offer>() { public Offer mapRow(ResultSet rs, int rowNum) throws SQLException { Offer offer = new Offer(); offer.setId(rs.getInt("id")); offer.setName(rs.getString("name")); offer.setText(rs.getString("text")); offer.setEmail(rs.getString("email")); return offer; } }); } }
82d199ba39cd2a03a7d9fe40103a8ee7e33b2c35
0ff96de71930955254ff4f0e0a1e2917597bc691
/src/by/dimalix92/book2/task9_2/JAXB.java
8a7409e32cdf18ffa5c99bcbb913c95f8bfbdb51
[]
no_license
Staller92/PVT-Java-JD1-2017
c09b2cf0ffa70172f0f6b8256174b4794f31e20f
bdfde2e1fcfcdea9d3b8b1f246456f15f004b9fe
refs/heads/master
2021-06-27T06:01:26.498125
2017-09-17T16:50:45
2017-09-17T16:50:45
103,699,887
0
0
null
null
null
null
UTF-8
Java
false
false
2,358
java
package by.dimalix92.book2.task9_2; import by.dimalix92.book2.task9_1.generated.Points; import by.dimalix92.book2.task9_1.generated.PointsList; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Marshaller; import javax.xml.bind.Unmarshaller; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; /** * Created by LIKHTAROVICH on 05.09.2017. * Java to XML, XML to Java (Marshalling and Unmarshalling) */ public class JAXB { public static void main(String[] args) { // Save objects to XML marshal("D:\\My tasks\\Java\\PVT\\src\\by\\dimalix92\\book2\\task9_2\\points.xml"); unmarshal("D:\\My tasks\\Java\\PVT\\src\\by\\dimalix92\\book2\\task9_2\\points.xml"); } public static void marshal(String fileName) { Points point1 = new Points(); point1.setX(10); point1.setY(2); Points point2 = new Points(); point2.setX(10); point2.setY(200); PointsList pointsList = new PointsList(); pointsList.point.add(point1); pointsList.point.add(point2); try { JAXBContext jaxbContext = JAXBContext.newInstance(PointsList.class); Marshaller marshaller = jaxbContext.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); FileOutputStream fos = new FileOutputStream(fileName); marshaller.marshal(pointsList, fos); } catch (JAXBException e) { e.printStackTrace(); } catch (FileNotFoundException e) { e.printStackTrace(); } } public static void unmarshal(String fileName) { try { JAXBContext jaxbContext = JAXBContext.newInstance(PointsList.class); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); PointsList pointsList = (PointsList) unmarshaller.unmarshal(new FileInputStream(fileName)); System.out.println(pointsList.getPoint().get(0).getX()); System.out.println(pointsList.getPoint().get(0).getY()); System.out.println(pointsList.getPoint().get(1).getX()); System.out.println(pointsList.getPoint().get(1).getY()); } catch (Exception e) { e.printStackTrace(); } } }
84d607d7f955513df4ffb34d3ea9cc74d9fe9ae3
587a6c7239df806be26f2d94096cf9e4b3d435b0
/src/main/java/com/resolution/config/DispatcherServlet.java
1a165aa9f547b4682eb5e236d3ec6d02b08f584a
[]
no_license
maxim-grinchenko/resolution_spring
2ea44bfdd8df79b2853e2371d07409afd1654b8a
4690079a988d71d6ad4db1c1277c6904aab6f906
refs/heads/master
2022-12-23T08:02:16.193388
2019-07-17T06:24:47
2019-07-17T06:24:47
135,448,673
0
0
null
2022-12-15T23:26:36
2018-05-30T13:42:41
Java
UTF-8
Java
false
false
554
java
package com.resolution.config; import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; public class DispatcherServlet extends AbstractAnnotationConfigDispatcherServletInitializer { @Override protected Class<?>[] getRootConfigClasses() { return new Class<?>[]{AppConfig.class}; } @Override protected Class<?>[] getServletConfigClasses() { return new Class<?>[0]; } @Override protected String[] getServletMappings() { return new String[]{"/"}; } }
3ff8be7f256273fa807ae42271d173cb5b5eb26a
66c5c1d6df3cfd393a484ab041f56fe221723c7e
/src/main/java/com/lin/domain/User.java
a92f7a55a4c9fe3e39ff639f04cc16565f50de5d
[]
no_license
taz372436/ssm_shiro
914625ff8b7bcc0ef10db271c26a0053acc36371
b5857e9b2d0d6021a12853e5adf6c5a1ffce20fe
refs/heads/master
2021-01-22T22:57:33.198852
2017-09-05T02:13:13
2017-09-05T02:13:13
102,422,362
0
0
null
null
null
null
UTF-8
Java
false
false
1,070
java
package com.lin.domain; import java.util.Date; public class User { private Integer id; private String name; private Integer age; private Date birthday; private String password; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name == null ? null : name.trim(); } public Integer getAge() { return age; } public void setAge(Integer age) { this.age = age; } public Date getBirthday() { return birthday; } public void setBirthday(Date birthday) { this.birthday = birthday; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password == null ? null : password.trim(); } public String toString() { return this.name + ", " + this.age + ", " + this.birthday + ", " + this.password; } }
58bf68101ae5635af4e6b8fa079de223c60ad8bf
089c99b71bc161e5809921e12ec450d041a4a9e6
/archive/OdometricLocalizer.java
b944b2de151c419c4c229b715b5279810542e051
[]
no_license
HarshalShende/Robot
1f7691c12d5a60ac2f4e030b3fd04ba84b62bf58
1e29a9a9584726abb21b2a63f13a40b272946baa
refs/heads/master
2020-06-16T12:00:23.971332
2018-04-29T16:14:11
2018-04-29T16:14:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,922
java
import com.ridgesoft.robotics.Localizer; import com.ridgesoft.robotics.Pose; import com.ridgesoft.robotics.ShaftEncoder; public class OdometricLocalizer extends Thread implements Localizer { private static final float PI = 3.14159f; private static final float TWO_PI = PI * 2.0f; private ShaftEncoder leftEncoder; private ShaftEncoder rightEncoder; private int previousLeftCounts; private int previousRightCounts; private float distancePerCount; private float radiansPerCount; private float x = 0.0f; private float y = 0.0f; private float heading = 0.0f; private int period; public OdometricLocalizer( ShaftEncoder leftEncoder, ShaftEncoder rightEncoder, float wheelDiameter, float trackWidth, int countsPerRevolution, int threadPriority, int period){ this.leftEncoder = leftEncoder; this.rightEncoder = rightEncoder; distancePerCount = (PI * wheelDiameter) / (float)countsPerRevolution; radiansPerCount = PI * (wheelDiameter / trackWidth) / countsPerRevolution; this.period = period; previousLeftCounts = leftEncoder.getCounts(); previousRightCounts = rightEncoder.getCounts(); setDaemon(true); setPriority(threadPriority); start(); } public synchronized Pose getPose() { return new Pose(x, y, heading); } public void run() { try { long nextTime = System.currentTimeMillis(); while (true) { int leftCounts = leftEncoder.getCounts(); int rightCounts = rightEncoder.getCounts(); int deltaLeft = leftCounts - previousLeftCounts; int deltaRight = rightCounts - previousRightCounts; float deltaDistance = 0.5f * (float)(deltaLeft + deltaRight) * distancePerCount; float deltaX = deltaDistance * (float)Math.cos(heading); float deltaY = deltaDistance * (float)Math.sin(heading); float deltaTheta = (float)(deltaRight - deltaLeft) * radiansPerCount; synchronized (this) { x += deltaX; y += deltaY; heading += deltaTheta; // limit theta to -Pi <= theta < Pi if (heading > PI) heading -= TWO_PI; else if (heading <= -PI) heading += TWO_PI; } previousLeftCounts = leftCounts; previousRightCounts = rightCounts; nextTime += period; Thread.sleep(nextTime - System.currentTimeMillis()); } } catch (Throwable t) { t.printStackTrace(); } } @Override public void setHeading(float arg0) { // TODO Auto-generated method stub } @Override public void setPose(Pose arg0) { // TODO Auto-generated method stub } @Override public void setPose(float arg0, float arg1, float arg2) { // TODO Auto-generated method stub } @Override public void setPosition(float arg0, float arg1) { // TODO Auto-generated method stub } }
8465b07250eb39ad701536d094b94b10607cd76b
bf2739bdee52405cad9066a36009269a31dda9eb
/app/src/main/java/com/langham/chris/starships/adapter/PilotListAdapter.java
a1130fcf76feb00edb31264b806285032bc6f998
[]
no_license
christopherLangham/viopmjsvoidjfvoi
d993a4e173814d1fd9d57261ecd092dcab755ce2
07523965bc29521f364bf417bc9b218a284695ba
refs/heads/master
2020-04-03T04:10:28.354456
2018-10-01T05:06:20
2018-10-01T05:06:20
155,005,608
0
0
null
null
null
null
UTF-8
Java
false
false
1,649
java
package com.langham.chris.starships.adapter; import android.databinding.DataBindingUtil; import android.support.annotation.NonNull; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.ViewGroup; import com.langham.chris.starships.R; import com.langham.chris.starships.databinding.LineItemPilotBinding; import com.langham.chris.starships.model.Person; import java.util.List; public class PilotListAdapter extends RecyclerView.Adapter<PilotViewHolder> { private List<Person> pilotList; private final PilotInfoListener pilotInfoListener; public PilotListAdapter(final PilotInfoListener listener, final List<Person> pilotList) { this.pilotInfoListener = listener; this.pilotList = pilotList; } @NonNull @Override public PilotViewHolder onCreateViewHolder(@NonNull final ViewGroup parent, final int viewType) { LayoutInflater inflater = LayoutInflater.from(parent.getContext()); LineItemPilotBinding binding = DataBindingUtil.inflate(inflater, R.layout.line_item_pilot, parent, false); return new PilotViewHolder(binding); } @Override public void onBindViewHolder(@NonNull final PilotViewHolder holder, final int position) { holder.setViewModel(pilotList.get(position)); holder.itemView.setOnClickListener(v -> pilotInfoListener.onShowPerson(pilotList.get(position))); } @Override public int getItemCount() { return pilotList.size(); } public void setPilotList(final List<Person> pilotList) { this.pilotList = pilotList; notifyDataSetChanged(); } }
206c93167fdf5cd4f7935ac0df522fb04d66ebcf
741c341760ef7e08b17f1d01f0f2a919216846d5
/core/src/main/java/academy/devdojo/youtube/core/model/Course.java
2732178659e69f55830083c467ab08baf4637b33
[]
no_license
tuliopcunha/microservices-java
962ed00aa1fa171b6f94b49b9f0521921cc57f2c
4890f1823e3ff8bc6af7f44e5b4b7a98b0b41aab
refs/heads/master
2023-01-10T05:52:31.896123
2020-11-01T13:33:20
2020-11-01T13:33:20
304,946,998
0
0
null
null
null
null
UTF-8
Java
false
false
874
java
package academy.devdojo.youtube.core.model; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import lombok.ToString; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.validation.constraints.NotNull; @Entity @Getter @Setter @Builder @AllArgsConstructor @NoArgsConstructor @ToString @EqualsAndHashCode(onlyExplicitlyIncluded = true) public class Course implements AbstractEntity{ @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @EqualsAndHashCode.Include private Long id; @NotNull(message = "The field 'title' is mandatory") @Column(nullable = false) private String title; }
01400c68e73aedbb2d00ea0caa6a6a023ca03ad8
f876839d72c4469b9bf3768ea45b96be1735a8e3
/GoogleTest/main/test/com/package_Selenium_Basic_Test_Servlet/Selenium_Basic_Test.java
f34bc7023e9b1baffdd7dfe55bc82d747e603a07
[]
no_license
jkavita77/PerScholasQE
16723a20627a4b48a8013c74dee45acb20c21d09
948bada4211eedf6911b89815d62ebbc1718bf3c
refs/heads/master
2020-09-12T19:43:21.180771
2019-11-18T19:53:23
2019-11-18T19:53:23
222,530,159
0
0
null
null
null
null
UTF-8
Java
false
false
88
java
package com.package_Selenium_Basic_Test_Servlet; public class Selenium_Basic_Test { }
7abf0db6f55fdab31c92cc30218c873b3bc05646
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/34/34_8b737ef33fd5214c9b5f5839f53aee19668371d9/MusicIndexService/34_8b737ef33fd5214c9b5f5839f53aee19668371d9_MusicIndexService_t.java
d753d10569ca31f102a34070c264ea9afeb958ca
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
7,724
java
package net.sourceforge.subsonic.service; import net.sourceforge.subsonic.domain.MusicFile; import net.sourceforge.subsonic.domain.MusicFolder; import net.sourceforge.subsonic.domain.MusicIndex; import net.sourceforge.subsonic.domain.MusicIndex.Artist; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.SortedMap; import java.util.SortedSet; import java.util.StringTokenizer; import java.util.TreeMap; import java.util.TreeSet; /** * Provides services for grouping artists by index. * * @author Sindre Mehus */ public class MusicIndexService { private SettingsService settingsService; private MusicFileService musicFileService; /** * Returns a map from music indexes to sets of artists that are direct children of the given music folders. * * @param folders The music folders. * @return A map from music indexes to sets of artists that are direct children of this music file. * @throws IOException If an I/O error occurs. */ public SortedMap<MusicIndex, SortedSet<Artist>> getIndexedArtists(MusicFolder[] folders) throws IOException { String[] ignoredArticles = settingsService.getIgnoredArticlesAsArray(); String[] shortcuts = settingsService.getShortcutsAsArray(); final List<MusicIndex> indexes = createIndexesFromExpression(settingsService.getIndexString()); Comparator<MusicIndex> indexComparator = new Comparator<MusicIndex>() { public int compare(MusicIndex a, MusicIndex b) { int indexA = indexes.indexOf(a); int indexB = indexes.indexOf(b); if (indexA == -1) { indexA = Integer.MAX_VALUE; } if (indexB == -1) { indexB = Integer.MAX_VALUE; } if (indexA < indexB) { return -1; } if (indexA > indexB) { return 1; } return 0; } }; SortedSet<Artist> artists = createArtists(folders, ignoredArticles, shortcuts); SortedMap<MusicIndex, SortedSet<Artist>> result = new TreeMap<MusicIndex, SortedSet<Artist>>(indexComparator); for (Artist artist : artists) { MusicIndex index = getIndex(artist, indexes); SortedSet<Artist> artistSet = result.get(index); if (artistSet == null) { artistSet = new TreeSet<Artist>(); result.put(index, artistSet); } artistSet.add(artist); } return result; } /** * Creates a new instance by parsing the given expression. The expression consists of an index name, followed by * an optional list of one-character prefixes. For example:<p/> * <p/> * The expression <em>"A"</em> will create the index <em>"A" -&gt; ["A"]</em><br/> * The expression <em>"The"</em> will create the index <em>"The" -&gt; ["The"]</em><br/> * The expression <em>"A(A&Aring;&AElig;)"</em> will create the index <em>"A" -&gt; ["A", "&Aring;", "&AElig;"]</em><br/> * The expression <em>"X-Z(XYZ)"</em> will create the index <em>"X-Z" -&gt; ["X", "Y", "Z"]</em> * * @param expr The expression to parse. * @return A new instance. */ protected MusicIndex createIndexFromExpression(String expr) { int separatorIndex = expr.indexOf('('); if (separatorIndex == -1) { MusicIndex index = new MusicIndex(expr); index.addPrefix(expr); return index; } MusicIndex index = new MusicIndex(expr.substring(0, separatorIndex)); String prefixString = expr.substring(separatorIndex + 1, expr.length() - 1); for (int i = 0; i < prefixString.length(); i++) { index.addPrefix(prefixString.substring(i, i + 1)); } return index; } /** * Creates a list of music indexes by parsing the given expression. The expression is a space-separated list of * sub-expressions, for which the rules described in {@link #createIndexFromExpression} apply. * * @param expr The expression to parse. * @return A list of music indexes. */ protected List<MusicIndex> createIndexesFromExpression(String expr) { List<MusicIndex> result = new ArrayList<MusicIndex>(); StringTokenizer tokenizer = new StringTokenizer(expr, " "); while (tokenizer.hasMoreTokens()) { MusicIndex index = createIndexFromExpression(tokenizer.nextToken()); result.add(index); } return result; } private SortedSet<Artist> createArtists(MusicFolder[] folders, String[] ignoredArticles, String[] shortcuts) throws IOException { SortedMap<String, Artist> artistMap = new TreeMap<String, Artist>(); Set<String> shortcutSet = new HashSet<String>(Arrays.asList(shortcuts)); for (MusicFolder folder : folders) { MusicFile parent = musicFileService.getMusicFile(folder.getPath()); List<MusicFile> children = musicFileService.getChildDirectories(parent); for (MusicFile child : children) { if (shortcutSet.contains(child.getName()) || !child.isDirectory()) { continue; } String sortableName = createSortableName(child.getName(), ignoredArticles); Artist artist = artistMap.get(sortableName); if (artist == null) { artist = new Artist(child.getName(), sortableName); artistMap.put(sortableName, artist); } artist.addMusicFile(child); } } return new TreeSet<Artist>(artistMap.values()); } private String createSortableName(String name, String[] ignoredArticles) { String uppercaseName = name.toUpperCase(); for (String article : ignoredArticles) { if (uppercaseName.startsWith(article.toUpperCase() + " ")) { return name.substring(article.length() + 1) + ", " + article; } } return name; } /** * Returns the music index to which the given artist belongs. * * @param artist The artist in question. * @param indexes List of available indexes. * @return The music index to which this music file belongs, or {@link MusicIndex#OTHER} if no index applies. */ private MusicIndex getIndex(Artist artist, List<MusicIndex> indexes) { String sortableName = artist.getSortableName().toUpperCase(); for (MusicIndex index : indexes) { for (String prefix : index.getPrefixes()) { if (sortableName.startsWith(prefix.toUpperCase())) { return index; } } } return MusicIndex.OTHER; } public void setSettingsService(SettingsService settingsService) { this.settingsService = settingsService; } public void setMusicFileService(MusicFileService musicFileService) { this.musicFileService = musicFileService; } }
7ab980abd8a70703e4767bfbc2ba492082866b13
ed94e068ff37013ebba51f3beb69b2809bd1a295
/easyerp.service/src/main/java/org/easyerp/service/impl/UserServiceImpl.java
6014be0c719f9bc0fa9ff2800a21107072dbb7a0
[]
no_license
hylrf0/easyerp
0a8f1e88f8fd61507553cce8af45d43f8ee4910b
ccf7928194841eaae6e47a2c58691ae4e0fdb0a9
refs/heads/master
2021-01-17T20:14:48.728365
2017-03-20T07:35:07
2017-03-20T07:35:07
84,141,571
0
0
null
null
null
null
UTF-8
Java
false
false
1,098
java
package org.easyerp.service.impl; import org.easyerp.dao.entity.UserInfo; import org.easyerp.dao.mapper.UserInfoMapper; import org.easyerp.service.UserService; import org.easyerp.service.bo.UserInfoBO; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; /** * Created by Administrator on 2017/3/15 0015. * 用户信息服务层 */ @Service public class UserServiceImpl implements UserService { @Autowired private UserInfoMapper userInfoMapper; @Override public UserInfoBO getUserInfoByUsernameAndPassword(String username, String password) { UserInfo userInfo = userInfoMapper.getUserInfoByUsernameAndPassword(username, password); if (null == userInfo) { return null; } return fillUserInfoBOByUserInfo(userInfo); } private UserInfoBO fillUserInfoBOByUserInfo(UserInfo userInfo) { UserInfoBO userInfoBO = new UserInfoBO(); BeanUtils.copyProperties(userInfo, userInfoBO); return userInfoBO; } }
55c7879ad6dcf7bbd5742ceabfbd854fd7201f9b
fb16b8dde007cc08ab34412cfab3a026a1f14b8d
/src/test/java/com/kondratev/LogStatisticsCollectorTest.java
ff19e06d696bf563469b88a692ea0c9ad85b80bb
[]
no_license
AlexJud/smartbics_HW
7e7c0c31db98505370a792083c320dfa2d8a0ba7
be579da7c709a48b7eb087f199ded621c462801f
refs/heads/master
2023-01-09T09:46:39.825015
2020-11-07T18:53:25
2020-11-07T18:53:25
310,909,216
0
0
null
null
null
null
UTF-8
Java
false
false
2,605
java
package com.kondratev; import com.kondratev.classifier.LogClassifiers; import com.kondratev.logparser.SplittingLogParser; import com.kondratev.model.LogEntry; import com.kondratev.model.LogLevel; import com.kondratev.reader.InputStreamReader; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import java.io.ByteArrayInputStream; import java.io.InputStream; import java.time.LocalDateTime; import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; public class LogStatisticsCollectorTest { private List<LogEntry> LOGS = Arrays.asList(LogEntry.builder().date(LocalDateTime.now()).level(LogLevel.INFO).message("Info").build(), LogEntry.builder().date(LocalDateTime.now()).level(LogLevel.ERROR).message("Error").build(), LogEntry.builder().date(LocalDateTime.now()).level(LogLevel.WARN).message("Warning").build()); @DataProvider(parallel = true) public Object[][] logLevels() { return new Object[][]{ { createInputStreamFromLogList(LOGS), Stream.of(LogLevel.INFO).collect(Collectors.toCollection(HashSet::new)), 1 }, { createInputStreamFromLogList(LOGS), Stream.of(LogLevel.ERROR).collect(Collectors.toCollection(HashSet::new)), 1 }, { createInputStreamFromLogList(LOGS), Stream.of(LogLevel.WARN).collect(Collectors.toCollection(HashSet::new)), 1 }, { createInputStreamFromLogList(LOGS), Stream.of(LogLevel.INFO, LogLevel.ERROR, LogLevel.WARN).collect(Collectors.toCollection(HashSet::new)), 3 } }; } @Test(dataProvider = "logLevels") public void testCollectByLogLevel(InputStream inputStream, Set<LogLevel> levels, int expectedSize) throws Exception { LogStatisticsCollector collector = new LogStatisticsCollector(new SplittingLogParser(), new InputStreamReader()); Map<LogLevel, Long> collectedLogs = collector.collect(inputStream, LogClassifiers.BY_LEVEL, logEntry -> levels.contains(logEntry.getLevel())); assertThat(collectedLogs.size(), equalTo(expectedSize)); } private InputStream createInputStreamFromLogList(List<LogEntry> logs) { return new ByteArrayInputStream(logs.stream() .map(LogEntry::toString) .collect(Collectors.joining("\n")) .getBytes()); } }
06f3481dd993bd7f1333978afca9ab25d0545653
310df228e824cc30b3d6536706d2ae571947e746
/custom-spring-boot-starter/src/main/java/com/mycompany/myframework/service/security/servlet/HeaderUserDetailsService.java
3bd05b749abdd4577eb176ea465802db27f925c1
[]
no_license
mfeyabat/spring-boot-custom-starter-demo
91bcf47c66bf5751b768d119d9913ae76b533498
175eaad8b4642fee52a0185ef9407d97974a4c22
refs/heads/master
2022-04-13T23:03:49.228697
2019-10-04T19:35:14
2019-10-04T19:35:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,174
java
package com.mycompany.myframework.service.security.servlet; import java.util.Optional; import org.apache.commons.lang3.StringUtils; import org.springframework.lang.Nullable; import org.springframework.security.core.userdetails.User; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; public class HeaderUserDetailsService implements UserDetailsService { @Override public UserDetails loadUserByUsername(@Nullable String username) throws UsernameNotFoundException { return Optional.ofNullable(username) .map(StringUtils::trimToNull) .filter(user -> StringUtils.equals(user, "user1")) .map(this::createUserDetails) .orElseThrow(() -> new UsernameNotFoundException(String.format("User %s is not a valid user", username))); } private UserDetails createUserDetails(String username) { return User.withUsername(username) .accountExpired(false) .accountLocked(false) .credentialsExpired(false) .disabled(false) .password("n/a") .authorities("ROLE_USER") .build(); } }
0b531539715ef0f9fd52d5eff913d8e5943bd58b
c23d9be4a5d864d4f4443a1edb4eefdd2ea4a955
/app/src/main/java/com/nuoxian/kokojia/fragment/TeacherAnswerAll.java
15a4621a7fa28cec6315d1ed2a41084c480c1b81
[]
no_license
Superingxz/KoKoJia
b85ec91e81bf516ff859528c1eeb62e310b06abe
84010dd816933dd4042b81f5b46b33c35ae6a766
refs/heads/master
2021-01-21T09:52:51.580953
2017-05-18T08:41:48
2017-05-18T08:41:48
85,960,266
0
0
null
null
null
null
UTF-8
Java
false
false
2,772
java
package com.nuoxian.kokojia.fragment; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.AdapterView; import com.google.gson.Gson; import com.jingchen.pulltorefresh.PullToRefreshLayout; import com.nuoxian.kokojia.activity.TeacherAnswerDetailsActivity; import com.nuoxian.kokojia.adapter.TeacherAnswerAdapter; import com.nuoxian.kokojia.enterty.BuyResult; import com.nuoxian.kokojia.enterty.TeacherAnswer; import com.nuoxian.kokojia.http.Urls; import com.nuoxian.kokojia.utils.CommonMethod; import com.nuoxian.kokojia.utils.CommonValues; import com.ypy.eventbus.EventBus; import org.json.JSONException; import org.json.JSONObject; import java.util.ArrayList; import java.util.List; /** * Created by Administrator on 2016/9/19. */ public class TeacherAnswerAll extends BaseTeacherAnswerFragment { private List<TeacherAnswer.DataBean> mList; private TeacherAnswerAdapter adapter; private int page = 1; private static String status = "0"; @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); CommonMethod.showLoadingDialog("正在加载...", getContext()); init(); getData(Urls.TEACHER_ANSWER, CommonValues.NOT_TO_DO, mList, adapter, status, page); } private void init() { //设置适配器 mList = new ArrayList<>(); adapter = new TeacherAnswerAdapter(mList, getContext()); setAdapter(adapter); //上下拉刷新 setOnRefreshListener(new PullToRefreshLayout.OnRefreshListener() { @Override public void onRefresh(PullToRefreshLayout pullToRefreshLayout) { //刷新 page = 1; mList.clear(); getData(Urls.TEACHER_ANSWER, CommonValues.TO_REFRESH, mList, adapter, status, page); adapter.notifyDataSetChanged(); } @Override public void onLoadMore(PullToRefreshLayout pullToRefreshLayout) { //加载 page++; getData(Urls.TEACHER_ANSWER, CommonValues.TO_LOAD, mList, adapter, status, page); adapter.notifyDataSetChanged(); } }); setItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { //跳转到答疑详情页 Intent intent = new Intent(getContext(), TeacherAnswerDetailsActivity.class); intent.putExtra("id", mList.get(position).getId()); startActivity(intent); } }); } }
89c303c68c59a945360240e1dfd9f07a387819fa
02abd68504bb65757666b7b5a6575aca47b25b0e
/Code/PrototipoDeCarnetDigital/src/prototipodecarnetdigital/controller/EstudianteController.java
117dff4b83f75c060e41a65321397078e45d0a13
[]
no_license
edisonjt/G5_3594_MET_DES_SW_202150
40d69332f018aff0ed678e9a0fd4ecc1068ca2d2
4ae679d7348e1ec2cde2a41bf1828f6d9e9fef01
refs/heads/main
2023-07-21T20:24:00.695782
2021-09-07T07:02:29
2021-09-07T07:02:29
403,866,242
0
0
null
2021-09-07T06:27:15
2021-09-07T06:27:14
null
UTF-8
Java
false
false
785
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 prototipodecarnetdigital.controller; import com.mongodb.BasicDBObject; import com.mongodb.DBObject; /** * * @author BryanPC */ public class EstudianteController { BasicDBObject document = new BasicDBObject(); public DBObject request(String name, String id, String correo, String career, String address, String age) { document.put("Name", name); document.put("ID", id); document.put("Correo", correo); document.put("Career", career); document.put("Address", address); document.put("Age", age); return document; } }
9728250ac47ac0fc7b0fb85fa4c231d9838826cc
de12f4f9766a2394c3d6bfe20b2ea1333c7dd49e
/mutlti_client_socket/src/main/java/com/example/network/HttpImageActivity.java
d63d48779c42ed3de7b670fa535744a273ed2216
[]
no_license
yyj8209/multi_client
f347750891b8daee3bc7631b989d780024d39975
810c2097f92ede48b6468f76818901e58250d10f
refs/heads/master
2022-06-19T03:40:18.404861
2020-05-06T02:48:43
2020-05-06T02:48:43
261,632,786
0
0
null
null
null
null
UTF-8
Java
false
false
1,319
java
package com.example.network; import com.example.network.task.GetImageCodeTask; import com.example.network.task.GetImageCodeTask.OnImageCodeListener; import android.net.Uri; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.view.View.OnClickListener; import android.widget.ImageView; /** * Created by ouyangshen on 2016/11/11. */ public class HttpImageActivity extends AppCompatActivity implements OnClickListener, OnImageCodeListener { private ImageView iv_image_code; private boolean bRunning = false; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_http_image); iv_image_code = (ImageView) findViewById(R.id.iv_image_code); iv_image_code.setOnClickListener(this); getImageCode(); } private void getImageCode() { if (bRunning != true) { bRunning = true; GetImageCodeTask codeTask = new GetImageCodeTask(this); codeTask.setOnImageCodeListener(this); codeTask.execute(); } } @Override public void onClick(View v) { if (v.getId() == R.id.iv_image_code) { getImageCode(); } } @Override public void onGetCode(String path) { Uri uri = Uri.parse(path); iv_image_code.setImageURI(uri); bRunning = false; } }
12e0536d93e8e99393d618555d5fb754642108e6
4940d7c91d73d9e5ba7e415c02e928eefd92fb5f
/src/net/fycraft/plugins/vip/api/pagseguro/service/SessionService.java
7f0cad39bbf8623533467b7de87a7f22b7fe7b4f
[]
no_license
ohgosch/FyCraft_survival
91146ca8819dea673d64e79c3ae2c111a62d5c40
1503df6fd5a036f91df0c910d72593ed223c0e97
refs/heads/master
2021-06-11T04:41:23.524385
2017-01-02T02:08:00
2017-01-02T02:08:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,828
java
/* ************************************************************************ Copyright [2011] [PagSeguro Internet Ltda.] 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 net.fycraft.plugins.vip.api.pagseguro.service; import java.net.HttpURLConnection; import java.util.List; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.xml.sax.InputSource; import net.fycraft.plugins.vip.api.pagseguro.domain.Credentials; import net.fycraft.plugins.vip.api.pagseguro.domain.Error; import net.fycraft.plugins.vip.api.pagseguro.enums.HttpStatus; import net.fycraft.plugins.vip.api.pagseguro.exception.PagSeguroServiceException; import net.fycraft.plugins.vip.api.pagseguro.logs.Log; import net.fycraft.plugins.vip.api.pagseguro.utils.HttpConnection; import net.fycraft.plugins.vip.api.pagseguro.xmlparser.ErrorsParser; import net.fycraft.plugins.vip.api.pagseguro.xmlparser.XMLParserUtils; /** * Class Session Service */ public class SessionService { /** * @var Log */ private static Log log = new Log(SessionService.class); private static String buildSessionsRequestUrl(ConnectionData connectionData) // throws PagSeguroServiceException { return connectionData.getSessionsUrl(); } public static String createSession(Credentials credentials) // throws PagSeguroServiceException { log.info("SessionService.createSession() - begin"); ConnectionData connectionData = new ConnectionData(credentials); String url = SessionService.buildSessionsRequestUrl(connectionData); HttpConnection connection = new HttpConnection(); HttpStatus httpCodeStatus = null; HttpURLConnection response = connection.post(url, // credentials.getAttributes(), // connectionData.getServiceTimeout(), // connectionData.getCharset(), null); try { httpCodeStatus = HttpStatus.fromCode(response.getResponseCode()); if (httpCodeStatus == null) { throw new PagSeguroServiceException("Connection Timeout"); } else if (HttpURLConnection.HTTP_OK == httpCodeStatus.getCode().intValue()) { DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); InputSource inputSource = new InputSource(response.getInputStream()); Document document = documentBuilder.parse(inputSource); Element element = document.getDocumentElement(); // setting <session><id> String sessionId = XMLParserUtils.getTagValue("id", element); log.info("SessionService.createSession() - end"); return sessionId; } else if (HttpURLConnection.HTTP_BAD_REQUEST == httpCodeStatus.getCode().intValue()) { List<Error> errors = ErrorsParser.readErrosXml(response.getErrorStream()); PagSeguroServiceException exception = new PagSeguroServiceException(httpCodeStatus, errors); log.error(String.format("SessionService.createSession() - error %s", // exception.getMessage())); throw exception; } else if (HttpURLConnection.HTTP_UNAUTHORIZED == httpCodeStatus.getCode().intValue()) { PagSeguroServiceException exception = new PagSeguroServiceException(httpCodeStatus); log.error(String.format("SessionService.createSession() - error %s", // exception.getMessage())); throw exception; } else { throw new PagSeguroServiceException(httpCodeStatus); } } catch (PagSeguroServiceException e) { throw e; } catch (Exception e) { log.error(String.format("SessionService.createSession() - error %s", // e.getMessage())); throw new PagSeguroServiceException(httpCodeStatus, e); } finally { response.disconnect(); } } }
bc189a6c34558688730f4465a16c1331b85d6dcc
e16189135e4a6725f32b7ccf2bd1766c122b84ec
/Java22.02/TabliczkaMnozenia.java
36fd2c81ef6b13e22035e38f2a67fa80e6c7f975
[]
no_license
kowal16/Java
4c1a7541edb88c96fdeb0cc38136a4897bab2490
947a4417a2e00b64af2b09af9c2dad1efed2f8fa
refs/heads/master
2021-01-20T16:56:00.485441
2017-05-08T08:33:49
2017-05-08T08:33:49
82,807,006
0
0
null
null
null
null
UTF-8
Java
false
false
369
java
class TabliczkaMnozenia{ public static void main(String[] args) { int n = Integer.parseInt(args[0]); for(int i=1; i<=n; i++){ for(int j=1;j<=n; j++){ System.out.print(i*j+"\t"); } System.out.println(); } for(int i=1; i<=n; i++){ for(int j=1;j<=n; j++){ System.out.print(i+"*"+j+"="+i*j+"\t"); } System.out.println(); } } }
ea8baabaaa8293e85d5f2b2c54f9219694a8a7f8
33d5bd747b036d304192510355f9ecacf3227df0
/src/leetCode/GetPermutation.java
b73dd12ab74fc6f55d6279c1acbec05465b4518f
[]
no_license
18jie/algorithm
c9358840edadec7a51cf3c32a20d4c550126aac4
d6d9e634080e0f895c2d869f6c1b9cdceef9949e
refs/heads/master
2020-04-25T05:23:15.007898
2019-07-01T07:46:42
2019-07-01T07:46:42
142,892,574
0
0
null
null
null
null
UTF-8
Java
false
false
948
java
package leetCode; import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * @author fengjie * @date 2019:01:08 */ public class GetPermutation { public String getPermutation(int n, int k) { StringBuilder str = new StringBuilder(); String num = "123456789"; List<Integer> list = new ArrayList<>(); for (int i = 0; i < n; i++) { list.add(1); if(i != 0){ list.add(i,i * list.get(i - 1)); } } --k; for (int i = n; i >= 1; i--) { int j = k / list.get(i - 1); k %= list.get(i - 1); str.append(num.charAt(j)); num = num.replace(String.valueOf(num.charAt(j)),""); } return str.toString(); } public static void main(String[] args) { GetPermutation g = new GetPermutation(); System.out.println(g.getPermutation(4,17)); } }
ec5bac8a184f3aaf22bee75d5906f8c0b5e969c8
b4b6ccef05e1f1ec48456efbcf9da5e8b65442dd
/src/main/java/com/task/service/CategoryService.java
05f8f04386159c9e264838ed0c45e10764c16205
[]
no_license
oblivious7777/test5
9c6f0d70da250e9b766105533f8ff8ebae4572fa
714798bf2461315037b3e1582b62e07580232907
refs/heads/master
2021-05-09T18:47:01.517060
2018-01-27T14:53:07
2018-01-27T14:53:07
119,172,778
0
0
null
null
null
null
UTF-8
Java
false
false
872
java
package com.task.service; import com.task.model.Category; import com.task.model.Category_; import java.util.List; public interface CategoryService { List<Category> list(); public int listState(); public int listStateLs(); public int listStateAlready(); public List<Category> listStateAll(); public List<Category_> listOcc(); public int listOccDir(Category category); public List<Category_> listOccId(int id); public int listOccDirAll(Category category); public int listOccDir1(Category category); public int listOccDir2(Category category); public int listOccDir3(Category category); public int listOccDir4(); public int listOccDir5(Category category); public int listOccDir6(Category category); public int listOccDir7(); public int listOccDir8(); public int listOccDir9(); }
1e6aff807300bbe8f593dd9cdb19197b15908836
6ff8ef13f8eb37d425d4d8b7d0127dec609fb5af
/WebProj4/src/com/internousdev/webproj4/action/LoginAction.java
ac14926580df5f9696ccf7e328b323c967e9593b
[]
no_license
torchegit/test
1a15f5d56bbd598fdea4fedaa87ab9a3305528c2
b9b32cdc68d12571809e74d3694a8c9efd9b8009
refs/heads/master
2020-04-06T23:19:53.636563
2019-03-29T11:03:25
2019-03-29T11:03:25
157,865,612
0
0
null
null
null
null
UTF-8
Java
false
false
1,203
java
package com.internousdev.webproj4.action; import java.util.ArrayList; import java.util.List; import com.internousdev.webproj4.dao.LoginDAO; import com.internousdev.webproj4.dto.LoginDTO; import com.opensymphony.xwork2.ActionSupport; public class LoginAction extends ActionSupport { private String username; private String password; private List<LoginDTO> LoginDTOList = new ArrayList<LoginDTO>(); public String execute() { String ret=ERROR; System.out.println(username); System.out.println(password); LoginDAO dao=new LoginDAO(); LoginDTOList=dao.select(username, password); if(this.username.equals(LoginDTOList.get(0).getUsername())&& this.password.equals(LoginDTOList.get(0).getPassword())){ ret=SUCCESS; }else{ ret=ERROR; } return ret; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public List<LoginDTO> getLoginDTOList() { return LoginDTOList; } public void setLoginDTOList(List<LoginDTO> loginDTOList) { LoginDTOList = loginDTOList; } }
8c688157e449ba5da271b8c5099e5d8c7c12eaa3
a1f6786f150ae75cf9bbdcd177d2a2ae60718a8f
/src/main/java/com/alipay/simplehbase/client/service/HbaseRawService.java
fb6dfa9cf93919156dc9748cc047ab7d6112b09c
[]
no_license
lmy86263/simplehbase
a52b5254cba2e659f137a2d69f71ba54908f1803
34746d4d28bb5cbf65e2c2109483d80be4955b71
refs/heads/master
2020-03-26T10:10:58.707184
2018-08-15T02:03:44
2018-08-15T02:03:44
144,785,088
0
0
null
null
null
null
UTF-8
Java
false
false
564
java
package com.alipay.simplehbase.client.service; import java.util.List; import com.alipay.simplehbase.client.SimpleHbaseCellResult; /** * HbaseRawService. * * <pre> * Provides hbase raw service. * </pre> * * @author xinzhi.zhang * */ public interface HbaseRawService { /** * put data. * */ public void put(String hql); /** * select data. * */ public List<List<SimpleHbaseCellResult>> select(String hql); /** * delete data. * */ public void delete(String hql); }
d9eac745a37ec72bcd1307e7b557878dd31366ce
2974ca92c9ac74a34dd6dd95acfd30f6013f9d8a
/demo/src/main/java/cn/larry/demo/guice/produce/HardWare.java
8b0bf0c2429d7440b289c9da8e6405c4306efcab
[]
no_license
larryfu/curiosity
6e7b2305fd002625e8b5ed10e2a34b51b741e338
d3eeebef7bcc3adaf399d6baac2c41552b8b67ad
refs/heads/master
2023-07-24T10:52:59.878437
2023-07-11T06:36:31
2023-07-11T06:36:31
57,139,993
0
0
null
2022-12-16T08:29:30
2016-04-26T15:30:43
Java
UTF-8
Java
false
false
220
java
package cn.larry.demo.guice.produce; import com.google.inject.ImplementedBy; /** * Created by larry on 16-8-27. */ @ImplementedBy(IBMPC.class) public interface HardWare { void startup(); void shutdown(); }
048d13516e34a18e11a219ae57b05ddecc0b6bd5
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/7/7_55725615a67d8cf19723f1b79d657c9b62b0dc5b/AbyssalCharacterModule/7_55725615a67d8cf19723f1b79d657c9b62b0dc5b_AbyssalCharacterModule_s.java
d28add5d3c609c0696f1636700a831b181d1ff33
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
4,975
java
package net.sf.anathema.character.abyssal; import net.sf.anathema.character.abyssal.caste.AbyssalCaste; import net.sf.anathema.character.abyssal.resonance.AbyssalResonanceModelFactory; import net.sf.anathema.character.abyssal.resonance.AbyssalResonanceParser; import net.sf.anathema.character.abyssal.resonance.AbyssalResonancePersisterFactory; import net.sf.anathema.character.abyssal.resonance.AbyssalResonanceTemplate; import net.sf.anathema.character.abyssal.resonance.AbyssalResonanceViewFactory; import net.sf.anathema.character.generic.backgrounds.IBackgroundTemplate; import net.sf.anathema.character.generic.framework.ICharacterGenerics; import net.sf.anathema.character.generic.framework.additionaltemplate.IAdditionalViewFactory; import net.sf.anathema.character.generic.framework.additionaltemplate.model.IAdditionalModelFactory; import net.sf.anathema.character.generic.framework.additionaltemplate.persistence.IAdditionalPersisterFactory; import net.sf.anathema.character.generic.framework.module.CharacterModule; import net.sf.anathema.character.generic.framework.module.NullObjectCharacterModuleAdapter; import net.sf.anathema.character.generic.impl.backgrounds.CharacterTypeBackgroundTemplate; import net.sf.anathema.character.generic.impl.backgrounds.TemplateTypeBackgroundTemplate; import net.sf.anathema.character.generic.impl.caste.CasteCollection; import net.sf.anathema.character.generic.template.TemplateType; import net.sf.anathema.lib.registry.IIdentificateRegistry; import net.sf.anathema.lib.registry.IRegistry; import net.sf.anathema.lib.util.Identificate; import static net.sf.anathema.character.generic.type.CharacterType.ABYSSAL; @CharacterModule public class AbyssalCharacterModule extends NullObjectCharacterModuleAdapter { @SuppressWarnings("unused") private static final TemplateType abyssalTemplateType = new TemplateType(ABYSSAL); private static final TemplateType loyalAbyssalTemplateType = new TemplateType(ABYSSAL, new Identificate("default")); //$NON-NLS-1$ @SuppressWarnings("unused") private static final TemplateType renegadeAbyssalTemplateType = new TemplateType(ABYSSAL, new Identificate("RenegadeAbyssal")); //$NON-NLS-1$ @SuppressWarnings("unused") public static final String BACKGROUND_ID_ABYSSAL_COMMAND = "AbyssalCommand"; //$NON-NLS-1$ public static final String BACKGROUND_ID_LIEGE = "Liege"; //$NON-NLS-1$ public static final String BACKGROUND_ID_SPIES = "Spies"; //$NON-NLS-1$ public static final String BACKGROUND_ID_UNDERWORLD_MANSE = "UnderworldManse"; //$NON-NLS-1$ public static final String BACKGROUND_ID_WHISPERS = "Whispers"; //$NON-NLS-1$ @Override public void registerCommonData(ICharacterGenerics characterGenerics) { characterGenerics.getAdditionalTemplateParserRegistry().register(AbyssalResonanceTemplate.ID, new AbyssalResonanceParser()); characterGenerics.getCasteCollectionRegistry().register(ABYSSAL, new CasteCollection(AbyssalCaste.values())); } @Override public void addCharacterTemplates(ICharacterGenerics characterGenerics) { registerParsedTemplate(characterGenerics, "template/LoyalAbyssal2nd.template", "moep_Abyssals_"); //$NON-NLS-1$ registerParsedTemplate(characterGenerics, "template/RenegadeAbyssal2nd.template", "moep_Abyssals_"); //$NON-NLS-1$ } @Override public void addBackgroundTemplates(ICharacterGenerics generics) { IIdentificateRegistry<IBackgroundTemplate> backgroundRegistry = generics.getBackgroundRegistry(); backgroundRegistry.add(new CharacterTypeBackgroundTemplate(BACKGROUND_ID_ABYSSAL_COMMAND, loyalAbyssalTemplateType)); backgroundRegistry.add(new TemplateTypeBackgroundTemplate(BACKGROUND_ID_LIEGE, loyalAbyssalTemplateType)); backgroundRegistry.add(new CharacterTypeBackgroundTemplate(BACKGROUND_ID_SPIES, loyalAbyssalTemplateType)); backgroundRegistry.add(new CharacterTypeBackgroundTemplate(BACKGROUND_ID_UNDERWORLD_MANSE, loyalAbyssalTemplateType)); backgroundRegistry.add(new CharacterTypeBackgroundTemplate(BACKGROUND_ID_WHISPERS, ABYSSAL)); } @Override public void addAdditionalTemplateData(ICharacterGenerics characterGenerics) { IRegistry<String, IAdditionalModelFactory> additionalModelFactoryRegistry = characterGenerics.getAdditionalModelFactoryRegistry(); String templateId = AbyssalResonanceTemplate.ID; additionalModelFactoryRegistry.register(templateId, new AbyssalResonanceModelFactory()); IRegistry<String, IAdditionalViewFactory> additionalViewFactoryRegistry = characterGenerics.getAdditionalViewFactoryRegistry(); additionalViewFactoryRegistry.register(templateId, new AbyssalResonanceViewFactory()); IRegistry<String, IAdditionalPersisterFactory> persisterFactory = characterGenerics.getAdditonalPersisterFactoryRegistry(); persisterFactory.register(templateId, new AbyssalResonancePersisterFactory()); } }
e2301d349e026e35c389cb83ab2d1243a72bacb8
b82f6c81ce1c229c6d1bb4858ad7137cecaa12c6
/dungeonandancestry/src/main/java/ycd/org/dungeonandancestry/models/User.java
4f4a775191b445e02991c25fc4da1e69dbbaf932
[]
no_license
YoitsMeda/dugeonandancestory
c6f308c25d7b0efda6f96099d87558a9254dd494
bba07eea505bef097737748ca404a8f26f3d3d27
refs/heads/master
2020-04-26T21:13:13.698871
2019-03-05T09:33:35
2019-03-05T09:33:35
173,835,962
0
0
null
null
null
null
UTF-8
Java
false
false
1,609
java
package ycd.org.dungeonandancestry.models; import java.security.SecureRandom; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; @Entity public class User { @Id @GeneratedValue private int id; @NotNull @Size(min=3, max=15) private String firstname; @NotNull @Size(min=3, max=15) private String lastname; @NotNull @Size(min=7, max=20) private String password; @NotNull @Size(min=3) private String email; @NotNull @Size(min=3, max=15) private String username; public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getFirstname() { return firstname; } public void setFirstname(String firstname) { this.firstname = firstname; } public String getLastname() { return lastname; } public void setLastname(String lastname) { this.lastname = lastname; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public int getId() { return id; } public class passwordAuth { SecureRandom random = new SecureRandom(); byte[] salt = new byte[16]; random.nextBytes(salt); } }//END CLASS
e66cb527d1e01b37df49b7f376f6c7a385358e78
45fe0cf36a4dc3b3299ddada2b1cc968f6e68cea
/BankAccountManagement/src/main/java/com/qsoft/bam/service/BankAccountManagement.java
cf271fd99fb89e17e6805187ee1765b8b0b3945c
[]
no_license
ngo-thanh-le/TDD
9335eca5df846cd74c25723c4846db78002a926b
633106473abf7e96b2bb4a8cb9cf1f371148d240
refs/heads/master
2020-03-26T00:44:52.176994
2013-07-30T08:00:03
2013-07-30T08:00:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
838
java
package com.qsoft.bam.service; import com.qsoft.bam.dao.BankAccountDAO; import com.qsoft.bam.model.BankAccount; import com.qsoft.bam.model.Transaction; import java.util.Date; import java.util.List; /** * User: lent * Date: 7/8/13 */ public interface BankAccountManagement { public void setBankAccountDAO(BankAccountDAO bankAccountDAO); void openAccount(String accountNo, double balance); BankAccount getAccount(String accountNo); void deposit(String accountNo, double amount, String description); List<Transaction> getTransactionsOccurred(String accountNo, Date from, Date to); void withdraw(String accountNo, double amount, String description); List<Transaction> getTransactionsOccurred(String accountNo); List<Transaction> getRecentTransactions(String accountNo, int numberOfTransaction); }
18b9ec0aab2733d2d0921c27366e60540887710c
d850af00b9c31e6a9fbd1826d02f2f88752ba680
/src/main/java/com/helper/Util.java
12e8d0274cb9d0ecc5bc68fa2dc6e833017f349c
[]
no_license
siddharthgelda/Diary
bfac85e58190d6f51a581e8df1009e0559781d9e
bb9747a64ca20cc56b1267f0a2bdd9cd82e129c1
refs/heads/master
2021-01-17T23:31:55.908204
2020-09-01T14:06:30
2020-09-01T14:06:30
65,192,551
0
0
null
null
null
null
UTF-8
Java
false
false
1,928
java
package com.helper; import com.Constants; import com.ibm.internal.assignment.entity.UserDetail; import java.sql.Date; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.List; public class Util { public static Date getSqlDate(String searchDateStr) throws ParseException { SimpleDateFormat format = new SimpleDateFormat("MM/dd/yyyy"); Date parsed = convert(format.parse(searchDateStr)); return parsed; } private static java.sql.Date convert(java.util.Date uDate) { java.sql.Date sDate = new java.sql.Date(uDate.getTime()); return sDate; } public static String createExcelSheet(List<UserDetail> list) { StringBuffer data=new StringBuffer(); data.append(Constants.CASE_LIST_HEADERS); list.stream().forEach(caseData->{ data.append(System.lineSeparator()); data.append(caseData.getFileNo()); data.append(Constants.COMMOA); data.append(caseData.getCaseNo()); data.append(Constants.COMMOA); data.append(caseData.getAgainstClient()); data.append(Constants.COMMOA); data.append(caseData.getStage()); data.append(Constants.COMMOA); data.append(caseData.getDescripation()); data.append(Constants.COMMOA); data.append(caseData.getAdvocate()); data.append(Constants.COMMOA); data.append(caseData.getPrevDate().toString()); data.append(Constants.COMMOA); data.append(caseData.getCourt().getName()); data.append(Constants.COMMOA); data.append(caseData.getCompany().getName()); data.append(Constants.COMMOA); data.append(caseData.getCity().getName()); data.append(Constants.COMMOA); data.append(" "); }); return data.toString(); } }
b406062f1d26d7b1676eb7acdc0298c43b0da9a4
dac724ce4264693b978e60116d53c4cb187be62b
/src/main/java/com/tzxx/common/tencentservice/bill/identifyhandler/VatRollSingleInvoiceInfoHandler.java
8b5661b35293dc9619c5b7c7531f2976c618a171
[]
no_license
gitzhangliang/zlearn-web
60572f3e9a79c2ab10ee633fb49fa012958a4cdb
81788c7a53c212996d352b526ab6eaa4c9c0caa5
refs/heads/master
2023-02-24T14:01:07.659840
2023-02-12T10:25:28
2023-02-12T10:25:28
180,762,071
1
0
null
2022-06-17T02:07:26
2019-04-11T09:44:30
Java
UTF-8
Java
false
false
1,091
java
package com.tzxx.common.tencentservice.bill.identifyhandler; import com.tencentcloudapi.ocr.v20181119.models.SingleInvoiceInfo; import com.tzxx.common.tencentservice.bill.category.VatRollInvoice; import java.util.List; import java.util.Map; /** * @author zhangliang * @date 2021/1/28. */ public class VatRollSingleInvoiceInfoHandler extends AbstractSingleInvoiceInfoHandler<VatRollInvoice>{ public VatRollSingleInvoiceInfoHandler(List<SingleInvoiceInfo> singleInvoiceInfos){ super(singleInvoiceInfos); } @Override protected VatRollInvoice doHandle(Map<String, String> nameValueMap) { VatRollInvoice vatRollInvoice = new VatRollInvoice(); vatRollInvoice.setInvoiceNo(nameValueMap.get("发票号码")); vatRollInvoice.setInvoiceDate(nameValueMap.get("开票日期")); vatRollInvoice.setInvoiceCode(nameValueMap.get("发票代码")); vatRollInvoice.setTotalPriceInFigures(nameValueMap.get("合计金额(小写)")); vatRollInvoice.setCheckCode(nameValueMap.get("校验码")); return vatRollInvoice; } }
983117ac75b92c42a7c5b8af8dbf0727281c6c90
237a53f8bbf188e93de42517953804f40aed7c2b
/新闻客户端/newsclient/src/com/feicui/news/view/QrCodePupopWindow.java
e2d29eef0ac0bf6fc769fd3ebb355ab6629ac76c
[]
no_license
taiyang0725/Android
ce01a156d1c954e7274b74a9c3d128cfc846b729
36b411dd6b83dbfd8a94ca4472e8e9a7c23eb2b6
refs/heads/master
2020-04-27T08:35:29.326885
2015-05-15T09:27:29
2015-05-15T09:27:29
30,404,770
0
0
null
null
null
null
GB18030
Java
false
false
2,087
java
package com.feicui.news.view; import java.util.ArrayList; import android.app.Activity; import android.content.Context; import android.graphics.drawable.ColorDrawable; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup.LayoutParams; import android.widget.ListView; import android.widget.PopupWindow; import com.feicui.news.R; import com.feicui.news.mode.UIEntity; /** * 二维码适配器 * */ public class QrCodePupopWindow extends PopupWindow { private View conentView; private ListView lst; private ArrayList<UIEntity> list; // /** 点击事件回调方法 */ // public void setOnItemClick(OnItemClickListener OnItemClick) { // this.OnItemClick = OnItemClick; // } public QrCodePupopWindow(final Activity context) { LayoutInflater inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); conentView = inflater.inflate(R.layout.qrcode, null); int h = context.getWindowManager().getDefaultDisplay().getHeight(); int w = context.getWindowManager().getDefaultDisplay().getWidth(); // 设置SelectPicPopupWindow的View this.setContentView(conentView); // 设置SelectPicPopupWindow弹出窗体的宽 this.setWidth(w / 3); // 设置SelectPicPopupWindow弹出窗体的高 this.setHeight(LayoutParams.WRAP_CONTENT); // 设置SelectPicPopupWindow弹出窗体可点击 this.setFocusable(true); this.setOutsideTouchable(true); // 刷新状态 this.update(); // 实例化一个ColorDrawable颜色为半透明 ColorDrawable dw = new ColorDrawable(R.color.green); // 点back键和其他地方使其消失,设置了这个才能触发OnDismisslistener ,设置其他控件变化等操作 this.setBackgroundDrawable(dw); this.setAnimationStyle(android.R.style.Animation_Dialog); // 设置SelectPicPopupWindow弹出窗体动画效果 // this.setAnimationStyle(R.style.); } public void showPopupWindow(View parent) { if (!this.isShowing()) { this.showAsDropDown(parent, parent.getLayoutParams().width / 4, 15); } else { this.dismiss(); } } }
633f1fe089bd1ac50c9761c1e325252fa82e8624
c89403dbdc280089c90d380452a3ddeb071a86fd
/shopingbackend/src/main/java/MavenDemoProject/shopingbackend/App.java
a81f5b440f5edb4851114755f2dd21312ae5a930
[]
no_license
ROSHANAHIRE/online-shoping
d3fac481b8dab2f2ac3c9d310e530ecf7f6b3f0d
c8f34b8d8272f0f28c04441b26c4baf34c911b34
refs/heads/master
2021-04-28T10:02:27.344281
2018-03-13T12:54:23
2018-03-13T12:54:23
122,055,296
0
0
null
null
null
null
UTF-8
Java
false
false
207
java
package MavenDemoProject.shopingbackend; /** * Hello world! * */ public class App { public static void main( String[] args ) { System.out.println( "Hello World!" ); } }
dab2f033b45f277a016b92d14acd40fa9b220572
63b7527a1053a2dbaa7841084c544eca5de35489
/src/main/java/net/dv8tion/jda/internal/utils/BufferedRequestBody.java
1e4dba36a4397ce8f19ec14cc115e8c30794afbc
[ "Apache-2.0" ]
permissive
DHeartEz/JDA
d696db134e49fd166455da2b55fbfbb456f0b80b
4b75ff2a3d8f0beb222f282a5d6d0c17d1cadbc9
refs/heads/master
2022-05-24T06:14:52.935992
2020-04-21T04:33:14
2020-04-21T04:33:14
257,476,581
0
0
Apache-2.0
2020-04-21T04:08:38
2020-04-21T04:08:37
null
UTF-8
Java
false
false
1,657
java
/* * Copyright 2015-2019 Austin Keener, Michael Ritter, Florian Spieß, and the JDA contributors * * 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 net.dv8tion.jda.internal.utils; import okhttp3.MediaType; import okhttp3.RequestBody; import okio.BufferedSink; import okio.BufferedSource; import okio.Okio; import okio.Source; import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.io.IOException; public class BufferedRequestBody extends RequestBody { private final Source source; private final MediaType type; private byte[] data; public BufferedRequestBody(Source source, MediaType type) { this.source = source; this.type = type; } @Nullable @Override public MediaType contentType() { return type; } @Override public void writeTo(@Nonnull BufferedSink sink) throws IOException { if (data != null) { sink.write(data); return; } try (BufferedSource s = Okio.buffer(source)) { data = s.readByteArray(); sink.write(data); } } }
cc9ac6be2ad6a7ece3c2a45434b362067c29d9f8
db2be461dca17aa54481140970d6ed05a32ebd60
/src/main/java/com/csye6220/recruitment/controller/AdminController.java
b3ddac588f9c8d0bb486f2177e5d22b7b5e2cfaa
[]
no_license
Shamture/recruitment-website
43a21a504ff4e019f50d072ac7c69d9d0b0bed48
964a6983ce5f7add8361f596fb25f7b374d0e0a4
refs/heads/master
2020-03-25T11:40:27.943975
2018-05-18T10:46:20
2018-05-18T10:46:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,130
java
package com.csye6220.recruitment.controller; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import com.csye6220.recruitment.dao.AdminDAO; import com.csye6220.recruitment.dao.RoleDAO; import com.csye6220.recruitment.pojo.Admin; import com.csye6220.recruitment.pojo.Application; import com.csye6220.recruitment.pojo.Hr; import com.csye6220.recruitment.pojo.Post; import com.csye6220.recruitment.pojo.Resume; import com.csye6220.recruitment.pojo.Role; import com.csye6220.recruitment.pojo.User; @Controller public class AdminController { @Autowired private AdminDAO adminDAO; @Autowired private RoleDAO roleDAO; @Autowired private BCryptPasswordEncoder bcryptEncoder; @RequestMapping(value="/admin/addAdmin",method=RequestMethod.GET) protected String showRegisterAdmin(){ return "register-admin"; } @RequestMapping(value="/admin/addAdmin",method=RequestMethod.POST) protected String addAdmin(HttpServletRequest request,ModelMap model){ String username = request.getParameter("username"); String rawPassword = request.getParameter("password"); String password = bcryptEncoder.encode(rawPassword); String roleString = request.getParameter("role"); Role role = roleDAO.getByName(roleString); Admin admin = new Admin(username,password,role); adminDAO.add(admin); model.addAttribute("message","An admin has been added successfully."); return "message"; } @RequestMapping(value="/admin/manageAdmins",method=RequestMethod.GET) protected String showManageAdmins(ModelMap model){ List<Admin> admins = adminDAO.list(); model.addAttribute("admins",admins); //to be continued return "manage-admins"; } }
974a449219273f7ef528b6dfc0c49b0b78ea758a
8d95de1da574f71a80e3c836b4dda4f62419870a
/app/src/test/java/com/harshadachavan/widgetexample/ExampleUnitTest.java
d8ca0e8a24b869e873d9f6d9ea421d037b852bcf
[]
no_license
harshadachavan/WidgetDemo
619300f5cc40b2fd4c37b474761af7905feb0596
752fc88e8d1ead597baf8b5df70489766b70fccd
refs/heads/master
2021-07-09T13:00:06.332178
2017-10-07T17:28:37
2017-10-07T17:28:37
106,116,637
0
0
null
null
null
null
UTF-8
Java
false
false
410
java
package com.harshadachavan.widgetexample; 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); } }
90d3c42144db6574608de360e0e1ac1d1aeaf4a2
1b7431bf6b8b289affcf8d596274ca34a05675eb
/app/src/main/java/lxy/liying/hdtvneu/service/task/NEU_ReviewProgramsInfoImpl.java
50352ddd565e5555a675c01c6e9ecfdf4c24215d
[ "Apache-2.0" ]
permissive
liying2008/XDPlayer
f1e9efdde40ea0b00a09d278639be0a7146975e5
9be0082d964bec6d530ff3660589dae9c62850da
refs/heads/master
2021-01-12T13:39:46.308332
2017-06-21T06:35:49
2017-06-21T06:35:49
69,211,893
6
4
null
null
null
null
UTF-8
Java
false
false
932
java
package lxy.liying.hdtvneu.service.task; import lxy.liying.hdtvneu.domain.ReviewList; import lxy.liying.hdtvneu.regex.NEU_RegexReviewHtml; import lxy.liying.hdtvneu.utils.CommonUtils; /** * ======================================================= * 作者:liying * 日期:2016/5/16 23:14 * 版本:1.0 * 描述:获取回看节目网页 * 备注: * ======================================================= */ public class NEU_ReviewProgramsInfoImpl implements NEU_ReviewProgramsInfo { @Override public ReviewList getReviewProgramsInfo(String p) { // http://hdtv.neu6.edu.cn/time-select?p=cctv5hd String html = CommonUtils.getHtml("http://hdtv.neu6.edu.cn/time-select?p=" + p, "UTF-8"); NEU_RegexReviewHtml regexReviewHtml = new NEU_RegexReviewHtml(); ReviewList reviewList = regexReviewHtml.getReviewPrograms(html); return reviewList; } }
94951d6b6ecf726645ea7da6a4406e55f19a1ec7
0fba2cd000422ef42be2f274edc7a2248c40f46c
/CRM_EAI_code_deploy/code/CRM61OM/TransformMoveUserToCSFormat/WEB-INF/src/com/reuters/eai/cc/uom/CSMoveUserRequest.java
649d4175742d356d0654b638012574cbc10f41dd
[]
no_license
RamKancharla/2012_R3
e5ea9627da9ded2136bb2c530c24d5e01f33bb12
0a7cfe86cde163d1554b48a73ceb924974a14dbe
refs/heads/master
2016-09-10T10:21:38.581302
2013-06-25T15:41:17
2013-06-25T15:41:17
10,941,682
0
0
null
null
null
null
UTF-8
Java
false
false
1,660
java
// !DO NOT EDIT THIS FILE! // This source file is generated by Oracle tools // Contents may be subject to change // For reporting problems, use the following // Version = Oracle WebServices (10.1.3.3.0, build 070610.1800.23513) package com.reuters.eai.cc.uom; public class CSMoveUserRequest implements java.io.Serializable { protected com.reuters.eai.cc.uom._CSEaiHeader eaiHeader; protected com.reuters.eai.cc.uom.CSMessageHeader messageHeader; protected com.reuters.eai.cc.uom.CSUserOrderHeader userOrderHeader; protected com.reuters.eai.cc.uom.CSUOLI[] userOrderLineItem; public CSMoveUserRequest() { } public com.reuters.eai.cc.uom._CSEaiHeader getEaiHeader() { return eaiHeader; } public void setEaiHeader(com.reuters.eai.cc.uom._CSEaiHeader eaiHeader) { this.eaiHeader = eaiHeader; } public com.reuters.eai.cc.uom.CSMessageHeader getMessageHeader() { return messageHeader; } public void setMessageHeader(com.reuters.eai.cc.uom.CSMessageHeader messageHeader) { this.messageHeader = messageHeader; } public com.reuters.eai.cc.uom.CSUserOrderHeader getUserOrderHeader() { return userOrderHeader; } public void setUserOrderHeader(com.reuters.eai.cc.uom.CSUserOrderHeader userOrderHeader) { this.userOrderHeader = userOrderHeader; } public com.reuters.eai.cc.uom.CSUOLI[] getUserOrderLineItem() { return userOrderLineItem; } public void setUserOrderLineItem(com.reuters.eai.cc.uom.CSUOLI[] userOrderLineItem) { this.userOrderLineItem = userOrderLineItem; } }
5f763c9aa60cdeb484b3537e36a4b0a0e956fa04
f3f4f8ac27a96780e5e30c25e6ff91494d8eed85
/src/main/java/com/bcopstein/Interfaces/DTO/FiltroDTO.java
4d548f14cf1c2200833f5c9753ffabd96a09574c
[]
no_license
tiagoluzs/LocadoraBackend
4caf5a497d7c372563fd9ab88567b882199d3b33
92eb2f3232ebe468c257f2fd552584ffef444cef
refs/heads/master
2023-01-21T18:56:34.638636
2020-11-30T23:32:28
2020-11-30T23:32:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,480
java
package com.bcopstein; public class FiltroDTO { private DataLocal inicioLocacao = new DataLocal(); private DataLocal fimLocacao = new DataLocal(); private boolean arcondicionado = false; private boolean direcao = false; private boolean cambio = false; public FiltroDTO(DataLocal inicioLocacao, DataLocal fimLocacao, boolean arcondicionado, boolean direcao, boolean cambio) { this.inicioLocacao = inicioLocacao; this.fimLocacao = fimLocacao; this.arcondicionado = arcondicionado; this.direcao = direcao; this.cambio = cambio; } public DataLocal getInicioLocacao() { return inicioLocacao; } public void setInicioLocacao(DataLocal inicioLocacao) { this.inicioLocacao = inicioLocacao; } public DataLocal getFimLocacao() { return fimLocacao; } public void setFimLocacao(DataLocal fimLocacao) { this.fimLocacao = fimLocacao; } public boolean isArcondicionado() { return arcondicionado; } public boolean isDirecao(){ return direcao; } public boolean isCambio() { return cambio; } @Override public String toString() { return "FiltroDTO [arcondicionado=" + arcondicionado + ", cambio=" + cambio + ", direcao=" + direcao + ", fimLocacao=" + fimLocacao + ", inicioLocacao=" + inicioLocacao + "]"; } }
92641323c7574afdcf052b0f9e98eb2d9afde446
9430cbb7c15fd009e94ec1606948b32e6dc36846
/src/clueGame/DoorDirection.java
e4cfa36795e6e025d4503134fd450835c137fc7d
[]
no_license
nicwenzel26/Clue
97b5829b8d8b502af15f49e103694a330cc6e3c8
21b1db6d7c6cd4131c15bfe70a4e8d2513dc5913
refs/heads/master
2020-06-19T15:43:43.301203
2019-07-13T21:53:13
2019-07-13T21:53:13
196,769,184
0
0
null
null
null
null
UTF-8
Java
false
false
147
java
/* * Brennan Guthals & Nicholas Wenzel * 3/6/2019 * ClueGame */ package clueGame; public enum DoorDirection { UP, DOWN, LEFT, RIGHT, NONE; }
905a5a3a8238d044a7315b0dce74032d4c614bff
db039688ea992ab01f3d01d45bbaa2f37bae3324
/gcbpanel/src/main/java/com/macoscope/gcbwatchface/SyncPreferencesView.java
d42824af2708c82ebff02e69a9175c70b45bba16
[ "Apache-2.0" ]
permissive
jayshah3893/GCBAndroidWearWatchFace
05f6767fe480989d66457817caca73b79c49dea8
8744158d8216b99b30f3faff9bdb65655b92356b
refs/heads/master
2021-06-01T02:10:26.142049
2016-06-09T14:09:36
2016-06-09T14:09:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
443
java
package com.macoscope.gcbwatchface; import android.content.Intent; public interface SyncPreferencesView { void showGooglePlayServicesAvailabilityErrorDialog(int connectionStatusCode); void showMessage(String message); void showMessage(int resourceId); void startRequestAccountActivityForResult(Intent intent, int requestCode); void requestEasyPermissions(int requestCode, String permission, int messageResourceId); }
5372efaa6f59a545455ce715887a8b504f6d9e52
06f7ba5a5c69beb0915567ca0946a931d5fcd07a
/src/IO/FileInputStreamTest05.java
666b2afe9aa7944c962492744ffd5101dcf28c8f
[]
no_license
04143066/execise
c31c89f171b4c6371dd6c48dce0734e48842e006
c7979317ca56578f8a927729fc567f1ef5a37bc9
refs/heads/master
2020-03-29T09:08:48.902124
2017-06-18T06:41:18
2017-06-18T06:41:18
94,669,860
0
0
null
null
null
null
GB18030
Java
false
false
893
java
package IO; import java.io.*; public class FileInputStreamTest05 { public static void main(String[] args) { //1.创建流 FileInputStream fis = null; try { fis = new FileInputStream("E:\\我的java程序\\动力节点\\src\\IO\\temp01.txt"); System.out.println(fis.available());//4 System.out.println(fis.read());//97 System.out.println(fis.available());//3 //available() 返回下一次输入流调用的方法可以不受阻塞地从此输入流读取(或跳过)的估计剩余值 fis.skip(1);//跳过一个字节 System.out.println(fis.available());//2 System.out.println(fis.read());//99 } catch (FileNotFoundException e) { e.printStackTrace(); }catch (IOException e) { e.printStackTrace(); } finally{ try { fis.close(); } catch (IOException e) { e.printStackTrace(); } } } }
18ca92589a6bd8340657e4868b97dcb3037fd329
6b23142c6c2ced711ac866944e1934dbacf6586c
/app/src/main/java/com/solutionsmax/silverlinktask/db/FactsRepository.java
42acd467da6e3f638428d3830d7762c362957229
[]
no_license
cr7rahul/SilverlinkTask
c9a9d234b8b6f8bc4e28ac6ccc7b7bfd851cd7c3
0dab8b800f425d518646c1ba61238533087299fc
refs/heads/master
2020-09-08T02:01:06.950767
2019-11-11T12:58:34
2019-11-11T12:58:34
220,952,206
0
0
null
null
null
null
UTF-8
Java
false
false
1,057
java
package com.solutionsmax.silverlinktask.db; import android.app.Application; import android.os.AsyncTask; import androidx.lifecycle.LiveData; import java.util.List; public class FactsRepository { private FactsDAO factsDAO; private LiveData<List<Facts>> factsLiveData; public FactsRepository(Application application) { FactsDatabase factsDatabase = FactsDatabase.getDatabase(application); factsDAO = factsDatabase.dao(); factsLiveData = factsDAO.getAllfacts(); } public LiveData<List<Facts>> getFacts() { return factsLiveData; } public void insert(Facts facts) { new InsertAsyncTask(factsDAO).execute(facts); } private static class InsertAsyncTask extends AsyncTask<Facts, Void, Void> { FactsDAO asyncFactsDAO; InsertAsyncTask(FactsDAO factsDAO) { asyncFactsDAO = factsDAO; } @Override protected Void doInBackground(Facts... facts) { asyncFactsDAO.insert(facts[0]); return null; } } }
92ea78fe33ad80e6737d5a9ce0c8cd0240450f70
8c91941af0aa65bde64ed3b5e98855da51cdb315
/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/UserApi.java
064ecfca40aa8abb18cdb8f97eb81f910d4dd179
[ "Apache-2.0" ]
permissive
m-kay/openapi-generator
0337b4bc06534b6326591d917c60a71727aaff47
56495d1486315990b49c1fa1c44f1ec762396a6f
refs/heads/master
2023-05-13T20:41:03.138022
2023-05-05T08:11:57
2023-05-05T08:11:57
261,681,160
0
0
Apache-2.0
2020-05-06T07:16:35
2020-05-06T07:16:34
null
UTF-8
Java
false
false
9,494
java
/** * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.6.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.api; import java.util.List; import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "user", description = "Operations about user") public interface UserApi { default UserApiDelegate getDelegate() { return new UserApiDelegate() {}; } /** * POST /user : Create user * This can only be done by the logged in user. * * @param user Created user object (required) * @return successful operation (status code 200) */ @ApiOperation( tags = { "user" }, value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", authorizations = { @Authorization(value = "api_key") } ) @ApiResponses({ @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user", consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) default void createUser( @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User user ) { getDelegate().createUser(user); } /** * POST /user/createWithArray : Creates list of users with given input array * * * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( tags = { "user" }, value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", authorizations = { @Authorization(value = "api_key") } ) @ApiResponses({ @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithArray", consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) default void createUsersWithArrayInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<User> user ) { getDelegate().createUsersWithArrayInput(user); } /** * POST /user/createWithList : Creates list of users with given input array * * * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( tags = { "user" }, value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", authorizations = { @Authorization(value = "api_key") } ) @ApiResponses({ @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.POST, value = "/user/createWithList", consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) default void createUsersWithListInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<User> user ) { getDelegate().createUsersWithListInput(user); } /** * DELETE /user/{username} : Delete user * This can only be done by the logged in user. * * @param username The name that needs to be deleted (required) * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ @ApiOperation( tags = { "user" }, value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", authorizations = { @Authorization(value = "api_key") } ) @ApiResponses({ @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.DELETE, value = "/user/{username}" ) @ResponseStatus(HttpStatus.BAD_REQUEST) default void deleteUser( @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username ) { getDelegate().deleteUser(username); } /** * GET /user/{username} : Get user by user name * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) * or Invalid username supplied (status code 400) * or User not found (status code 404) */ @ApiOperation( tags = { "user" }, value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class ) @ApiResponses({ @ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.GET, value = "/user/{username}", produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) default User getUserByName( @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username ) { return getDelegate().getUserByName(username); } /** * GET /user/login : Logs user into the system * * * @param username The user name for login (required) * @param password The password for login in clear text (required) * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ @ApiOperation( tags = { "user" }, value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class ) @ApiResponses({ @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied") }) @RequestMapping( method = RequestMethod.GET, value = "/user/login", produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) default String loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password ) { return getDelegate().loginUser(username, password); } /** * GET /user/logout : Logs out current logged in user session * * * @return successful operation (status code 200) */ @ApiOperation( tags = { "user" }, value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", authorizations = { @Authorization(value = "api_key") } ) @ApiResponses({ @ApiResponse(code = 200, message = "successful operation") }) @RequestMapping( method = RequestMethod.GET, value = "/user/logout" ) @ResponseStatus(HttpStatus.OK) default void logoutUser( ) { getDelegate().logoutUser(); } /** * PUT /user/{username} : Updated user * This can only be done by the logged in user. * * @param username name that need to be deleted (required) * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ @ApiOperation( tags = { "user" }, value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", authorizations = { @Authorization(value = "api_key") } ) @ApiResponses({ @ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 404, message = "User not found") }) @RequestMapping( method = RequestMethod.PUT, value = "/user/{username}", consumes = { "application/json" } ) @ResponseStatus(HttpStatus.BAD_REQUEST) default void updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User user ) { getDelegate().updateUser(username, user); } }
9559994a15dbf3b92c2a1f0a8523c2630c6ef8c1
d3a5c22fc6f248b057a36f25c2271e1966bbb91f
/reactive-mysql/src/test/java/com/anbu/reactive/mysql/ReactiveMysqlApplicationTests.java
2ed6f9f76aedad50cdb5bebb6bc8424535b99286
[]
no_license
anbusampath/spring-data-r2dbc-examples
19d7198003d1370202ffbc256c886a52364df6b1
66d8f08e97c01317c9eb84e6bdce595b4635c334
refs/heads/master
2020-06-28T22:19:03.334764
2019-08-28T06:10:05
2019-08-28T06:10:05
200,356,516
0
0
null
null
null
null
UTF-8
Java
false
false
222
java
package com.anbu.reactive.mysql; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class ReactiveMysqlApplicationTests { @Test void contextLoads() { } }
b94956a9fbd2f24f0e7acb2860fd30e604ee4f8b
36d4c9a57b53f5e14acb512759b49fe44d9990d8
/csc/java_2014/2014_11_10/src/test/java/ru/csc/java2014/testing/demo3/CalculatorCliTest.java
29eac5a2784334893148eec4489b2f6867ee76aa
[]
no_license
yosef8234/test
4a280fa2b27563c055b54f2ed3dfbc7743dd9289
8bb58d12b2837c9f8c7b1877206a365ab9004758
refs/heads/master
2021-05-07T22:46:06.598921
2017-10-16T18:11:26
2017-10-16T18:11:26
107,286,907
4
2
null
null
null
null
UTF-8
Java
false
false
1,608
java
package ru.csc.java2014.testing.demo3; import org.junit.Before; import org.junit.Test; import org.mockito.Mockito; import java.io.StringReader; import static org.junit.Assert.*; import static org.mockito.Mockito.*; public class CalculatorCliTest { private Calculator calculatorMock; private CalculatorCli calculatorCli; @Before public void setUp() { calculatorMock = Mockito.mock(Calculator.class); calculatorCli = new CalculatorCli(calculatorMock); } @Test public void empty_expressions_must_be_skipped() { calculatorCli.runInteractiveSession(new StringReader(";\n; ;;;\t\n;")); Mockito.verifyZeroInteractions(calculatorMock); } @Test public void each_expression_separated_by_semicolon_must_be_evaluated() { calculatorCli.runInteractiveSession(new StringReader("1;2;3;")); verify(calculatorMock).calculate("1"); verify(calculatorMock).calculate("2"); verify(calculatorMock).calculate("3"); verifyNoMoreInteractions(calculatorMock); } @Test public void each_expression_separated_by_semicolon_must_be_evaluated_2() { when(calculatorMock.calculate("1")).thenReturn(1d); when(calculatorMock.calculate("2")).thenReturn(2d); when(calculatorMock.calculate("3")).thenReturn(3d); calculatorCli.runInteractiveSession(new StringReader("1;2;3;")); verify(calculatorMock).calculate("1"); verify(calculatorMock).calculate("2"); verify(calculatorMock).calculate("3"); verifyNoMoreInteractions(calculatorMock); } }
631957de52ec2ce77b100f477b0bd51c0cdd782d
c765552996afd2dd3479d02d2c5f4f87e14ece83
/src/com/company/behaviouralPattern/visitor/HeadingNode.java
d1d8d18a35e5be2316e22f8959879252ab955edc
[]
no_license
yousa-rahman/DesignPatterns
02810ef63e0cc7be13ec479f958f609235cc43e4
c1d54dfb90968d8eb31b67c79106466ecb7c78fc
refs/heads/main
2023-08-20T14:34:21.813316
2021-10-24T15:44:02
2021-10-24T15:44:02
406,389,304
0
0
null
null
null
null
UTF-8
Java
false
false
195
java
package com.company.behaviouralPattern.visitor; public class HeadingNode implements HtmlNode{ @Override public void execute(Operation operation) { operation.apply(this); } }
94ca75a1754b37da0c8dc198c5e0e2f08cf9d3a9
667761a0b60550bebb59a04bb2c4f310aca71243
/myApp/src/ie/gmit/computing/TreeAdapter.java
b81b278f7e52e218151bd2125fb51e9af97bc94c
[]
no_license
zengxuezhen/Marine
f2dd3aa31d2bdd021204e869dfb6f383d194662b
fd25ed7eff85c92e0e9d9cbf6d911ce447576f0f
refs/heads/master
2021-03-12T20:20:21.961439
2015-01-18T18:05:42
2015-01-18T18:05:42
29,435,109
0
0
null
null
null
null
GB18030
Java
false
false
6,472
java
package ie.gmit.computing; import java.util.ArrayList; import java.util.List; import android.content.Context; import android.content.Intent; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.CheckBox; import android.widget.ImageView; import android.widget.TextView; /** * The adapter is to back up the data for listview * @author Alex.Zeng * */ public class TreeAdapter extends BaseAdapter{ private Context con; private LayoutInflater lif; private List<Node> all = new ArrayList<Node>();//展示 private List<Node> cache = new ArrayList<Node>();//缓存 private TreeAdapter tree = this; boolean hasCheckBox; private int expandIcon = -1;//展开图标 private int collapseIcon = -1;//收缩图标 /** * Constructor */ public TreeAdapter(Context context,List<Node>rootNodes){ this.con = context; this.lif = (LayoutInflater)con.getSystemService(Context.LAYOUT_INFLATER_SERVICE); for(int i=0;i<rootNodes.size();i++){ addNode(rootNodes.get(i)); } } /** * add the given node to listview * @param node * */ public void addNode(Node node){ all.add(node); cache.add(node); if(node.isLeaf())return; for(int i = 0;i<node.getChildrens().size();i++){ addNode(node.getChildrens().get(i)); } } /** * set icon * @param expandIcon * @param collapseIcon * */ public void setCollapseAndExpandIcon(int expandIcon,int collapseIcon){ this.collapseIcon = collapseIcon; this.expandIcon = expandIcon; } /** * set the state of checkbox * * */ public void checkNode(Node n,boolean isChecked){ checkParentNode(n, isChecked); for(int i =0 ;i<n.getChildrens().size();i++){ checkNode((Node)n.getChildrens().get(i), isChecked); } } public void checkParentNode(Node n, boolean isChecked){ n.setChecked(isChecked); Node parent = n.getParent(); if (parent != null) { if(isChecked){ checkParentNode(parent, true); }else{ boolean checked = false; for (int i = 0; i < parent.getChildrens().size(); i++) { Node child = parent.getChildrens().get(i); if(child.isChecked()) { checked = true; break; } } checkParentNode(parent, checked); } } } /** *get all selected nodes * @return * */ public List<Node>getSelectedNode(){ List<Node>checks =new ArrayList<Node>() ; for(int i = 0;i<cache.size();i++){ Node n =(Node)cache.get(i); if(n.isChecked()) checks.add(n); } return checks; } /** * if has checkbox * @param hasCheckBox * */ public void setCheckBox(boolean hasCheckBox){ this.hasCheckBox = hasCheckBox; } /** * change the state of each node * @param location * */ public void ExpandOrCollapse(int location){ Node n = all.get(location);//获得当前视图需要处理的节点 if(n!=null)//排除传入参数错误异常 { if(!n.isLeaf()){ n.setExplaned(!n.isExplaned());// 由于该方法是用来控制展开和收缩的,所以取反即可 filterNode();//遍历一下,将所有上级节点展开的节点重新挂上去 this.notifyDataSetChanged();//刷新视图 } } } /** * set the layer * @param level * */ public void setExpandLevel(int level){ all.clear(); for(int i = 0;i<cache.size();i++){ Node n = cache.get(i); if(n.getLevel()<=level){ if(n.getLevel()<level) n.setExplaned(true); else n.setExplaned(false); all.add(n); } } } public void filterNode(){ all.clear(); for(int i = 0;i<cache.size();i++){ Node n = cache.get(i); if(!n.isParentCollapsed()||n.isRoot())//凡是父节点不收缩或者不是根节点的都挂上去 all.add(n); } } /* (non-Javadoc) * @see android.widget.Adapter#getCount() */ @Override public int getCount() { // TODO Auto-generated method stub return all.size(); } /* (non-Javadoc) * @see android.widget.Adapter#getItem(int) */ @Override public Object getItem(int location) { // TODO Auto-generated method stub return all.get(location); } /* (non-Javadoc) * @see android.widget.Adapter#getItemId(int) */ @Override public long getItemId(int location) { // TODO Auto-generated method stub return location; } /* (non-Javadoc) * @see android.widget.Adapter#getView(int, android.view.View, android.view.ViewGroup) */ @Override public View getView(int location, View view, ViewGroup viewgroup) { ViewItem vi = null; if(view == null){ view = lif.inflate(R.layout.list_item, null); vi = new ViewItem(); vi.cb = (CheckBox)view.findViewById(R.id.cb); vi.flagIcon = (ImageView)view.findViewById(R.id.ivec); vi.tv = (TextView)view.findViewById(R.id.itemvalue); vi.icon =(ImageView)view.findViewById(R.id.ivicon); vi.cb.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Node n = (Node)v.getTag(); checkNode(n, ((CheckBox)v).isChecked()); tree.notifyDataSetChanged(); } }); view.setTag(vi); } else{ vi = (ViewItem)view.getTag(); if(vi ==null) System.out.println(); } Node n = all.get(location); if(n!=null){ if(vi==null||vi.cb==null) System.out.println(); vi.cb.setTag(n); vi.cb.setChecked(n.isChecked()); //叶节点不显示展开收缩图标 if(n.isLeaf()){ vi.flagIcon.setVisibility(View.GONE); } else{ vi.flagIcon.setVisibility(View.VISIBLE); if(n.isExplaned()){ if(expandIcon!=-1){ vi.flagIcon.setImageResource(expandIcon); } } else{ if(collapseIcon!=-1){ vi.flagIcon.setImageResource(collapseIcon); } } } //设置是否显示复选框 if(n.hasCheckBox()&&n.hasCheckBox()){ vi.cb.setVisibility(View.VISIBLE); } else{ vi.cb.setVisibility(View.GONE); } //设置是否显示头像图标 if(n.getIcon()!=-1){ vi.icon.setImageResource(n.getIcon()); vi.icon.setVisibility(View.VISIBLE); } else{ vi.icon.setVisibility(View.GONE); } //显示文本 vi.tv.setText(n.getTitle()); // 控制缩进 view.setPadding(30*n.getLevel(), 3,3, 3); } return view; } /** * This is an entity class * @author Alex.Zeng * */ public class ViewItem{ private CheckBox cb; private ImageView icon; private ImageView flagIcon; private TextView tv; } }
efb3e84abfb8bc38c4ca22889ac8d17af0942ba7
3cf549cbcf330d3febb4e21d60d157a311153e15
/src/com/esg/user/AppRegister.java
2b604b01f49654acba5d9cf070e79c5edbdd1ef9
[]
no_license
rgao0313/wechatpay
67231e242f15a64af5dc46768b807d2ef3babc3c
a6a1557a6169e9b947fe7cb5de3b3dd9580e325e
refs/heads/master
2020-03-25T18:00:43.957648
2018-08-09T08:55:34
2018-08-09T08:55:34
144,008,626
0
0
null
null
null
null
WINDOWS-1252
Java
false
false
624
java
package com.esg.user; import com.tencent.mm.opensdk.openapi.IWXAPI; import com.tencent.mm.opensdk.openapi.WXAPIFactory; //import com.tencent.mm.sdk.openapi.IWXAPI; //import com.tencent.mm.sdk.openapi.WXAPIFactory; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; public class AppRegister extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { final IWXAPI msgApi = WXAPIFactory.createWXAPI(context, null); // ½«¸Ãapp×¢²áµ½Î¢ÐÅ msgApi.registerApp(Constants.APP_ID); UnifiedOrder.unifiedOrder(); } }
a3e0f0339315f33d0aa0ed6806f0870c5724774c
64ea0d71b0109fe51018c46bb0e2baade78ed6d2
/Persistance/src/persistence/DAO/PizzaPriceListDAO.java
52ce3c9c8f8fa4273a7ac00e3197e1c0ae917a73
[]
no_license
dodaro/PizzaManager
8a0eb458dc5bbd15577abec6863d0a9d8a3b3f63
95868a70569507d11ae5ae9897380297a576e7b0
refs/heads/master
2021-01-10T18:33:14.435895
2016-01-27T12:52:28
2016-01-27T12:52:28
46,803,852
0
0
null
null
null
null
UTF-8
Java
false
false
337
java
package persistence.DAO; import java.util.List; import persistence.PizzaPriceList; public interface PizzaPriceListDAO { public void create(PizzaPriceList pizzaPriceList); public void delete(PizzaPriceList pizzaPriceList); public void update(PizzaPriceList pizzaPriceList); public List<PizzaPriceList> get(); }
882d4e762ad6dc8b7995ada4a33da46f263cf976
6fb16361ca612d16269fa2774cdaa3f1ad11a5d3
/spring-main/chap_04_java_config/src/main/java/com/j4ltechnologies/formation/spring/dao/javaconfig/impls/CompteService.java
8df5e739d620a7a5dcc2308ab45a22f5d9802681
[ "MIT" ]
permissive
renaud91/manageBill
aeaccd1b67b264e0610dc522a8580ee286f49b9e
98de012ac9834ac7d97b9b03308e93bc96ec20ca
refs/heads/main
2023-05-09T15:54:08.526314
2021-06-01T14:04:01
2021-06-01T14:04:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,213
java
package com.j4ltechnologies.formation.spring.dao.javaconfig.impls; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import com.j4ltechnologies.formation.spring.dao.ICompteService; import com.j4ltechnologies.formation.spring.domains.Compte; @Component public class CompteService implements ICompteService { @Autowired private CompteRepository compteRepository; @Override public void transfert(Integer numSource, Integer numDestination, Double montant) { Compte source = compteRepository.find(numSource); Compte destination = compteRepository.find(numDestination); source.setSolde(source.getSolde() - montant); destination.setSolde(destination.getSolde() + montant); compteRepository.update(source); compteRepository.update(destination); } @Override public void crediter(Integer numero, Double montant) { Compte compte = compteRepository.find(numero); compte.setSolde(compte.getSolde() + montant); compteRepository.update(compte); } @Override public Compte getCompte(Integer numero) { return compteRepository.find(numero); } }
2133765b8d2d23bc2bb84ad88533a866c731dc3d
7cf38653cf743a4102d98a1693bb1a51a485c3d2
/jdk1.7.0_79.jdk/src/org/omg/PortableServer/POAPackage/ServantAlreadyActiveHelper.java
56ab36e3596f3624edea23e6077b183d36c2e5b7
[]
no_license
Ranch2014/JDK-Source
91064af7611f29b1bd96c37ae6d23831c62073b8
97715ef4a5aaf9b7ec560b263dbf7a22c06a4ff4
refs/heads/master
2021-01-01T03:36:45.716654
2016-04-18T01:57:10
2016-04-18T01:57:10
56,468,771
1
0
null
null
null
null
UTF-8
Java
false
false
2,346
java
package org.omg.PortableServer.POAPackage; /** * org/omg/PortableServer/POAPackage/ServantAlreadyActiveHelper.java . * Generated by the IDL-to-Java compiler (portable), version "3.2" * from ../../../../src/share/classes/org/omg/PortableServer/poa.idl * Friday, April 10, 2015 11:31:10 AM PDT */ abstract public class ServantAlreadyActiveHelper { private static String _id = "IDL:omg.org/PortableServer/POA/ServantAlreadyActive:1.0"; public static void insert (org.omg.CORBA.Any a, org.omg.PortableServer.POAPackage.ServantAlreadyActive that) { org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); a.type (type ()); write (out, that); a.read_value (out.create_input_stream (), type ()); } public static org.omg.PortableServer.POAPackage.ServantAlreadyActive extract (org.omg.CORBA.Any a) { return read (a.create_input_stream ()); } private static org.omg.CORBA.TypeCode __typeCode = null; private static boolean __active = false; synchronized public static org.omg.CORBA.TypeCode type () { if (__typeCode == null) { synchronized (org.omg.CORBA.TypeCode.class) { if (__typeCode == null) { if (__active) { return org.omg.CORBA.ORB.init().create_recursive_tc ( _id ); } __active = true; org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [0]; org.omg.CORBA.TypeCode _tcOf_members0 = null; __typeCode = org.omg.CORBA.ORB.init ().create_exception_tc (org.omg.PortableServer.POAPackage.ServantAlreadyActiveHelper.id (), "ServantAlreadyActive", _members0); __active = false; } } } return __typeCode; } public static String id () { return _id; } public static org.omg.PortableServer.POAPackage.ServantAlreadyActive read (org.omg.CORBA.portable.InputStream istream) { org.omg.PortableServer.POAPackage.ServantAlreadyActive value = new org.omg.PortableServer.POAPackage.ServantAlreadyActive (); // read and discard the repository ID istream.read_string (); return value; } public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.PortableServer.POAPackage.ServantAlreadyActive value) { // write the repository ID ostream.write_string (id ()); } }
d5f6686c889f53e5f2f3f2abaed25d7a130dfd06
04445505e96b5b1bbaff6087a7e5b555a8ce13fd
/8_OOPExtraFeatures/src/task2_Bank/Task2_Bank.java
544191ff54e94471952c78bbb82ca787957e0490
[]
no_license
lgeorgieva/swift
880c77245f8667dd12dbda5252eb8831a98b5aa3
86b35ea3364a1a6ed80c5e82665dc092972fac12
refs/heads/master
2020-06-14T12:07:50.597879
2017-02-04T08:42:18
2017-02-04T08:42:18
75,026,941
0
0
null
null
null
null
UTF-8
Java
false
false
4,140
java
package task2_Bank; import task2_Bank.accounts.DepositAccount; import task2_Bank.accounts.LoanAccount; import task2_Bank.accounts.MortgageAccount; import task2_Bank.customers.IndividualCustomer; import java.util.Scanner; /** * Created by ASUS on 11.11.2016 г.. */ public class Task2_Bank { public static void main(String[] args) { Scanner scn = new Scanner(System.in); String input = scn.nextLine(); while (true) { String[] command = input.trim().split("\\s+"); if (command[0].equals("END")) { break; } switch (command[0]) { case "OPEN": String name = command[1]; String owner = (command[2]); double balance = Double.parseDouble(command[3]); double monthlyInterestRate = Double.parseDouble(command[4]); DepositAccount depositAccount = new DepositAccount(name, owner, balance, monthlyInterestRate); System.out.println(depositAccount.getAccountIBAN()); balance = Double.parseDouble(command[3]); monthlyInterestRate = Double.parseDouble(command[4]); LoanAccount loanAccount = new LoanAccount(name, owner, balance, monthlyInterestRate); System.out.println(loanAccount.getAccountIBAN()); balance = Double.parseDouble(command[3]); monthlyInterestRate = Double.parseDouble(command[4]); MortgageAccount mortgageAccount = new MortgageAccount(name, owner, balance, monthlyInterestRate); System.out.println(mortgageAccount.getAccountIBAN()); break; case "PUT": String accountIBAN = command[1]; double cash = Double.parseDouble(command[2]); depositAccount.put(cash); System.out.println(depositAccount.getBalance()); loanAccount.put(cash); System.out.println(loanAccount.getBalance()); mortgageAccount.put(cash); System.out.println(mortgageAccount.getBalance()); break; case "GET": name = command[1]; accountIBAN = command[1]; cash = Double.parseDouble(command[1]); depositAccount.put(cash); System.out.println(depositAccount.getBalance()); break; case "INFO": name = command[1]; accountIBAN = command[1]; System.out.println(depositAccount.getInterestRateCost()); } System.out.println(depositAccount.getInterestRateCost()); } System.out.println(depositAccount.getInterestRateCost()); } public static int getCompanyCustomer() { return companyCustomer; } public static void setCompanyCustomer(int companyCustomer) { Task2_Bank.companyCustomer = companyCustomer; } public static int getIndividualCustomer() { return individualCustomer; } public static void setIndividualCustomer(int individualCustomer) { Task2_Bank.individualCustomer = individualCustomer; } public static DepositAccount getDepositAccount() { return depositAccount; } public static void setDepositAccount(DepositAccount depositAccount) { Task2_Bank.depositAccount = depositAccount; } public static LoanAccount getLoanAccount() { return loanAccount; } public static void setLoanAccount(LoanAccount loanAccount) { Task2_Bank.loanAccount = loanAccount; } public static MortgageAccount getMortgageAccount() { return mortgageAccount; } public static void setMortgageAccount(MortgageAccount mortgageAccount) { Task2_Bank.mortgageAccount = mortgageAccount; } }
8ef74664651034d8a6d25342bbad4374edf8a086
e44b96ce9280d9f4b07b86b9b401ad1dfe50cb62
/yhlibrary/src/main/java/org/yh/library/view/webview/ProgressLifeCyclic.java
7cfa0e7e021409319159eea4195e9bfe91b330b4
[ "Apache-2.0" ]
permissive
my11712/YhLibraryForAndroid
aa34f6404d667e1d7cba7a1d93896914ad54b9d6
f8d6f1dc97757517b72c069b743a65f5d1baec22
refs/heads/master
2020-04-11T12:10:27.336160
2018-03-30T14:12:26
2018-03-30T14:12:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
171
java
package org.yh.library.view.webview; public interface ProgressLifeCyclic { void showProgressBar(); void setProgressBar(int newProgress); void finish(); }
b3ec5de8fcf33ac3523d907727e67f06130ca4fa
2d7a444a419245b9c1e4a8dfa065d83f52e97038
/src/main/scala/com/neighborhood/aka/laplace/estuary/web/config/RestTemplateConfig.java
2e977e421e887bea9c2385ac69f2bd41d3abe494
[ "Apache-2.0" ]
permissive
perkinls/estuary
91522fb685e54d853b5ca90f8d46b6ef3350e289
f963882c19f96d24297bcde728ade3ffe2bcb353
refs/heads/master
2022-01-09T01:24:57.751657
2019-02-14T09:23:35
2019-02-14T09:23:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
909
java
package com.neighborhood.aka.laplace.estuary.web.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.client.ClientHttpRequestFactory; import org.springframework.http.client.SimpleClientHttpRequestFactory; import org.springframework.web.client.RestTemplate; /** * Created by john_liu on 2019/1/21. */ @Configuration public class RestTemplateConfig { @Bean("restTemplate") public RestTemplate restTemplate(ClientHttpRequestFactory factory) { return new RestTemplate(factory); } @Bean public ClientHttpRequestFactory simpleClientHttpRequestFactory() { SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory(); factory.setReadTimeout(5000);//单位为ms factory.setConnectTimeout(5000);//单位为ms return factory; } }
acd6e5661ff76f5fa8f10379e189790f3b029a2a
e54035db6f9ca36927eeacfeb65c0e423d35105d
/src/main/java/com/shopping/cart/handler/CartHandler.java
971dceb5fcc2aff1d460fe30e801aeed216ab810
[]
no_license
kiran-prince/shopping-cart
94ea50b1bca7df990eb77ec6dd071b6ca9507188
97009f8f5c96d897a1192a3144462e0cd8a1abb6
refs/heads/master
2023-03-20T10:49:25.006481
2021-03-19T13:29:33
2021-03-19T13:29:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,977
java
package com.shopping.cart.handler; import java.util.HashMap; import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Component; import com.shopping.cart.constant.ResponseConstants; import com.shopping.cart.entity.Cart; import com.shopping.cart.entity.CartItem; import com.shopping.cart.exception.CartItemDoesNotExistException; import com.shopping.cart.exception.CartNotAssociatedException; import com.shopping.cart.exception.DataNotValidException; import com.shopping.cart.exception.ProductDoesNotExistException; import com.shopping.cart.service.CartService; import com.shopping.cart.validator.CartRequestValidator;; /** * CartHandler class to handle the requests and response to cart operations. * * @author Kusal * */ @Component public class CartHandler { /** * Logger for this class */ private static final Logger logger = LoggerFactory.getLogger(CartHandler.class); /** * Autowiring CartService dependency for consumption */ @Autowired CartService cartService; /** * Autowiring CartRequestValidator dependency for validation of requests */ @Autowired CartRequestValidator cartRequestValidator; /** * Handler method to fetch the cartItem list based on cart Id * * @param cartId * @return ResponseEntity */ public ResponseEntity<Map<String, Object>> getCartItemList(int cartId) { Map<String, Object> responseMap = new HashMap<>(); Cart cart; try { logger.info("Request received to fetch CartItems list for cartId - {}", cartId); cartRequestValidator.validateGetCartItemListRequest(cartId); cart = cartService.getCartItemList(cartId); if (cart.getCartItem() != null && cart.getCartItem().size() > 0) { responseMap.put(ResponseConstants.RESPONSE, cart); } else { // Returning a user friendly response if cart is empty. responseMap.put(ResponseConstants.RESPONSE, ResponseConstants.EMPTY_CART); } } catch (DataNotValidException de) { logger.error("DataNotValidException occurred in CartHandler::getCartItemList. Message - {}", de.getMessage()); responseMap.put(ResponseConstants.RESPONSE, de.getMessage()); return new ResponseEntity<Map<String, Object>>(responseMap, HttpStatus.BAD_REQUEST); } catch (CartNotAssociatedException ce) { logger.error("CartNotAssociatedException occurred in CartHandler::getCartItemList. Message - {}", ce.getMessage()); responseMap.put(ResponseConstants.RESPONSE, ce.getMessage()); return new ResponseEntity<Map<String, Object>>(responseMap, HttpStatus.PRECONDITION_FAILED); } catch (Exception e) { logger.error("Exception in CartHandler::getCartItemList. Message - {}", e.getMessage()); responseMap.put(ResponseConstants.RESPONSE, e.getMessage()); return new ResponseEntity<Map<String, Object>>(responseMap, HttpStatus.INTERNAL_SERVER_ERROR); } logger.info("CartItem list is fetched successfully for cartId - {}", cartId); return new ResponseEntity<Map<String, Object>>(responseMap, HttpStatus.OK); } /** * Handler method to add an item to the cart * * @param cartItem * @return ResponseEntity */ public ResponseEntity<Map<String, Object>> addItem(CartItem cartItem) { Map<String, Object> responseMap = new HashMap<>(); CartItem createdCartItem = null; try { logger.info("Request received to add an item to the cart - {}", cartItem); cartRequestValidator.validateAddItemRequest(cartItem); createdCartItem = cartService.addItem(cartItem); responseMap.put(ResponseConstants.RESPONSE, ResponseConstants.ADD_ITEM_SUCCESS); } catch (DataNotValidException de) { logger.error("DataNotValidException occurred in CartHandler::addItem. Message - {}", de.getMessage()); responseMap.put(ResponseConstants.RESPONSE, de.getMessage()); return new ResponseEntity<Map<String, Object>>(responseMap, HttpStatus.BAD_REQUEST); } catch (CartNotAssociatedException | ProductDoesNotExistException ce) { logger.error( "CartNotAssociatedException/ProductDoesNotExistException occurred in CartHandler::addItem. Message - {}", ce.getMessage()); responseMap.put(ResponseConstants.RESPONSE, ce.getMessage()); return new ResponseEntity<Map<String, Object>>(responseMap, HttpStatus.PRECONDITION_FAILED); } catch (Exception e) { logger.error("Exception in CartHandler::addItem. Message - {}", e.getMessage()); responseMap.put(ResponseConstants.RESPONSE, e.getMessage()); return new ResponseEntity<Map<String, Object>>(responseMap, HttpStatus.INTERNAL_SERVER_ERROR); } logger.info("CartItem added successfully to the cart, cartItemId - {}", createdCartItem.getId()); return new ResponseEntity<Map<String, Object>>(responseMap, HttpStatus.CREATED); } /** * Handler method to update an existing item in the cart * * @param cartItem * @return ResponseEntity */ public ResponseEntity<Map<String, Object>> updateItem(CartItem cartItem) { Map<String, Object> responseMap = new HashMap<>(); CartItem updatedCartItem = null; try { logger.info("Request received to update an existing item in the cart - {}", cartItem); cartRequestValidator.validateUpdateItemRequest(cartItem); updatedCartItem = cartService.updateItem(cartItem); responseMap.put(ResponseConstants.RESPONSE, ResponseConstants.UPDATE_ITEM_SUCCESS); } catch (DataNotValidException de) { logger.error("DataNotValidException occurred in CartHandler::updateItem. Message - {}", de.getMessage()); responseMap.put(ResponseConstants.RESPONSE, de.getMessage()); return new ResponseEntity<Map<String, Object>>(responseMap, HttpStatus.BAD_REQUEST); } catch (CartNotAssociatedException | ProductDoesNotExistException | CartItemDoesNotExistException ce) { logger.error( "CartNotAssociatedException/ProductDoesNotExistException/CartItemDoesNotExistException occurred in CartHandler::updateItem. Message - {}", ce.getMessage()); responseMap.put(ResponseConstants.RESPONSE, ce.getMessage()); return new ResponseEntity<Map<String, Object>>(responseMap, HttpStatus.PRECONDITION_FAILED); } catch (Exception e) { logger.error("Exception in CartHandler::updateItem. Message - {}", e.getMessage()); responseMap.put(ResponseConstants.RESPONSE, e.getMessage()); return new ResponseEntity<Map<String, Object>>(responseMap, HttpStatus.INTERNAL_SERVER_ERROR); } logger.info("CartItem updated successfully in the cart, cartItemId - {}", updatedCartItem.getId()); return new ResponseEntity<Map<String, Object>>(responseMap, HttpStatus.OK); } /** * Handler method to delete an existing item from the cart * * @param cartId * @return ResponseEntity */ public ResponseEntity<Map<String, Object>> deleteItem(int cartItemId) { Map<String, Object> responseMap = new HashMap<>(); try { logger.info("Request received to delete an item from the cart, cartItemId - {}", cartItemId); cartRequestValidator.validateDeleteCartItemRequest(cartItemId); cartService.deleteItem(cartItemId); responseMap.put(ResponseConstants.RESPONSE, ResponseConstants.DELETE_ITEM_SUCCESS); } catch (DataNotValidException de) { logger.error("DataNotValidException occurred in CartHandler::deleteItem. Message - {}", de.getMessage()); responseMap.put(ResponseConstants.RESPONSE, de.getMessage()); return new ResponseEntity<Map<String, Object>>(responseMap, HttpStatus.BAD_REQUEST); } catch (Exception e) { logger.error("Exception in CartHandler::deleteItem. Message - {}", e.getMessage()); responseMap.put(ResponseConstants.RESPONSE, e.getMessage()); return new ResponseEntity<Map<String, Object>>(responseMap, HttpStatus.INTERNAL_SERVER_ERROR); } logger.info("CartItem deleted successfully from the cart, cartItemId - {}", cartItemId); return new ResponseEntity<Map<String, Object>>(responseMap, HttpStatus.OK); } }
402877a813fa2c9af603b866ee6175f9921bac49
011b41cdc57d0eb1bdc4a4ba88d6794ec885a199
/liborrow-webinterface/liborrow-webinterface-model/src/main/java/com/liborrow/webinterface/generated/model/SaveReservations.java
4b98c7c9514be7aa75fe39300e1bef51fffbf4ac
[]
no_license
Luwin95/liborrow-P7
13c2743fe60a7e5f3f7f2805362e4badb6afaa79
d7fdc1bd7371c31fbae63d984805fb9cacd5d4fa
refs/heads/master
2020-03-14T18:08:44.463440
2018-05-31T21:30:40
2018-05-31T21:30:40
131,735,723
0
0
null
null
null
null
UTF-8
Java
false
false
1,805
java
package com.liborrow.webinterface.generated.model; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; /** * <p>Classe Java pour saveReservations complex type. * * <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe. * * <pre> * &lt;complexType name="saveReservations"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="arg0" type="{model.generated.webinterface.liborrow.com}waitingListDTO" maxOccurs="unbounded" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "saveReservations", propOrder = { "arg0" }) public class SaveReservations { protected List<WaitingListDTO> arg0; /** * Gets the value of the arg0 property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the arg0 property. * * <p> * For example, to add a new item, do as follows: * <pre> * getArg0().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link WaitingListDTO } * * */ public List<WaitingListDTO> getArg0() { if (arg0 == null) { arg0 = new ArrayList<WaitingListDTO>(); } return this.arg0; } }
87615e70712f4314d8a0b30d11eda368658d144a
28875ff9749759d4e1bb36bc4c969b0a60c96896
/app/src/androidTest/java/com/team_clicker/idlefarmer/ExampleInstrumentedTest.java
98fc3642dff70d282bc6ff19741925ffe98dd31c
[ "Apache-2.0" ]
permissive
ClickerTeam/Idle-Farmer
e0819b46c30e39912c4647b712743e0abc04c8a9
24fd0b890ecf09045ed8f17f196ce8be301a5236
refs/heads/master
2020-12-30T15:55:01.403267
2017-06-07T21:03:32
2017-06-07T21:03:32
91,186,914
0
0
null
null
null
null
UTF-8
Java
false
false
784
java
package com.team_clicker.idlefarmer; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumentation test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.team_clicker.idlefarmer", appContext.getPackageName()); } }