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
461c80c9f468174ad6e1ac7b3c2f2c982409532d
33,363,306,009,127
dd6d28d18915b8d73a562b5329e0f774814385e3
/FrameWork/src/test/java/TestLevel/NewTestForLevelTest.java
a72a78fdf0dc9046b00f98209417535b93b4777d
[]
no_license
MariamFaroukk/first
https://github.com/MariamFaroukk/first
2624b4fa0a816e92a02f853b4f00e3b603e41bc5
5723574ea4a17a9b535810b1af1071f47839049e
refs/heads/main
2023-04-25T04:29:42.494000
2021-05-11T22:16:55
2021-05-11T22:16:55
366,520,611
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package TestLevel; import org.testng.annotations.Test; import io.github.bonigarcia.wdm.WebDriverManager; import GeneralUIActions.WebBrowserActions; import WebPages.CreateDocumentPage; import WebPages.HomepagelevelTest; import Wrappers.PropertiesFileReader; import org.testng.annotations.BeforeClass; import org.testng.annotations.DataProvider; import java.io.File; import java.io.IOException; import com.google.common.io.Files; import org.apache.commons.io.FileUtils; import org.openqa.selenium.OutputType; import org.openqa.selenium.TakesScreenshot; import org.openqa.selenium.WebDriver; import org.testng.Assert; import org.testng.ITestResult; import org.testng.annotations.AfterClass; import org.testng.annotations.AfterMethod; public class NewTestForLevelTest { WebDriver driver; @Test public void LeinProductScenarioTest() { CreateDocumentPage page= new HomepagelevelTest(driver).navigateTohomePage().clickoncreatedocument(); Assert.assertEquals(page.validatetitle("Lien Waiver"),"Lien Waiver"); Assert.assertEquals(page.finditisfreeornot("Lien Waiver"),"Free"); } @Test public void NoticeProductScenarioTest() { CreateDocumentPage page= new HomepagelevelTest(driver).navigateTohomePage().clickoncreatedocument(); Assert.assertEquals(page.validatetitle("Notice of Intent to Lien"),"Notice of Intent to Lien"); Assert.assertEquals(page.finditisfreeornot("Notice of Intent to Lien"),"Free"); } @Test public void PreliminryProductScenarioTest() { CreateDocumentPage page= new HomepagelevelTest(driver).navigateTohomePage().clickoncreatedocument(); Assert.assertEquals(page.validatetitle("20-Day Preliminary Notice"),"20-Day Preliminary Notice"); Assert.assertEquals(page.finditisfreeornot("20-Day Preliminary Notice"),"Free"); } @Test public void LeinAndbondProductScenarioTest() { CreateDocumentPage page= new HomepagelevelTest(driver).navigateTohomePage().clickoncreatedocument(); Assert.assertEquals(page.validatetitle("Lien / Bond Claim"),"Lien / Bond Claim"); Assert.assertEquals(page.finditisfreeornot("Lien / Bond Claim"),"Free"); } @Test public void stopnotify() { driver.get("http://www.qaautomated.com/2018/03/how-to-disable-chrome-notifications.html"); } @Test(dataProvider="SearchProvider") public void allproductScenario(String productname ,String price) { CreateDocumentPage page= new HomepagelevelTest(driver).navigateTohomePage().clickoncreatedocument(); Assert.assertEquals(page.validatetitle(productname),productname); Assert.assertEquals(page.finditisfreeornot(productname),price); } @DataProvider(name="SearchProvider") public Object[][] getDataFromDataprovider(){ return new Object[][] { { "Lien / Bond Claim", "Free" }, { "20-Day Preliminary Notice", "Free" }, { "Notice of Intent to Lien", "Free" }, { "Lien Waiver", "Free" } }; } @BeforeClass public void beforeClass() { // WebDriverManager.chromedriver().setup(); driver= WebBrowserActions.chooseBrowserDriver("Chrome"); WebBrowserActions.staticmaximizeWindow(driver); } @Test public void testingwrapperpropfile() { Assert.assertEquals("Mariam",PropertiesFileReader.getValue("Name")); } @AfterClass public void afterClass() { WebBrowserActions.quitWindow(driver); driver.manage().deleteAllCookies(); } @AfterMethod public void recordFailure(ITestResult result){ if(ITestResult.FAILURE == result.getStatus()) { TakesScreenshot ts = (TakesScreenshot)driver; File file = ts.getScreenshotAs(OutputType.FILE); try { FileUtils.copyFile(file,new File ("./ScreenShot_Folder/Test1_Login.png")); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } //File screenshot = new File("resources/screenshoots/test.png"); /*try { File screenshot = null; Files.move(screenshot, new File("/FrameWork/src/main/resources/screenshots" + result.getName() + ".png")); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); }*/ } } }
UTF-8
Java
4,134
java
NewTestForLevelTest.java
Java
[ { "context": " org.testng.annotations.Test;\n\n\n\nimport io.github.bonigarcia.wdm.WebDriverManager;\nimport GeneralUIActions.Web", "end": 86, "score": 0.9996540546417236, "start": 76, "tag": "USERNAME", "value": "bonigarcia" } ]
null
[]
package TestLevel; import org.testng.annotations.Test; import io.github.bonigarcia.wdm.WebDriverManager; import GeneralUIActions.WebBrowserActions; import WebPages.CreateDocumentPage; import WebPages.HomepagelevelTest; import Wrappers.PropertiesFileReader; import org.testng.annotations.BeforeClass; import org.testng.annotations.DataProvider; import java.io.File; import java.io.IOException; import com.google.common.io.Files; import org.apache.commons.io.FileUtils; import org.openqa.selenium.OutputType; import org.openqa.selenium.TakesScreenshot; import org.openqa.selenium.WebDriver; import org.testng.Assert; import org.testng.ITestResult; import org.testng.annotations.AfterClass; import org.testng.annotations.AfterMethod; public class NewTestForLevelTest { WebDriver driver; @Test public void LeinProductScenarioTest() { CreateDocumentPage page= new HomepagelevelTest(driver).navigateTohomePage().clickoncreatedocument(); Assert.assertEquals(page.validatetitle("Lien Waiver"),"Lien Waiver"); Assert.assertEquals(page.finditisfreeornot("Lien Waiver"),"Free"); } @Test public void NoticeProductScenarioTest() { CreateDocumentPage page= new HomepagelevelTest(driver).navigateTohomePage().clickoncreatedocument(); Assert.assertEquals(page.validatetitle("Notice of Intent to Lien"),"Notice of Intent to Lien"); Assert.assertEquals(page.finditisfreeornot("Notice of Intent to Lien"),"Free"); } @Test public void PreliminryProductScenarioTest() { CreateDocumentPage page= new HomepagelevelTest(driver).navigateTohomePage().clickoncreatedocument(); Assert.assertEquals(page.validatetitle("20-Day Preliminary Notice"),"20-Day Preliminary Notice"); Assert.assertEquals(page.finditisfreeornot("20-Day Preliminary Notice"),"Free"); } @Test public void LeinAndbondProductScenarioTest() { CreateDocumentPage page= new HomepagelevelTest(driver).navigateTohomePage().clickoncreatedocument(); Assert.assertEquals(page.validatetitle("Lien / Bond Claim"),"Lien / Bond Claim"); Assert.assertEquals(page.finditisfreeornot("Lien / Bond Claim"),"Free"); } @Test public void stopnotify() { driver.get("http://www.qaautomated.com/2018/03/how-to-disable-chrome-notifications.html"); } @Test(dataProvider="SearchProvider") public void allproductScenario(String productname ,String price) { CreateDocumentPage page= new HomepagelevelTest(driver).navigateTohomePage().clickoncreatedocument(); Assert.assertEquals(page.validatetitle(productname),productname); Assert.assertEquals(page.finditisfreeornot(productname),price); } @DataProvider(name="SearchProvider") public Object[][] getDataFromDataprovider(){ return new Object[][] { { "Lien / Bond Claim", "Free" }, { "20-Day Preliminary Notice", "Free" }, { "Notice of Intent to Lien", "Free" }, { "Lien Waiver", "Free" } }; } @BeforeClass public void beforeClass() { // WebDriverManager.chromedriver().setup(); driver= WebBrowserActions.chooseBrowserDriver("Chrome"); WebBrowserActions.staticmaximizeWindow(driver); } @Test public void testingwrapperpropfile() { Assert.assertEquals("Mariam",PropertiesFileReader.getValue("Name")); } @AfterClass public void afterClass() { WebBrowserActions.quitWindow(driver); driver.manage().deleteAllCookies(); } @AfterMethod public void recordFailure(ITestResult result){ if(ITestResult.FAILURE == result.getStatus()) { TakesScreenshot ts = (TakesScreenshot)driver; File file = ts.getScreenshotAs(OutputType.FILE); try { FileUtils.copyFile(file,new File ("./ScreenShot_Folder/Test1_Login.png")); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } //File screenshot = new File("resources/screenshoots/test.png"); /*try { File screenshot = null; Files.move(screenshot, new File("/FrameWork/src/main/resources/screenshots" + result.getName() + ".png")); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); }*/ } } }
4,134
0.739961
0.735849
121
33.165291
29.941084
109
false
false
0
0
0
0
0
0
1.099174
false
false
3
2d4b01f38c740ae3d04fe6a2fd69b4a0104d3fd6
17,051,020,218,078
2a08ab90086320a0af7d127c7be8a27b8d14198c
/app/src/main/java/kr/ac/tu/wtf/test20180825/RssiScan.java
b619b5a02fb43ef0d0762505a3e8edfc316613c3
[]
no_license
level120/Test20180825
https://github.com/level120/Test20180825
e25ac2a0634d302ea22b5af315aa59f182f06a76
6635fa0805a77e057cdbe3868f55cb70d835f14a
refs/heads/master
2020-03-27T07:52:39.047000
2018-08-30T13:57:45
2018-08-30T13:57:45
146,200,040
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package kr.ac.tu.wtf.test20180825; import android.Manifest; import android.app.Activity; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.pm.PackageManager; import android.net.ConnectivityManager; import android.net.wifi.ScanResult; import android.net.wifi.WifiManager; import android.support.v4.app.ActivityCompat; import android.support.v4.content.ContextCompat; import android.widget.Toast; import java.util.ArrayList; import java.util.List; public class RssiScan { private WifiManager wifiManager; private Activity activity; /* AP 정보 결과 리스트 */ public ArrayList<ScanResult> results = new ArrayList<>(); private BroadcastReceiver WifiReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { if (intent.getAction().equals(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION)) { searchWifi(); } } }; public RssiScan(Activity _activity) { activity = _activity; checkPermission(); initRssi(); } private void initRssi() { wifiManager = (WifiManager) activity.getApplicationContext().getSystemService(Context.WIFI_SERVICE); wifiManager.setWifiEnabled(true); wifiManager.startScan(); IntentFilter filter = new IntentFilter(); filter.addAction(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION); filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION); filter.addAction("android.intent.RECEIVE_LOCATION"); activity.registerReceiver(WifiReceiver, filter); } /* 작업 성공 시 true, 실패 시 false 반환 */ public boolean searchWifi() { wifiManager.startScan(); List<ScanResult> apList = wifiManager.getScanResults(); for (int i=0, size=results.size(); i<size; ++i) { results.remove(0); } if (apList != null) { for (int i=0, size=apList.size(); i<size; ++i) { results.add(apList.get(i)); } } try { activity.unregisterReceiver(WifiReceiver); } catch (IllegalArgumentException e) { return false; } return true; } /* API 23 이후부터 적용 */ private void checkPermission() { final int MY_PERMISSIONS_REQUEST_READ_WIFI = 3; if (ContextCompat.checkSelfPermission(activity, Manifest.permission.ACCESS_WIFI_STATE) != PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission(activity, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission(activity, Manifest.permission.CHANGE_WIFI_STATE) != PackageManager.PERMISSION_GRANTED) { // Should we show an explanation? if (ActivityCompat.shouldShowRequestPermissionRationale(activity, Manifest.permission.ACCESS_WIFI_STATE) && ActivityCompat.shouldShowRequestPermissionRationale(activity, Manifest.permission.ACCESS_COARSE_LOCATION) && ActivityCompat.shouldShowRequestPermissionRationale(activity, Manifest.permission.CHANGE_WIFI_STATE)) { // Show an explanation to the user *asynchronously* -- don't block // this thread waiting for the user's response! After the user // sees the explanation, try again to request the permission. } else { Toast.makeText(activity, "앱 실행을 위해서는 네트워크 권한을 설정해야 합니다", Toast.LENGTH_LONG).show(); // No explanation needed, we can request the permission. ActivityCompat.requestPermissions(activity, new String[]{Manifest.permission.ACCESS_WIFI_STATE, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.CHANGE_WIFI_STATE}, MY_PERMISSIONS_REQUEST_READ_WIFI); // MY_PERMISSIONS_REQUEST_READ_CONTACTS is an // app-defined int constant. The callback method gets the // result of the request. } } } }
UTF-8
Java
4,533
java
RssiScan.java
Java
[]
null
[]
package kr.ac.tu.wtf.test20180825; import android.Manifest; import android.app.Activity; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.pm.PackageManager; import android.net.ConnectivityManager; import android.net.wifi.ScanResult; import android.net.wifi.WifiManager; import android.support.v4.app.ActivityCompat; import android.support.v4.content.ContextCompat; import android.widget.Toast; import java.util.ArrayList; import java.util.List; public class RssiScan { private WifiManager wifiManager; private Activity activity; /* AP 정보 결과 리스트 */ public ArrayList<ScanResult> results = new ArrayList<>(); private BroadcastReceiver WifiReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { if (intent.getAction().equals(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION)) { searchWifi(); } } }; public RssiScan(Activity _activity) { activity = _activity; checkPermission(); initRssi(); } private void initRssi() { wifiManager = (WifiManager) activity.getApplicationContext().getSystemService(Context.WIFI_SERVICE); wifiManager.setWifiEnabled(true); wifiManager.startScan(); IntentFilter filter = new IntentFilter(); filter.addAction(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION); filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION); filter.addAction("android.intent.RECEIVE_LOCATION"); activity.registerReceiver(WifiReceiver, filter); } /* 작업 성공 시 true, 실패 시 false 반환 */ public boolean searchWifi() { wifiManager.startScan(); List<ScanResult> apList = wifiManager.getScanResults(); for (int i=0, size=results.size(); i<size; ++i) { results.remove(0); } if (apList != null) { for (int i=0, size=apList.size(); i<size; ++i) { results.add(apList.get(i)); } } try { activity.unregisterReceiver(WifiReceiver); } catch (IllegalArgumentException e) { return false; } return true; } /* API 23 이후부터 적용 */ private void checkPermission() { final int MY_PERMISSIONS_REQUEST_READ_WIFI = 3; if (ContextCompat.checkSelfPermission(activity, Manifest.permission.ACCESS_WIFI_STATE) != PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission(activity, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission(activity, Manifest.permission.CHANGE_WIFI_STATE) != PackageManager.PERMISSION_GRANTED) { // Should we show an explanation? if (ActivityCompat.shouldShowRequestPermissionRationale(activity, Manifest.permission.ACCESS_WIFI_STATE) && ActivityCompat.shouldShowRequestPermissionRationale(activity, Manifest.permission.ACCESS_COARSE_LOCATION) && ActivityCompat.shouldShowRequestPermissionRationale(activity, Manifest.permission.CHANGE_WIFI_STATE)) { // Show an explanation to the user *asynchronously* -- don't block // this thread waiting for the user's response! After the user // sees the explanation, try again to request the permission. } else { Toast.makeText(activity, "앱 실행을 위해서는 네트워크 권한을 설정해야 합니다", Toast.LENGTH_LONG).show(); // No explanation needed, we can request the permission. ActivityCompat.requestPermissions(activity, new String[]{Manifest.permission.ACCESS_WIFI_STATE, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.CHANGE_WIFI_STATE}, MY_PERMISSIONS_REQUEST_READ_WIFI); // MY_PERMISSIONS_REQUEST_READ_CONTACTS is an // app-defined int constant. The callback method gets the // result of the request. } } } }
4,533
0.620077
0.616475
119
36.34454
27.039167
108
false
false
0
0
0
0
0
0
0.579832
false
false
3
ada95f8c6e8a62757f6b595da01f676fa96e458e
712,964,595,309
915e72c3cd9e98ed66dff80f43281835e635fcd0
/app/src/main/java/com/example/anonymous/CikgoodPengajar/utils/UtilsApi.java
bd9bbeecd8f3cfa43b43c57b3c217514dffef0cd
[]
no_license
ridhoafni/cikgood-pengajar
https://github.com/ridhoafni/cikgood-pengajar
accc07b73359279ee75cba38d1bfd16356f68511
229fbe4e59adeabfae1abe70ba75a312927ff014
refs/heads/master
2020-04-26T09:12:44.897000
2019-03-24T05:09:47
2019-03-24T05:09:47
173,447,720
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.anonymous.CikgoodPengajar.utils; import com.example.anonymous.CikgoodPengajar.config.ServerConfig; import com.example.anonymous.CikgoodPengajar.rests.ApiClient; import com.example.anonymous.CikgoodPengajar.rests.ApiInterface; public class UtilsApi { // public static final String BASE_URL_API = "http://10.0.2.2/mahasiswa/"; private static final String BASE_URL = ServerConfig.API_ENDPOINT; // Mendeklarasikan Interface BaseApiService public static ApiInterface getAPIService(){ return ApiClient.getClient(BASE_URL).create(ApiInterface.class); } }
UTF-8
Java
598
java
UtilsApi.java
Java
[ { "context": "public static final String BASE_URL_API = \"http://10.0.2.2/mahasiswa/\";\n private static final String BASE", "end": 336, "score": 0.994349479675293, "start": 328, "tag": "IP_ADDRESS", "value": "10.0.2.2" } ]
null
[]
package com.example.anonymous.CikgoodPengajar.utils; import com.example.anonymous.CikgoodPengajar.config.ServerConfig; import com.example.anonymous.CikgoodPengajar.rests.ApiClient; import com.example.anonymous.CikgoodPengajar.rests.ApiInterface; public class UtilsApi { // public static final String BASE_URL_API = "http://10.0.2.2/mahasiswa/"; private static final String BASE_URL = ServerConfig.API_ENDPOINT; // Mendeklarasikan Interface BaseApiService public static ApiInterface getAPIService(){ return ApiClient.getClient(BASE_URL).create(ApiInterface.class); } }
598
0.782609
0.774247
15
38.866665
29.364075
77
false
false
0
0
0
0
0
0
0.466667
false
false
3
2549f2ecf19806b71c52f92029ccf3a12fc0d02c
11,613,591,587,607
cfff1bcc26db737da7e1857fc27fa3f9271a8cb5
/Hello/src/com/yihua/oop/classDemo04/Application.java
507b06ebbeac6243ca16c322422a9db580f1c0a1
[]
no_license
yihuahuahua/JavaLearn
https://github.com/yihuahuahua/JavaLearn
d371b73162a071b5b25010a19f49b07967b4e3c6
05cc30c3cb6614de08657700ba24bfe704963dc8
refs/heads/main
2023-03-27T07:18:28.363000
2021-03-31T10:00:59
2021-03-31T10:00:59
353,308,095
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.yihua.oop.classDemo04; import java.time.temporal.TemporalAccessor; public class Application { public static void main(String[] args) { /* * 多态注意事项: * 1. 多态是方法的多态,属性没有多态 * 2. 父类和子类,有联系 类型转换异常 * */ // 一个对象的实际类型是确定的 // new Student(); // new Person(); // 可指向的引用类型就不确定了:父类的引用指向子类 // Student 能调用的方法都是自己或者继承父类的! Student s1 = new Student(); // Person 父类型,可以指向子类,但是不能调用子类独有的方法 Person s2 = new Student(); Object s3 = new Student(); // 对象能执行哪些方法,主要是看对象左边的类型,和右边关系不大! ((Student) s2).eat(); //s2.eat(); s1.eat(); System.out.println(s3 instanceof Student); System.out.println(s3 instanceof Person); System.out.println(s3 instanceof Object); } }
UTF-8
Java
1,150
java
Application.java
Java
[]
null
[]
package com.yihua.oop.classDemo04; import java.time.temporal.TemporalAccessor; public class Application { public static void main(String[] args) { /* * 多态注意事项: * 1. 多态是方法的多态,属性没有多态 * 2. 父类和子类,有联系 类型转换异常 * */ // 一个对象的实际类型是确定的 // new Student(); // new Person(); // 可指向的引用类型就不确定了:父类的引用指向子类 // Student 能调用的方法都是自己或者继承父类的! Student s1 = new Student(); // Person 父类型,可以指向子类,但是不能调用子类独有的方法 Person s2 = new Student(); Object s3 = new Student(); // 对象能执行哪些方法,主要是看对象左边的类型,和右边关系不大! ((Student) s2).eat(); //s2.eat(); s1.eat(); System.out.println(s3 instanceof Student); System.out.println(s3 instanceof Person); System.out.println(s3 instanceof Object); } }
1,150
0.544186
0.52907
34
23.294117
16.653086
50
false
false
0
0
0
0
0
0
0.382353
false
false
3
b94cd5c5bcb067a15a0fadad3fa6a7d7830f69bc
4,260,607,626,419
dc316cd4c8008c8a2651a9d95e9aacdd011c21dd
/commons-data/src/main/java/com/mizhousoft/commons/data/util/PageRequestBuilder.java
0087b8e07a4c76e7b0d33248a105319df9a19359
[ "BSD-3-Clause" ]
permissive
63966367/mizhousoft-commons
https://github.com/63966367/mizhousoft-commons
5bc124f692daf44c7643d5a0ed527e774240979a
e6e1fa50b50031ee4e3d364c64178e3873d88993
refs/heads/main
2023-05-05T21:20:16.396000
2021-06-01T03:33:36
2021-06-01T03:33:36
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.mizhousoft.commons.data.util; import com.mizhousoft.commons.data.constant.PaginationConstants; import com.mizhousoft.commons.data.domain.PageRequest; import com.mizhousoft.commons.data.domain.Pageable; /** * PageRequest构建器 * * @version */ public abstract class PageRequestBuilder { /** * 构建分页请求 * * @param pageNumber * @param pageSize * @return */ public static Pageable build(Integer pageNumber, Integer pageSize) { if (null == pageNumber || pageNumber.intValue() < 1) { pageNumber = PaginationConstants.DEFAULT_PAGE_NUMBER; } if (null == pageSize || pageSize.intValue() < 1) { pageSize = PaginationConstants.DEFAULT_PAGE_SIZE; } PageRequest pageRequest = new PageRequest(); pageRequest.setPageNumber(pageNumber); pageRequest.setPageSize(pageSize); return pageRequest; } /** * 构建默认分页 * * @return */ public static Pageable buildDefault() { PageRequest pageRequest = new PageRequest(); pageRequest.setPageNumber(PaginationConstants.DEFAULT_PAGE_NUMBER); pageRequest.setPageSize(PaginationConstants.DEFAULT_PAGE_SIZE); return pageRequest; } }
UTF-8
Java
1,211
java
PageRequestBuilder.java
Java
[]
null
[]
package com.mizhousoft.commons.data.util; import com.mizhousoft.commons.data.constant.PaginationConstants; import com.mizhousoft.commons.data.domain.PageRequest; import com.mizhousoft.commons.data.domain.Pageable; /** * PageRequest构建器 * * @version */ public abstract class PageRequestBuilder { /** * 构建分页请求 * * @param pageNumber * @param pageSize * @return */ public static Pageable build(Integer pageNumber, Integer pageSize) { if (null == pageNumber || pageNumber.intValue() < 1) { pageNumber = PaginationConstants.DEFAULT_PAGE_NUMBER; } if (null == pageSize || pageSize.intValue() < 1) { pageSize = PaginationConstants.DEFAULT_PAGE_SIZE; } PageRequest pageRequest = new PageRequest(); pageRequest.setPageNumber(pageNumber); pageRequest.setPageSize(pageSize); return pageRequest; } /** * 构建默认分页 * * @return */ public static Pageable buildDefault() { PageRequest pageRequest = new PageRequest(); pageRequest.setPageNumber(PaginationConstants.DEFAULT_PAGE_NUMBER); pageRequest.setPageSize(PaginationConstants.DEFAULT_PAGE_SIZE); return pageRequest; } }
1,211
0.69602
0.694327
53
20.283018
22.612717
69
false
false
0
0
0
0
0
0
1.339623
false
false
3
53880046a1791c08ed1d8d3d1987928e1037f0a2
12,713,103,204,469
dc74ad220f8601e41924fa4919a2a17a9f1b10d5
/src/Modulo1/Ejercicio15.java
b98418c6d36cf8d25bec80819dac3e6090368fed
[]
no_license
YeisonRuiz/RepositorioJavaEjercicios
https://github.com/YeisonRuiz/RepositorioJavaEjercicios
38782ec973d3cdbdd66e718042a5711809ae1e5e
efcf05e74822b60ba6981b35580c3c263f290bc7
refs/heads/main
2023-01-08T16:00:52.839000
2020-11-09T01:09:18
2020-11-09T01:09:18
311,187,094
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 Modulo1; import java.util.Scanner; /** * * @author YEISON */ public class Ejercicio15 { public static void main(String[] args) { double precio_compra, precio_venta; Scanner escaner = new Scanner(System.in); System.out.println("Ingrese el precio de compra de DVD"); precio_compra = escaner.nextDouble(); precio_venta = precio_compra + (precio_compra * 0.20); System.out.println("-------------------------"); System.out.println("El precio de compra es: " + precio_compra); System.out.println("El precio a vender es: " + precio_venta); } }
UTF-8
Java
871
java
Ejercicio15.java
Java
[ { "context": "lo1;\n\nimport java.util.Scanner;\n\n/**\n *\n * @author YEISON\n */\npublic class Ejercicio15 {\n \n public st", "end": 254, "score": 0.8793817758560181, "start": 248, "tag": "NAME", "value": "YEISON" } ]
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 Modulo1; import java.util.Scanner; /** * * @author YEISON */ public class Ejercicio15 { public static void main(String[] args) { double precio_compra, precio_venta; Scanner escaner = new Scanner(System.in); System.out.println("Ingrese el precio de compra de DVD"); precio_compra = escaner.nextDouble(); precio_venta = precio_compra + (precio_compra * 0.20); System.out.println("-------------------------"); System.out.println("El precio de compra es: " + precio_compra); System.out.println("El precio a vender es: " + precio_venta); } }
871
0.590126
0.583238
33
25.39394
25.389021
79
false
false
0
0
0
0
0
0
0.424242
false
false
3
7b6aa32bc2830d705e1108cb92be4cd8748bfdea
17,102,559,787,068
01c751c07adf0c3231d1a95fc9ccbd00af07f45b
/Week_05/homework_10/src/main/java/com/cfw/geektime/java000/Main.java
6f525c47f824d53efdf15110dfebfb31e66d0bca
[]
no_license
XXMY/JAVA-000
https://github.com/XXMY/JAVA-000
1220aa069348722d581dcfdcb92c84808905e75c
fe485761369d004440ccff92d15a58d05dd04d63
refs/heads/main
2023-01-27T20:19:37.427000
2020-12-09T13:21:23
2020-12-09T13:21:23
303,412,482
0
0
null
true
2020-10-12T14:10:33
2020-10-12T14:10:32
2020-10-12T03:41:54
2020-10-12T08:13:10
2
0
0
0
null
false
false
package com.cfw.geektime.java000; import com.zaxxer.hikari.HikariDataSource; import java.sql.*; public class Main { public static void main(String[] args) throws Exception { String driver = "com.mysql.jdbc.Driver"; String url = "jdbc:mysql://localhost:3306/java_000?useUnicode=true&characterEncoding=UTF8"; String username = "root"; String password = "admin"; Class.forName(driver); Connection connection = DriverManager.getConnection(url,username,password); Statement statement = connection.createStatement(); // 1. 使用 JDBC 原生接口,实现数据库的增删改查操作。 operationWithoutTX(statement); // 2. 使用事务,PrepareStatement 方式,批处理方式,改进上述操作。 operationWithTX(connection,statement); statement.close(); operationWithPreparedStatement(connection); operationWitchPreparedStatementBathTX(connection); connection.close(); // 3. 配置 Hikari 连接池,改进上述操作 HikariPoolDatasource hikariPoolDatasource = new HikariPoolDatasource(); HikariDataSource hikariDataSource = hikariPoolDatasource.dataSource(url,username,password); connection = hikariDataSource.getConnection(); operationWithPreparedStatement(connection); } private static void operationWithTX(Connection connection, Statement statement) throws SQLException { connection.setAutoCommit(false); JDBCOperation jdbcOperation = new JDBCOperation(); jdbcOperation.insert(statement); connection.commit(); jdbcOperation.delete(statement); jdbcOperation.select(statement); connection.rollback(); jdbcOperation.select(statement); } private static void operationWithoutTX(Statement statement) throws SQLException { JDBCOperation jdbcOperation = new JDBCOperation(); jdbcOperation.insert(statement); jdbcOperation.delete(statement); jdbcOperation.update(statement); jdbcOperation.select(statement); } private static void operationWithPreparedStatement(Connection connection) throws SQLException { JDBCOperation jdbcOperation = new JDBCOperation(); jdbcOperation.preparedStatementQuery(connection); } private static void operationWitchPreparedStatementBathTX(Connection connection) throws SQLException { JDBCOperation jdbcOperation = new JDBCOperation(); jdbcOperation.preparedStatementBathInsert(connection); } }
UTF-8
Java
2,571
java
Main.java
Java
[ { "context": "ing username = \"root\";\n String password = \"admin\";\n\n Class.forName(driver);\n Connect", "end": 396, "score": 0.9994358420372009, "start": 391, "tag": "PASSWORD", "value": "admin" } ]
null
[]
package com.cfw.geektime.java000; import com.zaxxer.hikari.HikariDataSource; import java.sql.*; public class Main { public static void main(String[] args) throws Exception { String driver = "com.mysql.jdbc.Driver"; String url = "jdbc:mysql://localhost:3306/java_000?useUnicode=true&characterEncoding=UTF8"; String username = "root"; String password = "<PASSWORD>"; Class.forName(driver); Connection connection = DriverManager.getConnection(url,username,password); Statement statement = connection.createStatement(); // 1. 使用 JDBC 原生接口,实现数据库的增删改查操作。 operationWithoutTX(statement); // 2. 使用事务,PrepareStatement 方式,批处理方式,改进上述操作。 operationWithTX(connection,statement); statement.close(); operationWithPreparedStatement(connection); operationWitchPreparedStatementBathTX(connection); connection.close(); // 3. 配置 Hikari 连接池,改进上述操作 HikariPoolDatasource hikariPoolDatasource = new HikariPoolDatasource(); HikariDataSource hikariDataSource = hikariPoolDatasource.dataSource(url,username,password); connection = hikariDataSource.getConnection(); operationWithPreparedStatement(connection); } private static void operationWithTX(Connection connection, Statement statement) throws SQLException { connection.setAutoCommit(false); JDBCOperation jdbcOperation = new JDBCOperation(); jdbcOperation.insert(statement); connection.commit(); jdbcOperation.delete(statement); jdbcOperation.select(statement); connection.rollback(); jdbcOperation.select(statement); } private static void operationWithoutTX(Statement statement) throws SQLException { JDBCOperation jdbcOperation = new JDBCOperation(); jdbcOperation.insert(statement); jdbcOperation.delete(statement); jdbcOperation.update(statement); jdbcOperation.select(statement); } private static void operationWithPreparedStatement(Connection connection) throws SQLException { JDBCOperation jdbcOperation = new JDBCOperation(); jdbcOperation.preparedStatementQuery(connection); } private static void operationWitchPreparedStatementBathTX(Connection connection) throws SQLException { JDBCOperation jdbcOperation = new JDBCOperation(); jdbcOperation.preparedStatementBathInsert(connection); } }
2,576
0.715619
0.709939
63
38.126984
29.587906
106
false
false
0
0
0
0
0
0
0.68254
false
false
3
b6b5ef8314400e5aebd6e518674eb43a752be84c
16,140,487,143,796
54d80ec8169570c8ff35440e5af50aa4649b713d
/String/GenerateParentheses.java
57d021a6076027e82e670ae336d2e618c7254357
[]
no_license
verma-saurabh/DS
https://github.com/verma-saurabh/DS
6f085fdb8a44dc98839ba49c63aa0673f23071df
4f9c8c7f41076a7536f7f64e50d57b7132850a7f
refs/heads/master
2021-06-27T23:26:45.351000
2021-02-01T15:31:37
2021-02-01T15:31:37
216,160,449
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package String; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Stack; /** * 22. Generate Parentheses * https://leetcode.com/problems/generate-parentheses/ **/ public class GenerateParentheses { HashMap<Character, Character> map = new HashMap<>(); public static void main(String[] args) { GenerateParentheses obj = new GenerateParentheses(); obj.generateParenthesis(3); } public List<String> generateParenthesis(int n) { loadMap(); List<String> ans = new ArrayList<>(); List<String> result = new ArrayList<>(); //generateCombinations(ans, 2 * n, ""); generateCombinations_backtrack(ans, n, "", 0, 0); for (String str : ans) { if (isWellFormed(str)) { result.add(str); } } return result; } public boolean isWellFormed(String str) { Stack<Character> stack = new Stack<>(); for (char c : str.toCharArray()) { if (map.containsKey(c)) { if (!stack.isEmpty() && stack.peek() == map.get(c)) { stack.pop(); } else { stack.push(c); } } else { stack.push(c); } } return stack.isEmpty(); } public void loadMap() { map.put(')', '('); } public void generateCombinations(List<String> ans, int length, String str) { if (str.length() == length) { ans.add(str); return; } generateCombinations(ans, length, str + '('); generateCombinations(ans, length, str + ')'); } public void generateCombinations_backtrack(List<String> ans, int n, String str, int open, int close) { if (str.length() == 2 * n) { ans.add(str); return; } if (open < n) { generateCombinations_backtrack(ans, n, str + '(', open + 1, close); } // At this step if you do close< n , then it would generate combinations where the number of brackets is equal // but also includes those results which are not valid if (close < open) { generateCombinations_backtrack(ans, n, str + ')', open, close + 1); } } }
UTF-8
Java
2,336
java
GenerateParentheses.java
Java
[]
null
[]
package String; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Stack; /** * 22. Generate Parentheses * https://leetcode.com/problems/generate-parentheses/ **/ public class GenerateParentheses { HashMap<Character, Character> map = new HashMap<>(); public static void main(String[] args) { GenerateParentheses obj = new GenerateParentheses(); obj.generateParenthesis(3); } public List<String> generateParenthesis(int n) { loadMap(); List<String> ans = new ArrayList<>(); List<String> result = new ArrayList<>(); //generateCombinations(ans, 2 * n, ""); generateCombinations_backtrack(ans, n, "", 0, 0); for (String str : ans) { if (isWellFormed(str)) { result.add(str); } } return result; } public boolean isWellFormed(String str) { Stack<Character> stack = new Stack<>(); for (char c : str.toCharArray()) { if (map.containsKey(c)) { if (!stack.isEmpty() && stack.peek() == map.get(c)) { stack.pop(); } else { stack.push(c); } } else { stack.push(c); } } return stack.isEmpty(); } public void loadMap() { map.put(')', '('); } public void generateCombinations(List<String> ans, int length, String str) { if (str.length() == length) { ans.add(str); return; } generateCombinations(ans, length, str + '('); generateCombinations(ans, length, str + ')'); } public void generateCombinations_backtrack(List<String> ans, int n, String str, int open, int close) { if (str.length() == 2 * n) { ans.add(str); return; } if (open < n) { generateCombinations_backtrack(ans, n, str + '(', open + 1, close); } // At this step if you do close< n , then it would generate combinations where the number of brackets is equal // but also includes those results which are not valid if (close < open) { generateCombinations_backtrack(ans, n, str + ')', open, close + 1); } } }
2,336
0.534247
0.530394
85
26.482353
25.101963
118
false
false
0
0
0
0
0
0
0.658824
false
false
3
3b978325d71df55d91d740a180f5e3e2205e7c93
22,703,197,184,485
a4b640c9ba3ee5a8572a9a3e05356ec57b4d8c3f
/consultemed/src/main/java/br/com/consultemed/dao/ConsultaDAO.java
117b7342bd20ef826be7b04afbbe2049e9d7a842
[]
no_license
SergioDiniz/iesp-aula-15-06-19-ORM
https://github.com/SergioDiniz/iesp-aula-15-06-19-ORM
d1faca1dcfff3ae932dbd736523f1b5cea6c95df
5024001924dd0ca43e37fd5d45cab0ec33486210
refs/heads/master
2022-07-19T02:01:34.460000
2019-06-28T23:45:21
2019-06-28T23:45:21
192,079,243
2
1
null
false
2022-06-21T01:17:17
2019-06-15T13:02:56
2022-05-18T17:44:33
2022-06-21T01:17:13
217
0
1
2
Java
false
false
package br.com.consultemed.dao; import br.com.consultemed.model.Consulta; import javax.persistence.Query; import javax.persistence.TemporalType; import java.util.Date; import java.util.List; public class ConsultaDAO extends DAO<Consulta> { public ConsultaDAO() { super(Consulta.class); } public List<Consulta> consultarPorPeriodo(Date inicio, Date fim){ Query query = this.getManager().createQuery("SELECT C FROM Consulta C WHERE C.dataDaConsulta BETWEEN :dataInicial AND :dataFinal"); query.setParameter("dataInicial", inicio, TemporalType.DATE); query.setParameter("dataFinal", fim, TemporalType.DATE); List<Consulta> result = query.getResultList(); return result; } }
UTF-8
Java
742
java
ConsultaDAO.java
Java
[]
null
[]
package br.com.consultemed.dao; import br.com.consultemed.model.Consulta; import javax.persistence.Query; import javax.persistence.TemporalType; import java.util.Date; import java.util.List; public class ConsultaDAO extends DAO<Consulta> { public ConsultaDAO() { super(Consulta.class); } public List<Consulta> consultarPorPeriodo(Date inicio, Date fim){ Query query = this.getManager().createQuery("SELECT C FROM Consulta C WHERE C.dataDaConsulta BETWEEN :dataInicial AND :dataFinal"); query.setParameter("dataInicial", inicio, TemporalType.DATE); query.setParameter("dataFinal", fim, TemporalType.DATE); List<Consulta> result = query.getResultList(); return result; } }
742
0.721024
0.721024
24
29.916666
32.238586
139
false
false
0
0
0
0
0
0
0.708333
false
false
3
75d9dff6d36f434e6b80caa28b0db811369efbf1
20,349,555,065,391
e51f29269a97471017639e284bf2aa5b78b2dffd
/src/com/automationpractice/selenium/BrokenImagesTest.java
f0c65abe3347ab1ab1734567c247bd7643432039
[]
no_license
nuralfiekowati/automationcodespractice
https://github.com/nuralfiekowati/automationcodespractice
168c21b752b320420e8dc491a8bbd4046f102cfa
986b4906dcc6e7dbb25a79b41ca79bb331844103
refs/heads/master
2020-03-20T18:16:08.614000
2018-06-21T01:21:19
2018-06-21T01:21:19
137,579,741
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.automationpractice.selenium; import java.io.IOException; import java.util.List; import org.apache.http.HttpResponse; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.HttpClientBuilder; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; class BrokenImagesTest { private int brokenImageCount; public void findInvalidImages(WebDriver driver) { brokenImageCount = 0; List<WebElement> imageList = driver.findElements(By.tagName("img")); System.out.println("Total number of images : " + imageList.size()); if (imageList != null && imageList.size() > 0) { for (WebElement imageElement : imageList) { if (imageElement != null) { verifyImageVisible(imageElement); } } } System.out.println("Total number of invalid image : " + brokenImageCount); } public void verifyImageVisible(WebElement imageElement) { try { HttpClient client = HttpClientBuilder.create().build(); HttpGet request = new HttpGet(imageElement.getAttribute("src")); HttpResponse response = client.execute(request); if (response.getStatusLine().getStatusCode() != 200) { brokenImageCount++; } } catch (ClientProtocolException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
UTF-8
Java
1,596
java
BrokenImagesTest.java
Java
[]
null
[]
package com.automationpractice.selenium; import java.io.IOException; import java.util.List; import org.apache.http.HttpResponse; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.HttpClientBuilder; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; class BrokenImagesTest { private int brokenImageCount; public void findInvalidImages(WebDriver driver) { brokenImageCount = 0; List<WebElement> imageList = driver.findElements(By.tagName("img")); System.out.println("Total number of images : " + imageList.size()); if (imageList != null && imageList.size() > 0) { for (WebElement imageElement : imageList) { if (imageElement != null) { verifyImageVisible(imageElement); } } } System.out.println("Total number of invalid image : " + brokenImageCount); } public void verifyImageVisible(WebElement imageElement) { try { HttpClient client = HttpClientBuilder.create().build(); HttpGet request = new HttpGet(imageElement.getAttribute("src")); HttpResponse response = client.execute(request); if (response.getStatusLine().getStatusCode() != 200) { brokenImageCount++; } } catch (ClientProtocolException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
1,596
0.699248
0.696115
67
21.820896
23.237852
76
false
false
0
0
0
0
0
0
1.462687
false
false
3
ca52f499c14b656462b38c3c4c8b5f7a6833ac1c
5,145,370,862,852
bef7a61eb59a6ebf727b3d997575d73aa9b55034
/rest_server/src/main/java/pl/pgorka/warehouse/rest/ShoeController.java
7455cb1afc96a846105ce3ba59f9e2f5a74071e5
[]
no_license
PgCola/warehouse_app
https://github.com/PgCola/warehouse_app
10e765e72d782b0b9c20d26a42ad65ba9e346828
b9cba070d50a2baa1131ab5c90e3112e9040c7ce
refs/heads/master
2020-03-29T20:39:49.602000
2018-09-27T23:35:19
2018-09-27T23:35:19
133,690,675
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package pl.pgorka.warehouse.rest; import java.util.Arrays; import java.util.List; import javax.persistence.NoResultException; import javax.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; 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.RestController; import pl.pgorka.warehouse.entity.Color; import pl.pgorka.warehouse.entity.SaleSession; import pl.pgorka.warehouse.entity.Shoe; import pl.pgorka.warehouse.exception.ColorNotFoundException; import pl.pgorka.warehouse.exception.MagazineNotFoundException; import pl.pgorka.warehouse.exception.ManufacturerNotFoundException; import pl.pgorka.warehouse.security.JwtTokenProvider; import pl.pgorka.warehouse.service.ColorService; import pl.pgorka.warehouse.service.MagazineService; import pl.pgorka.warehouse.service.ManufacturerService; import pl.pgorka.warehouse.service.SaleSessionService; import pl.pgorka.warehouse.service.ShoeService; @CrossOrigin @RestController @RequestMapping("/api") public class ShoeController { @Autowired private ShoeService shoeService; @Autowired private ManufacturerService manufacturerService; @Autowired private ColorService colorService; @Autowired private MagazineService magazineService; @Autowired private SaleSessionService saleSessionService; @Autowired private Environment env; @Autowired private JwtTokenProvider jwtTokenProvider; @GetMapping("/shoes") private List<Shoe> getShoes(HttpServletRequest request){ return shoeService.getShoes(); } @RequestMapping(value="/shoes/pagination", method = RequestMethod.GET) private List<Shoe> getShoesPaginated(@RequestParam int offset, @RequestParam int limit){ return shoeService.getShoesPaginated((offset * limit), limit); } @RequestMapping(value="/shoes/pages", method = RequestMethod.GET) private int getShoePages(@RequestParam("limit") int limit) { return shoeService.getShoePages(limit); } @GetMapping("/shoes/{id}") private Shoe getShoe(@PathVariable int id) { return shoeService.getShoe(id); } @PostMapping("/shoes") private void saveShoe(@RequestBody Shoe shoe) { if(manufacturerService.getManufacturer(shoe.getIdManufacturer().getId()) == null) { throw new ManufacturerNotFoundException("Manufacturer with id "+shoe.getIdManufacturer().getId()+" not found"); } if(colorService.getColor(shoe.getIdColor().getId()) == null) { throw new ColorNotFoundException("Color with id "+shoe.getIdColor().getId()+" not found"); } if(magazineService.getMagazine(shoe.getIdMagazine().getId()) == null) { throw new MagazineNotFoundException("Magazine with id "+shoe.getIdMagazine().getId()+" not found"); } shoe.setId(0); shoeService.saveShoe(shoe); } @PutMapping("/shoes") private Shoe updateShoe(@RequestBody Shoe shoe) { shoeService.saveShoe(shoe); return shoe; } @GetMapping("/shoes/colors/{id}") private List<Color> getColorsOfShoes(@PathVariable String id){ return shoeService.getColorsByShoe(id); } @GetMapping("/shoes/sizes/{id}") private List<Float> getSizesOfSHoes(@PathVariable String id){ return shoeService.getSizesByShoe(id); } @PostMapping("/shoes/salesession/add/{id}") private boolean addShoeToSaleSession(@PathVariable int id, HttpServletRequest request) { String jwt = Arrays.stream(request.getCookies()).filter(e -> e.getName().equals(env.getProperty("jwt.tokenName"))).findFirst().get().getValue(); SaleSession ses = null; Integer userId = jwtTokenProvider.getUserIdFromJwt(jwt); if(userId != null) { try { ses = saleSessionService.findSaleSessionByUserId(userId); }catch(NoResultException e) { } if(ses == null){ ses = new SaleSession(); ses.setId(0); ses.setUserId(userId); ses.setStatus(0); saleSessionService.saveSession(ses); } }else{ //MA TUTAJ WYRZUCAC EXCEPTION BRAK UZYTKOWNIKA return false; } Shoe shoe = shoeService.getShoe(id); if(shoe.getIdSaleSession() != null) { return false; }else { shoe.setIdSaleSession(ses.getId()); shoeService.saveShoe(shoe); return true; } } }
UTF-8
Java
4,844
java
ShoeController.java
Java
[]
null
[]
package pl.pgorka.warehouse.rest; import java.util.Arrays; import java.util.List; import javax.persistence.NoResultException; import javax.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; 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.RestController; import pl.pgorka.warehouse.entity.Color; import pl.pgorka.warehouse.entity.SaleSession; import pl.pgorka.warehouse.entity.Shoe; import pl.pgorka.warehouse.exception.ColorNotFoundException; import pl.pgorka.warehouse.exception.MagazineNotFoundException; import pl.pgorka.warehouse.exception.ManufacturerNotFoundException; import pl.pgorka.warehouse.security.JwtTokenProvider; import pl.pgorka.warehouse.service.ColorService; import pl.pgorka.warehouse.service.MagazineService; import pl.pgorka.warehouse.service.ManufacturerService; import pl.pgorka.warehouse.service.SaleSessionService; import pl.pgorka.warehouse.service.ShoeService; @CrossOrigin @RestController @RequestMapping("/api") public class ShoeController { @Autowired private ShoeService shoeService; @Autowired private ManufacturerService manufacturerService; @Autowired private ColorService colorService; @Autowired private MagazineService magazineService; @Autowired private SaleSessionService saleSessionService; @Autowired private Environment env; @Autowired private JwtTokenProvider jwtTokenProvider; @GetMapping("/shoes") private List<Shoe> getShoes(HttpServletRequest request){ return shoeService.getShoes(); } @RequestMapping(value="/shoes/pagination", method = RequestMethod.GET) private List<Shoe> getShoesPaginated(@RequestParam int offset, @RequestParam int limit){ return shoeService.getShoesPaginated((offset * limit), limit); } @RequestMapping(value="/shoes/pages", method = RequestMethod.GET) private int getShoePages(@RequestParam("limit") int limit) { return shoeService.getShoePages(limit); } @GetMapping("/shoes/{id}") private Shoe getShoe(@PathVariable int id) { return shoeService.getShoe(id); } @PostMapping("/shoes") private void saveShoe(@RequestBody Shoe shoe) { if(manufacturerService.getManufacturer(shoe.getIdManufacturer().getId()) == null) { throw new ManufacturerNotFoundException("Manufacturer with id "+shoe.getIdManufacturer().getId()+" not found"); } if(colorService.getColor(shoe.getIdColor().getId()) == null) { throw new ColorNotFoundException("Color with id "+shoe.getIdColor().getId()+" not found"); } if(magazineService.getMagazine(shoe.getIdMagazine().getId()) == null) { throw new MagazineNotFoundException("Magazine with id "+shoe.getIdMagazine().getId()+" not found"); } shoe.setId(0); shoeService.saveShoe(shoe); } @PutMapping("/shoes") private Shoe updateShoe(@RequestBody Shoe shoe) { shoeService.saveShoe(shoe); return shoe; } @GetMapping("/shoes/colors/{id}") private List<Color> getColorsOfShoes(@PathVariable String id){ return shoeService.getColorsByShoe(id); } @GetMapping("/shoes/sizes/{id}") private List<Float> getSizesOfSHoes(@PathVariable String id){ return shoeService.getSizesByShoe(id); } @PostMapping("/shoes/salesession/add/{id}") private boolean addShoeToSaleSession(@PathVariable int id, HttpServletRequest request) { String jwt = Arrays.stream(request.getCookies()).filter(e -> e.getName().equals(env.getProperty("jwt.tokenName"))).findFirst().get().getValue(); SaleSession ses = null; Integer userId = jwtTokenProvider.getUserIdFromJwt(jwt); if(userId != null) { try { ses = saleSessionService.findSaleSessionByUserId(userId); }catch(NoResultException e) { } if(ses == null){ ses = new SaleSession(); ses.setId(0); ses.setUserId(userId); ses.setStatus(0); saleSessionService.saveSession(ses); } }else{ //MA TUTAJ WYRZUCAC EXCEPTION BRAK UZYTKOWNIKA return false; } Shoe shoe = shoeService.getShoe(id); if(shoe.getIdSaleSession() != null) { return false; }else { shoe.setIdSaleSession(ses.getId()); shoeService.saveShoe(shoe); return true; } } }
4,844
0.745458
0.744839
151
30.07947
27.860704
146
false
false
0
0
0
0
0
0
1.735099
false
false
3
34d3902260eb4131ff1cca48447a01bf05b2f6b3
18,992,345,425,310
c4dfbb6538d03e15c5de7a0ab359aad6df8e45c0
/NewCompany/src/main/java/com/qienProgramma/rest/EmployeeEndpoint.java
ec9c4ea15f85bbba627d62061a1170e6afb967e3
[]
no_license
Cecilia86/WeekopdrachtWk31
https://github.com/Cecilia86/WeekopdrachtWk31
684657c7f1bbe54ca296e46960931896551428d3
0048b0f9ce6d59466526898768bbf3ef139961e5
refs/heads/master
2022-11-26T18:14:17.464000
2020-07-31T13:51:02
2020-07-31T13:51:02
284,045,064
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.qienProgramma.rest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.qienProgramma.controller.EmployeeService; import com.qienProgramma.model.Employee; @RestController @RequestMapping("/api/Employee") public class EmployeeEndpoint { @Autowired EmployeeService es; @PostMapping("/new") public Employee addEmployee(@RequestBody Employee employee) { return es.addEmployee(employee); } @GetMapping("/all") public Iterable<Employee> getEmployees(){ return es.getAllEmployees(); } @GetMapping("/id/{id}") public Employee getEmployeeByID(@PathVariable(value = "id") long id){ return es.getById(id); } @DeleteMapping("/delete/{id}") public void deleteEmployeeById(@PathVariable(value = "id") long id) { es.deleteEmployeeById(id); } }
UTF-8
Java
1,300
java
EmployeeEndpoint.java
Java
[]
null
[]
package com.qienProgramma.rest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.qienProgramma.controller.EmployeeService; import com.qienProgramma.model.Employee; @RestController @RequestMapping("/api/Employee") public class EmployeeEndpoint { @Autowired EmployeeService es; @PostMapping("/new") public Employee addEmployee(@RequestBody Employee employee) { return es.addEmployee(employee); } @GetMapping("/all") public Iterable<Employee> getEmployees(){ return es.getAllEmployees(); } @GetMapping("/id/{id}") public Employee getEmployeeByID(@PathVariable(value = "id") long id){ return es.getById(id); } @DeleteMapping("/delete/{id}") public void deleteEmployeeById(@PathVariable(value = "id") long id) { es.deleteEmployeeById(id); } }
1,300
0.747692
0.747692
39
32.333332
24.081415
74
false
false
0
0
0
0
0
0
0.871795
false
false
3
198964581ae9c1f5eb384329b1012e1723eec196
18,992,345,424,798
0e846c4825a1fb8496e31f2aaecec7e65d98bbdc
/RoadTripTest.java
922e4dfa57b80eef91430db2c1f0004840b7b478
[]
no_license
alphago004/PathFinder
https://github.com/alphago004/PathFinder
d713a6a3bc0fae8f5179c65d596d5e380abadf86
8d37f9dd6dd9cd1e89e437313595dedd5ff377b0
refs/heads/main
2023-09-01T14:34:55.939000
2021-10-28T22:07:04
2021-10-28T22:07:04
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
import java.io.FileNotFoundException; /** Program to perform basic testing of the RoadTrip class. Comments include expected output produced by method calls. */ public class RoadTripTest { public static void main (String[] args) { RoadTrip roads = new RoadTrip("states.txt"); System.out.println(roads.getPath("LA", "TX")); /* There is a path from LA to TX The shortest path involves crossing 1 borders Path: [LA -> TX] */ System.out.println(roads.getPath("LA", "FL")); /* There is a path from LA to FL The shortest path involves crossing 3 borders Path: [LA -> MS -> AL -> FL] */ System.out.println(roads.getPath("LA", "OR")); /* There is a path from LA to OR The shortest path involves crossing 5 borders Path: [LA -> TX -> NM -> AZ -> CA -> OR] */ } }
UTF-8
Java
959
java
RoadTripTest.java
Java
[]
null
[]
import java.io.FileNotFoundException; /** Program to perform basic testing of the RoadTrip class. Comments include expected output produced by method calls. */ public class RoadTripTest { public static void main (String[] args) { RoadTrip roads = new RoadTrip("states.txt"); System.out.println(roads.getPath("LA", "TX")); /* There is a path from LA to TX The shortest path involves crossing 1 borders Path: [LA -> TX] */ System.out.println(roads.getPath("LA", "FL")); /* There is a path from LA to FL The shortest path involves crossing 3 borders Path: [LA -> MS -> AL -> FL] */ System.out.println(roads.getPath("LA", "OR")); /* There is a path from LA to OR The shortest path involves crossing 5 borders Path: [LA -> TX -> NM -> AZ -> CA -> OR] */ } }
959
0.552659
0.549531
37
23.972973
22.40715
59
false
false
0
0
0
0
0
0
0.216216
false
false
3
cf07ec2988cb94696ba1eae268ebf1296aa8955e
670,014,933,912
e644f566bf742cbed4513aa5a8da80db35e6995a
/i-util-route-datasource/src/main/java/com/isen/util/route/datasource/controller/UserController.java
f44ab1345108d6b3232f479e4dc1138c48440e63
[]
no_license
Isen18/iutil
https://github.com/Isen18/iutil
b914e5b1431418341615cf8549f838c728f66b06
205613635504d050307d22abc7f709f82e2fa50b
refs/heads/master
2022-06-27T01:20:00.332000
2020-12-08T15:01:29
2020-12-08T15:01:29
155,679,723
0
0
null
false
2022-06-21T01:05:26
2018-11-01T07:43:03
2020-12-08T15:01:43
2022-06-21T01:05:22
122
0
0
14
Java
false
false
package com.isen.util.route.datasource.controller; import com.isen.util.route.datasource.vo.UpdateGroup; import com.isen.util.route.datasource.vo.UserVo; import java.util.List; import javax.validation.Valid; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import org.hibernate.validator.constraints.Range; import org.springframework.validation.BindingResult; import org.springframework.validation.FieldError; import org.springframework.validation.ObjectError; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; /** * @author Isen * @date 2019/4/29 23:03 * @since 1.0 */ @RestController @RequestMapping("/user") @Validated public class UserController { /** * curl http://localhost:8080/user/add * @param userVo * @return */ @RequestMapping("/add") public String addUser(@Valid UserVo userVo, BindingResult bindingResult){ //BindingResult 一定要直接紧跟在要校验的参数后面,每个要校验的参数后边都可以有一个 BindingResult //BindingResult 主要是获取错误信息,非必须,因为如果校验失败,会抛出异常,有统一异常处理器处理 if (bindingResult.hasErrors()) { List<ObjectError> objectErrors = bindingResult.getAllErrors(); for(ObjectError objectError : objectErrors){ if (objectError instanceof FieldError) { FieldError fieldError = (FieldError) objectError; System.out.println(fieldError.getField() + fieldError.getDefaultMessage()); } //进行一些出错处理,例如跳转到错误页面 } } return "ok"; } @RequestMapping("/add2") public String addUser(@NotBlank(message = "姓名不能为空") String name, @Range(min = 1, max = 150, message = "年龄需要在{min}-{max}之间") @NotNull String age){ //BindingResult省略 return "ok"; } @RequestMapping("/update") public String updateUser(@Validated({UpdateGroup.class}) UserVo userVo, @Validated UserVo userVo2){ //userVo 配置了分组 UpdateGroup,只使用具有标识分组 UpdateGroup 的校验规则 //userVo2 没有配置分组,使用没有分组的校验规则 return "ok"; } }
UTF-8
Java
2,523
java
UserController.java
Java
[ { "context": "eb.bind.annotation.RestController;\n\n/**\n * @author Isen\n * @date 2019/4/29 23:03\n * @since 1.0\n */\n@Res", "end": 769, "score": 0.5043619871139526, "start": 767, "tag": "NAME", "value": "Is" }, { "context": "bind.annotation.RestController;\n\n/**\n * @author Isen\n * @date 2019/4/29 23:03\n * @since 1.0\n */\n@RestC", "end": 771, "score": 0.581108033657074, "start": 769, "tag": "USERNAME", "value": "en" } ]
null
[]
package com.isen.util.route.datasource.controller; import com.isen.util.route.datasource.vo.UpdateGroup; import com.isen.util.route.datasource.vo.UserVo; import java.util.List; import javax.validation.Valid; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import org.hibernate.validator.constraints.Range; import org.springframework.validation.BindingResult; import org.springframework.validation.FieldError; import org.springframework.validation.ObjectError; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; /** * @author Isen * @date 2019/4/29 23:03 * @since 1.0 */ @RestController @RequestMapping("/user") @Validated public class UserController { /** * curl http://localhost:8080/user/add * @param userVo * @return */ @RequestMapping("/add") public String addUser(@Valid UserVo userVo, BindingResult bindingResult){ //BindingResult 一定要直接紧跟在要校验的参数后面,每个要校验的参数后边都可以有一个 BindingResult //BindingResult 主要是获取错误信息,非必须,因为如果校验失败,会抛出异常,有统一异常处理器处理 if (bindingResult.hasErrors()) { List<ObjectError> objectErrors = bindingResult.getAllErrors(); for(ObjectError objectError : objectErrors){ if (objectError instanceof FieldError) { FieldError fieldError = (FieldError) objectError; System.out.println(fieldError.getField() + fieldError.getDefaultMessage()); } //进行一些出错处理,例如跳转到错误页面 } } return "ok"; } @RequestMapping("/add2") public String addUser(@NotBlank(message = "姓名不能为空") String name, @Range(min = 1, max = 150, message = "年龄需要在{min}-{max}之间") @NotNull String age){ //BindingResult省略 return "ok"; } @RequestMapping("/update") public String updateUser(@Validated({UpdateGroup.class}) UserVo userVo, @Validated UserVo userVo2){ //userVo 配置了分组 UpdateGroup,只使用具有标识分组 UpdateGroup 的校验规则 //userVo2 没有配置分组,使用没有分组的校验规则 return "ok"; } }
2,523
0.701386
0.690657
64
33.953125
29.398357
149
false
false
0
0
0
0
0
0
0.40625
false
false
3
f0eb200bfb630afe5e4cd1af143b772df996dae9
24,163,486,054,967
d273664291b412f4d19776290094499b8ee6f934
/server/src/main/java/com/github/sgov/server/model/AbstractUser.java
5f6d77286fd4d7fdd98b2865cade1ea821061bb1
[]
no_license
ledsoft/sgov
https://github.com/ledsoft/sgov
fd2afcb65cdae57c99fa9fab2d3502cfbb413af6
13cba578a94916ebdd24fa7dffddec0cfa8cb220
refs/heads/master
2022-11-17T00:56:08.219000
2020-07-13T12:16:11
2020-07-13T12:16:11
279,292,929
0
0
null
true
2020-07-13T12:12:10
2020-07-13T12:12:09
2020-07-10T09:15:41
2020-07-10T09:15:39
385
0
0
0
null
false
false
package com.github.sgov.server.model; import com.github.sgov.server.model.util.HasIdentifier; import com.github.sgov.server.model.util.HasTypes; import com.github.sgov.server.util.Vocabulary; import cz.cvut.kbss.jopa.model.annotations.Id; import cz.cvut.kbss.jopa.model.annotations.MappedSuperclass; import cz.cvut.kbss.jopa.model.annotations.OWLDataProperty; import cz.cvut.kbss.jopa.model.annotations.ParticipationConstraints; import cz.cvut.kbss.jopa.model.annotations.Types; import java.io.Serializable; import java.net.URI; import java.util.Objects; import java.util.Set; import javax.validation.constraints.NotBlank; @MappedSuperclass abstract class AbstractUser implements HasIdentifier, HasTypes, Serializable { @Id protected URI uri; @NotBlank @ParticipationConstraints(nonEmpty = true) @OWLDataProperty(iri = Vocabulary.s_p_ma_krestni_jmeno) protected String firstName; @NotBlank @ParticipationConstraints(nonEmpty = true) @OWLDataProperty(iri = Vocabulary.s_p_ma_prijmeni) protected String lastName; @NotBlank @ParticipationConstraints(nonEmpty = true) @OWLDataProperty(iri = Vocabulary.s_p_ma_uzivatelske_jmeno) protected String username; @Types protected Set<String> types; @Override public URI getUri() { return uri; } @Override public void setUri(URI uri) { this.uri = uri; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } @Override public Set<String> getTypes() { return types; } @Override public void setTypes(Set<String> types) { this.types = types; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof AbstractUser)) { return false; } final AbstractUser that = (AbstractUser) o; return Objects.equals(uri, that.uri) && Objects.equals(username, that.username); } @Override public int hashCode() { return Objects.hash(uri, username); } @Override public String toString() { return "User{" + firstName + " " + lastName + ", username='" + username + '\'' + '}'; } }
UTF-8
Java
2,675
java
AbstractUser.java
Java
[ { "context": " toString() {\n return \"User{\"\n + firstName\n + \" \" + lastName\n + \", use", "end": 2571, "score": 0.99143385887146, "start": 2562, "tag": "NAME", "value": "firstName" }, { "context": "User{\"\n + firstName\n + \" \" + lastName\n + \", username='\" + username + '\\''\n ", "end": 2600, "score": 0.9980327486991882, "start": 2592, "tag": "NAME", "value": "lastName" }, { "context": " + \" \" + lastName\n + \", username='\" + username + '\\''\n + '}';\n }\n}\n", "end": 2640, "score": 0.9964750409126282, "start": 2632, "tag": "USERNAME", "value": "username" } ]
null
[]
package com.github.sgov.server.model; import com.github.sgov.server.model.util.HasIdentifier; import com.github.sgov.server.model.util.HasTypes; import com.github.sgov.server.util.Vocabulary; import cz.cvut.kbss.jopa.model.annotations.Id; import cz.cvut.kbss.jopa.model.annotations.MappedSuperclass; import cz.cvut.kbss.jopa.model.annotations.OWLDataProperty; import cz.cvut.kbss.jopa.model.annotations.ParticipationConstraints; import cz.cvut.kbss.jopa.model.annotations.Types; import java.io.Serializable; import java.net.URI; import java.util.Objects; import java.util.Set; import javax.validation.constraints.NotBlank; @MappedSuperclass abstract class AbstractUser implements HasIdentifier, HasTypes, Serializable { @Id protected URI uri; @NotBlank @ParticipationConstraints(nonEmpty = true) @OWLDataProperty(iri = Vocabulary.s_p_ma_krestni_jmeno) protected String firstName; @NotBlank @ParticipationConstraints(nonEmpty = true) @OWLDataProperty(iri = Vocabulary.s_p_ma_prijmeni) protected String lastName; @NotBlank @ParticipationConstraints(nonEmpty = true) @OWLDataProperty(iri = Vocabulary.s_p_ma_uzivatelske_jmeno) protected String username; @Types protected Set<String> types; @Override public URI getUri() { return uri; } @Override public void setUri(URI uri) { this.uri = uri; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } @Override public Set<String> getTypes() { return types; } @Override public void setTypes(Set<String> types) { this.types = types; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof AbstractUser)) { return false; } final AbstractUser that = (AbstractUser) o; return Objects.equals(uri, that.uri) && Objects.equals(username, that.username); } @Override public int hashCode() { return Objects.hash(uri, username); } @Override public String toString() { return "User{" + firstName + " " + lastName + ", username='" + username + '\'' + '}'; } }
2,675
0.650093
0.650093
110
23.318182
20.115093
88
false
false
0
0
0
0
0
0
0.372727
false
false
3
c3b6d8ee5abd052187b41e19d5f5ed4e15f9c28f
30,331,059,091,982
3916b10b9fb1ca283e21328a386818eb078186f9
/app/src/main/java/com/testkart/exam/edu/exam/StartExamConfirmationDialog.java
f778aafd6a49f05949b75116d856e5553664170c
[]
no_license
zuzuauthor/Testkart
https://github.com/zuzuauthor/Testkart
51dbbdca3cff8c431fad6a6b8a9a25c021a5636f
6c8deb51cea8163c1932d22a9356d7b471af5d60
refs/heads/master
2020-03-21T10:45:20.349000
2018-07-11T07:51:34
2018-07-11T07:51:34
138,469,360
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.testkart.exam.edu.exam; import android.app.Dialog; import android.content.Context; import android.content.DialogInterface; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v4.app.DialogFragment; import android.support.v7.app.AlertDialog; import android.view.LayoutInflater; import android.view.View; import android.widget.TextView; import com.testkart.exam.R; import com.testkart.exam.edu.exam.examlist.Exam; /** * Created by testkart on 28/4/17. */ public class StartExamConfirmationDialog extends DialogFragment { public static final String KEY_EXAM_DETAILS = "exam_details"; public static final String KEY_EXAM_EXPIRE = "exam_expire"; private String examId; //private ImageView viewNoQuestions, viewExamDuration, viewTotalMarks, viewCorrectMarks, viewPeneltyMarks; private TextView examName, examExpiry, examType, startDate, endDate, paidExam, amount, attemptCont, expiry, attempt, attemptOrder; private OnexamSelectListener mListener; public interface OnexamSelectListener{ void onExamSelect(String examId); } @Override public void onAttach(Context context) { super.onAttach(context); try{ mListener = (OnexamSelectListener)context; }catch(Exception e){ e.printStackTrace(); } } @NonNull @Override public Dialog onCreateDialog(Bundle savedInstanceState) { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); View rootView = LayoutInflater.from(getActivity()).inflate(R.layout.dialog_start_confermation_dialog, null); //initialize initialization(rootView); builder.setView(rootView); builder.setPositiveButton("Attempt Now", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { //show feedback activity if(mListener != null){ mListener.onExamSelect(examId); } } }); builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dismiss(); } }); AlertDialog d = builder.create(); return d; } private void initialization(View rv) { Exam exam = (Exam) getArguments().getSerializable(KEY_EXAM_DETAILS); String ee = getArguments().getString(KEY_EXAM_EXPIRE); examName = (TextView)rv.findViewById(R.id.examName); examExpiry = (TextView)rv.findViewById(R.id.examExpiry); examType = (TextView)rv.findViewById(R.id.examType); startDate = (TextView)rv.findViewById(R.id.startDate); endDate = (TextView)rv.findViewById(R.id.endDate); paidExam = (TextView)rv.findViewById(R.id.paidExam); amount = (TextView)rv.findViewById(R.id.amount); attemptCont = (TextView)rv.findViewById(R.id.attemptCont); expiry = (TextView)rv.findViewById(R.id.expiry); attempt = (TextView)rv.findViewById(R.id.attempt); attemptOrder = (TextView)rv.findViewById(R.id.attemptOrder); if(exam != null){ examId = exam.getId(); examName.setText(exam.getName()); examType.setText(exam.getType()); startDate.setText(exam.getStartDate()); endDate.setText(exam.getEndDate()); paidExam.setText(exam.getPaidExam()); amount.setText((String)exam.getAmount()); attemptCont.setText(exam.getAttemptCount()); expiry.setText((String)exam.getExpiry()); attempt.setText(exam.getAttempt()); attemptOrder.setText(exam.getAttemptOrder()); } if(ee != null){ examExpiry.setText(ee); } } }
UTF-8
Java
3,939
java
StartExamConfirmationDialog.java
Java
[ { "context": "rt.exam.edu.exam.examlist.Exam;\n\n/**\n * Created by testkart on 28/4/17.\n */\n\npublic class StartExamConfirmati", "end": 493, "score": 0.9996702671051025, "start": 485, "tag": "USERNAME", "value": "testkart" } ]
null
[]
package com.testkart.exam.edu.exam; import android.app.Dialog; import android.content.Context; import android.content.DialogInterface; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v4.app.DialogFragment; import android.support.v7.app.AlertDialog; import android.view.LayoutInflater; import android.view.View; import android.widget.TextView; import com.testkart.exam.R; import com.testkart.exam.edu.exam.examlist.Exam; /** * Created by testkart on 28/4/17. */ public class StartExamConfirmationDialog extends DialogFragment { public static final String KEY_EXAM_DETAILS = "exam_details"; public static final String KEY_EXAM_EXPIRE = "exam_expire"; private String examId; //private ImageView viewNoQuestions, viewExamDuration, viewTotalMarks, viewCorrectMarks, viewPeneltyMarks; private TextView examName, examExpiry, examType, startDate, endDate, paidExam, amount, attemptCont, expiry, attempt, attemptOrder; private OnexamSelectListener mListener; public interface OnexamSelectListener{ void onExamSelect(String examId); } @Override public void onAttach(Context context) { super.onAttach(context); try{ mListener = (OnexamSelectListener)context; }catch(Exception e){ e.printStackTrace(); } } @NonNull @Override public Dialog onCreateDialog(Bundle savedInstanceState) { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); View rootView = LayoutInflater.from(getActivity()).inflate(R.layout.dialog_start_confermation_dialog, null); //initialize initialization(rootView); builder.setView(rootView); builder.setPositiveButton("Attempt Now", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { //show feedback activity if(mListener != null){ mListener.onExamSelect(examId); } } }); builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dismiss(); } }); AlertDialog d = builder.create(); return d; } private void initialization(View rv) { Exam exam = (Exam) getArguments().getSerializable(KEY_EXAM_DETAILS); String ee = getArguments().getString(KEY_EXAM_EXPIRE); examName = (TextView)rv.findViewById(R.id.examName); examExpiry = (TextView)rv.findViewById(R.id.examExpiry); examType = (TextView)rv.findViewById(R.id.examType); startDate = (TextView)rv.findViewById(R.id.startDate); endDate = (TextView)rv.findViewById(R.id.endDate); paidExam = (TextView)rv.findViewById(R.id.paidExam); amount = (TextView)rv.findViewById(R.id.amount); attemptCont = (TextView)rv.findViewById(R.id.attemptCont); expiry = (TextView)rv.findViewById(R.id.expiry); attempt = (TextView)rv.findViewById(R.id.attempt); attemptOrder = (TextView)rv.findViewById(R.id.attemptOrder); if(exam != null){ examId = exam.getId(); examName.setText(exam.getName()); examType.setText(exam.getType()); startDate.setText(exam.getStartDate()); endDate.setText(exam.getEndDate()); paidExam.setText(exam.getPaidExam()); amount.setText((String)exam.getAmount()); attemptCont.setText(exam.getAttemptCount()); expiry.setText((String)exam.getExpiry()); attempt.setText(exam.getAttempt()); attemptOrder.setText(exam.getAttemptOrder()); } if(ee != null){ examExpiry.setText(ee); } } }
3,939
0.650165
0.648388
137
27.759125
28.311234
134
false
false
0
0
0
0
0
0
0.562044
false
false
3
ef5cab52a5c14c5074bf7237184e8ac9001ffc74
5,093,831,263,574
00042bedfd98a8e6e9cd8a8f3c481e6c317dad87
/src/main/java/com/rest/trade/models/CompanyPortfolio.java
4253bd83ae0fb91ae945025cd2523e994607090a
[]
no_license
group4citi/trading-MongoTemplate
https://github.com/group4citi/trading-MongoTemplate
5979a3f9a6512271d5c28fa1dfc7bb9dbb200157
19c3975fa113d7032203266e5fbed76e9c2b43e4
refs/heads/master
2022-12-27T17:05:05.606000
2020-10-12T09:36:19
2020-10-12T09:36:19
303,331,290
0
0
null
false
2020-10-13T08:27:21
2020-10-12T08:46:54
2020-10-12T14:38:27
2020-10-13T07:03:42
261
0
0
1
Java
false
false
package com.rest.trade.models; import java.math.BigDecimal; import org.springframework.data.annotation.Id; import org.springframework.data.mongodb.core.mapping.Document; @Document(collection = "company_portfolio") public class CompanyPortfolio { @Id private String ticker; private String name; private String stock_exchange; private String currency; private BigDecimal price; private BigDecimal dayHigh; private BigDecimal dayLow; private BigDecimal dayOpen; private Long avgVol; public String getTicker() { return ticker; } public void setTicker(String ticker) { this.ticker = ticker; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getStock_exchange() { return stock_exchange; } public void setStock_exchange(String stock_exchange) { this.stock_exchange = stock_exchange; } public String getCurrency() { return currency; } public void setCurrency(String currency) { this.currency = currency; } public BigDecimal getPrice() { return price; } public void setPrice(BigDecimal price) { this.price = price; } public BigDecimal getDayHigh() { return dayHigh; } public void setDayHigh(BigDecimal dayHigh) { this.dayHigh = dayHigh; } public BigDecimal getDayLow() { return dayLow; } public void setDayLow(BigDecimal dayLow) { this.dayLow = dayLow; } public BigDecimal getDayOpen() { return dayOpen; } public void setDayOpen(BigDecimal dayOpen) { this.dayOpen = dayOpen; } public Long getAvgVol() { return avgVol; } public void setAvgVol(Long avgVol) { this.avgVol = avgVol; } }
UTF-8
Java
1,623
java
CompanyPortfolio.java
Java
[]
null
[]
package com.rest.trade.models; import java.math.BigDecimal; import org.springframework.data.annotation.Id; import org.springframework.data.mongodb.core.mapping.Document; @Document(collection = "company_portfolio") public class CompanyPortfolio { @Id private String ticker; private String name; private String stock_exchange; private String currency; private BigDecimal price; private BigDecimal dayHigh; private BigDecimal dayLow; private BigDecimal dayOpen; private Long avgVol; public String getTicker() { return ticker; } public void setTicker(String ticker) { this.ticker = ticker; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getStock_exchange() { return stock_exchange; } public void setStock_exchange(String stock_exchange) { this.stock_exchange = stock_exchange; } public String getCurrency() { return currency; } public void setCurrency(String currency) { this.currency = currency; } public BigDecimal getPrice() { return price; } public void setPrice(BigDecimal price) { this.price = price; } public BigDecimal getDayHigh() { return dayHigh; } public void setDayHigh(BigDecimal dayHigh) { this.dayHigh = dayHigh; } public BigDecimal getDayLow() { return dayLow; } public void setDayLow(BigDecimal dayLow) { this.dayLow = dayLow; } public BigDecimal getDayOpen() { return dayOpen; } public void setDayOpen(BigDecimal dayOpen) { this.dayOpen = dayOpen; } public Long getAvgVol() { return avgVol; } public void setAvgVol(Long avgVol) { this.avgVol = avgVol; } }
1,623
0.736291
0.736291
75
20.639999
15.570604
62
false
false
0
0
0
0
0
0
1.52
false
false
3
5ba356fb8935de3d3cfe72501c193ec9168223b6
5,093,831,260,804
612c7da5e9043ada16709f69ed1cfd84efaa216b
/src/com/s2p/sudarshan/equaliser/lane/preditor/Predictor.java
dca4e982bc534522f454d1fafed9bfd9e923c84d
[]
no_license
guptaknaveen/sudarshan
https://github.com/guptaknaveen/sudarshan
a4044dc1e41bce44be104e1808a58883d607147a
292867546a794afc1290d8de868d67ef4a475351
refs/heads/master
2021-05-11T15:10:24.217000
2020-02-08T14:04:10
2020-02-08T14:04:10
117,716,617
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.s2p.sudarshan.equaliser.lane.preditor; import com.s2p.sudarshan.equaliser.SeriesData; import com.s2p.sudarshan.equaliser.lane.*; import java.util.Set; public interface Predictor { Set<com.s2p.sudarshan.equaliser.lane.Number> predictNumber(SeriesData seriesData); }
UTF-8
Java
284
java
Predictor.java
Java
[]
null
[]
package com.s2p.sudarshan.equaliser.lane.preditor; import com.s2p.sudarshan.equaliser.SeriesData; import com.s2p.sudarshan.equaliser.lane.*; import java.util.Set; public interface Predictor { Set<com.s2p.sudarshan.equaliser.lane.Number> predictNumber(SeriesData seriesData); }
284
0.802817
0.788732
10
27.4
27.375902
86
false
false
0
0
0
0
0
0
0.5
false
false
3
4dc56661197c9b1fa335dce0d171c9305c2b36ff
14,053,133,023,471
4aa9cfd67ea3805418c238b55a98a5626de43e0d
/app/src/main/java/com/findmeahome/findmeahome/interfaces/OnFragmentInteractionListener.java
9385ce6fc8ed7f947fb6b2df99fa858da43d0ca6
[ "Apache-2.0" ]
permissive
juanjecilla/FindMeAHome
https://github.com/juanjecilla/FindMeAHome
8de25d22da62d054bebf4822c85f25887f152b1e
fce9ebd89a5ed56f501cc788da6b04539cfef98e
refs/heads/master
2018-03-03T21:16:09.363000
2017-09-25T11:59:07
2017-09-25T11:59:07
57,069,647
4
0
Apache-2.0
false
2017-12-02T16:17:32
2016-04-25T19:27:06
2017-09-25T11:59:23
2017-12-02T16:15:48
11,471
4
0
0
Java
false
null
package com.findmeahome.findmeahome.interfaces; import android.os.Bundle; /** * Created by juanje on 1/07/16. */ public interface OnFragmentInteractionListener { public void onFragmentInteraction(int id, Bundle bundle); }
UTF-8
Java
231
java
OnFragmentInteractionListener.java
Java
[ { "context": "ces;\n\nimport android.os.Bundle;\n\n/**\n * Created by juanje on 1/07/16.\n */\npublic interface OnFragmentIntera", "end": 100, "score": 0.9995079040527344, "start": 94, "tag": "USERNAME", "value": "juanje" } ]
null
[]
package com.findmeahome.findmeahome.interfaces; import android.os.Bundle; /** * Created by juanje on 1/07/16. */ public interface OnFragmentInteractionListener { public void onFragmentInteraction(int id, Bundle bundle); }
231
0.766234
0.744589
11
20
22.364744
61
false
false
0
0
0
0
0
0
0.363636
false
false
3
31b0e3f1ca0b27e9e9b97ebb0f5b90332bff38d0
24,094,766,569,801
741e55aa32722cd9e6ce9986b1cb1d711c6a73c1
/app/src/main/java/com/yuqf/fengmomusic/db/DownloadingDao.java
1b3c611bc4145a8bf3437381cb82345cd7f6361b
[]
no_license
Android-Novice/FengMoMusic
https://github.com/Android-Novice/FengMoMusic
f06bed51c3f45badc935e48274ce24df96b1b9e6
9da505fc84fbb781fa496f70ae33866a52f4ab1d
refs/heads/master
2020-04-12T09:32:06.445000
2017-11-24T06:34:11
2017-11-24T06:34:11
65,076,608
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.yuqf.fengmomusic.db; import java.util.List; public class DownloadingDao { public final static String TABLE_NAME = "downloading_info"; public final static String MUSIC_ID = "music_id"; public final static String MUSIC_NAME = "music"; public final static String ARTIST = "artist"; public final static String ARTIST_ID = "artist_id"; public final static String DOWNLOAD_URL = "download_url"; public final static String TOTAL_SIZE = "total_size"; public final static String THREAD_INDEX = "thread_index"; public final static String THREAD_COUNT = "thread_count"; public final static String BLOCK_SIZE = "block_size"; public final static String COMPLETE_SIZE = "complete_size"; public final static String COMPLETED = "completed"; private static DownloadingDao downloadingDao; public static DownloadingDao getInstance() { if (downloadingDao == null) downloadingDao = new DownloadingDao(); return downloadingDao; } private DownloadingDao() { } public boolean isDownloading(int musicId, String music) { return DatabaseManager.getInstance().isDownloading(musicId, music); } public List<DownloadingPartMusic> getDownloadingMusic(int musicId, String music) { return DatabaseManager.getInstance().getDownloadingMusic(musicId, music); } public int getDownloadingTotalCount() { return DatabaseManager.getInstance().getDownloadingMusicCount(); } public void insertDownloadingMusic(List<DownloadingPartMusic> list) { DatabaseManager.getInstance().insertDownloadingInfo(list); } public void updateDownloadingMusic(DownloadingPartMusic partMusic, boolean completed) { DatabaseManager.getInstance().updateDownloadingInfo(partMusic, completed); } public void deleteDownloadingMusic(int musicId, String music) { DatabaseManager.getInstance().deleteDownloadingInfo(musicId, music); } }
UTF-8
Java
1,979
java
DownloadingDao.java
Java
[]
null
[]
package com.yuqf.fengmomusic.db; import java.util.List; public class DownloadingDao { public final static String TABLE_NAME = "downloading_info"; public final static String MUSIC_ID = "music_id"; public final static String MUSIC_NAME = "music"; public final static String ARTIST = "artist"; public final static String ARTIST_ID = "artist_id"; public final static String DOWNLOAD_URL = "download_url"; public final static String TOTAL_SIZE = "total_size"; public final static String THREAD_INDEX = "thread_index"; public final static String THREAD_COUNT = "thread_count"; public final static String BLOCK_SIZE = "block_size"; public final static String COMPLETE_SIZE = "complete_size"; public final static String COMPLETED = "completed"; private static DownloadingDao downloadingDao; public static DownloadingDao getInstance() { if (downloadingDao == null) downloadingDao = new DownloadingDao(); return downloadingDao; } private DownloadingDao() { } public boolean isDownloading(int musicId, String music) { return DatabaseManager.getInstance().isDownloading(musicId, music); } public List<DownloadingPartMusic> getDownloadingMusic(int musicId, String music) { return DatabaseManager.getInstance().getDownloadingMusic(musicId, music); } public int getDownloadingTotalCount() { return DatabaseManager.getInstance().getDownloadingMusicCount(); } public void insertDownloadingMusic(List<DownloadingPartMusic> list) { DatabaseManager.getInstance().insertDownloadingInfo(list); } public void updateDownloadingMusic(DownloadingPartMusic partMusic, boolean completed) { DatabaseManager.getInstance().updateDownloadingInfo(partMusic, completed); } public void deleteDownloadingMusic(int musicId, String music) { DatabaseManager.getInstance().deleteDownloadingInfo(musicId, music); } }
1,979
0.723092
0.723092
53
36.339622
29.982349
91
false
false
0
0
0
0
0
0
0.584906
false
false
3
7f42f81db775dc077d86645cbc2ddab4efbfd704
28,527,172,815,501
dfcff679231dee88766aaa23736bb34d6454d8f4
/pimpmyshirt/src/org/pimpmyshirt/web/RateShirtsController.java
d4f8f9d52051940a3586a4f0971a722a35b17199
[]
no_license
Ervacon/spring-samples
https://github.com/Ervacon/spring-samples
f261f5ca16d13d523d74ad71d639fe6ec7f5a4fb
0ca5b445ab99a6427d9eba387cd11f6629416623
refs/heads/master
2021-01-20T23:27:07.047000
2015-02-02T21:00:58
2015-02-02T21:00:58
30,207,884
2
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package org.pimpmyshirt.web; import java.util.HashMap; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.pimpmyshirt.domain.Rating; import org.pimpmyshirt.domain.Shirt; import org.pimpmyshirt.service.ShirtService; import org.springframework.util.StringUtils; import org.springframework.validation.BindException; import org.springframework.web.bind.RequestUtils; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.multiaction.MultiActionController; import org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver; import org.springframework.web.util.WebUtils; /** * Multi-action controller to handle the 'index' page. This involves * several tasks: * - handle displaying the shirt list (the actual front page) * - handle shirt rating * - handle shirt deletion */ public class RateShirtsController extends MultiActionController { private ShirtService shirtService; public RateShirtsController() { /* * Identify handler methods using the "op" request parameter. * By default just display the front page. */ ParameterMethodNameResolver methodNameResolver = new ParameterMethodNameResolver(); methodNameResolver.setParamName("op"); methodNameResolver.setDefaultMethodName("handleFrontPage"); setMethodNameResolver(methodNameResolver); } public void setShirtService(ShirtService shirtService) { this.shirtService = shirtService; } /** * Display the front page: a list of all shirts in the database. */ public ModelAndView handleFrontPage(HttpServletRequest request, HttpServletResponse response) throws Exception { return new ModelAndView("index", getModel()); } /** * Handle a rating request. */ public ModelAndView handleRate(HttpServletRequest request, HttpServletResponse response) throws Exception { /* * We're expecting request parameters of the form * id_<shirtId>=<rating> * for instance * id_123=0 * which would mean: rate shirt with id "123" as "low" (0). * Could also be that we receive * id_123= * in which case no rating was done for identified shirt. */ Map idParams = WebUtils.getParametersStartingWith(request, "id_"); Map<Shirt,Rating> ratings = new HashMap<Shirt,Rating>(); //parse out input for (Object o : idParams.keySet()) { //could be that no rating was selected if (StringUtils.hasText((String)idParams.get(o))) { String s = (String)o; Rating rating = Rating.valueOf((String)idParams.get(s)); String shirtId = StringUtils.delete(s, "id_"); Shirt shirt = shirtService.getShirt(Long.parseLong(shirtId)); ratings.put(shirt, rating); } } if (ratings.isEmpty()) { //no shirts have been rated, this is wrong! BindException be = new BindException(new Object(), "shirtRatings"); be.reject("error.ratings.missing"); Map<String, Object> model = getModel(); model.putAll((Map<? extends String, ? extends Object>)be.getModel()); return new ModelAndView("index", model); } else { shirtService.rateShirts(ratings); //redirect after processing the submission return new ModelAndView("redirect:/index.html"); } } /** * Handle a shirt deletion request. */ public ModelAndView handleDelete(HttpServletRequest request, HttpServletResponse response) throws Exception { Long id = RequestUtils.getLongParameter(request, "id"); shirtService.deleteShirt(id); //redirect after processing the submission return new ModelAndView("redirect:/index.html"); } /** * Internal helper to setup the model backing the 'index' page. */ private Map<String, Object> getModel() { Map<String, Object> m = new HashMap<String, Object>(); m.put("shirtRatings", shirtService.getShirtRatings()); m.put("ratings", Rating.values()); return m; } }
UTF-8
Java
4,016
java
RateShirtsController.java
Java
[]
null
[]
package org.pimpmyshirt.web; import java.util.HashMap; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.pimpmyshirt.domain.Rating; import org.pimpmyshirt.domain.Shirt; import org.pimpmyshirt.service.ShirtService; import org.springframework.util.StringUtils; import org.springframework.validation.BindException; import org.springframework.web.bind.RequestUtils; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.multiaction.MultiActionController; import org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver; import org.springframework.web.util.WebUtils; /** * Multi-action controller to handle the 'index' page. This involves * several tasks: * - handle displaying the shirt list (the actual front page) * - handle shirt rating * - handle shirt deletion */ public class RateShirtsController extends MultiActionController { private ShirtService shirtService; public RateShirtsController() { /* * Identify handler methods using the "op" request parameter. * By default just display the front page. */ ParameterMethodNameResolver methodNameResolver = new ParameterMethodNameResolver(); methodNameResolver.setParamName("op"); methodNameResolver.setDefaultMethodName("handleFrontPage"); setMethodNameResolver(methodNameResolver); } public void setShirtService(ShirtService shirtService) { this.shirtService = shirtService; } /** * Display the front page: a list of all shirts in the database. */ public ModelAndView handleFrontPage(HttpServletRequest request, HttpServletResponse response) throws Exception { return new ModelAndView("index", getModel()); } /** * Handle a rating request. */ public ModelAndView handleRate(HttpServletRequest request, HttpServletResponse response) throws Exception { /* * We're expecting request parameters of the form * id_<shirtId>=<rating> * for instance * id_123=0 * which would mean: rate shirt with id "123" as "low" (0). * Could also be that we receive * id_123= * in which case no rating was done for identified shirt. */ Map idParams = WebUtils.getParametersStartingWith(request, "id_"); Map<Shirt,Rating> ratings = new HashMap<Shirt,Rating>(); //parse out input for (Object o : idParams.keySet()) { //could be that no rating was selected if (StringUtils.hasText((String)idParams.get(o))) { String s = (String)o; Rating rating = Rating.valueOf((String)idParams.get(s)); String shirtId = StringUtils.delete(s, "id_"); Shirt shirt = shirtService.getShirt(Long.parseLong(shirtId)); ratings.put(shirt, rating); } } if (ratings.isEmpty()) { //no shirts have been rated, this is wrong! BindException be = new BindException(new Object(), "shirtRatings"); be.reject("error.ratings.missing"); Map<String, Object> model = getModel(); model.putAll((Map<? extends String, ? extends Object>)be.getModel()); return new ModelAndView("index", model); } else { shirtService.rateShirts(ratings); //redirect after processing the submission return new ModelAndView("redirect:/index.html"); } } /** * Handle a shirt deletion request. */ public ModelAndView handleDelete(HttpServletRequest request, HttpServletResponse response) throws Exception { Long id = RequestUtils.getLongParameter(request, "id"); shirtService.deleteShirt(id); //redirect after processing the submission return new ModelAndView("redirect:/index.html"); } /** * Internal helper to setup the model backing the 'index' page. */ private Map<String, Object> getModel() { Map<String, Object> m = new HashMap<String, Object>(); m.put("shirtRatings", shirtService.getShirtRatings()); m.put("ratings", Rating.values()); return m; } }
4,016
0.712151
0.709412
123
30.650406
27.339178
113
false
false
0
0
0
0
0
0
2.04065
false
false
3
efc5897a915675cdc905e3f47b84aeb098ad6b29
33,363,306,002,978
a13770565216e72f8a39d03f86d0edff4f4b3978
/db-test/src/main/java/cl/fullstack/dbtest/model/customer/CustomerDetail.java
170b83fc92b2802506fd79cfeac20bf7a300bb8b
[]
no_license
cristobalgvera/java-spring-apps
https://github.com/cristobalgvera/java-spring-apps
6508439bfcd28c88bc5765f886ecdd35c0a28343
b0a07f9a0424cbfac6f395cd1fe41cf71a1be825
refs/heads/master
2022-11-29T20:26:51.546000
2020-08-11T04:50:25
2020-08-11T04:50:25
279,224,712
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package cl.fullstack.dbtest.model.customer; import org.springframework.stereotype.Component; import javax.persistence.*; @Entity @Component public class CustomerDetail implements CustomerService { @Id @GeneratedValue(generator = "CUSTOMER_DETAIL_SEQ") protected Long id; @Column(length = 20) private String phoneNumber; @Column(length = 1) private String sex; @Column(length = 30) private String email; @OneToOne(mappedBy = "customerDetail") private Customer customer; public CustomerDetail() { } public CustomerDetail(String phoneNumber, String sex, String email) { this.phoneNumber = phoneNumber; this.sex = sex; this.email = email; } public CustomerDetail(Long id, String phoneNumber, String sex, String email) { this.id = id; this.phoneNumber = phoneNumber; this.sex = sex; this.email = email; } @Override public String toString() { return "CustomerDetail{" + "id=" + id + ", phoneNumber='" + phoneNumber + '\'' + ", sex='" + sex + '\'' + ", email='" + email + '\'' + ", customer=" + customer.getId() + '}'; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getPhoneNumber() { return phoneNumber; } public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } public String getSex() { return sex; } public void setSex(String sex) { this.sex = sex; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public Customer getCustomer() { return customer; } public void setCustomer(Customer customer) { this.customer = customer; } }
UTF-8
Java
1,971
java
CustomerDetail.java
Java
[]
null
[]
package cl.fullstack.dbtest.model.customer; import org.springframework.stereotype.Component; import javax.persistence.*; @Entity @Component public class CustomerDetail implements CustomerService { @Id @GeneratedValue(generator = "CUSTOMER_DETAIL_SEQ") protected Long id; @Column(length = 20) private String phoneNumber; @Column(length = 1) private String sex; @Column(length = 30) private String email; @OneToOne(mappedBy = "customerDetail") private Customer customer; public CustomerDetail() { } public CustomerDetail(String phoneNumber, String sex, String email) { this.phoneNumber = phoneNumber; this.sex = sex; this.email = email; } public CustomerDetail(Long id, String phoneNumber, String sex, String email) { this.id = id; this.phoneNumber = phoneNumber; this.sex = sex; this.email = email; } @Override public String toString() { return "CustomerDetail{" + "id=" + id + ", phoneNumber='" + phoneNumber + '\'' + ", sex='" + sex + '\'' + ", email='" + email + '\'' + ", customer=" + customer.getId() + '}'; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getPhoneNumber() { return phoneNumber; } public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } public String getSex() { return sex; } public void setSex(String sex) { this.sex = sex; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public Customer getCustomer() { return customer; } public void setCustomer(Customer customer) { this.customer = customer; } }
1,971
0.572806
0.570269
92
20.423914
18.656643
82
false
false
0
0
0
0
0
0
0.380435
false
false
3
01ff44931805b8322dbb0d1adc5b5fe320d65605
13,511,967,141,753
2075a843141945db9feb6c1a4323382b6ae149f4
/Labs/lab13/MyTree.java
2d22a99f51a1794ad852d3b1b3cea601dbe21f41
[]
no_license
bhaumiksony1995/CSC-205---Programming-2
https://github.com/bhaumiksony1995/CSC-205---Programming-2
b0a22f60477f917a2992d2ac2d22cff490caf9ee
5befa78f7739e35534e433972ce1876397cc46a3
refs/heads/master
2020-03-17T15:08:00.211000
2018-05-16T17:20:04
2018-05-16T17:20:04
133,699,773
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
import java.util.*; public class MyTree extends BinarySearchTree { public void main (String args[]) { BinarySearchTree t = new BinarySearchTree(); t.insert(new KeyedItem("M")); t.insert(new KeyedItem("J")); t.insert(new KeyedItem("D")); t.insert(new KeyedItem("F")); t.insert(new KeyedItem("L")); t.insert(new KeyedItem("W")); t.insert(new KeyedItem("S")); t.insert(new KeyedItem("T")); t.insert(new KeyedItem("Z")); if (root == null) return; t.inorder(); //t.preorder(); //t.countNodes(); } }
UTF-8
Java
535
java
MyTree.java
Java
[]
null
[]
import java.util.*; public class MyTree extends BinarySearchTree { public void main (String args[]) { BinarySearchTree t = new BinarySearchTree(); t.insert(new KeyedItem("M")); t.insert(new KeyedItem("J")); t.insert(new KeyedItem("D")); t.insert(new KeyedItem("F")); t.insert(new KeyedItem("L")); t.insert(new KeyedItem("W")); t.insert(new KeyedItem("S")); t.insert(new KeyedItem("T")); t.insert(new KeyedItem("Z")); if (root == null) return; t.inorder(); //t.preorder(); //t.countNodes(); } }
535
0.631776
0.631776
25
20.4
14.929166
46
false
false
0
0
0
0
0
0
2
false
false
3
6533d21f709fea4ae0c701c611e84f764a3ec3fc
31,224,412,268,602
c2c4e4baa1dd589dec85a6c472cfafebf617bf43
/legacy_lib/application/nkr-efinance-webservices-kh/src/main/java/com/nokor/efinance/third/wing/server/payment/vo/InfoResponseMessage.java
b71bb39e22d5a208b88af9350d3282d87631e5af
[]
no_license
StevesRoger/legacy-lib
https://github.com/StevesRoger/legacy-lib
79139eafbc302ffebff279372bba23ffa3cd9751
d80e3ea3c6d438397e7a8b83f02f674d228ff17a
refs/heads/master
2020-04-06T21:23:36.084000
2018-11-16T02:33:09
2018-11-16T02:33:09
157,801,685
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.nokor.efinance.third.wing.server.payment.vo; import java.io.Serializable; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * @author ly.youhort */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "InfoResponseMessage") public class InfoResponseMessage implements Serializable { private static final long serialVersionUID = 7944410016042301788L; @XmlElement(name = "status", required = true) private int status; @XmlElement(name = "errorMessage", required = false) private Message errorMessage; @XmlElement(name = "serviceHeader", required = true) private ServiceHeader serviceHeader; @XmlElement(name = "reference", required = true) private String reference; @XmlElement(name = "tokenId", required = true) private String tokenId; @XmlElement(name = "applicant", required = true) private Applicant applicant; @XmlElement(name = "financial", required = true) private Financial financial; /** * @return the status */ public int getStatus() { return status; } /** * @param status the status to set */ public void setStatus(int status) { this.status = status; } /** * @return the errorMessage */ public Message getErrorMessage() { return errorMessage; } /** * @param errorMessage the errorMessage to set */ public void setErrorMessage(Message errorMessage) { this.errorMessage = errorMessage; } /** * @return the serviceHeader */ public ServiceHeader getServiceHeader() { return serviceHeader; } /** * @param serviceHeader the serviceHeader to set */ public void setServiceHeader(ServiceHeader serviceHeader) { this.serviceHeader = serviceHeader; } /** * @return the reference */ public String getReference() { return reference; } /** * @param reference the reference to set */ public void setReference(String reference) { this.reference = reference; } /** * @return the tokenId */ public String getTokenId() { return tokenId; } /** * @param tokenId the tokenId to set */ public void setTokenId(String tokenId) { this.tokenId = tokenId; } /** * @return the applicant */ public Applicant getApplicant() { return applicant; } /** * @param applicant the applicant to set */ public void setApplicant(Applicant applicant) { this.applicant = applicant; } /** * @return the financial */ public Financial getFinancial() { return financial; } /** * @param financial the financial to set */ public void setFinancial(Financial financial) { this.financial = financial; } }
UTF-8
Java
2,671
java
InfoResponseMessage.java
Java
[ { "context": "avax.xml.bind.annotation.XmlType;\n\n\n/**\n * @author ly.youhort\n */\n@XmlAccessorType(XmlAccessType.FIELD)\n@XmlTyp", "end": 300, "score": 0.9962784647941589, "start": 290, "tag": "USERNAME", "value": "ly.youhort" } ]
null
[]
package com.nokor.efinance.third.wing.server.payment.vo; import java.io.Serializable; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * @author ly.youhort */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "InfoResponseMessage") public class InfoResponseMessage implements Serializable { private static final long serialVersionUID = 7944410016042301788L; @XmlElement(name = "status", required = true) private int status; @XmlElement(name = "errorMessage", required = false) private Message errorMessage; @XmlElement(name = "serviceHeader", required = true) private ServiceHeader serviceHeader; @XmlElement(name = "reference", required = true) private String reference; @XmlElement(name = "tokenId", required = true) private String tokenId; @XmlElement(name = "applicant", required = true) private Applicant applicant; @XmlElement(name = "financial", required = true) private Financial financial; /** * @return the status */ public int getStatus() { return status; } /** * @param status the status to set */ public void setStatus(int status) { this.status = status; } /** * @return the errorMessage */ public Message getErrorMessage() { return errorMessage; } /** * @param errorMessage the errorMessage to set */ public void setErrorMessage(Message errorMessage) { this.errorMessage = errorMessage; } /** * @return the serviceHeader */ public ServiceHeader getServiceHeader() { return serviceHeader; } /** * @param serviceHeader the serviceHeader to set */ public void setServiceHeader(ServiceHeader serviceHeader) { this.serviceHeader = serviceHeader; } /** * @return the reference */ public String getReference() { return reference; } /** * @param reference the reference to set */ public void setReference(String reference) { this.reference = reference; } /** * @return the tokenId */ public String getTokenId() { return tokenId; } /** * @param tokenId the tokenId to set */ public void setTokenId(String tokenId) { this.tokenId = tokenId; } /** * @return the applicant */ public Applicant getApplicant() { return applicant; } /** * @param applicant the applicant to set */ public void setApplicant(Applicant applicant) { this.applicant = applicant; } /** * @return the financial */ public Financial getFinancial() { return financial; } /** * @param financial the financial to set */ public void setFinancial(Financial financial) { this.financial = financial; } }
2,671
0.711344
0.704231
122
20.893442
18.683651
67
false
false
0
0
0
0
0
0
1.254098
false
false
3
1efdad449a9e13c83c3173e98780d2767f5e27e7
19,404,662,273,161
6e4c7a58dfb0044e09374ffe77dbbbd5e84006b5
/src/main/java/com/practicas/API/Rest/models/entity/Factura.java
b6feb6e781a419605a2204e7915e28da40872ef5
[]
no_license
jose2889/APIRest-spring-boot
https://github.com/jose2889/APIRest-spring-boot
545580e193e3a579d172c9ea14b79aec77eae567
287be29fc549d55cc8d32b9332d0213485b34ef3
refs/heads/master
2020-07-23T01:16:37.784000
2019-10-27T21:40:12
2019-10-27T21:40:12
207,397,502
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.practicas.API.Rest.models.entity; import java.io.Serializable; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.ManyToOne; import javax.persistence.PrePersist; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.Data; @Data @Entity @Table(name = "facturas") public class Factura implements Serializable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String descripcion; private String observacion; @Temporal(TemporalType.DATE) @Column(name = "create_at") private Date createAt; @PrePersist public void prePersis() { // TODO Auto-generated method stub createAt = new Date(); } @ManyToOne @JsonIgnoreProperties("") private Cliente cliente; private static final long serialVersionUID = 1L; }
UTF-8
Java
1,076
java
Factura.java
Java
[]
null
[]
package com.practicas.API.Rest.models.entity; import java.io.Serializable; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.ManyToOne; import javax.persistence.PrePersist; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.Data; @Data @Entity @Table(name = "facturas") public class Factura implements Serializable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String descripcion; private String observacion; @Temporal(TemporalType.DATE) @Column(name = "create_at") private Date createAt; @PrePersist public void prePersis() { // TODO Auto-generated method stub createAt = new Date(); } @ManyToOne @JsonIgnoreProperties("") private Cliente cliente; private static final long serialVersionUID = 1L; }
1,076
0.792751
0.791822
47
21.893618
16.75383
61
false
false
0
0
0
0
0
0
0.87234
false
false
3
226f3fdddefb69671be213fb44173fba48f904cd
27,590,869,962,971
3eb6182027f1889f87964bb11db67ad6796ef6a7
/intramirror-root/lib/LIB-Core/src/main/java/com/intramirror/core/servlet/interceptor/AuthenticationInterceptor.java
a30d20f0483ded4e498d4c4ff29efc700bb68df1
[]
no_license
1187717503/BoutiquePortal
https://github.com/1187717503/BoutiquePortal
dce23cc8913a4345182f36d840141c27e16c9e00
b0042ea16cd964dc57e97165cbe0ddf989bce57e
refs/heads/release_boutique
2022-12-23T17:32:13.735000
2019-07-18T13:56:57
2019-07-18T13:56:57
197,595,020
1
3
null
false
2022-12-16T09:15:57
2019-07-18T13:43:30
2022-12-16T03:21:33
2022-12-16T09:15:54
27,294
2
2
46
Java
false
false
package com.intramirror.core.servlet.interceptor; import com.intramirror.core.common.exception.StandardExceptions; import io.jsonwebtoken.Claims; import io.jsonwebtoken.JwtException; import io.jsonwebtoken.JwtParser; import io.jsonwebtoken.Jwts; import io.jsonwebtoken.impl.Base64Codec; import java.util.ArrayList; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpMethod; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; /** * Created on 3/28/2017. * @author eyoufzh */ public class AuthenticationInterceptor extends HandlerInterceptorAdapter { private final static Logger LOGGER = LoggerFactory.getLogger(AuthenticationInterceptor.class); private final static String jwtSecret = "qazxswedcvfr543216yhnmju70plmjkiu89"; private static final String LOGIN_URI = "/login"; private static List<String> passUrlList; static { passUrlList = new ArrayList<>(); passUrlList.add("/login"); passUrlList.add("/rule"); // passUrlList.add("/file"); } /** * This implementation always returns {@code true}. * @param request * @param response * @param handler */ @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { LOGGER.info("RequestURI {}", request.getRequestURI()); for (String passUrl : passUrlList) { if (request.getRequestURI().startsWith(passUrl)) { return true; } } if (HttpMethod.OPTIONS.matches(request.getMethod())) { return true; } Long userId = null; String jwt = request.getHeader("token"); if (StringUtils.isEmpty(jwt)) { throw StandardExceptions.UNAUTHORIZED; } Claims claims = null; try { claims = this.parseBody(jwt); } catch (JwtException e) { throw StandardExceptions.UNAUTHORIZED; } if (System.currentTimeMillis() > claims.getIssuedAt().getTime()) { throw StandardExceptions.UNAUTHORIZED; } userId = Long.valueOf(claims.getSubject()); if (userId == null) { throw StandardExceptions.UNAUTHORIZED; } request.getSession().setAttribute("sessionStorage", userId); return true; } public String getJwtBase64Key() { return Base64Codec.BASE64.encode(jwtSecret); } public JwtParser parseToken() { return Jwts.parser().setSigningKey(getJwtBase64Key()); } public Claims parseBody(String jwt) throws JwtException { return parseToken().setSigningKey(getJwtBase64Key()).parseClaimsJws(jwt).getBody(); } /** * This implementation is empty. * @param request * @param response * @param handler * @param modelAndView */ @Override public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { super.postHandle(request, response, handler, modelAndView); } /** * This implementation is empty. * @param request * @param response * @param handler * @param ex */ @Override public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { super.afterCompletion(request, response, handler, ex); } }
UTF-8
Java
3,742
java
AuthenticationInterceptor.java
Java
[ { "context": "rAdapter;\n\n/**\n * Created on 3/28/2017.\n * @author eyoufzh\n */\npublic class AuthenticationInterceptor extend", "end": 753, "score": 0.9995911121368408, "start": 746, "tag": "USERNAME", "value": "eyoufzh" }, { "context": "s);\n\n private final static String jwtSecret = \"qazxswedcvfr543216yhnmju70plmjkiu89\";\n private static final String LOGIN_URI = \"/l", "end": 1013, "score": 0.9994652271270752, "start": 978, "tag": "KEY", "value": "qazxswedcvfr543216yhnmju70plmjkiu89" } ]
null
[]
package com.intramirror.core.servlet.interceptor; import com.intramirror.core.common.exception.StandardExceptions; import io.jsonwebtoken.Claims; import io.jsonwebtoken.JwtException; import io.jsonwebtoken.JwtParser; import io.jsonwebtoken.Jwts; import io.jsonwebtoken.impl.Base64Codec; import java.util.ArrayList; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpMethod; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; /** * Created on 3/28/2017. * @author eyoufzh */ public class AuthenticationInterceptor extends HandlerInterceptorAdapter { private final static Logger LOGGER = LoggerFactory.getLogger(AuthenticationInterceptor.class); private final static String jwtSecret = "<KEY>"; private static final String LOGIN_URI = "/login"; private static List<String> passUrlList; static { passUrlList = new ArrayList<>(); passUrlList.add("/login"); passUrlList.add("/rule"); // passUrlList.add("/file"); } /** * This implementation always returns {@code true}. * @param request * @param response * @param handler */ @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { LOGGER.info("RequestURI {}", request.getRequestURI()); for (String passUrl : passUrlList) { if (request.getRequestURI().startsWith(passUrl)) { return true; } } if (HttpMethod.OPTIONS.matches(request.getMethod())) { return true; } Long userId = null; String jwt = request.getHeader("token"); if (StringUtils.isEmpty(jwt)) { throw StandardExceptions.UNAUTHORIZED; } Claims claims = null; try { claims = this.parseBody(jwt); } catch (JwtException e) { throw StandardExceptions.UNAUTHORIZED; } if (System.currentTimeMillis() > claims.getIssuedAt().getTime()) { throw StandardExceptions.UNAUTHORIZED; } userId = Long.valueOf(claims.getSubject()); if (userId == null) { throw StandardExceptions.UNAUTHORIZED; } request.getSession().setAttribute("sessionStorage", userId); return true; } public String getJwtBase64Key() { return Base64Codec.BASE64.encode(jwtSecret); } public JwtParser parseToken() { return Jwts.parser().setSigningKey(getJwtBase64Key()); } public Claims parseBody(String jwt) throws JwtException { return parseToken().setSigningKey(getJwtBase64Key()).parseClaimsJws(jwt).getBody(); } /** * This implementation is empty. * @param request * @param response * @param handler * @param modelAndView */ @Override public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { super.postHandle(request, response, handler, modelAndView); } /** * This implementation is empty. * @param request * @param response * @param handler * @param ex */ @Override public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { super.afterCompletion(request, response, handler, ex); } }
3,712
0.674773
0.666221
122
29.672131
28.729218
146
false
false
0
0
0
0
0
0
0.491803
false
false
3
a7db4283c7f210f573bf620292d05310816538b0
6,322,191,871,853
bd41cf3902220642bd98efbde8e7e3e76c47829c
/src/com/example/matrix/Matrix.java
33566b0cbd5a8747a14eb12ed347b6f7a3652d5a
[]
no_license
vitorpavanelli/s2it
https://github.com/vitorpavanelli/s2it
bebe9a10d8735064463ca59f3b60cb1dc600382c
ace31f3864ab41a879af2e802d154772f42a8110
refs/heads/master
2021-03-22T00:08:15.492000
2017-11-17T12:36:17
2017-11-17T12:36:17
109,389,436
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.matrix; public class Matrix { public int diffDiagonal(int[][] mtrx, int n) throws MatrixException { // não tenho certeza se precisa validar as informações validateMatrix(mtrx, n); int diag1 = 0; int diag2 = 0; for (int line = 0; line < n; line++) { diag1 += mtrx[line][line]; diag2 += mtrx[line][(n - 1) - line]; } return diag1 - diag2; } private void validateMatrix(int[][] mtrx, int n) throws MatrixException { if (mtrx == null) { throw new MatrixException("Matrix cannot be null"); } if (n < 2) { throw new MatrixException("Matrix deve ser pelo menos 2x2 para que haja diagonais"); } if (mtrx.length != n || mtrx[0].length != n) { throw new MatrixException("Matrix deve respeitar tamanho N"); } // Seria melhor validar os números no input de cada number da matrix. // Talvez seria melhor adicionar essa validação dentro do for em diffDiagonal // para termos apenas um loop porém isso pode adicionar complexidade extra. // Como preciso somente das diagonais nesse caso, vou apenas validar o que preciso for (int line = 0; line < n; line++) { int diag1 = mtrx[line][line]; int diag2 = mtrx[line][(n - 1) - line]; boolean check1 = (diag1 > 100 || diag1 < -100); boolean check2 = (diag2 > 100 || diag2 < -100); if (check1 || check2) { throw new MatrixException("Matrix cannot have numbers greater than 100 and lower than -100"); } } } }
ISO-8859-1
Java
1,469
java
Matrix.java
Java
[]
null
[]
package com.example.matrix; public class Matrix { public int diffDiagonal(int[][] mtrx, int n) throws MatrixException { // não tenho certeza se precisa validar as informações validateMatrix(mtrx, n); int diag1 = 0; int diag2 = 0; for (int line = 0; line < n; line++) { diag1 += mtrx[line][line]; diag2 += mtrx[line][(n - 1) - line]; } return diag1 - diag2; } private void validateMatrix(int[][] mtrx, int n) throws MatrixException { if (mtrx == null) { throw new MatrixException("Matrix cannot be null"); } if (n < 2) { throw new MatrixException("Matrix deve ser pelo menos 2x2 para que haja diagonais"); } if (mtrx.length != n || mtrx[0].length != n) { throw new MatrixException("Matrix deve respeitar tamanho N"); } // Seria melhor validar os números no input de cada number da matrix. // Talvez seria melhor adicionar essa validação dentro do for em diffDiagonal // para termos apenas um loop porém isso pode adicionar complexidade extra. // Como preciso somente das diagonais nesse caso, vou apenas validar o que preciso for (int line = 0; line < n; line++) { int diag1 = mtrx[line][line]; int diag2 = mtrx[line][(n - 1) - line]; boolean check1 = (diag1 > 100 || diag1 < -100); boolean check2 = (diag2 > 100 || diag2 < -100); if (check1 || check2) { throw new MatrixException("Matrix cannot have numbers greater than 100 and lower than -100"); } } } }
1,469
0.653215
0.623119
48
29.458334
28.987036
97
false
false
0
0
0
0
0
0
2.625
false
false
3
13d363221e2951c6d1830cf0a54fab88044aea74
5,944,234,766,575
f2159616f7435ae590533f4c685a84345e0e24c7
/demo/设计模式_高琪/src/结构型模式/代理模式/静态代理/ProxyStar.java
b06e7c4f17955fd392eeef7f00fb2f570efacbda
[]
no_license
mxg694/project
https://github.com/mxg694/project
2ca4587a23943e15335de47a13ca9ec40089b639
a893b4eacbbec90f791151b3f01b3ce6d7614e9e
refs/heads/master
2022-12-23T11:07:27.542000
2020-08-04T09:44:42
2020-08-04T09:44:42
252,129,520
0
0
null
false
2022-12-16T09:41:20
2020-04-01T09:26:19
2020-08-04T09:42:47
2022-12-16T09:41:17
32,226
0
0
17
Java
false
false
package 结构型模式.代理模式.静态代理; /** * author: mxg */ public class ProxyStar implements Star { private Star star; public ProxyStar(Star star) { this.star = star; } @Override public void pre() { System.out.printf("proxyStar 前置操作"); } @Override public void dosomething() { star.dosomething(); } @Override public void post() { System.out.printf("proxyStar 后置操作"); } }
UTF-8
Java
485
java
ProxyStar.java
Java
[ { "context": "package 结构型模式.代理模式.静态代理;\n\n/**\n * author: mxg\n */\npublic class ProxyStar implements Star {\n\n ", "end": 44, "score": 0.9996730089187622, "start": 41, "tag": "USERNAME", "value": "mxg" } ]
null
[]
package 结构型模式.代理模式.静态代理; /** * author: mxg */ public class ProxyStar implements Star { private Star star; public ProxyStar(Star star) { this.star = star; } @Override public void pre() { System.out.printf("proxyStar 前置操作"); } @Override public void dosomething() { star.dosomething(); } @Override public void post() { System.out.printf("proxyStar 后置操作"); } }
485
0.577878
0.577878
28
14.821428
14.152369
44
false
false
0
0
0
0
0
0
0.214286
false
false
3
f05bc774b68316e891ed62fbce1bc9f0dc0e9cf2
33,474,975,144,686
d653029a119100465a908e663bf795c4dedfe43a
/src/main/java/com/common/business/library/regulations/service/impl/TLibraryPolocyRegulationCheckAttaServiceImpl.java
ce91b610cf4a6f56b37f3cc6496ca120b4ab80a8
[]
no_license
MengleiZhao/bg_perfm-main
https://github.com/MengleiZhao/bg_perfm-main
d59740a42995e3b39c5ddbd0df710d87798f3e80
38751d15947984159da0069b54c8db547c55bbb3
refs/heads/master
2023-05-01T01:54:00.791000
2021-05-08T05:51:39
2021-05-08T05:51:39
365,401,842
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.common.business.library.regulations.service.impl; import com.common.business.library.regulations.entity.TLibraryPolocyRegulationCheckAtta; import com.common.business.library.regulations.mapper.TLibraryPolocyRegulationCheckAttaMapper; import com.common.business.library.regulations.service.TLibraryPolocyRegulationCheckAttaService; import com.baomidou.mybatisplus.service.impl.ServiceImpl; import org.springframework.stereotype.Service; /** * <p> * 政策法规审批附件表 服务实现类 * </p> * * @author 田鑫艳 * @since 2021-03-26 */ @Service public class TLibraryPolocyRegulationCheckAttaServiceImpl extends ServiceImpl<TLibraryPolocyRegulationCheckAttaMapper, TLibraryPolocyRegulationCheckAtta> implements TLibraryPolocyRegulationCheckAttaService { }
UTF-8
Java
786
java
TLibraryPolocyRegulationCheckAttaServiceImpl.java
Java
[ { "context": "*\n * <p>\n * 政策法规审批附件表 服务实现类\n * </p>\n *\n * @author 田鑫艳\n * @since 2021-03-26\n */\n@Service\npublic class TL", "end": 505, "score": 0.999864399433136, "start": 502, "tag": "NAME", "value": "田鑫艳" } ]
null
[]
package com.common.business.library.regulations.service.impl; import com.common.business.library.regulations.entity.TLibraryPolocyRegulationCheckAtta; import com.common.business.library.regulations.mapper.TLibraryPolocyRegulationCheckAttaMapper; import com.common.business.library.regulations.service.TLibraryPolocyRegulationCheckAttaService; import com.baomidou.mybatisplus.service.impl.ServiceImpl; import org.springframework.stereotype.Service; /** * <p> * 政策法规审批附件表 服务实现类 * </p> * * @author 田鑫艳 * @since 2021-03-26 */ @Service public class TLibraryPolocyRegulationCheckAttaServiceImpl extends ServiceImpl<TLibraryPolocyRegulationCheckAttaMapper, TLibraryPolocyRegulationCheckAtta> implements TLibraryPolocyRegulationCheckAttaService { }
786
0.848404
0.837766
20
36.599998
51.006275
207
false
false
0
0
0
0
0
0
0.4
false
false
3
79bb119a6c064dd0127a913a70ee4a98c063a0f0
2,259,152,849,392
93f9827d1bc6482a988dfb3238aa2ad00e110c13
/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ONAPWelcomeController.java
615dff060b009f863a16dbd4263a9dd366091dec
[ "CC-BY-4.0", "Apache-2.0" ]
permissive
onap/portal
https://github.com/onap/portal
92a770a2e9c32ff10c6e4a926ba35a4864666cbf
97ede1a34fffb96a4708d1195e648995d4843897
refs/heads/master
2023-06-21T20:21:32.054000
2021-03-09T06:39:15
2021-03-09T06:41:30
115,064,099
2
4
NOASSERTION
false
2021-06-29T18:47:13
2017-12-22T01:43:42
2021-03-09T07:19:38
2021-06-29T18:47:12
21,576
2
2
1
Java
false
false
/*- * ============LICENSE_START========================================== * ONAP Portal * =================================================================== * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed * under the Apache License, Version 2.0 (the "License"); * you may not use this software 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. * * Unless otherwise specified, all documentation contained herein is licensed * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * * https://creativecommons.org/licenses/by/4.0/ * * Unless required by applicable law or agreed to in writing, documentation * 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. * * ============LICENSE_END============================================ * * */ package org.onap.portalapp.controller; import java.security.Principal; import java.util.Set; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import lombok.NoArgsConstructor; import org.mitre.openid.connect.client.SubjectIssuerGrantedAuthority; import org.onap.portalapp.controller.EPRestrictedBaseController; import org.onap.portalapp.portal.logging.aop.EPAuditLog; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.EnableAspectJAutoProxy; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.servlet.ModelAndView; @Controller @RequestMapping("/") @Configuration @EnableAspectJAutoProxy @EPAuditLog @NoArgsConstructor public class ONAPWelcomeController extends EPRestrictedBaseController{ @GetMapping(value = "/index.htm") public String getIndexPage(HttpServletRequest request) { return "/index"; } @GetMapping(value = {"/app/*","/applicationsHome", "/dashboard", "/widgetsHome", "/kpidash*", "/admins", "/users", "/portalAdmins", "/applications", "/widgets", "/functionalMenu", "/contactUs", "/getAccess","/appCatalog", "/widgetOnboarding", "/accountOnboarding"}) public String getEcompSinglePage(HttpServletRequest request, HttpServletResponse response) { return "forward:/index.html"; } // TODO Need to revisit this as its conflicting with Spring Security; check web.xml's oid-context.xml config //@Resource(name = "namedAdmins") private Set<SubjectIssuerGrantedAuthority> admins; @RequestMapping("/user") public String user(Principal p) { return "oid-user"; } @RequestMapping("/admin") public String admin(Model model, Principal p) { model.addAttribute("admins", admins); return "oid-admin"; } @RequestMapping("/oid-login") public ModelAndView login(Principal p) { return new ModelAndView("openIdLogin"); } }
UTF-8
Java
3,849
java
ONAPWelcomeController.java
Java
[]
null
[]
/*- * ============LICENSE_START========================================== * ONAP Portal * =================================================================== * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed * under the Apache License, Version 2.0 (the "License"); * you may not use this software 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. * * Unless otherwise specified, all documentation contained herein is licensed * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * * https://creativecommons.org/licenses/by/4.0/ * * Unless required by applicable law or agreed to in writing, documentation * 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. * * ============LICENSE_END============================================ * * */ package org.onap.portalapp.controller; import java.security.Principal; import java.util.Set; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import lombok.NoArgsConstructor; import org.mitre.openid.connect.client.SubjectIssuerGrantedAuthority; import org.onap.portalapp.controller.EPRestrictedBaseController; import org.onap.portalapp.portal.logging.aop.EPAuditLog; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.EnableAspectJAutoProxy; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.servlet.ModelAndView; @Controller @RequestMapping("/") @Configuration @EnableAspectJAutoProxy @EPAuditLog @NoArgsConstructor public class ONAPWelcomeController extends EPRestrictedBaseController{ @GetMapping(value = "/index.htm") public String getIndexPage(HttpServletRequest request) { return "/index"; } @GetMapping(value = {"/app/*","/applicationsHome", "/dashboard", "/widgetsHome", "/kpidash*", "/admins", "/users", "/portalAdmins", "/applications", "/widgets", "/functionalMenu", "/contactUs", "/getAccess","/appCatalog", "/widgetOnboarding", "/accountOnboarding"}) public String getEcompSinglePage(HttpServletRequest request, HttpServletResponse response) { return "forward:/index.html"; } // TODO Need to revisit this as its conflicting with Spring Security; check web.xml's oid-context.xml config //@Resource(name = "namedAdmins") private Set<SubjectIssuerGrantedAuthority> admins; @RequestMapping("/user") public String user(Principal p) { return "oid-user"; } @RequestMapping("/admin") public String admin(Model model, Principal p) { model.addAttribute("admins", admins); return "oid-admin"; } @RequestMapping("/oid-login") public ModelAndView login(Principal p) { return new ModelAndView("openIdLogin"); } }
3,849
0.71681
0.713692
97
38.680412
36.699265
266
false
false
0
0
0
0
68
0.035334
0.907216
false
false
3
c89fb83a54d8e7c385b1f7d8b4fbd73f4f4010ab
893,353,244,968
953a46f6bbd14202ba177942d39d799a64bab9cb
/src/main/java/com/soqi/oem/dao/OemloginlogMapper.java
53d0889153f06d2bf169c4463d73fa27d3815210
[]
no_license
JohnZhaoXiaoHu/soqioem
https://github.com/JohnZhaoXiaoHu/soqioem
f848c439da028249bcd8cbf1a5b6a019c09a17bf
0d745be8bafd28d39333b7eaf99b8bc0c8dadced
refs/heads/master
2020-06-20T02:36:02.867000
2018-07-19T09:30:11
2018-07-19T09:30:11
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.soqi.oem.dao; import com.soqi.oem.gentry.Oemloginlog; import java.util.List; public interface OemloginlogMapper { int deleteByPrimaryKey(Long id); int insert(Oemloginlog record); Oemloginlog selectByPrimaryKey(Long id); List<Oemloginlog> selectAll(); int updateByPrimaryKey(Oemloginlog record); }
UTF-8
Java
349
java
OemloginlogMapper.java
Java
[]
null
[]
package com.soqi.oem.dao; import com.soqi.oem.gentry.Oemloginlog; import java.util.List; public interface OemloginlogMapper { int deleteByPrimaryKey(Long id); int insert(Oemloginlog record); Oemloginlog selectByPrimaryKey(Long id); List<Oemloginlog> selectAll(); int updateByPrimaryKey(Oemloginlog record); }
349
0.724928
0.724928
16
19.9375
18.352346
47
false
false
0
0
0
0
0
0
0.5
false
false
3
ad7ed8f237d435914f403b4e8085ca14fa83f6a5
29,540,785,102,824
121c2c54a34c98b1d73e65d7d235eab4ddcfd230
/Client/src/ClientConnections/Client.java
97c4ca50866844923523373ff4dd173431d1144d
[]
no_license
AntonioBarral/net-computing
https://github.com/AntonioBarral/net-computing
c66861452938d412a58e60065c37c0d58d4968a1
33ae297da220a5065ff95eda126078f2e9e26fa2
refs/heads/master
2021-01-17T17:21:55.897000
2017-03-06T23:04:54
2017-03-06T23:04:54
84,129,977
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package ClientConnections; import java.io.DataOutputStream; import java.io.IOException; import java.net.Socket; import java.net.UnknownHostException; public class Client extends Thread { private String address; private int port; public Client(String ad, int p){ address=ad; port=p; } public void run() { Socket s=null; try { //Send the message to the server s= new Socket(address, port); DataOutputStream dos= new DataOutputStream(s.getOutputStream()); dos.writeUTF("Sending message"); } catch (UnknownHostException e) { System.err.println("EOF:"+e.getMessage()); } catch (IOException e) { System.err.println("readline:"+e.getMessage()); } finally{ try { s.close(); } catch (IOException e) { e.printStackTrace(); } } } }
UTF-8
Java
800
java
Client.java
Java
[]
null
[]
package ClientConnections; import java.io.DataOutputStream; import java.io.IOException; import java.net.Socket; import java.net.UnknownHostException; public class Client extends Thread { private String address; private int port; public Client(String ad, int p){ address=ad; port=p; } public void run() { Socket s=null; try { //Send the message to the server s= new Socket(address, port); DataOutputStream dos= new DataOutputStream(s.getOutputStream()); dos.writeUTF("Sending message"); } catch (UnknownHostException e) { System.err.println("EOF:"+e.getMessage()); } catch (IOException e) { System.err.println("readline:"+e.getMessage()); } finally{ try { s.close(); } catch (IOException e) { e.printStackTrace(); } } } }
800
0.6725
0.6725
39
19.512821
16.216282
67
false
false
0
0
0
0
0
0
2.102564
false
false
3
199dee8aafacd8d248812c8362e2aa650d0e5516
33,775,622,850,302
5b589d2289d3024ca288764329f6ce44d3bcd253
/compiler/src/main/java/Lexical.java
822e8051f40b9034e2648ab1a8f4ced03b7d9a91
[]
no_license
prabir24/my_compiler
https://github.com/prabir24/my_compiler
4dc21386a95a96cfbdfce7b9a1e1c6d1a8470ddc
e262a22a2c70e09c578cb1b91200f529003dddd9
refs/heads/master
2023-06-26T05:44:18.641000
2021-08-01T08:16:03
2021-08-01T08:16:03
391,567,032
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
public class Lexical { }
UTF-8
Java
26
java
Lexical.java
Java
[]
null
[]
public class Lexical { }
26
0.692308
0.692308
3
7.666667
10.143416
22
false
false
0
0
0
0
0
0
0
false
false
3
b0f78004fd955f88d98e689da4a3f04e62ec85f2
21,912,923,194,208
e5a9a67e329bf0bf1f5dc406186dc0566e95f8a7
/ogrenciQR/app/src/main/java/com/example/ogrenciqr/YoklamaActivity.java
497b5fcdcfc2c9be9a1fa3d3c63bc8c538512af2
[]
no_license
ardademr1/QrKodYoklamaSistemi
https://github.com/ardademr1/QrKodYoklamaSistemi
5de0d09ae34ed5cd7ef769d01a76cce01f5fd430
609a67073821de9110f9bfc9b3e2f3aee67abd88
refs/heads/master
2022-11-23T02:40:43.795000
2020-07-29T15:33:36
2020-07-29T15:33:36
283,344,162
2
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.ogrenciqr; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.Query; import com.google.firebase.database.ValueEventListener; import java.util.ArrayList; import java.util.List; public class YoklamaActivity extends AppCompatActivity { ListView listview; FirebaseDatabase database; DatabaseReference ref; DatabaseReference refkey; ArrayList<String> list; String value; ArrayAdapter<String> adapter; ogrenci ogrenci; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_yoklama); ogrenci = new ogrenci(); listview = (ListView) findViewById(R.id.listview); database = FirebaseDatabase.getInstance(); ref = database.getReference("Student"); refkey = FirebaseDatabase.getInstance().getReference("Key"); // Read from the database refkey.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { // This method is called once with the initial value and again // whenever data at this location is updated. value = dataSnapshot.getValue(String.class); Log.d(MainActivity.class.getName(), "Value is: " + value); } @Override public void onCancelled(DatabaseError error) { // Failed to read value Log.w(MainActivity.class.getName(), "Failed to read value.", error.toException()); } }); list = new ArrayList<>(); adapter = new ArrayAdapter<String>(this,R.layout.user_info,R.id.userInfo,list); ref.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot dataSnapshot) { for(DataSnapshot ds:dataSnapshot.getChildren()){ ogrenci = ds.getValue(ogrenci.class); if(value.equals(ogrenci.getDurum())) { list.add(ogrenci.getAdsoyad().toString() + " " + "Geldi"); } } listview.setAdapter(adapter); } @Override public void onCancelled(@NonNull DatabaseError databaseError) { } }); } }
UTF-8
Java
2,863
java
YoklamaActivity.java
Java
[]
null
[]
package com.example.ogrenciqr; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.Query; import com.google.firebase.database.ValueEventListener; import java.util.ArrayList; import java.util.List; public class YoklamaActivity extends AppCompatActivity { ListView listview; FirebaseDatabase database; DatabaseReference ref; DatabaseReference refkey; ArrayList<String> list; String value; ArrayAdapter<String> adapter; ogrenci ogrenci; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_yoklama); ogrenci = new ogrenci(); listview = (ListView) findViewById(R.id.listview); database = FirebaseDatabase.getInstance(); ref = database.getReference("Student"); refkey = FirebaseDatabase.getInstance().getReference("Key"); // Read from the database refkey.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { // This method is called once with the initial value and again // whenever data at this location is updated. value = dataSnapshot.getValue(String.class); Log.d(MainActivity.class.getName(), "Value is: " + value); } @Override public void onCancelled(DatabaseError error) { // Failed to read value Log.w(MainActivity.class.getName(), "Failed to read value.", error.toException()); } }); list = new ArrayList<>(); adapter = new ArrayAdapter<String>(this,R.layout.user_info,R.id.userInfo,list); ref.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot dataSnapshot) { for(DataSnapshot ds:dataSnapshot.getChildren()){ ogrenci = ds.getValue(ogrenci.class); if(value.equals(ogrenci.getDurum())) { list.add(ogrenci.getAdsoyad().toString() + " " + "Geldi"); } } listview.setAdapter(adapter); } @Override public void onCancelled(@NonNull DatabaseError databaseError) { } }); } }
2,863
0.649668
0.649668
80
34.787498
24.588459
98
false
false
0
0
0
0
0
0
0.6
false
false
3
18aefba8f096b0dcfe21df51ab77383cb24a9d90
558,345,803,300
0b92f6eb5e072da79b54ad199a3a77dec67d1a28
/src/main/java/com/gk/secondhand/service/OrdersService.java
7aeab5e37bd838d6ec6986eab2601231a665d47b
[]
no_license
qq51992807/secondhand
https://github.com/qq51992807/secondhand
759abc655c194d0588ee9ca9e2e6f4e917aec12b
766cbb78ae1e1ba3afc8b62a914c860ade6889e4
refs/heads/master
2023-08-08T18:34:16.402000
2020-03-11T05:43:22
2020-03-11T05:43:22
227,796,724
0
0
null
false
2023-07-23T00:16:54
2019-12-13T08:53:20
2023-03-31T09:09:01
2023-07-23T00:16:54
21,445
1
0
2
JavaScript
false
false
package com.gk.secondhand.service; import com.baomidou.mybatisplus.extension.service.IService; import com.gk.secondhand.entity.Orders; import java.util.List; public interface OrdersService extends IService<Orders> { public List<Orders> getOrdersByUserId(Integer user_id); public List<Orders> getOrdersByUserAndGoods(Integer user_id); public void addOrders(Orders orders); public void deliverByOrderNum(Integer orderNum); public void receiptByOrderNum(Integer orderNum); public int getOrdersNum(); public List<Orders> getPageOrders(int pageNum, int pageSize); public Orders getOrdersById(int ordersId); public void updateByPrimaryKey(Integer id, Orders orders); public void deleteOrdersByPrimaryKeys(int parseInt); public List<Orders> getPageOrdersByOrders(Long orderNum, String orderInformation, Integer orderState, int pageNum, int pageSize); }
UTF-8
Java
951
java
OrdersService.java
Java
[]
null
[]
package com.gk.secondhand.service; import com.baomidou.mybatisplus.extension.service.IService; import com.gk.secondhand.entity.Orders; import java.util.List; public interface OrdersService extends IService<Orders> { public List<Orders> getOrdersByUserId(Integer user_id); public List<Orders> getOrdersByUserAndGoods(Integer user_id); public void addOrders(Orders orders); public void deliverByOrderNum(Integer orderNum); public void receiptByOrderNum(Integer orderNum); public int getOrdersNum(); public List<Orders> getPageOrders(int pageNum, int pageSize); public Orders getOrdersById(int ordersId); public void updateByPrimaryKey(Integer id, Orders orders); public void deleteOrdersByPrimaryKeys(int parseInt); public List<Orders> getPageOrdersByOrders(Long orderNum, String orderInformation, Integer orderState, int pageNum, int pageSize); }
951
0.741325
0.741325
33
27.818182
30.597538
118
false
false
0
0
0
0
0
0
0.636364
false
false
3
6647714809487b85382fa45179c2d62369a0b292
20,349,555,088,731
41577e69fed6808037fa28ab86530c808b6f8334
/StackOverflow/src/com/stackoverflow/tests/MainClass.java
d15c482c9250a0c0f89a8f0af137de00649695d4
[]
no_license
elizeire/JavaTests
https://github.com/elizeire/JavaTests
ccd3ed9657ca14c1dbd73df0de513e0941916d81
8e527921b0c2a67eddd41b917ae7589d6e7ad251
refs/heads/master
2020-12-30T16:02:04.877000
2017-06-08T09:23:28
2017-06-08T09:23:28
91,200,972
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.stackoverflow.tests; class A { } class B extends A { } class C extends B { } public class MainClass { static void overloadedMethod(A a) { System.out.println("1"); } static void overloadedMethod(B b) { System.out.println("2"); } static void overloadedMethod(C c) { System.out.println("3"); } static void overloadedMethod(Object o) { System.out.println("3"); } static void overloadedMethod(Class<? extends A> o) { System.out.println("4"); } public static void main(String[] args) { Object o = new C(); overloadedMethod(o); } }
UTF-8
Java
584
java
MainClass.java
Java
[]
null
[]
package com.stackoverflow.tests; class A { } class B extends A { } class C extends B { } public class MainClass { static void overloadedMethod(A a) { System.out.println("1"); } static void overloadedMethod(B b) { System.out.println("2"); } static void overloadedMethod(C c) { System.out.println("3"); } static void overloadedMethod(Object o) { System.out.println("3"); } static void overloadedMethod(Class<? extends A> o) { System.out.println("4"); } public static void main(String[] args) { Object o = new C(); overloadedMethod(o); } }
584
0.65411
0.645548
44
12.295455
15.19656
53
false
false
0
0
0
0
0
0
0.909091
false
false
3
a80f1fd1db440e979c248f864039d0d483875e5a
33,758,442,952,222
a01ddb883f8bea8cd2f01400fdeb656f07c3e0c6
/DominatingSpeciesWeb/src/main/java/cz/muni/fi/pa165/dominatingspecies/web/config/DominatingSpeciesWebConfig.java
44dc27321e9bfec706e7a3f13d03ea0e7ba6e12d
[]
no_license
vaclavHala/PA165_Orange
https://github.com/vaclavHala/PA165_Orange
ea2838cde17218c7f99667906dc9d187fb145c5b
a6f9443291ad365c40b590d31cb0294eb87ef033
refs/heads/master
2021-01-09T21:57:25.267000
2016-01-18T14:02:28
2016-01-18T14:02:28
44,298,264
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package cz.muni.fi.pa165.dominatingspecies.web.config; import javax.validation.Validator; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; import org.springframework.web.servlet.ViewResolver; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.view.InternalResourceViewResolver; import cz.muni.fi.pa165.dominatingspecies.sampledata.DominatingSpeciesSampleDataConfiguration; @EnableWebMvc @Configuration @Import({DominatingSpeciesSampleDataConfiguration.class}) @ComponentScan(basePackages = "cz.muni.fi.pa165.dominatingspecies") public class DominatingSpeciesWebConfig extends WebMvcConfigurerAdapter { @Override public void addViewControllers(ViewControllerRegistry registry) { registry.addViewController("/").setViewName("index"); registry.addViewController("/login").setViewName("login"); } @Bean public ViewResolver viewResolver() { InternalResourceViewResolver viewResolver = new InternalResourceViewResolver(); viewResolver.setPrefix("/WEB-INF/"); viewResolver.setSuffix(".jsp"); return viewResolver; } // @Bean // public MessageSource messageSource() { // ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource(); // messageSource.setBasename("text"); // return messageSource; // } @Bean public Validator validator() { return new LocalValidatorFactoryBean(); } }
UTF-8
Java
1,948
java
DominatingSpeciesWebConfig.java
Java
[]
null
[]
package cz.muni.fi.pa165.dominatingspecies.web.config; import javax.validation.Validator; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; import org.springframework.web.servlet.ViewResolver; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.view.InternalResourceViewResolver; import cz.muni.fi.pa165.dominatingspecies.sampledata.DominatingSpeciesSampleDataConfiguration; @EnableWebMvc @Configuration @Import({DominatingSpeciesSampleDataConfiguration.class}) @ComponentScan(basePackages = "cz.muni.fi.pa165.dominatingspecies") public class DominatingSpeciesWebConfig extends WebMvcConfigurerAdapter { @Override public void addViewControllers(ViewControllerRegistry registry) { registry.addViewController("/").setViewName("index"); registry.addViewController("/login").setViewName("login"); } @Bean public ViewResolver viewResolver() { InternalResourceViewResolver viewResolver = new InternalResourceViewResolver(); viewResolver.setPrefix("/WEB-INF/"); viewResolver.setSuffix(".jsp"); return viewResolver; } // @Bean // public MessageSource messageSource() { // ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource(); // messageSource.setBasename("text"); // return messageSource; // } @Bean public Validator validator() { return new LocalValidatorFactoryBean(); } }
1,948
0.76694
0.76232
48
38.583332
29.719406
94
false
false
0
0
0
0
0
0
0.479167
false
false
3
7ea47d8ea3a0c3cbfb4a323b6aa2c729a28571d2
13,348,758,425,158
08156f1da4de33d251a3f074c5b0bf4a2991aea0
/zapzero/src/main/java/com/srnpr/zapzero/api/ApiKeepLiveInput.java
3b780c5b2aa6b0d7559aa5c9c26a1653efef9dff
[]
no_license
liudongpu/zapsrnpr
https://github.com/liudongpu/zapsrnpr
08fc4aca58a22c1f445b6e99d3c98631e5a255a9
69b14a5c1f16f11164306e66ca21d10d48463fcf
refs/heads/master
2020-05-18T07:12:36.076000
2014-06-12T06:06:37
2014-06-12T06:06:37
11,193,707
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.srnpr.zapzero.api; import com.srnpr.zapcom.topapi.RootInput; public class ApiKeepLiveInput extends RootInput { /** * 服务编码 */ private String serverCode = "undefined"; /** * IP地址 */ private String ipAddress = ""; /** * 运行模式 leader或者follower */ private String runType = ""; /** * 运行服务列表 */ private String runList=""; /** * 本机回调地址 */ private String apiHost = ""; /** * 通知时间 */ private String noticeTime = ""; /** * 同步配置文件名 */ private String syncConfig=""; public String getServerCode() { return serverCode; } public void setServerCode(String serverCode) { this.serverCode = serverCode; } public String getIpAddress() { return ipAddress; } public void setIpAddress(String ipAddress) { this.ipAddress = ipAddress; } public String getApiHost() { return apiHost; } public void setApiHost(String apiHost) { this.apiHost = apiHost; } public String getRunType() { return runType; } public void setRunType(String runType) { this.runType = runType; } public String getNoticeTime() { return noticeTime; } public void setNoticeTime(String noticeTime) { this.noticeTime = noticeTime; } public String getSyncConfig() { return syncConfig; } public void setSyncConfig(String syncConfig) { this.syncConfig = syncConfig; } public String getRunList() { return runList; } public void setRunList(String runList) { this.runList = runList; } }
UTF-8
Java
1,626
java
ApiKeepLiveInput.java
Java
[]
null
[]
package com.srnpr.zapzero.api; import com.srnpr.zapcom.topapi.RootInput; public class ApiKeepLiveInput extends RootInput { /** * 服务编码 */ private String serverCode = "undefined"; /** * IP地址 */ private String ipAddress = ""; /** * 运行模式 leader或者follower */ private String runType = ""; /** * 运行服务列表 */ private String runList=""; /** * 本机回调地址 */ private String apiHost = ""; /** * 通知时间 */ private String noticeTime = ""; /** * 同步配置文件名 */ private String syncConfig=""; public String getServerCode() { return serverCode; } public void setServerCode(String serverCode) { this.serverCode = serverCode; } public String getIpAddress() { return ipAddress; } public void setIpAddress(String ipAddress) { this.ipAddress = ipAddress; } public String getApiHost() { return apiHost; } public void setApiHost(String apiHost) { this.apiHost = apiHost; } public String getRunType() { return runType; } public void setRunType(String runType) { this.runType = runType; } public String getNoticeTime() { return noticeTime; } public void setNoticeTime(String noticeTime) { this.noticeTime = noticeTime; } public String getSyncConfig() { return syncConfig; } public void setSyncConfig(String syncConfig) { this.syncConfig = syncConfig; } public String getRunList() { return runList; } public void setRunList(String runList) { this.runList = runList; } }
1,626
0.631105
0.631105
99
13.717172
15.252779
49
false
false
0
0
0
0
0
0
1.121212
false
false
3
b2633f4794e81f4745409bc7682591245738cd77
35,699,768,173,090
abf114504abcce2cde4134e5a090d1a6d8fa4c25
/src/main/java/com/algs4/mystack/MyStack.java
08c30e733bf7ce9aa30b421b380b1f8f7f5948b1
[]
no_license
loverasd/javademo
https://github.com/loverasd/javademo
1230c84a7fa85148e27fe0bc313251428ff9a230
528f564b219d081e4fa98984d67f8f1a05a1b158
refs/heads/master
2022-07-09T09:50:47.619000
2019-10-21T04:43:55
2019-10-21T04:43:55
145,996,233
0
0
null
false
2022-06-30T14:46:00
2018-08-24T13:39:32
2019-10-21T04:44:27
2022-06-30T14:45:57
9,291
0
0
5
Java
false
false
package com.algs4.mystack; import java.util.Iterator; import java.util.Spliterator; import java.util.function.Consumer; /** * @program: javademo * @description: 链表实现 LIFO * @author: chenp * @create: 2018-09-26 10:54 **/ public class MyStack<Item> implements Iterable<Item> { private Node first; int n = 0; private class Node{ Item item; Node next; } public boolean isEmpty(){ return n == 0; } public int size(){ return n; } public void push(Item item){ Node oldFirst = first; first = new Node(); first.item = item; first.next = oldFirst; n++; } public Item pop(){ Item temp = first.item; first = first.next; n--; return temp; } @Override public Iterator<Item> iterator() { return new MyStackIterator(); } private class MyStackIterator implements Iterator{ @Override public boolean hasNext() { return n > 0; } @Override public Object next() { return first.item; } @Override public void remove() { } @Override public void forEachRemaining(Consumer action) { } } @Override public void forEach(Consumer<? super Item> action) { } @Override public Spliterator<Item> spliterator() { return null; } public static void main(String[] args) { MyStack<String> myStack = new MyStack<>(); System.out.println(myStack.size()); myStack.push("nihao"); myStack.push(",wo hao"); myStack.push("da jia hao"); System.out.println(myStack.iterator().next()); System.out.println(myStack.first.item); System.out.println(myStack.size()); } }
UTF-8
Java
1,845
java
MyStack.java
Java
[ { "context": "m: javademo\n * @description: 链表实现 LIFO\n * @author: chenp\n * @create: 2018-09-26 10:54\n **/\npublic class My", "end": 192, "score": 0.9996513724327087, "start": 187, "tag": "USERNAME", "value": "chenp" } ]
null
[]
package com.algs4.mystack; import java.util.Iterator; import java.util.Spliterator; import java.util.function.Consumer; /** * @program: javademo * @description: 链表实现 LIFO * @author: chenp * @create: 2018-09-26 10:54 **/ public class MyStack<Item> implements Iterable<Item> { private Node first; int n = 0; private class Node{ Item item; Node next; } public boolean isEmpty(){ return n == 0; } public int size(){ return n; } public void push(Item item){ Node oldFirst = first; first = new Node(); first.item = item; first.next = oldFirst; n++; } public Item pop(){ Item temp = first.item; first = first.next; n--; return temp; } @Override public Iterator<Item> iterator() { return new MyStackIterator(); } private class MyStackIterator implements Iterator{ @Override public boolean hasNext() { return n > 0; } @Override public Object next() { return first.item; } @Override public void remove() { } @Override public void forEachRemaining(Consumer action) { } } @Override public void forEach(Consumer<? super Item> action) { } @Override public Spliterator<Item> spliterator() { return null; } public static void main(String[] args) { MyStack<String> myStack = new MyStack<>(); System.out.println(myStack.size()); myStack.push("nihao"); myStack.push(",wo hao"); myStack.push("da jia hao"); System.out.println(myStack.iterator().next()); System.out.println(myStack.first.item); System.out.println(myStack.size()); } }
1,845
0.557431
0.548721
88
19.886364
15.896277
56
false
false
0
0
0
0
0
0
0.363636
false
false
3
96ac1a3cde9382010757199e9bf22cc105deeb3c
10,471,130,327,748
c47c196274c741e41139ce8467510b5523d411fb
/src/main/java/com/wqy/wx/back/plus3/entity/ShDict.java
b11cb124c0be922eee410b50dfb95fc93e45beba
[]
no_license
weiQuYun/weiShoppingService
https://github.com/weiQuYun/weiShoppingService
b5e97b59d1245a919b52ec3f2c96682debe88c0a
7719741384d99c541d1b2d0abfcdad561e6ddd30
refs/heads/master
2022-12-02T11:48:04.089000
2020-04-29T03:45:38
2020-04-29T03:45:38
252,066,645
0
0
null
false
2022-11-16T11:33:54
2020-04-01T03:54:18
2020-04-29T03:45:52
2022-11-16T11:33:51
681
0
0
9
Java
false
false
package com.wqy.wx.back.plus3.entity; import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; import java.io.Serializable; import java.time.LocalDateTime; import java.util.Date; /** * @author licm * @since 2020-04-09 */ @ApiModel(value = "字典表") @Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) public class ShDict implements Serializable { /** * 主键keyId */ @ApiModelProperty(value = "主键keyId") @TableId(value = "id") @TableField(value = "key_id", fill = FieldFill.INSERT_UPDATE) private Long keyId; /** * 父Id */ @ApiModelProperty(value = "父Id") @TableField(value = "pid", fill = FieldFill.INSERT_UPDATE) private Long pid; /** * 字典类型名称 */ @ApiModelProperty(value = "字典类型名称") @TableField(value = "dict_type_name", fill = FieldFill.INSERT_UPDATE) private String dictTypeName; /** * 字典编码 */ @ApiModelProperty(value = "字典编码") @TableField(value = "dict_type_code", fill = FieldFill.INSERT_UPDATE) private String dictTypeCode; @TableField(value = "dict_id", fill = FieldFill.INSERT_UPDATE) private String dictId; /** * 字典名称 */ @ApiModelProperty(value = "字典名称") @TableField(value = "dict_name", fill = FieldFill.INSERT_UPDATE) private String dictName; /** * 序号 */ @ApiModelProperty(value = "序号") @TableField(value = "sort_no", fill = FieldFill.INSERT_UPDATE) private Integer sortNo; @TableField(value = "level", fill = FieldFill.INSERT_UPDATE) private Integer level; /** * 描述 */ @ApiModelProperty(value = "描述") @TableField(value = "memo", fill = FieldFill.INSERT_UPDATE) private String memo; @TableField(value = "add_time", fill = FieldFill.INSERT_UPDATE) private Date addTime; @TableField(value = "modify_time", fill = FieldFill.INSERT_UPDATE) private Date modifyTime; }
UTF-8
Java
2,283
java
ShDict.java
Java
[ { "context": "alDateTime;\nimport java.util.Date;\n\n/**\n * @author licm\n * @since 2020-04-09\n */\n@ApiModel(value = \"字典表\")", "end": 484, "score": 0.9996307492256165, "start": 480, "tag": "USERNAME", "value": "licm" } ]
null
[]
package com.wqy.wx.back.plus3.entity; import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; import java.io.Serializable; import java.time.LocalDateTime; import java.util.Date; /** * @author licm * @since 2020-04-09 */ @ApiModel(value = "字典表") @Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) public class ShDict implements Serializable { /** * 主键keyId */ @ApiModelProperty(value = "主键keyId") @TableId(value = "id") @TableField(value = "key_id", fill = FieldFill.INSERT_UPDATE) private Long keyId; /** * 父Id */ @ApiModelProperty(value = "父Id") @TableField(value = "pid", fill = FieldFill.INSERT_UPDATE) private Long pid; /** * 字典类型名称 */ @ApiModelProperty(value = "字典类型名称") @TableField(value = "dict_type_name", fill = FieldFill.INSERT_UPDATE) private String dictTypeName; /** * 字典编码 */ @ApiModelProperty(value = "字典编码") @TableField(value = "dict_type_code", fill = FieldFill.INSERT_UPDATE) private String dictTypeCode; @TableField(value = "dict_id", fill = FieldFill.INSERT_UPDATE) private String dictId; /** * 字典名称 */ @ApiModelProperty(value = "字典名称") @TableField(value = "dict_name", fill = FieldFill.INSERT_UPDATE) private String dictName; /** * 序号 */ @ApiModelProperty(value = "序号") @TableField(value = "sort_no", fill = FieldFill.INSERT_UPDATE) private Integer sortNo; @TableField(value = "level", fill = FieldFill.INSERT_UPDATE) private Integer level; /** * 描述 */ @ApiModelProperty(value = "描述") @TableField(value = "memo", fill = FieldFill.INSERT_UPDATE) private String memo; @TableField(value = "add_time", fill = FieldFill.INSERT_UPDATE) private Date addTime; @TableField(value = "modify_time", fill = FieldFill.INSERT_UPDATE) private Date modifyTime; }
2,283
0.672139
0.668035
78
27.128204
21.315914
73
false
false
0
0
0
0
0
0
0.435897
false
false
3
5c1532da808b5aa5c77becf169dd2ab8daa749c7
28,690,381,574,581
e301217c39b1e6f2a5f329b99e2811adec7aa694
/ButtonDialogManyListener.java
68ec52e0c130993fef85ecdf334d795a9d9f7c69
[]
no_license
z3880341/buttonDialog
https://github.com/z3880341/buttonDialog
94a0331ecc64ac8cadd2207a5ae550f252758c0d
6e298481737041a73ded8834ccfe88f86c6d2b60
refs/heads/master
2020-07-23T21:47:26.664000
2019-09-11T03:35:18
2019-09-11T03:35:18
207,715,129
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.yt.kangaroo.widgets.button_dialog; import java.util.Set; public interface ButtonDialogManyListener { void onShow(); void onCurrentItemClick(int position); void onSelectItem(Set<Integer> selecetPositionSet); void onDismiss(); void onError(String e); }
UTF-8
Java
285
java
ButtonDialogManyListener.java
Java
[]
null
[]
package com.yt.kangaroo.widgets.button_dialog; import java.util.Set; public interface ButtonDialogManyListener { void onShow(); void onCurrentItemClick(int position); void onSelectItem(Set<Integer> selecetPositionSet); void onDismiss(); void onError(String e); }
285
0.747368
0.747368
11
24.90909
18.744476
55
false
false
0
0
0
0
0
0
0.636364
false
false
3
643fa7b732fc7adc342d1d1dee6842eadd9b2059
18,829,136,685,235
f31f3825dde74c70cc55c8b074e9274d519e3857
/src/test/java/ec/cjpq/cjfews/comprobante/JRDataSourceFactoryTest.java
cf95e15e0df4e3e4b8388e552c9497f63bd50531
[]
no_license
carlosjulioperez/feapp
https://github.com/carlosjulioperez/feapp
0c95730b88265e979429886d15be71cefba0f0fc
cb3d051c5d1ec48dbc507cc26565a35546959090
refs/heads/master
2022-11-27T22:35:17.220000
2019-11-25T00:31:32
2019-11-25T00:31:32
183,148,035
0
0
null
false
2022-11-24T02:26:41
2019-04-24T04:28:03
2019-11-25T00:31:46
2022-11-24T02:26:38
601
0
0
19
Java
false
false
package ec.cjpq.cjfews.comprobante; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.junit.Test; import ec.cjpq.cjfews.comprobante.JRDataSourceFactory; import ec.cjpq.cjfews.comprobante.factura.Factura; public class JRDataSourceFactoryTest{ private static Logger log = LogManager.getLogger(JRDataSourceFactoryTest.class); //@Test public void test(){ Factura[] facturas = JRDataSourceFactory.getFacturaArray(); Factura factura = facturas[0]; log.warn(factura.getVersion()); } }
UTF-8
Java
547
java
JRDataSourceFactoryTest.java
Java
[]
null
[]
package ec.cjpq.cjfews.comprobante; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.junit.Test; import ec.cjpq.cjfews.comprobante.JRDataSourceFactory; import ec.cjpq.cjfews.comprobante.factura.Factura; public class JRDataSourceFactoryTest{ private static Logger log = LogManager.getLogger(JRDataSourceFactoryTest.class); //@Test public void test(){ Factura[] facturas = JRDataSourceFactory.getFacturaArray(); Factura factura = facturas[0]; log.warn(factura.getVersion()); } }
547
0.778793
0.773309
21
25
24.05945
84
false
false
0
0
0
0
0
0
0.904762
false
false
3
caf5a21d64cf8fe2075dc49e1f206f1ec8d7598d
11,184,094,882,663
8032bbe10d89247ad8a511f6a109ac72a4993e6b
/src/main/java/com/baizhi/entity/Album.java
17e060d543bbee9d84f33802ae0f4a985a6def2e
[]
no_license
wuzebin123/cmfz
https://github.com/wuzebin123/cmfz
81c49579cfa19924ef65ee2dd5a305f308326e1a
8efd8cdc0e65cc6f2c7a5ddf3dbe1229d9ca483a
refs/heads/master
2022-07-08T23:13:40.070000
2019-10-21T09:54:45
2019-10-21T09:54:45
214,942,598
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.baizhi.entity; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import java.util.Date; @Data @AllArgsConstructor @NoArgsConstructor @Accessors(chain = true) public class Album { private String id; private String title;//标题 private String cover;//图片 private String author;//作者 private String beam;//波音员 private Integer count;//章节数 private Date publish_date;//发布时间 private String content;//简介 private Date create_date;//上传时间 private String state;//状态 private Double fraction;//分数 }
UTF-8
Java
667
java
Album.java
Java
[]
null
[]
package com.baizhi.entity; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import java.util.Date; @Data @AllArgsConstructor @NoArgsConstructor @Accessors(chain = true) public class Album { private String id; private String title;//标题 private String cover;//图片 private String author;//作者 private String beam;//波音员 private Integer count;//章节数 private Date publish_date;//发布时间 private String content;//简介 private Date create_date;//上传时间 private String state;//状态 private Double fraction;//分数 }
667
0.739837
0.739837
26
22.653847
11.704511
37
false
false
0
0
0
0
0
0
0.653846
false
false
3
8f2ebc847f7f310a18481e9b0950e6589c9bb358
8,383,776,164,427
ea62523d6a3c13f24d4b92c34d91b1ce0b3264b6
/logistic/SubLevel1Page.java
45ca581134bd54271d35219aae87eda06e469c1d
[]
no_license
afiantara/erp
https://github.com/afiantara/erp
020fc44d91b133969fd5d13270f1a5478cd93a9f
3312d3395e6860d61077407c78bc43a67f601f84
refs/heads/master
2020-06-01T18:16:33.734000
2012-09-05T07:21:55
2012-09-05T07:21:55
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package org.apache.wicket.erp.logistic; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import org.apache.axis2.AxisFault; import org.apache.wicket.AttributeModifier; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.markup.html.AjaxLink; import org.apache.wicket.erp.accounting.BasePage; import org.apache.wicket.erp.utils.IActionHandler; import org.apache.wicket.erp.utils.PanelAction; import org.apache.wicket.erp.utils.Service; import org.apache.wicket.erp.utils.UserInfo; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.form.RequiredTextField; import org.apache.wicket.markup.html.link.Link; import org.apache.wicket.markup.html.link.PopupSettings; import org.apache.wicket.markup.html.navigation.paging.PagingNavigator; import org.apache.wicket.markup.repeater.Item; import org.apache.wicket.markup.repeater.data.DataView; import org.apache.wicket.markup.repeater.data.ListDataProvider; import org.apache.wicket.model.AbstractReadOnlyModel; import org.apache.wicket.model.CompoundPropertyModel; import org.apache.wicket.request.mapper.parameter.PageParameters; import java.text.SimpleDateFormat; public class SubLevel1Page extends BasePage implements IActionHandler{ /** * */ private static final long serialVersionUID = 1L; private Service _service; HashMap<String, Group1> maps; private ArrayList<Group1> list=new ArrayList<Group1>(); private Form<Group1> form; public static Group1 group1; private Link subgrouplevel2Button; private RequiredTextField<String> kgroup; private RequiredTextField<String> kgroup1; private RequiredTextField<String> ngroup1; boolean isReadOnly=true; private static String kgroupValue; final AttributeModifier ro = new AttributeModifier("readonly", isReadOnly); public SubLevel1Page(PageParameters p) { super("Sub Group Level1"); kgroupValue=p.get("kgroup").toString(); if(group1==null) { group1=new Group1(); } group1.setKgroup(kgroupValue); init(); getGroup1(kgroupValue); buildPage(); try { if(p.get("new")!=null) { if(p.get("new").toString().equals("1")) { kgroup1.remove(ro); ngroup1.remove(ro); } } } catch(Exception ex){} } public SubLevel1Page() { super("Sub Group Level1"); init(); getGroup1(group1.getKgroup()); buildPage(); } @SuppressWarnings("unchecked") private void buildPage() { final DataView<Group1> dataView = new DataView<Group1>("pageable", new ListDataProvider( list)) { /** * */ private static final long serialVersionUID = 1L; public void populateItem(final Item item) { final Group1 _group1 = (Group1) item.getModelObject(); item.add(new Label("no", String.valueOf(_group1.getNo()))); item.add(new Label("kgroup", _group1.getKgroup())); item.add(new Label("kgroup1", _group1.getKgroup1())); item.add(new Label("ngroup1", _group1.getNgroup1())); item.add(new AjaxLink<Group1>("select") { /** * */ private static final long serialVersionUID = 1L; @Override public void onClick(AjaxRequestTarget target) { // TODO Auto-generated method stub Group1 selected = (Group1)getParent().getDefaultModelObject(); group1=selected; PanelAction.actionType=2; setResponsePage(SubLevel1Page.class); } }); item.add(AttributeModifier.replace("class", new AbstractReadOnlyModel<String>() { private static final long serialVersionUID = 1L; @Override public String getObject() { return (item.getIndex() % 2 == 1) ? "even" : "odd"; } })); } }; dataView.setItemsPerPage(8); add(dataView); add(new PagingNavigator("navigator", dataView)); form = new Form<Group1>("form", new CompoundPropertyModel<Group1>(this.group1)); add(form); // add a simple text field that uses Input's 'text' property. Nothing // can go wrong here kgroup=new RequiredTextField<String>("kgroup"); kgroup1=new RequiredTextField<String>("kgroup1"); ngroup1=new RequiredTextField<String>("ngroup1"); PopupSettings popupSettings = new PopupSettings(PopupSettings.LOCATION_BAR | PopupSettings.RESIZABLE | PopupSettings.SCROLLBARS). setHeight(300).setWidth(730).setTop(300).setLeft(180); subgrouplevel2Button=new Link("subgrouplevel2Button") { /** * */ private static final long serialVersionUID = 1L; @Override public void onClick() { // TODO Auto-generated method stub //setResponsePage(ModalKursHarianPage.class, new PageParameters()); PageParameters p =new PageParameters(); p.add("kgroup", kgroup.getModelObject()); p.add("kgroup1", kgroup1.getModelObject()); setResponsePage(SubLevel2Page.class,p); } }; subgrouplevel2Button.setPopupSettings(popupSettings); subgrouplevel2Button.setEnabled((PanelAction.actionType==2||PanelAction.actionType==3)? true:false); form.add(subgrouplevel2Button); readOnly(); form.add(kgroup); form.add(kgroup1); form.add(ngroup1); form.add(new PanelAction("actionpanel",this)); } private void init() { maps=new HashMap<String, Group1>(); try { _service=new Service(Service.INVENTORY_SERVICE_URL); } catch (AxisFault e) { // TODO Auto-generated catch block e.printStackTrace(); } } private void getGroup1(String kgroup) { Object[] params=new Object[]{kgroup}; Class[] retTypes =new Class[]{Group1.class}; try { Object[] response=_service.callServiceInventory("getGroup1ByCode", params,retTypes); Group1 item = (Group1)response[0]; if(item==null) return; if(item.getGroups()==null) return; int count=item.getGroups().length; list = new ArrayList<Group1>(); for(int i=0; i < count;i++) { sf.inventory.Group1 group1=item.getGroups()[i]; Group1 _group1 = new Group1(); _group1.setKgroup(group1.getKgroup()); _group1.setNo(i+1); _group1.setKgroup1(group1.getKgroup1()); _group1.setNgroup1(group1.getNgroup1()); if(null!=_group1) { list.add(_group1); } } } catch (AxisFault e) { // TODO Auto-generated catch block e.printStackTrace(); } } public void readOnly() { // TODO Auto-generated method stub try { kgroup.add(ro); kgroup1.add(ro); ngroup1.add(ro); } catch(Exception ex){} } public void activate() { // TODO Auto-generated method stub setResponsePage(SubLevel1Page.class); } public void cancel(boolean flag) { // TODO Auto-generated method stub PageParameters p = new PageParameters(); p.set("kgroup", group1.getKgroup()); setResponsePage(SubLevel1Page.class,p); } public int delete() { // TODO Auto-generated method stub form.process(null); Group1 valuta= (Group1)form.getModelObject(); SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); String dateNow = sdf.format(new Date()); valuta.setTglupdate(Long.parseLong(dateNow)); valuta.setUserupdate(UserInfo.USERID); Object[] params=new Object[]{valuta}; Class[] retTypes =new Class[]{Boolean.class}; Object[] response; try { response = _service.callServiceInventory("deleteGroup1", params, retTypes); Boolean ret=(Boolean)response[0]; if(ret) { PanelAction.actionType=2; PageParameters p = new PageParameters(); p.set("kgroup", group1.getKgroup()); group1 = null; setResponsePage(SubLevel1Page.class,p); return 1; } return 0; } catch (AxisFault e) { // TODO Auto-generated catch block error("Data tidak berhasil disimpan\r\n" + e.getMessage()); } return 2; } public void deleteAction() { // TODO Auto-generated method stub setResponsePage(this); } public void editAction() { // TODO Auto-generated method stub try { setResponsePage(this); kgroup1.remove(ro); ngroup1.remove(ro); } catch(Exception ex){} } public int insert() { // TODO Auto-generated method stub form.process(null); Group1 valuta = (Group1)form.getModelObject(); SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); String dateNow = sdf.format(new Date()); valuta.setTglupdate(Long.parseLong(dateNow)); valuta.setUserupdate(UserInfo.USERID); Object[] params=new Object[]{valuta}; Class[] retTypes =new Class[]{Boolean.class}; Object[] response; boolean duplicate=false; try { response = _service.callServiceInventory("insertGroup1", params, retTypes); Boolean ret=(Boolean)response[0]; if(ret) { PageParameters p = new PageParameters(); p.set("kgroup", group1.getKgroup()); setResponsePage(SubLevel1Page.class,p); PanelAction.actionType=0; } return ret?1:0; } catch (AxisFault e) { // TODO Auto-generated catch block if(e.getMessage().indexOf("Duplicate")>=0) { error(e.getMessage() + ",Click activate button if you would like to activate."); duplicate=true; } else error(e.getMessage()); } return duplicate? 2: 0; } public void newAction() { // TODO Auto-generated method stub PageParameters p= new PageParameters(); p.add("new", 1); if(group1!=null) { group1.setKgroup1(""); group1.setNgroup1(""); p.set("kgroup", group1.getKgroup()); } setResponsePage(SubLevel1Page.class,p); try { kgroup1.remove(ro); ngroup1.remove(ro); } catch(Exception ex){} } public void print() { // TODO Auto-generated method stub } public int update() { // TODO Auto-generated method stub form.process(null); Group1 group1 = (Group1)form.getModelObject(); SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); String dateNow = sdf.format(new Date()); group1.setTglupdate(Long.parseLong(dateNow)); group1.setUserupdate(UserInfo.USERID); Object[] params=new Object[]{group1}; Class[] retTypes =new Class[]{Boolean.class}; Object[] response; try { response = _service.callServiceInventory("updateGroup1", params, retTypes); Boolean ret=(Boolean)response[0]; if(ret) { PanelAction.actionType=2; setResponsePage(SubLevel1Page.class); } return ret?1:0; } catch (AxisFault e) { // TODO Auto-generated catch block e.printStackTrace(); } return 0; } }
UTF-8
Java
10,367
java
SubLevel1Page.java
Java
[]
null
[]
package org.apache.wicket.erp.logistic; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import org.apache.axis2.AxisFault; import org.apache.wicket.AttributeModifier; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.markup.html.AjaxLink; import org.apache.wicket.erp.accounting.BasePage; import org.apache.wicket.erp.utils.IActionHandler; import org.apache.wicket.erp.utils.PanelAction; import org.apache.wicket.erp.utils.Service; import org.apache.wicket.erp.utils.UserInfo; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.form.RequiredTextField; import org.apache.wicket.markup.html.link.Link; import org.apache.wicket.markup.html.link.PopupSettings; import org.apache.wicket.markup.html.navigation.paging.PagingNavigator; import org.apache.wicket.markup.repeater.Item; import org.apache.wicket.markup.repeater.data.DataView; import org.apache.wicket.markup.repeater.data.ListDataProvider; import org.apache.wicket.model.AbstractReadOnlyModel; import org.apache.wicket.model.CompoundPropertyModel; import org.apache.wicket.request.mapper.parameter.PageParameters; import java.text.SimpleDateFormat; public class SubLevel1Page extends BasePage implements IActionHandler{ /** * */ private static final long serialVersionUID = 1L; private Service _service; HashMap<String, Group1> maps; private ArrayList<Group1> list=new ArrayList<Group1>(); private Form<Group1> form; public static Group1 group1; private Link subgrouplevel2Button; private RequiredTextField<String> kgroup; private RequiredTextField<String> kgroup1; private RequiredTextField<String> ngroup1; boolean isReadOnly=true; private static String kgroupValue; final AttributeModifier ro = new AttributeModifier("readonly", isReadOnly); public SubLevel1Page(PageParameters p) { super("Sub Group Level1"); kgroupValue=p.get("kgroup").toString(); if(group1==null) { group1=new Group1(); } group1.setKgroup(kgroupValue); init(); getGroup1(kgroupValue); buildPage(); try { if(p.get("new")!=null) { if(p.get("new").toString().equals("1")) { kgroup1.remove(ro); ngroup1.remove(ro); } } } catch(Exception ex){} } public SubLevel1Page() { super("Sub Group Level1"); init(); getGroup1(group1.getKgroup()); buildPage(); } @SuppressWarnings("unchecked") private void buildPage() { final DataView<Group1> dataView = new DataView<Group1>("pageable", new ListDataProvider( list)) { /** * */ private static final long serialVersionUID = 1L; public void populateItem(final Item item) { final Group1 _group1 = (Group1) item.getModelObject(); item.add(new Label("no", String.valueOf(_group1.getNo()))); item.add(new Label("kgroup", _group1.getKgroup())); item.add(new Label("kgroup1", _group1.getKgroup1())); item.add(new Label("ngroup1", _group1.getNgroup1())); item.add(new AjaxLink<Group1>("select") { /** * */ private static final long serialVersionUID = 1L; @Override public void onClick(AjaxRequestTarget target) { // TODO Auto-generated method stub Group1 selected = (Group1)getParent().getDefaultModelObject(); group1=selected; PanelAction.actionType=2; setResponsePage(SubLevel1Page.class); } }); item.add(AttributeModifier.replace("class", new AbstractReadOnlyModel<String>() { private static final long serialVersionUID = 1L; @Override public String getObject() { return (item.getIndex() % 2 == 1) ? "even" : "odd"; } })); } }; dataView.setItemsPerPage(8); add(dataView); add(new PagingNavigator("navigator", dataView)); form = new Form<Group1>("form", new CompoundPropertyModel<Group1>(this.group1)); add(form); // add a simple text field that uses Input's 'text' property. Nothing // can go wrong here kgroup=new RequiredTextField<String>("kgroup"); kgroup1=new RequiredTextField<String>("kgroup1"); ngroup1=new RequiredTextField<String>("ngroup1"); PopupSettings popupSettings = new PopupSettings(PopupSettings.LOCATION_BAR | PopupSettings.RESIZABLE | PopupSettings.SCROLLBARS). setHeight(300).setWidth(730).setTop(300).setLeft(180); subgrouplevel2Button=new Link("subgrouplevel2Button") { /** * */ private static final long serialVersionUID = 1L; @Override public void onClick() { // TODO Auto-generated method stub //setResponsePage(ModalKursHarianPage.class, new PageParameters()); PageParameters p =new PageParameters(); p.add("kgroup", kgroup.getModelObject()); p.add("kgroup1", kgroup1.getModelObject()); setResponsePage(SubLevel2Page.class,p); } }; subgrouplevel2Button.setPopupSettings(popupSettings); subgrouplevel2Button.setEnabled((PanelAction.actionType==2||PanelAction.actionType==3)? true:false); form.add(subgrouplevel2Button); readOnly(); form.add(kgroup); form.add(kgroup1); form.add(ngroup1); form.add(new PanelAction("actionpanel",this)); } private void init() { maps=new HashMap<String, Group1>(); try { _service=new Service(Service.INVENTORY_SERVICE_URL); } catch (AxisFault e) { // TODO Auto-generated catch block e.printStackTrace(); } } private void getGroup1(String kgroup) { Object[] params=new Object[]{kgroup}; Class[] retTypes =new Class[]{Group1.class}; try { Object[] response=_service.callServiceInventory("getGroup1ByCode", params,retTypes); Group1 item = (Group1)response[0]; if(item==null) return; if(item.getGroups()==null) return; int count=item.getGroups().length; list = new ArrayList<Group1>(); for(int i=0; i < count;i++) { sf.inventory.Group1 group1=item.getGroups()[i]; Group1 _group1 = new Group1(); _group1.setKgroup(group1.getKgroup()); _group1.setNo(i+1); _group1.setKgroup1(group1.getKgroup1()); _group1.setNgroup1(group1.getNgroup1()); if(null!=_group1) { list.add(_group1); } } } catch (AxisFault e) { // TODO Auto-generated catch block e.printStackTrace(); } } public void readOnly() { // TODO Auto-generated method stub try { kgroup.add(ro); kgroup1.add(ro); ngroup1.add(ro); } catch(Exception ex){} } public void activate() { // TODO Auto-generated method stub setResponsePage(SubLevel1Page.class); } public void cancel(boolean flag) { // TODO Auto-generated method stub PageParameters p = new PageParameters(); p.set("kgroup", group1.getKgroup()); setResponsePage(SubLevel1Page.class,p); } public int delete() { // TODO Auto-generated method stub form.process(null); Group1 valuta= (Group1)form.getModelObject(); SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); String dateNow = sdf.format(new Date()); valuta.setTglupdate(Long.parseLong(dateNow)); valuta.setUserupdate(UserInfo.USERID); Object[] params=new Object[]{valuta}; Class[] retTypes =new Class[]{Boolean.class}; Object[] response; try { response = _service.callServiceInventory("deleteGroup1", params, retTypes); Boolean ret=(Boolean)response[0]; if(ret) { PanelAction.actionType=2; PageParameters p = new PageParameters(); p.set("kgroup", group1.getKgroup()); group1 = null; setResponsePage(SubLevel1Page.class,p); return 1; } return 0; } catch (AxisFault e) { // TODO Auto-generated catch block error("Data tidak berhasil disimpan\r\n" + e.getMessage()); } return 2; } public void deleteAction() { // TODO Auto-generated method stub setResponsePage(this); } public void editAction() { // TODO Auto-generated method stub try { setResponsePage(this); kgroup1.remove(ro); ngroup1.remove(ro); } catch(Exception ex){} } public int insert() { // TODO Auto-generated method stub form.process(null); Group1 valuta = (Group1)form.getModelObject(); SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); String dateNow = sdf.format(new Date()); valuta.setTglupdate(Long.parseLong(dateNow)); valuta.setUserupdate(UserInfo.USERID); Object[] params=new Object[]{valuta}; Class[] retTypes =new Class[]{Boolean.class}; Object[] response; boolean duplicate=false; try { response = _service.callServiceInventory("insertGroup1", params, retTypes); Boolean ret=(Boolean)response[0]; if(ret) { PageParameters p = new PageParameters(); p.set("kgroup", group1.getKgroup()); setResponsePage(SubLevel1Page.class,p); PanelAction.actionType=0; } return ret?1:0; } catch (AxisFault e) { // TODO Auto-generated catch block if(e.getMessage().indexOf("Duplicate")>=0) { error(e.getMessage() + ",Click activate button if you would like to activate."); duplicate=true; } else error(e.getMessage()); } return duplicate? 2: 0; } public void newAction() { // TODO Auto-generated method stub PageParameters p= new PageParameters(); p.add("new", 1); if(group1!=null) { group1.setKgroup1(""); group1.setNgroup1(""); p.set("kgroup", group1.getKgroup()); } setResponsePage(SubLevel1Page.class,p); try { kgroup1.remove(ro); ngroup1.remove(ro); } catch(Exception ex){} } public void print() { // TODO Auto-generated method stub } public int update() { // TODO Auto-generated method stub form.process(null); Group1 group1 = (Group1)form.getModelObject(); SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); String dateNow = sdf.format(new Date()); group1.setTglupdate(Long.parseLong(dateNow)); group1.setUserupdate(UserInfo.USERID); Object[] params=new Object[]{group1}; Class[] retTypes =new Class[]{Boolean.class}; Object[] response; try { response = _service.callServiceInventory("updateGroup1", params, retTypes); Boolean ret=(Boolean)response[0]; if(ret) { PanelAction.actionType=2; setResponsePage(SubLevel1Page.class); } return ret?1:0; } catch (AxisFault e) { // TODO Auto-generated catch block e.printStackTrace(); } return 0; } }
10,367
0.685734
0.669914
383
26.067884
21.893061
132
false
false
0
0
0
0
0
0
2.749347
false
false
3
e2a02584c005e7467a45d56aee90d02133d8b63c
4,483,945,913,083
1a5bd0e50a052408d5ce5beea32edc3afea081a6
/godisnji-odmori/src/main/java/tim12/si/app/godisnji_odmori/ViewModel/IzvjestajVM.java
67ff8350db3d6dd8666d4e3ce6c45b9c1d71bf94
[]
no_license
SoftverInzenjeringETFSA/SI2015Tim2
https://github.com/SoftverInzenjeringETFSA/SI2015Tim2
e00e31fa9e4739a14b1644f808891ee7f376f2c1
b130e6a4d513c382d6f4d29d866e9869afe026ff
refs/heads/master
2021-01-18T21:28:00.268000
2016-05-23T16:35:56
2016-05-23T16:35:56
52,455,657
3
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package tim12.si.app.godisnji_odmori.ViewModel; import java.util.List; public class IzvjestajVM { public List<IzvjestajZapVM> listaZaposlenikaIPodataka; public int ukupnoRadni; public int ukupnoNeradni; //Konstruktori public IzvjestajVM (List<IzvjestajZapVM> listaZaposlenikaIPodataka, int ukupnoRadni, int ukupnoNeradni) { this.listaZaposlenikaIPodataka=listaZaposlenikaIPodataka; this.ukupnoRadni=ukupnoRadni; this.ukupnoNeradni=ukupnoNeradni; } public IzvjestajVM() {} //Getteri i setteri public List<IzvjestajZapVM> getListaZaposlenikaIPodataka() { return listaZaposlenikaIPodataka; } public void setListaZaposlenikaIPodataka(List<IzvjestajZapVM> listaZaposlenikaIPodataka) { this.listaZaposlenikaIPodataka = listaZaposlenikaIPodataka; } public int getUkupnoRadni() { return ukupnoRadni; } public void setUkupnoRadni(int ukupnoRadni) { this.ukupnoRadni = ukupnoRadni; } public int getUkupnoNeradni() { return ukupnoNeradni; } public void setUkupnoNeradni(int ukupnoNeradni) { this.ukupnoNeradni = ukupnoNeradni; } }
UTF-8
Java
1,128
java
IzvjestajVM.java
Java
[]
null
[]
package tim12.si.app.godisnji_odmori.ViewModel; import java.util.List; public class IzvjestajVM { public List<IzvjestajZapVM> listaZaposlenikaIPodataka; public int ukupnoRadni; public int ukupnoNeradni; //Konstruktori public IzvjestajVM (List<IzvjestajZapVM> listaZaposlenikaIPodataka, int ukupnoRadni, int ukupnoNeradni) { this.listaZaposlenikaIPodataka=listaZaposlenikaIPodataka; this.ukupnoRadni=ukupnoRadni; this.ukupnoNeradni=ukupnoNeradni; } public IzvjestajVM() {} //Getteri i setteri public List<IzvjestajZapVM> getListaZaposlenikaIPodataka() { return listaZaposlenikaIPodataka; } public void setListaZaposlenikaIPodataka(List<IzvjestajZapVM> listaZaposlenikaIPodataka) { this.listaZaposlenikaIPodataka = listaZaposlenikaIPodataka; } public int getUkupnoRadni() { return ukupnoRadni; } public void setUkupnoRadni(int ukupnoRadni) { this.ukupnoRadni = ukupnoRadni; } public int getUkupnoNeradni() { return ukupnoNeradni; } public void setUkupnoNeradni(int ukupnoNeradni) { this.ukupnoNeradni = ukupnoNeradni; } }
1,128
0.756206
0.754433
48
21.5
25.0408
104
false
false
0
0
0
0
0
0
1.291667
false
false
3
4e3bcae300f6e68b3cbecc52a123fa406b3cb49f
19,902,878,502,962
652e06dab9cb1b442181a00e3d339367a2d17644
/DestinyCommunityHub/src/com/opencabinetlabs/destinycommunityhub/dao/BaseDao.java
a63e6271c321cd98201854d22609d5200de6e409
[ "Apache-2.0" ]
permissive
Jogan/DestinyCommunityHub
https://github.com/Jogan/DestinyCommunityHub
6380509fcd7e63cc75ef1d1f06ed83abfb9de72d
0e6d89788fc8abc1d84c2a79c9050a73d77ba92c
refs/heads/master
2021-01-01T05:38:45.085000
2014-04-02T00:56:38
2014-04-02T00:56:38
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.opencabinetlabs.destinycommunityhub.dao; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import android.database.Cursor; public class BaseDao { /** * Populates a mapping of column name --> index * * @param cursor The cursor to extract * @return The newly created mapping */ protected static Map<String, Integer> buildCursorCols(final Cursor cursor) { Map<String, Integer> retval = new ConcurrentHashMap<String, Integer>(); for (int i = 0, len = cursor.getColumnCount(); i < len; i++) { retval.put(cursor.getColumnName(i), i); } return retval; } }
UTF-8
Java
662
java
BaseDao.java
Java
[]
null
[]
package com.opencabinetlabs.destinycommunityhub.dao; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import android.database.Cursor; public class BaseDao { /** * Populates a mapping of column name --> index * * @param cursor The cursor to extract * @return The newly created mapping */ protected static Map<String, Integer> buildCursorCols(final Cursor cursor) { Map<String, Integer> retval = new ConcurrentHashMap<String, Integer>(); for (int i = 0, len = cursor.getColumnCount(); i < len; i++) { retval.put(cursor.getColumnName(i), i); } return retval; } }
662
0.660121
0.65861
23
27.782608
26.169941
80
false
false
0
0
0
0
0
0
0.652174
false
false
3
238b20d34238389c7cac9f77afd05ca238884fcd
30,769,145,761,131
d6f69d605ef874e9e7f9c2c724182d6d9fdda386
/DPM/src/Ghost.java
c402563fa0d5bc9ec459f5a26a9d9b708fd27a51
[]
no_license
richiwu/ECSE-211
https://github.com/richiwu/ECSE-211
52ce56b010e9bb2acfc8060243d9107e881dcfcb
2421b971599691a175196622074d12b2b77c9679
refs/heads/master
2021-05-28T22:05:22.823000
2015-08-05T03:18:44
2015-08-05T03:18:44
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
public class Ghost { private int x,y; private boolean valid; private String orientation; private Map map; public Ghost(int x, int y, String o, Map m){ this.x = x; this.y = y; this.orientation = o; this.map = m; this.valid = true; } public void invalid(){ valid = false; } public boolean isValid(){ return valid; } public int wallinFront(){ if(orientation.equals("N")){ if(map.getSquare(x, y+1) == null){ return 1; } else if(map.getSquare(x,y+1).isWall()){ return 1; } else if(map.getSquare(x, y+2) == null){ return 1; } else if(map.getSquare(x,y+2).isWall()){ return 1; } } if(orientation.equals("S")){ if(map.getSquare(x, y-1) == null){ return 1; } else if(map.getSquare(x,y-1).isWall()){ return 1; } else if(map.getSquare(x, y-2) == null){ return 2; } else if(map.getSquare(x,y-2).isWall()){ return 2; } } if(orientation.equals("E")){ if(map.getSquare(x+1, y) == null){ return 1; } else if(map.getSquare(x+1,y).isWall()){ return 1; } else if(map.getSquare(x+2, y) == null){ return 2; } else if(map.getSquare(x+2,y).isWall()){ return 2; } } if(orientation.equals("W")){ if(map.getSquare(x-1, y) == null){ return 1; } else if(map.getSquare(x-1,y).isWall()){ return 1; } if(map.getSquare(x-2, y) == null){ return 2; } else if(map.getSquare(x-2,y).isWall()){ return 2; } } return 0; } public int getX(){ return x; } public int getY(){ return y; } public String getOrientation(){ return orientation; } public void move(){ if(orientation.equals("N")){ y++; } if(orientation.equals("S")){ y--; } if(orientation.equals("E")){ x++; } if(orientation.equals("W")){ x--; } } public void turn(){ if(orientation.equals("N")){ orientation = "E"; } else if(orientation.equals("S")){ orientation = "W"; } else if(orientation.equals("E")){ orientation = "S"; } else if(orientation.equals("W")){ orientation = "N"; } } public void turnLeft(){ if(orientation.equals("N")){ orientation = "W"; } else if(orientation.equals("S")){ orientation = "E"; } else if(orientation.equals("E")){ orientation = "N"; } else if(orientation.equals("W")){ orientation = "S"; } } }
UTF-8
Java
2,378
java
Ghost.java
Java
[]
null
[]
public class Ghost { private int x,y; private boolean valid; private String orientation; private Map map; public Ghost(int x, int y, String o, Map m){ this.x = x; this.y = y; this.orientation = o; this.map = m; this.valid = true; } public void invalid(){ valid = false; } public boolean isValid(){ return valid; } public int wallinFront(){ if(orientation.equals("N")){ if(map.getSquare(x, y+1) == null){ return 1; } else if(map.getSquare(x,y+1).isWall()){ return 1; } else if(map.getSquare(x, y+2) == null){ return 1; } else if(map.getSquare(x,y+2).isWall()){ return 1; } } if(orientation.equals("S")){ if(map.getSquare(x, y-1) == null){ return 1; } else if(map.getSquare(x,y-1).isWall()){ return 1; } else if(map.getSquare(x, y-2) == null){ return 2; } else if(map.getSquare(x,y-2).isWall()){ return 2; } } if(orientation.equals("E")){ if(map.getSquare(x+1, y) == null){ return 1; } else if(map.getSquare(x+1,y).isWall()){ return 1; } else if(map.getSquare(x+2, y) == null){ return 2; } else if(map.getSquare(x+2,y).isWall()){ return 2; } } if(orientation.equals("W")){ if(map.getSquare(x-1, y) == null){ return 1; } else if(map.getSquare(x-1,y).isWall()){ return 1; } if(map.getSquare(x-2, y) == null){ return 2; } else if(map.getSquare(x-2,y).isWall()){ return 2; } } return 0; } public int getX(){ return x; } public int getY(){ return y; } public String getOrientation(){ return orientation; } public void move(){ if(orientation.equals("N")){ y++; } if(orientation.equals("S")){ y--; } if(orientation.equals("E")){ x++; } if(orientation.equals("W")){ x--; } } public void turn(){ if(orientation.equals("N")){ orientation = "E"; } else if(orientation.equals("S")){ orientation = "W"; } else if(orientation.equals("E")){ orientation = "S"; } else if(orientation.equals("W")){ orientation = "N"; } } public void turnLeft(){ if(orientation.equals("N")){ orientation = "W"; } else if(orientation.equals("S")){ orientation = "E"; } else if(orientation.equals("E")){ orientation = "N"; } else if(orientation.equals("W")){ orientation = "S"; } } }
2,378
0.558873
0.544996
142
15.739436
13.634917
45
false
false
0
0
0
0
0
0
2.690141
false
false
3
212a69d740ebb7db186796eb8492f74ab5dbfb54
10,479,720,212,286
944083363c858fec7e24acee25ca676a4d9860c9
/src/main/java/com/jurin_n/infrastructure/persistence/JPAPartsRepository.java
f6a5f213e71d734c2fb1303fc871d36e6a88abd4
[]
no_license
jurin-n/jax-rs-2_0-prototype
https://github.com/jurin-n/jax-rs-2_0-prototype
6effd0d5b5c286ada917e9c201af6a67641894c8
65e4f4bf904a171d2a85f9a2b7c55e3c195ef223
refs/heads/master
2020-12-09T08:10:02.639000
2016-10-04T13:05:11
2016-10-04T13:05:11
43,623,603
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.jurin_n.infrastructure.persistence; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import com.jurin_n.domain.parts.Parts; import com.jurin_n.domain.parts.PartsRepository; public class JPAPartsRepository implements PartsRepository { @PersistenceContext private EntityManager em; public JPAPartsRepository() { super(); } public JPAPartsRepository(EntityManager em) { super(); this.em = em; } @Override public Parts findById(String id) { return em.find(Parts.class, id); } @Override public void persist(Parts parts) { em.persist(parts); } }
UTF-8
Java
683
java
JPAPartsRepository.java
Java
[]
null
[]
package com.jurin_n.infrastructure.persistence; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import com.jurin_n.domain.parts.Parts; import com.jurin_n.domain.parts.PartsRepository; public class JPAPartsRepository implements PartsRepository { @PersistenceContext private EntityManager em; public JPAPartsRepository() { super(); } public JPAPartsRepository(EntityManager em) { super(); this.em = em; } @Override public Parts findById(String id) { return em.find(Parts.class, id); } @Override public void persist(Parts parts) { em.persist(parts); } }
683
0.689605
0.689605
31
21.032259
18.593243
60
false
false
0
0
0
0
0
0
0.387097
false
false
3
19ec9aae5ddcd8e659137a7a7f720eabb772e4ed
14,817,637,181,076
15a04ddc490a2273f9516fb2f730b208c672a7bd
/officefloor/web/officeweb_configuration/src/test/java/net/officefloor/woof/model/woof/RemoveUnconnectedTest.java
d5f5f38177bf4fe17a2f9e325072f6379eb1a213
[ "Apache-2.0" ]
permissive
officefloor/OfficeFloor
https://github.com/officefloor/OfficeFloor
d50c4441e96773e3f33b6a154dcaf049088480a2
4bad837e3d71dbc49b161f9814d6b188937ca69d
refs/heads/master
2023-09-01T12:06:04.230000
2023-08-27T16:36:04
2023-08-27T16:36:04
76,112,580
60
7
Apache-2.0
false
2023-09-14T20:12:48
2016-12-10T12:56:50
2023-09-01T21:27:02
2023-09-14T20:12:47
71,559
53
5
17
Java
false
false
/*- * #%L * Web configuration * %% * Copyright (C) 2005 - 2020 Daniel Sagenschneider * %% * 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. * #L% */ package net.officefloor.woof.model.woof; import net.officefloor.model.change.Change; /** * Tests removing from a {@link WoofModel}. * * @author Daniel Sagenschneider */ public class RemoveUnconnectedTest extends AbstractWoofChangesTestCase { /** * Ensure able to remove the {@link WoofHttpContinuationModel}. */ public void testRemoveHttpContinuation() { // Obtain the HTTP Continuation to remove WoofHttpContinuationModel continuation = this.model.getWoofHttpContinuations().get(0); // Remove the application path Change<WoofHttpContinuationModel> change = this.operations.removeHttpContinuation(continuation); this.assertChange(change, continuation, "Remove HTTP continuation /path", true); } /** * Ensure able to remove the {@link WoofHttpInputModel}. */ public void testRemoveHttpInput() { // Obtain the HTTP Input to remove WoofHttpInputModel httpInput = this.model.getWoofHttpInputs().get(0); // Remove the HTTP Input Change<WoofHttpInputModel> change = this.operations.removeHttpInput(httpInput); this.assertChange(change, httpInput, "Remove HTTP input POST /input", true); } /** * Ensure able to remove the {@link WoofTemplateModel}. */ public void testRemoveTemplate() { // Register the extension test details Change<?> extensionChange = this.createMock(Change.class); MockChangeWoofTemplateExtensionSource.reset(extensionChange, "/template", new String[] { "ONE", "A", "TWO", "B" }, null, null, this.getWoofTemplateChangeContext()); // Record extension change MockChangeWoofTemplateExtensionSource.recordAssertChange(extensionChange, this); // Obtain the template to remove WoofTemplateModel template = this.model.getWoofTemplates().get(0); // Test this.replayMockObjects(); // Remove the template Change<WoofTemplateModel> change = this.operations.removeTemplate(template, this.getWoofTemplateChangeContext()); // Validate change this.assertChange(change, template, "Remove template /template", true); // Verify this.verifyMockObjects(); } /** * Ensure able to remove the {@link WoofProcedureModel}. */ public void testRemoveProcedure() { // Obtain the procedure to remove WoofProcedureModel procedure = this.model.getWoofProcedures().get(0); // Remove the procedure Change<WoofProcedureModel> change = this.operations.removeProcedure(procedure); this.assertChange(change, procedure, "Remove procedure PROCEDURE", true); } /** * Ensure able to remove the {@link WoofSectionModel}. */ public void testRemoveSection() { // Obtain the section to remove WoofSectionModel section = this.model.getWoofSections().get(0); // Remove the section Change<WoofSectionModel> change = this.operations.removeSection(section); this.assertChange(change, section, "Remove section SECTION", true); } /** * Ensure able to remove the {@link WoofSecurityModel}. */ public void testRemoveSecurity() { // Obtain the security to remove WoofSecurityModel security = this.model.getWoofSecurities().get(0); // Remove the security Change<WoofSecurityModel> change = this.operations.removeSecurity(security); this.assertChange(change, security, "Remove security SECURITY", true); } /** * Ensure able to remove the {@link WoofGovernanceModel}. */ public void testRemoveGovernance() { // Obtain the governance to remove WoofGovernanceModel governance = this.model.getWoofGovernances().get(0); // Remove the governance Change<WoofGovernanceModel> change = this.operations.removeGovernance(governance); this.assertChange(change, governance, "Remove governance GOVERNANCE", true); } /** * Ensure able to remove the {@link WoofResourceModel}. */ public void testRemoveResource() { // Obtain the resource to remove WoofResourceModel resource = this.model.getWoofResources().get(0); // Remove the resource Change<WoofResourceModel> change = this.operations.removeResource(resource); this.assertChange(change, resource, "Remove resource Example.html", true); } /** * Ensure able to remove the {@link WoofExceptionModel}. */ public void testRemoveException() { // Obtain the exception to remove WoofExceptionModel exception = this.model.getWoofExceptions().get(0); // Remove the exception Change<WoofExceptionModel> change = this.operations.removeException(exception); this.assertChange(change, exception, "Remove exception java.lang.Exception", true); } /** * Ensure able to remove the {@link WoofStartModel}. */ public void testRemoveStart() { // Obtain the start to remove WoofStartModel start = this.model.getWoofStarts().get(0); // Remove the start Change<WoofStartModel> change = this.operations.removeStart(start); this.assertChange(change, start, "Remove start", true); } }
UTF-8
Java
5,458
java
RemoveUnconnectedTest.java
Java
[ { "context": "b configuration\n * %%\n * Copyright (C) 2005 - 2020 Daniel Sagenschneider\n * %%\n * Licensed under the Apache License, Versi", "end": 88, "score": 0.9998400211334229, "start": 67, "tag": "NAME", "value": "Daniel Sagenschneider" }, { "context": " removing from a {@link WoofModel}.\n * \n * @author Daniel Sagenschneider\n */\npublic class RemoveUnconnectedTest extends Ab", "end": 836, "score": 0.9998466968536377, "start": 815, "tag": "NAME", "value": "Daniel Sagenschneider" } ]
null
[]
/*- * #%L * Web configuration * %% * Copyright (C) 2005 - 2020 <NAME> * %% * 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. * #L% */ package net.officefloor.woof.model.woof; import net.officefloor.model.change.Change; /** * Tests removing from a {@link WoofModel}. * * @author <NAME> */ public class RemoveUnconnectedTest extends AbstractWoofChangesTestCase { /** * Ensure able to remove the {@link WoofHttpContinuationModel}. */ public void testRemoveHttpContinuation() { // Obtain the HTTP Continuation to remove WoofHttpContinuationModel continuation = this.model.getWoofHttpContinuations().get(0); // Remove the application path Change<WoofHttpContinuationModel> change = this.operations.removeHttpContinuation(continuation); this.assertChange(change, continuation, "Remove HTTP continuation /path", true); } /** * Ensure able to remove the {@link WoofHttpInputModel}. */ public void testRemoveHttpInput() { // Obtain the HTTP Input to remove WoofHttpInputModel httpInput = this.model.getWoofHttpInputs().get(0); // Remove the HTTP Input Change<WoofHttpInputModel> change = this.operations.removeHttpInput(httpInput); this.assertChange(change, httpInput, "Remove HTTP input POST /input", true); } /** * Ensure able to remove the {@link WoofTemplateModel}. */ public void testRemoveTemplate() { // Register the extension test details Change<?> extensionChange = this.createMock(Change.class); MockChangeWoofTemplateExtensionSource.reset(extensionChange, "/template", new String[] { "ONE", "A", "TWO", "B" }, null, null, this.getWoofTemplateChangeContext()); // Record extension change MockChangeWoofTemplateExtensionSource.recordAssertChange(extensionChange, this); // Obtain the template to remove WoofTemplateModel template = this.model.getWoofTemplates().get(0); // Test this.replayMockObjects(); // Remove the template Change<WoofTemplateModel> change = this.operations.removeTemplate(template, this.getWoofTemplateChangeContext()); // Validate change this.assertChange(change, template, "Remove template /template", true); // Verify this.verifyMockObjects(); } /** * Ensure able to remove the {@link WoofProcedureModel}. */ public void testRemoveProcedure() { // Obtain the procedure to remove WoofProcedureModel procedure = this.model.getWoofProcedures().get(0); // Remove the procedure Change<WoofProcedureModel> change = this.operations.removeProcedure(procedure); this.assertChange(change, procedure, "Remove procedure PROCEDURE", true); } /** * Ensure able to remove the {@link WoofSectionModel}. */ public void testRemoveSection() { // Obtain the section to remove WoofSectionModel section = this.model.getWoofSections().get(0); // Remove the section Change<WoofSectionModel> change = this.operations.removeSection(section); this.assertChange(change, section, "Remove section SECTION", true); } /** * Ensure able to remove the {@link WoofSecurityModel}. */ public void testRemoveSecurity() { // Obtain the security to remove WoofSecurityModel security = this.model.getWoofSecurities().get(0); // Remove the security Change<WoofSecurityModel> change = this.operations.removeSecurity(security); this.assertChange(change, security, "Remove security SECURITY", true); } /** * Ensure able to remove the {@link WoofGovernanceModel}. */ public void testRemoveGovernance() { // Obtain the governance to remove WoofGovernanceModel governance = this.model.getWoofGovernances().get(0); // Remove the governance Change<WoofGovernanceModel> change = this.operations.removeGovernance(governance); this.assertChange(change, governance, "Remove governance GOVERNANCE", true); } /** * Ensure able to remove the {@link WoofResourceModel}. */ public void testRemoveResource() { // Obtain the resource to remove WoofResourceModel resource = this.model.getWoofResources().get(0); // Remove the resource Change<WoofResourceModel> change = this.operations.removeResource(resource); this.assertChange(change, resource, "Remove resource Example.html", true); } /** * Ensure able to remove the {@link WoofExceptionModel}. */ public void testRemoveException() { // Obtain the exception to remove WoofExceptionModel exception = this.model.getWoofExceptions().get(0); // Remove the exception Change<WoofExceptionModel> change = this.operations.removeException(exception); this.assertChange(change, exception, "Remove exception java.lang.Exception", true); } /** * Ensure able to remove the {@link WoofStartModel}. */ public void testRemoveStart() { // Obtain the start to remove WoofStartModel start = this.model.getWoofStarts().get(0); // Remove the start Change<WoofStartModel> change = this.operations.removeStart(start); this.assertChange(change, start, "Remove start", true); } }
5,428
0.737816
0.733785
179
29.491621
29.849785
98
false
false
0
0
0
0
0
0
1.452514
false
false
3
57c2ad3812801403abe527e2898cce00c3b4e491
1,838,246,018,479
f60a8bdc9085025f6e899c81f2f11127d22594ee
/app/src/main/java/com/example/mediatracker/RecyclerAdapter.java
118f3fcdc42d3e7c9b02093169c3efceb9c2ec46
[]
no_license
AlgidPenguin/MediaTracker
https://github.com/AlgidPenguin/MediaTracker
af2b5b0782f13ae51050edb874b35fffbdf93336
6b159237a683812117121653deaa5b9932be7962
refs/heads/master
2023-06-12T07:40:59.179000
2021-06-22T21:29:05
2021-06-22T21:29:05
370,915,426
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.mediatracker; import android.content.Intent; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import androidx.recyclerview.widget.RecyclerView; import java.util.List; public class RecyclerAdapter extends RecyclerView.Adapter<RecyclerAdapter.ViewHolder> { private List<Album> albumList; private AlbumListener globalAlbumListener; public RecyclerAdapter(AlbumListener albumListener) { this.globalAlbumListener = albumListener; } @Override public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) { View v = LayoutInflater.from(viewGroup.getContext()) .inflate(R.layout.media_layout, viewGroup, false); ViewHolder viewHolder = new ViewHolder(v, globalAlbumListener); return viewHolder; } public void onBindViewHolder(ViewHolder viewHolder, int i) { viewHolder.itemTitle.setText(albumList.get(i).getTitle()); viewHolder.itemArtist.setText(albumList.get(i).getArtist()); viewHolder.itemFormat.setText(albumList.get(i).getFormat()); } public int getItemCount() { if(albumList == null) { return 0; } else { return albumList.size(); } } public void setAlbumList(List<Album> albums) { albumList = albums; notifyDataSetChanged(); } class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { TextView itemTitle; TextView itemArtist; TextView itemFormat; AlbumListener albumListener; ViewHolder(View itemView, AlbumListener albumListener ) { super(itemView); itemTitle = itemView.findViewById(R.id.album_title); itemArtist = itemView.findViewById(R.id.album_artist); itemFormat = itemView.findViewById(R.id.album_format); this.albumListener = albumListener; itemView.setOnClickListener(this); } @Override public void onClick(View v) { albumListener.albumClick(albumList.get(getAdapterPosition())); } } public interface AlbumListener { void albumClick(Album album); } }
UTF-8
Java
2,281
java
RecyclerAdapter.java
Java
[]
null
[]
package com.example.mediatracker; import android.content.Intent; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import androidx.recyclerview.widget.RecyclerView; import java.util.List; public class RecyclerAdapter extends RecyclerView.Adapter<RecyclerAdapter.ViewHolder> { private List<Album> albumList; private AlbumListener globalAlbumListener; public RecyclerAdapter(AlbumListener albumListener) { this.globalAlbumListener = albumListener; } @Override public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) { View v = LayoutInflater.from(viewGroup.getContext()) .inflate(R.layout.media_layout, viewGroup, false); ViewHolder viewHolder = new ViewHolder(v, globalAlbumListener); return viewHolder; } public void onBindViewHolder(ViewHolder viewHolder, int i) { viewHolder.itemTitle.setText(albumList.get(i).getTitle()); viewHolder.itemArtist.setText(albumList.get(i).getArtist()); viewHolder.itemFormat.setText(albumList.get(i).getFormat()); } public int getItemCount() { if(albumList == null) { return 0; } else { return albumList.size(); } } public void setAlbumList(List<Album> albums) { albumList = albums; notifyDataSetChanged(); } class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { TextView itemTitle; TextView itemArtist; TextView itemFormat; AlbumListener albumListener; ViewHolder(View itemView, AlbumListener albumListener ) { super(itemView); itemTitle = itemView.findViewById(R.id.album_title); itemArtist = itemView.findViewById(R.id.album_artist); itemFormat = itemView.findViewById(R.id.album_format); this.albumListener = albumListener; itemView.setOnClickListener(this); } @Override public void onClick(View v) { albumListener.albumClick(albumList.get(getAdapterPosition())); } } public interface AlbumListener { void albumClick(Album album); } }
2,281
0.671197
0.670758
77
28.623377
25.515993
87
false
false
0
0
0
0
0
0
0.506494
false
false
3
065116b48b2bae1c50529724d45d8982464dfacf
28,724,741,289,985
12d5e3d9e5f8a91c11f072da0959211c2ea20e10
/restclient/src/main/java/com/example/restclient/json/JokeResponse.java
99f00ed45e2b2e0c83ff0ba5e4496a7d5c2e469c
[]
no_license
cyu60/learning-springboot
https://github.com/cyu60/learning-springboot
115adf284d2c33172ceef0edc3901d8456bcc534
f249d750e8b2f327796b0df48ae4e4e8b0d75e87
refs/heads/main
2023-04-30T11:16:38.975000
2021-05-27T10:18:35
2021-05-27T10:18:35
369,224,421
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.restclient.json; public class JokeResponse { private String response; private Value value; public String getResponse() { return response; } public void setResponse(String response) { this.response = response; } public Value getValue() { return value; } public void setValue(Value value) { this.value = value; } }
UTF-8
Java
410
java
JokeResponse.java
Java
[]
null
[]
package com.example.restclient.json; public class JokeResponse { private String response; private Value value; public String getResponse() { return response; } public void setResponse(String response) { this.response = response; } public Value getValue() { return value; } public void setValue(Value value) { this.value = value; } }
410
0.62439
0.62439
22
17.636364
15.143392
46
false
false
0
0
0
0
0
0
0.318182
false
false
3
77abfd0f500d2c2357ad71aab52a35fc65b71960
4,887,672,799,096
e04b8a0c67a5f10c23755e453dec22caf4ae6836
/src/main/java/leetcode练习题/printNumbers.java
5b86b7fa7afae4ba8f73e5307733f8c84e6d7b7f
[]
no_license
2462612540/LeetCode
https://github.com/2462612540/LeetCode
7db83f92c47ee672ff0a703e960d146f5b488cec
59b27411dc82e482950d3f141bfd6886124296b5
refs/heads/master
2022-05-29T12:50:21.803000
2021-08-12T15:40:05
2021-08-12T15:40:05
226,246,049
5
0
null
false
2021-03-21T01:33:50
2019-12-06T04:32:33
2021-02-25T12:16:57
2021-03-21T01:33:50
95,317
5
0
0
Java
false
false
/** * Copyright (C), 2018-2020 * FileName: printNumbers * Author: xjl * Date: 2020/3/5 12:24 * Description: 输入数字 n,按顺序打印出从 1 到最大的 n 位十进制数。比如输入 3,则打印出 1、2、3 一直到最大的 3 位数 999。 */ package leetcode练习题; public class printNumbers { public static int[] printNumbers(int n) { int sum=0; for(int i=1;i<=n;i++){ sum=10*sum+9; } int[] numbers = new int[sum]; for (int i=0;i<sum;i++){ numbers[i]=i+1; System.out.println(numbers[i]); } return numbers; } public static void main(String[] args) { printNumbers(3); } }
UTF-8
Java
722
java
printNumbers.java
Java
[ { "context": ", 2018-2020\n * FileName: printNumbers\n * Author: xjl\n * Date: 2020/3/5 12:24\n * Description: 输入数字 ", "end": 74, "score": 0.999703586101532, "start": 71, "tag": "USERNAME", "value": "xjl" } ]
null
[]
/** * Copyright (C), 2018-2020 * FileName: printNumbers * Author: xjl * Date: 2020/3/5 12:24 * Description: 输入数字 n,按顺序打印出从 1 到最大的 n 位十进制数。比如输入 3,则打印出 1、2、3 一直到最大的 3 位数 999。 */ package leetcode练习题; public class printNumbers { public static int[] printNumbers(int n) { int sum=0; for(int i=1;i<=n;i++){ sum=10*sum+9; } int[] numbers = new int[sum]; for (int i=0;i<sum;i++){ numbers[i]=i+1; System.out.println(numbers[i]); } return numbers; } public static void main(String[] args) { printNumbers(3); } }
722
0.537975
0.482595
27
22.407408
17.668259
80
false
false
0
0
0
0
0
0
0.481481
false
false
3
41d6636aaf75951c016408087f68f336624e00e9
18,597,208,411,725
0e4cd5d6ca6ddb6922bfcad338185d2ca1cc5609
/GWTC2CProject/src/main/java/org/C2C/client/TaskRegisterClass.java
6d9f10b16219ffac37db8549934414c9fda05bd6
[]
no_license
ghmayakyan/gwtc2c
https://github.com/ghmayakyan/gwtc2c
5fb869747903b34a0f4134b7e28d61da713995af
5b9dd51b6983722165486500bfdf717019874356
refs/heads/master
2016-08-05T21:08:06.184000
2015-01-09T03:18:06
2015-01-09T03:18:06
32,685,310
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/** * Copyright 2014-2015 C2C Software, LLC. All rights reserved. * C2C SOFTWARE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ package org.C2C.client; /** * Class RegisterClass * @author C2C Software, LLC */ public class TaskRegisterClass extends Task { Object m_serverSideClasName = null; Class m_localClass = null; /** * The default constructor for class RegisterClass */ public TaskRegisterClass(Object serverSideClasName, Class localClass) { super(); m_serverSideClasName = serverSideClasName; m_localClass = localClass; setCompleted(false); TaskManager.ADD_TASK(this); } @Override public String run() { String ret = CallManager.REGISTER_CLASS(this, (String) m_serverSideClasName, m_localClass); setCompleted(true); return ret; } }
UTF-8
Java
875
java
TaskRegisterClass.java
Java
[]
null
[]
/** * Copyright 2014-2015 C2C Software, LLC. All rights reserved. * C2C SOFTWARE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ package org.C2C.client; /** * Class RegisterClass * @author C2C Software, LLC */ public class TaskRegisterClass extends Task { Object m_serverSideClasName = null; Class m_localClass = null; /** * The default constructor for class RegisterClass */ public TaskRegisterClass(Object serverSideClasName, Class localClass) { super(); m_serverSideClasName = serverSideClasName; m_localClass = localClass; setCompleted(false); TaskManager.ADD_TASK(this); } @Override public String run() { String ret = CallManager.REGISTER_CLASS(this, (String) m_serverSideClasName, m_localClass); setCompleted(true); return ret; } }
875
0.662857
0.649143
35
24
24.62171
99
false
false
0
0
0
0
0
0
0.457143
false
false
3
97369ccd3287b8486497dddebf5ec60eb7b40940
5,798,205,866,536
ddd02d6a03642ff861dec4311f526ea6e881cdc5
/src/main/java/ma/zs/generated/bean/CourrierPieceJoint.java
fa889541324d3fdd4793f6d2a5a73cd710cd1ff6
[]
no_license
Noureddine-ait/backendAfter
https://github.com/Noureddine-ait/backendAfter
5d6588906ced702c28dd3c24271bc24493bd9658
bb92bbfeefc47ea459f738cc8e617cb3336a6e43
refs/heads/master
2023-05-14T20:30:04.952000
2021-06-06T15:15:17
2021-06-06T15:15:17
374,391,947
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package ma.zs.generated.bean; import javax.persistence.*; import java.util.List; import java.util.Arrays; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; import ma.zs.generated.bean.CourrierObject; import ma.zs.generated.bean.Voie; import ma.zs.generated.bean.NatureCourrier; import ma.zs.generated.bean.Courrier; import ma.zs.generated.bean.Expeditor; import ma.zs.generated.bean.LeService; import ma.zs.generated.bean.Evaluation; import ma.zs.generated.bean.ExpeditorType; import ma.zs.generated.bean.Subdivision; import ma.zs.generated.bean.Status; import ma.zs.generated.bean.TypeCourrier; import ma.zs.generated.bean.User; @Entity public class CourrierPieceJoint { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; private String chemin; private String absoluteChemin = "C:\\Users\\" + System.getProperty("user.name") + "\\pieces-jointes\\" + chemin; private byte[] contenu; private String type; @ManyToOne private Courrier courier; public String getAbsoluteChemin() { return absoluteChemin; } public void setAbsoluteChemin(String absoluteChemin) { this.absoluteChemin = absoluteChemin; } public String getChemin() { return chemin; } public void setChemin(String chemin) { this.chemin = chemin; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public byte[] getContenu() { return contenu; } public void setContenu(byte[] contenu) { this.contenu = contenu; } public Courrier getCourier() { return courier; } public void setCourier(Courrier courier) { this.courier = courier; } public CourrierPieceJoint() { super(); // TODO Auto-generated constructor stub this.absoluteChemin = "C:\\Users\\" + System.getProperty("user.name") + "\\pieces-jointes\\" + chemin; } public CourrierPieceJoint(Long id, String chemin, byte[] contenu, String type, Courrier courier) { super(); this.id = id; this.chemin = chemin; this.contenu = contenu; this.type = type; this.courier = courier; this.absoluteChemin = "C:\\Users\\" + System.getProperty("user.name") + "\\pieces-jointes\\" + chemin; } @Override public String toString() { return "CourrierPieceJoint [id=" + id + ", chemin=" + chemin + ", contenu=" + Arrays.toString(contenu) + ", type=" + type + ", courier=" + courier + "]"; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((chemin == null) ? 0 : chemin.hashCode()); result = prime * result + Arrays.hashCode(contenu); result = prime * result + ((courier == null) ? 0 : courier.hashCode()); result = prime * result + ((id == null) ? 0 : id.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; CourrierPieceJoint other = (CourrierPieceJoint) obj; if (chemin == null) { if (other.chemin != null) return false; } else if (!chemin.equals(other.chemin)) return false; if (!Arrays.equals(contenu, other.contenu)) return false; if (courier == null) { if (other.courier != null) return false; } else if (!courier.equals(other.courier)) return false; if (id == null) { if (other.id != null) return false; } else if (!id.equals(other.id)) return false; return true; } }
UTF-8
Java
3,427
java
CourrierPieceJoint.java
Java
[]
null
[]
package ma.zs.generated.bean; import javax.persistence.*; import java.util.List; import java.util.Arrays; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; import ma.zs.generated.bean.CourrierObject; import ma.zs.generated.bean.Voie; import ma.zs.generated.bean.NatureCourrier; import ma.zs.generated.bean.Courrier; import ma.zs.generated.bean.Expeditor; import ma.zs.generated.bean.LeService; import ma.zs.generated.bean.Evaluation; import ma.zs.generated.bean.ExpeditorType; import ma.zs.generated.bean.Subdivision; import ma.zs.generated.bean.Status; import ma.zs.generated.bean.TypeCourrier; import ma.zs.generated.bean.User; @Entity public class CourrierPieceJoint { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; private String chemin; private String absoluteChemin = "C:\\Users\\" + System.getProperty("user.name") + "\\pieces-jointes\\" + chemin; private byte[] contenu; private String type; @ManyToOne private Courrier courier; public String getAbsoluteChemin() { return absoluteChemin; } public void setAbsoluteChemin(String absoluteChemin) { this.absoluteChemin = absoluteChemin; } public String getChemin() { return chemin; } public void setChemin(String chemin) { this.chemin = chemin; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public byte[] getContenu() { return contenu; } public void setContenu(byte[] contenu) { this.contenu = contenu; } public Courrier getCourier() { return courier; } public void setCourier(Courrier courier) { this.courier = courier; } public CourrierPieceJoint() { super(); // TODO Auto-generated constructor stub this.absoluteChemin = "C:\\Users\\" + System.getProperty("user.name") + "\\pieces-jointes\\" + chemin; } public CourrierPieceJoint(Long id, String chemin, byte[] contenu, String type, Courrier courier) { super(); this.id = id; this.chemin = chemin; this.contenu = contenu; this.type = type; this.courier = courier; this.absoluteChemin = "C:\\Users\\" + System.getProperty("user.name") + "\\pieces-jointes\\" + chemin; } @Override public String toString() { return "CourrierPieceJoint [id=" + id + ", chemin=" + chemin + ", contenu=" + Arrays.toString(contenu) + ", type=" + type + ", courier=" + courier + "]"; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((chemin == null) ? 0 : chemin.hashCode()); result = prime * result + Arrays.hashCode(contenu); result = prime * result + ((courier == null) ? 0 : courier.hashCode()); result = prime * result + ((id == null) ? 0 : id.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; CourrierPieceJoint other = (CourrierPieceJoint) obj; if (chemin == null) { if (other.chemin != null) return false; } else if (!chemin.equals(other.chemin)) return false; if (!Arrays.equals(contenu, other.contenu)) return false; if (courier == null) { if (other.courier != null) return false; } else if (!courier.equals(other.courier)) return false; if (id == null) { if (other.id != null) return false; } else if (!id.equals(other.id)) return false; return true; } }
3,427
0.68398
0.682229
128
25.765625
22.93758
116
false
false
0
0
0
0
0
0
1.8125
false
false
3
f0a7b7e47fedb4c3a371892f543a5f62d440b9a0
4,449,586,141,959
cf55ff3fc92b7c9bb3985720dfeaf87548cedfa7
/src/br/edu/unipac/exemplos/equal/ClasseA.java
dcf2320394f93032a1a35dc1512705c25b7c21af
[]
no_license
diego91964/poo-unipac
https://github.com/diego91964/poo-unipac
24bb96b3f21750c6b69b150124c7eca99baf92ac
5d22c764d2e0d49537505435fe1fa40b6fb178d6
refs/heads/master
2021-01-19T15:12:49.945000
2017-10-17T17:25:14
2017-10-17T17:25:14
100,950,893
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package br.edu.unipac.exemplos.equal; public class ClasseA { public String s; public static String s2 = "teste2"; ClasseA() { this.s = new String( "teste" ); } }
UTF-8
Java
194
java
ClasseA.java
Java
[]
null
[]
package br.edu.unipac.exemplos.equal; public class ClasseA { public String s; public static String s2 = "teste2"; ClasseA() { this.s = new String( "teste" ); } }
194
0.587629
0.57732
11
16.636364
15.363905
40
false
false
0
0
0
0
0
0
0.363636
false
false
3
a889c7d97b7442567e63f568452a86b572f58fd7
4,423,816,336,902
04cc53efc476a5dbb7f1dfc35600e3eeaf54316b
/jframe-utils/src/test/java/com/jf/database/model/CustomUser.java
1061f694ef4d94800c33a66d5060423c10d0c3ca
[ "BSD-3-Clause" ]
permissive
jacksonrick/JFrameBoot
https://github.com/jacksonrick/JFrameBoot
eb57390a6ae0ab3f11bdda62ab7309a52b7825d8
7bb6d3b35ed6bcae1851f1536fe5644183399945
refs/heads/master
2021-05-13T21:13:51.513000
2020-09-04T01:53:34
2020-09-04T01:53:34
116,456,932
7
3
BSD-3-Clause
false
2021-04-13T02:41:46
2018-01-06T05:40:54
2021-04-13T02:41:28
2021-04-13T02:41:46
30,842
7
3
5
JavaScript
false
false
package com.jf.database.model; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.jf.json.StringArraySerialize; import java.util.Date; /** * Created by xujunfei on 2017/1/4. */ public class CustomUser { @JsonSerialize(using = ToStringSerializer.class) private Integer id; @JsonSerialize(using = StringArraySerialize.class) private Integer[] ids; private String name; private Integer age; private Boolean flag; @JsonFormat(pattern = "yyyy-MM-dd") private Date birth; @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date time; private Date dates; private CustomRole role; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public Integer[] getIds() { return ids; } public void setIds(Integer[] ids) { this.ids = ids; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getAge() { return age; } public void setAge(Integer age) { this.age = age; } public Boolean getFlag() { return flag; } public void setFlag(Boolean flag) { this.flag = flag; } public Date getBirth() { return birth; } public void setBirth(Date birth) { this.birth = birth; } public Date getTime() { return time; } public void setTime(Date time) { this.time = time; } public Date getDates() { return dates; } public void setDates(Date dates) { this.dates = dates; } public CustomRole getRole() { return role; } public void setRole(CustomRole role) { this.role = role; } @Override public String toString() { return "TUser{" + "name='" + name + '\'' + ", age=" + age + ", flag=" + flag + ", birth=" + birth + ", time=" + time + ", dates=" + dates + ", role=" + role + '}'; } }
UTF-8
Java
2,303
java
CustomUser.java
Java
[ { "context": "ialize;\n\nimport java.util.Date;\n\n/**\n * Created by xujunfei on 2017/1/4.\n */\npublic class CustomUser {\n\n @", "end": 306, "score": 0.9996557235717773, "start": 298, "tag": "USERNAME", "value": "xujunfei" }, { "context": " return \"TUser{\" +\n \"name='\" + name + '\\'' +\n \", age=\" + age +\n ", "end": 2052, "score": 0.8596159815788269, "start": 2048, "tag": "NAME", "value": "name" } ]
null
[]
package com.jf.database.model; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.jf.json.StringArraySerialize; import java.util.Date; /** * Created by xujunfei on 2017/1/4. */ public class CustomUser { @JsonSerialize(using = ToStringSerializer.class) private Integer id; @JsonSerialize(using = StringArraySerialize.class) private Integer[] ids; private String name; private Integer age; private Boolean flag; @JsonFormat(pattern = "yyyy-MM-dd") private Date birth; @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date time; private Date dates; private CustomRole role; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public Integer[] getIds() { return ids; } public void setIds(Integer[] ids) { this.ids = ids; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getAge() { return age; } public void setAge(Integer age) { this.age = age; } public Boolean getFlag() { return flag; } public void setFlag(Boolean flag) { this.flag = flag; } public Date getBirth() { return birth; } public void setBirth(Date birth) { this.birth = birth; } public Date getTime() { return time; } public void setTime(Date time) { this.time = time; } public Date getDates() { return dates; } public void setDates(Date dates) { this.dates = dates; } public CustomRole getRole() { return role; } public void setRole(CustomRole role) { this.role = role; } @Override public String toString() { return "TUser{" + "name='" + name + '\'' + ", age=" + age + ", flag=" + flag + ", birth=" + birth + ", time=" + time + ", dates=" + dates + ", role=" + role + '}'; } }
2,303
0.55406
0.551455
121
18.033058
16.270409
65
false
false
0
0
0
0
0
0
0.330579
false
false
3
022e730b82ea2889de18d5440b4bfa2370f64c9c
20,701,742,381,712
3447b9cbca807cc921a3abd72094196bf4599288
/Omnom.Android/Omnom/src/main/java/com/omnom/android/view/subcategories/ItemTouchListenerBase.java
339e922de8f70ac2ae8dc78fe8d8b28c7e53365e
[]
no_license
saintlab/mobileapp_android
https://github.com/saintlab/mobileapp_android
a1f6614d0837f0527ce426baa232916b985f4b43
14ab2f0ae62ee432a740922f5c2784799dac6a99
refs/heads/master
2021-05-29T11:32:21.305000
2015-07-02T06:24:50
2015-07-02T06:24:50
21,729,682
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.omnom.android.view.subcategories; import android.graphics.Rect; import android.support.v7.widget.RecyclerView; import android.view.GestureDetector; import android.view.MotionEvent; import android.view.View; import static com.omnom.android.view.subcategories.SubcategoriesView.OnCollapsedTouchListener; /** * Created by Ch3D on 24.03.2015. */ public abstract class ItemTouchListenerBase implements RecyclerView.OnItemTouchListener { // protected Point mPoint = new Point(); protected boolean mTouchEnabled = false; private SubcategoriesView mView; private GestureDetector mGestureDetector; private OnCollapsedTouchListener mCollapsedTouchListener; private Rect mRect; public ItemTouchListenerBase(SubcategoriesView view, GestureDetector gestureDetector, final OnCollapsedTouchListener collapsedTouchListener) { mView = view; mGestureDetector = gestureDetector; mCollapsedTouchListener = collapsedTouchListener; } public void setTouchEnabled(final boolean touchEnabled) { mTouchEnabled = touchEnabled; } protected void onActionUp(final MotionEvent e) { if(mRect == null) { // skip return; } if(mRect.contains((int) e.getX(), (int) e.getY())) { final View childViewUnder = mView.mListView.findChildViewUnder(e.getX(), e.getY()); mView.onGroupClick(childViewUnder, true); if(mCollapsedTouchListener != null) { mCollapsedTouchListener.onCollapsedSubcategoriesTouch(e); } } mRect.set(-1, -1, -1, -1); } protected void onActionDown(final MotionEvent e) { final View childViewUnder = mView.mListView.findChildViewUnder(e.getX(), e.getY()); if(childViewUnder != null) { mRect = new Rect(childViewUnder.getLeft(), childViewUnder.getTop(), childViewUnder.getRight(), childViewUnder.getBottom()); } } protected boolean onGestureHandle(final MotionEvent e) { return mGestureDetector.onTouchEvent(e); } @Override public void onTouchEvent(final RecyclerView rv, final MotionEvent e) { // Do nothing } }
UTF-8
Java
2,048
java
ItemTouchListenerBase.java
Java
[ { "context": "sView.OnCollapsedTouchListener;\n\n/**\n * Created by Ch3D on 24.03.2015.\n */\npublic abstract class ItemTouc", "end": 339, "score": 0.9995932579040527, "start": 335, "tag": "USERNAME", "value": "Ch3D" } ]
null
[]
package com.omnom.android.view.subcategories; import android.graphics.Rect; import android.support.v7.widget.RecyclerView; import android.view.GestureDetector; import android.view.MotionEvent; import android.view.View; import static com.omnom.android.view.subcategories.SubcategoriesView.OnCollapsedTouchListener; /** * Created by Ch3D on 24.03.2015. */ public abstract class ItemTouchListenerBase implements RecyclerView.OnItemTouchListener { // protected Point mPoint = new Point(); protected boolean mTouchEnabled = false; private SubcategoriesView mView; private GestureDetector mGestureDetector; private OnCollapsedTouchListener mCollapsedTouchListener; private Rect mRect; public ItemTouchListenerBase(SubcategoriesView view, GestureDetector gestureDetector, final OnCollapsedTouchListener collapsedTouchListener) { mView = view; mGestureDetector = gestureDetector; mCollapsedTouchListener = collapsedTouchListener; } public void setTouchEnabled(final boolean touchEnabled) { mTouchEnabled = touchEnabled; } protected void onActionUp(final MotionEvent e) { if(mRect == null) { // skip return; } if(mRect.contains((int) e.getX(), (int) e.getY())) { final View childViewUnder = mView.mListView.findChildViewUnder(e.getX(), e.getY()); mView.onGroupClick(childViewUnder, true); if(mCollapsedTouchListener != null) { mCollapsedTouchListener.onCollapsedSubcategoriesTouch(e); } } mRect.set(-1, -1, -1, -1); } protected void onActionDown(final MotionEvent e) { final View childViewUnder = mView.mListView.findChildViewUnder(e.getX(), e.getY()); if(childViewUnder != null) { mRect = new Rect(childViewUnder.getLeft(), childViewUnder.getTop(), childViewUnder.getRight(), childViewUnder.getBottom()); } } protected boolean onGestureHandle(final MotionEvent e) { return mGestureDetector.onTouchEvent(e); } @Override public void onTouchEvent(final RecyclerView rv, final MotionEvent e) { // Do nothing } }
2,048
0.74707
0.740234
69
28.68116
29.49404
126
false
false
0
0
0
0
0
0
1.623188
false
false
3
b046daff68c3886f7b540468be4d3255295a3212
13,262,859,030,434
f7bcf7c5a5c8efc5946c9959586d9b5d65abd3b4
/app/src/main/java/com/mateabeslic/careapp/UsersActivity.java
933b1afb1c50524afcd7776eec2997fe38a30add
[]
no_license
MB-matea/CareAppFrontend
https://github.com/MB-matea/CareAppFrontend
e300cc11c12b36cc3292877b7bfdd73785583e15
12672d89afc05ae1848fc7f7389d5c8475345f4b
refs/heads/master
2023-08-19T01:47:20.278000
2021-10-12T19:44:24
2021-10-12T19:44:24
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.mateabeslic.careapp; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.widget.Toast; import com.android.volley.Response; import com.android.volley.VolleyError; import com.mateabeslic.careapp.api.client.ResidentsApi; import com.mateabeslic.careapp.api.client.UsersApi; import com.mateabeslic.careapp.api.model.GetAllResidentsResponseBody; import com.mateabeslic.careapp.api.model.GetAllResidentsResponseBodyResidents; import com.mateabeslic.careapp.api.model.GetAllUsersResponseBody; import com.mateabeslic.careapp.api.model.GetAllUsersResponseBodyUsers; import com.mateabeslic.careapp.api.model.User; import java.util.ArrayList; import java.util.List; public class UsersActivity extends AppCompatActivity { private static UsersApi client; private static final String TAG = "UsersActivity"; //var private ArrayList<Integer> mIds = new ArrayList<>(); private ArrayList<String> mNames = new ArrayList<>(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_users); Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setHomeAsUpIndicator(R.mipmap.ic_home3_foreground); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getUsers(); } @Override protected void onRestart() { super.onRestart(); recreate(); } public void getUsers(){ if(client == null) { client = new UsersApi(); } client.setBasePath(BasePath.getBasePath()); client.usersGet(new Response.Listener<GetAllUsersResponseBody>() { @Override public void onResponse(GetAllUsersResponseBody response) { List<GetAllUsersResponseBodyUsers> users = response.getUsers(); for (GetAllUsersResponseBodyUsers user : users) { mIds.add(user.getUserId()); String name = user.getName() + " " + user.getLastName(); mNames.add(name); } initRecyclerView(); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { } }); } private void initRecyclerView(){ RecyclerView recyclerView = findViewById(R.id.users_recycler_view); UsersRecyclerViewAdapter adapter = new UsersRecyclerViewAdapter(UsersActivity.this, mIds, mNames); recyclerView.setAdapter(adapter); recyclerView.setLayoutManager(new LinearLayoutManager(UsersActivity.this)); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_main, menu); return super.onCreateOptionsMenu(menu); } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { // Respond to the action bar's Up/Home button case android.R.id.home: Intent intent = new Intent(UsersActivity.this, HomeActivity.class); startActivity(intent); return true; case R.id.action_create_resident: Intent intent2 = new Intent(UsersActivity.this, CreateUserActivity.class); startActivity(intent2); return true; default: return super.onOptionsItemSelected(item); } } }
UTF-8
Java
3,835
java
UsersActivity.java
Java
[]
null
[]
package com.mateabeslic.careapp; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.widget.Toast; import com.android.volley.Response; import com.android.volley.VolleyError; import com.mateabeslic.careapp.api.client.ResidentsApi; import com.mateabeslic.careapp.api.client.UsersApi; import com.mateabeslic.careapp.api.model.GetAllResidentsResponseBody; import com.mateabeslic.careapp.api.model.GetAllResidentsResponseBodyResidents; import com.mateabeslic.careapp.api.model.GetAllUsersResponseBody; import com.mateabeslic.careapp.api.model.GetAllUsersResponseBodyUsers; import com.mateabeslic.careapp.api.model.User; import java.util.ArrayList; import java.util.List; public class UsersActivity extends AppCompatActivity { private static UsersApi client; private static final String TAG = "UsersActivity"; //var private ArrayList<Integer> mIds = new ArrayList<>(); private ArrayList<String> mNames = new ArrayList<>(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_users); Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setHomeAsUpIndicator(R.mipmap.ic_home3_foreground); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getUsers(); } @Override protected void onRestart() { super.onRestart(); recreate(); } public void getUsers(){ if(client == null) { client = new UsersApi(); } client.setBasePath(BasePath.getBasePath()); client.usersGet(new Response.Listener<GetAllUsersResponseBody>() { @Override public void onResponse(GetAllUsersResponseBody response) { List<GetAllUsersResponseBodyUsers> users = response.getUsers(); for (GetAllUsersResponseBodyUsers user : users) { mIds.add(user.getUserId()); String name = user.getName() + " " + user.getLastName(); mNames.add(name); } initRecyclerView(); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { } }); } private void initRecyclerView(){ RecyclerView recyclerView = findViewById(R.id.users_recycler_view); UsersRecyclerViewAdapter adapter = new UsersRecyclerViewAdapter(UsersActivity.this, mIds, mNames); recyclerView.setAdapter(adapter); recyclerView.setLayoutManager(new LinearLayoutManager(UsersActivity.this)); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_main, menu); return super.onCreateOptionsMenu(menu); } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { // Respond to the action bar's Up/Home button case android.R.id.home: Intent intent = new Intent(UsersActivity.this, HomeActivity.class); startActivity(intent); return true; case R.id.action_create_resident: Intent intent2 = new Intent(UsersActivity.this, CreateUserActivity.class); startActivity(intent2); return true; default: return super.onOptionsItemSelected(item); } } }
3,835
0.673012
0.672229
120
30.966667
26.301435
106
false
false
0
0
0
0
0
0
0.516667
false
false
3
240f6b52571d8bf0b1ce78e208aebc60ad2cd963
24,266,565,245,833
abe29dc7763eb76a373d3a67fc8d43494830414a
/shiro-ch03/src/main/java/top/youngcoding/shiro/demo/ch03/web/controller/OrderController.java
537e6873abd373091c1496b135cdbdd00514d2cf
[]
no_license
bingdianfeishui/shiro-demo
https://github.com/bingdianfeishui/shiro-demo
b2d559d8eb8ef395c94d498908978b6cd8238f8d
9d8bbb8b8450a4ca2a2358dc64df68ca5353fb1f
refs/heads/master
2020-03-21T23:53:16.147000
2018-06-30T01:56:37
2018-06-30T01:56:37
139,211,619
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package top.youngcoding.shiro.demo.ch03.web.controller; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import javax.servlet.http.HttpServletRequest; /** * @author liy * @date 2018/4/25 */ @Controller @RequestMapping("/order") @RequiresPermissions("order") public class OrderController { @GetMapping("create") public String create(HttpServletRequest request, Model model) { model.addAttribute("msg", ResultMsg.ok(request)); return "index"; } @GetMapping("delete") public String delete(HttpServletRequest request, Model model) { model.addAttribute("msg", ResultMsg.ok(request)); return "index"; } @GetMapping("submit") public String submit(HttpServletRequest request, Model model) { model.addAttribute("msg", ResultMsg.ok(request)); return "index"; } @GetMapping("list") public String list(HttpServletRequest request, Model model) { model.addAttribute("msg", ResultMsg.ok(request)); return "index"; } @GetMapping("detail") public String detail(HttpServletRequest request, Model model) { model.addAttribute("msg", ResultMsg.ok(request)); return "index"; } }
UTF-8
Java
1,429
java
OrderController.java
Java
[ { "context": "x.servlet.http.HttpServletRequest;\n\n/**\n * @author liy\n * @date 2018/4/25\n */\n@Controller\n@RequestMappin", "end": 394, "score": 0.9996299743652344, "start": 391, "tag": "USERNAME", "value": "liy" } ]
null
[]
package top.youngcoding.shiro.demo.ch03.web.controller; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import javax.servlet.http.HttpServletRequest; /** * @author liy * @date 2018/4/25 */ @Controller @RequestMapping("/order") @RequiresPermissions("order") public class OrderController { @GetMapping("create") public String create(HttpServletRequest request, Model model) { model.addAttribute("msg", ResultMsg.ok(request)); return "index"; } @GetMapping("delete") public String delete(HttpServletRequest request, Model model) { model.addAttribute("msg", ResultMsg.ok(request)); return "index"; } @GetMapping("submit") public String submit(HttpServletRequest request, Model model) { model.addAttribute("msg", ResultMsg.ok(request)); return "index"; } @GetMapping("list") public String list(HttpServletRequest request, Model model) { model.addAttribute("msg", ResultMsg.ok(request)); return "index"; } @GetMapping("detail") public String detail(HttpServletRequest request, Model model) { model.addAttribute("msg", ResultMsg.ok(request)); return "index"; } }
1,429
0.704689
0.69839
48
28.770834
23.802345
67
false
false
0
0
0
0
0
0
0.5625
false
false
3
380b97a9275094586f472c2627d6e844c70c4d66
23,063,974,423,566
2a60133e3be347f57873a0c29460082c6dd7dce7
/src/edu/cmu/square/client/model/AsquareCase.java
94f1dd692a84a475d61a92d9329132c0201ca864
[]
no_license
deekay0/asquare
https://github.com/deekay0/asquare
ef2ce88f17c3d5155c4564d9f3408c13a01fcc15
f4bd77fe08f4731c2b3e3ac81601f183d0119e38
refs/heads/master
2021-01-25T08:37:00.515000
2011-08-08T19:48:53
2011-08-08T19:48:53
1,767,608
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package edu.cmu.square.client.model; public enum AsquareCase { Case1("Case 1"), Case2("Case 2"), Case3("Case 3"); //None("None"); private String label; private AsquareCase(String label) { this.label = label; } public String getLabel() { return this.label; } }
UTF-8
Java
322
java
AsquareCase.java
Java
[]
null
[]
package edu.cmu.square.client.model; public enum AsquareCase { Case1("Case 1"), Case2("Case 2"), Case3("Case 3"); //None("None"); private String label; private AsquareCase(String label) { this.label = label; } public String getLabel() { return this.label; } }
322
0.574534
0.555901
21
13.333333
12.100112
37
false
false
0
0
0
0
0
0
1.952381
false
false
3
4fc549449ad112ad068445646e32af9ff41c7bbc
10,196,252,363,340
e3712168b5154d456edf3512a1424b9aea290f24
/frontend/Tagline/sources/gnu/kawa/xml/Attributes.java
70b8ab5050b626041d3528b923af26582cc397be
[]
no_license
uandisson/Projeto-TagLine-HACK_GOV_PE
https://github.com/uandisson/Projeto-TagLine-HACK_GOV_PE
bf3c5c106191292b3692068d41bc5e6f38f07d52
5e130ff990faf5c8c5dab060398c34e53e0fd896
refs/heads/master
2023-03-12T17:36:36.792000
2021-02-11T18:17:51
2021-02-11T18:17:51
338,082,674
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package gnu.kawa.xml; import android.support.p000v4.app.FragmentTransaction; import gnu.lists.Consumer; import gnu.lists.PositionConsumer; import gnu.lists.SeqPosition; import gnu.lists.TreeList; import gnu.lists.TreePosition; import gnu.mapping.CallContext; import gnu.mapping.MethodProc; import gnu.mapping.Values; import java.io.PrintStream; public class Attributes extends MethodProc { public static final Attributes attributes; public Attributes() { } static { Attributes attributes2; new Attributes(); attributes = attributes2; } public int numArgs() { return FragmentTransaction.TRANSIT_FRAGMENT_OPEN; } public static void attributes(TreeList treeList, int index, Consumer consumer) { StringBuilder sb; TreeList tlist = treeList; Consumer consumer2 = consumer; int attr = tlist.gotoAttributesStart(index); PrintStream printStream = System.out; new StringBuilder(); printStream.print(sb.append("Attributes called, at:").append(attr).append(" ").toString()); tlist.dump(); while (attr >= 0) { int ipos = attr << 1; if (tlist.getNextKind(ipos) == 35) { int next = tlist.nextDataIndex(attr); if (consumer2 instanceof PositionConsumer) { ((PositionConsumer) consumer2).writePosition(tlist, ipos); } else { int consumeIRange = tlist.consumeIRange(attr, next, consumer2); } attr = next; } else { return; } } } public static void attributes(Object obj, Consumer consumer) { Object node = obj; Consumer consumer2 = consumer; if (node instanceof TreeList) { attributes((TreeList) node, 0, consumer2); } else if ((node instanceof SeqPosition) && !(node instanceof TreePosition)) { SeqPosition pos = (SeqPosition) node; if (pos.sequence instanceof TreeList) { attributes((TreeList) pos.sequence, pos.ipos >> 1, consumer2); } } } public void apply(CallContext callContext) { CallContext ctx = callContext; Consumer consumer = ctx.consumer; Object node = ctx.getNextArg(); ctx.lastArg(); if (node instanceof Values) { TreeList tlist = (TreeList) node; int i = 0; while (true) { int index = i; int kind = tlist.getNextKind(index << 1); if (kind != 0) { if (kind == 32) { attributes(tlist.getPosNext(index << 1), consumer); } else { attributes(tlist, index, consumer); } i = tlist.nextDataIndex(index); } else { return; } } } else { attributes(node, consumer); } } }
UTF-8
Java
3,062
java
Attributes.java
Java
[]
null
[]
package gnu.kawa.xml; import android.support.p000v4.app.FragmentTransaction; import gnu.lists.Consumer; import gnu.lists.PositionConsumer; import gnu.lists.SeqPosition; import gnu.lists.TreeList; import gnu.lists.TreePosition; import gnu.mapping.CallContext; import gnu.mapping.MethodProc; import gnu.mapping.Values; import java.io.PrintStream; public class Attributes extends MethodProc { public static final Attributes attributes; public Attributes() { } static { Attributes attributes2; new Attributes(); attributes = attributes2; } public int numArgs() { return FragmentTransaction.TRANSIT_FRAGMENT_OPEN; } public static void attributes(TreeList treeList, int index, Consumer consumer) { StringBuilder sb; TreeList tlist = treeList; Consumer consumer2 = consumer; int attr = tlist.gotoAttributesStart(index); PrintStream printStream = System.out; new StringBuilder(); printStream.print(sb.append("Attributes called, at:").append(attr).append(" ").toString()); tlist.dump(); while (attr >= 0) { int ipos = attr << 1; if (tlist.getNextKind(ipos) == 35) { int next = tlist.nextDataIndex(attr); if (consumer2 instanceof PositionConsumer) { ((PositionConsumer) consumer2).writePosition(tlist, ipos); } else { int consumeIRange = tlist.consumeIRange(attr, next, consumer2); } attr = next; } else { return; } } } public static void attributes(Object obj, Consumer consumer) { Object node = obj; Consumer consumer2 = consumer; if (node instanceof TreeList) { attributes((TreeList) node, 0, consumer2); } else if ((node instanceof SeqPosition) && !(node instanceof TreePosition)) { SeqPosition pos = (SeqPosition) node; if (pos.sequence instanceof TreeList) { attributes((TreeList) pos.sequence, pos.ipos >> 1, consumer2); } } } public void apply(CallContext callContext) { CallContext ctx = callContext; Consumer consumer = ctx.consumer; Object node = ctx.getNextArg(); ctx.lastArg(); if (node instanceof Values) { TreeList tlist = (TreeList) node; int i = 0; while (true) { int index = i; int kind = tlist.getNextKind(index << 1); if (kind != 0) { if (kind == 32) { attributes(tlist.getPosNext(index << 1), consumer); } else { attributes(tlist, index, consumer); } i = tlist.nextDataIndex(index); } else { return; } } } else { attributes(node, consumer); } } }
3,062
0.55258
0.544415
94
31.574469
22.07988
99
false
false
0
0
0
0
0
0
0.670213
false
false
3
ec5bf8c5b7313372ebe6ce6a62ec05b0cfe368d1
12,841,952,216,957
662ec53ec68ee84b5355813b8fb79585cb76dbcb
/app/src/main/java/com/fansleague/itemsclass/fanLevel.java
9d659fdd80c4ccb2890abc5f2e6eb9d4e838da73
[]
no_license
goffer14/Fans-League
https://github.com/goffer14/Fans-League
b2dc3f874de59c64c23a4dc3929b38999c18e394
c9ae1853b9d169eef26b86424a795dbbcb292c94
refs/heads/master
2016-12-16T15:49:19.834000
2016-12-11T11:56:26
2016-12-11T11:56:26
56,127,289
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.fansleague.itemsclass; import java.io.Serializable; /** * Created by goffer on 09/03/2016. */ public class fanLevel implements Serializable { String id; String levelName; int levelNumber; String levelImageUrl; int levelStartPoint; int levelEndPoint; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getLevelName() { return levelName; } public void setLevelName(String levelName) { this.levelName = levelName; } public int getLevelNumber() { return levelNumber; } public void setLevelNumber(int levelNumber) { this.levelNumber = levelNumber; } public String getLevelImageUrl() { return levelImageUrl; } public void setLevelImageUrl(String levelImageUrl) { this.levelImageUrl = levelImageUrl; } public int getLevelStartPoint() { return levelStartPoint; } public void setLevelStartPoint(int levelStartPoint) { this.levelStartPoint = levelStartPoint; } public int getLevelEndPoint() { return levelEndPoint; } public void setLevelEndPoint(int levelEndPoint) { this.levelEndPoint = levelEndPoint; } }
UTF-8
Java
1,285
java
fanLevel.java
Java
[ { "context": ";\n\nimport java.io.Serializable;\n\n/**\n * Created by goffer on 09/03/2016.\n */\npublic class fanLevel implemen", "end": 90, "score": 0.998895525932312, "start": 84, "tag": "USERNAME", "value": "goffer" } ]
null
[]
package com.fansleague.itemsclass; import java.io.Serializable; /** * Created by goffer on 09/03/2016. */ public class fanLevel implements Serializable { String id; String levelName; int levelNumber; String levelImageUrl; int levelStartPoint; int levelEndPoint; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getLevelName() { return levelName; } public void setLevelName(String levelName) { this.levelName = levelName; } public int getLevelNumber() { return levelNumber; } public void setLevelNumber(int levelNumber) { this.levelNumber = levelNumber; } public String getLevelImageUrl() { return levelImageUrl; } public void setLevelImageUrl(String levelImageUrl) { this.levelImageUrl = levelImageUrl; } public int getLevelStartPoint() { return levelStartPoint; } public void setLevelStartPoint(int levelStartPoint) { this.levelStartPoint = levelStartPoint; } public int getLevelEndPoint() { return levelEndPoint; } public void setLevelEndPoint(int levelEndPoint) { this.levelEndPoint = levelEndPoint; } }
1,285
0.649027
0.642802
60
20.416666
17.74194
57
false
false
0
0
0
0
0
0
0.333333
false
false
3
de05973491bddfebfd1f8079cd1f451e3a71091c
28,716,151,363,066
81f4f9d78577869f90632bad1752d1292b81e83c
/src/java/bean/ControllerDmPolicy.java
441aa93e4c4361b3677118e1c10afc981db70e84
[]
no_license
sdcc-i-coop-portal/zoom101
https://github.com/sdcc-i-coop-portal/zoom101
75a41c80c76550e9fd5f3cd1dd7cfdbcf3a2b9eb
4c3b1212961433a7abf02e3cbddad8b702494b7c
refs/heads/master
2019-07-06T05:07:50.315000
2019-07-02T07:20:06
2019-07-02T07:20:06
123,894,563
0
1
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 bean; import java.sql.SQLException; import java.sql.Types; import java.util.Date; import javax.faces.bean.ManagedBean; import javax.faces.bean.ManagedProperty; import javax.faces.bean.RequestScoped; import javax.faces.context.FacesContext; import javax.persistence.Query; import javax.persistence.TemporalType; import model.CoopFinDmPolicyFile; /** * * @author misteam */ @ManagedBean @RequestScoped public class ControllerDmPolicy { /** * Creates a new instance of ControllerDmPolicy */ public ControllerDmPolicy() { } @ManagedProperty(value = "#{dbConnection}") private DbConnection dbConnection; @ManagedProperty(value = "#{emfData}") private EmfData emf; @ManagedProperty(value = "#{controllerDate}") private ControllerDate controllerDate; @ManagedProperty(value = "#{dmPolicyFileData}") private DmPolicyFileData dmPolicyFile; @ManagedProperty(value = "#{userCodeData}") private UserCodeData userCode; @ManagedProperty(value = "#{myMessages}") private MyMessages messages; @ManagedProperty(value = "#{navigationControllerFinal}") private NavigationControllerFinal navigationControllerFinal; public void create() { getDmPolicyFile().beanclear(); getDmPolicyFile().setOps(1); getDmPolicyFile().setDmProdList(getEmf().financialDbEmf.createEntityManager() .createQuery("SELECT d FROM CoopFinDmProdFile d WHERE d.dmProdStatus = 'TRUE'") .getResultList()); getNavigationControllerFinal().navigateTo("dmPolicyFileMaintenance"); } public void viewCurrentDmPolicy() { if (getDmPolicyFile().getDmPolicy().getDmProdCode().getDmProdCode() != null) { //CURRENT_TIMESTAMP = customDate Query q = getEmf().financialDbEmf.createEntityManager() .createQuery("SELECT d FROM CoopFinDmPolicyFile d WHERE d.dmProdCode = :dmProdCode AND d.effectivityDate < :customDate ORDER BY d.dmPolicyRecno DESC") .setMaxResults(1) .setParameter("dmProdCode", getDmPolicyFile().getDmPolicy().getDmProdCode()) .setParameter("customDate", getControllerDate().getCustomDate(), TemporalType.TIMESTAMP); if (q.getResultList().size() > 0) { getDmPolicyFile().setCurrentDmPolicy((CoopFinDmPolicyFile) q.getResultList().get(0)); } else { getDmPolicyFile().setCurrentDmPolicy(new CoopFinDmPolicyFile()); } } else { getDmPolicyFile().setCurrentDmPolicy(new CoopFinDmPolicyFile()); } } public void selectUpdate() { getDmPolicyFile().setDmPolicy(getDmPolicyFile().getSelectedDmPolicy()); getDmPolicyFile().setOps(2); //CURRENT_TIMESTAMP = customDate getDmPolicyFile().setCurrentDmPolicy((CoopFinDmPolicyFile) getEmf().financialDbEmf.createEntityManager() .createQuery("SELECT d FROM CoopFinDmPolicyFile d WHERE d.dmProdCode = :dmProdCode AND d.effectivityDate < :customDate ORDER BY d.dmPolicyRecno DESC") .setParameter("dmProdCode", getDmPolicyFile().getSelectedDmPolicy().getDmProdCode()) .setParameter("customDate", getControllerDate().getCustomDate(), TemporalType.TIMESTAMP) .getResultList().get(0)); getNavigationControllerFinal().navigateTo("dmPolicyFileMaintenance"); } // public String back() { // return "success"; // } public void selectDelete() throws SQLException { getDmPolicyFile().setDmPolicy(getDmPolicyFile().getSelectedDmPolicy()); getDmPolicyFile().setOps(3); maintenanceDmPolicyFile(getDmPolicyFile().getOps()); } public void maintenanceDmPolicyFile(Integer operation) throws SQLException { StringBuilder dmPolicyFileArray = new StringBuilder(); if (operation == 1) { getDmPolicyFile().getDmPolicy().setCreatedDate(getControllerDate().getCustomDate()); //new Date() } dmPolicyFileArray.append("array[(").append(getDmPolicyFile().getDmPolicy().getDmPolicyRecno()).append(","); dmPolicyFileArray.append("'").append(getControllerDate().dateStrSql(getDmPolicyFile().getDmPolicy().getCreatedDate())).append("'::date").append(","); dmPolicyFileArray.append("'").append(getControllerDate().dateStrSql(getDmPolicyFile().getDmPolicy().getEffectivityDate())).append("'::date").append(","); dmPolicyFileArray.append(getDmPolicyFile().getDmPolicy().getDmProdCode().getDmProdCode()).append(","); dmPolicyFileArray.append(getDmPolicyFile().getDmPolicy().getCharge()).append(","); dmPolicyFileArray.append(getDmPolicyFile().getDmPolicy().getPenalty()).append(","); dmPolicyFileArray.append(getDmPolicyFile().getDmPolicy().getLimitAmount()).append(")]::coop_fin_dm_policy_file[]"); // System.out.println(dmPolicyFileArray.toString()); getDmPolicyFile().setReturnCallableStatement(""); if (operation == 3) { //CURRENT_TIMESTAMP = customDate Query q = getEmf().financialDbEmf.createEntityManager() .createQuery("SELECT d FROM CoopFinDmPolicyFile d WHERE d.dmProdCode = :dmProdCode AND d.effectivityDate < :customDate ORDER BY d.dmPolicyRecno DESC") .setParameter("dmProdCode", getDmPolicyFile().getDmPolicy().getDmProdCode()) .setParameter("customDate", getControllerDate().getCustomDate(), TemporalType.TIMESTAMP); if (!q.getResultList().isEmpty()) { if (q.getResultList().size() <= 1) { getDmPolicyFile().setReturnCallableStatement("Cannot delete policy; there will be no other active DM policy for " + getDmPolicyFile().getDmPolicy().getDmProdCode().getDmProdName() + "."); getMessages().messageWarn(getDmPolicyFile().getReturnCallableStatement(), ""); } } } getDbConnection().setDbUserName(getUserCode().getUser().getUserid().toString()); getDbConnection().financialDbConnection = getDbConnection().connectToFinancialDb(); if (getDbConnection().financialDbConnection != null) { try { getDbConnection().callableStatement = getDbConnection().financialDbConnection.prepareCall("{ ? = call maintenance_dm_policy_file(" + dmPolicyFileArray.toString() + ",?)}"); getDbConnection().callableStatement.registerOutParameter(1, Types.VARCHAR); getDbConnection().callableStatement.setInt(2, getDmPolicyFile().getOps()); getDbConnection().callableStatement.execute(); getDmPolicyFile().setReturnCallableStatement(getDbConnection().callableStatement.getString(1)); } catch (Exception e) { getDmPolicyFile().setReturnCallableStatement("Error on database function."); System.out.print("maintenanceDmPolicyFile()-3 " + e); getDbConnection().financialDbConnection.close(); } finally { getDbConnection().callableStatement.close(); getDbConnection().financialDbConnection.close(); } } if (getDmPolicyFile().getReturnCallableStatement().contains("Error")) { getMessages().messageError(getDmPolicyFile().getReturnCallableStatement(), "Please send a feedback."); } else if (!getDmPolicyFile().getReturnCallableStatement().contains("NO RECORD FOUND OR SELECTED")) { getNavigationControllerFinal().navigateTo("dmPolicyFileMain"); } } public void init() { if (FacesContext.getCurrentInstance().isPostback() == false) { if (getDmPolicyFile().getReturnCallableStatement() != null) { if (getDmPolicyFile().getReturnCallableStatement().contains("ADDED") || getDmPolicyFile().getReturnCallableStatement().contains("UPDATED") || getDmPolicyFile().getReturnCallableStatement().contains("DELETED")) { getMessages().messageInfo(getDmPolicyFile().getReturnCallableStatement(), ""); } } getDmPolicyFile().beanclear(); } } /* getter / setter */ public DbConnection getDbConnection() { return dbConnection == null ? dbConnection = new DbConnection() : dbConnection; } public void setDbConnection(DbConnection dbConnection) { this.dbConnection = dbConnection; } public EmfData getEmf() { return emf == null ? emf = new EmfData() : emf; } public void setEmf(EmfData emf) { this.emf = emf; } public ControllerDate getControllerDate() { return controllerDate == null ? controllerDate = new ControllerDate() : controllerDate; } public void setControllerDate(ControllerDate controllerDate) { this.controllerDate = controllerDate; } public DmPolicyFileData getDmPolicyFile() { return dmPolicyFile == null ? dmPolicyFile = new DmPolicyFileData() : dmPolicyFile; } public void setDmPolicyFile(DmPolicyFileData dmPolicyFile) { this.dmPolicyFile = dmPolicyFile; } public UserCodeData getUserCode() { return userCode == null ? userCode = new UserCodeData() : userCode; } public void setUserCode(UserCodeData userCode) { this.userCode = userCode; } public MyMessages getMessages() { return messages == null ? messages = new MyMessages() : messages; } public void setMessages(MyMessages messages) { this.messages = messages; } public NavigationControllerFinal getNavigationControllerFinal() { return navigationControllerFinal == null ? navigationControllerFinal = new NavigationControllerFinal() : navigationControllerFinal; } public void setNavigationControllerFinal(NavigationControllerFinal navigationControllerFinal) { this.navigationControllerFinal = navigationControllerFinal; } }
UTF-8
Java
10,247
java
ControllerDmPolicy.java
Java
[ { "context": "port model.CoopFinDmPolicyFile;\n\n/**\n *\n * @author misteam\n */\n@ManagedBean\n@RequestScoped\npublic class Cont", "end": 565, "score": 0.9995334148406982, "start": 558, "tag": "USERNAME", "value": "misteam" } ]
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 bean; import java.sql.SQLException; import java.sql.Types; import java.util.Date; import javax.faces.bean.ManagedBean; import javax.faces.bean.ManagedProperty; import javax.faces.bean.RequestScoped; import javax.faces.context.FacesContext; import javax.persistence.Query; import javax.persistence.TemporalType; import model.CoopFinDmPolicyFile; /** * * @author misteam */ @ManagedBean @RequestScoped public class ControllerDmPolicy { /** * Creates a new instance of ControllerDmPolicy */ public ControllerDmPolicy() { } @ManagedProperty(value = "#{dbConnection}") private DbConnection dbConnection; @ManagedProperty(value = "#{emfData}") private EmfData emf; @ManagedProperty(value = "#{controllerDate}") private ControllerDate controllerDate; @ManagedProperty(value = "#{dmPolicyFileData}") private DmPolicyFileData dmPolicyFile; @ManagedProperty(value = "#{userCodeData}") private UserCodeData userCode; @ManagedProperty(value = "#{myMessages}") private MyMessages messages; @ManagedProperty(value = "#{navigationControllerFinal}") private NavigationControllerFinal navigationControllerFinal; public void create() { getDmPolicyFile().beanclear(); getDmPolicyFile().setOps(1); getDmPolicyFile().setDmProdList(getEmf().financialDbEmf.createEntityManager() .createQuery("SELECT d FROM CoopFinDmProdFile d WHERE d.dmProdStatus = 'TRUE'") .getResultList()); getNavigationControllerFinal().navigateTo("dmPolicyFileMaintenance"); } public void viewCurrentDmPolicy() { if (getDmPolicyFile().getDmPolicy().getDmProdCode().getDmProdCode() != null) { //CURRENT_TIMESTAMP = customDate Query q = getEmf().financialDbEmf.createEntityManager() .createQuery("SELECT d FROM CoopFinDmPolicyFile d WHERE d.dmProdCode = :dmProdCode AND d.effectivityDate < :customDate ORDER BY d.dmPolicyRecno DESC") .setMaxResults(1) .setParameter("dmProdCode", getDmPolicyFile().getDmPolicy().getDmProdCode()) .setParameter("customDate", getControllerDate().getCustomDate(), TemporalType.TIMESTAMP); if (q.getResultList().size() > 0) { getDmPolicyFile().setCurrentDmPolicy((CoopFinDmPolicyFile) q.getResultList().get(0)); } else { getDmPolicyFile().setCurrentDmPolicy(new CoopFinDmPolicyFile()); } } else { getDmPolicyFile().setCurrentDmPolicy(new CoopFinDmPolicyFile()); } } public void selectUpdate() { getDmPolicyFile().setDmPolicy(getDmPolicyFile().getSelectedDmPolicy()); getDmPolicyFile().setOps(2); //CURRENT_TIMESTAMP = customDate getDmPolicyFile().setCurrentDmPolicy((CoopFinDmPolicyFile) getEmf().financialDbEmf.createEntityManager() .createQuery("SELECT d FROM CoopFinDmPolicyFile d WHERE d.dmProdCode = :dmProdCode AND d.effectivityDate < :customDate ORDER BY d.dmPolicyRecno DESC") .setParameter("dmProdCode", getDmPolicyFile().getSelectedDmPolicy().getDmProdCode()) .setParameter("customDate", getControllerDate().getCustomDate(), TemporalType.TIMESTAMP) .getResultList().get(0)); getNavigationControllerFinal().navigateTo("dmPolicyFileMaintenance"); } // public String back() { // return "success"; // } public void selectDelete() throws SQLException { getDmPolicyFile().setDmPolicy(getDmPolicyFile().getSelectedDmPolicy()); getDmPolicyFile().setOps(3); maintenanceDmPolicyFile(getDmPolicyFile().getOps()); } public void maintenanceDmPolicyFile(Integer operation) throws SQLException { StringBuilder dmPolicyFileArray = new StringBuilder(); if (operation == 1) { getDmPolicyFile().getDmPolicy().setCreatedDate(getControllerDate().getCustomDate()); //new Date() } dmPolicyFileArray.append("array[(").append(getDmPolicyFile().getDmPolicy().getDmPolicyRecno()).append(","); dmPolicyFileArray.append("'").append(getControllerDate().dateStrSql(getDmPolicyFile().getDmPolicy().getCreatedDate())).append("'::date").append(","); dmPolicyFileArray.append("'").append(getControllerDate().dateStrSql(getDmPolicyFile().getDmPolicy().getEffectivityDate())).append("'::date").append(","); dmPolicyFileArray.append(getDmPolicyFile().getDmPolicy().getDmProdCode().getDmProdCode()).append(","); dmPolicyFileArray.append(getDmPolicyFile().getDmPolicy().getCharge()).append(","); dmPolicyFileArray.append(getDmPolicyFile().getDmPolicy().getPenalty()).append(","); dmPolicyFileArray.append(getDmPolicyFile().getDmPolicy().getLimitAmount()).append(")]::coop_fin_dm_policy_file[]"); // System.out.println(dmPolicyFileArray.toString()); getDmPolicyFile().setReturnCallableStatement(""); if (operation == 3) { //CURRENT_TIMESTAMP = customDate Query q = getEmf().financialDbEmf.createEntityManager() .createQuery("SELECT d FROM CoopFinDmPolicyFile d WHERE d.dmProdCode = :dmProdCode AND d.effectivityDate < :customDate ORDER BY d.dmPolicyRecno DESC") .setParameter("dmProdCode", getDmPolicyFile().getDmPolicy().getDmProdCode()) .setParameter("customDate", getControllerDate().getCustomDate(), TemporalType.TIMESTAMP); if (!q.getResultList().isEmpty()) { if (q.getResultList().size() <= 1) { getDmPolicyFile().setReturnCallableStatement("Cannot delete policy; there will be no other active DM policy for " + getDmPolicyFile().getDmPolicy().getDmProdCode().getDmProdName() + "."); getMessages().messageWarn(getDmPolicyFile().getReturnCallableStatement(), ""); } } } getDbConnection().setDbUserName(getUserCode().getUser().getUserid().toString()); getDbConnection().financialDbConnection = getDbConnection().connectToFinancialDb(); if (getDbConnection().financialDbConnection != null) { try { getDbConnection().callableStatement = getDbConnection().financialDbConnection.prepareCall("{ ? = call maintenance_dm_policy_file(" + dmPolicyFileArray.toString() + ",?)}"); getDbConnection().callableStatement.registerOutParameter(1, Types.VARCHAR); getDbConnection().callableStatement.setInt(2, getDmPolicyFile().getOps()); getDbConnection().callableStatement.execute(); getDmPolicyFile().setReturnCallableStatement(getDbConnection().callableStatement.getString(1)); } catch (Exception e) { getDmPolicyFile().setReturnCallableStatement("Error on database function."); System.out.print("maintenanceDmPolicyFile()-3 " + e); getDbConnection().financialDbConnection.close(); } finally { getDbConnection().callableStatement.close(); getDbConnection().financialDbConnection.close(); } } if (getDmPolicyFile().getReturnCallableStatement().contains("Error")) { getMessages().messageError(getDmPolicyFile().getReturnCallableStatement(), "Please send a feedback."); } else if (!getDmPolicyFile().getReturnCallableStatement().contains("NO RECORD FOUND OR SELECTED")) { getNavigationControllerFinal().navigateTo("dmPolicyFileMain"); } } public void init() { if (FacesContext.getCurrentInstance().isPostback() == false) { if (getDmPolicyFile().getReturnCallableStatement() != null) { if (getDmPolicyFile().getReturnCallableStatement().contains("ADDED") || getDmPolicyFile().getReturnCallableStatement().contains("UPDATED") || getDmPolicyFile().getReturnCallableStatement().contains("DELETED")) { getMessages().messageInfo(getDmPolicyFile().getReturnCallableStatement(), ""); } } getDmPolicyFile().beanclear(); } } /* getter / setter */ public DbConnection getDbConnection() { return dbConnection == null ? dbConnection = new DbConnection() : dbConnection; } public void setDbConnection(DbConnection dbConnection) { this.dbConnection = dbConnection; } public EmfData getEmf() { return emf == null ? emf = new EmfData() : emf; } public void setEmf(EmfData emf) { this.emf = emf; } public ControllerDate getControllerDate() { return controllerDate == null ? controllerDate = new ControllerDate() : controllerDate; } public void setControllerDate(ControllerDate controllerDate) { this.controllerDate = controllerDate; } public DmPolicyFileData getDmPolicyFile() { return dmPolicyFile == null ? dmPolicyFile = new DmPolicyFileData() : dmPolicyFile; } public void setDmPolicyFile(DmPolicyFileData dmPolicyFile) { this.dmPolicyFile = dmPolicyFile; } public UserCodeData getUserCode() { return userCode == null ? userCode = new UserCodeData() : userCode; } public void setUserCode(UserCodeData userCode) { this.userCode = userCode; } public MyMessages getMessages() { return messages == null ? messages = new MyMessages() : messages; } public void setMessages(MyMessages messages) { this.messages = messages; } public NavigationControllerFinal getNavigationControllerFinal() { return navigationControllerFinal == null ? navigationControllerFinal = new NavigationControllerFinal() : navigationControllerFinal; } public void setNavigationControllerFinal(NavigationControllerFinal navigationControllerFinal) { this.navigationControllerFinal = navigationControllerFinal; } }
10,247
0.666927
0.665561
229
43.746723
41.694424
207
false
false
0
0
0
0
0
0
0.467249
false
false
3
d98063bf00528a142da44518d421f16b14f918a6
30,949,534,343,793
a85757843fc9f8481755548439c89c54c96c6fb5
/mythunes-ws/src/test/java/frlsazc/mythunes/ws/tests/UserTests.java
567933c9d459fd77548e955148a4b2ce2038710d
[ "Apache-2.0" ]
permissive
frlsazc/mythunes
https://github.com/frlsazc/mythunes
682f16723ba8b2296ee3b19125046a89bb41029d
b5326aa6c52c6f2a124eb76d970bbf910c1cdc1b
refs/heads/master
2016-05-06T14:26:21.055000
2015-11-11T14:39:57
2015-11-11T14:39:57
45,291,694
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package frlsazc.mythunes.ws.tests; import static org.junit.Assert.*; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.TestExecutionListeners; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.DependencyInjectionTestExecutionListener; import org.springframework.transaction.annotation.Transactional; import frlsazc.mythunes.ws.services.IUserService; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes=ApplicationContextConfig.class) @TestExecutionListeners(DependencyInjectionTestExecutionListener.class) public class UserTests { @Autowired private IUserService userService; @Test @Transactional @Rollback(true) public void testAddAndLoginUser() { userService.addUser("admin", "admin"); String sessionId = userService.logIn("admin", "admin",100000); assertNotNull(sessionId); String login = userService.getLoginFromSession(sessionId); assertEquals("admin",login); //test login again String newSessionId = userService.logIn("admin", "admin",1000); assertNotEquals(sessionId, newSessionId); login = userService.getLoginFromSession(sessionId); assertEquals("admin",login); //test expiration try { Thread.sleep(1000); } catch (InterruptedException e) { } login = userService.getLoginFromSession(newSessionId); assertNull(login); newSessionId = userService.logIn("admin", "admin", 1000); //test with non existing sessionId login = userService.getLoginFromSession(""); assertNull(login); } @Test @Transactional @Rollback(true) public void testNonExistingLogin() { String result = userService.logIn("nonExistingLogin", "admin",1000); assertNull(result); } @Test @Transactional @Rollback(true) public void testBadPassword() { userService.addUser("admin", "admin"); String result = userService.logIn("admin", "badPassword",1000); assertNull(result); } }
UTF-8
Java
2,144
java
UserTests.java
Java
[ { "context": "stBadPassword() {\n\t\tuserService.addUser(\"admin\", \"admin\");\n\t\tString result = userService.logIn(\"admin\", \"", "end": 2047, "score": 0.9934752583503723, "start": 2042, "tag": "USERNAME", "value": "admin" } ]
null
[]
package frlsazc.mythunes.ws.tests; import static org.junit.Assert.*; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.TestExecutionListeners; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.DependencyInjectionTestExecutionListener; import org.springframework.transaction.annotation.Transactional; import frlsazc.mythunes.ws.services.IUserService; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes=ApplicationContextConfig.class) @TestExecutionListeners(DependencyInjectionTestExecutionListener.class) public class UserTests { @Autowired private IUserService userService; @Test @Transactional @Rollback(true) public void testAddAndLoginUser() { userService.addUser("admin", "admin"); String sessionId = userService.logIn("admin", "admin",100000); assertNotNull(sessionId); String login = userService.getLoginFromSession(sessionId); assertEquals("admin",login); //test login again String newSessionId = userService.logIn("admin", "admin",1000); assertNotEquals(sessionId, newSessionId); login = userService.getLoginFromSession(sessionId); assertEquals("admin",login); //test expiration try { Thread.sleep(1000); } catch (InterruptedException e) { } login = userService.getLoginFromSession(newSessionId); assertNull(login); newSessionId = userService.logIn("admin", "admin", 1000); //test with non existing sessionId login = userService.getLoginFromSession(""); assertNull(login); } @Test @Transactional @Rollback(true) public void testNonExistingLogin() { String result = userService.logIn("nonExistingLogin", "admin",1000); assertNull(result); } @Test @Transactional @Rollback(true) public void testBadPassword() { userService.addUser("admin", "admin"); String result = userService.logIn("admin", "badPassword",1000); assertNull(result); } }
2,144
0.784515
0.770989
68
30.529411
23.395243
89
false
false
0
0
0
0
0
0
1.852941
false
false
3
b3a67921ec8adbfb8a3c68ed4c64138403be1b06
29,764,123,370,807
f726e1f37751911cd2d75f406fb4b7851fc903ba
/StockMarketAPI/src/main/java/com/example/astha/controller/IpoController.java
c26519c88ba47f7e49c645887b8e01e035baa481
[]
no_license
Deepak-gauniyal/testtry
https://github.com/Deepak-gauniyal/testtry
26c7fa8ae3c3ed031045f6fc81482756539f606a
3f1c5f95b6114b5ffbbf9dc9ff88736d251e21f0
refs/heads/main
2023-07-18T21:30:11.260000
2021-09-18T19:04:18
2021-09-18T19:04:18
407,943,007
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.astha.controller; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import com.example.astha.entities.IpoDetails; import com.example.astha.repositories.CompanyRepository; import com.example.astha.services.IpoDetailsService; @CrossOrigin(origins = "http://localhost:3000") @RestController public class IpoController { @Autowired private IpoDetailsService ips; @GetMapping("/getAllIpo") public List<IpoDetails> getAllIpo() { return ips.getAllIpo(); } @GetMapping("/getIpoById/{id}") public IpoDetails getIpoById(@PathVariable ("id") Long id) { return ips.getIpoById(id); } @GetMapping( "/getCompanyNameByIpoId/{id}") public String getCompanyNameByIpoId(@PathVariable ("id") Long id) { return ips.getCompanyNameByIpoId(id); } @PostMapping( "/addIPO/{companyId}") public ResponseEntity<Void> addIPO(@RequestBody IpoDetails ipoDetails, @PathVariable ("companyId") Long companyId) { ips.addIPO(ipoDetails,companyId); return ResponseEntity.status(HttpStatus.OK).build(); } @PostMapping("/updateAnIPO") public ResponseEntity<Void> updateAnIPO(@RequestBody IpoDetails ipoDetails) { ips.updateIpo(ipoDetails); return ResponseEntity.status(HttpStatus.OK).build(); } }
UTF-8
Java
1,733
java
IpoController.java
Java
[]
null
[]
package com.example.astha.controller; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import com.example.astha.entities.IpoDetails; import com.example.astha.repositories.CompanyRepository; import com.example.astha.services.IpoDetailsService; @CrossOrigin(origins = "http://localhost:3000") @RestController public class IpoController { @Autowired private IpoDetailsService ips; @GetMapping("/getAllIpo") public List<IpoDetails> getAllIpo() { return ips.getAllIpo(); } @GetMapping("/getIpoById/{id}") public IpoDetails getIpoById(@PathVariable ("id") Long id) { return ips.getIpoById(id); } @GetMapping( "/getCompanyNameByIpoId/{id}") public String getCompanyNameByIpoId(@PathVariable ("id") Long id) { return ips.getCompanyNameByIpoId(id); } @PostMapping( "/addIPO/{companyId}") public ResponseEntity<Void> addIPO(@RequestBody IpoDetails ipoDetails, @PathVariable ("companyId") Long companyId) { ips.addIPO(ipoDetails,companyId); return ResponseEntity.status(HttpStatus.OK).build(); } @PostMapping("/updateAnIPO") public ResponseEntity<Void> updateAnIPO(@RequestBody IpoDetails ipoDetails) { ips.updateIpo(ipoDetails); return ResponseEntity.status(HttpStatus.OK).build(); } }
1,733
0.78592
0.783612
63
26.507936
26.340187
115
false
false
0
0
0
0
0
0
1.15873
false
false
3
f0d30324d8cd7c34357ae93fdc1f4f5f0003f9b7
11,613,591,610,291
86a1cf0b6fec24203b9d9ad15a26a7518e599ada
/app/src/main/java/com/example/vinhntph08047_lab3/DetailActivity.java
453ae9939f65ac97f5f198381ec4df53e6fb48ca
[]
no_license
mahuha80/Lab3
https://github.com/mahuha80/Lab3
de5e3d93e6558b758571b6588421466321729437
3c3540da25714bf42625244cf42102dd6b6f5cc3
refs/heads/master
2022-11-19T20:20:30.006000
2020-07-17T16:37:00
2020-07-17T16:37:00
280,208,395
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.vinhntph08047_lab3; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.widget.TextView; import android.widget.Toast; import java.util.List; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.disposables.CompositeDisposable; import io.reactivex.disposables.Disposable; import io.reactivex.schedulers.Schedulers; public class DetailActivity extends AppCompatActivity { Disposable disposable; String id; private TextView tvID; private TextView tvModified; private TextView tvTitle; private TextView tvContent; CompositeDisposable compositeDisposable = new CompositeDisposable(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_detail); tvID = (TextView) findViewById(R.id.tvID); tvModified = (TextView) findViewById(R.id.tvModified); tvTitle = (TextView) findViewById(R.id.tvTitle); tvContent = (TextView) findViewById(R.id.tvContent); getAgrument(); getDataFromServer(); } private void getDataFromServer() { disposable = NetModule.getAPIService() .getDetalItem(id) .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()).subscribe(this::OnSuccess, this::OnFailure); compositeDisposable.add(disposable); } private void OnSuccess(DetailClass detailClasses) { tvID.setText(String.valueOf(detailClasses.getId())); tvContent.setText(detailClasses.getContent().rendered.toString()); tvModified.setText(detailClasses.getModified().toString()); tvTitle.setText(detailClasses.getTitle().toString()); } private void OnFailure(Throwable throwable) { } private void getAgrument() { Intent intent = getIntent(); String id = intent.getStringExtra("id"); this.id = id; } @Override protected void onDestroy() { super.onDestroy(); compositeDisposable.clear(); } }
UTF-8
Java
2,159
java
DetailActivity.java
Java
[]
null
[]
package com.example.vinhntph08047_lab3; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.widget.TextView; import android.widget.Toast; import java.util.List; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.disposables.CompositeDisposable; import io.reactivex.disposables.Disposable; import io.reactivex.schedulers.Schedulers; public class DetailActivity extends AppCompatActivity { Disposable disposable; String id; private TextView tvID; private TextView tvModified; private TextView tvTitle; private TextView tvContent; CompositeDisposable compositeDisposable = new CompositeDisposable(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_detail); tvID = (TextView) findViewById(R.id.tvID); tvModified = (TextView) findViewById(R.id.tvModified); tvTitle = (TextView) findViewById(R.id.tvTitle); tvContent = (TextView) findViewById(R.id.tvContent); getAgrument(); getDataFromServer(); } private void getDataFromServer() { disposable = NetModule.getAPIService() .getDetalItem(id) .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()).subscribe(this::OnSuccess, this::OnFailure); compositeDisposable.add(disposable); } private void OnSuccess(DetailClass detailClasses) { tvID.setText(String.valueOf(detailClasses.getId())); tvContent.setText(detailClasses.getContent().rendered.toString()); tvModified.setText(detailClasses.getModified().toString()); tvTitle.setText(detailClasses.getTitle().toString()); } private void OnFailure(Throwable throwable) { } private void getAgrument() { Intent intent = getIntent(); String id = intent.getStringExtra("id"); this.id = id; } @Override protected void onDestroy() { super.onDestroy(); compositeDisposable.clear(); } }
2,159
0.700324
0.697545
69
30.304348
23.283573
90
false
false
0
0
0
0
0
0
0.550725
false
false
3
e693b70ef45292bb8351dedb69d2d962d7151fa0
9,887,014,776,815
0e9d22b258193c93ef03859be2de11980ebbe33d
/src/com/danielwehner/patterns/chainofresponsibility/CoRTest.java
864e956901527755f8a59248db7303d4c505cacd
[]
no_license
DaWe1992/SWA
https://github.com/DaWe1992/SWA
4e12f099522bd326a03841a1c691ee55daae4ea2
1f011a335e08ea17385b0c1be806cbc4966608d1
refs/heads/master
2019-07-15T13:27:45.532000
2017-04-23T16:47:48
2017-04-23T16:47:48
84,348,880
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.danielwehner.patterns.chainofresponsibility; /** * CoRTest. * @author Daniel * */ public class CoRTest { /** * Main method. * @param args */ public static void main(String[] args) { Logger l = LoggerFactory.getInstance().getLogger(); l.dealWithMessage("This is a test", Logger.DEBUG); } }
UTF-8
Java
320
java
CoRTest.java
Java
[ { "context": "chainofresponsibility;\n\n/**\n * CoRTest.\n * @author Daniel\n *\n */\npublic class CoRTest {\n\n\t/**\n\t * Main meth", "end": 91, "score": 0.9994217157363892, "start": 85, "tag": "NAME", "value": "Daniel" } ]
null
[]
package com.danielwehner.patterns.chainofresponsibility; /** * CoRTest. * @author Daniel * */ public class CoRTest { /** * Main method. * @param args */ public static void main(String[] args) { Logger l = LoggerFactory.getInstance().getLogger(); l.dealWithMessage("This is a test", Logger.DEBUG); } }
320
0.671875
0.671875
18
16.777779
19.288902
56
false
false
0
0
0
0
0
0
0.777778
false
false
3
32f4040127472d20e193a6d5c3b3ffe6e758fab0
9,887,014,773,430
4d38a2b9006aacf758d5215796b6054b0023355d
/src/main/java/com/ensa/gestionPharmacie/dao/PharmacienDao.java
89a32407e0398ceb0e1a17a88e38927c297eb454
[]
no_license
ghizlano-id/GeoPharma2
https://github.com/ghizlano-id/GeoPharma2
8a1cceea6d2b1a89b649b474b27d41d97e990f91
0602fe6b8c762eab1df560a384d889fc5e8a9a00
refs/heads/master
2021-01-20T09:44:44.948000
2017-07-09T17:23:20
2017-07-09T17:23:20
90,278,080
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.ensa.gestionPharmacie.dao; import com.ensa.gestionPharmacie.entity.Pharmacien; public interface PharmacienDao { String estPharmacien(String email , String password) ; void ajouter(Pharmacien pharmacien); Pharmacien getPharmacien(String CIN); void supprimer(String CIN); }
UTF-8
Java
302
java
PharmacienDao.java
Java
[]
null
[]
package com.ensa.gestionPharmacie.dao; import com.ensa.gestionPharmacie.entity.Pharmacien; public interface PharmacienDao { String estPharmacien(String email , String password) ; void ajouter(Pharmacien pharmacien); Pharmacien getPharmacien(String CIN); void supprimer(String CIN); }
302
0.778146
0.778146
15
19.133333
21.036055
57
false
false
0
0
0
0
0
0
0.8
false
false
3
9c500290e71404a7762682ae0fcb15a8fa8a6576
1,159,641,225,532
0b6eab40bb3593e19e1fa31ba86aa5fa590aa396
/src/main/java/MusicLendClient/CartController.java
47373f1d2151b7d6e7f6f85e9fac388a6a88d903
[]
no_license
insolor/music-lend-client
https://github.com/insolor/music-lend-client
d60e3200f47371423fc5ffe6d50ddb94b459accd
342c830b90413b1a36bcda2950d9ff5cdd9d7548
refs/heads/master
2022-01-18T09:43:15.478000
2019-07-24T10:28:21
2019-07-24T10:28:21
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package MusicLendClient; import javafx.collections.FXCollections; import javafx.fxml.FXML; import javafx.scene.control.*; import javafx.scene.control.cell.PropertyValueFactory; import java.io.IOException; import java.math.BigDecimal; public class CartController { private Cart cart; @FXML TextField txtPromo, txtSum, txtDiscountPercent, txtDiscountSum, txtSumToPay; @FXML Spinner<Integer> spinNumberOfDays; @FXML TableView<Instrument> tableInstrumentsInCart; @FXML TextArea textDescription; private void initTableColumns() { TableColumn<Instrument, String> nameColumn = new TableColumn<>("Название"); nameColumn.setCellValueFactory(new PropertyValueFactory<>("name")); tableInstrumentsInCart.getColumns().add(nameColumn); TableColumn<Instrument, BigDecimal> priceForDay = new TableColumn<>("Цена за сутки"); priceForDay.setCellValueFactory(new PropertyValueFactory<>("priceForDay")); tableInstrumentsInCart.getColumns().add(priceForDay); } private void updateInstrumentsInCart() { tableInstrumentsInCart.setItems(FXCollections.observableArrayList(cart.getInstruments())); } @FXML void initialize() { try { cart = Main.connection.getCart(); } catch (IOException ex) { Main.showError("Ошибка соединения", ""); cart = new Cart(); } catch (Connection.UnexpectedResultException ex) { Main.showError("Ошибка при запросе данных", ex.getMessage()); cart = new Cart(); } initTableColumns(); updateInstrumentsInCart(); spinNumberOfDays.getValueFactory().setValue(cart.getDays()); txtPromo.setText(cart.getPromocode()); // action when promocode text is changed txtPromo.textProperty().addListener((observable, oldValue, newValue)-> { BigDecimal oldPercent, newPercent; try { oldPercent = Main.connection.getPromocodePercent(oldValue); newPercent = Main.connection.getPromocodePercent(newValue); } catch (IOException ex) { Main.showError("Ошибка соединения", ""); return; } catch (Connection.UnexpectedResultException ex) { Main.showError("Ошибка при запросе данных", ex.getMessage()); return; } if(!oldPercent.equals(newPercent)) { // TODO: show promocode status somehow recalcCart(); } }); // action when number of days is changed spinNumberOfDays.valueProperty().addListener((observable, oldValue, newValue)-> recalcCart()); recalcCart(); // Show instrument description tableInstrumentsInCart.getSelectionModel().selectedItemProperty().addListener((obs, oldValue, newValue) -> { if(newValue == null) { textDescription.setText(""); } else { textDescription.setText(newValue.getDescription()); } }); } @FXML void removeFromCart() { Instrument instrument = tableInstrumentsInCart.getSelectionModel().getSelectedItem(); if(instrument != null) { try { Main.connection.removeFromCart(instrument); } catch (IOException ex) { Main.showError("Ошибка соединения", ""); return; } catch (Connection.UnexpectedResultException ex) { Main.showError("Ошибка при запросе данных", ex.getMessage()); return; } cart.getInstruments().remove(instrument); updateInstrumentsInCart(); recalcCart(); } } @FXML void pay() { if(!cart.getInstruments().isEmpty()) { cart.setPromocode(txtPromo.getText()); cart.setDays(spinNumberOfDays.getValue()); try { Main.connection.pay(); } catch (IOException ex) { Main.showError("Ошибка соединения", ""); return; } catch (Connection.UnexpectedResultException ex) { Main.showError("Ошибка при запросе данных", ex.getMessage()); return; } Alert alert = new Alert(Alert.AlertType.CONFIRMATION, "Оплачено", ButtonType.OK); alert.showAndWait(); try { cart = Main.connection.getCart(); } catch (IOException ex) { Main.showError("Ошибка соединения", ""); cart = new Cart(); } catch (Connection.UnexpectedResultException ex) { Main.showError("Ошибка при запросе данных", ex.getMessage()); cart = new Cart(); } updateInstrumentsInCart(); Main.localUser.invalidate(); } } private void recalcCart() { Cart cart = new Cart(tableInstrumentsInCart.getItems(), txtPromo.getText(), spinNumberOfDays.getValue()); CartCalculationResult result; try { Main.connection.updateCartData(cart.getPromocode(), cart.getDays()); result = Main.connection.calculateCart(); } catch (IOException ex) { Main.showError("Ошибка соединения", ""); return; } catch (Connection.UnexpectedResultException ex) { Main.showError("Ошибка при запросе данных", ex.getMessage()); return; } txtDiscountPercent.setText(result.getDiscountPercent().toString().concat("%")); txtDiscountSum.setText(result.getDiscountSum().toString()); txtSumToPay.setText(result.getSumToBePaid().toString()); txtSum.setText(result.getSumToBePaid().add(result.getDiscountSum()).toString()); } }
UTF-8
Java
6,258
java
CartController.java
Java
[]
null
[]
package MusicLendClient; import javafx.collections.FXCollections; import javafx.fxml.FXML; import javafx.scene.control.*; import javafx.scene.control.cell.PropertyValueFactory; import java.io.IOException; import java.math.BigDecimal; public class CartController { private Cart cart; @FXML TextField txtPromo, txtSum, txtDiscountPercent, txtDiscountSum, txtSumToPay; @FXML Spinner<Integer> spinNumberOfDays; @FXML TableView<Instrument> tableInstrumentsInCart; @FXML TextArea textDescription; private void initTableColumns() { TableColumn<Instrument, String> nameColumn = new TableColumn<>("Название"); nameColumn.setCellValueFactory(new PropertyValueFactory<>("name")); tableInstrumentsInCart.getColumns().add(nameColumn); TableColumn<Instrument, BigDecimal> priceForDay = new TableColumn<>("Цена за сутки"); priceForDay.setCellValueFactory(new PropertyValueFactory<>("priceForDay")); tableInstrumentsInCart.getColumns().add(priceForDay); } private void updateInstrumentsInCart() { tableInstrumentsInCart.setItems(FXCollections.observableArrayList(cart.getInstruments())); } @FXML void initialize() { try { cart = Main.connection.getCart(); } catch (IOException ex) { Main.showError("Ошибка соединения", ""); cart = new Cart(); } catch (Connection.UnexpectedResultException ex) { Main.showError("Ошибка при запросе данных", ex.getMessage()); cart = new Cart(); } initTableColumns(); updateInstrumentsInCart(); spinNumberOfDays.getValueFactory().setValue(cart.getDays()); txtPromo.setText(cart.getPromocode()); // action when promocode text is changed txtPromo.textProperty().addListener((observable, oldValue, newValue)-> { BigDecimal oldPercent, newPercent; try { oldPercent = Main.connection.getPromocodePercent(oldValue); newPercent = Main.connection.getPromocodePercent(newValue); } catch (IOException ex) { Main.showError("Ошибка соединения", ""); return; } catch (Connection.UnexpectedResultException ex) { Main.showError("Ошибка при запросе данных", ex.getMessage()); return; } if(!oldPercent.equals(newPercent)) { // TODO: show promocode status somehow recalcCart(); } }); // action when number of days is changed spinNumberOfDays.valueProperty().addListener((observable, oldValue, newValue)-> recalcCart()); recalcCart(); // Show instrument description tableInstrumentsInCart.getSelectionModel().selectedItemProperty().addListener((obs, oldValue, newValue) -> { if(newValue == null) { textDescription.setText(""); } else { textDescription.setText(newValue.getDescription()); } }); } @FXML void removeFromCart() { Instrument instrument = tableInstrumentsInCart.getSelectionModel().getSelectedItem(); if(instrument != null) { try { Main.connection.removeFromCart(instrument); } catch (IOException ex) { Main.showError("Ошибка соединения", ""); return; } catch (Connection.UnexpectedResultException ex) { Main.showError("Ошибка при запросе данных", ex.getMessage()); return; } cart.getInstruments().remove(instrument); updateInstrumentsInCart(); recalcCart(); } } @FXML void pay() { if(!cart.getInstruments().isEmpty()) { cart.setPromocode(txtPromo.getText()); cart.setDays(spinNumberOfDays.getValue()); try { Main.connection.pay(); } catch (IOException ex) { Main.showError("Ошибка соединения", ""); return; } catch (Connection.UnexpectedResultException ex) { Main.showError("Ошибка при запросе данных", ex.getMessage()); return; } Alert alert = new Alert(Alert.AlertType.CONFIRMATION, "Оплачено", ButtonType.OK); alert.showAndWait(); try { cart = Main.connection.getCart(); } catch (IOException ex) { Main.showError("Ошибка соединения", ""); cart = new Cart(); } catch (Connection.UnexpectedResultException ex) { Main.showError("Ошибка при запросе данных", ex.getMessage()); cart = new Cart(); } updateInstrumentsInCart(); Main.localUser.invalidate(); } } private void recalcCart() { Cart cart = new Cart(tableInstrumentsInCart.getItems(), txtPromo.getText(), spinNumberOfDays.getValue()); CartCalculationResult result; try { Main.connection.updateCartData(cart.getPromocode(), cart.getDays()); result = Main.connection.calculateCart(); } catch (IOException ex) { Main.showError("Ошибка соединения", ""); return; } catch (Connection.UnexpectedResultException ex) { Main.showError("Ошибка при запросе данных", ex.getMessage()); return; } txtDiscountPercent.setText(result.getDiscountPercent().toString().concat("%")); txtDiscountSum.setText(result.getDiscountSum().toString()); txtSumToPay.setText(result.getSumToBePaid().toString()); txtSum.setText(result.getSumToBePaid().add(result.getDiscountSum()).toString()); } }
6,258
0.585541
0.585541
177
32.915253
27.940184
116
false
false
0
0
0
0
0
0
0.615819
false
false
3
1ba11ad074493ae3cffddb7d6c37e20b0510d182
7,610,682,058,327
0d546c26bde95f065aeb0c0d68f7e1d189771d43
/main/java/net/minelucraft/rewinside/gamemodes/PrimeBW.java
6b0d8fe2c75b6efe41c0690ad835fddfe82f6f86
[]
no_license
minelucraft/Rewinside-Addon-Remake
https://github.com/minelucraft/Rewinside-Addon-Remake
84c8cf2c3ae71bb6ca45c02b46b2b06ee2ca91e1
2c3ba851c393c31bcd284efac77eba46a46eb024
refs/heads/master
2020-03-28T06:07:19.244000
2018-09-07T11:52:12
2018-09-07T11:52:12
147,261,211
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package net.minelucraft.rewinside.gamemodes; public class PrimeBW extends BedWars { /** * @param gameModeName the name of the GameMode, like BedWars, SkyWars,.. * @param tabListName how the mode is called in the tablist. Like BedWars-2x4 * @param identifier * @param prefix * @see this.getName(); * @see this.getTabList(); */ public PrimeBW(String gameModeName, String tabListName, String identifier, String prefix) { super(gameModeName, tabListName, identifier, prefix); } }
UTF-8
Java
522
java
PrimeBW.java
Java
[]
null
[]
package net.minelucraft.rewinside.gamemodes; public class PrimeBW extends BedWars { /** * @param gameModeName the name of the GameMode, like BedWars, SkyWars,.. * @param tabListName how the mode is called in the tablist. Like BedWars-2x4 * @param identifier * @param prefix * @see this.getName(); * @see this.getTabList(); */ public PrimeBW(String gameModeName, String tabListName, String identifier, String prefix) { super(gameModeName, tabListName, identifier, prefix); } }
522
0.695402
0.691571
14
36.285713
40.624462
151
false
false
0
0
0
0
0
0
0.928571
false
false
3
cd81667f1802f33933082c4ebdde9389eb43eed1
25,512,105,794,018
fe4d1658a7ffc0b5c19cb0bd0004b84414457b4a
/cloudnet-server/src/main/java/de/dytanic/cloudnetserver/util/Utils.java
03e9cf275987e17a8de732f65a0cfb0e281dfe63
[]
no_license
zM4xi/CloudNet-V1
https://github.com/zM4xi/CloudNet-V1
0b8130ac5b115ae735bb2750447b7a742181a630
cd304060487a44fd4710bfbf4786e36c09183849
refs/heads/master
2021-01-22T04:32:53.575000
2017-09-01T15:22:21
2017-09-01T15:22:21
102,268,212
0
2
null
true
2017-09-03T13:56:05
2017-09-03T13:56:05
2017-09-01T15:26:58
2017-09-01T15:22:26
0
0
0
0
null
null
null
package de.dytanic.cloudnetserver.util; import java.text.SimpleDateFormat; import java.util.Random; /** * Created by Tareko on 25.05.2017. */ public final class Utils { public static final SimpleDateFormat SIMPLE_DATE_FORMAT = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss"); public static final Random RANDOM = new Random(); public static boolean checkAsNumber(String input) { try{ Short.parseShort(input); return true; }catch (Exception e) { return false; } } }
UTF-8
Java
555
java
Utils.java
Java
[ { "context": "ormat;\nimport java.util.Random;\n\n/**\n * Created by Tareko on 25.05.2017.\n */\npublic final class Utils {\n\n ", "end": 126, "score": 0.9956652522087097, "start": 120, "tag": "NAME", "value": "Tareko" } ]
null
[]
package de.dytanic.cloudnetserver.util; import java.text.SimpleDateFormat; import java.util.Random; /** * Created by Tareko on 25.05.2017. */ public final class Utils { public static final SimpleDateFormat SIMPLE_DATE_FORMAT = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss"); public static final Random RANDOM = new Random(); public static boolean checkAsNumber(String input) { try{ Short.parseShort(input); return true; }catch (Exception e) { return false; } } }
555
0.634234
0.61982
25
21.200001
24.023321
106
false
false
0
0
0
0
0
0
0.32
false
false
3
d48354e7fd992cbd42c28d3bf013bfa734276558
38,972,533,244,146
6b5bb11b5ce1dfa055736797a5d02efbedb73e12
/gmall-sms/src/main/java/com/atguigu/gmall/sms/dao/SeckillSkuRelationDao.java
25fb85040d7332bfe47d3fb2ef19ba0e8c210186
[ "Apache-2.0" ]
permissive
763977251/gmall
https://github.com/763977251/gmall
2a9dedb8fbdf8c968ecfe8e523e1b0b110b5c9be
b44a1c4d0f416bb0f26d8387c4c1b71442d9953f
refs/heads/master
2021-09-23T12:23:54.641000
2020-03-27T03:16:39
2020-03-27T03:16:39
233,981,253
1
0
Apache-2.0
false
2021-05-11T00:59:45
2020-01-15T02:31:44
2020-03-27T03:19:17
2021-05-11T00:59:43
12,844
1
0
19
JavaScript
false
false
package com.atguigu.gmall.sms.dao; import com.atguigu.gmall.sms.entity.SeckillSkuRelationEntity; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; /** * 秒杀活动商品关联 * * @author shanggao * @email 763977251@qq.com * @date 2020-01-15 14:48:42 */ @Mapper public interface SeckillSkuRelationDao extends BaseMapper<SeckillSkuRelationEntity> { }
UTF-8
Java
414
java
SeckillSkuRelationDao.java
Java
[ { "context": "nnotations.Mapper;\n\n/**\n * 秒杀活动商品关联\n * \n * @author shanggao\n * @email 763977251@qq.com\n * @date 2020-01-15 14", "end": 239, "score": 0.9994860291481018, "start": 231, "tag": "USERNAME", "value": "shanggao" }, { "context": "/**\n * 秒杀活动商品关联\n * \n * @author shanggao\n * @email 763977251@qq.com\n * @date 2020-01-15 14:48:42\n */\n@Mapper\npublic i", "end": 266, "score": 0.9998219013214111, "start": 250, "tag": "EMAIL", "value": "763977251@qq.com" } ]
null
[]
package com.atguigu.gmall.sms.dao; import com.atguigu.gmall.sms.entity.SeckillSkuRelationEntity; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; /** * 秒杀活动商品关联 * * @author shanggao * @email <EMAIL> * @date 2020-01-15 14:48:42 */ @Mapper public interface SeckillSkuRelationDao extends BaseMapper<SeckillSkuRelationEntity> { }
405
0.778894
0.721106
17
22.411764
24.904663
85
false
false
0
0
0
0
0
0
0.294118
false
false
3
0cf4e08724d73ebbcc26de50375f80f3977d7b1b
37,976,100,838,037
0e94f13181227cc07501302f84dee378738633e9
/app/src/main/java/org/destil/gpsaveraging/AveragingService.java
fd56bfd061ef432ae7a6eda6040b5cb05e89a130
[ "Apache-2.0" ]
permissive
lijian8/GPS-Averaging
https://github.com/lijian8/GPS-Averaging
ac9772e67e53acab08f0353723dd0340982d9789
501e3b8a7162d0497ec6dd9c5ceba143f1069b68
refs/heads/master
2021-01-17T23:08:49.328000
2015-08-17T11:44:05
2015-08-17T11:44:05
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package org.destil.gpsaveraging; import java.util.Timer; import java.util.TimerTask; import android.app.Notification; import android.app.PendingIntent; import android.app.Service; import android.content.Context; import android.content.Intent; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.os.Bundle; import android.os.IBinder; import android.support.v4.app.NotificationCompat; import android.support.v4.content.LocalBroadcastManager; public class AveragingService extends Service implements LocationListener { private static final int MEASUREMENT_DELAY = 2000; // delay between // measurements public static final String INTENT_ACTION = "org.destil.gpsaveraging.LocationUpdate"; public static final String EXTRA_LOCATION = "org.destil.gpsaveraging.LOCATION"; public static boolean isRunning = false; private Measurements measurements; private LocationManager locationManager; private Timer timer; @Override public void onCreate() { super.onCreate(); measurements = Measurements.getInstance(); locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); } @Override public IBinder onBind(Intent intent) { // no binding return null; } @Override public int onStartCommand(Intent intent, int flags, int startId) { // start averaging startAveraging(); // keep GPS running locationManager.requestLocationUpdates(MainActivity.GPS, 0, 0, this); return START_STICKY; } @Override public void onDestroy() { if (timer != null) { timer.cancel(); } stopForeground(true); locationManager.removeUpdates(this); super.onDestroy(); } /** * Starts active averaging. */ public void startAveraging() { isRunning = true; showNotification(); measurements.clean(); timer = new Timer(); final LocalBroadcastManager broadcastManager = LocalBroadcastManager.getInstance(this); final Intent intent = new Intent(INTENT_ACTION); timer.schedule(new TimerTask() { @Override public void run() { Location location = locationManager.getLastKnownLocation("gps"); if (location != null) { measurements.add(locationManager.getLastKnownLocation("gps")); intent.putExtra(EXTRA_LOCATION, measurements.getAveragedLocation()); broadcastManager.sendBroadcast(intent); } } }, 0, MEASUREMENT_DELAY); } /** * Shows notification and launches ONGOING mode. */ private void showNotification() { PendingIntent intent = PendingIntent.getActivity(this, 0, new Intent(this, MainActivity.class), 0); Notification notification = new NotificationCompat.Builder(this).setOngoing(true) .setContentTitle(getString(R.string.averaging_running)).setSmallIcon(R.drawable.ic_stat_notification) .setContentIntent(intent).setContentText(getString(R.string.tap_to_control_it)).build(); startForeground(42, notification); } @Override public void onLocationChanged(Location location) { // ignore } @Override public void onProviderDisabled(String provider) { // ignore } @Override public void onProviderEnabled(String provider) { // ignore } @Override public void onStatusChanged(String provider, int status, Bundle extras) { // ignore } }
UTF-8
Java
3,255
java
AveragingService.java
Java
[]
null
[]
package org.destil.gpsaveraging; import java.util.Timer; import java.util.TimerTask; import android.app.Notification; import android.app.PendingIntent; import android.app.Service; import android.content.Context; import android.content.Intent; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.os.Bundle; import android.os.IBinder; import android.support.v4.app.NotificationCompat; import android.support.v4.content.LocalBroadcastManager; public class AveragingService extends Service implements LocationListener { private static final int MEASUREMENT_DELAY = 2000; // delay between // measurements public static final String INTENT_ACTION = "org.destil.gpsaveraging.LocationUpdate"; public static final String EXTRA_LOCATION = "org.destil.gpsaveraging.LOCATION"; public static boolean isRunning = false; private Measurements measurements; private LocationManager locationManager; private Timer timer; @Override public void onCreate() { super.onCreate(); measurements = Measurements.getInstance(); locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); } @Override public IBinder onBind(Intent intent) { // no binding return null; } @Override public int onStartCommand(Intent intent, int flags, int startId) { // start averaging startAveraging(); // keep GPS running locationManager.requestLocationUpdates(MainActivity.GPS, 0, 0, this); return START_STICKY; } @Override public void onDestroy() { if (timer != null) { timer.cancel(); } stopForeground(true); locationManager.removeUpdates(this); super.onDestroy(); } /** * Starts active averaging. */ public void startAveraging() { isRunning = true; showNotification(); measurements.clean(); timer = new Timer(); final LocalBroadcastManager broadcastManager = LocalBroadcastManager.getInstance(this); final Intent intent = new Intent(INTENT_ACTION); timer.schedule(new TimerTask() { @Override public void run() { Location location = locationManager.getLastKnownLocation("gps"); if (location != null) { measurements.add(locationManager.getLastKnownLocation("gps")); intent.putExtra(EXTRA_LOCATION, measurements.getAveragedLocation()); broadcastManager.sendBroadcast(intent); } } }, 0, MEASUREMENT_DELAY); } /** * Shows notification and launches ONGOING mode. */ private void showNotification() { PendingIntent intent = PendingIntent.getActivity(this, 0, new Intent(this, MainActivity.class), 0); Notification notification = new NotificationCompat.Builder(this).setOngoing(true) .setContentTitle(getString(R.string.averaging_running)).setSmallIcon(R.drawable.ic_stat_notification) .setContentIntent(intent).setContentText(getString(R.string.tap_to_control_it)).build(); startForeground(42, notification); } @Override public void onLocationChanged(Location location) { // ignore } @Override public void onProviderDisabled(String provider) { // ignore } @Override public void onProviderEnabled(String provider) { // ignore } @Override public void onStatusChanged(String provider, int status, Bundle extras) { // ignore } }
3,255
0.754839
0.750845
117
26.820513
26.103218
105
false
false
0
0
0
0
0
0
1.91453
false
false
3
58663ae9cb52dd8a53fbf9ff52fa8c95f47f5a54
34,857,954,600,188
cb3834805c4ed033a94ad02287fc27c28f124a50
/src/main/java/jin/annotations/Json.java
8e1f764152a2d2dfa03b93e3974d12d18f783d95
[ "MIT" ]
permissive
andela-ftchirou/jin
https://github.com/andela-ftchirou/jin
cc0c5bad23cf3237c268cb5281589e641a24b684
67218e0c44488032a2bb82c2b8a5c841c5035892
refs/heads/master
2020-04-10T03:28:24.501000
2015-03-06T11:01:22
2015-03-06T11:01:22
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package jin.annotations; import jin.databind.JsonDeserializer; import jin.databind.JsonSerializer; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Target({ElementType.TYPE, ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME) public @interface Json { String property() default ""; boolean ignore() default false; Class<? extends JsonSerializer> serializeWith() default JsonSerializer.class; Class<? extends JsonDeserializer> deserializeWith() default JsonDeserializer.class; }
UTF-8
Java
613
java
Json.java
Java
[]
null
[]
package jin.annotations; import jin.databind.JsonDeserializer; import jin.databind.JsonSerializer; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Target({ElementType.TYPE, ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME) public @interface Json { String property() default ""; boolean ignore() default false; Class<? extends JsonSerializer> serializeWith() default JsonSerializer.class; Class<? extends JsonDeserializer> deserializeWith() default JsonDeserializer.class; }
613
0.800979
0.800979
18
33.055557
23.651339
87
false
false
0
0
0
0
0
0
0.666667
false
false
3
7ffda89450df7516b503c0c4e4a0cb4cb00a978c
25,993,142,137,005
591eebff12e660032b6873bdd21c582757da0e1a
/Clavicom/src/clavicom/gui/edition/key/UIPanelOptionColor.java
c0b75911102685fd9faf4ed53cace87af37979ae
[]
no_license
B3tty/clavicom
https://github.com/B3tty/clavicom
776ef2ecbe33a4d8966d43c95b871a3ecf85dc16
6cbf4e92ec864805c2ce6d7278ac0bc0bb79a1eb
refs/heads/master
2021-01-13T00:56:20.744000
2012-06-26T13:35:33
2012-06-26T13:35:33
54,482,642
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/*-----------------------------------------------------------------------------+ Filename : PanelOptionColor.java Creation date : 5 juin 07 Project : Clavicom Package : clavicom.gui.keyboard.key.option Developed by : Thomas DEVAUX & Guillaume REBESCHE Copyright (C) : (2007) Centre ICOM' ------------------------- This program is free software. You can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation. Either version 2.1 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +-----------------------------------------------------------------------------*/ package clavicom.gui.edition.key; import java.awt.Color; import java.awt.Dimension; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.List; import javax.swing.JColorChooser; import javax.swing.JLabel; import javax.swing.JPanel; import clavicom.core.keygroup.CKey; import clavicom.gui.language.UIString; import clavicom.tools.TColorKeyEnum; import clavicom.tools.TColorPanel; public class UIPanelOptionColor extends JPanel { //--------------------------------------------------------- CONSTANTES --// //---------------------------------------------------------- VARIABLES --// CKey key; TColorPanel colorPanel; JLabel lColor; TColorKeyEnum colorEnum; List<CKey> selectedKeys; //------------------------------------------------------ CONSTRUCTEURS --// public UIPanelOptionColor( ) { lColor = new JLabel(); add(lColor); colorPanel = new TColorPanel(); colorPanel.setPreferredSize( new Dimension(30,20) ); add( colorPanel ); colorPanel.addMouseListener( new MouseAdapter() { public void mouseClicked(MouseEvent e) { if((selectedKeys == null) && (key != null)) // Selection unique { Color newColor = JColorChooser.showDialog( UIPanelOptionColor.this, UIString.getUIString("LB_CHOOSE_COLOR"), key.getColor( colorEnum ) ); if( newColor != null ) { if( newColor != key.getColor( colorEnum ) ) { // la couleur à changé key.setColor( newColor, colorEnum ); colorPanel.setBackground( newColor ); } } } else if ((selectedKeys != null) && (key == null)) // Selection multiple { Color newColor = JColorChooser.showDialog( UIPanelOptionColor.this, UIString.getUIString("LB_CHOOSE_COLOR"), Color.WHITE ); if( newColor != null ) { for (CKey currentKey : selectedKeys) { if( newColor != currentKey.getColor( colorEnum ) ) { // la couleur à changé currentKey.setColor( newColor, colorEnum ); } } } colorPanel.setBackground( newColor ); } } }); } public void setValues(List<CKey> selectedKeys, TColorKeyEnum myColorEnum) { key = null; this.selectedKeys = selectedKeys; colorEnum = myColorEnum; lColor.setText(colorEnum.toString()); } public void setValues(CKey myKey, TColorKeyEnum myColorEnum) { selectedKeys = null; key = myKey; colorEnum = myColorEnum; lColor.setText(colorEnum.toString()); colorPanel.setBackground( key.getColor( colorEnum ) ); } //----------------------------------------------------------- METHODES --// //--------------------------------------------------- METHODES PRIVEES --// }
UTF-8
Java
3,795
java
UIPanelOptionColor.java
Java
[ { "context": "icom.gui.keyboard.key.option\r\n\r\n\t\t\tDeveloped by\t\t: Thomas DEVAUX & Guillaume REBESCHE\r\n\t\t\tCopyright (C)\t\t: (2007) ", "end": 268, "score": 0.9998603463172913, "start": 255, "tag": "NAME", "value": "Thomas DEVAUX" }, { "context": "d.key.option\r\n\r\n\t\t\tDeveloped by\t\t: Thomas DEVAUX & Guillaume REBESCHE\r\n\t\t\tCopyright (C)\t\t: (2007) Centre ICOM'\r\n\r\n\t\t\t\t\t", "end": 289, "score": 0.9998385310173035, "start": 271, "tag": "NAME", "value": "Guillaume REBESCHE" } ]
null
[]
/*-----------------------------------------------------------------------------+ Filename : PanelOptionColor.java Creation date : 5 juin 07 Project : Clavicom Package : clavicom.gui.keyboard.key.option Developed by : <NAME> & <NAME> Copyright (C) : (2007) Centre ICOM' ------------------------- This program is free software. You can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation. Either version 2.1 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +-----------------------------------------------------------------------------*/ package clavicom.gui.edition.key; import java.awt.Color; import java.awt.Dimension; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.List; import javax.swing.JColorChooser; import javax.swing.JLabel; import javax.swing.JPanel; import clavicom.core.keygroup.CKey; import clavicom.gui.language.UIString; import clavicom.tools.TColorKeyEnum; import clavicom.tools.TColorPanel; public class UIPanelOptionColor extends JPanel { //--------------------------------------------------------- CONSTANTES --// //---------------------------------------------------------- VARIABLES --// CKey key; TColorPanel colorPanel; JLabel lColor; TColorKeyEnum colorEnum; List<CKey> selectedKeys; //------------------------------------------------------ CONSTRUCTEURS --// public UIPanelOptionColor( ) { lColor = new JLabel(); add(lColor); colorPanel = new TColorPanel(); colorPanel.setPreferredSize( new Dimension(30,20) ); add( colorPanel ); colorPanel.addMouseListener( new MouseAdapter() { public void mouseClicked(MouseEvent e) { if((selectedKeys == null) && (key != null)) // Selection unique { Color newColor = JColorChooser.showDialog( UIPanelOptionColor.this, UIString.getUIString("LB_CHOOSE_COLOR"), key.getColor( colorEnum ) ); if( newColor != null ) { if( newColor != key.getColor( colorEnum ) ) { // la couleur à changé key.setColor( newColor, colorEnum ); colorPanel.setBackground( newColor ); } } } else if ((selectedKeys != null) && (key == null)) // Selection multiple { Color newColor = JColorChooser.showDialog( UIPanelOptionColor.this, UIString.getUIString("LB_CHOOSE_COLOR"), Color.WHITE ); if( newColor != null ) { for (CKey currentKey : selectedKeys) { if( newColor != currentKey.getColor( colorEnum ) ) { // la couleur à changé currentKey.setColor( newColor, colorEnum ); } } } colorPanel.setBackground( newColor ); } } }); } public void setValues(List<CKey> selectedKeys, TColorKeyEnum myColorEnum) { key = null; this.selectedKeys = selectedKeys; colorEnum = myColorEnum; lColor.setText(colorEnum.toString()); } public void setValues(CKey myKey, TColorKeyEnum myColorEnum) { selectedKeys = null; key = myKey; colorEnum = myColorEnum; lColor.setText(colorEnum.toString()); colorPanel.setBackground( key.getColor( colorEnum ) ); } //----------------------------------------------------------- METHODES --// //--------------------------------------------------- METHODES PRIVEES --// }
3,776
0.571617
0.568188
127
27.850393
27.879402
143
false
false
0
0
0
0
0
0
2.984252
false
false
3
30eccdcbc23649a67f312e3ac1fe4ce1b591b6f7
33,251,636,838,956
e38b66f7110285aab22f3b8f7f1031c9cc736cb4
/mascotes-src/src/problemes/mascotes/ChipImpl.java
2b8234aeb2a06a826f40e9c5f2b5d24b4325d37a
[]
no_license
victorgomezluque/POO-DAM
https://github.com/victorgomezluque/POO-DAM
9d91ed63e7529556e2993b6b8fc17b0fb69530bf
f450eb3b8d42f1c57512b1363c702eae5059fbed
refs/heads/master
2022-06-22T17:06:58.574000
2019-11-06T19:26:57
2019-11-06T19:26:57
220,065,735
0
0
null
false
2022-06-21T02:11:12
2019-11-06T18:41:50
2019-11-06T19:27:09
2022-06-21T02:11:11
21,395
0
0
16
Java
false
false
package problemes.mascotes; import java.util.Objects; public class ChipImpl implements Chip { private static long id=1; private Hogar hogar; public Long getId() { return id; } public Hogar getHogar() { return hogar; } @Override public String toString() { return "ChipImpl [id=" + id + ", hogar=" + hogar + "]"; } public ChipImpl(long contador, Hogar hogar) { super(); ChipImpl.id = contador; this.hogar = hogar; } @Override public int hashCode() { return Objects.hash(id); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ChipImpl other = (ChipImpl) obj; if (hogar == null) { if (other.hogar != null) return false; } else if (!hogar.equals(other.hogar)) return false; return true; } }
UTF-8
Java
879
java
ChipImpl.java
Java
[]
null
[]
package problemes.mascotes; import java.util.Objects; public class ChipImpl implements Chip { private static long id=1; private Hogar hogar; public Long getId() { return id; } public Hogar getHogar() { return hogar; } @Override public String toString() { return "ChipImpl [id=" + id + ", hogar=" + hogar + "]"; } public ChipImpl(long contador, Hogar hogar) { super(); ChipImpl.id = contador; this.hogar = hogar; } @Override public int hashCode() { return Objects.hash(id); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ChipImpl other = (ChipImpl) obj; if (hogar == null) { if (other.hogar != null) return false; } else if (!hogar.equals(other.hogar)) return false; return true; } }
879
0.634812
0.633675
55
14.981818
13.906821
57
false
false
0
0
0
0
0
0
1.672727
false
false
3
28f87c0fd23fd3799f14b15411811476cf9ca412
33,251,636,838,827
797130f16671ad469137c8fe28834f0b52801e9e
/BookStore/src/com/chatone/bookStore/web/servlet/UserServlet.java
2fafdf656c74b748101da4e4d70622e8c64ff2fc
[]
no_license
SignalLine/BookStore
https://github.com/SignalLine/BookStore
be6f1f0014fb9a436a5bf385b875a46fc83943d5
cf504f2e3a5138b4b455c11ff04eb015906f28e3
refs/heads/master
2021-08-07T11:08:06.740000
2017-11-08T02:30:03
2017-11-08T02:30:03
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.chatone.bookStore.web.servlet; import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.util.UUID; 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; import com.chatone.bookStore.domain.User; import com.chatone.bookStore.execption.UserException; import com.chatone.bookStore.service.UserService; public class UserServlet extends BaseServlet { public void login(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { //获取表单数据 String username = request.getParameter("username"); String password = request.getParameter("password"); UserService us = new UserService(); try { User user = us.login(username,password); String path = "/index.jsp"; if("admin".equals(user.getRole())){ path = "/admin/login/home.jsp"; } request.getSession().setAttribute("user", user); request.getRequestDispatcher(path).forward(request, response); } catch (UserException e) { e.printStackTrace(); request.setAttribute("user_msg", e.getMessage()); request.getRequestDispatcher("/login.jsp").forward(request, response); } } public void register(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { //处理验证码 String ckcode = request.getParameter("ckcode"); String checkcode_session = (String) request.getSession().getAttribute("checkcode_session"); if(!checkcode_session.equals(ckcode)){ //如果两个验证码不一致,跳回初始页面 request.setAttribute("ckcode_msg", "验证码错误!"); request.getRequestDispatcher("/register.jsp").forward(request, response); return; } //获取表单数据 User user = new User(); try { BeanUtils.populate(user, request.getParameterMap()); user.setActiveCode(UUID.randomUUID().toString());//手动设置激活码 UserService us = new UserService(); //调用业务逻辑 us.regist(user); //分发转向 //要求用户激活后才能登陆,所以不能把用户信息保存到session中 // request.getSession().setAttribute("user", user);//把用户信息封装到session对象中 request.getRequestDispatcher("/registersuccess.jsp").forward(request, response); } catch (UserException e) { // e.printStackTrace(); request.setAttribute("user_msg",e.getMessage()); request.getRequestDispatcher("/register.jsp").forward(request, response); return; } catch (Exception e) { e.printStackTrace(); } } public void logout(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.getSession().invalidate();//使session销毁 response.sendRedirect(request.getContextPath() + "/index.jsp"); } public void findUserById(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String id = request.getParameter("id"); UserService us = new UserService(); try { User user = us.findUserById(id); request.setAttribute("u",user); request.getRequestDispatcher("/modifyuserinfo.jsp").forward(request, response); } catch (UserException e) { e.printStackTrace(); // response.getWriter().write(e.getMessage()); response.sendRedirect(request.getContextPath() + "/login.jsp"); } } public void modifyUserServlet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { //封装表单数据 User user = new User(); try { BeanUtils.populate(user, request.getParameterMap()); UserService us = new UserService(); us.modifyUser(user); //成功 request.getSession().invalidate();//注销用户 response.sendRedirect(request.getContextPath() + "/modifyUserInfoSuccess.jsp"); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } catch (UserException e) { e.printStackTrace(); response.getWriter().write(e.getMessage()); } } }
UTF-8
Java
4,347
java
UserServlet.java
Java
[ { "context": "获取表单数据\r\n\t\tString username = request.getParameter(\"username\");\r\n\t\tString password = request.getParameter(\"pas", "end": 768, "score": 0.7916233539581299, "start": 760, "tag": "USERNAME", "value": "username" } ]
null
[]
package com.chatone.bookStore.web.servlet; import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.util.UUID; 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; import com.chatone.bookStore.domain.User; import com.chatone.bookStore.execption.UserException; import com.chatone.bookStore.service.UserService; public class UserServlet extends BaseServlet { public void login(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { //获取表单数据 String username = request.getParameter("username"); String password = request.getParameter("password"); UserService us = new UserService(); try { User user = us.login(username,password); String path = "/index.jsp"; if("admin".equals(user.getRole())){ path = "/admin/login/home.jsp"; } request.getSession().setAttribute("user", user); request.getRequestDispatcher(path).forward(request, response); } catch (UserException e) { e.printStackTrace(); request.setAttribute("user_msg", e.getMessage()); request.getRequestDispatcher("/login.jsp").forward(request, response); } } public void register(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { //处理验证码 String ckcode = request.getParameter("ckcode"); String checkcode_session = (String) request.getSession().getAttribute("checkcode_session"); if(!checkcode_session.equals(ckcode)){ //如果两个验证码不一致,跳回初始页面 request.setAttribute("ckcode_msg", "验证码错误!"); request.getRequestDispatcher("/register.jsp").forward(request, response); return; } //获取表单数据 User user = new User(); try { BeanUtils.populate(user, request.getParameterMap()); user.setActiveCode(UUID.randomUUID().toString());//手动设置激活码 UserService us = new UserService(); //调用业务逻辑 us.regist(user); //分发转向 //要求用户激活后才能登陆,所以不能把用户信息保存到session中 // request.getSession().setAttribute("user", user);//把用户信息封装到session对象中 request.getRequestDispatcher("/registersuccess.jsp").forward(request, response); } catch (UserException e) { // e.printStackTrace(); request.setAttribute("user_msg",e.getMessage()); request.getRequestDispatcher("/register.jsp").forward(request, response); return; } catch (Exception e) { e.printStackTrace(); } } public void logout(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.getSession().invalidate();//使session销毁 response.sendRedirect(request.getContextPath() + "/index.jsp"); } public void findUserById(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String id = request.getParameter("id"); UserService us = new UserService(); try { User user = us.findUserById(id); request.setAttribute("u",user); request.getRequestDispatcher("/modifyuserinfo.jsp").forward(request, response); } catch (UserException e) { e.printStackTrace(); // response.getWriter().write(e.getMessage()); response.sendRedirect(request.getContextPath() + "/login.jsp"); } } public void modifyUserServlet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { //封装表单数据 User user = new User(); try { BeanUtils.populate(user, request.getParameterMap()); UserService us = new UserService(); us.modifyUser(user); //成功 request.getSession().invalidate();//注销用户 response.sendRedirect(request.getContextPath() + "/modifyUserInfoSuccess.jsp"); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } catch (UserException e) { e.printStackTrace(); response.getWriter().write(e.getMessage()); } } }
4,347
0.706124
0.706124
130
29.776922
25.309855
93
false
false
0
0
0
0
0
0
2.730769
false
false
3
6f31743f566d4af713274bf4138c54c99f90f797
23,983,097,448,150
e480ed68929d6ba31955ef704a7028df76cdc8e5
/src/test/java/org/mgilgar/horseracing/PlayerTest.java
d9218ffdd8131241e24bba5201c6572e66ac60d7
[]
no_license
mgilgar/horseracing
https://github.com/mgilgar/horseracing
7bb6d2f282ca8c557417239705afc62ae86e470c
92f8f7d98443330f7e9273dafc177f3ffe5a24bb
refs/heads/master
2020-05-31T16:24:17.934000
2014-09-20T09:08:47
2014-09-20T09:08:47
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package org.mgilgar.horseracing; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class PlayerTest { private static final int ONE_FURLONG = 220; Player player1; Player player2; @Before public void setUp() { player1 = new Player(1, "HORSE1"); player1.addDistance(5); player2 = new Player(2, "HORSE2"); } @Test public void addDistanceShouldStopWhenReachingOneFurlong() { player1.addDistance(240); Assert.assertEquals(player1.getDistance(), ONE_FURLONG); } @Test public void compareToShouldReturn1IsPlayer1DistanceIsMoreThanPlayers2() { Assert.assertTrue(player1.compareTo(player2) == 1); } @Test public void compareToShouldReturn0IsPlayer1DistanceIsEqualsToPlayers2() { player2.addDistance(5); Assert.assertTrue(player1.compareTo(player2) == 0); } @Test public void compareToShouldReturnMinus1IsPlayer1DistanceIsLessThanPlayers2() { player2.addDistance(10); Assert.assertTrue(player1.compareTo(player2) == -1); } }
UTF-8
Java
996
java
PlayerTest.java
Java
[ { "context": "\tpublic void setUp() {\n\t\tplayer1 = new Player(1, \"HORSE1\");\n\t\tplayer1.addDistance(5);\n\t\tplayer2 = new Play", "end": 283, "score": 0.44672736525535583, "start": 277, "tag": "NAME", "value": "HORSE1" }, { "context": "layer1.addDistance(5);\n\t\tplayer2 = new Player(2, \"HORSE2\");\n\t}\n\t\n\t@Test\n\tpublic void addDistanceShouldS", "end": 343, "score": 0.529728889465332, "start": 340, "tag": "NAME", "value": "HOR" }, { "context": "1.addDistance(5);\n\t\tplayer2 = new Player(2, \"HORSE2\");\n\t}\n\t\n\t@Test\n\tpublic void addDistanceShouldStop", "end": 346, "score": 0.4676874577999115, "start": 345, "tag": "NAME", "value": "2" } ]
null
[]
package org.mgilgar.horseracing; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class PlayerTest { private static final int ONE_FURLONG = 220; Player player1; Player player2; @Before public void setUp() { player1 = new Player(1, "HORSE1"); player1.addDistance(5); player2 = new Player(2, "HORSE2"); } @Test public void addDistanceShouldStopWhenReachingOneFurlong() { player1.addDistance(240); Assert.assertEquals(player1.getDistance(), ONE_FURLONG); } @Test public void compareToShouldReturn1IsPlayer1DistanceIsMoreThanPlayers2() { Assert.assertTrue(player1.compareTo(player2) == 1); } @Test public void compareToShouldReturn0IsPlayer1DistanceIsEqualsToPlayers2() { player2.addDistance(5); Assert.assertTrue(player1.compareTo(player2) == 0); } @Test public void compareToShouldReturnMinus1IsPlayer1DistanceIsLessThanPlayers2() { player2.addDistance(10); Assert.assertTrue(player1.compareTo(player2) == -1); } }
996
0.757028
0.715863
43
22.16279
23.261837
79
false
false
0
0
0
0
0
0
1.465116
false
false
3
05ecd845540bd64f186389fe9a1474815c342845
3,745,211,498,445
ba69c9b5de2ef71ff1288fc0752106207a4aeeb1
/src/main/java/sckm/com/jcbj/sgp/web/TareaBean.java
5f69a86736825ff4c4de6a26e0167428599e93b6
[]
no_license
JuanCB99/ProyectoGestionProyectos
https://github.com/JuanCB99/ProyectoGestionProyectos
d47c795e2f1a0b62d11f0bfe98fad71fd9d44fd6
9cdfdce5618b912828dc24cca8f09c550d27f083
refs/heads/master
2023-07-03T13:25:37.219000
2021-08-10T19:49:21
2021-08-10T19:49:21
390,885,124
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 sckm.com.jcbj.sgp.web; import java.io.Serializable; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.annotation.PostConstruct; import javax.faces.application.FacesMessage; import javax.faces.context.FacesContext; import javax.faces.view.ViewScoped; import javax.inject.Inject; import javax.inject.Named; import sckm.com.jcbj.sgp.domain.Fases; import sckm.com.jcbj.sgp.domain.Tareas; import sckm.com.jcbj.sgp.servicio.TareaService; /** * * @author Juan */ @Named("tareaBean") @ViewScoped public class TareaBean implements Serializable { @Inject TareaService tareaService; @Inject FaseBean faseBean; private String idFase; private List<Tareas> tareasList; private Tareas tareaSeleccionada; private List<Fases> fasesListRecuperada; private Map<String, Fases> fasesMap; private Fases faseSeleccionada; @PostConstruct public void inicializar() { this.faseSeleccionada = new Fases(); this.tareaSeleccionada = new Tareas(); } public String getIdFase() { return idFase; } public void setIdFase(String idFase) { this.idFase = idFase; } public List<Tareas> getTareasList() { return tareasList; } public void setTareasList(List<Tareas> tareasList) { this.tareasList = tareasList; } public Tareas getTareaSeleccionada() { return tareaSeleccionada; } public void setTareaSeleccionada(Tareas tareaSeleccionada) { this.tareaSeleccionada = tareaSeleccionada; } public List<Fases> getFasesListRecuperada() { return fasesListRecuperada; } public void setFasesListRecuperada(List<Fases> fasesListRecuperada) { this.fasesListRecuperada = fasesListRecuperada; } public Map<String, Fases> getFasesMap() { return fasesMap; } public void setFasesMap(Map<String, Fases> fasesMap) { this.fasesMap = fasesMap; } public Fases getFaseSeleccionada() { return faseSeleccionada; } public void setFaseSeleccionada(Fases faseSeleccionada) { this.faseSeleccionada = faseSeleccionada; } //este metodo se llama atraves de AJAX para actualizar las fases que se muestran respecto al proyecto que selecciona el usuario //y trae el valor almacenado en el Map mediante el iD y lo guarda rn la variable proyectoSeleccionado,despues llama al metodo listar FasesByProyectoId public void onProyectoChange() { //se llama al metodo que recupera las fases apartir del proyecto seleccioando faseBean.onProyectoChange(); listFasesByProyectoId(); this.tareasList = null; } public void onFaseChange() { //se llama al metodo que recupera las fases apartir del proyecto seleccioando System.out.println("ENTRANDO AL METODO DE AJAX:"); if (this.idFase != null && !this.idFase.equals("")) { this.faseSeleccionada = this.fasesMap.get(this.idFase); System.out.println("FASE ENVIADA POR AJAX: " + this.faseSeleccionada); listTareasByFaseId(); } else { this.faseSeleccionada = null; this.tareasList = null; } } //se recupera la lista de fases y se agrega a un Map para poder usarla despues public void listFasesByProyectoId() { this.fasesListRecuperada = (List<Fases>) FacesContext.getCurrentInstance(). getExternalContext().getSessionMap().get("fasesList"); //Se crea una variable de tipo Map para poder guardar cada objeto fase con una llave que es el ID respectivo de esa fase this.fasesMap = new HashMap<>(); for (Fases fase : this.fasesListRecuperada) { this.fasesMap.put(Integer.toString(fase.getFaseId()), fase); } } public void listTareasByFaseId() { this.tareasList = this.tareaService.findTareasByIdFase(faseSeleccionada); FacesContext.getCurrentInstance().getExternalContext() .getSessionMap().put("tareasList", this.tareasList); } public void insertarTarea() { try { this.tareaSeleccionada.setTareaFaseId(faseSeleccionada); System.out.println("TAREA PARA GUARDAR: " + this.tareaSeleccionada); this.tareaService.insertTarea(tareaSeleccionada); this.tareasList.add(this.tareaSeleccionada); this.tareaSeleccionada = new Tareas(); //Se manda un mensaje para notificar al usuario que la tarea se asigno con exito FacesContext.getCurrentInstance(). addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Guardado: Se asigno la tarea a la fase con exito!!", "")); } catch (Exception e) { e.printStackTrace(System.out); FacesContext.getCurrentInstance(). addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Error: No se pudo guardar la informacion", "" + e)); } } public void editarTarea() { this.tareaSeleccionada.setTareaFaseId(this.faseSeleccionada); this.tareaService.updateTarea(this.tareaSeleccionada); this.tareasList.remove(this.tareaSeleccionada); this.tareasList.add(this.tareaSeleccionada); this.tareaSeleccionada = null; FacesContext.getCurrentInstance(). addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Actualizado: Se edito la tarea con exito!!", "")); } public void eliminarTarea(){ this.tareaService.deleteTarea(this.tareaSeleccionada); this.tareasList.remove(this.tareaSeleccionada); this.tareaSeleccionada = null; FacesContext.getCurrentInstance(). addMessage(null, new FacesMessage(FacesMessage.SEVERITY_WARN, "Eliminado: Se elimino la tarea con exito!!", "")); } }
UTF-8
Java
6,118
java
TareaBean.java
Java
[ { "context": "jcbj.sgp.servicio.TareaService;\n\n/**\n *\n * @author Juan\n */\n@Named(\"tareaBean\")\n@ViewScoped\npublic class ", "end": 683, "score": 0.9996352195739746, "start": 679, "tag": "NAME", "value": "Juan" } ]
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 sckm.com.jcbj.sgp.web; import java.io.Serializable; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.annotation.PostConstruct; import javax.faces.application.FacesMessage; import javax.faces.context.FacesContext; import javax.faces.view.ViewScoped; import javax.inject.Inject; import javax.inject.Named; import sckm.com.jcbj.sgp.domain.Fases; import sckm.com.jcbj.sgp.domain.Tareas; import sckm.com.jcbj.sgp.servicio.TareaService; /** * * @author Juan */ @Named("tareaBean") @ViewScoped public class TareaBean implements Serializable { @Inject TareaService tareaService; @Inject FaseBean faseBean; private String idFase; private List<Tareas> tareasList; private Tareas tareaSeleccionada; private List<Fases> fasesListRecuperada; private Map<String, Fases> fasesMap; private Fases faseSeleccionada; @PostConstruct public void inicializar() { this.faseSeleccionada = new Fases(); this.tareaSeleccionada = new Tareas(); } public String getIdFase() { return idFase; } public void setIdFase(String idFase) { this.idFase = idFase; } public List<Tareas> getTareasList() { return tareasList; } public void setTareasList(List<Tareas> tareasList) { this.tareasList = tareasList; } public Tareas getTareaSeleccionada() { return tareaSeleccionada; } public void setTareaSeleccionada(Tareas tareaSeleccionada) { this.tareaSeleccionada = tareaSeleccionada; } public List<Fases> getFasesListRecuperada() { return fasesListRecuperada; } public void setFasesListRecuperada(List<Fases> fasesListRecuperada) { this.fasesListRecuperada = fasesListRecuperada; } public Map<String, Fases> getFasesMap() { return fasesMap; } public void setFasesMap(Map<String, Fases> fasesMap) { this.fasesMap = fasesMap; } public Fases getFaseSeleccionada() { return faseSeleccionada; } public void setFaseSeleccionada(Fases faseSeleccionada) { this.faseSeleccionada = faseSeleccionada; } //este metodo se llama atraves de AJAX para actualizar las fases que se muestran respecto al proyecto que selecciona el usuario //y trae el valor almacenado en el Map mediante el iD y lo guarda rn la variable proyectoSeleccionado,despues llama al metodo listar FasesByProyectoId public void onProyectoChange() { //se llama al metodo que recupera las fases apartir del proyecto seleccioando faseBean.onProyectoChange(); listFasesByProyectoId(); this.tareasList = null; } public void onFaseChange() { //se llama al metodo que recupera las fases apartir del proyecto seleccioando System.out.println("ENTRANDO AL METODO DE AJAX:"); if (this.idFase != null && !this.idFase.equals("")) { this.faseSeleccionada = this.fasesMap.get(this.idFase); System.out.println("FASE ENVIADA POR AJAX: " + this.faseSeleccionada); listTareasByFaseId(); } else { this.faseSeleccionada = null; this.tareasList = null; } } //se recupera la lista de fases y se agrega a un Map para poder usarla despues public void listFasesByProyectoId() { this.fasesListRecuperada = (List<Fases>) FacesContext.getCurrentInstance(). getExternalContext().getSessionMap().get("fasesList"); //Se crea una variable de tipo Map para poder guardar cada objeto fase con una llave que es el ID respectivo de esa fase this.fasesMap = new HashMap<>(); for (Fases fase : this.fasesListRecuperada) { this.fasesMap.put(Integer.toString(fase.getFaseId()), fase); } } public void listTareasByFaseId() { this.tareasList = this.tareaService.findTareasByIdFase(faseSeleccionada); FacesContext.getCurrentInstance().getExternalContext() .getSessionMap().put("tareasList", this.tareasList); } public void insertarTarea() { try { this.tareaSeleccionada.setTareaFaseId(faseSeleccionada); System.out.println("TAREA PARA GUARDAR: " + this.tareaSeleccionada); this.tareaService.insertTarea(tareaSeleccionada); this.tareasList.add(this.tareaSeleccionada); this.tareaSeleccionada = new Tareas(); //Se manda un mensaje para notificar al usuario que la tarea se asigno con exito FacesContext.getCurrentInstance(). addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Guardado: Se asigno la tarea a la fase con exito!!", "")); } catch (Exception e) { e.printStackTrace(System.out); FacesContext.getCurrentInstance(). addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Error: No se pudo guardar la informacion", "" + e)); } } public void editarTarea() { this.tareaSeleccionada.setTareaFaseId(this.faseSeleccionada); this.tareaService.updateTarea(this.tareaSeleccionada); this.tareasList.remove(this.tareaSeleccionada); this.tareasList.add(this.tareaSeleccionada); this.tareaSeleccionada = null; FacesContext.getCurrentInstance(). addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Actualizado: Se edito la tarea con exito!!", "")); } public void eliminarTarea(){ this.tareaService.deleteTarea(this.tareaSeleccionada); this.tareasList.remove(this.tareaSeleccionada); this.tareaSeleccionada = null; FacesContext.getCurrentInstance(). addMessage(null, new FacesMessage(FacesMessage.SEVERITY_WARN, "Eliminado: Se elimino la tarea con exito!!", "")); } }
6,118
0.673913
0.673913
197
30.055838
32.013195
154
false
false
0
0
0
0
0
0
0.451777
false
false
3
c840275aede0af82cb135208bc5557f6925130bd
34,282,428,961,085
e065bc51b0cc71c1b30316e931625449111ed6be
/app/src/main/java/net/solvetheriddle/sopoker/app/profile/ProfileActivity.java
17eb4e04ebb486427ac8eabd523a385d5861e5ba
[]
no_license
anoniim/SOPoker
https://github.com/anoniim/SOPoker
183d43b93ca54aa43be8fcb70e0d04e6c633235b
9f0c721d0899d428f5223a6d9c1c81ad70d9699c
refs/heads/master
2021-01-20T08:54:14.478000
2018-04-13T23:23:25
2018-04-13T23:23:25
89,874,906
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package net.solvetheriddle.sopoker.app.profile; import android.arch.lifecycle.ViewModelProviders; import android.content.Intent; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.ImageView; import android.widget.TextView; import com.squareup.picasso.Picasso; import net.solvetheriddle.sopoker.R; import net.solvetheriddle.sopoker.app.auth.AuthenticationActivity; import net.solvetheriddle.sopoker.app.settings.SettingsActivity; import net.solvetheriddle.sopoker.network.model.AccessToken; import net.solvetheriddle.sopoker.network.model.User; import javax.inject.Inject; import butterknife.BindView; import butterknife.ButterKnife; import dagger.android.AndroidInjection; import io.reactivex.disposables.Disposable; public class ProfileActivity extends AppCompatActivity { private static final String TAG = ProfileActivity.class.getCanonicalName(); public static final int REQUEST_AUTHENTICATE = 100; @BindView(R.id.toolbar) Toolbar mToolbar; @BindView(R.id.profile_image) ImageView mProfileImage; @BindView(R.id.username_text) TextView mUsername; @BindView(R.id.reputation_text) TextView mReputationText; @BindView(R.id.history_title) TextView mHistoryTitle; @BindView(R.id.attempt_history_view) RecyclerView mHistoryView; @BindView(R.id.poke_fab) View mFab; @BindView(android.R.id.content) View mContentView; @Inject ProfilePresenter mProfilePresenter; @Inject ProfilePresenter.Factory mProfileViewModelFactory; private AttemptHistoryAdapter mAttemptHistoryAdapter; private Disposable mAllAttemptsSubscription; @Override public void onCreate(@Nullable final Bundle savedInstanceState) { AndroidInjection.inject(this); super.onCreate(savedInstanceState); // SoPokerApp application = (SoPokerApp) getApplication(); // DaggerProfileScreenComponent.builder() // .appComponent(application.getAppComponent()) // .profileScreenModule(new ProfileScreenModule(this)) // .build() // .inject(this); setContentView(R.layout.activity_profile); ButterKnife.bind(this); setSupportActionBar(mToolbar); initHistoryView(); mProfilePresenter = ViewModelProviders.of(this, mProfileViewModelFactory) .get(ProfilePresenter.class); setDataObservers(); mFab.setOnClickListener(view -> mProfilePresenter.schedulePoking()); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { startActivity(SettingsActivity.getCallingIntent(this)); return true; } return super.onOptionsItemSelected(item); } @Override protected void onActivityResult(final int requestCode, final int resultCode, final Intent data) { if (requestCode == REQUEST_AUTHENTICATE && resultCode == RESULT_OK) { final AccessToken accessToken = data .getParcelableExtra(AuthenticationActivity.EXTRA_AUTH_TOKEN); mProfilePresenter.authenticationSuccessful(accessToken); } else { // mLoginButton.setEnabled(true); } } @Override protected void onDestroy() { mAllAttemptsSubscription.dispose(); super.onDestroy(); } private void startAuthenticationActivity() { startActivityForResult(AuthenticationActivity.getStartingIntent(this, mProfilePresenter.getLoginUrl()), REQUEST_AUTHENTICATE); } private void showAuthenticationError() { Snackbar.make(mContentView, "Please sign in", Snackbar.LENGTH_LONG) .setAction("SIGN IN", v -> startAuthenticationActivity()) .show(); } private void showProfile(final User profile) { Picasso.with(this) .load(profile.getProfileImage()) .into(mProfileImage); mUsername.setText(profile.getDisplayName()); mReputationText.setText(String.format(getString(R.string.reputation), profile.getReputation(), profile.getBadgeCounts().getGold(), profile.getBadgeCounts().getSilver(), profile.getBadgeCounts().getBronze())); } private void showError(final String message) { Snackbar.make(mContentView, message, Snackbar.LENGTH_LONG).show(); } private void initHistoryView() { mAttemptHistoryAdapter = new AttemptHistoryAdapter(this); mHistoryView.setAdapter(mAttemptHistoryAdapter); mHistoryView.setLayoutManager(new LinearLayoutManager(this)); } private void setDataObservers() { mAllAttemptsSubscription = mProfilePresenter.getLatestProfile() .subscribe( response -> { Log.i(TAG, "Profile loaded"); showProfile(response); }, throwable -> { Log.i(TAG, "Profile load failed"); if (throwable instanceof IllegalAccessException) { showAuthenticationError(); } else { showError(throwable.getMessage()); } }); mProfilePresenter.getAllAttempts() .observe(this, attempts -> { if (attempts != null && !attempts.isEmpty()) { mAttemptHistoryAdapter.setAttempts(attempts); mHistoryTitle.setText(String.format(getString(R.string.history_and_count), attempts.size())); } else { mHistoryTitle.setText("No attempts have been made yet"); } }); } }
UTF-8
Java
6,487
java
ProfileActivity.java
Java
[]
null
[]
package net.solvetheriddle.sopoker.app.profile; import android.arch.lifecycle.ViewModelProviders; import android.content.Intent; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.ImageView; import android.widget.TextView; import com.squareup.picasso.Picasso; import net.solvetheriddle.sopoker.R; import net.solvetheriddle.sopoker.app.auth.AuthenticationActivity; import net.solvetheriddle.sopoker.app.settings.SettingsActivity; import net.solvetheriddle.sopoker.network.model.AccessToken; import net.solvetheriddle.sopoker.network.model.User; import javax.inject.Inject; import butterknife.BindView; import butterknife.ButterKnife; import dagger.android.AndroidInjection; import io.reactivex.disposables.Disposable; public class ProfileActivity extends AppCompatActivity { private static final String TAG = ProfileActivity.class.getCanonicalName(); public static final int REQUEST_AUTHENTICATE = 100; @BindView(R.id.toolbar) Toolbar mToolbar; @BindView(R.id.profile_image) ImageView mProfileImage; @BindView(R.id.username_text) TextView mUsername; @BindView(R.id.reputation_text) TextView mReputationText; @BindView(R.id.history_title) TextView mHistoryTitle; @BindView(R.id.attempt_history_view) RecyclerView mHistoryView; @BindView(R.id.poke_fab) View mFab; @BindView(android.R.id.content) View mContentView; @Inject ProfilePresenter mProfilePresenter; @Inject ProfilePresenter.Factory mProfileViewModelFactory; private AttemptHistoryAdapter mAttemptHistoryAdapter; private Disposable mAllAttemptsSubscription; @Override public void onCreate(@Nullable final Bundle savedInstanceState) { AndroidInjection.inject(this); super.onCreate(savedInstanceState); // SoPokerApp application = (SoPokerApp) getApplication(); // DaggerProfileScreenComponent.builder() // .appComponent(application.getAppComponent()) // .profileScreenModule(new ProfileScreenModule(this)) // .build() // .inject(this); setContentView(R.layout.activity_profile); ButterKnife.bind(this); setSupportActionBar(mToolbar); initHistoryView(); mProfilePresenter = ViewModelProviders.of(this, mProfileViewModelFactory) .get(ProfilePresenter.class); setDataObservers(); mFab.setOnClickListener(view -> mProfilePresenter.schedulePoking()); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { startActivity(SettingsActivity.getCallingIntent(this)); return true; } return super.onOptionsItemSelected(item); } @Override protected void onActivityResult(final int requestCode, final int resultCode, final Intent data) { if (requestCode == REQUEST_AUTHENTICATE && resultCode == RESULT_OK) { final AccessToken accessToken = data .getParcelableExtra(AuthenticationActivity.EXTRA_AUTH_TOKEN); mProfilePresenter.authenticationSuccessful(accessToken); } else { // mLoginButton.setEnabled(true); } } @Override protected void onDestroy() { mAllAttemptsSubscription.dispose(); super.onDestroy(); } private void startAuthenticationActivity() { startActivityForResult(AuthenticationActivity.getStartingIntent(this, mProfilePresenter.getLoginUrl()), REQUEST_AUTHENTICATE); } private void showAuthenticationError() { Snackbar.make(mContentView, "Please sign in", Snackbar.LENGTH_LONG) .setAction("SIGN IN", v -> startAuthenticationActivity()) .show(); } private void showProfile(final User profile) { Picasso.with(this) .load(profile.getProfileImage()) .into(mProfileImage); mUsername.setText(profile.getDisplayName()); mReputationText.setText(String.format(getString(R.string.reputation), profile.getReputation(), profile.getBadgeCounts().getGold(), profile.getBadgeCounts().getSilver(), profile.getBadgeCounts().getBronze())); } private void showError(final String message) { Snackbar.make(mContentView, message, Snackbar.LENGTH_LONG).show(); } private void initHistoryView() { mAttemptHistoryAdapter = new AttemptHistoryAdapter(this); mHistoryView.setAdapter(mAttemptHistoryAdapter); mHistoryView.setLayoutManager(new LinearLayoutManager(this)); } private void setDataObservers() { mAllAttemptsSubscription = mProfilePresenter.getLatestProfile() .subscribe( response -> { Log.i(TAG, "Profile loaded"); showProfile(response); }, throwable -> { Log.i(TAG, "Profile load failed"); if (throwable instanceof IllegalAccessException) { showAuthenticationError(); } else { showError(throwable.getMessage()); } }); mProfilePresenter.getAllAttempts() .observe(this, attempts -> { if (attempts != null && !attempts.isEmpty()) { mAttemptHistoryAdapter.setAttempts(attempts); mHistoryTitle.setText(String.format(getString(R.string.history_and_count), attempts.size())); } else { mHistoryTitle.setText("No attempts have been made yet"); } }); } }
6,487
0.65269
0.651611
176
35.857956
25.898561
117
false
false
0
0
0
0
0
0
0.579545
false
false
3
4e0e897b5b87d4c2edfdf07de52197b465b61b63
22,058,952,066,659
31e1671dfefc9731ca8890dc3329ae1c8fb122ca
/compressor_huffman/src/outros/Codigo.java
e926c3c7d7aa07f68ff09638ad5362d05f7fb355
[]
no_license
israeltduarte/compressor_huffman
https://github.com/israeltduarte/compressor_huffman
649290cc7b657634d6bf67ea3570bcb96a790b62
7688fee3d865e547f82a73d3b5ceeb4c21be929a
refs/heads/master
2020-09-09T23:09:54.663000
2019-11-14T02:19:21
2019-11-14T02:19:21
221,592,657
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package outros; public class Codigo { public Codigo(Character caracter, String codigo) { this.caracter = caracter; this.codigo = codigo; } private Character caracter; private String codigo; public Character getNome() { return caracter; } public void setNome(Character caracter) { this.caracter = caracter; } public String getCodigo() { return codigo; } public void setCodigo(String codigo) { this.codigo = codigo; } @Override public String toString() { return "[" + caracter + ", " + codigo + "]"; } }
UTF-8
Java
539
java
Codigo.java
Java
[]
null
[]
package outros; public class Codigo { public Codigo(Character caracter, String codigo) { this.caracter = caracter; this.codigo = codigo; } private Character caracter; private String codigo; public Character getNome() { return caracter; } public void setNome(Character caracter) { this.caracter = caracter; } public String getCodigo() { return codigo; } public void setCodigo(String codigo) { this.codigo = codigo; } @Override public String toString() { return "[" + caracter + ", " + codigo + "]"; } }
539
0.682746
0.682746
33
15.333333
15.371494
51
false
false
0
0
0
0
0
0
1.242424
false
false
3
c264adf867204a3293f0ec00da95483484573cf5
33,861,522,181,493
dccaa4c2c0ff7592c8f405109e4986bed2eb31de
/src/main/java/test/MyService1.java
c071078a90923751a93069582fefb2ce043ada97
[]
no_license
liu9187/testspark
https://github.com/liu9187/testspark
ca7cd0faf1a5601ab876634851092aa0bed152cb
6f49272768ccbaf18b7610e99d15ce1a2e83be21
refs/heads/master
2020-05-03T18:47:34.794000
2019-04-01T02:29:33
2019-04-01T02:29:33
178,771,162
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package test; import java.util.concurrent.BrokenBarrierException; import java.util.concurrent.CyclicBarrier; public class MyService1 { private CyclicBarrier cyclicBarrier; public MyService1(CyclicBarrier cyclicBarrier) { this.cyclicBarrier = cyclicBarrier; } private void begin(int count){ try { System.out.println(Thread.currentThread().getName()+"到了 在等待其他人都到了再开始跑"); if (Thread.currentThread().getName().equals("Thread-2")){ System.out.println("thread-2 进来了"); Thread.sleep(5000); //Integer.parseInt("a"); Thread.currentThread().interrupt(); } cyclicBarrier.await(); System.out.println("都到了开始跑"); System.out.println(Thread.currentThread().getName()+"到达终点并结束第"+count+"赛段"); } catch (InterruptedException e) { System.out.println("进入 InterruptedException"+cyclicBarrier.isBroken()); e.printStackTrace(); } catch (BrokenBarrierException e) { System.out.println("进入 BrokenBarrierException"+cyclicBarrier.isBroken()); e.printStackTrace(); } } public void test(){ for (int i=0;i<1;i++){ begin(i+1); } } }
UTF-8
Java
1,427
java
MyService1.java
Java
[]
null
[]
package test; import java.util.concurrent.BrokenBarrierException; import java.util.concurrent.CyclicBarrier; public class MyService1 { private CyclicBarrier cyclicBarrier; public MyService1(CyclicBarrier cyclicBarrier) { this.cyclicBarrier = cyclicBarrier; } private void begin(int count){ try { System.out.println(Thread.currentThread().getName()+"到了 在等待其他人都到了再开始跑"); if (Thread.currentThread().getName().equals("Thread-2")){ System.out.println("thread-2 进来了"); Thread.sleep(5000); //Integer.parseInt("a"); Thread.currentThread().interrupt(); } cyclicBarrier.await(); System.out.println("都到了开始跑"); System.out.println(Thread.currentThread().getName()+"到达终点并结束第"+count+"赛段"); } catch (InterruptedException e) { System.out.println("进入 InterruptedException"+cyclicBarrier.isBroken()); e.printStackTrace(); } catch (BrokenBarrierException e) { System.out.println("进入 BrokenBarrierException"+cyclicBarrier.isBroken()); e.printStackTrace(); } } public void test(){ for (int i=0;i<1;i++){ begin(i+1); } } }
1,427
0.566247
0.558105
38
34.552631
26.321592
91
false
false
0
0
0
0
0
0
0.526316
false
false
3
f5b87b6bcaaa29c0b223cad666aaabdacbc482e2
22,505,628,681,223
aef17d404b857d2550ab34017a2647560660db6a
/src/main/java/org/demo/model/CoreBase.java
0f51393a988391f930ff685c4458c99e7cca26fb
[]
no_license
ChenJianzhao/springDemo
https://github.com/ChenJianzhao/springDemo
aa75cc4d4de1e00fdf0b8c787f8271f73dc1a61e
034906803511a50517f1f92b02ec1b61d5fd1a00
refs/heads/master
2021-01-19T19:38:03.976000
2017-10-28T09:28:53
2017-10-28T09:28:53
88,430,974
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package org.demo.model; import org.hibernate.annotations.GenericGenerator; import javax.persistence.*; import java.io.Serializable; import java.util.UUID; /** * Created by jzchen on 2017/1/11 0011. */ @MappedSuperclass public class CoreBase implements Serializable{ private Integer id = null; @Id @GeneratedValue(strategy= GenerationType.AUTO) // @GeneratedValue(generator = "system-uuid") // @GenericGenerator(name = "system-uuid", strategy = "uuid") @Column(name = "id", unique = true, nullable = false) public Integer getId() { // if(id == null) { // id = UUID.randomUUID().toString().replace("-",""); // } return id; } public void setId(Integer id) { this.id = id; } }
UTF-8
Java
761
java
CoreBase.java
Java
[ { "context": "lizable;\nimport java.util.UUID;\n\n/**\n * Created by jzchen on 2017/1/11 0011.\n */\n@MappedSuperclass\npublic c", "end": 182, "score": 0.9996864199638367, "start": 176, "tag": "USERNAME", "value": "jzchen" } ]
null
[]
package org.demo.model; import org.hibernate.annotations.GenericGenerator; import javax.persistence.*; import java.io.Serializable; import java.util.UUID; /** * Created by jzchen on 2017/1/11 0011. */ @MappedSuperclass public class CoreBase implements Serializable{ private Integer id = null; @Id @GeneratedValue(strategy= GenerationType.AUTO) // @GeneratedValue(generator = "system-uuid") // @GenericGenerator(name = "system-uuid", strategy = "uuid") @Column(name = "id", unique = true, nullable = false) public Integer getId() { // if(id == null) { // id = UUID.randomUUID().toString().replace("-",""); // } return id; } public void setId(Integer id) { this.id = id; } }
761
0.633377
0.618922
33
22.060606
20.394503
64
false
false
0
0
0
0
0
0
0.393939
false
false
3
d7c15e283c85f8b35a58a4db587ebef54224b139
34,583,076,685,865
f7a55176523101c78da76ddb380eb7dc11bc19a1
/src/main/java/ru/itis/blog/controllers/PostController.java
460ff5f68bb19146fbbc0b964aff8aeef2cfb8b4
[]
no_license
Corner18/Blog
https://github.com/Corner18/Blog
b1579cba6ea6a6ac5d6bf9b3e0edecb752396a7e
fead2d625b2246aac7811133f873d5dd3c3ee891
refs/heads/master
2022-12-22T12:46:19.978000
2020-05-17T12:39:55
2020-05-17T12:39:55
252,143,672
0
0
null
false
2022-12-16T15:29:17
2020-04-01T10:31:03
2020-05-17T12:40:16
2022-12-16T15:29:15
637
0
0
7
Java
false
false
package ru.itis.blog.controllers; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.servlet.ModelAndView; import ru.itis.blog.dto.CommentDto; import ru.itis.blog.dto.LikeDto; import ru.itis.blog.models.User; import ru.itis.blog.security.details.UserDetailsImpl; import ru.itis.blog.services.CommentService; import ru.itis.blog.services.FileStorageService; import ru.itis.blog.services.PostService; import ru.itis.blog.services.UsersService; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import java.util.HashMap; import java.util.Map; @Controller public class PostController { @Autowired private PostService postService; @Autowired private UsersService usersService; @Autowired private CommentService commentService; @PreAuthorize("isAuthenticated()") @GetMapping("/post/{post_id}") public String getPostPage(@PathVariable("post_id") Long post_id, Authentication authentication, Model model) { UserDetailsImpl userDetails = (UserDetailsImpl) authentication.getPrincipal(); model.addAttribute("comments", commentService.userComment(post_id)); model.addAttribute("user", userDetails.getUser()); model.addAttribute("post", postService.getOne(post_id)); return "post"; } }
UTF-8
Java
1,803
java
PostController.java
Java
[]
null
[]
package ru.itis.blog.controllers; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.servlet.ModelAndView; import ru.itis.blog.dto.CommentDto; import ru.itis.blog.dto.LikeDto; import ru.itis.blog.models.User; import ru.itis.blog.security.details.UserDetailsImpl; import ru.itis.blog.services.CommentService; import ru.itis.blog.services.FileStorageService; import ru.itis.blog.services.PostService; import ru.itis.blog.services.UsersService; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import java.util.HashMap; import java.util.Map; @Controller public class PostController { @Autowired private PostService postService; @Autowired private UsersService usersService; @Autowired private CommentService commentService; @PreAuthorize("isAuthenticated()") @GetMapping("/post/{post_id}") public String getPostPage(@PathVariable("post_id") Long post_id, Authentication authentication, Model model) { UserDetailsImpl userDetails = (UserDetailsImpl) authentication.getPrincipal(); model.addAttribute("comments", commentService.userComment(post_id)); model.addAttribute("user", userDetails.getUser()); model.addAttribute("post", postService.getOne(post_id)); return "post"; } }
1,803
0.792568
0.792568
51
34.35294
26.181736
114
false
false
0
0
0
0
0
0
0.705882
false
false
3
3f9bf8df46d53fd6b9d46d78f5f065dfa974b229
13,597,866,493,418
ba74038a0d3a24d93e6dbd1f166530f8cb1dd641
/teamclock/src/legacy/com/fivesticks/time/ebay/setup/boxes/BoxServiceDelegateImpl.java
846b63f12c8ef02c5f89924a1832f4d30b3a1878
[]
no_license
ReidCarlberg/teamclock
https://github.com/ReidCarlberg/teamclock
63ce1058c62c0a00d63a429bac275c4888ada79a
4ac078610be86cf0902a73b1ba2a697f9dcf4e3c
refs/heads/master
2016-09-05T23:46:28.600000
2009-09-18T07:25:37
2009-09-18T07:25:37
32,190,901
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * Created on May 10, 2005 by Reid */ package com.fivesticks.time.ebay.setup.boxes; import java.util.Collection; import com.fivesticks.time.common.AbstractServiceDelegate; import com.fivesticks.time.common.AbstractServiceDelegateException; /** * @author Reid */ public class BoxServiceDelegateImpl extends AbstractServiceDelegate implements BoxServiceDelegate { // private SystemOwner systemOwner; // // private OwnerKeyValidatorAndDecorator ownerKeyValidatorAndDecorator; // // private BoxDAO boxDAO; /* * (non-Javadoc) * * @see com.fivesticks.time.ebay.setup.BoxServiceDelegate#findLarger(java.lang.Integer, * java.lang.Integer, java.lang.Integer) */ public Collection findLarger(Integer length, Integer width, Integer height) throws BoxServiceDelegateException { BoxCriteriaParameters filter = BoxFilterBuilder.buildActiveLargerThan(length, width, height); return this.find(filter); } /* * (non-Javadoc) * * @see com.fivesticks.time.ebay.setup.BoxServiceDelegate#findLargerInstock(java.lang.Integer, * java.lang.Integer, java.lang.Integer) */ public Collection findLargerInstock(Integer length, Integer width, Integer height) throws BoxServiceDelegateException { BoxCriteriaParameters filter = BoxFilterBuilder.buildActiveInstockLargerThan( length, width, height); return this.find(filter); } /* * (non-Javadoc) * * @see com.fivesticks.time.ebay.setup.BoxServiceDelegate#find(com.fivesticks.time.ebay.setup.BoxFilter) */ public Collection find(BoxCriteriaParameters filter) throws BoxServiceDelegateException { try { this.handleDecorate(filter); } catch (AbstractServiceDelegateException e) { throw new BoxServiceDelegateException(e); } return this.getDao().find(filter); } /* * (non-Javadoc) * * @see com.fivesticks.time.ebay.setup.BoxServiceDelegate#getBox(java.lang.Long) */ public Box getBox(Long id) throws BoxServiceDelegateException { Box ret = (Box) this.getDao().get(id); if (ret != null) { try { this.handleValidate(ret); } catch (AbstractServiceDelegateException e) { throw new BoxServiceDelegateException(e); } } return ret; } /* * (non-Javadoc) * * @see com.fivesticks.time.ebay.setup.BoxServiceDelegate#delete(java.lang.Long) */ public void delete(Long id) throws BoxServiceDelegateException { Box box = this.getBox(id); this.delete(box); } /* * (non-Javadoc) * * @see com.fivesticks.time.ebay.setup.BoxServiceDelegate#delete(com.fivesticks.time.ebay.setup.Box) */ public void delete(Box box) throws BoxServiceDelegateException { try { this.handleValidate(box); } catch (AbstractServiceDelegateException e) { throw new BoxServiceDelegateException(e); } this.getDao().delete(box); } /* * (non-Javadoc) * * @see com.fivesticks.time.ebay.setup.BoxServiceDelegate#save(com.fivesticks.time.ebay.setup.Box) */ public void save(Box box) throws BoxServiceDelegateException { try { handleDecorate(box); } catch (AbstractServiceDelegateException e) { throw new BoxServiceDelegateException(e); } this.getDao().save(box); } // private void handleDecorate(SystemOwnerKeyAware target) throws BoxServiceDelegateException { // try { // this.getOwnerKeyValidatorAndDecorator().decorate(target, this.getSystemOwner()); // } catch (OwnerKeyValidatorAndDecoratorException e) { // throw new BoxServiceDelegateException(e); // } // } // // private void handleValidate(SystemOwnerKeyAware target) throws BoxServiceDelegateException { // try { // this.getOwnerKeyValidatorAndDecorator().validate(target, this.getSystemOwner()); // } catch (OwnerKeyValidatorAndDecoratorException e) { // throw new BoxServiceDelegateException(e); // } // } // /* // * (non-Javadoc) // * // * @see com.fivesticks.time.ebay.setup.BoxDAOAware#setBoxDAO(com.fivesticks.time.ebay.setup.BoxDAO) // */ // public void setBoxDAO(BoxDAO boxDAO) { // this.boxDAO = boxDAO; // } // // /** // * @return Returns the ownerKeyValidatorAndDecorator. // */ // public OwnerKeyValidatorAndDecorator getOwnerKeyValidatorAndDecorator() { // return ownerKeyValidatorAndDecorator; // } // // /** // * @param ownerKeyValidatorAndDecorator // * The ownerKeyValidatorAndDecorator to set. // */ // public void setOwnerKeyValidatorAndDecorator( // OwnerKeyValidatorAndDecorator ownerKeyValidatorAndDecorator) { // this.ownerKeyValidatorAndDecorator = ownerKeyValidatorAndDecorator; // } // // /** // * @return Returns the systemOwner. // */ // public SystemOwner getSystemOwner() { // return systemOwner; // } // // /** // * @param systemOwner // * The systemOwner to set. // */ // public void setSystemOwner(SystemOwner systemOwner) { // this.systemOwner = systemOwner; // } // // /** // * @return Returns the boxDAO. // */ // public BoxDAO getBoxDAO() { // return boxDAO; // } }
UTF-8
Java
5,769
java
BoxServiceDelegateImpl.java
Java
[ { "context": "/*\r\n * Created on May 10, 2005 by Reid\r\n */\r\npackage com.fivesticks.time.ebay.setup.boxe", "end": 38, "score": 0.999794065952301, "start": 34, "tag": "NAME", "value": "Reid" }, { "context": "stractServiceDelegateException;\r\n\r\n/**\r\n * @author Reid\r\n */\r\npublic class BoxServiceDelegateImpl extends", "end": 277, "score": 0.9997950792312622, "start": 273, "tag": "NAME", "value": "Reid" } ]
null
[]
/* * Created on May 10, 2005 by Reid */ package com.fivesticks.time.ebay.setup.boxes; import java.util.Collection; import com.fivesticks.time.common.AbstractServiceDelegate; import com.fivesticks.time.common.AbstractServiceDelegateException; /** * @author Reid */ public class BoxServiceDelegateImpl extends AbstractServiceDelegate implements BoxServiceDelegate { // private SystemOwner systemOwner; // // private OwnerKeyValidatorAndDecorator ownerKeyValidatorAndDecorator; // // private BoxDAO boxDAO; /* * (non-Javadoc) * * @see com.fivesticks.time.ebay.setup.BoxServiceDelegate#findLarger(java.lang.Integer, * java.lang.Integer, java.lang.Integer) */ public Collection findLarger(Integer length, Integer width, Integer height) throws BoxServiceDelegateException { BoxCriteriaParameters filter = BoxFilterBuilder.buildActiveLargerThan(length, width, height); return this.find(filter); } /* * (non-Javadoc) * * @see com.fivesticks.time.ebay.setup.BoxServiceDelegate#findLargerInstock(java.lang.Integer, * java.lang.Integer, java.lang.Integer) */ public Collection findLargerInstock(Integer length, Integer width, Integer height) throws BoxServiceDelegateException { BoxCriteriaParameters filter = BoxFilterBuilder.buildActiveInstockLargerThan( length, width, height); return this.find(filter); } /* * (non-Javadoc) * * @see com.fivesticks.time.ebay.setup.BoxServiceDelegate#find(com.fivesticks.time.ebay.setup.BoxFilter) */ public Collection find(BoxCriteriaParameters filter) throws BoxServiceDelegateException { try { this.handleDecorate(filter); } catch (AbstractServiceDelegateException e) { throw new BoxServiceDelegateException(e); } return this.getDao().find(filter); } /* * (non-Javadoc) * * @see com.fivesticks.time.ebay.setup.BoxServiceDelegate#getBox(java.lang.Long) */ public Box getBox(Long id) throws BoxServiceDelegateException { Box ret = (Box) this.getDao().get(id); if (ret != null) { try { this.handleValidate(ret); } catch (AbstractServiceDelegateException e) { throw new BoxServiceDelegateException(e); } } return ret; } /* * (non-Javadoc) * * @see com.fivesticks.time.ebay.setup.BoxServiceDelegate#delete(java.lang.Long) */ public void delete(Long id) throws BoxServiceDelegateException { Box box = this.getBox(id); this.delete(box); } /* * (non-Javadoc) * * @see com.fivesticks.time.ebay.setup.BoxServiceDelegate#delete(com.fivesticks.time.ebay.setup.Box) */ public void delete(Box box) throws BoxServiceDelegateException { try { this.handleValidate(box); } catch (AbstractServiceDelegateException e) { throw new BoxServiceDelegateException(e); } this.getDao().delete(box); } /* * (non-Javadoc) * * @see com.fivesticks.time.ebay.setup.BoxServiceDelegate#save(com.fivesticks.time.ebay.setup.Box) */ public void save(Box box) throws BoxServiceDelegateException { try { handleDecorate(box); } catch (AbstractServiceDelegateException e) { throw new BoxServiceDelegateException(e); } this.getDao().save(box); } // private void handleDecorate(SystemOwnerKeyAware target) throws BoxServiceDelegateException { // try { // this.getOwnerKeyValidatorAndDecorator().decorate(target, this.getSystemOwner()); // } catch (OwnerKeyValidatorAndDecoratorException e) { // throw new BoxServiceDelegateException(e); // } // } // // private void handleValidate(SystemOwnerKeyAware target) throws BoxServiceDelegateException { // try { // this.getOwnerKeyValidatorAndDecorator().validate(target, this.getSystemOwner()); // } catch (OwnerKeyValidatorAndDecoratorException e) { // throw new BoxServiceDelegateException(e); // } // } // /* // * (non-Javadoc) // * // * @see com.fivesticks.time.ebay.setup.BoxDAOAware#setBoxDAO(com.fivesticks.time.ebay.setup.BoxDAO) // */ // public void setBoxDAO(BoxDAO boxDAO) { // this.boxDAO = boxDAO; // } // // /** // * @return Returns the ownerKeyValidatorAndDecorator. // */ // public OwnerKeyValidatorAndDecorator getOwnerKeyValidatorAndDecorator() { // return ownerKeyValidatorAndDecorator; // } // // /** // * @param ownerKeyValidatorAndDecorator // * The ownerKeyValidatorAndDecorator to set. // */ // public void setOwnerKeyValidatorAndDecorator( // OwnerKeyValidatorAndDecorator ownerKeyValidatorAndDecorator) { // this.ownerKeyValidatorAndDecorator = ownerKeyValidatorAndDecorator; // } // // /** // * @return Returns the systemOwner. // */ // public SystemOwner getSystemOwner() { // return systemOwner; // } // // /** // * @param systemOwner // * The systemOwner to set. // */ // public void setSystemOwner(SystemOwner systemOwner) { // this.systemOwner = systemOwner; // } // // /** // * @return Returns the boxDAO. // */ // public BoxDAO getBoxDAO() { // return boxDAO; // } }
5,769
0.611544
0.610504
184
29.36413
29.660269
108
false
false
0
0
0
0
0
0
0.277174
false
false
3
765631ce5ca7f86264b6717a42bd1ac35f7765b1
19,679,540,190,433
093d37050606aa5a49644150cc40af5cf78dc360
/src/main/java/leetcode/solution/backtrace/q216/Solution.java
d2425278c2d7ff00149a904894556216896df8d3
[]
no_license
Grootzz/LeetCode-Solution
https://github.com/Grootzz/LeetCode-Solution
07f83c5698170f91f7a1459741a77cbf8ad6e2bb
b90af81cb3a4b18cef7fa7fea58d4c8ae7061fdc
refs/heads/master
2021-07-12T10:57:38.622000
2020-08-14T13:34:50
2020-08-14T13:34:50
200,228,141
2
0
null
false
2020-10-13T15:03:37
2019-08-02T12:07:34
2020-08-14T13:35:09
2020-10-13T15:03:36
141
0
0
1
Java
false
false
package leetcode.solution.backtrace.q216; import org.junit.Test; import java.util.ArrayList; import java.util.List; import java.util.Stack; /* 找出所有相加之和为 n 的 k 个数的组合。组合中只允许含有 1 - 9 的正整数,并且每种组合中不存在重复的数字。 说明: 所有数字都是正整数。 解集不能包含重复的组合。  示例 1: 输入: k = 3, n = 7 输出: [[1,2,4]] 示例 2: 输入: k = 3, n = 9 输出: [[1,2,6], [1,3,5], [2,3,4]] */ /** * 216. 组合总和 III * https://leetcode-cn.com/problems/combination-sum-iii/ * * @author noodle * @date 2019/8/21 21:28 */ public class Solution { public List<List<Integer>> combinationSum3(int k, int n) { List<List<Integer>> ans = new ArrayList<>(); Stack<Integer> stack = new Stack<>(); backtrace(ans, stack, k, n, 1); return ans; } private void backtrace(List<List<Integer>> ans, Stack<Integer> stack, int k, int n, int cur) { if (n == 0 && stack.size() == k) { ans.add(new ArrayList<>(stack)); return; } if ((stack.size() > k || n < 0) || (stack.size() < k && n == 0)) return; for (int i = cur; i < 10; i++) { stack.push(i); backtrace(ans, stack, k, n - i, i + 1); stack.pop(); } } @Test public void doTest() { int k = 3, n = 7; System.out.println(combinationSum3(k, n)); } @Test public void doTest01() { int k = 3, n = 9; System.out.println(combinationSum3(k, n)); } }
UTF-8
Java
1,613
java
Solution.java
Java
[ { "context": "cn.com/problems/combination-sum-iii/\n *\n * @author noodle\n * @date 2019/8/21 21:28\n */\npublic class Solutio", "end": 433, "score": 0.9996340870857239, "start": 427, "tag": "USERNAME", "value": "noodle" } ]
null
[]
package leetcode.solution.backtrace.q216; import org.junit.Test; import java.util.ArrayList; import java.util.List; import java.util.Stack; /* 找出所有相加之和为 n 的 k 个数的组合。组合中只允许含有 1 - 9 的正整数,并且每种组合中不存在重复的数字。 说明: 所有数字都是正整数。 解集不能包含重复的组合。  示例 1: 输入: k = 3, n = 7 输出: [[1,2,4]] 示例 2: 输入: k = 3, n = 9 输出: [[1,2,6], [1,3,5], [2,3,4]] */ /** * 216. 组合总和 III * https://leetcode-cn.com/problems/combination-sum-iii/ * * @author noodle * @date 2019/8/21 21:28 */ public class Solution { public List<List<Integer>> combinationSum3(int k, int n) { List<List<Integer>> ans = new ArrayList<>(); Stack<Integer> stack = new Stack<>(); backtrace(ans, stack, k, n, 1); return ans; } private void backtrace(List<List<Integer>> ans, Stack<Integer> stack, int k, int n, int cur) { if (n == 0 && stack.size() == k) { ans.add(new ArrayList<>(stack)); return; } if ((stack.size() > k || n < 0) || (stack.size() < k && n == 0)) return; for (int i = cur; i < 10; i++) { stack.push(i); backtrace(ans, stack, k, n - i, i + 1); stack.pop(); } } @Test public void doTest() { int k = 3, n = 7; System.out.println(combinationSum3(k, n)); } @Test public void doTest01() { int k = 3, n = 9; System.out.println(combinationSum3(k, n)); } }
1,613
0.531337
0.494429
70
19.528572
20.914602
98
false
false
0
0
0
0
0
0
0.771429
false
false
3
739063c2aec8dbbcbfa56c90c3c69d0bef3c9313
103,079,255,020
b6d853857fcc88112aff3fce5f710e5f5bf70ace
/Android/app/src/main/java/com/arun/api/Adaptor/DepartmentAdapter.java
e5d0d3b7ede27e9b6aa412f89f7c7a33dd51233d
[]
no_license
ArunNishanthan/Stationery-Store-Inventory-System
https://github.com/ArunNishanthan/Stationery-Store-Inventory-System
bac346e695f2510c9046d9e5ec65c4bb4a189459
9ff9e1c6bfaa8e70bb8fce132c97409547b68e85
refs/heads/master
2023-03-17T01:21:23.269000
2020-03-22T18:21:56
2020-03-22T18:21:56
249,243,529
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.arun.api.Adaptor; import android.app.Activity; import android.content.Context; import android.text.Editable; import android.text.TextWatcher; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; import com.arun.api.Model.Retrieval; import com.arun.api.R; import java.util.List; import java.util.Objects; public class DepartmentAdapter extends ArrayAdapter<Retrieval> { private Context context; public List<Retrieval> lists; int updateActualQty = 0; public DepartmentAdapter(Context context, int resourceId, List<Retrieval> lists) { super(context, resourceId, lists); this.context = context; this.lists = lists; } public View getView(final int position, View view, ViewGroup parent) { final Retrieval rowItem = getItem(position); LayoutInflater inflater = (LayoutInflater) context.getSystemService(Activity.LAYOUT_INFLATER_SERVICE); view = inflater.inflate(R.layout.row_listview2, parent, false); EditText tvCount = view.findViewById(R.id.actualValue); Button btnIncrease = (Button) view.findViewById(R.id.actualDecrease); Button btnDecrease = (Button) view.findViewById(R.id.actualIncrease); ViewHolder viewHolder = new ViewHolder(); viewHolder.deptCode = (TextView) view.findViewById(R.id.DepCode); viewHolder.ActualQty = (EditText) view.findViewById(R.id.actualValue); viewHolder.NeededQty = (TextView) view.findViewById(R.id.neededValue); viewHolder.btnPlus = (Button) view.findViewById(R.id.actualIncrease); final View finalView = view; viewHolder.btnPlus.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (rowItem.getActual() < rowItem.getNeeded()) { updateActualQty = lists.get(position).Actual; updateActualQty += 1; View tempView = finalView; actualQtydisplay(updateActualQty, tempView); if (lists.contains(getItem(position))) { rowItem.Actual = updateActualQty; } } } }); viewHolder.btnMinus = (Button) view.findViewById(R.id.actualDecrease); viewHolder.btnMinus.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { updateActualQty = lists.get(position).Actual; updateActualQty -= 1; View tempView = finalView; actualQtydisplay(updateActualQty, tempView); if (lists.contains(getItem(position))) { rowItem.Actual = updateActualQty; } } }); tvCount.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { } @Override public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { } @Override public void afterTextChanged(Editable editable) { if (!editable.toString().equalsIgnoreCase("")) { if(Integer.parseInt(editable.toString())<=rowItem.getNeeded()){ rowItem.Actual = Integer.parseInt(editable.toString()); }else{ Toast.makeText(getContext(), "There is mismatch in value", Toast.LENGTH_SHORT).show(); actualQtydisplay( rowItem.Actual , finalView); } } } }); if (rowItem != null && view != null) { TextView DepCode = view.findViewById(R.id.DepCode); if (DepCode != null) { DepCode.setText(rowItem.getDepartmentCode()); } TextView Needed = view.findViewById(R.id.neededValue); if (Needed != null) { Needed.setText(String.valueOf(rowItem.getNeeded())); } EditText Actual = view.findViewById(R.id.actualValue); if (Actual != null) { Actual.setText(String.valueOf(rowItem.getActual())); } } return view; } void actualQtydisplay(int number, View view) { if(number<0){ number=0; } EditText displayInteger = view.findViewById(R.id.actualValue); displayInteger.setText("" + number); } private class ViewHolder { TextView deptCode; TextView NeededQty; Button btnPlus; EditText ActualQty; Button btnMinus; } }
UTF-8
Java
4,934
java
DepartmentAdapter.java
Java
[]
null
[]
package com.arun.api.Adaptor; import android.app.Activity; import android.content.Context; import android.text.Editable; import android.text.TextWatcher; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; import com.arun.api.Model.Retrieval; import com.arun.api.R; import java.util.List; import java.util.Objects; public class DepartmentAdapter extends ArrayAdapter<Retrieval> { private Context context; public List<Retrieval> lists; int updateActualQty = 0; public DepartmentAdapter(Context context, int resourceId, List<Retrieval> lists) { super(context, resourceId, lists); this.context = context; this.lists = lists; } public View getView(final int position, View view, ViewGroup parent) { final Retrieval rowItem = getItem(position); LayoutInflater inflater = (LayoutInflater) context.getSystemService(Activity.LAYOUT_INFLATER_SERVICE); view = inflater.inflate(R.layout.row_listview2, parent, false); EditText tvCount = view.findViewById(R.id.actualValue); Button btnIncrease = (Button) view.findViewById(R.id.actualDecrease); Button btnDecrease = (Button) view.findViewById(R.id.actualIncrease); ViewHolder viewHolder = new ViewHolder(); viewHolder.deptCode = (TextView) view.findViewById(R.id.DepCode); viewHolder.ActualQty = (EditText) view.findViewById(R.id.actualValue); viewHolder.NeededQty = (TextView) view.findViewById(R.id.neededValue); viewHolder.btnPlus = (Button) view.findViewById(R.id.actualIncrease); final View finalView = view; viewHolder.btnPlus.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (rowItem.getActual() < rowItem.getNeeded()) { updateActualQty = lists.get(position).Actual; updateActualQty += 1; View tempView = finalView; actualQtydisplay(updateActualQty, tempView); if (lists.contains(getItem(position))) { rowItem.Actual = updateActualQty; } } } }); viewHolder.btnMinus = (Button) view.findViewById(R.id.actualDecrease); viewHolder.btnMinus.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { updateActualQty = lists.get(position).Actual; updateActualQty -= 1; View tempView = finalView; actualQtydisplay(updateActualQty, tempView); if (lists.contains(getItem(position))) { rowItem.Actual = updateActualQty; } } }); tvCount.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { } @Override public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { } @Override public void afterTextChanged(Editable editable) { if (!editable.toString().equalsIgnoreCase("")) { if(Integer.parseInt(editable.toString())<=rowItem.getNeeded()){ rowItem.Actual = Integer.parseInt(editable.toString()); }else{ Toast.makeText(getContext(), "There is mismatch in value", Toast.LENGTH_SHORT).show(); actualQtydisplay( rowItem.Actual , finalView); } } } }); if (rowItem != null && view != null) { TextView DepCode = view.findViewById(R.id.DepCode); if (DepCode != null) { DepCode.setText(rowItem.getDepartmentCode()); } TextView Needed = view.findViewById(R.id.neededValue); if (Needed != null) { Needed.setText(String.valueOf(rowItem.getNeeded())); } EditText Actual = view.findViewById(R.id.actualValue); if (Actual != null) { Actual.setText(String.valueOf(rowItem.getActual())); } } return view; } void actualQtydisplay(int number, View view) { if(number<0){ number=0; } EditText displayInteger = view.findViewById(R.id.actualValue); displayInteger.setText("" + number); } private class ViewHolder { TextView deptCode; TextView NeededQty; Button btnPlus; EditText ActualQty; Button btnMinus; } }
4,934
0.600527
0.5985
139
34.503597
27.582806
110
false
false
0
0
0
0
0
0
0.625899
false
false
3
7f4280752d5c87022eef5575cf2b9601aa0bcaa1
22,196,391,030,510
da8f4490785c87f9ebb53ba1dd2f31b18fa8c822
/mfthub-core/src/main/java/de/mfthub/core/scheduler/MftScheduler.java
198fee029824341a217783784eb31666b7eb3b5f
[]
no_license
prosdl/mfthub
https://github.com/prosdl/mfthub
f63d4ff6c262892cf3657492da78a1a3d4d5272d
3b9a872ee05fa1a8545c27a8e16e28a1caf047d0
refs/heads/master
2020-05-28T13:59:51.442000
2015-03-11T22:56:00
2015-03-11T22:56:00
30,834,479
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package de.mfthub.core.scheduler; import org.quartz.SchedulerException; import de.mfthub.model.entities.Transfer; public interface MftScheduler { public abstract void scheduleTransfer(Transfer transfer) throws SchedulerException; public abstract void startScheduler() throws SchedulerException; public abstract void standbyScheduler() throws SchedulerException; public abstract void safeShutdownScheduler() throws SchedulerException; void scheduleRedeliveryJob() throws SchedulerException; }
UTF-8
Java
524
java
MftScheduler.java
Java
[]
null
[]
package de.mfthub.core.scheduler; import org.quartz.SchedulerException; import de.mfthub.model.entities.Transfer; public interface MftScheduler { public abstract void scheduleTransfer(Transfer transfer) throws SchedulerException; public abstract void startScheduler() throws SchedulerException; public abstract void standbyScheduler() throws SchedulerException; public abstract void safeShutdownScheduler() throws SchedulerException; void scheduleRedeliveryJob() throws SchedulerException; }
524
0.807252
0.807252
20
25.25
27.518858
74
false
false
0
0
0
0
0
0
0.4
false
false
3
80134d615f197776d593ce4d898518539db7441e
10,617,159,214,832
697db4ffa21739ff32aa8ec6ca85d58eeb2ad8fb
/docking-frames-demo-chess/src/bibliothek/chess/model/Figure.java
df33252ae6f1ff2e711aacb6975cb64ad370e12b
[]
no_license
subes/DockingFrames
https://github.com/subes/DockingFrames
87e0a485b5c5bab6dcdf194a9c582e8662694cf2
76ab477a0888030791bacbfd094ab3db0af8d6c5
refs/heads/master
2022-07-08T01:15:18.362000
2022-06-30T12:22:57
2022-06-30T12:22:57
243,284,554
0
0
null
true
2020-02-26T14:36:49
2020-02-26T14:36:48
2019-12-06T06:59:48
2019-12-06T06:59:38
31,368
0
0
0
null
false
false
package bibliothek.chess.model; import javax.swing.Icon; import bibliothek.chess.util.Utils; import bibliothek.util.container.Single; /** * A figure is a part of a chess-board. Every figure has a {@link Behavior} that * describes how it can move and attack. Each figure has also an {@link Icon} * and belongs to a {@link Player}. * @author Benjamin Sigg */ public final class Figure { /** * Describes what kind of figure an instance of {@link Figure} is. * @author Benjamin Sigg */ public static enum Type{ /** most important figure of all */ KING( "King", "k", new King() ), /** most dangerous figure */ QUEEN( "Queen", "q", new Queen() ), /** can move only diagonal */ BISHOP( "Bishop", "b", new Bishop() ), /** can jump over other figures */ KNIGHT( "Knight", "n", new Knight() ), /** can move only horizontal and vertical*/ ROCK( "Rock", "r", new Rock() ), /** very slow figure */ PAWN( "Pawn", "p", new Pawn() ); /** The human readable name of this type */ private String name; /** A small version of {@link #name} */ private String sign; /** Describes how figures of this type behave */ private Behavior behavior; private Type( String name, String sign, Behavior behavior ){ this.name = name; this.sign = sign; this.behavior = behavior; } /** * Gets the name of this type. * @return A string that can be read by humans. */ public String getName() { return name; } /** * Gets the sign of this type. * @return A unique, small name */ public String getSign() { return sign; } /** * Gets the behavior of figures of this type. * @return The unique behavior */ public Behavior getBehavior() { return behavior; } } /** An {@link Icon} of size 16x16 */ private Icon smallIcon; /** An {@link Icon} of size 48x48 */ private Icon bigIcon; /** The board on which this figure stands */ private Board board; /** The player to which this figure belongs */ private Player player; /** The row in which this figure stands */ private int row; /** The column in which this figure stands */ private int column; /** * The type of this figure, describing how this figure looks like, and how * it can be used by a player. */ private Type type; /** Behavior describing how this figure can be moved by the player. */ private Behavior behavior; /** whether this figure has already been moved or not */ private boolean moved = false; /** whether this figure has been moved exactly once */ private boolean justMoved = false; /** * Creates a new figure. * @param board the board on which the figure will stand * @param player the owner of the figure * @param type what kind of figure * @param row the initial position (row-coordinate) * @param column the initial position (column-coordinate) */ public Figure( Board board, Player player, Type type, int row, int column ){ this( board, player, type, row, column, true ); } /** * Creates a new figure. * @param board the board on which the figure will stand * @param player the owner of the figure * @param type what kind of figure * @param row the initial position (row-coordinate) * @param column the initial position (column-coordinate) * @param icons whether the figure should create icons or not. Not creating * icons is faster, however the figure can't be displayed without icons. */ private Figure( Board board, Player player, Type type, int row, int column, boolean icons ){ this.board = board; this.player = player; this.type = type; if( icons ){ this.smallIcon = Utils.getChessIcon( type.getSign(), player, 16 ); this.bigIcon = Utils.getChessIcon( type.getSign(), player, 48 ); } this.row = row; this.column = column; this.behavior = type.getBehavior(); } /** * Gets the name of this figure. * @return the name, a string readable by a human * @see Type#name() */ public String getName(){ return type.getName(); } /** * Tells what kind of figure this figure is. * @return the type */ public Type getType() { return type; } /** * Gets the board on which this figure stands. * @return the board */ public Board getBoard() { return board; } /** * Gets the owner of this figure. * @return the player which can move this figure */ public Player getPlayer(){ return player; } /** * Gets a small icon for this figure. * @return an icon of size 16x16 */ public Icon getSmallIcon(){ return smallIcon; } /** * Gets a big icon for this figure. * @return an icon of size 48x48 */ public Icon getBigIcon(){ return bigIcon; } /** * Gets the row in which this figure stands currently * @return the row */ public int getRow() { return row; } /** * Gets the column in which this figure stands currently. * @return the column */ public int getColumn() { return column; } /** * Tells whether this figure has been moved at least once or not. * @return <code>true</code> if the figure has been moved */ public boolean isMoved() { return moved; } /** * Tells whether this figure has been moved exactly once or not * @return <code>true</code> if this figure has been moved exactly once * and only in the last stroke. */ public boolean isJustMoved() { return justMoved; } /** * Cleans the just moved flag and sets it to <code>false</code>. */ public void cleanJustMoved(){ justMoved = false; } /** * Changes the location of this figure. This might have influence on other * figures on the {@link #getBoard() board}, according to the rules of * chess. The behavior is unspecified for coordinates which are not * reachable by the rules of the game. * @param row the new row * @param column the new column */ public void setLocation( int row, int column ){ behavior.moving( board, this, row, column ); justMoved = !moved; moved = true; this.row = row; this.column = column; } /** * Creates a copy of this figure using the new board * @param board the new board * @return the new figure */ public Figure copy( Board board ){ Figure figure = new Figure( board, player, type, row, column, false ); figure.moved = moved; figure.justMoved = justMoved; return figure; } /** * Tells whether this figure can move to at least one other cell or not. * @return <code>true</code> if the figure can be moved. */ public boolean moveable(){ final Single<Boolean> result = new Single<Boolean>( false ); reachable( new Board.CellVisitor(){ public boolean visit( int r, int c, Figure figure ) { result.setA( true ); return false; } }); return result.getA(); } /** * Visits all cells which can be reached within the next legal move. * @param visitor the visitor */ public void reachable( Board.CellVisitor visitor ){ behavior.reachable( board, this, visitor ); } /** * Visits all cells which can be attacked within the next legal move. * @param visitor the visitor */ public void attackable( Board.CellVisitor visitor ){ behavior.attackable( board, this, visitor ); } @Override public String toString() { return player + " " + getName(); } }
UTF-8
Java
7,701
java
Figure.java
Java
[ { "context": "on}\n * and belongs to a {@link Player}.\n * @author Benjamin Sigg\n */\npublic final class Figure {\n\t/**\n\t * Describe", "end": 360, "score": 0.9998803734779358, "start": 347, "tag": "NAME", "value": "Benjamin Sigg" }, { "context": "gure an instance of {@link Figure} is.\n\t * @author Benjamin Sigg\n\t */\n public static enum Type{\n \t/** most i", "end": 491, "score": 0.9998621344566345, "start": 478, "tag": "NAME", "value": "Benjamin Sigg" } ]
null
[]
package bibliothek.chess.model; import javax.swing.Icon; import bibliothek.chess.util.Utils; import bibliothek.util.container.Single; /** * A figure is a part of a chess-board. Every figure has a {@link Behavior} that * describes how it can move and attack. Each figure has also an {@link Icon} * and belongs to a {@link Player}. * @author <NAME> */ public final class Figure { /** * Describes what kind of figure an instance of {@link Figure} is. * @author <NAME> */ public static enum Type{ /** most important figure of all */ KING( "King", "k", new King() ), /** most dangerous figure */ QUEEN( "Queen", "q", new Queen() ), /** can move only diagonal */ BISHOP( "Bishop", "b", new Bishop() ), /** can jump over other figures */ KNIGHT( "Knight", "n", new Knight() ), /** can move only horizontal and vertical*/ ROCK( "Rock", "r", new Rock() ), /** very slow figure */ PAWN( "Pawn", "p", new Pawn() ); /** The human readable name of this type */ private String name; /** A small version of {@link #name} */ private String sign; /** Describes how figures of this type behave */ private Behavior behavior; private Type( String name, String sign, Behavior behavior ){ this.name = name; this.sign = sign; this.behavior = behavior; } /** * Gets the name of this type. * @return A string that can be read by humans. */ public String getName() { return name; } /** * Gets the sign of this type. * @return A unique, small name */ public String getSign() { return sign; } /** * Gets the behavior of figures of this type. * @return The unique behavior */ public Behavior getBehavior() { return behavior; } } /** An {@link Icon} of size 16x16 */ private Icon smallIcon; /** An {@link Icon} of size 48x48 */ private Icon bigIcon; /** The board on which this figure stands */ private Board board; /** The player to which this figure belongs */ private Player player; /** The row in which this figure stands */ private int row; /** The column in which this figure stands */ private int column; /** * The type of this figure, describing how this figure looks like, and how * it can be used by a player. */ private Type type; /** Behavior describing how this figure can be moved by the player. */ private Behavior behavior; /** whether this figure has already been moved or not */ private boolean moved = false; /** whether this figure has been moved exactly once */ private boolean justMoved = false; /** * Creates a new figure. * @param board the board on which the figure will stand * @param player the owner of the figure * @param type what kind of figure * @param row the initial position (row-coordinate) * @param column the initial position (column-coordinate) */ public Figure( Board board, Player player, Type type, int row, int column ){ this( board, player, type, row, column, true ); } /** * Creates a new figure. * @param board the board on which the figure will stand * @param player the owner of the figure * @param type what kind of figure * @param row the initial position (row-coordinate) * @param column the initial position (column-coordinate) * @param icons whether the figure should create icons or not. Not creating * icons is faster, however the figure can't be displayed without icons. */ private Figure( Board board, Player player, Type type, int row, int column, boolean icons ){ this.board = board; this.player = player; this.type = type; if( icons ){ this.smallIcon = Utils.getChessIcon( type.getSign(), player, 16 ); this.bigIcon = Utils.getChessIcon( type.getSign(), player, 48 ); } this.row = row; this.column = column; this.behavior = type.getBehavior(); } /** * Gets the name of this figure. * @return the name, a string readable by a human * @see Type#name() */ public String getName(){ return type.getName(); } /** * Tells what kind of figure this figure is. * @return the type */ public Type getType() { return type; } /** * Gets the board on which this figure stands. * @return the board */ public Board getBoard() { return board; } /** * Gets the owner of this figure. * @return the player which can move this figure */ public Player getPlayer(){ return player; } /** * Gets a small icon for this figure. * @return an icon of size 16x16 */ public Icon getSmallIcon(){ return smallIcon; } /** * Gets a big icon for this figure. * @return an icon of size 48x48 */ public Icon getBigIcon(){ return bigIcon; } /** * Gets the row in which this figure stands currently * @return the row */ public int getRow() { return row; } /** * Gets the column in which this figure stands currently. * @return the column */ public int getColumn() { return column; } /** * Tells whether this figure has been moved at least once or not. * @return <code>true</code> if the figure has been moved */ public boolean isMoved() { return moved; } /** * Tells whether this figure has been moved exactly once or not * @return <code>true</code> if this figure has been moved exactly once * and only in the last stroke. */ public boolean isJustMoved() { return justMoved; } /** * Cleans the just moved flag and sets it to <code>false</code>. */ public void cleanJustMoved(){ justMoved = false; } /** * Changes the location of this figure. This might have influence on other * figures on the {@link #getBoard() board}, according to the rules of * chess. The behavior is unspecified for coordinates which are not * reachable by the rules of the game. * @param row the new row * @param column the new column */ public void setLocation( int row, int column ){ behavior.moving( board, this, row, column ); justMoved = !moved; moved = true; this.row = row; this.column = column; } /** * Creates a copy of this figure using the new board * @param board the new board * @return the new figure */ public Figure copy( Board board ){ Figure figure = new Figure( board, player, type, row, column, false ); figure.moved = moved; figure.justMoved = justMoved; return figure; } /** * Tells whether this figure can move to at least one other cell or not. * @return <code>true</code> if the figure can be moved. */ public boolean moveable(){ final Single<Boolean> result = new Single<Boolean>( false ); reachable( new Board.CellVisitor(){ public boolean visit( int r, int c, Figure figure ) { result.setA( true ); return false; } }); return result.getA(); } /** * Visits all cells which can be reached within the next legal move. * @param visitor the visitor */ public void reachable( Board.CellVisitor visitor ){ behavior.reachable( board, this, visitor ); } /** * Visits all cells which can be attacked within the next legal move. * @param visitor the visitor */ public void attackable( Board.CellVisitor visitor ){ behavior.attackable( board, this, visitor ); } @Override public String toString() { return player + " " + getName(); } }
7,687
0.620309
0.617712
287
25.832752
21.986849
93
false
false
0
0
0
0
0
0
1.195122
false
false
3
c73be22d818ccdda05f6c0be03f0dc8c8722e63b
38,757,784,901,824
63ffa1041473411c6baa85dac297922f484d953f
/2015/20/solution.java
585566a24cd996b8ddb5defdf51e4abe5764171a
[]
no_license
wmouwen/advent-of-code
https://github.com/wmouwen/advent-of-code
a812c454a4730e83f2a81cd95514bbf5b5080817
045f15e690c90dc32b247efc2def1e696fca976f
refs/heads/master
2020-03-30T03:54:33.434000
2019-12-17T18:11:53
2019-12-17T18:11:53
150,714,108
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
import java.util.Scanner; public class AoC_20 { void magic() { int input = sc.nextInt(), partOne = Integer.MAX_VALUE, partTwo = Integer.MAX_VALUE; long[] housesOne = new long[1000000], housesTwo = new long[housesOne.length]; for (int i = 1; i < housesOne.length; i++) { for (int j = 1; i * j < housesOne.length; j++) { housesOne[i * j] += 10 * i; housesTwo[i * j] += j <= 50 ? 11 * i : 0; } if (housesOne[i] >= input) { partOne = Math.min(i, partOne); } if (housesTwo[i] >= input) { partTwo = Math.min(i, partTwo); } } System.out.println("Part One: " + partOne); System.out.println("Part Two: " + partTwo); } static Scanner sc = new Scanner(System.in); public static void main(String[] args) { long startTime = System.currentTimeMillis(); new AoC_20().magic(); System.out.println("Running time: " + (System.currentTimeMillis() - startTime) + "ms"); } }
UTF-8
Java
1,104
java
solution.java
Java
[]
null
[]
import java.util.Scanner; public class AoC_20 { void magic() { int input = sc.nextInt(), partOne = Integer.MAX_VALUE, partTwo = Integer.MAX_VALUE; long[] housesOne = new long[1000000], housesTwo = new long[housesOne.length]; for (int i = 1; i < housesOne.length; i++) { for (int j = 1; i * j < housesOne.length; j++) { housesOne[i * j] += 10 * i; housesTwo[i * j] += j <= 50 ? 11 * i : 0; } if (housesOne[i] >= input) { partOne = Math.min(i, partOne); } if (housesTwo[i] >= input) { partTwo = Math.min(i, partTwo); } } System.out.println("Part One: " + partOne); System.out.println("Part Two: " + partTwo); } static Scanner sc = new Scanner(System.in); public static void main(String[] args) { long startTime = System.currentTimeMillis(); new AoC_20().magic(); System.out.println("Running time: " + (System.currentTimeMillis() - startTime) + "ms"); } }
1,104
0.506341
0.488225
33
32.424244
26.915165
95
false
false
0
0
0
0
0
0
0.666667
false
false
3
e7cec1ec30178a6715cbb80e0dbbb3a4105a8b3e
34,213,709,537,413
e6e0e5d91820b45dce0f1182e8a0f9d78447140b
/src/controller/ServerTranslator.java
b5ed6b9cec6af266a96d624fc75cd31c658f1cc5
[]
no_license
magiclud/graLista2
https://github.com/magiclud/graLista2
a14aa873e4bc59357247e54bdcb38c96ad611f2c
c57f8bcff80cae6aeb0b97415d2269051b661bf8
refs/heads/master
2021-01-17T12:48:31.836000
2013-12-05T16:05:18
2013-12-05T16:05:18
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package controller; public class ServerTranslator { String message = null; String playerID = null; ServerTranslator() { } String getMessage() { return message; } void spytajCzyChceDolaczycDoGry(String playerID) { CommunicationBox.orderForServer = "Chcesz grać ?"; this.playerID = playerID; } public static void startMethod(String playerID, String polecenie) { switch(polecenie){ case "ADD": { CommunicationBox.orderForRozgrywka="ADD"; CommunicationBox.whichPlayerRogrywka=playerID; }; } } public static void wyslijWiadomosc(String message, String playerID) { CommunicationBox.orderForServer = message; CommunicationBox.whichPlayerServer = playerID; } }
UTF-8
Java
705
java
ServerTranslator.java
Java
[]
null
[]
package controller; public class ServerTranslator { String message = null; String playerID = null; ServerTranslator() { } String getMessage() { return message; } void spytajCzyChceDolaczycDoGry(String playerID) { CommunicationBox.orderForServer = "Chcesz grać ?"; this.playerID = playerID; } public static void startMethod(String playerID, String polecenie) { switch(polecenie){ case "ADD": { CommunicationBox.orderForRozgrywka="ADD"; CommunicationBox.whichPlayerRogrywka=playerID; }; } } public static void wyslijWiadomosc(String message, String playerID) { CommunicationBox.orderForServer = message; CommunicationBox.whichPlayerServer = playerID; } }
705
0.740057
0.740057
30
22.466667
22.284124
70
false
false
0
0
0
0
0
0
1.9
false
false
3
d0853619f2151e88cc178390cadd6d8158f4f608
37,048,387,929,926
15302420030a694bc9b2ca9756f08a28cc72143c
/arrows/src/main/java/nosubmmitted/LC157ReadNCharactersGivenRead4.java
d58e8b82d03d1f1abf2700d750d0825dbabcee96
[ "Apache-2.0" ]
permissive
BruceZu/sawdust
https://github.com/BruceZu/sawdust
5dd925afd5481b37ce3904d7317e4916084fa9b6
ed3c48101ab168ebee0da9928759c27193713d13
refs/heads/master
2021-01-24T07:14:19.856000
2021-01-24T06:19:58
2021-01-24T06:19:58
52,577,100
2
0
null
null
null
null
null
null
null
null
null
null
null
null
null
// Copyright 2016 The Sawdust Open Source Project // // 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 nosubmmitted; import static java.lang.Math.min; /** * 157. Read N Characters Given Read4 * https://leetcode.com/problems/read-n-characters-given-read4/ * Difficulty: Easy <pre> * The API: int read4(char *buf) reads 4 characters at a time from a file. * <p/> * The return value is the actual number of characters read. For example, it returns 3 if there is only 3 characters left in the file. * <p/> * By using the read4 API, implement the function int read(char *buf, int n) that reads n characters from the file. * <p/> * Note: * The read function will only be called once for each test case. * <p/> * Hide Company Tags Facebook * Hide Tags String * Hide Similar Problems (H) Read N Characters Given Read4 II - Call multiple times * </pre> */ public class LC157ReadNCharactersGivenRead4 { /* The read4 API is defined in the parent class Reader4. int read4(char[] buf); */ class Reader4 { int read4(char[] buf) { return 0;//todo } } class Solution extends Reader4 { /** * the fast one currently beat 92.49% * * @param buf * @param n * @return */ public int read(char[] buf, int n) { char[] buffer = new char[4];//temp buffer for each call to read4() int read = 0;//actual num of char read by the current call to read4() int hasRead = 0;//running total of char read while (true) { read = read4(buffer);//read4 int toRead = min(read, n - hasRead);//determine how many char to copy over to buf from buffer for (int i = 0; i < toRead; i++) {//do the copy buf[hasRead++] = buffer[i]; } if (read < 4) return hasRead; if (hasRead == n) return n; } } /** * save as above */ public int read2(char[] buf, int n) { if (n <= 0) return 0; char[] tmp = new char[4]; int j = 0; while (true) { int readCount = read4(tmp); for (int i = 0; i < readCount && j < n; i++) buf[j++] = tmp[i]; if (j == n || readCount < 4) break; } return j; } } }
UTF-8
Java
2,994
java
LC157ReadNCharactersGivenRead4.java
Java
[]
null
[]
// Copyright 2016 The Sawdust Open Source Project // // 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 nosubmmitted; import static java.lang.Math.min; /** * 157. Read N Characters Given Read4 * https://leetcode.com/problems/read-n-characters-given-read4/ * Difficulty: Easy <pre> * The API: int read4(char *buf) reads 4 characters at a time from a file. * <p/> * The return value is the actual number of characters read. For example, it returns 3 if there is only 3 characters left in the file. * <p/> * By using the read4 API, implement the function int read(char *buf, int n) that reads n characters from the file. * <p/> * Note: * The read function will only be called once for each test case. * <p/> * Hide Company Tags Facebook * Hide Tags String * Hide Similar Problems (H) Read N Characters Given Read4 II - Call multiple times * </pre> */ public class LC157ReadNCharactersGivenRead4 { /* The read4 API is defined in the parent class Reader4. int read4(char[] buf); */ class Reader4 { int read4(char[] buf) { return 0;//todo } } class Solution extends Reader4 { /** * the fast one currently beat 92.49% * * @param buf * @param n * @return */ public int read(char[] buf, int n) { char[] buffer = new char[4];//temp buffer for each call to read4() int read = 0;//actual num of char read by the current call to read4() int hasRead = 0;//running total of char read while (true) { read = read4(buffer);//read4 int toRead = min(read, n - hasRead);//determine how many char to copy over to buf from buffer for (int i = 0; i < toRead; i++) {//do the copy buf[hasRead++] = buffer[i]; } if (read < 4) return hasRead; if (hasRead == n) return n; } } /** * save as above */ public int read2(char[] buf, int n) { if (n <= 0) return 0; char[] tmp = new char[4]; int j = 0; while (true) { int readCount = read4(tmp); for (int i = 0; i < readCount && j < n; i++) buf[j++] = tmp[i]; if (j == n || readCount < 4) break; } return j; } } }
2,994
0.565798
0.548764
89
32.64045
28.411205
134
false
false
0
0
0
0
0
0
0.404494
false
false
3
538f20148a6b810d4029256743e2f34b138f8903
38,792,144,672,679
30371392a8d5d3e584fc340bb44d3720822dbe34
/src/com/richer/out/StreamDevice.java
6a8fc37e705e437670f1ddf820ca53d743eaa507
[]
no_license
weizy2018/Richer
https://github.com/weizy2018/Richer
8f26f2b770cbaee8471b68182756dc4681c0fe83
07cf8612dde0141fef7f6f50075a406f72cf5145
refs/heads/master
2020-03-28T08:42:12.807000
2018-10-30T12:03:43
2018-10-30T12:03:43
147,983,428
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.richer.out; public class StreamDevice extends OutDevice { @Override public void draw(String str) { System.out.print(str); } @Override public void drawln(String str) { System.out.println(str); } }
UTF-8
Java
224
java
StreamDevice.java
Java
[]
null
[]
package com.richer.out; public class StreamDevice extends OutDevice { @Override public void draw(String str) { System.out.print(str); } @Override public void drawln(String str) { System.out.println(str); } }
224
0.705357
0.705357
17
12.176471
14.439469
45
false
false
0
0
0
0
0
0
0.764706
false
false
3
74a48e3f72956c4a121efff48d2b3cfb0fffbb06
36,180,804,543,075
300122df166c1e8061a082a9df8d4a43c982ec0d
/src/main/java/com/autocoin/db/useraccount/UserAccount.java
6858378619e99228b6bb7d1f7940121e8654b6d5
[]
no_license
mgrzaslewicz/java-db-examples
https://github.com/mgrzaslewicz/java-db-examples
ce86f4a10b71b4a5da6e42de1b4a03cc4c9d1f19
2d793b584ba8bf6b7539f05f4b73d6d9b4efc31e
refs/heads/master
2022-06-16T15:52:02.709000
2020-05-03T17:40:20
2020-05-10T13:42:25
260,698,108
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.autocoin.db.useraccount; public class UserAccount { private final String userAccountId; private final String firstName; private final String lastName; public UserAccount(String userAccountId, String firstName, String lastName) { this.userAccountId = userAccountId; this.firstName = firstName; this.lastName = lastName; } public String getUserAccountId() { return userAccountId; } public String getFirstName() { return firstName; } public String getLastName() { return lastName; } }
UTF-8
Java
591
java
UserAccount.java
Java
[ { "context": "ccountId = userAccountId;\n this.firstName = firstName;\n this.lastName = lastName;\n }\n\n pub", "end": 337, "score": 0.9839892387390137, "start": 328, "tag": "NAME", "value": "firstName" }, { "context": "his.firstName = firstName;\n this.lastName = lastName;\n }\n\n public String getUserAccountId() {\n ", "end": 371, "score": 0.8911360502243042, "start": 363, "tag": "NAME", "value": "lastName" } ]
null
[]
package com.autocoin.db.useraccount; public class UserAccount { private final String userAccountId; private final String firstName; private final String lastName; public UserAccount(String userAccountId, String firstName, String lastName) { this.userAccountId = userAccountId; this.firstName = firstName; this.lastName = lastName; } public String getUserAccountId() { return userAccountId; } public String getFirstName() { return firstName; } public String getLastName() { return lastName; } }
591
0.671743
0.671743
25
22.639999
19.611996
81
false
false
0
0
0
0
0
0
0.48
false
false
3
baebb422ab8be5dab85ff0575862d6aca82abb68
36,721,970,421,521
76e21a54a6c2f2c972f10ea00903e4a6599b3aa3
/src/com/cinchwallet/acquirer/http/msg/HttpResponse.java
bf3eb8b5b31824dee470e3727a04cceea37f0dd7
[]
no_license
ahmedkabiru/processor
https://github.com/ahmedkabiru/processor
dc72937bc47b4764523eeb05678ade75d0addcaa
dcb4a8d2c25f62946ee818543d7c41113f748933
refs/heads/master
2020-12-09T06:57:55.200000
2016-04-18T09:36:14
2016-04-18T09:36:14
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.cinchwallet.acquirer.http.msg; import java.util.List; import javax.xml.bind.annotation.XmlRootElement; import org.codehaus.jackson.map.annotate.JsonSerialize; @JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL) public class HttpResponse { private String merchantTxnID; private String respCode; private String reasonCode; private String respMsg; private String expirationDate; private String cwTransID; private String cardHolderName; private Double prepaidbalance; private String pointExpireOn; private Integer pointBalance; private List<TxnHistory> txns; private Card card; private Profile profile; //for webpos login private String merchantId; private String storeId; private String merchantName; private String storeName; public String getMerchantTxnID() { return merchantTxnID; } public void setMerchantTxnID(String merchantTxnID) { this.merchantTxnID = merchantTxnID; } public String getRespCode() { return respCode; } public void setRespCode(String respCode) { this.respCode = respCode; } public String getReasonCode() { return reasonCode; } public void setReasonCode(String reasonCode) { this.reasonCode = reasonCode; } public String getRespMsg() { return respMsg; } public void setRespMsg(String respMsg) { this.respMsg = respMsg; } public String getExpirationDate() { return expirationDate; } public void setExpirationDate(String expirationDate) { this.expirationDate = expirationDate; } public String getCwTransID() { return cwTransID; } public void setCwTransID(String cwTransID) { this.cwTransID = cwTransID; } public String getCardHolderName() { return cardHolderName; } public void setCardHolderName(String cardHolderName) { this.cardHolderName = cardHolderName; } public Double getPrepaidbalance() { return prepaidbalance; } public void setPrepaidbalance(Double prepaidbalance) { this.prepaidbalance = prepaidbalance; } public Integer getPointBalance() { return pointBalance; } public void setPointBalance(Integer pointBalance) { this.pointBalance = pointBalance; } public List<TxnHistory> getTxns() { return txns; } public void setTxns(List<TxnHistory> txns) { this.txns = txns; } public Card getCard() { return card; } public void setCard(Card card) { this.card = card; } public String getPointExpireOn() { return pointExpireOn; } public void setPointExpireOn(String pointsExpireOn) { this.pointExpireOn = pointsExpireOn; } public Profile getProfile() { return profile; } public void setProfile(Profile profile) { this.profile = profile; } public String getMerchantId() { return merchantId; } public void setMerchantId(String merchantId) { this.merchantId = merchantId; } public String getStoreId() { return storeId; } public void setStoreId(String storeId) { this.storeId = storeId; } public String getMerchantName() { return merchantName; } public void setMerchantName(String merchantName) { this.merchantName = merchantName; } public String getStoreName() { return storeName; } public void setStoreName(String storeName) { this.storeName = storeName; } @Override public String toString() { return "HttpResponse [merchantTxnID=" + merchantTxnID + ", respCode=" + respCode + ", reasonCode=" + reasonCode + ", respMsg=" + respMsg + ", expirationDate=" + expirationDate + ", cwTransID=" + cwTransID + ", cardHolderName=" + cardHolderName + ", prepaidbalance=" + prepaidbalance + ", pointExpireOn=" + pointExpireOn + ", pointBalance=" + pointBalance + ", txns=" + txns + ", card=" + card + ", profile=" + profile + ", merchantId=" + merchantId + ", storeId=" + storeId + ", merchantName=" + merchantName + ", storeName=" + storeName + "]"; } }
UTF-8
Java
4,219
java
HttpResponse.java
Java
[]
null
[]
package com.cinchwallet.acquirer.http.msg; import java.util.List; import javax.xml.bind.annotation.XmlRootElement; import org.codehaus.jackson.map.annotate.JsonSerialize; @JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL) public class HttpResponse { private String merchantTxnID; private String respCode; private String reasonCode; private String respMsg; private String expirationDate; private String cwTransID; private String cardHolderName; private Double prepaidbalance; private String pointExpireOn; private Integer pointBalance; private List<TxnHistory> txns; private Card card; private Profile profile; //for webpos login private String merchantId; private String storeId; private String merchantName; private String storeName; public String getMerchantTxnID() { return merchantTxnID; } public void setMerchantTxnID(String merchantTxnID) { this.merchantTxnID = merchantTxnID; } public String getRespCode() { return respCode; } public void setRespCode(String respCode) { this.respCode = respCode; } public String getReasonCode() { return reasonCode; } public void setReasonCode(String reasonCode) { this.reasonCode = reasonCode; } public String getRespMsg() { return respMsg; } public void setRespMsg(String respMsg) { this.respMsg = respMsg; } public String getExpirationDate() { return expirationDate; } public void setExpirationDate(String expirationDate) { this.expirationDate = expirationDate; } public String getCwTransID() { return cwTransID; } public void setCwTransID(String cwTransID) { this.cwTransID = cwTransID; } public String getCardHolderName() { return cardHolderName; } public void setCardHolderName(String cardHolderName) { this.cardHolderName = cardHolderName; } public Double getPrepaidbalance() { return prepaidbalance; } public void setPrepaidbalance(Double prepaidbalance) { this.prepaidbalance = prepaidbalance; } public Integer getPointBalance() { return pointBalance; } public void setPointBalance(Integer pointBalance) { this.pointBalance = pointBalance; } public List<TxnHistory> getTxns() { return txns; } public void setTxns(List<TxnHistory> txns) { this.txns = txns; } public Card getCard() { return card; } public void setCard(Card card) { this.card = card; } public String getPointExpireOn() { return pointExpireOn; } public void setPointExpireOn(String pointsExpireOn) { this.pointExpireOn = pointsExpireOn; } public Profile getProfile() { return profile; } public void setProfile(Profile profile) { this.profile = profile; } public String getMerchantId() { return merchantId; } public void setMerchantId(String merchantId) { this.merchantId = merchantId; } public String getStoreId() { return storeId; } public void setStoreId(String storeId) { this.storeId = storeId; } public String getMerchantName() { return merchantName; } public void setMerchantName(String merchantName) { this.merchantName = merchantName; } public String getStoreName() { return storeName; } public void setStoreName(String storeName) { this.storeName = storeName; } @Override public String toString() { return "HttpResponse [merchantTxnID=" + merchantTxnID + ", respCode=" + respCode + ", reasonCode=" + reasonCode + ", respMsg=" + respMsg + ", expirationDate=" + expirationDate + ", cwTransID=" + cwTransID + ", cardHolderName=" + cardHolderName + ", prepaidbalance=" + prepaidbalance + ", pointExpireOn=" + pointExpireOn + ", pointBalance=" + pointBalance + ", txns=" + txns + ", card=" + card + ", profile=" + profile + ", merchantId=" + merchantId + ", storeId=" + storeId + ", merchantName=" + merchantName + ", storeName=" + storeName + "]"; } }
4,219
0.657502
0.657502
147
26.70068
22.325184
113
false
false
0
0
0
0
0
0
1.047619
false
false
3
31c9c1ede9f8a6104f8aa77ba424a44089f775f6
36,721,970,418,884
8c50d329c8456c5e4cff62ba578768fa86754509
/src/main/java/salon_za_avtomobili/salon/model/excep/InvalidArgumentException.java
f7ef80ee99e19ba6bb22e0927307988fb6c9ecf2
[]
no_license
jovanmk98/Spring_Cars_Shop
https://github.com/jovanmk98/Spring_Cars_Shop
96518edcca748e2e70babe4b1feb331d701d0c46
b9f81c9e3abfce617300a16ffe4df40f45b20b1a
refs/heads/master
2023-03-08T19:31:04.008000
2021-02-26T19:01:25
2021-02-26T19:01:25
342,675,540
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package salon_za_avtomobili.salon.model.excep; public class InvalidArgumentException extends RuntimeException { public InvalidArgumentException() { super("Vnesete argumenti"); } }
UTF-8
Java
197
java
InvalidArgumentException.java
Java
[]
null
[]
package salon_za_avtomobili.salon.model.excep; public class InvalidArgumentException extends RuntimeException { public InvalidArgumentException() { super("Vnesete argumenti"); } }
197
0.751269
0.751269
7
27.142857
23.381485
64
false
false
0
0
0
0
0
0
0.285714
false
false
3
74e6014dd3e55eb1b711ca8977853c7a4f4807f1
4,269,197,564,303
a78dd49a2f98a1bcae935ceff68c981479c67613
/ZIMG-Client/src/main/java/ZIMG/models/User.java
ab8599d302a37603c2b73e99069a5cb25dfce625
[]
no_license
B-Stefan/ZIMG
https://github.com/B-Stefan/ZIMG
a7164450d9b4cbd26682991eb240f0b2711415a2
33f3071f6c3c4b049b92824b577e828bf68631ed
refs/heads/master
2020-12-31T04:07:10.191000
2015-11-20T00:42:49
2015-11-20T00:42:49
34,245,277
1
1
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * ZIMG-JAVA - Game, Copyright 2015 Nils Oke S., Fabian J., Chris P., Stefan Bieliauskas - All Rights Reserved. * Hochschule Bremen - University of Applied Sciences * * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Web: * https://github.com/B-Stefan/ZIMG * */ package ZIMG.models; import javax.persistence.*; import javax.persistence.Entity; import java.util.ArrayList; import java.util.List; @Entity @Table(name="users") @Inheritance(strategy=InheritanceType.JOINED) public class User extends BaseModel { @Column(unique = true) private String email; private String name; private String password; private boolean admin; @Transient private List<Image> lastFiveImages; @OneToMany(mappedBy = "uploader") private List<Image> images = new ArrayList<Image>(); public User(){ } public User(String email, String password){ this.email = email; this.password = password; } public User(String email, String password, String name){ this(email, password); this.name = name; } public String getName(){ return this.name; } public String getEmail(){ return this.email; } public String getPassword(){ return this.password; } public boolean getAdmin(){ return this.admin; } public List<Image> getImages() { return images; } public boolean isAdmin() { return admin; } public void setAdmin(boolean admin) { this.admin = admin; } public void setEmail(String email) { this.email = email; } public void setName(String name) { this.name = name; } public void setPassword(String password) { this.password = password; } public void setImages(List<Image> images) { this.images = images; } public List<Image> getLastFiveImages() { return lastFiveImages; } public void setLastFiveImages(List<Image> lastFiveImages) { this.lastFiveImages = lastFiveImages; } }
UTF-8
Java
2,747
java
User.java
Java
[ { "context": "/*\n * ZIMG-JAVA - Game, Copyright 2015 Nils Oke S., Fabian J., Chris P., Stefan Bieliauskas - All", "end": 50, "score": 0.9998865127563477, "start": 40, "tag": "NAME", "value": "Nils Oke S" }, { "context": "\n * ZIMG-JAVA - Game, Copyright 2015 Nils Oke S., Fabian J., Chris P., Stefan Bieliauskas - All Rights Res", "end": 61, "score": 0.9998757839202881, "start": 53, "tag": "NAME", "value": "Fabian J" }, { "context": "VA - Game, Copyright 2015 Nils Oke S., Fabian J., Chris P., Stefan Bieliauskas - All Rights Reserved.\n * ", "end": 71, "score": 0.9998480081558228, "start": 64, "tag": "NAME", "value": "Chris P" }, { "context": " Copyright 2015 Nils Oke S., Fabian J., Chris P., Stefan Bieliauskas - All Rights Reserved.\n * Hochschule Bremen - U", "end": 92, "score": 0.9998856782913208, "start": 74, "tag": "NAME", "value": "Stefan Bieliauskas" }, { "context": "110-1301, USA.\n\n * Web:\n * https://github.com/B-Stefan/ZIMG\n *\n */\npackage ZIMG.models;\n\nimport javax.pe", "end": 940, "score": 0.8522614240646362, "start": 932, "tag": "USERNAME", "value": "B-Stefan" } ]
null
[]
/* * ZIMG-JAVA - Game, Copyright 2015 <NAME>., <NAME>., <NAME>., <NAME> - All Rights Reserved. * Hochschule Bremen - University of Applied Sciences * * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Web: * https://github.com/B-Stefan/ZIMG * */ package ZIMG.models; import javax.persistence.*; import javax.persistence.Entity; import java.util.ArrayList; import java.util.List; @Entity @Table(name="users") @Inheritance(strategy=InheritanceType.JOINED) public class User extends BaseModel { @Column(unique = true) private String email; private String name; private String password; private boolean admin; @Transient private List<Image> lastFiveImages; @OneToMany(mappedBy = "uploader") private List<Image> images = new ArrayList<Image>(); public User(){ } public User(String email, String password){ this.email = email; this.password = password; } public User(String email, String password, String name){ this(email, password); this.name = name; } public String getName(){ return this.name; } public String getEmail(){ return this.email; } public String getPassword(){ return this.password; } public boolean getAdmin(){ return this.admin; } public List<Image> getImages() { return images; } public boolean isAdmin() { return admin; } public void setAdmin(boolean admin) { this.admin = admin; } public void setEmail(String email) { this.email = email; } public void setName(String name) { this.name = name; } public void setPassword(String password) { this.password = password; } public void setImages(List<Image> images) { this.images = images; } public List<Image> getLastFiveImages() { return lastFiveImages; } public void setLastFiveImages(List<Image> lastFiveImages) { this.lastFiveImages = lastFiveImages; } }
2,728
0.661449
0.655624
115
22.886957
22.972107
114
false
false
0
0
0
0
0
0
0.426087
false
false
3
feef001e962522226a8613d3cc135867a12ad691
36,953,898,656,760
79b6827793303bbfcf844c5038c328ae13ec5267
/eventstore/cassandra/src/main/java/com/grydtech/msstack/eventstore/cassandra/CassandraDBConnector.java
de261eef3c7d478497a2126cdccd2c1c09907624
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
msstack/msstack
https://github.com/msstack/msstack
86aa5b4eaeaf47e4dcc35766d58c3b2b7c696bee
7897571942f686d7283ec72081190c9bd8c8612c
refs/heads/master
2022-12-01T13:22:24.870000
2019-12-03T20:29:37
2019-12-03T20:29:37
128,061,029
3
8
Apache-2.0
false
2022-11-16T09:00:01
2018-04-04T12:47:05
2019-12-03T20:29:41
2022-11-16T09:00:00
414
2
7
13
Java
false
false
package com.grydtech.msstack.eventstore.cassandra; import com.datastax.driver.core.Cluster; import com.datastax.driver.core.Host; import com.datastax.driver.core.Metadata; import com.datastax.driver.core.Session; import com.grydtech.msstack.config.ConfigKey; import com.grydtech.msstack.config.ConfigurationProperties; import com.grydtech.msstack.core.connectors.eventstore.EventStoreConnector; import com.grydtech.msstack.core.types.messaging.Event; import com.grydtech.msstack.eventstore.cassandra.repository.EventRepository; import com.grydtech.msstack.eventstore.cassandra.repository.KeyspaceRepository; import java.util.ArrayList; import java.util.List; import java.util.UUID; import java.util.logging.LogManager; import java.util.logging.Logger; /** * Created by dileka on 9/21/18. */ public final class CassandraDBConnector extends EventStoreConnector<UUID, Event> { private static final Logger LOG = LogManager.getLogManager().getLogger(CassandraDBConnector.class.getName()); private Cluster cluster; private Session session; private EventRepository eventRepository; @Override public void push(Event event) { eventRepository.insertEvent(event); } @Override public Event get(UUID uuid) { return eventRepository.selectEventByUUID(uuid); } @Override public List<Event> get(String topic) { List<? extends Event> events = eventRepository.selectAllEventByTopic(topic); return new ArrayList<>(events); } @Override public void connect() { // Configuration String dbName = ConfigurationProperties.get(ConfigKey.EVENTSTORE_NAME); String dbHost = ConfigurationProperties.get(ConfigKey.EVENTSTORE_HOST); int dbPort = Integer.parseInt(ConfigurationProperties.get(ConfigKey.EVENTSTORE_PORT)); // Cluster this.cluster = Cluster.builder().withClusterName(dbName).addContactPoint(dbHost).withPort(dbPort).build(); Metadata metadata = cluster.getMetadata(); LOG.info("Cluster Name: " + metadata.getClusterName()); for (Host host : metadata.getAllHosts()) { LOG.info("Data Center: " + host.getDatacenter() + "| Host: " + host.getAddress() + "| Rack: " + host.getRack()); } // Connect this.session = cluster.connect(); this.configureAfterConnect(); } private void configureAfterConnect() { KeyspaceRepository sr = new KeyspaceRepository(session); sr.createKeyspace("eventStoreConfiguration", "SimpleStrategy", 2); sr.useKeyspace("library"); eventRepository = new EventRepository(session); eventRepository.createTable(); eventRepository.alterTableEvents("publisher", "text"); eventRepository.createTableEventsByTopic(); } @Override public void disconnect() { session.close(); cluster.close(); } }
UTF-8
Java
2,902
java
CassandraDBConnector.java
Java
[ { "context": "mport java.util.logging.Logger;\n\n/**\n * Created by dileka on 9/21/18.\n */\npublic final class CassandraDBCon", "end": 779, "score": 0.9995954632759094, "start": 773, "tag": "USERNAME", "value": "dileka" } ]
null
[]
package com.grydtech.msstack.eventstore.cassandra; import com.datastax.driver.core.Cluster; import com.datastax.driver.core.Host; import com.datastax.driver.core.Metadata; import com.datastax.driver.core.Session; import com.grydtech.msstack.config.ConfigKey; import com.grydtech.msstack.config.ConfigurationProperties; import com.grydtech.msstack.core.connectors.eventstore.EventStoreConnector; import com.grydtech.msstack.core.types.messaging.Event; import com.grydtech.msstack.eventstore.cassandra.repository.EventRepository; import com.grydtech.msstack.eventstore.cassandra.repository.KeyspaceRepository; import java.util.ArrayList; import java.util.List; import java.util.UUID; import java.util.logging.LogManager; import java.util.logging.Logger; /** * Created by dileka on 9/21/18. */ public final class CassandraDBConnector extends EventStoreConnector<UUID, Event> { private static final Logger LOG = LogManager.getLogManager().getLogger(CassandraDBConnector.class.getName()); private Cluster cluster; private Session session; private EventRepository eventRepository; @Override public void push(Event event) { eventRepository.insertEvent(event); } @Override public Event get(UUID uuid) { return eventRepository.selectEventByUUID(uuid); } @Override public List<Event> get(String topic) { List<? extends Event> events = eventRepository.selectAllEventByTopic(topic); return new ArrayList<>(events); } @Override public void connect() { // Configuration String dbName = ConfigurationProperties.get(ConfigKey.EVENTSTORE_NAME); String dbHost = ConfigurationProperties.get(ConfigKey.EVENTSTORE_HOST); int dbPort = Integer.parseInt(ConfigurationProperties.get(ConfigKey.EVENTSTORE_PORT)); // Cluster this.cluster = Cluster.builder().withClusterName(dbName).addContactPoint(dbHost).withPort(dbPort).build(); Metadata metadata = cluster.getMetadata(); LOG.info("Cluster Name: " + metadata.getClusterName()); for (Host host : metadata.getAllHosts()) { LOG.info("Data Center: " + host.getDatacenter() + "| Host: " + host.getAddress() + "| Rack: " + host.getRack()); } // Connect this.session = cluster.connect(); this.configureAfterConnect(); } private void configureAfterConnect() { KeyspaceRepository sr = new KeyspaceRepository(session); sr.createKeyspace("eventStoreConfiguration", "SimpleStrategy", 2); sr.useKeyspace("library"); eventRepository = new EventRepository(session); eventRepository.createTable(); eventRepository.alterTableEvents("publisher", "text"); eventRepository.createTableEventsByTopic(); } @Override public void disconnect() { session.close(); cluster.close(); } }
2,902
0.713646
0.711578
81
34.82716
29.908829
124
false
false
0
0
0
0
0
0
0.592593
false
false
3
a8c93b249ee7e7bb2da6d3fefc4d42643c24c50d
11,862,699,726,763
6a10141144d11b00ff4d277404e2a04c2e59f2ed
/src/main/java/io/github/prepayments/rep1/service/report/AmortizationReportGeneratorService.java
0dc14d6656be2460cfd949354c277526d38de0b6
[]
no_license
prepayments/prepayments_rep1
https://github.com/prepayments/prepayments_rep1
8e70f5043e88d9e44e8050475a89d2af05beab47
9057f0eda45f49bfb75a8375409eedc8a8d43456
refs/heads/master
2020-05-25T06:58:30.526000
2019-05-22T09:13:33
2019-05-22T09:13:33
187,676,626
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package io.github.prepayments.rep1.service.report; import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand; import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty; import io.github.prepayments.rep1.service.clients.PrepaymentsService; import io.github.prepayments.rep1.service.ReportGeneratorService; import io.github.prepayments.rep1.service.dto.AmortizationEntryDTO; import io.github.prepayments.rep1.service.dto.GeneratedReportDTO; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.Objects; import java.util.Optional; import static io.github.prepayments.rep1.service.impl.FileInputUtil.createExcelFile; @Slf4j @Transactional @Service("amortizationReportGeneratorService") public class AmortizationReportGeneratorService implements ReportGeneratorService { private final PrepaymentsService prepaymentsservice; @Autowired public AmortizationReportGeneratorService(final PrepaymentsService prepaymentsservice) { this.prepaymentsservice = prepaymentsservice; } @HystrixCommand(commandProperties = {@HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "30000")}) @Override public Optional<GeneratedReportDTO> generateReport(String reportTitle, String reportType) { List<AmortizationEntryDTO> amortizationEntries = prepaymentsservice.getAllAmortizationEntries(); log.debug("Fetched {} amortization entry items from the prepaymentService", amortizationEntries.size()); byte[] dataFile = createExcelFile(amortizationEntries, AmortizationEntryDTO.class); GeneratedReportDTO dto = GeneratedReportDTO.builder() .reportTitle(reportTitle) .reportType(reportType) .reportFile(dataFile) .reportFileContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") .build(); return Optional.of(Objects.requireNonNull(dto)); } }
UTF-8
Java
2,338
java
AmortizationReportGeneratorService.java
Java
[]
null
[]
package io.github.prepayments.rep1.service.report; import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand; import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty; import io.github.prepayments.rep1.service.clients.PrepaymentsService; import io.github.prepayments.rep1.service.ReportGeneratorService; import io.github.prepayments.rep1.service.dto.AmortizationEntryDTO; import io.github.prepayments.rep1.service.dto.GeneratedReportDTO; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.Objects; import java.util.Optional; import static io.github.prepayments.rep1.service.impl.FileInputUtil.createExcelFile; @Slf4j @Transactional @Service("amortizationReportGeneratorService") public class AmortizationReportGeneratorService implements ReportGeneratorService { private final PrepaymentsService prepaymentsservice; @Autowired public AmortizationReportGeneratorService(final PrepaymentsService prepaymentsservice) { this.prepaymentsservice = prepaymentsservice; } @HystrixCommand(commandProperties = {@HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "30000")}) @Override public Optional<GeneratedReportDTO> generateReport(String reportTitle, String reportType) { List<AmortizationEntryDTO> amortizationEntries = prepaymentsservice.getAllAmortizationEntries(); log.debug("Fetched {} amortization entry items from the prepaymentService", amortizationEntries.size()); byte[] dataFile = createExcelFile(amortizationEntries, AmortizationEntryDTO.class); GeneratedReportDTO dto = GeneratedReportDTO.builder() .reportTitle(reportTitle) .reportType(reportType) .reportFile(dataFile) .reportFileContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") .build(); return Optional.of(Objects.requireNonNull(dto)); } }
2,338
0.726689
0.720701
53
43.113209
39.243633
142
false
false
0
0
0
0
0
0
0.490566
false
false
3
ae56bff1a14bae181251ae7c5bfc3f66fd7c11f7
33,457,795,300,259
43b30286f24f347d03f6f47a5340ae40a6d8fdb0
/spring与mybatis补充部分/SpringUnit03(spring与ajax)/src/com/tarena/dao/EmpDao.java
c0310f08304c26d0c279c711060c1965f85cef9d
[]
no_license
qixinglan/java
https://github.com/qixinglan/java
399a1c9f13bcfc751ad04d4bebb0ff0f81d7629c
a82ddb3cd75033e5c2458b1231124c4077faec71
refs/heads/master
2020-03-19T11:33:29.766000
2018-06-07T10:44:16
2018-06-07T10:44:16
136,461,358
2
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.tarena.dao; import java.util.List; import com.tarena.annotation.MyBatisRepository; import com.tarena.entity.Condition; import com.tarena.entity.Emp; /** * 员工表的DAO组件 */ @MyBatisRepository public interface EmpDao { List<Emp> findByDept(Condition cond); List<Emp> findBySalary(Condition cond); List<Emp> findByDeptAndSalary(Condition cond); List<Emp> findByDeptAndSalary2(Condition cond); void update(Emp emp); void update2(Emp emp); List<Emp> findByIds(Condition cond); }
GB18030
Java
520
java
EmpDao.java
Java
[]
null
[]
package com.tarena.dao; import java.util.List; import com.tarena.annotation.MyBatisRepository; import com.tarena.entity.Condition; import com.tarena.entity.Emp; /** * 员工表的DAO组件 */ @MyBatisRepository public interface EmpDao { List<Emp> findByDept(Condition cond); List<Emp> findBySalary(Condition cond); List<Emp> findByDeptAndSalary(Condition cond); List<Emp> findByDeptAndSalary2(Condition cond); void update(Emp emp); void update2(Emp emp); List<Emp> findByIds(Condition cond); }
520
0.753937
0.75
29
16.517241
17.0529
48
false
false
0
0
0
0
0
0
0.862069
false
false
3