blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
sequencelengths
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
sequencelengths
1
1
author_id
stringlengths
0
313
b7fd2817615ac86f0699f57c2e68be1c37d0bee2
0fe584cfa8328da62502a47aae25b41a425937f0
/src/com/xsis/day1/Practice05.java
6fac16be1dd1d135d7e68d4c574c9dc786ce7ae4
[]
no_license
waway5/batch-219
5f131a04f56acc675f14732122767d0c1aefc797
985f6594424676a52c70031f5bb8489fcd851844
refs/heads/master
2020-08-27T01:03:16.265789
2019-10-24T03:38:24
2019-10-24T03:38:24
217,200,269
0
0
null
null
null
null
UTF-8
Java
false
false
601
java
package com.xsis.day1; import java.util.Scanner; public class Practice05 { public static void main(String[] args) { double literPerkilo, totalJarakTempuh, totalLiter; Scanner scan = new Scanner(System.in); System.out.print("Total Jarak Tempuh : "); totalJarakTempuh = scan.nextDouble(); System.out.print("Total Bensin yang dipakai : "); totalLiter = scan.nextDouble(); // calculate satu liter per kilo nya literPerkilo = totalJarakTempuh / totalLiter; System.out.println("Satu Liter per kilo : "+ literPerkilo); } }
49259023854fb8f018cdcedfe41cd59fe2608e41
dec841ce431c03bcf5b1454eab34de21a35376a5
/slick2d/src/org/newdawn/slick/util/DefaultLogSystem.java
50f106f8a040edfec2e6c6f8d135228ce8b16045
[]
no_license
guts2014/Geeksoc
277b74ea57964ebd177d29a3cb7eddee444dd374
a24d19a9e933bdbe5675b9afc5e54f35bfc3ed10
refs/heads/master
2016-09-05T11:37:55.748602
2014-10-17T15:57:05
2014-10-17T15:57:05
25,053,159
0
1
null
2014-10-11T23:06:18
2014-10-10T21:05:17
Java
UTF-8
Java
false
false
1,951
java
package org.newdawn.slick.util; import java.io.PrintStream; import java.util.Date; /** * The default implementation that just spits the messages out to stdout * * @author kevin */ public class DefaultLogSystem implements LogSystem { /** The output stream for dumping the log out on */ public static PrintStream out = System.out; /** * Log an error * * @param message * The message describing the error * @param e * The exception causing the error */ public void error(String message, Throwable e) { error(message); error(e); } /** * Log an error * * @param e * The exception causing the error */ public void error(Throwable e) { out.println(new Date() + " ERROR:" + e.getMessage()); e.printStackTrace(out); } /** * Log an error * * @param message * The message describing the error */ public void error(String message) { out.println(new Date() + " ERROR:" + message); } /** * Log a warning * * @param message * The message describing the warning */ public void warn(String message) { out.println(new Date() + " WARN:" + message); } /** * Log an information message * * @param message * The message describing the infomation */ public void info(String message) { out.println(new Date() + " INFO:" + message); } /** * Log a debug message * * @param message * The message describing the debug */ public void debug(String message) { out.println(new Date() + " DEBUG:" + message); } /** * Log a warning with an exception that caused it * * @param message * The message describing the warning * @param e * The cause of the warning */ public void warn(String message, Throwable e) { warn(message); e.printStackTrace(out); } }
8296f1be8782da3a31c1de4232db93e88b1083ec
b100a617f36da70cc03a22086caa62efffb9b4e1
/src/main/java/hu/adam/project_inventory/App.java
8aed9bc5537f2916ee003c34e1433f7b08d56993
[]
no_license
593304/project-inventory
ecbba07d6fbc2a62673d9fc36991116d900a3c09
35cb436c5750dad7d3dd6c605cc18489913dc945
refs/heads/master
2020-03-15T16:00:59.866658
2018-08-04T09:07:58
2018-08-04T09:07:58
132,226,197
0
0
null
null
null
null
UTF-8
Java
false
false
505
java
package hu.adam.project_inventory; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.web.servlet.config.annotation.EnableWebMvc; @SpringBootApplication @EnableWebMvc public class App extends SpringBootServletInitializer { public static void main(String[] args) { SpringApplication.run(App.class, args); } }
7e4022af15973f501f53f06abea35a314c81b94b
9d0650df0c1216ad9e50a7b8dad85e0231c0ab6a
/PIII-master/FlyBook/src/backend/managers/FlightManager.java
804ab36159a2d37ac707d30cae3799b37dcbc450
[]
no_license
persa188/flybook
41c93e5078e83f5a92898f5d0057b16339815287
32ec15e1226b897497c62f27db7a2865e660255b
refs/heads/master
2020-06-02T07:54:18.323245
2016-09-15T00:07:14
2016-09-15T00:07:14
37,269,020
0
0
null
null
null
null
UTF-8
Java
false
false
4,981
java
/** * */ package backend.managers; import java.io.IOException; import java.util.ArrayList; import backend.exceptions.InvalidCSVFormatException; import backend.exceptions.NoSuchEntryException; /** * A manager of Flights. * Stores Flights. * Can upload Flights from csv (same format as handout). * Can also output a csv file (same format as handout). * This class is a singleton. * @author xiaxiuqi * */ public class FlightManager extends Manager<String, FlightInfo> { /** * The actual singleton instance. We create this as soon as the app * starts up because we will need this for sure, so we might as well * create it. */ private static final FlightManager instance = new FlightManager(); // private static int NUMBERINDEX = 0; // private static int DEPARTINDEX = 1; // private static int ARRIVEINDEX = 2; // private static int AIRLINEINDEX = 3; // private static int ORIGININDEX = 4; // private static int DESTINDEX = 5; // private static int PRICEINDEX = 6; /** The name of this database for exception messages **/ private final String DBNAME = "FlightDB"; /** * Retrieve the one and only instance of FlightDB * @return The only instance of FlightDB */ public static FlightManager getInstance() { return instance; } /** * Creates a new empty FlightDB */ private FlightManager() { super(); } // /** // * Creates a new flightDB by loading the data from the specified path // * @param path The path of the csv file to load data from. // * The file must be formatted according to the specifications in the // * Phase 2 handout. // * @throws IOException Error in reading the CSV file // */ // private FlightDB(String path) throws IOException{ // // First make an empty instance and set it to be the only instance // this(); // // Load data into it // load(path); // } /* (non-Javadoc) * @see backend.Database#parseLine(java.lang.String) */ @Override public FlightInfo parseLine(String line) throws InvalidCSVFormatException { // // Split the line into comma-delimited tokens // String [] tokens = line.split(","); // // // Create a new Flight with the required information // FlightInfo newFlight; // try { // newFlight = new FlightInfo( // tokens[NUMBERINDEX], // tokens[DEPARTINDEX], // tokens[ARRIVEINDEX], // tokens[AIRLINEINDEX], // tokens[ORIGININDEX], // tokens[DESTINDEX], // Integer.parseInt(tokens[PRICEINDEX])); // } catch (ArrayIndexOutOfBoundsException e) { // // If the the indices are out of bounds the csv line is probably // // not formatted correctly // throw new InvalidCSVFormatException(DBNAME); // } /* * Design note: For FlightDB, I put the parsing code in the constructor * for FlightInfo so that BookingsDB can also access the same parsing * code. This is a compromise solution betwen two options: * 1) Put all the parsing code in all the DatabaseEntries * Problem: There is no way to specify a constructor in interfaces * If we made it a method instead, we would need an instance * of a DatabaseEntry just to be able to call the parseLine * method from it. It's also not possible to make an interface * specify a static method * 2) Put all the parsing code in all the subclasses of Database * Problem: One database cannot access the parsing method in another * because it would require an instance of the other database. * it's also not possible to make an abstract static method * in the Database parent class */ try { return new FlightInfo(line); } catch(InvalidCSVFormatException e) { // re-throw the exception with the name of this database throw new InvalidCSVFormatException(DBNAME); } } /** * This method will be used by Daniel's Search * to get data from this FlightDB as an ArrayList * @return All the flights in the database as an ArrayList of Flights */ public ArrayList<FlightInfo> getAllFlights(){ // Add all the values in the records map to a new ArrayList ArrayList<FlightInfo> allFlights = new ArrayList<FlightInfo>(); for(FlightInfo f: dataTable.values()) { // Make a new copy of each flight as we add them to the list allFlights.add(new FlightInfo(f)); } // Safe to return since everything is a copy, not the original return allFlights; } /** * Updates a flights info * @param key * @param updatedEntry * @throws NoSuchEntryException if no flight with that key exists */ public void setFlight(String key, FlightInfo updatedEntry) throws NoSuchEntryException{ setEntry(key, new FlightInfo(updatedEntry)); } }
b120c1a719b71a48001ead55b81c582311c95dd8
2bc2eadc9b0f70d6d1286ef474902466988a880f
/branches/mule-3-lifecycle/tests/integration/src/test/java/org/mule/module/xml/functional/JXPathExpressionTestCase.java
dbacdc477fc4f942fab5c4112f84d307d2928fa9
[]
no_license
OrgSmells/codehaus-mule-git
085434a4b7781a5def2b9b4e37396081eaeba394
f8584627c7acb13efdf3276396015439ea6a0721
refs/heads/master
2022-12-24T07:33:30.190368
2020-02-27T19:10:29
2020-02-27T19:10:29
243,593,543
0
0
null
2022-12-15T23:30:00
2020-02-27T18:56:48
null
UTF-8
Java
false
false
1,298
java
/* * $Id$ * -------------------------------------------------------------------------------------- * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com * * The software in this package is published under the terms of the CPAL v1.0 * license, a copy of which has been included with this distribution in the * LICENSE.txt file. */ package org.mule.module.xml.functional; import java.text.MessageFormat; import java.util.Properties; public class JXPathExpressionTestCase extends AbstractXmlPropertyExtractorTestCase { public static final String MESSAGE = "<endpoint>{0}</endpoint>"; public JXPathExpressionTestCase() { super(true); } protected Properties getStartUpProperties() { Properties p = new Properties(); p.setProperty("selector.expression", "/endpoint"); p.setProperty("selector.evaluator", "jxpath"); return p; } protected Object getMatchMessage() throws Exception { return documentFor("matchingEndpoint1"); } protected Object getErrorMessage() throws Exception { return documentFor("missingEndpoint"); } protected String documentFor(String name) throws Exception { return MessageFormat.format(MESSAGE, name); } }
[ "rossmason@bf997673-6b11-0410-b953-e057580c5b09" ]
rossmason@bf997673-6b11-0410-b953-e057580c5b09
9369ddc984edefd03eace97ec98bfac31505d370
c647fd579a0be09b01c3e8cda61273be469c1244
/devlibs/asmsources/org/objectweb/asm/Symbol.java
db0a9cfa60e802047e21971d6eeb23ac35d65c71
[]
no_license
valoeghese/EnigmaRefactorTool
28559cee6ddc8c808b7663a2a6180f3bd6f88a1d
f6132519b6a1b6008394f16ad0516d14cb9855d7
refs/heads/master
2020-12-13T14:39:20.412250
2020-01-23T08:36:31
2020-01-23T08:36:31
234,447,579
0
0
null
null
null
null
UTF-8
Java
false
false
1,732
java
// // Decompiled by Procyon v0.5.36 // package org.objectweb.asm; abstract class Symbol { static final int CONSTANT_CLASS_TAG = 7; static final int CONSTANT_FIELDREF_TAG = 9; static final int CONSTANT_METHODREF_TAG = 10; static final int CONSTANT_INTERFACE_METHODREF_TAG = 11; static final int CONSTANT_STRING_TAG = 8; static final int CONSTANT_INTEGER_TAG = 3; static final int CONSTANT_FLOAT_TAG = 4; static final int CONSTANT_LONG_TAG = 5; static final int CONSTANT_DOUBLE_TAG = 6; static final int CONSTANT_NAME_AND_TYPE_TAG = 12; static final int CONSTANT_UTF8_TAG = 1; static final int CONSTANT_METHOD_HANDLE_TAG = 15; static final int CONSTANT_METHOD_TYPE_TAG = 16; static final int CONSTANT_DYNAMIC_TAG = 17; static final int CONSTANT_INVOKE_DYNAMIC_TAG = 18; static final int CONSTANT_MODULE_TAG = 19; static final int CONSTANT_PACKAGE_TAG = 20; static final int BOOTSTRAP_METHOD_TAG = 64; static final int TYPE_TAG = 128; static final int UNINITIALIZED_TYPE_TAG = 129; static final int MERGED_TYPE_TAG = 130; final int index; final int tag; final String owner; final String name; final String value; final long data; int info; Symbol(final int index, final int tag, final String owner, final String name, final String value, final long data) { this.index = index; this.tag = tag; this.owner = owner; this.name = name; this.value = value; this.data = data; } int getArgumentsAndReturnSizes() { if (this.info == 0) { this.info = Type.getArgumentsAndReturnSizes(this.value); } return this.info; } }
ee5663a9712a1baed7f46d449f4a41497bf89de7
1ccc1a98266347c88a49c3d3a05c472413350b9d
/webapi-prototype-main/src/main/java/com/jurin_n/infrastructure/persistence/JPAPracticeRecordRepository.java
6c32d560685660f9f81c7529bd8b3eda588372f4
[]
no_license
jurin-n/webapi-prototype
a30cd5692e329279df9b2deb8740d4e3fc65fe24
913890fb71c74a516c27fbf68d379e3666a07364
refs/heads/master
2021-01-10T09:32:04.111618
2016-04-18T12:46:02
2016-04-18T12:46:02
49,761,430
0
0
null
null
null
null
UTF-8
Java
false
false
1,671
java
package com.jurin_n.infrastructure.persistence; import java.util.List; import javax.ejb.Stateless; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.TypedQuery; import com.jurin_n.domain.model.practice.plan.PracticePlan; import com.jurin_n.domain.model.practice.record.PracticeRecord; import com.jurin_n.domain.model.practice.record.PracticeRecordId; import com.jurin_n.domain.model.practice.record.PracticeRecordRepository; @Stateless public class JPAPracticeRecordRepository implements PracticeRecordRepository { @PersistenceContext private EntityManager em; public JPAPracticeRecordRepository(EntityManager em) { setEntityManager(em); } public JPAPracticeRecordRepository() { super(); } public void setEntityManager(EntityManager em){ if(this.em != null){ Class<?> c = this.getClass(); throw new IllegalStateException( "EntityManager instance 'em' is not null." + "This Method "+ c.getName() + ".setEntityManager" +" is for Using Unit Test."); } this.em = em; } @Override public void add(PracticeRecord aPracticeRecord) { em.persist(aPracticeRecord); } @Override public List<PracticeRecord> getAll() { TypedQuery<PracticeRecord> query = em.createNamedQuery("PracticeRecord.FIND_ALL",PracticeRecord.class); return query.getResultList(); } @Override public PracticeRecordId nextIdentity() { return new PracticeRecordId( java.util.UUID.randomUUID().toString().toUpperCase() ); } @Override public PracticeRecord getRecordById(PracticeRecordId practiceRecordId) { return em.find(PracticeRecord.class,practiceRecordId); } }
04cc7bec370bf8b1893f5fdbdaf9147844371f0a
6e8d2feb77880cd03356086b22eaf7f4b597113d
/AgentApp/Backend/src/main/java/rent/app/controller/ws/client/CarTransmissionClient.java
7ce304db0bd976410c5dc86582727b1e80cd2f39
[]
no_license
majakesin/XML-Tim-18
b33a6f7d3aa1b8210075010fc6eeefe7ce35c797
1de9c6d28ca6e25b2432710b71572d944ab0aea0
refs/heads/master
2022-12-14T05:29:37.099758
2020-09-08T09:29:30
2020-09-08T09:29:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
758
java
package rent.app.controller.ws.client; import org.springframework.ws.client.core.support.WebServiceGatewaySupport; import rent.app.controller.ws.generate.CarTransmissionRequest; import rent.app.controller.ws.generate.SoapResponse; import javax.xml.bind.JAXBElement; public class CarTransmissionClient extends WebServiceGatewaySupport { public SoapResponse handleCarTransmission(CarTransmissionRequest request){ try{ JAXBElement<SoapResponse> jax = (JAXBElement<SoapResponse>) getWebServiceTemplate() .marshalSendAndReceive(request); SoapResponse c = jax.getValue(); return c; } catch (Exception e) { e.printStackTrace(); return null; } } }
c64eff9de87cf48edf85cc1d9f1b5e3f33e6b14b
baf90c1c17b165188676b9bb46f4eb66b85f20c9
/app/src/main/java/com/example/siyeon/project/Levelup.java
aa60f6bbda4c8e4a00769e0151eac7cfdf6787ac
[]
no_license
ggongchi765/monster_scheduler
c77b7a88b452d04bfb5dab905ede53b91abd0916
5bedfc0567a2d07d2debe18bedd1c2de579788d5
refs/heads/master
2023-01-19T14:06:10.870157
2020-11-18T09:52:41
2020-11-18T09:52:41
313,889,937
0
0
null
null
null
null
UTF-8
Java
false
false
511
java
package com.example.siyeon.project; import android.app.Dialog; import android.content.Context; import android.view.View; import android.view.Window; public class Levelup{ private Context context; public Levelup(Context context) { this.context=context; } public void callFunction( ) { final Dialog diglog = new Dialog(context); diglog.requestWindowFeature(Window.FEATURE_NO_TITLE); diglog.setContentView(R.layout.level_up); diglog.show(); } }
766a589226d8c17676feca4256505c4583257f94
d2824524d2ab11d34ea7e940a6a9525762721590
/AutoOntologyGen/src/main/java/sap/corp/emea/Sparql_Test.java
287310f1df8b536ef57b4f48fd45b826bf079d62
[]
no_license
badarinath-katti/SAP-DFKI
1b5382910057c769907cc855f1385a8d12e003c6
3ce311132981615ed2e4e876d8e3145b2586559d
refs/heads/master
2021-05-18T05:24:07.245423
2020-03-29T21:07:04
2020-03-29T21:07:04
251,130,722
0
0
null
2020-03-29T20:53:51
2020-03-29T20:45:30
C#
UTF-8
Java
false
false
4,451
java
package sap.corp.emea; import java.io.InputStream; import org.apache.jena.ontology.OntModel; import org.apache.jena.query.Query; import org.apache.jena.query.QueryExecution; import org.apache.jena.query.QueryExecutionFactory; import org.apache.jena.query.QueryFactory; import org.apache.jena.query.QuerySolution; import org.apache.jena.query.ResultSet; import org.apache.jena.rdf.model.Model; import org.apache.jena.rdf.model.ModelFactory; import org.apache.jena.util.FileManager; public class Sparql_Test { public static void main(String[] args) { // TODO Auto-generated method stub Model model = ModelFactory.createDefaultModel(); InputStream in = FileManager.get().open("sp.owl"); model.read( in, "RDF/XML"); OntModel ontModel = ModelFactory.createOntologyModel(); in = FileManager.get().open("sp.owl"); in = FileManager.get().open("RescomInformationModel.owl"); ontModel.read( in, "RDF/XML"); String QueryString1 = "PREFIX : <http://emea.global.corp.sap/rescom#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> "+ "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>"+ "SELECT ?PressInstance ((abs(?Press_XCoOrdValue - ?LowerShellWarehouse_XCoOrdValue))"+ "+(abs(?Press_XCoOrdValue - ?UpperShellWarehouse_XCoOrdValue)) +(abs(?Press_XCoOrdValue - ?CircuitBoardWarehouse_XCoOrdValue))"+ "+(abs(?Press_XCoOrdValue - ?IndustrialCamera_XCoOrdValue))+(abs(?Press_XCoOrdValue - ?RFIDReader_XCoOrdValue)) as ?CumulativeDistance)"+ "WHERE{ ?LowerShellWarehouseInstance :hasPositionX ?XCoOrdInst_LS; rdf:type :rescom_resources_LowerShellProvider. ?XCoOrdInst_LS :Value ?LowerShellWarehouse_XCoOrdValue."+ "?UpperShellWarehouseInstance :hasPositionX ?XCoOrdInst_US; rdf:type :rescom_resources_UpperShellProvider. ?XCoOrdInst_US :Value ?UpperShellWarehouse_XCoOrdValue."+ "?CircuitBoardWarehouseInstance :hasPositionX ?XCoOrdInst_CB; rdf:type :rescom_resources_CircuitBoardProvider. ?XCoOrdInst_CB :Value ?CircuitBoardWarehouse_XCoOrdValue."+ "?IndustrialCameraInstance :hasPositionX ?XCoOrdInst_Camera; rdf:type :rescom_resources_IndustrialCamera. ?XCoOrdInst_Camera :Value ?IndustrialCamera_XCoOrdValue."+ "?RFIDReaderInstance :hasPositionX ?XCoOrdInst_RFIDReader; rdf:type :rescom_resources_RFIDReader. ?XCoOrdInst_RFIDReader :Value ?RFIDReader_XCoOrdValue."+ "{ SELECT ?PressInstance ?Press_XCoOrdValue WHERE{ ?PressInstance :hasPositionX ?XCoOrdInst_Press; rdf:type :rescom_capability_abstracts_Assembler. ?XCoOrdInst_Press :Value ?Press_XCoOrdValue.} } }"+ "order by asc(?CumulativeDistance) limit 1"; String queryStr = "PREFIX : <http://www.semanticweb.org/d065085/ontologies/2018/9/untitled-ontology-81#> "+ "PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> "+ "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> "+ "SELECT ?PressInstance ((abs(?Press_XCoOrdValue - ?LowerShellWarehouse_XCoOrdValue)) "+ "+(abs(?Press_XCoOrdValue - ?UpperShellWarehouse_XCoOrdValue)) +(abs(?Press_XCoOrdValue - ?CircuitBoardWarehouse_XCoOrdValue))"+ "+(abs(?Press_XCoOrdValue - ?IndustrialCamera_XCoOrdValue))+(abs(?Press_XCoOrdValue - ?RFIDReader_XCoOrdValue)) as ?CumulativeDistance)"+ "WHERE{ ?LowerShellWarehouseInstance :xCoOrd ?LowerShellWarehouse_XCoOrdValue; rdf:type :LowerShellWarehouse."+ "?UpperShellWarehouseInstance :xCoOrd ?UpperShellWarehouse_XCoOrdValue; rdf:type :UpperShellWarehouse."+ "?CircuitBoardWarehouseInstance :xCoOrd ?CircuitBoardWarehouse_XCoOrdValue; rdf:type :CircuitBoardWareHouse."+ "?IndustrialCameraInstance :xCoOrd ?IndustrialCamera_XCoOrdValue; rdf:type :Camera."+ "?RFIDReaderInstance :xCoOrd ?RFIDReader_XCoOrdValue; rdf:type :RFIDReader."+ "{SELECT ?PressInstance ?Press_XCoOrdValue WHERE{ ?PressInstance :xCoOrd ?Press_XCoOrdValue;rdf:type :PressMachine.}}}"+ "ORDER BY asc(?CumulativeDistance) limit 3"; Query query = QueryFactory.create(QueryString1); QueryExecution queryExec = QueryExecutionFactory.create(QueryString1, ontModel); try{ ResultSet results = queryExec.execSelect(); while(results.hasNext()){ QuerySolution solution = results.next(); System.out.println(solution.toString()); System.out.println(solution.getResource("?PressInstance")); } } finally{ } } }
e995dc1a71e246bd15ed64104ef96f8c1298fcb1
d352d1f57cfd741efd6559ecd4c5882d2dbd4f26
/config-model/src/main/java/com/yahoo/vespa/model/content/storagecluster/PersistenceProducer.java
dabfbd4f75d4df2a7240ff78e1c93d5684c0125d
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
hshukla/vespa
69b154388bda4f374370883f8c50360a3ad55f0c
d618d1442bc1963de08e843ef14c49f12ae7e9d9
refs/heads/master
2020-05-18T09:48:45.357329
2019-04-30T22:17:59
2019-04-30T22:17:59
184,333,759
0
0
Apache-2.0
2019-04-30T21:26:04
2019-04-30T21:26:04
null
UTF-8
Java
false
false
1,815
java
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.model.content.storagecluster; import com.yahoo.vespa.config.content.PersistenceConfig; import com.yahoo.vespa.model.builder.xml.dom.ModelElement; import com.yahoo.vespa.model.utils.Duration; /** * Serves engines config for storage clusters. */ public class PersistenceProducer implements PersistenceConfig.Producer { public static class Builder { public PersistenceProducer build(ModelElement element) { ModelElement persistence = element.getChild("engine"); if (persistence == null) { return new PersistenceProducer(); } return new PersistenceProducer( persistence.childAsBoolean("fail-partition-on-error"), persistence.childAsDuration("recovery-time"), persistence.childAsDuration("revert-time")); } } Boolean failOnError; Duration recoveryPeriod; Duration revertTimePeriod; public PersistenceProducer() {} public PersistenceProducer(Boolean failOnError, Duration recoveryPeriod, Duration revertTimePeriod) { this.failOnError = failOnError; this.recoveryPeriod = recoveryPeriod; this.revertTimePeriod = revertTimePeriod; } @Override public void getConfig(PersistenceConfig.Builder builder) { if (failOnError != null) { builder.fail_partition_on_error(failOnError); } if (recoveryPeriod != null) { builder.keep_remove_time_period((int)recoveryPeriod.getSeconds()); } if (revertTimePeriod != null) { builder.revert_time_period((int)revertTimePeriod.getSeconds()); } } }
980332b2e8b084e9a27680ecf112ade18486a63d
e28cdc6e5e9fab4e313e115fbcab85da5b01d3e0
/src/main/java/com/mballem/curso/boot/web/controller/FuncionarioController.java
ae2d76968df6f420ab39d655738ad7ac90f4cdfd
[]
no_license
arivaldonsilva/udemy-demo-mvc-ari2
4226cc9a0b768f6c49ff69391a1dd54c700d5c65
45eb068afb0a5b91119fd07daa3641d88062351c
refs/heads/master
2020-05-17T05:40:16.673145
2019-04-25T19:14:00
2019-04-25T19:14:00
183,540,977
0
0
null
null
null
null
UTF-8
Java
false
false
4,151
java
package com.mballem.curso.boot.web.controller; import java.time.LocalDate; import java.util.List; import javax.validation.Valid; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.convert.JodaTimeConverters.DateTimeToDateConverter; import org.springframework.format.annotation.DateTimeFormat; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.validation.BindingResult; import org.springframework.web.bind.WebDataBinder; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.InitBinder; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.mballem.curso.boot.domain.Cargo; import com.mballem.curso.boot.domain.Funcionario; import com.mballem.curso.boot.domain.UF; import com.mballem.curso.boot.service.CargoService; import com.mballem.curso.boot.service.FuncionarioService; import com.mballem.curso.boot.web.validator.FuncionarioValidator; @Controller @RequestMapping("funcionarios") public class FuncionarioController { @Autowired private FuncionarioService funcionarioService; @Autowired private CargoService cargoService; @InitBinder public void initBinder(WebDataBinder binder) { binder.addValidators(new FuncionarioValidator()); } @GetMapping("/cadastrar") public String cadastrar(Funcionario funcionario) { return "funcionario/cadastro"; } @GetMapping("/listar") public String listar(ModelMap model) { model.addAttribute("funcionarios", funcionarioService.buscarTodos()); return "funcionario/lista"; } @PostMapping("/salvar") public String salvar(@Valid Funcionario funcionario, BindingResult results, RedirectAttributes attr) { if(results.hasErrors()) { return "funcionario/cadastro"; } funcionarioService.salvar(funcionario); attr.addFlashAttribute("success", "Funcionário salvo com sucesso"); return "redirect:/funcionarios/cadastrar"; } @GetMapping("/editar/{id}") public String preEditar(@PathVariable("id") Long id, ModelMap model) { model.addAttribute("funcionario", funcionarioService.buscarPorId(id)); return "funcionario/cadastro"; } @PostMapping("/editar") public String editar(@Valid Funcionario funcionario, BindingResult results, RedirectAttributes attr) { if(results.hasErrors()) { return "funcionario/cadastro"; } funcionarioService.editar(funcionario); attr.addFlashAttribute("success", "Funcionário atualizado com sucesso!"); return "redirect:/funcionarios/cadastrar"; } @GetMapping("/excluir/{id}") public String excluir(@PathVariable("id") Long id, RedirectAttributes attr) { funcionarioService.excluir(id); attr.addFlashAttribute("success", "Funcionário excluído com sucesso!"); return "redirect:/funcionarios/listar"; } @GetMapping("/buscar/nome") public String getPorNome(@RequestParam("nome") String nome, ModelMap model) { model.addAttribute("funcionarios", funcionarioService.buscarPorNome(nome)); return "funcionario/lista"; } @GetMapping("/buscar/cargo") public String getPorCargo(@RequestParam("cargo") Long cargo, ModelMap model) { model.addAttribute("funcionarios", funcionarioService.buscarPorCargo(cargo)); return "funcionario/lista"; } @GetMapping("/buscar/data") public String getPorData( @RequestParam("entrada") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate entrada, @RequestParam("saida") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate saida, ModelMap model) { model.addAttribute("funcionarios", funcionarioService.buscarPorDatas(entrada, saida)); return "funcionario/lista"; } @ModelAttribute("cargos") public List<Cargo> getCargos(){ return cargoService.buscarTodos(); } @ModelAttribute("ufs") public UF[] getUFs(){ return UF.values(); } }
0f99927e78fc2561a563442fc63626a0c164447c
76da3da7fccba7cff538e469c9f238a6e6ed0359
/src/com/calculator/expressionsolver/Tan.java
f7e1cbfb9e44d37045273e43f5304e5747591818
[]
no_license
sumit1511/ExpressionSolver
ad2ba0ddade6b4a53c7b2b054039f47bf4b3cc77
ce4cdfe3b7870002a38869370d1611c4e4330778
refs/heads/master
2021-01-14T16:53:55.197496
2020-02-25T05:40:45
2020-02-25T05:40:45
242,686,515
0
0
null
null
null
null
UTF-8
Java
false
false
291
java
package com.calculator.expressionsolver; public class Tan extends MainSolver { public Tan() { super(); } public double expressionEvaluate(int signed,double ...exp1) { // Math.tan(Math.toRadians(exp1[0])); return signed*Math.tan(exp1[0]); } }
65ed08b88381d8f5e2e1a35d1564e201f0635fe9
a560dfb092baaa4317c85f505ad21e55750e5638
/hileco-drpc-http/src/test/java/com/hileco/drpc/http/HttpModuleDRPCTest.java
3c44a376efcb341e761377fe353d4a5ab65cc1f0
[]
no_license
rmoorman/hileco-drpc
ae1379c740863eaa07695d6c8de346704fcc9ed4
bba1cf6f88e45af5319982fde6d638a2ddc1c2f7
refs/heads/master
2021-01-18T14:40:12.023500
2015-02-07T16:42:36
2015-02-07T16:42:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,273
java
package com.hileco.drpc.http; import com.hileco.drpc.core.spec.ServiceConnector; import com.hileco.drpc.http.subscription.CacheSubscriptionStore; import com.hileco.drpc.http.router.RouterServer; import org.junit.Ignore; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; /** * @author Philipp Gayret */ public class HttpModuleDRPCTest { private static final Logger LOG = LoggerFactory.getLogger(HttpModuleDRPCTest.class); public static final int DRPC_INTERVAL_MS = 100; public static final int PORT_BASE_RANGE_SERVICES = 8300; public static final int PORT_BASE_RANGE_CLIENTS = 8400; public static final int PORT_ROUTER = 8500; public static final String ROUTER_URL = "http://localhost:" + PORT_ROUTER; public static final String HOST = "localhost"; public static interface SampleService { public Integer calculate(Integer a, Integer b); } @Ignore @Test public void startAll() throws Exception { ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(100); CacheSubscriptionStore subscriptionStore = new CacheSubscriptionStore(); RouterServer routerServer = new RouterServer(subscriptionStore); routerServer.start(PORT_ROUTER); LOG.info("Spawning services"); for (int index = 0; index < 10; index++) { Client client = new Client(ROUTER_URL, HOST, PORT_BASE_RANGE_SERVICES + index); client.publish(SampleService.class, Integer.toString(index), (a, b) -> a + b); } LOG.info("Spawning clients"); for (int index = 0; index < 1; index++) { Client client = new Client(ROUTER_URL, HOST, PORT_BASE_RANGE_CLIENTS + index); scheduler.scheduleAtFixedRate(() -> { ServiceConnector<SampleService> connector = client.connector(SampleService.class); connector.drpc(d -> d.calculate(1, 2), r -> LOG.info("Obtained a result: {}", r)); }, DRPC_INTERVAL_MS, DRPC_INTERVAL_MS, TimeUnit.MILLISECONDS); } LOG.info("Sleeping"); Thread.sleep(10000); } }
d392f43f5c847ff838a0f2020472ece8abed1472
a189b77d72f0bcbd26eee27d31ad71202ab3d5ee
/CoinChange.java
acbcbe5aff853670aefdc4eb55f9ba2f603088eb
[]
no_license
bahuljain/Leet-Code
e21f67bb4db9e457a79e3b411dc59c55c1b15d6c
04777d690a962d0ad6f4bcc368f9f5da6eb44523
refs/heads/master
2016-08-12T01:59:16.687140
2016-01-31T15:05:53
2016-01-31T15:05:53
45,647,651
0
0
null
null
null
null
UTF-8
Java
false
false
591
java
public class Solution { public int coinChange(int[] coins, int amount) { if (amount <= 0) return 0; if (coins.length == 0) return -1; int[] min = new int[amount + 1]; min[0] = 0; for(int i = 1; i <= amount; i++) { int m = Integer.MAX_VALUE; for(int j = coins.length - 1; j >= 0; j--) { int coin = coins[j]; if(i - coin < 0 || min[i - coin] == -1) { continue; } else { m = Math.min(m, 1 + min[i-coin]); } } min[i] = (m == Integer.MAX_VALUE) ? -1 : m; } return min[amount]; } }
bc0eea8dc87c56be792c93f3b03b9f44e9a02e90
24db43827d836550b76c5cbe11ec41edefc7ef74
/org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidName.java
b4d22e655f7c31aa55d0c116a291a7d6a0b8fc01
[]
no_license
chengkande/javasrc
f8f0380f7a7fa0e0cde86da023f574413303be13
2adbcfc6dddafe0daf3f03143361557e620a0d9b
refs/heads/master
2021-01-20T20:18:14.383584
2016-06-23T12:37:30
2016-06-23T12:37:30
61,803,806
0
0
null
null
null
null
UTF-8
Java
false
false
604
java
package org.omg.PortableInterceptor.ORBInitInfoPackage; /** * org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidName.java . * Generated by the IDL-to-Java compiler (portable), version "3.2" * from ../../../../src/share/classes/org/omg/PortableInterceptor/Interceptors.idl * Thursday, December 18, 2014 5:09:39 PM PST */ public final class InvalidName extends org.omg.CORBA.UserException { public InvalidName () { super(InvalidNameHelper.id()); } // ctor public InvalidName (String $reason) { super(InvalidNameHelper.id() + " " + $reason); } // ctor } // class InvalidName
c0233b1fec7cbaa603046023197d0ed6b2fba7e0
447520f40e82a060368a0802a391697bc00be96f
/apks/banking_set2/com.advantage.RaiffeisenBank/source/com/thinkdesquared/banking/helpers/ui/IPagingBaseAdapter.java
afad914149a57c2e909a99ae141ec4a1d205aab9
[ "Apache-2.0" ]
permissive
iantal/AndroidPermissions
7f3343a9c29d82dbcd4ecd98b3a50ddf8d179465
d623b732734243590b5f004d167e542e2e2ae249
refs/heads/master
2023-07-19T01:29:26.689186
2019-09-30T19:01:42
2019-09-30T19:01:42
107,239,248
0
0
Apache-2.0
2023-07-16T07:41:38
2017-10-17T08:22:57
null
UTF-8
Java
false
false
297
java
package com.thinkdesquared.banking.helpers.ui; import java.util.List; public abstract interface IPagingBaseAdapter<T> { public abstract void addMoreItems(int paramInt, List<T> paramList); public abstract void addMoreItems(List<T> paramList); public abstract void removeAllItems(); }
9806e19e8c1536a6d9f119f8dd2942513cabbfc7
deb7fe94bf3ea0bbddcdb7ccec60522d23ae5a78
/src/main/java/question/Ch08_Recursion_and_Dynamic_Programming/Q8_12_Eight_Queens/Question.java
2220b0f4505f2259f6fc612e3ca3790752ffa2e6
[]
no_license
jadefromkorea/algorithm
86757905ca760269d0643d618996b182fe447d46
51a4e3d1414d5811ef23ab4be7a1601df0f1e47c
refs/heads/master
2022-12-28T19:14:22.172849
2020-10-18T08:53:22
2020-10-18T08:53:22
305,060,062
0
0
null
null
null
null
UTF-8
Java
false
false
2,749
java
package question.Ch08_Recursion_and_Dynamic_Programming.Q8_12_Eight_Queens; import java.util.ArrayList; public class Question { public static int GRID_SIZE = 8; /* Check if (row1, column1) is a valid spot for a queen by checking if there * is a queen in the same column or diagonal. We don't need to check it for queens * in the same row because the calling placeQueen only attempts to place one queen at * a time. We know this row is empty. */ public static boolean checkValid(Integer[] columns, int row1, int column1) { for (int row2 = 0; row2 < row1; row2++) { int column2 = columns[row2]; /* Check if (row2, column2) invalidates (row1, column1) as a queen spot. */ /* Check if rows have a queen in the same column */ if (column1 == column2) { return false; } /* Check diagonals: if the distance between the columns equals the distance * between the rows, then they’re in the same diagonal. */ int columnDistance = Math.abs(column2 - column1); int rowDistance = row1 - row2; // row1 > row2, so no need to use absolute value if (columnDistance == rowDistance) { return false; } } return true; } public static void placeQueens(int row, Integer[] columns, ArrayList<Integer[]> results) { if (row == GRID_SIZE) { // Found valid placement results.add(columns.clone()); } else { for (int col = 0; col < GRID_SIZE; col++) { if (checkValid(columns, row, col)) { columns[row] = col; // Place queen placeQueens(row + 1, columns, results); } } } } public static void clear(Integer[] columns) { for (int i = 0; i < GRID_SIZE; i++) { columns[i] = -1; } } public static void printBoard(Integer[] columns) { drawLine(); for(int i = 0; i < GRID_SIZE; i++){ System.out.print("|"); for (int j = 0; j < GRID_SIZE; j++){ if (columns[i] == j) { System.out.print("Q|"); } else { System.out.print(" |"); } } System.out.print("\n"); drawLine(); } System.out.println(""); } private static void drawLine() { StringBuilder line = new StringBuilder(); for (int i=0;i<GRID_SIZE*2+1;i++) line.append('-'); System.out.println(line.toString()); } public static void printBoards(ArrayList<Integer[]> boards) { for (int i = 0; i < boards.size(); i++) { Integer[] board = boards.get(i); printBoard(board); } } public static void main(String[] args) { ArrayList<Integer[]> results = new ArrayList<Integer[]>(); Integer[] columns = new Integer[GRID_SIZE]; clear(columns); placeQueens(0, columns, results); printBoards(results); System.out.println(results.size()); } }
8758043c30d109c1fb82d9a83060dc3e9dd031fe
6decdca2dad070710376fe62aaf83eb0dec92482
/collection/src/cn/dan/util/Iterator.java
82e79ff1b723f11b79d97f19fb0616f475dab296
[]
no_license
JaneDan/practice
5941b7db6866d0a9a293e48198d5a26f99e5bde8
1a64daed34c36776093863c88c6b5be6f1456cec
refs/heads/master
2016-08-12T20:31:18.037405
2015-12-02T12:49:31
2015-12-02T12:49:31
47,067,272
0
0
null
null
null
null
UTF-8
Java
false
false
113
java
package cn.dan.util; public interface Iterator<E> { boolean hasNext(); E next(); void remove(); }
31c81d8d381045cff050e4e5b070e780d49caeea
1f32d84bbcad4f6ee4555a5c911fece8fcc61fe1
/src/main/java/com/edao/codes/patterns/iterator/t3/PancakeHouseMenuIterator.java
55f02618547691d1a9d06ec27c97b07062e89bef
[]
no_license
elevendao/jdao
13c946ed0641c67a5e7364dbc06388e2bff11dd4
ca3dce2e4786ae6ff92df933b2f6a5a594fb4831
refs/heads/master
2021-01-18T13:03:19.815552
2017-03-09T13:36:28
2017-03-09T13:36:28
84,333,741
0
0
null
null
null
null
UTF-8
Java
false
false
1,167
java
/** * 版权所有:elevendao * 项目名称:demo * 创建者: Leo * 创建日期: 2015年10月5日 * 文件说明: * 最近修改者:Leo * 最近修改日期:2015年10月5日 */ package com.edao.codes.patterns.iterator.t3; import java.util.ArrayList; import java.util.Iterator; /** * @author Leo * */ public class PancakeHouseMenuIterator implements Iterator { ArrayList items; int position = 0; /** * */ public PancakeHouseMenuIterator(ArrayList items) { this.items = items; } /* (non-Javadoc) * @see com.edao.codes.patterns.iterator.t2.Iterator#hasNext() */ @Override public boolean hasNext() { if (position<items.size()) { return true; } return false; } /* (non-Javadoc) * @see com.edao.codes.patterns.iterator.t2.Iterator#next() */ @Override public Object next() { Object obj = items.get(position); position = position + 1; return obj; } /* (non-Javadoc) * @see java.util.Iterator#remove() */ @Override public void remove() { if (position <= 0) { throw new IllegalStateException("You can't remove an item until you've done at least one next()"); } items.remove(position); } }
9ad511bc73bfd9ac28dd3c58ea53d94441ab5c47
0aece160ed556c1b97bfd2638bc99634fd35744d
/Spring-Data-JPA/src/main/java/br/com/fiap/springdatajpa/dto/customer/PhoneDTO.java
1777797f9ed9e5c058168c3d4168f57ae4983c23
[]
no_license
ronaldoleitte1975/trabalho-final-persistencia-34scj
b8caef468a127beb0a1e69eb9fd31657af58668a
39b79113911cd86e133073ffd814d0b374f4d5d8
refs/heads/master
2022-07-09T14:02:47.041160
2019-07-07T19:06:56
2019-07-07T19:06:56
194,278,134
0
6
null
2022-06-21T01:21:51
2019-06-28T13:25:47
Java
UTF-8
Java
false
false
349
java
package br.com.fiap.springdatajpa.dto.customer; public class PhoneDTO { public PhoneDTO() { } public PhoneDTO(String number) { this.number = number; } private String number; public String getNumber() { return number; } public void setNumber(String number) { this.number = number; } }
38c9f806d8b080e3569691ed5b184084ce3cf25a
8f362e22b0bd0a3e1294df90e13791c6bceb1bef
/src/uk/dangrew/dinosaurs/game/actions/movement/Movement.java
ec811e7471d21f0f47d71f9f5bdae0c3ef268591
[ "Apache-2.0" ]
permissive
DanGrew/Dinosaurs
829d1fd6371b617f3a58356d8aab10fb9e141650
e21ff4519ed97ae85bf2c4845150e591525d9d1e
refs/heads/main
2023-02-24T20:39:23.880864
2021-01-25T17:56:07
2021-01-25T17:56:07
328,762,490
0
0
null
null
null
null
UTF-8
Java
false
false
1,098
java
package uk.dangrew.dinosaurs.game.actions.movement; import java.util.function.BiFunction; import uk.dangrew.dinosaurs.game.world.World; import uk.dangrew.dinosaurs.game.world.WorldLocation; /** * Types of movement permitted by the player. */ public enum Movement { UP( "Up", (l, w) -> l.translate(0, -1, w) ), RIGHT( "Right", (l, w) -> l.translate(1, 0, w) ), DOWN( "Down", (l, w) -> l.translate(0, 1, w) ), LEFT( "Left", (l, w) -> l.translate(-1, 0, w) ); private final String displayName; private final BiFunction<WorldLocation, World, WorldLocation> rawMoverFunction; private Movement(String displayName, BiFunction<WorldLocation, World, WorldLocation> rawMoverFunction) { this.displayName = displayName; this.rawMoverFunction = rawMoverFunction; } public WorldLocation move(WorldLocation worldLocation, World world) { return rawMoverFunction.apply(worldLocation, world); } public String displayName() { return displayName; } }
05e53c43c76321184d30805ec4495cc5df254f1e
eb6b020ed9520a7a875b8c581254ba62e03033ce
/app/src/main/java/com/example/android/mapvoyage/MainActivity.java
1dbc4eef5de4f65d9f56f7af149699d1c0dfa391
[]
no_license
edashota426/MapVoyage
fe23373d6c061805e986a3e2192db8e6e288c7af
7af553480875a97ed7043610bf2fa526b4fa3212
refs/heads/master
2021-08-08T22:38:26.051991
2017-11-11T14:05:12
2017-11-11T14:05:12
110,350,123
0
0
null
null
null
null
UTF-8
Java
false
false
1,212
java
package com.example.android.mapvoyage; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } public void showMap1 (View v) { Uri geoLocation = Uri.parse("google.streetview:cbll=47.6267071,-122.2424512"); Intent intent = new Intent(Intent.ACTION_VIEW); intent.setPackage("com.google.android.apps.maps"); intent.setData(geoLocation); if (intent.resolveActivity(getPackageManager()) != null) { startActivity(intent); } } public void showMap2 (View v) { Uri geoLocation = Uri.parse("google.streetview:cbll=37.4351932,-122.1404567"); Intent intent = new Intent(Intent.ACTION_VIEW); intent.setPackage("com.google.android.apps.maps"); intent.setData(geoLocation); if (intent.resolveActivity(getPackageManager()) != null) { startActivity(intent); } } }
41b5fba4ab78b2fc16aaf4b0a3ec3bdcdf036a09
f40c5613a833bc38fca6676bad8f681200cffb25
/kubernetes-model-generator/openshift-model/src/generated/java/io/fabric8/openshift/api/model/RoleBindingList.java
b6525bda2ed7373e6c4034b8519436459bcaffc4
[ "Apache-2.0" ]
permissive
rohanKanojia/kubernetes-client
2d599e4ed1beedf603c79d28f49203fbce1fc8b2
502a14c166dce9ec07cf6adb114e9e36053baece
refs/heads/master
2023-07-25T18:31:33.982683
2022-04-12T13:39:06
2022-04-13T05:12:38
106,398,990
2
3
Apache-2.0
2023-04-28T16:21:03
2017-10-10T09:50:25
Java
UTF-8
Java
false
false
5,112
java
package io.fabric8.openshift.api.model; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.fabric8.kubernetes.api.model.Container; import io.fabric8.kubernetes.api.model.IntOrString; import io.fabric8.kubernetes.api.model.KubernetesResource; import io.fabric8.kubernetes.api.model.KubernetesResourceList; import io.fabric8.kubernetes.api.model.LabelSelector; import io.fabric8.kubernetes.api.model.ListMeta; import io.fabric8.kubernetes.api.model.LocalObjectReference; import io.fabric8.kubernetes.api.model.ObjectMeta; import io.fabric8.kubernetes.api.model.ObjectReference; import io.fabric8.kubernetes.api.model.PersistentVolumeClaim; import io.fabric8.kubernetes.api.model.PodTemplateSpec; import io.fabric8.kubernetes.api.model.ResourceRequirements; import io.fabric8.kubernetes.model.annotation.Group; import io.fabric8.kubernetes.model.annotation.Version; import io.sundr.builder.annotations.Buildable; import io.sundr.builder.annotations.BuildableReference; import lombok.EqualsAndHashCode; import lombok.Setter; import lombok.ToString; import lombok.experimental.Accessors; @JsonDeserialize(using = com.fasterxml.jackson.databind.JsonDeserializer.None.class) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ "apiVersion", "kind", "metadata", "items" }) @ToString @EqualsAndHashCode @Setter @Accessors(prefix = { "_", "" }) @Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, lazyCollectionInitEnabled = false, builderPackage = "io.fabric8.kubernetes.api.builder", refs = { @BuildableReference(ObjectMeta.class), @BuildableReference(LabelSelector.class), @BuildableReference(Container.class), @BuildableReference(PodTemplateSpec.class), @BuildableReference(ResourceRequirements.class), @BuildableReference(IntOrString.class), @BuildableReference(ObjectReference.class), @BuildableReference(LocalObjectReference.class), @BuildableReference(PersistentVolumeClaim.class) }) @Version("v1") @Group("authorization.openshift.io") public class RoleBindingList implements KubernetesResource, KubernetesResourceList<io.fabric8.openshift.api.model.RoleBinding> { /** * * (Required) * */ @JsonProperty("apiVersion") private String apiVersion = "authorization.openshift.io/v1"; @JsonProperty("items") private List<io.fabric8.openshift.api.model.RoleBinding> items = new ArrayList<io.fabric8.openshift.api.model.RoleBinding>(); /** * * (Required) * */ @JsonProperty("kind") private String kind = "RoleBindingList"; @JsonProperty("metadata") private ListMeta metadata; @JsonIgnore private Map<String, Object> additionalProperties = new HashMap<String, Object>(); /** * No args constructor for use in serialization * */ public RoleBindingList() { } /** * * @param metadata * @param apiVersion * @param kind * @param items */ public RoleBindingList(String apiVersion, List<io.fabric8.openshift.api.model.RoleBinding> items, String kind, ListMeta metadata) { super(); this.apiVersion = apiVersion; this.items = items; this.kind = kind; this.metadata = metadata; } /** * * (Required) * */ @JsonProperty("apiVersion") public String getApiVersion() { return apiVersion; } /** * * (Required) * */ @JsonProperty("apiVersion") public void setApiVersion(String apiVersion) { this.apiVersion = apiVersion; } @JsonProperty("items") public List<io.fabric8.openshift.api.model.RoleBinding> getItems() { return items; } @JsonProperty("items") public void setItems(List<io.fabric8.openshift.api.model.RoleBinding> items) { this.items = items; } /** * * (Required) * */ @JsonProperty("kind") public String getKind() { return kind; } /** * * (Required) * */ @JsonProperty("kind") public void setKind(String kind) { this.kind = kind; } @JsonProperty("metadata") public ListMeta getMetadata() { return metadata; } @JsonProperty("metadata") public void setMetadata(ListMeta metadata) { this.metadata = metadata; } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } @JsonAnySetter public void setAdditionalProperty(String name, Object value) { this.additionalProperties.put(name, value); } }
65bd1ad1f2b68a5ac2957fafac6fe7a84424eb42
4d39e1bc34193629f7222f2cc03b6926eee9332b
/AppPilotoJ2ee6/src/br/com/topsys/dao/TipoClienteDAO.java
987e571a189b990eef32a1cea026c86ba6e15bb0
[]
no_license
topazio/AppPilotoJ2ee6
ed8daa047f7c2caacb71592dcfe5b7fec1d1b859
0015ca5ece6f0445665a7f662e35bd21eb428224
refs/heads/master
2021-01-18T15:23:44.304938
2011-12-05T00:36:10
2011-12-05T00:36:10
2,910,394
0
0
null
null
null
null
UTF-8
Java
false
false
656
java
package br.com.topsys.dao; import java.util.ArrayList; import java.util.List; import br.com.topsys.database.TSDataBaseBrokerIf; import br.com.topsys.database.factory.TSDataBaseBrokerFactory; import br.com.topsys.model.TipoClienteModel; public class TipoClienteDAO { @SuppressWarnings("unchecked") public List<TipoClienteModel> pesquisarTodos() { //TSDataBaseBrokerIf broker = TSDataBaseBrokerFactory.getDataBaseBrokerIf(); // broker.setPropertySQL("tipoclientedao.pesquisarTodos"); //return broker.getCollectionBean(TipoClienteModel.class,"id","descricao"); return new ArrayList<TipoClienteModel>(); } }
89c3f8429fac30592b40d9fb9a883ba5443cfd90
a33ab0090a6250fe1bc827158375d59a96b0a2f2
/app/src/main/java/com/sdzx/government/governmentpersonnel/adapter/SimpleTreeAdapter.java
0a7fcc41c805d14c5a8deafcc4c98d115d7785e9
[]
no_license
mahjack/GovernmentPersonnel
e8f015eccfcc16a955436d217d4eb72ba5e7b768
f72b2dd62cdc37f8769eda16246174a5729d574a
refs/heads/master
2021-09-03T15:11:31.835818
2018-01-10T02:24:11
2018-01-10T02:24:11
115,406,604
0
0
null
null
null
null
UTF-8
Java
false
false
2,772
java
package com.sdzx.government.governmentpersonnel.adapter; import android.content.Context; import android.util.Log; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; import com.sdzx.government.governmentpersonnel.R; import com.sdzx.government.governmentpersonnel.activity.MyApp; import com.sdzx.government.governmentpersonnel.activity.SlectManDialog; import com.sdzx.government.governmentpersonnel.bean.FileBean; import com.sdzx.government.governmentpersonnel.fragment.DaFragment; import com.zhy.tree.bean.Node; import com.zhy.tree.bean.TreeListViewAdapter; import java.util.List; public class SimpleTreeAdapter<T> extends TreeListViewAdapter<T> { List<FileBean> datas; Context context; public SimpleTreeAdapter(ListView mTree, Context context, List<FileBean> datas, int defaultExpandLevel) throws IllegalArgumentException, IllegalAccessException { super(mTree, context, (List<T>) datas, defaultExpandLevel); this.datas = datas; this.context = context; } @Override public View getConvertView(final Node node, final int position, View convertView, ViewGroup parent) { ViewHolder viewHolder = null; if (convertView == null) { convertView = mInflater.inflate(R.layout.list_item, parent, false); viewHolder = new ViewHolder(); viewHolder.icon = (ImageView) convertView .findViewById(R.id.id_treenode_icon); viewHolder.label = (TextView) convertView .findViewById(R.id.id_treenode_label); viewHolder.xuanz = (TextView) convertView .findViewById(R.id.tv_xz); convertView.setTag(viewHolder); } else { viewHolder = (ViewHolder) convertView.getTag(); } if (node.getIcon() == -1) { viewHolder.icon.setVisibility(View.INVISIBLE); } else { viewHolder.icon.setVisibility(View.VISIBLE); viewHolder.icon.setImageResource(node.getIcon()); } viewHolder.label.setText(node.getName()); viewHolder.xuanz.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { MyApp.bmname=node.getName(); MyApp.bmid=node.getId()+""; DaFragment.spinner_bm.setText( MyApp.bmname); Log.v("bmid",MyApp.bmid); SlectManDialog.dialog.dismiss(); } }); return convertView; } private final class ViewHolder { ImageView icon; TextView label; TextView xuanz; } }
1b2167242caaa8a08cfcfefcfe7879b06e23b05b
6b01b801b51d72befe24bff15b8dd89cfc6b3ded
/Web学习/DBUtilDemo/src/ThreadLocal/Mythread.java
60dad981c588b9cb95179fc80763ad9cd960bbe1
[]
no_license
FanBingyang/HelloWord
1d638fac40ea1475000cf43104cf14e345ab18a8
a883a72112a007850af4f4c7449b47a3dadd3bb7
refs/heads/master
2022-07-23T09:20:12.940791
2019-07-01T15:13:13
2019-07-01T15:13:13
187,741,986
2
0
null
2022-06-21T01:23:21
2019-05-21T01:50:39
Java
UTF-8
Java
false
false
227
java
package ThreadLocal; public class Mythread extends Thread{ private ThreadLocal tl; public Mythread(ThreadLocal tl) { this.tl = tl; } @Override public void run() { System.out.println(tl.get()+"aaaaaaaaaaaaa"); } }
2cc76c1898ad3c4dccfe60edb26cd56ed30e8798
89c2efc5fd03b63b6bf86325ee67ff755b3902fe
/src/main/java/de/tarent/challenge/config/ProductSetterConfiguration.java
1c9b6a7a12e29d0ba19043bb2a5362629b876997
[ "MIT" ]
permissive
JanCGu/tscr
9a5f56b52585cf74a2d2583fb6b5fa818d804ad2
ff38197a82fab3406e3ab0ac89d3eb5f68073b82
refs/heads/master
2020-04-05T04:44:22.901420
2018-11-25T19:45:53
2018-11-25T19:45:53
156,564,629
0
0
null
null
null
null
UTF-8
Java
false
false
738
java
package de.tarent.challenge.config; import de.tarent.challenge.persistent.ProductStorer; import de.tarent.challenge.service.IProductSetter; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; /** * A Factory allowing to get the ProductServices between layers. * * @author Jan */ @Configuration @ComponentScan(value = {"de.tarent.challenge.persitent"}) public class ProductSetterConfiguration { /** * Returns a IProductSetter with access to a perstiant storage. * * @return */ @Bean public static IProductSetter getIProductSetter() { return new ProductStorer(); } }
48b24c3883bbab7ec5b4fb2450dc5acd14c463bf
cf4335e6eba82f7866303bb21a72a6a6b7b2768f
/src/main/java/three/battle/Unit.java
c0ec07a1184d31e50d876e12b84c37888acfb2d9
[]
no_license
zhoooltyj/ya
ec26b03a6052a9d093820dd70b9ee824e27b3522
56bb70c91d5dcd8f1125c78c8735728130035b5f
refs/heads/master
2021-07-16T21:37:50.412796
2017-10-24T08:53:19
2017-10-24T08:53:19
107,240,313
0
0
null
null
null
null
UTF-8
Java
false
false
579
java
package three.battle; /** * Created by polosatik on 26.09.17. */ public abstract class Unit { protected final int power; protected final double speed; protected Terrain terrain; protected Unit(int power, int speed, Terrain terrain) { this.power = power; this.speed = speed; this.terrain = terrain; } public void move() { System.out.println(this.getClass() + " moving forward: " + speed); } public abstract void shoot(); public void setTerrain(Terrain terrain) { this.terrain = terrain; } }
8c941d181ace801000a823e386d19527e84c1f71
0af8b92686a58eb0b64e319b22411432aca7a8f3
/api-vs-impl-small/app/src/main/java/org/gradle/testapp/performancenull_39/Productionnull_3883.java
a9078e354adce56832bc995467c20dc7d06e683a
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
588
java
package org.gradle.testapp.performancenull_39; public class Productionnull_3883 { private final String property; public Productionnull_3883(String param) { this.property = param; } public String getProperty() { return property; } private String prop0; public String getProp0() { return prop0; } public void setProp0(String value) { prop0 = value; } private String prop1; public String getProp1() { return prop1; } public void setProp1(String value) { prop1 = value; } }
9c8850e49984100c19804c4cdf1e6be4b10a2379
7030ac2a67064e0c4207059b8d71bf1184194d37
/app/src/main/java/com/redridgeapps/movies/model/tmdb/Reviews.java
2dc4e7d103fbc25228508ad74499209d50639c92
[]
no_license
SaurabhSandav/Movies
db753da5034eff143a2e80ba66454a056f79758e
97d9754af3ea1f481fd22ff2b6acefdd670e8319
refs/heads/master
2020-03-19T09:56:30.035007
2018-08-30T12:44:50
2019-01-04T13:38:28
136,329,569
2
0
null
null
null
null
UTF-8
Java
false
false
2,223
java
package com.redridgeapps.movies.model.tmdb; import android.os.Parcel; import android.os.Parcelable; import com.squareup.moshi.Json; import java.util.ArrayList; import java.util.List; public class Reviews implements Parcelable { @Json(name = "page") private Integer page; @Json(name = "results") private List<ReviewItem> results = null; @Json(name = "total_pages") private Integer totalPages; @Json(name = "total_results") private Integer totalResults; public Integer getPage() { return page; } public void setPage(Integer page) { this.page = page; } public List<ReviewItem> getResults() { return results; } public void setResults(List<ReviewItem> results) { this.results = results; } public Integer getTotalPages() { return totalPages; } public void setTotalPages(Integer totalPages) { this.totalPages = totalPages; } public Integer getTotalResults() { return totalResults; } public void setTotalResults(Integer totalResults) { this.totalResults = totalResults; } public static final Parcelable.Creator<Reviews> CREATOR = new Parcelable.Creator<Reviews>() { @Override public Reviews createFromParcel(Parcel source) { return new Reviews(source); } @Override public Reviews[] newArray(int size) { return new Reviews[size]; } }; public Reviews() { } private Reviews(Parcel in) { this.page = (Integer) in.readValue(Integer.class.getClassLoader()); this.results = new ArrayList<>(); in.readList(this.results, ReviewItem.class.getClassLoader()); this.totalPages = (Integer) in.readValue(Integer.class.getClassLoader()); this.totalResults = (Integer) in.readValue(Integer.class.getClassLoader()); } @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeValue(this.page); dest.writeList(this.results); dest.writeValue(this.totalPages); dest.writeValue(this.totalResults); } }
94509d478c6c47549c17548bb8c7a937379e504e
989c34fe8b3498a0c0dfff5368955786d64773f9
/app/src/main/java/com/synle/counterfeit_goods_tracker/AuthenticationAgency.java
728603965ae5081dc60fcee5f61e5335ea50bf82
[]
no_license
synle/android-counterfeit-goods-tracker
ac9fb08b19294685cd3761b5d883fcc0e29ccf05
9e3322cc37d4aa58125f03b72099f1c7446d13e6
refs/heads/master
2020-03-13T17:31:20.303597
2018-05-20T00:47:56
2018-05-20T00:54:55
131,218,659
0
0
null
null
null
null
UTF-8
Java
false
false
1,272
java
package com.synle.counterfeit_goods_tracker; import android.content.Context; import android.content.Intent; import android.os.AsyncTask; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.EditText; import com.synle.counterfeit_goods_tracker.com.synle.counter_goods_tracker.common.CommonUtil; import com.synle.counterfeit_goods_tracker.com.synle.counter_goods_tracker.common.DataUtil; import com.synle.counterfeit_goods_tracker.com.synle.counterfeit_goods_tracker.com.synle.counter_goods_tracker.dao.Site; public class AuthenticationAgency extends AuthenticationBase { public AuthenticationAgency(){ this.isAgency = true; } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_authentication_agency); txtSiteName = findViewById(R.id.txtSiteName); txtSiteLocation = findViewById(R.id.txtSiteLocation); txtSiteName.setText("Agency-Santa-Clara"); txtSiteLocation.setText("Santa Clara"); intent = new Intent(this, DashboardAgency.class); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_TASK_ON_HOME); } }
3be4620524925d15c07f8ba6e14ce61c0648c975
5e231c2ecfea4e7303b360bbfbf5d60da5862f7b
/Printing numbers in inverse right angle triangle/Main.java
21102cb447b4096c8bee5eae6d8fd20ed8cbc69a
[]
no_license
Manali-006/Playground
a1fb35f394f423cd546e9dcb090ee5cf5bbf81d7
399845f23a3c7ed8835634c2ae4dd9d0717430a2
refs/heads/master
2020-05-18T19:11:57.550526
2019-08-03T05:24:54
2019-08-03T05:24:54
184,603,669
0
0
null
null
null
null
UTF-8
Java
false
false
485
java
import java.util.Scanner; class Main{ public static void main (String[] args){ // Type your code here Scanner in = new Scanner(System.in); int n = in.nextInt(); int val = n; for(int curr_row = 1; curr_row <= n; curr_row++) { // Handle numbers for each row for(int curr_col = val; curr_col >= 1; curr_col--) { System.out.print(curr_col); } val--; System.out.println(); } } }
523d5eb4d4ce6a0af938d71ae4eca830493c377c
e86a478cb3c67d4b72af434f68069495d66fb393
/app/src/main/java/com/example/notebook/utils/DeleteDialogFragment.java
f987f75bcc090d0a0cc23fa7ba2afcd2dc87c5c5
[]
no_license
yulmaso/c_notebook
71795a4124ad333860831f0f3f870ff496a96b0d
d5f00edc21501c3e0f9f57c7fc2232e83ba946ef
refs/heads/master
2020-08-22T08:02:53.803109
2020-03-11T16:14:20
2020-03-11T16:14:20
216,353,872
1
0
null
null
null
null
UTF-8
Java
false
false
1,731
java
package com.example.notebook.utils; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.DialogFragment; import com.example.notebook.screens.note.NoteActivity; import com.example.notebook.R; public class DeleteDialogFragment extends DialogFragment implements View.OnClickListener { private NoteActivity noteActivity; public DeleteDialogFragment(NoteActivity noteActivity){ this.noteActivity = noteActivity; } @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { getDialog().setTitle("Delete"); View v = inflater.inflate(R.layout.dialog_delete_layout, null); v.findViewById(R.id.cancel_dialog_button).setOnClickListener(this); v.findViewById(R.id.delete_dialog_button).setOnClickListener(this); return v; } @Override public void onResume() { super.onResume(); getDialog().getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); } @Override public void onClick(View v) { switch (v.getId()){ case R.id.delete_dialog_button:{ noteActivity.deleteNote(); dismiss(); break; } case R.id.cancel_dialog_button:{ dismiss(); break; } } } }
d16265d9e159f9ceca4911900c043ff70a9791db
b73c8deb34ae0915d5f8135a2878c18fa747a196
/04_StatementsTest/src/com/kh/test/loop/Test2.java
2a6500b31645aab0c067402e271db0603b6dc038
[]
no_license
kianpas/KH_Java_Test
c444082a9b726677307bb016e044d16efe3ca855
5e1a99b69609362b2370ee134f8b4b40845bf624
refs/heads/main
2023-02-28T09:12:53.626402
2021-02-08T06:33:15
2021-02-08T06:33:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
423
java
package com.kh.test.loop; import java.util.Scanner; public class Test2 { public static void main(String[] args) { Test2 t2 = new Test2(); t2.test(); } public void test() { Scanner sc = new Scanner(System.in); int num = sc.nextInt(); String res = null; for(int i = 1; i <= num; i++) { if (i % 2 == 0) { res = "박"; } else { res = "수"; } System.out.print(res); } } }
bce42eb5009a0007c914333bf94b758008a669ca
a40dad4afecd0db0b4dadbfeb01fdb707b7013d5
/src/main/java/mvc/controller/TestController.java
fa149f2ea2a0143afeb19e48f499ca17750faa3a
[]
no_license
seawaylee/SpringInAction4th
374a27195ba772bb141d8c3d83c6868ef5970f8d
3e9976efc8a2da78eed0ee8720027e0029af153b
refs/heads/master
2021-01-11T20:27:21.164509
2017-04-11T11:52:13
2017-04-11T11:52:13
79,118,729
0
0
null
null
null
null
UTF-8
Java
false
false
4,713
java
package mvc.controller; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import javax.json.JsonObject; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.Serializable; import java.io.UnsupportedEncodingException; import java.util.Map; /** * @author NikoBelic * @create 2017/3/29 21:54 */ @Controller @RequestMapping(value = "/mvc") public class TestController { /** * 测试启动 * * @Author SeawayLee * @Date 2017/03/29 22:08 */ @ResponseBody @RequestMapping(value = "/") public Object helloMVC(HttpServletRequest request, HttpServletResponse response) { return "Let's Go"; } /** * 测试Content-Type * * @Author SeawayLee * @Date 2017/03/29 22:24 */ @ResponseBody @RequestMapping(value = "/testContentType", consumes = "text/html;charset=utf-8", produces = "application/json;charset=utf-8", params = {"patientId"}, headers = {"ABC"}) public Object testContentType(HttpServletRequest request, HttpServletResponse response, String patientId) { return patientId + "\n" + request.getContentType(); } /** * 这种参数接收方式,实质上是UrlParam * UrlParam一定会导致中文乱码,除非客户端手动将中文URLEncode * * @Author SeawayLee * @Date 2017/03/29 22:49 */ @ResponseBody @RequestMapping(value = "/getJson1", method = RequestMethod.POST, produces = "application/json;charset=utf-8") public Object getJson1(HttpServletRequest request, HttpServletResponse response, String patientId, String patientName) throws UnsupportedEncodingException { System.out.println(patientName); return new Patient(patientId, patientName); } /** * @ReuqestBody 指明被注解的参数是请求的body,可以是一个json结构,只要双方字符集统一,不会出现中文乱码 * @Author SeawayLee * @Date 2017/03/29 23:14 */ @ResponseBody @RequestMapping(value = "/getJson2", method = RequestMethod.POST, produces = "application/json") public Object getJson2(HttpServletRequest request, @RequestBody JSONObject patientJson) throws UnsupportedEncodingException { System.out.println(patientJson); return patientJson; } /** * 和上面一样 * @Author SeawayLee * @Date 2017/03/29 23:16 */ @ResponseBody @RequestMapping(value = "/getJson3", method = RequestMethod.POST, produces = "application/json") public Object getJson3(HttpServletRequest request, @RequestBody Map<String, String> params) throws UnsupportedEncodingException { System.out.println(params); return params; } /** * 如果请求参数中既有json,又有独立的参数,客户端需要将数据以表单的形式提交 * @Author SeawayLee * @Date 2017/03/29 23:36 */ @ResponseBody @RequestMapping(value = "/getJson4", method = RequestMethod.POST, produces = "application/json;charset=utf-8") public Object getJson4(HttpServletRequest request, @RequestParam(required = true) String patientJson,@RequestParam(required = false) String city) throws UnsupportedEncodingException { System.out.println(patientJson); System.out.println(city); return patientJson; } /** * 同上 * @Author SeawayLee * @Date 2017/03/29 23:40 */ @ResponseBody @RequestMapping(value = "/getJson5", method = RequestMethod.POST, produces = "application/json;charset=utf-8") public Object getJson5(HttpServletRequest request) throws UnsupportedEncodingException { String patientJson = request.getParameter("patientJson"); String city = request.getParameter("city"); System.out.println(patientJson); System.out.println(city); return patientJson; } class Patient implements Serializable { private String patientId; private String patientName; public Patient(String patientId, String patientName) { this.patientId = patientId; this.patientName = patientName; } public String getPatientId() { return patientId; } public void setPatientId(String patientId) { this.patientId = patientId; } public String getPatientName() { return patientName; } public void setPatientName(String patientName) { this.patientName = patientName; } } }
3eddb067547a7ae5fadcc761648736c1fac270d2
167cf91ec2deac74f6400997474ae2df1065d27e
/src/test/java/com/potato112/springservice/SpringServiceAppTests.java
a6efce184741e1da01528888f045419ccae62cd8
[]
no_license
MocMilo/spring-service
cf23ff5aa0a90ccb140e02a9b13ba3377bba11d8
67b78b0c0ce10c52d4192f6a29169ff43806c9d2
refs/heads/master
2023-06-23T22:24:57.178842
2020-04-18T22:59:24
2020-04-18T22:59:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
772
java
package com.potato112.springservice; import com.potato112.springservice.config.AppConfig; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.transaction.annotation.EnableTransactionManagement; //import org.springframework.transaction.annotation.EnableTransactionManagement; @RunWith(SpringRunner.class) @ContextConfiguration(classes = {AppConfig.class}) @EnableTransactionManagement @Rollback @SpringBootTest public class SpringServiceAppTests { @Test public void contextLoads() { } }
92571d6e39c536da243cf49caff6b9a570af8292
d8f4ee310dca6e93cefb26217b278053307c797b
/src/com/dora/test_algorithm/shortestpath/DijkstraTest.java
a37a450790eaaa06848d9cb35082fa5ff9354f04
[]
no_license
wkdthf21/Data-Structure
a666ac1be643b8587d21db5ef8960ae9f5328710
2aad426ede7007326af7f2fbe8d55388b473d502
refs/heads/main
2022-12-30T22:13:55.424680
2020-10-23T08:21:37
2020-10-23T08:21:37
271,230,034
0
0
null
null
null
null
UTF-8
Java
false
false
441
java
package com.dora.test_algorithm.shortestpath; import static org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.Test; import com.dora.algorithm.shortestpath.Dijkstra; class DijkstraTest { int[][] graph = { {0, 3, 0, 3 ,2}, {0, 0, 0, 0, 5}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 5}, {0, 0, 6, 0, 0}, }; @Test void test() { Dijkstra dijkstra = new Dijkstra(graph); dijkstra.printShortestPath(0); } }
c624bd0cd407d697a9796b3cca103da5b88ad984
82e1f183bf622c33cc18bf8e98b71f04c5336592
/core/src/main/java/com/triangleleft/flashcards/service/settings/UserData.java
c36daea4440eb5cd7968220653d2ae5fc9a56b03
[ "Apache-2.0" ]
permissive
AhmedThabit/Flashcards
b9b2ad2e97622d0fc6deff0f7207af178581d0f3
2b6a4238ae008ddf326c21663463ab7025af905d
refs/heads/master
2020-03-11T10:48:20.229563
2017-02-25T14:30:46
2017-02-25T14:30:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,846
java
package com.triangleleft.flashcards.service.settings; import com.google.auto.value.AutoValue; import com.annimon.stream.Optional; import com.annimon.stream.Stream; import com.triangleleft.flashcards.util.AutoGson; import java.util.Comparator; import java.util.List; import static com.annimon.stream.Collectors.toList; @AutoGson @AutoValue public abstract class UserData { private static final Comparator<Language> languageComparator = (l1, l2) -> Boolean.valueOf(l2.isCurrentLearning()).compareTo(l1.isCurrentLearning()); public static UserData create( List<Language> languages, String avatar, String username, String uiLanguage, String learningLanguage) { return new AutoValue_UserData( languages, avatar, username, uiLanguage, learningLanguage); } public abstract List<Language> getLanguages(); public abstract String getAvatar(); public abstract String getUsername(); public abstract String getUiLanguageId(); public abstract String getLearningLanguageId(); public abstract UserData withLanguages(List<Language> languages); public abstract UserData withLearningLanguageId(String learningLanguageId); public List<Language> getSortedLanguages() { // We assume that is only one language that we are currently learning // Sort it, so it is always top of the list return Stream.of(getLanguages()) .filter(Language::isLearning) .sorted(languageComparator) .collect(toList()); } public Optional<Language> getCurrentLearningLanguage() { List<Language> languages = getSortedLanguages(); return languages.size() > 0 ? Optional.of(languages.get(0)) : Optional.empty(); } }
3fd29d00bb6ec9fe6f1ecc438ea78816a147eb75
21be796e2c3213d0f66425fe0f149620d1b5e1a9
/src/main/java/com/spring/swagger/config/SpringSecConfig.java
99d1785aca51b0b08cd4ee77e15f77c820bc2550
[]
no_license
Dah-roh/swagger
b64aea5b66d76b24e20e363df5cdc43a7b0c4aa9
4826083c69d2f7f508152c6ec357f2cf8d4bcdce
refs/heads/master
2023-08-09T21:43:25.167626
2020-06-26T20:27:47
2020-06-26T20:27:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
652
java
package com.spring.swagger.config; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; @Configuration public class SpringSecConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity httpSecurity) throws Exception { httpSecurity.authorizeRequests().antMatchers("/","/swagger-resources").permitAll(); httpSecurity.csrf().disable(); httpSecurity.headers().frameOptions().disable(); } }
efddc7969a8ab2cffabe6522149894ee5ce72243
7983b2efeafb036a7dbf41a6d738996aa768e4c0
/src/main/java/coinsorter/textui/SetMaximumValueCommand.java
4863d699992704f2645076f2fd17736f3c575e60
[ "MIT" ]
permissive
dtmo/coin-sorter
2ed2fbfed426f029e4a6e0faca2b9a087f6f6da4
dd0efc10485156001cce0e320518b0f816d4a581
refs/heads/main
2023-01-23T20:44:45.199793
2020-11-29T11:42:24
2020-11-29T11:42:24
316,559,510
0
0
null
null
null
null
UTF-8
Java
false
false
832
java
package coinsorter.textui; import java.util.List; import coinsorter.CoinSorter; import coinsorter.validation.MinimumValueConstraintValidator; public class SetMaximumValueCommand implements Command { private final CoinSorter coinSorter; private final Console console; public SetMaximumValueCommand(final CoinSorter coinSorter, final Console console) { this.coinSorter = coinSorter; this.console = console; } @Override public void execute() { console.println("Current maximum coin input is: " + coinSorter.getMaximumValue()); final int maximumValue = console.promptForValidInt("Please enter a new maximum coin input: ", List.of(new MinimumValueConstraintValidator(coinSorter.getMinimumValue()))); coinSorter.setMaximumValue(maximumValue); } }
191168e4d40b35eea47168c1f8eb70a8f54e8a82
7c54e3f652b6a2c8725dd46b5d2d895fb76a3598
/part_001/src/main/java/ru/javavlad/array/ArrayDuplicate.java
6b2cd43eba60794c6d393a56789e48e3375fcfdd
[ "Apache-2.0" ]
permissive
Vladislav4er/Quantum_Leap
52079705cf6f5caaff124a489b677f7ad35a48b5
8e9c960f081728b7cf991d019d0f50b92b52f70c
refs/heads/master
2019-10-04T13:51:27.857791
2018-06-06T21:40:13
2018-06-06T21:40:13
99,323,329
0
0
null
null
null
null
UTF-8
Java
false
false
768
java
package ru.javavlad.array; import java.util.Arrays; /** * ArrayDuplicate class. * @author Vladislav4er * @version 1.00 * @since 04.04.2018 */ public class ArrayDuplicate { /** * Duplicate in array remove method. * @param array - input array with duplicates * @return array without duplicates */ public String[] remove(String[] array) { int unique = array.length; for (int out = 0; out < unique; out++) { for (int in = out + 1; in < unique; in++) { if (array[out].equals(array[in])) { array[in] = array[unique - 1]; unique--; in--; } } } return Arrays.copyOf(array, unique); } }
6ce5dad49981bd19b7df775cef6224bda3d3cb05
f41bfb9a06ba6f576cdb48f759c80ddf042bc907
/petclinic2019-data/src/main/java/com/blogspot/jesfre/petclinic2019/repositories/PetRepository.java
077db9eb1bd38595b17b21b5f541fd4ffe69af7e
[]
no_license
jesfre/petclinic2019
b02eb1b1fe907da5d6b4c728f67ccf28c56ce134
ea5538bb3b5c4be1a0a91167bc8540735f8d1464
refs/heads/master
2020-04-20T15:37:23.366740
2019-05-08T11:22:30
2019-05-08T11:22:30
168,936,096
1
0
null
null
null
null
UTF-8
Java
false
false
238
java
package com.blogspot.jesfre.petclinic2019.repositories; import com.blogspot.jesfre.petclinic2019.model.Pet; import org.springframework.data.repository.CrudRepository; public interface PetRepository extends CrudRepository<Pet, Long> { }
89a37003a9ba6889ef4e56ca35f3a7e324e67c36
a7ee817234ce177f9fc5e80b732c7a345300d616
/OOPS/StringHandling/StringConstantPooll.java
4a4bf9b72bcbdfb639dada807d41ca42b3b71d08
[]
no_license
javatopics3/Core-Java
ade885ae60ed57edc8d6595473ea76a46cb7dcec
9fe3a6c09fceb4d4119b77f2ed2daebb65b14bd8
refs/heads/master
2021-05-11T07:22:47.537902
2018-01-29T10:30:22
2018-01-29T10:30:22
118,018,200
0
0
null
null
null
null
UTF-8
Java
false
false
245
java
package StringHandling; public class StringConstantPooll { public static void main(String[] args) { String s = "prasad"; String s2 = new String("prasad"); System.out.println(s.equals(s2)); System.out.println(s == s2); } }
[ "Raghunadh@RAGHU" ]
Raghunadh@RAGHU
b357fa799fae871bf4b7ca9c209244bdb886ce33
df2cb70561c8cd2a4bfd05a363b7a8f21a964e02
/MoWiDi PC/test/edu/kit/ibds/mowidi/pc/controller/NotifierTest.java
303a3fbb61b2e439f486236ceaf55af16364a4b6
[ "MIT" ]
permissive
DocGerd/MoWiDi
c26aee6f5f64e6f7f78d10e7c3a1be896142d385
3fe6011e75bf37eacca8b9d09267f28519df7f97
refs/heads/master
2021-01-11T03:44:25.484947
2016-10-18T22:57:23
2016-10-18T22:57:23
71,295,807
1
0
null
null
null
null
UTF-8
Java
false
false
2,542
java
/* * @(#)NotifierTest.java * * This file is part of MoWiDi. * * MoWiDi is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * MoWiDi is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with MoWiDi. If not, see <http://www.gnu.org/licenses/>. * * Copyright 2010 by PSE23-Team: * * Patrick Kuhn, Michael Auracher, * André Wengert, Kim Spieß, Christopher Schütze */ package edu.kit.ibds.mowidi.pc.controller; import org.junit.BeforeClass; import org.junit.Test; import static org.junit.Assert.*; /** * * @author Patrick Kuhn */ public class NotifierTest { @BeforeClass public static void before() { System.out.println("---------------"); System.out.println("--Notifier"); } private static final class ObservingViewImpl implements ObservingView { @Override public void update(final Information i) { assert true; } } /** * Test of addObservingView method, of class Notifier. */ @Test public void testAddObservingView() { System.out.println("addObservingView"); final int expResult = 1; final ObservingView o = new ObservingViewImpl(); final Notifier instance = new Notifier(); instance.addObservingView(o); assertEquals(expResult, instance.getRegisteredCount()); } /** * Test of notifyObservers method, of class Notifier. */ @Test public void testNotifyObservers() { System.out.println("notifyObservers"); final Information i = null; final Notifier instance = new Notifier(); final ObservingView o = new ObservingViewImpl(); instance.addObservingView(o); instance.notifyObservers(i); } /** * Test of getRegisteredCount method, of class Notifier. */ @Test public void testGetRegisteredCount() { System.out.println("getRegisteredCount"); final Notifier instance = new Notifier(); final int expResult = 0; final int result = instance.getRegisteredCount(); assertEquals(expResult, result); } }
1443df5c178b66d21acb9ddde1a457598d017af7
6acd37ef75fa2d56bf2f501e0c1e55adbbcf5cd3
/src/testPackage/HeaderClass.java
afd139236af346b911f12d2a2935adfb4d5c0591
[]
no_license
skuriako/sheena
c8cac021141ebd402e9950359a868a02c0dad128
53d527621948cd4f7843c25bb8297cd14b3be4fb
refs/heads/master
2021-04-19T13:06:36.049366
2020-03-24T03:43:48
2020-03-24T03:43:48
249,606,383
0
0
null
null
null
null
UTF-8
Java
false
false
135
java
package testPackage; public class HeaderClass { public void validateHeader() { System.out.println("here i validate the header"); } }
70685c4501b7b33a098d2843834905c6527bd9e6
dc0919c9609f03f5b239ec0799cea22ed070f411
/android/support/v4/widget/SearchViewCompat$SearchViewCompatHoneycombImpl$2.java
7ea5c5cbb9a48af18c64f059dd5fa57f77de3087
[]
no_license
jjensn/milight-decompile
a8f98af475f452c18a74fd1032dce8680f23abc0
47c4b9eea53c279f6fab3e89091e2fef495c6159
refs/heads/master
2021-06-01T17:23:28.555123
2016-10-12T18:07:53
2016-10-12T18:07:53
70,721,205
5
0
null
null
null
null
UTF-8
Java
false
false
632
java
package android.support.v4.widget; class SearchViewCompat$SearchViewCompatHoneycombImpl$2 implements SearchViewCompatHoneycomb.OnCloseListenerCompatBridge { SearchViewCompat$SearchViewCompatHoneycombImpl$2(SearchViewCompat.SearchViewCompatHoneycombImpl paramSearchViewCompatHoneycombImpl, SearchViewCompat.OnCloseListenerCompat paramOnCloseListenerCompat) { } public boolean onClose() { return this.val$listener.onClose(); } } /* Location: * Qualified Name: android.support.v4.widget.SearchViewCompat.SearchViewCompatHoneycombImpl.2 * Java Class Version: 6 (50.0) * JD-Core Version: 0.6.1-SNAPSHOT */
3673db31fb63ff99edd366d346256a266fe10390
21b736028889a32f1dcba96e8236f80cc9973df5
/src/com/microsoft/schemas/xrm/_2011/metadata/impl/ArrayOfStringFormatImpl.java
7028cfbb51e7732e40b075f876859b12af0f9401
[]
no_license
nbuddharaju/Java2CRMCRUD
3cfcf487ce9fe9c8791484387f32da2e83ccef15
aaba26757df088dda780aa6fe873c7d8356f4d56
refs/heads/master
2021-01-19T04:07:07.528318
2016-05-28T08:52:28
2016-05-28T08:52:28
59,885,531
0
2
null
null
null
null
UTF-8
Java
false
false
8,109
java
/* * XML Type: ArrayOfStringFormat * Namespace: http://schemas.microsoft.com/xrm/2011/Metadata * Java type: com.microsoft.schemas.xrm._2011.metadata.ArrayOfStringFormat * * Automatically generated - do not modify. */ package com.microsoft.schemas.xrm._2011.metadata.impl; /** * An XML ArrayOfStringFormat(@http://schemas.microsoft.com/xrm/2011/Metadata). * * This is a complex type. */ public class ArrayOfStringFormatImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements com.microsoft.schemas.xrm._2011.metadata.ArrayOfStringFormat { private static final long serialVersionUID = 1L; public ArrayOfStringFormatImpl(org.apache.xmlbeans.SchemaType sType) { super(sType); } private static final javax.xml.namespace.QName STRINGFORMAT$0 = new javax.xml.namespace.QName("http://schemas.microsoft.com/xrm/2011/Metadata", "StringFormat"); /** * Gets array of all "StringFormat" elements */ public com.microsoft.schemas.xrm._2011.metadata.StringFormat.Enum[] getStringFormatArray() { synchronized (monitor()) { check_orphaned(); java.util.List targetList = new java.util.ArrayList(); get_store().find_all_element_users(STRINGFORMAT$0, targetList); com.microsoft.schemas.xrm._2011.metadata.StringFormat.Enum[] result = new com.microsoft.schemas.xrm._2011.metadata.StringFormat.Enum[targetList.size()]; for (int i = 0, len = targetList.size() ; i < len ; i++) result[i] = (com.microsoft.schemas.xrm._2011.metadata.StringFormat.Enum)((org.apache.xmlbeans.SimpleValue)targetList.get(i)).getEnumValue(); return result; } } /** * Gets ith "StringFormat" element */ public com.microsoft.schemas.xrm._2011.metadata.StringFormat.Enum getStringFormatArray(int i) { synchronized (monitor()) { check_orphaned(); org.apache.xmlbeans.SimpleValue target = null; target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(STRINGFORMAT$0, i); if (target == null) { throw new IndexOutOfBoundsException(); } return (com.microsoft.schemas.xrm._2011.metadata.StringFormat.Enum)target.getEnumValue(); } } /** * Gets (as xml) array of all "StringFormat" elements */ public com.microsoft.schemas.xrm._2011.metadata.StringFormat[] xgetStringFormatArray() { synchronized (monitor()) { check_orphaned(); java.util.List targetList = new java.util.ArrayList(); get_store().find_all_element_users(STRINGFORMAT$0, targetList); com.microsoft.schemas.xrm._2011.metadata.StringFormat[] result = new com.microsoft.schemas.xrm._2011.metadata.StringFormat[targetList.size()]; targetList.toArray(result); return result; } } /** * Gets (as xml) ith "StringFormat" element */ public com.microsoft.schemas.xrm._2011.metadata.StringFormat xgetStringFormatArray(int i) { synchronized (monitor()) { check_orphaned(); com.microsoft.schemas.xrm._2011.metadata.StringFormat target = null; target = (com.microsoft.schemas.xrm._2011.metadata.StringFormat)get_store().find_element_user(STRINGFORMAT$0, i); if (target == null) { throw new IndexOutOfBoundsException(); } return target; } } /** * Returns number of "StringFormat" element */ public int sizeOfStringFormatArray() { synchronized (monitor()) { check_orphaned(); return get_store().count_elements(STRINGFORMAT$0); } } /** * Sets array of all "StringFormat" element */ public void setStringFormatArray(com.microsoft.schemas.xrm._2011.metadata.StringFormat.Enum[] stringFormatArray) { synchronized (monitor()) { check_orphaned(); arraySetterHelper(stringFormatArray, STRINGFORMAT$0); } } /** * Sets ith "StringFormat" element */ public void setStringFormatArray(int i, com.microsoft.schemas.xrm._2011.metadata.StringFormat.Enum stringFormat) { synchronized (monitor()) { check_orphaned(); org.apache.xmlbeans.SimpleValue target = null; target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(STRINGFORMAT$0, i); if (target == null) { throw new IndexOutOfBoundsException(); } target.setEnumValue(stringFormat); } } /** * Sets (as xml) array of all "StringFormat" element */ public void xsetStringFormatArray(com.microsoft.schemas.xrm._2011.metadata.StringFormat[]stringFormatArray) { synchronized (monitor()) { check_orphaned(); arraySetterHelper(stringFormatArray, STRINGFORMAT$0); } } /** * Sets (as xml) ith "StringFormat" element */ public void xsetStringFormatArray(int i, com.microsoft.schemas.xrm._2011.metadata.StringFormat stringFormat) { synchronized (monitor()) { check_orphaned(); com.microsoft.schemas.xrm._2011.metadata.StringFormat target = null; target = (com.microsoft.schemas.xrm._2011.metadata.StringFormat)get_store().find_element_user(STRINGFORMAT$0, i); if (target == null) { throw new IndexOutOfBoundsException(); } target.set(stringFormat); } } /** * Inserts the value as the ith "StringFormat" element */ public void insertStringFormat(int i, com.microsoft.schemas.xrm._2011.metadata.StringFormat.Enum stringFormat) { synchronized (monitor()) { check_orphaned(); org.apache.xmlbeans.SimpleValue target = (org.apache.xmlbeans.SimpleValue)get_store().insert_element_user(STRINGFORMAT$0, i); target.setEnumValue(stringFormat); } } /** * Appends the value as the last "StringFormat" element */ public void addStringFormat(com.microsoft.schemas.xrm._2011.metadata.StringFormat.Enum stringFormat) { synchronized (monitor()) { check_orphaned(); org.apache.xmlbeans.SimpleValue target = null; target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(STRINGFORMAT$0); target.setEnumValue(stringFormat); } } /** * Inserts and returns a new empty value (as xml) as the ith "StringFormat" element */ public com.microsoft.schemas.xrm._2011.metadata.StringFormat insertNewStringFormat(int i) { synchronized (monitor()) { check_orphaned(); com.microsoft.schemas.xrm._2011.metadata.StringFormat target = null; target = (com.microsoft.schemas.xrm._2011.metadata.StringFormat)get_store().insert_element_user(STRINGFORMAT$0, i); return target; } } /** * Appends and returns a new empty value (as xml) as the last "StringFormat" element */ public com.microsoft.schemas.xrm._2011.metadata.StringFormat addNewStringFormat() { synchronized (monitor()) { check_orphaned(); com.microsoft.schemas.xrm._2011.metadata.StringFormat target = null; target = (com.microsoft.schemas.xrm._2011.metadata.StringFormat)get_store().add_element_user(STRINGFORMAT$0); return target; } } /** * Removes the ith "StringFormat" element */ public void removeStringFormat(int i) { synchronized (monitor()) { check_orphaned(); get_store().remove_element(STRINGFORMAT$0, i); } } }
a628fc877f9de5eae21e135642c43c1a15f2cad4
81e31a571f9263b317a60ab7e2fa6a62199aefa1
/icm4j/src/main/java/com/tnsoft/util/logging/MessageFormatter.java
6cbf6598b5de240f44e138d17e70faa8ff727728
[]
no_license
qhjindev/icm
66910f1db5b9cf549b31817e3e2adeada4babd17
9e2a659dcf8c4cdadb71e129eedb667efc817517
refs/heads/master
2020-05-17T05:37:21.762348
2015-01-08T02:16:08
2015-01-08T02:16:08
28,762,156
3
1
null
null
null
null
UTF-8
Java
false
false
759
java
/* * com.tnsoft.util.logging.MessageFormatter.java 1.00 2011-7-22 * CREATE M.J.Fung * MODULE ID logging * * Copyright (c) 2011 Transoft, Inc. * All rights resvered. * * This software is the confidential and proprietary information of * Transoft, Inc. ("confidential Information"). You shall not disclose * such Confidential Information and shall use it only in accordance * with the terms of the license agreement you entered into with Transoft. * * Alteration Records: * Create file at: 2011-7-22 下午03:51:16 * */ package com.tnsoft.util.logging; /** * <p> * Provide methods to format message string. * </p> * * @author M.J.Fung * */ public interface MessageFormatter { String format(String message, Object... args); }
aa296afcaad618c0f7cdfef2885761098db72736
8a9b2671cd5fb43cf3bd786b7fc26ec71b3b5eab
/back-end/datax-plugin/datax-plugins-common/src/main/java/org/example/plugins/common/exceptions/PluginError.java
d0e67c03a1cbdf0f5b57635c2c00f709c77f2a4a
[]
no_license
Zxj19951031/data-flow
771ecc682bfe12abea5444af653712488d45d178
4cba9785fb4f2258f6c13a348a0206a8b25802e7
refs/heads/main
2023-06-06T05:34:44.226876
2021-06-23T11:57:41
2021-06-23T11:57:41
323,791,514
0
0
null
null
null
null
UTF-8
Java
false
false
793
java
package org.example.plugins.common.exceptions; public enum PluginError implements IErrorCode { TASK_INIT_ERROR(3001, "初始化异常"), TASK_UNSUPPORTED_TYPE(3002, "字段类型不支持"), TASK_READ_ERROR(3004, "读取异常"), GET_COLUMN_INFO_FAILED(3005, "获取列表元数据失败"), TASK_WRITE_ERROR(3006, "写入异常"); private final int code; private final String msg; PluginError(Integer code, String msg) { this.code = code; this.msg = msg; } @Override public int getCode() { return this.code; } @Override public String getMsg() { return this.msg; } @Override public String toString() { return String.format("Code=[%s],Message=[%s]", this.code, this.msg); } }
6ac8c71e105c2669dac4cd8b9878bc09788f1b2f
87a48e60eec6b4a8ab15298de1557e7db4ed1c0e
/src/view/PanelFournisseur.java
8ffb911aadd4639015b7105752be2c9f92b2b292
[]
no_license
raed-logong/GestionAchatsVentes-Java-Swing
f2bf4c08b0c63b72237eecaad782c0ec708f2716
76a5958389a99f6639d22c51c702772329345feb
refs/heads/master
2023-05-09T19:34:32.527709
2021-06-02T16:55:27
2021-06-02T16:55:27
373,108,923
1
0
null
null
null
null
UTF-8
Java
false
false
8,644
java
package view; import controller.FournisseurService; import models.Client; import view.components.MyTable; import javax.swing.*; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import javax.swing.table.DefaultTableModel; import javax.swing.table.TableModel; import javax.swing.table.TableRowSorter; import java.awt.*; import java.awt.event.*; import java.util.ArrayList; public class PanelFournisseur extends JPanel { private final JTable table; private final TableRowSorter<TableModel> rowSorter; JFrame frame; JButton btnModifier; JButton btnSupprimer; public PanelFournisseur(MainWindow frame) { this.frame = frame; setLayout(new BorderLayout()); this.setSize(1175, 585); JScrollPane scrollPane = new JScrollPane(); //scrollPane.setBounds(10, 104, 1155, 471); scrollPane.setBackground(Color.WHITE); add(scrollPane, BorderLayout.CENTER); table = new MyTable(); Dimension dimension = new Dimension(100, 50); table.getTableHeader().setMinimumSize(dimension); table.setModel(new DefaultTableModel( new Object[][]{ }, new String[]{ "Code", "Matricule", "Raison", "Type", "NumRue", "Libelle", "Ville", "CodePostal", "Gouvernourat", "Pays", "fax", "NumFix", "NumPortable", "Email", "SiteWeb", "Etat" } ) { @Override public boolean isCellEditable(int row, int column) { return false; } }); rowSorter = new TableRowSorter<>(table.getModel()); table.setRowSorter(rowSorter); table.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS); table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); table.getTableHeader().setMinimumSize(new Dimension(100, 100)); //table.getTableHeader().setFont(new Font(Font.SERIF,Font.BOLD,18)); table.getTableHeader().setFont(new Font("Segoe UI", Font.BOLD, 20)); table.getTableHeader().setOpaque(false); table.getTableHeader().setBackground(new Color(32, 136, 203)); table.getTableHeader().setForeground(new Color(255, 255, 255)); table.setSelectionBackground(new java.awt.Color(232, 57, 124)); table.setRowHeight(30); table.setFont(new Font("Tahoma", Font.PLAIN, 17)); scrollPane.setViewportView(table); JPanel panel = new JPanel(); add(panel, BorderLayout.NORTH); panel.setLayout(new BorderLayout(0, 0)); JLabel lblNewLabel = new JLabel("Listes Des Fournisseur"); lblNewLabel.setHorizontalAlignment(SwingConstants.LEFT); lblNewLabel.setIcon(new ImageIcon(PanelClient.class.getResource("/resource/icons8-liste-64.png"))); lblNewLabel.setForeground(Color.BLUE); lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 23)); panel.add(lblNewLabel, BorderLayout.NORTH); JPanel panel_1 = new JPanel(); panel.add(panel_1, BorderLayout.WEST); panel_1.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5)); JLabel lblNewLabel_1 = new JLabel("Recherche"); lblNewLabel_1.setIcon(new ImageIcon(PanelClient.class.getResource("/resource/icons8-rechercher-plus-35.png"))); lblNewLabel_1.setForeground(Color.BLUE); lblNewLabel_1.setHorizontalTextPosition(SwingConstants.LEFT); lblNewLabel_1.setFont(new Font("Tahoma", Font.PLAIN, 17)); panel_1.add(lblNewLabel_1); JEditorPane filtre = new JEditorPane(); filtre.setSize(200, 100); filtre.setToolTipText("recherche"); filtre.setFont(new Font("Arial", Font.BOLD, 19)); panel_1.add(filtre); JPanel panel_2 = new JPanel(); panel.add(panel_2, BorderLayout.EAST); panel_2.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5)); JButton btnAjouter = new JButton("Ajouter"); btnAjouter.setIcon(new ImageIcon(PanelClient.class.getResource("/resource/icons8-ajouter-16.png"))); btnAjouter.setToolTipText("Ajouter un fournisseur"); btnAjouter.setHorizontalAlignment(SwingConstants.LEFT); panel_2.add(btnAjouter); btnModifier = new JButton("Modifier"); btnModifier.setIcon(new ImageIcon(PanelClient.class.getResource("/resource/icons8-modifier-16.png"))); btnModifier.setToolTipText("Modifier le fournisseur selectionné"); btnModifier.setEnabled(false); panel_2.add(btnModifier); btnSupprimer = new JButton("Supprimer"); btnSupprimer.setIcon(new ImageIcon(PanelClient.class.getResource("/resource/icons8-supprimer-16.png"))); btnSupprimer.setToolTipText("Supprimer le fournisseur selectionner\r\n"); btnSupprimer.setEnabled(false); panel_2.add(btnSupprimer); updatedata(); filtre.getDocument().addDocumentListener(new DocumentListener() { @Override public void insertUpdate(DocumentEvent e) { String text = filtre.getText(); table.clearSelection(); btnModifier.setEnabled(false); btnSupprimer.setEnabled(false); if (text.trim().length() == 0) { rowSorter.setRowFilter(null); } else { rowSorter.setRowFilter(RowFilter.regexFilter("(?i)" + text)); } } @Override public void removeUpdate(DocumentEvent e) { String text = filtre.getText(); if (text.trim().length() == 0) { rowSorter.setRowFilter(null); } else { rowSorter.setRowFilter(RowFilter.regexFilter("(?i)" + text)); } } @Override public void changedUpdate(DocumentEvent e) { throw new UnsupportedOperationException("Not supported yet."); } }); table.addMouseListener(new MouseAdapter() { @Override public void mousePressed(MouseEvent e) { if (table.getSelectedRowCount() > 0) { btnSupprimer.setEnabled(true); btnModifier.setEnabled(true); } } }); table.addKeyListener(new KeyListener() { @Override public void keyTyped(KeyEvent e) { } @Override public void keyPressed(KeyEvent e) { int keyCode = e.getKeyCode(); if (keyCode == KeyEvent.VK_ESCAPE) { table.clearSelection(); btnModifier.setEnabled(false); btnSupprimer.setEnabled(false); } } @Override public void keyReleased(KeyEvent e) { } }); btnAjouter.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { AjouterFournisseur ac = new AjouterFournisseur(PanelFournisseur.this); ac.getParent().setEnabled(false); ac.setVisible(true); } }); btnSupprimer.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { FournisseurService fournisseurService = new FournisseurService(); if (!(table.getSelectionModel().isSelectionEmpty())) { int dialogResult = JOptionPane.showConfirmDialog(PanelFournisseur.this, "Voulez vous supprimer ce" + "Fournisseur", "Confirmation", JOptionPane.YES_NO_OPTION); if (dialogResult == JOptionPane.YES_OPTION) { int[] rows = table.getSelectedRows(); for (int i = 0; i < rows.length; i++) { String code = (String) table.getValueAt(rows[i], 0); fournisseurService.delete(code); } updatedata(); } } if (table.getRowCount() == 0) { btnModifier.setEnabled(false); btnSupprimer.setEnabled(false); } } }); btnModifier.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (!(table.getSelectionModel().isSelectionEmpty())) { FournisseurService fournisseurService = new FournisseurService(); int row = table.getSelectedRow(); String code = (String) table.getValueAt(row, 0); Client fournisseur = fournisseurService.get(code); ModifierFournisseur ac = new ModifierFournisseur(PanelFournisseur.this, fournisseur, row); ac.getParent().setEnabled(false); ac.setVisible(true); } } }); } public JTable getTable() { return table; } /** * Create the panel. */ public void updatedata() { while (table.getRowSorter().getModelRowCount() > 0) { ((DefaultTableModel) table.getModel()).removeRow(0); } FournisseurService fournisseurservice = new FournisseurService(); ArrayList<Client> list = fournisseurservice.getAll(); for (int i = 0; i < list.size(); i++) { Client fournisseur = list.get(i); try { Object[] data = {fournisseur.getCode(), fournisseur.getMatricule(), fournisseur.getRaison(), fournisseur.getType(), fournisseur.getAddress().getNumeroRue(), fournisseur.getAddress().getLibelle(), fournisseur.getAddress().getVille(), fournisseur.getAddress().getCodePostal(), fournisseur.getAddress().getGouvernourat(), fournisseur.getAddress().getPays(), fournisseur.getFax(), fournisseur.getNumFix(), fournisseur.getNumPortable(), fournisseur.getEmail(), fournisseur.getSiteWeb(), fournisseur.getEtat().toString()}; ((DefaultTableModel) table.getModel()).addRow(data); } catch (Exception E) { System.out.println(E.getMessage()); } } } }
0270068938871f29356265cfa44d1731bd69f38e
d89c86fdc28b68d14dc90f0365a6f12c5ca2cd06
/by/java_online/additional_task/cycle/task20/Task20.java
aceb9332e891828fa385ffe65153fe9833635a30
[]
no_license
Sviatlana-Zenko/module01_additional_tasks
ff1dc4403d3a0eda440a35826201693f7ebbc2f3
8766b11d9235eede1d54943ef84b0a28091b6659
refs/heads/master
2021-05-25T15:49:46.232299
2020-05-13T15:29:06
2020-05-13T15:29:06
253,814,923
0
0
null
null
null
null
UTF-8
Java
false
false
913
java
/* * Найдите все четырехзначные числа, сумма цифр * которых равна 15. */ package by.java_online.additional_task.cycle.task20; public class Task20 { public static void main(String[] args) { int n1; int n2; int sum; n1 = 1000; n2 = 9999; System.out.println("There are four-digit numbers in which the sum of " + "digits is equal to 15:"); while (n1 <= n2) { sum = calculateSum(n1); if (sum == 15) { System.out.print(n1 + "; "); } n1++; } } public static int calculateSum(int number) { int sum = 0; while (number > 0) { sum = sum + (number % 10); number /= 10; } return sum; } }
245172638d81b70b66cbd55bb5611cbdfbe2e4eb
8211f5b8c2140a58adbfdb6b93557a6e8c550783
/IdeaProjects/Week12. 20161114/src/CDLExample.java
d685a55a044a7f471b22d4ccd3de9cbf8afd258d
[]
no_license
SeoHyunAhn/Purdue-JavaO-O
a8fec82b3639759e85732e447a600db22e2635a8
60d0ed74c22bc67919b3f560e0784dbf33fdcd8a
refs/heads/master
2021-01-20T03:46:45.021694
2017-04-17T00:29:54
2017-04-17T00:29:54
83,833,674
0
0
null
2017-03-03T19:32:21
2017-03-03T19:27:59
null
UTF-8
Java
false
false
742
java
/** * Example for CS18000-F16 Homework 10 to show use of CountDownLatch. * * @author Neil Allison * @version November 12, 2016 */ public class CDLExample extends Thread { private char letter; public CDLExample(char letter) { this.letter = letter; } @Override public void run() { for (int i = 0; i < 5; i++) { System.out.println(letter); try { Thread.sleep(500); } catch (InterruptedException e) { System.err.printf("Sleeping Failed: %s%n", e.getMessage()); } } System.out.printf("%c thread finished%n", letter); CDLExampleExecutor.decrementCountDownLatch(); } }
4b084779f910ae313b7b7409a46f935d96b537a5
80848a00331b78d180386b2fce0b2993fa45e575
/app/src/main/java/com/bouilli/nxx/bouillihotel/push/org/jivesoftware/smackx/pubsub/PubSubElementType.java
49ad3772d48b2b5c36ca640791376e067691b2bb
[]
no_license
nx6313/BouilliHotel
4f68fc3f33a36d68e07cefd1d9628f110533db33
09407054930a1e95b195f1542be614cf9b22fef8
refs/heads/master
2020-07-16T07:33:36.837913
2017-11-03T09:39:40
2017-11-03T09:39:40
73,950,097
0
0
null
null
null
null
UTF-8
Java
false
false
2,640
java
/** * 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.bouilli.nxx.bouillihotel.push.org.jivesoftware.smackx.pubsub; import com.bouilli.nxx.bouillihotel.push.org.jivesoftware.smackx.pubsub.packet.PubSubNamespace; /** * Defines all the possible element types as defined for all the pubsub * schemas in all 3 namespaces. * * @author Robin Collier */ public enum PubSubElementType { CREATE("create", PubSubNamespace.BASIC), DELETE("delete", PubSubNamespace.OWNER), DELETE_EVENT("delete", PubSubNamespace.EVENT), CONFIGURE("configure", PubSubNamespace.BASIC), CONFIGURE_OWNER("configure", PubSubNamespace.OWNER), CONFIGURATION("configuration", PubSubNamespace.EVENT), OPTIONS("options", PubSubNamespace.BASIC), DEFAULT("default", PubSubNamespace.OWNER), ITEMS("items", PubSubNamespace.BASIC), ITEMS_EVENT("items", PubSubNamespace.EVENT), ITEM("item", PubSubNamespace.BASIC), ITEM_EVENT("item", PubSubNamespace.EVENT), PUBLISH("publish", PubSubNamespace.BASIC), PUBLISH_OPTIONS("publish-options", PubSubNamespace.BASIC), PURGE_OWNER("purge", PubSubNamespace.OWNER), PURGE_EVENT("purge", PubSubNamespace.EVENT), RETRACT("retract", PubSubNamespace.BASIC), AFFILIATIONS("affiliations", PubSubNamespace.BASIC), SUBSCRIBE("subscribe", PubSubNamespace.BASIC), SUBSCRIPTION("subscription", PubSubNamespace.BASIC), SUBSCRIPTIONS("subscriptions", PubSubNamespace.BASIC), UNSUBSCRIBE("unsubscribe", PubSubNamespace.BASIC); private String eName; private PubSubNamespace nSpace; private PubSubElementType(String elemName, PubSubNamespace ns) { eName = elemName; nSpace = ns; } public PubSubNamespace getNamespace() { return nSpace; } public String getElementName() { return eName; } public static PubSubElementType valueOfFromElemName(String elemName, String namespace) { int index = namespace.lastIndexOf('#'); String fragment = (index == -1 ? null : namespace.substring(index+1)); if (fragment != null) { return valueOf((elemName + '_' + fragment).toUpperCase()); } return valueOf(elemName.toUpperCase().replace('-', '_')); } }
e5ac55fd74dc33e122be10b10a2e67bee47cf0e8
ed370f48661c0b37c4f05b577b943cb87e4c9291
/PrimeOrNot.java
c0c30baac862b0342a0c409c4ed5326dea7805cb
[]
no_license
AsmitaSethiya/java_practice_questions
b78dc94810e1abf952aa72d7e97ce028d35e9834
f627ee69c81417eed03e0a1f608b7aa54dd25b11
refs/heads/main
2023-06-16T10:00:17.959440
2021-07-07T17:14:36
2021-07-07T17:14:36
381,376,496
0
0
null
null
null
null
UTF-8
Java
false
false
396
java
import java.util.Scanner; class PrimeOrNot { public static void main(String[] args) { int i; Scanner in = new Scanner(System.in); System.out.println("Enter a number: "); int n = in.nextInt(); for(i = 2; i < n; i++) { if(n % i == 0) { System.out.println("Non Prime Number"); break; } } if(n == i) { System.out.println("Prime Number"); } } }
2b83474ab6df3552124af33b553f29b5135b53cc
1590fa8ce4d083041c90e1cb10067ad299c46404
/Client/Lazyboard/app/src/main/java/com/ofaucoz/lazyboard/LazyboardService.java
5b316f8bdbd06b1bec1857ada6dd1a7c587dd420
[]
no_license
ofaucoz/lazyboard
906bfec56ae822e0616a4f94a753141b822652ae
b55a02e22154ba108609a20705af26e394913ff9
refs/heads/master
2021-01-21T05:10:03.102469
2017-10-12T21:01:53
2017-10-12T21:01:53
101,916,690
0
0
null
2017-10-12T21:01:54
2017-08-30T18:39:30
Java
UTF-8
Java
false
false
9,071
java
package com.ofaucoz.lazyboard; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothSocket; import android.content.Context; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.util.Log; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.UUID; public class LazyboardService { // Debugging private static final String TAG = "LazyboardService"; private static final UUID MY_UUID_SECURE = UUID.fromString("0511a889-e39e-475b-8789-b61f74fd92d5"); // Member fields private final BluetoothAdapter mAdapter; private final Handler mHandler; private ConnectThread mConnectThread; private ConnectedThread mConnectedThread; private int mState; private int mNewState; // Constants that indicate the current connection state public static final int STATE_NONE = 0; // we're doing nothing public static final int STATE_LISTEN = 1; // now listening for incoming connections public static final int STATE_CONNECTING = 2; // now initiating an outgoing connection public static final int STATE_CONNECTED = 3; // now connected to a remote device public LazyboardService(Context context, Handler handler) { mAdapter = BluetoothAdapter.getDefaultAdapter(); mState = STATE_NONE; mNewState = mState; mHandler = handler; } private synchronized void updateUserInterfaceTitle() { mState = getState(); mNewState = mState; // Give the new state to the Handler so the UI Activity can update mHandler.obtainMessage(Constants.MESSAGE_STATE_CHANGE, mNewState, -1).sendToTarget(); } /** * Return the current connection state. */ public synchronized int getState() { return mState; } public synchronized void connect(BluetoothDevice device, boolean secure) { // Cancel any thread attempting to make a connection if (mState == STATE_CONNECTING) { if (mConnectThread != null) { mConnectThread.cancel(); mConnectThread = null; } } // Cancel any thread currently running a connection if (mConnectedThread != null) { mConnectedThread.cancel(); mConnectedThread = null; } // Start the thread to connect with the given device mConnectThread = new ConnectThread(device, secure); mConnectThread.start(); // Update UI title updateUserInterfaceTitle(); } public synchronized void connected(BluetoothSocket socket, BluetoothDevice device, final String socketType) { // Cancel the thread that completed the connection if (mConnectThread != null) { mConnectThread.cancel(); mConnectThread = null; } // Cancel any thread currently running a connection if (mConnectedThread != null) { mConnectedThread.cancel(); mConnectedThread = null; } // Start the thread to manage the connection and perform transmissions mConnectedThread = new ConnectedThread(socket, socketType); mConnectedThread.start(); // Send the name of the connected device back to the UI Activity Message msg = mHandler.obtainMessage(Constants.MESSAGE_DEVICE_NAME); Bundle bundle = new Bundle(); bundle.putString(Constants.DEVICE_NAME, device.getName()); msg.setData(bundle); mHandler.sendMessage(msg); // Update UI title updateUserInterfaceTitle(); } public synchronized void stop() { if (mConnectThread != null) { mConnectThread.cancel(); mConnectThread = null; } if (mConnectedThread != null) { mConnectedThread.cancel(); mConnectedThread = null; } mState = STATE_NONE; // Update UI title updateUserInterfaceTitle(); } public void write(int out) { // Create temporary object Log.d("lazyboard_service", "state 1 = " + this.getState()); ConnectedThread r; // Synchronize a copy of the ConnectedThread synchronized (this) { if (mState != STATE_CONNECTED) return; r = mConnectedThread; } // Perform the write unsynchronized r.write(out); } private void connectionFailed() { // Send a failure message back to the Activity Message msg = mHandler.obtainMessage(Constants.MESSAGE_TOAST); Bundle bundle = new Bundle(); bundle.putString(Constants.TOAST, "Unable to connect device"); msg.setData(bundle); mHandler.sendMessage(msg); mState = STATE_NONE; // Update UI title updateUserInterfaceTitle(); // Do something } private class ConnectThread extends Thread { private final BluetoothSocket mmSocket; private final BluetoothDevice mmDevice; private String mSocketType; public ConnectThread(BluetoothDevice device, boolean secure) { mmDevice = device; BluetoothSocket tmp = null; mSocketType = secure ? "Secure" : "Insecure"; // Get a BluetoothSocket for a connection with the // given BluetoothDevice try { if (secure) { tmp = device.createRfcommSocketToServiceRecord( MY_UUID_SECURE); } else { } } catch (IOException e) { } mmSocket = tmp; mState = STATE_CONNECTING; } public void run() { setName("ConnectThread" + mSocketType); // Always cancel discovery because it will slow down a connection mAdapter.cancelDiscovery(); // Make a connection to the BluetoothSocket try { // This is a blocking call and will only return on a // successful connection or an exception mmSocket.connect(); } catch (IOException e) { // Close the socket try { mmSocket.close(); } catch (IOException e2) { } connectionFailed(); return; } // Reset the ConnectThread because we're done synchronized (LazyboardService.this) { mConnectThread = null; } // Start the connected thread connected(mmSocket, mmDevice, mSocketType); } public void cancel() { try { mmSocket.close(); } catch (IOException e) { } } } /** * This thread runs during a connection with a remote device. * It handles all incoming and outgoing transmissions. */ private class ConnectedThread extends Thread { private final BluetoothSocket mmSocket; private final InputStream mmInStream; private final OutputStream mmOutStream; public ConnectedThread(BluetoothSocket socket, String socketType) { mmSocket = socket; InputStream tmpIn = null; OutputStream tmpOut = null; // Get the BluetoothSocket input and output streams try { tmpIn = socket.getInputStream(); tmpOut = socket.getOutputStream(); } catch (IOException e) { } mmInStream = tmpIn; mmOutStream = tmpOut; mState = STATE_CONNECTED; } public void run() { byte[] buffer = new byte[1024]; int bytes; // Keep listening to the InputStream while connected while (mState == STATE_CONNECTED) { try { // Read from the InputStream bytes = mmInStream.read(buffer); // Send the obtained bytes to the UI Activity mHandler.obtainMessage(Constants.MESSAGE_READ, bytes, -1, buffer) .sendToTarget(); } catch (IOException e) { break; } } } /** * Write to the connected OutStream. * * @param buffer The bytes to write */ public void write(int buffer) { try { mmOutStream.write(buffer); // Share the sent message back to the UI Activity mHandler.obtainMessage(Constants.MESSAGE_WRITE, -1, -1, buffer) .sendToTarget(); } catch (IOException e) { } } public void cancel() { try { mmSocket.close(); } catch (IOException e) { } } } }
c9e7fb93b075ae694d464ddddac689e78b81ad2f
ede53c4500da6c94afb033fdf4491d5fec26a5bb
/banco-logic/src/main/java/co/edu/usb/cali/banco/dto/TipoTransaccionDTO.java
001a6199d1488cb4126eee5b882b846cfbec9f56
[]
no_license
mattlenius/configuraciongestion
f71f55a7c327407dc69462213c12c7176f561c61
9963458a99d59b93728b53261eca62e70be1d22d
refs/heads/master
2022-10-02T03:56:39.897287
2019-06-14T00:58:06
2019-06-14T00:58:06
191,852,803
0
0
null
2022-09-08T01:00:53
2019-06-14T00:55:14
Java
UTF-8
Java
false
false
1,062
java
package co.edu.usb.cali.banco.dto; import java.io.Serializable; import java.util.List; import javax.persistence.Column; import javax.persistence.Id; import javax.persistence.OneToMany; import co.edu.usb.cali.banco.domain.Transaccion; public class TipoTransaccionDTO { private static final long serialVersionUID = 1L; private Long titrId; private String activo; private String nombre; public TipoTransaccionDTO() { super(); } public TipoTransaccionDTO(Long titrId, String activo, String nombre) { super(); this.titrId = titrId; this.activo = activo; this.nombre = nombre; } public Long getTitrId() { return titrId; } public void setTitrId(Long titrId) { this.titrId = titrId; } public String getActivo() { return activo; } public void setActivo(String activo) { this.activo = activo; } public String getNombre() { return nombre; } public void setNombre(String nombre) { this.nombre = nombre; } public static long getSerialversionuid() { return serialVersionUID; } }
f90abcb98315aa796fe6ab352a18919d0fe0af79
fcc94af06e6ae2cfb2110a60a94b63f0d236beee
/programming/thursday-w34/exercise02/src/App.java
c8a15740a53432b7ac9e2b91af95787b0ecc08ef
[]
no_license
darth-raijin/kea-data21v2
cbe9f97497d752566d46461e51773120728e0e6f
fdea39d92f781fa0b962b5368de88397ba04b8af
refs/heads/master
2023-08-21T16:37:23.789862
2021-09-23T18:16:20
2021-09-23T18:16:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
451
java
public class App { public static void main(String[] args) throws Exception { Library localLibrary = new Library(); localLibrary.addBook(new Book("9780140439199", "The Art of War", "6th century BC")); localLibrary.addBook(new Book("9780023042706", "The Prince", "1513")); localLibrary.addBook(new Book("9788702188684", "Mimbo Jimbo finder en ven", "2041")); localLibrary.findBook("9780023042706"); } }
c6d9c5ca8fa5d47f06ab8c3dfc222e1c23428b9c
18b03c67ef57ce75341dee76219b22bf2618c843
/firstGUI.java
7cb7754fafc2f3ca1eefa7053eb3f62df1c30329
[]
no_license
bicepsFlex/calculatorGUI
f86e86578da7d5765fd5945ced9613c59b62d4cb
0d26c9076d730f9fb3ad505818dd435dd33a9d7b
refs/heads/master
2023-08-05T09:01:21.289354
2021-09-18T16:26:49
2021-09-18T16:26:49
407,908,690
0
0
null
null
null
null
UTF-8
Java
false
false
9,651
java
import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Font; import java.awt.Insets; import javax.swing.BorderFactory; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JSplitPane; import javax.swing.JTextArea; import javax.swing.SwingUtilities; import javax.swing.UIManager; public class firstGUI { int number = 0; Long totalNumber = 0L; String currCalculation = ""; String calculations = ""; enum Operation { NULL, PLUS, MINUS, MULT, DIV } // 0 = null, 1 = plus, 2 = minus, 3 = mult, 4 Operation prevOp = Operation.NULL; public static void main(String[] args) { try { UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel"); } catch (Exception e) { e.printStackTrace(); } SwingUtilities.invokeLater(() -> new firstGUI()); } public firstGUI() { JButton s1080p = new JButton("1920x1080"); JButton s720p = new JButton("1280x720"); JButton s360p = new JButton("640x360"); JButton resetSize = new JButton("Reset Size"); s1080p.setFont(new Font("", 0, 20)); s720p.setFont(new Font("", 0, 20)); s360p.setFont(new Font("", 0, 20)); resetSize.setFont(new Font("", 0, 20)); JPanel controlPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); controlPanel.add(s1080p); controlPanel.add(s720p); controlPanel.add(s360p); controlPanel.add(resetSize); JTextArea someText = new JTextArea(); someText.setLineWrap(true); someText.setWrapStyleWord(true); someText.setBackground(Color.LIGHT_GRAY); someText.setMargin(new Insets(5, 5, 5, 5)); someText.setEditable(false); someText.setFont(new Font("", 0, 30)); JTextArea calculationsHistory = new JTextArea(); calculationsHistory.setLineWrap(true); calculationsHistory.setWrapStyleWord(true); calculationsHistory.setMargin(new Insets(5, 5, 5, 5)); calculationsHistory.setEditable(false); JPanel someTextPanel = new JPanel(new BorderLayout()); someTextPanel.add(someText, BorderLayout.WEST); someTextPanel.add(calculationsHistory, BorderLayout.EAST); someTextPanel.add(new JScrollPane(calculationsHistory), BorderLayout.CENTER); Font btFont = new Font("", 0, 20); JButton one = new JButton("1"); one.setFont(btFont); JButton two = new JButton("2"); two.setFont(btFont); JButton three = new JButton("3"); three.setFont(btFont); JButton four = new JButton("4"); four.setFont(btFont); JButton five = new JButton("5"); five.setFont(btFont); JButton six = new JButton("6"); six.setFont(btFont); JButton seven = new JButton("7"); seven.setFont(btFont); JButton eight = new JButton("8"); eight.setFont(btFont); JButton nine = new JButton("9"); nine.setFont(btFont); JButton zero = new JButton("0"); zero.setFont(btFont); JButton plus = new JButton("+"); JButton minus = new JButton("-"); JButton mult = new JButton("*"); JButton div = new JButton("/"); JButton eq = new JButton("="); JPanel buttonsPanel = new JPanel(new FlowLayout(FlowLayout.CENTER)); buttonsPanel.add(one); buttonsPanel.add(two); buttonsPanel.add(three); buttonsPanel.add(four); buttonsPanel.add(five); buttonsPanel.add(six); buttonsPanel.add(seven); buttonsPanel.add(eight); buttonsPanel.add(nine); buttonsPanel.add(zero); buttonsPanel.add(plus); buttonsPanel.add(minus); buttonsPanel.add(mult); buttonsPanel.add(div); buttonsPanel.add(eq); JSplitPane calcPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, someTextPanel, buttonsPanel); calcPanel.setBorder(BorderFactory.createLineBorder(Color.BLACK)); one.addActionListener((e) -> { num(1, someText); }); two.addActionListener((e) -> { num(2, someText); }); three.addActionListener((e) -> { num(3, someText); }); four.addActionListener((e) -> { num(4, someText); }); five.addActionListener((e) -> { num(5, someText); }); six.addActionListener((e) -> { num(6, someText); }); seven.addActionListener((e) -> { num(7, someText); }); eight.addActionListener((e) -> { num(8, someText); }); nine.addActionListener((e) -> { num(9, someText); }); zero.addActionListener((e) -> { num(0, someText); }); plus.addActionListener((e) -> { plus(); currCalculation += "+"; }); minus.addActionListener((e) -> { minus(); currCalculation += "-"; }); mult.addActionListener((e) -> { mult(); currCalculation += "*"; }); div.addActionListener((e) -> { div(); currCalculation += "/"; }); eq.addActionListener((e) -> { switch (prevOp) { case PLUS: plus(); break; case MINUS: minus(); break; case MULT: mult(); break; case DIV: div(); break; default: break; } currCalculation += "="; someText.setText(String.valueOf(totalNumber)); currCalculation += String.valueOf(totalNumber); calculations = currCalculation + "\n" + calculations; calculationsHistory.setText(calculations); reset(); }); JPanel mainPanel = new JPanel(new BorderLayout()); mainPanel.add(controlPanel, BorderLayout.NORTH); mainPanel.add(calcPanel); JFrame frame = new JFrame(); frame.setTitle("First Program"); frame.setSize(new Dimension(400, 500)); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLocationRelativeTo(null); frame.setVisible(true); frame.add(mainPanel, BorderLayout.CENTER); s1080p.addActionListener((e) -> { frame.setSize(new Dimension(1920, 1080)); frame.setLocationRelativeTo(null); }); s720p.addActionListener((e) -> { frame.setSize(new Dimension(1280, 720)); frame.setLocationRelativeTo(null); }); s360p.addActionListener((e) -> { frame.setSize(new Dimension(640, 360)); frame.setLocationRelativeTo(null); }); resetSize.addActionListener((e) -> { frame.setSize(new Dimension(400, 500)); frame.setLocationRelativeTo(null); }); } public void num(int num, JTextArea text) { if (String.valueOf(number).length() + String.valueOf(num).length() < 9) { currCalculation += String.valueOf(num); int prevNum = number; number = Integer.valueOf(String.valueOf(prevNum) + String.valueOf(num)); text.setText(String.valueOf(number)); } } public void plus() { switch (prevOp) { case MINUS: totalNumber -= number; break; case DIV: totalNumber /= number; break; case MULT: totalNumber *= number; break; default: totalNumber += number; break; } prevOp = Operation.PLUS; number = 0; } public void minus() { switch (prevOp) { case NULL, PLUS: totalNumber += number; break; case DIV: totalNumber /= number; break; case MULT: totalNumber *= number; break; default: totalNumber -= number; break; } prevOp = Operation.MINUS; number = 0; } public void mult() { switch (prevOp) { case NULL, PLUS: totalNumber += number; break; case MINUS: totalNumber -= number; break; case DIV: totalNumber /= number; break; default: totalNumber *= number; break; } prevOp = Operation.MULT; number = 0; } public void div() { switch (prevOp) { case NULL, PLUS: totalNumber += number; break; case MINUS: totalNumber -= number; break; case MULT: totalNumber *= number; break; default: totalNumber /= number; break; } prevOp = Operation.DIV; number = 0; } public void reset() { number = 0; totalNumber = 0L; prevOp = Operation.NULL; currCalculation = ""; } }
2d579f6a566a0e2bb48be0223789d4d1c4ae9f38
ba005c6729aed08554c70f284599360a5b3f1174
/lib/selenium-server-standalone-3.4.0/com/gargoylesoftware/htmlunit/javascript/SimpleScriptableProxy.java
ee867d37205a90c95feb2a89e00bb5dee8fdfe3d
[]
no_license
Viral-patel703/Testyourbond-aut0
f6727a6da3b1fbf69cc57aeb89e15635f09e249a
784ab7a3df33d0efbd41f3adadeda22844965a56
refs/heads/master
2020-08-09T00:27:26.261661
2017-11-07T10:12:05
2017-11-07T10:12:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,138
java
package com.gargoylesoftware.htmlunit.javascript; import java.io.Serializable; import net.sourceforge.htmlunit.corejs.javascript.Delegator; import net.sourceforge.htmlunit.corejs.javascript.Scriptable; public abstract class SimpleScriptableProxy<T extends SimpleScriptable> extends Delegator implements Serializable { public SimpleScriptableProxy() {} public abstract T getDelegee(); public Object get(int index, Scriptable start) { if ((start instanceof SimpleScriptableProxy)) { start = ((SimpleScriptableProxy)start).getDelegee(); } return getDelegee().get(index, start); } public Object get(String name, Scriptable start) { if ((start instanceof SimpleScriptableProxy)) { start = ((SimpleScriptableProxy)start).getDelegee(); } return getDelegee().get(name, start); } public boolean has(int index, Scriptable start) { if ((start instanceof SimpleScriptableProxy)) { start = ((SimpleScriptableProxy)start).getDelegee(); } return getDelegee().has(index, start); } public boolean has(String name, Scriptable start) { if ((start instanceof SimpleScriptableProxy)) { start = ((SimpleScriptableProxy)start).getDelegee(); } return getDelegee().has(name, start); } public boolean hasInstance(Scriptable instance) { if ((instance instanceof SimpleScriptableProxy)) { instance = ((SimpleScriptableProxy)instance).getDelegee(); } return getDelegee().hasInstance(instance); } public void put(int index, Scriptable start, Object value) { if ((start instanceof SimpleScriptableProxy)) { start = ((SimpleScriptableProxy)start).getDelegee(); } getDelegee().put(index, start, value); } public void put(String name, Scriptable start, Object value) { if ((start instanceof SimpleScriptableProxy)) { start = ((SimpleScriptableProxy)start).getDelegee(); } getDelegee().put(name, start, value); } public Object getDefaultValue(Class<?> hint) { return getDelegee().getDefaultValue(hint); } }
4c99fa82bda4fd0bbce9ed8e39d8dfd92114a2ef
ac073738adeb18821dbabf45f55d1a0e27c19882
/src/main/java/local/CafeChanged.java
df7291490f9976b4d0ef5fa3d4b5ecaddad96649
[]
no_license
rlatjdwo555/SKtarbucks-Cafe
850f7a46d4956467d8813de32253836b32d1786e
9f0d35e9cb1e1663876fb4defd052fcdcb6d5fb1
refs/heads/main
2023-06-26T23:03:52.685360
2021-07-26T05:18:13
2021-07-26T05:18:13
385,104,419
0
1
null
null
null
null
UTF-8
Java
false
false
731
java
package local; public class CafeChanged extends AbstractEvent { private Long id; private String cafeNm; private Long stock; private int price; public CafeChanged(){ super(); } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getCafeNm() { return cafeNm; } public void setCafeNm(String cafeNm) { this.cafeNm = cafeNm; } public void setStock(Long stock){ this.stock = stock; } public Long getStock(){ return stock; } public void setPrice(int price){ this.price = price; } public int getPrice(){ return price; } }
a302fc762f9803839e21942fb4effbe7bc3896e8
ad21d8179a77855c59c325196ace385b5cb15cf1
/Project3/try2/src/Project3.java
31e47aa3f354876ec591a49348e019dfb1071b7d
[]
no_license
prodimator/DanceThreads
65020d97375a7c4ba55290522bd429fd942fa1dc
13337b3f77b63fe889e24c083b67ee1163cf8134
refs/heads/master
2020-04-12T22:44:24.244621
2015-05-06T06:55:36
2015-05-06T06:55:36
34,625,117
0
0
null
null
null
null
UTF-8
Java
false
false
719
java
import java.util.*; import java.util.concurrent.*; public class Project3 { public static void main(String[] args) throws Exception{ Hashtable<String, String> danceCard = new Hashtable<String, String>(); danceCard.put("Waltz", ""); danceCard.put("Tango", ""); danceCard.put("Foxtrot", ""); danceCard.put("Quickstep", ""); danceCard.put("Rumba", ""); danceCard.put("Scamba", ""); danceCard.put("Cha Cha", ""); danceCard.put("Jive", ""); BlockingQueue queue = new LinkedBlockingQueue(); Leader leader1 = new Leader(queue, danceCard, "L" ); Follower follower1 = new Follower(queue, danceCard, "F"); follower1.run(); leader1.run(); } }
ae1fbc74f191a77bad6804fa2059f0076747d2d3
aa156ad1c988edd51db23429522943d268eb3289
/src/app/FXMain.java
f02664ced48c1eeca22cb072cc8bfb6b7342843f
[]
no_license
guiller1712/Sample
2e308515fd54fe57789926fe670eebd6a625c2ca
0a2fc91494a190879128a33e07d1ace782274724
refs/heads/master
2021-01-19T22:27:05.154282
2017-04-20T03:47:26
2017-04-20T03:47:26
88,818,295
0
0
null
null
null
null
UTF-8
Java
false
false
1,050
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 app; import java.io.IOException; import javafx.application.Application; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.layout.StackPane; import javafx.stage.Stage; /** * * @author guill */ public class FXMain extends Application { @Override public void start(Stage stage) throws IOException { Parent root = FXMLLoader.load(getClass().getResource("login/loginView.fxml")); Scene scene = new Scene(root); stage.setTitle("Sample Login"); stage.setScene(scene); stage.show(); } /** * @param args the command line arguments */ public static void main(String[] args) { launch(args); } }
97d12b48cf204df61973f5d4276c8f5edc27f9cb
1672cea99943ab4f934068bbb0e4bc87fcfb0936
/src/main/java/pl/allegro/promo/geecon2015/domain/user/User.java
f4b3b020fb875f280bb5b487f3f80a5f6a12f0d3
[]
no_license
GregZuber/geecon2015-challenge
c6cecadf38fe9e55414192a2095f84dd3552f245
b7d0a982399fc405279611e598b33fbdc46b7616
refs/heads/master
2021-01-17T06:37:53.671187
2015-05-14T09:18:19
2015-05-14T09:18:19
35,602,569
1
0
null
2015-05-14T09:20:57
2015-05-14T09:20:57
null
UTF-8
Java
false
false
540
java
package pl.allegro.promo.geecon2015.domain.user; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.UUID; public class User { private final UUID id; private final String name; @JsonCreator public User(@JsonProperty("id") UUID id, @JsonProperty("name") String name) { this.id = id; this.name = name; } public UUID getId() { return id; } public String getName() { return name; } }
9484a24d2bdda933eebc6b71c426c3541660a3b4
84fb0330cab09be61351dfd7797e4afc932a767c
/src/constant/Defines.java
ae38c94b8acbcc7488b2f791588bcded2724f242
[]
no_license
chauvuong/OrganicStore-1
c14da5286202a86b9ac552c74f0c64c989eb8dd3
c428ae738e7f4361a52185252ca13d1c9267efcb
refs/heads/master
2020-04-17T21:15:04.232513
2019-01-03T11:01:07
2019-01-03T11:01:07
166,941,333
1
0
null
2019-01-22T06:39:45
2019-01-22T06:39:45
null
UTF-8
Java
false
false
348
java
package constant; public class Defines { public static final String DIR_UPLOAD = "files"; public static final int ROW_COUNT = 5; public String SHOP_TEMPLATE_URL; public String getSHOP_TEMPLATE_URL() { return SHOP_TEMPLATE_URL; } public void setSHOP_TEMPLATE_URL(String sHOP_TEMPLATE_URL) { SHOP_TEMPLATE_URL = sHOP_TEMPLATE_URL; } }
0510546e5d08359aa7a2502ee0728257b4975760
220cc7e0ed6204d68e6a7fc11987e2a606739b4a
/exchange-domain/src/main/java/io/exchange/domain/enums/OrderType.java
990839a5a00fc95ec8a1d4759d428a429e261b66
[]
no_license
lhysin/ponybit
4503d0e5377e4346dc3b117440781680349af9b0
a5c60c5f12b0e0e3cb40ed878a4112c214371ec3
refs/heads/main
2023-04-05T16:32:53.913071
2021-04-09T07:05:42
2021-04-09T07:05:42
356,171,152
0
0
null
null
null
null
UTF-8
Java
false
false
75
java
package io.exchange.domain.enums; public enum OrderType { BUY, SELL }
c44c5091c338e0615a93daf1a5cc6020ba069ad8
c555e2a75e18a6a1186a161b3737171af35fa0ff
/vehicle/src/main/java/com/fastcampus/vehicle/eventstore/VehicleEventEntity.java
50368722a97a22d9ed4a113a6c7dc5288cc2c690
[ "Apache-2.0" ]
permissive
SeungpilPark/fastcampus-mobility
db9ad35ca2fa190694b6abfdad72a9323fe157a0
22372305ac3b56837b2e6058bd9505a8317b093f
refs/heads/main
2023-02-20T13:29:50.332398
2021-01-14T06:59:31
2021-01-14T06:59:31
328,278,853
0
0
null
null
null
null
UTF-8
Java
false
false
452
java
package com.fastcampus.vehicle.eventstore; import com.fastcampus.common.event.AbstractEventEntity; import javax.persistence.Entity; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; @Getter @Setter @NoArgsConstructor @Entity(name = "vehicle_event_store") @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = false) public class VehicleEventEntity extends AbstractEventEntity { }
4b189051c542404fe0b3dbfc9d9ebeb86711d20f
f6dfb92a53472bd6980dc3cd4bb44bb5c4e9437d
/apps/Gallery2/src/com/android/gallery3d/app/GalleryActivity.java
5149619e334a67333165e784e96943105c196f1a
[]
no_license
tuxafgmur/DhollmenK_packages
5d52da8ba58c60b7f4a0e92bf7b8818bba724d26
9a11d8225f07353ce3711f9e326b18e28c453fa5
refs/heads/master
2020-12-31T07:54:45.423581
2015-06-18T00:09:23
2015-06-18T00:09:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
11,447
java
/* * Copyright (C) 2009 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.gallery3d.app; import android.app.Dialog; import android.content.ContentResolver; import android.content.DialogInterface; import android.content.DialogInterface.OnCancelListener; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.view.InputDevice; import android.view.MotionEvent; import android.view.View; import android.view.Window; import android.view.WindowManager; import android.widget.Toast; import com.android.gallery3d.R; import com.android.gallery3d.common.Utils; import com.android.gallery3d.data.DataManager; import com.android.gallery3d.data.MediaItem; import com.android.gallery3d.data.MediaSet; import com.android.gallery3d.data.Path; import com.android.gallery3d.picasasource.PicasaSource; import com.android.gallery3d.util.GalleryUtils; public final class GalleryActivity extends AbstractGalleryActivity implements OnCancelListener { public static final String EXTRA_SLIDESHOW = "slideshow"; public static final String EXTRA_DREAM = "dream"; public static final String EXTRA_CROP = "crop"; public static final String ACTION_REVIEW = "com.android.camera.action.REVIEW"; public static final String KEY_GET_CONTENT = "get-content"; public static final String KEY_GET_ALBUM = "get-album"; public static final String KEY_TYPE_BITS = "type-bits"; public static final String KEY_MEDIA_TYPES = "mediaTypes"; public static final String KEY_DISMISS_KEYGUARD = "dismiss-keyguard"; private static final String TAG = "GalleryActivity"; private Dialog mVersionCheckDialog; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_ACTION_BAR); requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY); if (getIntent().getBooleanExtra(KEY_DISMISS_KEYGUARD, false)) { getWindow().addFlags( WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD); } setContentView(R.layout.main); if (savedInstanceState != null) { getStateManager().restoreFromState(savedInstanceState); } else { initializeByIntent(); } } private void initializeByIntent() { Intent intent = getIntent(); String action = intent.getAction(); if (Intent.ACTION_GET_CONTENT.equalsIgnoreCase(action)) { startGetContent(intent); } else if (Intent.ACTION_PICK.equalsIgnoreCase(action)) { // We do NOT really support the PICK intent. Handle it as // the GET_CONTENT. However, we need to translate the type // in the intent here. String type = Utils.ensureNotNull(intent.getType()); if (type.startsWith("vnd.android.cursor.dir/")) { if (type.endsWith("/image")) intent.setType("image/*"); if (type.endsWith("/video")) intent.setType("video/*"); } startGetContent(intent); } else if (Intent.ACTION_VIEW.equalsIgnoreCase(action) || ACTION_REVIEW.equalsIgnoreCase(action)){ startViewAction(intent); } else { startDefaultPage(); } } public void startDefaultPage() { PicasaSource.showSignInReminder(this); Bundle data = new Bundle(); data.putString(AlbumSetPage.KEY_MEDIA_PATH, getDataManager().getTopSetPath(DataManager.INCLUDE_ALL)); getStateManager().startState(AlbumSetPage.class, data); mVersionCheckDialog = PicasaSource.getVersionCheckDialog(this); if (mVersionCheckDialog != null) { mVersionCheckDialog.setOnCancelListener(this); } } private void startGetContent(Intent intent) { Bundle data = intent.getExtras() != null ? new Bundle(intent.getExtras()) : new Bundle(); data.putBoolean(KEY_GET_CONTENT, true); int typeBits = GalleryUtils.determineTypeBits(this, intent); data.putInt(KEY_TYPE_BITS, typeBits); data.putString(AlbumSetPage.KEY_MEDIA_PATH, getDataManager().getTopSetPath(typeBits)); getStateManager().startState(AlbumSetPage.class, data); } private String getContentType(Intent intent) { String type = intent.getType(); if (type != null) { return GalleryUtils.MIME_TYPE_PANORAMA360.equals(type) ? MediaItem.MIME_TYPE_JPEG : type; } Uri uri = intent.getData(); try { return getContentResolver().getType(uri); } catch (Throwable t) { Log.w(TAG, "get type fail", t); return null; } } private void startViewAction(Intent intent) { Boolean slideshow = intent.getBooleanExtra(EXTRA_SLIDESHOW, false); if (slideshow) { getActionBar().hide(); DataManager manager = getDataManager(); Path path = manager.findPathByUri(intent.getData(), intent.getType()); if (path == null || manager.getMediaObject(path) instanceof MediaItem) { path = Path.fromString( manager.getTopSetPath(DataManager.INCLUDE_IMAGE)); } Bundle data = new Bundle(); data.putString(SlideshowPage.KEY_SET_PATH, path.toString()); data.putBoolean(SlideshowPage.KEY_RANDOM_ORDER, true); data.putBoolean(SlideshowPage.KEY_REPEAT, true); if (intent.getBooleanExtra(EXTRA_DREAM, false)) { data.putBoolean(SlideshowPage.KEY_DREAM, true); } getStateManager().startState(SlideshowPage.class, data); } else { Bundle data = new Bundle(); DataManager dm = getDataManager(); Uri uri = intent.getData(); String contentType = getContentType(intent); if (contentType == null) { Toast.makeText(this, R.string.no_such_item, Toast.LENGTH_LONG).show(); finish(); return; } if (uri == null) { int typeBits = GalleryUtils.determineTypeBits(this, intent); data.putInt(KEY_TYPE_BITS, typeBits); data.putString(AlbumSetPage.KEY_MEDIA_PATH, getDataManager().getTopSetPath(typeBits)); getStateManager().startState(AlbumSetPage.class, data); } else if (contentType.startsWith( ContentResolver.CURSOR_DIR_BASE_TYPE)) { int mediaType = intent.getIntExtra(KEY_MEDIA_TYPES, 0); if (mediaType != 0) { uri = uri.buildUpon().appendQueryParameter( KEY_MEDIA_TYPES, String.valueOf(mediaType)) .build(); } Path setPath = dm.findPathByUri(uri, null); MediaSet mediaSet = null; if (setPath != null) { mediaSet = (MediaSet) dm.getMediaObject(setPath); } if (mediaSet != null) { if (mediaSet.isLeafAlbum()) { data.putString(AlbumPage.KEY_MEDIA_PATH, setPath.toString()); data.putString(AlbumPage.KEY_PARENT_MEDIA_PATH, dm.getTopSetPath(DataManager.INCLUDE_ALL)); getStateManager().startState(AlbumPage.class, data); } else { data.putString(AlbumSetPage.KEY_MEDIA_PATH, setPath.toString()); getStateManager().startState(AlbumSetPage.class, data); } } else { startDefaultPage(); } } else { Path itemPath = dm.findPathByUri(uri, contentType); Path albumPath = dm.getDefaultSetOf(itemPath); data.putString(PhotoPage.KEY_MEDIA_ITEM_PATH, itemPath.toString()); data.putBoolean(PhotoPage.KEY_READONLY, true); // TODO: Make the parameter "SingleItemOnly" public so other // activities can reference it. boolean singleItemOnly = (albumPath == null) || intent.getBooleanExtra("SingleItemOnly", false); if (!singleItemOnly) { data.putString(PhotoPage.KEY_MEDIA_SET_PATH, albumPath.toString()); // when FLAG_ACTIVITY_NEW_TASK is set, (e.g. when intent is fired // from notification), back button should behave the same as up button // rather than taking users back to the home screen if (intent.getBooleanExtra(PhotoPage.KEY_TREAT_BACK_AS_UP, false) || ((intent.getFlags() & Intent.FLAG_ACTIVITY_NEW_TASK) != 0)) { data.putBoolean(PhotoPage.KEY_TREAT_BACK_AS_UP, true); } } getStateManager().startState(SinglePhotoPage.class, data); } } } @Override protected void onResume() { Utils.assertTrue(getStateManager().getStateCount() > 0); super.onResume(); if (mVersionCheckDialog != null) { mVersionCheckDialog.show(); } } @Override protected void onPause() { super.onPause(); if (mVersionCheckDialog != null) { mVersionCheckDialog.dismiss(); } } @Override public void onCancel(DialogInterface dialog) { if (dialog == mVersionCheckDialog) { mVersionCheckDialog = null; } } @Override public boolean onGenericMotionEvent(MotionEvent event) { final boolean isTouchPad = (event.getSource() & InputDevice.SOURCE_CLASS_POSITION) != 0; if (isTouchPad) { float maxX = event.getDevice().getMotionRange(MotionEvent.AXIS_X).getMax(); float maxY = event.getDevice().getMotionRange(MotionEvent.AXIS_Y).getMax(); View decor = getWindow().getDecorView(); float scaleX = decor.getWidth() / maxX; float scaleY = decor.getHeight() / maxY; float x = event.getX() * scaleX; //x = decor.getWidth() - x; // invert x float y = event.getY() * scaleY; //y = decor.getHeight() - y; // invert y MotionEvent touchEvent = MotionEvent.obtain(event.getDownTime(), event.getEventTime(), event.getAction(), x, y, event.getMetaState()); return dispatchTouchEvent(touchEvent); } return super.onGenericMotionEvent(event); } }
dfa8413abbf775dbb6b107669ba5473d104497fa
d31f48b9d029b67778ef1b50fe7a692393d3f083
/java8/reflexao/ReflexaoExemplo.java
76c578a8a1b7651f91ddd3a04deb7052d73f4ed9
[]
no_license
gumota/Java8-Topicos-Avancados
35f33fcbb4bbdfa78d192afb67762e8b2f19761e
c4d308b415621ac916f57f81d843796d925ab894
refs/heads/master
2021-03-16T02:40:20.908252
2020-03-21T01:04:50
2020-03-21T01:04:50
246,896,998
0
0
null
null
null
null
ISO-8859-2
Java
false
false
599
java
package reflexao; import java.lang.reflect.Method; import java.lang.reflect.Parameter; public class ReflexaoExemplo { public static void main(String[] args) { // Instancia da classe produto Produto p = new Produto("Geladeira", 3000.00); // Instancia da classe class Class cl = p.getClass(); // Todos os métodos declarados na classe produto Method[] methods = cl.getDeclaredMethods(); for (Method m : methods) { System.out.println(m.getName()); Parameter[] parameter = m.getParameters(); for(Parameter pr : parameter) { System.out.println(pr); } } } }
a8613ea273fd1af242f9bb8c35e78465650ad16c
319eaae6d6251b02f8fbccba13bf72559171e2b6
/SRS13_JavaCode/src/srs13_demo/Photo.java
6833652da945fe424d8993d0cbdab11db99da135
[]
no_license
aligad1999/TestGit
d60907e2d6abc290cf0ad8e7f19dad83e4e2c4e7
ccd1eaf06514601ec767b2d84b4abb28bf773ef1
refs/heads/master
2020-12-01T12:44:24.408257
2019-12-28T16:17:01
2019-12-28T16:17:01
230,629,673
0
0
null
2019-12-28T15:44:59
2019-12-28T15:44:58
null
UTF-8
Java
false
false
701
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 srs13_demo; public class Photo implements Iphoto{ Double photoSize; String photoName; Enum photoType; int photoID; public void deletePhoto() { } public void addPhoto() { } public boolean searchPhoto() { return true; } public void viewPhoto(int photoID) { } @Override public void display() { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } }
4c0816282a9dd534b765c1e63ce9f9e6946ad0fa
8a3b0182024d568a7aa4af8c428399c691471b2b
/src/com/mrapocalypse/screwdshop/frags/PieTargets.java
c83b997a073726de5645d1e34d0826344d6853b6
[]
no_license
ScrewdAOSP/packages_apps_ScrewShop
1f01d3a0547d4a33eaaf238ddbd30aaeea581228
82380d744efa9fd506a9f6898c8b5e15788ede7a
refs/heads/n7x
2020-04-05T22:45:28.180051
2017-08-02T07:26:10
2017-08-10T22:17:07
61,762,728
2
21
null
2016-12-28T17:19:34
2016-06-23T01:18:23
Java
UTF-8
Java
false
false
5,824
java
/* * Copyright (C) 2010-2015 ParanoidAndroid Project * Portions Copyright (C) 2015 Fusion & CyanideL Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.mrapocalypse.screwdshop.frags; import android.app.Activity; import android.content.ContentResolver; import android.content.res.Resources; import android.content.Context; import android.os.Bundle; import android.support.v7.preference.PreferenceScreen; import android.support.v7.preference.ListPreference; import android.support.v14.preference.SwitchPreference; import android.support.v7.preference.Preference; import android.support.v7.preference.Preference.OnPreferenceChangeListener; import android.provider.Settings; import android.provider.Settings.SettingNotFoundException; import android.util.Log; import com.android.internal.logging.MetricsProto.MetricsEvent; import com.android.settings.R; import com.android.settings.SettingsPreferenceFragment; public class PieTargets extends SettingsPreferenceFragment implements OnPreferenceChangeListener { private static final String PA_PIE_MENU = "pa_pie_menu"; private static final String PA_PIE_LASTAPP = "pa_pie_lastapp"; private static final String PA_PIE_KILLTASK = "pa_pie_killtask"; private static final String PA_PIE_NOTIFICATIONS = "pa_pie_notifications"; private static final String PA_PIE_SETTINGS_PANEL = "pa_pie_settings_panel"; private static final String PA_PIE_SCREENSHOT = "pa_pie_screenshot"; private SwitchPreference mPieMenu; private SwitchPreference mPieLastApp; private SwitchPreference mPieKillTask; private SwitchPreference mPieNotifications; private SwitchPreference mPieQsPanel; private SwitchPreference mPieScreenshot; private ContentResolver mResolver; @Override protected int getMetricsCategory() { return MetricsEvent.SCREWD; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Load the preferences from an XML resource addPreferencesFromResource(R.xml.pa_pie_targets); PreferenceScreen prefSet = getPreferenceScreen(); Context context = getActivity(); mResolver = context.getContentResolver(); mPieMenu = (SwitchPreference) prefSet.findPreference(PA_PIE_MENU); mPieMenu.setChecked(Settings.System.getInt(mResolver, Settings.System.PA_PIE_MENU, 0) != 0); mPieLastApp = (SwitchPreference) prefSet.findPreference(PA_PIE_LASTAPP); mPieLastApp.setChecked(Settings.System.getInt(mResolver, Settings.System.PA_PIE_LAST_APP, 0) != 0); mPieKillTask = (SwitchPreference) prefSet.findPreference(PA_PIE_KILLTASK); mPieKillTask.setChecked(Settings.System.getInt(mResolver, Settings.System.PA_PIE_KILL_TASK, 0) != 0); mPieNotifications = (SwitchPreference) prefSet.findPreference(PA_PIE_NOTIFICATIONS); mPieNotifications.setChecked(Settings.System.getInt(mResolver, Settings.System.PA_PIE_NOTIFICATIONS, 0) != 0); mPieQsPanel = (SwitchPreference) prefSet.findPreference(PA_PIE_SETTINGS_PANEL); mPieQsPanel.setChecked(Settings.System.getInt(mResolver, Settings.System.PA_PIE_SETTINGS_PANEL, 0) != 0); mPieScreenshot = (SwitchPreference) prefSet.findPreference(PA_PIE_SCREENSHOT); mPieScreenshot.setChecked(Settings.System.getInt(mResolver, Settings.System.PA_PIE_SCREENSHOT, 0) != 0); } @Override public boolean onPreferenceTreeClick(Preference preference) { if (preference == mPieMenu) { Settings.System.putInt(getActivity().getApplicationContext().getContentResolver(), Settings.System.PA_PIE_MENU, mPieMenu.isChecked() ? 1 : 0); } else if (preference == mPieLastApp) { Settings.System.putInt(getActivity().getApplicationContext().getContentResolver(), Settings.System.PA_PIE_LAST_APP, mPieLastApp.isChecked() ? 1 : 0); } else if (preference == mPieKillTask) { Settings.System.putInt(getActivity().getApplicationContext().getContentResolver(), Settings.System.PA_PIE_KILL_TASK, mPieKillTask.isChecked() ? 1 : 0); } else if (preference == mPieNotifications) { Settings.System.putInt(getActivity().getApplicationContext().getContentResolver(), Settings.System.PA_PIE_NOTIFICATIONS, mPieNotifications.isChecked() ? 1 : 0); } else if (preference == mPieQsPanel) { Settings.System.putInt(getActivity().getApplicationContext().getContentResolver(), Settings.System.PA_PIE_SETTINGS_PANEL, mPieQsPanel.isChecked() ? 1 : 0); } else if (preference == mPieScreenshot) { Settings.System.putInt(getActivity().getApplicationContext().getContentResolver(), Settings.System.PA_PIE_SCREENSHOT, mPieScreenshot.isChecked() ? 1 : 0); } return super.onPreferenceTreeClick(preference); } @Override public boolean onPreferenceChange(Preference preference, Object newValue) { return false; } }
9b4674ffe8f92f76db2b070f7d88e7b00cffddc7
55b9344bc17d0c7e558bc917a443c1336cf1443b
/src/main/java/com/janakerman/exemplarservice/exception/PaymentValidationException.java
6e43ce7c0c91aae00fa47652c9d15d16e149b4ec
[]
no_license
janakerman/exemplar-service
bc2594c52d3ae40d8cb81297d542b195280369da
85ecf4d565ac968ebcc4e8bd8c38a4127d6486ae
refs/heads/master
2020-05-15T19:30:51.249807
2019-05-01T12:12:43
2019-05-01T12:12:43
182,457,676
0
1
null
null
null
null
UTF-8
Java
false
false
308
java
package com.janakerman.exemplarservice.exception; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; @ResponseStatus(value= HttpStatus.BAD_REQUEST, reason="Invalid payment request") public class PaymentValidationException extends RuntimeException {}
a7b6cfcc119c231936f2d091d3b83bcf233beac8
2f5220f7126e52a939412067f08a321bb95f0010
/gulimall-ware/src/main/java/com/atguigu/gulimall/ware/entity/PurchaseEntity.java
b196e4c1d662dae9eecb514c12ccd1882d48f87f
[ "Apache-2.0" ]
permissive
gzqnb/springcloud
77e5c581840ba7b4b72a86a49eb4c4a50b92a020
b7f1ef3e78155230502a3058195deb088904b547
refs/heads/master
2023-06-20T02:09:45.873381
2021-07-05T06:37:23
2021-07-05T06:37:23
360,515,806
0
0
null
null
null
null
UTF-8
Java
false
false
912
java
package com.atguigu.gulimall.ware.entity; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import java.math.BigDecimal; import java.io.Serializable; import java.util.Date; import lombok.Data; /** * 采购信息 * * @author guoziqian * @email [email protected] * @date 2021-03-17 14:58:07 */ @Data @TableName("wms_purchase") public class PurchaseEntity implements Serializable { private static final long serialVersionUID = 1L; /** * */ @TableId private Long id; /** * */ private Long assigneeId; /** * */ private String assigneeName; /** * */ private String phone; /** * */ private Integer priority; /** * */ private Integer status; /** * */ private Long wareId; /** * */ private BigDecimal amount; /** * */ private Date createTime; /** * */ private Date updateTime; }
db31404377c2029232213475f3355e677e96e511
3f7d9123220638ce806970241880caa082fe4a9b
/src/main/java/com/wygjyw/filedownload/HomeController.java
f05a544d2c48f566ac886fe4a9f9eb873ecde0c7
[]
no_license
wygjyw/SpringMVC
30e95c0572d8bf4a5c8d56dad4a0ea7a99dd6401
9da3963fb4eee60345df626f8c651fda6109b8e5
refs/heads/master
2021-01-19T07:37:16.483510
2014-01-15T15:10:49
2014-01-15T15:10:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,085
java
package com.wygjyw.filedownload; import java.text.DateFormat; import java.util.Date; import java.util.Locale; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; /** * Handles requests for the application home page. */ @Controller public class HomeController { private static final Logger logger = LoggerFactory.getLogger(HomeController.class); /** * Simply selects the home view to render by returning its name. */ @RequestMapping(value = "/", method = RequestMethod.GET) public String home(Locale locale, Model model) { logger.info("Welcome home! The client locale is {}.", locale); Date date = new Date(); DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale); String formattedDate = dateFormat.format(date); model.addAttribute("serverTime", formattedDate ); return "home"; } }
de7aca1c4e3ae10f151ff325364c8e38cc3322d6
445fd967984e788a95e45926da840e6bde85940e
/src/com/itnear/principle/demeter/Course.java
4525849887435c6b80cd8682244f22f1b9379717
[]
no_license
NearAJC/DesignPattern
81121584a047e5c3d6fe480db48d26a708194af2
a02bc4694f9209d0d77c084aefb0611475555fac
refs/heads/master
2021-01-08T04:59:47.190742
2020-02-20T15:48:51
2020-02-20T15:48:52
241,919,858
0
0
null
null
null
null
UTF-8
Java
false
false
135
java
package com.itnear.principle.demeter; /** * 描述:课程类 * 作者:NearJC * 时间:2020/02/16 */ public class Course { }
b28b37a16750071660721c49b1f5f5be377ba5a4
a5b5e759f6c6bd4ef01b140b1596f3e94befaab7
/src/Scenes/FightScene/FightSceneController.java
406d6e8e155c1fd92227f092a9f294fcd4fd685b
[]
no_license
Tyovaish/DragonWarriorMonsters
ccbf9971f0258fdcbd371c6a85a785ad41c92c2b
80d74ed40bb8277e028f489db63a9706cbc53f30
refs/heads/master
2021-01-13T03:34:17.901871
2017-12-20T04:43:25
2017-12-20T04:43:25
77,311,840
0
0
null
2017-12-20T04:43:26
2016-12-25T05:24:27
Java
UTF-8
Java
false
false
4,717
java
package Scenes.FightScene; import Model.BattleMediator.BattleMediator; import Model.Monster.Monster; import Model.Monster.MonsterObserver; import Model.Monster.MonsterSkillLabel; import Model.Skill.Skill; import javafx.event.EventHandler; import javafx.scene.Group; import javafx.scene.control.Label; import javafx.scene.input.MouseEvent; import java.util.ArrayList; import static Scenes.FightScene.FightScene.SCENE_LENGTH; import static Scenes.FightScene.FightScene.gameboyFont; public class FightSceneController { Group fightScene=null; BattleMediator battleMediator=null; FightSceneController(FightScene fightScene,BattleMediator battleMediator){ this.fightScene=fightScene.getScene(); this.battleMediator=battleMediator; addFightMenu(); } public void addFightMenu(){ Group fightMenu=new Group(); fightMenu.setLayoutY(2*SCENE_LENGTH/3); Label fight=new Label(); fight.setText("FIGHT"); fight.setOnMouseClicked(new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent event) { battleMediator.autoFight(); System.out.println("Hit"); } }); fight.setFont(gameboyFont); Label command=new Label(); command.setLayoutY(SCENE_LENGTH/12); command.setText("COMMAND"); command.setFont(gameboyFont); command.setOnMouseClicked(new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent event) { fightScene.getChildren().remove(fightMenu); addCommandMenu(); } }); Label items=new Label(); items.setLayoutY(2*SCENE_LENGTH/12); items.setText("ITEMS"); items.setFont(gameboyFont); Label run=new Label(); run.setLayoutY(3*SCENE_LENGTH/12); run.setText("RUN"); run.setFont(gameboyFont); fightMenu.getChildren().addAll(fight,command,items,run); fightScene.getChildren().addAll(fightMenu); } public void addCommandMenu(){ ArrayList<MonsterSkillLabel> monsterSkillLabels=battleMediator.getCurrentMonsterSelected().getAllSkillLabels(); Group commandMenu=new Group(); commandMenu.setLayoutY(2*SCENE_LENGTH/3); Label monsterSelected=new Label(); monsterSelected.setText(battleMediator.getCurrentMonsterSelected().getMonsterName().getText()); monsterSelected.setFont(gameboyFont); commandMenu.getChildren().add(monsterSelected); for(int i=0;i<monsterSkillLabels.size();++i){ MonsterSkillLabel monsterSkill=monsterSkillLabels.get(i); Label monsterSkillLabel=monsterSkill.getSkillLabel(); monsterSkillLabel.setFont(gameboyFont); monsterSkillLabel.setLayoutY((i+1)*SCENE_LENGTH/12); monsterSkillLabel.setOnMouseClicked(new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent event) { fightScene.getChildren().remove(commandMenu); addEnemyMonsterSelection(monsterSkill.getSkill()); } }); commandMenu.getChildren().add(monsterSkillLabel); } fightScene.getChildren().addAll(commandMenu); } public void addEnemyMonsterSelection(Skill monsterSkill){ ArrayList<MonsterObserver> enemyMonsters=battleMediator.getEnemyMonsterObservers(); Group enemyMonsterNameGroup=new Group(); enemyMonsterNameGroup.setLayoutY(2*SCENE_LENGTH/3); for(int i=0;i<enemyMonsters.size();i++){ MonsterObserver enemyMonster=enemyMonsters.get(i); Label enemyMonsterName=enemyMonster.getMonsterName(); enemyMonsterName.setFont(gameboyFont); enemyMonsterName.setOnMouseClicked(new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent event) { fightScene.getChildren().remove(enemyMonsterNameGroup); battleMediator.addPlayerMonsterTurn(enemyMonster,monsterSkill); battleMediator.nextPlayerMonster(); if(battleMediator.lastMonsterToOrder()){ addDisplayMonsterTurns; battleMediator.resetMonsterToOrder(); } else { addCommandMenu(); } } }); enemyMonsterName.setLayoutY(i*SCENE_LENGTH/9); enemyMonsterNameGroup.getChildren().add(enemyMonsterName); } fightScene.getChildren().add(enemyMonsterNameGroup); } }
fc013a0dceb323b1fa90fe526af612a71688e5fe
9a137683c48adc054e501838e72348e9a149b584
/src/main/java/com/app/vegetable/controller/BaseController.java
f7a37e5bdb96a6863933867665869cb6b854652b
[]
no_license
princepk01/vegetable-app-server
a0752bcaa18662a9b4f613862637cf9062a43a29
70b33c3284c3fd2d33a8b6cdee6e7c6496a67f7d
refs/heads/master
2023-01-03T02:58:17.488071
2020-10-27T02:54:28
2020-10-27T02:54:28
260,649,457
0
0
null
null
null
null
UTF-8
Java
false
false
312
java
package com.app.vegetable.controller; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; @Controller public class BaseController { public ResponseEntity<?> sendResponse(ResponseMessage responseMessage) { return ResponseEntity.ok().body(responseMessage); } }
537ab933ae3bbe28b724c01b842a1d0b2b8efab1
1f29e3f95b29cf39b9af62ccaf40d18605e2369a
/src/main/java/kr/or/ddit/paging/model/PageVo.java
1f6fc45a2e0783eea07e0ca06e7cb0e000e7104b
[]
no_license
hanssol/spring
390fd97ca6d5a8907af11eed10b28cdf03a38815
3a81d06935e89a7b799f668b129233c9ae671aab
refs/heads/master
2022-12-09T11:12:28.229645
2019-07-08T01:36:37
2019-07-08T01:36:37
192,683,627
0
0
null
2022-11-16T12:21:29
2019-06-19T07:41:09
Java
UTF-8
Java
false
false
1,077
java
package kr.or.ddit.paging.model; public class PageVo { private int page; // 페이지 번호 private int pageSize; // 페이지당 건수 public PageVo(int page, int pageSize) { this.page = page; this.pageSize = pageSize; } public PageVo(){ } public int getPage() { return page == 0 ? 1 : page; } public void setPage(int page) { this.page = page; } public int getPageSize() { return pageSize == 0 ? 10 :pageSize; } public void setPageSize(int pageSize) { this.pageSize = pageSize; } // 객체간 값 비교 @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + getPage(); result = prime * result + getPageSize(); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; PageVo other = (PageVo) obj; if (getPage() != other.getPage()) return false; if (getPageSize() != other.getPageSize()) return false; return true; } }
8fdd2d32ae277b5f0adcfa85c5c870e0b458b6f9
0299b79f350bb7910621166de1b2550e334328ef
/controller/onos/common/src/main/java/thesiscode/common/tree/AbstractTreeAlgorithm.java
3daabf00f67b9e5a672be1814b3991807a2586fb
[]
no_license
kit-tm/toposync
5b6e0dda213c39a32c8d6873545a95c41d1bcdef
cfc6121fb48356f93ff4de80f739a1be7b97107a
refs/heads/master
2021-03-29T16:14:41.881365
2020-03-17T16:19:54
2020-03-17T16:19:54
247,966,657
0
0
null
2020-10-13T20:25:46
2020-03-17T12:42:07
Java
UTF-8
Java
false
false
257
java
package thesiscode.common.tree; import thesiscode.common.group.IGroupChangeListener; /** * Abstraction of an algorithm, which computes trees. */ public abstract class AbstractTreeAlgorithm extends AbstractTreeChanger implements IGroupChangeListener { }
6299fa013e5010738553a8428645d587d0758d26
ecf6b0e5ed5915c48e8306481a2f19151a72d356
/Ludum/src/controller/MouseInput.java
f68445ec4f43a0824a3af424173cdcbbbcb33a00
[]
no_license
Tapetklister/GroundGame
684e50f6465978616353b64d7d64102b96ad4583
13b49a7967fc56d5032a4c8ec868ef5d6e63c682
refs/heads/master
2020-12-30T14:00:12.286672
2017-05-15T16:58:43
2017-05-15T16:58:43
91,271,640
0
0
null
null
null
null
UTF-8
Java
false
false
1,038
java
package controller; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import window.Game; public class MouseInput implements MouseListener { @Override public void mouseClicked(MouseEvent arg0) { } @Override public void mouseEntered(MouseEvent arg0) { } @Override public void mouseExited(MouseEvent arg0) { } @Override public void mousePressed(MouseEvent event) { if (Game.State != Game.STATE.GAME) { int mouseX = event.getX(); int mouseY = event.getY(); if (mouseX >= Game.WIDTH / 4 && mouseX <= Game.WIDTH - Game.WIDTH / 4) { if (mouseY >= 200 && mouseY <= 250) { switch (Game.State) { case MENU: Game.State = Game.STATE.GAME; break; case GAMEOVER: Game.willRestart = true; break; default: break; } } if (mouseY >= 300 && mouseY <= 350) { System.exit(1); } } } } @Override public void mouseReleased(MouseEvent arg0) { } }
63c976e31955c5aed5ccb3a26060d3ff57d4182e
ca198ad0201f8cc27479d92a18e636b8001931d8
/src/main/java/com/cheerhou/microservices/limitsservice/LimitsConfigurationController.java
49c8fd391d3abc7b94251f1994c97bc4a3e3557f
[]
no_license
cheerhou/limits-service
61f33ada8bfd51b8cf9dc50374a344a2eea352f5
7d784f8fdcc32208c1b600916cece93029c95044
refs/heads/main
2023-02-05T06:34:34.466197
2020-12-23T07:33:00
2020-12-23T07:33:00
323,820,575
0
0
null
null
null
null
UTF-8
Java
false
false
614
java
package com.cheerhou.microservices.limitsservice; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; /** * @author hcj * @Description * @Date 2020/12/23 */ @RestController public class LimitsConfigurationController { @Autowired private Configuration configuration; @GetMapping("/limits") public LimitsConfiguration retrieveLimitsFromConfiguration() { return new LimitsConfiguration(configuration.getMaximum(), configuration.getMinimum()); } }
01df0a68abf6a358fece57b364b9638a246433f8
dbd073641215e36af2d7036314ee2d5cb2834ca0
/src/main/java/com/thoughtworks/capability/gtb/restfulapidesign/domain/Group.java
aa4534f206537c98f687469425bba71da14dd566
[]
no_license
cleoxiii/B-Restful-api-design-homework
1200f675e2c4c720497d56da61aac24d14382140
2b04b926cebd9b825f3abb8956ca5076f8b52d92
refs/heads/master
2022-12-19T09:04:43.376312
2020-09-23T16:37:51
2020-09-23T16:37:51
295,379,626
0
0
null
2020-09-14T10:19:30
2020-09-14T10:19:29
null
UTF-8
Java
false
false
540
java
package com.thoughtworks.capability.gtb.restfulapidesign.domain; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.util.List; @Data @AllArgsConstructor @NoArgsConstructor @Builder public class Group { private Integer id; private String name; private String note; private List<Student> studentList; public void addStudent(Student student) { studentList.add(student); } public void clear() { studentList.clear(); } }
ad98999e7a59d8c98f70e6d07d4ce56dcb88ce54
4efe026019cdb9ff26fdfe998f44417486000403
/src/ch06/CarTest.java
0348dfabeae353197717eba86986a7e62edd762c
[]
no_license
cooo23/JIYOO
bb8d8f3c488f05a48d38150c9f5d3c66b3d451b6
df4ae8da95197be528f0f0cdb5f255b6b3932bc8
refs/heads/master
2023-08-27T14:34:35.692820
2021-10-06T07:38:34
2021-10-06T07:38:34
411,529,002
0
0
null
null
null
null
UTF-8
Java
false
false
949
java
package ch06; public class CarTest { public static void main(String[] args) { String car2 = new String(""); Car car = new Car(); //new 라는 클래스 없이 객체화 불가능 new 뒤에 객체화하고 싶은 클래스 안에 있는 메소드 // 클래스의 변수 = new 클래스 car.brand = "현대"; car.nm = "소나타"; car.drive(); car.stop(); Car car3 = new Car(); // 클래스 변수 = car3.brand = "기아"; car3.nm = "K5"; car3.drive(); car3.stop(); Car car4 = new Car(); car.brand = "현대"; car.nm = "소나타"; car.drive(); car.stop(); System.out.println(car == car3); //false 둘 다 새로 만들었기 때문에 다른 주소값 System.out.println(car == car4); //false 값이 같아도 새로만들었기 때문에 주소값이 달라 false } }
5077be72fb0acb736817db3095267733bb34bb2b
7edc0ef769d77f3ea39a06d4ec363c749f48a7ca
/src/main/java/com/jt/design_pattern/structural/bridge/ConcreteImplementor.java
91e8d01dc1937c2df7d798eb64c924a514299d62
[]
no_license
jitatai/design_pattern
a715ed7e91c5856cf3a978323ad1348b11dad60c
35119e440d7963d9a1af1656f8597602e0f74639
refs/heads/master
2023-02-18T12:43:01.335763
2021-01-22T09:13:12
2021-01-22T09:13:12
326,631,257
0
0
null
null
null
null
UTF-8
Java
false
false
319
java
package com.jt.design_pattern.structural.bridge; /** * @author jiatai.hu * @version 1.0 * @date 2021/1/13 11:18 */ public class ConcreteImplementor implements Implementor { @Override public void OperationImpl() { System.out.println("具体实现化(Concrete Implementor)角色被访问"); } }
e71c4d90059770725a08158058f546659256ba31
80b60aea637d5c55f827fd66d63147d6a963959c
/app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/android/support/graphics/drawable/R.java
17c0af7112ecb88e85b5928e43dbef38b50f47b6
[]
no_license
Rishabh96M/Word-Timer
783b9908e62440575970677d64df2deebf7f5f88
c4d07a4ca585ddd4de58c0ddce0af6ae04cd3b82
refs/heads/master
2023-05-09T15:49:48.121835
2021-05-30T11:42:56
2021-05-30T11:42:56
372,183,757
0
0
null
null
null
null
UTF-8
Java
false
false
8,261
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.graphics.drawable; public final class R { private R() {} public static final class attr { private attr() {} public static final int font = 0x7f020078; public static final int fontProviderAuthority = 0x7f02007a; public static final int fontProviderCerts = 0x7f02007b; public static final int fontProviderFetchStrategy = 0x7f02007c; public static final int fontProviderFetchTimeout = 0x7f02007d; public static final int fontProviderPackage = 0x7f02007e; public static final int fontProviderQuery = 0x7f02007f; public static final int fontStyle = 0x7f020080; public static final int fontWeight = 0x7f020081; } public static final class bool { private bool() {} public static final int abc_action_bar_embed_tabs = 0x7f030000; } public static final class color { private color() {} public static final int notification_action_color_filter = 0x7f04003f; public static final int notification_icon_bg_color = 0x7f040040; public static final int ripple_material_light = 0x7f04004a; public static final int secondary_text_default_material_light = 0x7f04004c; } public static final class dimen { private dimen() {} public static final int compat_button_inset_horizontal_material = 0x7f05004b; public static final int compat_button_inset_vertical_material = 0x7f05004c; public static final int compat_button_padding_horizontal_material = 0x7f05004d; public static final int compat_button_padding_vertical_material = 0x7f05004e; public static final int compat_control_corner_material = 0x7f05004f; public static final int notification_action_icon_size = 0x7f050059; public static final int notification_action_text_size = 0x7f05005a; public static final int notification_big_circle_margin = 0x7f05005b; public static final int notification_content_margin_start = 0x7f05005c; public static final int notification_large_icon_height = 0x7f05005d; public static final int notification_large_icon_width = 0x7f05005e; public static final int notification_main_column_padding_top = 0x7f05005f; public static final int notification_media_narrow_margin = 0x7f050060; public static final int notification_right_icon_size = 0x7f050061; public static final int notification_right_side_padding_top = 0x7f050062; public static final int notification_small_icon_background_padding = 0x7f050063; public static final int notification_small_icon_size_as_large = 0x7f050064; public static final int notification_subtext_size = 0x7f050065; public static final int notification_top_pad = 0x7f050066; public static final int notification_top_pad_large_text = 0x7f050067; } public static final class drawable { private drawable() {} public static final int notification_action_background = 0x7f06005e; public static final int notification_bg = 0x7f06005f; public static final int notification_bg_low = 0x7f060060; public static final int notification_bg_low_normal = 0x7f060061; public static final int notification_bg_low_pressed = 0x7f060062; public static final int notification_bg_normal = 0x7f060063; public static final int notification_bg_normal_pressed = 0x7f060064; public static final int notification_icon_background = 0x7f060065; public static final int notification_template_icon_bg = 0x7f060066; public static final int notification_template_icon_low_bg = 0x7f060067; public static final int notification_tile_bg = 0x7f060068; public static final int notify_panel_notification_icon_bg = 0x7f060069; } public static final class id { private id() {} public static final int action_container = 0x7f07000e; public static final int action_divider = 0x7f070010; public static final int action_image = 0x7f070011; public static final int action_text = 0x7f070017; public static final int actions = 0x7f070018; public static final int async = 0x7f07001f; public static final int blocking = 0x7f070024; public static final int chronometer = 0x7f07002d; public static final int forever = 0x7f070044; public static final int icon = 0x7f07004e; public static final int icon_group = 0x7f07004f; public static final int info = 0x7f070053; public static final int italic = 0x7f070055; public static final int line1 = 0x7f070058; public static final int line3 = 0x7f070059; public static final int normal = 0x7f070062; public static final int notification_background = 0x7f070063; public static final int notification_main_column = 0x7f070064; public static final int notification_main_column_container = 0x7f070065; public static final int right_icon = 0x7f070071; public static final int right_side = 0x7f070072; public static final int tag_transition_group = 0x7f070094; public static final int text = 0x7f070095; public static final int text2 = 0x7f070096; public static final int time = 0x7f07009e; public static final int title = 0x7f07009f; } public static final class integer { private integer() {} public static final int status_bar_notification_info_maxnum = 0x7f080004; } public static final class layout { private layout() {} public static final int notification_action = 0x7f09001f; public static final int notification_action_tombstone = 0x7f090020; public static final int notification_template_custom_big = 0x7f090021; public static final int notification_template_icon_group = 0x7f090022; public static final int notification_template_part_chronometer = 0x7f090023; public static final int notification_template_part_time = 0x7f090024; } public static final class string { private string() {} public static final int status_bar_notification_info_overflow = 0x7f0c001f; } public static final class style { private style() {} public static final int TextAppearance_Compat_Notification = 0x7f0d00e7; public static final int TextAppearance_Compat_Notification_Info = 0x7f0d00e8; public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0d00e9; public static final int TextAppearance_Compat_Notification_Time = 0x7f0d00ea; public static final int TextAppearance_Compat_Notification_Title = 0x7f0d00eb; public static final int Widget_Compat_NotificationActionContainer = 0x7f0d0153; public static final int Widget_Compat_NotificationActionText = 0x7f0d0154; } public static final class styleable { private styleable() {} public static final int[] FontFamily = { 0x7f02007a, 0x7f02007b, 0x7f02007c, 0x7f02007d, 0x7f02007e, 0x7f02007f }; 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 = { 0x1010532, 0x1010533, 0x101053f, 0x7f020078, 0x7f020080, 0x7f020081 }; public static final int FontFamilyFont_android_font = 0; public static final int FontFamilyFont_android_fontWeight = 1; public static final int FontFamilyFont_android_fontStyle = 2; public static final int FontFamilyFont_font = 3; public static final int FontFamilyFont_fontStyle = 4; public static final int FontFamilyFont_fontWeight = 5; } }
6cb645e937d70cb9458e7c8322bbef0b9079f6b8
76875917925793ea446a1b1536606633a3272653
/evo-springboot-annotation/src/main/java/com/tazine/evo/annotation/conditional/spring/LinuxListService.java
d538a5545fdc0f84699e48769aa4fbe026758a15
[ "MIT" ]
permissive
BookFrank/EVO-World
01555355c434fac65406e158ffa5f7aebf3ff7dc
3d27ae414f0281668024838a4c64db4bdd4a6377
refs/heads/master
2022-06-22T05:56:43.648597
2020-05-05T15:44:32
2020-05-05T15:44:32
147,456,884
1
1
MIT
2022-06-21T02:58:35
2018-09-05T03:54:10
Java
UTF-8
Java
false
false
276
java
package com.tazine.evo.annotation.conditional.spring; /** * Linux 下所要创建的 Bean 的类 * * @author frank * @date 2018/09/26 */ public class LinuxListService implements ListFileService { @Override public String showList() { return "ls"; } }
185c86774241c0f9ad855e01e094511b3e6a6632
7d77bccb4dc41c354daf6cd884471f2ce3a0282e
/modello-plugins/modello-plugin-java/src/test/java/org/codehaus/modello/plugin/java/AnnotationsJava4GeneratorTest.java
4169b7b9ef1f6d5687d73f57426b5f2911b5d38a
[ "MIT", "Apache-2.0" ]
permissive
elharo/modello
f2cac146eab2c98de352efeea803923148c49fa7
96d0a6a9117384d1f82e5d4c586e86cb54132171
refs/heads/master
2023-08-01T08:37:53.471786
2020-01-20T20:56:59
2020-01-20T20:56:59
241,111,471
0
0
MIT
2020-02-17T13:14:50
2020-02-17T13:14:49
null
UTF-8
Java
false
false
2,062
java
package org.codehaus.modello.plugin.java; /* * Copyright (c) 2004, Codehaus.org * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies * of the Software, and to permit persons to whom the Software is furnished to do * so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ import java.util.Properties; import org.codehaus.modello.AbstractModelloJavaGeneratorTest; import org.codehaus.modello.core.ModelloCore; import org.codehaus.modello.model.Model; /** * Check that annotations are not added to generated sources when Java 5 features are not enabled. */ public class AnnotationsJava4GeneratorTest extends AbstractModelloJavaGeneratorTest { public AnnotationsJava4GeneratorTest() { super( "annotations-java4" ); } public void testJava4GeneratorWithAnnotations() throws Throwable { ModelloCore modello = (ModelloCore) lookup( ModelloCore.ROLE ); Model model = modello.loadModel( getXmlResourceReader( "/models/annotations.mdo" ) ); Properties parameters = getModelloParameters( "1.0.0", false ); modello.generate( model, "java", parameters ); compileGeneratedSources( false ); } }
[ "hboutemy@f0865d36-f2f9-0310-a560-dfd520db29d7" ]
hboutemy@f0865d36-f2f9-0310-a560-dfd520db29d7
bcdac3dbbc1d340393a40c51ab7d5c43fabd2321
34521988c1e8bbc8a4bf81f7d82b69eee4edd8db
/Exercise4/src/Exercise4_5/Mango.java
9dd7015d1223c1e93a509f05d4ef8e2995a34bf5
[]
no_license
YongBoonKeat/Exercise4
b00e66339e7db11bbb815fb3e6e0ee235b0205b7
a43ca0ff54e01b07f64cbe04eb08c209b17bba2e
refs/heads/master
2023-04-28T02:18:55.692193
2021-05-19T05:32:28
2021-05-19T05:32:28
322,176,966
0
0
null
null
null
null
UTF-8
Java
false
false
2,007
java
package Exercise4_5; public class Mango extends Fruit{ private int quantity; private double price; public Mango(String name,int Q,double P) {//Constructor with argument super(name); this.quantity = Q; this.price = P; //System.out.println(name + " constructor is invoked"); if (this.quantity <= 10) { totalPrice(); //overloading with no arguments because price is same System.out.println(name); System.out.println("Quantity\t: " + this.quantity); System.out.println("Price\t: RM" + this.price); System.out.println("If quantity LESS than 10, Total price: RM" + totalPrice()); } else if (this.quantity > 10 && this.quantity <= 100) { System.out.println(name); double pp = 3.2; // Buy more than 10 but less than 100, price is RM3.2 totalPrice(pp); //overloading with 1 argument System.out.println("Quantity\t: " + this.quantity); System.out.println("If quantity MORE than 10, Get More Cheaper Price!"); System.out.println("Price\t\t: RM" + pp); System.out.println("Total price\t: RM" + totalPrice(pp)); } else { System.out.println(name); double pp = 3; //Buy more than 100, price is RM3 double dis; Discount M = new MangoDiscount(); dis = M.discountRate();//Buy more than 100, get discount; totalPrice(pp, dis); //overloading with 2 arguments System.out.println("Quantity\t: " + this.quantity); System.out.println("If quantity MORE than 100, Get More Cheaper Price and Special Discount!"); System.out.println("Price\t\t: RM" + pp); System.out.println("Special Discount: " + (dis*100)+"%"); System.out.println("Total price\t: RM" + totalPrice(pp,dis)); } } public double totalPrice() {//overloading method return this.price * this.quantity; } public double totalPrice(double pp) {//overloading method return pp * this.quantity; } public double totalPrice(double pp, double dis) {//overloading method return pp * this.quantity* (1-dis); } }
[ "LEGION@LAPTOP-DHOK1Q7Q" ]
LEGION@LAPTOP-DHOK1Q7Q
cf0ac35efa1273a63eac1c5b9b5abbbbdc746b25
806718fb1a3104319205e8ab4bbfd48010dd263e
/src/main/java/com/inova/banheirolimpo/exception/ExceptionHandlerController.java
b758de74802a48104d8142943e875555193533f8
[]
no_license
markussouza/banheirolimpo-service
f5541c4ebc136714dfe8192f52619f21b16572db
34650daa7466c2016314c2546c9abc7104c5ed7f
refs/heads/master
2020-03-10T01:33:43.247303
2018-05-02T19:33:41
2018-05-02T19:33:41
129,113,019
0
0
null
null
null
null
UTF-8
Java
false
false
1,108
java
/** * */ package com.inova.banheirolimpo.exception; import java.util.stream.Collectors; import javax.validation.ConstraintViolationException; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; /** * @author Markus Souza on 06/02/2018 * * Essa controller será responsável por interceptar e tratar as exceções lançadas pela aplicação. * */ @ControllerAdvice public class ExceptionHandlerController { @ExceptionHandler(ConstraintViolationException.class) public ResponseEntity<?> validateError(ConstraintViolationException ex){ return ResponseEntity.badRequest().body(ex.getConstraintViolations().stream().map(cv -> cv.getMessage()).collect(Collectors.toList())); } @ExceptionHandler(Exception.class) public ResponseEntity<?> otherErrors(Exception ex){ return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(ex.getMessage()); } }
b72e5449bdfdf320e13f255f66ac858f35e87c84
fe0a27bcd9eb2be6ae938d53deeaee52968a7c36
/controller/src/main/java/com/epam/esm/contoller/UserController.java
1833f3e3e3c1e78ac845eefaf202b940178c628c
[]
no_license
KostyaSvirski/Authentication-Spring-Security
a87075994ab3f057f34492ca630f817b1766d5ec
0ac8f96eeb6557e7a1b1c653005a9f1cdd2a8942
refs/heads/dev
2023-04-11T09:48:22.707765
2021-04-16T16:42:19
2021-04-16T16:42:19
342,965,209
0
0
null
2021-03-01T07:22:46
2021-02-27T21:47:58
Java
UTF-8
Java
false
false
2,247
java
package com.epam.esm.contoller; import com.epam.esm.auth.UserPrincipal; import com.epam.esm.dto.UserDTO; import com.epam.esm.exception.UnknownPrincipalException; import com.epam.esm.service.UserService; import com.epam.esm.util.builder.UserLinkBuilder; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.web.bind.annotation.*; import java.util.List; @RestController @RequestMapping("/users") public class UserController { private static final int DEFAULT_LIMIT_INT = 5; private static final int DEFAULT_PAGE_INT = 1; private static final String DEFAULT_LIMIT = "5"; private static final String DEFAULT_PAGE = "1"; @Autowired private UserService service; @GetMapping("/") public ResponseEntity<?> retrieveAllUsers (@RequestParam(defaultValue = DEFAULT_LIMIT) int limit, @RequestParam(defaultValue = DEFAULT_PAGE) int page) { List<UserDTO> resultList = service.findAll(limit, page); for (int i = 0; i < resultList.size(); i++) { UserLinkBuilder builder = new UserLinkBuilder(resultList.get(i)); builder.buildRetrieveSpecificUserLink(); resultList.set(i, builder.getHypermedia()); } return new ResponseEntity<>(resultList, HttpStatus.OK); } @GetMapping("/{id}") public ResponseEntity<?> retrieveSpecificUser(@PathVariable long id) { UserDTO user = service.find(id); UserLinkBuilder builder = new UserLinkBuilder(user); builder.buildOrdersReferencesLink(DEFAULT_LIMIT_INT, DEFAULT_PAGE_INT); return new ResponseEntity<>(builder.getHypermedia(), HttpStatus.OK); } @GetMapping("/me") public ResponseEntity<?> retrieveMe() { Object me = SecurityContextHolder.getContext().getAuthentication().getPrincipal(); if (me instanceof UserPrincipal) { return retrieveSpecificUser(((UserPrincipal) me).getId()); } else { throw new UnknownPrincipalException("principal of " + me.getClass() + " is unknown"); } } }
233cc915b691a8a470f2a304997c57341153ecd3
56320ce0c5d583c3fb21a5f66381760fe24bdc90
/app/src/main/java/com/migue/zeus/expensesnotes/ui/add_expense_or_income_activity/AddAccountEntryContract.java
d138f8c6423d2e33d51fa3f0c824b5b259027816
[]
no_license
MigueArcos/Expenses-Notes
b34e74dd55bfefdf67726d4e5dc559ccda25468d
4fb2ef538b7ba0065c00ddb5912fb3c0fbc41abd
refs/heads/master
2020-05-04T04:53:15.004318
2019-05-14T23:03:26
2019-05-14T23:03:26
178,975,814
0
0
null
null
null
null
UTF-8
Java
false
false
1,770
java
package com.migue.zeus.expensesnotes.ui.add_expense_or_income_activity; import com.migue.zeus.expensesnotes.data.models.Account; import com.migue.zeus.expensesnotes.data.models.AccountEntry; import com.migue.zeus.expensesnotes.data.models.AccountEntryCategory; import com.migue.zeus.expensesnotes.data.models.AccountEntryDetail; import com.migue.zeus.expensesnotes.data.models.AccountEntryWithDetails; import java.util.List; public class AddAccountEntryContract { interface View{ void showCategories(List<AccountEntryCategory> accountEntryCategories); void showAccounts(List<Account> accounts); void showTitle(String title); void showDate(String date); void notifyAccountEntryCreated(long id); } interface Model { List<Account> getAccounts(); List<AccountEntryCategory> getAccountEntriesCategories(boolean isExpense); String getAccountEntryTitle(AccountEntry accountEntry); String getAccountEntryDate(AccountEntry accountEntry); String getAccountEntryDate(); long createAccountEntry(String name, String date, long expenseCategoryId, List<AccountEntryDetail> details, boolean isExpense); void updateAccountEntry(AccountEntryWithDetails accountEntryWithDetails); } interface Presenter{ void getAccounts(); void getAccountEntryCategories(boolean isExpense); void getAccountEntryTitle(AccountEntry accountEntry); void getAccountEntryDate(AccountEntry accountEntry); void getAccountEntryDate(); void createAccountEntry(String name, String date, long expenseCategoryId, List<AccountEntryDetail> details, boolean isExpense); void updateAccountEntry(AccountEntryWithDetails accountEntryWithDetails); } }
[ "=" ]
=
a11ff1dcdba66046006b1a6cb6a08135dfb9be68
2595bb387bb59424ad4c4b63e3654949ecccef7e
/org.contextmapper.dsl.ide/src/org/contextmapper/dsl/ide/actions/impl/SwitchFromPartnershipToSharedKernelAction.java
c7e7792319f24413e74c77dad87dba89300dd467
[ "Apache-2.0" ]
permissive
ContextMapper/context-mapper-dsl
fab85a2e2b5205faf31847707d9f21c565fcd56d
44e2db8a10cfb475e2f1715eba0ad724dd2ce971
refs/heads/master
2023-08-31T17:42:23.479341
2023-08-17T12:51:09
2023-08-17T12:51:09
153,783,743
197
34
Apache-2.0
2023-08-17T12:38:01
2018-10-19T13:03:03
Java
UTF-8
Java
false
false
2,351
java
/* * Copyright 2020 The Context Mapper Project Team * * 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.contextmapper.dsl.ide.actions.impl; import java.util.List; import java.util.Set; import java.util.stream.Collectors; import org.contextmapper.dsl.cml.CMLResource; import org.contextmapper.dsl.contextMappingDSL.Partnership; import org.contextmapper.dsl.ide.actions.CMLCodeAction; import org.eclipse.emf.ecore.EObject; import org.eclipse.lsp4j.Command; import com.google.common.collect.Lists; /** * Action that calls the "Change Partnership to Shared Kernel" refactoring. * * @author Stefan Kapferer * */ public class SwitchFromPartnershipToSharedKernelAction implements CMLCodeAction { private CMLResource cmlResource; private List<EObject> editorSelection; public SwitchFromPartnershipToSharedKernelAction(CMLResource cmlResource, List<EObject> editorSelection) { this.cmlResource = cmlResource; this.editorSelection = editorSelection; } @Override public boolean isApplicable() { return getSelectedPartnerships().size() == 1; } @Override public Command getCommand() { List<Object> commandArguments = Lists.newLinkedList(); Partnership selectedPartnership = getSelectedPartnership(); commandArguments.add(cmlResource.getURI().toString()); commandArguments.add(selectedPartnership.getParticipant1().getName()); commandArguments.add(selectedPartnership.getParticipant2().getName()); return new Command("Change to Shared Kernel", "cml.ar.switchPartnershipToSharedKernel", commandArguments); } private Partnership getSelectedPartnership() { return getSelectedPartnerships().iterator().next(); } private Set<Partnership> getSelectedPartnerships() { return editorSelection.stream().filter(o -> o instanceof Partnership).map(o -> (Partnership) o).collect(Collectors.toSet()); } }
bd466bdf7242861688bf0bd15462b03edfc8ea77
3ffb212d8752fa08508d863e4e195a7a86cabf23
/src/main/java/com/example/demo/appuser/AppUserService.java
67319e7f97d9b2287514557b6832bd710f66fac3
[]
no_license
nikkukn/Java-Login
4af51fc5b3753294543ccca62fbcc92b7b80a420
5e473a1c79b335cb063243f1b0575614e1f687d5
refs/heads/main
2023-06-23T08:42:54.032346
2021-07-05T23:16:11
2021-07-05T23:16:11
383,385,353
1
0
null
2021-07-06T07:50:35
2021-07-06T07:50:34
null
UTF-8
Java
false
false
529
java
package com.example.demo.appuser; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.stereotype.Service; @Service public class AppUserService implements UserDetailsService { private final AppUser @Override public UserDetails loadUserByUsername(String s) throws UsernameNotFoundException { return null; } }
e19e26b3ebc5100f0e06b3f54811eea23bf1bb53
96a857065c55699d135f00bc7f11144e2b01f2fe
/BroadcastTest/src/com/example/broadcasttest/MainActivity.java
e9276d2bd73538a011c32961b13d22a75040c01b
[ "Apache-2.0" ]
permissive
zjiat/android_sail
7b5b01e0a6187d1088f6cde376de55f365290bb0
f3861603517d69e1b3b56f7f64baa7eb54119479
refs/heads/master
2020-12-24T10:23:30.285408
2016-11-18T01:31:36
2016-11-18T01:31:36
73,086,782
0
0
null
null
null
null
UTF-8
Java
false
false
1,575
java
package com.example.broadcasttest; import android.app.Activity; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.widget.Toast; public class MainActivity extends Activity { private IntentFilter intentFilter; private NetworkChangeReceiver networkChangeReceiver; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); intentFilter = new IntentFilter(); intentFilter.addAction("android.net.conn.CONNECTIVITY_CHANGE"); networkChangeReceiver = new NetworkChangeReceiver(); registerReceiver(networkChangeReceiver, intentFilter); } @Override protected void onDestroy() { super.onDestroy(); unregisterReceiver(networkChangeReceiver); } class NetworkChangeReceiver extends BroadcastReceiver{ @Override public void onReceive(Context context, Intent intent) { ConnectivityManager connectivityManager = (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo(); if (networkInfo != null && networkInfo.isAvailable()) { Toast.makeText(context, "network is available", Toast.LENGTH_SHORT).show(); }else { Toast.makeText(context, "network is unavailable", Toast.LENGTH_SHORT).show(); } } } }
572cf6291f29b1f8cfe69d830037d9378e75020c
39c7af659bb3fd342b2dfcf744a6e7e956a19779
/src/main/java/com/careerstack/careerstack69/linklistMerge/SortedLinkListMerge.java
a86de5d6a3c47b7480fd7055937c89d05e169eb6
[]
no_license
braj065/CompeteL1
49c2ae24aed6027fbc8b145284af1b257bea1aa6
e1e9073bf867c0ca39c628506270fd579927e3df
refs/heads/master
2023-05-25T18:23:11.148030
2017-05-23T03:10:10
2017-05-23T03:10:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
798
java
package com.trgr.careerstack69.linklistMerge; public class SortedLinkListMerge { LinkList a; public static void main(String[] args){ LinkList a=new LinkList(10); a.insert(30); a.insert(50); a.insert(70); a.insert(90); LinkList b=new LinkList(20); b.insert(40); b.insert(60); b.insert(80); b.insert(100); SortedLinkListMerge we=new SortedLinkListMerge(); we.merger(b, a); System.out.println("Jammy"); } public void merger(LinkList y, LinkList x){ LinkList secList=x; while(y!=null && x!=null){ if(y.data<x.data){ LinkList k=y.next; y.next=x; secList=x.next; x.next=k; y=k; x=secList; }else if(y.data>x.data){ LinkList k=x.next; x.next=y; secList=y.next; y.next=k; x=k; y=secList; } } } }
3aea28e74c644cb7eb8d800a34efef42ed465b25
3fe57157ae68abe7e9656245d69b11ca01eed45d
/src/main/java/com/sistr/scarlethill/datagen/ScarletItemTagsProvider.java
aeaf97de7776dfa076a1ea2757e49ff43e37744e
[ "MIT" ]
permissive
SistrScarlet/TheScarletHillMod
68e3cced07db944f91824e8601577ceab9c341ef
44ab485646c071cc35c882bfa2d9956b3b3d5b58
refs/heads/master
2021-05-25T17:31:55.684892
2021-03-06T05:44:44
2021-03-06T05:44:44
253,831,134
0
0
null
null
null
null
UTF-8
Java
false
false
635
java
package com.sistr.scarlethill.datagen; import com.sistr.scarlethill.setup.Registration; import net.minecraft.data.DataGenerator; import net.minecraft.item.Items; import net.minecraftforge.common.Tags; import net.minecraftforge.common.data.ForgeItemTagsProvider; public class ScarletItemTagsProvider extends ForgeItemTagsProvider { public ScarletItemTagsProvider(DataGenerator gen) { super(gen); } @Override public void registerTags() { getBuilder(ScarletTags.Items.RED_THINGS).add(Items.RED_DYE, Items.REDSTONE); getBuilder(Tags.Items.GEMS).add(Registration.SCARLET_GEM_ITEM.get()); } }
522b9d2cd3b12b628d1afe095e06a85372915b81
3febd5483511342beae7a0f622fbbac64da7a5af
/ÖDEV2/src/com/company/InstructorManager.java
652d71e45e6435b200333eecdadb1d346cda709f
[]
no_license
varlikursat/-dev2
95076dc4f668c745fe37b639da1d299125275be4
6354cedf906ddffff7ad5ac5725e2fe7ba5f2a34
refs/heads/main
2023-04-18T16:28:05.866182
2021-04-25T12:35:21
2021-04-25T12:35:21
361,423,460
0
0
null
null
null
null
UTF-8
Java
false
false
349
java
package com.company; public class InstructorManager { public void displayInstructor(Instructor instructor){ System.out.println( "--Eğitmen Bilgileri--" + "/n" + "Eğitmen İsmi: " + instructor.instructorName+ "/n" + "Deneyim Yılı: " + instructor.yearOfExperience); } }
9a38db9e91119d56010d9e9c81abdafbb09cdaf0
fd6e125be6d6915f49ae632600af2c357282f688
/SpringBootDemo/src/main/java/com/dhcc/zhyl/SpringBootDemo/controller/TestController.java
e1fec49f61b518a6461cccedae5104b2dbc4d335
[]
no_license
AlphaKitty/gitRepository
07f6397dc948e878a6fcae7186faa443d579f353
8d5fbd49b5a8420414fc944e5791972a6e98f0f3
refs/heads/test
2021-01-20T12:16:26.863571
2018-01-04T11:36:25
2018-01-04T11:36:25
101,707,194
1
0
null
2020-05-19T02:55:29
2017-08-29T02:00:15
HTML
UTF-8
Java
false
false
344
java
package com.dhcc.zhyl.SpringBootDemo.controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("/zhyl") public class TestController { @RequestMapping("/gateway") public String sayHello() { return "hello123"; } }
069a9feb8d53ee56eda96c35a0cc7a35e5b14036
95e944448000c08dd3d6915abb468767c9f29d3c
/sources/com/p280ss/android/ugc/aweme/shortvideo/cover/C38637g.java
190dc831d49880e771b37ebe53a6385f76937962
[]
no_license
xrealm/tiktok-src
261b1faaf7b39d64bb7cb4106dc1a35963bd6868
90f305b5f981d39cfb313d75ab231326c9fca597
refs/heads/master
2022-11-12T06:43:07.401661
2020-07-04T20:21:12
2020-07-04T20:21:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
480
java
package com.p280ss.android.ugc.aweme.shortvideo.cover; import com.p280ss.android.ugc.aweme.shortvideo.mvtemplate.p1583a.C40093a; /* renamed from: com.ss.android.ugc.aweme.shortvideo.cover.g */ final /* synthetic */ class C38637g implements C40093a { /* renamed from: a */ private final C386262 f100369a; C38637g(C386262 r1) { this.f100369a = r1; } /* renamed from: a */ public final void mo96653a() { this.f100369a.mo96640b(); } }
942fccfdfce8d2d72207ab61cb40c6f368c457ac
b98322ed93d2d8c5e7362b0db471b5109c0b11e8
/app/src/main/java/com/example/ahsan/popularmovies/model/details/SpokenLanguage.java
924894d6d5549ef87873909b52a249dd0c6aebf7
[]
no_license
a2ashraf/popularmovies
a7fdce8e135122abe4ce79f337ef474ec3bf26d4
987fc699e43df1b9ba05f2c0defe09efc1720efd
refs/heads/master
2021-04-29T10:33:52.834027
2017-07-04T03:40:20
2017-07-04T03:40:20
77,638,250
0
0
null
null
null
null
UTF-8
Java
false
false
602
java
package com.example.ahsan.popularmovies.model.details; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; public class SpokenLanguage { @SerializedName("iso_639_1") @Expose private String iso6391; @SerializedName("name") @Expose private String name; public String getIso6391() { return iso6391; } public void setIso6391(String iso6391) { this.iso6391 = iso6391; } public String getName() { return name; } public void setName(String name) { this.name = name; } }