blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 7
332
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
50
| license_type
stringclasses 2
values | repo_name
stringlengths 7
115
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringclasses 557
values | visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
684M
⌀ | star_events_count
int64 0
77.7k
| fork_events_count
int64 0
48k
| gha_license_id
stringclasses 17
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 82
values | src_encoding
stringclasses 28
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 7
5.41M
| extension
stringclasses 11
values | content
stringlengths 7
5.41M
| authors
listlengths 1
1
| author
stringlengths 0
161
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b1e4bf8c53d27246a06fe30bd9a6ac5d12f45810
|
41cdc95b4bad0f9230736ee2268c2e82df8013e3
|
/app/src/main/java/com/example/admin/menu_demo/MessageHelper.java
|
90746f6a8f05441259182d8d58b53d4724378d09
|
[] |
no_license
|
aos-week-day-6th/menu-demo
|
3f1d1d0f4fe5731c80f3b5987b93a477502b5859
|
e655aadc39d5a2b8f132fa8b34b41d192dd3623d
|
refs/heads/master
| 2020-04-07T08:08:04.165384 | 2018-11-19T10:19:36 | 2018-11-19T10:19:36 | 158,201,702 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 260 |
java
|
package com.example.admin.menu_demo;
import android.content.Context;
import android.widget.Toast;
public class MessageHelper {
static void showMessage(Context context,String smg){
Toast.makeText(context, smg, Toast.LENGTH_SHORT).show();
}
}
|
[
"[email protected]"
] | |
ac79d5aeb3c3e212793ea3e740f16083cc2386e4
|
e2d72f8b30d19282465b1a17bf5043b0dbb70a65
|
/JumpGame/core/src/com/ray/game/Utils.java
|
15a49ee8290d4da826edb7662c133d090794c28f
|
[] |
no_license
|
GITFlask/FlappyBirdClone
|
b43d79f31b75638ccd73917602fdd5cdb870a6d6
|
5f41d1cdd8e7251651daf0863708de6a5ee6caa2
|
refs/heads/master
| 2021-01-22T20:54:16.311152 | 2017-03-23T21:41:01 | 2017-03-23T21:41:01 | 85,372,024 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,159 |
java
|
package com.ray.game;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.math.Interpolation;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.scenes.scene2d.Action;
import com.badlogic.gdx.scenes.scene2d.actions.Actions;
import com.badlogic.gdx.scenes.scene2d.actions.MoveByAction;
import com.badlogic.gdx.scenes.scene2d.actions.SequenceAction;
/**
* Created by Ray on 15/12/2016.
*/
/*This class contains some methods we will be using.
* getRandomYOpening for where our tube gap is placed
* and getFloatyAction tap to start label and plane in pregame state.
* */
public class Utils {
public static float getRandomYOpening(){ //Set up a random position for the tube gap
return MathUtils.random(96f + 48f, JumpGame.HEIGHT - 64f);
}
public static Action getFloatyAction(){
MoveByAction a1 = Actions.moveBy(0, 10f, 1f, Interpolation.sine); //Move up
MoveByAction a2 = Actions.moveBy(0, -10f, 1f, Interpolation.sine); //Move down
SequenceAction sa = Actions.sequence(a1, a2); //Do the movements one after another
return Actions.forever(sa); //Keep doing this action
}
}
|
[
"[email protected]"
] | |
eab0d10fdb51fcc7f90b23b9085f1c746a39edc9
|
fa4345bc2c7cda13b0825d415720c4737220d883
|
/designpattern/src/main/java/com/morningstar/designpattern/state/gumballstatewinner/GumballMachineTestDrive.java
|
dd5ffc5b68b7dc12d6c67d164f724bf9540189c5
|
[] |
no_license
|
robatter/designpattern
|
d45657f5aff269aff511207a2debac2c2b0c0059
|
a52b75a87c66d66c4b060f9cf045e03ea7482a21
|
refs/heads/master
| 2020-12-30T10:23:12.795845 | 2015-01-26T05:14:07 | 2015-01-26T05:14:07 | 29,723,179 | 0 | 2 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,094 |
java
|
package com.morningstar.designpattern.state.gumballstatewinner;
public class GumballMachineTestDrive {
public static void main(String[] args) {
GumballMachine gumballMachine =
new GumballMachine(10);
System.out.println(gumballMachine);
gumballMachine.insertQuarter();
gumballMachine.turnCrank();
gumballMachine.insertQuarter();
gumballMachine.turnCrank();
System.out.println(gumballMachine);
gumballMachine.insertQuarter();
gumballMachine.turnCrank();
gumballMachine.insertQuarter();
gumballMachine.turnCrank();
System.out.println(gumballMachine);
gumballMachine.insertQuarter();
gumballMachine.turnCrank();
gumballMachine.insertQuarter();
gumballMachine.turnCrank();
System.out.println(gumballMachine);
gumballMachine.insertQuarter();
gumballMachine.turnCrank();
gumballMachine.insertQuarter();
gumballMachine.turnCrank();
System.out.println(gumballMachine);
gumballMachine.insertQuarter();
gumballMachine.turnCrank();
gumballMachine.insertQuarter();
gumballMachine.turnCrank();
System.out.println(gumballMachine);
}
}
|
[
"[email protected]"
] | |
db041ba10280526203602745194736e81e24da2c
|
db8a51998bf751cac0017b0b96a5cbe68d838e53
|
/HearthStone/src/capacite/Invocation.java
|
7070223d3b900389b8a983bdd4a6d01b2e312c6e
|
[] |
no_license
|
Aniki02/Projet_HearthStone
|
9719f332c8bbc83dbd134d04329b56534bbfcc72
|
0ae28948682446ca02fa6eb3ee2df20ed22b4293
|
refs/heads/master
| 2020-03-13T07:59:10.550732 | 2018-05-22T10:02:34 | 2018-05-22T10:02:34 | 131,035,149 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 720 |
java
|
package capacite;
import carte.ICarte;
import plateau.IPlateau;
import plateau.Plateau;
public abstract class Invocation extends Capacite{
private String nom, description;
private ICarte carteInvoque;
/**
* @param nom
* @param description
*/
public Invocation(String nom, String description, ICarte carteInvoque) {
super(nom, description);
this.carteInvoque = carteInvoque;
}
public void executerEffetMiseEnJeu(Object cible) {
// TODO Auto-generated method stub
IPlateau p = Plateau.getInstance();
p.getJoueurCourant().jouerCarte(carteInvoque);
}
public ICarte getCarte() {
return carteInvoque;
}
public String toString() {
return "Capacite ["+nom+" : "+description+"]";
}
}
|
[
"[email protected]"
] | |
b40770cd34239d1f01fd7a6dd4e99ce9d0dbbd1a
|
16442546359750bd0f33ff0a92ef0900f600b068
|
/RecuperacionEval/EjerciciosRecuperacion/PPTijerasSharedPref/app/src/main/java/com/example/pptijerassharedpref/ResultadosActivity.java
|
41b932965fc6748e319907220d18b6d3e0fa9aba
|
[] |
no_license
|
dianbero/Programacion-de-Dispositivos-Moviles
|
fb5adc60e4f2345023a60acd1a569fbcc09e9057
|
cf6be82bf06231ebdb41be9a34d0f319c1a1acc1
|
refs/heads/master
| 2021-07-17T18:16:01.490403 | 2020-09-17T11:17:25 | 2020-09-17T11:17:25 | 212,861,036 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,530 |
java
|
package com.example.pptijerassharedpref;
import androidx.appcompat.app.AppCompatActivity;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelStoreOwner;
import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.widget.TextView;
import com.example.pptijerassharedpref.ViewModels.ResultadosActivityVM;
import java.util.PriorityQueue;
public class ResultadosActivity extends AppCompatActivity {
private TextView ptoPiedraGanado, ptoPapelGanado, ptoTijerasGanado;
private ResultadosActivityVM vm;
private int ptoPiedra, ptoPapel, ptoTijeras;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_resultados);
ptoPiedraGanado = findViewById(R.id.ptoPiedraGanado);
ptoPapelGanado = findViewById(R.id.ptoPapelGanado);
ptoTijerasGanado = findViewById(R.id.ptoTijerasGanado);
//Instancio VM
vm = new ViewModelProvider(this).get(ResultadosActivityVM.class);
SharedPreferences sharedPreferences = getSharedPreferences("archivo", Context.MODE_PRIVATE);
// SharedPreferences.Editor editor = sharedPreferences.edit();
int piedra = sharedPreferences.getInt("ptoPiedra", 0);
int papel = sharedPreferences.getInt("ptoPapel", 0);
int tijeras = sharedPreferences.getInt("ptoTijeras", 0);
// ptoPiedraGanado.setText(Integer.toString(piedra));
// ptoPapelGanado.setText(Integer.toString(papel));
// ptoTijerasGanado.setText(Integer.toString(tijeras));
vm.setPtosPiedraGanados(piedra);
vm.setPtosPapelGanados(papel);
vm.setPtosTijerasGanados(tijeras);
//
// Cosas comentadas a ignorar:
//
// Obtengo los datos de la actividad anterior
// ptoPiedra = getIntent().getIntExtra("ptosPiedra", 0);
// ptoPapel = getIntent().getIntExtra("ptosPapel", 0);
// ptoTijeras = getIntent().getIntExtra("ptosTijeras", 0);
// ptoPiedraGanado.setText(Integer.toString(ptoPiedra)); //Si lo dejo así no se me pierde el valor al girarlo
//Paso los valores obtenidos al VM
// vm.setPtosPiedraGanados(ptoPiedra);
// vm.setPtosPapelGanados(ptoPapel);
// vm.setPtosTijerasGanados(ptoTijeras);
final Observer<Integer> resultadoObserverPiedra = new Observer<Integer>() {
@Override
public void onChanged(Integer integer) {
ptoPiedraGanado.setText(Integer.toString(integer));
}
};
vm.getPtosPiedraGanados().observe(this, resultadoObserverPiedra);
final Observer<Integer> resultadoOberverPapel = new Observer<Integer>() {
@Override
public void onChanged(Integer integer) {
ptoPapelGanado.setText(Integer.toString(integer));
}
};
vm.getPtosPapelGanados().observe(this, resultadoOberverPapel);
final Observer<Integer> resultadoOberverTijeras = new Observer<Integer>() {
@Override
public void onChanged(Integer integer) {
ptoTijerasGanado.setText(Integer.toString(integer));
}
};
vm.getPtosTijerasGanados().observe(this, resultadoOberverTijeras);
}
}
|
[
"[email protected]"
] | |
f0b14899b8259688a5b5ea9a78f6550b6530c073
|
92846764643aadb97ba1d1e261a8c7372eb30993
|
/src/main/java/io/github/flooq/ShovelPartition.java
|
73a47cc67460a70dfa1c7a9f74b1a0654c101bca
|
[] |
no_license
|
pmackowski/flooq
|
a3790a35607a5b711db0fb3a75204aef5d36b49e
|
94098ec867b56418b1288126a70b7016e921eb75
|
refs/heads/master
| 2020-04-15T12:14:06.421560 | 2019-01-25T09:44:26 | 2019-01-25T09:44:26 | 164,665,916 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 597 |
java
|
package io.github.flooq;
import com.rabbitmq.client.Delivery;
import reactor.core.publisher.Flux;
import java.util.List;
import java.util.function.Function;
public interface ShovelPartition {
ShovelPartition inputExchange(String inputExchange);
ShovelPartition outputExchange(String outputExchange);
ShovelPartition outputExchange(String outputExchange, ExchangeType exchangeType);
ShovelPartition queue(String queue, int partitions);
ShovelPartition buckets(List<Integer> buckets);
ShovelPartition transform(Function<Flux<Delivery>,Flux<Delivery>> transform);
}
|
[
"[email protected]"
] | |
eb2494daa2f5effc2a75b110e82e8e5e4be1f7af
|
65e5da56b36b0e01fcd0ab68e9518280c46225c3
|
/Account.java
|
0142657ba88946b575952a937e8e1f6cd87eaba9
|
[] |
no_license
|
liamradley1/ATM
|
62c2587904f5dc31d5a60b754cbbd2ccdefd2d33
|
18ade7584e2588d880ecc883cda45da69705deb3
|
refs/heads/master
| 2022-09-03T17:42:37.405484 | 2020-05-27T15:59:17 | 2020-05-27T15:59:17 | 267,363,483 | 1 | 0 | null | 2020-05-27T15:59:19 | 2020-05-27T15:56:08 |
Java
|
UTF-8
|
Java
| false | false | 1,744 |
java
|
import java.util.ArrayList;
class Account {
private String name;
private double balance;
private String uuid;
private User holder;
private ArrayList<Transaction> transactionList;
public Account(String name, User holder, Bank bank){
this.name = name;
this.holder = holder;
this.uuid = bank.getNewAccountUUID();
this.transactionList = new ArrayList<Transaction>();
}
public String getUuid() {
return this.uuid;
}
public String getName() {
return this.name;
}
public User getHolder() {
return this.holder;
}
public ArrayList<Transaction> getTransactions() {
return this.transactionList;
}
public String getSummaryLine() {
double balance = this.getBalance();
if(this.balance >= 0) {
return String.format("%s : £%.2f : %s", this.uuid, balance, this.name);
}
else {
return String.format("%s : £(%.2f) : %s", this.uuid, -balance, this.name);
}
}
public double getBalance() {
double balance = 0;
for (Transaction t : this.transactionList) {
balance += t.getAmount();
}
return balance;
}
public void printTransHistory() {
System.out.printf("\nTransaction history for account %s\n", this.uuid);
for (int t = this.transactionList.size() - 1; t>=0; --t){
System.out.println(this.transactionList.get(t).getSummaryLine());
}
System.out.println();
}
public void addTransaction(double amount, String memo) {
Transaction transaction = new Transaction(amount, memo, this);
this.transactionList.add(transaction);
}
}
|
[
"[email protected]"
] | |
3660e404dbe9ab418f746adbeb1b5c5521e6eed8
|
c7d02e64d8449b818e83967b2835902dacc2d1bf
|
/src/test/java/be/dbmodelgen/tests/sql/testDB/TableCTable.java
|
6f6d1b46476771a5085a15ac940f8ec82a3a5ed4
|
[] |
no_license
|
espinard/dbModelGen
|
8b2234f4925723c2f6181dfcf49b75cd14f596e4
|
06dff637d23643364d290a5505f947a96804bd69
|
refs/heads/master
| 2021-03-12T20:37:20.586596 | 2013-08-23T17:44:28 | 2013-08-23T17:44:28 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,652 |
java
|
package be.dbmodelgen.tests.sql.testDB;
import org.dynamicschema.reification.columnconstraint.PrimaryKey;
import org.dynamicschema.reification.columnconstraint.ColumnConstraint;
import org.dynamicschema.reification.RelationMember;
import org.dynamicschema.reification.Table;
import org.dynamicschema.reification.Relation;
import org.dynamicschema.annotation.Role;
import org.dynamicschema.reification.columnconstraint.ForeignKey;
import org.dynamicschema.reification.ContextedTable;
import org.dynamicschema.reification.DBTable;
import org.dynamicschema.reification.Occurrence;
import org.dynamicschema.reification.RelationModel;
import org.dynamicschema.sql.RelationCondition;
import org.dynamicschema.sql.SqlCondition;
import java.util.Arrays;
import java.util.List;
import org.dynamicschema.reification.ColumnModel;
import org.dynamicschema.reification.Column;
//import static android.provider.BaseColumns._ID;
public class TableCTable extends DBTable {
public static final String NAME = "TableC";
public static class TableCColumns extends ColumnModel {
//tables column names
public static String _ID = "_id";
public static String RES__ID = "Res__id";
public static String DESCRIPTION = "Description";
public TableCColumns() {
//Restore import _ID when ready
setColumnsNames(Arrays.asList(_ID, RES__ID, DESCRIPTION));
setColumnsConstraints(Arrays.asList((ColumnConstraint) new PrimaryKey(Arrays.asList("_id")),
(ColumnConstraint)new ForeignKey(Arrays.asList("Res__id"),
"Restaurant",
Arrays.asList("_id")
)
));
}
}
public TableCTable(){
super (NAME, new TableCColumns());
}
}
|
[
"[email protected]"
] | |
7705c10adb3d649b4b6dad128683c39e01e715ee
|
a5ae6c2aea97af5c28124c0a39d5fd496c38c5a0
|
/src/main/java/br/com/zup/mercadolivre/outros/RankingNovaCompraForm.java
|
1417d9a7718968ff130d6250aa6f6b55abf4e6c8
|
[] |
no_license
|
jaacksonalves/ZUP_desafio-mercado-livre
|
8c27f18efff278f92c8b6946036f6f71cc24385d
|
ed553730864f6ee181a63fd5f852b0934e15af9f
|
refs/heads/master
| 2023-03-17T13:19:32.703310 | 2021-02-28T19:52:02 | 2021-02-28T19:52:02 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 521 |
java
|
package br.com.zup.mercadolivre.outros;
import javax.validation.constraints.NotNull;
public class RankingNovaCompraForm {
@NotNull
private Long idCompra;
@NotNull
private Long idVendedor;
public RankingNovaCompraForm(Long idCompra, Long idVendedor) {
this.idCompra = idCompra;
this.idVendedor = idVendedor;
}
@Override
public String toString() {
return "NovaCompraNFRequest [idCompra=" + idCompra + ", idComprador="
+ idVendedor + "]";
}
}
|
[
"[email protected]"
] | |
611d7dcd035df78891743aaf7c17e45e7c83bd54
|
835b912ff611b926d0376f553439f8b6dbba7eda
|
/src/main/java/com/company/TPMonitoreo/Repository/LogDao.java
|
e2ac93074f0daa01a9a1e9ad309c0c51cdfff1d3
|
[] |
no_license
|
GabrielAntinori92/TPMonitoreo
|
ccf14487086637b4e903865fcd976e1484c6bbaf
|
3b8ffa53e2627a4f97c32db184d7ec41e2861949
|
refs/heads/master
| 2020-03-15T00:08:01.090112 | 2018-05-02T22:49:00 | 2018-05-02T22:49:00 | 131,860,608 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 211 |
java
|
package com.company.TPMonitoreo.Repository;
import com.company.TPMonitoreo.Model.Log;
import org.springframework.data.jpa.repository.JpaRepository;
public interface LogDao extends JpaRepository<Log,Long> {
}
|
[
"[email protected]"
] | |
36cef1431b465b0d520fa9423bb2e10297621e92
|
d7c5121237c705b5847e374974b39f47fae13e10
|
/airspan.netspan/src/main/java/Netspan/NBI_16_5/Statistics/RsrpMeasurementRawGet.java
|
fb59a6ce49dfb76e5bd031d22bd9ee94450a376a
|
[] |
no_license
|
AirspanNetworks/SWITModules
|
8ae768e0b864fa57dcb17168d015f6585d4455aa
|
7089a4b6456621a3abd601cc4592d4b52a948b57
|
refs/heads/master
| 2022-11-24T11:20:29.041478 | 2020-08-09T07:20:03 | 2020-08-09T07:20:03 | 184,545,627 | 1 | 0 | null | 2022-11-16T12:35:12 | 2019-05-02T08:21:55 |
Java
|
UTF-8
|
Java
| false | false | 4,726 |
java
|
package Netspan.NBI_16_5.Statistics;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.datatype.XMLGregorianCalendar;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="NodeName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
* <element name="NodeId" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
* <element name="DateStart" type="{http://www.w3.org/2001/XMLSchema}dateTime"/>
* <element name="DateEnd" type="{http://www.w3.org/2001/XMLSchema}dateTime"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"nodeName",
"nodeId",
"dateStart",
"dateEnd"
})
@XmlRootElement(name = "RsrpMeasurementRawGet")
public class RsrpMeasurementRawGet {
@XmlElement(name = "NodeName")
protected List<String> nodeName;
@XmlElement(name = "NodeId")
protected List<String> nodeId;
@XmlElement(name = "DateStart", required = true)
@XmlSchemaType(name = "dateTime")
protected XMLGregorianCalendar dateStart;
@XmlElement(name = "DateEnd", required = true)
@XmlSchemaType(name = "dateTime")
protected XMLGregorianCalendar dateEnd;
/**
* Gets the value of the nodeName property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the nodeName property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getNodeName().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link String }
*
*
*/
public List<String> getNodeName() {
if (nodeName == null) {
nodeName = new ArrayList<String>();
}
return this.nodeName;
}
/**
* Gets the value of the nodeId property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the nodeId property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getNodeId().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link String }
*
*
*/
public List<String> getNodeId() {
if (nodeId == null) {
nodeId = new ArrayList<String>();
}
return this.nodeId;
}
/**
* Gets the value of the dateStart property.
*
* @return
* possible object is
* {@link XMLGregorianCalendar }
*
*/
public XMLGregorianCalendar getDateStart() {
return dateStart;
}
/**
* Sets the value of the dateStart property.
*
* @param value
* allowed object is
* {@link XMLGregorianCalendar }
*
*/
public void setDateStart(XMLGregorianCalendar value) {
this.dateStart = value;
}
/**
* Gets the value of the dateEnd property.
*
* @return
* possible object is
* {@link XMLGregorianCalendar }
*
*/
public XMLGregorianCalendar getDateEnd() {
return dateEnd;
}
/**
* Sets the value of the dateEnd property.
*
* @param value
* allowed object is
* {@link XMLGregorianCalendar }
*
*/
public void setDateEnd(XMLGregorianCalendar value) {
this.dateEnd = value;
}
}
|
[
"[email protected]"
] | |
e8e6874841ab78d2793ee87a161e601490d35483
|
e0891d4bd9af1d44bdf0aae49b0f768f2aae65d4
|
/src/main/java/pl/coderslab/betting/entity/Game.java
|
e967f336f7a902402a75691eab8d1b9dcc01c563
|
[] |
no_license
|
konmoc/betting24
|
ee830328e4e236d5441bdb3e1cc40e557460fa29
|
c32b46bea135749049b64892a0ba20f7e968302d
|
refs/heads/master
| 2020-03-19T02:20:19.010595 | 2018-06-08T10:48:05 | 2018-06-08T10:48:05 | 135,619,460 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,447 |
java
|
package pl.coderslab.betting.entity;
import lombok.Data;
import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.List;
/**This entity represents game. Each game has its date and time(LocalDateTime dateAndTime),
* list of players(List<Player> playersInGame) OR teams(List<Team> teamsInGame),
* list of ALL bets placed on this game(List<Bet> gameBets),
* result of game(private GameResult gameResult) created after the game is finished,
* type of video game which is played in this game(VideoGame videoGame),
* status("PLANNED", "STARTED" or "FINISHED"),
* win ratios of both sides calculated in the methods below(TRANSIENT!!!).
*/
@Entity
@Table(name = "games")
@Data
public class Game {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY )
private Long id;
private LocalDateTime dateAndTime;
@LazyCollection(LazyCollectionOption.FALSE)
@ManyToMany(cascade = {CascadeType.MERGE})
private List<Player> playersInGame;
@LazyCollection(LazyCollectionOption.FALSE)
@ManyToMany(cascade = {CascadeType.MERGE})
private List<Team> teamsInGame;
@OneToMany
private List<Bet> gameBets;
@OneToOne
private GameResult gameResult;
@OneToOne
private VideoGame videoGame;
private String status;
private double odd1;
private double odd2;
}
|
[
"[email protected]"
] | |
44b4191fea1c3269e05e039916cfedf91c601889
|
85f48afde4f702a6415b50c9cb642bb583c341fa
|
/app/src/main/java/com/baidu/android/voicedemo/activity/ActivityOffline.java
|
6663842f20814e2490ce736265c4c836b5f1e453
|
[] |
no_license
|
wziwen/Arithmetic
|
21a43b18008952b402c2ac4f9e8ee2790a6759a4
|
c9fd2d1d2789c767b8403d9bc50b88b280ada544
|
refs/heads/master
| 2021-01-23T20:05:26.726578 | 2017-09-08T16:57:19 | 2017-09-08T16:57:19 | 102,846,793 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,072 |
java
|
package com.baidu.android.voicedemo.activity;
import com.baidu.android.voicedemo.activity.setting.OfflineSetting;
import com.baidu.android.voicedemo.recognization.CommonRecogParams;
import com.baidu.android.voicedemo.recognization.offline.OfflineRecogParams;
/**
* 用于展示离线语法
*/
public class ActivityOffline extends ActivityRecog {
{
DESC_TEXT = "此Activity 展示离线语法识别功能。即自定义有限的短句进行离线识别。SDK没有任意词离线识别功能。。\n" +
" 看见下方日志中asr.loaded说明离线文件加载成功,在线识别说一句正常句子后,正式授权文件才会自动下载。\n" +
" 正式授权文件自动下载后,断网可以测试:\n" +
" 请大声说出: 打电话给李琦(离线)\n\n\n" +
"集成指南:" +
"如果集成后无法正常使用请检查正式授权文件问题:\n" +
" 1. 是否在开放平台对应应用绑定了包名,本demo的包名是com.baidu.speech.recognizerdemo," +
"定义在build.gradle文件中。\n" +
" 2. AndroidManifest.xml是否填写了正确的APP_ID APP_KEY 及 APP_SECRET\n" +
"\n其它提示:\n" +
" 1. 在加载离线引擎ASR_KWS_LOAD_ENGINE输入事件中的GRAMMER参数中设置bsg文件路径。此时如同时设置SLOT_DATA参数的会覆盖bsg文件中的同名词条。\n" +
"如果删除DEMO代码里的SLOT_DATA参数后, 您可以测试本DEMO里bsg文件自带的:“打电话给张三(离线)”\n" +
" 2. 卸载app后正式授权文件自动删除。\n" +
" 3. 自定义离线语法的bsg文件,在http://yuyin.baidu.com/asr 下载。\n " ;
enableOffline = true;
}
public ActivityOffline() {
super();
settingActivityClass = OfflineSetting.class;
}
@Override
protected CommonRecogParams getApiParams() {
return new OfflineRecogParams(this);
}
}
|
[
"[email protected]"
] | |
a4d34f5cd72bf9b826f760c9495dc9bfd707564c
|
ef712b2921b2b9db0ebe332fab8ffeb1544ed68d
|
/src/main/java/furgl/stupidThings/client/renderer/entity/RenderBlockBomb.java
|
926fec1c8fd1a4be2f43ad633d5a2ddb822a4057
|
[
"MIT"
] |
permissive
|
Furgl/Stupid-Things
|
d75d8ad7eaddd3cd7cc4356c9f5392e4a0ba85c4
|
2d74ee128a30dad58a09d043e9b95173cf2e2036
|
refs/heads/1.12
| 2021-01-13T15:28:34.146426 | 2020-09-02T15:59:04 | 2020-09-02T15:59:04 | 79,873,832 | 6 | 3 |
NOASSERTION
| 2020-06-14T10:38:40 | 2017-01-24T03:12:46 |
Java
|
UTF-8
|
Java
| false | false | 789 |
java
|
package furgl.stupidThings.client.renderer.entity;
import furgl.stupidThings.client.model.ModelBlockBomb;
import furgl.stupidThings.common.StupidThings;
import furgl.stupidThings.common.entity.EntityBlockBomb;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.util.ResourceLocation;
public class RenderBlockBomb extends RenderLiving<EntityBlockBomb> {
private static final ResourceLocation TEXTURE = new ResourceLocation(StupidThings.MODID+":textures/entity/block_bomb.png");
public RenderBlockBomb(RenderManager renderManagerIn) {
super(renderManagerIn, new ModelBlockBomb(), 0.4f);
}
@Override
protected ResourceLocation getEntityTexture(EntityBlockBomb entity) {
return TEXTURE;
}
}
|
[
"[email protected]"
] | |
1712852b76b28583d61057efeebc6ceceb17327b
|
fa33e5938f206549062227d537f933c9d0d1f964
|
/src/main/java/me/epicgodmc/epicvalues/utils/Util.java
|
0dff41fdcc91885bca7de553a28555da8793e6d9
|
[] |
no_license
|
EpicGodMC202/EpicValues
|
0b0ddb3002850f33776170f43ced5a0714d098ce
|
fb2027f0c3c311862149256a81857385f1764836
|
refs/heads/master
| 2022-04-17T02:09:53.847823 | 2020-03-12T22:31:02 | 2020-03-12T22:31:02 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 6,038 |
java
|
package me.epicgodmc.epicvalues.utils;
import me.epicgodmc.epicvalues.EpicValues;
import me.epicgodmc.epicvalues.GlobalValues;
import me.epicgodmc.epicvalues.objects.ValuePlayer;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import java.util.HashMap;
import java.util.List;
public class Util {
private EpicValues plugin = EpicValues.getInstance();
private MessageManager mm = plugin.mm;
public int getBaseValue(String identifier) {
return plugin.getConfig().getInt("baseValues." + identifier);
}
public boolean existsAsBaseValue(String identifier) {
return plugin.getConfig().isSet("baseValues." + identifier);
}
public int parseValue(String valueStr) {
int output;
try {
output = Integer.parseInt(valueStr);
} catch (NumberFormatException e) {
System.out.println("[EpicValues] an error occurred while parsing a value, Cause: " + e.getMessage());
return -1;
}
return output;
}
public int parseValue(CommandSender requester, String valueStr) {
int output;
try {
output = Integer.parseInt(valueStr);
} catch (NumberFormatException e) {
requester.sendMessage(mm.getMessage("notANumber"));
return -1;
}
return output;
}
public void runCommands(Player player, List<String> commands, int value, int valueChecked, String identifier) {
for (String cmd : commands) {
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), cmd
.replace("%value%", value + "")
.replace("%valuechecked%", valueChecked + "")
.replace("%identifier%", identifier)
.replace("%player%", player.getName()));
}
}
public void runCommands(List<String> commands, int value, int valueChecked, String identifier) {
for (String cmd : commands) {
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), cmd
.replace("%value%", value + "")
.replace("%valuechecked%", valueChecked + "")
.replace("%identifier%", identifier));
}
}
public boolean conditionMet(String identifier) {
GlobalValues globalValues = GlobalValues.getInstance();
int valueSpecified = plugin.getConfig().getInt("valueTriggers.global." + identifier + ".value");
String comparator = "=";
if (plugin.getConfig().isSet("valueTriggers.global." + identifier + ".type")) {
comparator = plugin.getConfig().getString("valueTriggers.global." + identifier + ".type");
}
if (comparator != null) {
switch (comparator) {
case "=":
if (globalValues.containsValue(identifier)) {
return globalValues.getValue(identifier) == valueSpecified;
} else return false;
case "<":
if (globalValues.containsValue(identifier)) {
return globalValues.getValue(identifier) < valueSpecified;
} else return false;
case ">":
if (globalValues.containsValue(identifier)) {
return globalValues.getValue(identifier) > valueSpecified;
} else return false;
case ">=":
if (globalValues.containsValue(identifier)) {
return globalValues.getValue(identifier) >= valueSpecified;
} else return false;
case "<=":
if (globalValues.containsValue(identifier)) {
return globalValues.getValue(identifier) <= valueSpecified;
} else return false;
default:
return false;
}
} else return false;
}
public boolean conditionMet(ValuePlayer valuePlayer, String identifier) {
String comparator = "=";
int valueSpecified = plugin.getConfig().getInt("valueTriggers.player." + identifier + ".value");
if (plugin.getConfig().isSet("valueTriggers.player." + identifier + ".type")) {
comparator = plugin.getConfig().getString("valueTriggers.global." + identifier + ".type");
}
if (comparator != null) {
switch (comparator) {
case "=":
if (valuePlayer.hasValue(identifier)) {
return valuePlayer.getValue(identifier) == valueSpecified;
} else return false;
case "<":
if (valuePlayer.hasValue(identifier)) {
return valuePlayer.getValue(identifier) < valueSpecified;
} else return false;
case ">":
if (valuePlayer.hasValue(identifier)) {
return valuePlayer.getValue(identifier) > valueSpecified;
} else return false;
case ">=":
if (valuePlayer.hasValue(identifier)) {
return valuePlayer.getValue(identifier) >= valueSpecified;
} else return false;
case "<=":
if (valuePlayer.hasValue(identifier)) {
return valuePlayer.getValue(identifier) <= valueSpecified;
} else return false;
default:
return false;
}
} else return false;
}
public HashMap<String, Integer> parseValues(List<String> serializedValues)
{
HashMap<String, Integer> parsed = new HashMap<>();
for (String str : serializedValues)
{
String[] split = str.split(":");
String id = split[0];
int value = parseValue(split[1]);
parsed.put(id, value);
}
return parsed;
}
}
|
[
"[email protected]"
] | |
8ea425a5729acfe9772d98c87264ec4e05133bad
|
378210a2901e49fbb5b2a154e61b7e4317d84aa8
|
/src/com/library/dao/CollectionDao.java
|
606e975f3a1cf5775182263b60c2a068e4536adf
|
[] |
no_license
|
github-zhanghang/LibrarySystem
|
d31380e52b1e0bb9d1299bae0b840f7d83b4e5f8
|
731b53c80a8d354291142ac5e8929c525c0eb011
|
refs/heads/master
| 2020-06-14T13:50:38.206659 | 2017-05-04T11:32:43 | 2017-05-04T11:32:43 | 75,174,968 | 2 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,920 |
java
|
package com.library.dao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import com.library.bean.BookDetailBean;
import com.library.bean.CollectionBean;
import com.library.bean.ReaderBean;
import com.library.util.DBUtil;
import com.library.util.TableUtill;
public class CollectionDao {
private Connection mConnection;
private PreparedStatement mStatement;
private ResultSet mResultSet;
/**
* 获取读者的收藏记录
*
* @param readerAccount
* 读者账号
* @return 收藏对象集合
*/
public List<CollectionBean> getCollectionRecord(String readerAccount) {
List<CollectionBean> collectionList = new ArrayList<CollectionBean>();
mConnection = DBUtil.getConnection();
String sql = "select * from " + TableUtill.TABLE_NAME_COLLECTION
+ " where ReaderAccount=?";
try {
mStatement = mConnection.prepareStatement(sql);
mStatement.setString(1, readerAccount);
mResultSet = mStatement.executeQuery();
while (mResultSet.next()) {
String collectionId = mResultSet.getString(1);
String bookName = mResultSet.getString(3);
String borrowTime = mResultSet.getString(4);
ReaderBean readerInfo = new ReaderDao()
.getReaderByAccount(readerAccount);
BookDetailBean bookInfo = new BookDao().getBookByName(
bookName).get(0);
collectionList.add(new CollectionBean(collectionId, readerInfo,
bookInfo, borrowTime));
}
} catch (SQLException e) {
e.printStackTrace();
} finally {
DBUtil.close(mStatement, mConnection, mResultSet);
}
return collectionList;
}
/**
* 判断是否已收藏该书
*
* @param readerId
* 读者账号
* @param bookName
* 书名
* @return 是否收藏
*/
public boolean isCollected(String readerId, String bookName) {
boolean isCollected = false;
mConnection = DBUtil.getConnection();
String sql = "select * from " + TableUtill.TABLE_NAME_COLLECTION
+ " where ReaderID=? and BookName=?";
try {
mStatement = mConnection.prepareStatement(sql);
mStatement.setString(1, readerId);
mStatement.setString(2, bookName);
mResultSet = mStatement.executeQuery();
if (mResultSet.next()) {
isCollected = true;
}
} catch (SQLException e) {
e.printStackTrace();
} finally {
DBUtil.close(mStatement, mConnection, mResultSet);
}
return isCollected;
}
/**
* 添加收藏记录
*
* @param readerId
* 读者账号
* @param bookNames
* 收藏的书籍名称集合
* @return 是否添加成功
*/
public boolean addCollection(String readerId, String bookName) {
boolean isSuccess = false;
mConnection = DBUtil.getConnection();
String sql = "insert into " + TableUtill.TABLE_NAME_COLLECTION
+ "(ReaderID,BookName) values(?,?)";
try {
mStatement = mConnection.prepareStatement(sql);
mStatement.setString(1, readerId);
mStatement.setString(2, bookName);
int lines = mStatement.executeUpdate();
if (lines == 1) {
isSuccess = true;
}
} catch (SQLException e) {
e.printStackTrace();
} finally {
DBUtil.close(mStatement, mConnection, mResultSet);
}
return isSuccess;
}
/**
* 删除一条收藏记录
*
* @param collectionId
* @return
*/
public boolean deleteCollection(String collectionId) {
boolean isSuccess = false;
mConnection = DBUtil.getConnection();
try {
String sql = "delete from " + TableUtill.TABLE_NAME_COLLECTION
+ " where CollectionID=?";
mStatement = mConnection.prepareStatement(sql);
mStatement.setString(1, collectionId);
int lines = mStatement.executeUpdate();
if (lines == 1) {
isSuccess = true;
}
} catch (SQLException e) {
e.printStackTrace();
} finally {
DBUtil.close(mStatement, mConnection, mResultSet);
}
return isSuccess;
}
}
|
[
"[email protected]"
] | |
1a8749c47439e10c1f141c0ff50788009ad38ae7
|
7c455087b776c55d014bf9cdd5804739b1fec3fa
|
/src/Day23_Arrays_Started/ArrayToString.java
|
0cab3cd34abcee5fd11b78cdad48bf16c9f4ab2f
|
[] |
no_license
|
Mrbaku/MrBaku
|
6e9829619d4f619cb1acdf34567d34c2f143abf0
|
b3678ccadbce0ce105c89dba46c1117733dd62ce
|
refs/heads/master
| 2020-05-18T09:35:12.966828 | 2019-05-29T22:22:36 | 2019-05-29T22:22:36 | 184,328,220 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 274 |
java
|
package Day23_Arrays_Started;
public class ArrayToString {
public static void main(String[] args) {
// TODO Auto-generated method stub
String [] names = new String[5];
String [] names2 = {"Shaun" , "Vlad" , "Orhan", "Maria"};
System.out.println(names2[3]);
}
}
|
[
"[email protected]"
] | |
655b5e18d981b62a60c01df86a20a5a69b6155fa
|
4d86ef86bfbf1419d63b7ab82226f8befbe2ae84
|
/src/main/java/com/springBootD/framework/constant/tips/SuccessTip.java
|
49c246e2ed283e91eac23a3cc37113b32234ec20
|
[] |
no_license
|
ilaotan/springBootD
|
8db7ad67451bb8dcc2c6416def00ea5a3e633f3c
|
d99712b321d65b2bfd520f1a71a6987289330edb
|
refs/heads/master
| 2020-04-07T00:05:25.845275 | 2017-08-30T01:11:53 | 2017-08-30T01:11:53 | 47,492,277 | 0 | 0 | null | 2017-08-30T01:12:09 | 2015-12-06T10:30:30 |
Java
|
UTF-8
|
Java
| false | false | 212 |
java
|
package com.springBootD.framework.constant.tips;
/**
* 返回给前台的成功提示
*/
public class SuccessTip extends Tip{
public SuccessTip(){
super.code = 200;
super.message = "操作成功";
}
}
|
[
"[email protected]"
] | |
f47e72b4f47d2d2ffc3ad02ff3d2b160b7d95f0a
|
085239b995406cbcce9e86651567fb80af1d56b1
|
/src/main/java/com/example/algorithm/linkedList/OddEvenLinkedList.java
|
d379e84be5c4d330a2db02925261563c44adf891
|
[] |
no_license
|
chankibiswas/algorithm
|
83b980168cef41aba0b58a369a8c26f8689d4cd7
|
32e6b5ef2d618aba260eb7ce1adbf30fe51ec0f4
|
refs/heads/master
| 2023-08-29T04:56:30.984903 | 2021-11-08T07:57:42 | 2021-11-08T07:57:59 | 294,657,374 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,094 |
java
|
package com.example.algorithm.linkedList;
/*
Given the head of a singly linked list, group all the nodes with odd indices together followed by the nodes with even
indices, and return the reordered list.
The first node is considered odd, and the second node is even, and so on.
Note that the relative order inside both the even and odd groups should remain as it was in the input.
You must solve the problem in O(1) extra space complexity and O(n) time complexity.
*
Input: head = [1,2,3,4,5]
Output: [1,3,5,2,4]
*
Input: head = [2,1,3,5,6,4,7]
Output: [2,3,6,7,1,5,4]
*/
public class OddEvenLinkedList {
public ListNode oddEvenList(final ListNode head) {
if (head == null) {
return null;
}
ListNode odd = head;
ListNode even = head.next;
final ListNode evenHead = even;
while (odd != null && even != null && even.next != null) {
odd.next = even.next;
odd = odd.next;
even.next = odd.next;
even = even.next;
}
odd.next = evenHead;
return head;
}
}
|
[
"[email protected]"
] | |
4a9d7c01fe0ad683c22fc5edfcfd304a8320670b
|
f9c64ed74b5cd104a79412ea0432dd95e78b19e3
|
/src/main/java/duke/command/SorryCommand.java
|
29d9813db0ed963e8c5268d27b3224aca2b8bd63
|
[] |
no_license
|
jialerk/ip
|
3ca7f82aa5b9a81b7b9215a31060cdae68ae6653
|
ef66d7f8d80fe3847dcf09c51c62372b0794cc80
|
refs/heads/master
| 2022-12-21T23:50:54.697759 | 2020-10-02T14:20:33 | 2020-10-02T14:20:33 | 288,486,566 | 0 | 0 | null | 2020-09-25T07:22:18 | 2020-08-18T14:59:11 |
Java
|
UTF-8
|
Java
| false | false | 587 |
java
|
package duke.command;
import duke.tasks.TaskList;
import duke.ui.Ui;
/**
* Allows the printing of an error line if the user did not input correctly
*/
public class SorryCommand extends ExecuteCommand {
/**
* Prints an error if the user fails to input correctly
* @param taskList nil
*/
@Override
public void execute(TaskList taskList){
Ui.printError();
}
/**
* Checks whether the the user exits the program
* @return <code>true</code> if user exits the program
*/
public boolean isExit(){
return false;
}
}
|
[
"[email protected]"
] | |
ee721afbcf33446500a295c9877f726dac987fc0
|
3faadfd7e3c8dd17042c61974a4822feb826909b
|
/CrazyChatParent/parent/user/src/main/java/com/crazychat/user/controller/BaseExceptionHandler.java
|
c5da34b09d32267ddb508861b823d568622b06c3
|
[] |
no_license
|
JackMaXiaoLong/CrazyChat
|
a14abb23e248d29d7b14c0cf56ada1f4f63fd68a
|
1cf14817e15ece4fdc77df600d52d51fa1387961
|
refs/heads/master
| 2020-05-14T16:58:16.495419 | 2019-03-30T13:02:39 | 2019-03-30T13:02:39 | 181,884,237 | 1 | 0 | null | 2019-04-17T12:13:05 | 2019-04-17T12:13:05 | null |
UTF-8
|
Java
| false | false | 629 |
java
|
package com.crazychat.user.controller;
import com.crazychat.common.entity.Result;
import com.crazychat.common.entity.StatusCode;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* 统一异常处理类
*/
@ControllerAdvice
public class BaseExceptionHandler {
@ExceptionHandler(value = Exception.class)
@ResponseBody
public Result error(Exception e) {
e.printStackTrace();
return new Result(false, StatusCode.ERROR.getCode(), e.getMessage());
}
}
|
[
"[email protected]"
] | |
b9021f91f5fc60704db6fae193a8f1a17ee53b6a
|
e8157f23a8e8f87c68ff9471d9e6a59fcc9643d8
|
/src/main/java/com/example/demo/service/EmployeService.java
|
5836053b19b5aeb63f99a25bf4944815a1923b78
|
[] |
no_license
|
fedilahbib/spring-TIMESHEET
|
a2e661ccf483ab22f3c6b1240387de973a2ab4d3
|
3253769e790eaa68dc5d0123ee1030659948e9ee
|
refs/heads/main
| 2023-02-18T18:52:20.015505 | 2021-01-21T23:13:04 | 2021-01-21T23:13:04 | 331,764,691 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 610 |
java
|
package com.example.demo.service;
import java.util.List;
import com.example.demo.entity.Contrat;
import com.example.demo.entity.Employe;
import com.example.demo.repository.EmployeRepository;
public interface EmployeService {
public int ajouterEmploye(Employe employe);
public void affecterEmployeADepartement(int employeId, int depId);
public int ajouterContrat(Contrat contrat);
public void affecterContratAEmploye(int contratId, int employeId);
public String getEmployePrenomById(int employeId);
public long getNombreEmployeJPQL();
public List<String> getAllEmployeNamesJPQL();
}
|
[
"[email protected]"
] | |
cb2b4fccb3ac378ab4a9cde2e6b4e954cd3a4302
|
b30efdee2f8cfb711ed92906e58dffd425a9c7f6
|
/app/src/main/java/com/creative/dongsung/app/util/KeyValueArrayAdapter.java
|
fedca0c619f863d6d3839d3b43b3e0c41ca9e4ea
|
[] |
no_license
|
mlovesm/SJSF-dongsung
|
45040a325c0e6f11db289a3f836c175313136df8
|
c2e4753544412b5d0c6b957026bc7f3276e2c894
|
refs/heads/master
| 2021-09-09T12:35:05.018149 | 2018-03-16T05:39:25 | 2018-03-16T05:39:25 | 114,828,359 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 6,220 |
java
|
/*
* Copyright 2012 CREADOR GRANOESTE<[email protected]>
*
* 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.creative.dongsung.app.util;
import java.util.List;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
/**
* Key and Value Array Adapter
*
* @param <T>
*/
public class KeyValueArrayAdapter extends ArrayAdapter<KeyValueArrayAdapter.KeyValue> {
/**
* Key and Value
*/
public class KeyValue {
public String key;
public String value;
/**
* @param key
* @param value
*/
public KeyValue(final String key, final String value) {
super();
this.key = key;
this.value = value;
}
}
/**
* @param context
* @param resource
* @param textViewResourceId
* @param objects
*/
public KeyValueArrayAdapter(final Context context, final int resource,
final int textViewResourceId,
final KeyValue[] objects) {
super(context, resource, textViewResourceId, objects);
}
/**
* @param context
* @param resource
* @param textViewResourceId
* @param objects
*/
public KeyValueArrayAdapter(final Context context, final int resource,
final int textViewResourceId,
final List<KeyValue> objects) {
super(context, resource, textViewResourceId, objects);
}
/**
* @param context
* @param resource
* @param textViewResourceId
*/
public KeyValueArrayAdapter(final Context context, final int resource,
final int textViewResourceId) {
super(context, resource, textViewResourceId);
}
/**
* @param context
* @param textViewResourceId
* @param objects
*/
public KeyValueArrayAdapter(final Context context, final int textViewResourceId,
final KeyValue[] objects) {
super(context, textViewResourceId, objects);
}
/**
* @param context
* @param textViewResourceId
* @param objects
*/
public KeyValueArrayAdapter(final Context context, final int textViewResourceId,
final List<KeyValue> objects) {
super(context, textViewResourceId, objects);
}
/**
* @param context
* @param textViewResourceId
*/
public KeyValueArrayAdapter(final Context context, final int textViewResourceId) {
super(context, textViewResourceId);
}
/**
* Change the string value of the TextView with the value of the KeyValue.
*/
@Override
public View getView(final int position, final View convertView, final ViewGroup parent) {
final TextView view = (TextView) super.getView(position, convertView, parent);
view.setText(getItem(position).value);
return view;
}
/**
* Change the string value of the TextView with the value of the KeyValue.
*/
@Override
public View getDropDownView(final int position, final View convertView, final ViewGroup parent) {
final TextView view = (TextView) super.getDropDownView(position, convertView, parent);
view.setText(getItem(position).value);
return view;
}
/**
* Set the specified Collection at the array.
*
* @param keys
* @param vaules
*/
public void setKeyValue(final String[] keys, final String[] vaules) {
if (keys.length != vaules.length) {
throw new RuntimeException("The length of keys and values is not in agreement.");
}
final int N = keys.length;
for (int i = 0; i < N; i++) {
add(new KeyValue(keys[i], vaules[i]));
}
}
/**
* Set the specified Collection at the array.
*
* @param keysVaules
*/
public void setKeyValue(final String[][] keysVaules) {
final int N = keysVaules.length;
for (int i = 0; i < N; i++) {
add(new KeyValue(keysVaules[i][0], keysVaules[i][1]));
}
}
private String[] entries;
private String[] entryValues;
/**
* Set the specified Collection at the array.
*
* @param entries
*/
public void setEntries(final String[] entries) {
this.entries = entries;
if (entryValues != null) {
setKeyValue(entryValues, entries);
}
}
/**
* Set the specified Collection at the array.
*
* @param entryValues
*/
public void setEntryValues(final String[] entryValues) {
this.entryValues = entryValues;
if (entries != null) {
setKeyValue(entryValues, entries);
}
}
/**
* Get the value of the KeyValue with the specified position in the data set.
*
* @param position
* @return
*/
public String getValue(final int position) {
return getItem(position).value;
}
/**
* Get the key of the KeyValue with the specified position in the data set.
*
* @param position
* @return
*/
public String getKey(final int position) {
return getItem(position).key;
}
/**
* Get the entry of the KeyValue with the specified position in the data set.
*
* @param position
* @return
*/
public String getEntry(final int position) {
return getValue(position);
}
/**
* Get the entry value of the KeyValue with the specified position in the data set.
*
* @param position
* @return
*/
public String getEntryValue(final int position) {
return getKey(position);
}
}
|
[
"[email protected]"
] | |
359c58cfec47dda08c01bd199b6126a61fc00486
|
121fdfd5f27c8e72ba8eaba4d6fc8b1f9d9b6ea8
|
/tags/STRUTS_1_1_RC1/src/java/org/apache/commons/dbcp/PoolableConnection.java
|
2eef977077f8cca54437dd1737e6b586de495306
|
[
"Apache-1.1"
] |
permissive
|
SRIKAZQY/apache-commons-dbcp
|
2a970cf95a1179d039329281a338b2df83843979
|
c98566f4755b4b636b438057d3e965ce3f33c0c9
|
refs/heads/master
| 2021-01-18T12:48:05.824510 | 2015-01-18T18:59:59 | 2015-01-18T18:59:59 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 4,847 |
java
|
/*
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//dbcp/src/java/org/apache/commons/dbcp/PoolableConnection.java,v 1.5 2002/11/01 15:27:21 rwaldhoff Exp $
* $Revision: 1.5 $
* $Date: 2002/11/01 15:27:21 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999-2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact [email protected].
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package org.apache.commons.dbcp;
import java.sql.Connection;
import java.sql.SQLException;
import org.apache.commons.pool.ObjectPool;
/**
* A delegating connection that, rather than closing the underlying
* connection, returns itself to an {@link ObjectPool} when
* closed.
*
* @author Rodney Waldhoff
* @author Glenn L. Nielsen
* @author James House (<a href="mailto:[email protected]">[email protected]</a>)
* @version $Id: PoolableConnection.java,v 1.5 2002/11/01 15:27:21 rwaldhoff Exp $
*/
public class PoolableConnection extends DelegatingConnection {
/** The pool to which I should return. */
protected ObjectPool _pool = null;
/**
*
* @param conn my underlying connection
* @param pool the pool to which I should return when closed
*/
public PoolableConnection(Connection conn, ObjectPool pool) {
super(conn);
_pool = pool;
}
/**
*
* @param conn my underlying connection
* @param pool the pool to which I should return when closed
* @param config the abandoned configuration settings
*/
public PoolableConnection(Connection conn, ObjectPool pool,
AbandonedConfig config) {
super(conn, config);
_pool = pool;
}
/**
* Returns me to my pool.
*/
public void close() throws SQLException {
if(isClosed()) {
throw new SQLException("Already closed.");
} else {
try {
_pool.returnObject(this);
} catch(SQLException e) {
throw e;
} catch(RuntimeException e) {
throw e;
} catch(Exception e) {
throw new SQLException(e.toString());
}
}
}
/**
* Actually close my underlying {@link Connection}.
*/
public void reallyClose() throws SQLException {
_conn.close();
}
}
|
[
"bayard@13f79535-47bb-0310-9956-ffa450edef68"
] |
bayard@13f79535-47bb-0310-9956-ffa450edef68
|
7aad28b4212a0f0e87471cb4fc3927ebda8ea4cc
|
a1c45c1815b8e092f58146cba73adb41d4976225
|
/rule-examples/src/main/java/com/solibri/smc/api/examples/effectivecoveragearearule/visibility/Edge.java
|
d409428e5b050c5d5457d860e1ba5ca9bd0a1b0d
|
[
"MIT"
] |
permissive
|
seb-esser/api-examples
|
69e609813fbfe359eeea0e3c4310212ab93b7a8c
|
9795b5d0ac438d27ea505b6ec08260037fe42dfa
|
refs/heads/master
| 2023-06-27T23:38:55.458746 | 2021-07-26T05:36:13 | 2021-07-26T05:36:13 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,396 |
java
|
package com.solibri.smc.api.examples.effectivecoveragearearule.visibility;
import java.util.Objects;
class Edge<T> {
final Vertex<T> source;
final Vertex<T> destination;
final double weight;
Edge(Vertex<T> source, Vertex<T> destination) {
this(source, destination, 0);
}
Edge(Vertex<T> source, Vertex<T> destination, double weight) {
this.source = source;
this.destination = destination;
this.weight = weight;
}
T getSource() {
return source.getPayload();
}
T getDestination() {
return destination.getPayload();
}
/*
* Retrieves the other one of the vertices. If given source, it will return
* destination and if given destination, it will return source.
*/
T getOther(T v) {
if (source.getPayload().equals(v)) {
return destination.getPayload();
} else if (destination.getPayload().equals(v)) {
return source.getPayload();
}
throw new IllegalArgumentException(v + " is not the value at either vertex connected to this edge");
}
@Override
public int hashCode() {
return Objects.hash(source, destination);
}
@Override
public boolean equals(Object other) {
if (!(other instanceof Edge)) {
return false;
}
Edge<?> otherEdge = (Edge<?>) other;
return source.equals(otherEdge.source) && destination.equals(otherEdge.destination);
}
@Override
public String toString() {
return "Edge: " + source + ", " + destination;
}
}
|
[
"[email protected]"
] | |
ad7461fb1bc4dc56eaa804c430ef4a640a493252
|
9eb04aa9253d089f589da6c64351e00ac8f459b1
|
/src/adan_rodriguez/laboratorio14/L14E2.java
|
80426ed4bdfaa7e888080493721daca0cc4a0eb0
|
[] |
no_license
|
IsaiGalarza/sdetjunio2021
|
4451406d046adbfbd6e1598db31af09a440648cd
|
d9deff96c0da25fc549fa000f04adfba8fcf801a
|
refs/heads/main
| 2023-08-02T18:29:10.856717 | 2021-09-20T00:16:03 | 2021-09-20T00:16:03 | 408,265,566 | 0 | 0 | null | null | null | null |
ISO-8859-10
|
Java
| false | false | 705 |
java
|
package adan_rodriguez.laboratorio14;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Set;
public class L14E2 {
public static void main(String[] args) {
Hashtable<Integer, String> htPaises = new Hashtable<>();
htPaises.put(1, "ARGENTINA");
htPaises.put(2, "PERU");
htPaises.put(3, "BOLIVIA");
htPaises.put(0, "ARGELIA");
htPaises.put(100, "ESPAŅA");
System.out.println("-------------------------");
// iterar
Set<Integer> llaves = htPaises.keySet();
Iterator<Integer> it = llaves.iterator();
Integer key = 0;
while (it.hasNext()) {
key = it.next();
System.out.println("Llave: " + key + " Valor: " + htPaises.get(key).toString());
}
}
}
|
[
"[email protected]"
] | |
2a866a33085e48ff56631e275e9f84714c3f0d5d
|
b336d7065caf63b60dc928f02f948f7ab9f998c9
|
/app/src/main/java/apps/steve/fire/randomchat/base/usecase/UseCaseHandler.java
|
b2002a7225cc69ad3f55416f75086e548a11847b
|
[] |
no_license
|
kikerojash/AnonymousPosts
|
87d5e713dad794e34b4df9b20d20150669c1981c
|
7939323405f336364398649f1bace4aaf01c54b1
|
refs/heads/master
| 2021-09-01T00:37:11.881883 | 2017-12-23T21:27:53 | 2017-12-23T21:27:53 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,848 |
java
|
package apps.steve.fire.randomchat.base.usecase;
public class UseCaseHandler {
private static UseCaseHandler INSTANCE;
private final UseCaseScheduler mUseCaseScheduler;
public UseCaseHandler(UseCaseScheduler useCaseScheduler) {
mUseCaseScheduler = useCaseScheduler;
}
public <T extends UseCase.RequestValues, R extends UseCase.ResponseValue> void execute(
final UseCase<T, R> useCase, T values, UseCase.UseCaseCallback<R> callback) {
useCase.setRequestValues(values);
useCase.setUseCaseCallback(new UiCallbackWrapper(callback, this));
// The network request might be handled in a different thread so make sure
// Espresso knows
// that the app is busy until the response is handled.
EspressoIdlingResource.increment(); // App is busy until further notice
mUseCaseScheduler.execute(new Runnable() {
@Override
public void run() {
useCase.run();
// This Callback may be called twice, once for the cache and once for loading
// the data from the server API, so we check before decrementing, otherwise
// it throws "Counter has been corrupted!" exception.
if (!EspressoIdlingResource.getIdlingResource().isIdleNow()) {
EspressoIdlingResource.decrement(); // Set app as idle.
}
}
});
}
public <V extends UseCase.ResponseValue> void notifyResponse(final V response,
final UseCase.UseCaseCallback<V> useCaseCallback) {
mUseCaseScheduler.notifyResponse(response, useCaseCallback);
}
private <V extends UseCase.ResponseValue> void notifyError(
final UseCase.UseCaseCallback<V> useCaseCallback) {
mUseCaseScheduler.onError(useCaseCallback);
}
private static final class UiCallbackWrapper<V extends UseCase.ResponseValue> implements
UseCase.UseCaseCallback<V> {
private final UseCase.UseCaseCallback<V> mCallback;
private final UseCaseHandler mUseCaseHandler;
public UiCallbackWrapper(UseCase.UseCaseCallback<V> callback,
UseCaseHandler useCaseHandler) {
mCallback = callback;
mUseCaseHandler = useCaseHandler;
}
@Override
public void onSuccess(V response) {
mUseCaseHandler.notifyResponse(response, mCallback);
}
@Override
public void onError() {
mUseCaseHandler.notifyError(mCallback);
}
}
public static UseCaseHandler getInstance() {
if (INSTANCE == null) {
INSTANCE = new UseCaseHandler(new UseCaseThreadPoolScheduler());
}
return INSTANCE;
}
}
|
[
"[email protected]"
] | |
806155882690176041155fe1f9a8cb1d70015c45
|
719f02c895ac4afd1e79c0d5992f56d0c66108bf
|
/src/test/java/br/com/ll/ecommerce/ECommerceApplicationTests.java
|
e10766760899363102bfa98f79e7e8191e30e062
|
[] |
no_license
|
luangrasser/e-commerce
|
8bc36c450db02a4aaae19dc0e08f3a2844f9b409
|
29a017a0b0d11be8cd2da76fb5fb7225d31491c6
|
refs/heads/master
| 2022-10-30T15:31:14.438343 | 2020-06-23T00:02:08 | 2020-06-23T00:02:08 | 269,219,086 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 214 |
java
|
package br.com.ll.ecommerce;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class ECommerceApplicationTests {
@Test
void contextLoads() {
}
}
|
[
"[email protected]"
] | |
ccbc9c80e2bc7fa94fe46d195bb52e6017736d7c
|
46a9759df8a69b3a86d04976da5a9340ee6560c9
|
/app/src/main/java/com/fromscratch/mine/bookclub/Adapters/BooksListAdapter.java
|
3d37fd93da0886c9dfccef98d9a41594459f8e6b
|
[] |
no_license
|
ahmedsabrymohamed/BookClubChat
|
0934bcad102fc9d6559f1903290cdedeeb5f5c54
|
33243102fdb074f56d4aaa6f073ce4ae8c0ec34e
|
refs/heads/master
| 2021-09-12T02:06:53.049256 | 2018-04-13T15:14:45 | 2018-04-13T15:14:45 | 123,845,361 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 4,417 |
java
|
package com.fromscratch.mine.bookclub.Adapters;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.fromscratch.mine.bookclub.Classes.BookClub;
import com.fromscratch.mine.bookclub.R;
import java.util.ArrayList;
import java.util.HashMap;
public class BooksListAdapter extends RecyclerView.Adapter<BooksListAdapter.BookClubViewHolder> {
private ArrayList<BookClub> bookClubs;
private HashMap<String, BookClub> bookClubsSelected;
private SetOncLickListener listener;
private Context context;
public BooksListAdapter(Context context, SetOncLickListener listener) {
this.listener = listener;
this.context = context;
this.bookClubs = new ArrayList<>();
bookClubsSelected = new HashMap<>();
}
@Override
public BookClubViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
LayoutInflater inflater = LayoutInflater.from(parent.getContext());
View root = inflater.inflate(R.layout.bookclub_item, parent, false);
return new BookClubViewHolder(root);
}
@Override
public void onBindViewHolder(final BookClubViewHolder holder, final int position) {
holder.bookType.setText(bookClubs.get(position).getBookType());
holder.bookName.setText(bookClubs.get(position).getBookName());
if (bookClubs.get(position).isSelected())
holder.checkbook.setImageDrawable(context.getDrawable(R.mipmap.books));
else
holder.checkbook.setImageDrawable(context.getDrawable(R.mipmap.books_unse));
holder.checkbook.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
BookClub bookClub =
bookClubs.get(position);
if (!bookClub.isSelected()) {
bookClub.setSelected(true);
holder.checkbook.setImageDrawable(context.getDrawable(R.mipmap.books));
bookClubsSelected.put(bookClub.getClubId(), bookClub);
listener.OnSelectChange(bookClubsSelected);
} else {
bookClub.setSelected(false);
holder.checkbook.setImageDrawable(context.getDrawable(R.mipmap.books_unse));
bookClubsSelected.remove(bookClub.getClubId());
listener.OnSelectChange(bookClubsSelected);
}
}
});
}
@Override
public int getItemCount() {
return bookClubs.size();
}
public void setBookClubs(HashMap<String, BookClub> bookClubsSelected
, ArrayList<BookClub> bookClubArrayList) {
refresh();
this.bookClubsSelected = bookClubsSelected;
for (BookClub club : bookClubArrayList) {
if (bookClubsSelected.containsKey(club.getClubId()))
club.setSelected(true);
else
club.setSelected(false);
insertItem(club);
}
}
private void insertItem(BookClub bookClub) {
bookClubs.add(bookClub);
this.notifyItemInserted(bookClubs.size() - 1);
}
public void refresh() {
bookClubs.clear();
bookClubsSelected.clear();
this.notifyDataSetChanged();
}
public ArrayList<BookClub> getBookClubs() {
return bookClubs;
}
public interface SetOncLickListener {
void SetOnclick(BookClub club);
void OnSelectChange(HashMap<String, BookClub> bookClubsSelected);
}
class BookClubViewHolder extends RecyclerView.ViewHolder
implements View.OnClickListener {
final TextView bookName;
final TextView bookType;
final ImageView checkbook;
public BookClubViewHolder(View itemView) {
super(itemView);
bookName = itemView.findViewById(R.id.book_name);
bookType = itemView.findViewById(R.id.book_type);
checkbook = itemView.findViewById(R.id.select_image);
itemView.setOnClickListener(this);
}
@Override
public void onClick(View view) {
listener.SetOnclick(bookClubs.get(getAdapterPosition()));
}
}
}
|
[
"[email protected]"
] | |
86e0064f6c748949d20892764740590196d32028
|
ebd8cd1b926469c83364792b2bd46f8747fee68f
|
/src/main/java/com/fh/shop/admin/po/user/User.java
|
d37f36904b5f230795a7984a2276779e02ca909a
|
[] |
no_license
|
yuxyjava/fh-shop-admin
|
c3f45b8097204f634f2dfa7f779d1bf5b8dc558a
|
f956d5bf7abfcf9ae9c7c63d5e1a2cf74833f6db
|
refs/heads/master
| 2022-12-22T07:42:34.543046 | 2019-09-25T05:20:42 | 2019-09-25T05:20:42 | 210,576,892 | 1 | 0 | null | 2022-12-16T11:08:13 | 2019-09-24T10:35:51 |
Java
|
UTF-8
|
Java
| false | false | 3,068 |
java
|
package com.fh.shop.admin.po.user;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
public class User implements Serializable {
private Long id;
private String userName;
private String realName;
private String password;
private Integer sex;
private Integer age;
private String phone;
private String email;
private Integer salary;
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date entryTime;
private String roleIds;
private Date loginTime;
private int loginCount;
private String salt;
private int loginErrorCount;
private Date loginErrorDate;
public int getLoginErrorCount() {
return loginErrorCount;
}
public void setLoginErrorCount(int loginErrorCount) {
this.loginErrorCount = loginErrorCount;
}
public Date getLoginErrorDate() {
return loginErrorDate;
}
public void setLoginErrorDate(Date loginErrorDate) {
this.loginErrorDate = loginErrorDate;
}
public String getSalt() {
return salt;
}
public void setSalt(String salt) {
this.salt = salt;
}
public int getLoginCount() {
return loginCount;
}
public void setLoginCount(int loginCount) {
this.loginCount = loginCount;
}
public Date getLoginTime() {
return loginTime;
}
public void setLoginTime(Date loginTime) {
this.loginTime = loginTime;
}
public String getRoleIds() {
return roleIds;
}
public void setRoleIds(String roleIds) {
this.roleIds = roleIds;
}
public Integer getSex() {
return sex;
}
public void setSex(Integer sex) {
this.sex = sex;
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Integer getSalary() {
return salary;
}
public void setSalary(Integer salary) {
this.salary = salary;
}
public Date getEntryTime() {
return entryTime;
}
public void setEntryTime(Date entryTime) {
this.entryTime = entryTime;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getRealName() {
return realName;
}
public void setRealName(String realName) {
this.realName = realName;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
|
[
"[email protected]"
] | |
5d96ed6f709a1a0e7794cd48432c15fb79fe9b02
|
a458a07dc0b9c9a6d54075a4141298bb7a124728
|
/VRML_API/src/main/java/iicm/vrml/pw/MultiField.java
|
ce2a6d7ea8876f9814b8f6a8d3516b6dfb5486fd
|
[
"MIT"
] |
permissive
|
xml3d/VRML-X3D-Converter
|
eaffda72bdb551f1b1ef092a92d43489d88e940a
|
18a359453603b85b25845aa00470bc5e8ebb1659
|
refs/heads/master
| 2021-01-10T19:20:53.857135 | 2012-09-07T09:44:32 | 2012-09-07T09:44:32 | 5,714,787 | 5 | 3 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,126 |
java
|
/*
* <copyright>
*
* Copyright (c) 1996,97
* Institute for Information Processing and Computer Supported New Media (IICM),
* Graz University of Technology, Austria.
*
* This file is part of the `pw' VRML 2.0 parser.
*
* </copyright>
*/
/*
* MultiField.java
* MultiField interface
*
* created: mpichler, 19960808
* changed: mpichler, 19970131
* changed: kwagen, 19970917
*
* $Id: MultiField.java,v 1.6 1997/09/17 10:15:06 kwagen Exp $
*/
package iicm.vrml.pw;
import java.io.*;
import java.util.Hashtable;
/**
* MultiField - multi valued Field base class
* Copyright (c) 1996,97 IICM
*
* @author Michael Pichler, Karin Roschker
* @version 0.5, latest change: 31 Jan 97
*/
abstract public class MultiField extends Field
{
/**
* @return number of field values
*/
abstract public int getValueCount ();
/**
* read a single field value
* @return true if value could be successfully read
*/
abstract void read1Value (VRMLparser parser) throws IOException;
/**
* clear current values (before reading new ones)
* @return true if field was previosly non-empty
*/
abstract boolean clearValues ();
/**
* read field's values
* @return true if all values could be successfully read
*/
void readValue (VRMLparser parser) throws IOException
{
StrTokenizer st = parser.istok;
// clear any default values (or proto defaults)
if (clearValues ())
changed = true;
st.skipComment ();
if (st.nextChar () != '[') // single value
{
read1Value (parser);
return;
}
char c = (char) st.readChar (); // '['
// multiple values
while (st.skipCommentReturn (true) && !st.eof () && st.nextChar () != ']')
{
// stop field parsing after an error occured (catch up ']')
if (readerror)
st.readChar ();
else {
read1Value (parser);
}
// ',' is whitespace in VRML 2.0
}
char t = (char) st.readChar (); // eat ']'
} // readValue
} // class MultiField
|
[
"[email protected]"
] | |
ac124b459d604e755722ff6dd14bb9467799a439
|
5cecd730d1e83d84b7fc08055e58e5658139efb0
|
/src/main/java/cn/fay/terminal/request/SubTerminalRequest.java
|
02318c43e4df1fe7bd3f63bc66d706922cbfb32a
|
[] |
no_license
|
sofay/net-terminal
|
6088401e28c1c46b633a4e0a4c4706deee4528d6
|
3b53a724c4dedb6dba88b6d49eea86486a89918b
|
refs/heads/master
| 2021-01-21T12:20:14.205635 | 2017-09-05T09:11:44 | 2017-09-05T09:11:44 | 102,064,612 | 2 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 238 |
java
|
package cn.fay.terminal.request;
import lombok.Data;
@Data
public class SubTerminalRequest {
private String subTerminal;
private String[] params;
@Override
public String toString() {
return subTerminal;
}
}
|
[
"[email protected]"
] | |
c6a23afc0e58204e865ba2bb34fb6323742ed3ad
|
c7dc53850d711382aafb6e7df9453a82426b2d3a
|
/src/main/java/com/imaginary/home/cloud/PendingCommandState.java
|
acc3f4e9bee1e0935f1c74b76cae2884c3a07fc5
|
[] |
no_license
|
basmababa/imaginary-home
|
4dfe652bd89fbdc4e849edc774e3e5695390639a
|
8f60d388b74638f56dba01a2759e8e977cefd27a
|
refs/heads/master
| 2020-12-26T02:20:42.952771 | 2014-04-17T13:38:22 | 2014-04-17T13:38:22 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 814 |
java
|
/*
* Copyright (C) 2013 George Reese
*
* 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.imaginary.home.cloud;
/**
* [Class Documentation]
* <p>Created by George Reese: 1/27/13 11:42 AM</p>
*
* @author George Reese
*/
public enum PendingCommandState {
WAITING, SENT, EXECUTED
}
|
[
"[email protected]"
] | |
6b5465259639350c418cfaac7f3cdd4e934808d8
|
4473e6229ef7cc8cf5ae36229d39dc6d8fc3ef56
|
/employee/src/main/java/anandh/employee/types/Department.java
|
a386e925fa98c62df0341c369743593e8dadb95a
|
[] |
no_license
|
Anandharaj0930/KubernatesSample
|
aa16a4a2361ee090dbd932e82c3c02b34490f318
|
be3de822854e11fe036a9c2593ac27d96a1ce308
|
refs/heads/main
| 2023-03-10T21:47:13.014437 | 2021-02-27T17:17:34 | 2021-02-27T17:17:34 | 339,932,611 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 873 |
java
|
package anandh.employee.types;
import java.io.Serializable;
public class Department implements Serializable {
private String name;
private String process;
private String location;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getProcess() {
return process;
}
public void setProcess(String process) {
this.process = process;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
@Override
public String toString() {
return "Department{" +
"name='" + name + '\'' +
", process='" + process + '\'' +
", location='" + location + '\'' +
'}';
}
}
|
[
"[email protected]"
] | |
0c14a90f67324bb6b69668149236422f880321d3
|
d914465538c4f4ce80ff7cd6a87b61d80939cda2
|
/src/main/java/com/sxw/common/constants/RedisKeyConstants.java
|
5a4235027fe49478ba9776c7bd03e2075ca70ab1
|
[
"Apache-2.0"
] |
permissive
|
suxiongwei/message-push
|
582ed53fe3e37ac7f6e085b90e55d5a3a035ad31
|
5019ce427236ae85c49da2de26367d78833f9cd6
|
refs/heads/master
| 2022-06-24T09:23:26.364083 | 2020-03-19T09:19:41 | 2020-03-19T09:19:41 | 201,834,318 | 12 | 2 |
Apache-2.0
| 2022-06-17T02:25:51 | 2019-08-12T01:12:26 |
Java
|
UTF-8
|
Java
| false | false | 259 |
java
|
package com.sxw.common.constants;
public class RedisKeyConstants {
/**
* 用来计算消费队列的自增key
*/
public static final String SUBSCRIBE_QUEUE_INCR_KEY = "sqik";
public static final String SUBSCRIBE_QUEUE_KEY = "sqk_";
}
|
[
"[email protected]"
] | |
33868a99babae1a99da8ee9e9dd3ecdc7e316f9c
|
995f73d30450a6dce6bc7145d89344b4ad6e0622
|
/Honor5C-7.0/src/main/java/org/apache/xml/utils/SecuritySupport12.java
|
26dc7d9657d8ac9d39331c29aea31cc2db5f76e4
|
[] |
no_license
|
morningblu/HWFramework
|
0ceb02cbe42585d0169d9b6c4964a41b436039f5
|
672bb34094b8780806a10ba9b1d21036fd808b8e
|
refs/heads/master
| 2023-07-29T05:26:14.603817 | 2021-09-03T05:23:34 | 2021-09-03T05:23:34 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 4,894 |
java
|
package org.apache.xml.utils;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
class SecuritySupport12 extends SecuritySupport {
/* renamed from: org.apache.xml.utils.SecuritySupport12.3 */
class AnonymousClass3 implements PrivilegedAction {
final /* synthetic */ ClassLoader val$cl;
AnonymousClass3(ClassLoader val$cl) {
this.val$cl = val$cl;
}
public Object run() {
ClassLoader parent = null;
try {
parent = this.val$cl.getParent();
} catch (SecurityException e) {
}
return parent == this.val$cl ? null : parent;
}
}
/* renamed from: org.apache.xml.utils.SecuritySupport12.4 */
class AnonymousClass4 implements PrivilegedAction {
final /* synthetic */ String val$propName;
AnonymousClass4(String val$propName) {
this.val$propName = val$propName;
}
public Object run() {
return System.getProperty(this.val$propName);
}
}
/* renamed from: org.apache.xml.utils.SecuritySupport12.5 */
class AnonymousClass5 implements PrivilegedExceptionAction {
final /* synthetic */ File val$file;
AnonymousClass5(File val$file) {
this.val$file = val$file;
}
public Object run() throws FileNotFoundException {
return new FileInputStream(this.val$file);
}
}
/* renamed from: org.apache.xml.utils.SecuritySupport12.6 */
class AnonymousClass6 implements PrivilegedAction {
final /* synthetic */ ClassLoader val$cl;
final /* synthetic */ String val$name;
AnonymousClass6(ClassLoader val$cl, String val$name) {
this.val$cl = val$cl;
this.val$name = val$name;
}
public Object run() {
if (this.val$cl == null) {
return ClassLoader.getSystemResourceAsStream(this.val$name);
}
return this.val$cl.getResourceAsStream(this.val$name);
}
}
/* renamed from: org.apache.xml.utils.SecuritySupport12.7 */
class AnonymousClass7 implements PrivilegedAction {
final /* synthetic */ File val$f;
AnonymousClass7(File val$f) {
this.val$f = val$f;
}
public Object run() {
return new Boolean(this.val$f.exists());
}
}
/* renamed from: org.apache.xml.utils.SecuritySupport12.8 */
class AnonymousClass8 implements PrivilegedAction {
final /* synthetic */ File val$f;
AnonymousClass8(File val$f) {
this.val$f = val$f;
}
public Object run() {
return new Long(this.val$f.lastModified());
}
}
SecuritySupport12() {
}
ClassLoader getContextClassLoader() {
return (ClassLoader) AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
ClassLoader cl = null;
try {
cl = Thread.currentThread().getContextClassLoader();
} catch (SecurityException e) {
}
return cl;
}
});
}
ClassLoader getSystemClassLoader() {
return (ClassLoader) AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
ClassLoader cl = null;
try {
cl = ClassLoader.getSystemClassLoader();
} catch (SecurityException e) {
}
return cl;
}
});
}
ClassLoader getParentClassLoader(ClassLoader cl) {
return (ClassLoader) AccessController.doPrivileged(new AnonymousClass3(cl));
}
String getSystemProperty(String propName) {
return (String) AccessController.doPrivileged(new AnonymousClass4(propName));
}
FileInputStream getFileInputStream(File file) throws FileNotFoundException {
try {
return (FileInputStream) AccessController.doPrivileged(new AnonymousClass5(file));
} catch (PrivilegedActionException e) {
throw ((FileNotFoundException) e.getException());
}
}
InputStream getResourceAsStream(ClassLoader cl, String name) {
return (InputStream) AccessController.doPrivileged(new AnonymousClass6(cl, name));
}
boolean getFileExists(File f) {
return ((Boolean) AccessController.doPrivileged(new AnonymousClass7(f))).booleanValue();
}
long getLastModified(File f) {
return ((Long) AccessController.doPrivileged(new AnonymousClass8(f))).longValue();
}
}
|
[
"[email protected]"
] | |
315c0eaea172e27f1733bf009d8420ea046d44c2
|
0d7eeae360c899b3d4e84c7d28630cf10960c2c2
|
/cordapp/src/main/java/com/template/vo/WorkStateValue.java
|
8bd8b122b98f8eca4084727fffd1038363c44058
|
[
"Apache-2.0"
] |
permissive
|
jimKir/blockchain-hackathon-credit-suisse
|
1965ed3dbe628d5e2bb77863ceeec5a3217c8c15
|
0142e95e2841fca22e32d5b8a9238c1dbc67f6cb
|
refs/heads/master
| 2021-05-11T11:59:55.998381 | 2018-01-16T07:34:21 | 2018-01-16T07:34:21 | 117,648,940 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 861 |
java
|
package com.template.vo;
import net.corda.core.serialization.CordaSerializable;
import java.util.Objects;
/**
* Created by pai on 15.01.18.
*/
@CordaSerializable
public class WorkStateValue {
String description;
public WorkStateValue(String description) {
this.description = description;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
WorkStateValue that = (WorkStateValue) o;
return Objects.equals(description, that.description);
}
@Override
public int hashCode() {
return Objects.hash(description);
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}
|
[
"[email protected]"
] | |
76ea53116aa870871df7cdeb3f08b8e012c7e31a
|
2c2657c70b6cbc094a721ec51749654514c77a67
|
/dad/dad-service/src/main/java/com/dad/service/util/CacheKeyUtil.java
|
b613ae466690eab77ef185c4a7e859d960b4033b
|
[] |
no_license
|
illiqiang/dad
|
0ceb8ff01f80bd26a044a39095fa0f6ad6ab2fbe
|
693bf1ef06714e471a7e391000bfb65d3e38dcc2
|
refs/heads/master
| 2020-05-20T03:43:10.020974 | 2015-06-02T08:13:44 | 2015-06-02T08:13:44 | 32,973,001 | 0 | 2 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,268 |
java
|
package com.dad.service.util;
public class CacheKeyUtil {
private static String deviceKey = "c_device+%s";
private static String deviceUserKey = "c_device_user+%s";
private static String devicePltKey = "c_device_plt+%s+%s";
private static String devicePltListKey = "c_plt_list+%s";
private static String lastRtdDataKey = "c_lastrtd+%s+%s";
private static String sessionKey = "c_session+%s";
private static String userSessionKey = "c_user_session+%s";
public static String getDeviceKey(String deviceId) {
return String.format(deviceKey, deviceId);
}
public static String getDeviceUserKey(String deviceId) {
return String.format(deviceUserKey, deviceId);
}
public static String getDevicePltKey(String deviceId, String code) {
return String.format(devicePltKey, deviceId, code);
}
public static String getDevicePltListKey(String deviceId) {
return String.format(devicePltListKey, deviceId);
}
public static String getLastRtdDataKey(String deviceId, String code) {
return String.format(lastRtdDataKey, deviceId,code);
}
public static String getSessionKey(String session) {
return String.format(sessionKey, session);
}
public static String getUserSessionKey(long userId) {
return String.format(userSessionKey, userId);
}
}
|
[
"[email protected]"
] | |
45b1cbaec3667c75f943c983f6b2b799b36b01b1
|
e9a250fe6a0da94862039914e2304119a7c11db0
|
/src/main/java/com/api/service/ModelService.java
|
d821379a13f94d05fcb0f10775897a1652ea6bf4
|
[] |
no_license
|
andrei-kuzniatsou/test
|
d89ab37542076df80404c0b499707f3980a29984
|
859fea49b068c3848192685d16f1827caf87f6c6
|
refs/heads/master
| 2020-12-24T21:54:39.846022 | 2016-06-15T06:59:22 | 2016-06-15T06:59:22 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 239 |
java
|
package com.api.service;
import com.model.Model;
/**
* The contract for interacting with {@link Model}.
* Date: 06/14/2016
*
* @author Uladzislau_Shalamitski
*/
public interface ModelService extends GenericService<Long, Model> {
}
|
[
"[email protected]"
] | |
645bd1bff381ca8eac4d3ea2895e6e87bdd6d67a
|
8a179794563acf7b7866756db40ed4793a6e349d
|
/Fedex/src/test/java/javaprogram/B.java
|
b68ec9b80c4ea393f2b3eae58c7eb13e10005462
|
[] |
no_license
|
payal444/SoniClassesFramework
|
837caad4d0d9c93b13353ca0c4f074dad4e21a6a
|
2bbcad2f04871ba72db9995d09c083b2ab202fe7
|
refs/heads/master
| 2020-04-17T13:50:48.891120 | 2019-01-20T07:45:23 | 2019-01-20T07:45:23 | 166,632,725 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 170 |
java
|
package javaprogram;
public class B{
public SimpleJavaPrograms B1method()
{
System.out.println("B1method EXE");
return new SimpleJavaPrograms();
}
}
|
[
"User@Hp"
] |
User@Hp
|
40f86e103caa9a656544610dd8a1f7357a5a2d43
|
9e6e50e720540916c5e82020c18c19b7cb8c6471
|
/app/src/androidTest/java/com/example/kentsimgeleri/ExampleInstrumentedTest.java
|
2ced35281fccce5802d2e93dd30cf6d81c4a55f4
|
[
"MIT"
] |
permissive
|
kartalyusuf/city-explain
|
ba94a6b56a4696e0c3be59bbcc5be098bdfc4215
|
b5e7718d9ea9d093753f19a0edfa5a7abebeb8be
|
refs/heads/main
| 2023-07-11T13:54:37.503135 | 2021-08-06T11:39:40 | 2021-08-06T11:39:40 | 393,358,480 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 764 |
java
|
package com.example.kentsimgeleri;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.example.kentsimgeleri", appContext.getPackageName());
}
}
|
[
"[email protected]"
] | |
e5d9e5f084bc0872f8b259b04c4e3d0e92d00ef9
|
180ced28c41753ab6d76eece25abda272150c2d2
|
/src/main/java/Controller/UserController.java
|
2a368a81136bae67651f7cc91e21803571a05540
|
[] |
no_license
|
AntonioMembrino/BootuserSpring
|
715829e8219707a198d153434a57aeac5ba380a8
|
2e4a2056ec7bf5211c1a61905941d24e126a25c8
|
refs/heads/master
| 2023-03-09T09:25:02.680033 | 2019-06-30T18:28:39 | 2019-06-30T18:28:39 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,225 |
java
|
package Controller;
import javax.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import Repository.UserRepository;
import entities.User;
@Controller
public class UserController {
private final UserRepository userRepository;
@Autowired
public UserController(UserRepository userRepository) {
this.userRepository = userRepository;
}
@GetMapping("/signup")
public String showSignUpForm(User user) {
return "add-user";
}
@PostMapping("/adduser")
public String addUser(@Valid User user, BindingResult result, Model model) {
if (result.hasErrors()) {
return "add-user";
}
userRepository.save(user);
model.addAttribute("users", userRepository.findAll());
return "index";
}
@GetMapping("/edit/{id}")
public String showUpdateForm(@PathVariable("id") long id, Model model) {
User user = userRepository.findById(id).orElseThrow(() -> new IllegalArgumentException("Invalid user Id:" + id));
model.addAttribute("user", user);
return "update-user";
}
@PostMapping("/update/{id}")
public String updateUser(@PathVariable("id") long id, @Valid User user, BindingResult result, Model model) {
if (result.hasErrors()) {
user.setId(id);
return "update-user";
}
userRepository.save(user);
model.addAttribute("users", userRepository.findAll());
return "index";
}
@GetMapping("/delete/{id}")
public String deleteUser(@PathVariable("id") long id, Model model) {
User user = userRepository.findById(id).orElseThrow(() -> new IllegalArgumentException("Invalid user Id:" + id));
userRepository.delete(user);
model.addAttribute("users", userRepository.findAll());
return "index";
}
}
|
[
"[email protected]"
] | |
48ce6950d10c555932289b96425254359a0f28a4
|
00ae0464c195806a2c516e40225773a259305b12
|
/app/src/main/java/com/example/graduationworks/User/UserInfo.java
|
0f0805515012624aa26bbf603df78ce1c3aac03d
|
[] |
no_license
|
Shekangcheng/Graduationworks
|
266e29cd86eea92bdd69209fc6b535c822d452d2
|
673361568ebbf17a5d946141e360860398027209
|
refs/heads/master
| 2023-01-21T17:59:05.934173 | 2020-11-22T02:07:28 | 2020-11-22T02:07:28 | 311,824,654 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 17,029 |
java
|
package com.example.graduationworks.User;
import android.annotation.SuppressLint;
import android.app.DatePickerDialog;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.text.InputType;
import android.text.TextWatcher;
import android.util.Log;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.PopupWindow;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.fragment.app.Fragment;
import com.example.graduationworks.SQL.Teacher;
import com.example.graduationworks.toolkit.AppContext;
import com.example.graduationworks.toolkit.Popup;
import com.example.graduationworks.R;
import com.example.graduationworks.SQL.User;
import java.util.Arrays;
import java.util.Calendar;
import java.util.List;
import java.util.Locale;
import cn.bmob.v3.BmobQuery;
import cn.bmob.v3.exception.BmobException;
import cn.bmob.v3.listener.FindListener;
import cn.bmob.v3.listener.UpdateListener;
public class UserInfo extends Fragment implements View.OnClickListener {
private static final String TAG = "UserInfo";
Button top_up, U_info_change, pop_modification_confirm;
int Year, Month, Day, control;
String time, birthday,account=AppContext.account;
TextView U_F_i_name, U_F_i_gold, U_F_i_gender, U_F_i_age, U_F_i_phone, U_F_i_birthday, U_F_i_grade, U_F_i_e_mail, U_F_i_site, modification_hint;
EditText modification_content;
ConstraintLayout outer;
Popup pop;
PopupWindow win;
Calendar calendar= Calendar.getInstance(Locale.CHINA);
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.user_fragment_infor, container, false);
return view;
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
initialize(view);
info();
}
private void initialize(View view) {
top_up = view.findViewById(R.id.top);
U_F_i_name = view.findViewById(R.id.U_F_i_name);
U_F_i_gold = view.findViewById(R.id.U_F_i_gold);
U_F_i_gender = view.findViewById(R.id.U_F_i_gender);
U_F_i_age = view.findViewById(R.id.U_F_i_age);
U_F_i_phone = view.findViewById(R.id.U_F_i_phone);
U_F_i_birthday = view.findViewById(R.id.U_F_i_birthday);
U_F_i_grade = view.findViewById(R.id.U_F_i_grade);
U_F_i_e_mail = view.findViewById(R.id.U_F_i_e_mail);
U_F_i_site = view.findViewById(R.id.U_F_i_site);
U_info_change = view.findViewById(R.id.U_info_change);
view.findViewById(R.id.top_up).setOnClickListener(this);
view.findViewById(R.id.U_F_i_name).setOnClickListener(this);
view.findViewById(R.id.linearLayout1).setOnClickListener(this);
view.findViewById(R.id.linearLayout3).setOnClickListener(this);
view.findViewById(R.id.linearLayout4).setOnClickListener(this);
view.findViewById(R.id.linearLayout5).setOnClickListener(this);
view.findViewById(R.id.linearLayout6).setOnClickListener(this);
view.findViewById(R.id.linearLayout7).setOnClickListener(this);
view.findViewById(R.id.U_info_change).setOnClickListener(this);
currentdate();
}
private void info() {
BmobQuery<User> query = new BmobQuery<>();
query.addWhereEqualTo("account", AppContext.account);
synchronized (this) {
query.findObjects(new FindListener<User>() {
@Override
public void done(List<User> list, BmobException e) {
Log.d(TAG, "账号为" + AppContext.account);
if (e == null) {
for (User bmobUser : list) {
U_F_i_name.setText(bmobUser.getName() + "");
U_F_i_gold.setText(bmobUser.getGold() + "");
U_F_i_gender.setText(bmobUser.getGender());
U_F_i_age.setText(bmobUser.getAge() + "");
U_F_i_phone.setText(bmobUser.getPhone() + "");
U_F_i_birthday.setText(bmobUser.getBirthday() + "");
U_F_i_grade.setText(bmobUser.getGrade() + "");
U_F_i_e_mail.setText(bmobUser.getE_mail() + "");
U_F_i_site.setText(bmobUser.getSite() + "");
}
} else {
int errorCode = e.getErrorCode();
Log.d(TAG, "失败:" + e.getMessage() + "\t错误码 ==> " + errorCode);
}
}
});
}
}
private void currentdate() {
Calendar c = Calendar.getInstance();//获得当前日期
Year = c.get(Calendar.YEAR);
Month = c.get(Calendar.MONTH);
Day = c.get(Calendar.DAY_OF_MONTH);
time = Year + "-" + Month + "-" + Day;
}
@SuppressLint("ResourceType")
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.U_F_i_name:
modification_frame(view, "请输入你的名字", InputType.TYPE_CLASS_TEXT);
control = 1;
break;
case R.id.linearLayout1:
pop = Popup.getPop(getContext(), R.layout.gender_popup);
win = pop.getWin();
win.showAtLocation((View) view.getParent(), Gravity.CENTER, 0, 0);
View gender_popView = pop.getView();
Button boy = gender_popView.findViewById(R.id.boy);
boy.setOnClickListener(new popItemClick(win));
Button girl = gender_popView.findViewById(R.id.girl);
girl.setOnClickListener(new popItemClick(win));
Button confidentiality = gender_popView.findViewById(R.id.confidentiality);
confidentiality.setOnClickListener(new popItemClick(win));
break;
case R.id.linearLayout3:
modification_frame(view, "请输入你的电话号码", InputType.TYPE_CLASS_NUMBER);
control = 2;
break;
case R.id.linearLayout4:
new DatePickerDialog(getContext(), 2, new DatePickerDialog.OnDateSetListener() {
// 绑定监听器(How the parent is notified that the date is set.)
@Override
public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
birthday = year + "-" + (monthOfYear + 1) + "-" + dayOfMonth;
int age = 0;
U_F_i_birthday.setText(birthday);
if (Year - year > 0) {
age = Year - year;
if (monthOfYear > Month) {
age--;
} else if (monthOfYear == Month) {
if (dayOfMonth > Day) {
age--;
}
}
}
U_F_i_age.setText(age + "");
}
}
// 设置初始日期
, calendar.get(Calendar.YEAR)
, calendar.get(Calendar.MONTH)
, calendar.get(Calendar.DAY_OF_MONTH)).show();
break;
case R.id.linearLayout5:
modification_frame(view, "请输入你当前学习阶段", InputType.TYPE_CLASS_TEXT);
control = 3;
break;
case R.id.linearLayout6:
modification_frame(view, "请输入你的邮箱",InputType.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS);
control = 4;
break;
case R.id.linearLayout7:
modification_frame(view, "请输入你的所在地址", InputType.TYPE_CLASS_TEXT);
control = 5;
break;
//保存信息
case R.id.U_info_change:
BmobQuery<User> cursor = new BmobQuery<>();
cursor.addWhereContainsAll("account", Arrays.asList(account));
//
synchronized (this) {
cursor.findObjects(new FindListener<User>() {
@Override
public void done(List<User> list, BmobException e) {
if (e == null) {
Log.d(TAG, "查询成功:共" + list.size() + "条数据。");
for (User bmobUser : list) {
String ID = bmobUser.getObjectId();
bmobUser.setValue("name", U_F_i_name.getText().toString());
bmobUser.setValue("gender", U_F_i_gender.getText().toString());
bmobUser.setValue("age", Integer.valueOf(U_F_i_age.getText().toString()).intValue());
bmobUser.setValue("phone", U_F_i_phone.getText().toString());
bmobUser.setValue("birthday", U_F_i_birthday.getText().toString());
bmobUser.setValue("grade", U_F_i_grade.getText().toString());
bmobUser.setValue("e_mail", U_F_i_e_mail.getText().toString());
bmobUser.setValue("site", U_F_i_site.getText().toString());
bmobUser.update(ID, new UpdateListener() {
@Override
public void done(BmobException e) {
if (e == null) {
Toast.makeText(getContext(), "以保存当前信息", Toast.LENGTH_SHORT).show();
Log.i("bmob", "成功");
} else {
Log.i("bmob", "失败:" + e.getMessage());
Toast.makeText(getContext(), "保存失败,请检查填写格式或网络", Toast.LENGTH_SHORT).show();
}
}
});
}
} else {
int errorCode = e.getErrorCode();
Log.d(TAG, "失败:" + e.getMessage() + "\t错误码 ==> " + errorCode);
}
}
});
}
break;
case R.id.top_up:
int i = Integer.valueOf(U_F_i_gold.getText().toString()).intValue();
i+=50;
BmobQuery<User> U_cursor = new BmobQuery<>();
U_cursor.addWhereContainsAll("account", Arrays.asList(account));
synchronized (this) {
int I = i;
U_cursor.findObjects(new FindListener<User>() {
@Override
public void done(List<User> list, BmobException e) {
if (e == null) {
for (User bmobUser : list) {
String ID = bmobUser.getObjectId();
bmobUser.setValue("gold", I);
bmobUser.update(ID, new UpdateListener() {
@Override
public void done(BmobException e) {
if (e == null) {
Log.i("", "成功");
} else {
Log.i("", "失败:" + e.getMessage());
}
}
});
}
} else {
int errorCode = e.getErrorCode();
Log.d(TAG, "失败:" + e.getMessage() + "\t错误码 ==> " + errorCode);
}
}
});
}
U_F_i_gold.setText(i + "");
break;
}
}
private void modification_frame(View view, String hint, int Type) {
pop = Popup.getPop(getContext(), R.layout.import_popup);
win = pop.getWin();
View phone_popView = pop.getView();
modification_hint = phone_popView.findViewById(R.id.modification_hint);
modification_hint.setText(hint);
modification_content = phone_popView.findViewById(R.id.modification_content);
modification_content.setInputType(Type);
pop_modification_confirm = phone_popView.findViewById(R.id.pop_modification_confirm);
pop_modification_confirm.setOnClickListener(new popItemClick(win));
modification_content.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
Log.e(TAG, "onTextChanged: "+s.toString() );
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
boolean is = s.toString().contains(".");
Log.e(TAG, "onTextChanged: "+is);
if (is) {
int i = s.toString().indexOf(".");
modification_content.setText(s.toString().substring(0,i));
}
}
@Override
public void afterTextChanged(Editable s) {}
});
outer = phone_popView.findViewById(R.id.outer);
outer.setOnClickListener(new popItemClick(win));
win.showAtLocation((View) view.getParent(), Gravity.CENTER, 0, 0);
}
class popItemClick implements View.OnClickListener {
PopupWindow win;
popItemClick(PopupWindow win) {
this.win = win;
}
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.boy:
U_F_i_gender.setText("男");
win.dismiss();
break;
case R.id.girl:
U_F_i_gender.setText("女");
win.dismiss();
break;
case R.id.confidentiality:
U_F_i_gender.setText("保密");
win.dismiss();
break;
case R.id.pop_modification_confirm:
switch (control) {
case 1:
U_F_i_name.setText(modification_content.getText().toString());
win.dismiss();
break;
case 2:
if (modification_content.getText().toString().length() != 11) {
Toast.makeText(getContext(), "手机格式错误", Toast.LENGTH_SHORT).show();
} else {
U_F_i_phone.setText(modification_content.getText().toString());
win.dismiss();
}
break;
case 3:
U_F_i_grade.setText(modification_content.getText().toString());
win.dismiss();
break;
case 4:
U_F_i_e_mail.setText(modification_content.getText().toString());
win.dismiss();
break;
case 5:
U_F_i_site.setText(modification_content.getText().toString());
win.dismiss();
break;
}
break;
case R.id.outer:
win.dismiss();
break;
}
}
}
}
|
[
"[email protected]"
] | |
0b49d8528aacbc646d34e8f44b93f4ff2aef0e1d
|
d5876f6b8b83466ad6c0fa4778e28e7f3446aac1
|
/CoyoteFT/src/test/java/coyote/dx/ftp/AbstractEngineTest.java
|
f8660fd2310a7ea07339b17f566c1b3035fb2777
|
[] |
no_license
|
abbyarmada/coyote
|
8b506b71c08d04de28c0128cfb3bbf254078614f
|
3983424fc3438338d00a3e351c5512cc3b4963ac
|
refs/heads/develop
| 2021-01-01T20:39:32.641078 | 2017-07-31T18:45:33 | 2017-07-31T18:45:33 | 98,907,070 | 0 | 0 | null | 2017-07-31T16:03:07 | 2017-07-31T16:03:07 | null |
UTF-8
|
Java
| false | false | 1,975 |
java
|
/*
* Copyright (c) 2015 Stephan D. Cote' - All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which accompanies this distribution, and is
* available at http://creativecommons.org/licenses/MIT/
*
* Contributors:
* Stephan D. Cote
* - Initial concept and implementation
*/
package coyote.dx.ftp;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import coyote.dx.TransformEngine;
import coyote.dx.TransformEngineFactory;
import coyote.commons.SystemPropertyUtil;
/**
*
*/
public class AbstractEngineTest {
/**
* Loads a configuration file and set of properties from the classpath
*
* <p>This loads [name].properties as the system properties and [name.json as
* the engine configuration.</p>
*
* @param name the name of the files to use
*
* @return The transform engine configured with the requested configuration
*/
protected TransformEngine loadEngine( String name ) {
TransformEngine engine = null;
// load named system properties
SystemPropertyUtil.load( name.toLowerCase() );
// now read the named configuration file
StringBuffer b = new StringBuffer();
try {
BufferedReader reader = new BufferedReader( new InputStreamReader( AbstractEngineTest.class.getClassLoader().getResourceAsStream( name + ".json" ) ) );
String line;
while ( ( line = reader.readLine() ) != null ) {
b.append( line );
}
} catch ( FileNotFoundException e ) {
e.printStackTrace();
} catch ( IOException e ) {
e.printStackTrace();
}
String cfgFile = b.toString();
// create an engine out of the file
engine = TransformEngineFactory.getInstance( cfgFile );
// return the configured engine
return engine;
}
}
|
[
"[email protected]"
] | |
a04af3eb0221ef7e81d6f544dea631ef07729955
|
93d0b3ba6775e776ea01daeee825e5b10aafa5ea
|
/Algorithms/src/com/christianpari/TwoSum.java
|
c33c6306cc3ba335cdcc3a9e5e416ae6e6ab144f
|
[] |
no_license
|
ChristianPari/Interview-Prep
|
ee05fe2904c7dde558ca220fcc83f92df9314e13
|
ef9b331a1a4adb49fb6339297b90f5dc8d62c85e
|
refs/heads/main
| 2023-07-07T18:49:10.790867 | 2021-08-13T23:03:40 | 2021-08-13T23:03:40 | 394,792,667 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 645 |
java
|
package com.christianpari;
import java.util.HashMap;
public class TwoSum {
public static void main(String[] args) {
int[] indices = findTwoSum(new int[] { 3, 1, 5, 7, 5, 9 }, 10);
if(indices != null) {
System.out.println(indices[0] + " " + indices[1]);
}
}
public static int[] findTwoSum(int[] list, int sum) {
HashMap<Integer, Integer> listMap = new HashMap<>();
for (int i = 0; i < list.length; i++) {
int curVal = list[i];
int needs = sum - curVal;
if (listMap.containsKey(needs))
return new int[]{i, listMap.get(needs)};
listMap.put(curVal, i);
}
return null;
}
}
|
[
"[email protected]"
] | |
89983d01c19350e69d6d94ae89054434f5ee0c6f
|
4d92c7b9c1641c70fdf52eecc171c806bb7d01e2
|
/src/main/java/at/refugeescode/javapsettests/pset3/lizardSpockGame/model/SpockMove.java
|
f94a10a77547ce4da60a7b3b96cedaa0efe879a0
|
[] |
no_license
|
timaf/java-pset-tests
|
9ebe2eac26733e2dabbf8cd7588717c26d6dc770
|
79376cf4627f6a84f22c1c9a480b97ecac46cd5e
|
refs/heads/master
| 2021-04-15T08:48:46.304843 | 2018-03-20T18:23:31 | 2018-03-20T18:23:31 | 126,445,471 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 609 |
java
|
package at.refugeescode.javapsettests.pset3.lizardSpockGame.model;
import at.refugeescode.javapsettests.pset2.RockScissorPaper_PolyMorphizm.model.Move;
import at.refugeescode.javapsettests.pset2.RockScissorPaper_PolyMorphizm.model.RockMove;
import at.refugeescode.javapsettests.pset2.RockScissorPaper_PolyMorphizm.model.ScissorsMove;
public class SpockMove implements Move {
@Override
public String sayWhichMove() {
return "Spock";
}
@Override
public boolean wins(Move move) {
return (move.getClass() == RockMove.class || move.getClass() == ScissorsMove.class);
}
}
|
[
"[email protected]"
] | |
d4068dff9c893318d1eabc42758e17fcade9de9d
|
b635f4f2c64e34e6328275cc686a8d5d27eb5a94
|
/app/src/main/java/com/ejemplo/album/listener/AlbumListener.java
|
f8657e1d16c7e97ed2bb49934a0292b2c0b2e302
|
[] |
no_license
|
josefmadero/AlbumApp2016
|
2b4735af7100366fd12a02eeb6aff9bb71c6ba2c
|
d592da87c04c7e5fdad016a51902c364ca356c9c
|
refs/heads/master
| 2021-01-18T13:40:12.214803 | 2016-07-21T03:29:22 | 2016-07-21T03:29:22 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 242 |
java
|
package com.ejemplo.album.listener;
import com.ejemplo.album.model.Album;
/**
* Copyright Guillermo M. Zalazar on 25/06/2016.
*/
public interface AlbumListener{
void onAlbumSelected(String title,String url, String thumbnailUrl );
}
|
[
"[email protected]"
] | |
cce073dfeb251694425eb8b1a3785bb5f003969a
|
a3818cc53156671a9c1c40c4f88895bd3996d501
|
/src/main/java/api/ProductService.java
|
7abb8d93bf29f3b2994a39dbb318e5cb51de168a
|
[] |
no_license
|
stawir/1024kb_tutorial
|
a0253b57b49d2606b63c814ab88607180b06ed4f
|
46a293d7cc166d32d2ac075426f0f6179164612d
|
refs/heads/master
| 2022-12-26T15:55:06.809814 | 2020-06-03T20:12:32 | 2020-06-03T20:12:32 | 261,543,576 | 0 | 0 | null | 2020-10-13T21:45:48 | 2020-05-05T17:48:06 |
Java
|
UTF-8
|
Java
| false | false | 368 |
java
|
package api;
import entity.Product;
import java.util.List;
public interface ProductService {
List<Product> getAllProducts();
Integer getCountProducts();
Product getProductByProductName(String productName);
boolean isProductOnWarehouse(String productName);
boolean isProductExist(String productName);
boolean isProductExist(Long productId);
}
|
[
"[email protected]"
] | |
ce8e75b9f3cbec9489e31a5a8ff94c2b7ad3b07e
|
5ea2ea64bdf3a12f651355cde07fa33ffd17b3fa
|
/src/main/java/parqueadero/parqueadero/persistencia/entidad/VehiculoEnParqueaderoEntity.java
|
8a38d9e062e4517f063fd06d01616678c87fe3d7
|
[] |
no_license
|
ricardo-cardona/CeibaEstacionamiento
|
01978c04decf78c5fd57abe8dae564e8a63f84f4
|
5d43f3dead4e71cd6897c1cf904c9fe1e028e6c3
|
refs/heads/master
| 2020-03-22T10:23:54.979685 | 2018-07-27T12:07:25 | 2018-07-27T12:07:25 | 139,899,973 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,019 |
java
|
package parqueadero.parqueadero.persistencia.entidad;
import java.util.Calendar;
import javax.persistence.Entity;
import javax.persistence.Id;
@Entity
public class VehiculoEnParqueaderoEntity {
@Id
private int id;
private String placa;
private String tipo;
private Calendar fechaIngreso;
public VehiculoEnParqueaderoEntity() {
super();
}
public VehiculoEnParqueaderoEntity(int id, String placa, String tipo, Calendar fechaIngreso) {
this.id = id;
this.placa = placa;
this.tipo = tipo;
this.fechaIngreso = fechaIngreso;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getPlaca() {
return placa;
}
public void setPlaca(String placa) {
this.placa = placa;
}
public String getTipo() {
return tipo;
}
public void setTipo(String tipo) {
this.tipo = tipo;
}
public Calendar getFechaIngreso() {
return fechaIngreso;
}
public void setFechaIngreso(Calendar fechaIngreso) {
this.fechaIngreso = fechaIngreso;
}
}
|
[
"[email protected]"
] | |
1049b239e913b5928076583ffd728c90fa2aea79
|
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
|
/com.tencent.qqlite/classes.jar/tb.java
|
3544227d12008c5848c7d970d661178ba06760ec
|
[] |
no_license
|
tsuzcx/qq_apk
|
0d5e792c3c7351ab781957bac465c55c505caf61
|
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
|
refs/heads/main
| 2022-07-02T10:32:11.651957 | 2022-02-01T12:41:38 | 2022-02-01T12:41:38 | 453,860,108 | 36 | 9 | null | 2022-01-31T09:46:26 | 2022-01-31T02:43:22 |
Java
|
UTF-8
|
Java
| false | false | 882 |
java
|
import android.content.DialogInterface.OnClickListener;
import android.view.View;
import android.view.View.OnClickListener;
import com.tencent.biz.widgets.ShareResultDialog;
public class tb
implements View.OnClickListener
{
public tb(ShareResultDialog paramShareResultDialog, DialogInterface.OnClickListener paramOnClickListener) {}
public void onClick(View paramView)
{
if (this.jdField_a_of_type_AndroidContentDialogInterface$OnClickListener != null) {
this.jdField_a_of_type_AndroidContentDialogInterface$OnClickListener.onClick(this.jdField_a_of_type_ComTencentBizWidgetsShareResultDialog, -2);
}
this.jdField_a_of_type_ComTencentBizWidgetsShareResultDialog.dismiss();
}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.qqlite\classes.jar
* Qualified Name: tb
* JD-Core Version: 0.7.0.1
*/
|
[
"[email protected]"
] | |
901ecea7acfd95fa17d4f2cbc2904030c322da2d
|
0ddab2edbb9763b972ce4641dee5517f48e65f89
|
/backend/src/main/java/com/oda/services/OrderDetailService.java
|
87c1bfd20b6e152fa635beef73638676661667b9
|
[] |
no_license
|
rodrigooda/xy-inc
|
a5ce2f28acdc8390b806553ca8518202d5aba3ee
|
70692f6170c86f8f1c1c5c7bc720235cd0d60492
|
refs/heads/master
| 2020-03-23T19:48:43.782332 | 2018-07-23T22:58:48 | 2018-07-23T22:58:48 | 98,948,172 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 314 |
java
|
package com.oda.services;
import java.util.List;
import com.oda.domain.OrderDetail;
/*
*
* @author rodrigooda
*/
public interface OrderDetailService {
List<OrderDetail> listAll();
OrderDetail getById(Integer id);
OrderDetail saveOrUpdate(OrderDetail orderDetail);
void delete(Integer id);
}
|
[
"[email protected]"
] | |
89ec4ff6ff9d9ef542a260bd2572041ffc17500c
|
c4e953050b91bc29723ed0022c54e5610ee0b178
|
/CS403/dpl/src/io/FileInputRunner.java
|
455f0fa63b015a0fcefcedc0033c3adbf3c2f039
|
[] |
no_license
|
mdlivingston/EarlyYearCode
|
4b3004d206ae615a16e668e3ae1d358c07b14ed7
|
a0ea8ad22eced2951fa90db6bedfb0449cf0f3cf
|
refs/heads/master
| 2020-05-07T15:13:45.671993 | 2019-04-10T16:13:30 | 2019-04-10T16:13:30 | 180,616,721 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 299 |
java
|
package io;
import java.io.EOFException;
public class FileInputRunner {
public static void main(String[] args) {
FileInput f = new FileInput("thorough.txt");
Character c = null;
try {
c = f.readNextRawCharacter();
} catch (EOFException e) {
return;
}
System.out.print(c);
}
}
|
[
"[email protected]"
] | |
e7ee9ca242e0cf5c963220cbda986ba670b860f9
|
bd4c67692a1fe26206519456408cf67d47f759c7
|
/app4train-ui/src/main/java/com/lukasz/engineerproject/app4train/ui/exampleExercises/ExerciseFourFactory.java
|
e0743420ffa3739beaec4fbebdea30122b1b23e9
|
[] |
no_license
|
CarlosPimentel10/app4train
|
27822e67283765bdce042be4b4e31108b00437bc
|
ae27d9dc69c027e34c00b9c962139f8bc5e0285d
|
refs/heads/master
| 2022-11-07T21:28:17.349887 | 2019-09-04T14:37:45 | 2019-09-04T14:37:45 | null | 0 | 0 | null | null | null | null |
WINDOWS-1250
|
Java
| false | false | 3,749 |
java
|
package com.lukasz.engineerproject.app4train.ui.exampleExercises;
import java.io.File;
import com.lukasz.engineerproject.app4train.utils.ExercisesTitles;
import com.vaadin.server.FileResource;
import com.vaadin.server.FontAwesome;
import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.Button;
import com.vaadin.ui.UI;
import com.vaadin.ui.themes.ValoTheme;
import com.vaadin.ui.Component;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Video;
import com.vaadin.ui.Window;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
@org.springframework.stereotype.Component
public class ExerciseFourFactory {
private class ExerciseFourLayout extends VerticalLayout {
private static final long serialVersionUID = 1L;
private Label throughtExplanationOfExerciseFourPart1;
private Label throughtExplanationOfExerciseFourPart2;
private VerticalLayout layoutForLabelAndVideo;
private Video video;
public ExerciseFourLayout init() {
Label topicOfExerciseFour = new Label(ExercisesTitles.TOPIC_FOUR.getString());
Button buttonForWindow = new Button();
buttonAction(buttonForWindow);
buttonForWindow.setIcon(FontAwesome.SEARCH);
buttonForWindow.setStyleName(ValoTheme.BUTTON_SMALL);
HorizontalLayout layoutForButtonAndWindow = new HorizontalLayout(buttonForWindow, topicOfExerciseFour);
layoutForButtonAndWindow.setSpacing(true);
addComponent(layoutForButtonAndWindow);
return this;
}
private void buttonAction(Button buttonForWindow) {
buttonForWindow.addClickListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
Window window = new Window();
window.setModal(true);
FileResource fileResource = new FileResource(new File(
"E:/wersja z 18,04,2018/app4train/app4train-web/src/main/webapp/VAADIN/videos/4.mp4"));
prepareVideo(fileResource);
prepareLabelsForExplanation();
layoutForLabelAndVideo = new VerticalLayout();
layoutForLabelAndVideo.addComponents(
throughtExplanationOfExerciseFourPart1,
throughtExplanationOfExerciseFourPart2,
video);
layoutForLabelAndVideo.setSizeUndefined();
window.setContent(layoutForLabelAndVideo);
window.setSizeFull();
UI.getCurrent().addWindow(window);
}
});
}
private void prepareLabelsForExplanation() {
throughtExplanationOfExerciseFourPart1 = new Label(
"<b>W pozycji siedzącej na ławce, sztanga trzymana nachwytem, szerokość rozstawu rąk powinien być większy niż rozstaw barków. Kąt ustawienia<br>"
+ " ławki w ramach tego ćwiczenia powinien wynosić od 40 do 60 stopni:",
ContentMode.HTML);
throughtExplanationOfExerciseFourPart2 = new Label(
"<b><ul><li>wziąć wdech a następnie opuścić sztangę w \r\n"
+ "okolice wcięcia szyjnego mostka (ruch w tej fazie powinien być wolniejszy w celu odpowiedniego rozciągnięcia mięśni)</li><li>wycisnąć sztangę wykonująć w końcowej fazie ruchu wydech (ruch w tej fazie powinien być szybki)</li></ul><br></b>",
ContentMode.HTML);
throughtExplanationOfExerciseFourPart1.setStyleName("throughtExplanationOfExerciseFourPart1");
throughtExplanationOfExerciseFourPart1.addStyleName(ValoTheme.TEXTAREA_ALIGN_CENTER);
throughtExplanationOfExerciseFourPart2.setStyleName("throughtExplanationOfExerciseFourPart2");
}
private void prepareVideo(FileResource fileResource) {
video = new Video("video");
video.setSource(fileResource);
video.setSizeUndefined();
video.setCaption("Film instruktarzowy");
}
}
public Component createComponent() {
return new ExerciseFourLayout().init();
}
}
|
[
"[email protected]"
] | |
d50770079ce56510a518d7412eea57539ad7a53d
|
86198aecfb4c8031c629d20b17148256c93224fe
|
/src/br/com/caelum/financas/modelo/Conta.java
|
7df5b35d09d3db4afa931a3536c1da38b3417839
|
[] |
no_license
|
thiagoleme/curso-jpa
|
b69054dfc7339acd6e52e347e8611ce412fc4ac7
|
917687ee23506d339619bc5e05982c3249227f25
|
refs/heads/master
| 2021-01-10T02:31:18.012280 | 2016-02-16T19:05:59 | 2016-02-16T19:05:59 | 51,609,275 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,614 |
java
|
package br.com.caelum.financas.modelo;
import java.math.BigDecimal;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
@Entity
@SequenceGenerator(name = "SEQ_CONTAS", sequenceName = "SEQ_CONTAS", initialValue = 1)
public class Conta {
private String agencia;
private String banco;
@Id
@GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ_CONTAS")
private Integer id;
private String numero;
private BigDecimal saldo;
private String titular;
@OneToMany(mappedBy = "conta")
private List<Movimentacao> movimentacoes;
public List<Movimentacao> getMovimentacoes() {
return movimentacoes;
}
public String getAgencia() {
return agencia;
}
public String getBanco() {
return banco;
}
public Integer getId() {
return id;
}
public String getNumero() {
return numero;
}
public BigDecimal getSaldo() {
return saldo;
}
public String getTitular() {
return titular;
}
public void setAgencia(String agencia) {
this.agencia = agencia;
}
public void setBanco(String banco) {
this.banco = banco;
}
public void setId(Integer id) {
this.id = id;
}
public void setNumero(String numero) {
this.numero = numero;
}
public void setSaldo(BigDecimal saldo) {
this.saldo = saldo;
}
public void setMovimentacoes(List<Movimentacao> movimentacoes) {
this.movimentacoes = movimentacoes;
}
public void setTitular(String titular) {
this.titular = titular;
}
}
|
[
"[email protected]"
] | |
7e72706fb47362a0c5fc1484fc8acb4adb4f42d0
|
7bff647e52be65b21c0b6fecb76c36bbce589048
|
/item-add-display/src/com/hsbc/controller/ItemServlet.java
|
0935b9547a8f15211527de250b77b1b4c63a7e7a
|
[] |
no_license
|
ronakagarwal1702/handson-assignments
|
516ab43b85361f502ae256e1b0f48064834b1a38
|
004d2701904ae45d5c40da2bd2c9e8112c6f5edf
|
refs/heads/master
| 2022-12-27T10:55:06.308893 | 2020-10-13T15:17:42 | 2020-10-13T15:17:42 | 295,698,450 | 0 | 0 | null | 2020-09-15T10:56:02 | 2020-09-15T10:56:01 | null |
UTF-8
|
Java
| false | false | 1,906 |
java
|
package com.hsbc.controller;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
/**
* Servlet implementation class ItemServlet
*/
@WebServlet("/ItemServlet")
public class ItemServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public ItemServlet() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
response.getWriter().append("Served at: ").append(request.getContextPath());
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
HttpSession session = request.getSession();
List<String> l=null;
String item = request.getParameter("it");
if(session.getAttribute("key1")==null)
{
l=new ArrayList<>();
l.add(item);
}
else
{
l=(List<String>)session.getAttribute("key1");
l.add(item);
}
session.setAttribute("key1", l);
PrintWriter pw = response.getWriter();
pw.print("<html><body><h>");
pw.println("item count= "+l.size());
pw.print("</h></body></html>");
RequestDispatcher rd = request.getRequestDispatcher("item.html");
rd.include(request,response);
}
}
|
[
"[email protected]"
] | |
9fcdbd9f43e1c8393a89f5e99a4f9266ef471ed0
|
3d9b0247e2b4f2d8730741367abcb0f0e514f73f
|
/src/test/java/assumptions/AssumptionsTest.java
|
0b80a926f4a19a3d7bf16eee01ad7c4f8a02f62a
|
[] |
no_license
|
utopia90/junit-maven
|
9e7bdd41ed4a5fa3efb5c1bdb5a41af0b2d74ad5
|
34be6eda00772315d5ed2df08e0090238a1b84a8
|
refs/heads/master
| 2023-03-13T06:19:10.405101 | 2021-02-24T16:59:23 | 2021-02-24T16:59:23 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 375 |
java
|
package assumptions;
//import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assumptions.*;
public class AssumptionsTest {
@Test
void prueba1(){
String destktop = System.getenv("DESKTOP_SESSION");
assumeTrue("windows".equals(destktop));
System.out.println("hola!!");
}
}
|
[
"[email protected]"
] | |
d897e1fd36b62444b1e3fb05fd945963623f462b
|
49c6cf776addc6fbac50c887edfa168d81aa7729
|
/CodeChef/SeptLongChallenge/PointMeeting.java
|
acb874ab9b834c3f63838b949213217771530b5f
|
[] |
no_license
|
Ryednap/Coding-Competition
|
b43e38b4e8d3bfc7eee21750cd1014fb4ce49c54
|
a4fd7b97f3898e60800689fe27b8c00ac8a456fa
|
refs/heads/main
| 2023-08-19T06:55:04.344956 | 2021-10-08T05:59:24 | 2021-10-08T05:59:24 | 398,359,907 | 0 | 0 | null | 2021-08-28T12:33:09 | 2021-08-20T17:55:14 |
C++
|
UTF-8
|
Java
| false | false | 2,380 |
java
|
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.*;
public class PointMeeting {
static FastScanner fs = new FastScanner();
public static void main (String [] args) {
int t = fs.nextInt();
while (t-- > 0) {
int n = fs.nextInt();
int [] X = fs.readArray(n);
int [] Y = fs.readArray(n);
int [][] dp = new int[n][n];
for (int [] ar : dp) {
Arrays.fill(ar, (int)1e9);
}
for (int i = 0; i < n; ++i) {
dp[i][i] = 0;
for (int j = i + 1; j < n; ++j) {
int x = Math.abs(X[i] - X[j]);
int y = Math.abs(Y[i] - Y[j]);
int moves = 0;
if (x == 0 && y == 0) moves = 0;
else if (x == 0 || y == 0 || x == y) moves = 1;
else moves = 2;
dp[i][j] = dp[j][i] = moves;
}
}
for (int k = 0; k < n; ++k) {
for (int i = 0; i < n; ++i) {
for (int j = 0; j < n; ++j) {
dp[i][j] = Math.min(dp[i][j], dp[i][k] + dp[k][j]);
}
}
}
int answer = (int)1e9;
for (int [] ar : dp) {
System.out.println(Arrays.toString(ar));
answer = Math.min(answer, Arrays.stream(ar).sum());
}
System.out.println(answer);
}
}
static class FastScanner {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer token = new StringTokenizer("");
String next () {
while (!token.hasMoreTokens()) {
try {
token = new StringTokenizer(br.readLine());
} catch (IOException ie) {
ie.printStackTrace();
}
}
return token.nextToken();
}
int nextInt () {
return Integer.parseInt(next());
}
int [] readArray (int n) {
int [] a = new int [n];
for (int i = 0; i < n; ++i) {
a[i] = nextInt();
}
return a;
}
}
}
|
[
"[email protected]"
] | |
6c04c2e3c610bcfec5cabc9672d4a4a768f9c98d
|
42cd53f184f3b5c6c27d715f6d8a67eaeaa91aca
|
/app/src/main/java/tam/pa/komik/activity/genrePage/adapter/PopulerAdapter.java
|
72b9707157f537b2232e4bfb634e0f7e4290f06b
|
[] |
no_license
|
Tamrizki/Aplikasi-Baca-Komik
|
6f9ec7ad739d4ee4120394418085d8f8e7418d23
|
4345cc3f7db281f68cc60fd70ec3a0c6d83e9f28
|
refs/heads/master
| 2022-12-28T03:54:22.519865 | 2020-10-17T01:19:21 | 2020-10-17T01:19:21 | 304,760,394 | 2 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,653 |
java
|
package tam.pa.komik.activity.genrePage.adapter;
import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.squareup.picasso.Picasso;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import tam.pa.komik.R;
import tam.pa.komik.activity.detailKomik.DetailKomikActivity;
import tam.pa.komik.model.PopulerListItem;
public class PopulerAdapter extends RecyclerView.Adapter<PopulerAdapter.viewHolder> {
private Context context;
private List<PopulerListItem>listPopuler;
public PopulerAdapter(Context context, List<PopulerListItem> listPopuler) {
this.context = context;
this.listPopuler = listPopuler;
}
@NonNull
@Override
public viewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.custom_list_komik, parent, false);
return new viewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull viewHolder holder, final int position) {
holder.bind(listPopuler.get(position));
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(context, DetailKomikActivity.class);
intent.putExtra("endpoint", listPopuler.get(position).getEndpoint());
context.startActivity(intent);
}
});
}
@Override
public int getItemCount() {
return listPopuler.size();
}
public class viewHolder extends RecyclerView.ViewHolder {
@BindView(R.id.ivThumbnail)
ImageView ivThumbnail;
@BindView(R.id.tvChapter) TextView tvType;
@BindView(R.id.tvTitle) TextView tvTitle;
@BindView(R.id.tvUpdate) TextView tvUpdate;
public viewHolder(@NonNull View itemView) {
super(itemView);
ButterKnife.bind(this, itemView);
}
public void bind(PopulerListItem populerListItem) {
Picasso.get()
.load(populerListItem.getThumb())
.fit()
.into(ivThumbnail);
tvType.setText(populerListItem.getType());
tvTitle.setText(populerListItem.getTitle());
tvUpdate.setText(populerListItem.getUploadOn());
}
}
}
|
[
"[email protected]"
] | |
5749bbd67054dda24ad39b60e851781653c91140
|
ebbeb731b6df8cadf834dbaa090ada6e26eaaaa6
|
/app/src/main/java/com/example/gramairefacile/activities/InterrogatifActivity.java
|
b5ec4d3bf671e297b539b614d7feb9dad3c0e74c
|
[] |
no_license
|
Ifs006/grammaire-facile
|
49b81e15c4e24ed616d5af267e0c15d9fa294688
|
4901ae148d11fd4648543bea8d43790f1b6bb7cf
|
refs/heads/master
| 2020-07-07T22:01:47.292436 | 2019-11-05T03:48:48 | 2019-11-05T03:48:48 | 203,488,057 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,581 |
java
|
package com.example.gramairefacile.activities;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.widget.ImageButton;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import com.example.gramairefacile.R;
import com.example.gramairefacile.database.DatabaseHelper;
import com.example.gramairefacile.database.model.Interrogatif;
import java.util.List;
public class InterrogatifActivity extends AppCompatActivity {
private Toolbar toolbar;
private TextView titleToolbar;
private DatabaseHelper db;
private List<Interrogatif> dataList;
private ImageButton ibtnBack;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_detail_materi);
db = new DatabaseHelper(this);
initView();
}
private void initView() {
toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayShowTitleEnabled(false);
titleToolbar = findViewById(R.id.title_toolbar);
titleToolbar.setText("Interrogatif");
titleToolbar.setGravity(Gravity.CENTER);
ibtnBack = findViewById(R.id.btn_back);
ibtnBack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
dataList = db.getMateriByType(Interrogatif.class);
}
}
|
[
"[email protected]"
] | |
49919721837e3f012e5e78a3317ff0894f68faaa
|
e98facbcbb88799329f0d4c76f7bb01ee62618a9
|
/src/main/java/com/algaworks/vinhos/OficinaSpringFrameworkApplication.java
|
ea3e17a4a3b6405fcd1593a7c73ad427c0fdefd5
|
[] |
no_license
|
RayssaNeder/Loja-de-Vinhos
|
292024dd77b0395e0080f22ca0f33f4284609a1d
|
3770a29d50619bd5f79f3eaaa679aef806c669bb
|
refs/heads/master
| 2020-03-12T12:30:06.849725 | 2018-04-23T00:31:48 | 2018-04-23T00:31:48 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 344 |
java
|
package com.algaworks.vinhos;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class OficinaSpringFrameworkApplication {
public static void main(String[] args) {
SpringApplication.run(OficinaSpringFrameworkApplication.class, args);
}
}
|
[
"[email protected]"
] | |
691ed9dc9e1c80bc11f7610e5d9fb9574ed17e45
|
dc48f2bb7ba6026a9ef4f58903ea315546325796
|
/health_service_provider/src/main/java/com/youle/service/impl/AddressServiceImpl.java
|
d5a17336e35d3069651e0594fd76f750286be0fb
|
[] |
no_license
|
wug924694/Dubbo_Code
|
77cbc088f9015e69f4dd6daa898f86da67afc6c0
|
70f840359e5e961353f3418af3a96850cd2a19d5
|
refs/heads/master
| 2022-12-25T10:19:49.999222 | 2020-09-25T08:21:06 | 2020-09-25T08:21:06 | 298,511,902 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,775 |
java
|
package com.youle.service.impl;
import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.youle.constant.RedisConstant;
import com.youle.dao.AddressDao;
import com.youle.entiy.PageResult;
import com.youle.entiy.QueryPageBean;
import com.youle.pojo.Address;
import com.youle.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import redis.clients.jedis.JedisPool;
import java.util.List;
@Service(interfaceClass = AddressService.class)
public class AddressServiceImpl implements AddressService {
@Autowired
private AddressDao addressDao;
@Autowired
private JedisPool jedisPool;
@Override
public void add(Address address) {
addressDao.add(address);
//将图片名称存储到redis
String img = address.getImg();
jedisPool.getResource().sadd(RedisConstant.SETMEAL_PIC_DB_RESOURCES,img);
}
@Override
public PageResult pageQuery(QueryPageBean queryPageBean) {
Integer currentPage = queryPageBean.getCurrentPage();
Integer pageSize = queryPageBean.getPageSize();
String queryString = queryPageBean.getQueryString();
PageHelper.startPage(currentPage,pageSize);
Page<Address> page = addressDao.selectByCondition(queryString);
long total = page.getTotal();
List<Address> result = page.getResult();
return new PageResult(total,result);
}
@Override
public Address findById(Integer id) {
return addressDao.findById(id);
}
@Override
public void edit(Address address) {
addressDao.edit(address);
}
@Override
public void delete(Integer id) {
addressDao.delete(id);
}
}
|
[
"[email protected]"
] | |
1450ed3747fb7a23d7c09ef42eb3034f6343b49a
|
bd729ef9fcd96ea62e82bb684c831d9917017d0e
|
/StatisticAnalysisServer/src/com/caits/analysisserver/quartz/jobs/impl/OilConsumeMonthstatJobdetail.java
|
465cc0a9c05dc5d4ba505eb5429edebab54d72a0
|
[] |
no_license
|
shanghaif/workspace-kepler
|
849c7de67b1f3ee5e7da55199c05c737f036780c
|
ac1644be26a21f11a3a4a00319c450eb590c1176
|
refs/heads/master
| 2023-03-22T03:38:55.103692 | 2018-03-24T02:39:41 | 2018-03-24T02:39:41 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 4,598 |
java
|
package com.caits.analysisserver.quartz.jobs.impl;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Types;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.caits.analysisserver.database.OracleConnectionPool;
import com.caits.analysisserver.database.SQLPool;
/**
*
* <p>
* -----------------------------------------------------------------------------
* <br>
* 工程名 : StatisticAnalysisServer <br>
* 功能: <br>
* 描述: <br>
* 授权 : (C) Copyright (c) 2011 <br>
* 公司 : 北京中交兴路信息科技有限公司 <br>
* -----------------------------------------------------------------------------
* <br>
* 修改历史 <br>
* <table width="432" border="1">
* <tr>
* <td>版本</td>
* <td>时间</td>
* <td>作者</td>
* <td>改变</td>
* </tr>
* <tr>
* <td>1.0</td>
* <td>2013-01-16</td>
* <td>yujch</td>
* <td>创建</td>
* </tr>
* </table>
* <br>
* <font color="#FF0000>注意: 本内容仅限于[北京中交兴路信息科技有限公司]内部使用,禁止转发</font> <br>
*
* @version 1.0
*
* @author yujch
* @since JDK1.6
*/
public class OilConsumeMonthstatJobdetail {
private static final Logger logger = LoggerFactory
.getLogger(OilConsumeMonthstatJobdetail.class);
// ------获得xml拼接的Sql语句
private String statOilConsumeMonthstatSql; // 保存企业日车辆告警情况
// private int count = 0;// 计数器
/*private long statDate;
private long beginTime;
private long endTime;*/
private String statMonth;
/**
* 初始化统计周期:传入日期
*
* @param statDate
* 当日12点日期时间
*/
public OilConsumeMonthstatJobdetail(int year,int month) {
/*this.beginTime = CDate.getFirstDayOfMonth(year,month).getTime();//当月第一天零点
this.endTime = CDate.getDateFromParam(CDate.getFirstDayOfMonth(year,month),0,1,1,0,0,0,0).getTime();//下月第一天零点
*/
if (month<10){
this.statMonth = year+"0"+month;
}else{
this.statMonth = year+""+month;
}
this.initAnalyser();
}
// 初始化方法
public void initAnalyser() {
// 调用燃油消耗月统计存储过程
statOilConsumeMonthstatSql = SQLPool.getinstance().getSql(
"sql_procOilConsumeMonthStat");
}
/**
* 生成车辆日运营属性
*
* @param
* @return int 0:执行失败, 1执行成功
*/
public int executeStatRecorder() {
//PreparedStatement dbPstmt0 = null;
CallableStatement dbPstmt1 = null;
/*PreparedStatement dbPstmt2 = null;
PreparedStatement dbPstmt3 = null;*/
Connection dbConnection = null;
// 结果集对象
//ResultSet dbResultSet = null;
// 成功标志位 0:执行失败, >=1执行成功,成功解析个数
int flag = 0;
try {
// 获得Connection对象
dbConnection = OracleConnectionPool.getConnection();
if (dbConnection != null) {
// 删除7日前车辆运营属性,即此数据保留7日
/*
* dbPstmt0 = dbConnection
* .prepareStatement(delOrgOpterationDaystatSql);
* dbPstmt0.setLong(1, statDate - 1000 * 60 * 60 * 24 * 7);
* dbPstmt0.executeUpdate();
*/
// 统计当月燃油消耗情况
dbPstmt1 = dbConnection
.prepareCall(statOilConsumeMonthstatSql);
dbPstmt1.setString(1, statMonth);
dbPstmt1.registerOutParameter(2, Types.INTEGER);
dbPstmt1.execute();
int successtag = dbPstmt1.getInt(2);
if (successtag == 1) {
logger.debug(statMonth + "车辆燃油消耗月统计信息生成成功!");
}else{
logger.error(statMonth+ "车辆燃油消耗月统计统计信息生成出错!");
}
flag = 1;
} else {
logger.debug("获取数据库链接失败");
}
} catch (Exception e) {
logger.error("生成车辆燃油消耗月统计信息出错:", e);
flag = 0;
} finally {
try {
/*if (dbResultSet != null) {
dbResultSet.close();
}
if (dbPstmt0 != null) {
dbPstmt0.close();
}*/
if (dbPstmt1 != null) {
dbPstmt1.close();
}
/*if (dbPstmt2 != null) {
dbPstmt2.close();
}
if (dbPstmt3 != null) {
dbPstmt3.close();
}*/
if (dbConnection != null) {
dbConnection.close();
}
} catch (SQLException e) {
logger.error("连接放回连接池出错.", e);
}
}
return flag;
}
/**
* 将空值转换为空字符串
*
* @param str
* 字符串
* @return String 返回处理后的字符串
*/
public static String nullToStr(String str) {
return str == null || str.equals("null") ? "" : str.trim();
}
}
|
[
"[email protected]"
] | |
c48beb524774223b0329f2e8b8cb74925147516d
|
c0ddef0eca4dd52448f72e88e9eb8f6f55ec5ad4
|
/src/main/java/com/example/demo/student/StudentService.java
|
a4acdb5ecccccdc1d3b900478434a4d0a9b7e2e3
|
[] |
no_license
|
arasfi/Java-Sprint-Boot-Api-PostgreSQL-JPA
|
11dd3c2d74ab33179cab9a6c7bab30d67a856821
|
abd77da3136dec8f7284ae2206734e42ee7ff6de
|
refs/heads/master
| 2023-03-11T23:03:43.295513 | 2021-03-05T02:19:53 | 2021-03-05T02:19:53 | 342,058,648 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,194 |
java
|
package com.example.demo.student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
import java.time.LocalDate;
import java.time.Month;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
@Service
public class StudentService {
private final StudentRepository studentRepository;
@Autowired
public StudentService(StudentRepository studentRepository) {
this.studentRepository = studentRepository;
}
public List<Student> getStudents() {
return studentRepository.findAll();
}
public void addNewStudent(Student student) throws IllegalAccessException {
Optional<Student> studentOptional = studentRepository.findStudentByEmail(student.getEmail());
if (studentOptional.isPresent()) {
throw new IllegalAccessException("email taken");
}
studentRepository.save(student);
}
public void deleteStudent(Long studentId) {
boolean exists = studentRepository.existsById(studentId);
if (!exists) {
throw new IllegalStateException("student with id " + studentId + " does not exists");
}
studentRepository.deleteById(studentId);
}
@Transactional
public void updateStudent(Long studentId, String name, String email) {
Student student = studentRepository.findById(studentId)
.orElseThrow(() -> new IllegalStateException(
"student with id" + studentId + "does not exists"
));
if (name != null
&& name.length() > 0
&& !Objects.equals(student.getName(), name)) {
student.setName(name);
}
if (email != null &&
email.length() > 0 &&
!Objects.equals(student.getEmail(), email)) {
Optional<Student> studentOptional = studentRepository
.findStudentByEmail(email);
if (studentOptional.isPresent()) {
throw new IllegalStateException("email taken");
}
student.setEmail(email);
}
}
}
|
[
"[email protected]"
] | |
0c433bb8dbf8e45bd47141072506514c1e9202a9
|
9df5fe6d3e408f90f34178127f9ef62f2b7f94ab
|
/memory/src/main/java/第八章/DynamicDispath.java
|
07469cb9b4636e4a42acf93742361ba8930b7ea4
|
[] |
no_license
|
zhouxin36/jvm
|
e5a74f32b66c11e4e7b87b2c7825dd8ad93d633a
|
857bbe022975ccad73df11b8987ece6ef92fb2d5
|
refs/heads/master
| 2020-03-25T04:14:42.257308 | 2018-10-10T08:40:23 | 2018-10-10T08:40:23 | 143,384,998 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 673 |
java
|
package 第八章;
public class DynamicDispath {
static abstract class Human{
protected abstract void sayHello();
}
static class Man extends Human{
@Override
protected void sayHello() {
System.out.println("man say hello");
}
}
static class Woman extends Human{
@Override
protected void sayHello() {
System.out.println("woman say hello");
}
}
public static void main(String[] args) {
Human man = new Man();
Human woman = new Woman();
man.sayHello();
woman.sayHello();
man = new Woman();
man.sayHello();
}
}
|
[
"[email protected]"
] | |
355a93378b3af2a7bd0de4c3fe1e2a0898ce68c6
|
d025b34d2ded3441f2bca4409389bcabbe949582
|
/src/com/ruks/story/AdditionStory.java
|
d9d97218dacec4f53c968d8048f4b1569f8acfe9
|
[] |
no_license
|
SuKondal/Calculator_TestBox
|
8b97fca17f1c7d69e99ec0661abea850d9c5e728
|
0260acc7b9f02317d77ca93acc8ebc869526cc73
|
refs/heads/master
| 2021-01-10T15:09:44.422024 | 2016-01-26T10:22:22 | 2016-01-26T10:22:22 | 50,422,310 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,377 |
java
|
package com.ruks.story;
import java.util.ArrayList;
import java.util.List;
import org.jbehave.core.configuration.Configuration;
import org.jbehave.core.configuration.MostUsefulConfiguration;
import org.jbehave.core.io.CodeLocations;
import org.jbehave.core.io.LoadFromClasspath;
import org.jbehave.core.io.StoryFinder;
import org.jbehave.core.junit.JUnitStories;
import org.jbehave.core.junit.JUnitStory;
import org.jbehave.core.reporters.Format;
import org.jbehave.core.reporters.StoryReporterBuilder;
import org.jbehave.core.steps.InjectableStepsFactory;
import org.jbehave.core.steps.InstanceStepsFactory;
import com.ruks.step.AdditionStep;
public class AdditionStory extends JUnitStories{
// @Override
public Configuration configuration() {
return new MostUsefulConfiguration()
// where to find the stories
.useStoryLoader(new LoadFromClasspath(this.getClass()))
// CONSOLE and TXT reporting
.useStoryReporterBuilder(
new StoryReporterBuilder().withDefaultFormats()
.withFormats(Format.CONSOLE, Format.TXT));
}
@Override
public InjectableStepsFactory stepsFactory() {
return new InstanceStepsFactory(configuration(),new AdditionStep());
}
@Override
protected List<String> storyPaths() {
return new StoryFinder().findPaths(CodeLocations.codeLocationFromClass(this.getClass()), "**/*addition*.story", "");
}
}
|
[
"[email protected]"
] | |
182291128d9949aabe1cf5c96d4336da1fab1545
|
112330454b95bb237bcbf9714bb732d0a40384aa
|
/Backend/src/main/java/nl/pietervanturennout/utils/Headers.java
|
5c93127981be9a6da823446f4f59494a736ec30d
|
[] |
no_license
|
PvanTurennout/IPRWC
|
4caf81306c638765997be5830f5c84ccb195735c
|
93d475c66b86ee341e4a6630c46dd40fb05a0183
|
refs/heads/master
| 2023-02-25T03:56:57.319135 | 2021-01-25T00:21:10 | 2021-01-25T00:21:10 | 331,122,580 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,233 |
java
|
package nl.pietervanturennout.utils;
import nl.pietervanturennout.exceptions.InvalidOperationException;
import java.util.*;
public class Headers {
public static final List<String> singleValueHeaders;
private Headers() { }
public static Map<String, Float> parseAccept(String accept) {
return parseAccept(accept, false);
}
public static Map<String, Float> parseAccept(String accept, boolean strict) {
if (accept == null)
accept = "";
accept = accept.trim();
Map<String, Float> accepts = new HashMap<>();
if (!accept.isEmpty()) {
String[] raws = accept.split(",");
for (String raw : raws) {
String[] parts = raw.split(";");
float weight = 1f;
if (parts.length == 2) {
String q = parts[1].trim();
if (q.startsWith("q=")) {
q = q.substring(2).trim();
try {
weight = Float.parseFloat(q);
if (weight < 0f || weight > 1f) {
if (strict)
throw new InvalidOperationException(
"Malformed header; Weight greater then 1.0 or lower then 0.0");
weight = Math.max(Math.min(weight, 1f), 0f);
}
}
catch (NumberFormatException e) {
if (strict)
throw new InvalidOperationException("Malformed header; bad formatted weight (q=)", e);
}
}
else if (strict)
throw new InvalidOperationException("Malformed header; invalid parameter (no q= match)");
}
accepts.put(parts[0].trim(), weight);
}
}
return accepts;
}
public static String bestAcceptMatch(Map<String, Float> accept) {
return bestAcceptMatch(accept, "*/*");
}
public static String bestAcceptMatch(Map<String, Float> accepts, String anyDefault) {
String highestMime = "*/*";
float highestWeight = 0f;
for (Map.Entry<String, Float> accept : accepts.entrySet())
if (accept.getValue() > highestWeight) {
highestMime = accept.getKey();
highestWeight = accept.getValue();
}
return highestMime.equals("*/*")
? anyDefault
: highestMime;
}
public static String bestAcceptMatch(String accept) {
return bestAcceptMatch(parseAccept(accept));
}
public static String bestAcceptMatch(String accept, String anyDefault) {
return bestAcceptMatch(parseAccept(accept), anyDefault);
}
public static boolean isSingleValueHeader(String header) {
return singleValueHeaders.contains(header.toLowerCase());
}
static {
ArrayList<String> headers = new ArrayList<>();
headers.add("content-type");
singleValueHeaders = Collections.unmodifiableList(headers);
}
}
|
[
"[email protected]"
] | |
761b3833101e3f5a4da137cf2419d0fce64321f0
|
92a6a85189178e02fd164af59ab74e1c090f72e0
|
/src/com/Section7_OOP_Part_2/Lamp.java
|
c9ded5cbe85fc622b40e9f0c0c97a15571b0d1d9
|
[] |
no_license
|
wavrick/Java-Programming-Masterclass-for-Software-Developers
|
6b45d315f4d700dc0dce1d9a781cf1ee283a3fb1
|
34f7fd23cda02d913e3d47e42ba530efe05ad7c9
|
refs/heads/main
| 2023-04-01T04:44:21.287905 | 2021-04-15T08:21:51 | 2021-04-15T08:21:51 | 345,015,294 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 607 |
java
|
package com.Section7_OOP_Part_2;
public class Lamp {
private String style;
private boolean battery;
private int globRating;
public Lamp(String style, boolean battery, int globRating) {
this.style = style;
this.battery = battery;
this.globRating = globRating;
}
public String getStyle() {
return this.style;
}
public int getGlobRating() {
return this.globRating;
}
public void turnOn() {
System.out.println("Lamp is being turned on");
}
public boolean isBattery() {
return this.battery;
}
}
|
[
"[email protected]"
] | |
cc09f1bfb790e2b67d54481f0cd1a00106adce82
|
e91853ae0cdb848ec9fcf5343b6a844e0fdd3e76
|
/src/Praktek2.java
|
a221e40e27c1a04c8cd7e331d65a41e68954390c
|
[] |
no_license
|
MuhammadBagasRamadhan/OperasiString
|
a0120dc307d0a6fd8102c9fa9e47f8ce36b44ecc
|
315f96acb95aa71a5d82110a6b9b24cb4d535ed3
|
refs/heads/master
| 2020-03-26T06:03:34.678912 | 2018-08-14T11:52:03 | 2018-08-14T11:52:03 | 144,587,386 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,887 |
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.
*/
import java.util.Scanner;
/**
*
* @author User
*/
public class Praktek2 {
private static void tampilJudul(String identitas)
{
System.out.println("Identitas : "+ identitas);
System.out.println("\nConvert Kalimat Alay Angka (Vokal Ke Angka\n");
}
private static String tampilInput() {
Scanner scanner = new Scanner(System.in);
System.out.println("Masukan Kalimat : ");
String kalimat = scanner.nextLine();
System.out.println("Kalimat Asli : " + kalimat );
return kalimat;
}
private static String vocal2Angka(String kalimat) {
char [][] arConvert =
{{'a','4'},{'i','1'},{'u','2'},{'e','3'},{'o','0'}};
kalimat = kalimat.toLowerCase();
for(int i=0;i<arConvert.length;i++)
kalimat = kalimat.replace(arConvert[i][0], arConvert[i][1]);
return kalimat;
}
private static void tampilPerkata(String kalimat, String convert) {
String[] arrKal = kalimat.split(" ");
String[] arrCon = convert.split(" ");
for(int i=0;i<arrKal.length;i++)
System.out.println(arrKal[i]+" => "+arrCon[i]);
}
private static void tampilHasil(String convert) {
System.out.println("Kalimat Alay Angka : " + convert);
}
public static void main(String[] args) {
String identitas = "MUHAMMAD BAGAS RAMADHAN / XRPL2 / 21";
tampilJudul(identitas);
String kalimat = tampilInput();
String convert = vocal2Angka(kalimat);
tampilPerkata(kalimat, convert);
tampilHasil(convert);
}
}
|
[
"User@User"
] |
User@User
|
7ff6b1c23bbd0211e473b7b95de2ed4c4276bcc8
|
6bf967d37e850d84b2859de77c9723d636f09da9
|
/src/com/ad/acp/client/Client.java
|
bb5a662757414c12dcef2b07e9481bbaa2894873
|
[] |
no_license
|
aakash791/AcademyPortalApplicationV1.0
|
4505817cda0e0b0dd1439ea2b34aaea200a84873
|
099b0fde39555dc8d5927dfc86e004de42f6b8e9
|
refs/heads/master
| 2020-08-16T08:24:25.865025 | 2019-10-16T11:50:11 | 2019-10-16T11:50:11 | 215,479,445 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 250 |
java
|
package com.ad.acp.client;
import com.ad.acp.controller.LoginController;
public class Client {
public static void main(String[] args) {
LoginController loginController=new LoginController();
loginController.excuteFrontController();
}
}
|
[
"[email protected]"
] | |
35006d5fd35e232191f78df9b7a728b16dbefd94
|
5012910010ee0ecf4455004ddc2dc4ce2e2d5b7d
|
/app/src/main/java/ds/pinvent/model/MainActivityViewModel.java
|
8b5788ac83546da9ea7dc33f4d00504fbd471090
|
[] |
no_license
|
mzc1986/pinventory
|
f076b44b4e7ba8a382c94337b39e209d98deb4cf
|
3c30007a0659f8910ff0a6fe09d4b74630780ebb
|
refs/heads/master
| 2023-03-26T00:29:32.875899 | 2021-03-30T12:41:46 | 2021-03-30T12:41:46 | 352,996,156 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,569 |
java
|
package ds.pinvent.model;
import android.app.Application;
import android.os.AsyncTask;
import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import java.util.List;
import ds.pinvent.model.database.DatabaseClient;
public class MainActivityViewModel extends AndroidViewModel {
private MutableLiveData<List<Product>> products;
public MainActivityViewModel(@NonNull Application application) {
super(application);
}
public LiveData<List<Product>> getProductsList() {
if (products == null) {
products = new MutableLiveData<List<Product>>();
getProducts();
}
return products;
}
private void getProducts() {
class GetProducts extends AsyncTask<Void, Void, List<Product>> {
@Override
protected List<Product> doInBackground(Void... voids) {
List<Product> productList = DatabaseClient
.getInstance(getApplication().getApplicationContext())
.getAppDatabase()
.productDAO()
.getAll();
return productList;
}
@Override
protected void onPostExecute(List<Product> productList) {
super.onPostExecute(productList);
products.setValue(productList);
}
}
GetProducts getProducts = new GetProducts();
getProducts.execute();
}
}
|
[
"[email protected]"
] | |
eb91ef0594fcafd03a5a2dfd775a32c5c8c2b903
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/32/32_e2c665339c2c7568cf07425d176ed3369f88ce33/JPAReportService/32_e2c665339c2c7568cf07425d176ed3369f88ce33_JPAReportService_s.java
|
ad884c30b73f4c233884807d280dddcaa68f706f
|
[] |
no_license
|
zhongxingyu/Seer
|
48e7e5197624d7afa94d23f849f8ea2075bcaec0
|
c11a3109fdfca9be337e509ecb2c085b60076213
|
refs/heads/master
| 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null |
UTF-8
|
Java
| false | false | 5,289 |
java
|
package org.gwaspi.dao.jpa;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.NoResultException;
import javax.persistence.PersistenceException;
import javax.persistence.Query;
import org.gwaspi.dao.ReportService;
import org.gwaspi.dao.sql.ReportServiceImpl;
import org.gwaspi.model.Operation;
import org.gwaspi.model.Report;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* JPA implementation of a report service.
* Uses abstracted DB access to store data,
* see persistence.xml for DB settings.
*/
public class JPAReportService implements ReportService {
private static final Logger LOG
= LoggerFactory.getLogger(JPAReportService.class);
private final EntityManagerFactory emf;
public JPAReportService(EntityManagerFactory emf) {
this.emf = emf;
}
private EntityManager open() {
EntityManager em = emf.createEntityManager();
return em;
}
private void begin(EntityManager em) {
em.getTransaction().begin();
}
private void commit(EntityManager em) {
em.getTransaction().commit();
}
private void rollback(EntityManager em) {
if (em == null) {
LOG.error("Failed to create an entity manager");
} else {
try {
if (em.isOpen() && em.getTransaction().isActive()) {
em.getTransaction().rollback();
} else {
LOG.error("Failed to rollback a transaction: no active"
+ " connection or transaction");
}
} catch (PersistenceException ex) {
LOG.error("Failed to rollback a transaction", ex);
}
}
}
private void close(EntityManager em) {
if (em == null) {
LOG.error("Failed to create an entity manager");
} else {
try {
if (em.isOpen()) {
em.close();
}
} catch (IllegalStateException ex) {
LOG.error("Failed to close an entity manager", ex);
}
}
}
@Override
public Report getById(int reportId) throws IOException {
Report report = null;
EntityManager em = null;
try {
em = open();
Query query = em.createNamedQuery("report_fetchById");
query.setParameter("id", reportId);
report = (Report) query.getSingleResult();
} catch (NoResultException ex) {
LOG.error("Failed fetching a report by id: " + reportId
+ " (id not found)", ex);
} catch (Exception ex) {
LOG.error("Failed fetching a report by id: " + reportId, ex);
} finally {
close(em);
}
return report;
}
@Override
public List<Report> getReportsList(int parentOperationId, int parentMatrixId) throws IOException {
List<Report> reports = Collections.EMPTY_LIST;
EntityManager em = null;
try {
em = open();
Query query = em.createNamedQuery(
"report_fetchByParentOperationIdParentMatrixId");
query.setParameter("parentOperationId", parentOperationId);
query.setParameter("parentMatrixId", parentMatrixId);
reports = (List<Report>) query.getResultList();
} catch (NoResultException ex) {
LOG.error("Failed fetching a report by"
+ ": parent-operation-id: " + parentOperationId
+ ", parent-matrix-id: " + parentMatrixId
+ "; (not found)", ex);
} catch (Exception ex) {
LOG.error("Failed fetching report", ex);
} finally {
close(em);
}
return reports;
}
@Override
public String getReportNamePrefix(Operation op) {
return ReportServiceImpl.extractReportNamePrefix(op);
}
@Override
public String createReportsMetadataTable() {
// throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
return "1";
}
@Override
public void insertRPMetadata(Report report) {
EntityManager em = null;
try {
em = open();
begin(em);
em.persist(report);
commit(em);
} catch (Exception ex) {
LOG.error("Failed adding a report", ex);
rollback(em);
} finally {
close(em);
}
}
@Override
public void deleteReportByMatrixId(int parentMatrixId) throws IOException {
int deleted = 0;
EntityManager em = null;
try {
em = open();
Query query = em.createNamedQuery("report_deleteByParentMatrixId");
query.setParameter("parentMatrixId", parentMatrixId);
deleted = query.executeUpdate();
} catch (NoResultException ex) {
LOG.error("Failed deleting reports by"
+ ": parent-matrix-id: " + parentMatrixId
+ "; (not found)", ex);
} catch (Exception ex) {
LOG.error("Failed deleting reports", ex);
} finally {
close(em);
}
}
@Override
public void deleteReportByOperationId(int parentOperationId) throws IOException {
int deleted = 0;
EntityManager em = null;
try {
em = open();
Query query = em.createNamedQuery("report_deleteByParentOperationId");
query.setParameter("parentOperationId", parentOperationId);
deleted = query.executeUpdate();
} catch (NoResultException ex) {
LOG.error("Failed deleting reports by"
+ ": parent-operation-id: " + parentOperationId
+ "; (not found)", ex);
} catch (Exception ex) {
LOG.error("Failed deleting reports", ex);
} finally {
close(em);
}
}
}
|
[
"[email protected]"
] | |
fc4dec8839a6d077a39576f75e9e058fb78a006b
|
3d7c1686794e9fe5b0bb2ee41aac80b2f862e001
|
/src/main/java/com/data/big/model/Diskinfo.java
|
6e77241ebdee9a4c438bd5129c5b8bbc19fc914e
|
[] |
no_license
|
yangshichao123/big
|
ea9bc9d0cba81ad634b1fe99c6d7f06eac463225
|
2d32e85d0b820f9cac80fb5e102182502ac7666f
|
refs/heads/master
| 2023-02-06T21:50:13.019408 | 2020-12-28T12:17:35 | 2020-12-28T12:17:35 | 292,201,800 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,346 |
java
|
package com.data.big.model;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
@Table(name = "Diskinfo")
public class Diskinfo implements Serializable {
/**
* 设备标识 铁标16位设备编码
*/
@Id
private String deviceId;
/**
* 设备名称
*/
private String deviceName;
/**
* 设备IP地址
*/
private String ipAddr;
/**
* 设备类型 disk
*/
private String deviceType;
/**
* 设备型号
*/
private String deviceModel;
/**
* 安装位置
*/
private String location;
/**
* 总容量 单位GB
*/
private String capacity;
/**
* 设备厂商
*/
private String manufacturer;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table diskinfo
*
* @mbg.generated Tue Aug 11 17:08:08 CST 2020
*/
private static final long serialVersionUID = 1L;
public String getDeviceId() {
return deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId == null ? null : deviceId.trim();
}
public String getDeviceName() {
return deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName == null ? null : deviceName.trim();
}
public String getIpAddr() {
return ipAddr;
}
public void setIpAddr(String ipAddr) {
this.ipAddr = ipAddr == null ? null : ipAddr.trim();
}
public String getDeviceType() {
return deviceType;
}
public void setDeviceType(String deviceType) {
this.deviceType = deviceType == null ? null : deviceType.trim();
}
public String getDeviceModel() {
return deviceModel;
}
public void setDeviceModel(String deviceModel) {
this.deviceModel = deviceModel == null ? null : deviceModel.trim();
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location == null ? null : location.trim();
}
public String getCapacity() {
return capacity;
}
public void setCapacity(String capacity) {
this.capacity = capacity == null ? null : capacity.trim();
}
public String getManufacturer() {
return manufacturer;
}
public void setManufacturer(String manufacturer) {
this.manufacturer = manufacturer == null ? null : manufacturer.trim();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", deviceId=").append(deviceId);
sb.append(", deviceName=").append(deviceName);
sb.append(", ipAddr=").append(ipAddr);
sb.append(", deviceType=").append(deviceType);
sb.append(", deviceModel=").append(deviceModel);
sb.append(", location=").append(location);
sb.append(", capacity=").append(capacity);
sb.append(", manufacturer=").append(manufacturer);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}
|
[
"“xxxxxx@449155439@"
] |
“xxxxxx@449155439@
|
951277724c81201d397140e178e22996373da396
|
a15d4565864d8cecf88f4a9a92139c9c41578c8f
|
/modules/core/org.jowidgets.cap.common/src/main/java/org/jowidgets/cap/common/tools/bean/BeanKeyBuilder.java
|
d8b50c7df32c9d4a3467c2e44dee306fe11fc19b
|
[] |
no_license
|
jo-source/jo-client-platform
|
f4800d121df6b982639390f3507da237fc5426c1
|
2f346b26fa956c6d6612fef2d0ef3eedbb390d7a
|
refs/heads/master
| 2021-01-23T10:03:16.067646 | 2019-04-29T11:43:04 | 2019-04-29T11:43:04 | 39,776,103 | 2 | 3 | null | 2016-08-24T13:53:07 | 2015-07-27T13:33:59 |
Java
|
UTF-8
|
Java
| false | false | 2,468 |
java
|
/*
* Copyright (c) 2011, grossmann
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the jo-widgets.org nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL jo-widgets.org BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*/
package org.jowidgets.cap.common.tools.bean;
import org.jowidgets.cap.common.api.CapCommonToolkit;
import org.jowidgets.cap.common.api.bean.IBeanDto;
import org.jowidgets.cap.common.api.bean.IBeanKey;
import org.jowidgets.cap.common.api.bean.IBeanKeyBuilder;
public final class BeanKeyBuilder implements IBeanKeyBuilder {
private final IBeanKeyBuilder builder;
public BeanKeyBuilder() {
this.builder = CapCommonToolkit.beanKeyBuilder();
}
@Override
public IBeanKeyBuilder setId(final Object id) {
builder.setId(id);
return this;
}
@Override
public IBeanKeyBuilder setVersion(final long version) {
builder.setVersion(version);
return this;
}
@Override
public IBeanKeyBuilder setBeanDto(final IBeanDto beanDto) {
builder.setBeanDto(beanDto);
return this;
}
@Override
public IBeanKey build() {
return builder.build();
}
}
|
[
"[email protected]"
] | |
b422936d4774767043053514b0391d7344f9dcfb
|
c687b4fb87bf7c73ca7805300415749a2c1463b4
|
/MyFirstApp/app/src/main/java/com/example/hasee/myfirstapp/RecognizeService.java
|
d45686c804c64bce07d76d9b1b9099699e264183
|
[] |
no_license
|
hualongsheng/hackathon-we
|
be55af05de194153afb9b08b181987dd48e9015e
|
205b68e76ab50cab47ababd0bb82ff9b17885c55
|
refs/heads/master
| 2021-08-23T01:28:23.477163 | 2017-12-02T04:50:30 | 2017-12-02T04:50:30 | 112,813,595 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 10,649 |
java
|
package com.example.hasee.myfirstapp;
/**
* Created by hasee on 2017/12/1.
*/
import com.baidu.ocr.sdk.OCR;
import com.baidu.ocr.sdk.OnResultListener;
import com.baidu.ocr.sdk.exception.OCRError;
import com.baidu.ocr.sdk.model.BankCardParams;
import com.baidu.ocr.sdk.model.BankCardResult;
import com.baidu.ocr.sdk.model.GeneralBasicParams;
import com.baidu.ocr.sdk.model.GeneralParams;
import com.baidu.ocr.sdk.model.GeneralResult;
import com.baidu.ocr.sdk.model.OcrRequestParams;
import com.baidu.ocr.sdk.model.OcrResponseResult;
import com.baidu.ocr.sdk.model.Word;
import com.baidu.ocr.sdk.model.WordSimple;
import java.io.File;
/**
* Created by ruanshimin on 2017/4/20.
*/
public class RecognizeService {
interface ServiceListener {
public void onResult(String result);
}
public static void recGeneral(String filePath, final ServiceListener listener) {
GeneralParams param = new GeneralParams();
param.setDetectDirection(true);
param.setVertexesLocation(true);
param.setRecognizeGranularity(GeneralParams.GRANULARITY_SMALL);
param.setImageFile(new File(filePath));
OCR.getInstance().recognizeGeneral(param, new OnResultListener<GeneralResult>() {
@Override
public void onResult(GeneralResult result) {
StringBuilder sb = new StringBuilder();
for (WordSimple wordSimple : result.getWordList()) {
Word word = (Word) wordSimple;
sb.append(word.getWords());
sb.append("\n");
}
listener.onResult(result.getJsonRes());
}
@Override
public void onError(OCRError error) {
listener.onResult(error.getMessage());
}
});
}
public static void recAccurate(String filePath, final ServiceListener listener) {
GeneralParams param = new GeneralParams();
param.setDetectDirection(true);
param.setVertexesLocation(true);
param.setRecognizeGranularity(GeneralParams.GRANULARITY_SMALL);
param.setImageFile(new File(filePath));
OCR.getInstance().recognizeAccurate(param, new OnResultListener<GeneralResult>() {
@Override
public void onResult(GeneralResult result) {
StringBuilder sb = new StringBuilder();
for (WordSimple wordSimple : result.getWordList()) {
Word word = (Word) wordSimple;
sb.append(word.getWords());
sb.append("\n");
}
listener.onResult(result.getJsonRes());
}
@Override
public void onError(OCRError error) {
listener.onResult(error.getMessage());
}
});
}
public static void recAccurateBasic(String filePath, final ServiceListener listener) {
GeneralParams param = new GeneralParams();
param.setDetectDirection(true);
param.setVertexesLocation(true);
param.setRecognizeGranularity(GeneralParams.GRANULARITY_SMALL);
param.setImageFile(new File(filePath));
OCR.getInstance().recognizeAccurateBasic(param, new OnResultListener<GeneralResult>() {
@Override
public void onResult(GeneralResult result) {
StringBuilder sb = new StringBuilder();
for (WordSimple wordSimple : result.getWordList()) {
WordSimple word = wordSimple;
sb.append(word.getWords());
sb.append("\n");
}
listener.onResult(result.getJsonRes());
}
@Override
public void onError(OCRError error) {
listener.onResult(error.getMessage());
}
});
}
public static void recGeneralBasic(String filePath, final ServiceListener listener) {
GeneralBasicParams param = new GeneralBasicParams();
param.setDetectDirection(true);
param.setImageFile(new File(filePath));
OCR.getInstance().recognizeGeneralBasic(param, new OnResultListener<GeneralResult>() {
@Override
public void onResult(GeneralResult result) {
StringBuilder sb = new StringBuilder();
for (WordSimple wordSimple : result.getWordList()) {
WordSimple word = wordSimple;
sb.append(word.getWords());
sb.append("\n");
}
listener.onResult(result.getJsonRes());
}
@Override
public void onError(OCRError error) {
listener.onResult(error.getMessage());
}
});
}
public static void recGeneralEnhanced(String filePath, final ServiceListener listener) {
GeneralBasicParams param = new GeneralBasicParams();
param.setDetectDirection(true);
param.setImageFile(new File(filePath));
OCR.getInstance().recognizeGeneralEnhanced(param, new OnResultListener<GeneralResult>() {
@Override
public void onResult(GeneralResult result) {
StringBuilder sb = new StringBuilder();
for (WordSimple wordSimple : result.getWordList()) {
WordSimple word = wordSimple;
sb.append(word.getWords());
sb.append("\n");
}
listener.onResult(result.getJsonRes());
}
@Override
public void onError(OCRError error) {
listener.onResult(error.getMessage());
}
});
}
public static void recWebimage(String filePath, final ServiceListener listener) {
GeneralBasicParams param = new GeneralBasicParams();
param.setDetectDirection(true);
param.setImageFile(new File(filePath));
OCR.getInstance().recognizeWebimage(param, new OnResultListener<GeneralResult>() {
@Override
public void onResult(GeneralResult result) {
StringBuilder sb = new StringBuilder();
for (WordSimple wordSimple : result.getWordList()) {
WordSimple word = wordSimple;
sb.append(word.getWords());
sb.append("\n");
}
listener.onResult(result.getJsonRes());
}
@Override
public void onError(OCRError error) {
listener.onResult(error.getMessage());
}
});
}
public static void recBankCard(String filePath, final ServiceListener listener) {
BankCardParams param = new BankCardParams();
param.setImageFile(new File(filePath));
OCR.getInstance().recognizeBankCard(param, new OnResultListener<BankCardResult>() {
@Override
public void onResult(BankCardResult result) {
String res = String.format("卡号:%s\n类型:%s\n发卡行:%s",
result.getBankCardNumber(),
result.getBankCardType().name(),
result.getBankName());
listener.onResult(res);
}
@Override
public void onError(OCRError error) {
listener.onResult(error.getMessage());
}
});
}
public static void recVehicleLicense(String filePath, final ServiceListener listener) {
OcrRequestParams param = new OcrRequestParams();
param.setImageFile(new File(filePath));
OCR.getInstance().recognizeVehicleLicense(param, new OnResultListener<OcrResponseResult>() {
@Override
public void onResult(OcrResponseResult result) {
listener.onResult(result.getJsonRes());
}
@Override
public void onError(OCRError error) {
listener.onResult(error.getMessage());
}
});
}
public static void recDrivingLicense(String filePath, final ServiceListener listener) {
OcrRequestParams param = new OcrRequestParams();
param.setImageFile(new File(filePath));
OCR.getInstance().recognizeDrivingLicense(param, new OnResultListener<OcrResponseResult>() {
@Override
public void onResult(OcrResponseResult result) {
listener.onResult(result.getJsonRes());
}
@Override
public void onError(OCRError error) {
listener.onResult(error.getMessage());
}
});
}
public static void recLicensePlate(String filePath, final ServiceListener listener) {
OcrRequestParams param = new OcrRequestParams();
param.setImageFile(new File(filePath));
OCR.getInstance().recognizeLicensePlate(param, new OnResultListener<OcrResponseResult>() {
@Override
public void onResult(OcrResponseResult result) {
listener.onResult(result.getJsonRes());
}
@Override
public void onError(OCRError error) {
listener.onResult(error.getMessage());
}
});
}
public static void recBusinessLicense(String filePath, final ServiceListener listener) {
OcrRequestParams param = new OcrRequestParams();
param.setImageFile(new File(filePath));
OCR.getInstance().recognizeBusinessLicense(param, new OnResultListener<OcrResponseResult>() {
@Override
public void onResult(OcrResponseResult result) {
listener.onResult(result.getJsonRes());
}
@Override
public void onError(OCRError error) {
listener.onResult(error.getMessage());
}
});
}
public static void recReceipt(String filePath, final ServiceListener listener) {
OcrRequestParams param = new OcrRequestParams();
param.setImageFile(new File(filePath));
param.putParam("detect_direction", "true");
OCR.getInstance().recognizeReceipt(param, new OnResultListener<OcrResponseResult>() {
@Override
public void onResult(OcrResponseResult result) {
listener.onResult(result.getJsonRes());
}
@Override
public void onError(OCRError error) {
listener.onResult(error.getMessage());
}
});
}
}
|
[
"[email protected]"
] | |
bc0600f3fbfc8d229bf4ea455e8ca40ccc4e539a
|
03b34aab5686d36c2c15fd7036f5dda08934dc3d
|
/app/src/test/java/com/example/sohamchatterjee/weather_21/ExampleUnitTest.java
|
63a2ac329c2b44ebd273a85e3ae67b93abe550a1
|
[] |
no_license
|
sohamchatterjee50/PROJECT-SUNSHINE
|
fbbd7957ec7ac1b2014a302041faf9d6b6bbef36
|
d43801312608721fb5fa9c8345b8df9759f6262f
|
refs/heads/master
| 2021-01-10T03:33:51.523132 | 2016-04-05T14:59:51 | 2016-04-05T14:59:51 | 54,821,055 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 331 |
java
|
package com.example.sohamchatterjee.weather_21;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
|
[
"[email protected]"
] | |
3e9de1376312808bdd2e58e1ddfe5d7fc664432f
|
33d79a3552382fa3849a94ccc92f3fd7e878ae0a
|
/LanMeiShop-master/lanmei-os-web/src/main/java/org/lanmei/os/utils/property/EnctryptPropertyPlaceholderConfigurer.java
|
662da582ce75996d037b45118ec84c8079101e38
|
[] |
no_license
|
CodeBoySun/FirstMyGitProject
|
23b0b74f0ccdec5a352b3803978d266450d459ba
|
3bd99e20113757f26116943d6b74d04cff9c4cc2
|
refs/heads/master
| 2020-03-27T10:54:31.930345 | 2018-08-21T02:20:26 | 2018-08-21T02:20:26 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,422 |
java
|
package org.lanmei.os.utils.property;
import org.lanmei.os.utils.des.DESUtils;
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
import org.springframework.data.domain.ExampleMatcher.PropertyValueTransformer;
public class EnctryptPropertyPlaceholderConfigurer extends PropertyPlaceholderConfigurer {
//定义需要解密的属性
private String[] enctryptPropertyValue= {"jdbc.username","jdbc.password"};
/**
* 在加载属性配置文件并读取配置属性时都会调用该方法,可以对所有的值进行转换,返回的是新的propertyValue
*/
@Override
protected String convertProperty(String propertyName, String propertyValue) {
System.out.println(propertyName + " = " + propertyValue );
if(isEnctryptPropertyValue(propertyName)) {
String decryResult = null;
try {
//解密操作
decryResult = DESUtils.decrypt(propertyValue);
System.out.println("解密后:"+decryResult);
} catch (Exception e1) {
e1.printStackTrace();
}
//返回解密后的属性值
return (decryResult);
}
return propertyValue;
}
/**
* 判断是否需要解密
* @param value
* @return
*/
private boolean isEnctryptPropertyValue(String value){
for(String propertyValue:enctryptPropertyValue) {
if(propertyValue.equals(value)) {
return true;
}
}
return false;
}
}
|
[
"[email protected]"
] | |
5eceac1ab5d88410fc3cde3d91c8ae8ff393ebd4
|
a09c29d4c4c65c22bc5120ad184a9a1bd301b8fe
|
/src/main/java/com/itanveer/spring5jokesappv1/Spring5JokesAppV1Application.java
|
38687ec285fa842155b933286f94936139903850
|
[] |
no_license
|
iTanveerAhmad/spring5-jokes-app-v1
|
a6d9ace57fd7914a71be922cdb0a128887fd4510
|
0da610057bbb78e401846f4162641e3d910ff164
|
refs/heads/main
| 2023-06-06T14:38:34.723879 | 2021-06-29T12:58:57 | 2021-06-29T12:58:57 | 381,301,140 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 345 |
java
|
package com.itanveer.spring5jokesappv1;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class Spring5JokesAppV1Application {
public static void main(String[] args) {
SpringApplication.run(Spring5JokesAppV1Application.class, args);
}
}
|
[
"[email protected]"
] | |
2d7893dc164de535826c2dc85200164e1d1f2a93
|
499056472528f2379f25c2fe2318c18f6213d785
|
/src/main/java/com/ya/yaevent/ApplicationWebXml.java
|
ffbfa456afb2b8416ffe6c5d83e7795ad0f53e29
|
[] |
no_license
|
alefebvre-fixit/ya-event
|
7298d50c0be6d331b3128174e73610d36ae6d6a4
|
4e1dc7100db57dc8c266d7de6f6cd05b23741c5b
|
refs/heads/master
| 2021-01-10T14:23:13.941114 | 2017-07-21T15:42:34 | 2017-07-21T15:42:34 | 49,549,026 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,254 |
java
|
package com.ya.yaevent;
import com.ya.yaevent.config.Constants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.web.SpringBootServletInitializer;
/**
* This is a helper Java class that provides an alternative to creating a web.xml.
*/
public class ApplicationWebXml extends SpringBootServletInitializer {
private final Logger log = LoggerFactory.getLogger(ApplicationWebXml.class);
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.profiles(addDefaultProfile())
.sources(Application.class);
}
/**
* Set a default profile if it has not been set.
* <p>
* Please use -Dspring.profiles.active=dev
* </p>
*/
private String addDefaultProfile() {
String profile = System.getProperty("spring.profiles.active");
if (profile != null) {
log.info("Running with Spring profile(s) : {}", profile);
return profile;
}
log.warn("No Spring profile configured, running with default configuration");
return Constants.SPRING_PROFILE_DEVELOPMENT;
}
}
|
[
"[email protected]"
] | |
9b5b6003c9889a3214ef7b8227824f4cef5fb3ee
|
488f41de2b5fce4081c87feb547ef853ea69a5f6
|
/materials/2019-2020/11v/2020-04-07-exam-2-1/src/org/elsys/duzunov/VirtualWallet.java
|
36a3fa275a551b1c9f4cac55609b5f7626a56a60
|
[] |
no_license
|
elsys/oop
|
5c17e8f2c72aba775f4d895499782b6cad5816d1
|
a5be4adb767cdde7d9f904024880382509f53498
|
refs/heads/master
| 2023-06-14T06:21:30.570095 | 2023-06-05T19:04:14 | 2023-06-05T19:04:14 | 211,560,844 | 11 | 32 | null | 2023-02-22T09:24:13 | 2019-09-28T20:57:51 |
PostScript
|
UTF-8
|
Java
| false | false | 2,050 |
java
|
package org.elsys.duzunov;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
import java.util.HashMap;
public class VirtualWallet implements IVirtualWallet {
private static class AmountComparator implements Comparator<Card> {
@Override
public int compare(Card o1, Card o2) {
return Double.compare(o1.getAmount(), o2.getAmount());
}
}
private HashMap<String, Card> cards = new HashMap<>();
@Override
public boolean registerCard(Card card) {
if (card == null || cards.containsKey(card.getName())) {
return false;
}
cards.put(card.getName(), card);
return true;
}
@Override
public boolean unregisterCard(Card card) {
return card != null && cards.remove(card.getName()) != null;
}
@Override
public boolean executePayment(Card card, PaymentInfo paymentInfo) {
if (card == null || paymentInfo == null) {
return false;
}
var foundCard = getCardByName(card.getName());
return foundCard != null &&
foundCard.executePayment(paymentInfo.getCost());
}
@Override
public boolean feed(Card card, double amount) {
if (card == null) {
return false;
}
var foundCard = getCardByName(card.getName());
return foundCard != null && foundCard.feed(amount);
}
@Override
public Card getCardByName(String name) {
return cards.get(name);
}
@Override
public int getTotalNumberOfCards() {
return cards.size();
}
@Override
public Collection<Card> sortCardsByName() {
return sortCards(null);
}
@Override
public Collection<Card> sortCardsByAmount() {
return sortCards(new AmountComparator());
}
private Collection<Card> sortCards(Comparator<Card> cardComparator) {
var cardsList = new ArrayList<>(cards.values());
cardsList.sort(cardComparator);
return cardsList;
}
}
|
[
"[email protected]"
] | |
913a5c9cf9d8a9cc6d7594c365a72986c1e79fcb
|
6b6ead550f7e2e34bdc316a4b3c016de8170cc12
|
/src/plugin/scoring-similarity/src/java/org/apache/nutch/scoring/similarity/cosine/package-info.java
|
70ae4abe740e6f94ef57dff3d0545b5de3c85940
|
[
"LicenseRef-scancode-unknown",
"Apache-2.0",
"Python-2.0",
"BSD-3-Clause",
"W3C-19980720",
"LicenseRef-scancode-proprietary-license",
"Apache-1.1",
"CPL-1.0",
"CDDL-1.0",
"SAX-PD",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-unicode-mappings",
"MIT",
"LicenseRef-scancode-jdom",
"LicenseRef-scancode-public-domain",
"ICU",
"Saxpath",
"LicenseRef-scancode-warranty-disclaimer",
"BSD-2-Clause"
] |
permissive
|
umd-lib/nutch
|
927266f7bb91dd2216f674b6d4d41a99632c8648
|
9ac1b36c7391d0b8fe1ee54eadbb758cebcb3a73
|
refs/heads/umd-develop
| 2021-07-06T17:22:33.315080 | 2020-01-15T18:25:51 | 2020-01-15T18:25:51 | 136,042,287 | 0 | 2 |
Apache-2.0
| 2019-06-20T20:10:02 | 2018-06-04T15:03:33 |
Java
|
UTF-8
|
Java
| false | false | 146 |
java
|
/**
*
*/
/** Implements the cosine similarity metric for scoring relevant documents
*
*/
package org.apache.nutch.scoring.similarity.cosine;
|
[
"[email protected]"
] | |
e5fd3e1053920608a580f8ad7bb6b7383ca50f6a
|
4e53d1012c928aebaa116d323dc083366924490e
|
/src/main/java/com/pyd/controller/AlipayController.java
|
4cd3993e1d9537beea1ec620969bae79a24a8946
|
[] |
no_license
|
YuDongPan/First-Blood
|
1e63540632af6417d075a9accd8fed729ed66234
|
09a8a06e3fd8fbe4db27ae1951fbc0a36d382412
|
refs/heads/master
| 2023-07-01T13:53:08.797509 | 2021-07-30T14:11:39 | 2021-07-30T14:11:39 | 390,739,804 | 1 | 1 | null | 2021-07-30T14:08:52 | 2021-07-29T13:51:45 |
JavaScript
|
UTF-8
|
Java
| false | false | 5,747 |
java
|
package com.pyd.controller;
import java.io.IOException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;
import com.alipay.api.internal.util.AlipaySignature;
import com.alipay.api.request.AlipayTradePagePayRequest;
import com.pyd.dbutil.AlipayConfig;
import com.relops.snowflake.Snowflake;
@Controller
public class AlipayController {
/**
* 电脑端网页支付
* @param rep
* @param request
* @return
* @throws AlipayApiException
* @throws IOException
*/
@RequestMapping("toalipay")
@ResponseBody
public String ToAlipay(HttpServletResponse rep,HttpServletRequest request) throws AlipayApiException, IOException {
// 获得初始化的AlipayClient
AlipayClient alipayClient = new DefaultAlipayClient(
AlipayConfig.gatewayUrl, AlipayConfig.app_id,
AlipayConfig.merchant_private_key, "json",
AlipayConfig.charset, AlipayConfig.alipay_public_key,
AlipayConfig.sign_type);
// 设置请求参数
AlipayTradePagePayRequest alipayRequest = new AlipayTradePagePayRequest();
alipayRequest.setReturnUrl(AlipayConfig.return_url);
alipayRequest.setNotifyUrl(AlipayConfig.notify_url);
long uuNo = new Snowflake(100).next();
//商户订单号,商户网站订单系统中唯一订单号,必填
String out_trade_no = String.valueOf(uuNo);
//付款金额,必填
String total_amount = new String(request.getParameter("money").getBytes("ISO-8859-1"),"UTF-8");
System.out.println(total_amount);
//订单名称,必填
String subject = "测试";
// 商品描述,可空
String body = new String("".getBytes(
"ISO-8859-1"), "UTF-8");
alipayRequest.setBizContent("{\"out_trade_no\":\"" + out_trade_no
+ "\"," + "\"total_amount\":\"" + total_amount + "\","
+ "\"subject\":\"" + subject + "\"," + "\"body\":\"" + body
+ "\"," + "\"product_code\":\"FAST_INSTANT_TRADE_PAY\"}");
// 若想给BizContent增加其他可选请求参数,以增加自定义超时时间参数timeout_express来举例说明
// alipayRequest.setBizContent("{\"out_trade_no\":\""+ out_trade_no
// +"\","
// + "\"total_amount\":\""+ total_amount +"\","
// + "\"subject\":\""+ subject +"\","
// + "\"body\":\""+ body +"\","
// + "\"timeout_express\":\"10m\","
// + "\"product_code\":\"FAST_INSTANT_TRADE_PAY\"}");
// 请求参数可查阅【电脑网站支付的API文档-alipay.trade.page.pay-请求参数】章节
// 请求
String result = alipayClient.pageExecute(alipayRequest).getBody();
// 输出
// System.out.println(result);
rep.setContentType("text/html;charset=UTF-8");
rep.getWriter().write(result);//直接将完整的表单html输出到页面
rep.getWriter().flush();
rep.getWriter().close();
return null;
}
/**
* 电脑端网页支付结果
* @param request
* @param hs
* @return
* @throws Exception
*/
@RequestMapping("alipayresult")
public String alipayResult(HttpServletRequest request,HttpSession hs) throws Exception{
//获取支付宝GET过来反馈信息
Map<String,String> params = new HashMap<String,String>();
Map<String,String[]> requestParams = request.getParameterMap();
for (Iterator<String> iter = requestParams.keySet().iterator(); iter.hasNext();) {
String name = (String) iter.next();
String[] values = (String[]) requestParams.get(name);
String valueStr = "";
for (int i = 0; i < values.length; i++) {
valueStr = (i == values.length - 1) ? valueStr + values[i]
: valueStr + values[i] + ",";
}
//乱码解决,这段代码在出现乱码时使用
valueStr = new String(valueStr.getBytes("ISO-8859-1"), "utf-8");
params.put(name, valueStr);
}
boolean signVerified = AlipaySignature.rsaCheckV1(params, AlipayConfig.alipay_public_key, AlipayConfig.charset, AlipayConfig.sign_type); //调用SDK验证签名
//——请在这里编写您的程序(以下代码仅作参考)——
if(signVerified) {
//商户订单号
String out_trade_no = new String(request.getParameter("out_trade_no").getBytes("ISO-8859-1"),"UTF-8");
//支付宝交易号
String trade_no = new String(request.getParameter("trade_no").getBytes("ISO-8859-1"),"UTF-8");
//付款金额
String total_amount = new String(request.getParameter("total_amount").getBytes("ISO-8859-1"),"UTF-8");
System.out.println("trade_no:"+trade_no+"<br/>out_trade_no:"+out_trade_no+"<br/>total_amount:"+total_amount);
}else {
System.out.println("验签失败");
}
//——请在这里编写您的程序(以上代码仅作参考)——
return "redirect:/bank/index.jsp";
}
/* @RequestMapping("indicatorQuery")
public String indicatorQuery() throws AlipayApiException{
AlipayClient alipayClient = new DefaultAlipayClient(
AlipayConfig.gatewayUrl, AlipayConfig.app_id,
AlipayConfig.merchant_private_key, "json",
AlipayConfig.charset, AlipayConfig.alipay_public_key,
AlipayConfig.sign_type);
KoubeiMarketingDataIndicatorQueryRequest request = new KoubeiMarketingDataIndicatorQueryRequest();
request.setBizContent("{\"begin_date\":\"20160501\",\"end_date\":\"20160616\",\"page_num\":\"1\", \"page_size\":\"20\",\"biz_type\":\"MemberQuery\"}");
KoubeiMarketingDataIndicatorQueryResponse response = alipayClient.execute(request);
response.getBody();
return "result";
}*/
}
|
[
"[email protected]"
] | |
c4f3b670e0c367394a32ab4e994923dcd0264142
|
2c69f950524afc5ddefc0905fb041eb49df0f2f9
|
/PRG3/Assignment2_Karol_Strzelecki/InvalidDateException.java
|
39d0e7c3b54aee25ddeab2d807e0436ebb7c3fb2
|
[] |
no_license
|
karolstrzelecki/school_and_training
|
98608df45524734da02e1a37545810e348e0543b
|
50c3ea9456f2a522fef517566718a3d7493f6392
|
refs/heads/master
| 2022-12-05T23:52:21.588641 | 2019-12-17T22:29:21 | 2019-12-17T22:29:21 | 218,631,534 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 156 |
java
|
// Karol Strzelecki id: 19101653
public class InvalidDateException extends Exception{
public InvalidDateException(String s) {
super(s);
}
}
|
[
"[email protected]"
] | |
af53807f1a00aba1bf380cf3c4c6822edc32a0d8
|
9062c8da85912575bb43bb7ecfd59d2cdb45e7c9
|
/JavaEE_Full-Stack/src/exerLogicaProgramacao/ResoulcaoEquacao.java
|
fa29eda2c0e7979f74499fe964669422ad146732
|
[] |
no_license
|
erickhonecker/exercicios-java
|
c1ba2d8b8d08b8821a7906218f51e531173a8311
|
4eaee57c3f22580214324df9cac93ab70f42f3c5
|
refs/heads/master
| 2023-06-26T05:56:28.676025 | 2021-07-30T20:52:03 | 2021-07-30T20:52:03 | 391,177,470 | 0 | 0 | null | null | null | null |
ISO-8859-1
|
Java
| false | false | 501 |
java
|
package exerLogicaProgramacao;
import java.util.Scanner;
public class ResoulcaoEquacao {
public static void main(String[] args) {
Scanner e = new Scanner(System.in);
int y, a, x;
// dado y = ax³ + 7 converter para LP Java.
System.out.println("Digite o valor de A: ");
a = e.nextInt();
System.out.println("Digite o valor de x: ");
x = e.nextInt();
y = a * x * x * x + 7;
System.out.println("Este é o resultado dessa equação ---> "+ y);
}
}
|
[
"Erick Honecker@DESKTOP-DSELV58"
] |
Erick Honecker@DESKTOP-DSELV58
|
b5b2d6e289acaa0c1400953152878bb7cbe40b40
|
c72d85cfaf53ae1f2fab654b8bb431100d74af08
|
/zws-webapp/code/java/com/zws/functor/java/GetClass.java
|
41f578eea3c8787eaff91d3329944e622e819bbd
|
[] |
no_license
|
vadeq/repotest
|
fd11e75008894f1bebbc24d722efc90309fb4b68
|
6e85f316d9cfc138dd5d001cd8f2f345aa682c12
|
refs/heads/master
| 2021-01-20T05:29:17.633968 | 2011-04-23T02:23:32 | 2011-04-23T02:23:32 | 1,553,934 | 2 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 530 |
java
|
package com.zws.functor.java;
import com.zws.functor.Functor;
public class GetClass extends Functor {
public void execute () throws ClassNotFoundException {
setResult(Class.forName(getClassName()));
}
public void bind(Object o) { setClassName(o.getClass().getName()); }
public void bind(Class c) { setClassName(c.getName()); }
public void bind(String s) { setClassName(s); }
public String getClassName() { return className; }
public void setClassName(String s) { className=s; }
private String className;
}
|
[
"ourpc@.(none)"
] |
ourpc@.(none)
|
7fbfb9dc58c3d0bceecc5e79c510659932f5078c
|
e680b908e6bf115024a7c5b7fcf02d5fdf4ed0f4
|
/AutorModel.java
|
759f3e43dea8857bbaa98e2775530e8c3ad6f8dd
|
[] |
no_license
|
chelAndrade/BolsaBiblioteca
|
d5c6d7df38caf4baa46da1bff06174837fb34169
|
e5531c023bd880ae435f5270a27123041d817fa4
|
refs/heads/master
| 2020-06-02T06:38:20.949595 | 2019-06-15T17:10:51 | 2019-06-15T17:10:51 | 191,072,222 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 550 |
java
|
package com.example.livraria1;
public class AutorModel {
private String nome;
private int ID;
public AutorModel(String nome,int ID){
this.nome = nome;
this.ID = ID;
}
public AutorModel(String nome) {
this.nome = nome;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public int getID() {
return ID;
}
public void setID(int ID) {
this.ID = ID;
}
}
|
[
"[email protected]"
] | |
c28ecbef471f00d51b733a8087b39adbebdb9b77
|
4cf60e49e5d82c03d2b90dd8e03d82beae186938
|
/Hospital/drhouse-accountancy/src/main/java/at/nacs/drhouseaccountancy/persistance/domain/Invoice.java
|
682be594beb00c30758ae6ca0911e256fc4371c6
|
[] |
no_license
|
LeenRaslan/backend
|
3ddf889678634ec187b41de87c2069995d57130f
|
1d5acfceae2460108b55697b696fb8ac89d92ed0
|
refs/heads/master
| 2020-04-24T14:45:01.467745 | 2019-05-02T15:20:17 | 2019-05-02T15:20:17 | 172,034,596 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 646 |
java
|
package at.nacs.drhouseaccountancy.persistance.domain;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import java.time.LocalDateTime;
@Entity
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class Invoice {
@Id
@GeneratedValue
private Long id;
@ManyToOne
private Patient patient;
@Enumerated(EnumType.STRING)
private Kind kind;
private String symptoms;
private String diagnosis;
private String provided;
private double cost;
private boolean paid;
private LocalDateTime timestamp;
}
|
[
"[email protected]"
] | |
078ed040ca1accb5ece9cf56aba1592c03a200c2
|
2cc1993be3db96ece34362459887d17402d3ec9c
|
/app/src/main/java/trade/view/pie/PieChartAnimation.java
|
d82ed77b3dc5319a9db7f40c928acddb2b2c8ad0
|
[] |
no_license
|
galibujianbusana/KViewTest
|
75f024ac2d3da4b2b3b95bb0765ad6f4ae98e245
|
b4e2a574034a39fcd7a7a7e5a4cae5204eeb4f95
|
refs/heads/master
| 2023-02-02T08:39:13.928520 | 2020-12-10T03:56:44 | 2020-12-10T03:56:44 | 308,284,759 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,723 |
java
|
package trade.view.pie;
import android.util.Log;
import android.view.animation.Animation;
import android.view.animation.Transformation;
import java.util.List;
import trade.utils.StringUtils;
/**
* ============================================================
* 作 者 : [email protected]
* 更新时间 :2018/07/17 16:50
* 描 述 :
* ============================================================
*/
public class PieChartAnimation extends Animation {
public static final String TAG = PieChartAnimation.class.getSimpleName();
List<PieEntrys> mPieEntrysList;
float mSumValue;
PieChartView mView;
public void setPieChartData(List<PieEntrys> pieEntrysList, float sumValue, PieChartView view) {
this.mPieEntrysList = pieEntrysList;
this.mSumValue = sumValue;
this.mView = view;
}
@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
super.applyTransformation(interpolatedTime, t);
if (StringUtils.isEmpty(mPieEntrysList) || mSumValue <= 0 || mView == null) return;
Log.d(TAG, "applyTransformation1: " + interpolatedTime);
if (interpolatedTime == 1.0f) {
mView.setDrawLine(true);
}
for (int i = 0; i < mPieEntrysList.size(); i++) {
PieEntrys data = mPieEntrysList.get(i);
//通过总和来计算百分比
float percentage = data.value / mSumValue;
//通过百分比来计算对应的角度
float angle = percentage * 360;
//根据插入时间来计算角度
angle = angle * interpolatedTime;
data.mSweepAngle = angle;
}
mView.invalidate();
}
}
|
[
"[email protected]"
] | |
b7cead6eb1ec5ee93a3a662fe5f8929d02bb8bb0
|
7364d283dab97686e13664a5e037217fbdba0e00
|
/app/src/test/java/com/flynorc/popularmovies_stage1/ExampleUnitTest.java
|
50e6b9755481df067c6050e3786ea5657b62d4d0
|
[] |
no_license
|
flynorc/AND_02_PopularMovies_1
|
91e2baf6fefb326f54fb8a3a80e612c8dda9b709
|
8da846f0e206c5930426f3ab579127390e64a836
|
refs/heads/master
| 2021-01-24T10:06:16.779193 | 2018-02-26T22:19:56 | 2018-02-26T22:19:56 | 123,037,969 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 410 |
java
|
package com.flynorc.popularmovies_stage1;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
|
[
"[email protected]"
] | |
0128b62176d321d5c3ac3c3b20ce9e47fc39ee02
|
473e82ea7d289919a2d9b782a1a6dadae7cd4d92
|
/app/src/main/java/com/chhotaloan/ui/history/HistoryFragment.java
|
e319f6a4c2e31cf1adf3e7d2680ab60db683228e
|
[] |
no_license
|
imshubhamkumar/Skillenza-Hackathons
|
796bb62f43ed9e14b983ddadf3e9272eafbd72f4
|
5e55386536dd3ad5d01703e3d1b8dd3885d16e4c
|
refs/heads/master
| 2021-01-09T19:25:02.797783 | 2020-02-23T01:15:49 | 2020-02-23T01:15:49 | 242,429,498 | 0 | 0 | null | 2020-02-22T23:57:40 | 2020-02-22T23:57:39 | null |
UTF-8
|
Java
| false | false | 712 |
java
|
package com.chhotaloan.ui.history;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProviders;
import com.chhotaloan.R;
public class HistoryFragment extends Fragment {
// private HistoryViewModel recyclerView = ViewModelProviders.of(this).get(HistoryViewModel.class);
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.fragment_history, container, false);
return root;
}
}
|
[
"[email protected]"
] | |
f8740cedf8db261046c38dec6f52c9f80a0fcb58
|
a78f99c8cc19084b70812f77c5401c212345da47
|
/src/MIPSSimulatorBackend/Instruction.java
|
30599a30fd7f6c455036eab18e98d089f4e42193
|
[] |
no_license
|
zkaric1/MIPSSimulator
|
8a03080b28d015f20727298c1db60136a6e4cf33
|
850c80f9ff8f2b6d4365f4e1ef4059b81bd83a90
|
refs/heads/master
| 2021-04-08T10:17:37.882548 | 2017-06-07T11:06:09 | 2017-06-07T11:06:09 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,392 |
java
|
package MIPSSimulatorBackend;
import javax.swing.JOptionPane;
public class Instruction {
protected Boolean[] instructionCode;
private Boolean opcode[];
private Boolean rs[];
private Boolean rt[];
private Boolean rd[];
private Boolean funct[];
private Boolean imm[];
public Instruction() { }
public Instruction(String instructionCode) throws IllegalArgumentException {
if(instructionCode.length() != 32)
JOptionPane.showMessageDialog(null,"Instruction must be 32-bit long");
this.instructionCode = new Boolean[32];
fillArrayFromString(this.instructionCode, instructionCode);
}
public void decodeInstruction() {
opcode = new Boolean[6];
for(int i = 0; i < 6; i++)
opcode[i] = this.instructionCode[i];
rs = new Boolean[5];
for(int i = 6; i < 11; i++)
rs[i%6] = this.instructionCode[i];
rt = new Boolean[5];
for(int i = 11; i < 16; i++)
rt[i%11] = this.instructionCode[i];
rd = new Boolean[5];
for(int i = 16; i < 21; i++)
rd[i%16] = this.instructionCode[i];
funct = new Boolean[11];
for(int i = 21; i < 32; i++)
funct[i%21] = this.instructionCode[i];
imm = new Boolean[16];
for(int i = 16; i < 32; i++)
imm[i%16] = this.instructionCode[i];
}
public int getIntFromBin(Boolean[] arr) {
int n = 0, l = arr.length;
for (int i = 0; i < l; ++i) {
n = (n << 1) + (arr[i] ? 1 : 0);
}
return n;
}
private void fillArrayFromString(Boolean[] arr, String str) {
for(int i = 0; i < 32; i++)
if(str.charAt(i) == '1')
arr[i] = true;
else if(str.charAt(i) == '0')
arr[i] = false;
else
JOptionPane.showMessageDialog(null,"Instruction contains character other than 0/1");
}
public Boolean[] getOpcode() { return opcode; }
public Boolean[] getRs() { return rs; }
public Boolean[] getRt() { return rt; }
public Boolean[] getRd() { return rd; }
public Boolean[] getFunct() { return funct; }
public Boolean[] getImm() { return imm; }
public int getOpcodeInt() { return getIntFromBin(opcode); }
public int getRsInt() { return getIntFromBin(rs); }
public int getRtInt() { return getIntFromBin(rt); }
public int getRdInt() { return getIntFromBin(rd); }
public int getFunctInt() { return getIntFromBin(funct); }
public int getImmInt() { return getIntFromBin(imm); }
}
|
[
"[email protected]"
] | |
5da2e3bb32db602aff3e369a77c704debac7ee4f
|
99a3761261f0d0f36b17ce8715bf5cdbda20c208
|
/IntroductionToJava/WeightBody/src/WeightBody.java
|
dafce53a6c1b7c12f21d03c6dd55f5b74f66005c
|
[] |
no_license
|
CaoBinh18/Module_2
|
73147d4f8a16c72fbc64a9bc1947f6209ea97a13
|
eb28d617bf1b49d19c143c489a24001be188691b
|
refs/heads/master
| 2023-05-10T10:05:49.259100 | 2021-06-08T15:45:58 | 2021-06-08T15:45:58 | 373,377,384 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 827 |
java
|
import java.util.Scanner;
public class WeightBody {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
double weight, height, bmi;
System.out.print("Your weight (in kilogram):");
weight = scanner.nextDouble();
System.out.print("Your height (in meter):");
height = scanner.nextDouble();
bmi = weight/Math.pow(height,2);
System.out.printf("%-20s%s", "bmi", "Interpretation\n");
if (bmi < 18)
System.out.printf("%-20.2f%s", bmi, "Underweight");
else if (bmi < 25.0)
System.out.printf("%-20.2f%s", bmi, "Normal");
else if (bmi < 30.0)
System.out.printf("%-20.2f%s", bmi, "Overweight");
else
System.out.printf("%-20.2f%s", bmi, "Obese");
}
}
|
[
"[email protected]"
] | |
27b99ddce25f1d3cb5a0d232e42edafe173c22b1
|
b2de28d27ac0c001b2a064c53b7978ac67a88e94
|
/simge/GTalk/gen/com/comu/android/R.java
|
b5610e278dc005d6c35291adfd623f036c8d9509
|
[] |
no_license
|
dinfooo/homescreen
|
a2e719ba73b3d6564d7f07a2b314fb8a07365179
|
302c1a0e10e73486310eeda6567cc358bad69f66
|
refs/heads/master
| 2021-01-15T09:48:08.631434 | 2012-06-14T08:23:04 | 2012-06-14T08:23:04 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,328 |
java
|
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.comu.android;
public final class R {
public static final class attr {
}
public static final class drawable {
public static final int gtalk=0x7f020000;
public static final int gtalklogo=0x7f020001;
public static final int ic_launcher=0x7f020002;
}
public static final class id {
public static final int btnLogin=0x7f050001;
public static final int btnRegister=0x7f050006;
public static final int header=0x7f050000;
public static final int link_to_login=0x7f050007;
public static final int link_to_register=0x7f050002;
public static final int reg_email=0x7f050004;
public static final int reg_fullname=0x7f050003;
public static final int reg_password=0x7f050005;
}
public static final class layout {
public static final int header_gradient=0x7f030000;
public static final int login=0x7f030001;
public static final int register=0x7f030002;
}
public static final class string {
public static final int app_name=0x7f040001;
public static final int hello=0x7f040000;
}
}
|
[
"[email protected]"
] | |
ed5cf6c509db504bffd55e385b9e5ca71d3eea19
|
01b9219c796f14b39486b1b6d3e21618f3ea7bdc
|
/faceye-search-book-manager/src/template/project/src/test/java/com/faceye/test/feature/repository/ExampleRepositoryTestCase.java
|
2bc398515f256f4b6f96dd0eb576dde452338793
|
[] |
no_license
|
haipenge/faceye-search
|
aedb93f3d90da0ba0231b35064540608966aaebb
|
c47cd9021fa60d7e0c66cf9981abb91d1a8be5cf
|
refs/heads/master
| 2020-07-15T01:18:10.555756 | 2019-04-29T06:02:32 | 2019-04-29T06:02:32 | 73,872,563 | 0 | 2 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,509 |
java
|
package com.faceye.test.feature.repository;
import java.util.HashMap;
import java.util.Map;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.junit.Assert;
import com.faceye.feature.entity.Example;
import com.faceye.feature.repository.ExampleRepository;
public class ExampleRepositoryTestCase extends BaseRepositoryTestCase {
@Autowired
private ExampleRepository exampleRepository = null;
@Before
public void before() throws Exception {
this.exampleRepository.deleteAll();
}
@After
public void after() throws Exception {
}
@Test
public void testSave() throws Exception {
Example entity = new Example();
entity.setName("test-entity");
this.exampleRepository.save(entity);
Iterable<Example> entities = this.exampleRepository.findAll();
Assert.assertTrue(entities.iterator().hasNext());
}
@Test
public void testDelete() throws Exception {
Example entity = new Example();
entity.setName("test-entity");
this.exampleRepository.save(entity);
this.exampleRepository.deleteById(entity.getId());
Iterable<Example> entities = this.exampleRepository.findAll();
Assert.assertTrue(!entities.iterator().hasNext());
}
@Test
public void testFindOne() throws Exception {
Example entity = new Example();
entity.setName("test-entity");
this.exampleRepository.save(entity);
Example example=this.exampleRepository.findById(entity.getId()).get();
Assert.assertTrue(example!=null);
}
@Test
public void testGetPage() throws Exception {
for (int i = 0; i < 25; i++) {
Example entity = new Example();
entity.setName("test-" + i);
this.exampleRepository.save(entity);
}
Map<String, Object> searchParams = new HashMap<String, Object>();
Page<Example> page = this.exampleRepository.getPage(searchParams, 0, 5);
Assert.assertTrue(page != null && page.getSize() == 5);
searchParams.put("EQ_name", "test-10");
page = this.exampleRepository.getPage(searchParams, 0, 5);
Assert.assertTrue(page != null && page.getTotalElements() == 1);
searchParams = new HashMap<String, Object>();
searchParams.put("LIKE_name", "test");
page = this.exampleRepository.getPage(searchParams, 0, 5);
Assert.assertTrue(page != null && page.getTotalElements() == 25 && page.getNumberOfElements() == 5);
}
}
|
[
"[email protected]"
] | |
b9546b16c03d1f8b924fd7025942d3592b557934
|
44fcecf48e865afede287de0659cd68be6d0a0ae
|
/LinkedLists/Node.java
|
16cc35e83fb36fad1cc383b305850e09c7d48d21
|
[] |
no_license
|
alfmat/coding-interview
|
4d28b4ab71a051088df7cd72cb59a0b22a644ed0
|
e8440f7018409e965608cc6a4cc4bf757e842416
|
refs/heads/main
| 2023-08-21T12:38:10.723762 | 2021-10-02T16:39:02 | 2021-10-02T16:39:02 | 406,998,901 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 316 |
java
|
package LinkedLists;
public class Node {
Node next = null;
int data;
public Node(int d) {
this.data = d;
}
void appendToTail(int d) {
Node end = new Node(d);
Node n = this;
while(n.next != null) {
n = n.next;
}
n.next = end;
}
}
|
[
"[email protected]"
] | |
7da8eb0f419fa179ea5ab730d23f84dd83b421cd
|
2f9a3fc0e60371a2af624b3b91f8caeaac9f83f4
|
/exercises/week4/exercise6/src/test/java/academy/everyonecodes/client/MarathonClientTest.java
|
cb500ca7a3487d2ed6c115e35ce82edee44631b6
|
[] |
no_license
|
Alex3m/springboot-module
|
49c1f08b6179286b4e752a818d2bbd5762044dd4
|
7d29b8065e0297eecc785033d40134fb37a62367
|
refs/heads/master
| 2022-06-23T03:49:59.106614 | 2020-05-07T18:31:52 | 2020-05-07T18:31:52 | 246,024,872 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,523 |
java
|
package academy.everyonecodes.clients;
import academy.everyonecodes.data.Runner;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.web.client.RestTemplate;
import java.time.Duration;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.NONE;
@SpringBootTest(webEnvironment = NONE)
class MarathonClientTest {
@Autowired
MarathonClient marathonClient;
@MockBean
RestTemplate restTemplate;
@Value("${marathon.postrunnerurl}")
String postURL;
@Value("${marathon.winnerurl}")
String winnerURL;
Runner runner = new Runner("name", Duration.parse("PT1H1M1S"));
@Test
void postRunner() {
when(restTemplate.postForObject(postURL, runner, Runner.class))
.thenReturn(runner);
marathonClient.postRunner(runner);
verify(restTemplate).postForObject(postURL, runner, Runner.class);
}
@Test
void getWinner() {
when(restTemplate.getForObject(winnerURL, Runner.class))
.thenReturn(runner);
marathonClient.getWinner();
verify(restTemplate).getForObject(winnerURL, Runner.class);
}
}
|
[
"[email protected]"
] | |
79ad9228c3f89d1e0edfbaa91c66dad3d2e84fb9
|
bf626bdb0cf1e83ae0f166ac4558a68d26a68f81
|
/src/main/java/com/songdi/paas/common/context/BaseContextHandler.java
|
1d175c4aa030ecf30c27931cd1ac5daf14ea4fd7
|
[] |
no_license
|
songdi676/Paas-Lite
|
f25d78c974ee776d3a057f14b8f53e808c8815a1
|
f1d59b92349e5389f951e2858def7e1a1b652b25
|
refs/heads/master
| 2022-12-11T03:54:00.339441 | 2020-01-13T07:43:50 | 2020-01-13T07:43:50 | 180,953,471 | 0 | 0 | null | 2022-12-07T01:02:22 | 2019-04-12T07:22:42 |
Vue
|
UTF-8
|
Java
| false | false | 2,258 |
java
|
package com.songdi.paas.common.context;
import java.util.HashMap;
import java.util.Map;
import com.songdi.paas.common.constant.CommonConstants;
import com.songdi.paas.common.util.StringHelper;
/**
* Created by ace on 2017/9/8.
*/
public class BaseContextHandler {
public static ThreadLocal<Map<String, Object>> threadLocal = new ThreadLocal<Map<String, Object>>();
public static void set(String key, Object value) {
Map<String, Object> map = threadLocal.get();
if (map == null) {
map = new HashMap<String, Object>();
threadLocal.set(map);
}
map.put(key, value);
}
public static Object get(String key) {
Map<String, Object> map = threadLocal.get();
if (map == null) {
map = new HashMap<String, Object>();
threadLocal.set(map);
}
return map.get(key);
}
public static String getUserID() {
Object value = get(CommonConstants.CONTEXT_KEY_USER_ID);
return returnObjectValue(value);
}
public static String getUsername() {
Object value = get(CommonConstants.CONTEXT_KEY_USERNAME);
return returnObjectValue(value);
}
public static String getName() {
Object value = get(CommonConstants.CONTEXT_KEY_USER_NAME);
return StringHelper.getObjectValue(value);
}
public static String getToken() {
Object value = get(CommonConstants.CONTEXT_KEY_USER_TOKEN);
return StringHelper.getObjectValue(value);
}
public static void setToken(String token) {
set(CommonConstants.CONTEXT_KEY_USER_TOKEN, token);
}
public static void setName(String name) {
set(CommonConstants.CONTEXT_KEY_USER_NAME, name);
}
public static void setUserID(String userID) {
set(CommonConstants.CONTEXT_KEY_USER_ID, userID);
}
public static void setUsername(String username) {
set(CommonConstants.CONTEXT_KEY_USERNAME, username);
}
private static String returnObjectValue(Object value) {
return value == null ? null : value.toString();
}
public static void remove() {
threadLocal.remove();
}
}
|
[
"[email protected]"
] | |
7bf9f2a7ec36378e5a88308c291b74e0df815751
|
a026f5df043f1adb4945417d027ef7eab1d2bad8
|
/Workspace/LetsTagOn/LetsTagOnService/src/main/java/com/letstagon/service/impl/OpportunityServiceImpl.java
|
1a4ca816f89e776c0c987a599624cbeae2b769b1
|
[] |
no_license
|
Ranjitha1992/LetsTag-On
|
9a134790d9c325d0c1befba871b1b485dd65d24a
|
50400e9f2a25e4900bc6abfd34ff289e67b3f329
|
refs/heads/master
| 2021-06-22T07:48:01.737246 | 2017-08-16T07:02:42 | 2017-08-16T07:02:42 | 100,458,604 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 8,874 |
java
|
package com.letstagon.service.impl;
import java.security.InvalidParameterException;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Component;
import com.letstagon.dao.model.Cause;
import com.letstagon.dao.model.Opportunity;
import com.letstagon.dao.model.OpportunityCauseXref;
import com.letstagon.dao.model.OpportunityJobType;
import com.letstagon.dao.model.Party;
import com.letstagon.dao.model.User;
import com.letstagon.dao.repository.AddressRepository;
import com.letstagon.dao.repository.OpportunityCauseRepository;
import com.letstagon.dao.repository.OpportunityJobTypeRepository;
import com.letstagon.dao.repository.OpportunityRepository;
import com.letstagon.exception.profile.InvalidPreferenceException;
import com.letstagon.service.OpportunityService;
// TODO: Auto-generated Javadoc
/**
* The Class OpportunityServiceImpl.
*/
@Component
public class OpportunityServiceImpl implements OpportunityService {
/** The opportunity repository. */
@Autowired
private OpportunityRepository opportunityRepository;
/** The opportunity job type repository. */
@Autowired
private OpportunityJobTypeRepository opportunityJobTypeRepository;
/** The opportunity cause repository. */
@Autowired
private OpportunityCauseRepository opportunityCauseRepository;
/** The address repository. */
@Autowired
private AddressRepository addressRepository;
/* (non-Javadoc)
* @see com.letstagon.service.OpportunityService#createOpportunity(com.letstagon.dao.model.Opportunity)
*/
@Override
public Opportunity createOpportunity(Opportunity opportunity) {
// save address before saving opportunity
if (opportunity.getAddressBean() != null) {
this.addressRepository.save(opportunity.getAddressBean());
}
if (opportunity.getCreatedByParty() == null) {
throw new InvalidParameterException("No created by party sent.");
}
opportunity.setModifiedDate(new Date());
return opportunityRepository.save(opportunity);
}
/* (non-Javadoc)
* @see com.letstagon.service.OpportunityService#deleteOpportunity(com.letstagon.dao.model.Opportunity)
*/
@Override
public void deleteOpportunity(Opportunity opportunity) {
opportunityRepository.delete(opportunity);
}
/* (non-Javadoc)
* @see com.letstagon.service.OpportunityService#getAllRecentOpportunities()
*/
@Override
public List<Opportunity> getAllRecentOpportunities() {
Sort orderBy = new Sort(Sort.Direction.DESC, "dateStart");
return (List<Opportunity>) opportunityRepository.findAll(orderBy);
}
/* (non-Javadoc)
* @see com.letstagon.service.OpportunityService#getOpportunityDetails(long)
*/
@Override
public Opportunity getOpportunityDetails(long opportunityID) {
return this.opportunityRepository.findOne(opportunityID);
}
/* (non-Javadoc)
* @see com.letstagon.service.OpportunityService#editOpportunity(com.letstagon.dao.model.Opportunity)
*/
@Override
public Opportunity editOpportunity(Opportunity opportunity) {
// save address before saving opportunity
if (opportunity.getAddressBean() != null) {
this.addressRepository.save(opportunity.getAddressBean());
}
opportunity.setModifiedDate(new Date());
return opportunityRepository.save(opportunity);
}
/* (non-Javadoc)
* @see com.letstagon.service.OpportunityService#setContactPerson(com.letstagon.dao.model.Opportunity, com.letstagon.dao.model.User)
*/
@Override
public Opportunity setContactPerson(Opportunity opportunity, User contactperson) {
Opportunity oppFromDB = this.getOpportunityDetails(opportunity.getId());
oppFromDB.setContactPerson(contactperson);
oppFromDB.setModifiedDate(new Date());
return opportunityRepository.save(oppFromDB);
}
/* (non-Javadoc)
* @see com.letstagon.service.OpportunityService#addEventToProgram(com.letstagon.dao.model.Opportunity)
*/
@Override
public Opportunity addEventToProgram(Opportunity opportunity) {
Opportunity oppFromDB = this.getOpportunityDetails(opportunity.getId());
oppFromDB.setParentProgram(opportunity.getParentProgram());
oppFromDB.setModifiedDate(new Date());
return opportunityRepository.save(oppFromDB);
}
/* (non-Javadoc)
* @see com.letstagon.service.OpportunityService#mapRoleToOpportunity(com.letstagon.dao.model.OpportunityJobType)
*/
@Override
public Opportunity mapRoleToOpportunity(OpportunityJobType opportunityJobType) {
if (opportunityJobType == null || opportunityJobType.getOpportunityBean() == null
|| opportunityJobType.getOpportunityBean().getId() <= 0 || opportunityJobType.getJobTypeBean() == null
|| opportunityJobType.getJobTypeBean().getId() <= 0) {
throw new InvalidParameterException("Invalid parameter, not enough input");
}
OpportunityJobType oppJobType = this.opportunityJobTypeRepository.findOneByJobTypeBeanAndOpportunityBean(
opportunityJobType.getJobTypeBean(), opportunityJobType.getOpportunityBean());
if (oppJobType == null) {
oppJobType = this.opportunityJobTypeRepository.save(opportunityJobType);
}
oppJobType.setNumberOfPositions(opportunityJobType.getNumberOfPositions());
oppJobType.setSelectionCriteria(opportunityJobType.getSelectionCriteria());
oppJobType.setStatus(opportunityJobType.getStatus());
this.opportunityJobTypeRepository.save(oppJobType);
updateModifiedDate(oppJobType.getOpportunityBean().getId());
return this.getOpportunityDetails(oppJobType.getOpportunityBean().getId());
}
/* (non-Javadoc)
* @see com.letstagon.service.OpportunityService#updateModifiedDate(long)
*/
@Override
public void updateModifiedDate(long id) {
Opportunity oppFromDB = opportunityRepository.findOne(id);
if (oppFromDB == null) {
return;
}
oppFromDB.setModifiedDate(new Date());
this.opportunityRepository.save(oppFromDB);
}
/* (non-Javadoc)
* @see com.letstagon.service.OpportunityService#changeOpportunityJobStatus(com.letstagon.dao.model.Opportunity, com.letstagon.dao.model.OpportunityJobType)
*/
@Override
public Opportunity changeOpportunityJobStatus(Opportunity opportunity, OpportunityJobType opportunityJobType) {
OpportunityJobType oppJobType = this.opportunityJobTypeRepository.findOne(opportunityJobType.getId());
oppJobType.setStatus(opportunityJobType.getStatus());
this.opportunityJobTypeRepository.save(oppJobType);
this.updateModifiedDate(opportunity.getId());
return this.getOpportunityDetails(opportunity.getId());
}
/* (non-Javadoc)
* @see com.letstagon.service.OpportunityService#mapCauseToOpportunity(com.letstagon.dao.model.OpportunityCauseXref)
*/
@Override
public Opportunity mapCauseToOpportunity(OpportunityCauseXref causeXref) {
if (causeXref == null || causeXref.getOpportunityBean() == null || causeXref.getOpportunityBean().getId() <= 0
|| causeXref.getCauseBean() == null || causeXref.getCauseBean().getId() <= 0) {
throw new InvalidParameterException("Invalid parameter, not enough input");
}
OpportunityCauseXref causeXrefFromDB = this.opportunityCauseRepository
.findOneByCauseBeanAndOpportunityBean(causeXref.getCauseBean(), causeXref.getOpportunityBean());
if (causeXrefFromDB == null) {
causeXrefFromDB = this.opportunityCauseRepository.save(causeXref);
}
causeXrefFromDB.setCauseBean(causeXref.getCauseBean());
causeXrefFromDB.setOpportunityBean(causeXref.getOpportunityBean());
this.opportunityCauseRepository.save(causeXref);
this.updateModifiedDate(causeXref.getOpportunityBean().getId());
return this.getOpportunityDetails(causeXref.getOpportunityBean().getId());
}
/* (non-Javadoc)
* @see com.letstagon.service.OpportunityService#getOpportunitiesCreatedByParty(com.letstagon.dao.model.Party)
*/
@Override
public List<Opportunity> getOpportunitiesCreatedByParty(Party party) {
if (party == null || party.getId() < 1) {
throw new InvalidParameterException("Invalid party passed");
}
return this.opportunityRepository.findAllByCreatedByParty(party);
}
/* (non-Javadoc)
* @see com.letstagon.service.OpportunityService#deleteCause(long, long)
*/
@Override
public void deleteCause(long opportunityID, long causeId) {
OpportunityCauseXref cause = opportunityCauseRepository.findOneByCauseBeanAndOpportunityBean(new Cause(causeId),
new Opportunity(opportunityID));
this.opportunityCauseRepository.delete(cause);
}
/* (non-Javadoc)
* @see com.letstagon.service.OpportunityService#saveOrUpdateLatLongForOpportunity(long, java.lang.String)
*/
@Override
public Opportunity saveOrUpdateLatLongForOpportunity(long oppId,String latLong) throws InvalidPreferenceException {
Opportunity opp = opportunityRepository.findOne(oppId);
if(opp == null){
throw new InvalidPreferenceException("Opportunity not found");
}
opp.setLatLong(latLong);
return opportunityRepository.save(opp);
}
}
|
[
"[email protected]"
] | |
cb9899994b5cc2793c8c1a2bd0dde1a74a6c225b
|
9d34c7307d2c925d715bb088faf0ca00e4736fb6
|
/src/main/java/kz/edu/sdu/diploma/configuration/LocalDateTimeSerializer.java
|
f146e3ad6a884fbe66aaeada156a7c07cc8ddd44
|
[] |
no_license
|
Daulet402/edu-library
|
9b8dfa80f71c5eed428edc9f7da19d70b58ca012
|
8edbede016c1ef7c3246ffbfd792dde2dffc28da
|
refs/heads/master
| 2020-03-19T11:30:26.993136 | 2018-06-07T10:18:15 | 2018-06-07T10:38:34 | 136,459,898 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 611 |
java
|
package kz.edu.sdu.diploma.configuration;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import java.io.IOException;
import java.time.LocalDateTime;
public class LocalDateTimeSerializer extends JsonSerializer<LocalDateTime> {
@Override
public void serialize(LocalDateTime value, JsonGenerator gen, SerializerProvider serializers) throws IOException, JsonProcessingException {
gen.writeString(value.toString());
}
}
|
[
"[email protected]"
] | |
5c1d9a10d3ffab453372022203f3c1424458af46
|
5dc2572e7e42493a56c98e30c6d7be355c828520
|
/app/src/main/java/com/example/buttonsshoesstoreapp/Model/Users.java
|
fc3ea645404641e3f80504040c7122fa910e3984
|
[] |
no_license
|
pravin467/Buttonsshoesstore
|
71b2a4edffcee75d2a9a802842aa1dbc4d5d9192
|
b4e42f6b771450bc23e04374ae28e16f4c32fe53
|
refs/heads/master
| 2020-05-09T10:33:51.801753 | 2019-07-11T10:39:26 | 2019-07-11T10:39:26 | 181,047,483 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,112 |
java
|
package com.example.buttonsshoesstoreapp.Model;
public class Users {
private String name, phone, password, image, address;
public Users() {
}
public Users(String name, String phone, String password, String image, String address) {
this.name = name;
this.phone = phone;
this.password = password;
this.image = image;
this.address = address;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
}
|
[
"[email protected]"
] | |
01baf18ee884936cefb73765a43170071f929546
|
a2f89edea9d97e58a3d058ae0e0db61c10cc4692
|
/learn-otus-2/src/main/java/ru/otus/spring/dao/QuestionDaoSimple.java
|
76d0b44710b9f11302cf27ac3b6133803c9d9387
|
[] |
no_license
|
mari-otus/2020-08-otus-spring-Tronina
|
9166422c43902eecac3278c2dcc098d9c9247328
|
c05bd1509c3d21b848f5c76917e2d408078ead18
|
refs/heads/master
| 2023-03-04T15:07:17.087981 | 2021-02-02T12:40:31 | 2021-02-02T12:40:31 | 294,100,442 | 0 | 0 | null | 2021-02-02T12:41:06 | 2020-09-09T12:03:24 |
Java
|
UTF-8
|
Java
| false | false | 1,338 |
java
|
package ru.otus.spring.dao;
import com.fasterxml.jackson.databind.MappingIterator;
import com.fasterxml.jackson.dataformat.csv.CsvMapper;
import com.fasterxml.jackson.dataformat.csv.CsvSchema;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import org.springframework.core.io.Resource;
import org.springframework.stereotype.Repository;
import ru.otus.spring.domain.Question;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
/**
* DAO для работы с вопросами для теста.
*
* @author Mariya Tronina
*/
@Data
@RequiredArgsConstructor
@Repository
public class QuestionDaoSimple implements QuestionDao {
private final Resource resource;
private CsvMapper csvMapper = new CsvMapper();
@Override
public List<Question> findAllQuestion() {
try {
CsvSchema schema = csvMapper.schemaFor(Question.class)
.withColumnSeparator(';');
MappingIterator<Question> personIter = csvMapper
.reader(Question.class)
.with(schema)
.readValues(resource.getFile());
return personIter.readAll();
} catch (IOException e) {
e.printStackTrace();
}
return Collections.emptyList();
}
}
|
[
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.