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
e9043f7c081c555880bdd496b8e3fa216d72eb94
57231a0f0f2ee8b46af3bbec7248c0e11e985d26
/app/src/androidTest/java/com/example/altair/teste/ExampleInstrumentedTest.java
4d7e43f7955d0056afd0f210128694925c42e138
[]
no_license
tatosjb/android-data-binding-test
ca2e54d5fc8bb03663a9e323f6ef9b59312adbd1
aa654f70fc4b043c3b580e3c037500ec3eeacaee
refs/heads/master
2021-01-11T16:18:24.977598
2017-01-26T14:58:31
2017-01-26T14:58:31
80,062,484
0
0
null
null
null
null
UTF-8
Java
false
false
752
java
package com.example.altair.teste; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumentation test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.altair.teste", appContext.getPackageName()); } }
[ "tatosjb@gmail.com" ]
tatosjb@gmail.com
4dea28af137c32c543b01a99f91b69b0e092295f
adb3be46fc5e9063d5a38294699c434ec38e58ca
/generator/src/test/java/com/yafred/asn1/generator/go/test/DummyTest.java
a15c6154b110bfd3e63eea10eb537d00164ef450
[ "MIT" ]
permissive
zhongweijun/asn1-tool
ddd88b8a418b7804d10345f1e11d9d9961ef91ab
c36610768f07dd52e87722dffc73a4f1ca45d17a
refs/heads/master
2023-07-10T06:33:04.529244
2021-08-19T08:34:52
2021-08-19T08:34:52
397,825,172
0
0
MIT
2021-08-19T05:17:46
2021-08-19T05:17:46
null
UTF-8
Java
false
false
875
java
package com.yafred.asn1.generator.go.test; import java.io.File; import java.io.FileWriter; import java.io.PrintWriter; import org.junit.Test; public class DummyTest { @Test public void generateCode() throws Exception { // create output dir String outputPath = System.getProperty("buildDirectory") + File.separator + "generator-output" + File.separator + "go" + File.separator + "dummy"; File outputPathFile = new File(outputPath); outputPathFile.mkdirs(); // write a dummy file PrintWriter fileWriter = new PrintWriter(new FileWriter(new File(outputPathFile, "dummy.go"))); fileWriter.println("package dummy\r\n" + "\r\n" + "// Hello returns string hello\r\n" + "func Hello() string {\r\n" + " return \"hello\"\r\n" + "}"); fileWriter.close(); } }
[ "yafred@users.noreply.github.com" ]
yafred@users.noreply.github.com
d9faa2e4a5415e3e469a2477357ffcad203ecf37
54ff9f59162581d8503ceae63d1fe70ad8a3aec2
/EO-GameSDK/src/com/eogame/listener/InitCallback.java
e708419866e0c16285b8b523e3aed45a19f4582c
[]
no_license
Zhaoxizhen/workplace_20200310
189b7d54ded0398547de40b6358144c90d00229b
6aa21eccb5bdca0b0c2a93b4c15f35402e6934f4
refs/heads/master
2022-12-10T05:17:14.740974
2020-09-15T08:40:06
2020-09-15T08:40:06
295,666,021
0
0
null
null
null
null
UTF-8
Java
false
false
253
java
package com.eogame.listener; /** * SDK初始化回调 * @author wujunfeng * @date 创建时间:2016-8-9 下午3:27:29 * @version 1.0 */ public interface InitCallback { public void onSuccess(); public void onError(String errorMsg); }
[ "zhaoxizhen94@gmail.com" ]
zhaoxizhen94@gmail.com
366fbf287a9665ac875122ea5d1883e370f87ddb
a22b2b53220caf6196120098d90d42517085b034
/src/main/java/day9/Task2/Circle.java
25280b7948f86f0571ebc03fbb72d7af0fec3fe5
[]
no_license
afrojeeus/JavaMarathon2021
3c730f5fdf98234ec360a6aaf87e45cfc415a660
4039ff149548f37bf0d0a50806af3d4d2db978fa
refs/heads/master
2023-03-26T11:32:35.639729
2021-03-22T11:53:38
2021-03-22T11:53:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
498
java
package day9.Task2; public class Circle extends Figure { private int radius; public Circle(String color, int radius){ super(color); this.radius = radius; } public int getRadius() { return radius; } public void setRadius(int radius) { this.radius = radius; } @Override public double area() { return (radius*radius)*Math.PI; } @Override public double perimeter() { return 2*Math.PI*radius; } }
[ "maksim.simonenko@gmail.com" ]
maksim.simonenko@gmail.com
6cf45ce85e94d8fa194a0b939933b21ee7a5dad0
9521bf7660c86c0decb7e92d0fe6a28259e0a241
/src/main/java/utfpr/bruno/projetotds/web/util/RelatorioUtil.java
8c7a5f62db6b7c46c9529721868aa6797aa4711e
[]
no_license
BrunoSchwengber/projetoTDS
28f0d53e4cd021de208a6508a9a9149d0825e922
88bc639a859a8c4d90a0ebae3854e2cbaca9e6a3
refs/heads/master
2020-03-20T11:21:26.795352
2018-07-05T04:17:06
2018-07-05T04:17:06
137,400,784
0
0
null
null
null
null
UTF-8
Java
false
false
4,250
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 utfpr.bruno.projetotds.web.util; import utfpr.bruno.projetotds.dao.ConexaoHibernate; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream; import java.sql.Connection; import java.sql.SQLException; import java.util.HashMap; import javax.faces.context.ExternalContext; import javax.faces.context.FacesContext; import javax.persistence.EntityManager; import javax.servlet.ServletContext; import org.hibernate.Session; import org.hibernate.jdbc.Work; import org.primefaces.model.StreamedContent; import net.sf.jasperreports.engine.*; import net.sf.jasperreports.engine.export.*; import net.sf.jasperreports.engine.export.oasis.JROdtExporter; import net.sf.jasperreports.engine.util.JRLoader; import net.sf.jasperreports.export.*; import org.primefaces.model.DefaultStreamedContent; /** * * @author BRUNO */ public class RelatorioUtil { private Connection connection; public StreamedContent geraRelatorio(HashMap parametrosRelatorio, String nomeRelatorioJasper, String nomeRelatorioSaida) throws UtilException { StreamedContent arquivoRetorno = null; try { Connection conexao = this.getConexao(); FacesContext contextoFaces = FacesContext.getCurrentInstance(); ExternalContext contextoExterno = contextoFaces.getExternalContext(); ServletContext contextoServlet = (ServletContext) contextoExterno.getContext(); String caminhoRelatorios ="/home/bruno/NetBeansProjects/ProjetoTDS/relatorios/";//contextoServlet.getRealPath("/relatorios"); String caminhoArquivoJasper = caminhoRelatorios + File.separator + nomeRelatorioJasper + ".jasper"; String caminhoArquivoRelatorio = caminhoRelatorios + File.separator + nomeRelatorioSaida; JasperReport relatorioJasper = (JasperReport) JRLoader.loadObjectFromFile(caminhoArquivoJasper); JasperPrint impressoraJasper = JasperFillManager .fillReport(relatorioJasper, parametrosRelatorio, conexao); String extensao = null; File arquivoGerado = null; JRPdfExporter pdfExportado = new JRPdfExporter(); extensao = "pdf"; arquivoGerado = new java.io.File(caminhoArquivoRelatorio + "." + extensao); pdfExportado.setExporterInput(new SimpleExporterInput( impressoraJasper)); pdfExportado.setExporterOutput(new SimpleOutputStreamExporterOutput(arquivoGerado)); pdfExportado.exportReport(); arquivoGerado.deleteOnExit(); InputStream conteudoRelatorio = new FileInputStream(arquivoGerado); arquivoRetorno = new DefaultStreamedContent(conteudoRelatorio, "application/" + extensao, nomeRelatorioSaida + "." + extensao); } catch (JRException e) { throw new UtilException("N�o foi poss�vel gerar o relat�rio.", e); } catch (FileNotFoundException e) { throw new UtilException("Arquivo do relat�rio n�o encontrado.", e); } return arquivoRetorno; } private Connection getConexao() throws UtilException { try { EntityManager manager = ConexaoHibernate.getInstance(); Session session = manager.unwrap(Session.class); session.doWork( new Work() { @Override public void execute(Connection connection) throws SQLException { setConnection(connection); } } ); return this.connection; } catch (Exception e) { throw new UtilException("Não foi possível conectar com o banco de dados para o relatório.", e); } } private void setConnection(Connection connection) { this.connection = connection; } }
[ "Bruno Henrique@DESKTOP-3GBTT7H" ]
Bruno Henrique@DESKTOP-3GBTT7H
d8f0cdd26b5f753bc69b2910532d6a57a72bbd8a
2502775db578b57d2d5f0b1f20a2c651870110de
/TMCProjects/2013-OOProgrammingWithJava-PART2/week7-week7_08.Airport/src/Airport.java
141f3f4efaab877fcbbea7669fa1b437ed407701
[]
no_license
amanbahata/MOOC---tutorials
bd4cffdea1d391651f6a46b5f88016e284121303
067c57ac0beb2d8038fb28f67de88c4d664e6362
refs/heads/master
2021-03-24T12:06:09.075735
2017-11-20T18:07:50
2017-11-20T18:07:50
106,298,878
0
0
null
null
null
null
UTF-8
Java
false
false
1,366
java
import java.util.ArrayList; import java.util.HashMap; public class Airport { private HashMap<Airplane, ArrayList<Flight>> flightList; public Airport(){ this.flightList = new HashMap<Airplane, ArrayList<Flight>>(); } public void addPlane(Airplane airplane){ this.flightList.put(airplane, new ArrayList<Flight>()); } public void addFlight(String airplaneCode, Flight flight){ for (Airplane airplane : this.flightList.keySet()) { if (airplane.getId().equals(airplaneCode)){ this.flightList.get(airplane).add(flight); } } } public void printPlanes(){ for (Airplane airplane : this.flightList.keySet()) { System.out.println(airplane); } } public void printFlights(){ ArrayList<Flight> flights = new ArrayList<Flight>(); for (Airplane airplane : this.flightList.keySet()) { flights = this.flightList.get(airplane); for (Flight flight : flights) { System.out.println(airplane + " " + flight); } } } public void printPlaneInfo(String planeCode){ for (Airplane airplane : this.flightList.keySet()) { if (airplane.getId().equals(planeCode)){ System.out.println(airplane); } } } }
[ "bahataaman@gmail.com" ]
bahataaman@gmail.com
4607cc5a2ac6afa67ebcb278ae6c9e8f583dc4ce
a6914525f7ac77cd60270b2774a07853711f113a
/Acme-HackerRank/src/test/java/services/MiscellaneousDataServiceTest.java
6212d733fe79fa0a4607095c75b1e29a5a6b4459
[]
no_license
antnolang/Acme_Hacker_Rank
ead4a33867ba6ff2f71e6a2db99612efe3dac1f7
3e06b6357b47cdb1507d39c8a5e24c0799e41c57
refs/heads/master
2021-11-04T01:01:04.950746
2019-04-27T07:17:00
2019-04-27T07:17:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,748
java
package services; import javax.transaction.Transactional; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.util.Assert; import repositories.CurriculumRepository; import repositories.MiscellaneousDataRepository; import utilities.AbstractTest; import domain.Curriculum; import domain.MiscellaneousData; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = { "classpath:spring/junit.xml" }) @Transactional public class MiscellaneousDataServiceTest extends AbstractTest { // Service under testing -------------------------------------------------- @Autowired private MiscellaneousDataService miscellaneousDataService; // Other services and repositories ---------------------------------------- @Autowired private MiscellaneousDataRepository miscellaneousDataRepository; @Autowired private CurriculumRepository curriculumRepository; // Tests ------------------------------------------------------------------ /* * A: An actor who is authenticated as a hacker must be able to: Manage his * or her curricula, which includes listing, showing, CREATING, updating, * and deleting them. * * B: Positive test * * C: Approximately 100% of sentence coverage, since it has been covered * 23 lines of code of 23 possible. * * D: Approximately 33% of data coverage, since it has been used 2 * values in the data of 6 different possible values. */ @Test public void miscellaneousDataCreateTest() { MiscellaneousData miscellaneousData, savedMiscellaneousData; Curriculum curriculum; int curriculumId, numberMiscData; String attachments, text; // Data attachments = "https://www.attachment1.com\rhttps://www.attachments2.com\rhttps://www.attachment3.com"; text = "Miscellaneous text test"; super.authenticate("hacker8"); curriculumId = super.getEntityId("curriculum81"); curriculum = this.curriculumRepository.findOne(curriculumId); numberMiscData = curriculum.getMiscellaneousDatas().size(); miscellaneousData = this.miscellaneousDataService.create(); miscellaneousData.setAttachments(attachments); miscellaneousData.setText(text); savedMiscellaneousData = this.miscellaneousDataService.save(miscellaneousData, curriculumId); super.unauthenticate(); Assert.isTrue(curriculum.getMiscellaneousDatas().size() == numberMiscData + 1); Assert.isTrue(curriculum.getMiscellaneousDatas().contains(savedMiscellaneousData)); } /* * A: An actor who is authenticated as a hacker must be able to: Manage his * or her curricula, which includes listing, showing, CREATING, updating, * and deleting them. * * B: The miscellaneous data can only be created in one of the curriculum in * which the hacker principal is owner. * * C: Approximately 87% of sentence coverage, since it has been covered * 20 lines of code of 23 possible. * * D: Approximately 33% of data coverage, since it has been used 2 * values in the data of 6 different possible values. */ @Test(expected = IllegalArgumentException.class) public void miscellaneousDataCreateNegativeTest() { MiscellaneousData miscellaneousData, savedMiscellaneousData; Curriculum curriculum; int curriculumId, numberMiscData; String attachments, text; // Data attachments = "https://www.attachment1.com\rhttps://www.attachments2.com\rhttps://www.attachment3.com"; text = "Miscellaneous text test"; super.authenticate("hacker9"); curriculumId = super.getEntityId("curriculum81"); curriculum = this.curriculumRepository.findOne(curriculumId); numberMiscData = curriculum.getMiscellaneousDatas().size(); miscellaneousData = this.miscellaneousDataService.create(); miscellaneousData.setAttachments(attachments); miscellaneousData.setText(text); savedMiscellaneousData = this.miscellaneousDataService.save(miscellaneousData, curriculumId); super.unauthenticate(); Assert.isTrue(curriculum.getMiscellaneousDatas().size() == numberMiscData + 1); Assert.isTrue(curriculum.getMiscellaneousDatas().contains(savedMiscellaneousData)); } /* * A: An actor who is authenticated as a hacker must be able to: Manage his * or her curricula, which includes listing, showing, creating, UPDATING, * and deleting them. * * B: Positive test * * C: Approximately 100% of sentence coverage, since it has been covered * 33 lines of code of 33 possible. * * D: Approximately 33% of data coverage, since it has been used 2 * values in the data of 6 different possible values. */ @Test public void miscellaneousDataEditTest() { MiscellaneousData miscellaneousData, saved; int miscellaneousDataId; String text; // Data text = "Text Edit test"; super.authenticate("hacker7"); miscellaneousDataId = super.getEntityId("miscellaneousData71"); miscellaneousData = this.miscellaneousDataRepository.findOne(miscellaneousDataId); miscellaneousData = this.cloneMiscellaneousData(miscellaneousData); miscellaneousData.setText(text); saved = this.miscellaneousDataService.save(miscellaneousData); super.unauthenticate(); Assert.isTrue(saved.getText() == text); } /* * A: An actor who is authenticated as a hacker must be able to: Manage his * or her curricula, which includes listing, showing, creating, UPDATING, * and deleting them. * * B: The Miscellaneous Data can only be updated by its owner. * * C: Approximately 18.2% of sentence coverage, since it has been covered * 6 lines of code of 33 possible. * * D: Approximately 33% of data coverage, since it has been used 2 * values in the data of 6 different possible values. */ @Test(expected = IllegalArgumentException.class) public void miscellaneousDataEditNegativeTest() { MiscellaneousData miscellaneousData, saved; int miscellaneousDataId; String text; // Data text = "Text Edit test"; super.authenticate("hacker9"); miscellaneousDataId = super.getEntityId("miscellaneousData71"); miscellaneousData = this.miscellaneousDataRepository.findOne(miscellaneousDataId); miscellaneousData = this.cloneMiscellaneousData(miscellaneousData); miscellaneousData.setText(text); saved = this.miscellaneousDataService.save(miscellaneousData); super.unauthenticate(); Assert.isTrue(saved.getText() == text); } /* * A: An actor who is authenticated as a hacker must be able to: Manage his * or her curricula, which includes listing, showing, creating, updating, * and DELETING them. * * B: Positive test * * C: Approximately 100% of sentence coverage, since it has been covered * 40 lines of code of 40 possible. * * D: 100% of data coverage */ @Test public void miscellaneousDataDeleteTest() { MiscellaneousData miscellaneousData, saved; int miscellaneousDataId; super.authenticate("hacker7"); miscellaneousDataId = super.getEntityId("miscellaneousData71"); miscellaneousData = this.miscellaneousDataRepository.findOne(miscellaneousDataId); this.miscellaneousDataService.delete(miscellaneousData); super.unauthenticate(); saved = this.miscellaneousDataRepository.findOne(miscellaneousDataId); Assert.isTrue(saved == null); } /* * A: An actor who is authenticated as a hacker must be able to: Manage his * or her curricula, which includes listing, showing, creating, updating, * and DELETING them. * * B: The Miscellaneous Data can only be deleted by its owner. * * C: Approximately 15% of sentence coverage, since it has been covered * 6 lines of code of 40 possible. * * D: 100% of data coverage */ @Test(expected = IllegalArgumentException.class) public void miscellaneousDataDeleteNegativeTest() { MiscellaneousData miscellaneousData, saved; int miscellaneousDataId; super.authenticate("hacker9"); miscellaneousDataId = super.getEntityId("miscellaneousData71"); miscellaneousData = this.miscellaneousDataRepository.findOne(miscellaneousDataId); this.miscellaneousDataService.delete(miscellaneousData); super.unauthenticate(); saved = this.miscellaneousDataRepository.findOne(miscellaneousDataId); Assert.isTrue(saved == null); } // Ancillary methods -------------------------------------------------- private MiscellaneousData cloneMiscellaneousData(final MiscellaneousData miscellaneousData) { final MiscellaneousData res = new MiscellaneousData(); res.setAttachments(miscellaneousData.getAttachments()); res.setId(miscellaneousData.getId()); res.setText(miscellaneousData.getText()); res.setVersion(miscellaneousData.getVersion()); return res; } }
[ "antnolangos@gmail.com" ]
antnolangos@gmail.com
3a32ab11f95b94da8c3637b8d90164907cc56d82
e3db8bd7dcca00b240171261da31008796b36a5e
/Racing/app/src/main/java/com/example/dell/racing/DataModel/Score.java
a949e40448a780b28d541e3530f70b1069b9a7c1
[]
no_license
DucDepTraiNhatVuTru/Game-Racing
35d70cc914769a19a7e83f082c715bd4cfc0e6c2
7b4b3fa0f5c2b75114e156a18cf034e248e84386
refs/heads/master
2020-03-18T00:08:29.724753
2018-05-19T16:41:37
2018-05-19T16:41:37
134,079,785
0
0
null
null
null
null
UTF-8
Java
false
false
517
java
package com.example.dell.racing.DataModel; public class Score { private String email; private int score; public Score() { } public Score(String email, int score) { this.email = email; this.score = score; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public int getScore() { return score; } public void setScore(int score) { this.score = score; } }
[ "31755740+DucDepTraiNhatVuTru@users.noreply.github.com" ]
31755740+DucDepTraiNhatVuTru@users.noreply.github.com
7556e82a6bc4d9294bc687514560d217b36b11a0
be702c1cc5bf00b322daddb23476c500e973a193
/android/src/ti/box/calls/RegisterUser.java
bac082ff4dbd507264903f632ee8e9d0c22cd92b
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
appcelerator-archive/ti.box
1ce33ee6c44f96101454d5d4e8d74ca773f1cec2
39346bf7250ba445c6236c52795412441aa2bd62
refs/heads/master
2020-04-10T00:52:29.518780
2017-03-28T20:28:16
2017-03-28T20:28:16
22,700,963
1
1
null
2017-03-28T20:28:17
2014-08-06T22:55:54
Java
UTF-8
Java
false
false
2,014
java
/** * Ti.Box Module * Copyright (c) 2010-2013 by Appcelerator, Inc. All Rights Reserved. * Please see the LICENSE included with this distribution for details. */ package ti.box.calls; import java.io.IOException; import java.util.HashMap; import org.appcelerator.kroll.KrollDict; import org.appcelerator.kroll.KrollFunction; import org.appcelerator.kroll.KrollProxy; import ti.box.Constants; import ti.box.Util; import com.box.androidlib.Box; import com.box.androidlib.DAO.User; import com.box.androidlib.ResponseListeners.RegisterNewUserListener; public class RegisterUser { /** * Prevents instantiation. */ private RegisterUser() {} public static void call(final KrollProxy proxy, HashMap args) { KrollDict argsDict = new KrollDict(args); String username = argsDict.getString("username"); String password = argsDict.getString("password"); final KrollFunction success = (KrollFunction)args.get("success"); final KrollFunction error = (KrollFunction)args.get("error"); final Box box = Box.getInstance(Constants.API_KEY); box.registerNewUser(username, password, new RegisterNewUserListener() { @Override public void onIOException(IOException ex) { Util.handleIOException(proxy, ex, error); } @Override public void onComplete(User user, String status) { if (status.equals("successful_register")) { Util.saveAuthToken(user.getAuthToken()); success.callAsync(proxy.getKrollObject(), new Object[] {}); } else if (status.equals("email_invalid")) { Util.handleError(proxy, "The username you specified is not valid!", status, error); } else if (status.equals("email_already_registered")) { Util.handleError(proxy, "That username is already registered!", status, error); } else if (status.equals("e_register")) { Util.handleError(proxy, "The username or password you specified was not valid!", status, error); } else { Util.handleCommonStatuses(proxy, status, error); } } }); } }
[ "jon@local" ]
jon@local
7c246f11c4bdd4cc86b61b9beda71c2e459fef10
63eb7ef1da3c325e4161aa7a4b1ccd5263e6868f
/app/src/main/java/montoya/girona/joan/idi/fib/acook/Llibre.java
87b810c4e6b0cb3c6d60e6c16658cdf5c611ceb9
[]
no_license
joancmontoya89/ACook
0bcec5a4d9b18cd7671a3605d58ee23f28b2275c
69fbfde4454332009d8bb1e80433bd4b87969243
refs/heads/master
2021-01-19T20:08:23.561268
2017-03-03T00:43:14
2017-03-03T00:43:14
83,739,779
0
0
null
null
null
null
UTF-8
Java
false
false
12,096
java
package montoya.girona.joan.idi.fib.acook; import android.content.Intent; import android.database.Cursor; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.support.v7.app.ActionBarActivity; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; import java.util.ArrayList; public class Llibre extends ActionBarActivity { /** * Atributs privats de la classe Llibre */ private final String LOG_TAG = Llibre.class.getSimpleName(); private ArrayList<ReceptesEntrada> imgs_noms_receptes; private ArrayList<String> tipus_menjar; private ListView lvReceptes; private ListView lvTipus; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_llibre); afegir_ingredients_bd(); inicialitzar_atributs_classe(); get_dades_bd(); //Log.d(LOG_TAG, "Dades tipus: " + tipus_menjar); //Log.d(LOG_TAG, "Noms receptes: " + noms_receptes); carregar_lv(); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_inici, menu); return super.onCreateOptionsMenu(menu); } @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); } public void onClickAddRecepta(View view) { Intent intent = new Intent(this, Afegir_Recepta.class); if (intent.resolveActivity(getPackageManager()) != null) { startActivityForResult(intent, 0); inicialitzar_atributs_classe(); get_dades_bd(); //actualitzem per si hi ha una nova recepta o mod carregar_lv(); } else { Log.e(LOG_TAG, "Error al canviar a la Recepta per afegir-ne una"); } } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { //super.onActivityResult(requestCode, resultCode, data); inicialitzar_atributs_classe(); get_dades_bd(); //actualitzem per si hi ha una nova recepta o mod carregar_lv(); } public void onClickTipusCuina(View view) { Intent intent = new Intent(this, Recepta.class); if (intent.resolveActivity(getPackageManager()) != null) { startActivity(intent); } else { Log.e(LOG_TAG, "Error al canviar a TipusCuina"); } } /** * Metodes privats de la classe */ private void afegir_ingredients_bd() { ArrayList<String> nom_ingredients = new ArrayList<>(); ArrayList<String> mes_ingredients = new ArrayList<>(); // mesura DBHelper dbHelper = DBHelper.getInstance(this); Cursor cursor = dbHelper.selectIngredients(); if (cursor == null || cursor.getCount() == 0) { String m = "ml."; String g = "grams"; String u = "unitat"; String c = "cullaradeta"; nom_ingredients.add("All"); mes_ingredients.add(u); nom_ingredients.add("Arròs"); mes_ingredients.add(g); nom_ingredients.add("Canyella"); mes_ingredients.add(c); nom_ingredients.add("Carn de pollastre"); mes_ingredients.add(g); nom_ingredients.add("Carn de porc"); mes_ingredients.add(g); nom_ingredients.add("Carn de vedella"); mes_ingredients.add(g); nom_ingredients.add("Ceba"); mes_ingredients.add(g); nom_ingredients.add("Cigrons"); mes_ingredients.add(g); nom_ingredients.add("Enciam"); mes_ingredients.add(g); nom_ingredients.add("Espaguetis"); mes_ingredients.add(g); nom_ingredients.add("Espinacs"); mes_ingredients.add(g); nom_ingredients.add("Farina"); mes_ingredients.add(g); nom_ingredients.add("Formatge"); mes_ingredients.add(g); nom_ingredients.add("Iogurt"); mes_ingredients.add(u); nom_ingredients.add("Llet"); mes_ingredients.add(m); nom_ingredients.add("Llevadura de reposteria"); mes_ingredients.add(g); nom_ingredients.add("Llimona"); mes_ingredients.add(u); nom_ingredients.add("Macarrons"); mes_ingredients.add(g); nom_ingredients.add("Mantega"); mes_ingredients.add(g); nom_ingredients.add("Nata liquida"); mes_ingredients.add(m); nom_ingredients.add("Oli de oliva"); mes_ingredients.add(m); nom_ingredients.add("Ous"); mes_ingredients.add(u); nom_ingredients.add("Patata"); mes_ingredients.add(g); nom_ingredients.add("Pernil"); mes_ingredients.add(g); nom_ingredients.add("Sal"); mes_ingredients.add(g); nom_ingredients.add("Sucre"); mes_ingredients.add(c); nom_ingredients.add("Taronja"); mes_ingredients.add(u); nom_ingredients.add("Tomàquet"); mes_ingredients.add(u); nom_ingredients.add("Tonyina en llauna"); mes_ingredients.add(u); nom_ingredients.add("ZZZZZZ"); mes_ingredients.add(u); int n = nom_ingredients.size(); for (int i = 0; i < n; i++) { dbHelper.createIngredient(nom_ingredients.get(i), mes_ingredients.get(i)); } //afegim 5 receptes dbHelper.addRecepta("Ou ferrat", "Preparar amb l oli ben calent i anar posant oli a sobre", "-", "Cuina tradicional"); dbHelper.createParticipa("Ou ferrat", "Ous", 2); dbHelper.createParticipa("Ou ferrat", "Oli de oliva", 20); dbHelper.addRecepta("Arros bullit", "Arros bullit al estil tradicional de sempre", "-", "Cuina tradicional"); dbHelper.createParticipa("Arros bullit", "All", 3); dbHelper.createParticipa("Arros bullit", "Arròs", 100); dbHelper.createParticipa("Arros bullit", "Oli de oliva", 20); dbHelper.addRecepta("Truita francesa", "Preparar amb l oli ben calent i els ous batuts", "-", "Cuina francesa"); dbHelper.createParticipa("Truita francesa", "Ous", 2); dbHelper.createParticipa("Truita francesa", "Oli de oliva", 10); dbHelper.createSubstitutsParticipa("Truita francesa", "Oli de oliva", "Mantega"); dbHelper.addRecepta("Filet de vedella a la planxa", "Posar un raig de oli a la planxa i esperar a que s escalfi be", "-", "Cuina per solters"); dbHelper.createParticipa("Filet de vedella a la planxa", "Carn de vedella", 100); dbHelper.createParticipa("Filet de vedella a la planxa", "Oli de oliva", 3); dbHelper.createParticipa("Filet de vedella a la planxa", "Sal", 1); dbHelper.addRecepta("Suc de taronja", "Expremer les taronges a el expremedor i afegir-hi el sucre", "-", "Natural"); dbHelper.createParticipa("Suc de taronja", "Carn de vedella", 2); dbHelper.createParticipa("Suc de taronja", "Sucre", 3); } //cursor.close(); dbHelper.close(); } private void inicialitzar_atributs_classe() { imgs_noms_receptes = new ArrayList<ReceptesEntrada>(); tipus_menjar = new ArrayList<String>(); //lliguem widgets amb layout lvReceptes = (ListView)findViewById(R.id.lvReceptesInici); lvTipus = (ListView)findViewById(R.id.lvTipusInici); lvReceptes.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) { int pos = i; String nom_r = imgs_noms_receptes.get(pos).getNom_recepta(); Intent intent = new Intent(Llibre.this, Recepta.class); String recepta = "recepta"; intent.putExtra(recepta, nom_r); startActivity(intent); } }); } private void get_dades_bd() { DBHelper dbHelper = DBHelper.getInstance(this); Cursor cursor_receptes = dbHelper.select_recepta(); if ((cursor_receptes != null) && cursor_receptes.getCount() > 0) { cursor_receptes.moveToFirst(); while (!cursor_receptes.isAfterLast()) { String nom = cursor_receptes.getString(cursor_receptes.getColumnIndex( Contract.TRecepta.COLUMN_NOM)); String img = cursor_receptes.getString(cursor_receptes.getColumnIndex( Contract.TRecepta.COLUMN_IMATGE)); ReceptesEntrada re = new ReceptesEntrada(nom, img); imgs_noms_receptes.add(re); cursor_receptes.moveToNext(); } } else { //inserim les receptes inicials } Cursor cursor_tipus = dbHelper.select_tipus_diferents(); if ((cursor_tipus != null) && (cursor_tipus.getCount() > 0)) { cursor_tipus.moveToFirst(); while (!cursor_tipus.isAfterLast()) { String tipus = cursor_tipus.getString(cursor_tipus.getColumnIndex( Contract.TRecepta.COLUMN_TIPUS)); tipus_menjar.add(tipus); cursor_tipus.moveToNext(); } } else { //tipus_menjar.add("-"); } dbHelper.close(); } /* * */ private void carregar_lv() { lvReceptes.setAdapter(new CustomAdapter(this, imgs_noms_receptes) { @Override public void onEntrada(Object entrada, View view) { if (entrada != null) { TextView tvNom_recepta = (TextView) view.findViewById(R.id.nomReceptaLlibre); if (tvNom_recepta != null) tvNom_recepta.setText(((ReceptesEntrada)entrada).getNom_recepta()); ImageView ivRecepta = (ImageView) view.findViewById(R.id.ivReceptaLlibre); if (ivRecepta != null) { //ivRecepta.setImageResource(((Lista_entrada) entrada).get_idImagen()); String img = ((ReceptesEntrada)entrada).getImg_recepta(); Drawable d; if (img.contentEquals("-")) { d = getResources().getDrawable(R.drawable.food); } else { Bitmap imgRecepta = BitmapFactory.decodeFile(img); d = new BitmapDrawable(imgRecepta); } ivRecepta.setBackground(d); } } } }); ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_dropdown_item, tipus_menjar); lvTipus.setAdapter(adapter); } }
[ "joan8989@gmail.com" ]
joan8989@gmail.com
870f87c0af8583fb50252032b1c3e13c61257417
3c68a9f27ba4fbd9340eed8e5fb60b8b60cda3ca
/ot-core/src/main/java/hibernatetest/realm/MyRealm.java
594aa1d17cb55b15c7a6a66a8f9100730ae6f6d5
[]
no_license
ClarkFeng/ot-system
f07d43be5c0e3e023577c4f2f468b23b47e0c8ad
ef476b6860e2b1f2ae8be79308864fea4b520bae
refs/heads/master
2022-07-12T06:42:43.370072
2022-06-30T00:43:43
2022-06-30T00:43:43
104,157,519
0
0
null
null
null
null
UTF-8
Java
false
false
746
java
package hibernatetest.realm; import org.apache.shiro.authc.AuthenticationException; import org.apache.shiro.authc.AuthenticationInfo; import org.apache.shiro.authc.AuthenticationToken; import org.apache.shiro.authz.AuthorizationInfo; import org.apache.shiro.realm.AuthorizingRealm; import org.apache.shiro.subject.PrincipalCollection; public class MyRealm extends AuthorizingRealm { @Override protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) { // TODO Auto-generated method stub return null; } @Override protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException { // TODO Auto-generated method stub return null; } }
[ "2221918807@qq.com" ]
2221918807@qq.com
c4bb348edb7195f85e43ed4b8ddf913de881199b
89b618dc0e58472b93931e31b6dd3a650ea56f0d
/src/main/java/com/decorator/RedShapeDecorator.java
30f02550086d7babfdb87b1e584d34b91687084d
[]
no_license
liuboflyon145/basejava
55d8753207170a2272a44d4dc057b956fafd750e
86cd06ab488e2c71a6dcf5b5a4290fd88234b93d
refs/heads/master
2021-01-11T07:42:44.394364
2017-08-10T09:45:36
2017-08-10T09:45:36
72,631,111
0
0
null
null
null
null
UTF-8
Java
false
false
391
java
package com.decorator; public class RedShapeDecorator extends ShapeDecorator { public RedShapeDecorator(Shape decoratedShape) { super(decoratedShape); } @Override public void draw() { decoratedShape.draw(); setRedBorder(decoratedShape); } private void setRedBorder(Shape decoratedShape){ System.out.println("Border Color: Red"); } }
[ "liubo16@jd.com" ]
liubo16@jd.com
1c3bc7592aac8db08e77806f48ecc7e2fe3492b6
8bb8fc97ce3b836b45af8a5399085bd7e387330e
/mall-coupon/src/main/java/com/future/newmall/coupon/service/MemberPriceService.java
2149cd0f6622dd120e076f6788e544796e441f59
[ "Apache-2.0" ]
permissive
wsq2025/Mall
be83a926d24c6071fee82b0a3c4b86d3b8da298a
d7080f869a00daea425eaa32a6fb31dbd871e444
refs/heads/master
2022-12-24T22:56:09.850029
2020-09-21T14:50:07
2020-09-21T14:50:07
297,369,651
0
0
null
null
null
null
UTF-8
Java
false
false
472
java
package com.future.newmall.coupon.service; import com.baomidou.mybatisplus.extension.service.IService; import com.future.newmall.common.utils.PageUtils; import com.future.newmall.coupon.entity.MemberPriceEntity; import java.util.Map; /** * 商品会员价格 * * @author wsq * @email 673372988@qq.com * @date 2020-09-02 19:32:29 */ public interface MemberPriceService extends IService<MemberPriceEntity> { PageUtils queryPage(Map<String, Object> params); }
[ "673372988@qq.com" ]
673372988@qq.com
b57a29a16ff8a1a90528102a71771426d6937902
c5ddf7d907049e0b1834f7071fadd3ed494a7967
/AgileTE/src/java/agileteservice/src/com/huawei/agilete/northinterface/dao/OTQosVlanDsDAO.java
5ee63be1f233f827811e1e66ba6c53513996374c
[ "MIT" ]
permissive
HuaweiSNC/Huawei_AgileTool
41f75c00f549cfcca025d91a43f6aaec96d2ff88
a998694a52e63d9941924d19d21388dd212219b1
refs/heads/master
2016-09-06T12:47:45.095193
2015-02-08T13:16:59
2015-02-08T13:16:59
27,543,821
0
0
null
2014-12-04T14:48:07
2014-12-04T14:23:02
null
UTF-8
Java
false
false
4,728
java
package com.huawei.agilete.northinterface.dao; import java.util.List; import com.huawei.agilete.base.servlet.MyQosVlanDs; import com.huawei.agilete.data.MyData; import com.huawei.agilete.data.MyData.RestType; import com.huawei.agilete.northinterface.bean.OTQosVlanDs; import com.huawei.networkos.ops.client.OpsRestCaller; import com.huawei.networkos.ops.response.RetRpc; public final class OTQosVlanDsDAO implements IOTDao{ private static OTQosVlanDsDAO single = null; private OpsRestCaller client = null; private OTQosVlanDsDAO(){ } public synchronized static OTQosVlanDsDAO getInstance() { if (single == null) { single = new OTQosVlanDsDAO(); } return single; } public RetRpc control(String domainId, String deviceId, String apiPath, RestType restType,String content){ RetRpc result = new RetRpc(); client = new OpsRestCaller(OTDomainDAO.getInstance().getOpsServer(domainId), deviceId); if(restType.equals(MyData.RestType.GET)){ result = get(apiPath); }else if(restType.equals(MyData.RestType.DELETE)){ result = del(apiPath); }else if(restType.equals(MyData.RestType.POST)){ result = add(content); }else if(restType.equals(MyData.RestType.PUT)){ result = edit(content); }else{ } return result; } public RetRpc add(String content){ RetRpc result = new RetRpc(); OTQosVlanDs oTQosVlanDs = new OTQosVlanDs(content); String bodyPath = oTQosVlanDs.getOpsMessage(); MyQosVlanDs myQosVlanDs =new MyQosVlanDs(client); myQosVlanDs.body=bodyPath; result = myQosVlanDs.create(null); return result; } public RetRpc edit(String content){ RetRpc result = new RetRpc(); OTQosVlanDs oTQosVlanDs = new OTQosVlanDs(content); String bodyPath = oTQosVlanDs.getOpsMessage(); MyQosVlanDs myQosVlanDs =new MyQosVlanDs(client); myQosVlanDs.body=bodyPath; result = myQosVlanDs.modify(null); return result; } public RetRpc del(String apiPath){ RetRpc result = new RetRpc(); if(null != apiPath && !"".equals(apiPath)){ MyQosVlanDs myQosVlanDs =new MyQosVlanDs(client); myQosVlanDs.body = apiPath; result = myQosVlanDs.delete(null); }else{ result.setStatusCode(500); result.setContent("Error!ApiPath is null!"); } return result; } public RetRpc get(String apiPath){ RetRpc opsresult = new RetRpc(); List<OTQosVlanDs> list = getList(apiPath); if(null != list){ OTQosVlanDs oTQosVlanDs = new OTQosVlanDs(); String flag = oTQosVlanDs.getUiMessage(list); opsresult.setContent(flag); }else{ opsresult.setStatusCode(500); opsresult.setContent("Error!"); } return opsresult; } public List<OTQosVlanDs> getList(String apiPath){ List<OTQosVlanDs> list = null; MyQosVlanDs myQosVlanDs =new MyQosVlanDs(client); String[] name = null; if(!"".equals(apiPath)){ name = new String[]{apiPath}; } RetRpc opsresult = myQosVlanDs.get(name); if(opsresult.getStatusCode()==200){ OTQosVlanDs oTQosVlanDs = new OTQosVlanDs(); list = oTQosVlanDs.parseOpsToUi(opsresult.getContent()); } return list; } public static void main(String[] args) { //String content = "<tunnels><tunnel><name>Tunnel4</name><interfaceName>Tunnel4</interfaceName><identifyIndex>502</identifyIndex><ingressIp>4.4.4.4</ingressIp><egressIp>2.2.2.2</egressIp><hotStandbyTime>15</hotStandbyTime><isDouleConfig>false</isDouleConfig><desDeviceName>123</desDeviceName><tunnelPaths><tunnelPath><pathType>hot_standby</pathType>backup<pathName>path</pathName><lspState>down</lspState></tunnelPath></tunnelPaths><paths><path><name>path</name><nextHops><nextHop><id>1</id><nextIp>10.1.1.1</nextIp></nextHop></nextHops></path></paths></tunnel></tunnels>"; //OTQosVlanDsDAO.getInstance().get("1", "5", ""); /*//System.out.println(OTQosVlanDsDAO.getInstance().edit("1", "5", "<policys><policy><name>PolicyTunnel10</name><tpNexthops><tpNexthop><nexthopIPaddr>1.1.1.1</nexthopIPaddr><tpTunnels><tpTunnel><tunnelName>Tunnel1</tunnelName></tpTunnel></tpTunnels></tpNexthop></tpNexthops></policy></policys>"));*/ } public OpsRestCaller getClient() { return client; } public void setClient(OpsRestCaller client) { this.client = client; } }
[ "styu28_48@163.com" ]
styu28_48@163.com
f06dedb250b051b161f81f4f48e883abb1e93a8f
13e18b68a4883c2f1c86d76aeb39ca1c0af6228c
/Parcial1-G04/src/tipos/modelos/GestorTipos.java
34e75c35cf51f971d9ae97faf2b8d41bb16b87d6
[]
no_license
mauruiz20/NuevoRepositorio1
c09283b7a2632e741becd3b1464346b2fd73b39c
810c3910ea1af82352e97d739b4f63d881e809bd
refs/heads/master
2023-01-12T20:24:18.828215
2020-11-12T20:26:34
2020-11-12T20:26:34
303,881,279
0
0
null
2020-11-12T20:27:32
2020-10-14T02:27:49
Java
UTF-8
Java
false
false
1,221
java
package tipos.modelos; import interfaces.IGestorTipos; import java.util.ArrayList; public class GestorTipos implements IGestorTipos{ private ArrayList<Tipo> tipos = new ArrayList<>(); private static GestorTipos instancia; private GestorTipos(){ } public static GestorTipos crear(){ if(instancia == null) instancia = new GestorTipos(); return instancia; } @Override public String nuevoTipo(String nombre) { if((!nombre.isBlank()) && (nombre != null)){ Tipo unTipo = new Tipo(nombre); if(!tipos.contains(unTipo)){ tipos.add(unTipo); return TIPO_EXITO; } else{ return TIPO_REPETIDO; } }else { return TIPO_NOMBRE_INCORRECTO; } } @Override public ArrayList<Tipo> verTipos() { return tipos; } @Override public Tipo verTipo(String nombre) { for(Tipo t : tipos){ if(t.verNombre().equalsIgnoreCase(nombre)){ return t; } } return null; } }
[ "maumarruiz@hotmail.com" ]
maumarruiz@hotmail.com
77d45390d763e8da2234e1938417ff2b899509fd
07daf7ea6fb4e556a81b3de5e54493d412dae29e
/app/src/main/java/com/cjt/employment/presenter/ProjectEditPresenter.java
0065c66b1e32a46d0d68d83fe44c280292d96333
[]
no_license
my1622/Employment
a275b3de7d1cc2d9fb4dadc6be659e0239216037
958c809890e8542628bb0d6723d56aaf542ad9c5
refs/heads/master
2020-04-05T03:17:43.135610
2017-04-06T07:54:48
2017-04-06T07:54:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,172
java
package com.cjt.employment.presenter; import android.util.Log; import com.cjt.employment.bean.UpdateResult; import com.cjt.employment.model.EducationEditModelImp; import com.cjt.employment.model.Imodel.EducationEditModel; import com.cjt.employment.model.Imodel.ProjectEditModel; import com.cjt.employment.model.ProjectEditModelImp; import com.cjt.employment.ui.activity.ProjectEditActivity; import rx.android.schedulers.AndroidSchedulers; import rx.functions.Action1; import rx.schedulers.Schedulers; /** * 作者: 陈嘉桐 on 2016/9/28 * 邮箱: 445263848@qq.com. */ public class ProjectEditPresenter extends BasePresenter<ProjectEditActivity> { private ProjectEditModel mProjectEditModel; public ProjectEditPresenter() { mProjectEditModel = ProjectEditModelImp.getInstance(); } public void addProject(String action, String id, String projectname, String responsibility, String starttime, String endtime, String content) { if (mProjectEditModel != null) { // getView().showProgressBar(); mProjectEditModel.addProject(action, id, projectname, responsibility, starttime, endtime, content) .subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Action1<UpdateResult>() { @Override public void call(UpdateResult updateResult) { if (updateResult.getResult().equals("success")) { Log.i("CJT", "success"); // getView().updateSuccess(); } else { // getView().updateFail(); } } }, new Action1<Throwable>() { @Override public void call(Throwable throwable) { Log.i("RxJava", "又是在这里出现了问题呀----->" + throwable.toString()); } }); } else { Log.i("CJT", "model is null"); } } }
[ "445263848@qq.com" ]
445263848@qq.com
19578d5513ba62ff614b8670d2d3352fda193c11
f061512dff06ecd3490fb0ad62ba293ce786c878
/OmniDexter/src/com/omnidex/weather/FieldWeather.java
90855cbc52fd83539e44a28d37cfd42f441678ee
[]
no_license
jakers/OmniDexter
b2029b969317a05012987c8d99e45e9d24e497ea
24e4a53b57e23d5a6633000bfbbb804b06f4957d
refs/heads/master
2021-01-18T14:33:45.708711
2013-08-23T02:17:06
2013-08-23T02:17:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,214
java
package com.omnidex.weather; /** * Creation Date: 3/10/2012 * @author Akers */ public class FieldWeather implements Weather { private boolean isRain; private boolean isClear; private boolean isFog; private boolean isSand; private boolean isHail; private boolean isSun; private int duration; static final int DUR_0 = 0; static final int DUR_5 = 5; static final int DUR_8 = 8; static final int DUR_INF = -1; // SUN and RAIN modifiers static final double RAIN_FIRE_NEG_MOD = 0.5; static final double RAIN_WATER_BOOST_MOD = 2.0; static final double SUN_FIE_BOOST_MOD = 2.0; static final double SUN_WATER_NEG_MOD = 0.5; public FieldWeather() { clearWeather(); } public FieldWeather(Weather weather) { isRain = weather.isRain(); isClear = weather.isClear(); isFog = weather.isFog(); isSand = weather.isSand(); isHail = weather.isHail(); isSun = weather.isSun(); duration = weather.getDuration(); } /** * Decreases the duration of the current weather by 1. If the duration of * the weather becomes zero then the weather is set to NO_WEATHER. */ public int getDuration() { return duration; } /** * Returns the number of turns the weather will be in play. * * @return an int representing the number of turns that the current weather * will be in effect. A return value of -1 indicates infinite * weather condition. */ public void decrementDuration() { if (duration > 0) { duration--; if (duration == 0) { clearWeather(); } } } /** * @return a boolean representing whether or not the current weather * condition is no weather. */ public boolean isClear() { return isClear; } /** * @return a boolean representing whether or not the current weather * condition is Fog. */ public boolean isFog() { return isFog; } /** * @return a boolean representing whether or not the current weather * condition is Hail. */ public boolean isHail() { return isHail; } /** * @return a boolean representing whether or not the current weather * condition is Rain. */ public boolean isRain() { return isRain; } /** * @return a boolean representing whether or not the current weather * condition is Sand. */ public boolean isSand() { return isSand; } /** * @return a boolean representing whether or not the current weather * condition is Sun. */ @Override public boolean isSun() { return isSun; } /** * Sets the current weather condition to No Weather and sets the duration. */ public void setClear() { clearWeather(); } /** * Sets the current weather condition to Fog and sets the duration of the * weather effect. * * @param duration * an int representing how long the Fog will last. */ public void setFog(int duration) { clearWeather(); isClear = false; isFog = true; this.duration = duration; } /** * Sets the current weather condition to Hail and sets the duration of the * weather effect. * * @param duration * an int representing how long the Hail will last. */ @Override public void setHail(int duration) { clearWeather(); isClear = false; isHail = true; this.duration = duration; } /** * Sets the current weather condition to Rain and sets the duration of the * weather effect. * * @param duration * an int representing how long the Rain will last. */ public void setRain(int duration) { clearWeather(); isClear = false; isRain = true; this.duration = duration; } /** * Sets the current weather condition to Sand and sets the duration of the * weather effect. * * @param duration * an int representing how long the Sand will last. */ public void setSand(int duration) { clearWeather(); isClear = false; isSand = true; this.duration = duration; } /** * Sets the current weather condition to Sun and sets the duration of the * weather effect. * * @param duration * an int representing how long the Sun will last. */ public void setSun(int duration) { clearWeather(); isClear = false; isSun = true; this.duration = duration; } private void clearWeather() { isClear = true; isRain = false; isSun = false; isSand = false; isFog = false; isHail = false; duration = DUR_INF; } public String getWeatherCondition() { String condition = "Foggy"; if (isClear) { condition = "Clear"; } else if (isRain) { condition = "Raining"; } else if (isSun) { condition = "Sunny"; } else if (isSand) { condition = "Sandstorm"; } else if (isHail) { condition = "Hailing"; } return condition; } }
[ "akersjesse3@gmail.com" ]
akersjesse3@gmail.com
e46d0590f58cd33800e1cf490c13fb20d85b0b6e
9308448947d0334d62d61c8571523821afcd67c7
/service/src/main/java/com.mark/pt/factory/Sender.java
a258fce111fed31596835f7670179b53f32f9ce7
[]
no_license
fellowlei/mywork
c39a4307696abcd4ee8fce8eae439b6139c3f6c7
e8258788fc6137a9730c2fe9ac03b17a2caa6971
refs/heads/master
2021-01-17T13:25:38.541371
2018-11-09T09:13:07
2018-11-09T09:13:07
58,213,000
0
0
null
null
null
null
UTF-8
Java
false
false
124
java
package com.mark.pt.factory; /** * Created by lulei on 2016/5/25. */ public interface Sender { public void send(); }
[ "lulei@jd.com" ]
lulei@jd.com
2fe9cc067f66b16965e766f785ff34df7767e2b3
b111b77f2729c030ce78096ea2273691b9b63749
/db-example-large-multi-project/project16/src/test/java/org/gradle/test/performance/mediumjavamultiproject/project16/p80/Test1618.java
af3b3e9a2a0ac8d4fca1cd60b4e9074c1a839321
[]
no_license
WeilerWebServices/Gradle
a1a55bdb0dd39240787adf9241289e52f593ccc1
6ab6192439f891256a10d9b60f3073cab110b2be
refs/heads/master
2023-01-19T16:48:09.415529
2020-11-28T13:28:40
2020-11-28T13:28:40
256,249,773
1
0
null
null
null
null
UTF-8
Java
false
false
2,555
java
package org.gradle.test.performance.mediumjavamultiproject.project16.p80; import org.junit.Test; import static org.junit.Assert.*; public class Test1618 { Production1618 objectUnderTest = new Production1618(); @Test public void testProperty0() throws Exception { String value = "value"; objectUnderTest.setProperty0(value); Thread.sleep(250); assertEquals(value, objectUnderTest.getProperty0()); } @Test public void testProperty1() throws Exception { String value = "value"; objectUnderTest.setProperty1(value); Thread.sleep(250); assertEquals(value, objectUnderTest.getProperty1()); } @Test public void testProperty2() throws Exception { String value = "value"; objectUnderTest.setProperty2(value); Thread.sleep(250); assertEquals(value, objectUnderTest.getProperty2()); } @Test public void testProperty3() throws Exception { String value = "value"; objectUnderTest.setProperty3(value); Thread.sleep(250); assertEquals(value, objectUnderTest.getProperty3()); } @Test public void testProperty4() throws Exception { String value = "value"; objectUnderTest.setProperty4(value); Thread.sleep(250); assertEquals(value, objectUnderTest.getProperty4()); } @Test public void testProperty5() throws Exception { String value = "value"; objectUnderTest.setProperty5(value); Thread.sleep(250); assertEquals(value, objectUnderTest.getProperty5()); } @Test public void testProperty6() throws Exception { String value = "value"; objectUnderTest.setProperty6(value); Thread.sleep(250); assertEquals(value, objectUnderTest.getProperty6()); } @Test public void testProperty7() throws Exception { String value = "value"; objectUnderTest.setProperty7(value); Thread.sleep(250); assertEquals(value, objectUnderTest.getProperty7()); } @Test public void testProperty8() throws Exception { String value = "value"; objectUnderTest.setProperty8(value); Thread.sleep(250); assertEquals(value, objectUnderTest.getProperty8()); } @Test public void testProperty9() throws Exception { String value = "value"; objectUnderTest.setProperty9(value); Thread.sleep(250); assertEquals(value, objectUnderTest.getProperty9()); } }
[ "nateweiler84@gmail.com" ]
nateweiler84@gmail.com
09c5361e08d76ee6bb7325176ff52781f1e5ecaf
b10a8ddb306fb0490ddebd188a2bace643ac9ca5
/melting-pot/net.imagej/imagej-common/src/main/java/net/imagej/options/OptionsConversions.java
a87ccfba5552e57fcad0e21f6e5a66112be34f41
[ "BSD-2-Clause", "Apache-2.0", "NetCDF" ]
permissive
BobHanson/scifio-SwingJS
2436a7fa16efe6c3134cf5747ed4f9d7dba84f9a
5c2b581f0ab78c0d1fc4f1fbbc028bb8983107f6
refs/heads/master
2020-12-01T15:46:46.351229
2020-01-22T23:24:52
2020-01-22T23:24:52
230,685,282
0
0
null
null
null
null
UTF-8
Java
false
false
2,938
java
/* * #%L * ImageJ software for multidimensional image processing and analysis. * %% * Copyright (C) 2009 - 2017 Board of Regents of the University of * Wisconsin-Madison, Broad Institute of MIT and Harvard, and Max Planck * Institute of Molecular Cell Biology and Genetics. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * #L% */ package net.imagej.options; import org.scijava.menu.MenuConstants; import org.scijava.options.OptionsPlugin; import org.scijava.plugin.Attr; import org.scijava.plugin.Menu; import org.scijava.plugin.Parameter; import org.scijava.plugin.Plugin; /** * Runs the Edit::Options::Conversions dialog. * * @author Barry DeZonia */ @Plugin(type = OptionsPlugin.class, menu = { @Menu(label = MenuConstants.EDIT_LABEL, weight = MenuConstants.EDIT_WEIGHT, mnemonic = MenuConstants.EDIT_MNEMONIC), @Menu(label = "Options", mnemonic = 'o'), @Menu(label = "Conversions...", weight = 11) }, attrs = { @Attr(name = "no-legacy") }) public class OptionsConversions extends OptionsPlugin { @Parameter(label = "Scale When Converting") private boolean scaleWhenConverting = true; @Parameter(label = "Weighted RGB Conversions") private boolean weightedRgbConversions = false; // -- OptionsConversions methods -- public boolean isScaleWhenConverting() { return scaleWhenConverting; } public boolean isWeightedRgbConversions() { return weightedRgbConversions; } public void setScaleWhenConverting(final boolean scaleWhenConverting) { this.scaleWhenConverting = scaleWhenConverting; } public void setWeightedRgbConversions(final boolean weightedRgbConversions) { this.weightedRgbConversions = weightedRgbConversions; } }
[ "hansonr@stolaf.edu" ]
hansonr@stolaf.edu
11d75705404f41c9a7702d083c98240ef013be5b
55900c2ec0ecf2d660f9e3be0e17344aca1229b2
/app/SplashExample/app/src/test/java/com/example/seungsoo/splashexample/ExampleUnitTest.java
e682769642d0f17c94be5f42c4660d2531b10948
[]
no_license
HyeongGunLee/Battery-24-7
201168039ef18df935737629eb8f36009979820e
a42f93c5ecc6cc833074750ba8f4f116015db8d9
refs/heads/master
2020-03-07T06:54:40.410906
2018-03-16T08:26:36
2018-03-16T08:26:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
412
java
package com.example.seungsoo.splashexample; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "nablekim94@gmail.com" ]
nablekim94@gmail.com
07bf5247464a392043ba7feabe345f0eb14f1e41
881c19a2a6a6d211bf811beef03439343026d4d3
/11-ribbon-demo01/src/main/java/com/example/ribbondemo/controller/HelloController.java
1608e2fb5a2fdb09b337282eceafae045955997d
[]
no_license
ReExia/learn-spring-cloud
d43cc3ce07dc66b8fe0499b2d3fc8bc186d28f1e
dc89c5bf5e1c54bedf1d87da0490c5b50c275c61
refs/heads/master
2020-04-11T18:40:16.207800
2018-12-22T13:59:58
2018-12-22T13:59:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
522
java
package com.example.ribbondemo.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.client.RestTemplate; @RestController public class HelloController { @Autowired RestTemplate restTemplate; @RequestMapping("/hello") public String hello(){ System.out.println("hello ribbon"); return "hello ribbon"; } }
[ "liu1023434681@qq.com" ]
liu1023434681@qq.com
3371358d9a8f2eeb3ddeb595f64fe10115f32a6e
c472eb20e6ef598ab0d9541676bc469a900648e1
/src/main/java/msf/MessageSupportFactory.java
457db4ba02cd90ece336fd04ad4786e5af60d552
[]
no_license
AlekSanVik47/spring_study
bb0adb53ed44acb6362e8fff115e96e41a9cb135
caf429bb055ca2ed39e7bd0eb903f3c8290d1955
refs/heads/master
2023-04-04T02:48:30.259065
2021-04-19T18:56:56
2021-04-19T18:56:56
351,202,925
0
0
null
null
null
null
UTF-8
Java
false
false
1,326
java
package msf; import realizationHelloWorld.MessageProvider; import realizationHelloWorld.MessageRenderer; import java.util.Properties; public class MessageSupportFactory { private static MessageSupportFactory instance; private Properties props; private MessageRenderer renderer; private MessageProvider provider; private MessageSupportFactory() { props = new Properties(); try { props.load(this.getClass().getResourceAsStream( "/msf.properties")); String rendererClass = props.getProperty( "renderer.class"); String providerClass = props.getProperty( "provider.class"); renderer = ( MessageRenderer ) Class.forName(rendererClass).newInstance(); provider = ( MessageProvider ) Class.forName(providerClass).newInstance(); } catch (Exception ex) { ex.printStackTrace(); } } static { instance = new MessageSupportFactory(); } public static MessageSupportFactory getInstance() { return instance; } public MessageRenderer getMessageRenderer() { return renderer; } public MessageProvider getMessageProvider() { return provider; } }
[ "qa_aleksvik@outlook.com" ]
qa_aleksvik@outlook.com
e879bcca35af0e70088f4e4509e47d0057bf874e
421f0a75a6b62c5af62f89595be61f406328113b
/generated_tests/model_seeding/54_db-everywhere-com.gbshape.dbe.struts.bean.MessageBean-0.5-2/com/gbshape/dbe/struts/bean/MessageBean_ESTest.java
19a663a71cae79c87ed2f67a3ff7763a2dbc2b52
[]
no_license
tigerqiu712/evosuite-model-seeding-empirical-evaluation
c78c4b775e5c074aaa5e6ca56bc394ec03c2c7c6
11a920b8213d9855082d3946233731c843baf7bc
refs/heads/master
2020-12-23T21:04:12.152289
2019-10-30T08:02:29
2019-10-30T08:02:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
655
java
/* * This file was automatically generated by EvoSuite * Tue Oct 29 09:45:15 GMT 2019 */ package com.gbshape.dbe.struts.bean; import org.junit.Test; import static org.junit.Assert.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true, useJEE = true) public class MessageBean_ESTest extends MessageBean_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pderakhshanfar@bsr01.win.tue.nl" ]
pderakhshanfar@bsr01.win.tue.nl
b938cc8f4043b89ef5fd17b5ce212d5ca28e3559
1d645092d2673c4d709227881c6727045592efe0
/hadoop/src/main/java/cs455/hadoop/analyzesongs/ReduceJoiner.java
56f0187142f4c0b13fd7fd77a135f117ec00a288
[]
no_license
eholmgre/cs455
0b5a0640cae8e9df3f632824bfdbd7c10d646ad4
1fd780c7ebf09dfc73bf8546081a45cbd030c4cd
refs/heads/master
2020-04-19T01:28:16.269852
2019-04-18T22:40:03
2019-04-18T22:40:03
167,872,977
0
0
null
null
null
null
UTF-8
Java
false
false
857
java
package cs455.hadoop.analyzesongs; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.Reducer; import java.io.IOException; public class ReduceJoiner extends Reducer<Text, Text, Text, Text>{ public void reduce(Text key, Iterable<Text> values, Context context) throws IOException, InterruptedException { for (Text t : values) { String record = t.toString(); String []parts = record.split(","); if (parts[0].contains("metadata")) { context.write(new Text("metadata"), new Text(record)); } else if (parts[0].contains("analysis")) { context.write(new Text("analysis"), new Text(record)); } else { context.write(new Text("what"), new Text(record)); //aww hell what happened } } } }
[ "erik@erikholmgren.com" ]
erik@erikholmgren.com
98961cb533b756753e28d54f4e3e13bf120a0dd9
d646b3c61d9b50ec2c6e839308eb88cf85b17a9c
/Networking/ApacheHttp/src/main/java/br/com/esec/rest/client/ApacheHttpClientGet.java
4757c464ef0db8bbe8107be668ad67bd46dce2ec
[]
no_license
FLSouza/Java-SE-Exemplos
ed8c9bd164379085c7a672d8328608b098946fa0
d8ed049f5c581a0eed8b0d5bf75254afeaf63859
refs/heads/master
2021-01-21T14:44:17.033929
2016-12-02T20:26:25
2016-12-02T20:26:25
58,232,615
0
1
null
2016-07-14T19:15:23
2016-05-06T20:16:31
Java
UTF-8
Java
false
false
1,549
java
package br.com.esec.rest.client; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import org.apache.http.HttpResponse; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.DefaultHttpClient; // Exemplo de consumo do REST com GET utilizando Apache HttpComponents public class ApacheHttpClientGet { // http://localhost:8080/ApacheHttp/json/product/get public static void main(String[] args) { try { DefaultHttpClient httpClient = new DefaultHttpClient(); HttpGet getRequest = new HttpGet( "http://localhost:8080/ApacheHttp/json/product/get"); getRequest.addHeader("accept", "application/json"); HttpResponse response = httpClient.execute(getRequest); if (response.getStatusLine().getStatusCode() != 200) { throw new RuntimeException("Failed : HTTP error code : " + response.getStatusLine().getStatusCode()); } BufferedReader br = new BufferedReader(new InputStreamReader( (response.getEntity().getContent()))); String output; System.out.println("Output from Server .... \n"); while ((output = br.readLine()) != null) { System.out.println(output); } httpClient.getConnectionManager().shutdown(); } catch (ClientProtocolException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
[ "felipelara@Felipes-MacBook-Pro.local" ]
felipelara@Felipes-MacBook-Pro.local
233c7fdbc02bc7993a6006c57c435cf37c8d814c
592fe9081e48f984b1619f10cf6e2025cdb7544d
/src/main/java/com/performance/artigo/ServletInitializer.java
3afcf82744ea5d46d54624c620ca14f504996a69
[]
no_license
rodrigo-sntg/artigo-jpa
5a9ec0152a9c44b010cde5b459e33690c636ed67
20f5a114cf9c8d647396f6a01dc4a0010f57fa5d
refs/heads/master
2022-11-08T07:08:50.096415
2020-06-27T21:19:09
2020-06-27T21:19:09
275,454,462
0
0
null
null
null
null
UTF-8
Java
false
false
420
java
package com.performance.artigo; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; public class ServletInitializer extends SpringBootServletInitializer { @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(JpaPerformanceApplication.class); } }
[ "digo_santiago@hotmail.com" ]
digo_santiago@hotmail.com
dcebc960e0de09ddf8139ab210f41ba96a14c8a8
4112e80f3dadde1129d5542cd66dbf3b1344b724
/src/main/java/com/simsilica/lemur/anim/AnimationState.java
ec69b8166f71a840d5ec87615f17ff2f3bb949b3
[ "BSD-3-Clause" ]
permissive
tomreineke/Lemur
4b25843faaae0adaa9f3421618f0b2bd34164e8d
a161a12c55be58089049ef25ff16fa18cba34f04
refs/heads/master
2020-04-08T07:24:33.190659
2018-11-27T08:28:47
2018-11-27T08:28:47
159,137,836
0
0
null
2018-11-26T08:47:03
2018-11-26T08:47:02
null
UTF-8
Java
false
false
4,743
java
/* * $Id$ * * Copyright (c) 2015, Simsilica, LLC * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. Neither the name of the copyright holder nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. */ package com.simsilica.lemur.anim; import java.util.*; import com.jme3.app.Application; import com.jme3.app.state.BaseAppState; /** * Manages a list of Animation tasks, calling them each once * per frame until done or canceled. * * @author Paul Speed */ public class AnimationState extends BaseAppState { public static final double NANOS_TO_SECONDS = 1 / 1000000000.0; private static AnimationState defaultInstance; private final List<Animation> tasks = new ArrayList<Animation>(); private Animation[] array = null; private long lastTime; public AnimationState() { if( defaultInstance == null ) { defaultInstance = this; } } /** * Returns the default animation state instance. */ public static AnimationState getDefaultInstance() { return defaultInstance; } /** * Returns true if the specified animation object is * currently running, ie: will be executed this frame. */ public boolean isRunning( Animation anim ) { return tasks.contains(anim); } /** * Begins executing the specified animation. The passed * animation is returned directly to the caller. */ public <T extends Animation> T add( T anim ) { tasks.add(anim); array = null; return anim; } /** * Creates a TweenAnimation from the specified tween or * tweens. If more than one Tween is passed then they are wrapped * in a sequence. */ public TweenAnimation add( Tween... sequence ) { TweenAnimation anim = new TweenAnimation(sequence); return add(anim); } /** * Cancels a currently running animation. */ public void cancel( Animation anim ) { anim.cancel(); remove(anim); } private Animation[] getArray() { if( array == null ) { array = new Animation[tasks.size()]; array = tasks.toArray(array); } return array; } protected void remove( Animation anim ) { tasks.remove(anim); array = null; } @Override protected void initialize( Application app ) { } @Override protected void cleanup( Application app ) { // Seems prudent to cancel all of them and let // any cleanup get done that is required for( Animation a : getArray() ) { cancel(a); } // See if there is another one after we've been removed defaultInstance = getState(AnimationState.class); } @Override protected void onEnable() { lastTime = System.nanoTime(); } @Override public void update( float tpf ) { long time = System.nanoTime(); long delta = time - lastTime; double t = delta * NANOS_TO_SECONDS; lastTime = time; for( Animation a : getArray() ) { if( !a.animate(t) ) { remove(a); } } } @Override protected void onDisable() { } }
[ "reineke@apt-solutions.de" ]
reineke@apt-solutions.de
24be7f82a3d1f85119b571ba684c6f70bcc71a22
a0edff29e8b80c399deb62abcb22af0d13181e42
/src/test/java/it/polimi/ingsw/GC_36/model/GameTest.java
760118a9c76ac2ad6134515fc51731ce51cd397a
[]
no_license
mirkosalaris/lorenzoIlMagnifico
4a2c537df2440776db5b6b91023d88f357af6d46
162c1ad7ae91dafcc579ed254bb5303792931546
refs/heads/master
2022-06-04T17:14:30.685888
2017-07-10T10:10:16
2017-07-10T10:19:15
87,698,924
0
0
null
2022-05-20T20:52:19
2017-04-09T09:58:38
Java
UTF-8
Java
false
false
3,787
java
package it.polimi.ingsw.GC_36.model; import it.polimi.ingsw.GC_36.client.User; import it.polimi.ingsw.GC_36.client.view.ViewCLI; import it.polimi.ingsw.GC_36.observers.GameObserver; import it.polimi.ingsw.GC_36.server.ParticipantRMI; import it.polimi.ingsw.GC_36.utils.Pair; import org.junit.After; import org.junit.Before; import org.junit.Test; import java.lang.reflect.Field; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; public class GameTest { Game game; @Before public void setUp() throws Exception { game = new Game(); Map<PlayerColor, Player> players = new HashMap<>(); Player player1 = new Player(PlayerColor.BLUE, new ParticipantRMI(new User(new ViewCLI()))); Player player2 = new Player(PlayerColor.BLUE, new ParticipantRMI(new User(new ViewCLI()))); players.put(PlayerColor.BLUE, player1); players.put(PlayerColor.BLUE, player2); game.setPlayers(players); player1.init(new PersonalBoard(1)); player2.init(new PersonalBoard(2)); game.subscribe(player1.getParticipant()); game.subscribe(player2.getParticipant()); } @After public void tearDown() throws Exception { } @Test public void getInstance() throws Exception { assertEquals("game retrieved in wrong way", game, Game.getInstance()); } @Test public void getBoard() throws Exception { Field field = game.getClass().getDeclaredField("board"); field.setAccessible(true); assertEquals("board retrieved in wrong way", field.get(game), game.getBoard()); } @Test public void getCurrentPeriod() throws Exception { final Field field = game.getClass().getDeclaredField("currentPeriod"); field.setAccessible(true); assertEquals("currentPeriod retrieved in wrong way", field.get(game), game.getCurrentPeriod()); } @Test public void getState() throws Exception { final Field field = game.getClass().getDeclaredField("currentState"); field.setAccessible(true); assertEquals("Game state is retrieved in the wrong way", field.get(game), game.getState()); game.start(); // now the gameState should have changed (but we don't have to test if // it has changed, it is just to do a second check) assertEquals("Game state is retrieved in the wrong way", field.get(game), game.getState()); } @Test public void start() throws Exception { // the only thing you can test is that after start the field state // should be set to GameState.PLAYING game.start(); final Field field = game.getClass().getDeclaredField("currentState"); field.setAccessible(true); assertEquals("Game state is wrong after finishing running", field.get(game), GameState.PLAYING); } @Test public void subscribe() throws Exception { // check if subscribe actually add observers to the set of observers // The check is done with two observers, just to be sure GameObserver o1 = new GameObserver() { @Override public void update(GameState newState) {} @Override public void update(int periodNumber) {} @Override public void update( List<Pair<PlayerIdentifier, Integer>> winningOrderList) { } }; GameObserver o2 = new GameObserver() { @Override public void update(GameState newState) {} @Override public void update(int periodNumber) {} @Override public void update( List<Pair<PlayerIdentifier, Integer>> winningOrderList) { } }; game.subscribe(o1); game.subscribe(o2); final Field fieldList = game.getClass().getDeclaredField("observers"); fieldList.setAccessible(true); @SuppressWarnings("unchecked") Set<GameObserver> set = (Set<GameObserver>) fieldList.get(game); assertTrue(set.contains(o1) && set.contains(o2)); } }
[ "salarismirko@gmail.com" ]
salarismirko@gmail.com
360b2db65decb80968bfd87cbf3a8bea53ee2c5a
0747b5a501c7579e125b6578ad97c8ce563c600b
/jvmana/src/main/java/loadprocess/init/NotInitialialization.java
cd79b5d025b6f76dbba739febae4461c660b340e
[]
no_license
zhang6622056/NeroJavaEE
07a5afa948f60ca7d34c7f40d087080b93543842
c7ca16f058ca85f4536d210adf4e55ff4488d0f7
refs/heads/master
2020-03-16T15:06:31.795315
2018-09-11T12:49:16
2018-09-11T12:49:16
125,844,609
0
0
null
null
null
null
UTF-8
Java
false
false
1,216
java
package loadprocess.init; /**** * 以下3种情况都不会触发类的初始化阶段 * 在类的加载过程中,不会立即触发初始化阶段 */ public class NotInitialialization { /**** * 被动引用一:引用父类初始化 * 通过子类引用父类,只会触发父类的初始化阶段,而不会触发子类的初始化阶段 * 输出结果为 * Super class Init * 3 */ // public static void main(String[] args) { // System.out.println(SubClass.value); // } /**** * 被动引用二:数组初始化 * 被动引用案例 数组案例 * 并不会触发SuperClass的初始化阶段 * 实际为 new Array * @param args */ // public static void main(String[] args) { // SuperClass[] sca = new SuperClass[10]; // } /**** * 被动引用三:静态常量跨类引用 * 在编译成class阶段,就已经将ConstClass的变量传递给NotInitialialization类的常量池中 * 在编译完成后,其实已经和ConstClass没有任何关系了。 * @param args */ public static void main(String[] args) { System.out.println(ConstClass.HELLOWORLD); } }
[ "443819358@163.com" ]
443819358@163.com
3a5f4f96419c684a60c0365da1d576b7cc7f9e95
d29143a9dfb1ba59f10da89ac86e39b7986ea884
/src/main/java/com/joker/common/model/BaseModel.java
597071c27c4b158d883fe69cf8d7c7abb7cdaa62
[]
no_license
lhzlovewyp/autoCode
07a5684739db051abcfb4f36a3cead68807611f9
e6f22958a53883395a82171a231c36787116a2ec
refs/heads/master
2020-12-25T14:48:30.581885
2016-08-04T02:51:00
2016-08-04T02:51:00
64,809,261
0
0
null
null
null
null
UTF-8
Java
false
false
309
java
package com.joker.common.model; import com.joker.core.annotation.Attr; public abstract class BaseModel { @Attr(column="id",desc="id",dataType="char",pk=true,defaultValue="1",length=36) private String id; public String getId() { return id; } public void setId(String id) { this.id = id; } }
[ "lvhaizhen@10.211.55.2" ]
lvhaizhen@10.211.55.2
2ea401b4bb8fdd9a6be8150805b80a60bdb96c68
7479cd8744a8e2bbcf5b93cf8c6b2db5f4d06ed8
/src/main/java/kss/springframework/msscbeerservice/web/controller/BeerController.java
08229499200ecd5ff9ebdc6e0dd5266172478396
[]
no_license
kuznetsovsergeyymailcom/mssc-beer-service
91ce5b3c2bce40081ad309f74aa5cd2d4d812556
76d05f11c2b58cf1bdb3fd7ccc2fedd3fe7ff3b2
refs/heads/master
2022-10-07T15:16:12.932705
2020-06-06T19:41:55
2020-06-06T19:41:55
257,023,828
0
0
null
2020-04-21T14:49:14
2020-04-19T14:42:56
Java
UTF-8
Java
false
false
3,454
java
package kss.springframework.msscbeerservice.web.controller; import kss.brewery.model.BeerDto; import kss.springframework.msscbeerservice.services.BeerService; import kss.brewery.model.BeerPagedList; import kss.brewery.model.BeerStyleEnum; import lombok.RequiredArgsConstructor; import org.springframework.data.domain.PageRequest; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import java.util.UUID; @RequiredArgsConstructor @RequestMapping("/api/v1") @RestController public class BeerController { private static final Integer DEFAULT_PAGE_NUMBER = 0; private static final Integer DEFAULT_PAGE_SIZE = 25; private final BeerService beerService; @GetMapping(produces = { "application/json" }, path = "beer") public ResponseEntity<BeerPagedList> listBeers(@RequestParam(value = "pageNumber", required = false) Integer pageNumber, @RequestParam(value = "pageSize", required = false) Integer pageSize, @RequestParam(value = "beerName", required = false) String beerName, @RequestParam(value = "beerStyle", required = false) BeerStyleEnum beerStyle, @RequestParam(value = "showInventoryOnHand", required = false) Boolean showInventoryOnHand){ if(showInventoryOnHand == null){ showInventoryOnHand = false; } if (pageNumber == null || pageNumber < 0){ pageNumber = DEFAULT_PAGE_NUMBER; } if (pageSize == null || pageSize < 1) { pageSize = DEFAULT_PAGE_SIZE; } BeerPagedList beerList = beerService.listBeers(beerName, beerStyle, PageRequest.of(pageNumber, pageSize), showInventoryOnHand); beerList.get().forEach(System.out::println); return new ResponseEntity<>(beerList, HttpStatus.OK); } @GetMapping("beer/{uuid}") public ResponseEntity<BeerDto> getBeerById(@PathVariable("uuid") UUID uuid, @RequestParam(value = "showInventoryOnHand", required = false) Boolean showInventoryOnHand){ if(showInventoryOnHand == null){ showInventoryOnHand = false; } BeerDto beerById = beerService.getBeerById(uuid, showInventoryOnHand); return new ResponseEntity<>(beerById, HttpStatus.OK); } @PostMapping(path = "beer") public ResponseEntity saveNewBeer(@RequestBody @Validated BeerDto beer){ beerService.saveNewBeer(beer); HttpHeaders httpHeaders = new HttpHeaders(); httpHeaders.add("Location", "api/v1/beer/" + beer.getId()); return new ResponseEntity(httpHeaders, HttpStatus.CREATED); } @PutMapping("beer/{uuid}") public ResponseEntity updateBeerById(@PathVariable("uuid") UUID uuid, @RequestBody @Validated BeerDto beer){ beerService.updateBeerDto(uuid, beer); return new ResponseEntity(HttpStatus.NO_CONTENT); } @GetMapping("beerUpc/{upc}") public ResponseEntity getBeerByUPC(@PathVariable("upc") String upc){ BeerDto beerByUPC = beerService.findByUpc(upc); return new ResponseEntity<>(beerByUPC, HttpStatus.OK); } }
[ "github123869p" ]
github123869p
788875047799ed3154d1af5728d72c2c3b4e6ffc
54609d68b8ddef76a15d71738c559e39ce343587
/src/test/java/com/blog/myapp/service/dto/GpsInfoDTOTest.java
748a9194a9f4f31aa2c2f9ab9f33ad1979bb83d8
[]
no_license
zero1527/jhipster-pro-blog
4d8faf8c4aee046d1a82660aafbe765a0568aaaf
b82d7b1be014fa6d74ac93de242c7a933457f248
refs/heads/main
2023-05-30T22:00:44.492326
2021-06-18T14:48:17
2021-06-18T14:48:17
378,181,428
0
0
null
null
null
null
UTF-8
Java
false
false
792
java
package com.blog.myapp.service.dto; import static org.assertj.core.api.Assertions.assertThat; import com.blog.myapp.web.rest.TestUtil; import org.junit.jupiter.api.Test; class GpsInfoDTOTest { @Test void dtoEqualsVerifier() throws Exception { TestUtil.equalsVerifier(GpsInfoDTO.class); GpsInfoDTO gpsInfoDTO1 = new GpsInfoDTO(); gpsInfoDTO1.setId(1L); GpsInfoDTO gpsInfoDTO2 = new GpsInfoDTO(); assertThat(gpsInfoDTO1).isNotEqualTo(gpsInfoDTO2); gpsInfoDTO2.setId(gpsInfoDTO1.getId()); assertThat(gpsInfoDTO1).isEqualTo(gpsInfoDTO2); gpsInfoDTO2.setId(2L); assertThat(gpsInfoDTO1).isNotEqualTo(gpsInfoDTO2); gpsInfoDTO1.setId(null); assertThat(gpsInfoDTO1).isNotEqualTo(gpsInfoDTO2); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
ddf05d2e240c0a3869d83603309602c55aec62bf
4e4ba44fda3bf1ed3af64590e82c9c87759a4024
/Sistema-Barbearia/src/sistemabarbearia/SistemaBarbearia.java
61ffd4cd5927d7558dc156f8471e97ee076ee0ee
[ "MIT" ]
permissive
JoaoCFN/ExerciciosJava
2c5e647f374094f691432a7cc0eb456a0e64687e
67d4e3f0f3582be46a679ef0a7aacd0b0c826cc7
refs/heads/master
2022-12-18T19:53:51.723237
2020-09-17T02:53:21
2020-09-17T02:53:21
267,758,345
0
0
null
null
null
null
UTF-8
Java
false
false
8,206
java
package sistemabarbearia; import javax.swing.JOptionPane; public class SistemaBarbearia { public static void main(String[] args) { // BABEARIA Barbearia barbearia1 = new Barbearia(); barbearia1.setNome("Barbearia do Toinho"); barbearia1.setCnpj("000.000.0000/000-20"); barbearia1.setEndereco("Rua da ponte, Queimadinha"); // BARBEIROS Barbeiro barbeiro1 = new Barbeiro(); barbeiro1.setNome("João Carlos"); Barbeiro barbeiro2 = new Barbeiro(); barbeiro2.setNome("Genivaldo"); // Adiciona os barbeiros barbearia1.setListaBarbeiros(barbeiro1); barbearia1.setListaBarbeiros(barbeiro2); /* DENTRO DA MAIN HOJE, TEMOS APENAS O INTERFACE DO USUÁRIO */ int opcaoUsuario = 0; // ENQUANTO O USUÁRIO NÃO FECHAR, O PROGRAMA RODARÁ while(opcaoUsuario != -1){ // PRIMEIRO O USUÁRIO INFORMA SE ELE É BARBEIRO OU CLIENTE String[] opcoesUsuario = {"Se cadastrar", "Fechar"}; opcaoUsuario = JOptionPane.showOptionDialog(null, " " + barbearia1.getNome(), "Seja Bem vindo", JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE, null, opcoesUsuario, opcoesUsuario[0] ); switch(opcaoUsuario){ case 0: // CLIENTES Cliente cliente = new Cliente(); cliente.setNome(JOptionPane.showInputDialog("Digite seu nome")); // OPÇÕES DE SERVIÇO JOptionPane.showMessageDialog(null, "Nossos serviços \n" + "Barba - R$10 - 20 minutos \n" + "Cabelo na máquina - R$15 - 40 minutos \n" + "Cabelo na tesoura - R$20 - 1H \n" + "Serviço completo - R$35 - 1H E 40 minutos \n" ); // ESCOLHENDO O SERVIÇO String[] servicos = {"Barba", "Cabelo na máquina", "Cabelo na tesoura", "Serviço completo"}; int opcaoServico = JOptionPane.showOptionDialog(null, "Serviços", "Escolha o serviço", JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE, null, servicos, servicos[0] ); // SETA O SERVIÇO ESCOLHIDO switch(opcaoServico){ case 0: cliente.setServico(1); break; case 1: cliente.setServico(2); break; case 2: cliente.setServico(3); break; case 3: cliente.setServico(4); break; default: JOptionPane.showMessageDialog(null, "Nenhuma opção selecionada"); break; } // PASSA A BARBEARIA PARA BUSCAR OS BARBEIROS DISPONÍVEIS cliente.setBarbeirosDisponiveis(barbearia1); // CONTROI UM ARRAY QUE IRÁ RECEBER TODOS OS BARBEIROS DISPONÍVEIS NA BARBEARIA String[] listaBarbeirosDisponiveis = new String[cliente.getBarbeirosDisponiveis().size()]; // PREENCHE O ARRAY DE BARBEIROS DISPONÍVEIS NA BARBEARIA for(int i = 0; i < cliente.getBarbeirosDisponiveis().size(); i++){ listaBarbeirosDisponiveis[i] = cliente.getBarbeirosDisponiveis().get(i).getNome(); } // Captura qual barbeiro foi escolhido pelo usuário int barbeiroEscolhido = JOptionPane.showOptionDialog(null, "Barbeiros disponíveis", "Escolha o barbeiro", JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE, null, listaBarbeirosDisponiveis, listaBarbeirosDisponiveis[0] ); // ADICIONA O CLIENTE A LISTA //cliente1.getBarbeirosDisponiveis().get(barbeiroEscolhido).setListaClientes(cliente1); barbearia1.getListaBarbeiros().get(barbeiroEscolhido).setListaClientes(cliente); JOptionPane.showMessageDialog(null, "Nome: " + cliente.getNome() + "\n" + "Tipo de serviço: " + cliente.getNomeServico()+ "\n" + "Valor do serviço: R$" + cliente.getValorServico() + "\n" + "Barbeiro escolhido: " + cliente.getBarbeirosDisponiveis().get(barbeiroEscolhido).getNome() + "\n" + cliente.getTempoEspera() + "\n" + "Quantidade de pessoas na sua frente: " + cliente.getQtdPessoasAFrente() ); break; case 1: JOptionPane.showMessageDialog(null, "Muito obrigado por usar nosso programa"); opcaoUsuario = -1; break; default: JOptionPane.showMessageDialog(null, "Você fechou o programa"); break; } } barbearia1.setFaturamento(); /* TESTE NO CONSOLE */ // Dados barbearia System.out.println("---------------------------------------"); System.out.println("Barbearia"); System.out.println("---------------------------------------"); System.out.println("Nome: " + barbearia1.getNome()); System.out.println("CNPJ: " + barbearia1.getCnpj()); System.out.println("Endereço: " + barbearia1.getEndereco()); System.out.println("Faturamento: R$" + barbearia1.getFaturamento()); System.out.println("Número barbeiros: " + barbearia1.numeroBarbeiros()); // Dados barbeiro System.out.println("---------------------------------------"); System.out.println("Barbeiros"); System.out.println("---------------------------------------"); System.out.println("Nome: " + barbeiro1.getNome()); System.out.println("Total de dinheiro de ganho: R$" + barbeiro1.getTotalDinheiroGanho()); System.out.println("Quantidade de pessoas na fila: " + barbeiro1.numeroClientes()); System.out.printf("Tempo de fila: %.2f \n", barbeiro1.getTempoFila()); System.out.println("***************************************"); System.out.println("Nome: " + barbeiro2.getNome()); System.out.println("Total de dinheiro de ganho: R$" + barbeiro2.getTotalDinheiroGanho()); System.out.println("Quantidade de pessoas na fila: " + barbeiro2.numeroClientes()); System.out.printf("Tempo de fila: %.2f \n", barbeiro2.getTempoFila()); System.out.println("---------------------------------------"); System.out.println("Clientes"); System.out.println("---------------------------------------"); for(int i = 0; i < barbeiro1.getListaClientes().size(); i++){ System.out.println(barbeiro1.getListaClientes().get(i).getNome()); } for(int i = 0; i < barbeiro2.getListaClientes().size(); i++){ System.out.println(barbeiro2.getListaClientes().get(i).getNome()); } } }
[ "joaoneto.20fsa@gmail.com" ]
joaoneto.20fsa@gmail.com
561e73367a282ffdf2f90361aa09078060f5a15e
b8b02b1c7bd19df302f2acce11fcec36ac2ce326
/src/main/java/datenewtypes/FamilyBirthdays.java
9453c44ada7727780085331522fc987ac36873d4
[]
no_license
p-suha/training-solutions
4b4297bc945bd31885fb025a58ae2b1564c7945e
05a7bcf1bf627c85a45fc08ef6d83dd6ff2fc616
refs/heads/master
2023-03-19T21:59:41.927803
2021-03-06T11:19:58
2021-03-06T11:19:58
308,387,774
0
0
null
null
null
null
UTF-8
Java
false
false
1,531
java
package datenewtypes; import java.time.LocalDate; import java.time.temporal.ChronoField; import java.time.temporal.ChronoUnit; import java.time.temporal.TemporalAccessor; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class FamilyBirthdays { private List<LocalDate> birthdays; public FamilyBirthdays(LocalDate... birthdays) { this.birthdays = Arrays.asList(birthdays); } public boolean isFamilyBirthday(TemporalAccessor date) { int month = date.get(ChronoField.MONTH_OF_YEAR); int day = date.get(ChronoField.DAY_OF_MONTH); for (LocalDate birthday : birthdays) { if ((birthday.get(ChronoField.MONTH_OF_YEAR) == month) && (birthday.get(ChronoField.DAY_OF_MONTH) == day)) { return true; } } return false; } public int nextFamilyBirthDay(TemporalAccessor date) { int year = date.get(ChronoField.YEAR); LocalDate base = LocalDate.of(year, date.get(ChronoField.MONTH_OF_YEAR), date.get(ChronoField.DAY_OF_MONTH)); int min = Integer.MAX_VALUE; for (LocalDate birthday : birthdays) { LocalDate nextBirthday = birthday.withYear(year); if (nextBirthday.isBefore(base)) { nextBirthday = birthday.withYear(year + 1); } int diff = (int) ChronoUnit.DAYS.between(base, nextBirthday); if (min > diff) { min = diff; } } return min; } }
[ "peti.suha@gmail.com" ]
peti.suha@gmail.com
99c83a1ab5160d2f0bca65b8dfef0443c1ed4939
ae5eb1a38b4d22c82dfd67c86db73592094edc4b
/project187/src/main/java/org/gradle/test/performance/largejavamultiproject/project187/p935/Production18716.java
fc9367ab4e075c2ab1a4de618c02f03cce23bbc1
[]
no_license
big-guy/largeJavaMultiProject
405cc7f55301e1fd87cee5878a165ec5d4a071aa
1cd6a3f9c59e9b13dffa35ad27d911114f253c33
refs/heads/main
2023-03-17T10:59:53.226128
2021-03-04T01:01:39
2021-03-04T01:01:39
344,307,977
0
0
null
null
null
null
UTF-8
Java
false
false
1,970
java
package org.gradle.test.performance.largejavamultiproject.project187.p935; public class Production18716 { private Production18713 property0; public Production18713 getProperty0() { return property0; } public void setProperty0(Production18713 value) { property0 = value; } private Production18714 property1; public Production18714 getProperty1() { return property1; } public void setProperty1(Production18714 value) { property1 = value; } private Production18715 property2; public Production18715 getProperty2() { return property2; } public void setProperty2(Production18715 value) { property2 = value; } private String property3; public String getProperty3() { return property3; } public void setProperty3(String value) { property3 = value; } private String property4; public String getProperty4() { return property4; } public void setProperty4(String value) { property4 = value; } private String property5; public String getProperty5() { return property5; } public void setProperty5(String value) { property5 = value; } private String property6; public String getProperty6() { return property6; } public void setProperty6(String value) { property6 = value; } private String property7; public String getProperty7() { return property7; } public void setProperty7(String value) { property7 = value; } private String property8; public String getProperty8() { return property8; } public void setProperty8(String value) { property8 = value; } private String property9; public String getProperty9() { return property9; } public void setProperty9(String value) { property9 = value; } }
[ "sterling.greene@gmail.com" ]
sterling.greene@gmail.com
23a9d475fefb74ec49dd0c6344bc06938d8b0e85
8f7b55fd86ff09e695e1d5fe08b5b534796c554b
/src/main/java/com/NevernoteRESTAPI/Controller/NoteController.java
55176c7410c478d2869efcfea9fa8827721da716
[]
no_license
cmudduluru/Nevernote-REST-API_modified
c0c8fb6c8cf4f5454901f04e1f1ab17895c73a87
db25185a31fbfc2854e881d1083b8fb0da7428bf
refs/heads/master
2020-03-22T12:32:02.336567
2018-07-14T20:06:01
2018-07-14T20:06:01
140,045,705
0
0
null
null
null
null
UTF-8
Java
false
false
2,911
java
package com.NevernoteRESTAPI.Controller; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; import com.NevernoteRESTAPI.Model.Note; import com.NevernoteRESTAPI.View.NoteService; //This Spring MVC - Controller layer exposes the Note REST methods and //maps the URI to the methods that perform the CRUD operations @RestController public class NoteController { // Injecting the dependency here @Autowired private NoteService noteService; // *** this method calls the noteService createNote method to create // a note using the contents provided for the specified Notebook *** @RequestMapping(method = RequestMethod.POST, value="/notebooks/{notebookName}/notes") public void createNote(@RequestBody Note note, @PathVariable String notebookName) { noteService.createNote(notebookName, note); } // *** this method returns back the list of Notes associated to a Notebook *** @RequestMapping(method = RequestMethod.GET, value = "/notebooks/{notebookName}/notes") public List<Note> retreiveAllNotes(@PathVariable String notebookName){ return noteService.retreiveAllNotes(notebookName); } // *** this method returns the Note contents for the specified Note title from a Notebook *** @RequestMapping(method = RequestMethod.GET, value = "/notebooks/{notebookName}/notes/{title}") public Note retreiveNote(@PathVariable String notebookName, @PathVariable String title) { return noteService.retreiveNote(notebookName, title); } // *** this method returns the filtered Notes that has the given tag; notes associated to a Notebook *** @RequestMapping(method = RequestMethod.GET, value = "/notebooks/{notebookName}/{tag}") public List<Note> FilterNotesbyTag(@PathVariable String notebookName, @PathVariable String tag){ return noteService.FilterNotesbyTag(notebookName, tag); } // *** this method calls the noteService updateNote method to update // a specified note using the contents provided *** @RequestMapping(method = RequestMethod.PUT, value = "/notebooks/{notebookName}/notes/{title}") public void updateNote(@RequestBody Note note, @PathVariable String notebookName ,@PathVariable String title) { noteService.updateNote(title, note, notebookName); } // *** this method calls the noteService deleteNote method to // delete a Note for the specified Note title *** @RequestMapping(method = RequestMethod.DELETE, value = "/notebooks/{notebookName}/notes/{title}") public void deleteNote(@PathVariable String notebookName, @PathVariable String title) { noteService.deleteNote(notebookName, title); } }
[ "40604431+cmudduluru@users.noreply.github.com" ]
40604431+cmudduluru@users.noreply.github.com
3abded4ee170e6552492081e528f6dc8e7b9b2c2
12693d81b34202478157a7abf9c81f263106d521
/src/main/java/application/domain/HasID.java
151432239e0e54a6e40bf399a1553bfb93786150
[]
no_license
timimonoki/betting
38ac40fa41a464d7ce81702d3dc3dafbac7b3435
99bc29a20977d20ca9a479e8d183531e366b438f
refs/heads/master
2022-07-06T23:30:40.389398
2017-03-23T15:04:22
2017-03-23T15:04:22
95,014,899
0
0
null
2022-06-21T16:32:20
2017-06-21T14:47:24
Java
UTF-8
Java
false
false
147
java
package application.domain; /** * Created by NegrutiA on 3/17/2017. */ public interface HasID<ID> { ID getId(); void setId(ID newId); }
[ "Andrei.Negruti@PaddyPowerBetfair.com" ]
Andrei.Negruti@PaddyPowerBetfair.com
309a7a4bf3d29cd0da6bb316f4443e0e4467cfec
97029734170a9aeda0c221a133e2162770b24618
/app/src/main/java/com/example/mrlanguagearabic/b_s1p13_2.java
e6ff1087610c433e75150bdb931f2d9be884dad9
[]
no_license
ghomdoust/MrLanguageArabic
0f33662062693086c512e07eb99af798ef410824
2bdeeb851c46d0cc8a1704b16050ac71901de2e3
refs/heads/master
2023-03-31T18:53:28.889369
2021-04-06T23:17:27
2021-04-06T23:17:27
257,643,540
0
0
null
null
null
null
UTF-8
Java
false
false
4,055
java
package com.example.mrlanguagearabic; import androidx.appcompat.app.AppCompatActivity; import android.media.MediaPlayer; import android.os.AsyncTask; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.Toast; import com.github.barteksc.pdfviewer.PDFView; import java.io.BufferedInputStream; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.URL; public class b_s1p13_2 extends AppCompatActivity { PDFView pdfView; static MediaPlayer mPlayer; Button buttonPlay; Button buttonStop; String url = "https://www.aghayezaban.ir/downloads/1_dialouge/lesson13/lesson13_vocab.mp3"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.b_s1p13_2); pdfView =(PDFView)findViewById(R.id.pdfView); new b_s1p13_2.RetrivePdfStream().execute("https://www.aghayezaban.ir/downloads/1_dialouge/lesson13/lesson13_vocab.pdf"); this.buttonPlay = (Button)this.findViewById(R.id.play); this.buttonPlay.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { b_s1p13_2.mPlayer = new MediaPlayer(); b_s1p13_2.mPlayer.setAudioStreamType(3); try { b_s1p13_2.mPlayer.setDataSource(b_s1p13_2.this.url); } catch (IllegalArgumentException var5) { Toast.makeText(b_s1p13_2.this.getApplicationContext(), "You might not set the URI correctly!", Toast.LENGTH_LONG).show(); } catch (SecurityException var6) { Toast.makeText(b_s1p13_2.this.getApplicationContext(), "You might not set the URI correctly!", Toast.LENGTH_LONG).show(); } catch (IllegalStateException var7) { Toast.makeText(b_s1p13_2.this.getApplicationContext(), "You might not set the URI correctly!", Toast.LENGTH_LONG).show(); } catch (IOException var8) { var8.printStackTrace(); } try { b_s1p13_2.mPlayer.prepare(); } catch (IllegalStateException var3) { Toast.makeText(b_s1p13_2.this.getApplicationContext(), "You might not set the URI correctly!", Toast.LENGTH_LONG).show(); } catch (IOException var4) { Toast.makeText(b_s1p13_2.this.getApplicationContext(), "You might not set the URI correctly!", Toast.LENGTH_LONG).show(); } b_s1p13_2.mPlayer.start(); } }); this.buttonStop = (Button)this.findViewById(R.id.stop); this.buttonStop.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { if (b_s1p13_2.mPlayer != null && b_s1p13_2.mPlayer.isPlaying()) { b_s1p13_2.mPlayer.stop(); } } }); } class RetrivePdfStream extends AsyncTask<String,Void, InputStream> { @Override protected InputStream doInBackground(String... strings) { InputStream inputStream = null; try{ URL url = new URL(strings[0]); HttpURLConnection urlConnection=(HttpURLConnection)url.openConnection(); if(urlConnection.getResponseCode()==200) { inputStream=new BufferedInputStream(urlConnection.getInputStream()); } } catch (IOException e) { return null; } return inputStream; } @Override protected void onPostExecute(InputStream inputStream) { pdfView.fromStream(inputStream).load(); } } protected void onDestroy() { super.onDestroy(); if (mPlayer != null) { mPlayer.release(); mPlayer = null; } } }
[ "47427371+ghomdoust@users.noreply.github.com" ]
47427371+ghomdoust@users.noreply.github.com
08fa2d72752998dcfe909d76a2632d020098d315
d0ce232fae4b722d266a0f92223d49326fadcff6
/DemoProject/src/main/java/com/demo/user/service/UserService.java
d865454a03196c3f177c9853fd052a99f30a6e33
[]
no_license
OlgaE/DemoProject
c8965f9c3ac9379852bf7ef0b6a793abf4baaa02
8b1c8f9aee8feb69b1eab7c88105170e94705e60
refs/heads/master
2020-04-25T06:30:38.771088
2013-12-01T11:57:55
2013-12-01T11:57:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
234
java
package com.demo.user.service; import com.demo.user.User; public interface UserService { void insertUser(User user); User getUserById(int userId); User getUser(String loginName); /* List<User> getUsers();*/ }
[ "olga.efimova.aol@gmail.com" ]
olga.efimova.aol@gmail.com
4d175f6b040934018f6106b3ceea682e8aba652e
00990b40a0f563c9ca9e60497030a4f66565b4bd
/src/main/java/com/gdufe/SwaggerApp.java
7f64f443fbbb426e0681e07ee30c765c1b77fd56
[]
no_license
NEW666/springboot-swagger-
b10a472a385671b9cd1732a344db1625c91c8cfe
b8b7687c5629cbe225040db92a3689a3f39ecd7b
refs/heads/master
2020-04-08T04:01:11.525403
2018-11-25T04:55:59
2018-11-25T04:55:59
158,999,032
0
1
null
null
null
null
UTF-8
Java
false
false
297
java
package com.gdufe; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class SwaggerApp { public static void main(String[] args) { SpringApplication.run(SwaggerApp.class,args); } }
[ "gong.wenhui@trs.com.cn" ]
gong.wenhui@trs.com.cn
1dde9efd9c90bb07a142302a352f10bc080768d0
adabaf9e85db0383a1cd4335a733367463b92289
/3.JavaMultithreading/src/com/javarush/task/task30/task3003/Consumer.java
cf1b0d78cf8a4d687d3b4c689a5ef799cc73e686
[]
no_license
rossi23891/JavaRushTasks
8bc8c64a3e2c6ca8028c2d90eabaef3ef666eb9a
0250c3c16fb4f973b8c54c4a1400bc7b9679196f
refs/heads/master
2021-07-08T21:17:46.607861
2020-08-16T19:38:10
2020-08-16T19:38:10
177,397,671
1
0
null
null
null
null
UTF-8
Java
false
false
637
java
package com.javarush.task.task30.task3003; import java.util.concurrent.TransferQueue; public class Consumer implements Runnable { private TransferQueue<ShareItem> queue; public Consumer(TransferQueue<ShareItem> queue) { this.queue = queue; } @Override public void run() { try { Thread.sleep(450); } catch (InterruptedException e) { } while (true){ try { ShareItem item =queue.take(); System.out.format("Processing %s"+ item.toString()); } catch (InterruptedException e) { } } } }
[ "rossi23891@gmail.com" ]
rossi23891@gmail.com
a965d2f2ae58fcec2f76ea2742295c908c886aa7
b336605cc11ce111b5ffad91eea1201362eafab6
/cucumber-first-demo/src/test/java/com/demo/cucumber/cucumberdemo/CucumberDemoApplicationTests.java
110cb3be3fac9f1ca9adacc96e9094f2966c5bd3
[]
no_license
gurucode001/demos
4e4675248056727dc4659d0ae6387c944389ccd5
563410030529f7920e0a153bc9d56ca711a8708a
refs/heads/master
2023-04-29T19:20:25.612010
2020-08-28T13:35:16
2020-08-28T13:35:16
257,525,351
0
0
null
2023-04-14T17:33:16
2020-04-21T08:08:35
Java
UTF-8
Java
false
false
228
java
package com.demo.cucumber.cucumberdemo; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class CucumberDemoApplicationTests { @Test void contextLoads() { } }
[ "ashutosh@uxmint.in" ]
ashutosh@uxmint.in
a43c2046ddd7f3dc1b8da18d2f8eb2083705ea47
f9b7678a3c97fc0569e9735e2f0c29bb97741be0
/Test/src/main/java/de/persistence/PersistenceFacadeIF.java
372af94a4d396c9d2589938630ed541b42b8e45b
[]
no_license
trallus/Autonomic-Robots
6f4712a4171256a4552668a5f5c30832ea9db44d
2237543b77142f2622c9f252238bc4d18509ae43
refs/heads/master
2021-01-23T13:31:35.867485
2015-01-30T06:07:01
2015-01-30T06:07:01
19,114,561
0
0
null
null
null
null
UTF-8
Java
false
false
1,077
java
package de.persistence; /** * Declaration of the menagment Methods of the Persitence * @author Mike Kiekebusch * @version 0.1 * @since 28.05.2014 */ public interface PersistenceFacadeIF { /** * Returns a Implementing Instance of the CRUDIF * @return A new implementing Object of the CRUDIF * (Create,Read,Update,Delete) */ public CRUDIF getDBController(); /** * Starts the DataBaseSystem */ public void startDBSystem(); /** * Stops the DataBaseSystem */ public void shutdownDBSystem(); /** * Beginns a new Transaction * @param dbcontroller The DB Controller for which the Transaction should be started */ public void beginTransaction(final CRUDIF dbcontroller); /** * Ends the Transaction with the specified state * @param state true := commit * false := rollback * @param dbcontroller The DB Controller for which the Transaction should be ended */ public void endTransaction(final boolean state, final CRUDIF dbcontroller); }
[ "mikekiekebusch@gmail.com" ]
mikekiekebusch@gmail.com
e5a11d464689a03dbf41d55122ac968790c0c24d
c501452c302afb65c1380cd9b92a1eb86a638dde
/leyou-auth/leyou-auth-service/src/main/java/com/tang/leyou/auth/config/JwtProperties.java
7cc7ff2e2d38bb3bd4adb3be21a9458895b943f9
[]
no_license
tangxiaonian/jwt-sso
9ff9abcc93bee437831077d7d001fd9296d3d9d7
3098010d050c16f8e4a2fc3ed9a81e40949ad7b5
refs/heads/master
2021-06-30T15:15:31.127985
2019-12-01T14:35:04
2019-12-01T14:35:04
225,173,365
1
0
null
2021-03-19T20:30:35
2019-12-01T14:17:31
Java
UTF-8
Java
false
false
2,332
java
package com.tang.leyou.auth.config; import com.tang.leyou.auth.common.RsaUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.context.properties.ConfigurationProperties; import javax.annotation.PostConstruct; import java.security.PrivateKey; import java.security.PublicKey; /** * @Classname JwtProperties * @Description [ TODO ] * @Author Tang * @Date 2019/11/29 22:36 * @Created by ASUS */ @ConfigurationProperties(prefix = "jwt") public class JwtProperties { // 密钥 private String secret; // 公钥 private String pubKeyPath; // 私钥 private String priKeyPath; // token过期时间 private int expire; // cookieName private String cookieName; // 公钥 private PublicKey publicKey; // 私钥 private PrivateKey privateKey; private static final Logger logger = LoggerFactory.getLogger(JwtProperties.class); @PostConstruct public void init() throws Exception { this.privateKey = RsaUtils.getPrivateKey("C:\\TEMP\\rsa\\rsa.pri"); this.publicKey = RsaUtils.getPublicKey("C:\\TEMP\\rsa\\rsa.pub"); logger.info("读取公钥私钥文件..."); } public String getCookieName() { return cookieName; } public void setCookieName(String cookieName) { this.cookieName = cookieName; } public String getSecret() { return secret; } public void setSecret(String secret) { this.secret = secret; } public String getPubKeyPath() { return pubKeyPath; } public void setPubKeyPath(String pubKeyPath) { this.pubKeyPath = pubKeyPath; } public String getPriKeyPath() { return priKeyPath; } public void setPriKeyPath(String priKeyPath) { this.priKeyPath = priKeyPath; } public int getExpire() { return expire; } public void setExpire(int expire) { this.expire = expire; } public PublicKey getPublicKey() { return publicKey; } public void setPublicKey(PublicKey publicKey) { this.publicKey = publicKey; } public PrivateKey getPrivateKey() { return privateKey; } public void setPrivateKey(PrivateKey privateKey) { this.privateKey = privateKey; } }
[ "2684270465@qq.com" ]
2684270465@qq.com
1f5041731ae6786869b001878ca6c8773f73d763
5d8f3a88f09150cd6b8496938b37166248993ce1
/mybatisTest/src/main/java/com/lagou/pojo/User.java
d95cce473b689b5fae110863ac3983552c9ffdd3
[]
no_license
PuppetMan0318/mybatis
71eaacca8621e7e4df9daca7ed881abbc7ba5ba0
f384fb301946403af6ef8cc7621bececedb084ff
refs/heads/master
2022-07-06T19:30:55.344937
2020-03-02T14:59:07
2020-03-02T14:59:07
244,094,293
0
0
null
2020-10-13T19:58:01
2020-03-01T05:43:20
Java
UTF-8
Java
false
false
697
java
package com.lagou.pojo; /** * @author Xuhui * @title User * @date 2020/2/24 21:31 */ public class User { private int id; private String username; private String password; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } @Override public String toString() { return "User{" + "id=" + id + ", username='" + username + '\'' + ", password='" + password + '\'' + '}'; } }
[ "1070453739@qq.com" ]
1070453739@qq.com
ea60c04e8ca105e6c097e459c100fdf5ec5393ea
168ce2bedc582853b318959828a98d6c9eefebad
/src/pizzas/Ventana.java
5044a75b3999bdb3a25e404fcafe491ebc9e6504
[]
no_license
FLOTUZ/pizzas-gui
8c5d04845cfb5681a77a29df18d72647816d4ab1
133da13be41e8bd0c2f8d675f74faba6d992b134
refs/heads/master
2020-08-09T00:12:02.350605
2019-10-10T15:11:43
2019-10-10T15:11:43
213,955,970
0
0
null
null
null
null
UTF-8
Java
false
false
39,596
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 pizzas; import java.awt.Color; import java.awt.Image; import java.awt.print.PrinterException; import java.io.BufferedWriter; import java.io.FileWriter; import java.util.ArrayList; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.Icon; import javax.swing.ImageIcon; import javax.swing.JFileChooser; import javax.swing.JOptionPane; import javax.swing.filechooser.FileNameExtensionFilter; /** * * @author Emmanuel */ public class Ventana extends javax.swing.JFrame { Acerca_De acerca; Icon icHawaiana, icVegetariana, icItaliana, icPeperoni, icSarten; private ArrayList<Pedido> pedido = null; public Ventana() { initComponents(); acerca = new Acerca_De(this, true); calcularPrecio(); pedido = new ArrayList<>(); llenarPedidos(); /*icHawaiana = new ImageIcon(getClass().getResource("hawaiana.jpg")); icItaliana = new ImageIcon(getClass().getResource("italiana.jpg")); icPeperoni = new ImageIcon(getClass().getResource("peperoni.jpg")); icSarten = new ImageIcon(getClass().getResource("sarten.jpg")); icVegetariana = new ImageIcon(getClass().getResource("vegetariana.jpg")); */ lbl_imagen.setSize(200, 200); // HAWAIANA //Se obtiene la imagen de donde la tengamos ImageIcon imgIconHw = new ImageIcon(getClass().getResource("hawaiana.jpg")); //Escala la imagen Image imgEscaladaHw = imgIconHw.getImage().getScaledInstance(100, 100, Image.SCALE_SMOOTH); icHawaiana = new ImageIcon(imgEscaladaHw); //Se setea la imagen en el Label lbl_imagen.setIcon(icHawaiana); // ITALIANA //Se obtiene la imagen de donde la tengamos ImageIcon imgIconIt = new ImageIcon(getClass().getResource("italiana.jpg")); //Escala la imagen Image imgEscaladaIt = imgIconIt.getImage().getScaledInstance(100, 100, Image.SCALE_SMOOTH); icItaliana = new ImageIcon(imgEscaladaIt); //Se setea la imagen en el Label lbl_imagen.setIcon(icItaliana); // PEPERONI //Se obtiene la imagen de donde la tengamos ImageIcon imgIconPe = new ImageIcon(getClass().getResource("peperoni.jpg")); //Escala la imagen Image imgEscaladaPe = imgIconPe.getImage().getScaledInstance(100, 100, Image.SCALE_SMOOTH); icPeperoni = new ImageIcon(imgEscaladaPe); //Se setea la imagen en el Label lbl_imagen.setIcon(icPeperoni); // SARTEN //Se obtiene la imagen de donde la tengamos ImageIcon imgIconSa = new ImageIcon(getClass().getResource("sarten.jpg")); //Escala la imagen Image imgEscaladaSa = imgIconSa.getImage().getScaledInstance(100, 100, Image.SCALE_SMOOTH); icSarten = new ImageIcon(imgEscaladaSa); //Se setea la imagen en el Label lbl_imagen.setIcon(icSarten); // VEGETARIANA //Se obtiene la imagen de donde la tengamos ImageIcon imgIconVe = new ImageIcon(getClass().getResource("vegetariana.jpg")); //Escala la imagen Image imgEscaladaVe = imgIconVe.getImage().getScaledInstance(100, 100, Image.SCALE_SMOOTH); icVegetariana = new ImageIcon(imgEscaladaVe); //Se setea la imagen en el Label lbl_imagen.setIcon(icVegetariana); } //Onjetos de prueba private void llenarPedidos() { pedido.add(new Pedido("Emmanuel", "Hawaiana", "Grande", "Queso", 110)); pedido.add(new Pedido("pepe", "peperoni", "mediana", "Biscochos", 220)); pedido.add(new Pedido("jose", "sartén", "chica", "hot Papas", 250)); } /** * 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() { buttonGroup1 = new javax.swing.ButtonGroup(); jButton2 = new javax.swing.JButton(); jTabbedPane1 = new javax.swing.JTabbedPane(); jPanel3 = new javax.swing.JPanel(); jPanel1 = new javax.swing.JPanel(); cbxSeleccionarPizza = new javax.swing.JComboBox<>(); rbChica = new javax.swing.JRadioButton(); rbMediana = new javax.swing.JRadioButton(); rbGrande = new javax.swing.JRadioButton(); rbFamiliar = new javax.swing.JRadioButton(); cbExtraQueso = new javax.swing.JCheckBox(); cbOrillaRellena = new javax.swing.JCheckBox(); cbHotPapas = new javax.swing.JCheckBox(); cbBiscochos = new javax.swing.JCheckBox(); tfNombreCliente = new javax.swing.JTextField(); jLabel1 = new javax.swing.JLabel(); jPanel6 = new javax.swing.JPanel(); lbl_imagen = new javax.swing.JLabel(); jPanel4 = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); tbVentasDia = new javax.swing.JTable(); jLabel3 = new javax.swing.JLabel(); lbTotalVentas = new javax.swing.JLabel(); jPanel2 = new javax.swing.JPanel(); lbPrecioTotal = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jButton1 = new javax.swing.JButton(); jPanel5 = new javax.swing.JPanel(); jScrollPane2 = new javax.swing.JScrollPane(); taNota = new javax.swing.JTextArea(); btn_imprimir = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setBackground(new java.awt.Color(1, 107, 213)); jButton2.setText("Acerca de"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Seleccione como quiere su pizza", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tw Cen MT", 0, 14))); // NOI18N jPanel1.setToolTipText(""); jPanel1.setName("Seleccione Pizza"); // NOI18N cbxSeleccionarPizza.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "-- Seleccione Pizza --", "Hawaiana", "Vegetariana", "Peperoni", "Italiana", "De Sartén" })); cbxSeleccionarPizza.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cbxSeleccionarPizzaActionPerformed(evt); } }); buttonGroup1.add(rbChica); rbChica.setSelected(true); rbChica.setText("Chica"); rbChica.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { rbChicaActionPerformed(evt); } }); buttonGroup1.add(rbMediana); rbMediana.setText("Mediana"); rbMediana.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { rbChicaActionPerformed(evt); } }); buttonGroup1.add(rbGrande); rbGrande.setText("Grande"); rbGrande.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { rbChicaActionPerformed(evt); } }); buttonGroup1.add(rbFamiliar); rbFamiliar.setText("Familiar"); rbFamiliar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { rbChicaActionPerformed(evt); } }); cbExtraQueso.setText("Extra queso"); cbExtraQueso.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { rbChicaActionPerformed(evt); } }); cbOrillaRellena.setText("Orilla Rellena"); cbOrillaRellena.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { rbChicaActionPerformed(evt); } }); cbHotPapas.setText("Hot Papas"); cbHotPapas.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { rbChicaActionPerformed(evt); } }); cbBiscochos.setText("Biscochos"); cbBiscochos.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { rbChicaActionPerformed(evt); } }); tfNombreCliente.addFocusListener(new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { tfNombreClienteFocusGained(evt); } }); jLabel1.setText("Nombre Cliente"); jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder("Preview")); lbl_imagen.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM); javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6); jPanel6.setLayout(jPanel6Layout); jPanel6Layout.setHorizontalGroup( jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel6Layout.createSequentialGroup() .addContainerGap() .addComponent(lbl_imagen, javax.swing.GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE) .addContainerGap()) ); jPanel6Layout.setVerticalGroup( jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel6Layout.createSequentialGroup() .addComponent(lbl_imagen, javax.swing.GroupLayout.DEFAULT_SIZE, 64, Short.MAX_VALUE) .addContainerGap()) ); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(cbxSeleccionarPizza, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(rbChica) .addComponent(rbMediana) .addComponent(rbGrande) .addComponent(rbFamiliar)) .addGap(69, 69, 69) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(cbExtraQueso) .addComponent(cbBiscochos) .addComponent(cbHotPapas) .addComponent(cbOrillaRellena)))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel1) .addComponent(tfNombreCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(341, 341, 341)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(28, 28, 28) .addComponent(cbxSeleccionarPizza, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(rbChica) .addComponent(cbExtraQueso)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(rbMediana) .addComponent(cbOrillaRellena)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(rbGrande) .addComponent(cbHotPapas))) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(39, 39, 39) .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(rbFamiliar) .addComponent(cbBiscochos)) .addContainerGap()) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addGap(0, 10, Short.MAX_VALUE) .addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(tfNombreCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))) ); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 483, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 8, Short.MAX_VALUE)) ); jPanel3Layout.setVerticalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() .addContainerGap() .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(20, Short.MAX_VALUE)) ); jTabbedPane1.addTab("Generar Pedido", jPanel3); tbVentasDia.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null, null, null}, {null, null, null, null, null}, {null, null, null, null, null}, {null, null, null, null, null}, {null, null, null, null, null}, {null, null, null, null, null}, {null, null, null, null, null}, {null, null, null, null, null}, {null, null, null, null, null}, {null, null, null, null, null}, {null, null, null, null, null} }, new String [] { "Nombre Cliente", "Pizza", "Tamaño", "Extras", "Precio" } ) { Class[] types = new Class [] { java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Double.class }; public Class getColumnClass(int columnIndex) { return types [columnIndex]; } }); jScrollPane1.setViewportView(tbVentasDia); jLabel3.setText("Ventas Del Dia"); lbTotalVentas.setFont(new java.awt.Font("Noto Sans", 0, 18)); // NOI18N lbTotalVentas.setText("0.00"); javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout.setHorizontalGroup( jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 467, Short.MAX_VALUE) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addComponent(jLabel3) .addGap(18, 18, 18) .addComponent(lbTotalVentas, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(27, 27, 27))) .addContainerGap()) ); jPanel4Layout.setVerticalGroup( jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(37, 37, 37) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3) .addComponent(lbTotalVentas)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jTabbedPane1.addTab("VENTAS", jPanel4); jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Precio", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tunga", 0, 24), new java.awt.Color(255, 0, 0))); // NOI18N lbPrecioTotal.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N lbPrecioTotal.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); lbPrecioTotal.setText("0.00"); jLabel2.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel2.setText("Pague:"); jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/pizzas/repartidor2.png"))); // NOI18N jButton1.setText("Pedir Pizza"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder("Nota")); taNota.setColumns(20); taNota.setFont(new java.awt.Font("Courier 10 Pitch", 0, 13)); // NOI18N taNota.setRows(5); jScrollPane2.setViewportView(taNota); btn_imprimir.setText("Imprimir"); btn_imprimir.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn_imprimirActionPerformed(evt); } }); javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5); jPanel5.setLayout(jPanel5Layout); jPanel5Layout.setHorizontalGroup( jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel5Layout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 186, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(btn_imprimir) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel5Layout.setVerticalGroup( jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel5Layout.createSequentialGroup() .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 133, Short.MAX_VALUE) .addContainerGap()) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addComponent(btn_imprimir) .addGap(36, 36, 36)) ); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addContainerGap() .addComponent(jButton1)) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(lbPrecioTotal, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(18, 18, 18) .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lbPrecioTotal, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel2)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton1)) .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jButton3.setText("Guardar"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); 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(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 511, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(32, 32, 32)) .addGroup(layout.createSequentialGroup() .addGap(252, 252, 252) .addComponent(jButton2) .addGap(43, 43, 43) .addComponent(jButton3) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(51, 51, 51) .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 310, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton2) .addComponent(jButton3)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void cbxSeleccionarPizzaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbxSeleccionarPizzaActionPerformed lbl_imagen.setIcon(null); switch (cbxSeleccionarPizza.getSelectedIndex()) { case 0: lbl_imagen.setIcon(null); break; case 1: lbl_imagen.setIcon(icHawaiana); break; case 2: lbl_imagen.setIcon(icVegetariana); break; case 3: lbl_imagen.setIcon(icPeperoni); break; case 4: lbl_imagen.setIcon(icItaliana); break; case 5: lbl_imagen.setIcon(icSarten); break; } calcularPrecio(); }//GEN-LAST:event_cbxSeleccionarPizzaActionPerformed private void rbChicaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbChicaActionPerformed calcularPrecio(); }//GEN-LAST:event_rbChicaActionPerformed private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed String nombreCliente = tfNombreCliente.getText(); String tamaño = null; if (rbChica.isSelected()) { tamaño = "Chica"; } if (rbMediana.isSelected()) { tamaño = "Mediana"; } if (rbGrande.isSelected()) { tamaño = "Grande"; } if (rbFamiliar.isSelected()) { tamaño = "Familiar"; } String extras = ""; if (cbExtraQueso.isSelected()) { extras += " ExtraQueso "; } if (cbHotPapas.isSelected()) { extras += " HotPapas "; } if (cbOrillaRellena.isSelected()) { extras += " OrillaRellena "; } if (cbBiscochos.isSelected()) { extras += " Biscochos "; } String saborPizza = null; saborPizza = cbxSeleccionarPizza.getItemAt(cbxSeleccionarPizza.getSelectedIndex()); if (cbxSeleccionarPizza.getSelectedIndex() != 0) { int a = 0; if (tfNombreCliente.getText() == null || tfNombreCliente.getText().equals("")) { a = JOptionPane.showConfirmDialog(rootPane, "Continuar sin nombre?"); } if (a == 0) { double precio = Double.parseDouble(lbPrecioTotal.getText()); pedido.add(new Pedido(nombreCliente, saborPizza, tamaño, extras, precio)); int r = 0; for (Pedido p : pedido) { tbVentasDia.setValueAt(p.getNombreCliente(), r, 0); tbVentasDia.setValueAt(p.getSaborPizza(), r, 1); tbVentasDia.setValueAt(p.getTamaño(), r, 2); tbVentasDia.setValueAt(p.getExtras(), r, 3); tbVentasDia.setValueAt(p.getPrecio(), r, 4); r++; int ventas = 0; for (Pedido q : pedido) { ventas += q.getPrecio(); lbTotalVentas.setText(String.valueOf(ventas)); } } JOptionPane.showMessageDialog(rootPane, "Su pizza va en camino"); } else { tfNombreCliente.setBackground(Color.red); } } else { JOptionPane.showMessageDialog(rootPane, "Seleccione su pizza por favor"); } }//GEN-LAST:event_jButton1ActionPerformed private void tfNombreClienteFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_tfNombreClienteFocusGained tfNombreCliente.setBackground(Color.WHITE); }//GEN-LAST:event_tfNombreClienteFocusGained private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed acerca.setTitle("Acerca de pizzeria patito"); acerca.setResizable(false); acerca.setLocationRelativeTo(null); acerca.setVisible(true); }//GEN-LAST:event_jButton2ActionPerformed private void btn_imprimirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_imprimirActionPerformed try { taNota.print(); } catch (PrinterException ex) { Logger.getLogger(Ventana.class.getName()).log(Level.SEVERE, null, ex); } }//GEN-LAST:event_btn_imprimirActionPerformed private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed //Navegador de archivos JFileChooser browser = new JFileChooser(); //Regresa 0 si se obtiene el archivo con exito //Regresa 1 si se da click en cancelar o cerrar FileNameExtensionFilter filtro = new FileNameExtensionFilter("Archivo de texto", "txt"); //Se aplica filtro al explorador de archivos browser.setFileFilter(filtro); int resultado = browser.showSaveDialog(null); if (resultado == JFileChooser.APPROVE_OPTION) { String archivo = browser.getSelectedFile().getAbsolutePath()+".txt"; //Filtro de dialogo de archivos //Se exporta la nota a un archivo txt try{ String nota = taNota.getText(); FileWriter wr = new FileWriter(archivo); BufferedWriter buffer = new BufferedWriter(wr); buffer.write(nota); buffer.close(); JOptionPane.showMessageDialog(rootPane, "Se ha guardado"); }catch(Exception e){ } } }//GEN-LAST:event_jButton3ActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Ventana.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Ventana.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Ventana.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Ventana.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Ventana().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btn_imprimir; private javax.swing.ButtonGroup buttonGroup1; private javax.swing.JCheckBox cbBiscochos; private javax.swing.JCheckBox cbExtraQueso; private javax.swing.JCheckBox cbHotPapas; private javax.swing.JCheckBox cbOrillaRellena; private javax.swing.JComboBox<String> cbxSeleccionarPizza; private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel2; private javax.swing.JPanel jPanel3; private javax.swing.JPanel jPanel4; private javax.swing.JPanel jPanel5; private javax.swing.JPanel jPanel6; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JScrollPane jScrollPane2; private javax.swing.JTabbedPane jTabbedPane1; private javax.swing.JLabel lbPrecioTotal; private javax.swing.JLabel lbTotalVentas; private javax.swing.JLabel lbl_imagen; private javax.swing.JRadioButton rbChica; private javax.swing.JRadioButton rbFamiliar; private javax.swing.JRadioButton rbGrande; private javax.swing.JRadioButton rbMediana; private javax.swing.JTextArea taNota; private javax.swing.JTable tbVentasDia; private javax.swing.JTextField tfNombreCliente; // End of variables declaration//GEN-END:variables public void calcularPrecio() { final int CHICA = 0, MEDIANA = 1, GRANDE = 2, FAMILIAR = 3; int precio = 0; int tam = 0; if (rbChica.isSelected()) { tam = CHICA; } else if (rbMediana.isSelected()) { tam = MEDIANA; } else if (rbGrande.isSelected()) { tam = GRANDE; } else if (rbFamiliar.isSelected()) { tam = FAMILIAR; } switch (cbxSeleccionarPizza.getSelectedIndex()) { case 0: switch (tam) { case CHICA: precio = 90; break; case MEDIANA: precio = 120; break; case GRANDE: precio = 170; break; case FAMILIAR: precio = 260; break; } break; case 1: switch (tam) { case CHICA: precio = 90; break; case MEDIANA: precio = 120; break; case GRANDE: precio = 170; break; case FAMILIAR: precio = 260; break; } break; case 2: switch (tam) { case CHICA: precio = 90; break; case MEDIANA: precio = 120; break; case GRANDE: precio = 170; break; case FAMILIAR: precio = 260; break; } break; case 3: switch (tam) { case CHICA: precio = 90; break; case MEDIANA: precio = 120; break; case GRANDE: precio = 170; break; case FAMILIAR: precio = 260; break; } break; case 4: switch (tam) { case CHICA: precio = 90; break; case MEDIANA: precio = 120; break; case GRANDE: precio = 170; break; case FAMILIAR: precio = 260; break; } break; } if (cbExtraQueso.isSelected()) { precio += 10; } if (cbOrillaRellena.isSelected()) { precio += 10; } if (cbHotPapas.isSelected()) { precio += 10; } if (cbBiscochos.isSelected()) { precio += 10; } lbPrecioTotal.setText(String.valueOf(precio)); genera_Nota(); } public void genera_Nota() { taNota.setText("=== Pizzería patito===\n"); taNota.append("----------------------"); } }
[ "flotuz10@gmail.com" ]
flotuz10@gmail.com
e6c40361d77583077c791df1f21491d530cbc12d
fd42c7f2a002564be5c48536492469b0fb44b485
/Notebook/src/main/java/ua/model/Address.java
5c9b10def1f847f25e8d76a12f50fcae8d7ab417
[]
no_license
AndriiSeverin/JavaTraining
488e9a6cb0d508f0a6c92f98e5e64055a2daac97
d6f9d5c149352dc8ab7e8d4cb399d6405d318a0b
refs/heads/master
2021-06-11T21:25:49.637197
2017-01-20T22:31:10
2017-01-20T22:31:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,167
java
package ua.model; /** * Created by andrii on 06.11.16. */ public class Address { /** * */ private String postalCode; /** * */ private String city; /** * */ private String street; /** * */ private String houseNumber; /** * */ private String apartmentNumber; /** * * @param postalCode * @param city * @param street * @param houseNumber * @param apartmentNumber */ public Address(String postalCode, String city, String street, String houseNumber, String apartmentNumber) { this.postalCode = postalCode; this.city = city; this.street = street; this.houseNumber = houseNumber; this.apartmentNumber = apartmentNumber; } @Override public String toString() { return "Address{" + "postalCode='" + postalCode + '\'' + ", city='" + city + '\'' + ", street='" + street + '\'' + ", houseNumber='" + houseNumber + '\'' + ", apartmentNumber='" + apartmentNumber + '\'' + '}'; } }
[ "Severinandrey97@gmail.com" ]
Severinandrey97@gmail.com
1b89b7a08fba9b413c08e47d4f2f20935b9c5c0e
fe1684ba3e16e9c3904b8a90f668a68e1cd4e604
/wealth/wealth-persist/src/test/java/org/solt/wealth/persist/common/EnumDAOTest.java
b55f09abd990253ff835befd137895df56590794
[]
no_license
pepper7/wealth
c77229708cf535a9ccad1438e6d63e5a6eb3f509
c5df597ae4e4eb102f7e793566ae2c076a385190
refs/heads/master
2021-01-20T12:11:33.420777
2016-01-08T09:38:16
2016-01-08T09:38:16
27,519,268
0
0
null
null
null
null
UTF-8
Java
false
false
1,149
java
package org.solt.wealth.persist.common; import java.sql.SQLException; import javax.annotation.Resource; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.solt.wealth.model.common.Enums; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations={"classpath*:/app-data-test.xml"}) public class EnumDAOTest { @Resource private EnumDAO dao; @Before public void before() { } @Test public void getEnumsById() throws SQLException { Enums enums = null; //查空记录 enums = new Enums(); String enumId = ""; enums.setEnumId(enumId); enums = dao.findByKey(enums); Assert.assertNull("失败,该记录应该不存在!",enums); //查存在记录 enums = new Enums(); enumId = "0101"; enums.setEnumId(enumId); enums = dao.findByKey(enums); Assert.assertNotNull("失败, 该记录应该存在!",enums); Assert.assertEquals(enumId, enums.getEnumId()); } }
[ "yasin.y.ren@gmail.com" ]
yasin.y.ren@gmail.com
0b2b050a860e28d429a4d8ad87c9e788480d002b
adbd3ddcd18921e614f56909068554967636ed89
/Question9_1.java
575d29dcd95d3dd19799a073a3635b916a4e51ea
[]
no_license
nangu21/java_practice
249c328bde23338f40e7b0131b4a5fef8773e558
da56cc8d6f2f95b061e6d23075dc646f490ebf49
refs/heads/main
2023-01-12T23:56:15.416026
2020-11-27T07:36:06
2020-11-27T07:36:06
301,378,833
0
0
null
null
null
null
UTF-8
Java
false
false
455
java
import java.io.*; import java.lang.*; public class question9_1{ public static void main(String[] args){ try{ String str; FileReader fr= new FileReader("today.txt"); BufferedReader br= new BufferedReader(fr); while(br.ready()){ str= br.readLine(); System.out.println(str); } br.close(); fr.close(); }catch(IOException e){ System.out.println("入力された名前のファイルは存在しません"); } } }
[ "noreply@github.com" ]
nangu21.noreply@github.com
49f9007978c0482a564ab4320318602ed57945e2
dafdbbb0234b1f423970776259c985e6b571401f
/allbinary_src/ThreadLibraryM/src/main/java/allbinary/thread/RunnableInterface.java
3708855891b8c58fc234e1d51ebe0d2829b9beaa
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
biddyweb/AllBinary-Platform
3581664e8613592b64f20fc3f688dc1515d646ae
9b61bc529b0a5e2c647aa1b7ba59b6386f7900ad
refs/heads/master
2020-12-03T10:38:18.654527
2013-11-17T11:17:35
2013-11-17T11:17:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
672
java
/* * AllBinary Open License Version 1 * Copyright (c) 2011 AllBinary * * By agreeing to this license you and any business entity you represent are * legally bound to the AllBinary Open License Version 1 legal agreement. * * You may obtain the AllBinary Open License Version 1 legal agreement from * AllBinary or the root directory of AllBinary's AllBinary Platform repository. * * Created By: Travis Berthelot * */ package allbinary.thread; public interface RunnableInterface extends Runnable { public boolean isRunning(); public void setRunning(boolean isRunning); //public Thread getThread(); public void setThread(Thread thread)throws Exception; }
[ "travisberthelot@hotmail.com" ]
travisberthelot@hotmail.com
dfbe047bc6ab9fe8adef21890e26de45884c3a27
1de157d1198295eb991f6f63db08159aaefc23b2
/app/src/main/java/pl/bandurski/piotr/taskorganizerpreview/data/SampleDataItem.java
9ce6b79c11f21164e584cce0051acedfce896ec1
[]
no_license
PiotrBandurski/TaskOrganizer
6fe0750e8d6040f3630b5a44959ac040951cf141
d4b86f5e4fb0c14dac910b1fb055e0ec66c8841a
refs/heads/master
2021-01-19T23:20:20.875374
2017-04-21T13:25:08
2017-04-21T13:25:08
88,965,570
0
0
null
null
null
null
UTF-8
Java
false
false
357
java
package pl.bandurski.piotr.taskorganizerpreview.data; import java.util.Random; /** * Created by piotr on 21/04/2017. */ public class SampleDataItem { private String sampleLabel = "Label"; public SampleDataItem() { sampleLabel += new Random().nextInt(16); } public String getSampleLabel() { return sampleLabel; } }
[ "Piotr" ]
Piotr
39e7fbb861a398e7ad0888cf60f6472a5e8f4ba4
55bbb333ec3b0972abe77f1c92d6550836606fd0
/30 Days Of Code/Day 07 - Arrays/Solution.java
8ddd9410102a074500273c9f038958e3e4dd0338
[]
no_license
builien2010/HackerRank_Solutions
4c70a39673719bf55373d5f3a0522f458f975260
9897ef6142aeee2d90de03aad4e90c3ceb3d96fa
refs/heads/master
2020-03-23T17:57:27.520110
2018-09-17T12:47:33
2018-09-17T12:47:33
141,882,815
1
0
null
null
null
null
UTF-8
Java
false
false
915
java
// Author: Lien Bui // GitHub: github.com/builien2010 // HackerRank: hackerrank.com/builien2010 import java.io.*; import java.math.*; import java.security.*; import java.text.*; import java.util.*; import java.util.concurrent.*; import java.util.regex.*; public class Solution { private static final Scanner scanner = new Scanner(System.in); public static void main(String[] args) { int n = scanner.nextInt(); scanner.skip("(\r\n|[\n\r\u2028\u2029\u0085])?"); int[] arr = new int[n]; String[] arrItems = scanner.nextLine().split(" "); scanner.skip("(\r\n|[\n\r\u2028\u2029\u0085])?"); for (int i = 0; i < n; i++) { int arrItem = Integer.parseInt(arrItems[i]); arr[i] = arrItem; } for ( int i = n-1; i >= 0; i--){ System.out.print(arr[i] + " "); } scanner.close(); } }
[ "noreply@github.com" ]
builien2010.noreply@github.com
4dd34589f921dfa5793b35b961b96c32a1aee872
70fdcc1acfcc11681f8250e3cb437ffe5958c991
/services/src/main/java/fr/alma/mw1516/services/exception/IMEIInvalidFormatException.java
52bd4b4b120c05e14e64282acf80a35aee6e9b52
[]
no_license
masters-info-nantes/bloffee
5981ccd33d7646049a0f7c0736a19d549178c6b1
27d9cff429d7e56e54b29f97bf51aebd7851868e
refs/heads/master
2021-01-10T07:16:05.724840
2015-12-04T16:07:04
2015-12-04T16:08:08
47,321,606
1
0
null
null
null
null
UTF-8
Java
false
false
184
java
package fr.alma.mw1516.services.exception; /** * Created on 12/3/15. * * @author Adrien Garandel, Nicolas Brondin */ public class IMEIInvalidFormatException extends Exception { }
[ "dralagen@dralagen.fr" ]
dralagen@dralagen.fr
bfcfa3c3250e204f6ff6700961cedc8944b373f4
baf53267cfa28a4c2a398ee9758da17aa09f3fb2
/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/OperationOutcomeUtil.java
f88262c43c65c1009bb73378253e021b01d08e9e
[ "LicenseRef-scancode-warranty-disclaimer", "Apache-2.0" ]
permissive
tadgh/hapi-fhir
d10e6fa95bf2e2266823fce6d306473335f1c333
ef923a77c48f98476bd82fec9bbd269a0e4a35ca
refs/heads/master
2020-04-11T05:42:08.047254
2019-09-30T22:08:25
2019-09-30T22:08:25
161,557,604
0
0
Apache-2.0
2019-09-30T22:08:28
2018-12-12T23:26:18
Java
UTF-8
Java
false
false
6,717
java
package ca.uhn.fhir.util; /* * #%L * HAPI FHIR - Core Library * %% * Copyright (C) 2014 - 2019 University Health Network * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * #L% */ import static org.apache.commons.lang3.StringUtils.isNotBlank; import java.util.List; import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.IBaseOperationOutcome; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IPrimitiveType; import ca.uhn.fhir.context.BaseRuntimeChildDefinition; import ca.uhn.fhir.context.BaseRuntimeElementCompositeDefinition; import ca.uhn.fhir.context.BaseRuntimeElementDefinition; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.FhirVersionEnum; import ca.uhn.fhir.context.RuntimeResourceDefinition; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; /** * Utilities for dealing with OperationOutcome resources across various model versions */ public class OperationOutcomeUtil { /** * Add an issue to an OperationOutcome * * @param theCtx * The fhir context * @param theOperationOutcome * The OO resource to add to * @param theSeverity * The severity (fatal | error | warning | information) * @param theDetails * The details string * @param theCode */ public static void addIssue(FhirContext theCtx, IBaseOperationOutcome theOperationOutcome, String theSeverity, String theDetails, String theLocation, String theCode) { IBase issue = createIssue(theCtx, theOperationOutcome); populateDetails(theCtx, issue, theSeverity, theDetails, theLocation, theCode); } private static IBase createIssue(FhirContext theCtx, IBaseResource theOutcome) { RuntimeResourceDefinition ooDef = theCtx.getResourceDefinition(theOutcome); BaseRuntimeChildDefinition issueChild = ooDef.getChildByName("issue"); BaseRuntimeElementCompositeDefinition<?> issueElement = (BaseRuntimeElementCompositeDefinition<?>) issueChild.getChildByName("issue"); IBase issue = issueElement.newInstance(); issueChild.getMutator().addValue(theOutcome, issue); return issue; } public static String getFirstIssueDetails(FhirContext theCtx, IBaseOperationOutcome theOutcome) { return getFirstIssueStringPart(theCtx, theOutcome, "diagnostics"); } public static String getFirstIssueLocation(FhirContext theCtx, IBaseOperationOutcome theOutcome) { return getFirstIssueStringPart(theCtx, theOutcome, "location"); } private static String getFirstIssueStringPart(FhirContext theCtx, IBaseOperationOutcome theOutcome, String name) { if (theOutcome == null) { return null; } RuntimeResourceDefinition ooDef = theCtx.getResourceDefinition(theOutcome); BaseRuntimeChildDefinition issueChild = ooDef.getChildByName("issue"); List<IBase> issues = issueChild.getAccessor().getValues(theOutcome); if (issues.isEmpty()) { return null; } IBase issue = issues.get(0); BaseRuntimeElementCompositeDefinition<?> issueElement = (BaseRuntimeElementCompositeDefinition<?>) theCtx.getElementDefinition(issue.getClass()); BaseRuntimeChildDefinition detailsChild = issueElement.getChildByName(name); List<IBase> details = detailsChild.getAccessor().getValues(issue); if (details.isEmpty()) { return null; } return ((IPrimitiveType<?>) details.get(0)).getValueAsString(); } /** * Returns true if the given OperationOutcome has 1 or more Operation.issue repetitions */ public static boolean hasIssues(FhirContext theCtx, IBaseOperationOutcome theOutcome) { if (theOutcome == null) { return false; } return getIssueCount(theCtx, theOutcome) > 0; } public static int getIssueCount(FhirContext theCtx, IBaseOperationOutcome theOutcome) { RuntimeResourceDefinition ooDef = theCtx.getResourceDefinition(theOutcome); BaseRuntimeChildDefinition issueChild = ooDef.getChildByName("issue"); return issueChild.getAccessor().getValues(theOutcome).size(); } public static IBaseOperationOutcome newInstance(FhirContext theCtx) { RuntimeResourceDefinition ooDef = theCtx.getResourceDefinition("OperationOutcome"); try { return (IBaseOperationOutcome) ooDef.getImplementingClass().newInstance(); } catch (InstantiationException e) { throw new InternalErrorException("Unable to instantiate OperationOutcome", e); } catch (IllegalAccessException e) { throw new InternalErrorException("Unable to instantiate OperationOutcome", e); } } private static void populateDetails(FhirContext theCtx, IBase theIssue, String theSeverity, String theDetails, String theLocation, String theCode) { BaseRuntimeElementCompositeDefinition<?> issueElement = (BaseRuntimeElementCompositeDefinition<?>) theCtx.getElementDefinition(theIssue.getClass()); BaseRuntimeChildDefinition detailsChild; detailsChild = issueElement.getChildByName("diagnostics"); BaseRuntimeChildDefinition codeChild = issueElement.getChildByName("code"); IPrimitiveType<?> codeElem = (IPrimitiveType<?>) codeChild.getChildByName("code").newInstance(codeChild.getInstanceConstructorArguments()); codeElem.setValueAsString(theCode); codeChild.getMutator().addValue(theIssue, codeElem); BaseRuntimeElementDefinition<?> stringDef = detailsChild.getChildByName(detailsChild.getElementName()); BaseRuntimeChildDefinition severityChild = issueElement.getChildByName("severity"); BaseRuntimeChildDefinition locationChild = issueElement.getChildByName("location"); IPrimitiveType<?> severityElem = (IPrimitiveType<?>) severityChild.getChildByName("severity").newInstance(severityChild.getInstanceConstructorArguments()); severityElem.setValueAsString(theSeverity); severityChild.getMutator().addValue(theIssue, severityElem); IPrimitiveType<?> string = (IPrimitiveType<?>) stringDef.newInstance(); string.setValueAsString(theDetails); detailsChild.getMutator().setValue(theIssue, string); if (isNotBlank(theLocation)) { IPrimitiveType<?> locationElem = (IPrimitiveType<?>) locationChild.getChildByName("location").newInstance(locationChild.getInstanceConstructorArguments()); locationElem.setValueAsString(theLocation); locationChild.getMutator().addValue(theIssue, locationElem); } } }
[ "jamesagnew@gmail.com" ]
jamesagnew@gmail.com
6f2b6a8bc602dc499a95ce65b035f9648f5e60ed
318b62b6575c3566f498c244d7b667354bbc6a4e
/app/src/androidTest/java/com/josenaves/udacity/fivethings/ApplicationTest.java
ab0ff1f5d0b5982c68704d94c7b03a5172f01976
[ "MIT" ]
permissive
josenaves/udacity-5-things
9ae7493e3cf76da97e573bb05edac7c967f544ed
1964debcb2b48168e1f04c4005efdb24791a8407
refs/heads/master
2021-01-01T19:30:51.466651
2015-10-22T18:16:39
2015-10-22T18:16:39
39,401,182
1
0
null
null
null
null
UTF-8
Java
false
false
363
java
package com.josenaves.udacity.fivethings; 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); } }
[ "josenaves@gmail.com" ]
josenaves@gmail.com
f941e27e342eb25807d50f7112ad205ff25f651a
c2f71118013cd3c0f0e9bdd7987cff1fbc801044
/module/vipshop-admin/Doc/v1/temp/src/main/java/io/swagger/client/ApiResponse.java
5c2273a908041edaf5d1907ebeb87a1596ce463a
[]
no_license
VellichorLK/emotibot-admin-api
74c11891350ad25c9ab5196544670aebafc78fdc
6e4f45e85d6836e89106dd7d1beffec141fff810
refs/heads/master
2022-11-11T23:43:19.271043
2019-08-22T10:18:55
2019-08-22T10:18:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,488
java
/* * 机器人设置API * This is api document page for robot setting RestAPIs * * OpenAPI spec version: 1.0.0 * Contact: danielwu@emotibot.com * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ package io.swagger.client; import java.util.List; import java.util.Map; /** * API response returned by API call. * * @param <T> The type of data that is deserialized from response body */ public class ApiResponse<T> { final private int statusCode; final private Map<String, List<String>> headers; final private T data; /** * @param statusCode The status code of HTTP response * @param headers The headers of HTTP response */ public ApiResponse(int statusCode, Map<String, List<String>> headers) { this(statusCode, headers, null); } /** * @param statusCode The status code of HTTP response * @param headers The headers of HTTP response * @param data The object deserialized from response bod */ public ApiResponse(int statusCode, Map<String, List<String>> headers, T data) { this.statusCode = statusCode; this.headers = headers; this.data = data; } public int getStatusCode() { return statusCode; } public Map<String, List<String>> getHeaders() { return headers; } public T getData() { return data; } }
[ "i.lu.f@hotmail.com.tw" ]
i.lu.f@hotmail.com.tw
8dc8b32099b103494af320950cf82c26f4c6c26e
0356bb92375c945d7e3cff1ba99f4c47c85fe678
/src/main/java/com/example/servicecustomer01/configuration/Config.java
f2998046be5a0f1bc1f3b771b0efb6f3ab77f879
[]
no_license
IvanChiu0/servicecustomer
883e2cde2936dccd1deb947c69cdb437ac27f75a
bb506a5f0ad03863b7d19e480d61e6d74787d1f6
refs/heads/master
2020-11-29T04:37:46.751228
2019-12-25T01:37:32
2019-12-25T01:37:32
230,023,485
0
0
null
null
null
null
UTF-8
Java
false
false
908
java
package com.example.servicecustomer01.configuration; import com.example.servicecustomer01.iRule.MyIRule; import com.netflix.hystrix.contrib.metrics.eventstream.HystrixMetricsStreamServlet; import com.netflix.loadbalancer.IRule; import com.netflix.loadbalancer.RandomRule; import org.springframework.boot.web.servlet.ServletRegistrationBean; import org.springframework.cloud.client.loadbalancer.LoadBalanced; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.client.RestTemplate; import javax.servlet.ServletRegistration; @Configuration public class Config { /** * ribbon访问引擎 * @return */ @Bean @LoadBalanced public RestTemplate restTemplate() { return new RestTemplate(); } // @Bean // public IRule iRule() { // return new MyIRule(); // } }
[ "409237119@qq.com" ]
409237119@qq.com
a152b57fd9aa50d8cfc1ac89e258c28b0cc31e9c
b07e80c5fc4c6336adcf99d385ab7b88c84f2c39
/server/car-service-core/src/main/java/com/huhuo/carservicecore/sys/district/IDaoCity.java
7ecbda77a3fd9c963579b904645a65daf00ea4c1
[]
no_license
Becker365/car-rental
a34ebe6cbaaf20ca7bdd46b1d89700967c6b69a0
a360c9eec844f9dcf95d52c5e73d8b1b2213b140
refs/heads/main
2023-04-10T06:12:56.023792
2020-12-26T14:43:40
2020-12-26T14:43:40
361,785,498
0
0
null
null
null
null
UTF-8
Java
false
false
161
java
package com.huhuo.carservicecore.sys.district; import com.huhuo.integration.base.IBaseExtenseDao; public interface IDaoCity<T> extends IBaseExtenseDao<T> { }
[ "Becker365@users.noreply.github.com" ]
Becker365@users.noreply.github.com
9ccae2e2f18028cec401f49554e98bd282557c21
97fd02f71b45aa235f917e79dd68b61c62b56c1c
/src/main/java/com/tencentcloudapi/trro/v20220325/models/ModifyDeviceRequest.java
20c7033e347c8b73764dc0cd9406269f3b1dfaa5
[ "Apache-2.0" ]
permissive
TencentCloud/tencentcloud-sdk-java
7df922f7c5826732e35edeab3320035e0cdfba05
09fa672d75e5ca33319a23fcd8b9ca3d2afab1ec
refs/heads/master
2023-09-04T10:51:57.854153
2023-09-01T03:21:09
2023-09-01T03:21:09
129,837,505
537
317
Apache-2.0
2023-09-13T02:42:03
2018-04-17T02:58:16
Java
UTF-8
Java
false
false
4,427
java
/* * Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.tencentcloudapi.trro.v20220325.models; import com.tencentcloudapi.common.AbstractModel; import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.Expose; import java.util.HashMap; public class ModifyDeviceRequest extends AbstractModel{ /** * 要修改设备归属项目的项目ID */ @SerializedName("ProjectId") @Expose private String ProjectId; /** * 要修改设备的设备ID */ @SerializedName("DeviceId") @Expose private String DeviceId; /** * 修改后的设备名称,不填则不修改 */ @SerializedName("DeviceName") @Expose private String DeviceName; /** * 修改后的设备认证口令,不填则不修改 */ @SerializedName("DeviceToken") @Expose private String DeviceToken; /** * Get 要修改设备归属项目的项目ID * @return ProjectId 要修改设备归属项目的项目ID */ public String getProjectId() { return this.ProjectId; } /** * Set 要修改设备归属项目的项目ID * @param ProjectId 要修改设备归属项目的项目ID */ public void setProjectId(String ProjectId) { this.ProjectId = ProjectId; } /** * Get 要修改设备的设备ID * @return DeviceId 要修改设备的设备ID */ public String getDeviceId() { return this.DeviceId; } /** * Set 要修改设备的设备ID * @param DeviceId 要修改设备的设备ID */ public void setDeviceId(String DeviceId) { this.DeviceId = DeviceId; } /** * Get 修改后的设备名称,不填则不修改 * @return DeviceName 修改后的设备名称,不填则不修改 */ public String getDeviceName() { return this.DeviceName; } /** * Set 修改后的设备名称,不填则不修改 * @param DeviceName 修改后的设备名称,不填则不修改 */ public void setDeviceName(String DeviceName) { this.DeviceName = DeviceName; } /** * Get 修改后的设备认证口令,不填则不修改 * @return DeviceToken 修改后的设备认证口令,不填则不修改 */ public String getDeviceToken() { return this.DeviceToken; } /** * Set 修改后的设备认证口令,不填则不修改 * @param DeviceToken 修改后的设备认证口令,不填则不修改 */ public void setDeviceToken(String DeviceToken) { this.DeviceToken = DeviceToken; } public ModifyDeviceRequest() { } /** * NOTE: Any ambiguous key set via .set("AnyKey", "value") will be a shallow copy, * and any explicit key, i.e Foo, set via .setFoo("value") will be a deep copy. */ public ModifyDeviceRequest(ModifyDeviceRequest source) { if (source.ProjectId != null) { this.ProjectId = new String(source.ProjectId); } if (source.DeviceId != null) { this.DeviceId = new String(source.DeviceId); } if (source.DeviceName != null) { this.DeviceName = new String(source.DeviceName); } if (source.DeviceToken != null) { this.DeviceToken = new String(source.DeviceToken); } } /** * Internal implementation, normal users should not use it. */ public void toMap(HashMap<String, String> map, String prefix) { this.setParamSimple(map, prefix + "ProjectId", this.ProjectId); this.setParamSimple(map, prefix + "DeviceId", this.DeviceId); this.setParamSimple(map, prefix + "DeviceName", this.DeviceName); this.setParamSimple(map, prefix + "DeviceToken", this.DeviceToken); } }
[ "tencentcloudapi@tencent.com" ]
tencentcloudapi@tencent.com
6704bf61692272473ba4dcec7f53c7fe2856c4ba
35107dc613dd6e7c56e4548e2e66756b0e067653
/src/main/java/service/impl/MstKotaSvcImpl.java
db92b98d3fd16ce502f8739c44372e807cd73421
[]
no_license
yadsyah/Spring-ZkFramework
3c48583e3fb11e2e48b92c1e04fb8af95b0ec405
47108c16e6516ea0c95ec49ece2362bee764a27f
refs/heads/master
2021-09-04T13:11:07.853460
2018-01-19T02:37:29
2018-01-19T02:37:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,816
java
package service.impl; import java.util.ArrayList; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import dao.MstKotaDao; import dao.MstProvinsiDao; import dto.MstKotaDto; import entity.MstKota; import entity.MstKotaPk; import service.MstKotaSvc; @Service("mstKotaSvc") @Transactional public class MstKotaSvcImpl implements MstKotaSvc { @Autowired MstKotaDao mstKotaDao; @Autowired MstProvinsiDao mstProvinsiDao; @Override public List<MstKotaDto> findAllKota() { // TODO Auto-generated method stub List<MstKota> mstKotas = mstKotaDao.findAllKota(); List<MstKotaDto> mstKotaDtos = new ArrayList<>(); for (MstKota mk : mstKotas) { MstKotaDto mstKotaDto = new MstKotaDto(); mstKotaDto.setKodeKota(mk.getKodeKota()); mstKotaDto.setKodeProvinsi(mk.getKodeProvinsi()); mstKotaDto.setNamaKota(mk.getNamaKota()); mstKotaDtos.add(mstKotaDto); } return mstKotaDtos; } @Override public void delete(String kodeKota) { // TODO Auto-generated method stub MstKotaPk mstKotaPK = new MstKotaPk(); mstKotaPK.setKodeKota(kodeKota); mstKotaDao.delete(mstKotaPK); } @Override public void save(MstKotaDto mstKotaDto) { // TODO Auto-generated method stub MstKota mstKota = new MstKota(); mstKota.setKodeKota(mstKotaDto.getKodeKota()); mstKota.setKodeProvinsi(mstKotaDto.getKodeProvinsi()); mstKota.setNamaKota(mstKotaDto.getNamaKota()); mstKotaDao.save(mstKota); } @Override public void update(MstKotaDto mstKotaDto) { // TODO Auto-generated method stub MstKota mstKota = new MstKota(); mstKota.setKodeKota(mstKotaDto.getKodeKota()); mstKota.setKodeProvinsi(mstKotaDto.getKodeProvinsi()); mstKota.setNamaKota(mstKotaDto.getNamaKota()); mstKotaDao.save(mstKota); } @Override public MstKotaDto findOneKota(String kodeKota) { // TODO Auto-generated method stub MstKota kota = mstKotaDao.findOneKota(kodeKota); MstKotaDto mstKotaDto = new MstKotaDto(); if (kota != null) { mstKotaDto.setKodeKota(kota.getKodeKota()); mstKotaDto.setKodeProvinsi(kota.getKodeProvinsi()); mstKotaDto.setNamaKota(kota.getNamaKota()); return mstKotaDto; } return mstKotaDto; } @Override public List<MstKotaDto> findAllKotaByProvinsi(String kodeProvinsi) { List<MstKota> listObject = mstKotaDao.findKotaByIdProvinsi(kodeProvinsi); List<MstKotaDto> mstKotaDtos = new ArrayList<>(); for (MstKota objects : listObject) { MstKotaDto mstKotaDto = new MstKotaDto(); mstKotaDto.setKodeKota(objects.getKodeKota()); mstKotaDto.setKodeProvinsi(objects.getKodeProvinsi()); mstKotaDto.setNamaKota(objects.getNamaKota()); mstKotaDtos.add(mstKotaDto); } return mstKotaDtos; } }
[ "diyansetiyadi@gmail.com" ]
diyansetiyadi@gmail.com
11a0f10c70a58e8f9cec4a6af8481c0d0f1101a9
dd2e7df1852584980a5b1f0959a6032fd4d181ad
/src/NewThread4.java
e55c9f5021b52d02246f54b691889a24eeb83887
[]
no_license
AnnaVitalevna/lab6
aaeac909fd976978d1fb40058a133b70b8f21f43
50652e1a0137506749c0c429e4945504df284950
refs/heads/master
2020-04-16T10:07:37.210609
2019-01-13T10:31:17
2019-01-13T10:31:17
163,088,011
0
0
null
2019-01-11T11:15:48
2018-12-25T14:09:28
Java
WINDOWS-1251
Java
false
false
1,815
java
//Применение методов isAlive() и join() public class NewThread4 implements Runnable { String name; Thread t; NewThread4 (String threadname){ name=threadname; t= new Thread(this,name); System.out.println("Новый поток: "+t); t.start(); } public void run(){ try{ for (int i=5;i>0;i--){ System.out.println(name+": "+i); Thread.sleep(1000); } } catch (InterruptedException e){ System.out.println(name+" прерван."); } System.out.println(name+" завершен."); } } class DemoJoin { public static void main (String args[]){ NewThread4 ob1 = new NewThread4("Один"); NewThread4 ob2 = new NewThread4("Два"); NewThread4 ob3 = new NewThread4("Три"); System.out.println("Поток Один запущен: "+ob1.t.isAlive()); System.out.println("Поток Два запущен: "+ob2.t.isAlive()); System.out.println("Поток Три запущен: "+ob3.t.isAlive()); try{ System.out.println("Ожидание завершения потоков..."); ob1.t.join(); ob2.t.join(); ob3.t.join(); } catch (InterruptedException e){ System.out.println("Главный поток прерван."); } System.out.println("Поток Один запущен: "+ob1.t.isAlive()); System.out.println("Поток Два запущен: "+ob2.t.isAlive()); System.out.println("Поток Три запущен: "+ob3.t.isAlive()); System.out.println("Главный поток завершен."); } }
[ "noreply@github.com" ]
AnnaVitalevna.noreply@github.com
546a2c00d58c10f4d064be62dd1fa96180d1ae9d
f03edca3906885b6194b369d3b1b4ac9152baa98
/src-def/org/tds/sgh/logic/ITomarReservaController.java
b1fba5a523fa6f28813eb3041a17f6932d990269
[]
no_license
rioseco/JavaProjects
dfddd209edef5fa12a863b3d423dad604e0d69c6
a5759dcba4964a72f7c8a3a27d03f6df8e87e864
refs/heads/master
2016-09-11T02:58:06.964766
2013-08-24T18:47:23
2013-08-24T18:51:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
535
java
package org.tds.sgh.logic; import java.util.*; import org.tds.sgh.dto.*; public interface ITomarReservaController extends IHacerReservaController, IIdentificarReservaClienteController { List<ReservaDto> buscarReservasNoTomadas(String nombreHotel, GregorianCalendar fecha); ReservaDto seleccionarReserva(long codigoReserva); HuespedDto registrarHuesped(long codigoReserva, String nombre, String documento); HabitacionDto tomarReserva(long codigoReserva); }
[ "rioseco.luis@gmail.com" ]
rioseco.luis@gmail.com
8cf481562051603daf2c619022b74cfa2a55d5ee
1c5196893c4fa68b75469fb0d616b6bee62f7763
/Android UI/RelativeLayoutExample/app/src/androidTest/java/com/example/asus/relativelayoutexample/ExampleInstrumentedTest.java
546fc3c637a0b93410b58b0ff2ddffa354cd4bbd
[]
no_license
Rache1LiN/learn-in-Android
a1872bafaf2e8e71f1396056626b275af14e5592
5635ffd679d23a11512aebda945ffc00e71cad2a
refs/heads/master
2021-08-31T13:43:54.616024
2017-12-21T14:49:02
2017-12-21T14:49:02
113,399,174
0
1
null
null
null
null
UTF-8
Java
false
false
780
java
package com.example.asus.relativelayoutexample; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumentation test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.asus.relativelayoutexample", appContext.getPackageName()); } }
[ "948094798@qq.com" ]
948094798@qq.com
ececfb9ce75392b19ccb43cdbd4be3f2079a4ff7
dd8cf499db557a3dd446f63bd4ea533567a085b1
/chapter-5-spring-boot-paging-sorting/src/main/java/cn/springboot/service/impl/UserServiceImpl.java
be489bf27332f345fc4ef086e29654f1a0ac4c4f
[]
no_license
bailj007/springbootlearning
6562d43637ec59aac8c5bc3c07c0ebb15779ae72
8fca107d637c49fabc5f9c37d6e00ac339b02cb2
refs/heads/master
2021-07-08T03:29:07.158097
2019-08-09T01:39:29
2019-08-09T01:39:29
201,013,933
0
0
null
2020-10-13T15:10:12
2019-08-07T09:06:09
Java
UTF-8
Java
false
false
1,155
java
package cn.springboot.service.impl; import cn.springboot.domain.User; import cn.springboot.domain.UserRepository; import cn.springboot.service.UserService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; /** * User 业务层实现 * * Created by bysocket on 18/09/2017. */ @Service public class UserServiceImpl implements UserService { private static final Logger LOGGER = LoggerFactory.getLogger(UserServiceImpl.class); @Autowired UserRepository userRepository; @Override public Page<User> findByPage(Pageable pageable) { LOGGER.info(" \n 分页查询用户:" + " PageNumber = " + pageable.getPageNumber() + " PageSize = " + pageable.getPageSize()); return userRepository.findAll(pageable); } @Override public User insertByUser(User user) { LOGGER.info("新增用户:" + user.toString()); return userRepository.save(user); } }
[ "736198133@qq.com" ]
736198133@qq.com
ef5498b95ee642862a18ff720ecfd65ab5be102f
531452124c7cf2e89b878c07be41045b17ced567
/src/main/java/com/niche/ng/config/ApplicationProperties.java
99bcb429aba5f7e0957fe7efa1b456b08ceef4ba
[]
no_license
AnithaRaja90/ProjectGreenHands_isha
b93619014b74817c669c21b9bf5e7bfc29b5a03c
377e43e60ae78c7e27d7d8a8caaf4f2ade65b446
refs/heads/master
2020-03-26T19:34:46.965548
2018-08-19T04:39:04
2018-08-19T04:39:04
145,272,857
0
0
null
null
null
null
UTF-8
Java
false
false
416
java
package com.niche.ng.config; import org.springframework.boot.context.properties.ConfigurationProperties; /** * Properties specific to Project GH. * <p> * Properties are configured in the application.yml file. * See {@link io.github.jhipster.config.JHipsterProperties} for a good example. */ @ConfigurationProperties(prefix = "application", ignoreUnknownFields = false) public class ApplicationProperties { }
[ "ptnaveenraj@outlook.com" ]
ptnaveenraj@outlook.com
9fefdf5fa495729ec8e3b18991003f4abae0ad26
07f91d8a46c580f5a8a31d8235ad78a8d94497be
/CoreJavaBasics/src/cpycons/CpyConstructorTest.java
4cea5722b5b269a27b9ebaf6c9e52c6f5c6a00d6
[]
no_license
harshalp27/BackupCodesYTPL
39fd47595bb8ab395105a1a60f07d023ce7d36be
47d3ffbd8dcaceb7b0b8e8809964de40b8005660
refs/heads/master
2022-12-31T00:18:22.579962
2019-06-01T18:51:55
2019-06-01T18:51:55
189,712,394
0
0
null
2022-12-16T06:33:46
2019-06-01T09:05:26
Java
UTF-8
Java
false
false
446
java
package cpycons; public class CpyConstructorTest { public static void main(String[] args) { PointOne one = new PointOne(1,2); PointTwo two = new PointTwo(1,2,3); PointOne clone1 = new PointOne(one); PointOne clone2 = new PointOne(two); //Let check for class types System.out.println(clone1.getClass()); System.out.println(clone2.getClass()); } }
[ "harshalp28@gmail.com" ]
harshalp28@gmail.com
ed622bf31b6c8fde3b740f120a28bfd34a9f6533
7d2b33e68e80ca06701f090f1b95425bee0e3aaf
/src/main/java/arrays/Solution.java
cf2532d58423977038a38f758c3f4c1c758ee1d4
[]
no_license
fanonxr/Interview-Prep-Repo
a2d8b8aaf84b5b60f7bd73f8bcbfa478f5860ec7
94b152c721dba5328b42dd8216e5d11dfa6061f3
refs/heads/master
2021-06-13T02:22:05.204622
2020-05-19T00:48:24
2020-05-19T00:48:24
254,412,210
0
0
null
null
null
null
UTF-8
Java
false
false
2,407
java
package arrays; import java.util.HashMap; import java.util.Map; public class Solution { public static void main(String[] args) { int[] testSubArraySum = new int[]{3, 4, 7, 2, -3, 1, 4, 2}; int test1 = subArraySum(testSubArraySum, 7); System.out.println(test1); } public static int findMinInRotatedArray(int[] nums) { // check for edge cases if (nums.length <= 0) { return -1; } if (nums.length == 1) { return nums[0]; } // execute binary search in order to find the elements int start = 0; int end = nums.length - 1; while (start < end) { // calculate the midpoint int mid = start + (end - start) / 2; // search for the mid if (mid > 0 && nums[mid] < nums[mid - 1]) { return nums[mid]; // check if the value at the midpoint is greater than the value at the end } else if (nums[start] <= nums[mid] && nums[mid] > nums[end]) { // search higher half start = mid + 1; } else { // else search the lower half end = mid - 1; } } return nums[start]; } public static int subArraySum(int[] nums, int k) { // use a hashmap to store if we have seen that sum Map<Integer, Integer> map = new HashMap<>(); map.put(0, 1); // we have seen 0 once // keep track of the sum int sum = 0; // how many sub arrays will calculate up to int result = 0; for (int num : nums) { // add the current num to our sum sum += num; // check if the map contains if (map.containsKey(sum - k)) { result += map.get(sum - k); } map.put(sum, map.getOrDefault(sum, 0) + 1); } return result; } public int[][] rotate(int[][] matrix) { // rotating a matrix clockwise int size = matrix.length - 1; for (int layer = 0; layer < (matrix.length / 2); layer++) { for (int i = layer; i < size - layer; i++) { // store the elements at each position int top = matrix[layer][i]; int right = matrix[i][size - layer]; int bottom = matrix[size - layer][size - i]; int left = matrix[size - i][layer]; // swap the elements 90 degrees matrix[layer][i] = left; matrix[i][size - layer] = top; matrix[size - layer][size - i] = right; matrix[size - i][layer] = bottom; } } return matrix; } }
[ "fanonxdevelops@gmail.com" ]
fanonxdevelops@gmail.com
5deea5d587b31ee2e86c0c710a539db4d88988b5
35a545de13f5d684cefa000be5619fd1ca43c559
/src/main/java/de/flapdoodle/embed/process/config/IRuntimeConfig.java
901ed43aa0cf986884041b81bf45691987af4269
[]
no_license
chrbayer84/de.flapdoodle.embed.process
359b82b340842831eb9a0fc7a6ab08905134be39
0870edb8664705dd4b88c478dc749f1d63e215f4
refs/heads/master
2021-01-17T08:18:16.936053
2013-08-27T04:40:18
2013-08-27T04:40:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,358
java
/** * Copyright (C) 2011 * Michael Mosmann <michael@mosmann.de> * Martin Jöhren <m.joehren@googlemail.com> * * with contributions from * konstantin-ba@github,Archimedes Trajano (trajano@github) * * 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 de.flapdoodle.embed.process.config; import de.flapdoodle.embed.process.config.io.ProcessOutput; import de.flapdoodle.embed.process.config.store.IDownloadConfig; import de.flapdoodle.embed.process.extract.ITempNaming; import de.flapdoodle.embed.process.io.directories.IDirectory; import de.flapdoodle.embed.process.runtime.ICommandLinePostProcessor; import de.flapdoodle.embed.process.store.IArtifactStore; public interface IRuntimeConfig { ProcessOutput getProcessOutput(); ICommandLinePostProcessor getCommandLinePostProcessor(); IArtifactStore getArtifactStore(); }
[ "michael@mosmann.de" ]
michael@mosmann.de
fe73699df3868b2f7e68faf17652872e18dea87f
fb1f54eb41c72170e0844d17593432d07f4ebc3c
/src/main/java/com/jasperwireless/api/ws/schema/ChangeSubscriberServiceResponse.java
d16af3716a596e5db417c0ba367b871dcd327363
[]
no_license
lxchen2001/jasper-wireless-api
a46635f6ccd6e4decf4d758f9e6423822dd77c93
3b4b4f866c1d92cbcb3cb5e4b4ce62280adc8d83
refs/heads/master
2021-01-19T21:05:14.223937
2016-10-28T19:15:46
2016-10-28T19:15:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
879
java
package com.jasperwireless.api.ws.schema; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;extension base="{http://api.jasperwireless.com/ws/schema}SubscriberResponseType"> * &lt;anyAttribute processContents='lax'/> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") @XmlRootElement(name = "ChangeSubscriberServiceResponse") public class ChangeSubscriberServiceResponse extends SubscriberResponseType { }
[ "cesar.alvernaz@gmail.com" ]
cesar.alvernaz@gmail.com
003e4c41b8ddf935b7a3f8e061d57fe650a53abf
40cc987bce56500a8de2718c8377397ebef53748
/src/main/java/com/wangwenjun/design_pattern/chapter8/AsynFuture.java
c0a2c996002f796d8f5b83accd5f5ff6d137b99d
[]
no_license
xiaotaowei1992/JavaThread
5adbf72ece3563bb5c9b77939bcab42c4f5b7d5a
9b54083d90a1e732c323a0e247def8ae400b1363
refs/heads/master
2021-06-29T04:53:32.314190
2019-07-19T03:16:24
2019-07-19T03:16:24
139,999,086
0
0
null
null
null
null
UTF-8
Java
false
false
707
java
package com.wangwenjun.design_pattern.chapter8; /*************************************** * @author:Alex Wang * @Date:2017/3/22 QQ:532500648 * QQ交流群:286081824 ***************************************/ public class AsynFuture<T> implements Future<T> { private volatile boolean done = false; private T result; public void done(T result) { synchronized (this) { this.result = result; this.done = true; this.notifyAll(); } } @Override public T get() throws InterruptedException { synchronized (this) { while (!done) { this.wait(); } } return result; } }
[ "weixiaotao@shein.com" ]
weixiaotao@shein.com
158ba461cd5c2da4a8406ae4c783e10b4b84febd
b7d9aac03b6f449b038d8546dd7b6e3aac6b171c
/src/main/java/Reproductor/Modificar.java
fed1772d9d92bc322c7fbb307e33a6fefe9f142e
[]
no_license
jamesg19/Practica1_OCL2
0c979743478c919d1d0c111d477274f396b721fa
93806160bcbf36edbd19cfb4dd8265726d1c1dea
refs/heads/master
2023-07-28T18:41:11.065427
2021-09-10T20:32:34
2021-09-10T20:32:34
401,389,792
0
0
null
null
null
null
UTF-8
Java
false
false
817
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package Reproductor; import Archivos.LecturaArchivoBinario; /** * * @author James Gramajo */ public class Modificar { private String nombrePista; private Pista pista; public Modificar(String nombrePista) { this.nombrePista = nombrePista; } public String modificar(){ String codigo_pista=""; LecturaArchivoBinario arch = new LecturaArchivoBinario(); //obtenemos el objeto pista seleccionado pista=null; pista =(Pista) arch.LeerArchivo(nombrePista); codigo_pista=pista.getCODIGO(); return codigo_pista; } }
[ "48737452+jamesg19@users.noreply.github.com" ]
48737452+jamesg19@users.noreply.github.com
74cd6b6c909b321e5679011aeae34c468ac14266
bdaca4aa07672d6b73c8eb6491290bbcb5d53030
/927-Three-Equal-Parts/solution.java
3519dc181093645e830810ed3a621ec796b0eb76
[]
no_license
zacw7/LeetCodeSolution
9b4102ffa69ff0d0fc15bd546c7fa0c8ae9971a7
6293fa5893864dc52d161c2532bc985e12d07598
refs/heads/master
2022-03-29T13:14:06.664763
2020-01-19T21:27:40
2020-01-19T21:27:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,148
java
class Solution { public int[] threeEqualParts(int[] A) { int count = 0; for (int n : A) { count += n; } if (count == 0) { return new int[]{0, A.length - 1}; } if (count % 3 > 0) { return new int[]{-1, -1}; } int each = count / 3; int idx1 = -1, idx2 = -1, idx3 = -1; for (int cnt = 0, i = 0; i < A.length; i++) { cnt += A[i]; if (cnt == 1) { if (idx1 == -1) idx1 = i; } else if (cnt == each + 1) { if (idx2 == -1) idx2 = i; } else if (cnt == each * 2 + 1) { idx3 = i; break; } } int shift = 1; while (idx3 + shift < A.length) { if (idx1 + shift >= idx2 || idx2 + shift >= idx3 || A[idx1 + shift] != A[idx2 + shift] || A[idx2 + shift] != A[idx3 + shift]) { return new int[]{-1, -1}; } shift++; } return new int[]{idx1 + shift - 1, idx2 + shift}; } }
[ "zac.wen7@gmail.com" ]
zac.wen7@gmail.com
eee756958138d117b0ef4e2e27e1d495447ed364
dbdd5e0191f5f86a0389c7de304ab861084db507
/src/ao/games/console/SpaceShip.java
97d940aa9df532a8bbb0690a9f6d2da0ccf1c147
[]
no_license
AsyaCemeniel/Star-Wars
1c44b537f69dddc9bcffcbd991da8edc3b49d117
46c1aace405f779527e6410cb453c4af675b3f5e
refs/heads/master
2022-07-16T02:07:51.403485
2020-05-13T15:14:20
2020-05-13T15:14:20
263,665,669
0
0
null
null
null
null
UTF-8
Java
false
false
922
java
package ao.games.console; public class SpaceShip extends BaseObject { private static int[][] matrix = { {0, 0, 0, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {1, 0, 1, 0, 1}, {1, 1, 1, 1, 1}, }; private double dx = 0; public SpaceShip(double x, double y) { super(x, y, 3); } public void moveLeft() { dx = -1; } public void moveRight() { dx = 1; } @Override public void draw(Canvas canvas) { canvas.drawMatrix(x - radius + 1, y - radius + 1, matrix, 'M'); } @Override public void move() { x = x + dx; checkBorders(radius, Space.game.getWidth() - radius + 1, 1, Space.game.getHeight() + 1); } public void fire() { Space.game.getRockets().add(new Rocket(x - 2, y)); Space.game.getRockets().add(new Rocket(x + 2, y)); } }
[ "noreply@github.com" ]
AsyaCemeniel.noreply@github.com
605b1a6a26fea1738507bb4dc85ee6743771a1c9
a566b8ac1a4dcd26edb73aec179bda3d30f6518b
/src/Shelf.java
f68e87388f20e9eb64bd114326e50c1022641bf1
[]
no_license
Clement05/3D-Bin-Packing-BFDH
82956d352ed45949997048707f160ac02a4f84ae
46dae88debd3be1476629238a53a60b86c823002
refs/heads/master
2021-01-13T11:51:28.714401
2016-12-28T10:50:29
2016-12-28T10:50:29
77,496,764
1
0
null
null
null
null
UTF-8
Java
false
false
1,695
java
import java.util.LinkedList; public class Shelf { private int height; private int id; private LinkedList<Row> rows = new LinkedList<Row>(); public Shelf(){ this.height = 0; this.id = 0; } public Shelf(int id, int height){ this.height = height; this.id =id; } public Shelf(int id, Row currRow) { this.id = id; this.rows.add(currRow); this.height = currRow.getHeight(); } public boolean CanContains(Row currRow) { int currWidth = 0; for (Row r : rows) { currWidth += r.getWidth(); } currWidth += currRow.getWidth(); if(this.height >= currRow.getHeight() && currWidth <= 10){ return true; } return false; } public boolean BetterThan(Row currRow, Shelf currShelf) { int currWidth = 0; int widthToTest = 0; for (Row r : rows) { widthToTest += r.getWidth(); } widthToTest += currRow.getWidth(); for (Row r : currShelf.rows) { currWidth += r.getWidth(); } currWidth += currRow.getWidth();; if(widthToTest >= currWidth || (widthToTest <= 10 && currWidth > 10)){ return true; } else { return false; } } public void AddRow(Row currRow) { int y = 0; for (Row r : rows) { for (Part p : r.getParts()) { p.setY1(y); } y += r.getWidth(); } rows.add(currRow); } public int getId() { return id; } public void setId(int id) { this.id = id; } public int getHeight() { return height; } public void setHeight(int height) { this.height = height; } public LinkedList<Row> getRows() { return rows; } public void setRows(LinkedList<Row> rows) { this.rows = rows; } }
[ "clement.girard@dptechnology.com" ]
clement.girard@dptechnology.com
dcddc7dc3c743147e4ff91b1acd1cd13a5f096d1
e24a6a89bf2415f1af66387086ebed209a988d15
/Pet-Clinic/pet-clinic-data/src/main/java/com/technolearns/model/Person.java
1034de5e2e5c1e5ce6810c7b9bc6bed9583c97b5
[]
no_license
arjunxxx/Pet-Clinic
f1afa2f0a6d4137f2edd8a5365858c59dd887e39
b1285666fff841aa2ff696aed3e6bfe8d2a072d5
refs/heads/master
2023-05-27T20:33:06.035875
2021-06-14T17:45:59
2021-06-14T17:45:59
370,351,779
0
0
null
2021-06-14T17:22:35
2021-05-24T12:55:31
Java
UTF-8
Java
false
false
639
java
package com.technolearns.model; import javax.persistence.Column; import javax.persistence.MappedSuperclass; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import lombok.experimental.SuperBuilder; @Getter @Setter @SuperBuilder @NoArgsConstructor @AllArgsConstructor @MappedSuperclass // To specify that its just a parent class and do not need separate column in // DB. It just gives attributes to sub classes. public class Person extends BaseEntity { @Column(name = "first_name") private String firstname; @Column(name = "last_name") private String lastname; }
[ "arjunrajeev1@gmail.com" ]
arjunrajeev1@gmail.com
8e50857feb8b2acab1301971bed68cb22e948cce
2866b18c9a305370aaac463cb60a0de2c9c92399
/Open Camera/src/open/camera/OpenCamera.java
3a4ea007f6235d402129d5d99e6a5d92b6518009
[]
no_license
ShaminAsfaq/Java-with-NetBeans
30ec0ca186044a1fb6231368a1d3e2fc619efe78
a2f4df2d82080f02d9cbee6de240539acc511f11
refs/heads/master
2021-01-12T04:46:21.683457
2019-07-01T21:07:34
2019-07-01T21:07:34
77,791,799
0
0
null
null
null
null
UTF-8
Java
false
false
929
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 open.camera; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.stage.Stage; /** * * @author shamin */ public class OpenCamera extends Application { @Override public void start(Stage stage) throws Exception { Parent root = FXMLLoader.load(getClass().getResource("FXMLDocument.fxml")); Scene scene = new Scene(root); stage.setScene(scene); stage.show(); } /** * @param args the command line arguments */ public static void main(String[] args) { launch(args); } @Override public void stop(){ System.exit(0); } }
[ "shamin.asfaq@gmail.com" ]
shamin.asfaq@gmail.com
90a9af5bc4d2f0b5ddd11a6a712414180c6149ee
d2eee6e9a3ad0b3fd2899c3d1cf94778615b10cb
/PROMISE/archives/ant/1.3/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java
6b0b374de85917a37632a7d1007ca0bf035ade17
[]
no_license
hvdthong/DEFECT_PREDICTION
78b8e98c0be3db86ffaed432722b0b8c61523ab2
76a61c69be0e2082faa3f19efd76a99f56a32858
refs/heads/master
2021-01-20T05:19:00.927723
2018-07-10T03:38:14
2018-07-10T03:38:14
89,766,606
5
1
null
null
null
null
UTF-8
Java
false
false
8,467
java
package org.apache.tools.ant.taskdefs.optional.junit; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; import junit.framework.*; import java.lang.reflect.*; import java.io.*; import java.util.StringTokenizer; import java.util.Vector; /** * Simple Testrunner for JUnit that runs all tests of a testsuite. * * <p>This TestRunner expects a name of a TestCase class as its * argument. If this class provides a static suite() method it will be * called and the resulting Test will be run. * * <p>Otherwise all public methods starting with "test" and taking no * argument will be run. * * <p>Summary output is generated at the end. * * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a> */ public class JUnitTestRunner implements TestListener { /** * No problems with this test. */ public static final int SUCCESS = 0; /** * Some tests failed. */ public static final int FAILURES = 1; /** * An error occured. */ public static final int ERRORS = 2; /** * Holds the registered formatters. */ private Vector formatters = new Vector(); /** * Collects TestResults. */ private TestResult res; /** * Do we stop on errors. */ private boolean haltOnError = false; /** * Do we stop on test failures. */ private boolean haltOnFailure = false; /** * The corresponding testsuite. */ private Test suite = null; /** * Exception caught in constructor. */ private Exception exception; /** * Returncode */ private int retCode = SUCCESS; /** * The TestSuite we are currently running. */ private JUnitTest junitTest; /** * Constructor for fork=true or when the user hasn't specified a * classpath. */ public JUnitTestRunner(JUnitTest test, boolean haltOnError, boolean haltOnFailure) { this(test, haltOnError, haltOnFailure, null); } /** * Constructor to use when the user has specified a classpath. */ public JUnitTestRunner(JUnitTest test, boolean haltOnError, boolean haltOnFailure, ClassLoader loader) { this.junitTest = test; this.haltOnError = haltOnError; this.haltOnFailure = haltOnFailure; try { Class testClass = null; if (loader == null) { testClass = Class.forName(test.getName()); } else { testClass = loader.loadClass(test.getName()); } Method suiteMethod = null; try { suiteMethod= testClass.getMethod("suite", new Class[0]); } catch(Exception e) { } if (suiteMethod != null){ suite = (Test)suiteMethod.invoke(null, new Class[0]); } else { suite= new TestSuite(testClass); } } catch(Exception e) { retCode = ERRORS; exception = e; } } public void run() { res = new TestResult(); res.addListener(this); for (int i=0; i < formatters.size(); i++) { res.addListener((TestListener)formatters.elementAt(i)); } long start = System.currentTimeMillis(); fireStartTestSuite(); for (int i=0; i < formatters.size(); i++) { ((TestListener)formatters.elementAt(i)).addError(null, exception); } junitTest.setCounts(1, 0, 1); junitTest.setRunTime(0); } else { suite.run(res); junitTest.setCounts(res.runCount(), res.failureCount(), res.errorCount()); junitTest.setRunTime(System.currentTimeMillis() - start); } fireEndTestSuite(); if (retCode != SUCCESS || res.errorCount() != 0) { retCode = ERRORS; } else if (res.failureCount() != 0) { retCode = FAILURES; } } /** * Returns what System.exit() would return in the standalone version. * * @return 2 if errors occurred, 1 if tests failed else 0. */ public int getRetCode() { return retCode; } /** * Interface TestListener. * * <p>A new Test is started. */ public void startTest(Test t) {} /** * Interface TestListener. * * <p>A Test is finished. */ public void endTest(Test test) {} /** * Interface TestListener for JUnit &lt;= 3.4. * * <p>A Test failed. */ public void addFailure(Test test, Throwable t) { if (haltOnFailure) { res.stop(); } } /** * Interface TestListener for JUnit &gt; 3.4. * * <p>A Test failed. */ public void addFailure(Test test, AssertionFailedError t) { addFailure(test, (Throwable) t); } /** * Interface TestListener. * * <p>An error occured while running the test. */ public void addError(Test test, Throwable t) { if (haltOnError) { res.stop(); } } private void fireStartTestSuite() { for (int i=0; i<formatters.size(); i++) { ((JUnitResultFormatter)formatters.elementAt(i)).startTestSuite(junitTest); } } private void fireEndTestSuite() { for (int i=0; i<formatters.size(); i++) { ((JUnitResultFormatter)formatters.elementAt(i)).endTestSuite(junitTest); } } public void addFormatter(JUnitResultFormatter f) { formatters.addElement(f); } /** * Entry point for standalone (forked) mode. * * Parameters: testcaseclassname plus parameters in the format * key=value, none of which is required. * * <table cols="4" border="1"> * <tr><th>key</th><th>description</th><th>default value</th></tr> * * <tr><td>haltOnError</td><td>halt test on * errors?</td><td>false</td></tr> * * <tr><td>haltOnFailure</td><td>halt test on * failures?</td><td>false</td></tr> * * <tr><td>formatter</td><td>A JUnitResultFormatter given as * classname,filename. If filename is ommitted, System.out is * assumed.</td><td>none</td></tr> * * </table> */ public static void main(String[] args) throws IOException { boolean exitAtEnd = true; boolean haltError = false; boolean haltFail = false; if (args.length == 0) { System.err.println("required argument TestClassName missing"); System.exit(ERRORS); } for (int i=1; i<args.length; i++) { if (args[i].startsWith("haltOnError=")) { haltError = Project.toBoolean(args[i].substring(12)); } else if (args[i].startsWith("haltOnFailure=")) { haltFail = Project.toBoolean(args[i].substring(14)); } else if (args[i].startsWith("formatter=")) { try { createAndStoreFormatter(args[i].substring(10)); } catch (BuildException be) { System.err.println(be.getMessage()); System.exit(ERRORS); } } } JUnitTest t = new JUnitTest(args[0]); JUnitTestRunner runner = new JUnitTestRunner(t, haltError, haltFail); transferFormatters(runner); runner.run(); System.exit(runner.getRetCode()); } private static Vector fromCmdLine = new Vector(); private static void transferFormatters(JUnitTestRunner runner) { for (int i=0; i<fromCmdLine.size(); i++) { runner.addFormatter((JUnitResultFormatter) fromCmdLine.elementAt(i)); } } /** * Line format is: formatter=<classname>(,<pathname>)? */ private static void createAndStoreFormatter(String line) throws BuildException { FormatterElement fe = new FormatterElement(); int pos = line.indexOf(','); if (pos == -1) { fe.setClassname(line); } else { fe.setClassname(line.substring(0, pos)); fe.setOutfile( new File(line.substring(pos + 1)) ); } fromCmdLine.addElement(fe.createFormatter()); }
[ "hvdthong@github.com" ]
hvdthong@github.com
86798234611d47cfeb17abbc9e5b76e0703cb9e8
5adb9848b978e3754df65e55c22af20a0c54f84c
/src/main/java/com/netthreads/libgdx/texture/SoundAssetManager.java
f8acfa5671f8216c56e03cdbee03933523ed1409
[ "Apache-2.0" ]
permissive
alistairrutherford/netthreads-libgdx
c8ce08b01eba4379ed8de99b40a64b271c577f14
c7bb502992a6097712b26e8a05d704a3b81d0e21
refs/heads/master
2020-05-17T15:24:58.832747
2016-11-27T10:51:52
2016-11-27T10:51:52
8,676,644
23
12
null
null
null
null
UTF-8
Java
false
false
885
java
package com.netthreads.libgdx.texture; import com.badlogic.gdx.assets.AssetManager; import com.badlogic.gdx.audio.Sound; import com.badlogic.gdx.utils.Disposable; import com.google.inject.Inject; import com.google.inject.Singleton; import com.netthreads.libgdx.sound.SoundDefinition; import com.netthreads.libgdx.sound.SoundDefinitions; @Singleton public class SoundAssetManager implements Disposable { private AssetManager assetManager; @Inject public SoundAssetManager(SoundDefinitions soundDefinitions) { assetManager = new AssetManager(); for (SoundDefinition soundDefinition : soundDefinitions.getDefinitions()) { assetManager.load(soundDefinition.getPath(), Sound.class); } } public AssetManager getAssetManager() { return assetManager; } @Override public void dispose() { assetManager.dispose(); } }
[ "alistair.rutherford@gmail.com" ]
alistair.rutherford@gmail.com
582fe74c4800fb806584ca8d482e26f8258be688
18244d33aaeaea6f82c40ff7663dd3156a914310
/src/main/java/fr/uvsq21920965/pglp52/Ipersonnels.java
1f46604b84d07ac395230d40e9e3bd5839b94def
[]
no_license
uvsq21920965/pglp_5.2
eb4a0fe2c45fc8f0a07bc6a12da9a6cef53e3700
19e0f3d13fb895ec1e40159f38804b098a0cef46
refs/heads/master
2022-12-30T06:12:36.447474
2020-04-27T15:41:03
2020-04-27T15:41:03
257,967,770
0
0
null
2020-10-13T21:28:14
2020-04-22T17:09:30
HTML
UTF-8
Java
false
false
280
java
package fr.uvsq21920965.pglp52; import java.io.Serializable; /** * Ipersonnels interface. * @author Sarra Belmahdi * */ public interface Ipersonnels { /** * methode pour l'affichage. * @return affichage des coredonnes de personnel. */ public String print(); }
[ "sarra.belmahdi@gmail.com" ]
sarra.belmahdi@gmail.com
48968a9d56e1af64c733ca948bb6551eccfc09c4
cd6875de73db5abbca2c52ca5b9cdde0546020e6
/src/hackerrank/XORStrings.java
14ba85f689b8eb8c96eff1c633b3b2d8c4b8599c
[]
no_license
sowon-dev/AlgorithmStudy_Java
e3d34bb41353acf3f49a779c863722cc9b7eed3b
e793ef4be21f422ffd358c8fc3949600a64e686c
refs/heads/master
2023-06-27T22:32:37.356540
2021-08-03T14:49:20
2021-08-03T14:49:20
299,468,936
10
7
null
null
null
null
UTF-8
Java
false
false
675
java
package hackerrank; public class XORStrings { public static String stringsXOR(String s, String t) { // 0과 1로된 두 개의 문자열에서 XOR값을 리턴하는 문제 // XOR란 같으면 0 다르면 1을 출력한다. // 주어진 코드 중 3줄만 수정가능하고 새로운 코드를 추가하거나 기존 코드를 제거하면 안된다. String res = new String(""); for(int i = 0; i < s.length(); i++) { if(s.charAt(i) == t.charAt(i)) res += "0"; else res += "1"; } return res; } public static void main(String[] args) { System.out.println(stringsXOR("10101", "00101")+", ans: 10000"); } }
[ "sowonkim177@gmail.com" ]
sowonkim177@gmail.com
3094691bb874ddb3da5c25bc857e7b74d7f233d9
282f33997d5636627609531a29737c280479653d
/PG_Test_2017_Autumn/src/main/java/jp/pgtest_autumn/application/ApplicationBase.java
b4d2e3c4197c65fba2a78d17b976e69a3c768548
[]
no_license
mono0423/pg_test_2017_autumn
4ec0dfbbaffa71fbcbca12cdb35e1caf9c2c15b1
81abcfd907444db6786262a143c61d112d0ff7c4
refs/heads/master
2021-09-10T05:30:34.825594
2018-03-21T05:19:18
2018-03-21T05:19:18
110,315,972
0
0
null
null
null
null
UTF-8
Java
false
false
1,264
java
package jp.pgtest_autumn.application; import java.util.List; public abstract class ApplicationBase { /** * アプリ起動時処理。 * <p> * 具体的な処理はサブクラスでオーバーライドし定義する。 * </p> * * @return メッセージリスト */ public abstract List<String> launch(); /** * 音量UPボタン押下時処理。 * <p> * 具体的な処理はサブクラスでオーバーライドし定義する。 * </p> * * @return メッセージリスト */ public abstract List<String> putVolumeUp(); /** * 音量DOWNボタン押下時処理。 * <p> * 具体的な処理はサブクラスでオーバーライドし定義する。 * </p> * * @return メッセージリスト */ public abstract List<String> putVolumeDown(); /** * 起動中アプリ表示メソッド。 * <p> * 具体的な処理はサブクラスでオーバーライドし定義する。 * </p> * * @return メッセージ */ public abstract List<String> display(); /** * アプリ名取得メソッド。 * <p> * 具体的な処理はサブクラスでオーバーライドし定義する。 * </p> * * @return メッセージ */ public abstract String fetchApplicationName(); }
[ "mono0423@gmail.com" ]
mono0423@gmail.com
67d62b6a59349c54a7e532ba741feaaffe15f531
16a7c5345cbbbb68c1f102d38e6f5ba7198b57e2
/Leccion02/sga-jee-01/sga-jee/src/main/java/mx/com/gm/sga/servicio/PersonaServiceImpl.java
2e973eb81a7ce30451627f22847780a8498fa415
[]
no_license
diegoogle/JavaEE
f534986ab298bcf5bbc3b7836edd8f2e5d6d7d08
8f9c6b44c023d1647535dc291e24312f930589fe
refs/heads/master
2022-07-08T08:06:48.609119
2019-09-10T18:38:38
2019-09-10T18:38:38
207,609,755
1
0
null
2022-06-21T01:51:06
2019-09-10T16:32:04
Java
UTF-8
Java
false
false
1,017
java
package mx.com.gm.sga.servicio; import java.util.ArrayList; import java.util.List; import javax.ejb.Stateless; import mx.com.gm.sga.domain.Persona; @Stateless public class PersonaServiceImpl implements PersonaServiceRemote { @Override public List<Persona> listarPersonas() { List<Persona> personas = new ArrayList<>(); personas.add(new Persona(1, "Juan", "Perez", "Suarez", "jperez@gmail.com", "55668798")); personas.add(new Persona(2, "Martha", "Suarez", "Jimenez", "msuarez@mail.com", "566998811")); return personas; } @Override public Persona encontrarPersonaPorId(Persona persona) { return null; } @Override public Persona encontrarPersonaPorEmail(Persona persona) { return null; } @Override public void registrarPersona(Persona persona) {} @Override public void modificarPersona(Persona persona) {} @Override public void eliminarPersona(Persona persona) {} }
[ "noreply@github.com" ]
diegoogle.noreply@github.com
1d9a9a73b6aa9b2769e491efda4e0ca52f742aed
69a99b024f85a3e3f2bc313d9d20affec028780a
/UFPESECURITY2/app/build/generated/source/r/debug/android/support/v7/recyclerview/R.java
bc39f152d24d7b9f9e20913a1e8f26ab3622a163
[]
no_license
vdcn1/ufpesecurity
8829fd3e1ce7aed3d25b1ba7544f7dac06f7ece9
404a5bede03dfb9053fcb39a9ebf691951fa6e7b
refs/heads/master
2020-03-22T17:42:22.351624
2018-07-10T22:11:11
2018-07-10T22:11:11
140,410,360
0
0
null
null
null
null
UTF-8
Java
false
false
9,938
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * gradle plugin from the resource data it found. It * should not be modified by hand. */ package android.support.v7.recyclerview; public final class R { public static final class attr { public static final int fastScrollEnabled = 0x7f03009b; public static final int fastScrollHorizontalThumbDrawable = 0x7f03009c; public static final int fastScrollHorizontalTrackDrawable = 0x7f03009d; public static final int fastScrollVerticalThumbDrawable = 0x7f03009e; public static final int fastScrollVerticalTrackDrawable = 0x7f03009f; public static final int font = 0x7f0300a0; public static final int fontProviderAuthority = 0x7f0300a2; public static final int fontProviderCerts = 0x7f0300a3; public static final int fontProviderFetchStrategy = 0x7f0300a4; public static final int fontProviderFetchTimeout = 0x7f0300a5; public static final int fontProviderPackage = 0x7f0300a6; public static final int fontProviderQuery = 0x7f0300a7; public static final int fontStyle = 0x7f0300a8; public static final int fontWeight = 0x7f0300a9; public static final int layoutManager = 0x7f0300cb; public static final int reverseLayout = 0x7f03013a; public static final int spanCount = 0x7f03014a; public static final int stackFromEnd = 0x7f030150; } public static final class bool { public static final int abc_action_bar_embed_tabs = 0x7f040000; } public static final class color { public static final int notification_action_color_filter = 0x7f050054; public static final int notification_icon_bg_color = 0x7f050055; public static final int ripple_material_light = 0x7f050060; public static final int secondary_text_default_material_light = 0x7f050062; } public static final class dimen { public static final int compat_button_inset_horizontal_material = 0x7f06004a; public static final int compat_button_inset_vertical_material = 0x7f06004b; public static final int compat_button_padding_horizontal_material = 0x7f06004c; public static final int compat_button_padding_vertical_material = 0x7f06004d; public static final int compat_control_corner_material = 0x7f06004e; public static final int fastscroll_default_thickness = 0x7f060077; public static final int fastscroll_margin = 0x7f060078; public static final int fastscroll_minimum_range = 0x7f060079; public static final int item_touch_helper_max_drag_scroll_per_frame = 0x7f060081; public static final int item_touch_helper_swipe_escape_max_velocity = 0x7f060082; public static final int item_touch_helper_swipe_escape_velocity = 0x7f060083; public static final int notification_action_icon_size = 0x7f060084; public static final int notification_action_text_size = 0x7f060085; public static final int notification_big_circle_margin = 0x7f060086; public static final int notification_content_margin_start = 0x7f060087; public static final int notification_large_icon_height = 0x7f060088; public static final int notification_large_icon_width = 0x7f060089; public static final int notification_main_column_padding_top = 0x7f06008a; public static final int notification_media_narrow_margin = 0x7f06008b; public static final int notification_right_icon_size = 0x7f06008c; public static final int notification_right_side_padding_top = 0x7f06008d; public static final int notification_small_icon_background_padding = 0x7f06008e; public static final int notification_small_icon_size_as_large = 0x7f06008f; public static final int notification_subtext_size = 0x7f060090; public static final int notification_top_pad = 0x7f060091; public static final int notification_top_pad_large_text = 0x7f060092; } public static final class drawable { public static final int notification_action_background = 0x7f07007a; public static final int notification_bg = 0x7f07007b; public static final int notification_bg_low = 0x7f07007c; public static final int notification_bg_low_normal = 0x7f07007d; public static final int notification_bg_low_pressed = 0x7f07007e; public static final int notification_bg_normal = 0x7f07007f; public static final int notification_bg_normal_pressed = 0x7f070080; public static final int notification_icon_background = 0x7f070081; public static final int notification_template_icon_bg = 0x7f070082; public static final int notification_template_icon_low_bg = 0x7f070083; public static final int notification_tile_bg = 0x7f070084; public static final int notify_panel_notification_icon_bg = 0x7f070085; } public static final class id { public static final int action_container = 0x7f08000e; public static final int action_divider = 0x7f080010; public static final int action_image = 0x7f080011; public static final int action_text = 0x7f080017; public static final int actions = 0x7f080018; public static final int async = 0x7f080020; public static final int blocking = 0x7f080024; public static final int chronometer = 0x7f08002f; public static final int forever = 0x7f080052; public static final int icon = 0x7f080058; public static final int icon_group = 0x7f080059; public static final int info = 0x7f08005d; public static final int italic = 0x7f08005f; public static final int item_touch_helper_previous_elevation = 0x7f080060; public static final int line1 = 0x7f080064; public static final int line3 = 0x7f080065; public static final int normal = 0x7f080072; public static final int notification_background = 0x7f080073; public static final int notification_main_column = 0x7f080074; public static final int notification_main_column_container = 0x7f080075; public static final int right_icon = 0x7f080083; public static final int right_side = 0x7f080084; public static final int text = 0x7f0800b0; public static final int text2 = 0x7f0800b1; public static final int time = 0x7f0800bd; public static final int title = 0x7f0800be; } public static final class integer { public static final int status_bar_notification_info_maxnum = 0x7f09000a; } public static final class layout { public static final int notification_action = 0x7f0a002e; public static final int notification_action_tombstone = 0x7f0a002f; public static final int notification_template_custom_big = 0x7f0a0036; public static final int notification_template_icon_group = 0x7f0a0037; public static final int notification_template_part_chronometer = 0x7f0a003b; public static final int notification_template_part_time = 0x7f0a003c; } public static final class string { public static final int status_bar_notification_info_overflow = 0x7f0c0046; } public static final class style { public static final int TextAppearance_Compat_Notification = 0x7f0d0100; public static final int TextAppearance_Compat_Notification_Info = 0x7f0d0101; public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0d0103; public static final int TextAppearance_Compat_Notification_Time = 0x7f0d0106; public static final int TextAppearance_Compat_Notification_Title = 0x7f0d0108; public static final int Widget_Compat_NotificationActionContainer = 0x7f0d017e; public static final int Widget_Compat_NotificationActionText = 0x7f0d017f; } public static final class styleable { public static final int[] FontFamily = { 0x7f0300a2, 0x7f0300a3, 0x7f0300a4, 0x7f0300a5, 0x7f0300a6, 0x7f0300a7 }; public static final int FontFamily_fontProviderAuthority = 0; public static final int FontFamily_fontProviderCerts = 1; public static final int FontFamily_fontProviderFetchStrategy = 2; public static final int FontFamily_fontProviderFetchTimeout = 3; public static final int FontFamily_fontProviderPackage = 4; public static final int FontFamily_fontProviderQuery = 5; public static final int[] FontFamilyFont = { 0x7f0300a0, 0x7f0300a8, 0x7f0300a9 }; public static final int FontFamilyFont_font = 0; public static final int FontFamilyFont_fontStyle = 1; public static final int FontFamilyFont_fontWeight = 2; public static final int[] RecyclerView = { 0x010100c4, 0x010100f1, 0x7f03009b, 0x7f03009c, 0x7f03009d, 0x7f03009e, 0x7f03009f, 0x7f0300cb, 0x7f03013a, 0x7f03014a, 0x7f030150 }; public static final int RecyclerView_android_orientation = 0; public static final int RecyclerView_android_descendantFocusability = 1; public static final int RecyclerView_fastScrollEnabled = 2; public static final int RecyclerView_fastScrollHorizontalThumbDrawable = 3; public static final int RecyclerView_fastScrollHorizontalTrackDrawable = 4; public static final int RecyclerView_fastScrollVerticalThumbDrawable = 5; public static final int RecyclerView_fastScrollVerticalTrackDrawable = 6; public static final int RecyclerView_layoutManager = 7; public static final int RecyclerView_reverseLayout = 8; public static final int RecyclerView_spanCount = 9; public static final int RecyclerView_stackFromEnd = 10; } }
[ "noreply@github.com" ]
vdcn1.noreply@github.com
eee5105aac6a3a998ef4881ee6ce5098044d9663
201ef9f147813381276291309781b4bd5e745fae
/servlet3.0/src/com/liang/servlet/MyServletContainerInitializer.java
e6e35e42369d9cf99abd3faa1a11842c6e8fb8b3
[]
no_license
LvanLiang/spring-web-annotation-learn
4d27428afbf4d6e7b7b0e21440713632ccf43e2f
d4fcd08ef68e4273c3859ede25bcac8147226e90
refs/heads/master
2022-12-27T21:47:37.124281
2019-07-13T13:22:29
2019-07-13T13:22:29
196,421,584
0
0
null
2022-12-16T08:48:11
2019-07-11T15:34:29
Java
UTF-8
Java
false
false
2,009
java
package com.liang.servlet; import com.liang.service.UserService; import javax.servlet.*; import javax.servlet.annotation.HandlesTypes; import java.util.EnumSet; import java.util.Set; /** * 容器启动的时候会将@HandlesTypes指定的这个类型下面的子类(实现类,子接口等)传递过来;传入感兴趣的类型; * @author: Liangxp * @date: 2019/7/11 21:26 */ @HandlesTypes(value = {UserService.class}) public class MyServletContainerInitializer implements ServletContainerInitializer { /** * 应用启动的时候,会运行onStartup方法; * <p> * Set<Class<?>> set:感兴趣的类型的所有子类型; * ServletContext servletContext:代表当前Web应用的ServletContext;一个Web应用一个ServletContext; * <p> * 1)、使用ServletContext注册Web组件(Servlet、Filter、Listener) * 2)、使用编码的方式,在项目启动的时候给ServletContext里面添加组件; * 必须在项目启动的时候来添加; * 1)、ServletContainerInitializer得到的ServletContext; * 2)、ServletContextListener得到的ServletContext; */ @Override public void onStartup(Set<Class<?>> set, ServletContext servletContext) throws ServletException { System.out.println("****感兴趣的类**** "); for (Class<?> aClass : set) { System.out.println(aClass); } // 注册servlet ServletRegistration.Dynamic orderServlet = servletContext.addServlet("orderServlet", new OrderServlet()); // 配置servlet的映射信息 orderServlet.addMapping("/order"); // 注册Filter FilterRegistration.Dynamic orderFilter = servletContext.addFilter("orderFilter", OrderFilter.class); // 配置Filter的映射信息 orderFilter.addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST),true,"/*"); //注册listener servletContext.addListener(OrderListener.class); } }
[ "liangxp0@126.com" ]
liangxp0@126.com
198c89813950f25a986adb243db2ebe7af0ef6af
8b9881fa503b0e4144ce66192b88df897785eacf
/src/com/mukesh/DSA/Algorithm/BubbleSortTryout.java
6f32f39caa258dc24bd7cf84e730f8c2418deb8d
[]
no_license
mukeshkumar7470/JavaPracticewithDSA
7627c0d4b3bbe4df9eaf49ee9ee6c3a3152f7f53
e6bc3ecb698b6ac88d49a586d9609e7dcc8fd0c6
refs/heads/master
2023-07-02T17:01:38.062160
2021-08-05T18:33:54
2021-08-05T18:33:54
351,735,686
0
0
null
null
null
null
UTF-8
Java
false
false
1,436
java
package com.mukesh.DSA.Algorithm; public class BubbleSortTryout { static int noOfSwaps = 0; static int noOfPasses = 0; public static void swap(int[] numbers, int firstIndex, int secondIndex) { int temp = numbers[firstIndex]; numbers[firstIndex] = numbers[secondIndex]; numbers[secondIndex] = temp; noOfSwaps += 1; } public static void bubbleSort(int[] numbers) { int length = numbers.length; for (int index1 = 0; index1 < (length - 1); index1++) { boolean swapped = false; noOfPasses += 1; for (int index2 = 0; index2 < (length - index1 - 1); index2++) { if (numbers[index2] > numbers[index2 + 1]) { swap(numbers, index2, index2 + 1); swapped = true; } } if (swapped == false) break; } } public static void main(String[] args) { int[] numbers = { 48, 40, 35, 49, 33 }; System.out.println("Given array:"); for (int number : numbers) { System.out.println(number); } bubbleSort(numbers); System.out.println("Sorted array:"); for (int number : numbers) { System.out.println(number); } System.out.println("No. of passes: " + noOfPasses); System.out.println("No. of swaps: " + noOfSwaps); } }
[ "kumarmukeshpatel57@gmail.com" ]
kumarmukeshpatel57@gmail.com
e8d3d4616c30ee604364208fde9968853c9b78c7
5e8eec6ed490c0c1d4711ce6a9158aec4d4719ee
/数据结构/src/com/buaa/link/Test.java
26f7586d9b63de2f5e8d46b4671a3f80d3b98ec3
[]
no_license
PengLi1990/eclipse_backup
11466fecd9c2af576354199736faeffc6915e056
dab0f53d11a8296115190098245cddd384564384
refs/heads/master
2021-01-17T19:23:33.800457
2016-06-22T13:13:20
2016-06-22T13:13:20
57,083,724
0
0
null
null
null
null
UTF-8
Java
false
false
174
java
package com.buaa.link; public class Test { public static void main(String[] args) { LinkList ll = new LinkList(); ll.insert(10); ll.insert(20); } }
[ "peng_li_pre@qq.com" ]
peng_li_pre@qq.com
5bf6eb08d92111a5e3076c0cb5833ba2cedca852
435196c47097c51266e253c124a2da34a9442ee8
/retail-rules/src/main/java/com/wisrc/rules/webapp/dao/LogisticsOfferRelDao.java
841a6b3e4ec4c02c6915da509cc51ddf933fe4df
[]
no_license
hzwy23/wisrc
87b6bb034375ddbd0f342556c20440f52b87effe
94e3403ae4d2f693bf2b10616517491350c2d617
refs/heads/master
2022-12-28T03:12:09.254707
2020-10-11T13:19:05
2020-10-11T13:19:05
297,698,891
2
1
null
null
null
null
UTF-8
Java
false
false
815
java
package com.wisrc.rules.webapp.dao; import com.wisrc.rules.webapp.entity.LogisticsOfferRelEntity; import org.apache.ibatis.annotations.*; import java.util.List; @Mapper public interface LogisticsOfferRelDao { @Insert("INSERT INTO logistics_offer_relation(uuid, rule_id, offer_id) VALUES(#{uuid}, #{ruleId}, #{offerId})") void saveSaleLogisticsOfferRel(LogisticsOfferRelEntity logisticsOfferRelEntity) throws Exception; @Select("SELECT offer_id FROM logistics_offer_relation WHERE rule_id = #{ruleId}") List<String> getOfferIdByRuleId(@Param("ruleId") String ruleId) throws Exception; @Delete("DELETE FROM logistics_offer_relation WHERE rule_id = #{ruleId} AND offer_id = #{offerId}") void deleteSaleLogisticsOfferRel(LogisticsOfferRelEntity logisticsOfferRelEntity) throws Exception; }
[ "hzwy23@hzwy23deMBP.lan" ]
hzwy23@hzwy23deMBP.lan
0fa0c78062f83e0abf25d9eec8ccd94fcf9f2f06
92dd6bc0a9435c359593a1f9b309bb58d3e3f103
/src/yelpInterview/_Array51SortedArrayClosestSum.java
9b8e5c90aec126a824d3b72d7e3d358487bf18eb
[ "MIT" ]
permissive
darshanhs90/Java-Coding
bfb2eb84153a8a8a9429efc2833c47f6680f03f4
da76ccd7851f102712f7d8dfa4659901c5de7a76
refs/heads/master
2023-05-27T03:17:45.055811
2021-06-16T06:18:08
2021-06-16T06:18:08
36,981,580
3
3
null
null
null
null
UTF-8
Java
false
false
657
java
package yelpInterview; public class _Array51SortedArrayClosestSum { public static void main(String a[]){ int arr[] = {10, 22, 28, 29, 30, 40}; int x = 54; printClosestSum(arr,x); arr = new int[]{1, 3, 4, 7, 10}; x = 15; printClosestSum(arr,x); } private static void printClosestSum(int[] arr, int x) { int l=0,r=arr.length-1; int resLow=0,resHigh=0,diff=Integer.MAX_VALUE; while(l<r) { if (Math.abs(arr[l] + arr[r] - x) < diff) { resLow = l; resHigh = r; diff = Math.abs(arr[l] + arr[r] - x); } if (arr[l] + arr[r] > x) r--; else l++; } System.out.println(arr[resLow]+"/"+arr[resHigh]); } }
[ "hsdars@gmail.com" ]
hsdars@gmail.com
2d7d431d9db2e930428cb2506cf686b122a0a306
a3a95c5b0739ae50c39e2bc3ec58ebe9b97719fc
/app/src/main/java/test/labs/twelfthman/Utils/RoundCornersTransformation.java
d42d109cf912a86a357f4adc83d479408bf0683d
[]
no_license
logsrbh/TwelFthMan
77facf1c2283c50751d38ee72f471e976756b22c
f8f5142f0525cb052b1af0e29d042efa21ceb944
refs/heads/master
2020-04-29T09:11:00.870616
2019-03-16T19:20:01
2019-03-16T19:20:01
176,014,748
0
0
null
null
null
null
UTF-8
Java
false
false
5,156
java
package test.labs.twelfthman.Utils; import android.graphics.Bitmap; import android.graphics.Bitmap.Config; import android.graphics.BitmapShader; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Path; import android.graphics.RectF; import android.graphics.Shader; public class RoundCornersTransformation implements com.squareup.picasso.Transformation { private final int radius; // dp private final int margin; // dp private String KEY = ""; private boolean topCorners = true; private boolean bottomCorners = true; /** * Creates rounded transformation for all corners. * * @param radius radius is corner radii in dp * @param margin margin is the board in dp */ public RoundCornersTransformation(final int radius, final int margin) { this.radius = radius; this.margin = margin; if (KEY.isEmpty()) KEY = "rounded_" + radius + margin; } /** * Creates rounded transformation for top or bottom corners. * * @param radius radius is corner radii in dp * @param margin margin is the board in dp * @param topCornersOnly Rounded corner for top corners only. * @param bottomCornersOnly Rounded corner for bottom corners only. */ public RoundCornersTransformation(final int radius, final int margin, boolean topCornersOnly, boolean bottomCornersOnly) { this(radius, margin); topCorners = topCornersOnly; bottomCorners = bottomCornersOnly; KEY = "rounded_" + radius + margin + topCorners + bottomCorners; } @Override public Bitmap transform(final Bitmap source) { final Paint paint = new Paint(); paint.setAntiAlias(true); paint.setShader(new BitmapShader(source, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP)); Bitmap output = Bitmap.createBitmap(source.getWidth(), source.getHeight(), Config.ARGB_8888); Canvas canvas = new Canvas(output); if(topCorners && bottomCorners) { // Uses native method to draw symmetric rounded corners canvas.drawRoundRect(new RectF(margin, margin, source.getWidth() - margin, source.getHeight() - margin), radius, radius, paint); } else { // Uses custom path to generate rounded corner individually canvas.drawPath(RoundedRect(margin, margin, source.getWidth() - margin, source.getHeight() - margin, radius, radius, topCorners, topCorners, bottomCorners, bottomCorners), paint); } if (source != output) { source.recycle(); } return output; } @Override public String key() { return "rounded_" + radius + margin; // return KEY; } /** * Prepares a path for rounded corner selectively. * Source taken from http://stackoverflow.com/a/35668889/6635889 * @param leftX The X coordinate of the left side of the rectangle * @param topY The Y coordinate of the top of the rectangle * @param rightX The X coordinate of the right side of the rectangle * @param bottomY The Y coordinate of the bottom of the rectangle * @param rx The x-radius of the oval used to round the corners * @param ry The y-radius of the oval used to round the corners * @param topLeft * @param topRight * @param bottomRight * @param bottomLeft * @return */ public static Path RoundedRect(float leftX, float topY, float rightX, float bottomY, float rx, float ry, boolean topLeft, boolean topRight, boolean bottomRight, boolean bottomLeft) { Path path = new Path(); if (rx < 0) rx = 0; if (ry < 0) ry = 0; float width = rightX - leftX; float height = bottomY - topY; if (rx > width / 2) rx = width / 2; if (ry > height / 2) ry = height / 2; float widthMinusCorners = (width - (2 * rx)); float heightMinusCorners = (height - (2 * ry)); path.moveTo(rightX, topY + ry); if (topRight) path.rQuadTo(0, -ry, -rx, -ry);//top-right corner else{ path.rLineTo(0, -ry); path.rLineTo(-rx,0); } path.rLineTo(-widthMinusCorners, 0); if (topLeft) path.rQuadTo(-rx, 0, -rx, ry); //top-left corner else{ path.rLineTo(-rx, 0); path.rLineTo(0,ry); } path.rLineTo(0, heightMinusCorners); if (bottomLeft) path.rQuadTo(0, ry, rx, ry);//bottom-left corner else{ path.rLineTo(0, ry); path.rLineTo(rx,0); } path.rLineTo(widthMinusCorners, 0); if (bottomRight) path.rQuadTo(rx, 0, rx, -ry); //bottom-right corner else{ path.rLineTo(rx,0); path.rLineTo(0, -ry); } path.rLineTo(0, -heightMinusCorners); path.close();//Given close, last lineto can be removed. return path; } }
[ "saurabh@tiysol.com" ]
saurabh@tiysol.com
741cc63422b9b8ee8baa6ea003fa5577d42ed838
70af18a30cb45c63a925d212a26257f269ba63ff
/zadaniaDoDomu/src/com/tt/kursjava/wyklad5/Liczydlo.java
5baa4becd3b019d1cc6dbbb2333e0ffa9fc3b40a
[]
no_license
asinczak/kursJAVA
86903da5c6cef9ed9932fc56073885450e7e5985
583769c122e153c977a7f2ea29ecb2c23efdaecc
refs/heads/master
2020-04-12T14:26:17.226809
2019-03-21T20:39:40
2019-03-21T20:39:40
162,552,548
0
0
null
null
null
null
UTF-8
Java
false
false
1,930
java
package com.tt.kursjava.wyklad5; class Liczydlo { public void oblicz(double a) { System.out.println("licze w metodzie przyjmujacej jeden parametr double"); } //jesli ta metoda bedzie odkomentowana wywoanie metody oblicz z argumentem typu short wywoa wlasnie ja //jesli pozostanie zakomentowana wywolana zostanie metoda z parametrem typu double // public void oblicz(int a) { // System.out.println("licze w metodzie przyjmujacej jeden parametr int"); // } public void oblicz(int a, int b) { System.out.println("licze w metodzie przyjmujacej dwa parametry typu int: a i b"); } public void oblicz(double a, double b) { System.out.println("licze w metodzie przyjmujacej dwa parametry typu double: a i b"); } public Box oblicz(Box box112) { //box112 jest kopia przekazanej referencji, przypisanie do niej nowego obiektu //nie powoduje przypisania tego obiektu do referencji, ktora byla pzekazana jako argument box112 = new Box(box112.width + 10, box112.height + 10); return box112; } public static void main(String[] args) { Liczydlo licz = new Liczydlo(); Box b0; Box b1 = new Box(2, 2); Box b2 = new Box(3, 3); // int resB1 = licz.oblicz(b1); // System.out.println("B1: Wysokosc + szderokosc = " + resB1); // // int resB2 = licz.oblicz(b2); // System.out.println("B2: Wysokosc + szderokosc = " + resB2); //b1 nadal bedzie sie odnosic do obiektu stworzonego w linicje 37, b3 to referencja do obiektu zwroconego w metodzie oblicz Box b3 = licz.oblicz(b1); System.out.println("B1 height " + b1.height + ", width " + b1.width); System.out.println("B3 height " + b3.height + ", width " + b3.width); licz.oblicz(b2); // System.out.println("B2 height " + b2.height + ", width " + b2.width); } }
[ "amorpiwo@gmail.com" ]
amorpiwo@gmail.com
97c9776de4a0f985da1e1d5757d764c593433eaa
a22d864c2d4260d458ed7afebb9ff5a9a3b79c47
/ab.java
693fa11485b55a37034cb852b1021a954a46347a
[]
no_license
iscomax/Arbol_binario
1f165bfda2ddd1317b71bfb597571103f61e24a2
c2afcaac865fd103c264cebdee470055e0e899bb
refs/heads/master
2021-05-15T02:49:04.537866
2020-03-26T20:20:08
2020-03-26T20:20:08
250,371,405
0
0
null
null
null
null
UTF-8
Java
false
false
9,089
java
// ab.java import java.util.*; //usamos el paquete util, importando toas las clases con * import javax.swing.JOptionPane; // JOptionPane : Es para abrir ventanas de dialogo o informativas, no las estamos usando aqui. // Clase ab public class ab { /* Nodo: El arbol binario usa una clase anidada llamada Nodo, la cual no contine funciones miembro (operaciones) solo un constructor. Cada nodo almacena un elemento y tiene dos apuntadores. The binary tree is built using this nested node class. */ private static class Nodo { Nodo izq; Nodo der; int dato; Nodo(int nDato) { izq = null; der = null; dato = nDato; } //Fin constructor de la clase Nodo } //Fin clase Nodo // Nodo Raiz public Nodo raiz; /** Constructor de la clase ab: Crea un arbol binario vacio con la raiz apuntando a la constante null. Tambien crea una grafica a visualizar con JUNG **/ public ab(){ raiz = null; } /** Buscar: Devuelve 1 si la variable entera dato esta en el arbol binario (los nodos almacenan enteros). Recursivamente explora el arbol. **/ public boolean buscar(int dato) { return(buscar(raiz, dato)); } /** Buscar: homonimia de funciones (mismo nombre diferente no. de parametros), una busqueda RECURSIVA a partir de un nodo, recursivamente buscamos un dato, suponiendo un orden en el arbol, en el cual los numeros menores estan a la izq. y los mayores a la der. */ private boolean buscar(Nodo nodo, int dato) { if (nodo==null) { return(false); } if (dato==nodo.dato) { return(true); } else if (dato<nodo.dato) { return(buscar(nodo.izq, dato)); } else { return(buscar(nodo.der, dato)); } } /** Insertar: Inserta un dato en el arbol binario. Usa una funcion recursiva con mismo nombre pero dos parametros (nodo, dato). */ public void insertar(int data) { raiz = insertar(raiz, data); } /** Insercion recursiva -- a partir del nodo recorre hacia abajo e inserta un dato en el arbol. Devuelve el apuntador al nuevo nodo. */ private Nodo insertar(Nodo nodo, int dato) { if (nodo==null) { nodo = new Nodo(dato); } //Fin if else { if (dato <= nodo.dato) { nodo.izq = insertar(nodo.izq, dato); } else { nodo.der = insertar(nodo.der, dato); } }//Fin else return nodo; // En cualquier caso devuelve el apuntador al nodo inicial , es una funcion recursiva } //Fin Node //----------------------------------------------------------------------------- //metodo calcula la altura del nodo public int altura ( Nodo nodo){ int altura =0; if (nodo != null) { if (nodo.izq !=null) { altura = Math.max(altura, altura(nodo.izq)); } if (nodo.der !=null) { altura = Math.max(altura, altura(nodo.der)); } altura++; } return altura; } //-------------------------------------------------------------------------- public void pre(){ pre(raiz); } private void pre(Nodo nodo) { if(nodo == null) return; System.out.print("\t"+nodo.dato); pre(nodo.izq); pre(nodo.der); } public void in(){ in(raiz); } private void in(Nodo nodo) { if(nodo == null) return; in(nodo.izq); System.out.print("\t"+nodo.dato); in(nodo.der); } public void pos(){ pos(raiz); } private void pos(Nodo nodo) { if(nodo == null) return; pos(nodo.izq); pos(nodo.der); System.out.print("\t"+nodo.dato); } // Funciones para buscar en el ABB private Nodo buscar2(Nodo nodo, int dat) { if(nodo.dato == dat) return nodo; if(dat <= nodo.dato) return buscar2(nodo.izq,dat); else return buscar2(nodo.der,dat); } public Nodo buscar2(int dat){ return buscar2(raiz, dat); } //Regresa el nodo/vertice padre del nodo con el dato, explora a partir de un sub-arbol con raiz nodo. private Nodo padre(Nodo nodo, int dato){ if(nodo.izq == null && nodo.der == null && nodo.dato == dato) //Solo hay un nodo y ese nodo tiene el dato return nodo; //regresa el padre if(nodo.izq != null && (nodo.izq).dato == dato) //Esta en el primer hijo de la raiz, izquierdo return nodo; //regresa el padre if(nodo.der != null && (nodo.der).dato == dato) //Esta en el segundo hijo de la raiz, derecho return nodo; //regresa el padre if(dato <= nodo.dato) return padre(nodo.izq,dato); else return padre(nodo.der,dato); } //Devuelve el valor entero almacenado en el subarbol que tiene como raiz al parametro nodo private int minderint(Nodo nodo) { int tmp; if (nodo.izq == null && nodo.der == null){//Si es una hoja. tmp = nodo.dato; padre(nodo,nodo.dato).izq = null; padre(nodo,nodo.dato).der = null; return tmp; } else return minderint(nodo.izq); //Recursividad } //Devuelve el nodo con el dato mas pequeño a partir de un nodo private Nodo minder(Nodo nodo) { if (nodo.izq == null && nodo.der == null){ padre(nodo,nodo.dato).izq = null; padre(nodo,nodo.dato).der = null; return nodo; } else return minder(nodo.izq);//Buscamos a la izquierda } //Funcion que invoca a la funcion borrar. public void borrar(int dato){ Nodo nodoborrar; if(buscar(dato)) //Buscamos el nodo que tiene el dato { //nodoborrar = buscar2(dato); //borrar(nodoborrar,dato);//Borramos a partir de ese nodo borrarNodo(raiz,dato); //Borra desde la raiz. } else JOptionPane.showMessageDialog(null,"El dato a borrar no se encuentra en el ABB"); } //Funcion para borrar un nodo en un ABB private Nodo borrarNodo(Nodo root, int data) { Nodo cur = root; //temporalmente almacena el nodo que se esta explorando, es una llamada por valor o referencia? if(cur == null){ //Si es null regrasa cur return cur;//regresa el nodo cur } if(cur.dato > data){ //Si esta el dato esta en el lado izq cur.izq = borrarNodo(cur.izq, data); //llamada recursiva }else if(cur.dato < data){ //Si esta en el lado der. cur.der = borrarNodo(cur.der, data);//Lamada recursiva }else{//No es nullo ni esta a la izq. ni a la der. if(cur.izq == null && cur.der == null){ //Si no tiene hijos cur = null; //hacerlo null }else if(cur.der == null){ //si tiene hijo izq. cur = cur.izq; //bajar con el hijo izq. }else if(cur.izq == null){ //Si tiene hijo der. cur = cur.der; //bajamos con el hijo der. }else{ // si no tiene dos hijos Nodo temp = minder(cur.der); //tmpo es el nodo con el valor minimo a la derecha. cur.dato = temp.dato; //el dato de tmp.data se lo asignamos a cur.data (el nodo a borrar), cur.der = borrarNodo(cur.der, temp.dato); //Borramos desde cur.right el temp.dato } } return cur; } //Funcion para Borrar un nodo en un ABB private void borrar(Nodo nodo, int dato) { int mind; //para almacenar el valor minimo del subarbol derecho Nodo curtmp = nodo; //Esta es una observacion importante, durante la recursion tenemos que tener guardado en cada paso //un nodo que almacena el nodo a borrar, si no, no tenemos control if (curtmp==null) //Si el ABB esta vacio return; if ( curtmp.dato == dato && curtmp == raiz) // Si es esta en nodo raiz pero la raiz tiene hijos { JOptionPane.showMessageDialog(null,"Actualmente no podemos borrar la raiz"); return; } if (curtmp.dato == dato && curtmp.izq == null && curtmp.der == null && curtmp == raiz){ //Si el dato esta en la raiz y la raiz no tiene hijos raiz = null; return; }; if (curtmp.dato == dato && curtmp.izq == null && curtmp.der == null){ //Si el dato esta en una hoja padre(curtmp,dato).izq = null; padre(curtmp,dato).der = null; nodo = null; return; }; //Casos con un hijo if (curtmp.dato == dato && curtmp.der != null && curtmp.izq == null) // Si es un nodo interior con hijo derecho { padre(curtmp,dato).der = curtmp.der; return; } if (curtmp.dato == dato && curtmp.izq != null && curtmp.der == null) // Si es un nodo interior con hijo izquierdo { if(padre(curtmp,dato).dato < curtmp.dato) { padre(curtmp,dato).der = curtmp.izq; return; } if(padre(curtmp,dato).dato >= curtmp.dato) { padre(curtmp,dato).izq = curtmp.izq; return; } } //Caso con dos hijos if (curtmp.dato == dato && curtmp.izq != null && curtmp.der != null) { mind=minderint(curtmp); //Esta funcion devuelve un entero curtmp.dato = mind; //Solo cambiamos el valor no borramos. } if (dato <= nodo.dato) //Recursion en el arbol binario de busqueda borrar(nodo.izq, dato); else borrarNodo(nodo.der, dato); }//Fin borrar } //Fin Clase ab
[ "santamariajc61@gmail.com" ]
santamariajc61@gmail.com
e900d0e971873fd4763641a99269c5eed78d9473
ada8f5304e178d265f779d0cf07fe24813f3eeb1
/src/main/java/com/lbis/aerovibe/api/server/views/SensorMeasurementView.java
dd9629683932025b0d8dd9b994c6a0c4aae61588
[]
no_license
michaelassraf/aerovibe-api-server
88370c2c305ef4df23f069e78f270dea846618bc
f5ac2f011703543b3c8bd7b0eccebd2daf794e3b
refs/heads/master
2021-01-01T05:15:33.728847
2016-05-18T10:25:27
2016-05-18T10:25:27
59,105,295
0
0
null
null
null
null
UTF-8
Java
false
false
4,860
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 com.lbis.aerovibe.api.server.views; import com.lbis.aerovibe.enums.DataProvidorsEnums; import com.lbis.aerovibe.model.PartialList; import com.lbis.aerovibe.model.Sensor; import com.lbis.aerovibe.model.SensorMeasurement; import com.lbis.aerovibe.spring.common.controllers.SensorMeasurementController; import com.lbis.aerovibe.spring.common.services.LatestDataService; import java.util.LinkedList; import java.util.List; import javax.servlet.http.HttpServletResponse; import javax.ws.rs.core.MediaType; import org.apache.http.HttpStatus; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; @Controller @RequestMapping("/sensorMeasurement") public class SensorMeasurementView { @Autowired LatestDataService latestSensorsAndSensorMeasurements; @Autowired SensorMeasurementController sensorMeasurementContrroller; Logger logger = Logger.getLogger(SensorMeasurementView.class); @RequestMapping(value = "/latestMeasurements", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON) @ResponseBody public LinkedList<SensorMeasurement> getLatestMeasurements() { try { logger.info("Returning latest results."); LinkedList<SensorMeasurement> latestSensorMeasurement = latestSensorsAndSensorMeasurements.getLatestMeasurements(); return latestSensorMeasurement; } catch (Throwable th) { logger.error("Fail to return latest results.", th); } return null; } @RequestMapping(value = "/latestMeasurementsByProvider", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON) @ResponseBody public LinkedList<SensorMeasurement> getLatestMeasurementsByProvider(@RequestParam(value = SensorMeasurement.PROVIDER) DataProvidorsEnums provider) { try { logger.info("Returning latest results from provider " + provider.name()); LinkedList<SensorMeasurement> latestSensorMeasurement = latestSensorsAndSensorMeasurements.getLatestMeasurementsByProvider(provider); return latestSensorMeasurement; } catch (Throwable th) { logger.error("Fail to return latest results.", th); } return null; } @RequestMapping(value = "/latestMeasurementsPaged", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON) @ResponseBody public PartialList<SensorMeasurement> getLatestMeasurementsPaged(@RequestParam(value = SensorMeasurement.PAGE) Integer numberOfPage, HttpServletResponse response) { try { logger.info("Returning latest results from page " + numberOfPage); if (numberOfPage < 0 || numberOfPage > latestSensorsAndSensorMeasurements.getLatestMeasurementsChunked().size()) { response.sendError(HttpStatus.SC_NOT_FOUND, "Bad value for page number."); return null; } PartialList<SensorMeasurement> latestSensorMeasurementPaged = latestSensorsAndSensorMeasurements.getLatestMeasurementsChunked().get(numberOfPage); return latestSensorMeasurementPaged; } catch (Throwable th) { logger.error("Fail to return latest results.", th); } return null; } @RequestMapping(value = "/getLastMeasurementsForSensor", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON) @ResponseBody public List<SensorMeasurement> getLastMeasurementsForSensor(@RequestParam(value = Sensor.SENSOR_ID) String sensorId, @RequestParam(value = SensorMeasurement.NO_OF_MEASUREMENTS) Integer noOfMeasurements, HttpServletResponse response) { try { logger.info("Returning latest results for sensor Id " + sensorId); if (noOfMeasurements == null || noOfMeasurements < 0 || sensorId == null || sensorId.isEmpty()) { response.sendError(HttpStatus.SC_NOT_FOUND, "Bad value for sensor Id or number of measurements."); return null; } return sensorMeasurementContrroller.getLatestSensorMeasurementForSensorId(sensorId, noOfMeasurements); } catch (Throwable th) { logger.error("Fail to return latest results for sensor Id " + sensorId , th); } return null; } }
[ "michaelassraf@gmail.com" ]
michaelassraf@gmail.com
8de8a0af08661cc347d0e9f1d80368ed7d90d643
ed1672767cdd0a926389cedd132919772dafacd3
/src/main/java/io/renren/wap/client/dto/MsgCycleOrderFinishReportDTO.java
699afa559f7c6bc54558399702b03058683dab07
[ "Apache-2.0" ]
permissive
yxqzjj/renren-fast1
dc9709ecb8ecf1085ae52dcf692632457f79c160
612c6a0cff6890846c243e466900afaef34d77fc
refs/heads/master
2022-07-24T08:23:33.479221
2020-01-07T03:19:15
2020-01-07T03:19:15
231,340,260
0
0
Apache-2.0
2022-07-06T20:45:59
2020-01-02T08:35:47
JavaScript
UTF-8
Java
false
false
4,842
java
package io.renren.wap.client.dto; import io.renren.wap.client.constant.FactoryConstant; import io.renren.wap.client.factory.FactoryProducer; import io.renren.wap.client.service.MsgReceiveService; import java.util.Objects; /** * Console→WCS cycle完成报告 * * @Author: CalmLake * @Date: 2018/11/17 12:48 * @Version: V1.0.0 **/ public class MsgCycleOrderFinishReportDTO extends MsgDTO { /** * mcKey,0000-9999 */ private String mcKey; /** * 机器名称 */ private String machineName; /** * Cycle命令 */ private String cycleCommand; /** * 作业区分 */ private String cycleType; /** * 货形(高度),默认0 */ private String height; /** * 货形(宽度),默认0 */ private String width; /** * 排,01-99 */ private String row; /** * 列,01-99 */ private String line; /** * 层,01-99 */ private String tier; /** * 站台 */ private String station; /** * 码头 */ private String dock; /** * 载荷状态 0-无在荷,1-托盘在荷,2-子车在荷,3-子车,托盘在荷 */ private String loadStatus; /** * 完成区分 0-无完成信息,1-正常完成,2-异常完成 */ private String finishType; /** * 完成代码 1-开始,2-完成,3-重复存放,4-空出库,5-货形匹配错误,9-数据异常 */ private String finishCode; public MsgCycleOrderFinishReportDTO getMsgDTO(String msg) { MsgReceiveService msgReceiveService = Objects.requireNonNull(FactoryProducer.getFactory(FactoryConstant.RECEIVE)).getMsgReceiveService(msg); return (MsgCycleOrderFinishReportDTO) msgReceiveService.getMsgDTO(msg); } public String getMcKey() { return mcKey; } public void setMcKey(String mcKey) { this.mcKey = mcKey; } public String getMachineName() { return machineName; } public void setMachineName(String machineName) { this.machineName = machineName; } public String getCycleCommand() { return cycleCommand; } public void setCycleCommand(String cycleCommand) { this.cycleCommand = cycleCommand; } public String getCycleType() { return cycleType; } public void setCycleType(String cycleType) { this.cycleType = cycleType; } public String getHeight() { return height; } public void setHeight(String height) { this.height = height; } public String getWidth() { return width; } public void setWidth(String width) { this.width = width; } public String getRow() { return row; } public void setRow(String row) { this.row = row; } public String getLine() { return line; } public void setLine(String line) { this.line = line; } public String getTier() { return tier; } public void setTier(String tier) { this.tier = tier; } public String getStation() { return station; } public void setStation(String station) { this.station = station; } public String getDock() { return dock; } public void setDock(String dock) { this.dock = dock; } public String getLoadStatus() { return loadStatus; } public void setLoadStatus(String loadStatus) { this.loadStatus = loadStatus; } public String getFinishType() { return finishType; } public void setFinishType(String finishType) { this.finishType = finishType; } public String getFinishCode() { return finishCode; } public void setFinishCode(String finishCode) { this.finishCode = finishCode; } @Override public String toString() { return String.format("McKey:%s,机器号:%s,cycle命令:%s,作业区分:%s,货形高度:%s,货形宽度:%s,排:%s,列:%s,层:%s,站台:%s,码头:%s,载荷状态:%s,完成区分:%s,完成代码:%s", mcKey, machineName, cycleCommand, cycleType, height, width, row, line, tier, station, dock, loadStatus, finishType, finishCode); } public String getData() { return mcKey + machineName + cycleCommand + cycleType + height + width + row + line + tier + station + dock + loadStatus + finishType + finishCode; } @Override public String getNumString() { return getMessageNumber() + getCommandType() + getReSend() + getSendTime() + mcKey + machineName + cycleCommand + cycleType + height + width + row + line + tier + station + dock + loadStatus + finishType + finishCode + getBcc(); } }
[ "yxq3711@163.com" ]
yxq3711@163.com
8124bb768c5fe55e8e3e7f5f7897ad2cbd6bd022
5e34243e2c87d136566f9403465277c3ffd5417d
/google-plus/ios/src/main/java/org/robovm/pods/google/opensource/GTLPlusPersonName.java
274f8648effab31b8163be2810fabee6be589df2
[]
no_license
ipsumgames/ipsum-robovm-robopods
6003ed38cf1d2167860fe6b61dd2ffcb34df1902
5ddc062d0ca561b018998ede4a78b541168bec92
refs/heads/master
2016-09-06T21:52:32.337362
2015-10-23T08:44:30
2015-10-23T08:44:48
41,791,776
2
0
null
null
null
null
UTF-8
Java
false
false
2,951
java
/* * Copyright (C) 2013-2015 RoboVM AB * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.robovm.pods.google.opensource; /*<imports>*/ import java.io.*; import java.nio.*; import java.util.*; import org.robovm.objc.*; import org.robovm.objc.annotation.*; import org.robovm.objc.block.*; import org.robovm.rt.*; import org.robovm.rt.annotation.*; import org.robovm.rt.bro.*; import org.robovm.rt.bro.annotation.*; import org.robovm.rt.bro.ptr.*; import org.robovm.apple.foundation.*; import org.robovm.apple.uikit.*; import org.robovm.apple.coregraphics.*; /*</imports>*/ /*<javadoc>*/ /*</javadoc>*/ /*<annotations>*/@Library(Library.INTERNAL) @NativeClass/*</annotations>*/ /*<visibility>*/public/*</visibility>*/ class /*<name>*/GTLPlusPersonName/*</name>*/ extends /*<extends>*/GTLObject/*</extends>*/ /*<implements>*//*</implements>*/ { /*<ptr>*/public static class GTLPlusPersonNamePtr extends Ptr<GTLPlusPersonName, GTLPlusPersonNamePtr> {}/*</ptr>*/ /*<bind>*/static { ObjCRuntime.bind(GTLPlusPersonName.class); }/*</bind>*/ /*<constants>*//*</constants>*/ /*<constructors>*/ public GTLPlusPersonName() {} protected GTLPlusPersonName(SkipInit skipInit) { super(skipInit); } /*</constructors>*/ /*<properties>*/ @Property(selector = "familyName") public native String getFamilyName(); @Property(selector = "setFamilyName:") public native void setFamilyName(String v); @Property(selector = "formatted") public native String getFormatted(); @Property(selector = "setFormatted:") public native void setFormatted(String v); @Property(selector = "givenName") public native String getGivenName(); @Property(selector = "setGivenName:") public native void setGivenName(String v); @Property(selector = "honorificPrefix") public native String getHonorificPrefix(); @Property(selector = "setHonorificPrefix:") public native void setHonorificPrefix(String v); @Property(selector = "honorificSuffix") public native String getHonorificSuffix(); @Property(selector = "setHonorificSuffix:") public native void setHonorificSuffix(String v); @Property(selector = "middleName") public native String getMiddleName(); @Property(selector = "setMiddleName:") public native void setMiddleName(String v); /*</properties>*/ /*<members>*//*</members>*/ /*<methods>*/ /*</methods>*/ }
[ "blueriverteam@gmail.com" ]
blueriverteam@gmail.com
e026659607ba00aca70e835c0d2d575fa7379242
4b26cff44403639fb742b5642f7aa719bdee39d6
/Voice/app/src/test/java/com/gcitcomplaint/voice/ExampleUnitTest.java
777870860bde693d12edacfde9d10fb8bc418b60
[]
no_license
cheki20/ITW202_Mobile-Application
c502c8de7cb0c6ae8e481fa2054641b644386563
a2c6f956b9722ac0183f246b34685e8cc203cef0
refs/heads/master
2023-05-08T04:36:47.804460
2021-06-01T06:30:07
2021-06-01T06:30:07
346,034,109
0
0
null
null
null
null
UTF-8
Java
false
false
400
java
package com.gcitcomplaint.voice; 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); } }
[ "chekilhamo286@gmail.com" ]
chekilhamo286@gmail.com
1fad3b849691b949af149bd494160ecb3ff62801
fa51687f6aa32d57a9f5f4efc6dcfda2806f244d
/jdk8-src/src/main/java/com/sun/imageio/plugins/png/PNGMetadataFormatResources.java
d3746b2f0f6c9c9788970e3421adecd7d90b7b6d
[]
no_license
yida-lxw/jdk8
44bad6ccd2d81099bea11433c8f2a0fc2e589eaa
9f69e5f33eb5ab32e385301b210db1e49e919aac
refs/heads/master
2022-12-29T23:56:32.001512
2020-04-27T04:14:10
2020-04-27T04:14:10
258,988,898
0
1
null
2020-10-13T21:32:05
2020-04-26T09:21:22
Java
UTF-8
Java
false
false
10,774
java
/* * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package com.sun.imageio.plugins.png; import java.util.ListResourceBundle; public class PNGMetadataFormatResources extends ListResourceBundle { public PNGMetadataFormatResources() { } protected Object[][] getContents() { return new Object[][]{ // Node name, followed by description {"IHDR", "The IHDR chunk, containing the header"}, {"PLTE", "The PLTE chunk, containing the palette"}, {"PLTEEntry", "A palette entry"}, {"bKGD", "The bKGD chunk, containing the background color"}, {"bKGD_RGB", "An RGB background color, for RGB and RGBAlpha images"}, {"bKGD_Grayscale", "A grayscale background color, for Gray and GrayAlpha images"}, {"bKGD_Palette", "A background palette index"}, {"cHRM", "The cHRM chunk, containing color calibration"}, {"gAMA", "The gAMA chunk, containing the image gamma"}, {"hIST", "The hIST chunk, containing histogram information "}, {"hISTEntry", "A histogram entry"}, {"iCCP", "The iCCP chunk, containing an ICC color profile"}, {"iTXt", "The iTXt chunk, containing internationalized text"}, {"iTXtEntry", "A localized text entry"}, {"pHYS", "The pHYS chunk, containing the pixel size and aspect ratio"}, {"sBIT", "The sBIT chunk, containing significant bit information"}, {"sBIT_Grayscale", "Significant bit information for gray samples"}, {"sBIT_GrayAlpha", "Significant bit information for gray and alpha samples"}, {"sBIT_RGB", "Significant bit information for RGB samples"}, {"sBIT_RGBAlpha", "Significant bit information for RGBA samples"}, {"sBIT_Palette", "Significant bit information for RGB palette entries"}, {"sPLT", "The sPLT chunk, containing a suggested palette"}, {"sPLTEntry", "A suggested palette entry"}, {"sRGB", "The sRGB chunk, containing rendering intent information"}, {"tEXt", "The tEXt chunk, containing text"}, {"tEXtEntry", "A text entry"}, {"tIME", "The tIME chunk, containing the image modification time"}, {"tRNS", "The tRNS chunk, containing transparency information"}, {"tRNS_Grayscale", "A grayscale value that should be considered transparent"}, {"tRNS_RGB", "An RGB value that should be considered transparent"}, {"tRNS_Palette", "A palette index that should be considered transparent"}, {"zTXt", "The zTXt chunk, containing compressed text"}, {"zTXtEntry", "A compressed text entry"}, {"UnknownChunks", "A set of unknown chunks"}, {"UnknownChunk", "Unknown chunk data stored as a byte array"}, // Node name + "/" + AttributeName, followed by description {"IHDR/width", "The width of the image in pixels"}, {"IHDR/height", "The height of the image in pixels"}, {"IHDR/bitDepth", "The bit depth of the image samples"}, {"IHDR/colorType", "The color type of the image"}, {"IHDR/compressionMethod", "The compression used for image data, always \"deflate\""}, {"IHDR/filterMethod", "The filtering method used for compression, always \"adaptive\""}, {"IHDR/interlaceMethod", "The interlacing method, \"none\" or \"adam7\""}, {"PLTEEntry/index", "The index of a palette entry"}, {"PLTEEntry/red", "The red value of a palette entry"}, {"PLTEEntry/green", "The green value of a palette entry"}, {"PLTEEntry/blue", "The blue value of a palette entry"}, {"bKGD_Grayscale/gray", "A gray value to be used as a background"}, {"bKGD_RGB/red", "A red value to be used as a background"}, {"bKGD_RGB/green", "A green value to be used as a background"}, {"bKGD_RGB/blue", "A blue value to be used as a background"}, {"bKGD_Palette/index", "A palette index to be used as a background"}, {"cHRM/whitePointX", "The CIE x coordinate of the white point, multiplied by 1e5"}, {"cHRM/whitePointY", "The CIE y coordinate of the white point, multiplied by 1e5"}, {"cHRM/redX", "The CIE x coordinate of the red primary, multiplied by 1e5"}, {"cHRM/redY", "The CIE y coordinate of the red primary, multiplied by 1e5"}, {"cHRM/greenX", "The CIE x coordinate of the green primary, multiplied by 1e5"}, {"cHRM/greenY", "The CIE y coordinate of the green primary, multiplied by 1e5"}, {"cHRM/blueX", "The CIE x coordinate of the blue primary, multiplied by 1e5"}, {"cHRM/blueY", "The CIE y coordinate of the blue primary, multiplied by 1e5"}, {"gAMA/value", "The image gamma, multiplied by 1e5"}, {"hISTEntry/index", "The palette index of this histogram entry"}, {"hISTEntry/value", "The frequency of this histogram entry"}, {"iCCP/profileName", "The name of this ICC profile"}, {"iCCP/compressionMethod", "The compression method used to store this ICC profile"}, {"iTXtEntry/keyword", "The keyword"}, {"iTXtEntry/compressionMethod", "The compression method used to store this iTXt entry"}, {"iTXtEntry/languageTag", "The ISO tag describing the language this iTXt entry"}, {"iTXtEntry/translatedKeyword", "The translated keyword for iTXt entry"}, {"iTXtEntry/text", "The localized text"}, {"pHYS/pixelsPerUnitXAxis", "The number of horizontal pixels per unit, multiplied by 1e5"}, {"pHYS/pixelsPerUnitYAxis", "The number of vertical pixels per unit, multiplied by 1e5"}, {"pHYS/unitSpecifier", "The unit specifier for this chunk (i.e., meters)"}, {"sBIT_Grayscale/gray", "The number of significant bits of the gray samples"}, {"sBIT_GrayAlpha/gray", "The number of significant bits of the gray samples"}, {"sBIT_GrayAlpha/alpha", "The number of significant bits of the alpha samples"}, {"sBIT_RGB/red", "The number of significant bits of the red samples"}, {"sBIT_RGB/green", "The number of significant bits of the green samples"}, {"sBIT_RGB/blue", "The number of significant bits of the blue samples"}, {"sBIT_RGBAlpha/red", "The number of significant bits of the red samples"}, {"sBIT_RGBAlpha/green", "The number of significant bits of the green samples"}, {"sBIT_RGBAlpha/blue", "The number of significant bits of the blue samples"}, {"sBIT_RGBAlpha/alpha", "The number of significant bits of the alpha samples"}, {"sBIT_Palette/red", "The number of significant bits of the red palette entries"}, {"sBIT_Palette/green", "The number of significant bits of the green palette entries"}, {"sBIT_Palette/blue", "The number of significant bits of the blue palette entries"}, {"sPLTEntry/index", "The index of a suggested palette entry"}, {"sPLTEntry/red", "The red value of a suggested palette entry"}, {"sPLTEntry/green", "The green value of a suggested palette entry"}, {"sPLTEntry/blue", "The blue value of a suggested palette entry"}, {"sPLTEntry/alpha", "The blue value of a suggested palette entry"}, {"sRGB/renderingIntent", "The rendering intent"}, {"tEXtEntry/keyword", "The keyword"}, {"tEXtEntry/value", "The text"}, {"tIME/year", "The year when the image was last modified"}, {"tIME/month", "The month when the image was last modified, 1 = January"}, {"tIME/day", "The day of the month when the image was last modified"}, {"tIME/hour", "The hour when the image was last modified"}, {"tIME/minute", "The minute when the image was last modified"}, {"tIME/second", "The second when the image was last modified, 60 = leap second"}, {"tRNS_Grayscale/gray", "The gray value to be considered transparent"}, {"tRNS_RGB/red", "The red value to be considered transparent"}, {"tRNS_RGB/green", "The green value to be considered transparent"}, {"tRNS_RGB/blue", "The blure value to be considered transparent"}, {"tRNS_Palette/index", "A palette index to be considered transparent"}, {"tRNS_Palette/alpha", "The transparency associated with the palette entry"}, {"zTXtEntry/keyword", "The keyword"}, {"zTXtEntry/compressionMethod", "The compression method"}, {"zTXtEntry/text", "The compressed text"}, {"UnknownChunk/type", "The 4-character type of the unknown chunk"} }; } }
[ "yida@caibeike.com" ]
yida@caibeike.com
42eff38922ff9408de753c4dce0072f8dae14db5
026f9ca5b32e1f446a3c17d7be9bcda7694d6b26
/src/main/java/ru/torgcrm/web/rest/UserResource.java
2ce5acb95c2ca5549a236c1567927c02a5e02d15
[ "Apache-2.0" ]
permissive
raj2008/TorgCRM-CE
f161ea25bfeb453261748fdace77d7b4043e5808
ee4146ffe05f2d2be4828f06e7264df11f9d8a42
refs/heads/master
2021-05-06T23:14:34.495434
2017-12-03T20:23:51
2017-12-03T20:23:51
112,960,526
0
0
null
2017-12-03T20:19:38
2017-12-03T20:19:38
null
UTF-8
Java
false
false
8,275
java
package ru.torgcrm.web.rest; import ru.torgcrm.config.Constants; import com.codahale.metrics.annotation.Timed; import ru.torgcrm.domain.User; import ru.torgcrm.repository.UserRepository; import ru.torgcrm.security.AuthoritiesConstants; import ru.torgcrm.service.MailService; import ru.torgcrm.service.UserService; import ru.torgcrm.service.dto.UserDTO; import ru.torgcrm.web.rest.vm.ManagedUserVM; import ru.torgcrm.web.rest.util.HeaderUtil; import ru.torgcrm.web.rest.util.PaginationUtil; import io.github.jhipster.web.util.ResponseUtil; import io.swagger.annotations.ApiParam; 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.security.access.annotation.Secured; import org.springframework.web.bind.annotation.*; import java.net.URI; import java.net.URISyntaxException; import java.util.*; /** * REST controller for managing users. * * <p>This class accesses the User entity, and needs to fetch its collection of authorities.</p> * <p> * For a normal use-case, it would be better to have an eager relationship between User and Authority, * and send everything to the client side: there would be no View Model and DTO, a lot less code, and an outer-join * which would be good for performance. * </p> * <p> * We use a View Model and a DTO for 3 reasons: * <ul> * <li>We want to keep a lazy association between the user and the authorities, because people will * quite often do relationships with the user, and we don't want them to get the authorities all * the time for nothing (for performance reasons). This is the #1 goal: we should not impact our users' * application because of this use-case.</li> * <li> Not having an outer join causes n+1 requests to the database. This is not a real issue as * we have by default a second-level cache. This means on the first HTTP call we do the n+1 requests, * but then all authorities come from the cache, so in fact it's much better than doing an outer join * (which will get lots of data from the database, for each HTTP call).</li> * <li> As this manages users, for security reasons, we'd rather have a DTO layer.</li> * </ul> * <p>Another option would be to have a specific JPA entity graph to handle this case.</p> */ @RestController @RequestMapping("/api") public class UserResource { private final Logger log = LoggerFactory.getLogger(UserResource.class); private static final String ENTITY_NAME = "userManagement"; private final UserRepository userRepository; private final MailService mailService; private final UserService userService; public UserResource(UserRepository userRepository, MailService mailService, UserService userService) { this.userRepository = userRepository; this.mailService = mailService; this.userService = userService; } /** * POST /users : Creates a new user. * <p> * Creates a new user if the login and email are not already used, and sends an * mail with an activation link. * The user needs to be activated on creation. * </p> * * @param managedUserVM the user to create * @return the ResponseEntity with status 201 (Created) and with body the new user, or with status 400 (Bad Request) if the login or email is already in use * @throws URISyntaxException if the Location URI syntax is incorrect */ @PostMapping("/users") @Timed @Secured(AuthoritiesConstants.ADMIN) public ResponseEntity createUser(@RequestBody ManagedUserVM managedUserVM) throws URISyntaxException { log.debug("REST request to save User : {}", managedUserVM); //Lowercase the user login before comparing with database if (userRepository.findOneByLogin(managedUserVM.getLogin().toLowerCase()).isPresent()) { return ResponseEntity.badRequest() .headers(HeaderUtil.createFailureAlert(ENTITY_NAME, "userexists", "Login already in use")) .body(null); } else if (userRepository.findOneByEmail(managedUserVM.getEmail()).isPresent()) { return ResponseEntity.badRequest() .headers(HeaderUtil.createFailureAlert(ENTITY_NAME, "emailexists", "Email already in use")) .body(null); } else { User newUser = userService.createUser(managedUserVM); mailService.sendCreationEmail(newUser); return ResponseEntity.created(new URI("/api/users/" + newUser.getLogin())) .headers(HeaderUtil.createAlert( "userManagement.created", newUser.getLogin())) .body(newUser); } } /** * PUT /users : Updates an existing User. * * @param managedUserVM the user to update * @return the ResponseEntity with status 200 (OK) and with body the updated user, * or with status 400 (Bad Request) if the login or email is already in use, * or with status 500 (Internal Server Error) if the user couldn't be updated */ @PutMapping("/users") @Timed @Secured(AuthoritiesConstants.ADMIN) public ResponseEntity<UserDTO> updateUser(@RequestBody ManagedUserVM managedUserVM) { log.debug("REST request to update User : {}", managedUserVM); Optional<User> existingUser = userRepository.findOneByEmail(managedUserVM.getEmail()); if (existingUser.isPresent() && (!existingUser.get().getId().equals(managedUserVM.getId()))) { return ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert(ENTITY_NAME, "emailexists", "E-mail already in use")).body(null); } existingUser = userRepository.findOneByLogin(managedUserVM.getLogin().toLowerCase()); if (existingUser.isPresent() && (!existingUser.get().getId().equals(managedUserVM.getId()))) { return ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert(ENTITY_NAME, "userexists", "Login already in use")).body(null); } Optional<UserDTO> updatedUser = userService.updateUser(managedUserVM); return ResponseUtil.wrapOrNotFound(updatedUser, HeaderUtil.createAlert("userManagement.updated", managedUserVM.getLogin())); } /** * GET /users : get all users. * * @param pageable the pagination information * @return the ResponseEntity with status 200 (OK) and with body all users * @throws URISyntaxException if the pagination headers couldn't be generated */ @GetMapping("/users") @Timed public ResponseEntity<List<UserDTO>> getAllUsers(@ApiParam Pageable pageable) throws URISyntaxException { final Page<UserDTO> page = userService.getAllManagedUsers(pageable); HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, "/api/users"); return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK); } /** * GET /users/:login : get the "login" user. * * @param login the login of the user to find * @return the ResponseEntity with status 200 (OK) and with body the "login" user, or with status 404 (Not Found) */ @GetMapping("/users/{login:" + Constants.LOGIN_REGEX + "}") @Timed public ResponseEntity<UserDTO> getUser(@PathVariable String login) { log.debug("REST request to get User : {}", login); return ResponseUtil.wrapOrNotFound( userService.getUserWithAuthoritiesByLogin(login) .map(UserDTO::new)); } /** * DELETE /users/:login : delete the "login" User. * * @param login the login of the user to delete * @return the ResponseEntity with status 200 (OK) */ @DeleteMapping("/users/{login:" + Constants.LOGIN_REGEX + "}") @Timed @Secured(AuthoritiesConstants.ADMIN) public ResponseEntity<Void> deleteUser(@PathVariable String login) { log.debug("REST request to delete User: {}", login); userService.deleteUser(login); return ResponseEntity.ok().headers(HeaderUtil.createAlert( "userManagement.deleted", login)).build(); } }
[ "funbanji@gmail.com" ]
funbanji@gmail.com
d4282681f4db5cc3a26d549020e7796ad0d9f2f1
ee461488c62d86f729eda976b421ac75a964114c
/trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/event/MediaKeyEvent.java
19b752a92b65cc5aeaf01abac5c8221bd7ccd8a8
[ "Apache-2.0" ]
permissive
svn2github/htmlunit
2c56f7abbd412e6d9e0efd0934fcd1277090af74
6fc1a7d70c08fb50fef1800673671fd9cada4899
refs/heads/master
2023-09-03T10:35:41.987099
2015-07-26T13:12:45
2015-07-26T13:12:45
37,107,064
0
1
null
null
null
null
UTF-8
Java
false
false
1,280
java
/* * Copyright (c) 2002-2015 Gargoyle Software Inc. * * 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.gargoylesoftware.htmlunit.javascript.host.event; import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.CHROME; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass; import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor; import com.gargoylesoftware.htmlunit.javascript.configuration.WebBrowser; /** * A JavaScript object for {@code MediaKeyEvent}. * * @version $Revision$ * @author Ahmed Ashour */ @JsxClass(browsers = @WebBrowser(CHROME)) public class MediaKeyEvent extends Event { /** * Creates an instance. */ @JsxConstructor public MediaKeyEvent() { } }
[ "asashour@5f5364db-9458-4db8-a492-e30667be6df6" ]
asashour@5f5364db-9458-4db8-a492-e30667be6df6
5efec9b64ddbe18db0b5aed45f74d3b074dee17c
a3a9f16c99c355f9192966b676fca633e850e453
/app/src/main/java/com/best/movie/note/model/repositories/SeasonsRepository.java
c877caae143f6f03a068661bf0f7883a33d4b682
[]
no_license
kolesnikov-denys-dev/Movie.Note
5ab90c4f6865011cd7e2d2f444f1a005ba85899f
987ad2812e3d410efae16131702099bf85314061
refs/heads/master
2023-01-30T01:13:02.172055
2020-12-13T22:27:26
2020-12-13T22:27:26
314,388,825
0
0
null
null
null
null
UTF-8
Java
false
false
2,879
java
package com.best.movie.note.model.repositories; import android.app.Application; import android.util.Log; import androidx.lifecycle.MutableLiveData; import com.best.movie.note.model.response.movies.movie.MovieResult; import com.best.movie.note.model.response.movies.movie.MoviesApiResponse; import com.best.movie.note.model.response.tvshows.seasons.SeasonApiResponse; import com.best.movie.note.service.ApiService; import java.util.ArrayList; import java.util.List; import javax.inject.Inject; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.disposables.CompositeDisposable; import io.reactivex.disposables.Disposable; import io.reactivex.functions.Consumer; import io.reactivex.schedulers.Schedulers; import static com.best.movie.note.Global.getAppComponent; import static com.best.movie.note.utils.Constants.API_KEY; import static com.best.movie.note.utils.Constants.QUERY_LANGUAGE; import static com.best.movie.note.utils.Constants.TAG_ERROR; public class SeasonsRepository { private Application application; @Inject ApiService apiService; private CompositeDisposable compositeDisposable; public SeasonsRepository(Application application) { this.application = application; compositeDisposable = new CompositeDisposable(); getAppComponent().injectSeasonsRepository(this); } // Airing Today private SeasonApiResponse seasonResult; private final MutableLiveData<SeasonApiResponse> seasonMutableLiveData = new MutableLiveData<>(); public MutableLiveData<SeasonApiResponse> getSeasonMutableLiveData(int tvId, int seasonNumber, String language) { Disposable disposableSimpleData = apiService.getSeasonByTvShowId(tvId, seasonNumber, API_KEY, language) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Consumer<SeasonApiResponse>() { @Override public void accept(SeasonApiResponse seasonApiResponse) throws Exception { if (seasonApiResponse != null && seasonApiResponse != null) { seasonResult = seasonApiResponse; seasonMutableLiveData.setValue(seasonResult); } } }, new Consumer<Throwable>() { @Override public void accept(Throwable throwable) throws Exception { Log.e(TAG_ERROR, "onFailure: geSeasonMutableLiveData" + throwable.getLocalizedMessage()); } }); compositeDisposable.add(disposableSimpleData); return seasonMutableLiveData; } public void disposeDisposable() { if (compositeDisposable != null) { compositeDisposable.dispose(); } } }
[ "kolesnikov.denys.dev@gmail.com" ]
kolesnikov.denys.dev@gmail.com