blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
131 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
32 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
313
74c5e57fe14aea2b4c8661af75278034796a982f
f904a407b1062ab29383f37f82c85c89ce5febef
/app/src/main/java/com/example/football2/auxiliary/DataMatch.java
e94aa0eb7b9274862afc69bd20fd60e54acb4e3d
[]
no_license
tenn5/kurs
67420e2285214c8601558e22187762b2dce2d699
d156fae4df966bf1b0bbf979cf98d3e092c520ff
refs/heads/master
2023-05-03T01:31:53.435180
2021-05-22T21:53:49
2021-05-22T21:53:49
358,564,762
0
0
null
null
null
null
UTF-8
Java
false
false
466
java
package com.example.football2.auxiliary; import android.widget.Spinner; import com.example.football2.constants.Country; public class DataMatch { private Spinner spinner; private Country country; public DataMatch(Spinner spinner, Country country) { this.spinner = spinner; this.country = country; } public Spinner getSpinner() { return spinner; } public Country getCountry() { return country; } }
[ "keosakartem@gmail.com" ]
keosakartem@gmail.com
b64a5403b9815d38a2412cf997b032270152de5e
a0e51496ff8c2f1d4d98bc7888d1d660490b832f
/yeshttp/app/src/main/java/com/my/yeshttp/base/DataResponse.java
e9c6ee7c43599100c0e9d5fb434ce5bd4135eb6f
[]
no_license
xdhfir/xdd
ce027d8d744492819e766464a902a714f0ada138
0df93556e4b8605057196ddb9a1c10fbc0f6e200
refs/heads/master
2020-07-25T21:01:02.902391
2019-09-15T08:25:53
2019-09-15T08:25:53
208,422,823
1
0
null
null
null
null
UTF-8
Java
false
false
619
java
package com.my.yeshttp.base; /** * 网络请求的通用返回格式 */ public class DataResponse<T> { public String status; public String message; public String dataCount; public T data; public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public T getData() { return data; } public void setData(T data) { this.data = data; } }
[ "387974911@qq.com" ]
387974911@qq.com
cf10f45344a2302a2e35d18ea87ce0bfa9cd52e7
5538d7beb441e7cee3cb4ae21c5aae54f6b93350
/stack-springboot-domain/src/main/java/org/robinkyou/stack/demo/domain/common/BizResponse.java
0c28df0df8469b2b9872f639c892cbec5c1487ad
[ "Apache-2.0" ]
permissive
robinkyou/stack-springboot
9899bd208d3d2563dd47132d7110cbde4f253e69
614de3777545fa8dfe8194a326ec2bedd5f0e726
refs/heads/master
2022-07-03T01:43:07.194671
2020-10-17T15:38:00
2020-10-17T15:38:00
216,862,004
0
0
Apache-2.0
2022-06-17T03:29:01
2019-10-22T16:39:54
Java
UTF-8
Java
false
false
1,781
java
package org.robinkyou.stack.demo.domain.common; import org.robinkyou.stack.demo.domain.enums.ResultCodeEnum; public class BizResponse<T> { private String resultCode; private String resultMessage; private T data; public BizResponse() { } public static <T> BizResponse<T> buildSuccessResult(T data) { BizResponse<T> bizResponse = new BizResponse<>(); bizResponse.setData(data); bizResponse.setResultCode(ResultCodeEnum.SUCCESS.getResultCode()); bizResponse.setResultMessage(ResultCodeEnum.SUCCESS.getResultMessage()); return bizResponse; } public static <T> BizResponse<T> buildFailResult(T data) { BizResponse<T> bizResponse = new BizResponse<>(); bizResponse.setData(data); bizResponse.setResultCode(ResultCodeEnum.FAIL.getResultCode()); bizResponse.setResultMessage(ResultCodeEnum.FAIL.getResultMessage()); return bizResponse; } public static <T> BizResponse<T> buildResult(T data, ResultCodeEnum resultCodeEnum) { BizResponse<T> bizResponse = new BizResponse<>(); bizResponse.setData(data); bizResponse.setResultCode(resultCodeEnum.getResultCode()); bizResponse.setResultMessage(resultCodeEnum.getResultMessage()); return bizResponse; } public String getResultCode() { return resultCode; } public void setResultCode(String resultCode) { this.resultCode = resultCode; } public String getResultMessage() { return resultMessage; } public void setResultMessage(String resultMessage) { this.resultMessage = resultMessage; } public T getData() { return data; } public void setData(T data) { this.data = data; } }
[ "qiaoruigang@gmail.com" ]
qiaoruigang@gmail.com
3a0e27a45117d95f1a60b67c0d597add12f3ff57
2c6de277d081953d40142df0fd9b3f7b7b2898c0
/2.JavaCore/src/com/javarush/task/task12/task1206/Solution.java
d72e58dc1a68983c32cfb107d00e238fba8da1ad
[]
no_license
KosBlow/JavaRushTasks
8c8b4a1fed228bfa81d840b69894dc5bfd171adb
782504f1fc86ab7e4ddf652f94d2ff6329cc8b9c
refs/heads/master
2022-11-26T23:42:19.121550
2020-08-09T15:59:24
2020-08-09T15:59:24
272,177,699
0
0
null
null
null
null
UTF-8
Java
false
false
302
java
package com.javarush.task.task12.task1206; /* Выполняем перегрузку! */ public class Solution { public static void main(String[] args) { } public static void print(int a){} public static void print(String a){} //Напишите тут ваши методы }
[ "besednikovkonstantin@gmail.com" ]
besednikovkonstantin@gmail.com
1224269d19d11d13364a3c8731b3adc7ded76a61
eb4f6544ba12ad74e24408dc2787b70176704726
/inheritance2/src/inheritance2/Main.java
466aa16922af73e914132a681ec0c8117c7083d0
[]
no_license
miracthis/JavaBootcamp
6911b5b512986da3f36822c8f3fa71ea80357f57
e69286e378d1f0be331481195f5743d42fe0d765
refs/heads/main
2023-06-06T12:31:26.212885
2021-06-13T22:55:14
2021-06-13T22:55:14
364,584,881
4
0
null
null
null
null
UTF-8
Java
false
false
225
java
package inheritance2; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub CustomerManager customerManager = new CustomerManager(); customerManager.add(new SmsLogger()); } }
[ "mirac@matabt.com" ]
mirac@matabt.com
4ec7768681d70044b73bad1ecf8a693244743ca9
44a0e67273389aea6e0927559312729e9d3f5675
/fili-core/src/main/java/com/yahoo/bard/webservice/web/TableMetadataFormatter.java
18ca4feddb7ff7a2e8ef7be76c4821c71ae738ad
[ "Apache-2.0" ]
permissive
gitter-badger/fili
0159aae7d624dbfa4569a4fdd466c7c7d8819235
2adb1220975bee91fe2ecd0cbbe43380aea39df9
refs/heads/master
2020-12-25T16:03:06.076889
2016-06-21T16:33:35
2016-06-21T16:33:35
61,657,132
0
0
null
2016-06-21T18:27:16
2016-06-21T18:27:15
null
UTF-8
Java
false
false
1,547
java
// Copyright 2016 Yahoo Inc. // Licensed under the terms of the Apache license. Please see LICENSE file distributed with this work for terms. package com.yahoo.bard.webservice.web; import com.yahoo.bard.webservice.table.LogicalTable; import java.util.List; import java.util.Set; import javax.ws.rs.core.UriInfo; public interface TableMetadataFormatter { /** * Method to provide a list of TableViews which have a complete view of all the tables * and underlying information * * @param logicalTableList List of logical tables * @param uriInfo Uri information to construct the uri's * * @return List of table views which contains full vew of each table */ List<TableView> formatTables(Set<LogicalTable> logicalTableList, UriInfo uriInfo); /** * Method to provide a representation of a table and underlying information * * @param logicalTable Logical Table * @param uriInfo Uri information to construct the uri's * * @return Table which contains complete view */ TableView formatTable(LogicalTable logicalTable, UriInfo uriInfo); /** * Method to provide a representation of a table at grain level * * @param logicalTable Logical Table * @param grain Table grain * @param uriInfo Uri information to construct the uri's * * @return Table details with all the metrics and dimension details for given grain */ TableGrainView formatTableGrain(LogicalTable logicalTable, String grain, UriInfo uriInfo); }
[ "mclawhor@yahoo-inc.com" ]
mclawhor@yahoo-inc.com
7c44de61bd7acae7085cfd2a76c94ccd7249c0a5
b23e110233523bd5f1e38867f304dd84b6c1bb80
/app/src/androidTest/java/com/example/androidhelloworld/ExampleInstrumentedTest.java
2f82fb4873e3b3d5ae64c7874fae7ae198cf21e5
[]
no_license
WoodsGeo442/cst338
0ac77a01cead6465ba75b784b4a679963eefc2e8
56bce828aa3ad2deca9db0dea3e0093bf65c7482
refs/heads/master
2020-12-29T07:40:59.350320
2020-11-13T21:49:40
2020-11-13T21:49:40
238,517,515
0
0
null
null
null
null
UTF-8
Java
false
false
773
java
package com.example.androidhelloworld; import android.content.Context; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); assertEquals("com.example.androidhelloworld", appContext.getPackageName()); } }
[ "gewoods@csumb.edu" ]
gewoods@csumb.edu
6dba70a1d559a5c2d152c48b7ef27d500935c5be
fa9ecd0c26cce912080994e57f4278237d3ebf6d
/src/main/java/com/estsoft/mysite/aspect/MeasureDaoExecutionTimeAspect.java
fbee1cd00aeee8c84e0ead36ecd8b965c263987a
[]
no_license
kisay97/mysite3
e9a35c31ef0d94f7bca366cbcaeb13162e934e68
f39a197e168b36156c8af67313fdfb6df392c441
refs/heads/master
2016-09-13T11:29:54.651605
2016-05-03T03:06:45
2016-05-03T03:06:45
57,280,451
0
0
null
null
null
null
UTF-8
Java
false
false
1,060
java
package com.estsoft.mysite.aspect; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; import org.springframework.stereotype.Component; import org.springframework.util.StopWatch; @Component @Aspect public class MeasureDaoExecutionTimeAspect { @Around("execution( * *..dao.*.*(..) ) || execution( * *..service.*.*(..) ) || execution( * *..controller.*.*(..) )") public Object around(ProceedingJoinPoint pjp) throws Throwable{ //Before(전처리) String taskName = pjp.getTarget().getClass() + "." + pjp.getSignature().getName(); //실행한 메서드의 이름을 받아온다 StopWatch stopWatch = new StopWatch(); stopWatch.start(); Object result = pjp.proceed(); //pjp.proceed()를 해주면 실제 함수 실행됨 //After(후처리) stopWatch.stop(); System.out.println( taskName + " : " + stopWatch.getTotalTimeMillis() + "millis"); return result; //실행한 결과를 따로 돌려줘야함 } }
[ "bit@bit_pc" ]
bit@bit_pc
21cfcd6f09154b592ce638cfabd97885ab54a4aa
4ab345435bd094dcfdb254bc608a17f73458139b
/Car.java
0e02f52f9afc83430360f93db5f53d7a4635299e
[]
no_license
WaleedMortaja/Draw-a-simple-car
778b81a5767fec1f9460b6b4c021177c991a5070
fd270ec57424dd05f61e9fbc64473c60be71fafa
refs/heads/master
2021-01-20T02:08:42.025083
2017-05-04T14:24:56
2017-05-04T14:24:56
89,380,666
0
0
null
null
null
null
UTF-8
Java
false
false
1,346
java
/** * * @author Waleed Mortaja, *contact Email : <a href="mailto:waleed.mortaja@gmail.com">waleed.mortaja@gmail.com</a> */ import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.geom.Ellipse2D; import java.awt.geom.Line2D; import javax.swing.JComponent; public class Car extends JComponent { @Override protected void paintComponent(Graphics g) { Graphics2D gr = (Graphics2D) g; Line2D.Double l1 = new Line2D.Double(200, 200, 300, 200); Line2D.Double l2 = new Line2D.Double(200, 200, 150, 250); Line2D.Double l3 = new Line2D.Double(150, 250, 100, 250); Line2D.Double l4 = new Line2D.Double(100, 250, 100, 300); Line2D.Double l5 = new Line2D.Double(100, 300, 400, 300); Line2D.Double l6 = new Line2D.Double(400, 300, 400, 250); Line2D.Double l7 = new Line2D.Double(400, 250, 350, 250); Line2D.Double l8 = new Line2D.Double(350, 250, 300, 200); Ellipse2D.Double e1 = new Ellipse2D.Double(275,275,50,50); Ellipse2D.Double e2 = new Ellipse2D.Double(175,275,50,50); gr.draw(l1); gr.draw(l2); gr.draw(l3); gr.draw(l4); gr.draw(l5); gr.draw(l6); gr.draw(l7); gr.draw(l8); gr.draw(e1); gr.draw(e2); } }
[ "noreply@github.com" ]
WaleedMortaja.noreply@github.com
a65669e9a37507b0628704273135280310ced369
6e6124da86038ed930afa0ffa00e9db2b5ee5361
/src/main/java/BrowserDriver.java
62d22a132c5391f4456321afc9a3d93a019d7f60
[]
no_license
PavGurin/alfaTestNew
71d4e728ac25990cec8d3f81ecc3a9fc6035ea44
661806de6048ef9b58c8ed97a536b3896f2eb015
refs/heads/master
2021-09-28T07:57:42.085217
2018-11-15T15:50:06
2018-11-15T15:50:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,265
java
import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.remote.UnreachableBrowserException; public class BrowserDriver { private static WebDriver driver; private synchronized static WebDriver getCurrentDriver() { if (driver ==null) { try { driver = new ChromeDriver(); } finally{ Runtime.getRuntime().addShutdownHook( new Thread(new BrowserCleanup())); } } return driver; } private static class BrowserCleanup implements Runnable { public void run() { System.out.println("Закрытие браузера"); close(); } } private static void close() { try { getCurrentDriver().quit(); driver = null; System.out.println("Закрытие браузера"); } catch (UnreachableBrowserException e) { System.out.println("Невозможно закрыть браузер: unreachable browser"); } } public static void loadPage(String url){; System.out.println("Directing browser to:" + url); getCurrentDriver().get(url); } }
[ "kalliak1993@yandex.ru" ]
kalliak1993@yandex.ru
1bac0c4602144f5910eedd246a02a8d864caa0fe
030562c989b91536e2946f07568f976431477ef1
/src/FunctionLib/AppLib.java
21aa2bb1855d184a87aecf530a2c1b3866d72112
[]
no_license
prasad361/PeopleSoft_Automation
43d0a971dbaf41aeead37b5c390b2356b1b22280
856f87132ae7322c279306cc57ec78f1d5176eeb
refs/heads/master
2020-05-09T23:57:48.771853
2019-05-16T16:28:18
2019-05-16T16:28:18
181,516,914
0
0
null
null
null
null
UTF-8
Java
false
false
10,271
java
package FunctionLib; import java.io.IOException; import java.util.Set; import org.openqa.selenium.By; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.Keys; import org.openqa.selenium.WebDriver; import org.openqa.selenium.ie.InternetExplorerDriver; import org.openqa.selenium.chrome.*; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.support.ui.WebDriverWait; import Configuration.ReadConfig; import pageObjects.*; public class AppLib { public static WebDriver driver; public static WebDriverWait wait; public static String browser = "chrome"; public static String QRACurl = "https://qa-resources.coxinc.com/psp/cehqrac/?cmd=login"; public static String QA1url = "https://qa1-resources.coxinc.com/psp/CEH92QA1/?cmd=login"; public static String QA2url = "https://qadev92-resources.coxinc.com/psp/CEH92QA2/?cmd=login&languageCd=ENG&"; public static String QA3url = "https://qa3-resources.coxinc.com/psp/CEH92QA3/?cmd=login&languageCd=ENG&"; public static String empid = "00599020"; /* * public static String devgoal = "DevGoal_4/9 - 3:40"; public static String * enddate = "12/31/19"; public static String description = * "Make Selenium Automation a big success"; public static String * updated_Devgoalname = devgoal + "_updated"; public static String perfgoal = * "PerfGoal_4/10 - 3:40"; public static String updated_Perfgoalname = perfgoal * + "_updated"; */ //test for working with branches public static void Login(String emplid, String Pwd) throws IOException, InterruptedException { // TODO Auto-generated method stub //driver = new InternetExplorerDriver(); //Get url and browser type from Config file //String url = ReadConfig.GetData("url"); //System.setProperty("webdriver.chrome.driver", "D:\\prasad ramdasu\\COX_PROJECT\\COX_Automation\\selinium\\Selenium_Chrome\\chromedriver.exe"); if (browser.equalsIgnoreCase("IE")) driver = new InternetExplorerDriver(); else if (browser.equalsIgnoreCase("CHROME")) driver = new ChromeDriver(); else if (browser.equalsIgnoreCase("FIREFOX")) driver = new FirefoxDriver(); driver.manage().window().maximize(); //driver.get(QRACurl); //driver.get(QA1url); //driver.get(QA2url); driver.get(QA3url); Login.txt_Userid(driver).sendKeys(emplid); Login.txt_Pwd(driver).sendKeys(Pwd); Login.Btn_Signin(driver).click(); //Login_Page.txt_Pwd(driver).sendKeys(Pwd, Keys.ENTER); //wait.until(ExpectedConditions.elementToBeClickable(Login_Page.btn_SignIn(driver))); //Login_Page.btn_SignIn(driver).click(); System.out.println("Login successful"); } // Navigate to job data // 1) Click on navigation bar 2) select favorites 3) click Job data public static void Jobdata() throws InterruptedException { //Home_Page.lnk_MyDeskDbd(driver).wait(5000); Home.Navigationbar(driver).click(); Thread.sleep(3000); Home.MenuMyfav(driver).click(); Thread.sleep(2000); Home.MenuJobdata(driver).click(); Thread.sleep(2000); } // Emp search //1) enter the empl data 2) hit search button //public static void Emp_Search() throws InterruptedException public static void Emp_Search() throws InterruptedException { Home.txt_Empid(driver).sendKeys(empid); Thread.sleep(2000); Home.Btn_Search(driver).click(); Thread.sleep(5000); } //Termination flow public static void HRTermination() throws InterruptedException { Home.Addrow(driver).click(); Thread.sleep(8000); //Home.Effectivedate(driver).click(); //Home.Effectivedate(driver).clear(); //System.out.println("Clicked on Effective date filed"); //Home.Effectivedate(driver).sendKeys("05/11/2019"); Home.Drop_Action(driver).click(); Thread.sleep(5000); Home.ActionValue_Termination(driver).getText(); Thread.sleep(5000); Home.Drop_Reason(driver).click(); Thread.sleep(5000); Home.ReasonValue_Termination(driver).getText(); Thread.sleep(5000); Home.Btn_Save(driver).click(); Thread.sleep(9000); String HRstatus= driver.findElement(By.xpath("//span[@id='JOB_HR_STATUS$0']")).getText(); System.out.println("HR status :" + HRstatus); Thread.sleep(6000); String PayrollStatus=driver.findElement(By.xpath("//span[@id='JOB_EMPL_STATUS$0']")).getText(); System.out.println("Payroll Status : " +PayrollStatus); } // Leave of absence public static void LeaveOfAbsence() throws InterruptedException { Home.Addrow(driver).click(); Thread.sleep(6000); Home.Drop_Action(driver).click(); Thread.sleep(5000); Home.ActionValue_LeaveAbsence(driver).getText(); Thread.sleep(5000); Home.Drop_Reason(driver).click(); Thread.sleep(5000); Home.ReasonValue_LeaveofAbsence(driver).getText(); Thread.sleep(5000); Home.Btn_Save(driver).click(); Thread.sleep(9000); String HRstatus= driver.findElement(By.xpath("//span[@id='JOB_HR_STATUS$0']")).getText(); System.out.println("HR status :" + HRstatus); Thread.sleep(6000); String PayrollStatus=driver.findElement(By.xpath("//span[@id='JOB_EMPL_STATUS$0']")).getText(); System.out.println("Payroll Status : " +PayrollStatus); } // paid leave of Absence public static void PaidLeaveOfAbsence() throws InterruptedException { Home.Addrow(driver).click(); Thread.sleep(6000); Home.Drop_Action(driver).click(); Thread.sleep(5000); Home.ActionValue_PaidLeaveAbsence(driver).getText(); Thread.sleep(5000); Home.Drop_Reason(driver).click(); Thread.sleep(5000); Home.ReasonValue_PaidLeaveofAbsence(driver).getText(); Thread.sleep(5000); Home.Btn_Save(driver).click(); Thread.sleep(9000); String HRstatus= driver.findElement(By.xpath("//span[@id='JOB_HR_STATUS$0']")).getText(); System.out.println("HR status :" + HRstatus); Thread.sleep(6000); String PayrollStatus=driver.findElement(By.xpath("//span[@id='JOB_EMPL_STATUS$0']")).getText(); System.out.println("Payroll Status : " +PayrollStatus); } //Short term disability public static void ShortTermDisability() throws InterruptedException { Home.Addrow(driver).click(); Thread.sleep(6000); Home.Drop_Action(driver).click(); Thread.sleep(5000); Home.ActionValue_ShortTermDisability(driver).getText(); Thread.sleep(5000); Home.Drop_Reason(driver).click(); Thread.sleep(5000); Home.ReasonValue_ShortTermDisability(driver).getText(); Thread.sleep(5000); Home.Btn_Save(driver).click(); Thread.sleep(9000); String HRstatus= driver.findElement(By.xpath("//span[@id='JOB_HR_STATUS$0']")).getText(); System.out.println("HR status :" + HRstatus); Thread.sleep(6000); String PayrollStatus=driver.findElement(By.xpath("//span[@id='JOB_EMPL_STATUS$0']")).getText(); System.out.println("Payroll Status : " +PayrollStatus); } //data change public static void DataChange() throws InterruptedException { Home.Addrow(driver).click(); Thread.sleep(6000); Home.Drop_Action(driver).click(); Thread.sleep(8000); Home.ActionValue_Datachange(driver).getText(); Thread.sleep(8000); Home.Drop_Reason(driver).click(); Thread.sleep(8000); Home.ReasonValue_Datachang(driver).getText(); Thread.sleep(8000); //Home.Jobinfo(driver).click(); //Thread.sleep(3000); //Home.Txt_Jobcode(driver).clear(); //Home.Txt_Jobcode(driver).sendKeys("TEC301"); //Thread.sleep(3000); //Home.Txt_SupervisorId(driver).clear(); //Home.Txt_SupervisorId(driver).sendKeys("00281042"); //Thread.sleep(3000); Home.Btn_Save(driver).click(); Thread.sleep(6000); //click on "OK" button //driver.findElement(By.xpath("//input[@title='Ok (Enter)']")).click(); Thread.sleep(8000); String HRstatus= driver.findElement(By.xpath("//span[@id='JOB_HR_STATUS$0']")).getText(); System.out.println("HR status :" + HRstatus); Thread.sleep(6000); String PayrollStatus=driver.findElement(By.xpath("//span[@id='JOB_EMPL_STATUS$0']")).getText(); System.out.println("Payroll Status : " +PayrollStatus); } //TC012:Family status Change public static void FamilyStatus() throws InterruptedException { Home.Addrow(driver).click(); Thread.sleep(12000); Home.Drop_Action(driver).click(); Thread.sleep(8000); Home.ActionValue_FamilyChange(driver).getText(); Thread.sleep(20000); Home.Drop_Reason(driver).click(); Thread.sleep(8000); Home.ReasonValue_FamilyChange(driver).getText(); Thread.sleep(20000); Home.Btn_Save(driver).click(); Thread.sleep(15000); String HRstatus= driver.findElement(By.xpath("//span[@id='JOB_HR_STATUS$0']")).getText(); System.out.println("HR status :" + HRstatus); Thread.sleep(10000); String PayrollStatus=driver.findElement(By.xpath("//span[@id='JOB_EMPL_STATUS$0']")).getText(); System.out.println("Payroll Status : " +PayrollStatus); } // TC03:terminate the employee public static void TerminateEmp() throws InterruptedException { Home.Addrow(driver).click(); Thread.sleep(3000); //Home.Drop_Action(driver).click(); Thread.sleep(2000); //Home.Termination(driver).click(); Thread.sleep(2000); //Home.Drop_Reason(driver).click(); Thread.sleep(2000); //Home.Notrenewed(driver).click(); Thread.sleep(2000); Home.Btn_Save(driver).click(); Thread.sleep(5000); } // Click Work location tab public static void Click_Worklocation() throws InterruptedException { Home.WorkInfo(driver).click(); } // Click Job information tab public static void Click_Jobinformation() throws InterruptedException { Home.Jobinfo(driver).click(); } // Click Home icon to navigate to home page public static void Img_Home() throws InterruptedException { Home.ImgHome(driver).click(); } // Logout ( click on Action list icon, click signout and close the browser public static void Signout() throws InterruptedException { Logout.Imgactionlist(driver).click(); Thread.sleep(3000); Logout.Btn_Signout(driver).click(); Thread.sleep(3000); driver.close(); } }
[ "Dream@#123" ]
Dream@#123
954f9cf3809a2cade246607f5059ba42e6477590
3c2a3eaa0ca3dd9612d9b21cc53d988d110cf431
/src/main/java/com/bjpowernode/crm/workbench/dao/CustomerDao.java
e4e5f812864483d6230b96f3096a8cdfc2ff04f5
[]
no_license
buaaxyc/crm01b_xyc_remote
ed27e25b7397f29906a88a8693274eecdd41f979
17b20c1a546f7607abdfffd31967ea24d609bbba
refs/heads/master
2020-05-15T15:47:19.134578
2019-04-20T10:34:15
2019-04-20T10:34:15
182,380,022
0
0
null
null
null
null
UTF-8
Java
false
false
289
java
package com.bjpowernode.crm.workbench.dao; import com.bjpowernode.crm.workbench.domain.Customer; import java.util.List; public interface CustomerDao { int save(Customer cus); List<String> getCustomerNameListByName(String name); Customer getCustomerbyName(String name); }
[ "xyc@bjpowernode.com" ]
xyc@bjpowernode.com
5c61e9fc922f44cf61ece71b0fe38173f9a07e4e
5a92491be429a8bf54307064e2fa6151faf2e3a1
/src/main/java/board/demo/callapisample/dao/MessageDao.java
ae856235cb47560379ad02880f454f73dd75f90c
[]
no_license
217yahagi/AWS-javascript
afa0d9d0056834f302832fa5d51267eebdf831e5
52ea4149fd30c9002d2ec195f776ea3913ab4621
refs/heads/master
2020-03-23T06:26:17.213143
2018-07-30T08:01:09
2018-07-30T08:01:09
141,209,777
1
0
null
null
null
null
UTF-8
Java
false
false
617
java
package board.demo.callapisample.dao; import board.demo.callapisample.model.Message; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Service; import java.util.List; @Service public class MessageDao { @Autowired private JdbcTemplate jdbcTemplate; public List<org.apache.logging.log4j.message.Message> getAllMessage(){ return jdbcTemplate.query("SELECT user_name, message FROM message", (rs,rowNum) -> new Message(rs.getString("user_name"),rs.getString("Message"))); } }
[ "21711377yy@tama.ac.jp" ]
21711377yy@tama.ac.jp
e033b1c269255bb4acc6ae3273b29fd14d4ed0f3
93d17a4bd94cc648b47890f2d2ce1d7840bad614
/src/ca/trustpoint/m2m/M2mSignatureAlgorithmOids.java
f64e60f3c7da6620a6bcb38c36e8c4395fda63bb
[]
no_license
tommy66666/ECQVextensionClient
f36f88f13ecc06c887f93e762c6d6908529ecbbb
69118d44e05d371643b1bc3943aad0e51eb32649
refs/heads/master
2022-05-17T10:08:17.875495
2020-04-23T09:37:30
2020-04-23T09:37:30
258,097,593
0
0
null
null
null
null
UTF-8
Java
false
false
6,153
java
/** * Copyright 2016 TrustPoint Innovation Technologies, Ltd. * * 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 ca.trustpoint.m2m; /** * Enumerates the ASN.1 object identifiers contained in the M2M spec for the * supported signature algorithms. */ public enum M2mSignatureAlgorithmOids implements SignatureAlgorithmOids { /** * Algorithm ECDSA SHA256 SECP192R1. * * See <a href= * "https://www.ietf.org/rfc/rfc5480.txt">https://www.ietf.org/rfc/rfc5480.txt</a> * for details. */ ECDSA_SHA256_SECP192R1("1.3.186.1.0"), /** * Algorithm ECDAS SHA256 SECP224R1. * * See <a href= * "https://www.ietf.org/rfc/rfc5480.txt">https://www.ietf.org/rfc/rfc5480.txt</a> * for details. */ ECDSA_SHA256_SECP224R1("1.3.186.1.1"), /** * Algorithm ECDSA SH256 SECT233K1. * * See <a href= * "https://www.ietf.org/rfc/rfc5480.txt">https://www.ietf.org/rfc/rfc5480.txt</a> * for details. */ ECDSA_SHA256_SECT233K1("1.3.186.1.2"), /** * Algorithm ECDSA SHA256 SECT233R1. * * See <a href= * "https://www.ietf.org/rfc/rfc5480.txt">https://www.ietf.org/rfc/rfc5480.txt</a> * for details. */ ECDSA_SHA256_SECT233R1("1.3.186.1.3"), /** * Algorithm ECQV SHA256 SECP192R1. * * See <a href= * "http://www.secg.org/draft-sec4-1.1.pdf">http://www.secg.org/draft-sec4-1.1.pdf</a> * for details. */ ECQV_SHA256_SECP192R1("1.3.186.1.4"), /** * Algorithm ECQV SHA256 SECP224R1. * * See <a href= * "http://www.secg.org/draft-sec4-1.1.pdf">http://www.secg.org/draft-sec4-1.1.pdf</a> * for details. */ ECQV_SHA256_SECP224R1("1.3.186.1.5"), /** * Algorithm ECQV SHA256 SECT233K1. * * See <a href= * "http://www.secg.org/draft-sec4-1.1.pdf">http://www.secg.org/draft-sec4-1.1.pdf</a> * for details. */ ECQV_SHA256_SECT233K1("1.3.186.1.6"), /** * Algorithm ECQV SHA256 SECT233R1. * * See <a href= * "http://www.secg.org/draft-sec4-1.1.pdf">http://www.secg.org/draft-sec4-1.1.pdf</a> * for details. */ ECQV_SHA256_SECT233R1("1.3.186.1.7"), /** * Algorithm RSA SHA256 RSA. * * See <a href= * "https://www.ietf.org/rfc/rfc6594.txt">https://www.ietf.org/rfc/rfc6594.txt</a> * for details. */ RSA_SHA256_RSA("1.3.186.1.8"), /** * Algorithm ECDSA SHA256 SECP256R1. * * See <a href= * "https://www.ietf.org/rfc/rfc5480.txt">https://www.ietf.org/rfc/rfc5480.txt</a> * for details. */ ECDSA_SHA256_SECP256R1("1.3.186.1.9"), /** * Algorithm ECQV SHA256 SECP256R1. * * See <a href= * "http://www.secg.org/draft-sec4-1.1.pdf">http://www.secg.org/draft-sec4-1.1.pdf</a> * for details. */ ECQV_SHA256_SECP256R1("1.3.186.1.10"), /** * Algorithm ECDSA SHA384 SECP384R1. * * See <a href= * "https://www.ietf.org/rfc/rfc5480.txt">https://www.ietf.org/rfc/rfc5480.txt</a> * for details. */ ECDSA_SHA384_SECP384R1("1.3.186.1.11"), /** * Algorithm ECQV SHA384 SECP384R1. * * See <a href= * "http://www.secg.org/draft-sec4-1.1.pdf">http://www.secg.org/draft-sec4-1.1.pdf</a> * for details. */ ECQV_SHA384_SECP384R1("1.3.186.1.12"), /** * Algorithm ECDSA SHA512 SECP521R1. * * See <a href= * "https://www.ietf.org/rfc/rfc5480.txt">https://www.ietf.org/rfc/rfc5480.txt</a> * for details. */ ECDSA_SHA512_SECP521R1("1.3.186.1.13"), /** * Algorithm ECQV SHA512 SECP521R1. * * See <a href= * "http://www.secg.org/draft-sec4-1.1.pdf">http://www.secg.org/draft-sec4-1.1.pdf</a> * for details. */ ECQV_SHA512_SECP521R1("1.3.186.1.14"), ECQV_SHA256_SECP256K1("1.3.186.1.15"); private final String oid; /** * Constructor. */ M2mSignatureAlgorithmOids(String oid) { this.oid = oid; } /** * Returns object ID. * * @return Object ID. */ @Override public String getOid() { return oid; } /** * Returns the enumeration value that corresponds to the given oid. * * @param oid * Object ID of an object in the enum. * * @return An instance of Object ID in the enum associated with the given oid. * @throws IllegalArgumentException * if oid is invalid. */ public static M2mSignatureAlgorithmOids getInstance(String oid) throws IllegalArgumentException { if (oid.equals(ECDSA_SHA256_SECP192R1.oid)) { return ECDSA_SHA256_SECP192R1; } else if (oid.equals(ECDSA_SHA256_SECP224R1.oid)) { return ECDSA_SHA256_SECP224R1; } else if (oid.equals(ECDSA_SHA256_SECT233K1.oid)) { return ECDSA_SHA256_SECT233K1; } else if (oid.equals(ECDSA_SHA256_SECT233R1.oid)) { return ECDSA_SHA256_SECT233R1; } else if (oid.equals(ECQV_SHA256_SECP192R1.oid)) { return ECQV_SHA256_SECP192R1; } else if (oid.equals(ECQV_SHA256_SECP224R1.oid)) { return ECQV_SHA256_SECP224R1; } else if (oid.equals(ECQV_SHA256_SECT233K1.oid)) { return ECQV_SHA256_SECT233K1; } else if (oid.equals(ECQV_SHA256_SECT233R1.oid)) { return ECQV_SHA256_SECT233R1; } else if (oid.equals(RSA_SHA256_RSA.oid)) { return RSA_SHA256_RSA; } else if (oid.equals(ECDSA_SHA256_SECP256R1.oid)) { return ECDSA_SHA256_SECP256R1; } else if (oid.equals(ECQV_SHA256_SECP256R1.oid)) { return ECQV_SHA256_SECP256R1; } else if (oid.equals(ECDSA_SHA384_SECP384R1.oid)) { return ECDSA_SHA384_SECP384R1; } else if (oid.equals(ECQV_SHA384_SECP384R1.oid)) { return ECQV_SHA384_SECP384R1; } else if (oid.equals(ECDSA_SHA512_SECP521R1.oid)) { return ECDSA_SHA512_SECP521R1; } else if (oid.equals(ECQV_SHA512_SECP521R1.oid)) { return ECQV_SHA512_SECP521R1; } else if (oid.equals(ECQV_SHA256_SECP256K1.oid)) { return ECQV_SHA256_SECP256K1; } else { throw new IllegalArgumentException("unknown oid: " + oid); } } }
[ "634498497@qq.com" ]
634498497@qq.com
2377d15eb17915c9fcf8307de783e98db6cb85a2
07fe2528527bfe60dd30daadde198cae0d001a90
/app/src/main/java/com/pagatodo/apolo/activity/CheckIDP/_presenter/_interfaces/IdpView.java
a6e49145fcee9bd60df80a695002ec6e356e9df6
[]
no_license
CarolJim/apolo-android-1.0.7-master
97b93c589423cf791cafb09bd7835ef2c77330f6
22406d9b0b17a11a53e267aead2c20fcbea03828
refs/heads/master
2020-04-25T23:44:37.318478
2019-04-12T21:45:48
2019-04-12T21:45:48
173,155,580
0
0
null
null
null
null
UTF-8
Java
false
false
475
java
package com.pagatodo.apolo.activity.CheckIDP._presenter._interfaces; import com.pagatodo.apolo.ui.base.factoryinterfaces.IEventOnView; import com.pagatodo.networkframework.DataManager; /** * Created by FranciscoManzo on 22/12/2017. */ public interface IdpView extends IEventOnView { void setIdpNumberError(); void setNavigation(); void showMessage(String message); void onSuccess(DataManager dataManager); void onFailed(DataManager dataManager); }
[ "cjimenez@pagatodo.com" ]
cjimenez@pagatodo.com
89bb8722200a8044fee5e81ce314b940c6df5ac7
40175396d63d2f5ce388b2fd2ee81a7ff325603d
/attendance/src/main/java/com/ace/controller/ChController.java
31120b534bcbcc6234c6dacd24fa2ace8f872304
[]
no_license
RajeswarM-NIIT/RajeswarAceMarch2020
2dc67dcdf702815384678221f391e699ca3f6ccb
a18913cc0383b834f3b0583709f0df436970c495
refs/heads/master
2022-12-28T22:41:28.410504
2020-03-14T10:16:31
2020-03-14T10:16:31
247,252,775
0
0
null
2022-12-16T10:56:19
2020-03-14T10:06:44
Java
UTF-8
Java
false
false
1,579
java
package com.ace.controller; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import com.ace.dao.AttDataDAO; import com.ace.dao.FacultyDAOInt; import com.ace.model.Vw_Att_Absent; import com.ace.model.Vw_Att_Present; @Controller public class ChController { @Autowired private FacultyDAOInt facdao; @RequestMapping(value= {"/reqCHPage","/reqAttPresPage"}) public String displaycHPage(Model m) { AttDataDAO attdao = new AttDataDAO(); List<Vw_Att_Present> data = attdao.getPresentData(); float totalpercentage=0; for(Vw_Att_Present v: data) { totalpercentage += v.getPresents(); } //totalpercentage=totalpercentage/data.size(); m.addAttribute("totalpercentage", totalpercentage); m.addAttribute("presentdata", data); return "chpage-student-att-pres"; } @RequestMapping("/reqAttAbsPage") public String displaycHPage1(Model m) { AttDataDAO attdao = new AttDataDAO(); List<Vw_Att_Absent> data = attdao.getAbsentData(); m.addAttribute("absentdata", data); System.out.println(data); return "chpage-student-att-abs"; } } /* public String displaycHPage(Model m) { AttDataDAO attdao = new AttDataDAO(); List<Vw_Att_Present> data = facdao.getPresentData(); System.out.println(data); System.out.println(data.size()); for(Vw_Att_Present v:data) { System.out.println(v.getStid()); } m.addAttribute("presentdata", data); return "chpage"; } */
[ "rajeshwar.mrr@gmail.com" ]
rajeshwar.mrr@gmail.com
c480f9c366e53dfcfb6d42e24390d9588af9e6d7
69040d2ad1b09341df198deb4822fde814eccd52
/src/main/java/RingOfDestiny/cards/ShadowFlower/ShadowMark.java
ebf9424e501dcf4cf4ef8fedb52441e625869dfc
[]
no_license
Rita-Bernstein/RingOfDestiny
69feecf461541ed2c585c181c6dde6a16d39af52
788da2b2d11c2393288506b3e04e6d5da1a16949
refs/heads/master
2023-07-16T20:56:30.160192
2021-08-31T17:16:55
2021-08-31T17:16:55
343,334,965
3
3
null
2021-05-24T08:28:52
2021-03-01T08:01:25
Java
UTF-8
Java
false
false
2,274
java
package RingOfDestiny.cards.ShadowFlower; import RingOfDestiny.RingOfDestiny; import RingOfDestiny.cards.AbstractRingCard; import RingOfDestiny.patches.CardColorEnum; import RingOfDestiny.powers.ShadowMarkPower; import basemod.abstracts.CustomCard; import com.megacrit.cardcrawl.actions.common.ApplyPowerAction; import com.megacrit.cardcrawl.actions.common.GainBlockAction; import com.megacrit.cardcrawl.cards.AbstractCard; import com.megacrit.cardcrawl.characters.AbstractPlayer; import com.megacrit.cardcrawl.core.CardCrawlGame; import com.megacrit.cardcrawl.dungeons.AbstractDungeon; import com.megacrit.cardcrawl.localization.CardStrings; import com.megacrit.cardcrawl.monsters.AbstractMonster; import com.megacrit.cardcrawl.powers.PoisonPower; import com.megacrit.cardcrawl.powers.VulnerablePower; import com.megacrit.cardcrawl.powers.WeakPower; public class ShadowMark extends AbstractRingCard { public static final String ID = RingOfDestiny.makeID("ShadowMark"); private static final CardStrings cardStrings = CardCrawlGame.languagePack.getCardStrings(ID); public static final String NAME = cardStrings.NAME; public static final String IMG = RingOfDestiny.assetPath("img/cards/ShadowFlower/53.png"); private static final int COST = 0; public static final String DESCRIPTION = cardStrings.DESCRIPTION; public static final CardType TYPE = CardType.SKILL; private static final CardColor COLOR = CardColorEnum.ShadowFlower_LIME; private static final CardRarity RARITY = CardRarity.RARE; private static final CardTarget TARGET = CardTarget.ENEMY; public ShadowMark() { super(ID, NAME, IMG, COST, DESCRIPTION, TYPE, COLOR, RARITY, TARGET); this.magicNumber = this.baseMagicNumber = 1; this.exhaust = true; } public void use(AbstractPlayer p, AbstractMonster m) { addToBot(new ApplyPowerAction(m,p,new ShadowMarkPower(m,this.magicNumber),this.magicNumber)); } public AbstractCard makeCopy() { return new ShadowMark(); } public void upgrade() { if (!this.upgraded) { upgradeName(); this.isInnate = true; this.rawDescription = cardStrings.UPGRADE_DESCRIPTION; initializeDescription(); } } }
[ "13536709069@163.com" ]
13536709069@163.com
0b7fec2acbeda3a694c1bac87d03759638cb322f
f01e17b302654db933dbdbafa1c8b48777fc4cfc
/Methods-Arrays and ArrayList/Methods with ArrayList - set.java
d396c3e313b88b9ab261d7b8fb7a8428fb194fdb
[]
no_license
Almira1612/ReplitAssignments
9b6e2bf4b0b88255b12b03fad887cca15c8e00ba
ddb0640740da3e61a1966c328dfc83ff87cd63d9
refs/heads/master
2020-04-03T04:58:07.155931
2018-12-09T23:57:04
2018-12-09T23:57:04
155,030,015
0
1
null
null
null
null
UTF-8
Java
false
false
165
java
import java.util.ArrayList; class Main { public static void test(ArrayList<String> words) { //write code here words.set(0,"git"); words.set(2,"gud"); } }
[ "almira1612@gmail.com" ]
almira1612@gmail.com
ccafbd7181add46472e40728fdb2d45d99fff372
90aadcdb3beb4d17dfca62e77f6817afd04d5032
/src/main/java/date/dao/CourseDao.java
1034ba6fe69277600e004b88d074c9eea0dd903c
[]
no_license
TomaszOciepa/driving-school
38b64190e9d4a891000c9c74e917b69baaf01221
c4028ff95697b842ec0232e5b6cc3eaf2c7d9908
refs/heads/master
2020-04-17T15:10:41.212180
2019-03-15T09:52:58
2019-03-15T09:52:58
166,688,112
0
0
null
null
null
null
UTF-8
Java
false
false
1,029
java
package date.dao; import date.model.Course; import date.model.Instructor; import javax.ejb.Stateless; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.Query; import java.util.List; @Stateless public class CourseDao { @PersistenceContext private EntityManager entityManager; public int save(Course course) { entityManager.persist(course); return course.getCourseId(); } public Course update(Course course) { return entityManager.merge(course); } public void delete(int id) { final Course course = entityManager.find(Course.class, id); if (course != null) { entityManager.remove(course); } } public Course findById(int id) { return entityManager.find(Course.class, id); } public List<Course> findAll() { final Query query = entityManager.createQuery("SELECT i FROM Course i"); return (List<Course>) query.getResultList(); } }
[ "tom.ociepa@gmail.com" ]
tom.ociepa@gmail.com
d7c471bd1bd96b52312fc19366289eceb5a495c9
15d536ab2b1fb839b166b017eec3bd06bac96b01
/src/main/java/forms/StudentResults.java
9c7e44e2b54b4e88a385eefec9ca17e17d83bb0e
[]
no_license
khodorkovskyalexey/sova_desktop
cc17236dd3bdca0026760196d687fc452dd7dcf0
a30e9aa6c6a10bdb8dd87dadca7bd26915e259b3
refs/heads/master
2022-12-17T06:29:51.491206
2020-09-24T08:16:02
2020-09-24T08:16:02
298,212,548
1
0
null
null
null
null
UTF-8
Java
false
false
840
java
package forms; import database_classes.Result; import database_classes.Test; import javax.swing.*; public class StudentResults extends JFrame{ private JPanel panel; private JButton MenuButton; private JLabel TestNameLabel; private JLabel Results; private JPanel ResultPanel; public StudentResults( ){ super("SOVA"); setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); Result r=new Result((float)7.8,7); writeResults(new Result((float)7.8,7),new Test("Test Name")); } void writeResults(Result result, Test test){ TestNameLabel.setText("Тест: "+test.getName()); Results.setText("Ваш результат: "+result.getMark()); this.getContentPane().add(panel); panel.revalidate(); pack(); setVisible(true); } }
[ "aezz120813@gmail.com" ]
aezz120813@gmail.com
193c8fecef2d68079536e119adba905c1c45440a
e55540329dd72a63cc8e134c7a5f313577ead98e
/src/main/java/cn/umisoft/admin/controller/UmiRController.java
4733c4def4f9ff8b06df7c8618eb7492cc201dd1
[]
no_license
umi-soft/umi-spring-boot-admin
3017fe3830156b069c6d91f75ee51de56cc2901f
96922b9cef8f9efe7ad3f54d21170e5f635c0723
refs/heads/master
2020-04-28T02:40:13.132732
2019-03-27T05:45:59
2019-03-27T05:45:59
174,907,289
3
1
null
null
null
null
UTF-8
Java
false
false
2,811
java
package cn.umisoft.admin.controller; import cn.umisoft.admin.entity.UmiEntity; import cn.umisoft.admin.service.IUmiService; import cn.umisoft.admin.util.ApiResult; import cn.umisoft.admin.util.ApiResultWrapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; import java.util.*; /** * @description: <p>仅仅面向关系表,如用户部门中间表</p> * @author: hujie@umisoft.cn * @date: 2019/1/24 10:20 AM */ public class UmiRController<S extends IUmiService<T>, T extends UmiEntity> extends UmiController<S,T> { @Autowired protected S baseService; /** * @description: <p>单个新增,仅追加</p> * @author: hujie@umisoft.cn * @date: 2019/1/14 12:43 AM * @param: request * @param: entity * @return: ApiResult,数据结构满足开发规范 */ @PostMapping(value = "add") public ApiResult add(HttpServletRequest request, T entity){ checkMappingFields(entity); baseService.save(entity); return ApiResultWrapper.success(); } /** * @description: <p>批量重置,清除原有映射关系</p> * @author: hujie@umisoft.cn * @date: 2019/1/14 12:44 AM * @param: request * @param: entities * @return: ApiResult,数据结构满足开发规范 */ @PostMapping("reset") public ApiResult resetAdd(HttpServletRequest request, @RequestBody List<T> entities){ Map<String, Set<Object>> mappingInfo = new HashMap<String, Set<Object>>(); for (T entity : entities) { for (String mappingField: mappingFields) { if (mappingInfo.get(mappingField) == null) { mappingInfo.put(mappingField, new HashSet<Object>()); } mappingInfo.get(mappingField).add(getEntityFieldValue(entity, mappingField)); } } baseService.resetByMap(entities, mappingInfo); return ApiResultWrapper.success(); } /** * @description: <p>根据映射关系删除</p> * @author: hujie@umisoft.cn * @date: 2019/1/14 12:45 AM * @param: request * @param: mapping * @return: ApiResult,数据结构满足开发规范 */ @PostMapping(value = "del-by-entity-mapping") public ApiResult delByEntityMapping(HttpServletRequest request, T entity){ Map<String, Object> mapping = new HashMap<String, Object>(); for (String mappingField: mappingFields) { mapping.put(mappingField, getEntityFieldValue(entity, mappingField)); } baseService.removeByMap(mapping); return ApiResultWrapper.success(); } }
[ "hujie@17luma.com" ]
hujie@17luma.com
09a600bcae84e449347db1bc8e013d32d815bb37
c29f27b30c1363fe5de18bc5311e8576252c8fa6
/app/src/androidTest/java/com/example/ashish/mymapproject/ApplicationTest.java
baf86be76bf910b4ee7b28d704f90e4d2614af80
[]
no_license
AshishgithubindiA/mapDemoApp
1bb6ebd026cd26b2167a813c8e934f8e713be933
7a20fe657e74560994b3f2e1d9eba81869817de0
refs/heads/master
2021-01-13T00:55:37.812698
2016-02-11T07:56:55
2016-02-11T07:56:55
51,495,579
0
0
null
null
null
null
UTF-8
Java
false
false
362
java
package com.example.ashish.mymapproject; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
[ "ashishsorathiya039@gmail.com" ]
ashishsorathiya039@gmail.com
58367be68eb85aaa76ed7f11b51182aae7514762
8a3e81133ff67b8266b654a78fd452236e088c0e
/moviebuffs-api/src/main/java/com/sivalabs/moviebuffs/importer/model/MovieCsvRecord.java
ce19d76449372c149e3185282686b8c1b9905d0c
[]
no_license
purnachand99/moviebuffs
4a1c624e3114a472674eb6e026f9869bf7f50c09
fa7d4829dd6a35481f973472060bbd063895e0d8
refs/heads/master
2021-03-23T23:07:01.529257
2020-03-09T03:38:55
2020-03-09T04:25:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
874
java
package com.sivalabs.moviebuffs.importer.model; import lombok.Builder; import lombok.Data; @Data @Builder public class MovieCsvRecord { private String adult; private String belongsToCollection; private String budget; private String genres; private String homepage; private String id; private String imdbId; private String originalLanguage; private String originalTitle; private String overview; private String popularity; private String posterPath; private String productionCompanies; private String productionCountries; private String releaseDate; private String revenue; private String runtime; private String spokenLanguages; private String status; private String tagline; private String title; private String video; private String voteAverage; private String voteCount; }
[ "sivaprasadreddy.k@gmail.com" ]
sivaprasadreddy.k@gmail.com
5fae7f0959f13e74c7d135a9f3c77ca606e52e47
8296a8f024dc4e6c9a960429db03a673c5ecd09c
/app/src/main/java/co/campusconnect/branch/MainActivity.java
eafe98a945514aa56793827c109561ca785fb304
[]
no_license
Connected123/Branch
4b77402d1d6e57d9fc7eae53d07d44c9b2be9887
3c3706cf5f8ec5bb544c493c903bb2a692279335
refs/heads/master
2020-12-02T11:10:50.695613
2017-07-08T10:08:42
2017-07-08T10:08:42
96,611,010
0
0
null
null
null
null
UTF-8
Java
false
false
1,782
java
package co.campusconnect.branch; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.View; import android.view.Menu; import android.view.MenuItem; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) .setAction("Action", null).show(); } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } }
[ "YOUR_PUBLIC@GIT_EMAIL.COM" ]
YOUR_PUBLIC@GIT_EMAIL.COM
fbd9f6da0053b8104caf203aa5b2c42bc0aa68d4
0f36d0173298d72f63d080423c93d3144e8b838f
/src/test/java/testframework/pages/BasePage.java
e87e4e2bd06159512520b14752505122b345290f
[]
no_license
ragazzoua/testukrnet
8e3b401178d99bd7df4276058aa41deafac1fc85
19b4a0d50ff9304abe6ce969a2229da9cabb77b4
refs/heads/master
2020-04-23T08:47:23.503317
2019-02-17T06:47:01
2019-02-17T06:47:01
171,048,548
0
0
null
null
null
null
UTF-8
Java
false
false
758
java
package testframework.pages; import io.github.bonigarcia.wdm.ChromeDriverManager; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.support.PageFactory; import java.util.concurrent.TimeUnit; import static testframework.common.Constants.BASE_URL; /** * created by FAMILY 16.02.2019 */ public class BasePage { protected static WebDriver driver; static { ChromeDriverManager.chromedriver().setup(); driver = new ChromeDriver(); driver.get(BASE_URL); driver.manage().window().maximize(); driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); } public BasePage() { PageFactory.initElements(driver, this); } }
[ "ragazzo@ukr.net" ]
ragazzo@ukr.net
6e92d3a31dd4b7fa2ac40b046a2df4f9ea553932
6bb1082dc8074356d4ddb7ceff93f76032aadaae
/BlueHotel/src/blue/hotel/gui/IconNames.java
5c0f636ff1c9a7f345d48ac7314e65b09251d93a
[]
no_license
wi3sl/sese
aa5b0fb2a2dc0285eb76205a862b36a401955d90
1df8e4efd3fa9d80f4a76654f3c52b6d82473630
refs/heads/master
2020-04-29T17:16:37.158017
2012-01-31T18:15:15
2012-01-31T18:15:15
2,714,471
2
0
null
null
null
null
UTF-8
Java
false
false
446
java
package blue.hotel.gui; public class IconNames { public static final String INVOICE_MISSING_ICON_NAME = "missing"; public static final String INVOICE_MISSING_ICON_RES = "/blue/hotel/data/cash-register-icon.png"; public static final String INVOICE_ICON_NAME = "invoice"; public static final String INVOICE_ICON_RES = "/blue/hotel/data/Ok-icon.png"; public static final String FILLER_ICON_RES = "/blue/hotel/data/exclamation-icon.png"; }
[ "stefan.mueller@vol.at" ]
stefan.mueller@vol.at
40b2dcd0ee5709a81983b47241be9c798d1c4143
cbccd1b2fce72c256f2cb134b12ba7d38906b3aa
/app/src/androidTest/java/com/example/financialmodelingprep/ExampleInstrumentedTest.java
33e4fd9bb0342a553217788191a54eccad80c538
[]
no_license
LucasFreitag/FinancialModelingPrep
dccc592b2614bb7a4b0356e0cf8d7b6450efc90e
fcddf682b95d8b28d6828d55ea49a88f97f000d4
refs/heads/main
2023-08-23T18:02:30.764589
2021-10-19T00:45:17
2021-10-19T00:45:17
368,347,199
0
0
null
null
null
null
UTF-8
Java
false
false
780
java
package com.example.financialmodelingprep; import android.content.Context; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); assertEquals("com.example.financialmodelingprep", appContext.getPackageName()); } }
[ "64878083+LucasFreitag@users.noreply.github.com" ]
64878083+LucasFreitag@users.noreply.github.com
b5c7acfa67b31e8b03cf7d893e673f2fbf9ea8ef
cfadb8b7faf5a7d0341d1947f25217a82ed94862
/ToT/src/java/DAO/DBConnectionFactoryImpl.java
f68fabc6e2a4bac0122c65a2dfb276f60975ebca
[]
no_license
Shermaine98/EGMII.P.I.D
321cbcf30ac78d0ee8429f2f7239966e3825ecdd
7a896aeb170afc3a62bae43119e3d52d4c38c12c
refs/heads/master
2021-01-10T15:40:50.217223
2015-11-28T17:27:34
2015-11-28T17:27:34
45,374,253
0
0
null
null
null
null
UTF-8
Java
false
false
950
java
package Database; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.util.logging.Level; import java.util.logging.Logger; /** * * @author Atayan * @author Lapidario * @author Sy * @author Nunez * */ public class DBConnectionFactoryImpl extends DBConnectionFactory { /** * * @return */ @Override public Connection getConnection() { try { Class.forName("com.mysql.jdbc.Driver"); Connection conn = DriverManager.getConnection(url, username, password); return conn; } catch (ClassNotFoundException ex) { Logger.getLogger(DBConnectionFactoryImpl.class.getName()).log(Level.SEVERE, null, ex); } catch (SQLException ex) { Logger.getLogger(DBConnectionFactoryImpl.class.getName()).log(Level.SEVERE, null, ex); } return null; } }
[ "shermaine_sy@dlsu.edu.ph" ]
shermaine_sy@dlsu.edu.ph
0995f0b02cdec52a56f81a836cb37782e376a7aa
c37f9b1bca69c7dabfceb8fecd0163d40a3bed23
/src/main/java/com/guilin/antlr4/demo/aleiye/grammar/util/SystemPam.java
92b894cb3b71dd3d45efb230d75470d9cf6a7c56
[]
no_license
dongguilin/Antlr4Demo
34933bca09740d0c5b8f354eff1e4f872ddf1a6c
3efdb33d4a48c27cfea086acbeaf3bf750141018
refs/heads/master
2021-01-09T20:57:49.795311
2016-07-13T08:40:45
2016-07-13T08:40:45
63,229,466
0
0
null
null
null
null
UTF-8
Java
false
false
572
java
package com.guilin.antlr4.demo.aleiye.grammar.util; public interface SystemPam { //public static final String DFIELD = "A_"; public static final String DFIELD = "A_"; //索引间隔符 public static final String INDEX_SEPARATOR = "-"; //每天存储统计日志分隔符 public static final String STAT_STREAM_SEPARATOR = ":"; //流量topic的分割符 public static final String STREAM_SEPARATOR = "-"; //流量统计前缀 public static final String INDEX_STAT_PREFIX = "stat"; //流量统计标识 public static final String STAT_ALL_STREAM = "all"; }
[ "guilin.dong@aleiye.cn" ]
guilin.dong@aleiye.cn
7048d4aaf5759031ed18b36deb1ac04f4a738957
f34055f3f7fed9499f1b0d3fe0de1a5da6c26caf
/src/main/java/com/chotoxautinh/server/service/CounterException.java
a369c06036a595267aa395e9af51fe34ac6c5032
[]
no_license
npmcdn-to-unpkg-bot/moom-account
36b1ba125eef47c4e8df70ef6b6a5b167eb4d098
01e93f94323661355dad5b0381906ba82bef0c15
refs/heads/master
2021-01-16T21:24:52.596351
2016-04-25T03:55:40
2016-04-25T03:55:40
67,944,764
0
0
null
2016-09-11T17:45:31
2016-09-11T17:45:31
null
UTF-8
Java
false
false
611
java
/** * @author chotoxautinh * * Apr 2, 2016 - http://chotoxautinh.com/ */ package com.chotoxautinh.server.service; public class CounterException extends RuntimeException { private static final long serialVersionUID = 1L; private String errCode; private String errMsg; public CounterException(String errMsg) { this.setErrMsg(errMsg); } // get, set... public String getErrCode() { return errCode; } public void setErrCode(String errCode) { this.errCode = errCode; } public String getErrMsg() { return errMsg; } public void setErrMsg(String errMsg) { this.errMsg = errMsg; } }
[ "zhangqingsong21293@gmail.com" ]
zhangqingsong21293@gmail.com
27f2d95d38bd6c706feaa5008184beea6d5cf3e4
4764a9f6ed8c9cd6b01b829af7e9fe1c71897a45
/src/main/java/com/mmtechy/commerce/domain/Vente.java
228013ef963aeffcd71bcfc3fdd07429eeed7b05
[]
no_license
mouradxmt/MyCommerce
577e595d77026eb96444599b16efb1c9b7b62cbc
2e345ae66c5449d232479709c1b1926ce5883b6e
refs/heads/main
2023-04-14T05:10:57.772376
2021-04-10T21:56:01
2021-04-10T21:56:01
356,703,473
1
0
null
2021-04-10T21:56:02
2021-04-10T21:51:54
Java
UTF-8
Java
false
false
4,633
java
package com.mmtechy.commerce.domain; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import java.io.Serializable; import java.time.LocalDate; import java.util.HashSet; import java.util.Set; import javax.persistence.*; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; /** * A Vente. */ @Entity @Table(name = "vente") @Cache(usage = CacheConcurrencyStrategy.READ_WRITE) public class Vente implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @Column(name = "date_vente") private LocalDate dateVente; @Column(name = "nom_revendeur") private String nomRevendeur; @Column(name = "mode_paiement") private String modePaiement; @Column(name = "montant_vente") private Double montantVente; @ManyToOne @JsonIgnoreProperties(value = { "ventes" }, allowSetters = true) private Client client; @OneToMany(mappedBy = "vente") @Cache(usage = CacheConcurrencyStrategy.READ_WRITE) @JsonIgnoreProperties(value = { "vente" }, allowSetters = true) private Set<Produit> produits = new HashSet<>(); // jhipster-needle-entity-add-field - JHipster will add fields here public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Vente id(Long id) { this.id = id; return this; } public LocalDate getDateVente() { return this.dateVente; } public Vente dateVente(LocalDate dateVente) { this.dateVente = dateVente; return this; } public void setDateVente(LocalDate dateVente) { this.dateVente = dateVente; } public String getNomRevendeur() { return this.nomRevendeur; } public Vente nomRevendeur(String nomRevendeur) { this.nomRevendeur = nomRevendeur; return this; } public void setNomRevendeur(String nomRevendeur) { this.nomRevendeur = nomRevendeur; } public String getModePaiement() { return this.modePaiement; } public Vente modePaiement(String modePaiement) { this.modePaiement = modePaiement; return this; } public void setModePaiement(String modePaiement) { this.modePaiement = modePaiement; } public Double getMontantVente() { return this.montantVente; } public Vente montantVente(Double montantVente) { this.montantVente = montantVente; return this; } public void setMontantVente(Double montantVente) { this.montantVente = montantVente; } public Client getClient() { return this.client; } public Vente client(Client client) { this.setClient(client); return this; } public void setClient(Client client) { this.client = client; } public Set<Produit> getProduits() { return this.produits; } public Vente produits(Set<Produit> produits) { this.setProduits(produits); return this; } public Vente addProduit(Produit produit) { this.produits.add(produit); produit.setVente(this); return this; } public Vente removeProduit(Produit produit) { this.produits.remove(produit); produit.setVente(null); return this; } public void setProduits(Set<Produit> produits) { if (this.produits != null) { this.produits.forEach(i -> i.setVente(null)); } if (produits != null) { produits.forEach(i -> i.setVente(this)); } this.produits = produits; } // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Vente)) { return false; } return id != null && id.equals(((Vente) o).id); } @Override public int hashCode() { // see https://vladmihalcea.com/how-to-implement-equals-and-hashcode-using-the-jpa-entity-identifier/ return getClass().hashCode(); } // prettier-ignore @Override public String toString() { return "Vente{" + "id=" + getId() + ", dateVente='" + getDateVente() + "'" + ", nomRevendeur='" + getNomRevendeur() + "'" + ", modePaiement='" + getModePaiement() + "'" + ", montantVente=" + getMontantVente() + "}"; } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
309bc7c91bc02f2fc044bedbe8cc604e45363d8b
4c8203c75d1e784b14ce860ba875182e831b5834
/src/checkers/Colour.java
e8fb71f502b44f976adff6ca1387b6e19671fe75
[]
no_license
themastermann1/Checkers
36bc76034cac1b4d5a75655baa94fdc2d58b3b85
f188b6eae8735668e13afe9600ff4c682f5aaa12
refs/heads/master
2020-05-25T14:56:12.709759
2016-12-08T15:28:24
2016-12-08T15:28:24
69,651,997
0
0
null
null
null
null
UTF-8
Java
false
false
184
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package checkers; /** * * @author sdm29 */ public enum Colour { RED,BLACK }
[ "sdm29@sussex.ac.uk" ]
sdm29@sussex.ac.uk
95334788dc789c79bec4c6fea9a34286accfb6a1
4886332fe94ec44ba22790beba6cc13f7bc37531
/ch10/HRSystem_Eclipse/src/org/crazyit/hrsystem/action/ProcessAppAction.java
28e677e7328c8969e37a1577101a8b5caf34b2e2
[ "Apache-2.0" ]
permissive
Castlebin/crazyjee.bak
79002519015a3d41b2e0adcbbf11099314de2bfb
cde7cbe966dac1cd70ba8dbda644f749165504a5
refs/heads/master
2022-12-24T19:23:21.453363
2020-07-13T06:48:43
2020-07-13T06:48:43
35,644,767
0
1
Apache-2.0
2022-12-10T01:31:24
2015-05-15T00:40:40
Java
GB18030
Java
false
false
1,890
java
package org.crazyit.hrsystem.action; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import com.opensymphony.xwork2.*; import org.apache.struts2.interceptor.*; import org.crazyit.hrsystem.service.EmpManager; import org.crazyit.hrsystem.exception.HrException; import org.crazyit.hrsystem.action.base.EmpBaseAction; import org.crazyit.hrsystem.vo.*; import java.util.*; import java.text.SimpleDateFormat; /** * Description: * <br/>网站: <a href="http://www.crazyit.org">疯狂Java联盟</a> * <br/>Copyright (C), 2001-2016, Yeeku.H.Lee * <br/>This program is protected by copyright laws. * <br/>Program Name: * <br/>Date: * @author Yeeku.H.Lee kongyeeku@163.com * @version 1.0 */ public class ProcessAppAction extends EmpBaseAction { // 申请异动的出勤ID private int attId; // 希望改变到出勤类型 private int typeId; // 申请理由 private String reason; // attId的setter和getter方法 public void setAttId(int attId) { this.attId = attId; } public int getAttId() { return this.attId; } // typeId的setter和getter方法 public void setTypeId(int typeId) { this.typeId = typeId; } public int getTypeId() { return this.typeId; } // reason的setter和getter方法 public void setReason(String reason) { this.reason = reason; } public String getReason() { return this.reason; } // 处理用户请求 public String execute() throws Exception { // 处理异动申请 boolean result = mgr.addApplication(attId , typeId , reason); // 如果申请成功 if(result) { addActionMessage("您已经申请成功,等待经理审阅"); } else { addActionMessage("申请失败,请注意不要重复申请"); } return SUCCESS; } }
[ "heller@H-L-PC" ]
heller@H-L-PC
c86d39d9f3b76307ba05dcf0f35d390d9ae348e8
2755262ba39ca0b0f5abd055a077223436b22257
/lab/area6.java
275d3de7279c42a62679d4d763b5d871c2b78bc5
[]
no_license
Ranjan14/Java
0a9ea17c8a5fb32419b2b9d5f3d8c533d79ce5df
1ec7ce1f15d11fdab0282bc6b674df5d619a01a8
refs/heads/master
2023-03-28T18:29:23.514371
2021-04-11T07:21:17
2021-04-11T07:21:17
299,647,474
0
0
null
null
null
null
UTF-8
Java
false
false
1,620
java
//Write a java program to create an abstract class named shape that contains two integers and an empty method named print Area(). //Provide three classes named Rectangle, Triangle and Circle such that each one of the classes extends the class shape. //Each one of the class contains only the method print Area() that print the area of the given shape import java.util.*; import java.lang.*; class A{ void area(double l,double b){ double a = (double)1/2 * l * b; System.out.println("Area of triangle is "+a+" sq.cms");} void area1(double s){ double a = Math.pow(s,2); System.out.println("Area of square is "+a+" sq.cms"); } } class area6 extends A{ void area(double l,double b){ double a = l * b; System.out.println("Area of rectangle is "+a+" sq.cms"); super.area(l,b); } void area1(double r){ double a = Math.PI * r * r; System.out.println("Area pf circle is "+a+" sq.cms"); super.area1(r); } public static void main(String[] args){ double a,b; double r; area6 obj = new area6(); Scanner sc = new Scanner(System.in); System.out.println("Enter lenghts and breadths for triangle and rectangle in cms"); a = sc.nextDouble(); b = sc.nextDouble(); System.out.println("Enter radius or sides for circle/square in cms"); r = sc.nextDouble(); obj.area(a,b); //for rectangle obj.area1(r); // for circle //System.out.println("Area of rectangle(in sq.cms): "+x+"\nArea of triangle(in sq.cms): "+y); //System.out.println("Area of square(in sq.cms): "+v+"\nArea of circle(in sq.cms): "+u); } }
[ "noreply@github.com" ]
Ranjan14.noreply@github.com
38f255ed1129d1133d9df6a355b5a026d05d6430
dd00dc372d9e0495349c719e19ff980ffc5701df
/AB04/src/ab4/test/TreeTest.java
02d2c12d3abb0562b432c7afce810fd74a9704ab
[]
no_license
cpppwner/AuD2016
3416fd6a0f24141d9f4bde913ddd8f0cabc15fb8
68d15d3df931b694274e1fedd2ba59b07dca0cb8
refs/heads/master
2021-01-19T04:15:46.650037
2016-06-27T23:57:39
2016-06-27T23:57:39
62,096,097
0
0
null
null
null
null
UTF-8
Java
false
false
3,325
java
package ab4.test; import java.util.Arrays; import java.util.List; import java.util.Random; import java.util.Set; import java.util.TreeSet; import org.junit.Assert; import org.junit.Test; import ab4.Node; import ab4.Tree; import ab4.impl.Eberl.TreeImpl; public class TreeTest { private Tree<Character> tree = new TreeImpl<Character>(); @Test public void testLWR1() { tree.clear(); tree.addValue('a'); tree.addValue('g'); tree.addValue('f'); tree.addValue('z'); tree.addValue('k'); Assert.assertEquals(Arrays.asList('a', 'f', 'g', 'k', 'z'), tree.toLWR()); } @Test public void testLWR2() { tree.clear(); tree.addValue('a'); tree.addValue('g'); tree.addValue('f'); tree.addValue('z'); tree.addValue('k'); tree.addValue('b'); tree.addValue('u'); tree.addValue('l'); tree.addValue('c'); tree.removeValue('k'); Assert.assertEquals(Arrays.asList('a', 'b', 'c', 'f', 'g', 'l', 'u', 'z'), tree.toLWR()); } @Test public void testContains() { tree.clear(); tree.addValue('a'); tree.addValue('g'); tree.addValue('f'); tree.addValue('z'); tree.addValue('k'); tree.addValue('b'); tree.addValue('u'); tree.addValue('l'); tree.addValue('c'); Assert.assertEquals(true, tree.containsValue('u')); Assert.assertEquals(true, tree.containsValue('c')); Assert.assertEquals(false, tree.containsValue('d')); Assert.assertEquals(false, tree.containsValue('w')); } @Test public void testSize() { tree.clear(); tree.addValue('a'); tree.addValue('g'); tree.addValue('f'); tree.addValue('z'); tree.addValue('k'); tree.addValue('b'); tree.addValue('u'); tree.addValue('l'); tree.addValue('c'); Assert.assertEquals(9, tree.size()); } @Test public void testClear() { tree.clear(); tree.addValue('a'); tree.addValue('g'); tree.addValue('f'); tree.addValue('z'); tree.addValue('k'); tree.addValue('b'); tree.addValue('u'); tree.addValue('l'); tree.addValue('c'); tree.clear(); Assert.assertEquals(Arrays.asList(), tree.toLRW()); Assert.assertEquals(-1, tree.getHeight()); Assert.assertEquals(0, tree.size()); } @Test public void testOrders2() { tree.clear(); Random rand = new Random(System.currentTimeMillis()); for (int i = 0; i < 1000; i++) { char c = ((char) rand.nextInt(10000)); tree.addValue(c); } List<Character> lwr2 = tree.toLWR(); Set<Character> set2 = new TreeSet<Character>(lwr2); Assert.assertEquals(set2.size(), lwr2.size()); } @Test public void testAVLProperty() { Tree<Integer> tree = new TreeImpl<Integer>(); Random rand = new Random(System.currentTimeMillis()); for (int i = 0; i < 1000; i++) { tree.addValue(rand.nextInt(10000)); } Assert.assertEquals(true, isAVLTree(tree.getRoot())); } private static boolean isAVLTree(Node<?> node) { if (node == null) return true; int leftH = getHeightOfSubtree(node.getLeft()); int rightH = getHeightOfSubtree(node.getRight()); if (Math.abs(leftH - rightH) > 1) return false; return isAVLTree(node.getLeft()) && isAVLTree(node.getRight()); } private static int getHeightOfSubtree(Node<?> node) { if (node == null) return -1; int leftH = getHeightOfSubtree(node.getLeft()); int rightH = getHeightOfSubtree(node.getRight()); return 1 + Math.max(leftH, rightH); } }
[ "cpppwner@gmail.com" ]
cpppwner@gmail.com
6ae9ee14bb7352e8204c63971b2b36b64c695b70
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XWIKI-13546-1-12-NSGA_II-LineCoverage:ExceptionType:StackTraceSimilarity/org/xwiki/model/reference/EntityReference_ESTest.java
01556455b377e941888fec7cf502645875fae13b
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
890
java
/* * This file was automatically generated by EvoSuite * Sun Apr 05 15:34:09 UTC 2020 */ package org.xwiki.model.reference; import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.runtime.EvoAssertions.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; import org.xwiki.model.EntityType; import org.xwiki.model.reference.EntityReference; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class EntityReference_ESTest extends EntityReference_ESTest_scaffolding { @Test(timeout = 4000) public void test0() throws Throwable { EntityType entityType0 = EntityType.DOCUMENT; EntityReference entityReference0 = new EntityReference("`Rv", entityType0); // Undeclared exception! entityReference0.setName((String) null); } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
5399034e94336b90db98a56e7d5423c9e6655a78
b46a3e1930d726345bb34c4f7783be853f0044f6
/airport-router/src/main/java/com/bagrouter/model/TerminalGate.java
8dffb48f1fbb04763186236ee6d6fbb388690e77
[]
no_license
pras79/airportbag-router
dc227af7b260f285cf40417b50999c28921aedff
d6aaf46e97bce4680c6d6fec76031a9ae0c6101e
refs/heads/master
2021-09-04T18:06:38.156357
2018-01-20T23:57:19
2018-01-20T23:57:19
118,286,735
0
0
null
null
null
null
UTF-8
Java
false
false
722
java
package com.bagrouter.model; /** * @author pras * Domain object for gates. */ public class TerminalGate implements Identifiable<String> { private final String gateNumber; /** * Create a gate given the gate number. */ public TerminalGate(String gateNumber) { this.gateNumber = gateNumber; } /** * Get the gate ID */ public String getGateNumber() { return gateNumber; } @Override public boolean equals( Object obj ) { return ( ! (obj instanceof TerminalGate) ) ? super.equals( obj ) : ((TerminalGate) obj).getGateNumber().equals( getGateNumber() ); } @Override public String getId() { return getGateNumber(); } @Override public String toString() { return getId(); } }
[ "pras@10.0.0.225" ]
pras@10.0.0.225
e6a0f9d854b07a228829e016a0b77ebb43d0d18d
fc2e1c537fa316d77a294363aec8bb7ca620219b
/src/main/java/com/willpower/travel/config/MvcConfig.java
f433b7a16211afdd8866323fd4563680f2bfd4dc
[]
no_license
AJ990716/old-travel
146d7a6e4fbe9e12f57a8b575dbd75da9dfbe2e9
f65bb1729de3a124fdf623c64693c76df588024d
refs/heads/master
2023-06-23T11:02:25.610032
2021-07-22T07:36:54
2021-07-22T07:36:54
388,305,695
0
0
null
null
null
null
UTF-8
Java
false
false
1,965
java
package com.willpower.travel.config; import com.willpower.travel.interceptor.LoginInterceptor; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.InterceptorRegistration; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; /** * @project: oldtravle; * @package: com.willpower.travel.config; * @author: Administrator; * @date: 2021/5/18 21:11; * @Description: 配置拦截器 * WebMvcConfigurer */ @Configuration public class MvcConfig { public void addInterceptors(InterceptorRegistry registry) { //注册TestInterceptor拦截器 InterceptorRegistration interceptor = registry.addInterceptor(new LoginInterceptor()); interceptor.addPathPatterns("/**"); //所有路径都被拦截 //添加不拦截路径 interceptor.excludePathPatterns( "/", //前台首页不拦截 "/index", "/createCode", //验证码 "/adminUser_login", //后台用户登录 "/login", //跳转后台登录地址 "/css/**", "/hotel/**", "/insurance/**", "/js/**", "/layui/**", "/message/**", "/scenicSpot/**", "/strategy/**", "/travelRoute/**", "/images/**", "/car/**", "/favicon.ioc", "/portal_*", //前台某些地址不拦截 "/portal_*/**", //前台某些地址不拦截 "/user_tologin", //前台前台跳转登录 "/user_login", //前台登录 "/user_toregister", //前台前台跳转注册 "/user_register" //前台注册 ); } }
[ "319067125@qq.com" ]
319067125@qq.com
febf7a0231c26ae709d9406711051a59e1a543b6
9371ae6ec24ad4b9914a43e64befb915d71e34f2
/out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/src/android/widget/ZoomButton.java
b33653e2a252d2c709e2b79bd7c0b7e7e8521860
[]
no_license
kanaida/LG-Esteem-Homeless-Kernel
9fac4c52993798eaf3021d9abb72a5e697464398
a5780f82bef7631fdb43b079e6f9ea6dbd187ac7
refs/heads/master
2020-06-09T06:14:50.214296
2012-02-24T04:23:01
2012-02-24T04:23:01
3,532,548
1
2
null
null
null
null
UTF-8
Java
false
false
1,296
java
package android.widget; public class ZoomButton extends android.widget.ImageButton implements android.view.View.OnLongClickListener { public ZoomButton(android.content.Context context) { super((android.content.Context)null,(android.util.AttributeSet)null,0); throw new RuntimeException("Stub!"); } public ZoomButton(android.content.Context context, android.util.AttributeSet attrs) { super((android.content.Context)null,(android.util.AttributeSet)null,0); throw new RuntimeException("Stub!"); } public ZoomButton(android.content.Context context, android.util.AttributeSet attrs, int defStyle) { super((android.content.Context)null,(android.util.AttributeSet)null,0); throw new RuntimeException("Stub!"); } public boolean onTouchEvent(android.view.MotionEvent event) { throw new RuntimeException("Stub!"); } public void setZoomSpeed(long speed) { throw new RuntimeException("Stub!"); } public boolean onLongClick(android.view.View v) { throw new RuntimeException("Stub!"); } public boolean onKeyUp(int keyCode, android.view.KeyEvent event) { throw new RuntimeException("Stub!"); } public void setEnabled(boolean enabled) { throw new RuntimeException("Stub!"); } public boolean dispatchUnhandledMove(android.view.View focused, int direction) { throw new RuntimeException("Stub!"); } }
[ "kanaida.bat@gmail.com" ]
kanaida.bat@gmail.com
3076ddef732e410ffe71c776f4f182fbc38fec9e
2125d408edb818288e8d98f4c2d182662475e47d
/library/src/main/java/easyimagepick/foronia/com/library/util/ImageLoader.java
9b5805c2feab87a1573c29be22ec699d06f36f8f
[]
no_license
Foronia/EasyImagePick
2d9c5f6930bb223b4b1164f6ee3981b228753268
4889bda9514c432204fe55b5d688ff532c02f89a
refs/heads/master
2021-01-20T03:40:03.019603
2017-08-25T05:03:03
2017-08-25T05:03:03
101,364,506
7
0
null
null
null
null
UTF-8
Java
false
false
10,689
java
package easyimagepick.foronia.com.library.util; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.Handler; import android.os.Looper; import android.os.Message; import android.util.DisplayMetrics; import android.util.LruCache; import android.view.ViewGroup; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.widget.ImageView; import java.lang.reflect.Field; import java.util.LinkedList; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Semaphore; /** * Created by Foronia on 2016/8/5. */ public class ImageLoader { //单例模式 private static ImageLoader mInstance; /** * 图片缓存的核心对象 */ private LruCache<String,Bitmap> mLruCache; /** * 线程池 */ private ExecutorService mThreadPool; /** * 默认线程数 */ private static final int DEFAULT_THREED_COUNT=5; private Type mType= Type.LIFO; /** * 任务堆栈 */ private LinkedList<Runnable> mTaskQueue; /** * 后台轮训线程用于获取任务到任务池 */ private Thread mPoolThread; /** * 后台消息处理handler */ private Handler mPoolThreadHandler; /** * 前台通知Uihandler */ private Handler mUIHandler; private Semaphore mSemaphorePoolThreadHandler = new Semaphore(0); private Semaphore mSemaphoreThreadPool; private Runnable task; public Runnable getTask() { if(mType== Type.FIFO){ return mTaskQueue.removeFirst(); }else if(mType== Type.LIFO){ return mTaskQueue.removeLast(); } return task; } public enum Type{ FIFO,LIFO } public ImageLoader(int defaultThreedCount, Type type) { init(defaultThreedCount,type); } private void init(int defaultThreedCount, Type type) { //初始化线程 mPoolThread=new Thread(){ @Override public void run() { Looper.prepare(); mPoolThreadHandler=new Handler(){ @Override public void handleMessage(Message msg) { //线程池取出一个任务进行执行 mThreadPool.execute(getTask()); try { mSemaphoreThreadPool.acquire(); } catch (InterruptedException e) { e.printStackTrace(); } } }; //释放一个信号量 mSemaphorePoolThreadHandler.release(); Looper.loop(); } }; mPoolThread.start(); int memorysize=getMemorySize()/8; //初始化图片缓存 mLruCache=new LruCache<String, Bitmap>(memorysize){ @Override protected int sizeOf(String key, Bitmap value) { return value.getRowBytes() * value.getHeight(); } }; //创建线程池 mThreadPool= Executors.newFixedThreadPool(defaultThreedCount); //初始化任务堆栈 mTaskQueue=new LinkedList<Runnable>(); //模式 mType=type; //后台同时进行线程的信号量 mSemaphoreThreadPool=new Semaphore(defaultThreedCount); } /** * 获取应用的最大内存 * @return */ public int getMemorySize() { int maxMemory= (int) Runtime.getRuntime().maxMemory(); return maxMemory; } public void LoadImage(final String path, final ImageView imageView){ imageView.setTag(path); if(mUIHandler == null){ mUIHandler=new Handler(){ @Override public void handleMessage(Message msg) { //获取得到的图片,为ImageView回调设置图片 ImgBeanHolder holder= (ImgBeanHolder) msg.obj; Bitmap bitmap=holder.bitmap; ImageView imageView=holder.imageView; String path=holder.path; if(imageView.getTag().toString().equals(path)){ imageView.setImageBitmap(bitmap); Animation animation=new AlphaAnimation(0,1); animation.setDuration(1000); imageView.startAnimation(animation); } } }; } Bitmap bitmap=getBitmapFromLruCache(path); if(bitmap !=null){ refreshBitmap(path,imageView,bitmap); }else { addTask(new Runnable(){ @Override public void run() { ImageSize imageSize=getImageViewSize(imageView); //压缩图片 Bitmap bm=decodeSampledBitmapFromPath(path,imageSize.width,imageSize.height); //3.把图片加入到缓存 addBitmapToLruCache(path, bm); refreshBitmap(path, imageView, bm); mSemaphoreThreadPool.release(); } }); } } private void refreshBitmap(String path, ImageView imageView, Bitmap bitmap) { Message message=Message.obtain(); ImgBeanHolder holder=new ImgBeanHolder(); holder.bitmap=bitmap; holder.path=path; holder.imageView=imageView; message.obj=holder; mUIHandler.sendMessage(message); } private void addBitmapToLruCache(String path, Bitmap bm) { if (getBitmapFromLruCache(path) == null) { if (bm != null) { mLruCache.put(path, bm); } } } private Bitmap decodeSampledBitmapFromPath(String path, int width, int height) { //获取图片的宽和高,并不把图片加载到内存中 BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; BitmapFactory.decodeFile(path, options); options.inSampleSize = caculateInSampleSize(options, width, height); //使用获取到的InSampleSize再次解析图片 options.inJustDecodeBounds = false; Bitmap bitmap = BitmapFactory.decodeFile(path, options); return bitmap; } /** * 根据需求的宽和高以及图片实际的宽和高计算SampleSize * * @param options * @param reqwidth * @param reqheight * @return */ private int caculateInSampleSize(BitmapFactory.Options options, int reqwidth, int reqheight) { int width = options.outWidth; int hegiht = options.outHeight; int inSampleSize = 1; if (width > reqwidth || hegiht > reqheight) { int widthRadio = Math.round(width * 1.0f / reqwidth); int heightRadio = Math.round(hegiht * 1.0f / reqheight); inSampleSize = Math.max(widthRadio, heightRadio); } return inSampleSize; } /** * 根据ImageView 获取适当的压缩的宽和高 * * @param imageView * @return */ private ImageSize getImageViewSize(ImageView imageView) { ImageSize imageSize=new ImageSize(); DisplayMetrics displayMetrics=imageView.getContext().getResources().getDisplayMetrics(); ViewGroup.LayoutParams layoutParams=imageView.getLayoutParams(); int width=imageView.getWidth(); if(width<=0){ try { width=layoutParams.width; } catch (Exception e) { width=0; } } if(width<=0){ width=getImageViewFieldValue(imageView,"mMaxWidth"); } if(width<=0){ width=displayMetrics.widthPixels; } int height=imageView.getHeight(); if(height<=0){ try { height=layoutParams.height; } catch (Exception e) { height=0; } } if(height<=0){ height=getImageViewFieldValue(imageView,"mMaxHeight"); } if(height<=0){ height=displayMetrics.heightPixels; } imageSize.width=width; imageSize.height=height; return imageSize; } /** * 通过反射获取最大值 * @param object * @param fieldName * @return */ private int getImageViewFieldValue(Object object, String fieldName) { int value = 0; try { Field field = ImageView.class.getDeclaredField(fieldName); field.setAccessible(true); int fieldValue = field.getInt(object); if (fieldValue > 0 && fieldValue < Integer.MAX_VALUE) { value = fieldValue; } } catch (Exception e) { e.printStackTrace(); } return value; } /** * 同步 * @param runnable */ private synchronized void addTask(Runnable runnable) { mTaskQueue.add(runnable); try { if (mPoolThreadHandler == null) { mSemaphorePoolThreadHandler.acquire(); } } catch (Exception e) { e.printStackTrace(); } mPoolThreadHandler.sendEmptyMessage(0x110); } private Bitmap getBitmapFromLruCache(String path) { return mLruCache.get(path); } private class ImageSize { int width; int height; } private class ImgBeanHolder { Bitmap bitmap; ImageView imageView; String path; } public static ImageLoader getIntance(){ if(mInstance==null){ /** * 保证同一时刻只有一个线程访问该方法 */ synchronized (ImageLoader.class){ if(mInstance==null){ mInstance=new ImageLoader(DEFAULT_THREED_COUNT, Type.LIFO); } } } return mInstance; } /** * 设置线程数和加载模式 * @param count * @param type Type.FIFO Type.LIFO * @return */ public static ImageLoader getIntance(int count,Type type){ if(mInstance==null){ /** * 保证同一时刻只有一个线程访问该方法 */ synchronized (ImageLoader.class){ if(mInstance==null){ mInstance=new ImageLoader(count,type); } } } return mInstance; } }
[ "249424604@qq.com" ]
249424604@qq.com
8fe6d36f9c3a52a5404323f798229ac36bdfd070
9bcb777b51d88b0f48b7857e54c0ca3a7f6f9e3e
/Sorting/TreeSort/src/TreeVisitor.java
c61b257143312b0462b0688d0d13d5fb375d03f4
[]
no_license
Destro13/Algorithms
7860290dd1e0e2c03d22850c6337a8962ff26436
237598f31a13e5a6c011d7643ae3324f74bdd7c1
refs/heads/master
2021-01-11T20:33:27.901066
2018-05-12T21:50:40
2018-05-12T21:50:40
79,142,767
2
0
null
null
null
null
UTF-8
Java
false
false
60
java
public interface TreeVisitor { void visit(Tree node); }
[ "pavlyknazarij@gmail.com" ]
pavlyknazarij@gmail.com
8da874047fed2f871fbe849eaf5df54cadd08669
9e64d53b69c90e582fd8d8d79fb8a7e7dc93fb17
/ch.rgw.utility/src/ch/rgw/tools/Tree.java
d3c83560572af87d08eaeb6176d7a3734fdcff19
[]
no_license
jsigle/elexis-base
e89e277516f2eb94d870f399266560700820dcc5
fbda2efb49220b61ef81da58c1fa4b68c28bbcd4
refs/heads/master
2021-01-17T00:08:29.782414
2013-05-05T18:12:15
2013-05-05T18:12:15
6,995,370
0
1
null
null
null
null
UTF-8
Java
false
false
7,004
java
/******************************************************************************* * Copyright (c) 2005-2009, G. Weirich and Elexis * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * G. Weirich - initial implementation * * $Id: Tree.java 5022 2009-01-23 16:34:27Z rgw_ch $ *******************************************************************************/ package ch.rgw.tools; import java.util.ArrayList; import java.util.Collection; import java.util.Comparator; /** * Eine Baumförmige rekursive Datenstruktur. Ein Tree ist gleicheitig ein node. Ein Tree hat * children (die allerdings auch null sein können) und Geschwister, (die ebenfalls null sein * können), sowie ein Parent, welches ebenfalls null sein kann (dann ist dieses Tree-Objekt die * Wurzel des Baums) Jeder Tree trägt ein beliebiges Datenobjekt (contents). */ public class Tree<T> { public IFilter filter; protected Tree<T> parent; protected Tree<T> first; protected Tree<T> next; // protected Tree<T> last; public T contents; /** * Eine neues Tree-Objekt erstellen * * @param p * der Parent, oder null, wenn dies die Wurzel werden soll. * @param elem * das zugeordnete Datenobjekt */ public Tree(Tree<T> p, T elem){ contents = elem; parent = p; first = null; // last=null; filter = null; if (parent != null) { next = parent.first; parent.first = this; } } /** * Ein neues Tree-Objekt innerhalb der Geschwisterliste sortiert einfügen * * @param parent * Parent * @param elem * Datenobjekt * @param comp * Ein Comparator für das Fatenobjekt */ public Tree(Tree<T> parent, T elem, Comparator<T> comp){ this.parent = parent; contents = elem; if (parent != null) { next = parent.first; Tree<T> prev = null; while ((next != null) && (comp.compare(next.contents, elem) < 0)) { prev = next; next = next.next; } if (prev == null) { parent.first = this; } else { prev.next = this; } } } /** * Ein neues Tree-Objekt mit einem Filter erstellen. Wenn ein Filter gesetzt wird, dann werden * von getChildren() nur die geliefert, die dem Filter entsprechen * * @param p * Parent-Element * @param elem * Datenobjekt * @param f * Filter */ public Tree(Tree<T> p, T elem, IFilter f){ this(p, elem); filter = f; } /** * Filter nachträglich setzen. Der Filter wird für dieses und alle Children gesetzt. * * @param f * der Filter */ public void setFilter(IFilter f){ filter = f; Tree<T> cursor = first; while (cursor != null) { cursor.setFilter(f); cursor = cursor.next; } } /** * Ein Datenobjekt als Kind-element zufügen. Dies (Das Datenobjekt wird implizit in ein * Tree-Objekt gepackt. obj.add(t) ist dasselbe wie new Tree(obj,t)) * * @param elem * Das Datenobjekt * @return das erzeugte Tree-Objekt */ public Tree<T> add(T elem){ Tree<T> ret = new Tree<T>(this, elem, filter); return ret; } /** * Ein Kind-Element samt dessen Unterelementen entfernen * * @param subtree * das Kindelement */ public void remove(Tree<T> subtree){ if (first == null) { return; } if (first.equals(subtree)) { first = subtree.next; return; } Tree<T> runner = first; while (!runner.next.equals(subtree)) { runner = runner.next; if (runner == null) { return; } } runner.next = subtree.next; } /** * An einen anderen Parenet-Node oder Tree zügeln (Mitsamt allen Kindern) * * @param newParent * der neue Elter */ public synchronized Tree<T> move(Tree<T> newParent){ Tree<T> oldParent = parent; if (oldParent != null) { oldParent.remove(this); } parent = newParent; next = newParent.first; newParent.first = this; return this; } /** * Ähnlich wie add, aber wenn das übergebene Child schon existiert, werden nur dessen Kinder mit * den Kindern des existenten childs ge'merged' (Also im Prinzip ein add mit Vermeidung von * Dubletten */ public synchronized void merge(Tree<T> newChild){ Tree<T> tExist = find(newChild.contents, false); if (tExist != null) { for (Tree<T> ts = newChild.first; ts != null; ts = ts.next) { tExist.merge(ts); } if (newChild.first == null) { newChild.getParent().remove(newChild); } } else { newChild.move(this); } } /** * Alle Kind-Elemente entfernen * */ @SuppressWarnings("unchecked")//$NON-NLS-1$ public synchronized void clear(){ for (Tree t : getChildren()) { remove(t); } } /** * Alle Kind-Elemente liefern * * @return eine Collection mit den Kind-Trees */ public Collection<Tree<T>> getChildren(){ ArrayList<Tree<T>> al = new ArrayList<Tree<T>>(); Tree<T> cursor = first; while (cursor != null) { if (filter == null) { al.add(cursor); } else { if (filter.select(cursor.contents) || cursor.hasChildren()) { al.add(cursor); } } cursor = cursor.next; } return al; } /** * Das Elternobjekt liefern * * @return das parent */ public Tree<T> getParent(){ return parent; } /** * Erstes Kind-element liefern. Null, wenn keine Kinder. Dies macht im Gegensatz zu * hasChildren() keine synchronisation! * * @return */ public Tree<T> getFirstChild(){ return first; } /** * Nächstes Geschwister liefern oder null wenn keine mehr da sind. getParent().getFirstChild() * liefert den Start der Geschwisterliste. * * @return */ public Tree<T> getNextSibling(){ return next; } /** * Fragen, ob Kinder vorhanden sind * * @return true wenn dieses Objekt Children hat. */ public boolean hasChildren(){ if (filter == null) { return (first != null); } Tree<T> cursor = first; while (cursor != null) { if (filter.select(cursor.contents) || cursor.hasChildren()) { return true; } cursor = cursor.next; } return false; } /** * Ein Array mit allen Elementen des Baums liefern * * @return */ @SuppressWarnings("unchecked")//$NON-NLS-1$ public Tree<T>[] toArray(){ return (Tree<T>[]) getAll().toArray(); } /** * Eine Liste mit allen Elementen des Baums liefern * * @return */ public Collection<Tree<T>> getAll(){ ArrayList<Tree<T>> al = new ArrayList<Tree<T>>(); Tree<T> child = first; while (child != null) { al.add(child); al.addAll(child.getAll()); child = child.next; } return al; } public Tree<T> find(Object o, boolean deep){ for (Tree<T> t : getChildren()) { if (t.contents.equals(o)) { return t; } if (deep) { Tree<T> ct = t.find(o, true); if (ct != null) { return ct; } } } return null; } }
[ "jsigle@think3.sc.de" ]
jsigle@think3.sc.de
55083d33f54a490f759ceb65014e36a4bfd8969c
3af4a7fc6d6a7bc413efdb21cd739151a4fae937
/icecream-backend/icecream-auth/src/main/java/com/apang/icecream/auth/configure/WebSecurityConfig.java
e2d1763222a6cb78beaaee88e4db48512e836877
[]
no_license
justinlxf/icecream
c0b993c6db0f17475bac37aeb1022a4247c3f344
2faefd2fa1a2e27faba20080afa8347c26a0114b
refs/heads/master
2023-01-19T17:46:08.953992
2020-10-27T09:21:47
2020-10-27T09:21:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,358
java
package com.apang.icecream.auth.configure; import com.apang.icecream.auth.security.CustomExpiredSessionStrategy; import com.apang.icecream.auth.security.User4AuthDetailService; import com.apang.icecream.auth.security.UserRoleDecisionVoter; import com.apang.icecream.auth.constants.AuthConstants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.access.AccessDecisionManager; import org.springframework.security.access.AccessDecisionVoter; import org.springframework.security.access.vote.AffirmativeBased; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.authentication.AuthenticationProvider; import org.springframework.security.authentication.ProviderManager; import org.springframework.security.authentication.dao.DaoAuthenticationProvider; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.core.session.SessionRegistry; import org.springframework.security.core.session.SessionRegistryImpl; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * 认证配置管理.<br> * * @author andy pang <br> * @version 1.0.0 2019年8月30日<br> * @since JDK 1.8.0 */ @Configuration @EnableWebSecurity public class WebSecurityConfig extends WebSecurityConfigurerAdapter { /** * LOG. */ private Logger logger = LoggerFactory.getLogger(this.getClass()); @Autowired private User4AuthDetailService user4AuthDetailService; @Autowired private CustomExpiredSessionStrategy expiredSessionStrategy; @Override protected void configure(HttpSecurity http) throws Exception { http.authorizeRequests() // 默认许可的访问地址. .antMatchers(AuthConstants.C_AUTH_URI).permitAll() .anyRequest().authenticated() .and() // 登出session处理. .logout().invalidateHttpSession(true) .and() // Session控制. .sessionManagement().maximumSessions(1).maxSessionsPreventsLogin(false).expiredSessionStrategy(expiredSessionStrategy) .sessionRegistry(this.sessionRegistry()).and() .and() // 认证 .authenticationProvider(this.authenticationProvider()).authorizeRequests().anyRequest().authenticated() .accessDecisionManager(this.accessDecisionManager()); http.csrf().disable(); } @Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { super.configure(auth); } /** * 会话注册. * @return Registry. */ @Bean public SessionRegistry sessionRegistry() { return new SessionRegistryImpl(); } /** * 实例化投票器. * @return 实例化的投票器. */ @Bean UserRoleDecisionVoter userRoleVoter(){ return new UserRoleDecisionVoter(); } /** * 实例化AccessDecisionManager. * @return 实例. */ @Bean AccessDecisionManager accessDecisionManager() { List<AccessDecisionVoter<? extends Object>> decisionVoters = new ArrayList<AccessDecisionVoter<? extends Object>>(); decisionVoters.add(this.userRoleVoter()); return new AffirmativeBased(decisionVoters); } @Bean User4AuthDetailService userDetailServiceImpl() { final User4AuthDetailService detailService = new User4AuthDetailService(); return detailService; } /** * 认证管理 * @return 实例. * @throws Exception 异常. */ @Bean public AuthenticationManager authenticationManager() throws Exception { DaoAuthenticationProvider authenticationProvider = new DaoAuthenticationProvider(); BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); authenticationProvider.setPasswordEncoder(passwordEncoder); authenticationProvider.setUserDetailsService(this.userDetailServiceImpl()); ProviderManager authenticationManager = new ProviderManager(Arrays.asList((AuthenticationProvider) authenticationProvider)); return authenticationManager; } /** * 认证提供处理者. * @return 实例. * @throws Exception 异常. */ @Bean public AuthenticationProvider authenticationProvider() throws Exception { DaoAuthenticationProvider authenticationProvider = new DaoAuthenticationProvider(); BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); authenticationProvider.setPasswordEncoder(passwordEncoder); authenticationProvider.setUserDetailsService(this.userDetailServiceImpl()); return authenticationProvider; } }
[ "260445@gree.com.cn" ]
260445@gree.com.cn
0f39952540a24ed9e6499047c7f4cabf9f5fc0c0
255ff79057c0ff14d0b760fc2d6da1165f1806c8
/02JavaStep02/01java进阶13天资料/day09-方法引用, Stream流,File类 , 递归 ,字节流/homework/01.File,递归作业和答案/day09_Homework/src/com/itheima/test01/Test01_05.java
b4c0931d73fd7bf6e176d5b12e736165f2bacfbe
[]
no_license
wjphappy90/Resource
7f1f817d323db5adae06d26da17dfc09ee5f9d3a
6574c8399f3cdfb6d6b39cd64dc9507e784a2549
refs/heads/master
2022-07-30T03:33:59.869345
2020-08-10T02:31:35
2020-08-10T02:31:35
285,701,650
2
6
null
null
null
null
UTF-8
Java
false
false
515
java
package com.itheima.test01; import java.io.File; import java.io.IOException; /** * @author pkxing * @version 1.0 * @Package com.itheima.test01 * @date 2018/5/4 上午10:43 */ public class Test01_05 { public static void main(String[] args) throws IOException { // 创建文件对象 File f = new File("c:/a.txt"); // 删除文件 f.delete(); // 创建文件夹对象 File dir = new File("c:/aaa"); // 删除文件夹 dir.delete(); } }
[ "981146457@qq.com" ]
981146457@qq.com
b4fedabf2f32db6cbbb4af533ed814a16de4a24b
5ed707d521adab6077936dfd65ce84f83db44775
/src/main/java/tn/esprit/spring/entity/User.java
defac9ef4d2e40df432f132d25ca23d03279b4cb
[]
no_license
Hghassen/springBootDataJpa
9f0c171a4d3dee407ebb21deab1f517f149bedff
e12d0401e7a86b9b36e443f1b9a87f0e2631cbda
refs/heads/main
2023-08-21T23:32:24.481385
2021-10-26T18:56:16
2021-10-26T18:56:16
412,798,547
0
0
null
null
null
null
UTF-8
Java
false
false
1,866
java
package tn.esprit.spring.entity; import java.io.Serializable; import java.util.Date; import javax.persistence.EnumType; import javax.persistence.Enumerated; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Temporal; import javax.persistence.TemporalType; import javax.persistence.Entity; import javax.persistence.Table; @Entity @Table public class User implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String firstName; private String lastName; @Enumerated(EnumType.STRING) Role role; @Temporal(TemporalType.DATE) private Date dateNaissance; public Long getId() { return id; } public void setId(Long id) { this.id = id; } 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 Role getRole() { return role; } public void setRole(Role role) { this.role = role; } public Date getDateNaissance() { return dateNaissance; } public void setDateNaissance(Date dateNaissance) { this.dateNaissance = dateNaissance; } public User(Long id, String firstName, String lastName, Date dateNaissance, Role role) { this.id = id; this.firstName = firstName; this.lastName = lastName; this.role = role; this.dateNaissance = dateNaissance; } public User() { super(); // TODO Auto-generated constructor stub } @Override public String toString() { return "User [id=" + id + ", firstName=" + firstName + ", lastName=" + lastName + ", role=" + role + ", dateNaissance=" + dateNaissance + "]"; } }
[ "ghassen.hammouda@esprit.tn" ]
ghassen.hammouda@esprit.tn
72c5f8b1642a3f9134dc93afa061e73d3340e4df
48e257621587490b1c54a935543c29897ef3f71b
/core/src/test/java/galdr/spy/CollectionDisposeStartEventTest.java
2fcbcf0e1b24fb79b3326b3083a6eceafb7ea78f
[ "Apache-2.0" ]
permissive
realityforge/galdr
4719044471acb14cbe42bddf5cc22a7b69230952
185c07dcb2aa71f716d3fcaf55517ea9e41eade9
refs/heads/master
2022-05-16T11:01:48.109987
2022-04-29T08:16:11
2022-04-29T08:16:11
207,789,524
1
0
null
null
null
null
UTF-8
Java
false
false
1,137
java
package galdr.spy; import galdr.AbstractTest; import galdr.AreaOfInterest; import galdr.World; import galdr.Worlds; import java.util.Collections; import java.util.HashMap; import org.testng.annotations.Test; import static org.testng.Assert.*; public class CollectionDisposeStartEventTest extends AbstractTest { private static class Health { } @Test public void basicOperation() { final World world = Worlds.world().component( Health.class ).build(); final AreaOfInterest areaOfInterest = world.createAreaOfInterest( Collections.singletonList( Health.class ) ); run( world, () -> world.createSubscription( areaOfInterest ) ); final CollectionInfo info = world.getSpy().getCollections().get( areaOfInterest ); final CollectionDisposeStartEvent event = new CollectionDisposeStartEvent( info ); assertEquals( event.getCollection(), info ); final HashMap<String, Object> data = new HashMap<>(); event.toMap( data ); assertEquals( data.get( "type" ), "CollectionDisposeStart" ); assertEquals( data.get( "areaOfInterest" ), areaOfInterest ); assertEquals( data.size(), 2 ); } }
[ "peter@realityforge.org" ]
peter@realityforge.org
2f3f7082ac5e08afd427b0504ff8f477fbbcc668
2c646bc5e3ed35389c42abc00096799cacbdc8ec
/src/com/itqf/servlet/loginAjaxServlet.java
6f4e199b92eb9c6cc4b6fd48a5365da061b1b085
[]
no_license
Zwjcheer/test
686a5147806dcf64abf7ed1ed6cb593960e5139b
6897278ea177b289931752040939794fd396031e
refs/heads/master
2021-07-25T13:16:43.185265
2017-11-05T01:05:36
2017-11-05T01:05:36
109,376,836
0
0
null
null
null
null
UTF-8
Java
false
false
1,370
java
package com.itqf.servlet; import java.io.IOException; import java.sql.SQLException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.itqf.bean.Student; import com.itqf.service.StudentService; @WebServlet("/loginAjaxServlet") public class loginAjaxServlet extends HttpServlet{ @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { req.setCharacterEncoding("UTF-8"); resp.setContentType("text/html;charset=UTF-8"); String username = req.getParameter("username"); String password = req.getParameter("password"); StudentService service=new StudentService(); try { Student findLogin = service.findLogin(username,password); // System.out.println(findLogin); req.getSession().setAttribute("findLogin", findLogin); if(findLogin!=null){ resp.getWriter().print("1"); }else{ resp.getWriter().print("0"); } } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { doGet(req, resp); } }
[ "32290377+Zwjcheer@users.noreply.github.com" ]
32290377+Zwjcheer@users.noreply.github.com
01dfef6bb99fc60647ecfbf8069b7f9bf86ff0f1
df670a9f8372540b695b9b936a8bde9ea2e36742
/src/com/parkingsystem/Car.java
df05298d13bd7f320417810c56abd24cb000fee1
[]
no_license
XixiePi/SimpleParkingLotSystem
77b07b27b721cc6cd4772d58c75361182333b66d
bb321547f3bb6d9f96a8a24e508a0745d35e712a
refs/heads/master
2020-05-22T02:59:38.254942
2019-05-12T02:46:42
2019-05-12T02:46:42
186,154,758
0
0
null
null
null
null
UTF-8
Java
false
false
773
java
package com.parkingsystem; public class Car { //Attributes public String plateNumber; public boolean isParked; public String parkingLotID; public int parkingHour; public Car(String plateNumber){ this.plateNumber = plateNumber; } public int parkCar(String parkingLotID, String plateNumber) { // TODO: Check is the car is parked somewhere else; this.isParked = true; this.plateNumber = plateNumber; this.parkingLotID = parkingLotID; return 1; } public int driveAway(int parkingHour) { // write your code here this.isParked = false; this.plateNumber = null; this.parkingLotID = null; this.parkingHour = parkingHour; return 1; } }
[ "Xingyu.xie@outlook.com" ]
Xingyu.xie@outlook.com
317e1bb83ddf8b624bfef18ffcd17aff7db02380
b4f9d7abccca2304f12accffc6af354a83365963
/stu_service/class_service/src/test/java/com/qf/class_service/ClassServiceApplicationTests.java
34c71265d57b3361fc3d483d3fa9068206482e3a
[]
no_license
destiny16825/student_manager
165baa6af7f776927871570403fb83f7eb4618c6
e972ebcac3a87b7a5121ebd472c128ba0f99b739
refs/heads/master
2020-05-07T05:41:46.100100
2019-04-09T03:52:03
2019-04-09T03:52:03
180,280,711
1
0
null
null
null
null
UTF-8
Java
false
false
343
java
package com.qf.class_service; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class ClassServiceApplicationTests { @Test public void contextLoads() { } }
[ "ldw@qq.com" ]
ldw@qq.com
437ef5ca3a98a9cceda518a878c711a702908c0d
0f8506da1ea43cd94e871d2b90f51573ff394b70
/vjezbe/MouseExample.java
a2262051f6d609854750fa9feac2bf11f630afe8
[]
no_license
ZaidZerdo/VjezbeW7D1
e9d53dd6d4549d26aade29125644bb082c8002f5
68a1c928efd7b9d696092dee3b1ba3f767612ea5
refs/heads/master
2021-01-16T00:28:28.915655
2015-06-29T14:59:26
2015-06-29T14:59:26
38,245,263
0
0
null
null
null
null
UTF-8
Java
false
false
2,017
java
package vjezbe; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Font; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import javax.swing.JFrame; import javax.swing.JLabel; public class MouseExample extends JFrame { private static final long serialVersionUID = -3037227350838747481L; private JLabel label = new JLabel("GITHub"); private Font font1 = new Font("Monospaced", Font.PLAIN, 35); private Font font2 = new Font("Monospaced", Font.BOLD, 35); public MouseExample() { setLayout(new BorderLayout()); add(label); label.setFont(font1); label.setHorizontalAlignment(JLabel.CENTER); label.addMouseListener(new Mouse()); label.addMouseMotionListener(new MouseMotion()); label.setText("Fuj"); setSize(400, 300); setLocationRelativeTo(null); setTitle("Fuj"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setVisible(true); } public static void main(String[] args) { new MouseExample(); } private class MouseMotion implements MouseMotionListener { private int counter = 0; @Override public void mouseDragged(MouseEvent arg0) { } @Override public void mouseMoved(MouseEvent arg0) { System.out.println(counter); counter++; } } private class Mouse implements MouseListener { @Override public void mouseClicked(MouseEvent arg0) { } @Override public void mouseEntered(MouseEvent e) { if (e.getSource() == label) { label.setForeground(Color.RED); } } @Override public void mouseExited(MouseEvent e) { if (e.getSource() == label) { label.setForeground(Color.BLACK); } } @Override public void mousePressed(MouseEvent e) { if (e.getSource() == label) { label.setFont(font2); label.setForeground(Color.BLACK); } } @Override public void mouseReleased(MouseEvent e) { if (e.getSource() == label) { label.setFont(font1); label.setForeground(Color.RED); } } } }
[ "zerdo.zaid@gmail.com" ]
zerdo.zaid@gmail.com
d865c1c4a5129f78bc0333db99df3865ad11c9d1
3374f62c624c1e133ffcdd340713a50303cb7c6d
/core/applib/src/main/java/org/apache/isis/applib/annotation/DomainService.java
9f9d33782d316c85e8d978250aecd3b6041458bf
[ "Apache-2.0" ]
permissive
DalavanCloud/isis
83b6d6437a3ca3b7e0442ed1b8b5dbc3ae67ef1e
2af2ef3e2edcb807d742f089839e0571d8132bd9
refs/heads/master
2020-04-29T10:08:49.816838
2019-02-11T23:35:56
2019-02-11T23:35:56
176,051,163
1
0
Apache-2.0
2019-03-17T03:19:31
2019-03-17T03:19:31
null
UTF-8
Java
false
false
3,053
java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.isis.applib.annotation; import java.lang.annotation.*; /** * Indicates that the class should be automatically recognized as a domain service. * * <p> * Also indicates whether the domain service acts as a repository for an entity, and menu ordering UI hints. * </p> */ @Inherited @Target({ ElementType.TYPE }) @Retention(RetentionPolicy.RUNTIME) public @interface DomainService { /** * Provides the (first part of the) unique identifier (OID) for the service (the instanceId is always &quot;1&quot;). * * <p> * If not specified then either the optional &quot;getId()&quot is used, otherwise the class' name. */ String objectType() default ""; /** * If this domain service acts as a repository for an entity type, specify that entity type. */ Class<?> repositoryFor() default Object.class; /** * The nature of this service, eg for menus, contributed actions, repository. */ NatureOfService nature() default NatureOfService.VIEW; /** * Number in Dewey Decimal format representing the order. * * <p> * Same convention as {@link MemberOrder#sequence()}. If not specified, placed after any named. * </p> * * <p> * Either this attribute or {@link DomainServiceLayout#menuOrder()} can be used; they are equivalent. * Typically this attribute is used for services with a {@link #nature() nature} of * {@link NatureOfService#DOMAIN domain} (these are not visible in the UI) whereas * {@link DomainServiceLayout#menuOrder()} is used for services with a nature of * {@link NatureOfService#VIEW_MENU_ONLY} (which do appear in the UI) * </p> * * <p> * The default value is set to "Integer.MAX_VALUE - 100" so that any domain services intended to override the * default implementations provided by the framework itself will do so without having to specify the * menuOrder (with the exception of <tt>EventBusServiceJdo</tt>, all framework implementations have a * default order greater than Integer.MAX_VALUE - 50). * </p> */ String menuOrder() default Constants.MENU_ORDER_DEFAULT ; }
[ "dan@haywood-associates.co.uk" ]
dan@haywood-associates.co.uk
4d8b0f65e51db9eff22505ea61f9969b3762f8ca
b2ee4f56779f783bc13f4b669b8a6a9b77db7393
/wcloud-account-service/src/main/java/com/whirlpool/wcloud/model/Account.java
480f64e2ec09e64f4b441b50f1fe064c041e380e
[]
no_license
pativ11/test1
bf5163e1f4ad50b27f7ed84fb186b2f346de2dee
c0bc22e776de7a255692bac71ae936f792fe12cf
refs/heads/master
2021-01-21T05:29:44.645662
2017-02-26T11:06:53
2017-02-26T11:06:53
83,198,872
0
0
null
null
null
null
UTF-8
Java
false
false
882
java
package com.whirlpool.wcloud.model; import java.util.Date; public class Account { private int id; private String account_status; private Date created_at; private Date updated_at; private int m2m_user_id; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getAccount_status() { return account_status; } public void setAccount_status(String account_status) { this.account_status = account_status; } public Date getCreated_at() { return created_at; } public void setCreated_at(Date created_at) { this.created_at = created_at; } public Date getUpdated_at() { return updated_at; } public void setUpdated_at(Date updated_at) { this.updated_at = updated_at; } public int getM2m_user_id() { return m2m_user_id; } public void setM2m_user_id(int m2m_user_id) { this.m2m_user_id = m2m_user_id; } }
[ "vishwanath_patil_syntel@whirlpool.com" ]
vishwanath_patil_syntel@whirlpool.com
6dd5f7707a7e237a1b649c5ce444a2a00e6324c0
a13b2b1f177a00b03f4a62bc2193fc4fc578ec61
/app/src/main/java/com/wfl/kits/commons/utils/Views.java
626659ffba953a95cd11a1a86b3a2bc4eede1de0
[]
no_license
wflfei/kits
44e20d4c737b6a404b09d276ae037d0f27d8bd19
4c86573402ebd54121274d8195046e7bef311222
refs/heads/master
2021-01-15T15:42:36.799193
2018-04-02T03:07:12
2018-04-02T03:07:12
47,069,628
0
0
null
null
null
null
UTF-8
Java
false
false
436
java
package com.wfl.kits.commons.utils; import android.app.Activity; import android.view.View; import android.view.ViewGroup; /** * Created by wfl on 15/11/15. */ public class Views { public static <T extends View> T find(ViewGroup viewGroup, int id) { return (T) viewGroup.findViewById(id); } public static <T extends View> T find(Activity activity, int id) { return (T) activity.findViewById(id); } }
[ "826338180@qq.com" ]
826338180@qq.com
1954d29f6412d3503277c179d6fecdeeb2b39102
74b47b895b2f739612371f871c7f940502e7165b
/aws-java-sdk-licensemanager/src/main/java/com/amazonaws/services/licensemanager/model/RejectGrantRequest.java
3c6a84d03bc7c4fe9ec77cc124835f5fbd1dbc42
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
baganda07/aws-sdk-java
fe1958ed679cd95b4c48f971393bf03eb5512799
f19bdb30177106b5d6394223a40a382b87adf742
refs/heads/master
2022-11-09T21:55:43.857201
2022-10-24T21:08:19
2022-10-24T21:08:19
221,028,223
0
0
Apache-2.0
2019-11-11T16:57:12
2019-11-11T16:57:11
null
UTF-8
Java
false
false
3,535
java
/* * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.licensemanager.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/license-manager-2018-08-01/RejectGrant" target="_top">AWS API * Documentation</a> */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class RejectGrantRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** * <p> * Amazon Resource Name (ARN) of the grant. * </p> */ private String grantArn; /** * <p> * Amazon Resource Name (ARN) of the grant. * </p> * * @param grantArn * Amazon Resource Name (ARN) of the grant. */ public void setGrantArn(String grantArn) { this.grantArn = grantArn; } /** * <p> * Amazon Resource Name (ARN) of the grant. * </p> * * @return Amazon Resource Name (ARN) of the grant. */ public String getGrantArn() { return this.grantArn; } /** * <p> * Amazon Resource Name (ARN) of the grant. * </p> * * @param grantArn * Amazon Resource Name (ARN) of the grant. * @return Returns a reference to this object so that method calls can be chained together. */ public RejectGrantRequest withGrantArn(String grantArn) { setGrantArn(grantArn); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getGrantArn() != null) sb.append("GrantArn: ").append(getGrantArn()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof RejectGrantRequest == false) return false; RejectGrantRequest other = (RejectGrantRequest) obj; if (other.getGrantArn() == null ^ this.getGrantArn() == null) return false; if (other.getGrantArn() != null && other.getGrantArn().equals(this.getGrantArn()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getGrantArn() == null) ? 0 : getGrantArn().hashCode()); return hashCode; } @Override public RejectGrantRequest clone() { return (RejectGrantRequest) super.clone(); } }
[ "" ]
c9f8e67b4c6c160f164d7d04db1f1976b1964805
e6604ec59cbf5c8db141bc4338a1b99c098adce7
/quora-service/src/main/java/com/upgrad/quora/service/business/PasswordCryptographyProvider.java
181f6d226cdfe03a832bf4ce8c16f5f998d41e0f
[]
no_license
priteshkumar/quora-api
140ce891294227ac1b0a1065e3610dcbd186d452
345b3212260461f35922afbe6b873afccf43da78
refs/heads/master
2022-12-07T04:11:41.952000
2020-08-25T15:20:09
2020-08-25T15:20:09
286,382,925
0
0
null
2020-08-16T14:11:51
2020-08-10T05:20:08
Java
UTF-8
Java
false
false
3,124
java
package com.upgrad.quora.service.business; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; import java.security.spec.InvalidKeySpecException; import java.util.Base64; import java.util.Random; import javax.crypto.SecretKey; import javax.crypto.SecretKeyFactory; import javax.crypto.spec.PBEKeySpec; import org.springframework.stereotype.Component; @Component public class PasswordCryptographyProvider { private final static char[] hexArray = "0123456789ABCDEF".toCharArray(); private static String SECRET_KEY_ALGORITHM = "PBKDF2WithHmacSHA512"; private static int HASHING_ITERATIONS = 1000; private static int HASHING_KEY_LENGTH = 64; /** * This method re-generates hashed Password from raw-password and salt. This will be used during * authentication. * * @param password char array. * @param salt byte array. * @return byte array of hashed password. */ public static String encrypt(final String password, String salt) { return bytesToHex(hashPassword(password.toCharArray(), getBase64DecodedStringAsBytes(salt))); } /** * This method generates Salt * * @return 32 bytes long array */ private static byte[] generateSaltBytes() { final Random random = new SecureRandom(); byte[] saltBytes = new byte[32]; random.nextBytes(saltBytes); return saltBytes; } /** * This method generates hashed Password * * @param password char array. * @param salt byte array. * @return byte array of hashed password. */ private static byte[] hashPassword(final char[] password, final byte[] salt) { try { SecretKeyFactory skf = SecretKeyFactory.getInstance(SECRET_KEY_ALGORITHM); PBEKeySpec spec = new PBEKeySpec(password, salt, HASHING_ITERATIONS, HASHING_KEY_LENGTH); SecretKey key = skf.generateSecret(spec); byte[] res = key.getEncoded(); return res; } catch (NoSuchAlgorithmException | InvalidKeySpecException e) { throw new RuntimeException(e); } } private static String bytesToHex(byte[] bytes) { char[] hexChars = new char[bytes.length * 2]; for (int j = 0; j < bytes.length; j++) { int v = bytes[j] & 0xFF; hexChars[j * 2] = hexArray[v >>> 4]; hexChars[j * 2 + 1] = hexArray[v & 0x0F]; } return new String(hexChars); } private static String getBase64EncodedBytesAsString(byte bytes[]) { return Base64.getEncoder().encodeToString(bytes); } private static byte[] getBase64DecodedStringAsBytes(String decode) { return Base64.getDecoder().decode(decode); } /** * This method generates Salt and hashed Password * * @param password char array. * @return String array with [0] encoded salt [1] hashed password. */ public String[] encrypt(final String password) { byte[] salt = generateSaltBytes(); byte[] hashedPassword = hashPassword(password.toCharArray(), salt); return new String[]{getBase64EncodedBytesAsString(salt), bytesToHex(hashedPassword)}; } }
[ "pritesh.kumar2@gmail.com" ]
pritesh.kumar2@gmail.com
fcc5288cb54c1dc8ce9facb76d97974f221a362f
903cff6d0b72d4933df7015d99246cd60eb18232
/src/pacman/view/screens/EndGame.java
3ebf5a9d479060c74f16d57c5e49782a62bd3c20
[]
no_license
lesquoyb/pacman
68e213abcf7e9aabc614ab9c93a4822149a3bdb5
c82346c26c99425274d6c02d62962f0f0e116c8e
refs/heads/master
2021-01-01T06:45:29.603082
2015-03-04T01:53:37
2015-03-04T01:53:37
29,625,684
0
0
null
null
null
null
UTF-8
Java
false
false
1,825
java
package pacman.view.screens; import pacman.controller.resources.ResourceManager; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Screen; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.TextureRegion; public class EndGame implements Screen{ private boolean victory; private TextureRegion texture; private String score; private SpriteBatch batch; public EndGame(boolean victory, String score){ this.victory = victory; this.score = score; ResourceManager.getFont(ResourceManager.menuFont).setColor(Color.BLACK); } @Override public void show() { if(victory){ texture = ResourceManager.getTexture(ResourceManager.victoire,false); } else{ texture = ResourceManager.getTexture(ResourceManager.defaite,false); } batch = new SpriteBatch(); } public void qContinue(){ texture = ResourceManager.getTexture(ResourceManager.qContinue,false); } @Override public void render(float delta) { Gdx.gl.glClearColor(1, 1, 1, 0); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); batch.begin(); batch.draw(texture, 0, 0); ResourceManager.getFont(ResourceManager.menuFont).draw(batch, score, Gdx.graphics.getWidth()/2, Gdx.graphics.getHeight()/2); batch.end(); } @Override public void resize(int width, int height) { // TODO Auto-generated method stub } @Override public void pause() { // TODO Auto-generated method stub } @Override public void resume() { // TODO Auto-generated method stub } @Override public void hide() { // TODO Auto-generated method stub } @Override public void dispose() { // TODO Auto-generated method stub } }
[ "nouvelleaddresse@yahoo.fr" ]
nouvelleaddresse@yahoo.fr
5b68586ddd181ddb83446d977e20056bf1109a43
67c36c848798add6499d91335678a19f98849576
/src/main/java/Singer.java
c7e7dadb43876eb7361e4c9a1ad7b9b525405887
[]
no_license
sviatiq/music
f62c3dc40e0e197bb1c80a0f3b9bb74071bcb96b
565a7e6767a40061d36734e5f7847faa1daddda6
refs/heads/master
2020-05-23T09:27:01.835704
2019-05-14T22:22:12
2019-05-14T22:22:12
186,706,707
0
0
null
null
null
null
UTF-8
Java
false
false
206
java
public class Singer extends Music{ private String name; private String country; public Singer(String genre, String country, String language) { super(genre, country, language); } }
[ "sviatiq@mail.ru" ]
sviatiq@mail.ru
e7d08009bd658852feeaa6755fbf67dcf00a7d73
3ef55e152decb43bdd90e3de821ffea1a2ec8f75
/large/module1613_public/tests/unittests/src/java/module1613_public_tests_unittests/a/Foo1.java
04609ea13c2344302f33ea52d9fd55e16f19c188
[ "BSD-3-Clause" ]
permissive
salesforce/bazel-ls-demo-project
5cc6ef749d65d6626080f3a94239b6a509ef145a
948ed278f87338edd7e40af68b8690ae4f73ebf0
refs/heads/master
2023-06-24T08:06:06.084651
2023-03-14T11:54:29
2023-03-14T11:54:29
241,489,944
0
5
BSD-3-Clause
2023-03-27T11:28:14
2020-02-18T23:30:47
Java
UTF-8
Java
false
false
1,704
java
package module1613_public_tests_unittests.a; import javax.lang.model.*; import javax.management.*; import javax.naming.directory.*; /** * Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut * labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. * Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. * * @see java.nio.file.FileStore * @see java.sql.Array * @see java.util.logging.Filter */ @SuppressWarnings("all") public abstract class Foo1<L> extends module1613_public_tests_unittests.a.Foo0<L> implements module1613_public_tests_unittests.a.IFoo1<L> { java.util.zip.Deflater f0 = null; javax.annotation.processing.Completion f1 = null; javax.lang.model.AnnotatedConstruct f2 = null; public L element; public static Foo1 instance; public static Foo1 getInstance() { return instance; } public static <T> T create(java.util.List<T> input) { return module1613_public_tests_unittests.a.Foo0.create(input); } public String getName() { return module1613_public_tests_unittests.a.Foo0.getInstance().getName(); } public void setName(String string) { module1613_public_tests_unittests.a.Foo0.getInstance().setName(getName()); return; } public L get() { return (L)module1613_public_tests_unittests.a.Foo0.getInstance().get(); } public void set(Object element) { this.element = (L)element; module1613_public_tests_unittests.a.Foo0.getInstance().set(this.element); } public L call() throws Exception { return (L)module1613_public_tests_unittests.a.Foo0.getInstance().call(); } }
[ "gwagenknecht@salesforce.com" ]
gwagenknecht@salesforce.com
f18f3b3d24e0d0bbfe0a375d58adad25444b1729
4fedd44e9c08e8fa12cc7e557338ee25cfe55948
/TPE-Programacion3/Aeropuerto.java
2c9279557c4ade896e43b9a72ebc21bfbf5b8425
[]
no_license
FlorenciaWilgenhoff/PROGRAMACION-3
3fa7e612c54777b10d0f2510612bec619f173d50
a55f0e7804bf7680efbc86277428602a758bbb25
refs/heads/master
2020-05-07T09:49:11.988062
2019-08-16T14:49:59
2019-08-16T14:49:59
180,243,962
0
0
null
null
null
null
UTF-8
Java
false
false
2,128
java
import java.util.ArrayList; import java.util.List; public class Aeropuerto { private String nombre; private String pais; private String ciudad; private String estado; private List<Ruta> rutas; public Aeropuerto(String nombre,String ciudad, String pais) { this.ciudad = ciudad; this.nombre = nombre; this.pais = pais; this.estado = "noVisitado"; } public String getCiudad() { return ciudad; } public void setCiudad(String ciudad) { this.ciudad = ciudad; } public String getNombre() { return nombre; } public void setNombre(String nombre) { this.nombre = nombre; } public String getPais() { return pais; } public void setPais(String pais) { this.pais = pais; } public List<Ruta> getRutas() { return rutas; } public void addRuta(Ruta ruta) { if (rutas == null) { rutas = new ArrayList<>(); } rutas.add(ruta); } public String getEstado() { return estado; } public void setEstado(String estado) { this.estado = estado; } @Override public String toString() { return this.nombre; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((ciudad == null) ? 0 : ciudad.hashCode()); result = prime * result + ((nombre == null) ? 0 : nombre.hashCode()); result = prime * result + ((pais == null) ? 0 : pais.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; Aeropuerto other = (Aeropuerto) obj; if (ciudad == null) { if (other.ciudad != null) return false; } else if (!ciudad.equals(other.ciudad)) return false; if (nombre == null) { if (other.nombre != null) return false; } else if (!nombre.equals(other.nombre)) return false; if (pais == null) { if (other.pais != null) return false; } else if (!pais.equals(other.pais)) return false; return true; } }
[ "florenciawilgenhoff12@gmail.com" ]
florenciawilgenhoff12@gmail.com
cb2ee2b458fa4a744fd5012eab09bf94b9e71493
4028ecb799c7ad196661e0dc6acc28e4af513a5c
/main-mod/src/main/java/com/niezhiliang/nexus/docker/Application.java
8a92572e40c0d461d7c3da58a1bb66c460635744
[]
no_license
niezhiliang/maven-nexus-docker
7ccc5bb80b7d0eb9a68e5b00deb71a691e06d447
7b8f9790ca83d8235a618f71cf8b22d46c4820b8
refs/heads/master
2021-07-09T09:25:00.680625
2020-08-04T08:18:24
2020-08-04T08:18:24
159,758,576
0
1
null
null
null
null
UTF-8
Java
false
false
286
java
package com.niezhiliang.nexus.docker; import com.niezhiliang.com.test.mod.TestUtils; /** * @Author NieZhiLiang * @Email nzlsgg@163.com * @Date 2018/11/30 上午10:54 */ public class Application { public static void main(String[] args) { TestUtils.sayHello(); } }
[ "1132263176@qq.com" ]
1132263176@qq.com
4071e8465a2075b032baf481a8fd418195a12088
75793e804225dc48c7fdb460a6071bdab36b9d39
/src/main/java/cn/com/pingan/cdn/config/RedisLuaScriptService.java
cb3f0c10e212cec82071155b90e2d4f1614b719b
[]
no_license
x00082/anubis-content
da8f6bd63e774624bf59112efe27fccdc9cec280
e0cf332125ba2b0eff55e4f1a752ef4e9eb05e19
refs/heads/main
2023-04-07T03:14:34.667459
2020-11-23T11:32:52
2020-11-23T11:32:52
305,291,788
0
0
null
null
null
null
UTF-8
Java
false
false
4,798
java
/** * @Project: anubis-content * @File: RedisContentCountLuaScriptService.java * @Package cn.com.pingan.cdn.config * @Description: TODO() * @author lujun * @date 2020年10月16日 上午9:59:58 */ package cn.com.pingan.cdn.config; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.DataAccessException; import org.springframework.data.redis.connection.RedisConnection; import org.springframework.data.redis.connection.StringRedisConnection; import org.springframework.data.redis.core.RedisCallback; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.script.RedisScript; import org.springframework.stereotype.Component; import javax.annotation.PostConstruct; import javax.annotation.Resource; import java.util.List; /** * @ClassName: RedisContentCountLuaScriptService * @Description: TODO() * @author lujun * @date 2020年10月16日 上午9:59:58 * */ @Slf4j @Component public class RedisLuaScriptService { @Autowired private StringRedisTemplate redisTemplate; @Resource(name = "contentCountLuaScript") private RedisScript<Long> countLuaScript; @Resource(name = "vendorQpsLuaScript") private RedisScript<Long> qpsLuaScript; @Resource(name = "vendorQpsAndSizeLuaScript") private RedisScript<Long> qpsAndSizeLuaScript; @Resource(name = "getUserLimitLuaScript") private RedisScript<String> getUserLimitLuaScript; @Resource(name = "expireLuaScript") private RedisScript<Long> expireLuaScript; @Resource(name = "getIdLuaScript") private RedisScript<String> getIdLuaScript; /** * 启动时加载 */ @PostConstruct public void loadScript() { redisTemplate.execute(new RedisCallback<String>() { @Override public String doInRedis(RedisConnection connection) throws DataAccessException { StringRedisConnection redisConnection = (StringRedisConnection) connection; return redisConnection.scriptLoad(countLuaScript.getScriptAsString()); } }); } /** * 执行脚本 * @param keys * @param args * @return */ public int executeCountScript(List<String> keys, List<String> args) { try { Long scriptValue = redisTemplate.execute(countLuaScript,keys,args.toArray()); return scriptValue.intValue(); } catch (Exception e) { log.error("execute script error", e); return -1; } } /** * 执行脚本 * @param keys * @param args * @return */ public int executeQpsScript(List<String> keys, List<String> args) { try { Long scriptValue = redisTemplate.execute(qpsLuaScript,keys,args.toArray()); return scriptValue.intValue(); } catch (Exception e) { log.error("execute script error", e); return -1; } } /** * 执行脚本 * @param keys * @param args * @return */ public int executeQpsAndTotalScript(List<String> keys, List<String> args) { try { Long scriptValue = redisTemplate.execute(qpsAndSizeLuaScript,keys,args.toArray()); return scriptValue.intValue(); } catch (Exception e) { log.error("execute script error", e); return -1; } } /** * 执行脚本 * @param keys * @param args * @return */ public int executeExpireScript(List<String> keys, List<String> args) { try { Long scriptValue = redisTemplate.execute(expireLuaScript,keys,args.toArray()); return scriptValue.intValue(); } catch (Exception e) { log.error("execute script error", e); return -1; } } /** * 执行脚本 * @param keys * @param args * @return */ public String executeUserLimitScript(List<String> keys, List<String> args) { try { String scriptValue = redisTemplate.execute(getUserLimitLuaScript,keys,args.toArray()); return scriptValue.toString(); } catch (Exception e) { log.error("execute script error", e); return null; } } /** * 执行脚本 * @param keys * @param args * @return */ public String executeGetIdScript(List<String> keys, List<String> args) { try { String scriptValue = redisTemplate.execute(getIdLuaScript,keys,args.toArray()); return scriptValue.toString(); } catch (Exception e) { log.error("execute script error", e); return null; } } }
[ "156366625@qq.com" ]
156366625@qq.com
8bd5c659379b191d13b79d6df4cf8fc9ab5649f6
0b09ab7a3d911ff0b206629f00bd1d76f6b45023
/Final Project (RESTful Book Library)/book-library/book-library-ui/src/main/java/ru/nsu/g/beryanov/book_library/service/impl/AddressServiceImpl.java
68bd1973201e3dc0a7de3ad364d40aa9cbc78a8f
[]
no_license
beryanow/java-optimization-labs
bf8c59548b7bd157740b25b60d7ade533db87f99
1bf996fd88406613e607687dc008d9f469d82bd2
refs/heads/master
2023-02-02T08:55:17.808471
2020-12-19T08:41:09
2020-12-19T08:41:09
296,683,317
1
0
null
null
null
null
UTF-8
Java
false
false
1,226
java
package ru.nsu.g.beryanov.book_library.service.impl; import com.fasterxml.jackson.databind.ObjectMapper; import lombok.RequiredArgsConstructor; import lombok.SneakyThrows; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import ru.nsu.g.beryanov.book_library.dto.AddressDto; import ru.nsu.g.beryanov.book_library.external.ExternalCall; import ru.nsu.g.beryanov.book_library.service.AddressService; import ru.nsu.g.beryanov.book_library.utility.BookLibraryServiceURL; import java.util.List; @Service @RequiredArgsConstructor public class AddressServiceImpl implements AddressService { @Autowired private ExternalCall externalCall; @Autowired private BookLibraryServiceURL bookLibraryServiceURL; private final ObjectMapper objectMapper = new ObjectMapper(); @Override public List<AddressDto> findAll() { return externalCall.getCall(bookLibraryServiceURL.ADDRESS_FIND_ALL, List.class); } @Override @SneakyThrows public AddressDto save(AddressDto addressDto) { return externalCall.postCall(objectMapper.writeValueAsString(addressDto), bookLibraryServiceURL.ADDRESS_FIND_ALL, AddressDto.class); } }
[ "berjnov.ru@mail.ru" ]
berjnov.ru@mail.ru
fba856310bbcf50127d02fca6458925a7c2b2dde
3715fe8a2286945f26f9b7715a1fa30bd157af32
/src/cn/com/mybatis/mapper/CustmerMapper.java
ba0a604f38bf1c3bf4c499b2639672a73f568e85
[]
no_license
HuLianggo/MyBatisFirstDemo
6d9e4ac1d4006a0d3cffe4b69887ee658d8e0780
5bafaa19ab5e572d1a5147fe4b1f91a1f6ea8a84
refs/heads/master
2020-08-08T08:04:38.605332
2019-10-10T15:38:01
2019-10-10T15:38:01
213,787,457
0
0
null
null
null
null
UTF-8
Java
false
false
180
java
package cn.com.mybatis.mapper; import cn.com.mybatis.po.Customer; public interface CustmerMapper { public Customer findCustmerById(Customer customer)throws Exception; }
[ "hulianghu@hotmail.com" ]
hulianghu@hotmail.com
1f833c22c2766d60acfc069fa38cd6e4dfdfa019
27fdae420fbc95de798f9bc15f04ce7202b567ae
/FragmentExample/tv/src/main/java/com/test/fragment/PlaybackActivity.java
783e4eb06a7e7dbc19cef2a975c5859eea00f526
[]
no_license
pavankumardss/fragmentSample
f3a1a6e83456bb530d40770f8f91af8989559833
dc4734ef4cff73bf9a9803244db5e714bd67811d
refs/heads/master
2020-03-27T08:27:20.041591
2018-08-27T06:37:41
2018-08-27T06:37:41
146,256,181
0
0
null
null
null
null
UTF-8
Java
false
false
1,181
java
/* * Copyright (C) 2014 The Android 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 com.test.fragment; import android.os.Bundle; import android.support.v4.app.FragmentActivity; /** * Loads {@link PlaybackVideoFragment}. */ public class PlaybackActivity extends FragmentActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (savedInstanceState == null) { getSupportFragmentManager() .beginTransaction() .replace(android.R.id.content, new PlaybackVideoFragment()) .commit(); } } }
[ "pavan.ds@laalsa.com" ]
pavan.ds@laalsa.com
ee463f84e30a8af31f43d82a7c9094ced16b1103
debd33235bebad43d74e4f265fdad069a7a23a85
/src/main/java/com/nedap/university/eline/exchanger/executor/AbstractSender.java
376b734174dc400248cffc2ab3f48d8cc0f757b8
[]
no_license
ElineVerbon/TheExchanger
b51a392ba57a070a60b92d540322d878c538bcff
8abbd1139463d240f21353b4e22ab9de7b27edeb
refs/heads/master
2021-05-20T16:57:40.607435
2020-04-16T19:08:18
2020-04-16T19:08:18
252,374,989
0
0
null
null
null
null
UTF-8
Java
false
false
488
java
package com.nedap.university.eline.exchanger.executor; import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; public abstract class AbstractSender { private DatagramSocket socket; public AbstractSender(DatagramSocket socket) { this.socket = socket; } public void sendPacket(final DatagramPacket packet) { try { socket.send(packet); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
[ "eline.verbon@nedap.com" ]
eline.verbon@nedap.com
998018a2106dbfc8629bf08b23d79ca51fd3b4c3
100a3e8d7ca15ed7f1d47106222ca7d65eeaa61c
/CrudApplication/src/test/java/com/jpa/demo/CrudApplicationTests.java
dfbc94c72d0b6e841d4bcd706de7143f5a919fdb
[]
no_license
DharmisettyRajesh/SpringBoot-Projects
a7fea3f730c12febe9db3119d51ccf9e2c17cf26
299e9f7addaa47a2f86b8e195a56026a63b2c151
refs/heads/master
2023-07-25T11:44:41.804736
2021-09-04T00:32:29
2021-09-04T00:32:29
402,806,957
1
0
null
null
null
null
UTF-8
Java
false
false
202
java
package com.jpa.demo; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class CrudApplicationTests { @Test void contextLoads() { } }
[ "mailsaisarathsetty@gmail.com" ]
mailsaisarathsetty@gmail.com
59c0f197996ef6e0e2b51987ecefe19d94c6f375
8fd52101eed1d67f110bdbb1221bb90b859d5588
/app/src/main/java/com/android/example/gawala/Consumer/Adapters/AcquiredGoodsAdapter.java
a9c73439035da2ca4b32da218ad50487c6986a54
[]
no_license
ashirmehmood1996/Gawala
b014b80f85921dae04db7d13ea07f088f13edfe1
a5d198bb63c94d3b05b20bc66df3208f27c898dd
refs/heads/master
2020-06-11T04:04:59.747841
2020-02-11T10:19:48
2020-02-11T10:19:48
193,845,303
0
0
null
null
null
null
UTF-8
Java
false
false
3,528
java
package com.android.example.gawala.Consumer.Adapters; import android.app.Activity; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; import com.android.example.gawala.Generel.Models.AcquiredGoodModel; import com.android.example.gawala.R; import com.bumptech.glide.Glide; import java.util.ArrayList; public class AcquiredGoodsAdapter extends RecyclerView.Adapter<AcquiredGoodsAdapter.AquiredgoodsHolder> { private ArrayList<AcquiredGoodModel> aquiredGoodsArrayList; private Context context; private Callback callback; public AcquiredGoodsAdapter(ArrayList<AcquiredGoodModel> aquiredGoodsArrayList, Activity activity) { this.aquiredGoodsArrayList = aquiredGoodsArrayList; this.context = activity; this.callback = (Callback) activity; } @NonNull @Override public AquiredgoodsHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { return new AquiredgoodsHolder(LayoutInflater.from(context).inflate(R.layout.li_acquired_goods, parent, false)); } @Override public void onBindViewHolder(@NonNull AquiredgoodsHolder holder, int position) { AcquiredGoodModel acquiredGoodModel = aquiredGoodsArrayList.get(position); holder.nameTextvew.setText(acquiredGoodModel.getGoodModel().getName()); // holder.typeTextView.setText(acquiredGoodModel.getGoodModel().getType()); holder.priceTextView.setText(String.format("%s PKR", acquiredGoodModel.getGoodModel().getPrice())); holder.descTextView.setText(acquiredGoodModel.getGoodModel().getDescription()); if (acquiredGoodModel.getGoodModel().getImage_uri() != null && !acquiredGoodModel.getGoodModel().getImage_uri().isEmpty()) { Glide.with(context).load(acquiredGoodModel.getGoodModel().getImage_uri()).into(holder.imageView); } else { holder.imageView.setImageResource(R.drawable.ic_broken_image_black_24dp); } // holder.producerNameTextView.setText("prdocer"); later } @Override public int getItemCount() { return aquiredGoodsArrayList.size(); } class AquiredgoodsHolder extends RecyclerView.ViewHolder { LinearLayout containerLayout; TextView nameTextvew, priceTextView, /*typeTextView, producerNameTextView,*/ descTextView; ImageView imageView; public AquiredgoodsHolder(@NonNull View itemView) { super(itemView); containerLayout = itemView.findViewById(R.id.ll_li_acquired_goods_container); nameTextvew = itemView.findViewById(R.id.tv_li_acquired_goods_name); priceTextView = itemView.findViewById(R.id.tv_li_acquired_goods_price); descTextView = itemView.findViewById(R.id.tv_li_acquired_goods_desc); // typeTextView = itemView.findViewById(R.id.tv_li_acquired_goods_type); // producerNameTextView = itemView.findViewById(R.id.tv_li_acquired_goods_producer_name); imageView = itemView.findViewById(R.id.iv_li_acquired_goods_picture); containerLayout.setOnClickListener(v -> callback.onAcquiredGoodClicked(getAdapterPosition())); } } public interface Callback { void onAcquiredGoodClicked(int pos); } }
[ "ashirmehmood1996@gmail.com" ]
ashirmehmood1996@gmail.com
88d16a6802abe37f15b00d67640cea4fa12e71c6
d33d87e133d8d2581f938286e7786c82619e5129
/garakuta/src/main/java/security/Length.java
e911d0bd3c12dfd14404940c8b959a3230a33bce
[ "MIT" ]
permissive
ARK2022020/sandbox
de6fbea3f3ab5d94783c66bed974e40f584aeb47
6d952b3e3942cbe8aec1d2053b61dee313ea17ad
refs/heads/master
2023-04-06T06:03:46.568913
2021-04-14T21:56:02
2021-04-14T21:56:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,512
java
package security; import java.math.BigInteger; public class Length { enum Status { INT, LONG, BIGINT } private static final int INT_MAX = Integer.MAX_VALUE - 8; private static final long LONG_MAX = Long.MAX_VALUE - 8L; int iValue; long lValue; BigInteger biValue; Status status = Status.INT; private final int size; public Length(final int size) { this.size = size; } public void increment() { switch (status) { case INT: { if (iValue > INT_MAX) { lValue = iValue; status = Status.LONG; increment(); return; } iValue += 8; return; } case LONG: { if (lValue > LONG_MAX) { biValue = BigInteger.valueOf(lValue); status = Status.BIGINT; increment(); return; } lValue += 8L; return; } case BIGINT: { biValue = biValue.add(BigInteger.valueOf(8)); return; } } throw new IllegalStateException(); } private byte getByte(final int index) { switch (status) { case INT: { if (index < 4) { return (byte) (iValue >> (8 * index)); } return 0; } case LONG: { if (index < 8) { return (byte) (lValue >> (8L * index)); } return 0; } case BIGINT: { return biValue.shiftRight(8 * index).byteValue(); } } throw new IllegalStateException(); } public void writeTo(final byte[] out, final int index) { for (int i = 0; i < size; i++) { out[index + i] = getByte(size - 1 - i); } } }
[ "backpaper0@gmail.com" ]
backpaper0@gmail.com
135bec82072c52ee3b8069a341a2501979fcadbc
0bf61ea236b6535324b73ae5885a0d301334a263
/data-provider-simulator/provider-service/src/main/java/com/finaxys/finaxysplatform/dataprovidersimulator/service/impl/IndexServiceImpl.java
1f2097a479670082b22351492046020b8d65721f
[]
no_license
jhonygo/finaxys-platform
e060dcaaaa1736be3cbf3dbb8eacee390e404b57
14df271a48e9377ca916a22d48a564349368f51a
refs/heads/master
2021-01-16T22:01:22.299792
2014-08-20T15:51:29
2014-08-20T15:51:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
589
java
/* * */ package com.finaxys.finaxysplatform.dataprovidersimulator.service.impl; import org.springframework.beans.factory.annotation.Autowired; import com.finaxys.finaxysplatform.core.domain.Index; import com.finaxys.finaxysplatform.dataprovidersimulator.dao.IndexDao; import com.finaxys.finaxysplatform.dataprovidersimulator.service.IndexService; // TODO: Auto-generated Javadoc /** * The Class IndexInfoServiceImpl. */ public class IndexServiceImpl implements IndexService{ @Autowired private IndexDao dao; @Override public void add(Index index) { dao.add(index); } }
[ "=" ]
=
5934c9867091f75a764ccfe955d0dbd814d16257
666e5c08d81c1643db711720bf83b6b81d41310d
/app/src/main/java/com/fatihb/instaclon/Upload.java
0be4f2863def3267e66d540ff119b3855ad5ed0e
[]
no_license
fathbas/InstaClon
d7c2b705653e40206e7b2d427026813e8a7929e4
88a0c6a61f0031dc485ce1728487be4d053944b9
refs/heads/master
2022-11-04T21:09:17.997082
2020-07-17T11:39:51
2020-07-17T11:39:51
280,409,064
0
0
null
null
null
null
UTF-8
Java
false
false
7,008
java
package com.fatihb.instaclon; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; import android.Manifest; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.ImageDecoder; import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.provider.MediaStore; import android.view.View; import android.widget.EditText; import android.widget.ImageView; import android.widget.Toast; import com.google.android.gms.tasks.OnFailureListener; import com.google.android.gms.tasks.OnSuccessListener; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.auth.FirebaseUser; import com.google.firebase.firestore.DocumentReference; import com.google.firebase.firestore.FieldValue; import com.google.firebase.firestore.FirebaseFirestore; import com.google.firebase.storage.FirebaseStorage; import com.google.firebase.storage.StorageReference; import com.google.firebase.storage.UploadTask; import java.io.IOException; import java.lang.reflect.Field; import java.util.HashMap; import java.util.UUID; public class Upload extends AppCompatActivity { Bitmap selectedImage; ImageView imageView; EditText commentTxt; private FirebaseStorage firebaseStorage; private StorageReference storageReference; Uri imageData; private FirebaseFirestore firestore; private FirebaseAuth firebaseAuth; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_upload); imageView = findViewById(R.id.im); commentTxt = findViewById(R.id.comment); firebaseStorage = FirebaseStorage.getInstance(); storageReference = firebaseStorage.getReference(); firestore = FirebaseFirestore.getInstance(); firebaseAuth = FirebaseAuth.getInstance(); } public void upload(View view){ if (imageData!=null){ //unıversal unıque ıd UUID uuid = UUID.randomUUID(); final String imageFolderName = "images/"+uuid+".jpg"; storageReference.child(imageFolderName).putFile(imageData).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() { @Override public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) { StorageReference newReference = FirebaseStorage.getInstance().getReference(imageFolderName); newReference.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() { @Override public void onSuccess(Uri uri) { String dowUrl = uri.toString(); FirebaseUser firebaseUser = firebaseAuth.getCurrentUser(); String userEmail = firebaseUser.getEmail().toString(); String com = commentTxt.getText().toString(); HashMap<String,Object> hashMap = new HashMap<>(); hashMap.put("email",userEmail); hashMap.put("comment",com); hashMap.put("dowUrl",dowUrl); hashMap.put("date", FieldValue.serverTimestamp()); firestore.collection("Posts").add(hashMap).addOnFailureListener(new OnFailureListener() { @Override public void onFailure(@NonNull Exception e) { Toast.makeText(Upload.this,e.getLocalizedMessage().toString(),Toast.LENGTH_LONG).show(); } }).addOnSuccessListener(new OnSuccessListener<DocumentReference>() { @Override public void onSuccess(DocumentReference documentReference) { Intent intent = new Intent(Upload.this,FeedActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(intent); } }); } }); } }).addOnFailureListener(new OnFailureListener() { @Override public void onFailure(@NonNull Exception e) { Toast.makeText(Upload.this,e.getLocalizedMessage().toString(),Toast.LENGTH_LONG).show(); } }); }else { Toast.makeText(Upload.this,"Invalid or empty data",Toast.LENGTH_LONG).show(); } } public void selectImage(View view){ if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED){ ActivityCompat.requestPermissions(this,new String[] {Manifest.permission.READ_EXTERNAL_STORAGE},1); }else{ Intent intentToGalery = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI); startActivityForResult(intentToGalery,2); } } @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { if (requestCode == 1){ if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED){ Intent intentToGalery = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI); startActivityForResult(intentToGalery,2); } } super.onRequestPermissionsResult(requestCode, permissions, grantResults); } @Override protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { if (requestCode==2){ if (resultCode == RESULT_OK && data != null){ imageData = data.getData(); try { if (Build.VERSION.SDK_INT >= 28){ ImageDecoder.Source source = ImageDecoder.createSource(this.getContentResolver(),imageData); selectedImage = ImageDecoder.decodeBitmap(source); imageView.setImageBitmap(selectedImage); }else{ selectedImage = MediaStore.Images.Media.getBitmap(this.getContentResolver(),imageData); imageView.setImageBitmap(selectedImage); } } catch (IOException e) { e.printStackTrace(); } } } super.onActivityResult(requestCode, resultCode, data); } }
[ "32433330+fathbas@users.noreply.github.com" ]
32433330+fathbas@users.noreply.github.com
f31ca5e86f53552e2a026418d0443e911a54ca73
0961646084fef63e22e13a37cd52002e176c1323
/counter/app/src/main/java/com/s4hpi/forestry/counter/service/ListeningServiceFragment.java
084af5ca0509fa6756b13a2ab83630e56a09b827
[]
no_license
picapau4445/forestry
ec0e51a712caf3ce391e557b6dcf7716dcd1b00f
87d404d7dab232431753cf89a405a094cab2a3af
refs/heads/master
2022-06-18T22:19:12.239053
2020-05-09T22:53:58
2020-05-09T22:53:58
105,387,526
0
0
null
null
null
null
UTF-8
Java
false
false
3,021
java
package com.s4hpi.forestry.counter.service; import android.content.Context; import android.graphics.Color; import android.graphics.PorterDuff; import android.os.Handler; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; import com.s4hpi.forestry.counter.R; public class ListeningServiceFragment extends Fragment { public View view; private TextView textResult; private TextView textRecord; private ImageView imageAudio; private ListeningService listeningService; Handler guiThreadHandler; SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss", Locale.JAPANESE); public ListeningServiceFragment() { guiThreadHandler = new Handler(); } /* * 画面呼び出し */ public View loadView(Context context, ListeningService service) { LayoutInflater inflater = LayoutInflater.from(context); view = inflater.inflate(R.layout.fragment_listening, null); textResult = (TextView)view.findViewById((R.id.textResult)); textRecord = (TextView)view.findViewById((R.id.textRecord)); imageAudio = (ImageView)view.findViewById(R.id.imageAudio); Button buttonStop = (Button)view.findViewById(R.id.button_stop); buttonStop.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // 音声入力を停止し、サービスを終了する listeningService.stopListening(); listeningService.stopForeground(true); listeningService.openActivityWindow(); } }); listeningService = service; listeningService.startListening(); return view; } public void setTextResult(String result) { textResult.setText(result); } public void setTextRecord(String result) { // 結果エリアに表示 StringBuilder sbResult = new StringBuilder(); sbResult.insert(0, textRecord.getText().toString()); sbResult.append("\n"); sbResult.append( sdf.format(new Date())); sbResult.append(" "); sbResult.append(result); textRecord.setText(sbResult.toString()); } public void setImageAudio() { imageAudio.setImageResource(android.R.drawable.ic_btn_speak_now); } public void setImageWait() { imageAudio.setImageResource(android.R.drawable.presence_audio_online); imageAudio.setColorFilter(Color.parseColor("#000000"), PorterDuff.Mode.SRC_IN); } public void setImageAudioActive() { imageAudio.setColorFilter(Color.parseColor("#000000"), PorterDuff.Mode.SRC_IN); } public void setImageAudioWait() { imageAudio.setColorFilter(Color.parseColor("#cccccc"), PorterDuff.Mode.SRC_IN); } }
[ "sohashi45@gmail.com" ]
sohashi45@gmail.com
8ce3dee0d5a0fed17102a9fb47b6eb3627f540a2
d486c86b1b63478697f355a6e93eb42e57f28b0a
/5_feladat/src/Main.java
f46ae6ee6e518691f5003464d53b5dfdb9854f9e
[]
no_license
kopancs/Java
46cc2f337332ac57c390c560736ec63f09a6b610
32c8c3c1c38263bcb0ba46ba16436066ae0e919d
refs/heads/master
2020-03-31T02:22:48.768431
2018-10-06T11:24:04
2018-10-06T11:24:04
151,820,797
0
0
null
2018-10-06T11:19:14
2018-10-06T08:41:39
Java
WINDOWS-1250
Java
false
false
360
java
public class Main { public static void main(String[] args) { int szam=12; if (szam%2==0) { System.out.println(szam+" páros"); }else { System.out.println(szam+" páratlan"); } switch (szam%2) { case 0: System.out.println(szam+" páros"); break; case 1: System.out.println(szam+" páratlan"); break; } } }
[ "aniko.kovacs.galamb@gmail.com" ]
aniko.kovacs.galamb@gmail.com
68bf86602fe116c8674ac9102504cdf3e2243705
86d3fc89d7b4164cb3f28a6ac860a52ef985ace3
/Server/src/server/Main.java
8fd8119dbd015e2398543a44c25ccf49fdd772d1
[]
no_license
LeonidIvankin/DropBox
7267f28f858146dc7dacd517b4711d331f4af7d2
e3e638690488c250705554f251f38b46b0e9e288
refs/heads/master
2021-05-11T19:37:02.231101
2018-03-04T19:17:37
2018-03-04T19:17:37
117,885,296
0
0
null
null
null
null
UTF-8
Java
false
false
100
java
package server; public class Main { public static void main(String[] args) { new Server(); } }
[ "lim14@yandex.ru" ]
lim14@yandex.ru
d0678d3b8490c9989662d2469471e65e1b4af19c
ee259222fabc385d429d69856058de63f8601b1f
/LotteryImplicitIntent/src/test/java/com/example/lotteryimplicitintent/ExampleUnitTest.java
f2251d0f2f364d4990d9c38c394bdfea033de744
[]
no_license
mbuchser/fhnw_android_chapter3
caaffcdab803e76d754f5561f8b62fa6b387f7b4
dc69bf049b28c9a09f77199befbd09908eb73135
refs/heads/master
2023-03-24T22:23:22.398908
2021-03-26T12:57:28
2021-03-26T12:57:28
351,495,001
0
0
null
null
null
null
UTF-8
Java
false
false
394
java
package com.example.lotteryimplicitintent; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
[ "marc.buchser@transgourmet.ch" ]
marc.buchser@transgourmet.ch
2ed2d2489b5c73d4c5fd3aca015c754b91f7e497
60dde56a288db420021be82d53231f9d04baa6d9
/core/src/ua/gram/view/AbstractLoadingScreen.java
3c45a02a183d069490b287e1e75e0995563e0a6f
[]
no_license
chenbing8512/DivineDefense
c6aa16621d2fe3394676ab6fc3e2bedceda9fda3
f6a78ac19a02c86c360364a3d604dd85e0c36434
refs/heads/master
2020-12-28T20:19:27.518021
2016-05-01T09:54:35
2016-05-01T09:54:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,497
java
package ua.gram.view; import ua.gram.DDGame; import ua.gram.controller.stage.LoadingStage; import ua.gram.utils.Log; import ua.gram.view.screen.ErrorScreen; import ua.gram.view.screen.MainMenuScreen; /** * LevelScreen handles resource loading invocation. * In 'show' you specify resources to be loaded. * In 'onLoad' you specify program logic that will be executed */ public abstract class AbstractLoadingScreen extends AbstractScreen { protected LoadingStage loadingStage; protected int progress; public AbstractLoadingScreen(DDGame game) { super(game); } @Override public void show() { super.show(); loadingStage = new LoadingStage(game); } @Override public void renderAlways(float delta) { progress = (int) game.getAssetManager().getProgress() * 100; loadingStage.update(progress); loadingStage.act(delta); loadingStage.draw(); if (game.getAssetManager().update()) { try { onLoad(); } catch (Exception e) { game.setScreen(new ErrorScreen(game, "Error at loading", e)); } } } @Override public void renderNoPause(float delta) { } public void onLoad() { loadingStage.update(progress); Log.info("Loading " + progress + "%"); game.setScreen(new MainMenuScreen(game)); } @Override public void hide() { super.hide(); progress = 0; } }
[ "gram7gram@gmail.com" ]
gram7gram@gmail.com
0a939fecdcbb0c8507dcf5cb19da7b26fbfe0f4b
8ef0ece3bae0f1c14b2f8145e5b3791af896ce26
/src/com/pankaj/zoomcars/utils/SquareView.java
ecc01c713b05f26d6132bd767e2a58174d471c81
[]
no_license
pankajk7/ZoomCars
ca0a2ce8c6a2e05f827c5c3b33dec6642fd4b032
f0b47f98a98ebc4c426e9977608abef1a2201110
refs/heads/master
2020-06-06T03:22:34.227961
2015-09-13T15:26:57
2015-09-13T15:26:57
42,351,790
0
0
null
null
null
null
UTF-8
Java
false
false
741
java
package com.pankaj.zoomcars.utils; import android.content.Context; import android.util.AttributeSet; import android.widget.LinearLayout; public class SquareView extends LinearLayout { public SquareView(Context context) { super(context); } public SquareView(Context context, AttributeSet attrs) { super(context, attrs); } public SquareView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); setMeasuredDimension(getMeasuredWidth(), getMeasuredWidth()); //Snap to width } }
[ "pank.kmwt@gmail.com" ]
pank.kmwt@gmail.com
91a2990ae98daf13f7b9a874aff247e6f30df6e4
6efbd3fd9638002d2e234d14654a002ae69083b2
/src/gates/Gates.java
a89e0423090c5ddc8f339cd45197f4fd60e57ceb
[]
no_license
zhuang002/CCC-2015-Gates
5f06ecea42f9f98cf3bca5eadbbde84f56e50663
a0c96cb05a21b89a16a073e0e39cb10c5d570215
refs/heads/master
2020-09-11T05:41:41.867917
2019-11-15T16:02:07
2019-11-15T16:02:07
221,957,353
0
0
null
null
null
null
UTF-8
Java
false
false
998
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package gates; import java.util.Scanner; /** * * @author zhuan */ public class Gates { static Scanner sc=new Scanner(System.in); static int G; static int P; static int[] ar=null; public static void main(String[] args) { // TODO Auto-generated method stub G=sc.nextInt(); ar=new int[G]; for (int i=0;i<G;i++) ar[i]=i; P=sc.nextInt(); for (int i=0;i<P;i++) { int gi=sc.nextInt()-1; int previousGate=getAvailableGate(gi); if (previousGate<0) { System.out.println(i); return; } } System.out.println(P); } private static int getAvailableGate(int gi) { // TODO Auto-generated method stub if (gi<0) return gi; if (ar[gi]==gi) { ar[gi]=gi-1; return gi; } else { int pre=getAvailableGate(ar[gi]); ar[gi]=pre; return pre; } } }
[ "zhuang001@gmail.com" ]
zhuang001@gmail.com
cb97e690a6a4f1012c14c8606590696fe3251b60
a372ba1530d0ec100f0d6dd67a18bbc3b3125279
/src/main/java/com/springboot/mongodb/repo/CategoryRepo.java
833b07fde816a39c7d0d6dc8f918e95331c650d1
[]
no_license
Saurabh167-sleepy/ECommApp
6f147e743ed0c434872c8476879face40f885473
39377af5364d41fbbe86b090cc4c942a89718a53
refs/heads/master
2023-08-15T02:27:07.128472
2021-09-26T19:38:00
2021-09-26T19:38:00
410,643,108
0
0
null
null
null
null
UTF-8
Java
false
false
289
java
package com.springboot.mongodb.repo; import org.springframework.data.mongodb.repository.MongoRepository; import org.springframework.stereotype.Repository; import com.springboot.ecomm.model.Category; @Repository public interface CategoryRepo extends MongoRepository<Category,String>{ }
[ "saurabh.singh@crossasyst.com" ]
saurabh.singh@crossasyst.com
ccb67cbb10b15967a9f7747052edef91c18eb4fe
45f5f2c96b684cbc67c8a1c92b94fbb3ab91edaf
/src/main/java/com/walmart/qa/pages/ShopGrocery.java
88eeaf65c50b755c7b8d3ebf43c5ae559dafcded
[]
no_license
pprathapaneni/Walmart
e9f3b4b082d24b0558a309015dccd4021746cdc4
5d7e2738de9c62297f910fd9f17a2906e0f19165
refs/heads/master
2023-02-23T08:28:35.303107
2021-01-25T23:18:52
2021-01-25T23:18:52
332,910,167
0
0
null
null
null
null
UTF-8
Java
false
false
691
java
package com.walmart.qa.pages; import java.util.List; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; import com.walmart.qa.base.TestBase; public class ShopGrocery extends TestBase{ @FindBy(xpath="//div[contains(@class,'tileGenV2_wrapper tenCol ')]//div/descendant::span[contains(@class,'chevron_white')]") List <WebElement> list; public ShopGrocery() { PageFactory.initElements(driver, this); } public void validateGroceryOptions() { System.out.println("Number of suggestions are " + list.size()); for(int i=0;i<list.size();i++) { System.out.println(list.get(i).getText()); } } }
[ "pprathapaneni@gmail.com" ]
pprathapaneni@gmail.com
d5abbdeedecf8a6f067347cf89cadb0f5bf4b77f
d99527f65ad36868d4b98343b6b1807de68856c4
/8.TestingWithMocks/src/com/clouway/systemsms/MessageValidator.java
fafaf766681004df455e8584c2684cd8fac542c3
[]
no_license
EmilGeorgiev/com.clouway.course.tasks
11df535eb1b592a8afc28365101d678e138531f0
06a5e08e14fc391e82dbf28f3c8976a954ebfed6
refs/heads/master
2021-01-15T17:07:04.606294
2014-08-07T19:26:34
2014-08-07T19:26:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
699
java
package com.clouway.systemsms; /** * Created by clouway on 1/7/14. */ public class MessageValidator implements Validator { private final int textSize; public MessageValidator(int textSize) { this.textSize = textSize; } @Override public void validateMessage(Message message) { if (message.getTitle() == null) { throw new IllegalArgumentException("You need to add a title!"); } if (message.getText().length() > textSize) { throw new IllegalArgumentException("Message must contain less than " + textSize + " characters"); } if (message.getRecipient() == null) { throw new IllegalArgumentException("You need to add an recipient!"); } } }
[ "emogeorgiev88@gmail.com" ]
emogeorgiev88@gmail.com
390a43dea322c851c65e336d4fcf41be82398afd
6d371310b35ead5d1a54ded5fc7f97d9760f67ae
/src/main/java/cpackageee/Class_1706.java
37b43a9de0da462437e5da643ae6fbf26784338b
[]
no_license
vbozh/a_project_test
fd4dbd4baaffcc4ba5d2669e10cac3c32a6dd055
289f263cfdbdee37fd896669f204e49950b38e79
refs/heads/master
2021-02-12T20:27:10.848639
2020-03-04T10:26:40
2020-03-04T10:28:01
244,627,143
0
0
null
null
null
null
UTF-8
Java
false
false
69
java
package cpackageee; public class Class_1706{public void foo1706(){}}
[ "viktoria.bozhko@jetbrains.com" ]
viktoria.bozhko@jetbrains.com
6531856b448b7b1ac362ba063c86dd6f20e4f50f
74de41a3b821c54a5bf65d6c03716a51ef076925
/src/main/java/net/joinedminds/masserr/db/MorphiaProvider.java
56fe6799e4ed560567342fbfa4f8e930c5b3e79c
[ "MIT" ]
permissive
rsandell/masserr2
15b7728eb0e94cd020c85d24061d9ac55084396c
67a569221b529a60391b28713717876df867535b
refs/heads/master
2016-09-15T06:20:24.467122
2014-07-31T12:03:38
2014-07-31T12:03:38
7,318,911
0
1
null
2016-03-09T08:23:05
2012-12-25T16:37:01
Java
UTF-8
Java
false
false
3,059
java
/* * The MIT License * * Copyright (c) 2013-, Robert Sandell-sandell.robert@gmail.com. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package net.joinedminds.masserr.db; import com.github.jmkgreen.morphia.Datastore; import com.github.jmkgreen.morphia.Morphia; import com.google.inject.Inject; import com.google.inject.Provider; import com.google.inject.Singleton; import com.google.inject.name.Named; import com.mongodb.Mongo; import java.net.UnknownHostException; /** * Guice provider for the thread instance of a {@link Morphia}. * * @author sandell.robert@gmail.com */ @Singleton public class MorphiaProvider implements Provider<Datastore> { private final String dbHost; private final String dbName; private final String dbUser; private final String dbPasswd; private Morphia morphia = null; private Mongo mongo; private Datastore datastore; @Inject public MorphiaProvider(@Named("DB_HOST") String dbHost, @Named("DB_NAME") String dbName, @Named("DB_USER") String dbUser, @Named("DB_PASSWD") String dbPasswd) throws UnknownHostException { this.dbHost = dbHost; this.dbName = dbName; this.dbUser = dbUser; this.dbPasswd = dbPasswd; startUp(); } @Override public synchronized Datastore get() { return datastore; } private void startUp() throws UnknownHostException { mongo = new Mongo(dbHost); morphia = new Morphia(); morphia.mapPackage("net.joinedminds.masserr.model", true); if (dbUser != null && !dbUser.isEmpty() && dbPasswd != null && !dbPasswd.isEmpty()) { datastore = morphia.createDatastore(mongo, dbName, dbUser, dbPasswd.toCharArray()); } else { datastore = morphia.createDatastore(mongo, dbName); } datastore.ensureIndexes(); //creates indexes from @Index annotations in your entities datastore.ensureCaps(); //creates capped collections from @Entity } }
[ "sandell.robert@gmail.com" ]
sandell.robert@gmail.com
9a00ef6daf1a18272d6f9e8bf65e9125854acf53
98578b7abdb929615d99593179a04d21226c7ded
/app/src/main/java/com/bignerdranch/android/geoquiz/CheatActivity.java
60fa6554e0eea6b855cf1d397991cc486263f258
[]
no_license
PeterN-T/GeoQuiz
7028963ee38ea5a970d69685fe5e1b377b44244d
8addf7e910c535da3433da27242649be73d4a1c6
refs/heads/master
2020-04-13T09:33:25.263027
2018-12-26T16:10:02
2018-12-26T16:10:02
163,114,657
1
0
null
null
null
null
UTF-8
Java
false
false
3,670
java
package com.bignerdranch.android.geoquiz; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.content.Context; import android.content.Intent; import android.os.Build; import android.support.design.widget.FloatingActionButton; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.view.ViewAnimationUtils; import android.widget.Button; import android.widget.TextView; public class CheatActivity extends AppCompatActivity { private static final String EXTRA_ANSWER_IS_TRUE = "com.bignerdranch.android.geoquiz.answer_is_true"; public static final String EXTRA_ANSWER_SHOWN = "com.bignerdranch.android.geoquiz.answer_shown"; private boolean mAnswerIsTrue; private TextView mAnswerTextView; private Button mShowAnswer; // variable for the user's device api (Challenge) // private TextView deviceApiLevel; public static Intent newIntent(Context packageContext, boolean answerIsTrue) { Intent i = new Intent(packageContext, CheatActivity.class); i.putExtra(EXTRA_ANSWER_IS_TRUE, answerIsTrue); return i; } public static boolean wasAnswerShow(Intent result) { return result.getBooleanExtra(EXTRA_ANSWER_SHOWN, false); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_cheat); mAnswerIsTrue = getIntent().getBooleanExtra(EXTRA_ANSWER_IS_TRUE, false); mAnswerTextView = (TextView) findViewById(R.id.answer_text_view); mShowAnswer = (Button) findViewById(R.id.show_answer_button); mShowAnswer.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (mAnswerIsTrue) { mAnswerTextView.setText(R.string.true_button); } else { mAnswerTextView.setText(R.string.false_button); } setAnswerShownResult(true); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { int cx = mShowAnswer.getWidth() / 2; int cy = mShowAnswer.getHeight() / 2; float radius = mShowAnswer.getWidth(); Animator anim = ViewAnimationUtils .createCircularReveal(mShowAnswer, cx, cy, radius, 0); anim.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { super.onAnimationEnd(animation); mAnswerTextView.setVisibility(View.VISIBLE); mShowAnswer.setVisibility(View.INVISIBLE); } }); anim.start(); } else { mAnswerTextView.setVisibility(View.VISIBLE); mShowAnswer.setVisibility(View.INVISIBLE); } } }); // displaying user's device api level during runtime // int apiLevel = Build.VERSION.SDK_INT; //deviceApiLevel = (TextView) findViewById(R.id.deviceApiLevel); // String apiLevelString = getString(R.string.api_level, apiLevel); // deviceApiLevel.setText(apiLevelString); } private void setAnswerShownResult(boolean isAnswerShown) { Intent data = new Intent(); data.putExtra(EXTRA_ANSWER_SHOWN, isAnswerShown); setResult(RESULT_OK, data); } }
[ "39628067+PeterN-T@users.noreply.github.com" ]
39628067+PeterN-T@users.noreply.github.com
d683e5061150f8de203cc2a4e10af604a6d99824
653da453cb595b3ef7bd30528497c60eb1ea24d6
/app/src/main/java/com/example/parking/MapsActivity.java
c9bd668fa83ba5b21a47948723bff33507b7dead
[]
no_license
angelanajdoska/Parking
064043d1477b9a13d2f472d67646ec6c3d0fe3ab
9647c8089f386a56079336981fb2456b02febc7e
refs/heads/master
2023-02-05T23:19:45.786689
2020-12-28T13:00:02
2020-12-28T13:00:02
321,447,659
0
0
null
2020-12-28T12:18:39
2020-12-14T19:11:40
null
UTF-8
Java
false
false
924
java
package com.example.parking; import androidx.appcompat.app.AppCompatActivity; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentTransaction; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.OnMapReadyCallback; import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.MarkerOptions; public class MapsActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_maps); } }
[ "angela.najdoska17@gmail.com" ]
angela.najdoska17@gmail.com
ccf871926497409e0a58f3a3cf73ca075bf36609
e0c033f3067fa0f17dd7ccadd072db341dd1c901
/pascals-triangle/src/test/java/PascalsTriangleGeneratorTest.java
1bd94a47fd72ec5bf560f6fc25f41a3d511caa92
[]
no_license
krnets/exercism-java
a45e9bd111563c33afdd034d73375644429bf1fc
a00e09912dce9a63719839885006cc2d6306b774
refs/heads/master
2023-01-13T04:08:41.804704
2020-11-17T23:19:34
2020-11-17T23:19:34
299,140,253
0
0
null
null
null
null
UTF-8
Java
false
false
2,798
java
import org.junit.Test; import static org.junit.Assert.assertArrayEquals; public class PascalsTriangleGeneratorTest { private PascalsTriangleGenerator pascalsTriangleGenerator = new PascalsTriangleGenerator(); @Test public void testTriangleWithZeroRows() { int[][] expectedOutput = new int[][]{}; assertArrayEquals(expectedOutput, pascalsTriangleGenerator.generateTriangle(0)); } @Test public void testTriangleWithOneRow() { int[][] expectedOutput = new int[][]{ {1} }; assertArrayEquals(expectedOutput, pascalsTriangleGenerator.generateTriangle(1)); } @Test public void testTriangleWithTwoRows() { int[][] expectedOutput = new int[][]{ {1}, {1, 1} }; assertArrayEquals(expectedOutput, pascalsTriangleGenerator.generateTriangle(2)); } @Test public void testTriangleWithThreeRows() { int[][] expectedOutput = new int[][]{ {1}, {1, 1}, {1, 2, 1} }; assertArrayEquals(expectedOutput, pascalsTriangleGenerator.generateTriangle(3)); } @Test public void testTriangleWithFourRows() { int[][] expectedOutput = new int[][]{ {1}, {1, 1}, {1, 2, 1}, {1, 3, 3, 1} }; assertArrayEquals(expectedOutput, pascalsTriangleGenerator.generateTriangle(4)); } @Test public void testTriangleWithFiveRows() { int[][] expectedOutput = new int[][]{ {1}, {1, 1}, {1, 2, 1}, {1, 3, 3, 1}, {1, 4, 6, 4, 1} }; assertArrayEquals(expectedOutput, pascalsTriangleGenerator.generateTriangle(5)); } @Test public void testTriangleWithSixRows() { int[][] expectedOutput = new int[][]{ {1}, {1, 1}, {1, 2, 1}, {1, 3, 3, 1}, {1, 4, 6, 4, 1}, {1, 5, 10, 10, 5, 1} }; assertArrayEquals(expectedOutput, pascalsTriangleGenerator.generateTriangle(6)); } @Test public void testTriangleWithTenRows() { int[][] expectedOutput = new int[][]{ {1}, {1, 1}, {1, 2, 1}, {1, 3, 3, 1}, {1, 4, 6, 4, 1}, {1, 5, 10, 10, 5, 1}, {1, 6, 15, 20, 15, 6, 1}, {1, 7, 21, 35, 35, 21, 7, 1}, {1, 8, 28, 56, 70, 56, 28, 8, 1}, {1, 9, 36, 84, 126, 126, 84, 36, 9, 1} }; assertArrayEquals(expectedOutput, pascalsTriangleGenerator.generateTriangle(10)); } }
[ "cmantheo@gmail.com" ]
cmantheo@gmail.com
ca0a49ca1692897447785bdd8668a9a9df7d459b
cf7b3a248403aa0e00202a6299b6c3daaf01e176
/src/vista/contenedores/VtnPrincipal.java
9f8a9c2798daed4a2703942af7e61642318c8b7d
[]
no_license
taguz91/PF-Restaurante-M3A
436a8b7392046228a4b3e318f33734e74866af56
0b1018045310a5263c686155d120ce1d42f19d19
refs/heads/master
2022-01-07T09:16:05.159957
2019-05-16T00:28:33
2019-05-16T00:28:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,956
java
package vista.contenedores; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextField; import modelo.estilo.BtnCambioLetra; /** * * @author Johnny */ public class VtnPrincipal extends javax.swing.JFrame { /** * Creates new form VtnPrincipal */ public VtnPrincipal() { initComponents(); btnSalir.addMouseListener(new BtnCambioLetra(btnSalir)); } public JButton getBtnSalir() { return btnSalir; } public JLabel getLblNombre() { return lblNombre; } public JPanel getPnlNavegacion() { return pnlNavegacion; } public JPanel getPnlPrincipal() { return pnlPrincipal; } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { pnlNavegacion = new javax.swing.JPanel(); pnlPrincipal = new javax.swing.JPanel(); pnlInformacion = new javax.swing.JPanel(); btnSalir = new javax.swing.JButton(); lblNombre = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setMinimumSize(new java.awt.Dimension(800, 502)); setPreferredSize(new java.awt.Dimension(800, 500)); pnlNavegacion.setBackground(new java.awt.Color(102, 103, 101)); pnlNavegacion.setLayout(new java.awt.CardLayout()); pnlPrincipal.setBackground(new java.awt.Color(255, 255, 255)); pnlPrincipal.setLayout(new java.awt.CardLayout()); pnlInformacion.setBackground(new java.awt.Color(67, 67, 67)); btnSalir.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N btnSalir.setForeground(new java.awt.Color(204, 204, 204)); btnSalir.setText("Salir"); btnSalir.setBorder(null); btnSalir.setContentAreaFilled(false); btnSalir.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); btnSalir.setFocusPainted(false); lblNombre.setBackground(new java.awt.Color(255, 255, 255)); lblNombre.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N lblNombre.setForeground(new java.awt.Color(255, 255, 255)); lblNombre.setText("Nombre usuario"); javax.swing.GroupLayout pnlInformacionLayout = new javax.swing.GroupLayout(pnlInformacion); pnlInformacion.setLayout(pnlInformacionLayout); pnlInformacionLayout.setHorizontalGroup( pnlInformacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlInformacionLayout.createSequentialGroup() .addContainerGap() .addComponent(lblNombre, javax.swing.GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnSalir, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); pnlInformacionLayout.setVerticalGroup( pnlInformacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlInformacionLayout.createSequentialGroup() .addContainerGap(12, Short.MAX_VALUE) .addGroup(pnlInformacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(lblNombre) .addComponent(btnSalir, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(pnlNavegacion, javax.swing.GroupLayout.DEFAULT_SIZE, 596, Short.MAX_VALUE) .addGap(0, 0, 0) .addComponent(pnlInformacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(pnlPrincipal, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(pnlInformacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(pnlNavegacion, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(0, 0, 0) .addComponent(pnlPrincipal, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(0, 0, 0)) ); pack(); setLocationRelativeTo(null); }// </editor-fold>//GEN-END:initComponents // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btnSalir; private javax.swing.JLabel lblNombre; private javax.swing.JPanel pnlInformacion; private javax.swing.JPanel pnlNavegacion; private javax.swing.JPanel pnlPrincipal; // End of variables declaration//GEN-END:variables }
[ "johnnygar98@hotmail.com" ]
johnnygar98@hotmail.com
b18a302b518ed63ade995ce57e55fbca12dbebe8
844a12ba2a66ea39283a1842fa0919b56593562c
/java-analytics-data/proto-google-analytics-data-v1beta/src/main/java/com/google/analytics/data/v1beta/PivotHeader.java
6391c40bb805d8cd770df230d28984ca775c0f25
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
meltsufin/google-cloud-java
f941375e56657a2e20cda5351079e2d3d1d6aeb5
3869c18477cb8cd4e4c1560db90936b578845089
refs/heads/main
2022-05-04T11:43:50.284969
2022-05-03T20:44:17
2022-05-03T20:44:17
71,588,669
0
0
null
null
null
null
UTF-8
Java
false
false
37,278
java
/* * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://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. */ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/analytics/data/v1beta/data.proto package com.google.analytics.data.v1beta; /** * * * <pre> * Dimensions' values in a single pivot. * </pre> * * Protobuf type {@code google.analytics.data.v1beta.PivotHeader} */ public final class PivotHeader extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.analytics.data.v1beta.PivotHeader) PivotHeaderOrBuilder { private static final long serialVersionUID = 0L; // Use PivotHeader.newBuilder() to construct. private PivotHeader(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private PivotHeader() { pivotDimensionHeaders_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new PivotHeader(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private PivotHeader( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 10: { if (!((mutable_bitField0_ & 0x00000001) != 0)) { pivotDimensionHeaders_ = new java.util.ArrayList< com.google.analytics.data.v1beta.PivotDimensionHeader>(); mutable_bitField0_ |= 0x00000001; } pivotDimensionHeaders_.add( input.readMessage( com.google.analytics.data.v1beta.PivotDimensionHeader.parser(), extensionRegistry)); break; } case 16: { rowCount_ = input.readInt32(); break; } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) != 0)) { pivotDimensionHeaders_ = java.util.Collections.unmodifiableList(pivotDimensionHeaders_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.analytics.data.v1beta.ReportingApiProto .internal_static_google_analytics_data_v1beta_PivotHeader_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.analytics.data.v1beta.ReportingApiProto .internal_static_google_analytics_data_v1beta_PivotHeader_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.analytics.data.v1beta.PivotHeader.class, com.google.analytics.data.v1beta.PivotHeader.Builder.class); } public static final int PIVOT_DIMENSION_HEADERS_FIELD_NUMBER = 1; private java.util.List<com.google.analytics.data.v1beta.PivotDimensionHeader> pivotDimensionHeaders_; /** * * * <pre> * The size is the same as the cardinality of the corresponding dimension * combinations. * </pre> * * <code>repeated .google.analytics.data.v1beta.PivotDimensionHeader pivot_dimension_headers = 1; * </code> */ @java.lang.Override public java.util.List<com.google.analytics.data.v1beta.PivotDimensionHeader> getPivotDimensionHeadersList() { return pivotDimensionHeaders_; } /** * * * <pre> * The size is the same as the cardinality of the corresponding dimension * combinations. * </pre> * * <code>repeated .google.analytics.data.v1beta.PivotDimensionHeader pivot_dimension_headers = 1; * </code> */ @java.lang.Override public java.util.List<? extends com.google.analytics.data.v1beta.PivotDimensionHeaderOrBuilder> getPivotDimensionHeadersOrBuilderList() { return pivotDimensionHeaders_; } /** * * * <pre> * The size is the same as the cardinality of the corresponding dimension * combinations. * </pre> * * <code>repeated .google.analytics.data.v1beta.PivotDimensionHeader pivot_dimension_headers = 1; * </code> */ @java.lang.Override public int getPivotDimensionHeadersCount() { return pivotDimensionHeaders_.size(); } /** * * * <pre> * The size is the same as the cardinality of the corresponding dimension * combinations. * </pre> * * <code>repeated .google.analytics.data.v1beta.PivotDimensionHeader pivot_dimension_headers = 1; * </code> */ @java.lang.Override public com.google.analytics.data.v1beta.PivotDimensionHeader getPivotDimensionHeaders(int index) { return pivotDimensionHeaders_.get(index); } /** * * * <pre> * The size is the same as the cardinality of the corresponding dimension * combinations. * </pre> * * <code>repeated .google.analytics.data.v1beta.PivotDimensionHeader pivot_dimension_headers = 1; * </code> */ @java.lang.Override public com.google.analytics.data.v1beta.PivotDimensionHeaderOrBuilder getPivotDimensionHeadersOrBuilder(int index) { return pivotDimensionHeaders_.get(index); } public static final int ROW_COUNT_FIELD_NUMBER = 2; private int rowCount_; /** * * * <pre> * The cardinality of the pivot. The total number of rows for this pivot's * fields regardless of how the parameters `offset` and `limit` are specified * in the request. * </pre> * * <code>int32 row_count = 2;</code> * * @return The rowCount. */ @java.lang.Override public int getRowCount() { return rowCount_; } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { for (int i = 0; i < pivotDimensionHeaders_.size(); i++) { output.writeMessage(1, pivotDimensionHeaders_.get(i)); } if (rowCount_ != 0) { output.writeInt32(2, rowCount_); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; for (int i = 0; i < pivotDimensionHeaders_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize( 1, pivotDimensionHeaders_.get(i)); } if (rowCount_ != 0) { size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, rowCount_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.analytics.data.v1beta.PivotHeader)) { return super.equals(obj); } com.google.analytics.data.v1beta.PivotHeader other = (com.google.analytics.data.v1beta.PivotHeader) obj; if (!getPivotDimensionHeadersList().equals(other.getPivotDimensionHeadersList())) return false; if (getRowCount() != other.getRowCount()) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (getPivotDimensionHeadersCount() > 0) { hash = (37 * hash) + PIVOT_DIMENSION_HEADERS_FIELD_NUMBER; hash = (53 * hash) + getPivotDimensionHeadersList().hashCode(); } hash = (37 * hash) + ROW_COUNT_FIELD_NUMBER; hash = (53 * hash) + getRowCount(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.google.analytics.data.v1beta.PivotHeader parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.analytics.data.v1beta.PivotHeader parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.analytics.data.v1beta.PivotHeader parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.analytics.data.v1beta.PivotHeader parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.analytics.data.v1beta.PivotHeader parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.analytics.data.v1beta.PivotHeader parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.analytics.data.v1beta.PivotHeader parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.analytics.data.v1beta.PivotHeader parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.analytics.data.v1beta.PivotHeader parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static com.google.analytics.data.v1beta.PivotHeader parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.analytics.data.v1beta.PivotHeader parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.analytics.data.v1beta.PivotHeader parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException( PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.google.analytics.data.v1beta.PivotHeader prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * * * <pre> * Dimensions' values in a single pivot. * </pre> * * Protobuf type {@code google.analytics.data.v1beta.PivotHeader} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:google.analytics.data.v1beta.PivotHeader) com.google.analytics.data.v1beta.PivotHeaderOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.analytics.data.v1beta.ReportingApiProto .internal_static_google_analytics_data_v1beta_PivotHeader_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.analytics.data.v1beta.ReportingApiProto .internal_static_google_analytics_data_v1beta_PivotHeader_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.analytics.data.v1beta.PivotHeader.class, com.google.analytics.data.v1beta.PivotHeader.Builder.class); } // Construct using com.google.analytics.data.v1beta.PivotHeader.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { getPivotDimensionHeadersFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); if (pivotDimensionHeadersBuilder_ == null) { pivotDimensionHeaders_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); } else { pivotDimensionHeadersBuilder_.clear(); } rowCount_ = 0; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.analytics.data.v1beta.ReportingApiProto .internal_static_google_analytics_data_v1beta_PivotHeader_descriptor; } @java.lang.Override public com.google.analytics.data.v1beta.PivotHeader getDefaultInstanceForType() { return com.google.analytics.data.v1beta.PivotHeader.getDefaultInstance(); } @java.lang.Override public com.google.analytics.data.v1beta.PivotHeader build() { com.google.analytics.data.v1beta.PivotHeader result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.analytics.data.v1beta.PivotHeader buildPartial() { com.google.analytics.data.v1beta.PivotHeader result = new com.google.analytics.data.v1beta.PivotHeader(this); int from_bitField0_ = bitField0_; if (pivotDimensionHeadersBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { pivotDimensionHeaders_ = java.util.Collections.unmodifiableList(pivotDimensionHeaders_); bitField0_ = (bitField0_ & ~0x00000001); } result.pivotDimensionHeaders_ = pivotDimensionHeaders_; } else { result.pivotDimensionHeaders_ = pivotDimensionHeadersBuilder_.build(); } result.rowCount_ = rowCount_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.google.analytics.data.v1beta.PivotHeader) { return mergeFrom((com.google.analytics.data.v1beta.PivotHeader) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.google.analytics.data.v1beta.PivotHeader other) { if (other == com.google.analytics.data.v1beta.PivotHeader.getDefaultInstance()) return this; if (pivotDimensionHeadersBuilder_ == null) { if (!other.pivotDimensionHeaders_.isEmpty()) { if (pivotDimensionHeaders_.isEmpty()) { pivotDimensionHeaders_ = other.pivotDimensionHeaders_; bitField0_ = (bitField0_ & ~0x00000001); } else { ensurePivotDimensionHeadersIsMutable(); pivotDimensionHeaders_.addAll(other.pivotDimensionHeaders_); } onChanged(); } } else { if (!other.pivotDimensionHeaders_.isEmpty()) { if (pivotDimensionHeadersBuilder_.isEmpty()) { pivotDimensionHeadersBuilder_.dispose(); pivotDimensionHeadersBuilder_ = null; pivotDimensionHeaders_ = other.pivotDimensionHeaders_; bitField0_ = (bitField0_ & ~0x00000001); pivotDimensionHeadersBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getPivotDimensionHeadersFieldBuilder() : null; } else { pivotDimensionHeadersBuilder_.addAllMessages(other.pivotDimensionHeaders_); } } } if (other.getRowCount() != 0) { setRowCount(other.getRowCount()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.analytics.data.v1beta.PivotHeader parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.analytics.data.v1beta.PivotHeader) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_; private java.util.List<com.google.analytics.data.v1beta.PivotDimensionHeader> pivotDimensionHeaders_ = java.util.Collections.emptyList(); private void ensurePivotDimensionHeadersIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { pivotDimensionHeaders_ = new java.util.ArrayList<com.google.analytics.data.v1beta.PivotDimensionHeader>( pivotDimensionHeaders_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.analytics.data.v1beta.PivotDimensionHeader, com.google.analytics.data.v1beta.PivotDimensionHeader.Builder, com.google.analytics.data.v1beta.PivotDimensionHeaderOrBuilder> pivotDimensionHeadersBuilder_; /** * * * <pre> * The size is the same as the cardinality of the corresponding dimension * combinations. * </pre> * * <code> * repeated .google.analytics.data.v1beta.PivotDimensionHeader pivot_dimension_headers = 1; * </code> */ public java.util.List<com.google.analytics.data.v1beta.PivotDimensionHeader> getPivotDimensionHeadersList() { if (pivotDimensionHeadersBuilder_ == null) { return java.util.Collections.unmodifiableList(pivotDimensionHeaders_); } else { return pivotDimensionHeadersBuilder_.getMessageList(); } } /** * * * <pre> * The size is the same as the cardinality of the corresponding dimension * combinations. * </pre> * * <code> * repeated .google.analytics.data.v1beta.PivotDimensionHeader pivot_dimension_headers = 1; * </code> */ public int getPivotDimensionHeadersCount() { if (pivotDimensionHeadersBuilder_ == null) { return pivotDimensionHeaders_.size(); } else { return pivotDimensionHeadersBuilder_.getCount(); } } /** * * * <pre> * The size is the same as the cardinality of the corresponding dimension * combinations. * </pre> * * <code> * repeated .google.analytics.data.v1beta.PivotDimensionHeader pivot_dimension_headers = 1; * </code> */ public com.google.analytics.data.v1beta.PivotDimensionHeader getPivotDimensionHeaders( int index) { if (pivotDimensionHeadersBuilder_ == null) { return pivotDimensionHeaders_.get(index); } else { return pivotDimensionHeadersBuilder_.getMessage(index); } } /** * * * <pre> * The size is the same as the cardinality of the corresponding dimension * combinations. * </pre> * * <code> * repeated .google.analytics.data.v1beta.PivotDimensionHeader pivot_dimension_headers = 1; * </code> */ public Builder setPivotDimensionHeaders( int index, com.google.analytics.data.v1beta.PivotDimensionHeader value) { if (pivotDimensionHeadersBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensurePivotDimensionHeadersIsMutable(); pivotDimensionHeaders_.set(index, value); onChanged(); } else { pivotDimensionHeadersBuilder_.setMessage(index, value); } return this; } /** * * * <pre> * The size is the same as the cardinality of the corresponding dimension * combinations. * </pre> * * <code> * repeated .google.analytics.data.v1beta.PivotDimensionHeader pivot_dimension_headers = 1; * </code> */ public Builder setPivotDimensionHeaders( int index, com.google.analytics.data.v1beta.PivotDimensionHeader.Builder builderForValue) { if (pivotDimensionHeadersBuilder_ == null) { ensurePivotDimensionHeadersIsMutable(); pivotDimensionHeaders_.set(index, builderForValue.build()); onChanged(); } else { pivotDimensionHeadersBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * * * <pre> * The size is the same as the cardinality of the corresponding dimension * combinations. * </pre> * * <code> * repeated .google.analytics.data.v1beta.PivotDimensionHeader pivot_dimension_headers = 1; * </code> */ public Builder addPivotDimensionHeaders( com.google.analytics.data.v1beta.PivotDimensionHeader value) { if (pivotDimensionHeadersBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensurePivotDimensionHeadersIsMutable(); pivotDimensionHeaders_.add(value); onChanged(); } else { pivotDimensionHeadersBuilder_.addMessage(value); } return this; } /** * * * <pre> * The size is the same as the cardinality of the corresponding dimension * combinations. * </pre> * * <code> * repeated .google.analytics.data.v1beta.PivotDimensionHeader pivot_dimension_headers = 1; * </code> */ public Builder addPivotDimensionHeaders( int index, com.google.analytics.data.v1beta.PivotDimensionHeader value) { if (pivotDimensionHeadersBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensurePivotDimensionHeadersIsMutable(); pivotDimensionHeaders_.add(index, value); onChanged(); } else { pivotDimensionHeadersBuilder_.addMessage(index, value); } return this; } /** * * * <pre> * The size is the same as the cardinality of the corresponding dimension * combinations. * </pre> * * <code> * repeated .google.analytics.data.v1beta.PivotDimensionHeader pivot_dimension_headers = 1; * </code> */ public Builder addPivotDimensionHeaders( com.google.analytics.data.v1beta.PivotDimensionHeader.Builder builderForValue) { if (pivotDimensionHeadersBuilder_ == null) { ensurePivotDimensionHeadersIsMutable(); pivotDimensionHeaders_.add(builderForValue.build()); onChanged(); } else { pivotDimensionHeadersBuilder_.addMessage(builderForValue.build()); } return this; } /** * * * <pre> * The size is the same as the cardinality of the corresponding dimension * combinations. * </pre> * * <code> * repeated .google.analytics.data.v1beta.PivotDimensionHeader pivot_dimension_headers = 1; * </code> */ public Builder addPivotDimensionHeaders( int index, com.google.analytics.data.v1beta.PivotDimensionHeader.Builder builderForValue) { if (pivotDimensionHeadersBuilder_ == null) { ensurePivotDimensionHeadersIsMutable(); pivotDimensionHeaders_.add(index, builderForValue.build()); onChanged(); } else { pivotDimensionHeadersBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * * * <pre> * The size is the same as the cardinality of the corresponding dimension * combinations. * </pre> * * <code> * repeated .google.analytics.data.v1beta.PivotDimensionHeader pivot_dimension_headers = 1; * </code> */ public Builder addAllPivotDimensionHeaders( java.lang.Iterable<? extends com.google.analytics.data.v1beta.PivotDimensionHeader> values) { if (pivotDimensionHeadersBuilder_ == null) { ensurePivotDimensionHeadersIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, pivotDimensionHeaders_); onChanged(); } else { pivotDimensionHeadersBuilder_.addAllMessages(values); } return this; } /** * * * <pre> * The size is the same as the cardinality of the corresponding dimension * combinations. * </pre> * * <code> * repeated .google.analytics.data.v1beta.PivotDimensionHeader pivot_dimension_headers = 1; * </code> */ public Builder clearPivotDimensionHeaders() { if (pivotDimensionHeadersBuilder_ == null) { pivotDimensionHeaders_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { pivotDimensionHeadersBuilder_.clear(); } return this; } /** * * * <pre> * The size is the same as the cardinality of the corresponding dimension * combinations. * </pre> * * <code> * repeated .google.analytics.data.v1beta.PivotDimensionHeader pivot_dimension_headers = 1; * </code> */ public Builder removePivotDimensionHeaders(int index) { if (pivotDimensionHeadersBuilder_ == null) { ensurePivotDimensionHeadersIsMutable(); pivotDimensionHeaders_.remove(index); onChanged(); } else { pivotDimensionHeadersBuilder_.remove(index); } return this; } /** * * * <pre> * The size is the same as the cardinality of the corresponding dimension * combinations. * </pre> * * <code> * repeated .google.analytics.data.v1beta.PivotDimensionHeader pivot_dimension_headers = 1; * </code> */ public com.google.analytics.data.v1beta.PivotDimensionHeader.Builder getPivotDimensionHeadersBuilder(int index) { return getPivotDimensionHeadersFieldBuilder().getBuilder(index); } /** * * * <pre> * The size is the same as the cardinality of the corresponding dimension * combinations. * </pre> * * <code> * repeated .google.analytics.data.v1beta.PivotDimensionHeader pivot_dimension_headers = 1; * </code> */ public com.google.analytics.data.v1beta.PivotDimensionHeaderOrBuilder getPivotDimensionHeadersOrBuilder(int index) { if (pivotDimensionHeadersBuilder_ == null) { return pivotDimensionHeaders_.get(index); } else { return pivotDimensionHeadersBuilder_.getMessageOrBuilder(index); } } /** * * * <pre> * The size is the same as the cardinality of the corresponding dimension * combinations. * </pre> * * <code> * repeated .google.analytics.data.v1beta.PivotDimensionHeader pivot_dimension_headers = 1; * </code> */ public java.util.List<? extends com.google.analytics.data.v1beta.PivotDimensionHeaderOrBuilder> getPivotDimensionHeadersOrBuilderList() { if (pivotDimensionHeadersBuilder_ != null) { return pivotDimensionHeadersBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(pivotDimensionHeaders_); } } /** * * * <pre> * The size is the same as the cardinality of the corresponding dimension * combinations. * </pre> * * <code> * repeated .google.analytics.data.v1beta.PivotDimensionHeader pivot_dimension_headers = 1; * </code> */ public com.google.analytics.data.v1beta.PivotDimensionHeader.Builder addPivotDimensionHeadersBuilder() { return getPivotDimensionHeadersFieldBuilder() .addBuilder(com.google.analytics.data.v1beta.PivotDimensionHeader.getDefaultInstance()); } /** * * * <pre> * The size is the same as the cardinality of the corresponding dimension * combinations. * </pre> * * <code> * repeated .google.analytics.data.v1beta.PivotDimensionHeader pivot_dimension_headers = 1; * </code> */ public com.google.analytics.data.v1beta.PivotDimensionHeader.Builder addPivotDimensionHeadersBuilder(int index) { return getPivotDimensionHeadersFieldBuilder() .addBuilder( index, com.google.analytics.data.v1beta.PivotDimensionHeader.getDefaultInstance()); } /** * * * <pre> * The size is the same as the cardinality of the corresponding dimension * combinations. * </pre> * * <code> * repeated .google.analytics.data.v1beta.PivotDimensionHeader pivot_dimension_headers = 1; * </code> */ public java.util.List<com.google.analytics.data.v1beta.PivotDimensionHeader.Builder> getPivotDimensionHeadersBuilderList() { return getPivotDimensionHeadersFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.analytics.data.v1beta.PivotDimensionHeader, com.google.analytics.data.v1beta.PivotDimensionHeader.Builder, com.google.analytics.data.v1beta.PivotDimensionHeaderOrBuilder> getPivotDimensionHeadersFieldBuilder() { if (pivotDimensionHeadersBuilder_ == null) { pivotDimensionHeadersBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< com.google.analytics.data.v1beta.PivotDimensionHeader, com.google.analytics.data.v1beta.PivotDimensionHeader.Builder, com.google.analytics.data.v1beta.PivotDimensionHeaderOrBuilder>( pivotDimensionHeaders_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); pivotDimensionHeaders_ = null; } return pivotDimensionHeadersBuilder_; } private int rowCount_; /** * * * <pre> * The cardinality of the pivot. The total number of rows for this pivot's * fields regardless of how the parameters `offset` and `limit` are specified * in the request. * </pre> * * <code>int32 row_count = 2;</code> * * @return The rowCount. */ @java.lang.Override public int getRowCount() { return rowCount_; } /** * * * <pre> * The cardinality of the pivot. The total number of rows for this pivot's * fields regardless of how the parameters `offset` and `limit` are specified * in the request. * </pre> * * <code>int32 row_count = 2;</code> * * @param value The rowCount to set. * @return This builder for chaining. */ public Builder setRowCount(int value) { rowCount_ = value; onChanged(); return this; } /** * * * <pre> * The cardinality of the pivot. The total number of rows for this pivot's * fields regardless of how the parameters `offset` and `limit` are specified * in the request. * </pre> * * <code>int32 row_count = 2;</code> * * @return This builder for chaining. */ public Builder clearRowCount() { rowCount_ = 0; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:google.analytics.data.v1beta.PivotHeader) } // @@protoc_insertion_point(class_scope:google.analytics.data.v1beta.PivotHeader) private static final com.google.analytics.data.v1beta.PivotHeader DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.analytics.data.v1beta.PivotHeader(); } public static com.google.analytics.data.v1beta.PivotHeader getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<PivotHeader> PARSER = new com.google.protobuf.AbstractParser<PivotHeader>() { @java.lang.Override public PivotHeader parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new PivotHeader(input, extensionRegistry); } }; public static com.google.protobuf.Parser<PivotHeader> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<PivotHeader> getParserForType() { return PARSER; } @java.lang.Override public com.google.analytics.data.v1beta.PivotHeader getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }
[ "noreply@github.com" ]
meltsufin.noreply@github.com
3044b321c4ceec63a7b2e908bd89a6a8f663f07f
9bd0afb9b1b9886a37b17d21ee5b6f2a8bac4eea
/Program/src/org/jphototagger/program/module/keywords/tree/PathSelectionDialog.java
a6dfe84efed31b6bdcf5e59312f8b5425af9839e
[]
no_license
ebaumann/jphototagger
2d37a256e8373e3704b9e19adfb32f6debcdccbe
b9411c3a2c289f65d82be15d7033a00644e1e210
refs/heads/master
2023-04-12T21:46:34.382467
2023-03-16T18:02:42
2023-03-16T18:02:42
32,269,356
15
2
null
null
null
null
UTF-8
Java
false
false
12,011
java
package org.jphototagger.program.module.keywords.tree; import java.awt.Component; import java.awt.Container; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; import javax.swing.DefaultListCellRenderer; import javax.swing.DefaultListModel; import javax.swing.Icon; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import org.jphototagger.lib.swing.DialogExt; import org.jphototagger.lib.swing.util.MnemonicUtil; import org.jphototagger.lib.util.Bundle; import org.jphototagger.program.resource.GUI; import org.jphototagger.resources.Icons; import org.jphototagger.resources.UiFactory; /** * Modal dialog to select a path. * * @author Elmar Baumann */ public class PathSelectionDialog extends DialogExt implements ListSelectionListener { private static final long serialVersionUID = 1L; private boolean accepted; private final Collection<Collection<String>> paths; private Collection<Collection<String>> selPaths; private final Mode mode; public enum Mode { PATHS, DISTINCT_ELEMENTS, } public PathSelectionDialog(Collection<Collection<String>> paths, Mode mode) { super(GUI.getAppFrame(), true); if (paths == null) { throw new NullPointerException("paths == null"); } if (mode == null) { throw new NullPointerException("mode == null"); } this.paths = paths; this.mode = mode; assert paths != null : "paths == null!"; initComponents(); postInitComponents(); } private void postInitComponents() { list.addListSelectionListener(this); if (mode.equals(Mode.DISTINCT_ELEMENTS)) { list.setLayoutOrientation(javax.swing.JList.HORIZONTAL_WRAP); list.setVisibleRowCount(-1); } MnemonicUtil.setMnemonics((Container) this); } public boolean isAccepted() { return accepted; } public void setInfoMessage(String message) { if (message == null) { throw new NullPointerException("message == null"); } labelInfo.setText(message); labelInfo.setDisplayedMnemonic(message.charAt(0)); } public Collection<Collection<String>> getSelPaths() { return Collections.unmodifiableCollection(selPaths); } private void handleButtonSelectNothingActionPerformed() { selPaths = new ArrayList<>(); accepted = false; setVisible(false); } private void handleButtonSelectAllActionPerformed() { accepted = true; selPaths = new ArrayList<>(paths); setVisible(false); } @SuppressWarnings("unchecked") private void handleButtonSelectSelectedActionPerformed() { accepted = true; List<Collection<String>> sel = new ArrayList<>(); Object[] selValues = list.getSelectedValues(); for (Object selValue : selValues) { if (selValue instanceof Collection<?>) { Collection<String> collection = (Collection<String>) selValue; sel.add(collection); } else if (selValue instanceof String) { Collection<String> collection = Collections.singletonList((String) selValue); sel.add(collection); } } selPaths = sel; setVisible(false); } @Override public void valueChanged(ListSelectionEvent evt) { if (evt == null) { throw new NullPointerException("evt == null"); } if (!evt.getValueIsAdjusting()) { buttonSelectSelected.setEnabled(list.getSelectedIndex() >= 0); } } private class Model extends DefaultListModel<Object> { private static final long serialVersionUID = 1L; Model() { if (mode.equals(Mode.DISTINCT_ELEMENTS)) { addDistinctElements(); } else { addPaths(); } } private void addPaths() { for (Collection<?> path : paths) { addElement(path); } } private void addDistinctElements() { for (Collection<String> path : paths) { for (String element : path) { addElement(element); } } } } private static class Renderer extends DefaultListCellRenderer { private static final long serialVersionUID = 1L; private final Icon ICON = Icons.getIcon("icon_keyword.png"); @Override public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) { JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); if (value instanceof Collection<?>) { renderCollection(value, label); } else if (value instanceof String) { String padding = " "; label.setText((String) value + padding); } label.setIcon(ICON); return label; } private void renderCollection(Object value, JLabel label) { Collection<? extends Object> collection = (Collection<? extends Object>) value; StringBuilder sb = new StringBuilder(); String pathDelim = " > "; int i = 0; for (Object element : collection) { sb.append(i == 0 ? "" : pathDelim).append(element.toString()); i++; } label.setText(sb.toString()); } } private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; panelContent = UiFactory.panel(); labelInfo = UiFactory.label(); scrollPane = UiFactory.scrollPane(); list = UiFactory.jxList(); panelButtons = UiFactory.panel(); buttonSelectNothing = UiFactory.button(); buttonSelectAll = UiFactory.button(); buttonSelectSelected = UiFactory.button(); setTitle(Bundle.getString(getClass(), "PathSelectionDialog.title")); // NOI18N addWindowListener(new java.awt.event.WindowAdapter() { @Override public void windowClosing(java.awt.event.WindowEvent evt) { formWindowClosing(evt); } }); getContentPane().setLayout(new java.awt.GridBagLayout()); panelContent.setName("panelContent"); // NOI18N panelContent.setLayout(new java.awt.GridBagLayout()); labelInfo.setLabelFor(list); labelInfo.setName("labelInfo"); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; panelContent.add(labelInfo, gridBagConstraints); scrollPane.setName("scrollPane"); // NOI18N list.setModel(new Model()); list.setCellRenderer(new Renderer()); list.setName("list"); // NOI18N scrollPane.setViewportView(list); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; gridBagConstraints.insets = UiFactory.insets(5, 0, 0, 0); panelContent.add(scrollPane, gridBagConstraints); panelButtons.setName("panelButtons"); // NOI18N panelButtons.setLayout(new java.awt.GridBagLayout()); buttonSelectNothing.setText(Bundle.getString(getClass(), "PathSelectionDialog.buttonSelectNothing.text")); // NOI18N buttonSelectNothing.setName("buttonSelectNothing"); // NOI18N buttonSelectNothing.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { buttonSelectNothingActionPerformed(evt); } }); panelButtons.add(buttonSelectNothing, new java.awt.GridBagConstraints()); buttonSelectAll.setText(Bundle.getString(getClass(), "PathSelectionDialog.buttonSelectAll.text")); // NOI18N buttonSelectAll.setName("buttonSelectAll"); // NOI18N buttonSelectAll.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { buttonSelectAllActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.insets = UiFactory.insets(0, 5, 0, 0); panelButtons.add(buttonSelectAll, gridBagConstraints); buttonSelectSelected.setText(Bundle.getString(getClass(), "PathSelectionDialog.buttonSelectSelected.text")); // NOI18N buttonSelectSelected.setEnabled(false); buttonSelectSelected.setName("buttonSelectSelected"); // NOI18N buttonSelectSelected.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { buttonSelectSelectedActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.insets = UiFactory.insets(0, 5, 0, 0); panelButtons.add(buttonSelectSelected, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = UiFactory.insets(7, 0, 0, 0); panelContent.add(panelButtons, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; gridBagConstraints.insets = UiFactory.insets(7, 7, 7, 7); getContentPane().add(panelContent, gridBagConstraints); pack(); } private void buttonSelectNothingActionPerformed(java.awt.event.ActionEvent evt) { handleButtonSelectNothingActionPerformed(); } private void buttonSelectAllActionPerformed(java.awt.event.ActionEvent evt) { handleButtonSelectAllActionPerformed(); } private void buttonSelectSelectedActionPerformed(java.awt.event.ActionEvent evt) { handleButtonSelectSelectedActionPerformed(); } private void formWindowClosing(java.awt.event.WindowEvent evt) { setVisible(false); // writes properties } private javax.swing.JButton buttonSelectAll; private javax.swing.JButton buttonSelectNothing; private javax.swing.JButton buttonSelectSelected; private javax.swing.JLabel labelInfo; private org.jdesktop.swingx.JXList list; private javax.swing.JPanel panelButtons; private javax.swing.JPanel panelContent; private javax.swing.JScrollPane scrollPane; }
[ "eb@elmar-baumann.de" ]
eb@elmar-baumann.de
61d17fdad36d4aba16c86033e4e316aa9b0a05bc
cd87f9a46dcd71e63bff3ba13f02db99edf99fc3
/appengine-mapreduce/java/src/com/google/appengine/tools/mapreduce/impl/shardedjob/InProcessShardedJobRunner.java
aa0a1b2e2e9f10070f71cccb10b23766391c1101
[ "Apache-2.0", "LicenseRef-scancode-generic-cla", "JSON" ]
permissive
bslatkin/8-bits
f381824d30e28c3939dac85b7d2c2bf35c2f731c
1608a53bdd5ff491519396212679dc79cc07fca4
refs/heads/master
2021-01-02T15:33:31.768942
2013-05-13T09:54:03
2013-05-13T09:54:03
5,300,337
2
0
null
null
null
null
UTF-8
Java
false
false
1,290
java
// Copyright 2012 Google Inc. All Rights Reserved. package com.google.appengine.tools.mapreduce.impl.shardedjob; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; import java.io.Serializable; import java.util.List; /** * Runs a sharded job in the current process. Only for very small jobs. Easier * to debug than a parallel execution. * * @author ohler@google.com (Christian Ohler) */ public class InProcessShardedJobRunner { private InProcessShardedJobRunner() { } /** * Runs the given job and returns its result. */ public static <T extends IncrementalTask<T, R>, R extends Serializable> R runJob( List<? extends T> initialTasks, ShardedJobController<T, R> controller) { R partialResult = controller.combineResults(ImmutableList.<R>of()); for (T task : initialTasks) { Preconditions.checkNotNull(task, "Null initial task: %s", initialTasks); do { IncrementalTask.RunResult<T, R> runResult = task.run(); partialResult = controller.combineResults( ImmutableList.of(partialResult, runResult.getPartialResult())); task = runResult.getFollowupTask(); } while (task != null); } controller.completed(partialResult); return partialResult; } }
[ "brett@haxor.com" ]
brett@haxor.com
684e16c93197a5175d81b4f5f5bf367aa189e7ef
4cecf695e01434ba274f71edcb475764f45b44e6
/src/main/java/com/anchal/tacocloud/HomeController.java
88896bfc35add25e56c585f444fc7e17670b7f2d
[]
no_license
anchal66/taco-cloud
c340c927c2f2f8bdfc8db409fe884618ff6a566b
11e115c282385c4eb4b85dad70ab51b90c649dc6
refs/heads/master
2021-08-17T04:12:30.509276
2020-09-08T15:03:37
2020-09-08T15:03:37
219,416,500
2
0
null
null
null
null
UTF-8
Java
false
false
261
java
package com.anchal.tacocloud; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; @Controller public class HomeController { @GetMapping("/") public String home(){ return "home"; } }
[ "you@example.comanchalavinash66@gmail.com" ]
you@example.comanchalavinash66@gmail.com
ad9110eaf65d612e3dec130d5f73947deca5b298
37d0712e6c3870fe409574bcc8f7b8db9e46ab23
/textprep/src/main/java/com/example/textprep/entity/Question.java
f87c0c2ff9b593838f2f4f043c69c95ced887b89
[]
no_license
alenosal/textprep
31e5e671f6132687dac786ca2b5e78c4bc09adf6
f416e8665a7539093dfa7bff1c0f7546ac8405a4
refs/heads/main
2023-03-11T02:18:25.778257
2021-02-27T11:28:19
2021-02-27T11:28:19
302,426,098
0
0
null
2020-11-22T12:27:32
2020-10-08T18:17:22
Java
UTF-8
Java
false
false
1,184
java
package com.example.textprep.entity; import org.hibernate.annotations.GenericGenerator; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name = "Questions") public class Question { @Id @GeneratedValue(generator = "uuid") @GenericGenerator(name = "uuid", strategy = "uuid2") private String id; private int number; private String description; private String fileId; public Question(int number, String description, String fileId) { this.number = number; this.description = description; this.fileId = fileId; } public int getNumber() { return number; } public String getDescription() { return description; } public String getFileId() { return fileId; } public String getId() { return this.id; } public void setNumber(int number) { this.number = number; } public void setDescription(String description){ this.description = description; } public void setFileId(String fileId) { this.fileId = fileId; } }
[ "milosz.nosal@gmail.com" ]
milosz.nosal@gmail.com
40a54c0f19f30f298691924008cbbc092e07219a
fff2b6d72209c3db0dda88b2db73954e98c7cd5e
/visiSearch/gen/com/yahoo/visisearch/R.java
147e6455a885dc8163298d5c22797513aa4665dc
[]
no_license
utopcell/android-experiments
8e9978afc92783d0bfb5044b84a7ac2ccc2b0965
b64b3888ffd05898daaa86d297938df1f01e13fa
refs/heads/master
2021-01-10T22:52:12.670175
2016-10-08T16:32:48
2016-10-08T16:32:48
70,344,006
0
0
null
null
null
null
UTF-8
Java
false
false
3,349
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * aapt tool from the resource data it found. It * should not be modified by hand. */ package com.yahoo.visisearch; public final class R { public static final class array { public static final int image_colors=0x7f050001; public static final int image_sizes=0x7f050000; public static final int image_types=0x7f050002; } public static final class attr { } public static final class drawable { public static final int ic_launcher=0x7f020000; public static final int ic_options=0x7f020001; } public static final class id { public static final int btnSave=0x7f08000a; public static final int btnSearch=0x7f08000c; public static final int etQuery=0x7f08000b; public static final int etSite=0x7f080009; public static final int gvResults=0x7f08000d; public static final int ivResult=0x7f080000; public static final int options=0x7f08000e; public static final int spColor=0x7f080007; public static final int spSize=0x7f080006; public static final int spType=0x7f080008; public static final int tvColor=0x7f080003; public static final int tvFilter=0x7f080005; public static final int tvSize=0x7f080002; public static final int tvTitle=0x7f080001; public static final int tvType=0x7f080004; } public static final class layout { public static final int activity_image_display=0x7f030000; public static final int activity_options=0x7f030001; public static final int activity_search=0x7f030002; public static final int item_image_result=0x7f030003; } public static final class menu { public static final int main_menu=0x7f070000; } public static final class string { public static final int app_name=0x7f040000; public static final int btnGo=0x7f040001; public static final int etHint=0x7f040002; public static final int options=0x7f040005; public static final int title_activity_image_display=0x7f040003; public static final int title_activity_options=0x7f040004; } public static final class style { /** Base application theme, dependent on API level. This theme is replaced by AppBaseTheme from res/values-vXX/styles.xml on newer devices. Theme customizations available in newer API levels can go in res/values-vXX/styles.xml, while customizations related to backward-compatibility can go here. Base application theme for API 11+. This theme completely replaces AppBaseTheme from res/values/styles.xml on API 11+ devices. API 11 theme customizations can go here. Base application theme for API 14+. This theme completely replaces AppBaseTheme from BOTH res/values/styles.xml and res/values-v11/styles.xml on API 14+ devices. API 14 theme customizations can go here. */ public static final int AppBaseTheme=0x7f060000; /** Application theme. All customizations that are NOT specific to a particular API-level can go here. */ public static final int AppTheme=0x7f060001; } }
[ "stergios@yahoo-inc.com" ]
stergios@yahoo-inc.com
e28ecd93be412396675d3e10d3616ae08b35911f
5e42f54c614a14f2172c698e077d26fa131ced2e
/graphalytics-core/src/main/java/nl/tudelft/graphalytics/util/io/VertexListInputStreamReader.java
8a1c1bc2e0c87812f964808d6b8117837da6c0bf
[ "Apache-2.0" ]
permissive
mihaic/ldbc_graphalytics
1122ba0066d7c456567e66da06a3a2189ebcabeb
bca0363644bd9fa0606fabc02cb54e7151df8cb3
refs/heads/master
2020-12-30T23:33:49.966473
2016-12-28T20:44:28
2016-12-28T20:44:28
80,656,524
0
0
null
2017-02-01T19:40:29
2017-02-01T19:40:29
null
UTF-8
Java
false
false
2,309
java
/* * Copyright 2015 Delft University of Technology * * 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 nl.tudelft.graphalytics.util.io; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.Arrays; import java.util.NoSuchElementException; /** * VertexListStream that reads vertex data for an InputStream. * * @author Tim Hegeman */ public class VertexListInputStreamReader implements VertexListStream { private final BufferedReader reader; private final VertexData cache = new VertexData(); private boolean cacheValid; public VertexListInputStreamReader(InputStream inputStream) { reader = new BufferedReader(new InputStreamReader(inputStream)); } @Override public boolean hasNextVertex() throws IOException { if (cacheValid) { return true; } else { for (String line = reader.readLine(); line != null; line = reader.readLine()) { line = line.trim(); if (line.isEmpty()) { continue; } String[] tokens = line.split(" "); try { cache.setId(Long.parseLong(tokens[0])); } catch (NumberFormatException ex) { throw new IOException("Failed to parse vertex identifier from stream.", ex); } if (cache.getValues().length == tokens.length - 1) { System.arraycopy(tokens, 1, cache.getValues(), 0, tokens.length - 1); } else { cache.setValues(Arrays.copyOfRange(tokens, 1, tokens.length)); } cacheValid = true; return true; } return false; } } @Override public VertexData getNextVertex() throws IOException { if (!hasNextVertex()) { throw new NoSuchElementException(); } cacheValid = false; return cache; } @Override public void close() throws IOException { reader.close(); } }
[ "tim.m.hegeman@gmail.com" ]
tim.m.hegeman@gmail.com
c7288ef30c242e949dc201832cb48ebe35df3d5b
9b284f00fcc578ab1d9bd47c0b45c22519d3e808
/src/main/test/app/BookFunctionsTest.java
a7926df7df80fd5d7e6b9514608e2f069440a38f
[]
no_license
Damrocka89/Library
74134503d6e7e4887b4ed334bd899c77752a97e9
811f4c0c765b4335a53f9abbc59a1f0e74c13042
refs/heads/master
2021-06-16T05:53:37.388642
2019-05-26T13:45:41
2019-05-26T13:45:41
186,115,415
0
0
null
null
null
null
UTF-8
Java
false
false
10,232
java
package app; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; import java.util.*; import static app.BookBindingType.M; import static app.BookBindingType.T; import static org.assertj.core.api.Assertions.assertThat; class BookFunctionsTest { private static List<Book> books; private static BookFunctions bookFunctions; /*W klasie BookFunctionsTest tworzymy ręcznie 6 książek (bez autorów i kategorii) i dodajemy je do listy. To nasze dane testowe, których będziemy używać do kolejnych funkcji. */ @BeforeAll static void setup() { books = Arrays.asList(new Book(1, "Java", "123ert", 2010, M), new Book(2, "Exercises", "202020kdkdkd", 2000, T), new Book(3, "Just a title", "dldldldl", 1999, M), new Book(4, "Another book", "abc", 2003, T), new Book(5, "Creative ideas", "123456", 2019, M), new Book(6, "Innovations", "gkfks", 2018, T)); bookFunctions = new BookFunctions(); } @Test void testFindBookByIsbnWithLoopIfIsbnIsCorrect() { Assertions.assertEquals(books.get(0), bookFunctions.getBookFromTheListWithGivenIsbnLoop("123ert", books)); } @Test void testFindBookByIsbnWithLoopIfBookNotExists() { Assertions.assertNull(bookFunctions.getBookFromTheListWithGivenIsbnLoop("bla", books)); } @Test void testFindBookByIsbnWithStreamsIfIsbnIsCorrect() { Assertions.assertEquals(books.get(0), bookFunctions.getBookFromTheListWithGivenIsbnStream("123ert", books)); } @Test void testFindBookByIsbnWithStreamsIfBookNotExists() { Assertions.assertNull(bookFunctions.getBookFromTheListWithGivenIsbnStream("bla", books)); } @Test void testReceivingTwoLastBooksFromTheListWithLoop() { assertThat(bookFunctions.getTwoLastBooksStreams(books)).hasSize(2) .contains((books.get(books.size() - 1)), (books.get(books.size() - 2))); } @Test void testReceivingTwoLastBooksFromTheListWithStreams() { assertThat(bookFunctions.getTwoLastBooksStreams(books)).hasSize(2) .contains((books.get(books.size() - 1)), (books.get(books.size() - 2))); } @Test void testReceivingTwoLastBooksFromTheListIfListIsShorterThanTwoLoop() { List<Book> books1 = new ArrayList<>(); books1.add(new Book(6, "Innovations", "gkfks", 2018, T)); Assertions.assertEquals(books1, bookFunctions.getTwoLastBooksLoop(books1)); } @Test void testReceivingTwoLastBooksFromTheListIfListIsEmptyLoop() { List<Book> books1 = new ArrayList<>(); Assertions.assertEquals(books1, bookFunctions.getTwoLastBooksLoop(books1)); } @Test void testReceivingTwoLastBooksFromTheListIfListIsShorterThanTwoStream() { List<Book> books1 = new ArrayList<>(); books1.add(new Book(6, "Innovations", "gkfks", 2018, T)); Assertions.assertEquals(books1, bookFunctions.getTwoLastBooksStreams(books1)); } @Test void testReceivingTwoLastBooksFromTheListIfListIsEmptyStream() { List<Book> books1 = new ArrayList<>(); Assertions.assertEquals(books1, bookFunctions.getTwoLastBooksStreams(books1)); } @Test void testReceivingtheOldestBookUsingLoop() { Assertions.assertEquals(books.get(2), bookFunctions.getTheOldestBookLoop(books)); } @Test void testReceivingtheOldestBookUsingStream() { Assertions.assertEquals(books.get(2), bookFunctions.getTheOldestBookStream(books)); } @Test void testReceivingtheNewestBookUsingLoop() { Assertions.assertEquals(books.get(4), bookFunctions.getTheNewestBookLoop(books)); } @Test void testReceivingtheNewestBookUsingStream() { Assertions.assertEquals(books.get(4), bookFunctions.getTheNewestBookStream(books)); } @Test void testTheSummingOfPublicationYearsUsingLoop() { Assertions.assertEquals(12049, bookFunctions.getTheSumOfPublicationYearsLoop(books)); } @Test void testTheSummingOfPublicationYearsUsingStreams() { Assertions.assertEquals(12049, bookFunctions.getTheSumOfPublicationYearsStreams(books)); } @Test void testTheNumberOfBooksPublishedAfter2007UsingLoops() { Assertions.assertEquals(3, bookFunctions.getTheNumberOfBooksPublishedAfter2007Loop(books)); } @Test void testTheNumberOfBooksPublishedAfter2007UsingStreams() { Assertions.assertEquals(3, bookFunctions.getTheNumberOfBooksPublishedAfter2007Streams(books)); } @Test void testIfAllBooksArePublishedAfter2000UsingLoop() { Assertions.assertFalse(bookFunctions.areAllBooksPublishedAfter2000Loop(books)); } @Test void testIfAllBooksArePublishedAfter2000UsingStreams() { Assertions.assertFalse(bookFunctions.areAllBooksPublishedAfter2000Streams(books)); } @Test void testAverageYesrOfPublishingLoop() { Assertions.assertEquals(2008.16, bookFunctions.averageYearOfPublishingLoop(books), 0.01); } @Test void testAverageYesrOfPublishingStreams() { Assertions.assertEquals(2008.16, bookFunctions.averageYearOfPublishingStreams(books), 0.01); } @Test void testIfAnyBookHasBeenPublishedBefore2003Loop() { Assertions.assertTrue(bookFunctions.isAnyBookPublishedBefore2003Loop(books)); } @Test void testIfAnyBookHasBeenPublishedBefore2003Stream() { Assertions.assertTrue(bookFunctions.isAnyBookPublishedBefore2003Streams(books)); } @Test void testBooksWithTitleStartingWithCPublishedAfter2007() { List<Book> booksFiltered = new ArrayList<>(); booksFiltered.add(books.get(4)); Assertions.assertEquals(booksFiltered, bookFunctions.returnBooksWithTitleStartingWithCAndPublishedAfter2007(books)); } @ParameterizedTest @CsvSource({ "0", "1", "2", "3", "4", "5" }) void testAddingHundredYearsToPublishYear(int index) { Assertions.assertEquals(books.get(index).getYear() + 100, bookFunctions.addHundredYearsToPublishYear(books).get(index).getYear()); } @Test void testReceivingListOfBooksDividableByTwo() { assertThat(bookFunctions.returnBooksWhichYearOfPublishIdDividableByTwo(books)).hasSize(3) .contains(books.get(0), books.get(1), books.get(5)); } @Test void testGettingMapFromBooksList() { Map<String, Book> booksMap = new HashMap<>(); for (Book book : books) { booksMap.put(book.getIsbnNumber(), book); } assertThat(bookFunctions.returnMapOfBooksWithIsbnKey(books)).hasSize(6) .containsAllEntriesOf(booksMap); } @ParameterizedTest @CsvSource({ "0,Just a title", "1,Exercises", "2,Another book", "3,Java", "4,Innovations", "5,Creative ideas" }) void testSortingListByPublishYearAscending(int index, String title) { bookFunctions.sortBooksListByPublishYearAscending(books); Assertions.assertEquals(title, books.get(index).getTitle()); } @ParameterizedTest @CsvSource({ "0,Creative ideas", "1,Innovations", "2,Java", "3,Another book", "4,Exercises", "5,Just a title" }) void testSortingListByPublishYearDescending(int index, String title) { bookFunctions.sortBooksListByPublishYearDescending(books); Assertions.assertEquals(title, books.get(index).getTitle()); } @Test void testDividingListIntoListOfListsSize() { List<List<Book>> listOfBooks = bookFunctions.getThreeListsContainingEachTwoBooks(books); assertThat(listOfBooks).hasSize(3); } @Test void testDividingListIntoListOfListsSizeGuava() { List<List<Book>> listOfBooks = bookFunctions.getThreeListsContainingEachTwoBooks(books); assertThat(listOfBooks).hasSize(3); } @Test void testDividingListIntoListOfLists() { List<List<Book>> listOfBooksActual = bookFunctions.getThreeListsContainingEachTwoBooks(books); List<Book> list1 = books.subList(0, 2); List<Book> list2 = books.subList(2, 4); List<Book> list3 = books.subList(4, 6); List<List<Book>> listOfBooksExpected = Arrays.asList(list1, list2, list3); Assertions.assertEquals(listOfBooksExpected, listOfBooksActual); } //books = Arrays.asList(new Book(1, "Java", "123ert", 2010, M), // new Book(2, "Exercises", "202020kdkdkd", 2000, T), // new Book(3, "Just a title", "dldldldl", 1999, M), // new Book(4, "Another book", "abc", 2003, T), // new Book(5, "Creative ideas", "123456", 2019, M), // new Book(6, "Innovations", "gkfks", 2018, T)); @Test void testReceivingMapOfBooksListsGroupedByPublishYear() { Assertions.assertEquals("Java", bookFunctions.groupBooksByPublishYear(books).get(2010).get(0).getTitle()); } @Test void testReceivingMapOfBooksListsGroupedByPublishYearSize() { assertThat(bookFunctions.groupBooksByPublishYear(books)).hasSize(6); } @Test void testReceivingMapOfBooksListsGroupedByPublishYearSizeOfOneList() { assertThat(bookFunctions.groupBooksByPublishYear(books).get(1999)).hasSize(1); } @Test void testGroupBooksPublishedAfter2009AndTheRestSize() { assertThat(bookFunctions.groupBooksPublishedAfter2009AndTheRest(books)).hasSize(2); } @Test void testGroupBooksPublishedAfter2009AndTheRestListAfter2009() { assertThat(bookFunctions.groupBooksPublishedAfter2009AndTheRest(books).get(Boolean.TRUE)).hasSize(3) .contains(books.get(0),books.get(4),books.get(5)); } @Test void testGroupBooksPublishedAfter2009AndTheRestSizeOfOneListBefore2009() { assertThat(bookFunctions.groupBooksPublishedAfter2009AndTheRest(books).get(Boolean.FALSE)).hasSize(3); } }
[ "ew.krasowska@hotmail.com" ]
ew.krasowska@hotmail.com
3d2b2306ee89fe32b8f72cc41147db78c9adc920
ec53a7c96ad208d0a86838c6af9a43d67cbe0515
/src/me/thedoffman/essentialspro/commands/Gamemode.java
131242b8e49880c81cae18d8b2466e054b7ec86d
[ "MIT" ]
permissive
Yowckie/EssentialsPro
f83931a3ead4190bf26248656b5025ff2b289666
ecc105a27cb7baec50969839efa888ec2d504f8a
refs/heads/master
2020-05-24T12:38:17.120970
2019-05-15T05:21:13
2019-05-15T05:21:13
187,272,523
0
0
null
2019-05-17T19:42:29
2019-05-17T19:42:28
null
UTF-8
Java
false
false
2,660
java
package me.thedoffman.essentialspro.commands; import me.thedoffman.essentialspro.main.Main; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.GameMode; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; public class Gamemode implements CommandExecutor { private Main plugin = Main.getPlugin(Main.class); public Gamemode(Main plugin) { Bukkit.getPluginCommand("gamemode").setExecutor(this); } public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) { plugin.prefix = plugin.prefix.replaceAll("&", "\u00A7"); if (cmd.getName().equalsIgnoreCase("gamemode") && !sender.hasPermission("ep.gamemode")) { sender.sendMessage(ChatColor.RED + "You do not have permission to use that command!"); return true; } if (!(sender instanceof Player)) { sender.sendMessage(plugin.prefix + ChatColor.RED + "Error: Only players can set a gamemode!"); return true; } Player player = (Player)sender; if (args.length == 0) { player.sendMessage(plugin.prefix + ChatColor.BLUE + "Gamemode " + ChatColor.GREEN + "0" + ChatColor.BLUE + ", " + ChatColor.GREEN + "1 " + ChatColor.BLUE + ", " + ChatColor.GREEN + "2 " + ChatColor.BLUE + "or " + ChatColor.GREEN + "3" + ChatColor.BLUE + "."); return true; } if (args.length != 1) return true; if (args[0].equalsIgnoreCase("0")) { player.setGameMode(GameMode.SURVIVAL); player.sendMessage(plugin.prefix + ChatColor.BLUE + "GameMode set to" + ChatColor.GREEN + " Survival"); return true; } if (args[0].equalsIgnoreCase("1")) { player.setGameMode(GameMode.CREATIVE); player.sendMessage(plugin.prefix + ChatColor.BLUE + "GameMode set to" + ChatColor.GREEN + " Creative"); return true; } if (args[0].equalsIgnoreCase("2")) { player.setGameMode(GameMode.ADVENTURE); player.sendMessage(plugin.prefix + ChatColor.BLUE + "GameMode set to" + ChatColor.GREEN + " Adventure"); return true; } if (args[0].equalsIgnoreCase("3")) { player.setGameMode(GameMode.SPECTATOR); player.sendMessage(plugin.prefix + ChatColor.BLUE + "GameMode set to" + ChatColor.GREEN + " Spectator"); return true; } player.sendMessage(plugin.prefix + ChatColor.RED + "Usage: /gamemode [0:1:2:3]"); return true; } }
[ "thedoffman@gmail.com" ]
thedoffman@gmail.com
220a92530742c815cd43357e7c17dea7f247e4cc
2af12c642f18dd93901ae4ed764422c2c9596662
/kindeditor/src/main/java/com/yjp/test/CpuTestServlet.java
6bff67bb88e068dfe6baabcb6229be86e2447f51
[]
no_license
zl532812070/mygithub
d351930ddb569dc6bb2c009b15b6a1f84f7152d4
21d3e1e9d5d21b665a309f214edcada3ef1aa4f5
refs/heads/master
2020-03-26T10:41:59.206201
2018-09-07T08:25:06
2018-09-07T08:25:06
144,811,417
0
0
null
null
null
null
UTF-8
Java
false
false
1,560
java
package com.yjp.test; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * Servlet implementation class CpuTestServlet */ @WebServlet("/CpuTestServlet") public class CpuTestServlet extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public CpuTestServlet() { super(); // TODO Auto-generated constructor stub System.out.println("CpuTestServlet.CpuTestServlet()"); } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub for(int i = 0; i<1500;i++){ new Thread(new Runnable() { @Override public void run() { // TODO Auto-generated method stub while(true){ try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } }).start();; } } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub } }
[ "532812070@qq.com" ]
532812070@qq.com
7a54c25d0bc087e55fbe2f14b1c58e625758abe1
fc9f4ed2b1a7a59684c554d5e040561a07c9dda8
/src/Rozryad.java
6a4d9b550bb9f833f7ecf8618fdb6b9002f164a3
[]
no_license
Ragimov/ROZRYAD
9e957e04b1b4ce3e9d1f52c838088f8e372cd884
f8b9dbfe42a047700b49ca37a870c7aeae494e5b
refs/heads/master
2020-12-31T07:09:26.986945
2016-04-27T16:10:18
2016-04-27T16:10:18
57,227,507
0
0
null
null
null
null
UTF-8
Java
false
false
418
java
/** * Created by Acer on 27.04.2016. */ public class Rozryad { public static void main(String[] args) { int n = Integer.parseInt(args[0]); int Roz = 1; if(n <10) if(Roz ==0) { System.out.println("Rozryad 1"); return; } System.out.println("Rozryad=" + n); } }
[ "relmar@mail.ua" ]
relmar@mail.ua
6fa721f5b150558998a4ab9984db334fa39780ec
3ed18d25cc3596eb1e96b4f3bdd3225ed74311dc
/src/main/java/io/github/nucleuspowered/nucleus/modules/kit/commands/kit/KitResetUsageCommand.java
a1d11795700d9642771c280a9f5dfb5ef6851a95
[ "MIT", "Apache-2.0" ]
permissive
Tollainmear/Nucleus
ab197b89b4465aaa9121a8d92174ab7c58df3568
dfd88cb3b2ab6923548518765a712c190259557b
refs/heads/sponge-api/7
2021-01-25T15:04:23.678553
2018-08-19T14:03:46
2018-08-19T14:03:46
123,745,847
0
3
MIT
2018-10-08T05:55:23
2018-03-04T01:19:42
Java
UTF-8
Java
false
false
2,854
java
/* * This file is part of Nucleus, licensed under the MIT License (MIT). See the LICENSE.txt file * at the root of this project for more details. */ package io.github.nucleuspowered.nucleus.modules.kit.commands.kit; import io.github.nucleuspowered.nucleus.Nucleus; import io.github.nucleuspowered.nucleus.Util; import io.github.nucleuspowered.nucleus.api.nucleusdata.Kit; import io.github.nucleuspowered.nucleus.internal.annotations.RunAsync; import io.github.nucleuspowered.nucleus.internal.annotations.command.NoModifiers; import io.github.nucleuspowered.nucleus.internal.annotations.command.Permissions; import io.github.nucleuspowered.nucleus.internal.annotations.command.RegisterCommand; import io.github.nucleuspowered.nucleus.internal.command.NucleusParameters; import io.github.nucleuspowered.nucleus.internal.command.ReturnMessageException; import io.github.nucleuspowered.nucleus.internal.permissions.SuggestedLevel; import io.github.nucleuspowered.nucleus.modules.kit.commands.KitFallbackBase; import io.github.nucleuspowered.nucleus.modules.kit.datamodules.KitUserDataModule; import org.spongepowered.api.command.CommandResult; import org.spongepowered.api.command.CommandSource; import org.spongepowered.api.command.args.CommandContext; import org.spongepowered.api.command.args.CommandElement; import org.spongepowered.api.entity.living.player.User; import org.spongepowered.api.util.annotation.NonnullByDefault; @Permissions(prefix = "kit", suggestedLevel = SuggestedLevel.ADMIN) @RegisterCommand(value = {"resetusage", "reset"}, subcommandOf = KitCommand.class) @RunAsync @NonnullByDefault @NoModifiers public class KitResetUsageCommand extends KitFallbackBase<CommandSource> { @Override public CommandElement[] getArguments() { return new CommandElement[] { NucleusParameters.ONE_USER, KitFallbackBase.KIT_PARAMETER_NO_PERM_CHECK }; } @Override public CommandResult executeCommand(final CommandSource player, CommandContext args) throws Exception { Kit kitInfo = args.<Kit>getOne(KIT_PARAMETER_KEY).get(); User u = args.<User>getOne(NucleusParameters.Keys.USER).get(); KitUserDataModule inu = Nucleus.getNucleus().getUserDataManager().getUnchecked(u).get(KitUserDataModule.class); if (Util.getKeyIgnoreCase(inu.getKitLastUsedTime(), kitInfo.getName()).isPresent()) { // Remove the key. inu.removeKitLastUsedTime(kitInfo.getName().toLowerCase()); player.sendMessage( Nucleus.getNucleus().getMessageProvider().getTextMessageWithFormat("command.kit.resetuser.success", u.getName(), kitInfo.getName())); return CommandResult.success(); } throw ReturnMessageException.fromKey("command.kit.resetuser.empty", u.getName(), kitInfo.getName()); } }
[ "git@drnaylor.co.uk" ]
git@drnaylor.co.uk
6f4bbe9cf7dd548381a3d9a599f778447e4b33d4
7c9a9bc48ed82d0d135ef2fba7509d68e6ecda2c
/JAVA/p1408.java
632c20b90427e15af54eb837e17edeb3f27fe095
[]
no_license
sh0114/SW_Algorithm_Practice_Basic
a9f99161acb72ebd576e1e0f7640ae5ee078c80f
e0bef8f1005a166acb8a0e26d5a215fad913ab00
refs/heads/master
2020-07-31T07:17:12.884033
2020-03-19T07:24:53
2020-03-19T07:24:53
210,527,796
1
0
null
null
null
null
UTF-8
Java
false
false
937
java
import java.util.*; public class p1408 { public static void main(String[] args) { Scanner s = new Scanner(System.in); String current = s.nextLine(); String start = s.nextLine(); int ch =Integer.parseInt(current.split(":")[0]); int cm = Integer.parseInt(current.split(":")[1]); int cs = Integer.parseInt(current.split(":")[2]); int ct = ch*3600+cm*60+cs; int sh = Integer.parseInt(start.split(":")[0]); int sm = Integer.parseInt(start.split(":")[1]); int ss = Integer.parseInt(start.split(":")[2]); int st = sh*3600+sm*60+ss; if(ct>st) { st += 24*3600; } String result=""; int r = st-ct; int rh = r/3600; r = r%3600; result = result + String.format("%02d", rh) +":"; int rm = r/60; r = r%60; result = result + String.format("%02d", rm) + ":"; int rs = r; result = result + String.format("%02d", rs); System.out.println(result); s.close(); } }
[ "spring013@ajou.ac.kr" ]
spring013@ajou.ac.kr
ffe8bf0a7726a25287fc0a30bc4b2ee17328bac6
3ec2d2bbb52abaa28af294dba911d225fa7d2d48
/src/main/java/vn/vpay/web/rest/WalletRuleResource.java
2f165eb42080ef139712f9663b1fcce28e0c0ef3
[]
no_license
tkmd123/vpay03
faf4621ff18b5772bda4fa9d77d6eeef5a68d3c9
25282fb4f14a367698552eab0329984ff8439711
refs/heads/master
2020-04-04T16:22:08.492262
2018-11-04T11:43:51
2018-11-04T11:43:51
156,074,755
0
0
null
2018-11-05T04:13:43
2018-11-04T11:23:15
Java
UTF-8
Java
false
false
5,240
java
package vn.vpay.web.rest; import com.codahale.metrics.annotation.Timed; import vn.vpay.domain.WalletRule; import vn.vpay.repository.WalletRuleRepository; import vn.vpay.web.rest.errors.BadRequestAlertException; import vn.vpay.web.rest.util.HeaderUtil; import vn.vpay.web.rest.util.PaginationUtil; import io.github.jhipster.web.util.ResponseUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; import java.net.URI; import java.net.URISyntaxException; import java.util.List; import java.util.Optional; /** * REST controller for managing WalletRule. */ @RestController @RequestMapping("/api") public class WalletRuleResource { private final Logger log = LoggerFactory.getLogger(WalletRuleResource.class); private static final String ENTITY_NAME = "walletRule"; private final WalletRuleRepository walletRuleRepository; public WalletRuleResource(WalletRuleRepository walletRuleRepository) { this.walletRuleRepository = walletRuleRepository; } /** * POST /wallet-rules : Create a new walletRule. * * @param walletRule the walletRule to create * @return the ResponseEntity with status 201 (Created) and with body the new walletRule, or with status 400 (Bad Request) if the walletRule has already an ID * @throws URISyntaxException if the Location URI syntax is incorrect */ @PostMapping("/wallet-rules") @Timed public ResponseEntity<WalletRule> createWalletRule(@Valid @RequestBody WalletRule walletRule) throws URISyntaxException { log.debug("REST request to save WalletRule : {}", walletRule); if (walletRule.getId() != null) { throw new BadRequestAlertException("A new walletRule cannot already have an ID", ENTITY_NAME, "idexists"); } WalletRule result = walletRuleRepository.save(walletRule); return ResponseEntity.created(new URI("/api/wallet-rules/" + result.getId())) .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString())) .body(result); } /** * PUT /wallet-rules : Updates an existing walletRule. * * @param walletRule the walletRule to update * @return the ResponseEntity with status 200 (OK) and with body the updated walletRule, * or with status 400 (Bad Request) if the walletRule is not valid, * or with status 500 (Internal Server Error) if the walletRule couldn't be updated * @throws URISyntaxException if the Location URI syntax is incorrect */ @PutMapping("/wallet-rules") @Timed public ResponseEntity<WalletRule> updateWalletRule(@Valid @RequestBody WalletRule walletRule) throws URISyntaxException { log.debug("REST request to update WalletRule : {}", walletRule); if (walletRule.getId() == null) { throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull"); } WalletRule result = walletRuleRepository.save(walletRule); return ResponseEntity.ok() .headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, walletRule.getId().toString())) .body(result); } /** * GET /wallet-rules : get all the walletRules. * * @param pageable the pagination information * @return the ResponseEntity with status 200 (OK) and the list of walletRules in body */ @GetMapping("/wallet-rules") @Timed public ResponseEntity<List<WalletRule>> getAllWalletRules(Pageable pageable) { log.debug("REST request to get a page of WalletRules"); Page<WalletRule> page = walletRuleRepository.findAll(pageable); HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, "/api/wallet-rules"); return ResponseEntity.ok().headers(headers).body(page.getContent()); } /** * GET /wallet-rules/:id : get the "id" walletRule. * * @param id the id of the walletRule to retrieve * @return the ResponseEntity with status 200 (OK) and with body the walletRule, or with status 404 (Not Found) */ @GetMapping("/wallet-rules/{id}") @Timed public ResponseEntity<WalletRule> getWalletRule(@PathVariable Long id) { log.debug("REST request to get WalletRule : {}", id); Optional<WalletRule> walletRule = walletRuleRepository.findById(id); return ResponseUtil.wrapOrNotFound(walletRule); } /** * DELETE /wallet-rules/:id : delete the "id" walletRule. * * @param id the id of the walletRule to delete * @return the ResponseEntity with status 200 (OK) */ @DeleteMapping("/wallet-rules/{id}") @Timed public ResponseEntity<Void> deleteWalletRule(@PathVariable Long id) { log.debug("REST request to delete WalletRule : {}", id); walletRuleRepository.deleteById(id); return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build(); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech