blob_id
stringlengths
40
40
__id__
int64
225
39,780B
directory_id
stringlengths
40
40
path
stringlengths
6
313
content_id
stringlengths
40
40
detected_licenses
list
license_type
stringclasses
2 values
repo_name
stringlengths
6
132
repo_url
stringlengths
25
151
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
70
visit_date
timestamp[ns]
revision_date
timestamp[ns]
committer_date
timestamp[ns]
github_id
int64
7.28k
689M
star_events_count
int64
0
131k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
23 values
gha_fork
bool
2 classes
gha_event_created_at
timestamp[ns]
gha_created_at
timestamp[ns]
gha_updated_at
timestamp[ns]
gha_pushed_at
timestamp[ns]
gha_size
int64
0
40.4M
gha_stargazers_count
int32
0
112k
gha_forks_count
int32
0
39.4k
gha_open_issues_count
int32
0
11k
gha_language
stringlengths
1
21
gha_archived
bool
2 classes
gha_disabled
bool
1 class
content
stringlengths
7
4.37M
src_encoding
stringlengths
3
16
language
stringclasses
1 value
length_bytes
int64
7
4.37M
extension
stringclasses
24 values
filename
stringlengths
4
174
language_id
stringclasses
1 value
entities
list
contaminating_dataset
stringclasses
0 values
malware_signatures
list
redacted_content
stringlengths
7
4.37M
redacted_length_bytes
int64
7
4.37M
alphanum_fraction
float32
0.25
0.94
alpha_fraction
float32
0.25
0.94
num_lines
int32
1
84k
avg_line_length
float32
0.76
99.9
std_line_length
float32
0
220
max_line_length
int32
5
998
is_vendor
bool
2 classes
is_generated
bool
1 class
max_hex_length
int32
0
319
hex_fraction
float32
0
0.38
max_unicode_length
int32
0
408
unicode_fraction
float32
0
0.36
max_base64_length
int32
0
506
base64_fraction
float32
0
0.5
avg_csv_sep_count
float32
0
4
is_autogen_header
bool
1 class
is_empty_html
bool
1 class
shard
stringclasses
16 values
9c689d6cb38970fda215778e756097bb74b522d2
15,685,220,601,966
650598c2049534bd55c083a397d064cafac8de61
/src/main/java/com/sivasankar/userapi/service/UserService.java
2d53541af1be969953eb67f44896db729445e94b
[]
no_license
sivasankar-r/user-api
https://github.com/sivasankar-r/user-api
78a422184918d12e8319aa9925c8cff06377d8f9
04b08dd8e6432259c2291d36ce07044624de8750
refs/heads/master
2021-08-08T21:40:25.199000
2017-11-11T09:51:42
2017-11-11T09:51:42
110,321,052
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.sivasankar.userapi.service; import java.util.ArrayList; import java.util.List; import javax.naming.OperationNotSupportedException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.sivasankar.userapi.dao.UserRepository; import com.sivasankar.userapi.framework.UserAlreadyExistException; import com.sivasankar.userapi.framework.UserNotFoundException; import com.sivasankar.userapi.model.User; @Service public class UserService { @Autowired private UserRepository userRepository; public List<User> getAllUsers() { List<User> users = new ArrayList<>(); userRepository.findAll().forEach(users::add); return users; } public User getUser(String name) { return userRepository.findOne(name); } public void addUser(User user) throws UserAlreadyExistException { User existingUser = userRepository.findOne(user.getId()); if(existingUser != null) { throw new UserAlreadyExistException("User already exist with same userId"); } User existingUserByEmail = userRepository.findByEmailAndActive(user.getEmail(), true); if(existingUserByEmail != null) { throw new UserAlreadyExistException("An active user found with same email"); } userRepository.save(user); } public void updateUser(User user) throws UserNotFoundException, OperationNotSupportedException { User existingUser = userRepository.findOne(user.getId()); if(existingUser == null) { throw new UserNotFoundException("User not found for the input userId"); } if(!existingUser.getEmail().equals(user.getEmail())) { throw new OperationNotSupportedException("Can only update pincode or birth date. Email updation not allowed."); } if(!existingUser.getfName().equals(user.getfName()) || !existingUser.getlName().equals(user.getlName())) { throw new OperationNotSupportedException("Can only update pincode or birth date. First Name or Last Name updation not allowed"); } userRepository.save(user); } public void deleteUser(String id) { userRepository.delete(id); } }
UTF-8
Java
2,076
java
UserService.java
Java
[]
null
[]
package com.sivasankar.userapi.service; import java.util.ArrayList; import java.util.List; import javax.naming.OperationNotSupportedException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.sivasankar.userapi.dao.UserRepository; import com.sivasankar.userapi.framework.UserAlreadyExistException; import com.sivasankar.userapi.framework.UserNotFoundException; import com.sivasankar.userapi.model.User; @Service public class UserService { @Autowired private UserRepository userRepository; public List<User> getAllUsers() { List<User> users = new ArrayList<>(); userRepository.findAll().forEach(users::add); return users; } public User getUser(String name) { return userRepository.findOne(name); } public void addUser(User user) throws UserAlreadyExistException { User existingUser = userRepository.findOne(user.getId()); if(existingUser != null) { throw new UserAlreadyExistException("User already exist with same userId"); } User existingUserByEmail = userRepository.findByEmailAndActive(user.getEmail(), true); if(existingUserByEmail != null) { throw new UserAlreadyExistException("An active user found with same email"); } userRepository.save(user); } public void updateUser(User user) throws UserNotFoundException, OperationNotSupportedException { User existingUser = userRepository.findOne(user.getId()); if(existingUser == null) { throw new UserNotFoundException("User not found for the input userId"); } if(!existingUser.getEmail().equals(user.getEmail())) { throw new OperationNotSupportedException("Can only update pincode or birth date. Email updation not allowed."); } if(!existingUser.getfName().equals(user.getfName()) || !existingUser.getlName().equals(user.getlName())) { throw new OperationNotSupportedException("Can only update pincode or birth date. First Name or Last Name updation not allowed"); } userRepository.save(user); } public void deleteUser(String id) { userRepository.delete(id); } }
2,076
0.771195
0.771195
65
30.938461
32.645828
131
false
false
0
0
0
0
0
0
1.615385
false
false
13
d55e872acc55555b9e524f4fdbe179298d9b4b90
29,953,101,978,496
9cdfc74d7bde18f79d673e02875a0f5ba2e804f6
/vehiclerentalsystem/src/model/Distances.java
1f4cc308752840e5aec8f96959cfb41cad7704d6
[]
no_license
donaldjohn/springsample_java
https://github.com/donaldjohn/springsample_java
c20375cf81d62ef5eab50376e55999d4ff7761ef
facc4a08032a514e42bd756caa3ac52c173ef2a1
refs/heads/master
2021-01-25T13:34:36.274000
2017-10-18T10:11:30
2017-10-18T10:11:30
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package model; public enum Distances { Pune(0), Mumbai(200), Bangalore(1000), Delhi(2050), Chennai((int) 1234.5); private int distance; Distances(int distance) { this.distance = distance; } public int getDistance() { return distance; } }
UTF-8
Java
250
java
Distances.java
Java
[]
null
[]
package model; public enum Distances { Pune(0), Mumbai(200), Bangalore(1000), Delhi(2050), Chennai((int) 1234.5); private int distance; Distances(int distance) { this.distance = distance; } public int getDistance() { return distance; } }
250
0.696
0.628
14
16.928572
19.436579
75
false
false
0
0
0
0
0
0
1.357143
false
false
13
08f7e70955c210a26c1a81f3426933892cb315dc
9,397,388,477,204
64f01e3cfbea3a31fd14dc28a042718477cb8427
/iJob/src/com/example/ifest/ProfileView.java
58b9134cc5d02a20eb0209daf5c2154564ba8f78
[]
no_license
shalinshah1993/Location-Alarm
https://github.com/shalinshah1993/Location-Alarm
503242a4cec1d6540f823ec8812bd8ab5ea648fc
07e6d39344642342418ceb028eff2f1f3c51dde7
refs/heads/master
2016-09-06T02:20:37.486000
2013-01-26T18:24:24
2013-01-26T18:24:24
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.ifest; import java.util.ArrayList; import android.os.Bundle; import android.app.AlertDialog; import android.app.Dialog; import android.app.ListActivity; import android.content.ContentValues; import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; import android.content.Intent; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.util.Log; import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.ListView; import android.widget.Spinner; import android.widget.TextView; import android.widget.TimePicker; import android.support.v4.app.NavUtils; public class ProfileView extends ListActivity{ int hour,min; TimePicker tp ; String e,e1; static int p = 0; Spinner spn ,sp1; Button b1,b2,b3,b4,b5,add,del; EditText et,et1; String str1; ArrayList<String> list = new ArrayList<String>(); ArrayAdapter<String> adapter,adapter1; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); //if(p == 0) //list.add("Create"); openDB(); p++; add = (Button) findViewById(R.id.but1_Main); del = (Button) findViewById(R.id.but2_Main); adapter = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,list); setListAdapter(adapter); add.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { final Dialog build = new Dialog(ProfileView.this); build.setTitle("String Name and Details"); build.setContentView(R.layout.activity_dialog); build.show(); spn = (Spinner)build.findViewById(R.id.spinner1_Dialog); et = (EditText) build.findViewById(R.id.editText1_Dialog); b2 = (Button) build.findViewById(R.id.button1_Dialog); //tp = (TimePicker)build.findViewById(R.id.timePicker1_Dialog); b3 = (Button)build.findViewById(R.id.button2_Dialog); //tp.setIs24HourView(true); //tp.setCurrentMinute(00); b2.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { build.dismiss(); //hour = tp.getCurrentHour(); //min = tp.getCurrentMinute(); list.add(et.getText().toString()); addDB(et.getText().toString(),spn.getLastVisiblePosition()); adapter.notifyDataSetChanged(); setListAdapter(adapter); } }); b3.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { build.dismiss(); } }); } }); del.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { final Dialog d = new Dialog(ProfileView.this); d.setTitle("Delete Event"); d.setContentView(R.layout.activity_dialog2); b4 = (Button) d.findViewById(R.id.button1_Dialog2); sp1 = (Spinner) d.findViewById(R.id.spinner1_Dialog2); b5 = (Button) d.findViewById(R.id.button2_Dialog2); adapter1 = new ArrayAdapter<String>(ProfileView.this,android.R.layout.simple_spinner_dropdown_item,list); sp1.setAdapter(adapter1); d.show(); b4.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { d.dismiss(); ////Logd.d("Index", " " + sp1.getLastVisiblePosition()); ////Logd.d("Index", " " + list.get(sp1.getLastVisiblePosition())); DBHandler handler = new DBHandler(ProfileView.this); SQLiteDatabase db = handler.getWritableDatabase(); Cursor c = db.rawQuery("SELECT * FROM "+ "_table",null); c.moveToFirst(); ////Logd.d("cur", c.getString(1)); while(!c.getString(1).equals(list.get(sp1.getLastVisiblePosition()))){ c.moveToNext(); ////Logd.d("cur", c.getString(1)); ////Logd.d("yes/no",""+c.getString(1).equals(list.get(sp1.getLastVisiblePosition()))); } db.delete("_table" , "_no =" + c.getInt(0), null); c.close(); db.close(); list.remove(list.get(sp1.getLastVisiblePosition())); adapter.notifyDataSetChanged(); setListAdapter(adapter); //openDB(); } }); b5.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { d.dismiss(); } }); } }); } @Override protected void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); DBHandler handler = new DBHandler(this); SQLiteDatabase db = handler.getReadableDatabase(); Cursor c = db.query("_table", new String[]{"_no","_name","_type"}, null, null, null, null, null); c.moveToFirst(); while(position != 0){ c.moveToNext(); position--; } //Logd.d("ID", c.getString(0)); Bundle bb = new Bundle(); bb.putInt("id",c.getInt(0)); bb.putString("name", c.getString(1)); bb.putString("type", c.getString(2)); //bb.putInt("hour", c.getInt(3)); //bb.putInt("minute", c.getInt(4)); ////Logd.d("column no", c.getString(1)); c.close(); db.close(); Intent ix = new Intent("com.example.ifest.ALARM"); ix.putExtras(bb); startActivity(ix); } protected void addDB(String name,int id) { DBHandler handle = new DBHandler(this); SQLiteDatabase db = handle.getWritableDatabase(); ContentValues cv = new ContentValues(); cv.put("_name",name); if(id == 0) cv.put("_type","WIFI"); else if(id == 1) cv.put("_type","BLUETOOTH"); else if(id == 2) cv.put("_type","MEDIA"); else if(id == 3) cv.put("_type", "ALARM"); //cv.put("_hour", h); //cv.put("_min", m); db.insert("_table", null , cv); db.close(); } private void openDB() { DBHandler handle = new DBHandler(this); SQLiteDatabase db = handle.getReadableDatabase(); if(p != 0){ Cursor c = db.rawQuery("SELECT * FROM "+ "_table",null); c.moveToFirst(); list.add(c.getString(1)); //Logd.d("cursor", c.getString(1)); while(c.moveToNext()){ list.add(c.getString(1)); //Logd.d("cursor", c.getString(1)); } c.close(); //Logd.d("open/close",""+db.isOpen()); db.close(); //Logd.d("open/close",""+db.isOpen()); }/*else{ Dialog d = new Dialog(this); d.setTitle("Intro to the app!"); d.setContentView(R.layout.activity_dialog3); d.show(); }*/ } @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater mi = getMenuInflater(); mi.inflate(R.menu.activity_main, menu); return true; } @Override public boolean onMenuItemSelected(int featureId, MenuItem item) { switch(item.getItemId()){ case R.id.item1: final Dialog build = new Dialog(ProfileView.this); build.setTitle("String Name and Details"); build.setContentView(R.layout.activity_dialog); build.show(); spn = (Spinner)build.findViewById(R.id.spinner1_Dialog); et = (EditText) build.findViewById(R.id.editText1_Dialog); b2 = (Button) build.findViewById(R.id.button1_Dialog); //tp = (TimePicker)build.findViewById(R.id.timePicker1_Dialog); b3 = (Button)build.findViewById(R.id.button2_Dialog); //tp.setIs24HourView(true); //tp.setCurrentMinute(00); b2.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { build.dismiss(); //hour = tp.getCurrentHour(); //min = tp.getCurrentMinute(); list.add(et.getText().toString()); addDB(et.getText().toString(),spn.getLastVisiblePosition()); adapter.notifyDataSetChanged(); setListAdapter(adapter); } }); b3.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { build.dismiss(); } }); break; case R.id.item2: final Dialog d = new Dialog(this); d.setTitle("Delete Event"); d.setContentView(R.layout.activity_dialog2); b4 = (Button) d.findViewById(R.id.button1_Dialog2); sp1 = (Spinner) d.findViewById(R.id.spinner1_Dialog2); b5 = (Button) d.findViewById(R.id.button2_Dialog2); adapter1 = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_dropdown_item,list); sp1.setAdapter(adapter1); d.show(); b4.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { d.dismiss(); //list.remove(list.indexOf(et1.getText().toString())); //Logd.d("Index" , list.get(sp1.getLastVisiblePosition())); DBHandler handler = new DBHandler(ProfileView.this); SQLiteDatabase db = handler.getWritableDatabase(); Cursor c = db.rawQuery("SELECT * FROM "+ "_table",null); c.moveToFirst(); ////Logd.d("cur", c.getString(1)); while(!c.getString(1).equals(list.get(sp1.getLastVisiblePosition()))){ c.moveToNext(); //Logd.d("cur", c.getString(1)); //Logd.d("yes/no",""+c.getString(1).equals(list.get(sp1.getLastVisiblePosition()))); } db.delete("_table" , "_no =" + c.getInt(0), null); c.close(); list.remove(list.get(sp1.getLastVisiblePosition())); adapter.notifyDataSetChanged(); setListAdapter(adapter); } }); b5.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { d.dismiss(); } }); break; case R.id.item3: Intent i = new Intent("com.example.ifest.ABOUTUS"); startActivity(i); break; case R.id.item4: AlertDialog.Builder b = new AlertDialog.Builder(this); b.setTitle("Exit"); b.setMessage("Are you sure you want to exit?"); b.setCancelable(true); b.setPositiveButton("Yes", new OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); finish(); } }); b.setNegativeButton("No", new OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); AlertDialog ad = b.create(); ad.show(); break; } return true; } }
UTF-8
Java
10,385
java
ProfileView.java
Java
[]
null
[]
package com.example.ifest; import java.util.ArrayList; import android.os.Bundle; import android.app.AlertDialog; import android.app.Dialog; import android.app.ListActivity; import android.content.ContentValues; import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; import android.content.Intent; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.util.Log; import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.ListView; import android.widget.Spinner; import android.widget.TextView; import android.widget.TimePicker; import android.support.v4.app.NavUtils; public class ProfileView extends ListActivity{ int hour,min; TimePicker tp ; String e,e1; static int p = 0; Spinner spn ,sp1; Button b1,b2,b3,b4,b5,add,del; EditText et,et1; String str1; ArrayList<String> list = new ArrayList<String>(); ArrayAdapter<String> adapter,adapter1; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); //if(p == 0) //list.add("Create"); openDB(); p++; add = (Button) findViewById(R.id.but1_Main); del = (Button) findViewById(R.id.but2_Main); adapter = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,list); setListAdapter(adapter); add.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { final Dialog build = new Dialog(ProfileView.this); build.setTitle("String Name and Details"); build.setContentView(R.layout.activity_dialog); build.show(); spn = (Spinner)build.findViewById(R.id.spinner1_Dialog); et = (EditText) build.findViewById(R.id.editText1_Dialog); b2 = (Button) build.findViewById(R.id.button1_Dialog); //tp = (TimePicker)build.findViewById(R.id.timePicker1_Dialog); b3 = (Button)build.findViewById(R.id.button2_Dialog); //tp.setIs24HourView(true); //tp.setCurrentMinute(00); b2.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { build.dismiss(); //hour = tp.getCurrentHour(); //min = tp.getCurrentMinute(); list.add(et.getText().toString()); addDB(et.getText().toString(),spn.getLastVisiblePosition()); adapter.notifyDataSetChanged(); setListAdapter(adapter); } }); b3.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { build.dismiss(); } }); } }); del.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { final Dialog d = new Dialog(ProfileView.this); d.setTitle("Delete Event"); d.setContentView(R.layout.activity_dialog2); b4 = (Button) d.findViewById(R.id.button1_Dialog2); sp1 = (Spinner) d.findViewById(R.id.spinner1_Dialog2); b5 = (Button) d.findViewById(R.id.button2_Dialog2); adapter1 = new ArrayAdapter<String>(ProfileView.this,android.R.layout.simple_spinner_dropdown_item,list); sp1.setAdapter(adapter1); d.show(); b4.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { d.dismiss(); ////Logd.d("Index", " " + sp1.getLastVisiblePosition()); ////Logd.d("Index", " " + list.get(sp1.getLastVisiblePosition())); DBHandler handler = new DBHandler(ProfileView.this); SQLiteDatabase db = handler.getWritableDatabase(); Cursor c = db.rawQuery("SELECT * FROM "+ "_table",null); c.moveToFirst(); ////Logd.d("cur", c.getString(1)); while(!c.getString(1).equals(list.get(sp1.getLastVisiblePosition()))){ c.moveToNext(); ////Logd.d("cur", c.getString(1)); ////Logd.d("yes/no",""+c.getString(1).equals(list.get(sp1.getLastVisiblePosition()))); } db.delete("_table" , "_no =" + c.getInt(0), null); c.close(); db.close(); list.remove(list.get(sp1.getLastVisiblePosition())); adapter.notifyDataSetChanged(); setListAdapter(adapter); //openDB(); } }); b5.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { d.dismiss(); } }); } }); } @Override protected void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); DBHandler handler = new DBHandler(this); SQLiteDatabase db = handler.getReadableDatabase(); Cursor c = db.query("_table", new String[]{"_no","_name","_type"}, null, null, null, null, null); c.moveToFirst(); while(position != 0){ c.moveToNext(); position--; } //Logd.d("ID", c.getString(0)); Bundle bb = new Bundle(); bb.putInt("id",c.getInt(0)); bb.putString("name", c.getString(1)); bb.putString("type", c.getString(2)); //bb.putInt("hour", c.getInt(3)); //bb.putInt("minute", c.getInt(4)); ////Logd.d("column no", c.getString(1)); c.close(); db.close(); Intent ix = new Intent("com.example.ifest.ALARM"); ix.putExtras(bb); startActivity(ix); } protected void addDB(String name,int id) { DBHandler handle = new DBHandler(this); SQLiteDatabase db = handle.getWritableDatabase(); ContentValues cv = new ContentValues(); cv.put("_name",name); if(id == 0) cv.put("_type","WIFI"); else if(id == 1) cv.put("_type","BLUETOOTH"); else if(id == 2) cv.put("_type","MEDIA"); else if(id == 3) cv.put("_type", "ALARM"); //cv.put("_hour", h); //cv.put("_min", m); db.insert("_table", null , cv); db.close(); } private void openDB() { DBHandler handle = new DBHandler(this); SQLiteDatabase db = handle.getReadableDatabase(); if(p != 0){ Cursor c = db.rawQuery("SELECT * FROM "+ "_table",null); c.moveToFirst(); list.add(c.getString(1)); //Logd.d("cursor", c.getString(1)); while(c.moveToNext()){ list.add(c.getString(1)); //Logd.d("cursor", c.getString(1)); } c.close(); //Logd.d("open/close",""+db.isOpen()); db.close(); //Logd.d("open/close",""+db.isOpen()); }/*else{ Dialog d = new Dialog(this); d.setTitle("Intro to the app!"); d.setContentView(R.layout.activity_dialog3); d.show(); }*/ } @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater mi = getMenuInflater(); mi.inflate(R.menu.activity_main, menu); return true; } @Override public boolean onMenuItemSelected(int featureId, MenuItem item) { switch(item.getItemId()){ case R.id.item1: final Dialog build = new Dialog(ProfileView.this); build.setTitle("String Name and Details"); build.setContentView(R.layout.activity_dialog); build.show(); spn = (Spinner)build.findViewById(R.id.spinner1_Dialog); et = (EditText) build.findViewById(R.id.editText1_Dialog); b2 = (Button) build.findViewById(R.id.button1_Dialog); //tp = (TimePicker)build.findViewById(R.id.timePicker1_Dialog); b3 = (Button)build.findViewById(R.id.button2_Dialog); //tp.setIs24HourView(true); //tp.setCurrentMinute(00); b2.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { build.dismiss(); //hour = tp.getCurrentHour(); //min = tp.getCurrentMinute(); list.add(et.getText().toString()); addDB(et.getText().toString(),spn.getLastVisiblePosition()); adapter.notifyDataSetChanged(); setListAdapter(adapter); } }); b3.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { build.dismiss(); } }); break; case R.id.item2: final Dialog d = new Dialog(this); d.setTitle("Delete Event"); d.setContentView(R.layout.activity_dialog2); b4 = (Button) d.findViewById(R.id.button1_Dialog2); sp1 = (Spinner) d.findViewById(R.id.spinner1_Dialog2); b5 = (Button) d.findViewById(R.id.button2_Dialog2); adapter1 = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_dropdown_item,list); sp1.setAdapter(adapter1); d.show(); b4.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { d.dismiss(); //list.remove(list.indexOf(et1.getText().toString())); //Logd.d("Index" , list.get(sp1.getLastVisiblePosition())); DBHandler handler = new DBHandler(ProfileView.this); SQLiteDatabase db = handler.getWritableDatabase(); Cursor c = db.rawQuery("SELECT * FROM "+ "_table",null); c.moveToFirst(); ////Logd.d("cur", c.getString(1)); while(!c.getString(1).equals(list.get(sp1.getLastVisiblePosition()))){ c.moveToNext(); //Logd.d("cur", c.getString(1)); //Logd.d("yes/no",""+c.getString(1).equals(list.get(sp1.getLastVisiblePosition()))); } db.delete("_table" , "_no =" + c.getInt(0), null); c.close(); list.remove(list.get(sp1.getLastVisiblePosition())); adapter.notifyDataSetChanged(); setListAdapter(adapter); } }); b5.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { d.dismiss(); } }); break; case R.id.item3: Intent i = new Intent("com.example.ifest.ABOUTUS"); startActivity(i); break; case R.id.item4: AlertDialog.Builder b = new AlertDialog.Builder(this); b.setTitle("Exit"); b.setMessage("Are you sure you want to exit?"); b.setCancelable(true); b.setPositiveButton("Yes", new OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); finish(); } }); b.setNegativeButton("No", new OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); AlertDialog ad = b.create(); ad.show(); break; } return true; } }
10,385
0.631777
0.620799
329
30.56535
21.542976
109
false
false
0
0
0
0
0
0
3.75076
false
false
13
6be94a8c4b312e1a4f6021b1f48ade96dd10c6b3
1,056,561,958,807
aec4c089f639ea63a63457febcd53255bb7bb723
/src/main/java/idv/heimlich/Task/common/utils/FreeMarkerUtils.java
6e690888c06c451e393a60d15ae1557fe28d72a4
[]
no_license
HeimlichLin/Task
https://github.com/HeimlichLin/Task
29532e654d2b37688fa38b41b76d1eb7da3af4e7
8edb7e25058f7561926c4b475ee74a43ee0c99fd
refs/heads/main
2023-08-10T16:31:30.307000
2021-10-01T06:42:56
2021-10-01T06:42:56
412,357,293
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package idv.heimlich.Task.common.utils; import java.io.File; import java.io.IOException; import java.io.StringWriter; import java.io.Writer; import java.util.Locale; import java.util.Map; import freemarker.template.Configuration; import freemarker.template.Template; import freemarker.template.TemplateException; import idv.heimlich.Task.common.exception.ApBusinessException; public class FreeMarkerUtils { public static String getTemplate(final String ftlName, final Map<String, ?> map) { final String dir = "/APCLMS/CLASS/ftl"; final Configuration conf = new Configuration(Configuration.VERSION_2_3_0); try { conf.setDirectoryForTemplateLoading(new File(dir)); conf.setEncoding(Locale.TAIWAN, "UTF-8"); final Template template = conf.getTemplate(ftlName); try (Writer writer = new StringWriter()) { try { template.process(map, writer); } catch (final TemplateException e) { throw new ApBusinessException("樣板錯誤" + ftlName, e); } return writer.toString(); } } catch (final IOException e) { throw new ApBusinessException("資料夾不存在:" + dir + " name:" + ftlName, e); } } public static void getTemplate(final String ftlName, final Map<String, ?> map, final Writer writer) throws TemplateException { final String dir = "\\APCLMS\\CLASS\\ftl"; final Configuration conf = new Configuration(Configuration.VERSION_2_3_0); try { conf.setDirectoryForTemplateLoading(new File(dir)); conf.setEncoding(Locale.TAIWAN, "UTF-8"); final Template template = conf.getTemplate(ftlName); template.process(map, writer); } catch (final TemplateException e) { throw new ApBusinessException("樣板異常" + ftlName, e); } catch (final IOException e) { throw new ApBusinessException("資料夾不存在:" + dir, e); } } // == [Method] Block Stop // ================================================ // == [Inner Class] Block Start // == [Inner Class] Block Stop // ================================================ }
UTF-8
Java
2,011
java
FreeMarkerUtils.java
Java
[]
null
[]
package idv.heimlich.Task.common.utils; import java.io.File; import java.io.IOException; import java.io.StringWriter; import java.io.Writer; import java.util.Locale; import java.util.Map; import freemarker.template.Configuration; import freemarker.template.Template; import freemarker.template.TemplateException; import idv.heimlich.Task.common.exception.ApBusinessException; public class FreeMarkerUtils { public static String getTemplate(final String ftlName, final Map<String, ?> map) { final String dir = "/APCLMS/CLASS/ftl"; final Configuration conf = new Configuration(Configuration.VERSION_2_3_0); try { conf.setDirectoryForTemplateLoading(new File(dir)); conf.setEncoding(Locale.TAIWAN, "UTF-8"); final Template template = conf.getTemplate(ftlName); try (Writer writer = new StringWriter()) { try { template.process(map, writer); } catch (final TemplateException e) { throw new ApBusinessException("樣板錯誤" + ftlName, e); } return writer.toString(); } } catch (final IOException e) { throw new ApBusinessException("資料夾不存在:" + dir + " name:" + ftlName, e); } } public static void getTemplate(final String ftlName, final Map<String, ?> map, final Writer writer) throws TemplateException { final String dir = "\\APCLMS\\CLASS\\ftl"; final Configuration conf = new Configuration(Configuration.VERSION_2_3_0); try { conf.setDirectoryForTemplateLoading(new File(dir)); conf.setEncoding(Locale.TAIWAN, "UTF-8"); final Template template = conf.getTemplate(ftlName); template.process(map, writer); } catch (final TemplateException e) { throw new ApBusinessException("樣板異常" + ftlName, e); } catch (final IOException e) { throw new ApBusinessException("資料夾不存在:" + dir, e); } } // == [Method] Block Stop // ================================================ // == [Inner Class] Block Start // == [Inner Class] Block Stop // ================================================ }
2,011
0.682902
0.678843
60
31.85
24.386353
100
false
false
0
0
0
0
0
0
2.283333
false
false
13
c57639c94b14cff28e06fb4bb47b00485f56323e
2,903,397,942,374
c256647f50cb3fe21dc304245e81637d47c38afd
/app/src/main/java/net/mikael/aiworicheditor/CheckImageView.java
4a3d10ba5e1a7ac2ed4ecb9d4d0f8f537badf09d
[]
no_license
MikaelZero/AiwoEditor
https://github.com/MikaelZero/AiwoEditor
f3d54a0bb0082ad70454908bb96b1bec06ccdfb0
28c9f0da8f3f51a19fccd56a7c62c9fb4b147d6d
refs/heads/master
2022-04-22T04:41:27.115000
2020-04-17T03:04:19
2020-04-17T03:04:19
256,383,796
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package net.mikael.aiworicheditor; import android.content.Context; import android.graphics.Color; import android.util.AttributeSet; import androidx.annotation.Nullable; import androidx.appcompat.widget.AppCompatImageView; /** * @ProjectName: cosmetology * @Package: com.jingrui.cosmetology.pcommunity.posteditor * @ClassName: CheckImageView * @Description: * @Author: MikaelZero * @CreateDate: 2020/3/29 7:15 PM * @UpdateUser: 更新者: * @UpdateDate: 2020/3/29 7:15 PM * @UpdateRemark: 更新说明: * @Version: 1.0 */ public class CheckImageView extends AppCompatImageView { private int checkColor = Color.parseColor("#5B59DF"); private int unCheckColor = Color.parseColor("#1C1C1F"); public CheckImageView(Context context) { super(context); } public CheckImageView(Context context, @Nullable AttributeSet attrs) { super(context, attrs); } public CheckImageView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } boolean isCheck = false; public void setCheck(boolean check) { isCheck = check; setColorFilter(check ? checkColor : unCheckColor); } public boolean isCheck() { return isCheck; } }
UTF-8
Java
1,276
java
CheckImageView.java
Java
[ { "context": "sName: CheckImageView\n * @Description:\n * @Author: MikaelZero\n * @CreateDate: 2020/3/29 7:15 PM\n * @UpdateUser:", "end": 386, "score": 0.9994158744812012, "start": 376, "tag": "USERNAME", "value": "MikaelZero" } ]
null
[]
package net.mikael.aiworicheditor; import android.content.Context; import android.graphics.Color; import android.util.AttributeSet; import androidx.annotation.Nullable; import androidx.appcompat.widget.AppCompatImageView; /** * @ProjectName: cosmetology * @Package: com.jingrui.cosmetology.pcommunity.posteditor * @ClassName: CheckImageView * @Description: * @Author: MikaelZero * @CreateDate: 2020/3/29 7:15 PM * @UpdateUser: 更新者: * @UpdateDate: 2020/3/29 7:15 PM * @UpdateRemark: 更新说明: * @Version: 1.0 */ public class CheckImageView extends AppCompatImageView { private int checkColor = Color.parseColor("#5B59DF"); private int unCheckColor = Color.parseColor("#1C1C1F"); public CheckImageView(Context context) { super(context); } public CheckImageView(Context context, @Nullable AttributeSet attrs) { super(context, attrs); } public CheckImageView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } boolean isCheck = false; public void setCheck(boolean check) { isCheck = check; setColorFilter(check ? checkColor : unCheckColor); } public boolean isCheck() { return isCheck; } }
1,276
0.705087
0.68283
49
24.67347
22.339119
92
false
false
0
0
0
0
0
0
0.428571
false
false
13
51f202ce23db09c976d50204a0697b42b852dae8
17,995,912,995,173
fed066954f94b3ee8b8f8fd24a0edebe63ee411c
/chat-v1/src/main/java/ic/playground/chat/Endpoints.java
5ff1c553d208bb2daa96fe6b5ef5bce5359dbc4a
[]
no_license
ichytov/client-server-communication
https://github.com/ichytov/client-server-communication
2125d365561d513b74568985a834c451745b5b16
3697bfd57dc8b7fb3baf31718d6af631ae2c2330
refs/heads/master
2020-03-14T06:22:27.328000
2018-08-27T14:13:18
2018-08-27T14:13:18
131,482,474
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package ic.playground.chat; /** * @author igor.chytov */ public abstract class Endpoints { public static final String AJAX = "/chat/ajax"; public static final String WEBSOCKET = "/chat/websocket"; public static final String SOCKJS = "/chat/sockjs"; public static final String STOMP = "/chat/stomp"; public static final String SSE = "/chat/sse"; }
UTF-8
Java
369
java
Endpoints.java
Java
[ { "context": "package ic.playground.chat;\n\n/**\n * @author igor.chytov\n */\npublic abstract class Endpoints {\n public ", "end": 55, "score": 0.9320260286331177, "start": 44, "tag": "NAME", "value": "igor.chytov" } ]
null
[]
package ic.playground.chat; /** * @author igor.chytov */ public abstract class Endpoints { public static final String AJAX = "/chat/ajax"; public static final String WEBSOCKET = "/chat/websocket"; public static final String SOCKJS = "/chat/sockjs"; public static final String STOMP = "/chat/stomp"; public static final String SSE = "/chat/sse"; }
369
0.693767
0.693767
12
29.833334
22.726025
61
false
false
0
0
0
0
0
0
0.5
false
false
13
5f030ee37f2585fcc6648bb1e378601a6330bbf7
13,297,218,787,671
9792d173df65ff2e5d25066688cfa1310050cea0
/src/main/java/creational/builder_v2/Juice.java
2b51f784fdca867e0e7bbdd05be050ea3d64425b
[ "MIT" ]
permissive
alexshavlovsky/java-design-patterns
https://github.com/alexshavlovsky/java-design-patterns
dda2a8e8b19bd13cd0c5dfab69558dea703232c3
248fea9f845cbe9c6dbd2928882292eeb355fc34
refs/heads/master
2020-12-12T18:12:58.329000
2020-03-15T20:14:54
2020-03-21T19:32:26
234,194,456
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package creational.builder_v2; public class Juice implements Item { @Override public String getItemName() { return "Juice"; } @Override public double getItemPrice() { return 1.25; } }
UTF-8
Java
226
java
Juice.java
Java
[ { "context": " public String getItemName() {\n return \"Juice\";\n }\n\n @Override\n public double getIt", "end": 135, "score": 0.5144271850585938, "start": 133, "tag": "NAME", "value": "Ju" } ]
null
[]
package creational.builder_v2; public class Juice implements Item { @Override public String getItemName() { return "Juice"; } @Override public double getItemPrice() { return 1.25; } }
226
0.615044
0.597345
13
16.384615
13.211524
36
false
false
0
0
0
0
0
0
0.230769
false
false
13
5528a7f2209cb538d3b780add17cc98d444bbeed
22,548,578,343,022
7f121e964c9cd22874aa59602a4bf866d196f388
/src/main/java/com/exalow/mineo/models/projects/tasks/TaskStatus.java
865442116d14c113ffcd532314c940f5e1288d79
[]
no_license
Exalow/Mineo-Client
https://github.com/Exalow/Mineo-Client
43fdaf1070fb8889a980586166de043bc6619675
edcec136c07bf79acdf620b1a8d4b57a2c3d5e4d
refs/heads/main
2023-07-29T11:19:31.074000
2021-09-02T20:02:37
2021-09-02T20:02:37
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.exalow.mineo.models.projects.tasks; import java.util.Arrays; public enum TaskStatus { UNKNOWN(-1, "#7F8C8D"), WAITING(0, ""), ACTIVE(1, ""), COMPLETED(2, ""), ARCHIVED(3, ""); private final int key; private final String color; TaskStatus(int key, String color) { this.key = key; this.color = color; } public static TaskStatus fromKey(int key) { return Arrays.stream(values()) .filter(status -> status.key == key) .findAny() .orElse(UNKNOWN); } public int getKey() { return key; } public String getColor() { return color; } }
UTF-8
Java
697
java
TaskStatus.java
Java
[]
null
[]
package com.exalow.mineo.models.projects.tasks; import java.util.Arrays; public enum TaskStatus { UNKNOWN(-1, "#7F8C8D"), WAITING(0, ""), ACTIVE(1, ""), COMPLETED(2, ""), ARCHIVED(3, ""); private final int key; private final String color; TaskStatus(int key, String color) { this.key = key; this.color = color; } public static TaskStatus fromKey(int key) { return Arrays.stream(values()) .filter(status -> status.key == key) .findAny() .orElse(UNKNOWN); } public int getKey() { return key; } public String getColor() { return color; } }
697
0.542324
0.530846
39
16.871796
15.59122
52
false
false
0
0
0
0
0
0
0.512821
false
false
13
0cd39820f016f15839192195ad40e0f11342daab
21,861,383,564,714
e266a2bc896193e77d9e05f34b48295f41170ed0
/src/main/java/employee/Application.java
809db7094ae78195216c47196ef329a51456eb17
[]
no_license
saadhashim/javafortestaresolutions
https://github.com/saadhashim/javafortestaresolutions
8214cc72d531119441985adaf7dae9338eba9156
092bf06acb073aba41e8704ba68c782fe200072a
refs/heads/master
2020-04-06T06:54:39.889000
2016-09-20T12:22:56
2016-09-20T12:22:56
64,539,468
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package employee; import employee.impl.EmployeeApplicaton; public class Application { public static void main(String[] args) { EmployeeService employeeService = new EmployeeApplicaton(); //do something useful with employeeService } }
UTF-8
Java
274
java
Application.java
Java
[]
null
[]
package employee; import employee.impl.EmployeeApplicaton; public class Application { public static void main(String[] args) { EmployeeService employeeService = new EmployeeApplicaton(); //do something useful with employeeService } }
274
0.693431
0.693431
12
20.833334
22.926815
67
false
false
0
0
0
0
0
0
0.25
false
false
13
1c8b803f2aaf96c621c6ed2a5f3dfd6495932a8e
12,025,908,429,339
25c2c886c7923304787758fec1c77ba3c85ef2ee
/driver.java
bfac6353638f51029a834690ed21619b0f36a767
[]
no_license
sabeet/integersToArray
https://github.com/sabeet/integersToArray
fb89016900d78bf510797e3804a94738d72616f3
8691b6abf124583ea9f62fdac415175827d092fe
refs/heads/main
2023-01-10T12:20:11.939000
2020-11-14T21:18:56
2020-11-14T21:18:56
312,893,598
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
import java.util.Arrays; public class driver { public static void main(String[] args) { System.out.println(Arrays.toString(digitsToArray(3000))); } public static int digitCount(int digits){ //this counts digits int count = 0; while(!(digits < 1)){ digits /= 10; count++; } return count; } public static int[] digitsToArray(int digits){ //for the length of the digits, add each digit into the array int arr[] = new int[digitCount(digits)]; for(int i = 0; i <= digitCount(digits) - 1; i++ ) { arr[i] = Integer.parseInt(Integer.toString(digits).substring(i, i+1));; } return arr; } }
UTF-8
Java
723
java
driver.java
Java
[]
null
[]
import java.util.Arrays; public class driver { public static void main(String[] args) { System.out.println(Arrays.toString(digitsToArray(3000))); } public static int digitCount(int digits){ //this counts digits int count = 0; while(!(digits < 1)){ digits /= 10; count++; } return count; } public static int[] digitsToArray(int digits){ //for the length of the digits, add each digit into the array int arr[] = new int[digitCount(digits)]; for(int i = 0; i <= digitCount(digits) - 1; i++ ) { arr[i] = Integer.parseInt(Integer.toString(digits).substring(i, i+1));; } return arr; } }
723
0.565699
0.550484
25
27.959999
24.750725
83
false
false
0
0
0
0
0
0
0.56
false
false
13
97adbced6073ed5ab6ae9e9d5a20addb8ff6d844
1,443,109,039,363
81137789c746d398be32d13efbbb4379f2bee661
/easyuse/src/main/java/com/cai/easyuse/hybrid/example/BuiDefaultInvokeHandler.java
cb1281a1b3af809f073d7ccf7a0df168e8b45ee8
[ "Apache-2.0" ]
permissive
cailingxiao/easyuse
https://github.com/cailingxiao/easyuse
756c19e4f3fbb0d33aa3d8d78c47c5977d3aa85b
d4c5355d12faa253d8189864a68fbc4bdbac9147
refs/heads/master
2021-09-02T12:01:52.881000
2018-01-02T12:14:02
2018-01-02T12:14:02
109,077,300
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.cai.easyuse.hybrid.example; import org.json.JSONObject; import com.cai.easyuse.hybrid.annotation.H5CallNa; import android.content.Context; /** * 处理H5发起的请求的类的例子 * <p> * 请仿照这个文件写出方法,方法名不重要,请按照注解配置,方法一定要有这两个参数 * <p> * 将处理请求的类的全名(包名+类名)写在assets根目录下的handler文件中 * <p> * {"defaultHandler":"com.cai.easyuse.hybrid.example.BuiDefaultInvokeHandler"} * 其中,com.cai.easyuse.hybrid.example.BuiDefaultInvokeHandler就是处理类 * * @author cailingxiao * @date 2016年3月3日 * */ public final class BuiDefaultInvokeHandler { private static final String TAG = "BuiDefaultInvokeHandler"; public BuiDefaultInvokeHandler() { } @H5CallNa(invokeName = "default") public String doExample1(Context ctx, JSONObject args) { System.out.println("this is the default handle from " + TAG); return "default" + TAG; } @H5CallNa(invokeName = "test") public String doExample(Context ctx, JSONObject args) { System.out.println("please use a new file to handle request!" + TAG); return "test" + TAG; } }
UTF-8
Java
1,232
java
BuiDefaultInvokeHandler.java
Java
[ { "context": "xample.BuiDefaultInvokeHandler就是处理类\n * \n * @author cailingxiao\n * @date 2016年3月3日\n * \n */\npublic final class Bui", "end": 455, "score": 0.9994557499885559, "start": 444, "tag": "USERNAME", "value": "cailingxiao" } ]
null
[]
package com.cai.easyuse.hybrid.example; import org.json.JSONObject; import com.cai.easyuse.hybrid.annotation.H5CallNa; import android.content.Context; /** * 处理H5发起的请求的类的例子 * <p> * 请仿照这个文件写出方法,方法名不重要,请按照注解配置,方法一定要有这两个参数 * <p> * 将处理请求的类的全名(包名+类名)写在assets根目录下的handler文件中 * <p> * {"defaultHandler":"com.cai.easyuse.hybrid.example.BuiDefaultInvokeHandler"} * 其中,com.cai.easyuse.hybrid.example.BuiDefaultInvokeHandler就是处理类 * * @author cailingxiao * @date 2016年3月3日 * */ public final class BuiDefaultInvokeHandler { private static final String TAG = "BuiDefaultInvokeHandler"; public BuiDefaultInvokeHandler() { } @H5CallNa(invokeName = "default") public String doExample1(Context ctx, JSONObject args) { System.out.println("this is the default handle from " + TAG); return "default" + TAG; } @H5CallNa(invokeName = "test") public String doExample(Context ctx, JSONObject args) { System.out.println("please use a new file to handle request!" + TAG); return "test" + TAG; } }
1,232
0.70283
0.692453
41
24.853659
24.798269
78
false
false
0
0
0
0
0
0
0.292683
false
false
13
c6f0786ce311e49f2003820b96a9633b829c575d
18,279,380,835,971
f1b5562455aaa608ae13f2141c4c0e153262b34a
/app/src/main/java/vn/minhtdh/demo/feature/user/UserAdapter.java
0339ea2614dfcfced7a78d37d6d1cb6b6fae1bd1
[]
no_license
minhtdh/MedicalConferences
https://github.com/minhtdh/MedicalConferences
f525fb4f58cace525d60ce70bfcb481d91a7b49b
524720c7c8810633c6cc568e099040f1a5aeb9f8
refs/heads/master
2021-01-10T20:08:17.219000
2015-08-25T09:13:42
2015-08-25T09:13:42
41,262,877
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package vn.minhtdh.demo.feature.user; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.BaseAdapter; import vn.minhtdh.demo.model.User; import vn.minhtdh.demo.widget.CmnAdt; import vn.minhtdh.demo.widget.SimpleHolder; /** * Created by exoplatform on 8/25/15. */ public class UserAdapter extends CmnAdt.SimpleAdt<User> { @Override public void onBindViewHolder(SimpleHolder holder, int position) { User user = getItem(position); holder.mTv.setText(user == null? null : user.userMail); } }
UTF-8
Java
622
java
UserAdapter.java
Java
[ { "context": "nhtdh.demo.widget.SimpleHolder;\n\n/**\n * Created by exoplatform on 8/25/15.\n */\npublic class UserAdapter extends ", "end": 351, "score": 0.9978632926940918, "start": 340, "tag": "USERNAME", "value": "exoplatform" } ]
null
[]
package vn.minhtdh.demo.feature.user; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.BaseAdapter; import vn.minhtdh.demo.model.User; import vn.minhtdh.demo.widget.CmnAdt; import vn.minhtdh.demo.widget.SimpleHolder; /** * Created by exoplatform on 8/25/15. */ public class UserAdapter extends CmnAdt.SimpleAdt<User> { @Override public void onBindViewHolder(SimpleHolder holder, int position) { User user = getItem(position); holder.mTv.setText(user == null? null : user.userMail); } }
622
0.750804
0.742765
23
26.043478
21.140274
69
false
false
0
0
0
0
0
0
0.521739
false
false
13
4426b6fc0b5cbce7e131cd4ccc3ab8c31f82393d
4,217,657,909,546
5df42045d4b8d96abb196bd0597fdb4e48fec6e3
/src/interfaces/MyContextTask.java
18494b91c15da0f2052a9ab19f5e02d9efaffa0c
[]
no_license
Ruandv/Java
https://github.com/Ruandv/Java
e45d0f41352ef0df41acf8ace00be517c332f6bd
5356cb0542ac81b78482ffbedba7dae1121101f3
refs/heads/master
2016-09-06T16:29:53.825000
2013-09-23T07:02:49
2013-09-23T07:02:49
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package interfaces; import android.os.Handler; public abstract class MyContextTask //extends TimerTask { Handler handler; protected Runnable runnable; public MyContextTask(Handler h,Runnable r){ handler = h; runnable = r; } /*@Override public void run() { Globals.iCount+=1; handler.post(runnable); }*/ }
UTF-8
Java
331
java
MyContextTask.java
Java
[]
null
[]
package interfaces; import android.os.Handler; public abstract class MyContextTask //extends TimerTask { Handler handler; protected Runnable runnable; public MyContextTask(Handler h,Runnable r){ handler = h; runnable = r; } /*@Override public void run() { Globals.iCount+=1; handler.post(runnable); }*/ }
331
0.703928
0.700906
23
13.304348
14.848319
55
false
false
0
0
0
0
0
0
1.043478
false
false
13
c0050564f8cb8bfb2a06bd10de05f9100ec6b587
7,730,941,141,990
25346f238005b26857afb2a635c325ffa24a95d7
/amems/src/main/java/com/eray/thjw/aerialmaterial/service/impl/OverseasListingServiceImpl.java
fadaba3c480db76557a134e0b89532ec8e9ee596
[]
no_license
xyd104449/amems
https://github.com/xyd104449/amems
93491ff8fcf1d0650a9af764fa1fa38d7a25572a
74a0ef8dc31d27ee5d1a0e91ff4d74af47b08778
refs/heads/master
2021-09-15T03:21:15.399000
2018-05-25T03:15:58
2018-05-25T03:15:58
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.eray.thjw.aerialmaterial.service.impl; import javax.annotation.Resource; import org.springframework.stereotype.Service; import com.eray.thjw.aerialmaterial.dao.OverseasListingMapper; import com.eray.thjw.aerialmaterial.po.OverseasListing; import com.eray.thjw.aerialmaterial.service.OverseasListingService; @Service public class OverseasListingServiceImpl implements OverseasListingService { @Resource private OverseasListingMapper overseasListingMapper; @Override public void insert(OverseasListing overseasListing) { overseasListingMapper.insertSelective(overseasListing); } }
UTF-8
Java
635
java
OverseasListingServiceImpl.java
Java
[]
null
[]
package com.eray.thjw.aerialmaterial.service.impl; import javax.annotation.Resource; import org.springframework.stereotype.Service; import com.eray.thjw.aerialmaterial.dao.OverseasListingMapper; import com.eray.thjw.aerialmaterial.po.OverseasListing; import com.eray.thjw.aerialmaterial.service.OverseasListingService; @Service public class OverseasListingServiceImpl implements OverseasListingService { @Resource private OverseasListingMapper overseasListingMapper; @Override public void insert(OverseasListing overseasListing) { overseasListingMapper.insertSelective(overseasListing); } }
635
0.809449
0.809449
24
24.458334
27.064705
75
false
false
0
0
0
0
0
0
0.791667
false
false
13
49dd7818ea9a7218fd5c82c14b3e54a4949f468e
7,791,070,682,076
06104f83704648c6307a2f3b62de5d6bef27ef3e
/src/main/java/com/flipped/utils/ClientUtils.java
5b7e823567fa1b78287c1b91ae907c84a34c66ff
[]
no_license
flippedZH/piecesflipped
https://github.com/flippedZH/piecesflipped
84e778488e2c7d0f05441229306bb6c347e2f053
26dc8a563774734dfd1e36202b86a521fc7401c9
refs/heads/master
2023-06-09T16:17:17.345000
2021-06-27T12:47:21
2021-06-27T12:47:21
378,785,758
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.flipped.utils; import com.alibaba.fastjson.JSONObject; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.Socket; import java.util.Scanner; /** * @Classname ClientUtils * @Description TODO * @Date 2021/6/20 14:39 * @Created by zh */ public class ClientUtils { public static Socket connect(){ Socket socket=null; try { socket = new Socket("localhost", 10086); } catch (IOException e) { e.printStackTrace(); } return socket; } public void sendMsg(Socket socket,String s){ PrintWriter pw= null;//将输出流包装为打印流 try { pw = new PrintWriter(socket.getOutputStream()); pw.write(myToJson(s).toJSONString()); pw.flush(); } catch (IOException e) { e.printStackTrace(); } finally { try { socket.close(); System.out.println("断开2"); } catch (IOException e) { e.printStackTrace(); } pw.close(); } } public String getMsg(Socket socket){ BufferedReader bufferedReader = null; String msg = null; try { bufferedReader = new BufferedReader(new InputStreamReader(socket.getInputStream())); msg = bufferedReader.readLine(); if(msg!=null){ System.out.println("收到:" + msg); return msg; } } catch (IOException e) { e.printStackTrace(); }finally { try { bufferedReader.close(); System.out.println("断开1"); } catch (IOException e) { e.printStackTrace(); } } return null; } public static JSONObject myToJson(String s) { JSONObject jsonObject = new JSONObject(); String[] trim = s.trim().split(" "); jsonObject.put("x", trim[0]); jsonObject.put("y", trim[1]); jsonObject.put("color", trim[2]); return jsonObject; } }
UTF-8
Java
2,195
java
ClientUtils.java
Java
[ { "context": "ption TODO\n * @Date 2021/6/20 14:39\n * @Created by zh\n */\n\n\npublic class ClientUtils {\n public stati", "end": 334, "score": 0.9030397534370422, "start": 332, "tag": "USERNAME", "value": "zh" } ]
null
[]
package com.flipped.utils; import com.alibaba.fastjson.JSONObject; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.Socket; import java.util.Scanner; /** * @Classname ClientUtils * @Description TODO * @Date 2021/6/20 14:39 * @Created by zh */ public class ClientUtils { public static Socket connect(){ Socket socket=null; try { socket = new Socket("localhost", 10086); } catch (IOException e) { e.printStackTrace(); } return socket; } public void sendMsg(Socket socket,String s){ PrintWriter pw= null;//将输出流包装为打印流 try { pw = new PrintWriter(socket.getOutputStream()); pw.write(myToJson(s).toJSONString()); pw.flush(); } catch (IOException e) { e.printStackTrace(); } finally { try { socket.close(); System.out.println("断开2"); } catch (IOException e) { e.printStackTrace(); } pw.close(); } } public String getMsg(Socket socket){ BufferedReader bufferedReader = null; String msg = null; try { bufferedReader = new BufferedReader(new InputStreamReader(socket.getInputStream())); msg = bufferedReader.readLine(); if(msg!=null){ System.out.println("收到:" + msg); return msg; } } catch (IOException e) { e.printStackTrace(); }finally { try { bufferedReader.close(); System.out.println("断开1"); } catch (IOException e) { e.printStackTrace(); } } return null; } public static JSONObject myToJson(String s) { JSONObject jsonObject = new JSONObject(); String[] trim = s.trim().split(" "); jsonObject.put("x", trim[0]); jsonObject.put("y", trim[1]); jsonObject.put("color", trim[2]); return jsonObject; } }
2,195
0.533549
0.523832
82
25.329268
17.38941
96
false
false
0
0
0
0
0
0
0.52439
false
false
13
d9811192ba246bc92f9fcf3d2aafb0cd466aca0d
24,859,270,766,273
f1560ca5b24e68de1f6b1244122f0076d6d6a2c2
/intherain-web/src/main/java/com/time/scenery/rain/utils/DictUtil.java
83ddc9b751d8cb295bdfafb16d0f00c3ab154fad
[]
no_license
lonelyonrain/rain-project
https://github.com/lonelyonrain/rain-project
b443716847456355d7cfda29be376d0f14538860
bd29c23585abd19791019bdba6e67abbf539bf52
refs/heads/master
2021-08-11T17:47:39.267000
2017-11-14T01:02:00
2017-11-14T01:02:00
110,621,176
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.time.scenery.rain.utils; /** * @ClassName: DictUtil * @Description: 字典表 * @author: zhzp * @date: 2016年4月8日 上午9:53:47 * @version * @since JDK 1.7 */ public class DictUtil { /** * 单位类型 */ public final static String UNIT_TYPE = "UNIT_TYPE"; /** * 单位职能 */ public final static String UNIT_FUNCTION = "UNIT_FNC"; /** * 无人机类型 */ public final static String UAV = "UAV"; /** * 状态说明 */ /** * 有效 */ public final static int VALID = 0x01; /** * 无效 */ public final static int INVALID = 0x00; }
UTF-8
Java
603
java
DictUtil.java
Java
[ { "context": "ssName: DictUtil \n * @Description: 字典表\n * @author: zhzp\n * @date: 2016年4月8日 上午9:53:47\n * @version \n * @si", "end": 104, "score": 0.999686062335968, "start": 100, "tag": "USERNAME", "value": "zhzp" } ]
null
[]
package com.time.scenery.rain.utils; /** * @ClassName: DictUtil * @Description: 字典表 * @author: zhzp * @date: 2016年4月8日 上午9:53:47 * @version * @since JDK 1.7 */ public class DictUtil { /** * 单位类型 */ public final static String UNIT_TYPE = "UNIT_TYPE"; /** * 单位职能 */ public final static String UNIT_FUNCTION = "UNIT_FNC"; /** * 无人机类型 */ public final static String UAV = "UAV"; /** * 状态说明 */ /** * 有效 */ public final static int VALID = 0x01; /** * 无效 */ public final static int INVALID = 0x00; }
603
0.583486
0.548624
37
13.72973
15.086505
55
false
false
0
0
0
0
0
0
0.864865
false
false
13
ef258257564c0858b96918a61bce07d317a05461
1,846,835,971,626
120fcbd60fe7921fc8fc996d9fc796d9ac50fcec
/bank/src/main/java/com/bank/web/controller/AccountController.java
279abbdf38d570c87adc602a6669cfb3323b359e
[]
no_license
seojinkim/bank
https://github.com/seojinkim/bank
db5bf701775a5c805a48a59f9550ce3413066384
5e88c7ffe896a318d44a4f56823191dead751848
refs/heads/master
2021-01-10T04:17:36.058000
2016-02-26T00:16:59
2016-02-26T00:16:59
52,063,622
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.bank.web.controller; import javax.servlet.http.HttpSession; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import com.bank.web.domain.AccountVO; import com.bank.web.domain.MemberVO; import com.bank.web.serviceImpl.AccountServiceImpl; @Controller @RequestMapping("/account") public class AccountController { @Autowired AccountServiceImpl accountService; // 내 계좌페이지 이동 @RequestMapping(value = "/myAccount/{userid}", method = RequestMethod.GET) public String myAccount(Model model, @PathVariable("userid")String userid, HttpSession session){ AccountVO acc = new AccountVO(); acc = accountService.getAccount(userid); System.out.println("내 계좌정보 : "+acc.getAccountNo()); System.out.println("내 계좌 잔액 : "+acc.getMoney()); System.out.println("내 계좌 비번 : "+acc.getPassword()); model.addAttribute("acc", acc); model.addAttribute("id", userid); return "account/myAccount"; } // 계좌 개설하기 @RequestMapping(value = "/openAccount", method = RequestMethod.GET) public String openAccount(Model model,HttpSession session){ return "account/myAccount"; } // 입금하기 @RequestMapping(value = "/deposit", method = RequestMethod.GET) public String deposit(Model model,HttpSession session){ return "account/myAccount"; } // 출금하기 @RequestMapping(value = "/withdraw", method = RequestMethod.GET) public String withdraw(Model model,HttpSession session){ return "account/myAccount"; } // 계좌해지 @RequestMapping(value = "/removeAccount", method = RequestMethod.GET) public String removeAccount(Model model,HttpSession session){ return "account/myAccount"; } }
UTF-8
Java
2,036
java
AccountController.java
Java
[]
null
[]
package com.bank.web.controller; import javax.servlet.http.HttpSession; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import com.bank.web.domain.AccountVO; import com.bank.web.domain.MemberVO; import com.bank.web.serviceImpl.AccountServiceImpl; @Controller @RequestMapping("/account") public class AccountController { @Autowired AccountServiceImpl accountService; // 내 계좌페이지 이동 @RequestMapping(value = "/myAccount/{userid}", method = RequestMethod.GET) public String myAccount(Model model, @PathVariable("userid")String userid, HttpSession session){ AccountVO acc = new AccountVO(); acc = accountService.getAccount(userid); System.out.println("내 계좌정보 : "+acc.getAccountNo()); System.out.println("내 계좌 잔액 : "+acc.getMoney()); System.out.println("내 계좌 비번 : "+acc.getPassword()); model.addAttribute("acc", acc); model.addAttribute("id", userid); return "account/myAccount"; } // 계좌 개설하기 @RequestMapping(value = "/openAccount", method = RequestMethod.GET) public String openAccount(Model model,HttpSession session){ return "account/myAccount"; } // 입금하기 @RequestMapping(value = "/deposit", method = RequestMethod.GET) public String deposit(Model model,HttpSession session){ return "account/myAccount"; } // 출금하기 @RequestMapping(value = "/withdraw", method = RequestMethod.GET) public String withdraw(Model model,HttpSession session){ return "account/myAccount"; } // 계좌해지 @RequestMapping(value = "/removeAccount", method = RequestMethod.GET) public String removeAccount(Model model,HttpSession session){ return "account/myAccount"; } }
2,036
0.736438
0.736438
60
30.566668
23.566479
75
false
false
0
0
0
0
0
0
1.65
false
false
13
4f15f984b9e762108eba38bd91629cade23a1b2e
27,255,862,480,954
961fdee6ff5d6204dab023d8bfd1ad2adf916965
/portal_new/src/main/java/com/infosmart/portal/service/dwmis/DwmisKpiDataService.java
802e7ff0e8f1a6765eb03a2ffa992b5627861805
[]
no_license
xeonye/portal
https://github.com/xeonye/portal
d78c562a2700e73db2a495df72cddaea54541f4a
52d6a95a9145e748bd3179d9482708818f907c3e
refs/heads/master
2020-06-23T19:10:11.275000
2016-02-01T08:13:12
2016-02-01T08:13:12
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.infosmart.portal.service.dwmis; import java.math.BigDecimal; import java.util.Date; import java.util.List; import java.util.Map; import com.infosmart.portal.pojo.dwmis.DwmisKpiData; import com.infosmart.portal.pojo.dwmis.DwmisMisDptmnt; import com.infosmart.portal.vo.dwmis.DwmisDeptKpiData; public interface DwmisKpiDataService { /** * 列出部门监控的KPI指标数据 * * @param reportDate * 报表日期 * @return */ List<DwmisDeptKpiData> listDeptMonitorKpiData( List<DwmisMisDptmnt> deptInfoList, String queryDate); /** * 查询某年某指标总量(额) * * @param kpiCode * @param yearNo * @return */ BigDecimal getFullYearValueByKpiCode(String kpiCode, int yearNo); /** * 根据KPI编码得到指标数据 * * @param DwmisKpiInfo * @return */ List<DwmisKpiData> getKpiDataByCondition(List<String> kpiCodeList); /** * 根据KPI编码(多个),报表时间和时间类型查询KPI数据 (返回以KPI_CODE为主键的KPI数据集(MAP)) * * @param kpiCodeList * @param reportDate * @param kpiType * 数据类型 * @return 返回以KPI_CODE为主键的KPI数据集(MAP) */ Map<String, List<DwmisKpiData>> listdwmisKpiDataByKpiCode( List<DwmisKpiData> kpiDataList, String reportBeginDate, String reportEndDate, String dateType); /** * 根据单个指标查询指标数据 * * @param dwmisKpiData * @return */ List<DwmisKpiData> getKpiDataByKpiCode(DwmisKpiData dwmisKpiData, List<String> staCodeList); /** * 查询指定指标某日期的指标数据 * * @param kpiCodeList * 多个指标列表 * @param dateType * 时间粒度 * @param staCode * 统计类型 * @param reportDate * 统计时间----将根据时间粒度转为相应的统计时间 * @return */ Map<String, DwmisKpiData> getKpiData(List<String> kpiCodeList, int dateType, int staCode, Date reportDate); /** * 列出指定指标某段日期内的指标数据 * * @param kpiCodeList * 多个指标列表 * @param dateType * 时间粒度 * @param staCode * 统计类型 * @param beginDate * 开始时间----将根据时间粒度转为相应的统计时间 * @param endDate * 结束时间----将根据时间粒度转为相应的统计时间 * @return */ Map<String, List<DwmisKpiData>> listKpiData(List<String> kpiCodeList, int dateType, int staCode, Date beginDate, Date endDate); /** * 列出指定指标某段日期内的指标数据 Map 用日期reportDate作为Key * * @param kpiCodeList * 多个指标列表 * @param dateType * 时间粒度 * @param staCode * 统计类型 * @param beginDate * 开始时间----将根据时间粒度转为相应的统计时间 * @param endDate * 结束时间----将根据时间粒度转为相应的统计时间 * @return 返回以reportDate为主键的KPI数据集(MAP) */ Map<String, List<DwmisKpiData>> listKpiDataByDate(List<String> kpiCodeList, int dateType, int staCode, Date beginDate, Date endDate); /** * 查询指标年累计值 * * @param kpiCode * 指标 * @param dateType * 时间粒度 * @param staCode * 统计类型 * @param reportDate * 统计时间----将根据时间粒度转为相应的统计时间 * @return */ Double getKpiDataValueByYear(String kpiCode, int dateType, int staCode, Date reportDate); /** * 查询指标年月计值 * * @param kpiCode * 指标 * @param dateType * 时间粒度 * @param staCode * 统计类型 * @param reportDate * 统计时间----将根据时间粒度转为相应的统计时间 * @return */ Double getKpiDataValueByMonth(String kpiCode, int dateType, int staCode, Date reportDate); /** * 查询指标年月计值 * * @param kpiCodeList * 指标 * @param dateType * 时间粒度 * @param staCode * 统计类型 * @return */ List<DwmisKpiData> getKpiDataByParams(Object param, List<String> kpiCodeList, int dateType, int staCode, String beginDate, String endDate); /** * 列出指定指标某段日期内的指标数据 * * @param kpiCode * 指标 * @param dateType * 时间粒度 * @param staCode * 统计类型 * @param beginDate * 开始时间----将根据时间粒度转为相应的统计时间 * @param endDate * 结束时间----将根据时间粒度转为相应的统计时间 * @return */ List<DwmisKpiData> kpiDataListByParam(String kpiCode, int dateType, int staCode, Date beginDate, Date endDate); /** * 根据KpiCode和日期查询指标数据 * * @param kpiCode * @param reportDate * @param dateType * @param staCode * @return */ List<DwmisKpiData> getKpiDataByCodeAndDate(String kpiCode, Date reportDate, int dateType, int staCode); }
UTF-8
Java
5,133
java
DwmisKpiDataService.java
Java
[]
null
[]
package com.infosmart.portal.service.dwmis; import java.math.BigDecimal; import java.util.Date; import java.util.List; import java.util.Map; import com.infosmart.portal.pojo.dwmis.DwmisKpiData; import com.infosmart.portal.pojo.dwmis.DwmisMisDptmnt; import com.infosmart.portal.vo.dwmis.DwmisDeptKpiData; public interface DwmisKpiDataService { /** * 列出部门监控的KPI指标数据 * * @param reportDate * 报表日期 * @return */ List<DwmisDeptKpiData> listDeptMonitorKpiData( List<DwmisMisDptmnt> deptInfoList, String queryDate); /** * 查询某年某指标总量(额) * * @param kpiCode * @param yearNo * @return */ BigDecimal getFullYearValueByKpiCode(String kpiCode, int yearNo); /** * 根据KPI编码得到指标数据 * * @param DwmisKpiInfo * @return */ List<DwmisKpiData> getKpiDataByCondition(List<String> kpiCodeList); /** * 根据KPI编码(多个),报表时间和时间类型查询KPI数据 (返回以KPI_CODE为主键的KPI数据集(MAP)) * * @param kpiCodeList * @param reportDate * @param kpiType * 数据类型 * @return 返回以KPI_CODE为主键的KPI数据集(MAP) */ Map<String, List<DwmisKpiData>> listdwmisKpiDataByKpiCode( List<DwmisKpiData> kpiDataList, String reportBeginDate, String reportEndDate, String dateType); /** * 根据单个指标查询指标数据 * * @param dwmisKpiData * @return */ List<DwmisKpiData> getKpiDataByKpiCode(DwmisKpiData dwmisKpiData, List<String> staCodeList); /** * 查询指定指标某日期的指标数据 * * @param kpiCodeList * 多个指标列表 * @param dateType * 时间粒度 * @param staCode * 统计类型 * @param reportDate * 统计时间----将根据时间粒度转为相应的统计时间 * @return */ Map<String, DwmisKpiData> getKpiData(List<String> kpiCodeList, int dateType, int staCode, Date reportDate); /** * 列出指定指标某段日期内的指标数据 * * @param kpiCodeList * 多个指标列表 * @param dateType * 时间粒度 * @param staCode * 统计类型 * @param beginDate * 开始时间----将根据时间粒度转为相应的统计时间 * @param endDate * 结束时间----将根据时间粒度转为相应的统计时间 * @return */ Map<String, List<DwmisKpiData>> listKpiData(List<String> kpiCodeList, int dateType, int staCode, Date beginDate, Date endDate); /** * 列出指定指标某段日期内的指标数据 Map 用日期reportDate作为Key * * @param kpiCodeList * 多个指标列表 * @param dateType * 时间粒度 * @param staCode * 统计类型 * @param beginDate * 开始时间----将根据时间粒度转为相应的统计时间 * @param endDate * 结束时间----将根据时间粒度转为相应的统计时间 * @return 返回以reportDate为主键的KPI数据集(MAP) */ Map<String, List<DwmisKpiData>> listKpiDataByDate(List<String> kpiCodeList, int dateType, int staCode, Date beginDate, Date endDate); /** * 查询指标年累计值 * * @param kpiCode * 指标 * @param dateType * 时间粒度 * @param staCode * 统计类型 * @param reportDate * 统计时间----将根据时间粒度转为相应的统计时间 * @return */ Double getKpiDataValueByYear(String kpiCode, int dateType, int staCode, Date reportDate); /** * 查询指标年月计值 * * @param kpiCode * 指标 * @param dateType * 时间粒度 * @param staCode * 统计类型 * @param reportDate * 统计时间----将根据时间粒度转为相应的统计时间 * @return */ Double getKpiDataValueByMonth(String kpiCode, int dateType, int staCode, Date reportDate); /** * 查询指标年月计值 * * @param kpiCodeList * 指标 * @param dateType * 时间粒度 * @param staCode * 统计类型 * @return */ List<DwmisKpiData> getKpiDataByParams(Object param, List<String> kpiCodeList, int dateType, int staCode, String beginDate, String endDate); /** * 列出指定指标某段日期内的指标数据 * * @param kpiCode * 指标 * @param dateType * 时间粒度 * @param staCode * 统计类型 * @param beginDate * 开始时间----将根据时间粒度转为相应的统计时间 * @param endDate * 结束时间----将根据时间粒度转为相应的统计时间 * @return */ List<DwmisKpiData> kpiDataListByParam(String kpiCode, int dateType, int staCode, Date beginDate, Date endDate); /** * 根据KpiCode和日期查询指标数据 * * @param kpiCode * @param reportDate * @param dateType * @param staCode * @return */ List<DwmisKpiData> getKpiDataByCodeAndDate(String kpiCode, Date reportDate, int dateType, int staCode); }
5,133
0.627179
0.627179
191
20.921467
18.605835
76
false
false
0
0
0
0
0
0
1.314136
false
false
13
553683953104dd1fab2e238520d62e8576aafdfb
16,492,674,447,172
cb1bc5ff2e363e006dcf34fa7efcadce85927f02
/spring-beans/src/main/java/com/johar/springframework/context/event/SimpleApplicationEventMulticaster.java
09f5764dc75215c111ada4fdff6ab08ea855de57
[]
no_license
Johar77/small-spring
https://github.com/Johar77/small-spring
c07990042a6a8df2b8ed51a1865fd9c59179db82
ea128e4f6d127ed6ad05b7c8b4fc2e80a6542d8b
refs/heads/main
2023-08-29T04:43:27.470000
2021-10-14T13:51:55
2021-10-14T13:51:55
408,514,713
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.johar.springframework.context.event; import com.johar.springframework.beans.factory.BeanFactory; import com.johar.springframework.context.ApplicationEvent; import com.johar.springframework.context.ApplicationListener; /** * @ClassName: SimpleApplicationEventMulticaster * @Description: TODO * @Author: Johar * @Date: 2021/9/23 16:36 * @Since: 1.0.0 */ public class SimpleApplicationEventMulticaster extends AbstractApplicationEventMulticaster{ public SimpleApplicationEventMulticaster(BeanFactory beanFactory) { setBeanFactory(beanFactory); } @Override public void multicastEvent(ApplicationEvent event) { for (ApplicationListener listener : getApplicationListeners(event)){ listener.onApplicationEvent(event); } } }
UTF-8
Java
794
java
SimpleApplicationEventMulticaster.java
Java
[ { "context": "EventMulticaster\n * @Description: TODO\n * @Author: Johar\n * @Date: 2021/9/23 16:36\n * @Since: 1.0.0\n */\npu", "end": 324, "score": 0.9956867098808289, "start": 319, "tag": "NAME", "value": "Johar" } ]
null
[]
package com.johar.springframework.context.event; import com.johar.springframework.beans.factory.BeanFactory; import com.johar.springframework.context.ApplicationEvent; import com.johar.springframework.context.ApplicationListener; /** * @ClassName: SimpleApplicationEventMulticaster * @Description: TODO * @Author: Johar * @Date: 2021/9/23 16:36 * @Since: 1.0.0 */ public class SimpleApplicationEventMulticaster extends AbstractApplicationEventMulticaster{ public SimpleApplicationEventMulticaster(BeanFactory beanFactory) { setBeanFactory(beanFactory); } @Override public void multicastEvent(ApplicationEvent event) { for (ApplicationListener listener : getApplicationListeners(event)){ listener.onApplicationEvent(event); } } }
794
0.763224
0.745592
26
29.576923
27.803118
91
false
false
0
0
0
0
0
0
0.230769
false
false
13
c3854734355bf94119dd95ea393c08a2757a4843
18,786,186,984,861
7fca4e645f24880ab75f644f03d227aa5688749d
/p3/patterns/abstract_factory/src/test/Application.java
24440220f4364401c54412f5d2f06a4824347a25
[]
no_license
jcarlosadm/classes
https://github.com/jcarlosadm/classes
95e687f8ec6e4c1f405442de86c0dffc588f0f2e
9658b1b0805647f64d02c4b760d81d26943ec6da
refs/heads/master
2021-05-15T02:18:30.318000
2018-07-24T15:29:20
2018-07-24T15:29:20
24,521,175
2
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package test; import factory.GUIFactory; import product.Button; import product.Label; public class Application { public Application(GUIFactory factory) { Button button = factory.createButton(); Label label = factory.createLabel(); button.paint(); label.paint(); } }
UTF-8
Java
308
java
Application.java
Java
[]
null
[]
package test; import factory.GUIFactory; import product.Button; import product.Label; public class Application { public Application(GUIFactory factory) { Button button = factory.createButton(); Label label = factory.createLabel(); button.paint(); label.paint(); } }
308
0.672078
0.672078
14
21
15.56553
47
false
false
0
0
0
0
0
0
0.571429
false
false
13
4d81dd26dec216856840a454e303a792e7a14b8d
9,981,504,024,765
e16cdd2eef2a33b8e715a0ce0e536c37ec27f361
/app/src/main/java/ru/synergy/wordsmvvmlivedata/domain/WordViewModel.java
d9971c5204cdafc073353e1594b30bcf90c890e2
[]
no_license
Reality-Family-Android-course/WordsMVVMLiveData
https://github.com/Reality-Family-Android-course/WordsMVVMLiveData
943548d01633ff5385a1606b706810e3902f2ce9
e041411a17dd204007cf692197be37ddd617866e
refs/heads/master
2023-07-12T07:19:49.879000
2021-08-30T20:01:12
2021-08-30T20:01:12
401,471,310
0
2
null
null
null
null
null
null
null
null
null
null
null
null
null
package ru.synergy.wordsmvvmlivedata.domain; import android.app.Application; import android.widget.Toast; import androidx.annotation.NonNull; import androidx.lifecycle.AndroidViewModel; import androidx.lifecycle.LiveData; import java.util.List; import ru.synergy.wordsmvvmlivedata.data.repository.WordRepositoryRoomImpl; import ru.synergy.wordsmvvmlivedata.data.room.Word; public class WordViewModel extends AndroidViewModel { private WordRepository mRepository; private final LiveData<List<Word>> mAllWords; public WordViewModel(@NonNull Application application) { super(application); mRepository = new WordRepositoryRoomImpl(application); mAllWords = mRepository.getAllWords(); } public LiveData<List<Word>> getAllWords() {return mAllWords;} public void insert(Word word){ mRepository.insert(word); } public void deleteAll(){ mRepository.deleteAll(); Toast.makeText(getApplication(), "All words have been removed", Toast.LENGTH_SHORT).show(); } }
UTF-8
Java
1,043
java
WordViewModel.java
Java
[]
null
[]
package ru.synergy.wordsmvvmlivedata.domain; import android.app.Application; import android.widget.Toast; import androidx.annotation.NonNull; import androidx.lifecycle.AndroidViewModel; import androidx.lifecycle.LiveData; import java.util.List; import ru.synergy.wordsmvvmlivedata.data.repository.WordRepositoryRoomImpl; import ru.synergy.wordsmvvmlivedata.data.room.Word; public class WordViewModel extends AndroidViewModel { private WordRepository mRepository; private final LiveData<List<Word>> mAllWords; public WordViewModel(@NonNull Application application) { super(application); mRepository = new WordRepositoryRoomImpl(application); mAllWords = mRepository.getAllWords(); } public LiveData<List<Word>> getAllWords() {return mAllWords;} public void insert(Word word){ mRepository.insert(word); } public void deleteAll(){ mRepository.deleteAll(); Toast.makeText(getApplication(), "All words have been removed", Toast.LENGTH_SHORT).show(); } }
1,043
0.748802
0.748802
36
27.972221
25.656368
99
false
false
0
0
0
0
0
0
0.555556
false
false
13
1cd8c28c161f9c6901f24072858c3a8847867cee
19,069,654,808,243
2c85fb004667c3f214797bbe32a161bbd5d14e71
/src/main/java/mti/commons/model/track/LineageRelation.java
dec9e9e6240baf50586ce3268bae846ef91daf7e
[]
no_license
bradh/mti
https://github.com/bradh/mti
c823b282364574140ccccda0bf3319dc10513df5
6efb71395f78cc52acec12f1eb072f8142852773
refs/heads/master
2020-03-08T18:40:10.650000
2016-04-22T19:26:39
2016-04-22T19:26:39
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package mti.commons.model.track; import java.util.Date; import java.util.UUID; //STANAG 4676 /** * Associates related and possibly related tracks to each other. Often there * is ambiguity as to whether two tracks are actually the same object. * Additionally, multiple objects may converge to appear as a single object * or, multiple objects may split from a single track to multiple tracks. * The LineageRelation allows all track segments which may be interconnected * or related to be identified. */ public class LineageRelation { private String uuid; private String trackUuid; // Track.uuid private Security security; private Date time = null; private String comment; private Long id; /** * The track number of a separate track that is related to the reported track. */ private String relatedTrackNumber; /** * The system the related track resides. */ private String relatedTrackSystem; /** * The URL of a separate track that is related to the reported track * if it can be found on an external system. */ private String relatedTrackUrl; /** * The UUID of a separate track that is related to the reported track. */ private UUID relatedTrackUuid; /** * The relationship between a separate track and the reported track. */ private String relation; private UUID relatedTrackItemUuid; private Double confidence; public String getUuid() { return uuid; } public void setUuid(String uuid) { this.uuid = uuid; } public String getTrackUuid() { return trackUuid; } public void setTrackUuid(String trackUuid) { this.trackUuid = trackUuid; } public Security getSecurity() { return security; } public void setSecurity(Security security) { this.security = security; } public Date getTime() { return time; } public void setTime(Date time) { this.time = time; } public String getComment() { return comment; } public void setComment(String comment) { this.comment = comment; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getRelatedTrackNumber() { return relatedTrackNumber; } public void setRelatedTrackNumber(String relatedTrackNumber) { this.relatedTrackNumber = relatedTrackNumber; } public void setRelatedTrackSystem(String relatedTrackSystem) { this.relatedTrackSystem = relatedTrackSystem; } public String getRelatedTrackSystem() { return relatedTrackSystem; } public void setRelatedTrackUrl(String relatedTrackUrl) { this.relatedTrackUrl = relatedTrackUrl; } public String getRelatedTrackUrl() { return relatedTrackUrl; } public UUID getRelatedTrackUuid() { return relatedTrackUuid; } public void setRelatedTrackUuid(UUID relatedTrackUuid) { this.relatedTrackUuid = relatedTrackUuid; } public String getRelation() { return relation; } public void setRelation(String relation) { this.relation = relation; } public UUID getRelatedTrackItemUuid() { return relatedTrackItemUuid; } public void setRelatedTrackItemUuid(UUID relatedTrackItemUuid) { this.relatedTrackItemUuid = relatedTrackItemUuid; } public Double getConfidence() { return confidence; } public void setConfidence(Double confidence) { this.confidence = confidence; } }
UTF-8
Java
3,249
java
LineageRelation.java
Java
[]
null
[]
package mti.commons.model.track; import java.util.Date; import java.util.UUID; //STANAG 4676 /** * Associates related and possibly related tracks to each other. Often there * is ambiguity as to whether two tracks are actually the same object. * Additionally, multiple objects may converge to appear as a single object * or, multiple objects may split from a single track to multiple tracks. * The LineageRelation allows all track segments which may be interconnected * or related to be identified. */ public class LineageRelation { private String uuid; private String trackUuid; // Track.uuid private Security security; private Date time = null; private String comment; private Long id; /** * The track number of a separate track that is related to the reported track. */ private String relatedTrackNumber; /** * The system the related track resides. */ private String relatedTrackSystem; /** * The URL of a separate track that is related to the reported track * if it can be found on an external system. */ private String relatedTrackUrl; /** * The UUID of a separate track that is related to the reported track. */ private UUID relatedTrackUuid; /** * The relationship between a separate track and the reported track. */ private String relation; private UUID relatedTrackItemUuid; private Double confidence; public String getUuid() { return uuid; } public void setUuid(String uuid) { this.uuid = uuid; } public String getTrackUuid() { return trackUuid; } public void setTrackUuid(String trackUuid) { this.trackUuid = trackUuid; } public Security getSecurity() { return security; } public void setSecurity(Security security) { this.security = security; } public Date getTime() { return time; } public void setTime(Date time) { this.time = time; } public String getComment() { return comment; } public void setComment(String comment) { this.comment = comment; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getRelatedTrackNumber() { return relatedTrackNumber; } public void setRelatedTrackNumber(String relatedTrackNumber) { this.relatedTrackNumber = relatedTrackNumber; } public void setRelatedTrackSystem(String relatedTrackSystem) { this.relatedTrackSystem = relatedTrackSystem; } public String getRelatedTrackSystem() { return relatedTrackSystem; } public void setRelatedTrackUrl(String relatedTrackUrl) { this.relatedTrackUrl = relatedTrackUrl; } public String getRelatedTrackUrl() { return relatedTrackUrl; } public UUID getRelatedTrackUuid() { return relatedTrackUuid; } public void setRelatedTrackUuid(UUID relatedTrackUuid) { this.relatedTrackUuid = relatedTrackUuid; } public String getRelation() { return relation; } public void setRelation(String relation) { this.relation = relation; } public UUID getRelatedTrackItemUuid() { return relatedTrackItemUuid; } public void setRelatedTrackItemUuid(UUID relatedTrackItemUuid) { this.relatedTrackItemUuid = relatedTrackItemUuid; } public Double getConfidence() { return confidence; } public void setConfidence(Double confidence) { this.confidence = confidence; } }
3,249
0.743613
0.742382
147
21.108843
21.687366
79
false
false
0
0
0
0
0
0
1.217687
false
false
13
3fadd76955c030f5789006ad2bb1c5ec4bac92c6
14,774,687,547,505
62f90d7f7602072d519c28313417bcbe8c801ea4
/zipkin-storage/cassandra-v1/src/test/java/zipkin2/storage/cassandra/v1/integrationV1/CassandraSpanStoreTest.java
7407f0f73b1b7cc8563d17ade6ddc44fd189534a
[ "Apache-2.0" ]
permissive
LeftEarCat/zipkin
https://github.com/LeftEarCat/zipkin
b53905aeb27e93267dd5cfd8df0d3937d9d00550
2047930ef93f14ed8f38816b5af8d7cb49ee5ff3
refs/heads/master
2021-09-18T08:12:30.951000
2018-07-11T14:38:25
2018-07-11T15:36:27
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * Copyright 2015-2018 The OpenZipkin Authors * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under * the License. */ package zipkin2.storage.cassandra.v1.integrationV1; import com.google.common.collect.Lists; import java.util.ArrayList; import java.util.List; import org.junit.AssumptionViolatedException; import org.junit.Before; import org.junit.Test; import zipkin.Annotation; import zipkin.BinaryAnnotation; import zipkin.Endpoint; import zipkin.Span; import zipkin.TestObjects; import zipkin.internal.ApplyTimestampAndDuration; import zipkin.internal.Util; import zipkin.internal.V2StorageComponent; import zipkin.storage.QueryRequest; import zipkin.storage.SpanStoreTest; import zipkin.storage.StorageComponent; import zipkin2.storage.cassandra.v1.CassandraStorage; import zipkin2.storage.cassandra.v1.InternalForTests; import static java.util.Arrays.asList; import static java.util.stream.Collectors.toList; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.failBecauseExceptionWasNotThrown; abstract class CassandraSpanStoreTest extends SpanStoreTest { protected abstract String keyspace(); private CassandraStorage storage; @Before public void connect() { storage = storageBuilder().keyspace(keyspace()).build(); } protected abstract CassandraStorage.Builder storageBuilder(); @Override protected final StorageComponent storage() { return V2StorageComponent.create(storage); } /** Cassandra indexing is performed separately, allowing the raw span to be stored unaltered. */ @Test public void rawTraceStoredWithoutAdjustments() { Span rawSpan = TestObjects.TRACE.get(0).toBuilder().timestamp(null).duration(null).build(); accept(rawSpan); // At query time, timestamp and duration are added. assertThat(store().getTrace(rawSpan.traceIdHigh, rawSpan.traceId)) .containsExactly(ApplyTimestampAndDuration.apply(rawSpan)); // Unlike other stores, Cassandra can show that timestamp and duration weren't reported assertThat(store().getRawTrace(rawSpan.traceIdHigh, rawSpan.traceId)).containsExactly(rawSpan); } @Test public void overFetchesToCompensateForDuplicateIndexData() { int traceCount = 100; List<Span> spans = new ArrayList<>(); for (int i = 0; i < traceCount; i++) { final long delta = i * 1000; // all timestamps happen a millisecond later for (Span s : TestObjects.TRACE) { spans.add( TestObjects.TRACE .get(0) .toBuilder() .traceId(s.traceId + i * 10) .id(s.id + i * 10) .timestamp(s.timestamp + delta) .annotations( s.annotations .stream() .map(a -> Annotation.create(a.timestamp + delta, a.value, a.endpoint)) .collect(toList())) .build()); } } accept(spans.toArray(new Span[0])); // Index ends up containing more rows than services * trace count, and cannot be de-duped // in a server-side query. assertThat(rowCount("service_name_index")) .isGreaterThan(traceCount * store().getServiceNames().size()); // Implementation over-fetches on the index to allow the user to receive unsurprising results. assertThat(store().getTraces(QueryRequest.builder().limit(traceCount).build())) .hasSize(traceCount); } @Test public void searchingByAnnotationShouldFilterBeforeLimiting() { long now = System.currentTimeMillis(); int queryLimit = 2; Endpoint endpoint = TestObjects.LOTS_OF_SPANS[0].annotations.get(0).endpoint; BinaryAnnotation ba = BinaryAnnotation.create("host.name", "host1", endpoint); int nbTraceFetched = queryLimit * InternalForTests.indexFetchMultiplier(storage); for (int i = 0; i < nbTraceFetched; i++) { accept(TestObjects.LOTS_OF_SPANS[i++].toBuilder().timestamp(now - (i * 1000)).build()); } // Add two traces with the binary annotation we're looking for for (int i = nbTraceFetched; i < nbTraceFetched * 2; i++) { accept( TestObjects.LOTS_OF_SPANS[i++] .toBuilder() .timestamp(now - (i * 1000)) .addBinaryAnnotation(ba) .build()); } QueryRequest queryRequest = QueryRequest.builder() .addBinaryAnnotation(ba.key, new String(ba.value, Util.UTF_8)) .serviceName(endpoint.serviceName) .limit(queryLimit) .build(); assertThat(store().getTraces(queryRequest)).hasSize(queryLimit); } long rowCount(String table) { return InternalForTests.session(storage) .execute("SELECT COUNT(*) from " + table) .one() .getLong(0); } @Override public void getTraces_duration() { try { super.getTraces_duration(); failBecauseExceptionWasNotThrown(IllegalArgumentException.class); } catch (IllegalArgumentException e) { assertThat(e.getMessage()) .isEqualTo( "getTraces with duration is unsupported. Upgrade to the new cassandra3 schema."); throw new AssumptionViolatedException("Upgrade to cassandra3 if you want duration queries"); } } @Override public void getTraces_duration_allServices() { try { super.getTraces_duration_allServices(); failBecauseExceptionWasNotThrown(IllegalArgumentException.class); } catch (IllegalArgumentException e) { throw new AssumptionViolatedException("Upgrade to cassandra3 to search all services"); } } @Override public void getTraces_exactMatch_allServices() { try { super.getTraces_exactMatch_allServices(); failBecauseExceptionWasNotThrown(IllegalArgumentException.class); } catch (IllegalArgumentException e) { throw new AssumptionViolatedException("Upgrade to cassandra3 to search all services"); } } /** Makes sure the test cluster doesn't fall over on BusyPoolException */ @Override protected void accept(Span... spans) { // TODO: this avoids overrunning the cluster with BusyPoolException for (List<Span> nextChunk : Lists.partition(asList(spans), 100)) { super.accept(nextChunk.toArray(new Span[0])); // Now, block until writes complete, notably so we can read them. InternalForTests.blockWhileInFlight(storage); } } }
UTF-8
Java
6,896
java
CassandraSpanStoreTest.java
Java
[]
null
[]
/* * Copyright 2015-2018 The OpenZipkin Authors * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under * the License. */ package zipkin2.storage.cassandra.v1.integrationV1; import com.google.common.collect.Lists; import java.util.ArrayList; import java.util.List; import org.junit.AssumptionViolatedException; import org.junit.Before; import org.junit.Test; import zipkin.Annotation; import zipkin.BinaryAnnotation; import zipkin.Endpoint; import zipkin.Span; import zipkin.TestObjects; import zipkin.internal.ApplyTimestampAndDuration; import zipkin.internal.Util; import zipkin.internal.V2StorageComponent; import zipkin.storage.QueryRequest; import zipkin.storage.SpanStoreTest; import zipkin.storage.StorageComponent; import zipkin2.storage.cassandra.v1.CassandraStorage; import zipkin2.storage.cassandra.v1.InternalForTests; import static java.util.Arrays.asList; import static java.util.stream.Collectors.toList; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.failBecauseExceptionWasNotThrown; abstract class CassandraSpanStoreTest extends SpanStoreTest { protected abstract String keyspace(); private CassandraStorage storage; @Before public void connect() { storage = storageBuilder().keyspace(keyspace()).build(); } protected abstract CassandraStorage.Builder storageBuilder(); @Override protected final StorageComponent storage() { return V2StorageComponent.create(storage); } /** Cassandra indexing is performed separately, allowing the raw span to be stored unaltered. */ @Test public void rawTraceStoredWithoutAdjustments() { Span rawSpan = TestObjects.TRACE.get(0).toBuilder().timestamp(null).duration(null).build(); accept(rawSpan); // At query time, timestamp and duration are added. assertThat(store().getTrace(rawSpan.traceIdHigh, rawSpan.traceId)) .containsExactly(ApplyTimestampAndDuration.apply(rawSpan)); // Unlike other stores, Cassandra can show that timestamp and duration weren't reported assertThat(store().getRawTrace(rawSpan.traceIdHigh, rawSpan.traceId)).containsExactly(rawSpan); } @Test public void overFetchesToCompensateForDuplicateIndexData() { int traceCount = 100; List<Span> spans = new ArrayList<>(); for (int i = 0; i < traceCount; i++) { final long delta = i * 1000; // all timestamps happen a millisecond later for (Span s : TestObjects.TRACE) { spans.add( TestObjects.TRACE .get(0) .toBuilder() .traceId(s.traceId + i * 10) .id(s.id + i * 10) .timestamp(s.timestamp + delta) .annotations( s.annotations .stream() .map(a -> Annotation.create(a.timestamp + delta, a.value, a.endpoint)) .collect(toList())) .build()); } } accept(spans.toArray(new Span[0])); // Index ends up containing more rows than services * trace count, and cannot be de-duped // in a server-side query. assertThat(rowCount("service_name_index")) .isGreaterThan(traceCount * store().getServiceNames().size()); // Implementation over-fetches on the index to allow the user to receive unsurprising results. assertThat(store().getTraces(QueryRequest.builder().limit(traceCount).build())) .hasSize(traceCount); } @Test public void searchingByAnnotationShouldFilterBeforeLimiting() { long now = System.currentTimeMillis(); int queryLimit = 2; Endpoint endpoint = TestObjects.LOTS_OF_SPANS[0].annotations.get(0).endpoint; BinaryAnnotation ba = BinaryAnnotation.create("host.name", "host1", endpoint); int nbTraceFetched = queryLimit * InternalForTests.indexFetchMultiplier(storage); for (int i = 0; i < nbTraceFetched; i++) { accept(TestObjects.LOTS_OF_SPANS[i++].toBuilder().timestamp(now - (i * 1000)).build()); } // Add two traces with the binary annotation we're looking for for (int i = nbTraceFetched; i < nbTraceFetched * 2; i++) { accept( TestObjects.LOTS_OF_SPANS[i++] .toBuilder() .timestamp(now - (i * 1000)) .addBinaryAnnotation(ba) .build()); } QueryRequest queryRequest = QueryRequest.builder() .addBinaryAnnotation(ba.key, new String(ba.value, Util.UTF_8)) .serviceName(endpoint.serviceName) .limit(queryLimit) .build(); assertThat(store().getTraces(queryRequest)).hasSize(queryLimit); } long rowCount(String table) { return InternalForTests.session(storage) .execute("SELECT COUNT(*) from " + table) .one() .getLong(0); } @Override public void getTraces_duration() { try { super.getTraces_duration(); failBecauseExceptionWasNotThrown(IllegalArgumentException.class); } catch (IllegalArgumentException e) { assertThat(e.getMessage()) .isEqualTo( "getTraces with duration is unsupported. Upgrade to the new cassandra3 schema."); throw new AssumptionViolatedException("Upgrade to cassandra3 if you want duration queries"); } } @Override public void getTraces_duration_allServices() { try { super.getTraces_duration_allServices(); failBecauseExceptionWasNotThrown(IllegalArgumentException.class); } catch (IllegalArgumentException e) { throw new AssumptionViolatedException("Upgrade to cassandra3 to search all services"); } } @Override public void getTraces_exactMatch_allServices() { try { super.getTraces_exactMatch_allServices(); failBecauseExceptionWasNotThrown(IllegalArgumentException.class); } catch (IllegalArgumentException e) { throw new AssumptionViolatedException("Upgrade to cassandra3 to search all services"); } } /** Makes sure the test cluster doesn't fall over on BusyPoolException */ @Override protected void accept(Span... spans) { // TODO: this avoids overrunning the cluster with BusyPoolException for (List<Span> nextChunk : Lists.partition(asList(spans), 100)) { super.accept(nextChunk.toArray(new Span[0])); // Now, block until writes complete, notably so we can read them. InternalForTests.blockWhileInFlight(storage); } } }
6,896
0.694026
0.685325
189
35.486771
29.676849
100
false
false
0
0
0
0
0
0
0.465608
false
false
13
12550f0ba1fc37cac7dc25d32a7a00534873db21
7,937,099,598,240
81dcb8086c6634e0fdbb33dae5160367e04412e4
/src/main/java/com/theappservice/server/repository/entities/UserEntity.java
a09d0e0471f17a5bb2570495da980a056b07dad7
[]
no_license
mkeiji/xappServer
https://github.com/mkeiji/xappServer
550da6f0eec687da5b6e33a43839ef8a9aef494a
5be6d01da3bb7fbb4d7fdf28d143b870f0ffad07
refs/heads/master
2023-03-18T22:20:45.751000
2020-08-30T21:48:34
2020-08-30T21:48:34
342,653,379
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.theappservice.server.repository.entities; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; @Getter @Setter @NoArgsConstructor @Entity @Table(name = "Users") public class UserEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @NotBlank @Column(name = "user_name", unique = true) @Size(min = 1, max = 100) private String userName; @NotBlank @Column(name = "first_name") @Size(max = 50) private String firstName; @Column(name = "last_name") @Size(max = 50) private String lastName; }
UTF-8
Java
911
java
UserEntity.java
Java
[]
null
[]
package com.theappservice.server.repository.entities; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; @Getter @Setter @NoArgsConstructor @Entity @Table(name = "Users") public class UserEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @NotBlank @Column(name = "user_name", unique = true) @Size(min = 1, max = 100) private String userName; @NotBlank @Column(name = "first_name") @Size(max = 50) private String firstName; @Column(name = "last_name") @Size(max = 50) private String lastName; }
911
0.738749
0.729967
39
22.358974
15.510935
55
false
false
0
0
0
0
0
0
0.461538
false
false
13
12d2681d7cb783f7c29fdbd030f9765dbdbcfc56
13,554,916,792,064
bb8ef964114fdbb475418764df98385bedce60e0
/Master/src/main/java/me/shortydev/phoenix/master/wrapper/WrapperEntity.java
b9d9ce9942d77d3f529c546bbadc4dd61187b812
[]
no_license
ShortyDev/phoenixcloud
https://github.com/ShortyDev/phoenixcloud
8971d5ff9d03646349ae66ee708163a460c7d344
29bb1bf36a0c8a32a3fbbc77b5a075ce1f6a4d2c
refs/heads/master
2023-06-21T20:27:17.476000
2021-07-15T21:05:58
2021-07-15T21:05:58
291,156,290
5
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package me.shortydev.phoenix.master.wrapper; public class WrapperEntity { public String address; public int id; public WrapperEntity(String address, int id) { this.address = address; this.id = id; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public int getId() { return id; } public void setId(int id) { this.id = id; } }
UTF-8
Java
496
java
WrapperEntity.java
Java
[]
null
[]
package me.shortydev.phoenix.master.wrapper; public class WrapperEntity { public String address; public int id; public WrapperEntity(String address, int id) { this.address = address; this.id = id; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public int getId() { return id; } public void setId(int id) { this.id = id; } }
496
0.586694
0.586694
28
16.714285
15.443115
50
false
false
0
0
0
0
0
0
0.357143
false
false
13
a371d6246360c7558eda080c604105e466bd65ed
3,478,923,559,724
7eece9d240fd915745ff2cf8866c5261ca37d94b
/src/main/java/com/example/demo/data/Entity/Book.java
5beb40cff4896850ef728b04819878343d36f031
[]
no_license
takayan40/spring-boot-security
https://github.com/takayan40/spring-boot-security
9955a6b46c2e8df927bf5203e686d9a9975fe3c5
a4086232f49c3f5151165efb00a0978b1ef6a40d
refs/heads/master
2023-04-27T14:55:52.958000
2021-05-13T09:34:14
2021-05-13T09:34:14
366,631,782
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.demo.data.Entity; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; @Entity @NoArgsConstructor @AllArgsConstructor @Data public class Book { @Id @GeneratedValue(strategy = GenerationType.AUTO) private long id; private String title; private String done; private String site; private Long userId; public Book(String title, String done, String site, Long userId) { super(); this.title = title; this.done = done; this.site = site; this.userId = userId; } }
UTF-8
Java
734
java
Book.java
Java
[]
null
[]
package com.example.demo.data.Entity; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; @Entity @NoArgsConstructor @AllArgsConstructor @Data public class Book { @Id @GeneratedValue(strategy = GenerationType.AUTO) private long id; private String title; private String done; private String site; private Long userId; public Book(String title, String done, String site, Long userId) { super(); this.title = title; this.done = done; this.site = site; this.userId = userId; } }
734
0.713896
0.713896
32
21.9375
15.78753
70
false
false
0
0
0
0
0
0
0.65625
false
false
13
fef9e08cc620e2ad099da0101f5a8f286022229c
19,542,101,242,913
823c862b96a5332bf02999fa0a44747aada5c5f9
/ITP1_4/D/main.java
79a7a1048890b8eead8385a0412467a9746b69a1
[]
no_license
tortuepin/AizuOnlineJudge
https://github.com/tortuepin/AizuOnlineJudge
3f73020eb35e52740b89dfb588d89758fe8fe20e
62b8f16ba131332c0f2add16c9619af03a20c78b
refs/heads/master
2021-01-10T01:56:10.487000
2016-03-10T09:32:00
2016-03-10T09:32:00
53,572,260
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
import java.io.*; class Main{ public static void main(String[] args)throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String nRead = br.readLine(); String str = br.readLine(); String strArr[] = str.split(" "); int n = Integer.parseInt(nRead); int a[] = new int[n]; int min=1000000, max=-1000000, sum=0; for(int i=0; i<n; i++){ a[i] = Integer.parseInt(strArr[i]); } //int sumtmp = a[0]; for(int i=0; i<n; i++){ if(a[i]<min){ min = a[i]; } if(a[i]>max){ max = a[i]; } sum += a[i]; } System.out.printf("%d %d %d\n", min, max, sum); } }
UTF-8
Java
640
java
main.java
Java
[]
null
[]
import java.io.*; class Main{ public static void main(String[] args)throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String nRead = br.readLine(); String str = br.readLine(); String strArr[] = str.split(" "); int n = Integer.parseInt(nRead); int a[] = new int[n]; int min=1000000, max=-1000000, sum=0; for(int i=0; i<n; i++){ a[i] = Integer.parseInt(strArr[i]); } //int sumtmp = a[0]; for(int i=0; i<n; i++){ if(a[i]<min){ min = a[i]; } if(a[i]>max){ max = a[i]; } sum += a[i]; } System.out.printf("%d %d %d\n", min, max, sum); } }
640
0.570313
0.542188
34
17.852942
18.607609
75
false
false
0
0
0
0
0
0
2.323529
false
false
13
0d0583ad38ac8e4f12a31492142c2ad465fe9c80
29,300,266,940,509
7948a48cb49328984b1e5a19f9df84daddabf049
/jdbc/src/site/itwill/jdbc/StaticBlockApp.java
4f19be1debc2edd8924963c91580cd3fcd9cc3f1
[]
no_license
codingwanee/itwill-java
https://github.com/codingwanee/itwill-java
6f5e26b707f83f416f0ddb6ee9be86fe9710ac7b
da99ffc209e4a78eda179dd2e730a0a6872be5fb
refs/heads/master
2022-12-02T23:02:52.211000
2020-08-22T11:33:37
2020-08-22T11:33:37
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package site.itwill.jdbc; public class StaticBlockApp { public static void main(String[] args) { /* //1.클래스로더(ClassLoader)에 의해 클래스(Class 파일)를 읽어 메모리 저장 - 자동 // => 프로그램에서 한번만 동작 //2.new 연산자로 메모리에 저장된 클래스(Clazz)의 생성자를 호출하여 인스턴스 생성 // => 생성된 인스턴스를 참조변수에 저장하여 지속적 사용 가능하도록 설정 StaticBlock sb1=new StaticBlock(); StaticBlock sb2=new StaticBlock(); //3.참조변수에 저장된 인스턴스로 메소드 호출 - 기능 구현 sb1.display(); sb1.display(); sb2.display(); */ //Class 클래스 : 메모리에 저장된 클래스정보(Clazz)를 저장하기 위한 클래스 //Class.forName(String className) : 문자열로 전달된 클래스를 Class 인스턴스(Clazz)로 반환하는 메소드 // => 클래스로더를 이용하여 클래스(Class 파일)를 메모리에 저장 - 수동 // => 클래스에 선언된 필드, 생성자, 메소드 정보를 반환받아 사용(리플렉션 : Reflection) try { Class.forName("site.itwill.jdbc.StaticBlock"); //인스턴스 생성 및 메소드 호출을 정적영역에서 실행 /* StaticBlock sb=new StaticBlock(); sb.display(); */ } catch (ClassNotFoundException e) { System.out.println("[에러]클래스가 존재하지 않습니다."); } } }
UHC
Java
1,461
java
StaticBlockApp.java
Java
[]
null
[]
package site.itwill.jdbc; public class StaticBlockApp { public static void main(String[] args) { /* //1.클래스로더(ClassLoader)에 의해 클래스(Class 파일)를 읽어 메모리 저장 - 자동 // => 프로그램에서 한번만 동작 //2.new 연산자로 메모리에 저장된 클래스(Clazz)의 생성자를 호출하여 인스턴스 생성 // => 생성된 인스턴스를 참조변수에 저장하여 지속적 사용 가능하도록 설정 StaticBlock sb1=new StaticBlock(); StaticBlock sb2=new StaticBlock(); //3.참조변수에 저장된 인스턴스로 메소드 호출 - 기능 구현 sb1.display(); sb1.display(); sb2.display(); */ //Class 클래스 : 메모리에 저장된 클래스정보(Clazz)를 저장하기 위한 클래스 //Class.forName(String className) : 문자열로 전달된 클래스를 Class 인스턴스(Clazz)로 반환하는 메소드 // => 클래스로더를 이용하여 클래스(Class 파일)를 메모리에 저장 - 수동 // => 클래스에 선언된 필드, 생성자, 메소드 정보를 반환받아 사용(리플렉션 : Reflection) try { Class.forName("site.itwill.jdbc.StaticBlock"); //인스턴스 생성 및 메소드 호출을 정적영역에서 실행 /* StaticBlock sb=new StaticBlock(); sb.display(); */ } catch (ClassNotFoundException e) { System.out.println("[에러]클래스가 존재하지 않습니다."); } } }
1,461
0.643821
0.635514
35
26.171429
21.066542
79
false
false
0
0
0
0
0
0
2.257143
false
false
13
7b1cea04e4a389a323080ddb9b84158513d164b0
17,892,833,809,372
67c07118117e5084e25b4d9c2febc224d5d80450
/src/com/third/ght/AES.java
fdcca71c681661bde86ffb798859e575b8352904
[]
no_license
Peng19890717/pay
https://github.com/Peng19890717/pay
046eea361ee271791127182d196ef8688c3aa86e
9a4eccaa05ae26984e833d48a682577922a63cda
refs/heads/master
2021-05-02T06:47:59.557000
2017-11-21T07:22:12
2017-11-21T07:22:12
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.third.ght; import java.io.PrintStream; import java.security.Key; import javax.crypto.Cipher; import javax.crypto.KeyGenerator; import javax.crypto.SecretKey; import javax.crypto.spec.SecretKeySpec; public class AES{ public static final String KEY_ALGORITHM = "AES"; public static final String CIPHER_ALGORITHM = "AES/ECB/PKCS5Padding"; private static Key toKey(byte[] key) throws Exception { SecretKey secretKey = new SecretKeySpec(key, "AES"); return secretKey; } public static byte[] decrypt(byte[] data, byte[] key) throws Exception { Key k = toKey(key); Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding"); cipher.init(2, k); return cipher.doFinal(data); } public static byte[] encrypt(byte[] data, byte[] key) throws Exception { Key k = toKey(key); Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding"); cipher.init(1, k); return cipher.doFinal(data); } public static byte[] initKey() throws Exception { KeyGenerator kg = KeyGenerator.getInstance("AES"); kg.init(128); SecretKey secretKey = kg.generateKey(); return secretKey.getEncoded(); } public static void main(String[] args) { String data = "{\"merchId\":\"123456789\",\"timeStamp\":\"20140424\",\"version\":\"1.0\",\"orderNo\":\"993932\",\"orderDate\":\"20140424\",\"amount\":\"10000\",\"account\":\"13657458526\",\"chargeCards\":[{\"cardNo\":\"2667915483748918\",\"chargeAmt\":\"10000\"}],\"sign\":\"3232wwewew\"}"; String aesKey = "WgpZmlYFyCNyrphu90Mazw=="; try { byte[] key = Base64.decode(aesKey); byte[] encrData = encrypt(data.getBytes(), key); System.out.println(Base64.encode(encrData)); System.out.println("key=== " + new String(decrypt(encrData, key)) + " "); System.out.println("key===" + key.length + " "); } catch (Exception e) { e.printStackTrace(); } } }
UTF-8
Java
1,947
java
AES.java
Java
[ { "context": "],\\\"sign\\\":\\\"3232wwewew\\\"}\";\n String aesKey = \"WgpZmlYFyCNyrphu90Mazw==\";\n try\n {\n byte[] key = Base64.decode(a", "end": 1573, "score": 0.999677300453186, "start": 1548, "tag": "KEY", "value": "WgpZmlYFyCNyrphu90Mazw==\"" } ]
null
[]
package com.third.ght; import java.io.PrintStream; import java.security.Key; import javax.crypto.Cipher; import javax.crypto.KeyGenerator; import javax.crypto.SecretKey; import javax.crypto.spec.SecretKeySpec; public class AES{ public static final String KEY_ALGORITHM = "AES"; public static final String CIPHER_ALGORITHM = "AES/ECB/PKCS5Padding"; private static Key toKey(byte[] key) throws Exception { SecretKey secretKey = new SecretKeySpec(key, "AES"); return secretKey; } public static byte[] decrypt(byte[] data, byte[] key) throws Exception { Key k = toKey(key); Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding"); cipher.init(2, k); return cipher.doFinal(data); } public static byte[] encrypt(byte[] data, byte[] key) throws Exception { Key k = toKey(key); Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding"); cipher.init(1, k); return cipher.doFinal(data); } public static byte[] initKey() throws Exception { KeyGenerator kg = KeyGenerator.getInstance("AES"); kg.init(128); SecretKey secretKey = kg.generateKey(); return secretKey.getEncoded(); } public static void main(String[] args) { String data = "{\"merchId\":\"123456789\",\"timeStamp\":\"20140424\",\"version\":\"1.0\",\"orderNo\":\"993932\",\"orderDate\":\"20140424\",\"amount\":\"10000\",\"account\":\"13657458526\",\"chargeCards\":[{\"cardNo\":\"2667915483748918\",\"chargeAmt\":\"10000\"}],\"sign\":\"3232wwewew\"}"; String aesKey = "<KEY>; try { byte[] key = Base64.decode(aesKey); byte[] encrData = encrypt(data.getBytes(), key); System.out.println(Base64.encode(encrData)); System.out.println("key=== " + new String(decrypt(encrData, key)) + " "); System.out.println("key===" + key.length + " "); } catch (Exception e) { e.printStackTrace(); } } }
1,927
0.645095
0.599897
75
24.973333
37.787819
294
false
false
0
0
0
0
0
0
0.626667
false
false
13
de191272b43c258bff588c4becc8e6688c7168cc
1,606,317,834,214
6f6cd3c8681be6a551c643df206088e4f377126c
/src/com/ccdata/host/dao/HostDao.java
93430976fb8d64e977f98f69427a059d295ff412
[]
no_license
XuKyle/Theseus
https://github.com/XuKyle/Theseus
e510a1368e81efd0784782b01f6aa0ece6d83134
57984ff767b110111acc275f6f3807fd10f046c9
refs/heads/master
2016-09-08T10:35:49.690000
2015-08-13T10:04:44
2015-08-13T10:04:44
40,460,684
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.ccdata.host.dao; import com.ccdata.util.core.Page; import java.util.List; /** * Created by kyle.xu on 2015/8/12. */ public interface HostDao { void unregistHost(Page page); void processTaskHost(Page page); void unTaskDevice(Page page); void closedDevice(Page page); void processTask(Page page); float signalIntensityAvg(); float noiseSignalRatio(); int getChannelNum(String channel); void warningHost(Page page); void warningDevice(Page page); }
UTF-8
Java
513
java
HostDao.java
Java
[ { "context": "e.Page;\n\nimport java.util.List;\n\n/**\n * Created by kyle.xu on 2015/8/12.\n */\npublic interface HostDao {\n\n ", "end": 114, "score": 0.7886450886726379, "start": 107, "tag": "NAME", "value": "kyle.xu" } ]
null
[]
package com.ccdata.host.dao; import com.ccdata.util.core.Page; import java.util.List; /** * Created by kyle.xu on 2015/8/12. */ public interface HostDao { void unregistHost(Page page); void processTaskHost(Page page); void unTaskDevice(Page page); void closedDevice(Page page); void processTask(Page page); float signalIntensityAvg(); float noiseSignalRatio(); int getChannelNum(String channel); void warningHost(Page page); void warningDevice(Page page); }
513
0.695906
0.682261
31
15.548388
15.857915
38
false
false
0
0
0
0
0
0
0.419355
false
false
13
5873e36014a3b8df3918cd59dc4322db2739fc81
2,405,181,744,546
e7373bb280ce84312d3d7ef437bbda09d0473ba6
/javahelloworld.java
f7984a2e712e2c20cbab5aabcbd969b3c1a11679
[]
no_license
boosam/New-Training-Repo
https://github.com/boosam/New-Training-Repo
a92543d7053b9dd33335e4090c6aaf1241686f17
e181bfbc015ca3f883bea0669fecef5dc212a2d9
refs/heads/master
2016-09-14T06:55:17.011000
2016-04-20T03:36:11
2016-04-20T03:36:11
56,651,880
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
public class javahelloworld { public static void main (String [] args) { System.out.println("Hellooo java World"); System.out.println("Hellooooo again"); System.out.println("Testing upgrade to 2.4.1"); } }
UTF-8
Java
215
java
javahelloworld.java
Java
[]
null
[]
public class javahelloworld { public static void main (String [] args) { System.out.println("Hellooo java World"); System.out.println("Hellooooo again"); System.out.println("Testing upgrade to 2.4.1"); } }
215
0.706977
0.693023
9
22.888889
19.874296
49
false
false
0
0
0
0
0
0
1.333333
false
false
13
9cef8274dfb6a98dd4a3437d52404c3639211e19
10,247,791,975,855
97584ff96b6fd1fb621a4dec6211de779c4f6bf6
/app/src/main/java/com/tapc/android/controller/MachineController.java
11f90fe18dd2edad9aacb3c3ebc3d034b3f86312
[]
no_license
dylan-zwl/tapc_test_reconsitution1
https://github.com/dylan-zwl/tapc_test_reconsitution1
043ab2bbd774cb3df9c02c9ff20220dcbfc9de0d
5dd8601b971e46a90f9b2fec5576151e5ff2aec7
refs/heads/master
2021-01-10T00:01:17.206000
2018-01-29T07:47:23
2018-01-29T07:47:24
91,561,746
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.tapc.android.controller; import android.annotation.SuppressLint; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.os.Message; import com.tapc.android.uart.Commands; @SuppressLint("HandlerLeak") public final class MachineController { public static final String MSG_WORKOUT_STATUS = "tapc.status.action"; public static final String MSG_KEY_BOARD = "tapc.key.action"; private Context mcontext; private int mKeyCode; private int mSpeed; private int mPaceRate; private int mHeartRate; private int mIncline; private int mHardwareStatus; private int mInclineCalStatus; private Handler messageHandler; private static MachineController mMachineController; private MachieStatusController mMachineStatusController; private KeyboardController mKeyboardController; private HeartController mHeartController; private SpeedController mSpeedController; private InclineController mInclineController; private IOUpdateController mIOUpdateController; private FootRateController mFootRateController; private HardwareStatusController mHardwareStatuscontroller; private Handler mUIGetSpeed; private Handler mUIGetIncline; public MachineController() { } public static MachineController getInstance() { if (null == mMachineController) { mMachineController = new MachineController(); } return mMachineController; } public void initController() { if (null != mMachineController) { messageHandler = new Handler() { @Override public void handleMessage(Message msg) { super.handleMessage(msg); if (msg.getData().containsKey(HardwareStatusController.KEY_WORKOUT_STATUS)) { mHardwareStatus = (Integer) msg.getData().get(HardwareStatusController.KEY_WORKOUT_STATUS); Intent intent = new Intent(); intent.setAction(MSG_WORKOUT_STATUS); intent.putExtra(HardwareStatusController.KEY_WORKOUT_STATUS, mHardwareStatus); mcontext.sendBroadcast(intent); // Log.d("get mHardwareStatus", "" + mHardwareStatus); } else if (msg.getData().containsKey("HEART_RATE")) { mHeartRate = (Integer) msg.getData().get("HEART_RATE"); } else if (msg.getData().containsKey("FOOT_RATE")) { mPaceRate = (Integer) msg.getData().get("FOOT_RATE"); } else if (msg.getData().containsKey("SPEED_VALUE")) { mSpeed = (Integer) msg.getData().get("SPEED_VALUE"); if (mUIGetSpeed != null) { setUIIntMessage(mUIGetSpeed, "SPEED_VALUE", mSpeed); } } else if (msg.getData().containsKey("INCLINE_VALUE")) { mIncline = (Integer) msg.getData().get("INCLINE_VALUE"); if (mUIGetIncline != null) { setUIIntMessage(mUIGetIncline, "INCLINE_VALUE", mIncline); } } else if (msg.getData().containsKey(KeyboardController.KEY_CODE)) { mKeyCode = (Integer) msg.getData().get(KeyboardController.KEY_CODE); Intent intent = new Intent(); intent.setAction(MSG_KEY_BOARD); intent.putExtra(KeyboardController.KEY_CODE, mKeyCode); mcontext.sendBroadcast(intent); } else if (msg.getData().containsKey("INCLNE_CAL_FINISH")) { mInclineCalStatus = (Integer) msg.getData().get("INCLNE_CAL_FINISH"); } } }; mMachineStatusController = new MachieStatusController(messageHandler); mHeartController = new HeartController(messageHandler); mSpeedController = new SpeedController(messageHandler); mInclineController = new InclineController(messageHandler); mFootRateController = new FootRateController(messageHandler); mHardwareStatuscontroller = new HardwareStatusController(messageHandler); mKeyboardController = new KeyboardController(messageHandler); } } public void start() { mHeartController.start(); mSpeedController.start(); mInclineController.start(); mFootRateController.start(); mHardwareStatuscontroller.start(); mMachineStatusController.start(); mKeyboardController.start(); } public void stop() { mHeartController.stop(); mSpeedController.stop(); mInclineController.stop(); mFootRateController.stop(); mHardwareStatuscontroller.stop(); mMachineStatusController.stop(); mKeyboardController.stop(); } public int getRecvCommandCount() { return mHeartController.recvCommandCount; } public void setRecvCommandCount(int count) { mHeartController.recvCommandCount = count; } public void updateMCU(String filePath, Handler IOUpdateMsg) { mIOUpdateController = new IOUpdateController(IOUpdateMsg); mIOUpdateController.start(); mIOUpdateController.updateIO(filePath); } public void stopIOUpdateController() { if (mIOUpdateController != null) { mIOUpdateController.stop(); mIOUpdateController = null; } } public void enterErpStatus(int delayTime) { mMachineStatusController.enterERP(delayTime); } public void setReceiveBroadcast(Context context) { mcontext = context; } public void setSpeed(int speed) { mSpeedController.setSpeed(speed); } public void setIncline(int incline) { mInclineController.setIncline(incline); } public void startInclinecal() { mInclineCalStatus = -1; mInclineController.startInclinecal(); } public void stopInclinecal() { mInclineController.stopInclinecal(); } public void setFanLevel(int spdlvl) { mMachineStatusController.setFanSpeedLevel(spdlvl); } public void startMachine(int speed, int incline) { mMachineStatusController.startMachine(speed, incline); } public void stopMachine(int incline) { mMachineStatusController.stopMachine(incline); } public void pauseMachine() { mMachineStatusController.pauseMachine(); } public void sendMachineErrorCmd() { mMachineStatusController.sendMachineErrorCmd(); } public void sendCtlVersionCmd() { mMachineStatusController.sendCtlVersionCmd(); } public byte[] getMachineVersionBytes() { return mMachineStatusController.getMachineVersionBytes(); } public String getCtlVersionValue() { return mMachineStatusController.getCtlVersionValue(); } public int getFanLevel() { return mMachineStatusController.getFanSpeedLevel(); } public int getInclinecalStatus() { return mInclineCalStatus; } public void getIncline(Handler handler) { mUIGetIncline = handler; mInclineController.getIncline(); } public void getSpeed(Handler handler) { mUIGetSpeed = handler; mSpeedController.getSpeed(); } public int getIncline() { return mIncline; } public int getSpeed() { return mSpeed; } public int getPaceRate() { return mPaceRate; } public int getHeartRate() { return mHeartRate; } public int getHardwareStatus() { return mHardwareStatus; } public int getSafeKeyStatus() { return mHardwareStatuscontroller.getSafeKeyStatus(); } public void sendRfidCommand() { mMachineStatusController.sendRfidCmd(); } public int getRfidStatus() { return mMachineStatusController.getRfidStatus(); } public void sendCommands(Commands commands, byte[] data) { mMachineStatusController.sendCommands(commands, data); } public void setUIIntMessage(Handler handler, String key, int value) { Bundle bndl = new Bundle(); bndl.putInt(key, value); Message msg = new Message(); msg.setData(bndl); handler.sendMessage(msg); } }
UTF-8
Java
8,555
java
MachineController.java
Java
[]
null
[]
package com.tapc.android.controller; import android.annotation.SuppressLint; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.os.Message; import com.tapc.android.uart.Commands; @SuppressLint("HandlerLeak") public final class MachineController { public static final String MSG_WORKOUT_STATUS = "tapc.status.action"; public static final String MSG_KEY_BOARD = "tapc.key.action"; private Context mcontext; private int mKeyCode; private int mSpeed; private int mPaceRate; private int mHeartRate; private int mIncline; private int mHardwareStatus; private int mInclineCalStatus; private Handler messageHandler; private static MachineController mMachineController; private MachieStatusController mMachineStatusController; private KeyboardController mKeyboardController; private HeartController mHeartController; private SpeedController mSpeedController; private InclineController mInclineController; private IOUpdateController mIOUpdateController; private FootRateController mFootRateController; private HardwareStatusController mHardwareStatuscontroller; private Handler mUIGetSpeed; private Handler mUIGetIncline; public MachineController() { } public static MachineController getInstance() { if (null == mMachineController) { mMachineController = new MachineController(); } return mMachineController; } public void initController() { if (null != mMachineController) { messageHandler = new Handler() { @Override public void handleMessage(Message msg) { super.handleMessage(msg); if (msg.getData().containsKey(HardwareStatusController.KEY_WORKOUT_STATUS)) { mHardwareStatus = (Integer) msg.getData().get(HardwareStatusController.KEY_WORKOUT_STATUS); Intent intent = new Intent(); intent.setAction(MSG_WORKOUT_STATUS); intent.putExtra(HardwareStatusController.KEY_WORKOUT_STATUS, mHardwareStatus); mcontext.sendBroadcast(intent); // Log.d("get mHardwareStatus", "" + mHardwareStatus); } else if (msg.getData().containsKey("HEART_RATE")) { mHeartRate = (Integer) msg.getData().get("HEART_RATE"); } else if (msg.getData().containsKey("FOOT_RATE")) { mPaceRate = (Integer) msg.getData().get("FOOT_RATE"); } else if (msg.getData().containsKey("SPEED_VALUE")) { mSpeed = (Integer) msg.getData().get("SPEED_VALUE"); if (mUIGetSpeed != null) { setUIIntMessage(mUIGetSpeed, "SPEED_VALUE", mSpeed); } } else if (msg.getData().containsKey("INCLINE_VALUE")) { mIncline = (Integer) msg.getData().get("INCLINE_VALUE"); if (mUIGetIncline != null) { setUIIntMessage(mUIGetIncline, "INCLINE_VALUE", mIncline); } } else if (msg.getData().containsKey(KeyboardController.KEY_CODE)) { mKeyCode = (Integer) msg.getData().get(KeyboardController.KEY_CODE); Intent intent = new Intent(); intent.setAction(MSG_KEY_BOARD); intent.putExtra(KeyboardController.KEY_CODE, mKeyCode); mcontext.sendBroadcast(intent); } else if (msg.getData().containsKey("INCLNE_CAL_FINISH")) { mInclineCalStatus = (Integer) msg.getData().get("INCLNE_CAL_FINISH"); } } }; mMachineStatusController = new MachieStatusController(messageHandler); mHeartController = new HeartController(messageHandler); mSpeedController = new SpeedController(messageHandler); mInclineController = new InclineController(messageHandler); mFootRateController = new FootRateController(messageHandler); mHardwareStatuscontroller = new HardwareStatusController(messageHandler); mKeyboardController = new KeyboardController(messageHandler); } } public void start() { mHeartController.start(); mSpeedController.start(); mInclineController.start(); mFootRateController.start(); mHardwareStatuscontroller.start(); mMachineStatusController.start(); mKeyboardController.start(); } public void stop() { mHeartController.stop(); mSpeedController.stop(); mInclineController.stop(); mFootRateController.stop(); mHardwareStatuscontroller.stop(); mMachineStatusController.stop(); mKeyboardController.stop(); } public int getRecvCommandCount() { return mHeartController.recvCommandCount; } public void setRecvCommandCount(int count) { mHeartController.recvCommandCount = count; } public void updateMCU(String filePath, Handler IOUpdateMsg) { mIOUpdateController = new IOUpdateController(IOUpdateMsg); mIOUpdateController.start(); mIOUpdateController.updateIO(filePath); } public void stopIOUpdateController() { if (mIOUpdateController != null) { mIOUpdateController.stop(); mIOUpdateController = null; } } public void enterErpStatus(int delayTime) { mMachineStatusController.enterERP(delayTime); } public void setReceiveBroadcast(Context context) { mcontext = context; } public void setSpeed(int speed) { mSpeedController.setSpeed(speed); } public void setIncline(int incline) { mInclineController.setIncline(incline); } public void startInclinecal() { mInclineCalStatus = -1; mInclineController.startInclinecal(); } public void stopInclinecal() { mInclineController.stopInclinecal(); } public void setFanLevel(int spdlvl) { mMachineStatusController.setFanSpeedLevel(spdlvl); } public void startMachine(int speed, int incline) { mMachineStatusController.startMachine(speed, incline); } public void stopMachine(int incline) { mMachineStatusController.stopMachine(incline); } public void pauseMachine() { mMachineStatusController.pauseMachine(); } public void sendMachineErrorCmd() { mMachineStatusController.sendMachineErrorCmd(); } public void sendCtlVersionCmd() { mMachineStatusController.sendCtlVersionCmd(); } public byte[] getMachineVersionBytes() { return mMachineStatusController.getMachineVersionBytes(); } public String getCtlVersionValue() { return mMachineStatusController.getCtlVersionValue(); } public int getFanLevel() { return mMachineStatusController.getFanSpeedLevel(); } public int getInclinecalStatus() { return mInclineCalStatus; } public void getIncline(Handler handler) { mUIGetIncline = handler; mInclineController.getIncline(); } public void getSpeed(Handler handler) { mUIGetSpeed = handler; mSpeedController.getSpeed(); } public int getIncline() { return mIncline; } public int getSpeed() { return mSpeed; } public int getPaceRate() { return mPaceRate; } public int getHeartRate() { return mHeartRate; } public int getHardwareStatus() { return mHardwareStatus; } public int getSafeKeyStatus() { return mHardwareStatuscontroller.getSafeKeyStatus(); } public void sendRfidCommand() { mMachineStatusController.sendRfidCmd(); } public int getRfidStatus() { return mMachineStatusController.getRfidStatus(); } public void sendCommands(Commands commands, byte[] data) { mMachineStatusController.sendCommands(commands, data); } public void setUIIntMessage(Handler handler, String key, int value) { Bundle bndl = new Bundle(); bndl.putInt(key, value); Message msg = new Message(); msg.setData(bndl); handler.sendMessage(msg); } }
8,555
0.632262
0.632145
255
32.549019
25.895653
115
false
false
0
0
0
0
0
0
0.509804
false
false
13
5339343856fa99b698294ec3b443bcc1e2ff875c
17,300,128,326,211
9cc787156dfc24e5c5968f07aeb9d2518c6f8581
/Introduction to function/3 power.java
4b01f865b67704776f815a9705bd481ba2e0cceb
[ "MIT" ]
permissive
sneh-pragya/LearningPrograming
https://github.com/sneh-pragya/LearningPrograming
dcb6088b943ff9ac48d33d5b21efbc8777273e84
cb59cecb3ec6980a97d02b97b2021d2f403f60ba
refs/heads/main
2023-08-29T10:10:33.320000
2021-11-03T14:52:25
2021-11-03T14:52:25
406,765,552
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
//You are given two integers A and B. //You have to find the value of A to the power B public class Solution { // DO NOT MODIFY THE LIST. IT IS READ ONLY public int power(final int A, final int B) { int power =1; for (int i=1; i<= B; i++){ power= power*A; } return power; } }
UTF-8
Java
334
java
3 power.java
Java
[]
null
[]
//You are given two integers A and B. //You have to find the value of A to the power B public class Solution { // DO NOT MODIFY THE LIST. IT IS READ ONLY public int power(final int A, final int B) { int power =1; for (int i=1; i<= B; i++){ power= power*A; } return power; } }
334
0.553892
0.547904
14
22.857143
17.282763
48
false
false
0
0
0
0
0
0
0.428571
false
false
13
1420a500f20d3efc2426ac2aa8c3e61338a2ead5
27,462,020,957,134
bc75a2cf3842c65bbc206609d3105e55ce120190
/src/com/yu/day1/Demo.java
6d98db2970dd1e614b671deed2abda3b14628301
[]
no_license
h404j/java
https://github.com/h404j/java
3d13be827f1abff9164f79e241536a50f9043c15
dffe31dc3e7d77b8b0de6d49e188557a0cef0d5b
refs/heads/main
2023-01-23T03:55:12.228000
2020-10-21T01:51:34
2020-10-21T01:51:34
305,112,225
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.yu.day1; public class Demo { public static void main(String[] args) { cat a=new cat("猫",12); a.eat(); a.jump(); a.run(); a.die(); System.out.println( a.getSpecie()+a.getHigh()); a.setSpecie("狗"); a.setHigh(190); System.out.println( a.getSpecie()+a.getHigh()); a.catchmouse(); } }
UTF-8
Java
385
java
Demo.java
Java
[]
null
[]
package com.yu.day1; public class Demo { public static void main(String[] args) { cat a=new cat("猫",12); a.eat(); a.jump(); a.run(); a.die(); System.out.println( a.getSpecie()+a.getHigh()); a.setSpecie("狗"); a.setHigh(190); System.out.println( a.getSpecie()+a.getHigh()); a.catchmouse(); } }
385
0.503937
0.488189
16
22.8125
15.981313
55
false
false
0
0
0
0
0
0
0.75
false
false
13
cd94612a2e17e26b85deb6d2b3a489467ad31f31
7,464,653,216,411
bdb68a9161c02f3d67ec964cd513adf12c191d33
/app/src/main/java/com/alan/handsome/base/bean/Encrypt.java
5b7e2a253f31cb3f997861a69049872105463b77
[]
no_license
ALanTin00/MoneyDemo
https://github.com/ALanTin00/MoneyDemo
e06136b995d87f6b94d02df50b0e7abe402028d7
0315eb2567a3b56c42cac1a125022e63d0166d32
refs/heads/master
2023-01-08T10:11:27.016000
2020-11-05T03:56:54
2020-11-05T03:56:54
307,052,102
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.alan.handsome.base.bean; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * 类说明:标注类的要加密的属性 * 作者:qiujialiu * 时间:2019/1/17 */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) public @interface Encrypt { }
UTF-8
Java
407
java
Encrypt.java
Java
[ { "context": "notation.Target;\r\n\r\n/**\r\n * 类说明:标注类的要加密的属性\r\n * 作者:qiujialiu\r\n * 时间:2019/1/17\r\n */\r\n@Retention(RetentionPolicy", "end": 246, "score": 0.9988095760345459, "start": 237, "tag": "USERNAME", "value": "qiujialiu" } ]
null
[]
package com.alan.handsome.base.bean; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * 类说明:标注类的要加密的属性 * 作者:qiujialiu * 时间:2019/1/17 */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) public @interface Encrypt { }
407
0.749319
0.730245
16
20.9375
15.562249
44
false
false
0
0
0
0
0
0
0.3125
false
false
13
58c8ee280313a8e63786d7294bb3a1df795ce5fd
14,989,435,921,447
c64bed517e09175a53f330261e60ff786a2d3ff7
/wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/model/ModelUtils.java
9ddf0f427ba89919225d4cf8ece8887841ac1266
[ "Apache-2.0" ]
permissive
krichter722/wicket-orientdb
https://github.com/krichter722/wicket-orientdb
582e4d897431494ca30bb21873a35a9f44ef4a5d
66e1016801ff6fad9e78bbde35c73a560fe64dad
refs/heads/master
2021-01-17T11:57:07.156000
2015-04-01T23:51:20
2015-04-01T23:51:20
33,389,435
0
0
null
true
2015-04-04T00:50:39
2015-04-04T00:50:39
2015-04-03T23:40:11
2015-04-01T23:51:49
925
0
0
0
null
null
null
package ru.ydn.wicket.wicketorientdb.model; import java.io.Serializable; import org.apache.wicket.WicketRuntimeException; import org.apache.wicket.model.IModel; import org.apache.wicket.model.Model; import com.orientechnologies.orient.core.record.impl.ODocument; import com.orientechnologies.orient.core.type.ODocumentWrapper; public class ModelUtils { @SuppressWarnings("unchecked") public static <K> IModel<K> model(K o) { if(o instanceof ODocument) return (IModel<K>)new ODocumentModel((ODocument)o); else if(o instanceof ODocumentWrapper) return (IModel<K>)new ODocumentWrapperModel<ODocumentWrapper>((ODocumentWrapper)o); else if(o instanceof Serializable) return (IModel<K>)Model.of((Serializable)o); else throw new WicketRuntimeException(ModelUtils.class.getSimpleName()+" can't work with non serializable objects: "+o); } }
UTF-8
Java
868
java
ModelUtils.java
Java
[]
null
[]
package ru.ydn.wicket.wicketorientdb.model; import java.io.Serializable; import org.apache.wicket.WicketRuntimeException; import org.apache.wicket.model.IModel; import org.apache.wicket.model.Model; import com.orientechnologies.orient.core.record.impl.ODocument; import com.orientechnologies.orient.core.type.ODocumentWrapper; public class ModelUtils { @SuppressWarnings("unchecked") public static <K> IModel<K> model(K o) { if(o instanceof ODocument) return (IModel<K>)new ODocumentModel((ODocument)o); else if(o instanceof ODocumentWrapper) return (IModel<K>)new ODocumentWrapperModel<ODocumentWrapper>((ODocumentWrapper)o); else if(o instanceof Serializable) return (IModel<K>)Model.of((Serializable)o); else throw new WicketRuntimeException(ModelUtils.class.getSimpleName()+" can't work with non serializable objects: "+o); } }
868
0.77765
0.77765
22
38.454544
38.146519
127
false
false
0
0
0
0
0
0
0.818182
false
false
13
5986f2896f2f5d9071c5024e2448209f01940980
17,858,474,079,733
5d16ec88933b4028fc094b05cf02c219be0711be
/redora/configuration/src/main/java/redora/configuration/rdo/service/base/UpgradeBase.java
fa9791c773d606e0db3bd86a7e6aaa5299ca2425
[ "Apache-2.0" ]
permissive
tectronics/redora
https://github.com/tectronics/redora
d048dee98c10f216c58d380779bb9ab197d814fc
5b7386619aefe204a777f323fa896493c0e01663
refs/heads/master
2018-01-11T15:02:42.505000
2012-03-22T07:34:50
2012-03-22T07:34:50
45,293,657
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * Copyright 2009-2010 Nanjing RedOrange ltd (http://www.red-orange.cn) * * 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 redora.configuration.rdo.service.base; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import redora.configuration.rdo.model.RedoraConfiguration; import redora.configuration.rdo.service.RedoraConfigurationService; import redora.configuration.rdo.service.ServiceFactory; import redora.exceptions.*; import redora.service.BusinessRuleViolation; import redora.service.ServiceBase; import redora.util.ResourceFileHandler; import javax.servlet.ServletContext; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Set; import java.util.logging.Logger; import static java.util.logging.Level.*; import static redora.api.fetch.Page.ALL_TABLE; import static redora.configuration.rdo.model.base.RedoraConfigurationBase.Status.Error; import static redora.configuration.rdo.model.base.RedoraConfigurationBase.Status.*; /** * Base class for bridging your object model and the database tables. * In your application in the 'target/generated-sources/redora-target' directory * you can find the ...rdo.service.Upgrade class. This Upgrade extends this base class. * Usages * <br><br> * Create Tables<br> * In all you have functionality to create tables based on the model (see ..rdo.sql(and .base) * for the CREATE_TABLE statement. * <br><br> * Definition Check<br> * There is a function that checks if the table definition in the database is still in sync * with your model: see ..rdo.service.check for the PojoCheck classes. For example you might have changed * your model but have forgotten to add an alter table script. * <br><br> * Running Upgrade Scripts<br> * The upgrade function implemented in Upgrade and UpgradeBase. All upgrade scripts, * files located in /src/main/resources/upgrade are executed once for you application. Redora will * maintain the RedoraConfiguration table with a list of upgrade scripts and their execution status. * * @author Nanjing RedOrange (http://www.red-orange.cn) */ public abstract class UpgradeBase extends ServiceBase { static final transient Logger l = Logger.getLogger("redora.configuration.rdo.service.base.UpgradeBase"); public final static String[] redoraTables = {"RedoraConfiguration", "RedoraTrash"}; public abstract List<String> objects(); public abstract String[] relationTables(); public abstract String[] scripts(); /** * Only access this class through the Upgrade class in your application located * in ..rdo.service in the generated-sources target. * * @throws ConnectException On failing to get a DB connection */ protected UpgradeBase(@NotNull String schema) throws ConnectException { super(schema); } public void upgradeTables(@Nullable PrintWriter out, @Nullable ServletContext context) throws RedoraException, IOException { executeUpgradeScript(context); boolean retVal; ResultSet rs = null; try { rs = st.con.con.getMetaData().getTables(null, null, null, null); while (rs.next()) { retVal = false; for (String tableName : objects()) { if (rs.getString("TABLE_NAME").equalsIgnoreCase(tableName)) { retVal = true; break; } } for (String tableName : relationTables()) { if (rs.getString("TABLE_NAME").equalsIgnoreCase(tableName)) { retVal = true; break; } } for (String tableName : redoraTables) { if (rs.getString("TABLE_NAME").equalsIgnoreCase(tableName)) { retVal = true; break; } } if (!retVal) { l.log(WARNING, "Table {0} does not exist in the model, but i did find it in the database", rs.getString("TABLE_NAME")); // if (out != null) { // out.println("Warning: table " + rs.getString("TABLE_NAME") + " does not exist in the model, but i did find it in database." + "<br>"); // } } } } catch (SQLException e) { l.log(SEVERE, "Failed to open meta data", e); throw new QueryException("Failed to open meta data", e); } finally { close(rs); } } protected void executeUpgradeScript(@Nullable ServletContext context) throws RedoraException { initUpgradeScript(); RedoraConfigurationService service = ServiceFactory.redoraConfigurationService(); ResultSet rs = null; try { for (RedoraConfiguration conf : service.findByStatus(New, ALL_TABLE)) { String currentScript = null; try { for (String sql : loadSql(conf.getScriptName(), context)) { currentScript = sql; execute(currentScript); l.log(INFO, "Adding SQL statement: {0}", currentScript); } conf.setStatus(Ready); if (!service.persist(conf).isEmpty()) { throw new BusinessRuleViolationException("Failed to persist RedoraConfiguration due to a business rule violation (" + conf + ")"); } } catch (QueryException e) { l.log(WARNING, "Failed to perform upgrade script " + currentScript + " from upgrade file: " + conf.getScriptName(), e); conf.setStatus(Error); String error = "Failed with this script\r\n" + currentScript + "\r\nWith error:\r\n" + e.getMessage(); try { conf.setOutput(error); if (!service.persist(conf).isEmpty()) { throw new BusinessRuleViolationException("Failed to persist RedoraConfiguration due to a business rule violation (" + conf + ")"); } } catch (PersistException e1) { l.log(SEVERE, "Failed to persist configuration " + error, e1); } } } } catch (IOException e) { l.log(SEVERE, "Failed", e); } finally { close(rs); ServiceFactory.close(service); } } /** * Scans the SCRIPT_SOURCE_DIR for new upgrade scripts. Adds them to RedoraConfiguration. * * @throws RedoraException New scripts are added to the RedoraConfiguration table. This exception * is thrown when failing to manipulate this table. */ protected void initUpgradeScript() throws RedoraException { RedoraConfigurationService service = null; try { service = ServiceFactory.redoraConfigurationService(); for (String upgrade : scripts()) { if (service.findByScriptName(upgrade, ALL_TABLE).isEmpty()) { RedoraConfiguration conf = new RedoraConfiguration(); conf.setScriptName(upgrade); Set<BusinessRuleViolation> brViolations = service.persist(conf); if (!brViolations.isEmpty()) { String s = "One or more business rules have been violated: "; for (BusinessRuleViolation br : brViolations) { s += br.getPersistable().getClass().getName() + " id: " + br.getPersistable().getId() + " for rule: " + br.getBusinessRuleId(); } l.log(SEVERE, "Failed to persist new configuration for script {0}", upgrade); throw new BusinessRuleViolationException(s); } l.log(INFO, "Found new script file {0}", conf.getScriptName()); } } } finally { redora.configuration.rdo.service.ServiceFactory.close(service); } } /** * Locates the script file and makes a list of sql statements in the file. * Each SQL statement is supposed to end with ;. * * @param sqlFile (Mandatory) File name of the upgrade script without path * @param context (Optional) The servlet container (if applicable) for classpath reference to load the file * @return Empty or filled list with SQL statements. * @throws IOException When loading the script file fails/ */ @NotNull List<String> loadSql(@NotNull String sqlFile, @Nullable ServletContext context) throws IOException { List<String> retVal = new ArrayList<String>(); InputStream in = ResourceFileHandler.findUpgradeFile(sqlFile, context); if (in == null) { throw new IOException("Did not find upgrade file " + sqlFile); } String upgradeFile = IOUtils.toString(in, "utf-8"); in.close(); String[] sqlStatements = upgradeFile.split("(;\\s*\\r\\n)|(;\\s*\\n)"); for (String sql : sqlStatements) { sql = sql.replaceAll("--.*", "").trim(); sql = sql.replaceAll("#.*", "").trim(); if (StringUtils.isNotEmpty(sql)) { retVal.add(sql); } } return retVal; } protected void checkRelationTable(@NotNull String tableName, @NotNull String objectA , @NotNull String objectB, @NotNull PrintWriter out) throws ConnectException, QueryException { ResultSet rs = null; try { rs = st.con.con.getMetaData().getColumns("", "", tableName, ""); HashMap<String, HashMap<String, Object>> map = new HashMap<String, HashMap<String, Object>>(); while (rs.next()) { HashMap<String, Object> list = new HashMap<String, Object>(); list.put("COLUMN_NAME", rs.getString("COLUMN_NAME")); list.put("DATA_TYPE", rs.getInt("DATA_TYPE")); map.put(rs.getString("COLUMN_NAME"), list); } for (String key : map.keySet()) { String COLUMN_NAME = map.get(key).get("COLUMN_NAME").toString(); if (!(COLUMN_NAME.equalsIgnoreCase(objectA) || COLUMN_NAME.equalsIgnoreCase(objectB) || COLUMN_NAME.equalsIgnoreCase("creationDate") || COLUMN_NAME.equalsIgnoreCase("updateDate") || COLUMN_NAME.equalsIgnoreCase("roDeleted"))) { l.log(WARNING, " {0} does not have {1} attribute but it exists in database", new Object[]{tableName, key}); if (out != null) { out.print(tableName + " does not have " + key + " attribute but it exists in database.<br>"); } } } if (!map.containsKey(objectA)) { l.log(WARNING, "{0}.{1} does not existed or its sqltype does not match according to xml", new Object[]{tableName, objectA}); if (out != null) { out.print(tableName + "." + objectA + " does not existed or its sqltype does not match according to xml.<br>"); } } if (!map.containsKey(objectB)) { l.log(WARNING, "{0}.{1} does not existed or its sqltype does not match according to xml", new Object[]{tableName, objectB}); if (out != null) { out.print(tableName + "." + objectB + " does not existed or its sqltype does not match according to xml.<br>"); } } if (!map.containsKey("creationDate")) { l.log(WARNING, "{0}.creationDate does not existed or its sqltype does not match according to xml", tableName); if (out != null) { out.print(tableName + ".creationDate does not existed or its sqltype does not match according to xml.<br>"); } } if (!map.containsKey("updateDate")) { l.log(WARNING, "{0}.updateDate does not existed or its sqltype does not match according to xml", tableName); if (out != null) { out.print(tableName + ".updateDate does not existed or its sqltype does not match according to xml.<br>"); } } } catch (SQLException e) { l.log(SEVERE, "Failed to execute checkRelationTable " + tableName, e); throw new QueryException("Failed to execute checkRelationTable " + tableName, e); } finally { close(rs); } } @Override public void close() { super.close(); } }
UTF-8
Java
13,644
java
UpgradeBase.java
Java
[ { "context": " scripts and their execution status.\n *\n * @author Nanjing RedOrange (http://www.red-orange.cn)\n */\npublic a", "end": 2819, "score": 0.9998804926872253, "start": 2812, "tag": "NAME", "value": "Nanjing" } ]
null
[]
/* * Copyright 2009-2010 Nanjing RedOrange ltd (http://www.red-orange.cn) * * 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 redora.configuration.rdo.service.base; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import redora.configuration.rdo.model.RedoraConfiguration; import redora.configuration.rdo.service.RedoraConfigurationService; import redora.configuration.rdo.service.ServiceFactory; import redora.exceptions.*; import redora.service.BusinessRuleViolation; import redora.service.ServiceBase; import redora.util.ResourceFileHandler; import javax.servlet.ServletContext; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Set; import java.util.logging.Logger; import static java.util.logging.Level.*; import static redora.api.fetch.Page.ALL_TABLE; import static redora.configuration.rdo.model.base.RedoraConfigurationBase.Status.Error; import static redora.configuration.rdo.model.base.RedoraConfigurationBase.Status.*; /** * Base class for bridging your object model and the database tables. * In your application in the 'target/generated-sources/redora-target' directory * you can find the ...rdo.service.Upgrade class. This Upgrade extends this base class. * Usages * <br><br> * Create Tables<br> * In all you have functionality to create tables based on the model (see ..rdo.sql(and .base) * for the CREATE_TABLE statement. * <br><br> * Definition Check<br> * There is a function that checks if the table definition in the database is still in sync * with your model: see ..rdo.service.check for the PojoCheck classes. For example you might have changed * your model but have forgotten to add an alter table script. * <br><br> * Running Upgrade Scripts<br> * The upgrade function implemented in Upgrade and UpgradeBase. All upgrade scripts, * files located in /src/main/resources/upgrade are executed once for you application. Redora will * maintain the RedoraConfiguration table with a list of upgrade scripts and their execution status. * * @author Nanjing RedOrange (http://www.red-orange.cn) */ public abstract class UpgradeBase extends ServiceBase { static final transient Logger l = Logger.getLogger("redora.configuration.rdo.service.base.UpgradeBase"); public final static String[] redoraTables = {"RedoraConfiguration", "RedoraTrash"}; public abstract List<String> objects(); public abstract String[] relationTables(); public abstract String[] scripts(); /** * Only access this class through the Upgrade class in your application located * in ..rdo.service in the generated-sources target. * * @throws ConnectException On failing to get a DB connection */ protected UpgradeBase(@NotNull String schema) throws ConnectException { super(schema); } public void upgradeTables(@Nullable PrintWriter out, @Nullable ServletContext context) throws RedoraException, IOException { executeUpgradeScript(context); boolean retVal; ResultSet rs = null; try { rs = st.con.con.getMetaData().getTables(null, null, null, null); while (rs.next()) { retVal = false; for (String tableName : objects()) { if (rs.getString("TABLE_NAME").equalsIgnoreCase(tableName)) { retVal = true; break; } } for (String tableName : relationTables()) { if (rs.getString("TABLE_NAME").equalsIgnoreCase(tableName)) { retVal = true; break; } } for (String tableName : redoraTables) { if (rs.getString("TABLE_NAME").equalsIgnoreCase(tableName)) { retVal = true; break; } } if (!retVal) { l.log(WARNING, "Table {0} does not exist in the model, but i did find it in the database", rs.getString("TABLE_NAME")); // if (out != null) { // out.println("Warning: table " + rs.getString("TABLE_NAME") + " does not exist in the model, but i did find it in database." + "<br>"); // } } } } catch (SQLException e) { l.log(SEVERE, "Failed to open meta data", e); throw new QueryException("Failed to open meta data", e); } finally { close(rs); } } protected void executeUpgradeScript(@Nullable ServletContext context) throws RedoraException { initUpgradeScript(); RedoraConfigurationService service = ServiceFactory.redoraConfigurationService(); ResultSet rs = null; try { for (RedoraConfiguration conf : service.findByStatus(New, ALL_TABLE)) { String currentScript = null; try { for (String sql : loadSql(conf.getScriptName(), context)) { currentScript = sql; execute(currentScript); l.log(INFO, "Adding SQL statement: {0}", currentScript); } conf.setStatus(Ready); if (!service.persist(conf).isEmpty()) { throw new BusinessRuleViolationException("Failed to persist RedoraConfiguration due to a business rule violation (" + conf + ")"); } } catch (QueryException e) { l.log(WARNING, "Failed to perform upgrade script " + currentScript + " from upgrade file: " + conf.getScriptName(), e); conf.setStatus(Error); String error = "Failed with this script\r\n" + currentScript + "\r\nWith error:\r\n" + e.getMessage(); try { conf.setOutput(error); if (!service.persist(conf).isEmpty()) { throw new BusinessRuleViolationException("Failed to persist RedoraConfiguration due to a business rule violation (" + conf + ")"); } } catch (PersistException e1) { l.log(SEVERE, "Failed to persist configuration " + error, e1); } } } } catch (IOException e) { l.log(SEVERE, "Failed", e); } finally { close(rs); ServiceFactory.close(service); } } /** * Scans the SCRIPT_SOURCE_DIR for new upgrade scripts. Adds them to RedoraConfiguration. * * @throws RedoraException New scripts are added to the RedoraConfiguration table. This exception * is thrown when failing to manipulate this table. */ protected void initUpgradeScript() throws RedoraException { RedoraConfigurationService service = null; try { service = ServiceFactory.redoraConfigurationService(); for (String upgrade : scripts()) { if (service.findByScriptName(upgrade, ALL_TABLE).isEmpty()) { RedoraConfiguration conf = new RedoraConfiguration(); conf.setScriptName(upgrade); Set<BusinessRuleViolation> brViolations = service.persist(conf); if (!brViolations.isEmpty()) { String s = "One or more business rules have been violated: "; for (BusinessRuleViolation br : brViolations) { s += br.getPersistable().getClass().getName() + " id: " + br.getPersistable().getId() + " for rule: " + br.getBusinessRuleId(); } l.log(SEVERE, "Failed to persist new configuration for script {0}", upgrade); throw new BusinessRuleViolationException(s); } l.log(INFO, "Found new script file {0}", conf.getScriptName()); } } } finally { redora.configuration.rdo.service.ServiceFactory.close(service); } } /** * Locates the script file and makes a list of sql statements in the file. * Each SQL statement is supposed to end with ;. * * @param sqlFile (Mandatory) File name of the upgrade script without path * @param context (Optional) The servlet container (if applicable) for classpath reference to load the file * @return Empty or filled list with SQL statements. * @throws IOException When loading the script file fails/ */ @NotNull List<String> loadSql(@NotNull String sqlFile, @Nullable ServletContext context) throws IOException { List<String> retVal = new ArrayList<String>(); InputStream in = ResourceFileHandler.findUpgradeFile(sqlFile, context); if (in == null) { throw new IOException("Did not find upgrade file " + sqlFile); } String upgradeFile = IOUtils.toString(in, "utf-8"); in.close(); String[] sqlStatements = upgradeFile.split("(;\\s*\\r\\n)|(;\\s*\\n)"); for (String sql : sqlStatements) { sql = sql.replaceAll("--.*", "").trim(); sql = sql.replaceAll("#.*", "").trim(); if (StringUtils.isNotEmpty(sql)) { retVal.add(sql); } } return retVal; } protected void checkRelationTable(@NotNull String tableName, @NotNull String objectA , @NotNull String objectB, @NotNull PrintWriter out) throws ConnectException, QueryException { ResultSet rs = null; try { rs = st.con.con.getMetaData().getColumns("", "", tableName, ""); HashMap<String, HashMap<String, Object>> map = new HashMap<String, HashMap<String, Object>>(); while (rs.next()) { HashMap<String, Object> list = new HashMap<String, Object>(); list.put("COLUMN_NAME", rs.getString("COLUMN_NAME")); list.put("DATA_TYPE", rs.getInt("DATA_TYPE")); map.put(rs.getString("COLUMN_NAME"), list); } for (String key : map.keySet()) { String COLUMN_NAME = map.get(key).get("COLUMN_NAME").toString(); if (!(COLUMN_NAME.equalsIgnoreCase(objectA) || COLUMN_NAME.equalsIgnoreCase(objectB) || COLUMN_NAME.equalsIgnoreCase("creationDate") || COLUMN_NAME.equalsIgnoreCase("updateDate") || COLUMN_NAME.equalsIgnoreCase("roDeleted"))) { l.log(WARNING, " {0} does not have {1} attribute but it exists in database", new Object[]{tableName, key}); if (out != null) { out.print(tableName + " does not have " + key + " attribute but it exists in database.<br>"); } } } if (!map.containsKey(objectA)) { l.log(WARNING, "{0}.{1} does not existed or its sqltype does not match according to xml", new Object[]{tableName, objectA}); if (out != null) { out.print(tableName + "." + objectA + " does not existed or its sqltype does not match according to xml.<br>"); } } if (!map.containsKey(objectB)) { l.log(WARNING, "{0}.{1} does not existed or its sqltype does not match according to xml", new Object[]{tableName, objectB}); if (out != null) { out.print(tableName + "." + objectB + " does not existed or its sqltype does not match according to xml.<br>"); } } if (!map.containsKey("creationDate")) { l.log(WARNING, "{0}.creationDate does not existed or its sqltype does not match according to xml", tableName); if (out != null) { out.print(tableName + ".creationDate does not existed or its sqltype does not match according to xml.<br>"); } } if (!map.containsKey("updateDate")) { l.log(WARNING, "{0}.updateDate does not existed or its sqltype does not match according to xml", tableName); if (out != null) { out.print(tableName + ".updateDate does not existed or its sqltype does not match according to xml.<br>"); } } } catch (SQLException e) { l.log(SEVERE, "Failed to execute checkRelationTable " + tableName, e); throw new QueryException("Failed to execute checkRelationTable " + tableName, e); } finally { close(rs); } } @Override public void close() { super.close(); } }
13,644
0.591469
0.589417
297
44.939392
37.248592
166
false
false
0
0
0
0
0
0
0.649832
false
false
13
ba28e6d04e23ff4b689500d798986ed4601c2734
25,907,242,784,975
d3024f962f139ed5507d96dd2465d5d3d593d894
/hamster-sprite-web/src/main/java/org/hamster/sprite/portal/interceptor/WSInterceptor.java
8302b086ddf07e9490e69aaca15a3f964fd11d6c
[]
no_license
grossopa/hamster-sprite
https://github.com/grossopa/hamster-sprite
b28ff88a83d5d86ba3dd3add6864504890c90639
c89503d8dce2b08df820ddec06ceb10a0b17fa6f
refs/heads/master
2021-01-17T04:13:10.107000
2017-06-25T14:37:25
2017-06-25T14:37:25
47,980,166
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/** * */ package org.hamster.sprite.portal.interceptor; import java.util.Optional; import org.hamster.core.web.spring.interceptor.AbstractWebInterceptor; import org.hamster.sprite.service.user.api.model.AppUser; import org.hamster.sprite.service.user.api.service.UserService; import org.springframework.beans.factory.annotation.Autowired; /** * * * @author <a href="mailto:grossopaforever@gmail.com">Jack Yin</a> * @since 1.0 */ public class WSInterceptor extends AbstractWebInterceptor { @Autowired private UserService userService; /* * (non-Javadoc) * * @see org.hamster.core.web.spring.interceptor.InterceptorPathPatterns#pathPatterns() */ @Override public Optional<String[]> pathPatterns() { return Optional.of(new String[] { "/ws/**" }); } /* * (non-Javadoc) * * @see org.hamster.core.web.spring.interceptor.InterceptorPathPatterns#excludePathPatterns() */ @Override public Optional<String[]> excludePathPatterns() { return Optional.empty(); } /* * (non-Javadoc) * * @see org.hamster.core.web.spring.interceptor.AbstractWebInterceptor#getUserName() */ @Override protected String getUserName() { Optional<AppUser> user = userService.getCurrentUser(); return user.isPresent() ? user.get().getUsername() : "anonymous"; } }
UTF-8
Java
1,392
java
WSInterceptor.java
Java
[ { "context": ".Autowired;\n\n/**\n *\n *\n * @author <a href=\"mailto:grossopaforever@gmail.com\">Jack Yin</a>\n * @since 1.0\n */\npublic class WSIn", "end": 407, "score": 0.9999106526374817, "start": 382, "tag": "EMAIL", "value": "grossopaforever@gmail.com" }, { "context": "author <a href=\"mailto:grossopaforever@gmail.com\">Jack Yin</a>\n * @since 1.0\n */\npublic class WSInterceptor ", "end": 417, "score": 0.9998179078102112, "start": 409, "tag": "NAME", "value": "Jack Yin" } ]
null
[]
/** * */ package org.hamster.sprite.portal.interceptor; import java.util.Optional; import org.hamster.core.web.spring.interceptor.AbstractWebInterceptor; import org.hamster.sprite.service.user.api.model.AppUser; import org.hamster.sprite.service.user.api.service.UserService; import org.springframework.beans.factory.annotation.Autowired; /** * * * @author <a href="mailto:<EMAIL>"><NAME></a> * @since 1.0 */ public class WSInterceptor extends AbstractWebInterceptor { @Autowired private UserService userService; /* * (non-Javadoc) * * @see org.hamster.core.web.spring.interceptor.InterceptorPathPatterns#pathPatterns() */ @Override public Optional<String[]> pathPatterns() { return Optional.of(new String[] { "/ws/**" }); } /* * (non-Javadoc) * * @see org.hamster.core.web.spring.interceptor.InterceptorPathPatterns#excludePathPatterns() */ @Override public Optional<String[]> excludePathPatterns() { return Optional.empty(); } /* * (non-Javadoc) * * @see org.hamster.core.web.spring.interceptor.AbstractWebInterceptor#getUserName() */ @Override protected String getUserName() { Optional<AppUser> user = userService.getCurrentUser(); return user.isPresent() ? user.get().getUsername() : "anonymous"; } }
1,372
0.671695
0.670259
55
24.309092
27.822733
97
false
false
0
0
0
0
0
0
0.2
false
false
13
54049b99b16f9f942eb238c3b54ba0e43dd96cfc
16,423,954,941,439
2350a97bddfb849e64fd37fa81a949948ab029d9
/app/src/main/java/com/example/pooptest/PoopsView.java
e7edb4bd838a6bab219bc9a6bd56804f33f48a70
[]
no_license
NanJ7020/BunnyHealthCareFrontEnd_Android
https://github.com/NanJ7020/BunnyHealthCareFrontEnd_Android
be35c885ed52927be5e2037e4116e1991e10252d
3551bc37e8f407801d7021cd3cb779fddb93e06f
refs/heads/master
2022-06-21T09:58:59.188000
2020-05-07T22:20:15
2020-05-07T22:20:15
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.pooptest; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.Gravity; import android.view.View; import android.widget.Toast; import com.example.pooptest.PoopTest.CecalPoopActivity; import com.example.pooptest.PoopTest.HealthPoopActivity; import com.example.pooptest.PoopTest.StringPoopActivity; import com.example.pooptest.PoopTest.WateryPoopActivity; import com.example.pooptest.PoopTest.WormPoopActivity; import com.example.pooptest.SearchVet.VetSearchActivity; import com.example.pooptest.SearchVet.VetSearchBaseActivity; public class PoopsView extends AcctBaseActivity { public void healthPoop(View view) { Intent intent=new Intent(this, HealthPoopActivity.class); startActivity(intent); } public void cecalPoop (View view) { Intent intent=new Intent(this, CecalPoopActivity.class); startActivity(intent); } public void stringPoop(View view) { Intent intent=new Intent(this, StringPoopActivity.class); startActivity(intent); } public void wormPoop(View view) { Intent intent=new Intent(this, WormPoopActivity.class); startActivity(intent); } public void wateryPoop(View view) { Intent intent=new Intent(this, WateryPoopActivity.class); startActivity(intent); } public void mainMenu(View view) { Intent intent=new Intent(this, HealthCare.class); startActivity(intent); } /* public void wateryP_func (View view) { Toast toast = Toast.makeText(this,"Watery, no solid pieces, or entirely " + "liquid. You need bring your bunny to see a vet as soon as possible.", Toast.LENGTH_SHORT); toast.setGravity(Gravity.TOP|Gravity.CENTER_HORIZONTAL, 0, 1220); toast.show(); //looking for a vet Intent intent=new Intent(this, VetSearchActivity.class); startActivity(intent); } */ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_poops_view); } }
UTF-8
Java
2,247
java
PoopsView.java
Java
[]
null
[]
package com.example.pooptest; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.Gravity; import android.view.View; import android.widget.Toast; import com.example.pooptest.PoopTest.CecalPoopActivity; import com.example.pooptest.PoopTest.HealthPoopActivity; import com.example.pooptest.PoopTest.StringPoopActivity; import com.example.pooptest.PoopTest.WateryPoopActivity; import com.example.pooptest.PoopTest.WormPoopActivity; import com.example.pooptest.SearchVet.VetSearchActivity; import com.example.pooptest.SearchVet.VetSearchBaseActivity; public class PoopsView extends AcctBaseActivity { public void healthPoop(View view) { Intent intent=new Intent(this, HealthPoopActivity.class); startActivity(intent); } public void cecalPoop (View view) { Intent intent=new Intent(this, CecalPoopActivity.class); startActivity(intent); } public void stringPoop(View view) { Intent intent=new Intent(this, StringPoopActivity.class); startActivity(intent); } public void wormPoop(View view) { Intent intent=new Intent(this, WormPoopActivity.class); startActivity(intent); } public void wateryPoop(View view) { Intent intent=new Intent(this, WateryPoopActivity.class); startActivity(intent); } public void mainMenu(View view) { Intent intent=new Intent(this, HealthCare.class); startActivity(intent); } /* public void wateryP_func (View view) { Toast toast = Toast.makeText(this,"Watery, no solid pieces, or entirely " + "liquid. You need bring your bunny to see a vet as soon as possible.", Toast.LENGTH_SHORT); toast.setGravity(Gravity.TOP|Gravity.CENTER_HORIZONTAL, 0, 1220); toast.show(); //looking for a vet Intent intent=new Intent(this, VetSearchActivity.class); startActivity(intent); } */ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_poops_view); } }
2,247
0.698264
0.696039
84
25.75
24.930319
96
false
false
0
0
0
0
0
0
0.571429
false
false
13
19790f0485a456830932c51bbd98be7dde98f781
498,216,208,455
b96712da674099f67d91478a1fddfe40ff705778
/src/main/java/hu/doravar/logistics/security/LogisticsUserDetailsService.java
73294f6af3e3140ba6e2e7fdf7e57c4e1dcb5585
[]
no_license
doravar/logistics_application
https://github.com/doravar/logistics_application
d731e64e9127f6257a53f31f11f836aaf8541b25
93ea2aea344d8e619c89254abe38c6373c4518c6
refs/heads/master
2023-05-25T09:35:54.554000
2021-06-08T09:47:17
2021-06-08T09:47:17
374,958,939
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package hu.doravar.logistics.security; import java.util.stream.Collectors; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.authority.SimpleGrantedAuthority; 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; import org.springframework.stereotype.Service; import hu.doravar.logistics.model.LogisticsUser; import hu.doravar.logistics.repository.UserRepository; @Service public class LogisticsUserDetailsService implements UserDetailsService { @Autowired UserRepository userRepository; @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { LogisticsUser logisticsUser = userRepository.findById(username) .orElseThrow(()-> new UsernameNotFoundException(username)); return new User(username, logisticsUser.getPassword(), logisticsUser.getRoles().stream().map(SimpleGrantedAuthority::new) .collect(Collectors.toList())); } }
UTF-8
Java
1,213
java
LogisticsUserDetailsService.java
Java
[]
null
[]
package hu.doravar.logistics.security; import java.util.stream.Collectors; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.authority.SimpleGrantedAuthority; 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; import org.springframework.stereotype.Service; import hu.doravar.logistics.model.LogisticsUser; import hu.doravar.logistics.repository.UserRepository; @Service public class LogisticsUserDetailsService implements UserDetailsService { @Autowired UserRepository userRepository; @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { LogisticsUser logisticsUser = userRepository.findById(username) .orElseThrow(()-> new UsernameNotFoundException(username)); return new User(username, logisticsUser.getPassword(), logisticsUser.getRoles().stream().map(SimpleGrantedAuthority::new) .collect(Collectors.toList())); } }
1,213
0.812861
0.812861
32
35.90625
30.202814
90
false
false
0
0
0
0
0
0
1.25
false
false
13
0e28cbbf6ea7dae6cb828859bd07946e569203b0
14,714,557,975,216
b6cb55c0dc6dd775805ff393b18daefa70c88c0f
/Express/src/kyle/leis/eo/operation/manifest/da/SpscontentCondition.java
c493fd67f07f1d3f72d17cd73ebc268dd965ae30
[]
no_license
haha541514/Express
https://github.com/haha541514/Express
d12ec127df2c6137792ef2724ac2239a27f0dd86
72e59fdea51fdba395f52575918ef1972e357cec
refs/heads/master
2021-04-03T06:50:28.984000
2018-03-08T09:04:09
2018-03-08T09:06:50
124,365,014
2
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package kyle.leis.eo.operation.manifest.da; import kyle.common.dbaccess.query.GeneralCondition; public class SpscontentCondition extends GeneralCondition { public SpscontentCondition() { m_astrConditions = new String[1]; } public void setMfcode(String strMfcode) { this.setField(0, strMfcode); } public String getMfcode() { return this.getField(0); } }
UTF-8
Java
373
java
SpscontentCondition.java
Java
[]
null
[]
package kyle.leis.eo.operation.manifest.da; import kyle.common.dbaccess.query.GeneralCondition; public class SpscontentCondition extends GeneralCondition { public SpscontentCondition() { m_astrConditions = new String[1]; } public void setMfcode(String strMfcode) { this.setField(0, strMfcode); } public String getMfcode() { return this.getField(0); } }
373
0.75067
0.742627
19
18.631578
20.084585
59
false
false
0
0
0
0
0
0
1.052632
false
false
13
135ab5d14a2b1329f1d2db5f9abc6ecca9547074
13,391,708,052,721
9499a151234fb355d904dcf78341d9df2fa824f4
/src/com/grantbroadwater/animal/Chip.java
377757a8a837f0aa2dcf92374c43e87f1c5318fa
[]
no_license
broadwatergrant/AnimalRecordsSystem
https://github.com/broadwatergrant/AnimalRecordsSystem
171b8c1c730dbb1ad892e9fbdd43befc0638066c
18ccc7e6ca49af90ac6486adf48f735a32176e3d
refs/heads/master
2016-09-08T00:18:10.634000
2015-02-22T23:55:35
2015-02-22T23:55:35
30,434,341
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.grantbroadwater.animal; import java.util.Date; public final class Chip { private final boolean chipped; private final int chipNumber; private final String owner; private final Date contactDate; private final Date implantDate; public Chip(){ chipped = false; chipNumber = 0; owner = null; contactDate = null; implantDate = null; } public Chip(String owner, int chipNumber, Date contactDate){ chipped = true; this.owner = owner; this.chipNumber = chipNumber; this.contactDate = contactDate; this.implantDate = null; } public Chip(int chipNumber, Date implantDate){ this.chipped = false; this.chipNumber = chipNumber; this.implantDate = implantDate; this.owner = null; this.contactDate = null; } public static Chip parseChip(String representation){ Chip result = null; String[] parts = representation.split("-"); boolean chipped = Boolean.parseBoolean(parts[0]); if(chipped){ result = new Chip(parts[1], Integer.parseInt(parts[2]), Animal.parseDate(parts[3])); // Owner, chip #, Contact Date }else{ result = new Chip(Integer.parseInt(parts[1]), Animal.parseDate(parts[2])); // Chip #, Implant Date } return result; } public String stringRepresentation(){ String result = isChipped()+"-"; if(isChipped()) result += getOwner() + "-" + getChipNumber() + "-" + Animal.printDate(getContactDate()); else result += getChipNumber() + "-" + Animal.printDate(getImplantDate()); return result; } public boolean isChipped(){ return this.chipped; } public int getChipNumber(){ return this.chipNumber; } public String getOwner(){ return this.owner; } public Date getContactDate(){ return this.contactDate; } public Date getImplantDate(){ return this.implantDate; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + chipNumber; result = prime * result + (chipped ? 1231 : 1237); result = prime * result + ((contactDate == null) ? 0 : contactDate.hashCode()); result = prime * result + ((implantDate == null) ? 0 : implantDate.hashCode()); result = prime * result + ((owner == null) ? 0 : owner.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof Chip)) return false; Chip other = (Chip) obj; if (chipNumber != other.chipNumber) return false; if (chipped != other.chipped) return false; if (contactDate == null) { if (other.contactDate != null) return false; } else if (!contactDate.equals(other.contactDate)) return false; if (implantDate == null) { if (other.implantDate != null) return false; } else if (!implantDate.equals(other.implantDate)) return false; if (owner == null) { if (other.owner != null) return false; } else if (!owner.equals(other.owner)) return false; return true; } }
UTF-8
Java
2,987
java
Chip.java
Java
[]
null
[]
package com.grantbroadwater.animal; import java.util.Date; public final class Chip { private final boolean chipped; private final int chipNumber; private final String owner; private final Date contactDate; private final Date implantDate; public Chip(){ chipped = false; chipNumber = 0; owner = null; contactDate = null; implantDate = null; } public Chip(String owner, int chipNumber, Date contactDate){ chipped = true; this.owner = owner; this.chipNumber = chipNumber; this.contactDate = contactDate; this.implantDate = null; } public Chip(int chipNumber, Date implantDate){ this.chipped = false; this.chipNumber = chipNumber; this.implantDate = implantDate; this.owner = null; this.contactDate = null; } public static Chip parseChip(String representation){ Chip result = null; String[] parts = representation.split("-"); boolean chipped = Boolean.parseBoolean(parts[0]); if(chipped){ result = new Chip(parts[1], Integer.parseInt(parts[2]), Animal.parseDate(parts[3])); // Owner, chip #, Contact Date }else{ result = new Chip(Integer.parseInt(parts[1]), Animal.parseDate(parts[2])); // Chip #, Implant Date } return result; } public String stringRepresentation(){ String result = isChipped()+"-"; if(isChipped()) result += getOwner() + "-" + getChipNumber() + "-" + Animal.printDate(getContactDate()); else result += getChipNumber() + "-" + Animal.printDate(getImplantDate()); return result; } public boolean isChipped(){ return this.chipped; } public int getChipNumber(){ return this.chipNumber; } public String getOwner(){ return this.owner; } public Date getContactDate(){ return this.contactDate; } public Date getImplantDate(){ return this.implantDate; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + chipNumber; result = prime * result + (chipped ? 1231 : 1237); result = prime * result + ((contactDate == null) ? 0 : contactDate.hashCode()); result = prime * result + ((implantDate == null) ? 0 : implantDate.hashCode()); result = prime * result + ((owner == null) ? 0 : owner.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof Chip)) return false; Chip other = (Chip) obj; if (chipNumber != other.chipNumber) return false; if (chipped != other.chipped) return false; if (contactDate == null) { if (other.contactDate != null) return false; } else if (!contactDate.equals(other.contactDate)) return false; if (implantDate == null) { if (other.implantDate != null) return false; } else if (!implantDate.equals(other.implantDate)) return false; if (owner == null) { if (other.owner != null) return false; } else if (!owner.equals(other.owner)) return false; return true; } }
2,987
0.664212
0.657181
131
21.801527
20.638443
118
false
false
0
0
0
0
0
0
2.229008
false
false
4
b5001d53ff89c709a7491278ceb485d2ae3aa2b3
26,774,826,166,341
af3d60e20a667eac7846286773004a2a1b8b662b
/WEB .NET JSP Assigments/JSP/Assigment_2/src/java/Question_open.java
5f2b0268fa8b343e05ad8563e3ea330e0d8d3422
[]
no_license
Shb90ties/ALL
https://github.com/Shb90ties/ALL
d10924e2a10b55c9c7c6a8931333881c1b634b79
bcf3d3dae383d4ef6be5237391f98e056ba1e3f4
refs/heads/master
2021-01-20T08:16:27.072000
2017-07-19T08:10:44
2017-07-19T08:10:44
83,901,922
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet(urlPatterns = {"/Question_open"}) public class Question_open extends Game { protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); DefaultPrint p = new DefaultPrint(); p.Head(request, response); p.Menu(request, response); out.println("<div style=\"width: 80%; float: right; text-align: center; height: 900px;\">"); out.println("<form method=\"POST\" action=\"Question_checkSave\" id=\"qForm\">"); out.println("<div style=\"width: 50%; float: left; text-align: center; height: 900px;\">"); out.println("<input type=\"hidden\" name=\"idd\" value=\"Open_Question\">"); out.println("<h1>Pick a subject</h1><br>"); out.println("<input type=\"radio\" name=\"subject\" value=\"Math\">Math<br>"); out.println("<input type=\"radio\" name=\"subject\" value=\"History\">History<br>"); out.println("<input type=\"radio\" name=\"subject\" value=\"Politics\">Politics<br>"); out.println("<input type=\"radio\" name=\"subject\" value=\"Literature\">Literature<br>"); out.println("<input type=\"radio\" name=\"subject\" value=\"Science\">Science<br>"); out.println("<input type=\"radio\" name=\"subject\" value=\"Movies\">Movies<br>"); out.println("<input type=\"radio\" name=\"subject\" value=\"Animals\">Animals<br>"); out.println("<h1>Pick a difficulty level</h1><br>"); out.println("<input type=\"radio\" name=\"Difficulty\" value=\"Hard\">Hard<br>"); out.println("<input type=\"radio\" name=\"Difficulty\" value=\"Medium\">Medium<br>"); out.println("<input type=\"radio\" name=\"Difficulty\" value=\"Easy\">Easy<br>"); out.println("<br><br>"); out.println("<center><input type=\"submit\" name=\"submit\" value=\"submit\"></center>"); out.println("</div>"); out.println("<div style=\"width: 50%; float: right; text-align: center; height: 900px;\">"); out.println("<h1>Type the question</h1><br>"); out.println("<textarea rows=\"3\" cols=\"25\" wrap=\"hard\" style=\"width: 200px; height: 50px;\""); out.println("form=\"qForm\" name=\"question\"></textarea><br>"); out.println("<h1>Type the Answer</h1><br>"); out.println("<textarea rows=\"3\" cols=\"25\" wrap=\"hard\" style=\"width: 200px; height: 50px;\""); out.println("form=\"qForm\" name=\"answer\"></textarea><br>"); out.println("</div>"); out.println("</form>"); out.println("</div>"); p.Bottom(request, response); } // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> /** * Handles the HTTP <code>GET</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Handles the HTTP <code>POST</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Returns a short description of the servlet. * * @return a String containing servlet description */ @Override public String getServletInfo() { return "Short description"; }// </editor-fold> }
UTF-8
Java
4,585
java
Question_open.java
Java
[]
null
[]
import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet(urlPatterns = {"/Question_open"}) public class Question_open extends Game { protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); DefaultPrint p = new DefaultPrint(); p.Head(request, response); p.Menu(request, response); out.println("<div style=\"width: 80%; float: right; text-align: center; height: 900px;\">"); out.println("<form method=\"POST\" action=\"Question_checkSave\" id=\"qForm\">"); out.println("<div style=\"width: 50%; float: left; text-align: center; height: 900px;\">"); out.println("<input type=\"hidden\" name=\"idd\" value=\"Open_Question\">"); out.println("<h1>Pick a subject</h1><br>"); out.println("<input type=\"radio\" name=\"subject\" value=\"Math\">Math<br>"); out.println("<input type=\"radio\" name=\"subject\" value=\"History\">History<br>"); out.println("<input type=\"radio\" name=\"subject\" value=\"Politics\">Politics<br>"); out.println("<input type=\"radio\" name=\"subject\" value=\"Literature\">Literature<br>"); out.println("<input type=\"radio\" name=\"subject\" value=\"Science\">Science<br>"); out.println("<input type=\"radio\" name=\"subject\" value=\"Movies\">Movies<br>"); out.println("<input type=\"radio\" name=\"subject\" value=\"Animals\">Animals<br>"); out.println("<h1>Pick a difficulty level</h1><br>"); out.println("<input type=\"radio\" name=\"Difficulty\" value=\"Hard\">Hard<br>"); out.println("<input type=\"radio\" name=\"Difficulty\" value=\"Medium\">Medium<br>"); out.println("<input type=\"radio\" name=\"Difficulty\" value=\"Easy\">Easy<br>"); out.println("<br><br>"); out.println("<center><input type=\"submit\" name=\"submit\" value=\"submit\"></center>"); out.println("</div>"); out.println("<div style=\"width: 50%; float: right; text-align: center; height: 900px;\">"); out.println("<h1>Type the question</h1><br>"); out.println("<textarea rows=\"3\" cols=\"25\" wrap=\"hard\" style=\"width: 200px; height: 50px;\""); out.println("form=\"qForm\" name=\"question\"></textarea><br>"); out.println("<h1>Type the Answer</h1><br>"); out.println("<textarea rows=\"3\" cols=\"25\" wrap=\"hard\" style=\"width: 200px; height: 50px;\""); out.println("form=\"qForm\" name=\"answer\"></textarea><br>"); out.println("</div>"); out.println("</form>"); out.println("</div>"); p.Bottom(request, response); } // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> /** * Handles the HTTP <code>GET</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Handles the HTTP <code>POST</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Returns a short description of the servlet. * * @return a String containing servlet description */ @Override public String getServletInfo() { return "Short description"; }// </editor-fold> }
4,585
0.593239
0.584515
91
49.373627
36.113876
123
false
false
0
0
0
0
0
0
0.802198
false
false
4
677b850bfabc5d5d110e6a50f21b2b9bd402952f
37,125,697,339,083
0f223de029a1073b4a05aa96dbbe909faea4a6e5
/tugas 3/testmethodoverloading.java
f940362ca2d0fd320f40dc4a45555b709c38248b
[]
no_license
baguspurnomo/1441180039TugasPBO
https://github.com/baguspurnomo/1441180039TugasPBO
7190f0d0bc31c0523762fb5af4983d5c5d37f181
c0731269bd8f424082eed89d979b56acd6130ccc
refs/heads/master
2021-01-22T13:47:34.047000
2015-07-09T04:43:18
2015-07-09T04:43:18
32,022,210
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
//Example to illustrate method overloading public class testmethodoverloading { public static int average(int nSatu, int nDua){ //A return (nSatu+nDua)/2; } public static double average(double nSatu, double nDua){ // B return (nSatu+nDua)/2; } public static double average(int nSatu, int nDua, int nTiga){ // C return (nSatu+nDua+nTiga)/3; } public static void main(String[] args) { System.out.println(average(1, 2)); // A System.out.println(average(1.0, 2.0)); // B System.out.println(average(1, 2, 3)); // C System.out.println(average(1.0, 2)); // D } }
UTF-8
Java
592
java
testmethodoverloading.java
Java
[]
null
[]
//Example to illustrate method overloading public class testmethodoverloading { public static int average(int nSatu, int nDua){ //A return (nSatu+nDua)/2; } public static double average(double nSatu, double nDua){ // B return (nSatu+nDua)/2; } public static double average(int nSatu, int nDua, int nTiga){ // C return (nSatu+nDua+nTiga)/3; } public static void main(String[] args) { System.out.println(average(1, 2)); // A System.out.println(average(1.0, 2.0)); // B System.out.println(average(1, 2, 3)); // C System.out.println(average(1.0, 2)); // D } }
592
0.663851
0.638514
23
24.782608
22.835815
67
false
false
0
0
0
0
0
0
2.173913
false
false
4
4380abb8520c5b03bdfa5ade964c86cec7c8fbbc
37,125,697,338,403
086d506805c75a81d90b7c3723a0b5716ecc47c5
/Implementation/RedBlackTree.java
27c377e93c45b0fe2c4e6311f6b25865432d38d7
[]
no_license
ChetanKaushik702/DSA
https://github.com/ChetanKaushik702/DSA
d09faccfcbaf31e814d9a98d01fb5fa7cc5ee907
4a6bcc9b53a139b5e339db0f80e9e9440acc477e
refs/heads/main
2023-05-31T11:17:53.967000
2021-06-30T13:53:12
2021-06-30T13:53:12
374,174,373
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* Red-Black tree properties: ** (i) Every node is either red or black. ** (ii) Root node is always black. ** (iii) Every leaf(NIL) is black. ** (iv) If a node is red, then its children are black. ** (v) For each node, all simple paths from the node to the descendant leaves ** contain the same number of black nodes. */ class RBT { private static final int RED = 1; private static final int BLACK = 0; // inorder-traversal routine void inorder(Sentinel T, Node root) { if (root != T.nil) { inorder(T, root.left); System.out.println("key: " + root.key + "\tcolor: " + root.color); inorder(T, root.right); } } // preorder-traversal routine void preorder(Sentinel T, Node root) { if (root != T.nil) { System.out.println("key: " + root.key + "\tcolor: " + root.color); preorder(T, root.left); preorder(T, root.right); } } // tree-minimum routine Node treeMinimum(Sentinel T, Node root) { while (root != T.nil && root.left != T.nil) root = root.left; return root; } // search routine Node search(Sentinel T, int key) { Node root = T.root; while (root != T.nil) { if (root.key == key) return root; else if (root.key > key) root = root.left; else root = root.right; } return null; } // right-Rotate routine void rightRotate(Sentinel T, Node x) { // System.out.println("Inside rightRotate: " + x.key); /* Assumption: x.left != T.nil and root's parent is T.nil*/ Node y = x.left; // set y x.left = y.right; // turn y's right subtree into x's left subtree if (y.right != T.nil) y.right.p = x; y.p = x.p; // link x's parent to y's parent if (x.p == T.nil) T.root = y; else if (x == x.p.left) x.p.left = y; else x.p.right = y; y.right = x; // put x on y's right x.p = y; } // left-Rotate routine void leftRotate(Sentinel T, Node x) { // System.out.println("Inside leftRotate: " + x.key); /* Assumption: x.right != T.nil and root's parent is T.nil*/ Node y = x.right; // set y x.right = y.left; // turn y's left subtree into x's right subtree if (y.left != T.nil) y.left.p = x; y.p = x.p; // link x's parent to y if (x.p == T.nil) T.root = y; else if (x == x.p.left) x.p.left = y; else x.p.right = y; y.left = x; // put x on y's left x.p = y; } // insert node-routine void rbInsert(Sentinel T, Node z) { // System.out.println("Inside rbInsert: " + z.key); /* Properties that can be violated: ** Root node is always black. ** If a node is red, then its children are black. */ Node y = T.nil; Node x = T.root; while (x != T.nil) { y = x; if (z.key < x.key) x = x.left; else x = x.right; } z.p = y; // System.out.println("z's parent data: " + z.p.key); if (y == T.nil) T.root = z; else if (z.key < y.key) y.left = z; else y.right = z; z.left = T.nil; z.right = T.nil; z.color = RED; // 1 indicates RED rbInsertFixup(T, z); } void rbInsertFixup(Sentinel T, RBT.Node z) { // System.out.println("Inside rbInsertFixup " + z.key); while (z.p.color == RED) { // z's parent is RED // System.out.println("Inside rbInsertFixup while loop " + z.key); if (z.p == z.p.p.left) { Node y = z.p.p.right; if (y.color == RED) { z.p.color = BLACK; y.color = BLACK; z.p.p.color = RED; z = z.p.p; } else if (z == z.p.right) { z = z.p; leftRotate(T, z); } else { z.p.color = BLACK; z.p.p.color = RED; rightRotate(T, z.p.p); } }else { Node y = z.p.p.left; if (y.color == RED) { z.p.color = BLACK; y.color = BLACK; z.p.p.color = RED; z = z.p.p; } else if (z == z.p.left) { z = z.p; rightRotate(T, z); } else { z.p.color = BLACK; z.p.p.color = RED; leftRotate(T, z.p.p); } } } T.root.color = BLACK; } // delete node routine void rbDelete(Sentinel T, Node z) { /* Properties that can be violated when y.color = BLACK: ** Root node is always black. ** If a node is red, then its children are black. ** For each node, all simple paths from the node to the descendant leaves contain the same number of black nodes.*/ Node y = z; Node x = null; byte y_original_color = y.color; if (z.left == T.nil) { x = z.right; rbTransplant(T, z, z.right); } else if (z.right == T.nil) { x = z.left; rbTransplant(T, z, z.left); } else { y = treeMinimum(T, z.right); y_original_color = y.color; x = y.right; if (y.p == z) x.p = y; else { rbTransplant(T, y, y.right); y.right = z.right; y.right.p = y; } rbTransplant(T, z, y); y.left = z.left; y.left.p = y; y.color = z.color; } if (y_original_color == BLACK) treeDeleteFixup(T, x); } // delete node fixup routine void treeDeleteFixup(Sentinel T, Node x) { while (x != T.root && x.color == BLACK) { if (x == x.p.left) { Node w = x.p.right; if (w.color == RED) { w.color = BLACK; x.p.color = RED; leftRotate(T, x.p); w = x.p.right; } if (w.left.color == BLACK && w.right.color == BLACK) { w.color = RED; x = x.p; } else if (w.right.color == BLACK) { w.left.color = BLACK; w.color = RED; rightRotate(T, w); w = x.p.right; }else { w.color = x.p.color; x.p.color = BLACK; w.right.color = BLACK; leftRotate(T, x.p); x = T.root; } }else { Node w = x.p.left; if (w.color == RED) { w.color = BLACK; x.p.color = RED; rightRotate(T, x.p); w = x.p.left; } if (w.left.color == BLACK && w.right.color == BLACK) { w.color = RED; x = x.p; } else if (w.left.color == BLACK) { w.right.color = BLACK; w.color = RED; leftRotate(T, w); w = x.p.left; }else { w.color = x.p.color; x.p.color = BLACK; w.left.color = BLACK; rightRotate(T, x.p); x = T.root; } } } x.color = BLACK; } // transplant routine void rbTransplant(Sentinel T, Node u, Node v) { if (u.p == T.nil) T.root = v; else if (u == u.p.left) u.p.left = v; else u.p.right = v; v.p = u.p; } public static void main(String[] args) { RBT rbt = new RBT(); Sentinel T = rbt.new Sentinel(); rbt.rbInsert(T, rbt.new Node(41)); rbt.rbInsert(T, rbt.new Node(38)); rbt.rbInsert(T, rbt.new Node(31)); rbt.rbInsert(T, rbt.new Node(12)); rbt.rbInsert(T, rbt.new Node(19)); rbt.rbInsert(T, rbt.new Node(8)); rbt.inorder(T, T.root); System.out.println(); rbt.rbDelete(T, rbt.search(T, 8)); rbt.inorder(T, T.root); System.out.println(); rbt.rbDelete(T, rbt.search(T, 12)); rbt.inorder(T, T.root); System.out.println(); rbt.rbDelete(T, rbt.search(T, 19)); rbt.inorder(T, T.root); System.out.println(); rbt.rbDelete(T, rbt.search(T, 31)); rbt.inorder(T, T.root); System.out.println(); rbt.rbDelete(T, rbt.search(T, 38)); rbt.inorder(T, T.root); System.out.println(); rbt.rbDelete(T, rbt.search(T, 41)); rbt.inorder(T, T.root); System.out.println(); // rbt.preorder(T, T.root); } // sentinel node class Sentinel { private Node nil; private Node root; public Sentinel() { this.nil = new Node(-1); this.nil.color = BLACK; // black color this.root = this.nil; } } // structure of a node in Red-black tree class Node { private int key; private byte color; private Node left; private Node right; private Node p; public Node(int data) { this.key = data; } } }
UTF-8
Java
10,075
java
RedBlackTree.java
Java
[]
null
[]
/* Red-Black tree properties: ** (i) Every node is either red or black. ** (ii) Root node is always black. ** (iii) Every leaf(NIL) is black. ** (iv) If a node is red, then its children are black. ** (v) For each node, all simple paths from the node to the descendant leaves ** contain the same number of black nodes. */ class RBT { private static final int RED = 1; private static final int BLACK = 0; // inorder-traversal routine void inorder(Sentinel T, Node root) { if (root != T.nil) { inorder(T, root.left); System.out.println("key: " + root.key + "\tcolor: " + root.color); inorder(T, root.right); } } // preorder-traversal routine void preorder(Sentinel T, Node root) { if (root != T.nil) { System.out.println("key: " + root.key + "\tcolor: " + root.color); preorder(T, root.left); preorder(T, root.right); } } // tree-minimum routine Node treeMinimum(Sentinel T, Node root) { while (root != T.nil && root.left != T.nil) root = root.left; return root; } // search routine Node search(Sentinel T, int key) { Node root = T.root; while (root != T.nil) { if (root.key == key) return root; else if (root.key > key) root = root.left; else root = root.right; } return null; } // right-Rotate routine void rightRotate(Sentinel T, Node x) { // System.out.println("Inside rightRotate: " + x.key); /* Assumption: x.left != T.nil and root's parent is T.nil*/ Node y = x.left; // set y x.left = y.right; // turn y's right subtree into x's left subtree if (y.right != T.nil) y.right.p = x; y.p = x.p; // link x's parent to y's parent if (x.p == T.nil) T.root = y; else if (x == x.p.left) x.p.left = y; else x.p.right = y; y.right = x; // put x on y's right x.p = y; } // left-Rotate routine void leftRotate(Sentinel T, Node x) { // System.out.println("Inside leftRotate: " + x.key); /* Assumption: x.right != T.nil and root's parent is T.nil*/ Node y = x.right; // set y x.right = y.left; // turn y's left subtree into x's right subtree if (y.left != T.nil) y.left.p = x; y.p = x.p; // link x's parent to y if (x.p == T.nil) T.root = y; else if (x == x.p.left) x.p.left = y; else x.p.right = y; y.left = x; // put x on y's left x.p = y; } // insert node-routine void rbInsert(Sentinel T, Node z) { // System.out.println("Inside rbInsert: " + z.key); /* Properties that can be violated: ** Root node is always black. ** If a node is red, then its children are black. */ Node y = T.nil; Node x = T.root; while (x != T.nil) { y = x; if (z.key < x.key) x = x.left; else x = x.right; } z.p = y; // System.out.println("z's parent data: " + z.p.key); if (y == T.nil) T.root = z; else if (z.key < y.key) y.left = z; else y.right = z; z.left = T.nil; z.right = T.nil; z.color = RED; // 1 indicates RED rbInsertFixup(T, z); } void rbInsertFixup(Sentinel T, RBT.Node z) { // System.out.println("Inside rbInsertFixup " + z.key); while (z.p.color == RED) { // z's parent is RED // System.out.println("Inside rbInsertFixup while loop " + z.key); if (z.p == z.p.p.left) { Node y = z.p.p.right; if (y.color == RED) { z.p.color = BLACK; y.color = BLACK; z.p.p.color = RED; z = z.p.p; } else if (z == z.p.right) { z = z.p; leftRotate(T, z); } else { z.p.color = BLACK; z.p.p.color = RED; rightRotate(T, z.p.p); } }else { Node y = z.p.p.left; if (y.color == RED) { z.p.color = BLACK; y.color = BLACK; z.p.p.color = RED; z = z.p.p; } else if (z == z.p.left) { z = z.p; rightRotate(T, z); } else { z.p.color = BLACK; z.p.p.color = RED; leftRotate(T, z.p.p); } } } T.root.color = BLACK; } // delete node routine void rbDelete(Sentinel T, Node z) { /* Properties that can be violated when y.color = BLACK: ** Root node is always black. ** If a node is red, then its children are black. ** For each node, all simple paths from the node to the descendant leaves contain the same number of black nodes.*/ Node y = z; Node x = null; byte y_original_color = y.color; if (z.left == T.nil) { x = z.right; rbTransplant(T, z, z.right); } else if (z.right == T.nil) { x = z.left; rbTransplant(T, z, z.left); } else { y = treeMinimum(T, z.right); y_original_color = y.color; x = y.right; if (y.p == z) x.p = y; else { rbTransplant(T, y, y.right); y.right = z.right; y.right.p = y; } rbTransplant(T, z, y); y.left = z.left; y.left.p = y; y.color = z.color; } if (y_original_color == BLACK) treeDeleteFixup(T, x); } // delete node fixup routine void treeDeleteFixup(Sentinel T, Node x) { while (x != T.root && x.color == BLACK) { if (x == x.p.left) { Node w = x.p.right; if (w.color == RED) { w.color = BLACK; x.p.color = RED; leftRotate(T, x.p); w = x.p.right; } if (w.left.color == BLACK && w.right.color == BLACK) { w.color = RED; x = x.p; } else if (w.right.color == BLACK) { w.left.color = BLACK; w.color = RED; rightRotate(T, w); w = x.p.right; }else { w.color = x.p.color; x.p.color = BLACK; w.right.color = BLACK; leftRotate(T, x.p); x = T.root; } }else { Node w = x.p.left; if (w.color == RED) { w.color = BLACK; x.p.color = RED; rightRotate(T, x.p); w = x.p.left; } if (w.left.color == BLACK && w.right.color == BLACK) { w.color = RED; x = x.p; } else if (w.left.color == BLACK) { w.right.color = BLACK; w.color = RED; leftRotate(T, w); w = x.p.left; }else { w.color = x.p.color; x.p.color = BLACK; w.left.color = BLACK; rightRotate(T, x.p); x = T.root; } } } x.color = BLACK; } // transplant routine void rbTransplant(Sentinel T, Node u, Node v) { if (u.p == T.nil) T.root = v; else if (u == u.p.left) u.p.left = v; else u.p.right = v; v.p = u.p; } public static void main(String[] args) { RBT rbt = new RBT(); Sentinel T = rbt.new Sentinel(); rbt.rbInsert(T, rbt.new Node(41)); rbt.rbInsert(T, rbt.new Node(38)); rbt.rbInsert(T, rbt.new Node(31)); rbt.rbInsert(T, rbt.new Node(12)); rbt.rbInsert(T, rbt.new Node(19)); rbt.rbInsert(T, rbt.new Node(8)); rbt.inorder(T, T.root); System.out.println(); rbt.rbDelete(T, rbt.search(T, 8)); rbt.inorder(T, T.root); System.out.println(); rbt.rbDelete(T, rbt.search(T, 12)); rbt.inorder(T, T.root); System.out.println(); rbt.rbDelete(T, rbt.search(T, 19)); rbt.inorder(T, T.root); System.out.println(); rbt.rbDelete(T, rbt.search(T, 31)); rbt.inorder(T, T.root); System.out.println(); rbt.rbDelete(T, rbt.search(T, 38)); rbt.inorder(T, T.root); System.out.println(); rbt.rbDelete(T, rbt.search(T, 41)); rbt.inorder(T, T.root); System.out.println(); // rbt.preorder(T, T.root); } // sentinel node class Sentinel { private Node nil; private Node root; public Sentinel() { this.nil = new Node(-1); this.nil.color = BLACK; // black color this.root = this.nil; } } // structure of a node in Red-black tree class Node { private int key; private byte color; private Node left; private Node right; private Node p; public Node(int data) { this.key = data; } } }
10,075
0.42134
0.418759
338
28.810652
16.609674
81
false
false
0
0
0
0
0
0
0.701183
false
false
4
5a6cb330df33575451ea145dab91535275f1abf0
39,462,159,543,659
c7e8eda3c4128b799749ece5310e875e24a372b6
/service/src/main/java/com/comsysto/movie/service/impl/MovieDBImporter.java
56f389815cbc802a32f62818b20cb88af48b15fc
[]
no_license
jockeyyan/mongo-full-text-search-movie-showcase
https://github.com/jockeyyan/mongo-full-text-search-movie-showcase
47fcdac9e6603f105ffbc6b7b1bdbdcc933bbfed
7c7c2392c00ced299528e442763e8caa32c0f80a
refs/heads/master
2020-12-25T22:28:48.125000
2015-06-17T09:13:15
2015-06-17T09:13:15
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.comsysto.movie.service.impl; import com.comsysto.movie.repository.api.MovieRepository; import com.comsysto.movie.repository.model.Movie; import com.mongodb.BasicDBObject; import com.mongodb.DBObject; import com.mongodb.util.JSON; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.util.List; import java.util.Random; /** * User: christian.kroemer@comsysto.com * Date: 6/12/13 * Time: 2:36 PM */ @Service public class MovieDBImporter { // API Key // private static final String API_KEY = "16a0036a641140ce7e23ddd423dfbf50"; TODO don't publish this one! private static final String API_KEY = "5a1a77e2eba8984804586122754f969f"; @Autowired MovieRepository movieRepository; Random rnd = new Random(); public void importMovies (int numberOfMovies) throws IOException { int counter = 0; int numPages = numberOfMovies/20+1; for (int page=1; page<=numPages; page++) { URL url = new URL("http://api.themoviedb.org/3/discover/movie?api_key="+API_KEY+"&page="+page); InputStream is = url.openStream(); ByteArrayOutputStream os = new ByteArrayOutputStream(); int retVal; while ((retVal = is.read()) != -1) { os.write(retVal); } final String movieString = os.toString(); BasicDBObject parsedResponse = (BasicDBObject) JSON.parse(movieString); List<DBObject> movieList = (List<DBObject>) parsedResponse.get("results"); if (movieList.isEmpty()) { break; } for (DBObject movieObject : movieList) { if (counter>=numberOfMovies) { break; } String movieId = movieObject.get("id").toString(); try { Movie movie = importMovieById(movieId); movieRepository.save(movie); counter++; } catch (IOException e) { System.out.println("problem with importing a certain movie..."); System.out.println(e); System.out.println("trying next one..."); } } } } private Movie importMovieById(String movieId) throws IOException { URL url = new URL("http://api.themoviedb.org/3/movie/"+ movieId +"?api_key="+API_KEY); InputStream is = url.openStream(); ByteArrayOutputStream os = new ByteArrayOutputStream(); int retVal; while ((retVal = is.read()) != -1) { os.write(retVal); } final String movieString = os.toString(); BasicDBObject movieObject = (BasicDBObject) JSON.parse(movieString); String title = movieObject.get("title").toString(); Object overviewObject = movieObject.get("overview"); String yearString = movieObject.get("release_date").toString().split("-")[0]; String description = ""; if (overviewObject != null) { description = overviewObject.toString(); } int year = 0; if (yearString.length() >0) { year = Integer.valueOf(yearString); } Movie.MovieBuilder movieBuilder = Movie.MovieBuilder.create(title) .withDescription(description) .withYear(year); if (rnd.nextBoolean()) { movieBuilder.withAlreadyWatched(true); } else if (rnd.nextBoolean()) { movieBuilder.withLikeToWatch(true); } Movie movie = movieBuilder.build(); return movie; } }
UTF-8
Java
3,815
java
MovieDBImporter.java
Java
[ { "context": ".util.List;\nimport java.util.Random;\n\n/**\n * User: christian.kroemer@comsysto.com\n * Date: 6/12/13\n * Time: 2:36 PM\n */\n@Service\npu", "end": 561, "score": 0.9998773336410522, "start": 531, "tag": "EMAIL", "value": "christian.kroemer@comsysto.com" }, { "context": " Key\n// private static final String API_KEY = \"16a0036a641140ce7e23ddd423dfbf50\"; TODO don't publish this one!\n private static", "end": 733, "score": 0.9996899366378784, "start": 701, "tag": "KEY", "value": "16a0036a641140ce7e23ddd423dfbf50" }, { "context": "s one!\n private static final String API_KEY = \"5a1a77e2eba8984804586122754f969f\";\n\n @Autowired\n MovieRepository movieReposi", "end": 840, "score": 0.9997032284736633, "start": 808, "tag": "KEY", "value": "5a1a77e2eba8984804586122754f969f" } ]
null
[]
package com.comsysto.movie.service.impl; import com.comsysto.movie.repository.api.MovieRepository; import com.comsysto.movie.repository.model.Movie; import com.mongodb.BasicDBObject; import com.mongodb.DBObject; import com.mongodb.util.JSON; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.util.List; import java.util.Random; /** * User: <EMAIL> * Date: 6/12/13 * Time: 2:36 PM */ @Service public class MovieDBImporter { // API Key // private static final String API_KEY = "<KEY>"; TODO don't publish this one! private static final String API_KEY = "<KEY>"; @Autowired MovieRepository movieRepository; Random rnd = new Random(); public void importMovies (int numberOfMovies) throws IOException { int counter = 0; int numPages = numberOfMovies/20+1; for (int page=1; page<=numPages; page++) { URL url = new URL("http://api.themoviedb.org/3/discover/movie?api_key="+API_KEY+"&page="+page); InputStream is = url.openStream(); ByteArrayOutputStream os = new ByteArrayOutputStream(); int retVal; while ((retVal = is.read()) != -1) { os.write(retVal); } final String movieString = os.toString(); BasicDBObject parsedResponse = (BasicDBObject) JSON.parse(movieString); List<DBObject> movieList = (List<DBObject>) parsedResponse.get("results"); if (movieList.isEmpty()) { break; } for (DBObject movieObject : movieList) { if (counter>=numberOfMovies) { break; } String movieId = movieObject.get("id").toString(); try { Movie movie = importMovieById(movieId); movieRepository.save(movie); counter++; } catch (IOException e) { System.out.println("problem with importing a certain movie..."); System.out.println(e); System.out.println("trying next one..."); } } } } private Movie importMovieById(String movieId) throws IOException { URL url = new URL("http://api.themoviedb.org/3/movie/"+ movieId +"?api_key="+API_KEY); InputStream is = url.openStream(); ByteArrayOutputStream os = new ByteArrayOutputStream(); int retVal; while ((retVal = is.read()) != -1) { os.write(retVal); } final String movieString = os.toString(); BasicDBObject movieObject = (BasicDBObject) JSON.parse(movieString); String title = movieObject.get("title").toString(); Object overviewObject = movieObject.get("overview"); String yearString = movieObject.get("release_date").toString().split("-")[0]; String description = ""; if (overviewObject != null) { description = overviewObject.toString(); } int year = 0; if (yearString.length() >0) { year = Integer.valueOf(yearString); } Movie.MovieBuilder movieBuilder = Movie.MovieBuilder.create(title) .withDescription(description) .withYear(year); if (rnd.nextBoolean()) { movieBuilder.withAlreadyWatched(true); } else if (rnd.nextBoolean()) { movieBuilder.withLikeToWatch(true); } Movie movie = movieBuilder.build(); return movie; } }
3,738
0.597641
0.580865
116
31.887932
26.461023
108
false
false
0
0
0
0
0
0
0.5
false
false
4
1e27af8b8e2c77e1241dd03af2a11682225ed5b6
36,026,185,717,980
0a95c40a9193b59d1dae9a2562a0ceee1ad20ee5
/app/src/main/java/com/claris/sharedmoney/activities/DeleteBuyerActivity.java
c6565af125c41d26f698b1e5d00bd6cd6adb8df8
[]
no_license
naoto24kawa/SharedMoney
https://github.com/naoto24kawa/SharedMoney
2e3400889cd6a49a3dda48b47be412fc377e3033
4a2a82d2ab67a80db1b07b8e6ad86bfd7a2841bd
refs/heads/develop
2020-02-06T08:37:52.442000
2015-03-25T18:23:59
2015-03-25T18:23:59
30,599,592
0
0
null
false
2015-03-25T18:23:59
2015-02-10T15:47:54
2015-02-23T16:07:55
2015-03-25T18:23:59
292
0
0
0
Java
null
null
package com.claris.sharedmoney.activities; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.TextView; import com.claris.sharedmoney.R; public class DeleteBuyerActivity extends Activity{ //layout parts private TextView actionBarText; private Button actionBarBack; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_delete_buyer); //レイアウト初期化 initLayout(); //コールバックセット setCallBacks(); } @Override protected void onStart() { super.onStart(); } @Override protected void onResume() { super.onResume(); } @Override protected void onPause() { super.onPause(); } @Override protected void onStop() { super.onStop(); } @Override protected void onDestroy() { super.onDestroy(); } private void initLayout() { actionBarBack = (Button) findViewById(R.id.delete_buyer_actionbar).findViewById(R.id.action_bar_back); actionBarText = (TextView) findViewById(R.id.delete_buyer_actionbar).findViewById(R.id.action_bar_text); actionBarText.setText(R.string.delete); } private void setCallBacks() { actionBarBack.setOnClickListener(backButtonCallBacks); } private View.OnClickListener backButtonCallBacks = new View.OnClickListener() { @Override public void onClick(View v) { finish(); } }; }
UTF-8
Java
1,713
java
DeleteBuyerActivity.java
Java
[]
null
[]
package com.claris.sharedmoney.activities; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.TextView; import com.claris.sharedmoney.R; public class DeleteBuyerActivity extends Activity{ //layout parts private TextView actionBarText; private Button actionBarBack; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_delete_buyer); //レイアウト初期化 initLayout(); //コールバックセット setCallBacks(); } @Override protected void onStart() { super.onStart(); } @Override protected void onResume() { super.onResume(); } @Override protected void onPause() { super.onPause(); } @Override protected void onStop() { super.onStop(); } @Override protected void onDestroy() { super.onDestroy(); } private void initLayout() { actionBarBack = (Button) findViewById(R.id.delete_buyer_actionbar).findViewById(R.id.action_bar_back); actionBarText = (TextView) findViewById(R.id.delete_buyer_actionbar).findViewById(R.id.action_bar_text); actionBarText.setText(R.string.delete); } private void setCallBacks() { actionBarBack.setOnClickListener(backButtonCallBacks); } private View.OnClickListener backButtonCallBacks = new View.OnClickListener() { @Override public void onClick(View v) { finish(); } }; }
1,713
0.626563
0.626563
69
22.333334
23.268854
112
false
false
0
0
0
0
0
0
0.347826
false
false
4
3a2a6a92abcf679475ec871192b5295d52a00339
38,611,756,014,300
42ef479d0e961d19a6e287e0a7b7b44cd07e8881
/system-service/src/main/java/com/jenkin/systemservice/system/dao/RoleMapper.java
c87354fa5f79c40ac6555565f36535746312774b
[]
no_license
xyz0101/less-code
https://github.com/xyz0101/less-code
b90feb98b08e25957b4511ce3e23077e78e7be10
250b398d6d2ae76d5d5a9b2c2d68cd93167cda0d
refs/heads/master
2023-08-16T04:31:21.119000
2021-10-13T14:18:57
2021-10-13T14:18:57
415,898,117
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.jenkin.systemservice.system.dao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.jenkin.common.entity.pos.system.RolePo; import com.jenkin.common.shiro.dao.BaseRoleMapper; /** * @author jenkin * @className RoleMapper * @description TODO * @date 2020/12/9 15:53 */ public interface RoleMapper extends BaseRoleMapper, BaseMapper<RolePo> { }
UTF-8
Java
377
java
RoleMapper.java
Java
[ { "context": "n.common.shiro.dao.BaseRoleMapper;\n\n/**\n * @author jenkin\n * @className RoleMapper\n * @description TODO\n * ", "end": 226, "score": 0.9996431469917297, "start": 220, "tag": "USERNAME", "value": "jenkin" } ]
null
[]
package com.jenkin.systemservice.system.dao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.jenkin.common.entity.pos.system.RolePo; import com.jenkin.common.shiro.dao.BaseRoleMapper; /** * @author jenkin * @className RoleMapper * @description TODO * @date 2020/12/9 15:53 */ public interface RoleMapper extends BaseRoleMapper, BaseMapper<RolePo> { }
377
0.779841
0.750663
14
25.928572
23.288452
72
false
false
0
0
0
0
0
0
0.357143
false
false
4
29958fb4e2661b1abd12ba934e1b2043d6a72313
18,013,092,903,214
d0479ca0831bf1ca1d2f5f3c75a81245a0835ac7
/domain-api/src/main/java/org/yes/cart/domain/dto/CustomerOrderDeliveryDetailDTO.java
a08a16c277bc7ea5b95777f6bec4b6413ca5bc9b
[ "Apache-2.0" ]
permissive
inspire-software/yes-cart
https://github.com/inspire-software/yes-cart
20a8e035116e0fb0a9d63da7362799fb530fab72
803b7c302f718803e5b841f93899942dd28a4ea0
refs/heads/master
2023-08-31T18:09:26.780000
2023-08-26T12:07:25
2023-08-26T12:07:25
39,092,083
131
92
Apache-2.0
false
2022-12-16T05:46:38
2015-07-14T18:10:24
2022-12-14T22:32:35
2022-12-16T05:46:38
615,192
98
76
14
Java
false
false
/* * Copyright 2009 Inspire-Software.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.yes.cart.domain.dto; import org.yes.cart.domain.entity.Identifiable; import org.yes.cart.domain.misc.Pair; import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalDateTime; import java.util.Map; /** * Customer order detail DTO interface. * Represent single order line in order with delivery details. * * <p/> * User: Igor Azarny iazarny@yahoo.com * Date: 8/12/12 * Time: 7:21 AM */ public interface CustomerOrderDeliveryDetailDTO extends Identifiable, AuditInfoDTO { /** * Get pk value of order detail record. * @return pk value */ long getCustomerOrderDeliveryDetId(); /** * Set pk value of related order detail record. * @param customerorderdeliveryId pk value */ void setCustomerOrderDeliveryDetId(long customerorderdeliveryId) ; /** * Get sku code . * @return sku code . */ String getSkuCode(); /** * Set sku code . * @param skuCode sku code . */ void setSkuCode(String skuCode); /** * Get sku name. * @return sku name. */ String getSkuName(); /** * Set sku name. * @param skuName sku name. */ void setSkuName(String skuName); /** * @return supplier code. */ String getSupplierCode(); /** * Set supplier code (fulfilment centre/warehouse code). * * @param supplierCode supplier code */ void setSupplierCode(String supplierCode); /** * @return delivery group. */ String getDeliveryGroup(); /** * Set delivery group * * @param deliveryGroup delivery group */ void setDeliveryGroup(String deliveryGroup); /** * @return item group. */ String getItemGroup(); /** * Set item group * * @param itemGroup item group */ void setItemGroup(String itemGroup); /** * Delivery remarks (could be used for third party integrations or in JAM) * * @return remarks */ String getDeliveryRemarks(); /** * Delivery remarks (could be used for third party integrations or in JAM) * * @param deliveryRemarks remarks */ void setDeliveryRemarks(String deliveryRemarks); /** * Earliest date the delivery is estimated for. * * @return estimated date */ LocalDateTime getDeliveryEstimatedMin(); /** * Earliest date the delivery is estimated for. * * @param deliveryEstimatedMin estimated date */ void setDeliveryEstimatedMin(LocalDateTime deliveryEstimatedMin); /** * Latest date the delivery is estimated for. * * @return estimated date */ LocalDateTime getDeliveryEstimatedMax(); /** * Latest date the delivery is estimated for. * * @param deliveryEstimatedMax estimated date */ void setDeliveryEstimatedMax(LocalDateTime deliveryEstimatedMax); /** * Guaranteed delivery date. * * @return guaranteed date */ LocalDateTime getDeliveryGuaranteed(); /** * Guaranteed delivery date. * * @param deliveryGuaranteed guaranteed date */ void setDeliveryGuaranteed(LocalDateTime deliveryGuaranteed); /** * Guaranteed delivery date. This date should be populated from the third party integrations and denoted * actual confirmed date of delivery. If this is field is null it only means that there is not confirmation * by the delivery company that the items is delivered, it does not mean that it has not been delivered. * * @return guaranteed date */ LocalDateTime getDeliveryConfirmed(); /** * Actual confirmed delivery date. * * @param delivered confirmed delivery date */ void setDeliveryConfirmed(LocalDateTime delivered); /** * Actual delivered quantity. Zero indicates that item has been rejected. Must remain null if no * confirmation received. See {@link #getDeliveryConfirmed()}. * * @return confirmed delivered quantity */ BigDecimal getDeliveredQuantity(); /** * Confirmed quantity. * * @param deliveredQuantity confirmed quantity */ void setDeliveredQuantity(BigDecimal deliveredQuantity); /** * Helper check for {@link #getDeliveredQuantity()} == 0. If no confirmed quantity this check should return false. * * @return true if delivery was rejected for this line. */ boolean isDeliveryRejected(); /** * Delivery rejected flag. * * @param deliveryRejected rejected flag */ void setDeliveryRejected(boolean deliveryRejected); /** * Helper check for {@link #getDeliveredQuantity()} == {@link #getQty()}. If no confirmed quantity this check should return false. * * @return true if delivery was different for this line. */ boolean isDeliveryDifferent(); /** * Delivery different flag * * @param deliveryDifferent different flag */ void setDeliveryDifferent(boolean deliveryDifferent); /** * B2B remarks. * * @return remarks */ String getB2bRemarks(); /** * B2B remarks. * * @param b2bRemarks remarks */ void setB2bRemarks(String b2bRemarks); /** * Invoice number for this item. In most cases invoice matches the order, however in some cases * with long term recurring orders invoices are done either in bulk or per article, hence invoice * number is per line. * * @return supplier invoice number */ String getSupplierInvoiceNo(); /** * Set invoice number for this line. * * @param invoiceNo invoice number */ void setSupplierInvoiceNo(String invoiceNo); /** * Invoice date, see {@link #getSupplierInvoiceNo()}. * * @return invoice date */ LocalDate getSupplierInvoiceDate(); /** * Set invoice date. * * @param supplierInvoiceDate invoice date */ void setSupplierInvoiceDate(LocalDate supplierInvoiceDate); /** * Get quantity. * @return quantity. */ BigDecimal getQty(); /** * Set product qty. * @param qty quantity. */ void setQty(BigDecimal qty) ; /** * Get price of product, which is in delivery. * @return deal price. */ BigDecimal getPrice() ; /** * Set deal price. * * @param price deal price. */ void setPrice(BigDecimal price); /** * Get the sku sale price including all promotions. * * @return after tax price */ BigDecimal getNetPrice(); /** * Set net price (price before tax). * * @param netPrice price before tax */ void setNetPrice(final BigDecimal netPrice); /** * Get the sku sale price including all promotions. * * @return before tax price */ BigDecimal getGrossPrice(); /** * Set net price (price after tax). * * @param grossPrice price after tax */ void setGrossPrice(final BigDecimal grossPrice); /** * Get tax code used for this item. * * @return tax code */ String getTaxCode(); /** * Set tax code reference. * * @param taxCode tax code */ void setTaxCode(final String taxCode); /** * Get tax rate for this item. * * @return tax rate 0-99 */ BigDecimal getTaxRate(); /** * Set tax rate used (0-99). * * @param taxRate tax rate */ void setTaxRate(final BigDecimal taxRate); /** * Tax exclusive of price flag. * * @return true if exclusive, false if inclusive */ boolean isTaxExclusiveOfPrice(); /** * Set whether this tax is included or excluded from price. * * @param taxExclusiveOfPrice tax flag */ void setTaxExclusiveOfPrice(final boolean taxExclusiveOfPrice); /** * Get sale price. * @return price */ BigDecimal getSalePrice(); /** * Set sale price. * @param salePrice to set. */ void setSalePrice(BigDecimal salePrice); /** * Get price in catalog. * @return price in catalog. */ BigDecimal getListPrice(); /** * Set price in catalog. * @param listPrice price in catalog. */ void setListPrice(BigDecimal listPrice); /** * This is a configurable product. * * @return true if this is a configurable product. */ boolean isConfigurable(); /** * Set configurable * * @param configurable true if this is a configurable product. */ void setConfigurable(boolean configurable); /** * This product not to be sold separately. * * @return not to be sold separately product. */ boolean isNotSoldSeparately(); /** * Set not sold separately * * @param notSoldSeparately not to be sold separately product. */ void setNotSoldSeparately(boolean notSoldSeparately); /** * Returns true if this item has been added as gift as * a result of promotion. * * @return true if this is a promotion gift */ boolean isGift(); /** * @param gift set gift flag */ void setGift(boolean gift); /** * Returns true if promotions have been applied to this * item. * * @return true if promotions have been applied */ boolean isPromoApplied(); /** * @param promoApplied set promotion applied flag */ void setPromoApplied(boolean promoApplied); /** * Comma separated list of promotion codes that have been applied * for this cart item. * * @return comma separated promo codes */ String getAppliedPromo(); /** * @param appliedPromo comma separated promo codes */ void setAppliedPromo(String appliedPromo); /** * Get delivery number. * @return delivery number. */ String getDeliveryNum(); /** * Set delivery number. * @param deliveryNum delivery num. */ void setDeliveryNum(String deliveryNum) ; /** * Get delivery status label for more details look at {@link org.yes.cart.domain.entity.CustomerOrderDelivery} * @return delivery detail . */ String getDeliveryStatusLabel(); /** * Set delivery status label. * @param deliveryStatusLabel delivery status label. */ void setDeliveryStatusLabel(String deliveryStatusLabel) ; /** * Total amount for this line. * * @return qty * grossPrice; */ BigDecimal getLineTotal(); /** * Total amount for this line. * * @param lineTotal qty * grossPrice; */ void setLineTotal(BigDecimal lineTotal); /** * Total tax amount for this line. * * @return qty * (grossPrice - netPrice) */ BigDecimal getLineTax(); /** * Total tax amount for this line. * * @param lineTax qty * (grossPrice - netPrice) */ void setLineTax(BigDecimal lineTax); /** * Total amount for this line. * * @return qty * grossPrice; */ BigDecimal getLineTotalGross(); /** * Total amount for this line. * * @param lineTotalGross qty * grossPrice; */ void setLineTotalGross(BigDecimal lineTotalGross); /** * Total amount for this line. * * @return qty * netPrice; */ BigDecimal getLineTotalNet(); /** * Total amount for this line. * * @param lineTotalNet qty * netPrice; */ void setLineTotalNet(BigDecimal lineTotalNet); /** * @return all values mapped to codes */ Map<String, Pair<String, Map<String, String>>> getAllValues(); /** * @param allValues all values */ void setAllValues(Map<String, Pair<String, Map<String, String>>> allValues); }
UTF-8
Java
13,130
java
CustomerOrderDeliveryDetailDTO.java
Java
[ { "context": "rder with delivery details.\r\n *\r\n * <p/>\r\n * User: Igor Azarny iazarny@yahoo.com\r\n * Date: 8/12/12\r\n * Time: 7:2", "end": 1034, "score": 0.9997895956039429, "start": 1023, "tag": "NAME", "value": "Igor Azarny" }, { "context": "livery details.\r\n *\r\n * <p/>\r\n * User: Igor Azarny iazarny@yahoo.com\r\n * Date: 8/12/12\r\n * Time: 7:21 AM\r\n */\r\n\r\npubli", "end": 1052, "score": 0.9999181032180786, "start": 1035, "tag": "EMAIL", "value": "iazarny@yahoo.com" } ]
null
[]
/* * Copyright 2009 Inspire-Software.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.yes.cart.domain.dto; import org.yes.cart.domain.entity.Identifiable; import org.yes.cart.domain.misc.Pair; import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalDateTime; import java.util.Map; /** * Customer order detail DTO interface. * Represent single order line in order with delivery details. * * <p/> * User: <NAME> <EMAIL> * Date: 8/12/12 * Time: 7:21 AM */ public interface CustomerOrderDeliveryDetailDTO extends Identifiable, AuditInfoDTO { /** * Get pk value of order detail record. * @return pk value */ long getCustomerOrderDeliveryDetId(); /** * Set pk value of related order detail record. * @param customerorderdeliveryId pk value */ void setCustomerOrderDeliveryDetId(long customerorderdeliveryId) ; /** * Get sku code . * @return sku code . */ String getSkuCode(); /** * Set sku code . * @param skuCode sku code . */ void setSkuCode(String skuCode); /** * Get sku name. * @return sku name. */ String getSkuName(); /** * Set sku name. * @param skuName sku name. */ void setSkuName(String skuName); /** * @return supplier code. */ String getSupplierCode(); /** * Set supplier code (fulfilment centre/warehouse code). * * @param supplierCode supplier code */ void setSupplierCode(String supplierCode); /** * @return delivery group. */ String getDeliveryGroup(); /** * Set delivery group * * @param deliveryGroup delivery group */ void setDeliveryGroup(String deliveryGroup); /** * @return item group. */ String getItemGroup(); /** * Set item group * * @param itemGroup item group */ void setItemGroup(String itemGroup); /** * Delivery remarks (could be used for third party integrations or in JAM) * * @return remarks */ String getDeliveryRemarks(); /** * Delivery remarks (could be used for third party integrations or in JAM) * * @param deliveryRemarks remarks */ void setDeliveryRemarks(String deliveryRemarks); /** * Earliest date the delivery is estimated for. * * @return estimated date */ LocalDateTime getDeliveryEstimatedMin(); /** * Earliest date the delivery is estimated for. * * @param deliveryEstimatedMin estimated date */ void setDeliveryEstimatedMin(LocalDateTime deliveryEstimatedMin); /** * Latest date the delivery is estimated for. * * @return estimated date */ LocalDateTime getDeliveryEstimatedMax(); /** * Latest date the delivery is estimated for. * * @param deliveryEstimatedMax estimated date */ void setDeliveryEstimatedMax(LocalDateTime deliveryEstimatedMax); /** * Guaranteed delivery date. * * @return guaranteed date */ LocalDateTime getDeliveryGuaranteed(); /** * Guaranteed delivery date. * * @param deliveryGuaranteed guaranteed date */ void setDeliveryGuaranteed(LocalDateTime deliveryGuaranteed); /** * Guaranteed delivery date. This date should be populated from the third party integrations and denoted * actual confirmed date of delivery. If this is field is null it only means that there is not confirmation * by the delivery company that the items is delivered, it does not mean that it has not been delivered. * * @return guaranteed date */ LocalDateTime getDeliveryConfirmed(); /** * Actual confirmed delivery date. * * @param delivered confirmed delivery date */ void setDeliveryConfirmed(LocalDateTime delivered); /** * Actual delivered quantity. Zero indicates that item has been rejected. Must remain null if no * confirmation received. See {@link #getDeliveryConfirmed()}. * * @return confirmed delivered quantity */ BigDecimal getDeliveredQuantity(); /** * Confirmed quantity. * * @param deliveredQuantity confirmed quantity */ void setDeliveredQuantity(BigDecimal deliveredQuantity); /** * Helper check for {@link #getDeliveredQuantity()} == 0. If no confirmed quantity this check should return false. * * @return true if delivery was rejected for this line. */ boolean isDeliveryRejected(); /** * Delivery rejected flag. * * @param deliveryRejected rejected flag */ void setDeliveryRejected(boolean deliveryRejected); /** * Helper check for {@link #getDeliveredQuantity()} == {@link #getQty()}. If no confirmed quantity this check should return false. * * @return true if delivery was different for this line. */ boolean isDeliveryDifferent(); /** * Delivery different flag * * @param deliveryDifferent different flag */ void setDeliveryDifferent(boolean deliveryDifferent); /** * B2B remarks. * * @return remarks */ String getB2bRemarks(); /** * B2B remarks. * * @param b2bRemarks remarks */ void setB2bRemarks(String b2bRemarks); /** * Invoice number for this item. In most cases invoice matches the order, however in some cases * with long term recurring orders invoices are done either in bulk or per article, hence invoice * number is per line. * * @return supplier invoice number */ String getSupplierInvoiceNo(); /** * Set invoice number for this line. * * @param invoiceNo invoice number */ void setSupplierInvoiceNo(String invoiceNo); /** * Invoice date, see {@link #getSupplierInvoiceNo()}. * * @return invoice date */ LocalDate getSupplierInvoiceDate(); /** * Set invoice date. * * @param supplierInvoiceDate invoice date */ void setSupplierInvoiceDate(LocalDate supplierInvoiceDate); /** * Get quantity. * @return quantity. */ BigDecimal getQty(); /** * Set product qty. * @param qty quantity. */ void setQty(BigDecimal qty) ; /** * Get price of product, which is in delivery. * @return deal price. */ BigDecimal getPrice() ; /** * Set deal price. * * @param price deal price. */ void setPrice(BigDecimal price); /** * Get the sku sale price including all promotions. * * @return after tax price */ BigDecimal getNetPrice(); /** * Set net price (price before tax). * * @param netPrice price before tax */ void setNetPrice(final BigDecimal netPrice); /** * Get the sku sale price including all promotions. * * @return before tax price */ BigDecimal getGrossPrice(); /** * Set net price (price after tax). * * @param grossPrice price after tax */ void setGrossPrice(final BigDecimal grossPrice); /** * Get tax code used for this item. * * @return tax code */ String getTaxCode(); /** * Set tax code reference. * * @param taxCode tax code */ void setTaxCode(final String taxCode); /** * Get tax rate for this item. * * @return tax rate 0-99 */ BigDecimal getTaxRate(); /** * Set tax rate used (0-99). * * @param taxRate tax rate */ void setTaxRate(final BigDecimal taxRate); /** * Tax exclusive of price flag. * * @return true if exclusive, false if inclusive */ boolean isTaxExclusiveOfPrice(); /** * Set whether this tax is included or excluded from price. * * @param taxExclusiveOfPrice tax flag */ void setTaxExclusiveOfPrice(final boolean taxExclusiveOfPrice); /** * Get sale price. * @return price */ BigDecimal getSalePrice(); /** * Set sale price. * @param salePrice to set. */ void setSalePrice(BigDecimal salePrice); /** * Get price in catalog. * @return price in catalog. */ BigDecimal getListPrice(); /** * Set price in catalog. * @param listPrice price in catalog. */ void setListPrice(BigDecimal listPrice); /** * This is a configurable product. * * @return true if this is a configurable product. */ boolean isConfigurable(); /** * Set configurable * * @param configurable true if this is a configurable product. */ void setConfigurable(boolean configurable); /** * This product not to be sold separately. * * @return not to be sold separately product. */ boolean isNotSoldSeparately(); /** * Set not sold separately * * @param notSoldSeparately not to be sold separately product. */ void setNotSoldSeparately(boolean notSoldSeparately); /** * Returns true if this item has been added as gift as * a result of promotion. * * @return true if this is a promotion gift */ boolean isGift(); /** * @param gift set gift flag */ void setGift(boolean gift); /** * Returns true if promotions have been applied to this * item. * * @return true if promotions have been applied */ boolean isPromoApplied(); /** * @param promoApplied set promotion applied flag */ void setPromoApplied(boolean promoApplied); /** * Comma separated list of promotion codes that have been applied * for this cart item. * * @return comma separated promo codes */ String getAppliedPromo(); /** * @param appliedPromo comma separated promo codes */ void setAppliedPromo(String appliedPromo); /** * Get delivery number. * @return delivery number. */ String getDeliveryNum(); /** * Set delivery number. * @param deliveryNum delivery num. */ void setDeliveryNum(String deliveryNum) ; /** * Get delivery status label for more details look at {@link org.yes.cart.domain.entity.CustomerOrderDelivery} * @return delivery detail . */ String getDeliveryStatusLabel(); /** * Set delivery status label. * @param deliveryStatusLabel delivery status label. */ void setDeliveryStatusLabel(String deliveryStatusLabel) ; /** * Total amount for this line. * * @return qty * grossPrice; */ BigDecimal getLineTotal(); /** * Total amount for this line. * * @param lineTotal qty * grossPrice; */ void setLineTotal(BigDecimal lineTotal); /** * Total tax amount for this line. * * @return qty * (grossPrice - netPrice) */ BigDecimal getLineTax(); /** * Total tax amount for this line. * * @param lineTax qty * (grossPrice - netPrice) */ void setLineTax(BigDecimal lineTax); /** * Total amount for this line. * * @return qty * grossPrice; */ BigDecimal getLineTotalGross(); /** * Total amount for this line. * * @param lineTotalGross qty * grossPrice; */ void setLineTotalGross(BigDecimal lineTotalGross); /** * Total amount for this line. * * @return qty * netPrice; */ BigDecimal getLineTotalNet(); /** * Total amount for this line. * * @param lineTotalNet qty * netPrice; */ void setLineTotalNet(BigDecimal lineTotalNet); /** * @return all values mapped to codes */ Map<String, Pair<String, Map<String, String>>> getAllValues(); /** * @param allValues all values */ void setAllValues(Map<String, Pair<String, Map<String, String>>> allValues); }
13,115
0.586367
0.584158
555
21.657658
22.940777
134
false
false
0
0
0
0
0
0
0.192793
false
false
4
13f72a24d969c99997e960e43d2f0db5ac6b00b9
498,216,231,814
a630a07ab398b2a4dc4ad168674d3c57135ce763
/lab05/Ex_2/cakeMaster.java
71a27532a9071e8927e290619a2147a377e87d7c
[]
no_license
RFL1M4/PDS
https://github.com/RFL1M4/PDS
4bb19a78006a244780bfe4f1f951aa94c7e915c6
676d3bca5acf7845b3d490269100eba881f32770
refs/heads/master
2023-03-25T03:44:51.006000
2021-06-28T07:24:00
2021-06-28T07:24:00
344,065,520
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
/** * @author Rodrigo Lima * @author Goncalo Machado */ class CakeMaster{ private CakeBuilder cakeBuilder; // Selects right builder to use public void setCakeBuilder(CakeBuilder cb){ cakeBuilder = cb; } // Return cake built public Cake getCake() { return cakeBuilder.getCake(); } // Construction with full selection public void createCake(Shape shape, int layers, String message) { cakeBuilder.createCake(); // Creation of cake cakeBuilder.setCakeShape(shape); // Sets cake shape for (int i = 0 ; i < layers ; i++) // For loop on layers number cakeBuilder.addCakeLayer(); // Sets number of layers cakeBuilder.addMessage(message); // Sets message to be shown on cake cakeBuilder.addCreamLayer(); // Adds cream layers cakeBuilder.addTopLayer(); // Adds top layers cakeBuilder.addTopping(); // Adds topping } // Construction with 2 options selected public void createCake(int layers, String message) { cakeBuilder.createCake(); // Creation of cake cakeBuilder.setCakeShape(Shape.Circle); // Sets cake shape for (int i = 0 ; i < layers ; i++) // For loop on layers number cakeBuilder.addCakeLayer(); // Sets number of layers cakeBuilder.addMessage(message); // Sets message to be shown on cake cakeBuilder.addCreamLayer(); // Adds cream layers cakeBuilder.addTopLayer(); // Adds top layers cakeBuilder.addTopping(); // Adds topping } // Construction with 1 option selected public void createCake(String message) { cakeBuilder.createCake(); // Creation of cake cakeBuilder.setCakeShape(Shape.Circle); // Sets cake shape cakeBuilder.addCakeLayer(); // Sets number of layers cakeBuilder.addMessage(message); // Sets message to be shown on cake cakeBuilder.addCreamLayer(); // Adds cream layers cakeBuilder.addTopLayer(); // Adds top layers cakeBuilder.addTopping(); // Adds topping } // Construction with no options selected public void createCake() { cakeBuilder.createCake(); // Creation of cake cakeBuilder.setCakeShape(Shape.Circle); // Sets cake shape cakeBuilder.addCakeLayer(); // Sets number of layers cakeBuilder.addMessage("Congrats"); // Sets message to be shown on cake cakeBuilder.addCreamLayer(); // Adds cream layers cakeBuilder.addTopLayer(); // Adds top layers cakeBuilder.addTopping(); // Adds topping } }
UTF-8
Java
3,043
java
cakeMaster.java
Java
[ { "context": "/** \r\n * @author Rodrigo Lima\r\n * @author Goncalo Machado\r\n*/\r\n\r\nclass CakeMast", "end": 29, "score": 0.9998615384101868, "start": 17, "tag": "NAME", "value": "Rodrigo Lima" }, { "context": "/** \r\n * @author Rodrigo Lima\r\n * @author Goncalo Machado\r\n*/\r\n\r\nclass CakeMaster{\r\n private CakeBuilder", "end": 57, "score": 0.9998603463172913, "start": 42, "tag": "NAME", "value": "Goncalo Machado" } ]
null
[]
/** * @author <NAME> * @author <NAME> */ class CakeMaster{ private CakeBuilder cakeBuilder; // Selects right builder to use public void setCakeBuilder(CakeBuilder cb){ cakeBuilder = cb; } // Return cake built public Cake getCake() { return cakeBuilder.getCake(); } // Construction with full selection public void createCake(Shape shape, int layers, String message) { cakeBuilder.createCake(); // Creation of cake cakeBuilder.setCakeShape(shape); // Sets cake shape for (int i = 0 ; i < layers ; i++) // For loop on layers number cakeBuilder.addCakeLayer(); // Sets number of layers cakeBuilder.addMessage(message); // Sets message to be shown on cake cakeBuilder.addCreamLayer(); // Adds cream layers cakeBuilder.addTopLayer(); // Adds top layers cakeBuilder.addTopping(); // Adds topping } // Construction with 2 options selected public void createCake(int layers, String message) { cakeBuilder.createCake(); // Creation of cake cakeBuilder.setCakeShape(Shape.Circle); // Sets cake shape for (int i = 0 ; i < layers ; i++) // For loop on layers number cakeBuilder.addCakeLayer(); // Sets number of layers cakeBuilder.addMessage(message); // Sets message to be shown on cake cakeBuilder.addCreamLayer(); // Adds cream layers cakeBuilder.addTopLayer(); // Adds top layers cakeBuilder.addTopping(); // Adds topping } // Construction with 1 option selected public void createCake(String message) { cakeBuilder.createCake(); // Creation of cake cakeBuilder.setCakeShape(Shape.Circle); // Sets cake shape cakeBuilder.addCakeLayer(); // Sets number of layers cakeBuilder.addMessage(message); // Sets message to be shown on cake cakeBuilder.addCreamLayer(); // Adds cream layers cakeBuilder.addTopLayer(); // Adds top layers cakeBuilder.addTopping(); // Adds topping } // Construction with no options selected public void createCake() { cakeBuilder.createCake(); // Creation of cake cakeBuilder.setCakeShape(Shape.Circle); // Sets cake shape cakeBuilder.addCakeLayer(); // Sets number of layers cakeBuilder.addMessage("Congrats"); // Sets message to be shown on cake cakeBuilder.addCreamLayer(); // Adds cream layers cakeBuilder.addTopLayer(); // Adds top layers cakeBuilder.addTopping(); // Adds topping } }
3,028
0.553401
0.552087
64
45.578125
30.463505
87
false
false
0
0
0
0
0
0
0.59375
false
false
4
01c2cda5a7bc595886a65b7aae85d99651924f1f
32,942,399,175,866
8b4505cae83e8684f7a7470976c362c3226bdf65
/Examen1/src/Separador/Examen1.java
9a7114bd34ed7d591906cd392746276fd1df3b8d
[]
no_license
fuentesrma/Java-Basico
https://github.com/fuentesrma/Java-Basico
a4263153bcae9ed036c3df9b673fc01688fa3b50
bbe379cdb6c613916d607651c471198cc8bd2fdb
refs/heads/master
2021-05-29T14:37:02.871000
2015-04-16T18:02:17
2015-04-16T18:02:17
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package Separador; import java.util.ArrayList; public class Examen1 {//clase examen1 ArrayList listaLetras = new ArrayList();//declaracion de arraylist para guradar las letras ArrayList listaNumeros = new ArrayList();//declaracion de arraylist para guardar los numeros int indice; public String separar(String cadena){//metodo separar que recibe un parametro de tipo cadena char elementos[]=cadena.toCharArray();//declaramos un arreglo llamado elementos que convertira la cadena en char for(indice=0;indice<cadena.length();indice++){//recorremos el arreglo if(Character.isLetter(elementos[indice])){//comprobamos que la posicion actual sea una letra listaLetras.add(elementos[indice]);//agregamos la letra a la lista }else{ listaNumeros.add(elementos[indice]);//agregamos los numeros a lista } } //System.out.println(listaLetras);//imprimimos las letras //System.out.println(listaNumeros);//imprimimos los numeros return cadena; } public void imprimir(){ System.out.println(listaLetras);//imprimimos las letras System.out.println(listaNumeros);//imprimimos los numeros } public static void main(String []args){//metodo principal Examen1 nuevo=new Examen1 (); System.out.println(nuevo.separar("m16u3l4n63l1k4JUL1O153L444R0NN4Y3L1"));//agregamos un valor a la cadena que recibe en el metodo separar nuevo.imprimir(); } }
UTF-8
Java
1,394
java
Examen1.java
Java
[]
null
[]
package Separador; import java.util.ArrayList; public class Examen1 {//clase examen1 ArrayList listaLetras = new ArrayList();//declaracion de arraylist para guradar las letras ArrayList listaNumeros = new ArrayList();//declaracion de arraylist para guardar los numeros int indice; public String separar(String cadena){//metodo separar que recibe un parametro de tipo cadena char elementos[]=cadena.toCharArray();//declaramos un arreglo llamado elementos que convertira la cadena en char for(indice=0;indice<cadena.length();indice++){//recorremos el arreglo if(Character.isLetter(elementos[indice])){//comprobamos que la posicion actual sea una letra listaLetras.add(elementos[indice]);//agregamos la letra a la lista }else{ listaNumeros.add(elementos[indice]);//agregamos los numeros a lista } } //System.out.println(listaLetras);//imprimimos las letras //System.out.println(listaNumeros);//imprimimos los numeros return cadena; } public void imprimir(){ System.out.println(listaLetras);//imprimimos las letras System.out.println(listaNumeros);//imprimimos los numeros } public static void main(String []args){//metodo principal Examen1 nuevo=new Examen1 (); System.out.println(nuevo.separar("m16u3l4n63l1k4JUL1O153L444R0NN4Y3L1"));//agregamos un valor a la cadena que recibe en el metodo separar nuevo.imprimir(); } }
1,394
0.751793
0.734577
36
37.694443
38.456917
139
false
false
0
0
0
0
0
0
2.277778
false
false
4
440321b68e3688004e182a72ae9b72eee44b9053
1,262,720,404,663
88c72d8ba43dfa66e78e8a397a7ae2ce722ecbe3
/src/main/java/demo/ui/components/editor/table/TableTest1.java
4ee070fe52be3d0a6565f039639e04a979c8b85a
[ "Apache-2.0" ]
permissive
charygao/idea-setting-explorer
https://github.com/charygao/idea-setting-explorer
849bfe42572272a12f23b6a567453f008d623630
cd8ee80e5141913a5dcf4405c12adad743a30b69
refs/heads/main
2023-05-26T22:30:47.087000
2021-06-14T12:12:47
2021-06-14T12:12:47
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package demo.ui.components.editor.table; import com.intellij.openapi.actionSystem.CommonShortcuts; import com.intellij.openapi.keymap.KeymapUtil; import com.intellij.openapi.ui.popup.ComponentPopupBuilder; import com.intellij.openapi.ui.popup.JBPopup; import com.intellij.openapi.ui.popup.JBPopupFactory; import javax.swing.*; import javax.swing.table.DefaultTableModel; import java.awt.*; /** * @author Carry * @date 2020/8/13 */ public class TableTest1 { public static void main(String[] args) { Object[][] data = new Object[][] { { new MColoredBoolValue(false, false), new MColoredStringValue("hah1", false), Boolean.FALSE }, { new MColoredBoolValue(false, true), new MColoredStringValue("hah2", true), Boolean.TRUE }, }; String[] columnNames = new String[] { "Colored", "String", "Bool" }; JTable jTable = new JTable(new DefaultTableModel(data, columnNames) { Class<?>[] cols = new Class[] { MColoredBoolValue.class, MColoredStringValue.class, Boolean.class }; @Override public Class<?> getColumnClass(int columnIndex) { return cols[columnIndex]; } }); MCellRenderer renderer = new MCellRenderer(); jTable.setDefaultRenderer(MColoredBoolValue.class, renderer); jTable.setDefaultRenderer(MColoredStringValue.class, renderer); MCellEditor anEditor = new MCellEditor(); jTable.setDefaultEditor(MColoredBoolValue.class, anEditor); jTable.setDefaultEditor(MColoredStringValue.class, anEditor); // show(jTable); showFrame(jTable); } static void showFrame(JTable jTable) { JFrame frame = new JFrame("Book Tree"); frame.getContentPane().add(jTable, BorderLayout.CENTER); frame.setSize(920, 470); frame.setLocationRelativeTo(frame.getOwner()); frame.setVisible(true); } private static void show(JTable jTable) { JPanel jPanel = new JPanel(new BorderLayout()); jPanel.add(jTable, BorderLayout.CENTER); ComponentPopupBuilder builder = JBPopupFactory.getInstance() .createComponentPopupBuilder(jPanel, jTable) .setCancelOnClickOutside(true) .setCancelOnOtherWindowOpen(false) .setCancelOnWindowDeactivation(false) .setCancelKeyEnabled(false) .setAdText("Press " + KeymapUtil.getShortcutsText( CommonShortcuts.ALT_ENTER.getShortcuts()) + " to collapse/expand") .setTitle("Search Settings") .setMovable(true) .setResizable(true) .setRequestFocus(true) .setMayBeParent(true) .setMinSize(new Dimension(800, 500)); JBPopup jbPopup = builder.createPopup(); jbPopup.showInFocusCenter(); } }
UTF-8
Java
3,512
java
TableTest1.java
Java
[ { "context": "aultTableModel;\nimport java.awt.*;\n\n/**\n * @author Carry\n * @date 2020/8/13\n */\npublic class TableTest1 {\n", "end": 413, "score": 0.9988268613815308, "start": 408, "tag": "NAME", "value": "Carry" } ]
null
[]
package demo.ui.components.editor.table; import com.intellij.openapi.actionSystem.CommonShortcuts; import com.intellij.openapi.keymap.KeymapUtil; import com.intellij.openapi.ui.popup.ComponentPopupBuilder; import com.intellij.openapi.ui.popup.JBPopup; import com.intellij.openapi.ui.popup.JBPopupFactory; import javax.swing.*; import javax.swing.table.DefaultTableModel; import java.awt.*; /** * @author Carry * @date 2020/8/13 */ public class TableTest1 { public static void main(String[] args) { Object[][] data = new Object[][] { { new MColoredBoolValue(false, false), new MColoredStringValue("hah1", false), Boolean.FALSE }, { new MColoredBoolValue(false, true), new MColoredStringValue("hah2", true), Boolean.TRUE }, }; String[] columnNames = new String[] { "Colored", "String", "Bool" }; JTable jTable = new JTable(new DefaultTableModel(data, columnNames) { Class<?>[] cols = new Class[] { MColoredBoolValue.class, MColoredStringValue.class, Boolean.class }; @Override public Class<?> getColumnClass(int columnIndex) { return cols[columnIndex]; } }); MCellRenderer renderer = new MCellRenderer(); jTable.setDefaultRenderer(MColoredBoolValue.class, renderer); jTable.setDefaultRenderer(MColoredStringValue.class, renderer); MCellEditor anEditor = new MCellEditor(); jTable.setDefaultEditor(MColoredBoolValue.class, anEditor); jTable.setDefaultEditor(MColoredStringValue.class, anEditor); // show(jTable); showFrame(jTable); } static void showFrame(JTable jTable) { JFrame frame = new JFrame("Book Tree"); frame.getContentPane().add(jTable, BorderLayout.CENTER); frame.setSize(920, 470); frame.setLocationRelativeTo(frame.getOwner()); frame.setVisible(true); } private static void show(JTable jTable) { JPanel jPanel = new JPanel(new BorderLayout()); jPanel.add(jTable, BorderLayout.CENTER); ComponentPopupBuilder builder = JBPopupFactory.getInstance() .createComponentPopupBuilder(jPanel, jTable) .setCancelOnClickOutside(true) .setCancelOnOtherWindowOpen(false) .setCancelOnWindowDeactivation(false) .setCancelKeyEnabled(false) .setAdText("Press " + KeymapUtil.getShortcutsText( CommonShortcuts.ALT_ENTER.getShortcuts()) + " to collapse/expand") .setTitle("Search Settings") .setMovable(true) .setResizable(true) .setRequestFocus(true) .setMayBeParent(true) .setMinSize(new Dimension(800, 500)); JBPopup jbPopup = builder.createPopup(); jbPopup.showInFocusCenter(); } }
3,512
0.53246
0.526196
75
45.826668
32.573761
112
false
false
0
0
0
0
0
0
0.746667
false
false
4
9416ad149ce70f1f06a498f874741a53d8e94a02
317,827,606,675
76852b1b29410436817bafa34c6dedaedd0786cd
/sources-2020-11-04-tempmail/sources/com/tempmail/api/models/requests/DomainsBody.java
b03ecfb0a341e57c0d3aa243a69adf41f9f1afb4
[]
no_license
zteeed/tempmail-apks
https://github.com/zteeed/tempmail-apks
040e64e07beadd8f5e48cd7bea8b47233e99611c
19f8da1993c2f783b8847234afb52d94b9d1aa4c
refs/heads/master
2023-01-09T06:43:40.830000
2020-11-04T18:55:05
2020-11-04T18:55:05
310,075,224
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.tempmail.api.models.requests; public class DomainsBody extends RpcBody { DomainParams params = new DomainParams(); public class DomainParams { public DomainParams() { } } public DomainsBody() { this.method = "getdomains"; } }
UTF-8
Java
285
java
DomainsBody.java
Java
[]
null
[]
package com.tempmail.api.models.requests; public class DomainsBody extends RpcBody { DomainParams params = new DomainParams(); public class DomainParams { public DomainParams() { } } public DomainsBody() { this.method = "getdomains"; } }
285
0.638596
0.638596
14
19.357143
17.277596
45
false
false
0
0
0
0
0
0
0.214286
false
false
4
7825021b7ac26c9047229bd4d40382f91b7bc241
29,686,813,964,695
8715a5e1cf152e037faf6ac0ecfd70c73a01ca0e
/es/dto/ESSearchObject.java
f41d9c238b12f4347f1ad858b1bd0201c5ef96c2
[]
no_license
phungminhhieu1206/elasticseach_demo
https://github.com/phungminhhieu1206/elasticseach_demo
c79e1f928c19d38fbb3882f0d0a7e52fb7c3b686
518b74f5a0f0858b5d795ed9a83ebc8698fd1b3c
refs/heads/main
2023-05-01T10:47:24.127000
2021-05-14T10:29:05
2021-05-14T10:29:05
355,982,286
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.tav.web.dto; /** * * @author HieuPhung */ public class ESSearchObject { private Integer from; // offset private Integer size; // limit private ESSearchQuery query = new ESSearchQuery(); private Boolean track_total_hits = true; public Integer getFrom() { return from; } public void setFrom(Integer from) { this.from = from; } public Integer getSize() { return size; } public void setSize(Integer size) { this.size = size; } public ESSearchQuery getQuery() { return query; } public void setQuery(ESSearchQuery query) { this.query = query; } public Boolean getTrack_total_hits() { return track_total_hits; } public void setTrack_total_hits(Boolean track_total_hits) { this.track_total_hits = track_total_hits; } }
UTF-8
Java
1,076
java
ESSearchObject.java
Java
[ { "context": "r.\n */\npackage com.tav.web.dto;\n\n/**\n *\n * @author HieuPhung\n */\npublic class ESSearchObject {\n \n privat", "end": 238, "score": 0.9944043755531311, "start": 229, "tag": "NAME", "value": "HieuPhung" } ]
null
[]
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.tav.web.dto; /** * * @author HieuPhung */ public class ESSearchObject { private Integer from; // offset private Integer size; // limit private ESSearchQuery query = new ESSearchQuery(); private Boolean track_total_hits = true; public Integer getFrom() { return from; } public void setFrom(Integer from) { this.from = from; } public Integer getSize() { return size; } public void setSize(Integer size) { this.size = size; } public ESSearchQuery getQuery() { return query; } public void setQuery(ESSearchQuery query) { this.query = query; } public Boolean getTrack_total_hits() { return track_total_hits; } public void setTrack_total_hits(Boolean track_total_hits) { this.track_total_hits = track_total_hits; } }
1,076
0.626394
0.626394
53
19.301888
20.085276
79
false
false
0
0
0
0
0
0
0.301887
false
false
4
92dad34141197c5bfc5573b79507eb96cf1a6104
13,812,614,827,830
5b3124d08ed839e876de9f47af685589ccec5c9b
/ulearning-common-core/src/main/java/com/ky/ulearning/common/core/utils/EncryptUtil.java
6a08109ad01f84f62d8be44bacb74476b0b055f2
[]
no_license
Hyidol/u-learning
https://github.com/Hyidol/u-learning
b570b59ac6a7caed593d8105b462c9c4071661b7
859a5439e12a05eb2206817dfe68b46a5fdd67b0
refs/heads/master
2022-11-20T06:39:36.030000
2020-05-22T14:49:41
2020-05-22T14:49:41
299,804,019
0
1
null
true
2020-09-30T03:57:12
2020-09-30T03:57:11
2020-09-30T03:21:04
2020-07-21T01:42:25
51,107
0
0
0
null
false
false
package com.ky.ulearning.common.core.utils; import org.springframework.util.DigestUtils; /** * 加密工具类 * * @author luyuhao * @date 19/12/06 03:33 */ public class EncryptUtil { /** * 密码加密 * * @param password 密码 * @return 返回加密后的密码串 */ public static String encryptPassword(String password) { return DigestUtils.md5DigestAsHex(password.getBytes()); } }
UTF-8
Java
440
java
EncryptUtil.java
Java
[ { "context": "work.util.DigestUtils;\n\n/**\n * 加密工具类\n *\n * @author luyuhao\n * @date 19/12/06 03:33\n */\npublic class EncryptU", "end": 125, "score": 0.9995428919792175, "start": 118, "tag": "USERNAME", "value": "luyuhao" }, { "context": " /**\n * 密码加密\n *\n * @param password 密码\n * @return 返回加密后的密码串\n */\n public stati", "end": 234, "score": 0.9918457865715027, "start": 232, "tag": "PASSWORD", "value": "密码" } ]
null
[]
package com.ky.ulearning.common.core.utils; import org.springframework.util.DigestUtils; /** * 加密工具类 * * @author luyuhao * @date 19/12/06 03:33 */ public class EncryptUtil { /** * 密码加密 * * @param password 密码 * @return 返回加密后的密码串 */ public static String encryptPassword(String password) { return DigestUtils.md5DigestAsHex(password.getBytes()); } }
440
0.6425
0.615
22
17.181818
18.874313
63
false
false
0
0
0
0
0
0
0.136364
false
false
4
926f1a9a31098b8728762553b0e7ae5978022ad3
12,025,908,431,512
ec81ffbd1d4b053da34540ab2867089e7dd2f079
/Business/src/main/java/se/bdd/admin/business/handler/status/StatusHandler.java
67c75dd87900edebb336630010844e7ec6c512b0
[]
no_license
svantebdd/admin
https://github.com/svantebdd/admin
33ccdfe8009a04f1f94a194ea1d233cc0727fc2e
21d589515c60303a399d944473fc0a0eb6b5aa30
refs/heads/master
2020-08-13T21:17:07.630000
2019-11-04T13:41:21
2019-11-04T13:41:21
215,038,947
0
0
null
false
2020-07-18T16:49:12
2019-10-14T12:31:02
2019-11-04T13:41:30
2020-07-18T16:49:10
6,534
0
0
3
Java
false
false
package se.bdd.admin.business.handler.status; import se.bdd.admin.business.handler.status.valueclass.Status; public interface StatusHandler { Status getStatus(); void init(Long total, String status); void init(int total, String status); void updateProgress(); void addToNumber(); void setStatusToFinished(); }
UTF-8
Java
343
java
StatusHandler.java
Java
[]
null
[]
package se.bdd.admin.business.handler.status; import se.bdd.admin.business.handler.status.valueclass.Status; public interface StatusHandler { Status getStatus(); void init(Long total, String status); void init(int total, String status); void updateProgress(); void addToNumber(); void setStatusToFinished(); }
343
0.720117
0.720117
19
17.052631
19.661541
62
false
false
0
0
0
0
0
0
0.526316
false
false
4
15dae6c799e8c48254a5831c2ca75916f3d17105
12,833,362,284,627
f06e07e78302314e1ae5a173dcb19efb5eb39afd
/app/src/main/java/com/cannizarro/securitycamera/CameraActivity.java
8e73f872026ccef4122a8f42f05dd312b5f12cdd
[ "MIT" ]
permissive
cannizarro/Suraksha
https://github.com/cannizarro/Suraksha
9e3b22e3725ada361d991b766407e54b683bd3b3
cc0d922779d59743099512bda76f8313805620a0
refs/heads/master
2021-07-12T07:42:46.985000
2021-05-09T10:57:13
2021-05-09T10:57:13
245,426,609
5
0
null
false
2020-04-01T10:12:07
2020-03-06T13:26:39
2020-04-01T10:10:50
2020-04-01T10:12:07
321
1
0
0
Java
false
false
package com.cannizarro.securitycamera; import android.Manifest; import android.content.Intent; import android.content.pm.PackageManager; import android.net.Uri; import android.os.Bundle; import android.os.Environment; import android.text.Editable; import android.text.TextWatcher; import android.util.Base64; import android.util.Log; import android.view.WindowManager; import android.widget.Button; import android.widget.LinearLayout; import android.widget.Toast; import androidx.annotation.NonNull; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; import androidx.core.content.FileProvider; import com.cannizarro.securitycamera.VideoRecorder.CustomVideoRecorder; import com.cannizarro.securitycamera.webRTC.APIKeys; import com.cannizarro.securitycamera.webRTC.CustomPeerConnectionObserver; import com.cannizarro.securitycamera.webRTC.CustomSdpObserver; import com.cannizarro.securitycamera.webRTC.FirebaseSignalling; import com.cannizarro.securitycamera.webRTC.IceServer; import com.cannizarro.securitycamera.webRTC.SDP; import com.cannizarro.securitycamera.webRTC.TurnServerPojo; import com.cannizarro.securitycamera.webRTC.Utils; import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.android.material.snackbar.Snackbar; import com.google.android.material.textfield.TextInputEditText; import com.google.android.material.textfield.TextInputLayout; import com.leinardi.android.speeddial.SpeedDialActionItem; import com.leinardi.android.speeddial.SpeedDialView; import org.webrtc.AudioSource; import org.webrtc.AudioTrack; import org.webrtc.Camera1Enumerator; import org.webrtc.CameraEnumerator; import org.webrtc.DefaultVideoDecoderFactory; import org.webrtc.DefaultVideoEncoderFactory; import org.webrtc.EglBase; import org.webrtc.IceCandidate; import org.webrtc.Logging; import org.webrtc.MediaConstraints; import org.webrtc.MediaStream; import org.webrtc.PeerConnection; import org.webrtc.PeerConnectionFactory; import org.webrtc.SessionDescription; import org.webrtc.SurfaceTextureHelper; import org.webrtc.SurfaceViewRenderer; import org.webrtc.VideoCapturer; import org.webrtc.VideoSource; import org.webrtc.VideoTrack; import java.io.File; import java.nio.charset.StandardCharsets; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Locale; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; public class CameraActivity extends AppCompatActivity implements FirebaseSignalling.SignallingInterface { final String TAG = "CameraActivity"; final int ALL_PERMISSIONS_CODE = 1; static final int MEDIA_TYPE_VIDEO = 1; String[] permissions = {Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO, Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE}; private boolean isRecording = false, isScreenOn = true, isStarted = false, isChannelReady = false; private int recordingQuality = 720; private String username, cameraName; PeerConnection localPeer; List<IceServer> iceServers; List<PeerConnection.IceServer> peerIceServers = new ArrayList<>(); PeerConnectionFactory peerConnectionFactory; MediaConstraints audioConstraints; MediaConstraints videoConstraints; MediaConstraints sdpConstraints; VideoCapturer videoCapturerAndroid; VideoSource videoSource; VideoTrack localVideoTrack; AudioSource audioSource; AudioTrack localAudioTrack; public static EglBase rootEglBase; SurfaceTextureHelper surfaceTextureHelper; MediaStream stream; CustomVideoRecorder customVideoRecorder; private File file; LinearLayout buttonGroupLayout; SurfaceViewRenderer localVideoView; SpeedDialView speedDialView; FloatingActionButton backButton; private Button captureButton, screenOffButton, onlineButton; FirebaseSignalling signallingClient; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_camera); Intent intent = getIntent(); username = intent.getStringExtra("username"); signallingClient = new FirebaseSignalling(); rootEglBase = EglBase.create(); onlineButton = findViewById(R.id.online); captureButton = findViewById(R.id.save); screenOffButton = findViewById(R.id.screenOff); localVideoView = findViewById(R.id.local_gl_surface_view); speedDialView = findViewById(R.id.speedDial); backButton = findViewById(R.id.back_button); buttonGroupLayout = findViewById(R.id.linearLayout); speedDialView.addActionItem( new SpeedDialActionItem.Builder(R.id.fab_action_hd, R.drawable.ic_720_hd) .setFabBackgroundColor(getResources().getColor(R.color.colorSecondaryVariant, getResources().newTheme())) .create()); speedDialView.addActionItem( new SpeedDialActionItem.Builder(R.id.fab_action_sd, R.drawable.ic_480_sd) .setFabBackgroundColor(getResources().getColor(R.color.colorSecondaryVariant, getResources().newTheme())) .create()); localVideoView.setOnClickListener(view -> { if (!isScreenOn) { turnScreenOn(); } }); screenOffButton.setOnClickListener(view -> { if (isScreenOn) turnScreenOff(); else turnScreenOn(); }); captureButton.setOnClickListener(view -> controlRecording()); onlineButton.setOnClickListener(view -> { if (isStarted) { hangup(); localVideoView.setKeepScreenOn(false); onlineButton.setText(R.string.online); onlineButton.setBackgroundColor(getResources().getColor(R.color.colorPrimary, getResources().newTheme())); } else { streamOnline(); } }); speedDialView.setOnActionSelectedListener(actionItem -> { switch (actionItem.getId()) { case R.id.fab_action_hd: if (videoCapturerAndroid != null && recordingQuality != 720) { videoCapturerAndroid.changeCaptureFormat(1024, 720, 30); recordingQuality = 720; } break; case R.id.fab_action_sd: if (videoCapturerAndroid != null && recordingQuality != 480) { videoCapturerAndroid.changeCaptureFormat(720, 480, 30); recordingQuality = 480; } captureButton.setText("Record " + recordingQuality); break; } return false; }); backButton.setOnClickListener(view -> onBackPressed()); if (ContextCompat.checkSelfPermission(this, permissions[0]) != PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission(this, permissions[1]) != PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission(this, permissions[2]) != PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission(this, permissions[3]) != PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(this, permissions, ALL_PERMISSIONS_CODE); } getIceServers(); } @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); if (requestCode != ALL_PERMISSIONS_CODE || grantResults.length != 4 || grantResults[0] != PackageManager.PERMISSION_GRANTED || grantResults[1] != PackageManager.PERMISSION_GRANTED || grantResults[2] != PackageManager.PERMISSION_GRANTED || grantResults[3] != PackageManager.PERMISSION_GRANTED) { //All permissions are not granted finish(); Toast.makeText(this, "Required permissions are not granted.", Toast.LENGTH_SHORT).show(); } } @Override protected void onPause() { super.onPause(); if (isStarted) { hangup(); localVideoView.setKeepScreenOn(false); onlineButton.setText(R.string.online); onlineButton.setBackgroundColor(getResources().getColor(R.color.colorPrimary, getResources().newTheme())); } if (isRecording) controlRecording(); if (videoCapturerAndroid != null) { try { videoCapturerAndroid.stopCapture(); } catch (InterruptedException e) { e.printStackTrace(); } surfaceTextureHelper.stopListening(); surfaceTextureHelper.dispose(); localVideoView.release(); } } @Override protected void onResume() { super.onResume(); start(); } /** * Initialising Camera Preview */ public void initRTCViews() { localVideoView.init(rootEglBase.getEglBaseContext(), null); localVideoView.setZOrderMediaOverlay(true); } /** * Method related to fulfil TURN server needs. Here we are using Xirsys **/ private void getIceServers() { //get Ice servers using xirsys byte[] data; data = (APIKeys.xirsys).getBytes(StandardCharsets.UTF_8); String authToken = "Basic " + Base64.encodeToString(data, Base64.NO_WRAP); Utils.getInstance().getRetrofitInstance().getIceCandidates(authToken).enqueue(new Callback<TurnServerPojo>() { @Override public void onResponse(@NonNull Call<TurnServerPojo> call, @NonNull Response<TurnServerPojo> response) { TurnServerPojo body = response.body(); if (body != null) { iceServers = body.iceServerList.iceServers; } for (IceServer iceServer : iceServers) { if (iceServer.credential == null) { PeerConnection.IceServer peerIceServer = PeerConnection.IceServer.builder(iceServer.url).createIceServer(); peerIceServers.add(peerIceServer); } else { PeerConnection.IceServer peerIceServer = PeerConnection.IceServer.builder(iceServer.url) .setUsername(iceServer.username) .setPassword(iceServer.credential) .createIceServer(); peerIceServers.add(peerIceServer); } } Log.d("onApiResponse", "IceServers\n" + peerIceServers.toString()); isChannelReady = true; onlineButton.setEnabled(true); } @Override public void onFailure(@NonNull Call<TurnServerPojo> call, @NonNull Throwable t) { t.printStackTrace(); isChannelReady = true; onlineButton.setEnabled(true); Snackbar.make(buttonGroupLayout, "Can't connect to Xirsys TURN servers. Calls over some networks won't connect", Snackbar.LENGTH_INDEFINITE) .setAnchorView(buttonGroupLayout) .setActionTextColor(getResources().getColor(R.color.colorSecondary, getResources().newTheme())) .setTextColor(getResources().getColor(R.color.colorOnPrimary, getResources().newTheme())) .setBackgroundTint(getResources().getColor(R.color.material_dark_grey, getResources().newTheme())) .setAction("Retry", view -> { isChannelReady = false; onlineButton.setEnabled(false); getIceServers(); }) .show(); } }); } /** * Starting intitialising WebRTC built in features to be used for further streaming or video recording. */ public void start() { initRTCViews(); PeerConnectionFactory.InitializationOptions initializationOptions = PeerConnectionFactory.InitializationOptions.builder(this) .createInitializationOptions(); PeerConnectionFactory.initialize(initializationOptions); //Create a new PeerConnectionFactory instance - using Hardware encoder and decoder. PeerConnectionFactory.Options options = new PeerConnectionFactory.Options(); DefaultVideoEncoderFactory defaultVideoEncoderFactory = new DefaultVideoEncoderFactory( rootEglBase.getEglBaseContext(), /* enableIntelVp8Encoder */true, /* enableH264HighProfile */true); DefaultVideoDecoderFactory defaultVideoDecoderFactory = new DefaultVideoDecoderFactory(rootEglBase.getEglBaseContext()); peerConnectionFactory = PeerConnectionFactory.builder() .setVideoEncoderFactory(defaultVideoEncoderFactory) .setVideoDecoderFactory(defaultVideoDecoderFactory) .setOptions(options) .createPeerConnectionFactory(); //Create MediaConstraints - Will be useful for specifying video and audio constraints. audioConstraints = new MediaConstraints(); videoConstraints = new MediaConstraints(); surfaceTextureHelper = SurfaceTextureHelper.create("CaptureThread", rootEglBase.getEglBaseContext()); //Now create a VideoCapturer instance. videoCapturerAndroid = createCameraCapturer(new Camera1Enumerator(false)); //Create a VideoSource instance if (videoCapturerAndroid != null) { videoSource = peerConnectionFactory.createVideoSource(videoCapturerAndroid.isScreencast()); videoCapturerAndroid.initialize(surfaceTextureHelper, getApplicationContext(), videoSource.getCapturerObserver()); } localVideoTrack = peerConnectionFactory.createVideoTrack("100", videoSource); //create an AudioSource instance audioSource = peerConnectionFactory.createAudioSource(audioConstraints); localAudioTrack = peerConnectionFactory.createAudioTrack("101", audioSource); surfaceTextureHelper = SurfaceTextureHelper.create("CaptureThread", rootEglBase.getEglBaseContext()); if (videoCapturerAndroid != null) { videoCapturerAndroid.startCapture(1024, 720, 30); } // And finally, with our VideoRenderer ready, we // can add our renderer to the VideoTrack. localVideoTrack.addSink(localVideoView); stream = peerConnectionFactory.createLocalMediaStream("102"); stream.addTrack(localVideoTrack); } /** * Called when online button is pressed. Basically pushes its SDP constraints onto firebase for handshaking. */ private void streamOnline() { // Set up the input TextInputLayout textInputLayout = (TextInputLayout) getLayoutInflater().inflate(R.layout.my_text_input, null); TextInputEditText input = (TextInputEditText) textInputLayout.getEditText(); if (input != null) { AlertDialog.Builder builder = new AlertDialog.Builder(this) .setIcon(R.drawable.ic_security) .setTitle("Set camera name") .setMessage("If you want to go online, please set this camera's name.") .setView(textInputLayout) .setPositiveButton("OK", (dialogInterface, i) -> { cameraName = input.getText().toString(); signallingClient.setReference("/" + username + "/" + cameraName); onTryToStart(); signallingClient.attachReadListener(this, cameraName); showSnackBar("Camera name set", Snackbar.LENGTH_LONG); onlineButton.setText("Stop " + cameraName); onlineButton.setBackgroundColor(getResources().getColor(R.color.colorSecondary, getResources().newTheme())); localVideoView.setKeepScreenOn(true); }) .setNegativeButton("Cancel", (dialogInterface, i) -> dialogInterface.cancel()); AlertDialog dialog = builder.create(); dialog.setOnShowListener(dialog1 -> ((AlertDialog) dialog1).getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false)); // Enable Send button when there's text to send input.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { } @Override public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { if (charSequence.toString().trim().length() > 0) { (dialog).getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(true); } else { (dialog).getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false); } } @Override public void afterTextChanged(Editable editable) { } }); dialog.show(); } } /** * This method will be called directly by the app when it is the initiator and has got the local media * or when the remote peer sends a message through socket that it is ready to transmit AV data */ public void onTryToStart() { runOnUiThread(() -> { if (!isStarted && localVideoTrack != null) { createPeerConnection(); isStarted = true; doCall(); } }); } /** * Creating the local peerconnection instance */ private void createPeerConnection() { Log.d("onApiResponsecreatePeerConn", "IceServers\n" + peerIceServers.toString()); PeerConnection.RTCConfiguration rtcConfig = new PeerConnection.RTCConfiguration(peerIceServers); // TCP candidates are only useful when connecting to a server that supports // ICE-TCP. rtcConfig.tcpCandidatePolicy = PeerConnection.TcpCandidatePolicy.DISABLED; rtcConfig.bundlePolicy = PeerConnection.BundlePolicy.MAXBUNDLE; rtcConfig.rtcpMuxPolicy = PeerConnection.RtcpMuxPolicy.REQUIRE; rtcConfig.continualGatheringPolicy = PeerConnection.ContinualGatheringPolicy.GATHER_CONTINUALLY; // Use ECDSA encryption. rtcConfig.keyType = PeerConnection.KeyType.ECDSA; localPeer = peerConnectionFactory.createPeerConnection(rtcConfig, new CustomPeerConnectionObserver("localPeerCreation") { @Override public void onIceCandidate(IceCandidate iceCandidate) { super.onIceCandidate(iceCandidate); onIceCandidateReceived(iceCandidate); } }); addStreamToLocalPeer(); } /** * Adding the stream to the localpeer */ private void addStreamToLocalPeer() { //creating local mediastream MediaStream stream = peerConnectionFactory.createLocalMediaStream("102"); stream.addTrack(localAudioTrack); stream.addTrack(localVideoTrack); localPeer.addStream(stream); } /** * This method is called when the app is initiator - We generate the offer and send it over through socket * to remote peer */ private void doCall() { sdpConstraints = new MediaConstraints(); sdpConstraints.mandatory.add( new MediaConstraints.KeyValuePair("OfferToReceiveAudio", "true")); sdpConstraints.mandatory.add(new MediaConstraints.KeyValuePair( "OfferToReceiveVideo", "true")); localPeer.createOffer(new CustomSdpObserver("localCreateOffer") { @Override public void onCreateSuccess(SessionDescription sessionDescription) { super.onCreateSuccess(sessionDescription); localPeer.setLocalDescription(new CustomSdpObserver("localSetLocalDesc"), sessionDescription); Log.d("onCreateSuccess", "SignallingClient emit "); emitMessage(sessionDescription, cameraName); } }, sdpConstraints); } /** * Received local ice candidate. Send it to remote peer through signalling for negotiation */ public void onIceCandidateReceived(IceCandidate iceCandidate) { //we have received ice candidate. We can set it to the other peer. emitIceCandidate(iceCandidate, cameraName); } /** * Called when remote peer sends answer to your offer */ @Override public void onAnswerReceived(SDP data) { showSnackBar("Streamer added", Snackbar.LENGTH_LONG); localPeer.setRemoteDescription(new CustomSdpObserver("localSetRemote"), new SessionDescription(SessionDescription.Type.fromCanonicalForm(data.type.toLowerCase()), data.sdp)); } /** * Remote IceCandidate received */ @Override public void onIceCandidateReceived(SDP data) { localPeer.addIceCandidate(new IceCandidate(data.id, data.label, data.candidate)); } // Dummy @Override public void onOfferReceived(SDP data) { } /** * Pushing ice candidates to firebase. */ public void emitIceCandidate(IceCandidate iceCandidate, String username) { SDP object = new SDP(iceCandidate, username); signallingClient.push(object); } /** * Pushing the sesion description onto firebase. */ public void emitMessage(SessionDescription message, String username) { Log.d("CameraActivity", "emitMessage() called with: message = [" + message + "]"); SDP object = new SDP(message, username); signallingClient.push(object); } @Override public void disconnect(){ showSnackBar("Streamer Disconnected", Snackbar.LENGTH_LONG); hangup(); signallingClient.setReference("/" + username + "/" + cameraName); onTryToStart(); signallingClient.attachReadListener(this, cameraName); } /** * Closes all connection and disconnects deletes all the local and online presence created. */ private void hangup() { try { localPeer.close(); localPeer = null; isStarted = false; close(); } catch (Exception e) { e.printStackTrace(); } } /** * Detaching the read listener */ public void close() { signallingClient.detachReadListener(); signallingClient.deleteReference(); } @Override public boolean getisStarted(){ return isStarted; } /** * When this method is called: * if isRecording is true then recording will stop * else it will start recording */ public void controlRecording() { try { if (customVideoRecorder == null) { customVideoRecorder = new CustomVideoRecorder(); } if (isRecording) { // stop recording and release camera localVideoView.setKeepScreenOn(false); //getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); customVideoRecorder.stopRecording(1, getApplicationContext()); // inform the user that recording has stopped captureButton.setText("Record " + recordingQuality); captureButton.setBackgroundColor(getResources().getColor(R.color.colorPrimary, getResources().newTheme())); showSnackBar(file, Snackbar.LENGTH_LONG); isRecording = false; } else { localVideoView.setKeepScreenOn(true); getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); file = getOutputMediaFile(MEDIA_TYPE_VIDEO); if (file != null) { customVideoRecorder.startRecordingToFile(file.getPath(), 1, localVideoTrack, rootEglBase); } // inform the user that recording has started captureButton.setText(R.string.stop); captureButton.setBackgroundColor(getResources().getColor(R.color.colorSecondary, getResources().newTheme())); isRecording = true; } } catch (Exception e) { e.printStackTrace(); throw new RuntimeException( "Failed to open video file for output: ", e); } } public void turnScreenOff() { WindowManager.LayoutParams params = getWindow().getAttributes(); params.screenBrightness = .01f; getWindow().setAttributes(params); isScreenOn = false; screenOffButton.setBackgroundColor(getResources().getColor(R.color.colorSecondary, getResources().newTheme())); captureButton.setEnabled(false); onlineButton.setEnabled(false); } public void turnScreenOn() { WindowManager.LayoutParams params = getWindow().getAttributes(); params.screenBrightness = -1f; getWindow().setAttributes(params); screenOffButton.setBackgroundColor(getResources().getColor(R.color.colorPrimary, getResources().newTheme())); isScreenOn = true; screenOffButton.setText(R.string.dim_screen); captureButton.setEnabled(true); if (isChannelReady) { onlineButton.setEnabled(true); } } /** * Create a File for saving an image or video */ private static File getOutputMediaFile(@SuppressWarnings("SameParameterValue") int type) { // To be safe, you should check that the SDCard is // using Environment.getExternalStorageState() before doing this. // Create a media file name String timeStamp = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH).format(new Date()); File mediaStorageDir = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM), "Security Camera/" + timeStamp); // This location works best if you want the created images to be shared // between applications and persist after your app has been uninstalled. // Create the storage directory if it does not exist if (!mediaStorageDir.exists()) { if (!mediaStorageDir.mkdirs()) { Log.d("Security Camera", "failed to create directory"); return null; } } File mediaFile; timeStamp = new SimpleDateFormat("HH:mm:ss", Locale.ENGLISH).format(new Date()); if (type == MEDIA_TYPE_VIDEO) { mediaFile = new File(mediaStorageDir.getPath() + File.separator + "CAM_" + timeStamp + ".mp4"); } else { return null; } return mediaFile; } public void showSnackBar(String msg, int length) { Snackbar.make(buttonGroupLayout, msg, length) .setAnchorView(buttonGroupLayout) .setTextColor(getResources().getColor(R.color.colorOnPrimary, getResources().newTheme())) .setBackgroundTint(getResources().getColor(R.color.material_dark_grey, getResources().newTheme())) .show(); } public void showSnackBar(final File file, int length) { Snackbar.make(buttonGroupLayout, "Video saved. Path: " + file.getParent(), length) .setAnchorView(buttonGroupLayout) .setTextColor(getResources().getColor(R.color.colorOnPrimary, getResources().newTheme())) .setActionTextColor(getResources().getColor(R.color.colorSecondary, getResources().newTheme())) .setBackgroundTint(getResources().getColor(R.color.material_dark_grey, getResources().newTheme())) .setAction("View Video", v -> { // Respond to the click, such as by undoing the modification that caused // Create the text message with a string Uri selectedUri = FileProvider.getUriForFile(getApplicationContext(), getApplicationContext().getPackageName() + ".provider", file); Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(selectedUri, "video/mp4"); intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); if (intent.resolveActivityInfo(getPackageManager(), 0) != null) { startActivity(intent); } else { // if you reach this place, it means there is no any file // explorer app installed on your device showSnackBar("No application to view mp4 video.", Snackbar.LENGTH_LONG); } }) .show(); } private VideoCapturer createCameraCapturer(CameraEnumerator enumerator) { final String[] deviceNames = enumerator.getDeviceNames(); // First, try to find back facing camera Logging.d(TAG, "Looking for back facing cameras."); for (String deviceName : deviceNames) { if (enumerator.isBackFacing(deviceName)) { Logging.d(TAG, "Creating back facing camera capturer."); VideoCapturer videoCapturer = enumerator.createCapturer(deviceName, null); if (videoCapturer != null) { return videoCapturer; } } } return null; } }
UTF-8
Java
30,211
java
CameraActivity.java
Java
[ { "context": "tent();\n username = intent.getStringExtra(\"username\");\n\n signallingClient = new FirebaseSignal", "end": 4390, "score": 0.9996179342269897, "start": 4382, "tag": "USERNAME", "value": "username" }, { "context": " signallingClient.setReference(\"/\" + username + \"/\" + cameraName);\n\n onT", "end": 16179, "score": 0.8084187507629395, "start": 16171, "tag": "USERNAME", "value": "username" } ]
null
[]
package com.cannizarro.securitycamera; import android.Manifest; import android.content.Intent; import android.content.pm.PackageManager; import android.net.Uri; import android.os.Bundle; import android.os.Environment; import android.text.Editable; import android.text.TextWatcher; import android.util.Base64; import android.util.Log; import android.view.WindowManager; import android.widget.Button; import android.widget.LinearLayout; import android.widget.Toast; import androidx.annotation.NonNull; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; import androidx.core.content.FileProvider; import com.cannizarro.securitycamera.VideoRecorder.CustomVideoRecorder; import com.cannizarro.securitycamera.webRTC.APIKeys; import com.cannizarro.securitycamera.webRTC.CustomPeerConnectionObserver; import com.cannizarro.securitycamera.webRTC.CustomSdpObserver; import com.cannizarro.securitycamera.webRTC.FirebaseSignalling; import com.cannizarro.securitycamera.webRTC.IceServer; import com.cannizarro.securitycamera.webRTC.SDP; import com.cannizarro.securitycamera.webRTC.TurnServerPojo; import com.cannizarro.securitycamera.webRTC.Utils; import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.android.material.snackbar.Snackbar; import com.google.android.material.textfield.TextInputEditText; import com.google.android.material.textfield.TextInputLayout; import com.leinardi.android.speeddial.SpeedDialActionItem; import com.leinardi.android.speeddial.SpeedDialView; import org.webrtc.AudioSource; import org.webrtc.AudioTrack; import org.webrtc.Camera1Enumerator; import org.webrtc.CameraEnumerator; import org.webrtc.DefaultVideoDecoderFactory; import org.webrtc.DefaultVideoEncoderFactory; import org.webrtc.EglBase; import org.webrtc.IceCandidate; import org.webrtc.Logging; import org.webrtc.MediaConstraints; import org.webrtc.MediaStream; import org.webrtc.PeerConnection; import org.webrtc.PeerConnectionFactory; import org.webrtc.SessionDescription; import org.webrtc.SurfaceTextureHelper; import org.webrtc.SurfaceViewRenderer; import org.webrtc.VideoCapturer; import org.webrtc.VideoSource; import org.webrtc.VideoTrack; import java.io.File; import java.nio.charset.StandardCharsets; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Locale; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; public class CameraActivity extends AppCompatActivity implements FirebaseSignalling.SignallingInterface { final String TAG = "CameraActivity"; final int ALL_PERMISSIONS_CODE = 1; static final int MEDIA_TYPE_VIDEO = 1; String[] permissions = {Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO, Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE}; private boolean isRecording = false, isScreenOn = true, isStarted = false, isChannelReady = false; private int recordingQuality = 720; private String username, cameraName; PeerConnection localPeer; List<IceServer> iceServers; List<PeerConnection.IceServer> peerIceServers = new ArrayList<>(); PeerConnectionFactory peerConnectionFactory; MediaConstraints audioConstraints; MediaConstraints videoConstraints; MediaConstraints sdpConstraints; VideoCapturer videoCapturerAndroid; VideoSource videoSource; VideoTrack localVideoTrack; AudioSource audioSource; AudioTrack localAudioTrack; public static EglBase rootEglBase; SurfaceTextureHelper surfaceTextureHelper; MediaStream stream; CustomVideoRecorder customVideoRecorder; private File file; LinearLayout buttonGroupLayout; SurfaceViewRenderer localVideoView; SpeedDialView speedDialView; FloatingActionButton backButton; private Button captureButton, screenOffButton, onlineButton; FirebaseSignalling signallingClient; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_camera); Intent intent = getIntent(); username = intent.getStringExtra("username"); signallingClient = new FirebaseSignalling(); rootEglBase = EglBase.create(); onlineButton = findViewById(R.id.online); captureButton = findViewById(R.id.save); screenOffButton = findViewById(R.id.screenOff); localVideoView = findViewById(R.id.local_gl_surface_view); speedDialView = findViewById(R.id.speedDial); backButton = findViewById(R.id.back_button); buttonGroupLayout = findViewById(R.id.linearLayout); speedDialView.addActionItem( new SpeedDialActionItem.Builder(R.id.fab_action_hd, R.drawable.ic_720_hd) .setFabBackgroundColor(getResources().getColor(R.color.colorSecondaryVariant, getResources().newTheme())) .create()); speedDialView.addActionItem( new SpeedDialActionItem.Builder(R.id.fab_action_sd, R.drawable.ic_480_sd) .setFabBackgroundColor(getResources().getColor(R.color.colorSecondaryVariant, getResources().newTheme())) .create()); localVideoView.setOnClickListener(view -> { if (!isScreenOn) { turnScreenOn(); } }); screenOffButton.setOnClickListener(view -> { if (isScreenOn) turnScreenOff(); else turnScreenOn(); }); captureButton.setOnClickListener(view -> controlRecording()); onlineButton.setOnClickListener(view -> { if (isStarted) { hangup(); localVideoView.setKeepScreenOn(false); onlineButton.setText(R.string.online); onlineButton.setBackgroundColor(getResources().getColor(R.color.colorPrimary, getResources().newTheme())); } else { streamOnline(); } }); speedDialView.setOnActionSelectedListener(actionItem -> { switch (actionItem.getId()) { case R.id.fab_action_hd: if (videoCapturerAndroid != null && recordingQuality != 720) { videoCapturerAndroid.changeCaptureFormat(1024, 720, 30); recordingQuality = 720; } break; case R.id.fab_action_sd: if (videoCapturerAndroid != null && recordingQuality != 480) { videoCapturerAndroid.changeCaptureFormat(720, 480, 30); recordingQuality = 480; } captureButton.setText("Record " + recordingQuality); break; } return false; }); backButton.setOnClickListener(view -> onBackPressed()); if (ContextCompat.checkSelfPermission(this, permissions[0]) != PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission(this, permissions[1]) != PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission(this, permissions[2]) != PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission(this, permissions[3]) != PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(this, permissions, ALL_PERMISSIONS_CODE); } getIceServers(); } @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); if (requestCode != ALL_PERMISSIONS_CODE || grantResults.length != 4 || grantResults[0] != PackageManager.PERMISSION_GRANTED || grantResults[1] != PackageManager.PERMISSION_GRANTED || grantResults[2] != PackageManager.PERMISSION_GRANTED || grantResults[3] != PackageManager.PERMISSION_GRANTED) { //All permissions are not granted finish(); Toast.makeText(this, "Required permissions are not granted.", Toast.LENGTH_SHORT).show(); } } @Override protected void onPause() { super.onPause(); if (isStarted) { hangup(); localVideoView.setKeepScreenOn(false); onlineButton.setText(R.string.online); onlineButton.setBackgroundColor(getResources().getColor(R.color.colorPrimary, getResources().newTheme())); } if (isRecording) controlRecording(); if (videoCapturerAndroid != null) { try { videoCapturerAndroid.stopCapture(); } catch (InterruptedException e) { e.printStackTrace(); } surfaceTextureHelper.stopListening(); surfaceTextureHelper.dispose(); localVideoView.release(); } } @Override protected void onResume() { super.onResume(); start(); } /** * Initialising Camera Preview */ public void initRTCViews() { localVideoView.init(rootEglBase.getEglBaseContext(), null); localVideoView.setZOrderMediaOverlay(true); } /** * Method related to fulfil TURN server needs. Here we are using Xirsys **/ private void getIceServers() { //get Ice servers using xirsys byte[] data; data = (APIKeys.xirsys).getBytes(StandardCharsets.UTF_8); String authToken = "Basic " + Base64.encodeToString(data, Base64.NO_WRAP); Utils.getInstance().getRetrofitInstance().getIceCandidates(authToken).enqueue(new Callback<TurnServerPojo>() { @Override public void onResponse(@NonNull Call<TurnServerPojo> call, @NonNull Response<TurnServerPojo> response) { TurnServerPojo body = response.body(); if (body != null) { iceServers = body.iceServerList.iceServers; } for (IceServer iceServer : iceServers) { if (iceServer.credential == null) { PeerConnection.IceServer peerIceServer = PeerConnection.IceServer.builder(iceServer.url).createIceServer(); peerIceServers.add(peerIceServer); } else { PeerConnection.IceServer peerIceServer = PeerConnection.IceServer.builder(iceServer.url) .setUsername(iceServer.username) .setPassword(iceServer.credential) .createIceServer(); peerIceServers.add(peerIceServer); } } Log.d("onApiResponse", "IceServers\n" + peerIceServers.toString()); isChannelReady = true; onlineButton.setEnabled(true); } @Override public void onFailure(@NonNull Call<TurnServerPojo> call, @NonNull Throwable t) { t.printStackTrace(); isChannelReady = true; onlineButton.setEnabled(true); Snackbar.make(buttonGroupLayout, "Can't connect to Xirsys TURN servers. Calls over some networks won't connect", Snackbar.LENGTH_INDEFINITE) .setAnchorView(buttonGroupLayout) .setActionTextColor(getResources().getColor(R.color.colorSecondary, getResources().newTheme())) .setTextColor(getResources().getColor(R.color.colorOnPrimary, getResources().newTheme())) .setBackgroundTint(getResources().getColor(R.color.material_dark_grey, getResources().newTheme())) .setAction("Retry", view -> { isChannelReady = false; onlineButton.setEnabled(false); getIceServers(); }) .show(); } }); } /** * Starting intitialising WebRTC built in features to be used for further streaming or video recording. */ public void start() { initRTCViews(); PeerConnectionFactory.InitializationOptions initializationOptions = PeerConnectionFactory.InitializationOptions.builder(this) .createInitializationOptions(); PeerConnectionFactory.initialize(initializationOptions); //Create a new PeerConnectionFactory instance - using Hardware encoder and decoder. PeerConnectionFactory.Options options = new PeerConnectionFactory.Options(); DefaultVideoEncoderFactory defaultVideoEncoderFactory = new DefaultVideoEncoderFactory( rootEglBase.getEglBaseContext(), /* enableIntelVp8Encoder */true, /* enableH264HighProfile */true); DefaultVideoDecoderFactory defaultVideoDecoderFactory = new DefaultVideoDecoderFactory(rootEglBase.getEglBaseContext()); peerConnectionFactory = PeerConnectionFactory.builder() .setVideoEncoderFactory(defaultVideoEncoderFactory) .setVideoDecoderFactory(defaultVideoDecoderFactory) .setOptions(options) .createPeerConnectionFactory(); //Create MediaConstraints - Will be useful for specifying video and audio constraints. audioConstraints = new MediaConstraints(); videoConstraints = new MediaConstraints(); surfaceTextureHelper = SurfaceTextureHelper.create("CaptureThread", rootEglBase.getEglBaseContext()); //Now create a VideoCapturer instance. videoCapturerAndroid = createCameraCapturer(new Camera1Enumerator(false)); //Create a VideoSource instance if (videoCapturerAndroid != null) { videoSource = peerConnectionFactory.createVideoSource(videoCapturerAndroid.isScreencast()); videoCapturerAndroid.initialize(surfaceTextureHelper, getApplicationContext(), videoSource.getCapturerObserver()); } localVideoTrack = peerConnectionFactory.createVideoTrack("100", videoSource); //create an AudioSource instance audioSource = peerConnectionFactory.createAudioSource(audioConstraints); localAudioTrack = peerConnectionFactory.createAudioTrack("101", audioSource); surfaceTextureHelper = SurfaceTextureHelper.create("CaptureThread", rootEglBase.getEglBaseContext()); if (videoCapturerAndroid != null) { videoCapturerAndroid.startCapture(1024, 720, 30); } // And finally, with our VideoRenderer ready, we // can add our renderer to the VideoTrack. localVideoTrack.addSink(localVideoView); stream = peerConnectionFactory.createLocalMediaStream("102"); stream.addTrack(localVideoTrack); } /** * Called when online button is pressed. Basically pushes its SDP constraints onto firebase for handshaking. */ private void streamOnline() { // Set up the input TextInputLayout textInputLayout = (TextInputLayout) getLayoutInflater().inflate(R.layout.my_text_input, null); TextInputEditText input = (TextInputEditText) textInputLayout.getEditText(); if (input != null) { AlertDialog.Builder builder = new AlertDialog.Builder(this) .setIcon(R.drawable.ic_security) .setTitle("Set camera name") .setMessage("If you want to go online, please set this camera's name.") .setView(textInputLayout) .setPositiveButton("OK", (dialogInterface, i) -> { cameraName = input.getText().toString(); signallingClient.setReference("/" + username + "/" + cameraName); onTryToStart(); signallingClient.attachReadListener(this, cameraName); showSnackBar("Camera name set", Snackbar.LENGTH_LONG); onlineButton.setText("Stop " + cameraName); onlineButton.setBackgroundColor(getResources().getColor(R.color.colorSecondary, getResources().newTheme())); localVideoView.setKeepScreenOn(true); }) .setNegativeButton("Cancel", (dialogInterface, i) -> dialogInterface.cancel()); AlertDialog dialog = builder.create(); dialog.setOnShowListener(dialog1 -> ((AlertDialog) dialog1).getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false)); // Enable Send button when there's text to send input.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { } @Override public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { if (charSequence.toString().trim().length() > 0) { (dialog).getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(true); } else { (dialog).getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false); } } @Override public void afterTextChanged(Editable editable) { } }); dialog.show(); } } /** * This method will be called directly by the app when it is the initiator and has got the local media * or when the remote peer sends a message through socket that it is ready to transmit AV data */ public void onTryToStart() { runOnUiThread(() -> { if (!isStarted && localVideoTrack != null) { createPeerConnection(); isStarted = true; doCall(); } }); } /** * Creating the local peerconnection instance */ private void createPeerConnection() { Log.d("onApiResponsecreatePeerConn", "IceServers\n" + peerIceServers.toString()); PeerConnection.RTCConfiguration rtcConfig = new PeerConnection.RTCConfiguration(peerIceServers); // TCP candidates are only useful when connecting to a server that supports // ICE-TCP. rtcConfig.tcpCandidatePolicy = PeerConnection.TcpCandidatePolicy.DISABLED; rtcConfig.bundlePolicy = PeerConnection.BundlePolicy.MAXBUNDLE; rtcConfig.rtcpMuxPolicy = PeerConnection.RtcpMuxPolicy.REQUIRE; rtcConfig.continualGatheringPolicy = PeerConnection.ContinualGatheringPolicy.GATHER_CONTINUALLY; // Use ECDSA encryption. rtcConfig.keyType = PeerConnection.KeyType.ECDSA; localPeer = peerConnectionFactory.createPeerConnection(rtcConfig, new CustomPeerConnectionObserver("localPeerCreation") { @Override public void onIceCandidate(IceCandidate iceCandidate) { super.onIceCandidate(iceCandidate); onIceCandidateReceived(iceCandidate); } }); addStreamToLocalPeer(); } /** * Adding the stream to the localpeer */ private void addStreamToLocalPeer() { //creating local mediastream MediaStream stream = peerConnectionFactory.createLocalMediaStream("102"); stream.addTrack(localAudioTrack); stream.addTrack(localVideoTrack); localPeer.addStream(stream); } /** * This method is called when the app is initiator - We generate the offer and send it over through socket * to remote peer */ private void doCall() { sdpConstraints = new MediaConstraints(); sdpConstraints.mandatory.add( new MediaConstraints.KeyValuePair("OfferToReceiveAudio", "true")); sdpConstraints.mandatory.add(new MediaConstraints.KeyValuePair( "OfferToReceiveVideo", "true")); localPeer.createOffer(new CustomSdpObserver("localCreateOffer") { @Override public void onCreateSuccess(SessionDescription sessionDescription) { super.onCreateSuccess(sessionDescription); localPeer.setLocalDescription(new CustomSdpObserver("localSetLocalDesc"), sessionDescription); Log.d("onCreateSuccess", "SignallingClient emit "); emitMessage(sessionDescription, cameraName); } }, sdpConstraints); } /** * Received local ice candidate. Send it to remote peer through signalling for negotiation */ public void onIceCandidateReceived(IceCandidate iceCandidate) { //we have received ice candidate. We can set it to the other peer. emitIceCandidate(iceCandidate, cameraName); } /** * Called when remote peer sends answer to your offer */ @Override public void onAnswerReceived(SDP data) { showSnackBar("Streamer added", Snackbar.LENGTH_LONG); localPeer.setRemoteDescription(new CustomSdpObserver("localSetRemote"), new SessionDescription(SessionDescription.Type.fromCanonicalForm(data.type.toLowerCase()), data.sdp)); } /** * Remote IceCandidate received */ @Override public void onIceCandidateReceived(SDP data) { localPeer.addIceCandidate(new IceCandidate(data.id, data.label, data.candidate)); } // Dummy @Override public void onOfferReceived(SDP data) { } /** * Pushing ice candidates to firebase. */ public void emitIceCandidate(IceCandidate iceCandidate, String username) { SDP object = new SDP(iceCandidate, username); signallingClient.push(object); } /** * Pushing the sesion description onto firebase. */ public void emitMessage(SessionDescription message, String username) { Log.d("CameraActivity", "emitMessage() called with: message = [" + message + "]"); SDP object = new SDP(message, username); signallingClient.push(object); } @Override public void disconnect(){ showSnackBar("Streamer Disconnected", Snackbar.LENGTH_LONG); hangup(); signallingClient.setReference("/" + username + "/" + cameraName); onTryToStart(); signallingClient.attachReadListener(this, cameraName); } /** * Closes all connection and disconnects deletes all the local and online presence created. */ private void hangup() { try { localPeer.close(); localPeer = null; isStarted = false; close(); } catch (Exception e) { e.printStackTrace(); } } /** * Detaching the read listener */ public void close() { signallingClient.detachReadListener(); signallingClient.deleteReference(); } @Override public boolean getisStarted(){ return isStarted; } /** * When this method is called: * if isRecording is true then recording will stop * else it will start recording */ public void controlRecording() { try { if (customVideoRecorder == null) { customVideoRecorder = new CustomVideoRecorder(); } if (isRecording) { // stop recording and release camera localVideoView.setKeepScreenOn(false); //getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); customVideoRecorder.stopRecording(1, getApplicationContext()); // inform the user that recording has stopped captureButton.setText("Record " + recordingQuality); captureButton.setBackgroundColor(getResources().getColor(R.color.colorPrimary, getResources().newTheme())); showSnackBar(file, Snackbar.LENGTH_LONG); isRecording = false; } else { localVideoView.setKeepScreenOn(true); getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); file = getOutputMediaFile(MEDIA_TYPE_VIDEO); if (file != null) { customVideoRecorder.startRecordingToFile(file.getPath(), 1, localVideoTrack, rootEglBase); } // inform the user that recording has started captureButton.setText(R.string.stop); captureButton.setBackgroundColor(getResources().getColor(R.color.colorSecondary, getResources().newTheme())); isRecording = true; } } catch (Exception e) { e.printStackTrace(); throw new RuntimeException( "Failed to open video file for output: ", e); } } public void turnScreenOff() { WindowManager.LayoutParams params = getWindow().getAttributes(); params.screenBrightness = .01f; getWindow().setAttributes(params); isScreenOn = false; screenOffButton.setBackgroundColor(getResources().getColor(R.color.colorSecondary, getResources().newTheme())); captureButton.setEnabled(false); onlineButton.setEnabled(false); } public void turnScreenOn() { WindowManager.LayoutParams params = getWindow().getAttributes(); params.screenBrightness = -1f; getWindow().setAttributes(params); screenOffButton.setBackgroundColor(getResources().getColor(R.color.colorPrimary, getResources().newTheme())); isScreenOn = true; screenOffButton.setText(R.string.dim_screen); captureButton.setEnabled(true); if (isChannelReady) { onlineButton.setEnabled(true); } } /** * Create a File for saving an image or video */ private static File getOutputMediaFile(@SuppressWarnings("SameParameterValue") int type) { // To be safe, you should check that the SDCard is // using Environment.getExternalStorageState() before doing this. // Create a media file name String timeStamp = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH).format(new Date()); File mediaStorageDir = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM), "Security Camera/" + timeStamp); // This location works best if you want the created images to be shared // between applications and persist after your app has been uninstalled. // Create the storage directory if it does not exist if (!mediaStorageDir.exists()) { if (!mediaStorageDir.mkdirs()) { Log.d("Security Camera", "failed to create directory"); return null; } } File mediaFile; timeStamp = new SimpleDateFormat("HH:mm:ss", Locale.ENGLISH).format(new Date()); if (type == MEDIA_TYPE_VIDEO) { mediaFile = new File(mediaStorageDir.getPath() + File.separator + "CAM_" + timeStamp + ".mp4"); } else { return null; } return mediaFile; } public void showSnackBar(String msg, int length) { Snackbar.make(buttonGroupLayout, msg, length) .setAnchorView(buttonGroupLayout) .setTextColor(getResources().getColor(R.color.colorOnPrimary, getResources().newTheme())) .setBackgroundTint(getResources().getColor(R.color.material_dark_grey, getResources().newTheme())) .show(); } public void showSnackBar(final File file, int length) { Snackbar.make(buttonGroupLayout, "Video saved. Path: " + file.getParent(), length) .setAnchorView(buttonGroupLayout) .setTextColor(getResources().getColor(R.color.colorOnPrimary, getResources().newTheme())) .setActionTextColor(getResources().getColor(R.color.colorSecondary, getResources().newTheme())) .setBackgroundTint(getResources().getColor(R.color.material_dark_grey, getResources().newTheme())) .setAction("View Video", v -> { // Respond to the click, such as by undoing the modification that caused // Create the text message with a string Uri selectedUri = FileProvider.getUriForFile(getApplicationContext(), getApplicationContext().getPackageName() + ".provider", file); Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(selectedUri, "video/mp4"); intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); if (intent.resolveActivityInfo(getPackageManager(), 0) != null) { startActivity(intent); } else { // if you reach this place, it means there is no any file // explorer app installed on your device showSnackBar("No application to view mp4 video.", Snackbar.LENGTH_LONG); } }) .show(); } private VideoCapturer createCameraCapturer(CameraEnumerator enumerator) { final String[] deviceNames = enumerator.getDeviceNames(); // First, try to find back facing camera Logging.d(TAG, "Looking for back facing cameras."); for (String deviceName : deviceNames) { if (enumerator.isBackFacing(deviceName)) { Logging.d(TAG, "Creating back facing camera capturer."); VideoCapturer videoCapturer = enumerator.createCapturer(deviceName, null); if (videoCapturer != null) { return videoCapturer; } } } return null; } }
30,211
0.636656
0.633279
737
39.991859
33.294334
182
false
false
0
0
0
0
0
0
0.621438
false
false
4
10563127b065b1defb41ef47aedb42660d84479f
17,995,912,984,517
70df11fc2cf8f0b60807265c0de01b7cbcc34280
/assert-except/src/main/java/com/pl/stu/validate/Assert.java
83ab47fedbc3c095660e2a3959d70c15c90eaed5
[]
no_license
pengls/dragon-demo
https://github.com/pengls/dragon-demo
ea8bdb7b2f84f67b290837bddef04bc5811528ff
9782e79b33a5eba341b68fafbb652a6cc05d3398
refs/heads/master
2022-06-11T18:02:36.363000
2020-05-02T01:55:23
2020-05-02T01:55:23
260,585,772
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.pl.stu.validate; import com.pl.stu.exception.BaseException; /** * @ClassName: Assert * @Description: validate something * @Author: pengl * @Date: 2020/5/1 22:29 * @Version V1.0 */ public interface Assert { BaseException ofException(Object... args); default void notNull(Object object, Object... args) { if (object == null) { throw ofException(args); } } default void notBlank(String str, Object... args) { if (StrUtils.isBlank(str)) { throw ofException(args); } } default void isAnyBlank(CharSequence... css){ if(StrUtils.isAnyBlank(css)){ throw ofException(); } } default void isTrue(boolean expression, Object... args) { if (!expression) { throw ofException(args); } } default void isFalse(boolean expression, Object... args) { if (expression) { throw ofException(args); } } }
UTF-8
Java
990
java
Assert.java
Java
[ { "context": "rt\n * @Description: validate something\n * @Author: pengl\n * @Date: 2020/5/1 22:29\n * @Version V1.0\n */\npub", "end": 153, "score": 0.9995914101600647, "start": 148, "tag": "USERNAME", "value": "pengl" } ]
null
[]
package com.pl.stu.validate; import com.pl.stu.exception.BaseException; /** * @ClassName: Assert * @Description: validate something * @Author: pengl * @Date: 2020/5/1 22:29 * @Version V1.0 */ public interface Assert { BaseException ofException(Object... args); default void notNull(Object object, Object... args) { if (object == null) { throw ofException(args); } } default void notBlank(String str, Object... args) { if (StrUtils.isBlank(str)) { throw ofException(args); } } default void isAnyBlank(CharSequence... css){ if(StrUtils.isAnyBlank(css)){ throw ofException(); } } default void isTrue(boolean expression, Object... args) { if (!expression) { throw ofException(args); } } default void isFalse(boolean expression, Object... args) { if (expression) { throw ofException(args); } } }
990
0.575758
0.563636
45
21
18.915014
62
false
false
0
0
0
0
0
0
0.266667
false
false
4
78ba3cb596c3b9ed3bc76eae81ad3b5b340f757e
24,567,212,963,148
c3247e01bbaf2354bf38670e68313d8d6734de91
/Cards/MonsterCards/Wizard.java
0af4e518e127e605a6708e479768b34b0b743c46
[]
no_license
stephangerve/computing-2-final-project
https://github.com/stephangerve/computing-2-final-project
3dca9c7e7527526db1c4feaf09166eafd1c7192b
f5de9c16a2a584485de5743c7d79d317a4d1bbbc
refs/heads/master
2023-01-02T04:21:16.855000
2020-10-27T20:28:22
2020-10-27T20:28:22
300,916,010
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
//Wizard.java package Cards.MonsterCards; import CardProperties.*; import GameProperties.*; import java.util.*; public class Wizard extends Monster{ public Wizard(){ super("Wizard", "Gold", "Dark", 19, 18, 50, 7); cost.setGoldCoins(1); cost.setSilverCoins(0); cost.setBronzeCoins(0); cost.setFireMana(0); cost.setWaterMana(0); cost.setEarthMana(0); cost.setDarkMana(0); cost.setLightMana(0); cost.setAnyMana(3); value.setGoldCoins(0); value.setSilverCoins(0); value.setBronzeCoins(0); value.setFireMana(1); value.setWaterMana(1); value.setEarthMana(1); value.setDarkMana(1); value.setLightMana(1); value.setAnyMana(1); setAbilityName("Magic Potion"); setAbilityDesc("Add 3 mana of any element to bank."); } }
UTF-8
Java
765
java
Wizard.java
Java
[]
null
[]
//Wizard.java package Cards.MonsterCards; import CardProperties.*; import GameProperties.*; import java.util.*; public class Wizard extends Monster{ public Wizard(){ super("Wizard", "Gold", "Dark", 19, 18, 50, 7); cost.setGoldCoins(1); cost.setSilverCoins(0); cost.setBronzeCoins(0); cost.setFireMana(0); cost.setWaterMana(0); cost.setEarthMana(0); cost.setDarkMana(0); cost.setLightMana(0); cost.setAnyMana(3); value.setGoldCoins(0); value.setSilverCoins(0); value.setBronzeCoins(0); value.setFireMana(1); value.setWaterMana(1); value.setEarthMana(1); value.setDarkMana(1); value.setLightMana(1); value.setAnyMana(1); setAbilityName("Magic Potion"); setAbilityDesc("Add 3 mana of any element to bank."); } }
765
0.701961
0.667974
38
19.131578
13.262871
55
false
false
0
0
0
0
0
0
2.078947
false
false
4
4db0e11596f916a2811297d2f94e6135362ba563
18,786,186,992,173
4d910669377cd9e38c9eabae870655e433679118
/Application1/src/main/java/session/ISerializer.java
777d1823d74492a0e595f564867465dfeae0334e
[]
no_license
tasharnvb/learning_java
https://github.com/tasharnvb/learning_java
a0876d6ed39580061e2f994fbb24f6ef90fdc371
24f0dcd694ee527e94c4ccf43745080549bb29ee
refs/heads/master
2020-03-28T02:02:26.386000
2016-08-10T16:03:41
2016-08-10T16:03:41
64,771,324
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package session; import entity.Film; import java.util.HashMap; import java.util.concurrent.ConcurrentHashMap; /** * Created by Academy07 on 08/08/2016. */ public interface ISerializer { void serialize(ConcurrentHashMap<Long, Film> map); <T> T deserialize(); }
UTF-8
Java
274
java
ISerializer.java
Java
[ { "context": "l.concurrent.ConcurrentHashMap;\n\n/**\n * Created by Academy07 on 08/08/2016.\n */\npublic interface ISerializer {", "end": 140, "score": 0.9993265271186829, "start": 131, "tag": "USERNAME", "value": "Academy07" } ]
null
[]
package session; import entity.Film; import java.util.HashMap; import java.util.concurrent.ConcurrentHashMap; /** * Created by Academy07 on 08/08/2016. */ public interface ISerializer { void serialize(ConcurrentHashMap<Long, Film> map); <T> T deserialize(); }
274
0.729927
0.693431
15
17.266666
17.778139
54
false
false
0
0
0
0
0
0
0.466667
false
false
4
c417447e040fea4ec36616d582d9c00bad2593ce
8,040,178,801,827
a3384caa6f8e246de228ccd4c157ac7e65c4cdb2
/Salao/src/core/persistence/ServicoDAO.java
5f31b13f0547ab02b53fdd11a0da487412d763df
[ "Apache-2.0" ]
permissive
manzoli2122/salao
https://github.com/manzoli2122/salao
1d2a1d64983eb815c773d1650fcaf635060464f5
cddda1162be1abf7b53e321151c2032ad9f1854e
refs/heads/master
2016-09-05T09:44:42.670000
2015-06-28T11:32:19
2015-06-28T11:32:19
35,246,318
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package core.persistence; import java.util.List; import javax.ejb.Local; import core.domain.Servico; import br.ufes.inf.nemo.util.ejb3.persistence.BaseDAO; @Local public interface ServicoDAO extends BaseDAO<Servico>{ List<Servico> findByName(String param); }
UTF-8
Java
267
java
ServicoDAO.java
Java
[]
null
[]
package core.persistence; import java.util.List; import javax.ejb.Local; import core.domain.Servico; import br.ufes.inf.nemo.util.ejb3.persistence.BaseDAO; @Local public interface ServicoDAO extends BaseDAO<Servico>{ List<Servico> findByName(String param); }
267
0.786517
0.782772
16
15.6875
19.025373
54
false
false
0
0
0
0
0
0
0.4375
false
false
4
a2e6094bb8159ccdf8c200942a517cc5879d0a99
8,040,178,801,210
14c8213abe7223fe64ff89a47f70b0396e623933
/com/google/cloud/storage/Acl$Project$ProjectRole.java
c112bf54f1c5a4fa5d13d3b79541613cb05f579d
[ "MIT" ]
permissive
PolitePeoplePlan/backdoored
https://github.com/PolitePeoplePlan/backdoored
c804327a0c2ac5fe3fbfff272ca5afcb97c36e53
3928ac16a21662e4f044db9f054d509222a8400e
refs/heads/main
2023-05-31T04:19:55.497000
2021-06-23T15:20:03
2021-06-23T15:20:03
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.google.cloud.storage; import com.google.api.core.*; import com.google.cloud.*; public static final class ProjectRole extends StringEnumValue { private static final long serialVersionUID = -8360324311187914382L; private static final ApiFunction<String, ProjectRole> CONSTRUCTOR; private static final StringEnumType<ProjectRole> type; public static final ProjectRole OWNERS; public static final ProjectRole EDITORS; public static final ProjectRole VIEWERS; private ProjectRole(final String a1) { super(a1); } public static ProjectRole valueOfStrict(final String a1) { return (ProjectRole)ProjectRole.type.valueOfStrict(a1); } public static ProjectRole valueOf(final String a1) { return (ProjectRole)ProjectRole.type.valueOf(a1); } public static ProjectRole[] values() { return (ProjectRole[])ProjectRole.type.values(); } ProjectRole(final String a1, final Acl$1 a2) { this(a1); } static { CONSTRUCTOR = (ApiFunction)new ApiFunction<String, ProjectRole>() { Acl$Project$ProjectRole$1() { super(); } public ProjectRole apply(final String a1) { return new ProjectRole(a1); } public /* bridge */ Object apply(final Object o) { return this.apply((String)o); } }; type = new StringEnumType((Class)ProjectRole.class, (ApiFunction)ProjectRole.CONSTRUCTOR); OWNERS = (ProjectRole)ProjectRole.type.createAndRegister("OWNERS"); EDITORS = (ProjectRole)ProjectRole.type.createAndRegister("EDITORS"); VIEWERS = (ProjectRole)ProjectRole.type.createAndRegister("VIEWERS"); } }
UTF-8
Java
1,809
java
Acl$Project$ProjectRole.java
Java
[]
null
[]
package com.google.cloud.storage; import com.google.api.core.*; import com.google.cloud.*; public static final class ProjectRole extends StringEnumValue { private static final long serialVersionUID = -8360324311187914382L; private static final ApiFunction<String, ProjectRole> CONSTRUCTOR; private static final StringEnumType<ProjectRole> type; public static final ProjectRole OWNERS; public static final ProjectRole EDITORS; public static final ProjectRole VIEWERS; private ProjectRole(final String a1) { super(a1); } public static ProjectRole valueOfStrict(final String a1) { return (ProjectRole)ProjectRole.type.valueOfStrict(a1); } public static ProjectRole valueOf(final String a1) { return (ProjectRole)ProjectRole.type.valueOf(a1); } public static ProjectRole[] values() { return (ProjectRole[])ProjectRole.type.values(); } ProjectRole(final String a1, final Acl$1 a2) { this(a1); } static { CONSTRUCTOR = (ApiFunction)new ApiFunction<String, ProjectRole>() { Acl$Project$ProjectRole$1() { super(); } public ProjectRole apply(final String a1) { return new ProjectRole(a1); } public /* bridge */ Object apply(final Object o) { return this.apply((String)o); } }; type = new StringEnumType((Class)ProjectRole.class, (ApiFunction)ProjectRole.CONSTRUCTOR); OWNERS = (ProjectRole)ProjectRole.type.createAndRegister("OWNERS"); EDITORS = (ProjectRole)ProjectRole.type.createAndRegister("EDITORS"); VIEWERS = (ProjectRole)ProjectRole.type.createAndRegister("VIEWERS"); } }
1,809
0.641791
0.624102
54
32.5
26.973753
98
false
false
0
0
0
0
0
0
0.481481
false
false
4
f2fa05d59ecfc4cfc4c883403cc2c61f4990530c
27,857,157,909,741
e4648b5da102dd00ab9b87a55d96747434de93e8
/app/src/main/java/com/vikas/tests/webservices_test/Adapter/ChatAdapter.java
9af316bc850403a5739377a0a26a64e5d2e8fd40
[ "Apache-2.0" ]
permissive
ervikaspec/webservices_test
https://github.com/ervikaspec/webservices_test
b3a797143b90fb8da71f0c30468821bb87e9bbd1
f37e2e35ab5c6b8cce64e5e7bfc16952768767ab
refs/heads/master
2017-11-30T19:36:06.649000
2016-05-29T13:10:41
2016-05-29T13:10:41
59,942,874
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.vikas.tests.webservices_test.Adapter; import android.support.v7.widget.RecyclerView; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.TextView; import com.bumptech.glide.Glide; import com.vikas.tests.webservices_test.CustomApplication; import com.vikas.tests.webservices_test.Lib.Cache.DataSingleton; import com.vikas.tests.webservices_test.Lib.EventBus.DataFetchedEvent; import com.vikas.tests.webservices_test.Lib.EventBus.EventBus; import com.vikas.tests.webservices_test.Lib.Util.TimeUtil; import com.vikas.tests.webservices_test.Model.Chat; import com.vikas.tests.webservices_test.R; import java.util.ArrayList; import java.util.List; /** * Created by vikasmalhotra on 5/29/16. */ public class ChatAdapter extends RecyclerView.Adapter<ChatAdapter.ViewHolder> { List<Chat> data; public ChatAdapter() { super.setHasStableIds(true); this.data = new ArrayList(); } public void setData(List<Chat> data) { this.data = data; this.notifyDataSetChanged(); } @Override public ViewHolder onCreateViewHolder(ViewGroup group, int type) { ViewHolder element; RelativeLayout view = (RelativeLayout) LayoutInflater.from(group.getContext()).inflate(R.layout.list_item_view_chat, group, false); element = new ViewHolder(view); return element; } @Override public int getItemCount() { return data.size(); } @Override public void onBindViewHolder(ViewHolder holder, int position) { final Chat chat = data.get(position); holder.text.setText(chat.body); holder.name.setText(chat.name); holder.username.setText(chat.username); holder.time.setText(TimeUtil.formatDate(chat.time)); int favIcon = R.drawable.test_icon_favourite_unset; List<String> list = DataSingleton.getInstance().userFavouriteStats.get(chat.username); if (list != null && list.contains(chat.body)) favIcon = R.drawable.test_icon_favourite_set; holder.favourite.setImageResource(favIcon); holder.favourite.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { DataSingleton.getInstance().setUserFavStats(chat.username, chat.body); notifyDataSetChanged(); EventBus.getInstance().post(new DataFetchedEvent()); } }); holder.time.setSelected(true); if (!TextUtils.isEmpty(chat.avatarUrl)) { Glide.with(CustomApplication.getContext()) .load(chat.avatarUrl) .centerCrop() .placeholder(R.drawable.test_icon_default_user_avatar) .error(R.drawable.test_icon_default_user_avatar) .crossFade() .into(holder.avatar); } else { holder.avatar.setImageResource(R.drawable.test_icon_default_user_avatar); } } @Override public long getItemId(int position) { return position; } class ViewHolder extends RecyclerView.ViewHolder { ImageView favourite, avatar; TextView text, name, username, time; public ViewHolder(RelativeLayout itemView) { super(itemView); this.favourite = (ImageView) itemView.findViewById(R.id.favourite); this.avatar = (ImageView) itemView.findViewById(R.id.avatar); this.text = (TextView) itemView.findViewById(R.id.text); this.name = (TextView) itemView.findViewById(R.id.name); this.username = (TextView) itemView.findViewById(R.id.username); this.time = (TextView) itemView.findViewById(R.id.time); } } }
UTF-8
Java
3,918
java
ChatAdapter.java
Java
[ { "context": "rayList;\nimport java.util.List;\n\n/**\n * Created by vikasmalhotra on 5/29/16.\n */\npublic class ChatAdapter extends ", "end": 855, "score": 0.9996759295463562, "start": 842, "tag": "USERNAME", "value": "vikasmalhotra" } ]
null
[]
package com.vikas.tests.webservices_test.Adapter; import android.support.v7.widget.RecyclerView; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.TextView; import com.bumptech.glide.Glide; import com.vikas.tests.webservices_test.CustomApplication; import com.vikas.tests.webservices_test.Lib.Cache.DataSingleton; import com.vikas.tests.webservices_test.Lib.EventBus.DataFetchedEvent; import com.vikas.tests.webservices_test.Lib.EventBus.EventBus; import com.vikas.tests.webservices_test.Lib.Util.TimeUtil; import com.vikas.tests.webservices_test.Model.Chat; import com.vikas.tests.webservices_test.R; import java.util.ArrayList; import java.util.List; /** * Created by vikasmalhotra on 5/29/16. */ public class ChatAdapter extends RecyclerView.Adapter<ChatAdapter.ViewHolder> { List<Chat> data; public ChatAdapter() { super.setHasStableIds(true); this.data = new ArrayList(); } public void setData(List<Chat> data) { this.data = data; this.notifyDataSetChanged(); } @Override public ViewHolder onCreateViewHolder(ViewGroup group, int type) { ViewHolder element; RelativeLayout view = (RelativeLayout) LayoutInflater.from(group.getContext()).inflate(R.layout.list_item_view_chat, group, false); element = new ViewHolder(view); return element; } @Override public int getItemCount() { return data.size(); } @Override public void onBindViewHolder(ViewHolder holder, int position) { final Chat chat = data.get(position); holder.text.setText(chat.body); holder.name.setText(chat.name); holder.username.setText(chat.username); holder.time.setText(TimeUtil.formatDate(chat.time)); int favIcon = R.drawable.test_icon_favourite_unset; List<String> list = DataSingleton.getInstance().userFavouriteStats.get(chat.username); if (list != null && list.contains(chat.body)) favIcon = R.drawable.test_icon_favourite_set; holder.favourite.setImageResource(favIcon); holder.favourite.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { DataSingleton.getInstance().setUserFavStats(chat.username, chat.body); notifyDataSetChanged(); EventBus.getInstance().post(new DataFetchedEvent()); } }); holder.time.setSelected(true); if (!TextUtils.isEmpty(chat.avatarUrl)) { Glide.with(CustomApplication.getContext()) .load(chat.avatarUrl) .centerCrop() .placeholder(R.drawable.test_icon_default_user_avatar) .error(R.drawable.test_icon_default_user_avatar) .crossFade() .into(holder.avatar); } else { holder.avatar.setImageResource(R.drawable.test_icon_default_user_avatar); } } @Override public long getItemId(int position) { return position; } class ViewHolder extends RecyclerView.ViewHolder { ImageView favourite, avatar; TextView text, name, username, time; public ViewHolder(RelativeLayout itemView) { super(itemView); this.favourite = (ImageView) itemView.findViewById(R.id.favourite); this.avatar = (ImageView) itemView.findViewById(R.id.avatar); this.text = (TextView) itemView.findViewById(R.id.text); this.name = (TextView) itemView.findViewById(R.id.name); this.username = (TextView) itemView.findViewById(R.id.username); this.time = (TextView) itemView.findViewById(R.id.time); } } }
3,918
0.664114
0.662583
107
35.616821
26.836174
139
false
false
0
0
0
0
0
0
0.598131
false
false
4
4f3b2a43398e0ac96768bbcc188704e03c17f8f9
12,386,685,718,684
5748d8e5ab80776e6f565f0dd1f5029d4af5b65e
/codeforces/205/B.java
d5d203a8a825f06667463756eda7f0e9d1a3580c
[]
no_license
lokiysh/cp
https://github.com/lokiysh/cp
f50394a98eec42aa4e9ae997aa4852253fff012f
99cbf19c9db16f51de5a68a8c4989f5de36678c8
refs/heads/master
2023-02-10T21:18:51.987000
2011-07-22T13:04:00
2021-01-11T02:39:17
328,587,177
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
import java.util.Scanner; import java.io.OutputStream; import java.io.IOException; import java.io.PrintWriter; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at the top * @author Lokesh Khandelwal aka (codeKNIGHT | phantom11) */ public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; Scanner in = new Scanner(inputStream); PrintWriter out = new PrintWriter(outputStream); TaskB solver = new TaskB(); solver.solve(1, in, out); out.close(); } } class TaskB { public void solve(int testNumber, Scanner in, PrintWriter out) { int n=in.nextInt(); int i,a[]=new int[n]; for(i=0;i<n;i++) a[i]=in.nextInt(); long min=a[0],last=a[0],comp=a[0],max=a[0]; long c=0; i=1; while (i<n) { boolean status=false; if(a[i]>=last) { last=a[i]; comp=a[i]; i++; continue; } min=Integer.MAX_VALUE; while (i<n&&a[i]<last) { if(a[i]<min) min=a[i]; last=a[i]; i++; status=true; } if(status) c+=comp-min; if(i<n) { comp=a[i]; last=a[i]; } i++; } out.println(c); } }
UTF-8
Java
1,521
java
B.java
Java
[ { "context": "lug-in\n * Actual solution is at the top\n * @author Lokesh Khandelwal aka (codeKNIGHT | phantom11)\n */\npublic class Mai", "end": 236, "score": 0.9998940229415894, "start": 219, "tag": "NAME", "value": "Lokesh Khandelwal" }, { "context": " at the top\n * @author Lokesh Khandelwal aka (codeKNIGHT | phantom11)\n */\npublic class Main {\n\tpublic stat", "end": 252, "score": 0.6056673526763916, "start": 246, "tag": "USERNAME", "value": "KNIGHT" }, { "context": "top\n * @author Lokesh Khandelwal aka (codeKNIGHT | phantom11)\n */\npublic class Main {\n\tpublic static void main", "end": 264, "score": 0.7594302296638489, "start": 255, "tag": "USERNAME", "value": "phantom11" } ]
null
[]
import java.util.Scanner; import java.io.OutputStream; import java.io.IOException; import java.io.PrintWriter; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at the top * @author <NAME> aka (codeKNIGHT | phantom11) */ public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; Scanner in = new Scanner(inputStream); PrintWriter out = new PrintWriter(outputStream); TaskB solver = new TaskB(); solver.solve(1, in, out); out.close(); } } class TaskB { public void solve(int testNumber, Scanner in, PrintWriter out) { int n=in.nextInt(); int i,a[]=new int[n]; for(i=0;i<n;i++) a[i]=in.nextInt(); long min=a[0],last=a[0],comp=a[0],max=a[0]; long c=0; i=1; while (i<n) { boolean status=false; if(a[i]>=last) { last=a[i]; comp=a[i]; i++; continue; } min=Integer.MAX_VALUE; while (i<n&&a[i]<last) { if(a[i]<min) min=a[i]; last=a[i]; i++; status=true; } if(status) c+=comp-min; if(i<n) { comp=a[i]; last=a[i]; } i++; } out.println(c); } }
1,510
0.476003
0.469428
64
22.75
13.72953
65
false
false
0
0
0
0
0
0
0.96875
false
false
4
b23623928a50b299f25f6b582321ccba9bdfa741
22,144,851,406,307
f7a66b91dabe72194405dce14878f0983075256b
/src/main/java/over2craft/taxes/configuration/GlobalConfig.java
4023131e82524bc676214e1288065b8910397e87
[]
no_license
magrigry/Over2Taxes
https://github.com/magrigry/Over2Taxes
629e7fad6adc24cd21c9e0be57d3ac2621b640cc
dfad9e1017e19644f449fffc26ec38c3cc7e13f2
refs/heads/main
2023-03-03T20:08:59.965000
2021-02-15T12:56:09
2021-02-15T12:56:09
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package over2craft.taxes.configuration; import over2craft.taxes.Taxes; import java.util.List; public class GlobalConfig { public static List<String> getOfflineCommands() { return Taxes.plugin.getConfig().getStringList("taxes.notify.send-essentials-mail-if-offline"); } public static List<String> getOnlineMessages() { return Taxes.plugin.getConfig().getStringList("taxes.notify.send-message-if-online"); } }
UTF-8
Java
447
java
GlobalConfig.java
Java
[]
null
[]
package over2craft.taxes.configuration; import over2craft.taxes.Taxes; import java.util.List; public class GlobalConfig { public static List<String> getOfflineCommands() { return Taxes.plugin.getConfig().getStringList("taxes.notify.send-essentials-mail-if-offline"); } public static List<String> getOnlineMessages() { return Taxes.plugin.getConfig().getStringList("taxes.notify.send-message-if-online"); } }
447
0.731544
0.727069
18
23.833334
31.646046
102
false
false
0
0
0
0
0
0
0.277778
false
false
4
1956fea58382c23f89ad35d47b87b8c3d272b7fc
22,144,851,403,586
fbbdb636b6c7023548b1768cb7c0c68494fbd367
/src/main/java/com/somnus/pay/payment/service/PaymentOrderService.java
11f8aa5306ea9dbb7c1573badda8c8f29c22ec27
[]
no_license
lmtoo/pay
https://github.com/lmtoo/pay
40b6b76c45f3ee8353492bfb00b2fb83ff0bf76c
a958ee95101e16fd1e435c7f46bc36c044dcc9b9
refs/heads/master
2021-01-24T23:24:37.472000
2016-07-09T11:13:55
2016-07-09T11:13:55
62,949,961
1
0
null
true
2016-07-09T13:06:57
2016-07-09T13:06:55
2016-07-09T13:06:57
2016-07-09T11:13:42
797
0
0
0
Java
null
null
package com.somnus.pay.payment.service; import com.somnus.pay.payment.pojo.*; import java.util.Map; /** *  @description: <br/> *  @author: 丹青生<br/> *  @version: 1.0<br/> *  @createdate: 2015-12-30<br/> *  Modification  History:<br/> *  Date         Author        Version        Discription<br/> *  -----------------------------------------------------<br/> *  2015-12-30       丹青生                        1.0            初始化 <br/> *   */ public interface PaymentOrderService { public PaymentOrder get(String orderId, int source); public PaymentOrder get(String orderId); public PaymentResult convert(PaymentOrder paymentOrder); /** * 分页查询所有支付通知 * @param page * @return */ public QueryResult<PaymentOrder> list(Page page,Map<String,Object> params); public PaymentOrder get(String orderId, String userId); }
UTF-8
Java
922
java
PaymentOrderService.java
Java
[ { "context": "il.Map;\n\n/**\n *  @description: <br/>\n *  @author: 丹青生<br/>\n *  @version: 1.0<br/>\n *  @createdate: 2015", "end": 147, "score": 0.9955397844314575, "start": 144, "tag": "NAME", "value": "丹青生" }, { "context": "-----------------------<br/>\n *  2015-12-30       丹青生                        1.0            初始化 <br/>\n ", "end": 391, "score": 0.7198759317398071, "start": 388, "tag": "NAME", "value": "丹青生" } ]
null
[]
package com.somnus.pay.payment.service; import com.somnus.pay.payment.pojo.*; import java.util.Map; /** *  @description: <br/> *  @author: 丹青生<br/> *  @version: 1.0<br/> *  @createdate: 2015-12-30<br/> *  Modification  History:<br/> *  Date         Author        Version        Discription<br/> *  -----------------------------------------------------<br/> *  2015-12-30       丹青生                        1.0            初始化 <br/> *   */ public interface PaymentOrderService { public PaymentOrder get(String orderId, int source); public PaymentOrder get(String orderId); public PaymentResult convert(PaymentOrder paymentOrder); /** * 分页查询所有支付通知 * @param page * @return */ public QueryResult<PaymentOrder> list(Page page,Map<String,Object> params); public PaymentOrder get(String orderId, String userId); }
922
0.593341
0.56956
35
23.028572
23.778124
76
false
false
0
0
0
0
0
0
0.742857
false
false
4
831b0b6fc815e8a5ce954f0cddf21edd5f298d87
19,250,043,465,382
f0d42d6ad9ec4350e30339d402aac969327671a8
/src/main/java/pms/com/service/EffortServiceImplement.java
68cfcc1fa6fe85a02af48bc91eb88cd49e40f575
[]
no_license
datlp0905/pms
https://github.com/datlp0905/pms
2543da658f9e0f807604244b588f859785cd8b44
7e78fcacc4ee88f2645508ab41dacf69b767fcc4
refs/heads/master
2020-05-27T14:19:37.711000
2019-05-26T08:27:09
2019-05-26T08:27:09
188,657,612
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package pms.com.service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import pms.com.entities.Effort; import pms.com.repository.EffortRepository; import pms.com.repository.EmployeeRepository; import java.util.List; import java.util.Optional; @Service public class EffortServiceImplement implements EffortService { @Autowired private EffortRepository effortRepository; @Override public List<Effort> getAll() { return effortRepository.findAll(); } @Override public Effort findById(int id) { Optional<Effort> effort = effortRepository.findById(id); if(effort.isPresent()) { return effort.get(); } return null; } @Override public Effort create(Effort e) { return effortRepository.save(e); } @Override public Effort approve(int id, Effort e) { Optional<Effort> effort = effortRepository.findById(id); if(effort.isPresent()) { effortRepository.save(e); } return null; } }
UTF-8
Java
1,098
java
EffortServiceImplement.java
Java
[]
null
[]
package pms.com.service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import pms.com.entities.Effort; import pms.com.repository.EffortRepository; import pms.com.repository.EmployeeRepository; import java.util.List; import java.util.Optional; @Service public class EffortServiceImplement implements EffortService { @Autowired private EffortRepository effortRepository; @Override public List<Effort> getAll() { return effortRepository.findAll(); } @Override public Effort findById(int id) { Optional<Effort> effort = effortRepository.findById(id); if(effort.isPresent()) { return effort.get(); } return null; } @Override public Effort create(Effort e) { return effortRepository.save(e); } @Override public Effort approve(int id, Effort e) { Optional<Effort> effort = effortRepository.findById(id); if(effort.isPresent()) { effortRepository.save(e); } return null; } }
1,098
0.677596
0.677596
44
23.954546
19.663019
64
false
false
0
0
0
0
0
0
0.409091
false
false
4
872601b564e68e1696dfa555ea50b9065a7efe56
26,783,416,107,389
3ebaee3a565d5e514e5d56b44ebcee249ec1c243
/assetBank 3.77 decomplied fixed/src/java/com/bright/assetbank/entity/action/DeleteAssetEntityAction.java
53d451e8f8c684084fd53949a8c21eb3a5c28004
[]
no_license
webchannel-dev/Java-Digital-Bank
https://github.com/webchannel-dev/Java-Digital-Bank
89032eec70a1ef61eccbef6f775b683087bccd63
65d4de8f2c0ce48cb1d53130e295616772829679
refs/heads/master
2021-10-08T19:10:48.971000
2017-11-07T09:51:17
2017-11-07T09:51:17
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* */ package com.bright.assetbank.entity.action; /* */ /* */ import com.bn2web.common.exception.Bn2Exception; /* */ import com.bright.assetbank.entity.exception.EntityHasAssetsException; /* */ import com.bright.assetbank.entity.exception.EntityHasRelationshipException; /* */ import com.bright.assetbank.entity.form.AssetEntityForm; /* */ import com.bright.assetbank.entity.service.AssetEntityManager; /* */ import com.bright.assetbank.user.bean.ABUserProfile; /* */ import com.bright.framework.database.bean.DBTransaction; /* */ import com.bright.framework.simplelist.bean.ListItem; /* */ import com.bright.framework.simplelist.service.ListManager; /* */ import com.bright.framework.user.bean.UserProfile; /* */ import javax.servlet.http.HttpServletRequest; /* */ import javax.servlet.http.HttpServletResponse; /* */ import org.apache.commons.logging.Log; /* */ import org.apache.struts.action.ActionForm; /* */ import org.apache.struts.action.ActionForward; /* */ import org.apache.struts.action.ActionMapping; /* */ /* */ public class DeleteAssetEntityAction extends AssetEntityAction /* */ { /* 46 */ protected ListManager m_listManager = null; /* */ /* */ public ActionForward execute(ActionMapping a_mapping, ActionForm a_form, HttpServletRequest a_request, HttpServletResponse a_response, DBTransaction a_dbTransaction) /* */ throws Bn2Exception /* */ { /* 66 */ long lId = getLongParameter(a_request, "id"); /* 67 */ ABUserProfile userProfile = (ABUserProfile)UserProfile.getUserProfile(a_request.getSession()); /* 68 */ AssetEntityForm form = (AssetEntityForm)a_form; /* */ /* 71 */ if ((!userProfile.getIsAdmin()) && (!userProfile.getIsOrgUnitAdmin())) /* */ { /* 73 */ this.m_logger.error("DeleteAssetEntityAction.execute : User must be an administrator."); /* 74 */ return a_mapping.findForward("NoPermission"); /* */ } /* */ /* */ try /* */ { /* 80 */ getAssetEntityManager().deleteEntity(a_dbTransaction, lId); /* */ } /* */ catch (EntityHasAssetsException e) /* */ { /* 84 */ form.addError(this.m_listManager.getListItem(a_dbTransaction, "cannotDeleteAssetEntity", userProfile.getCurrentLanguage()).getBody()); /* 85 */ a_dbTransaction.rollback2(); /* 86 */ return a_mapping.findForward("Failure"); /* */ } /* */ catch (EntityHasRelationshipException e) /* */ { /* 90 */ form.addError(this.m_listManager.getListItem(a_dbTransaction, "assetEntityHasRelationships", userProfile.getCurrentLanguage()).getBody()); /* 91 */ a_dbTransaction.rollback2(); /* 92 */ return a_mapping.findForward("Failure"); /* */ } /* */ /* 95 */ return a_mapping.findForward("Success"); /* */ } /* */ /* */ public void setListManager(ListManager listManager) /* */ { /* 100 */ this.m_listManager = listManager; /* */ } /* */ } /* Location: C:\Users\mamatha\Desktop\com.zip * Qualified Name: com.bright.assetbank.entity.action.DeleteAssetEntityAction * JD-Core Version: 0.6.0 */
UTF-8
Java
3,231
java
DeleteAssetEntityAction.java
Java
[ { "context": " }\n/* */ }\n\n/* Location: C:\\Users\\mamatha\\Desktop\\com.zip\n * Qualified Name: com.br", "end": 3096, "score": 0.5800701379776001, "start": 3093, "tag": "USERNAME", "value": "mam" } ]
null
[]
/* */ package com.bright.assetbank.entity.action; /* */ /* */ import com.bn2web.common.exception.Bn2Exception; /* */ import com.bright.assetbank.entity.exception.EntityHasAssetsException; /* */ import com.bright.assetbank.entity.exception.EntityHasRelationshipException; /* */ import com.bright.assetbank.entity.form.AssetEntityForm; /* */ import com.bright.assetbank.entity.service.AssetEntityManager; /* */ import com.bright.assetbank.user.bean.ABUserProfile; /* */ import com.bright.framework.database.bean.DBTransaction; /* */ import com.bright.framework.simplelist.bean.ListItem; /* */ import com.bright.framework.simplelist.service.ListManager; /* */ import com.bright.framework.user.bean.UserProfile; /* */ import javax.servlet.http.HttpServletRequest; /* */ import javax.servlet.http.HttpServletResponse; /* */ import org.apache.commons.logging.Log; /* */ import org.apache.struts.action.ActionForm; /* */ import org.apache.struts.action.ActionForward; /* */ import org.apache.struts.action.ActionMapping; /* */ /* */ public class DeleteAssetEntityAction extends AssetEntityAction /* */ { /* 46 */ protected ListManager m_listManager = null; /* */ /* */ public ActionForward execute(ActionMapping a_mapping, ActionForm a_form, HttpServletRequest a_request, HttpServletResponse a_response, DBTransaction a_dbTransaction) /* */ throws Bn2Exception /* */ { /* 66 */ long lId = getLongParameter(a_request, "id"); /* 67 */ ABUserProfile userProfile = (ABUserProfile)UserProfile.getUserProfile(a_request.getSession()); /* 68 */ AssetEntityForm form = (AssetEntityForm)a_form; /* */ /* 71 */ if ((!userProfile.getIsAdmin()) && (!userProfile.getIsOrgUnitAdmin())) /* */ { /* 73 */ this.m_logger.error("DeleteAssetEntityAction.execute : User must be an administrator."); /* 74 */ return a_mapping.findForward("NoPermission"); /* */ } /* */ /* */ try /* */ { /* 80 */ getAssetEntityManager().deleteEntity(a_dbTransaction, lId); /* */ } /* */ catch (EntityHasAssetsException e) /* */ { /* 84 */ form.addError(this.m_listManager.getListItem(a_dbTransaction, "cannotDeleteAssetEntity", userProfile.getCurrentLanguage()).getBody()); /* 85 */ a_dbTransaction.rollback2(); /* 86 */ return a_mapping.findForward("Failure"); /* */ } /* */ catch (EntityHasRelationshipException e) /* */ { /* 90 */ form.addError(this.m_listManager.getListItem(a_dbTransaction, "assetEntityHasRelationships", userProfile.getCurrentLanguage()).getBody()); /* 91 */ a_dbTransaction.rollback2(); /* 92 */ return a_mapping.findForward("Failure"); /* */ } /* */ /* 95 */ return a_mapping.findForward("Success"); /* */ } /* */ /* */ public void setListManager(ListManager listManager) /* */ { /* 100 */ this.m_listManager = listManager; /* */ } /* */ } /* Location: C:\Users\mamatha\Desktop\com.zip * Qualified Name: com.bright.assetbank.entity.action.DeleteAssetEntityAction * JD-Core Version: 0.6.0 */
3,231
0.636645
0.623955
66
47.969696
36.345135
177
false
false
0
0
0
0
0
0
0.636364
false
false
4
b4c9c509c23365c7369ee6f8ece298d773507893
7,653,631,776,419
a0fe5851834cd39a326f5a2ba7229cbd6abfd324
/src/main/java/com/prateek/mediaoceanquestion/MediaOceanQuestion.java
d0abb9475590209977ddb52ba77230559f421bb6
[]
no_license
spunkprs/workspace
https://github.com/spunkprs/workspace
5649dc05472ea0d3717d184b6ddf1835026cac32
d39578da9f8ec5cfc1437d1217e27b4a20dbfa5c
refs/heads/master
2021-01-21T04:50:12.856000
2016-07-08T09:26:13
2016-07-08T09:26:13
48,749,301
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.prateek.mediaoceanquestion; public class MediaOceanQuestion { private static char[] arr; private static int counter = 1; private static int startPoint = 0; private static int endPoint = 0; private static int sum = 0; public static void main(String[] args) { } public static String validTriangleSum(final String input) { try { parseInput(input); } catch (Exception e) { return "Invalid"; } return String.valueOf(sum); } private static void parseInput(final String input) throws Exception { arr = input.toCharArray(); parse(arr); } private static void parse(final char[] arr) throws Exception { int i = 0; int j = 0; while (i < arr.length) { setStartAndEndPoint(); checkIfNonNumberExistsThroughStartAndEndIndex(startPoint, endPoint); j = 0; while(i <= endPoint && i < arr.length) { i = i+2; j++; } i = endPoint + 2; if (counter != j) { throw new Exception("Count mismatch"); } getLargestNumberFromArray(); counter++; } if (!(arr[arr.length - 1] >=48 && arr[arr.length - 1] <= 57)) { throw new Exception("Not an integer"); } } private static void getLargestNumberFromArray() { int length = (endPoint - startPoint) / 2; int indexOne = length; int indexTwo = indexOne - 1; if (endPoint == 0) indexTwo = indexOne; if (length == 1) { if (arr[indexTwo] < arr[indexOne]) { swap(indexTwo, indexOne); } indexOne--; } while(indexOne != 0) { int parentOne = getParent(indexOne); int parentTwo = getParent(indexTwo); if (isParentSame(parentOne, parentTwo)) { if (isShufflingRequired(parentOne, indexOne, indexTwo)) { if (arr[startPoint + 2 * indexOne] >= arr[startPoint + 2 * indexTwo]) { swap(parentOne, indexOne); } else { swap(parentOne, indexTwo); } } indexOne -= 2; indexTwo -= 2; } else { if (isShufflingRequired(parentOne, indexOne, indexOne)) { swap(parentOne, indexOne); } indexOne--; indexTwo--; } } char ch[] = new char[1]; ch[0] = arr[startPoint + 2 * indexOne]; String st = new String(ch); sum += Integer.parseInt(st); } private static void swap(int indexTwo, int indexOne) { final char ch = arr[startPoint + 2 * indexTwo]; arr[startPoint + 2 * indexTwo] = arr[startPoint + 2 * indexOne]; arr[startPoint + 2 * indexOne] = ch; } private static boolean isShufflingRequired(int parent, int indexOne, int indexTwo) { if (arr[startPoint + 2 * parent] > arr[startPoint + 2 * indexTwo] && arr[startPoint + 2 * parent] > arr[startPoint + 2 * indexOne]) { return false; } return true; } private static boolean isParentSame(int parentOne, int parentTwo) { return parentOne == parentTwo ? true : false; } private static int getParent(int index) { return (index - 1)/2; } private static void checkIfNonNumberExistsThroughStartAndEndIndex(int startPoint, int endPoint) throws Exception { if (!(isCharInRange(startPoint, endPoint))) { throw new Exception("Not an integer"); } } private static boolean isCharInRange(int startPoint, int endPoint) { for (int i = startPoint; i <= endPoint; i+=2) { if (!(arr[i] >=48 && arr[i] <=57)) { return false; } } return true; } private static void setStartAndEndPoint() { if (counter == 1) { startPoint = 0; endPoint = 0; } else { startPoint = endPoint + 2; endPoint = startPoint + (counter - 1)*2; } } }
UTF-8
Java
3,468
java
MediaOceanQuestion.java
Java
[]
null
[]
package com.prateek.mediaoceanquestion; public class MediaOceanQuestion { private static char[] arr; private static int counter = 1; private static int startPoint = 0; private static int endPoint = 0; private static int sum = 0; public static void main(String[] args) { } public static String validTriangleSum(final String input) { try { parseInput(input); } catch (Exception e) { return "Invalid"; } return String.valueOf(sum); } private static void parseInput(final String input) throws Exception { arr = input.toCharArray(); parse(arr); } private static void parse(final char[] arr) throws Exception { int i = 0; int j = 0; while (i < arr.length) { setStartAndEndPoint(); checkIfNonNumberExistsThroughStartAndEndIndex(startPoint, endPoint); j = 0; while(i <= endPoint && i < arr.length) { i = i+2; j++; } i = endPoint + 2; if (counter != j) { throw new Exception("Count mismatch"); } getLargestNumberFromArray(); counter++; } if (!(arr[arr.length - 1] >=48 && arr[arr.length - 1] <= 57)) { throw new Exception("Not an integer"); } } private static void getLargestNumberFromArray() { int length = (endPoint - startPoint) / 2; int indexOne = length; int indexTwo = indexOne - 1; if (endPoint == 0) indexTwo = indexOne; if (length == 1) { if (arr[indexTwo] < arr[indexOne]) { swap(indexTwo, indexOne); } indexOne--; } while(indexOne != 0) { int parentOne = getParent(indexOne); int parentTwo = getParent(indexTwo); if (isParentSame(parentOne, parentTwo)) { if (isShufflingRequired(parentOne, indexOne, indexTwo)) { if (arr[startPoint + 2 * indexOne] >= arr[startPoint + 2 * indexTwo]) { swap(parentOne, indexOne); } else { swap(parentOne, indexTwo); } } indexOne -= 2; indexTwo -= 2; } else { if (isShufflingRequired(parentOne, indexOne, indexOne)) { swap(parentOne, indexOne); } indexOne--; indexTwo--; } } char ch[] = new char[1]; ch[0] = arr[startPoint + 2 * indexOne]; String st = new String(ch); sum += Integer.parseInt(st); } private static void swap(int indexTwo, int indexOne) { final char ch = arr[startPoint + 2 * indexTwo]; arr[startPoint + 2 * indexTwo] = arr[startPoint + 2 * indexOne]; arr[startPoint + 2 * indexOne] = ch; } private static boolean isShufflingRequired(int parent, int indexOne, int indexTwo) { if (arr[startPoint + 2 * parent] > arr[startPoint + 2 * indexTwo] && arr[startPoint + 2 * parent] > arr[startPoint + 2 * indexOne]) { return false; } return true; } private static boolean isParentSame(int parentOne, int parentTwo) { return parentOne == parentTwo ? true : false; } private static int getParent(int index) { return (index - 1)/2; } private static void checkIfNonNumberExistsThroughStartAndEndIndex(int startPoint, int endPoint) throws Exception { if (!(isCharInRange(startPoint, endPoint))) { throw new Exception("Not an integer"); } } private static boolean isCharInRange(int startPoint, int endPoint) { for (int i = startPoint; i <= endPoint; i+=2) { if (!(arr[i] >=48 && arr[i] <=57)) { return false; } } return true; } private static void setStartAndEndPoint() { if (counter == 1) { startPoint = 0; endPoint = 0; } else { startPoint = endPoint + 2; endPoint = startPoint + (counter - 1)*2; } } }
3,468
0.639273
0.625433
141
23.595745
23.955034
135
false
false
0
0
0
0
0
0
2.638298
false
false
4
3d12b7911cad6f3f148513b1591ebdf6803a2145
2,302,102,519,355
ab63bfb71ef607c59662f5a5cb14a794186f082f
/jo.chview.core/src/jo/d2k/data/logic/report/DistanceMatrixReport.java
4df001b48629acf308b34b0f372e38903e5a7e30
[]
no_license
Surtac/ChView
https://github.com/Surtac/ChView
cef5af20acd4f66b93b3c893d5e12c00355f9847
e927267be2b95b6250419c0b88464ba396d8f71f
refs/heads/master
2021-05-29T23:59:43.430000
2015-07-10T21:12:42
2015-07-10T21:12:42
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/** * Created on Aug 28, 2002 * * To change this generated comment edit the template variable "filecomment": * Window>Preferences>Java>Templates. * To enable and disable the creation of file comments go to * Window>Preferences>Java>Code Generation. */ package jo.d2k.data.logic.report; import java.util.Arrays; import java.util.Collection; import java.util.Comparator; import jo.d2k.data.data.ChViewContextBean; import jo.d2k.data.data.StarBean; import jo.d2k.data.logic.ChViewFormatLogic; import jo.util.geom3d.Point3D; import jo.util.utils.FormatUtils; /** * @author jgrant * * To change this generated comment edit the template variable "typecomment": * Window>Preferences>Java>Templates. * To enable and disable the creation of type comments go to * Window>Preferences>Java>Code Generation. */ public class DistanceMatrixReport { public static String generateReport(final ChViewContextBean params) { StringBuffer text = new StringBuffer(); text.append("<html>"); text.append("<head>"); text.append("<title>DISTANCE MATRIX</title>"); text.append("</head>"); text.append("<body>"); text.append("<h1>DISTANCE MATRIX</h1>"); UtilLogic.reportFilter(text, params); Collection<StarBean> starList = params.getSelected(); if (starList.size() < 2) { starList = params.getFilteredStars(); UtilLogic.winnowStars(starList, params); } int size = starList.size(); if (size < 2) text.append("No objects selected to report on!"); else { StarBean[] stars = starList.toArray(new StarBean[0]); Arrays.sort(stars, new Comparator<StarBean>() { @Override public int compare(StarBean o1, StarBean o2) { String n1 = ChViewFormatLogic.getStarName(params, o1).toLowerCase(); String n2 = ChViewFormatLogic.getStarName(params, o2).toLowerCase(); return n1.compareTo(n2); } }); double[][] distances = new double[size-1][]; for (int i = 0; i < stars.length - 1; i++) { Point3D loc1 = new Point3D(stars[i].getX(), stars[i].getY(), stars[i].getZ()); distances[i] = new double[stars.length - i - 1]; for (int j = 0; j < stars.length - 1 - i; j++) { Point3D loc2 = new Point3D(stars[stars.length - 1 - j].getX(), stars[stars.length - 1 - j].getY(), stars[stars.length - 1 - j].getZ()); distances[i][j] = loc1.dist(loc2); } } text.append("<table>"); // top row text.append("<tr>"); text.append("<td></td>"); for (int j = 0; j < stars.length - 1; j++) text.append("<th>"+ChViewFormatLogic.getStarName(params, stars[stars.length - 1 - j])+"</th>"); text.append("</tr>\n"); // values for (int i = 0; i < stars.length - 1; i++) { text.append("<tr>"); text.append("<th>"+ChViewFormatLogic.getStarName(params, stars[i])+"</th>"); for (int j = 0; j < stars.length - 1 - i; j++) { if ((i%2) == 0) if ((j%2) == 0) text.append("<td style=\"background-color:#C0C0C0; text-align: right;\">"); else text.append("<td style=\"background-color:#E0E0E0; text-align: right;\">"); else if ((j%2) == 0) text.append("<td style=\"background-color:#E0E0E0; text-align: right;\">"); else text.append("<td style=\"background-color:#FFFFFF; text-align: right;\">"); text.append(FormatUtils.formatDouble(distances[i][j], 2)); text.append("</td>"); } text.append("</tr>\n"); } text.append("</table>"); } text.append("</body>"); text.append("</html>"); return text.toString(); } }
UTF-8
Java
4,006
java
DistanceMatrixReport.java
Java
[ { "context": "rt jo.util.utils.FormatUtils;\r\n\r\n\r\n/**\r\n * @author jgrant\r\n *\r\n * To change this generated comment edit the", "end": 609, "score": 0.9979203939437866, "start": 603, "tag": "USERNAME", "value": "jgrant" } ]
null
[]
/** * Created on Aug 28, 2002 * * To change this generated comment edit the template variable "filecomment": * Window>Preferences>Java>Templates. * To enable and disable the creation of file comments go to * Window>Preferences>Java>Code Generation. */ package jo.d2k.data.logic.report; import java.util.Arrays; import java.util.Collection; import java.util.Comparator; import jo.d2k.data.data.ChViewContextBean; import jo.d2k.data.data.StarBean; import jo.d2k.data.logic.ChViewFormatLogic; import jo.util.geom3d.Point3D; import jo.util.utils.FormatUtils; /** * @author jgrant * * To change this generated comment edit the template variable "typecomment": * Window>Preferences>Java>Templates. * To enable and disable the creation of type comments go to * Window>Preferences>Java>Code Generation. */ public class DistanceMatrixReport { public static String generateReport(final ChViewContextBean params) { StringBuffer text = new StringBuffer(); text.append("<html>"); text.append("<head>"); text.append("<title>DISTANCE MATRIX</title>"); text.append("</head>"); text.append("<body>"); text.append("<h1>DISTANCE MATRIX</h1>"); UtilLogic.reportFilter(text, params); Collection<StarBean> starList = params.getSelected(); if (starList.size() < 2) { starList = params.getFilteredStars(); UtilLogic.winnowStars(starList, params); } int size = starList.size(); if (size < 2) text.append("No objects selected to report on!"); else { StarBean[] stars = starList.toArray(new StarBean[0]); Arrays.sort(stars, new Comparator<StarBean>() { @Override public int compare(StarBean o1, StarBean o2) { String n1 = ChViewFormatLogic.getStarName(params, o1).toLowerCase(); String n2 = ChViewFormatLogic.getStarName(params, o2).toLowerCase(); return n1.compareTo(n2); } }); double[][] distances = new double[size-1][]; for (int i = 0; i < stars.length - 1; i++) { Point3D loc1 = new Point3D(stars[i].getX(), stars[i].getY(), stars[i].getZ()); distances[i] = new double[stars.length - i - 1]; for (int j = 0; j < stars.length - 1 - i; j++) { Point3D loc2 = new Point3D(stars[stars.length - 1 - j].getX(), stars[stars.length - 1 - j].getY(), stars[stars.length - 1 - j].getZ()); distances[i][j] = loc1.dist(loc2); } } text.append("<table>"); // top row text.append("<tr>"); text.append("<td></td>"); for (int j = 0; j < stars.length - 1; j++) text.append("<th>"+ChViewFormatLogic.getStarName(params, stars[stars.length - 1 - j])+"</th>"); text.append("</tr>\n"); // values for (int i = 0; i < stars.length - 1; i++) { text.append("<tr>"); text.append("<th>"+ChViewFormatLogic.getStarName(params, stars[i])+"</th>"); for (int j = 0; j < stars.length - 1 - i; j++) { if ((i%2) == 0) if ((j%2) == 0) text.append("<td style=\"background-color:#C0C0C0; text-align: right;\">"); else text.append("<td style=\"background-color:#E0E0E0; text-align: right;\">"); else if ((j%2) == 0) text.append("<td style=\"background-color:#E0E0E0; text-align: right;\">"); else text.append("<td style=\"background-color:#FFFFFF; text-align: right;\">"); text.append(FormatUtils.formatDouble(distances[i][j], 2)); text.append("</td>"); } text.append("</tr>\n"); } text.append("</table>"); } text.append("</body>"); text.append("</html>"); return text.toString(); } }
4,006
0.557414
0.541188
110
34.418182
28.478184
149
false
false
0
0
0
0
0
0
1.990909
false
false
4
ad7a1adfbc3a79b2211c493387981694db441750
22,514,218,606,428
fa9308f0f3e4cfe1e79cbb6d0375c6726617163e
/src/Types/Streams/StreamEntierAleatoire.java
33ff0ba4b4b5f46a75afdfe2fd6d1c7b26cf5d99
[]
no_license
FlorianCahay/Streash
https://github.com/FlorianCahay/Streash
d8ff13dd4e8899cbaac2f1cb66d8abfab4276040
be1d6a66335a48055ccdc7a92ab93d460663b055
refs/heads/master
2020-04-13T09:08:15.913000
2019-01-17T18:39:39
2019-01-17T18:39:39
163,102,785
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package Types.Streams; import Types.Rationnel; import Types.StreamType; import Types.TypesDonnees; import java.math.BigInteger; import java.util.ArrayList; import java.util.Random; import java.util.stream.Stream; public class StreamEntierAleatoire implements StreamType { private long seed; private long mini; private long maxi; private boolean infini; private Stream s = null; public StreamEntierAleatoire() { } private StreamEntierAleatoire(Rationnel a, Rationnel b, Rationnel seed) { this.mini = a.getNumerateur().longValue(); this.maxi = b.getNumerateur().longValue(); this.seed = seed.getNumerateur().longValue(); if (seed.getNumerateur().longValue() == -1) { this.seed = new Random().nextLong(); } this.infini = true; } @Override public StreamType copier() { return new StreamEntierAleatoire(new Rationnel(this.mini), new Rationnel(this.maxi), new Rationnel(this.seed)); } @Override public Stream getStream() { if (s == null) { s = new Random(this.seed).ints((int) mini, (int) maxi+1).mapToObj(x -> new Rationnel(BigInteger.valueOf(x))); } return s; } @Override public boolean streamInfini() { return infini; } @Override public StreamType getObject() { return this; } @Override public String affichageDansConsole() { return "Stream d'entiers pseudo-aléatoires compris entre " + String.valueOf(mini) + " et " + String.valueOf(maxi) + " (seed=" + String.valueOf(seed) + ")"; } @Override public String getType() { return "StreamEntierAleatoire"; } @Override public StreamType initialisationStream(ArrayList<TypesDonnees> args) { Rationnel r1 = (Rationnel) args.get(0); Rationnel r2 = (Rationnel) args.get(1); Rationnel r3 = (Rationnel) args.get(2); // Vérification que les paramètres sont bien des entiers if (!r1.isEntier()) throw new IllegalArgumentException("Le début du stream doit etre un entier"); if (!r2.isEntier()) throw new IllegalArgumentException("La fin du stream doit etre un entier"); if (!r3.isEntier()) throw new IllegalArgumentException("Le seed du random doit etre un entier"); return new StreamEntierAleatoire(r1, r2, r3); } }
UTF-8
Java
2,389
java
StreamEntierAleatoire.java
Java
[]
null
[]
package Types.Streams; import Types.Rationnel; import Types.StreamType; import Types.TypesDonnees; import java.math.BigInteger; import java.util.ArrayList; import java.util.Random; import java.util.stream.Stream; public class StreamEntierAleatoire implements StreamType { private long seed; private long mini; private long maxi; private boolean infini; private Stream s = null; public StreamEntierAleatoire() { } private StreamEntierAleatoire(Rationnel a, Rationnel b, Rationnel seed) { this.mini = a.getNumerateur().longValue(); this.maxi = b.getNumerateur().longValue(); this.seed = seed.getNumerateur().longValue(); if (seed.getNumerateur().longValue() == -1) { this.seed = new Random().nextLong(); } this.infini = true; } @Override public StreamType copier() { return new StreamEntierAleatoire(new Rationnel(this.mini), new Rationnel(this.maxi), new Rationnel(this.seed)); } @Override public Stream getStream() { if (s == null) { s = new Random(this.seed).ints((int) mini, (int) maxi+1).mapToObj(x -> new Rationnel(BigInteger.valueOf(x))); } return s; } @Override public boolean streamInfini() { return infini; } @Override public StreamType getObject() { return this; } @Override public String affichageDansConsole() { return "Stream d'entiers pseudo-aléatoires compris entre " + String.valueOf(mini) + " et " + String.valueOf(maxi) + " (seed=" + String.valueOf(seed) + ")"; } @Override public String getType() { return "StreamEntierAleatoire"; } @Override public StreamType initialisationStream(ArrayList<TypesDonnees> args) { Rationnel r1 = (Rationnel) args.get(0); Rationnel r2 = (Rationnel) args.get(1); Rationnel r3 = (Rationnel) args.get(2); // Vérification que les paramètres sont bien des entiers if (!r1.isEntier()) throw new IllegalArgumentException("Le début du stream doit etre un entier"); if (!r2.isEntier()) throw new IllegalArgumentException("La fin du stream doit etre un entier"); if (!r3.isEntier()) throw new IllegalArgumentException("Le seed du random doit etre un entier"); return new StreamEntierAleatoire(r1, r2, r3); } }
2,389
0.648218
0.642348
79
29.189873
32.592255
163
false
false
0
0
0
0
0
0
0.493671
false
false
4
f0e8ed14daeb74e6131fca5af83221f89df1a62a
26,783,416,104,589
2f26ed6f6dac814ebd04548b2cd274246e8c9326
/WEB-INF/src/com/yhaguy/util/comision/Cons.java
4b5d25958806a7f4f2efaa33a3eb50234322bd56
[]
no_license
sraul/yhaguy-baterias
https://github.com/sraul/yhaguy-baterias
ecbac89f922fc88c5268102025affc0a6d07ffb5
7aacfdd3fbca50f9d71c940ba083337a2c80e899
refs/heads/master
2023-08-19T05:21:03.565000
2023-08-18T15:33:08
2023-08-18T15:33:08
144,028,474
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.yhaguy.util.comision; import java.text.DecimalFormat; import java.text.NumberFormat; import java.util.*; import com.coreweb.extras.csv.CSV; import com.coreweb.util.Misc; public class Cons { /* * SQL usado para sacar la info del mes ***** OJO: Son 2 sql, uno para las * cobranzas, y otro que suma las ventas del mes que NO estan cobradas, * ayuda para obtener la meta. * * * PASOS 1. Ejecutar los 2 (dos) sql (ventas y cobranzas) -----[no]. * 2. (deprecated) Armar 1 cvs con los 2 sql * 3. LLevar a LibreOffice, separador TAB * 4. Poner el campo Mes arriba * 5. Sumar los campos numericos * 6. Guardar como ods * 7. exportar a cvs * 7. Editar cvs, quitar los ", 00:00:00.000" por nada * 8. Quitar compos [null] por 0 * 9. Quitar las Ñ por N y puede que algún ñ en caracater raro * 10. ES S.A. (1225) para Sixto. Lo que hago es de las cobranzas, quitar todos los * movimientos de ES S.A. y poner como Usuario y Vendedor a Sixto Sanches (9-SSHANCHEZ) */ /* * **************** SQL con TODO 01 cobranzas ********************* esto son * las cobranzas solamente (primer SQL) * SELECT a.IDRECIBO, a.IDTIPORECIBO, a.NRORECIBO, c.IDTIPOMOVIMIENTO, a.FECHA as FECHA_RECIBO, c.FECHA as FECHA_MOV, a.TOTAL as TOTAL_RECIBO, b.MONTO as MONTO_DETALLE_RECIBO, c.DEBE, d.GRAVADA, d.PORC_DESCUENTO, d.PRECIO_IVA, d.CANTIDAD, a.ESTADO, a.FECHA_CARGA, d.IDMOVIMIENTO, c.NROMOVIMIENTO, c.IDVENDEDOR, g.APELLIDO, g.NOMBRE, c.IDUSER, d.IDARTICULO, SUBSTR(e.DESCRIPCION , 0 , 20) , e.IDCOLECCION as IDPROVEEDOR, f.DESCRIPCION as DESCRIPCION_PROVEEDOR, "" as APELLIDO_USER, "" as NOMBRE_USER, h.IDPERSONA, SUBSTR(h.PERSONA , 0 , 20) as PERSONA, e.IDMARCA, m.DESCRIPCION as DESCRIPCION_MARCA FROM (((((((RECIBOS a join DETALLERECIBO b on a.IDRECIBO = b.IDRECIBO) join MOVIMIENTOS c on b.IDMOVIMIENTO = c.IDMOVIMIENTO) join DETALLEMOVIMIENTO d on c.IDMOVIMIENTO = d.IDMOVIMIENTO) join ARTICULO e on e.IDARTICULO = d.IDARTICULO) join COLECCION f on f.IDCOLECCION = e.IDCOLECCION) join VENDEDOR g on g.IDVENDEDOR = c.IDVENDEDOR) join PERSONA h on h.IDPERSONA = c.IDPERSONA) join Marca m on m.IDMARCA = e.IDMARCA where (a.FECHA >= '10/01/2015') and (a.FECHA <= '10/31/2015') and (a.IDTIPORECIBO in (0,1,10)) and (a.ESTADO = 'E') order by a.IDRECIBO, c.NROMOVIMIENTO * * * **************************************************** * * ============= solo ventas ================= * SELECT 0 as IDRECIBO, 0 as IDTIPORECIBO, 0 as NRORECIBO, c.IDTIPOMOVIMIENTO, 0 as FECHA_RECIBO, c.FECHA as FECHA_MOV, 0 as TOTAL_RECIBO, 0 as MONTO_DETALLE_RECIBO, c.DEBE, d.GRAVADA, d.PORC_DESCUENTO, d.PRECIO_IVA, d.CANTIDAD, 0 as ESTADO, 0 as FECHA_CARGA, d.IDMOVIMIENTO, c.NROMOVIMIENTO, c.IDVENDEDOR, g.APELLIDO, g.NOMBRE, c.IDUSER, d.IDARTICULO, SUBSTR(e.DESCRIPCION , 0 , 20) , e.IDCOLECCION as IDPROVEEDOR, f.DESCRIPCION as DESCRIPCION_PROVEEDOR, "" as APELLIDO_USER, "" as NOMBRE_USER, h.IDPERSONA, SUBSTR(h.PERSONA , 0 , 20) as PERSONA, e.IDMARCA as IDMARCA, m.DESCRIPCION as DESCRIPCION_MARCA FROM ((((( MOVIMIENTOS c join DETALLEMOVIMIENTO d on c.IDMOVIMIENTO = d.IDMOVIMIENTO) join ARTICULO e on e.IDARTICULO = d.IDARTICULO) join COLECCION f on f.IDCOLECCION = e.IDCOLECCION) join VENDEDOR g on g.IDVENDEDOR = c.IDVENDEDOR) join PERSONA h on h.IDPERSONA = c.IDPERSONA) join MARCA m on m.IDMARCA = e.IDMARCA where (c.FECHA >= '10/01/2015') and (c.FECHA <= '10/31/2015') and (c.idtipomovimiento = 43 or c.idtipomovimiento = 13 or c.idtipomovimiento = 44) and (c.estado = "F") order by c.NROMOVIMIENTO ============================================================== */ public static String MES_CORRIENTE = "10.2015"; public static String MES_STR = "2015-10-octubre"; // OJO poner las ventas de ES.S.A. cómo hechas por SIXTO, así se calculan public static boolean DEBUG = false; public static boolean SI_VENTAS = false; public static String direBase = "/home/daniel/datos/yhaguy/comisiones/"; /* archivo de ventas del mes */ public static String direOut = direBase + MES_STR + "/"; public static String direFileResumen = direOut + "resumen.txt"; public static String direFileError = direOut + "error.txt"; public static String fileVentas = direOut + "datos" + "/l-ventas.csv"; public static String fileCobranzas = direOut + "datos" + "/l-cobranzas.csv"; public static String FECHA_EJECUCION = "Generado: " + (new Misc()).getFechaHoyDetalle() + " \n ------------------- \n"; public static int EXTERNO = 0; public static int MOSTRADOR = 1; public static int AUXILIAR = 2; public static int LOS_CRESPI = 3; public static String idPorcDefault = "otraProveedor"; public static int ID_CONTADO = 43; public static int ID_CREDITO = 44; public static int ID_NDC = 13; public static StringBuffer LOGs = new StringBuffer(); public static StringBuffer OUT = new StringBuffer(); public static void error(String linea) { LOGs.append(linea + "\n"); } public static void print(String linea) { OUT.append(linea + "\n"); } public static double[][] porDevolucion = { { 0.007, 0.003 }, { 0.02, 0.0015 }, { 0.04, 0.0005 } }; /*******************************************************************/ // para saber los usuarios de los vendedores Externos, de esa forma sabemos // si es una venta compartida o no public static Object[][] usuarioVendedor = { { EXTERNO, "otro-e", "1" }, { EXTERNO, "JAGUILERA", "3" }, { EXTERNO, "EALEGRE", "2" }, { EXTERNO, "RAMARILLA", "4" }, { MOSTRADOR, "MANOLO", "5" }, { EXTERNO, "CAYALA", "6" }, { MOSTRADOR, "RBRITOS", "73" }, { EXTERNO, "RCESPEDES", "77" }, { MOSTRADOR, "NCRESPI", "61" }, { MOSTRADOR, "JDUARTE", "20" }, { MOSTRADOR, "HFERNANDEZ", "29" }, { EXTERNO, "DFERREIRA", "27" }, { EXTERNO, "GNUNEZ", "12" }, { MOSTRADOR, "DGAONA", "54" }, { EXTERNO, "AGOMEZ", "67" }, { EXTERNO, "FGRANADA", "72" }, { EXTERNO, "LLEGUIZAMO", "62" }, { EXTERNO, "FLEON", "70" }, { EXTERNO, "otro-ea", "60" }, { EXTERNO, "JGIMENEZ", "23" }, { EXTERNO, "JOSORIO", "71" }, { MOSTRADOR, "MOTAZU", "22" }, { EXTERNO, "LRISSO", "25" }, { EXTERNO, "ARODRIGUEZ", "78" }, { MOSTRADOR, "SSANCHEZ", "9" }, // ANTES ERA EXTERNO { MOSTRADOR, "CSANTACRUZ", "13" },{ EXTERNO, "DLOPEZ", "56" }, { EXTERNO, "ASUGASTI", "24" }, { EXTERNO, "MURDAPILLE", "28" }, { EXTERNO, "EVAZQUEZ", "49" }, { EXTERNO, "-sin-usuario-", "136" }, { MOSTRADOR, "SCUEVAS", "8" }, { MOSTRADOR, "RJGONZALEZ", "57" }, { MOSTRADOR, "LMACIEL", "15" }, { MOSTRADOR, "JMAIDANA", "34" }, { MOSTRADOR, "otro-eb", "64" }, { MOSTRADOR, "JRIOS", "37" }, { MOSTRADOR, "CVALDEZ", "14" }, { MOSTRADOR, "DMARTINEZ", "113" }, // { AUXILIAR, "MESTECHE", "52" }, { MOSTRADOR, "MESTECHE", "52" }, { MOSTRADOR, "PROLON", "99" }, { MOSTRADOR, "DAGUILAR", "-1" },{ MOSTRADOR, "AMENDOZA", "94" }, { EXTERNO, "CORTIZ", "31" }, { MOSTRADOR, "GBENITEZ", "121" } , { MOSTRADOR, "otro-q", "92" }, // Sixto Sanchez Temporal Mostrador { MOSTRADOR, "FMATTESICH", "132" } , { MOSTRADOR, "LGONCALVES", "otro-lg" } , // Los Crespi { LOS_CRESPI, "otro-be", "117" } , // Matto Arturo { LOS_CRESPI, "OCARBALLO", "135" } , // Matto Arturo { LOS_CRESPI, "HALVAREZ", "79" }, // Hernán Alvarez { LOS_CRESPI, "otro-ce", "101" } , // Sanchez Higinio { LOS_CRESPI, "HGIMENEZ", "81" }, // Hugo Gimenez { MOSTRADOR, "JVELAZQUEZ", "55" }, // Jorge velazquez { LOS_CRESPI, "LVERA", "76" }, // Librada vera { LOS_CRESPI, "LBENITEZ", "69" }, // Luis Benitez { LOS_CRESPI, "RFLORENTIN", "102" }, // Rolando Florentin { LOS_CRESPI, "otro-de", "138" } , // Ramos Luis { LOS_CRESPI, "otro-ee", "141" } , // Romero Nidia { MOSTRADOR, "otro-ae", "116" } , // Miguel Acosta { MOSTRADOR, "PJARA", "68" }, // Pablo Jara // { MOSTRADOR, "OCARBALLO", "135" }, // OSCAR CARBALLO { MOSTRADOR, "AMAGUILERA", "133" }, // ADRIAN MARTIN AGUILERA /* * { AUXILIAR, "PROLON", "id-most" }, { AUXILIAR, "RGIMENEZ", "18" }, { * AUXILIAR, "LMOREL", "7" }, { AUXILIAR, "LLOPEZ", "80" }, { AUXILIAR, * "DLOPEZ", "56" }, { AUXILIAR, "MEZARATE", "id-most" }, { AUXILIAR, * "FZARACHO", "id-most" }, { AUXILIAR, "DGOLDARAZ", "id-most" } */ }; public static Object[][] auxiliaresTemporales = { // dato de alta a pedido de Raquel { "OVERA4", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "JMAUGER", "ost", new Rango("2015.05.01", "2012.12.31")}, { "HALVAREZ", "79", new Rango("1900.01.01", "2012.12.31") }, { "PROLON", "99", new Rango("1900.01.01", "2013.05.31") }, { "RGIMENEZ", "18", new Rango("1900.01.01", "2020.12.31") }, { "RGIMENEZ6", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "LMOREL", "7", new Rango("1900.01.01", "2020.12.31") }, { "LMOREL6", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "LLOPEZ", "80", new Rango("1900.01.01", "2020.12.31") }, { "DLOPEZ", "56", new Rango("1900.01.01", "2013.07.31") }, { "MEZARATE", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "MEZARATE6", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "FZARACHO", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "DGOLDARAZ", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "DBOSCHERT", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "DBOSCHER", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "POJEDACEN", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "POJEDA", "65", new Rango("1900.01.01", "2020.12.31") }, { "POJEDA5", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "POJEDA3", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "LCIBILS", "95", new Rango("1900.01.01", "2020.12.31") }, { "GORTIZ", "96", new Rango("1900.01.01", "2020.12.31") }, { "VRIVEROS", "id-most", new Rango("2013.04.01", "2020.12.31") }, { "OESPINOLA", "97", new Rango("1900.01.01", "2020.12.31") }, { "ABOGADO", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "ABOGADOFDO", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "LPORTILLO", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "LPORTILLO5", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "LPORTILLO6", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "ADURE", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "VGONZALEZ", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "NCRESPI", "61", new Rango("2013.08.01", "2020.12.31") }, { "MANOLO", "5", new Rango("2013.10.01", "2020.12.31") }, { "SCUEVAS", "8", new Rango("2013.10.01", "2020.12.31") }, { "CSANTACRUZ", "13", new Rango("2013.10.01", "2020.12.31") }, { "EORTELLA4", "id-most", new Rango("2013.12.01", "2020.12.31") }, { "EORTELLA5", "id-most", new Rango("2013.12.01", "2020.12.31") }, { "EORTELLA6", "id-most", new Rango("2013.12.01", "2020.12.31") }, { "HINSFRAN", "118", new Rango("2014.01.01", "2020.12.31") }, // Natalia me pidio { "PROLON", "99", new Rango("2014.01.01", "2020.12.31") }, { "DGAONA", "54", new Rango("2014.01.01", "2020.12.31") }, }; /******************** METAS ***********************************/ public static int indiceMetaMinima = 0; public static int indiceMetaMaxima = 9; public static double m = 1000000; public static String meta0 = "meta0"; public static double[] metaV0 = { 1 * m, 120 * m, 125 * m, 130 * m, 135 * m, 140 * m, 145 * m, 150 * m, 160 * m, 180 * m}; public static String metaCO = "metaCO"; public static double[] metaCOv = { 1 * m, 410 * m , 420 * m , 430 * m , 440 * m , 450 * m , 460 * m , 470 * m , 480 * m , 500 * m }; public static String metaDF = "metaDF"; public static double[] metaDFv = { 1 * m, 210 * m , 220 * m , 230 * m , 240 * m , 250 * m , 260 * m , 270 * m , 280 * m , 300 * m }; public static String metaGN = "metaGN"; public static double[] metaGNv = { 1 * m, 360 * m , 370 * m , 380 * m , 390 * m , 405 * m , 425 * m , 460 * m , 480 * m , 500 * m }; public static String metaLR = "metaLR"; public static double[] metaLRv ={ 1 * m, 340 * m , 345 * m , 350 * m , 355 * m , 360 * m , 365 * m , 370 * m , 375 * m , 380 * m }; public static String metaSS = "metaSS"; // public static double[] metaSSv = {350 * m , 380 * m , 400 * m , 420 * m , 440 * m , 460 * m , 475 * m , 485 * m , 500 * m , 500 * m }; public static double[] metaSSv = { 1 * m, 450 * m , 475 * m , 485 * m , 500 * m , 520 * m , 540 * m , 560 * m , 580 * m , 600 * m }; public static String metaDefault = "metaDefault"; public static double[] metaVD = { 1 * m, 210 * m, 215 * m, 220 * m, 225 * m, 230 * m, 235 * m, 240 * m, 255 * m, 275 * m}; public static String[][] idVendedorPorMeta = { { "31", metaSS }, { "12", metaCO }, { "25", metaGN }, { "27", metaLR }, { "136", metaDF }, // { "9", metaSS }, }; /* Metas antes de los cambios del 6 de Marzo { "12", metaGN }, { "25", metaLR }, { "27", metaDF }, { "31", metaCO }, { "9", metaSS }, */ /***********************************************************************/ public static String CONTADO = "CTO"; public static String COBRANZA = "CRE"; public static double PORC_MOSTRADOR_CONTADO_def = 0.016; public static double PORC_MOSTRADOR_COBRANZA_def = 0.012; public static double PORC_EXTERNO_COBRANZA = 0.012; public static Object[][] idVendedorMostradorPorcentaje = { { "54", 0.012, 0.012 }, // Dahiana Gaona { "73", 0.015, 0.013 }, // Richard Britos { "99", 0.02, 0.02 }, // Pamela Rolon { "22", 0.025, 0.025 }, // Miguel Otazu { "20", 0.025, 0.025 }, // Julio Duarte { "29", 0.025, 0.025 }, // Hugo Fernandez { "94", 0.02, 0.018 }, // Alverto Mendoza { "68", 0.025, 0.025 }, // Pablo Jara { "116", 0.025, 0.025 }, // Miguel Acosta // { "135", 0.025, 0.025 }, // OSCAR CARBALLO { "133", 0.025, 0.025 }, // ADRIAN MARTIN AGUILERA { "9", 0.025, 0.025 }, // SIXTO SANCHEZ { "55", 0.0050, 0.0050 }, // JORGE VAZQUEZ (0.50% para todas las ventas) // Esto se carga para que siiga el curso, pero NO se usa, // por eso le pongo cero // Los Crespi /* aca { "116", 0.0, 0.0 }, // Miguel Acosta { "102", 0.0, 0.0 }, // Rolando Florentin { "79", 0.0, 0.0 }, // Hernan Alvarez { "81", 0.0, 0.0 }, // Hugo Gimenez { "117", 0.0, 0.0 }, // Matto Arturo { "101", 0.0, 0.0 }, // Sanches Higinio { "55", 0.0, 0.0 }, // Jorge Velazquez { "76", 0.0, 0.0 }, // Librada Vera { "69", 0.0, 0.0 }, // Luis Benitez { "68", 0.0, 0.0 }, // Pablo Jara */ }; // Los Crespi, Id de Vendedor y el Id de las Metas x Marcas public static Object[][] idVendedorLosCrespi = { // { "116", 1 }, // Miguel Acosta { "102", 1 }, // Rolando Florentin { "79", 1 }, // Hernan Alvarez { "81", 1 }, // Hugo Gimenez { "117", 1}, // Matto Arturo { "135", 1}, // Oscar Carballo { "101", 1 }, // Sanches Higinio // paso a venderores del mostrador para poder ponerle una comisión fija para todo lo demas // { "55", 1 }, // Jorge Velazquez { "76", 1 }, // Librada Vera { "69", 1}, // Luis Benitez { "141", 1}, // Romero Nidia { "138", 1}, // Ramos Luis //{ "68", 1 }, // Pablo Jara }; // comisión especial de algunos vendedores con respecto a proveedores public static Object [][] idcomisionEspecialPorVendedorProveedor = { {"55-10219", 0.0091, 0.0078, "Jorge Velazquez, BATEBOL LTDA.INDUSTRIA DE BATERIAS"}, {"55-57088", 0.0180, 0.0160, "Jorge Velazquez, JOHNSON CONTROLS"}, {"55-86299", 0.0230, 0.0200, "Jorge Velazquez, JOHNSON CONTROLS COLOMBIA S.A.S"}, {"55-10501", 0.0100, 0.0100, "Jorge Velazquez, PUMA ENERGY PARAGUAY"}, // esto ya está en marcas con porcentaje especial // {"55-xx", 0.0050, 0.0050, "Jorge Velazquez, CASTROL"}, {"TD-10501", 0.0100, 0.0100, "Para todos, PUMA ENERGY PARAGUAY"}, }; public static Hashtable<String, Double[]> comisionEspecialPorVendedorProveedor = new Hashtable<>(); public static void cargaComisionEspecialVendedorProveedor(){ for (int i = 0; i < idcomisionEspecialPorVendedorProveedor.length; i++) { Object[] d = idcomisionEspecialPorVendedorProveedor[i]; Double[] porComi = {(Double) d[1], (Double) d[2]}; comisionEspecialPorVendedorProveedor.put((String) d[0], porComi); } } public static String textoComisionEspecialPorVendedorProveedor(){ String out = "\n\n"; out += "Comisión especial de Vendedores por Proveedor\n"; out += "--------------------------------------------------------------------\n"; for (int i = 0; i < idcomisionEspecialPorVendedorProveedor.length; i++) { Object[] d = idcomisionEspecialPorVendedorProveedor[i]; String ctdo = misc.formatoDs(((double)d[1])*100, 8, false)+"%"; String cred = misc.formatoDs(((double)d[2])*100, 8, false)+"%"; String nomb = misc.formato("["+d[0]+"] "+d[3], 50, true); out+= nomb + ctdo + cred+"\n"; } out += "--------------------------------------------------------------------\n"; return out; } // vendedores sobre los cuales se debe considerar venta asignada // vendedores compañeros public static Object[][] idMarcasVendedorAsignado = { }; public static Object[][] xxxxxidMarcasVendedorAsignado = { {"250", "RAIDEN", "79", new String[]{"73","102"} }, // Raiden - Hernan Alvarez, comparte con Rolando {"249", "HELIAR", "79", new String[]{"73","102"} }, // Heliar - Hernan Alvarez, comparte con Rolando {"234", "TOYO", "102", new String[]{"79", "73"} }, // Toyo - Rolando Britos, comparte con Hernan y Richard {"248", "PLATIN", "102", new String[]{"79", "73"} }, // Platin - Richard Britos, comparte con Hernan y Richard }; public static Hashtable<String, Integer> idVendedorLosCrespiTable = new Hashtable<String, Integer>(); public static Hashtable<String, Double> idVendedorMostradorPorcentajeTable = new Hashtable<String, Double>(); public static void cargaVenMostradorPorcentaje() { for (int i = 0; i < idVendedorMostradorPorcentaje.length; i++) { String idV = (String) idVendedorMostradorPorcentaje[i][0]; Double cto = (Double) idVendedorMostradorPorcentaje[i][1]; Double cre = (Double) idVendedorMostradorPorcentaje[i][2]; idVendedorMostradorPorcentajeTable.put(idV + CONTADO, cto); idVendedorMostradorPorcentajeTable.put(idV + COBRANZA, cre); } // cargo dos valores por default idVendedorMostradorPorcentajeTable.put(CONTADO, PORC_MOSTRADOR_CONTADO_def); idVendedorMostradorPorcentajeTable.put(COBRANZA, PORC_MOSTRADOR_COBRANZA_def); // Carga los Crespi for (int i = 0; i < idVendedorLosCrespi.length ; i++) { String idV = (String) idVendedorLosCrespi[i][0]; Integer meta = (Integer) idVendedorLosCrespi[i][1]; idVendedorLosCrespiTable.put(idV, meta); } } public static double getPorcMostrador(String idV, String tipo) { Double d = idVendedorMostradorPorcentajeTable.get(idV + tipo); if (d == null) { d = idVendedorMostradorPorcentajeTable.get(tipo); } return d.doubleValue(); } /***********************************************************************/ public static String[][] clientesNoConsiderados = { { "54481", "Arandu Repuestos" }, { "57562", "Katupyry Repuestos S.A." } }; public static boolean esClienteNoConsiderado(String idPersona) { boolean out = false; for (int i = 0; i < clientesNoConsiderados.length; i++) { String id = clientesNoConsiderados[i][0]; if (id.compareTo(idPersona) == 0) { out = true; } } return out; } // Id cliente, Cliente, porcentaje, true: NO compartida, false: según lo que corresponda public static Object[][] porcentajePorCliente = { { "4783", "Central Repuestos S.A.", 0.005, true }, { "3123", "Brianza S.A.", 0.005, true }, { "23", "Todo Mercedes", 0.005, true } , { "5826", "Tractopar", 0.01, false}, // { "2618", "Neumatec", 0.01, false} }; public static double getPorcentajeClienteEspecial(String idPersona) { double out = -1; for (int i = 0; i < porcentajePorCliente.length; i++) { String id = (String) porcentajePorCliente[i][0]; if (id.compareTo(idPersona) == 0) { out = (double) porcentajePorCliente[i][2]; } } return out; } public static boolean getPorcentajeClienteEspecialNOCompartida(String idPersona) { boolean out = false; // por defecto es según corresponda for (int i = 0; i < porcentajePorCliente.length; i++) { String id = (String) porcentajePorCliente[i][0]; if (id.compareTo(idPersona) == 0) { out = (boolean) porcentajePorCliente[i][3]; } } return out; } // Id marca public static Object[][] porcentajePorMarca = { { "308", "Castrol", 0.005 }, }; public static double getPorcentajeMarcaEspecial(String idMarca) { double out = -1; for (int i = 0; i < porcentajePorMarca.length; i++) { String id = (String) porcentajePorMarca[i][0]; if (id.compareTo(idMarca) == 0) { out = (double) porcentajePorMarca[i][2]; } } return out; } public static String textoClienteNoConsiderados() { String out = " \n\n"; out += "Clientes que NO suman en la comision ni en la venta del mes\n"; out += "-----------------------------------------------------------\n"; for (int i = 0; i < clientesNoConsiderados.length; i++) { String id = ("[" + clientesNoConsiderados[i][0] + "] ") .substring(0, 10); String cl = clientesNoConsiderados[i][1]; out += id + cl + "\n"; } out += "-----------------------------------------------------------" + "\n"; return out; } public static String textoPorcentajeEspecialClientes() { Misc m = new Misc(); String out = " \n\n"; out += "Clientes con porcentaje especial (TRUE: ES NO COMPARTIDA)" + "\n"; out += "-----------------------------------------------------------" + "\n"; for (int i = 0; i < porcentajePorCliente.length; i++) { String id = ("[" + porcentajePorCliente[i][0] + "] ") .substring(0, 10); String cl = ("" + porcentajePorCliente[i][1] + " ") .substring(0, 25); String por = m.formatoDs( ((double) porcentajePorCliente[i][2]) * 100, 5, false) + "%"; String comp = " "+porcentajePorCliente[i][3]+""; out += id + cl + por + comp + "\n"; } out += "-----------------------------------------------------------" + "\n"; return out; } public static String textoPorcentajeEspecialMarca() { Misc m = new Misc(); String out = " \n\n"; out += "Marcas con porcentaje especial" + "\n"; out += "-----------------------------------------------------------" + "\n"; for (int i = 0; i < porcentajePorMarca.length; i++) { String id = ("[" + porcentajePorMarca[i][0] + "] ") .substring(0, 10); String mk = ("" + porcentajePorMarca[i][1] + " ") .substring(0, 25); String por = m.formatoDs( ((double) porcentajePorMarca[i][2]) * 100, 5, false) + "%"; out += id + mk + por + "\n"; } out += "-----------------------------------------------------------" + "\n"; return out; } public static String textoVendedoresSinComisionXProveedor(){ String out = "\n\n"; out += "Vendedores que NO cobram comision para ciertas fábricas\n"; out += "-----------------------------------------------------------\n"; iniPrintColumanas(2); addPrintDato(0, "Fabricas que NO pagan comision"); addPrintDato(0, "------------------------------"); for (int i = 0; i < fabricasNoComision.length; i++) { addPrintDato(0, "("+fabricasNoComision[i][0]+") "+fabricasNoComision[i][1]); } addPrintDato(0, "------------------------------"); addPrintDato(1, "Vendedores en este régimen "); addPrintDato(1, "------------------------------"); for (int i = 0; i < vendedoresFabricasNoComision.length; i++) { String idV = (String) vendedoresFabricasNoComision[i][0]; String nV = (String) vendedoresFabricasNoComision[i][2]; String s = "000"+idV.trim(); s = s.substring(s.length()-3); addPrintDato(1, "("+s+") - "+nV); } addPrintDato(1, "------------------------------"); out += printCol(new int[]{30,30}, "|"); return out; } /********************* PARA LEER DEL CSV *******************************/ public static String[][] cab = { { "Mes", CSV.STRING } }; public static String[][] cabDet = { { "IDMOVIMIENTO", CSV.NUMERICO }, // id { "IDRECIBO", CSV.NUMERICO }, { "IDTIPORECIBO", CSV.NUMERICO }, { "NRORECIBO", CSV.STRING }, { "IDTIPOMOVIMIENTO", CSV.NUMERICO }, { "FECHA_RECIBO", CSV.STRING }, { "FECHA_MOV", CSV.STRING }, { "TOTAL_RECIBO", CSV.NUMERICO }, { "MONTO_DETALLE_RECIBO", CSV.NUMERICO }, { "DEBE", CSV.NUMERICO }, { "GRAVADA", CSV.NUMERICO }, { "PRECIO_IVA", CSV.NUMERICO }, { "CANTIDAD", CSV.NUMERICO }, { "ESTADO", CSV.STRING }, { "FECHA_CARGA", CSV.STRING }, { "IDMOVIMIENTO", CSV.NUMERICO }, { "NROMOVIMIENTO", CSV.NUMERICO }, { "IDVENDEDOR", CSV.NUMERICO, }, { "APELLIDO", CSV.STRING }, { "NOMBRE", CSV.STRING }, { "IDUSER", CSV.STRING }, { "APELLIDO_USER", CSV.STRING }, { "NOMBRE_USER", CSV.STRING }, { "IDARTICULO", CSV.STRING }, { "SUBSTR", CSV.STRING }, { "IDMARCA", CSV.NUMERICO }, { "DESCRIPCION_MARCA", CSV.STRING }, { "PORC_DESCUENTO", CSV.NUMERICO }, { "IDPERSONA", CSV.NUMERICO }, { "PERSONA", CSV.STRING }, { "IDPROVEEDOR", CSV.NUMERICO }, { "DESCRIPCION_PROVEEDOR", CSV.STRING } }; /************** TABLA DE COMPROBANTES, YA PASADOS DESDE EL CSV **********************/ // poner los campos de los comprobantes private static String[] camposComprobante = { "ID", "IDRECIBO", "IDTIPORECIBO", "NRORECIBO", "IDTIPOMOVIMIENTO", "FECHA_RECIBO", "FECHA_MOV", "TOTAL_RECIBO", "MONTO_DETALLE_RECIBO", "DEBE", "GRAVADA", "PRECIO_IVA", "CANTIDAD", "ESTADO", "FECHA_CARGA", "IDMOVIMIENTO", "NROMOVIMIENTO", "IDVENDEDOR", "APELLIDO", "NOMBRE", "IDUSER", "APELLIDO_USER", "NOMBRE_USER", "IDARTICULO", "SUBSTR", "IDPROVEEDOR", "DESCRIPCION_IDPROVEEDOR", "ESCONTADO", "IDPERSONA", "PERSONA", "IDMARCA", "DESCRIPCION_MARCA", "IDPROVEEDOR", "DESCRIPCION_PROVEEDOR" }; public static Tabla ventas = new Tabla(camposComprobante); public static Tabla cobranzas = new Tabla(camposComprobante); public static void csvtoTable(String file, Tabla table) throws Exception { System.out.println("Datos: " + file); /* * cargar los comprobantes del CSV o de donde sea */ String direccion = file; // Leer el CSV CSV csv = new CSV(cab, cabDet, direccion); // Como recorrer el detalle csv.start(); int contador = 0; int nroLinea = 0; while (csv.hashNext() /* && nroLinea < 50 */) { nroLinea++; // Lee el detalle de las facturaciones double IDRECIBO = csv.getDetalleDouble("IDRECIBO"); double IDTIPORECIBO = csv.getDetalleDouble("IDTIPORECIBO"); String NRORECIBO = csv.getDetalleString("NRORECIBO"); long IDTIPOMOVIMIENTO = (long) csv .getDetalleDouble("IDTIPOMOVIMIENTO"); String FECHA_RECIBO = csv.getDetalleString("FECHA_RECIBO"); String FECHA_MOV = csv.getDetalleString("FECHA_MOV"); double TOTAL_RECIBO = csv.getDetalleDouble("TOTAL_RECIBO"); double MONTO_DETALLE_RECIBO = csv .getDetalleDouble("MONTO_DETALLE_RECIBO"); double DEBE = csv.getDetalleDouble("DEBE"); double GRAVADA = csv.getDetalleDouble("GRAVADA"); double POR_DESC = csv.getDetalleDouble("PORC_DESCUENTO"); // quitando el descuento GRAVADA = GRAVADA - GRAVADA * (POR_DESC / 100); double PRECIO_IVA = csv.getDetalleDouble("PRECIO_IVA"); double CANTIDAD = csv.getDetalleDouble("CANTIDAD"); String ESTADO = csv.getDetalleString("ESTADO"); String FECHA_CARGA = csv.getDetalleString("FECHA_CARGA"); double IDMOVIMIENTO = csv.getDetalleDouble("IDMOVIMIENTO"); String NROMOVIMIENTO = "" + ((long) csv.getDetalleDouble("NROMOVIMIENTO")); String IDVENDEDOR = "" + ((long) csv.getDetalleDouble("IDVENDEDOR")); String APELLIDO = csv.getDetalleString("APELLIDO"); String NOMBRE = csv.getDetalleString("NOMBRE"); String IDUSER = csv.getDetalleString("IDUSER"); String APELLIDO_USER = csv.getDetalleString("APELLIDO_USER"); String NOMBRE_USER = csv.getDetalleString("NOMBRE_USER"); String IDARTICULO = csv.getDetalleString("IDARTICULO"); String SUBSTR = csv.getDetalleString("SUBSTR"); String IDPROVEEDOR = "" + ((long) csv.getDetalleDouble("IDPROVEEDOR")); String DESCRIPCION_PROVEEDOR = csv .getDetalleString("DESCRIPCION_PROVEEDOR"); String IDPERSONA = "" + ((long) csv.getDetalleDouble("IDPERSONA")); String PERSONA = csv.getDetalleString("PERSONA"); String IDMARCA = "" + ((long) csv.getDetalleDouble("IDMARCA")); String DESCRIPCION_MARCA = csv .getDetalleString("DESCRIPCION_MARCA"); boolean esContado = false; if (IDTIPOMOVIMIENTO == ID_CONTADO) { esContado = true; } if (IDTIPOMOVIMIENTO == ID_NDC) { GRAVADA = GRAVADA * -1; } if ((IDTIPOMOVIMIENTO == ID_CONTADO || IDTIPOMOVIMIENTO == ID_CREDITO || IDTIPOMOVIMIENTO == ID_NDC)) { contador++; // Cargarlos detalles en la tabla Comprobante table.newRow(); table.addDataRow("ID", contador); table.addDataRow("IDRECIBO", IDRECIBO); table.addDataRow("IDTIPORECIBO", IDTIPORECIBO); table.addDataRow("NRORECIBO", NRORECIBO); table.addDataRow("IDTIPOMOVIMIENTO", IDTIPOMOVIMIENTO); table.addDataRow("FECHA_RECIBO", FECHA_RECIBO); table.addDataRow("FECHA_MOV", FECHA_MOV); table.addDataRow("TOTAL_RECIBO", TOTAL_RECIBO); table.addDataRow("MONTO_DETALLE_RECIBO", MONTO_DETALLE_RECIBO); table.addDataRow("DEBE", DEBE); table.addDataRow("GRAVADA", GRAVADA); table.addDataRow("PRECIO_IVA", PRECIO_IVA); table.addDataRow("CANTIDAD", CANTIDAD); table.addDataRow("ESTADO", ESTADO); table.addDataRow("FECHA_CARGA", FECHA_CARGA); table.addDataRow("IDMOVIMIENTO", IDMOVIMIENTO); table.addDataRow("NROMOVIMIENTO", NROMOVIMIENTO); table.addDataRow("IDVENDEDOR", IDVENDEDOR); table.addDataRow("APELLIDO", APELLIDO); table.addDataRow("NOMBRE", NOMBRE); table.addDataRow("IDUSER", IDUSER); table.addDataRow("APELLIDO_USER", APELLIDO_USER); table.addDataRow("NOMBRE_USER", NOMBRE_USER); table.addDataRow("IDARTICULO", IDARTICULO); table.addDataRow("SUBSTR", SUBSTR); // Descripcion del // Articulo table.addDataRow("IDPROVEEDOR", IDPROVEEDOR); table.addDataRow("DESCRIPCION_PROVEEDOR", DESCRIPCION_PROVEEDOR); table.addDataRow("ESCONTADO", esContado); table.addDataRow("IDPERSONA", IDPERSONA); table.addDataRow("PERSONA", PERSONA); table.addDataRow("IDMARCA", IDMARCA); table.addDataRow("DESCRIPCION_MARCA", DESCRIPCION_MARCA); table.saveRow(); } else { error("Error IDTIPOMOVIMIENTO:" + IDTIPOMOVIMIENTO + " IDRECIBO:" + IDRECIBO + " IDMOVIMIENTO:" + IDMOVIMIENTO + "" + file); } } } /********************* PORCENTAJES DE COMISIONES **********************/ public static Hashtable<String, Object[]> porcentajePorProveedor = new Hashtable<String, Object[]>(); public static double[] grupoPorcentaje0 = { 0.0132, 0.0134, 0.0135, 0.0136, 0.014, 0.0142, 0.0145, 0.0147, 0.015, 0.0154}; public static double[] grupoPorcentaje1 = { 0.0155, 0.0158, 0.0159, 0.016, 0.0164, 0.0167, 0.0171, 0.0174, 0.0176, 0.0179}; public static double[] grupoPorcentaje2 = { 0.0180, 0.0184, 0.0185, 0.0186, 0.0189, 0.0192, 0.0195, 0.0197, 0.0199, 0.02}; public static double[] grupoPorcentajeOtro = { 0.0123, 0.0123, 0.0123, 0.0123, 0.0123, 0.0123, 0.0123, 0.0123, 0.0123, 0.0123}; public static void cargaPorcentajesPorProveedor() { // (HACER) Traer del CSV los proveedores con sus respectivos porcentajes porcentajePorProveedor.put("10303", new Object[] {"10303","ZF DO BRASIL LTDA.SACHS",grupoPorcentaje0, "Grupo 0"}); porcentajePorProveedor.put("62175", new Object[] {"62175","MAHLE BRASIL",grupoPorcentaje0, "Grupo 0"}); porcentajePorProveedor.put("10145", new Object[] {"10145","CINPAL",grupoPorcentaje0, "Grupo 0"}); porcentajePorProveedor.put("10106", new Object[] {"10106","AFFINIA AUTOMOTIVA LTDA.",grupoPorcentaje0, "Grupo 0"}); porcentajePorProveedor.put("10508", new Object[] {"10508","IDEAL STANDARD WABCO TRAN",grupoPorcentaje0, "Grupo 0"}); porcentajePorProveedor.put("10116", new Object[] {"10116","SUPORTE REI",grupoPorcentaje0, "Grupo 0"}); porcentajePorProveedor.put("10482", new Object[] {"10482","ROLAMENTOS FAG LTDA.",grupoPorcentaje0, "Grupo 0"}); porcentajePorProveedor.put("10506", new Object[] {"10506","SABO INDUS.E COMERCIO DE",grupoPorcentaje0, "Grupo 0"}); porcentajePorProveedor.put("54300", new Object[] {"54300","ZF SACHS ALEMANIA",grupoPorcentaje0, "Grupo 0"}); porcentajePorProveedor.put("10122", new Object[] {"10122","FRUM",grupoPorcentaje0, "Grupo 0"}); porcentajePorProveedor.put("10110", new Object[] {"10110","MAR ROLAMENTOS",grupoPorcentaje1, "Grupo 1"}); porcentajePorProveedor.put("10483", new Object[] {"10483","INSTALADORA SAO MARCOS LT",grupoPorcentaje1, "Grupo 1"}); porcentajePorProveedor.put("10495", new Object[] {"10495","KNORR BREMSE SIST.P/VEIC.",grupoPorcentaje1, "Grupo 1"}); porcentajePorProveedor.put("54501", new Object[] {"54501","FEBI BILSTEIN ALEMANIA",grupoPorcentaje1, "Grupo 1"}); porcentajePorProveedor.put("53760", new Object[] {"53760","GARRET",grupoPorcentaje1, "Grupo 1"}); porcentajePorProveedor.put("56039", new Object[] {"56039","AIRTECH",grupoPorcentaje1, "Grupo 1"}); porcentajePorProveedor.put("10132", new Object[] {"10132","FRICCION S.R.L.",grupoPorcentaje1, "Grupo 1"}); porcentajePorProveedor.put("10117", new Object[] {"10117","VETORE IND.E COMERCIO",grupoPorcentaje1, "Grupo 1"}); porcentajePorProveedor.put("10108", new Object[] {"10108","AUTOLINEA HUBNER",grupoPorcentaje1, "Grupo 1"}); porcentajePorProveedor.put("10199", new Object[] {"10199","TECNICA INDUSTRIAL TIPH S",grupoPorcentaje1, "Grupo 1"}); porcentajePorProveedor.put("10111", new Object[] {"10111","MEC-PAR",grupoPorcentaje1, "Grupo 1"}); porcentajePorProveedor.put("56520", new Object[] {"56520","HONGKONG WOOD BEST INDUST",grupoPorcentaje1, "Grupo 1"}); porcentajePorProveedor.put("10105", new Object[] {"10105","SIEMENS VDO AUTOMOTIVE",grupoPorcentaje1, "Grupo 1"}); porcentajePorProveedor.put("60909", new Object[] {"60909","DUROLINE TRADING COMPANY LIMITED",grupoPorcentaje1, "Grupo 1"}); porcentajePorProveedor.put("53759", new Object[] {"53759","RIOSULENSE",grupoPorcentaje1, "Grupo 1"}); porcentajePorProveedor.put("10115", new Object[] {"10115","AMALCABURIO",grupoPorcentaje1, "Grupo 1"}); porcentajePorProveedor.put("10268", new Object[] {"10268","MAGNETI MARELLI COFAP AUT",grupoPorcentaje1, "Grupo 1"}); porcentajePorProveedor.put("56698", new Object[] {"56698","DAYCO ARGENTINA S.A.",grupoPorcentaje2, "Grupo 2"}); porcentajePorProveedor.put("10114", new Object[] {"10114","RODAROS",grupoPorcentaje2, "Grupo 2"}); porcentajePorProveedor.put("53534", new Object[] {"53534","CINPAL ARGENTINA",grupoPorcentaje2, "Grupo 2"}); porcentajePorProveedor.put("10733", new Object[] {"10733","ZF SACHS ARGENTINA S.A.",grupoPorcentaje2, "Grupo 2"}); porcentajePorProveedor.put("53840", new Object[] {"53840","ESPERANZA-RODAFUSO",grupoPorcentaje2, "Grupo 2"}); porcentajePorProveedor.put("58944", new Object[] {"58944","AFFINIA URUGUAY",grupoPorcentaje2, "Grupo 2"}); porcentajePorProveedor.put("10313", new Object[] {"10313","BOECHAT",grupoPorcentaje2, "Grupo 2"}); porcentajePorProveedor.put("10424", new Object[] {"10424","Biagio Dell'Agll & CIA Ltda.",grupoPorcentaje2, "Grupo 2"}); porcentajePorProveedor.put("79094", new Object[] {"79094","MAHLE FILTROS BRASIL",grupoPorcentaje2, "Grupo 2"}); porcentajePorProveedor.put("80103", new Object[] {"80103","MAHLE SINGAPORE",grupoPorcentaje2, "Grupo 2"}); porcentajePorProveedor.put("79537", new Object[] {"79537","DUROLINE S.A. BRASIL",grupoPorcentaje2, "Grupo 2"}); porcentajePorProveedor.put("78812", new Object[] {"78812","MAXION PRIORITY",grupoPorcentaje2, "Grupo 2"}); porcentajePorProveedor.put("57937", new Object[] {"57937","GENMOT GENEL MOTOR STANDA",grupoPorcentaje2, "Grupo 2"}); porcentajePorProveedor.put("53374", new Object[] {"53374","UNIONREBIT",grupoPorcentaje2, "Grupo 2"}); porcentajePorProveedor.put("80263", new Object[] {"80263","RELEMIX",grupoPorcentaje2, "Grupo 2"}); porcentajePorProveedor.put("82756", new Object[] {"82756","Valeo",grupoPorcentaje2, "Grupo 2"}); porcentajePorProveedor.put("10303", new Object[] {"81674","GRUPO ELITE S.A",grupoPorcentaje2, "Grupo 2"}); porcentajePorProveedor.put(idPorcDefault, new Object[] { idPorcDefault, "otras", grupoPorcentajeOtro, "Grupo Default" }); } public static double calculoDevolucion(double totalVenta, double porDevolucion) { double out = 0.0; double intervalo1, intervalo2; // 0.0% <= porDevolucion < 0.7% ......0.3% // 0.7% <= porDevolucion < 2% ......0.15% // 2% <= porDevolucion < 4% ......0.05% intervalo1 = 0; for (int j = 0; j < Cons.porDevolucion.length; j++) { intervalo2 = Cons.porDevolucion[j][0]; if (porDevolucion >= intervalo1 && porDevolucion < intervalo2) { out = totalVenta * Cons.porDevolucion[j][1]; } intervalo1 = Cons.porDevolucion[j][0]; } return out; } public static String textoPorDevolucion() { Misc m = new Misc(); NumberFormat fp = new DecimalFormat("##0.00 %"); String out = ""; out += "Plus por devolucion\n"; out += "----------------------------------------\n"; double desde = 0; double hasta = 0; double por = 0; for (int i = 0; i < Cons.porDevolucion.length; i++) { hasta = Cons.porDevolucion[i][0]; por = Cons.porDevolucion[i][1]; out += "[ >= " + m.formato(fp.format(desde), 8, false) + " y < " + m.formato(fp.format(hasta), 8, false) + " ] " + m.formato(fp.format(por), 8, false) + "\n"; desde = Cons.porDevolucion[i][0]; ; } hasta = 1; por = 0; out += "[ >= " + m.formato(fp.format(desde), 8, false) + " y < " + m.formato(fp.format(hasta), 8, false) + " ] " + m.formato(fp.format(por), 8, false) + "\n"; out += "----------------------------------------\n"; return out; } public static String textoUsuariosAuxiliares() { String out = "\n\n"; out += "Usuarios AUXILIARES (NO se considera venta compartida)\n"; out += "------------------------------------------------------\n"; String linea = ""; // {"HALVAREZ", "79", new Rango("1900.01.01", "2012.12.31")}, for (int i = 0; i < auxiliaresTemporales.length; i++) { Object[] dato = auxiliaresTemporales[i]; String user = (String) dato[0]; String id = (String) dato[1]; linea = ("[" + user + "] " + id + " ").substring( 0, 20); linea += " Fechas:"; for (int j = 2; j < dato.length; j++) { Rango r = (Rango) dato[j]; linea += " " + r; } out += linea + "\n"; } out += "------------------------------------------------------\n"; return out; } public static void xxmain(String[] args) { System.out.println(Cons.textoPorDevolucion()); } //======================================== //======================================== // auxiliar, porque de esta manera puedo poner fábricas diferentes para // cada venderor, por ahora son las mismas, pero ... private static String[][] fabricasNoComision = { {"10219","BATEBOL LTDA.IND"}, {"10666","CHAMPION LABORAT"}, {"82080","CONTINENTAL CUBI"}, {"82726","CONTINENTAL CUBI"}, {"84633","CONTINENTAL CUBI"}, {"83631","CONTINENTAL CUBI"}, {"10675","COOPER TIRE & RU"}, {"10204","FILTROS HS de Si"}, {"54505","GITI TIRE CUBIER"}, {"53910","GRUPO KOLIMA"}, {"10665","INDUSTRIAS MIGUE"}, {"10673","ITOCHU CORPORATI"}, {"10730","J B IMPORTACIONE"}, {"57088","JOHNSON CONTROLS"}, {"86299","JOHNSON CONTROLS"}, {"74605","MAHLE ALEMANIA"}, {"79094","MAHLE FILTROS BR"}, {"10689","PEKO INCORPORATI"}, {"10718","PENTIUS AUTOMOTI"}, {"10662","SOFAPE S/A"}, {"10672","TECNECO FILTERS"}, {"10696","VALVOLINE ARGENT"}, {"58253","YIGITAKU"}, {"10501","PUMA ENERGY PARAGUAY S.A."} }; // que vendedor y que lista de fábricas NO cobra comision private static Object[][] vendedoresFabricasNoComision = { // {"9", fabricasNoComision, "Sixto Sanchez"}, /* desde Julio 2015 {"31", fabricasNoComision, "Carlos Ortiz"}, {"27", fabricasNoComision, "Diego Ferreira"}, {"12", fabricasNoComision, "Gabriel Nunez"}, {"25", fabricasNoComision, "Lorenzo Risso"}, {"133", fabricasNoComision, "ADRIAN MARTIN AGUILERA"}, */ {"135", fabricasNoComision, "OSCAR CARBALLO"}, {"4", fabricasNoComision, "ROQUE AMARILLA"}, }; // fabricas con comisión especial en todas las ventas private static String[][] fabricasComisionEspecialTodos = { {"xdr10501","PUMA ENERGY PARAGUAY S.A.", "",""}, }; private static Hashtable <String, String> hashVendedorFabrica = new Hashtable<>(); private static String getIdViFas(String idV, String idFas){ return (idV.trim()+"-"+idFas.trim()); } static Misc misc = new Misc(); static String ff = "/home/daniel/datos/yhaguy/comisiones/2014-08-agosto/datos/idVidFas.txt"; static{ // caraga un has con idVendedor y idFas, entonces si // está en el hash es porque NO le corresponde comision for (int i = 0; i < vendedoresFabricasNoComision.length; i++) { String idV = (String) vendedoresFabricasNoComision[i][0]; String[][] fas = (String[][]) vendedoresFabricasNoComision[i][1]; for (int j = 0; j < fas.length; j++) { String idVIdFas = getIdViFas(idV,fas[j][0]); hashVendedorFabrica.put(idVIdFas, "ok"); misc.agregarStringToArchivo(ff, idVIdFas+"\n"); } } misc.agregarStringToArchivo(ff, "********************************\n"); misc.agregarStringToArchivo(ff, "********************************\n"); } public static boolean cobraComision(String idVendedor, String idFabrica){ String idVidFas = getIdViFas(idVendedor, idFabrica); misc.agregarStringToArchivo(ff, idVidFas+"\n"); Object o = hashVendedorFabrica.get(idVidFas); if (o == null){ // si no está, cobra comision return true; } misc.agregarStringToArchivo(ff, "---------SI \n"); return false; } private static ArrayList<String>[] cols = null; static public void iniPrintColumanas(int nColumnas){ cols = new ArrayList[nColumnas]; for (int i = 0; i < nColumnas; i++) { cols[i] = new ArrayList<String>(); } } static public void addPrintDato(int col, String dato){ ArrayList<String> ld = cols[col]; ld.add(dato); } static public String printCol(int[] anchos, String sep){ String out = ""; boolean hayDato = true; int vuelta = 0; while (hayDato == true){ hayDato = false; String linea = ""; for (int i = 0; i < cols.length; i++) { String str = ""; ArrayList<String> ld = cols[i]; if (vuelta < ld.size()){ str = ld.get(vuelta); hayDato = true; } str += " "; str = str.substring(0, anchos[i]); linea += sep + str; } if (hayDato == true){ out += linea+"\n"; } vuelta++; } return out; } public static void main(String[] args) { iniPrintColumanas(3); addPrintDato(0, "1.1"); addPrintDato(0, "2.1"); addPrintDato(0, "3.1"); addPrintDato(1, "1.2"); addPrintDato(1, "2.2"); addPrintDato(2, "1.3"); addPrintDato(2, "2.3"); addPrintDato(2, "3.3"); System.out.println(printCol(new int[]{10,10,10}, "|")); } }
UTF-8
Java
43,708
java
Cons.java
Java
[ { "context": "atic Object[][] usuarioVendedor = { { EXTERNO, \"otro-e\", \"1\" },\n\t\t\t{ EXTERNO, \"JAGUILERA\", \"3\" }, { EX", "end": 5479, "score": 0.5369421243667603, "start": 5477, "tag": "NAME", "value": "ro" }, { "context": "c Object[][] usuarioVendedor = { { EXTERNO, \"otro-e\", \"1\" },\n\t\t\t{ EXTERNO, \"JAGUILERA\", \"3\" }, { EXTE", "end": 5481, "score": 0.5899820327758789, "start": 5480, "tag": "NAME", "value": "e" }, { "context": "or = { { EXTERNO, \"otro-e\", \"1\" },\n\t\t\t{ EXTERNO, \"JAGUILERA\", \"3\" }, { EXTERNO, \"EALEGRE\", \"2\" },\n\t\t\t{ EXTERN", "end": 5515, "score": 0.9997363090515137, "start": 5506, "tag": "NAME", "value": "JAGUILERA" }, { "context": " },\n\t\t\t{ EXTERNO, \"JAGUILERA\", \"3\" }, { EXTERNO, \"EALEGRE\", \"2\" },\n\t\t\t{ EXTERNO, \"RAMARILLA\", \"4\" }, { MOST", "end": 5544, "score": 0.9993640780448914, "start": 5537, "tag": "NAME", "value": "EALEGRE" }, { "context": "3\" }, { EXTERNO, \"EALEGRE\", \"2\" },\n\t\t\t{ EXTERNO, \"RAMARILLA\", \"4\" }, { MOSTRADOR, \"MANOLO\", \"5\" },\n\t\t\t{ EXTER", "end": 5578, "score": 0.9997475147247314, "start": 5569, "tag": "NAME", "value": "RAMARILLA" }, { "context": ",\n\t\t\t{ EXTERNO, \"RAMARILLA\", \"4\" }, { MOSTRADOR, \"MANOLO\", \"5\" },\n\t\t\t{ EXTERNO, \"CAYALA\", \"6\" }, \n\t\t\t{ MOS", "end": 5608, "score": 0.9997434616088867, "start": 5602, "tag": "NAME", "value": "MANOLO" }, { "context": "\" }, { MOSTRADOR, \"MANOLO\", \"5\" },\n\t\t\t{ EXTERNO, \"CAYALA\", \"6\" }, \n\t\t\t{ MOSTRADOR, \"RBRITOS\", \"73\" },\n\t\t\t{", "end": 5639, "score": 0.9997587203979492, "start": 5633, "tag": "NAME", "value": "CAYALA" }, { "context": "\n\t\t\t{ EXTERNO, \"CAYALA\", \"6\" }, \n\t\t\t{ MOSTRADOR, \"RBRITOS\", \"73\" },\n\t\t\t{ EXTERNO, \"RCESPEDES\", \"77\" },\n\t\t\t{", "end": 5674, "score": 0.9997345209121704, "start": 5667, "tag": "NAME", "value": "RBRITOS" }, { "context": "\t\t\t{ MOSTRADOR, \"RBRITOS\", \"73\" },\n\t\t\t{ EXTERNO, \"RCESPEDES\", \"77\" },\n\t\t\t{ MOSTRADOR, \"NCRESPI\", \"61\" }, { MO", "end": 5709, "score": 0.9997089505195618, "start": 5700, "tag": "NAME", "value": "RCESPEDES" }, { "context": "\t{ EXTERNO, \"RCESPEDES\", \"77\" },\n\t\t\t{ MOSTRADOR, \"NCRESPI\", \"61\" }, { MOSTRADOR, \"JDUARTE\", \"20\" },\n\t\t\t{ MO", "end": 5744, "score": 0.9996676445007324, "start": 5737, "tag": "NAME", "value": "NCRESPI" }, { "context": "\n\t\t\t{ MOSTRADOR, \"NCRESPI\", \"61\" }, { MOSTRADOR, \"JDUARTE\", \"20\" },\n\t\t\t{ MOSTRADOR, \"HFERNANDEZ\", \"29\" }, {", "end": 5776, "score": 0.9997349977493286, "start": 5769, "tag": "NAME", "value": "JDUARTE" }, { "context": " { MOSTRADOR, \"JDUARTE\", \"20\" },\n\t\t\t{ MOSTRADOR, \"HFERNANDEZ\", \"29\" }, { EXTERNO, \"DFERREIRA\", \"27\" },\n\t\t\t{ EX", "end": 5814, "score": 0.9997717142105103, "start": 5804, "tag": "NAME", "value": "HFERNANDEZ" }, { "context": "\t\t\t{ MOSTRADOR, \"HFERNANDEZ\", \"29\" }, { EXTERNO, \"DFERREIRA\", \"27\" },\n\t\t\t{ EXTERNO, \"GNUNEZ\", \"12\" }, { MOSTR", "end": 5846, "score": 0.9997485280036926, "start": 5837, "tag": "NAME", "value": "DFERREIRA" }, { "context": "}, { EXTERNO, \"DFERREIRA\", \"27\" },\n\t\t\t{ EXTERNO, \"GNUNEZ\", \"12\" }, { MOSTRADOR, \"DGAONA\", \"54\" },\n\t\t\t { EX", "end": 5878, "score": 0.9996120929718018, "start": 5872, "tag": "NAME", "value": "GNUNEZ" }, { "context": " },\n\t\t\t{ EXTERNO, \"GNUNEZ\", \"12\" }, { MOSTRADOR, \"DGAONA\", \"54\" },\n\t\t\t { EXTERNO, \"AGOMEZ\", \"67\" },\n\t\t\t{ E", "end": 5909, "score": 0.9996796250343323, "start": 5903, "tag": "NAME", "value": "DGAONA" }, { "context": "}, { MOSTRADOR, \"DGAONA\", \"54\" },\n\t\t\t { EXTERNO, \"AGOMEZ\", \"67\" },\n\t\t\t{ EXTERNO, \"FGRANADA\", \"72\" }, \n\t\t\t{", "end": 5942, "score": 0.9996554255485535, "start": 5936, "tag": "NAME", "value": "AGOMEZ" }, { "context": ",\n\t\t\t { EXTERNO, \"AGOMEZ\", \"67\" },\n\t\t\t{ EXTERNO, \"FGRANADA\", \"72\" }, \n\t\t\t{ EXTERNO, \"LLEGUIZAMO\", \"62\" }, { ", "end": 5976, "score": 0.9997738003730774, "start": 5968, "tag": "NAME", "value": "FGRANADA" }, { "context": "\t\t\t{ EXTERNO, \"FGRANADA\", \"72\" }, \n\t\t\t{ EXTERNO, \"LLEGUIZAMO\", \"62\" }, { EXTERNO, \"FLEON\", \"70\" },\n\t\t\t{ EXTERN", "end": 6013, "score": 0.9996220469474792, "start": 6003, "tag": "NAME", "value": "LLEGUIZAMO" }, { "context": " \n\t\t\t{ EXTERNO, \"LLEGUIZAMO\", \"62\" }, { EXTERNO, \"FLEON\", \"70\" },\n\t\t\t{ EXTERNO, \"otro-ea\", \"60\" }, { EXTE", "end": 6041, "score": 0.9994433522224426, "start": 6036, "tag": "NAME", "value": "FLEON" }, { "context": "\" },\n\t\t\t{ EXTERNO, \"otro-ea\", \"60\" }, { EXTERNO, \"JGIMENEZ\", \"23\" },\n\t\t\t{ EXTERNO, \"JOSORIO\", \"71\" }, { MOST", "end": 6105, "score": 0.998030960559845, "start": 6097, "tag": "NAME", "value": "JGIMENEZ" }, { "context": " }, { EXTERNO, \"JGIMENEZ\", \"23\" },\n\t\t\t{ EXTERNO, \"JOSORIO\", \"71\" }, { MOSTRADOR, \"MOTAZU\", \"22\" },\n\t\t\t{ EXT", "end": 6138, "score": 0.9997258186340332, "start": 6131, "tag": "NAME", "value": "JOSORIO" }, { "context": "},\n\t\t\t{ EXTERNO, \"JOSORIO\", \"71\" }, { MOSTRADOR, \"MOTAZU\", \"22\" },\n\t\t\t{ EXTERNO, \"LRISSO\", \"25\" }, { EXTER", "end": 6169, "score": 0.9996452331542969, "start": 6163, "tag": "NAME", "value": "MOTAZU" }, { "context": " }, { MOSTRADOR, \"MOTAZU\", \"22\" },\n\t\t\t{ EXTERNO, \"LRISSO\", \"25\" }, { EXTERNO, \"ARODRIGUEZ\", \"78\" },\n\t\t\t{ M", "end": 6201, "score": 0.9996197819709778, "start": 6195, "tag": "NAME", "value": "LRISSO" }, { "context": "2\" },\n\t\t\t{ EXTERNO, \"LRISSO\", \"25\" }, { EXTERNO, \"ARODRIGUEZ\", \"78\" },\n\t\t\t{ MOSTRADOR, \"SSANCHEZ\", \"9\" }, // A", "end": 6234, "score": 0.9996135234832764, "start": 6224, "tag": "NAME", "value": "ARODRIGUEZ" }, { "context": "{ EXTERNO, \"ARODRIGUEZ\", \"78\" },\n\t\t\t{ MOSTRADOR, \"SSANCHEZ\", \"9\" }, // ANTES ERA EXTERNO\n\t\t\t{ MOSTRADOR, \"CS", "end": 6270, "score": 0.9996933341026306, "start": 6262, "tag": "NAME", "value": "SSANCHEZ" }, { "context": "EZ\", \"9\" }, // ANTES ERA EXTERNO\n\t\t\t{ MOSTRADOR, \"CSANTACRUZ\", \"13\" },{ EXTERNO, \"DLOPEZ\", \"56\" },\n\t\t\t{ EXTERN", "end": 6328, "score": 0.9998425245285034, "start": 6318, "tag": "NAME", "value": "CSANTACRUZ" }, { "context": "\n\t\t\t{ MOSTRADOR, \"CSANTACRUZ\", \"13\" },{ EXTERNO, \"DLOPEZ\", \"56\" },\n\t\t\t{ EXTERNO, \"ASUGASTI\", \"24\" }, { EXT", "end": 6356, "score": 0.9982737898826599, "start": 6350, "tag": "NAME", "value": "DLOPEZ" }, { "context": "13\" },{ EXTERNO, \"DLOPEZ\", \"56\" },\n\t\t\t{ EXTERNO, \"ASUGASTI\", \"24\" }, { EXTERNO, \"MURDAPILLE\", \"28\" },\n\t\t\t{ E", "end": 6390, "score": 0.9995864629745483, "start": 6382, "tag": "NAME", "value": "ASUGASTI" }, { "context": " },\n\t\t\t{ EXTERNO, \"ASUGASTI\", \"24\" }, { EXTERNO, \"MURDAPILLE\", \"28\" },\n\t\t\t{ EXTERNO, \"EVAZQUEZ\", \"49\" }, \n\t\t\t{", "end": 6423, "score": 0.9991581439971924, "start": 6413, "tag": "NAME", "value": "MURDAPILLE" }, { "context": ", { EXTERNO, \"MURDAPILLE\", \"28\" },\n\t\t\t{ EXTERNO, \"EVAZQUEZ\", \"49\" }, \n\t\t\t{ EXTERNO, \"-sin-usuario-\", \"136\" }", "end": 6457, "score": 0.9995330572128296, "start": 6449, "tag": "NAME", "value": "EVAZQUEZ" }, { "context": ", \"-sin-usuario-\", \"136\" },\n\t\t\t\n\t\t\t { MOSTRADOR, \"SCUEVAS\", \"8\" },\n\t\t\t{ MOSTRADOR, \"RJGONZALEZ\", \"57\" }, { ", "end": 6538, "score": 0.9997765421867371, "start": 6531, "tag": "NAME", "value": "SCUEVAS" }, { "context": "\t { MOSTRADOR, \"SCUEVAS\", \"8\" },\n\t\t\t{ MOSTRADOR, \"RJGONZALEZ\", \"57\" }, { MOSTRADOR, \"LMACIEL\", \"15\" },\n\t\t\t{ MO", "end": 6575, "score": 0.9998094439506531, "start": 6565, "tag": "NAME", "value": "RJGONZALEZ" }, { "context": "\t{ MOSTRADOR, \"RJGONZALEZ\", \"57\" }, { MOSTRADOR, \"LMACIEL\", \"15\" },\n\t\t\t{ MOSTRADOR, \"JMAIDANA\", \"34\" }, { M", "end": 6607, "score": 0.9998334646224976, "start": 6600, "tag": "NAME", "value": "LMACIEL" }, { "context": " { MOSTRADOR, \"LMACIEL\", \"15\" },\n\t\t\t{ MOSTRADOR, \"JMAIDANA\", \"34\" }, { MOSTRADOR, \"otro-eb\", \"64\" },\n\t\t\t{ MO", "end": 6643, "score": 0.9998456239700317, "start": 6635, "tag": "NAME", "value": "JMAIDANA" }, { "context": " { MOSTRADOR, \"otro-eb\", \"64\" },\n\t\t\t{ MOSTRADOR, \"JRIOS\", \"37\" },\n\t\t\t{ MOSTRADOR, \"CVALDEZ\", \"14\" },\n\t\t\t{", "end": 6708, "score": 0.999813437461853, "start": 6703, "tag": "NAME", "value": "JRIOS" }, { "context": "\t\t\t{ MOSTRADOR, \"JRIOS\", \"37\" },\n\t\t\t{ MOSTRADOR, \"CVALDEZ\", \"14\" },\n\t\t\t{ MOSTRADOR, \"DMARTINEZ\", \"113\" },\n\t", "end": 6743, "score": 0.999815821647644, "start": 6736, "tag": "NAME", "value": "CVALDEZ" }, { "context": "\t{ MOSTRADOR, \"CVALDEZ\", \"14\" },\n\t\t\t{ MOSTRADOR, \"DMARTINEZ\", \"113\" },\n\t\t\t// { AUXILIAR, \"MESTECHE\", \"52\" },\n", "end": 6780, "score": 0.9997999668121338, "start": 6771, "tag": "NAME", "value": "DMARTINEZ" }, { "context": "STRADOR, \"DMARTINEZ\", \"113\" },\n\t\t\t// { AUXILIAR, \"MESTECHE\", \"52\" },\n\t\t\t{ MOSTRADOR, \"MESTECHE\", \"52\" }, { ", "end": 6819, "score": 0.9997971057891846, "start": 6811, "tag": "NAME", "value": "MESTECHE" }, { "context": " { AUXILIAR, \"MESTECHE\", \"52\" },\n\t\t\t{ MOSTRADOR, \"MESTECHE\", \"52\" }, { MOSTRADOR, \"PROLON\", \"99\" },\n\t\t\t{ MO", "end": 6855, "score": 0.9997573494911194, "start": 6847, "tag": "NAME", "value": "MESTECHE" }, { "context": "\t\t{ MOSTRADOR, \"MESTECHE\", \"52\" }, { MOSTRADOR, \"PROLON\", \"99\" },\n\t\t\t{ MOSTRADOR, \"DAGUILAR\", \"-1\" },{ MO", "end": 6887, "score": 0.9997857213020325, "start": 6881, "tag": "NAME", "value": "PROLON" }, { "context": " { MOSTRADOR, \"PROLON\", \"99\" },\n\t\t\t{ MOSTRADOR, \"DAGUILAR\", \"-1\" },{ MOSTRADOR, \"AMENDOZA\", \"94\" },\n\t\t\t { E", "end": 6923, "score": 0.9997794032096863, "start": 6915, "tag": "NAME", "value": "DAGUILAR" }, { "context": "\n\t\t\t{ MOSTRADOR, \"DAGUILAR\", \"-1\" },{ MOSTRADOR, \"AMENDOZA\", \"94\" },\n\t\t\t { EXTERNO, \"CORTIZ\", \"31\" },\n\t\t\t{ M", "end": 6955, "score": 0.9997727274894714, "start": 6947, "tag": "NAME", "value": "AMENDOZA" }, { "context": ",{ MOSTRADOR, \"AMENDOZA\", \"94\" },\n\t\t\t { EXTERNO, \"CORTIZ\", \"31\" },\n\t\t\t{ MOSTRADOR, \"GBENITEZ\", \"121\" } ,\n\t", "end": 6988, "score": 0.9997431635856628, "start": 6982, "tag": "NAME", "value": "CORTIZ" }, { "context": "\t\t\t { EXTERNO, \"CORTIZ\", \"31\" },\n\t\t\t{ MOSTRADOR, \"GBENITEZ\", \"121\" } ,\n\t\t\t{ MOSTRADOR, \"otro-q\", \"92\" }, // ", "end": 7024, "score": 0.9998032450675964, "start": 7016, "tag": "NAME", "value": "GBENITEZ" }, { "context": "Sixto Sanchez Temporal Mostrador\n\t\t\t{ MOSTRADOR, \"FMATTESICH\", \"132\" } ,\n\t\t\t{ MOSTRADOR, \"LGONCALVES\", \"otro-l", "end": 7134, "score": 0.9998336434364319, "start": 7124, "tag": "NAME", "value": "FMATTESICH" }, { "context": "STRADOR, \"FMATTESICH\", \"132\" } ,\n\t\t\t{ MOSTRADOR, \"LGONCALVES\", \"otro-lg\" } ,\n\n\t\t\t// Los Crespi\n\t\t\t{ LOS_CRESPI", "end": 7174, "score": 0.9997847676277161, "start": 7164, "tag": "NAME", "value": "LGONCALVES" }, { "context": "os Crespi\n\t\t\t{ LOS_CRESPI, \"otro-be\", \"117\" } , // Matto Arturo\n\t\t\t{ LOS_CRESPI, \"OCARBALLO\", \"135\" } , // Matto ", "end": 7262, "score": 0.931633710861206, "start": 7250, "tag": "NAME", "value": "Matto Arturo" }, { "context": "-be\", \"117\" } , // Matto Arturo\n\t\t\t{ LOS_CRESPI, \"OCARBALLO\", \"135\" } , // Matto Arturo\n\t\t\t{ LOS_CRESPI, \"HAL", "end": 7290, "score": 0.9998143315315247, "start": 7281, "tag": "NAME", "value": "OCARBALLO" }, { "context": " Arturo\n\t\t\t{ LOS_CRESPI, \"OCARBALLO\", \"135\" } , // Matto Arturo\n\t\t\t{ LOS_CRESPI, \"HALVAREZ\", \"79\" }, // Hernán Al", "end": 7318, "score": 0.9976954460144043, "start": 7306, "tag": "NAME", "value": "Matto Arturo" }, { "context": "LLO\", \"135\" } , // Matto Arturo\n\t\t\t{ LOS_CRESPI, \"HALVAREZ\", \"79\" }, // Hernán Alvarez\n\t\t\t{ LOS_CRESPI, \"otr", "end": 7345, "score": 0.9996321201324463, "start": 7337, "tag": "NAME", "value": "HALVAREZ" }, { "context": "tto Arturo\n\t\t\t{ LOS_CRESPI, \"HALVAREZ\", \"79\" }, // Hernán Alvarez\n\t\t\t{ LOS_CRESPI, \"otro-ce\", \"101\" } , // Sanchez", "end": 7373, "score": 0.9998729228973389, "start": 7359, "tag": "NAME", "value": "Hernán Alvarez" }, { "context": " Alvarez\n\t\t\t{ LOS_CRESPI, \"otro-ce\", \"101\" } , // Sanchez Higinio\n\t\t\t{ LOS_CRESPI, \"HGIMENEZ\", \"81\" }, // Hugo Gime", "end": 7431, "score": 0.9998697638511658, "start": 7416, "tag": "NAME", "value": "Sanchez Higinio" }, { "context": ", \"101\" } , // Sanchez Higinio\n\t\t\t{ LOS_CRESPI, \"HGIMENEZ\", \"81\" }, // Hugo Gimenez\n\t\t\t{ MOSTRADOR, \"JVELAZ", "end": 7458, "score": 0.9841365814208984, "start": 7450, "tag": "NAME", "value": "HGIMENEZ" }, { "context": "ez Higinio\n\t\t\t{ LOS_CRESPI, \"HGIMENEZ\", \"81\" }, // Hugo Gimenez\n\t\t\t{ MOSTRADOR, \"JVELAZQUEZ\", \"55\" }, // Jorge ve", "end": 7484, "score": 0.9998671412467957, "start": 7472, "tag": "NAME", "value": "Hugo Gimenez" }, { "context": "IMENEZ\", \"81\" }, // Hugo Gimenez\n\t\t\t{ MOSTRADOR, \"JVELAZQUEZ\", \"55\" }, // Jorge velazquez\n\t\t\t{ LOS_CRESPI, \"LV", "end": 7512, "score": 0.9916742444038391, "start": 7502, "tag": "NAME", "value": "JVELAZQUEZ" }, { "context": "o Gimenez\n\t\t\t{ MOSTRADOR, \"JVELAZQUEZ\", \"55\" }, // Jorge velazquez\n\t\t\t{ LOS_CRESPI, \"LVERA\", \"76\" }, // Librada vera", "end": 7541, "score": 0.9998586177825928, "start": 7526, "tag": "NAME", "value": "Jorge velazquez" }, { "context": "rge velazquez\n\t\t\t{ LOS_CRESPI, \"LVERA\", \"76\" }, // Librada vera\n\t\t\t{ LOS_CRESPI, \"LBENITEZ\", \"69\" }, // Luis Beni", "end": 7591, "score": 0.9893249273300171, "start": 7579, "tag": "NAME", "value": "Librada vera" }, { "context": "LVERA\", \"76\" }, // Librada vera\n\t\t\t{ LOS_CRESPI, \"LBENITEZ\", \"69\" }, // Luis Benitez\n\t\t\t{ LOS_CRESPI, \"RFLOR", "end": 7618, "score": 0.9701609015464783, "start": 7610, "tag": "NAME", "value": "LBENITEZ" }, { "context": "brada vera\n\t\t\t{ LOS_CRESPI, \"LBENITEZ\", \"69\" }, // Luis Benitez\n\t\t\t{ LOS_CRESPI, \"RFLORENTIN\", \"102\" }, // Roland", "end": 7644, "score": 0.9998416900634766, "start": 7632, "tag": "NAME", "value": "Luis Benitez" }, { "context": "NITEZ\", \"69\" }, // Luis Benitez\n\t\t\t{ LOS_CRESPI, \"RFLORENTIN\", \"102\" }, // Rolando Florentin\n\t\t\t{ LOS_CRESPI, ", "end": 7673, "score": 0.9910410642623901, "start": 7663, "tag": "NAME", "value": "RFLORENTIN" }, { "context": "Benitez\n\t\t\t{ LOS_CRESPI, \"RFLORENTIN\", \"102\" }, // Rolando Florentin\n\t\t\t{ LOS_CRESPI, \"otro-de\", \"138\" } , // Ramos Lu", "end": 7705, "score": 0.999856173992157, "start": 7688, "tag": "NAME", "value": "Rolando Florentin" }, { "context": "Florentin\n\t\t\t{ LOS_CRESPI, \"otro-de\", \"138\" } , // Ramos Luis\n\t\t\t{ LOS_CRESPI, \"otro-ee\", \"141\" } , // Romero N", "end": 7757, "score": 0.9998562335968018, "start": 7747, "tag": "NAME", "value": "Ramos Luis" }, { "context": "amos Luis\n\t\t\t{ LOS_CRESPI, \"otro-ee\", \"141\" } , // Romero Nidia\n\n\t\t\t{ MOSTRADOR, \"otro-ae\", \"116\" } , // Miguel A", "end": 7811, "score": 0.9998643398284912, "start": 7799, "tag": "NAME", "value": "Romero Nidia" }, { "context": "ero Nidia\n\n\t\t\t{ MOSTRADOR, \"otro-ae\", \"116\" } , // Miguel Acosta\t\t\t\n\n\t\t\t{ MOSTRADOR, \"PJARA\", \"68\" }, // Pablo Jar", "end": 7866, "score": 0.9998552203178406, "start": 7853, "tag": "NAME", "value": "Miguel Acosta" }, { "context": ", \"116\" } , // Miguel Acosta\t\t\t\n\n\t\t\t{ MOSTRADOR, \"PJARA\", \"68\" }, // Pablo Jara\n\n\t//\t\t{ MOSTRADOR, \"OCARB", "end": 7893, "score": 0.999732255935669, "start": 7888, "tag": "NAME", "value": "PJARA" }, { "context": "uel Acosta\t\t\t\n\n\t\t\t{ MOSTRADOR, \"PJARA\", \"68\" }, // Pablo Jara\n\n\t//\t\t{ MOSTRADOR, \"OCARBALLO\", \"135\" }, // OSCAR", "end": 7917, "score": 0.9998612403869629, "start": 7907, "tag": "NAME", "value": "Pablo Jara" }, { "context": "PJARA\", \"68\" }, // Pablo Jara\n\n\t//\t\t{ MOSTRADOR, \"OCARBALLO\", \"135\" }, // OSCAR CARBALLO\n\t\t\t{ MOSTRADOR, \"AMA", "end": 7947, "score": 0.9997168779373169, "start": 7938, "tag": "NAME", "value": "OCARBALLO" }, { "context": "o Jara\n\n\t//\t\t{ MOSTRADOR, \"OCARBALLO\", \"135\" }, // OSCAR CARBALLO\n\t\t\t{ MOSTRADOR, \"AMAGUILERA\", \"133\" }, // ADRIAN ", "end": 7976, "score": 0.9998102784156799, "start": 7962, "tag": "NAME", "value": "OSCAR CARBALLO" }, { "context": "LLO\", \"135\" }, // OSCAR CARBALLO\n\t\t\t{ MOSTRADOR, \"AMAGUILERA\", \"133\" }, // ADRIAN MARTIN AGUILERA\n\t\t\t\n\t\t\n\t\t\t\n\t", "end": 8004, "score": 0.999210000038147, "start": 7994, "tag": "NAME", "value": "AMAGUILERA" }, { "context": "CARBALLO\n\t\t\t{ MOSTRADOR, \"AMAGUILERA\", \"133\" }, // ADRIAN MARTIN AGUILERA\n\t\t\t\n\t\t\n\t\t\t\n\t/*\n\t * { AUXILIAR, \"PROLON\", \"id-most", "end": 8041, "score": 0.9997673034667969, "start": 8019, "tag": "NAME", "value": "ADRIAN MARTIN AGUILERA" }, { "context": "N MARTIN AGUILERA\n\t\t\t\n\t\t\n\t\t\t\n\t/*\n\t * { AUXILIAR, \"PROLON\", \"id-most\" }, { AUXILIAR, \"RGIMENEZ\", \"18\" }, {\n", "end": 8080, "score": 0.9732614755630493, "start": 8074, "tag": "NAME", "value": "PROLON" }, { "context": "* { AUXILIAR, \"PROLON\", \"id-most\" }, { AUXILIAR, \"RGIMENEZ\", \"18\" }, {\n\t * AUXILIAR, \"LMOREL\", \"7\" }, { AUXI", "end": 8117, "score": 0.7498912215232849, "start": 8109, "tag": "NAME", "value": "RGIMENEZ" }, { "context": " { AUXILIAR, \"RGIMENEZ\", \"18\" }, {\n\t * AUXILIAR, \"LMOREL\", \"7\" }, { AUXILIAR, \"LLOPEZ\", \"80\" }, { AUXILIAR", "end": 8151, "score": 0.7525303959846497, "start": 8145, "tag": "NAME", "value": "LMOREL" }, { "context": " }, {\n\t * AUXILIAR, \"LMOREL\", \"7\" }, { AUXILIAR, \"LLOPEZ\", \"80\" }, { AUXILIAR,\n\t * \"DLOPEZ\", \"56\" }, { AUX", "end": 8180, "score": 0.9896872639656067, "start": 8174, "tag": "NAME", "value": "LLOPEZ" }, { "context": "}, { AUXILIAR, \"LLOPEZ\", \"80\" }, { AUXILIAR,\n\t * \"DLOPEZ\", \"56\" }, { AUXILIAR, \"MEZARATE\", \"id-most\" }, { ", "end": 8214, "score": 0.9930310249328613, "start": 8208, "tag": "NAME", "value": "DLOPEZ" }, { "context": "}, { AUXILIAR,\n\t * \"DLOPEZ\", \"56\" }, { AUXILIAR, \"MEZARATE\", \"id-most\" }, { AUXILIAR,\n\t * \"FZARACHO\", \"id-mo", "end": 8246, "score": 0.9754052758216858, "start": 8238, "tag": "NAME", "value": "MEZARATE" }, { "context": "XILIAR, \"MEZARATE\", \"id-most\" }, { AUXILIAR,\n\t * \"FZARACHO\", \"id-most\" }, { AUXILIAR, \"DGOLDARAZ\", \"id-most\"", "end": 8287, "score": 0.9953754544258118, "start": 8279, "tag": "NAME", "value": "FZARACHO" }, { "context": "XILIAR,\n\t * \"FZARACHO\", \"id-most\" }, { AUXILIAR, \"DGOLDARAZ\", \"id-most\" }\n\t */\n\t};\n\n\n\n\t\n\t\n\tpublic static Obje", "end": 8325, "score": 0.9981054663658142, "start": 8316, "tag": "NAME", "value": "DGOLDARAZ" }, { "context": "s = {\n\t\t\t// dato de alta a pedido de Raquel\n\t\t\t{ \"OVERA4\", \"id-most\", new Rango(\"1900.01.01\", \"2020.12.31\"", "end": 8457, "score": 0.9941306710243225, "start": 8451, "tag": "USERNAME", "value": "OVERA4" }, { "context": "new Rango(\"1900.01.01\", \"2020.12.31\") },\n\t\t\n\t\t\t{ \"JMAUGER\", \"ost\", new Rango(\"2015.05.01\", \"2012.12.31\")},\n", "end": 8528, "score": 0.9925882816314697, "start": 8521, "tag": "USERNAME", "value": "JMAUGER" }, { "context": "new Rango(\"2015.05.01\", \"2012.12.31\")},\n\t\t\t\n\t\t\t{ \"HALVAREZ\", \"79\", new Rango(\"1900.01.01\", \"2012.12.31\") },\n", "end": 8596, "score": 0.974982500076294, "start": 8588, "tag": "USERNAME", "value": "HALVAREZ" }, { "context": ", new Rango(\"1900.01.01\", \"2012.12.31\") },\n\n\t\t\t{ \"PROLON\", \"99\", new Rango(\"1900.01.01\", \"2013.05.31\") },\n", "end": 8659, "score": 0.9974989891052246, "start": 8653, "tag": "USERNAME", "value": "PROLON" }, { "context": "ew Rango(\"1900.01.01\", \"2013.05.31\") },\n\t\t\t\n\t\t\t{ \"RGIMENEZ\", \"18\", new Rango(\"1900.01.01\", \"2020.12.31\") },\n", "end": 8727, "score": 0.9984607100486755, "start": 8719, "tag": "USERNAME", "value": "RGIMENEZ" }, { "context": "\", new Rango(\"1900.01.01\", \"2020.12.31\") },\n\t\t\t{ \"RGIMENEZ6\", \"id-most\", new Rango(\"1900.01.01\", \"2020.12.31\"", "end": 8792, "score": 0.9994832277297974, "start": 8783, "tag": "USERNAME", "value": "RGIMENEZ6" }, { "context": "ew Rango(\"1900.01.01\", \"2020.12.31\") },\n\t\t\t\n\t\t\t{ \"LMOREL\", \"7\", new Rango(\"1900.01.01\", \"2020.12.31\") },\n\t", "end": 8863, "score": 0.9980936050415039, "start": 8857, "tag": "USERNAME", "value": "LMOREL" }, { "context": "\", new Rango(\"1900.01.01\", \"2020.12.31\") },\n\t\t\t{ \"LMOREL6\", \"id-most\", new Rango(\"1900.01.01\", \"2020.12.31\"", "end": 8925, "score": 0.9990881681442261, "start": 8918, "tag": "USERNAME", "value": "LMOREL6" }, { "context": "ew Rango(\"1900.01.01\", \"2020.12.31\") },\n\t\t\t\n\t\t\t{ \"LLOPEZ\", \"80\", new Rango(\"1900.01.01\", \"2020.12.31\") },\n", "end": 8996, "score": 0.9986753463745117, "start": 8990, "tag": "USERNAME", "value": "LLOPEZ" }, { "context": "\", new Rango(\"1900.01.01\", \"2020.12.31\") },\n\t\t\t{ \"DLOPEZ\", \"56\", new Rango(\"1900.01.01\", \"2013.07.31\") },\n", "end": 9058, "score": 0.9993021488189697, "start": 9052, "tag": "USERNAME", "value": "DLOPEZ" }, { "context": ", new Rango(\"1900.01.01\", \"2013.07.31\") },\n\n\t\t\t{ \"MEZARATE\", \"id-most\", new Rango(\"1900.01.01\", \"2020.12.31\"", "end": 9123, "score": 0.9991481900215149, "start": 9115, "tag": "USERNAME", "value": "MEZARATE" }, { "context": "\", new Rango(\"1900.01.01\", \"2020.12.31\") },\n\t\t\t{ \"MEZARATE6\", \"id-most\", new Rango(\"1900.01.01\", \"2020.12.31\"", "end": 9193, "score": 0.9532932043075562, "start": 9184, "tag": "USERNAME", "value": "MEZARATE6" }, { "context": "ew Rango(\"1900.01.01\", \"2020.12.31\") },\n\t\t\t\n\t\t\t{ \"FZARACHO\", \"id-most\", new Rango(\"1900.01.01\", \"2020.12.31\"", "end": 9266, "score": 0.813365638256073, "start": 9258, "tag": "NAME", "value": "FZARACHO" }, { "context": "\", new Rango(\"1900.01.01\", \"2020.12.31\") },\n\t\t\t{ \"DGOLDARAZ\", \"id-most\", new Rango(\"1900.01.01\", \"2020", "end": 9329, "score": 0.6497397422790527, "start": 9327, "tag": "USERNAME", "value": "DG" }, { "context": " new Rango(\"1900.01.01\", \"2020.12.31\") },\n\t\t\t{ \"DGOLDARAZ\", \"id-most\", new Rango(\"1900.01.01\", \"2020.12.31\"", "end": 9336, "score": 0.5779409408569336, "start": 9329, "tag": "NAME", "value": "OLDARAZ" }, { "context": "\", new Rango(\"1900.01.01\", \"2020.12.31\") },\n\t\t\t{ \"DBOSCHERT\", \"id-most\", new Rango(\"1900.01.01\", \"2020.12.31\"", "end": 9406, "score": 0.5879273414611816, "start": 9397, "tag": "USERNAME", "value": "DBOSCHERT" }, { "context": "\", new Rango(\"1900.01.01\", \"2020.12.31\") },\n\t\t\t{ \"DBOSCHER\", \"id-most\", new Rango(\"1900.01.01\", \"2020.12.31\"", "end": 9475, "score": 0.6885243654251099, "start": 9467, "tag": "USERNAME", "value": "DBOSCHER" }, { "context": "w Rango(\"1900.01.01\", \"2020.12.31\") },\n\t\t\t\n\n\t\t\t{ \"POJEDACEN\", \"id-most\", new Rango(\"1900.01.01\", \"2020.12.31\"", "end": 9550, "score": 0.8092361688613892, "start": 9541, "tag": "NAME", "value": "POJEDACEN" }, { "context": "\", new Rango(\"1900.01.01\", \"2020.12.31\") },\n\t\t\t{ \"POJEDA\", \"65\", new Rango(\"1900.01.01\", \"2020.12.31\") },\n", "end": 9617, "score": 0.7246540188789368, "start": 9611, "tag": "NAME", "value": "POJEDA" }, { "context": "\", new Rango(\"1900.01.01\", \"2020.12.31\") },\n\t\t\t{ \"POJEDA5\", \"id-most\", new Rango(\"1900.01.01\", \"2020.12.3", "end": 9678, "score": 0.5749223232269287, "start": 9673, "tag": "NAME", "value": "POJED" }, { "context": "w Rango(\"1900.01.01\", \"2020.12.31\") },\n\t\t\t{ \"POJEDA5\", \"id-most\", new Rango(\"1900.01.01\", \"2020.12.31\"", "end": 9680, "score": 0.7119259834289551, "start": 9678, "tag": "USERNAME", "value": "A5" }, { "context": "\", new Rango(\"1900.01.01\", \"2020.12.31\") },\n\t\t\t{ \"POJEDA3\", \"id-most\", new Rango(\"1900.01.01\", \"2020.1", "end": 9743, "score": 0.6247239112854004, "start": 9741, "tag": "NAME", "value": "PO" }, { "context": " new Rango(\"1900.01.01\", \"2020.12.31\") },\n\t\t\t{ \"POJEDA3\", \"id-most\", new Rango(\"1900.01.01\", \"2020.12", "end": 9744, "score": 0.550783097743988, "start": 9743, "tag": "USERNAME", "value": "J" }, { "context": "new Rango(\"1900.01.01\", \"2020.12.31\") },\n\t\t\t{ \"POJEDA3\", \"id-most\", new Rango(\"1900.01.01\", \"2020.12.3", "end": 9746, "score": 0.5143465995788574, "start": 9744, "tag": "NAME", "value": "ED" }, { "context": "w Rango(\"1900.01.01\", \"2020.12.31\") },\n\t\t\t{ \"POJEDA3\", \"id-most\", new Rango(\"1900.01.01\", \"2020.12.31\"", "end": 9748, "score": 0.731040894985199, "start": 9746, "tag": "USERNAME", "value": "A3" }, { "context": "ew Rango(\"1900.01.01\", \"2020.12.31\") },\n\t\t\t\n\t\t\t{ \"LCIBILS\", \"95\", new Rango(\"1900.01.01\", \"2020.12.31\") },\n", "end": 9820, "score": 0.8042274117469788, "start": 9813, "tag": "NAME", "value": "LCIBILS" }, { "context": "\", new Rango(\"1900.01.01\", \"2020.12.31\") },\n\t\t\t{ \"GORTIZ\", \"96\", new Rango(\"1900.01.01\", \"2020.12.31\") },\n", "end": 9882, "score": 0.7337241172790527, "start": 9876, "tag": "NAME", "value": "GORTIZ" }, { "context": "\", new Rango(\"1900.01.01\", \"2020.12.31\") },\n\t\t\t{ \"VRIVEROS\", \"id-most\", new Rango(\"2013.04.01\", \"2020.12.31\"", "end": 9946, "score": 0.8359020948410034, "start": 9938, "tag": "NAME", "value": "VRIVEROS" }, { "context": "\", new Rango(\"2013.04.01\", \"2020.12.31\") },\n\t\t\t{ \"OESPINOLA\", \"97\", new Rango(\"1900.01.01\", \"2020.12.31\") },\n", "end": 10016, "score": 0.8491995334625244, "start": 10007, "tag": "NAME", "value": "OESPINOLA" }, { "context": "\", new Rango(\"1900.01.01\", \"2020.12.31\") },\n\t\t\t{ \"ABOGADO\", \"id-most\", new Rango(\"1900.01.01\", \"2020.12.31\"", "end": 10079, "score": 0.9432211518287659, "start": 10072, "tag": "NAME", "value": "ABOGADO" }, { "context": "\", new Rango(\"1900.01.01\", \"2020.12.31\") },\n\t\t\t{ \"ABOGADOFDO\", \"id-most\", new Rango(\"1900.01.01\", \"2020.12.31\"", "end": 10150, "score": 0.6692104339599609, "start": 10140, "tag": "USERNAME", "value": "ABOGADOFDO" }, { "context": "ew Rango(\"1900.01.01\", \"2020.12.31\") },\n\t\t\t\n\t\t\t{ \"ADURE\", \"id-most\", new Rango(\"1900.01.01\", \"2020.12.", "end": 10433, "score": 0.5542178750038147, "start": 10431, "tag": "NAME", "value": "AD" }, { "context": "ew Rango(\"1900.01.01\", \"2020.12.31\") },\n\t\t\t\n\t\t\t{ \"VGONZALEZ\", \"id-most\", new Rango(\"1900.01.01\", \"2020.1", "end": 10505, "score": 0.6545885801315308, "start": 10501, "tag": "USERNAME", "value": "VGON" }, { "context": "ango(\"1900.01.01\", \"2020.12.31\") },\n\t\t\t\n\t\t\t{ \"VGONZALEZ\", \"id-most\", new Rango(\"1900.01.01\", \"2020.12.31\"", "end": 10510, "score": 0.6525234580039978, "start": 10505, "tag": "NAME", "value": "ZALEZ" }, { "context": "ango(\"1900.01.01\", \"2020.12.31\") },\n\t\t\t\n\t\t\t\n\t\t\t{ \"NCRESPI\", \"61\", new Rango(\"2013.08.01\", \"2020.12.31\") },\n", "end": 10586, "score": 0.8728402256965637, "start": 10579, "tag": "USERNAME", "value": "NCRESPI" }, { "context": "\", new Rango(\"2013.08.01\", \"2020.12.31\") },\n\t\t\t{ \"MANOLO\", \"5\", new Rango(\"2013.10.01\", \"2020.12.31\") },\n\t", "end": 10648, "score": 0.9700460433959961, "start": 10642, "tag": "NAME", "value": "MANOLO" }, { "context": "\", new Rango(\"2013.10.01\", \"2020.12.31\") },\n\t\t\t{ \"SCUEVAS\", \"8\", new Rango(\"2013.10.01\", \"2020.12.31\") },\n\t", "end": 10710, "score": 0.811271607875824, "start": 10703, "tag": "NAME", "value": "SCUEVAS" }, { "context": "\", new Rango(\"2013.10.01\", \"2020.12.31\") },\n\t\t\t{ \"CSANTACRUZ\", \"13\", new Rango(\"2013.10.01\", \"2020.12.31\") ", "end": 10772, "score": 0.6212847232818604, "start": 10765, "tag": "USERNAME", "value": "CSANTAC" }, { "context": "Rango(\"2013.10.01\", \"2020.12.31\") },\n\t\t\t{ \"CSANTACRUZ\", \"13\", new Rango(\"2013.10.01\", \"2020.12.31\") },\n", "end": 10775, "score": 0.8203049302101135, "start": 10772, "tag": "NAME", "value": "RUZ" }, { "context": ", new Rango(\"2013.10.01\", \"2020.12.31\") },\n\n\t\t\t{ \"EORTELLA4\", \"id-most\", new Rango(\"2013.12.01\", \"2020.12.31", "end": 10840, "score": 0.6416783928871155, "start": 10832, "tag": "USERNAME", "value": "EORTELLA" }, { "context": "\", new Rango(\"2013.12.01\", \"2020.12.31\") },\n\t\t\t{ \"EORTELLA6\", \"id-most\", new Rango(\"2013.12.01\", \"2020.12.31\"", "end": 10981, "score": 0.9964789152145386, "start": 10972, "tag": "USERNAME", "value": "EORTELLA6" }, { "context": "ew Rango(\"2013.12.01\", \"2020.12.31\") },\n\t\t\t\n\t\t\t{ \"HINSFRAN\", \"118\", new Rango(\"2014.01.01\", \"2020.12.31\") },", "end": 11054, "score": 0.7937078475952148, "start": 11046, "tag": "USERNAME", "value": "HINSFRAN" }, { "context": "8\", new Rango(\"2014.01.01\", \"2020.12.31\") },\n\t\t\t// Natalia me pidio\n\t\t\t{ \"PROLON\", \"99\", new Rango(\"2014.01.", "end": 11118, "score": 0.9947482943534851, "start": 11111, "tag": "NAME", "value": "Natalia" }, { "context": "1\", \"2020.12.31\") },\n\t\t\t// Natalia me pidio\n\t\t\t{ \"PROLON\", \"99\", new Rango(\"2014.01.01\", \"2020.12.31\") },\n", "end": 11140, "score": 0.9786622524261475, "start": 11134, "tag": "USERNAME", "value": "PROLON" }, { "context": "\", new Rango(\"2014.01.01\", \"2020.12.31\") },\n\t\t\t{ \"DGAONA\", \"54\", new Rango(\"2014.01.01\", \"2020.12.31\") },\n", "end": 11202, "score": 0.8445801734924316, "start": 11196, "tag": "USERNAME", "value": "DGAONA" }, { "context": "tradorPorcentaje = {\n\t\t\t{ \"54\", 0.012, 0.012 }, // Dahiana Gaona\n\t\t\t{ \"73\", 0.015, 0.013 }, // Richard Britos\n\t\t\t{", "end": 13592, "score": 0.9998491406440735, "start": 13579, "tag": "NAME", "value": "Dahiana Gaona" }, { "context": " }, // Dahiana Gaona\n\t\t\t{ \"73\", 0.015, 0.013 }, // Richard Britos\n\t\t\t{ \"99\", 0.02, 0.02 }, // Pamela Rolon\n\t\t\t{ \"22", "end": 13637, "score": 0.9998504519462585, "start": 13623, "tag": "NAME", "value": "Richard Britos" }, { "context": "3 }, // Richard Britos\n\t\t\t{ \"99\", 0.02, 0.02 }, // Pamela Rolon\n\t\t\t{ \"22\", 0.025, 0.025 }, // Miguel Otazu\n\t\t\t{ \"", "end": 13678, "score": 0.9998222589492798, "start": 13666, "tag": "NAME", "value": "Pamela Rolon" }, { "context": "2 }, // Pamela Rolon\n\t\t\t{ \"22\", 0.025, 0.025 }, // Miguel Otazu\n\t\t\t{ \"20\", 0.025, 0.025 }, // Julio Duarte\n\t\t\t{ \"", "end": 13721, "score": 0.9997811913490295, "start": 13709, "tag": "NAME", "value": "Miguel Otazu" }, { "context": "5 }, // Miguel Otazu\n\t\t\t{ \"20\", 0.025, 0.025 }, // Julio Duarte\n\t\t\t{ \"29\", 0.025, 0.025 }, // Hugo Fernandez\n\t\t\t{", "end": 13764, "score": 0.9998019337654114, "start": 13752, "tag": "NAME", "value": "Julio Duarte" }, { "context": "5 }, // Julio Duarte\n\t\t\t{ \"29\", 0.025, 0.025 }, // Hugo Fernandez\n\t\t\t{ \"94\", 0.02, 0.018 }, // Alverto Mendoza\n\t\t\t{", "end": 13809, "score": 0.9998313784599304, "start": 13795, "tag": "NAME", "value": "Hugo Fernandez" }, { "context": " }, // Hugo Fernandez\n\t\t\t{ \"94\", 0.02, 0.018 }, // Alverto Mendoza\n\t\t\t{ \"68\", 0.025, 0.025 }, // Pablo Jara\n\t\t\t{ \"11", "end": 13854, "score": 0.9997935891151428, "start": 13839, "tag": "NAME", "value": "Alverto Mendoza" }, { "context": ", // Alverto Mendoza\n\t\t\t{ \"68\", 0.025, 0.025 }, // Pablo Jara\n\t\t\t{ \"116\", 0.025, 0.025 }, // Miguel Acosta\n\t\t\t\n", "end": 13895, "score": 0.9997850656509399, "start": 13885, "tag": "NAME", "value": "Pablo Jara" }, { "context": "25 }, // Pablo Jara\n\t\t\t{ \"116\", 0.025, 0.025 }, // Miguel Acosta\n\t\t\t\n//\t\t\t{ \"135\", 0.025, 0.025 }, // OSCAR CARBAL", "end": 13940, "score": 0.9998260140419006, "start": 13927, "tag": "NAME", "value": "Miguel Acosta" }, { "context": "Miguel Acosta\n\t\t\t\n//\t\t\t{ \"135\", 0.025, 0.025 }, // OSCAR CARBALLO\n\t\t\t{ \"133\", 0.025, 0.025 }, // ADRIAN MARTIN AGUI", "end": 13992, "score": 0.9997332692146301, "start": 13978, "tag": "NAME", "value": "OSCAR CARBALLO" }, { "context": ", // OSCAR CARBALLO\n\t\t\t{ \"133\", 0.025, 0.025 }, // ADRIAN MARTIN AGUILERA\n\t\t\t\n\t\t\t{ \"9\", 0.025, 0.025 }, // SIXTO SANCH", "end": 14041, "score": 0.6058942079544067, "start": 14024, "tag": "NAME", "value": "ADRIAN MARTIN AGU" }, { "context": "\t\t\t{ \"133\", 0.025, 0.025 }, // ADRIAN MARTIN AGUILERA\n\t\t\t\n\t\t\t{ \"9\", 0.025, 0.025 }, // SIXTO SANCHEZ\n\t\t", "end": 14046, "score": 0.5826473236083984, "start": 14043, "tag": "NAME", "value": "ERA" }, { "context": "N MARTIN AGUILERA\n\t\t\t\n\t\t\t{ \"9\", 0.025, 0.025 }, // SIXTO SANCHEZ\n\t\t\t{ \"55\", 0.0050, 0.0050 }, // JORGE", "end": 14081, "score": 0.5360015630722046, "start": 14080, "tag": "NAME", "value": "S" }, { "context": ", // SIXTO SANCHEZ\n\t\t\t{ \"55\", 0.0050, 0.0050 }, // JORGE VAZQUEZ (0.50% para todas las ventas)\n\n\n\t\t\t//", "end": 14127, "score": 0.6037673354148865, "start": 14126, "tag": "NAME", "value": "J" }, { "context": " SIXTO SANCHEZ\n\t\t\t{ \"55\", 0.0050, 0.0050 }, // JORGE VAZQUEZ (0.50% para todas las ventas)\n\n\n\t\t\t// Esto se car", "end": 14139, "score": 0.5896619558334351, "start": 14129, "tag": "NAME", "value": "GE VAZQUEZ" }, { "context": "// Los Crespi\n\t\t\t/* aca\n\t\t\t{ \"116\", 0.0, 0.0 }, // Miguel Acosta\n\t\t\t{ \"102\", 0.0, 0.0 }, // Rolando Florentin\n\t\t\t{", "end": 14332, "score": 0.9998913407325745, "start": 14319, "tag": "NAME", "value": "Miguel Acosta" }, { "context": "0.0 }, // Miguel Acosta\n\t\t\t{ \"102\", 0.0, 0.0 }, // Rolando Florentin\n\t\t\t{ \"79\", 0.0, 0.0 }, // Hernan Alvarez\n\t\t\t{ \"81", "end": 14377, "score": 0.9998789429664612, "start": 14360, "tag": "NAME", "value": "Rolando Florentin" }, { "context": " }, // Rolando Florentin\n\t\t\t{ \"79\", 0.0, 0.0 }, // Hernan Alvarez\n\t\t\t{ \"81\", 0.0, 0.0 }, // Hugo Gimenez\n\t\t\t{ \"117\"", "end": 14418, "score": 0.9998676180839539, "start": 14404, "tag": "NAME", "value": "Hernan Alvarez" }, { "context": "0.0 }, // Hernan Alvarez\n\t\t\t{ \"81\", 0.0, 0.0 }, // Hugo Gimenez\n\t\t\t{ \"117\", 0.0, 0.0 }, // Matto Arturo\n\t\t\t{ \"101", "end": 14457, "score": 0.9998422265052795, "start": 14445, "tag": "NAME", "value": "Hugo Gimenez" }, { "context": " 0.0 }, // Hugo Gimenez\n\t\t\t{ \"117\", 0.0, 0.0 }, // Matto Arturo\n\t\t\t{ \"101\", 0.0, 0.0 }, // Sanches Higinio\n\t\t\t{ \"", "end": 14497, "score": 0.9998727440834045, "start": 14485, "tag": "NAME", "value": "Matto Arturo" }, { "context": " 0.0 }, // Matto Arturo\n\t\t\t{ \"101\", 0.0, 0.0 }, // Sanches Higinio\n\t\t\t{ \"55\", 0.0, 0.0 }, // Jorge Velazquez\n\t\t\t{ \"7", "end": 14540, "score": 0.9997515678405762, "start": 14525, "tag": "NAME", "value": "Sanches Higinio" }, { "context": ".0 }, // Sanches Higinio\n\t\t\t{ \"55\", 0.0, 0.0 }, // Jorge Velazquez\n\t\t\t{ \"76\", 0.0, 0.0 }, // Librada Vera\n\t\t\t{ \"69\",", "end": 14582, "score": 0.999864935874939, "start": 14567, "tag": "NAME", "value": "Jorge Velazquez" }, { "context": ".0 }, // Jorge Velazquez\n\t\t\t{ \"76\", 0.0, 0.0 }, // Librada Vera\n\t\t\t{ \"69\", 0.0, 0.0 }, // Luis Benitez\n\t\t\t{ \"68\",", "end": 14621, "score": 0.9582083821296692, "start": 14609, "tag": "NAME", "value": "Librada Vera" }, { "context": ", 0.0 }, // Librada Vera\n\t\t\t{ \"69\", 0.0, 0.0 }, // Luis Benitez\n\t\t\t{ \"68\", 0.0, 0.0 }, // Pablo Jara\n\t\t\t*/\n\t};\n\t\n", "end": 14660, "score": 0.9998366236686707, "start": 14648, "tag": "NAME", "value": "Luis Benitez" }, { "context": ", 0.0 }, // Luis Benitez\n\t\t\t{ \"68\", 0.0, 0.0 }, // Pablo Jara\n\t\t\t*/\n\t};\n\t\n\n\t// Los Crespi, Id de Vendedor y el ", "end": 14697, "score": 0.999862790107727, "start": 14687, "tag": "NAME", "value": "Pablo Jara" }, { "context": "t[][] idVendedorLosCrespi = {\n\t//\t{ \"116\", 1 }, // Miguel Acosta\n\t\t{ \"102\", 1 }, // Rolando Florentin\n\t\t{ \"79\", 1 ", "end": 14856, "score": 0.9998724460601807, "start": 14843, "tag": "NAME", "value": "Miguel Acosta" }, { "context": "\t{ \"116\", 1 }, // Miguel Acosta\n\t\t{ \"102\", 1 }, // Rolando Florentin\n\t\t{ \"79\", 1 }, // Hernan Alvarez\n\t\t{ \"81\", 1 }, /", "end": 14893, "score": 0.9998745918273926, "start": 14876, "tag": "NAME", "value": "Rolando Florentin" }, { "context": "\"102\", 1 }, // Rolando Florentin\n\t\t{ \"79\", 1 }, // Hernan Alvarez\n\t\t{ \"81\", 1 }, // Hugo Gimenez\n\t\t{ \"117\", 1}, // ", "end": 14926, "score": 0.9998362064361572, "start": 14912, "tag": "NAME", "value": "Hernan Alvarez" }, { "context": "\t\t{ \"79\", 1 }, // Hernan Alvarez\n\t\t{ \"81\", 1 }, // Hugo Gimenez\n\t\t{ \"117\", 1}, // Matto Arturo\n\t\t{ \"135\", 1}, // ", "end": 14957, "score": 0.9997828602790833, "start": 14945, "tag": "NAME", "value": "Hugo Gimenez" }, { "context": "z\n\t\t{ \"81\", 1 }, // Hugo Gimenez\n\t\t{ \"117\", 1}, // Matto Arturo\n\t\t{ \"135\", 1}, // Oscar Carballo\n\t\t\n\t\t{ \"101\", 1 ", "end": 14988, "score": 0.9998463988304138, "start": 14976, "tag": "NAME", "value": "Matto Arturo" }, { "context": "z\n\t\t{ \"117\", 1}, // Matto Arturo\n\t\t{ \"135\", 1}, // Oscar Carballo\n\t\t\n\t\t{ \"101\", 1 }, // Sanches Higinio\n//\t\tpaso a ", "end": 15021, "score": 0.9998918175697327, "start": 15007, "tag": "NAME", "value": "Oscar Carballo" }, { "context": "\"135\", 1}, // Oscar Carballo\n\t\t\n\t\t{ \"101\", 1 }, // Sanches Higinio\n//\t\tpaso a venderores del mostrador para poder po", "end": 15059, "score": 0.9998925924301147, "start": 15044, "tag": "NAME", "value": "Sanches Higinio" }, { "context": "misión fija para todo lo demas\n//\t\t{ \"55\", 1 }, // Jorge Velazquez\n\t\t{ \"76\", 1 }, // Librada Vera\n\t\t{ \"69\", 1}, // L", "end": 15187, "score": 0.999882698059082, "start": 15172, "tag": "NAME", "value": "Jorge Velazquez" }, { "context": "\t{ \"55\", 1 }, // Jorge Velazquez\n\t\t{ \"76\", 1 }, // Librada Vera\n\t\t{ \"69\", 1}, // Luis Benitez\n\t\t{ \"141\", 1}, // R", "end": 15218, "score": 0.9998828768730164, "start": 15206, "tag": "NAME", "value": "Librada Vera" }, { "context": "ez\n\t\t{ \"76\", 1 }, // Librada Vera\n\t\t{ \"69\", 1}, // Luis Benitez\n\t\t{ \"141\", 1}, // Romero Nidia\n\t\t{ \"138\", 1}, // ", "end": 15248, "score": 0.9998928308486938, "start": 15236, "tag": "NAME", "value": "Luis Benitez" }, { "context": "ra\n\t\t{ \"69\", 1}, // Luis Benitez\n\t\t{ \"141\", 1}, // Romero Nidia\n\t\t{ \"138\", 1}, // Ramos Luis\n\t\t//{ \"68\", 1 }, // ", "end": 15279, "score": 0.9998974800109863, "start": 15267, "tag": "NAME", "value": "Romero Nidia" }, { "context": "z\n\t\t{ \"141\", 1}, // Romero Nidia\n\t\t{ \"138\", 1}, // Ramos Luis\n\t\t//{ \"68\", 1 }, // Pablo Jara\n};\n\t\n\t\n\t// comisió", "end": 15308, "score": 0.999887228012085, "start": 15298, "tag": "NAME", "value": "Ramos Luis" }, { "context": "a\n\t\t{ \"138\", 1}, // Ramos Luis\n\t\t//{ \"68\", 1 }, // Pablo Jara\n};\n\t\n\t\n\t// comisión especial de algunos vendedore", "end": 15339, "score": 0.9998894929885864, "start": 15329, "tag": "NAME", "value": "Pablo Jara" }, { "context": "edorProveedor = {\n\t\t{\"55-10219\", 0.0091, 0.0078, \"Jorge Velazquez, BATEBOL LTDA.INDUSTRIA DE BATERIAS\"},\n\t\t{\"55-570", "end": 15535, "score": 0.9998810887336731, "start": 15520, "tag": "NAME", "value": "Jorge Velazquez" }, { "context": "IA DE BATERIAS\"},\n\t\t{\"55-57088\", 0.0180, 0.0160, \"Jorge Velazquez, JOHNSON CONTROLS\"},\n\t\t{\"55-86299\", 0.0230, 0.020", "end": 15622, "score": 0.9998866319656372, "start": 15607, "tag": "NAME", "value": "Jorge Velazquez" }, { "context": "HNSON CONTROLS\"},\n\t\t{\"55-86299\", 0.0230, 0.0200, \"Jorge Velazquez, JOHNSON CONTROLS COLOMBIA S.A.S\"},\n\t\t{\"55-10501\"", "end": 15691, "score": 0.9998818635940552, "start": 15676, "tag": "NAME", "value": "Jorge Velazquez" }, { "context": "COLOMBIA S.A.S\"},\n\t\t{\"55-10501\", 0.0100, 0.0100, \"Jorge Velazquez, PUMA ENERGY PARAGUAY\"},\n\t\t// esto ya está en mar", "end": 15775, "score": 0.9998780488967896, "start": 15760, "tag": "NAME", "value": "Jorge Velazquez" }, { "context": "centaje especial\n\t\t//\t\t{\"55-xx\", 0.0050, 0.0050, \"Jorge Velazquez, CASTROL\"},\n\t\t{\"TD-10501\", 0.0100, 0.0100, \"Para ", "end": 15901, "score": 0.9998807907104492, "start": 15886, "tag": "NAME", "value": "Jorge Velazquez" }, { "context": "xxxxidMarcasVendedorAsignado = {\n {\"250\", \"RAIDEN\", \"79\", new String[]{\"73\",\"102\"} }, // Raiden - H", "end": 17373, "score": 0.9998072981834412, "start": 17367, "tag": "NAME", "value": "RAIDEN" }, { "context": "0\", \"RAIDEN\", \"79\", new String[]{\"73\",\"102\"} }, // Raiden - Hernan Alvarez, comparte con Rolando\n {\"", "end": 17419, "score": 0.9998590350151062, "start": 17413, "tag": "NAME", "value": "Raiden" }, { "context": "EN\", \"79\", new String[]{\"73\",\"102\"} }, // Raiden - Hernan Alvarez, comparte con Rolando\n {\"249\", \"HELIAR\", \"", "end": 17436, "score": 0.9998640418052673, "start": 17422, "tag": "NAME", "value": "Hernan Alvarez" }, { "context": "an Alvarez, comparte con Rolando\n {\"249\", \"HELIAR\", \"79\", new String[]{\"73\",\"102\"} }, // Heliar - H", "end": 17482, "score": 0.9994990825653076, "start": 17476, "tag": "NAME", "value": "HELIAR" }, { "context": "9\", \"HELIAR\", \"79\", new String[]{\"73\",\"102\"} }, // Heliar - Hernan Alvarez, comparte con Rolando\n \n ", "end": 17528, "score": 0.9997698068618774, "start": 17522, "tag": "NAME", "value": "Heliar" }, { "context": "AR\", \"79\", new String[]{\"73\",\"102\"} }, // Heliar - Hernan Alvarez, comparte con Rolando\n \n {\"234\", \"T", "end": 17545, "score": 0.9998642802238464, "start": 17531, "tag": "NAME", "value": "Hernan Alvarez" }, { "context": "\"102\"} }, // Heliar - Hernan Alvarez, comparte con Rolando\n \n {\"234\", \"TOYO\", \"102\", new Strin", "end": 17567, "score": 0.9902147054672241, "start": 17560, "tag": "NAME", "value": "Rolando" }, { "context": "z, comparte con Rolando\n \n {\"234\", \"TOYO\", \"102\", new String[]{\"79\", \"73\"} }, // Toyo - Ro", "end": 17598, "score": 0.9978164434432983, "start": 17594, "tag": "NAME", "value": "TOYO" }, { "context": "OYO\", \"102\", new String[]{\"79\", \"73\"} }, // Toyo - Rolando Britos, comparte con Hernan y Richard\n {\"248\", \"P", "end": 17660, "score": 0.9998677372932434, "start": 17646, "tag": "NAME", "value": "Rolando Britos" }, { "context": "\", \"73\"} }, // Toyo - Rolando Britos, comparte con Hernan y Richard\n {\"248\", \"PLATIN\", \"102\", new St", "end": 17681, "score": 0.9988660216331482, "start": 17675, "tag": "NAME", "value": "Hernan" }, { "context": "}, // Toyo - Rolando Britos, comparte con Hernan y Richard\n {\"248\", \"PLATIN\", \"102\", new String[]{\"79", "end": 17691, "score": 0.9996447563171387, "start": 17684, "tag": "NAME", "value": "Richard" }, { "context": "s, comparte con Hernan y Richard\n {\"248\", \"PLATIN\", \"102\", new String[]{\"79\", \"73\"} }, // Platin -", "end": 17715, "score": 0.9979092478752136, "start": 17709, "tag": "NAME", "value": "PLATIN" }, { "context": "\", \"102\", new String[]{\"79\", \"73\"} }, // Platin - Richard Britos, comparte con Hernan y Richard\n\t};\n\n\n\t\t\n\tpublic s", "end": 17780, "score": 0.999829113483429, "start": 17766, "tag": "NAME", "value": "Richard Britos" }, { "context": "\"73\"} }, // Platin - Richard Britos, comparte con Hernan y Richard\n\t};\n\n\n\t\t\n\tpublic static Hashtable<Strin", "end": 17801, "score": 0.9944044947624207, "start": 17795, "tag": "NAME", "value": "Hernan" }, { "context": " // Platin - Richard Britos, comparte con Hernan y Richard\n\t};\n\n\n\t\t\n\tpublic static Hashtable<String, Integer", "end": 17811, "score": 0.999242901802063, "start": 17804, "tag": "NAME", "value": "Richard" }, { "context": "ing[][] clientesNoConsiderados = {\n\t\t\t{ \"54481\", \"Arandu Repuestos\" },\n\t\t\t{ \"57562\", \"Katupyry Repuestos S.A.\" } };\n", "end": 19328, "score": 0.9995819926261902, "start": 19312, "tag": "NAME", "value": "Arandu Repuestos" }, { "context": "\t\t{ \"54481\", \"Arandu Repuestos\" },\n\t\t\t{ \"57562\", \"Katupyry Repuestos S.A.\" } };\n\n\n\tpublic static boolean esC", "end": 19356, "score": 0.9975227117538452, "start": 19348, "tag": "NAME", "value": "Katupyry" }, { "context": "ral Repuestos S.A.\", 0.005, true },\n\t\t\t{ \"3123\", \"Brianza S.A.\", 0.005, true }, \n\t\t\t{ \"23\", \"Todo Mercedes\", 0.", "end": 19876, "score": 0.9080989956855774, "start": 19865, "tag": "NAME", "value": "Brianza S.A" }, { "context": "123\", \"Brianza S.A.\", 0.005, true }, \n\t\t\t{ \"23\", \"Todo Mercedes\", 0.005, true } ,\n\t\t\t{ \"5826\", \"Tractopar\", 0.01,", "end": 19921, "score": 0.997520923614502, "start": 19908, "tag": "NAME", "value": "Todo Mercedes" }, { "context": "\", \"Todo Mercedes\", 0.005, true } ,\n\t\t\t{ \"5826\", \"Tractopar\", 0.01, false}, \n\t\t// \t{ \"2618\", \"Neumatec\", 0.01", "end": 19963, "score": 0.9819402694702148, "start": 19954, "tag": "NAME", "value": "Tractopar" }, { "context": "26\", \"Tractopar\", 0.01, false}, \n\t\t// \t{ \"2618\", \"Neumatec\", 0.01, false} \n\t\t\t};\n\n\tpublic static double getP", "end": 20006, "score": 0.9945945739746094, "start": 19998, "tag": "NAME", "value": "Neumatec" }, { "context": "ePorProveedor.put(\"54300\", new Object[] {\"54300\",\"ZF SACHS ALEMANIA\",grupoPorcentaje0, \"Grupo 0\"});\n\t\tporcentajePorPr", "end": 32837, "score": 0.9580543041229248, "start": 32820, "tag": "NAME", "value": "ZF SACHS ALEMANIA" }, { "context": "ePorProveedor.put(\"10122\", new Object[] {\"10122\",\"FRUM\",grupoPorcentaje0, \"Grupo 0\"});\n\n\n\t\tporcentajePor", "end": 32935, "score": 0.7611753940582275, "start": 32931, "tag": "NAME", "value": "FRUM" }, { "context": "ePorProveedor.put(\"10110\", new Object[] {\"10110\",\"MAR ROLAMENTOS\",grupoPorcentaje1, \"Grupo 1\"});\n\t\tporcentajePorPr", "end": 33045, "score": 0.9953909516334534, "start": 33031, "tag": "NAME", "value": "MAR ROLAMENTOS" }, { "context": "(\"10483\", new Object[] {\"10483\",\"INSTALADORA SAO MARCOS LT\",grupoPorcentaje1, \"Grupo 1\"});\n\t\tporcentajePo", "end": 33161, "score": 0.7607444524765015, "start": 33156, "tag": "NAME", "value": "ARCOS" }, { "context": "ePorProveedor.put(\"54501\", new Object[] {\"54501\",\"FEBI BILSTEIN ALEMANIA\",grupoPorcentaje1, \"Grupo 1\"});\n\t\tporcentajePorPr", "end": 33399, "score": 0.979925274848938, "start": 33377, "tag": "NAME", "value": "FEBI BILSTEIN ALEMANIA" }, { "context": "ePorProveedor.put(\"53760\", new Object[] {\"53760\",\"GARRET\",grupoPorcentaje1, \"Grupo 1\"});\n\t\tporcentajePorPr", "end": 33499, "score": 0.9602634906768799, "start": 33493, "tag": "NAME", "value": "GARRET" }, { "context": "rProveedor.put(\"10108\", new Object[] {\"10108\",\"AUTOLINEA HUBNER\",grupoPorcentaje1, \"Grupo 1\"});\n\t\tporcentajePorPr", "end": 33934, "score": 0.9988796710968018, "start": 33921, "tag": "NAME", "value": "OLINEA HUBNER" }, { "context": "ePorProveedor.put(\"58944\", new Object[] {\"58944\",\"AFFINIA URUGUAY\",grupoPorcentaje2, \"Grupo 2\"});\n\t\tporcentajePorPr", "end": 35508, "score": 0.9306472539901733, "start": 35493, "tag": "NAME", "value": "AFFINIA URUGUAY" }, { "context": "ePorProveedor.put(\"10424\", new Object[] {\"10424\",\"Biagio Dell'Agll & CIA Ltda.\",grupoPorcentaje2, \"Grupo 2\"});\n\t", "end": 35714, "score": 0.8668165802955627, "start": 35703, "tag": "NAME", "value": "Biagio Dell" }, { "context": "ePorProveedor.put(\"79094\", new Object[] {\"79094\",\"MAHLE FILTROS BRASIL\",grupoPorcentaje2, \"Grupo 2\"});\n\t\tporcentajePorPr", "end": 35845, "score": 0.9713541865348816, "start": 35825, "tag": "NAME", "value": "MAHLE FILTROS BRASIL" }, { "context": "ePorProveedor.put(\"80103\", new Object[] {\"80103\",\"MAHLE SINGAPORE\",grupoPorcentaje2, \"Grupo 2\"});\n\t\tporcentajePorPr", "end": 35954, "score": 0.9868898987770081, "start": 35939, "tag": "NAME", "value": "MAHLE SINGAPORE" }, { "context": "---------------\\n\";\n\n\t\tString linea = \"\";\n\n\t\t// {\"HALVAREZ\", \"79\", new Rango(\"1900.01.01\", \"2012.12.31\")},\n\t", "end": 38605, "score": 0.7513705492019653, "start": 38597, "tag": "USERNAME", "value": "HALVAREZ" }, { "context": "BI\"},\n\t\t{\"10675\",\"COOPER TIRE & RU\"},\n\t\t{\"10204\",\"FILTROS HS de Si\"},\n\t\t{\"54505\",\"GITI TIRE CUBIER\"},\n\t\t{\"53910\",\"GR", "end": 39771, "score": 0.9935398697853088, "start": 39755, "tag": "NAME", "value": "FILTROS HS de Si" }, { "context": "UE\"},\n\t\t{\"10673\",\"ITOCHU CORPORATI\"},\n\t\t{\"10730\",\"J B IMPORTACIONE\"},\n\t\t{\"57088\",\"JOHNSON CONTROLS\"},\n\t\t{\"86299\",\"JO", "end": 39927, "score": 0.998726487159729, "start": 39911, "tag": "NAME", "value": "J B IMPORTACIONE" }, { "context": "TI\"},\n\t\t{\"10730\",\"J B IMPORTACIONE\"},\n\t\t{\"57088\",\"JOHNSON CONTROLS\"},\n\t\t{\"86299\",\"JOHNSON CONTROLS\"},\n\t\t{\"74605\",\"MA", "end": 39959, "score": 0.9997968077659607, "start": 39943, "tag": "NAME", "value": "JOHNSON CONTROLS" }, { "context": "NE\"},\n\t\t{\"57088\",\"JOHNSON CONTROLS\"},\n\t\t{\"86299\",\"JOHNSON CONTROLS\"},\n\t\t{\"74605\",\"MAHLE ALEMANIA\"},\n\t\t{\"79094\",\"MAHL", "end": 39991, "score": 0.9997509121894836, "start": 39975, "tag": "NAME", "value": "JOHNSON CONTROLS" }, { "context": "LS\"},\n\t\t{\"86299\",\"JOHNSON CONTROLS\"},\n\t\t{\"74605\",\"MAHLE ALEMANIA\"},\n\t\t{\"79094\",\"MAHLE FILTROS BR\"},\n\t\t{\"10689\",\"PE", "end": 40021, "score": 0.9998595118522644, "start": 40007, "tag": "NAME", "value": "MAHLE ALEMANIA" }, { "context": "ROLS\"},\n\t\t{\"74605\",\"MAHLE ALEMANIA\"},\n\t\t{\"79094\",\"MAHLE FILTROS BR\"},\n\t\t{\"10689\",\"PEKO INCORPORATI\"},\n\t\t{\"10718\",\"PE", "end": 40053, "score": 0.9996863603591919, "start": 40037, "tag": "NAME", "value": "MAHLE FILTROS BR" }, { "context": "BR\"},\n\t\t{\"10689\",\"PEKO INCORPORATI\"},\n\t\t{\"10718\",\"PENTIUS AUTOMOTI\"},\n\t\t{\"10662\",\"SOFAPE S/A\"},\n\t\t{\"10672\",\"TECNECO ", "end": 40117, "score": 0.9834121465682983, "start": 40101, "tag": "NAME", "value": "PENTIUS AUTOMOTI" }, { "context": "TI\"},\n\t\t{\"10718\",\"PENTIUS AUTOMOTI\"},\n\t\t{\"10662\",\"SOFAPE S/A\"},\n\t\t{\"10672\",\"TECNECO FILTERS\"},\n\t\t{\"10696\",", "end": 40139, "score": 0.7178584933280945, "start": 40133, "tag": "NAME", "value": "SOFAPE" }, { "context": "I\"},\n\t\t{\"10662\",\"SOFAPE S/A\"},\n\t\t{\"10672\",\"TECNECO FILTERS\"},\n\t\t{\"10696\",\"VALVOLINE ARGENT\"},\n\t\t{\"58253\",\"YI", "end": 40174, "score": 0.5181820392608643, "start": 40167, "tag": "NAME", "value": "FILTERS" }, { "context": "S/A\"},\n\t\t{\"10672\",\"TECNECO FILTERS\"},\n\t\t{\"10696\",\"VALVOLINE ARGENT\"},\n\t\t{\"58253\",\"YIGITAKU\"},\n\t\t{\"10501\",\"PUMA ENERG", "end": 40206, "score": 0.9998871684074402, "start": 40190, "tag": "NAME", "value": "VALVOLINE ARGENT" }, { "context": "icasNoComision = {\n\t//\t{\"9\", fabricasNoComision, \"Sixto Sanchez\"},\n\t\t/* desde Julio 2015\n\t\t{\"31\", fabricasNoComis", "end": 40442, "score": 0.9995660781860352, "start": 40429, "tag": "NAME", "value": "Sixto Sanchez" }, { "context": "/* desde Julio 2015\n\t\t{\"31\", fabricasNoComision, \"Carlos Ortiz\"},\n\t\t{\"27\", fabricasNoComision, \"Diego Ferreira\"}", "end": 40510, "score": 0.9998896718025208, "start": 40498, "tag": "NAME", "value": "Carlos Ortiz" }, { "context": "n, \"Carlos Ortiz\"},\n\t\t{\"27\", fabricasNoComision, \"Diego Ferreira\"},\n\t\t{\"12\", fabricasNoComision, \"Gabriel Nunez\"},", "end": 40558, "score": 0.9998828768730164, "start": 40544, "tag": "NAME", "value": "Diego Ferreira" }, { "context": " \"Diego Ferreira\"},\n\t\t{\"12\", fabricasNoComision, \"Gabriel Nunez\"},\n\t\t{\"25\", fabricasNoComision, \"Lorenzo Risso\"},", "end": 40605, "score": 0.9998871684074402, "start": 40592, "tag": "NAME", "value": "Gabriel Nunez" }, { "context": ", \"Gabriel Nunez\"},\n\t\t{\"25\", fabricasNoComision, \"Lorenzo Risso\"},\n\t\t{\"133\", fabricasNoComision, \"ADRIAN MARTIN A", "end": 40652, "score": 0.9998831748962402, "start": 40639, "tag": "NAME", "value": "Lorenzo Risso" }, { "context": " \"Lorenzo Risso\"},\n\t\t{\"133\", fabricasNoComision, \"ADRIAN MARTIN AGUILERA\"},\n\t\t*/\n\t\t{\"135\", fabricasNoComision, \"OSCAR CARB", "end": 40709, "score": 0.9998491406440735, "start": 40687, "tag": "NAME", "value": "ADRIAN MARTIN AGUILERA" }, { "context": "N AGUILERA\"},\n\t\t*/\n\t\t{\"135\", fabricasNoComision, \"OSCAR CARBALLO\"},\n\t\t{\"4\", fabricasNoComision, \"ROQUE AMARILLA\"},", "end": 40763, "score": 0.9998747706413269, "start": 40749, "tag": "NAME", "value": "OSCAR CARBALLO" }, { "context": ", \"OSCAR CARBALLO\"},\n\t\t{\"4\", fabricasNoComision, \"ROQUE AMARILLA\"},\n\t\t\n\t};\n\n\t// fabricas con comisión especial en ", "end": 40810, "score": 0.9998822212219238, "start": 40796, "tag": "NAME", "value": "ROQUE AMARILLA" } ]
null
[]
package com.yhaguy.util.comision; import java.text.DecimalFormat; import java.text.NumberFormat; import java.util.*; import com.coreweb.extras.csv.CSV; import com.coreweb.util.Misc; public class Cons { /* * SQL usado para sacar la info del mes ***** OJO: Son 2 sql, uno para las * cobranzas, y otro que suma las ventas del mes que NO estan cobradas, * ayuda para obtener la meta. * * * PASOS 1. Ejecutar los 2 (dos) sql (ventas y cobranzas) -----[no]. * 2. (deprecated) Armar 1 cvs con los 2 sql * 3. LLevar a LibreOffice, separador TAB * 4. Poner el campo Mes arriba * 5. Sumar los campos numericos * 6. Guardar como ods * 7. exportar a cvs * 7. Editar cvs, quitar los ", 00:00:00.000" por nada * 8. Quitar compos [null] por 0 * 9. Quitar las Ñ por N y puede que algún ñ en caracater raro * 10. ES S.A. (1225) para Sixto. Lo que hago es de las cobranzas, quitar todos los * movimientos de ES S.A. y poner como Usuario y Vendedor a Sixto Sanches (9-SSHANCHEZ) */ /* * **************** SQL con TODO 01 cobranzas ********************* esto son * las cobranzas solamente (primer SQL) * SELECT a.IDRECIBO, a.IDTIPORECIBO, a.NRORECIBO, c.IDTIPOMOVIMIENTO, a.FECHA as FECHA_RECIBO, c.FECHA as FECHA_MOV, a.TOTAL as TOTAL_RECIBO, b.MONTO as MONTO_DETALLE_RECIBO, c.DEBE, d.GRAVADA, d.PORC_DESCUENTO, d.PRECIO_IVA, d.CANTIDAD, a.ESTADO, a.FECHA_CARGA, d.IDMOVIMIENTO, c.NROMOVIMIENTO, c.IDVENDEDOR, g.APELLIDO, g.NOMBRE, c.IDUSER, d.IDARTICULO, SUBSTR(e.DESCRIPCION , 0 , 20) , e.IDCOLECCION as IDPROVEEDOR, f.DESCRIPCION as DESCRIPCION_PROVEEDOR, "" as APELLIDO_USER, "" as NOMBRE_USER, h.IDPERSONA, SUBSTR(h.PERSONA , 0 , 20) as PERSONA, e.IDMARCA, m.DESCRIPCION as DESCRIPCION_MARCA FROM (((((((RECIBOS a join DETALLERECIBO b on a.IDRECIBO = b.IDRECIBO) join MOVIMIENTOS c on b.IDMOVIMIENTO = c.IDMOVIMIENTO) join DETALLEMOVIMIENTO d on c.IDMOVIMIENTO = d.IDMOVIMIENTO) join ARTICULO e on e.IDARTICULO = d.IDARTICULO) join COLECCION f on f.IDCOLECCION = e.IDCOLECCION) join VENDEDOR g on g.IDVENDEDOR = c.IDVENDEDOR) join PERSONA h on h.IDPERSONA = c.IDPERSONA) join Marca m on m.IDMARCA = e.IDMARCA where (a.FECHA >= '10/01/2015') and (a.FECHA <= '10/31/2015') and (a.IDTIPORECIBO in (0,1,10)) and (a.ESTADO = 'E') order by a.IDRECIBO, c.NROMOVIMIENTO * * * **************************************************** * * ============= solo ventas ================= * SELECT 0 as IDRECIBO, 0 as IDTIPORECIBO, 0 as NRORECIBO, c.IDTIPOMOVIMIENTO, 0 as FECHA_RECIBO, c.FECHA as FECHA_MOV, 0 as TOTAL_RECIBO, 0 as MONTO_DETALLE_RECIBO, c.DEBE, d.GRAVADA, d.PORC_DESCUENTO, d.PRECIO_IVA, d.CANTIDAD, 0 as ESTADO, 0 as FECHA_CARGA, d.IDMOVIMIENTO, c.NROMOVIMIENTO, c.IDVENDEDOR, g.APELLIDO, g.NOMBRE, c.IDUSER, d.IDARTICULO, SUBSTR(e.DESCRIPCION , 0 , 20) , e.IDCOLECCION as IDPROVEEDOR, f.DESCRIPCION as DESCRIPCION_PROVEEDOR, "" as APELLIDO_USER, "" as NOMBRE_USER, h.IDPERSONA, SUBSTR(h.PERSONA , 0 , 20) as PERSONA, e.IDMARCA as IDMARCA, m.DESCRIPCION as DESCRIPCION_MARCA FROM ((((( MOVIMIENTOS c join DETALLEMOVIMIENTO d on c.IDMOVIMIENTO = d.IDMOVIMIENTO) join ARTICULO e on e.IDARTICULO = d.IDARTICULO) join COLECCION f on f.IDCOLECCION = e.IDCOLECCION) join VENDEDOR g on g.IDVENDEDOR = c.IDVENDEDOR) join PERSONA h on h.IDPERSONA = c.IDPERSONA) join MARCA m on m.IDMARCA = e.IDMARCA where (c.FECHA >= '10/01/2015') and (c.FECHA <= '10/31/2015') and (c.idtipomovimiento = 43 or c.idtipomovimiento = 13 or c.idtipomovimiento = 44) and (c.estado = "F") order by c.NROMOVIMIENTO ============================================================== */ public static String MES_CORRIENTE = "10.2015"; public static String MES_STR = "2015-10-octubre"; // OJO poner las ventas de ES.S.A. cómo hechas por SIXTO, así se calculan public static boolean DEBUG = false; public static boolean SI_VENTAS = false; public static String direBase = "/home/daniel/datos/yhaguy/comisiones/"; /* archivo de ventas del mes */ public static String direOut = direBase + MES_STR + "/"; public static String direFileResumen = direOut + "resumen.txt"; public static String direFileError = direOut + "error.txt"; public static String fileVentas = direOut + "datos" + "/l-ventas.csv"; public static String fileCobranzas = direOut + "datos" + "/l-cobranzas.csv"; public static String FECHA_EJECUCION = "Generado: " + (new Misc()).getFechaHoyDetalle() + " \n ------------------- \n"; public static int EXTERNO = 0; public static int MOSTRADOR = 1; public static int AUXILIAR = 2; public static int LOS_CRESPI = 3; public static String idPorcDefault = "otraProveedor"; public static int ID_CONTADO = 43; public static int ID_CREDITO = 44; public static int ID_NDC = 13; public static StringBuffer LOGs = new StringBuffer(); public static StringBuffer OUT = new StringBuffer(); public static void error(String linea) { LOGs.append(linea + "\n"); } public static void print(String linea) { OUT.append(linea + "\n"); } public static double[][] porDevolucion = { { 0.007, 0.003 }, { 0.02, 0.0015 }, { 0.04, 0.0005 } }; /*******************************************************************/ // para saber los usuarios de los vendedores Externos, de esa forma sabemos // si es una venta compartida o no public static Object[][] usuarioVendedor = { { EXTERNO, "otro-e", "1" }, { EXTERNO, "JAGUILERA", "3" }, { EXTERNO, "EALEGRE", "2" }, { EXTERNO, "RAMARILLA", "4" }, { MOSTRADOR, "MANOLO", "5" }, { EXTERNO, "CAYALA", "6" }, { MOSTRADOR, "RBRITOS", "73" }, { EXTERNO, "RCESPEDES", "77" }, { MOSTRADOR, "NCRESPI", "61" }, { MOSTRADOR, "JDUARTE", "20" }, { MOSTRADOR, "HFERNANDEZ", "29" }, { EXTERNO, "DFERREIRA", "27" }, { EXTERNO, "GNUNEZ", "12" }, { MOSTRADOR, "DGAONA", "54" }, { EXTERNO, "AGOMEZ", "67" }, { EXTERNO, "FGRANADA", "72" }, { EXTERNO, "LLEGUIZAMO", "62" }, { EXTERNO, "FLEON", "70" }, { EXTERNO, "otro-ea", "60" }, { EXTERNO, "JGIMENEZ", "23" }, { EXTERNO, "JOSORIO", "71" }, { MOSTRADOR, "MOTAZU", "22" }, { EXTERNO, "LRISSO", "25" }, { EXTERNO, "ARODRIGUEZ", "78" }, { MOSTRADOR, "SSANCHEZ", "9" }, // ANTES ERA EXTERNO { MOSTRADOR, "CSANTACRUZ", "13" },{ EXTERNO, "DLOPEZ", "56" }, { EXTERNO, "ASUGASTI", "24" }, { EXTERNO, "MURDAPILLE", "28" }, { EXTERNO, "EVAZQUEZ", "49" }, { EXTERNO, "-sin-usuario-", "136" }, { MOSTRADOR, "SCUEVAS", "8" }, { MOSTRADOR, "RJGONZALEZ", "57" }, { MOSTRADOR, "LMACIEL", "15" }, { MOSTRADOR, "JMAIDANA", "34" }, { MOSTRADOR, "otro-eb", "64" }, { MOSTRADOR, "JRIOS", "37" }, { MOSTRADOR, "CVALDEZ", "14" }, { MOSTRADOR, "DMARTINEZ", "113" }, // { AUXILIAR, "MESTECHE", "52" }, { MOSTRADOR, "MESTECHE", "52" }, { MOSTRADOR, "PROLON", "99" }, { MOSTRADOR, "DAGUILAR", "-1" },{ MOSTRADOR, "AMENDOZA", "94" }, { EXTERNO, "CORTIZ", "31" }, { MOSTRADOR, "GBENITEZ", "121" } , { MOSTRADOR, "otro-q", "92" }, // Sixto Sanchez Temporal Mostrador { MOSTRADOR, "FMATTESICH", "132" } , { MOSTRADOR, "LGONCALVES", "otro-lg" } , // Los Crespi { LOS_CRESPI, "otro-be", "117" } , // <NAME> { LOS_CRESPI, "OCARBALLO", "135" } , // <NAME> { LOS_CRESPI, "HALVAREZ", "79" }, // <NAME> { LOS_CRESPI, "otro-ce", "101" } , // <NAME> { LOS_CRESPI, "HGIMENEZ", "81" }, // <NAME> { MOSTRADOR, "JVELAZQUEZ", "55" }, // <NAME> { LOS_CRESPI, "LVERA", "76" }, // <NAME> { LOS_CRESPI, "LBENITEZ", "69" }, // <NAME> { LOS_CRESPI, "RFLORENTIN", "102" }, // <NAME> { LOS_CRESPI, "otro-de", "138" } , // <NAME> { LOS_CRESPI, "otro-ee", "141" } , // <NAME> { MOSTRADOR, "otro-ae", "116" } , // <NAME> { MOSTRADOR, "PJARA", "68" }, // <NAME> // { MOSTRADOR, "OCARBALLO", "135" }, // <NAME> { MOSTRADOR, "AMAGUILERA", "133" }, // <NAME> /* * { AUXILIAR, "PROLON", "id-most" }, { AUXILIAR, "RGIMENEZ", "18" }, { * AUXILIAR, "LMOREL", "7" }, { AUXILIAR, "LLOPEZ", "80" }, { AUXILIAR, * "DLOPEZ", "56" }, { AUXILIAR, "MEZARATE", "id-most" }, { AUXILIAR, * "FZARACHO", "id-most" }, { AUXILIAR, "DGOLDARAZ", "id-most" } */ }; public static Object[][] auxiliaresTemporales = { // dato de alta a pedido de Raquel { "OVERA4", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "JMAUGER", "ost", new Rango("2015.05.01", "2012.12.31")}, { "HALVAREZ", "79", new Rango("1900.01.01", "2012.12.31") }, { "PROLON", "99", new Rango("1900.01.01", "2013.05.31") }, { "RGIMENEZ", "18", new Rango("1900.01.01", "2020.12.31") }, { "RGIMENEZ6", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "LMOREL", "7", new Rango("1900.01.01", "2020.12.31") }, { "LMOREL6", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "LLOPEZ", "80", new Rango("1900.01.01", "2020.12.31") }, { "DLOPEZ", "56", new Rango("1900.01.01", "2013.07.31") }, { "MEZARATE", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "MEZARATE6", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "FZARACHO", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "DGOLDARAZ", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "DBOSCHERT", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "DBOSCHER", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "POJEDACEN", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "POJEDA", "65", new Rango("1900.01.01", "2020.12.31") }, { "POJEDA5", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "POJEDA3", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "LCIBILS", "95", new Rango("1900.01.01", "2020.12.31") }, { "GORTIZ", "96", new Rango("1900.01.01", "2020.12.31") }, { "VRIVEROS", "id-most", new Rango("2013.04.01", "2020.12.31") }, { "OESPINOLA", "97", new Rango("1900.01.01", "2020.12.31") }, { "ABOGADO", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "ABOGADOFDO", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "LPORTILLO", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "LPORTILLO5", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "LPORTILLO6", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "ADURE", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "VGONZALEZ", "id-most", new Rango("1900.01.01", "2020.12.31") }, { "NCRESPI", "61", new Rango("2013.08.01", "2020.12.31") }, { "MANOLO", "5", new Rango("2013.10.01", "2020.12.31") }, { "SCUEVAS", "8", new Rango("2013.10.01", "2020.12.31") }, { "CSANTACRUZ", "13", new Rango("2013.10.01", "2020.12.31") }, { "EORTELLA4", "id-most", new Rango("2013.12.01", "2020.12.31") }, { "EORTELLA5", "id-most", new Rango("2013.12.01", "2020.12.31") }, { "EORTELLA6", "id-most", new Rango("2013.12.01", "2020.12.31") }, { "HINSFRAN", "118", new Rango("2014.01.01", "2020.12.31") }, // Natalia me pidio { "PROLON", "99", new Rango("2014.01.01", "2020.12.31") }, { "DGAONA", "54", new Rango("2014.01.01", "2020.12.31") }, }; /******************** METAS ***********************************/ public static int indiceMetaMinima = 0; public static int indiceMetaMaxima = 9; public static double m = 1000000; public static String meta0 = "meta0"; public static double[] metaV0 = { 1 * m, 120 * m, 125 * m, 130 * m, 135 * m, 140 * m, 145 * m, 150 * m, 160 * m, 180 * m}; public static String metaCO = "metaCO"; public static double[] metaCOv = { 1 * m, 410 * m , 420 * m , 430 * m , 440 * m , 450 * m , 460 * m , 470 * m , 480 * m , 500 * m }; public static String metaDF = "metaDF"; public static double[] metaDFv = { 1 * m, 210 * m , 220 * m , 230 * m , 240 * m , 250 * m , 260 * m , 270 * m , 280 * m , 300 * m }; public static String metaGN = "metaGN"; public static double[] metaGNv = { 1 * m, 360 * m , 370 * m , 380 * m , 390 * m , 405 * m , 425 * m , 460 * m , 480 * m , 500 * m }; public static String metaLR = "metaLR"; public static double[] metaLRv ={ 1 * m, 340 * m , 345 * m , 350 * m , 355 * m , 360 * m , 365 * m , 370 * m , 375 * m , 380 * m }; public static String metaSS = "metaSS"; // public static double[] metaSSv = {350 * m , 380 * m , 400 * m , 420 * m , 440 * m , 460 * m , 475 * m , 485 * m , 500 * m , 500 * m }; public static double[] metaSSv = { 1 * m, 450 * m , 475 * m , 485 * m , 500 * m , 520 * m , 540 * m , 560 * m , 580 * m , 600 * m }; public static String metaDefault = "metaDefault"; public static double[] metaVD = { 1 * m, 210 * m, 215 * m, 220 * m, 225 * m, 230 * m, 235 * m, 240 * m, 255 * m, 275 * m}; public static String[][] idVendedorPorMeta = { { "31", metaSS }, { "12", metaCO }, { "25", metaGN }, { "27", metaLR }, { "136", metaDF }, // { "9", metaSS }, }; /* Metas antes de los cambios del 6 de Marzo { "12", metaGN }, { "25", metaLR }, { "27", metaDF }, { "31", metaCO }, { "9", metaSS }, */ /***********************************************************************/ public static String CONTADO = "CTO"; public static String COBRANZA = "CRE"; public static double PORC_MOSTRADOR_CONTADO_def = 0.016; public static double PORC_MOSTRADOR_COBRANZA_def = 0.012; public static double PORC_EXTERNO_COBRANZA = 0.012; public static Object[][] idVendedorMostradorPorcentaje = { { "54", 0.012, 0.012 }, // <NAME> { "73", 0.015, 0.013 }, // <NAME> { "99", 0.02, 0.02 }, // <NAME> { "22", 0.025, 0.025 }, // <NAME> { "20", 0.025, 0.025 }, // <NAME> { "29", 0.025, 0.025 }, // <NAME> { "94", 0.02, 0.018 }, // <NAME> { "68", 0.025, 0.025 }, // <NAME> { "116", 0.025, 0.025 }, // <NAME> // { "135", 0.025, 0.025 }, // <NAME> { "133", 0.025, 0.025 }, // <NAME>ILERA { "9", 0.025, 0.025 }, // SIXTO SANCHEZ { "55", 0.0050, 0.0050 }, // JOR<NAME> (0.50% para todas las ventas) // Esto se carga para que siiga el curso, pero NO se usa, // por eso le pongo cero // Los Crespi /* aca { "116", 0.0, 0.0 }, // <NAME> { "102", 0.0, 0.0 }, // <NAME> { "79", 0.0, 0.0 }, // <NAME> { "81", 0.0, 0.0 }, // <NAME> { "117", 0.0, 0.0 }, // <NAME> { "101", 0.0, 0.0 }, // <NAME> { "55", 0.0, 0.0 }, // <NAME> { "76", 0.0, 0.0 }, // <NAME> { "69", 0.0, 0.0 }, // <NAME> { "68", 0.0, 0.0 }, // <NAME> */ }; // Los Crespi, Id de Vendedor y el Id de las Metas x Marcas public static Object[][] idVendedorLosCrespi = { // { "116", 1 }, // <NAME> { "102", 1 }, // <NAME> { "79", 1 }, // <NAME> { "81", 1 }, // <NAME> { "117", 1}, // <NAME> { "135", 1}, // <NAME> { "101", 1 }, // <NAME> // paso a venderores del mostrador para poder ponerle una comisión fija para todo lo demas // { "55", 1 }, // <NAME> { "76", 1 }, // <NAME> { "69", 1}, // <NAME> { "141", 1}, // <NAME> { "138", 1}, // <NAME> //{ "68", 1 }, // <NAME> }; // comisión especial de algunos vendedores con respecto a proveedores public static Object [][] idcomisionEspecialPorVendedorProveedor = { {"55-10219", 0.0091, 0.0078, "<NAME>, BATEBOL LTDA.INDUSTRIA DE BATERIAS"}, {"55-57088", 0.0180, 0.0160, "<NAME>, JOHNSON CONTROLS"}, {"55-86299", 0.0230, 0.0200, "<NAME>, JOHNSON CONTROLS COLOMBIA S.A.S"}, {"55-10501", 0.0100, 0.0100, "<NAME>, PUMA ENERGY PARAGUAY"}, // esto ya está en marcas con porcentaje especial // {"55-xx", 0.0050, 0.0050, "<NAME>, CASTROL"}, {"TD-10501", 0.0100, 0.0100, "Para todos, PUMA ENERGY PARAGUAY"}, }; public static Hashtable<String, Double[]> comisionEspecialPorVendedorProveedor = new Hashtable<>(); public static void cargaComisionEspecialVendedorProveedor(){ for (int i = 0; i < idcomisionEspecialPorVendedorProveedor.length; i++) { Object[] d = idcomisionEspecialPorVendedorProveedor[i]; Double[] porComi = {(Double) d[1], (Double) d[2]}; comisionEspecialPorVendedorProveedor.put((String) d[0], porComi); } } public static String textoComisionEspecialPorVendedorProveedor(){ String out = "\n\n"; out += "Comisión especial de Vendedores por Proveedor\n"; out += "--------------------------------------------------------------------\n"; for (int i = 0; i < idcomisionEspecialPorVendedorProveedor.length; i++) { Object[] d = idcomisionEspecialPorVendedorProveedor[i]; String ctdo = misc.formatoDs(((double)d[1])*100, 8, false)+"%"; String cred = misc.formatoDs(((double)d[2])*100, 8, false)+"%"; String nomb = misc.formato("["+d[0]+"] "+d[3], 50, true); out+= nomb + ctdo + cred+"\n"; } out += "--------------------------------------------------------------------\n"; return out; } // vendedores sobre los cuales se debe considerar venta asignada // vendedores compañeros public static Object[][] idMarcasVendedorAsignado = { }; public static Object[][] xxxxxidMarcasVendedorAsignado = { {"250", "RAIDEN", "79", new String[]{"73","102"} }, // Raiden - <NAME>, comparte con Rolando {"249", "HELIAR", "79", new String[]{"73","102"} }, // Heliar - <NAME>, comparte con Rolando {"234", "TOYO", "102", new String[]{"79", "73"} }, // Toyo - <NAME>, comparte con Hernan y Richard {"248", "PLATIN", "102", new String[]{"79", "73"} }, // Platin - <NAME>, comparte con Hernan y Richard }; public static Hashtable<String, Integer> idVendedorLosCrespiTable = new Hashtable<String, Integer>(); public static Hashtable<String, Double> idVendedorMostradorPorcentajeTable = new Hashtable<String, Double>(); public static void cargaVenMostradorPorcentaje() { for (int i = 0; i < idVendedorMostradorPorcentaje.length; i++) { String idV = (String) idVendedorMostradorPorcentaje[i][0]; Double cto = (Double) idVendedorMostradorPorcentaje[i][1]; Double cre = (Double) idVendedorMostradorPorcentaje[i][2]; idVendedorMostradorPorcentajeTable.put(idV + CONTADO, cto); idVendedorMostradorPorcentajeTable.put(idV + COBRANZA, cre); } // cargo dos valores por default idVendedorMostradorPorcentajeTable.put(CONTADO, PORC_MOSTRADOR_CONTADO_def); idVendedorMostradorPorcentajeTable.put(COBRANZA, PORC_MOSTRADOR_COBRANZA_def); // Carga los Crespi for (int i = 0; i < idVendedorLosCrespi.length ; i++) { String idV = (String) idVendedorLosCrespi[i][0]; Integer meta = (Integer) idVendedorLosCrespi[i][1]; idVendedorLosCrespiTable.put(idV, meta); } } public static double getPorcMostrador(String idV, String tipo) { Double d = idVendedorMostradorPorcentajeTable.get(idV + tipo); if (d == null) { d = idVendedorMostradorPorcentajeTable.get(tipo); } return d.doubleValue(); } /***********************************************************************/ public static String[][] clientesNoConsiderados = { { "54481", "<NAME>" }, { "57562", "Katupyry Repuestos S.A." } }; public static boolean esClienteNoConsiderado(String idPersona) { boolean out = false; for (int i = 0; i < clientesNoConsiderados.length; i++) { String id = clientesNoConsiderados[i][0]; if (id.compareTo(idPersona) == 0) { out = true; } } return out; } // Id cliente, Cliente, porcentaje, true: NO compartida, false: según lo que corresponda public static Object[][] porcentajePorCliente = { { "4783", "Central Repuestos S.A.", 0.005, true }, { "3123", "<NAME>.", 0.005, true }, { "23", "<NAME>", 0.005, true } , { "5826", "Tractopar", 0.01, false}, // { "2618", "Neumatec", 0.01, false} }; public static double getPorcentajeClienteEspecial(String idPersona) { double out = -1; for (int i = 0; i < porcentajePorCliente.length; i++) { String id = (String) porcentajePorCliente[i][0]; if (id.compareTo(idPersona) == 0) { out = (double) porcentajePorCliente[i][2]; } } return out; } public static boolean getPorcentajeClienteEspecialNOCompartida(String idPersona) { boolean out = false; // por defecto es según corresponda for (int i = 0; i < porcentajePorCliente.length; i++) { String id = (String) porcentajePorCliente[i][0]; if (id.compareTo(idPersona) == 0) { out = (boolean) porcentajePorCliente[i][3]; } } return out; } // Id marca public static Object[][] porcentajePorMarca = { { "308", "Castrol", 0.005 }, }; public static double getPorcentajeMarcaEspecial(String idMarca) { double out = -1; for (int i = 0; i < porcentajePorMarca.length; i++) { String id = (String) porcentajePorMarca[i][0]; if (id.compareTo(idMarca) == 0) { out = (double) porcentajePorMarca[i][2]; } } return out; } public static String textoClienteNoConsiderados() { String out = " \n\n"; out += "Clientes que NO suman en la comision ni en la venta del mes\n"; out += "-----------------------------------------------------------\n"; for (int i = 0; i < clientesNoConsiderados.length; i++) { String id = ("[" + clientesNoConsiderados[i][0] + "] ") .substring(0, 10); String cl = clientesNoConsiderados[i][1]; out += id + cl + "\n"; } out += "-----------------------------------------------------------" + "\n"; return out; } public static String textoPorcentajeEspecialClientes() { Misc m = new Misc(); String out = " \n\n"; out += "Clientes con porcentaje especial (TRUE: ES NO COMPARTIDA)" + "\n"; out += "-----------------------------------------------------------" + "\n"; for (int i = 0; i < porcentajePorCliente.length; i++) { String id = ("[" + porcentajePorCliente[i][0] + "] ") .substring(0, 10); String cl = ("" + porcentajePorCliente[i][1] + " ") .substring(0, 25); String por = m.formatoDs( ((double) porcentajePorCliente[i][2]) * 100, 5, false) + "%"; String comp = " "+porcentajePorCliente[i][3]+""; out += id + cl + por + comp + "\n"; } out += "-----------------------------------------------------------" + "\n"; return out; } public static String textoPorcentajeEspecialMarca() { Misc m = new Misc(); String out = " \n\n"; out += "Marcas con porcentaje especial" + "\n"; out += "-----------------------------------------------------------" + "\n"; for (int i = 0; i < porcentajePorMarca.length; i++) { String id = ("[" + porcentajePorMarca[i][0] + "] ") .substring(0, 10); String mk = ("" + porcentajePorMarca[i][1] + " ") .substring(0, 25); String por = m.formatoDs( ((double) porcentajePorMarca[i][2]) * 100, 5, false) + "%"; out += id + mk + por + "\n"; } out += "-----------------------------------------------------------" + "\n"; return out; } public static String textoVendedoresSinComisionXProveedor(){ String out = "\n\n"; out += "Vendedores que NO cobram comision para ciertas fábricas\n"; out += "-----------------------------------------------------------\n"; iniPrintColumanas(2); addPrintDato(0, "Fabricas que NO pagan comision"); addPrintDato(0, "------------------------------"); for (int i = 0; i < fabricasNoComision.length; i++) { addPrintDato(0, "("+fabricasNoComision[i][0]+") "+fabricasNoComision[i][1]); } addPrintDato(0, "------------------------------"); addPrintDato(1, "Vendedores en este régimen "); addPrintDato(1, "------------------------------"); for (int i = 0; i < vendedoresFabricasNoComision.length; i++) { String idV = (String) vendedoresFabricasNoComision[i][0]; String nV = (String) vendedoresFabricasNoComision[i][2]; String s = "000"+idV.trim(); s = s.substring(s.length()-3); addPrintDato(1, "("+s+") - "+nV); } addPrintDato(1, "------------------------------"); out += printCol(new int[]{30,30}, "|"); return out; } /********************* PARA LEER DEL CSV *******************************/ public static String[][] cab = { { "Mes", CSV.STRING } }; public static String[][] cabDet = { { "IDMOVIMIENTO", CSV.NUMERICO }, // id { "IDRECIBO", CSV.NUMERICO }, { "IDTIPORECIBO", CSV.NUMERICO }, { "NRORECIBO", CSV.STRING }, { "IDTIPOMOVIMIENTO", CSV.NUMERICO }, { "FECHA_RECIBO", CSV.STRING }, { "FECHA_MOV", CSV.STRING }, { "TOTAL_RECIBO", CSV.NUMERICO }, { "MONTO_DETALLE_RECIBO", CSV.NUMERICO }, { "DEBE", CSV.NUMERICO }, { "GRAVADA", CSV.NUMERICO }, { "PRECIO_IVA", CSV.NUMERICO }, { "CANTIDAD", CSV.NUMERICO }, { "ESTADO", CSV.STRING }, { "FECHA_CARGA", CSV.STRING }, { "IDMOVIMIENTO", CSV.NUMERICO }, { "NROMOVIMIENTO", CSV.NUMERICO }, { "IDVENDEDOR", CSV.NUMERICO, }, { "APELLIDO", CSV.STRING }, { "NOMBRE", CSV.STRING }, { "IDUSER", CSV.STRING }, { "APELLIDO_USER", CSV.STRING }, { "NOMBRE_USER", CSV.STRING }, { "IDARTICULO", CSV.STRING }, { "SUBSTR", CSV.STRING }, { "IDMARCA", CSV.NUMERICO }, { "DESCRIPCION_MARCA", CSV.STRING }, { "PORC_DESCUENTO", CSV.NUMERICO }, { "IDPERSONA", CSV.NUMERICO }, { "PERSONA", CSV.STRING }, { "IDPROVEEDOR", CSV.NUMERICO }, { "DESCRIPCION_PROVEEDOR", CSV.STRING } }; /************** TABLA DE COMPROBANTES, YA PASADOS DESDE EL CSV **********************/ // poner los campos de los comprobantes private static String[] camposComprobante = { "ID", "IDRECIBO", "IDTIPORECIBO", "NRORECIBO", "IDTIPOMOVIMIENTO", "FECHA_RECIBO", "FECHA_MOV", "TOTAL_RECIBO", "MONTO_DETALLE_RECIBO", "DEBE", "GRAVADA", "PRECIO_IVA", "CANTIDAD", "ESTADO", "FECHA_CARGA", "IDMOVIMIENTO", "NROMOVIMIENTO", "IDVENDEDOR", "APELLIDO", "NOMBRE", "IDUSER", "APELLIDO_USER", "NOMBRE_USER", "IDARTICULO", "SUBSTR", "IDPROVEEDOR", "DESCRIPCION_IDPROVEEDOR", "ESCONTADO", "IDPERSONA", "PERSONA", "IDMARCA", "DESCRIPCION_MARCA", "IDPROVEEDOR", "DESCRIPCION_PROVEEDOR" }; public static Tabla ventas = new Tabla(camposComprobante); public static Tabla cobranzas = new Tabla(camposComprobante); public static void csvtoTable(String file, Tabla table) throws Exception { System.out.println("Datos: " + file); /* * cargar los comprobantes del CSV o de donde sea */ String direccion = file; // Leer el CSV CSV csv = new CSV(cab, cabDet, direccion); // Como recorrer el detalle csv.start(); int contador = 0; int nroLinea = 0; while (csv.hashNext() /* && nroLinea < 50 */) { nroLinea++; // Lee el detalle de las facturaciones double IDRECIBO = csv.getDetalleDouble("IDRECIBO"); double IDTIPORECIBO = csv.getDetalleDouble("IDTIPORECIBO"); String NRORECIBO = csv.getDetalleString("NRORECIBO"); long IDTIPOMOVIMIENTO = (long) csv .getDetalleDouble("IDTIPOMOVIMIENTO"); String FECHA_RECIBO = csv.getDetalleString("FECHA_RECIBO"); String FECHA_MOV = csv.getDetalleString("FECHA_MOV"); double TOTAL_RECIBO = csv.getDetalleDouble("TOTAL_RECIBO"); double MONTO_DETALLE_RECIBO = csv .getDetalleDouble("MONTO_DETALLE_RECIBO"); double DEBE = csv.getDetalleDouble("DEBE"); double GRAVADA = csv.getDetalleDouble("GRAVADA"); double POR_DESC = csv.getDetalleDouble("PORC_DESCUENTO"); // quitando el descuento GRAVADA = GRAVADA - GRAVADA * (POR_DESC / 100); double PRECIO_IVA = csv.getDetalleDouble("PRECIO_IVA"); double CANTIDAD = csv.getDetalleDouble("CANTIDAD"); String ESTADO = csv.getDetalleString("ESTADO"); String FECHA_CARGA = csv.getDetalleString("FECHA_CARGA"); double IDMOVIMIENTO = csv.getDetalleDouble("IDMOVIMIENTO"); String NROMOVIMIENTO = "" + ((long) csv.getDetalleDouble("NROMOVIMIENTO")); String IDVENDEDOR = "" + ((long) csv.getDetalleDouble("IDVENDEDOR")); String APELLIDO = csv.getDetalleString("APELLIDO"); String NOMBRE = csv.getDetalleString("NOMBRE"); String IDUSER = csv.getDetalleString("IDUSER"); String APELLIDO_USER = csv.getDetalleString("APELLIDO_USER"); String NOMBRE_USER = csv.getDetalleString("NOMBRE_USER"); String IDARTICULO = csv.getDetalleString("IDARTICULO"); String SUBSTR = csv.getDetalleString("SUBSTR"); String IDPROVEEDOR = "" + ((long) csv.getDetalleDouble("IDPROVEEDOR")); String DESCRIPCION_PROVEEDOR = csv .getDetalleString("DESCRIPCION_PROVEEDOR"); String IDPERSONA = "" + ((long) csv.getDetalleDouble("IDPERSONA")); String PERSONA = csv.getDetalleString("PERSONA"); String IDMARCA = "" + ((long) csv.getDetalleDouble("IDMARCA")); String DESCRIPCION_MARCA = csv .getDetalleString("DESCRIPCION_MARCA"); boolean esContado = false; if (IDTIPOMOVIMIENTO == ID_CONTADO) { esContado = true; } if (IDTIPOMOVIMIENTO == ID_NDC) { GRAVADA = GRAVADA * -1; } if ((IDTIPOMOVIMIENTO == ID_CONTADO || IDTIPOMOVIMIENTO == ID_CREDITO || IDTIPOMOVIMIENTO == ID_NDC)) { contador++; // Cargarlos detalles en la tabla Comprobante table.newRow(); table.addDataRow("ID", contador); table.addDataRow("IDRECIBO", IDRECIBO); table.addDataRow("IDTIPORECIBO", IDTIPORECIBO); table.addDataRow("NRORECIBO", NRORECIBO); table.addDataRow("IDTIPOMOVIMIENTO", IDTIPOMOVIMIENTO); table.addDataRow("FECHA_RECIBO", FECHA_RECIBO); table.addDataRow("FECHA_MOV", FECHA_MOV); table.addDataRow("TOTAL_RECIBO", TOTAL_RECIBO); table.addDataRow("MONTO_DETALLE_RECIBO", MONTO_DETALLE_RECIBO); table.addDataRow("DEBE", DEBE); table.addDataRow("GRAVADA", GRAVADA); table.addDataRow("PRECIO_IVA", PRECIO_IVA); table.addDataRow("CANTIDAD", CANTIDAD); table.addDataRow("ESTADO", ESTADO); table.addDataRow("FECHA_CARGA", FECHA_CARGA); table.addDataRow("IDMOVIMIENTO", IDMOVIMIENTO); table.addDataRow("NROMOVIMIENTO", NROMOVIMIENTO); table.addDataRow("IDVENDEDOR", IDVENDEDOR); table.addDataRow("APELLIDO", APELLIDO); table.addDataRow("NOMBRE", NOMBRE); table.addDataRow("IDUSER", IDUSER); table.addDataRow("APELLIDO_USER", APELLIDO_USER); table.addDataRow("NOMBRE_USER", NOMBRE_USER); table.addDataRow("IDARTICULO", IDARTICULO); table.addDataRow("SUBSTR", SUBSTR); // Descripcion del // Articulo table.addDataRow("IDPROVEEDOR", IDPROVEEDOR); table.addDataRow("DESCRIPCION_PROVEEDOR", DESCRIPCION_PROVEEDOR); table.addDataRow("ESCONTADO", esContado); table.addDataRow("IDPERSONA", IDPERSONA); table.addDataRow("PERSONA", PERSONA); table.addDataRow("IDMARCA", IDMARCA); table.addDataRow("DESCRIPCION_MARCA", DESCRIPCION_MARCA); table.saveRow(); } else { error("Error IDTIPOMOVIMIENTO:" + IDTIPOMOVIMIENTO + " IDRECIBO:" + IDRECIBO + " IDMOVIMIENTO:" + IDMOVIMIENTO + "" + file); } } } /********************* PORCENTAJES DE COMISIONES **********************/ public static Hashtable<String, Object[]> porcentajePorProveedor = new Hashtable<String, Object[]>(); public static double[] grupoPorcentaje0 = { 0.0132, 0.0134, 0.0135, 0.0136, 0.014, 0.0142, 0.0145, 0.0147, 0.015, 0.0154}; public static double[] grupoPorcentaje1 = { 0.0155, 0.0158, 0.0159, 0.016, 0.0164, 0.0167, 0.0171, 0.0174, 0.0176, 0.0179}; public static double[] grupoPorcentaje2 = { 0.0180, 0.0184, 0.0185, 0.0186, 0.0189, 0.0192, 0.0195, 0.0197, 0.0199, 0.02}; public static double[] grupoPorcentajeOtro = { 0.0123, 0.0123, 0.0123, 0.0123, 0.0123, 0.0123, 0.0123, 0.0123, 0.0123, 0.0123}; public static void cargaPorcentajesPorProveedor() { // (HACER) Traer del CSV los proveedores con sus respectivos porcentajes porcentajePorProveedor.put("10303", new Object[] {"10303","ZF DO BRASIL LTDA.SACHS",grupoPorcentaje0, "Grupo 0"}); porcentajePorProveedor.put("62175", new Object[] {"62175","MAHLE BRASIL",grupoPorcentaje0, "Grupo 0"}); porcentajePorProveedor.put("10145", new Object[] {"10145","CINPAL",grupoPorcentaje0, "Grupo 0"}); porcentajePorProveedor.put("10106", new Object[] {"10106","AFFINIA AUTOMOTIVA LTDA.",grupoPorcentaje0, "Grupo 0"}); porcentajePorProveedor.put("10508", new Object[] {"10508","IDEAL STANDARD WABCO TRAN",grupoPorcentaje0, "Grupo 0"}); porcentajePorProveedor.put("10116", new Object[] {"10116","SUPORTE REI",grupoPorcentaje0, "Grupo 0"}); porcentajePorProveedor.put("10482", new Object[] {"10482","ROLAMENTOS FAG LTDA.",grupoPorcentaje0, "Grupo 0"}); porcentajePorProveedor.put("10506", new Object[] {"10506","SABO INDUS.E COMERCIO DE",grupoPorcentaje0, "Grupo 0"}); porcentajePorProveedor.put("54300", new Object[] {"54300","<NAME>",grupoPorcentaje0, "Grupo 0"}); porcentajePorProveedor.put("10122", new Object[] {"10122","FRUM",grupoPorcentaje0, "Grupo 0"}); porcentajePorProveedor.put("10110", new Object[] {"10110","<NAME>",grupoPorcentaje1, "Grupo 1"}); porcentajePorProveedor.put("10483", new Object[] {"10483","INSTALADORA SAO MARCOS LT",grupoPorcentaje1, "Grupo 1"}); porcentajePorProveedor.put("10495", new Object[] {"10495","KNORR BREMSE SIST.P/VEIC.",grupoPorcentaje1, "Grupo 1"}); porcentajePorProveedor.put("54501", new Object[] {"54501","<NAME>",grupoPorcentaje1, "Grupo 1"}); porcentajePorProveedor.put("53760", new Object[] {"53760","GARRET",grupoPorcentaje1, "Grupo 1"}); porcentajePorProveedor.put("56039", new Object[] {"56039","AIRTECH",grupoPorcentaje1, "Grupo 1"}); porcentajePorProveedor.put("10132", new Object[] {"10132","FRICCION S.R.L.",grupoPorcentaje1, "Grupo 1"}); porcentajePorProveedor.put("10117", new Object[] {"10117","VETORE IND.E COMERCIO",grupoPorcentaje1, "Grupo 1"}); porcentajePorProveedor.put("10108", new Object[] {"10108","AUT<NAME>",grupoPorcentaje1, "Grupo 1"}); porcentajePorProveedor.put("10199", new Object[] {"10199","TECNICA INDUSTRIAL TIPH S",grupoPorcentaje1, "Grupo 1"}); porcentajePorProveedor.put("10111", new Object[] {"10111","MEC-PAR",grupoPorcentaje1, "Grupo 1"}); porcentajePorProveedor.put("56520", new Object[] {"56520","HONGKONG WOOD BEST INDUST",grupoPorcentaje1, "Grupo 1"}); porcentajePorProveedor.put("10105", new Object[] {"10105","SIEMENS VDO AUTOMOTIVE",grupoPorcentaje1, "Grupo 1"}); porcentajePorProveedor.put("60909", new Object[] {"60909","DUROLINE TRADING COMPANY LIMITED",grupoPorcentaje1, "Grupo 1"}); porcentajePorProveedor.put("53759", new Object[] {"53759","RIOSULENSE",grupoPorcentaje1, "Grupo 1"}); porcentajePorProveedor.put("10115", new Object[] {"10115","AMALCABURIO",grupoPorcentaje1, "Grupo 1"}); porcentajePorProveedor.put("10268", new Object[] {"10268","MAGNETI MARELLI COFAP AUT",grupoPorcentaje1, "Grupo 1"}); porcentajePorProveedor.put("56698", new Object[] {"56698","DAYCO ARGENTINA S.A.",grupoPorcentaje2, "Grupo 2"}); porcentajePorProveedor.put("10114", new Object[] {"10114","RODAROS",grupoPorcentaje2, "Grupo 2"}); porcentajePorProveedor.put("53534", new Object[] {"53534","CINPAL ARGENTINA",grupoPorcentaje2, "Grupo 2"}); porcentajePorProveedor.put("10733", new Object[] {"10733","ZF SACHS ARGENTINA S.A.",grupoPorcentaje2, "Grupo 2"}); porcentajePorProveedor.put("53840", new Object[] {"53840","ESPERANZA-RODAFUSO",grupoPorcentaje2, "Grupo 2"}); porcentajePorProveedor.put("58944", new Object[] {"58944","<NAME>",grupoPorcentaje2, "Grupo 2"}); porcentajePorProveedor.put("10313", new Object[] {"10313","BOECHAT",grupoPorcentaje2, "Grupo 2"}); porcentajePorProveedor.put("10424", new Object[] {"10424","<NAME>'Agll & CIA Ltda.",grupoPorcentaje2, "Grupo 2"}); porcentajePorProveedor.put("79094", new Object[] {"79094","<NAME>",grupoPorcentaje2, "Grupo 2"}); porcentajePorProveedor.put("80103", new Object[] {"80103","<NAME>",grupoPorcentaje2, "Grupo 2"}); porcentajePorProveedor.put("79537", new Object[] {"79537","DUROLINE S.A. BRASIL",grupoPorcentaje2, "Grupo 2"}); porcentajePorProveedor.put("78812", new Object[] {"78812","MAXION PRIORITY",grupoPorcentaje2, "Grupo 2"}); porcentajePorProveedor.put("57937", new Object[] {"57937","GENMOT GENEL MOTOR STANDA",grupoPorcentaje2, "Grupo 2"}); porcentajePorProveedor.put("53374", new Object[] {"53374","UNIONREBIT",grupoPorcentaje2, "Grupo 2"}); porcentajePorProveedor.put("80263", new Object[] {"80263","RELEMIX",grupoPorcentaje2, "Grupo 2"}); porcentajePorProveedor.put("82756", new Object[] {"82756","Valeo",grupoPorcentaje2, "Grupo 2"}); porcentajePorProveedor.put("10303", new Object[] {"81674","GRUPO ELITE S.A",grupoPorcentaje2, "Grupo 2"}); porcentajePorProveedor.put(idPorcDefault, new Object[] { idPorcDefault, "otras", grupoPorcentajeOtro, "Grupo Default" }); } public static double calculoDevolucion(double totalVenta, double porDevolucion) { double out = 0.0; double intervalo1, intervalo2; // 0.0% <= porDevolucion < 0.7% ......0.3% // 0.7% <= porDevolucion < 2% ......0.15% // 2% <= porDevolucion < 4% ......0.05% intervalo1 = 0; for (int j = 0; j < Cons.porDevolucion.length; j++) { intervalo2 = Cons.porDevolucion[j][0]; if (porDevolucion >= intervalo1 && porDevolucion < intervalo2) { out = totalVenta * Cons.porDevolucion[j][1]; } intervalo1 = Cons.porDevolucion[j][0]; } return out; } public static String textoPorDevolucion() { Misc m = new Misc(); NumberFormat fp = new DecimalFormat("##0.00 %"); String out = ""; out += "Plus por devolucion\n"; out += "----------------------------------------\n"; double desde = 0; double hasta = 0; double por = 0; for (int i = 0; i < Cons.porDevolucion.length; i++) { hasta = Cons.porDevolucion[i][0]; por = Cons.porDevolucion[i][1]; out += "[ >= " + m.formato(fp.format(desde), 8, false) + " y < " + m.formato(fp.format(hasta), 8, false) + " ] " + m.formato(fp.format(por), 8, false) + "\n"; desde = Cons.porDevolucion[i][0]; ; } hasta = 1; por = 0; out += "[ >= " + m.formato(fp.format(desde), 8, false) + " y < " + m.formato(fp.format(hasta), 8, false) + " ] " + m.formato(fp.format(por), 8, false) + "\n"; out += "----------------------------------------\n"; return out; } public static String textoUsuariosAuxiliares() { String out = "\n\n"; out += "Usuarios AUXILIARES (NO se considera venta compartida)\n"; out += "------------------------------------------------------\n"; String linea = ""; // {"HALVAREZ", "79", new Rango("1900.01.01", "2012.12.31")}, for (int i = 0; i < auxiliaresTemporales.length; i++) { Object[] dato = auxiliaresTemporales[i]; String user = (String) dato[0]; String id = (String) dato[1]; linea = ("[" + user + "] " + id + " ").substring( 0, 20); linea += " Fechas:"; for (int j = 2; j < dato.length; j++) { Rango r = (Rango) dato[j]; linea += " " + r; } out += linea + "\n"; } out += "------------------------------------------------------\n"; return out; } public static void xxmain(String[] args) { System.out.println(Cons.textoPorDevolucion()); } //======================================== //======================================== // auxiliar, porque de esta manera puedo poner fábricas diferentes para // cada venderor, por ahora son las mismas, pero ... private static String[][] fabricasNoComision = { {"10219","BATEBOL LTDA.IND"}, {"10666","CHAMPION LABORAT"}, {"82080","CONTINENTAL CUBI"}, {"82726","CONTINENTAL CUBI"}, {"84633","CONTINENTAL CUBI"}, {"83631","CONTINENTAL CUBI"}, {"10675","COOPER TIRE & RU"}, {"10204","<NAME>"}, {"54505","GITI TIRE CUBIER"}, {"53910","GRUPO KOLIMA"}, {"10665","INDUSTRIAS MIGUE"}, {"10673","ITOCHU CORPORATI"}, {"10730","<NAME>"}, {"57088","<NAME>"}, {"86299","<NAME>"}, {"74605","<NAME>"}, {"79094","<NAME>"}, {"10689","PEKO INCORPORATI"}, {"10718","<NAME>"}, {"10662","SOFAPE S/A"}, {"10672","TECNECO FILTERS"}, {"10696","<NAME>"}, {"58253","YIGITAKU"}, {"10501","PUMA ENERGY PARAGUAY S.A."} }; // que vendedor y que lista de fábricas NO cobra comision private static Object[][] vendedoresFabricasNoComision = { // {"9", fabricasNoComision, "<NAME>"}, /* desde Julio 2015 {"31", fabricasNoComision, "<NAME>"}, {"27", fabricasNoComision, "<NAME>"}, {"12", fabricasNoComision, "<NAME>"}, {"25", fabricasNoComision, "<NAME>"}, {"133", fabricasNoComision, "<NAME>"}, */ {"135", fabricasNoComision, "<NAME>"}, {"4", fabricasNoComision, "<NAME>"}, }; // fabricas con comisión especial en todas las ventas private static String[][] fabricasComisionEspecialTodos = { {"xdr10501","PUMA ENERGY PARAGUAY S.A.", "",""}, }; private static Hashtable <String, String> hashVendedorFabrica = new Hashtable<>(); private static String getIdViFas(String idV, String idFas){ return (idV.trim()+"-"+idFas.trim()); } static Misc misc = new Misc(); static String ff = "/home/daniel/datos/yhaguy/comisiones/2014-08-agosto/datos/idVidFas.txt"; static{ // caraga un has con idVendedor y idFas, entonces si // está en el hash es porque NO le corresponde comision for (int i = 0; i < vendedoresFabricasNoComision.length; i++) { String idV = (String) vendedoresFabricasNoComision[i][0]; String[][] fas = (String[][]) vendedoresFabricasNoComision[i][1]; for (int j = 0; j < fas.length; j++) { String idVIdFas = getIdViFas(idV,fas[j][0]); hashVendedorFabrica.put(idVIdFas, "ok"); misc.agregarStringToArchivo(ff, idVIdFas+"\n"); } } misc.agregarStringToArchivo(ff, "********************************\n"); misc.agregarStringToArchivo(ff, "********************************\n"); } public static boolean cobraComision(String idVendedor, String idFabrica){ String idVidFas = getIdViFas(idVendedor, idFabrica); misc.agregarStringToArchivo(ff, idVidFas+"\n"); Object o = hashVendedorFabrica.get(idVidFas); if (o == null){ // si no está, cobra comision return true; } misc.agregarStringToArchivo(ff, "---------SI \n"); return false; } private static ArrayList<String>[] cols = null; static public void iniPrintColumanas(int nColumnas){ cols = new ArrayList[nColumnas]; for (int i = 0; i < nColumnas; i++) { cols[i] = new ArrayList<String>(); } } static public void addPrintDato(int col, String dato){ ArrayList<String> ld = cols[col]; ld.add(dato); } static public String printCol(int[] anchos, String sep){ String out = ""; boolean hayDato = true; int vuelta = 0; while (hayDato == true){ hayDato = false; String linea = ""; for (int i = 0; i < cols.length; i++) { String str = ""; ArrayList<String> ld = cols[i]; if (vuelta < ld.size()){ str = ld.get(vuelta); hayDato = true; } str += " "; str = str.substring(0, anchos[i]); linea += sep + str; } if (hayDato == true){ out += linea+"\n"; } vuelta++; } return out; } public static void main(String[] args) { iniPrintColumanas(3); addPrintDato(0, "1.1"); addPrintDato(0, "2.1"); addPrintDato(0, "3.1"); addPrintDato(1, "1.2"); addPrintDato(1, "2.2"); addPrintDato(2, "1.3"); addPrintDato(2, "2.3"); addPrintDato(2, "3.3"); System.out.println(printCol(new int[]{10,10,10}, "|")); } }
43,026
0.609
0.545344
1,122
37.937611
31.78108
137
false
false
0
0
0
0
0
0
3.517825
false
false
4
2f21847aa491766f6b23c2a83d3211af4a160c6b
10,943,576,727,945
317c05d87d5cf3479f81c6b4b4d8e1724ca7e98c
/src/Assignment_English_Language_known_Key_Length/VigenereCipher.java
1ac059642fdfa6b7215bd9da57773428ebdaa225
[]
no_license
chanhoparkcj/Breaking_VigenereCipher-DUKE-COURSE2-WEEK4
https://github.com/chanhoparkcj/Breaking_VigenereCipher-DUKE-COURSE2-WEEK4
4b684af84b089d04135040dae4afc831db1a5b7d
08657bd119f50b76fd7c0b62ba4a70e681a5eeeb
refs/heads/master
2020-03-12T19:23:47.257000
2018-04-24T03:09:28
2018-04-24T03:09:28
130,783,575
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package Assignment_English_Language_known_Key_Length; import edu.duke.*; import java.util.*; public class VigenereCipher { CaesarCipher[] ciphers; public VigenereCipher(int[] key){ /* * the constructor, which takes a key which is an array of integer * and initialize the field ciphers, which is an array of caesarcipher objects */ ciphers =new CaesarCipher[key.length]; for(int i=0;i<key.length;i++){ ciphers[i]=new CaesarCipher(key[i]); } } public String encrypt(String input){ StringBuilder answer=new StringBuilder(); int i=0; for(char c: input.toCharArray()){ int cipherIndex=i%ciphers.length; CaesarCipher thisCipher=ciphers[cipherIndex]; answer.append(thisCipher.encryptLetter(c)); i++; } return answer.toString(); } public String decrypt(String input){ StringBuilder answer=new StringBuilder(); int i=0; for(char c:input.toCharArray()){ int cipherIndex=i%ciphers.length; CaesarCipher thisCipher=ciphers[cipherIndex]; answer.append(thisCipher.decryptLetter(c)); i++; } return answer.toString(); } public String toString(){ return Arrays.toString(ciphers); } public void testVegenereCipher(){ FileResource fr=new FileResource(); String input=fr.asString(); System.out.println("1 :"+input); String encrypt=encrypt(input); System.out.println("2 :"+encrypt); String decrypt=decrypt(encrypt); System.out.println("3 :"+decrypt); } public static void main(String args[]){ int[] key={17,14,12,4}; //"rome" VigenereCipher vc=new VigenereCipher(key); vc.testVegenereCipher(); } }
UTF-8
Java
1,638
java
VigenereCipher.java
Java
[ { "context": "ic static void main(String args[]){\r\n\t\tint[] key={17,14,12,4}; //\"rome\"\r\n\t\tVigenereCipher vc=new VigenereCiphe", "end": 1544, "score": 0.9939101338386536, "start": 1534, "tag": "KEY", "value": "17,14,12,4" } ]
null
[]
package Assignment_English_Language_known_Key_Length; import edu.duke.*; import java.util.*; public class VigenereCipher { CaesarCipher[] ciphers; public VigenereCipher(int[] key){ /* * the constructor, which takes a key which is an array of integer * and initialize the field ciphers, which is an array of caesarcipher objects */ ciphers =new CaesarCipher[key.length]; for(int i=0;i<key.length;i++){ ciphers[i]=new CaesarCipher(key[i]); } } public String encrypt(String input){ StringBuilder answer=new StringBuilder(); int i=0; for(char c: input.toCharArray()){ int cipherIndex=i%ciphers.length; CaesarCipher thisCipher=ciphers[cipherIndex]; answer.append(thisCipher.encryptLetter(c)); i++; } return answer.toString(); } public String decrypt(String input){ StringBuilder answer=new StringBuilder(); int i=0; for(char c:input.toCharArray()){ int cipherIndex=i%ciphers.length; CaesarCipher thisCipher=ciphers[cipherIndex]; answer.append(thisCipher.decryptLetter(c)); i++; } return answer.toString(); } public String toString(){ return Arrays.toString(ciphers); } public void testVegenereCipher(){ FileResource fr=new FileResource(); String input=fr.asString(); System.out.println("1 :"+input); String encrypt=encrypt(input); System.out.println("2 :"+encrypt); String decrypt=decrypt(encrypt); System.out.println("3 :"+decrypt); } public static void main(String args[]){ int[] key={17,14,12,4}; //"rome" VigenereCipher vc=new VigenereCipher(key); vc.testVegenereCipher(); } }
1,638
0.684982
0.677045
57
26.736841
18.396727
80
false
false
0
0
0
0
0
0
2.385965
false
false
4
0b9850552dfc4cfd9e2409e5321575328bf45f00
7,593,502,226,752
19b1c2d2a4a1f9fa36fe6f8027d36a4fbcb2925f
/Chat_Video/src/webcam/JPanelVideo.java
11ab44978cefcb06ee517f1cf938aebfba329b42
[]
no_license
Niklaus5665/Java_Chat_Video
https://github.com/Niklaus5665/Java_Chat_Video
1a753957cc8299176647f2de4d3452250783e98c
3009a009ed3b7f2445293a23f94e456a8dbd34a0
refs/heads/master
2020-12-30T17:10:54.365000
2017-06-13T22:50:55
2017-06-13T22:50:55
91,061,929
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package webcam; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.GridLayout; import java.awt.LayoutManager; import java.awt.event.ComponentAdapter; import java.awt.event.ComponentEvent; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JPanel; import javax.swing.OverlayLayout; public class JPanelVideo extends JPanel { /*------------------------------------------------------------------*\ |* Constructeurs *| \*------------------------------------------------------------------*/ public JPanelVideo() { geometry(); control(); appearance(); } /*------------------------------------------------------------------*\ |* Methodes Public *| \*------------------------------------------------------------------*/ /*------------------------------*\ |* Set *| \*------------------------------*/ /*------------------------------*\ |* Get *| \*------------------------------*/ /*------------------------------------------------------------------*\ |* Methodes Private *| \*------------------------------------------------------------------*/ private void geometry() { // JComponent : Instanciation //Partie notre caméra jPanelWebcam = new JPanelWebcam(); jPanelCenter = new JPanel(); jPanelWebcamBorder = new JPanel(); BorderLayout borderLayoutSelfWebcam = new BorderLayout(); jPanelWebcamBorder.setLayout(borderLayoutSelfWebcam); GridBagLayout layoutCenter = new GridBagLayout(); GridBagConstraints gbc = new GridBagConstraints(); jPanelCenter.setLayout(layoutCenter); gbc.weightx = 1; gbc.weighty = 1; gbc.gridx = 0; gbc.gridy = 0; gbc.anchor = GridBagConstraints.LAST_LINE_END; jPanelWebcamBorder.add(jPanelWebcam, BorderLayout.CENTER); jPanelCenter.add(jPanelWebcamBorder, gbc); jPanelCenter.setBackground(Color.RED); //Partie bouton jPanelButton = new JPanel(); btnMiroir = new JButton("Miroir"); btn1 = new JButton("test1"); btn2 = new JButton("Miroir"); btn3 = new JButton("Miroir"); btn4 = new JButton("Miroir"); btn5 = new JButton("Déconnecter"); BorderLayout borderLayout = new BorderLayout(); setLayout(borderLayout); borderLayout.setVgap(20); add(jPanelButton, BorderLayout.SOUTH); jPanelButton.setMaximumSize(new Dimension(Integer.MAX_VALUE, 75)); jPanelButton.setLayout(new GridLayout(0, nombreButton, 10, 0)); jPanelButton.add(btnMiroir); jPanelButton.add(btn1); jPanelButton.add(btn2); jPanelButton.add(btn3); jPanelButton.add(btn4); jPanelButton.add(btn5); //Partie liaison layout pour la superposition jPanAutreCamera = new JPanel(); JPanel jPanCameraTest = new JPanel(); LayoutManager overlay = new OverlayLayout(jPanCameraTest); jPanCameraTest.setLayout(overlay); jPanCameraTest.add(jPanAutreCamera); jPanCameraTest.add(jPanelCenter); BorderLayout borderLayoutAutreCamera = new BorderLayout(); jPanAutreCamera.setLayout(borderLayoutAutreCamera); //jPanAutreCamera.add(jPanelWebcam,BorderLayout.CENTER); //Ajouter la caméra de l'autre jPanAutreCamera.setBackground(Color.GREEN); add(jPanCameraTest, BorderLayout.CENTER); } private void control() { // rien btn1.addComponentListener(new ComponentAdapter() { @Override public void componentResized(ComponentEvent e) { System.out.println(e.getComponent().getWidth()); if (e.getComponent().getWidth() > changementIconeButton) { btn1.setText("Miroir"); btn2.setText("test"); btn3.setText("test"); btn4.setText("test"); btn5.setText("test"); btnMiroir.setText("test"); btnMiroir.setIcon(null); btn1.setIcon(null); btn2.setIcon(null); btn3.setIcon(null); btn4.setIcon(null); btn5.setIcon(null); } else { btnMiroir.setIcon(new ImageIcon(((new ImageIcon("img/btn_mirror.jpg").getImage().getScaledInstance(widthButton, heightButton, java.awt.Image.SCALE_SMOOTH))))); btn1.setIcon(new ImageIcon(((new ImageIcon("img/btn_mirror.png.jpg").getImage().getScaledInstance(widthButton, heightButton, java.awt.Image.SCALE_SMOOTH))))); btn2.setIcon(new ImageIcon(((new ImageIcon("img/background_chat.jpg").getImage().getScaledInstance(widthButton, heightButton, java.awt.Image.SCALE_SMOOTH))))); btn3.setIcon(new ImageIcon(((new ImageIcon("img/background_chat.jpg").getImage().getScaledInstance(widthButton, heightButton, java.awt.Image.SCALE_SMOOTH))))); btn4.setIcon(new ImageIcon(((new ImageIcon("img/background_chat.jpg").getImage().getScaledInstance(widthButton, heightButton, java.awt.Image.SCALE_SMOOTH))))); btn5.setIcon(new ImageIcon(((new ImageIcon("img/background_chat.jpg").getImage().getScaledInstance(widthButton, heightButton, java.awt.Image.SCALE_SMOOTH))))); btn1.setText(""); btn2.setText(""); btn3.setText(""); btn4.setText(""); btn5.setText(""); btnMiroir.setText(""); } } }); jPanelCenter.addComponentListener(new ComponentAdapter() { @Override public void componentMoved(ComponentEvent e) { // TODO Auto-generated method stub d = e.getComponent().getSize(); int h = (int)(d.getHeight() / 4); int w = (int)(d.getWidth() / 4); d = new Dimension(w, h); jPanelWebcamBorder.setMinimumSize(d); jPanelWebcamBorder.setMaximumSize(d); jPanelWebcamBorder.setPreferredSize(d); } @Override public void componentResized(ComponentEvent e) { // TODO Auto-generated method stub d = e.getComponent().getSize(); int h = (int)(d.getHeight() / 4); int w = (int)(d.getWidth() / 4); d = new Dimension(w, h); jPanelWebcamBorder.setMinimumSize(d); jPanelWebcamBorder.setMaximumSize(d); jPanelWebcamBorder.setPreferredSize(d); } }); } private void appearance() { // rien btn1.setAlignmentX(CENTER_ALIGNMENT); btn2.setAlignmentX(CENTER_ALIGNMENT); btn3.setAlignmentX(CENTER_ALIGNMENT); btn4.setAlignmentX(CENTER_ALIGNMENT); btn5.setAlignmentX(CENTER_ALIGNMENT); d = new Dimension(jPanelCenter.getWidth(), jPanelCenter.getHeight()); jPanelWebcamBorder.setMinimumSize(d); jPanelWebcamBorder.setMaximumSize(d); jPanelWebcamBorder.setPreferredSize(d); } /*------------------------------------------------------------------*\ |* Attributs Private *| \*------------------------------------------------------------------*/ // Tools private JButton btnMiroir; private JButton btn1; private JButton btn2; private JButton btn3; private JButton btn4; private JButton btn5; private Dimension d; private int nombreButton = 6; private int heightButton = 16; private int widthButton = 20; private int changementIconeButton = 90; private JPanel jPanAutreCamera; private JPanel jPanelCenter; private JPanel jPanelButton; private JPanelWebcam jPanelWebcam; private JPanel jPanelWebcamBorder; }
ISO-8859-1
Java
7,016
java
JPanelVideo.java
Java
[]
null
[]
package webcam; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.GridLayout; import java.awt.LayoutManager; import java.awt.event.ComponentAdapter; import java.awt.event.ComponentEvent; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JPanel; import javax.swing.OverlayLayout; public class JPanelVideo extends JPanel { /*------------------------------------------------------------------*\ |* Constructeurs *| \*------------------------------------------------------------------*/ public JPanelVideo() { geometry(); control(); appearance(); } /*------------------------------------------------------------------*\ |* Methodes Public *| \*------------------------------------------------------------------*/ /*------------------------------*\ |* Set *| \*------------------------------*/ /*------------------------------*\ |* Get *| \*------------------------------*/ /*------------------------------------------------------------------*\ |* Methodes Private *| \*------------------------------------------------------------------*/ private void geometry() { // JComponent : Instanciation //Partie notre caméra jPanelWebcam = new JPanelWebcam(); jPanelCenter = new JPanel(); jPanelWebcamBorder = new JPanel(); BorderLayout borderLayoutSelfWebcam = new BorderLayout(); jPanelWebcamBorder.setLayout(borderLayoutSelfWebcam); GridBagLayout layoutCenter = new GridBagLayout(); GridBagConstraints gbc = new GridBagConstraints(); jPanelCenter.setLayout(layoutCenter); gbc.weightx = 1; gbc.weighty = 1; gbc.gridx = 0; gbc.gridy = 0; gbc.anchor = GridBagConstraints.LAST_LINE_END; jPanelWebcamBorder.add(jPanelWebcam, BorderLayout.CENTER); jPanelCenter.add(jPanelWebcamBorder, gbc); jPanelCenter.setBackground(Color.RED); //Partie bouton jPanelButton = new JPanel(); btnMiroir = new JButton("Miroir"); btn1 = new JButton("test1"); btn2 = new JButton("Miroir"); btn3 = new JButton("Miroir"); btn4 = new JButton("Miroir"); btn5 = new JButton("Déconnecter"); BorderLayout borderLayout = new BorderLayout(); setLayout(borderLayout); borderLayout.setVgap(20); add(jPanelButton, BorderLayout.SOUTH); jPanelButton.setMaximumSize(new Dimension(Integer.MAX_VALUE, 75)); jPanelButton.setLayout(new GridLayout(0, nombreButton, 10, 0)); jPanelButton.add(btnMiroir); jPanelButton.add(btn1); jPanelButton.add(btn2); jPanelButton.add(btn3); jPanelButton.add(btn4); jPanelButton.add(btn5); //Partie liaison layout pour la superposition jPanAutreCamera = new JPanel(); JPanel jPanCameraTest = new JPanel(); LayoutManager overlay = new OverlayLayout(jPanCameraTest); jPanCameraTest.setLayout(overlay); jPanCameraTest.add(jPanAutreCamera); jPanCameraTest.add(jPanelCenter); BorderLayout borderLayoutAutreCamera = new BorderLayout(); jPanAutreCamera.setLayout(borderLayoutAutreCamera); //jPanAutreCamera.add(jPanelWebcam,BorderLayout.CENTER); //Ajouter la caméra de l'autre jPanAutreCamera.setBackground(Color.GREEN); add(jPanCameraTest, BorderLayout.CENTER); } private void control() { // rien btn1.addComponentListener(new ComponentAdapter() { @Override public void componentResized(ComponentEvent e) { System.out.println(e.getComponent().getWidth()); if (e.getComponent().getWidth() > changementIconeButton) { btn1.setText("Miroir"); btn2.setText("test"); btn3.setText("test"); btn4.setText("test"); btn5.setText("test"); btnMiroir.setText("test"); btnMiroir.setIcon(null); btn1.setIcon(null); btn2.setIcon(null); btn3.setIcon(null); btn4.setIcon(null); btn5.setIcon(null); } else { btnMiroir.setIcon(new ImageIcon(((new ImageIcon("img/btn_mirror.jpg").getImage().getScaledInstance(widthButton, heightButton, java.awt.Image.SCALE_SMOOTH))))); btn1.setIcon(new ImageIcon(((new ImageIcon("img/btn_mirror.png.jpg").getImage().getScaledInstance(widthButton, heightButton, java.awt.Image.SCALE_SMOOTH))))); btn2.setIcon(new ImageIcon(((new ImageIcon("img/background_chat.jpg").getImage().getScaledInstance(widthButton, heightButton, java.awt.Image.SCALE_SMOOTH))))); btn3.setIcon(new ImageIcon(((new ImageIcon("img/background_chat.jpg").getImage().getScaledInstance(widthButton, heightButton, java.awt.Image.SCALE_SMOOTH))))); btn4.setIcon(new ImageIcon(((new ImageIcon("img/background_chat.jpg").getImage().getScaledInstance(widthButton, heightButton, java.awt.Image.SCALE_SMOOTH))))); btn5.setIcon(new ImageIcon(((new ImageIcon("img/background_chat.jpg").getImage().getScaledInstance(widthButton, heightButton, java.awt.Image.SCALE_SMOOTH))))); btn1.setText(""); btn2.setText(""); btn3.setText(""); btn4.setText(""); btn5.setText(""); btnMiroir.setText(""); } } }); jPanelCenter.addComponentListener(new ComponentAdapter() { @Override public void componentMoved(ComponentEvent e) { // TODO Auto-generated method stub d = e.getComponent().getSize(); int h = (int)(d.getHeight() / 4); int w = (int)(d.getWidth() / 4); d = new Dimension(w, h); jPanelWebcamBorder.setMinimumSize(d); jPanelWebcamBorder.setMaximumSize(d); jPanelWebcamBorder.setPreferredSize(d); } @Override public void componentResized(ComponentEvent e) { // TODO Auto-generated method stub d = e.getComponent().getSize(); int h = (int)(d.getHeight() / 4); int w = (int)(d.getWidth() / 4); d = new Dimension(w, h); jPanelWebcamBorder.setMinimumSize(d); jPanelWebcamBorder.setMaximumSize(d); jPanelWebcamBorder.setPreferredSize(d); } }); } private void appearance() { // rien btn1.setAlignmentX(CENTER_ALIGNMENT); btn2.setAlignmentX(CENTER_ALIGNMENT); btn3.setAlignmentX(CENTER_ALIGNMENT); btn4.setAlignmentX(CENTER_ALIGNMENT); btn5.setAlignmentX(CENTER_ALIGNMENT); d = new Dimension(jPanelCenter.getWidth(), jPanelCenter.getHeight()); jPanelWebcamBorder.setMinimumSize(d); jPanelWebcamBorder.setMaximumSize(d); jPanelWebcamBorder.setPreferredSize(d); } /*------------------------------------------------------------------*\ |* Attributs Private *| \*------------------------------------------------------------------*/ // Tools private JButton btnMiroir; private JButton btn1; private JButton btn2; private JButton btn3; private JButton btn4; private JButton btn5; private Dimension d; private int nombreButton = 6; private int heightButton = 16; private int widthButton = 20; private int changementIconeButton = 90; private JPanel jPanAutreCamera; private JPanel jPanelCenter; private JPanel jPanelButton; private JPanelWebcam jPanelWebcam; private JPanel jPanelWebcamBorder; }
7,016
0.639812
0.630543
222
30.585585
29.091024
164
false
false
0
0
0
0
0
0
3.189189
false
false
4
ee9b54db637ac9149940e1af0c03ef9cca602736
16,724,602,693,138
6fc7be33251aa544a9ec762528a8350a7ef7e3e5
/src/team/group26/activeReplica/Bank.java
3818a6773bd698e79790bc51dd3485dcb485c156
[]
no_license
Jamie-Jay/Reliable-Distributed-System-Bank
https://github.com/Jamie-Jay/Reliable-Distributed-System-Bank
bd7ed6303b62ec54f91545a7b35f4176e660dee9
6f8955767d1cc25478f681838bc1e25fb58d4787
refs/heads/master
2023-01-09T20:42:03.716000
2020-07-27T05:55:55
2020-07-27T05:55:55
311,389,781
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package team.group26.activeReplica; public class Bank { private int balance=0; private static Bank bank; //make the constructor private private Bank(){ } public static Bank getInstance() { if (bank == null) { synchronized (Bank.class) { if (bank == null) { bank = new Bank(); } } } return bank; } public synchronized void depositMoney(String cID,int money) { balance+=money; } public synchronized boolean withdrawMoney(String cID, int money) { if(balance-money<0) { return false; }else { balance-=money; return true; } } public int getBalance() { return balance; } public synchronized void setBalance(int money) { this.balance = money; } }
UTF-8
Java
911
java
Bank.java
Java
[]
null
[]
package team.group26.activeReplica; public class Bank { private int balance=0; private static Bank bank; //make the constructor private private Bank(){ } public static Bank getInstance() { if (bank == null) { synchronized (Bank.class) { if (bank == null) { bank = new Bank(); } } } return bank; } public synchronized void depositMoney(String cID,int money) { balance+=money; } public synchronized boolean withdrawMoney(String cID, int money) { if(balance-money<0) { return false; }else { balance-=money; return true; } } public int getBalance() { return balance; } public synchronized void setBalance(int money) { this.balance = money; } }
911
0.513721
0.50933
49
17.591837
16.940374
68
false
false
0
0
0
0
0
0
0.265306
false
false
4
e10c12a165173df3f7ef195fb2e5e8e8ed2e56be
6,373,731,509,378
df9fd3aec585b61a704d8fcbc3b61235fa142ad0
/JSocketsLibrary/src/jsockets/client/SocketClient.java
956d5fc1c23db6dd3aff7013ab64f0613e645c1e
[ "Apache-2.0" ]
permissive
rcasanovan/JSockets
https://github.com/rcasanovan/JSockets
6207eb756803c68e37b0197ec6d2c24f3e73ef21
8d1cbd7a71d21e0a3cb734d77be756f453d7f4c9
refs/heads/master
2016-09-05T10:18:57.417000
2016-02-07T11:45:04
2016-02-07T11:45:04
39,007,049
4
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package jsockets.client; import java.io.*; import java.net.ConnectException; import java.net.InetAddress; import java.net.Socket; import jsockets.util.UtilFunctions; /** * Class that contains the request made by the client to the server via * the protocol specified * @author Ricardo Casanova * @author Gerardo Barcia * @version 1.0.0 * @since JSockets 1.0.0 */ public final class SocketClient { private Socket client; private ObjectOutputStream out; private ObjectInputStream in; /** * Class constructor * @since JSockets 1.0.0 */ public SocketClient() { client = null; out = null; in = null; showInitialMessage(); } /** * Class constructor * @param showMessage boolean to show the initial message * @since JSockets 1.0.0 */ public SocketClient(boolean showMessage) { client = null; out = null; in = null; if (showMessage) showInitialMessage(); } /** * Method to get the client output stream * @return The client output stream * @since JSockets 1.0.0 */ public OutputStream getOutputStream() { OutputStream result = null; try { result = this.client.getOutputStream(); } catch (IOException e) { result = null; System.err.println("Error getting the outputstream from client"); } return result; } /** * Method to get the client input stream * @return The client input stream * @since JSockets 1.0.0 */ public InputStream getInputStream() { InputStream result; try { result = this.client.getInputStream(); } catch (IOException e) { result = null; System.err.println("Error getting the inputstream from client"); } return result; } /** * Method to show initial welcome message * @since JSockets 1.0.0 */ private void showInitialMessage() { UtilFunctions.showInitialMessage(true); } /** * Method to execute the request to the server with an answer * @param message Object to send to the specified protocol * @param host destination host * @param port destination port number * @return Message returned by the server * @since JSockets 1.0.0 */ public byte [] executeRequestWithAnswer(Object message, String host, Integer port) { byte [] result = null; try { connectToTheServer(host, port); out = new ObjectOutputStream(client.getOutputStream()); out.flush(); in = new ObjectInputStream(client.getInputStream()); sendData(message); result = readData(); } catch (EOFException eofE) { System.err.println("The client terminates the connection"); } // process problems that can happen when communicating with the server catch (IOException ioE) { ioE.printStackTrace(); } finally { closeConnection(); return result; } } /** * Method to execute the request to the server without an answer * @param message Object to send to the specified protocol * @param host destination host * @param port destination port number * @since JSockets 1.0.0 */ public void executeRequestWithoutAnswer(Object message, String host, Integer port) { try { connectToTheServer(host, port); out = new ObjectOutputStream(client.getOutputStream()); out.flush(); in = new ObjectInputStream(client.getInputStream()); sendData(message); } catch (EOFException eofE) { System.err.println("The client terminates the connection"); } // process problems that can happen when communicating with the server catch (IOException ioE) { ioE.printStackTrace(); } finally { closeConnection(); } } /** * Method to establish the connection to the server * @param host destination host * @param port destination port number * @throws the method can handle exceptions of IOException type * @since JSockets 1.0.0 */ private void connectToTheServer(String host, Integer port) throws IOException, ConnectException { System.out.println("Establishing connection..."); try { client = new Socket(InetAddress.getByName(host), port); System.out.println("The client is connected to: " + client.getInetAddress().getHostName()); } catch (ConnectException cE) { System.err.println("Error in the connection with the server"); } } /** * Method to close the connection to the server */ private void closeConnection() { try { client.close(); } catch(IOException ioE) { ioE.printStackTrace(); } } /** * Method to send messages to the server * @param message Object to send to the specified protocol * @throws the method can handle exceptions of IOException type * @since JSockets 1.0.0 */ private void sendData(Object message) throws IOException { byte [] stringMessage = UtilFunctions.objectToByteArray(message); out.writeObject(stringMessage); out.flush(); System.out.println("The message has been sent to the server"); } /** * Method to read messages from the server * @throws the method can handle exceptions of IOException type * @return Byte array that the server sends * @since JSockets 1.0.0 */ private byte [] readData() throws IOException { byte [] resultMessage; resultMessage = null; try { resultMessage = (byte []) in.readObject(); } finally { return resultMessage; } } }
UTF-8
Java
6,384
java
SocketClient.java
Java
[ { "context": "he server via\n * the protocol specified\n * @author Ricardo Casanova\n * @author Gerardo Barcia\n * @version 1.0.0\n * @s", "end": 297, "score": 0.9998378753662109, "start": 281, "tag": "NAME", "value": "Ricardo Casanova" }, { "context": "l specified\n * @author Ricardo Casanova\n * @author Gerardo Barcia\n * @version 1.0.0\n * @since JSockets 1.0.0\n */\npu", "end": 323, "score": 0.9998555183410645, "start": 309, "tag": "NAME", "value": "Gerardo Barcia" } ]
null
[]
package jsockets.client; import java.io.*; import java.net.ConnectException; import java.net.InetAddress; import java.net.Socket; import jsockets.util.UtilFunctions; /** * Class that contains the request made by the client to the server via * the protocol specified * @author <NAME> * @author <NAME> * @version 1.0.0 * @since JSockets 1.0.0 */ public final class SocketClient { private Socket client; private ObjectOutputStream out; private ObjectInputStream in; /** * Class constructor * @since JSockets 1.0.0 */ public SocketClient() { client = null; out = null; in = null; showInitialMessage(); } /** * Class constructor * @param showMessage boolean to show the initial message * @since JSockets 1.0.0 */ public SocketClient(boolean showMessage) { client = null; out = null; in = null; if (showMessage) showInitialMessage(); } /** * Method to get the client output stream * @return The client output stream * @since JSockets 1.0.0 */ public OutputStream getOutputStream() { OutputStream result = null; try { result = this.client.getOutputStream(); } catch (IOException e) { result = null; System.err.println("Error getting the outputstream from client"); } return result; } /** * Method to get the client input stream * @return The client input stream * @since JSockets 1.0.0 */ public InputStream getInputStream() { InputStream result; try { result = this.client.getInputStream(); } catch (IOException e) { result = null; System.err.println("Error getting the inputstream from client"); } return result; } /** * Method to show initial welcome message * @since JSockets 1.0.0 */ private void showInitialMessage() { UtilFunctions.showInitialMessage(true); } /** * Method to execute the request to the server with an answer * @param message Object to send to the specified protocol * @param host destination host * @param port destination port number * @return Message returned by the server * @since JSockets 1.0.0 */ public byte [] executeRequestWithAnswer(Object message, String host, Integer port) { byte [] result = null; try { connectToTheServer(host, port); out = new ObjectOutputStream(client.getOutputStream()); out.flush(); in = new ObjectInputStream(client.getInputStream()); sendData(message); result = readData(); } catch (EOFException eofE) { System.err.println("The client terminates the connection"); } // process problems that can happen when communicating with the server catch (IOException ioE) { ioE.printStackTrace(); } finally { closeConnection(); return result; } } /** * Method to execute the request to the server without an answer * @param message Object to send to the specified protocol * @param host destination host * @param port destination port number * @since JSockets 1.0.0 */ public void executeRequestWithoutAnswer(Object message, String host, Integer port) { try { connectToTheServer(host, port); out = new ObjectOutputStream(client.getOutputStream()); out.flush(); in = new ObjectInputStream(client.getInputStream()); sendData(message); } catch (EOFException eofE) { System.err.println("The client terminates the connection"); } // process problems that can happen when communicating with the server catch (IOException ioE) { ioE.printStackTrace(); } finally { closeConnection(); } } /** * Method to establish the connection to the server * @param host destination host * @param port destination port number * @throws the method can handle exceptions of IOException type * @since JSockets 1.0.0 */ private void connectToTheServer(String host, Integer port) throws IOException, ConnectException { System.out.println("Establishing connection..."); try { client = new Socket(InetAddress.getByName(host), port); System.out.println("The client is connected to: " + client.getInetAddress().getHostName()); } catch (ConnectException cE) { System.err.println("Error in the connection with the server"); } } /** * Method to close the connection to the server */ private void closeConnection() { try { client.close(); } catch(IOException ioE) { ioE.printStackTrace(); } } /** * Method to send messages to the server * @param message Object to send to the specified protocol * @throws the method can handle exceptions of IOException type * @since JSockets 1.0.0 */ private void sendData(Object message) throws IOException { byte [] stringMessage = UtilFunctions.objectToByteArray(message); out.writeObject(stringMessage); out.flush(); System.out.println("The message has been sent to the server"); } /** * Method to read messages from the server * @throws the method can handle exceptions of IOException type * @return Byte array that the server sends * @since JSockets 1.0.0 */ private byte [] readData() throws IOException { byte [] resultMessage; resultMessage = null; try { resultMessage = (byte []) in.readObject(); } finally { return resultMessage; } } }
6,366
0.566886
0.561247
251
24.438248
22.261734
103
false
false
0
0
0
0
0
0
0.278884
false
false
4
448bae96e2703962ad8b8334f96199f039050b9b
22,265,110,501,292
c7f905e333679b2b3bff43585b42790a6228b1da
/src/main/java/mymap/item/vo/MapPublicpakVo.java
6fc9a8153ed80f9c342db630f4441890c3d9538b
[]
no_license
hbyyb/item
https://github.com/hbyyb/item
1532b8e327b514701fd85ed8e25fab9ea7499e3a
14376a541a2faca218df8b39ff178c1ec3fd3073
refs/heads/master
2023-03-20T22:40:37.407000
2021-03-11T08:52:15
2021-03-11T08:52:15
346,637,951
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package mymap.item.vo; import javax.persistence.Column; import javax.persistence.Id; import javax.persistence.Table; import java.math.BigDecimal; import java.util.Date; @Table(name = "map_publicpak") public class MapPublicpakVo { @Id @Column(name = "publicpark_id") private Long publicparkId; @Column(name = "publicpark_name") private String publicparkName; @Column(name = "publicpark_address") private String publicparkAddress; @Column(name = "publicpark_area") private Date publicparkArea; @Column(name = "publicpark_labor_company") private Integer publicparkLaborCompany; @Column(name = "publicpark_longitude") private BigDecimal publicparkLongitude; @Column(name = "publicpark_llatitude") private BigDecimal publicparkLlatitude; /** * @return publicpark_id */ public Long getPublicparkId() { return publicparkId; } /** * @param publicparkId */ public void setPublicparkId(Long publicparkId) { this.publicparkId = publicparkId; } /** * @return publicpark_name */ public String getPublicparkName() { return publicparkName; } /** * @param publicparkName */ public void setPublicparkName(String publicparkName) { this.publicparkName = publicparkName; } /** * @return publicpark_address */ public String getPublicparkAddress() { return publicparkAddress; } /** * @param publicparkAddress */ public void setPublicparkAddress(String publicparkAddress) { this.publicparkAddress = publicparkAddress; } /** * @return publicpark_area */ public Date getPublicparkArea() { return publicparkArea; } /** * @param publicparkArea */ public void setPublicparkArea(Date publicparkArea) { this.publicparkArea = publicparkArea; } /** * @return publicpark_labor_company */ public Integer getPublicparkLaborCompany() { return publicparkLaborCompany; } /** * @param publicparkLaborCompany */ public void setPublicparkLaborCompany(Integer publicparkLaborCompany) { this.publicparkLaborCompany = publicparkLaborCompany; } /** * @return publicpark_longitude */ public BigDecimal getPublicparkLongitude() { return publicparkLongitude; } /** * @param publicparkLongitude */ public void setPublicparkLongitude(BigDecimal publicparkLongitude) { this.publicparkLongitude = publicparkLongitude; } /** * @return publicpark_llatitude */ public BigDecimal getPublicparkLlatitude() { return publicparkLlatitude; } /** * @param publicparkLlatitude */ public void setPublicparkLlatitude(BigDecimal publicparkLlatitude) { this.publicparkLlatitude = publicparkLlatitude; } }
UTF-8
Java
2,939
java
MapPublicpakVo.java
Java
[]
null
[]
package mymap.item.vo; import javax.persistence.Column; import javax.persistence.Id; import javax.persistence.Table; import java.math.BigDecimal; import java.util.Date; @Table(name = "map_publicpak") public class MapPublicpakVo { @Id @Column(name = "publicpark_id") private Long publicparkId; @Column(name = "publicpark_name") private String publicparkName; @Column(name = "publicpark_address") private String publicparkAddress; @Column(name = "publicpark_area") private Date publicparkArea; @Column(name = "publicpark_labor_company") private Integer publicparkLaborCompany; @Column(name = "publicpark_longitude") private BigDecimal publicparkLongitude; @Column(name = "publicpark_llatitude") private BigDecimal publicparkLlatitude; /** * @return publicpark_id */ public Long getPublicparkId() { return publicparkId; } /** * @param publicparkId */ public void setPublicparkId(Long publicparkId) { this.publicparkId = publicparkId; } /** * @return publicpark_name */ public String getPublicparkName() { return publicparkName; } /** * @param publicparkName */ public void setPublicparkName(String publicparkName) { this.publicparkName = publicparkName; } /** * @return publicpark_address */ public String getPublicparkAddress() { return publicparkAddress; } /** * @param publicparkAddress */ public void setPublicparkAddress(String publicparkAddress) { this.publicparkAddress = publicparkAddress; } /** * @return publicpark_area */ public Date getPublicparkArea() { return publicparkArea; } /** * @param publicparkArea */ public void setPublicparkArea(Date publicparkArea) { this.publicparkArea = publicparkArea; } /** * @return publicpark_labor_company */ public Integer getPublicparkLaborCompany() { return publicparkLaborCompany; } /** * @param publicparkLaborCompany */ public void setPublicparkLaborCompany(Integer publicparkLaborCompany) { this.publicparkLaborCompany = publicparkLaborCompany; } /** * @return publicpark_longitude */ public BigDecimal getPublicparkLongitude() { return publicparkLongitude; } /** * @param publicparkLongitude */ public void setPublicparkLongitude(BigDecimal publicparkLongitude) { this.publicparkLongitude = publicparkLongitude; } /** * @return publicpark_llatitude */ public BigDecimal getPublicparkLlatitude() { return publicparkLlatitude; } /** * @param publicparkLlatitude */ public void setPublicparkLlatitude(BigDecimal publicparkLlatitude) { this.publicparkLlatitude = publicparkLlatitude; } }
2,939
0.652603
0.652603
130
21.615385
19.724012
75
false
false
0
0
0
0
0
0
0.207692
false
false
4
bf5fabb693b5db71b03e35accd8037d103766423
16,621,523,491,195
95e944448000c08dd3d6915abb468767c9f29d3c
/sources/com/bytedance/apm/agent/tracing/AutoPageTraceHelper.java
0decc74ff113112f189beaa50596fba6294abe7d
[]
no_license
xrealm/tiktok-src
https://github.com/xrealm/tiktok-src
261b1faaf7b39d64bb7cb4106dc1a35963bd6868
90f305b5f981d39cfb313d75ab231326c9fca597
refs/heads/master
2022-11-12T06:43:07.401000
2020-07-04T20:21:12
2020-07-04T20:21:12
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.bytedance.apm.agent.tracing; import android.text.TextUtils; import com.bytedance.apm.p252m.C6273b; import com.bytedance.apm.p253n.p470b.C9635a; import java.util.HashSet; import java.util.concurrent.ConcurrentLinkedQueue; public class AutoPageTraceHelper { private static boolean sIsFirstWindowFocusChangedActivity; private static long sMaxValidTimeMs = 10000; private static final HashSet<String> sMethodSet = new HashSet<>(32); private static final ConcurrentLinkedQueue<PageTraceEntity> sPageList = new ConcurrentLinkedQueue<>(); /* JADX WARNING: Code restructure failed: missing block: B:30:0x0137, code lost: return; */ /* Code decompiled incorrectly, please refer to instructions dump. */ public static void reportStats() { /* java.util.concurrent.ConcurrentLinkedQueue<com.bytedance.apm.agent.tracing.PageTraceEntity> r0 = sPageList // Catch:{ Exception -> 0x0138 } int r0 = r0.size() // Catch:{ Exception -> 0x0138 } r1 = 0 L_0x0007: if (r1 >= r0) goto L_0x0137 java.util.concurrent.ConcurrentLinkedQueue<com.bytedance.apm.agent.tracing.PageTraceEntity> r2 = sPageList // Catch:{ Exception -> 0x0138 } java.lang.Object r2 = r2.peek() // Catch:{ Exception -> 0x0138 } com.bytedance.apm.agent.tracing.PageTraceEntity r2 = (com.bytedance.apm.agent.tracing.PageTraceEntity) r2 // Catch:{ Exception -> 0x0138 } if (r2 == 0) goto L_0x0137 long r3 = r2.onWindowFocusTs // Catch:{ Exception -> 0x0138 } r5 = 0 int r7 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1)) if (r7 != 0) goto L_0x0021 long r2 = r2.onViewShowTs // Catch:{ Exception -> 0x0138 } int r4 = (r2 > r5 ? 1 : (r2 == r5 ? 0 : -1)) if (r4 == 0) goto L_0x0137 L_0x0021: java.util.concurrent.ConcurrentLinkedQueue<com.bytedance.apm.agent.tracing.PageTraceEntity> r2 = sPageList // Catch:{ Exception -> 0x0138 } java.lang.Object r2 = r2.poll() // Catch:{ Exception -> 0x0138 } com.bytedance.apm.agent.tracing.PageTraceEntity r2 = (com.bytedance.apm.agent.tracing.PageTraceEntity) r2 // Catch:{ Exception -> 0x0138 } boolean r3 = r2.isValid() // Catch:{ Exception -> 0x0138 } if (r3 != 0) goto L_0x0040 boolean r0 = com.bytedance.apm.C6174c.m19149g() // Catch:{ Exception -> 0x0138 } if (r0 == 0) goto L_0x0137 com.bytedance.apm.d r0 = com.bytedance.apm.C6179d.m19171a() // Catch:{ Exception -> 0x0138 } java.lang.String r1 = "apm_autopage" r0.mo14889a(r1) // Catch:{ Exception -> 0x0138 } goto L_0x0138 L_0x0040: org.json.JSONObject r3 = new org.json.JSONObject // Catch:{ Exception -> 0x0138 } r3.<init>() // Catch:{ Exception -> 0x0138 } java.lang.String r4 = "name" java.lang.String r7 = "onCreate" r3.put(r4, r7) // Catch:{ Exception -> 0x0138 } java.lang.String r4 = "start" long r7 = r2.onCreateStartTs // Catch:{ Exception -> 0x0138 } r3.put(r4, r7) // Catch:{ Exception -> 0x0138 } java.lang.String r4 = "end" long r7 = r2.onCreateEndTs // Catch:{ Exception -> 0x0138 } r3.put(r4, r7) // Catch:{ Exception -> 0x0138 } org.json.JSONObject r4 = new org.json.JSONObject // Catch:{ Exception -> 0x0138 } r4.<init>() // Catch:{ Exception -> 0x0138 } java.lang.String r7 = "name" java.lang.String r8 = "onResume" r4.put(r7, r8) // Catch:{ Exception -> 0x0138 } java.lang.String r7 = "start" long r8 = r2.onResumeStartTs // Catch:{ Exception -> 0x0138 } r4.put(r7, r8) // Catch:{ Exception -> 0x0138 } java.lang.String r7 = "end" long r8 = r2.onResumeEndTs // Catch:{ Exception -> 0x0138 } r4.put(r7, r8) // Catch:{ Exception -> 0x0138 } org.json.JSONObject r7 = new org.json.JSONObject // Catch:{ Exception -> 0x0138 } r7.<init>() // Catch:{ Exception -> 0x0138 } java.lang.String r8 = "name" java.lang.String r9 = "onWindowFocusChanged" r7.put(r8, r9) // Catch:{ Exception -> 0x0138 } java.lang.String r8 = "start" long r9 = r2.onWindowFocusTs // Catch:{ Exception -> 0x0138 } r7.put(r8, r9) // Catch:{ Exception -> 0x0138 } org.json.JSONArray r8 = new org.json.JSONArray // Catch:{ Exception -> 0x0138 } r8.<init>() // Catch:{ Exception -> 0x0138 } r8.put(r3) // Catch:{ Exception -> 0x0138 } r8.put(r4) // Catch:{ Exception -> 0x0138 } r8.put(r7) // Catch:{ Exception -> 0x0138 } long r3 = r2.onViewShowTs // Catch:{ Exception -> 0x0138 } int r7 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1)) if (r7 <= 0) goto L_0x00b1 org.json.JSONObject r3 = new org.json.JSONObject // Catch:{ Exception -> 0x0138 } r3.<init>() // Catch:{ Exception -> 0x0138 } java.lang.String r4 = "name" java.lang.String r7 = "viewShow" r3.put(r4, r7) // Catch:{ Exception -> 0x0138 } java.lang.String r4 = "start" long r9 = r2.onViewShowTs // Catch:{ Exception -> 0x0138 } r3.put(r4, r9) // Catch:{ Exception -> 0x0138 } r8.put(r3) // Catch:{ Exception -> 0x0138 } L_0x00b1: org.json.JSONObject r3 = new org.json.JSONObject // Catch:{ Exception -> 0x0138 } r3.<init>() // Catch:{ Exception -> 0x0138 } java.lang.String r4 = "name" java.lang.String r7 = "page_load_stats" r3.put(r4, r7) // Catch:{ Exception -> 0x0138 } java.lang.String r4 = "page_type" java.lang.String r7 = "activity" r3.put(r4, r7) // Catch:{ Exception -> 0x0138 } java.lang.String r4 = "start" long r9 = r2.onCreateStartTs // Catch:{ Exception -> 0x0138 } r3.put(r4, r9) // Catch:{ Exception -> 0x0138 } long r9 = r2.onViewShowTs // Catch:{ Exception -> 0x0138 } int r4 = (r9 > r5 ? 1 : (r9 == r5 ? 0 : -1)) if (r4 <= 0) goto L_0x00e5 java.lang.String r4 = "end" long r5 = r2.onViewShowTs // Catch:{ Exception -> 0x0138 } r3.put(r4, r5) // Catch:{ Exception -> 0x0138 } long r4 = r2.onViewShowTs // Catch:{ Exception -> 0x0138 } long r6 = r2.onCreateStartTs // Catch:{ Exception -> 0x0138 } r9 = 0 long r4 = r4 - r6 long r6 = sMaxValidTimeMs // Catch:{ Exception -> 0x0138 } int r9 = (r4 > r6 ? 1 : (r4 == r6 ? 0 : -1)) if (r9 <= 0) goto L_0x00f8 goto L_0x0133 L_0x00e5: java.lang.String r4 = "end" long r5 = r2.onWindowFocusTs // Catch:{ Exception -> 0x0138 } r3.put(r4, r5) // Catch:{ Exception -> 0x0138 } long r4 = r2.onWindowFocusTs // Catch:{ Exception -> 0x0138 } long r6 = r2.onCreateStartTs // Catch:{ Exception -> 0x0138 } r9 = 0 long r4 = r4 - r6 long r6 = sMaxValidTimeMs // Catch:{ Exception -> 0x0138 } int r9 = (r4 > r6 ? 1 : (r4 == r6 ? 0 : -1)) if (r9 > 0) goto L_0x0133 L_0x00f8: java.lang.String r4 = "spans" r3.put(r4, r8) // Catch:{ Exception -> 0x0138 } java.util.HashSet<java.lang.String> r4 = sMethodSet // Catch:{ Exception -> 0x0138 } java.lang.String r5 = r2.pageName // Catch:{ Exception -> 0x0138 } boolean r4 = r4.contains(r5) // Catch:{ Exception -> 0x0138 } r5 = 1 if (r4 == 0) goto L_0x010a r4 = 2 goto L_0x010b L_0x010a: r4 = 1 L_0x010b: java.util.HashSet<java.lang.String> r6 = sMethodSet // Catch:{ Exception -> 0x0138 } java.lang.String r7 = r2.pageName // Catch:{ Exception -> 0x0138 } r6.add(r7) // Catch:{ Exception -> 0x0138 } java.lang.String r6 = "launch_mode" r3.put(r6, r4) // Catch:{ Exception -> 0x0138 } java.lang.String r4 = "collect_from" r3.put(r4, r5) // Catch:{ Exception -> 0x0138 } java.lang.String r4 = "page_name" java.lang.String r2 = r2.pageName // Catch:{ Exception -> 0x0138 } r3.put(r4, r2) // Catch:{ Exception -> 0x0138 } org.json.JSONObject r2 = new org.json.JSONObject // Catch:{ Exception -> 0x0138 } r2.<init>() // Catch:{ Exception -> 0x0138 } java.lang.String r4 = "trace" r2.put(r4, r3) // Catch:{ Exception -> 0x0138 } java.lang.String r3 = "page_load_trace" r4 = 0 com.bytedance.apm.agent.monitor.MonitorTool.monitorPerformance(r3, r4, r4, r2) // Catch:{ Exception -> 0x0138 } L_0x0133: int r1 = r1 + 1 goto L_0x0007 L_0x0137: return L_0x0138: return */ throw new UnsupportedOperationException("Method not decompiled: com.bytedance.apm.agent.tracing.AutoPageTraceHelper.reportStats():void"); } public static void setMaxValidTimeMs(long j) { sMaxValidTimeMs = j; } public static void reportViewIdStats(long j, String str) { PageTraceEntity pageTraceEntity = (PageTraceEntity) sPageList.peek(); if (pageTraceEntity != null && TextUtils.equals(str, pageTraceEntity.pageName)) { pageTraceEntity.onViewShowTs = j; C6273b.m19475a().mo15066a((Runnable) new Runnable() { public final void run() { AutoPageTraceHelper.reportStats(); } }); } } public static void onTrace(String str, String str2, boolean z) { if (TextUtils.equals("onCreate", str2)) { if (z) { if (!sIsFirstWindowFocusChangedActivity) { AutoLaunchTraceHelper.launcherActivityOnCreateStart(str); } sPageList.add(new PageTraceEntity(str, System.currentTimeMillis())); return; } if (!sIsFirstWindowFocusChangedActivity) { AutoLaunchTraceHelper.launcherActivityOnCreateEnd(); } PageTraceEntity pageTraceEntity = (PageTraceEntity) sPageList.peek(); if (pageTraceEntity != null) { pageTraceEntity.onCreateEndTs = System.currentTimeMillis(); } } else if (!TextUtils.equals("onResume", str2)) { if (TextUtils.equals("onWindowFocusChanged", str2) && z) { if (!sIsFirstWindowFocusChangedActivity) { AutoLaunchTraceHelper.launcherActivityOnWindowFocusChangedStart(str); sIsFirstWindowFocusChangedActivity = true; } PageTraceEntity pageTraceEntity2 = (PageTraceEntity) sPageList.peek(); if (pageTraceEntity2 != null && pageTraceEntity2.onWindowFocusTs == 0) { pageTraceEntity2.onWindowFocusTs = System.currentTimeMillis(); if (C9635a.m28501a(str) == null) { C6273b.m19475a().mo15066a((Runnable) new Runnable() { public final void run() { AutoPageTraceHelper.reportStats(); } }); } } } } else if (z) { if (!sIsFirstWindowFocusChangedActivity) { AutoLaunchTraceHelper.launcherActivityOnResumeStart(str); } PageTraceEntity pageTraceEntity3 = (PageTraceEntity) sPageList.peek(); if (pageTraceEntity3 != null) { pageTraceEntity3.onResumeStartTs = System.currentTimeMillis(); } } else { if (!sIsFirstWindowFocusChangedActivity) { AutoLaunchTraceHelper.launcherActivityOnResumeEnd(); } PageTraceEntity pageTraceEntity4 = (PageTraceEntity) sPageList.peek(); if (pageTraceEntity4 != null) { pageTraceEntity4.onResumeEndTs = System.currentTimeMillis(); } } } }
UTF-8
Java
12,816
java
AutoPageTraceHelper.java
Java
[]
null
[]
package com.bytedance.apm.agent.tracing; import android.text.TextUtils; import com.bytedance.apm.p252m.C6273b; import com.bytedance.apm.p253n.p470b.C9635a; import java.util.HashSet; import java.util.concurrent.ConcurrentLinkedQueue; public class AutoPageTraceHelper { private static boolean sIsFirstWindowFocusChangedActivity; private static long sMaxValidTimeMs = 10000; private static final HashSet<String> sMethodSet = new HashSet<>(32); private static final ConcurrentLinkedQueue<PageTraceEntity> sPageList = new ConcurrentLinkedQueue<>(); /* JADX WARNING: Code restructure failed: missing block: B:30:0x0137, code lost: return; */ /* Code decompiled incorrectly, please refer to instructions dump. */ public static void reportStats() { /* java.util.concurrent.ConcurrentLinkedQueue<com.bytedance.apm.agent.tracing.PageTraceEntity> r0 = sPageList // Catch:{ Exception -> 0x0138 } int r0 = r0.size() // Catch:{ Exception -> 0x0138 } r1 = 0 L_0x0007: if (r1 >= r0) goto L_0x0137 java.util.concurrent.ConcurrentLinkedQueue<com.bytedance.apm.agent.tracing.PageTraceEntity> r2 = sPageList // Catch:{ Exception -> 0x0138 } java.lang.Object r2 = r2.peek() // Catch:{ Exception -> 0x0138 } com.bytedance.apm.agent.tracing.PageTraceEntity r2 = (com.bytedance.apm.agent.tracing.PageTraceEntity) r2 // Catch:{ Exception -> 0x0138 } if (r2 == 0) goto L_0x0137 long r3 = r2.onWindowFocusTs // Catch:{ Exception -> 0x0138 } r5 = 0 int r7 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1)) if (r7 != 0) goto L_0x0021 long r2 = r2.onViewShowTs // Catch:{ Exception -> 0x0138 } int r4 = (r2 > r5 ? 1 : (r2 == r5 ? 0 : -1)) if (r4 == 0) goto L_0x0137 L_0x0021: java.util.concurrent.ConcurrentLinkedQueue<com.bytedance.apm.agent.tracing.PageTraceEntity> r2 = sPageList // Catch:{ Exception -> 0x0138 } java.lang.Object r2 = r2.poll() // Catch:{ Exception -> 0x0138 } com.bytedance.apm.agent.tracing.PageTraceEntity r2 = (com.bytedance.apm.agent.tracing.PageTraceEntity) r2 // Catch:{ Exception -> 0x0138 } boolean r3 = r2.isValid() // Catch:{ Exception -> 0x0138 } if (r3 != 0) goto L_0x0040 boolean r0 = com.bytedance.apm.C6174c.m19149g() // Catch:{ Exception -> 0x0138 } if (r0 == 0) goto L_0x0137 com.bytedance.apm.d r0 = com.bytedance.apm.C6179d.m19171a() // Catch:{ Exception -> 0x0138 } java.lang.String r1 = "apm_autopage" r0.mo14889a(r1) // Catch:{ Exception -> 0x0138 } goto L_0x0138 L_0x0040: org.json.JSONObject r3 = new org.json.JSONObject // Catch:{ Exception -> 0x0138 } r3.<init>() // Catch:{ Exception -> 0x0138 } java.lang.String r4 = "name" java.lang.String r7 = "onCreate" r3.put(r4, r7) // Catch:{ Exception -> 0x0138 } java.lang.String r4 = "start" long r7 = r2.onCreateStartTs // Catch:{ Exception -> 0x0138 } r3.put(r4, r7) // Catch:{ Exception -> 0x0138 } java.lang.String r4 = "end" long r7 = r2.onCreateEndTs // Catch:{ Exception -> 0x0138 } r3.put(r4, r7) // Catch:{ Exception -> 0x0138 } org.json.JSONObject r4 = new org.json.JSONObject // Catch:{ Exception -> 0x0138 } r4.<init>() // Catch:{ Exception -> 0x0138 } java.lang.String r7 = "name" java.lang.String r8 = "onResume" r4.put(r7, r8) // Catch:{ Exception -> 0x0138 } java.lang.String r7 = "start" long r8 = r2.onResumeStartTs // Catch:{ Exception -> 0x0138 } r4.put(r7, r8) // Catch:{ Exception -> 0x0138 } java.lang.String r7 = "end" long r8 = r2.onResumeEndTs // Catch:{ Exception -> 0x0138 } r4.put(r7, r8) // Catch:{ Exception -> 0x0138 } org.json.JSONObject r7 = new org.json.JSONObject // Catch:{ Exception -> 0x0138 } r7.<init>() // Catch:{ Exception -> 0x0138 } java.lang.String r8 = "name" java.lang.String r9 = "onWindowFocusChanged" r7.put(r8, r9) // Catch:{ Exception -> 0x0138 } java.lang.String r8 = "start" long r9 = r2.onWindowFocusTs // Catch:{ Exception -> 0x0138 } r7.put(r8, r9) // Catch:{ Exception -> 0x0138 } org.json.JSONArray r8 = new org.json.JSONArray // Catch:{ Exception -> 0x0138 } r8.<init>() // Catch:{ Exception -> 0x0138 } r8.put(r3) // Catch:{ Exception -> 0x0138 } r8.put(r4) // Catch:{ Exception -> 0x0138 } r8.put(r7) // Catch:{ Exception -> 0x0138 } long r3 = r2.onViewShowTs // Catch:{ Exception -> 0x0138 } int r7 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1)) if (r7 <= 0) goto L_0x00b1 org.json.JSONObject r3 = new org.json.JSONObject // Catch:{ Exception -> 0x0138 } r3.<init>() // Catch:{ Exception -> 0x0138 } java.lang.String r4 = "name" java.lang.String r7 = "viewShow" r3.put(r4, r7) // Catch:{ Exception -> 0x0138 } java.lang.String r4 = "start" long r9 = r2.onViewShowTs // Catch:{ Exception -> 0x0138 } r3.put(r4, r9) // Catch:{ Exception -> 0x0138 } r8.put(r3) // Catch:{ Exception -> 0x0138 } L_0x00b1: org.json.JSONObject r3 = new org.json.JSONObject // Catch:{ Exception -> 0x0138 } r3.<init>() // Catch:{ Exception -> 0x0138 } java.lang.String r4 = "name" java.lang.String r7 = "page_load_stats" r3.put(r4, r7) // Catch:{ Exception -> 0x0138 } java.lang.String r4 = "page_type" java.lang.String r7 = "activity" r3.put(r4, r7) // Catch:{ Exception -> 0x0138 } java.lang.String r4 = "start" long r9 = r2.onCreateStartTs // Catch:{ Exception -> 0x0138 } r3.put(r4, r9) // Catch:{ Exception -> 0x0138 } long r9 = r2.onViewShowTs // Catch:{ Exception -> 0x0138 } int r4 = (r9 > r5 ? 1 : (r9 == r5 ? 0 : -1)) if (r4 <= 0) goto L_0x00e5 java.lang.String r4 = "end" long r5 = r2.onViewShowTs // Catch:{ Exception -> 0x0138 } r3.put(r4, r5) // Catch:{ Exception -> 0x0138 } long r4 = r2.onViewShowTs // Catch:{ Exception -> 0x0138 } long r6 = r2.onCreateStartTs // Catch:{ Exception -> 0x0138 } r9 = 0 long r4 = r4 - r6 long r6 = sMaxValidTimeMs // Catch:{ Exception -> 0x0138 } int r9 = (r4 > r6 ? 1 : (r4 == r6 ? 0 : -1)) if (r9 <= 0) goto L_0x00f8 goto L_0x0133 L_0x00e5: java.lang.String r4 = "end" long r5 = r2.onWindowFocusTs // Catch:{ Exception -> 0x0138 } r3.put(r4, r5) // Catch:{ Exception -> 0x0138 } long r4 = r2.onWindowFocusTs // Catch:{ Exception -> 0x0138 } long r6 = r2.onCreateStartTs // Catch:{ Exception -> 0x0138 } r9 = 0 long r4 = r4 - r6 long r6 = sMaxValidTimeMs // Catch:{ Exception -> 0x0138 } int r9 = (r4 > r6 ? 1 : (r4 == r6 ? 0 : -1)) if (r9 > 0) goto L_0x0133 L_0x00f8: java.lang.String r4 = "spans" r3.put(r4, r8) // Catch:{ Exception -> 0x0138 } java.util.HashSet<java.lang.String> r4 = sMethodSet // Catch:{ Exception -> 0x0138 } java.lang.String r5 = r2.pageName // Catch:{ Exception -> 0x0138 } boolean r4 = r4.contains(r5) // Catch:{ Exception -> 0x0138 } r5 = 1 if (r4 == 0) goto L_0x010a r4 = 2 goto L_0x010b L_0x010a: r4 = 1 L_0x010b: java.util.HashSet<java.lang.String> r6 = sMethodSet // Catch:{ Exception -> 0x0138 } java.lang.String r7 = r2.pageName // Catch:{ Exception -> 0x0138 } r6.add(r7) // Catch:{ Exception -> 0x0138 } java.lang.String r6 = "launch_mode" r3.put(r6, r4) // Catch:{ Exception -> 0x0138 } java.lang.String r4 = "collect_from" r3.put(r4, r5) // Catch:{ Exception -> 0x0138 } java.lang.String r4 = "page_name" java.lang.String r2 = r2.pageName // Catch:{ Exception -> 0x0138 } r3.put(r4, r2) // Catch:{ Exception -> 0x0138 } org.json.JSONObject r2 = new org.json.JSONObject // Catch:{ Exception -> 0x0138 } r2.<init>() // Catch:{ Exception -> 0x0138 } java.lang.String r4 = "trace" r2.put(r4, r3) // Catch:{ Exception -> 0x0138 } java.lang.String r3 = "page_load_trace" r4 = 0 com.bytedance.apm.agent.monitor.MonitorTool.monitorPerformance(r3, r4, r4, r2) // Catch:{ Exception -> 0x0138 } L_0x0133: int r1 = r1 + 1 goto L_0x0007 L_0x0137: return L_0x0138: return */ throw new UnsupportedOperationException("Method not decompiled: com.bytedance.apm.agent.tracing.AutoPageTraceHelper.reportStats():void"); } public static void setMaxValidTimeMs(long j) { sMaxValidTimeMs = j; } public static void reportViewIdStats(long j, String str) { PageTraceEntity pageTraceEntity = (PageTraceEntity) sPageList.peek(); if (pageTraceEntity != null && TextUtils.equals(str, pageTraceEntity.pageName)) { pageTraceEntity.onViewShowTs = j; C6273b.m19475a().mo15066a((Runnable) new Runnable() { public final void run() { AutoPageTraceHelper.reportStats(); } }); } } public static void onTrace(String str, String str2, boolean z) { if (TextUtils.equals("onCreate", str2)) { if (z) { if (!sIsFirstWindowFocusChangedActivity) { AutoLaunchTraceHelper.launcherActivityOnCreateStart(str); } sPageList.add(new PageTraceEntity(str, System.currentTimeMillis())); return; } if (!sIsFirstWindowFocusChangedActivity) { AutoLaunchTraceHelper.launcherActivityOnCreateEnd(); } PageTraceEntity pageTraceEntity = (PageTraceEntity) sPageList.peek(); if (pageTraceEntity != null) { pageTraceEntity.onCreateEndTs = System.currentTimeMillis(); } } else if (!TextUtils.equals("onResume", str2)) { if (TextUtils.equals("onWindowFocusChanged", str2) && z) { if (!sIsFirstWindowFocusChangedActivity) { AutoLaunchTraceHelper.launcherActivityOnWindowFocusChangedStart(str); sIsFirstWindowFocusChangedActivity = true; } PageTraceEntity pageTraceEntity2 = (PageTraceEntity) sPageList.peek(); if (pageTraceEntity2 != null && pageTraceEntity2.onWindowFocusTs == 0) { pageTraceEntity2.onWindowFocusTs = System.currentTimeMillis(); if (C9635a.m28501a(str) == null) { C6273b.m19475a().mo15066a((Runnable) new Runnable() { public final void run() { AutoPageTraceHelper.reportStats(); } }); } } } } else if (z) { if (!sIsFirstWindowFocusChangedActivity) { AutoLaunchTraceHelper.launcherActivityOnResumeStart(str); } PageTraceEntity pageTraceEntity3 = (PageTraceEntity) sPageList.peek(); if (pageTraceEntity3 != null) { pageTraceEntity3.onResumeStartTs = System.currentTimeMillis(); } } else { if (!sIsFirstWindowFocusChangedActivity) { AutoLaunchTraceHelper.launcherActivityOnResumeEnd(); } PageTraceEntity pageTraceEntity4 = (PageTraceEntity) sPageList.peek(); if (pageTraceEntity4 != null) { pageTraceEntity4.onResumeEndTs = System.currentTimeMillis(); } } } }
12,816
0.537687
0.468399
243
51.740742
30.836531
155
false
false
0
0
0
0
0
0
0.279835
false
false
4
b2acc9521e53b012b0785517f1f3239d1edcf7ed
16,621,523,490,947
be099199b7775438b7fd159df0defc3a560848c6
/ViewPagerDemoS/src/com/stormgens/myviewpagerdemo/fragment/ImageDetailFragment.java
6b2bb85e2c484c81efec284f99881745cdb1538c
[]
no_license
StormGens/StormExamples
https://github.com/StormGens/StormExamples
ed38c90ac8fe8a8f18b4abc2f686155e42cabe50
a0f0a922048623559e22926feb2c45dc249c0619
refs/heads/master
2021-01-22T04:41:55.354000
2013-05-16T11:17:10
2013-05-16T11:17:10
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.stormgens.myviewpagerdemo.fragment; import com.stormgens.myviewpagerdemo.R; import com.stormgens.myviewpagerdemo.activity.ImageDetailViewPagerActivity; import com.stormgens.thread.MyAsyncTask; import com.stormgens.util.ImageUtil; import android.graphics.Bitmap; import android.os.Bundle; import android.support.v4.app.Fragment; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.ProgressBar; public class ImageDetailFragment extends Fragment { private static final String IMAGE_URL_EXTRA = "extra_image_data"; private ImageView iv; private ProgressBar pb; private Bitmap bm; private int padding; public static ImageDetailFragment newInstance(String url){ final ImageDetailFragment ret=new ImageDetailFragment(); Bundle bundle=new Bundle(); bundle.putString(IMAGE_URL_EXTRA, url); ret.setArguments(bundle); return ret; } @Override public void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // TODO Auto-generated method stub View view=inflater.inflate(R.layout.viewpager_itemview, container, false); pb=(ProgressBar) view.findViewById(R.id.album_progressbar); iv=(ImageView) view.findViewById(R.id.album_imgeview); iv.setOnClickListener((ImageDetailViewPagerActivity)getActivity()); padding = container.getResources().getDimensionPixelSize(R.dimen.padding_image_paper); return view; } @Override public void onActivityCreated(Bundle savedInstanceState) { // TODO Auto-generated method stub iv.setPadding(padding, padding, padding, padding); iv.setScaleType(ImageView.ScaleType.CENTER_INSIDE); new MyAsyncTask<String, Void, Bitmap>() { @Override protected Bitmap doInBackground(String... params) { // TODO Auto-generated method stub return ImageUtil.getCompressBitMap(params[0],1280,720); } @Override protected void onPostExecute(Bitmap result) { // TODO Auto-generated method stub bm=result; iv.setImageBitmap(bm); pb.setVisibility(View.GONE); } }.execute(getArguments().getString(IMAGE_URL_EXTRA)); super.onActivityCreated(savedInstanceState); } @Override public void onPause() { // TODO Auto-generated method stub super.onPause(); } }
UTF-8
Java
2,838
java
ImageDetailFragment.java
Java
[]
null
[]
package com.stormgens.myviewpagerdemo.fragment; import com.stormgens.myviewpagerdemo.R; import com.stormgens.myviewpagerdemo.activity.ImageDetailViewPagerActivity; import com.stormgens.thread.MyAsyncTask; import com.stormgens.util.ImageUtil; import android.graphics.Bitmap; import android.os.Bundle; import android.support.v4.app.Fragment; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.ProgressBar; public class ImageDetailFragment extends Fragment { private static final String IMAGE_URL_EXTRA = "extra_image_data"; private ImageView iv; private ProgressBar pb; private Bitmap bm; private int padding; public static ImageDetailFragment newInstance(String url){ final ImageDetailFragment ret=new ImageDetailFragment(); Bundle bundle=new Bundle(); bundle.putString(IMAGE_URL_EXTRA, url); ret.setArguments(bundle); return ret; } @Override public void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // TODO Auto-generated method stub View view=inflater.inflate(R.layout.viewpager_itemview, container, false); pb=(ProgressBar) view.findViewById(R.id.album_progressbar); iv=(ImageView) view.findViewById(R.id.album_imgeview); iv.setOnClickListener((ImageDetailViewPagerActivity)getActivity()); padding = container.getResources().getDimensionPixelSize(R.dimen.padding_image_paper); return view; } @Override public void onActivityCreated(Bundle savedInstanceState) { // TODO Auto-generated method stub iv.setPadding(padding, padding, padding, padding); iv.setScaleType(ImageView.ScaleType.CENTER_INSIDE); new MyAsyncTask<String, Void, Bitmap>() { @Override protected Bitmap doInBackground(String... params) { // TODO Auto-generated method stub return ImageUtil.getCompressBitMap(params[0],1280,720); } @Override protected void onPostExecute(Bitmap result) { // TODO Auto-generated method stub bm=result; iv.setImageBitmap(bm); pb.setVisibility(View.GONE); } }.execute(getArguments().getString(IMAGE_URL_EXTRA)); super.onActivityCreated(savedInstanceState); } @Override public void onPause() { // TODO Auto-generated method stub super.onPause(); } }
2,838
0.671952
0.668781
84
32.785713
24.398026
103
false
false
0
0
0
0
0
0
0.619048
false
false
4
a80e07ff980eb823877def3eb19c0fd91949e238
24,249,385,398,871
c798619b753a5176513ba408d44ae136480bf572
/src/com/linkbyte/everscript/ESDictionary.java
15e1d86eec4491fd3e1f3cdcded341c634af4a80
[ "MIT" ]
permissive
EverScriptLang/EverScript
https://github.com/EverScriptLang/EverScript
dffc9944b8506fd39d02b7e5513fb3ece5db5dd7
e791ca75523399206481f017be8e2861424d2177
refs/heads/master
2022-12-27T10:05:09.127000
2020-10-05T17:01:46
2020-10-05T17:01:46
291,805,507
6
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.linkbyte.everscript; import java.util.*; import java.util.stream.Collectors; class ESDictionary { final Token name; final Map<String, Object> properties; ESDictionary(Token name, Map<String, Object> properties) { this.name = name; this.properties = properties; } public Object getProperty(Token key, boolean safeNavigation) { if (safeNavigation) { if (properties.containsKey(key.lexeme)) { return properties.get(key.lexeme); } return null; } else { if (properties.containsKey(key.lexeme)) { return properties.get(key.lexeme); } throw new RuntimeError(key, "Property '" + key.lexeme + "' does not exist in object literal '" + name.lexeme + "'."); } } public void setProperty(Token key, Object value) { properties.put(key.lexeme, value); } @Override public String toString() { return properties.entrySet().stream().map(entry -> entry.getKey() + ": " + Interpreter.stringify(entry.getValue())).collect(Collectors.joining(", ", "{ ", " }")); } }
UTF-8
Java
1,164
java
ESDictionary.java
Java
[]
null
[]
package com.linkbyte.everscript; import java.util.*; import java.util.stream.Collectors; class ESDictionary { final Token name; final Map<String, Object> properties; ESDictionary(Token name, Map<String, Object> properties) { this.name = name; this.properties = properties; } public Object getProperty(Token key, boolean safeNavigation) { if (safeNavigation) { if (properties.containsKey(key.lexeme)) { return properties.get(key.lexeme); } return null; } else { if (properties.containsKey(key.lexeme)) { return properties.get(key.lexeme); } throw new RuntimeError(key, "Property '" + key.lexeme + "' does not exist in object literal '" + name.lexeme + "'."); } } public void setProperty(Token key, Object value) { properties.put(key.lexeme, value); } @Override public String toString() { return properties.entrySet().stream().map(entry -> entry.getKey() + ": " + Interpreter.stringify(entry.getValue())).collect(Collectors.joining(", ", "{ ", " }")); } }
1,164
0.597079
0.597079
37
30.459459
34.912704
170
false
false
0
0
0
0
0
0
0.621622
false
false
4
c709d631fda7bd09eb442a8ebfede0219b5cb7d6
31,207,232,414,140
7359d640dd5bc194d3b51ee20d4ee7d5ae4fe00c
/app/src/main/java/cn/adolf/adolf/widget/DaysWidget.java
83a7ce15b25b8e9fe15c5b4a41cd95615f910a76
[ "Apache-2.0" ]
permissive
Puffer987/AdolfTool
https://github.com/Puffer987/AdolfTool
7656fad7bfe02b7f96ed4d7d997ffdce98f36e18
683e8f0d7a4e2474e91bc6ab9310c1740cb7f3ed
refs/heads/main
2023-04-01T03:34:41.680000
2021-03-25T06:46:47
2021-03-25T06:46:47
312,208,108
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package cn.adolf.adolf.widget; import android.app.PendingIntent; import android.appwidget.AppWidgetManager; import android.appwidget.AppWidgetProvider; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.graphics.Bitmap; import android.net.Uri; import android.provider.AlarmClock; import android.util.Log; import android.widget.RemoteViews; import java.util.Arrays; import java.util.List; import java.util.Objects; import cn.adolf.adolf.R; /** * Implementation of App Widget functionality. * App Widget Configuration implemented in {@link DaysWidgetConfigureActivity DaysWidgetConfigureActivity} */ public class DaysWidget extends AppWidgetProvider { private static final String TAG = "jq-loveDays"; private final static String FORCE_UPDATE = "cn.adolf.widget.action.FORCE_UPDATE"; @Override public void onReceive(Context context, Intent intent) { super.onReceive(context, intent); if (Objects.equals(intent.getAction(), FORCE_UPDATE)) { Uri data = intent.getData(); int resId = -1; int widgetId = AppWidgetManager.INVALID_APPWIDGET_ID; if (data != null) { String[] split = data.getSchemeSpecificPart().split("-");// 返回":"和"#"之间的字符串 resId = Integer.parseInt(split[0]); widgetId = Integer.parseInt(split[1]); Log.e(TAG, "onReceive: " + data.getSchemeSpecificPart()); } RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.days_widget); switch (resId) { case R.id.layout_parent: Log.e(TAG, "强制更新: " + System.currentTimeMillis()); long timestamp = DaysWidgetConfigureActivity.loadTimestampPref(context, widgetId); String sumDays = SumUtils.getSumDays(timestamp); Bitmap bitmap = SumUtils.buildBitmapWithShadow(context, sumDays, 150); views.setImageViewBitmap(R.id.img_days, bitmap); break; } //获得appwidget管理实例,用于管理appwidget以便进行更新操作 AppWidgetManager manger = AppWidgetManager.getInstance(context); // updateAppWidget(context, manger, widgetId); // 相当于获得所有本程序创建的appwidget ComponentName thisName = new ComponentName(context, DaysWidget.class); //更新widget manger.updateAppWidget(widgetId, views); } } static void updateAppWidget(Context context, AppWidgetManager appWidgetManager, int appWidgetId) { Log.e(TAG, "updateAppWidget: " + appWidgetId); long timestamp = DaysWidgetConfigureActivity.loadTimestampPref(context, appWidgetId); String sumDays = SumUtils.getSumDays(timestamp); Log.d(TAG, "sumDays: " + sumDays); // Construct the RemoteViews object RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.days_widget); Bitmap bitmap = SumUtils.buildBitmapWithShadow(context, sumDays, 150); views.setImageViewBitmap(R.id.img_days, bitmap); // 跳转闹钟界面需要声明权限 <uses-permission android:name="com.android.alarm.permission.SET_ALARM" /> views.setOnClickPendingIntent(R.id.img_days, getActivityIntent(context, AlarmClock.ACTION_SHOW_ALARMS)); views.setOnClickPendingIntent(R.id.layout_parent, getForceUpdateBroadcastIntent(context, R.id.layout_parent, appWidgetId)); views.setOnClickPendingIntent(R.id.right_bottom, getWeChatScanIntent(context)); // Instruct the widget manager to update the widget appWidgetManager.updateAppWidget(appWidgetId, views); } @Override public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { Log.e(TAG, "onUpdate: " + Arrays.toString(appWidgetIds)); // There may be multiple widgets active, so update all of them for (int appWidgetId : appWidgetIds) { updateAppWidget(context, appWidgetManager, appWidgetId); } } @Override public void onDeleted(Context context, int[] appWidgetIds) { Log.e(TAG, "onDeleted: " + Arrays.toString(appWidgetIds)); // When the user deletes the widget, delete the preference associated with it. for (int appWidgetId : appWidgetIds) { DaysWidgetConfigureActivity.deleteTimestampPref(context, appWidgetId); } } @Override public void onEnabled(Context context) { Log.e(TAG, "onEnabled: "); // Enter relevant functionality for when the first widget is created } @Override public void onDisabled(Context context) { Log.e(TAG, "onDisabled: "); // Enter relevant functionality for when the last widget is disabled } private static PendingIntent getForceUpdateBroadcastIntent(Context context, int resID, int widgetId) { Intent intent = new Intent(); intent.setClass(context, DaysWidget.class);//此时这句代码去掉 intent.setAction(FORCE_UPDATE); //设置data域的时候,把控件id一起设置进去, // 因为在绑定的时候,是将同一个id绑定在一起的,所以哪个控件点击,发送的intent中data中的id就是哪个控件的id intent.setData(Uri.parse("id:" + resID + "-" + widgetId)); return PendingIntent.getBroadcast(context, 0, intent, 0); } private static PendingIntent getActivityIntent(Context context, String action) { Intent intent = new Intent(); intent.setAction(action); return PendingIntent.getActivity(context, 0, intent, 0); } private static PendingIntent getWeChatScanIntent(Context context) { Intent intent = context.getPackageManager().getLaunchIntentForPackage("com.tencent.mm"); if (intent != null) { intent.putExtra("LauncherUI.From.Scaner.Shortcut", true); return PendingIntent.getActivity(context, 0, intent, 0); } return null; } }
UTF-8
Java
6,260
java
DaysWidget.java
Java
[]
null
[]
package cn.adolf.adolf.widget; import android.app.PendingIntent; import android.appwidget.AppWidgetManager; import android.appwidget.AppWidgetProvider; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.graphics.Bitmap; import android.net.Uri; import android.provider.AlarmClock; import android.util.Log; import android.widget.RemoteViews; import java.util.Arrays; import java.util.List; import java.util.Objects; import cn.adolf.adolf.R; /** * Implementation of App Widget functionality. * App Widget Configuration implemented in {@link DaysWidgetConfigureActivity DaysWidgetConfigureActivity} */ public class DaysWidget extends AppWidgetProvider { private static final String TAG = "jq-loveDays"; private final static String FORCE_UPDATE = "cn.adolf.widget.action.FORCE_UPDATE"; @Override public void onReceive(Context context, Intent intent) { super.onReceive(context, intent); if (Objects.equals(intent.getAction(), FORCE_UPDATE)) { Uri data = intent.getData(); int resId = -1; int widgetId = AppWidgetManager.INVALID_APPWIDGET_ID; if (data != null) { String[] split = data.getSchemeSpecificPart().split("-");// 返回":"和"#"之间的字符串 resId = Integer.parseInt(split[0]); widgetId = Integer.parseInt(split[1]); Log.e(TAG, "onReceive: " + data.getSchemeSpecificPart()); } RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.days_widget); switch (resId) { case R.id.layout_parent: Log.e(TAG, "强制更新: " + System.currentTimeMillis()); long timestamp = DaysWidgetConfigureActivity.loadTimestampPref(context, widgetId); String sumDays = SumUtils.getSumDays(timestamp); Bitmap bitmap = SumUtils.buildBitmapWithShadow(context, sumDays, 150); views.setImageViewBitmap(R.id.img_days, bitmap); break; } //获得appwidget管理实例,用于管理appwidget以便进行更新操作 AppWidgetManager manger = AppWidgetManager.getInstance(context); // updateAppWidget(context, manger, widgetId); // 相当于获得所有本程序创建的appwidget ComponentName thisName = new ComponentName(context, DaysWidget.class); //更新widget manger.updateAppWidget(widgetId, views); } } static void updateAppWidget(Context context, AppWidgetManager appWidgetManager, int appWidgetId) { Log.e(TAG, "updateAppWidget: " + appWidgetId); long timestamp = DaysWidgetConfigureActivity.loadTimestampPref(context, appWidgetId); String sumDays = SumUtils.getSumDays(timestamp); Log.d(TAG, "sumDays: " + sumDays); // Construct the RemoteViews object RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.days_widget); Bitmap bitmap = SumUtils.buildBitmapWithShadow(context, sumDays, 150); views.setImageViewBitmap(R.id.img_days, bitmap); // 跳转闹钟界面需要声明权限 <uses-permission android:name="com.android.alarm.permission.SET_ALARM" /> views.setOnClickPendingIntent(R.id.img_days, getActivityIntent(context, AlarmClock.ACTION_SHOW_ALARMS)); views.setOnClickPendingIntent(R.id.layout_parent, getForceUpdateBroadcastIntent(context, R.id.layout_parent, appWidgetId)); views.setOnClickPendingIntent(R.id.right_bottom, getWeChatScanIntent(context)); // Instruct the widget manager to update the widget appWidgetManager.updateAppWidget(appWidgetId, views); } @Override public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { Log.e(TAG, "onUpdate: " + Arrays.toString(appWidgetIds)); // There may be multiple widgets active, so update all of them for (int appWidgetId : appWidgetIds) { updateAppWidget(context, appWidgetManager, appWidgetId); } } @Override public void onDeleted(Context context, int[] appWidgetIds) { Log.e(TAG, "onDeleted: " + Arrays.toString(appWidgetIds)); // When the user deletes the widget, delete the preference associated with it. for (int appWidgetId : appWidgetIds) { DaysWidgetConfigureActivity.deleteTimestampPref(context, appWidgetId); } } @Override public void onEnabled(Context context) { Log.e(TAG, "onEnabled: "); // Enter relevant functionality for when the first widget is created } @Override public void onDisabled(Context context) { Log.e(TAG, "onDisabled: "); // Enter relevant functionality for when the last widget is disabled } private static PendingIntent getForceUpdateBroadcastIntent(Context context, int resID, int widgetId) { Intent intent = new Intent(); intent.setClass(context, DaysWidget.class);//此时这句代码去掉 intent.setAction(FORCE_UPDATE); //设置data域的时候,把控件id一起设置进去, // 因为在绑定的时候,是将同一个id绑定在一起的,所以哪个控件点击,发送的intent中data中的id就是哪个控件的id intent.setData(Uri.parse("id:" + resID + "-" + widgetId)); return PendingIntent.getBroadcast(context, 0, intent, 0); } private static PendingIntent getActivityIntent(Context context, String action) { Intent intent = new Intent(); intent.setAction(action); return PendingIntent.getActivity(context, 0, intent, 0); } private static PendingIntent getWeChatScanIntent(Context context) { Intent intent = context.getPackageManager().getLaunchIntentForPackage("com.tencent.mm"); if (intent != null) { intent.putExtra("LauncherUI.From.Scaner.Shortcut", true); return PendingIntent.getActivity(context, 0, intent, 0); } return null; } }
6,260
0.675658
0.67316
145
40.413792
32.445091
131
false
false
0
0
0
0
0
0
0.855172
false
false
4
de04469c5fd70d60676908fcbc97975a5924702b
33,285,996,585,957
8b03ce2d9ef6c5bd1a748fef93a29e1950998631
/src/main/java/com/wapitia/common/io/csv/CSVCellCollector.java
95172ad2c1274a63121d1e6c725d2ecfbb7bdd40
[]
no_license
wapitia/Bergen-Budget
https://github.com/wapitia/Bergen-Budget
11902a7a0cb216e4d55099505a17ae24776687ef
67974bfe5ab775dcb48cd54215bf0b08300c01f5
refs/heads/master
2021-08-22T23:06:54.007000
2017-12-01T15:28:35
2017-12-01T15:28:35
112,540,900
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.wapitia.common.io.csv; @FunctionalInterface public interface CSVCellCollector { public void addCell(int column, int row, String cellContents); }
UTF-8
Java
164
java
CSVCellCollector.java
Java
[]
null
[]
package com.wapitia.common.io.csv; @FunctionalInterface public interface CSVCellCollector { public void addCell(int column, int row, String cellContents); }
164
0.780488
0.780488
8
19.5
22.627417
66
false
false
0
0
0
0
0
0
0.5
false
false
4
b9d5cf1b8e4234da836166ea640d205c92272ae6
28,973,849,429,838
285f46fcefff7992b0aca2df2055fca4b4b22463
/app/src/main/java/com/lgastelu/examensabado/repositories/UserRepository.java
9177d0b1d6a4d3f5e8eef855751ab610a24af262
[]
no_license
LuisAngelG/ExamenSabado
https://github.com/LuisAngelG/ExamenSabado
2aca7143e6c880acb0309488c863d7a7cbc2081a
31b6ce009d636e32ba285fa09805e7dae67528b2
refs/heads/master
2020-09-07T09:33:57.432000
2019-11-10T04:07:25
2019-11-10T04:07:25
220,739,277
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.lgastelu.examensabado.repositories; import com.lgastelu.examensabado.models.User; import com.orm.SugarRecord; import java.util.List; public class UserRepository { public static List<User>list(){ List<User>users= SugarRecord.listAll(User.class); return users; } public static User read(String username, String password){ User user= (User) SugarRecord.find(User.class, username, password); return user; } public static void create(String name, String username, String email, String password){ User user=new User(name,username,email,password); SugarRecord.save(user); } public static void update(String name, String username, String email, String password, Long id){ User user=SugarRecord.findById(User.class, id); user.setName(name); user.setUsername(username); user.setEmail(email); user.setPassword(password); SugarRecord.save(user); } public static void delete(Long id){ User user=SugarRecord.findById(User.class, id); SugarRecord.delete(user); } public static void checkUser(Long id){ User user=SugarRecord.findById(User.class, id); } }
UTF-8
Java
1,229
java
UserRepository.java
Java
[ { "context": " user.setName(name);\n user.setUsername(username);\n user.setEmail(email);\n user.setP", "end": 875, "score": 0.9982975125312805, "start": 867, "tag": "USERNAME", "value": "username" } ]
null
[]
package com.lgastelu.examensabado.repositories; import com.lgastelu.examensabado.models.User; import com.orm.SugarRecord; import java.util.List; public class UserRepository { public static List<User>list(){ List<User>users= SugarRecord.listAll(User.class); return users; } public static User read(String username, String password){ User user= (User) SugarRecord.find(User.class, username, password); return user; } public static void create(String name, String username, String email, String password){ User user=new User(name,username,email,password); SugarRecord.save(user); } public static void update(String name, String username, String email, String password, Long id){ User user=SugarRecord.findById(User.class, id); user.setName(name); user.setUsername(username); user.setEmail(email); user.setPassword(password); SugarRecord.save(user); } public static void delete(Long id){ User user=SugarRecord.findById(User.class, id); SugarRecord.delete(user); } public static void checkUser(Long id){ User user=SugarRecord.findById(User.class, id); } }
1,229
0.675346
0.675346
43
27.581396
26.162491
100
false
false
0
0
0
0
0
0
0.813953
false
false
4
e90248aad02f6a78402940ab286e91e9a3bbbf58
15,496,242,055,408
3fa13c9aed3d26c37ad3f4d21ae109bba46c384d
/Business/src/Business/ElectroDomesticoLogic.java
84555ccc638d3fb278ea81b679d4bfd85428fddc
[]
no_license
fbr1/TPJavaUTN2014NeSe
https://github.com/fbr1/TPJavaUTN2014NeSe
7a50ba8e89b84725dbca6986fedb51c712493d56
1286b1d4f2a23f85c86398f467c764de866376b1
refs/heads/master
2016-09-06T11:03:36.596000
2015-02-23T00:43:33
2015-02-23T00:43:33
22,772,027
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package Business; import java.util.ArrayList; import Data.ElectroDomesticoAdapter; import Entities.ConsumoEnergetico; import Entities.ElectroDomestico; import Entities.Color; import Entities.Lavarropas; import Entities.Entity.States; import Entities.PesoPrecio; import Entities.Television; public class ElectroDomesticoLogic extends BusinessLogic{ private ElectroDomesticoAdapter electroDomesticoData; public ElectroDomesticoLogic(){ electroDomesticoData = new ElectroDomesticoAdapter(); } public ElectroDomesticoAdapter ElectroDomesticoData() { return electroDomesticoData; } public void setElectroDomesticoData(ElectroDomesticoAdapter electroDomesticoData) { this.electroDomesticoData = electroDomesticoData; } public ElectroDomestico getOne(int id) throws Exception{ return ElectroDomesticoData().getOne(id); } public ArrayList<ElectroDomestico> getAll() throws Exception{ return ElectroDomesticoData().getAll(); } public ArrayList<ElectroDomestico> getAll(char consumo) throws Exception{ return ElectroDomesticoData().getAll(consumo); } public ArrayList<ElectroDomestico> getAll(double precio_min, double precio_max) throws Exception { ArrayList<ElectroDomestico> electrodomesticos = new ArrayList<ElectroDomestico>(); for(ElectroDomestico elecDom : ElectroDomesticoData().getAll()){ double preciofinal = 0; if(elecDom instanceof Television){ preciofinal = new TelevisionLogic().precioFinal((Television)elecDom); }else if(elecDom instanceof Lavarropas){ preciofinal = new LavarropasLogic().precioFinal((Lavarropas)elecDom); } if(preciofinal != 0){ if(preciofinal >= precio_min && preciofinal <= precio_max ){ electrodomesticos.add(elecDom); } }else{ throw new Exception("Hubo un error en el filtrado de datos"); } } return electrodomesticos; } public ArrayList<ElectroDomestico> getAll(double precio_min, double precio_max, char consumo) throws Exception { ArrayList<ElectroDomestico> electrodomesticos = new ArrayList<ElectroDomestico>(); electrodomesticos.addAll(this.getAll(precio_min,precio_max)); electrodomesticos.retainAll(this.getAll(consumo)); return electrodomesticos; } protected void validateInput(ElectroDomestico elecDom) throws Exception { States state = elecDom.getState(); if( state == States.New || state == States.Modified){ String color = elecDom.getColor().getNombre(); char consumo = elecDom.getConsumoEnergetico().getNombre(); ConsumoEnergeticoLogic consumos = new ConsumoEnergeticoLogic(); ColorLogic colores = new ColorLogic(); boolean correcto = false; for ( Color col : colores.getAll()){ if( color.equalsIgnoreCase(col.getNombre()) ){ correcto = true; break; } } if(!correcto){ elecDom.setColor(new Color());} for ( ConsumoEnergetico con : consumos.getAll()){ if( Character.toUpperCase(consumo) == Character.toUpperCase(con.getId()) ){ correcto = true; break; } } if(!correcto){ elecDom.setConsumoEnergetico(new ConsumoEnergetico());} if(elecDom.getDescripcion().isEmpty()){ throw new Exception("La descripcion esta vacia"); } } } public double precioFinal(int ID) throws Exception{ ElectroDomestico elecDom = this.getOne(ID); return this.precioFinal(elecDom); } public double precioFinal(ElectroDomestico elecDom) throws Exception{ PesoPrecioLogic pesosPrecios = new PesoPrecioLogic(); PesoPrecio pesoprecio = pesosPrecios.getOneByPeso(elecDom.getPeso()); return elecDom.PrecioFinal(pesoprecio); } }
UTF-8
Java
3,593
java
ElectroDomesticoLogic.java
Java
[]
null
[]
package Business; import java.util.ArrayList; import Data.ElectroDomesticoAdapter; import Entities.ConsumoEnergetico; import Entities.ElectroDomestico; import Entities.Color; import Entities.Lavarropas; import Entities.Entity.States; import Entities.PesoPrecio; import Entities.Television; public class ElectroDomesticoLogic extends BusinessLogic{ private ElectroDomesticoAdapter electroDomesticoData; public ElectroDomesticoLogic(){ electroDomesticoData = new ElectroDomesticoAdapter(); } public ElectroDomesticoAdapter ElectroDomesticoData() { return electroDomesticoData; } public void setElectroDomesticoData(ElectroDomesticoAdapter electroDomesticoData) { this.electroDomesticoData = electroDomesticoData; } public ElectroDomestico getOne(int id) throws Exception{ return ElectroDomesticoData().getOne(id); } public ArrayList<ElectroDomestico> getAll() throws Exception{ return ElectroDomesticoData().getAll(); } public ArrayList<ElectroDomestico> getAll(char consumo) throws Exception{ return ElectroDomesticoData().getAll(consumo); } public ArrayList<ElectroDomestico> getAll(double precio_min, double precio_max) throws Exception { ArrayList<ElectroDomestico> electrodomesticos = new ArrayList<ElectroDomestico>(); for(ElectroDomestico elecDom : ElectroDomesticoData().getAll()){ double preciofinal = 0; if(elecDom instanceof Television){ preciofinal = new TelevisionLogic().precioFinal((Television)elecDom); }else if(elecDom instanceof Lavarropas){ preciofinal = new LavarropasLogic().precioFinal((Lavarropas)elecDom); } if(preciofinal != 0){ if(preciofinal >= precio_min && preciofinal <= precio_max ){ electrodomesticos.add(elecDom); } }else{ throw new Exception("Hubo un error en el filtrado de datos"); } } return electrodomesticos; } public ArrayList<ElectroDomestico> getAll(double precio_min, double precio_max, char consumo) throws Exception { ArrayList<ElectroDomestico> electrodomesticos = new ArrayList<ElectroDomestico>(); electrodomesticos.addAll(this.getAll(precio_min,precio_max)); electrodomesticos.retainAll(this.getAll(consumo)); return electrodomesticos; } protected void validateInput(ElectroDomestico elecDom) throws Exception { States state = elecDom.getState(); if( state == States.New || state == States.Modified){ String color = elecDom.getColor().getNombre(); char consumo = elecDom.getConsumoEnergetico().getNombre(); ConsumoEnergeticoLogic consumos = new ConsumoEnergeticoLogic(); ColorLogic colores = new ColorLogic(); boolean correcto = false; for ( Color col : colores.getAll()){ if( color.equalsIgnoreCase(col.getNombre()) ){ correcto = true; break; } } if(!correcto){ elecDom.setColor(new Color());} for ( ConsumoEnergetico con : consumos.getAll()){ if( Character.toUpperCase(consumo) == Character.toUpperCase(con.getId()) ){ correcto = true; break; } } if(!correcto){ elecDom.setConsumoEnergetico(new ConsumoEnergetico());} if(elecDom.getDescripcion().isEmpty()){ throw new Exception("La descripcion esta vacia"); } } } public double precioFinal(int ID) throws Exception{ ElectroDomestico elecDom = this.getOne(ID); return this.precioFinal(elecDom); } public double precioFinal(ElectroDomestico elecDom) throws Exception{ PesoPrecioLogic pesosPrecios = new PesoPrecioLogic(); PesoPrecio pesoprecio = pesosPrecios.getOneByPeso(elecDom.getPeso()); return elecDom.PrecioFinal(pesoprecio); } }
3,593
0.747008
0.746451
120
28.941668
28.114141
111
false
false
0
0
0
0
0
0
2.341667
false
false
4
0a6dcfd985ed0773b0b55d4b429a7356066be2d1
24,824,911,013,496
31a6d75a765fb46e6c743f53343eadf02effc693
/modules/architecture-representation/src/main/java/arquitetura/touml/Operations.java
7886738c5e2ca87f4640072aa4e19bc9b6caf4b2
[]
no_license
LucianeBaldo/OPLA-Tool
https://github.com/LucianeBaldo/OPLA-Tool
9db5a2700f90356aedd7549b0ed0b206c4bb7415
f2c2647b0d1661a8517af33e66fae1168e92a14e
refs/heads/master
2020-04-30T16:00:07.482000
2020-03-13T00:02:54
2020-03-13T00:02:54
176,936,365
1
0
null
true
2020-03-05T16:07:58
2019-03-21T12:04:18
2020-03-04T17:53:29
2020-03-05T16:07:57
36,057
1
0
0
HTML
false
false
package arquitetura.touml; import arquitetura.representation.Architecture; /** * @author edipofederle<edipofederle@gmail.com> */ public class Operations { private DocumentManager doc; private ClassOperations classOperation; private AssociationOperations associationOperation; private PackageOperations packageOperaiton; private DependencyOperations dependencyOperation; private UsageOperations usageOperation; private GeneralizationOperations generalizationOperations; private CompositionOperations compositionOperations; private AggregationOperations aggregationOperations; private NoteOperations noteOperations; private StereotypeOperations concernOperation; private RealizationsOperations realizationOperations; private AssociationKlassOperations associationKlassOperations; private AbstractionOperations abstractionOperations; public Operations(DocumentManager doc2, Architecture a) { this.doc = doc2; createClassOperation(a); createAssociationOperations(); createPackageOperations(); createDependencyOperations(a); createUsageOperations(a); createGeneralizationOperations(); createCompositionOperations(); createAggrationOperations(a); createNoteOperations(a); createConcernOperation(); createRealaizationsOperations(); createAssociationKlassOperations(a); createAbstractionOperations(a); } private void createAbstractionOperations(Architecture a) { this.abstractionOperations = new AbstractionOperations(doc); } private void createAssociationKlassOperations(Architecture a) { this.associationKlassOperations = new AssociationKlassOperations(doc, a); } private void createRealaizationsOperations() { this.realizationOperations = new RealizationsOperations(doc); } private void createConcernOperation() { this.concernOperation = new StereotypeOperations(doc); } private void createNoteOperations(Architecture a) { this.noteOperations = new NoteOperations(doc, a); } private void createAggrationOperations(Architecture a) { this.aggregationOperations = new AggregationOperations(doc, a); } private void createCompositionOperations() { this.compositionOperations = new CompositionOperations(doc); } private void createGeneralizationOperations() { this.generalizationOperations = new GeneralizationOperations(doc); } private void createUsageOperations(Architecture a) { this.usageOperation = new UsageOperations(doc, a); } private void createDependencyOperations(Architecture a) { this.dependencyOperation = new DependencyOperations(doc, a); } private void createPackageOperations() { this.packageOperaiton = new PackageOperations(doc); } private void createAssociationOperations() { this.associationOperation = new AssociationOperations(doc); } private void createClassOperation(Architecture a) { this.classOperation = new ClassOperations(doc, a); } public ClassOperations forClass() { return classOperation; } public StereotypeOperations forConcerns() { return concernOperation; } public AssociationOperations forAssociation() { return associationOperation; } public PackageOperations forPackage() { return packageOperaiton; } public DependencyOperations forDependency() { return dependencyOperation; } public UsageOperations forUsage() { return usageOperation; } ; public GeneralizationOperations forGeneralization() { return generalizationOperations; } public CompositionOperations forComposition() { return compositionOperations; } public AggregationOperations forAggregation() { return aggregationOperations; } public NoteOperations forNote() { return noteOperations; } public RealizationsOperations forRealization() { return realizationOperations; } public AssociationKlassOperations forAssociationClass() { return associationKlassOperations; } public AbstractionOperations forAbstraction() { return abstractionOperations; } }
UTF-8
Java
4,365
java
Operations.java
Java
[ { "context": "tura.representation.Architecture;\n\n\n/**\n * @author edipofederle<edipofederle@gmail.com>\n */\npublic class Operatio", "end": 105, "score": 0.9985887408256531, "start": 93, "tag": "USERNAME", "value": "edipofederle" }, { "context": "ation.Architecture;\n\n\n/**\n * @author edipofederle<edipofederle@gmail.com>\n */\npublic class Operations {\n\n private Docum", "end": 128, "score": 0.9999294281005859, "start": 106, "tag": "EMAIL", "value": "edipofederle@gmail.com" } ]
null
[]
package arquitetura.touml; import arquitetura.representation.Architecture; /** * @author edipofederle<<EMAIL>> */ public class Operations { private DocumentManager doc; private ClassOperations classOperation; private AssociationOperations associationOperation; private PackageOperations packageOperaiton; private DependencyOperations dependencyOperation; private UsageOperations usageOperation; private GeneralizationOperations generalizationOperations; private CompositionOperations compositionOperations; private AggregationOperations aggregationOperations; private NoteOperations noteOperations; private StereotypeOperations concernOperation; private RealizationsOperations realizationOperations; private AssociationKlassOperations associationKlassOperations; private AbstractionOperations abstractionOperations; public Operations(DocumentManager doc2, Architecture a) { this.doc = doc2; createClassOperation(a); createAssociationOperations(); createPackageOperations(); createDependencyOperations(a); createUsageOperations(a); createGeneralizationOperations(); createCompositionOperations(); createAggrationOperations(a); createNoteOperations(a); createConcernOperation(); createRealaizationsOperations(); createAssociationKlassOperations(a); createAbstractionOperations(a); } private void createAbstractionOperations(Architecture a) { this.abstractionOperations = new AbstractionOperations(doc); } private void createAssociationKlassOperations(Architecture a) { this.associationKlassOperations = new AssociationKlassOperations(doc, a); } private void createRealaizationsOperations() { this.realizationOperations = new RealizationsOperations(doc); } private void createConcernOperation() { this.concernOperation = new StereotypeOperations(doc); } private void createNoteOperations(Architecture a) { this.noteOperations = new NoteOperations(doc, a); } private void createAggrationOperations(Architecture a) { this.aggregationOperations = new AggregationOperations(doc, a); } private void createCompositionOperations() { this.compositionOperations = new CompositionOperations(doc); } private void createGeneralizationOperations() { this.generalizationOperations = new GeneralizationOperations(doc); } private void createUsageOperations(Architecture a) { this.usageOperation = new UsageOperations(doc, a); } private void createDependencyOperations(Architecture a) { this.dependencyOperation = new DependencyOperations(doc, a); } private void createPackageOperations() { this.packageOperaiton = new PackageOperations(doc); } private void createAssociationOperations() { this.associationOperation = new AssociationOperations(doc); } private void createClassOperation(Architecture a) { this.classOperation = new ClassOperations(doc, a); } public ClassOperations forClass() { return classOperation; } public StereotypeOperations forConcerns() { return concernOperation; } public AssociationOperations forAssociation() { return associationOperation; } public PackageOperations forPackage() { return packageOperaiton; } public DependencyOperations forDependency() { return dependencyOperation; } public UsageOperations forUsage() { return usageOperation; } ; public GeneralizationOperations forGeneralization() { return generalizationOperations; } public CompositionOperations forComposition() { return compositionOperations; } public AggregationOperations forAggregation() { return aggregationOperations; } public NoteOperations forNote() { return noteOperations; } public RealizationsOperations forRealization() { return realizationOperations; } public AssociationKlassOperations forAssociationClass() { return associationKlassOperations; } public AbstractionOperations forAbstraction() { return abstractionOperations; } }
4,350
0.725315
0.724857
149
28.302013
24.574965
81
false
false
0
0
0
0
0
0
0.42953
false
false
4
bc2390ca82ade11a7a8506284f3ce3da13702659
31,336,081,395,036
3dc051d9be5b104f8f43aacf01076893986ddab5
/src/main/java/com/academy/base/service/ProjectService.java
bb1208649f70ff3cef863cd9c8a0223de65764db
[]
no_license
MatiasGonzalezRomeroAcademy/base
https://github.com/MatiasGonzalezRomeroAcademy/base
6608360c20cc9a2058300de7519536f76332b11b
be4a5703464b57f10518a15dc159c7d9aa39b4bc
refs/heads/master
2023-01-14T14:39:12.371000
2020-11-25T02:30:40
2020-11-25T02:30:40
309,836,528
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.academy.base.service; import static java.util.stream.Collectors.toList; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.CachePut; import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.academy.base.dto.ProjectDTO; import com.academy.base.entity.ProjectEntity; import com.academy.base.entity.TaskEntity; import com.academy.base.exception.ResourceNotFoundException; import com.academy.base.repository.ProjectRepository; import lombok.extern.slf4j.Slf4j; @Service @Slf4j public class ProjectService { private ProjectRepository projectRepository; private TaskService taskService; @Autowired public ProjectService(final ProjectRepository projectRepository, final TaskService taskService) { this.projectRepository = projectRepository; this.taskService = taskService; } @Transactional public List<ProjectDTO> findAll() { return entitiesToDTO(projectRepository.findAll()); } @Transactional @Cacheable(cacheNames = "projects", key = "#id", unless = "#id.equals(11L)") public ProjectDTO findById(final Long id) { log.info("Not cached data for project(id={}), caching...", id); return projectRepository.findById(id) // .map(this::toDTO) // .orElseThrow(() -> new ResourceNotFoundException("Project", "id", id)); } @Transactional @CachePut(cacheNames = "projects", key = "#id") public ProjectDTO update(final Long id, final ProjectDTO projectDTO) { if (!projectRepository.existsById(id)) { throw new ResourceNotFoundException("Project", "id", id); } final ProjectEntity projectEntity = toEntity(projectDTO); return toDTO(projectRepository.save(projectEntity)); } @Transactional @CacheEvict(cacheNames = "projects", key = "#id") public void delete(final Long id) { if (!projectRepository.existsById(id)) { throw new ResourceNotFoundException("Project", "id", id); } projectRepository.deleteById(id); } @Transactional @CachePut(cacheNames = "projects", key = "#result.id") public ProjectDTO save(final ProjectDTO project) { final ProjectEntity entity = toEntity(project); return toDTO(projectRepository.save(entity)); } private List<ProjectDTO> entitiesToDTO(final List<ProjectEntity> entities) { return entities.stream() // .map(this::toDTO) // .collect(toList()); } private ProjectEntity toEntity(final ProjectDTO dto) { final ProjectEntity entity = new ProjectEntity(); entity.setId(dto.getId()); entity.setName(dto.getName()); entity.setDescription(dto.getDescription()); final List<TaskEntity> taskEntities = taskService.toEntities(dto.getTasks()); entity.setTasks(new HashSet<>(taskEntities)); return entity; } private ProjectDTO toDTO(final ProjectEntity entity) { final ProjectDTO dto = new ProjectDTO(); dto.setId(entity.getId()); dto.setName(entity.getName()); dto.setDescription(entity.getDescription()); final List<TaskEntity> taskDTOs = new ArrayList<>(entity.getTasks()); dto.setTasks(taskService.toDTOs(taskDTOs)); return dto; } }
UTF-8
Java
3,297
java
ProjectService.java
Java
[ { "context": "tional\n\t@CacheEvict(cacheNames = \"projects\", key = \"#id\")\n\tpublic void delete(final Long id) {\n\t\tif (!pro", "end": 2003, "score": 0.9333561658859253, "start": 1999, "tag": "KEY", "value": "\"#id" }, { "context": "actional\n\t@CachePut(cacheNames = \"projects\", key = \"#result.id\")\n\tpublic ProjectDTO save(final ProjectDTO projec", "end": 2261, "score": 0.9765990972518921, "start": 2250, "tag": "KEY", "value": "\"#result.id" } ]
null
[]
package com.academy.base.service; import static java.util.stream.Collectors.toList; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.CachePut; import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.academy.base.dto.ProjectDTO; import com.academy.base.entity.ProjectEntity; import com.academy.base.entity.TaskEntity; import com.academy.base.exception.ResourceNotFoundException; import com.academy.base.repository.ProjectRepository; import lombok.extern.slf4j.Slf4j; @Service @Slf4j public class ProjectService { private ProjectRepository projectRepository; private TaskService taskService; @Autowired public ProjectService(final ProjectRepository projectRepository, final TaskService taskService) { this.projectRepository = projectRepository; this.taskService = taskService; } @Transactional public List<ProjectDTO> findAll() { return entitiesToDTO(projectRepository.findAll()); } @Transactional @Cacheable(cacheNames = "projects", key = "#id", unless = "#id.equals(11L)") public ProjectDTO findById(final Long id) { log.info("Not cached data for project(id={}), caching...", id); return projectRepository.findById(id) // .map(this::toDTO) // .orElseThrow(() -> new ResourceNotFoundException("Project", "id", id)); } @Transactional @CachePut(cacheNames = "projects", key = "#id") public ProjectDTO update(final Long id, final ProjectDTO projectDTO) { if (!projectRepository.existsById(id)) { throw new ResourceNotFoundException("Project", "id", id); } final ProjectEntity projectEntity = toEntity(projectDTO); return toDTO(projectRepository.save(projectEntity)); } @Transactional @CacheEvict(cacheNames = "projects", key = "#id") public void delete(final Long id) { if (!projectRepository.existsById(id)) { throw new ResourceNotFoundException("Project", "id", id); } projectRepository.deleteById(id); } @Transactional @CachePut(cacheNames = "projects", key = "#result.id") public ProjectDTO save(final ProjectDTO project) { final ProjectEntity entity = toEntity(project); return toDTO(projectRepository.save(entity)); } private List<ProjectDTO> entitiesToDTO(final List<ProjectEntity> entities) { return entities.stream() // .map(this::toDTO) // .collect(toList()); } private ProjectEntity toEntity(final ProjectDTO dto) { final ProjectEntity entity = new ProjectEntity(); entity.setId(dto.getId()); entity.setName(dto.getName()); entity.setDescription(dto.getDescription()); final List<TaskEntity> taskEntities = taskService.toEntities(dto.getTasks()); entity.setTasks(new HashSet<>(taskEntities)); return entity; } private ProjectDTO toDTO(final ProjectEntity entity) { final ProjectDTO dto = new ProjectDTO(); dto.setId(entity.getId()); dto.setName(entity.getName()); dto.setDescription(entity.getDescription()); final List<TaskEntity> taskDTOs = new ArrayList<>(entity.getTasks()); dto.setTasks(taskService.toDTOs(taskDTOs)); return dto; } }
3,297
0.759782
0.758265
114
27.921053
25.131983
98
false
false
0
0
0
0
0
0
1.5
false
false
4
afc916f6854924aed7b9804493844017ab587854
27,874,337,796,926
9538e783c022ff5418aa1f5fac7072077dd6ecf1
/src/main/java/com/epam/library/form/EditUserForm.java
e150e77d02759186bf505f3a84ffe7d42ad52d19
[]
no_license
abalyberdina/LibraryProject
https://github.com/abalyberdina/LibraryProject
2a2d99b581f49e2db00868a45e18ecef972c3198
7d9b6a70d1144fc465aed9b893ca7216c5133c2c
refs/heads/master
2021-01-24T19:12:45.130000
2015-05-24T16:14:30
2015-05-24T16:14:30
35,884,010
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.epam.library.form; import javax.validation.constraints.Pattern; import org.hibernate.validator.constraints.Length; import org.hibernate.validator.constraints.NotBlank; import com.epam.library.domain.User; import com.epam.library.support.FieldMatch; @FieldMatch.List({ @FieldMatch(first = "password", second = "passwordConfirmation")}) public class EditUserForm { @NotBlank @Length(min = 4, max = 50) private String password; @NotBlank @Length(min = 4, max = 50) private String passwordConfirmation; @NotBlank @Length(max = 50) private String firstName; @NotBlank @Length(max = 50) private String lastName; @NotBlank @Length(max = 50) private String country; @NotBlank @Length(max = 50) private String city; @NotBlank @Length(max = 50) private String street; @NotBlank @Length(max = 50) private String house; @Length(max = 50) private String appartment; @Length(max = 20) @Pattern(regexp = "(^\\+(?:[0-9] ?){6,14}[0-9]$)?") private String contactPhone; public EditUserForm() { } public EditUserForm(User user) { this.firstName = user.getFirstName(); this.lastName = user.getLastName(); this.country = user.getAddress().getCountry().getCountryName(); this.city = user.getAddress().getCity().getCityName(); this.street = user.getAddress().getStreet().getStreetName(); this.house = user.getAddress().getHouse(); this.appartment = user.getAddress().getApartment(); this.contactPhone = user.getContactPhone(); } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getPasswordConfirmation() { return passwordConfirmation; } public void setPasswordConfirmation(String passwordConfirmation) { this.passwordConfirmation = passwordConfirmation; } 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 getCountry() { return country; } public void setCountry(String country) { this.country = country; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } public String getStreet() { return street; } public void setStreet(String street) { this.street = street; } public String getHouse() { return house; } public void setHouse(String house) { this.house = house; } public String getContactPhone() { return contactPhone; } public void setContactPhone(String contactPhone) { this.contactPhone = contactPhone; } public String getAppartment() { return appartment; } public void setAppartment(String appartment) { this.appartment = appartment; } }
UTF-8
Java
3,226
java
EditUserForm.java
Java
[]
null
[]
package com.epam.library.form; import javax.validation.constraints.Pattern; import org.hibernate.validator.constraints.Length; import org.hibernate.validator.constraints.NotBlank; import com.epam.library.domain.User; import com.epam.library.support.FieldMatch; @FieldMatch.List({ @FieldMatch(first = "password", second = "passwordConfirmation")}) public class EditUserForm { @NotBlank @Length(min = 4, max = 50) private String password; @NotBlank @Length(min = 4, max = 50) private String passwordConfirmation; @NotBlank @Length(max = 50) private String firstName; @NotBlank @Length(max = 50) private String lastName; @NotBlank @Length(max = 50) private String country; @NotBlank @Length(max = 50) private String city; @NotBlank @Length(max = 50) private String street; @NotBlank @Length(max = 50) private String house; @Length(max = 50) private String appartment; @Length(max = 20) @Pattern(regexp = "(^\\+(?:[0-9] ?){6,14}[0-9]$)?") private String contactPhone; public EditUserForm() { } public EditUserForm(User user) { this.firstName = user.getFirstName(); this.lastName = user.getLastName(); this.country = user.getAddress().getCountry().getCountryName(); this.city = user.getAddress().getCity().getCityName(); this.street = user.getAddress().getStreet().getStreetName(); this.house = user.getAddress().getHouse(); this.appartment = user.getAddress().getApartment(); this.contactPhone = user.getContactPhone(); } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getPasswordConfirmation() { return passwordConfirmation; } public void setPasswordConfirmation(String passwordConfirmation) { this.passwordConfirmation = passwordConfirmation; } 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 getCountry() { return country; } public void setCountry(String country) { this.country = country; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } public String getStreet() { return street; } public void setStreet(String street) { this.street = street; } public String getHouse() { return house; } public void setHouse(String house) { this.house = house; } public String getContactPhone() { return contactPhone; } public void setContactPhone(String contactPhone) { this.contactPhone = contactPhone; } public String getAppartment() { return appartment; } public void setAppartment(String appartment) { this.appartment = appartment; } }
3,226
0.633292
0.624303
146
21.09589
19.491596
85
false
false
0
0
0
0
0
0
0.328767
false
false
4
86dea372b3a9f497db60937fcaf10fe4dfa18303
30,932,354,520,071
865687753db2604b6c307136dc147fb9edf948ae
/testing/src/interview_coding/PalindromeNumber.java
989d5f20650498c7ff488ff4a52793cd65a8211a
[]
no_license
azharkadri/testing
https://github.com/azharkadri/testing
c5d0152a0aa39d1972a9c39dd5bf11741035bf30
d79c7a5a476c5b4ab713786916b2b2e963304622
refs/heads/master
2021-05-22T14:58:15.848000
2020-04-04T10:55:07
2020-04-04T10:55:07
252,972,281
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package interview_coding; import java.util.Scanner; public class PalindromeNumber { public static void isPalindrome(int num) { int dup=num,rev=0; while(num>0) { rev=rev*10+(num%10); num/=10; } if(dup==rev) { System.out.println("yes, palindrome number: "+rev); } else System.out.println("no, not a palindrome number: "+rev); } public static void main(String[] args) { Scanner sc=new Scanner(System.in); System.out.println("enter a number"); int num=sc.nextInt(); isPalindrome(num); sc.close(); } }
UTF-8
Java
539
java
PalindromeNumber.java
Java
[]
null
[]
package interview_coding; import java.util.Scanner; public class PalindromeNumber { public static void isPalindrome(int num) { int dup=num,rev=0; while(num>0) { rev=rev*10+(num%10); num/=10; } if(dup==rev) { System.out.println("yes, palindrome number: "+rev); } else System.out.println("no, not a palindrome number: "+rev); } public static void main(String[] args) { Scanner sc=new Scanner(System.in); System.out.println("enter a number"); int num=sc.nextInt(); isPalindrome(num); sc.close(); } }
539
0.662338
0.647495
27
18.962963
17.179836
59
false
false
0
0
0
0
0
0
1.962963
false
false
4
dfdfc349127bcb7964d87f1669c50123e4b5bb61
37,924,561,247,629
15fc218f82eb4dce44f851de1f66d133af3384de
/app/src/main/java/org/ubucode/droidwalkersplanechase/DeckController.java
d0389b93041976a6c4efa43afabbbad1ddfdabb2
[]
no_license
mpcodemonkey/planechase
https://github.com/mpcodemonkey/planechase
2b12c8df3541e4cbb4574124c6a446272e2efe6a
d55f290cbd9108c0aff0eb6568b5e66f79beffd5
refs/heads/master
2020-09-17T09:12:03.622000
2014-07-25T05:27:50
2014-07-25T05:27:50
67,546,816
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package org.ubucode.droidwalkersplanechase; /** * Created by Jon on 7/20/2014. */ import android.content.Context; import android.util.Log; import java.io.IOException; import java.util.Collections; import java.util.Iterator; import java.util.LinkedList; import java.util.List; public class DeckController { private LinkedList<Card> planeQueue; private Card currentPlane; private Context context; public DeckController(Context c) { planeQueue = new LinkedList<Card>(); context = c; onStart(); } //grabs planeCards from db, initializes entries in planequeue private void onStart() { DataBaseHelper helper = null; try { helper = new DataBaseHelper(context); helper.opendatabase(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } List<Card> res = helper.getAllPlanes(); Iterator<Card> why = res.iterator(); while (why.hasNext()) { Card p = why.next(); planeQueue.add(p); } currentPlane = planeQueue.peek(); helper.close(); } public boolean nextPlane() { Card tmp = currentPlane; planeQueue.removeFirst(); currentPlane = planeQueue.getFirst(); planeQueue.addLast(tmp); return checkForEvent(); } private boolean checkForEvent() { return false; } public void prevPlane() { Card tmp = planeQueue.removeLast(); currentPlane = tmp; planeQueue.addFirst(tmp); } public Card getCurrentPlane() { // TODO Auto-generated method stub return this.currentPlane; } public void shuffle(){ Collections.shuffle(planeQueue); } public void randomizePlane(){ shuffle(); setCurrentPlane(planeQueue.peek()); } public void setCurrentPlane(Card p) { // TODO Auto-generated method stub this.currentPlane = p; } public LinkedList<Card> getPlaneQueue() { // TODO Auto-generated method stub return this.planeQueue; } }
UTF-8
Java
2,156
java
DeckController.java
Java
[ { "context": "ubucode.droidwalkersplanechase;\n\n/**\n * Created by Jon on 7/20/2014.\n */\n\nimport android.content.Context", "end": 66, "score": 0.9916352033615112, "start": 63, "tag": "NAME", "value": "Jon" } ]
null
[]
package org.ubucode.droidwalkersplanechase; /** * Created by Jon on 7/20/2014. */ import android.content.Context; import android.util.Log; import java.io.IOException; import java.util.Collections; import java.util.Iterator; import java.util.LinkedList; import java.util.List; public class DeckController { private LinkedList<Card> planeQueue; private Card currentPlane; private Context context; public DeckController(Context c) { planeQueue = new LinkedList<Card>(); context = c; onStart(); } //grabs planeCards from db, initializes entries in planequeue private void onStart() { DataBaseHelper helper = null; try { helper = new DataBaseHelper(context); helper.opendatabase(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } List<Card> res = helper.getAllPlanes(); Iterator<Card> why = res.iterator(); while (why.hasNext()) { Card p = why.next(); planeQueue.add(p); } currentPlane = planeQueue.peek(); helper.close(); } public boolean nextPlane() { Card tmp = currentPlane; planeQueue.removeFirst(); currentPlane = planeQueue.getFirst(); planeQueue.addLast(tmp); return checkForEvent(); } private boolean checkForEvent() { return false; } public void prevPlane() { Card tmp = planeQueue.removeLast(); currentPlane = tmp; planeQueue.addFirst(tmp); } public Card getCurrentPlane() { // TODO Auto-generated method stub return this.currentPlane; } public void shuffle(){ Collections.shuffle(planeQueue); } public void randomizePlane(){ shuffle(); setCurrentPlane(planeQueue.peek()); } public void setCurrentPlane(Card p) { // TODO Auto-generated method stub this.currentPlane = p; } public LinkedList<Card> getPlaneQueue() { // TODO Auto-generated method stub return this.planeQueue; } }
2,156
0.607607
0.60436
91
22.681318
16.725239
65
false
false
0
0
0
0
0
0
0.43956
false
false
4
9d973c87dd3ddd43adc43c68212819549f8ba953
20,280,835,638,998
8d3a9f0bdb3f5ea6f644a0e472c5d88de11f402b
/app/src/main/java/com/example/android/popularmovies/ImageAdapter.java
2fb5148adf390c7b9302d61c0249a72c08c4b929
[]
no_license
niteshgrg/Popular-Movies
https://github.com/niteshgrg/Popular-Movies
4594732c7b8da776cd633c130538df59eb67096a
42da9c3d97083531eecfc3fa3139b845ed34d709
refs/heads/master
2016-09-06T02:51:06.829000
2016-02-03T17:53:42
2016-02-03T17:53:42
42,601,080
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.android.popularmovies; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView; import com.example.android.popularmovies.model.Results; import com.squareup.picasso.Picasso; import java.util.ArrayList; public class ImageAdapter extends BaseAdapter { private Context mContext; private LayoutInflater mInflater; String BASE_URL = "http://image.tmdb.org/t/p/w185/"; private final String LOG_TAG = ImageAdapter.class.getSimpleName(); ArrayList<Results> images; public ImageAdapter(Context c, ArrayList<Results> temp) { super(); mContext = c; images = temp; mInflater = LayoutInflater.from(mContext); } public void updateContent(ArrayList<Results> temp) { this.images.clear(); this.images = temp; this.notifyDataSetChanged(); } public int getCount() { return images.size(); } public String getItem(int position) { return images.get(position).getPoster_path(); } public long getItemId(int position) { return 0; } public static class ViewHolder { public ImageView imageView; } // create a new ImageView for each item referenced by the Adapter @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder ; View vi = convertView; if (convertView == null) { // if it's not recycled, initialize some attributes vi = mInflater.inflate(R.layout.grid_item, null); holder = new ViewHolder(); holder.imageView = (ImageView) vi.findViewById(R.id.picture); vi.setTag(holder); } else { holder = (ViewHolder) vi.getTag(); } String url = BASE_URL + getItem(position); Picasso.with(mContext).load(url).fit().into(holder.imageView); return vi; } }
UTF-8
Java
2,066
java
ImageAdapter.java
Java
[]
null
[]
package com.example.android.popularmovies; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView; import com.example.android.popularmovies.model.Results; import com.squareup.picasso.Picasso; import java.util.ArrayList; public class ImageAdapter extends BaseAdapter { private Context mContext; private LayoutInflater mInflater; String BASE_URL = "http://image.tmdb.org/t/p/w185/"; private final String LOG_TAG = ImageAdapter.class.getSimpleName(); ArrayList<Results> images; public ImageAdapter(Context c, ArrayList<Results> temp) { super(); mContext = c; images = temp; mInflater = LayoutInflater.from(mContext); } public void updateContent(ArrayList<Results> temp) { this.images.clear(); this.images = temp; this.notifyDataSetChanged(); } public int getCount() { return images.size(); } public String getItem(int position) { return images.get(position).getPoster_path(); } public long getItemId(int position) { return 0; } public static class ViewHolder { public ImageView imageView; } // create a new ImageView for each item referenced by the Adapter @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder ; View vi = convertView; if (convertView == null) { // if it's not recycled, initialize some attributes vi = mInflater.inflate(R.layout.grid_item, null); holder = new ViewHolder(); holder.imageView = (ImageView) vi.findViewById(R.id.picture); vi.setTag(holder); } else { holder = (ViewHolder) vi.getTag(); } String url = BASE_URL + getItem(position); Picasso.with(mContext).load(url).fit().into(holder.imageView); return vi; } }
2,066
0.646176
0.64424
80
24.8375
22.225235
75
false
false
0
0
0
0
0
0
0.5125
false
false
4
d5da6f9b158856bc2bb84e3b00c5f28e7c0be85c
35,003,983,515,596
2a8b8d74ae0e30b2459813b69e906c8170278afc
/src/com/tcmimg/service/ImageService.java
a22aea9f5e0a5925c01da3193232c235d8e48190
[]
no_license
formularrr/tcmimg
https://github.com/formularrr/tcmimg
aa4ca55360dbf040d915786f3127bd5e3705ab7d
806f485ca786ca0abdc827a4ce5b4d0da045573d
refs/heads/master
2020-12-24T13:52:39.895000
2014-11-13T13:15:22
2014-11-13T13:15:22
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.tcmimg.service; import java.io.IOException; import java.util.List; import com.tcmimg.po.Image; public interface ImageService { public List<Image> getAllImages(); public Image getFirstUnlabeledImage(); public Image getImageById(long id); public boolean labelImage(Long labelID, Long plantID, String picPath, String picName, String picType, String picPart, String picDescription) throws IOException; public String uploadImage(List fileList); public List searchImage(String name); public String getType(String path); }
UTF-8
Java
581
java
ImageService.java
Java
[]
null
[]
package com.tcmimg.service; import java.io.IOException; import java.util.List; import com.tcmimg.po.Image; public interface ImageService { public List<Image> getAllImages(); public Image getFirstUnlabeledImage(); public Image getImageById(long id); public boolean labelImage(Long labelID, Long plantID, String picPath, String picName, String picType, String picPart, String picDescription) throws IOException; public String uploadImage(List fileList); public List searchImage(String name); public String getType(String path); }
581
0.741824
0.741824
24
22.208334
20.326458
70
false
false
0
0
0
0
0
0
1.458333
false
false
4
20435b8a65ac7cee786ea0cf4dc1cdd983d3e9c0
35,003,983,512,303
f6b90fae50ea0cd37c457994efadbd5560a5d663
/android/nut-dex2jar.src/android/support/v4/app/bk.java
bd17e33af0a698097a756cecbdf0ccf854d1235c
[]
no_license
dykdykdyk/decompileTools
https://github.com/dykdykdyk/decompileTools
5925ae91f588fefa7c703925e4629c782174cd68
4de5c1a23f931008fa82b85046f733c1439f06cf
refs/heads/master
2020-01-27T09:56:48.099000
2016-09-14T02:47:11
2016-09-14T02:47:11
66,894,502
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package android.support.v4.app; public final class bk extends bx { CharSequence a; } /* Location: C:\crazyd\work\ustone\odm2016031702\baidu\android\nut-dex2jar.jar * Qualified Name: android.support.v4.app.bk * JD-Core Version: 0.6.2 */
UTF-8
Java
259
java
bk.java
Java
[]
null
[]
package android.support.v4.app; public final class bk extends bx { CharSequence a; } /* Location: C:\crazyd\work\ustone\odm2016031702\baidu\android\nut-dex2jar.jar * Qualified Name: android.support.v4.app.bk * JD-Core Version: 0.6.2 */
259
0.69112
0.629344
11
22.636364
26.077761
88
false
false
0
0
0
0
0
0
0.181818
false
false
4
1a941b8d4c37ebaeb410f8299cbf7dbea8e7895b
38,714,835,226,537
234634a7cc966b48f85157267fa5d37706633f57
/espirit-core/src/main/java/com/espirit/eap/pagelayout/PageUpgrade.java
7d7bfc268ed92277ac1353c6242ba69d421c5f8d
[]
no_license
13285146182/harry
https://github.com/13285146182/harry
ea30eb18f67fdc0d15619c0070fe1b02f34c5450
024d9d61d17e254ae000380a0120c478cac8e844
refs/heads/master
2019-07-18T18:39:09.842000
2016-10-10T02:02:25
2016-10-10T02:02:25
62,796,865
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.espirit.eap.pagelayout; import java.util.List; import java.util.Map; import com.espirit.eap.manager.I18n; import com.googlecode.cswish.struts.AutoRun; public class PageUpgrade { private int version; private PagePlugin pagePlugin; // the element model private List<Model> models; // the page element data private List<PageCache> pageCaches; // file data: class file, js file, css file, local freemarker file private List<PageFileData> fileDatas; private List<Object> initData; private Map<String,I18n> i18ns; private AutoRun autoRun; public int getVersion() { return version; } public void setVersion(int version) { this.version = version; } public List<Model> getModels() { return models; } public void setModels(List<Model> models) { this.models = models; } public List<PageCache> getPageCaches() { return pageCaches; } public void setPageCaches(List<PageCache> pageCaches) { this.pageCaches = pageCaches; } public List<PageFileData> getFileDatas() { return fileDatas; } public void setFileDatas(List<PageFileData> fileDatas) { this.fileDatas = fileDatas; } public Map<String, I18n> getI18ns() { return i18ns; } public void setI18ns(Map<String, I18n> i18ns) { this.i18ns = i18ns; } public String getModelName() { return pageCaches.get(0).getModel().getName(); } public List<Object> getInitData() { return initData; } public void setInitData(List<Object> initData) { this.initData = initData; } @Override public String toString() { return getModelName(); } public AutoRun getAutoRun() { return autoRun; } public void setAutoRun(AutoRun autoRun) { this.autoRun = autoRun; } public PagePlugin getPagePlugin() { return pagePlugin; } public void setPagePlugin(PagePlugin pagePlugin) { this.pagePlugin = pagePlugin; } public boolean isEmpty() { return (initData == null || initData.isEmpty()) && (autoRun == null) && (pageCaches == null || pageCaches.isEmpty()) && (fileDatas == null || fileDatas.isEmpty()); } }
UTF-8
Java
2,168
java
PageUpgrade.java
Java
[]
null
[]
package com.espirit.eap.pagelayout; import java.util.List; import java.util.Map; import com.espirit.eap.manager.I18n; import com.googlecode.cswish.struts.AutoRun; public class PageUpgrade { private int version; private PagePlugin pagePlugin; // the element model private List<Model> models; // the page element data private List<PageCache> pageCaches; // file data: class file, js file, css file, local freemarker file private List<PageFileData> fileDatas; private List<Object> initData; private Map<String,I18n> i18ns; private AutoRun autoRun; public int getVersion() { return version; } public void setVersion(int version) { this.version = version; } public List<Model> getModels() { return models; } public void setModels(List<Model> models) { this.models = models; } public List<PageCache> getPageCaches() { return pageCaches; } public void setPageCaches(List<PageCache> pageCaches) { this.pageCaches = pageCaches; } public List<PageFileData> getFileDatas() { return fileDatas; } public void setFileDatas(List<PageFileData> fileDatas) { this.fileDatas = fileDatas; } public Map<String, I18n> getI18ns() { return i18ns; } public void setI18ns(Map<String, I18n> i18ns) { this.i18ns = i18ns; } public String getModelName() { return pageCaches.get(0).getModel().getName(); } public List<Object> getInitData() { return initData; } public void setInitData(List<Object> initData) { this.initData = initData; } @Override public String toString() { return getModelName(); } public AutoRun getAutoRun() { return autoRun; } public void setAutoRun(AutoRun autoRun) { this.autoRun = autoRun; } public PagePlugin getPagePlugin() { return pagePlugin; } public void setPagePlugin(PagePlugin pagePlugin) { this.pagePlugin = pagePlugin; } public boolean isEmpty() { return (initData == null || initData.isEmpty()) && (autoRun == null) && (pageCaches == null || pageCaches.isEmpty()) && (fileDatas == null || fileDatas.isEmpty()); } }
2,168
0.671125
0.660517
110
17.709091
17.911573
67
false
false
0
0
0
0
0
0
1.372727
false
false
4
0d9bf2cedc0e141cebc2f45b45baf61cdc7cdfc8
39,178,691,701,863
43a40e671821fde3a4fcd2dda2e09237cc324406
/Week8/src/factory2/Burger.java
c8c7e6c2954a9edf3072ad44c0d3e8eb5d241295
[]
no_license
207f20/L9101
https://github.com/207f20/L9101
bacb7be465dff7df88fa10d5ba62d302bf969940
3d849d1f4a85e179475d714fe9e41069006e4192
refs/heads/master
2023-02-01T17:47:00.934000
2020-12-20T22:14:07
2020-12-20T22:14:07
291,826,739
4
11
null
null
null
null
null
null
null
null
null
null
null
null
null
package factory2; public class Burger extends Food { private int calories; private String name; public Burger() { this.name = "Burger"; this.calories = 780; } @Override public String eat() { return "bite chew chew"; } @Override public int getCalories() { return this.calories; } @Override public String getName() { return this.name; } }
UTF-8
Java
367
java
Burger.java
Java
[ { "context": "e String name;\n\n\tpublic Burger() {\n\t\tthis.name = \"Burger\";\n\t\tthis.calories = 780;\n\t}\n\n\t@Override\n\tpubli", "end": 139, "score": 0.6284262537956238, "start": 136, "tag": "NAME", "value": "Bur" } ]
null
[]
package factory2; public class Burger extends Food { private int calories; private String name; public Burger() { this.name = "Burger"; this.calories = 780; } @Override public String eat() { return "bite chew chew"; } @Override public int getCalories() { return this.calories; } @Override public String getName() { return this.name; } }
367
0.673025
0.662125
27
12.592592
10.884101
34
false
false
0
0
0
0
0
0
1.185185
false
false
4
68ed3701dd4037bf8d51f3a1262123d9cd867da2
39,101,382,275,781
d80d66023b2d3029fe754797de854aaccd2d7bd5
/app/src/main/java/com/lemap/lxasset/data/AppConfig.java
c7463971334ebdc79b1553dc3c5ed42c563bcd43
[]
no_license
Bruce-Romance/LxAsset
https://github.com/Bruce-Romance/LxAsset
57a44d34d6cc4e1bd5935b89c03de84018fd165b
e63602143b6393064992537db11c03c45a105e71
refs/heads/master
2018-12-15T06:14:20.194000
2018-12-06T05:42:08
2018-12-06T05:42:08
148,711,816
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/** * 版权所有 (C) Lemap 2012 * * @author 廖安良 * @version 创建时间:2013-1-16 上午9:50:15 */ package com.lemap.lxasset.data; import java.net.MalformedURLException; import java.net.URL; import android.annotation.SuppressLint; import android.content.SharedPreferences.Editor; import com.lemap.authorize.AuthorizeType; import com.lemap.authorize.AuthorizeUtils; import com.lemap.cloudPerform.CAO; import com.lemap.core.AppParamContext; import com.lemap.core.LemapContext; import com.lemap.core.utils.EnumConvert; import com.lemap.core.utils.StringValidator; /** * 应用配置项 * * @author 廖安良 * @version 创建时间:2013-1-16 上午9:50:15 */ @SuppressLint("SdCardPath") public abstract class AppConfig { private static String mAccessToken; private static BarCodeMode mBarCodeMode; private static String mEnterpriseCode; private static int mUniqueCodeNotCheckRepeat = -1; private static int mGetBarCodeOnline = -1; private static String mUserCode; private static String mUserPhone; private static String mUserName; private static String mUserPassword; private static Role mUserRole; private static String mClientShortCode; private static String mTempStorageCode; @SuppressWarnings("unused") private static String mClientCode; private static int mMaxBarCodeLength = -1; private static int mMaxBarCodeCutLength = -1; private static String mOrgCode; private static String mCurrentVersion; private static final String BPIString = "MPos.Business.dll::MPos.Business.%s.%s()"; private static final String mLemapServiceUrl = "http://122.13.0.67:8898"; public static final String mAuthorizeBPIString = "MPos.Business.dll::MPos.Business.%s.%s()"; public static final String mAuthorizeServiceUrl = "authorize.kuaidingtong.com:8088"; private static String mUpgradeServiceUrl;//= "upgrade.kuaidingtong.com:8089"; //图片缓存路径 public static final String mImagesCachePath = "Caches/Goods/"; // 当无码时,默认的尺码编号 public static String getDefaultSizeCode = "000001"; // 当无码时,默认的尺码名称 public static String getDefaultSizeName = "无码"; // 当无色时,默认的颜色编号 public static String getDefaultColorCode = "000002"; // 当无色时,默认的颜色名称 public static String getDefaultColorName = "无色"; private static String mAgent; private static String mStore; /** * 获得授权服务URL * * @return */ public static String getLemapServiceUrl() { return mLemapServiceUrl; } // 零售默认订单ID public static String getDefaultOrderId = "0000"; /** * 临时 * * @return */ public static String getLastVersion() { return LemapContext.getSingleDefault().getSharedPreferences().getString("LastVersion", ""); } /** * 临时 * * @param url */ public static void setLastVersion(String value) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("LastVersion", value); editor.commit(); } /** * 获取版本号 * * @return */ public static String getCurrentVersion() { if (mCurrentVersion == null) { mCurrentVersion = LemapContext.getSingleDefault().getSharedPreferences().getString("CurrentVersion", ""); } return mCurrentVersion; } /** * 设置版本号 * * @param url */ public static void setCurrentVersion(String version) { mCurrentVersion = version; Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("CurrentVersion", mCurrentVersion); editor.commit(); } /** * 获取是否开启连续扫描(RFID) * @return */ public static boolean getOpenContinuityScan(){ return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("ContinuityScan",false); } /** * 设置是否开启连续扫描(RFID) * @param isOpen */ public static void setOpenContinuityScan(boolean isOpen){ Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("ContinuityScan",isOpen); editor.commit(); } /** * 获取企业编号 * * @return */ public static String getEnterpriseCode() { Object obj = LemapContext.getSingleDefault().getAppParamContext().getValue(AppParamContext.EnterpriseCode); if (obj != null) { return obj.toString(); } return ""; } /** * 设置企业编号 * * @param url */ public static void setEnterpriseCode(String enterpriseCode) { mEnterpriseCode = enterpriseCode; Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString(ParamsKeys.Param_EnterpriseCode, enterpriseCode); editor.commit(); LemapContext.getSingleDefault().getAppParamContext().putValue(AppParamContext.EnterpriseCode, enterpriseCode); } /** * 获取是否授权标示 * * @return */ public static boolean getIsAuthorize() { AuthorizeType authorizeType = AuthorizeUtils.getAuthorizeType(); return authorizeType == AuthorizeType.Authorize; } /** * 获取BPIString * * @param clsName 业务类名 * @param actionName 方法名 * @return BPIString * @author 廖安良 * @version 创建时间:2013-1-22 下午2:54:08 */ public static String getAuthorizeBPIString(String clsName, String actionName) { return String.format(AppConfig.mAuthorizeBPIString, clsName, actionName); } /** * 获取升级地址 * * @return */ public static String getUpgradeServiceUrl() { if (mUpgradeServiceUrl == null) { mUpgradeServiceUrl = LemapContext.getSingleDefault().getSharedPreferences().getString("UpgradeServiceUrl", ""); } return mUpgradeServiceUrl; } /** * 设置升级地址 * * @param url */ public static void setUpgradeServiceUrl(String url) { mUpgradeServiceUrl = url; Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("UpgradeServiceUrl", mUpgradeServiceUrl); editor.commit(); } /** * 获取同步周期 * * @author 廖安良 * @version 创建时间:2013-1-24 下午5:23:53 */ public static int getSyncPeriod() { return LemapContext.getSingleDefault().getSharedPreferences() .getInt("SyncPeriod", 1000 * 60 * 10);// 默认10分钟 } /** * 设置同步周期 * * @author 廖安良 * @version 创建时间:2013-1-24 下午5:23:53 */ public static void setSyncPeriod(int mSyncPeriod) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putInt("SyncPeriod", mSyncPeriod); editor.commit(); } /** * 获取访问云端Url * * @return * @author 廖安良 * @version 创建时间:2013-1-23 下午4:16:22 */ public static String getCloudUrl(String ipAndPort) { return "http://" + ipAndPort + "/Lemap/CloudService"; } /** * 获取云端IP和端口 * * @return * @author 廖安良 * @version 创建时间:2013-1-23 下午4:16:22 */ public static String getCloudIPAndPort() { try { URL rul = new URL(LemapContext.getSingleDefault() .getSharedPreferences() .getString(CAO.STR_CAOITEMKEY, CAO.STR_URLDEFUALT)); return rul.getHost() + ":" + rul.getPort(); } catch (MalformedURLException e) { e.printStackTrace(); return CAO.STR_URLDEFUALT.substring("http://".length()); } } /** * 设置默认云端IP和端口 * * @param cloudIPAndPort 云端IP和端口 * @author 廖安良 * @version 创建时间:2013-1-23 下午4:16:42 */ public static void setDefaultCloudIPAndPort(String cloudIPAndPort) { if (!LemapContext.getSingleDefault().getSharedPreferences() .contains(CAO.STR_CAOITEMKEY)) { AppConfig.setCloudIPAndPort(cloudIPAndPort); } } /** * 设置云端IP和端口 * * @param cloudIPAndPort 云端IP和端口 * @author 廖安良 * @version 创建时间:2013-1-23 下午4:16:42 */ public static void setCloudIPAndPort(String cloudIPAndPort) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString(CAO.STR_CAOITEMKEY, AppConfig.getCloudUrl(cloudIPAndPort)); editor.commit(); } /** * 获取BPIString * * @param clsName 业务类名 * @param actionName 方法名 * @return BPIString * @author 廖安良 * @version 创建时间:2013-1-22 下午2:54:08 */ public static String getBPIString(String clsName, String actionName) { return String.format(AppConfig.BPIString, clsName, actionName); } /** * 返回用户编号(用于关联) * * @return 用户编号 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getUserCode() { if (mUserCode == null) mUserCode = LemapContext.getSingleDefault().getSharedPreferences() .getString("UserCode", ""); return mUserCode; } /** * 设置用户编号 * * @param 用户编号 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setUserCode(String userCode) { mUserCode = userCode; Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("UserCode", mUserCode); editor.commit(); } /** * 返回客服联系人 * * @return 客服联系人 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getContact() { return LemapContext.getSingleDefault().getSharedPreferences().getString("Contact", "杨先生"); } /** * 设置客服联系人 * * @param 客服联系人 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setContact(String contact) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("Contact", contact); editor.commit(); } /** * 返回客服联系电话 * * @return 客服联系电话 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getContactTel() { return LemapContext.getSingleDefault().getSharedPreferences().getString("ContactTel", "020-22203916"); } /** * 设置客服联系电话 * * @param 客服联系电话 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setContactTel(String contactTel) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("ContactTel", contactTel); editor.commit(); } /** * 返回收银台 * * @return 收银台 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getVfpCode() { String vfpCode = LemapContext.getSingleDefault().getSharedPreferences() .getString("VfpCode", ""); if (StringValidator.isNullOrEmpty(vfpCode)) vfpCode = "0"; return vfpCode; } /** * 设置收银台 * * @param 收银台 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setVfpCode(String vfpCode) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("VfpCode", vfpCode); editor.commit(); } /** * 返回默认库位 * * @return 默认库位 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getDefaultStorageLocationCode() { String code = LemapContext.getSingleDefault().getSharedPreferences() .getString("DefaultStorageLocationCode", ""); if (StringValidator.isNullOrEmpty(code)) code = ""; return code; } /** * 设置默认库位 * * @param 默认库位 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setDefaultStorageLocationCode(String code) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("DefaultStorageLocationCode", code); editor.commit(); } /** * 返回店铺默认库位 * * @return 店铺默认库位 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getDefaultShopLocationCode() { String code = LemapContext.getSingleDefault().getSharedPreferences() .getString("DefaultShopLocationCode", ""); if (StringValidator.isNullOrEmpty(code)) code = ""; return code; } /** * 设置店铺默认库位 * * @param 店铺默认库位 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setDefaultShopLocationCode(String code) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("DefaultShopLocationCode", code); editor.commit(); } /** * 返回店铺默认仓库 * * @return 店铺默认仓库 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getDefaultShopStorageCode() { String code = LemapContext.getSingleDefault().getSharedPreferences() .getString("DefaultShopStorageCode", ""); if (StringValidator.isNullOrEmpty(code)) code = ""; return code; } /** * 设置店铺默认仓库 * * @param 店铺默认仓库 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setDefaultShopStorageCode(String code) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("DefaultShopStorageCode", code); editor.commit(); } /** * 返回默认仓库 * * @return 订单默认仓库 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getDefaultFromStorageCode() { String code = LemapContext.getSingleDefault().getSharedPreferences() .getString("DefaultFromStorageCode", ""); if (StringValidator.isNullOrEmpty(code)) code = ""; return code; } /** * 设置默认仓库 * * @param 订单默认仓库 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setDefaultFromStorageCode(String code) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("DefaultFromStorageCode", code); editor.commit(); } /** * 返回默认仓库 * * @return 订单默认仓库 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getChannelDefaultOrderStorageCode() { String code = LemapContext.getSingleDefault().getSharedPreferences() .getString("ChannelDefaultOrderStorageCode", ""); if (StringValidator.isNullOrEmpty(code)) code = ""; return code; } /** * 设置订单默认仓库 * * @param 订单默认仓库 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setChannelDefaultOrderStorageCode(String code) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("ChannelDefaultOrderStorageCode", code); editor.commit(); } /** * 返回订单默认库位 * * @return 订单默认库位 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getChannelDefaultOrderStorageLocationCode() { String code = LemapContext.getSingleDefault().getSharedPreferences() .getString("ChannelDefaultOrderStorageLocationCode", ""); if (StringValidator.isNullOrEmpty(code)) code = ""; return code; } /** * 设置订单默认库位 * * @param 订单默认库位 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setChannelDefaultOrderStorageLocationCode(String code) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("ChannelDefaultOrderStorageLocationCode", code); editor.commit(); } /** * 返回用户手机 * * @return 用户手机 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getUserPhone() { if (mUserPhone == null) mUserPhone = LemapContext.getSingleDefault().getSharedPreferences() .getString("UserPhone", ""); return mUserPhone; } /** * 设置用户手机 * * @param 用户手机 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setUserPhone(String userPhone) { mUserPhone = userPhone; Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("UserPhone", mUserPhone); editor.commit(); } /** * 返回店铺编号 * * @return 店铺编号 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getShopCode() { return LemapContext.getSingleDefault().getSharedPreferences() .getString("ShopCode", ""); } /** * 设置店铺编号 * * @param shopCode 店铺编号 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setShopCode(String shopCode) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("ShopCode", shopCode); editor.commit(); } /** * 返回店铺名称 * * @return 店铺名称 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getShopName() { return LemapContext.getSingleDefault().getSharedPreferences() .getString("ShopName", ""); } /** * 设置店铺名称 * * @param shopName 店铺编号 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setShopName(String shopName) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("ShopName", shopName); editor.commit(); } /** * 返回店铺价格字段 * * @return 店铺价格字段 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getShopSalePriceField() { String fileValue = LemapContext.getSingleDefault().getSharedPreferences() .getString("ShopSalePriceField", "BZSJ"); return fileValue; } /** * 设置店铺价格字段 * * @param shopName 店铺价格字段 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setShopSalePriceField(String fieldName) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("ShopSalePriceField", fieldName); editor.commit(); } /** * 返回用户姓名 * * @return 用户姓名 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getUserName() { if (mUserName == null) mUserName = LemapContext.getSingleDefault().getSharedPreferences() .getString("UserName", ""); return mUserName; } /** * 设置用户姓名 * * @param 用户姓名 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setUserName(String userName) { mUserName = userName; Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("UserName", mUserName); editor.commit(); } /** * 返回用户密码 * * @return 用户密码 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:29 */ public static String getUserPassword() { if (mUserPassword == null) mUserPassword = LemapContext.getSingleDefault() .getSharedPreferences().getString("UserPassword", ""); return mUserPassword; } /** * 设置用户密码 * * @param 用户密码 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:29 */ public static void setUserPassword(String userPassword) { mUserPassword = userPassword; Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("UserPassword", mUserPassword); editor.commit(); } /** * 返回用户角色 * * @return 用户角色 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:29 */ public static Role getUserRole() { return mUserRole; } /** * 设置用户角色 * * @param 用户角色 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:29 */ public static void setUserRole(Role userRole) { mUserRole = userRole; } /** * 返回设备编号 * * @return 设备编号 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:29 */ public static String getClientShortCode() { return mClientShortCode; } /** * 设置设备编号 * * @param 企业信息 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:29 */ public static void setClientShortCode(String shortCode) { mClientShortCode = shortCode; } /** * 返回是否记住密码 * * @return 是否记住密码 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static Boolean isRememberPassword() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("IsSavePassword", false); } /** * 设置是否记住密码 * * @param 是否记住密码 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void isRememberPassword(Boolean rememberPassword) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("IsSavePassword", rememberPassword); editor.commit(); } /** * 返回是否自动登录 * * @return 是否自动登录 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static Boolean isAutoLogin() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("IsAutoLogin", false); } /** * 设置是否自动登录 * * @param 是否自动登录 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void isAutoLogin(Boolean autoLogin) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("IsAutoLogin", autoLogin); editor.commit(); } /** * 返回蓝牙打印机的名称 * * @return 返回蓝牙打印机的名称 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getBlueName() { String def = ""; return LemapContext.getSingleDefault().getSharedPreferences().getString("BlueThPrintName", def); } /** * 设置蓝牙打印机的名称 * * @param 蓝牙打印机的名称 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setBlueName(String addrName) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("BlueThPrintName", addrName); editor.commit(); } /** * 返回蓝牙打印机地址 * * @return 返回蓝牙打印机地址 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getBlueThAddr() { String def = ""; return LemapContext.getSingleDefault().getSharedPreferences() .getString("BlueThPrintAddress", def); } /** * 设置蓝牙打印机地址 * * @param 蓝牙打印机地址 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setBlueThAddr(String addr) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("BlueThPrintAddress", addr); editor.commit(); } /** * 返回是否启用蓝牙打印机 * * @return 返回是否启用蓝牙打印机 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static Boolean getBlueThEnabled() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("BlueThPrintEnabled", false); } /** * 设置是否启用蓝牙打印机 * * @param 是否启用蓝牙打印机 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setBlueThEnabled(Boolean bEnabled) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("BlueThPrintEnabled", bEnabled); editor.commit(); } /** * 返回是否启用装箱单打印 * * @return 返回是否启用装箱单打印 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static Boolean getBoxPrintEnabled() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("BoxPrintEnabled", false); } /** * 设置是否启用装箱单打印 * * @param 是否启用装箱单打印 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setBoxPrintEnabled(Boolean bEnabled) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("BoxPrintEnabled", bEnabled); editor.commit(); } /** * 返回零售小票打印机的规格 * * @return 零售小票打印机的规格 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getBlueThPrintNorm() { String def = ""; return LemapContext.getSingleDefault().getSharedPreferences() .getString("BlueThPrintNorm", def); } /** * 设置零售小票打印机的规格 * * @param 零售小票打印机的规格 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setBlueThPrintNorm(String blueThPrintNorm) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("BlueThPrintNorm", blueThPrintNorm); editor.commit(); } /** * 返回零售时是否打印销售小票 * * @return 零售时是否打印销售小票 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static Boolean getSalePrintEnabled() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("SalePrintEnabled", false); } /** * 设置零售时是否打印销售小票 * * @param 零售时是否打印销售小票 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setSalePrintEnabled(Boolean bEnabled) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("SalePrintEnabled", bEnabled); editor.commit(); } /** * 返回装箱小票打的模板编号 * * @return 装箱小票打的模板编号 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getBoxPrintModelCode() { String def = ""; return LemapContext.getSingleDefault().getSharedPreferences() .getString("BoxPrintModelCode", def); } /** * 设置装箱小票打的模板编号 * * @param 装箱小票打的模板编号 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setBoxPrintModelCode(String code) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("BoxPrintModelCode", code); editor.commit(); } /** * 返回触摸不弹出输入法长按弹出 * * @return 触摸不弹出输入法长按弹出 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static Boolean getTouchNoShowAndLongClickShowEnabled() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("TouchNoShowAndLongClickShowEnabled", true); } /** * 设置触摸不弹出输入法长按弹出 * * @param 触摸不弹出输入法长按弹出 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setTouchNoShowAndLongClickShowEnabled(Boolean bEnabled) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("TouchNoShowAndLongClickShowEnabled", bEnabled); editor.commit(); } /** * 返回仓库调整单启用标志 * * @return 启用标志 * @author 马时洁 * @version 创建时间:2013-1-16 上午9:51:22 */ public static Boolean getTZD() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("TZD", true); } /** * 设置仓库调整单启用标志 * * @param 设置仓库调整单 * @author 马时洁 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setTZD(Boolean bEnabled) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("TZD", bEnabled); editor.commit(); } /** * 返回渠道补货单启用标志 * * @return 启用标志 * @author 马时洁 * @version 创建时间:2013-1-16 上午9:51:22 */ public static Boolean getQDBH() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("QDBH", true); } /** * 设置渠道补货单启用标志 * * @param 设置仓库调整单 * @author 马时洁 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setQDBH(Boolean bEnabled) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("QDBH", bEnabled); editor.commit(); } /** * 返回渠道收货单启用标志 * * @return 启用标志 * @author 马时洁 * @version 创建时间:2013-1-16 上午9:51:22 */ public static Boolean getQDSH() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("QDSH", true); } /** * 设置渠道收货单启用标志 * * @param 设置渠道收货单 * @author 马时洁 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setQDSH(Boolean bEnabled) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("QDSH", bEnabled); editor.commit(); } /** * 返回门店退货单启用标志 * * @return 启用标志 * @author 马时洁 * @version 创建时间:2013-1-16 上午9:51:22 */ public static Boolean getBack() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("Back", true); } /** * 设置门店退货单启用标志 * * @param 设置门店退货单 * @author 马时洁 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setBack(Boolean bEnabled) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("Back", bEnabled); editor.commit(); } /** * 返回日结时是否打印小票 * * @return 日结时是否打印小票 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static Boolean getSaleDayEndPrintEnabled() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("SaleDayEndPrintEnabled", false); } /** * 设置日结时是否打印小票 * * @param 日结时是否打印小票 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setSaleDayEndPrintEnabled(Boolean bEnabled) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("SaleDayEndPrintEnabled", bEnabled); editor.commit(); } /** * 返回云平台入口的url * * @return 用户密码 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:29 */ public static String getLemapEnterUrl() { return LemapContext.getSingleDefault().getSharedPreferences() .getString(CAO.STR_CAOITEMKEY, CAO.STR_URLDEFUALT); } /** * 设置云平台入口的url * * @param 用户密码 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:29 */ public static void setLemapEnterUrl(String url) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString(CAO.STR_CAOITEMKEY, url); editor.commit(); } /** * 返回是否允许折上折 * * @return 是否允许折上折 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static Boolean getDiscountOnEnable() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("IsDiscountOnEnable", false); } /** * 设置是否允许折上折 * * @param 是否允许折上折 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setDiscountOnEnable(Boolean discountOnEnable) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("IsDiscountOnEnable", discountOnEnable); editor.commit(); } /** * 返回是否允许手工折扣 * * @return 是否允许手工折扣 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static Boolean getDiscountManualEnable() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("IsDiscountManualEnable", false); } /** * 设置是否允许手工折扣 * * @param 是否允许手工折扣 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setDiscountManualEnable(Boolean discountManualEnable) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("IsDiscountManualEnable", discountManualEnable); editor.commit(); } /** * 返回默认营业员 * * @return 默认营业员 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getDefaultSalesMan() { String def = ""; return LemapContext.getSingleDefault().getSharedPreferences() .getString("DefaultSalesMan", def); } /** * 设置默认营业员 * * @param 默认营业员 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setDefaultSalesMan(String salesMan) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("DefaultSalesMan", salesMan); editor.commit(); } /** * 返回每行金额精度 * * @return 每行金额精度 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getRowAmountAccuracy() { String def = "#0.00"; return LemapContext.getSingleDefault().getSharedPreferences() .getString("RowAmountAccuracy", def); } /** * 设置每行金额精度 * * @param 每行金额精度 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setRowAmountAccuracy(String rowAmountAccuracy) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("RowAmountAccuracy", rowAmountAccuracy); editor.commit(); } /** * 返回每行金额精度计算方式 * * @return 每行金额精度计算方式 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getRowAmountAccuracyDeal() { String def = "四舍五入"; return LemapContext.getSingleDefault().getSharedPreferences() .getString("RowAmountAccuracyDeal", def); } /** * 设置每行金额精度计算方式 * * @param 每行金额精度计算方式 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setRowAmountAccuracyDeal(String rowAmountAccuracyDeal) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("RowAmountAccuracyDeal", rowAmountAccuracyDeal); editor.commit(); } /** * 返回总金额精度 * * @return 总金额精度 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getAmountAccuracy() { String def = "#0.00"; return LemapContext.getSingleDefault().getSharedPreferences() .getString("AmountAccuracy", def); } /** * 设置总金额精度 * * @param 总金额精度 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setAmountAccuracy(String amountAccuracy) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("AmountAccuracy", amountAccuracy); editor.commit(); } /** * 返回总金额精度计算方式 * * @return 总金额精度计算方式 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getAmountAccuracyDeal() { String def = "四舍五入"; return LemapContext.getSingleDefault().getSharedPreferences() .getString("AmountAccuracyDeal", def); } /** * 设置总金额精度计算方式 * * @param 总金额精度计算方式 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setAmountAccuracyDeal(String amountAccuracyDeal) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("AmountAccuracyDeal", amountAccuracyDeal); editor.commit(); } /** * 返回是否开启收货差异发送短信功能 * * @return 是否开启收货差异发送短信功能 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static Boolean getReceiptDiffSms() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("ReceiptDiffSms", false); } /** * 设置是否开启收货差异发送短信功能 * * @param 是否开启收货差异发送短信功能 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setReceiptDiffSms(Boolean receiptDiffSms) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("ReceiptDiffSms", receiptDiffSms); editor.commit(); } /** * 返回接收差异短信的手机号码 * * @return 接收差异短信的手机号码 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getSmsNumber() { return LemapContext.getSingleDefault().getSharedPreferences() .getString("SmsNumber", ""); } /** * 设置接收差异短信的手机号码 * * @param 接收差异短信的手机号码 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setSmsNumber(String smsNumber) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("SmsNumber", smsNumber); editor.commit(); } /** * 设置设备编号 * * @param 企业信息 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:29 */ public static void setClientCode(String shortCode) { mClientCode = shortCode; Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("ClientCode", shortCode); editor.commit(); } /** * 返回用户所属代理商 * * @return 用户所属代理商 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getAgent() { if (mAgent == null) mAgent = LemapContext.getSingleDefault().getSharedPreferences() .getString("Agent", ""); return mAgent; } /** * 设置用户所属代理商 * * @param 用户所属代理商 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setAgent(String Agent) { mAgent = Agent; Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("Agent", mAgent); editor.commit(); } /** * 返回用户所属店仓 * * @return 用户所属店仓 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getStore() { if (mStore == null) mStore = LemapContext.getSingleDefault().getSharedPreferences() .getString("Store", ""); return mStore; } /** * 设置用户所属店仓 * * @param 用户所属店仓 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setStore(String Store) { mStore = Store; Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("Store", mStore); editor.commit(); } /** * 返回授权码 * * @return 目前只有日期 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getAuthorizeCode() { return LemapContext.getSingleDefault().getSharedPreferences() .getString("AuthorizeCode", ""); } /** * 设置授权码,目前只有日期 * * @param 设置授权码 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setAuthorizeCode(String authorizeCode) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("AuthorizeCode", authorizeCode); editor.commit(); } /** * 获取USB文件路径 * * @return */ public static String getUSBFilePath() { return LemapContext.getSingleDefault().getSharedPreferences() .getString("filepathsetting", "/sdcard/仓储数据/"); } /** * 设置USB文件路径 * * @return */ public static void setUSBFilePath(String filePath) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("filepathsetting", filePath); editor.commit(); } /** * 获取ftp ip * * @return */ public static String getFtpIp() { return LemapContext.getSingleDefault().getSharedPreferences().getString("ftpipsetting", ""); } /** * 获取ftp userName * * @return */ public static String getFtpUserName() { return LemapContext.getSingleDefault().getSharedPreferences().getString("ftpusernamesetting", ""); } /** * 获取ftp password * * @return */ public static String getFtpPassWord() { return LemapContext.getSingleDefault().getSharedPreferences().getString("ftppasswordsetting", ""); } /** * 设置 ftp Ip * * @param ftpIp */ public static void setFtpIp(String ftpIp) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("ftpipsetting", ftpIp); editor.commit(); } /** * 设置ftp userName * * @param ftpUserName */ public static void setFtpUserName(String ftpUserName) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("ftpusernamesetting", ftpUserName); editor.commit(); } /** * 设置ftp password * * @param ftpPassword */ public static void setFtpPassword(String ftpPassword) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("ftppasswordsetting", ftpPassword); editor.commit(); } /** * 获取扫描是否验证商品资料 * * @return */ public static boolean getProductIsCheckExists() { return true; /* return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("cb_parsetting_check_ischecked", false);*/ } /** * 设置扫描是否验证商品资料是否存在 * * @param isCheck */ public static void setProductIsCheckExists(Boolean isCheck) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("cb_parsetting_check_ischecked", isCheck); editor.commit(); } /** * 店铺编号是否显示 * * @return */ public static boolean getShopCodeIsShow() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("cb_parsetting_shopcode", false); } /** * 设置店铺编号是否显示 * * @param isShow */ public static void setShopCodeIsShow(boolean isShow) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("cb_parsetting_shopcode", isShow); editor.commit(); } /** * 获取是否显示店位 * * @return */ public static boolean getShopNameTxtIsShow() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("cb_parsetting_shopnum_ischecked", false); } /** * 设置店位是否显示 * * @param isShow */ public static void setShopNameTxtIsShow(Boolean isShow) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("cb_parsetting_shopnum_ischecked", isShow); editor.commit(); } /** * 获取是否显示仓位 * * @return */ public static boolean getPositionCodeIsShow() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("cb_parsetting_storead_ischecked", false); } /** * 设置是否显示仓位 * * @param isShow */ public static void setPositionCodeIsShow(boolean isShow) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("cb_parsetting_storead_ischecked", isShow); editor.commit(); } /** * 获取是否显示数量 * * @return */ public static boolean getNumIsShow() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("cb_parsetting_number", false); } /** * 设置是否显示数量 * * @param isShow */ public static void setNumIsShow(boolean isShow) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("cb_parsetting_number", isShow); editor.commit(); } /** * 获取是否显示库存 * * @return */ public static boolean getStockNumIsShow() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("cb_parsetting_stocknum_ischecked", false); } /** * 设置是否显示库存 * * @param isShow */ public static void setStockNumIsShow(boolean isShow) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("cb_parsetting_stocknum_ischecked", isShow); editor.commit(); } /** * 获取是否启用复盘 * * @return */ public static boolean getIsAgainScan() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("cb_parsetting_reinventory", false); } /** * 设置是否启用复盘 * * @param isAgain */ public static void setIsAgainScan(boolean isAgain) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("cb_parsetting_reinventory", isAgain); editor.commit(); } /** * 获取是否启用重码扫描 * * @return */ public static boolean getIsRecode() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("cb_barsetting_recode_ischecked", false); } /** * 设置是否启用重码扫描 * * @param isrecode */ public static void setIsRecode(boolean isrecode) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("cb_barsetting_recode_ischecked", isrecode); editor.commit(); } /** * 获取店位文本 * * @return */ public static String getShopCodeTxt() { return LemapContext.getSingleDefault().getSharedPreferences().getString("shopnum", "仓库"); } /** * 设置店位文本 * * @param shopnumtxt */ public static void setShopCodeTxt(String shopnumtxt) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("shopnum", shopnumtxt); editor.commit(); } /** * 获取仓位文本 * * @return */ public static String getPositionCodeTxt() { return LemapContext.getSingleDefault().getSharedPreferences().getString("storead", "库位"); } /** * 设置仓位文本 * * @param positionCodeTxt */ public static void setPositionCodeTxt(String positionCodeTxt) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("storead", positionCodeTxt); editor.commit(); } /** * 获取显示行数 * * @return */ public static String getShowRowCount() { return LemapContext.getSingleDefault().getSharedPreferences().getString("linenum", ""); } /** * 设置显示行数 * * @param rowCount */ public static void setShowRowCount(String rowCount) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("linenum", rowCount); editor.commit(); } /** * 获取条码最小长度 * * @return */ public static String getMinLength() { return LemapContext.getSingleDefault().getSharedPreferences().getString("minlength", ""); } /** * 设置条码最小长度 * * @param minLength */ public static void setMinLength(String minLength) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("minlength", minLength); editor.commit(); } /** * 获取条码最大长度 * * @return */ public static String getMaxLength() { return LemapContext.getSingleDefault().getSharedPreferences().getString("maxlength", ""); } /** * 设置条码最大长度 * * @param minLength */ public static void setMaxLength(String maxLength) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("maxlength", maxLength); editor.commit(); } /** * 获取条码不包含字符 * * @return */ public static String getUninClude() { return LemapContext.getSingleDefault().getSharedPreferences().getString("uninclude", ""); } /** * 设置条码不包含字符 * * @param minLength */ public static void setUninClude(String uninclude) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("uninclude", uninclude); editor.commit(); } /** * 获取条码截取流水号位数 * * @return */ public static String getRemove() { return LemapContext.getSingleDefault().getSharedPreferences().getString("remove", ""); } /** * 设置条码截取流水号位数 * * @param minLength */ public static void setRemove(String len) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("remove", len); editor.commit(); } /** * 获取数量重复累加 * * @return */ public static boolean getRecodeYes() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("rb_barsetting_scan_yes_ischecked", true); } /** * 设置数量重复累加 * * @param isYes */ public static void setRecodeYes(boolean isYes) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("rb_barsetting_scan_yes_ischecked", isYes); editor.commit(); } /** * 获取行数累加 * * @return */ public static boolean getRecodeNo() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("rb_barsetting_scan_no_ischecked", false); } /** * 设置行数累加 * * @param isNo */ public static void setRecodeNo(boolean isNo) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("rb_barsetting_scan_no_ischecked", isNo); editor.commit(); } /** * 获取条码截取开始位置 * * @return */ public static String getCutBegin() { return LemapContext.getSingleDefault().getSharedPreferences().getString("et_barsetting_interception_begin", ""); } /** * 设置条码截取开始位置 * * @param beginIndex */ public static void setCutBegin(String beginIndex) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("et_barsetting_interception_begin", beginIndex); editor.commit(); } /** * 获取条码截取长度 * * @return */ public static String getCutLength() { return LemapContext.getSingleDefault().getSharedPreferences().getString("et_barsetting_interception_length", ""); } /** * 设置条码截取长度 * * @param len */ public static void setCutLength(String len) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("et_barsetting_interception_length", len); editor.commit(); } /** * 获取操作文件类型 * * @return */ public static String getOperatorFileType() { return LemapContext.getSingleDefault().getSharedPreferences().getString("operator_file_type", ""); } /** * 设置操作文件类型 * * @param fileType */ public static void setOperatorFileType(String fileType) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("operator_file_type", fileType); editor.commit(); } /** * 获取是否显示仓位 * * @return */ public static boolean getPositionNameTxtIsShow() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("cb_parsetting_storead_ischecked", false); } /** * 设置是否显示仓位 * * @param isShow */ public static void setPositionNameTxtIsShow(boolean isShow) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("cb_parsetting_storead_ischecked", isShow); editor.commit(); } /** * 获取是否打印出库单 * * @return */ public static boolean getPrintOutstoreEnable() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("IsPrintOutstoreEnable", false); } /** * 设置是否打印出库单 * * @param isShow */ public static void setPrintOutstoreEnable(boolean isShow) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("IsPrintOutstoreEnable", isShow); editor.commit(); } /** * 获取是否打印出库装箱单 * * @return */ public static boolean getPrintOutstoreBoxEnable() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("IsPrintOutstoreBoxEnable", false); } /** * 设置是否打印出库装箱单 * * @param isShow */ public static void setPrintOutstoreBoxEnable(boolean isShow) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("IsPrintOutstoreBoxEnable", isShow); editor.commit(); } /** * 获取是否打印入库单 * * @return */ public static boolean getPrintInstoreEnable() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("IsPrintInstoreEnable", false); } /** * 设置是否打印入库单 * * @param isShow */ public static void setPrintInstoreEnable(boolean isShow) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("IsPrintInstoreEnable", isShow); editor.commit(); } /** * 返回是否开机启动 * * @return 是否开机启动 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static Boolean getAutoStartup() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("IsAutoStartup", true); } /** * 设置是否开机启动 * * @param 是否开机启动 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setAutoStartup(Boolean autoStartup) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("IsAutoStartup", autoStartup); editor.commit(); } /** * 返回是否开启装箱货品控制 */ public static Boolean getBoxGoodsLimitEnable() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("IsBoxGoodsLimitEnable", false); } /** * 设置是否开启装箱货品控制 */ public static void setBoxGoodsLimitEnable(Boolean enable) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("IsBoxGoodsLimitEnable", enable); editor.commit(); } /** * 返回是否开启装箱差异控制 */ public static Boolean getBoxDiffLimitEnable() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("IsBoxDiffLimitEnable", false); } /** * 设置是否开启装箱差异控制 */ public static void setBoxDiffLimitEnable(Boolean enable) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("IsBoxDiffLimitEnable", enable); editor.commit(); } /** * 返回是否开启销售出库 * * @return */ public static boolean getSaleOutEnabled() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("SaleOutEnabled", true); } /** * 设置是否开启销售出库 * * @param */ public static void setSaleOutEnabled(boolean bEnabled) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("SaleOutEnabled", bEnabled); editor.commit(); } /** * 返回销售出库名称 * * @return */ public static String getSaleOutName() { return LemapContext.getSingleDefault().getSharedPreferences().getString("SaleOutName", "渠道调拨出库");//销售出库 } /** * 设置销售出库名称 * * @param */ public static void setSaleOutName(String sName) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("SaleOutName", sName); editor.commit(); } /** * 返回是否开启调拨出库 * * @return */ public static boolean getDiaoBoOutEnabled() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("DiaoBoOutEnabled", true); } /** * 设置是否开启调拨出库 * * @param */ public static void setDiaoBoOutEnabled(boolean bEnabled) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("DiaoBoOutEnabled", bEnabled); editor.commit(); } /** * 返回调拨出库名称 * * @return */ public static String getDiaoBoOutName() { return LemapContext.getSingleDefault().getSharedPreferences().getString("DiaoBoOutName", "商店配货出库");//调拨出库 } /** * 设置调拨出库名称 * * @param */ public static void setDiaoBoOutName(String sName) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("DiaoBoOutName", sName); editor.commit(); } /** * 返回是否开启采购退货出库 * * @return */ public static boolean getPurchaseBackOutEnabled() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("PurchaseBackOutEnabled", true); } /** * 设置是否开启采购退货出库 * * @param */ public static void setPurchaseBackOutEnabled(boolean bEnabled) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("PurchaseBackOutEnabled", bEnabled); editor.commit(); } /** * 返回采购退货出库名称 * * @return */ public static String getPurchaseBackOutName() { return LemapContext.getSingleDefault().getSharedPreferences().getString("PurchaseBackOutName", "商品退货出库");//采购退货出库 } /** * 设置采购退货出库名称 * * @param */ public static void setPurchaseBackOutName(String sName) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("PurchaseBackOutName", sName); editor.commit(); } /** * 返回是否开启采购入库 * * @return */ public static boolean getPurchaseInEnabled() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("PurchaseInEnabled", true); } /** * 设置是否开启采购入库 * * @param */ public static void setPurchaseInEnabled(boolean bEnabled) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("PurchaseInEnabled", bEnabled); editor.commit(); } /** * 返回采购入库名称 * * @return */ public static String getPurchaseInName() { return LemapContext.getSingleDefault().getSharedPreferences().getString("PurchaseInName", "采购进货入库");//采购入库 } /** * 设置采购入库名称 * * @param */ public static void setPurchaseInName(String sName) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("PurchaseInName", sName); editor.commit(); } /** * 返回是否开启调拨入库 * * @return */ public static boolean getDiaoBoInEnabled() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("DiaoBoInEnabled", true); } /** * 设置是否开启调拨入库 * * @param */ public static void setDiaoBoInEnabled(boolean bEnabled) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("DiaoBoInEnabled", bEnabled); editor.commit(); } /** * 返回调拨入库名称 * * @return */ public static String getDiaoBoInName() { return LemapContext.getSingleDefault().getSharedPreferences().getString("DiaoBoInName", "商店退货入库");//调拨入库 } /** * 设置调拨入库名称 * * @param */ public static void setDiaoBoInName(String sName) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("DiaoBoInName", sName); editor.commit(); } /** * 返回是否开启销售退货入库 * * @return */ public static boolean getSaleBackInEnabled() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("SaleBackInEnabled", true); } /** * 设置是否开启销售退货入库 * * @param */ public static void setSaleBackInEnabled(boolean bEnabled) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("SaleBackInEnabled", bEnabled); editor.commit(); } /** * 返回销售退货入库名称 * * @return */ public static String getSaleBackInName() { return LemapContext.getSingleDefault().getSharedPreferences().getString("SaleBackInName", "渠道退货入库");//销售退货入库 } /** * 设置销售退货入库名称 * * @param */ public static void setSaleBackInName(String sName) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("SaleBackInName", sName); editor.commit(); } /** * 获取唯一码控制 * * @return */ public static boolean getUniqueBarCodeSetting() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("uniqueBarCodeSetting", false); } /** * 设置唯一码控制 * * @param isStart */ public static void setUniqueBarCodeSetting(boolean isStart) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("uniqueBarCodeSetting", isStart); editor.commit(); } /** * 设置是否启用发货方式 * * @param isStart */ public static void setDeliveryTypeEnabled(boolean bEnabled) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("DeliveryTypeEnabled", bEnabled); editor.commit(); } /** * 获取是否启用发货方式 * * @return */ public static boolean getDeliveryTypeEnabled() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("DeliveryTypeEnabled", true); } /** * 设置是否允许供货/收货仓为空 * * @param isStart */ public static void setReceiptStorageEmptyEnabled(boolean bEnabled) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("ReceiptStorageEmptyEnabled", bEnabled); editor.commit(); } /** * 获取是否允许供货/收货仓为空 * * @return */ public static boolean getReceiptStorageEmptyEnabled() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("ReceiptStorageEmptyEnabled", true); } /** * 设置是否显示实时库存 * * @param isStart */ public static void setShowRealStockEnabled(boolean bEnabled) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("ShowRealStockEnabled", bEnabled); editor.commit(); } /** * 获取是否显示实时库存(订货,盘点) * * @return */ public static boolean getShowRealStockEnabled() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("ShowRealStockEnabled", true); } /** * 设置是否显示实时价格 * * @param isStart */ public static void setShowRealPriceEnabled(boolean bEnabled) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("ShowRealPriceEnabled", bEnabled); editor.commit(); } /** * 获取是否显示实时价格 * * @return */ public static boolean getShowRealPriceEnabled() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("ShowRealPriceEnabled", true); } /** * 设置提交订货单时是否检查库存 * * @param isStart */ public static void setPuchaseStockCheckEnabled(boolean bEnabled) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("CheckRealStockEnabled", bEnabled); editor.commit(); } /** * 获取提交订货单时是否检查库存 * * @return */ public static boolean getPuchaseStockCheckEnabled() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("CheckRealStockEnabled", true); } /** * 设置是否显示货品缩略图(订货) * * @param isStart */ public static void setShowRealImageEnabled(boolean bEnabled) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("ShowRealImageEnabled", bEnabled); editor.commit(); } /** * 获取设置是否显示货品缩略图(订货) * * @return */ public static boolean getShowRealImageEnabled() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("ShowRealImageEnabled", false); } /** * 设置登录后是否提示修改密码 * * @param 登录后是否提示修改密码 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setPwdModifyAlert(Boolean bEnabled) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("IsPwdModifyAlert", bEnabled); editor.commit(); } /** * 返回登录后是否提示修改密码 * * @return 登录后是否提示修改密码 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static Boolean getPwdModifyAlert() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("IsPwdModifyAlert", true); } /** * 设置是否需要更新代理商 * * @param */ public static void setNeedUpdateAgent(boolean bEnabled) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("NeedUpdateAgent", bEnabled); editor.commit(); } /** * 获取是否需要更新代理商 * * @return */ public static boolean getNeedUpdateAgent() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("NeedUpdateAgent", false); } /** * 设置弹出窗口的宽度 * * @param value */ public static void setDialogWidth(int value) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putInt("DialogWidth", value); editor.commit(); } /** * 获取弹出窗口的宽度 * * @return */ public static int getDialogWidth() { return LemapContext.getSingleDefault().getSharedPreferences().getInt("DialogWidth", 0); } /** * 临时存放仓库变量 * * @param value */ public static void setTempStorageCode(String value) { mTempStorageCode = value; } /** * 临时存放仓库变量 * * @return */ public static String getTempStorageCode() { return mTempStorageCode; } /** * 设置是否允许继续扫描当取不到实时价格时(订货) * * @param isStart */ public static void setNoPriceScanEnabled(boolean bEnabled) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("NoPriceScanEnabled", bEnabled); editor.commit(); } /** * 获取设置是否允许继续扫描当取不到实时价格时(订货) * * @return */ public static boolean getNoPriceScanEnabled() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("NoPriceScanEnabled", false); } /** * 设置是否允许无色无码的条码 * * @param isStart */ public static void setBarCodeNoColorNoSizeEnabled(boolean bEnabled) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("BarCodeNoColorNoSizeEnabled", bEnabled); editor.commit(); } /** * 获取设置是否允许无色无码的条码 * * @return */ public static boolean getBarCodeNoColorNoSizeEnabled() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("BarCodeNoColorNoSizeEnabled", false); } /** * 设置当出库中一款未完成扫描时是否提示 * * @param bEnabled */ public static void setNotSameGoodAlertEnabled(boolean bEnabled) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("NotSameGoodAlertEnabled", bEnabled); editor.commit(); } /** * 获取设置当出库中一款未完成扫描时是否提示 * * @return */ public static boolean getNotSameGoodAlertEnabled() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("NotSameGoodAlertEnabled", false); } /** * 设置扫描界面显示行数 * * @param isStart */ public static void setPageSize(int intPageSize) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putInt("PageSize", intPageSize); editor.commit(); } /** * 获取设置扫描界面显示行数setUniqueCodeCutLength * * @return */ public static int getPageSize() { return LemapContext.getSingleDefault().getSharedPreferences().getInt("PageSize", 20); } /** * 设置唯一码流水位截取长度 * * @param isStart */ public static void setUniqueCodeCutLength(int ivalue) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putInt("UniqueCodeCutLength", ivalue); editor.commit(); } /** * 获取唯一码流水位截取长度 * * @return */ public static int getUniqueCodeCutLength() { return LemapContext.getSingleDefault().getSharedPreferences().getInt("UniqueCodeCutLength", 0); } /** * 设置条码长度 * 是判断能否启用唯一码的重要标识 * * @param value */ public static void setMaxBarCodeLength(int value) { mMaxBarCodeLength = value; Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putInt("MaxBarCodeLength", value); editor.commit(); } /** * 获取条码长度 * 是判断能否启用唯一码的重要标识 * * @return */ public static int getMaxBarCodeLength() { if (mMaxBarCodeLength == -1) { mMaxBarCodeLength = LemapContext.getSingleDefault().getSharedPreferences().getInt("MaxBarCodeLength", 0); } return mMaxBarCodeLength; } /** * 设置截取条码长度 * 是判断能否启用唯一码的重要标识 * * @param value */ public static void setMaxBarCodeCutLength(int value) { mMaxBarCodeCutLength = value; Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putInt("MaxBarCodeCutLength", value); editor.commit(); } /** * 获取截取条码长度 * 是判断能否启用唯一码的重要标识 * * @return */ public static int getMaxBarCodeCutLength() { if (mMaxBarCodeCutLength == -1) { mMaxBarCodeCutLength = LemapContext.getSingleDefault().getSharedPreferences().getInt("MaxBarCodeCutLength", 0); } return mMaxBarCodeCutLength; } /** * 设置是否已经初始化删除的条码 * * @param bValue */ public static void setIsInitDeleteBarCode(boolean bValue) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("IsInitDeleteBarCode", bValue); editor.commit(); } /** * 获取是否已经初始化删除的条码 * * @return */ public static boolean getIsInitDeleteBarCode() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("IsInitDeleteBarCode", false); } /** * 设置是否在线获取条码 * * @param bValue */ public static void setBarCodeOnlineEnabled(boolean bValue) { mGetBarCodeOnline = bValue ? 1 : 0; Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putInt("IsBarCodeOnlineEnabled", mGetBarCodeOnline); editor.commit(); } /** * 获取是否只截取不校验唯一码重复 * * @return */ public static boolean getUniqueCodeNotCheckRepeatEnabled() { if (mUniqueCodeNotCheckRepeat == -1) { mUniqueCodeNotCheckRepeat = LemapContext.getSingleDefault().getSharedPreferences().getInt("UniqueCodeNotCheckRepeat", 1); } return mUniqueCodeNotCheckRepeat == 1; } /** * 设置是否只截取不校验唯一码重复 * * @param bValue */ public static void setUniqueCodeNotCheckRepeatEnabled(boolean bValue) { mUniqueCodeNotCheckRepeat = bValue ? 1 : 0; Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putInt("UniqueCodeNotCheckRepeat", mUniqueCodeNotCheckRepeat); editor.commit(); } /** * 获取是否在线获取条码 * * @return */ public static boolean getBarCodeOnlineEnabled() { if (mGetBarCodeOnline == -1) { mGetBarCodeOnline = LemapContext.getSingleDefault().getSharedPreferences().getInt("IsBarCodeOnlineEnabled", 1); } return mGetBarCodeOnline == 1; } /** * 设置是否在线获取条码 * * @param bValue */ public static void setBarCodeMode(BarCodeMode barCodeMode) { mBarCodeMode = barCodeMode; Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putInt("BarCodeMode", mBarCodeMode.value); editor.commit(); } /** * 获取条码类型 * * @return */ public static BarCodeMode getBarCodeMode() { if (mBarCodeMode == null) { int result = LemapContext.getSingleDefault().getSharedPreferences().getInt("BarCodeMode", BarCodeMode.ALL.value); mBarCodeMode = EnumConvert.ordinalOf(BarCodeMode.class, result, BarCodeMode.ALL); } return mBarCodeMode; } /** * 设置库存显示方式 * * @param bValue */ public static void setStockStyle(String style) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("StockStyle", style); editor.commit(); } /** * 获取库存显示方式 * * @return */ public static String getStockStyle() { return LemapContext.getSingleDefault().getSharedPreferences().getString("StockStyle", "HAND"); } /** * 设置通行证 * * @param bValue */ public static void setAccessToken(String sValue) { mAccessToken = sValue; Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("AccessToken", sValue); editor.commit(); } /** * 获取通行证 * * @return */ public static String getAccessToken() { if (mAccessToken == null) { mAccessToken = LemapContext.getSingleDefault().getSharedPreferences().getString("AccessToken", ""); } return mAccessToken; } /** * 设置所属机构 * * @param bValue */ public static void setOrgCode(String sValue) { mOrgCode = sValue; Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("OrgCode", sValue); editor.commit(); } /** * 获取所属机构 * * @return */ public static String getOrgCode() { if (mOrgCode == null) { mOrgCode = LemapContext.getSingleDefault().getSharedPreferences().getString("OrgCode", ""); } return mOrgCode; } /** * 获取巡检复检图片地址 * @return */ public static String getImgURL() { String imgURL = "http://112.74.77.202:8070/GetImages.ashx?w=40&h=40&id="; return imgURL; } }
UTF-8
Java
87,010
java
AppConfig.java
Java
[ { "context": "/**\n * 版权所有 (C) Lemap 2012\n *\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:50:15\n */\npackage ", "end": 44, "score": 0.9998245239257812, "start": 41, "tag": "NAME", "value": "廖安良" }, { "context": "tils.StringValidator;\n\n/**\n * 应用配置项\n *\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:50:15\n */\n@Suppres", "end": 582, "score": 0.9998346567153931, "start": 579, "tag": "NAME", "value": "廖安良" }, { "context": "tic String mUserPhone;\n private static String mUserName;\n private static String mUserPassword;\n pri", "end": 1026, "score": 0.883352518081665, "start": 1018, "tag": "USERNAME", "value": "UserName" }, { "context": "te static final String mLemapServiceUrl = \"http://122.13.0.67:8898\";\n public static final String mAuthorizeB", "end": 1598, "score": 0.9997562766075134, "start": 1587, "tag": "IP_ADDRESS", "value": "122.13.0.67" }, { "context": "nName 方法名\n * @return BPIString\n * @author 廖安良\n * @version 创建时间:2013-1-22 下午2:54:08\n */\n", "end": 5319, "score": 0.9997823238372803, "start": 5316, "tag": "NAME", "value": "廖安良" }, { "context": " }\n\n /**\n * 获取同步周期\n *\n * @author 廖安良\n * @version 创建时间:2013-1-24 下午5:23:53\n */\n", "end": 6241, "score": 0.9994262456893921, "start": 6238, "tag": "NAME", "value": "廖安良" }, { "context": " }\n\n /**\n * 设置同步周期\n *\n * @author 廖安良\n * @version 创建时间:2013-1-24 下午5:23:53\n */\n", "end": 6519, "score": 0.9993201494216919, "start": 6516, "tag": "NAME", "value": "廖安良" }, { "context": " * 获取访问云端Url\n *\n * @return\n * @author 廖安良\n * @version 创建时间:2013-1-23 下午4:16:22\n */\n", "end": 6875, "score": 0.9996265172958374, "start": 6872, "tag": "NAME", "value": "廖安良" }, { "context": " * 获取云端IP和端口\n *\n * @return\n * @author 廖安良\n * @version 创建时间:2013-1-23 下午4:16:22\n */\n", "end": 7116, "score": 0.9996154308319092, "start": 7113, "tag": "NAME", "value": "廖安良" }, { "context": " * @param cloudIPAndPort 云端IP和端口\n * @author 廖安良\n * @version 创建时间:2013-1-23 下午4:16:42\n */\n", "end": 7715, "score": 0.9989742040634155, "start": 7712, "tag": "NAME", "value": "廖安良" }, { "context": " * @param cloudIPAndPort 云端IP和端口\n * @author 廖安良\n * @version 创建时间:2013-1-23 下午4:16:42\n */\n", "end": 8116, "score": 0.998740017414093, "start": 8113, "tag": "NAME", "value": "廖安良" }, { "context": "nName 方法名\n * @return BPIString\n * @author 廖安良\n * @version 创建时间:2013-1-22 下午2:54:08\n */\n", "end": 8571, "score": 0.9989302158355713, "start": 8568, "tag": "NAME", "value": "廖安良" }, { "context": "号(用于关联)\n *\n * @return 用户编号\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 8848, "score": 0.9928486347198486, "start": 8845, "tag": "NAME", "value": "廖安良" }, { "context": "* 设置用户编号\n *\n * @param 用户编号\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 9196, "score": 0.9974943399429321, "start": 9193, "tag": "NAME", "value": "廖安良" }, { "context": "回客服联系人\n *\n * @return 客服联系人\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 9583, "score": 0.9996984004974365, "start": 9580, "tag": "NAME", "value": "廖安良" }, { "context": "设置客服联系人\n *\n * @param 客服联系人\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 9847, "score": 0.9997304677963257, "start": 9844, "tag": "NAME", "value": "廖安良" }, { "context": "服联系电话\n *\n * @return 客服联系电话\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 10201, "score": 0.9996606111526489, "start": 10198, "tag": "NAME", "value": "廖安良" }, { "context": "客服联系电话\n *\n * @param 客服联系电话\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 10482, "score": 0.9997364282608032, "start": 10479, "tag": "NAME", "value": "廖安良" }, { "context": " * 返回收银台\n *\n * @return 收银台\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 10842, "score": 0.9995676279067993, "start": 10839, "tag": "NAME", "value": "廖安良" }, { "context": " * 设置收银台\n *\n * @param 收银台\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 11230, "score": 0.999218761920929, "start": 11227, "tag": "NAME", "value": "廖安良" }, { "context": " 返回默认库位\n *\n * @return 默认库位\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 11580, "score": 0.9993844032287598, "start": 11577, "tag": "NAME", "value": "廖安良" }, { "context": "* 设置默认库位\n *\n * @param 默认库位\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 11995, "score": 0.9994527101516724, "start": 11992, "tag": "NAME", "value": "廖安良" }, { "context": "铺默认库位\n *\n * @return 店铺默认库位\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 12381, "score": 0.9982886910438538, "start": 12378, "tag": "NAME", "value": "廖安良" }, { "context": "店铺默认库位\n *\n * @param 店铺默认库位\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 12794, "score": 0.999458909034729, "start": 12791, "tag": "NAME", "value": "廖安良" }, { "context": "铺默认仓库\n *\n * @return 店铺默认仓库\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 13174, "score": 0.999491274356842, "start": 13171, "tag": "NAME", "value": "廖安良" }, { "context": "店铺默认仓库\n *\n * @param 店铺默认仓库\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 13585, "score": 0.9991660714149475, "start": 13582, "tag": "NAME", "value": "廖安良" }, { "context": "回默认仓库\n *\n * @return 订单默认仓库\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 13961, "score": 0.9995259642601013, "start": 13958, "tag": "NAME", "value": "廖安良" }, { "context": "设置默认仓库\n *\n * @param 订单默认仓库\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 14370, "score": 0.999553382396698, "start": 14367, "tag": "NAME", "value": "廖安良" }, { "context": "回默认仓库\n *\n * @return 订单默认仓库\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 14746, "score": 0.9911948442459106, "start": 14743, "tag": "NAME", "value": "廖安良" }, { "context": "订单默认仓库\n *\n * @param 订单默认仓库\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 15173, "score": 0.993548572063446, "start": 15170, "tag": "NAME", "value": "廖安良" }, { "context": "单默认库位\n *\n * @return 订单默认库位\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 15567, "score": 0.993667483329773, "start": 15564, "tag": "NAME", "value": "廖安良" }, { "context": "订单默认库位\n *\n * @param 订单默认库位\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 16010, "score": 0.9881248474121094, "start": 16007, "tag": "NAME", "value": "廖安良" }, { "context": " 返回用户手机\n *\n * @return 用户手机\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 16417, "score": 0.993746280670166, "start": 16414, "tag": "NAME", "value": "廖安良" }, { "context": "* 设置用户手机\n *\n * @param 用户手机\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 16770, "score": 0.9991773962974548, "start": 16767, "tag": "NAME", "value": "廖安良" }, { "context": " 返回店铺编号\n *\n * @return 店铺编号\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 17161, "score": 0.9977219700813293, "start": 17158, "tag": "NAME", "value": "廖安良" }, { "context": " *\n * @param shopCode 店铺编号\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 17448, "score": 0.9985038042068481, "start": 17445, "tag": "NAME", "value": "廖安良" }, { "context": " 返回店铺名称\n *\n * @return 店铺名称\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 17802, "score": 0.9955288171768188, "start": 17799, "tag": "NAME", "value": "廖安良" }, { "context": " *\n * @param shopName 店铺编号\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 18089, "score": 0.9980677366256714, "start": 18086, "tag": "NAME", "value": "廖安良" }, { "context": "铺价格字段\n *\n * @return 店铺价格字段\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 18448, "score": 0.9993482828140259, "start": 18445, "tag": "NAME", "value": "廖安良" }, { "context": " *\n * @param shopName 店铺价格字段\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 18801, "score": 0.9992575645446777, "start": 18798, "tag": "NAME", "value": "廖安良" }, { "context": " 返回用户姓名\n *\n * @return 用户姓名\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 19177, "score": 0.9995595812797546, "start": 19174, "tag": "NAME", "value": "廖安良" }, { "context": "* 设置用户姓名\n *\n * @param 用户姓名\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 19525, "score": 0.9995015859603882, "start": 19522, "tag": "NAME", "value": "廖安良" }, { "context": " 返回用户密码\n *\n * @return 用户密码\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:29\n */\n", "end": 19910, "score": 0.9965155124664307, "start": 19907, "tag": "NAME", "value": "廖安良" }, { "context": "* 设置用户密码\n *\n * @param 用户密码\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:29\n */\n", "end": 20278, "score": 0.981267511844635, "start": 20275, "tag": "NAME", "value": "廖安良" }, { "context": "ord(String userPassword) {\n mUserPassword = userPassword;\n Editor editor = LemapContext.get", "end": 20418, "score": 0.6634373068809509, "start": 20414, "tag": "PASSWORD", "value": "user" }, { "context": " 返回用户角色\n *\n * @return 用户角色\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:29\n */\n", "end": 20687, "score": 0.9740034937858582, "start": 20684, "tag": "NAME", "value": "廖安良" }, { "context": "* 设置用户角色\n *\n * @param 用户角色\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:29\n */\n", "end": 20875, "score": 0.9732744097709656, "start": 20872, "tag": "NAME", "value": "廖安良" }, { "context": " 返回设备编号\n *\n * @return 设备编号\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:29\n */\n", "end": 21081, "score": 0.9892476797103882, "start": 21078, "tag": "NAME", "value": "廖安良" }, { "context": "* 设置设备编号\n *\n * @param 企业信息\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:29\n */\n", "end": 21285, "score": 0.9816167950630188, "start": 21282, "tag": "NAME", "value": "廖安良" }, { "context": "否记住密码\n *\n * @return 是否记住密码\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 21513, "score": 0.9780640602111816, "start": 21510, "tag": "NAME", "value": "廖安良" }, { "context": "是否记住密码\n *\n * @param 是否记住密码\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 21813, "score": 0.9552097320556641, "start": 21810, "tag": "NAME", "value": "廖安良" }, { "context": "否自动登录\n *\n * @return 是否自动登录\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 22202, "score": 0.8424804210662842, "start": 22199, "tag": "NAME", "value": "廖安良" }, { "context": "是否自动登录\n *\n * @param 是否自动登录\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 22492, "score": 0.971331000328064, "start": 22489, "tag": "NAME", "value": "廖安良" }, { "context": "称\n *\n * @return 返回蓝牙打印机的名称\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 22863, "score": 0.985590398311615, "start": 22860, "tag": "NAME", "value": "廖安良" }, { "context": "机的名称\n *\n * @param 蓝牙打印机的名称\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 23165, "score": 0.9808622598648071, "start": 23162, "tag": "NAME", "value": "廖安良" }, { "context": "地址\n *\n * @return 返回蓝牙打印机地址\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 23517, "score": 0.9974969029426575, "start": 23514, "tag": "NAME", "value": "廖安良" }, { "context": "打印机地址\n *\n * @param 蓝牙打印机地址\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 23839, "score": 0.9958687424659729, "start": 23836, "tag": "NAME", "value": "廖安良" }, { "context": "\n *\n * @return 返回是否启用蓝牙打印机\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 24209, "score": 0.9966697692871094, "start": 24206, "tag": "NAME", "value": "廖安良" }, { "context": "打印机\n *\n * @param 是否启用蓝牙打印机\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 24517, "score": 0.9908421039581299, "start": 24514, "tag": "NAME", "value": "廖安良" }, { "context": "\n *\n * @return 返回是否启用装箱单打印\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 24900, "score": 0.9971530437469482, "start": 24897, "tag": "NAME", "value": "廖安良" }, { "context": "单打印\n *\n * @param 是否启用装箱单打印\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 25207, "score": 0.9991176724433899, "start": 25204, "tag": "NAME", "value": "廖安良" }, { "context": "格\n *\n * @return 零售小票打印机的规格\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 25589, "score": 0.9993017911911011, "start": 25586, "tag": "NAME", "value": "廖安良" }, { "context": "规格\n *\n * @param 零售小票打印机的规格\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 25919, "score": 0.9992923140525818, "start": 25916, "tag": "NAME", "value": "廖安良" }, { "context": "\n *\n * @return 零售时是否打印销售小票\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 26315, "score": 0.9993994235992432, "start": 26312, "tag": "NAME", "value": "廖安良" }, { "context": "票\n *\n * @param 零售时是否打印销售小票\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 26628, "score": 0.999568521976471, "start": 26625, "tag": "NAME", "value": "廖安良" }, { "context": "号\n *\n * @return 装箱小票打的模板编号\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 27012, "score": 0.9989078044891357, "start": 27009, "tag": "NAME", "value": "廖安良" }, { "context": "编号\n *\n * @param 装箱小票打的模板编号\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 27346, "score": 0.99570631980896, "start": 27343, "tag": "NAME", "value": "廖安良" }, { "context": " *\n * @return 触摸不弹出输入法长按弹出\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 27709, "score": 0.9976081848144531, "start": 27706, "tag": "NAME", "value": "廖安良" }, { "context": "\n *\n * @param 触摸不弹出输入法长按弹出\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 28059, "score": 0.9967219233512878, "start": 28056, "tag": "NAME", "value": "廖安良" }, { "context": "调整单启用标志\n *\n * @return 启用标志\n * @author 马时洁\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 28473, "score": 0.9996857643127441, "start": 28470, "tag": "NAME", "value": "马时洁" }, { "context": "单启用标志\n *\n * @param 设置仓库调整单\n * @author 马时洁\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 28753, "score": 0.9997234344482422, "start": 28750, "tag": "NAME", "value": "马时洁" }, { "context": "补货单启用标志\n *\n * @return 启用标志\n * @author 马时洁\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 29104, "score": 0.9997289776802063, "start": 29101, "tag": "NAME", "value": "马时洁" }, { "context": "单启用标志\n *\n * @param 设置仓库调整单\n * @author 马时洁\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 29386, "score": 0.9997754096984863, "start": 29383, "tag": "NAME", "value": "马时洁" }, { "context": "收货单启用标志\n *\n * @return 启用标志\n * @author 马时洁\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 29739, "score": 0.9997787475585938, "start": 29736, "tag": "NAME", "value": "马时洁" }, { "context": "单启用标志\n *\n * @param 设置渠道收货单\n * @author 马时洁\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 30021, "score": 0.9996516108512878, "start": 30018, "tag": "NAME", "value": "马时洁" }, { "context": "退货单启用标志\n *\n * @return 启用标志\n * @author 马时洁\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 30375, "score": 0.9996324181556702, "start": 30372, "tag": "NAME", "value": "马时洁" }, { "context": "单启用标志\n *\n * @param 设置门店退货单\n * @author 马时洁\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 30657, "score": 0.9995813369750977, "start": 30654, "tag": "NAME", "value": "马时洁" }, { "context": "小票\n *\n * @return 日结时是否打印小票\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 31015, "score": 0.9993813037872314, "start": 31012, "tag": "NAME", "value": "廖安良" }, { "context": "印小票\n *\n * @param 日结时是否打印小票\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 31336, "score": 0.999660074710846, "start": 31333, "tag": "NAME", "value": "廖安良" }, { "context": "台入口的url\n *\n * @return 用户密码\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:29\n */\n", "end": 31725, "score": 0.9356485605239868, "start": 31722, "tag": "NAME", "value": "廖安良" }, { "context": "平台入口的url\n *\n * @param 用户密码\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:29\n */\n", "end": 32037, "score": 0.9834423065185547, "start": 32034, "tag": "NAME", "value": "廖安良" }, { "context": "许折上折\n *\n * @return 是否允许折上折\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 32401, "score": 0.9869741797447205, "start": 32398, "tag": "NAME", "value": "廖安良" }, { "context": "允许折上折\n *\n * @param 是否允许折上折\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 32708, "score": 0.9853106141090393, "start": 32705, "tag": "NAME", "value": "廖安良" }, { "context": "工折扣\n *\n * @return 是否允许手工折扣\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 33106, "score": 0.9876158833503723, "start": 33103, "tag": "NAME", "value": "廖安良" }, { "context": "手工折扣\n *\n * @param 是否允许手工折扣\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 33423, "score": 0.996560275554657, "start": 33420, "tag": "NAME", "value": "廖安良" }, { "context": "回默认营业员\n *\n * @return 默认营业员\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 33831, "score": 0.9979000091552734, "start": 33828, "tag": "NAME", "value": "廖安良" }, { "context": "设置默认营业员\n *\n * @param 默认营业员\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 34151, "score": 0.998624861240387, "start": 34148, "tag": "NAME", "value": "廖安良" }, { "context": "行金额精度\n *\n * @return 每行金额精度\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 34523, "score": 0.9928261041641235, "start": 34520, "tag": "NAME", "value": "廖安良" }, { "context": "每行金额精度\n *\n * @param 每行金额精度\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 34854, "score": 0.998293399810791, "start": 34851, "tag": "NAME", "value": "廖安良" }, { "context": "式\n *\n * @return 每行金额精度计算方式\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 35256, "score": 0.9997254610061646, "start": 35253, "tag": "NAME", "value": "廖安良" }, { "context": "方式\n *\n * @param 每行金额精度计算方式\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 35602, "score": 0.9996885061264038, "start": 35599, "tag": "NAME", "value": "廖安良" }, { "context": "回总金额精度\n *\n * @return 总金额精度\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 36010, "score": 0.9997186064720154, "start": 36007, "tag": "NAME", "value": "廖安良" }, { "context": "设置总金额精度\n *\n * @param 总金额精度\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 36333, "score": 0.9995388388633728, "start": 36330, "tag": "NAME", "value": "廖安良" }, { "context": "方式\n *\n * @return 总金额精度计算方式\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 36721, "score": 0.997139036655426, "start": 36718, "tag": "NAME", "value": "廖安良" }, { "context": "算方式\n *\n * @param 总金额精度计算方式\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 37059, "score": 0.8267383575439453, "start": 37056, "tag": "NAME", "value": "廖安良" }, { "context": " *\n * @return 是否开启收货差异发送短信功能\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 37473, "score": 0.9411990642547607, "start": 37470, "tag": "NAME", "value": "廖安良" }, { "context": " *\n * @param 是否开启收货差异发送短信功能\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 37788, "score": 0.9975268244743347, "start": 37785, "tag": "NAME", "value": "廖安良" }, { "context": "\n *\n * @return 接收差异短信的手机号码\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 38182, "score": 0.9976008534431458, "start": 38179, "tag": "NAME", "value": "廖安良" }, { "context": "码\n *\n * @param 接收差异短信的手机号码\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 38476, "score": 0.9994210004806519, "start": 38473, "tag": "NAME", "value": "廖安良" }, { "context": "* 设置设备编号\n *\n * @param 企业信息\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:29\n */\n", "end": 38833, "score": 0.9971397519111633, "start": 38830, "tag": "NAME", "value": "廖安良" }, { "context": "属代理商\n *\n * @return 用户所属代理商\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 39232, "score": 0.9995368719100952, "start": 39229, "tag": "NAME", "value": "廖安良" }, { "context": "所属代理商\n *\n * @param 用户所属代理商\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 39571, "score": 0.9991541504859924, "start": 39568, "tag": "NAME", "value": "廖安良" }, { "context": "户所属店仓\n *\n * @return 用户所属店仓\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 39943, "score": 0.9990788698196411, "start": 39940, "tag": "NAME", "value": "廖安良" }, { "context": "用户所属店仓\n *\n * @param 用户所属店仓\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 40280, "score": 0.9996817111968994, "start": 40277, "tag": "NAME", "value": "廖安良" }, { "context": "返回授权码\n *\n * @return 目前只有日期\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 40648, "score": 0.9997122287750244, "start": 40645, "tag": "NAME", "value": "廖安良" }, { "context": ",目前只有日期\n *\n * @param 设置授权码\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 40943, "score": 0.9997053742408752, "start": 40940, "tag": "NAME", "value": "廖安良" }, { "context": " /**\n * 设置ftp userName\n *\n * @param ftpUserName\n */\n public static void setFtpUserName(Str", "end": 42784, "score": 0.7977471947669983, "start": 42773, "tag": "USERNAME", "value": "ftpUserName" }, { "context": "否开机启动\n *\n * @return 是否开机启动\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 56337, "score": 0.9998495578765869, "start": 56334, "tag": "NAME", "value": "廖安良" }, { "context": "是否开机启动\n *\n * @param 是否开机启动\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 56631, "score": 0.9998514652252197, "start": 56628, "tag": "NAME", "value": "廖安良" }, { "context": "码\n *\n * @param 登录后是否提示修改密码\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 68011, "score": 0.9966340065002441, "start": 68008, "tag": "NAME", "value": "廖安良" }, { "context": "\n *\n * @return 登录后是否提示修改密码\n * @author 廖安良\n * @version 创建时间:2013-1-16 上午9:51:22\n */\n", "end": 68395, "score": 0.997835099697113, "start": 68392, "tag": "NAME", "value": "廖安良" }, { "context": "ing getImgURL() {\n String imgURL = \"http://112.74.77.202:8070/GetImages.ashx?w=40&h=40&id=\";\n retur", "end": 78510, "score": 0.9993664026260376, "start": 78497, "tag": "IP_ADDRESS", "value": "112.74.77.202" } ]
null
[]
/** * 版权所有 (C) Lemap 2012 * * @author 廖安良 * @version 创建时间:2013-1-16 上午9:50:15 */ package com.lemap.lxasset.data; import java.net.MalformedURLException; import java.net.URL; import android.annotation.SuppressLint; import android.content.SharedPreferences.Editor; import com.lemap.authorize.AuthorizeType; import com.lemap.authorize.AuthorizeUtils; import com.lemap.cloudPerform.CAO; import com.lemap.core.AppParamContext; import com.lemap.core.LemapContext; import com.lemap.core.utils.EnumConvert; import com.lemap.core.utils.StringValidator; /** * 应用配置项 * * @author 廖安良 * @version 创建时间:2013-1-16 上午9:50:15 */ @SuppressLint("SdCardPath") public abstract class AppConfig { private static String mAccessToken; private static BarCodeMode mBarCodeMode; private static String mEnterpriseCode; private static int mUniqueCodeNotCheckRepeat = -1; private static int mGetBarCodeOnline = -1; private static String mUserCode; private static String mUserPhone; private static String mUserName; private static String mUserPassword; private static Role mUserRole; private static String mClientShortCode; private static String mTempStorageCode; @SuppressWarnings("unused") private static String mClientCode; private static int mMaxBarCodeLength = -1; private static int mMaxBarCodeCutLength = -1; private static String mOrgCode; private static String mCurrentVersion; private static final String BPIString = "MPos.Business.dll::MPos.Business.%s.%s()"; private static final String mLemapServiceUrl = "http://172.16.17.32:8898"; public static final String mAuthorizeBPIString = "MPos.Business.dll::MPos.Business.%s.%s()"; public static final String mAuthorizeServiceUrl = "authorize.kuaidingtong.com:8088"; private static String mUpgradeServiceUrl;//= "upgrade.kuaidingtong.com:8089"; //图片缓存路径 public static final String mImagesCachePath = "Caches/Goods/"; // 当无码时,默认的尺码编号 public static String getDefaultSizeCode = "000001"; // 当无码时,默认的尺码名称 public static String getDefaultSizeName = "无码"; // 当无色时,默认的颜色编号 public static String getDefaultColorCode = "000002"; // 当无色时,默认的颜色名称 public static String getDefaultColorName = "无色"; private static String mAgent; private static String mStore; /** * 获得授权服务URL * * @return */ public static String getLemapServiceUrl() { return mLemapServiceUrl; } // 零售默认订单ID public static String getDefaultOrderId = "0000"; /** * 临时 * * @return */ public static String getLastVersion() { return LemapContext.getSingleDefault().getSharedPreferences().getString("LastVersion", ""); } /** * 临时 * * @param url */ public static void setLastVersion(String value) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("LastVersion", value); editor.commit(); } /** * 获取版本号 * * @return */ public static String getCurrentVersion() { if (mCurrentVersion == null) { mCurrentVersion = LemapContext.getSingleDefault().getSharedPreferences().getString("CurrentVersion", ""); } return mCurrentVersion; } /** * 设置版本号 * * @param url */ public static void setCurrentVersion(String version) { mCurrentVersion = version; Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("CurrentVersion", mCurrentVersion); editor.commit(); } /** * 获取是否开启连续扫描(RFID) * @return */ public static boolean getOpenContinuityScan(){ return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("ContinuityScan",false); } /** * 设置是否开启连续扫描(RFID) * @param isOpen */ public static void setOpenContinuityScan(boolean isOpen){ Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("ContinuityScan",isOpen); editor.commit(); } /** * 获取企业编号 * * @return */ public static String getEnterpriseCode() { Object obj = LemapContext.getSingleDefault().getAppParamContext().getValue(AppParamContext.EnterpriseCode); if (obj != null) { return obj.toString(); } return ""; } /** * 设置企业编号 * * @param url */ public static void setEnterpriseCode(String enterpriseCode) { mEnterpriseCode = enterpriseCode; Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString(ParamsKeys.Param_EnterpriseCode, enterpriseCode); editor.commit(); LemapContext.getSingleDefault().getAppParamContext().putValue(AppParamContext.EnterpriseCode, enterpriseCode); } /** * 获取是否授权标示 * * @return */ public static boolean getIsAuthorize() { AuthorizeType authorizeType = AuthorizeUtils.getAuthorizeType(); return authorizeType == AuthorizeType.Authorize; } /** * 获取BPIString * * @param clsName 业务类名 * @param actionName 方法名 * @return BPIString * @author 廖安良 * @version 创建时间:2013-1-22 下午2:54:08 */ public static String getAuthorizeBPIString(String clsName, String actionName) { return String.format(AppConfig.mAuthorizeBPIString, clsName, actionName); } /** * 获取升级地址 * * @return */ public static String getUpgradeServiceUrl() { if (mUpgradeServiceUrl == null) { mUpgradeServiceUrl = LemapContext.getSingleDefault().getSharedPreferences().getString("UpgradeServiceUrl", ""); } return mUpgradeServiceUrl; } /** * 设置升级地址 * * @param url */ public static void setUpgradeServiceUrl(String url) { mUpgradeServiceUrl = url; Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("UpgradeServiceUrl", mUpgradeServiceUrl); editor.commit(); } /** * 获取同步周期 * * @author 廖安良 * @version 创建时间:2013-1-24 下午5:23:53 */ public static int getSyncPeriod() { return LemapContext.getSingleDefault().getSharedPreferences() .getInt("SyncPeriod", 1000 * 60 * 10);// 默认10分钟 } /** * 设置同步周期 * * @author 廖安良 * @version 创建时间:2013-1-24 下午5:23:53 */ public static void setSyncPeriod(int mSyncPeriod) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putInt("SyncPeriod", mSyncPeriod); editor.commit(); } /** * 获取访问云端Url * * @return * @author 廖安良 * @version 创建时间:2013-1-23 下午4:16:22 */ public static String getCloudUrl(String ipAndPort) { return "http://" + ipAndPort + "/Lemap/CloudService"; } /** * 获取云端IP和端口 * * @return * @author 廖安良 * @version 创建时间:2013-1-23 下午4:16:22 */ public static String getCloudIPAndPort() { try { URL rul = new URL(LemapContext.getSingleDefault() .getSharedPreferences() .getString(CAO.STR_CAOITEMKEY, CAO.STR_URLDEFUALT)); return rul.getHost() + ":" + rul.getPort(); } catch (MalformedURLException e) { e.printStackTrace(); return CAO.STR_URLDEFUALT.substring("http://".length()); } } /** * 设置默认云端IP和端口 * * @param cloudIPAndPort 云端IP和端口 * @author 廖安良 * @version 创建时间:2013-1-23 下午4:16:42 */ public static void setDefaultCloudIPAndPort(String cloudIPAndPort) { if (!LemapContext.getSingleDefault().getSharedPreferences() .contains(CAO.STR_CAOITEMKEY)) { AppConfig.setCloudIPAndPort(cloudIPAndPort); } } /** * 设置云端IP和端口 * * @param cloudIPAndPort 云端IP和端口 * @author 廖安良 * @version 创建时间:2013-1-23 下午4:16:42 */ public static void setCloudIPAndPort(String cloudIPAndPort) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString(CAO.STR_CAOITEMKEY, AppConfig.getCloudUrl(cloudIPAndPort)); editor.commit(); } /** * 获取BPIString * * @param clsName 业务类名 * @param actionName 方法名 * @return BPIString * @author 廖安良 * @version 创建时间:2013-1-22 下午2:54:08 */ public static String getBPIString(String clsName, String actionName) { return String.format(AppConfig.BPIString, clsName, actionName); } /** * 返回用户编号(用于关联) * * @return 用户编号 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getUserCode() { if (mUserCode == null) mUserCode = LemapContext.getSingleDefault().getSharedPreferences() .getString("UserCode", ""); return mUserCode; } /** * 设置用户编号 * * @param 用户编号 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setUserCode(String userCode) { mUserCode = userCode; Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("UserCode", mUserCode); editor.commit(); } /** * 返回客服联系人 * * @return 客服联系人 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getContact() { return LemapContext.getSingleDefault().getSharedPreferences().getString("Contact", "杨先生"); } /** * 设置客服联系人 * * @param 客服联系人 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setContact(String contact) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("Contact", contact); editor.commit(); } /** * 返回客服联系电话 * * @return 客服联系电话 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getContactTel() { return LemapContext.getSingleDefault().getSharedPreferences().getString("ContactTel", "020-22203916"); } /** * 设置客服联系电话 * * @param 客服联系电话 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setContactTel(String contactTel) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("ContactTel", contactTel); editor.commit(); } /** * 返回收银台 * * @return 收银台 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getVfpCode() { String vfpCode = LemapContext.getSingleDefault().getSharedPreferences() .getString("VfpCode", ""); if (StringValidator.isNullOrEmpty(vfpCode)) vfpCode = "0"; return vfpCode; } /** * 设置收银台 * * @param 收银台 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setVfpCode(String vfpCode) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("VfpCode", vfpCode); editor.commit(); } /** * 返回默认库位 * * @return 默认库位 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getDefaultStorageLocationCode() { String code = LemapContext.getSingleDefault().getSharedPreferences() .getString("DefaultStorageLocationCode", ""); if (StringValidator.isNullOrEmpty(code)) code = ""; return code; } /** * 设置默认库位 * * @param 默认库位 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setDefaultStorageLocationCode(String code) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("DefaultStorageLocationCode", code); editor.commit(); } /** * 返回店铺默认库位 * * @return 店铺默认库位 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getDefaultShopLocationCode() { String code = LemapContext.getSingleDefault().getSharedPreferences() .getString("DefaultShopLocationCode", ""); if (StringValidator.isNullOrEmpty(code)) code = ""; return code; } /** * 设置店铺默认库位 * * @param 店铺默认库位 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setDefaultShopLocationCode(String code) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("DefaultShopLocationCode", code); editor.commit(); } /** * 返回店铺默认仓库 * * @return 店铺默认仓库 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getDefaultShopStorageCode() { String code = LemapContext.getSingleDefault().getSharedPreferences() .getString("DefaultShopStorageCode", ""); if (StringValidator.isNullOrEmpty(code)) code = ""; return code; } /** * 设置店铺默认仓库 * * @param 店铺默认仓库 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setDefaultShopStorageCode(String code) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("DefaultShopStorageCode", code); editor.commit(); } /** * 返回默认仓库 * * @return 订单默认仓库 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getDefaultFromStorageCode() { String code = LemapContext.getSingleDefault().getSharedPreferences() .getString("DefaultFromStorageCode", ""); if (StringValidator.isNullOrEmpty(code)) code = ""; return code; } /** * 设置默认仓库 * * @param 订单默认仓库 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setDefaultFromStorageCode(String code) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("DefaultFromStorageCode", code); editor.commit(); } /** * 返回默认仓库 * * @return 订单默认仓库 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getChannelDefaultOrderStorageCode() { String code = LemapContext.getSingleDefault().getSharedPreferences() .getString("ChannelDefaultOrderStorageCode", ""); if (StringValidator.isNullOrEmpty(code)) code = ""; return code; } /** * 设置订单默认仓库 * * @param 订单默认仓库 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setChannelDefaultOrderStorageCode(String code) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("ChannelDefaultOrderStorageCode", code); editor.commit(); } /** * 返回订单默认库位 * * @return 订单默认库位 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getChannelDefaultOrderStorageLocationCode() { String code = LemapContext.getSingleDefault().getSharedPreferences() .getString("ChannelDefaultOrderStorageLocationCode", ""); if (StringValidator.isNullOrEmpty(code)) code = ""; return code; } /** * 设置订单默认库位 * * @param 订单默认库位 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setChannelDefaultOrderStorageLocationCode(String code) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("ChannelDefaultOrderStorageLocationCode", code); editor.commit(); } /** * 返回用户手机 * * @return 用户手机 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getUserPhone() { if (mUserPhone == null) mUserPhone = LemapContext.getSingleDefault().getSharedPreferences() .getString("UserPhone", ""); return mUserPhone; } /** * 设置用户手机 * * @param 用户手机 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setUserPhone(String userPhone) { mUserPhone = userPhone; Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("UserPhone", mUserPhone); editor.commit(); } /** * 返回店铺编号 * * @return 店铺编号 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getShopCode() { return LemapContext.getSingleDefault().getSharedPreferences() .getString("ShopCode", ""); } /** * 设置店铺编号 * * @param shopCode 店铺编号 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setShopCode(String shopCode) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("ShopCode", shopCode); editor.commit(); } /** * 返回店铺名称 * * @return 店铺名称 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getShopName() { return LemapContext.getSingleDefault().getSharedPreferences() .getString("ShopName", ""); } /** * 设置店铺名称 * * @param shopName 店铺编号 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setShopName(String shopName) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("ShopName", shopName); editor.commit(); } /** * 返回店铺价格字段 * * @return 店铺价格字段 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getShopSalePriceField() { String fileValue = LemapContext.getSingleDefault().getSharedPreferences() .getString("ShopSalePriceField", "BZSJ"); return fileValue; } /** * 设置店铺价格字段 * * @param shopName 店铺价格字段 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setShopSalePriceField(String fieldName) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("ShopSalePriceField", fieldName); editor.commit(); } /** * 返回用户姓名 * * @return 用户姓名 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getUserName() { if (mUserName == null) mUserName = LemapContext.getSingleDefault().getSharedPreferences() .getString("UserName", ""); return mUserName; } /** * 设置用户姓名 * * @param 用户姓名 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setUserName(String userName) { mUserName = userName; Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("UserName", mUserName); editor.commit(); } /** * 返回用户密码 * * @return 用户密码 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:29 */ public static String getUserPassword() { if (mUserPassword == null) mUserPassword = LemapContext.getSingleDefault() .getSharedPreferences().getString("UserPassword", ""); return mUserPassword; } /** * 设置用户密码 * * @param 用户密码 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:29 */ public static void setUserPassword(String userPassword) { mUserPassword = <PASSWORD>Password; Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("UserPassword", mUserPassword); editor.commit(); } /** * 返回用户角色 * * @return 用户角色 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:29 */ public static Role getUserRole() { return mUserRole; } /** * 设置用户角色 * * @param 用户角色 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:29 */ public static void setUserRole(Role userRole) { mUserRole = userRole; } /** * 返回设备编号 * * @return 设备编号 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:29 */ public static String getClientShortCode() { return mClientShortCode; } /** * 设置设备编号 * * @param 企业信息 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:29 */ public static void setClientShortCode(String shortCode) { mClientShortCode = shortCode; } /** * 返回是否记住密码 * * @return 是否记住密码 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static Boolean isRememberPassword() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("IsSavePassword", false); } /** * 设置是否记住密码 * * @param 是否记住密码 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void isRememberPassword(Boolean rememberPassword) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("IsSavePassword", rememberPassword); editor.commit(); } /** * 返回是否自动登录 * * @return 是否自动登录 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static Boolean isAutoLogin() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("IsAutoLogin", false); } /** * 设置是否自动登录 * * @param 是否自动登录 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void isAutoLogin(Boolean autoLogin) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("IsAutoLogin", autoLogin); editor.commit(); } /** * 返回蓝牙打印机的名称 * * @return 返回蓝牙打印机的名称 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getBlueName() { String def = ""; return LemapContext.getSingleDefault().getSharedPreferences().getString("BlueThPrintName", def); } /** * 设置蓝牙打印机的名称 * * @param 蓝牙打印机的名称 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setBlueName(String addrName) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("BlueThPrintName", addrName); editor.commit(); } /** * 返回蓝牙打印机地址 * * @return 返回蓝牙打印机地址 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getBlueThAddr() { String def = ""; return LemapContext.getSingleDefault().getSharedPreferences() .getString("BlueThPrintAddress", def); } /** * 设置蓝牙打印机地址 * * @param 蓝牙打印机地址 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setBlueThAddr(String addr) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("BlueThPrintAddress", addr); editor.commit(); } /** * 返回是否启用蓝牙打印机 * * @return 返回是否启用蓝牙打印机 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static Boolean getBlueThEnabled() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("BlueThPrintEnabled", false); } /** * 设置是否启用蓝牙打印机 * * @param 是否启用蓝牙打印机 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setBlueThEnabled(Boolean bEnabled) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("BlueThPrintEnabled", bEnabled); editor.commit(); } /** * 返回是否启用装箱单打印 * * @return 返回是否启用装箱单打印 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static Boolean getBoxPrintEnabled() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("BoxPrintEnabled", false); } /** * 设置是否启用装箱单打印 * * @param 是否启用装箱单打印 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setBoxPrintEnabled(Boolean bEnabled) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("BoxPrintEnabled", bEnabled); editor.commit(); } /** * 返回零售小票打印机的规格 * * @return 零售小票打印机的规格 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getBlueThPrintNorm() { String def = ""; return LemapContext.getSingleDefault().getSharedPreferences() .getString("BlueThPrintNorm", def); } /** * 设置零售小票打印机的规格 * * @param 零售小票打印机的规格 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setBlueThPrintNorm(String blueThPrintNorm) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("BlueThPrintNorm", blueThPrintNorm); editor.commit(); } /** * 返回零售时是否打印销售小票 * * @return 零售时是否打印销售小票 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static Boolean getSalePrintEnabled() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("SalePrintEnabled", false); } /** * 设置零售时是否打印销售小票 * * @param 零售时是否打印销售小票 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setSalePrintEnabled(Boolean bEnabled) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("SalePrintEnabled", bEnabled); editor.commit(); } /** * 返回装箱小票打的模板编号 * * @return 装箱小票打的模板编号 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getBoxPrintModelCode() { String def = ""; return LemapContext.getSingleDefault().getSharedPreferences() .getString("BoxPrintModelCode", def); } /** * 设置装箱小票打的模板编号 * * @param 装箱小票打的模板编号 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setBoxPrintModelCode(String code) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("BoxPrintModelCode", code); editor.commit(); } /** * 返回触摸不弹出输入法长按弹出 * * @return 触摸不弹出输入法长按弹出 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static Boolean getTouchNoShowAndLongClickShowEnabled() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("TouchNoShowAndLongClickShowEnabled", true); } /** * 设置触摸不弹出输入法长按弹出 * * @param 触摸不弹出输入法长按弹出 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setTouchNoShowAndLongClickShowEnabled(Boolean bEnabled) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("TouchNoShowAndLongClickShowEnabled", bEnabled); editor.commit(); } /** * 返回仓库调整单启用标志 * * @return 启用标志 * @author 马时洁 * @version 创建时间:2013-1-16 上午9:51:22 */ public static Boolean getTZD() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("TZD", true); } /** * 设置仓库调整单启用标志 * * @param 设置仓库调整单 * @author 马时洁 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setTZD(Boolean bEnabled) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("TZD", bEnabled); editor.commit(); } /** * 返回渠道补货单启用标志 * * @return 启用标志 * @author 马时洁 * @version 创建时间:2013-1-16 上午9:51:22 */ public static Boolean getQDBH() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("QDBH", true); } /** * 设置渠道补货单启用标志 * * @param 设置仓库调整单 * @author 马时洁 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setQDBH(Boolean bEnabled) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("QDBH", bEnabled); editor.commit(); } /** * 返回渠道收货单启用标志 * * @return 启用标志 * @author 马时洁 * @version 创建时间:2013-1-16 上午9:51:22 */ public static Boolean getQDSH() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("QDSH", true); } /** * 设置渠道收货单启用标志 * * @param 设置渠道收货单 * @author 马时洁 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setQDSH(Boolean bEnabled) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("QDSH", bEnabled); editor.commit(); } /** * 返回门店退货单启用标志 * * @return 启用标志 * @author 马时洁 * @version 创建时间:2013-1-16 上午9:51:22 */ public static Boolean getBack() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("Back", true); } /** * 设置门店退货单启用标志 * * @param 设置门店退货单 * @author 马时洁 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setBack(Boolean bEnabled) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("Back", bEnabled); editor.commit(); } /** * 返回日结时是否打印小票 * * @return 日结时是否打印小票 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static Boolean getSaleDayEndPrintEnabled() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("SaleDayEndPrintEnabled", false); } /** * 设置日结时是否打印小票 * * @param 日结时是否打印小票 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setSaleDayEndPrintEnabled(Boolean bEnabled) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("SaleDayEndPrintEnabled", bEnabled); editor.commit(); } /** * 返回云平台入口的url * * @return 用户密码 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:29 */ public static String getLemapEnterUrl() { return LemapContext.getSingleDefault().getSharedPreferences() .getString(CAO.STR_CAOITEMKEY, CAO.STR_URLDEFUALT); } /** * 设置云平台入口的url * * @param 用户密码 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:29 */ public static void setLemapEnterUrl(String url) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString(CAO.STR_CAOITEMKEY, url); editor.commit(); } /** * 返回是否允许折上折 * * @return 是否允许折上折 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static Boolean getDiscountOnEnable() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("IsDiscountOnEnable", false); } /** * 设置是否允许折上折 * * @param 是否允许折上折 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setDiscountOnEnable(Boolean discountOnEnable) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("IsDiscountOnEnable", discountOnEnable); editor.commit(); } /** * 返回是否允许手工折扣 * * @return 是否允许手工折扣 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static Boolean getDiscountManualEnable() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("IsDiscountManualEnable", false); } /** * 设置是否允许手工折扣 * * @param 是否允许手工折扣 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setDiscountManualEnable(Boolean discountManualEnable) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("IsDiscountManualEnable", discountManualEnable); editor.commit(); } /** * 返回默认营业员 * * @return 默认营业员 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getDefaultSalesMan() { String def = ""; return LemapContext.getSingleDefault().getSharedPreferences() .getString("DefaultSalesMan", def); } /** * 设置默认营业员 * * @param 默认营业员 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setDefaultSalesMan(String salesMan) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("DefaultSalesMan", salesMan); editor.commit(); } /** * 返回每行金额精度 * * @return 每行金额精度 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getRowAmountAccuracy() { String def = "#0.00"; return LemapContext.getSingleDefault().getSharedPreferences() .getString("RowAmountAccuracy", def); } /** * 设置每行金额精度 * * @param 每行金额精度 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setRowAmountAccuracy(String rowAmountAccuracy) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("RowAmountAccuracy", rowAmountAccuracy); editor.commit(); } /** * 返回每行金额精度计算方式 * * @return 每行金额精度计算方式 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getRowAmountAccuracyDeal() { String def = "四舍五入"; return LemapContext.getSingleDefault().getSharedPreferences() .getString("RowAmountAccuracyDeal", def); } /** * 设置每行金额精度计算方式 * * @param 每行金额精度计算方式 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setRowAmountAccuracyDeal(String rowAmountAccuracyDeal) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("RowAmountAccuracyDeal", rowAmountAccuracyDeal); editor.commit(); } /** * 返回总金额精度 * * @return 总金额精度 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getAmountAccuracy() { String def = "#0.00"; return LemapContext.getSingleDefault().getSharedPreferences() .getString("AmountAccuracy", def); } /** * 设置总金额精度 * * @param 总金额精度 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setAmountAccuracy(String amountAccuracy) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("AmountAccuracy", amountAccuracy); editor.commit(); } /** * 返回总金额精度计算方式 * * @return 总金额精度计算方式 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getAmountAccuracyDeal() { String def = "四舍五入"; return LemapContext.getSingleDefault().getSharedPreferences() .getString("AmountAccuracyDeal", def); } /** * 设置总金额精度计算方式 * * @param 总金额精度计算方式 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setAmountAccuracyDeal(String amountAccuracyDeal) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("AmountAccuracyDeal", amountAccuracyDeal); editor.commit(); } /** * 返回是否开启收货差异发送短信功能 * * @return 是否开启收货差异发送短信功能 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static Boolean getReceiptDiffSms() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("ReceiptDiffSms", false); } /** * 设置是否开启收货差异发送短信功能 * * @param 是否开启收货差异发送短信功能 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setReceiptDiffSms(Boolean receiptDiffSms) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("ReceiptDiffSms", receiptDiffSms); editor.commit(); } /** * 返回接收差异短信的手机号码 * * @return 接收差异短信的手机号码 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getSmsNumber() { return LemapContext.getSingleDefault().getSharedPreferences() .getString("SmsNumber", ""); } /** * 设置接收差异短信的手机号码 * * @param 接收差异短信的手机号码 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setSmsNumber(String smsNumber) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("SmsNumber", smsNumber); editor.commit(); } /** * 设置设备编号 * * @param 企业信息 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:29 */ public static void setClientCode(String shortCode) { mClientCode = shortCode; Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("ClientCode", shortCode); editor.commit(); } /** * 返回用户所属代理商 * * @return 用户所属代理商 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getAgent() { if (mAgent == null) mAgent = LemapContext.getSingleDefault().getSharedPreferences() .getString("Agent", ""); return mAgent; } /** * 设置用户所属代理商 * * @param 用户所属代理商 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setAgent(String Agent) { mAgent = Agent; Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("Agent", mAgent); editor.commit(); } /** * 返回用户所属店仓 * * @return 用户所属店仓 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getStore() { if (mStore == null) mStore = LemapContext.getSingleDefault().getSharedPreferences() .getString("Store", ""); return mStore; } /** * 设置用户所属店仓 * * @param 用户所属店仓 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setStore(String Store) { mStore = Store; Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("Store", mStore); editor.commit(); } /** * 返回授权码 * * @return 目前只有日期 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static String getAuthorizeCode() { return LemapContext.getSingleDefault().getSharedPreferences() .getString("AuthorizeCode", ""); } /** * 设置授权码,目前只有日期 * * @param 设置授权码 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setAuthorizeCode(String authorizeCode) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("AuthorizeCode", authorizeCode); editor.commit(); } /** * 获取USB文件路径 * * @return */ public static String getUSBFilePath() { return LemapContext.getSingleDefault().getSharedPreferences() .getString("filepathsetting", "/sdcard/仓储数据/"); } /** * 设置USB文件路径 * * @return */ public static void setUSBFilePath(String filePath) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("filepathsetting", filePath); editor.commit(); } /** * 获取ftp ip * * @return */ public static String getFtpIp() { return LemapContext.getSingleDefault().getSharedPreferences().getString("ftpipsetting", ""); } /** * 获取ftp userName * * @return */ public static String getFtpUserName() { return LemapContext.getSingleDefault().getSharedPreferences().getString("ftpusernamesetting", ""); } /** * 获取ftp password * * @return */ public static String getFtpPassWord() { return LemapContext.getSingleDefault().getSharedPreferences().getString("ftppasswordsetting", ""); } /** * 设置 ftp Ip * * @param ftpIp */ public static void setFtpIp(String ftpIp) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("ftpipsetting", ftpIp); editor.commit(); } /** * 设置ftp userName * * @param ftpUserName */ public static void setFtpUserName(String ftpUserName) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("ftpusernamesetting", ftpUserName); editor.commit(); } /** * 设置ftp password * * @param ftpPassword */ public static void setFtpPassword(String ftpPassword) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putString("ftppasswordsetting", ftpPassword); editor.commit(); } /** * 获取扫描是否验证商品资料 * * @return */ public static boolean getProductIsCheckExists() { return true; /* return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("cb_parsetting_check_ischecked", false);*/ } /** * 设置扫描是否验证商品资料是否存在 * * @param isCheck */ public static void setProductIsCheckExists(Boolean isCheck) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("cb_parsetting_check_ischecked", isCheck); editor.commit(); } /** * 店铺编号是否显示 * * @return */ public static boolean getShopCodeIsShow() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("cb_parsetting_shopcode", false); } /** * 设置店铺编号是否显示 * * @param isShow */ public static void setShopCodeIsShow(boolean isShow) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("cb_parsetting_shopcode", isShow); editor.commit(); } /** * 获取是否显示店位 * * @return */ public static boolean getShopNameTxtIsShow() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("cb_parsetting_shopnum_ischecked", false); } /** * 设置店位是否显示 * * @param isShow */ public static void setShopNameTxtIsShow(Boolean isShow) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("cb_parsetting_shopnum_ischecked", isShow); editor.commit(); } /** * 获取是否显示仓位 * * @return */ public static boolean getPositionCodeIsShow() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("cb_parsetting_storead_ischecked", false); } /** * 设置是否显示仓位 * * @param isShow */ public static void setPositionCodeIsShow(boolean isShow) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("cb_parsetting_storead_ischecked", isShow); editor.commit(); } /** * 获取是否显示数量 * * @return */ public static boolean getNumIsShow() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("cb_parsetting_number", false); } /** * 设置是否显示数量 * * @param isShow */ public static void setNumIsShow(boolean isShow) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("cb_parsetting_number", isShow); editor.commit(); } /** * 获取是否显示库存 * * @return */ public static boolean getStockNumIsShow() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("cb_parsetting_stocknum_ischecked", false); } /** * 设置是否显示库存 * * @param isShow */ public static void setStockNumIsShow(boolean isShow) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("cb_parsetting_stocknum_ischecked", isShow); editor.commit(); } /** * 获取是否启用复盘 * * @return */ public static boolean getIsAgainScan() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("cb_parsetting_reinventory", false); } /** * 设置是否启用复盘 * * @param isAgain */ public static void setIsAgainScan(boolean isAgain) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("cb_parsetting_reinventory", isAgain); editor.commit(); } /** * 获取是否启用重码扫描 * * @return */ public static boolean getIsRecode() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("cb_barsetting_recode_ischecked", false); } /** * 设置是否启用重码扫描 * * @param isrecode */ public static void setIsRecode(boolean isrecode) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("cb_barsetting_recode_ischecked", isrecode); editor.commit(); } /** * 获取店位文本 * * @return */ public static String getShopCodeTxt() { return LemapContext.getSingleDefault().getSharedPreferences().getString("shopnum", "仓库"); } /** * 设置店位文本 * * @param shopnumtxt */ public static void setShopCodeTxt(String shopnumtxt) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("shopnum", shopnumtxt); editor.commit(); } /** * 获取仓位文本 * * @return */ public static String getPositionCodeTxt() { return LemapContext.getSingleDefault().getSharedPreferences().getString("storead", "库位"); } /** * 设置仓位文本 * * @param positionCodeTxt */ public static void setPositionCodeTxt(String positionCodeTxt) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("storead", positionCodeTxt); editor.commit(); } /** * 获取显示行数 * * @return */ public static String getShowRowCount() { return LemapContext.getSingleDefault().getSharedPreferences().getString("linenum", ""); } /** * 设置显示行数 * * @param rowCount */ public static void setShowRowCount(String rowCount) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("linenum", rowCount); editor.commit(); } /** * 获取条码最小长度 * * @return */ public static String getMinLength() { return LemapContext.getSingleDefault().getSharedPreferences().getString("minlength", ""); } /** * 设置条码最小长度 * * @param minLength */ public static void setMinLength(String minLength) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("minlength", minLength); editor.commit(); } /** * 获取条码最大长度 * * @return */ public static String getMaxLength() { return LemapContext.getSingleDefault().getSharedPreferences().getString("maxlength", ""); } /** * 设置条码最大长度 * * @param minLength */ public static void setMaxLength(String maxLength) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("maxlength", maxLength); editor.commit(); } /** * 获取条码不包含字符 * * @return */ public static String getUninClude() { return LemapContext.getSingleDefault().getSharedPreferences().getString("uninclude", ""); } /** * 设置条码不包含字符 * * @param minLength */ public static void setUninClude(String uninclude) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("uninclude", uninclude); editor.commit(); } /** * 获取条码截取流水号位数 * * @return */ public static String getRemove() { return LemapContext.getSingleDefault().getSharedPreferences().getString("remove", ""); } /** * 设置条码截取流水号位数 * * @param minLength */ public static void setRemove(String len) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("remove", len); editor.commit(); } /** * 获取数量重复累加 * * @return */ public static boolean getRecodeYes() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("rb_barsetting_scan_yes_ischecked", true); } /** * 设置数量重复累加 * * @param isYes */ public static void setRecodeYes(boolean isYes) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("rb_barsetting_scan_yes_ischecked", isYes); editor.commit(); } /** * 获取行数累加 * * @return */ public static boolean getRecodeNo() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("rb_barsetting_scan_no_ischecked", false); } /** * 设置行数累加 * * @param isNo */ public static void setRecodeNo(boolean isNo) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("rb_barsetting_scan_no_ischecked", isNo); editor.commit(); } /** * 获取条码截取开始位置 * * @return */ public static String getCutBegin() { return LemapContext.getSingleDefault().getSharedPreferences().getString("et_barsetting_interception_begin", ""); } /** * 设置条码截取开始位置 * * @param beginIndex */ public static void setCutBegin(String beginIndex) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("et_barsetting_interception_begin", beginIndex); editor.commit(); } /** * 获取条码截取长度 * * @return */ public static String getCutLength() { return LemapContext.getSingleDefault().getSharedPreferences().getString("et_barsetting_interception_length", ""); } /** * 设置条码截取长度 * * @param len */ public static void setCutLength(String len) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("et_barsetting_interception_length", len); editor.commit(); } /** * 获取操作文件类型 * * @return */ public static String getOperatorFileType() { return LemapContext.getSingleDefault().getSharedPreferences().getString("operator_file_type", ""); } /** * 设置操作文件类型 * * @param fileType */ public static void setOperatorFileType(String fileType) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("operator_file_type", fileType); editor.commit(); } /** * 获取是否显示仓位 * * @return */ public static boolean getPositionNameTxtIsShow() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("cb_parsetting_storead_ischecked", false); } /** * 设置是否显示仓位 * * @param isShow */ public static void setPositionNameTxtIsShow(boolean isShow) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("cb_parsetting_storead_ischecked", isShow); editor.commit(); } /** * 获取是否打印出库单 * * @return */ public static boolean getPrintOutstoreEnable() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("IsPrintOutstoreEnable", false); } /** * 设置是否打印出库单 * * @param isShow */ public static void setPrintOutstoreEnable(boolean isShow) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("IsPrintOutstoreEnable", isShow); editor.commit(); } /** * 获取是否打印出库装箱单 * * @return */ public static boolean getPrintOutstoreBoxEnable() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("IsPrintOutstoreBoxEnable", false); } /** * 设置是否打印出库装箱单 * * @param isShow */ public static void setPrintOutstoreBoxEnable(boolean isShow) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("IsPrintOutstoreBoxEnable", isShow); editor.commit(); } /** * 获取是否打印入库单 * * @return */ public static boolean getPrintInstoreEnable() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("IsPrintInstoreEnable", false); } /** * 设置是否打印入库单 * * @param isShow */ public static void setPrintInstoreEnable(boolean isShow) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("IsPrintInstoreEnable", isShow); editor.commit(); } /** * 返回是否开机启动 * * @return 是否开机启动 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static Boolean getAutoStartup() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("IsAutoStartup", true); } /** * 设置是否开机启动 * * @param 是否开机启动 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setAutoStartup(Boolean autoStartup) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("IsAutoStartup", autoStartup); editor.commit(); } /** * 返回是否开启装箱货品控制 */ public static Boolean getBoxGoodsLimitEnable() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("IsBoxGoodsLimitEnable", false); } /** * 设置是否开启装箱货品控制 */ public static void setBoxGoodsLimitEnable(Boolean enable) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("IsBoxGoodsLimitEnable", enable); editor.commit(); } /** * 返回是否开启装箱差异控制 */ public static Boolean getBoxDiffLimitEnable() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("IsBoxDiffLimitEnable", false); } /** * 设置是否开启装箱差异控制 */ public static void setBoxDiffLimitEnable(Boolean enable) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("IsBoxDiffLimitEnable", enable); editor.commit(); } /** * 返回是否开启销售出库 * * @return */ public static boolean getSaleOutEnabled() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("SaleOutEnabled", true); } /** * 设置是否开启销售出库 * * @param */ public static void setSaleOutEnabled(boolean bEnabled) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("SaleOutEnabled", bEnabled); editor.commit(); } /** * 返回销售出库名称 * * @return */ public static String getSaleOutName() { return LemapContext.getSingleDefault().getSharedPreferences().getString("SaleOutName", "渠道调拨出库");//销售出库 } /** * 设置销售出库名称 * * @param */ public static void setSaleOutName(String sName) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("SaleOutName", sName); editor.commit(); } /** * 返回是否开启调拨出库 * * @return */ public static boolean getDiaoBoOutEnabled() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("DiaoBoOutEnabled", true); } /** * 设置是否开启调拨出库 * * @param */ public static void setDiaoBoOutEnabled(boolean bEnabled) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("DiaoBoOutEnabled", bEnabled); editor.commit(); } /** * 返回调拨出库名称 * * @return */ public static String getDiaoBoOutName() { return LemapContext.getSingleDefault().getSharedPreferences().getString("DiaoBoOutName", "商店配货出库");//调拨出库 } /** * 设置调拨出库名称 * * @param */ public static void setDiaoBoOutName(String sName) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("DiaoBoOutName", sName); editor.commit(); } /** * 返回是否开启采购退货出库 * * @return */ public static boolean getPurchaseBackOutEnabled() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("PurchaseBackOutEnabled", true); } /** * 设置是否开启采购退货出库 * * @param */ public static void setPurchaseBackOutEnabled(boolean bEnabled) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("PurchaseBackOutEnabled", bEnabled); editor.commit(); } /** * 返回采购退货出库名称 * * @return */ public static String getPurchaseBackOutName() { return LemapContext.getSingleDefault().getSharedPreferences().getString("PurchaseBackOutName", "商品退货出库");//采购退货出库 } /** * 设置采购退货出库名称 * * @param */ public static void setPurchaseBackOutName(String sName) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("PurchaseBackOutName", sName); editor.commit(); } /** * 返回是否开启采购入库 * * @return */ public static boolean getPurchaseInEnabled() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("PurchaseInEnabled", true); } /** * 设置是否开启采购入库 * * @param */ public static void setPurchaseInEnabled(boolean bEnabled) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("PurchaseInEnabled", bEnabled); editor.commit(); } /** * 返回采购入库名称 * * @return */ public static String getPurchaseInName() { return LemapContext.getSingleDefault().getSharedPreferences().getString("PurchaseInName", "采购进货入库");//采购入库 } /** * 设置采购入库名称 * * @param */ public static void setPurchaseInName(String sName) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("PurchaseInName", sName); editor.commit(); } /** * 返回是否开启调拨入库 * * @return */ public static boolean getDiaoBoInEnabled() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("DiaoBoInEnabled", true); } /** * 设置是否开启调拨入库 * * @param */ public static void setDiaoBoInEnabled(boolean bEnabled) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("DiaoBoInEnabled", bEnabled); editor.commit(); } /** * 返回调拨入库名称 * * @return */ public static String getDiaoBoInName() { return LemapContext.getSingleDefault().getSharedPreferences().getString("DiaoBoInName", "商店退货入库");//调拨入库 } /** * 设置调拨入库名称 * * @param */ public static void setDiaoBoInName(String sName) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("DiaoBoInName", sName); editor.commit(); } /** * 返回是否开启销售退货入库 * * @return */ public static boolean getSaleBackInEnabled() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("SaleBackInEnabled", true); } /** * 设置是否开启销售退货入库 * * @param */ public static void setSaleBackInEnabled(boolean bEnabled) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("SaleBackInEnabled", bEnabled); editor.commit(); } /** * 返回销售退货入库名称 * * @return */ public static String getSaleBackInName() { return LemapContext.getSingleDefault().getSharedPreferences().getString("SaleBackInName", "渠道退货入库");//销售退货入库 } /** * 设置销售退货入库名称 * * @param */ public static void setSaleBackInName(String sName) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("SaleBackInName", sName); editor.commit(); } /** * 获取唯一码控制 * * @return */ public static boolean getUniqueBarCodeSetting() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("uniqueBarCodeSetting", false); } /** * 设置唯一码控制 * * @param isStart */ public static void setUniqueBarCodeSetting(boolean isStart) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("uniqueBarCodeSetting", isStart); editor.commit(); } /** * 设置是否启用发货方式 * * @param isStart */ public static void setDeliveryTypeEnabled(boolean bEnabled) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("DeliveryTypeEnabled", bEnabled); editor.commit(); } /** * 获取是否启用发货方式 * * @return */ public static boolean getDeliveryTypeEnabled() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("DeliveryTypeEnabled", true); } /** * 设置是否允许供货/收货仓为空 * * @param isStart */ public static void setReceiptStorageEmptyEnabled(boolean bEnabled) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("ReceiptStorageEmptyEnabled", bEnabled); editor.commit(); } /** * 获取是否允许供货/收货仓为空 * * @return */ public static boolean getReceiptStorageEmptyEnabled() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("ReceiptStorageEmptyEnabled", true); } /** * 设置是否显示实时库存 * * @param isStart */ public static void setShowRealStockEnabled(boolean bEnabled) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("ShowRealStockEnabled", bEnabled); editor.commit(); } /** * 获取是否显示实时库存(订货,盘点) * * @return */ public static boolean getShowRealStockEnabled() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("ShowRealStockEnabled", true); } /** * 设置是否显示实时价格 * * @param isStart */ public static void setShowRealPriceEnabled(boolean bEnabled) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("ShowRealPriceEnabled", bEnabled); editor.commit(); } /** * 获取是否显示实时价格 * * @return */ public static boolean getShowRealPriceEnabled() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("ShowRealPriceEnabled", true); } /** * 设置提交订货单时是否检查库存 * * @param isStart */ public static void setPuchaseStockCheckEnabled(boolean bEnabled) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("CheckRealStockEnabled", bEnabled); editor.commit(); } /** * 获取提交订货单时是否检查库存 * * @return */ public static boolean getPuchaseStockCheckEnabled() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("CheckRealStockEnabled", true); } /** * 设置是否显示货品缩略图(订货) * * @param isStart */ public static void setShowRealImageEnabled(boolean bEnabled) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("ShowRealImageEnabled", bEnabled); editor.commit(); } /** * 获取设置是否显示货品缩略图(订货) * * @return */ public static boolean getShowRealImageEnabled() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("ShowRealImageEnabled", false); } /** * 设置登录后是否提示修改密码 * * @param 登录后是否提示修改密码 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static void setPwdModifyAlert(Boolean bEnabled) { Editor editor = LemapContext.getSingleDefault() .getSharedPreferencesEditor(); editor.putBoolean("IsPwdModifyAlert", bEnabled); editor.commit(); } /** * 返回登录后是否提示修改密码 * * @return 登录后是否提示修改密码 * @author 廖安良 * @version 创建时间:2013-1-16 上午9:51:22 */ public static Boolean getPwdModifyAlert() { return LemapContext.getSingleDefault().getSharedPreferences() .getBoolean("IsPwdModifyAlert", true); } /** * 设置是否需要更新代理商 * * @param */ public static void setNeedUpdateAgent(boolean bEnabled) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("NeedUpdateAgent", bEnabled); editor.commit(); } /** * 获取是否需要更新代理商 * * @return */ public static boolean getNeedUpdateAgent() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("NeedUpdateAgent", false); } /** * 设置弹出窗口的宽度 * * @param value */ public static void setDialogWidth(int value) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putInt("DialogWidth", value); editor.commit(); } /** * 获取弹出窗口的宽度 * * @return */ public static int getDialogWidth() { return LemapContext.getSingleDefault().getSharedPreferences().getInt("DialogWidth", 0); } /** * 临时存放仓库变量 * * @param value */ public static void setTempStorageCode(String value) { mTempStorageCode = value; } /** * 临时存放仓库变量 * * @return */ public static String getTempStorageCode() { return mTempStorageCode; } /** * 设置是否允许继续扫描当取不到实时价格时(订货) * * @param isStart */ public static void setNoPriceScanEnabled(boolean bEnabled) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("NoPriceScanEnabled", bEnabled); editor.commit(); } /** * 获取设置是否允许继续扫描当取不到实时价格时(订货) * * @return */ public static boolean getNoPriceScanEnabled() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("NoPriceScanEnabled", false); } /** * 设置是否允许无色无码的条码 * * @param isStart */ public static void setBarCodeNoColorNoSizeEnabled(boolean bEnabled) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("BarCodeNoColorNoSizeEnabled", bEnabled); editor.commit(); } /** * 获取设置是否允许无色无码的条码 * * @return */ public static boolean getBarCodeNoColorNoSizeEnabled() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("BarCodeNoColorNoSizeEnabled", false); } /** * 设置当出库中一款未完成扫描时是否提示 * * @param bEnabled */ public static void setNotSameGoodAlertEnabled(boolean bEnabled) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("NotSameGoodAlertEnabled", bEnabled); editor.commit(); } /** * 获取设置当出库中一款未完成扫描时是否提示 * * @return */ public static boolean getNotSameGoodAlertEnabled() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("NotSameGoodAlertEnabled", false); } /** * 设置扫描界面显示行数 * * @param isStart */ public static void setPageSize(int intPageSize) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putInt("PageSize", intPageSize); editor.commit(); } /** * 获取设置扫描界面显示行数setUniqueCodeCutLength * * @return */ public static int getPageSize() { return LemapContext.getSingleDefault().getSharedPreferences().getInt("PageSize", 20); } /** * 设置唯一码流水位截取长度 * * @param isStart */ public static void setUniqueCodeCutLength(int ivalue) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putInt("UniqueCodeCutLength", ivalue); editor.commit(); } /** * 获取唯一码流水位截取长度 * * @return */ public static int getUniqueCodeCutLength() { return LemapContext.getSingleDefault().getSharedPreferences().getInt("UniqueCodeCutLength", 0); } /** * 设置条码长度 * 是判断能否启用唯一码的重要标识 * * @param value */ public static void setMaxBarCodeLength(int value) { mMaxBarCodeLength = value; Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putInt("MaxBarCodeLength", value); editor.commit(); } /** * 获取条码长度 * 是判断能否启用唯一码的重要标识 * * @return */ public static int getMaxBarCodeLength() { if (mMaxBarCodeLength == -1) { mMaxBarCodeLength = LemapContext.getSingleDefault().getSharedPreferences().getInt("MaxBarCodeLength", 0); } return mMaxBarCodeLength; } /** * 设置截取条码长度 * 是判断能否启用唯一码的重要标识 * * @param value */ public static void setMaxBarCodeCutLength(int value) { mMaxBarCodeCutLength = value; Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putInt("MaxBarCodeCutLength", value); editor.commit(); } /** * 获取截取条码长度 * 是判断能否启用唯一码的重要标识 * * @return */ public static int getMaxBarCodeCutLength() { if (mMaxBarCodeCutLength == -1) { mMaxBarCodeCutLength = LemapContext.getSingleDefault().getSharedPreferences().getInt("MaxBarCodeCutLength", 0); } return mMaxBarCodeCutLength; } /** * 设置是否已经初始化删除的条码 * * @param bValue */ public static void setIsInitDeleteBarCode(boolean bValue) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putBoolean("IsInitDeleteBarCode", bValue); editor.commit(); } /** * 获取是否已经初始化删除的条码 * * @return */ public static boolean getIsInitDeleteBarCode() { return LemapContext.getSingleDefault().getSharedPreferences().getBoolean("IsInitDeleteBarCode", false); } /** * 设置是否在线获取条码 * * @param bValue */ public static void setBarCodeOnlineEnabled(boolean bValue) { mGetBarCodeOnline = bValue ? 1 : 0; Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putInt("IsBarCodeOnlineEnabled", mGetBarCodeOnline); editor.commit(); } /** * 获取是否只截取不校验唯一码重复 * * @return */ public static boolean getUniqueCodeNotCheckRepeatEnabled() { if (mUniqueCodeNotCheckRepeat == -1) { mUniqueCodeNotCheckRepeat = LemapContext.getSingleDefault().getSharedPreferences().getInt("UniqueCodeNotCheckRepeat", 1); } return mUniqueCodeNotCheckRepeat == 1; } /** * 设置是否只截取不校验唯一码重复 * * @param bValue */ public static void setUniqueCodeNotCheckRepeatEnabled(boolean bValue) { mUniqueCodeNotCheckRepeat = bValue ? 1 : 0; Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putInt("UniqueCodeNotCheckRepeat", mUniqueCodeNotCheckRepeat); editor.commit(); } /** * 获取是否在线获取条码 * * @return */ public static boolean getBarCodeOnlineEnabled() { if (mGetBarCodeOnline == -1) { mGetBarCodeOnline = LemapContext.getSingleDefault().getSharedPreferences().getInt("IsBarCodeOnlineEnabled", 1); } return mGetBarCodeOnline == 1; } /** * 设置是否在线获取条码 * * @param bValue */ public static void setBarCodeMode(BarCodeMode barCodeMode) { mBarCodeMode = barCodeMode; Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putInt("BarCodeMode", mBarCodeMode.value); editor.commit(); } /** * 获取条码类型 * * @return */ public static BarCodeMode getBarCodeMode() { if (mBarCodeMode == null) { int result = LemapContext.getSingleDefault().getSharedPreferences().getInt("BarCodeMode", BarCodeMode.ALL.value); mBarCodeMode = EnumConvert.ordinalOf(BarCodeMode.class, result, BarCodeMode.ALL); } return mBarCodeMode; } /** * 设置库存显示方式 * * @param bValue */ public static void setStockStyle(String style) { Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("StockStyle", style); editor.commit(); } /** * 获取库存显示方式 * * @return */ public static String getStockStyle() { return LemapContext.getSingleDefault().getSharedPreferences().getString("StockStyle", "HAND"); } /** * 设置通行证 * * @param bValue */ public static void setAccessToken(String sValue) { mAccessToken = sValue; Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("AccessToken", sValue); editor.commit(); } /** * 获取通行证 * * @return */ public static String getAccessToken() { if (mAccessToken == null) { mAccessToken = LemapContext.getSingleDefault().getSharedPreferences().getString("AccessToken", ""); } return mAccessToken; } /** * 设置所属机构 * * @param bValue */ public static void setOrgCode(String sValue) { mOrgCode = sValue; Editor editor = LemapContext.getSingleDefault().getSharedPreferencesEditor(); editor.putString("OrgCode", sValue); editor.commit(); } /** * 获取所属机构 * * @return */ public static String getOrgCode() { if (mOrgCode == null) { mOrgCode = LemapContext.getSingleDefault().getSharedPreferences().getString("OrgCode", ""); } return mOrgCode; } /** * 获取巡检复检图片地址 * @return */ public static String getImgURL() { String imgURL = "http://172.16.17.32:8070/GetImages.ashx?w=40&h=40&id="; return imgURL; } }
87,016
0.600346
0.582631
3,015
25.062355
25.300413
133
false
false
0
0
0
0
0
0
0.279934
false
false
4
d92570a36c05968e96cc471cc00e08d17d9cc572
34,342,558,555,554
170f93685486f9c8640ef14ee085bdd8b452fb30
/src/main/java/aztech/modern_industrialization/inventory/SlotPositions.java
09ef9475fa4720864c4410afe5535e9fac007a7f
[ "MIT", "CC0-1.0" ]
permissive
AztechMC/Modern-Industrialization
https://github.com/AztechMC/Modern-Industrialization
1377d067793cb47e6b2f14e7dc2db62984fdd097
e62cf211f7cfd50e93b92be9747c99c4b7380d2a
refs/heads/master
2023-08-27T22:10:54.116000
2023-08-14T23:32:17
2023-08-14T23:32:17
285,924,283
125
109
MIT
false
2023-09-05T23:29:06
2020-08-07T21:31:08
2023-08-26T05:51:58
2023-09-05T23:29:06
12,190
107
63
28
Java
false
false
/* * MIT License * * Copyright (c) 2020 Azercoco & Technici4n * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ package aztech.modern_industrialization.inventory; import java.util.ArrayList; import java.util.Arrays; import java.util.function.Consumer; import net.minecraft.network.FriendlyByteBuf; public class SlotPositions { private final int[] x, y; private SlotPositions(int[] x, int[] y) { this.x = x; this.y = y; } public int getX(int index) { return x[index]; } public int getY(int index) { return y[index]; } public int size() { return x.length; } public void write(FriendlyByteBuf buf) { buf.writeVarIntArray(x); buf.writeVarIntArray(y); } public SlotPositions sublist(int start, int end) { return new SlotPositions(Arrays.copyOfRange(x, start, end), Arrays.copyOfRange(y, start, end)); } public Builder toBuilder() { var builder = new Builder(); for (int i = 0; i < x.length; i++) { builder.addSlot(x[i], y[i]); } return builder; } public static SlotPositions read(FriendlyByteBuf buf) { int[] x = buf.readVarIntArray(); int[] y = buf.readVarIntArray(); return new SlotPositions(x, y); } public static SlotPositions empty() { return new SlotPositions(new int[0], new int[0]); } public static class Builder { private final ArrayList<Integer> x = new ArrayList<>(); private final ArrayList<Integer> y = new ArrayList<>(); public Builder addSlot(int x, int y) { this.x.add(x); this.y.add(y); return this; } public Builder addSlots(int x, int y, int columns, int rows) { // The loop order is intended here: // We want to fill the slots horizontally first for correct insertion order. for (int i = 0; i < rows; ++i) { for (int j = 0; j < columns; ++j) { addSlot(x + j * 18, y + i * 18); } } return this; } public SlotPositions build() { return new SlotPositions(x.stream().mapToInt(x -> x).toArray(), y.stream().mapToInt(y -> y).toArray()); } public SlotPositions buildWithConsumer(Consumer<Builder> consumer) { consumer.accept(this); return build(); } } }
UTF-8
Java
3,500
java
SlotPositions.java
Java
[ { "context": "/*\n * MIT License\n *\n * Copyright (c) 2020 Azercoco & Technici4n\n *\n * Permission is hereby grant", "end": 47, "score": 0.9274990558624268, "start": 43, "tag": "NAME", "value": "Azer" }, { "context": "/*\n * MIT License\n *\n * Copyright (c) 2020 Azercoco & Technici4n\n *\n * Permission is hereby granted, ", "end": 51, "score": 0.6402044892311096, "start": 47, "tag": "USERNAME", "value": "coco" }, { "context": " * MIT License\n *\n * Copyright (c) 2020 Azercoco & Technici4n\n *\n * Permission is hereby granted, free of charg", "end": 64, "score": 0.9703506231307983, "start": 54, "tag": "USERNAME", "value": "Technici4n" } ]
null
[]
/* * MIT License * * Copyright (c) 2020 Azercoco & Technici4n * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ package aztech.modern_industrialization.inventory; import java.util.ArrayList; import java.util.Arrays; import java.util.function.Consumer; import net.minecraft.network.FriendlyByteBuf; public class SlotPositions { private final int[] x, y; private SlotPositions(int[] x, int[] y) { this.x = x; this.y = y; } public int getX(int index) { return x[index]; } public int getY(int index) { return y[index]; } public int size() { return x.length; } public void write(FriendlyByteBuf buf) { buf.writeVarIntArray(x); buf.writeVarIntArray(y); } public SlotPositions sublist(int start, int end) { return new SlotPositions(Arrays.copyOfRange(x, start, end), Arrays.copyOfRange(y, start, end)); } public Builder toBuilder() { var builder = new Builder(); for (int i = 0; i < x.length; i++) { builder.addSlot(x[i], y[i]); } return builder; } public static SlotPositions read(FriendlyByteBuf buf) { int[] x = buf.readVarIntArray(); int[] y = buf.readVarIntArray(); return new SlotPositions(x, y); } public static SlotPositions empty() { return new SlotPositions(new int[0], new int[0]); } public static class Builder { private final ArrayList<Integer> x = new ArrayList<>(); private final ArrayList<Integer> y = new ArrayList<>(); public Builder addSlot(int x, int y) { this.x.add(x); this.y.add(y); return this; } public Builder addSlots(int x, int y, int columns, int rows) { // The loop order is intended here: // We want to fill the slots horizontally first for correct insertion order. for (int i = 0; i < rows; ++i) { for (int j = 0; j < columns; ++j) { addSlot(x + j * 18, y + i * 18); } } return this; } public SlotPositions build() { return new SlotPositions(x.stream().mapToInt(x -> x).toArray(), y.stream().mapToInt(y -> y).toArray()); } public SlotPositions buildWithConsumer(Consumer<Builder> consumer) { consumer.accept(this); return build(); } } }
3,500
0.625714
0.621714
110
30.818182
28.258284
115
false
false
0
0
0
0
0
0
0.690909
false
false
4
01562d5c47ceaa9ffd477b75bd3732334ecbedf2
33,904,471,894,361
0ed64c3cae8137fc38efe0106d32fa3399f22735
/app/src/main/java/socekt/lm/socektdemo/ui/ChatActivity.java
801b4a396f4e6506eaaa53ed6da8592de681941c
[]
no_license
liming1993101/IM
https://github.com/liming1993101/IM
a01817b898f41484737aec67012f1f540768666e
810b944764af746030681818aebf1e159642fcb6
refs/heads/master
2021-01-19T05:30:02.006000
2016-07-11T06:57:03
2016-07-11T06:57:03
63,043,885
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package socekt.lm.socektdemo.ui; /** * Created by Administrator on 2016/6/21. */ import android.content.ContentValues; import android.content.Intent; import android.database.Cursor; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.media.MediaPlayer; import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.os.Environment; import android.provider.MediaStore; import android.support.annotation.Nullable; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; import com.way.chat.common.bean.User; import com.way.chat.common.tran.bean.TranObject; import com.way.chat.common.tran.bean.TranObjectType; import java.io.File; import java.util.ArrayList; import java.util.Collections; import java.util.List; import socekt.lm.socektdemo.R; import socekt.lm.socektdemo.adapter.ChatMsgAdapter; import com.way.chat.common.bean.TextMessage; import socekt.lm.socektdemo.clients.Client; import socekt.lm.socektdemo.clients.ClientOutputThread; import socekt.lm.socektdemo.entity.ChatMsgEntity; import socekt.lm.socektdemo.entity.RecentChatEntity; import socekt.lm.socektdemo.utils.Constants; import socekt.lm.socektdemo.utils.MessageDB; import socekt.lm.socektdemo.utils.MyApplication; import socekt.lm.socektdemo.utils.MyDate; import socekt.lm.socektdemo.utils.RecentContactsDB; import socekt.lm.socektdemo.utils.SharePreferenceUtil; import socekt.lm.socektdemo.utils.UserDB; public class ChatActivity extends MyActivity implements View.OnClickListener{ private EditText mSendEt; private TextView backBt; private TextView chatName; private Button sendBt; private ListView messageList; private MessageDB messageDB; private MyApplication myApplication; private User user; private UserDB userDB; private ImageView mSendPhoto; private ImageView mSendCamera; private Uri photoUri; private SharePreferenceUtil util; private List<ChatMsgEntity>chatMsgList=new ArrayList<ChatMsgEntity>(); private ChatMsgAdapter adapter; private String picPath; /** 使用照相机拍照获取图片 */ public static final int SELECT_PIC_BY_TACK_PHOTO = 1; /** 使用相册中的图片 */ public static final int SELECT_PIC_BY_PICK_PHOTO = 2; /** 获取到的图片路径 */ @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_chat); myApplication= (MyApplication) getApplicationContext(); messageDB=new MessageDB(this); userDB=new UserDB(this); user= (User) getIntent().getSerializableExtra("user"); util=new SharePreferenceUtil(this, Constants.SAVE_USER); initView(); initData(); } private void initView() { mSendPhoto= (ImageView) findViewById(R.id.send_photo); mSendCamera= (ImageView) findViewById(R.id.send_camera); mSendEt= (EditText) findViewById(R.id.chat_editmessage); backBt= (TextView) findViewById(R.id.chat_back); chatName= (TextView) findViewById(R.id.chat_name); sendBt= (Button) findViewById(R.id.chat_send); messageList= (ListView) findViewById(R.id.chat_listview); sendBt.setOnClickListener(this); mSendPhoto.setOnClickListener(this); mSendCamera.setOnClickListener(this); } public void initData() { chatName.setText(util.getName()); List<ChatMsgEntity>chat=messageDB.getMsg(user.getId()); if (chat.size() > 0) { for (ChatMsgEntity entity : chat) { if (entity.getName().equals("")) { entity.setName(user.getName()); } if (entity.getImg() < 0) { entity.setImg(user.getImg()); } chatMsgList.add(entity); } Collections.reverse(chatMsgList); } adapter=new ChatMsgAdapter(this,chatMsgList); messageList.setAdapter(adapter); messageList.setSelection(chatMsgList.size()-1); } @Override public void getMessage(TranObject msg) { switch (msg.getType()) { case MESSAGE: TextMessage tm= (TextMessage) msg.getObject(); String message=tm.getMessage(); ChatMsgEntity entity=new ChatMsgEntity(user.getName(), MyDate.getDateEN(), message, user.getImg(), true); if (msg.getFromUser()==user.getId()||msg.getFromUser()==0) { messageDB.savaMsg(user.getId(),entity); chatMsgList.add(entity); adapter.notifyDataSetChanged(); messageList.setSelection(chatMsgList.size()-1); MediaPlayer.create(this, R.raw.msg).start(); } else { messageDB.savaMsg(msg.getFromUser(),entity); MediaPlayer.create(this, R.raw.msg).start(); } TextMessage tMessage= (TextMessage) msg.getObject(); String message1=tMessage.getMessage(); ChatMsgEntity entity3=new ChatMsgEntity("", MyDate.getDateEN() ,message,-1,true);//收到的消息 messageDB.savaMsg(msg.getFromUser(),entity3); User user=userDB.selectInfo(msg.getFromUser()); RecentChatEntity entity1=new RecentChatEntity(msg.getFromUser() ,user.getImg(),0,user.getName(),MyDate.getDate(),message1); MyApplication.getmRecentAdapter().remove(entity1);// 先移除该对象,目的是添加到首部 MyApplication.getmRecentList().addFirst(entity1);// 再添加到首部 MyApplication.getmRecentAdapter().notifyDataSetChanged(); RecentContactsDB recentContactsDB=new RecentContactsDB(ChatActivity.this); recentContactsDB.savaRctContacts(entity1); recentContactsDB.colse(); break; case LOGIN: User loginUser= (User) msg.getObject(); Toast.makeText(ChatActivity.this,"你的好友"+loginUser.getId()+"上线了",Toast.LENGTH_SHORT).show(); break; case LOGOUT: User login0utUser= (User) msg.getObject(); Toast.makeText(ChatActivity.this,"你的好友"+login0utUser.getId()+"下线了",Toast.LENGTH_SHORT).show(); break; default: break; } } @Override public void onClick(View view) { switch (view.getId()) { case R.id.chat_send: sendMessage(1); break; case R.id.send_photo: pickPhoto(); break; case R.id.send_camera: takePhoto(); break; } } /* * 向服务器发送消息 */ private void sendMessage(int type) { String sendContent=mSendEt.getText().toString(); ChatMsgEntity entity=new ChatMsgEntity(); entity.setDate(MyDate.getDateEN()); entity.setName(util.getName()); entity.setImg(util.getImg()); entity.setMsgType(false); if (type==1) { entity.setMessage(sendContent); } else { entity.setMessage("图片"); } messageDB.savaMsg(user.getId(),entity); chatMsgList.add(entity); adapter.notifyDataSetChanged(); mSendEt.setText(""); messageList.setSelection(chatMsgList.size()-1); MyApplication application= (MyApplication) this.getApplicationContext(); Client client=application.getClient(); ClientOutputThread out =client.getClientOutputThread(); if (out!=null) { TranObject<TextMessage>o; TextMessage message=new TextMessage(); if (type==1) { o=new TranObject<TextMessage>(TranObjectType.MESSAGE); message.setMessage(sendContent); } else { o=new TranObject<TextMessage>(TranObjectType.IMG); File file=new File(picPath); message.setImg(file); } o.setObject(message); o.setFromUser(Integer.parseInt(util.getId())); o.setToUser(user.getId()); out.setMsg(o); } RecentChatEntity entity1=new RecentChatEntity(user.getId() ,user.getImg(), 0, user.getName(), MyDate.getDate(), sendContent); application.getmRecentList().remove(entity1); application.getmRecentList().addFirst(entity1); application.getmRecentAdapter().notifyDataSetChanged(); } /** * 拍照获取图片 */ private void takePhoto() { // 执行拍照前,应该先判断SD卡是否存在 String SDState = Environment.getExternalStorageState(); if (SDState.equals(Environment.MEDIA_MOUNTED)) { Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); /*** * 需要说明一下,以下操作使用照相机拍照,拍照后的图片会存放在相册中的 * 这里使用的这种方式有一个好处就是获取的图片是拍照后的原图 * 如果不使用ContentValues存放照片路径的话,拍照后获取的图片为缩略图不清晰 */ ContentValues values = new ContentValues(); photoUri = getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values); intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, photoUri); startActivityForResult(intent, SELECT_PIC_BY_TACK_PHOTO); } else { Toast.makeText(this, "内存卡不存在", Toast.LENGTH_LONG).show(); } } /* * 重相册中选取照片 */ private void pickPhoto() { Intent intent = new Intent(); // 如果要限制上传到服务器的图片类型时可以直接写如:"image/jpeg 、 image/png等的类型" intent.setType("image/*"); intent.setAction(Intent.ACTION_GET_CONTENT); startActivityForResult(intent, SELECT_PIC_BY_PICK_PHOTO); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if(resultCode == RESULT_CANCELED){ return; } // 可以使用同一个方法,这里分开写为了防止以后扩展不同的需求 switch (requestCode) { case SELECT_PIC_BY_PICK_PHOTO:// 如果是直接从相册获取 doPhoto(requestCode, data); break; case SELECT_PIC_BY_TACK_PHOTO:// 如果是调用相机拍照时 doPhoto(requestCode, data); break; } super.onActivityResult(requestCode, resultCode, data); } private void doPhoto(int requestCode, Intent data) { // 从相册取图片,有些手机有异常情况,请注意 if (requestCode == SELECT_PIC_BY_PICK_PHOTO) { if (data == null) { Toast.makeText(this, "选择图片文件出错", Toast.LENGTH_LONG).show(); return; } photoUri = data.getData(); if (photoUri == null) { Toast.makeText(this, "选择图片文件出错", Toast.LENGTH_LONG).show(); return; } } String[] pojo = { MediaStore.MediaColumns.DATA }; // The method managedQuery() from the type Activity is deprecated //Cursor cursor = managedQuery(photoUri, pojo, null, null, null); Cursor cursor = this.getContentResolver().query(photoUri, pojo, null, null, null); if (cursor != null) { int columnIndex = cursor.getColumnIndexOrThrow(pojo[0]); cursor.moveToFirst(); picPath = cursor.getString(columnIndex); // 4.0以上的版本会自动关闭 (4.0--14;; 4.0.3--15) if (Integer.parseInt(Build.VERSION.SDK) < 14) { cursor.close(); } } // 如果图片符合要求将其上传到服务器 if (picPath != null && ( picPath.endsWith(".png") || picPath.endsWith(".PNG") || picPath.endsWith(".jpg") || picPath.endsWith(".JPG"))) { BitmapFactory.Options option = new BitmapFactory.Options(); // 压缩图片:表示缩略图大小为原始图片大小的几分之一,1为原图 option.inSampleSize = 1; // 根据图片的SDCard路径读出Bitmap Bitmap bm = BitmapFactory.decodeFile(picPath, option); // 显示在图片控件上 } else { Toast.makeText(this, "选择图片文件不正确", Toast.LENGTH_LONG).show(); } sendMessage(2); } }
UTF-8
Java
13,231
java
ChatActivity.java
Java
[ { "context": "ackage socekt.lm.socektdemo.ui;\n\n/**\n * Created by Administrator on 2016/6/21.\n */\n\nimport android.content.Content", "end": 65, "score": 0.8899985551834106, "start": 52, "tag": "NAME", "value": "Administrator" } ]
null
[]
package socekt.lm.socektdemo.ui; /** * Created by Administrator on 2016/6/21. */ import android.content.ContentValues; import android.content.Intent; import android.database.Cursor; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.media.MediaPlayer; import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.os.Environment; import android.provider.MediaStore; import android.support.annotation.Nullable; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; import com.way.chat.common.bean.User; import com.way.chat.common.tran.bean.TranObject; import com.way.chat.common.tran.bean.TranObjectType; import java.io.File; import java.util.ArrayList; import java.util.Collections; import java.util.List; import socekt.lm.socektdemo.R; import socekt.lm.socektdemo.adapter.ChatMsgAdapter; import com.way.chat.common.bean.TextMessage; import socekt.lm.socektdemo.clients.Client; import socekt.lm.socektdemo.clients.ClientOutputThread; import socekt.lm.socektdemo.entity.ChatMsgEntity; import socekt.lm.socektdemo.entity.RecentChatEntity; import socekt.lm.socektdemo.utils.Constants; import socekt.lm.socektdemo.utils.MessageDB; import socekt.lm.socektdemo.utils.MyApplication; import socekt.lm.socektdemo.utils.MyDate; import socekt.lm.socektdemo.utils.RecentContactsDB; import socekt.lm.socektdemo.utils.SharePreferenceUtil; import socekt.lm.socektdemo.utils.UserDB; public class ChatActivity extends MyActivity implements View.OnClickListener{ private EditText mSendEt; private TextView backBt; private TextView chatName; private Button sendBt; private ListView messageList; private MessageDB messageDB; private MyApplication myApplication; private User user; private UserDB userDB; private ImageView mSendPhoto; private ImageView mSendCamera; private Uri photoUri; private SharePreferenceUtil util; private List<ChatMsgEntity>chatMsgList=new ArrayList<ChatMsgEntity>(); private ChatMsgAdapter adapter; private String picPath; /** 使用照相机拍照获取图片 */ public static final int SELECT_PIC_BY_TACK_PHOTO = 1; /** 使用相册中的图片 */ public static final int SELECT_PIC_BY_PICK_PHOTO = 2; /** 获取到的图片路径 */ @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_chat); myApplication= (MyApplication) getApplicationContext(); messageDB=new MessageDB(this); userDB=new UserDB(this); user= (User) getIntent().getSerializableExtra("user"); util=new SharePreferenceUtil(this, Constants.SAVE_USER); initView(); initData(); } private void initView() { mSendPhoto= (ImageView) findViewById(R.id.send_photo); mSendCamera= (ImageView) findViewById(R.id.send_camera); mSendEt= (EditText) findViewById(R.id.chat_editmessage); backBt= (TextView) findViewById(R.id.chat_back); chatName= (TextView) findViewById(R.id.chat_name); sendBt= (Button) findViewById(R.id.chat_send); messageList= (ListView) findViewById(R.id.chat_listview); sendBt.setOnClickListener(this); mSendPhoto.setOnClickListener(this); mSendCamera.setOnClickListener(this); } public void initData() { chatName.setText(util.getName()); List<ChatMsgEntity>chat=messageDB.getMsg(user.getId()); if (chat.size() > 0) { for (ChatMsgEntity entity : chat) { if (entity.getName().equals("")) { entity.setName(user.getName()); } if (entity.getImg() < 0) { entity.setImg(user.getImg()); } chatMsgList.add(entity); } Collections.reverse(chatMsgList); } adapter=new ChatMsgAdapter(this,chatMsgList); messageList.setAdapter(adapter); messageList.setSelection(chatMsgList.size()-1); } @Override public void getMessage(TranObject msg) { switch (msg.getType()) { case MESSAGE: TextMessage tm= (TextMessage) msg.getObject(); String message=tm.getMessage(); ChatMsgEntity entity=new ChatMsgEntity(user.getName(), MyDate.getDateEN(), message, user.getImg(), true); if (msg.getFromUser()==user.getId()||msg.getFromUser()==0) { messageDB.savaMsg(user.getId(),entity); chatMsgList.add(entity); adapter.notifyDataSetChanged(); messageList.setSelection(chatMsgList.size()-1); MediaPlayer.create(this, R.raw.msg).start(); } else { messageDB.savaMsg(msg.getFromUser(),entity); MediaPlayer.create(this, R.raw.msg).start(); } TextMessage tMessage= (TextMessage) msg.getObject(); String message1=tMessage.getMessage(); ChatMsgEntity entity3=new ChatMsgEntity("", MyDate.getDateEN() ,message,-1,true);//收到的消息 messageDB.savaMsg(msg.getFromUser(),entity3); User user=userDB.selectInfo(msg.getFromUser()); RecentChatEntity entity1=new RecentChatEntity(msg.getFromUser() ,user.getImg(),0,user.getName(),MyDate.getDate(),message1); MyApplication.getmRecentAdapter().remove(entity1);// 先移除该对象,目的是添加到首部 MyApplication.getmRecentList().addFirst(entity1);// 再添加到首部 MyApplication.getmRecentAdapter().notifyDataSetChanged(); RecentContactsDB recentContactsDB=new RecentContactsDB(ChatActivity.this); recentContactsDB.savaRctContacts(entity1); recentContactsDB.colse(); break; case LOGIN: User loginUser= (User) msg.getObject(); Toast.makeText(ChatActivity.this,"你的好友"+loginUser.getId()+"上线了",Toast.LENGTH_SHORT).show(); break; case LOGOUT: User login0utUser= (User) msg.getObject(); Toast.makeText(ChatActivity.this,"你的好友"+login0utUser.getId()+"下线了",Toast.LENGTH_SHORT).show(); break; default: break; } } @Override public void onClick(View view) { switch (view.getId()) { case R.id.chat_send: sendMessage(1); break; case R.id.send_photo: pickPhoto(); break; case R.id.send_camera: takePhoto(); break; } } /* * 向服务器发送消息 */ private void sendMessage(int type) { String sendContent=mSendEt.getText().toString(); ChatMsgEntity entity=new ChatMsgEntity(); entity.setDate(MyDate.getDateEN()); entity.setName(util.getName()); entity.setImg(util.getImg()); entity.setMsgType(false); if (type==1) { entity.setMessage(sendContent); } else { entity.setMessage("图片"); } messageDB.savaMsg(user.getId(),entity); chatMsgList.add(entity); adapter.notifyDataSetChanged(); mSendEt.setText(""); messageList.setSelection(chatMsgList.size()-1); MyApplication application= (MyApplication) this.getApplicationContext(); Client client=application.getClient(); ClientOutputThread out =client.getClientOutputThread(); if (out!=null) { TranObject<TextMessage>o; TextMessage message=new TextMessage(); if (type==1) { o=new TranObject<TextMessage>(TranObjectType.MESSAGE); message.setMessage(sendContent); } else { o=new TranObject<TextMessage>(TranObjectType.IMG); File file=new File(picPath); message.setImg(file); } o.setObject(message); o.setFromUser(Integer.parseInt(util.getId())); o.setToUser(user.getId()); out.setMsg(o); } RecentChatEntity entity1=new RecentChatEntity(user.getId() ,user.getImg(), 0, user.getName(), MyDate.getDate(), sendContent); application.getmRecentList().remove(entity1); application.getmRecentList().addFirst(entity1); application.getmRecentAdapter().notifyDataSetChanged(); } /** * 拍照获取图片 */ private void takePhoto() { // 执行拍照前,应该先判断SD卡是否存在 String SDState = Environment.getExternalStorageState(); if (SDState.equals(Environment.MEDIA_MOUNTED)) { Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); /*** * 需要说明一下,以下操作使用照相机拍照,拍照后的图片会存放在相册中的 * 这里使用的这种方式有一个好处就是获取的图片是拍照后的原图 * 如果不使用ContentValues存放照片路径的话,拍照后获取的图片为缩略图不清晰 */ ContentValues values = new ContentValues(); photoUri = getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values); intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, photoUri); startActivityForResult(intent, SELECT_PIC_BY_TACK_PHOTO); } else { Toast.makeText(this, "内存卡不存在", Toast.LENGTH_LONG).show(); } } /* * 重相册中选取照片 */ private void pickPhoto() { Intent intent = new Intent(); // 如果要限制上传到服务器的图片类型时可以直接写如:"image/jpeg 、 image/png等的类型" intent.setType("image/*"); intent.setAction(Intent.ACTION_GET_CONTENT); startActivityForResult(intent, SELECT_PIC_BY_PICK_PHOTO); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if(resultCode == RESULT_CANCELED){ return; } // 可以使用同一个方法,这里分开写为了防止以后扩展不同的需求 switch (requestCode) { case SELECT_PIC_BY_PICK_PHOTO:// 如果是直接从相册获取 doPhoto(requestCode, data); break; case SELECT_PIC_BY_TACK_PHOTO:// 如果是调用相机拍照时 doPhoto(requestCode, data); break; } super.onActivityResult(requestCode, resultCode, data); } private void doPhoto(int requestCode, Intent data) { // 从相册取图片,有些手机有异常情况,请注意 if (requestCode == SELECT_PIC_BY_PICK_PHOTO) { if (data == null) { Toast.makeText(this, "选择图片文件出错", Toast.LENGTH_LONG).show(); return; } photoUri = data.getData(); if (photoUri == null) { Toast.makeText(this, "选择图片文件出错", Toast.LENGTH_LONG).show(); return; } } String[] pojo = { MediaStore.MediaColumns.DATA }; // The method managedQuery() from the type Activity is deprecated //Cursor cursor = managedQuery(photoUri, pojo, null, null, null); Cursor cursor = this.getContentResolver().query(photoUri, pojo, null, null, null); if (cursor != null) { int columnIndex = cursor.getColumnIndexOrThrow(pojo[0]); cursor.moveToFirst(); picPath = cursor.getString(columnIndex); // 4.0以上的版本会自动关闭 (4.0--14;; 4.0.3--15) if (Integer.parseInt(Build.VERSION.SDK) < 14) { cursor.close(); } } // 如果图片符合要求将其上传到服务器 if (picPath != null && ( picPath.endsWith(".png") || picPath.endsWith(".PNG") || picPath.endsWith(".jpg") || picPath.endsWith(".JPG"))) { BitmapFactory.Options option = new BitmapFactory.Options(); // 压缩图片:表示缩略图大小为原始图片大小的几分之一,1为原图 option.inSampleSize = 1; // 根据图片的SDCard路径读出Bitmap Bitmap bm = BitmapFactory.decodeFile(picPath, option); // 显示在图片控件上 } else { Toast.makeText(this, "选择图片文件不正确", Toast.LENGTH_LONG).show(); } sendMessage(2); } }
13,231
0.605016
0.600916
352
34.34375
23.672085
110
false
false
0
0
0
0
0
0
0.730114
false
false
4
0c55ddedb33973913afcbc7ce5b695efdcae7430
16,681,653,038,890
8b378cd442eee04c6802e17b357e08d8368bea72
/bs-nethospital-common/src/main/java/com/bsoft/platform/model/MdcDrugremind.java
2809796a057f9d4da2afe2e3fb41376a0c3cb003
[]
no_license
wuming1805/common_hs
https://github.com/wuming1805/common_hs
3062c8fb4ed6403b04f9fbe9c7dbb8b1a5f986d6
761f8d97ef791e644f20dd3437503dd0416a8d8d
refs/heads/master
2020-08-09T18:02:08.470000
2020-05-13T06:12:43
2020-05-13T06:12:43
214,138,637
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.bsoft.platform.model; import com.bsoft.platform.core.BaseDO; import org.springframework.util.StringUtils; import java.util.Date; public class MdcDrugremind extends BaseDO { private Long id; private String username; private String medname; private Integer drugrepeat; private Integer times; private String timesde; private Date begindate; private Integer days; private String isremind; private Long uid; private Date updatetime; private Date creattime; private String busbegindate; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username == null ? null : username.trim(); } public String getMedname() { return medname; } public void setMedname(String medname) { this.medname = medname == null ? null : medname.trim(); } public Integer getDrugrepeat() { return drugrepeat; } public void setDrugrepeat(Integer drugrepeat) { this.drugrepeat = drugrepeat; } public Integer getTimes() { return times; } public void setTimes(Integer times) { this.times = times; } public String getTimesde() { return timesde; } public void setTimesde(String timesde) { this.timesde = timesde == null ? null : timesde.trim(); } public Date getBegindate() { return begindate; } public void setBegindate(Date begindate) { this.begindate = begindate; } public Integer getDays() { return days; } public void setDays(Integer days) { this.days = days; } public String getIsremind() { return isremind; } public void setIsremind(String isremind) { this.isremind = isremind == null ? null : isremind.trim(); } public Long getUid() { return uid; } public void setUid(Long uid) { this.uid = uid; } public Date getUpdatetime() { return updatetime; } public void setUpdatetime(Date updatetime) { this.updatetime = updatetime; } public Date getCreattime() { return creattime; } public void setCreattime(Date creattime) { this.creattime = creattime; } public String getBusbegindate() { return busbegindate; } @SuppressWarnings("deprecation") public void setBusbegindate(String busbegindate) { if(StringUtils.hasText(busbegindate)){ this.begindate=new Date(busbegindate.replaceAll("-", "/")); } this.busbegindate = busbegindate; } }
UTF-8
Java
2,741
java
MdcDrugremind.java
Java
[]
null
[]
package com.bsoft.platform.model; import com.bsoft.platform.core.BaseDO; import org.springframework.util.StringUtils; import java.util.Date; public class MdcDrugremind extends BaseDO { private Long id; private String username; private String medname; private Integer drugrepeat; private Integer times; private String timesde; private Date begindate; private Integer days; private String isremind; private Long uid; private Date updatetime; private Date creattime; private String busbegindate; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username == null ? null : username.trim(); } public String getMedname() { return medname; } public void setMedname(String medname) { this.medname = medname == null ? null : medname.trim(); } public Integer getDrugrepeat() { return drugrepeat; } public void setDrugrepeat(Integer drugrepeat) { this.drugrepeat = drugrepeat; } public Integer getTimes() { return times; } public void setTimes(Integer times) { this.times = times; } public String getTimesde() { return timesde; } public void setTimesde(String timesde) { this.timesde = timesde == null ? null : timesde.trim(); } public Date getBegindate() { return begindate; } public void setBegindate(Date begindate) { this.begindate = begindate; } public Integer getDays() { return days; } public void setDays(Integer days) { this.days = days; } public String getIsremind() { return isremind; } public void setIsremind(String isremind) { this.isremind = isremind == null ? null : isremind.trim(); } public Long getUid() { return uid; } public void setUid(Long uid) { this.uid = uid; } public Date getUpdatetime() { return updatetime; } public void setUpdatetime(Date updatetime) { this.updatetime = updatetime; } public Date getCreattime() { return creattime; } public void setCreattime(Date creattime) { this.creattime = creattime; } public String getBusbegindate() { return busbegindate; } @SuppressWarnings("deprecation") public void setBusbegindate(String busbegindate) { if(StringUtils.hasText(busbegindate)){ this.begindate=new Date(busbegindate.replaceAll("-", "/")); } this.busbegindate = busbegindate; } }
2,741
0.624225
0.624225
142
18.309858
18.031343
66
false
false
0
0
0
0
0
0
0.429577
false
false
4
0c3513c2c6e44c2c84926ccddb069524eb1c9a22
8,546,984,938,221
24bdca2af684f5beb2bdd9d4fd70d1e84e2aec13
/src/main/java/com/techlooper/model/SkillStatisticRequest.java
23e2163c95f26831428757097d054baa2644e0c6
[]
no_license
mobject/TechLooper
https://github.com/mobject/TechLooper
45484d05c00ea0a48db2c777f51554f5b0fee93e
1a0fc0d96691327f7633ded8f0b9f2d94e9ef1d2
refs/heads/master
2021-01-15T14:47:46.982000
2014-11-21T02:09:49
2014-11-21T02:09:49
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.techlooper.model; import java.util.List; /** * Created by NguyenDangKhoa on 11/4/14. */ public class SkillStatisticRequest { private TechnicalTermEnum term; private HistogramEnum[] histograms; public HistogramEnum[] getHistograms() { return histograms; } public void setHistograms(HistogramEnum[] histograms) { this.histograms = histograms; } public TechnicalTermEnum getTerm() { return term; } public void setTerm(TechnicalTermEnum term) { this.term = term; } }
UTF-8
Java
556
java
SkillStatisticRequest.java
Java
[ { "context": ".model;\n\nimport java.util.List;\n\n/**\n * Created by NguyenDangKhoa on 11/4/14.\n */\npublic class SkillStatisticReques", "end": 87, "score": 0.9891037940979004, "start": 73, "tag": "NAME", "value": "NguyenDangKhoa" } ]
null
[]
package com.techlooper.model; import java.util.List; /** * Created by NguyenDangKhoa on 11/4/14. */ public class SkillStatisticRequest { private TechnicalTermEnum term; private HistogramEnum[] histograms; public HistogramEnum[] getHistograms() { return histograms; } public void setHistograms(HistogramEnum[] histograms) { this.histograms = histograms; } public TechnicalTermEnum getTerm() { return term; } public void setTerm(TechnicalTermEnum term) { this.term = term; } }
556
0.667266
0.658273
29
18.206896
18.533064
59
false
false
0
0
0
0
0
0
0.275862
false
false
12
973b0bd2926d829654ff976bf639722db5a5df9a
30,322,469,131,516
5fa8f6565959824136c5825684a0676f6a55f0ce
/cases/src/org/commcare/cases/model/CaseIndex.java
009c86f9586ee0caef588666fbac198dcf931a99
[ "Apache-2.0" ]
permissive
wpride/commcare
https://github.com/wpride/commcare
e5b4117313146dc774497ed816a833cf8a3536fc
365577220432faf5dd0aaa18e11ec54223a59f7c
refs/heads/master
2020-05-20T08:36:26.144000
2014-07-23T17:58:06
2014-07-23T17:58:06
22,166,350
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
/** * */ package org.commcare.cases.model; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import org.javarosa.core.util.externalizable.DeserializationException; import org.javarosa.core.util.externalizable.ExtUtil; import org.javarosa.core.util.externalizable.Externalizable; import org.javarosa.core.util.externalizable.PrototypeFactory; /** * @author ctsims * */ public class CaseIndex implements Externalizable { private String name; private String targetId; private String targetCaseType; /* * serialization only! */ public CaseIndex() { } public CaseIndex(String name, String targetCaseType, String targetId) { this.name = name; this.targetId = targetId; this.targetCaseType = targetCaseType; } /* (non-Javadoc) * @see org.javarosa.core.util.externalizable.Externalizable#readExternal(java.io.DataInputStream, org.javarosa.core.util.externalizable.PrototypeFactory) */ public void readExternal(DataInputStream in, PrototypeFactory pf) throws IOException, DeserializationException { name = ExtUtil.readString(in); targetId = ExtUtil.readString(in); targetCaseType = ExtUtil.readString(in); } /* (non-Javadoc) * @see org.javarosa.core.util.externalizable.Externalizable#writeExternal(java.io.DataOutputStream) */ public void writeExternal(DataOutputStream out) throws IOException { ExtUtil.writeString(out, name); ExtUtil.writeString(out, targetId); ExtUtil.writeString(out, targetCaseType); } public String getName() { return name; } public String getTargetType() { return targetCaseType; } public String getTarget() { return targetId; } }
UTF-8
Java
1,670
java
CaseIndex.java
Java
[ { "context": "l.externalizable.PrototypeFactory;\n\n/**\n * @author ctsims\n *\n */\npublic class CaseIndex implements External", "end": 412, "score": 0.9996469616889954, "start": 406, "tag": "USERNAME", "value": "ctsims" } ]
null
[]
/** * */ package org.commcare.cases.model; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import org.javarosa.core.util.externalizable.DeserializationException; import org.javarosa.core.util.externalizable.ExtUtil; import org.javarosa.core.util.externalizable.Externalizable; import org.javarosa.core.util.externalizable.PrototypeFactory; /** * @author ctsims * */ public class CaseIndex implements Externalizable { private String name; private String targetId; private String targetCaseType; /* * serialization only! */ public CaseIndex() { } public CaseIndex(String name, String targetCaseType, String targetId) { this.name = name; this.targetId = targetId; this.targetCaseType = targetCaseType; } /* (non-Javadoc) * @see org.javarosa.core.util.externalizable.Externalizable#readExternal(java.io.DataInputStream, org.javarosa.core.util.externalizable.PrototypeFactory) */ public void readExternal(DataInputStream in, PrototypeFactory pf) throws IOException, DeserializationException { name = ExtUtil.readString(in); targetId = ExtUtil.readString(in); targetCaseType = ExtUtil.readString(in); } /* (non-Javadoc) * @see org.javarosa.core.util.externalizable.Externalizable#writeExternal(java.io.DataOutputStream) */ public void writeExternal(DataOutputStream out) throws IOException { ExtUtil.writeString(out, name); ExtUtil.writeString(out, targetId); ExtUtil.writeString(out, targetCaseType); } public String getName() { return name; } public String getTargetType() { return targetCaseType; } public String getTarget() { return targetId; } }
1,670
0.762874
0.762874
68
23.558823
29.516388
155
false
false
0
0
0
0
0
0
1.264706
false
false
12