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
abb3d7572f821b8dffb4c36e3a068aae6031a932
0587cd1b0c2d1c909a75fc113987d7f37720d455
/src/main/java/challenge/CriptografiaCesariana.java
19cc7cc8342de6eb57289f7af584d23ceb48b0d6
[]
no_license
caioq/criptografia-cesariana
f88fd3f8af4aaf31e7b6c53068840a9969714e0f
cb57085024a44fd4261a3b4ffbe9c95740afb28d
refs/heads/master
2020-04-29T20:38:58.809024
2019-03-19T01:06:43
2019-03-19T01:06:43
176,389,819
0
0
null
2019-03-19T01:06:44
2019-03-19T00:13:40
Java
UTF-8
Java
false
false
2,435
java
package challenge; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import java.util.function.Function; import java.util.stream.Collectors; public class CriptografiaCesariana implements Criptografia { @Override public String criptografar(String texto) { if (texto.equals(null)) { throw new NullPointerException(); } if (texto.isEmpty()) { throw new IllegalArgumentException(); } // converte string em lista de chars List<Character> listCharsBefore = texto.chars().mapToObj(i -> (char) i).collect(Collectors.toList()); // calcula valor da letra criptografada Function<Character, Character> encriptar = letra -> { Character novaLetra = (char) (letra + 3); if (novaLetra > 122) { novaLetra = (char) (novaLetra - 26); } return novaLetra; }; // converte letra para minusculo Function<Character, Character> toLowerCase = Character::toLowerCase; // Une as duas funcoes de tratamento na criptografia Function<Character, Character> transformacao = toLowerCase.andThen(encriptar); // criptografa cada char da lista String textCrypted = listCharsBefore.stream().map(c -> { if (c.isLetter(c)) { return transformacao.apply(c).toString(); } return c.toString(); }).collect(Collectors.joining("")); return textCrypted; } @Override public String descriptografar(String texto) { if (texto.equals(null)) { throw new NullPointerException(); } if (texto.isEmpty()) { throw new IllegalArgumentException(); } // converte string em lista de chars List<Character> listCharsBefore = texto.chars().mapToObj(i -> (char) i).collect(Collectors.toList()); // calcula valor da letra criptografada Function<Character, Character> desencriptar = letra -> { Character novaLetra = (char) (letra - 3); if (novaLetra < 97) { novaLetra = (char) (122 - (96 - novaLetra)); } return novaLetra; }; // converte letra para minusculo Function<Character, Character> toLowerCase = Character::toLowerCase; // Une as duas funcoes de tratamento na criptografia Function<Character, Character> transformacao = toLowerCase.andThen(desencriptar); // descriptografa cada char da lista String textDecrypted = listCharsBefore.stream().map(c -> { if (c.isLetter(c)) { return transformacao.apply(c).toString(); } return c.toString(); }).collect(Collectors.joining("")); return textDecrypted; } }
[ "caiogqueiroz@gmail.com" ]
caiogqueiroz@gmail.com
5ec60750d41f25710bf42cbe427d95c10551cb14
34241030f5ff5a83ae47d4b8b330a5ac19d4035e
/src/main/java/lesson08/mathoperations/MathOperation.java
7c8c7f1fc9a544de21655bd01065dbf55317e529
[]
no_license
xMAGWAJx/JGBC2020
97a4da45428c583500840327e9aa4f02ea4b567b
df1b95a4a99203b5183bbd5ea7b31c588768de9f
refs/heads/master
2021-01-05T06:28:46.208610
2020-03-24T21:42:52
2020-03-24T21:42:52
240,913,944
0
0
null
null
null
null
UTF-8
Java
false
false
111
java
package lesson08.mathoperations; public interface MathOperation { double execute(double a, double b); }
[ "xmagwajx@gmail.com" ]
xmagwajx@gmail.com
e8ee487e143da6e593f61f4b846d4c26032e1e87
cf05c5d19b990080b1a2671968c5bbe097fa3988
/app/src/main/java/com/nuaa/coolweather/db/Province.java
b308ada52010af7d0476da21cecf5525769ed139
[ "Apache-2.0" ]
permissive
LRQQQ/coolweather
0af08df1470a9d22369f98094c321687512a1f99
19e9f8ee5e170eaee104e81b605107a0439d4fff
refs/heads/master
2020-05-17T23:19:46.354749
2019-04-30T11:59:03
2019-04-30T11:59:03
184,028,841
0
0
null
null
null
null
UTF-8
Java
false
false
728
java
package com.nuaa.coolweather.db; import org.litepal.crud.DataSupport; public class Province extends DataSupport { private int id; //每个实体类中都应该有的字段 private String provinceName; //省名 private int provinceCode; //省代号 public int getId(){ return id; } public void setId(int id){ this.id = id; } public String getProvinceName(){ return provinceName; } public void setProvinceName(String provinceName){ this.provinceName = provinceName; } public int getProvinceCode(){ return provinceCode; } public void setProvinceCode(int provinceCode){ this.provinceCode = provinceCode; } }
[ "765844394@qq.com" ]
765844394@qq.com
9c8418a3dca7b62ef7c50af26de8781c736e6854
78973cf9de25cb71228a78d86fb38bc3dd086f16
/RodríguezBaezaJuanAntonioEDA1/.svn/pristine/9c/9c8418a3dca7b62ef7c50af26de8781c736e6854.svn-base
f76bab39a408ba443538b08dc352515c56ff4304
[]
no_license
juanrdzbaeza/eda1
3343629082f2341b6705f23794f0273fbbd1deb2
2d8e5e200bcc1b825edeeec17656fa0552c801d6
refs/heads/master
2016-09-14T03:35:52.283298
2016-05-04T21:35:49
2016-05-04T21:35:49
58,085,415
1
0
null
null
null
null
UTF-8
Java
false
false
18,990
package org.eda1.actividad05; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.util.*; import java.util.Map.Entry; import org.eda1.estructurasdedatos.ALStack; import org.eda1.estructurasdedatos.Graph; import org.eda1.estructurasdedatos.LinkedQueue; public class Network<Vertex> implements Graph<Vertex>, Iterable<Vertex> { protected boolean directed; // directed = false (unDirected), directed = true (DiGraph) protected TreeMap<Vertex, TreeMap<Vertex, Double>> adjacencyMap; protected TreeMap<Vertex, Integer> vertexToIndex; /** * Initialized this Network object to be empty. */ public Network() { directed = true; adjacencyMap = new TreeMap<Vertex, TreeMap<Vertex, Double>>(); vertexToIndex = new TreeMap<Vertex, Integer>(); } // default constructor public Network(boolean uDOrD) { //uDOrD == unDirected Or Directed directed = uDOrD; adjacencyMap = new TreeMap<Vertex, TreeMap<Vertex, Double>>(); vertexToIndex = new TreeMap<Vertex, Integer>(); } // default constructor /** * Initializes this Network object to a shallow copy of a specified Network * object. * The averageTime(V, E) is O(V + E). * * @param network - the Network object that this Network object is * initialized to a shallow copy of. * */ @SuppressWarnings("unchecked") public Network (Network<Vertex> network) { this.directed = network.directed; this.adjacencyMap = new TreeMap<Vertex, TreeMap<Vertex, Double>>(network.adjacencyMap); this.vertexToIndex = (TreeMap<Vertex, Integer>) network.vertexToIndex.clone(); } // copy constructor public void setDirected(boolean uDOrD) { directed = uDOrD; } public boolean getDirected() { return directed; } /** * Determines if this Network object contains no vertices. * * @return true - if this Network object contains no vertices. * */ public boolean isEmpty() { return adjacencyMap.isEmpty(); } // method isEmpty /** * Determines the number of vertices in this Network object. * * @return the number of vertices in this Network object. * */ public int numberOfVertices() { return adjacencyMap.size(); } // method size /** * Returns the number of edges in this Network object. * The averageTime (V, E) is O (V). * * @return the number of edges in this Network object. * */ public int numberOfEdges() { int count = 0; for (Map.Entry<Vertex, TreeMap<Vertex, Double>> entry : adjacencyMap.entrySet()) count += entry.getValue().size(); return count; } // method getEdgeCount public void clear() { adjacencyMap.clear(); } /** * Determines the weight of an edge in this Network object. * The averageTime (V, E) is O (E / V). * * @param v1 - the beginning Vertex object of the edge whose weight is sought. * @param v2 - the ending Vertex object of the edge whose weight is sought. * * @return the weight of edge <v1, v2>, if <v1, v2> forms an edge; return ���1.0 if * <v1, v2> does not form an edge in this Network object. * */ //public double getEdgeWeight (Vertex v1, Vertex v2) public double getWeight (Vertex v1, Vertex v2) { if (! (adjacencyMap.containsKey(v1) && adjacencyMap.get(v1).containsKey(v2))) return -1.0; return adjacencyMap.get(v1).get(v2); } // method getWeight public double setWeight (Vertex v1, Vertex v2, double w) { if (! (adjacencyMap.containsKey (v1) && adjacencyMap.get(v1).containsKey(v2))) return -1.0; double oldWeight = adjacencyMap.get(v1).get(v2); adjacencyMap.get(v1).put(v2, w); return oldWeight; } public boolean isAdjacent (Vertex v1, Vertex v2) { return (adjacencyMap.containsKey(v1) && adjacencyMap.get(v1).containsKey(v2)); } /** * Determines if this Network object contains a specified Vertex object. * * @param vertex - the Vertex object whose presence is sought. * * @return true - if vertex is an element of this Network object. */ public boolean containsVertex(Vertex vertex) { return adjacencyMap.containsKey(vertex); } // method containsVertex /** * Determines if this Network object contains an edge specified by two vertices. * The averageTime (V, E) is O (E / V). * * @param v1 - the beginning Vertex object of the edge sought. * @param v2 - the ending Vertex object of the edge sought. * * @return true - if this Network object contains the edge <v1, v2>. * */ public boolean containsEdge(Vertex v1, Vertex v2) { return (adjacencyMap.containsKey(v1) && adjacencyMap.get(v1).containsKey(v2)); } // method containsEdge /** * Ensures that a specified Vertex object is an element of this Network object. * * @param vertex - the Vertex object whose presence is ensured. * * @return true - if vertex was added to this Network object by this call; returns * false if vertex was already an element of this Network object when * this call was made. */ public boolean addVertex(Vertex vertex) { if (adjacencyMap.containsKey(vertex)) return false; adjacencyMap.put(vertex, new TreeMap<Vertex, Double>()); return true; } // method addVertex /** * Ensures that an edge is in this Network object. * * @param v1 - the beginning Vertex object of the edge whose presence * is ensured. * @param v2 - the ending Vertex object of the edge whose presence is * ensured. * @param weight - the weight of the edge whose presence is ensured. * * @return true - if the given edge (and weight) were added to this Network * object by this call; return false, if the given edge (and weight) * were already in this Network object when this call was made. * */ public boolean addEdge(Vertex v1, Vertex v2, double w) { addVertex(v1); addVertex(v2); adjacencyMap.get(v1).put(v2, w); if (!directed) adjacencyMap.get(v2).put(v1, w); return true; } // method addEdge /** * Ensures that a specified Vertex object is not an element of this Network object. * The averageTime (V, E) is O (V + E). * * @param vertex - the Vertex object whose absence is ensured. * * @return true - if vertex was removed from this Network object by this call; * returns false if vertex was not an element of this Network object * when this call was made. * */ public boolean removeVertex(Vertex vertex) { if (!adjacencyMap.containsKey(vertex)) return false; for (Map.Entry<Vertex, TreeMap<Vertex, Double>> entry: adjacencyMap.entrySet()) { entry.getValue().remove(vertex); } // for each vertex in the network adjacencyMap.remove(vertex); return true; } // removeVertex /** * Ensures that an edge specified by two vertices is absent from this Network * object. * The averageTime (V, E) is O (E / V). * * @param v1 - the beginning Vertex object of the edge whose absence is * ensured. * @param v2 - the ending Vertex object of the edge whose absence is * ensured. * * @return true - if the edge <v1, v2> was removed from this Network object * by this call; return false if the edge <v1, v2> was not in this * Network object when this call was made. * */ public boolean removeEdge (Vertex v1, Vertex v2) { if (!adjacencyMap.containsKey(v1) || !adjacencyMap.get(v1).containsKey(v2)) return false; adjacencyMap.get(v1).remove(v2); if (!directed) { adjacencyMap.get(v2).remove(v1); } return true; } // method removeEdge public Set<Vertex> vertexSet() { return adjacencyMap.keySet(); } /** * Returns a LinkedList object of the neighbors of a specified Vertex object. * * @param v - the Vertex object whose neighbors are returned. * * @return a LinkedList of the vertices that are neighbors of v. */ public Set<Vertex> getNeighbors(Vertex v) { if (adjacencyMap.containsKey(v)) return null; return new TreeSet<Vertex>(adjacencyMap.get(v).keySet()); } /** * Returns a String representation of this Network object. * The averageTime(V, E) is O(V + E). * * @return a String representation of this Network object. * */ public String toString() { return adjacencyMap.toString(); } // method toString /** * Returns the mapping between the Vertex objects and a set of integers representing them. * * * @return the map between Vertex and Integer --> matrix representation in Floyd algorithm. * */ public TreeMap<Vertex, Integer> getVertexToIndex(){ return vertexToIndex; } /** * Builds a graph whose vertices are strings by reading the * vertices and edges from the textfile <tt>filename</tt>. The format * of the file is <code> * nVertices * vertex_1 vertex_2 ...vertex_n * nEdges * vertex_i vertex_j weight * . . . </code> ... * @param filename name of the text file with vertex and edge specifications. * @return <tt>DiGraph</tt> object with generic type String. */ @SuppressWarnings("unchecked") public void readNetwork(String filename) throws FileNotFoundException { Scanner sc = new Scanner(new File(filename)); String linea = ""; String lineaCachos[]; int tipoGrafo = Integer.parseInt(sc.nextLine()); setDirected(tipoGrafo == 1 ? true:false); int numVertices = Integer.parseInt(sc.nextLine()); int index = 0; for (int i = 0; i < numVertices; i++) { linea = sc.nextLine(); addVertex((Vertex)linea); vertexToIndex.put((Vertex)linea, index); index++; } int numAristas = Integer.parseInt(sc.nextLine()); for (int i = 0; i < numAristas; i++) { linea = sc.nextLine(); lineaCachos = linea.split(" "); Vertex v1 = (Vertex) lineaCachos[0]; Vertex v2 = (Vertex) lineaCachos[1]; double w = Double.parseDouble(lineaCachos[2]); addEdge(v1, v2, w); } /*for (Entry<Vertex, TreeMap<Vertex, Double>> v : adjacencyMap.entrySet()) { vertexToIndex.put(v.getKey(), index); index++; }*/ //here!!! } public Iterator<Vertex> iterator() { return adjacencyMap.keySet().iterator(); } // method iterator public BreadthFirstIterator breadthFirstIterator (Vertex v) { if (!adjacencyMap.containsKey(v)) return null; return new BreadthFirstIterator(v); } // method breadthFirstIterator public DepthFirstIterator depthFirstIterator (Vertex v) { if (!adjacencyMap.containsKey (v)) return null; return new DepthFirstIterator(v); } // method depthFirstIterator public ArrayList<Vertex> toArrayDFS(Vertex start) { ArrayList<Vertex> result = new ArrayList<Vertex>(); TreeMap<Vertex,Boolean> visited = new TreeMap<Vertex, Boolean>(); for (Vertex v : adjacencyMap.keySet()){ visited.put(v,false); } toArrayDFSAux(start, result, visited); return result; } private void toArrayDFSAux(Vertex current, ArrayList<Vertex> result, TreeMap<Vertex,Boolean> visited) { result.add(current); visited.put(current, true); for (Vertex to : adjacencyMap.get(current).keySet()) { if (!visited.get(to)) toArrayDFSAux(to,result,visited); } } public ArrayList<Vertex> toArrayDFSIterative(Vertex start) { ArrayList<Vertex> result = new ArrayList<Vertex>(); TreeMap<Vertex,Boolean> visited = new TreeMap<Vertex, Boolean>(); ALStack<Vertex> stack = new ALStack<Vertex>(); Vertex current = null; for (Vertex v : adjacencyMap.keySet()){ visited.put(v,false); } stack.push(start); visited.put(start, true); while (!stack.isEmpty()) { current = stack.peek(); stack.pop(); result.add(current); for (Vertex to : adjacencyMap.get(current).keySet()) { if (visited.get(to)) continue; visited.put(to, true); stack.push(to); } } return result; } public ArrayList<Vertex> toArrayBFS(Vertex start) { ArrayList<Vertex> result = new ArrayList<Vertex>(); TreeMap<Vertex,Boolean> visited = new TreeMap<Vertex, Boolean>(); LinkedQueue<Vertex> q = new LinkedQueue<Vertex>(); Vertex current; for (Vertex v : adjacencyMap.keySet()){ visited.put(v,false); } q.push(start); visited.put(start, true); while (!q.isEmpty()) { current = q.peek(); q.pop(); result.add(current); for (Vertex to : adjacencyMap.get(current).keySet()) { if (visited.get(to)) continue; visited.put(to, true); q.push(to); } } return result; } ///////// public ArrayList<Object> Dijkstra(Vertex source, Vertex destination) { final double INFINITY = Double.MAX_VALUE; Double weight = .0, minWeight = INFINITY; TreeMap<Vertex, Double> D = new TreeMap<Vertex, Double>(); TreeMap<Vertex, Vertex> S = new TreeMap<Vertex, Vertex>(); TreeSet<Vertex> V_minus_S = new TreeSet<Vertex>(); ArrayList<Object> path = new ArrayList<Object>(); ALStack<Vertex> st = new ALStack<Vertex>(); Vertex from = null; if (source == null || destination == null) return null; if (source.equals(destination)) return null; if (!(adjacencyMap.containsKey(source) && adjacencyMap.containsKey(destination))) return null; for (Vertex e : adjacencyMap.keySet()) { if (source.equals(e)) continue; V_minus_S.add(e); } for (Vertex v : V_minus_S){ if (isAdjacent(source,v)){ S.put(v, source); D.put(v, getWeight(source,v)); } else{ S.put(v, null); D.put(v, INFINITY); } } S.put(source, source); D.put(source, 0.0); while (!V_minus_S.isEmpty()) { minWeight = INFINITY; from = null; for (Vertex v : V_minus_S){ if (D.get(v) < minWeight){ minWeight = D.get(v); from = v; } } if (from == null) break; V_minus_S.remove(from); for (Vertex v : V_minus_S){ if (isAdjacent(from,v)){ weight = getWeight(from,v); if (D.get(from) + weight < D.get(v)){ D.put(v, D.get(from) + weight); S.put(v, from); } } } } if (S.get(destination) == null) { throw new RuntimeException("The vertex " + destination + " is not reachable from " + source); } st.push(destination); while (!(st.peek().equals(source))) { st.push(S.get(st.peek())); } while (!(st.isEmpty())) { path.add(st.peek()); st.pop(); } return path; } @SuppressWarnings("unchecked") public double computeDistanceFromPath(ArrayList<Object> path){ double result=.0; for (int i=1; i<path.size(); i++){ result += getWeight((Vertex)path.get(i-1), (Vertex)path.get(i)); } return result; } public Object[] floyd() { final double INFINITY = Double.MAX_VALUE; Object [] resultFloyd = null; double [][] matrixD; // adjacency matrix int [][] matrixA; // *** Vertex from, to; double weight; int n = numberOfVertices(); resultFloyd = new Object[2]; matrixD = new double [n][n]; matrixA = new int [n][n]; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { matrixA[i][j] = -1; matrixD[i][j] = (i==j) ? 0 : INFINITY; } } for (Map.Entry<Vertex, TreeMap<Vertex, Double>> e1 : adjacencyMap.entrySet()) { for (Map.Entry<Vertex, Double> e2 : e1.getValue().entrySet()) { from = e1.getKey(); to = e2.getKey(); weight = e2.getValue(); matrixD[vertexToIndex.get(from)][vertexToIndex.get(to)] = weight; } } for (int k = 0; k < n; k++) { for (int i = 0; i < n; i++) { if (i==k) continue; for (int j = 0; j < n; j++) { if (j==k || i==j) continue; if (matrixD[i][k] == INFINITY || matrixD[k][j] == INFINITY) continue; if ((matrixD[i][k] + matrixD[k][j]) < matrixD[i][j]) { matrixD[i][j] = matrixD[i][k] + matrixD[k][j]; matrixA[i][j] = k; } } } } resultFloyd[0] = matrixD; resultFloyd[1] = matrixA; return resultFloyd; } protected class BreadthFirstIterator implements Iterator<Vertex> { protected LinkedQueue<Vertex> queue; protected TreeMap<Vertex, Boolean> visited; protected Vertex current; public BreadthFirstIterator (Vertex start) { queue = new LinkedQueue<Vertex>(); visited = new TreeMap<Vertex, Boolean>(); for (Vertex v : adjacencyMap.keySet()){ visited.put(v,false); } queue.push(start); visited.put (start, true); } // one-parameter constructor public boolean hasNext() { return !(queue.isEmpty()); } // method hasNext public Vertex next() { current = queue.pop(); for (Vertex to : adjacencyMap.get(current).keySet()) { if (!visited.get(to)) { visited.put (to, true); queue.push(to); } } return current; } // method next public void remove() { removeVertex (current); } // method remove } // class BreadthFirstIterator protected class DepthFirstIterator implements Iterator<Vertex> { ALStack<Vertex> stack; TreeMap<Vertex, Boolean> visited; Vertex current; public DepthFirstIterator (Vertex start) { stack = new ALStack<Vertex>(); visited = new TreeMap<Vertex, Boolean>(); for (Vertex v : adjacencyMap.keySet()){ visited.put(v, false); } stack.push (start); visited.put (start, true); } // one-parameter constructor public boolean hasNext() { return !(stack.isEmpty()); } // method hasNext public Vertex next() { current = stack.pop(); for (Vertex to: adjacencyMap.get(current).keySet()) { if (!visited.get (to)) { visited.put (to, true); stack.push (to); } } return current; } public void remove() { removeVertex (current); } } // class DepthFirstIterator } // class Network
[ "Juan@DESKTOP-9T3LSBK" ]
Juan@DESKTOP-9T3LSBK
fd122fcbf6ff0edf132b2e3a3b4266599b11152f
ee5af78266c2175a6494dafd43dcee75468fd3ab
/src/test/java/com/springboottesting/springboottesting/controller/controllerIntegrationTest.java
74221752daffc8794b4025a5822983411c92801e
[]
no_license
AmirGHUB/SpringBootTestingExercise
03c87db3348a64531e5e29004f3ff984cda21ab1
b4787eaa8a5999119c9e0183da4bd46a41673130
refs/heads/master
2022-11-29T14:58:37.386752
2020-08-03T08:09:45
2020-08-03T08:09:45
284,640,410
0
0
null
null
null
null
UTF-8
Java
false
false
1,006
java
package com.springboottesting.springboottesting.controller; import com.springboottesting.springboottesting.model.Students; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import static org.hamcrest.CoreMatchers.*; import static org.junit.Assert.*; @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @RunWith(SpringRunner.class) public class controllerIntegrationTest { @Autowired private StudentController studentController; @Test public void addStudent(){ // create new stdent object Students student = new Students("bino","kino","google"); //post the student Students savedStudent = studentController.addStudent(student); //now test the method assertThat("bino",is(equalTo(savedStudent.getFirstName()))); } }
[ "Main@Amirs-MacBook-Air.local" ]
Main@Amirs-MacBook-Air.local
bdaf9fa7fb57af311c557c4c17c01f420b42eaa8
712fc4069f57b62480231b98ee4b5fef99f91900
/src/Gun8/StringEndsWith.java
2fd89d6277c2a8e3274c631a4cec072dc26f6e01
[]
no_license
satdem/java
d3bb22a0b290f39b53b24e69e0bc8b4458082acd
ccad4a7146153eec3e0746175a5599d5dc70be5b
refs/heads/master
2022-12-11T21:23:03.272568
2020-09-02T10:54:42
2020-09-02T10:54:42
289,756,558
0
0
null
null
null
null
UTF-8
Java
false
false
534
java
package Gun8; public class StringEndsWith { public static void main(String[] args) { // EndsWith: bir sitrinin sonu .... ile bitiyor mu onu kontrol eder.büyük küçük harf ayrımı yapar. String text="Merhaba Dünya"; System.out.println("ya ile bitiyor mu: " +text.endsWith("ya")); System.out.println("A ile bitiyor mu: " +text.endsWith("A")); System.out.println("a ile bitiyor mu: " +text.endsWith("a")); System.out.println("ba ile bitiyor mu: " +text.endsWith("ba")); } }
[ "69872891+satdem@users.noreply.github.com" ]
69872891+satdem@users.noreply.github.com
85ff478a13ca638269f72cfbf365afe32d3500fa
b05927f7750627488f683b9557bb6f01d5362a5e
/src/nl/esciencecenter/aether/impl/nio/ChannelFactory.java
a974aea413470d1c4124c8ee60a9ecbf03b931b0
[ "Apache-2.0" ]
permissive
jmaassen/AetherNIO
14c7e07331101cf9991acf4239a4f462dc9926b4
7a61a3f5e8fea517adbd68b1ee7cf5a082a64c1f
refs/heads/master
2020-05-18T13:25:47.872768
2013-10-16T14:50:55
2013-10-16T14:50:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,172
java
/* $Id: ChannelFactory.java 11529 2009-11-18 15:53:11Z ceriel $ */ package nl.esciencecenter.aether.impl.nio; import java.io.IOException; import java.net.InetSocketAddress; import java.nio.channels.Channel; import nl.esciencecenter.aether.impl.ReceivePortIdentifier; /** * Creates and recycles/destroys writeable and readable channels. Any * implementation should also handle incoming connections in the run() method * and register them with the receiveport. */ public interface ChannelFactory extends Runnable { /** * Tries to connect to sendport to the given receiveport for tileoutMillis * milliseconds and returns the writechannel if it succeeded. A timeout of 0 * means try forever. * * @return a new Channel connected to "rpi". */ public Channel connect(NioSendPort spi, ReceivePortIdentifier rpi, long timeoutMillis) throws IOException; /** * Stops the factory. It will kill off any threads it made. */ public void quit() throws IOException; /** * Returns the socket address that this factory is listening to. */ public InetSocketAddress getAddress(); }
[ "J.Maassen@esciencecenter.nl" ]
J.Maassen@esciencecenter.nl
365f1a8bb2144f87a4cdcee383f31ff69c0ce6d7
c8efcb31941f78ec56812aa43164ee64abb6ff60
/app/src/main/java/com/mingri/future/airfresh/view/dialog/HCHOAlertDialog.java
8f5b09b3069473fb6e765acc21f5a9d621917482
[]
no_license
zhaoyayun199087/MRft
0a992ff798b615b5749fd6d753a102b948ab4646
f962d89f0387ae2d55fc817175930ddf95f589fb
refs/heads/main
2023-02-12T07:48:41.339311
2021-01-14T16:05:30
2021-01-14T16:05:30
309,666,941
1
0
null
null
null
null
UTF-8
Java
false
false
1,019
java
package com.mingri.future.airfresh.view.dialog; import android.content.Context; import android.view.View; import android.widget.TextView; import com.mingri.future.airfresh.R; /** * 耗材重置Dialog * Created by Administrator on 2017/7/7. */ public class HCHOAlertDialog extends BaseDialog{ private TextView tvOk; private VocAletCallback mCallback; public HCHOAlertDialog(Context context, VocAletCallback rc) { super(context); mCallback = rc; } @Override protected void initView() { View view=setView(R.layout.dialog_hcho_alert); tvOk = (TextView) view.findViewById(R.id.tv_ok); tvOk.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { mCallback.onOk(); dismiss(); } }); setCanceledOnTouchOutside(false); setWindowLayout(279,288); } public interface VocAletCallback{ public void onOk(); } }
[ "li.min@intellif.com" ]
li.min@intellif.com
22faf6327e3ae32b6178e76d7fd1f105dc324769
f8426d9766cddc2b6be389add73386a5d9b05e5a
/fluentlenium-integration-tests/src/test/java/org/fluentlenium/pages/Page2.java
c7cb2b51506ca1ca79649df8950a5817a4e340ee
[ "Apache-2.0" ]
permissive
wenceslas/FluentLenium
1876cce26cefaa3ef6c1b1342fa414b041ce7b5a
098586dc06af0ba86bcc0d9f1ce95b598a01f2c5
refs/heads/master
2022-12-05T16:15:20.964069
2020-08-14T13:45:44
2020-08-14T13:45:44
285,835,407
0
0
NOASSERTION
2020-08-07T13:26:57
2020-08-07T13:26:57
null
UTF-8
Java
false
false
438
java
package org.fluentlenium.pages; import static org.assertj.core.api.Assertions.assertThat; import org.fluentlenium.core.FluentPage; import org.fluentlenium.test.IntegrationFluentTest; public class Page2 extends FluentPage { @Override public String getUrl() { return IntegrationFluentTest.PAGE_2_URL; } @Override public void isAt() { assertThat(getDriver().getTitle()).isEqualTo("Page 2"); } }
[ "noreply@github.com" ]
noreply@github.com
a6929d910758efe9d483037ce29bc2959479543f
a3d0b8d4f9546c207518181cd043d8d620f3ddb2
/core/plugins/org.csstudio.autocomplete.pvmanager.sys/src/org/csstudio/autocomplete/pvmanager/sys/SysContentType.java
1a33123f3032a67739786d361fd84d5d74164a1f
[]
no_license
jhatje/cs-studio
ed2b42944ab6db6927a33643e687f81bf2cc686f
1d6a9d16c52b16823a236e7e32abad469a334197
refs/heads/master
2020-12-28T21:39:36.020993
2014-01-31T11:17:46
2014-01-31T11:17:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
806
java
/******************************************************************************* * Copyright (c) 2010-2013 ITER Organization. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html ******************************************************************************/ package org.csstudio.autocomplete.pvmanager.sys; import org.csstudio.autocomplete.parser.ContentType; /** * @author Fred Arnaud (Sopra Group) - ITER * */ public class SysContentType extends ContentType { public static SysContentType SysFunction = new SysContentType("SysFunction"); private SysContentType(String value) { super(value); } }
[ "frederic.arnaud@iter.org" ]
frederic.arnaud@iter.org
f4fd8646a840a7e51037609ee93fdd5fdabbdee5
776e0ccc10c4c788a02dc54df35fb2f5184e399e
/workspace/EmployeeJSP/src/com/wellsfargo/fsd/controller/ToDoServlet.java
d5fbff6e7c7ba2fb3044d48d7a39ab6de2349ea9
[]
no_license
swapnashetty05/FSD
b4c6d8ad61045247e3cf4dbf6532d4b250ca1040
c5cfc09d930353ed809d5d638a419b364bc9db66
refs/heads/master
2023-05-12T13:50:43.984950
2021-05-27T07:07:13
2021-05-27T07:07:13
285,956,606
0
0
null
null
null
null
UTF-8
Java
false
false
1,854
java
package com.wellsfargo.fsd.controller; import java.io.IOException; import java.util.ArrayList; import java.util.List; import javax.servlet.RequestDispatcher; import javax.servlet.ServletContext; 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 ToDoServlet */ @WebServlet("/todos") public class ToDoServlet extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public ToDoServlet() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse * response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { HttpSession session = request.getSession(); // List<String> taskList = (List<String>) session.getAttribute("tasks"); // ServletContext context = getServletContext(); //List<String> taskList = (List<String>) context.getAttribute("tasks"); if (taskList == null) { taskList = new ArrayList<>(); } String task = request.getParameter("task"); if (task != null) { taskList.add(task); } //context.setAttribute("tasks", taskList); session.setAttribute("tasks", taskList); request.getRequestDispatcher("toDoPage.jsp").forward(request, response); } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse * response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub doGet(request, response); } }
[ "wellsfargofsd60@iiht.tech" ]
wellsfargofsd60@iiht.tech
e442ac00fdacc45a546e3c0b64779353b2cb21e0
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/12/12_20ca3f3f1174dfce350b4b0c558d28c633db3546/CodeStyleTest/12_20ca3f3f1174dfce350b4b0c558d28c633db3546_CodeStyleTest_s.java
fcef5821231babbfa6b056d012c04d15603572e2
[]
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
15,551
java
/* * Copyright (c) 2002-2008 Gargoyle Software Inc. 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 acknowledgment: * * "This product includes software developed by Gargoyle Software Inc. * (http://www.GargoyleSoftware.com/)." * * Alternately, this acknowledgment may appear in the software itself, if * and wherever such third-party acknowledgments normally appear. * 4. The name "Gargoyle Software" must not be used to endorse or promote * products derived from this software without prior written permission. * For written permission, please contact info@GargoyleSoftware.com. * 5. Products derived from this software may not be called "HtmlUnit", nor may * "HtmlUnit" appear in their name, without prior written permission of * Gargoyle Software Inc. * * 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 GARGOYLE * SOFTWARE INC. 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. */ package com.gargoylesoftware.htmlunit; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.Calendar; import java.util.List; import org.junit.After; import org.junit.Before; import org.junit.Test; /** * Test of coding style for things that can not be detected by Checkstyle. * * @version $Revision$ * @author Ahmed Ashour */ public class CodeStyleTest { private List<String> errors_; /** * Before. */ @Before public void before() { errors_ = new ArrayList<String>(); } /** * After. */ @After public void after() { for (final String error : errors_) { System.err.println(error); } final int errorsNumber = errors_.size(); if (errorsNumber == 1) { fail("CodeStyle error"); } else if (errorsNumber > 1) { fail("CodeStyle " + errorsNumber + " errors"); } } private void addFailure(final String error) { errors_.add(error); } /** * @throws Exception if the test fails */ @Test public void codeStyle() throws Exception { process(new File("src/main/java")); process(new File("src/test/java")); licenseYear(); versionYear(); } private void process(final File dir) throws IOException { for (final File file : dir.listFiles()) { if (file.isDirectory() && !file.getName().equals(".svn")) { process(file); } else { if (file.getName().endsWith(".java")) { final List<String> lines = getLines(file); final String relativePath = file.getAbsolutePath().substring( new File(".").getAbsolutePath().length() - 1); openingCurlyBracket(lines, relativePath); year(lines, relativePath); javaDocFirstLine(lines, relativePath); methodFirstLine(lines, relativePath); methodLastLine(lines, relativePath); svnProperties(file, relativePath); runWith(lines, relativePath); twoEmptyLines(lines, relativePath); } } } } /** * Ensures that no opening curly bracket exists by itself in a single line. */ private void openingCurlyBracket(final List<String> lines, final String path) throws IOException { int index = 1; for (final String line : lines) { if (line.trim().equals("{")) { addFailure("Opening curly bracket is alone at " + path + ", line: " + index); } index++; } } /** * Checks the year in the source. */ private void year(final List<String> lines, final String path) throws IOException { assertTrue("Incorrect year in " + path, lines.get(1).contains("Copyright (c) 2002-" + Calendar.getInstance().get(Calendar.YEAR))); } /** * Checks the JavaDoc first line, it should not be empty, and should not start with lower-case. */ private void javaDocFirstLine(final List<String> lines, final String relativePath) throws IOException { for (int index = 1; index < lines.size(); index++) { final String previousLine = lines.get(index - 1); final String currentLine = lines.get(index); if (previousLine.trim().equals("/**")) { if (currentLine.trim().equals("*") || currentLine.contains("*/")) { addFailure("Empty line in " + relativePath + ", line: " + (index + 1)); } if (currentLine.trim().startsWith("*")) { final String text = currentLine.trim().substring(1).trim(); if (text.length() != 0 && Character.isLowerCase(text.charAt(0))) { addFailure("Lower case start in " + relativePath + ", line: " + (index + 1)); } } } } } /** * Checks the method first line, it should not be empty. */ private void methodFirstLine(final List<String> lines, final String relativePath) throws IOException { for (int index = 0; index < lines.size() - 1; index++) { final String line = lines.get(index); if (lines.get(index + 1).trim().length() == 0 && line.length() > 4 && Character.isWhitespace(line.charAt(0)) && line.endsWith("{") && !line.contains(" class ") && !line.contains(" interface ") && !line.contains(" @interface ") && (!Character.isWhitespace(line.charAt(4)) || line.trim().startsWith("public") || line.trim().startsWith("protected") || line.trim().startsWith("private"))) { addFailure("Empty line in " + relativePath + ", line: " + (index + 2)); } } } /** * Checks the method last line, it should not be empty. */ private void methodLastLine(final List<String> lines, final String relativePath) throws IOException { for (int index = 0; index < lines.size() - 1; index++) { final String line = lines.get(index); final String nextLine = lines.get(index + 1); if (line.trim().length() == 0 && nextLine.equals(" }")) { addFailure("Empty line in " + relativePath + ", line: " + (index + 1)); } } } /** * Checks properties svn:eol-style and svn:keywords. */ private void svnProperties(final File file, final String relativePath) throws IOException { final File svnBase = new File(file.getParentFile(), ".svn/prop-base/" + file.getName() + ".svn-base"); final File svnWork = new File(file.getParentFile(), ".svn/props/" + file.getName() + ".svn-work"); if (!isSvnPropertiesDefined(svnBase) && !isSvnPropertiesDefined(svnWork)) { addFailure("'svn:eol-style' and 'svn:keywords' properties are not defined for " + relativePath); } } private boolean isSvnPropertiesDefined(final File file) throws IOException { boolean eolStyleDefined = false; boolean keywordsDefined = false; if (file.exists()) { final List<String> lines = getLines(file); for (int i = 0; i + 2 < lines.size(); i++) { final String line = lines.get(i); final String nextLine = lines.get(i + 2); if (line.equals("svn:eol-style") && nextLine.equals("native")) { eolStyleDefined = true; } else if (line.equals("svn:keywords") && nextLine.equals("Author Date Id Revision")) { keywordsDefined = true; } } } return eolStyleDefined && keywordsDefined; } /** * Reads the given file as lines. * @param file file to read * @return the list of lines * @throws IOException if an error occurs */ private static List<String> getLines(final File file) throws IOException { final List<String> rv = new ArrayList<String>(); final BufferedReader reader = new BufferedReader(new FileReader(file)); String line; while ((line = reader.readLine()) != null) { rv.add(line); } reader.close(); return rv; } /** * @throws Exception if an error occurs */ @Test public void xmlStyle() throws Exception { processXML(new File("."), false); processXML(new File("src/main/resources"), true); processXML(new File("src/assembly"), true); processXML(new File("src/changes"), true); } private void processXML(final File dir, final boolean recursive) throws Exception { for (final File file : dir.listFiles()) { if (file.isDirectory() && !file.getName().equals(".svn")) { if (recursive) { processXML(file, true); } } else { if (file.getName().endsWith(".xml")) { final List<String> lines = getLines(file); final String relativePath = file.getAbsolutePath().substring( new File(".").getAbsolutePath().length() - 1); mixedIndentation(lines, relativePath); trailingWhitespace(lines, relativePath); badIndentationLevels(lines, relativePath); } } } } /** * Verifies that no XML files have mixed indentation (tabs and spaces, mixed). */ private void mixedIndentation(final List<String> lines, final String relativePath) { for (int i = 0; i < lines.size(); i++) { final String line = lines.get(i); if (line.indexOf('\t') != -1) { addFailure("Mixed indentation in " + relativePath + ", line: " + (i + 1)); } } } /** * Verifies that no XML files have trailing whitespace. */ private void trailingWhitespace(final List<String> lines, final String relativePath) { for (int i = 0; i < lines.size(); i++) { final String line = lines.get(i); if (line.length() > 0) { final char last = line.charAt(line.length() - 1); if (Character.isWhitespace(last)) { addFailure("Trailing whitespace in " + relativePath + ", line: " + (i + 1)); } } } } /** * Verifies that no XML files have bad indentation levels (each indentation level is 4 spaces). */ private void badIndentationLevels(final List<String> lines, final String relativePath) { for (int i = 0; i < lines.size(); i++) { final String line = lines.get(i); final int length1 = line.length(); final int length2 = line.trim().length(); final int indentation = length1 - length2; if (indentation % 4 != 0) { addFailure("Bad indentation level (" + indentation + ") in " + relativePath + ", line: " + (i + 1)); } } } /** * Checks the year in LICENSE.txt. */ private void licenseYear() throws IOException { final List<String> lines = getLines(new File("LICENSE.txt")); assertTrue("Incorrect year in LICENSE.txt", lines.get(1).contains("Copyright (c) 2002-" + Calendar.getInstance().get(Calendar.YEAR))); } /** * Checks the year in the {@link Version}. */ private void versionYear() throws IOException { final List<String> lines = getLines(new File("src/main/java/com/gargoylesoftware/htmlunit/Version.java")); for (final String line : lines) { if (line.contains("return \"Copyright (C) 2002-" + Calendar.getInstance().get(Calendar.YEAR))) { return; } } addFailure("Incorrect year in Version.getCopyright()"); } /** * Verifies that no direct instantiation of WebClient from a test that runs with BrowserRunner. */ private void runWith(final List<String> lines, final String relativePath) { if (relativePath.replace('\\', '/').contains("src/test/java") && !relativePath.contains("CodeStyleTest")) { boolean runWith = false; int index = 1; for (final String line : lines) { if (line.contains("@RunWith(BrowserRunner.class)")) { runWith = true; } if (runWith) { if (line.contains("new WebClient(")) { addFailure("Test " + relativePath + " should never directly instantiate WebClient, please use getWebClient() instead."); } if (line.contains("notYetImplemented()")) { addFailure("Use @NotYetImplemented instead of notYetImplemented() in " + relativePath + ", line: " + index); } } index++; } } } /** * Verifies that no two empty contiguous lines. */ private void twoEmptyLines(final List<String> lines, final String relativePath) { for (int i = 1; i < lines.size(); i++) { final String previousLine = lines.get(i - 1); final String line = lines.get(i); if (previousLine.trim().length() == 0 && line.trim().length() == 0) { addFailure("Two empty contiguous lines at " + relativePath + ", line: " + (i + 1)); } } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
7194f13f591791db275680b8f3f07c3167e7126d
8a69c60a9aa659e117b079b3fba94ec8350e905b
/src/java/services/RoleService.java
a5f47477ff8b7e85457df4788c0ce6fa1bb4f4a5
[]
no_license
Hargun-Bajwa/lab09
fb24657208f396961ccfa2570d71801ec7197d35
94e7799f13b54a10a4a9840e00eb432e090f5ae3
refs/heads/master
2023-06-18T23:27:42.890559
2021-07-18T19:35:09
2021-07-18T19:35:09
387,235,029
0
0
null
null
null
null
UTF-8
Java
false
false
265
java
package services; import models.Role; import dataaccess.RoleDB; public class RoleService { public Role get(int roleID) throws Exception { RoleDB roleDB = new RoleDB(); Role role = roleDB.get(roleID); return role; }}
[ "839217@SAIT227287IT.ACDM.DS.SAIT.CA" ]
839217@SAIT227287IT.ACDM.DS.SAIT.CA
4ff42a9538f77f7ddce757b879afb74670468084
b69a092c775780b725c90e1699c12f6d4ddc3f3b
/datarouter-storage/src/main/java/io/datarouter/storage/node/adapter/counter/physical/PhysicalMapStorageReaderCounterAdapter.java
c39c23f6f708269a2d126d8f8f74c465b0646c98
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
hoolatech/datarouter
a035e84e9dd5d79a5515f1015b10366a469fcb48
2ecc7e803895fbe8c5acffe875d4ddec24e7d14c
refs/heads/master
2020-04-12T00:08:08.762832
2018-12-13T00:39:58
2018-12-13T00:39:58
128,131,618
0
0
Apache-2.0
2018-12-17T21:02:20
2018-04-04T22:52:13
Java
UTF-8
Java
false
false
1,613
java
/** * Copyright © 2009 HotPads (admin@hotpads.com) * * 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 io.datarouter.storage.node.adapter.counter.physical; import io.datarouter.model.databean.Databean; import io.datarouter.model.key.primary.PrimaryKey; import io.datarouter.model.serialize.fielder.DatabeanFielder; import io.datarouter.storage.node.adapter.PhysicalAdapterMixin; import io.datarouter.storage.node.adapter.counter.BaseCounterAdapter; import io.datarouter.storage.node.adapter.counter.mixin.MapStorageReaderCounterAdapterMixin; import io.datarouter.storage.node.op.raw.read.MapStorageReader.PhysicalMapStorageReaderNode; public class PhysicalMapStorageReaderCounterAdapter< PK extends PrimaryKey<PK>, D extends Databean<PK,D>, F extends DatabeanFielder<PK,D>, N extends PhysicalMapStorageReaderNode<PK,D,F>> extends BaseCounterAdapter<PK,D,F,N> implements PhysicalMapStorageReaderNode<PK,D,F>, MapStorageReaderCounterAdapterMixin<PK,D,F,N>, PhysicalAdapterMixin<PK,D,F,N>{ public PhysicalMapStorageReaderCounterAdapter(N backingNode){ super(backingNode); } }
[ "cbonsart@hotpads.com" ]
cbonsart@hotpads.com
943e492520d8e8b8f12d566fd1a2c8ed76a71036
8397554fcdba3cdd7ef5683789fca3c683c005be
/app/src/main/java/com/austinabell8/studyspace/activities/Tutor/SearchActivity.java
ef0ea5a303abffbf72e9c174a03cd1c0a223402a
[]
no_license
austinabell/Studyspace
033e602fb14becd509c4b7f47e29694e1d40833e
99f450a38d4736c585c37ad2d8a9e105e77fec29
refs/heads/master
2021-03-27T19:57:49.738102
2018-02-14T16:22:21
2018-02-14T16:22:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,197
java
package com.austinabell8.studyspace.activities.Tutor; import android.app.Activity; import android.content.Intent; import android.support.v4.app.ActivityCompat; import android.support.v4.app.ActivityOptionsCompat; import android.support.v4.util.Pair; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.DividerItemDecoration; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.View; import android.widget.ProgressBar; import android.widget.TextView; import com.austinabell8.studyspace.R; import com.austinabell8.studyspace.adapters.Tutor.PostSearchRecyclerAdapter; import com.austinabell8.studyspace.model.Post; import com.austinabell8.studyspace.utils.SearchPostClickListener; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.Query; import com.google.firebase.database.ValueEventListener; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; public class SearchActivity extends AppCompatActivity { private static final String TAG = "SearchActivity"; private RecyclerView mRecyclerView; private ArrayList<Post> posts; private PostSearchRecyclerAdapter mPostRecyclerAdapter; private LinearLayoutManager llm; private SwipeRefreshLayout mSwipeRefreshLayout; private SearchPostClickListener mRecyclerViewClickListener; private ProgressBar mSpinner; private Toolbar mToolbar; private DatabaseReference mRootRef; private DatabaseReference mPostRef; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_search); mToolbar = findViewById(R.id.toolbar); setSupportActionBar(mToolbar); if (getSupportActionBar()!=null){ getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setTitle("Posts"); } mRecyclerView = findViewById(R.id.rv_search); mRootRef = FirebaseDatabase.getInstance().getReference(); mPostRef = mRootRef.child("posts"); mSpinner = findViewById(R.id.progress_bar_search); Bundle data = getIntent().getExtras(); String course = data.getString("course"); String searchText = data.getString("search_text"); mRecyclerView.setHasFixedSize(true); llm = new LinearLayoutManager(this); llm.setOrientation(LinearLayoutManager.VERTICAL); DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(mRecyclerView.getContext(), llm.getOrientation()); mRecyclerView.addItemDecoration(dividerItemDecoration); mRecyclerView.setLayoutManager(llm); posts = new ArrayList<>(); mRecyclerViewClickListener = new SearchPostClickListener() { @Override public void recyclerViewListClicked(View v, int position) { if (position != -1){ //Retrieve Id from item clicked, and pass it into an intent Intent intent = new Intent(v.getContext(), PostDetailsActivity.class); intent.putExtra("post_intent", posts.get(position)); TextView placeName = v.findViewById(R.id.text_name); TextView placeCourse = v.findViewById(R.id.text_course); TextView placePrice = v.findViewById(R.id.text_price); Pair<View,String> namePair = Pair.create((View)placeName, "tName"); Pair<View,String> coursePair = Pair.create((View)placeCourse, "tCourse"); Pair<View,String> pricePair = Pair.create((View)placePrice, "tPrice"); ArrayList<Pair> pairs = new ArrayList<>(); pairs.add(namePair); pairs.add(coursePair); pairs.add(pricePair); ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(SearchActivity.this, namePair,coursePair,pricePair); ActivityCompat.startActivity(v.getContext(), intent, options.toBundle()); } } @Override public void applyButtonClicked(View v, int position) { final Post clicked = posts.get(position); FirebaseDatabase firebaseDatabase = FirebaseDatabase.getInstance(); DatabaseReference ref = firebaseDatabase .getReference().child("post_applicants"); Map<String,Object> taskMap = new HashMap<>(); taskMap.put(FirebaseAuth.getInstance().getCurrentUser().getUid(), false); ref.child(clicked.getPid()).updateChildren(taskMap); setResult(Activity.RESULT_OK); } }; mPostRecyclerAdapter = new PostSearchRecyclerAdapter(getApplicationContext(), posts, mRecyclerViewClickListener); mRecyclerView.setAdapter(mPostRecyclerAdapter); Query tQuery = mPostRef.orderByChild("course").equalTo(course); tQuery.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(DataSnapshot snapshot) { posts.clear(); mSpinner.setVisibility(View.GONE); for (DataSnapshot postSnapshot: snapshot.getChildren()) { Post nPost = postSnapshot.getValue(Post.class); posts.add(nPost); (mRecyclerView.getAdapter()).notifyDataSetChanged(); } } @Override public void onCancelled(DatabaseError databaseError) { Log.e(TAG, "Post query request cancelled."); } }); } }
[ "austinabell8@gmail.com" ]
austinabell8@gmail.com
edf200d075176a39677b3f8a4bc9c67ebb7c7d5d
14cb30eea8d1904928ddf782f0ddf504e7dca48c
/client/app/src/main/java/pl/wroc/uni/ii/kokodzambocar/Api/Measurement.java
da5cb3248870714064c227416332a9a6a1829973
[]
no_license
mzapotoczny/KokodzamboCar
2f140dd70904d95a2fd47a83a55101e476705a5c
2088b8ea896f5b00a7785c768af9aea61634c990
refs/heads/master
2021-06-17T23:30:21.581277
2015-01-27T19:08:42
2015-01-27T19:08:42
93,996,751
0
0
null
null
null
null
UTF-8
Java
false
false
467
java
package pl.wroc.uni.ii.kokodzambocar.Api; import com.google.gson.annotations.SerializedName; /** * Created by michal on 25.01.15. */ public class Measurement { @SerializedName("pid_id") public Integer pid; @SerializedName("session_id") public Integer session; public String value; public Measurement(Integer session, Integer pid, String value){ this.pid = pid; this.value = value; this.session = session; } }
[ "mzapotoczny@gmail.com" ]
mzapotoczny@gmail.com
6d46e853e7abb3e7789c779909a8c8c8e614bb0f
03b5b6d74abf2367313d0c30e8b0d0bc729fc54e
/src/main/java/com/coolchatting/springbootwebchat/service/serviceImpl/VideoServiceImpl.java
b7a7da95166f1d33e7c01b4eeb7fdf80b7d477d0
[]
no_license
zhongliudizhu/springboot-webchat
06b8acb68dae7ef1b9b23fb43d29a39ffca1daa9
73e8889e938472a1a24e75adad262c6e835564fc
refs/heads/master
2020-05-05T13:30:37.256643
2019-04-08T10:46:24
2019-04-08T10:46:24
180,081,119
2
0
null
null
null
null
UTF-8
Java
false
false
1,089
java
package com.coolchatting.springbootwebchat.service.serviceImpl; import com.coolchatting.springbootwebchat.domain.Video; import com.coolchatting.springbootwebchat.mapper.VideoMapper; import com.coolchatting.springbootwebchat.service.VideoService; import org.springframework.beans.BeansException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.stereotype.Service; import java.util.List; @Service public class VideoServiceImpl implements VideoService , ApplicationContextAware { private ApplicationContext applicationContext; @Autowired private VideoMapper videoMapper; @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { this.applicationContext=applicationContext; System.out.println(applicationContext.getClass().getName()); } @Override public List<Video> getAllVideos() { return videoMapper.getAllVideos(); } }
[ "15596186979@163.com" ]
15596186979@163.com
c0f2a0c277360a24b88e791340733ffd8b9ed603
77e75da30e50e5e711885f44ea2ca898fe3835c4
/order/server/src/main/java/com/zhang/order/enums/OrderStatusEnum.java
058559f049fa07e706d02bea30ce9a8998c8ead5
[]
no_license
codingxin/springcloud-sell
b8875dbfc799a5cae200535a7873ff3eff8cd7f7
1fea814de695c46cd3ca8d9a1cc02efbe0170b2e
refs/heads/master
2022-04-05T06:31:49.394162
2020-02-21T11:15:33
2020-02-21T11:15:33
239,296,615
3
1
null
null
null
null
UTF-8
Java
false
false
350
java
package com.zhang.order.enums; import lombok.Getter; @Getter public enum OrderStatusEnum { New(0, "新订单"), FINISHED(1, "完结"), CANCEL(2, "取消"), ; private Integer code; private String message; OrderStatusEnum(Integer code, String message) { this.code = code; this.message = message; } }
[ "994683607@qq.com" ]
994683607@qq.com
3da55a27d3520f03bd9f29071bc511f110a73602
fd7409fc5bc3d16207eef4abf5df64c290ef4082
/CollectionDemo1.java
a98ef76f11068c228a36d591c6cde94b31785ffa
[]
no_license
devya212/signup
ca66dfa88999c5d6c2b449240409f0e8f48312a7
9902572f2c4334d5f6459dae9cf3e795ba13755c
refs/heads/master
2020-06-19T20:41:47.709435
2019-07-30T11:37:07
2019-07-30T11:37:07
196,864,540
0
0
null
null
null
null
UTF-8
Java
false
false
835
java
package coll; import java.util.*; import java.util.ArrayList; import java.util.List; public class CollectionDemo1 { public static void main(String[] args) { List list=new ArrayList(); list.add("hello"); list.add("hi"); list.add(12); Student s1 = new Student(1,"devyani"); list.add(s1.toString()); System.out.println(list); /*ArrayList<Student> list=new ArrayList<>(); list.add(new Student(1,"devyani")); list.add(new Student(2,"priya"));*/ /*for(int i=0;i<2;i++) { Student student=list.get(i); System.out.println(student.studentId+"\t"+student.studentName); }*/ /*Iterator iterator=list.iterator(); while(iterator.hasNext()) { Student student=(Student)iterator.next(); System.out.println(student.studentId+"\t"+student.studentName); }*/ } }
[ "noreply@github.com" ]
noreply@github.com
21f86366421c139406e28c0d926a37f75de2ae5d
a1e49f5edd122b211bace752b5fb1bd5c970696b
/projects/org.springframework.core/src/main/java/org/springframework/util/xml/TransformerUtils.java
7c615ade5de620538912c751605f179b26d8e8ca
[ "Apache-2.0" ]
permissive
savster97/springframework-3.0.5
4f86467e2456e5e0652de9f846f0eaefc3214cfa
34cffc70e25233ed97e2ddd24265ea20f5f88957
refs/heads/master
2020-04-26T08:48:34.978350
2019-01-22T14:45:38
2019-01-22T14:45:38
173,434,995
0
0
Apache-2.0
2019-03-02T10:37:13
2019-03-02T10:37:12
null
UTF-8
Java
false
false
3,290
java
/* * Copyright 2002-2008 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.util.xml; import javax.xml.transform.OutputKeys; import javax.xml.transform.Transformer; import org.springframework.util.Assert; /** * Contains common behavior relating to {@link javax.xml.transform.Transformer Transformers}, and the * <code>javax.xml.transform</code> package in general. * * @author Rick Evans * @author Juergen Hoeller * @since 2.5.5 */ public abstract class TransformerUtils { /** * The indent amount of characters if {@link #enableIndenting(javax.xml.transform.Transformer) indenting is enabled}. * <p>Defaults to "2". */ public static final int DEFAULT_INDENT_AMOUNT = 2; /** * Enable indenting for the supplied {@link javax.xml.transform.Transformer}. <p>If the underlying XSLT engine is * Xalan, then the special output key <code>indent-amount</code> will be also be set to a value of {@link * #DEFAULT_INDENT_AMOUNT} characters. * * @param transformer the target transformer * @see javax.xml.transform.Transformer#setOutputProperty(String, String) * @see javax.xml.transform.OutputKeys#INDENT */ public static void enableIndenting(Transformer transformer) { enableIndenting(transformer, DEFAULT_INDENT_AMOUNT); } /** * Enable indenting for the supplied {@link javax.xml.transform.Transformer}. <p>If the underlying XSLT engine is * Xalan, then the special output key <code>indent-amount</code> will be also be set to a value of {@link * #DEFAULT_INDENT_AMOUNT} characters. * * @param transformer the target transformer * @param indentAmount the size of the indent (2 characters, 3 characters, etc.) * @see javax.xml.transform.Transformer#setOutputProperty(String, String) * @see javax.xml.transform.OutputKeys#INDENT */ public static void enableIndenting(Transformer transformer, int indentAmount) { Assert.notNull(transformer, "Transformer must not be null"); Assert.isTrue(indentAmount > -1, "The indent amount cannot be less than zero : got " + indentAmount); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); try { // Xalan-specific, but this is the most common XSLT engine in any case transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", String.valueOf(indentAmount)); } catch (IllegalArgumentException ignored) { } } /** * Disable indenting for the supplied {@link javax.xml.transform.Transformer}. * * @param transformer the target transformer * @see javax.xml.transform.OutputKeys#INDENT */ public static void disableIndenting(Transformer transformer) { Assert.notNull(transformer, "Transformer must not be null"); transformer.setOutputProperty(OutputKeys.INDENT, "no"); } }
[ "taibi@sonar-scheduler.rd.tut.fi" ]
taibi@sonar-scheduler.rd.tut.fi
2ad4c5c4fd98d3d10cf2396882db3ec4bbd916f3
9b631783a0f96ef9b05ed8320d06cf3ad4075f76
/src/localhost/CancelaCFDI.java
43aff19dc50b66bbb1454ad35c41855444ac52ec
[]
no_license
njmube/adobe
cde61b9676ab999b9a0457f62acd8c202fef8e1c
af4b0cc023ce4a443d54f2f6f4e0407d5eb2d139
refs/heads/master
2022-11-14T18:39:36.007072
2019-09-19T15:46:17
2019-09-19T15:46:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,847
java
package localhost; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * <p>Clase Java para anonymous complex type. * * <p>El siguiente fragmento de esquema especifica el contenido que se espera que haya en esta clase. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="usuarioIntegrador" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="rfcEmisor" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="folioUUID" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "usuarioIntegrador", "rfcEmisor", "folioUUID" }) @XmlRootElement(name = "CancelaCFDI") public class CancelaCFDI { protected String usuarioIntegrador; protected String rfcEmisor; protected String folioUUID; /** * Obtiene el valor de la propiedad usuarioIntegrador. * * @return * possible object is * {@link String } * */ public String getUsuarioIntegrador() { return usuarioIntegrador; } /** * Define el valor de la propiedad usuarioIntegrador. * * @param value * allowed object is * {@link String } * */ public void setUsuarioIntegrador(String value) { this.usuarioIntegrador = value; } /** * Obtiene el valor de la propiedad rfcEmisor. * * @return * possible object is * {@link String } * */ public String getRfcEmisor() { return rfcEmisor; } /** * Define el valor de la propiedad rfcEmisor. * * @param value * allowed object is * {@link String } * */ public void setRfcEmisor(String value) { this.rfcEmisor = value; } /** * Obtiene el valor de la propiedad folioUUID. * * @return * possible object is * {@link String } * */ public String getFolioUUID() { return folioUUID; } /** * Define el valor de la propiedad folioUUID. * * @param value * allowed object is * {@link String } * */ public void setFolioUUID(String value) { this.folioUUID = value; } }
[ "33291536+dangelix@users.noreply.github.com" ]
33291536+dangelix@users.noreply.github.com
2c42b168467df139adc121ebdcc77711f4221eb4
04808b03cf6a4b4d3635a358d78b0653c07954cb
/src/gui/tests/NodesDeploy/dn_installation_option_rewrite_firmware_lin.java
7e2e0b6277c2f24f0fc7dc800f935734408f762e
[]
no_license
avishekdt/gui_automation
920824b3dfe1142c6820129286f3ac6ccc2ef7bf
a90016bb54e5001176ee309f550f9fddb3b743a4
refs/heads/master
2021-01-20T06:12:38.657626
2016-08-11T10:39:58
2016-08-11T10:39:58
89,855,410
0
0
null
null
null
null
UTF-8
Java
false
false
5,283
java
package gui.tests.NodesDeploy; import gui.common.base.BaselineLibrary; import gui.common.base.CommonHpsum; import gui.common.base.Nodes; import gui.common.util.ErrorUtil; import gui.common.util.TestUtil; import org.testng.SkipException; import org.testng.TestException; import org.testng.annotations.Test; // //Assertion: //<Write the purpose of the test case> // public class dn_installation_option_rewrite_firmware_lin extends TestSuiteBase { String test_name = this.getClass().getSimpleName(); String test_result = "PASS"; static boolean manual = false; // Make this false when test is automated. static boolean skip = false; static boolean fail = false; long initialTime; long finalTime; String executionTime = ""; @Test public void test_dn_installation_option_rewrite_firmware() { screenshot_name = test_name; screenshot_counter = 0; try { // // Environment: // printTestStartLine(test_name); // Get the test start time. initialTime = getTimeInMsec(); // Creating email template for the test. if(!testInitialize(test_name)) { printError("Failed to perform test initialize."); } printLogs("Checking Runmode of the test."); if(!TestUtil.isTestCaseRunnable(suite_xl, test_name)) { printLogs("WARNING:: Runmode of the test '" + test_name + "' set to 'N'. So Skipping the test."); skip = true; throw new SkipException("WARNING:: Runmode of the test '" + test_name + "' set to 'N'. So Skipping the test."); } printLogs("RunMode found as Y. Starting the test."); // THIS TEST IS MANUAL RIGHT NOW. RETURN MANUAL NOW. if(manual) { throw new Exception("INFO:: Manual Test"); } // // Setup: /*Before running this test case, run the deployment once so that all the components are at the baseline. * Then we can do rewrite firmware by selecting the installation option. */ // String remoteHostIp_l1 = CONFIG.getProperty("remoteHostIp_l1"); String remoteHostUserName1_l1 = CONFIG.getProperty("remoteHostUserName1_l1"); String remoteHostPassword1_l1 = CONFIG.getProperty("remoteHostPassword1_l1"); String remoteHostDesc_l1 = "Linux"; String remoteHostType_l1 = "NodeType_linux"; String accessLevel = "none"; String remoteHostSuperUserName = null; String remoteHostSuperPasswaord = null; // Find out if it is Win-Lin or Lin-Lin deployment. if (currentOsName.contains("windows")) { printLogs("Trying Win-Win remote deployment."); } else { printLogs("WARNING:: Skipping the test as host OS is " + currentOsName + " and trying to deploy on Windows"); skip = true; test_result = "SKIP"; throw new Exception(); } printLogs("Remote host host IP: " + remoteHostIp_l1); printLogs("Remote host Type: " + remoteHostType_l1); printLogs("UserName: " + remoteHostUserName1_l1 + " Password: " + remoteHostPassword1_l1); // 1. Do test setup if(!CommonHpsum.performTestSetup()) { throw new TestException("Test Failed"); } // 2. Do Baseline inventory if(!BaselineLibrary.performBaselineInventory()) { throw new TestException("Test Failed"); } //3. Add node and select the baseline. if(!Nodes.addNodeLinux(remoteHostIp_l1, remoteHostDesc_l1, true, remoteHostUserName1_l1, remoteHostPassword1_l1 , accessLevel, remoteHostSuperUserName, remoteHostSuperPasswaord)) { throw new TestException("Test Failed"); } // 4. Do Node inventory if(!killRemoteHpsum(remoteHostDesc_l1, remoteHostIp_l1, remoteHostUserName1_l1, remoteHostPassword1_l1)) { printError("Failed to kill hpsum service in dn_installation_option_rewrite_firmware"); } if(!Nodes.performNodeInventory()) { throw new TestException("Test Failed"); } //This the execution point where we need to select the installation option. // Deploy Node in Advanced mode if(!Nodes.deployNodeAdvMode_installation_Options(remoteHostIp_l1, remoteHostType_l1,"Rewrite Firmware")) { throw new TestException("Test Failed"); } // 6. View Logs if(!Nodes.viewLogsAfterDeploy(remoteHostIp_l1, remoteHostType_l1)) { throw new TestException("Test Failed"); } // // Execution:: // // // Verification: Need to add the verification point where it has selected the correct components. // captureScreenShot(); printLogs("DONE."); } catch (Throwable t) { if (skip) { test_result = "SKIP"; } else if (manual) { test_result = "MANUAL"; } else { test_result = "FAIL"; ErrorUtil.addVerificationFailure(t); } } finally { try { // // Cleanup: // printLogs("Test Cleanup:"); // Get current time in ms. finalTime = getTimeInMsec(); // Calculate test time interval. executionTime = calculateTimeInterval(initialTime, finalTime); // Write the final test result in html file. CommonHpsum.testCleanupAndReporting(test_name, test_result, executionTime); TestUtil.reportDataSetResult(suite_xl, "TestCases", TestUtil.getRowNum(suite_xl, test_name), test_result); printTestEndLine(test_name); } catch (Throwable t) { printError("Exception occurred in finally."); } } } }
[ "avishek.datta@hpe.com" ]
avishek.datta@hpe.com
20e9e7efc9b07176d4cd5fa074f12c6ba67f1957
8569b3e8515aa41acf60f43f707cd4cd13ee3d05
/src/models/encoder/encoders/InternalEncoder.java
fb08ad74b346ad8b0a090b0f1765166f782dbf88
[]
no_license
chrispiech/refactoredEncoder
90b7ed9dd76ffe8b68d466e65f0c734acbcbfe1c
aecf007f467ae140fbfe2d131cd2f84716ec39f6
refs/heads/master
2020-05-31T22:14:32.054269
2015-01-30T00:19:04
2015-01-30T00:19:04
26,612,725
0
0
null
null
null
null
UTF-8
Java
false
false
2,924
java
package models.encoder.encoders; import java.util.ArrayList; import java.util.List; import models.encoder.ClusterableMatrix; import models.encoder.EncoderParams; import models.encoder.NeuronLayer; import org.ejml.simple.SimpleMatrix; import util.MatrixUtil; import util.NeuralUtils; public class InternalEncoder implements NeuronLayer { // The parameters for an internal encoder. private List<SimpleMatrix> wList = new ArrayList<SimpleMatrix>(); private SimpleMatrix b; private String id; public InternalEncoder(String id, int arity) { int n = EncoderParams.getCodeVectorSize(); double std = EncoderParams.getInitStd(); for(int i = 0; i < arity; i++) { SimpleMatrix Wi = MatrixUtil.randomMatrix(n, n, std); wList.add(Wi); } b = MatrixUtil.randomVector(n, std); this.id = id; } public InternalEncoder(InternalEncoder toCopy) { wList = new ArrayList<SimpleMatrix>(); for(SimpleMatrix wToCopy : toCopy.wList) { wList.add(new SimpleMatrix(wToCopy)); } b = new SimpleMatrix(toCopy.b); id = toCopy.id; } public InternalEncoder(String id, List<SimpleMatrix> wList, SimpleMatrix b) { this.id = id; this.wList = wList; this.b = b; } public ClusterableMatrix getActivation(SimpleMatrix z) { SimpleMatrix a = NeuralUtils.elementwiseApplyTanh(z); return new ClusterableMatrix(a); } public SimpleMatrix getW(int i) { return wList.get(i); } public SimpleMatrix getB() { return b; } public SimpleMatrix getZ(List<ClusterableMatrix> childAList) { SimpleMatrix z = new SimpleMatrix(b); for(int i = 0; i < getArity(); i++) { SimpleMatrix childA = childAList.get(i).getVector(); SimpleMatrix W = wList.get(i); z = z.plus(W.mult(childA)); } MatrixUtil.validate(z); return z; } public void setParameters(List<SimpleMatrix> wList, SimpleMatrix b) { this.wList = wList; this.b = b; } public void setW(int i, SimpleMatrix W) { this.wList.set(i, W); } public int getArity() { return wList.size(); } public String getType() { return id; } public String getNodeType() { if(id.equals("block")) { return "block"; } if(id.equals("ifElse")) { return "maze_ifElse"; } if(id.equals("while")) { return "maze_forever"; } throw new RuntimeException("not type: " + id); } public boolean equals(Object obj) { InternalEncoder o = (InternalEncoder)obj; if(!id.equals(o.id)) return false; for(int i = 0; i < getArity(); i++) { SimpleMatrix Wa = getW(i); SimpleMatrix Wb = o.getW(i); if(!MatrixUtil.equals(Wa, Wb)) return false; } if(!MatrixUtil.equals(b, o.b)) return false; return true; } @Override public int getDimension() { int n = EncoderParams.getCodeVectorSize(); return getArity() * n * n + n; } public void scale(double d) { for(int i = 0; i < getArity(); i++) { SimpleMatrix W = wList.get(i); W = W.scale(d); wList.set(i, W); } b = b.scale(d); } }
[ "cpiech@stanford.edu" ]
cpiech@stanford.edu
0067b15cd7f6bd7f9a6e20cfae3dc9617b088a22
cc4af268130f2f297f922e2ebae1c767325c6249
/src/com/target11/java8/lymbdaexpression/Demo9_StreamDemo.java
a1fff611183b4d719b87fe6b60875848e94f0fa4
[]
no_license
mandeep4202/Skill-Sharpning
2dc078100c1315e1ff69015ffa8989ebaff9659b
0a4f1cf4435ebf5213fa96037ab2d2c337c38d13
refs/heads/master
2021-03-24T05:03:40.987648
2020-03-15T18:17:24
2020-03-15T18:17:24
247,519,276
0
0
null
null
null
null
UTF-8
Java
false
false
2,267
java
package com.target11.java8.lymbdaexpression; import java.util.ArrayList; import java.util.List; import java.util.stream.Stream; public class Demo9_StreamDemo{ public static void main(String args[]) { // Initialization of Collection List<Order> orderBook = new ArrayList<>(); Order buyGoogle = new Order("GOOG.NS", 300, 900.30, Order.Side.BUY); Order sellGoogle = new Order("GOOG.NS", 600, 890.30, Order.Side.SELL); Order buyApple = new Order("APPL.NS", 400, 552, Order.Side.BUY); Order sellApple = new Order("APPL.NS", 200, 550, Order.Side.SELL); Order buyGS = new Order("GS.NS", 300, 130, Order.Side.BUY); orderBook.add(buyGoogle); orderBook.add(sellGoogle); orderBook.add(buyApple); orderBook.add(sellApple); orderBook.add(buyGS); // Java 8 Streams Example 1 : Filtering Collection elements // Filtering buy and sell order using filter() method of java.util.Stream class Stream<Order> stream = orderBook.stream(); Stream buyOrders = stream.filter((Order o) -> o.side().equals(Order.Side.BUY)); System.out.println("No of Buy Order Placed :" + buyOrders.count()); Stream<Order> sellOrders = orderBook.stream().filter((Order o) -> o.side() == Order.Side.SELL); System.out.println("No of Sell Order Placed : " + sellOrders.count()); // Java 8 Streams Example 2 : Reduce or Fold operation // Calculating total value of all orders double value = orderBook.stream().mapToDouble((Order o) -> o.price()).sum(); System.out.println("Total value of all orders : " + value); long quantity = orderBook.stream().mapToLong((Order o) -> o.quantity()).sum(); System.out.println("Total quantity of all orders : " + quantity); } } class Order { enum Side { BUY, SELL; } private final String symbol; private final int quantity; private double price; private final Side side; public Order(String symbol, int quantity, double price, Side side) { this.symbol = symbol; this.quantity = quantity; this.price = price; this.side = side; } public double price() { return price; } public void price(double price) { this.price = price; } public String symbol() { return symbol; } public int quantity() { return quantity; } public Side side() { return side; } }
[ "mandeep4202@gmail.com" ]
mandeep4202@gmail.com
7bed3357d10905f8f741d53abd1cd5b1fe16fab6
07530af940cbf9150e4018cbf99fd7e168bc598d
/src/sort/methods/Selectionsort.java
da82b641607e963554eb56e0ce6b9b700f928d91
[]
no_license
Gizeland/Laboratorium_IP_Strategia
4710f87335146b18156583656cfd80004df45339
087e3cba559f80c3b7137d9feb5ab8e53f77addd
refs/heads/master
2023-06-05T10:47:54.053961
2021-06-17T11:04:33
2021-06-17T11:04:33
377,719,588
0
0
null
null
null
null
UTF-8
Java
false
false
697
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package sort.methods; /** * * @author LeopardProMK */ public class Selectionsort { private static int tablica[]; private static int ile_liczb; private static void selectionsort(int tablica[], int ile_liczb) { int min,i,j,temp; for (i=0;i<ile_liczb-1;i++) { min=i; for (j=i+1;j<ile_liczb;j++) if (tablica[j]<tablica[min]) min=j; temp=tablica[min]; tablica[min]=tablica[i]; tablica[i]=temp; } } }
[ "dominika.giza@onet.com.pl" ]
dominika.giza@onet.com.pl
6b1f52efca4ad5e2fd372b3609b20aa5c12523f7
bf5ff01bd7f3c7f9f1d56d99be46548797424a42
/SampleProjects/04/SampleCallIntent/app/src/androidTest/java/org/mochakim/samplecallintent/ExampleInstrumentedTest.java
ae0f0505c456d1382042bc20ec30ee197b074cbb
[]
no_license
mocha-kim/Do-it-android
b1feb9f5c597d6539309e2b82da1236872b1c04b
5d261dd44cd90740fb0f5cb8bae46a525843680e
refs/heads/master
2022-12-10T11:03:20.985883
2020-09-10T12:44:27
2020-09-10T12:44:27
281,077,060
0
0
null
null
null
null
UTF-8
Java
false
false
774
java
package org.mochakim.samplecallintent; 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("org.mochakim.samplecallintent", appContext.getPackageName()); } }
[ "jsg2804@gmail.com" ]
jsg2804@gmail.com
d8eaf80185da667a1518b44889de8e906c1b1346
18fcaed613b55f4b05f0209edc2f7820dbe35a09
/java/workspace/class0905/src/ByMyself/信号报告.java
e2d331471b7dff7ee9d7d40bbee683d5b7182243
[]
no_license
lonmiss/TheSeconedNote
cb54a1dac7e33bf305e60cb63240330ff8fb9eb9
72077a6b1f86e4b24332107f4e41c0c9ad4f5e69
refs/heads/master
2020-07-19T12:05:36.566769
2019-11-22T06:02:47
2019-11-22T06:02:47
206,445,263
0
0
null
null
null
null
UTF-8
Java
false
false
711
java
package ByMyself; import java.util.Scanner; public class 信号报告 { public static void main(String[] args) { String[] R={"unreadable","barely readable, occasional words distinguishabl","readable with considerable difficulty","readable with practically no difficulty","perfectly readable"}; String[] S={"Faint signals, barely perceptible","Very weak signals","Weak signals","Fair signals","Fairly good signals","Good signals","Moderately strong signals","Strong signals","Extremely strong signals"}; Scanner in=new Scanner(System.in); int data=in.nextInt(); int r=data/10; int s=data%10; System.out.println(S[s-1]+", "+R[r-1]+"."); } }
[ "1796887546@qq.com" ]
1796887546@qq.com
254e86ee511b86717850493be682e1abb431679b
ae521bf7fb27ea0955d585e12c1c513261f9f47d
/Seance1AA/src/ex5/Doodle.java
9a973f62071cbf5a9f45a19487fb0f1f5933cc4f
[]
no_license
JonasBerx/Algo_2_IPL
b1e727fa3d2b139f631315fc49d3ec7207ffa39f
2889d098ffd563f936c6d9f0b74e4efb7938a5cd
refs/heads/master
2023-03-06T23:17:32.568981
2021-02-18T00:15:43
2021-02-18T00:15:43
336,614,760
0
0
null
null
null
null
ISO-8859-1
Java
false
false
2,147
java
package ex5; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; public class Doodle { public PlageHoraire[] plages; // a compléter public Map<String, boolean[]> available; public Doodle(PlageHoraire... plages) { this.plages = plages; this.available = new HashMap<>(); // a compléter } // ajoute les disponibilités d'un participant sous forme d'un tableau de booleen. // les indices du tableau correspondent aux indices du tableau plages // true à l'indice i veut dire que le participant est disponible pour la plage à l'indice i du tableau plages // false à l'indice i veut dire que le participant n'est pas disponible pour la plage à l'indice i du tableau plages public void ajouterDisponibilites(String participant, boolean[] disponibilites) { if (disponibilites.length != plages.length) throw new IllegalArgumentException(); //a compléter available.put(participant, disponibilites); for (int i = 0; i < disponibilites.length; i++) { int ici = Arrays.asList(plages).get(i).getNbParticipantPresent(); if (disponibilites[i]) { ici += 1; } Arrays.asList(plages).get(i).setNbParticipantPresent(ici); } } // Hypothèse: la PlageHoraire plage en paramètre fait bien partie du tableau plages // renvoie vrai si le participant est disponible pour cette plage horaire // renvoie faux si le participant n'est pas disponible ou s'il n'a pas rempli le // sondage doodle public boolean estDisponible(String participant, PlageHoraire plage) { int index = Arrays.asList(plages).indexOf(plage); return available.get(participant)[index]; } // renvoie une des plages horaires qui a le maximum de participants prévus // cette méthode est appelée après que les participants aient rempli leurs disponibilités public PlageHoraire trouverPlageQuiConvientLeMieux() { int meilleur = 0; int index = 0; // TODO optimise, comparator for (int i = 0; i < plages.length; i++) { if (plages[i].getNbParticipantPresent() > meilleur) { index = i; meilleur = plages[i].getNbParticipantPresent(); } } return plages[index]; } }
[ "jonas.berx1@student.ucll.be" ]
jonas.berx1@student.ucll.be
2d457255ad4d3ddaec8634e515c3609022c9a313
2b057532b5b668757961b91708b13b0150b35ecf
/src/main/java/resource_proxy_demo/service/CRUDApi.java
d55c9df79205622caaac3bc137f601a278dca145
[]
no_license
iamxbg/resource_proxy_demo
29bb6021acf89504a682dd4e497f74aff23f491e
673c26988fd714c0e47cc0b5207648e151dfaa42
refs/heads/master
2020-04-07T23:13:24.933729
2018-11-23T08:33:44
2018-11-23T08:33:44
158,803,374
0
0
null
null
null
null
UTF-8
Java
false
false
246
java
package resource_proxy_demo.service; import java.util.List; public interface CRUDApi <T>{ public void add(T t); public void del(T t); public void update(T t); public List<T> find(T t); public T findById(int id); }
[ "m@m-PC" ]
m@m-PC
14048efef995b93366e16bd120669623a82247b5
7a58a2688596f76b825d179489215dfc2ee00dc8
/app/src/main/java/com/example/dinoyesport/HighScore.java
ef014028792f5084a23ecb19e14c60ff2dcb3dbe
[]
no_license
arcreane/android-app-yesport
cf7e1b734a4a224780b8f52861d9e504f165aa53
694ac63825a84a28ddbfd9da88c24b9690d55ba9
refs/heads/master
2023-06-01T00:46:24.974939
2021-06-24T21:28:02
2021-06-24T21:28:02
369,242,403
0
0
null
null
null
null
UTF-8
Java
false
false
148
java
package com.example.dinoyesport; /** * */ public class HighScore { /** * Default constructor */ public HighScore() { } }
[ "edarouj@hotmail.com" ]
edarouj@hotmail.com
3562ea4f69bcc4d52672318d2c69df173d1173bd
f69d625b31f0c01b2163951c355af2794e6d3a88
/src/test/java/com/nokia/netguard/adapter/test/base/TestTracer.java
d3b5b71a26c94e3dda3b7971babde6950eebe347
[]
no_license
himpan007/Java-AdapterConfig
e6fbd9ef2888d97daf2ddeee5f4dd53c1797f528
91e1875288f208ff154c21bf0497ae3119cd9184
refs/heads/master
2022-12-06T07:25:40.342764
2020-08-25T19:26:34
2020-08-25T19:26:34
289,688,359
0
0
null
null
null
null
UTF-8
Java
false
false
1,402
java
package com.nokia.netguard.adapter.test.base; import org.junit.rules.TestWatcher; import org.junit.runner.Description; import com.nakina.adapter.api.shared.util.Trace; public class TestTracer extends TestWatcher { private NE ne; public TestTracer(NE ne) { this.ne = ne; } @Override protected void starting(Description description) { Trace.info(getClass(), "\n\n" + "/-----\n" + "|\n" + "| TEST START\n" + "| ne "+ne+"\n" + "| class "+description.getClassName()+"\n" + "| test "+description.getMethodName()+"\n" + "|\n" + "\\-----\n"); } @Override protected void succeeded(Description description) { Trace.info(getClass(), "\n\n" + "/-----\n" + "|\n" + "| TEST SUCCESS\n" + "| ne "+ne+"\n" + "| class "+description.getClassName()+"\n" + "| test "+description.getMethodName()+"\n" + "|\n" + "\\-----\n"); } @Override protected void failed(Throwable e, Description description) { String msg = e.getMessage().replaceAll("\n\r|\r\n|\r|\n", "\n| "); Trace.info(getClass(), "\n\n" + "/-----\n" + "|\n" + "| TEST FAILED\n" + "| ne "+ne+"\n" + "| class "+description.getClassName()+"\n" + "| test "+description.getMethodName()+"\n" + "| error "+e.getClass().getCanonicalName()+"\n" + "| message "+msg+"\n" + "|\n" + "\\-----\n"); } }
[ "himanshu.1.pant.ext@nokia.com" ]
himanshu.1.pant.ext@nokia.com
e128f9634fe80849daceddecbc3776147ccd3636
f15357c76bfa5340a52e94d3fea304ad8cdabec8
/mobilesearch/src/test/java/com/jamal/mobilesearch/MobilesearchApplicationTests.java
bed46fea196b3ae7d5a978670de9b2b31beb173e
[]
no_license
sarfarazjamal/ecommerce-mobile
f1b988ec0e0b6d426f4b78c2defde473c7aa06f3
cae7b01cec681bd9b44209de8817b634297203ab
refs/heads/master
2022-12-18T05:01:55.872976
2020-09-28T15:02:14
2020-09-28T15:02:14
299,019,680
0
0
null
null
null
null
UTF-8
Java
false
false
220
java
package com.jamal.mobilesearch; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class MobilesearchApplicationTests { @Test void contextLoads() { } }
[ "jamalsarfaraz@gmail.com" ]
jamalsarfaraz@gmail.com
6f1f148a64f265d04346012e7650f4cad2841f1e
4d4123dd737ebf0b2b8f7abb4a467eb92b247de7
/Nihar_Cls/WHILE_LOOP/WHILE_1.java
dfa9aa4537bbaad76d67864a9818db999a695602
[]
no_license
iamNihar07/SmallJavaSnippets
d101fe3425b9e0ca2520636874dc395cc1d98850
346f36d10c1be4c579798404a1301d37976a9dcf
refs/heads/master
2020-12-19T23:30:17.376924
2020-01-23T20:58:14
2020-01-23T20:58:14
235,883,676
0
0
null
null
null
null
UTF-8
Java
false
false
183
java
package WHILE_LOOP; public class WHILE_1 { void main() { int i=1; while(i>=10) { System.out.println(i); i++; } } }
[ "31829255+iamNihar07@users.noreply.github.com" ]
31829255+iamNihar07@users.noreply.github.com
b0588d8b4aca365ca306b76830d210e20d31340c
b4b325edc79bc88aa472a869ee4eb867c4dd9294
/src/main/java/cn/neyzoter/module/proxy/Fruit.java
f8cc38612df562ec1b45b8a04c5a0567d3b8a221
[ "MIT" ]
permissive
Neyzoter/oj
dd78c5573ceac790bff5624cff1457b9ce1b7c1e
7817a07a3a626a260eb480c62d5d18ba33e8abc2
refs/heads/master
2022-10-20T19:34:36.642450
2021-02-09T12:09:02
2021-02-09T12:09:02
216,972,368
0
2
MIT
2022-10-04T23:58:55
2019-10-23T05:06:56
Java
UTF-8
Java
false
false
212
java
package cn.neyzoter.module.proxy; /** * interface * @author Charles song * @date 2020-5-9 */ public interface Fruit { /** * get fruit name * @return fruit name */ String getName(); }
[ "sonechaochao@gmail.com" ]
sonechaochao@gmail.com
5a5ddd489936633de273a5cb6fc50a8629444907
5215a610c9de7bf2758ffb18909730a9502872de
/src/com/jm/sort/UserPriceAdapter.java
195ee59e16bdc7f1309940f39378136c695f6b03
[]
no_license
githubzoujiayun/faxingwu
6059a74a5352c1379c78373cc504db57cb3ce95a
31a26788863afb200aa7e5ef901871d9b57e6ce7
refs/heads/master
2020-04-05T18:59:03.569793
2014-10-13T19:54:13
2014-10-13T19:54:13
26,966,399
1
0
null
null
null
null
GB18030
Java
false
false
3,996
java
package com.jm.sort; import java.util.ArrayList; import java.util.List; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; import com.jm.entity.User; import com.jm.fxw.R; import com.nostra13.universalimageloader.core.ImageLoader; public class UserPriceAdapter extends BaseAdapter implements OnClickListener { private LayoutInflater inflater; private List<User> mlist; private Context context; private int position; private Button btn; private int discount = 1; private boolean isProgress = false; public UserPriceAdapter(Context context) { inflater = LayoutInflater.from(context); mlist = new ArrayList<User>(); this.context = context; } public boolean isProgress() { return isProgress; } public void setProgress(boolean isProgress) { this.isProgress = isProgress; } /** * 添加数据列表 * * @param goods */ public void addMoreData(User type) { mlist.add(type); } public void setTypeList(List<User> list) { if (list == null) { return; } mlist = list; } public void setPriceList(int i) { discount = i; try { for (User u : mlist) { if (i == 2) { double p = (Double .parseDouble(u.getPrice_info().split("_")[1]) * Double .parseDouble(u.getPrice_info().split("_")[5])) / 10; u.setPrice("¥" + (int) p + "(" + u.getPrice_info().split("_")[4] + "折)"); } else if (i == 3) { double p = (Double .parseDouble(u.getPrice_info().split("_")[2]) * Double .parseDouble(u.getPrice_info().split("_")[6])) / 10; u.setPrice("¥" + (int) p + "(" + u.getPrice_info().split("_")[4] + "折)"); } else if (i == 4) { double p = (Double .parseDouble(u.getPrice_info().split("_")[3]) * Double .parseDouble(u.getPrice_info().split("_")[7])) / 10; u.setPrice("¥" + (int) p + "(" + u.getPrice_info().split("_")[4] + "折)"); } else { { double p = (Double.parseDouble(u.getPrice_info().split( "_")[0]) * Double.parseDouble(u.getPrice_info() .split("_")[4])) / 10; u.setPrice("¥" + (int) p + "(" + u.getPrice_info().split("_")[4] + "折)"); } } } } catch (Exception e) { // TODO: handle exception } } @Override public int getCount() { return mlist.size(); } public List<User> getUserList() { return mlist; } public void appendUserList(List<User> list) { if (list == null) { return; } if (mlist == null) { mlist = new ArrayList<User>(); } mlist.addAll(list); } @Override public Object getItem(int position) { return mlist.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { View view; this.position = position; User type = mlist.get(position); if (isProgress) { view = inflater.inflate(R.layout.progress_footer, null); return view; } else { if (convertView != null && convertView instanceof UserItem) { view = convertView; } else { view = inflater.inflate(R.layout.price_list, null); } setPriceList(discount); ImageLoader.getInstance().displayImage(type.getHead_photo(), (ImageView) view.findViewById(R.id.iv_pic)); ((TextView) view.findViewById(R.id.tv_1_1)).setText(type .getUsername()); ((TextView) view.findViewById(R.id.tv_2_1)).setText(type .getStore_name()); ((TextView) view.findViewById(R.id.tv_3_1)).setText(type .getStore_address()); ((TextView) view.findViewById(R.id.tv_3_2)) .setText(type.getPrice()); return view; } } public void clear() { if (mlist != null) { mlist.clear(); notifyDataSetChanged(); } } @Override public void onClick(View v) { } }
[ "233061987@qq.com" ]
233061987@qq.com
81f95c21b3e406e6d49c1dd4b5c1c7f23a20ea42
9254e7279570ac8ef687c416a79bb472146e9b35
/sofa-20190815/src/main/java/com/aliyun/sofa20190815/models/QueryLinkeBahamutIterationaddunitResponse.java
b3738cb31a31949e95eb330e4908c860005fab90
[ "Apache-2.0" ]
permissive
lquterqtd/alibabacloud-java-sdk
3eaa17276dd28004dae6f87e763e13eb90c30032
3e5dca8c36398469e10cdaaa34c314ae0bb640b4
refs/heads/master
2023-08-12T13:56:26.379027
2021-10-19T07:22:15
2021-10-19T07:22:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,224
java
// This file is auto-generated, don't edit it. Thanks. package com.aliyun.sofa20190815.models; import com.aliyun.tea.*; public class QueryLinkeBahamutIterationaddunitResponse extends TeaModel { @NameInMap("headers") @Validation(required = true) public java.util.Map<String, String> headers; @NameInMap("body") @Validation(required = true) public QueryLinkeBahamutIterationaddunitResponseBody body; public static QueryLinkeBahamutIterationaddunitResponse build(java.util.Map<String, ?> map) throws Exception { QueryLinkeBahamutIterationaddunitResponse self = new QueryLinkeBahamutIterationaddunitResponse(); return TeaModel.build(map, self); } public QueryLinkeBahamutIterationaddunitResponse setHeaders(java.util.Map<String, String> headers) { this.headers = headers; return this; } public java.util.Map<String, String> getHeaders() { return this.headers; } public QueryLinkeBahamutIterationaddunitResponse setBody(QueryLinkeBahamutIterationaddunitResponseBody body) { this.body = body; return this; } public QueryLinkeBahamutIterationaddunitResponseBody getBody() { return this.body; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
7684f500f1c4a7bbf8ea68a27dcdff74279d8223
2366c58a85cd87b636dcc099cf20b1a9ce9a3a7f
/src/tech/jiangchen/multiThread/swapPrint/Kaola.java
af52cb95aac1de90166c702d0501fe970f90f6b0
[]
no_license
Jlif/newcoder-algs
7fc3d10e4d02ab724114447744fda1a4711318b8
d82b83c1eb222996d0fb25eb8b05f5860c4f0756
refs/heads/main
2023-06-24T20:41:04.357158
2021-07-26T16:39:19
2021-07-26T16:39:31
329,533,660
0
0
null
null
null
null
UTF-8
Java
false
false
1,236
java
package tech.jiangchen.multiThread.swapPrint; /** * 两个不同的线程将会共用一个Kaola实例,其中一个线程将会调用kao()方法,另一个线程将会调用la()方法。 * 请修改以下的类,确保 "kaola" 被输出 n 次。 * * @author jiangchen * @date 2021/7/26 */ public class Kaola { private int n; private boolean flag = false; private Kaola kaola; public Kaola(int n) { this.n = n; } public void setFlag(boolean flag) { this.flag = flag; } public void kao(Runnable printKao) throws InterruptedException { for (int i = 0; i < n; i++) { synchronized (kaola) { while (!kaola.flag) { kaola.wait(); } } printKao.run(); kaola.setFlag(false); kaola.notifyAll(); } } public void la(Runnable printLa) throws InterruptedException { for (int i = 0; i < n; i++) { synchronized (kaola) { while (kaola.flag) { kaola.wait(); } } printLa.run(); kaola.setFlag(true); kaola.notifyAll(); } } }
[ "jiangchen23@qq.com" ]
jiangchen23@qq.com
ed3f9dc58807099011a559547295c60e778a68df
41fdf9d9623a4ac496cc0f2e506469a2b44c0721
/src/google/codejam/no6234486/MainC.java
68e5574b58ce60d40277a905707199efb36597e8
[]
no_license
COFFEE-ZJU/OnlineJudge
67ac39f074c73a4320b1c944331611035d43e807
61d0760e788e002b03573d564259e2ed0f4be3c8
refs/heads/master
2020-05-21T20:23:58.465379
2016-10-21T15:24:05
2016-10-21T15:24:05
65,429,689
0
0
null
null
null
null
UTF-8
Java
false
false
1,098
java
package google.codejam.no6234486; import google.codejam.CodejamUtils; import java.io.IOException; import java.io.Writer; import java.util.Scanner; /** * Created by zkf on 3/24/16. */ public class MainC { public static final String fileName = "C-small-practice-2"; public static void main(String[] args) throws IOException { Scanner scanner = CodejamUtils.getScanner(fileName, MainC.class); Writer writer = CodejamUtils.getWriter(fileName, MainC.class); int r = scanner.nextInt(); for(int rr=0; rr<r; rr++){ int n = scanner.nextInt(); scanner.nextLine(); String[] names = new String[n]; for (int i = 0; i < n; i++) { names[i] = scanner.nextLine(); } String max = names[0]; int cost = 0; for (int i = 1; i < names.length; i++) { int res = max.compareTo(names[i]); if (res == 0) continue; if (res > 0) cost++; else max = names[i]; } writer.write(format(rr, cost)); } writer.close(); scanner.close(); } private static String format(int caseNo, int d){ return String.format("Case #%d: %d\n", caseNo+1, d); } }
[ "zhangkf92@gmail.com" ]
zhangkf92@gmail.com
51cbe8bf6bd74acff7110d3fc96775ef6b75e358
e59a44c827390c415951091cf5665bc6ff56cf77
/app/src/main/java/com/example/tapiwa/collegebuddy/Main/Tasks/Task.java
b892f26f91e16ed78a5abab8c537ef57310e2331
[]
no_license
Tapszvidzwa/Collabo
7af3b6fd2a5850ad77f9357c49e28694281d467c
ab2929cc483b33907fa948318bb03b4c81d0a87d
refs/heads/master
2021-01-23T03:59:37.073672
2018-03-29T15:56:09
2018-03-29T15:56:09
89,055,020
2
1
null
null
null
null
UTF-8
Java
false
false
581
java
package com.example.tapiwa.collegebuddy.Main.Tasks; /** * Created by tapiwa on 10/21/17. */ public class Task { private String task; private String status; public Task() { } public Task(String task, String status) { this.task = task; this.status = status; } public String getTask() { return task; } public void setTask(String task) { this.task = task; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } }
[ "zvidzwat@grinnell.edu" ]
zvidzwat@grinnell.edu
f8c944e98349c2cc599a3370233997f15336b084
15213a461caaa43ba07bf206d6dd474cf3f6c52e
/jimovel-web/src/br/com/igordev/servlet/HelloServlet.java
e101c4906691ff025e97f2a3acc6f3ee8d8a3b7b
[]
no_license
tlima1011/Imoveis-web
9c6ed6516d0fbd09d90102c8f5ad0749c866c442
59e3c76bad5d77fb112b92f5a0ea06c9e1f73cc7
refs/heads/master
2020-05-02T15:28:10.698672
2019-03-27T17:20:44
2019-03-27T17:20:44
178,041,773
0
0
null
null
null
null
UTF-8
Java
false
false
674
java
package br.com.igordev.servlet; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class HelloServlet extends HttpServlet{ @Override protected void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { PrintWriter out = res.getWriter(); out.println("<html>"); out.println("<body>"); out.println("<h1><i>Hello Servlet!</i></h1>"); out.println("</body>"); out.println("</html>"); } //fim service }
[ "noreply@github.com" ]
noreply@github.com
cfb3861a8d0de5a107cfc71cd39f4277e3078e27
e1d3559593cbbb5b8cb067157059ddd271ae191c
/common/src/main/java/gnnt/mebs/common/RouteMap.java
996d71bb33572da306cc5dff5eb8129f16abb025
[]
no_license
armysman/MVVMFramework
ef8db397cbdd6b5f58c9ad782b530cd90f732a21
b0bff8f8089bf460ee38dcf0a3ce7b1f426fedf1
refs/heads/master
2020-05-14T14:21:45.126519
2019-07-23T05:40:14
2019-07-23T05:40:14
181,831,179
1
0
null
2019-04-17T06:32:48
2019-04-17T06:32:47
null
UTF-8
Java
false
false
1,315
java
package gnnt.mebs.common; /******************************************************************* * RouteMap.java 2018/12/13 * <P> * 路由表<br/> * <br/> * </p> * * @author:zhoupeng * ******************************************************************/ public interface RouteMap { interface SimpleDemo { /** * 数据加载演示 */ String LOAD_DATA_PAGE = "/simple/LoadDataPage"; /** * 数据绑定演示 */ String DATA_BINDING_PAGE = "/simple/DataBindingPage"; /** * 文件缓存演示 */ String FILE_REPOSITORY_PAGE = "/simple/FileRepositoryPage"; /** * Room数据缓存页 */ String ROOM_REPOSITORY_PAGE = "/simple/RoomRepositoryPage"; /** * 分页演示 */ String PAGE_PAGE = "/simple/PagePage"; /** * 全局事件监听 */ String GLOBAL_EVENT_PAGE = "/simple/GlobalEventPage"; /** * 登录 */ String LOGIN_PAGE = "/simple/LoginPage"; /** * 注册 */ String REGISTER_PAGE = "/simple/RegisterPage"; /** * 动态传参 */ String DYNAMIC_PARAMS_PAGE = "/simple/DynamicPage"; } }
[ "472250569@qq.com" ]
472250569@qq.com
03d853d46e4fb42826ba30c7c9d9b9d95d2a2749
11d621322c36602ddd6e2aad164c54fc2c12d602
/workFaceSurvey/src/com/web/entity/Search_record.java
eaa8f0d5ef1c80a37c6b859fd45cee190cacadda
[]
no_license
mr-pajamas/wf-questionnaire
781beca30bbc57da2b043f5ab37d5e4358bca5e8
cbfa9c4fb6f7900e074341dcb8ccc6550e7ad094
refs/heads/master
2021-03-12T20:00:54.667374
2015-08-15T06:16:05
2015-08-15T06:16:05
39,540,727
0
1
null
null
null
null
UTF-8
Java
false
false
5,014
java
package com.web.entity; import java.util.Date; import javax.persistence.Basic; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name = "search_record") public class Search_record{ @Id @Basic(optional = false) @Column(name = "id") @GeneratedValue(strategy = GenerationType.IDENTITY) private int id; @Column(name ="userid") private int userid; @Column(name ="cityid") private String cityid; @Column(name ="date") private String date; @Column(name ="mileage") private String mileage; @Column(name ="color") private String color; @Column(name ="uesd") private String uesd; @Column(name ="dueday") private String dueday; @Column(name ="fee") private String fee; @Column(name ="outside") private String outside; @Column(name ="inside") private String inside; @Column(name ="engine") private String engine; @Column(name ="eletircequip") private String eletircequip; @Column(name ="ohter") private String ohter; @Column(name ="chassis") private String chassis; @Column(name ="createtime") private Date createtime; @Column(name ="modifytime") private Date modifytime; @Column(name ="vehicleid") private int vehicleid; @Column(name ="vehiclename") private String vehiclename; @Column(name ="price1") private String price1; @Column(name ="price2") private String price2; @Column(name ="price3") private String price3; @Column(name ="maintain") private String maintain; @Column(name ="carcondition") private String carcondition; @Column(name ="price4") private String price4; @Column(name ="familyid") private String familyid; public String getFamilyid() { return familyid; } public void setFamilyid(String familyid) { this.familyid = familyid; } public String getMaintain() { return maintain; } public void setMaintain(String maintain) { this.maintain = maintain; } public String getCarcondition() { return carcondition; } public void setCarcondition(String carcondition) { this.carcondition = carcondition; } public void setId(int id){ this.id=id; } public int getId(){ return this.id; } public void setUserid(int userid){ this.userid=userid; } public int getUserid(){ return this.userid; } public void setCityid(String cityid){ this.cityid=cityid; } public String getCityid(){ return this.cityid; } public void setDate(String date){ this.date=date; } public String getDate(){ return this.date; } public void setMileage(String mileage){ this.mileage=mileage; } public String getMileage(){ return this.mileage; } public void setColor(String color){ this.color=color; } public String getColor(){ return this.color; } public void setUesd(String uesd){ this.uesd=uesd; } public String getUesd(){ return this.uesd; } public void setDueday(String dueday){ this.dueday=dueday; } public String getDueday(){ return this.dueday; } public void setFee(String fee){ this.fee=fee; } public String getFee(){ return this.fee; } public void setOutside(String outside){ this.outside=outside; } public String getOutside(){ return this.outside; } public void setInside(String inside){ this.inside=inside; } public String getInside(){ return this.inside; } public void setEngine(String engine){ this.engine=engine; } public String getEngine(){ return this.engine; } public void setEletircequip(String eletircequip){ this.eletircequip=eletircequip; } public String getEletircequip(){ return this.eletircequip; } public void setOhter(String ohter){ this.ohter=ohter; } public String getOhter(){ return this.ohter; } public void setChassis(String chassis){ this.chassis=chassis; } public String getChassis(){ return this.chassis; } public void setCreatetime(Date createtime){ this.createtime=createtime; } public Date getCreatetime(){ return this.createtime; } public void setModifytime(Date modifytime){ this.modifytime=modifytime; } public Date getModifytime(){ return this.modifytime; } public void setVehicleid(int vehicleid){ this.vehicleid=vehicleid; } public int getVehicleid(){ return this.vehicleid; } public void setVehiclename(String vehiclename){ this.vehiclename=vehiclename; } public String getVehiclename(){ return this.vehiclename; } public void setPrice1(String price1){ this.price1=price1; } public String getPrice1(){ return this.price1; } public void setPrice2(String price2){ this.price2=price2; } public String getPrice2(){ return this.price2; } public void setPrice3(String price3){ this.price3=price3; } public String getPrice3(){ return this.price3; } public String getPrice4() { return price4; } public void setPrice4(String price4) { this.price4 = price4; } }
[ "735181886@qq.com" ]
735181886@qq.com
af5dffeb72b589cee9e99197c10df7dfdf5a3faa
f85e75d3c26465a2d58d2d5fb9d1716557107be7
/app/src/main/java/com/surampaksakosoy/ydig/handlers/ServerHandler.java
b3c1c89bde9478de611e4616433094fbb541470a
[]
no_license
zolandhole/YDIG2
0531291d90898fd99f5981fd293c27ad89136625
362234304ceef46b547b765f09eaaa4a521f761b
refs/heads/master
2020-05-22T00:35:11.821106
2019-07-20T10:09:04
2019-07-20T10:09:04
186,174,897
0
0
null
null
null
null
UTF-8
Java
false
false
3,792
java
package com.surampaksakosoy.ydig.handlers; import android.content.Context; import android.util.Log; import com.android.volley.Request; import com.android.volley.RequestQueue; import com.android.volley.Response; import com.android.volley.VolleyError; import com.android.volley.toolbox.StringRequest; import com.android.volley.toolbox.Volley; import com.surampaksakosoy.ydig.LoginActivity; import com.surampaksakosoy.ydig.MainActivity; import com.surampaksakosoy.ydig.utils.PublicAddress; import org.json.JSONException; import org.json.JSONObject; import java.util.HashMap; import java.util.List; import java.util.Map; public class ServerHandler { private static final String TAG = "ServerHandler"; private Context context; private String aktifitas; public ServerHandler(Context context, String aktifitas){ this.context = context; this.aktifitas = aktifitas; } public void sendData(final List<String> list){ StringRequest stringRequest = new StringRequest(Request.Method.POST, alamatServer(), new Response.Listener<String>() { @Override public void onResponse(String response) { responseFromServer(response); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { Log.e(TAG, "onErrorResponse: " + error); } }){ @Override protected Map<String, String> getParams(){ Map<String, String> params = new HashMap<>(); params.put("params", String.valueOf(list)); return params; } }; RequestQueue requestQueue = Volley.newRequestQueue(context); requestQueue.add(stringRequest); } private void responseFromServer(String response) { try { JSONObject jsonObject = new JSONObject(response); if (jsonObject.optString("error").equals("true")){ responseFailed(jsonObject); Log.e(TAG, "responseFromServer: " + jsonObject.getString("pesan") ); } else { responseSuccess(jsonObject); } } catch (JSONException e) { Log.e(TAG, "responseFromServer: "+ e); e.printStackTrace(); } } private void responseFailed(JSONObject jsonObject) { if ("GET_HOME_DATA".equals(aktifitas)){ try { String pesan = jsonObject.getString("pesan"); MainActivity mainActivity = (MainActivity) context; // mainActivity.responseGetHomeDataFailed(pesan); } catch (JSONException e) { e.printStackTrace(); } } } private void responseSuccess(JSONObject jsonObject) { if ("LOGIN_DATA".equals(aktifitas)) { LoginActivity loginActivity = (LoginActivity) context; loginActivity.keMainActivity(); } else { try { Log.e(TAG, "responseSuccess: " + jsonObject.getString("pesan")); } catch (JSONException e) { Log.e(TAG, "responseSuccess: " + e); e.printStackTrace(); } } } private String alamatServer() { String URL = ""; switch (aktifitas){ case "LOGIN_DATA": URL = PublicAddress.POST_LOGIN; break; case "MAIN_LOGOUT": URL = PublicAddress.POST_LOGOUT; break; case "MAIN_SAVE_PHOTO": URL = PublicAddress.POST_SAVE_PHOTO; break; case "GET_HOME_DATA": URL = PublicAddress.GET_HOME_DATA; break; } return URL; } }
[ "zolandhole@gmail.com" ]
zolandhole@gmail.com
03668608042ec2f8656761222a9661d1d4244567
c703cc3c41b52a4d03d734c06cc4ba2b2dd76a63
/leyou-auth/leyou-auth-service/src/main/java/com/leyou/auth/controller/AuthController.java
f98de0716335e8a81c4fa6be15ab722d9cee91a8
[]
no_license
wuheshidao1/LeyouShopping
e7971e0a13c5c1364457ea1c53f6fee1138162dd
64305219b302919b6c4164569ed3a845823e9cc7
refs/heads/main
2023-06-19T09:31:18.307984
2021-07-19T03:31:17
2021-07-19T03:31:17
387,205,452
0
0
null
null
null
null
UTF-8
Java
false
false
3,119
java
package com.leyou.auth.controller; import com.leyou.auth.config.JwtProperties; import com.leyou.auth.service.AuthService; import com.leyou.common.pojo.UserInfo; import com.leyou.common.utils.CookieUtils; import com.leyou.common.utils.JwtUtils; import com.netflix.client.http.HttpResponse; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.http.HttpRequest; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @Controller @EnableConfigurationProperties(JwtProperties.class) public class AuthController { @Autowired private AuthService authService; @Autowired private JwtProperties jwtProperties; @PostMapping("/accredit") public ResponseEntity<Void> accredit( @RequestParam("username")String username, @RequestParam("password")String password, HttpServletRequest request, HttpServletResponse response){//request和reponse都是可以直接设置的,并直接使用的 //将token设置为cookie String token = authService.accredit(username,password); if (StringUtils.isBlank(token)){ return ResponseEntity.status(HttpStatus.UNAUTHORIZED).build();//401 } //通过common模块里面的CookieUtils来设置cookie CookieUtils.setCookie(request,response,jwtProperties.getCookieName(),token,this.jwtProperties.getExpire()*60); return ResponseEntity.ok(null); } /** * 通过前台的cookie信息,来通过jwtProperties的公钥进行解密。获得userInfo,在用其封装页面登录信息 * @param token * @return */ @GetMapping("/verify") public ResponseEntity<UserInfo> verify( @CookieValue("LY_TOKEN")String token, HttpServletRequest request, HttpServletResponse response){ try { UserInfo userInfo = JwtUtils.getInfoFromToken(token,jwtProperties.getPublicKey()); if (userInfo==null){ return ResponseEntity.status(HttpStatus.UNAUTHORIZED).build(); } //新生成一个token JwtUtils.generateToken(userInfo,jwtProperties.getPrivateKey(),jwtProperties.getExpire()); //重新设置一个cookie CookieUtils.setCookie(request,response,jwtProperties.getCookieName(),token,jwtProperties.getExpire()*60); return ResponseEntity.ok(userInfo); } catch (Exception e) { e.printStackTrace(); } return ResponseEntity.status(HttpStatus.UNAUTHORIZED).build(); } }
[ "78697748+wuheshidao1@users.noreply.github.com" ]
78697748+wuheshidao1@users.noreply.github.com
7ebef1e0a8dd9b2a98e23af7904afb7a90c9bd5e
1729ee7557eb2b4fbf6529265e28f117653569da
/src/main/java/com/worldgdp/client/api/CountryLanguageAPIController.java
c2ef6a8f432c48d3a22226a8eaa283fef1d2fe92
[]
no_license
tboydv1/WorldCoutriesGDP_project
6b56fbbb3a7601c74a13d18160832c032e9e58f3
41eff751fea4236fb03fdc86b278e34a77b65b7b
refs/heads/master
2021-08-22T16:40:12.456663
2021-07-19T00:24:31
2021-07-19T00:24:31
241,243,169
0
0
null
null
null
null
UTF-8
Java
false
false
2,949
java
package com.worldgdp.client.api; import com.worldgdp.models.CountryLanguage; import com.worldgdp.repository.CountryLanguageRepository; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; @RestController @RequestMapping("worldgdp/api/languages") @Slf4j public class CountryLanguageAPIController { @Autowired CountryLanguageRepository cLanguageDao; private static int PAGE_SIZE = 20; @GetMapping("/{countryCode}") public ResponseEntity<?> getLanguages(@PathVariable String countryCode, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo){ try { Pageable pageable = PageRequest.of(pageNo - 1, PAGE_SIZE); return ResponseEntity.ok(cLanguageDao.findByCountrycode(countryCode, pageable)); }catch(Exception ex) { System.out.println("Error while getting languages for country: {}"+ countryCode+ ex); return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) .body("Error while languages cities"); } } // @PostMapping("/{countryCode}") // public ResponseEntity<?> addLanguage(@PathVariable String countryCode, // @Valid @RequestBody CountryLanguage language){ // try { // if ( cLanguageDao.(countryCode, language.getLanguage())) { // return ResponseEntity.badRequest() // .body("Language already exists for country"); // } // cLanguageDao.save(language); // return ResponseEntity.ok(language); // }catch(Exception ex) { // System.out.println("Error while adding language: {} to country: {}"+ // language+ countryCode+ ex); // return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) // .body("Error while adding language"); // } // } @DeleteMapping("/{countryCode}/language/{language}") public ResponseEntity<?> deleteLanguage(@PathVariable String countryCode, @PathVariable String language){ // try { // // // cLanguageDao.delete(countryCode, language);; // return ResponseEntity.ok().build(); // }catch(Exception ex) { // System.out.println("Error occurred while deleting language : {}, for country: {}"+ // language+ countryCode+ ex); // return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) // .body("Error occurred while deleting the language"); // } return null; } }
[ "tboydv1@gmail.com" ]
tboydv1@gmail.com
142020eddf181dde0fb2d85d8a917b3ad7389d4c
98a8957cf82df80acdf7694785063421e9a8d720
/twitter/src/main/java/com/bhtwitter/twitter/exception/RestExceptionHandler.java
4bfadcf6142f014b610cb7a18f714071e061d3b4
[]
no_license
ojasva22/Twitter
10f8a9e4dbfd803e9379232d003b413d193e4437
e5139cb52b93334073353568945dcd5b60f0f53b
refs/heads/master
2022-09-09T22:04:58.933981
2020-06-01T14:16:52
2020-06-01T14:16:52
266,166,255
0
0
null
null
null
null
UTF-8
Java
false
false
4,975
java
package com.bhtwitter.twitter.exception; import java.time.LocalDateTime; import javax.validation.ConstraintViolationException; import org.springframework.dao.DataIntegrityViolationException; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.MethodArgumentNotValidException; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.context.request.WebRequest; import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler; @ControllerAdvice public class RestExceptionHandler extends ResponseEntityExceptionHandler{ /* @ExceptionHandler public ResponseEntity<ErrorResponse> handleException(Exception exc) { ErrorResponse error = new ErrorResponse(HttpStatus.BAD_REQUEST.value(), exc.getMessage(), LocalDateTime.now()); return new ResponseEntity<>(error, HttpStatus.BAD_REQUEST); }*/ @ExceptionHandler public ResponseEntity<ErrorResponse> userAlreadyExists(AlreadyExists exc){ ErrorResponse error = new ErrorResponse(); error.setStatus(HttpStatus.BAD_REQUEST.value()); error.setMessage(exc.getMessage()); error.setTimestamp(LocalDateTime.now()); return new ResponseEntity<>(error, HttpStatus.BAD_REQUEST); } @Override protected ResponseEntity<Object> handleMethodArgumentNotValid(MethodArgumentNotValidException ex, HttpHeaders headers, HttpStatus status, WebRequest request) { ErrorResponse error = new ErrorResponse(); error.setMessage(ex.getBindingResult().getFieldError().getDefaultMessage()); error.setStatus(HttpStatus.BAD_REQUEST.value()); error.setTimestamp(LocalDateTime.now()); return new ResponseEntity<>(error, HttpStatus.BAD_REQUEST); } @ExceptionHandler(UserNotFoundException.class) public ResponseEntity<Object> handleException(UserNotFoundException exc){ ErrorResponse error = new ErrorResponse(); error.setMessage(exc.getMessage()); error.setTimestamp(LocalDateTime.now()); error.setStatus(HttpStatus.BAD_REQUEST.value()); return new ResponseEntity<>(error, HttpStatus.BAD_REQUEST); } @ExceptionHandler(TweetNotFoundException.class) public ResponseEntity<ErrorResponse> handleException(TweetNotFoundException exc){ ErrorResponse error = new ErrorResponse(); error.setStatus(HttpStatus.BAD_REQUEST.value()); error.setMessage("Tweet not found "); error.setTimestamp(LocalDateTime.now()); return new ResponseEntity<>(error, HttpStatus.BAD_REQUEST); } @ExceptionHandler(DataIntegrityViolationException.class) public ResponseEntity<Object> handleException(DataIntegrityViolationException exc){ ErrorResponse error = new ErrorResponse(); error.setStatus(HttpStatus.CONFLICT.value()); error.setMessage(exc.getLocalizedMessage()); error.setTimestamp(LocalDateTime.now()); return new ResponseEntity<>(error, HttpStatus.CONFLICT); } @ExceptionHandler(ConstraintViolationException.class) public ResponseEntity<Object> handleException(ConstraintViolationException exc){ ErrorResponse error = new ErrorResponse(); error.setStatus(HttpStatus.BAD_REQUEST.value()); error.setMessage(exc.getConstraintViolations().iterator().next().getMessage()); error.setTimestamp(LocalDateTime.now()); return new ResponseEntity<>(error, HttpStatus.BAD_REQUEST); } @ExceptionHandler(FollowerException.class) public ResponseEntity<Object> handleException(FollowerException exc){ ErrorResponse error = new ErrorResponse(); error.setStatus(HttpStatus.BAD_REQUEST.value()); error.setMessage(exc.getMessage()); error.setTimestamp(LocalDateTime.now()); return new ResponseEntity<>(error, HttpStatus.BAD_REQUEST); } @ExceptionHandler(UniqueException.class) public ResponseEntity<Object> handleException(UniqueException exc){ ErrorResponse error = new ErrorResponse(); error.setStatus(HttpStatus.BAD_REQUEST.value()); error.setMessage(exc.getMessage()); error.setTimestamp(LocalDateTime.now()); return new ResponseEntity<>(error, HttpStatus.BAD_REQUEST); } @ExceptionHandler(LengthException.class) public ResponseEntity<Object> handleException(LengthException exc){ ErrorResponse error = new ErrorResponse(); error.setStatus(HttpStatus.BAD_REQUEST.value()); error.setMessage(exc.getMessage()); error.setTimestamp(LocalDateTime.now()); return new ResponseEntity<>(error, HttpStatus.BAD_REQUEST); } @ExceptionHandler(NotSensitiveException.class) public ResponseEntity<Object> handleException(NotSensitiveException exc){ ErrorResponse error = new ErrorResponse(); error.setStatus(HttpStatus.BAD_REQUEST.value()); error.setMessage(exc.getMessage()); error.setTimestamp(LocalDateTime.now()); return new ResponseEntity<>(error, HttpStatus.BAD_REQUEST); } }
[ "ojasva22@gmail.com" ]
ojasva22@gmail.com
ae776eb770037cf6fbf7502cd771448e54b3b735
c24e883bba5235840239de3bd5640d92e0c8db66
/product/src/main/java/com/smart/website/product/PmsProductEntity.java
5cd08ac60bd1eddb579e22b14ec09fa24a44a392
[]
no_license
hotHeart48156/mallwebsite
12fe2f7d4e108ceabe89b82eacca75898d479357
ba865c7ea22955009e2de7b688038ddd8bc9febf
refs/heads/master
2022-11-23T23:22:28.967449
2020-01-07T15:27:27
2020-01-07T15:27:27
231,905,626
0
0
null
2022-11-15T23:54:56
2020-01-05T11:14:43
Java
UTF-8
Java
false
false
26,031
java
package com.smart.website.product; import javax.persistence.*; import java.math.BigDecimal; import java.sql.Timestamp; @Entity @Table(name = "pms_product", schema = "product1", catalog = "") public class PmsProductEntity { private long id; private Long brandId; private Long productCategoryId; private Long feightTemplateId; private Long productAttributeCategoryId; private String name; private String pic; private String productSn; private Integer deleteStatus; private Integer publishStatus; private Integer newStatus; private Integer recommandStatus; private Integer verifyStatus; private Integer sort; private Integer sale; private BigDecimal price; private BigDecimal promotionPrice; private Integer giftGrowth; private Integer giftPoint; private Integer usePointLimit; private String subTitle; private String description; private BigDecimal originalPrice; private Integer stock; private Integer lowStock; private String unit; private BigDecimal weight; private Integer previewStatus; private String serviceIds; private String keywords; private String note; private String albumPics; private String detailTitle; private String detailDesc; private String detailHtml; private String detailMobileHtml; private Timestamp promotionStartTime; private Timestamp promotionEndTime; private Integer promotionPerLimit; private Integer promotionType; private String brandName; private String productCategoryName; private Long supplyId; private Timestamp createTime; private Long schoolId; private Integer storeId; private Long memberId; private Integer hit; private Integer type; private Long areaId; private String areaName; private String schoolName; private int transfee; private Integer isPaimai; private Timestamp expireTime; private String storeName; @Id @Column(name = "id", nullable = false) public long getId() { return id; } public void setId(long id) { this.id = id; } @Basic @Column(name = "brand_id", nullable = true) public Long getBrandId() { return brandId; } public void setBrandId(Long brandId) { this.brandId = brandId; } @Basic @Column(name = "product_category_id", nullable = true) public Long getProductCategoryId() { return productCategoryId; } public void setProductCategoryId(Long productCategoryId) { this.productCategoryId = productCategoryId; } @Basic @Column(name = "feight_template_id", nullable = true) public Long getFeightTemplateId() { return feightTemplateId; } public void setFeightTemplateId(Long feightTemplateId) { this.feightTemplateId = feightTemplateId; } @Basic @Column(name = "product_attribute_category_id", nullable = true) public Long getProductAttributeCategoryId() { return productAttributeCategoryId; } public void setProductAttributeCategoryId(Long productAttributeCategoryId) { this.productAttributeCategoryId = productAttributeCategoryId; } @Basic @Column(name = "name", nullable = true, length = 200) public String getName() { return name; } public void setName(String name) { this.name = name; } @Basic @Column(name = "pic", nullable = true, length = 255) public String getPic() { return pic; } public void setPic(String pic) { this.pic = pic; } @Basic @Column(name = "product_sn", nullable = true, length = 64) public String getProductSn() { return productSn; } public void setProductSn(String productSn) { this.productSn = productSn; } @Basic @Column(name = "delete_status", nullable = true) public Integer getDeleteStatus() { return deleteStatus; } public void setDeleteStatus(Integer deleteStatus) { this.deleteStatus = deleteStatus; } @Basic @Column(name = "publish_status", nullable = true) public Integer getPublishStatus() { return publishStatus; } public void setPublishStatus(Integer publishStatus) { this.publishStatus = publishStatus; } @Basic @Column(name = "new_status", nullable = true) public Integer getNewStatus() { return newStatus; } public void setNewStatus(Integer newStatus) { this.newStatus = newStatus; } @Basic @Column(name = "recommand_status", nullable = true) public Integer getRecommandStatus() { return recommandStatus; } public void setRecommandStatus(Integer recommandStatus) { this.recommandStatus = recommandStatus; } @Basic @Column(name = "verify_status", nullable = true) public Integer getVerifyStatus() { return verifyStatus; } public void setVerifyStatus(Integer verifyStatus) { this.verifyStatus = verifyStatus; } @Basic @Column(name = "sort", nullable = true) public Integer getSort() { return sort; } public void setSort(Integer sort) { this.sort = sort; } @Basic @Column(name = "sale", nullable = true) public Integer getSale() { return sale; } public void setSale(Integer sale) { this.sale = sale; } @Basic @Column(name = "price", nullable = true, precision = 2) public BigDecimal getPrice() { return price; } public void setPrice(BigDecimal price) { this.price = price; } @Basic @Column(name = "promotion_price", nullable = true, precision = 2) public BigDecimal getPromotionPrice() { return promotionPrice; } public void setPromotionPrice(BigDecimal promotionPrice) { this.promotionPrice = promotionPrice; } @Basic @Column(name = "gift_growth", nullable = true) public Integer getGiftGrowth() { return giftGrowth; } public void setGiftGrowth(Integer giftGrowth) { this.giftGrowth = giftGrowth; } @Basic @Column(name = "gift_point", nullable = true) public Integer getGiftPoint() { return giftPoint; } public void setGiftPoint(Integer giftPoint) { this.giftPoint = giftPoint; } @Basic @Column(name = "use_point_limit", nullable = true) public Integer getUsePointLimit() { return usePointLimit; } public void setUsePointLimit(Integer usePointLimit) { this.usePointLimit = usePointLimit; } @Basic @Column(name = "sub_title", nullable = true, length = 255) public String getSubTitle() { return subTitle; } public void setSubTitle(String subTitle) { this.subTitle = subTitle; } @Basic @Column(name = "description", nullable = true, length = -1) public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } @Basic @Column(name = "original_price", nullable = true, precision = 2) public BigDecimal getOriginalPrice() { return originalPrice; } public void setOriginalPrice(BigDecimal originalPrice) { this.originalPrice = originalPrice; } @Basic @Column(name = "stock", nullable = true) public Integer getStock() { return stock; } public void setStock(Integer stock) { this.stock = stock; } @Basic @Column(name = "low_stock", nullable = true) public Integer getLowStock() { return lowStock; } public void setLowStock(Integer lowStock) { this.lowStock = lowStock; } @Basic @Column(name = "unit", nullable = true, length = 16) public String getUnit() { return unit; } public void setUnit(String unit) { this.unit = unit; } @Basic @Column(name = "weight", nullable = true, precision = 2) public BigDecimal getWeight() { return weight; } public void setWeight(BigDecimal weight) { this.weight = weight; } @Basic @Column(name = "preview_status", nullable = true) public Integer getPreviewStatus() { return previewStatus; } public void setPreviewStatus(Integer previewStatus) { this.previewStatus = previewStatus; } @Basic @Column(name = "service_ids", nullable = true, length = 64) public String getServiceIds() { return serviceIds; } public void setServiceIds(String serviceIds) { this.serviceIds = serviceIds; } @Basic @Column(name = "keywords", nullable = true, length = 255) public String getKeywords() { return keywords; } public void setKeywords(String keywords) { this.keywords = keywords; } @Basic @Column(name = "note", nullable = true, length = 255) public String getNote() { return note; } public void setNote(String note) { this.note = note; } @Basic @Column(name = "album_pics", nullable = true, length = 255) public String getAlbumPics() { return albumPics; } public void setAlbumPics(String albumPics) { this.albumPics = albumPics; } @Basic @Column(name = "detail_title", nullable = true, length = 255) public String getDetailTitle() { return detailTitle; } public void setDetailTitle(String detailTitle) { this.detailTitle = detailTitle; } @Basic @Column(name = "detail_desc", nullable = true, length = -1) public String getDetailDesc() { return detailDesc; } public void setDetailDesc(String detailDesc) { this.detailDesc = detailDesc; } @Basic @Column(name = "detail_html", nullable = true, length = -1) public String getDetailHtml() { return detailHtml; } public void setDetailHtml(String detailHtml) { this.detailHtml = detailHtml; } @Basic @Column(name = "detail_mobile_html", nullable = true, length = -1) public String getDetailMobileHtml() { return detailMobileHtml; } public void setDetailMobileHtml(String detailMobileHtml) { this.detailMobileHtml = detailMobileHtml; } @Basic @Column(name = "promotion_start_time", nullable = true) public Timestamp getPromotionStartTime() { return promotionStartTime; } public void setPromotionStartTime(Timestamp promotionStartTime) { this.promotionStartTime = promotionStartTime; } @Basic @Column(name = "promotion_end_time", nullable = true) public Timestamp getPromotionEndTime() { return promotionEndTime; } public void setPromotionEndTime(Timestamp promotionEndTime) { this.promotionEndTime = promotionEndTime; } @Basic @Column(name = "promotion_per_limit", nullable = true) public Integer getPromotionPerLimit() { return promotionPerLimit; } public void setPromotionPerLimit(Integer promotionPerLimit) { this.promotionPerLimit = promotionPerLimit; } @Basic @Column(name = "promotion_type", nullable = true) public Integer getPromotionType() { return promotionType; } public void setPromotionType(Integer promotionType) { this.promotionType = promotionType; } @Basic @Column(name = "brand_name", nullable = true, length = 255) public String getBrandName() { return brandName; } public void setBrandName(String brandName) { this.brandName = brandName; } @Basic @Column(name = "product_category_name", nullable = true, length = 255) public String getProductCategoryName() { return productCategoryName; } public void setProductCategoryName(String productCategoryName) { this.productCategoryName = productCategoryName; } @Basic @Column(name = "supply_id", nullable = true) public Long getSupplyId() { return supplyId; } public void setSupplyId(Long supplyId) { this.supplyId = supplyId; } @Basic @Column(name = "create_time", nullable = true) public Timestamp getCreateTime() { return createTime; } public void setCreateTime(Timestamp createTime) { this.createTime = createTime; } @Basic @Column(name = "school_id", nullable = true) public Long getSchoolId() { return schoolId; } public void setSchoolId(Long schoolId) { this.schoolId = schoolId; } @Basic @Column(name = "store_id", nullable = true) public Integer getStoreId() { return storeId; } public void setStoreId(Integer storeId) { this.storeId = storeId; } @Basic @Column(name = "member_id", nullable = true) public Long getMemberId() { return memberId; } public void setMemberId(Long memberId) { this.memberId = memberId; } @Basic @Column(name = "hit", nullable = true) public Integer getHit() { return hit; } public void setHit(Integer hit) { this.hit = hit; } @Basic @Column(name = "type", nullable = true) public Integer getType() { return type; } public void setType(Integer type) { this.type = type; } @Basic @Column(name = "area_id", nullable = true) public Long getAreaId() { return areaId; } public void setAreaId(Long areaId) { this.areaId = areaId; } @Basic @Column(name = "area_name", nullable = true, length = 255) public String getAreaName() { return areaName; } public void setAreaName(String areaName) { this.areaName = areaName; } @Basic @Column(name = "school_name", nullable = true, length = 255) public String getSchoolName() { return schoolName; } public void setSchoolName(String schoolName) { this.schoolName = schoolName; } @Basic @Column(name = "transfee", nullable = false, precision = 0) public int getTransfee() { return transfee; } public void setTransfee(int transfee) { this.transfee = transfee; } @Basic @Column(name = "is_paimai", nullable = true) public Integer getIsPaimai() { return isPaimai; } public void setIsPaimai(Integer isPaimai) { this.isPaimai = isPaimai; } @Basic @Column(name = "expire_time", nullable = true) public Timestamp getExpireTime() { return expireTime; } public void setExpireTime(Timestamp expireTime) { this.expireTime = expireTime; } @Basic @Column(name = "store_name", nullable = true, length = 255) public String getStoreName() { return storeName; } public void setStoreName(String storeName) { this.storeName = storeName; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PmsProductEntity that = (PmsProductEntity) o; if (id != that.id) return false; if (transfee != that.transfee) return false; if (brandId != null ? !brandId.equals(that.brandId) : that.brandId != null) return false; if (productCategoryId != null ? !productCategoryId.equals(that.productCategoryId) : that.productCategoryId != null) return false; if (feightTemplateId != null ? !feightTemplateId.equals(that.feightTemplateId) : that.feightTemplateId != null) return false; if (productAttributeCategoryId != null ? !productAttributeCategoryId.equals(that.productAttributeCategoryId) : that.productAttributeCategoryId != null) return false; if (name != null ? !name.equals(that.name) : that.name != null) return false; if (pic != null ? !pic.equals(that.pic) : that.pic != null) return false; if (productSn != null ? !productSn.equals(that.productSn) : that.productSn != null) return false; if (deleteStatus != null ? !deleteStatus.equals(that.deleteStatus) : that.deleteStatus != null) return false; if (publishStatus != null ? !publishStatus.equals(that.publishStatus) : that.publishStatus != null) return false; if (newStatus != null ? !newStatus.equals(that.newStatus) : that.newStatus != null) return false; if (recommandStatus != null ? !recommandStatus.equals(that.recommandStatus) : that.recommandStatus != null) return false; if (verifyStatus != null ? !verifyStatus.equals(that.verifyStatus) : that.verifyStatus != null) return false; if (sort != null ? !sort.equals(that.sort) : that.sort != null) return false; if (sale != null ? !sale.equals(that.sale) : that.sale != null) return false; if (price != null ? !price.equals(that.price) : that.price != null) return false; if (promotionPrice != null ? !promotionPrice.equals(that.promotionPrice) : that.promotionPrice != null) return false; if (giftGrowth != null ? !giftGrowth.equals(that.giftGrowth) : that.giftGrowth != null) return false; if (giftPoint != null ? !giftPoint.equals(that.giftPoint) : that.giftPoint != null) return false; if (usePointLimit != null ? !usePointLimit.equals(that.usePointLimit) : that.usePointLimit != null) return false; if (subTitle != null ? !subTitle.equals(that.subTitle) : that.subTitle != null) return false; if (description != null ? !description.equals(that.description) : that.description != null) return false; if (originalPrice != null ? !originalPrice.equals(that.originalPrice) : that.originalPrice != null) return false; if (stock != null ? !stock.equals(that.stock) : that.stock != null) return false; if (lowStock != null ? !lowStock.equals(that.lowStock) : that.lowStock != null) return false; if (unit != null ? !unit.equals(that.unit) : that.unit != null) return false; if (weight != null ? !weight.equals(that.weight) : that.weight != null) return false; if (previewStatus != null ? !previewStatus.equals(that.previewStatus) : that.previewStatus != null) return false; if (serviceIds != null ? !serviceIds.equals(that.serviceIds) : that.serviceIds != null) return false; if (keywords != null ? !keywords.equals(that.keywords) : that.keywords != null) return false; if (note != null ? !note.equals(that.note) : that.note != null) return false; if (albumPics != null ? !albumPics.equals(that.albumPics) : that.albumPics != null) return false; if (detailTitle != null ? !detailTitle.equals(that.detailTitle) : that.detailTitle != null) return false; if (detailDesc != null ? !detailDesc.equals(that.detailDesc) : that.detailDesc != null) return false; if (detailHtml != null ? !detailHtml.equals(that.detailHtml) : that.detailHtml != null) return false; if (detailMobileHtml != null ? !detailMobileHtml.equals(that.detailMobileHtml) : that.detailMobileHtml != null) return false; if (promotionStartTime != null ? !promotionStartTime.equals(that.promotionStartTime) : that.promotionStartTime != null) return false; if (promotionEndTime != null ? !promotionEndTime.equals(that.promotionEndTime) : that.promotionEndTime != null) return false; if (promotionPerLimit != null ? !promotionPerLimit.equals(that.promotionPerLimit) : that.promotionPerLimit != null) return false; if (promotionType != null ? !promotionType.equals(that.promotionType) : that.promotionType != null) return false; if (brandName != null ? !brandName.equals(that.brandName) : that.brandName != null) return false; if (productCategoryName != null ? !productCategoryName.equals(that.productCategoryName) : that.productCategoryName != null) return false; if (supplyId != null ? !supplyId.equals(that.supplyId) : that.supplyId != null) return false; if (createTime != null ? !createTime.equals(that.createTime) : that.createTime != null) return false; if (schoolId != null ? !schoolId.equals(that.schoolId) : that.schoolId != null) return false; if (storeId != null ? !storeId.equals(that.storeId) : that.storeId != null) return false; if (memberId != null ? !memberId.equals(that.memberId) : that.memberId != null) return false; if (hit != null ? !hit.equals(that.hit) : that.hit != null) return false; if (type != null ? !type.equals(that.type) : that.type != null) return false; if (areaId != null ? !areaId.equals(that.areaId) : that.areaId != null) return false; if (areaName != null ? !areaName.equals(that.areaName) : that.areaName != null) return false; if (schoolName != null ? !schoolName.equals(that.schoolName) : that.schoolName != null) return false; if (isPaimai != null ? !isPaimai.equals(that.isPaimai) : that.isPaimai != null) return false; if (expireTime != null ? !expireTime.equals(that.expireTime) : that.expireTime != null) return false; if (storeName != null ? !storeName.equals(that.storeName) : that.storeName != null) return false; return true; } @Override public int hashCode() { int result = (int) (id ^ (id >>> 32)); result = 31 * result + (brandId != null ? brandId.hashCode() : 0); result = 31 * result + (productCategoryId != null ? productCategoryId.hashCode() : 0); result = 31 * result + (feightTemplateId != null ? feightTemplateId.hashCode() : 0); result = 31 * result + (productAttributeCategoryId != null ? productAttributeCategoryId.hashCode() : 0); result = 31 * result + (name != null ? name.hashCode() : 0); result = 31 * result + (pic != null ? pic.hashCode() : 0); result = 31 * result + (productSn != null ? productSn.hashCode() : 0); result = 31 * result + (deleteStatus != null ? deleteStatus.hashCode() : 0); result = 31 * result + (publishStatus != null ? publishStatus.hashCode() : 0); result = 31 * result + (newStatus != null ? newStatus.hashCode() : 0); result = 31 * result + (recommandStatus != null ? recommandStatus.hashCode() : 0); result = 31 * result + (verifyStatus != null ? verifyStatus.hashCode() : 0); result = 31 * result + (sort != null ? sort.hashCode() : 0); result = 31 * result + (sale != null ? sale.hashCode() : 0); result = 31 * result + (price != null ? price.hashCode() : 0); result = 31 * result + (promotionPrice != null ? promotionPrice.hashCode() : 0); result = 31 * result + (giftGrowth != null ? giftGrowth.hashCode() : 0); result = 31 * result + (giftPoint != null ? giftPoint.hashCode() : 0); result = 31 * result + (usePointLimit != null ? usePointLimit.hashCode() : 0); result = 31 * result + (subTitle != null ? subTitle.hashCode() : 0); result = 31 * result + (description != null ? description.hashCode() : 0); result = 31 * result + (originalPrice != null ? originalPrice.hashCode() : 0); result = 31 * result + (stock != null ? stock.hashCode() : 0); result = 31 * result + (lowStock != null ? lowStock.hashCode() : 0); result = 31 * result + (unit != null ? unit.hashCode() : 0); result = 31 * result + (weight != null ? weight.hashCode() : 0); result = 31 * result + (previewStatus != null ? previewStatus.hashCode() : 0); result = 31 * result + (serviceIds != null ? serviceIds.hashCode() : 0); result = 31 * result + (keywords != null ? keywords.hashCode() : 0); result = 31 * result + (note != null ? note.hashCode() : 0); result = 31 * result + (albumPics != null ? albumPics.hashCode() : 0); result = 31 * result + (detailTitle != null ? detailTitle.hashCode() : 0); result = 31 * result + (detailDesc != null ? detailDesc.hashCode() : 0); result = 31 * result + (detailHtml != null ? detailHtml.hashCode() : 0); result = 31 * result + (detailMobileHtml != null ? detailMobileHtml.hashCode() : 0); result = 31 * result + (promotionStartTime != null ? promotionStartTime.hashCode() : 0); result = 31 * result + (promotionEndTime != null ? promotionEndTime.hashCode() : 0); result = 31 * result + (promotionPerLimit != null ? promotionPerLimit.hashCode() : 0); result = 31 * result + (promotionType != null ? promotionType.hashCode() : 0); result = 31 * result + (brandName != null ? brandName.hashCode() : 0); result = 31 * result + (productCategoryName != null ? productCategoryName.hashCode() : 0); result = 31 * result + (supplyId != null ? supplyId.hashCode() : 0); result = 31 * result + (createTime != null ? createTime.hashCode() : 0); result = 31 * result + (schoolId != null ? schoolId.hashCode() : 0); result = 31 * result + (storeId != null ? storeId.hashCode() : 0); result = 31 * result + (memberId != null ? memberId.hashCode() : 0); result = 31 * result + (hit != null ? hit.hashCode() : 0); result = 31 * result + (type != null ? type.hashCode() : 0); result = 31 * result + (areaId != null ? areaId.hashCode() : 0); result = 31 * result + (areaName != null ? areaName.hashCode() : 0); result = 31 * result + (schoolName != null ? schoolName.hashCode() : 0); result = 31 * result + transfee; result = 31 * result + (isPaimai != null ? isPaimai.hashCode() : 0); result = 31 * result + (expireTime != null ? expireTime.hashCode() : 0); result = 31 * result + (storeName != null ? storeName.hashCode() : 0); return result; } }
[ "2680323775@qq.com" ]
2680323775@qq.com
839d1a52a540eed2a4d25176766dbec7391f8d9c
3ad941eabe20aa3d247cafc26b8dc54642c93fca
/Algorithms/src/BinaryTree/Queue.java
e88d3a10e57428a4eebef865e9acb5334277e86c
[]
no_license
Bmacs/JavaWorkspace
0e046dd3aed7a2bb67e3650aec5a9acb17a3bc95
72196638dad865582aa78914cb2bd6009c8bda4c
refs/heads/master
2021-03-27T14:11:29.540489
2017-09-15T20:56:42
2017-09-15T20:56:42
98,073,677
0
0
null
null
null
null
UTF-8
Java
false
false
568
java
package BinaryTree; public class Queue { private java.util.LinkedList<Object> queue = new java.util.LinkedList<Object>(); public Queue() { } public void clear() { queue.clear(); } public boolean isEmpty() { return queue.isEmpty(); } public Object firstEl() { return queue.getFirst(); } public Object dequeue() { return queue.removeFirst(); } public void enqueue(Object el) { queue.addLast(el); } public String toString() { return queue.toString(); } }
[ "BrendancMcNamara@yahoo.com" ]
BrendancMcNamara@yahoo.com
629f0ceb952321aba4ff6e76d555af135ddd5ace
9500eb97abf12bebc21a0ac7e35e741fff23a843
/app/src/main/java/com/epumer/aaronswartzsimulator/HistorialRecyclerView.java
30f957d5fa9aec98b41ce64b3052b2d1ab612c13
[]
no_license
eiribarren/AaronSwartzSimulator
68f91e210e9fb91c8f8bbf50390b661e62af3832
20e77a900f67fc68e7fffa4e7000fa968e471f88
refs/heads/master
2020-03-29T06:59:01.777319
2018-12-13T19:42:06
2018-12-13T19:42:06
149,648,650
0
0
null
null
null
null
UTF-8
Java
false
false
1,830
java
package com.epumer.aaronswartzsimulator; import android.support.annotation.NonNull; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import android.widget.TableRow; import android.widget.TextView; import org.w3c.dom.Text; import java.util.HashMap; import java.util.List; public class HistorialRecyclerView extends RecyclerView.Adapter<HistorialRecyclerView.HistorialViewHolder> { private List<Puntuacion> mDataset; public HistorialRecyclerView(List<Puntuacion> mDataset) { this.mDataset = mDataset; } @NonNull @Override public HistorialViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View v = (View) LayoutInflater.from(parent.getContext()).inflate(R.layout.historial_text_view, parent, false); HistorialViewHolder hvh = new HistorialViewHolder(v); return hvh; } @Override public void onBindViewHolder(@NonNull HistorialViewHolder historialViewHolder, int position) { historialViewHolder.fecha.setText(mDataset.get(position).getFecha()); historialViewHolder.puntuacion.setText(mDataset.get(position).getPuntuacionAsString()); historialViewHolder.nombre.setText(mDataset.get(position).getNombre()); } @Override public int getItemCount() { return mDataset.size(); } public class HistorialViewHolder extends RecyclerView.ViewHolder { public TextView fecha, puntuacion, nombre; public HistorialViewHolder(View tv) { super(tv); this.fecha = tv.findViewById(R.id.fechaText); this.puntuacion = tv.findViewById(R.id.puntuacionText); this.nombre = tv.findViewById(R.id.nombreText); } } }
[ "informatico@barcelonaled.com" ]
informatico@barcelonaled.com
f46b85e469aa7f31714705d46a3cae027d4399a8
2a38d45cc37c30f6d7f5de5408b765fb18b2b932
/05339 콜센터/src/Main.java
547fe79a597c32e2fce9bbed45c65808b15c6a52
[]
no_license
insulatir/repo-for-baekjoon
5ac5db622ccb066d920d30ae872cc65b08516cb5
7cad30d7cde320d40883ba3bca024e92c44e4077
refs/heads/master
2020-12-01T05:46:50.611198
2020-11-11T11:22:12
2020-11-11T11:22:12
230,568,210
1
0
null
null
null
null
UTF-8
Java
false
false
319
java
public class Main { public static void main(String[] args) { System.out.println(" /~\\\n" + " ( oo|\n" + " _\\=/_\n" + " / _ \\\n" + " //|/.\\|\\\\ \n" + " || \\ / ||\n" + "============\n" + "| |\n" + "| |\n" + "| |"); } }
[ "s42415466@gmail.com" ]
s42415466@gmail.com
cd8f1ebff44d4ff4e97569e824d5ed814b2645d6
1646921d4ad3154aa4315b6da680f9c6224f3690
/src/com/ums/bean/CourseMyExample.java
9fccb215f582fc7457f670d9cb6c2463bb46a34a
[]
no_license
lzl525898/ssm_ums
6210cb98825458340920af2d26692eae0c1598f3
8ed5234041fe593fdf6d8a413b0faa647fd90932
refs/heads/master
2021-04-03T08:57:49.407659
2018-03-30T08:52:56
2018-03-30T08:52:56
124,857,497
0
0
null
null
null
null
UTF-8
Java
false
false
27,093
java
package com.ums.bean; import java.util.ArrayList; import java.util.List; public class CourseMyExample { protected String orderByClause; protected boolean distinct; protected List<Criteria> oredCriteria; public CourseMyExample() { oredCriteria = new ArrayList<Criteria>(); } public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; } public String getOrderByClause() { return orderByClause; } public void setDistinct(boolean distinct) { this.distinct = distinct; } public boolean isDistinct() { return distinct; } public List<Criteria> getOredCriteria() { return oredCriteria; } public void or(Criteria criteria) { oredCriteria.add(criteria); } public Criteria or() { Criteria criteria = createCriteriaInternal(); oredCriteria.add(criteria); return criteria; } public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); if (oredCriteria.size() == 0) { oredCriteria.add(criteria); } return criteria; } protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); return criteria; } public void clear() { oredCriteria.clear(); orderByClause = null; distinct = false; } protected abstract static class GeneratedCriteria { protected List<Criterion> criteria; protected GeneratedCriteria() { super(); criteria = new ArrayList<Criterion>(); } public boolean isValid() { return criteria.size() > 0; } public List<Criterion> getAllCriteria() { return criteria; } public List<Criterion> getCriteria() { return criteria; } protected void addCriterion(String condition) { if (condition == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion(condition)); } protected void addCriterion(String condition, Object value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value)); } protected void addCriterion(String condition, Object value1, Object value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value1, value2)); } public Criteria andMidIsNull() { addCriterion("mid is null"); return (Criteria) this; } public Criteria andMidIsNotNull() { addCriterion("mid is not null"); return (Criteria) this; } public Criteria andMidEqualTo(Long value) { addCriterion("mid =", value, "mid"); return (Criteria) this; } public Criteria andMidNotEqualTo(Long value) { addCriterion("mid <>", value, "mid"); return (Criteria) this; } public Criteria andMidGreaterThan(Long value) { addCriterion("mid >", value, "mid"); return (Criteria) this; } public Criteria andMidGreaterThanOrEqualTo(Long value) { addCriterion("mid >=", value, "mid"); return (Criteria) this; } public Criteria andMidLessThan(Long value) { addCriterion("mid <", value, "mid"); return (Criteria) this; } public Criteria andMidLessThanOrEqualTo(Long value) { addCriterion("mid <=", value, "mid"); return (Criteria) this; } public Criteria andMidIn(List<Long> values) { addCriterion("mid in", values, "mid"); return (Criteria) this; } public Criteria andMidNotIn(List<Long> values) { addCriterion("mid not in", values, "mid"); return (Criteria) this; } public Criteria andMidBetween(Long value1, Long value2) { addCriterion("mid between", value1, value2, "mid"); return (Criteria) this; } public Criteria andMidNotBetween(Long value1, Long value2) { addCriterion("mid not between", value1, value2, "mid"); return (Criteria) this; } public Criteria andCourseidIsNull() { addCriterion("courseid is null"); return (Criteria) this; } public Criteria andCourseidIsNotNull() { addCriterion("courseid is not null"); return (Criteria) this; } public Criteria andCourseidEqualTo(Long value) { addCriterion("courseid =", value, "courseid"); return (Criteria) this; } public Criteria andCourseidNotEqualTo(Long value) { addCriterion("courseid <>", value, "courseid"); return (Criteria) this; } public Criteria andCourseidGreaterThan(Long value) { addCriterion("courseid >", value, "courseid"); return (Criteria) this; } public Criteria andCourseidGreaterThanOrEqualTo(Long value) { addCriterion("courseid >=", value, "courseid"); return (Criteria) this; } public Criteria andCourseidLessThan(Long value) { addCriterion("courseid <", value, "courseid"); return (Criteria) this; } public Criteria andCourseidLessThanOrEqualTo(Long value) { addCriterion("courseid <=", value, "courseid"); return (Criteria) this; } public Criteria andCourseidIn(List<Long> values) { addCriterion("courseid in", values, "courseid"); return (Criteria) this; } public Criteria andCourseidNotIn(List<Long> values) { addCriterion("courseid not in", values, "courseid"); return (Criteria) this; } public Criteria andCourseidBetween(Long value1, Long value2) { addCriterion("courseid between", value1, value2, "courseid"); return (Criteria) this; } public Criteria andCourseidNotBetween(Long value1, Long value2) { addCriterion("courseid not between", value1, value2, "courseid"); return (Criteria) this; } public Criteria andUseridIsNull() { addCriterion("userid is null"); return (Criteria) this; } public Criteria andUseridIsNotNull() { addCriterion("userid is not null"); return (Criteria) this; } public Criteria andUseridEqualTo(Long value) { addCriterion("userid =", value, "userid"); return (Criteria) this; } public Criteria andUseridNotEqualTo(Long value) { addCriterion("userid <>", value, "userid"); return (Criteria) this; } public Criteria andUseridGreaterThan(Long value) { addCriterion("userid >", value, "userid"); return (Criteria) this; } public Criteria andUseridGreaterThanOrEqualTo(Long value) { addCriterion("userid >=", value, "userid"); return (Criteria) this; } public Criteria andUseridLessThan(Long value) { addCriterion("userid <", value, "userid"); return (Criteria) this; } public Criteria andUseridLessThanOrEqualTo(Long value) { addCriterion("userid <=", value, "userid"); return (Criteria) this; } public Criteria andUseridIn(List<Long> values) { addCriterion("userid in", values, "userid"); return (Criteria) this; } public Criteria andUseridNotIn(List<Long> values) { addCriterion("userid not in", values, "userid"); return (Criteria) this; } public Criteria andUseridBetween(Long value1, Long value2) { addCriterion("userid between", value1, value2, "userid"); return (Criteria) this; } public Criteria andUseridNotBetween(Long value1, Long value2) { addCriterion("userid not between", value1, value2, "userid"); return (Criteria) this; } public Criteria andProgressIsNull() { addCriterion("progress is null"); return (Criteria) this; } public Criteria andProgressIsNotNull() { addCriterion("progress is not null"); return (Criteria) this; } public Criteria andProgressEqualTo(Long value) { addCriterion("progress =", value, "progress"); return (Criteria) this; } public Criteria andProgressNotEqualTo(Long value) { addCriterion("progress <>", value, "progress"); return (Criteria) this; } public Criteria andProgressGreaterThan(Long value) { addCriterion("progress >", value, "progress"); return (Criteria) this; } public Criteria andProgressGreaterThanOrEqualTo(Long value) { addCriterion("progress >=", value, "progress"); return (Criteria) this; } public Criteria andProgressLessThan(Long value) { addCriterion("progress <", value, "progress"); return (Criteria) this; } public Criteria andProgressLessThanOrEqualTo(Long value) { addCriterion("progress <=", value, "progress"); return (Criteria) this; } public Criteria andProgressIn(List<Long> values) { addCriterion("progress in", values, "progress"); return (Criteria) this; } public Criteria andProgressNotIn(List<Long> values) { addCriterion("progress not in", values, "progress"); return (Criteria) this; } public Criteria andProgressBetween(Long value1, Long value2) { addCriterion("progress between", value1, value2, "progress"); return (Criteria) this; } public Criteria andProgressNotBetween(Long value1, Long value2) { addCriterion("progress not between", value1, value2, "progress"); return (Criteria) this; } public Criteria andStudytimeIsNull() { addCriterion("studytime is null"); return (Criteria) this; } public Criteria andStudytimeIsNotNull() { addCriterion("studytime is not null"); return (Criteria) this; } public Criteria andStudytimeEqualTo(String value) { addCriterion("studytime =", value, "studytime"); return (Criteria) this; } public Criteria andStudytimeNotEqualTo(String value) { addCriterion("studytime <>", value, "studytime"); return (Criteria) this; } public Criteria andStudytimeGreaterThan(String value) { addCriterion("studytime >", value, "studytime"); return (Criteria) this; } public Criteria andStudytimeGreaterThanOrEqualTo(String value) { addCriterion("studytime >=", value, "studytime"); return (Criteria) this; } public Criteria andStudytimeLessThan(String value) { addCriterion("studytime <", value, "studytime"); return (Criteria) this; } public Criteria andStudytimeLessThanOrEqualTo(String value) { addCriterion("studytime <=", value, "studytime"); return (Criteria) this; } public Criteria andStudytimeLike(String value) { addCriterion("studytime like", value, "studytime"); return (Criteria) this; } public Criteria andStudytimeNotLike(String value) { addCriterion("studytime not like", value, "studytime"); return (Criteria) this; } public Criteria andStudytimeIn(List<String> values) { addCriterion("studytime in", values, "studytime"); return (Criteria) this; } public Criteria andStudytimeNotIn(List<String> values) { addCriterion("studytime not in", values, "studytime"); return (Criteria) this; } public Criteria andStudytimeBetween(String value1, String value2) { addCriterion("studytime between", value1, value2, "studytime"); return (Criteria) this; } public Criteria andStudytimeNotBetween(String value1, String value2) { addCriterion("studytime not between", value1, value2, "studytime"); return (Criteria) this; } public Criteria andMenuidIsNull() { addCriterion("menuid is null"); return (Criteria) this; } public Criteria andMenuidIsNotNull() { addCriterion("menuid is not null"); return (Criteria) this; } public Criteria andMenuidEqualTo(Long value) { addCriterion("menuid =", value, "menuid"); return (Criteria) this; } public Criteria andMenuidNotEqualTo(Long value) { addCriterion("menuid <>", value, "menuid"); return (Criteria) this; } public Criteria andMenuidGreaterThan(Long value) { addCriterion("menuid >", value, "menuid"); return (Criteria) this; } public Criteria andMenuidGreaterThanOrEqualTo(Long value) { addCriterion("menuid >=", value, "menuid"); return (Criteria) this; } public Criteria andMenuidLessThan(Long value) { addCriterion("menuid <", value, "menuid"); return (Criteria) this; } public Criteria andMenuidLessThanOrEqualTo(Long value) { addCriterion("menuid <=", value, "menuid"); return (Criteria) this; } public Criteria andMenuidIn(List<Long> values) { addCriterion("menuid in", values, "menuid"); return (Criteria) this; } public Criteria andMenuidNotIn(List<Long> values) { addCriterion("menuid not in", values, "menuid"); return (Criteria) this; } public Criteria andMenuidBetween(Long value1, Long value2) { addCriterion("menuid between", value1, value2, "menuid"); return (Criteria) this; } public Criteria andMenuidNotBetween(Long value1, Long value2) { addCriterion("menuid not between", value1, value2, "menuid"); return (Criteria) this; } public Criteria andMenulearnIsNull() { addCriterion("menuLearn is null"); return (Criteria) this; } public Criteria andMenulearnIsNotNull() { addCriterion("menuLearn is not null"); return (Criteria) this; } public Criteria andMenulearnEqualTo(Integer value) { addCriterion("menuLearn =", value, "menulearn"); return (Criteria) this; } public Criteria andMenulearnNotEqualTo(Integer value) { addCriterion("menuLearn <>", value, "menulearn"); return (Criteria) this; } public Criteria andMenulearnGreaterThan(Integer value) { addCriterion("menuLearn >", value, "menulearn"); return (Criteria) this; } public Criteria andMenulearnGreaterThanOrEqualTo(Integer value) { addCriterion("menuLearn >=", value, "menulearn"); return (Criteria) this; } public Criteria andMenulearnLessThan(Integer value) { addCriterion("menuLearn <", value, "menulearn"); return (Criteria) this; } public Criteria andMenulearnLessThanOrEqualTo(Integer value) { addCriterion("menuLearn <=", value, "menulearn"); return (Criteria) this; } public Criteria andMenulearnIn(List<Integer> values) { addCriterion("menuLearn in", values, "menulearn"); return (Criteria) this; } public Criteria andMenulearnNotIn(List<Integer> values) { addCriterion("menuLearn not in", values, "menulearn"); return (Criteria) this; } public Criteria andMenulearnBetween(Integer value1, Integer value2) { addCriterion("menuLearn between", value1, value2, "menulearn"); return (Criteria) this; } public Criteria andMenulearnNotBetween(Integer value1, Integer value2) { addCriterion("menuLearn not between", value1, value2, "menulearn"); return (Criteria) this; } public Criteria andMenuallIsNull() { addCriterion("menuAll is null"); return (Criteria) this; } public Criteria andMenuallIsNotNull() { addCriterion("menuAll is not null"); return (Criteria) this; } public Criteria andMenuallEqualTo(Integer value) { addCriterion("menuAll =", value, "menuall"); return (Criteria) this; } public Criteria andMenuallNotEqualTo(Integer value) { addCriterion("menuAll <>", value, "menuall"); return (Criteria) this; } public Criteria andMenuallGreaterThan(Integer value) { addCriterion("menuAll >", value, "menuall"); return (Criteria) this; } public Criteria andMenuallGreaterThanOrEqualTo(Integer value) { addCriterion("menuAll >=", value, "menuall"); return (Criteria) this; } public Criteria andMenuallLessThan(Integer value) { addCriterion("menuAll <", value, "menuall"); return (Criteria) this; } public Criteria andMenuallLessThanOrEqualTo(Integer value) { addCriterion("menuAll <=", value, "menuall"); return (Criteria) this; } public Criteria andMenuallIn(List<Integer> values) { addCriterion("menuAll in", values, "menuall"); return (Criteria) this; } public Criteria andMenuallNotIn(List<Integer> values) { addCriterion("menuAll not in", values, "menuall"); return (Criteria) this; } public Criteria andMenuallBetween(Integer value1, Integer value2) { addCriterion("menuAll between", value1, value2, "menuall"); return (Criteria) this; } public Criteria andMenuallNotBetween(Integer value1, Integer value2) { addCriterion("menuAll not between", value1, value2, "menuall"); return (Criteria) this; } public Criteria andStarttimeIsNull() { addCriterion("startTime is null"); return (Criteria) this; } public Criteria andStarttimeIsNotNull() { addCriterion("startTime is not null"); return (Criteria) this; } public Criteria andStarttimeEqualTo(String value) { addCriterion("startTime =", value, "starttime"); return (Criteria) this; } public Criteria andStarttimeNotEqualTo(String value) { addCriterion("startTime <>", value, "starttime"); return (Criteria) this; } public Criteria andStarttimeGreaterThan(String value) { addCriterion("startTime >", value, "starttime"); return (Criteria) this; } public Criteria andStarttimeGreaterThanOrEqualTo(String value) { addCriterion("startTime >=", value, "starttime"); return (Criteria) this; } public Criteria andStarttimeLessThan(String value) { addCriterion("startTime <", value, "starttime"); return (Criteria) this; } public Criteria andStarttimeLessThanOrEqualTo(String value) { addCriterion("startTime <=", value, "starttime"); return (Criteria) this; } public Criteria andStarttimeLike(String value) { addCriterion("startTime like", value, "starttime"); return (Criteria) this; } public Criteria andStarttimeNotLike(String value) { addCriterion("startTime not like", value, "starttime"); return (Criteria) this; } public Criteria andStarttimeIn(List<String> values) { addCriterion("startTime in", values, "starttime"); return (Criteria) this; } public Criteria andStarttimeNotIn(List<String> values) { addCriterion("startTime not in", values, "starttime"); return (Criteria) this; } public Criteria andStarttimeBetween(String value1, String value2) { addCriterion("startTime between", value1, value2, "starttime"); return (Criteria) this; } public Criteria andStarttimeNotBetween(String value1, String value2) { addCriterion("startTime not between", value1, value2, "starttime"); return (Criteria) this; } public Criteria andEndtimeIsNull() { addCriterion("endTime is null"); return (Criteria) this; } public Criteria andEndtimeIsNotNull() { addCriterion("endTime is not null"); return (Criteria) this; } public Criteria andEndtimeEqualTo(String value) { addCriterion("endTime =", value, "endtime"); return (Criteria) this; } public Criteria andEndtimeNotEqualTo(String value) { addCriterion("endTime <>", value, "endtime"); return (Criteria) this; } public Criteria andEndtimeGreaterThan(String value) { addCriterion("endTime >", value, "endtime"); return (Criteria) this; } public Criteria andEndtimeGreaterThanOrEqualTo(String value) { addCriterion("endTime >=", value, "endtime"); return (Criteria) this; } public Criteria andEndtimeLessThan(String value) { addCriterion("endTime <", value, "endtime"); return (Criteria) this; } public Criteria andEndtimeLessThanOrEqualTo(String value) { addCriterion("endTime <=", value, "endtime"); return (Criteria) this; } public Criteria andEndtimeLike(String value) { addCriterion("endTime like", value, "endtime"); return (Criteria) this; } public Criteria andEndtimeNotLike(String value) { addCriterion("endTime not like", value, "endtime"); return (Criteria) this; } public Criteria andEndtimeIn(List<String> values) { addCriterion("endTime in", values, "endtime"); return (Criteria) this; } public Criteria andEndtimeNotIn(List<String> values) { addCriterion("endTime not in", values, "endtime"); return (Criteria) this; } public Criteria andEndtimeBetween(String value1, String value2) { addCriterion("endTime between", value1, value2, "endtime"); return (Criteria) this; } public Criteria andEndtimeNotBetween(String value1, String value2) { addCriterion("endTime not between", value1, value2, "endtime"); return (Criteria) this; } } public static class Criteria extends GeneratedCriteria { protected Criteria() { super(); } } public static class Criterion { private String condition; private Object value; private Object secondValue; private boolean noValue; private boolean singleValue; private boolean betweenValue; private boolean listValue; private String typeHandler; public String getCondition() { return condition; } public Object getValue() { return value; } public Object getSecondValue() { return secondValue; } public boolean isNoValue() { return noValue; } public boolean isSingleValue() { return singleValue; } public boolean isBetweenValue() { return betweenValue; } public boolean isListValue() { return listValue; } public String getTypeHandler() { return typeHandler; } protected Criterion(String condition) { super(); this.condition = condition; this.typeHandler = null; this.noValue = true; } protected Criterion(String condition, Object value, String typeHandler) { super(); this.condition = condition; this.value = value; this.typeHandler = typeHandler; if (value instanceof List<?>) { this.listValue = true; } else { this.singleValue = true; } } protected Criterion(String condition, Object value) { this(condition, value, null); } protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { super(); this.condition = condition; this.value = value; this.secondValue = secondValue; this.typeHandler = typeHandler; this.betweenValue = true; } protected Criterion(String condition, Object value, Object secondValue) { this(condition, value, secondValue, null); } } }
[ "luckyforlei@163.com" ]
luckyforlei@163.com
3c7c50042ac901d737ff75323e7d54035eeba25d
a74bcf1c0f9e047afd46d4a7b9ad264e27946081
/Java/Android/OpenGLES/source/core/src/loon/core/resource/Resources.java
04cc1d71372ef7f7a313e6fa2121b4052d4245fc
[ "Apache-2.0" ]
permissive
windows10207/LGame
7a260b64dcdac5e1bbde415e5f801691d3bfb9fd
4599507d737a79b27d8f685f7aa542fd9f936cf7
refs/heads/master
2021-01-12T20:15:38.080295
2014-09-22T17:12:08
2014-09-22T17:12:08
24,441,072
1
0
null
null
null
null
UTF-8
Java
false
false
9,727
java
package loon.core.resource; import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import loon.core.LSystem; import loon.utils.StringUtils; import loon.utils.collection.ArrayByte; import android.content.res.AssetManager; /** * * Copyright 2008 - 2009 * * 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. * * @project loon * @author cping * @email javachenpeng@yahoo.com * @version 0.1.0 */ public abstract class Resources { // 以下为0.3.2版中新增资源读取方法(为避免冲突,同时保留了原始读取方式) /** * 从类中读取资源 * * @param path * @return */ public static Resource classRes(String path) { return new ClassRes(path); } /** * 从文件中读取资源 * * @param path * @return */ public static Resource fileRes(String path) { return new FileRes(path); } /** * 从远程地址读取资源 * * @param path * @return */ public static Resource remoteRes(String path) { return new RemoteRes(path); } /** * 从SD卡中读取资源 * * @param path * @return */ public static Resource sdRes(String path) { return new SDRes(path); } /** * 以字符串命令,加载任意类型资源 * * @param path * @return */ public final static InputStream strRes(final String path) { if (path == null) { return null; } InputStream in = null; if (path.indexOf("->") == -1) { if (path.startsWith("sd:")) { in = sdRes(path.substring(3, path.length())).getInputStream(); } else if (path.startsWith("class:")) { in = classRes(path.substring(6, path.length())) .getInputStream(); } else if (path.startsWith("path:")) { in = fileRes(path.substring(5, path.length())).getInputStream(); } else if (path.startsWith("url:")) { in = remoteRes(path.substring(4, path.length())) .getInputStream(); } } else { String[] newPath = StringUtils.split(path, "->"); in = new ByteArrayInputStream(LPKResource.openResource( newPath[0].trim(), newPath[1].trim())); } return in; } private static ClassLoader classLoader; private final static Object lock = new Object(); private final static Map<String, Object> lazyResources = new HashMap<String, Object>( LSystem.DEFAULT_MAX_CACHE_SIZE); static { try { // 在Android中Thread.currentThread()方式等于被废|||…… // classLoader = Thread.currentThread().getContextClassLoader(); classLoader = Resources.class.getClassLoader(); } catch (Throwable ex) { classLoader = null; } } /** * 获得资源名迭代器 * * @return */ public static Iterator<String> getNames() { synchronized (lock) { return lazyResources.keySet().iterator(); } } /** * 检查指定资源名是否存在 * * @param resName * @return */ public static boolean contains(String resName) { synchronized (lock) { return (lazyResources.get(resName) != null); } } /** * 删除指定名称的资源 * * @param resName */ public static void remove(String resName) { synchronized (lock) { lazyResources.remove(resName); } } public static void destroy() { lazyResources.clear(); } @Override public void finalize() { destroy(); } /** * 获得当前系统的ClassLoader * * @return */ public final static ClassLoader getClassLoader() { return classLoader; } /** * 获得指定类的ClassLoader * * @param clazz * @return */ public final static ClassLoader getClassLoader(Class<?> clazz) { return clazz.getClassLoader(); } /** * 返回针对当前游戏应用的资源管理器 * * @return */ public final static android.content.res.Resources getResources() { return LSystem.screenActivity.getResources(); } /** * 打开一个指定的ClassLoader资源 * * @param resName * @param cl * @return * @throws IOException */ public static InputStream openResource(String resName, final ClassLoader c) throws IOException { if (resName.indexOf("\\") != -1) { resName = resName.replace("\\", "/"); } final InputStream result = c.getResourceAsStream(resName); if (result == null) { throw new IOException("Exception to load resource [" + resName + "] ."); } return result; } private final static String assetsFlag = "assets"; /** * 打开当前类加载器下的资源文件 * * @param resName * @return * @throws IOException */ public static InputStream openResource(String resName) throws IOException { InputStream resource = strRes(resName); if (resource != null) { return resource; } if (resName.indexOf("\\") != -1) { resName = resName.replace("\\", "/"); } String fileName = resName.toLowerCase(); if (fileName.startsWith(assetsFlag) || fileName.startsWith(LSystem.FS + assetsFlag)) { boolean flag = resName.startsWith(LSystem.FS); AssetManager asset = LSystem.screenActivity.getAssets(); String file; if (flag) { file = resName.substring(1); } else { file = resName; } int index = file.indexOf(LSystem.FS) + 1; if (index != -1) { file = resName.substring(index); } else { int length = file.length(); int size = file.lastIndexOf(LSystem.FS, 0) + 1; if (size < length) { file = file.substring(size, length); } } return asset.open(file); } if (classLoader != null) { InputStream in = null; try { in = classLoader.getResourceAsStream(resName); } catch (Exception e) { try { in = LSystem.getResourceAsStream(resName); } catch (Exception ex) { throw new RuntimeException(resName + " not found!"); } } if (in == null) { in = LSystem.getResourceAsStream(resName); } return in; } else { return LSystem.screenActivity.getAssets().open(resName); } } /** * 加载资源文件 * * @param resName * @return */ public final static ArrayByte getResource(String resName) { if (resName == null) { return null; } if (resName.indexOf("\\") != -1) { resName = resName.replace("\\", "/"); } InputStream resource = strRes(resName); if (resource != null) { ArrayByte result = new ArrayByte(); try { result.write(resource); resource.close(); result.reset(); } catch (IOException ex) { result = null; } return result; } resName = resName.startsWith(LSystem.FS) ? resName.substring(1) : resName; String innerName = resName; String keyName = innerName.replaceAll(" ", "").toLowerCase(); synchronized (lock) { if (lazyResources.size() > LSystem.DEFAULT_MAX_CACHE_SIZE) { lazyResources.clear(); } byte[] data = (byte[]) lazyResources.get(keyName); if (data != null) { return new ArrayByte(data); } } InputStream in = null; // 外部文件标志 boolean filePath = StringUtils.startsWith(innerName, '$'); if (filePath) { try { innerName = innerName.substring(1, innerName.length()); in = new BufferedInputStream(new FileInputStream(new File( innerName))); } catch (Exception ex) { if (in != null) { LSystem.close(in); } throw new RuntimeException(resName + " file not found !"); } } else { try { in = openResource(innerName); } catch (IOException e) { throw new RuntimeException(resName + " file not found !"); } } ArrayByte byteArray = new ArrayByte(); try { byteArray.write(in); in.close(); byteArray.reset(); lazyResources.put(keyName, byteArray.getData()); } catch (IOException ex) { byteArray = null; } if (byteArray == null) { throw new RuntimeException(resName + " file not found !"); } return byteArray; } /** * 加载资源文件为InputStream格式 * * @param fileName * @return */ public static InputStream getResourceAsStream(final String fileName) { if ((fileName.indexOf("file:") >= 0) || (fileName.indexOf(":/") > 0)) { try { URL url = new URL(fileName); return new BufferedInputStream(url.openStream()); } catch (Exception e) { return null; } } return new ByteArrayInputStream(getResource(fileName).getData()); } /** * 将InputStream转为byte[] * * @param is * @return */ final static public byte[] getDataSource(InputStream is) { if (is == null) { return null; } ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); byte[] bytes = new byte[8192]; try { int read; while ((read = is.read(bytes)) >= 0) { byteArrayOutputStream.write(bytes, 0, read); } bytes = byteArrayOutputStream.toByteArray(); } catch (IOException e) { return null; } finally { try { if (byteArrayOutputStream != null) { byteArrayOutputStream.flush(); byteArrayOutputStream = null; } if (is != null) { is.close(); is = null; } } catch (IOException e) { } } return bytes; } public final static InputStream getResource(Class<?> clazz, String resName) { return clazz.getResourceAsStream(resName); } }
[ "longwind2012@hotmail.com" ]
longwind2012@hotmail.com
84f7c0aad1356b8e6e4b163e09f2656bd486bcf3
42c416edd01aa30206968c7ce9af98576f5add08
/Languages/Java/classes/ExampleClassName.java
56f41ebc80391e76305229a72d32b6d39219824a
[]
no_license
Alpenglow88/Useful_Code_stuff
6387a2a7b9a0677693810d6a04f705acd09ecc99
eedcbef0ce5d06441ec9517921f493329bfce000
refs/heads/master
2023-04-28T02:46:14.870755
2023-04-12T09:28:48
2023-04-12T09:28:48
233,573,772
1
0
null
2023-08-24T09:07:41
2020-01-13T10:51:31
Ruby
UTF-8
Java
false
false
161
java
package Languages.Java.classes; public class ExampleClassName { public static void main(String arg[]){ System.out.println("Hello World"); } }
[ "ian.goddard@theculturetrip.com" ]
ian.goddard@theculturetrip.com
8f083daf7e3c867980efc460d2fc9b330c26c071
9955880c73670d0edcb7982dc61ca2534126a41e
/src/test/java/com/everyflavormusic/song/SongsApplicationTests.java
c281aa3b8bb4c3388bb40209cc279a987b3b1155
[]
no_license
jjschurk30/Song-Webpage-Backend
1d7b1815f3989c143141bc9722534b2b647f1217
777730b3c44b089b3c106ef187d8fdd55754cfc0
refs/heads/master
2020-09-13T13:21:22.044547
2019-11-19T21:56:19
2019-11-19T21:56:19
222,795,573
0
0
null
null
null
null
UTF-8
Java
false
false
216
java
package com.everyflavormusic.song; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class SongsApplicationTests { @Test void contextLoads() { } }
[ "johnschurk@yahoo.com" ]
johnschurk@yahoo.com
f2ceae352ef88129e3390620dbbee4097bf6bcef
8ccf94d1088610185bbb2b096eb06e2f2d2d37cb
/src/main/java/csc/zerofoureightnine/conferencemanager/messaging/MessageController.java
8db5e24d625110fe3f289f13530acd25a63a2e8e
[]
no_license
AnnieZha99/conferenceManagerJava
05378ca27fb714face15e5ea7ace61ebef1fa5a5
49df6fac7fcaa654e083ceeec2e6d0652f1667f7
refs/heads/main
2023-02-12T22:53:48.415543
2021-01-13T15:36:33
2021-01-13T15:36:33
329,350,093
0
0
null
null
null
null
UTF-8
Java
false
false
11,471
java
package csc.zerofoureightnine.conferencemanager.messaging; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import csc.zerofoureightnine.conferencemanager.events.EventManager; import csc.zerofoureightnine.conferencemanager.interaction.MenuNode; import csc.zerofoureightnine.conferencemanager.interaction.presentation.TopicPresentable; import csc.zerofoureightnine.conferencemanager.users.UserManager; import csc.zerofoureightnine.conferencemanager.users.permission.PermissionManager; import csc.zerofoureightnine.conferencemanager.users.permission.Template; public class MessageController { private MessageManager messageManager; private Map<String, String> inputMap; private UserManager userManager; private PermissionManager permissionManager; private MessageMover messageMover; private EventManager eventManager; private final List<String> selectedMessageIDs = new ArrayList<>(); /** * Creates a new MessageController * * @param messageManager associated message manager * @param userManager associated user manager * @param eventManager associated event manager * @param permissionManager associated permission manager */ public MessageController(MessageManager messageManager, UserManager userManager, EventManager eventManager, PermissionManager permissionManager) { this.messageManager = messageManager; this.userManager = userManager; this.permissionManager = permissionManager; this.messageMover = new MessageMover(messageManager); this.eventManager = eventManager; this.inputMap = new HashMap<>(); } /** * Sends a message to a single user. * * @param username current user * @param input user input, may be null * @param selectableOptions options available to user, may be null * @return zero for continuation purposes */ public int messageSingleUser(String username, String input, List<TopicPresentable> selectableOptions) { messageManager.sendMessage(username, inputMap.get("content"), inputMap.get("to")); return 1; } /** * Sends a message to a group of users by template. * * @param username current user * @param input user input, may be null * @param options the options available to user, may be null * @return zero for continuation purposes */ public int messageGroup(String username, String input, List<TopicPresentable> options) { List<String> users = permissionManager. getUserByPermissionTemplate(Template.values()[Integer.parseInt(inputMap.get("selected_group"))- 2]); messageManager.sendMessage(username, inputMap.get("content"), users); return 1; } /** * Sends a message to all the events a user is hosting. * * @param username current user * @param input user input, may be null * @param options the options available to user, may be null * @return zero for continuation purposes */ public int messageAllEvents(String username, String input, List<TopicPresentable> options){ List<String> eventIds = eventManager.getHostingEvents(username); List<String> users = getParticipants(eventIds); if (users.size() == 0){ return 0; } messageManager.sendMessage(username, inputMap.get("content"), users); return 1; } /** * Sends a message to a single event a user is hosting. * * @param username current user * @param input user input, may be null * @param options the options available to user, may be null * @return zero for continuation purposes */ public int messageSingleEvent(String username, String input, List<TopicPresentable> options){ Collection<String> users = eventManager.getParticipants(inputMap.get("event_id")); if (users.size() == 0){ return 0; } messageManager.sendMessage(username, inputMap.get("content"), users); return 1; } /** * Moves a message from the current user's read inbox to their unread inbox. * * @param username current user * @param input user input, may be null * @param options the options available to user, may be null * @return zero for continuation purposes */ public int moveMessageToUnread(String username, String input, List<TopicPresentable> options){ messageMover.moveReadToUnread(UUID.fromString(selectedMessageIDs.get(Integer.parseInt(input))), username); return 1; } /** * Moves a message from current user's unread inbox to their read inbox * * @param username current user * @param input user input, may be null * @param options the options available to user, may be null * @return zero for continuation purposes */ public int moveMessageToRead(String username, String input, List<TopicPresentable> options){ messageMover.moveUnreadToRead(UUID.fromString(selectedMessageIDs.get(Integer.parseInt(input))), username); return 1; } /** * Moves a message to the current user's archived inbox. * * @param username current user * @param input user input, may be null * @param options the options available to user, may be null * @return zero for continuation purposes */ public int moveMessageToArchive(String username, String input, List<TopicPresentable> options){ messageMover.moveToArchived(UUID.fromString(selectedMessageIDs.get(Integer.parseInt(input))), username); return 1; } /** * Removes a message from the current user's archived inbox. * * @param username current user * @param input user input, may be null * @param options the options available to user, may be null * @return zero for continuation purposes */ public int removeMessageFromArchive(String username, String input, List<TopicPresentable> options){ messageMover.removeFromArchived(UUID.fromString(selectedMessageIDs.get(Integer.parseInt(input))), username); return 1; } /** * Deletes a single message the current user has from another user. * * @param username current user * @param input user input, may be null * @param options the options available to user, may be null * @return zero for continuation purposes */ public int deleteSingleMessage(String username, String input, List<TopicPresentable> options){ messageMover.deleteOneMessage(UUID.fromString(selectedMessageIDs.get(Integer.parseInt(input))), username); return 1; } /** * Deletes a conversation the current user has with another user. * * @param username current user * @param input user input, may be null * @param options the options available to user, may be null * @return zero for continuation purposes */ public int deleteSingleConversation(String username, String input, List<TopicPresentable> options){ messageMover.deleteConversation(username, input); return 1; } /** * Clears all inboxes the current user has. * * @param username current user * @param input user input, may be null * @param options the options available to user, may be null * @return zero for continuation purposes */ public int deleteAllInboxes(String username, String input, List<TopicPresentable> options){ messageMover.clearAllInboxes(username); return 1; } /** * Returns true if the inputted recipient for a message is an existing user. * * @param input the current user's input * @param options the options available to user, may be null * @return A boolean stating whether or not the inputted recipient is valid */ public boolean isValidMessageRecipient(String input, List<TopicPresentable> options) { return userManager.userExists(input); } /** * Returns true if the inputted content for a message is valid, * in other words, not empty. * * @param input the current user's input * @param options the options available to user, may be null * @return A boolean stating whether or not the inputted content is valid */ public boolean isValidContent(String input, List<TopicPresentable> options){ return !input.isEmpty(); } /** * Returns true if the inputted event id is valid. * * @param input the current user's input * @param options the options available to user, may be null * @return A boolean stating whether or not the inputted event id is valid */ public boolean isValidEventIdForSending(String input, List<TopicPresentable> options) { return eventManager.eventExists(input); } /** * Returns the input map of this MessageController. * * @return a Map of String to String of the input */ public Map<String, String> getInputMap() { return inputMap; } /** * Simply asks for input to confirm with the user. * @param username the current users username. * @param input the users input for this {@link MenuNode}. * @param topics the variety of children this {@link MenuNode} has. * @return a numerical value representing the option from topics selected. */ public int confirmationAction(String username, String input, List<TopicPresentable> topics) { return 1; } /** * Similar to {@link MessageController#confirmationAction(String, String, List)}, with the only difference of setting the selected messages to read. * @param username the current users username. * @param input the users input for this {@link MenuNode}. * @param topics the variety of children this {@link MenuNode} has. * @return a numerical value representing the option from topics selected. */ public int confirmationReadAction(String username, String input, List<TopicPresentable> topics) { for (String uuid : selectedMessageIDs) { messageMover.moveUnreadToRead(UUID.fromString(uuid), username); } return 1; } private List<String> getParticipants(List<String> eventIds){ List<String> users = new ArrayList<>(); for (String eventId : eventIds){ users.addAll(eventManager.getParticipants(eventId)); } return users; } /** * Checks if a numerical selection from the group of messages being presented by {@link MessagePresenter}. * @param input the current user's input * @param opts the options available to user, may be null * @return A boolean stating whether or not the input number is within bounds of selectable messages. */ public boolean validateMessageSelectionFromGroup(String input, List<TopicPresentable> opts) { return input.matches("^[0-9]+$") && Integer.parseInt(input) < selectedMessageIDs.size(); } /** * * @return A {@link List} of {@link String}s that represent the IDs of the messages currently being looked at by the user through the {@link MessagePresenter}. */ public List<String> getSelectedMessageIDs() { return selectedMessageIDs; } }
[ "noreply@github.com" ]
noreply@github.com
e73eb5cba810382f64bab4d956c05555e0863a01
0a4f87b9e8666ab994cc6aad4e716f25e8a71aca
/Views/AdminGUI/AdminDashBoardAddTestDetailsGUI.java
d3198cf9f796303ffb9d074a7c865e426763f90d
[]
no_license
gourango-modak/ODLRMS
28a1303f612a7a3a699882cba368c68909ccc791
508f1db11e4fae4c3875f4c8aa79dcd05e811c60
refs/heads/master
2022-09-19T14:10:40.230621
2020-05-31T17:20:42
2020-05-31T17:20:42
268,326,240
0
0
null
null
null
null
UTF-8
Java
false
false
10,895
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package Views.AdminGUI; import Database.DBConnection; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import javax.swing.JOptionPane; /** * * @author sajib */ public class AdminDashBoardAddTestDetailsGUI extends javax.swing.JFrame { Connection con; PreparedStatement ps; ResultSet rs; public AdminDashBoardAddTestDetailsGUI() { initComponents(); con = DBConnection.getConnection(); setIDField(); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { Submit = new javax.swing.JLabel(); IDField = new javax.swing.JTextField(); TestTypeField = new javax.swing.JTextField(); CostField = new javax.swing.JTextField(); MouseClickBackPatientDashBoardTOP = new javax.swing.JLabel(); MouseClickBackPatientDashBoardLEFT = new javax.swing.JLabel(); MouseClickBackPatientDashBoardBOTTOM = new javax.swing.JLabel(); MouseClickBackPatientDashBoardRIGHT = new javax.swing.JLabel(); BackgroundImageLabel = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setUndecorated(true); addWindowListener(new java.awt.event.WindowAdapter() { public void windowOpened(java.awt.event.WindowEvent evt) { formWindowOpened(evt); } }); getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); Submit.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { SubmitMouseClicked(evt); } }); getContentPane().add(Submit, new org.netbeans.lib.awtextra.AbsoluteConstraints(490, 379, 53, 30)); IDField.setBackground(new java.awt.Color(49, 19, 50)); IDField.setForeground(new java.awt.Color(255, 255, 255)); IDField.setBorder(null); getContentPane().add(IDField, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 180, 201, 21)); TestTypeField.setBackground(new java.awt.Color(49, 19, 50)); TestTypeField.setForeground(new java.awt.Color(255, 255, 255)); TestTypeField.setBorder(null); getContentPane().add(TestTypeField, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 250, 201, 21)); CostField.setBackground(new java.awt.Color(49, 19, 50)); CostField.setForeground(new java.awt.Color(255, 255, 255)); CostField.setBorder(null); getContentPane().add(CostField, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 320, 201, 21)); MouseClickBackPatientDashBoardTOP.setPreferredSize(new java.awt.Dimension(900, 42)); MouseClickBackPatientDashBoardTOP.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { MouseClickBackPatientDashBoardTOPMouseClicked(evt); } }); getContentPane().add(MouseClickBackPatientDashBoardTOP, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, -1)); MouseClickBackPatientDashBoardLEFT.setPreferredSize(new java.awt.Dimension(310, 466)); MouseClickBackPatientDashBoardLEFT.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { MouseClickBackPatientDashBoardLEFTMouseClicked(evt); } }); getContentPane().add(MouseClickBackPatientDashBoardLEFT, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 42, -1, -1)); MouseClickBackPatientDashBoardBOTTOM.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { MouseClickBackPatientDashBoardBOTTOMMouseClicked(evt); } }); getContentPane().add(MouseClickBackPatientDashBoardBOTTOM, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 508, 900, 42)); MouseClickBackPatientDashBoardRIGHT.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { MouseClickBackPatientDashBoardRIGHTMouseClicked(evt); } }); getContentPane().add(MouseClickBackPatientDashBoardRIGHT, new org.netbeans.lib.awtextra.AbsoluteConstraints(592, 42, 308, 466)); BackgroundImageLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/AdminImg/AdminDashBoardPageAddTestDetailsGUI.png"))); // NOI18N getContentPane().add(BackgroundImageLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 900, 550)); setSize(new java.awt.Dimension(900, 550)); setLocationRelativeTo(null); }// </editor-fold>//GEN-END:initComponents private void MouseClickBackPatientDashBoardTOPMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_MouseClickBackPatientDashBoardTOPMouseClicked this.setVisible(false); }//GEN-LAST:event_MouseClickBackPatientDashBoardTOPMouseClicked private void MouseClickBackPatientDashBoardLEFTMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_MouseClickBackPatientDashBoardLEFTMouseClicked this.setVisible(false); }//GEN-LAST:event_MouseClickBackPatientDashBoardLEFTMouseClicked private void MouseClickBackPatientDashBoardBOTTOMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_MouseClickBackPatientDashBoardBOTTOMMouseClicked this.setVisible(false); }//GEN-LAST:event_MouseClickBackPatientDashBoardBOTTOMMouseClicked private void MouseClickBackPatientDashBoardRIGHTMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_MouseClickBackPatientDashBoardRIGHTMouseClicked this.setVisible(false); }//GEN-LAST:event_MouseClickBackPatientDashBoardRIGHTMouseClicked private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened for(double i=0.0; i<=1.0; i+=0.1) { String val = i+""; float fval = Float.valueOf(val); this.setOpacity(fval); try { Thread.sleep(50); } catch(Exception e) { } } }//GEN-LAST:event_formWindowOpened private void setIDField() { if(con != null) { int count = 0; try { ps = con.prepareStatement("SELECT * FROM TEST"); rs = ps.executeQuery(); while(rs.next()) { count++; } IDField.setText(String.valueOf(1000+count)); } catch(Exception ex) { JOptionPane.showMessageDialog(null, ex.getMessage()); } } else JOptionPane.showMessageDialog(null, "DateBase Connection Failed"); } private void SubmitMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_SubmitMouseClicked if(con != null) { try { ps = con.prepareStatement("INSERT INTO `Test`(`type`, `cost`) VALUES (?,?)"); ps.setString(1, TestTypeField.getText()); ps.setString(2, CostField.getText()); if(ps.executeUpdate() != 0){ JOptionPane.showMessageDialog(null, "Test Added In Database"); this.setVisible(false); } else JOptionPane.showMessageDialog(null, "There was an Error"); } catch(Exception ex) { JOptionPane.showMessageDialog(null, ex.getMessage()); } } else JOptionPane.showMessageDialog(null, "DateBase Connection Failed"); }//GEN-LAST:event_SubmitMouseClicked /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(AdminDashBoardAddTestDetailsGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(AdminDashBoardAddTestDetailsGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(AdminDashBoardAddTestDetailsGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(AdminDashBoardAddTestDetailsGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new AdminDashBoardAddTestDetailsGUI().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel BackgroundImageLabel; private javax.swing.JTextField CostField; private javax.swing.JTextField IDField; private javax.swing.JLabel MouseClickBackPatientDashBoardBOTTOM; private javax.swing.JLabel MouseClickBackPatientDashBoardLEFT; private javax.swing.JLabel MouseClickBackPatientDashBoardRIGHT; private javax.swing.JLabel MouseClickBackPatientDashBoardTOP; private javax.swing.JLabel Submit; private javax.swing.JTextField TestTypeField; // End of variables declaration//GEN-END:variables }
[ "noreply@github.com" ]
noreply@github.com
9f6bbd553dee766033b17303ca43a87d2371b23d
c1b19409739946b28ef1f22da197c40b9ff6c56a
/src/MessageQueue.java
a8902e3bf706181f04416d5bf54e19232cc3e484
[]
no_license
christianfp/adsadasfa
0b0e3474255c4f5f51ac1dd9af8ea96f9a3c8ff6
3ccfb8eba36e2a3b09780a6e6d7bda876642a4ba
refs/heads/master
2020-03-19T06:53:08.331028
2018-06-04T17:59:41
2018-06-04T17:59:41
136,063,441
0
0
null
null
null
null
UTF-8
Java
false
false
588
java
import java.util.ArrayList; public class MessageQueue { private ArrayList<Message>queue; public Message peek() { if (queue.size() == 0) return null; else return queue.get(queue.size()-1); } public MessageQueue() { queue = new ArrayList(); } public Message remove() { return queue.remove(queue.size()-1); } public Message getMessageOf(int position){ return queue.get(position); } public void add(Message newMessage) { queue.add(newMessage); } public int size() { return queue.size(); } }
[ "christian_flores995@hotmail.com" ]
christian_flores995@hotmail.com
a1a18dabc692f18d2b8bbfc31ac70f24a2a96568
915761b284c7e66b5dc1bc9d4865107f3427d47b
/src/comportamentales/responsability/descrScooter7.java
f338950d4745d28303e9135ab8146120a3679a12
[]
no_license
ChristianGalindo10/ProyectoFinalModelos
c5eb4ebf7984946a3687e40d239200d5226803a5
c9d702ad74e6288adb128fe6b837ac43686749fb
refs/heads/master
2022-05-05T05:40:39.994334
2022-04-26T16:18:30
2022-04-26T16:18:30
249,746,181
0
0
null
null
null
null
UTF-8
Java
false
false
945
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package comportamentales.responsability; import javax.swing.JLabel; /** * * @author sebas */ public class descrScooter7 implements descrManager{ private descrManager manager_next; @Override public void setNext(descrManager dm) { this.manager_next = dm; } @Override public descrManager getManager() { return this.manager_next; } @Override public void description(JLabel lbl, String description,int price, int id) { if (id == 7){ lbl.setText("<html>"+description+"<br> Precio: "+price); } else{ System.out.println("No reconocido, ejecutando siguiente..."); this.manager_next.description(lbl, description, price , id); } } }
[ "cygc1@hotmail.com" ]
cygc1@hotmail.com
c19fd3107a5be2a44f1b795d9a9c0608a2c14654
95c49f466673952b465e19a5ee3ae6eff76bee00
/src/main/java/com/alibaba/baichuan/android/trade/C1214b.java
47e044c89633bab4436456f55f5c1cfe19d8ad86
[]
no_license
Phantoms007/zhihuAPK
58889c399ae56b16a9160a5f48b807e02c87797e
dcdbd103436a187f9c8b4be8f71bdf7813b6d201
refs/heads/main
2023-01-24T01:34:18.716323
2020-11-25T17:14:55
2020-11-25T17:14:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,683
java
package com.alibaba.baichuan.android.trade; import android.text.TextUtils; import android.webkit.URLUtil; import com.alibaba.baichuan.trade.biz.context.AlibcTradeContext; import com.alibaba.baichuan.trade.biz.context.AlibcTradeTaokeParam; import com.alibaba.baichuan.trade.biz.core.taoke.AlibcPidTaokeComponent; import com.alibaba.baichuan.trade.biz.core.taoke.AlibcTaokeTraceCallback; import com.alibaba.baichuan.trade.biz.core.usertracker.UserTrackerConstants; import java.util.HashMap; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; /* renamed from: com.alibaba.baichuan.android.trade.b */ public class C1214b { /* renamed from: a */ public Map<String, String> f5813a; /* renamed from: b */ private String f5814b; public C1214b(String str) { this.f5814b = str; } /* renamed from: a */ public void mo11279a(AlibcTradeTaokeParam alibcTradeTaokeParam, AlibcTradeContext alibcTradeContext, AlibcTaokeTraceCallback alibcTaokeTraceCallback) { if (!TextUtils.isEmpty(this.f5814b)) { boolean z = false; for (String str : AlibcContext.detailPatterns) { if (this.f5814b.matches(str)) { z = true; } } if (z) { Matcher matcher = Pattern.compile("(\\?|&)id=([^&?]*)").matcher(this.f5814b); String str2 = null; if (matcher.find()) { String group = matcher.group(); str2 = group.substring(group.indexOf(61) + 1); } HashMap<String, String> hashMap = new HashMap<>(); hashMap.put("itemId", str2); AlibcPidTaokeComponent.INSTANCE.genUrlAndTaokeTrace(hashMap, mo11281b(), true, alibcTradeTaokeParam, mo11283d(), alibcTaokeTraceCallback); } } } /* renamed from: a */ public boolean mo11280a() { return (getClass().getSuperclass() != null && getClass().getSuperclass().getName().equals(C1214b.class.getName())) || this.f5814b != null; } /* renamed from: b */ public String mo11281b() { if (URLUtil.isNetworkUrl(this.f5814b)) { return this.f5814b.trim(); } return null; } /* renamed from: c */ public boolean mo11282c() { return true; } /* renamed from: d */ public String mo11283d() { return UserTrackerConstants.E_SHOWPAGE; } /* renamed from: e */ public Map<String, String> mo11284e() { return this.f5813a; } /* renamed from: f */ public String mo11285f() { return "url"; } }
[ "seasonpplp@qq.com" ]
seasonpplp@qq.com
dfdb87f08e9fbd0bbb942535e931266732adf750
0a5b047ab7e6a5e00b6e1a9b4ef5f54bbda71512
/JavaFxx/src/com/javafxx/models/EmployeManutention.java
ec534aba91d49689601dfeb6284e0bd5748527c5
[]
no_license
SanaaSaadoune/Manage_employeesFx
b16054c86433bdae81d46052dcf13459b115fef8
1c596a8607dedff7e1f44a54de2fd2a1b2a9d4e5
refs/heads/master
2023-02-11T06:25:41.076342
2021-01-06T15:51:03
2021-01-06T15:51:03
null
0
0
null
null
null
null
ISO-8859-1
Java
false
false
1,526
java
package com.javafxx.models; import java.sql.Date; import java.text.SimpleDateFormat; public class EmployeManutention extends Employe { private int heuresTravail; public int getHeuresTravail() { return heuresTravail; } public void setHeuresTravail(int heuresTravail) { this.heuresTravail = heuresTravail; } public boolean isRisque() { return risque; } public void setRisque(boolean risque) { this.risque = risque; } private boolean risque; public EmployeManutention(int id, String nom, String prenom, int age, int dateEntree, int heuresTravail,boolean risque) { super(id, nom, prenom, age, dateEntree); // TODO Auto-generated constructor stub this.heuresTravail = heuresTravail; this.risque = risque; } public EmployeManutention(String nom, String prenom, int age, int dateEntree, int heuresTravail,boolean risque) { super(nom, prenom, age, dateEntree); // TODO Auto-generated constructor stub this.heuresTravail = heuresTravail; this.risque = risque; } @Override public double calculerSalaire() { // TODO Auto-generated method stub if(this.risque) { EmployeManutentionRisque EmplyeRisque = new EmployeManutentionRisque(); return heuresTravail * 50 + EmplyeRisque.prime(); }else { return heuresTravail * 50; } } /* @Override public String getNom() { return "L'employé de manutention : " + this.getNom() + this.getPrenom(); }*/ @Override public String toString() { return "EmployeManutention [heuresTravail=" + heuresTravail + "]"; } }
[ "sanaasdn@hotmail.com" ]
sanaasdn@hotmail.com
b5f3a84ec4993bff9b4fb933b52760fdf434b3ed
9810f48356a1641c4a4178bd9b1505dd97276f50
/CICDapp/src/main/java/applicationPackage/Appsource.java
269c6567a08973f8e33f56f34d3603b4ffbfb2a7
[]
no_license
pramoth57/CICDapp
1adc59001475084ab3bc1e66483051fecb98a593
22798d1657a0168b7cecde7f0f59cc68334f5d45
refs/heads/master
2020-03-14T18:50:12.659061
2018-05-01T18:45:58
2018-05-01T18:45:58
131,750,132
0
0
null
null
null
null
UTF-8
Java
false
false
313
java
package applicationPackage; import org.testng.Assert; import org.testng.annotations.Test; public class Appsource { @Test public void verifysum(){ int a=50,b=80,c; c=a+b; System.out.println("***********************************"); Assert.assertEquals(c, 130); } }
[ "pramothkumar57@gmail.com" ]
pramothkumar57@gmail.com
8df2e0d2e2171439714f21c9cefe166f770cb8cf
38a1c29c18e12eb58ba901d87669b7fe7a051422
/ecomm/src/main/java/com/roberto/ecom/domain/Payment.java
8ac4642ed3094d7d5a0314e2bdf171367d62d783
[]
no_license
rrocharoberto/spring-training
851008ecc9356ac26abdb70c36899e690e0b2c02
fc297688893fb3b24c8f0f1aa483351bb116b342
refs/heads/main
2023-08-30T12:24:40.998901
2021-10-27T12:38:00
2021-10-27T12:38:00
421,812,486
1
0
null
null
null
null
UTF-8
Java
false
false
1,523
java
package com.roberto.ecom.domain; import java.io.Serializable; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Inheritance; import javax.persistence.InheritanceType; import javax.persistence.JoinColumn; import javax.persistence.MapsId; import javax.persistence.OneToOne; import com.roberto.ecom.domain.enums.PaymentStatus; import lombok.Getter; import lombok.Setter; @Entity @Inheritance(strategy = InheritanceType.JOINED) @Setter @Getter public abstract class Payment implements Serializable { @Id private Integer id; private PaymentStatus status; @OneToOne @JoinColumn(name = "ORDER_FK") @MapsId private Order order; public Payment() { } public Payment(Integer id, PaymentStatus status, Order order) { this.id = id; this.status = status; this.order = order; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((id == null) ? 0 : id.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Payment other = (Payment) obj; if (id == null) { if (other.id != null) return false; } else if (!id.equals(other.id)) return false; return true; } }
[ "rrocha.roberto@gmail.com" ]
rrocha.roberto@gmail.com
4316ac08c0b265665a7a6cd384dfb35b91f1eb32
8d3a4a4b11081245913b6369068e8607e78c0ecf
/src/org/dimigo/inheritance/Animal.java
4255cdd992fb7cb43b6ebe385e598c24f31a005a
[]
no_license
nate2402/JavaClass
6f999b3ae983bf4f82bb181b856be7daf84abf60
3a968cd4a9048d593f5d2e4900440233bb4f798a
refs/heads/master
2020-06-17T00:54:42.081913
2019-07-08T06:18:48
2019-07-08T06:18:48
195,748,735
0
0
null
null
null
null
UTF-8
Java
false
false
584
java
package org.dimigo.inheritance; public class Animal { protected String name; public Animal(String name) { this.name = name; } public void eat() { System.out.println("냠냠"); } public void sleep() { System.out.println("쿨쿨"); } public void bark() { System.out.println("멍멍"); } public String toString() { return "제 이름은 " + name + "입니다."; } //getter public String getName() { return name; } //protected로 설정하면 자식에서만 접근 가능 }
[ "nate2402@naver.com" ]
nate2402@naver.com
571a424dd4977c78eeecd0bf3220bde5a9775253
c020ac56daef1d978ce0e298eade7584f18aec27
/Java/03-链表/src/com/zeng/AbstractList.java
6addecbc6984e4cb190ce038949ff3c22fed2286
[ "Apache-2.0" ]
permissive
yiyezhiqiu1024/DataStructure-Algorithms
d964a5a41494fe42bace363e82766f2f7b3c101b
e6247a46b32fe10a4c03e7b1e0a07c962fb0c23f
refs/heads/master
2022-11-20T14:02:40.085823
2020-07-10T11:09:27
2020-07-10T11:09:27
182,192,095
1
0
null
null
null
null
UTF-8
Java
false
false
746
java
package com.zeng; public abstract class AbstractList<E> implements List<E> { /** * 元素的数量 */ protected int size; @Override public int size() { return size; } @Override public boolean isEmpty() { return size == 0; } @Override public boolean contains(E element) { return indexOf(element) != ELEMENT_NOT_FOUND; } @Override public void add(E element) { add(size, element); } protected void outOfBounds(int index) { throw new IndexOutOfBoundsException("Index:" + index + ", Size:" + size); } protected void rangeCheck(int index) { if (index < 0 || index >= size) outOfBounds(index); } protected void rangeCheckForAdd(int index) { if (index < 0 || index > size) outOfBounds(index); } }
[ "zeng@AmassdeMac-mini.local" ]
zeng@AmassdeMac-mini.local
9ecd52d734d8fe42470ed34254ec160524029380
2a0b5df31c675070761dca0d3d719733fc2ea187
/java/oreilly/Java_practice/GUI1/PicPanelTest.java
47376223a09b4e714317e255da5a7abe3f70b134
[]
no_license
oussamad-blip/bookcode-compile-lang
55ff480d50f6101fd727bbfedb60587cb9930b60
87a959cf821624765df34eff506faf28ae429b4c
refs/heads/master
2023-05-05T00:05:49.387277
2019-02-17T10:08:17
2019-02-17T10:08:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
380
java
import javax.swing.*; import java.awt.*; public class PicPanelTest { public static void main (String[] args) { JFrame frame = new JFrame(); MyPicPanel pic = new MyPicPanel(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().add(pic); frame.setSize(300,300); frame.setVisible(true); } }
[ "jimagile@gmail.com" ]
jimagile@gmail.com
8105ac6f7ef0af5d73cca8ff58ff9c89a31d82ac
1ab5524843672abcdc620eb17656e01e228ae704
/src/main/java/com/xy/dev/ResourceWrapper.java
d8fa8b83107be85367258a2fa7a8e7210bb5425c
[]
no_license
yuanyi1989/droolsDemo
4b9b05eca6329c5d3f91f4ce55a27b34cb0af701
b733aed51929fbff3b52482a4921a7277237b6c2
refs/heads/master
2021-01-12T01:27:11.786997
2017-01-09T08:38:00
2017-01-09T08:38:00
78,386,589
0
0
null
null
null
null
UTF-8
Java
false
false
742
java
package com.xy.dev; import org.kie.api.io.Resource; /** * Created by 袁意 on 2017/1/6. */ public class ResourceWrapper { private Resource resource; private String targetResourceName; public ResourceWrapper(Resource resource, String targetResourceName) { this.resource = resource; this.targetResourceName = targetResourceName; } public Resource getResource() { return resource; } public String getTargetResourceName() { return targetResourceName; } public void setResource(Resource resource) { this.resource = resource; } public void setTargetResourceName(String targetResourceName) { this.targetResourceName = targetResourceName; } }
[ "mireator@126.com" ]
mireator@126.com
dfc2ee42b5ef22904cc969f96e5cc899faa37fdd
a44a3392fea160f997038c34ab2898591c280322
/src/designmodemy/Bridging.java
c1688206dca2cbff6bee378caa4391628edda1e6
[]
no_license
ZLATAN211/java_example
634da13f1d0a291420c913aa2cab9a06b477f050
5e0444d8f17eadcd90a659a215c36ffb963aa3ab
refs/heads/master
2023-06-24T20:48:06.928229
2021-07-23T06:42:34
2021-07-23T06:42:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,156
java
package designmodemy; //电脑品牌接口 interface Brand { void sale(); } //创建电脑品牌 class Lenovo implements Brand { @Override public void sale() { System.out.println("联想"); } } class Dell implements Brand { @Override public void sale() { System.out.println("戴尔"); } } //电脑集成品牌 class Computer { protected Brand brand; public Computer(Brand b) { this.brand=b; } public void sale(){ brand.sale(); } } // class Desktop extends Computer{ public Desktop(Brand b) { super(b); } @Override public void sale(){ super.sale(); System.out.println("出售台式电脑"); } } class Laptop extends Computer{ public Laptop(Brand b) { super(b); } @Override public void sale(){ super.sale(); System.out.println("出售笔记本"); } } public class Bridging { public static void main(String[] args) { Computer computer=new Laptop(new Lenovo()); computer.sale(); Computer computer1=new Desktop(new Dell()); computer1.sale(); } }
[ "2428784410@qq.com" ]
2428784410@qq.com
9787a84b1411408cefdf6ec70d3ab470e9bc3850
5b82e2f7c720c49dff236970aacd610e7c41a077
/QueryReformulation-master 2/data/processed/EclipseProjectConfigurator.java
1a489a1223578947740acfe22e43152d7d01d028
[]
no_license
shy942/EGITrepoOnlineVersion
4b157da0f76dc5bbf179437242d2224d782dd267
f88fb20497dcc30ff1add5fe359cbca772142b09
refs/heads/master
2021-01-20T16:04:23.509863
2016-07-21T20:43:22
2016-07-21T20:43:22
63,737,385
0
0
null
null
null
null
UTF-8
Java
false
false
2,427
java
/***/ package org.eclipse.ui.internal.wizards.datatransfer; import java.io.File; import java.util.HashSet; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IFolder; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProjectDescription; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.Path; import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin; import org.eclipse.ui.wizards.datatransfer.ProjectConfigurator; /** * A {@link ProjectConfigurator} that detects Eclipse projects (folder with * .project) * * @since 3.12 * */ public class EclipseProjectConfigurator implements ProjectConfigurator { @Override public Set<File> findConfigurableLocations(File root, IProgressMonitor monitor) { Set<File> projectFiles = new LinkedHashSet(); Set<String> visitedDirectories = new HashSet(); WizardProjectsImportPage.collectProjectFilesFromDirectory(projectFiles, root, visitedDirectories, true, monitor); Set<File> res = new LinkedHashSet(); for (File projectFile : projectFiles) { res.add(projectFile.getParentFile()); } return res; } @Override public boolean shouldBeAnEclipseProject(IContainer container, IProgressMonitor monitor) { return container.getFile(new Path(IProjectDescription.DESCRIPTION_FILE_NAME)).exists(); } @Override public Set<IFolder> getFoldersToIgnore(IProject project, IProgressMonitor monitor) { return null; } @Override public boolean canConfigure(IProject project, Set<IPath> ignoredPaths, IProgressMonitor monitor) { return true; } @Override public void removeDirtyDirectories(Map<File, List<ProjectConfigurator>> proposals) { // nothing to do: we cannot infer that a directory is dirty from // .project } @Override public void configure(IProject project, Set<IPath> excludedDirectories, IProgressMonitor monitor) { try { project.refreshLocal(IResource.DEPTH_INFINITE, monitor); } catch (CoreException ex) { IDEWorkbenchPlugin.log(ex.getMessage(), ex); } } }
[ "muktacseku@gmail.com" ]
muktacseku@gmail.com
709f60ee6eab1a061601d86fe479669bb72cff6d
838fe21048f4da4ba6a2ec1679e2a9e3aff188c9
/Calix-android/app/src/main/java/com/calix/calixgigamanage/utils/PatternMatcherUtil.java
31255c36b0e8b0ea4f7daa9d58d6527cafa3e080
[]
no_license
PrithivDharmarajan/Projects
03b162e0666dc08888d73bd3c6fa7771525677c7
1548b60025adc4f7a0570d51950c144a1cacce3a
refs/heads/master
2020-03-30T22:36:22.465572
2018-11-12T16:39:01
2018-11-12T16:39:01
151,672,600
0
0
null
null
null
null
UTF-8
Java
false
false
524
java
package com.calix.calixgigamanage.utils; import java.util.regex.Pattern; public class PatternMatcherUtil { /*to Check if the string is the mail ID or not*/ public static boolean isEmailValid(String email) { return android.util.Patterns.EMAIL_ADDRESS.matcher(email).matches(); } /*to Check if the string is the valid password or not*/ public static boolean isPasswordValid(String password) { return Pattern.compile(AppConstants.PASS_WORD_PATTERN).matcher(password).matches(); } }
[ "prithiviraj@smaatapps.com" ]
prithiviraj@smaatapps.com
75bd0038c821f0d76229dbbc3d0df0513de1ede7
18e21abf2fb48247d8b835133b11476e877c911f
/app/src/main/java/com/blockchain/ipfs/util/FileReaderUtil.java
74c0998a398378cdea0681cd5eb97f6a7d0d5ead
[ "MIT" ]
permissive
rogerlzp/IPFS_Android
c2db71ae6323002418306c81ab183d7673181370
6af110468c0844f57694382ecfcc0735d77e757e
refs/heads/master
2020-03-20T19:25:58.586593
2019-11-16T03:30:02
2019-11-16T03:30:02
137,637,280
1
0
null
null
null
null
UTF-8
Java
false
false
858
java
package com.blockchain.ipfs.util; import android.util.Log; import com.socks.library.KLog; import java.io.BufferedReader; import java.io.DataInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileReader; import java.io.IOException; public class FileReaderUtil { public static String readFile(File inputFile) { try { BufferedReader bfr = new BufferedReader(new FileReader(inputFile)); String line = bfr.readLine(); StringBuilder sb = new StringBuilder(); while (line != null) { sb.append(line); sb.append("\n"); line = bfr.readLine(); } bfr.close(); return sb.toString(); } catch (IOException e) { KLog.e(e.getMessage()); } return null; } }
[ "rogerlzp@gmail.com" ]
rogerlzp@gmail.com
5a1571f8a35182706ee8297dc87cbecd6ccc9e45
5be44f022a14d3a1587f557958d64d6958cfe9c3
/aws/springcloudrds/src/main/java/io/pratik/springcloudrds/ApplicationConfiguration.java
ade9eb53025b51dd6ee28c8dba7a65a9a063ebdb
[ "MIT" ]
permissive
thombergs/code-examples
4608b7d9ea3201ffa26d305f24d1ac1aa77f2c08
ca500ac4d4a0e501565e30dcdea37bb17d4d26e7
refs/heads/master
2023-09-04T23:14:37.811206
2023-08-14T21:04:33
2023-08-14T21:04:33
98,801,926
2,492
2,710
MIT
2023-09-10T20:42:50
2017-07-30T14:12:24
Java
UTF-8
Java
false
false
699
java
/** * */ package io.pratik.springcloudrds; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import io.awspring.cloud.jdbc.config.annotation.RdsInstanceConfigurer; import io.awspring.cloud.jdbc.datasource.TomcatJdbcDataSourceFactory; /** * @author pratikdas * */ @Configuration public class ApplicationConfiguration { @Bean public RdsInstanceConfigurer instanceConfigurer() { return ()-> { TomcatJdbcDataSourceFactory dataSourceFactory = new TomcatJdbcDataSourceFactory(); dataSourceFactory.setInitialSize(10); dataSourceFactory.setValidationQuery("SELECT 1 FROM DUAL"); return dataSourceFactory; }; } }
[ "pratikd2000@gmail.com" ]
pratikd2000@gmail.com
144c29e22751085e076dad39a3b7f49137b5f3d5
8fd840e0f5829b1e735ca5b5fbab944a216a4a2a
/src/main/java/com/memo/assist/data/models/Feedback.java
68913929137d0cd279a82bfdefa0d6c2ec3c2a17
[ "MIT" ]
permissive
kantjessica/try-to-remember
30728e7af2b9b00968ee0585ee84f3bea2464a45
7891089aaacad871b2dfdc3ead8d978e56f2e2dd
refs/heads/master
2021-01-18T23:49:58.949094
2016-07-27T20:53:47
2016-07-27T20:53:47
44,995,001
0
0
null
null
null
null
UTF-8
Java
false
false
477
java
package com.memo.assist.data.models; /** * Created by dhuiying on 14.07.16. */ public class Feedback { private Repetition repetition; private Grade grade; public Repetition getRepetition() { return repetition; } public void setRepetition(Repetition repetition) { this.repetition = repetition; } public Grade getGrade() { return grade; } public void setGrade(Grade grade) { this.grade = grade; } }
[ "kant1981@gmail.com" ]
kant1981@gmail.com
1b1e5a34ec770bc317a98c2f4b175ace4000164d
db01eb79f2608459b43bf883947bc1c4b846b8f8
/src/edu/jhu/cs/pl/group18/CurseOfMalphamond/Exception/PlayerFullException.java
e16cba943676f3b229f18fc831ed67f68da924d7
[]
no_license
kaikulimu/CurseOfMalphamond
d730c4ef7e16a94936d99a16c37d490f5edc997e
2382cb7419356f94cf0f385089255a96ec50a2b0
refs/heads/master
2020-02-26T15:42:04.765534
2016-10-12T22:01:30
2016-10-12T22:01:30
70,745,845
0
0
null
null
null
null
UTF-8
Java
false
false
404
java
/** * */ package edu.jhu.cs.pl.group18.CurseOfMalphamond.Exception; /** * Call this exception when player number reaches maximum. * @author Yunlong * */ public class PlayerFullException extends Exception { /** * */ private static final long serialVersionUID = 1L; @Override public String getMessage() { return "Players number reaches 4 - WE ARE FULL."; } }
[ "kaikulimu@gmail.com" ]
kaikulimu@gmail.com
c448b659fad5d5676531861a8ab7f01efcfe0938
d8a7e7a700cc587d89107a6a2cd8ffb9baddc116
/app/src/main/java/com/example/paturrachman/oceanwise4u/_sliders/SliderPagerAdapter.java
468c07f86df0de4da2650e72e84df61d08700730
[]
no_license
paturrachman/oceanwise4u
ebe8e5567ce29c596c88f25721e0381e2728c71e
5a67853aa181f01d40dc31bfbe3d827634dcf23f
refs/heads/master
2021-06-28T22:04:47.373094
2017-09-15T17:59:22
2017-09-15T17:59:22
103,234,089
0
0
null
null
null
null
UTF-8
Java
false
false
892
java
package com.example.paturrachman.oceanwise4u._sliders; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentStatePagerAdapter; import java.util.ArrayList; import java.util.List; /** * Created by bagicode on 12/04/17. */ public class SliderPagerAdapter extends FragmentStatePagerAdapter { private static final String TAG = "SliderPagerAdapter"; List<Fragment> mFrags = new ArrayList<>(); public SliderPagerAdapter(FragmentManager fm, List<Fragment> frags) { super(fm); mFrags = frags; } @Override public Fragment getItem(int position) { int index = position % mFrags.size(); return FragmentSlider.newInstance(mFrags.get(index).getArguments().getString("params")); } @Override public int getCount() { return Integer.MAX_VALUE; } }
[ "patur0857@gmail.com" ]
patur0857@gmail.com
f76efb0d06db41136237192e918bcf265596d9aa
37645ba4feec75e74fbd8d6940b644d840d56f54
/trunk/src/gtdmanager/gui/TreeView.java
ee00f9f86f41b05e20f9bbe670cd5d552d1109e7
[]
no_license
BackupTheBerlios/gtdm-svn
4ca3cb31b4bd01c7f9acdd453b3a7c8b0dac38dc
c4e6d23e9ff0525fa4b719e9f278537589671e1c
refs/heads/master
2016-09-11T11:58:24.287479
2005-07-14T11:26:15
2005-07-14T11:26:15
40,607,694
0
0
null
null
null
null
UTF-8
Java
false
false
3,542
java
/* gtdmanager/gui/TreeView * * {{{ package / imports */ package gtdmanager.gui; import gtdmanager.core.*; import javax.swing.JTree; import javax.swing.JComponent; import javax.swing.tree.*; import javax.swing.event.*; import java.util.*; /* }}} */ /** * <p>Title: TreeView class</p> * * <p>Description: </p> * * <p>Copyright: Copyright (c) 2005</p> * * @author Tomislav Viljetić * @version 1.0 * {{{ TreeView */ public class TreeView extends JTree implements View, TreeSelectionListener { MainWindow parent = null; //DefaultMutableTreeNode top; // JProject project = null; // JInstance instance = null; TreeView(MainWindow parent) { // DefaultMutableTreeNode t = new DefaultMutableTreeNode(); //super(t);//new DefaultMutableTreeNode()); //parent = window; //top = t; //setModel(new DefaultTreeModel( // top = new DefaultMutableTreeNode(), false)); setModel(null); // initialize empty tree //setSelectionModel(EmptySelectionModel.sharedInstance()); //selectionModel.addTreeSelectionListener(selectionRedirector); //setCellRenderer(new DefaultTreeCellRenderer()); //updateUI(); //this.userObject = top = new DefaultMutableTreeNode(); //this.allowsChildren = true; this.parent = parent; addTreeSelectionListener(this); } public void valueChanged(TreeSelectionEvent e) { DefaultMutableTreeNode n = (DefaultMutableTreeNode) e.getPath().getLastPathComponent(); if (n != null) { parent.setSelection(n.getUserObject()); // highlight dependencies: parent.getDiagramView().repaint(); } //System.out.println("selected: " + parent.getSelection()); //System.out.println("id: "+((JActivity)parent.getSelection()).getId()); } public void update(JProject project) { if (project == null) return; // nothing to do DefaultMutableTreeNode top = new DefaultMutableTreeNode(); setModel(new DefaultTreeModel(top, false)); //top.removeAllChildren(); top.setUserObject(project); ListIterator l = project.getInstances().listIterator(); while (l.hasNext()) { JInstance i = (JInstance)l.next(); DefaultMutableTreeNode n = new DefaultMutableTreeNode(i); top.add(n); //System.out.println("TreeView: " + i); ListIterator m = i.getActivities().listIterator(); while (m.hasNext()) updateActivity(n, (JActivity)m.next()); } // expand complete tree int row = 0; while (row < getRowCount()) expandRow(row++); //updateUI(); } private void updateActivity(DefaultMutableTreeNode top, JActivity act) { DefaultMutableTreeNode n = new DefaultMutableTreeNode(act); top.add(n); //System.out.println("TreeView: " + act); /*try { if (((JActivity)parent.getSelection()).getId() == act.getId()) { TreePath p[] = n.getPath(); for (int i = 0; i < p.length; i++) expandPath(p[i]); } } catch (Exception e) {}*/ ArrayList subacts = act.getActivities(); if (subacts != null) { ListIterator i = subacts.listIterator(); while (i.hasNext()) updateActivity(n, (JActivity)i.next()); } } } /* }}} * * vim:ts=4:sts=4:sw=4:et:fdm=marker **/
[ "viljettv@a0056d20-8df8-0310-9d4a-ada3a0c07b49" ]
viljettv@a0056d20-8df8-0310-9d4a-ada3a0c07b49
e6e56eb1cc5171f8ecc40e2ba0fc6f80061f00fe
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/spring-projects--spring-framework/47e141675f7a46f308beb606d8948475250b0528/after/HandshakeInfo.java
21b388f4c987957c2849ceeebb49ca5911ad0650
[]
no_license
fracz/refactor-extractor
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
dd5e82bfcc376e74a99e18c2bf54c95676914272
refs/heads/master
2021-01-19T06:50:08.211003
2018-11-30T13:00:57
2018-11-30T13:00:57
87,353,478
0
0
null
null
null
null
UTF-8
Java
false
false
2,053
java
/* * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.web.reactive.socket; import java.net.URI; import java.security.Principal; import reactor.core.publisher.Mono; import org.springframework.http.HttpHeaders; import org.springframework.util.Assert; /** * Simple container of information related to the handshake request that started * the {@link WebSocketSession} session. * * @author Rossen Stoyanchev * @since 5.0 * @see WebSocketSession#getHandshakeInfo() */ public class HandshakeInfo { private final URI uri; private final HttpHeaders headers; private final Mono<Principal> principalMono; public HandshakeInfo(URI uri, HttpHeaders headers, Mono<Principal> principalMono) { Assert.notNull(uri, "URI is required."); Assert.notNull(headers, "HttpHeaders are required."); Assert.notNull(principalMono, "Principal is required."); this.uri = uri; this.headers = headers; this.principalMono = principalMono; } /** * Return the URL for the WebSocket endpoint. */ public URI getUri() { return this.uri; } /** * Return the headers from the handshake HTTP request. */ public HttpHeaders getHeaders() { return this.headers; } /** * Return the principal associated with the handshake HTTP request, if any. */ public Mono<Principal> getPrincipal() { return this.principalMono; } @Override public String toString() { return "HandshakeInfo[uri=" + this.uri + ", headers=" + this.headers + "]"; } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
b893ca0c45c7daaf92c8acf91dda794a8ce2931a
53145fc1f675bca06c3357b43276bfcbc17c37d2
/06知识分享/2017年2月28日-程龙-简单爬虫实现/pac/src/LinkFilter/LinkFilter.java
d5086d3391bc7fe55d9952327af9945ccf0ae180
[]
no_license
yapengsong/documet
65bd65f5ae0c5501830e407484445182dc3f967c
1789f0a60b8b49d06b56f24d0467c7995d534773
refs/heads/master
2021-01-19T21:44:18.087576
2017-04-19T03:05:00
2017-04-19T03:05:00
88,694,060
1
0
null
null
null
null
UTF-8
Java
false
false
99
java
package LinkFilter; public interface LinkFilter { public Boolean accept(String url); }
[ "yapeng.song@eayun.com" ]
yapeng.song@eayun.com
6d378ad690810de28389850e2858277694b9bfa0
8714ee0d6de1c14d9e6e39f5e57b53fc8c308037
/ejb/src/main/java/com/ivan/nc/shortenedlinksservice/interfaces/StatisticsService.java
6f186f8e8de5956321616b60fa0b0bd7d44ef52f
[]
no_license
Imaisen17/NC_Project
30e3de27088d49838d6c029a378e5a7f9c7af6ee
2a1a8309af82ac09dbe19f13dbb56267fac75b40
refs/heads/master
2023-04-19T04:50:59.794410
2021-03-30T21:04:46
2021-03-30T21:04:46
362,824,604
0
0
null
null
null
null
UTF-8
Java
false
false
513
java
package com.ivan.nc.shortenedlinksservice.interfaces; import com.ivan.nc.shortenedlinksservice.entity.Statistics; import java.sql.SQLException; import java.util.Date; import java.util.List; public interface StatisticsService { List<Statistics> getAllStatByAuthorId(int authorId) throws SQLException; List <Statistics> getAllStatByRef(String shortRef) throws SQLException; List<Statistics> getAll() throws SQLException; void createStat(int idAuthor, String refShortAdr, int numbOfTrans); }
[ "ivan.maiseyenka@gmail.com" ]
ivan.maiseyenka@gmail.com
e94016aa19f0eef1551fa76c3909f914966cbe9b
6984dee463823432317a437a57142ffa02f0e186
/Code/WeddingTracker/src/main/java/com/defrainphoto/weddingtracker/model/Location.java
28ec097b70e9a57abb3cedc84acbf56572788395
[]
no_license
paulsbunion/WeddingTracker
3d440a8a590f1999663197d5c332e8a6560e47e8
a99369848ca984659a1111a716d778ae389c8c02
refs/heads/master
2021-01-01T18:31:31.716967
2017-09-29T02:43:09
2017-09-29T02:43:09
98,356,402
0
0
null
null
null
null
UTF-8
Java
false
false
2,453
java
package com.defrainphoto.weddingtracker.model; import java.io.Serializable; import javax.validation.constraints.Size; import org.hibernate.validator.constraints.NotEmpty; //import javax.validation.constraints.NotNull; public class Location implements Serializable{ private String locationId; @NotEmpty private String city; @NotEmpty private String state; @NotEmpty private String zip; @NotEmpty private String street; private String description; public Location() {}; public Location(String locationId, String street, String city, String state, String zip, String description) { this.locationId = locationId; this.city = city; this.state = state; this.zip = zip; this.street = street; this.description = description; }; public String getLocationId() { return locationId; } // @NotNull public void setLocationId(String locationId) { this.locationId = locationId; } public String getCity() { return city; } // @NotNull public void setCity(String city) { this.city = city; } public String getState() { return state; } // @NotNull public void setState(String state) { this.state = state; } public String getZip() { return zip; } // @NotNull public void setZip(String zip) { this.zip = zip; } public String getStreet() { return street; } // @NotNull public void setStreet(String street) { this.street = street; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((locationId == null) ? 0 : locationId.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Location other = (Location) obj; if (locationId == null) { if (other.locationId != null) return false; } else if (!locationId.equals(other.locationId)) return false; return true; } @Override public String toString() { String space = ""; if (description != null && description.length() > 0) { space = ", "; } return "" + street + ", " + city + ", " + state + ", " + zip + space + description; } public String toGoogleMapString() { return ("" + street + "+" + city + "+" + state + "+" + zip).replace(" ", "+"); } }
[ "defrain.3@gmail.com" ]
defrain.3@gmail.com
267df1470877c304b50fd5b0c51fba21f345404c
792da67479197475488b508e6a5ab525f4772c1d
/14_spring_security/baitap/bai1/src/main/java/com/codegym/services/impl/CategoryService.java
1e0e440dd24b601729e5b67e94829c72bad58846
[]
no_license
wanerbros9/C0421G1_NguyenThanhLam_Module4
18905840f2b8bc6fece5b3b3a107c8da4370362e
1ec22201b2fae6c1c421f12886cfbb25736b13b7
refs/heads/main
2023-08-14T18:17:11.108511
2021-09-28T02:07:30
2021-09-28T02:07:30
397,881,490
0
0
null
null
null
null
UTF-8
Java
false
false
706
java
package com.codegym.services.impl; import com.codegym.model.Category; import com.codegym.repository.CategoryRepository; import com.codegym.services.ICategoryService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.transaction.Transactional; import java.util.List; @Service @Transactional public class CategoryService implements ICategoryService { @Autowired CategoryRepository categoryRepository; @Override public List <Category> findAll() { return this.categoryRepository.findAll(); } @Override public void save(Category category) { this.categoryRepository.save(category); } }
[ "49389939+wanerbros9@users.noreply.github.com" ]
49389939+wanerbros9@users.noreply.github.com
e95df595607da2199a05a0df72a4d9c1650f0876
1201987943b0c83260b6fe0f17ed6a2eb4c4183d
/dal-jdbc/src/main/java/org/unidal/dal/jdbc/test/TableSchemaBuilder.java
da80649ff1a65a250b37b8df73557fbd7596b657
[]
no_license
yiming187/frameworks
0e51835b33729a43da7adf2c10482c96e047c17f
5b0d09b9705d316caeaa7fe5eb40a63badafadef
refs/heads/master
2023-06-27T19:04:34.033136
2022-06-26T02:10:57
2022-06-26T02:10:57
49,052,791
0
0
null
2016-01-05T08:32:52
2016-01-05T08:32:52
null
UTF-8
Java
false
false
3,629
java
package org.unidal.dal.jdbc.test; import java.util.ArrayList; import java.util.List; import org.unidal.dal.jdbc.test.meta.entity.EntityModel; import org.unidal.dal.jdbc.test.meta.entity.MemberModel; import org.unidal.dal.jdbc.test.meta.entity.PrimaryKeyModel; import org.unidal.dal.jdbc.test.meta.transform.BaseVisitor2; import org.unidal.helper.Splitters; import org.unidal.lookup.annotation.Named; @Named(instantiationStrategy = Named.PER_LOOKUP) public class TableSchemaBuilder extends BaseVisitor2 { private List<String> m_statements = new ArrayList<String>(); private StringBuilder m_sb; public List<String> getStatements() { return m_statements; } private String guessType(MemberModel member) { String type = member.getValueType(); Integer len = member.getLength(); if ("int".equals(type)) { return String.format("int(%s)", len); } else if ("long".equals(type)) { return "bigint"; } else if ("double".equals(type)) { return "double"; } else if ("String".equals(type)) { if (len == 2147483647) { return "longtext"; } else if (len == 16777215) { return "mediumtext"; } else if (len == 65535) { return "text"; } return String.format("varchar(%s)", len); } else if ("Date".equals(type)) { return "datetime"; } else if ("byte[]".equals(type)) { if (len == 2147483647) { return "longblob"; } else if (len == 16777215) { return "mediumblob"; } else if (len == 65535) { return "blob"; } } throw new IllegalStateException("Unable to guest field type for " + type + "!"); } private String quote(String field) { return "`" + field + "`"; } private String quotes(String fieldList) { List<String> fields = Splitters.by(',').trim().split(fieldList); StringBuilder sb = new StringBuilder(32); for (String field : fields) { if (sb.length() > 0) { sb.append(", "); } sb.append("`").append(field).append("`"); } return sb.toString(); } private void trimComma() { int len = m_sb.length(); if (len >= 3) { char ch0 = m_sb.charAt(len - 3); char ch1 = m_sb.charAt(len - 2); char ch2 = m_sb.charAt(len - 1); if (ch0 == ',' && ch1 == '\r' && ch2 == '\n') { m_sb.setCharAt(len - 3, ch1); m_sb.setCharAt(len - 2, ch2); m_sb.setLength(len - 1); } } } @Override protected void visitEntityChildren(EntityModel entity) { m_sb = new StringBuilder(1024); m_sb.append("CREATE TABLE ").append(quote(entity.getTable())).append(" (\r\n"); super.visitEntityChildren(entity); trimComma(); m_sb.append(") ENGINE=InnoDB DEFAULT CHARSET=utf8;\r\n"); m_statements.add(m_sb.toString()); } @Override protected void visitMemberChildren(MemberModel member) { m_sb.append(" ").append(quote(member.getField())).append(" "); m_sb.append(guessType(member)); if (member.isNullable()) { m_sb.append(" DEFAULT NULL"); } else { m_sb.append(" NOT NULL"); } if (member.isAutoIncrement()) { m_sb.append(" AUTO_INCREMENT"); } m_sb.append(",\r\n"); } @Override protected void visitPrimaryKeyChildren(PrimaryKeyModel primaryKey) { m_sb.append(" PRIMARY KEY ("); m_sb.append(quotes(primaryKey.getMembers())); m_sb.append("),\r\n"); } }
[ "qmwu2000@gmail.com" ]
qmwu2000@gmail.com
7b2302043761dcb18dafd486d85d4d7f09043863
419a9860a9a1f07a4073141f9cfc32feb60aa9f3
/apidoclet-core/src/main/java/org/apidoclet/core/spi/http/HttpRequestBodyResolver.java
3ca04de20520b9bd97599539c8d90ad6b8310542
[]
no_license
hwtl/apidoclet
01efbbf3c2a73fbf069da8fba4839449b362a807
f111210eb3e8e0a00618c61db7c364e1d459e6ec
refs/heads/master
2021-01-24T08:33:37.255940
2017-06-05T02:34:48
2017-06-05T02:34:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
734
java
package org.apidoclet.core.spi.http; import org.apidoclet.core.ApiDocletOptions; import org.apidoclet.model.RequestBody; import com.sun.javadoc.Parameter; /** * 解析方法参数的PathVariable */ public interface HttpRequestBodyResolver { /** * 是否支持此种参数的解析 * * @author huisman */ boolean support(Parameter parameter, ApiDocletOptions options); /** * 解析请求体 * * @author huisman * @param Parameter 参数信息的javadoc描述 * @param options 命令行参数 * @param typeResolver 类型信息解析,nerver null */ public RequestBody resolve(TypeInfoResolver typeResolver, Parameter parameter, String paramComment, ApiDocletOptions options); }
[ "potent6@aliyun.com" ]
potent6@aliyun.com
2c718a571e64fcfe8aab2e68d09fc2ebbbe31859
282224fefee490bca121542382b0b2fea8ccc6fa
/src/com/leetcode/threeFourHundred/reverseVowelsOfString/TestReverseVowelsString.java
32f8768bdafb468b96394e1f55d850888879b5b4
[]
no_license
wanhao838088/Leetcode
4f40a7b9246454e4feecb412b8f5943660dd12f2
6197167b19c38e00b4911d25b6c905def65663ef
refs/heads/master
2021-07-20T12:52:40.026973
2020-06-29T02:41:22
2020-06-29T02:41:22
186,771,264
0
1
null
null
null
null
UTF-8
Java
false
false
2,569
java
package com.leetcode.threeFourHundred.reverseVowelsOfString; import java.util.Arrays; import java.util.List; /** * Created by LiuLiHao on 2019/6/27 0027 下午 03:25 * @author : LiuLiHao * 描述: *编写一个函数,以字符串作为输入,反转该字符串中的元音字母。 * * 示例 1: * * 输入: "hello" * 输出: "holle" * 示例 2: * * 输入: "leetcode" * 输出: "leotcede" * 说明: * 元音字母不包含字母"y"。 */ public class TestReverseVowelsString { public static void main(String[] args) { String s = "a."; String vowels = reverseVowels(s); System.out.println(vowels); } public static String reverseVowels(String s) { if (s==null || s.equals("")){ return s; } Character[] chs = {'a','e','i','o','u','A','E','I','O','U'}; List<Character> list = Arrays.asList(chs); char[] charArray = s.toCharArray(); int i=0,j=s.length()-1; char temp; while (i<=j){ //找到i的元音字母位置 while (i<=j && !list.contains(s.charAt(i))){ i++; } //找到j的元音字母位置 while (i<=j && !list.contains(s.charAt(j))){ j--; } if(i<=j){ temp = charArray[i]; charArray[i] = charArray[j]; charArray[j] = temp; i++; j--; } } return new String(charArray); } // public static String reverseVowels(String s) { // if (s==null || s.equals("")){ // return s; // } // int index=0; // LinkedList<Integer> linkedList = new LinkedList<>(); // //获取所有元音下标 // while (index<s.length()){ // char c = s.charAt(index); // if (c=='a'||c=='e'||c=='i'||c=='o'||c=='u'|| // c=='A'||c=='E'||c=='I'||c=='O'||c=='U'){ // linkedList.add(index); // } // index++; // } // int len = linkedList.size(); // StringBuilder sb = new StringBuilder(s); // //交换位置 // for (int i = 0; i < len/2; i++) { // int start = linkedList.get(i); // int end = linkedList.get(len-(i+1)); // char sc = s.charAt(start); // char sd = s.charAt(end); // sb.replace(start,start+1,sd+""); // sb.replace(end,end+1,sc+""); // } // // return sb.toString(); // } }
[ "838088516@qq.com" ]
838088516@qq.com
f6c2fb0594815cc1dcee78ce3b87a2b334fb0a1e
7afb137677473c0b9719da1b9e1a07b2929aee82
/branches/pre-0.3/src/main/java/org/javageek/katalogo/dao/impl/AbstractBasicHibernateDao.java
ed968f814fcb4238f8e45f5bbdc5e2dd4ff6043b
[]
no_license
javageek/katalogo
3bb3a2f7a40e13eef7ef1d6cacd949d09b09fd34
fad5b7a4406b3100e241cb9a520b8782306686ff
refs/heads/master
2021-01-19T05:38:50.305617
2006-08-24T23:20:28
2006-08-24T23:20:28
32,344,159
0
0
null
null
null
null
UTF-8
Java
false
false
2,518
java
package org.javageek.katalogo.dao.impl; import java.util.List; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.SessionFactory; public class AbstractBasicHibernateDao<T> { private static final Log log = LogFactory.getLog(AbstractBasicHibernateDao.class); private Class _clazz; private SessionFactory sessionFactory; /** * Construct. * * @param clazz */ public AbstractBasicHibernateDao(final Class clazz) { try { _clazz = Class.forName(getClass().getGenericSuperclass().toString().split("[<>]")[1]); } catch(ClassNotFoundException e) { log.error(e.getMessage(), e); throw new RuntimeException(e.getMessage()); } } public void save(final T obj) { getSession().saveOrUpdate(obj); } @SuppressWarnings("unchecked") public T load(final long id) { return (T)getSession().get(_clazz, id); } @SuppressWarnings("unchecked") public T merge(final T obj) { return (T)getSession().merge(obj); } public void delete(final T obj) { getSession().delete(obj); } public void detach(final T obj) { getSession().evict(obj); } public void flush() { getSession().flush(); } protected Session getSession() { return sessionFactory.getCurrentSession(); } public SessionFactory getSessionFactory() { return sessionFactory; } public void setSessionFactory(final SessionFactory factory) { sessionFactory = factory; } protected Query createQuery(final String queryString) { return getSession().createQuery(queryString); } protected Query createQuery(final String hql, final Object... params) { final Query q = createQuery(hql); for(int i = 0; i < params.length; i++) { q.setParameter(i, params[i]); } return q; } @SuppressWarnings({"unchecked"}) protected List<T> list(final String name) { return (List<T>)getSession().getNamedQuery(name).list(); } @SuppressWarnings({"unchecked"}) protected List<T> list(final String name, final Object... params) { final Query query = getSession().getNamedQuery(name); for(int i = 0; i < params.length; i++) { query.setParameter(i, params[i]); } return (List<T>)query.list(); } }
[ "guillermo.castro@1400c883-9719-0410-8cb2-bf74317c8d72" ]
guillermo.castro@1400c883-9719-0410-8cb2-bf74317c8d72
caf89ecdffad2505bfc461f007f437acf670be04
bba23b735621be5f5ca65b4de5f09be787f22cce
/src/java/arch/actions/ros/RetryInitServices.java
0cda9bbd2e7252fdf1f0324a8abbb2f8cd930ce8
[]
no_license
LAAS-HRI/MuMMER_supervisor
c3d099a9dc65c9cc92cdea871985ec87721227ac
a2b54522ac2a9d7546444d3577251fbdec777ef2
refs/heads/master
2020-12-26T05:14:57.978659
2020-01-17T17:00:21
2020-01-17T17:00:21
237,396,232
0
0
null
null
null
null
UTF-8
Java
false
false
1,581
java
package arch.actions.ros; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.Map.Entry; import java.util.Set; import arch.actions.AbstractAction; import arch.agarch.AbstractROSAgArch; import jason.asSemantics.ActionExec; import jason.asSemantics.Unifier; import jason.asSyntax.Atom; import jason.asSyntax.Literal; import jason.asSyntax.LogicalFormula; import jason.asSyntax.Term; public class RetryInitServices extends AbstractAction { public RetryInitServices(ActionExec actionExec, AbstractROSAgArch rosAgArch) { super(actionExec, rosAgArch); setSync(true); } @Override public void execute() { actionExec.setResult(true); LogicalFormula logExpr = Literal.parseLiteral("~connected_srv(X)"); Iterator<Unifier> iu = logExpr.logicalConsequence(rosAgArch.getTS().getAg(), new Unifier()); Set<String> list = new HashSet<String>(); Term var = Literal.parseLiteral("X"); while (iu.hasNext()) { Term term = var.capply(iu.next()); list.add(term.toString()); } HashMap<String, Boolean> services_status = rosnode.retryInitServiceClients(list); for(Entry<String, Boolean> entry : services_status.entrySet()) { if(entry.getValue()) { rosAgArch.addBelief("connected_srv("+entry.getKey()+")"); rosAgArch.removeBelief("~connected_srv("+entry.getKey()+")"); }else { rosAgArch.addBelief("~connected_srv("+entry.getKey()+")"); actionExec.setResult(false); actionExec.setFailureReason(new Atom("srv_not_connected"), "Some services are not connected"); } } } }
[ "15892716+amdia@users.noreply.github.com" ]
15892716+amdia@users.noreply.github.com
d196616a9aaa7d43d22e2152698745ee8d5dd960
3d5b73cd1f2f124a27fb0e156eb1ee2dddc4b881
/app/src/androidTest/java/com/example/ankit/powwow/ExampleInstrumentedTest.java
a9ec2a9b068ac0490d273d061ac4131239adf3e7
[]
no_license
ankit5000/powwow
b5b25d2a875524817d009691e02636b81fd012fc
f8fb1477d88517b54c298f54fc3f29ac854ba8b8
refs/heads/master
2021-03-27T10:34:40.447553
2017-03-31T12:50:55
2017-03-31T12:50:55
84,988,723
1
0
null
null
null
null
UTF-8
Java
false
false
752
java
package com.example.ankit.powwow; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumentation test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.ankit.powwow", appContext.getPackageName()); } }
[ "ankit5000@ymail.com" ]
ankit5000@ymail.com
7fb37bdf7631931f537a0fee25cb72eba202ef2c
1cc41aef9bd36b7ff3245faac79adb569c65a0cf
/java/hibernate/spring-hibernate/src/main/java/org/javabrains/koushks31/projections_and_query_by_example/UserDetails.java
b3c1cfcd2e0d6c6b7e02d20479a8fd1f2638ea7d
[]
no_license
seungbeomi/development
fca4d350b31fefd56a9517bcc8c49ea39d6af19e
11c1c6c9f2ec522ce9e90808e1b0876eff5039df
refs/heads/master
2023-03-10T17:57:07.819034
2022-02-16T15:18:39
2022-02-16T15:18:39
1,160,501
2
3
null
2023-03-07T09:08:19
2010-12-12T08:10:56
Java
UTF-8
Java
false
false
440
java
package org.javabrains.koushks31.projections_and_query_by_example; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; import lombok.Data; @Data @Entity @Table(name="USER_DETAILS") public class UserDetails { @Id @GeneratedValue(strategy=GenerationType.AUTO) private int userId; private String userName; }
[ "seungbeomi@gmail.com" ]
seungbeomi@gmail.com
9979052ac843f9a0936ab10500ef449c32b95867
f68d2b3cd28f549e2702edcb31e6f8cd4fddd504
/src/ims/crawler/cache/ApplicationContextFactory.java
86fcda9140a808f411278a264d42351dfdce4d5b
[]
no_license
Ailab403/iiimmsNLPerModule
c850817908433ed917643e6646ef00df81633aa8
cfd9ece03b704705a45229310b45c6dfeb17e689
refs/heads/master
2016-09-10T15:29:19.491942
2014-09-29T13:14:58
2014-09-29T13:14:58
null
0
0
null
null
null
null
GB18030
Java
false
false
439
java
package ims.crawler.cache; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; public class ApplicationContextFactory { // 全局通用的applicationContext public static ApplicationContext appContext; // 静态程序块一次性初始化 static { appContext = new ClassPathXmlApplicationContext( "applicationContext.xml"); } }
[ "AiLab_superhy@superhy-PC" ]
AiLab_superhy@superhy-PC
445456234c4c20c450c62e5db9f46a571e0c2c36
1a24c61136a19c0677f73a27eae11752a0072e5c
/SpringBootApplication/src/main/java/com/demo/dto/Constants.java
072476270aaf9857663d3f64318bf3768e3b9e58
[]
no_license
JaeTutorials/ReactJS_SpringBoot2
05571b7342dbe420f50cddba901ce873d5581e49
b667cf67caf0715de1a579bd1f33ee0a34e570fb
refs/heads/main
2023-01-01T01:34:49.064740
2020-10-18T16:29:33
2020-10-18T16:29:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
306
java
package com.demo.dto; public class Constants { public static final long ACCESS_TOKEN_VALIDITY_SECONDS = 5 * 60 * 60; public static final String SIGNING_KEY = "devglan123r"; public static final String TOKEN_PREFIX = "Bearer "; public static final String HEADER_STRING = "Authorization"; }
[ "noreply@github.com" ]
noreply@github.com
627b666de10bf3aeeb2a72ee6a0076281102a644
6829b3fa032014e0f0dde844676b51d44671ced8
/文档/oop/JO02/上课案例/src/com/c/Math.java
7df59c3b2ffad73e0b46631602c2476c00e6c928
[]
no_license
whyza/JavaLearning
da7076b2d39b2ae3c45cb3c41e118a677e35b3fc
656bd6cde896b0e242076a59dd82dcad18392fd0
refs/heads/master
2021-09-09T07:38:53.299736
2018-03-14T08:44:43
2018-03-14T08:44:43
112,844,640
0
0
null
null
null
null
UTF-8
Java
false
false
313
java
package com.c; public class Math { public int add(int a,int b){ return a+b; } public double add(){ return 0; } public int add(int a){ return 0; } public double add(double a,double b){ return a+b; } public void fuck(String a,int b){ } public void fuck(int a,String b){ } }
[ "892903912@qq.com" ]
892903912@qq.com
4b8a2b721c8a1fd0993241666d868e174b93ba14
eadbd6ba5a2d5c960ffa9788f5f7e79eeb98384d
/src/com/tinder/views/m.java
8f9d6ed04584bc4a5e63eaadfc6a885c5cde0067
[]
no_license
marcoucou/com.tinder
37edc3b9fb22496258f3a8670e6349ce5b1d8993
c68f08f7cacf76bf7f103016754eb87b1c0ac30d
refs/heads/master
2022-04-18T23:01:15.638983
2020-04-14T18:04:10
2020-04-14T18:04:10
255,685,521
0
0
null
2020-04-14T18:00:06
2020-04-14T18:00:05
null
UTF-8
Java
false
false
3,225
java
package com.tinder.views; import android.view.MotionEvent; import android.view.VelocityTracker; import android.view.View; import android.view.View.OnTouchListener; import com.tinder.utils.q; public class m implements View.OnTouchListener { private a a; private VelocityTracker b; private float c; private float d; private float e; private float f; private float g; private float h; private float i; private float j; private float k; private float l; private float m; private float n; private int o; public m(a parama) { a = parama; } public float a() { return l; } public void a(float paramFloat) { k = paramFloat; } public float b() { return c; } public void b(float paramFloat) { m = paramFloat; } public float c() { return e; } public void c(float paramFloat) { l = paramFloat; o = ((int)(0.4F * paramFloat)); } public float d() { return f; } public float e() { return g; } public float f() { return h; } public float g() { return i; } public float h() { return j; } public boolean onTouch(View paramView, MotionEvent paramMotionEvent) { switch (paramMotionEvent.getActionMasked()) { } for (;;) { return true; if (paramMotionEvent.getPointerCount() == 1) { c = paramMotionEvent.getRawX(); e = paramMotionEvent.getRawY(); b = VelocityTracker.obtain(); continue; if (b == null) { b = VelocityTracker.obtain(); } b.computeCurrentVelocity(1); i = b.getXVelocity(); d = paramMotionEvent.getRawX(); f = paramMotionEvent.getRawY(); g = (paramMotionEvent.getRawX() - c); h = (paramMotionEvent.getRawY() - e); if (((Math.abs(i) >= k) && (Math.abs(g) > o)) || (Math.abs(g) > l)) { q.a("swipe detected"); a.a(g, h, i, j, true, false, false); b.recycle(); b = null; } else { q.a("not swipe detected"); if (Math.hypot(g, h) <= m) {} for (boolean bool = true;; bool = false) { a.a(g, h, i, j, false, true, bool); break; } if (b == null) { b = VelocityTracker.obtain(); } b.addMovement(paramMotionEvent); g = (paramMotionEvent.getRawX() - c); h = (paramMotionEvent.getRawY() - e); n = Math.min(1.0F, Math.abs(g) / l); a.b(n, g, h, i, j); return true; if (b != null) { b.recycle(); b = null; } } } } } public static abstract interface a { public abstract void a(float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4, boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3); public abstract void b(float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4, float paramFloat5); } } /* Location: * Qualified Name: com.tinder.views.m * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "reverseengineeringer@hackeradmin.com" ]
reverseengineeringer@hackeradmin.com
cb3c0ad9a97fc6166dc7cb148f720dfa88de309c
4181dc0348a00fb97b7e13ebfc299fd0847c3e24
/src/AccountManagerUtil/src/test/java/org/cote/accountmanager/util/TestWTPAType.java
639c18729c68fcee8f5f9939cf31abd6204869a0
[]
no_license
fuyunkh/AccountManager
185592c41b6ae77d3fe1621c43ddf4208cf9f770
1d1f504b602933a67df30c8427e675e699c6cc13
refs/heads/master
2020-12-30T12:22:57.286588
2017-02-25T20:14:05
2017-02-25T20:14:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
9,858
java
package org.cote.accountmanager.util; import static org.junit.Assert.assertTrue; import java.security.Security; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.cote.accountmanager.beans.SecurityBean; import org.cote.accountmanager.factory.SecurityFactory; import org.cote.accountmanager.objects.WTPAType; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.w3c.dom.Document; public class TestWTPAType { public static final Logger logger = LogManager.getLogger(TestWTPAType.class); @Before public void setUp() throws Exception { Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider()); } @After public void tearDown() throws Exception { } @Test public void testDecryptRemoteValue(){ String key_source = "<?xml version=\"1.0\"?><SecurityManager><public><key><![CDATA[PFJTQUtleVZhbHVlPjxNb2R1bHVzPm5kM2xxMUszVWk1SHc5bnZ0YVd3MVp1eU1sUkJYZHkvVGNWZ0VQaUxzZThwMmRoN3VPUDg4VGVyUjc5NWFwTXJEYmFOQTJleW5ndk9seDUrYWtpWmdMTGtJYTVZVXlvMFZmVnZ3UnU4dm5lb2NSaUluUUIyTUY3THhhUjdRckkxclhIaGhiaHFtaW1wZnYxaE1vbmV3cmZ2WkJIZGt4N3BSLzNCK0FuVGRZaz08L01vZHVsdXM+PEV4cG9uZW50PkFRQUI8L0V4cG9uZW50PjwvUlNBS2V5VmFsdWU+]]></key></public><private><key><![CDATA[PFJTQUtleVZhbHVlPjxNb2R1bHVzPm5kM2xxMUszVWk1SHc5bnZ0YVd3MVp1eU1sUkJYZHkvVGNWZ0VQaUxzZThwMmRoN3VPUDg4VGVyUjc5NWFwTXJEYmFOQTJleW5ndk9seDUrYWtpWmdMTGtJYTVZVXlvMFZmVnZ3UnU4dm5lb2NSaUluUUIyTUY3THhhUjdRckkxclhIaGhiaHFtaW1wZnYxaE1vbmV3cmZ2WkJIZGt4N3BSLzNCK0FuVGRZaz08L01vZHVsdXM+PEV4cG9uZW50PkFRQUI8L0V4cG9uZW50PjxQPnlTaE1mRWd2Z21tRHgrYkxoSHdXUUtqQXRTQVdlWnJrU2xESUN0OU1hdTlBWmlJOXJ1Z2ZzcG5ueDZaNnRMWEFTWjNKc2xmUXVtNmZoWmFqOTRBbzhRPT08L1A+PFE+eU9nbGFIZjI2amN2dE9RVXlwQ0E2c3JXSVYzbUVEd3lwcjF0Uk5OUU83cGxxTEUvVmdGMnpVWnlxSm1GQnhYMnh2MHZiaTlVS0ZyM3BmOXlyWGJXR1E9PTwvUT48RFA+R0U4MmJ3NktMMGh4RklkZnNQTU4vV0puWjN3cE95anN6YzVWWG5yOTBTNTRxZDhaZFRtNEd1MWVoVklwSWcyVTMxQ2lQMXM5YmtwUUhPVEhpL0dCQVE9PTwvRFA+PERRPmRxeHFMR053ZnJsS2ZOZWRVR283UEhYRU5zRjRmRzZTbk51WUIrZXFwUjFkbjEvVHdjSHJveVhSNUxXS1ZyMHFvREErTEIvWTNsMmRtM2hoRFFYOVFRPT08L0RRPjxJbnZlcnNlUT51d1l1UkJ2bGlrK3h0dG1TL3V0WTZKOHV0Qnh6cWZpRGRvdXlpelBzSStuWCtMbDNiNUQ0VE13Z2VQV2I5UXVKMXVWUmhITXFCSk9FdXpmWElqdE5NQT09PC9JbnZlcnNlUT48RD5kUWNWQmU4NHRQUllBUWtqV1U0dUMvdnltcnE1Qm1McGNqYTZJM3FNM0dnR1oxYkRTT25DRGZPTnhvOWI2N1NUZXdQei95MDFUVkpGWU9PYkpTRVNvUnB0c3VmSUpvcVcwaCtMWXBaNmszYzd5dnlnTWhvZGtWVTM3TEhkV0xKQXFRMDJUeDc2cWdPSWQ4OGphQzA2RXk2Rk53NFhXM3E0cDNUMlVJMWJuWUU9PC9EPjwvUlNBS2V5VmFsdWU+]]></key></private><cipher><key><![CDATA[vbTSKZ7ss0AQkC6BFYR/vg==]]></key><iv><![CDATA[BvuxGsOWgFnRGBlbfhDbUQ==]]></iv></cipher></SecurityManager>"; String test_enc = "eJIljc/cXTFj0dAvggZV5SG/ULb2gUfnicisOZDQG7245KLS+YSAdThBZGRzJZz4n0ms9cHnfA0xVuWstIsbZki8rC73WMbKdBmpj+q9BFIx9cU33lb+AxGaMQJpLqLOEzcWc4RE+CHoah5/MsiM9lOGZc51tDA8sCcGvRDbLSNAkZGy8Fy/KOCvNqJMUTQ2KsQSiJeSz7CXYSkZoiU2280dNcy/JlbAeB8xg1J114ccWfqcKDXtDzw0b+ydRb9QSbBk+66f48bHgvillUVQdVJwB2DUMD5l4Jv1pUbDgt3U8EItY3gjcwy8d4zRkRiNJsQrVF4XJSy4sRSXLVD2jFYnUdgY8ttO6/74cg+SA/kzHxA1BKKptxASAI3NQIi4dGSGuvCMpLWEuh3jdPrpRBZUZXxpRTYmRSlAoLcafm+Fdc3HfEWrDFGj4xYG8zlXKiTmvxirmdvaVlHNnrW7COOahYs0EtLh6ouEB6AAgTZrHKCCOwifsoROkQgaM69l8fmxFwA2VVt6q+bBXCJqbNYNlDTPUeWERTvySbbRvN1Q7okc45AEGi32YRwDL3UD"; //"2EfD+suF+QoOYC5+eW4c9S19mpAa5LFU9Yv4acWVQwUJC8y3W2eUcZpqUNAian9bj0lZxVxUKkN9TUbWm+qN9mksRO+32bjYj50hIvRKgmtgO2MN3WIcG2eYwQTcHaIESlSSB5YwNElXXrFcsqJSrnEpEyQvHcKGQJ+K3V7gxAueRPAtqvKe4JahO/xXW1zxRwPnk/kPgDoUz2Vqa24zxj7vycAZG1Re3OKremFNj6g9UXwaN0hsoc5W+nciIsaYbQ9k6PIQM2qjqYUrUa5nUjtGRvNvdZLokbyFAmzzYUK291QTpeM227+4eX5mGv/dEet+sTZYdlq8gRhjVZXOgzKpknsezGyrVmDpN5BLHyfJofYEip7viPGeuSmo0GEHC2T4TO1NlzlXgX3jpxtqz4XXv2645O5iHRusMYaH2HqshFEgRRNyEOEGNVcDgBU1fN6fSyaaFhxzncTNkrLet6KlKZlv31l0nDQTP3RiKj+TUekWVmhFEl9/Wv//0Ed9tTBSdMiJFoJtG9hiBVo7TXRTF37+IYoaaw4G1GmXNC1Rx9rZrJgOtqywMYXOqOFhw8fR1dpUZFbAvOYwdHxTIg=="; /// "hQn6f6C1gsq0wRqxNeaJdT1OK5167VqiA8X4p1S7miVoeFz3Bj6Od8EuHvFjDYdpLlzc/sT8WqXT0X79rseWKMavYox76D3ogIC66ss+ng5yGPfuzhrtMUw/1TageFqsWytYBsWn33iZYHiutsUllcGWJZgomVYtOza686ikGtTdrLSQp/Nwy1/R0SXJs5mFxzkxw//6KYQYDyqQWZWiL3/NLf+Wy57l+vzR5Ym/iceIjnSt2pL/QVWGVEtljro2z9VCPYVvMNVzrsSDxNY0yoABFl6JblsFZVnr3bNHtMTZovehSiE2CajRP8rzbIupAdmGEod1/j1KkwHvBug8+1HflBdqap0jeDt4vJvi3yPTEZ0p+6LosV3ogtQmNTulwIu/XnWXJZIz9bQv+2xKTNEzrLyQjozL8jRwE1oAg6GEZtB9PbX+9DT/vG7CUbdwDo3IKCMsWzRK/ii8FzNljg5YzQVyyWtmgtj5zyZ9ozMz0SCVwCkFVr8bPSfX31Dp+EqpEy5VjGvhKOR9h/ac6Q=="; SecurityFactory sf = SecurityFactory.getSecurityFactory(); SecurityBean bean = sf.createSecurityBean(key_source.getBytes(), false); //byte[] test_data = BinaryUtil.fromBase64(test_enc.getBytes()); //byte[] test_dec = SecurityUtil.decipher(bean, test_data); WTPAType wtpa = WTPAUtil.decipherWTPA(bean, test_enc); assertTrue("WTPAType is null", wtpa != null); ///logger.info(WTPAUtil.serializeToken(wtpa)); //logger.info("Deciphered data='" + (new String(test_dec))); /* assertTrue("Unable to decipher external data", test_dec.length != 0); VTPA vtpaToken = new VTPA(); boolean parsed = vtpaToken.parseToken(new String(test_dec)); assertTrue("Unable to decode VTPA token", parsed); */ } @Test public void testDecryptRemoteValueWithDoubleSerial(){ String key_source = "<?xml version=\"1.0\"?><SecurityManager><public><key><![CDATA[PFJTQUtleVZhbHVlPjxNb2R1bHVzPm5kM2xxMUszVWk1SHc5bnZ0YVd3MVp1eU1sUkJYZHkvVGNWZ0VQaUxzZThwMmRoN3VPUDg4VGVyUjc5NWFwTXJEYmFOQTJleW5ndk9seDUrYWtpWmdMTGtJYTVZVXlvMFZmVnZ3UnU4dm5lb2NSaUluUUIyTUY3THhhUjdRckkxclhIaGhiaHFtaW1wZnYxaE1vbmV3cmZ2WkJIZGt4N3BSLzNCK0FuVGRZaz08L01vZHVsdXM+PEV4cG9uZW50PkFRQUI8L0V4cG9uZW50PjwvUlNBS2V5VmFsdWU+]]></key></public><private><key><![CDATA[PFJTQUtleVZhbHVlPjxNb2R1bHVzPm5kM2xxMUszVWk1SHc5bnZ0YVd3MVp1eU1sUkJYZHkvVGNWZ0VQaUxzZThwMmRoN3VPUDg4VGVyUjc5NWFwTXJEYmFOQTJleW5ndk9seDUrYWtpWmdMTGtJYTVZVXlvMFZmVnZ3UnU4dm5lb2NSaUluUUIyTUY3THhhUjdRckkxclhIaGhiaHFtaW1wZnYxaE1vbmV3cmZ2WkJIZGt4N3BSLzNCK0FuVGRZaz08L01vZHVsdXM+PEV4cG9uZW50PkFRQUI8L0V4cG9uZW50PjxQPnlTaE1mRWd2Z21tRHgrYkxoSHdXUUtqQXRTQVdlWnJrU2xESUN0OU1hdTlBWmlJOXJ1Z2ZzcG5ueDZaNnRMWEFTWjNKc2xmUXVtNmZoWmFqOTRBbzhRPT08L1A+PFE+eU9nbGFIZjI2amN2dE9RVXlwQ0E2c3JXSVYzbUVEd3lwcjF0Uk5OUU83cGxxTEUvVmdGMnpVWnlxSm1GQnhYMnh2MHZiaTlVS0ZyM3BmOXlyWGJXR1E9PTwvUT48RFA+R0U4MmJ3NktMMGh4RklkZnNQTU4vV0puWjN3cE95anN6YzVWWG5yOTBTNTRxZDhaZFRtNEd1MWVoVklwSWcyVTMxQ2lQMXM5YmtwUUhPVEhpL0dCQVE9PTwvRFA+PERRPmRxeHFMR053ZnJsS2ZOZWRVR283UEhYRU5zRjRmRzZTbk51WUIrZXFwUjFkbjEvVHdjSHJveVhSNUxXS1ZyMHFvREErTEIvWTNsMmRtM2hoRFFYOVFRPT08L0RRPjxJbnZlcnNlUT51d1l1UkJ2bGlrK3h0dG1TL3V0WTZKOHV0Qnh6cWZpRGRvdXlpelBzSStuWCtMbDNiNUQ0VE13Z2VQV2I5UXVKMXVWUmhITXFCSk9FdXpmWElqdE5NQT09PC9JbnZlcnNlUT48RD5kUWNWQmU4NHRQUllBUWtqV1U0dUMvdnltcnE1Qm1McGNqYTZJM3FNM0dnR1oxYkRTT25DRGZPTnhvOWI2N1NUZXdQei95MDFUVkpGWU9PYkpTRVNvUnB0c3VmSUpvcVcwaCtMWXBaNmszYzd5dnlnTWhvZGtWVTM3TEhkV0xKQXFRMDJUeDc2cWdPSWQ4OGphQzA2RXk2Rk53NFhXM3E0cDNUMlVJMWJuWUU9PC9EPjwvUlNBS2V5VmFsdWU+]]></key></private><cipher><key><![CDATA[vbTSKZ7ss0AQkC6BFYR/vg==]]></key><iv><![CDATA[BvuxGsOWgFnRGBlbfhDbUQ==]]></iv></cipher></SecurityManager>"; String test_enc = "eJIljc/cXTFj0dAvggZV5SG/ULb2gUfnicisOZDQG7245KLS+YSAdThBZGRzJZz4n0ms9cHnfA0xVuWstIsbZki8rC73WMbKdBmpj+q9BFIx9cU33lb+AxGaMQJpLqLOEzcWc4RE+CHoah5/MsiM9lOGZc51tDA8sCcGvRDbLSNAkZGy8Fy/KOCvNqJMUTQ2KsQSiJeSz7CXYSkZoiU2280dNcy/JlbAeB8xg1J114ccWfqcKDXtDzw0b+ydRb9QSbBk+66f48bHgvillUVQdVJwB2DUMD5l4Jv1pUbDgt3U8EItY3gjcwy8d4zRkRiNJsQrVF4XJSy4sRSXLVD2jFYnUdgY8ttO6/74cg+SA/kzHxA1BKKptxASAI3NQIi4dGSGuvCMpLWEuh3jdPrpRBZUZXxpRTYmRSlAoLcafm+Fdc3HfEWrDFGj4xYG8zlXKiTmvxirmdvaVlHNnrW7COOahYs0EtLh6ouEB6AAgTZrHKCCOwifsoROkQgaM69l8fmxFwA2VVt6q+bBXCJqbNYNlDTPUeWERTvySbbRvN1Q7okc45AEGi32YRwDL3UD"; Document d = XmlUtil.GetDocumentFromBytes(key_source.getBytes()); assertTrue("Serial document is null", d != null); String pubKey = XmlUtil.FindElementText(d.getDocumentElement(), "public", "key"); assertTrue("Public key not found", pubKey != null); //logger.info("Public key = " + BinaryUtil.fromBase64Str(pubKey.getBytes())); String priKey = XmlUtil.FindElementText(d.getDocumentElement(), "private", "key"); assertTrue("Private key not found", priKey != null); //logger.info("Private key = " + BinaryUtil.fromBase64Str(priKey.getBytes())); String cipKey = XmlUtil.FindElementText(d.getDocumentElement(), "cipher", "key"); String cipIv = XmlUtil.FindElementText(d.getDocumentElement(), "cipher", "iv"); assertTrue("Cipher IV not found", cipIv != null); assertTrue("Cipher Key not found", cipKey != null); SecurityFactory sf = SecurityFactory.getSecurityFactory(); SecurityBean bean = sf.createSecurityBean(key_source.getBytes(), false); assertTrue("Public key is null or empty", (bean.getPublicKeyBytes() != null && bean.getPublicKeyBytes().length > 0)); assertTrue("Private key is null or empty", (bean.getPrivateKeyBytes() != null && bean.getPrivateKeyBytes().length > 0)); assertTrue("Cipher key is null or empty", (bean.getCipherKey() != null && bean.getCipherKey().length > 0)); assertTrue("Cipher IV is null or empty", (bean.getCipherIV() != null && bean.getCipherIV().length > 0)); String serial = SecurityUtil.serializeToXml(bean, true, true, true); ///logger.info("Java Key = " + serial); bean = sf.createSecurityBean(serial.getBytes(), false); byte[] test_data = BinaryUtil.fromBase64(test_enc.getBytes()); byte[] test_dec = SecurityUtil.decipher(bean, test_data); assertTrue("Test data is null or empty",test_dec != null && test_dec.length > 0); WTPAType wtpa = WTPAUtil.decipherWTPA(bean, test_enc); assertTrue("WTPAType is null", wtpa != null); logger.info(WTPAUtil.serializeToken(wtpa)); //logger.info("Deciphered data='" + (new String(test_dec))); /* assertTrue("Unable to decipher external data", test_dec.length != 0); VTPA vtpaToken = new VTPA(); boolean parsed = vtpaToken.parseToken(new String(test_dec)); assertTrue("Unable to decode VTPA token", parsed); */ } }
[ "Steve@cotedesk.local" ]
Steve@cotedesk.local
4577bca5270f500606eb1587edcf2c1f14a7ff54
168b6a85fccfcc79b307acb25e0e1448050de564
/src/main/java/com/itstyle/seckill/web/SeckillController.java
24dbe15d59361f8ba84d4bb38cce0cf8c804af69
[ "Apache-2.0" ]
permissive
neocxf/spring-boot-seckill
7578f22741a1e5d74eb14ecaa70ca83889fe853f
0e1f8bff4bb1ef9168d4469e5a27d3ece9118587
refs/heads/master
2022-07-04T14:33:38.835068
2020-01-21T03:08:51
2020-01-21T03:08:51
235,245,422
0
0
Apache-2.0
2022-06-17T02:53:47
2020-01-21T03:08:24
Java
UTF-8
Java
false
false
9,689
java
package com.itstyle.seckill.web; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import java.util.concurrent.CountDownLatch; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.itstyle.seckill.common.entity.Result; import com.itstyle.seckill.common.entity.SuccessKilled; import com.itstyle.seckill.queue.disruptor.DisruptorUtil; import com.itstyle.seckill.queue.disruptor.SeckillEvent; import com.itstyle.seckill.queue.jvm.SeckillQueue; import com.itstyle.seckill.service.ISeckillService; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; @Api(tags ="秒杀") @RestController @RequestMapping("/seckill") public class SeckillController { private final static Logger LOGGER = LoggerFactory.getLogger(SeckillController.class); private static int corePoolSize = Runtime.getRuntime().availableProcessors(); //创建线程池 调整队列数 拒绝服务 private static ThreadPoolExecutor executor = new ThreadPoolExecutor(corePoolSize, corePoolSize+1, 10l, TimeUnit.SECONDS, new LinkedBlockingQueue<>(1000)); @Autowired private ISeckillService seckillService; @ApiOperation(value="秒杀一(最low实现)",nickname="科帮网") @PostMapping("/start") public Result start(long seckillId){ int skillNum = 10; final CountDownLatch latch = new CountDownLatch(skillNum);//N个购买者 seckillService.deleteSeckill(seckillId); final long killId = seckillId; LOGGER.info("开始秒杀一(会出现超卖)"); /** * 开启新线程之前,将RequestAttributes对象设置为子线程共享 * 这里仅仅是为了测试,否则 IPUtils 中获取不到 request 对象 * 用到限流注解的测试用例,都需要加一下两行代码 */ ServletRequestAttributes sra = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); RequestContextHolder.setRequestAttributes(sra, true); for(int i=0;i<skillNum;i++){ final long userId = i; Runnable task = () -> { Result result = seckillService.startSeckil(killId, userId); if(result!=null){ LOGGER.info("用户:{}{}",userId,result.get("msg")); }else{ LOGGER.info("用户:{}{}",userId,"哎呦喂,人也太多了,请稍后!"); } latch.countDown(); }; executor.execute(task); } try { latch.await();// 等待所有人任务结束 Long seckillCount = seckillService.getSeckillCount(seckillId); LOGGER.info("一共秒杀出{}件商品",seckillCount); } catch (InterruptedException e) { e.printStackTrace(); } return Result.ok(); } @ApiOperation(value="秒杀二(程序锁)",nickname="科帮网") @PostMapping("/startLock") public Result startLock(long seckillId){ int skillNum = 1000; final CountDownLatch latch = new CountDownLatch(skillNum);//N个购买者 seckillService.deleteSeckill(seckillId); final long killId = seckillId; LOGGER.info("开始秒杀二(正常)"); for(int i=0;i<1000;i++){ final long userId = i; Runnable task = () -> { Result result = seckillService.startSeckilLock(killId, userId); LOGGER.info("用户:{}{}",userId,result.get("msg")); latch.countDown(); }; executor.execute(task); } try { latch.await();// 等待所有人任务结束 Long seckillCount = seckillService.getSeckillCount(seckillId); LOGGER.info("一共秒杀出{}件商品",seckillCount); } catch (InterruptedException e) { e.printStackTrace(); } return Result.ok(); } @ApiOperation(value="秒杀三(AOP程序锁)",nickname="科帮网") @PostMapping("/startAopLock") public Result startAopLock(long seckillId){ int skillNum = 1000; final CountDownLatch latch = new CountDownLatch(skillNum);//N个购买者 seckillService.deleteSeckill(seckillId); final long killId = seckillId; LOGGER.info("开始秒杀三(正常)"); for(int i=0;i<1000;i++){ final long userId = i; Runnable task = () -> { Result result = seckillService.startSeckilAopLock(killId, userId); LOGGER.info("用户:{}{}",userId,result.get("msg")); latch.countDown(); }; executor.execute(task); } try { latch.await();// 等待所有人任务结束 Long seckillCount = seckillService.getSeckillCount(seckillId); LOGGER.info("一共秒杀出{}件商品",seckillCount); } catch (InterruptedException e) { e.printStackTrace(); } return Result.ok(); } @ApiOperation(value="秒杀四(数据库悲观锁)",nickname="科帮网") @PostMapping("/startDBPCC_ONE") public Result startDBPCC_ONE(long seckillId){ int skillNum = 1000; final CountDownLatch latch = new CountDownLatch(skillNum);//N个购买者 seckillService.deleteSeckill(seckillId); final long killId = seckillId; LOGGER.info("开始秒杀四(正常)"); for(int i=0;i<1000;i++){ final long userId = i; Runnable task = () -> { Result result = seckillService.startSeckilDBPCC_ONE(killId, userId); LOGGER.info("用户:{}{}",userId,result.get("msg")); latch.countDown(); }; executor.execute(task); } try { latch.await();// 等待所有人任务结束 Long seckillCount = seckillService.getSeckillCount(seckillId); LOGGER.info("一共秒杀出{}件商品",seckillCount); } catch (InterruptedException e) { e.printStackTrace(); } return Result.ok(); } @ApiOperation(value="秒杀五(数据库悲观锁)",nickname="科帮网") @PostMapping("/startDPCC_TWO") public Result startDPCC_TWO(long seckillId){ int skillNum = 1000; final CountDownLatch latch = new CountDownLatch(skillNum);//N个购买者 seckillService.deleteSeckill(seckillId); final long killId = seckillId; LOGGER.info("开始秒杀五(正常、数据库锁最优实现)"); for(int i=0;i<1000;i++){ final long userId = i; Runnable task = () -> { Result result = seckillService.startSeckilDBPCC_TWO(killId, userId); LOGGER.info("用户:{}{}",userId,result.get("msg")); latch.countDown(); }; executor.execute(task); } try { latch.await();// 等待所有人任务结束 Long seckillCount = seckillService.getSeckillCount(seckillId); LOGGER.info("一共秒杀出{}件商品",seckillCount); } catch (InterruptedException e) { e.printStackTrace(); } return Result.ok(); } @ApiOperation(value="秒杀六(数据库乐观锁)",nickname="科帮网") @PostMapping("/startDBOCC") public Result startDBOCC(long seckillId){ int skillNum = 1000; final CountDownLatch latch = new CountDownLatch(skillNum);//N个购买者 seckillService.deleteSeckill(seckillId); final long killId = seckillId; LOGGER.info("开始秒杀六(正常、数据库锁最优实现)"); for(int i=0;i<1000;i++){ final long userId = i; Runnable task = () -> { //这里使用的乐观锁、可以自定义抢购数量、如果配置的抢购人数比较少、比如120:100(人数:商品) 会出现少买的情况 //用户同时进入会出现更新失败的情况 Result result = seckillService.startSeckilDBOCC(killId, userId,1); LOGGER.info("用户:{}{}",userId,result.get("msg")); latch.countDown(); }; executor.execute(task); } try { latch.await();// 等待所有人任务结束 Long seckillCount = seckillService.getSeckillCount(seckillId); LOGGER.info("一共秒杀出{}件商品",seckillCount); } catch (InterruptedException e) { e.printStackTrace(); } return Result.ok(); } @ApiOperation(value="秒杀柒(进程内队列)",nickname="科帮网") @PostMapping("/startQueue") public Result startQueue(long seckillId){ seckillService.deleteSeckill(seckillId); final long killId = seckillId; LOGGER.info("开始秒杀柒(正常)"); for(int i=0;i<1000;i++){ final long userId = i; Runnable task = () -> { SuccessKilled kill = new SuccessKilled(); kill.setSeckillId(killId); kill.setUserId(userId); try { Boolean flag = SeckillQueue.getMailQueue().produce(kill); if(flag){ LOGGER.info("用户:{}{}",kill.getUserId(),"秒杀成功"); }else{ LOGGER.info("用户:{}{}",userId,"秒杀失败"); } } catch (InterruptedException e) { e.printStackTrace(); LOGGER.info("用户:{}{}",userId,"秒杀失败"); } }; executor.execute(task); } try { Thread.sleep(10000); Long seckillCount = seckillService.getSeckillCount(seckillId); LOGGER.info("一共秒杀出{}件商品",seckillCount); } catch (InterruptedException e) { e.printStackTrace(); } return Result.ok(); } @ApiOperation(value="秒杀柒(Disruptor队列)",nickname="科帮网") @PostMapping("/startDisruptorQueue") public Result startDisruptorQueue(long seckillId){ seckillService.deleteSeckill(seckillId); final long killId = seckillId; LOGGER.info("开始秒杀八(正常)"); for(int i=0;i<1000;i++){ final long userId = i; Runnable task = () -> { SeckillEvent kill = new SeckillEvent(); kill.setSeckillId(killId); kill.setUserId(userId); DisruptorUtil.producer(kill); }; executor.execute(task); } try { Thread.sleep(10000); Long seckillCount = seckillService.getSeckillCount(seckillId); LOGGER.info("一共秒杀出{}件商品",seckillCount); } catch (InterruptedException e) { e.printStackTrace(); } return Result.ok(); } }
[ "345849402@qq.com" ]
345849402@qq.com
3cb3e09da870ec57af19a71d969ebb137d54a709
93e0d425be720ee47c69a5761afe4a0444b1c978
/app/src/main/java/com/opennetwork/secureim/DummyActivity.java
6aa2e89f1f0c686ad89d021d54d211952128c4ad
[]
no_license
opennetworkproject/secure-im-android
98904aedd2e5f2bd596a5ed48e90afd5de57491f
72351ad2823aace65922c1aea7e97568ebfce184
refs/heads/master
2021-05-10T18:53:05.059352
2018-01-30T14:38:27
2018-01-30T14:38:27
118,136,259
1
0
null
null
null
null
UTF-8
Java
false
false
336
java
package com.opennetwork.secureim; import android.app.Activity; import android.os.Bundle; /** * Workaround for Android bug: * https://code.google.com/p/android/issues/detail?id=53313 */ public class DummyActivity extends Activity { @Override public void onCreate(Bundle bundle) { super.onCreate(bundle); finish(); } }
[ "slmono@outlook.com" ]
slmono@outlook.com
63d28e4fb5587af04a8a3dc67829e6247401d4c4
21cc2a0bca082cd45fdf62cc413a8666bdb7b2c8
/app/src/main/java/com/android/mobile/ArticleFragment.java
3cd061eac26b833a6ba343bf82618562f8d101c1
[]
no_license
pramodrapolu/Retrofit
0eeff99518fd02424ab4eed62c16656190a0cae1
a004f21740e36c504a1aa11ed46f023d0e054493
refs/heads/master
2020-12-24T08:39:48.175748
2016-11-08T20:55:46
2016-11-08T20:55:46
73,225,326
0
0
null
null
null
null
UTF-8
Java
false
false
1,636
java
package com.android.mobile; import android.app.Fragment; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.android.mobile.access.models.Articles; import com.android.mobile.presentation.HorizontalDivider; public class ArticleFragment extends Fragment{ public static final String TAG = ArticleFragment.class.getSimpleName(); private RecyclerView articleList; private LinearLayoutManager linearLayoutManager; private Articles articles; private ArticleListAdapter articleListAdapter; public void setArticles(Articles articles) { this.articles = articles; } @Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.article_fragment_layout, container, false); articleList = (RecyclerView) view.findViewById(R.id.article_list); HorizontalDivider divider = new HorizontalDivider(getActivity()); divider.setColor(getResources().getColor(R.color.gray_300)); articleList.addItemDecoration(divider); linearLayoutManager = new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false); articleList.setLayoutManager(linearLayoutManager); articleListAdapter = new ArticleListAdapter(articles, getActivity()); articleList.setAdapter(articleListAdapter); return view; } }
[ "Pramod.Rapolu@Staples.com" ]
Pramod.Rapolu@Staples.com
3c3f0193e93985aa1531ff3da84b3086c11c7507
e175962b3a9eeb25e3d22eb67705edb4104dd693
/wqh006/app/src/main/java/com/example/wqh006/util/FileUtil.java
852c81d41ea8956342f8b335f0feb7303e5bf5b7
[]
no_license
wangquanhao/HomeWork-Finally-
3f584b170e79d490e924294830c0af8fbc3456bc
dd9d55fb6b730f8fc4bbd996ab9d5458b30608c9
refs/heads/master
2023-02-06T17:50:17.438868
2020-12-19T03:26:33
2020-12-19T03:26:33
306,825,540
0
0
null
null
null
null
UTF-8
Java
false
false
4,759
java
package com.example.wqh006.util; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.FilenameFilter; import java.util.ArrayList; import java.util.Locale; public class FileUtil { // 把字符串保存到指定路径的文本文件 public static void saveText(String path, String txt) { try { // 根据指定文件路径构建文件输出流对象 FileOutputStream fos = new FileOutputStream(path); // 把字符串写入文件输出流 fos.write(txt.getBytes()); // 关闭文件输出流 fos.close(); } catch (Exception e) { e.printStackTrace(); } } // 从指定路径的文本文件中读取内容字符串 public static String openText(String path) { String readStr = ""; try { // 根据指定文件路径构建文件输入流对象 FileInputStream fis = new FileInputStream(path); byte[] b = new byte[fis.available()]; // 从文件输入流读取字节数组 fis.read(b); // 把字节数组转换为字符串 readStr = new String(b); // 关闭文件输入流 fis.close(); } catch (Exception e) { e.printStackTrace(); } // 返回文本文件中的文本字符串 return readStr; } // 把位图数据保存到指定路径的图片文件 public static void saveImage(String path, Bitmap bitmap) { try { // 根据指定文件路径构建缓存输出流对象 BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(path)); // 把位图数据压缩到缓存输出流中 bitmap.compress(Bitmap.CompressFormat.JPEG, 80, bos); // 完成缓存输出流的写入动作 bos.flush(); // 关闭缓存输出流 bos.close(); } catch (Exception e) { e.printStackTrace(); } } // 从指定路径的图片文件中读取位图数据 public static Bitmap openImage(String path) { Bitmap bitmap = null; try { // 根据指定文件路径构建缓存输入流对象 BufferedInputStream bis = new BufferedInputStream(new FileInputStream(path)); // 从缓存输入流中解码位图数据 bitmap = BitmapFactory.decodeStream(bis); bis.close(); // 关闭缓存输入流 } catch (Exception e) { e.printStackTrace(); } // 返回图片文件中的位图数据 return bitmap; } public static ArrayList<File> getFileList(String path, String[] extendArray) { ArrayList<File> displayedContent = new ArrayList<File>(); File[] files = null; File directory = new File(path); if (extendArray != null && extendArray.length > 0) { FilenameFilter fileFilter = getTypeFilter(extendArray); files = directory.listFiles(fileFilter); } else { files = directory.listFiles(); } if (files != null) { for (File f : files) { if (!f.isDirectory() && !f.isHidden()) { displayedContent.add(f); } } } return displayedContent; } public static FilenameFilter getTypeFilter(String[] extendArray) { final ArrayList<String> fileExtensions = new ArrayList<String>(); for (int i = 0; i < extendArray.length; i++) { fileExtensions.add(extendArray[i]); } FilenameFilter fileNameFilter = new FilenameFilter() { @Override public boolean accept(File directory, String fileName) { boolean matched = false; File f = new File(String.format("%s/%s", directory.getAbsolutePath(), fileName)); matched = f.isDirectory(); if (!matched) { for (String s : fileExtensions) { s = String.format(".{0,}\\%s$", s); s = s.toUpperCase(Locale.getDefault()); fileName = fileName.toUpperCase(Locale.getDefault()); matched = fileName.matches(s); if (matched) { break; } } } return matched; } }; return fileNameFilter; } }
[ "1559169807@qq.com" ]
1559169807@qq.com
d85bbde209bd1b538d20e22680cc2d75f74131bc
8e56cd78ba1a5555993a9bcf11e29770b6ddd2cb
/src/main/java/com/dmetal/ems/controller/LoginController.java
339598442732a1c62060564c8ffcde10fdfc7873
[]
no_license
hlmetal/spring-login
f53d90bd806af34d4b5c12385a97b86420202200
0c1d61b3724f31a6d2f0cfaf0e38521b5a3533c6
refs/heads/master
2023-02-25T21:20:27.317732
2018-06-18T03:47:51
2018-06-18T03:47:51
null
0
0
null
null
null
null
GB18030
Java
false
false
3,767
java
package com.dmetal.ems.controller; import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import java.awt.image.BufferedImage; import java.io.IOException; import java.io.OutputStream; import java.util.Random; import javax.annotation.Resource; 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.ExceptionHandler; import org.springframework.web.bind.annotation.RequestMapping; import com.dmetal.ems.entity.User; import com.dmetal.ems.service.ApplicationException; import com.dmetal.ems.service.LoginService; @Controller public class LoginController { @Resource(name="LoginService") private LoginService ls; @ExceptionHandler public String handle(Exception e,HttpServletRequest request) { System.out.println("handle()"); if(e instanceof ApplicationException) { request.setAttribute("login_failed", e.getMessage()); return "login"; } return "error"; } @RequestMapping("/checkcode.do") //输出验证码图片 public void checkcode(HttpServletRequest request,HttpServletResponse response) throws IOException { /** * 1.生成图片 */ //创建画布 BufferedImage image=new BufferedImage(80,30,BufferedImage.TYPE_INT_RGB); //获得画笔 Graphics g=image.getGraphics(); //给笔设置颜色 g.setColor(new Color(255,255,255)); //设置画布颜色 g.fillRect(0, 0, 80, 30); //重新给笔设置随机颜色 Random r=new Random(); g.setColor(new Color(r.nextInt(255),r.nextInt(255),r.nextInt(255))); //设置字体 g.setFont(new Font(null,Font.ITALIC,24)); //生成一个随机数 String number=getNumber(4); //将验证码绑定到session对象上 HttpSession session=request.getSession(); session.setAttribute("number", number); //在图片上绘制随机数 g.drawString(number, 5, 25); //添加干扰线 for(int i=0;i<10;i++) { g.setColor(new Color(r.nextInt(255),r.nextInt(255),r.nextInt(255))); g.drawLine(r.nextInt(80), r.nextInt(30), r.nextInt(80), r.nextInt(30)); } /** * 2.压缩图片并输出 */ //告诉浏览器,服务器返回的是一张图片 response.setContentType("image/jpeg"); //获得字节输出流 OutputStream output=response.getOutputStream(); //将原始图片按照指定格式jepg进行压缩,输出。 javax.imageio.ImageIO.write(image, "jpeg", output); output.close(); } private String getNumber(int size) { String chars="ABCDEFGHIJKLMNOPQRSTUVWXYZ"+"0123456789"; String number=""; Random r=new Random(); for(int i=0;i<size;i++) { number+=chars.charAt(r.nextInt(chars.length())); } return number; } @RequestMapping("/toLogin.do") public String toLogin() { System.out.println("toLogin()"); return "login"; } @RequestMapping("/login.do") public String login(HttpServletRequest request,HttpSession session) { System.out.println("login()"); String number=request.getParameter("number"); String username=request.getParameter("username"); String pwd=request.getParameter("pwd"); System.out.println(username+" "+pwd+" "+number); Object obj=session.getAttribute("number"); if(!obj.equals(number)) { throw new ApplicationException("验证码错误"); } //将请求分发给业务层来处理 User user=ls.checkLogin(username,pwd); //登陆成功,将user对象绑定到session对象上 session.setAttribute("user", user); //登录成功 return "redirect:toIndex.do"; } @RequestMapping("/toIndex.do") public String toIndex() { return "index"; } }
[ "NiCo@DESKTOP-AM8PV3A.mshome.net" ]
NiCo@DESKTOP-AM8PV3A.mshome.net
e9a932bc8a13ae7735529f852566eeb6c21077b8
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_3263974c19bf80000e85d593a9605a5e072e5f75/PropertyDescriptor/2_3263974c19bf80000e85d593a9605a5e072e5f75_PropertyDescriptor_s.java
9e783e3edb1822cd2b4fff362eae0eaa421e9095
[]
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
6,146
java
/******************************************************************************* * Copyright (c) 2010 Oobium, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Jeremy Dowdall <jeremy@oobium.com> - initial API and implementation ******************************************************************************/ package org.oobium.build.gen.model; import static org.oobium.utils.StringUtils.varName; import java.util.List; import java.util.Map; import org.oobium.build.model.ModelAttribute; import org.oobium.build.model.ModelDefinition; import org.oobium.build.model.ModelRelation; import org.oobium.persist.ModelList; import org.oobium.utils.StringUtils; public class PropertyDescriptor { private String modelType; private String rawType; private String type; private String fullType; private String castType; private String typePackage; private String variable; private String init; private String getterName; private String hasserName; private String setterName; private String enumProp; private String check; private PropertyBuilder builder; private boolean array; private boolean primitive; private boolean readOnly; private boolean unique; private boolean virtual; private ModelDefinition model; private ModelRelation opposite; private boolean isAttr; private boolean hasOne; private boolean hasMany; private String relatedType; private String through; public PropertyDescriptor(ModelAttribute attribute) { this(attribute.model().getSimpleName(), attribute.getJavaType(), attribute.name()); rawType = attribute.type(); init = attribute.init(); getterName = StringUtils.getterName(variable); check = attribute.check(); readOnly = attribute.readOnly(); unique = attribute.unique(); virtual = attribute.virtual(); isAttr = true; hasOne = false; hasMany = false; relatedType = null; builder = new AttributeBuilder(this); } public PropertyDescriptor(ModelRelation relation) { this(relation.model().getSimpleName(), relation.type(), relation.name()); init = null; model = relation.model(); opposite = relation.getOpposite(); readOnly = relation.readOnly(); unique = relation.unique(); virtual = relation.virtual(); isAttr = false; hasOne = !relation.hasMany(); hasMany = relation.hasMany(); relatedType = relation.type(); through = relation.through(); if(relation.hasMany()) { castType = ModelList.class.getSimpleName(); getterName = variable; } else { getterName = StringUtils.getterName(variable); } builder = relation.hasMany() ? new HasManyBuilder(this) : new HasOneBuilder(this); } PropertyDescriptor(String modelType, String type, String name) { this.modelType = modelType; this.type = type.substring(type.lastIndexOf('.')+1); variable = name; fullType = type; castType = this.type; enumProp = StringUtils.constant(variable); hasserName = StringUtils.hasserName(variable); setterName = StringUtils.setterName(variable); int ix = type.lastIndexOf('.'); array = type.endsWith("[]"); if(ix != -1 || array) { typePackage = (ix == -1) ? null : type.substring(0, ix); } else { primitive = true; } } public String relatedType() { return relatedType; } /** * @return new String[] { field, subfield } */ public String[] through() { if(isThrough()) { int ix = through.indexOf(':'); if(ix == -1) { return new String[] { through, varName(type(), hasMany) }; } else { return new String[] { through.substring(0, ix), through.substring(ix + 1) }; } } return null; } public String castType() { return castType; } public String enumProp() { return enumProp; } public String rawType() { return rawType; } public String fullType() { return fullType; } public String getCheck() { return check; } public String getterName() { return getterName; } public boolean hasCheck() { return check != null && check.length() > 0; } public String hasserName() { return hasserName; } public String init() { return init; } public boolean isAttr() { return isAttr; } public boolean isReadOnly() { return readOnly; } public boolean isThrough() { return through != null && through.length() > 0; } public boolean isUnique() { return unique; } public boolean isVirtual() { return virtual; } public boolean hasDeclaration() { return !virtual; } public boolean hasEnum() { return true; } public boolean hasGetter() { return !"void".equals(type); } public boolean hasImport() { return typePackage != null; } public boolean hasInit() { return init != null && !init.isEmpty(); } public boolean hasOpposite() { return opposite != null; } public boolean hasOne() { return hasOne; } public boolean hasMany() { return hasMany; } public boolean hasSetter() { return !readOnly; } public List<String> imports() { return builder.getImports(); } public boolean isPrimitive() { return primitive; } public boolean isType(Class<?> clazz) { return this.type.equals(clazz.getSimpleName()); } public Map<String, String> methods() { return builder.getMethods(); } public ModelDefinition model() { return model; } public String modelType() { return modelType; } public ModelRelation opposite() { return opposite; } public String setterName() { return setterName; } public String type() { return type; } public String typePackage() { return typePackage; } public String variable() { return variable; } public Map<String, String> variables() { return builder.getDeclarations(); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
85a5925e33b0d1b374c3e5d7062cd3b05a6adf5e
14a6c900c09f206b5acebb12409d70ad477f7bfd
/VRChatAiNpcMain/src/test/java/com/vrchat/ai/npc/VrChatAiNpcMainApplicationTests.java
06bef050f63e6fe0a5bdfca7dadf29204ce3a236
[ "MIT" ]
permissive
bopopescu/VRChatAINpc
6d8ae39a1bddd391d211f7e71c9c58453160d5e3
6da5ecd3010ed09e07503711e39afedcce0af44a
refs/heads/master
2022-11-23T12:41:36.841387
2020-05-08T09:03:38
2020-05-08T09:03:38
281,640,699
0
0
MIT
2020-07-22T09:58:09
2020-07-22T09:58:08
null
UTF-8
Java
false
false
218
java
package com.vrchat.ai.npc; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class VrChatAiNpcMainApplicationTests { @Test void contextLoads() { } }
[ "kimrie2@naver.com" ]
kimrie2@naver.com
6cd2ff64b11481d3dbde25fe4597c521ca290365
97e3b3bdbd73abe9ba01b5abe211d8b694301f34
/源码分析/spring/spring-framework-5.1.5.RELEASE/spring-context/src/main/java/org/springframework/instrument/classloading/WeavingTransformer.java
d09d87aaacb568a545b127cd11711a71a09399e4
[ "Apache-2.0", "MIT" ]
permissive
yuaotian/java-technology-stack
dfbbef72aeeca0aeab91bc309fcce1fb93fdabf0
f060fea0f2968c2a527e8dd12b1ccf1d684c5d83
refs/heads/master
2020-08-26T12:37:30.573398
2019-05-27T14:10:07
2019-05-27T14:10:07
217,011,246
1
0
MIT
2019-10-23T08:49:43
2019-10-23T08:49:42
null
UTF-8
Java
false
false
3,860
java
/* * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.instrument.classloading; import java.lang.instrument.ClassFileTransformer; import java.lang.instrument.IllegalClassFormatException; import java.security.ProtectionDomain; import java.util.ArrayList; import java.util.List; import org.springframework.lang.Nullable; import org.springframework.util.Assert; import org.springframework.util.StringUtils; /** * ClassFileTransformer-based weaver, allowing for a list of transformers to be * applied on a class byte array. Normally used inside class loaders. * * <p>Note: This class is deliberately implemented for minimal external dependencies, * since it is included in weaver jars (to be deployed into application servers). * * @author Rod Johnson * @author Costin Leau * @author Juergen Hoeller * @since 2.0 */ public class WeavingTransformer { @Nullable private final ClassLoader classLoader; private final List<ClassFileTransformer> transformers = new ArrayList<>(); /** * Create a new WeavingTransformer for the given class loader. * @param classLoader the ClassLoader to build a transformer for */ public WeavingTransformer(@Nullable ClassLoader classLoader) { this.classLoader = classLoader; } /** * Add a class file transformer to be applied by this weaver. * @param transformer the class file transformer to register */ public void addTransformer(ClassFileTransformer transformer) { Assert.notNull(transformer, "Transformer must not be null"); this.transformers.add(transformer); } /** * Apply transformation on a given class byte definition. * The method will always return a non-null byte array (if no transformation has taken place * the array content will be identical to the original one). * @param className the full qualified name of the class in dot format (i.e. some.package.SomeClass) * @param bytes class byte definition * @return (possibly transformed) class byte definition */ public byte[] transformIfNecessary(String className, byte[] bytes) { String internalName = StringUtils.replace(className, ".", "/"); return transformIfNecessary(className, internalName, bytes, null); } /** * Apply transformation on a given class byte definition. * The method will always return a non-null byte array (if no transformation has taken place * the array content will be identical to the original one). * @param className the full qualified name of the class in dot format (i.e. some.package.SomeClass) * @param internalName class name internal name in / format (i.e. some/package/SomeClass) * @param bytes class byte definition * @param pd protection domain to be used (can be null) * @return (possibly transformed) class byte definition */ public byte[] transformIfNecessary(String className, String internalName, byte[] bytes, @Nullable ProtectionDomain pd) { byte[] result = bytes; for (ClassFileTransformer cft : this.transformers) { try { byte[] transformed = cft.transform(this.classLoader, internalName, null, pd, result); if (transformed != null) { result = transformed; } } catch (IllegalClassFormatException ex) { throw new IllegalStateException("Class file transformation failed", ex); } } return result; } }
[ "626984947@qq.com" ]
626984947@qq.com