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
db377e5da72e520cabcaf6868b3c62ab72f97bb0
5,446,018,545,728
d99b9939961b8b62014523bb8275613ae2cb4c88
/src/Survey.java
6696b5b6d403d3a612b9e6f316cb1714d7f3f075
[]
no_license
rsd477/object_oriented_project
https://github.com/rsd477/object_oriented_project
7ace2e7e610004faaba94fbe6b8dc4ee621009d8
dd1511576ac44e5ccf58d5d5251e0ddf22ae6cc4
refs/heads/master
2023-08-31T20:26:46.861000
2021-10-19T01:06:37
2021-10-19T01:06:37
418,719,352
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
// Richard Scott // 10/26/2020 // Survey - Adding questions, // saving and loading surveys, // displaying and taking them import java.io.File; import java.util.ArrayList; import java.util.Hashtable; import java.util.List; import java.util.TreeMap; public class Survey implements java.io.Serializable{ private static final long serialVersionUID = 76664924001143L; String surveyName; List<Question> savedQuestions; public Survey(String surveyName){ this.surveyName = surveyName; this.savedQuestions = new ArrayList<>(); } public String getName(){ return this.surveyName; } public int size(){ return this.savedQuestions.size(); } public void addQuestion(int type){ Question temp; switch(type){ case 1: temp = new True_False(); break; case 2: temp = new Multiple_Choice(); break; case 3: temp = new Short_Answer(); break; case 4: temp = new Essay(); break; case 5: temp = new Valid_Date(); break; case 6: temp = new Matching(); break; default: Output.print("Survey:43 THIS SHOULDN'T HAPPEN"); // if this is thrown, retire return; } temp.add(); this.savedQuestions.add(temp); } public void modifyQuestion(int question){ if(this.savedQuestions.size() < question){ Output.print("\u001B[31mThere aren't "+ question +" questions in the survey at this time\u001B[0m\n"); } else if(question < 1){ Output.print("\u001B[31mIndex must be greater than 0\u001B[0m\n"); } else { this.savedQuestions.get(question - 1).modify(); } } public void displaySurvey(){ for(int i = 0; i < this.savedQuestions.size(); i++){ Output.print((i+1) + ") "); this.savedQuestions.get(i).display(); Output.print("\n"); } } public void save(Survey in, String outPath){ Output.serialize(in, outPath); } public Survey load(String filePath){ return Input.deserialize(filePath); } public UserResponse takeSurvey(){ UserResponse temp = new UserResponse(); for(int i = 0; i < this.savedQuestions.size(); i++){ Output.print((i+1) + ") "); temp.addResponse(this.savedQuestions.get(i).take()); // Basically add a response to each question Output.print("\n"); } return(temp); } public void tabulateResults(String[] filePaths, String headerPath){ List<UserResponse> responses = new ArrayList<>(); UserResponse temp; for(int i=0;i<filePaths.length;i++){ temp = Input.deserialize(headerPath + File.separator + filePaths[i]); responses.add(temp); } int userResponseIndex = 0; Output.print("\n\n\n"); for(int i=0;i<savedQuestions.size();i++){ if(savedQuestions.get(i) instanceof True_False){ Output.print("Question:\n"); int c1=0; int c2=0; savedQuestions.get(i).display(); Output.print("\nResponses:\n"); for(int j=0;j<filePaths.length;j++){ Output.print(responses.get(j).getResponse(userResponseIndex)+ "\n"); if(responses.get(j).getResponse(userResponseIndex).equals("T")){ c1++; } else { c2++; } } Output.print("\nTabulation:\n"); Output.print("True: " + c1 + "\nFalse: " + c2); Output.print("\n\n\n"); userResponseIndex++; } else if(savedQuestions.get(i) instanceof Multiple_Choice){ Output.print("Question:\n"); savedQuestions.get(i).display(); int choices = ((Multiple_Choice) savedQuestions.get(i)).getAmtQs(); int[] ans = new int[choices]; Output.print("\nReplies:\n"); for(int j=0;j<filePaths.length;j++){ Output.print(responses.get(j).getResponse(userResponseIndex)+ "\n"); String[] splitAns = responses.get(j).getResponse(userResponseIndex).split("\\s\\s"); for(int o = 0; o< splitAns.length;o++){ ans[splitAns[o].charAt(0)-'A']++; } } Output.print("\nTabulation:\n"); for(int k=0; k<choices; k++){ Output.print(Character.toString((char)('A'+k)) + ": " + ans[k] + "\n"); } Output.print("\n\n\n"); userResponseIndex++; } else if(savedQuestions.get(i) instanceof Short_Answer){ String in; int count = 0; Hashtable<String, Integer> counter = new Hashtable<String, Integer>(); Output.print("Question:\n"); savedQuestions.get(i).display(); Output.print("\nResponses:\n"); for(int j=0;j<filePaths.length;j++){ in = responses.get(j).getResponse(userResponseIndex); Output.print(in + "\n"); if(!counter.containsKey(in)){ counter.put(in, 1); } else { count = counter.get(in); counter.put(in, ++count); } } Output.print("\nTabulation:\n"); for(String s:counter.keySet()) { Output.print(s + " " + counter.get(s)+ "\n"); } Output.print("\n\n\n"); userResponseIndex++; } else if(savedQuestions.get(i) instanceof Essay){ Output.print("Question:\n"); savedQuestions.get(i).display(); Output.print("\nResponses:\n"); for(int j=0;j<filePaths.length;j++){ Output.print(responses.get(j).getResponse(userResponseIndex)+ "\n\n"); } Output.print("\nTabulation:\n"); for(int j=0;j<filePaths.length;j++){ Output.print(responses.get(j).getResponse(userResponseIndex)+ "\n\n"); } Output.print("\n\n\n"); userResponseIndex++; } else if(savedQuestions.get(i) instanceof Valid_Date){ String in; int count = 0; Hashtable<String, Integer> counter = new Hashtable<String, Integer>(); Output.print("Question:\n"); savedQuestions.get(i).display(); Output.print("\nResponses:\n"); for(int j=0;j<filePaths.length;j++){ in = responses.get(j).getResponse(userResponseIndex); Output.print(in + "\n"); if(!counter.containsKey(in)){ counter.put(in, 1); } else { count = counter.get(in); counter.put(in, ++count); } } Output.print("\nTabulation:\n"); for(String s:counter.keySet()) { Output.print(s + "\n" + counter.get(s)+ "\n\n"); } Output.print("\n\n\n"); userResponseIndex++; } else if(savedQuestions.get(i) instanceof Matching){ String in; int count = 0; Hashtable<String, Integer> counter = new Hashtable<String, Integer>(); Output.print("Question:\n"); savedQuestions.get(i).display(); Output.print("\nResponses:\n"); for(int j=0;j<filePaths.length;j++){ in = responses.get(j).getResponse(userResponseIndex); String[] splitAns = in.split("\\s\\s"); for(int o = 0; o< splitAns.length;o++){ Output.print(splitAns[o]+ "\n"); } Output.print("\n"); if(!counter.containsKey(in)){ counter.put(in, 1); } else { count = counter.get(in); counter.put(in, ++count); } } Output.print("\nTabulation:\n"); for(String s:counter.keySet()) { Output.print(Integer.toString(counter.get(s)) + "\n"); String[] splitAns = s.split("\\s\\s"); for(int o = 0; o< splitAns.length;o++){ Output.print(splitAns[o]+ "\n"); } Output.print("\n"); } Output.print("\n\n\n"); userResponseIndex++; } } } }
UTF-8
Java
9,312
java
Survey.java
Java
[ { "context": "// Richard Scott\n// 10/26/2020\n// Survey - Adding questions,\n// sa", "end": 16, "score": 0.9997413754463196, "start": 3, "tag": "NAME", "value": "Richard Scott" } ]
null
[]
// <NAME> // 10/26/2020 // Survey - Adding questions, // saving and loading surveys, // displaying and taking them import java.io.File; import java.util.ArrayList; import java.util.Hashtable; import java.util.List; import java.util.TreeMap; public class Survey implements java.io.Serializable{ private static final long serialVersionUID = 76664924001143L; String surveyName; List<Question> savedQuestions; public Survey(String surveyName){ this.surveyName = surveyName; this.savedQuestions = new ArrayList<>(); } public String getName(){ return this.surveyName; } public int size(){ return this.savedQuestions.size(); } public void addQuestion(int type){ Question temp; switch(type){ case 1: temp = new True_False(); break; case 2: temp = new Multiple_Choice(); break; case 3: temp = new Short_Answer(); break; case 4: temp = new Essay(); break; case 5: temp = new Valid_Date(); break; case 6: temp = new Matching(); break; default: Output.print("Survey:43 THIS SHOULDN'T HAPPEN"); // if this is thrown, retire return; } temp.add(); this.savedQuestions.add(temp); } public void modifyQuestion(int question){ if(this.savedQuestions.size() < question){ Output.print("\u001B[31mThere aren't "+ question +" questions in the survey at this time\u001B[0m\n"); } else if(question < 1){ Output.print("\u001B[31mIndex must be greater than 0\u001B[0m\n"); } else { this.savedQuestions.get(question - 1).modify(); } } public void displaySurvey(){ for(int i = 0; i < this.savedQuestions.size(); i++){ Output.print((i+1) + ") "); this.savedQuestions.get(i).display(); Output.print("\n"); } } public void save(Survey in, String outPath){ Output.serialize(in, outPath); } public Survey load(String filePath){ return Input.deserialize(filePath); } public UserResponse takeSurvey(){ UserResponse temp = new UserResponse(); for(int i = 0; i < this.savedQuestions.size(); i++){ Output.print((i+1) + ") "); temp.addResponse(this.savedQuestions.get(i).take()); // Basically add a response to each question Output.print("\n"); } return(temp); } public void tabulateResults(String[] filePaths, String headerPath){ List<UserResponse> responses = new ArrayList<>(); UserResponse temp; for(int i=0;i<filePaths.length;i++){ temp = Input.deserialize(headerPath + File.separator + filePaths[i]); responses.add(temp); } int userResponseIndex = 0; Output.print("\n\n\n"); for(int i=0;i<savedQuestions.size();i++){ if(savedQuestions.get(i) instanceof True_False){ Output.print("Question:\n"); int c1=0; int c2=0; savedQuestions.get(i).display(); Output.print("\nResponses:\n"); for(int j=0;j<filePaths.length;j++){ Output.print(responses.get(j).getResponse(userResponseIndex)+ "\n"); if(responses.get(j).getResponse(userResponseIndex).equals("T")){ c1++; } else { c2++; } } Output.print("\nTabulation:\n"); Output.print("True: " + c1 + "\nFalse: " + c2); Output.print("\n\n\n"); userResponseIndex++; } else if(savedQuestions.get(i) instanceof Multiple_Choice){ Output.print("Question:\n"); savedQuestions.get(i).display(); int choices = ((Multiple_Choice) savedQuestions.get(i)).getAmtQs(); int[] ans = new int[choices]; Output.print("\nReplies:\n"); for(int j=0;j<filePaths.length;j++){ Output.print(responses.get(j).getResponse(userResponseIndex)+ "\n"); String[] splitAns = responses.get(j).getResponse(userResponseIndex).split("\\s\\s"); for(int o = 0; o< splitAns.length;o++){ ans[splitAns[o].charAt(0)-'A']++; } } Output.print("\nTabulation:\n"); for(int k=0; k<choices; k++){ Output.print(Character.toString((char)('A'+k)) + ": " + ans[k] + "\n"); } Output.print("\n\n\n"); userResponseIndex++; } else if(savedQuestions.get(i) instanceof Short_Answer){ String in; int count = 0; Hashtable<String, Integer> counter = new Hashtable<String, Integer>(); Output.print("Question:\n"); savedQuestions.get(i).display(); Output.print("\nResponses:\n"); for(int j=0;j<filePaths.length;j++){ in = responses.get(j).getResponse(userResponseIndex); Output.print(in + "\n"); if(!counter.containsKey(in)){ counter.put(in, 1); } else { count = counter.get(in); counter.put(in, ++count); } } Output.print("\nTabulation:\n"); for(String s:counter.keySet()) { Output.print(s + " " + counter.get(s)+ "\n"); } Output.print("\n\n\n"); userResponseIndex++; } else if(savedQuestions.get(i) instanceof Essay){ Output.print("Question:\n"); savedQuestions.get(i).display(); Output.print("\nResponses:\n"); for(int j=0;j<filePaths.length;j++){ Output.print(responses.get(j).getResponse(userResponseIndex)+ "\n\n"); } Output.print("\nTabulation:\n"); for(int j=0;j<filePaths.length;j++){ Output.print(responses.get(j).getResponse(userResponseIndex)+ "\n\n"); } Output.print("\n\n\n"); userResponseIndex++; } else if(savedQuestions.get(i) instanceof Valid_Date){ String in; int count = 0; Hashtable<String, Integer> counter = new Hashtable<String, Integer>(); Output.print("Question:\n"); savedQuestions.get(i).display(); Output.print("\nResponses:\n"); for(int j=0;j<filePaths.length;j++){ in = responses.get(j).getResponse(userResponseIndex); Output.print(in + "\n"); if(!counter.containsKey(in)){ counter.put(in, 1); } else { count = counter.get(in); counter.put(in, ++count); } } Output.print("\nTabulation:\n"); for(String s:counter.keySet()) { Output.print(s + "\n" + counter.get(s)+ "\n\n"); } Output.print("\n\n\n"); userResponseIndex++; } else if(savedQuestions.get(i) instanceof Matching){ String in; int count = 0; Hashtable<String, Integer> counter = new Hashtable<String, Integer>(); Output.print("Question:\n"); savedQuestions.get(i).display(); Output.print("\nResponses:\n"); for(int j=0;j<filePaths.length;j++){ in = responses.get(j).getResponse(userResponseIndex); String[] splitAns = in.split("\\s\\s"); for(int o = 0; o< splitAns.length;o++){ Output.print(splitAns[o]+ "\n"); } Output.print("\n"); if(!counter.containsKey(in)){ counter.put(in, 1); } else { count = counter.get(in); counter.put(in, ++count); } } Output.print("\nTabulation:\n"); for(String s:counter.keySet()) { Output.print(Integer.toString(counter.get(s)) + "\n"); String[] splitAns = s.split("\\s\\s"); for(int o = 0; o< splitAns.length;o++){ Output.print(splitAns[o]+ "\n"); } Output.print("\n"); } Output.print("\n\n\n"); userResponseIndex++; } } } }
9,305
0.466387
0.457367
249
36.397591
23.433031
114
false
false
0
0
0
0
0
0
0.714859
false
false
8
247ce3ca786b516823db09d909ab9381a78f3e7b
730,144,464,299
bc2358badd26199d0b3bf00a7e609aa61bcdb766
/src/test/java/havis/llrpservice/server/platform/PlatformManagerTest.java
f2c66e2fc83c84d7d7fcd3325f15dafb8a7eaf24
[ "Apache-2.0" ]
permissive
peramic/App.LLRP
https://github.com/peramic/App.LLRP
3424e2e5e0a0ebe08f47eb0fa94e659ebdd19f0a
c7b3da56757db7aabd775556f66cdf22694fd6d1
refs/heads/main
2023-03-11T01:44:13.589000
2021-02-04T08:24:19
2021-02-04T08:24:19
335,378,918
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package havis.llrpservice.server.platform; import org.testng.Assert; import org.testng.annotations.Test; import havis.llrpservice.sbc.service.OSGiServiceFactory; import havis.llrpservice.sbc.service.ReflectionServiceFactory; import havis.llrpservice.server.configuration.ServerConfiguration; import havis.llrpservice.server.configuration.ServerInstanceConfiguration; import havis.llrpservice.server.platform.MissingServiceFactoryException; import havis.llrpservice.server.platform.PlatformConfigAnalyser; import havis.llrpservice.server.platform.PlatformManager; import havis.llrpservice.xml.configuration.LLRPServerConfigurationType; import havis.llrpservice.xml.configuration.LLRPServerInstanceConfigurationType; import havis.util.platform.Platform; import mockit.Mocked; import mockit.NonStrictExpectations; import mockit.Verifications; public class PlatformManagerTest { @Test public void getServiceByReflection(@Mocked final ServerConfiguration serverConfiguration, @Mocked final LLRPServerConfigurationType serverConfigType, @Mocked final ServerInstanceConfiguration instanceConfiguration, @Mocked final LLRPServerInstanceConfigurationType instanceConfigType, @Mocked final PlatformConfigAnalyser confAnalyser, @Mocked final OSGiServiceFactory<Platform> osgiServiceFactory, @Mocked final ReflectionServiceFactory<Platform> rServiceFactory, @Mocked final Platform systemController) throws Exception { // create a config with enabled reflection new NonStrictExpectations() { { serverConfiguration.acquire().getObject(); result = serverConfigType; instanceConfiguration.acquire().getObject(); result = instanceConfigType; confAnalyser.getAddress().getHost(); result = "host"; confAnalyser.getAddress().getPort(); result = 3; confAnalyser.getSystemControllerPortProperties().getOpenCloseTimeout(); result = 4; confAnalyser.getSystemControllerPortProperties().ifReflection(); result = true; confAnalyser.getSystemControllerPortProperties().ifOSGi(); result = true; confAnalyser.getSystemControllerPortProperties().getReflection() .getAddressSetterMethodName(); result = "addressSetterMethodName"; confAnalyser.getSystemControllerPortProperties().getReflection() .getControllerClassName(); result = "controllerClassName"; rServiceFactory.getService("host", 3 /* port */, 4 /* openCloseTimeout */); result = systemController; } }; // create a manager with an OSGiServiceFactory PlatformManager scm = new PlatformManager(serverConfiguration, instanceConfiguration, osgiServiceFactory); // get a service final Platform service = scm.getService(); // the service created by the ReflectionServiceFactory is returned Assert.assertEquals(service, systemController); // release the service scm.release(service); new Verifications() { { // the properties for reflection are used new ReflectionServiceFactory<>("controllerClassName", "addressSetterMethodName"); times = 1; // the service is released at the ReflectionServiceFactory rServiceFactory.release(service); times = 1; } }; } @Test public void getServiceByOSGi(@Mocked final ServerConfiguration serverConfiguration, @Mocked final LLRPServerConfigurationType serverConfigType, @Mocked final ServerInstanceConfiguration instanceConfiguration, @Mocked final LLRPServerInstanceConfigurationType instanceConfigType, @Mocked final PlatformConfigAnalyser confAnalyser, @Mocked final OSGiServiceFactory<Platform> osgiServiceFactory, @Mocked final Platform systemController) throws Exception { // create a config with enabled OSGi new NonStrictExpectations() { { serverConfiguration.acquire().getObject(); result = serverConfigType; instanceConfiguration.acquire().getObject(); result = instanceConfigType; confAnalyser.getAddress().getHost(); result = "host"; confAnalyser.getAddress().getPort(); result = 3; confAnalyser.getSystemControllerPortProperties().getOpenCloseTimeout(); result = 4; confAnalyser.getSystemControllerPortProperties().ifOSGi(); result = true; osgiServiceFactory.getService("host", 3 /* port */, 4 /* openCloseTimeout */); result = systemController; } }; // create a manager with an OSGiServiceFactory PlatformManager scm = new PlatformManager(serverConfiguration, instanceConfiguration, osgiServiceFactory); // get a service final Platform service = scm.getService(); // the service created by the OSGiServiceFactory is returned Assert.assertEquals(service, systemController); // release the service scm.release(service); new Verifications() { { // the service is released at the OSGiServiceFactory osgiServiceFactory.release(service); times = 1; } }; } @Test public void getServiceError(@Mocked final ServerConfiguration serverConfiguration, @Mocked final LLRPServerConfigurationType serverConfigType, @Mocked final ServerInstanceConfiguration instanceConfiguration, @Mocked final LLRPServerInstanceConfigurationType instanceConfigType, @Mocked final PlatformConfigAnalyser confAnalyser) throws Exception { // create a config with enabled OSGi new NonStrictExpectations() { { serverConfiguration.acquire().getObject(); result = serverConfigType; instanceConfiguration.acquire().getObject(); result = instanceConfigType; confAnalyser.getSystemControllerPortProperties().ifOSGi(); result = true; } }; // try to create a manager without an OSGiServiceFactory try { new PlatformManager(serverConfiguration, instanceConfiguration, null /* osgiServiceFactory */); } catch (MissingServiceFactoryException e) { Assert.assertTrue(e.getMessage().contains("Missing OSGi service factory")); } } }
UTF-8
Java
5,855
java
PlatformManagerTest.java
Java
[]
null
[]
package havis.llrpservice.server.platform; import org.testng.Assert; import org.testng.annotations.Test; import havis.llrpservice.sbc.service.OSGiServiceFactory; import havis.llrpservice.sbc.service.ReflectionServiceFactory; import havis.llrpservice.server.configuration.ServerConfiguration; import havis.llrpservice.server.configuration.ServerInstanceConfiguration; import havis.llrpservice.server.platform.MissingServiceFactoryException; import havis.llrpservice.server.platform.PlatformConfigAnalyser; import havis.llrpservice.server.platform.PlatformManager; import havis.llrpservice.xml.configuration.LLRPServerConfigurationType; import havis.llrpservice.xml.configuration.LLRPServerInstanceConfigurationType; import havis.util.platform.Platform; import mockit.Mocked; import mockit.NonStrictExpectations; import mockit.Verifications; public class PlatformManagerTest { @Test public void getServiceByReflection(@Mocked final ServerConfiguration serverConfiguration, @Mocked final LLRPServerConfigurationType serverConfigType, @Mocked final ServerInstanceConfiguration instanceConfiguration, @Mocked final LLRPServerInstanceConfigurationType instanceConfigType, @Mocked final PlatformConfigAnalyser confAnalyser, @Mocked final OSGiServiceFactory<Platform> osgiServiceFactory, @Mocked final ReflectionServiceFactory<Platform> rServiceFactory, @Mocked final Platform systemController) throws Exception { // create a config with enabled reflection new NonStrictExpectations() { { serverConfiguration.acquire().getObject(); result = serverConfigType; instanceConfiguration.acquire().getObject(); result = instanceConfigType; confAnalyser.getAddress().getHost(); result = "host"; confAnalyser.getAddress().getPort(); result = 3; confAnalyser.getSystemControllerPortProperties().getOpenCloseTimeout(); result = 4; confAnalyser.getSystemControllerPortProperties().ifReflection(); result = true; confAnalyser.getSystemControllerPortProperties().ifOSGi(); result = true; confAnalyser.getSystemControllerPortProperties().getReflection() .getAddressSetterMethodName(); result = "addressSetterMethodName"; confAnalyser.getSystemControllerPortProperties().getReflection() .getControllerClassName(); result = "controllerClassName"; rServiceFactory.getService("host", 3 /* port */, 4 /* openCloseTimeout */); result = systemController; } }; // create a manager with an OSGiServiceFactory PlatformManager scm = new PlatformManager(serverConfiguration, instanceConfiguration, osgiServiceFactory); // get a service final Platform service = scm.getService(); // the service created by the ReflectionServiceFactory is returned Assert.assertEquals(service, systemController); // release the service scm.release(service); new Verifications() { { // the properties for reflection are used new ReflectionServiceFactory<>("controllerClassName", "addressSetterMethodName"); times = 1; // the service is released at the ReflectionServiceFactory rServiceFactory.release(service); times = 1; } }; } @Test public void getServiceByOSGi(@Mocked final ServerConfiguration serverConfiguration, @Mocked final LLRPServerConfigurationType serverConfigType, @Mocked final ServerInstanceConfiguration instanceConfiguration, @Mocked final LLRPServerInstanceConfigurationType instanceConfigType, @Mocked final PlatformConfigAnalyser confAnalyser, @Mocked final OSGiServiceFactory<Platform> osgiServiceFactory, @Mocked final Platform systemController) throws Exception { // create a config with enabled OSGi new NonStrictExpectations() { { serverConfiguration.acquire().getObject(); result = serverConfigType; instanceConfiguration.acquire().getObject(); result = instanceConfigType; confAnalyser.getAddress().getHost(); result = "host"; confAnalyser.getAddress().getPort(); result = 3; confAnalyser.getSystemControllerPortProperties().getOpenCloseTimeout(); result = 4; confAnalyser.getSystemControllerPortProperties().ifOSGi(); result = true; osgiServiceFactory.getService("host", 3 /* port */, 4 /* openCloseTimeout */); result = systemController; } }; // create a manager with an OSGiServiceFactory PlatformManager scm = new PlatformManager(serverConfiguration, instanceConfiguration, osgiServiceFactory); // get a service final Platform service = scm.getService(); // the service created by the OSGiServiceFactory is returned Assert.assertEquals(service, systemController); // release the service scm.release(service); new Verifications() { { // the service is released at the OSGiServiceFactory osgiServiceFactory.release(service); times = 1; } }; } @Test public void getServiceError(@Mocked final ServerConfiguration serverConfiguration, @Mocked final LLRPServerConfigurationType serverConfigType, @Mocked final ServerInstanceConfiguration instanceConfiguration, @Mocked final LLRPServerInstanceConfigurationType instanceConfigType, @Mocked final PlatformConfigAnalyser confAnalyser) throws Exception { // create a config with enabled OSGi new NonStrictExpectations() { { serverConfiguration.acquire().getObject(); result = serverConfigType; instanceConfiguration.acquire().getObject(); result = instanceConfigType; confAnalyser.getSystemControllerPortProperties().ifOSGi(); result = true; } }; // try to create a manager without an OSGiServiceFactory try { new PlatformManager(serverConfiguration, instanceConfiguration, null /* osgiServiceFactory */); } catch (MissingServiceFactoryException e) { Assert.assertTrue(e.getMessage().contains("Missing OSGi service factory")); } } }
5,855
0.773015
0.771136
165
34.484848
26.453987
90
false
false
0
0
0
0
0
0
2.969697
false
false
8
c3b5ba35c5d4482ddb38e49b4c0d4cdbb1b3f6c7
14,010,183,385,627
71007018bfae36117fd2f779dbe6e6d7bb9bde9c
/src/main/java/com/magento/test/entity/VertexCustomerCode.java
ace1575130c7e1bf5c26f8380e981b8e56de5988
[]
no_license
gmai2006/magentotest
https://github.com/gmai2006/magentotest
819201760b720a90d55ef853be964651ace125ac
ca67d16d6280ddaefbf57fa1129b6ae7bd80408f
refs/heads/main
2023-09-03T05:14:27.788000
2021-10-17T06:25:09
2021-10-17T06:25:09
418,040,494
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/** * %% Copyright (C) 2021 DataScience 9 LLC %% Licensed under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance with the License. You may obtain a * copy of the License at * * <p>http://www.apache.org/licenses/LICENSE-2.0 * * <p>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. #L% * * <p>This code is 100% AUTO generated. Please do not modify it DIRECTLY If you need new features or * function or changes please update the templates then submit the template through our web * interface. */ package com.magento.test.entity; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Table; import java.io.Serializable; import javax.persistence.Basic; @Entity @Table(name = "vertex_customer_code") public class VertexCustomerCode implements Serializable { private static final long serialVersionUID = 163445090716860160L; /** Description: customer_id. */ @javax.validation.constraints.NotNull @javax.persistence.Id @Column(name = "customer_id") private java.lang.Integer customerId; /** Description: customer_code. */ @Basic @Column(name = "customer_code", length = 0) private java.lang.String customerCode; public VertexCustomerCode() {} public java.lang.Integer getCustomerId() { return this.customerId; } public void setCustomerId(java.lang.Integer customerId) { this.customerId = customerId; } public java.lang.String getCustomerCode() { return this.customerCode; } public void setCustomerCode(java.lang.String customerCode) { this.customerCode = customerCode; } }
UTF-8
Java
1,891
java
VertexCustomerCode.java
Java
[]
null
[]
/** * %% Copyright (C) 2021 DataScience 9 LLC %% Licensed under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance with the License. You may obtain a * copy of the License at * * <p>http://www.apache.org/licenses/LICENSE-2.0 * * <p>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. #L% * * <p>This code is 100% AUTO generated. Please do not modify it DIRECTLY If you need new features or * function or changes please update the templates then submit the template through our web * interface. */ package com.magento.test.entity; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Table; import java.io.Serializable; import javax.persistence.Basic; @Entity @Table(name = "vertex_customer_code") public class VertexCustomerCode implements Serializable { private static final long serialVersionUID = 163445090716860160L; /** Description: customer_id. */ @javax.validation.constraints.NotNull @javax.persistence.Id @Column(name = "customer_id") private java.lang.Integer customerId; /** Description: customer_code. */ @Basic @Column(name = "customer_code", length = 0) private java.lang.String customerCode; public VertexCustomerCode() {} public java.lang.Integer getCustomerId() { return this.customerId; } public void setCustomerId(java.lang.Integer customerId) { this.customerId = customerId; } public java.lang.String getCustomerCode() { return this.customerCode; } public void setCustomerCode(java.lang.String customerCode) { this.customerCode = customerCode; } }
1,891
0.745637
0.729244
58
31.603449
30.052219
100
false
false
0
0
0
0
0
0
0.327586
false
false
8
fc71457f85c150b8f6a3cc955cbf383039ea6863
9,766,755,685,505
ce62132a6766b72ab555d32ea9e2e64e953a8b8c
/eclipse-workspace/QvxWriter/src/edu/njit/qvxwriter/LimitRowsPanel.java
f56804acd0e2378f047715beda658b529bc67694
[]
no_license
VidhyaDurairajan/capstone-project
https://github.com/VidhyaDurairajan/capstone-project
e414ece8d07eab2feb87bea2f4c13aaebcd49db3
7dd405c3de71294b7e2b723b90831a150cd7c74a
refs/heads/master
2020-05-09T23:47:37.439000
2019-04-14T16:36:43
2019-04-14T16:36:43
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package edu.njit.qvxwriter; import javax.swing.JCheckBox; import javax.swing.JPanel; import javax.swing.JSpinner; import javax.swing.SpinnerNumberModel; class LimitRowsPanel extends JPanel { private final JCheckBox rowLimitChecker; private final JSpinner rowLimitSpinner; LimitRowsPanel(){ rowLimitChecker = new JCheckBox("Limit rows:"); rowLimitSpinner = new JSpinner(new SpinnerNumberModel(1, 1, Integer.MAX_VALUE, 1)); add(rowLimitChecker); add(rowLimitSpinner); } }
UTF-8
Java
493
java
LimitRowsPanel.java
Java
[]
null
[]
package edu.njit.qvxwriter; import javax.swing.JCheckBox; import javax.swing.JPanel; import javax.swing.JSpinner; import javax.swing.SpinnerNumberModel; class LimitRowsPanel extends JPanel { private final JCheckBox rowLimitChecker; private final JSpinner rowLimitSpinner; LimitRowsPanel(){ rowLimitChecker = new JCheckBox("Limit rows:"); rowLimitSpinner = new JSpinner(new SpinnerNumberModel(1, 1, Integer.MAX_VALUE, 1)); add(rowLimitChecker); add(rowLimitSpinner); } }
493
0.774848
0.768763
21
22.476191
21.310894
85
false
false
0
0
0
0
0
0
1.47619
false
false
8
d8fc093c3c760c201379fe6dbff8bd7558ca709d
23,132,693,921,142
9a773d5c592a9e9dcad16ae3c68e1da9d3ee1174
/src/main/java/org/brokers/guiders/web/essay/payload/EssayForm.java
50e334ba7f36c3dc84c0be626aea136cfd0f4086
[]
no_license
hypernova1/guiders
https://github.com/hypernova1/guiders
d7980217bc0207f0d0301a4f97752e7e02240143
4fe5de8ef471e63ba62cf14331a4fdbec1e16f25
refs/heads/master
2021-06-10T10:45:22.095000
2021-05-20T14:15:14
2021-05-20T14:15:14
165,012,654
3
2
null
false
2021-03-03T05:29:54
2019-01-10T07:33:35
2021-03-02T13:22:29
2021-03-03T05:29:53
19,682
1
1
0
Java
false
false
package org.brokers.guiders.web.essay.payload; import lombok.Getter; import lombok.Setter; @Getter @Setter public class EssayForm { private String title; private String content; }
UTF-8
Java
192
java
EssayForm.java
Java
[]
null
[]
package org.brokers.guiders.web.essay.payload; import lombok.Getter; import lombok.Setter; @Getter @Setter public class EssayForm { private String title; private String content; }
192
0.755208
0.755208
12
15
14.300349
46
false
false
0
0
0
0
0
0
0.416667
false
false
8
cc8ad50918f0304a83562ed76013412731e1f705
23,132,693,920,859
1552f6ede4aabe6b5ef43ad908a7f64e733a6ed9
/ss/src/main/java/com/legrand/ss/protocol/model/alarm/SosData.java
e55690f553f756d087b6d498b61f363c37c57194
[]
no_license
Eadwyn/lg
https://github.com/Eadwyn/lg
833768e0953c085d33b13824d591d6873eab688a
d97a043348a71b1c143965fe4912dee0ad2d8b80
refs/heads/master
2020-03-23T13:56:37.883000
2019-02-17T00:54:08
2019-02-17T00:54:08
141,646,512
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.legrand.ss.protocol.model.alarm; import java.io.Serializable; public class SosData implements Serializable { private static final long serialVersionUID = 949508780001137535L; private String callNum; private String time; public String getCallNum() { return callNum; } public void setCallNum(String callNum) { this.callNum = callNum; } public String getTime() { return time; } public void setTime(String time) { this.time = time; } }
UTF-8
Java
471
java
SosData.java
Java
[]
null
[]
package com.legrand.ss.protocol.model.alarm; import java.io.Serializable; public class SosData implements Serializable { private static final long serialVersionUID = 949508780001137535L; private String callNum; private String time; public String getCallNum() { return callNum; } public void setCallNum(String callNum) { this.callNum = callNum; } public String getTime() { return time; } public void setTime(String time) { this.time = time; } }
471
0.740977
0.70276
27
16.444445
18.072556
66
false
false
0
0
0
0
0
0
1.037037
false
false
8
e853e4d44b715a4564c3a4c19a004822de02da86
15,066,745,343,447
e5bc2bb35d50f391423e017917bf0980d5069ea6
/src/Algorithms/mazeSolver.java
e891bc874f9f5e928b1c5565058d0b34748cb085
[]
no_license
ma5n1sh/Maze-Solver-And-Pathfinding-Algorithms-Visualizer
https://github.com/ma5n1sh/Maze-Solver-And-Pathfinding-Algorithms-Visualizer
1ee6dfcef9b047952517a505d2eb5f7e77ae08b4
8d3cd676b8da02b8138ca3e549748ec105500167
refs/heads/master
2021-05-18T01:03:10.059000
2020-04-13T12:51:59
2020-04-13T12:51:59
251,037,943
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package Algorithms; public interface mazeSolver { public void find(); }
UTF-8
Java
77
java
mazeSolver.java
Java
[]
null
[]
package Algorithms; public interface mazeSolver { public void find(); }
77
0.727273
0.727273
5
14.4
11.791522
29
false
false
0
0
0
0
0
0
0.4
false
false
8
ab24dd2c0163d53cc24efaa188fc2d5135f2ae9e
5,291,399,778,509
9eed0a3977299293bb2f244fc9c872e756870660
/Dictionary.java/src/dictionary/java/Dictionary.java
99f6319f51923c3ce2e6bc268215105a47f1621d
[]
no_license
anhdtuet1995/support_java
https://github.com/anhdtuet1995/support_java
0a246332afd20f05588429734c12ec4b3c9b2cbf
928b79b88c968938f8057fcb04d00e7a06aebf75
refs/heads/master
2021-05-04T10:54:04.884000
2015-11-17T01:23:03
2015-11-17T01:23:03
44,407,807
0
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 dictionary.java; /** * * @author Anh */ import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.BorderFactory; import javax.swing.DefaultListModel; import javax.swing.JButton; import javax.swing.JFrame; import static javax.swing.JFrame.EXIT_ON_CLOSE; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTextArea; import javax.swing.JTextField; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; public class Dictionary extends JFrame implements ActionListener { private JButton btDich, btAnhViet, btVietAnh, btThem, btSua; JTextField tfNhap, tfSuaAnh, tfSuaViet; JTextField tfThemTuAnh, tfThemTuViet; int flag =0; // anh-viet private JList<String> list; JTextArea tx; JPanel p4; Translate translate; private DefaultListModel<String> listModel; Dictionary() throws IOException{ this.translate = new Translate(); setSize(750, 700); setTitle("Từ điển A-V"); setLocationRelativeTo(null); setResizable(false); setDefaultCloseOperation(EXIT_ON_CLOSE); gui(); } public static void main(String[] args) throws IOException { new Dictionary().setVisible(true); } public void gui(){ JPanel p_main = new JPanel(); JPanel p1 = new JPanel(); JLabel lbNhap = new JLabel("Nhập:"); tfNhap = new JTextField(15); btDich = new JButton("Dịch"); p1.setBorder(BorderFactory.createTitledBorder("Tìm từ")); p1.add(lbNhap, new BorderLayout().SOUTH); p1.add(tfNhap, new BorderLayout().SOUTH); p1.add(btDich, new BorderLayout().SOUTH); p1.setPreferredSize(new Dimension(300, 70)); p_main.add(p1); JPanel p2 = new JPanel(); btAnhViet = new JButton("Anh - Việt"); btVietAnh = new JButton("Việt - Anh"); p2.setBorder(BorderFactory.createTitledBorder("Tùy chọn")); p2.add(btAnhViet, new BorderLayout().SOUTH); p2.add(btVietAnh, new BorderLayout().SOUTH); p2.setPreferredSize(new Dimension(400, 70)); p_main.add(p2); // p3 Danh sach tu JPanel p3 = new JPanel(); p3.setLayout(new BorderLayout()); p3.setBorder(BorderFactory.createTitledBorder("Danh sách từ")); p3.setPreferredSize(new Dimension(300, 400)); listModel=new DefaultListModel<String>(); list=new JList<String>(listModel); list.setBorder(BorderFactory.createTitledBorder("")); p3.add(new JScrollPane(list),BorderLayout.CENTER); ReloadJListEV(); p_main.add(p3); p4 = new JPanel(new BorderLayout()); tx = new JTextArea(44, 33); p4.add(tx); p4.setBorder(BorderFactory.createTitledBorder("Nghĩa của từ")); p4.setPreferredSize(new Dimension(400, 400)); p_main.add(p4); JPanel p5 = new JPanel(); tfThemTuAnh = new JTextField(15); tfThemTuViet = new JTextField(15); JLabel lbThemAnh = new JLabel("Tiếng Anh:"); JLabel lbThemViet = new JLabel("Tiếng Việt:"); btThem = new JButton("Thêm"); p5.setBorder(BorderFactory.createTitledBorder("Thêm từ")); p5.add(lbThemAnh, new BorderLayout().SOUTH); p5.add(tfThemTuAnh, new BorderLayout().SOUTH); p5.add(lbThemViet, new BorderLayout().SOUTH); p5.add(tfThemTuViet, new BorderLayout().SOUTH); p5.add(btThem, new BorderLayout().SOUTH); p5.setPreferredSize(new Dimension(300, 140)); p_main.add(p5); JPanel p6 = new JPanel(); tfSuaAnh = new JTextField(25); tfSuaViet = new JTextField(25); JLabel lbSuaAnh = new JLabel("Tiếng Anh"); JLabel lbSuaViet = new JLabel("Tiếng Việt"); btSua = new JButton("Sửa"); p6.setBorder(BorderFactory.createTitledBorder("Sửa từ")); p6.add(lbSuaAnh, new BorderLayout().WEST); p6.add(tfSuaAnh, new BorderLayout().CENTER); p6.add(lbSuaViet, new BorderLayout().WEST); p6.add(tfSuaViet, new BorderLayout().CENTER); p6.add(btSua, new BorderLayout().SOUTH); p6.setPreferredSize(new Dimension(400, 140)); p_main.add(p6); btDich.addActionListener(this); btAnhViet.addActionListener(this); btVietAnh.addActionListener(this); btThem.addActionListener(this); btSua.addActionListener(this); list.addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { JList source = (JList) e.getSource(); String word = (String) source.getSelectedValue(); //tim tu trong file roi dich if(flag == 0){ int find = translate.findWordEnglish(word); if(find!= -1){ tx.setText(translate.getVietNam(find)); } } if(flag == 1){ int find = translate.findWordVietNam(word); if(find!= -1){ tx.setText(translate.getEnglish(find)); } } tfNhap.setText(word); } }); this.add(p_main); } @Override public void actionPerformed(ActionEvent e) { Object o = e.getSource(); if(o.equals(btAnhViet)){ // load danh sach tieng anh flag = 0; try { translate.docFileAnh(); } catch (IOException ex) { Logger.getLogger(Dictionary.class.getName()).log(Level.SEVERE, null, ex); } ReloadJListEV(); } if(o.equals(btVietAnh)){ //load danh sach tieng viet flag =1; try { translate.docFileViet(); } catch (IOException ex) { Logger.getLogger(Dictionary.class.getName()).log(Level.SEVERE, null, ex); } ReloadJListVE(); } if(o.equals(btDich)&& flag== 0){ // dich sang tieng anh String word = tfNhap.getText(); int find = translate.findWordEnglish(word); if(find > -1){ tx.setText(translate.getVietNam(find)); }else{ tx.setText("Không tìm thấy từ"); } } if(o.equals(btDich) && flag == 1){ String word = tfNhap.getText(); int find = translate.findWordVietNam(word); if(find!= -1){ tx.setText(translate.getEnglish(find)); } else{ tx.setText("Không tìm thấy từ"); } } if(o.equals(btThem) && flag == 0){ String anh = tfThemTuAnh.getText(); String viet = tfThemTuViet.getText(); if(translate.findWordEnglish(anh)!=-1){ JOptionPane.showMessageDialog(this, "Từ này đã có trong danh sách"); tfThemTuAnh.setText(""); tfThemTuViet.setText(""); } else{ translate.ghiFileAnh(anh+":"+viet); try { translate.docFileAnh(); } catch (IOException ex) { Logger.getLogger(Dictionary.class.getName()).log(Level.SEVERE, null, ex); } ReloadJListEV(); tfThemTuAnh.setText(""); tfThemTuViet.setText(""); } } if(o.equals(btThem) && flag == 1){ String anh = tfThemTuAnh.getText(); String viet = tfThemTuViet.getText(); if(translate.findWordVietNam(anh)!=-1){ JOptionPane.showMessageDialog(this, "Từ này đã có trong danh sách"); tfThemTuAnh.setText(""); tfThemTuViet.setText(""); } else{ translate.ghiFileViet(viet+":"+anh); try { translate.docFileViet(); } catch (IOException ex) { Logger.getLogger(Dictionary.class.getName()).log(Level.SEVERE, null, ex); } ReloadJListVE(); tfThemTuAnh.setText(""); tfThemTuViet.setText(""); } } if(o.equals(btSua) && flag == 0){ String viet = tfSuaViet.getText(); String anh = tfSuaAnh.getText(); int viTriTuGoc = translate.findWordEnglish(anh); if(viTriTuGoc == -1){ JOptionPane.showMessageDialog(this, "Từ này không có trong danh sách"); tfThemTuAnh.setText(""); tfThemTuViet.setText(""); } else{ translate.xoaTu(viTriTuGoc); translate.ghiFileAnh(anh+":"+viet+"\n"); translate.setSoLuong(translate.getSoTu()+1); try { translate.docFileAnh(); } catch (IOException ex) { Logger.getLogger(Dictionary.class.getName()).log(Level.SEVERE, null, ex); } ReloadJListEV(); tfThemTuAnh.setText(""); tfThemTuViet.setText(""); } } } public void ReloadJListEV(){ listModel.clear(); ArrayList<String> tmp = new ArrayList<>(); for(int i = 0; i < translate.getSoTu()+1; i++){ tmp.add(translate.getEnglish(i)); } Collections.sort(tmp); tmp.stream().forEach((t) -> { listModel.addElement(t); }); } public void ReloadJListVE(){ listModel.clear(); ArrayList<String> tmp = new ArrayList<>(); for(int i = 0; i < translate.getSoTu()+1; i++){ tmp.add(translate.getVietNam(i)); } Collections.sort(tmp); tmp.stream().forEach((t) -> { listModel.addElement(t); }); } }
UTF-8
Java
12,086
java
Dictionary.java
Java
[ { "context": "r.\n */\npackage dictionary.java;\n\n/**\n *\n * @author Anh\n */\n\n\nimport java.awt.BorderLayout;\nimport java.a", "end": 232, "score": 0.992020845413208, "start": 229, "tag": "NAME", "value": "Anh" } ]
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 dictionary.java; /** * * @author Anh */ import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.BorderFactory; import javax.swing.DefaultListModel; import javax.swing.JButton; import javax.swing.JFrame; import static javax.swing.JFrame.EXIT_ON_CLOSE; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTextArea; import javax.swing.JTextField; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; public class Dictionary extends JFrame implements ActionListener { private JButton btDich, btAnhViet, btVietAnh, btThem, btSua; JTextField tfNhap, tfSuaAnh, tfSuaViet; JTextField tfThemTuAnh, tfThemTuViet; int flag =0; // anh-viet private JList<String> list; JTextArea tx; JPanel p4; Translate translate; private DefaultListModel<String> listModel; Dictionary() throws IOException{ this.translate = new Translate(); setSize(750, 700); setTitle("Từ điển A-V"); setLocationRelativeTo(null); setResizable(false); setDefaultCloseOperation(EXIT_ON_CLOSE); gui(); } public static void main(String[] args) throws IOException { new Dictionary().setVisible(true); } public void gui(){ JPanel p_main = new JPanel(); JPanel p1 = new JPanel(); JLabel lbNhap = new JLabel("Nhập:"); tfNhap = new JTextField(15); btDich = new JButton("Dịch"); p1.setBorder(BorderFactory.createTitledBorder("Tìm từ")); p1.add(lbNhap, new BorderLayout().SOUTH); p1.add(tfNhap, new BorderLayout().SOUTH); p1.add(btDich, new BorderLayout().SOUTH); p1.setPreferredSize(new Dimension(300, 70)); p_main.add(p1); JPanel p2 = new JPanel(); btAnhViet = new JButton("Anh - Việt"); btVietAnh = new JButton("Việt - Anh"); p2.setBorder(BorderFactory.createTitledBorder("Tùy chọn")); p2.add(btAnhViet, new BorderLayout().SOUTH); p2.add(btVietAnh, new BorderLayout().SOUTH); p2.setPreferredSize(new Dimension(400, 70)); p_main.add(p2); // p3 Danh sach tu JPanel p3 = new JPanel(); p3.setLayout(new BorderLayout()); p3.setBorder(BorderFactory.createTitledBorder("Danh sách từ")); p3.setPreferredSize(new Dimension(300, 400)); listModel=new DefaultListModel<String>(); list=new JList<String>(listModel); list.setBorder(BorderFactory.createTitledBorder("")); p3.add(new JScrollPane(list),BorderLayout.CENTER); ReloadJListEV(); p_main.add(p3); p4 = new JPanel(new BorderLayout()); tx = new JTextArea(44, 33); p4.add(tx); p4.setBorder(BorderFactory.createTitledBorder("Nghĩa của từ")); p4.setPreferredSize(new Dimension(400, 400)); p_main.add(p4); JPanel p5 = new JPanel(); tfThemTuAnh = new JTextField(15); tfThemTuViet = new JTextField(15); JLabel lbThemAnh = new JLabel("Tiếng Anh:"); JLabel lbThemViet = new JLabel("Tiếng Việt:"); btThem = new JButton("Thêm"); p5.setBorder(BorderFactory.createTitledBorder("Thêm từ")); p5.add(lbThemAnh, new BorderLayout().SOUTH); p5.add(tfThemTuAnh, new BorderLayout().SOUTH); p5.add(lbThemViet, new BorderLayout().SOUTH); p5.add(tfThemTuViet, new BorderLayout().SOUTH); p5.add(btThem, new BorderLayout().SOUTH); p5.setPreferredSize(new Dimension(300, 140)); p_main.add(p5); JPanel p6 = new JPanel(); tfSuaAnh = new JTextField(25); tfSuaViet = new JTextField(25); JLabel lbSuaAnh = new JLabel("Tiếng Anh"); JLabel lbSuaViet = new JLabel("Tiếng Việt"); btSua = new JButton("Sửa"); p6.setBorder(BorderFactory.createTitledBorder("Sửa từ")); p6.add(lbSuaAnh, new BorderLayout().WEST); p6.add(tfSuaAnh, new BorderLayout().CENTER); p6.add(lbSuaViet, new BorderLayout().WEST); p6.add(tfSuaViet, new BorderLayout().CENTER); p6.add(btSua, new BorderLayout().SOUTH); p6.setPreferredSize(new Dimension(400, 140)); p_main.add(p6); btDich.addActionListener(this); btAnhViet.addActionListener(this); btVietAnh.addActionListener(this); btThem.addActionListener(this); btSua.addActionListener(this); list.addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { JList source = (JList) e.getSource(); String word = (String) source.getSelectedValue(); //tim tu trong file roi dich if(flag == 0){ int find = translate.findWordEnglish(word); if(find!= -1){ tx.setText(translate.getVietNam(find)); } } if(flag == 1){ int find = translate.findWordVietNam(word); if(find!= -1){ tx.setText(translate.getEnglish(find)); } } tfNhap.setText(word); } }); this.add(p_main); } @Override public void actionPerformed(ActionEvent e) { Object o = e.getSource(); if(o.equals(btAnhViet)){ // load danh sach tieng anh flag = 0; try { translate.docFileAnh(); } catch (IOException ex) { Logger.getLogger(Dictionary.class.getName()).log(Level.SEVERE, null, ex); } ReloadJListEV(); } if(o.equals(btVietAnh)){ //load danh sach tieng viet flag =1; try { translate.docFileViet(); } catch (IOException ex) { Logger.getLogger(Dictionary.class.getName()).log(Level.SEVERE, null, ex); } ReloadJListVE(); } if(o.equals(btDich)&& flag== 0){ // dich sang tieng anh String word = tfNhap.getText(); int find = translate.findWordEnglish(word); if(find > -1){ tx.setText(translate.getVietNam(find)); }else{ tx.setText("Không tìm thấy từ"); } } if(o.equals(btDich) && flag == 1){ String word = tfNhap.getText(); int find = translate.findWordVietNam(word); if(find!= -1){ tx.setText(translate.getEnglish(find)); } else{ tx.setText("Không tìm thấy từ"); } } if(o.equals(btThem) && flag == 0){ String anh = tfThemTuAnh.getText(); String viet = tfThemTuViet.getText(); if(translate.findWordEnglish(anh)!=-1){ JOptionPane.showMessageDialog(this, "Từ này đã có trong danh sách"); tfThemTuAnh.setText(""); tfThemTuViet.setText(""); } else{ translate.ghiFileAnh(anh+":"+viet); try { translate.docFileAnh(); } catch (IOException ex) { Logger.getLogger(Dictionary.class.getName()).log(Level.SEVERE, null, ex); } ReloadJListEV(); tfThemTuAnh.setText(""); tfThemTuViet.setText(""); } } if(o.equals(btThem) && flag == 1){ String anh = tfThemTuAnh.getText(); String viet = tfThemTuViet.getText(); if(translate.findWordVietNam(anh)!=-1){ JOptionPane.showMessageDialog(this, "Từ này đã có trong danh sách"); tfThemTuAnh.setText(""); tfThemTuViet.setText(""); } else{ translate.ghiFileViet(viet+":"+anh); try { translate.docFileViet(); } catch (IOException ex) { Logger.getLogger(Dictionary.class.getName()).log(Level.SEVERE, null, ex); } ReloadJListVE(); tfThemTuAnh.setText(""); tfThemTuViet.setText(""); } } if(o.equals(btSua) && flag == 0){ String viet = tfSuaViet.getText(); String anh = tfSuaAnh.getText(); int viTriTuGoc = translate.findWordEnglish(anh); if(viTriTuGoc == -1){ JOptionPane.showMessageDialog(this, "Từ này không có trong danh sách"); tfThemTuAnh.setText(""); tfThemTuViet.setText(""); } else{ translate.xoaTu(viTriTuGoc); translate.ghiFileAnh(anh+":"+viet+"\n"); translate.setSoLuong(translate.getSoTu()+1); try { translate.docFileAnh(); } catch (IOException ex) { Logger.getLogger(Dictionary.class.getName()).log(Level.SEVERE, null, ex); } ReloadJListEV(); tfThemTuAnh.setText(""); tfThemTuViet.setText(""); } } } public void ReloadJListEV(){ listModel.clear(); ArrayList<String> tmp = new ArrayList<>(); for(int i = 0; i < translate.getSoTu()+1; i++){ tmp.add(translate.getEnglish(i)); } Collections.sort(tmp); tmp.stream().forEach((t) -> { listModel.addElement(t); }); } public void ReloadJListVE(){ listModel.clear(); ArrayList<String> tmp = new ArrayList<>(); for(int i = 0; i < translate.getSoTu()+1; i++){ tmp.add(translate.getVietNam(i)); } Collections.sort(tmp); tmp.stream().forEach((t) -> { listModel.addElement(t); }); } }
12,086
0.493378
0.483382
328
35.597561
20.479979
101
false
false
0
0
0
0
0
0
1.042683
false
false
8
b0decef9091fb275ddeb21237ee79a09e1052086
37,993,280,728,865
9b0e232574f7800be94a2f7e040a6579f8dc5c74
/code/src/main/design/pattern/factory/yjt/car/Bm525Li.java
1388e1c15463d529cde497ee6025764d79d1c80a
[ "MIT" ]
permissive
yangjiantao/Inner
https://github.com/yangjiantao/Inner
f7600f2d6e6cf239c31ed7f25c3df79b91e10f6b
8093fa79c664737462a4f1c721f32acd7f8f76fc
refs/heads/master
2020-03-27T22:08:14.183000
2020-02-15T08:28:42
2020-02-15T08:28:42
147,207,654
2
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package design.pattern.factory.yjt.car; import design.pattern.factory.yjt.framework.Car; /** * description * * @author Created by jiantaoyang * @date 2019-07-08 */ public class Bm525Li implements Car { @Override public String getName() { return getClass().getSimpleName(); } }
UTF-8
Java
304
java
Bm525Li.java
Java
[ { "context": ".Car;\n\n/**\n * description\n *\n * @author Created by jiantaoyang\n * @date 2019-07-08\n */\npublic class Bm525Li impl", "end": 146, "score": 0.9902799725532532, "start": 135, "tag": "USERNAME", "value": "jiantaoyang" } ]
null
[]
package design.pattern.factory.yjt.car; import design.pattern.factory.yjt.framework.Car; /** * description * * @author Created by jiantaoyang * @date 2019-07-08 */ public class Bm525Li implements Car { @Override public String getName() { return getClass().getSimpleName(); } }
304
0.684211
0.648026
16
18
16.729465
48
false
false
0
0
0
0
0
0
0.1875
false
false
8
e30765104df155f0fb4fec8379d9fa0170acdbae
37,168,647,013,377
7b23a260c470423ff3e3c7a8d35e7e218edbeb70
/src/test/java/competition/subsystems/drive/DriveSubsystemTest.java
096af6d4939c43074c354244e765e2dec38e929f
[]
no_license
Team488/FRCRobotTemplate
https://github.com/Team488/FRCRobotTemplate
909c1acbc0dbf0779e70cb66eca25e542c8b888c
eb8bc37ebafbee45df406c818e924229cd527597
refs/heads/main
2023-08-08T05:00:58.642000
2023-01-21T23:13:21
2023-01-21T23:13:21
43,615,910
1
16
null
false
2023-02-25T23:33:20
2015-10-03T21:39:01
2022-01-19T02:57:04
2023-02-22T04:11:59
1,069
0
11
1
Java
false
false
package competition.subsystems.drive; import static org.junit.Assert.assertEquals; import org.junit.Test; import competition.BaseCompetitionTest; public class DriveSubsystemTest extends BaseCompetitionTest { @Test public void testTankDrive() { DriveSubsystem driveSubsystem = (DriveSubsystem)getInjectorComponent().driveSubsystem(); driveSubsystem.tankDrive(1, 1); assertEquals(1, driveSubsystem.leftLeader.getMotorOutputPercent(), 0.001); assertEquals(1, driveSubsystem.rightLeader.getMotorOutputPercent(), 0.001); } }
UTF-8
Java
569
java
DriveSubsystemTest.java
Java
[]
null
[]
package competition.subsystems.drive; import static org.junit.Assert.assertEquals; import org.junit.Test; import competition.BaseCompetitionTest; public class DriveSubsystemTest extends BaseCompetitionTest { @Test public void testTankDrive() { DriveSubsystem driveSubsystem = (DriveSubsystem)getInjectorComponent().driveSubsystem(); driveSubsystem.tankDrive(1, 1); assertEquals(1, driveSubsystem.leftLeader.getMotorOutputPercent(), 0.001); assertEquals(1, driveSubsystem.rightLeader.getMotorOutputPercent(), 0.001); } }
569
0.760984
0.739895
18
30.611111
31.367249
96
false
false
0
0
0
0
0
0
0.722222
false
false
8
5680e4cc9f0816f3066f34344215088faf91fd56
34,875,134,494,584
e2cb94b1100beb2df3b120ddff3cafab78ee969f
/app/src/main/java/com/example/aarushiarya/tryfrag/Model/Match.java
7de4dc5adbd08265ee4a1ef5efadb78ade2726cf
[]
no_license
aarushiarya/Destin
https://github.com/aarushiarya/Destin
5143f34823eb51e3645d9c899ddc2ab12f1fb35a
b60947dbbbc498e601f31eba9405fb7b2ae57291
refs/heads/master
2020-03-17T23:03:54.144000
2018-05-20T06:19:28
2018-05-20T06:19:28
134,030,300
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.aarushiarya.tryfrag.Model; public class Match { private MyBusi[] businesses; public MyBusi[] getBusinesses () { return businesses; } public void setBusinesses (MyBusi[] businesses) { this.businesses = businesses; } @Override public String toString() { return "ClassPojo [businesses = "+businesses+"]"; } }
UTF-8
Java
397
java
Match.java
Java
[ { "context": "package com.example.aarushiarya.tryfrag.Model;\n\npublic class Match {\n private ", "end": 31, "score": 0.9150534868240356, "start": 20, "tag": "USERNAME", "value": "aarushiarya" } ]
null
[]
package com.example.aarushiarya.tryfrag.Model; public class Match { private MyBusi[] businesses; public MyBusi[] getBusinesses () { return businesses; } public void setBusinesses (MyBusi[] businesses) { this.businesses = businesses; } @Override public String toString() { return "ClassPojo [businesses = "+businesses+"]"; } }
397
0.619647
0.619647
21
17.952381
18.344524
57
false
false
0
0
0
0
0
0
0.238095
false
false
8
37c08964a755b8c81ed367c4d0b8c43a8e9d4752
39,410,619,917,882
04951d63b299d40a7cc415209f66e248406936b6
/src/greedy/JumpGameII.java
e74c17305d0c89e7bc70e66405748e81e252789a
[]
no_license
coolfire00/LeetCodeOJTwo
https://github.com/coolfire00/LeetCodeOJTwo
49b896f975e4f3a6791438547c5ac13f6e2e0cd1
3f32efc61cf7768c05fd9539879b5a670b8eda48
refs/heads/master
2016-09-09T23:44:32.111000
2015-11-13T06:45:06
2015-11-13T06:45:06
42,422,800
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package greedy; public class JumpGameII { public int jump(int[] nums) { if (nums.length <= 1) { return 0; } int i = 1, count = 1, max = nums[0]; while (i < nums.length) { if (max >= nums.length - 1) { break; } int temp = max; while (i <= temp) { max = Math.max(max, i + nums[i]); i++; } count++; } return count; } }
UTF-8
Java
365
java
JumpGameII.java
Java
[]
null
[]
package greedy; public class JumpGameII { public int jump(int[] nums) { if (nums.length <= 1) { return 0; } int i = 1, count = 1, max = nums[0]; while (i < nums.length) { if (max >= nums.length - 1) { break; } int temp = max; while (i <= temp) { max = Math.max(max, i + nums[i]); i++; } count++; } return count; } }
365
0.509589
0.493151
23
14.869565
12.109301
38
false
false
0
0
0
0
0
0
2.565217
false
false
8
bf8127d9b1c63cec3d34e6edf1e069ee0621f3ac
35,888,746,773,443
45a55d50f4a8775685e95d9fb9eda2ace8ce5c7b
/bookstore/src/hlju/edu/user/UserServlet.java
eee39832e3490eae774e6dd535c7e231fcf0a2a1
[]
no_license
ChinaITwsh/bookstore
https://github.com/ChinaITwsh/bookstore
5452a30d533649ced379adc617e7cb0ed6701b69
161007e0606371158aed9214d8b0387b429c568e
refs/heads/master
2020-04-18T10:27:03.231000
2016-09-06T05:22:21
2016-09-06T05:22:21
67,385,191
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package hlju.edu.user; import hlju.edu.domain.User; import hlju.edu.utils.BaseServlet; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.beanutils.BeanUtils; public class UserServlet extends BaseServlet { private UserService service = new UserService(); @Override public String execute(HttpServletRequest req, HttpServletResponse resp) throws Exception { User user = new User(); BeanUtils.populate(user,req.getParameterMap()); service.save(user); req.getSession().setAttribute("msg","你已经注册成功,请登录"); return "302:login"; } /* * 提供用户登录 * */ public String login(HttpServletRequest req,HttpServletResponse resp) throws Exception{ User user = new User(); BeanUtils.populate(user,req.getParameterMap()); User user2 = service.login(user); if(user2==null){ req.setAttribute("user",user); req.getSession().setAttribute("msg", "你的用户名或是密码错误"); return "login"; }else{ req.getSession().setAttribute("user", user2); return "302:succ"; } } }
UTF-8
Java
1,311
java
UserServlet.java
Java
[]
null
[]
package hlju.edu.user; import hlju.edu.domain.User; import hlju.edu.utils.BaseServlet; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.beanutils.BeanUtils; public class UserServlet extends BaseServlet { private UserService service = new UserService(); @Override public String execute(HttpServletRequest req, HttpServletResponse resp) throws Exception { User user = new User(); BeanUtils.populate(user,req.getParameterMap()); service.save(user); req.getSession().setAttribute("msg","你已经注册成功,请登录"); return "302:login"; } /* * 提供用户登录 * */ public String login(HttpServletRequest req,HttpServletResponse resp) throws Exception{ User user = new User(); BeanUtils.populate(user,req.getParameterMap()); User user2 = service.login(user); if(user2==null){ req.setAttribute("user",user); req.getSession().setAttribute("msg", "你的用户名或是密码错误"); return "login"; }else{ req.getSession().setAttribute("user", user2); return "302:succ"; } } }
1,311
0.705976
0.698805
51
22.607843
21.463219
87
false
false
0
0
0
0
0
0
1.803922
false
false
8
b05a2979d492e37408d0d08974efb533f7a85a2a
3,745,211,549,050
6ce7cb9e116eb298c4def137d04a4e50139997f6
/dbms/src/main/java/com/ecommerce/dao/impl/StoreDaoImpl.java
3a2ae6d27d3406fb962db842636953ecac5bdb20
[]
no_license
eyrafabdullayev/technocamp
https://github.com/eyrafabdullayev/technocamp
c1e7f3c038c13f14d735d27c23a652546883750a
601f8b85a96c5eb49809d1d0eb9533fc99735b0b
refs/heads/master
2022-12-04T09:48:59.740000
2020-09-01T12:58:20
2020-09-01T12:58:20
291,830,503
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.ecommerce.dao.impl; import com.ecommerce.dao.inter.StoreDaoInter; import com.ecommerce.entity.Store; import org.springframework.stereotype.Repository; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import java.util.List; @Repository("storeDao") public class StoreDaoImpl implements StoreDaoInter { @PersistenceContext EntityManager em; @Override public List<Store> getAllStories() { return (List<Store>) em.createQuery("SELECT s FROM Store s") .getResultList(); } @Override public Store getStoreById(Integer id) { return (Store) em.createQuery("SELECT s FROM Store s WHERE s.id = :id") .setParameter("id",id) .getSingleResult(); } @Override public Store getStoreByUserId(Integer id) { return (Store) em.createQuery("SELECT s FROM Store s WHERE s.user.id = :id") .setParameter("id",id) .getSingleResult(); } @Override public boolean updateStore(Store s) { boolean result = false; try { em.createQuery("UPDATE Store s SET s.name = :name, s.description = :description, s.phone = :phone, s.location = :location, s.imageURL = :imageURL WHERE s.id = :id") .setParameter("name",s.getName()) .setParameter("description",s.getDescription()) .setParameter("phone",s.getPhone()) .setParameter("location",s.getLocation()) .setParameter("imageURL",s.getImageURL()) .setParameter("id",s.getId()) .executeUpdate(); result = true; } finally { return result; } } @Override public boolean insertStore(Store s) { boolean result = false; try { em.createNativeQuery("INSERT INTO store (user_id,name,description,phone,location,imageURL) VALUES (?,?,?,?,?,?)") .setParameter(1,s.getUser().getId()) .setParameter(2,s.getName()) .setParameter(3,s.getDescription()) .setParameter(4,s.getPhone()) .setParameter(5,s.getLocation()) .setParameter(6,s.getImageURL()) .executeUpdate(); result = true; } finally { return result; } } @Override public boolean deleteStore(Integer id) { boolean result = false; try { em.createQuery("DELETE FROM Store s WHERE s.id = :id") .setParameter("id",id) .executeUpdate(); result = true; } finally { return result; } } }
UTF-8
Java
2,788
java
StoreDaoImpl.java
Java
[]
null
[]
package com.ecommerce.dao.impl; import com.ecommerce.dao.inter.StoreDaoInter; import com.ecommerce.entity.Store; import org.springframework.stereotype.Repository; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import java.util.List; @Repository("storeDao") public class StoreDaoImpl implements StoreDaoInter { @PersistenceContext EntityManager em; @Override public List<Store> getAllStories() { return (List<Store>) em.createQuery("SELECT s FROM Store s") .getResultList(); } @Override public Store getStoreById(Integer id) { return (Store) em.createQuery("SELECT s FROM Store s WHERE s.id = :id") .setParameter("id",id) .getSingleResult(); } @Override public Store getStoreByUserId(Integer id) { return (Store) em.createQuery("SELECT s FROM Store s WHERE s.user.id = :id") .setParameter("id",id) .getSingleResult(); } @Override public boolean updateStore(Store s) { boolean result = false; try { em.createQuery("UPDATE Store s SET s.name = :name, s.description = :description, s.phone = :phone, s.location = :location, s.imageURL = :imageURL WHERE s.id = :id") .setParameter("name",s.getName()) .setParameter("description",s.getDescription()) .setParameter("phone",s.getPhone()) .setParameter("location",s.getLocation()) .setParameter("imageURL",s.getImageURL()) .setParameter("id",s.getId()) .executeUpdate(); result = true; } finally { return result; } } @Override public boolean insertStore(Store s) { boolean result = false; try { em.createNativeQuery("INSERT INTO store (user_id,name,description,phone,location,imageURL) VALUES (?,?,?,?,?,?)") .setParameter(1,s.getUser().getId()) .setParameter(2,s.getName()) .setParameter(3,s.getDescription()) .setParameter(4,s.getPhone()) .setParameter(5,s.getLocation()) .setParameter(6,s.getImageURL()) .executeUpdate(); result = true; } finally { return result; } } @Override public boolean deleteStore(Integer id) { boolean result = false; try { em.createQuery("DELETE FROM Store s WHERE s.id = :id") .setParameter("id",id) .executeUpdate(); result = true; } finally { return result; } } }
2,788
0.556313
0.554161
88
30.681818
28.085724
176
false
false
0
0
0
0
0
0
0.590909
false
false
8
c67dacd9d2796878a827b951447eaac6cca286eb
36,687,610,684,747
d0479ca0831bf1ca1d2f5f3c75a81245a0835ac7
/manager/jam-services/src/main/java/org/yes/cart/service/vo/VoIOSupport.java
98f80744b689fe42095f7b2286fad76929468fcb
[ "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.service.vo; import java.io.IOException; /** * User: denispavlov * Date: 07/08/2016 * Time: 23:10 */ public interface VoIOSupport { /** * Store file in repository. * * @param fileName full name properly formatted * @param code master object code * @param attributeFileCode file attribute code * @param base64URL base64 URL string * @param storagePrefix storage prefix * * @return filename * * @throws IOException in case image cannot be added */ String addFileToRepository(String fileName, String code, String attributeFileCode, String base64URL, String storagePrefix) throws IOException; /** * Store file in repository. * * @param fileName full name properly formatted * @param code master object code * @param attributeFileCode file attribute code * @param base64URL base64 URL string * @param storagePrefix storage prefix * * @return filename * * @throws IOException in case image cannot be added */ String addSystemFileToRepository(String fileName, String code, String attributeFileCode, String base64URL, String storagePrefix) throws IOException; /** * Store image in repository. * * @param fileName full name properly formatted * @param code master object code * @param attributeImageCode image attribute code * @param base64URL base64 URL string * @param storagePrefix storage prefix * * @return filename * * @throws IOException in case image cannot be added */ String addImageToRepository(String fileName, String code, String attributeImageCode, String base64URL, String storagePrefix) throws IOException; /** * Get image as BASE64 data URL. * * @param fileName filename * @param code code * @param storagePrefix storage prefix * * @return base64 URL */ String getImageAsBase64(String fileName, String code, String storagePrefix); }
UTF-8
Java
3,113
java
VoIOSupport.java
Java
[ { "context": "ice.vo;\n\nimport java.io.IOException;\n\n/**\n * User: denispavlov\n * Date: 07/08/2016\n * Time: 23:10\n */\npublic int", "end": 719, "score": 0.9995659589767456, "start": 708, "tag": "USERNAME", "value": "denispavlov" } ]
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.service.vo; import java.io.IOException; /** * User: denispavlov * Date: 07/08/2016 * Time: 23:10 */ public interface VoIOSupport { /** * Store file in repository. * * @param fileName full name properly formatted * @param code master object code * @param attributeFileCode file attribute code * @param base64URL base64 URL string * @param storagePrefix storage prefix * * @return filename * * @throws IOException in case image cannot be added */ String addFileToRepository(String fileName, String code, String attributeFileCode, String base64URL, String storagePrefix) throws IOException; /** * Store file in repository. * * @param fileName full name properly formatted * @param code master object code * @param attributeFileCode file attribute code * @param base64URL base64 URL string * @param storagePrefix storage prefix * * @return filename * * @throws IOException in case image cannot be added */ String addSystemFileToRepository(String fileName, String code, String attributeFileCode, String base64URL, String storagePrefix) throws IOException; /** * Store image in repository. * * @param fileName full name properly formatted * @param code master object code * @param attributeImageCode image attribute code * @param base64URL base64 URL string * @param storagePrefix storage prefix * * @return filename * * @throws IOException in case image cannot be added */ String addImageToRepository(String fileName, String code, String attributeImageCode, String base64URL, String storagePrefix) throws IOException; /** * Get image as BASE64 data URL. * * @param fileName filename * @param code code * @param storagePrefix storage prefix * * @return base64 URL */ String getImageAsBase64(String fileName, String code, String storagePrefix); }
3,113
0.584324
0.57019
99
30.444445
23.626822
78
false
false
0
0
0
0
0
0
0.252525
false
false
8
c7afecf15e261ac59608c3a27b4323a4c69723e9
39,127,152,088,260
4ec3bf36837420a2cb84bec4adb772d2664f6e92
/FrameworkDartesESP_alunosSDIS/brokerOM2M/org.eclipse.om2m/org.eclipse.om2m.ipe.sdt.testsuite/src/main/java/org/eclipse/om2m/ipe/sdt/testsuite/module/SmokeSensorModuleTest.java
3502983ee5064e96c7182c8a635da09d51574667
[]
no_license
BaltasarAroso/SDIS_OM2M
https://github.com/BaltasarAroso/SDIS_OM2M
1f2ce310b3c1bf64c2a95ad9d236c64bf672abb0
618fdb4da1aba5621a85e49dae0442cafef5ca31
refs/heads/master
2020-04-08T19:08:22.073000
2019-01-20T15:42:48
2019-01-20T15:42:48
159,641,777
0
2
null
false
2020-03-06T15:49:51
2018-11-29T09:35:02
2019-05-21T03:51:01
2019-01-20T15:43:17
38,899
0
2
1
C
false
false
/******************************************************************************* * Copyright (c) 2014, 2016 Orange. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html *******************************************************************************/ package org.eclipse.om2m.ipe.sdt.testsuite.module; import org.eclipse.om2m.commons.constants.ResponseStatusCode; import org.eclipse.om2m.commons.resource.CustomAttribute; import org.eclipse.om2m.commons.resource.ResponsePrimitive; import org.eclipse.om2m.commons.resource.flexcontainerspec.SmokeSensorFlexContainer; import org.eclipse.om2m.core.service.CseService; import org.eclipse.om2m.ipe.sdt.testsuite.CSEUtil; import org.eclipse.om2m.ipe.sdt.testsuite.TestReport; import org.eclipse.om2m.ipe.sdt.testsuite.TestReport.State; import org.eclipse.om2m.ipe.sdt.testsuite.module.exception.FlexContainerNotFound; import org.eclipse.om2m.sdt.Module; import org.eclipse.om2m.sdt.datapoints.BooleanDataPoint; import org.eclipse.om2m.sdt.datapoints.IntegerDataPoint; import org.eclipse.om2m.sdt.exceptions.AccessException; import org.eclipse.om2m.sdt.exceptions.DataPointException; import org.eclipse.om2m.sdt.home.types.DatapointType; public class SmokeSensorModuleTest extends AbstractModuleTest { public SmokeSensorModuleTest(CseService pCseService, Module pModule) { super(pCseService, pModule); } public TestReport test() { TestReport report = new TestReport("Test for module " + getModule().getName()); String moduleUrl = null; try { moduleUrl = getModuleFlexContainerUrl(); } catch (FlexContainerNotFound e) { report.setErrorMessage("no FlexContainer for module " + getModule().getName()); report.setState(State.KO); return report; } // at this point, we found out the url of the module flexcontainer. // retrieve flexContainer value ResponsePrimitive response = CSEUtil.retrieveEntity(getCseService(), moduleUrl); if(!ResponseStatusCode.OK.equals(response.getResponseStatusCode())) { report.setErrorMessage("unable to retrieve FlexContainer for module " + getModule().getName()); report.setState(State.KO); return report; } SmokeSensorFlexContainer retrievedFlexContainer = (SmokeSensorFlexContainer) response.getContent(); // check alarm CustomAttribute alarmCA = retrievedFlexContainer.getCustomAttribute(DatapointType.alarm.getShortName()); if (alarmCA == null) { report.setErrorMessage("ERROR : no alarm customAttribute"); report.setState(State.KO); return report; } Boolean alarm = Boolean.parseBoolean(alarmCA.getCustomAttributeValue()); // alarm from module BooleanDataPoint alarmDP = (BooleanDataPoint) getModule().getDataPoint(DatapointType.alarm.getShortName()); Boolean currentValueFromModule = null; try { currentValueFromModule = alarmDP.getValue(); } catch (DataPointException | AccessException e) { report.setErrorMessage("unable to get alarm DP value from module " + getModule().getName()); report.setState(State.KO); return report; } if (!alarm.equals(currentValueFromModule)) { report.setErrorMessage("invalid value between flexContainer(" + alarm + ") and module (" + currentValueFromModule + ")"); report.setState(State.KO); return report; } // try to set value SmokeSensorFlexContainer toBeUpdated = new SmokeSensorFlexContainer(); alarmCA.setCustomAttributeValue("true"); toBeUpdated.getCustomAttributes().add(alarmCA); response = CSEUtil.updateFlexContainerEntity(getCseService(), moduleUrl, toBeUpdated); if (ResponseStatusCode.UPDATED.equals(response.getResponseStatusCode())) { // expected KO report.setErrorMessage("we should not be able to set alarm datapoint value from module " + getModule().getName()); report.setState(State.KO); return report; } // check detectedTime response = CSEUtil.retrieveEntity(getCseService(), moduleUrl); if (!ResponseStatusCode.OK.equals(response.getResponseStatusCode())) { report.setErrorMessage("unable to retrieve FlexContainer for module " + getModule().getName()); report.setState(State.KO); return report; } retrievedFlexContainer = (SmokeSensorFlexContainer) response.getContent(); CustomAttribute detectedTimeCA = retrievedFlexContainer.getCustomAttribute(DatapointType.detectedTime.getShortName()); if (detectedTimeCA != null) { // detectedTime is optional Integer detectedTime = new Integer(detectedTimeCA.getCustomAttributeValue()); // get detectedTime from module IntegerDataPoint detectedTimeDP = (IntegerDataPoint) getModule().getDataPoint(DatapointType.detectedTime.getShortName()); Integer detectedTimeFromModule = null; try { detectedTimeFromModule = detectedTimeDP.getValue(); } catch (DataPointException | AccessException e) { report.setErrorMessage("unable to retrieve detectedTime datapoint value :" + e.getMessage()); report.setState(State.KO); return report; } if (detectedTime == null) { if (detectedTimeFromModule != null) { report.setErrorMessage("expected non null detected time"); report.setState(State.KO); return report; } } else { if (!detectedTime.equals(detectedTimeFromModule)) { report.setErrorMessage("detectedTime from IPE(" + detectedTime + ") is different of detectedTime from module (" + detectedTimeFromModule + ")"); report.setState(State.KO); return report; } } } System.out.println("test module " + getModule().getName() + " __________________ OK ___________________________"); report.setState(State.OK); return report; } }
UTF-8
Java
5,927
java
SmokeSensorModuleTest.java
Java
[]
null
[]
/******************************************************************************* * Copyright (c) 2014, 2016 Orange. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html *******************************************************************************/ package org.eclipse.om2m.ipe.sdt.testsuite.module; import org.eclipse.om2m.commons.constants.ResponseStatusCode; import org.eclipse.om2m.commons.resource.CustomAttribute; import org.eclipse.om2m.commons.resource.ResponsePrimitive; import org.eclipse.om2m.commons.resource.flexcontainerspec.SmokeSensorFlexContainer; import org.eclipse.om2m.core.service.CseService; import org.eclipse.om2m.ipe.sdt.testsuite.CSEUtil; import org.eclipse.om2m.ipe.sdt.testsuite.TestReport; import org.eclipse.om2m.ipe.sdt.testsuite.TestReport.State; import org.eclipse.om2m.ipe.sdt.testsuite.module.exception.FlexContainerNotFound; import org.eclipse.om2m.sdt.Module; import org.eclipse.om2m.sdt.datapoints.BooleanDataPoint; import org.eclipse.om2m.sdt.datapoints.IntegerDataPoint; import org.eclipse.om2m.sdt.exceptions.AccessException; import org.eclipse.om2m.sdt.exceptions.DataPointException; import org.eclipse.om2m.sdt.home.types.DatapointType; public class SmokeSensorModuleTest extends AbstractModuleTest { public SmokeSensorModuleTest(CseService pCseService, Module pModule) { super(pCseService, pModule); } public TestReport test() { TestReport report = new TestReport("Test for module " + getModule().getName()); String moduleUrl = null; try { moduleUrl = getModuleFlexContainerUrl(); } catch (FlexContainerNotFound e) { report.setErrorMessage("no FlexContainer for module " + getModule().getName()); report.setState(State.KO); return report; } // at this point, we found out the url of the module flexcontainer. // retrieve flexContainer value ResponsePrimitive response = CSEUtil.retrieveEntity(getCseService(), moduleUrl); if(!ResponseStatusCode.OK.equals(response.getResponseStatusCode())) { report.setErrorMessage("unable to retrieve FlexContainer for module " + getModule().getName()); report.setState(State.KO); return report; } SmokeSensorFlexContainer retrievedFlexContainer = (SmokeSensorFlexContainer) response.getContent(); // check alarm CustomAttribute alarmCA = retrievedFlexContainer.getCustomAttribute(DatapointType.alarm.getShortName()); if (alarmCA == null) { report.setErrorMessage("ERROR : no alarm customAttribute"); report.setState(State.KO); return report; } Boolean alarm = Boolean.parseBoolean(alarmCA.getCustomAttributeValue()); // alarm from module BooleanDataPoint alarmDP = (BooleanDataPoint) getModule().getDataPoint(DatapointType.alarm.getShortName()); Boolean currentValueFromModule = null; try { currentValueFromModule = alarmDP.getValue(); } catch (DataPointException | AccessException e) { report.setErrorMessage("unable to get alarm DP value from module " + getModule().getName()); report.setState(State.KO); return report; } if (!alarm.equals(currentValueFromModule)) { report.setErrorMessage("invalid value between flexContainer(" + alarm + ") and module (" + currentValueFromModule + ")"); report.setState(State.KO); return report; } // try to set value SmokeSensorFlexContainer toBeUpdated = new SmokeSensorFlexContainer(); alarmCA.setCustomAttributeValue("true"); toBeUpdated.getCustomAttributes().add(alarmCA); response = CSEUtil.updateFlexContainerEntity(getCseService(), moduleUrl, toBeUpdated); if (ResponseStatusCode.UPDATED.equals(response.getResponseStatusCode())) { // expected KO report.setErrorMessage("we should not be able to set alarm datapoint value from module " + getModule().getName()); report.setState(State.KO); return report; } // check detectedTime response = CSEUtil.retrieveEntity(getCseService(), moduleUrl); if (!ResponseStatusCode.OK.equals(response.getResponseStatusCode())) { report.setErrorMessage("unable to retrieve FlexContainer for module " + getModule().getName()); report.setState(State.KO); return report; } retrievedFlexContainer = (SmokeSensorFlexContainer) response.getContent(); CustomAttribute detectedTimeCA = retrievedFlexContainer.getCustomAttribute(DatapointType.detectedTime.getShortName()); if (detectedTimeCA != null) { // detectedTime is optional Integer detectedTime = new Integer(detectedTimeCA.getCustomAttributeValue()); // get detectedTime from module IntegerDataPoint detectedTimeDP = (IntegerDataPoint) getModule().getDataPoint(DatapointType.detectedTime.getShortName()); Integer detectedTimeFromModule = null; try { detectedTimeFromModule = detectedTimeDP.getValue(); } catch (DataPointException | AccessException e) { report.setErrorMessage("unable to retrieve detectedTime datapoint value :" + e.getMessage()); report.setState(State.KO); return report; } if (detectedTime == null) { if (detectedTimeFromModule != null) { report.setErrorMessage("expected non null detected time"); report.setState(State.KO); return report; } } else { if (!detectedTime.equals(detectedTimeFromModule)) { report.setErrorMessage("detectedTime from IPE(" + detectedTime + ") is different of detectedTime from module (" + detectedTimeFromModule + ")"); report.setState(State.KO); return report; } } } System.out.println("test module " + getModule().getName() + " __________________ OK ___________________________"); report.setState(State.OK); return report; } }
5,927
0.710477
0.705753
141
40.035461
34.397842
149
false
false
0
0
0
0
0
0
2.638298
false
false
8
3ce0cfda8d8cad192821f98478815048efa6463a
35,845,797,096,717
2507bd6dfb9aa47cf901384dae77b83b4e2fcb36
/src/hospital/java/models/TabTraversal.java
cd477797d609f5ec70d3fb8f11f99272b003b951
[]
no_license
Srekaravarshan/VMC-Hospital-Management
https://github.com/Srekaravarshan/VMC-Hospital-Management
0bfbc1abfa600669c82daa7df8d7c641aa7abee3
7d0ff1d2eac2e0b279197321aa1ab876c2003ed5
refs/heads/master
2023-07-18T17:37:02.287000
2021-09-28T00:41:18
2021-09-28T00:41:18
374,056,578
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package hospital.java.models; import javafx.event.EventHandler; import javafx.scene.control.TextArea; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyEvent; public class TabTraversal implements EventHandler<KeyEvent> { private static final String FOCUS_EVENT_TEXT = "TAB_TO_FOCUS_EVENT"; @Override public void handle(final KeyEvent event) { if (!KeyCode.TAB.equals(event.getCode())) { return; } // handle events where the TAB key or TAB + CTRL key is pressed // so don't handle the event if the ALT, SHIFT or any other modifier key is pressed if (event.isAltDown() || event.isMetaDown() || event.isShiftDown()) { return; } if (!(event.getSource() instanceof TextArea)) { return; } final TextArea textArea = (TextArea) event.getSource(); if (event.isControlDown()) { // if the event text contains the special focus event text // => do not consume the event, and let the default behaviour (= move focus to the next control) happen. // // if the focus event text is not present, then the user has pressed CTRL + TAB key, // then consume the event and insert or replace selection with tab character if (!FOCUS_EVENT_TEXT.equalsIgnoreCase(event.getText())) { event.consume(); textArea.replaceSelection("\t"); } } else { // The default behaviour of the TextArea for the CTRL+TAB key is a move of focus to the next control. // So we consume the TAB key event, and fire a new event with the CTRL + TAB key. event.consume(); final KeyEvent tabControlEvent = new KeyEvent(event.getSource(), event.getTarget(), event.getEventType(), event.getCharacter(), FOCUS_EVENT_TEXT, event.getCode(), event.isShiftDown(), true, event.isAltDown(), event.isMetaDown()); textArea.fireEvent(tabControlEvent); } } }
UTF-8
Java
2,120
java
TabTraversal.java
Java
[]
null
[]
package hospital.java.models; import javafx.event.EventHandler; import javafx.scene.control.TextArea; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyEvent; public class TabTraversal implements EventHandler<KeyEvent> { private static final String FOCUS_EVENT_TEXT = "TAB_TO_FOCUS_EVENT"; @Override public void handle(final KeyEvent event) { if (!KeyCode.TAB.equals(event.getCode())) { return; } // handle events where the TAB key or TAB + CTRL key is pressed // so don't handle the event if the ALT, SHIFT or any other modifier key is pressed if (event.isAltDown() || event.isMetaDown() || event.isShiftDown()) { return; } if (!(event.getSource() instanceof TextArea)) { return; } final TextArea textArea = (TextArea) event.getSource(); if (event.isControlDown()) { // if the event text contains the special focus event text // => do not consume the event, and let the default behaviour (= move focus to the next control) happen. // // if the focus event text is not present, then the user has pressed CTRL + TAB key, // then consume the event and insert or replace selection with tab character if (!FOCUS_EVENT_TEXT.equalsIgnoreCase(event.getText())) { event.consume(); textArea.replaceSelection("\t"); } } else { // The default behaviour of the TextArea for the CTRL+TAB key is a move of focus to the next control. // So we consume the TAB key event, and fire a new event with the CTRL + TAB key. event.consume(); final KeyEvent tabControlEvent = new KeyEvent(event.getSource(), event.getTarget(), event.getEventType(), event.getCharacter(), FOCUS_EVENT_TEXT, event.getCode(), event.isShiftDown(), true, event.isAltDown(), event.isMetaDown()); textArea.fireEvent(tabControlEvent); } } }
2,120
0.604717
0.604717
57
36.210526
36.416565
139
false
false
0
0
0
0
0
0
0.578947
false
false
8
499e56a914da2910eb1d33c6e52483236d75cb5b
3,633,542,400,117
586b1aa5b42262884f3b738d9607c05a1689cb04
/src/main/java/cn/lucasma/design/pattern/structural/adapter/objectadadapter/Adaptee.java
e6b9c15a92ad1116a43ecd7b052a670608ef8d7d
[]
no_license
chuckma/design_pattern
https://github.com/chuckma/design_pattern
604e22df3e5104b6d91868f1e177c1dd8175a120
bdadc05fd2169c50e3b6a9043518075ea399ee3b
refs/heads/master
2022-12-21T15:42:22.472000
2021-04-11T08:47:55
2021-04-11T08:47:55
144,852,066
1
0
null
false
2022-12-16T03:37:48
2018-08-15T12:46:39
2021-04-11T08:48:07
2022-12-16T03:37:46
158
1
0
11
Java
false
false
package cn.lucasma.design.pattern.structural.adapter.objectadadapter; /** * Author: lucasma * <p> * 被适配者 */ public class Adaptee { public void adapteeRequest() { System.out.println("被适配者的方法"); } }
UTF-8
Java
241
java
Adaptee.java
Java
[ { "context": "tructural.adapter.objectadadapter;\n\n/**\n * Author: lucasma\n * <p>\n * 被适配者\n */\npublic class Adaptee {\n\n pu", "end": 93, "score": 0.9996747970581055, "start": 86, "tag": "USERNAME", "value": "lucasma" } ]
null
[]
package cn.lucasma.design.pattern.structural.adapter.objectadadapter; /** * Author: lucasma * <p> * 被适配者 */ public class Adaptee { public void adapteeRequest() { System.out.println("被适配者的方法"); } }
241
0.657534
0.657534
13
15.846154
19.677578
69
false
false
0
0
0
0
0
0
0.153846
false
false
8
f087911cea8715d9204f18a802c0c3e6e0b563ad
21,577,915,699,731
e789925c6292358703d9bb0877220bc1daa15222
/app/src/main/java/com/perul/vanshika/concetto/Developers.java
4fec939296f7b37a206c9d0ad01212d104edbaa1
[]
no_license
vanshikaarora/Concetto
https://github.com/vanshikaarora/Concetto
57312e1da9fa062deeabdf31dc8c1915ebbaca8d
b187e84b4db2f9973da0a8dc74277d486cc1617f
refs/heads/master
2020-03-29T22:37:52.605000
2018-10-16T18:35:23
2018-10-16T18:35:23
150,431,471
6
5
null
false
2018-10-22T07:54:10
2018-09-26T13:31:26
2018-10-16T18:35:37
2018-10-16T18:46:41
19,818
2
3
0
Java
false
null
package com.perul.vanshika.concetto; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.ImageView; /** * Created by lenovo on 9/27/2018. */ public class Developers extends MainActivity { ImageView vsg,vsl,peg,pel,ssg,sl,kul; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); super.replaceContentLayout(R.layout.developers, R.id.content_main_linear_layout); getSupportActionBar().hide(); vsg = (ImageView)findViewById(R.id.vanshigit); vsl = (ImageView)findViewById(R.id.vanshilinked); peg = (ImageView)findViewById(R.id.perugit); pel = (ImageView)findViewById(R.id.perulinked); ssg = (ImageView)findViewById(R.id.shridhargit); sl = (ImageView)findViewById(R.id.shridharlinked); kul = (ImageView)findViewById(R.id.kullinked); vsg.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String uri = "https://github.com/vanshikaarora"; Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri)); startActivity(intent); } }); vsl.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String uri = "https://www.linkedin.com/in/vanshika-arora-6396b4143/"; Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri)); startActivity(intent); } }); peg.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String uri = "https://github.com/peruljain"; Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri)); startActivity(intent); } }); pel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String uri = "https://www.linkedin.com/in/perul-jain-55845b154/"; Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri)); startActivity(intent); } }); ssg.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String uri = "https://github.com/ShridharGoel"; Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri)); startActivity(intent); } }); sl.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String uri = "https://www.linkedin.com/in/shridhar-goel/"; Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri)); startActivity(intent); } }); kul.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String uri = "http://www.linkedin.com/in/gautamkuldeep73096"; Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri)); startActivity(intent); } }); } @Override public void onBackPressed() { super.onBackPressed(); startActivity(new Intent(Developers.this, MainActivity.class)); } }
UTF-8
Java
3,616
java
Developers.java
Java
[ { "context": "mport android.widget.ImageView;\n\n/**\n * Created by lenovo on 9/27/2018.\n */\n\n\npublic class Developers exten", "end": 296, "score": 0.9996427297592163, "start": 290, "tag": "USERNAME", "value": "lenovo" }, { "context": "\n String uri = \"https://github.com/vanshikaarora\";\n Intent intent = new Intent(Inte", "end": 1239, "score": 0.9996976852416992, "start": 1226, "tag": "USERNAME", "value": "vanshikaarora" }, { "context": " String uri = \"https://www.linkedin.com/in/vanshika-arora-6396b4143/\";\n Intent intent = new Intent(Int", "end": 1593, "score": 0.999731183052063, "start": 1569, "tag": "USERNAME", "value": "vanshika-arora-6396b4143" }, { "context": "\n String uri = \"https://github.com/peruljain\";\n Intent intent = new Intent(Inte", "end": 1925, "score": 0.9996513724327087, "start": 1916, "tag": "USERNAME", "value": "peruljain" }, { "context": " String uri = \"https://www.linkedin.com/in/perul-jain-55845b154/\";\n Intent intent = new Intent(Int", "end": 2275, "score": 0.999670147895813, "start": 2255, "tag": "USERNAME", "value": "perul-jain-55845b154" }, { "context": "\n String uri = \"https://github.com/ShridharGoel\";\n Intent intent = new Intent(Inte", "end": 2609, "score": 0.9996424913406372, "start": 2597, "tag": "USERNAME", "value": "ShridharGoel" }, { "context": " String uri = \"https://www.linkedin.com/in/shridhar-goel/\";\n Intent intent = new Intent(Int", "end": 2952, "score": 0.9996175765991211, "start": 2939, "tag": "USERNAME", "value": "shridhar-goel" }, { "context": " String uri = \"http://www.linkedin.com/in/gautamkuldeep73096\";\n Intent intent = new Intent(Inte", "end": 3300, "score": 0.9996891617774963, "start": 3282, "tag": "USERNAME", "value": "gautamkuldeep73096" } ]
null
[]
package com.perul.vanshika.concetto; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.ImageView; /** * Created by lenovo on 9/27/2018. */ public class Developers extends MainActivity { ImageView vsg,vsl,peg,pel,ssg,sl,kul; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); super.replaceContentLayout(R.layout.developers, R.id.content_main_linear_layout); getSupportActionBar().hide(); vsg = (ImageView)findViewById(R.id.vanshigit); vsl = (ImageView)findViewById(R.id.vanshilinked); peg = (ImageView)findViewById(R.id.perugit); pel = (ImageView)findViewById(R.id.perulinked); ssg = (ImageView)findViewById(R.id.shridhargit); sl = (ImageView)findViewById(R.id.shridharlinked); kul = (ImageView)findViewById(R.id.kullinked); vsg.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String uri = "https://github.com/vanshikaarora"; Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri)); startActivity(intent); } }); vsl.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String uri = "https://www.linkedin.com/in/vanshika-arora-6396b4143/"; Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri)); startActivity(intent); } }); peg.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String uri = "https://github.com/peruljain"; Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri)); startActivity(intent); } }); pel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String uri = "https://www.linkedin.com/in/perul-jain-55845b154/"; Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri)); startActivity(intent); } }); ssg.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String uri = "https://github.com/ShridharGoel"; Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri)); startActivity(intent); } }); sl.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String uri = "https://www.linkedin.com/in/shridhar-goel/"; Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri)); startActivity(intent); } }); kul.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String uri = "http://www.linkedin.com/in/gautamkuldeep73096"; Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri)); startActivity(intent); } }); } @Override public void onBackPressed() { super.onBackPressed(); startActivity(new Intent(Developers.this, MainActivity.class)); } }
3,616
0.590431
0.582412
98
35.897961
25.523695
89
false
false
0
0
0
0
0
0
0.653061
false
false
8
7a226d8cb4e658db94064e2484dc011639669b86
27,255,862,528,399
08ae6ed3842db8655a26494d6d3ea5a63cf7b34a
/study/src/liu/api/java/util/classes/XLocale.java
4ba776c0d8228d8701ccedc82d8450792a6d5ddf
[ "Apache-2.0" ]
permissive
xiaotangai/KnowledgeBase
https://github.com/xiaotangai/KnowledgeBase
2538e9adfbfaf421aa5d2c6a2151701573e12fa2
376555e0a889b457b6a7f2256ecd96f2289b51f9
refs/heads/master
2018-11-13T02:05:16.496000
2018-08-24T02:39:27
2018-08-24T02:39:27
62,305,470
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package liu.api.java.util.classes; import java.util.Locale; public class XLocale { private Locale locale = Locale.getDefault(); public static Locale[] getAvailableLocales(){ return Locale.getAvailableLocales(); } public static String[] getISOCountries(){ return Locale.getISOCountries(); } public static String[] getISOLanguages(){ return Locale.getISOLanguages(); } public String getCountry(){ return locale.getCountry(); } public String getDisplayCountry(){ return locale.getDisplayCountry(); } public String getLanguage(){ return locale.getLanguage(); } public String getDisplayLanguage(){ return locale.getDisplayLanguage(); } public String getScript(){ return locale.getScript(); } public static void main(String[] args) { XLocale locale = new XLocale(); System.out.println(XLocale.getAvailableLocales().length); System.out.println(locale.getCountry()); System.out.println(locale.getLanguage()); } }
UTF-8
Java
1,017
java
XLocale.java
Java
[]
null
[]
package liu.api.java.util.classes; import java.util.Locale; public class XLocale { private Locale locale = Locale.getDefault(); public static Locale[] getAvailableLocales(){ return Locale.getAvailableLocales(); } public static String[] getISOCountries(){ return Locale.getISOCountries(); } public static String[] getISOLanguages(){ return Locale.getISOLanguages(); } public String getCountry(){ return locale.getCountry(); } public String getDisplayCountry(){ return locale.getDisplayCountry(); } public String getLanguage(){ return locale.getLanguage(); } public String getDisplayLanguage(){ return locale.getDisplayLanguage(); } public String getScript(){ return locale.getScript(); } public static void main(String[] args) { XLocale locale = new XLocale(); System.out.println(XLocale.getAvailableLocales().length); System.out.println(locale.getCountry()); System.out.println(locale.getLanguage()); } }
1,017
0.693215
0.693215
47
19.638298
18.154684
59
false
false
0
0
0
0
0
0
1.446808
false
false
8
b60a3ac65d81b0dcc6f2e825be0c35aa788ac175
7,507,602,843,029
c9af26e21c2cf1637a73ffdef919ce1a4d7ca475
/me/artcheer/attreasure/tasks/ChamadasTask.java
1c24b71d9d353efafa013381f6aa338da381cf21
[]
no_license
Artcheer/ATTreasure
https://github.com/Artcheer/ATTreasure
b4ee439087bd303442edfda405522dde563fc6a9
4c7946035a5af0221a28d379846d2c8f49628a3a
refs/heads/master
2020-03-17T11:39:25.824000
2019-10-10T19:15:52
2019-10-10T19:15:52
133,559,469
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package me.artcheer.attreasure.tasks; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.scheduler.BukkitScheduler; import org.bukkit.scheduler.BukkitTask; import me.artcheer.attreasure.config.ConfigManager; import me.artcheer.attreasure.config.ConfigManager.LocationType; import me.artcheer.attreasure.config.MessagesConfig; import me.artcheer.attreasure.eventos.EventoController; import me.artcheer.attreasure.main.ATTreasure; /** * * Cria chamadas para o evento, ao terminar de enviar as mensagens chama o * evento ChamadasFinalizadas onde os participantes serão teleportados para o * local do partida. * * ~ @Artcheer */ public class ChamadasTask { private boolean isAtivo = false; private BukkitTask preEvent; private BukkitScheduler bs = Bukkit.getServer().getScheduler(); private EventoController controller; public ChamadasTask(EventoController e) { this.controller = e; } public void run() { isAtivo = true; final int count[] = { 5 }; preEvent = bs.runTaskTimer(ATTreasure.getInstance(), new Runnable() { @Override public void run() { for(String s: MessagesConfig.getChamadas()){ Bukkit.broadcastMessage(s.replace("{Num}", String.valueOf(count[0]))); } if (count[0] <= 0) { if (controller.getJogadores().size() >= ConfigManager.getMinimoParticipantes()) { for (Player p : controller.getJogadores()) { p.teleport(ConfigManager.getLocation(LocationType.ENTRADA)); } controller.getChestTreasure().createChest(); controller.getDicas().run(); } else { controller.cancelEvent(); Bukkit.broadcastMessage(MessagesConfig.eventoCanceladoParticipantes); } setAtivo(false); preEvent.cancel(); } count[0]--; } }, 0, ConfigManager.getDelayChamada()*1200); } public boolean isAtivo() { return isAtivo; } public void setAtivo(boolean ativo){ this.isAtivo = ativo; } public BukkitTask getPreEvent() { return preEvent; } }
UTF-8
Java
2,061
java
ChamadasTask.java
Java
[ { "context": "eleportados para o\r\n * local do partida.\r\n *\r\n * ~ @Artcheer\r\n */\r\npublic class ChamadasTask {\r\n\tprivate boole", "end": 675, "score": 0.9968516230583191, "start": 666, "tag": "USERNAME", "value": "@Artcheer" } ]
null
[]
package me.artcheer.attreasure.tasks; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.scheduler.BukkitScheduler; import org.bukkit.scheduler.BukkitTask; import me.artcheer.attreasure.config.ConfigManager; import me.artcheer.attreasure.config.ConfigManager.LocationType; import me.artcheer.attreasure.config.MessagesConfig; import me.artcheer.attreasure.eventos.EventoController; import me.artcheer.attreasure.main.ATTreasure; /** * * Cria chamadas para o evento, ao terminar de enviar as mensagens chama o * evento ChamadasFinalizadas onde os participantes serão teleportados para o * local do partida. * * ~ @Artcheer */ public class ChamadasTask { private boolean isAtivo = false; private BukkitTask preEvent; private BukkitScheduler bs = Bukkit.getServer().getScheduler(); private EventoController controller; public ChamadasTask(EventoController e) { this.controller = e; } public void run() { isAtivo = true; final int count[] = { 5 }; preEvent = bs.runTaskTimer(ATTreasure.getInstance(), new Runnable() { @Override public void run() { for(String s: MessagesConfig.getChamadas()){ Bukkit.broadcastMessage(s.replace("{Num}", String.valueOf(count[0]))); } if (count[0] <= 0) { if (controller.getJogadores().size() >= ConfigManager.getMinimoParticipantes()) { for (Player p : controller.getJogadores()) { p.teleport(ConfigManager.getLocation(LocationType.ENTRADA)); } controller.getChestTreasure().createChest(); controller.getDicas().run(); } else { controller.cancelEvent(); Bukkit.broadcastMessage(MessagesConfig.eventoCanceladoParticipantes); } setAtivo(false); preEvent.cancel(); } count[0]--; } }, 0, ConfigManager.getDelayChamada()*1200); } public boolean isAtivo() { return isAtivo; } public void setAtivo(boolean ativo){ this.isAtivo = ativo; } public BukkitTask getPreEvent() { return preEvent; } }
2,061
0.695631
0.690777
71
27.014084
23.714554
86
false
false
0
0
0
0
0
0
2.380282
false
false
8
d50335e73b3cf3083b784c207b0e0ac98930fbde
6,614,249,697,308
825fb1e133133a1bbe4e219e33208a32a4d2acf6
/app/src/main/java/com/example/stumanager/manageCourse.java
64078ae5c742f09c63565d555099802298fc137c
[]
no_license
Hzx1998/android-coursemanager
https://github.com/Hzx1998/android-coursemanager
f603b68000ec12f47217ffa933a6ba725cb5d1da
bbf83db6e33914bb12d9180c332da10e82eae4c7
refs/heads/master
2020-05-15T17:48:33.628000
2019-04-20T05:43:45
2019-04-20T05:43:45
182,411,184
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.stumanager; public class manageCourse { String stuid; String stuname; String couid; String couname; manageCourse(String a,String b,String c,String d){ stuid=a; stuname=b; couid=c; couname=d; } String getStuid(){ return stuid; } String getStuname(){ return stuname; } String getCouid(){ return couid; } String getCouname(){ return couname; } }
UTF-8
Java
484
java
manageCourse.java
Java
[]
null
[]
package com.example.stumanager; public class manageCourse { String stuid; String stuname; String couid; String couname; manageCourse(String a,String b,String c,String d){ stuid=a; stuname=b; couid=c; couname=d; } String getStuid(){ return stuid; } String getStuname(){ return stuname; } String getCouid(){ return couid; } String getCouname(){ return couname; } }
484
0.566116
0.566116
26
17.615385
11.066502
54
false
false
0
0
0
0
0
0
0.615385
false
false
8
7919d53c8d38982d1bada7440f15f7fe40d766a8
506,806,173,097
596be59442ec69b7c0366903b548e95e02a46790
/backend/src/main/java/org/sdrc/usermgmt/domain/LoginAudit.java
be7447a9b35a3fb2f4f92614747dadb3ab03c040
[]
no_license
SDRC-India/SCPS-TN
https://github.com/SDRC-India/SCPS-TN
ccb004b95b53af02693d0bdfda9e61924513188b
fdd03df70fd4c5c8649e68c1350d79f69023e608
refs/heads/master
2023-03-09T02:12:26.902000
2021-02-25T10:20:23
2021-02-25T10:20:23
342,202,741
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package org.sdrc.usermgmt.domain; import java.util.Date; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import lombok.Data; /** * @author subham * */ @Entity @Data public class LoginAudit { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Integer id; private String username; @ManyToOne @JoinColumn(name = "acc_id_fk") private Account account; private Date loggedInDate; private Date logoutDate; private boolean active; private String userAgent; private String actualUserAgent; private String ipAddress; }
UTF-8
Java
763
java
LoginAudit.java
Java
[ { "context": "nyToOne;\r\n\r\nimport lombok.Data;\r\n\r\n/**\r\n * @author subham\r\n *\r\n */\r\n@Entity\r\n@Data\r\npublic class LoginAudit", "end": 333, "score": 0.9992181658744812, "start": 327, "tag": "USERNAME", "value": "subham" } ]
null
[]
package org.sdrc.usermgmt.domain; import java.util.Date; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import lombok.Data; /** * @author subham * */ @Entity @Data public class LoginAudit { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Integer id; private String username; @ManyToOne @JoinColumn(name = "acc_id_fk") private Account account; private Date loggedInDate; private Date logoutDate; private boolean active; private String userAgent; private String actualUserAgent; private String ipAddress; }
763
0.736566
0.736566
44
15.386364
14.983651
52
false
false
0
0
0
0
0
0
0.704545
false
false
8
23c1f85c7a2e18dadc6711c7bb3c8ce7d1ee4792
31,610,959,304,027
c96266eba0572a583c36464bfc2210823958ecea
/app/src/main/java/ir11/co/tsco/canavaslearning/utils/ResponseModel.java
972ec1003599d7ca47499ec927d420f9932a6172
[]
no_license
farhad-kargaran/Otello
https://github.com/farhad-kargaran/Otello
72d328aca8f0add82f4c122b62c4b87e3bb6df58
cffb1016918bff14d0f0f003730fdc9086596743
refs/heads/master
2020-05-29T08:52:42.916000
2017-12-04T10:48:02
2017-12-04T10:48:02
69,088,254
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package ir11.co.tsco.canavaslearning.utils; public class ResponseModel { public String response; public int statusCode; public Exception exception; private int nativeStatusCode; public String getResponse() { return response; } public void setResponse(String response) { this.response = response; } public int getStatusCode() { return statusCode; } public void setStatusCode(int statusCode) { this.statusCode = statusCode; } public Exception getException() { return exception; } public void setException(Exception exception) { this.exception = exception; } public Integer getNativeStatusCode() { return nativeStatusCode; } public void setNativeStatusCode(int nativeStatusCode) { this.nativeStatusCode = nativeStatusCode; } public ResponseModel() { response = ""; } }
UTF-8
Java
991
java
ResponseModel.java
Java
[]
null
[]
package ir11.co.tsco.canavaslearning.utils; public class ResponseModel { public String response; public int statusCode; public Exception exception; private int nativeStatusCode; public String getResponse() { return response; } public void setResponse(String response) { this.response = response; } public int getStatusCode() { return statusCode; } public void setStatusCode(int statusCode) { this.statusCode = statusCode; } public Exception getException() { return exception; } public void setException(Exception exception) { this.exception = exception; } public Integer getNativeStatusCode() { return nativeStatusCode; } public void setNativeStatusCode(int nativeStatusCode) { this.nativeStatusCode = nativeStatusCode; } public ResponseModel() { response = ""; } }
991
0.614531
0.612513
55
17.018183
17.101294
57
false
false
0
0
0
0
0
0
0.254545
false
false
8
26de34f6ce679dc20182fc3f2102eefd4f11adee
1,194,000,961,341
4ce650345eadcaa03256519c66d7f7d3510e30ce
/src/main/java/com/booklib/servlet/book/DestroyServle.java
2914546efa599a92319a3426c7e60e1338ecd029
[]
no_license
cimcoz/BookLib-A-Portal-for-library
https://github.com/cimcoz/BookLib-A-Portal-for-library
168377495ec2e0f72aae5c0176b2b16c3337846b
bfaa7e6474973b192d8956aa29503398eacf2b37
refs/heads/main
2023-05-08T08:55:55.865000
2021-05-28T09:13:26
2021-05-28T09:13:26
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.booklib.servlet.book; import com.booklib.dao.BookDAO; import com.booklib.model.Message; import com.booklib.util.DBConnectionManager; import java.io.IOException; import java.sql.SQLException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; @WebServlet(name = "BookDestroyServle", urlPatterns = {"/book-servlet/destroy"}) public class DestroyServle extends HttpServlet { private BookDAO bookDAO; public void init() { this.bookDAO = new BookDAO(DBConnectionManager.getConnection()); } /** * Processes requests for both HTTP <code>GET</code> and <code>POST</code> * methods. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); try{ destroy(request,response); }catch(Exception e){ e.printStackTrace(); } } /** * @param HttpServletRequest, HttpServletResponse * @redirect to author/index.jsp * */ private void destroy(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, SQLException { int id = Integer.parseInt(request.getParameter("book_id")); HttpSession session = request.getSession(); bookDAO.destroy(id); Message msg = new Message("Book removed Successfully.", "success", "alert-success"); session.setAttribute("msg", msg); response.sendRedirect(request.getContextPath() + "/book-servlet/index"); } // <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
3,311
java
DestroyServle.java
Java
[]
null
[]
package com.booklib.servlet.book; import com.booklib.dao.BookDAO; import com.booklib.model.Message; import com.booklib.util.DBConnectionManager; import java.io.IOException; import java.sql.SQLException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; @WebServlet(name = "BookDestroyServle", urlPatterns = {"/book-servlet/destroy"}) public class DestroyServle extends HttpServlet { private BookDAO bookDAO; public void init() { this.bookDAO = new BookDAO(DBConnectionManager.getConnection()); } /** * Processes requests for both HTTP <code>GET</code> and <code>POST</code> * methods. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); try{ destroy(request,response); }catch(Exception e){ e.printStackTrace(); } } /** * @param HttpServletRequest, HttpServletResponse * @redirect to author/index.jsp * */ private void destroy(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, SQLException { int id = Integer.parseInt(request.getParameter("book_id")); HttpSession session = request.getSession(); bookDAO.destroy(id); Message msg = new Message("Book removed Successfully.", "success", "alert-success"); session.setAttribute("msg", msg); response.sendRedirect(request.getContextPath() + "/book-servlet/index"); } // <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> }
3,311
0.683177
0.682875
97
33.134022
28.144922
135
false
false
0
0
0
0
0
0
0.474227
false
false
8
0f4c35270cc2c361d422717e9eb8f862ac577dd2
2,078,764,197,350
2fccdcb244a0c8d7f48fcca8af2ba52af7a9c751
/src/main/java/ch/protonmail/vladyslavbond/techsupport/web/controllers/UnknownPartyException.java
3958c88232825f1e3c64738f54e543826fe4dcc9
[ "MIT" ]
permissive
carriercomm/techsupport-web
https://github.com/carriercomm/techsupport-web
61640ede1d11d416989a545d01c5edffbcbbd909
22fc648dfe93bd1d1eb7fc7bbf204dea44c8e1e6
refs/heads/master
2020-12-07T15:31:44.090000
2015-06-08T01:41:52
2015-06-08T01:41:52
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package ch.protonmail.vladyslavbond.techsupport.web.controllers; public final class UnknownPartyException extends Exception { private final String username; public UnknownPartyException (String username) { this.username = new String(username); } @Override public String getMessage ( ) { return "There is no party with name " + this.username + "."; } }
UTF-8
Java
393
java
UnknownPartyException.java
Java
[]
null
[]
package ch.protonmail.vladyslavbond.techsupport.web.controllers; public final class UnknownPartyException extends Exception { private final String username; public UnknownPartyException (String username) { this.username = new String(username); } @Override public String getMessage ( ) { return "There is no party with name " + this.username + "."; } }
393
0.70229
0.70229
17
22.17647
24.064217
65
false
false
0
0
0
0
0
0
0.411765
false
false
8
2b268a374d9abd224f1466606d585d67984dc839
17,463,337,079,484
5cd537f250e18e6f5ff02e18939be852ad35d316
/project4/src/edu/ucla/cs/cs144/Item.java
c2ebc8d09600207dc25eb1b0151c56d337073d1d
[]
no_license
stanwayl/ebay-clone
https://github.com/stanwayl/ebay-clone
b5097dbb5a54c60721edf3da18246ad6900156db
bfe346553039c8c0929cbc874d69a18739da45ba
refs/heads/master
2018-01-11T05:22:30.481000
2016-03-08T11:31:11
2016-03-08T11:31:11
50,717,713
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package edu.ucla.cs.cs144; //import javax.xml.bind.*; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlElementWrapper; import java.util.*; // I designed this Item class and any nested classes after the XML for an item in // the eBay data. I decided to make a class for each "thing" that had its own // attributes or nested elements // All classes are: Item, Bid, Bidder, Location, and Seller @XmlRootElement( name = "Item" ) public class Item { private String ItemID; private String Name; private List<String> Category = new ArrayList<String>(); private String Currently; private String Buy_Price; private String First_Bid; private Integer Number_of_Bids; private List<Bid> Bids = new ArrayList<Bid>(); private Location Location; private String Country; private String Started; private String Ends; private Seller Seller; private String Description; @XmlAttribute( name = "ItemID" ) public String getItemID() { return this.ItemID; } public void setItemID(String x) { this.ItemID = x; } @XmlElement( name = "Name" ) public String getName() { return this.Name; } public void setName(String x) { this.Name = x; } @XmlElement( name = "Category" ) public List<String> getCategory() { return this.Category; } public void setCategory(List<String> x) { this.Category = x; } @XmlElement( name = "Currently" ) public String getCurrently() { return this.Currently; } public void setCurrently(String x) { this.Currently = x; } @XmlElement( name = "Buy_Price" ) public String getBuy_Price() { return this.Buy_Price; } public void setBuy_Price(String x) { this.Buy_Price = x; } @XmlElement( name = "First_Bid" ) public String getFirst_Bid() { return this.First_Bid; } public void setFirst_Bid(String x) { this.First_Bid = x; } @XmlElement( name = "Number_of_Bids" ) public Integer getNumber_of_Bids() { return this.Number_of_Bids; } public void setNumber_of_Bids(Integer x) { this.Number_of_Bids = x; } @XmlElementWrapper( name = "Bids" ) @XmlElement( name = "Bid" ) public List<Bid> getBids() { return this.Bids; } public void setBids(List<Bid> x) { this.Bids = x; } @XmlElement( name = "Location" ) public Location getLocation() { return this.Location; } public void setLocation(Location x) { this.Location = x; } @XmlElement( name = "Country" ) public String getCountry() { return this.Country; } public void setCountry(String x) { this.Country = x; } @XmlElement( name = "Started" ) public String getStarted() { return this.Started; } public void setStarted(String x) { this.Started = x; } @XmlElement( name = "Ends" ) public String getEnds() { return this.Ends; } public void setEnds(String x) { this.Ends = x; } @XmlElement( name = "Seller" ) public Seller getSeller() { return this.Seller; } public void setSeller(Seller x) { this.Seller = x; } @XmlElement( name = "Description" ) public String getDescription() { return this.Description; } public void setDescription(String x) { this.Description = x; } }
UTF-8
Java
3,609
java
Item.java
Java
[]
null
[]
package edu.ucla.cs.cs144; //import javax.xml.bind.*; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlElementWrapper; import java.util.*; // I designed this Item class and any nested classes after the XML for an item in // the eBay data. I decided to make a class for each "thing" that had its own // attributes or nested elements // All classes are: Item, Bid, Bidder, Location, and Seller @XmlRootElement( name = "Item" ) public class Item { private String ItemID; private String Name; private List<String> Category = new ArrayList<String>(); private String Currently; private String Buy_Price; private String First_Bid; private Integer Number_of_Bids; private List<Bid> Bids = new ArrayList<Bid>(); private Location Location; private String Country; private String Started; private String Ends; private Seller Seller; private String Description; @XmlAttribute( name = "ItemID" ) public String getItemID() { return this.ItemID; } public void setItemID(String x) { this.ItemID = x; } @XmlElement( name = "Name" ) public String getName() { return this.Name; } public void setName(String x) { this.Name = x; } @XmlElement( name = "Category" ) public List<String> getCategory() { return this.Category; } public void setCategory(List<String> x) { this.Category = x; } @XmlElement( name = "Currently" ) public String getCurrently() { return this.Currently; } public void setCurrently(String x) { this.Currently = x; } @XmlElement( name = "Buy_Price" ) public String getBuy_Price() { return this.Buy_Price; } public void setBuy_Price(String x) { this.Buy_Price = x; } @XmlElement( name = "First_Bid" ) public String getFirst_Bid() { return this.First_Bid; } public void setFirst_Bid(String x) { this.First_Bid = x; } @XmlElement( name = "Number_of_Bids" ) public Integer getNumber_of_Bids() { return this.Number_of_Bids; } public void setNumber_of_Bids(Integer x) { this.Number_of_Bids = x; } @XmlElementWrapper( name = "Bids" ) @XmlElement( name = "Bid" ) public List<Bid> getBids() { return this.Bids; } public void setBids(List<Bid> x) { this.Bids = x; } @XmlElement( name = "Location" ) public Location getLocation() { return this.Location; } public void setLocation(Location x) { this.Location = x; } @XmlElement( name = "Country" ) public String getCountry() { return this.Country; } public void setCountry(String x) { this.Country = x; } @XmlElement( name = "Started" ) public String getStarted() { return this.Started; } public void setStarted(String x) { this.Started = x; } @XmlElement( name = "Ends" ) public String getEnds() { return this.Ends; } public void setEnds(String x) { this.Ends = x; } @XmlElement( name = "Seller" ) public Seller getSeller() { return this.Seller; } public void setSeller(Seller x) { this.Seller = x; } @XmlElement( name = "Description" ) public String getDescription() { return this.Description; } public void setDescription(String x) { this.Description = x; } }
3,609
0.614021
0.613189
145
23.889656
16.72624
81
false
false
0
0
0
0
0
0
0.365517
false
false
8
cec96d9f89bf2ef5b3491168d63af5e95d6dcdb2
18,794,776,905,395
97658d1d6a7dc9a3fdfdff46806e055fc0d1dcb2
/Chapter6/src/exercise/Coffetest.java
7caf575da8b877bfb6c7558ee282fe333dac33e1
[]
no_license
HyungMinKang/JAVA-practiceCode
https://github.com/HyungMinKang/JAVA-practiceCode
c18535c4b119c33e760e82811eea2752d94c105e
8410714fb26566cd28e32a10b8f2e6e5f1814ed7
refs/heads/master
2022-06-22T14:57:55.378000
2020-04-28T07:36:41
2020-04-28T07:36:41
259,546,712
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package exercise; public class Coffetest { public static void main(String[] args) { Person personkim=new Person("±è¾¾",10000); Person personlee=new Person("À̾¾",12000); Star starcoffee=new Star(); Cong congcofffe=new Cong(); personkim.buyStarCoffee(starcoffee, 4000); personlee.buyCongCoffee(congcofffe, 4200); } }
WINDOWS-1252
Java
351
java
Coffetest.java
Java
[]
null
[]
package exercise; public class Coffetest { public static void main(String[] args) { Person personkim=new Person("±è¾¾",10000); Person personlee=new Person("À̾¾",12000); Star starcoffee=new Star(); Cong congcofffe=new Cong(); personkim.buyStarCoffee(starcoffee, 4000); personlee.buyCongCoffee(congcofffe, 4200); } }
351
0.71137
0.64723
18
18.055555
18.440512
44
false
false
0
0
0
0
0
0
1.722222
false
false
8
5b97c7babb99abeacf51fe963fc41944b38ceb18
31,353,261,261,906
14431603e83103ea34fd371de5d36518424d99a5
/src/main/java/org/datasurvey/repository/PPreguntaCerradaOpcionRepository.java
cf2054c9d709da52ed18efb5c7c9ca8b3c2ac0bd
[ "MIT" ]
permissive
Quantum-P3/datasurvey
https://github.com/Quantum-P3/datasurvey
c9bee843f6a1867277b3619e1de6e7b9fad54252
fc03659f7ed0b2592939fe05a4d9cda4531af5bf
refs/heads/dev
2023-07-11T10:36:17.512000
2021-08-18T05:21:59
2021-08-18T05:21:59
382,707,818
0
0
MIT
false
2021-08-18T05:34:03
2021-07-03T20:55:10
2021-08-18T05:22:02
2021-08-18T05:34:03
42,649
0
0
0
Java
false
false
package org.datasurvey.repository; import org.datasurvey.domain.PPreguntaCerradaOpcion; import org.springframework.data.jpa.repository.*; import org.springframework.stereotype.Repository; /** * Spring Data SQL repository for the PPreguntaCerradaOpcion entity. */ @SuppressWarnings("unused") @Repository public interface PPreguntaCerradaOpcionRepository extends JpaRepository<PPreguntaCerradaOpcion, Long>, JpaSpecificationExecutor<PPreguntaCerradaOpcion> {}
UTF-8
Java
466
java
PPreguntaCerradaOpcionRepository.java
Java
[]
null
[]
package org.datasurvey.repository; import org.datasurvey.domain.PPreguntaCerradaOpcion; import org.springframework.data.jpa.repository.*; import org.springframework.stereotype.Repository; /** * Spring Data SQL repository for the PPreguntaCerradaOpcion entity. */ @SuppressWarnings("unused") @Repository public interface PPreguntaCerradaOpcionRepository extends JpaRepository<PPreguntaCerradaOpcion, Long>, JpaSpecificationExecutor<PPreguntaCerradaOpcion> {}
466
0.83691
0.83691
13
34.846153
30.926331
108
false
false
0
0
0
0
0
0
0.461538
false
false
8
18c184a4d163b3df595a64e21936824ac0ae1088
9,861,244,914,932
7b9a27e3a21013a550c51929fb0df6cac373749a
/sparkStu/src/main/java/com/netcloud/spark/sparkcore/Demo000_WordCountLocal.java
9ee757a2bb034564fee5ede645eb32244968006c
[]
no_license
ysjyang/bigdata-learning
https://github.com/ysjyang/bigdata-learning
94a56c7000809fcb72f3760f15eff6788a3e242b
1a889d42973db8e339e387ca1241703dd52e9112
refs/heads/master
2022-07-10T02:19:07.716000
2020-02-17T13:59:50
2020-02-17T13:59:50
161,416,080
0
0
null
false
2022-07-01T17:41:07
2018-12-12T01:32:17
2020-02-17T14:00:00
2022-07-01T17:41:06
5,155
0
0
6
Scala
false
false
//package com.netcloud.spark.sparkcore; // //import org.apache.spark.SparkConf; //import org.apache.spark.api.java.JavaPairRDD; //import org.apache.spark.api.java.JavaRDD; //import org.apache.spark.api.java.JavaSparkContext; //import org.apache.spark.api.java.function.FlatMapFunction; //import org.apache.spark.api.java.function.Function2; //import org.apache.spark.api.java.function.PairFunction; //import org.apache.spark.api.java.function.VoidFunction; //import scala.Tuple2; //import scala.collection.Iterable; // //import java.util.Arrays; // ///** // * 本地测试wordCount // * // * @author yangshaojun // * #date 2019/3/9 10:00 // * @version 1.0 // */ //public class Demo000_WordCountLocal { // public static void main(String[] args) { // // 编写spark应用程序 // // 第一步:创建sparkconf对象,设置spark应用配置信息 // // 使用setMaster()设置Spark应用程序要连接的Spark集群的Master节点的url // // 如果设置local则代表在本地执行 // SparkConf conf = new SparkConf().setAppName("wordCount").setMaster("local[2]"); // // 第二步: 创建JavaSparkContext对象 // // 在Spark中SparkContext是spark所有功能的入口,无论使用java、scala还是python编写都必须有一个sparkContext对象. // // 它的作用:初始化spark应用程序所需要的的一些核心组件,包括调度器(DAGSchedule、TaskSchedule) // // 还回去spark Master节点上进行注册等等。 // // 但是呢,在spark中编写不同类型的spark应用程序使用的spakContext是不同的, // // 如果使用scala那么就是sparkContext对象 // // 如果使用java那么就是JavaSparkContext对象 // // 如果开发spark Sql程序那么就是SQLContext或者HiveContext // // 如果是开发Spark Streaming程序,那么就是它独有的SparkContext。 // JavaSparkContext sc = new JavaSparkContext(conf); // // 第三步:从数据源(HDFS、本地文件等)加载数据 创建一个RDD // // parkContext中根据文件的类型输入源创建的RDD的方法 是textFile() // // 在java中,创建的普通RDD都叫做JavaRDD // // 在这里呢,RDD有元素的概念,如果是HDFS或者是本地文件创建的RDD,其每个元素相当于文件的一行数据。 // JavaRDD<String> linesRDD = sc.textFile("data/sparkcore/wordcount"); // // 第四步: 对初始的RDD进行transformation操作 // // 将每一行拆分成单个的单词 // JavaRDD<String> words = linesRDD.flatMap(new FlatMapFunction<String, String>() { // @Override // public Iterable<String> call(String line) throws Exception { // String[] str = line.split(","); // return Arrays.asList(line.split(",")) // } // }); // JavaPairRDD<String, Integer> word = words.mapToPair(new PairFunction<String, String, Integer>() { // @Override // public Tuple2<String, Integer> call(String s) { // return new Tuple2<String, Integer>(s, 1); // } // }); // JavaPairRDD<String, Integer> result = word.reduceByKey(new Function2<Integer, Integer, Integer>() { // @Override // public Integer call(Integer int1, Integer int2) throws Exception { // return int1 + int2; // } // }); // // result.foreach(new VoidFunction<Tuple2<String, Integer>>() { // @Override // public void call(Tuple2<String, Integer> stringIntegerTuple2) throws Exception { // System.out.println(stringIntegerTuple2); // } // }); // // // } //}
UTF-8
Java
3,778
java
Demo000_WordCountLocal.java
Java
[ { "context": "ays;\n//\n///**\n// * 本地测试wordCount\n// *\n// * @author yangshaojun\n// * #date 2019/3/9 10:00\n// * @version 1.0\n// *", "end": 603, "score": 0.7162986397743225, "start": 592, "tag": "USERNAME", "value": "yangshaojun" } ]
null
[]
//package com.netcloud.spark.sparkcore; // //import org.apache.spark.SparkConf; //import org.apache.spark.api.java.JavaPairRDD; //import org.apache.spark.api.java.JavaRDD; //import org.apache.spark.api.java.JavaSparkContext; //import org.apache.spark.api.java.function.FlatMapFunction; //import org.apache.spark.api.java.function.Function2; //import org.apache.spark.api.java.function.PairFunction; //import org.apache.spark.api.java.function.VoidFunction; //import scala.Tuple2; //import scala.collection.Iterable; // //import java.util.Arrays; // ///** // * 本地测试wordCount // * // * @author yangshaojun // * #date 2019/3/9 10:00 // * @version 1.0 // */ //public class Demo000_WordCountLocal { // public static void main(String[] args) { // // 编写spark应用程序 // // 第一步:创建sparkconf对象,设置spark应用配置信息 // // 使用setMaster()设置Spark应用程序要连接的Spark集群的Master节点的url // // 如果设置local则代表在本地执行 // SparkConf conf = new SparkConf().setAppName("wordCount").setMaster("local[2]"); // // 第二步: 创建JavaSparkContext对象 // // 在Spark中SparkContext是spark所有功能的入口,无论使用java、scala还是python编写都必须有一个sparkContext对象. // // 它的作用:初始化spark应用程序所需要的的一些核心组件,包括调度器(DAGSchedule、TaskSchedule) // // 还回去spark Master节点上进行注册等等。 // // 但是呢,在spark中编写不同类型的spark应用程序使用的spakContext是不同的, // // 如果使用scala那么就是sparkContext对象 // // 如果使用java那么就是JavaSparkContext对象 // // 如果开发spark Sql程序那么就是SQLContext或者HiveContext // // 如果是开发Spark Streaming程序,那么就是它独有的SparkContext。 // JavaSparkContext sc = new JavaSparkContext(conf); // // 第三步:从数据源(HDFS、本地文件等)加载数据 创建一个RDD // // parkContext中根据文件的类型输入源创建的RDD的方法 是textFile() // // 在java中,创建的普通RDD都叫做JavaRDD // // 在这里呢,RDD有元素的概念,如果是HDFS或者是本地文件创建的RDD,其每个元素相当于文件的一行数据。 // JavaRDD<String> linesRDD = sc.textFile("data/sparkcore/wordcount"); // // 第四步: 对初始的RDD进行transformation操作 // // 将每一行拆分成单个的单词 // JavaRDD<String> words = linesRDD.flatMap(new FlatMapFunction<String, String>() { // @Override // public Iterable<String> call(String line) throws Exception { // String[] str = line.split(","); // return Arrays.asList(line.split(",")) // } // }); // JavaPairRDD<String, Integer> word = words.mapToPair(new PairFunction<String, String, Integer>() { // @Override // public Tuple2<String, Integer> call(String s) { // return new Tuple2<String, Integer>(s, 1); // } // }); // JavaPairRDD<String, Integer> result = word.reduceByKey(new Function2<Integer, Integer, Integer>() { // @Override // public Integer call(Integer int1, Integer int2) throws Exception { // return int1 + int2; // } // }); // // result.foreach(new VoidFunction<Tuple2<String, Integer>>() { // @Override // public void call(Tuple2<String, Integer> stringIntegerTuple2) throws Exception { // System.out.println(stringIntegerTuple2); // } // }); // // // } //}
3,778
0.628599
0.619002
76
40.13158
27.062473
109
false
false
0
0
0
0
0
0
0.513158
false
false
8
489083baae01f43fa48058668f90a484ea6333be
28,200,755,291,185
6056649c87208c4df4bfacc9a14af68972060433
/src/List/Tester.java
b6c266ac995da6df07d3aa4d6dc13809bcee8134
[]
no_license
Velinguard/Java-Data-Structures
https://github.com/Velinguard/Java-Data-Structures
8b71507511bdd246ecb48e040e11c13cdb9ae441
332f673b36d219427c805ee40e39d5edbd9ac223
refs/heads/master
2021-01-24T12:20:01.091000
2018-03-19T14:31:02
2018-03-19T14:31:02
123,131,742
0
0
null
false
2018-02-27T16:13:40
2018-02-27T13:17:43
2018-02-27T14:13:16
2018-02-27T16:13:39
37
0
0
0
Java
false
null
package List; import java.util.ArrayList; import java.util.List; public class Tester { public static void main(String[] args) { List<Thread> thread = new ArrayList<>(); for (int i = 0; i < 1000; i++) { Thread th = new Thread(new runner()); th.run(); thread.add(th); } for (int i = 0; i < thread.size(); i++){ try { thread.get(i).join(); } catch (InterruptedException e) { e.printStackTrace(); } } } } class runner implements Runnable{ LinkedList<Integer> list; public runner(){ list = new LinkedList<>(new Integer[] {0, 1, 2}); } @Override public void run(){ int i = 1000; for (; i > 0; i--) { //list.add(new Integer(3)); list.add(new Integer(4)); list.remove(2 ); list.add(new Integer(2)); list.add(new Integer(3)); list.remove(1); list.remove(1); } output(); /* LinkedList<String> list2 = new LinkedList<>(new String[] {"Hello", "How", "Are"}); list2.add("You"); list2.add(1, ","); System.out.println(list2.toString());*/ } public void output(){ System.out.println(list.toString()); } }
UTF-8
Java
1,355
java
Tester.java
Java
[]
null
[]
package List; import java.util.ArrayList; import java.util.List; public class Tester { public static void main(String[] args) { List<Thread> thread = new ArrayList<>(); for (int i = 0; i < 1000; i++) { Thread th = new Thread(new runner()); th.run(); thread.add(th); } for (int i = 0; i < thread.size(); i++){ try { thread.get(i).join(); } catch (InterruptedException e) { e.printStackTrace(); } } } } class runner implements Runnable{ LinkedList<Integer> list; public runner(){ list = new LinkedList<>(new Integer[] {0, 1, 2}); } @Override public void run(){ int i = 1000; for (; i > 0; i--) { //list.add(new Integer(3)); list.add(new Integer(4)); list.remove(2 ); list.add(new Integer(2)); list.add(new Integer(3)); list.remove(1); list.remove(1); } output(); /* LinkedList<String> list2 = new LinkedList<>(new String[] {"Hello", "How", "Are"}); list2.add("You"); list2.add(1, ","); System.out.println(list2.toString());*/ } public void output(){ System.out.println(list.toString()); } }
1,355
0.477491
0.458303
56
23.196428
18.416239
90
false
false
0
0
0
0
0
0
0.660714
false
false
8
eb8f3d269455d9a64b117c1c4161febd49948b0e
17,119,739,684,429
9a920c9911b7be4cef2f593429fa4b68f7a49e2e
/app/src/main/java/cn/jcyh/eaglekinglockdemo/MainActivity.java
c314eb766b73de7c2ee049064d555794b875dc85
[]
no_license
JJOGGER/EaglekingLockDemo
https://github.com/JJOGGER/EaglekingLockDemo
42b87603fbbe6805effe7dcbb68586645370eb13
33a1abec106802dad2301188c85082a5d802a78c
refs/heads/master
2020-03-13T13:33:00.856000
2018-11-10T03:58:36
2018-11-10T03:58:38
131,141,022
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package cn.jcyh.eaglekinglockdemo; import android.Manifest; import android.bluetooth.BluetoothAdapter; import android.content.Intent; import android.support.v4.app.FragmentManager; import android.view.View; import com.tbruyelle.rxpermissions2.RxPermissions; import butterknife.OnClick; import cn.jcyh.eaglekinglockdemo.base.BaseActivity; import cn.jcyh.eaglekinglockdemo.base.BaseFragment; import cn.jcyh.eaglekinglockdemo.constant.Constants; import cn.jcyh.eaglekinglockdemo.control.ControlCenter; import cn.jcyh.eaglekinglockdemo.entity.LockKey; import cn.jcyh.eaglekinglockdemo.entity.LockUser; import cn.jcyh.eaglekinglockdemo.entity.SyncData; import cn.jcyh.eaglekinglockdemo.http.LockHttpAction; import cn.jcyh.eaglekinglockdemo.http.MyLockAPI; import cn.jcyh.eaglekinglockdemo.http.OnHttpRequestCallback; import cn.jcyh.eaglekinglockdemo.ui.activity.AuthActivity; import cn.jcyh.eaglekinglockdemo.ui.activity.ChooseLockActivity; import cn.jcyh.eaglekinglockdemo.ui.fragment.LockListFragment; import cn.jcyh.eaglekinglockdemo.ui.fragment.LockMainFragment; import cn.jcyh.utils.L; import cn.jcyh.utils.SPUtil; import io.reactivex.disposables.Disposable; import io.reactivex.functions.Consumer; public class MainActivity extends BaseActivity { private FragmentManager mFragmentManager; @Override public int getLayoutId() { return R.layout.activity_main; } @Override public int immersiveColor() { return getResources().getColor(R.color.colorAccent); } @Override protected void init() { MyLockAPI.getLockAPI().startBleService(this); RxPermissions rxPermissions = new RxPermissions(this); Disposable subscribe = rxPermissions .request(android.Manifest.permission.BLUETOOTH_ADMIN, Manifest.permission.ACCESS_COARSE_LOCATION) .subscribe(new Consumer<Boolean>() { @Override public void accept(Boolean granted) throws Exception { BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); if (!bluetoothAdapter.isEnabled()) bluetoothAdapter.enable(); MyLockAPI.getLockAPI().startBTDeviceScan(); } }); mFragmentManager = getSupportFragmentManager(); mFragmentManager.beginTransaction() .replace(R.id.fl_container, new LockListFragment(), LockListFragment.class.getName()) .commit(); syncData(); } @Override protected void onDestroy() { super.onDestroy(); MyLockAPI.getLockAPI().stopBleService(this); } @OnClick({R.id.tv_logout, R.id.tv_add_lock}) public void onClick(View v) { switch (v.getId()) { case R.id.tv_logout: startNewActivity(AuthActivity.class); finish(); break; case R.id.tv_add_lock: startNewActivity(ChooseLockActivity.class); break; } } @Override protected void onNewIntent(Intent intent) { super.onNewIntent(intent); mFragmentManager.beginTransaction() .replace(R.id.fl_container, new LockListFragment(), LockListFragment.class.getName()) .commit(); syncData(); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); L.e("--------------onActivityResult"); syncData(); } private void syncData() { final LockUser user = ControlCenter.getControlCenter(this).getUserInfo(); long lastUpdateDate = SPUtil.getInstance().getLong(Constants.LAST_UPDATE_DATE, 0); //记录此次请求的时间,下次可直接传该时间做增量更新 if (user != null) { LockHttpAction.getHttpAction(this).syncData(0, user.getAccess_token(), new OnHttpRequestCallback<SyncData>() { @Override public void onFailure(int errorCode, String desc) { cancelProgressDialog(); } @Override public void onSuccess(SyncData syncData) { cancelProgressDialog(); L.e("------sync:" + syncData); if (syncData != null && syncData.getKeyList() != null) { for (int i = 0; i < syncData.getKeyList().size(); i++) { LockKey key = syncData.getKeyList().get(i); key.setAccessToken(user.getAccess_token()); } SPUtil.getInstance().put(Constants.LAST_UPDATE_DATE, syncData.getLastUpdateDate()); ControlCenter.getControlCenter(getApplicationContext()).saveLockKeys(syncData.getKeyList()); BaseFragment fragment = (BaseFragment) mFragmentManager.findFragmentByTag(LockListFragment.class.getName()); if (fragment != null) fragment.loadData(); fragment = (BaseFragment) mFragmentManager.findFragmentByTag(LockMainFragment.class.getName()); if (fragment != null) fragment.loadData(); } } }); } } }
UTF-8
Java
5,478
java
MainActivity.java
Java
[ { "context": ");\n key.setAccessToken(user.getAccess_token());\n }\n ", "end": 4657, "score": 0.8378663063049316, "start": 4637, "tag": "KEY", "value": "user.getAccess_token" } ]
null
[]
package cn.jcyh.eaglekinglockdemo; import android.Manifest; import android.bluetooth.BluetoothAdapter; import android.content.Intent; import android.support.v4.app.FragmentManager; import android.view.View; import com.tbruyelle.rxpermissions2.RxPermissions; import butterknife.OnClick; import cn.jcyh.eaglekinglockdemo.base.BaseActivity; import cn.jcyh.eaglekinglockdemo.base.BaseFragment; import cn.jcyh.eaglekinglockdemo.constant.Constants; import cn.jcyh.eaglekinglockdemo.control.ControlCenter; import cn.jcyh.eaglekinglockdemo.entity.LockKey; import cn.jcyh.eaglekinglockdemo.entity.LockUser; import cn.jcyh.eaglekinglockdemo.entity.SyncData; import cn.jcyh.eaglekinglockdemo.http.LockHttpAction; import cn.jcyh.eaglekinglockdemo.http.MyLockAPI; import cn.jcyh.eaglekinglockdemo.http.OnHttpRequestCallback; import cn.jcyh.eaglekinglockdemo.ui.activity.AuthActivity; import cn.jcyh.eaglekinglockdemo.ui.activity.ChooseLockActivity; import cn.jcyh.eaglekinglockdemo.ui.fragment.LockListFragment; import cn.jcyh.eaglekinglockdemo.ui.fragment.LockMainFragment; import cn.jcyh.utils.L; import cn.jcyh.utils.SPUtil; import io.reactivex.disposables.Disposable; import io.reactivex.functions.Consumer; public class MainActivity extends BaseActivity { private FragmentManager mFragmentManager; @Override public int getLayoutId() { return R.layout.activity_main; } @Override public int immersiveColor() { return getResources().getColor(R.color.colorAccent); } @Override protected void init() { MyLockAPI.getLockAPI().startBleService(this); RxPermissions rxPermissions = new RxPermissions(this); Disposable subscribe = rxPermissions .request(android.Manifest.permission.BLUETOOTH_ADMIN, Manifest.permission.ACCESS_COARSE_LOCATION) .subscribe(new Consumer<Boolean>() { @Override public void accept(Boolean granted) throws Exception { BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); if (!bluetoothAdapter.isEnabled()) bluetoothAdapter.enable(); MyLockAPI.getLockAPI().startBTDeviceScan(); } }); mFragmentManager = getSupportFragmentManager(); mFragmentManager.beginTransaction() .replace(R.id.fl_container, new LockListFragment(), LockListFragment.class.getName()) .commit(); syncData(); } @Override protected void onDestroy() { super.onDestroy(); MyLockAPI.getLockAPI().stopBleService(this); } @OnClick({R.id.tv_logout, R.id.tv_add_lock}) public void onClick(View v) { switch (v.getId()) { case R.id.tv_logout: startNewActivity(AuthActivity.class); finish(); break; case R.id.tv_add_lock: startNewActivity(ChooseLockActivity.class); break; } } @Override protected void onNewIntent(Intent intent) { super.onNewIntent(intent); mFragmentManager.beginTransaction() .replace(R.id.fl_container, new LockListFragment(), LockListFragment.class.getName()) .commit(); syncData(); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); L.e("--------------onActivityResult"); syncData(); } private void syncData() { final LockUser user = ControlCenter.getControlCenter(this).getUserInfo(); long lastUpdateDate = SPUtil.getInstance().getLong(Constants.LAST_UPDATE_DATE, 0); //记录此次请求的时间,下次可直接传该时间做增量更新 if (user != null) { LockHttpAction.getHttpAction(this).syncData(0, user.getAccess_token(), new OnHttpRequestCallback<SyncData>() { @Override public void onFailure(int errorCode, String desc) { cancelProgressDialog(); } @Override public void onSuccess(SyncData syncData) { cancelProgressDialog(); L.e("------sync:" + syncData); if (syncData != null && syncData.getKeyList() != null) { for (int i = 0; i < syncData.getKeyList().size(); i++) { LockKey key = syncData.getKeyList().get(i); key.setAccessToken(user.getAccess_token()); } SPUtil.getInstance().put(Constants.LAST_UPDATE_DATE, syncData.getLastUpdateDate()); ControlCenter.getControlCenter(getApplicationContext()).saveLockKeys(syncData.getKeyList()); BaseFragment fragment = (BaseFragment) mFragmentManager.findFragmentByTag(LockListFragment.class.getName()); if (fragment != null) fragment.loadData(); fragment = (BaseFragment) mFragmentManager.findFragmentByTag(LockMainFragment.class.getName()); if (fragment != null) fragment.loadData(); } } }); } } }
5,478
0.62081
0.619889
136
38.926472
28.88151
132
false
false
0
0
0
0
0
0
0.602941
false
false
8
da2e3c44eaf760e9cd2cd35b79946d0f62561d30
16,492,674,435,500
4e1689e4ca255a2219c71d3705a821755b6ef83e
/deya/src/com/deya/wcm/services/appeal/cpLead/CpLeadRPC.java
506eefb25f487132415f586a91a44c1af651cffd
[]
no_license
373974360/oldCms
https://github.com/373974360/oldCms
2578a53aafa93ea12a3188ea4a3d52f8c0d75a72
5c1e8a158273ad408a5b92f7458b6b4a070d7ab3
refs/heads/master
2020-12-30T07:41:03.640000
2019-07-26T07:44:39
2019-07-26T07:44:39
238,907,158
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/** * */ package com.deya.wcm.services.appeal.cpLead; import java.util.List; import java.util.Map; import com.deya.wcm.bean.appeal.cpLead.CpLeadBean; /** * @author Administrator * */ public class CpLeadRPC { /** * 得到所有领导 * @return */ public static List<CpLeadBean> getAllCpLeadList(){ return CpLeadManager.getAllCpLeadList(); } /** * 新增注册领导 * @param lead * @return */ public static boolean insertCpLead(CpLeadBean lead){ return CpLeadManager.insertCpLead(lead); } /** * 修改注册领导 * @param lead * @return */ public static boolean updateCpLead(CpLeadBean lead){ return CpLeadManager.updateCpLead(lead); } /** * 删除 注册领导 * @param leads * @return */ public static boolean deleteCpLead(String leads){ return CpLeadManager.deleteCpLead(leads); } /** * 得到指定ID的领导 * @param lead_id * @return */ public static CpLeadBean getCpLeadById(String lead_id){ return CpLeadManager.getCpLeadById(lead_id); } /** * 保存领导用户排序 * @param m * @return */ public static boolean savesortCpLead(int start,String lead_ids){ return CpLeadManager.savesortCpLead(start,lead_ids); } /** * 根据条件、分页展示注册领导 * @param m * @return */ public static List<CpLeadBean> getCpLeadList(Map<String,String> m){ return CpLeadManager.getCpLeadList(m); } /** * 根据条件得到注册领导总数 * @param m * @return */ public static String getCpLeadCount(Map<String,String> m){ return CpLeadManager.getCpLeadCount(m); } }
UTF-8
Java
1,617
java
CpLeadRPC.java
Java
[ { "context": "wcm.bean.appeal.cpLead.CpLeadBean;\n\n/**\n * @author Administrator\n *\n */\npublic class CpLeadRPC {\n\t\n\t/**\n\t * 得到所有领导", "end": 184, "score": 0.555969774723053, "start": 171, "tag": "NAME", "value": "Administrator" } ]
null
[]
/** * */ package com.deya.wcm.services.appeal.cpLead; import java.util.List; import java.util.Map; import com.deya.wcm.bean.appeal.cpLead.CpLeadBean; /** * @author Administrator * */ public class CpLeadRPC { /** * 得到所有领导 * @return */ public static List<CpLeadBean> getAllCpLeadList(){ return CpLeadManager.getAllCpLeadList(); } /** * 新增注册领导 * @param lead * @return */ public static boolean insertCpLead(CpLeadBean lead){ return CpLeadManager.insertCpLead(lead); } /** * 修改注册领导 * @param lead * @return */ public static boolean updateCpLead(CpLeadBean lead){ return CpLeadManager.updateCpLead(lead); } /** * 删除 注册领导 * @param leads * @return */ public static boolean deleteCpLead(String leads){ return CpLeadManager.deleteCpLead(leads); } /** * 得到指定ID的领导 * @param lead_id * @return */ public static CpLeadBean getCpLeadById(String lead_id){ return CpLeadManager.getCpLeadById(lead_id); } /** * 保存领导用户排序 * @param m * @return */ public static boolean savesortCpLead(int start,String lead_ids){ return CpLeadManager.savesortCpLead(start,lead_ids); } /** * 根据条件、分页展示注册领导 * @param m * @return */ public static List<CpLeadBean> getCpLeadList(Map<String,String> m){ return CpLeadManager.getCpLeadList(m); } /** * 根据条件得到注册领导总数 * @param m * @return */ public static String getCpLeadCount(Map<String,String> m){ return CpLeadManager.getCpLeadCount(m); } }
1,617
0.666219
0.666219
93
15.010753
18.50806
68
false
false
0
0
0
0
0
0
1.086022
false
false
8
26e364a5c94dfc502346f432e7c9665eccedd10e
2,448,131,363,579
4ba7b0e4902947a04ec8c18c08a7d260914f2a60
/mybatis-annotation/src/main/java/com/soft1851/spring/mybatis/splider/lp.java
8a8b7a8c6779fab958e7b6c8c9ca8fc722d3cfc3
[]
no_license
zhao-rgb/spring-learnin
https://github.com/zhao-rgb/spring-learnin
5cc364e8c34071a45ac253224f65c3e1f4dfcd77
aa6e3fb2f8b7b29c299c9587bd4e7160b83fe9dc
refs/heads/master
2022-12-23T17:07:09.163000
2020-04-12T09:12:25
2020-04-12T09:12:25
248,455,096
0
0
null
false
2022-12-16T15:31:14
2020-03-19T08:58:21
2020-04-12T09:12:39
2022-12-16T15:31:11
219
0
0
10
Java
false
false
package com.soft1851.spring.mybatis.splider; import com.alibaba.fastjson.JSONObject; import com.soft1851.spring.mybatis.entity.Music; import org.apache.http.HttpEntity; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPost; import org.apache.http.client.protocol.HttpClientContext; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; import java.io.IOException; import java.util.ArrayList; import java.util.List; /** * @author zhao * @className lp * @Description TODO * @Date 2020/4/3 * @Version 1.0 **/ public class lp { private static final Integer SUCCESS = 200; public static List<Music> getMusics(){ List<Music> musics = new ArrayList<>(); //网易云音乐链接请求头 String userAgent = "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.162 Mobile Safari/537.36"; String url = "https://music.163.com/m/discover/toplist?id=991319590"; CloseableHttpClient httpClient = HttpClients.createDefault(); HttpPost httpPost = new HttpPost(url); //设置请求头 httpPost.setHeader("User-Agent", userAgent); HttpClientContext context = HttpClientContext.create(); try { CloseableHttpResponse response = httpClient.execute(httpPost, context); int statusCode = response.getStatusLine().getStatusCode(); if(statusCode==SUCCESS){ HttpEntity entity = response.getEntity(); String res= null; res = EntityUtils.toString(entity, "UTF-8"); Document document = Jsoup.parse(res); Elements elements = document.getElementsByClass("m-sglst"); for(Element element :elements){ for(int i=0;i<element.childNodeSize();i++){ //获取每首音乐的id String musicId =element.child(i).attr("href").replace("//music.163.com/m/song?id=",""); //获取每首音乐的名字 String musicName = element.child(i).child(1).child(0).getElementsByClass("f-thide sgtl").text(); //获取每首音乐的作者 String author =element.child(i).child(1).child(0).getElementsByClass("f-thide sginfo").text(); //获取MKOnlinePlayer的对应json链接 String musicUrl = "http://music.uixsj.cn/api.php?callback=jQuery1113034466587161790607_1585798563762&types=url&id="+musicId+"&source=netease"; //获取音乐的下载链接 String downloadUrl=getUrl(musicUrl); Music music = Music.builder().id(Integer.parseInt(musicId)) .url(downloadUrl) .musicName(musicName) .build(); musics.add(music); } } } } catch (IOException e) { e.printStackTrace(); } try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } return musics; } public static String getUrl(String url){ HttpGet get = new HttpGet(url); CloseableHttpClient httpClient = HttpClients.createDefault(); HttpClientContext context = HttpClientContext.create(); CloseableHttpResponse response = null; try { response = httpClient.execute(get, context); } catch (IOException e) { e.printStackTrace(); } if(response.getStatusLine().getStatusCode()==SUCCESS){ HttpEntity entity = response.getEntity(); String res = null; try { res = EntityUtils.toString(entity, "UTF-8"); } catch (IOException e) { e.printStackTrace(); } String[] str=res.replace(")","(").split("\\("); String jsonContent = str[1]; JSONObject jsonObject = JSONObject.parseObject(jsonContent); return jsonObject.get("url").toString(); } System.out.println("获取失败"); return null; } public static void main(String[] args) { System.out.println(getMusics()); } }
UTF-8
Java
4,992
java
lp.java
Java
[ { "context": "ayList;\r\nimport java.util.List;\r\n\r\n/**\r\n * @author zhao\r\n * @className lp\r\n * @Description TODO\r\n * @Date", "end": 774, "score": 0.9966675043106079, "start": 770, "tag": "USERNAME", "value": "zhao" } ]
null
[]
package com.soft1851.spring.mybatis.splider; import com.alibaba.fastjson.JSONObject; import com.soft1851.spring.mybatis.entity.Music; import org.apache.http.HttpEntity; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPost; import org.apache.http.client.protocol.HttpClientContext; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; import java.io.IOException; import java.util.ArrayList; import java.util.List; /** * @author zhao * @className lp * @Description TODO * @Date 2020/4/3 * @Version 1.0 **/ public class lp { private static final Integer SUCCESS = 200; public static List<Music> getMusics(){ List<Music> musics = new ArrayList<>(); //网易云音乐链接请求头 String userAgent = "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.162 Mobile Safari/537.36"; String url = "https://music.163.com/m/discover/toplist?id=991319590"; CloseableHttpClient httpClient = HttpClients.createDefault(); HttpPost httpPost = new HttpPost(url); //设置请求头 httpPost.setHeader("User-Agent", userAgent); HttpClientContext context = HttpClientContext.create(); try { CloseableHttpResponse response = httpClient.execute(httpPost, context); int statusCode = response.getStatusLine().getStatusCode(); if(statusCode==SUCCESS){ HttpEntity entity = response.getEntity(); String res= null; res = EntityUtils.toString(entity, "UTF-8"); Document document = Jsoup.parse(res); Elements elements = document.getElementsByClass("m-sglst"); for(Element element :elements){ for(int i=0;i<element.childNodeSize();i++){ //获取每首音乐的id String musicId =element.child(i).attr("href").replace("//music.163.com/m/song?id=",""); //获取每首音乐的名字 String musicName = element.child(i).child(1).child(0).getElementsByClass("f-thide sgtl").text(); //获取每首音乐的作者 String author =element.child(i).child(1).child(0).getElementsByClass("f-thide sginfo").text(); //获取MKOnlinePlayer的对应json链接 String musicUrl = "http://music.uixsj.cn/api.php?callback=jQuery1113034466587161790607_1585798563762&types=url&id="+musicId+"&source=netease"; //获取音乐的下载链接 String downloadUrl=getUrl(musicUrl); Music music = Music.builder().id(Integer.parseInt(musicId)) .url(downloadUrl) .musicName(musicName) .build(); musics.add(music); } } } } catch (IOException e) { e.printStackTrace(); } try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } return musics; } public static String getUrl(String url){ HttpGet get = new HttpGet(url); CloseableHttpClient httpClient = HttpClients.createDefault(); HttpClientContext context = HttpClientContext.create(); CloseableHttpResponse response = null; try { response = httpClient.execute(get, context); } catch (IOException e) { e.printStackTrace(); } if(response.getStatusLine().getStatusCode()==SUCCESS){ HttpEntity entity = response.getEntity(); String res = null; try { res = EntityUtils.toString(entity, "UTF-8"); } catch (IOException e) { e.printStackTrace(); } String[] str=res.replace(")","(").split("\\("); String jsonContent = str[1]; JSONObject jsonObject = JSONObject.parseObject(jsonContent); return jsonObject.get("url").toString(); } System.out.println("获取失败"); return null; } public static void main(String[] args) { System.out.println(getMusics()); } }
4,992
0.554187
0.53202
114
40.736843
30.69289
170
false
false
0
0
0
0
0
0
0.640351
false
false
8
1193d8ce1510aa8b5958ca45618d03b124cf0b0e
15,685,220,580,559
04f4230ae587811a4f7cfedea0daf68701ce600b
/Seven.java
74cd49fcc9252725b7186ef6ccdd2af559ae9111
[]
no_license
rabingaire/javaclass
https://github.com/rabingaire/javaclass
2e59c987a1f9ee5c95aaa853d2b022670d90a43e
8335e2b8928c8348bc99231840d23fa0312e4a27
refs/heads/master
2020-03-28T06:16:51.145000
2018-09-13T14:42:58
2018-09-13T14:42:58
147,824,680
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
public class Seven { public static void main(String[] args) { int a = 12; int b = 13; // Desicion making if (a == b) { // false System.out.println("First: I am Equal"); } if (a != b) { // true System.out.println("Second: I am Equal"); } else { System.out.println("Second: I am not Equal"); } } }
UTF-8
Java
352
java
Seven.java
Java
[]
null
[]
public class Seven { public static void main(String[] args) { int a = 12; int b = 13; // Desicion making if (a == b) { // false System.out.println("First: I am Equal"); } if (a != b) { // true System.out.println("Second: I am Equal"); } else { System.out.println("Second: I am not Equal"); } } }
352
0.525568
0.514205
16
21
16.896746
51
false
false
0
0
0
0
0
0
0.3125
false
false
8
2906c2689523bf66038b0cf98862021cf92f1803
4,320,737,144,981
69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e
/methods/Method_50188.java
fb27ddd5dbacce4a030d86299c8a691641adcf9b
[]
no_license
P79N6A/icse_20_user_study
https://github.com/P79N6A/icse_20_user_study
5b9c42c6384502fdc9588430899f257761f1f506
8a3676bc96059ea2c4f6d209016f5088a5628f3c
refs/heads/master
2020-06-24T08:25:22.606000
2019-07-25T15:31:16
2019-07-25T15:31:16
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
public String getThumbnailBigPath(){ if (new File(thumbnailBigPath).exists()) { return thumbnailBigPath; } return ""; }
UTF-8
Java
130
java
Method_50188.java
Java
[]
null
[]
public String getThumbnailBigPath(){ if (new File(thumbnailBigPath).exists()) { return thumbnailBigPath; } return ""; }
130
0.692308
0.692308
6
20.666666
16.367311
44
false
false
0
0
0
0
0
0
0.333333
false
false
8
a35102fc940d61083c9cc7e8bc896cec41ed0859
2,207,613,236,152
8dd054d0ba48875cdfffe1485587a8dc59395b2b
/trade7/src/main/java/com/liantuo/deposit/common/constants/errorcode/ErrorCode008Constants.java
1ce00052c0bb85b955d9693adc80d2bf152c1cab
[]
no_license
Yellasa/trade
https://github.com/Yellasa/trade
5079c9ec30dd10e61d0bc8cbde91279ce298a266
2315e46ab61acd1ea37e883fae521cd1f20c35c9
refs/heads/master
2020-12-21T21:47:21.351000
2018-08-29T06:17:07
2018-08-29T06:17:07
62,866,663
1
3
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.liantuo.deposit.common.constants.errorcode; public class ErrorCode008Constants { }
UTF-8
Java
98
java
ErrorCode008Constants.java
Java
[]
null
[]
package com.liantuo.deposit.common.constants.errorcode; public class ErrorCode008Constants { }
98
0.816327
0.785714
6
15.333333
22.02776
55
false
false
0
0
0
0
0
0
0.166667
false
false
8
9eacace5f063b4c56cb6d0f7d24d289d14afc240
8,486,855,402,912
4b9fc7a13a6f824b208dc7a2378fea5f8c19bd94
/PBL1_AP2/src/modulo/ItemPedido.java
00d8b8f3dbcedbb8d080928cd7b0e3e122f8d515
[]
no_license
absilva21/PBL_AP2
https://github.com/absilva21/PBL_AP2
65ef1c501196405464ba4aa18eca6ee925f8454b
6850a6057b0aac4d8ff1908cd91461b9da0f1061
refs/heads/main
2023-08-05T11:50:15.617000
2021-09-14T17:01:03
2021-09-14T17:01:03
398,076,301
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package modulo; /******************************************************************************* Autor: Alisson Bomfim da Silva Componente Curricular: Algoritmos I Concluido em: 14/10/2011 Declaro que este código foi elaborado por mim de forma individual e não contém nenhum trecho de código de outro colega ou de outro autor, tais como provindos de livros e apostilas, e páginas ou documentos eletrônicos da Internet. Qualquer trecho de código de outra autoria que não a minha está destacado com uma citação para o autor e a fonte do código, e estou ciente que estes trechos não serão considerados para fins de avaliação. ******************************************************************************************/ class ItemPedido { int quantidade; String observacao; Pedido pedido; /** * */ Cardapio OpcaoMenu; public Cardapio getOpcaoMenu() { return OpcaoMenu; } public void setOpcaoMenu(Cardapio opcaoMenu) { OpcaoMenu = opcaoMenu; } public Pedido getPedido() { return pedido; } public void setPedido(Pedido pedido) { this.pedido = pedido; this.pedido.itens.add(this); } public int getQuantidade() { return quantidade; } public void setQuantidade(int quantidade) { this.quantidade = quantidade; } public String getObservacao() { return observacao; } public void setObservacao(String observacao) { this.observacao = observacao; } public ItemPedido(Cardapio c, int quan, String obs) { this.OpcaoMenu = c; this.quantidade = quan; this.observacao = obs; } }
UTF-8
Java
1,604
java
ItemPedido.java
Java
[ { "context": "******************************************\r\nAutor: Alisson Bomfim da Silva\r\nComponente Curricular: Algoritmos I\r\nConcluido e", "end": 129, "score": 0.9998656511306763, "start": 106, "tag": "NAME", "value": "Alisson Bomfim da Silva" } ]
null
[]
package modulo; /******************************************************************************* Autor: <NAME> Componente Curricular: Algoritmos I Concluido em: 14/10/2011 Declaro que este código foi elaborado por mim de forma individual e não contém nenhum trecho de código de outro colega ou de outro autor, tais como provindos de livros e apostilas, e páginas ou documentos eletrônicos da Internet. Qualquer trecho de código de outra autoria que não a minha está destacado com uma citação para o autor e a fonte do código, e estou ciente que estes trechos não serão considerados para fins de avaliação. ******************************************************************************************/ class ItemPedido { int quantidade; String observacao; Pedido pedido; /** * */ Cardapio OpcaoMenu; public Cardapio getOpcaoMenu() { return OpcaoMenu; } public void setOpcaoMenu(Cardapio opcaoMenu) { OpcaoMenu = opcaoMenu; } public Pedido getPedido() { return pedido; } public void setPedido(Pedido pedido) { this.pedido = pedido; this.pedido.itens.add(this); } public int getQuantidade() { return quantidade; } public void setQuantidade(int quantidade) { this.quantidade = quantidade; } public String getObservacao() { return observacao; } public void setObservacao(String observacao) { this.observacao = observacao; } public ItemPedido(Cardapio c, int quan, String obs) { this.OpcaoMenu = c; this.quantidade = quan; this.observacao = obs; } }
1,587
0.633501
0.628463
62
23.612904
26.348995
91
false
false
0
0
0
0
0
0
1.209677
false
false
8
8b9b44f9eab3f31c464aba66b75ac658ec638f49
9,010,841,397,906
4fe025040748495373ef0f24330a04bd02219976
/src/main/java/build/dream/common/utils/ParallelUtils.java
db32a1b366d0e5127adaf5891d7b012aa11acd03
[]
no_license
liuyandong33/saas-common
https://github.com/liuyandong33/saas-common
044bf794faf033b9eeb87b3f80613aabb79f97ba
bb37de13f04782e3c05673c9b3113c02ef7e6e82
refs/heads/master
2021-01-01T17:59:01.434000
2020-06-20T21:21:45
2020-06-20T21:21:45
98,187,433
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package build.dream.common.utils; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.*; public class ParallelUtils { private static final ExecutorService EXECUTOR_SERVICE = Executors.newCachedThreadPool(); public static <T> Map<String, T> invokeAll(Map<String, Callable<T>> callableMap) throws InterruptedException, ExecutionException { List<Future<T>> futures = EXECUTOR_SERVICE.invokeAll(callableMap.values()); Set<String> keySet = callableMap.keySet(); int index = 0; Map<String, T> result = new HashMap<String, T>(); for (String key : keySet) { result.put(key, futures.get(index).get()); index++; } return result; } }
UTF-8
Java
788
java
ParallelUtils.java
Java
[]
null
[]
package build.dream.common.utils; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.*; public class ParallelUtils { private static final ExecutorService EXECUTOR_SERVICE = Executors.newCachedThreadPool(); public static <T> Map<String, T> invokeAll(Map<String, Callable<T>> callableMap) throws InterruptedException, ExecutionException { List<Future<T>> futures = EXECUTOR_SERVICE.invokeAll(callableMap.values()); Set<String> keySet = callableMap.keySet(); int index = 0; Map<String, T> result = new HashMap<String, T>(); for (String key : keySet) { result.put(key, futures.get(index).get()); index++; } return result; } }
788
0.670051
0.668782
24
31.833334
32.35051
134
false
false
0
0
0
0
0
0
0.833333
false
false
8
6926e29efc644ba43707bb1caafab456de20d2ae
2,628,519,997,154
26cbdaed9a77ee221074294b1fe093e49885ea6b
/Firtst/src/Day3/example7_.java
cd39f9e2b6015e720003095a980816a3d68dffb9
[]
no_license
narnhada/Java
https://github.com/narnhada/Java
f1392f70722c01e6ab7a807bcd12914f3a8c66d1
64a33307322dbbea9b72eb39a1b570a672787d68
refs/heads/master
2022-12-22T12:27:40.678000
2020-02-25T00:43:33
2020-02-25T00:43:33
242,874,853
0
0
null
false
2022-12-16T10:04:08
2020-02-25T00:35:58
2020-02-25T00:45:08
2022-12-16T10:04:05
2,438
0
0
5
Java
false
false
package Day3; public class example7_ { public static void main(String[] args) { int[] data = {1,3,5,8,9,11,15,19,18,20,30,33,31}; int sum = 0; int num = 0; int i; for(i=0;i<data.length;i++) { if(data[i]%3==0) { System.out.println(data[i]); sum += data[i]; num +=1 ; /// 갯수 셀때 유용함 } } System.out.println("주어진 배열에서 3의 배수의 개수 =>"+ num); System.out.println("주어진 배열에서 3의 배수의 합 =>"+ sum); } } //주어진 배열에서 3의 배수의 개수 =>6 //주어진 배열에서 3의 배수의 합 =>108
UTF-8
Java
637
java
example7_.java
Java
[]
null
[]
package Day3; public class example7_ { public static void main(String[] args) { int[] data = {1,3,5,8,9,11,15,19,18,20,30,33,31}; int sum = 0; int num = 0; int i; for(i=0;i<data.length;i++) { if(data[i]%3==0) { System.out.println(data[i]); sum += data[i]; num +=1 ; /// 갯수 셀때 유용함 } } System.out.println("주어진 배열에서 3의 배수의 개수 =>"+ num); System.out.println("주어진 배열에서 3의 배수의 합 =>"+ sum); } } //주어진 배열에서 3의 배수의 개수 =>6 //주어진 배열에서 3의 배수의 합 =>108
637
0.512428
0.441683
30
16.466667
16.534275
52
false
false
23
0.043977
0
0
0
0
3.233333
false
false
8
a645c6b07f2d4c96f3751b5ad0c7903feb61654c
9,259,949,535,893
7fecc5772f7cd88fbe515350174922fed09b1d1e
/framework/src/main/java/org/freda/thrones/framework/remote/handler/ChannelChainHandlerDispatcher.java
74d4f6939fbcc8875c0055192d4f69c43c28ba0e
[]
no_license
FredaTeam/thrones
https://github.com/FredaTeam/thrones
18e66e7ca1c46e5e9bf3ffa5533202e22da0348f
fec049edd81da8d267eed357a610d4ebb37e869d
refs/heads/master
2020-03-25T13:47:41.964000
2018-09-30T04:15:06
2018-09-30T04:15:06
143,843,189
7
1
null
false
2018-09-25T23:45:07
2018-08-07T08:27:47
2018-09-21T15:16:17
2018-09-25T23:45:06
302
7
2
0
Java
false
null
package org.freda.thrones.framework.remote.handler; import lombok.extern.slf4j.Slf4j; import org.freda.thrones.framework.remote.ChannelChain; import java.util.Arrays; import java.util.Collection; import java.util.concurrent.CopyOnWriteArraySet; /** * Create on 2018/9/5 14:45 */ @Slf4j public class ChannelChainHandlerDispatcher implements ChannelChainHandler { private final Collection<ChannelChainHandler> channelHandlers = new CopyOnWriteArraySet<ChannelChainHandler>(); public ChannelChainHandlerDispatcher() { } public ChannelChainHandlerDispatcher(ChannelChainHandler... handlers) { this(handlers == null ? null : Arrays.asList(handlers)); } public ChannelChainHandlerDispatcher(Collection<ChannelChainHandler> handlers) { if (handlers != null && !handlers.isEmpty()) { this.channelHandlers.addAll(handlers); } } public Collection<ChannelChainHandler> getChannelHandlers() { return channelHandlers; } @Override public void onConnected(ChannelChain channelChain) { channelHandlers.forEach(it -> { try { it.onConnected(channelChain); } catch (Throwable t) { log.error(t.getMessage(), t); } }); } @Override public void onDisConnected(ChannelChain channelChain) { channelHandlers.forEach(it -> { try { it.onDisConnected(channelChain); } catch (Throwable t) { log.error(t.getMessage(), t); } }); } @Override public void onReceived(ChannelChain channelChain, Object message) { channelHandlers.forEach(it -> { try { it.onReceived(channelChain, message); } catch (Throwable t) { log.error(t.getMessage(), t); } }); } @Override public void onSent(ChannelChain channelChain, Object message) { channelHandlers.forEach(it -> { try { it.onSent(channelChain, message); } catch (Throwable t) { log.error(t.getMessage(), t); } }); } @Override public void onError(ChannelChain channelChain, Throwable throwable) { channelHandlers.forEach(it -> { try { it.onError(channelChain, throwable); } catch (Throwable t) { log.error(t.getMessage(), t); } }); } }
UTF-8
Java
2,517
java
ChannelChainHandlerDispatcher.java
Java
[]
null
[]
package org.freda.thrones.framework.remote.handler; import lombok.extern.slf4j.Slf4j; import org.freda.thrones.framework.remote.ChannelChain; import java.util.Arrays; import java.util.Collection; import java.util.concurrent.CopyOnWriteArraySet; /** * Create on 2018/9/5 14:45 */ @Slf4j public class ChannelChainHandlerDispatcher implements ChannelChainHandler { private final Collection<ChannelChainHandler> channelHandlers = new CopyOnWriteArraySet<ChannelChainHandler>(); public ChannelChainHandlerDispatcher() { } public ChannelChainHandlerDispatcher(ChannelChainHandler... handlers) { this(handlers == null ? null : Arrays.asList(handlers)); } public ChannelChainHandlerDispatcher(Collection<ChannelChainHandler> handlers) { if (handlers != null && !handlers.isEmpty()) { this.channelHandlers.addAll(handlers); } } public Collection<ChannelChainHandler> getChannelHandlers() { return channelHandlers; } @Override public void onConnected(ChannelChain channelChain) { channelHandlers.forEach(it -> { try { it.onConnected(channelChain); } catch (Throwable t) { log.error(t.getMessage(), t); } }); } @Override public void onDisConnected(ChannelChain channelChain) { channelHandlers.forEach(it -> { try { it.onDisConnected(channelChain); } catch (Throwable t) { log.error(t.getMessage(), t); } }); } @Override public void onReceived(ChannelChain channelChain, Object message) { channelHandlers.forEach(it -> { try { it.onReceived(channelChain, message); } catch (Throwable t) { log.error(t.getMessage(), t); } }); } @Override public void onSent(ChannelChain channelChain, Object message) { channelHandlers.forEach(it -> { try { it.onSent(channelChain, message); } catch (Throwable t) { log.error(t.getMessage(), t); } }); } @Override public void onError(ChannelChain channelChain, Throwable throwable) { channelHandlers.forEach(it -> { try { it.onError(channelChain, throwable); } catch (Throwable t) { log.error(t.getMessage(), t); } }); } }
2,517
0.593564
0.588399
89
27.280899
24.793524
115
false
false
0
0
0
0
0
0
0.404494
false
false
8
b4b07568e79aea0a534032ece64b33e5ffd5e49c
25,245,817,816,126
3bd137cff24fa0b22e0e859ba35233ddf4c4a780
/src/main/java/com/zhitu/jt808server/common/constant/UniversalAckResult.java
737542d016344cdc084c7228011971b070de1d8c
[]
no_license
charliexp/jt808server
https://github.com/charliexp/jt808server
1047368366bb94ef7facbf3232097525701812a7
ec11a8e9da0c9babd2afee101a61bcfc4f065a33
refs/heads/master
2023-03-15T09:15:04.387000
2020-05-28T11:45:16
2020-05-28T11:45:16
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.zhitu.jt808server.common.constant; /** * 平台通用响应结果,jt808-2011 中具有如下五种: * <ol> * <li>0:成功/确认</li> * <li>1:失败</li> * <li>2:消息有误</li> * <li>3:不支持</li> * <li>4:报警处理确认</li> * </ol> * * @author Jun * @date 2020-03-26 14:31 */ public interface UniversalAckResult { byte SUCCESS = 0; byte FAILURE = 1; byte ERR_MSG = 2; byte NOT_SUPPORT = 3; byte WARNING_PROCESS_ACK = 4; }
UTF-8
Java
527
java
UniversalAckResult.java
Java
[ { "context": "i>\n * <li>4:报警处理确认</li>\n * </ol>\n *\n * @author Jun\n * @date 2020-03-26 14:31\n */\npublic interface Un", "end": 233, "score": 0.99908447265625, "start": 230, "tag": "NAME", "value": "Jun" } ]
null
[]
package com.zhitu.jt808server.common.constant; /** * 平台通用响应结果,jt808-2011 中具有如下五种: * <ol> * <li>0:成功/确认</li> * <li>1:失败</li> * <li>2:消息有误</li> * <li>3:不支持</li> * <li>4:报警处理确认</li> * </ol> * * @author Jun * @date 2020-03-26 14:31 */ public interface UniversalAckResult { byte SUCCESS = 0; byte FAILURE = 1; byte ERR_MSG = 2; byte NOT_SUPPORT = 3; byte WARNING_PROCESS_ACK = 4; }
527
0.531868
0.461538
27
15.851851
12.420723
46
false
false
0
0
0
0
0
0
0.222222
false
false
8
985d5fe48e92b1ec00fb3482e370a2b874ca37d1
4,346,506,916,099
6f32e2237ec44245c18a035a27774a6129cb44a6
/atomicity/NewThread5.java
5b38df9415c62978a04cf52af3e66ec9c4c0f965
[ "SMLNJ", "BSD-3-Clause" ]
permissive
rishav1606/Velodrome_CS636
https://github.com/rishav1606/Velodrome_CS636
aca1c96c7e03ba46bf390b712695b24436c85a1e
25a0b2d9b040951e7194f233659f8616c2c83200
refs/heads/main
2023-04-24T18:11:57.896000
2021-05-12T13:26:33
2021-05-12T13:26:33
366,348,946
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package atomicity; public class NewThread5 implements Runnable { int index; Thread t; static MyObject4 obj = new MyObject4(10); public NewThread5(int i) { // Create a new thread if (i == 1) { index = 1; t = new Thread(this, "First Thread"); } else if (i == 2){ index = 2; t = new Thread(this, "Second Thread"); } else { index = 3; t = new Thread(this, "Third Thread"); } t.start(); // Start the thread } @Override public void run() { access(); } public void access() { try { if (index == 1) { System.out.println("Thread 1 writing to obj for the first time"); obj.a = 10; Thread.sleep(10000); obj.a = 40; System.out.println("Thread 1 writing to obj for the second time"); } else if (index == 2) { System.out.println("Thread 2 writing to obj for the first time"); obj.a = 50; Thread.sleep(5000); // obj.a = 60; // System.out.println("Thread 2 writing to obj for the second time"); } else if (index == 3) { System.out.println("Thread 3 writing to obj for the first time"); obj.a = 100; } else { // Do nothing } } catch(Exception e) { e.printStackTrace(); } } }
UTF-8
Java
1,304
java
NewThread5.java
Java
[]
null
[]
package atomicity; public class NewThread5 implements Runnable { int index; Thread t; static MyObject4 obj = new MyObject4(10); public NewThread5(int i) { // Create a new thread if (i == 1) { index = 1; t = new Thread(this, "First Thread"); } else if (i == 2){ index = 2; t = new Thread(this, "Second Thread"); } else { index = 3; t = new Thread(this, "Third Thread"); } t.start(); // Start the thread } @Override public void run() { access(); } public void access() { try { if (index == 1) { System.out.println("Thread 1 writing to obj for the first time"); obj.a = 10; Thread.sleep(10000); obj.a = 40; System.out.println("Thread 1 writing to obj for the second time"); } else if (index == 2) { System.out.println("Thread 2 writing to obj for the first time"); obj.a = 50; Thread.sleep(5000); // obj.a = 60; // System.out.println("Thread 2 writing to obj for the second time"); } else if (index == 3) { System.out.println("Thread 3 writing to obj for the first time"); obj.a = 100; } else { // Do nothing } } catch(Exception e) { e.printStackTrace(); } } }
1,304
0.539877
0.509969
54
23.148148
20.19755
76
false
false
0
0
0
0
0
0
0.518519
false
false
8
b997d48650feca0c375b817a412f99ea63595d49
10,711,648,460,641
420e4d6ffb7b355be8534b5a40e9ca4cf61394f1
/Server/src/guard/server/server/clientpacket/C_CheckGameActivePlayer.java
aa2e793707643e7b20f0398c096d506421f83867
[]
no_license
ibmboy19/the-guardian
https://github.com/ibmboy19/the-guardian
1a90d130a1332efc3c228176d9a355713a8a23b7
21924baf2fef82741c8e25cfd581b554de0ae705
refs/heads/master
2021-01-17T16:59:34.389000
2014-02-22T11:23:06
2014-02-22T11:23:06
32,198,479
2
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package guard.server.server.clientpacket; import static guard.server.server.clientpacket.ClientOpcodes.C_CheckGameActivePlayer; import static guard.server.server.clientpacket.ClientOpcodes.C_PacketSymbol; import guard.server.server.ClientProcess; import guard.server.server.model.GameRoom; import guard.server.server.model.instance.GameInstance; import guard.server.server.model.instance.PlayerInstance; public class C_CheckGameActivePlayer { public C_CheckGameActivePlayer(ClientProcess _client, String _packet) { PlayerInstance pc = _client.getActiveChar(); if (pc == null) return; GameRoom room = pc.getRoom(); if (room == null) { pc.SendClientPacket(String.valueOf(C_CheckGameActivePlayer) + C_PacketSymbol + "0"); return; } GameInstance game = room.getGame(); if (game == null) { pc.SendClientPacket(String.valueOf(C_CheckGameActivePlayer) + C_PacketSymbol + "0"); return; } room.broadcastPacketToRoom(String.valueOf(C_CheckGameActivePlayer) + C_PacketSymbol + String.valueOf(room.get_membersList().size())); } }
UTF-8
Java
1,106
java
C_CheckGameActivePlayer.java
Java
[]
null
[]
package guard.server.server.clientpacket; import static guard.server.server.clientpacket.ClientOpcodes.C_CheckGameActivePlayer; import static guard.server.server.clientpacket.ClientOpcodes.C_PacketSymbol; import guard.server.server.ClientProcess; import guard.server.server.model.GameRoom; import guard.server.server.model.instance.GameInstance; import guard.server.server.model.instance.PlayerInstance; public class C_CheckGameActivePlayer { public C_CheckGameActivePlayer(ClientProcess _client, String _packet) { PlayerInstance pc = _client.getActiveChar(); if (pc == null) return; GameRoom room = pc.getRoom(); if (room == null) { pc.SendClientPacket(String.valueOf(C_CheckGameActivePlayer) + C_PacketSymbol + "0"); return; } GameInstance game = room.getGame(); if (game == null) { pc.SendClientPacket(String.valueOf(C_CheckGameActivePlayer) + C_PacketSymbol + "0"); return; } room.broadcastPacketToRoom(String.valueOf(C_CheckGameActivePlayer) + C_PacketSymbol + String.valueOf(room.get_membersList().size())); } }
1,106
0.734177
0.732369
32
32.5625
25.150717
85
false
false
0
0
0
0
0
0
2.1875
false
false
8
24c49d145caa27fea833c9cd1f05ce2e41a525ec
23,931,557,812,391
45b557c70b2966689c532ec2847875fb760af7d7
/IRIS/OpenflowJ-IRIS/src/org/openflow/protocol/factory/VersionedMessageParser.java
8e5857ce528c767e185932aaf714a26ef866d5c5
[]
no_license
Hyunjeong/IRIS_ARPManger
https://github.com/Hyunjeong/IRIS_ARPManger
e5d4021b5abe6e7aad90b6b5b34d7730b2256040
818e0824ecd8b34d5a7b5c06b86974042713db25
refs/heads/master
2016-09-05T22:49:57.394000
2014-03-25T01:47:04
2014-03-25T01:47:04
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package org.openflow.protocol.factory; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; import org.openflow.protocol.OFMessage; import org.openflow.protocol.OFHeader; import org.openflow.protocol.factory.OFMessageParser; public class VersionedMessageParser implements OFMessageParser { public static final byte VERSION10 = 0x01; public static final byte VERSION13 = 0x04; @Override public List<OFMessage> parseMessages(ByteBuffer data) { return parseMessages(data, 0); } @Override public List<OFMessage> parseMessages(ByteBuffer data, int limit) { List<OFMessage> results = new ArrayList<OFMessage>(); OFHeader demux = new OFHeader(); while (limit == 0 || results.size() <= limit) { if (data.remaining() < OFHeader.MINIMUM_LENGTH) break; data.mark(); demux.readFrom(data); short subtype = 0; if ( data.remaining() >= 2 /*sizeof short*/) subtype = data.getShort(); data.reset(); if (demux.getLengthU() > data.remaining()) break; switch ( demux.getVersion() ) { // // FOR VERSION 1.0 // case VERSION10: // 1.0 org.openflow.protocol.ver1_0.types.OFMessageType t10 = org.openflow.protocol.ver1_0.types.OFMessageType.valueOf(demux.getType()); switch (t10) { case STATISTICS_REQUEST: case STATISTICS_REPLY: // read subtype information first. org.openflow.protocol.ver1_0.messages.OFStatistics sn = org.openflow.protocol.ver1_0.types.OFStatisticsType.valueOf(subtype, t10).newInstance(t10); sn.readFrom(data); results.add(sn); break; default: org.openflow.protocol.ver1_0.messages.OFMessage nn = org.openflow.protocol.ver1_0.types.OFMessageType.valueOf(demux.getType()).newInstance(); nn.readFrom(data); results.add(nn); } break; // // for VERSION 1.3 // case VERSION13: org.openflow.protocol.ver1_3.types.OFMessageType t13 = org.openflow.protocol.ver1_3.types.OFMessageType.valueOf(demux.getType()); switch (t13) { case STATISTICS_REQUEST: case STATISTICS_REPLY: org.openflow.protocol.ver1_3.messages.OFStatistics mn = org.openflow.protocol.ver1_3.types.OFStatisticsType.valueOf(subtype, t13).newInstance(t13); mn.readFrom(data); results.add(mn); break; default: org.openflow.protocol.ver1_3.messages.OFMessage ns = org.openflow.protocol.ver1_3.types.OFMessageType.valueOf(demux.getType()).newInstance(); ns.readFrom(data); results.add(ns); } break; } // // and there's no default case. // } return results; } }
UTF-8
Java
3,276
java
VersionedMessageParser.java
Java
[]
null
[]
package org.openflow.protocol.factory; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; import org.openflow.protocol.OFMessage; import org.openflow.protocol.OFHeader; import org.openflow.protocol.factory.OFMessageParser; public class VersionedMessageParser implements OFMessageParser { public static final byte VERSION10 = 0x01; public static final byte VERSION13 = 0x04; @Override public List<OFMessage> parseMessages(ByteBuffer data) { return parseMessages(data, 0); } @Override public List<OFMessage> parseMessages(ByteBuffer data, int limit) { List<OFMessage> results = new ArrayList<OFMessage>(); OFHeader demux = new OFHeader(); while (limit == 0 || results.size() <= limit) { if (data.remaining() < OFHeader.MINIMUM_LENGTH) break; data.mark(); demux.readFrom(data); short subtype = 0; if ( data.remaining() >= 2 /*sizeof short*/) subtype = data.getShort(); data.reset(); if (demux.getLengthU() > data.remaining()) break; switch ( demux.getVersion() ) { // // FOR VERSION 1.0 // case VERSION10: // 1.0 org.openflow.protocol.ver1_0.types.OFMessageType t10 = org.openflow.protocol.ver1_0.types.OFMessageType.valueOf(demux.getType()); switch (t10) { case STATISTICS_REQUEST: case STATISTICS_REPLY: // read subtype information first. org.openflow.protocol.ver1_0.messages.OFStatistics sn = org.openflow.protocol.ver1_0.types.OFStatisticsType.valueOf(subtype, t10).newInstance(t10); sn.readFrom(data); results.add(sn); break; default: org.openflow.protocol.ver1_0.messages.OFMessage nn = org.openflow.protocol.ver1_0.types.OFMessageType.valueOf(demux.getType()).newInstance(); nn.readFrom(data); results.add(nn); } break; // // for VERSION 1.3 // case VERSION13: org.openflow.protocol.ver1_3.types.OFMessageType t13 = org.openflow.protocol.ver1_3.types.OFMessageType.valueOf(demux.getType()); switch (t13) { case STATISTICS_REQUEST: case STATISTICS_REPLY: org.openflow.protocol.ver1_3.messages.OFStatistics mn = org.openflow.protocol.ver1_3.types.OFStatisticsType.valueOf(subtype, t13).newInstance(t13); mn.readFrom(data); results.add(mn); break; default: org.openflow.protocol.ver1_3.messages.OFMessage ns = org.openflow.protocol.ver1_3.types.OFMessageType.valueOf(demux.getType()).newInstance(); ns.readFrom(data); results.add(ns); } break; } // // and there's no default case. // } return results; } }
3,276
0.547924
0.528388
99
32.101009
25.600464
106
false
false
0
0
0
0
0
0
1.232323
false
false
8
9adc0e597614c42011ee11169eec6116414aeffa
30,751,965,900,168
66f381df89dd0ff518d364396174a1282340a538
/dolphin-schedule/src/main/java/cn/goktech/dolphin/schedule/annotation/ElasticJobConf.java
012d5aff9b3243565db6f9334da294dbf39373d0
[ "MIT" ]
permissive
funcas/dolphin-cloud
https://github.com/funcas/dolphin-cloud
433b8a62eff3af63a9d9e7f7dc446a2c5dddd656
dd72199579195d5c7e4d1558fea75e716df92a70
refs/heads/dev
2022-06-24T18:41:25.489000
2020-08-27T05:54:54
2020-08-27T05:54:54
179,837,400
5
3
MIT
false
2022-06-21T01:02:45
2019-04-06T13:34:31
2021-07-14T10:41:00
2022-06-21T01:02:45
246
3
3
6
Java
false
false
package cn.goktech.dolphin.schedule.annotation; import org.springframework.stereotype.Component; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * @author funcas * @version 1.0 * @date 2019年04月19日 */ @Component @Target({ ElementType.TYPE }) @Retention(RetentionPolicy.RUNTIME) public @interface ElasticJobConf { /** * 作业名称 * @return */ String name(); /** * cron表达式,用于控制作业触发时间 * @return */ String cron() default ""; /** * 作业分片总数 * @return */ int shardingTotalCount() default 1; /** * 分片序列号和参数用等号分隔,多个键值对用逗号分隔 * <p>分片序列号从0开始,不可大于或等于作业分片总数<p> * <p>如:<p> * <p>0=a,1=b,2=c<p> * @return */ String shardingItemParameters() default ""; /** * 作业自定义参数 * <p>作业自定义参数,可通过传递该参数为作业调度的业务方法传参,用于实现带参数的作业<p> * <p>例:每次获取的数据量、作业实例从数据库读取的主键等<p> * @return */ String jobParameter() default ""; /** * 是否开启任务执行失效转移,开启表示如果作业在一次任务执行中途宕机,允许将该次未完成的任务在另一作业节点上补偿执行 * @return */ boolean failover() default false; /** * 是否开启错过任务重新执行 * @return */ boolean misfire() default false; /** * 作业描述信息 * @return */ String description() default ""; boolean overwrite() default false; /** * 是否流式处理数据 * <p>如果流式处理数据, 则fetchData不返回空结果将持续执行作业<p> * <p>如果非流式处理数据, 则处理数据完成后作业结束<p> * @return */ boolean streamingProcess() default false; /** * 脚本型作业执行命令行 * @return */ String scriptCommandLine() default ""; /** * 监控作业运行时状态 * <p>每次作业执行时间和间隔时间均非常短的情况,建议不监控作业运行时状态以提升效率。<p> * <p>因为是瞬时状态,所以无必要监控。请用户自行增加数据堆积监控。并且不能保证数据重复选取,应在作业中实现幂等性。<p> * <p>每次作业执行时间和间隔时间均较长的情况,建议监控作业运行时状态,可保证数据不会重复选取。<p> * @return */ boolean monitorExecution() default true; /** * 作业监控端口 * <p>建议配置作业监控端口, 方便开发者dump作业信息。<p> * <p>使用方法: echo “dump” | nc 127.0.0.1 9888<p> * @return */ int monitorPort() default -1; /** * 大允许的本机与注册中心的时间误差秒数 * <p>如果时间误差超过配置秒数则作业启动时将抛异常<p> * <p>配置为-1表示不校验时间误差<p> * @return */ int maxTimeDiffSeconds() default -1; /** * 作业分片策略实现类全路径,默认使用平均分配策略 * @return */ String jobShardingStrategyClass() default ""; /** * 修复作业服务器不一致状态服务调度间隔时间,配置为小于1的任意值表示不执行修复,单位:分钟 * @return */ int reconcileIntervalMinutes() default 10; /** * 作业事件追踪的数据源Bean引用 * @return */ String eventTraceRdbDataSource() default ""; /** * 前置后置任务监听实现类,需实现ElasticJobListener接口 * @return */ String listener() default ""; /** * 作业是否禁止启动,可用于部署作业时,先禁止启动,部署结束后统一启动 * @return */ boolean disabled() default false; /** * 前置后置任务分布式监听实现类,需继承AbstractDistributeOnceElasticJobListener类 * @return */ String distributedListener() default ""; /** * 最后一个作业执行前的执行方法的超时时间,单位:毫秒 * @return */ long startedTimeoutMilliseconds() default Long.MAX_VALUE; /** * 最后一个作业执行后的执行方法的超时时间,单位:毫秒 * @return */ long completedTimeoutMilliseconds() default Long.MAX_VALUE; /** * 自定义异常处理类 * @return */ String jobExceptionHandler() default "com.dangdang.ddframe.job.executor.handler.impl.DefaultJobExceptionHandler"; /** * 自定义业务处理线程池 * @return */ String executorServiceHandler() default "com.dangdang.ddframe.job.executor.handler.impl.DefaultExecutorServiceHandler"; }
UTF-8
Java
5,022
java
ElasticJobConf.java
Java
[ { "context": "mport java.lang.annotation.Target;\n\n/**\n * @author funcas\n * @version 1.0\n * @date 2019年04月19日\n */\n@Compone", "end": 282, "score": 0.9977779388427734, "start": 276, "tag": "USERNAME", "value": "funcas" }, { "context": "便开发者dump作业信息。<p>\n * <p>使用方法: echo “dump” | nc 127.0.0.1 9888<p>\n * @return\n */\n int monitorPor", "end": 2039, "score": 0.9997497200965881, "start": 2030, "tag": "IP_ADDRESS", "value": "127.0.0.1" } ]
null
[]
package cn.goktech.dolphin.schedule.annotation; import org.springframework.stereotype.Component; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * @author funcas * @version 1.0 * @date 2019年04月19日 */ @Component @Target({ ElementType.TYPE }) @Retention(RetentionPolicy.RUNTIME) public @interface ElasticJobConf { /** * 作业名称 * @return */ String name(); /** * cron表达式,用于控制作业触发时间 * @return */ String cron() default ""; /** * 作业分片总数 * @return */ int shardingTotalCount() default 1; /** * 分片序列号和参数用等号分隔,多个键值对用逗号分隔 * <p>分片序列号从0开始,不可大于或等于作业分片总数<p> * <p>如:<p> * <p>0=a,1=b,2=c<p> * @return */ String shardingItemParameters() default ""; /** * 作业自定义参数 * <p>作业自定义参数,可通过传递该参数为作业调度的业务方法传参,用于实现带参数的作业<p> * <p>例:每次获取的数据量、作业实例从数据库读取的主键等<p> * @return */ String jobParameter() default ""; /** * 是否开启任务执行失效转移,开启表示如果作业在一次任务执行中途宕机,允许将该次未完成的任务在另一作业节点上补偿执行 * @return */ boolean failover() default false; /** * 是否开启错过任务重新执行 * @return */ boolean misfire() default false; /** * 作业描述信息 * @return */ String description() default ""; boolean overwrite() default false; /** * 是否流式处理数据 * <p>如果流式处理数据, 则fetchData不返回空结果将持续执行作业<p> * <p>如果非流式处理数据, 则处理数据完成后作业结束<p> * @return */ boolean streamingProcess() default false; /** * 脚本型作业执行命令行 * @return */ String scriptCommandLine() default ""; /** * 监控作业运行时状态 * <p>每次作业执行时间和间隔时间均非常短的情况,建议不监控作业运行时状态以提升效率。<p> * <p>因为是瞬时状态,所以无必要监控。请用户自行增加数据堆积监控。并且不能保证数据重复选取,应在作业中实现幂等性。<p> * <p>每次作业执行时间和间隔时间均较长的情况,建议监控作业运行时状态,可保证数据不会重复选取。<p> * @return */ boolean monitorExecution() default true; /** * 作业监控端口 * <p>建议配置作业监控端口, 方便开发者dump作业信息。<p> * <p>使用方法: echo “dump” | nc 127.0.0.1 9888<p> * @return */ int monitorPort() default -1; /** * 大允许的本机与注册中心的时间误差秒数 * <p>如果时间误差超过配置秒数则作业启动时将抛异常<p> * <p>配置为-1表示不校验时间误差<p> * @return */ int maxTimeDiffSeconds() default -1; /** * 作业分片策略实现类全路径,默认使用平均分配策略 * @return */ String jobShardingStrategyClass() default ""; /** * 修复作业服务器不一致状态服务调度间隔时间,配置为小于1的任意值表示不执行修复,单位:分钟 * @return */ int reconcileIntervalMinutes() default 10; /** * 作业事件追踪的数据源Bean引用 * @return */ String eventTraceRdbDataSource() default ""; /** * 前置后置任务监听实现类,需实现ElasticJobListener接口 * @return */ String listener() default ""; /** * 作业是否禁止启动,可用于部署作业时,先禁止启动,部署结束后统一启动 * @return */ boolean disabled() default false; /** * 前置后置任务分布式监听实现类,需继承AbstractDistributeOnceElasticJobListener类 * @return */ String distributedListener() default ""; /** * 最后一个作业执行前的执行方法的超时时间,单位:毫秒 * @return */ long startedTimeoutMilliseconds() default Long.MAX_VALUE; /** * 最后一个作业执行后的执行方法的超时时间,单位:毫秒 * @return */ long completedTimeoutMilliseconds() default Long.MAX_VALUE; /** * 自定义异常处理类 * @return */ String jobExceptionHandler() default "com.dangdang.ddframe.job.executor.handler.impl.DefaultJobExceptionHandler"; /** * 自定义业务处理线程池 * @return */ String executorServiceHandler() default "com.dangdang.ddframe.job.executor.handler.impl.DefaultExecutorServiceHandler"; }
5,022
0.606145
0.597486
178
19.11236
20.257021
123
false
false
0
0
0
0
0
0
0.230337
false
false
8
91a64b7fdadf1d6c3b36317452002b80ca42fac2
25,211,458,083,354
8f88292ef0aeb5020b6d1cb5b7a88fa34f7580a3
/src/main/java/com/teamwizardry/shotgunsandglitter/api/EffectRegistry.java
ee0bc32919ad5edfa8e4951886108da021553757
[ "MIT" ]
permissive
TeamWizardry/Shotguns-And-Glitter
https://github.com/TeamWizardry/Shotguns-And-Glitter
48205109e029a81ab593bc8549d8ccc63af49c59
9673b0a27fb1eaf0f6a5a79361dee956705fa900
refs/heads/master
2020-03-07T11:56:58.964000
2019-06-30T09:33:51
2019-06-30T09:33:51
127,467,172
1
1
MIT
false
2019-05-24T15:02:03
2018-03-30T19:49:21
2019-05-23T19:44:12
2019-05-24T15:02:03
16,455
0
1
1
Java
false
false
package com.teamwizardry.shotgunsandglitter.api; import com.teamwizardry.shotgunsandglitter.common.config.ModConfig; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; import java.util.HashMap; import java.util.List; public class EffectRegistry { private final static HashMap<String, BulletEffect> BULLET_EFFECTS = new HashMap<>(); private final static HashMap<String, GrenadeEffect> GRENADE_EFFECTS = new HashMap<>(); private final static BulletEffect BASIC_BULLET_EFFECT = new BulletEffectBasic(); private final static GrenadeEffect BASIC_GRENADE_EFFECT = new GrenadeEffectBasic(); private final static List<BulletEffect> BULLET_EFFECTS_ORDERED = new ArrayList<>(); private final static List<GrenadeEffect> GRENADE_EFFECTS_ORDERED = new ArrayList<>(); static { addEffect(BASIC_BULLET_EFFECT); addEffect(BASIC_GRENADE_EFFECT); } public static void addEffect(BulletEffect... bulletEffects) { for (BulletEffect bulletEffect : bulletEffects) addEffect(bulletEffect); } public static void addEffect(BulletEffect bulletEffect) { assert !BULLET_EFFECTS.containsKey(bulletEffect.getID()); if (ModConfig.isBulletEffectBlacklisted(bulletEffect.getID())) return; BULLET_EFFECTS.put(bulletEffect.getID(), bulletEffect); BULLET_EFFECTS_ORDERED.add(bulletEffect); } public static void addEffect(GrenadeEffect... grenadeEffects) { for (GrenadeEffect grenadeEffect : grenadeEffects) addEffect(grenadeEffect); } public static void addEffect(GrenadeEffect grenadeEffect) { assert !GRENADE_EFFECTS.containsKey(grenadeEffect.getID()); if (ModConfig.isGrenadeEffectBlacklisted(grenadeEffect.getID())) return; GRENADE_EFFECTS.put(grenadeEffect.getID(), grenadeEffect); GRENADE_EFFECTS_ORDERED.add(grenadeEffect); } public static List<BulletEffect> getBulletEffects() { return BULLET_EFFECTS_ORDERED; } public static List<GrenadeEffect> getGrenadeEffects() { return GRENADE_EFFECTS_ORDERED; } @NotNull public static BulletEffect getBulletEffectByID(String id) { return BULLET_EFFECTS.getOrDefault(id, BASIC_BULLET_EFFECT); } @NotNull public static GrenadeEffect getGrenadeEffectByID(String id) { return GRENADE_EFFECTS.getOrDefault(id, BASIC_GRENADE_EFFECT); } }
UTF-8
Java
2,242
java
EffectRegistry.java
Java
[]
null
[]
package com.teamwizardry.shotgunsandglitter.api; import com.teamwizardry.shotgunsandglitter.common.config.ModConfig; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; import java.util.HashMap; import java.util.List; public class EffectRegistry { private final static HashMap<String, BulletEffect> BULLET_EFFECTS = new HashMap<>(); private final static HashMap<String, GrenadeEffect> GRENADE_EFFECTS = new HashMap<>(); private final static BulletEffect BASIC_BULLET_EFFECT = new BulletEffectBasic(); private final static GrenadeEffect BASIC_GRENADE_EFFECT = new GrenadeEffectBasic(); private final static List<BulletEffect> BULLET_EFFECTS_ORDERED = new ArrayList<>(); private final static List<GrenadeEffect> GRENADE_EFFECTS_ORDERED = new ArrayList<>(); static { addEffect(BASIC_BULLET_EFFECT); addEffect(BASIC_GRENADE_EFFECT); } public static void addEffect(BulletEffect... bulletEffects) { for (BulletEffect bulletEffect : bulletEffects) addEffect(bulletEffect); } public static void addEffect(BulletEffect bulletEffect) { assert !BULLET_EFFECTS.containsKey(bulletEffect.getID()); if (ModConfig.isBulletEffectBlacklisted(bulletEffect.getID())) return; BULLET_EFFECTS.put(bulletEffect.getID(), bulletEffect); BULLET_EFFECTS_ORDERED.add(bulletEffect); } public static void addEffect(GrenadeEffect... grenadeEffects) { for (GrenadeEffect grenadeEffect : grenadeEffects) addEffect(grenadeEffect); } public static void addEffect(GrenadeEffect grenadeEffect) { assert !GRENADE_EFFECTS.containsKey(grenadeEffect.getID()); if (ModConfig.isGrenadeEffectBlacklisted(grenadeEffect.getID())) return; GRENADE_EFFECTS.put(grenadeEffect.getID(), grenadeEffect); GRENADE_EFFECTS_ORDERED.add(grenadeEffect); } public static List<BulletEffect> getBulletEffects() { return BULLET_EFFECTS_ORDERED; } public static List<GrenadeEffect> getGrenadeEffects() { return GRENADE_EFFECTS_ORDERED; } @NotNull public static BulletEffect getBulletEffectByID(String id) { return BULLET_EFFECTS.getOrDefault(id, BASIC_BULLET_EFFECT); } @NotNull public static GrenadeEffect getGrenadeEffectByID(String id) { return GRENADE_EFFECTS.getOrDefault(id, BASIC_GRENADE_EFFECT); } }
2,242
0.785905
0.785905
69
31.492754
29.918549
87
false
false
0
0
0
0
0
0
1.42029
false
false
8
1b6b1f46bca653829bd2d6bbaa49fa263f713d03
12,463,995,144,938
231127718b967565f46520ed43a7a1616e875f41
/app/src/main/java/com/example/xieyo/roam/bookbean/BookFragList.java
06cb55aa3e16ca12588ffeb5bce3d672c0fb35a2
[]
no_license
yongweixie/Roam
https://github.com/yongweixie/Roam
c2a3e75b5e8b6e0cf5cbae482e337315215d029a
db251c74c0fdeb38c3a7e26f5732a52896cd07f1
refs/heads/master
2020-04-26T15:40:25.915000
2019-11-14T10:16:17
2019-11-14T10:16:17
173,653,884
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.xieyo.roam.bookbean; import com.chad.library.adapter.base.entity.MultiItemEntity; public class BookFragList implements MultiItemEntity { public String booklink; public String coveruri; public String artist; public String name; public int type;//标题栏&书单,布局种类 //必须重写的方法,开发工具会提示你的 public int from;//书来源。新书或是榜单书 public String rating; public String classification; public String reviews; public String sellindex; public String numraters; public String num_digest; public String part_digest; @Override public int getItemType() { return type; } }
UTF-8
Java
713
java
BookFragList.java
Java
[]
null
[]
package com.example.xieyo.roam.bookbean; import com.chad.library.adapter.base.entity.MultiItemEntity; public class BookFragList implements MultiItemEntity { public String booklink; public String coveruri; public String artist; public String name; public int type;//标题栏&书单,布局种类 //必须重写的方法,开发工具会提示你的 public int from;//书来源。新书或是榜单书 public String rating; public String classification; public String reviews; public String sellindex; public String numraters; public String num_digest; public String part_digest; @Override public int getItemType() { return type; } }
713
0.71205
0.71205
26
23.576923
15.214297
60
false
false
0
0
0
0
0
0
0.653846
false
false
8
5aab1b3f83ae519fb1eb9168abf52a178f204a01
23,484,881,227,214
282f18b91b37328ac2f0a8dcafd02e85f1f155fc
/commonLib/src/main/java/cn/aorise/common/core/module/download/DownloadTask.java
04a10329c11810ab5a934b33a7904c278a978035
[ "Apache-2.0" ]
permissive
zfl5232577/GitHubJ
https://github.com/zfl5232577/GitHubJ
1f4da5042a2876bb252abdfc21aef6f226881b62
7a41510a161bc7a8446626a70a5e7b04fb9d49dd
refs/heads/master
2020-04-09T12:13:49.922000
2019-02-20T10:09:57
2019-02-20T10:09:57
160,340,804
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
//package cn.aorise.common.core.module.download; // //import android.os.Environment; //import android.support.annotation.NonNull; // // //import java.io.File; // //import cn.aorise.common.core.util.UrlUtils; // ///** // * <pre> // * author : Mark // * e-mail : makun.cai@aorise.org // * time : 2018/06/14 // * desc : TODO // * version: 1.0 // * </pre> // */ //public class DownloadTask implements Comparable<DownloadTask> { // private final DownInfo mDownInfo; // private DownloadListener mDownloadListener; // // DownloadTask(DownInfo downInfo) { // this.mDownInfo = downInfo; // } // // public DownInfo getDownInfo() { // return mDownInfo; // } // // public DownloadListener getDownloadListener() { // return mDownloadListener; // } // // public void setDownloadListener(DownloadListener downloadListener) { // mDownloadListener = downloadListener; // } // // private int getPriority() { // return mDownInfo.getPriority(); // } // // public DownState getState(){ // return mDownInfo.getState(); // } // // void setState(DownState state) { // mDownInfo.setState(state); // } // // String getUrl(){ // return mDownInfo.getUrl(); // } // // public long getReadLength(){ // long readLength=0; // File file = getSaveFile(); // if (file.exists()){ // readLength = file.length(); // setReadLength(readLength); // } // return readLength; // } // // public void setReadLength(long readLength) { // mDownInfo.setReadLength(readLength); // } // // public File getSaveFile(){ // return new File(mDownInfo.getSavePath()); // } // // public boolean isUpdateProgress() { // return mDownInfo.isUpdateProgress(); // } // // public void setTotalSize(long totalSize) { // mDownInfo.setTotalSize(totalSize); // } // public long getTotalSize() { // return mDownInfo.getTotalSize(); // } // // public void enqueue(DownloadListener listener) { // mDownloadListener = listener; // DownloadManager.getInstance().enqueue(this); // } // // public void onPause(){ // DownloadManager.getInstance().onPause(this); // } // // public void cancel(){ // DownloadManager.getInstance().cancel(this); // } // // @Override // public boolean equals(Object o) { // if (this == o) return true; // if (o == null || getClass() != o.getClass()) return false; // // DownloadTask that = (DownloadTask) o; // // return mDownInfo != null ? mDownInfo.equals(that.mDownInfo) : that.mDownInfo == null; // } // // @Override // public int hashCode() { // return mDownInfo != null ? mDownInfo.hashCode() : 0; // } // // @Override // public int compareTo(@NonNull DownloadTask task) { // return task.getPriority() - getPriority(); // } // // // /** // * The builder of download task. // */ // public static class Builder { // private DownInfo mDownInfo; // // public Builder(@NonNull String url) { // String filePath = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)+File.separator+ UrlUtils.getFileName(url); // mDownInfo = new DownInfo(url, filePath); // } // // public Builder(@NonNull String url, @NonNull String filePath) { // mDownInfo = new DownInfo(url, filePath); // } // // public Builder updateProgress(boolean updateProgress) { // mDownInfo.setUpdateProgress(updateProgress); // return this; // } // // public Builder priority(int priority) { // priority = priority < 0 ? 0 : priority; // priority = priority > 1000 ? 1000 : priority; // mDownInfo.setPriority(priority); // return this; // } // // public DownloadTask build() { // return new DownloadTask(mDownInfo); // } // } //}
UTF-8
Java
4,052
java
DownloadTask.java
Java
[ { "context": "il.UrlUtils;\n//\n///**\n// * <pre>\n// * author : Mark\n// * e-mail : makun.cai@aorise.org\n// * t", "end": 250, "score": 0.9993643164634705, "start": 246, "tag": "NAME", "value": "Mark" }, { "context": "/ * <pre>\n// * author : Mark\n// * e-mail : makun.cai@aorise.org\n// * time : 2018/06/14\n// * desc : TO", "end": 289, "score": 0.9999340176582336, "start": 269, "tag": "EMAIL", "value": "makun.cai@aorise.org" } ]
null
[]
//package cn.aorise.common.core.module.download; // //import android.os.Environment; //import android.support.annotation.NonNull; // // //import java.io.File; // //import cn.aorise.common.core.util.UrlUtils; // ///** // * <pre> // * author : Mark // * e-mail : <EMAIL> // * time : 2018/06/14 // * desc : TODO // * version: 1.0 // * </pre> // */ //public class DownloadTask implements Comparable<DownloadTask> { // private final DownInfo mDownInfo; // private DownloadListener mDownloadListener; // // DownloadTask(DownInfo downInfo) { // this.mDownInfo = downInfo; // } // // public DownInfo getDownInfo() { // return mDownInfo; // } // // public DownloadListener getDownloadListener() { // return mDownloadListener; // } // // public void setDownloadListener(DownloadListener downloadListener) { // mDownloadListener = downloadListener; // } // // private int getPriority() { // return mDownInfo.getPriority(); // } // // public DownState getState(){ // return mDownInfo.getState(); // } // // void setState(DownState state) { // mDownInfo.setState(state); // } // // String getUrl(){ // return mDownInfo.getUrl(); // } // // public long getReadLength(){ // long readLength=0; // File file = getSaveFile(); // if (file.exists()){ // readLength = file.length(); // setReadLength(readLength); // } // return readLength; // } // // public void setReadLength(long readLength) { // mDownInfo.setReadLength(readLength); // } // // public File getSaveFile(){ // return new File(mDownInfo.getSavePath()); // } // // public boolean isUpdateProgress() { // return mDownInfo.isUpdateProgress(); // } // // public void setTotalSize(long totalSize) { // mDownInfo.setTotalSize(totalSize); // } // public long getTotalSize() { // return mDownInfo.getTotalSize(); // } // // public void enqueue(DownloadListener listener) { // mDownloadListener = listener; // DownloadManager.getInstance().enqueue(this); // } // // public void onPause(){ // DownloadManager.getInstance().onPause(this); // } // // public void cancel(){ // DownloadManager.getInstance().cancel(this); // } // // @Override // public boolean equals(Object o) { // if (this == o) return true; // if (o == null || getClass() != o.getClass()) return false; // // DownloadTask that = (DownloadTask) o; // // return mDownInfo != null ? mDownInfo.equals(that.mDownInfo) : that.mDownInfo == null; // } // // @Override // public int hashCode() { // return mDownInfo != null ? mDownInfo.hashCode() : 0; // } // // @Override // public int compareTo(@NonNull DownloadTask task) { // return task.getPriority() - getPriority(); // } // // // /** // * The builder of download task. // */ // public static class Builder { // private DownInfo mDownInfo; // // public Builder(@NonNull String url) { // String filePath = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)+File.separator+ UrlUtils.getFileName(url); // mDownInfo = new DownInfo(url, filePath); // } // // public Builder(@NonNull String url, @NonNull String filePath) { // mDownInfo = new DownInfo(url, filePath); // } // // public Builder updateProgress(boolean updateProgress) { // mDownInfo.setUpdateProgress(updateProgress); // return this; // } // // public Builder priority(int priority) { // priority = priority < 0 ? 0 : priority; // priority = priority > 1000 ? 1000 : priority; // mDownInfo.setPriority(priority); // return this; // } // // public DownloadTask build() { // return new DownloadTask(mDownInfo); // } // } //}
4,039
0.576505
0.571076
150
26.013334
23.561546
153
false
false
0
0
0
0
0
0
0.34
false
false
8
4855cf9c875f43dd21542eda1da4839acec6af5f
24,842,090,889,521
e593fd8902ef395b2c1626a3126a4e0002e2c0df
/app/src/main/java/com/warrous/ready2ride/bike/DefaultBikePresenter.java
3013a7bc91b4e2fe8dd5bf0277166a0384f2d1e9
[]
no_license
AshaPemma/Ready2Ride
https://github.com/AshaPemma/Ready2Ride
3d1c93a7e5d1f31469abf9d255ab5382871a13e4
8308c0cd51e113a347a19c165c0a6e6ff3cc000e
refs/heads/master
2022-02-12T11:19:07.178000
2019-07-23T05:20:12
2019-07-23T05:20:12
198,356,504
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.warrous.ready2ride.bike; import android.widget.ArrayAdapter; import com.warrous.ready2ride.base.BaseContract; import com.warrous.ready2ride.base.BasePresenter; import com.warrous.ready2ride.bike.model.DefaultBikeDetailsResponse; import com.warrous.ready2ride.bike.model.RideList; import java.util.ArrayList; public class DefaultBikePresenter extends BasePresenter implements DefaultBikeContract.Presenter { DefaultBikeContract.View view; public DefaultBikePresenter(DefaultBikeContract.View view) { super(view); this.view = view; } @Override public void getCycleDetails(int CycleId, int DealerId) { execute(getApiInterface().getBikeDetails(CycleId,DealerId)); } @Override public void getRideDetails(int cycleId, int ownerId) { execute(getApiInterface().getRideLog(cycleId,ownerId)); } @Override public void onResponse(String method, String message, Object result) { view.dismissLoader(); if(method.equalsIgnoreCase("r2r.ms.mobile/r2r.ms.mobile.api/api/Cycle/GetCycleDetails")){ ArrayList<DefaultBikeDetailsResponse> list = (ArrayList<DefaultBikeDetailsResponse>) result; ArrayList<DefaultBikeDetailsResponse> bikeList=new ArrayList<>(); if(list.size()>0){ for(int i=0;i<list.size();i++){ if(i<5){ bikeList.add(list.get(i)); } } } view.onCycleDetailsSucess(bikeList); }else{ ArrayList<RideList> list = (ArrayList<RideList>) result; view.onGetRideLogResponse(list); // view.onDeleteLibraryImageSucess(); } } }
UTF-8
Java
1,697
java
DefaultBikePresenter.java
Java
[]
null
[]
package com.warrous.ready2ride.bike; import android.widget.ArrayAdapter; import com.warrous.ready2ride.base.BaseContract; import com.warrous.ready2ride.base.BasePresenter; import com.warrous.ready2ride.bike.model.DefaultBikeDetailsResponse; import com.warrous.ready2ride.bike.model.RideList; import java.util.ArrayList; public class DefaultBikePresenter extends BasePresenter implements DefaultBikeContract.Presenter { DefaultBikeContract.View view; public DefaultBikePresenter(DefaultBikeContract.View view) { super(view); this.view = view; } @Override public void getCycleDetails(int CycleId, int DealerId) { execute(getApiInterface().getBikeDetails(CycleId,DealerId)); } @Override public void getRideDetails(int cycleId, int ownerId) { execute(getApiInterface().getRideLog(cycleId,ownerId)); } @Override public void onResponse(String method, String message, Object result) { view.dismissLoader(); if(method.equalsIgnoreCase("r2r.ms.mobile/r2r.ms.mobile.api/api/Cycle/GetCycleDetails")){ ArrayList<DefaultBikeDetailsResponse> list = (ArrayList<DefaultBikeDetailsResponse>) result; ArrayList<DefaultBikeDetailsResponse> bikeList=new ArrayList<>(); if(list.size()>0){ for(int i=0;i<list.size();i++){ if(i<5){ bikeList.add(list.get(i)); } } } view.onCycleDetailsSucess(bikeList); }else{ ArrayList<RideList> list = (ArrayList<RideList>) result; view.onGetRideLogResponse(list); // view.onDeleteLibraryImageSucess(); } } }
1,697
0.675309
0.669417
57
28.771931
28.937935
100
false
false
0
0
0
0
0
0
0.491228
false
false
8
ca0ba924ec230a075a49ae1ee487f61e832b2f09
14,903,536,573,378
d57a03b3c3fb72d5339d5665c7c27550c61c1570
/SSCC-DIRANDRO/src/main/java/com/sscc/form/BienBean.java
137d3847a190530d348b37049b02ee4ce50d4e15
[]
no_license
edsonvfloresf/SSCC-DIRANDRO
https://github.com/edsonvfloresf/SSCC-DIRANDRO
1023b2e969a51cb71379ae67345a5f71a146ba4e
10110d1b9ad4dc54683ded90900a60adee4972ac
refs/heads/master
2019-05-07T05:00:32.367000
2016-07-10T18:29:14
2016-07-10T18:29:14
62,972,856
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.sscc.form; public class BienBean { // Bien private Integer idBien; private String descripcion; private Double valor; private String partidaRegistral; private Integer id; private String codigo; private Integer tipoBien; private String tipo; public String getTipo() { return tipo; } public void setTipo(String tipo) { this.tipo = tipo; } public Integer getIdBien() { return idBien; } public void setIdBien(Integer idBien) { this.idBien = idBien; } public String getDescripcion() { return descripcion; } public void setDescripcion(String descripcion) { this.descripcion = descripcion; } public Double getValor() { return valor; } public void setValor(Double valor) { this.valor = valor; } public String getPartidaRegistral() { return partidaRegistral; } public void setPartidaRegistral(String partidaRegistral) { this.partidaRegistral = partidaRegistral; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getCodigo() { return codigo; } public void setCodigo(String codigo) { this.codigo = codigo; } public Integer getTipoBien() { return tipoBien; } public void setTipoBien(Integer tipoBien) { this.tipoBien = tipoBien; } }
UTF-8
Java
1,346
java
BienBean.java
Java
[]
null
[]
package com.sscc.form; public class BienBean { // Bien private Integer idBien; private String descripcion; private Double valor; private String partidaRegistral; private Integer id; private String codigo; private Integer tipoBien; private String tipo; public String getTipo() { return tipo; } public void setTipo(String tipo) { this.tipo = tipo; } public Integer getIdBien() { return idBien; } public void setIdBien(Integer idBien) { this.idBien = idBien; } public String getDescripcion() { return descripcion; } public void setDescripcion(String descripcion) { this.descripcion = descripcion; } public Double getValor() { return valor; } public void setValor(Double valor) { this.valor = valor; } public String getPartidaRegistral() { return partidaRegistral; } public void setPartidaRegistral(String partidaRegistral) { this.partidaRegistral = partidaRegistral; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getCodigo() { return codigo; } public void setCodigo(String codigo) { this.codigo = codigo; } public Integer getTipoBien() { return tipoBien; } public void setTipoBien(Integer tipoBien) { this.tipoBien = tipoBien; } }
1,346
0.677563
0.677563
71
16.957747
14.864114
59
false
false
0
0
0
0
0
0
1.478873
false
false
8
548fffb578a34eedc3a0d65201bb2817fd2d01c0
14,903,536,571,276
f56945128dc34fc789b69cbc50aed2b17fc34874
/lesson3/src/main/java/com/owner/test/service/UserService.java
c3b5ec05b7f6b024f98757f339424a56d912ab07
[]
no_license
NovenHong/java_lesson
https://github.com/NovenHong/java_lesson
dea6eda5046097c4eaab20ff4941bd9d9e5229d6
98954f6e8386937f42d599505f2bd430a1061635
refs/heads/master
2022-12-21T21:41:05.044000
2019-10-09T05:08:05
2019-10-09T05:08:05
206,504,378
0
0
null
false
2022-12-16T05:05:35
2019-09-05T07:40:45
2019-10-09T05:08:23
2022-12-16T05:05:34
270
0
0
44
Java
false
false
package com.owner.test.service; import java.util.ArrayList; import java.util.List; import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Join; import javax.persistence.criteria.JoinType; import javax.persistence.criteria.Predicate; import javax.persistence.criteria.Root; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.domain.Specification; import org.springframework.stereotype.Service; import org.springframework.util.StringUtils; import com.owner.test.dao.UserRepository; import com.owner.test.entity.Address; import com.owner.test.entity.User; @Service public class UserService { @Autowired private UserRepository userRepository; public User findUserByPrimaryId(int id) { return userRepository.findById(id).get(); } public List<User> findUserByUsername(String username) { return userRepository.findByUsername(username); } public List<User> findUserByUsernameLike(String username){ return userRepository.findByUsernameLike(username); } public List<User> findUserByUsernameAndAccount(String username,float account){ return userRepository.findByUsernameAndAccount(username,account); } public Page<User> findUserList(Integer pageNum,Integer pageSize,String username,String country){ Specification<User> specification = new Specification<User>() { private static final long serialVersionUID = 1L; @Override public Predicate toPredicate(Root<User> root, CriteriaQuery<?> query, CriteriaBuilder builder) { List<Predicate> predicates = new ArrayList<>(); if(!StringUtils.isEmpty(username)) { Predicate usernameLike = builder.like(root.get("username"),username+"%"); predicates.add(usernameLike); } if(!StringUtils.isEmpty(country)) { Join<User, Address> join = root.join("address",JoinType.LEFT); Predicate countryEqual = builder.equal(join.get("country"), country); predicates.add(countryEqual); } query.orderBy(builder.desc(root.get("id"))); return builder.and(predicates.toArray(new Predicate[predicates.size()])); } }; PageRequest pageRequest = PageRequest.of(pageNum-1, pageSize); return userRepository.findAll(specification,pageRequest); } }
UTF-8
Java
2,472
java
UserService.java
Java
[]
null
[]
package com.owner.test.service; import java.util.ArrayList; import java.util.List; import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Join; import javax.persistence.criteria.JoinType; import javax.persistence.criteria.Predicate; import javax.persistence.criteria.Root; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.domain.Specification; import org.springframework.stereotype.Service; import org.springframework.util.StringUtils; import com.owner.test.dao.UserRepository; import com.owner.test.entity.Address; import com.owner.test.entity.User; @Service public class UserService { @Autowired private UserRepository userRepository; public User findUserByPrimaryId(int id) { return userRepository.findById(id).get(); } public List<User> findUserByUsername(String username) { return userRepository.findByUsername(username); } public List<User> findUserByUsernameLike(String username){ return userRepository.findByUsernameLike(username); } public List<User> findUserByUsernameAndAccount(String username,float account){ return userRepository.findByUsernameAndAccount(username,account); } public Page<User> findUserList(Integer pageNum,Integer pageSize,String username,String country){ Specification<User> specification = new Specification<User>() { private static final long serialVersionUID = 1L; @Override public Predicate toPredicate(Root<User> root, CriteriaQuery<?> query, CriteriaBuilder builder) { List<Predicate> predicates = new ArrayList<>(); if(!StringUtils.isEmpty(username)) { Predicate usernameLike = builder.like(root.get("username"),username+"%"); predicates.add(usernameLike); } if(!StringUtils.isEmpty(country)) { Join<User, Address> join = root.join("address",JoinType.LEFT); Predicate countryEqual = builder.equal(join.get("country"), country); predicates.add(countryEqual); } query.orderBy(builder.desc(root.get("id"))); return builder.and(predicates.toArray(new Predicate[predicates.size()])); } }; PageRequest pageRequest = PageRequest.of(pageNum-1, pageSize); return userRepository.findAll(specification,pageRequest); } }
2,472
0.769013
0.768204
81
29.518518
27.270529
99
false
false
0
0
0
0
0
0
2.172839
false
false
8
f464423230922b4c7453a6f3639d88cf3949baab
34,660,386,084,345
988698fab9c7bc38ca9574a875dd552486dcdf51
/StartHere/src/main/java/com/lambdaschool/liftingweights/services/UserWorkoutServiceImpl.java
3f59ae5ede2c092f08dcbbacdb31813c74d84abe
[]
no_license
lambda-bw-weight-lift/LW_BACKEND
https://github.com/lambda-bw-weight-lift/LW_BACKEND
a0297e3e4405fc556e93d2e5062bdac1baee019d
dbe4f033e0e3b3339c2b8f2dc8319985fc0367dc
refs/heads/master
2022-11-20T06:52:56.229000
2019-09-27T00:59:07
2019-09-27T00:59:07
210,218,488
2
1
null
false
2022-11-16T12:26:09
2019-09-22T21:45:49
2020-03-27T19:20:19
2022-11-16T12:26:08
167
1
0
2
Java
false
false
package com.lambdaschool.liftingweights.services; import com.lambdaschool.liftingweights.exceptions.ResourceNotFoundException; import com.lambdaschool.liftingweights.models.Exercise; import com.lambdaschool.liftingweights.models.User; import com.lambdaschool.liftingweights.models.UserWorkout; import com.lambdaschool.liftingweights.repository.ExerciseRepository; import com.lambdaschool.liftingweights.repository.UserRepository; import com.lambdaschool.liftingweights.repository.UserWorkoutRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.List; @Service(value = "userWorkoutService") public class UserWorkoutServiceImpl implements UserWorkoutService { @Autowired UserWorkoutRepository userworkoutrepos; @Autowired ExerciseRepository exerciserepos; @Autowired UserRepository userrepos; @Override public List<UserWorkout> findAllWorkouts(Pageable pageable) { List<UserWorkout> myWorkouts = new ArrayList<>(); userworkoutrepos.findAll(pageable).iterator().forEachRemaining(myWorkouts::add); return myWorkouts; } @Override public void delete(long workoutid) { if (userworkoutrepos.findById(workoutid).isPresent()) { userworkoutrepos.deleteById(workoutid); } else { throw new ResourceNotFoundException("Workout id " + workoutid + " not found."); } } @Transactional @Override public UserWorkout saveWorkout(UserWorkout workout, String username) { UserWorkout uw = new UserWorkout(); User user = userrepos.findByUsername(username); uw.setUserid(user); uw.setWorkoutname(workout.getWorkoutname()); uw.setWorkoutlength(workout.getWorkoutlength()); uw.setDate(workout.getDate()); return userworkoutrepos.save(uw); } @Override public Exercise saveExerciseToWorkout(long workoutid, Exercise exercise) { Exercise ex = new Exercise(); UserWorkout uw = userworkoutrepos.findById(workoutid) .orElseThrow(() -> new ResourceNotFoundException("Workout id" + workoutid + " not found!")); System.out.println(workoutid); System.out.println(uw.toString()); ex.setExercisename(exercise.getExercisename()); ex.setReps(exercise.getReps()); ex.setWeightlifted(exercise.getWeightlifted()); ex.setRestperiod(exercise.getRestperiod()); ex.setExerciseregion(exercise.getExerciseregion()); ex.setUserworkout(uw); System.out.println(ex.toString()); return exerciserepos.save(ex); } @Override public UserWorkout findById(long workoutid) throws ResourceNotFoundException { return userworkoutrepos.findById(workoutid) .orElseThrow(() -> new ResourceNotFoundException("Workout id" + workoutid + "not Found!")); } @Override public UserWorkout update(UserWorkout workout, long id) { UserWorkout currentWorkout = userworkoutrepos.findById(id).orElseThrow(() -> new ResourceNotFoundException("Workout id " + id + " now found.")); if (workout.getWorkoutname() != null) { currentWorkout.setWorkoutname(workout.getWorkoutname()); } if (workout.getWorkoutlength() != null) { currentWorkout.setWorkoutlength(workout.getWorkoutlength()); } return userworkoutrepos.save(currentWorkout); } @Override public ArrayList<UserWorkout> findAll() { ArrayList<UserWorkout> list = new ArrayList<>(); userworkoutrepos.findAll().iterator().forEachRemaining(list::add); return list; } }
UTF-8
Java
4,082
java
UserWorkoutServiceImpl.java
Java
[]
null
[]
package com.lambdaschool.liftingweights.services; import com.lambdaschool.liftingweights.exceptions.ResourceNotFoundException; import com.lambdaschool.liftingweights.models.Exercise; import com.lambdaschool.liftingweights.models.User; import com.lambdaschool.liftingweights.models.UserWorkout; import com.lambdaschool.liftingweights.repository.ExerciseRepository; import com.lambdaschool.liftingweights.repository.UserRepository; import com.lambdaschool.liftingweights.repository.UserWorkoutRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.List; @Service(value = "userWorkoutService") public class UserWorkoutServiceImpl implements UserWorkoutService { @Autowired UserWorkoutRepository userworkoutrepos; @Autowired ExerciseRepository exerciserepos; @Autowired UserRepository userrepos; @Override public List<UserWorkout> findAllWorkouts(Pageable pageable) { List<UserWorkout> myWorkouts = new ArrayList<>(); userworkoutrepos.findAll(pageable).iterator().forEachRemaining(myWorkouts::add); return myWorkouts; } @Override public void delete(long workoutid) { if (userworkoutrepos.findById(workoutid).isPresent()) { userworkoutrepos.deleteById(workoutid); } else { throw new ResourceNotFoundException("Workout id " + workoutid + " not found."); } } @Transactional @Override public UserWorkout saveWorkout(UserWorkout workout, String username) { UserWorkout uw = new UserWorkout(); User user = userrepos.findByUsername(username); uw.setUserid(user); uw.setWorkoutname(workout.getWorkoutname()); uw.setWorkoutlength(workout.getWorkoutlength()); uw.setDate(workout.getDate()); return userworkoutrepos.save(uw); } @Override public Exercise saveExerciseToWorkout(long workoutid, Exercise exercise) { Exercise ex = new Exercise(); UserWorkout uw = userworkoutrepos.findById(workoutid) .orElseThrow(() -> new ResourceNotFoundException("Workout id" + workoutid + " not found!")); System.out.println(workoutid); System.out.println(uw.toString()); ex.setExercisename(exercise.getExercisename()); ex.setReps(exercise.getReps()); ex.setWeightlifted(exercise.getWeightlifted()); ex.setRestperiod(exercise.getRestperiod()); ex.setExerciseregion(exercise.getExerciseregion()); ex.setUserworkout(uw); System.out.println(ex.toString()); return exerciserepos.save(ex); } @Override public UserWorkout findById(long workoutid) throws ResourceNotFoundException { return userworkoutrepos.findById(workoutid) .orElseThrow(() -> new ResourceNotFoundException("Workout id" + workoutid + "not Found!")); } @Override public UserWorkout update(UserWorkout workout, long id) { UserWorkout currentWorkout = userworkoutrepos.findById(id).orElseThrow(() -> new ResourceNotFoundException("Workout id " + id + " now found.")); if (workout.getWorkoutname() != null) { currentWorkout.setWorkoutname(workout.getWorkoutname()); } if (workout.getWorkoutlength() != null) { currentWorkout.setWorkoutlength(workout.getWorkoutlength()); } return userworkoutrepos.save(currentWorkout); } @Override public ArrayList<UserWorkout> findAll() { ArrayList<UserWorkout> list = new ArrayList<>(); userworkoutrepos.findAll().iterator().forEachRemaining(list::add); return list; } }
4,082
0.718275
0.718275
117
33.888889
30.793432
152
false
false
0
0
0
0
0
0
0.470085
false
false
8
68fd888a4969de9b87926ba9b75a907fe6df481c
26,834,955,718,316
7aee3773b432b44eb642917990a97b5a05769906
/net.sourceforge.usbdm.cdt.ui/src/tests/internal/TestWorkbenchGdbServerPreferencePage.java
115b616c3ef4798c551dcd52ba003623d2e22ad2
[]
no_license
podonoghue/usbdm-eclipse-plugins
https://github.com/podonoghue/usbdm-eclipse-plugins
34c2dc52148087a1efb0145cb420706929471bed
9837f4396bd43995c0ed8094d660d8d7a877c8bf
refs/heads/master
2023-08-17T12:23:36.890000
2023-08-12T01:43:01
2023-08-12T01:43:01
10,416,330
3
3
null
null
null
null
null
null
null
null
null
null
null
null
null
package tests.internal; import java.util.ArrayList; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import net.sourceforge.usbdm.cdt.ui.WorkbenchGdbServerPreferencePage; import net.sourceforge.usbdm.cdt.ui.WorkbenchGdbServerPreferencePage.WorkbenchPreferenceCfv1Page; public class TestWorkbenchGdbServerPreferencePage { /** * @param args */ public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); // final WorkbenchGdbServerPreferencePage topPage = new WorkbenchPreferenceArmPage(); final WorkbenchGdbServerPreferencePage topPage = new WorkbenchPreferenceCfv1Page(); shell.setLayout(new FillLayout()); topPage.init(null); topPage.createContents(shell); Button btn = new Button(shell, SWT.NONE); btn.setText("Save"); btn.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { topPage.saveSettings(); ArrayList<String> commandList = topPage.getServerCommandLine(); String commandArray[] = new String[commandList.size()]; commandArray = commandList.toArray(commandArray); for (String s : commandArray) { System.err.print(s + " "); } System.err.print("\n"); } }); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } }
UTF-8
Java
1,771
java
TestWorkbenchGdbServerPreferencePage.java
Java
[]
null
[]
package tests.internal; import java.util.ArrayList; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import net.sourceforge.usbdm.cdt.ui.WorkbenchGdbServerPreferencePage; import net.sourceforge.usbdm.cdt.ui.WorkbenchGdbServerPreferencePage.WorkbenchPreferenceCfv1Page; public class TestWorkbenchGdbServerPreferencePage { /** * @param args */ public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); // final WorkbenchGdbServerPreferencePage topPage = new WorkbenchPreferenceArmPage(); final WorkbenchGdbServerPreferencePage topPage = new WorkbenchPreferenceCfv1Page(); shell.setLayout(new FillLayout()); topPage.init(null); topPage.createContents(shell); Button btn = new Button(shell, SWT.NONE); btn.setText("Save"); btn.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { topPage.saveSettings(); ArrayList<String> commandList = topPage.getServerCommandLine(); String commandArray[] = new String[commandList.size()]; commandArray = commandList.toArray(commandArray); for (String s : commandArray) { System.err.print(s + " "); } System.err.print("\n"); } }); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } }
1,771
0.675889
0.67476
52
33.057693
24.424463
97
false
false
0
0
0
0
0
0
0.596154
false
false
8
43c518f16c7b8369cdc7dd8fbe59baa823572f1d
15,229,954,053,221
4afbd997e212c82bcce561460ea5be1fa01393cb
/IslandFurniture_Enterprise-Student/IS3102_Project-ejb/src/java/AnalyticalCRM/ValueAnalysis/CustomerValueAnalysisBeanLocal.java
94da8e48da474cb940d1ffca825dafb715341ef6
[]
no_license
leileijng/sepCA5
https://github.com/leileijng/sepCA5
89436ae1521e5383a453b4d9a964a404fd78d276
49a944c540afea6435eb4858ecc308b583eb39c7
refs/heads/master
2020-12-18T20:16:57.931000
2020-02-14T07:55:46
2020-02-14T07:55:46
235,509,699
3
1
null
false
2020-02-14T07:55:47
2020-01-22T06:04:19
2020-02-10T02:17:04
2020-02-14T07:55:46
9,829
3
1
0
Java
false
false
/* * 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 AnalyticalCRM.ValueAnalysis; import EntityManager.FurnitureEntity; import EntityManager.ItemEntity; import EntityManager.LineItemEntity; import EntityManager.MemberEntity; import EntityManager.RetailProductEntity; import EntityManager.SalesRecordEntity; import java.util.Date; import java.util.List; import javax.ejb.Local; @Local public interface CustomerValueAnalysisBeanLocal { public List<LineItemEntity> sortBestSellingMenuItem1Year(); public List<LineItemEntity> sortBestSellingRetailProduct1Year(); public List<LineItemEntity> sortBestSellingFurniture1Year(); public Integer getCustomerMonetaryValueMenuItem(Long memberId); public Integer getCustomerMonetaryValueRetailProduct(Long memberId); public Integer getCustomerFrequencyMenuItem(Long memberId); public Integer getCustomerFrequencyRetailProduct(Long memberId); public Integer getCustomerRecencyMenuItem(Long memberId); public Integer getCustomerRecencyRetailProduct(Long memberId); public Integer getAverageCustomerRecencyRetailProduct(); public Integer getAverageCustomerMonetaryValueRetailProduct(); public Integer getAverageCustomerFrequencyRetailProduct(); public Integer getAverageCustomerFrequencyMenuItem(); public Integer getAverageCustomerMonetaryValueMenuItem(); public Integer getAverageCustomerRecencyMenuItem(); public Date getItemLastPurchase(Long itemId); public LineItemEntity getSecondProductFromFirstMenuItem(String menuItem); public LineItemEntity getSecondProductFromFirstRP(String retailProduct); public LineItemEntity getSecondProductFromFirst(String furniture); public Integer getTotalMenuItemSoldInCountry(String country); public Integer getTotalRetailProductsSoldInCountry(String country); public Integer getTotalFurnitureSoldInCountry(String country); public Double getEstimatedCustomerLife(); public Double getCustomerLifeTimeValue(); public Integer numOfMembersInJoinDate(Integer year); public Integer getRevenueOfJoinDate(Integer year); public Integer numOfMembersInCountry(String country); public Integer totalCumulativeSpendingOfCountry(String country); public List<LineItemEntity> sortBestSellingRetailProducts(); public Double averageOrderPriceForRetainedMembers(); public Double averageOrdersPerRetainedMember(); public Integer getTotalNumberOfSalesRecord(); public Double getRetainedCustomerRetentionRate(List<MemberEntity> retainedMembers); public List<MemberEntity> getRetainedMembers(); public Double averageOrderPriceInAcquiredYear(); public Double getFurnitureTotalRevenue(Long furnitureId); public List<LineItemEntity> sortBestSellingFurniture(); public List<LineItemEntity> sortBestSellingMenuItem(); public Boolean sendMemberLoyaltyPoints(List<MemberEntity> members, Integer loyaltyPoints); public Double getStdErrorOfIncome(); public Double getROfIncome(); public Double getRSquaredOfIncome(); public Double getStdErrorOfAge(); public Double getROfAge(); public Double getRSquaredOfAge(); public Integer totalCumulativeSpendingOfJoinDate(Integer startDate, Integer endDate); public Integer numOfMembersInIncomeGroup(Integer startIncome, Integer endIncome); public Double averageOrderPrice(); public Double averageOrdersPerAcquiredYear(); public Double getCustomerRetentionRate(); public Integer getAverageCustomerRecency(); public Integer getAverageCustomerFrequency(); public Integer getAverageCustomerMonetaryValue(); public Integer getCustomerMonetaryValue(Long memberId); public Integer getCustomerFrequency(Long memberId); public Integer getCustomerRecency(Long memberId); public Integer numOfMembersInAgeGroup(Integer startAge, Integer endAge); public Integer averageCumulativeSpending(); public Integer totalCumulativeSpendingOfAge(Integer startAge, Integer endAge); public Integer totalCumulativeSpendingOfIncome(Integer startIncome, Integer endIncome); public Double totalMemberRevenue(); public Double totalNonMemberRevenue(); public Integer customerLifetimeValueOfMember(Long memberId); public List<ItemEntity> viewSimilarProducts(Long itemId); public List<ItemEntity> viewUpsellProducts(Long itemId); public Integer viewMonthlyReport(); public Integer viewSalesSummary(); public List<FurnitureEntity> viewBestSellingFurniture(); public List<RetailProductEntity> viewBestSellingRetailProducts(); public List<SalesRecordEntity> viewMemberSalesRecord(Long memberId); public Double getSalesRecordAmountDueInUSD(Long salesRecordId); }
UTF-8
Java
5,026
java
CustomerValueAnalysisBeanLocal.java
Java
[]
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 AnalyticalCRM.ValueAnalysis; import EntityManager.FurnitureEntity; import EntityManager.ItemEntity; import EntityManager.LineItemEntity; import EntityManager.MemberEntity; import EntityManager.RetailProductEntity; import EntityManager.SalesRecordEntity; import java.util.Date; import java.util.List; import javax.ejb.Local; @Local public interface CustomerValueAnalysisBeanLocal { public List<LineItemEntity> sortBestSellingMenuItem1Year(); public List<LineItemEntity> sortBestSellingRetailProduct1Year(); public List<LineItemEntity> sortBestSellingFurniture1Year(); public Integer getCustomerMonetaryValueMenuItem(Long memberId); public Integer getCustomerMonetaryValueRetailProduct(Long memberId); public Integer getCustomerFrequencyMenuItem(Long memberId); public Integer getCustomerFrequencyRetailProduct(Long memberId); public Integer getCustomerRecencyMenuItem(Long memberId); public Integer getCustomerRecencyRetailProduct(Long memberId); public Integer getAverageCustomerRecencyRetailProduct(); public Integer getAverageCustomerMonetaryValueRetailProduct(); public Integer getAverageCustomerFrequencyRetailProduct(); public Integer getAverageCustomerFrequencyMenuItem(); public Integer getAverageCustomerMonetaryValueMenuItem(); public Integer getAverageCustomerRecencyMenuItem(); public Date getItemLastPurchase(Long itemId); public LineItemEntity getSecondProductFromFirstMenuItem(String menuItem); public LineItemEntity getSecondProductFromFirstRP(String retailProduct); public LineItemEntity getSecondProductFromFirst(String furniture); public Integer getTotalMenuItemSoldInCountry(String country); public Integer getTotalRetailProductsSoldInCountry(String country); public Integer getTotalFurnitureSoldInCountry(String country); public Double getEstimatedCustomerLife(); public Double getCustomerLifeTimeValue(); public Integer numOfMembersInJoinDate(Integer year); public Integer getRevenueOfJoinDate(Integer year); public Integer numOfMembersInCountry(String country); public Integer totalCumulativeSpendingOfCountry(String country); public List<LineItemEntity> sortBestSellingRetailProducts(); public Double averageOrderPriceForRetainedMembers(); public Double averageOrdersPerRetainedMember(); public Integer getTotalNumberOfSalesRecord(); public Double getRetainedCustomerRetentionRate(List<MemberEntity> retainedMembers); public List<MemberEntity> getRetainedMembers(); public Double averageOrderPriceInAcquiredYear(); public Double getFurnitureTotalRevenue(Long furnitureId); public List<LineItemEntity> sortBestSellingFurniture(); public List<LineItemEntity> sortBestSellingMenuItem(); public Boolean sendMemberLoyaltyPoints(List<MemberEntity> members, Integer loyaltyPoints); public Double getStdErrorOfIncome(); public Double getROfIncome(); public Double getRSquaredOfIncome(); public Double getStdErrorOfAge(); public Double getROfAge(); public Double getRSquaredOfAge(); public Integer totalCumulativeSpendingOfJoinDate(Integer startDate, Integer endDate); public Integer numOfMembersInIncomeGroup(Integer startIncome, Integer endIncome); public Double averageOrderPrice(); public Double averageOrdersPerAcquiredYear(); public Double getCustomerRetentionRate(); public Integer getAverageCustomerRecency(); public Integer getAverageCustomerFrequency(); public Integer getAverageCustomerMonetaryValue(); public Integer getCustomerMonetaryValue(Long memberId); public Integer getCustomerFrequency(Long memberId); public Integer getCustomerRecency(Long memberId); public Integer numOfMembersInAgeGroup(Integer startAge, Integer endAge); public Integer averageCumulativeSpending(); public Integer totalCumulativeSpendingOfAge(Integer startAge, Integer endAge); public Integer totalCumulativeSpendingOfIncome(Integer startIncome, Integer endIncome); public Double totalMemberRevenue(); public Double totalNonMemberRevenue(); public Integer customerLifetimeValueOfMember(Long memberId); public List<ItemEntity> viewSimilarProducts(Long itemId); public List<ItemEntity> viewUpsellProducts(Long itemId); public Integer viewMonthlyReport(); public Integer viewSalesSummary(); public List<FurnitureEntity> viewBestSellingFurniture(); public List<RetailProductEntity> viewBestSellingRetailProducts(); public List<SalesRecordEntity> viewMemberSalesRecord(Long memberId); public Double getSalesRecordAmountDueInUSD(Long salesRecordId); }
5,026
0.783526
0.782929
162
30.024691
29.326168
94
false
false
0
0
0
0
0
0
0.555556
false
false
8
d47695bd37fd801ed329630706effe2af381c14b
25,683,904,485,922
beebddfe38590c9608217e98ff46dc3d9ef474df
/src/main/java/com/lib/kodillalibrary/controller/exceptions/NotFoundException.java
a8c39cd593f90a14bf9f17be254e508542af1c25
[]
no_license
lapivoinerouge/library-manager
https://github.com/lapivoinerouge/library-manager
c9a7e792b1936e8b81a8cbd0807ff033f01f01a7
de2ae1927b2a03d84c42d16d5e985558cc06ec40
refs/heads/master
2020-07-04T18:10:01.414000
2019-09-20T13:10:15
2019-09-20T13:10:15
202,367,938
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.lib.kodillalibrary.controller.exceptions; public class NotFoundException extends Exception { public NotFoundException(Long id) { super("Id not found: " + id); } }
UTF-8
Java
193
java
NotFoundException.java
Java
[]
null
[]
package com.lib.kodillalibrary.controller.exceptions; public class NotFoundException extends Exception { public NotFoundException(Long id) { super("Id not found: " + id); } }
193
0.709845
0.709845
8
23.125
22.211695
53
false
false
0
0
0
0
0
0
0.25
false
false
8
0fc25cbfaba0384bd3653decf04d3ce424839ea5
17,325,898,093,156
aeda434d124602c1030d044a681b03f0f36498bd
/app/src/main/java/com/ats/monginis_communication/activity/DriverInfoActivity.java
4182d6fbbc1dc2ceaaf6f027c98e319a69dc488e
[]
no_license
Aaryatech/Monginis_Communication
https://github.com/Aaryatech/Monginis_Communication
684a5dc45f576b1e835dfdbdfad9b604956c6fb8
16f6d4ba6ae93f1d7cb5a947b48e4d9b04c5408a
refs/heads/master
2021-06-17T10:52:28.609000
2021-01-23T13:02:11
2021-01-23T13:02:11
135,136,916
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.ats.monginis_communication.activity; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.DefaultItemAnimator; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.widget.Toast; import com.ats.monginis_communication.R; import com.ats.monginis_communication.adapter.DriverInfoAdapter; import com.ats.monginis_communication.adapter.TrayReportAdapter; import com.ats.monginis_communication.bean.DriverInfo; import com.ats.monginis_communication.bean.TrayDetails; import com.ats.monginis_communication.common.CommonDialog; import com.ats.monginis_communication.constants.Constants; import com.ats.monginis_communication.util.PermissionUtil; import java.util.ArrayList; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; public class DriverInfoActivity extends AppCompatActivity { private RecyclerView recyclerView; DriverInfoAdapter adapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_driver_info); setTitle("Driver Info"); if (PermissionUtil.checkAndRequestPermissions(this)) { } recyclerView = findViewById(R.id.recyclerView); try { int frId = getIntent().getIntExtra("frId", 0); getDriverInfo(frId); } catch (Exception e) { e.printStackTrace(); } } public void getDriverInfo(int frId) { if (Constants.isOnline(this)) { final CommonDialog commonDialog = new CommonDialog(this, "Loading", "Please Wait..."); commonDialog.show(); Call<ArrayList<DriverInfo>> infoCall = Constants.myInterface.getDriverInfoByFr(frId); infoCall.enqueue(new Callback<ArrayList<DriverInfo>>() { @Override public void onResponse(Call<ArrayList<DriverInfo>> call, Response<ArrayList<DriverInfo>> response) { try { if (response.body() != null) { ArrayList<DriverInfo> data = response.body(); commonDialog.dismiss(); Log.e("Driver Info : ", "Info Date---------------------------" + data); adapter = new DriverInfoAdapter(data, DriverInfoActivity.this); RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(DriverInfoActivity.this); recyclerView.setLayoutManager(mLayoutManager); recyclerView.setItemAnimator(new DefaultItemAnimator()); recyclerView.setAdapter(adapter); } else { commonDialog.dismiss(); Log.e("Driver Info : ", " NULL"); Toast.makeText(DriverInfoActivity.this, "No Data Available!", Toast.LENGTH_SHORT).show(); } } catch (Exception e) { commonDialog.dismiss(); Log.e("Driver Info : ", " Exception : " + e.getMessage()); Toast.makeText(DriverInfoActivity.this, "Unable to process!", Toast.LENGTH_SHORT).show(); e.printStackTrace(); } } @Override public void onFailure(Call<ArrayList<DriverInfo>> call, Throwable t) { commonDialog.dismiss(); Log.e("Driver Info : ", " onFailure : " + t.getMessage()); t.printStackTrace(); Toast.makeText(DriverInfoActivity.this, "Unable to process!", Toast.LENGTH_SHORT).show(); } }); } else { Toast.makeText(this, "No Internet Connection", Toast.LENGTH_SHORT).show(); } } }
UTF-8
Java
4,043
java
DriverInfoActivity.java
Java
[]
null
[]
package com.ats.monginis_communication.activity; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.DefaultItemAnimator; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.widget.Toast; import com.ats.monginis_communication.R; import com.ats.monginis_communication.adapter.DriverInfoAdapter; import com.ats.monginis_communication.adapter.TrayReportAdapter; import com.ats.monginis_communication.bean.DriverInfo; import com.ats.monginis_communication.bean.TrayDetails; import com.ats.monginis_communication.common.CommonDialog; import com.ats.monginis_communication.constants.Constants; import com.ats.monginis_communication.util.PermissionUtil; import java.util.ArrayList; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; public class DriverInfoActivity extends AppCompatActivity { private RecyclerView recyclerView; DriverInfoAdapter adapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_driver_info); setTitle("Driver Info"); if (PermissionUtil.checkAndRequestPermissions(this)) { } recyclerView = findViewById(R.id.recyclerView); try { int frId = getIntent().getIntExtra("frId", 0); getDriverInfo(frId); } catch (Exception e) { e.printStackTrace(); } } public void getDriverInfo(int frId) { if (Constants.isOnline(this)) { final CommonDialog commonDialog = new CommonDialog(this, "Loading", "Please Wait..."); commonDialog.show(); Call<ArrayList<DriverInfo>> infoCall = Constants.myInterface.getDriverInfoByFr(frId); infoCall.enqueue(new Callback<ArrayList<DriverInfo>>() { @Override public void onResponse(Call<ArrayList<DriverInfo>> call, Response<ArrayList<DriverInfo>> response) { try { if (response.body() != null) { ArrayList<DriverInfo> data = response.body(); commonDialog.dismiss(); Log.e("Driver Info : ", "Info Date---------------------------" + data); adapter = new DriverInfoAdapter(data, DriverInfoActivity.this); RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(DriverInfoActivity.this); recyclerView.setLayoutManager(mLayoutManager); recyclerView.setItemAnimator(new DefaultItemAnimator()); recyclerView.setAdapter(adapter); } else { commonDialog.dismiss(); Log.e("Driver Info : ", " NULL"); Toast.makeText(DriverInfoActivity.this, "No Data Available!", Toast.LENGTH_SHORT).show(); } } catch (Exception e) { commonDialog.dismiss(); Log.e("Driver Info : ", " Exception : " + e.getMessage()); Toast.makeText(DriverInfoActivity.this, "Unable to process!", Toast.LENGTH_SHORT).show(); e.printStackTrace(); } } @Override public void onFailure(Call<ArrayList<DriverInfo>> call, Throwable t) { commonDialog.dismiss(); Log.e("Driver Info : ", " onFailure : " + t.getMessage()); t.printStackTrace(); Toast.makeText(DriverInfoActivity.this, "Unable to process!", Toast.LENGTH_SHORT).show(); } }); } else { Toast.makeText(this, "No Internet Connection", Toast.LENGTH_SHORT).show(); } } }
4,043
0.596339
0.594361
103
38.252426
32.45541
121
false
false
0
0
0
0
0
0
0.68932
false
false
8
afb5096b805f94e715ed032d77b2f91d738e0853
4,612,794,883,804
db0d5daa2ccee0385be1f9e6f0b28818688cc833
/app/src/main/java/br/unicamp/ft/e215293/Winding/MusicsFragment.java
85d5b752343f3662b50942f8fd55423f52337dd6
[]
no_license
EliseuPHP/windingBTD
https://github.com/EliseuPHP/windingBTD
9e0d9de45711ec8e43a9a77044a6da8ccfeb7c73
5d20976151a8e5e70bb3eeb3f3049bac0250e203
refs/heads/master
2023-06-04T19:44:32.042000
2021-06-21T21:09:23
2021-06-21T21:09:23
264,308,695
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package br.unicamp.ft.e215293.Winding; import android.os.Bundle; import androidx.fragment.app.Fragment; import androidx.navigation.NavController; import androidx.navigation.fragment.NavHostFragment; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Toast; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.util.ArrayList; import java.util.Arrays; import br.unicamp.ft.e215293.Winding.internet.JSONReceiver; import br.unicamp.ft.e215293.Winding.internet.ReceiveJSON; import br.unicamp.ft.e215293.Winding.music.Music; import br.unicamp.ft.e215293.Winding.music.MusicAdapter; /** * A simple {@link Fragment} subclass. */ public class MusicsFragment extends Fragment implements JSONReceiver { private RecyclerView recyclerView; private MusicAdapter musicAdapter; private int origin = 0; private ArrayList<Music> musicas = new ArrayList<>(); public MusicsFragment() { // Required empty public constructor } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment View view = inflater.inflate(R.layout.fragment_musics, container, false); recyclerView = view.findViewById(R.id.recycler_view); recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); String data; assert getArguments() != null; origin = getArguments().getInt("origin"); data = getArguments().getString("data"); if (origin == 1) { getArguments().remove("origin"); origin = 0; if (!data.equals("")) { makeACall(data); musicAdapter = new MusicAdapter(musicas); } else { data = "%25"; makeACall(data); musicAdapter = new MusicAdapter(musicas); } } MusicAdapter.MusicOnItemClickListener listener = new MusicAdapter.MusicOnItemClickListener() { @Override public void musicOnItemClickListener(Music music) { // Toast.makeText(getContext(), nome + "|" + art, Toast.LENGTH_SHORT).show(); Bundle bundle = new Bundle(); bundle.putSerializable("music", music); NavController navController = NavHostFragment.findNavController(MusicsFragment.this); navController.navigate(R.id.arestaMS, bundle); } }; if (musicAdapter == null) { data = "%25"; makeACall(data); musicAdapter = new MusicAdapter(musicas); } musicAdapter.setMusicOnItemClickListener(listener); recyclerView.setAdapter(musicAdapter); return view; } private void makeACall(String data){ System.out.println("*************" + data + "*****************"); String url = "https://api.genius.com/search?q=" + data + "&per_page=10&page=1&sort=popularity&access_token=MaALaMqzcduGO5dzRrkDUQei8E-rbz2BKNeHhszXdgJbZHzat9IVBbisjWjU8h4n"; new ReceiveJSON(MusicsFragment.this).execute(url); } @Override public void receiveJSON(JSONObject jsonObject) { try { JSONObject response = new JSONObject(jsonObject.getString("response")); JSONArray hits = response.getJSONArray("hits"); for (int i = 0; i < hits.length(); i++) { JSONObject track = new JSONObject(hits.getString(i)); JSONObject data = new JSONObject(track.getString("result")); JSONObject artist = new JSONObject(data.getString("primary_artist")); String nome = data.getString("title"); String songArt = data.getString("song_art_image_url"); int idMusica = data.getInt("id"); String artista = artist.getString("name"); int idArtist = artist.getInt("id"); String lPath = "http://genius.com" + data.getString("path"); Music musica = new Music(idMusica, nome, songArt, lPath, idArtist, artista); musicas.add(musica); System.out.println(musicas.get(i).getNomeMusica()); } } catch (JSONException e) { e.printStackTrace(); } refreshData(musicas); } private void refreshData(ArrayList<Music> data) { musicas = new ArrayList<Music>(data); musicAdapter.notifyDataSetChanged(); } }
UTF-8
Java
4,731
java
MusicsFragment.java
Java
[ { "context": "\"&per_page=10&page=1&sort=popularity&access_token=MaALaMqzcduGO5dzRrkDUQei8E-rbz2BKNeHhszXdgJbZHzat9IVBbisjWjU8h4n\";\n new ReceiveJSON(MusicsFragment.this).ex", "end": 3302, "score": 0.9955770373344421, "start": 3238, "tag": "KEY", "value": "MaALaMqzcduGO5dzRrkDUQei8E-rbz2BKNeHhszXdgJbZHzat9IVBbisjWjU8h4n" } ]
null
[]
package br.unicamp.ft.e215293.Winding; import android.os.Bundle; import androidx.fragment.app.Fragment; import androidx.navigation.NavController; import androidx.navigation.fragment.NavHostFragment; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Toast; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.util.ArrayList; import java.util.Arrays; import br.unicamp.ft.e215293.Winding.internet.JSONReceiver; import br.unicamp.ft.e215293.Winding.internet.ReceiveJSON; import br.unicamp.ft.e215293.Winding.music.Music; import br.unicamp.ft.e215293.Winding.music.MusicAdapter; /** * A simple {@link Fragment} subclass. */ public class MusicsFragment extends Fragment implements JSONReceiver { private RecyclerView recyclerView; private MusicAdapter musicAdapter; private int origin = 0; private ArrayList<Music> musicas = new ArrayList<>(); public MusicsFragment() { // Required empty public constructor } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment View view = inflater.inflate(R.layout.fragment_musics, container, false); recyclerView = view.findViewById(R.id.recycler_view); recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); String data; assert getArguments() != null; origin = getArguments().getInt("origin"); data = getArguments().getString("data"); if (origin == 1) { getArguments().remove("origin"); origin = 0; if (!data.equals("")) { makeACall(data); musicAdapter = new MusicAdapter(musicas); } else { data = "%25"; makeACall(data); musicAdapter = new MusicAdapter(musicas); } } MusicAdapter.MusicOnItemClickListener listener = new MusicAdapter.MusicOnItemClickListener() { @Override public void musicOnItemClickListener(Music music) { // Toast.makeText(getContext(), nome + "|" + art, Toast.LENGTH_SHORT).show(); Bundle bundle = new Bundle(); bundle.putSerializable("music", music); NavController navController = NavHostFragment.findNavController(MusicsFragment.this); navController.navigate(R.id.arestaMS, bundle); } }; if (musicAdapter == null) { data = "%25"; makeACall(data); musicAdapter = new MusicAdapter(musicas); } musicAdapter.setMusicOnItemClickListener(listener); recyclerView.setAdapter(musicAdapter); return view; } private void makeACall(String data){ System.out.println("*************" + data + "*****************"); String url = "https://api.genius.com/search?q=" + data + "&per_page=10&page=1&sort=popularity&access_token=<KEY>"; new ReceiveJSON(MusicsFragment.this).execute(url); } @Override public void receiveJSON(JSONObject jsonObject) { try { JSONObject response = new JSONObject(jsonObject.getString("response")); JSONArray hits = response.getJSONArray("hits"); for (int i = 0; i < hits.length(); i++) { JSONObject track = new JSONObject(hits.getString(i)); JSONObject data = new JSONObject(track.getString("result")); JSONObject artist = new JSONObject(data.getString("primary_artist")); String nome = data.getString("title"); String songArt = data.getString("song_art_image_url"); int idMusica = data.getInt("id"); String artista = artist.getString("name"); int idArtist = artist.getInt("id"); String lPath = "http://genius.com" + data.getString("path"); Music musica = new Music(idMusica, nome, songArt, lPath, idArtist, artista); musicas.add(musica); System.out.println(musicas.get(i).getNomeMusica()); } } catch (JSONException e) { e.printStackTrace(); } refreshData(musicas); } private void refreshData(ArrayList<Music> data) { musicas = new ArrayList<Music>(data); musicAdapter.notifyDataSetChanged(); } }
4,672
0.62862
0.618685
136
33.786766
29.657953
181
false
false
0
0
0
0
0
0
0.639706
false
false
8
34b7346f3c9878db304e6c18f7bec022720cf391
4,612,794,881,532
aaba66f9b7b8f50727387c5fed9976b3fb997030
/src/main/java/GUI/Welcome/WelcomePanel.java
9091f4f3888212dd9d97e4ad31d8e36ef394b036
[]
no_license
rluvaton/Maze
https://github.com/rluvaton/Maze
9aec31ed2b23e864332060164a8e041de730e87a
33455bc7e6368f0f21a1914120740538fd4fdf58
refs/heads/master
2021-06-30T15:01:52.289000
2020-06-25T14:11:10
2020-06-25T14:11:10
164,068,424
0
0
null
false
2020-10-01T14:25:45
2019-01-04T06:36:40
2020-06-25T14:11:13
2020-10-01T14:25:12
425
0
0
1
Java
false
false
package GUI.Welcome; import GUI.Utils.GuiHelper; import GUI.WindowCard; import Helpers.CallbackFns.NoArgsVoidCallbackFunction; import com.jgoodies.forms.layout.FormLayout; import com.jgoodies.forms.layout.CellConstraints; import javax.swing.*; import java.awt.*; public class WelcomePanel extends JPanel implements WindowCard { public static String DEFAULT_CARD_NAME = "WelcomeCard"; private JLabel title; private JLabel madeBy; private JButton generateBtn; private JButton statsBtn; private JButton playBtn; private NoArgsVoidCallbackFunction generatedClicked = () -> {}; private NoArgsVoidCallbackFunction playClicked = () -> {}; private NoArgsVoidCallbackFunction statsClicked = () -> {}; public WelcomePanel(NoArgsVoidCallbackFunction generatedClicked, NoArgsVoidCallbackFunction playClicked, NoArgsVoidCallbackFunction statsClicked) { this.generatedClicked = generatedClicked; this.playClicked = playClicked; this.statsClicked = statsClicked; // this.setPreferredSize(new Dimension(300, 300)); } public void init() { String encodedColumnSpecs = "fill:165px:noGrow, left:4dlu:noGrow, fill:d:grow, left:4dlu:noGrow, fill:155px:noGrow"; String encodedRowSpecs = "center:d:grow, top:4dlu:noGrow, center:max(d;4px):noGrow, top:4dlu:noGrow, center:d:grow"; this.setLayout(new FormLayout(encodedColumnSpecs, encodedRowSpecs)); this.setEnabled(true); this.setMaximumSize(new Dimension(530, 133)); this.setMinimumSize(new Dimension(530, 133)); this.setPreferredSize(new Dimension(530, 133)); this.setVisible(true); } public void initComponents() { createUIComponents(); } private void createUIComponents() { CellConstraints cc = new CellConstraints(); initGenerateBtn(); createStatsBtn(); createPlayBtn(cc); createTitle(cc); createMadeBy(cc); } private void initGenerateBtn() { generateBtn = new JButton(); Font generateBtnFont = GuiHelper.getFont("Fira Code", -1, -1, generateBtn.getFont()); if (generateBtnFont != null) { generateBtn.setFont(generateBtnFont); } generateBtn.setHideActionText(false); generateBtn.setText("Generate"); generateBtn.setToolTipText("Generate maze and export it to image"); generateBtn.putClientProperty("hideActionText", Boolean.FALSE); generateBtn.putClientProperty("html.disable", Boolean.FALSE); this.generateBtn.addActionListener(e -> generatedClicked.run()); this.add(generateBtn, new CellConstraints(1, 5, 1, 1, CellConstraints.DEFAULT, CellConstraints.DEFAULT, new Insets(0, 10, 0, 0))); } private void createStatsBtn() { statsBtn = new JButton(); Font statsBtnFont = GuiHelper.getFont("Fira Code", -1, -1, statsBtn.getFont()); if (statsBtnFont != null) { statsBtn.setFont(statsBtnFont); } statsBtn.setText("Stats"); statsBtn.setToolTipText("User Statics"); statsBtn.addActionListener(e -> statsClicked.run()); this.add(statsBtn, new CellConstraints(5, 5, 1, 1, CellConstraints.DEFAULT, CellConstraints.DEFAULT, new Insets(0, 0, 0, 10))); } private void createPlayBtn(CellConstraints cc) { playBtn = new JButton(); Font playBtnFont = GuiHelper.getFont("Fira Code", -1, -1, playBtn.getFont()); if (playBtnFont != null) { playBtn.setFont(playBtnFont); } playBtn.setText("Play"); playBtn.setToolTipText("Start Playing"); playBtn.putClientProperty("hideActionText", Boolean.FALSE); playBtn.addActionListener(e -> playClicked.run()); this.add(playBtn, cc.xy(3, 5)); } private void createTitle(CellConstraints cc) { title = new JLabel(); Font titleFont = GuiHelper.getFont("Source Code Pro", Font.BOLD, 18, title.getFont()); if (titleFont != null) { title.setFont(titleFont); } title.setHorizontalAlignment(0); title.setHorizontalTextPosition(0); title.setText("Maze"); this.add(title, cc.xy(3, 1)); } private void createMadeBy(CellConstraints cc) { madeBy = new JLabel(); Font madeByFont = GuiHelper.getFont("Fira Code", -1, -1, madeBy.getFont()); if (madeByFont != null) { madeBy.setFont(madeByFont); } madeBy.setForeground(new Color(-9276814)); madeBy.setHorizontalAlignment(0); madeBy.setText("Made by Raz Luvaton"); this.add(madeBy, cc.xy(3, 3)); } @Override public Dimension getPreferredSize() { return new Dimension(471, 98); } }
UTF-8
Java
4,839
java
WelcomePanel.java
Java
[ { "context": "ontalAlignment(0);\n madeBy.setText(\"Made by Raz Luvaton\");\n\n this.add(madeBy, cc.xy(3, 3));\n }\n", "end": 4686, "score": 0.9999025464057922, "start": 4675, "tag": "NAME", "value": "Raz Luvaton" } ]
null
[]
package GUI.Welcome; import GUI.Utils.GuiHelper; import GUI.WindowCard; import Helpers.CallbackFns.NoArgsVoidCallbackFunction; import com.jgoodies.forms.layout.FormLayout; import com.jgoodies.forms.layout.CellConstraints; import javax.swing.*; import java.awt.*; public class WelcomePanel extends JPanel implements WindowCard { public static String DEFAULT_CARD_NAME = "WelcomeCard"; private JLabel title; private JLabel madeBy; private JButton generateBtn; private JButton statsBtn; private JButton playBtn; private NoArgsVoidCallbackFunction generatedClicked = () -> {}; private NoArgsVoidCallbackFunction playClicked = () -> {}; private NoArgsVoidCallbackFunction statsClicked = () -> {}; public WelcomePanel(NoArgsVoidCallbackFunction generatedClicked, NoArgsVoidCallbackFunction playClicked, NoArgsVoidCallbackFunction statsClicked) { this.generatedClicked = generatedClicked; this.playClicked = playClicked; this.statsClicked = statsClicked; // this.setPreferredSize(new Dimension(300, 300)); } public void init() { String encodedColumnSpecs = "fill:165px:noGrow, left:4dlu:noGrow, fill:d:grow, left:4dlu:noGrow, fill:155px:noGrow"; String encodedRowSpecs = "center:d:grow, top:4dlu:noGrow, center:max(d;4px):noGrow, top:4dlu:noGrow, center:d:grow"; this.setLayout(new FormLayout(encodedColumnSpecs, encodedRowSpecs)); this.setEnabled(true); this.setMaximumSize(new Dimension(530, 133)); this.setMinimumSize(new Dimension(530, 133)); this.setPreferredSize(new Dimension(530, 133)); this.setVisible(true); } public void initComponents() { createUIComponents(); } private void createUIComponents() { CellConstraints cc = new CellConstraints(); initGenerateBtn(); createStatsBtn(); createPlayBtn(cc); createTitle(cc); createMadeBy(cc); } private void initGenerateBtn() { generateBtn = new JButton(); Font generateBtnFont = GuiHelper.getFont("Fira Code", -1, -1, generateBtn.getFont()); if (generateBtnFont != null) { generateBtn.setFont(generateBtnFont); } generateBtn.setHideActionText(false); generateBtn.setText("Generate"); generateBtn.setToolTipText("Generate maze and export it to image"); generateBtn.putClientProperty("hideActionText", Boolean.FALSE); generateBtn.putClientProperty("html.disable", Boolean.FALSE); this.generateBtn.addActionListener(e -> generatedClicked.run()); this.add(generateBtn, new CellConstraints(1, 5, 1, 1, CellConstraints.DEFAULT, CellConstraints.DEFAULT, new Insets(0, 10, 0, 0))); } private void createStatsBtn() { statsBtn = new JButton(); Font statsBtnFont = GuiHelper.getFont("Fira Code", -1, -1, statsBtn.getFont()); if (statsBtnFont != null) { statsBtn.setFont(statsBtnFont); } statsBtn.setText("Stats"); statsBtn.setToolTipText("User Statics"); statsBtn.addActionListener(e -> statsClicked.run()); this.add(statsBtn, new CellConstraints(5, 5, 1, 1, CellConstraints.DEFAULT, CellConstraints.DEFAULT, new Insets(0, 0, 0, 10))); } private void createPlayBtn(CellConstraints cc) { playBtn = new JButton(); Font playBtnFont = GuiHelper.getFont("Fira Code", -1, -1, playBtn.getFont()); if (playBtnFont != null) { playBtn.setFont(playBtnFont); } playBtn.setText("Play"); playBtn.setToolTipText("Start Playing"); playBtn.putClientProperty("hideActionText", Boolean.FALSE); playBtn.addActionListener(e -> playClicked.run()); this.add(playBtn, cc.xy(3, 5)); } private void createTitle(CellConstraints cc) { title = new JLabel(); Font titleFont = GuiHelper.getFont("Source Code Pro", Font.BOLD, 18, title.getFont()); if (titleFont != null) { title.setFont(titleFont); } title.setHorizontalAlignment(0); title.setHorizontalTextPosition(0); title.setText("Maze"); this.add(title, cc.xy(3, 1)); } private void createMadeBy(CellConstraints cc) { madeBy = new JLabel(); Font madeByFont = GuiHelper.getFont("Fira Code", -1, -1, madeBy.getFont()); if (madeByFont != null) { madeBy.setFont(madeByFont); } madeBy.setForeground(new Color(-9276814)); madeBy.setHorizontalAlignment(0); madeBy.setText("Made by <NAME>"); this.add(madeBy, cc.xy(3, 3)); } @Override public Dimension getPreferredSize() { return new Dimension(471, 98); } }
4,834
0.650548
0.633189
146
32.150684
29.785614
138
false
false
0
0
0
0
0
0
0.938356
false
false
8
24144dfa7375e444c9d1f1e9e09ea59afa415cfb
5,695,126,639,998
ed7c3150f11242e497d88a4a7772a57c4387bd59
/app/src/main/java/com/zhan/aoyoustore/beans/SetShoppingCartQuantityResponseBean.java
a3ed5ef939c0a5afc83f4359fd30870ee8103ce8
[]
no_license
HardWareMall2016/AoYouStore
https://github.com/HardWareMall2016/AoYouStore
da79e740d665b79b7a8c1dee1e9f6d9f5342762d
35797937949c247a833f93424efb2b0d73ed630a
refs/heads/master
2021-01-20T22:29:28.655000
2016-10-23T08:53:06
2016-10-23T08:53:06
62,874,817
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.zhan.aoyoustore.beans; /** * 作者:伍岳 on 2016/10/22 21:34 * 邮箱:wuyue8512@163.com * // * // ............................................. * // 美女坐镇 BUG辟易 * // ............................................. * // * // .::::. * // .::::::::. * // ::::::::::: * // ..:::::::::::' * // '::::::::::::' * // .:::::::::: * // '::::::::::::::.. * // ..::::::::::::. * // ``:::::::::::::::: * // ::::``:::::::::' .:::. * // ::::' ':::::' .::::::::. * // .::::' :::: .:::::::'::::. * // .:::' ::::: .:::::::::' ':::::. * // .::' :::::.:::::::::' ':::::. * // .::' ::::::::::::::' ``::::. * // ...::: ::::::::::::' ``::. * // ```` ':. ':::::::::' ::::.. * // '.:::::' ':'````.. * // */ public class SetShoppingCartQuantityResponseBean { private ResultBean result; public ResultBean getResult() { return result; } public void setResult(ResultBean result) { this.result = result; } public static class ResultBean { private int res; private int stock; private double price; private double totalPrice; public int getRes() { return res; } public void setRes(int res) { this.res = res; } public int getStock() { return stock; } public void setStock(int stock) { this.stock = stock; } public double getPrice() { return price; } public void setPrice(double price) { this.price = price; } public double getTotalPrice() { return totalPrice; } public void setTotalPrice(double totalPrice) { this.totalPrice = totalPrice; } } }
UTF-8
Java
2,193
java
SetShoppingCartQuantityResponseBean.java
Java
[ { "context": "package com.zhan.aoyoustore.beans;\n\n/**\n * 作者:伍岳 on 2016/10/22 21:34\n * 邮箱:wuyue8512@163.com\n * //", "end": 48, "score": 0.9994059801101685, "start": 46, "tag": "NAME", "value": "伍岳" }, { "context": "re.beans;\n\n/**\n * 作者:伍岳 on 2016/10/22 21:34\n * 邮箱:wuyue8512@163.com\n * //\n * // .............................", "end": 92, "score": 0.9999014735221863, "start": 75, "tag": "EMAIL", "value": "wuyue8512@163.com" } ]
null
[]
package com.zhan.aoyoustore.beans; /** * 作者:伍岳 on 2016/10/22 21:34 * 邮箱:<EMAIL> * // * // ............................................. * // 美女坐镇 BUG辟易 * // ............................................. * // * // .::::. * // .::::::::. * // ::::::::::: * // ..:::::::::::' * // '::::::::::::' * // .:::::::::: * // '::::::::::::::.. * // ..::::::::::::. * // ``:::::::::::::::: * // ::::``:::::::::' .:::. * // ::::' ':::::' .::::::::. * // .::::' :::: .:::::::'::::. * // .:::' ::::: .:::::::::' ':::::. * // .::' :::::.:::::::::' ':::::. * // .::' ::::::::::::::' ``::::. * // ...::: ::::::::::::' ``::. * // ```` ':. ':::::::::' ::::.. * // '.:::::' ':'````.. * // */ public class SetShoppingCartQuantityResponseBean { private ResultBean result; public ResultBean getResult() { return result; } public void setResult(ResultBean result) { this.result = result; } public static class ResultBean { private int res; private int stock; private double price; private double totalPrice; public int getRes() { return res; } public void setRes(int res) { this.res = res; } public int getStock() { return stock; } public void setStock(int stock) { this.stock = stock; } public double getPrice() { return price; } public void setPrice(double price) { this.price = price; } public double getTotalPrice() { return totalPrice; } public void setTotalPrice(double totalPrice) { this.totalPrice = totalPrice; } } }
2,183
0.290069
0.281293
81
25.728395
19.47332
65
false
false
0
0
0
0
0
0
0.197531
false
false
8
db92b7b558a2ccc0a9a3214c162faa44d344fbd2
6,708,738,925,085
19ca503cd8f1194d826ded783175fed897f13333
/sts-workspace-examples/example.web.basic/src/main/java/example/web/spring/form/command/ArticleCommand.java
931d2d2242a3fdf95c48b1284fa469de66a27772
[]
no_license
dgkim11/examples
https://github.com/dgkim11/examples
7ec497f07109ae599d5cec2af83491724bd49442
00887a605bc9564380fc9e24c3245c97b8bcc4d6
refs/heads/master
2016-08-11T11:37:58.321000
2016-01-10T02:15:04
2016-01-10T02:15:04
49,347,594
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package example.web.spring.form.command; /** * Each field name of command object should have the same name as input tag name in a form. * For example, <input name="title" ../> is mapped into title field of a command. Therefore, you * should use the same name for input fields and command object fields. * * @author kevin * */ public class ArticleCommand { private Integer id; private String title; private String content; private String author; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public String getAuthor() { return author; } public void setAuthor(String author) { this.author = author; } }
UTF-8
Java
1,000
java
ArticleCommand.java
Java
[ { "context": "fields and command object fields.\r\n * \r\n * @author kevin\r\n *\r\n */\r\npublic class ArticleCommand {\r\n priv", "end": 335, "score": 0.9823183417320251, "start": 330, "tag": "USERNAME", "value": "kevin" } ]
null
[]
package example.web.spring.form.command; /** * Each field name of command object should have the same name as input tag name in a form. * For example, <input name="title" ../> is mapped into title field of a command. Therefore, you * should use the same name for input fields and command object fields. * * @author kevin * */ public class ArticleCommand { private Integer id; private String title; private String content; private String author; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public String getAuthor() { return author; } public void setAuthor(String author) { this.author = author; } }
1,000
0.635
0.635
42
21.809525
22.22958
97
false
false
0
0
0
0
0
0
0.857143
false
false
8
b6e9882d1fa42935942418f08afb0a3666ede582
21,440,476,749,693
ef45855c2bb0e4574a8f916a01ed1b97b51eb487
/app/src/main/java/com/excalibur/starnovel/adapter/WriteViewPagerAdapter.java
a691c62da177813f646681fc563104fa7420885b
[]
no_license
ArthurExcalibur/StarNovel
https://github.com/ArthurExcalibur/StarNovel
53ddfd7987bff126b2ce4d3d8eb3799c54fe2c13
2b889107592dd201cc8cb82f480e72218d1572d4
refs/heads/master
2020-06-20T00:50:29.708000
2017-02-08T01:25:19
2017-02-08T01:25:19
74,893,194
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.excalibur.starnovel.adapter; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import com.excalibur.starnovel.fragment.WritePublicFragment; /** * Created by Excalibur on 2017/1/13. * 原创界面ViewPager的Adapter */ public class WriteViewPagerAdapter extends FragmentPagerAdapter { private String[] titles = new String[]{"微文","连载","私密"}; public WriteViewPagerAdapter(FragmentManager fm) { super(fm); } @Override public Fragment getItem(int position) { return new WritePublicFragment(); } @Override public int getCount() { return 3; } @Override public CharSequence getPageTitle(int position) { return titles[position]; } }
UTF-8
Java
828
java
WriteViewPagerAdapter.java
Java
[ { "context": "l.fragment.WritePublicFragment;\n\n/**\n * Created by Excalibur on 2017/1/13.\n * 原创界面ViewPager的Adapter\n */\npublic", "end": 271, "score": 0.9996738433837891, "start": 262, "tag": "USERNAME", "value": "Excalibur" } ]
null
[]
package com.excalibur.starnovel.adapter; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import com.excalibur.starnovel.fragment.WritePublicFragment; /** * Created by Excalibur on 2017/1/13. * 原创界面ViewPager的Adapter */ public class WriteViewPagerAdapter extends FragmentPagerAdapter { private String[] titles = new String[]{"微文","连载","私密"}; public WriteViewPagerAdapter(FragmentManager fm) { super(fm); } @Override public Fragment getItem(int position) { return new WritePublicFragment(); } @Override public int getCount() { return 3; } @Override public CharSequence getPageTitle(int position) { return titles[position]; } }
828
0.704715
0.691067
35
22.028572
21.545282
65
false
false
0
0
0
0
0
0
0.342857
false
false
8
d1a50737de8370e7416eb1b781df2bad0bc4ab02
5,892,695,143,370
53d677a55e4ece8883526738f1c9d00fa6560ff7
/a/i/b/a/c/b/c/m.java
65a9b9e06666f6491485c6c515fdfaadcd51cbfe
[]
no_license
0jinxing/wechat-apk-source
https://github.com/0jinxing/wechat-apk-source
544c2d79bfc10261eb36389c1edfdf553d8f312a
f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d
refs/heads/master
2020-06-07T20:06:03.580000
2019-06-21T09:17:26
2019-06-21T09:17:26
193,069,132
9
4
null
null
null
null
null
null
null
null
null
null
null
null
null
package a.i.b.a.c.b.c; import a.i.b.a.c.b.y; import a.i.b.a.c.f.b; import com.tencent.matrix.trace.core.AppMethodBeat; public final class m extends x { public m(y paramy, b paramb) { super(paramy, paramb); AppMethodBeat.i(119434); AppMethodBeat.o(119434); } } /* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes6-dex2jar.jar * Qualified Name: a.i.b.a.c.b.c.m * JD-Core Version: 0.6.2 */
UTF-8
Java
484
java
m.java
Java
[]
null
[]
package a.i.b.a.c.b.c; import a.i.b.a.c.b.y; import a.i.b.a.c.f.b; import com.tencent.matrix.trace.core.AppMethodBeat; public final class m extends x { public m(y paramy, b paramb) { super(paramy, paramb); AppMethodBeat.i(119434); AppMethodBeat.o(119434); } } /* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes6-dex2jar.jar * Qualified Name: a.i.b.a.c.b.c.m * JD-Core Version: 0.6.2 */
484
0.628099
0.584711
20
22.299999
25.363556
112
false
false
0
0
0
0
0
0
0.45
false
false
8
f5922a650677e810f9543af33ee19e8868e3ebba
28,003,186,779,178
5631712ea9f2f16ceaed876ea85463449b14bd3b
/app/src/main/java/com/vmloft/develop/library/simple/VMAppApplication.java
a02fd9c3c798fe9371a77af307f522bf5f0488b9
[]
no_license
xuepeng123/VMLibraryManager
https://github.com/xuepeng123/VMLibraryManager
d129bad0878cae00ec3682fae9744802082dd465
e1fd732b9d4e1f2615a02b34b158f44aafbdd4bf
refs/heads/master
2021-01-16T19:23:50.448000
2017-07-07T10:47:46
2017-07-07T10:47:46
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.vmloft.develop.library.simple; import com.vmloft.develop.library.tools.VMApplication; /** * Created by lzan13 on 2017/7/7. * 程序入口 */ public class VMAppApplication extends VMApplication { }
UTF-8
Java
214
java
VMAppApplication.java
Java
[ { "context": "op.library.tools.VMApplication;\n\n/**\n * Created by lzan13 on 2017/7/7.\n * 程序入口\n */\npublic class VMAppApplic", "end": 124, "score": 0.9995405077934265, "start": 118, "tag": "USERNAME", "value": "lzan13" } ]
null
[]
package com.vmloft.develop.library.simple; import com.vmloft.develop.library.tools.VMApplication; /** * Created by lzan13 on 2017/7/7. * 程序入口 */ public class VMAppApplication extends VMApplication { }
214
0.762136
0.723301
10
19.6
21.918941
54
false
false
0
0
0
0
0
0
0.2
false
false
8
126ffabb601208bf722a796979514451d7283168
28,003,186,775,007
7151bfc5aa9e063c3afb8d33b3689834e41754e5
/hello-memory/src/com/ailhanli/ex/Customer.java
1207f7315ec5e7db2e9d17353e22359672ff38bf
[]
no_license
superdevelopertr/vpp-advance-java
https://github.com/superdevelopertr/vpp-advance-java
75da4128a4c74d979a0d99f0ba2ee140ed6081bb
3a56e691a17dac2933ffec9600f0ff4d4bcb6a3f
refs/heads/master
2021-05-08T10:16:09.475000
2018-02-18T15:00:50
2018-02-18T15:00:50
119,831,806
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.ailhanli.ex; public class Customer { public static int numberOfGcd=0; private int id; public Customer(int id) { this.id = id; } @Override protected void finalize() throws Throwable { System.out.println(id+" is GC'd"); numberOfGcd++; } }
UTF-8
Java
268
java
Customer.java
Java
[]
null
[]
package com.ailhanli.ex; public class Customer { public static int numberOfGcd=0; private int id; public Customer(int id) { this.id = id; } @Override protected void finalize() throws Throwable { System.out.println(id+" is GC'd"); numberOfGcd++; } }
268
0.682836
0.679105
18
13.888889
14.074757
45
false
false
0
0
0
0
0
0
1.111111
false
false
8
dd4e46fce70a2032987afb60ee085cc3e502e551
35,064,113,033,196
aaf13fe1e58fac5d742aca31a26d4af75a8ca9ab
/template-example/freemarker-example/src/main/java/io/github/biezhi/freemarker/HelloExample.java
33391bbbce3bd37421a995626b21ab1b6be182c8
[ "MIT" ]
permissive
BleethNie/Examples
https://github.com/BleethNie/Examples
b07ad90ef9cae9da68825a7a032b8db23da42e49
7b9a5fd681aedb5418044112702bf5bdcbbe8e26
refs/heads/master
2020-02-20T00:39:56.469000
2019-05-11T06:00:40
2019-05-11T06:00:40
126,494,226
10
0
MIT
false
2020-05-15T19:40:11
2018-03-23T14:10:18
2020-05-10T05:50:40
2020-05-15T19:40:09
3,837
10
0
2
Java
false
false
package io.github.biezhi.freemarker; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.OutputStreamWriter; import java.io.Writer; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import freemarker.template.Configuration; import freemarker.template.Template; import freemarker.template.TemplateException; /** * @author biezhi * @date 2018/1/16 */ public class HelloExample { public static void main(String[] args) { //Freemarker configuration object Configuration cfg = new Configuration(); try { String resDir = "template-example/freemarker-example/src/main/resources"; //Load template from source folder Template template = cfg.getTemplate(resDir + "/hello.ftl"); // Build the data-model Map<String, Object> data = new HashMap<>(); data.put("message", "你好,王爵nice!"); //List parsing List<String> countries = new ArrayList<>(); countries.add("印第安"); countries.add("美国"); countries.add("中国"); countries.add("法国"); data.put("countries", countries); // Console output Writer out = new OutputStreamWriter(System.out); template.process(data, out); out.flush(); // File output Writer file = new FileWriter (new File(resDir + "/FTL_helloworld.txt")); template.process(data, file); file.flush(); file.close(); } catch (IOException | TemplateException e) { e.printStackTrace(); } } }
UTF-8
Java
1,731
java
HelloExample.java
Java
[ { "context": "package io.github.biezhi.freemarker;\n\nimport java.io.File;\nimport java.io.", "end": 24, "score": 0.9964982271194458, "start": 18, "tag": "USERNAME", "value": "biezhi" }, { "context": "marker.template.TemplateException;\n\n/**\n * @author biezhi\n * @date 2018/1/16\n */\npublic class HelloExample ", "end": 419, "score": 0.9996569752693176, "start": 413, "tag": "USERNAME", "value": "biezhi" }, { "context": " HashMap<>();\n data.put(\"message\", \"你好,王爵nice!\");\n\n //List parsing\n List<", "end": 963, "score": 0.9819192886352539, "start": 957, "tag": "NAME", "value": "王爵nice" } ]
null
[]
package io.github.biezhi.freemarker; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.OutputStreamWriter; import java.io.Writer; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import freemarker.template.Configuration; import freemarker.template.Template; import freemarker.template.TemplateException; /** * @author biezhi * @date 2018/1/16 */ public class HelloExample { public static void main(String[] args) { //Freemarker configuration object Configuration cfg = new Configuration(); try { String resDir = "template-example/freemarker-example/src/main/resources"; //Load template from source folder Template template = cfg.getTemplate(resDir + "/hello.ftl"); // Build the data-model Map<String, Object> data = new HashMap<>(); data.put("message", "你好,王爵nice!"); //List parsing List<String> countries = new ArrayList<>(); countries.add("印第安"); countries.add("美国"); countries.add("中国"); countries.add("法国"); data.put("countries", countries); // Console output Writer out = new OutputStreamWriter(System.out); template.process(data, out); out.flush(); // File output Writer file = new FileWriter (new File(resDir + "/FTL_helloworld.txt")); template.process(data, file); file.flush(); file.close(); } catch (IOException | TemplateException e) { e.printStackTrace(); } } }
1,731
0.603641
0.59953
60
27.383333
20.950809
85
false
false
0
0
0
0
0
0
0.633333
false
false
8
4da20c56ddc16c43a59ba0e50c64afae3ab2c8cc
21,002,390,088,360
ee2f08866c4decfd9694d7a1fb9afcfd0fa50be3
/eIntra/java/jp/co/tafs/eIntra/eTex/CEtexInputCtlBean.java
b250e9392169039473edc91ed49449eacf57c2a2
[]
no_license
mochitomo/eIntra
https://github.com/mochitomo/eIntra
3f1e97742055b711bbd5bd3ddffc794dffacd080
fd87509ea79dea460cd42e73abebf6b6ab89f562
refs/heads/master
2016-08-03T15:33:37.896000
2013-02-09T05:45:03
2013-02-09T05:45:03
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * クラス名:CEtexInputCtlBean * * クラス概要:交通費精算入力CtlBeanクラス * * 日付・バージョン情報: 2006/xx/xx Ver1.00 * * 作成者:N.Chiyo (TAFS) */ package jp.co.tafs.eIntra.eTex; import java.util.*; import javax.servlet.http.*; import org.apache.struts.action.*; import org.apache.struts.validator.ValidatorForm; /** * <p>交通費精算入力CtlBeanクラス</p> * @author N.Chiyo (TAFS) * @version 1.00 */ public final class CEtexInputCtlBean extends ValidatorForm { /******************/ /* クラス変数定義 */ /******************/ /** 社員コード */ private String staffCode = ""; /** 社員名 */ private String staffName = ""; /** 権限 */ private String staffGrant = ""; /** 処理種別 */ private String operateKind = "0"; /** 対象年 */ private String targetYear = ""; /** 対象月 */ private String targetMonth = ""; /** 対象日 */ private String targetDate = ""; /** 曜日 */ private String weekDate = ""; /** Index No. */ private String indexNo = ""; /** 精算区分 */ private String adjustClass = ""; /** 訪問先 */ private String visitDestination = ""; /** 用件 */ private String businessContents = ""; /** 区間from */ private String sectionFrom = ""; /** 区間矢印 */ private String sectionArrow = ""; /** 区間to */ private String sectionTo = ""; /** 交通機関コード */ private String trafficCode = ""; /** 交通機関名称 */ private String trafficName = ""; /** 金額 */ private String amountOfMoney = ""; /** テンプレートNo. */ private String templateNo = ""; /** テンプレート名 */ private String templateName = ""; /** 合計金額 */ private String sumOfMoney = ""; /** 合計金額調整幅 */ private int sumOfMoneyAdjustWidth = 0; /** 交通費精算リスト */ private ArrayList list = null; /** テンプレートリスト */ private ArrayList templateList = null; /** カレンダーデータリスト */ private ArrayList calendarList = null; /** 交通機関データリスト */ private ArrayList trafficList = null; /** 社員データリスト */ private ArrayList membersList = null; /** ログイン者社員コード */ private String operatorCode = ""; /** ログイン者社員名 */ private String operatorName = ""; /** ログイン者権限 */ private String operatorGrant = ""; /** 編集中フラグ */ private String editFlag = "0"; /** 詳細フラグ */ private String detailFlag = "1"; /** メッセージ */ private String message = ""; /** メッセージカラー */ private String messageColor = "blue"; /** 対象年月締めフラグ */ private String closeFlag = "0"; /** 退職者も含むフラグ */ private boolean retirementViewFlag = false; /** 拡張機能 管理ユーザーの代理申請有効フラグ */ private boolean expProxyApplyFlag = false; /** 拡張機能 コピーアンドペースト有効フラグ */ private boolean expCopyAndPastFlag = false; /** 拡張機能 CSVエクスポート有効フラグ */ private boolean expExportCsvFlag = false; /** 拡張機能 簡易表示有効フラグ */ private boolean expSimpleIndicateFlag = false; /**********/ /* 値設定 */ /**********/ /** * <p>値設定 社員コード</p> * @param _staffCode 社員コード * @return なし */ public void setStaffCode(String _staffCode) { /* 社員コード */ this.staffCode = _staffCode; } /** * <p>値設定 社員名</p> * @param _staffName 社員名 * @return なし */ public void setStaffName(String _staffName) { /* 社員名 */ this.staffName = _staffName; } /** * <p>値設定 権限</p> * @param _staffGrant 権限 * @return なし */ public void setStaffGrant(String _staffGrant) { /* 権限 */ this.staffGrant = _staffGrant; } /** * <p>値設定 処理種別</p> * @param _operateKind 処理種別 * @return なし */ public void setOperateKind(String _operateKind) { /* 処理種別 */ this.operateKind = _operateKind; } /** * <p>値設定 対象年</p> * @param _targetYear 対象年 * @return なし */ public void setTargetYear(String _targetYear) { /* 対象年 */ this.targetYear = _targetYear; } /** * <p>値設定 対象月</p> * @param _targetMonth 対象月 * @return なし */ public void setTargetMonth(String _targetMonth) { /* 対象月 */ this.targetMonth = _targetMonth; } /** * <p>値設定 対象日</p> * @param _targetDate 対象日 * @return なし */ public void setTargetDate(String _targetDate) { /* 対象日 */ this.targetDate = _targetDate; } /** * <p>値設定 曜日</p> * @param _weekDate 曜日 * @return なし */ public void setWeekDate(String _weekDate) { /* 曜日 */ this.weekDate = _weekDate; } /** * <p>値設定 Index No.</p> * @param _indexNo Index No. * @return なし */ public void setIndexNo(String _indexNo) { /* Index No. */ this.indexNo = _indexNo; } /** * <p>値設定 精算区分</p> * @param _adjustClass 精算区分 * @return なし */ public void setAdjustClass(String _adjustClass) { /* 精算区分 */ this.adjustClass = _adjustClass; } /** * <p>値設定 訪問先</p> * @param _visitDestination 訪問先 * @return なし */ public void setVisitDestination(String _visitDestination) { /* 訪問先 */ this.visitDestination = _visitDestination; } /** * <p>値設定 用件</p> * @param _businessContents 用件 * @return なし */ public void setBusinessContents(String _businessContents) { /* 用件 */ this.businessContents = _businessContents; } /** * <p>値設定 区間from</p> * @param _sectionFrom 区間from * @return なし */ public void setSectionFrom(String _sectionFrom) { /* 区間from */ this.sectionFrom = _sectionFrom; } /** * <p>値設定 区間矢印</p> * @param _sectionArrow 区間矢印 * @return なし */ public void setSectionArrow(String _sectionArrow) { /* 区間矢印 */ this.sectionArrow = _sectionArrow; } /** * <p>値設定 区間to</p> * @param _sectionTo 区間to * @return なし */ public void setSectionTo(String _sectionTo) { /* 区間to */ this.sectionTo = _sectionTo; } /** * <p>値設定 交通機関コード</p> * @param _trafficCode 交通機関コード * @return なし */ public void setTrafficCode(String _trafficCode) { /* 交通機関コード */ this.trafficCode = _trafficCode; } /** * <p>値設定 交通機関名称</p> * @param _trafficName 交通機関名称 * @return なし */ public void setTrafficName(String _trafficName) { /* 交通機関名称 */ this.trafficName = _trafficName; } /** * <p>値設定 金額</p> * @param _amountOfMoney 金額 * @return なし */ public void setAmountOfMoney(String _amountOfMoney) { /* 金額 */ this.amountOfMoney = _amountOfMoney; } /** * <p>値設定 テンプレートNo.</p> * @param _templateNo テンプレートNo. * @return なし */ public void setTemplateNo(String _templateNo) { /* テンプレートNo. */ this.templateNo = _templateNo; } /** * <p>値設定 テンプレート名</p> * @param _templateName テンプレート名 * @return なし */ public void setTemplateName(String _templateName) { /* テンプレート名 */ this.templateName = _templateName; } /** * <p>値設定 合計金額</p> * @param _sumOfMoney 合計金額 * @return なし */ public void setSumOfMoney(String _sumOfMoney) { /* 合計金額 */ this.sumOfMoney = _sumOfMoney; } /** * <p>値設定 合計金額調整幅</p> * @param _sumOfMoneyAdjustWidth 合計金額調整幅 * @return なし */ public void setSumOfMoneyAdjustWidth(int _sumOfMoneyAdjustWidth) { /* 合計金額調整幅 */ this.sumOfMoneyAdjustWidth = _sumOfMoneyAdjustWidth; } /** * <p>値設定 交通費精算リスト</p> * @param _list 交通費精算リスト * @return なし */ public void setList(ArrayList _list) { /* 交通費精算リスト */ this.list = _list; } /** * <p>値設定 テンプレートリスト</p> * @param _templateList テンプレートリスト * @return なし */ public void setTemplateList(ArrayList _templateList) { /* テンプレートリスト */ this.templateList = _templateList; } /** * <p>値設定 カレンダーデータリスト</p> * @param _calendarList カレンダーデータリスト * @return なし */ public void setCalendarList(ArrayList _calendarList) { /* カレンダーデータリスト */ this.calendarList = _calendarList; } /** * <p>値設定 交通機関データリスト</p> * @param _trafficList 交通機関データリスト * @return なし */ public void setTrafficList(ArrayList _trafficList) { /* 交通機関データリスト */ this.trafficList = _trafficList; } /** * <p>値設定 社員データリスト</p> * @param _membersList 社員データリスト * @return なし */ public void setMembersList(ArrayList _membersList) { /* 社員データリスト */ this.membersList = _membersList; } /** * <p>値設定 ログイン者社員コード</p> * @param _operatorCode ログイン者社員コード * @return なし */ public void setOperatorCode(String _operatorCode) { /* ログイン者社員コード */ this.operatorCode = _operatorCode; } /** * <p>値設定 ログイン者社員名</p> * @param _operatorName ログイン者社員名 * @return なし */ public void setOperatorName(String _operatorName) { /* ログイン者社員名 */ this.operatorName = _operatorName; } /** * <p>値設定 ログイン者権限</p> * @param _operatorGrant ログイン者権限 * @return なし */ public void setOperatorGrant(String _operatorGrant) { /* ログイン者権限 */ this.operatorGrant = _operatorGrant; } /** * <p>値設定 編集中フラグ</p> * @param _editFlag 編集中フラグ * @return なし */ public void setEditFlag(String _editFlag) { /* 編集中フラグ */ this.editFlag = _editFlag; } /** * <p>値設定 詳細フラグ</p> * @param _detailFlag 詳細フラグ * @return なし */ public void setDetailFlag(String _detailFlag) { /* 詳細フラグ */ this.detailFlag = _detailFlag; } /** * <p>値設定 メッセージ</p> * @param _message メッセージ * @return なし */ public void setMessage(String _message) { /* メッセージ */ this.message = _message; } /** * <p>値設定 メッセージカラー</p> * @param _messageColor メッセージカラー * @return なし */ public void setMessageColor(String _messageColor) { /* メッセージカラー */ this.messageColor = _messageColor; } /** * <p>値設定 対象年月締めフラグ</p> * @param _closeFlag 対象年月締めフラグ * @return なし */ public void setCloseFlag(String _closeFlag) { /* 対象年月締めフラグ */ this.closeFlag = _closeFlag; } /** * <p>値設定 退職者も含むフラグ</p> * @param _retirementViewFlag 退職者も含むフラグ * @return なし */ public void setRetirementViewFlag(boolean _retirementViewFlag) { /* 退職者も含むフラグ */ this.retirementViewFlag = _retirementViewFlag; } /** * <p>値設定 拡張機能 管理ユーザーの代理申請有効フラグ</p> * @param _expProxyApplyFlag 拡張機能 管理ユーザーの代理申請有効フラグ * @return なし */ public void setExpProxyApplyFlag(boolean _expProxyApplyFlag) { /* 拡張機能 管理ユーザーの代理申請有効フラグ */ this.expProxyApplyFlag = _expProxyApplyFlag; } /** * <p>値設定 拡張機能 コピーアンドペースト有効フラグ</p> * @param _expCopyAndPastFlag 拡張機能 コピーアンドペースト有効フラグ * @return なし */ public void setExpCopyAndPastFlag(boolean _expCopyAndPastFlag) { /* 拡張機能 コピーアンドペースト有効フラグ */ this.expCopyAndPastFlag = _expCopyAndPastFlag; } /** * <p>値設定 拡張機能 CSVエクスポート有効フラグ</p> * @param _expExportCsvFlag 拡張機能 CSVエクスポート有効フラグ * @return なし */ public void setExpExportCsvFlag(boolean _expExportCsvFlag) { /* 拡張機能 CSVエクスポート有効フラグ */ this.expExportCsvFlag = _expExportCsvFlag; } /** * <p>値設定 拡張機能 簡易表示有効フラグ</p> * @param _expSimpleIndicateFlag 拡張機能 簡易表示有効フラグ * @return なし */ public void setExpSimpleIndicateFlag(boolean _expSimpleIndicateFlag) { /* 拡張機能 簡易表示有効フラグ */ this.expSimpleIndicateFlag = _expSimpleIndicateFlag; } /**********/ /* 値取得 */ /**********/ /** * <p>値取得 社員コード</p> * @param なし * @return 社員コード */ public String getStaffCode() { /* 社員コード */ return this.staffCode; } /** * <p>値取得 社員名</p> * @param なし * @return 社員名 */ public String getStaffName() { /* 社員名 */ return this.staffName; } /** * <p>値取得 権限</p> * @param なし * @return 権限 */ public String getStaffGrant() { /* 権限 */ return this.staffGrant; } /** * <p>値取得 処理種別</p> * @param なし * @return 処理種別 */ public String getOperateKind() { /* 処理種別 */ return this.operateKind; } /** * <p>値取得 対象年</p> * @param なし * @return 対象年 */ public String getTargetYear() { /* 対象年 */ return this.targetYear; } /** * <p>値取得 対象月</p> * @param なし * @return 対象月 */ public String getTargetMonth() { /* 対象月 */ return this.targetMonth; } /** * <p>値取得 対象日</p> * @param なし * @return 対象日 */ public String getTargetDate() { /* 対象日 */ return this.targetDate; } /** * <p>値取得 曜日</p> * @param なし * @return 曜日 */ public String getWeekDate() { /* 曜日 */ return this.weekDate; } /** * <p>値取得 Index No.</p> * @param なし * @return Index No. */ public String getIndexNo() { /* Index No. */ return this.indexNo; } /** * <p>値取得 精算区分</p> * @param なし * @return 精算区分 */ public String getAdjustClass() { /* 精算区分 */ return this.adjustClass; } /** * <p>値取得 訪問先</p> * @param なし * @return 訪問先 */ public String getVisitDestination() { /* 訪問先 */ return this.visitDestination; } /** * <p>値取得 用件</p> * @param なし * @return 用件 */ public String getBusinessContents() { /* 用件 */ return this.businessContents; } /** * <p>値取得 区間from</p> * @param なし * @return 区間from */ public String getSectionFrom() { /* 区間from */ return this.sectionFrom; } /** * <p>値取得 区間矢印</p> * @param なし * @return 区間矢印 */ public String getSectionArrow() { /* 区間矢印 */ return this.sectionArrow; } /** * <p>値取得 区間to</p> * @param なし * @return 区間to */ public String getSectionTo() { /* 区間to */ return this.sectionTo; } /** * <p>値取得 交通機関コード</p> * @param なし * @return 交通機関コード */ public String getTrafficCode() { /* 交通機関コード */ return this.trafficCode; } /** * <p>値取得 交通機関名称</p> * @param なし * @return 交通機関名称 */ public String getTrafficName() { /* 交通機関名称 */ return this.trafficName; } /** * <p>値取得 金額</p> * @param なし * @return 金額 */ public String getAmountOfMoney() { /* 金額 */ return this.amountOfMoney; } /** * <p>値取得 テンプレートNo.</p> * @param なし * @return テンプレートNo. */ public String getTemplateNo() { /* テンプレートNo. */ return this.templateNo; } /** * <p>値取得 テンプレート名</p> * @param なし * @return テンプレート名 */ public String getTemplateName() { /* テンプレート名 */ return this.templateName; } /** * <p>値取得 合計金額</p> * @param なし * @return 合計金額 */ public String getSumOfMoney() { /* 合計金額 */ return this.sumOfMoney; } /** * <p>値取得 合計金額調整幅</p> * @param なし * @return 合計金額調整幅 */ public int getSumOfMoneyAdjustWidth() { /* 合計金額調整幅 */ return this.sumOfMoneyAdjustWidth; } /** * <p>値取得 交通費精算リスト</p> * @param なし * @return 交通費精算リスト */ public ArrayList getList() { /* 交通費精算リスト */ return this.list; } /** * <p>値取得 テンプレートリスト</p> * @param なし * @return テンプレートリスト */ public ArrayList getTemplateList() { /* テンプレートリスト */ return this.templateList; } /** * <p>値取得 カレンダーデータリスト</p> * @param なし * @return カレンダーデータリスト */ public ArrayList getCalendarList() { /* カレンダーデータリスト */ return this.calendarList; } /** * <p>値取得 交通機関データリスト</p> * @param なし * @return 交通機関データリスト */ public ArrayList getTrafficList() { /* 交通機関データリスト */ return this.trafficList; } /** * <p>値取得 社員データリスト</p> * @param なし * @return 社員データリスト */ public ArrayList getMembersList() { /* 社員データリスト */ return this.membersList; } /** * <p>値取得 ログイン者社員コード</p> * @param なし * @return ログイン者社員コード */ public String getOperatorCode() { /* ログイン者社員コード */ return this.operatorCode; } /** * <p>値取得 ログイン者社員名</p> * @param なし * @return ログイン者社員名 */ public String getOperatorName() { /* ログイン者社員名 */ return this.operatorName; } /** * <p>値取得 ログイン者権限</p> * @param なし * @return ログイン者権限 */ public String getOperatorGrant() { /* ログイン者権限 */ return this.operatorGrant; } /** * <p>値取得 編集中フラグ</p> * @param なし * @return 編集中フラグ */ public String getEditFlag() { /* 編集中フラグ */ return this.editFlag; } /** * <p>値取得 詳細フラグ</p> * @param なし * @return 詳細フラグ */ public String getDetailFlag() { /* 詳細フラグ */ return this.detailFlag; } /** * <p>値取得 メッセージ</p> * @param なし * @return メッセージ */ public String getMessage() { /* メッセージ */ return this.message; } /** * <p>値取得 メッセージカラー</p> * @param なし * @return メッセージカラー */ public String getMessageColor() { /* メッセージカラー */ return this.messageColor; } /** * <p>値取得 対象年月締めフラグ</p> * @param なし * @return 対象年月締めフラグ */ public String getCloseFlag() { /* 対象年月締めフラグ */ return this.closeFlag; } /** * <p>値取得 退職者も含むフラグ</p> * @param なし * @return 退職者も含むフラグ */ public boolean getRetirementViewFlag() { /* 退職者も含むフラグ */ return this.retirementViewFlag; } /** * <p>値取得 拡張機能 管理ユーザーの代理申請有効フラグ</p> * @param なし * @return 拡張機能 管理ユーザーの代理申請有効フラグ */ public boolean getExpProxyApplyFlag() { /* 拡張機能 管理ユーザーの代理申請有効フラグ */ return this.expProxyApplyFlag; } /** * <p>値取得 拡張機能 コピーアンドペースト有効フラグ</p> * @param なし * @return 拡張機能 コピーアンドペースト有効フラグ */ public boolean getExpCopyAndPastFlag() { /* 拡張機能 コピーアンドペースト有効フラグ */ return this.expCopyAndPastFlag; } /** * <p>値取得 拡張機能 CSVエクスポート有効フラグ</p> * @param なし * @return 拡張機能 CSVエクスポート有効フラグ */ public boolean getExpExportCsvFlag() { /* 拡張機能 CSVエクスポート有効フラグ */ return this.expExportCsvFlag; } /** * <p>値取得 拡張機能 簡易表示有効フラグ</p> * @param なし * @return 拡張機能 簡易表示有効フラグ */ public boolean getExpSimpleIndicateFlag() { /* 拡張機能 簡易表示有効フラグ */ return this.expSimpleIndicateFlag; } /*********/ /* reset */ /*********/ /** * <p>CEtexInputCtlBeanリセットメソッド</p> * @param map マッピング情報 * @param req リクエスト情報 * @return なし */ public void reset(ActionMapping map, HttpServletRequest req) { /* 処理種別 */ this.operateKind = "0"; /* 退職者も含むフラグ */ this.retirementViewFlag = false; } }/* ←END class CEtexInputCtlBean */
EUC-JP
Java
22,292
java
CEtexInputCtlBean.java
Java
[ { "context": "ス\n *\n * 日付・バージョン情報: 2006/xx/xx Ver1.00\n * \n * 作成者:N.Chiyo (TAFS)\n*/\npackage jp.co.tafs.eIntra.eTex;\n\nimport", "end": 115, "score": 0.9959202408790588, "start": 108, "tag": "NAME", "value": "N.Chiyo" }, { "context": "Form;\n\n\n/**\n * <p>交通費精算入力CtlBeanクラス</p>\n * @author N.Chiyo (TAFS)\n * @version 1.00\n */\npublic final class CE", "end": 345, "score": 0.9969381093978882, "start": 338, "tag": "NAME", "value": "N.Chiyo" } ]
null
[]
/* * クラス名:CEtexInputCtlBean * * クラス概要:交通費精算入力CtlBeanクラス * * 日付・バージョン情報: 2006/xx/xx Ver1.00 * * 作成者:N.Chiyo (TAFS) */ package jp.co.tafs.eIntra.eTex; import java.util.*; import javax.servlet.http.*; import org.apache.struts.action.*; import org.apache.struts.validator.ValidatorForm; /** * <p>交通費精算入力CtlBeanクラス</p> * @author N.Chiyo (TAFS) * @version 1.00 */ public final class CEtexInputCtlBean extends ValidatorForm { /******************/ /* クラス変数定義 */ /******************/ /** 社員コード */ private String staffCode = ""; /** 社員名 */ private String staffName = ""; /** 権限 */ private String staffGrant = ""; /** 処理種別 */ private String operateKind = "0"; /** 対象年 */ private String targetYear = ""; /** 対象月 */ private String targetMonth = ""; /** 対象日 */ private String targetDate = ""; /** 曜日 */ private String weekDate = ""; /** Index No. */ private String indexNo = ""; /** 精算区分 */ private String adjustClass = ""; /** 訪問先 */ private String visitDestination = ""; /** 用件 */ private String businessContents = ""; /** 区間from */ private String sectionFrom = ""; /** 区間矢印 */ private String sectionArrow = ""; /** 区間to */ private String sectionTo = ""; /** 交通機関コード */ private String trafficCode = ""; /** 交通機関名称 */ private String trafficName = ""; /** 金額 */ private String amountOfMoney = ""; /** テンプレートNo. */ private String templateNo = ""; /** テンプレート名 */ private String templateName = ""; /** 合計金額 */ private String sumOfMoney = ""; /** 合計金額調整幅 */ private int sumOfMoneyAdjustWidth = 0; /** 交通費精算リスト */ private ArrayList list = null; /** テンプレートリスト */ private ArrayList templateList = null; /** カレンダーデータリスト */ private ArrayList calendarList = null; /** 交通機関データリスト */ private ArrayList trafficList = null; /** 社員データリスト */ private ArrayList membersList = null; /** ログイン者社員コード */ private String operatorCode = ""; /** ログイン者社員名 */ private String operatorName = ""; /** ログイン者権限 */ private String operatorGrant = ""; /** 編集中フラグ */ private String editFlag = "0"; /** 詳細フラグ */ private String detailFlag = "1"; /** メッセージ */ private String message = ""; /** メッセージカラー */ private String messageColor = "blue"; /** 対象年月締めフラグ */ private String closeFlag = "0"; /** 退職者も含むフラグ */ private boolean retirementViewFlag = false; /** 拡張機能 管理ユーザーの代理申請有効フラグ */ private boolean expProxyApplyFlag = false; /** 拡張機能 コピーアンドペースト有効フラグ */ private boolean expCopyAndPastFlag = false; /** 拡張機能 CSVエクスポート有効フラグ */ private boolean expExportCsvFlag = false; /** 拡張機能 簡易表示有効フラグ */ private boolean expSimpleIndicateFlag = false; /**********/ /* 値設定 */ /**********/ /** * <p>値設定 社員コード</p> * @param _staffCode 社員コード * @return なし */ public void setStaffCode(String _staffCode) { /* 社員コード */ this.staffCode = _staffCode; } /** * <p>値設定 社員名</p> * @param _staffName 社員名 * @return なし */ public void setStaffName(String _staffName) { /* 社員名 */ this.staffName = _staffName; } /** * <p>値設定 権限</p> * @param _staffGrant 権限 * @return なし */ public void setStaffGrant(String _staffGrant) { /* 権限 */ this.staffGrant = _staffGrant; } /** * <p>値設定 処理種別</p> * @param _operateKind 処理種別 * @return なし */ public void setOperateKind(String _operateKind) { /* 処理種別 */ this.operateKind = _operateKind; } /** * <p>値設定 対象年</p> * @param _targetYear 対象年 * @return なし */ public void setTargetYear(String _targetYear) { /* 対象年 */ this.targetYear = _targetYear; } /** * <p>値設定 対象月</p> * @param _targetMonth 対象月 * @return なし */ public void setTargetMonth(String _targetMonth) { /* 対象月 */ this.targetMonth = _targetMonth; } /** * <p>値設定 対象日</p> * @param _targetDate 対象日 * @return なし */ public void setTargetDate(String _targetDate) { /* 対象日 */ this.targetDate = _targetDate; } /** * <p>値設定 曜日</p> * @param _weekDate 曜日 * @return なし */ public void setWeekDate(String _weekDate) { /* 曜日 */ this.weekDate = _weekDate; } /** * <p>値設定 Index No.</p> * @param _indexNo Index No. * @return なし */ public void setIndexNo(String _indexNo) { /* Index No. */ this.indexNo = _indexNo; } /** * <p>値設定 精算区分</p> * @param _adjustClass 精算区分 * @return なし */ public void setAdjustClass(String _adjustClass) { /* 精算区分 */ this.adjustClass = _adjustClass; } /** * <p>値設定 訪問先</p> * @param _visitDestination 訪問先 * @return なし */ public void setVisitDestination(String _visitDestination) { /* 訪問先 */ this.visitDestination = _visitDestination; } /** * <p>値設定 用件</p> * @param _businessContents 用件 * @return なし */ public void setBusinessContents(String _businessContents) { /* 用件 */ this.businessContents = _businessContents; } /** * <p>値設定 区間from</p> * @param _sectionFrom 区間from * @return なし */ public void setSectionFrom(String _sectionFrom) { /* 区間from */ this.sectionFrom = _sectionFrom; } /** * <p>値設定 区間矢印</p> * @param _sectionArrow 区間矢印 * @return なし */ public void setSectionArrow(String _sectionArrow) { /* 区間矢印 */ this.sectionArrow = _sectionArrow; } /** * <p>値設定 区間to</p> * @param _sectionTo 区間to * @return なし */ public void setSectionTo(String _sectionTo) { /* 区間to */ this.sectionTo = _sectionTo; } /** * <p>値設定 交通機関コード</p> * @param _trafficCode 交通機関コード * @return なし */ public void setTrafficCode(String _trafficCode) { /* 交通機関コード */ this.trafficCode = _trafficCode; } /** * <p>値設定 交通機関名称</p> * @param _trafficName 交通機関名称 * @return なし */ public void setTrafficName(String _trafficName) { /* 交通機関名称 */ this.trafficName = _trafficName; } /** * <p>値設定 金額</p> * @param _amountOfMoney 金額 * @return なし */ public void setAmountOfMoney(String _amountOfMoney) { /* 金額 */ this.amountOfMoney = _amountOfMoney; } /** * <p>値設定 テンプレートNo.</p> * @param _templateNo テンプレートNo. * @return なし */ public void setTemplateNo(String _templateNo) { /* テンプレートNo. */ this.templateNo = _templateNo; } /** * <p>値設定 テンプレート名</p> * @param _templateName テンプレート名 * @return なし */ public void setTemplateName(String _templateName) { /* テンプレート名 */ this.templateName = _templateName; } /** * <p>値設定 合計金額</p> * @param _sumOfMoney 合計金額 * @return なし */ public void setSumOfMoney(String _sumOfMoney) { /* 合計金額 */ this.sumOfMoney = _sumOfMoney; } /** * <p>値設定 合計金額調整幅</p> * @param _sumOfMoneyAdjustWidth 合計金額調整幅 * @return なし */ public void setSumOfMoneyAdjustWidth(int _sumOfMoneyAdjustWidth) { /* 合計金額調整幅 */ this.sumOfMoneyAdjustWidth = _sumOfMoneyAdjustWidth; } /** * <p>値設定 交通費精算リスト</p> * @param _list 交通費精算リスト * @return なし */ public void setList(ArrayList _list) { /* 交通費精算リスト */ this.list = _list; } /** * <p>値設定 テンプレートリスト</p> * @param _templateList テンプレートリスト * @return なし */ public void setTemplateList(ArrayList _templateList) { /* テンプレートリスト */ this.templateList = _templateList; } /** * <p>値設定 カレンダーデータリスト</p> * @param _calendarList カレンダーデータリスト * @return なし */ public void setCalendarList(ArrayList _calendarList) { /* カレンダーデータリスト */ this.calendarList = _calendarList; } /** * <p>値設定 交通機関データリスト</p> * @param _trafficList 交通機関データリスト * @return なし */ public void setTrafficList(ArrayList _trafficList) { /* 交通機関データリスト */ this.trafficList = _trafficList; } /** * <p>値設定 社員データリスト</p> * @param _membersList 社員データリスト * @return なし */ public void setMembersList(ArrayList _membersList) { /* 社員データリスト */ this.membersList = _membersList; } /** * <p>値設定 ログイン者社員コード</p> * @param _operatorCode ログイン者社員コード * @return なし */ public void setOperatorCode(String _operatorCode) { /* ログイン者社員コード */ this.operatorCode = _operatorCode; } /** * <p>値設定 ログイン者社員名</p> * @param _operatorName ログイン者社員名 * @return なし */ public void setOperatorName(String _operatorName) { /* ログイン者社員名 */ this.operatorName = _operatorName; } /** * <p>値設定 ログイン者権限</p> * @param _operatorGrant ログイン者権限 * @return なし */ public void setOperatorGrant(String _operatorGrant) { /* ログイン者権限 */ this.operatorGrant = _operatorGrant; } /** * <p>値設定 編集中フラグ</p> * @param _editFlag 編集中フラグ * @return なし */ public void setEditFlag(String _editFlag) { /* 編集中フラグ */ this.editFlag = _editFlag; } /** * <p>値設定 詳細フラグ</p> * @param _detailFlag 詳細フラグ * @return なし */ public void setDetailFlag(String _detailFlag) { /* 詳細フラグ */ this.detailFlag = _detailFlag; } /** * <p>値設定 メッセージ</p> * @param _message メッセージ * @return なし */ public void setMessage(String _message) { /* メッセージ */ this.message = _message; } /** * <p>値設定 メッセージカラー</p> * @param _messageColor メッセージカラー * @return なし */ public void setMessageColor(String _messageColor) { /* メッセージカラー */ this.messageColor = _messageColor; } /** * <p>値設定 対象年月締めフラグ</p> * @param _closeFlag 対象年月締めフラグ * @return なし */ public void setCloseFlag(String _closeFlag) { /* 対象年月締めフラグ */ this.closeFlag = _closeFlag; } /** * <p>値設定 退職者も含むフラグ</p> * @param _retirementViewFlag 退職者も含むフラグ * @return なし */ public void setRetirementViewFlag(boolean _retirementViewFlag) { /* 退職者も含むフラグ */ this.retirementViewFlag = _retirementViewFlag; } /** * <p>値設定 拡張機能 管理ユーザーの代理申請有効フラグ</p> * @param _expProxyApplyFlag 拡張機能 管理ユーザーの代理申請有効フラグ * @return なし */ public void setExpProxyApplyFlag(boolean _expProxyApplyFlag) { /* 拡張機能 管理ユーザーの代理申請有効フラグ */ this.expProxyApplyFlag = _expProxyApplyFlag; } /** * <p>値設定 拡張機能 コピーアンドペースト有効フラグ</p> * @param _expCopyAndPastFlag 拡張機能 コピーアンドペースト有効フラグ * @return なし */ public void setExpCopyAndPastFlag(boolean _expCopyAndPastFlag) { /* 拡張機能 コピーアンドペースト有効フラグ */ this.expCopyAndPastFlag = _expCopyAndPastFlag; } /** * <p>値設定 拡張機能 CSVエクスポート有効フラグ</p> * @param _expExportCsvFlag 拡張機能 CSVエクスポート有効フラグ * @return なし */ public void setExpExportCsvFlag(boolean _expExportCsvFlag) { /* 拡張機能 CSVエクスポート有効フラグ */ this.expExportCsvFlag = _expExportCsvFlag; } /** * <p>値設定 拡張機能 簡易表示有効フラグ</p> * @param _expSimpleIndicateFlag 拡張機能 簡易表示有効フラグ * @return なし */ public void setExpSimpleIndicateFlag(boolean _expSimpleIndicateFlag) { /* 拡張機能 簡易表示有効フラグ */ this.expSimpleIndicateFlag = _expSimpleIndicateFlag; } /**********/ /* 値取得 */ /**********/ /** * <p>値取得 社員コード</p> * @param なし * @return 社員コード */ public String getStaffCode() { /* 社員コード */ return this.staffCode; } /** * <p>値取得 社員名</p> * @param なし * @return 社員名 */ public String getStaffName() { /* 社員名 */ return this.staffName; } /** * <p>値取得 権限</p> * @param なし * @return 権限 */ public String getStaffGrant() { /* 権限 */ return this.staffGrant; } /** * <p>値取得 処理種別</p> * @param なし * @return 処理種別 */ public String getOperateKind() { /* 処理種別 */ return this.operateKind; } /** * <p>値取得 対象年</p> * @param なし * @return 対象年 */ public String getTargetYear() { /* 対象年 */ return this.targetYear; } /** * <p>値取得 対象月</p> * @param なし * @return 対象月 */ public String getTargetMonth() { /* 対象月 */ return this.targetMonth; } /** * <p>値取得 対象日</p> * @param なし * @return 対象日 */ public String getTargetDate() { /* 対象日 */ return this.targetDate; } /** * <p>値取得 曜日</p> * @param なし * @return 曜日 */ public String getWeekDate() { /* 曜日 */ return this.weekDate; } /** * <p>値取得 Index No.</p> * @param なし * @return Index No. */ public String getIndexNo() { /* Index No. */ return this.indexNo; } /** * <p>値取得 精算区分</p> * @param なし * @return 精算区分 */ public String getAdjustClass() { /* 精算区分 */ return this.adjustClass; } /** * <p>値取得 訪問先</p> * @param なし * @return 訪問先 */ public String getVisitDestination() { /* 訪問先 */ return this.visitDestination; } /** * <p>値取得 用件</p> * @param なし * @return 用件 */ public String getBusinessContents() { /* 用件 */ return this.businessContents; } /** * <p>値取得 区間from</p> * @param なし * @return 区間from */ public String getSectionFrom() { /* 区間from */ return this.sectionFrom; } /** * <p>値取得 区間矢印</p> * @param なし * @return 区間矢印 */ public String getSectionArrow() { /* 区間矢印 */ return this.sectionArrow; } /** * <p>値取得 区間to</p> * @param なし * @return 区間to */ public String getSectionTo() { /* 区間to */ return this.sectionTo; } /** * <p>値取得 交通機関コード</p> * @param なし * @return 交通機関コード */ public String getTrafficCode() { /* 交通機関コード */ return this.trafficCode; } /** * <p>値取得 交通機関名称</p> * @param なし * @return 交通機関名称 */ public String getTrafficName() { /* 交通機関名称 */ return this.trafficName; } /** * <p>値取得 金額</p> * @param なし * @return 金額 */ public String getAmountOfMoney() { /* 金額 */ return this.amountOfMoney; } /** * <p>値取得 テンプレートNo.</p> * @param なし * @return テンプレートNo. */ public String getTemplateNo() { /* テンプレートNo. */ return this.templateNo; } /** * <p>値取得 テンプレート名</p> * @param なし * @return テンプレート名 */ public String getTemplateName() { /* テンプレート名 */ return this.templateName; } /** * <p>値取得 合計金額</p> * @param なし * @return 合計金額 */ public String getSumOfMoney() { /* 合計金額 */ return this.sumOfMoney; } /** * <p>値取得 合計金額調整幅</p> * @param なし * @return 合計金額調整幅 */ public int getSumOfMoneyAdjustWidth() { /* 合計金額調整幅 */ return this.sumOfMoneyAdjustWidth; } /** * <p>値取得 交通費精算リスト</p> * @param なし * @return 交通費精算リスト */ public ArrayList getList() { /* 交通費精算リスト */ return this.list; } /** * <p>値取得 テンプレートリスト</p> * @param なし * @return テンプレートリスト */ public ArrayList getTemplateList() { /* テンプレートリスト */ return this.templateList; } /** * <p>値取得 カレンダーデータリスト</p> * @param なし * @return カレンダーデータリスト */ public ArrayList getCalendarList() { /* カレンダーデータリスト */ return this.calendarList; } /** * <p>値取得 交通機関データリスト</p> * @param なし * @return 交通機関データリスト */ public ArrayList getTrafficList() { /* 交通機関データリスト */ return this.trafficList; } /** * <p>値取得 社員データリスト</p> * @param なし * @return 社員データリスト */ public ArrayList getMembersList() { /* 社員データリスト */ return this.membersList; } /** * <p>値取得 ログイン者社員コード</p> * @param なし * @return ログイン者社員コード */ public String getOperatorCode() { /* ログイン者社員コード */ return this.operatorCode; } /** * <p>値取得 ログイン者社員名</p> * @param なし * @return ログイン者社員名 */ public String getOperatorName() { /* ログイン者社員名 */ return this.operatorName; } /** * <p>値取得 ログイン者権限</p> * @param なし * @return ログイン者権限 */ public String getOperatorGrant() { /* ログイン者権限 */ return this.operatorGrant; } /** * <p>値取得 編集中フラグ</p> * @param なし * @return 編集中フラグ */ public String getEditFlag() { /* 編集中フラグ */ return this.editFlag; } /** * <p>値取得 詳細フラグ</p> * @param なし * @return 詳細フラグ */ public String getDetailFlag() { /* 詳細フラグ */ return this.detailFlag; } /** * <p>値取得 メッセージ</p> * @param なし * @return メッセージ */ public String getMessage() { /* メッセージ */ return this.message; } /** * <p>値取得 メッセージカラー</p> * @param なし * @return メッセージカラー */ public String getMessageColor() { /* メッセージカラー */ return this.messageColor; } /** * <p>値取得 対象年月締めフラグ</p> * @param なし * @return 対象年月締めフラグ */ public String getCloseFlag() { /* 対象年月締めフラグ */ return this.closeFlag; } /** * <p>値取得 退職者も含むフラグ</p> * @param なし * @return 退職者も含むフラグ */ public boolean getRetirementViewFlag() { /* 退職者も含むフラグ */ return this.retirementViewFlag; } /** * <p>値取得 拡張機能 管理ユーザーの代理申請有効フラグ</p> * @param なし * @return 拡張機能 管理ユーザーの代理申請有効フラグ */ public boolean getExpProxyApplyFlag() { /* 拡張機能 管理ユーザーの代理申請有効フラグ */ return this.expProxyApplyFlag; } /** * <p>値取得 拡張機能 コピーアンドペースト有効フラグ</p> * @param なし * @return 拡張機能 コピーアンドペースト有効フラグ */ public boolean getExpCopyAndPastFlag() { /* 拡張機能 コピーアンドペースト有効フラグ */ return this.expCopyAndPastFlag; } /** * <p>値取得 拡張機能 CSVエクスポート有効フラグ</p> * @param なし * @return 拡張機能 CSVエクスポート有効フラグ */ public boolean getExpExportCsvFlag() { /* 拡張機能 CSVエクスポート有効フラグ */ return this.expExportCsvFlag; } /** * <p>値取得 拡張機能 簡易表示有効フラグ</p> * @param なし * @return 拡張機能 簡易表示有効フラグ */ public boolean getExpSimpleIndicateFlag() { /* 拡張機能 簡易表示有効フラグ */ return this.expSimpleIndicateFlag; } /*********/ /* reset */ /*********/ /** * <p>CEtexInputCtlBeanリセットメソッド</p> * @param map マッピング情報 * @param req リクエスト情報 * @return なし */ public void reset(ActionMapping map, HttpServletRequest req) { /* 処理種別 */ this.operateKind = "0"; /* 退職者も含むフラグ */ this.retirementViewFlag = false; } }/* ←END class CEtexInputCtlBean */
22,292
0.5798
0.578894
937
17.830309
14.735158
72
false
false
0
0
0
0
0
0
0.136606
false
false
8
6f28a187720e41819a56d1390052338b48cbab9a
21,002,390,088,943
2dbe855619f6c9412f9a46e66ab07d32314b51b4
/src/pdsys/src/main/java/com/zworks/pdsys/models/WareHouseBOMModel.java
cf4981b174df46cbfff0fa6d50fb364e63f89ecf
[]
no_license
zhangxiaofengjs/pdsys
https://github.com/zhangxiaofengjs/pdsys
73d1fedd46358c60a8ab83efe1d6e7abb4483e77
013e5e6d2e40472ae93a1c81861243221f611c9d
refs/heads/master
2021-05-25T09:16:17.658000
2020-05-13T09:20:58
2020-05-13T09:20:58
126,954,572
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.zworks.pdsys.models; import org.apache.ibatis.type.Alias; /** * @author: zhangxiaofengjs@163.com * @version: 2018/03/30 */ @Alias("wareHouseBOMModel") public class WareHouseBOMModel extends BaseModel{ private float num; private float deliveryRemainingNum; private float defectiveNum; private BOMModel bom; public WareHouseBOMModel() { this.bom = new BOMModel(); } public BOMModel getBom() { return bom; } public void setBom(BOMModel bom) { this.bom = bom; } public float getNum() { return num; } public void setNum(float num) { this.num = num; } public float getDeliveryRemainingNum() { return deliveryRemainingNum; } public void setDeliveryRemainingNum(float deliveryRemainingNum) { this.deliveryRemainingNum = deliveryRemainingNum; } public float getDefectiveNum() { return defectiveNum; } public void setDefectiveNum(float defectiveNum) { this.defectiveNum = defectiveNum; } }
UTF-8
Java
948
java
WareHouseBOMModel.java
Java
[ { "context": "ort org.apache.ibatis.type.Alias;\n\n/**\n * @author: zhangxiaofengjs@163.com\n * @version: 2018/03/30\n */\n@Alias(\"wareHouseBOMM", "end": 111, "score": 0.9998801350593567, "start": 88, "tag": "EMAIL", "value": "zhangxiaofengjs@163.com" } ]
null
[]
package com.zworks.pdsys.models; import org.apache.ibatis.type.Alias; /** * @author: <EMAIL> * @version: 2018/03/30 */ @Alias("wareHouseBOMModel") public class WareHouseBOMModel extends BaseModel{ private float num; private float deliveryRemainingNum; private float defectiveNum; private BOMModel bom; public WareHouseBOMModel() { this.bom = new BOMModel(); } public BOMModel getBom() { return bom; } public void setBom(BOMModel bom) { this.bom = bom; } public float getNum() { return num; } public void setNum(float num) { this.num = num; } public float getDeliveryRemainingNum() { return deliveryRemainingNum; } public void setDeliveryRemainingNum(float deliveryRemainingNum) { this.deliveryRemainingNum = deliveryRemainingNum; } public float getDefectiveNum() { return defectiveNum; } public void setDefectiveNum(float defectiveNum) { this.defectiveNum = defectiveNum; } }
932
0.735232
0.723629
51
17.588236
17.343334
66
false
false
0
0
0
0
0
0
1.117647
false
false
8
e6ee43a10967fd0f4614c9d8de67ef8404f1345e
22,539,988,383,066
513c1eb639ae80c0c3e9eb0a617cd1d00e2bc034
/src/net/demilich/metastone/game/cards/concrete/tokens/shaman/SpiritWolf.java
3531bf2facae08f6a668f1605f704223082b0e3f
[ "MIT" ]
permissive
hillst/MetaStone
https://github.com/hillst/MetaStone
a21b63a1d2d02646ee3b6226261b4eb3304c175a
5882d834d32028f5f083543f0700e59ccf1aa1fe
refs/heads/master
2021-05-28T22:05:42.911000
2015-06-05T00:58:06
2015-06-05T00:58:06
36,316,023
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package net.demilich.metastone.game.cards.concrete.tokens.shaman; import net.demilich.metastone.game.GameTag; import net.demilich.metastone.game.cards.MinionCard; import net.demilich.metastone.game.cards.Rarity; import net.demilich.metastone.game.entities.heroes.HeroClass; import net.demilich.metastone.game.entities.minions.Minion; public class SpiritWolf extends MinionCard { public SpiritWolf() { super("Spirit Wolf", 2, 3, Rarity.RARE, HeroClass.SHAMAN, 2); setDescription("Taunt"); setCollectible(false); } @Override public int getTypeId() { return 459; } @Override public Minion summon() { return createMinion(GameTag.TAUNT); } }
UTF-8
Java
688
java
SpiritWolf.java
Java
[]
null
[]
package net.demilich.metastone.game.cards.concrete.tokens.shaman; import net.demilich.metastone.game.GameTag; import net.demilich.metastone.game.cards.MinionCard; import net.demilich.metastone.game.cards.Rarity; import net.demilich.metastone.game.entities.heroes.HeroClass; import net.demilich.metastone.game.entities.minions.Minion; public class SpiritWolf extends MinionCard { public SpiritWolf() { super("Spirit Wolf", 2, 3, Rarity.RARE, HeroClass.SHAMAN, 2); setDescription("Taunt"); setCollectible(false); } @Override public int getTypeId() { return 459; } @Override public Minion summon() { return createMinion(GameTag.TAUNT); } }
688
0.739826
0.731105
27
23.481482
22.802486
65
false
false
0
0
0
0
0
0
1.259259
false
false
8
04907e64bad24e8ab1eda67cc6622d6af59ca678
28,544,352,674,486
99c83b6529679876edd0558861622d64a624cbc4
/src/main/java/ru/k0r0tk0ff/Sender.java
20f932f010a6d943925665c8ebf90875a63b6b42
[ "Unlicense" ]
permissive
k0r0tk0ff/Jmstest_embedded_broker
https://github.com/k0r0tk0ff/Jmstest_embedded_broker
7c6a553e94f2ae526cec8978e7b42a7c9524824c
dc89ffe94c7ecdc4488d9398aa455e79ae27fc35
refs/heads/master
2020-03-28T07:55:06.196000
2018-09-09T14:24:28
2018-09-09T14:24:28
147,933,168
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package ru.k0r0tk0ff; import org.apache.activemq.ActiveMQConnection; import org.apache.activemq.ActiveMQConnectionFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.jms.*; public class Sender extends Thread { private static final Logger LOG = LoggerFactory.getLogger(Sender.class); private String queueName; private int mode; private boolean isTransacted; private String url; public Sender(String queueName, int mode, boolean isTransacted, String url) { this.queueName = queueName; this.mode = mode; this.isTransacted = isTransacted; this.url = url; } public void run() { //System.out.println("Sender -- " + Thread.currentThread().toString()); sendMessage(mode, isTransacted, url); } public void sendMessage(int mode, boolean isTransacted, String url) { ConnectionFactory f = new ActiveMQConnectionFactory( ActiveMQConnection.DEFAULT_USER, ActiveMQConnection.DEFAULT_PASSWORD, // "failover://tcp://localhost:61616"); url); try { Connection connection = f.createConnection(); Session session = connection.createSession(isTransacted, mode); Destination destination = session.createQueue(queueName); MessageProducer producer = session.createProducer(destination); TextMessage message = session.createTextMessage("Message for send"); producer.send(message); LOG.error("Message has been sent success. Message contains that - '" + message.getText() + "'"); //session.commit(); session.close(); connection.close(); } catch (JMSException e) { LOG.error("......................................................................."); LOG.error(e.toString()); LOG.error("......................................................................."); } } }
UTF-8
Java
2,037
java
Sender.java
Java
[]
null
[]
package ru.k0r0tk0ff; import org.apache.activemq.ActiveMQConnection; import org.apache.activemq.ActiveMQConnectionFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.jms.*; public class Sender extends Thread { private static final Logger LOG = LoggerFactory.getLogger(Sender.class); private String queueName; private int mode; private boolean isTransacted; private String url; public Sender(String queueName, int mode, boolean isTransacted, String url) { this.queueName = queueName; this.mode = mode; this.isTransacted = isTransacted; this.url = url; } public void run() { //System.out.println("Sender -- " + Thread.currentThread().toString()); sendMessage(mode, isTransacted, url); } public void sendMessage(int mode, boolean isTransacted, String url) { ConnectionFactory f = new ActiveMQConnectionFactory( ActiveMQConnection.DEFAULT_USER, ActiveMQConnection.DEFAULT_PASSWORD, // "failover://tcp://localhost:61616"); url); try { Connection connection = f.createConnection(); Session session = connection.createSession(isTransacted, mode); Destination destination = session.createQueue(queueName); MessageProducer producer = session.createProducer(destination); TextMessage message = session.createTextMessage("Message for send"); producer.send(message); LOG.error("Message has been sent success. Message contains that - '" + message.getText() + "'"); //session.commit(); session.close(); connection.close(); } catch (JMSException e) { LOG.error("......................................................................."); LOG.error(e.toString()); LOG.error("......................................................................."); } } }
2,037
0.580756
0.575847
62
31.854839
28.530033
97
false
false
0
0
0
0
0
0
0.677419
false
false
8
f16c8789ff239302bc38004fd6adf359800531af
21,431,886,835,254
6535c6b60be5d92ab1f9c5ef143965f21ddee48a
/src/com/spring/mvc/HelloWorldWithoutReturnModelAndViewController.java
95a45a2fe09b95eb7226b8ec6369515aeab90263
[]
no_license
JoeyLiujj/SpringMVC
https://github.com/JoeyLiujj/SpringMVC
f0118c6affc4007554fb1662b91a22d2e7790410
03ea3df556cb6bcbc43a913d12ee5d52b18766ee
refs/heads/master
2017-10-07T17:26:22.842000
2017-06-05T09:34:51
2017-06-05T09:34:51
81,311,811
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.spring.mvc; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.AbstractController; import org.springframework.web.servlet.mvc.LastModified; public class HelloWorldWithoutReturnModelAndViewController extends AbstractController implements LastModified{ private long lastModified; @Override protected ModelAndView handleRequestInternal( HttpServletRequest request, HttpServletResponse response) throws Exception { response.getWriter().write("Hello World!!"); response.setCharacterEncoding("gb2312"); return null; } //Spring 判断是否过期的代码 //this.notModified = (ifModifiedSince >= (lastModifiedTimestamp / 1000 * 1000)); //即请求的“If-Modified-Since” 大于等于当前的getLastModified方法的时间戳,则认为没有修改 @Override public long getLastModified(HttpServletRequest paramHttpServletRequest) { System.out.println(lastModified); System.out.println(paramHttpServletRequest.getHeader("If-Modified-Since")); if(lastModified==0l){ lastModified = System.currentTimeMillis(); } return lastModified; } }
UTF-8
Java
1,264
java
HelloWorldWithoutReturnModelAndViewController.java
Java
[]
null
[]
package com.spring.mvc; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.AbstractController; import org.springframework.web.servlet.mvc.LastModified; public class HelloWorldWithoutReturnModelAndViewController extends AbstractController implements LastModified{ private long lastModified; @Override protected ModelAndView handleRequestInternal( HttpServletRequest request, HttpServletResponse response) throws Exception { response.getWriter().write("Hello World!!"); response.setCharacterEncoding("gb2312"); return null; } //Spring 判断是否过期的代码 //this.notModified = (ifModifiedSince >= (lastModifiedTimestamp / 1000 * 1000)); //即请求的“If-Modified-Since” 大于等于当前的getLastModified方法的时间戳,则认为没有修改 @Override public long getLastModified(HttpServletRequest paramHttpServletRequest) { System.out.println(lastModified); System.out.println(paramHttpServletRequest.getHeader("If-Modified-Since")); if(lastModified==0l){ lastModified = System.currentTimeMillis(); } return lastModified; } }
1,264
0.782353
0.771429
36
31.055555
28.349941
110
false
false
0
0
0
0
0
0
1.444444
false
false
8
5ddab5e0efe43f6084e5d45d9a21db581095a2b6
23,691,039,624,165
7d2d35cf42b51123d6f3de337de64e73c3cff002
/src/java_MiddleRank/thread/test/Test_6/Stack.java
ce292bfe11dd031d7c9c871f663d4ed781358e49
[]
no_license
TinyYu/JavaSE
https://github.com/TinyYu/JavaSE
4f49a9dda30fe318b7bf97f43911576a069c2720
8e90b0a61b6b38e5378a23c2c825d854ae767a5a
refs/heads/master
2021-05-18T01:01:30.321000
2020-04-23T09:42:26
2020-04-23T09:42:26
251,036,236
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package java_MiddleRank.thread.test.Test_6; import java.util.LinkedList; import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; public class Stack<T> { LinkedList<T> linkedList = new LinkedList<>(); Lock lock = new ReentrantLock(); Condition condition = lock.newCondition(); public void push(T t){ try { lock.lock(); while (linkedList.size() >= 200){ try { condition.await(); } catch (InterruptedException e) { e.printStackTrace(); } } linkedList.addLast(t); System.out.println("弹入:" + t + " 个数:" + linkedList.size()); condition.signal(); } finally { try { Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); } lock.unlock(); } } public T pull(){ T t = null; try { lock.lock(); while (linkedList.isEmpty()){ try { condition.await(); } catch (InterruptedException e) { e.printStackTrace(); } } t = linkedList.removeLast(); System.out.println("弹出:" + t + " 个数:" + linkedList.size()); condition.signal(); } finally { try { Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); } lock.unlock(); } return t; } }
UTF-8
Java
1,780
java
Stack.java
Java
[]
null
[]
package java_MiddleRank.thread.test.Test_6; import java.util.LinkedList; import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; public class Stack<T> { LinkedList<T> linkedList = new LinkedList<>(); Lock lock = new ReentrantLock(); Condition condition = lock.newCondition(); public void push(T t){ try { lock.lock(); while (linkedList.size() >= 200){ try { condition.await(); } catch (InterruptedException e) { e.printStackTrace(); } } linkedList.addLast(t); System.out.println("弹入:" + t + " 个数:" + linkedList.size()); condition.signal(); } finally { try { Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); } lock.unlock(); } } public T pull(){ T t = null; try { lock.lock(); while (linkedList.isEmpty()){ try { condition.await(); } catch (InterruptedException e) { e.printStackTrace(); } } t = linkedList.removeLast(); System.out.println("弹出:" + t + " 个数:" + linkedList.size()); condition.signal(); } finally { try { Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); } lock.unlock(); } return t; } }
1,780
0.451814
0.446145
59
27.898306
16.375566
71
false
false
0
0
0
0
0
0
0.474576
false
false
8
457b20091fb4d2b74cb39361dcfd31a5038c734b
28,063,316,364,881
a36d26017dab8214a303f636cf9cd0faa59fecde
/Game of life/src/net/flyingff/gol/func/CalcFunction.java
634df0cba7d2e2d1828ddc0fd023faf8687155a3
[]
no_license
flyingff/gameoflife
https://github.com/flyingff/gameoflife
b754a670a5342149558b5a649094c7d187d5c308
475e8de8493740fd2efbcc01ba8187c619a0e2e2
refs/heads/master
2021-01-10T20:23:01.604000
2015-07-08T10:10:02
2015-07-08T10:14:57
38,747,039
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package net.flyingff.gol.func; public interface CalcFunction { int nextState(int curr, int[] live); }
UTF-8
Java
109
java
CalcFunction.java
Java
[]
null
[]
package net.flyingff.gol.func; public interface CalcFunction { int nextState(int curr, int[] live); }
109
0.715596
0.715596
5
19.799999
15.942396
37
false
false
0
0
0
0
0
0
0.8
false
false
8
aac99262026c89188c86194d7df7d9749a9826dc
4,638,564,721,346
824d6cca4322170faa560465cd353803883eeeca
/src/main/java/com/fekpal/web/controller/clubAdmin/ClubCenterController.java
937131727b6785cb7c7f789fc557aed58d01f276
[]
no_license
APoneWorker/sau-ims
https://github.com/APoneWorker/sau-ims
58d243d8076ca35b3b0486d4b6c5f8ee54741f57
949e9382a368e6549f1587f2140dce40e3c53f8e
refs/heads/master
2021-09-03T13:42:29.636000
2018-01-09T13:40:10
2018-01-09T13:40:10
100,382,626
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.fekpal.web.controller.clubAdmin; import com.fekpal.domain.Club; import com.fekpal.domain.User; import com.fekpal.service.ClubService; import com.fekpal.tool.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import java.util.Date; import java.util.LinkedHashMap; import java.util.Map; /** * 校社联中心信息的控制类 * Created by hasee on 2017/8/19. */ @Controller public class ClubCenterController { @Autowired private ClubService clubService; @Autowired private JsonObject returnData; /** * 得到社团中心的信息的方法 * * @param session 用户session * @return 社团的一些基本信息 */ @ResponseBody @RequestMapping("/club/center/info") public Map<String, Object> getClubsCenterMsg(HttpSession session) { User user = (User) session.getAttribute("userCode"); //创建链表map集合存放社团中心信息 Map<String, Object> clubCenterMsg = new LinkedHashMap<>(); //通过用户ID得到数据 Club club = null;//clubService.getClubAllInfoByUserId(user.getUserId()); clubCenterMsg.put("clubId", club.getClubId()); clubCenterMsg.put("clubName", club.getClubName()); clubCenterMsg.put("clubLogo", club.getLogo()); clubCenterMsg.put("clubView", club.getClubView()); clubCenterMsg.put("description", club.getDescription()); clubCenterMsg.put("adminName", club.getAdminName()); clubCenterMsg.put("email", club.getEmail()); clubCenterMsg.put("phone", club.getPhone()); clubCenterMsg.put("foundTime", new Date(club.getFoundTime().getTime())); clubCenterMsg.put("members", club.getMembers()); //把用户数据添加到返回数据模板中 returnData.setData(clubCenterMsg); return returnData.getMap(); } /** * 上传社团头像的方法 * * @param files 文件对象,用from-data表单 * @param request 请求 * @return 图片文件名 */ @ResponseBody @RequestMapping(value = "/club/center/info/edit/head", method = RequestMethod.POST) public Map<String, Object> uploadLogo(@RequestParam("file") MultipartFile[] files, HttpServletRequest request, HttpSession session) { Map<String, Object> returnData = ImagesUploadTool.uploadImage(files, request, "club//logo"); if (returnData.get("code").toString().equals("0")) { //获取图片的名称 Map<String, String> clubLogoNameMap = (Map<String, String>) returnData.get("data"); String clubLogoName = clubLogoNameMap.get("clubLogo"); User user = (User) session.getAttribute("userCode"); Club club = clubService.getClubByUserId(user.getUserId()); club.setLogo(clubLogoName); //将logo文件名存入数据库 clubService.updateClubInfo(club); } return returnData; } /** * 上传社团展示图片的方法 * * @param files 文件对象,用from-data表单 * @param request 请求 * @return 图片文件名 */ @ResponseBody @RequestMapping(value = "/club/center/info/edit/view", method = RequestMethod.POST) public Map<String, Object> uploadView(@RequestParam("file") MultipartFile[] files, HttpServletRequest request,HttpSession session) { Map<String, Object> returnData = ImagesUploadTool.uploadImage(files, request, "club//view"); if (returnData.get("code").toString().equals("0")) { //获取图片的名称 Map<String, String> clubLogoNameMap = (Map<String, String>) returnData.get("data"); String clubLogoName = clubLogoNameMap.get("clubLogo"); User user = (User) session.getAttribute("userCode"); Club club = clubService.getClubByUserId(user.getUserId()); club.setClubView(clubLogoName); //将logo文件名存入数据库 clubService.updateClubInfo(club); } return returnData; } /** * 社团用来提交修改社团中心的信息 * * @param clubCenterMsg 社团中心信息 * @param session 会话 * @return 是否提交成功 */ @ResponseBody @RequestMapping(value = "/club/center/info/edit", method = RequestMethod.PUT) public Map<String, Object> subNewCenterMsg(@RequestParam Map<String, Object> clubCenterMsg, HttpSession session) { //根据用户id从service层得到数据库的用户的实体 return returnData.getMap(); } }
UTF-8
Java
5,036
java
ClubCenterController.java
Java
[ { "context": " java.util.Map;\n\n\n/**\n * 校社联中心信息的控制类\n * Created by hasee on 2017/8/19.\n */\n@Controller\npublic class ClubCe", "end": 792, "score": 0.9997245669364929, "start": 787, "tag": "USERNAME", "value": "hasee" } ]
null
[]
package com.fekpal.web.controller.clubAdmin; import com.fekpal.domain.Club; import com.fekpal.domain.User; import com.fekpal.service.ClubService; import com.fekpal.tool.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import java.util.Date; import java.util.LinkedHashMap; import java.util.Map; /** * 校社联中心信息的控制类 * Created by hasee on 2017/8/19. */ @Controller public class ClubCenterController { @Autowired private ClubService clubService; @Autowired private JsonObject returnData; /** * 得到社团中心的信息的方法 * * @param session 用户session * @return 社团的一些基本信息 */ @ResponseBody @RequestMapping("/club/center/info") public Map<String, Object> getClubsCenterMsg(HttpSession session) { User user = (User) session.getAttribute("userCode"); //创建链表map集合存放社团中心信息 Map<String, Object> clubCenterMsg = new LinkedHashMap<>(); //通过用户ID得到数据 Club club = null;//clubService.getClubAllInfoByUserId(user.getUserId()); clubCenterMsg.put("clubId", club.getClubId()); clubCenterMsg.put("clubName", club.getClubName()); clubCenterMsg.put("clubLogo", club.getLogo()); clubCenterMsg.put("clubView", club.getClubView()); clubCenterMsg.put("description", club.getDescription()); clubCenterMsg.put("adminName", club.getAdminName()); clubCenterMsg.put("email", club.getEmail()); clubCenterMsg.put("phone", club.getPhone()); clubCenterMsg.put("foundTime", new Date(club.getFoundTime().getTime())); clubCenterMsg.put("members", club.getMembers()); //把用户数据添加到返回数据模板中 returnData.setData(clubCenterMsg); return returnData.getMap(); } /** * 上传社团头像的方法 * * @param files 文件对象,用from-data表单 * @param request 请求 * @return 图片文件名 */ @ResponseBody @RequestMapping(value = "/club/center/info/edit/head", method = RequestMethod.POST) public Map<String, Object> uploadLogo(@RequestParam("file") MultipartFile[] files, HttpServletRequest request, HttpSession session) { Map<String, Object> returnData = ImagesUploadTool.uploadImage(files, request, "club//logo"); if (returnData.get("code").toString().equals("0")) { //获取图片的名称 Map<String, String> clubLogoNameMap = (Map<String, String>) returnData.get("data"); String clubLogoName = clubLogoNameMap.get("clubLogo"); User user = (User) session.getAttribute("userCode"); Club club = clubService.getClubByUserId(user.getUserId()); club.setLogo(clubLogoName); //将logo文件名存入数据库 clubService.updateClubInfo(club); } return returnData; } /** * 上传社团展示图片的方法 * * @param files 文件对象,用from-data表单 * @param request 请求 * @return 图片文件名 */ @ResponseBody @RequestMapping(value = "/club/center/info/edit/view", method = RequestMethod.POST) public Map<String, Object> uploadView(@RequestParam("file") MultipartFile[] files, HttpServletRequest request,HttpSession session) { Map<String, Object> returnData = ImagesUploadTool.uploadImage(files, request, "club//view"); if (returnData.get("code").toString().equals("0")) { //获取图片的名称 Map<String, String> clubLogoNameMap = (Map<String, String>) returnData.get("data"); String clubLogoName = clubLogoNameMap.get("clubLogo"); User user = (User) session.getAttribute("userCode"); Club club = clubService.getClubByUserId(user.getUserId()); club.setClubView(clubLogoName); //将logo文件名存入数据库 clubService.updateClubInfo(club); } return returnData; } /** * 社团用来提交修改社团中心的信息 * * @param clubCenterMsg 社团中心信息 * @param session 会话 * @return 是否提交成功 */ @ResponseBody @RequestMapping(value = "/club/center/info/edit", method = RequestMethod.PUT) public Map<String, Object> subNewCenterMsg(@RequestParam Map<String, Object> clubCenterMsg, HttpSession session) { //根据用户id从service层得到数据库的用户的实体 return returnData.getMap(); } }
5,036
0.668392
0.666451
139
32.366905
30.214138
137
false
false
0
0
0
0
0
0
0.618705
false
false
8
7e3b72d7d72b5840eadb865a3a4287797f95d1d6
20,590,073,255,722
a1a1ebd08640d27cd30db1b3b33c389f07b7d2cd
/Implementing_String_Class/src/sopan/lang/IndexOutOfBoundException.java
4c8d539fb6cdfdfdddb194f7c07182e970be2d10
[]
no_license
sopanbhutekar/core-java
https://github.com/sopanbhutekar/core-java
ee2c355ccda6989e7f50ab4db6c4e335bd1fb526
bcae2b50936bc34cedd8f2e8fcdf440fd7d3ab44
refs/heads/master
2020-11-25T02:12:50.214000
2019-12-16T18:53:04
2019-12-16T18:53:04
228,446,889
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package sopan.lang; import java.lang.RuntimeException; import java.lang.String; public class IndexOutOfBoundException extends RuntimeException { public IndexOutOfBoundException() { super(); } public IndexOutOfBoundException(String s) { super(s); } }
UTF-8
Java
263
java
IndexOutOfBoundException.java
Java
[]
null
[]
package sopan.lang; import java.lang.RuntimeException; import java.lang.String; public class IndexOutOfBoundException extends RuntimeException { public IndexOutOfBoundException() { super(); } public IndexOutOfBoundException(String s) { super(s); } }
263
0.768061
0.768061
15
16.533333
19.238388
64
false
false
0
0
0
0
0
0
0.933333
false
false
8
df59dd80815322a193cc81cd134953dc292cb72e
30,657,476,562,988
d6f775bf68dd41c67f71d14666f5b93284b1705a
/src/cn/figo/database/Database.java
fe961232fc08180e6447e724f145e1dff91f0075
[]
no_license
solomanhl/Isleep
https://github.com/solomanhl/Isleep
62446e6d8389f948a2822a39852df65f268d5a18
3c2f10d12382426031874ed6e557e88798059c03
refs/heads/master
2020-05-26T06:31:16.407000
2014-10-15T08:32:11
2014-10-15T08:32:11
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package cn.figo.database; import java.util.Date; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.SQLException; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabase.CursorFactory; import android.database.sqlite.SQLiteOpenHelper; public class Database { private int dbversion = 1; private String db_name = "sleep.db"; private String table_list = "sleeplist";// 已点菜单数据表名称 private String table_info = "info";// info表,存放安装时间 private Context mCtx = null; private DatabaseHelper dbHelper; private SQLiteDatabase SQLdb; public String username, password, waitername; public Date installDate; public class DatabaseHelper extends SQLiteOpenHelper { public DatabaseHelper(Context context, String name, CursorFactory factory, int version) { super(context, name, factory, version); // TODO Auto-generated constructor stub System.out.println("DB databasehelper(context,name,factory,version)"); } public DatabaseHelper(Context context) { super(context, db_name, null, dbversion); // TODO Auto-generated constructor stub System.out.println("DB databasehelper(context)"); } @Override public void onCreate(SQLiteDatabase db) { // TODO Auto-generated method stub System.out.println("DB onCreate"); // 只在第一次创建的时候进入 db.execSQL("create table IF NOT EXISTS " + table_info + "(installDate long)"); // SQLdb = db; System.out.println("DB onCreate --- 2"); //varchar(20) db.execSQL("create table IF NOT EXISTS " + table_list + "(id int ," + //序号 "startTime long, " + // "endTime long )"); // SQLdb = db; System.out.println("DB onCreate --- 1"); // 第一次创建的时候添加安装时间 installDate = new Date(System.currentTimeMillis()); ContentValues args = new ContentValues(); args.put("installDate", installDate.getTime()); SQLdb.insert(table_info, null, args); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { // TODO Auto-generated method stub } } /** 构造函数 */ public Database(Context ctx) { this.mCtx = ctx; System.out.println("DB构造函数"); } public Database open() throws SQLException { System.out.println("DB Open"); dbHelper = new DatabaseHelper(mCtx); // 只有调用getReadableDatabase或者getWriteableDatabase方法,才会创建数据库对象 SQLdb = dbHelper.getWritableDatabase(); return this; } public void close() { dbHelper.close(); } // public long addUser(String uname, String pass, String wname) { // ContentValues args = new ContentValues(); // // args.put("username", username); // args.put("password", password); // args.put("waitername", waitername); // // System.out.println("DB.add " + table_user); // return SQLdb.insert(table_user, null, args); // } public long addSleeplist(int id, Date startTime, Date endTime) { ContentValues args = new ContentValues(); args.put("id", id); args.put("startTime", startTime.getTime()); args.put("endTime", endTime.getTime()); System.out.println("DB.add " + table_list); return SQLdb.insert(table_list, null, args); } public int updateSleeplist(int id, Date endTime){ ContentValues args = new ContentValues(); args.put("endTime", endTime.getTime()); return SQLdb.update(table_list, args, "id=?", new String[]{String.valueOf(id)}); } public long delFoodlist(int id) { return SQLdb.delete(table_list, "id = " + id, null); } public long getinstallDate(){ Cursor cursor = null; try { cursor = SQLdb.query(table_info, // table名 new String[] { "installDate" }, // 字段 null, // 条件 null, null, null, null); cursor.moveToFirst(); } catch (Exception e) { e.printStackTrace(); System.out.println(e.toString()); } return cursor.getLong(cursor.getColumnIndex("installDate")); } public Cursor queryTable(String tablename) { Cursor cursor = null; try { if (tablename.equals(table_list) ) { cursor = SQLdb.query(table_list, // table名 new String[] { "id," + "startTime", "endTime" }, // 字段 null, // 条件 null, null, null, null); } } catch (Exception e) { e.printStackTrace(); System.out.println(e.toString()); } return cursor; } public Cursor queryTable(String tablename, Date startTime, Date endTime) { Cursor cursor = null; try { if (tablename.equals(table_list) ) { cursor = SQLdb.query(table_list, // table名 new String[] { "id," + "startTime", "endTime" }, // 字段 "startTime >= '" + startTime.getTime() + "' and startTime <= '" + endTime.getTime() + "'", // 条件 null, null, null, null); } } catch (Exception e) { e.printStackTrace(); System.out.println(e.toString()); } return cursor; } /* * public Cursor getAll(){ return SQLdb.rawQuery("select * from " + * table_list, null); } * * public Cursor getThis(String tableid){ return SQLdb.query(table_list, new * String [] {"tableid","foodname","num"}, "tableid = " + tableid, null, * null, null, null); } */ public void clearThis(String tableid) { SQLdb.delete(table_list, null, null); } }
GB18030
Java
5,289
java
Database.java
Java
[ { "context": "atabase SQLdb;\n\n\tpublic String username, password, waitername;\n\tpublic Date installDate;\n\n\tpublic class Databas", "end": 686, "score": 0.9936993718147278, "start": 676, "tag": "USERNAME", "value": "waitername" }, { "context": "= new ContentValues();\n//\n//\t\targs.put(\"username\", username);\n//\t\targs.put(\"password\", password);\n//\t\targs.pu", "end": 2637, "score": 0.9893217086791992, "start": 2629, "tag": "USERNAME", "value": "username" }, { "context": "ut(\"username\", username);\n//\t\targs.put(\"password\", password);\n//\t\targs.put(\"waitername\", waitername);\n//\n//\t\t", "end": 2673, "score": 0.9990531206130981, "start": 2665, "tag": "PASSWORD", "value": "password" } ]
null
[]
package cn.figo.database; import java.util.Date; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.SQLException; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabase.CursorFactory; import android.database.sqlite.SQLiteOpenHelper; public class Database { private int dbversion = 1; private String db_name = "sleep.db"; private String table_list = "sleeplist";// 已点菜单数据表名称 private String table_info = "info";// info表,存放安装时间 private Context mCtx = null; private DatabaseHelper dbHelper; private SQLiteDatabase SQLdb; public String username, password, waitername; public Date installDate; public class DatabaseHelper extends SQLiteOpenHelper { public DatabaseHelper(Context context, String name, CursorFactory factory, int version) { super(context, name, factory, version); // TODO Auto-generated constructor stub System.out.println("DB databasehelper(context,name,factory,version)"); } public DatabaseHelper(Context context) { super(context, db_name, null, dbversion); // TODO Auto-generated constructor stub System.out.println("DB databasehelper(context)"); } @Override public void onCreate(SQLiteDatabase db) { // TODO Auto-generated method stub System.out.println("DB onCreate"); // 只在第一次创建的时候进入 db.execSQL("create table IF NOT EXISTS " + table_info + "(installDate long)"); // SQLdb = db; System.out.println("DB onCreate --- 2"); //varchar(20) db.execSQL("create table IF NOT EXISTS " + table_list + "(id int ," + //序号 "startTime long, " + // "endTime long )"); // SQLdb = db; System.out.println("DB onCreate --- 1"); // 第一次创建的时候添加安装时间 installDate = new Date(System.currentTimeMillis()); ContentValues args = new ContentValues(); args.put("installDate", installDate.getTime()); SQLdb.insert(table_info, null, args); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { // TODO Auto-generated method stub } } /** 构造函数 */ public Database(Context ctx) { this.mCtx = ctx; System.out.println("DB构造函数"); } public Database open() throws SQLException { System.out.println("DB Open"); dbHelper = new DatabaseHelper(mCtx); // 只有调用getReadableDatabase或者getWriteableDatabase方法,才会创建数据库对象 SQLdb = dbHelper.getWritableDatabase(); return this; } public void close() { dbHelper.close(); } // public long addUser(String uname, String pass, String wname) { // ContentValues args = new ContentValues(); // // args.put("username", username); // args.put("password", <PASSWORD>); // args.put("waitername", waitername); // // System.out.println("DB.add " + table_user); // return SQLdb.insert(table_user, null, args); // } public long addSleeplist(int id, Date startTime, Date endTime) { ContentValues args = new ContentValues(); args.put("id", id); args.put("startTime", startTime.getTime()); args.put("endTime", endTime.getTime()); System.out.println("DB.add " + table_list); return SQLdb.insert(table_list, null, args); } public int updateSleeplist(int id, Date endTime){ ContentValues args = new ContentValues(); args.put("endTime", endTime.getTime()); return SQLdb.update(table_list, args, "id=?", new String[]{String.valueOf(id)}); } public long delFoodlist(int id) { return SQLdb.delete(table_list, "id = " + id, null); } public long getinstallDate(){ Cursor cursor = null; try { cursor = SQLdb.query(table_info, // table名 new String[] { "installDate" }, // 字段 null, // 条件 null, null, null, null); cursor.moveToFirst(); } catch (Exception e) { e.printStackTrace(); System.out.println(e.toString()); } return cursor.getLong(cursor.getColumnIndex("installDate")); } public Cursor queryTable(String tablename) { Cursor cursor = null; try { if (tablename.equals(table_list) ) { cursor = SQLdb.query(table_list, // table名 new String[] { "id," + "startTime", "endTime" }, // 字段 null, // 条件 null, null, null, null); } } catch (Exception e) { e.printStackTrace(); System.out.println(e.toString()); } return cursor; } public Cursor queryTable(String tablename, Date startTime, Date endTime) { Cursor cursor = null; try { if (tablename.equals(table_list) ) { cursor = SQLdb.query(table_list, // table名 new String[] { "id," + "startTime", "endTime" }, // 字段 "startTime >= '" + startTime.getTime() + "' and startTime <= '" + endTime.getTime() + "'", // 条件 null, null, null, null); } } catch (Exception e) { e.printStackTrace(); System.out.println(e.toString()); } return cursor; } /* * public Cursor getAll(){ return SQLdb.rawQuery("select * from " + * table_list, null); } * * public Cursor getThis(String tableid){ return SQLdb.query(table_list, new * String [] {"tableid","foodname","num"}, "tableid = " + tableid, null, * null, null, null); } */ public void clearThis(String tableid) { SQLdb.delete(table_list, null, null); } }
5,291
0.674028
0.673051
182
27.115385
21.96858
102
false
false
0
0
0
0
0
0
2.681319
false
false
8
dbdba58ddcff4a77cb1d7853b07ed8dd66514046
21,543,555,989,294
bd9f8de939384fa53b61961a687f4d096d20f105
/lab3_solution/Playgroung.java
b40c473816f68236ce2d96a13635148a51832ef4
[]
no_license
vh5202002/COMM1409
https://github.com/vh5202002/COMM1409
ff69214bf9d460b94e78387b7a6434c547b3cfd8
3081ce72ebebd0489590c0af967d0a704734629a
refs/heads/master
2020-04-26T20:58:38.225000
2019-12-15T19:49:32
2019-12-15T19:49:32
173,828,066
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
public class Playgroung{ public void run(){ Person person2 = new Person("Gary", "Tong", 23 ,100.5 ); person2.setFirstName("Atruro"); System.out.println(person2.getFirstName()); Person person1 = new Person(); System.out.println(person1.getFirstName()); System.out.println(person1.getLastName()); System.out.println(person2.CURRENT_YEAR); } }
UTF-8
Java
474
java
Playgroung.java
Java
[ { "context": "c void run(){\n Person person2 = new Person(\"Gary\", \"Tong\", 23 ,100.5 );\n \n person2.set", "end": 93, "score": 0.9997575879096985, "start": 89, "tag": "NAME", "value": "Gary" }, { "context": "un(){\n Person person2 = new Person(\"Gary\", \"Tong\", 23 ,100.5 );\n \n person2.setFirstNam", "end": 101, "score": 0.9993511438369751, "start": 97, "tag": "NAME", "value": "Tong" } ]
null
[]
public class Playgroung{ public void run(){ Person person2 = new Person("Gary", "Tong", 23 ,100.5 ); person2.setFirstName("Atruro"); System.out.println(person2.getFirstName()); Person person1 = new Person(); System.out.println(person1.getFirstName()); System.out.println(person1.getLastName()); System.out.println(person2.CURRENT_YEAR); } }
474
0.537975
0.510549
22
20.59091
19.88526
63
false
false
0
0
0
0
0
0
0.454545
false
false
8
180d5863d0c4ab0805a18dffd13cb2ce92a4b030
35,673,998,363,799
d72d1f932375fb216234ecf7c64a7f291bd45b5e
/exercicios/src/controle/exercicios/Exercicio6Metodos.java
42985e67ff0aaaf3b413af89518b3cd13859edb6
[]
no_license
renatoolimelo/Java_UdemyCod3r
https://github.com/renatoolimelo/Java_UdemyCod3r
aecec60001cab965d0ad5570fd5630443041137d
c55ff0db41db1b897fe660641640449cb400f245
refs/heads/master
2023-03-21T14:45:54.483000
2021-03-13T14:41:51
2021-03-13T14:41:51
336,600,492
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package controle.exercicios; import java.util.Random; import javax.swing.JOptionPane; public abstract class Exercicio6Metodos { public static int geraNumeroAleatorio() { Random gerador = new Random(); return gerador.nextInt(100); } private static int verificaNumeroDigitado(String numeroDigitado) { int numero; try { numero = Integer.parseInt(numeroDigitado); } catch (Exception ex) { JOptionPane.showMessageDialog(null, "Número inválido"); numero = -1; } return numero; } public static void jogar(int numeroAleatorio, int creditos) { String numeroDigitado; int numero; int tentativa; for (tentativa = creditos; tentativa > 0; tentativa--) { JOptionPane.showMessageDialog(null, "Você tem " + tentativa + " tentativas"); numeroDigitado = JOptionPane.showInputDialog("Informe o número:"); numero = verificaNumeroDigitado(numeroDigitado); if (numero == -1) { continue; } else if (numero < numeroAleatorio) { JOptionPane.showMessageDialog(null, "O número é maior"); } else if (numero > numeroAleatorio) { JOptionPane.showMessageDialog(null, "O número é menor"); } else if (numero == numeroAleatorio) { JOptionPane.showMessageDialog(null, "Número correto Parabéns"); break; } } if (tentativa == 0) { JOptionPane.showMessageDialog(null, "Você perdeu"); } } }
ISO-8859-1
Java
1,370
java
Exercicio6Metodos.java
Java
[]
null
[]
package controle.exercicios; import java.util.Random; import javax.swing.JOptionPane; public abstract class Exercicio6Metodos { public static int geraNumeroAleatorio() { Random gerador = new Random(); return gerador.nextInt(100); } private static int verificaNumeroDigitado(String numeroDigitado) { int numero; try { numero = Integer.parseInt(numeroDigitado); } catch (Exception ex) { JOptionPane.showMessageDialog(null, "Número inválido"); numero = -1; } return numero; } public static void jogar(int numeroAleatorio, int creditos) { String numeroDigitado; int numero; int tentativa; for (tentativa = creditos; tentativa > 0; tentativa--) { JOptionPane.showMessageDialog(null, "Você tem " + tentativa + " tentativas"); numeroDigitado = JOptionPane.showInputDialog("Informe o número:"); numero = verificaNumeroDigitado(numeroDigitado); if (numero == -1) { continue; } else if (numero < numeroAleatorio) { JOptionPane.showMessageDialog(null, "O número é maior"); } else if (numero > numeroAleatorio) { JOptionPane.showMessageDialog(null, "O número é menor"); } else if (numero == numeroAleatorio) { JOptionPane.showMessageDialog(null, "Número correto Parabéns"); break; } } if (tentativa == 0) { JOptionPane.showMessageDialog(null, "Você perdeu"); } } }
1,370
0.704194
0.698308
58
22.431034
23.780687
80
false
false
0
0
0
0
0
0
2.086207
false
false
8
5f0f2e0cf6f84ea4ed07d6bc6923a9b00301a128
36,515,811,951,924
bb67d1bd0cc8a01b964c5523633c0816bf903d12
/src/java/project/supplierData.java
ad2d50f00b4be28e9905c60e12ee1b9af5990b5b
[]
no_license
Muriloo/PMR2490_3Design
https://github.com/Muriloo/PMR2490_3Design
d5ea4eea0eba0d0672b4d3e2a0309bea8c885c1c
a9c0f6e4f56296d3932e99626562ac16f72bd4fb
refs/heads/master
2021-04-12T04:32:12.581000
2014-12-03T10:00:13
2014-12-03T10:00:13
null
0
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 project; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Vector; import java.util.ArrayList; import java.util.Arrays; import utils.Transacao; import java.sql.Statement; /** * * @author Arthur */ public class supplierData { public void insertMaterial(supplierDO supplier, Transacao tr) throws Exception{ Connection con = tr.obterConexao(); Date dia = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("yy-MM-dd hh-mm-ss"); sdf.format(dia); String day= sdf.format(dia); ArrayList<String> materials = new ArrayList<String> (); Object[] materials2 = supplier.getMaterials(); for(int i=0; i<materials2.length;i++){ String mat =(String) materials2[i]; String sql = "select * from material where material_name = ?"; PreparedStatement ps = con.prepareStatement(sql); ps.setString(1, mat); ResultSet rs = ps.executeQuery(); if(rs.next()){ int matId = rs.getInt("id"); String sql2 = "select * from supplier_material_relation where material_name = ?"; PreparedStatement ps2 = con.prepareStatement(sql2); ps2.setString(1, mat); ResultSet rs2 = ps2.executeQuery(); if(!rs2.next()){ String sql3 = "insert into supplier_material_relation set supplier_id=?, material_id=?"; PreparedStatement ps3 = con.prepareStatement(sql3); ps3.setInt(1,supplier.getId()); ps3.setInt(2,rs.getInt("id")); ps3.executeUpdate(); }else{ String sql3 = "insert into material set material_name=?"; PreparedStatement ps3 = con.prepareStatement(sql3); ps3.setString(2,mat); ps3.executeUpdate(); } } } } public int insertAddress(supplierAddressDO address, Transacao tr) throws Exception{ Connection con = tr.obterConexao(); Date dia = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("yy-MM-dd hh-mm-ss"); sdf.format(dia); String day= sdf.format(dia); if (address.getSupplier()==-1){ String sql = "insert into supplier_address (supplier_address_id, supplier_address_country, supplier_address_state, supplier_address_city," + " supplier_address_street, supplier_address_complement, supplier_address_postalcode, created_at, updated_at) " + "values('"+address.getSupplier()+"','"+address.getCountry()+"','"+address.getState()+"','"+address.getCity()+"','"+address.getStreet()+"'," + "'"+address.getComplement()+"','"+address.getPostalcode()+"','"+day+"','"+day+"')"; Statement stmt = con.createStatement(); stmt.executeUpdate(sql, Statement.RETURN_GENERATED_KEYS); ResultSet rs = stmt.getGeneratedKeys(); if ( rs.next() ){ address.setId(rs.getInt(1)); } }else{ String sqlA = "update supplier_address set supplier_address_country=?, supplier_address_state=?, supplier_address_city=?," + " supplier_address_street=?, supplier_address_complement=?, supplier_address_postalcode=?, updated_at=? where supplier_address_id=?"; PreparedStatement psA = con.prepareStatement(sqlA); psA.setString(1,address.getCountry()); psA.setString(2,address.getState()); psA.setString(3,address.getCity()); psA.setString(4,address.getStreet()); psA.setString(5,address.getComplement()); psA.setString(6,address.getPostalcode()); psA.setString(7, day); psA.setInt (8, address.getSupplier()); psA.executeUpdate(); } return address.getId(); } public int insertContact(contactInfoDO contact, Transacao tr) throws Exception{ Connection con = tr.obterConexao(); Date dia = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("yy-MM-dd hh-mm-ss"); sdf.format(dia); String day= sdf.format(dia); if (contact.getSupplierId()==-1){ String sql = "insert into contact (contact_supplier_id, contact_name, contact_position, contact_email," + " contact_phone, created_at, updated_at) values('"+contact.getSupplierId()+"','"+contact.getName()+"','"+contact.getPosition()+"" + "','"+contact.getEmail()+"','"+contact.getPhone()+"','"+day+"','"+day+"')"; Statement stmt = con.createStatement(); stmt.executeUpdate(sql, Statement.RETURN_GENERATED_KEYS); ResultSet rs = stmt.getGeneratedKeys(); if ( rs.next() ){ contact.setId(rs.getInt(1)); } }else{ String sqlC = "update contact set contact_name=?, contact_position=?, contact_email=?," + " contact_phone=?, updated_at=? where contact_supplier_id=?"; PreparedStatement psC = con.prepareStatement(sqlC); psC.setString(1,contact.getName()); psC.setString(2,contact.getPosition()); psC.setString(3,contact.getEmail()); psC.setString(4,contact.getPhone()); psC.setString (5, day); psC.setInt(6,contact.getSupplierId()); psC.executeUpdate(); } return contact.getId(); } public int insertBank(BankInfoDO bank, Transacao tr) throws Exception{ Connection con = tr.obterConexao(); Date dia = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("yy-MM-dd hh-mm-ss"); sdf.format(dia); String day= sdf.format(dia); if (bank.getSupplierId()==-1){ String sql = "insert into bank_info (bank_info_supplier_id, bank_info_number, bank_info_agency, bank_info_account," + " bank_info_cpf_cnpj, created_at, updated_at) values('"+bank.getSupplierId()+"','"+bank.getBankNumber()+"','"+bank.getAgency()+"','"+bank.getAccount()+"','"+bank.getCnpjCpf()+"','"+day+"','"+day+"')"; Statement stmt = con.createStatement(); stmt.executeUpdate(sql, Statement.RETURN_GENERATED_KEYS); ResultSet rs = stmt.getGeneratedKeys(); if ( rs.next() ){ bank.setId(rs.getInt(1)); } }else{ String sqlB = "update bank_info set bank_info_number=?, bank_info_agency=?, bank_info_account=?," + " bank_info_cpf_cnpj=?, updated_at=? where bank_info_supplier_id=?"; PreparedStatement psB = con.prepareStatement(sqlB); psB.setString(1,bank.getBankNumber()); psB.setString(2,bank.getAgency()); psB.setString(3,bank.getAccount()); psB.setString(4,bank.getCnpjCpf()); psB.setString (5, day); psB.setInt(6,bank.getSupplierId()); psB.executeUpdate(); } return bank.getId(); } public void update(supplierDO supplier, Transacao tr) throws Exception{ System.out.println("entra no update"); Connection con = tr.obterConexao(); System.out.println("cria conexão"); Date dia = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("yy-MM-dd hh-mm-ss"); sdf.format(dia); String day= sdf.format(dia); String sql = "update supplier set supplier_name=?, supplier_evaluation=?, " + "supplier_capacity_id=?, supplier_comment=?, supplier_description=?, created_at=?, updated_at=? where id=?"; System.out.println("fez sql"); PreparedStatement ps =con.prepareStatement(sql); System.out.println("prepara statement"); ps.setString(1, supplier.getName()); ps.setDouble(2, supplier.getEval()); ps.setInt(3, supplier.getCapacityId()); ps.setString(4, supplier.getComment()); ps.setString(5, supplier.getDescription()); ps.setString(6, day); ps.setString(7, day); ps.setInt(8, supplier.getId()); System.out.println("antes da query"); ps.executeUpdate(); System.out.println("executou a query de update"); } public int include(supplierDO supplier, Transacao tr) throws Exception { Connection con = tr.obterConexao(); Date dia = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("yy-MM-dd hh-mm-ss"); sdf.format(dia); String day= sdf.format(dia); System.out.println("supplier_evaluation:"+supplier.getEval()); String sql = "insert into supplier (supplier_name, supplier_evaluation, supplier_capacity_id, supplier_comment, supplier_description, created_at, updated_at)" + " values ('"+supplier.getName()+"', "+supplier.getEval()+", "+supplier.getCapacityId()+", '"+supplier.getComment()+"', '"+supplier.getDescription()+"', '"+day+"', '"+day+"');"; System.out.println(sql); Statement stmt = con.createStatement(); stmt.executeUpdate(sql, Statement.RETURN_GENERATED_KEYS); ResultSet rs = stmt.getGeneratedKeys(); if ( rs.next() ){ supplier.setId(rs.getInt(1)); } System.out.println("executou a query de inserção"); return supplier.getId(); } // include supplier public void delete (supplierDO supplier, Transacao tr) throws Exception { Connection con = tr.obterConexao(); Date dia = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("yy-MM-dd hh-mm-ss"); sdf.format(dia); String day= sdf.format(dia); String sql = "update supplier set deleted=1, deleted_at=? where id=?;"; PreparedStatement ps = con.prepareStatement(sql); ps.setString (1, day); ps.setInt (2,supplier.getId()); int result = ps.executeUpdate(); } // include supplier public Vector getSuppliers(Transacao tr) throws Exception { Connection con = tr.obterConexao(); String sql = "select * from supplier where deleted=0;"; PreparedStatement ps = con.prepareStatement(sql); ResultSet rs = ps.executeQuery(); System.out.println("query executada"); Vector suppliers = new Vector(); while (rs.next()) { supplierDO s = new supplierDO(); s.setId (rs.getInt("id")); s.setName (rs.getString("supplier_name")); s.setEval(rs.getDouble("supplier_evaluation")); s.setCapacityId(rs.getInt("supplier_capacity_id")); s.setComment(rs.getString("supplier_comment")); s.setDescription(rs.getString("supplier_description")); System.out.println("ID fornecedor="+s.getId()); // contatos Vector contacts = new Vector(); String sql1 = "select * from contact where contact_supplier_id=? and deleted=0;"; PreparedStatement ps1 = con.prepareStatement(sql1); ps1.setInt(1, s.getId()); ResultSet rs1 = ps1.executeQuery(); while (rs1.next()){ contactInfoDO ci = new contactInfoDO(); ci.setPhone(rs1.getString("contact_phone")); ci.setEmail(rs1.getString("contact_email")); ci.setPosition(rs1.getString("contact_position")); ci.setName(rs1.getString("contact_name")); ci.setSupplierId(rs1.getInt("contact_supplier_id")); ci.setId(rs1.getInt("id")); contacts.add(ci); System.out.println("Email: "+ci.getEmail()); } s.setContactInfo(contacts); //fecha contatos //endereços Vector Addresses = new Vector(); String sql2 = "select * from supplier_address where supplier_address_id=? and deleted=0;"; PreparedStatement ps2 = con.prepareStatement(sql2); ps2.setInt(1, s.getId()); ResultSet rs2 = ps2.executeQuery(); while ( rs2.next() ){ supplierAddressDO sa = new supplierAddressDO(); sa.setComplement(rs2.getString("supplier_address_complement")); sa.setPostalcode(rs2.getString("supplier_address_postalcode")); sa.setStreet(rs2.getString("supplier_address_street")); sa.setCity(rs2.getString("supplier_address_city")); sa.setState(rs2.getString("supplier_address_state")); sa.setCountry(rs2.getString("supplier_address_country")); sa.setSupplier(rs2.getInt("supplier_address_id")); sa.setId(rs2.getInt("id")); System.out.println("cidade: "+sa.getCity()); Addresses.add(sa); } s.setAddress(Addresses); // fecha endereços //bankInfos Vector bankInfos = new Vector(); String sql3 = "select * from bank_info where bank_info_supplier_id=? and deleted=0;"; PreparedStatement ps3 = con.prepareStatement(sql3); ps3.setInt(1,s.getId()); ResultSet rs3 = ps3.executeQuery(); while (rs3.next()){ BankInfoDO bi = new BankInfoDO(); bi.setCnpjCpf(rs3.getString("bank_info_cpf_cnpj")); bi.setAccount(rs3.getString("bank_info_account")); bi.setAgency(rs3.getString("bank_info_agency")); bi.setBankNumber(rs3.getString("bank_info_number")); bi.setSupplierId(rs3.getInt("bank_info_supplier_id")); bi.setId(rs3.getInt("id")); bankInfos.add(bi); System.out.println("ID do banco="+rs3.getInt("id")); } s.setBankInfo(bankInfos); // fecha bankInfos //materiais ArrayList<String> materials = new ArrayList<String> (); String sql4 = "select m.material_name from supplier_material_relation r " + "inner join material m on m.id=r.material_id and m.deleted=0 " + "where r.supplier_id = ? and r.deleted=0;"; PreparedStatement ps4 = con.prepareStatement(sql4); ps4.setInt(1,s.getId()); ResultSet rs4 = ps4.executeQuery(); while(rs4.next()){ System.out.println(rs4.getString("material_name")); materials.add(rs4.getString("material_name")); } s.setMaterials( materials.toArray()); suppliers.add(s); // suppliers <- s; } //while rs return suppliers; } // gets suppliers }
UTF-8
Java
15,006
java
supplierData.java
Java
[ { "context": "acao;\nimport java.sql.Statement;\n/**\n *\n * @author Arthur\n */\npublic class supplierData {\n \n public v", "end": 505, "score": 0.999365508556366, "start": 499, "tag": "NAME", "value": "Arthur" } ]
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 project; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Vector; import java.util.ArrayList; import java.util.Arrays; import utils.Transacao; import java.sql.Statement; /** * * @author Arthur */ public class supplierData { public void insertMaterial(supplierDO supplier, Transacao tr) throws Exception{ Connection con = tr.obterConexao(); Date dia = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("yy-MM-dd hh-mm-ss"); sdf.format(dia); String day= sdf.format(dia); ArrayList<String> materials = new ArrayList<String> (); Object[] materials2 = supplier.getMaterials(); for(int i=0; i<materials2.length;i++){ String mat =(String) materials2[i]; String sql = "select * from material where material_name = ?"; PreparedStatement ps = con.prepareStatement(sql); ps.setString(1, mat); ResultSet rs = ps.executeQuery(); if(rs.next()){ int matId = rs.getInt("id"); String sql2 = "select * from supplier_material_relation where material_name = ?"; PreparedStatement ps2 = con.prepareStatement(sql2); ps2.setString(1, mat); ResultSet rs2 = ps2.executeQuery(); if(!rs2.next()){ String sql3 = "insert into supplier_material_relation set supplier_id=?, material_id=?"; PreparedStatement ps3 = con.prepareStatement(sql3); ps3.setInt(1,supplier.getId()); ps3.setInt(2,rs.getInt("id")); ps3.executeUpdate(); }else{ String sql3 = "insert into material set material_name=?"; PreparedStatement ps3 = con.prepareStatement(sql3); ps3.setString(2,mat); ps3.executeUpdate(); } } } } public int insertAddress(supplierAddressDO address, Transacao tr) throws Exception{ Connection con = tr.obterConexao(); Date dia = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("yy-MM-dd hh-mm-ss"); sdf.format(dia); String day= sdf.format(dia); if (address.getSupplier()==-1){ String sql = "insert into supplier_address (supplier_address_id, supplier_address_country, supplier_address_state, supplier_address_city," + " supplier_address_street, supplier_address_complement, supplier_address_postalcode, created_at, updated_at) " + "values('"+address.getSupplier()+"','"+address.getCountry()+"','"+address.getState()+"','"+address.getCity()+"','"+address.getStreet()+"'," + "'"+address.getComplement()+"','"+address.getPostalcode()+"','"+day+"','"+day+"')"; Statement stmt = con.createStatement(); stmt.executeUpdate(sql, Statement.RETURN_GENERATED_KEYS); ResultSet rs = stmt.getGeneratedKeys(); if ( rs.next() ){ address.setId(rs.getInt(1)); } }else{ String sqlA = "update supplier_address set supplier_address_country=?, supplier_address_state=?, supplier_address_city=?," + " supplier_address_street=?, supplier_address_complement=?, supplier_address_postalcode=?, updated_at=? where supplier_address_id=?"; PreparedStatement psA = con.prepareStatement(sqlA); psA.setString(1,address.getCountry()); psA.setString(2,address.getState()); psA.setString(3,address.getCity()); psA.setString(4,address.getStreet()); psA.setString(5,address.getComplement()); psA.setString(6,address.getPostalcode()); psA.setString(7, day); psA.setInt (8, address.getSupplier()); psA.executeUpdate(); } return address.getId(); } public int insertContact(contactInfoDO contact, Transacao tr) throws Exception{ Connection con = tr.obterConexao(); Date dia = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("yy-MM-dd hh-mm-ss"); sdf.format(dia); String day= sdf.format(dia); if (contact.getSupplierId()==-1){ String sql = "insert into contact (contact_supplier_id, contact_name, contact_position, contact_email," + " contact_phone, created_at, updated_at) values('"+contact.getSupplierId()+"','"+contact.getName()+"','"+contact.getPosition()+"" + "','"+contact.getEmail()+"','"+contact.getPhone()+"','"+day+"','"+day+"')"; Statement stmt = con.createStatement(); stmt.executeUpdate(sql, Statement.RETURN_GENERATED_KEYS); ResultSet rs = stmt.getGeneratedKeys(); if ( rs.next() ){ contact.setId(rs.getInt(1)); } }else{ String sqlC = "update contact set contact_name=?, contact_position=?, contact_email=?," + " contact_phone=?, updated_at=? where contact_supplier_id=?"; PreparedStatement psC = con.prepareStatement(sqlC); psC.setString(1,contact.getName()); psC.setString(2,contact.getPosition()); psC.setString(3,contact.getEmail()); psC.setString(4,contact.getPhone()); psC.setString (5, day); psC.setInt(6,contact.getSupplierId()); psC.executeUpdate(); } return contact.getId(); } public int insertBank(BankInfoDO bank, Transacao tr) throws Exception{ Connection con = tr.obterConexao(); Date dia = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("yy-MM-dd hh-mm-ss"); sdf.format(dia); String day= sdf.format(dia); if (bank.getSupplierId()==-1){ String sql = "insert into bank_info (bank_info_supplier_id, bank_info_number, bank_info_agency, bank_info_account," + " bank_info_cpf_cnpj, created_at, updated_at) values('"+bank.getSupplierId()+"','"+bank.getBankNumber()+"','"+bank.getAgency()+"','"+bank.getAccount()+"','"+bank.getCnpjCpf()+"','"+day+"','"+day+"')"; Statement stmt = con.createStatement(); stmt.executeUpdate(sql, Statement.RETURN_GENERATED_KEYS); ResultSet rs = stmt.getGeneratedKeys(); if ( rs.next() ){ bank.setId(rs.getInt(1)); } }else{ String sqlB = "update bank_info set bank_info_number=?, bank_info_agency=?, bank_info_account=?," + " bank_info_cpf_cnpj=?, updated_at=? where bank_info_supplier_id=?"; PreparedStatement psB = con.prepareStatement(sqlB); psB.setString(1,bank.getBankNumber()); psB.setString(2,bank.getAgency()); psB.setString(3,bank.getAccount()); psB.setString(4,bank.getCnpjCpf()); psB.setString (5, day); psB.setInt(6,bank.getSupplierId()); psB.executeUpdate(); } return bank.getId(); } public void update(supplierDO supplier, Transacao tr) throws Exception{ System.out.println("entra no update"); Connection con = tr.obterConexao(); System.out.println("cria conexão"); Date dia = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("yy-MM-dd hh-mm-ss"); sdf.format(dia); String day= sdf.format(dia); String sql = "update supplier set supplier_name=?, supplier_evaluation=?, " + "supplier_capacity_id=?, supplier_comment=?, supplier_description=?, created_at=?, updated_at=? where id=?"; System.out.println("fez sql"); PreparedStatement ps =con.prepareStatement(sql); System.out.println("prepara statement"); ps.setString(1, supplier.getName()); ps.setDouble(2, supplier.getEval()); ps.setInt(3, supplier.getCapacityId()); ps.setString(4, supplier.getComment()); ps.setString(5, supplier.getDescription()); ps.setString(6, day); ps.setString(7, day); ps.setInt(8, supplier.getId()); System.out.println("antes da query"); ps.executeUpdate(); System.out.println("executou a query de update"); } public int include(supplierDO supplier, Transacao tr) throws Exception { Connection con = tr.obterConexao(); Date dia = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("yy-MM-dd hh-mm-ss"); sdf.format(dia); String day= sdf.format(dia); System.out.println("supplier_evaluation:"+supplier.getEval()); String sql = "insert into supplier (supplier_name, supplier_evaluation, supplier_capacity_id, supplier_comment, supplier_description, created_at, updated_at)" + " values ('"+supplier.getName()+"', "+supplier.getEval()+", "+supplier.getCapacityId()+", '"+supplier.getComment()+"', '"+supplier.getDescription()+"', '"+day+"', '"+day+"');"; System.out.println(sql); Statement stmt = con.createStatement(); stmt.executeUpdate(sql, Statement.RETURN_GENERATED_KEYS); ResultSet rs = stmt.getGeneratedKeys(); if ( rs.next() ){ supplier.setId(rs.getInt(1)); } System.out.println("executou a query de inserção"); return supplier.getId(); } // include supplier public void delete (supplierDO supplier, Transacao tr) throws Exception { Connection con = tr.obterConexao(); Date dia = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("yy-MM-dd hh-mm-ss"); sdf.format(dia); String day= sdf.format(dia); String sql = "update supplier set deleted=1, deleted_at=? where id=?;"; PreparedStatement ps = con.prepareStatement(sql); ps.setString (1, day); ps.setInt (2,supplier.getId()); int result = ps.executeUpdate(); } // include supplier public Vector getSuppliers(Transacao tr) throws Exception { Connection con = tr.obterConexao(); String sql = "select * from supplier where deleted=0;"; PreparedStatement ps = con.prepareStatement(sql); ResultSet rs = ps.executeQuery(); System.out.println("query executada"); Vector suppliers = new Vector(); while (rs.next()) { supplierDO s = new supplierDO(); s.setId (rs.getInt("id")); s.setName (rs.getString("supplier_name")); s.setEval(rs.getDouble("supplier_evaluation")); s.setCapacityId(rs.getInt("supplier_capacity_id")); s.setComment(rs.getString("supplier_comment")); s.setDescription(rs.getString("supplier_description")); System.out.println("ID fornecedor="+s.getId()); // contatos Vector contacts = new Vector(); String sql1 = "select * from contact where contact_supplier_id=? and deleted=0;"; PreparedStatement ps1 = con.prepareStatement(sql1); ps1.setInt(1, s.getId()); ResultSet rs1 = ps1.executeQuery(); while (rs1.next()){ contactInfoDO ci = new contactInfoDO(); ci.setPhone(rs1.getString("contact_phone")); ci.setEmail(rs1.getString("contact_email")); ci.setPosition(rs1.getString("contact_position")); ci.setName(rs1.getString("contact_name")); ci.setSupplierId(rs1.getInt("contact_supplier_id")); ci.setId(rs1.getInt("id")); contacts.add(ci); System.out.println("Email: "+ci.getEmail()); } s.setContactInfo(contacts); //fecha contatos //endereços Vector Addresses = new Vector(); String sql2 = "select * from supplier_address where supplier_address_id=? and deleted=0;"; PreparedStatement ps2 = con.prepareStatement(sql2); ps2.setInt(1, s.getId()); ResultSet rs2 = ps2.executeQuery(); while ( rs2.next() ){ supplierAddressDO sa = new supplierAddressDO(); sa.setComplement(rs2.getString("supplier_address_complement")); sa.setPostalcode(rs2.getString("supplier_address_postalcode")); sa.setStreet(rs2.getString("supplier_address_street")); sa.setCity(rs2.getString("supplier_address_city")); sa.setState(rs2.getString("supplier_address_state")); sa.setCountry(rs2.getString("supplier_address_country")); sa.setSupplier(rs2.getInt("supplier_address_id")); sa.setId(rs2.getInt("id")); System.out.println("cidade: "+sa.getCity()); Addresses.add(sa); } s.setAddress(Addresses); // fecha endereços //bankInfos Vector bankInfos = new Vector(); String sql3 = "select * from bank_info where bank_info_supplier_id=? and deleted=0;"; PreparedStatement ps3 = con.prepareStatement(sql3); ps3.setInt(1,s.getId()); ResultSet rs3 = ps3.executeQuery(); while (rs3.next()){ BankInfoDO bi = new BankInfoDO(); bi.setCnpjCpf(rs3.getString("bank_info_cpf_cnpj")); bi.setAccount(rs3.getString("bank_info_account")); bi.setAgency(rs3.getString("bank_info_agency")); bi.setBankNumber(rs3.getString("bank_info_number")); bi.setSupplierId(rs3.getInt("bank_info_supplier_id")); bi.setId(rs3.getInt("id")); bankInfos.add(bi); System.out.println("ID do banco="+rs3.getInt("id")); } s.setBankInfo(bankInfos); // fecha bankInfos //materiais ArrayList<String> materials = new ArrayList<String> (); String sql4 = "select m.material_name from supplier_material_relation r " + "inner join material m on m.id=r.material_id and m.deleted=0 " + "where r.supplier_id = ? and r.deleted=0;"; PreparedStatement ps4 = con.prepareStatement(sql4); ps4.setInt(1,s.getId()); ResultSet rs4 = ps4.executeQuery(); while(rs4.next()){ System.out.println(rs4.getString("material_name")); materials.add(rs4.getString("material_name")); } s.setMaterials( materials.toArray()); suppliers.add(s); // suppliers <- s; } //while rs return suppliers; } // gets suppliers }
15,006
0.583094
0.574695
326
45.015339
31.855064
219
false
false
0
0
0
0
0
0
1.082822
false
false
8
0f843cf827c2a8d0eb66709179a09d20968611f6
5,488,968,209,281
5f0be6eb5f8472244d27f0547eb8daa9cdfdc125
/app/src/main/java/com/XuanRan/ChangeIMEI/MainActivity.java
8021f2ea557ea9a29d6f5c86c9f272827bf7109b
[]
no_license
XuanRan0808/ChangeIMEI
https://github.com/XuanRan0808/ChangeIMEI
0bc49fea0da55fa5b2e5fa90846411f2560a9f7f
c535290c1811d3e75ff10add540fd9ed8e2a93a9
refs/heads/master
2023-02-15T04:57:07.002000
2021-01-15T08:45:17
2021-01-15T08:45:17
328,870,778
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.XuanRan.ChangeIMEI; import android.Manifest; import android.content.pm.PackageManager; import android.os.Build; import android.os.Bundle; import android.telephony.TelephonyManager; import android.widget.TextView; import android.widget.Toast; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; public class MainActivity extends AppCompatActivity { public static volatile transient Test $test=new Test() { @Override public Object test() { return null; } }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if ($test==null){ Toast.makeText(this, "NULL", Toast.LENGTH_SHORT).show(); }else{ Toast.makeText(this, "NOT NULL", Toast.LENGTH_SHORT).show(); } if (Build.VERSION.SDK_INT > 23) { requestPower(); } TextView tv = findViewById(R.id.textview); TelephonyManager tele = (TelephonyManager) this.getSystemService(TELEPHONY_SERVICE); try { tv.setText(tele.getDeviceId()+"\n"+tele.getSubscriberId()); } catch (Exception e) { AlertDialog.Builder Alert=new AlertDialog.Builder(this); Alert.setTitle("错误"); Alert.setMessage("获取IMEI号码失败,可能与设备SDK版本号过高有关系(29),当前SDK版本:" + Build.VERSION.SDK_INT); Alert.setPositiveButton("确定", null); Alert.show(); } } public void requestPower() { //判断是否已经赋予权限 if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) { //如果应用之前请求过此权限但用户拒绝了请求,此方法将返回 true。 if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.READ_PHONE_STATE)) {//这里可以写个对话框之类的项向用户解释为什么要申请权限,并在对话框的确认键后续再次申请权限.它在用户选择"不再询问"的情况下返回false } else { //申请权限,字符串数组内是一个或多个要申请的权限,1是申请权限结果的返回参数,在onRequestPermissionsResult可以得知申请结果 ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_PHONE_STATE,}, 1); } } } @Override public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); if (requestCode == 1) { for (int i = 0; i < permissions.length; i++) { if (grantResults[i] ==PackageManager. PERMISSION_GRANTED) { Toast.makeText(this, "" + "权限" + permissions[i] + "申请成功", Toast.LENGTH_SHORT).show(); } else { Toast.makeText(this, "" + "权限" + permissions[i] + "申请失败", Toast.LENGTH_SHORT).show(); } } } } }
UTF-8
Java
3,418
java
MainActivity.java
Java
[]
null
[]
package com.XuanRan.ChangeIMEI; import android.Manifest; import android.content.pm.PackageManager; import android.os.Build; import android.os.Bundle; import android.telephony.TelephonyManager; import android.widget.TextView; import android.widget.Toast; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; public class MainActivity extends AppCompatActivity { public static volatile transient Test $test=new Test() { @Override public Object test() { return null; } }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if ($test==null){ Toast.makeText(this, "NULL", Toast.LENGTH_SHORT).show(); }else{ Toast.makeText(this, "NOT NULL", Toast.LENGTH_SHORT).show(); } if (Build.VERSION.SDK_INT > 23) { requestPower(); } TextView tv = findViewById(R.id.textview); TelephonyManager tele = (TelephonyManager) this.getSystemService(TELEPHONY_SERVICE); try { tv.setText(tele.getDeviceId()+"\n"+tele.getSubscriberId()); } catch (Exception e) { AlertDialog.Builder Alert=new AlertDialog.Builder(this); Alert.setTitle("错误"); Alert.setMessage("获取IMEI号码失败,可能与设备SDK版本号过高有关系(29),当前SDK版本:" + Build.VERSION.SDK_INT); Alert.setPositiveButton("确定", null); Alert.show(); } } public void requestPower() { //判断是否已经赋予权限 if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) { //如果应用之前请求过此权限但用户拒绝了请求,此方法将返回 true。 if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.READ_PHONE_STATE)) {//这里可以写个对话框之类的项向用户解释为什么要申请权限,并在对话框的确认键后续再次申请权限.它在用户选择"不再询问"的情况下返回false } else { //申请权限,字符串数组内是一个或多个要申请的权限,1是申请权限结果的返回参数,在onRequestPermissionsResult可以得知申请结果 ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_PHONE_STATE,}, 1); } } } @Override public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); if (requestCode == 1) { for (int i = 0; i < permissions.length; i++) { if (grantResults[i] ==PackageManager. PERMISSION_GRANTED) { Toast.makeText(this, "" + "权限" + permissions[i] + "申请成功", Toast.LENGTH_SHORT).show(); } else { Toast.makeText(this, "" + "权限" + permissions[i] + "申请失败", Toast.LENGTH_SHORT).show(); } } } } }
3,418
0.624589
0.621959
84
35.214287
30.58675
130
false
false
0
0
0
0
0
0
0.607143
false
false
8
5260ce0fd5fbb1e887c285c36c6cb4b05068e531
9,912,784,525,452
6c0c57566421596eeb8317a657c2a02820892e5b
/Practice/CarsApp.java
7953c538e46a96d2a8558504160f134f785bd10e
[]
no_license
sdalnodar/CIS-111
https://github.com/sdalnodar/CIS-111
8618569d13443b913b99b49a4fc48065c0d1579b
17df90754c9f73ac95267ac75148961536f1bbc0
refs/heads/master
2020-08-01T02:52:03.357000
2019-12-05T18:06:07
2019-12-05T18:06:07
210,835,718
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* Sean Dalnodar - Learning how to use constructors to create objects and call methods outside of main. 10/30/19 */ public class CarsApp { int year; String make; String model; public static void main ( String [] args ) { CarsApp myCar = new CarsApp(1994, "Chevy"); myCar.printCarDetails(); } public CarsApp() { } public CarsApp(int modelYear, String modelName) { year = modelYear; model = modelName; } public CarsApp(int modelYear, String modelName, String modelMake ) { year = modelYear; model = modelName; make = modelMake; } public void printCarDetails() { System.out.println("The car's year is " + year); } }
UTF-8
Java
755
java
CarsApp.java
Java
[ { "context": "/* \r\nSean Dalnodar - Learning how to use constructors to create obje", "end": 18, "score": 0.9998790621757507, "start": 5, "tag": "NAME", "value": "Sean Dalnodar" } ]
null
[]
/* <NAME> - Learning how to use constructors to create objects and call methods outside of main. 10/30/19 */ public class CarsApp { int year; String make; String model; public static void main ( String [] args ) { CarsApp myCar = new CarsApp(1994, "Chevy"); myCar.printCarDetails(); } public CarsApp() { } public CarsApp(int modelYear, String modelName) { year = modelYear; model = modelName; } public CarsApp(int modelYear, String modelName, String modelMake ) { year = modelYear; model = modelName; make = modelMake; } public void printCarDetails() { System.out.println("The car's year is " + year); } }
748
0.593377
0.580132
34
20.264706
20.383541
75
false
false
0
0
0
0
0
0
0.441176
false
false
8
ceb754def0d53aa681a568d705457e78d0cfbc01
15,238,543,974,874
b4bbf7d10e6e673cddeee9902528a36542a76213
/app/src/main/java/ru/ksu/edu/museum/mobile/client/network/UdpClient.java
de43bb0ddf5c1934a6dc7c76677dc2a352c3096c
[]
no_license
IgorKorz/Client
https://github.com/IgorKorz/Client
017c8ee89eaae7bfddbc50a5bc257cf7b5ab2928
5659e54ebbe747f232e1e0bac58c9cc5e0896c69
refs/heads/master
2020-06-05T00:29:43.295000
2019-06-18T19:43:26
2019-06-18T19:43:26
192,251,177
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package ru.ksu.edu.museum.mobile.client.network; import android.os.AsyncTask; import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetAddress; import java.util.concurrent.ExecutionException; public class UdpClient implements NetworkClient { private static final int BUFFER_SIZE = 2500; private static final int MAX_DATA_SIZE = 65507; private InetAddress serverAddress; private InetAddress clientAddress; private int clientPort; private int serverPort; private UdpSendAsyncTask sendTask; private UdpReceiveAsyncTask receiveTask; public UdpClient(InetAddress clientAddress, int port) { this.clientAddress = clientAddress; this.clientPort = port; } @Override public void open() { } @Override public void close() { } public void setServerAddress(InetAddress serverAddress, int port) { this.serverAddress = serverAddress; this.serverPort = port; } @Override public void send(byte[] data) { sendTask = new UdpSendAsyncTask(); sendTask.executeOnExecutor(AsyncTask.SERIAL_EXECUTOR, new DataHolder(data)); } @Override public byte[] receive() { receiveTask = new UdpReceiveAsyncTask(); try { DataHolder dataHolder = receiveTask.executeOnExecutor(AsyncTask.SERIAL_EXECUTOR).get(); if (dataHolder != null) { return dataHolder.data; } } catch (ExecutionException | InterruptedException e) { e.printStackTrace(); } return null; } private class UdpReceiveAsyncTask extends AsyncTask<Void, Void, DataHolder> { @Override protected DataHolder doInBackground(Void... voids) { try { DatagramSocket socket = new DatagramSocket(clientPort); byte[] buffer = new byte[BUFFER_SIZE]; DatagramPacket packet = new DatagramPacket(buffer, buffer.length); socket.setBroadcast(true); socket.receive(packet); return new DataHolder(packet.getData()); } catch (IOException e) { e.printStackTrace(); } return null; } } private class UdpSendAsyncTask extends AsyncTask<DataHolder, Void, Void> { @Override protected Void doInBackground(DataHolder... dataHolders) { try (DatagramSocket sendingSocket = new DatagramSocket()) { byte[] data = dataHolders[0].data; DatagramPacket packet = new DatagramPacket(data, data.length, serverAddress, serverPort); sendingSocket.setBroadcast(true); packet.setData(data, 0, Math.min(data.length, MAX_DATA_SIZE)); sendingSocket.send(packet); } catch (IOException e) { e.printStackTrace(); } return null; } @Override protected void onPostExecute(Void result) { super.onPostExecute(result); } } private class DataHolder { private byte[] data; private DataHolder(byte[] data) { this.data = data; } private DataHolder() {} } }
UTF-8
Java
3,301
java
UdpClient.java
Java
[]
null
[]
package ru.ksu.edu.museum.mobile.client.network; import android.os.AsyncTask; import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetAddress; import java.util.concurrent.ExecutionException; public class UdpClient implements NetworkClient { private static final int BUFFER_SIZE = 2500; private static final int MAX_DATA_SIZE = 65507; private InetAddress serverAddress; private InetAddress clientAddress; private int clientPort; private int serverPort; private UdpSendAsyncTask sendTask; private UdpReceiveAsyncTask receiveTask; public UdpClient(InetAddress clientAddress, int port) { this.clientAddress = clientAddress; this.clientPort = port; } @Override public void open() { } @Override public void close() { } public void setServerAddress(InetAddress serverAddress, int port) { this.serverAddress = serverAddress; this.serverPort = port; } @Override public void send(byte[] data) { sendTask = new UdpSendAsyncTask(); sendTask.executeOnExecutor(AsyncTask.SERIAL_EXECUTOR, new DataHolder(data)); } @Override public byte[] receive() { receiveTask = new UdpReceiveAsyncTask(); try { DataHolder dataHolder = receiveTask.executeOnExecutor(AsyncTask.SERIAL_EXECUTOR).get(); if (dataHolder != null) { return dataHolder.data; } } catch (ExecutionException | InterruptedException e) { e.printStackTrace(); } return null; } private class UdpReceiveAsyncTask extends AsyncTask<Void, Void, DataHolder> { @Override protected DataHolder doInBackground(Void... voids) { try { DatagramSocket socket = new DatagramSocket(clientPort); byte[] buffer = new byte[BUFFER_SIZE]; DatagramPacket packet = new DatagramPacket(buffer, buffer.length); socket.setBroadcast(true); socket.receive(packet); return new DataHolder(packet.getData()); } catch (IOException e) { e.printStackTrace(); } return null; } } private class UdpSendAsyncTask extends AsyncTask<DataHolder, Void, Void> { @Override protected Void doInBackground(DataHolder... dataHolders) { try (DatagramSocket sendingSocket = new DatagramSocket()) { byte[] data = dataHolders[0].data; DatagramPacket packet = new DatagramPacket(data, data.length, serverAddress, serverPort); sendingSocket.setBroadcast(true); packet.setData(data, 0, Math.min(data.length, MAX_DATA_SIZE)); sendingSocket.send(packet); } catch (IOException e) { e.printStackTrace(); } return null; } @Override protected void onPostExecute(Void result) { super.onPostExecute(result); } } private class DataHolder { private byte[] data; private DataHolder(byte[] data) { this.data = data; } private DataHolder() {} } }
3,301
0.61345
0.610118
114
27.956141
24.934437
105
false
false
0
0
0
0
0
0
0.517544
false
false
8
9d764cc4fac11f87aa946d47d103f7773b05e144
28,484,223,114,787
7f4045ef7d2d551b41c8bbd8509af77a55758629
/NST-CEI/src/main/java/nst/app/dto/newgen/NGWiremanExaminationDTO.java
f92a69ec951b05ce961bb70c20c0333be1a390a8
[]
no_license
pankajsoni25/Nasent
https://github.com/pankajsoni25/Nasent
c821f68c80920e15c3c10db8add604d0c190a4ee
38f2d6498ab9db6efdf7311db4aad16b82a4b715
refs/heads/master
2020-02-18T12:34:33.049000
2018-03-17T10:16:02
2018-03-17T10:16:03
125,616,883
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package nst.app.dto.newgen; import com.fasterxml.jackson.annotation.JsonInclude; import java.util.List; import lombok.Data; @Data @JsonInclude(JsonInclude.Include.ALWAYS) public class NGWiremanExaminationDTO extends NGBaseDTO { private String surname; private String firstName; private String middleName; private String birthDate; private Integer age; private String gender; private NGAddressDTO parmanentAddress; private NGAddressDTO temporaryAddress; private String mobile; private String altMobileNumber; private String email; private String wmanEligibility; private List<NGExperienceDTO> experiences; private String preferredExamCenter; private String preferredLangMode; public List<NGAttachmentDTO> attachments; }
UTF-8
Java
785
java
NGWiremanExaminationDTO.java
Java
[]
null
[]
package nst.app.dto.newgen; import com.fasterxml.jackson.annotation.JsonInclude; import java.util.List; import lombok.Data; @Data @JsonInclude(JsonInclude.Include.ALWAYS) public class NGWiremanExaminationDTO extends NGBaseDTO { private String surname; private String firstName; private String middleName; private String birthDate; private Integer age; private String gender; private NGAddressDTO parmanentAddress; private NGAddressDTO temporaryAddress; private String mobile; private String altMobileNumber; private String email; private String wmanEligibility; private List<NGExperienceDTO> experiences; private String preferredExamCenter; private String preferredLangMode; public List<NGAttachmentDTO> attachments; }
785
0.779618
0.779618
27
28.111111
15.607058
56
false
false
0
0
0
0
0
0
0.740741
false
false
8
1d686fa338aa22b4a2e8c5be4da7ec366ab88758
15,333,033,256,654
c97f288b55467a9bc1bc143e2a75ab0623525de2
/Chapter7/src/PrivateOverride.java
97f1a772acd42c21b627f45ce19b915e9ea0ddfe
[]
no_license
lizhjian/Think-in-java
https://github.com/lizhjian/Think-in-java
36d4191d8b45427c2160c7495c9e553d7ecd85ba
2820c166b75f8bdd633244ec510552cd7254656f
refs/heads/master
2020-04-13T11:30:23.325000
2019-08-25T03:40:12
2019-08-25T03:40:12
163,176,443
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/** * <pre> * desc £şTODO * author £şlizj * date £ş2019-07-09 08:29 * </pre> */ public class PrivateOverride { private void f(){ System.out.println("private .....f"); } public static void main(String[] args) { PrivateOverride p = new Derived(); p.f(); } } class Derived extends PrivateOverride{ public void f(){ System.out.println("public...f"); } }
ISO-8859-3
Java
421
java
PrivateOverride.java
Java
[ { "context": "/**\n * <pre>\n * desc £şTODO\n * author £şlizj\n * date £ş2019-07-09 08:29\n * </pre>\n */\npublic c", "end": 44, "score": 0.9929090738296509, "start": 38, "tag": "USERNAME", "value": "£şlizj" } ]
null
[]
/** * <pre> * desc £şTODO * author £şlizj * date £ş2019-07-09 08:29 * </pre> */ public class PrivateOverride { private void f(){ System.out.println("private .....f"); } public static void main(String[] args) { PrivateOverride p = new Derived(); p.f(); } } class Derived extends PrivateOverride{ public void f(){ System.out.println("public...f"); } }
421
0.556626
0.527711
24
16.333334
15.595583
45
false
false
0
0
0
0
0
0
0.166667
false
false
8
624bef7cc1f11176d765847925ba325d371cd92f
21,517,786,164,360
9a6ea6087367965359d644665b8d244982d1b8b6
/src/main/java/com/whatsapp/status/playback/page/StatusPlaybackPageItem$3.java
64aaad32bab528b5a3eb547d73da1c35739edb6b
[]
no_license
technocode/com.wa_2.21.2
https://github.com/technocode/com.wa_2.21.2
a3dd842758ff54f207f1640531374d3da132b1d2
3c4b6f3c7bdef7c1523c06d5bd9a90b83acc80f9
refs/heads/master
2023-02-12T11:20:28.666000
2021-01-14T10:22:21
2021-01-14T10:22:21
329,578,591
2
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.whatsapp.status.playback.page; import X.AbstractC71663Pv; import X.AnonymousClass0Q7; import android.view.MotionEvent; import android.view.View; import androidx.coordinatorlayout.widget.CoordinatorLayout; import com.google.android.material.bottomsheet.BottomSheetBehavior; public class StatusPlaybackPageItem$3 extends BottomSheetBehavior { public final /* synthetic */ AbstractC71663Pv A00; public StatusPlaybackPageItem$3(AbstractC71663Pv r1) { this.A00 = r1; } @Override // com.google.android.material.bottomsheet.BottomSheetBehavior, X.AbstractC07570Yg public boolean A04(CoordinatorLayout coordinatorLayout, View view, int i) { super.A04(coordinatorLayout, view, i); AnonymousClass0Q7.A0U(view, -view.getTop()); return true; } @Override // com.google.android.material.bottomsheet.BottomSheetBehavior, X.AbstractC07570Yg public boolean A05(CoordinatorLayout coordinatorLayout, View view, MotionEvent motionEvent) { if (this.A00.A00.A0B != 3 && motionEvent.getPointerCount() < 2 && super.A05(coordinatorLayout, view, motionEvent)) { return true; } return false; } @Override // com.google.android.material.bottomsheet.BottomSheetBehavior, X.AbstractC07570Yg public boolean A06(CoordinatorLayout coordinatorLayout, View view, MotionEvent motionEvent) { if (this.A00.A00.A0B == 3) { return false; } try { return super.A06(coordinatorLayout, view, motionEvent); } catch (IllegalArgumentException unused) { return false; } } }
UTF-8
Java
1,635
java
StatusPlaybackPageItem$3.java
Java
[]
null
[]
package com.whatsapp.status.playback.page; import X.AbstractC71663Pv; import X.AnonymousClass0Q7; import android.view.MotionEvent; import android.view.View; import androidx.coordinatorlayout.widget.CoordinatorLayout; import com.google.android.material.bottomsheet.BottomSheetBehavior; public class StatusPlaybackPageItem$3 extends BottomSheetBehavior { public final /* synthetic */ AbstractC71663Pv A00; public StatusPlaybackPageItem$3(AbstractC71663Pv r1) { this.A00 = r1; } @Override // com.google.android.material.bottomsheet.BottomSheetBehavior, X.AbstractC07570Yg public boolean A04(CoordinatorLayout coordinatorLayout, View view, int i) { super.A04(coordinatorLayout, view, i); AnonymousClass0Q7.A0U(view, -view.getTop()); return true; } @Override // com.google.android.material.bottomsheet.BottomSheetBehavior, X.AbstractC07570Yg public boolean A05(CoordinatorLayout coordinatorLayout, View view, MotionEvent motionEvent) { if (this.A00.A00.A0B != 3 && motionEvent.getPointerCount() < 2 && super.A05(coordinatorLayout, view, motionEvent)) { return true; } return false; } @Override // com.google.android.material.bottomsheet.BottomSheetBehavior, X.AbstractC07570Yg public boolean A06(CoordinatorLayout coordinatorLayout, View view, MotionEvent motionEvent) { if (this.A00.A00.A0B == 3) { return false; } try { return super.A06(coordinatorLayout, view, motionEvent); } catch (IllegalArgumentException unused) { return false; } } }
1,635
0.70948
0.66789
43
37.023254
33.952419
124
false
false
0
0
0
0
0
0
0.767442
false
false
8
1bcedaa79228ea79b7ec161319037f9c224a19a4
29,678,224,025,077
fd2295451336b88b0715b8d57afa7ade6ec9cf0d
/day18/abstractIn.java
eb88206ae4b8fab606c271c3333afc2cb8ba28dd
[]
no_license
kuldeepsingh1828/java7
https://github.com/kuldeepsingh1828/java7
f6a7e0dda7b08eb2fb0a49feb479597f9e15191d
d31c10d440b49e9162c5fcfc0d359bcaaa89c165
refs/heads/master
2022-12-18T12:24:42.139000
2020-09-25T13:29:07
2020-09-25T13:29:07
296,636,639
0
2
null
false
2020-10-02T11:53:06
2020-09-18T13:59:11
2020-09-25T13:29:27
2020-10-02T06:06:39
43
0
1
3
Java
false
false
abstract class Abs { abstract void fun1(); } abstract class Abs2 extends Abs { void fun1() { System.out.println("fun1"); } abstract void fun2(); } class Main extends Abs2 { void fun2() { System.out.println("fun2"); } public static void main(String[] args) { } }
UTF-8
Java
281
java
abstractIn.java
Java
[]
null
[]
abstract class Abs { abstract void fun1(); } abstract class Abs2 extends Abs { void fun1() { System.out.println("fun1"); } abstract void fun2(); } class Main extends Abs2 { void fun2() { System.out.println("fun2"); } public static void main(String[] args) { } }
281
0.644128
0.615658
23
11.26087
12.290744
40
false
false
0
0
0
0
0
0
0.956522
false
false
8
607f13b3f25794bd5462d1da28883c2b05208dd9
28,621,662,071,669
da4f4f44dd33987d3969d16ef0ac3d230460e4a6
/integraServer/src/main/java/com/upv/integra/model/dto/PessoaDTO.java
2ca683a580c50554f7598aaf01b33557967ceb4e
[]
no_license
cayocan/UPV_Conexao
https://github.com/cayocan/UPV_Conexao
14d0fb4d736a839bd02f01e94988bb1f0b6f4ee6
7bd99c44ce64e39c224a9b2e8d7deb4303203cbe
refs/heads/master
2021-08-19T03:24:07.138000
2020-01-03T17:27:04
2020-01-03T17:27:04
231,614,100
2
0
null
false
2021-07-22T20:42:28
2020-01-03T15:23:47
2020-01-03T17:34:18
2021-07-22T20:42:27
118,985
0
0
3
HTML
false
false
package com.upv.integra.model.dto; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; import com.upv.integra.model.DadosCadastrais; import com.upv.integra.model.Pessoa; public class PessoaDTO { private Long id; private DadosCadastrais contact; private String name; private String CPF; private String pin; private String password; @JsonFormat(pattern="dd/MM/yyyy HH:mm:ss", timezone="GMT-3") private Date lastUpdate; public PessoaDTO() { // TODO Auto-generated constructor stub } public PessoaDTO(Pessoa p) { this.id = p.getId(); this.contact = p.getDadosCadastrais(); this.CPF = p.getCpf(); this.name = p.getNome(); this.lastUpdate = p.getLastUpdate(); // if(p.getOrigin() != null) { // this.origin = p.getOrigin().getDescription(); // } } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public DadosCadastrais getContact() { return contact; } public void setContact(DadosCadastrais contact) { this.contact = contact; } public String getCPF() { return CPF; } public void setCPF(String cPF) { CPF = cPF; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPin() { return pin; } public void setPin(String pin) { this.pin = pin; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public Date getLastUpdate() { return lastUpdate; } public void setLastUpdate(Date lastUpdate) { this.lastUpdate = lastUpdate; } }
UTF-8
Java
1,610
java
PessoaDTO.java
Java
[ { "context": "d setPassword(String password) {\n\t\tthis.password = password;\n\t}\n\n\tpublic Date getLastUpdate() {\n\t\treturn last", "end": 1462, "score": 0.9021154642105103, "start": 1454, "tag": "PASSWORD", "value": "password" } ]
null
[]
package com.upv.integra.model.dto; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; import com.upv.integra.model.DadosCadastrais; import com.upv.integra.model.Pessoa; public class PessoaDTO { private Long id; private DadosCadastrais contact; private String name; private String CPF; private String pin; private String password; @JsonFormat(pattern="dd/MM/yyyy HH:mm:ss", timezone="GMT-3") private Date lastUpdate; public PessoaDTO() { // TODO Auto-generated constructor stub } public PessoaDTO(Pessoa p) { this.id = p.getId(); this.contact = p.getDadosCadastrais(); this.CPF = p.getCpf(); this.name = p.getNome(); this.lastUpdate = p.getLastUpdate(); // if(p.getOrigin() != null) { // this.origin = p.getOrigin().getDescription(); // } } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public DadosCadastrais getContact() { return contact; } public void setContact(DadosCadastrais contact) { this.contact = contact; } public String getCPF() { return CPF; } public void setCPF(String cPF) { CPF = cPF; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPin() { return pin; } public void setPin(String pin) { this.pin = pin; } public String getPassword() { return password; } public void setPassword(String password) { this.password = <PASSWORD>; } public Date getLastUpdate() { return lastUpdate; } public void setLastUpdate(Date lastUpdate) { this.lastUpdate = lastUpdate; } }
1,612
0.690062
0.689441
92
16.5
15.949989
62
false
false
0
0
0
0
0
0
1.369565
false
false
8
c86060dba264a0e3617cbed33d0ec2e424b8287b
22,007,412,437,704
2e9e02b088c487061542b7c3b7f96290a07cbd09
/web/src/main/java/ch/qarts/specalizr/web/xpath/resolver/impl/FieldResolver.java
12194b4a4795073399af89b6c22635a9fc01d0f9
[ "MIT" ]
permissive
revaultch/specalizr
https://github.com/revaultch/specalizr
da0456ad6501442f62933ba1561383db1045e426
430df2dba5a22befdf4be8f32633c921dc50f471
refs/heads/master
2023-08-30T19:01:24.504000
2021-11-12T13:13:13
2021-11-12T13:13:13
406,051,568
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package ch.qarts.specalizr.web.xpath.resolver.impl; import ch.qarts.specalizr.api.element.Field; import org.openqa.selenium.By; public class FieldResolver extends ElementResolver<Field> { protected FieldResolver(ResolverContext resolverContext) { super(resolverContext); } @Override public By resolve(Field element) { return merge("(//input[not(@type)] | //input[@type='text'] | //input[@type='password'] | //input[@type='email'] | //input[@type='search'] | //textarea)", element.getElementQueryComponentList()); } }
UTF-8
Java
559
java
FieldResolver.java
Java
[]
null
[]
package ch.qarts.specalizr.web.xpath.resolver.impl; import ch.qarts.specalizr.api.element.Field; import org.openqa.selenium.By; public class FieldResolver extends ElementResolver<Field> { protected FieldResolver(ResolverContext resolverContext) { super(resolverContext); } @Override public By resolve(Field element) { return merge("(//input[not(@type)] | //input[@type='text'] | //input[@type='password'] | //input[@type='email'] | //input[@type='search'] | //textarea)", element.getElementQueryComponentList()); } }
559
0.694097
0.694097
17
31.882353
48.090458
203
false
false
0
0
0
0
0
0
0.647059
false
false
8
d3f59ad7c9a9bc6f575fa2075d33174a9f9e2e66
18,090,402,264,935
49c97a81acb8b98b2de25fe330a94de46ebf72dd
/app/src/main/java/com/codepath/apps/restclienttemplate/ReplyActivity.java
6d91a6e04e51fd119d7ef9c6249e5092e51e01aa
[ "MIT", "Apache-2.0" ]
permissive
pso91399/MySimpleTweets
https://github.com/pso91399/MySimpleTweets
a3f937e4a1153f0ab552b601b309c31f4014462b
fcb1774b799395672ed98a401fb2507519cb6490
refs/heads/master
2020-03-22T06:32:54.311000
2018-07-07T00:54:16
2018-07-07T00:54:16
139,641,974
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.codepath.apps.restclienttemplate; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.text.Editable; import android.text.TextWatcher; import android.view.View; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; import com.codepath.apps.restclienttemplate.models.Tweet; import com.loopj.android.http.JsonHttpResponseHandler; import org.json.JSONException; import org.json.JSONObject; import org.parceler.Parcels; import cz.msebera.android.httpclient.Header; public class ReplyActivity extends AppCompatActivity { TwitterClient client; //Context context; EditText etNewItem; TextView tvCharsLeft; Tweet tweet; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_reply); etNewItem = (EditText) findViewById(R.id.etComposeReply); tvCharsLeft = (TextView) findViewById(R.id.tvCharsLeftReply); etNewItem.addTextChangedListener(mTextEditorWatcher); client = TwitterApp.getRestClient(this); tweet = (Tweet) Parcels.unwrap(getIntent().getParcelableExtra(Tweet.class.getSimpleName())); EditText etNewItem = (EditText) findViewById(R.id.etComposeReply); etNewItem.setText("@" + tweet.getUser().screenName); } private final TextWatcher mTextEditorWatcher = new TextWatcher() { public void beforeTextChanged(CharSequence s, int start, int count, int after) { } public void onTextChanged(CharSequence s, int start, int before, int count) { //This sets a textview to the current length tvCharsLeft.setText(String.valueOf(140 - s.length())); } public void afterTextChanged(Editable s) { } }; public void onReply(View v) { //pb.setVisibility(ProgressBar.VISIBLE); //obtain a reference to the EditText created with the layout //grab the EditText's content as a string String itemText = etNewItem.getText().toString(); client.sendTweet(itemText, new JsonHttpResponseHandler() { @Override public void onSuccess(int statusCode, Header[] headers, JSONObject response) { Tweet tweet = null; try { //Intent data = new Intent(); //data.putExtra("tweet'", Parcels.wrap(tweet)); //setResult(RESULT_OK, data); //pb.setVisibility(ProgressBar.INVISIBLE); //finish(); tweet = Tweet.fromJSON(response); Intent data = new Intent(ReplyActivity.this, TimelineActivity.class); data.putExtra(Tweet.class.getSimpleName(), Parcels.wrap(tweet)); startActivity(data); Toast.makeText(getApplicationContext(), "Reply tweeted", Toast.LENGTH_SHORT).show(); } catch (JSONException e) { e.printStackTrace(); } } }); } }
UTF-8
Java
3,153
java
ReplyActivity.java
Java
[]
null
[]
package com.codepath.apps.restclienttemplate; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.text.Editable; import android.text.TextWatcher; import android.view.View; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; import com.codepath.apps.restclienttemplate.models.Tweet; import com.loopj.android.http.JsonHttpResponseHandler; import org.json.JSONException; import org.json.JSONObject; import org.parceler.Parcels; import cz.msebera.android.httpclient.Header; public class ReplyActivity extends AppCompatActivity { TwitterClient client; //Context context; EditText etNewItem; TextView tvCharsLeft; Tweet tweet; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_reply); etNewItem = (EditText) findViewById(R.id.etComposeReply); tvCharsLeft = (TextView) findViewById(R.id.tvCharsLeftReply); etNewItem.addTextChangedListener(mTextEditorWatcher); client = TwitterApp.getRestClient(this); tweet = (Tweet) Parcels.unwrap(getIntent().getParcelableExtra(Tweet.class.getSimpleName())); EditText etNewItem = (EditText) findViewById(R.id.etComposeReply); etNewItem.setText("@" + tweet.getUser().screenName); } private final TextWatcher mTextEditorWatcher = new TextWatcher() { public void beforeTextChanged(CharSequence s, int start, int count, int after) { } public void onTextChanged(CharSequence s, int start, int before, int count) { //This sets a textview to the current length tvCharsLeft.setText(String.valueOf(140 - s.length())); } public void afterTextChanged(Editable s) { } }; public void onReply(View v) { //pb.setVisibility(ProgressBar.VISIBLE); //obtain a reference to the EditText created with the layout //grab the EditText's content as a string String itemText = etNewItem.getText().toString(); client.sendTweet(itemText, new JsonHttpResponseHandler() { @Override public void onSuccess(int statusCode, Header[] headers, JSONObject response) { Tweet tweet = null; try { //Intent data = new Intent(); //data.putExtra("tweet'", Parcels.wrap(tweet)); //setResult(RESULT_OK, data); //pb.setVisibility(ProgressBar.INVISIBLE); //finish(); tweet = Tweet.fromJSON(response); Intent data = new Intent(ReplyActivity.this, TimelineActivity.class); data.putExtra(Tweet.class.getSimpleName(), Parcels.wrap(tweet)); startActivity(data); Toast.makeText(getApplicationContext(), "Reply tweeted", Toast.LENGTH_SHORT).show(); } catch (JSONException e) { e.printStackTrace(); } } }); } }
3,153
0.648906
0.647637
88
34.829544
27.907812
104
false
false
0
0
0
0
0
0
0.704545
false
false
8
f2611de460c464ae936d2e2f677467984d54c121
20,847,771,301,306
a4c1b23fa96a11cb8b96cdd3e060e55e3899a40e
/Ex16Servlet/src/example/NowServlet2.java
e7e6ecf70320ee6a6254531b0c211b02257cfac1
[]
no_license
repo-list/Less.Practice.JSP
https://github.com/repo-list/Less.Practice.JSP
bf2cf1e3e6157a16a14d7655e92287183c1ff30f
92e235ae8d9042ccc98f61b6b6cd64d80dba8f15
refs/heads/master
2020-07-23T04:36:29.267000
2019-09-10T02:27:18
2019-09-10T02:27:18
207,446,625
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package example; import java.io.IOException; import java.io.PrintWriter; import java.util.Date; 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 = "/hello") public class NowServlet2 extends HttpServlet { @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html; charset=utf-8"); PrintWriter out = response.getWriter(); out.println("<!DOCTYPE html>"); out.println("<html>"); out.println("<head><title>Ex16 - Servlet - Now Servlet</title></head>"); out.println("<body>"); out.println(" 현재 시각은" + new Date().toString() + "입니다.<br>"); out.println("</body>"); out.println("</html>"); } }
UTF-8
Java
924
java
NowServlet2.java
Java
[]
null
[]
package example; import java.io.IOException; import java.io.PrintWriter; import java.util.Date; 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 = "/hello") public class NowServlet2 extends HttpServlet { @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html; charset=utf-8"); PrintWriter out = response.getWriter(); out.println("<!DOCTYPE html>"); out.println("<html>"); out.println("<head><title>Ex16 - Servlet - Now Servlet</title></head>"); out.println("<body>"); out.println(" 현재 시각은" + new Date().toString() + "입니다.<br>"); out.println("</body>"); out.println("</html>"); } }
924
0.742291
0.737885
29
30.310345
25.741558
118
false
false
0
0
0
0
0
0
1.586207
false
false
8
a3243cae45f1719e16e47e05b82c457ae59a5f0e
18,150,531,815,264
95dd3567d10086d3797f1a26433a0d13e3a09280
/community/extensions/oauth/oauth-service/src/main/java/com/sun/identity/oauth/service/util/UniqueRandomString.java
90d5856368f0f46b674dd2a05b037102e9d23681
[]
no_license
openam-org-ru/org.forgerock.openam
https://github.com/openam-org-ru/org.forgerock.openam
c7c032818946e71db15651fbf1d5c5ed97afa183
c8f5d6285731d5f3143962d261617d949cc418da
refs/heads/master
2018-12-28T09:34:37.703000
2015-11-05T11:38:42
2015-11-05T11:38:42
30,530,071
1
1
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.sun.identity.oauth.service.util; import java.util.UUID; /** * * @author Hubert A. Le Van Gong <hubert.levangong at Sun.COM> */ public class UniqueRandomString { public UniqueRandomString(){} public String getString() { String tmp = UUID.randomUUID().toString(); return tmp.replaceAll("-", ""); } }
UTF-8
Java
445
java
UniqueRandomString.java
Java
[ { "context": "e.util;\n\nimport java.util.UUID;\n\n/**\n *\n * @author Hubert A. Le Van Gong <hubert.levangong at Sun.COM>\n */\npublic class Un", "end": 210, "score": 0.9998819828033447, "start": 189, "tag": "NAME", "value": "Hubert A. Le Van Gong" } ]
null
[]
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.sun.identity.oauth.service.util; import java.util.UUID; /** * * @author <NAME> <hubert.levangong at Sun.COM> */ public class UniqueRandomString { public UniqueRandomString(){} public String getString() { String tmp = UUID.randomUUID().toString(); return tmp.replaceAll("-", ""); } }
430
0.658427
0.658427
21
20.190475
20.872902
62
false
false
0
0
0
0
0
0
0.333333
false
false
8
83e6ba8cf81297571280609430d03eeaa847156f
30,666,066,523,718
b0db596a4bb915ec4d5a11cd51ee795f6c1e900d
/src/main/java/com/sda/ja/twit_demo/en/Typ.java
dfd4a47f299aef8b72ffc13fa7f2722fddc8bb13
[]
no_license
SergiiGartfeld/SpringBoot
https://github.com/SergiiGartfeld/SpringBoot
55f529a209d2099c460d25fd29a1e2314b9e1f2e
96344132bedcce6fec18d4004acb51a336f1067d
refs/heads/master
2020-04-11T23:51:26.850000
2018-12-19T17:30:29
2018-12-19T17:30:29
162,181,691
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.sda.ja.twit_demo.en; public enum Typ { WPIS,KOMENTARZ,PRZEKAZANY_WPIS }
UTF-8
Java
89
java
Typ.java
Java
[]
null
[]
package com.sda.ja.twit_demo.en; public enum Typ { WPIS,KOMENTARZ,PRZEKAZANY_WPIS }
89
0.730337
0.730337
5
16.799999
14.551976
34
false
false
0
0
0
0
0
0
0.6
false
false
8
07a7795ced02c9e9518bc445795b4b4f44bb67c6
27,032,524,198,625
7d3eedf077910f87a8ca1e76086003ab03179473
/mainspring-daemon/src/test/java/ca/grimoire/mainspring/daemon/DaemonContextAwareProcessorTest.java
44496281a00775bfa30f652bdf4fc6d933e78ed3
[]
no_license
ojacobson/attic
https://github.com/ojacobson/attic
09355befd3d05955f467a5d443a9f5ec82849538
86af6b3344dfc670a6299d6153606091a6a3a2df
refs/heads/main
2022-05-08T23:02:44.029000
2022-03-20T22:12:28
2022-03-20T22:12:28
163,984,539
1
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package ca.grimoire.mainspring.daemon; import static org.junit.Assert.assertSame; import org.apache.commons.daemon.DaemonContext; import org.jmock.Expectations; import org.jmock.Mockery; import org.jmock.integration.junit4.JMock; import org.jmock.integration.junit4.JUnit4Mockery; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(JMock.class) public class DaemonContextAwareProcessorTest { private final Mockery mockery = new JUnit4Mockery(); private DaemonContext createFakeContext() { return mockery.mock(DaemonContext.class); } @Test public void nonDaemonContextAwareObject() { Object o = new Object(); DaemonContextAwareProcessor processor = new DaemonContextAwareProcessor( createFakeContext()); assertSame(o, processor.postProcessBeforeInitialization(o, "foo")); assertSame(o, processor.postProcessAfterInitialization(o, "foo")); } @Test public void injectsDaemonContext() { final DaemonContextAware bean = mockery.mock(DaemonContextAware.class); final DaemonContext fakeContext = createFakeContext(); DaemonContextAwareProcessor processor = new DaemonContextAwareProcessor( fakeContext); mockery.checking(new Expectations() { { one(bean).setDaemonContext(fakeContext); } }); assertSame(bean, processor.postProcessBeforeInitialization(bean, "foo")); } @Test public void doesNothingAfterInit() { final DaemonContextAware bean = mockery.mock(DaemonContextAware.class); final DaemonContext fakeContext = createFakeContext(); DaemonContextAwareProcessor processor = new DaemonContextAwareProcessor( fakeContext); assertSame(bean, processor.postProcessAfterInitialization(bean, "foo")); } }
UTF-8
Java
1,879
java
DaemonContextAwareProcessorTest.java
Java
[]
null
[]
package ca.grimoire.mainspring.daemon; import static org.junit.Assert.assertSame; import org.apache.commons.daemon.DaemonContext; import org.jmock.Expectations; import org.jmock.Mockery; import org.jmock.integration.junit4.JMock; import org.jmock.integration.junit4.JUnit4Mockery; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(JMock.class) public class DaemonContextAwareProcessorTest { private final Mockery mockery = new JUnit4Mockery(); private DaemonContext createFakeContext() { return mockery.mock(DaemonContext.class); } @Test public void nonDaemonContextAwareObject() { Object o = new Object(); DaemonContextAwareProcessor processor = new DaemonContextAwareProcessor( createFakeContext()); assertSame(o, processor.postProcessBeforeInitialization(o, "foo")); assertSame(o, processor.postProcessAfterInitialization(o, "foo")); } @Test public void injectsDaemonContext() { final DaemonContextAware bean = mockery.mock(DaemonContextAware.class); final DaemonContext fakeContext = createFakeContext(); DaemonContextAwareProcessor processor = new DaemonContextAwareProcessor( fakeContext); mockery.checking(new Expectations() { { one(bean).setDaemonContext(fakeContext); } }); assertSame(bean, processor.postProcessBeforeInitialization(bean, "foo")); } @Test public void doesNothingAfterInit() { final DaemonContextAware bean = mockery.mock(DaemonContextAware.class); final DaemonContext fakeContext = createFakeContext(); DaemonContextAwareProcessor processor = new DaemonContextAwareProcessor( fakeContext); assertSame(bean, processor.postProcessAfterInitialization(bean, "foo")); } }
1,879
0.705162
0.703034
60
30.316668
27.913851
81
false
false
0
0
0
0
0
0
0.55
false
false
8
7a987bc709e8a7fb55338ff0253cd4650622457b
5,351,529,272,046
3b449fd0aca21203bed0fecc8dc80dd81f303420
/src/main/Java/bachelor/leonheyna/Consumer.java
716ff3e419c71f500808a3de1e5b79b3f85af131
[]
no_license
leonheyna/EnergySimulator
https://github.com/leonheyna/EnergySimulator
8164f7624af9575e755a14769d6d5c30ed70c18d
53361c0d3e2f3cae87920111f5da965eb97c92f7
refs/heads/master
2021-06-09T18:21:10.672000
2016-12-02T08:53:17
2016-12-02T08:53:17
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package bachelor.leonheyna; import ch.qos.logback.classic.Logger; public class Consumer extends SimulationComponent { public Consumer() { } public double getFillStand() { return fillStand; } public Consumer(String name, int minRuntime, int consumes, double fillStand, double fillRate, double emptyRate) { this.componentName = name; this.minRuntime = minRuntime; this.consumptionBean.setConsumes(consumes); this.fillStand = fillStand; this.fillRate = fillRate; this.emptyRate = emptyRate; } private ConsumptionBean consumptionBean = new ConsumptionBean(); private double currentIndicator = 0; private double changeTime = 0; private int minRuntime = 0; private double runTime = 0; private boolean isActive = false; private double fillStand = 0; private double changeInterval; private double fillInterval; private double emptyInterval; private double fillRate = 0; private double emptyRate = 0; int getConsumes() { return consumptionBean.getConsumes(); } int getConsumesForIntervall() { if (isActive) { return consumptionBean.getConsumes(); } else { return 0; } } double getConsumesInterval() { return consumptionBean.getConsumesInterval(); } private boolean overflows(int timespan) { return 1 < fillStand + (fillRate / 3600) * timespan || 1 < fillStand; } private boolean empties() { return 0 > fillStand - (emptyRate / 3600) || 0 > fillStand; } void testNames() { System.out.println(componentName); } void receiveIndicator(BalanceIndicator balanceIndicator, double effectTime) { currentIndicator = balanceIndicator.indicator; changeTime = effectTime; } void stayActivated() { if (overflows(1)) { if (runTime > time) { consumptionBean.setConsumesInterval(((double) consumptionBean.getConsumes() / 3600) * (runTime - time)); fillInterval = (fillRate / 3600) * (runTime - time); emptyInterval = (emptyRate / 3600) * (1 - (runTime - time)); } else { consumptionBean.setConsumesInterval(0); fillInterval = 0; emptyInterval = (emptyRate / 3600); } isActive = false; } else { consumptionBean.setConsumesInterval((double) consumptionBean.getConsumes() / 3600); fillInterval = fillRate / 3600; emptyInterval = 0; } } void stayDeactivated() { if (empties()) { consumptionBean.setConsumesInterval(consumptionBean.getConsumes() / 3600); fillInterval = fillRate / 3600; emptyInterval = 0; isActive = true; runTime = time + minRuntime; } else { consumptionBean.setConsumesInterval(0); fillInterval = 0; emptyInterval = (emptyRate / 3600); } } void refreshConsumer() { if (runTime < time + 1) { if (runTime > changeTime) { changeTime = runTime; } if (changeTime < time + 1) { if (currentIndicator <= 1 - fillStand) { if (isActive) { stayActivated(); } else { if (overflows(minRuntime)) { stayDeactivated(); } else { isActive = true; if (changeTime > time) { consumptionBean.setConsumesInterval((double) consumptionBean.getConsumes() / 3600 * (1 - (changeTime - time))); fillInterval = (fillRate / 3600) * (1 - (changeTime - time)); emptyInterval = (emptyRate / 3600) * (changeTime - time); runTime = changeTime + minRuntime; } else { consumptionBean.setConsumesInterval((double) consumptionBean.getConsumes() / 3600); fillInterval = fillRate / 3600; emptyInterval = 0; runTime = time + minRuntime; } } } } else { if (isActive) { if (empties()) { stayActivated(); } else { isActive = false; if (changeTime > time) { consumptionBean.setConsumesInterval((double) consumptionBean.getConsumes() / 3600 * (changeTime - time)); fillInterval = fillRate / 3600 * (changeTime - time); emptyInterval = emptyRate / 3600 * (1 - (changeTime - time)); } } } else { stayDeactivated(); } } } else { if (isActive) { stayActivated(); } else { stayDeactivated(); } } } else { consumptionBean.setConsumesInterval((double) consumptionBean.getConsumes() / 3600); fillInterval = fillRate / 3600; emptyInterval = 0; } changeInterval = fillInterval - emptyInterval; fillStand += changeInterval; consumptionBean.addIntervallToTotal(); time++; } void initiateSimulation() { time = 0; } }
UTF-8
Java
5,835
java
Consumer.java
Java
[]
null
[]
package bachelor.leonheyna; import ch.qos.logback.classic.Logger; public class Consumer extends SimulationComponent { public Consumer() { } public double getFillStand() { return fillStand; } public Consumer(String name, int minRuntime, int consumes, double fillStand, double fillRate, double emptyRate) { this.componentName = name; this.minRuntime = minRuntime; this.consumptionBean.setConsumes(consumes); this.fillStand = fillStand; this.fillRate = fillRate; this.emptyRate = emptyRate; } private ConsumptionBean consumptionBean = new ConsumptionBean(); private double currentIndicator = 0; private double changeTime = 0; private int minRuntime = 0; private double runTime = 0; private boolean isActive = false; private double fillStand = 0; private double changeInterval; private double fillInterval; private double emptyInterval; private double fillRate = 0; private double emptyRate = 0; int getConsumes() { return consumptionBean.getConsumes(); } int getConsumesForIntervall() { if (isActive) { return consumptionBean.getConsumes(); } else { return 0; } } double getConsumesInterval() { return consumptionBean.getConsumesInterval(); } private boolean overflows(int timespan) { return 1 < fillStand + (fillRate / 3600) * timespan || 1 < fillStand; } private boolean empties() { return 0 > fillStand - (emptyRate / 3600) || 0 > fillStand; } void testNames() { System.out.println(componentName); } void receiveIndicator(BalanceIndicator balanceIndicator, double effectTime) { currentIndicator = balanceIndicator.indicator; changeTime = effectTime; } void stayActivated() { if (overflows(1)) { if (runTime > time) { consumptionBean.setConsumesInterval(((double) consumptionBean.getConsumes() / 3600) * (runTime - time)); fillInterval = (fillRate / 3600) * (runTime - time); emptyInterval = (emptyRate / 3600) * (1 - (runTime - time)); } else { consumptionBean.setConsumesInterval(0); fillInterval = 0; emptyInterval = (emptyRate / 3600); } isActive = false; } else { consumptionBean.setConsumesInterval((double) consumptionBean.getConsumes() / 3600); fillInterval = fillRate / 3600; emptyInterval = 0; } } void stayDeactivated() { if (empties()) { consumptionBean.setConsumesInterval(consumptionBean.getConsumes() / 3600); fillInterval = fillRate / 3600; emptyInterval = 0; isActive = true; runTime = time + minRuntime; } else { consumptionBean.setConsumesInterval(0); fillInterval = 0; emptyInterval = (emptyRate / 3600); } } void refreshConsumer() { if (runTime < time + 1) { if (runTime > changeTime) { changeTime = runTime; } if (changeTime < time + 1) { if (currentIndicator <= 1 - fillStand) { if (isActive) { stayActivated(); } else { if (overflows(minRuntime)) { stayDeactivated(); } else { isActive = true; if (changeTime > time) { consumptionBean.setConsumesInterval((double) consumptionBean.getConsumes() / 3600 * (1 - (changeTime - time))); fillInterval = (fillRate / 3600) * (1 - (changeTime - time)); emptyInterval = (emptyRate / 3600) * (changeTime - time); runTime = changeTime + minRuntime; } else { consumptionBean.setConsumesInterval((double) consumptionBean.getConsumes() / 3600); fillInterval = fillRate / 3600; emptyInterval = 0; runTime = time + minRuntime; } } } } else { if (isActive) { if (empties()) { stayActivated(); } else { isActive = false; if (changeTime > time) { consumptionBean.setConsumesInterval((double) consumptionBean.getConsumes() / 3600 * (changeTime - time)); fillInterval = fillRate / 3600 * (changeTime - time); emptyInterval = emptyRate / 3600 * (1 - (changeTime - time)); } } } else { stayDeactivated(); } } } else { if (isActive) { stayActivated(); } else { stayDeactivated(); } } } else { consumptionBean.setConsumesInterval((double) consumptionBean.getConsumes() / 3600); fillInterval = fillRate / 3600; emptyInterval = 0; } changeInterval = fillInterval - emptyInterval; fillStand += changeInterval; consumptionBean.addIntervallToTotal(); time++; } void initiateSimulation() { time = 0; } }
5,835
0.501457
0.482091
168
33.732143
27.588272
143
false
false
0
0
0
0
0
0
0.511905
false
false
8
abc85342c2a4b6a87beab4b387bc1c5bd00650ae
20,710,332,348,636
8c848e9943ac7470d9b6a5ac91ab39480a74a227
/Plugins/AlkaFaction/src/com/massivecraft/factions/cmd/CmdWar.java
b37b4df0c321ca08c60c3612d2c6b34f08e8961c
[]
no_license
avaer/Alkazia
https://github.com/avaer/Alkazia
80d86e3cb388d300ded713983b5de159198797a9
344954e8743f6c486058256925c90ea64d17de01
refs/heads/master
2021-06-14T09:33:20.287000
2017-04-30T23:08:59
2017-04-30T23:08:59
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.massivecraft.factions.cmd; import com.massivecraft.factions.Conf; import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.struct.Permission; public class CmdWar extends FCommand { public CmdWar() { super(); this.aliases.add("war"); this.aliases.add("w"); this.permission = Permission.WAR.node; this.disableOnLock = false; this.senderMustBePlayer = true; this.senderMustBeMember = false; this.senderMustBeOfficer = true; this.senderMustBeLeader = false; } @Override public void perform() { } }
UTF-8
Java
639
java
CmdWar.java
Java
[]
null
[]
package com.massivecraft.factions.cmd; import com.massivecraft.factions.Conf; import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.struct.Permission; public class CmdWar extends FCommand { public CmdWar() { super(); this.aliases.add("war"); this.aliases.add("w"); this.permission = Permission.WAR.node; this.disableOnLock = false; this.senderMustBePlayer = true; this.senderMustBeMember = false; this.senderMustBeOfficer = true; this.senderMustBeLeader = false; } @Override public void perform() { } }
639
0.646322
0.646322
30
20.299999
17.862717
51
false
false
0
0
0
0
0
0
0.466667
false
false
8
c995cc29910657676ee833396f0238994a1ff86e
23,682,449,701,191
5d314cde5502239f140ecb9b4922b66f391e4a20
/echolot-app/src/main/java/de/exxcellent/echolot/layout/BlockLayoutData.java
8346e5c579cf0850fb6d2c94ccdb53b659deeea5
[]
no_license
bryanchance/echolot
https://github.com/bryanchance/echolot
0f03c7d1b65e578b0872ba325f82fa4c5192d328
76e042224f85272091d7aba8def7dd00ea8431e0
refs/heads/master
2023-03-19T07:29:35.265000
2018-12-06T13:48:15
2018-12-06T13:48:15
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * This file (BlockLayoutData.java) is part of the Echolot Project (hereinafter "Echolot"). * Copyright (C) 2008-2010 eXXcellent Solutions GmbH. * * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (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.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. */ package de.exxcellent.echolot.layout; import nextapp.echo.app.Extent; import nextapp.echo.app.layout.CellLayoutData; /** * A <code>LayoutData</code> object used to describe how a * <code>Component</code> is rendered within a <code>Column</code>. */ public class BlockLayoutData extends CellLayoutData { /** Serial Version UID. */ private static final long serialVersionUID = 20070101L; private Extent height = null; private String floating; private Extent marginTop; private Extent marginBottom; private Extent marginLeft; private Extent marginRight; private Extent width; /** * Returns the height of the cell. * This property only supports <code>Extent</code>s with * fixed (i.e., not percent) units. * * @return the cell height */ public Extent getHeight() { return height; } /** * Sets the height of the cell. * This property only supports <code>Extent</code>s with * fixed (i.e., not percent) units. * * @param height The cell height */ public void setHeight(Extent height) { this.height = height; } /** * Returns the width of the cell. This property only supports <code>Extent</code>s with fixed (i.e., not percent) * units. * * @return the cell width */ public Extent getWidth() { return width; } /** * Sets the width of the cell. This property only supports <code>Extent</code>s with fixed (i.e., not percent) * units. * * @param width The cell width */ public void setWidth(Extent width) { this.width = width; } public void setFloating(String floating) { this.floating = floating; } public String getFloating() { return floating; } public void setMarginTop(Extent marginTop) { this.marginTop = marginTop; } public Extent getMarginTop() { return marginTop; } public void setMarginBottom(Extent marginBottom) { this.marginBottom = marginBottom; } public Extent getMarginBottom() { return marginBottom; } public Extent getMarginLeft() { return marginLeft; } public void setMarginLeft(Extent marginLeft) { this.marginLeft = marginLeft; } public Extent getMarginRight() { return marginRight; } public void setMarginRight(Extent marginRight) { this.marginRight = marginRight; } }
UTF-8
Java
4,025
java
BlockLayoutData.java
Java
[]
null
[]
/* * This file (BlockLayoutData.java) is part of the Echolot Project (hereinafter "Echolot"). * Copyright (C) 2008-2010 eXXcellent Solutions GmbH. * * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (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.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. */ package de.exxcellent.echolot.layout; import nextapp.echo.app.Extent; import nextapp.echo.app.layout.CellLayoutData; /** * A <code>LayoutData</code> object used to describe how a * <code>Component</code> is rendered within a <code>Column</code>. */ public class BlockLayoutData extends CellLayoutData { /** Serial Version UID. */ private static final long serialVersionUID = 20070101L; private Extent height = null; private String floating; private Extent marginTop; private Extent marginBottom; private Extent marginLeft; private Extent marginRight; private Extent width; /** * Returns the height of the cell. * This property only supports <code>Extent</code>s with * fixed (i.e., not percent) units. * * @return the cell height */ public Extent getHeight() { return height; } /** * Sets the height of the cell. * This property only supports <code>Extent</code>s with * fixed (i.e., not percent) units. * * @param height The cell height */ public void setHeight(Extent height) { this.height = height; } /** * Returns the width of the cell. This property only supports <code>Extent</code>s with fixed (i.e., not percent) * units. * * @return the cell width */ public Extent getWidth() { return width; } /** * Sets the width of the cell. This property only supports <code>Extent</code>s with fixed (i.e., not percent) * units. * * @param width The cell width */ public void setWidth(Extent width) { this.width = width; } public void setFloating(String floating) { this.floating = floating; } public String getFloating() { return floating; } public void setMarginTop(Extent marginTop) { this.marginTop = marginTop; } public Extent getMarginTop() { return marginTop; } public void setMarginBottom(Extent marginBottom) { this.marginBottom = marginBottom; } public Extent getMarginBottom() { return marginBottom; } public Extent getMarginLeft() { return marginLeft; } public void setMarginLeft(Extent marginLeft) { this.marginLeft = marginLeft; } public Extent getMarginRight() { return marginRight; } public void setMarginRight(Extent marginRight) { this.marginRight = marginRight; } }
4,025
0.666584
0.659876
139
27.956835
27.420748
117
false
false
0
0
0
0
0
0
0.280576
false
false
8
1d438fa27e8e17ee0894cd024d26257db8c35303
15,977,278,364,971
71b14e7f6827c82818de87c6d0e2431e11aaa994
/Day13/src/com/itheima/_02collection/Demo01_集合的体系.java
cf35db650febb2d7321ce150229b8a2f758da9d9
[]
no_license
shaoyingying-git/JAVA_SE
https://github.com/shaoyingying-git/JAVA_SE
fd0c460fb998b946fbdb0d54c68306520d72f62b
8fd9cb184c91170c6428432990e1a40dcd76d3ab
refs/heads/master
2023-02-27T21:56:07.079000
2021-02-03T19:14:09
2021-02-03T19:14:09
334,726,683
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.itheima._02collection; /* */ public class Demo01_集合的体系 { }
UTF-8
Java
85
java
Demo01_集合的体系.java
Java
[]
null
[]
package com.itheima._02collection; /* */ public class Demo01_集合的体系 { }
85
0.68
0.626667
8
8.375
12.931913
34
false
false
0
0
0
0
0
0
0.125
false
false
8
80ad481debd9062fc59a16655beb2604e6745e8a
31,516,470,075,899
fd0416002161535a15bdb881b948ecb9bb1a609f
/lfrstate1/src/main/java/zxy/lfrstate1/MyReducer.java
9fc9b8d73e66724cde50489d064730db3c68e5ab
[]
no_license
zengxy/javawork
https://github.com/zengxy/javawork
b658b8e28727ca0ed0a956f767c430745ffa1934
d893392fdd5eaeb0b05bab0edf3afa855fe8d292
refs/heads/master
2021-01-21T12:58:11.900000
2016-05-03T12:13:39
2016-05-03T12:13:39
49,257,055
2
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package zxy.lfrstate1; import com.aliyun.odps.data.Record; import com.aliyun.odps.mapred.Reducer; import com.aliyun.odps.mapred.Reducer.TaskContext; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Random; /** * Reducer模板。请用真实逻辑替换模板内容 */ public class MyReducer implements Reducer { // 正则化参数 final private double lambda = 0.01; // 迭代速率 final private double stepRate = 0.05; // 特征维度 final private int featureLen = 5; private Record output; public void setup(TaskContext context) throws IOException { output = context.createOutputRecord(); } public void reduce(Record key, Iterator<Record> values, TaskContext context) throws IOException { Map<Long, String> sessionOcItem = new HashMap<Long, String>(); Map<Long, Double> sessionOcFuis = new HashMap<Long, Double>(); Map<Long, String> sessionOcFeature = new HashMap<Long, String>(); Map<Long, String> sessionBuyItem = new HashMap<Long, String>(); Map<Long, Double> sessionBuyFuis = new HashMap<Long, Double>(); Map<Long, String> sessionBuyFeature = new HashMap<Long, String>(); List<Object[]> rList = new ArrayList<Object[]>(); String userfeatureString = ""; Random rand = new Random(); while (values.hasNext()) { Record val = values.next(); rList.add(val.toArray().clone()); userfeatureString = val.getString("userfeature"); Long session = val.getBigint("session"); String item_id = val.getString("item"); Double fuis = val.getDouble("fuis"); String itemFeature = val.getString("itemfeature"); if (val.getBigint("isbought") == 1) { sessionBuyItem.put(session, item_id); sessionBuyFuis.put(session, fuis); sessionBuyFeature.put(session, itemFeature); } else { if (!sessionOcFuis.containsKey(session) || rand.nextBoolean() == true) { sessionOcItem.put(session, item_id); sessionOcFuis.put(session, fuis); sessionOcFeature.put(session, itemFeature); } } } if (sessionOcItem.isEmpty()) return; FeatureVector duf = new FeatureVector(featureLen, 0.0); FeatureVector userFeatureVector = new FeatureVector(userfeatureString); for (Long session : sessionOcItem.keySet()) { FeatureVector ocItemFeatureVector = new FeatureVector( sessionOcFeature.get(session)); FeatureVector buyItemFeatureVector = new FeatureVector( sessionBuyFeature.get(session)); duf.selfIncrease(FeatureVector.featureSub(ocItemFeatureVector, buyItemFeatureVector)); } userFeatureVector.featureMultiply(1 - lambda); userFeatureVector.selfDecrease(duf); for (Object[] objects : rList) { Long session = Long.parseLong(objects[1].toString()); output.set(0, session);// session output.set(1, key.getString("user_id")); output.set(2, userFeatureVector.getFeatureString()); Long isbought = Long.parseLong(objects[2].toString()); String item = objects[3].toString(); output.set(3, isbought); output.set(4, item); output.set(5, Double.parseDouble(objects[4].toString())); output.set(6, objects[5].toString()); context.write(output); } } public void cleanup(TaskContext arg0) throws IOException { } }
UTF-8
Java
3,291
java
MyReducer.java
Java
[]
null
[]
package zxy.lfrstate1; import com.aliyun.odps.data.Record; import com.aliyun.odps.mapred.Reducer; import com.aliyun.odps.mapred.Reducer.TaskContext; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Random; /** * Reducer模板。请用真实逻辑替换模板内容 */ public class MyReducer implements Reducer { // 正则化参数 final private double lambda = 0.01; // 迭代速率 final private double stepRate = 0.05; // 特征维度 final private int featureLen = 5; private Record output; public void setup(TaskContext context) throws IOException { output = context.createOutputRecord(); } public void reduce(Record key, Iterator<Record> values, TaskContext context) throws IOException { Map<Long, String> sessionOcItem = new HashMap<Long, String>(); Map<Long, Double> sessionOcFuis = new HashMap<Long, Double>(); Map<Long, String> sessionOcFeature = new HashMap<Long, String>(); Map<Long, String> sessionBuyItem = new HashMap<Long, String>(); Map<Long, Double> sessionBuyFuis = new HashMap<Long, Double>(); Map<Long, String> sessionBuyFeature = new HashMap<Long, String>(); List<Object[]> rList = new ArrayList<Object[]>(); String userfeatureString = ""; Random rand = new Random(); while (values.hasNext()) { Record val = values.next(); rList.add(val.toArray().clone()); userfeatureString = val.getString("userfeature"); Long session = val.getBigint("session"); String item_id = val.getString("item"); Double fuis = val.getDouble("fuis"); String itemFeature = val.getString("itemfeature"); if (val.getBigint("isbought") == 1) { sessionBuyItem.put(session, item_id); sessionBuyFuis.put(session, fuis); sessionBuyFeature.put(session, itemFeature); } else { if (!sessionOcFuis.containsKey(session) || rand.nextBoolean() == true) { sessionOcItem.put(session, item_id); sessionOcFuis.put(session, fuis); sessionOcFeature.put(session, itemFeature); } } } if (sessionOcItem.isEmpty()) return; FeatureVector duf = new FeatureVector(featureLen, 0.0); FeatureVector userFeatureVector = new FeatureVector(userfeatureString); for (Long session : sessionOcItem.keySet()) { FeatureVector ocItemFeatureVector = new FeatureVector( sessionOcFeature.get(session)); FeatureVector buyItemFeatureVector = new FeatureVector( sessionBuyFeature.get(session)); duf.selfIncrease(FeatureVector.featureSub(ocItemFeatureVector, buyItemFeatureVector)); } userFeatureVector.featureMultiply(1 - lambda); userFeatureVector.selfDecrease(duf); for (Object[] objects : rList) { Long session = Long.parseLong(objects[1].toString()); output.set(0, session);// session output.set(1, key.getString("user_id")); output.set(2, userFeatureVector.getFeatureString()); Long isbought = Long.parseLong(objects[2].toString()); String item = objects[3].toString(); output.set(3, isbought); output.set(4, item); output.set(5, Double.parseDouble(objects[4].toString())); output.set(6, objects[5].toString()); context.write(output); } } public void cleanup(TaskContext arg0) throws IOException { } }
3,291
0.713756
0.706028
110
28.418182
22.412813
77
false
false
0
0
0
0
0
0
2.545455
false
false
8
ac52a656a6b856a8a0a1524eca33ed3ee2520a44
32,375,463,517,655
d71e879b3517cf4fccde29f7bf82cff69856cfcd
/ExtractedJars/LibriVox_app.librivox.android/javafiles/android/support/v7/widget/AppCompatSpinner$DropdownPopup$2.java
6c7ce0b2d0b6e7c4782f44388879925d40f84cb1
[ "MIT" ]
permissive
Andreas237/AndroidPolicyAutomation
https://github.com/Andreas237/AndroidPolicyAutomation
b8e949e072d08cf6c6166c3f15c9c63379b8f6ce
c1ed10a2c6d4cf3dfda8b8e6291dee2c2a15ee8a
refs/heads/master
2020-04-10T02:14:08.789000
2019-05-16T19:29:11
2019-05-16T19:29:11
160,739,088
5
1
null
null
null
null
null
null
null
null
null
null
null
null
null
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.kpdus.com/jad.html // Decompiler options: packimports(3) annotate safe package android.support.v7.widget; class AppCompatSpinner$DropdownPopup$2 implements android.view.stener { public void onGlobalLayout() { AppCompatSpinner.DropdownPopup dropdownpopup = AppCompatSpinner.DropdownPopup.this; // 0 0:aload_0 // 1 1:getfield #12 <Field AppCompatSpinner$DropdownPopup this$1> // 2 4:astore_1 if(!dropdownpopup.isVisibleToUser(((android.view.View) (dropdownpopup.this$0)))) //* 3 5:aload_1 //* 4 6:aload_1 //* 5 7:getfield #23 <Field AppCompatSpinner AppCompatSpinner$DropdownPopup.this$0> //* 6 10:invokevirtual #27 <Method boolean AppCompatSpinner$DropdownPopup.isVisibleToUser(android.view.View)> //* 7 13:ifne 24 { dismiss(); // 8 16:aload_0 // 9 17:getfield #12 <Field AppCompatSpinner$DropdownPopup this$1> // 10 20:invokevirtual #30 <Method void AppCompatSpinner$DropdownPopup.dismiss()> return; // 11 23:return } else { computeContentWidth(); // 12 24:aload_0 // 13 25:getfield #12 <Field AppCompatSpinner$DropdownPopup this$1> // 14 28:invokevirtual #33 <Method void AppCompatSpinner$DropdownPopup.computeContentWidth()> AppCompatSpinner.DropdownPopup.access$001(AppCompatSpinner.DropdownPopup.this); // 15 31:aload_0 // 16 32:getfield #12 <Field AppCompatSpinner$DropdownPopup this$1> // 17 35:invokestatic #36 <Method void AppCompatSpinner$DropdownPopup.access$001(AppCompatSpinner$DropdownPopup)> return; // 18 38:return } } final AppCompatSpinner.DropdownPopup this$1; AppCompatSpinner$DropdownPopup$2() { this$1 = AppCompatSpinner.DropdownPopup.this; // 0 0:aload_0 // 1 1:aload_1 // 2 2:putfield #12 <Field AppCompatSpinner$DropdownPopup this$1> super(); // 3 5:aload_0 // 4 6:invokespecial #15 <Method void Object()> // 5 9:return } }
UTF-8
Java
2,228
java
AppCompatSpinner$DropdownPopup$2.java
Java
[ { "context": "// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.\n// Jad home page: http://www.kpdus.com/jad.html\n", "end": 61, "score": 0.9996311068534851, "start": 45, "tag": "NAME", "value": "Pavel Kouznetsov" } ]
null
[]
// Decompiled by Jad v1.5.8g. Copyright 2001 <NAME>. // Jad home page: http://www.kpdus.com/jad.html // Decompiler options: packimports(3) annotate safe package android.support.v7.widget; class AppCompatSpinner$DropdownPopup$2 implements android.view.stener { public void onGlobalLayout() { AppCompatSpinner.DropdownPopup dropdownpopup = AppCompatSpinner.DropdownPopup.this; // 0 0:aload_0 // 1 1:getfield #12 <Field AppCompatSpinner$DropdownPopup this$1> // 2 4:astore_1 if(!dropdownpopup.isVisibleToUser(((android.view.View) (dropdownpopup.this$0)))) //* 3 5:aload_1 //* 4 6:aload_1 //* 5 7:getfield #23 <Field AppCompatSpinner AppCompatSpinner$DropdownPopup.this$0> //* 6 10:invokevirtual #27 <Method boolean AppCompatSpinner$DropdownPopup.isVisibleToUser(android.view.View)> //* 7 13:ifne 24 { dismiss(); // 8 16:aload_0 // 9 17:getfield #12 <Field AppCompatSpinner$DropdownPopup this$1> // 10 20:invokevirtual #30 <Method void AppCompatSpinner$DropdownPopup.dismiss()> return; // 11 23:return } else { computeContentWidth(); // 12 24:aload_0 // 13 25:getfield #12 <Field AppCompatSpinner$DropdownPopup this$1> // 14 28:invokevirtual #33 <Method void AppCompatSpinner$DropdownPopup.computeContentWidth()> AppCompatSpinner.DropdownPopup.access$001(AppCompatSpinner.DropdownPopup.this); // 15 31:aload_0 // 16 32:getfield #12 <Field AppCompatSpinner$DropdownPopup this$1> // 17 35:invokestatic #36 <Method void AppCompatSpinner$DropdownPopup.access$001(AppCompatSpinner$DropdownPopup)> return; // 18 38:return } } final AppCompatSpinner.DropdownPopup this$1; AppCompatSpinner$DropdownPopup$2() { this$1 = AppCompatSpinner.DropdownPopup.this; // 0 0:aload_0 // 1 1:aload_1 // 2 2:putfield #12 <Field AppCompatSpinner$DropdownPopup this$1> super(); // 3 5:aload_0 // 4 6:invokespecial #15 <Method void Object()> // 5 9:return } }
2,218
0.632855
0.573609
59
36.762711
33.14904
122
false
false
0
0
0
0
0
0
1.254237
false
false
8
04a09b16735fdcee63eabe7a6446072892adf2d5
29,970,281,811,407
8d8ca8185b0cf24dc24e60b2fd28cb8879c233c6
/madstore-server/src/main/java/it/pronetics/madstore/server/jaxrs/atom/impl/AbstractResourceHandler.java
bf272f0122373bc4fc74a138bc49a330fc0432fb
[ "Apache-2.0" ]
permissive
salincandela/MadStore
https://github.com/salincandela/MadStore
8cc78abe2e72c166b47186c3f1250598413f1ddc
97d20cd146caa289b7e5264603f92b9f43360a03
refs/heads/master
2021-05-27T01:31:29.474000
2009-07-02T16:06:22
2009-07-02T16:06:22
948,301
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
/** * Copyright 2008 - 2009 Pro-Netics S.P.A. * * 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 it.pronetics.madstore.server.jaxrs.atom.impl; import it.pronetics.madstore.server.jaxrs.atom.*; import it.pronetics.madstore.common.AtomConstants; import it.pronetics.madstore.repository.CollectionRepository; import it.pronetics.madstore.repository.EntryRepository; import it.pronetics.madstore.repository.util.PagingList; import it.pronetics.madstore.server.abdera.util.AbderaHelper; import it.pronetics.madstore.server.jaxrs.atom.resolver.ResourceName; import it.pronetics.madstore.server.jaxrs.atom.resolver.ResourceResolver; import java.net.URL; import java.util.ArrayList; import java.util.List; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.CacheControl; import javax.ws.rs.core.Context; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriInfo; import org.apache.abdera.model.Collection; import org.apache.abdera.model.Entry; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Element; /** * Base abstract implementation of {@link ResourceHandler}. * * @author Sergio Bossa */ public abstract class AbstractResourceHandler implements ResourceHandler { private static final Logger LOG = LoggerFactory.getLogger(AbstractResourceHandler.class); protected int httpCacheMaxAge = 0; protected CollectionRepository collectionRepository; protected EntryRepository entryRepository; protected ResourceResolver resourceResolver; protected UriInfo uriInfo; public int getHttpCacheMaxAge() { return httpCacheMaxAge; } public void setHttpCacheMaxAge(int httpCacheMaxAge) { this.httpCacheMaxAge = httpCacheMaxAge; } public CollectionRepository getCollectionRepository() { return collectionRepository; } public void setCollectionRepository(CollectionRepository collectionRepository) { this.collectionRepository = collectionRepository; } public EntryRepository getEntryRepository() { return entryRepository; } public void setEntryRepository(EntryRepository entryRepository) { this.entryRepository = entryRepository; } public ResourceResolver getResourceResolver() { return resourceResolver; } public void setResourceResolver(ResourceResolver resourceResolver) { this.resourceResolver = resourceResolver; } public UriInfo getUriInfo() { return uriInfo; } @Context public void setUriInfo(UriInfo uriInfo) { this.uriInfo = uriInfo; } protected final Collection readCollectionFromRepository(String collectionKey) { Element collectionElement = collectionRepository.read(collectionKey); Collection collectionModel = null; if (collectionElement != null) { try { collectionModel = AbderaHelper.getCollectionFromDom(collectionElement); URL url = resourceResolver.resolveResourceUriFor(ResourceName.COLLECTION, uriInfo.getBaseUri().toString(), collectionKey); collectionModel.setHref(url.toString()); } catch (Exception ex) { LOG.warn("Error converting collection element: {}", collectionElement.toString()); } } else { throw new WebApplicationException(Response.Status.NOT_FOUND); } return collectionModel; } protected final List<Collection> readCollectionsFromRepository() { List<Element> collectionElements = collectionRepository.readCollections(); List<Collection> collectionModels = new ArrayList<Collection>(collectionElements.size()); for (Element collectionElement : collectionElements) { try { Collection appCollection = AbderaHelper.getCollectionFromDom(collectionElement); String collectionKey = appCollection.getAttributeValue(AtomConstants.ATOM_KEY); URL url = resourceResolver.resolveResourceUriFor(ResourceName.COLLECTION, uriInfo.getBaseUri().toString(), collectionKey); appCollection.setHref(url.toString()); collectionModels.add(appCollection); } catch (Exception ex) { LOG.warn("Error converting collection element: {}", collectionElement.toString()); } } return collectionModels; } protected final Entry readEntryFromRepository(String collectionKey, String entryKey) throws Exception { Element entryElement = entryRepository.read(collectionKey, entryKey); if (entryElement != null) { Entry entryModel = AbderaHelper.getEntryFromDom(entryElement); configureEntry(entryModel, collectionKey, entryKey); return entryModel; } else { throw new WebApplicationException(Response.Status.NOT_FOUND); } } protected final PagingList<Entry> readEntriesFromRepository(String collectionKey, int offset, int max) throws Exception { PagingList<Element> entryElements = entryRepository.readEntries(collectionKey, offset, max); PagingList<Entry> entryModels = new PagingList<Entry>( new ArrayList<Entry>(entryElements.size()), entryElements.getOffset(), entryElements.getMax(), entryElements.getTotal()); for (Element entryElement : entryElements) { Entry entry = AbderaHelper.getEntryFromDom(entryElement); String entryKey = entry.getAttributeValue(AtomConstants.ATOM_KEY); configureEntry(entry, collectionKey, entryKey); entryModels.add(entry); } return entryModels; } protected final PagingList<Entry> findEntriesFromRepository(String collectionKey, List<String> terms, int offset, int max) throws Exception { PagingList<Element> entryElements = entryRepository.findEntries(collectionKey, terms, offset, max); PagingList<Entry> entryModels = new PagingList<Entry>( new ArrayList<Entry>(entryElements.size()), entryElements.getOffset(), entryElements.getMax(), entryElements.getTotal()); for (Element entryElement : entryElements) { Entry entry = AbderaHelper.getEntryFromDom(entryElement); String entryKey = entry.getAttributeValue(AtomConstants.ATOM_KEY); configureEntry(entry, collectionKey, entryKey); entryModels.add(entry); } return entryModels; } protected final Response buildOkResponse(Object entity) { CacheControl cacheControl = new CacheControl(); cacheControl.setPrivate(false); cacheControl.setMaxAge(httpCacheMaxAge); Response response = Response.ok(entity).cacheControl(cacheControl).build(); return response; } private void configureEntry(Entry entry, String collectionKey, String entryKey) { URL selfUrl = resourceResolver.resolveResourceUriFor( ResourceName.ENTRY, uriInfo.getBaseUri().toString(), collectionKey, entryKey); String id = resourceResolver.resolveResourceIdFor(uriInfo.getBaseUri().toString(), ResourceName.ENTRY, collectionKey, entryKey); entry.setId(id); entry.addLink(selfUrl.toString(), "self"); entry.addLink(selfUrl.toString(), "edit"); } }
UTF-8
Java
8,008
java
AbstractResourceHandler.java
Java
[ { "context": "ntation of {@link ResourceHandler}.\n * \n * @author Sergio Bossa\n */\npublic abstract class AbstractResourceHandler", "end": 1686, "score": 0.9998748302459717, "start": 1674, "tag": "NAME", "value": "Sergio Bossa" } ]
null
[]
/** * Copyright 2008 - 2009 Pro-Netics S.P.A. * * 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 it.pronetics.madstore.server.jaxrs.atom.impl; import it.pronetics.madstore.server.jaxrs.atom.*; import it.pronetics.madstore.common.AtomConstants; import it.pronetics.madstore.repository.CollectionRepository; import it.pronetics.madstore.repository.EntryRepository; import it.pronetics.madstore.repository.util.PagingList; import it.pronetics.madstore.server.abdera.util.AbderaHelper; import it.pronetics.madstore.server.jaxrs.atom.resolver.ResourceName; import it.pronetics.madstore.server.jaxrs.atom.resolver.ResourceResolver; import java.net.URL; import java.util.ArrayList; import java.util.List; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.CacheControl; import javax.ws.rs.core.Context; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriInfo; import org.apache.abdera.model.Collection; import org.apache.abdera.model.Entry; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Element; /** * Base abstract implementation of {@link ResourceHandler}. * * @author <NAME> */ public abstract class AbstractResourceHandler implements ResourceHandler { private static final Logger LOG = LoggerFactory.getLogger(AbstractResourceHandler.class); protected int httpCacheMaxAge = 0; protected CollectionRepository collectionRepository; protected EntryRepository entryRepository; protected ResourceResolver resourceResolver; protected UriInfo uriInfo; public int getHttpCacheMaxAge() { return httpCacheMaxAge; } public void setHttpCacheMaxAge(int httpCacheMaxAge) { this.httpCacheMaxAge = httpCacheMaxAge; } public CollectionRepository getCollectionRepository() { return collectionRepository; } public void setCollectionRepository(CollectionRepository collectionRepository) { this.collectionRepository = collectionRepository; } public EntryRepository getEntryRepository() { return entryRepository; } public void setEntryRepository(EntryRepository entryRepository) { this.entryRepository = entryRepository; } public ResourceResolver getResourceResolver() { return resourceResolver; } public void setResourceResolver(ResourceResolver resourceResolver) { this.resourceResolver = resourceResolver; } public UriInfo getUriInfo() { return uriInfo; } @Context public void setUriInfo(UriInfo uriInfo) { this.uriInfo = uriInfo; } protected final Collection readCollectionFromRepository(String collectionKey) { Element collectionElement = collectionRepository.read(collectionKey); Collection collectionModel = null; if (collectionElement != null) { try { collectionModel = AbderaHelper.getCollectionFromDom(collectionElement); URL url = resourceResolver.resolveResourceUriFor(ResourceName.COLLECTION, uriInfo.getBaseUri().toString(), collectionKey); collectionModel.setHref(url.toString()); } catch (Exception ex) { LOG.warn("Error converting collection element: {}", collectionElement.toString()); } } else { throw new WebApplicationException(Response.Status.NOT_FOUND); } return collectionModel; } protected final List<Collection> readCollectionsFromRepository() { List<Element> collectionElements = collectionRepository.readCollections(); List<Collection> collectionModels = new ArrayList<Collection>(collectionElements.size()); for (Element collectionElement : collectionElements) { try { Collection appCollection = AbderaHelper.getCollectionFromDom(collectionElement); String collectionKey = appCollection.getAttributeValue(AtomConstants.ATOM_KEY); URL url = resourceResolver.resolveResourceUriFor(ResourceName.COLLECTION, uriInfo.getBaseUri().toString(), collectionKey); appCollection.setHref(url.toString()); collectionModels.add(appCollection); } catch (Exception ex) { LOG.warn("Error converting collection element: {}", collectionElement.toString()); } } return collectionModels; } protected final Entry readEntryFromRepository(String collectionKey, String entryKey) throws Exception { Element entryElement = entryRepository.read(collectionKey, entryKey); if (entryElement != null) { Entry entryModel = AbderaHelper.getEntryFromDom(entryElement); configureEntry(entryModel, collectionKey, entryKey); return entryModel; } else { throw new WebApplicationException(Response.Status.NOT_FOUND); } } protected final PagingList<Entry> readEntriesFromRepository(String collectionKey, int offset, int max) throws Exception { PagingList<Element> entryElements = entryRepository.readEntries(collectionKey, offset, max); PagingList<Entry> entryModels = new PagingList<Entry>( new ArrayList<Entry>(entryElements.size()), entryElements.getOffset(), entryElements.getMax(), entryElements.getTotal()); for (Element entryElement : entryElements) { Entry entry = AbderaHelper.getEntryFromDom(entryElement); String entryKey = entry.getAttributeValue(AtomConstants.ATOM_KEY); configureEntry(entry, collectionKey, entryKey); entryModels.add(entry); } return entryModels; } protected final PagingList<Entry> findEntriesFromRepository(String collectionKey, List<String> terms, int offset, int max) throws Exception { PagingList<Element> entryElements = entryRepository.findEntries(collectionKey, terms, offset, max); PagingList<Entry> entryModels = new PagingList<Entry>( new ArrayList<Entry>(entryElements.size()), entryElements.getOffset(), entryElements.getMax(), entryElements.getTotal()); for (Element entryElement : entryElements) { Entry entry = AbderaHelper.getEntryFromDom(entryElement); String entryKey = entry.getAttributeValue(AtomConstants.ATOM_KEY); configureEntry(entry, collectionKey, entryKey); entryModels.add(entry); } return entryModels; } protected final Response buildOkResponse(Object entity) { CacheControl cacheControl = new CacheControl(); cacheControl.setPrivate(false); cacheControl.setMaxAge(httpCacheMaxAge); Response response = Response.ok(entity).cacheControl(cacheControl).build(); return response; } private void configureEntry(Entry entry, String collectionKey, String entryKey) { URL selfUrl = resourceResolver.resolveResourceUriFor( ResourceName.ENTRY, uriInfo.getBaseUri().toString(), collectionKey, entryKey); String id = resourceResolver.resolveResourceIdFor(uriInfo.getBaseUri().toString(), ResourceName.ENTRY, collectionKey, entryKey); entry.setId(id); entry.addLink(selfUrl.toString(), "self"); entry.addLink(selfUrl.toString(), "edit"); } }
8,002
0.696304
0.694306
193
40.492229
31.867458
145
false
false
0
0
0
0
0
0
0.668394
false
false
8