blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 4 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2 values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 689M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 131 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 32 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 313 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e153eabe4e41b060323636da530032858d244494 | 37b4d0ca1efc9d5e366e1a466be3f0ce676bd21f | /RadixSort.java | 307505d93b10b0cc7f6fb93e7dee9b67cf8b97f8 | [] | no_license | steven-liu48/CSC172-lab7 | 23e0a4c699b76d746ad865f72fe5c0b5f1c7fb05 | 501540f58ec855ae13ac71cc9d86351a81134df7 | refs/heads/master | 2022-10-12T05:01:12.292728 | 2020-06-14T11:48:46 | 2020-06-14T11:48:46 | 272,178,767 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 15,106 | java | //Lab 7
//Lab Partners:
//Xiaoxiang "Steven" Liu
//xliu102@u.rochester.edu
//MW 6:15PM - 7:30PM
//Grant Yap
//gyap@u.rochester.edu
//MW 2:00 - 3:15PM
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.util.Locale;
public class RadixSort{
//Base 10
static int maxDigit(Integer[] A) {
int biggest = A[0];
int digits = 0;
for(int i = 0; i < A.length; i++) {
//System.out.println("x");
if(A[i] > biggest) {
biggest = A[i];
}
}
//System.out.println(biggest);
while(biggest > 0) {
digits += 1;
biggest = biggest/10;
}
return digits;
}
static int maxDigit2(Integer[] A) {
int biggest = A[0];
int digits = 0;
for(int i = 0; i < A.length; i++) {
//System.out.println("x");
if(A[i] > biggest) {
biggest = A[i];
}
}
String bin = toBinary(biggest);
return bin.length();
}
static String toBinary(int n) {
if (n == 0) {
return "0";
}
String binary = "";
while (n > 0) {
int rem = n % 2;
binary = rem + binary;
n = n / 2;
}
return binary;
}
static void radix(Integer[] A, int digit) {
Integer[] B = new Integer[A.length];
int[] count = new int[A.length];
// Count[i] stores number of records in bin[i]
int i, j, rtok;
for (i=0, rtok=1; i<digit; i++, rtok*=10) { // For k digits
for (j=0; j<10; j++) count[j] = 0; // Initialize count
// Count the number of records for each bin on this pass
for (j=0; j<A.length; j++) count[(A[j]/rtok)%10]++;
// count[j] will be index in B for last slot of bin j.
for (j=1; j<10; j++) count[j] = count[j-1] + count[j];
// Put records into bins, working from bottom of bin
// Since bins fill from bottom, j counts downwards
for (j=A.length-1; j>=0; j--)
B[--count[(A[j]/rtok)%10]] = A[j];
for (j=0; j<A.length; j++) A[j] = B[j]; // Copy B back
}
}
//Base 2
static void radix2(Integer[] A, int digit) {
Integer[] B = new Integer[A.length];
int[] count = new int[A.length];
// Count[i] stores number of records in bin[i]
int i, j;
for (i=0; i<digit; i++) { // For k digits
for (j=0; j<2; j++) count[j] = 0; // Initialize count
// Count the number of records for each bin on this pass
for (j=0; j<A.length; j++) count[(A[j]>>i)&1]++;
// count[j] will be index in B for last slot of bin j.
for (j=1; j<2; j++) count[j] = count[j-1] + count[j];
// Put records into bins, working from bottom of bin
// Since bins fill from bottom, j counts downwards
for (j=A.length-1; j>=0; j--)
B[--count[(A[j]>>i)&1]] = A[j];
for (j=0; j<A.length; j++) A[j] = B[j]; // Copy B back
}
}
public static void main(String[] args) {
//1K
System.out.println("1K");
Integer[] arr1 = new Integer[1000];
Integer[] arr2 = new Integer[1000];
for(int i = 0; i < 1000; i++) {
arr1[i] = (int)(Math.random() * 100);
arr2[i] = arr1[i];
}
int d1 = maxDigit(arr1);
int d2 = maxDigit2(arr2);
Stopwatch timer = new Stopwatch();
radix(arr1, d1);
double time = timer.elapsedTimeMillis();
System.out.println(time);
timer = new Stopwatch();
radix2(arr2, d2);
double time2 = timer.elapsedTimeMillis();
System.out.println(time2);
/*
for(int i = 0; i < 1000; i++) {
System.out.println(arr1[i] + " " + arr2[i]);
}
*/
//8K
System.out.println("8K");
Integer[] arr3 = new Integer[8000];
Integer[] arr4 = new Integer[8000];
for(int i = 0; i < 8000; i++) {
arr3[i] = (int)(Math.random() * 100);
arr4[i] = arr3[i];
}
int d3 = maxDigit(arr3);
int d4 = maxDigit2(arr4);
timer = new Stopwatch();
radix(arr3, d3);
double time3 = timer.elapsedTimeMillis();
System.out.println(time3);
timer = new Stopwatch();
radix2(arr4, d4);
double time4 = timer.elapsedTimeMillis();
System.out.println(time4);
//32K
System.out.println("32K");
Integer[] arr5 = new Integer[32000];
Integer[] arr6 = new Integer[32000];
for(int i = 0; i < 32000; i++) {
arr5[i] = (int)(Math.random() * 1000);
arr6[i] = arr5[i];
}
int d5 = maxDigit(arr5);
int d6 = maxDigit2(arr6);
timer = new Stopwatch();
radix(arr5, d5);
double time5 = timer.elapsedTimeMillis();
System.out.println(time5);
timer = new Stopwatch();
radix2(arr6, d6);
double time6 = timer.elapsedTimeMillis();
System.out.println(time6);
//64K
System.out.println("64K");
Integer[] arr7 = new Integer[64000];
Integer[] arr8 = new Integer[64000];
for(int i = 0; i < 64000; i++) {
arr7[i] = (int)(Math.random() * 1000);
arr8[i] = arr7[i];
}
int d7 = maxDigit(arr7);
int d8 = maxDigit2(arr8);
timer = new Stopwatch();
radix(arr7, d7);
double time7 = timer.elapsedTimeMillis();
System.out.println(time7);
timer = new Stopwatch();
radix2(arr8, d8);
double time8 = timer.elapsedTimeMillis();
System.out.println(time8);
//1M
System.out.println("1M");
Integer[] arr9 = new Integer[1000000];
Integer[] arr10 = new Integer[1000000];
for(int i = 0; i < 1000000; i++) {
arr9[i] = (int)(Math.random() * 1000);
arr10[i] = arr9[i];
}
int d9 = maxDigit(arr7);
int d10 = maxDigit2(arr8);
timer = new Stopwatch();
radix(arr9, d9);
double time9 = timer.elapsedTimeMillis();
System.out.println(time9);
timer = new Stopwatch();
radix2(arr10, d10);
double time10 = timer.elapsedTimeMillis();
System.out.println(time10);
}
class StdOut {
// force Unicode UTF-8 encoding; otherwise it's system dependent
private static final String CHARSET_NAME = "UTF-8";
// assume language = English, country = US for consistency with StdIn
private final Locale LOCALE = Locale.US;
// send output here
private PrintWriter out;
// this is called before invoking any methods
{
try {
out = new PrintWriter(new OutputStreamWriter(System.out, CHARSET_NAME), true);
}
catch (UnsupportedEncodingException e) {
System.out.println(e);
}
}
// don't instantiate
private StdOut() { }
/**
* Closes standard output.
*/
public void close() {
out.close();
}
/**
* Terminates the current line by printing the line-separator string.
*/
public void println() {
out.println();
}
/**
* Prints an object to this output stream and then terminates the line.
*
* @param x the object to print
*/
public void println(Object x) {
out.println(x);
}
/**
* Prints a boolean to standard output and then terminates the line.
*
* @param x the boolean to print
*/
public void println(boolean x) {
out.println(x);
}
/**
* Prints a character to standard output and then terminates the line.
*
* @param x the character to print
*/
public void println(char x) {
out.println(x);
}
/**
* Prints a double to standard output and then terminates the line.
*
* @param x the double to print
*/
public void println(double x) {
out.println(x);
}
/**
* Prints an integer to standard output and then terminates the line.
*
* @param x the integer to print
*/
public void println(float x) {
out.println(x);
}
/**
* Prints an integer to standard output and then terminates the line.
*
* @param x the integer to print
*/
public void println(int x) {
out.println(x);
}
/**
* Prints a long to standard output and then terminates the line.
*
* @param x the long to print
*/
public void println(long x) {
out.println(x);
}
/**
* Prints a short integer to standard output and then terminates the line.
*
* @param x the short to print
*/
public void println(short x) {
out.println(x);
}
/**
* Prints a byte to standard output and then terminates the line.
* <p>
* To write binary data, see {@link BinaryStdOut}.
*
* @param x the byte to print
*/
public void println(byte x) {
out.println(x);
}
/**
* Flushes standard output.
*/
public void print() {
out.flush();
}
/**
* Prints an object to standard output and flushes standard output.
*
* @param x the object to print
*/
public void print(Object x) {
out.print(x);
out.flush();
}
/**
* Prints a boolean to standard output and flushes standard output.
*
* @param x the boolean to print
*/
public void print(boolean x) {
out.print(x);
out.flush();
}
/**
* Prints a character to standard output and flushes standard output.
*
* @param x the character to print
*/
public void print(char x) {
out.print(x);
out.flush();
}
/**
* Prints a double to standard output and flushes standard output.
*
* @param x the double to print
*/
public void print(double x) {
out.print(x);
out.flush();
}
/**
* Prints a float to standard output and flushes standard output.
*
* @param x the float to print
*/
public void print(float x) {
out.print(x);
out.flush();
}
/**
* Prints an integer to standard output and flushes standard output.
*
* @param x the integer to print
*/
public void print(int x) {
out.print(x);
out.flush();
}
/**
* Prints a long integer to standard output and flushes standard output.
*
* @param x the long integer to print
*/
public void print(long x) {
out.print(x);
out.flush();
}
/**
* Prints a short integer to standard output and flushes standard output.
*
* @param x the short integer to print
*/
public void print(short x) {
out.print(x);
out.flush();
}
/**
* Prints a byte to standard output and flushes standard output.
*
* @param x the byte to print
*/
public void print(byte x) {
out.print(x);
out.flush();
}
/**
* Prints a formatted string to standard output, using the specified format
* string and arguments, and then flushes standard output.
*
*
* @param format the <a href = "http://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html#syntax">format string</a>
* @param args the arguments accompanying the format string
*/
public void printf(String format, Object... args) {
out.printf(LOCALE, format, args);
out.flush();
}
/**
* Prints a formatted string to standard output, using the locale and
* the specified format string and arguments; then flushes standard output.
*
* @param locale the locale
* @param format the <a href = "http://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html#syntax">format string</a>
* @param args the arguments accompanying the format string
*/
public void printf(Locale locale, String format, Object... args) {
out.printf(locale, format, args);
out.flush();
}
/**
* Unit tests some of the methods in {@code StdOut}.
*
* @param args the command-line arguments
*/
}
/******************************************************************************
* Copyright 2002-2016, Robert Sedgewick and Kevin Wayne.
*
* This file is part of algs4.jar, which accompanies the textbook
*
* Algorithms, 4th edition by Robert Sedgewick and Kevin Wayne,
* Addison-Wesley Professional, 2011, ISBN 0-321-57351-X.
* http://algs4.cs.princeton.edu
*
*
* algs4.jar is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* algs4.jar is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with algs4.jar. If not, see http://www.gnu.org/licenses.
******************************************************************************/
/* Compilation: javac Stopwatch.java
* Execution: java Stopwatch n
* Dependencies: none
*
* A utility class to measure the running time (wall clock) of a program.
*
* % java8 Stopwatch 100000000
* 6.666667e+11 0.5820 seconds
* 6.666667e+11 8.4530 seconds
*
******************************************************************************/
/**
* The {@code Stopwatch} data type is for measuring
* the time that elapses between the start and end of a
* programming task (wall-clock time).
*
* See {@link StopwatchCPU} for a version that measures CPU time.
* For additional documentation,
* see <a href="http://algs4.cs.princeton.edu/14analysis">Section 1.4</a> of
* <i>Algorithms, 4th Edition</i> by Robert Sedgewick and Kevin Wayne.
*
* @author Robert Sedgewick
* @author Kevin Wayne
*/
static class Stopwatch {
private final long start;
/**
* Initializes a new stopwatch.
*/
public Stopwatch() {
start = System.currentTimeMillis();
}
/**
* Returns the elapsed CPU time (in seconds) since the stopwatch was created.
*
* @return elapsed CPU time (in seconds) since the stopwatch was created
*/
public double elapsedTime() {
long now = System.currentTimeMillis();
return (now - start) / 1000.0;
}
/**
* Returns the elapsed CPU time (in miliseconds) since the stopwatch was created.
*
* @return elapsed CPU time (in miliseconds) since the stopwatch was created
*/
public double elapsedTimeMillis() {
long now = System.currentTimeMillis();
return (now - start) /1.0;
}
/**
* Unit tests the {@code Stopwatch} data type.
* Takes a command-line argument {@code n} and computes the
* sum of the square roots of the first {@code n} positive integers,
* first using {@code Math.sqrt()}, then using {@code Math.pow()}.
* It prints to standard output the sum and the amount of time to
* compute the sum. Note that the discrete sum can be approximated by
* an integral - the sum should be approximately 2/3 * (n^(3/2) - 1).
*
* @param args the command-line arguments
*/
}
}
| [
"xiaoxiang.liu48@gmail.com"
] | xiaoxiang.liu48@gmail.com |
85e68e14db13bce4866c912367b97a0f208fd0c1 | 0e7e98d2a18b569072f6c97cd06219fb980726d4 | /dashda-src/src/main/java/com/dashda/data/entities/UserRolePermission.java | 0313ffff44878f8b5aeedbee13d674eff88ed6f1 | [] | no_license | islamarabsoft/dashda | 3eded7ba5312f472525939873decf150c13ae32d | 3e7bf7cbd9f10aad799f918563dbd46bc7740e8f | refs/heads/master | 2022-12-05T02:56:02.506186 | 2019-08-19T14:24:18 | 2019-08-19T14:24:18 | 125,328,862 | 1 | 0 | null | 2022-11-24T07:13:24 | 2018-03-15T07:30:12 | JavaScript | UTF-8 | Java | false | false | 1,532 | java | package com.dashda.data.entities;
// Generated Apr 4, 2018 2:50:44 PM by Hibernate Tools 5.2.8.Final
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
/**
* UserRolePermission generated by hbm2java
*/
@Entity
@Table(name = "USER_ROLE_PERMISSION")
public class UserRolePermission implements java.io.Serializable, com.dashda.data.entities.BaseEntity {
private Integer id;
private Permission permission;
private UserRole userRole;
public UserRolePermission() {
}
public UserRolePermission(Permission permission, UserRole userRole) {
this.permission = permission;
this.userRole = userRole;
}
@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "ID", unique = true, nullable = false)
public Integer getId() {
return this.id;
}
public void setId(Integer id) {
this.id = id;
}
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "PERMISSION_ID")
public Permission getPermission() {
return this.permission;
}
public void setPermission(Permission permission) {
this.permission = permission;
}
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "USER_ROLE_ID")
public UserRole getUserRole() {
return this.userRole;
}
public void setUserRole(UserRole userRole) {
this.userRole = userRole;
}
}
| [
"islamarabsoft@gmail.com"
] | islamarabsoft@gmail.com |
d2f53bc787bfe57d412f8c029c095ccf0570e1ee | a385178586d1b1998af5e116dc8a739d0c4d2712 | /src/lesson6/Main.java | dd0182abc52e1e51c5421b8dbeaf47170aadf4a3 | [] | no_license | Xolodoc/javaJunior | 22740370992300318f4ed22526cc003e22299cb8 | 854c3937ac6623d82ece0e9c56185255293e73a0 | refs/heads/master | 2023-01-06T04:28:27.733712 | 2020-11-10T18:36:01 | 2020-11-10T18:36:01 | 309,758,283 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 334 | java | package lesson6;
public class Main {
public static void main(String[] args) {
// for (int i = 1; i < 10; i++){
// System.out.println(i);
// }
//то же самое только вайл
int i = 1;
while(i < 10){
System.out.println(i);
i++;
}
}
}
| [
"lawrenspiter@gmail.com"
] | lawrenspiter@gmail.com |
658d84fa07c9045f350cd78881e1f461f4e5fa2d | e94bddc529328b4b428bb08efe40953d2eda8524 | /shortestPath.java | 8c0380963fcb479d171ab73c569a32d848c79313 | [] | no_license | lalanimaulik/Hackerrank_Questions- | bcdbf4318118f34fd1b5f21213a2b3d3d78f089a | a5bcde752c1abd923145c362720d1ea45cadf92c | refs/heads/master | 2021-05-01T22:29:55.202313 | 2017-01-02T17:54:14 | 2017-01-02T17:54:14 | 77,364,618 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,606 | java | import java.io.*;
import java.util.*;
class Edge{
Node nodeName;
int cost;
Edge(Node node, int pathCost){
nodeName = node;
cost = pathCost;
}
}
class Node{
private static int objectCounter = 0;
static ArrayList<Node> exists =new ArrayList<Node>();
public String state;
public int totalCost;
public LinkedList<Edge> neighbouringNodes = new LinkedList<Edge>();
public Node parent;
public int heuristicCost;
public int totalHeuristicCost;
//constructor
Node(){
neighbouringNodes = new LinkedList<Edge>();
}
private Node(String value)
{
this.state=value;
}
public Node getInstance(String value)
{
Node node=null;
for(Node a: exists)
{
if(a.getVal().equals(value))
return a;
}
node=new Node(value);
objectCounter++;
exists.add(node);
return node;
}
public static int getCounter() {
return objectCounter;
}
public String getVal() {
return state;
}
public Node(Node node) {
state = node.state;
totalCost = node.totalCost;
parent = node.parent;
}
//function to add an edge between two nodes
void addEdge(Node nodeB, int pathCost){
Edge edge = new Edge(nodeB,pathCost);
neighbouringNodes.add(edge);
}
void addHeuristicCost(int hCost){
this.heuristicCost = hCost;
}
}
public class shortestPath{
public static void main(String[] args) throws Exception{
String algorithmToBeUsed = null;
int numberOfTrafficLines;
int heuristicCost;
try{
Node node = new Node();
Node startNode = new Node();
Node endNode = new Node();
Scanner inputFileData = new Scanner(new File("C:/Users/maulik44444/Downloads/input12.txt"));
algorithmToBeUsed = inputFileData.next();
startNode = node.getInstance(inputFileData.next());
endNode = node.getInstance(inputFileData.next());
numberOfTrafficLines = inputFileData.nextInt();
inputFileData.nextLine();
String[] trafficInformation = new String[numberOfTrafficLines];
while (numberOfTrafficLines>0) {
node = new Node();
trafficInformation = inputFileData.nextLine().split(" ");
node.getInstance(trafficInformation[0]).addEdge(
node.getInstance(trafficInformation[1]), Integer.valueOf(trafficInformation[2]));
numberOfTrafficLines--;
}
if(algorithmToBeUsed.equals("A*")){
heuristicCost = inputFileData.nextInt();
inputFileData.nextLine();
while (heuristicCost>0) {
node = new Node();
trafficInformation = inputFileData.nextLine().split(" ");
char[] check = trafficInformation[1].toCharArray();
// for 0 value
if(Character.isLetter(check[0])){
node.getInstance(trafficInformation[0]).addHeuristicCost(0);
}else{
node.getInstance(trafficInformation[0]).addHeuristicCost(
Integer.valueOf(trafficInformation[1]));
}
heuristicCost--;
}
}
// if(algorithmToBeUsed.equals("BFS"))
// BFStraversal(startNode, endNode);
// else if(algorithmToBeUsed.equals("UCS"))
// UCStraversal(startNode, endNode);
// else if(algorithmToBeUsed.equals("A*"))
// AStartraversal(startNode, endNode);
// else if(algorithmToBeUsed.equals("DFS"))
// DFStraversal(startNode, endNode);
// System.out.println("\nBFS");
// BFStraversal(startNode, endNode);
// System.out.println("\nUCS");
// UCStraversal(startNode, endNode);
System.out.println("\nA*");
AStartraversal(startNode, endNode);
// System.out.println("\nDFS");
// DFStraversal(startNode, endNode);
}catch(Exception e){
e.printStackTrace();
}finally{
}
}
// function to find shortest path using Breadth First Search
public static void BFStraversal(Node source, Node destination) throws IOException{
Node poppedNode;
Node nodeToBeExplored = new Node();
if(source.state == destination.state){
printWithoutCostPath(destination);
}
Set<String> explored = new HashSet<String>();
LinkedList<Node> queue = new LinkedList<Node>();
queue.add(source);
while(queue.size()!=0){
poppedNode = queue.poll();
explored.add(poppedNode.state);
ListIterator<Edge> hasNeightbour = poppedNode.neighbouringNodes.listIterator();
while(hasNeightbour.hasNext()){
Edge nextNode = hasNeightbour.next();
if (nextNode.nodeName.state.equals(destination.state))
{
destination.parent = poppedNode;
printWithoutCostPath(destination);
return;
}
if (!explored.contains(nextNode.nodeName.state))
{
explored.add(nextNode.nodeName.state);
nodeToBeExplored = nodeToBeExplored.getInstance(nextNode.nodeName.state);
nodeToBeExplored.parent = poppedNode;
queue.add(nodeToBeExplored);
}
}
}
return;
}
// function to find shortest path using Uniform Cost Search
public static void UCStraversal(Node source, Node destination) throws IOException{
source.totalCost = 0;
PriorityQueue<Node> queue = new PriorityQueue<Node>(Node.getCounter(),new Comparator<Node>() {
public int compare(Node i, Node j) {
if (i.totalCost >= j.totalCost) {return 1;}
else if (i.totalCost < j.totalCost) {return -1;}
else {return 0;}
}});
queue.add(source);
Set<Node> explored = new HashSet<Node>();
do {
Node current = queue.poll();
explored.add(current);
if (current.state.equals(destination.state)) {
destination.parent = current.parent;
destination.totalCost = current.totalCost;
break;
}
for (Edge edges : current.neighbouringNodes) {
Node child = edges.nodeName;
int cost = edges.cost;
if (!explored.contains(child) && !queue.contains(child)) {
child.totalCost = current.totalCost + cost;
child.parent = current;
queue.add(child);
}else if (queue.contains(child) || explored.contains(child)) {//instead of deleting - updated the parent
if(child.totalCost > cost + current.totalCost ){
child.parent = current;
child.totalCost = current.totalCost + cost;
}
}
}
} while (!queue.isEmpty());
printPath(destination);
}
public static Queue<Node> sortQueue (Queue queue){
Queue<Node> queue1 = new LinkedList<Node>();
Queue<Node> queue2 = new LinkedList<Node>();
while (!queue.isEmpty())
queue1.add((Node) queue.remove());
while (!queue1.isEmpty()) {
Node q = queue1.remove();
while (!queue2.isEmpty() && q.totalHeuristicCost < queue2.peek().totalHeuristicCost)
if (q.totalHeuristicCost < queue2.peek().totalHeuristicCost){
queue1.add(queue2.remove());}
queue2.add(q);
}
return queue2;
}
// function to find shortest path using A* search
public static void AStartraversal(Node source, Node destination) throws IOException{
source.totalCost = 0;
PriorityQueue<Node> queue = new PriorityQueue<Node>(Node.getCounter(),new Comparator<Node>() {
public int compare(Node i, Node j) {
if (i.totalHeuristicCost >= j.totalHeuristicCost) {
return 1;
}
else if (i.totalHeuristicCost < j.totalHeuristicCost) {
return -1;
}
else {
return 0;
}
}});
//Queue<Node> queue = new LinkedList<Node>();
queue.add(source);
Set<Node> explored = new HashSet<Node>();
do {
Node current = queue.poll();
explored.add(current);
if (current.state.equals(destination.state)) {
destination.parent = current.parent;
destination.totalCost = current.totalCost;
break;
}
for (Edge edges : current.neighbouringNodes) {
Node child = edges.nodeName;
int cost = edges.cost;
if (queue.contains(child) || explored.contains(child)) {
if(child.totalHeuristicCost > cost + current.totalCost + child.heuristicCost){
child.parent = current;
child.totalCost = current.totalCost + cost;
child.totalHeuristicCost = current.totalCost + cost + child.heuristicCost;
}
} else{
child.totalCost = current.totalCost + cost;
child.totalHeuristicCost = current.totalCost + cost + child.heuristicCost;
child.parent = current;
queue.add(child);
}
}
//queue = sortQueue(queue);
} while (!queue.isEmpty());
printPath(destination);
}
// function to find shortest path using Depth First Search
public static void DFStraversal(Node source, Node destination) throws IOException{
Node poppedNode;
Node nodeToBeExplored = new Node();
source.parent = null;
if(source.state == destination.state){
printWithoutCostPath(destination);
return;
}
Set<String> explored = new HashSet<String>();
LinkedList<Node> queue = new LinkedList<Node>();
queue.add(source);
while(queue.size()!=0){
poppedNode = queue.poll();
if (poppedNode.state.equals(destination.state))
{
printWithoutCostPath(destination);
return;
}
explored.add(poppedNode.state);
Iterator<Edge> hasNeightbour = poppedNode.neighbouringNodes.descendingIterator();
while(hasNeightbour.hasNext()){
Edge nextNode = hasNeightbour.next();
if (explored.contains(nextNode.nodeName.state))//ask
{
// nodeToBeExplored = nodeToBeExplored.getInstance(nextNode.nodeName.state);
// nodeToBeExplored.parent = poppedNode;
// queue.addFirst(nodeToBeExplored);
}else if(queue.contains(nextNode.nodeName)){
}else{
nodeToBeExplored = nodeToBeExplored.getInstance(nextNode.nodeName.state);
nodeToBeExplored.parent = poppedNode;
queue.addFirst(nodeToBeExplored);
}
}
}
return;
}
public static void printPath(Node target) throws IOException {
List<Node> path = new ArrayList<Node>();
for (Node node = target; node != null; node = node.parent) {
path.add(node);
}
Collections.reverse(path);
//File outputFile = new File("/Users/Aakanksha/Desktop/USC/AI/shortestPathInputs/a.txt");
//FileWriter fout = new FileWriter(outputFile);
for(Node node:path){
// fout.write(node.state + " " + node.totalCost + "\n");
System.out.println(node.state + " " + node.totalCost); //remove
}
//fout.close();
}
public static void printWithoutCostPath(Node target) throws IOException {
List<Node> path = new ArrayList<Node>();
for (Node node = target; node != null; node = node.parent) {
path.add(node);
}
Collections.reverse(path);
int i = 0,j=0; //remove
//File outputFile = new File("/Users/Aakanksha/Desktop/USC/AI/shortestPathInputs/b.txt");
//FileWriter fout = new FileWriter(outputFile);
for(Node node:path){
// fout.write(node.state + " " + i++ + "\n");
System.out.println(node.state + " " + j++); //remove
}
//fout.close();
}
}
| [
"lalanimaulik@gmail.com"
] | lalanimaulik@gmail.com |
b6accbcfe5b98b764e7d28a3d0357b4e04d14e28 | 3bacbcbce8672037e89edf0a60b1e8440ebece7a | /Login/app/src/main/java/org/androidtown/login/profile.java | 73997ea33bb2041cf8f8bbadf87a0fee7e0d7a5a | [] | no_license | hankug1234/styx-app | 69742c65c49ecfbe7a1bdb2ac39623ee102e64c8 | f15aa61618c1b1fc157ae69ae295059d1740a9e7 | refs/heads/master | 2022-11-20T11:45:24.569471 | 2019-06-05T04:10:19 | 2019-06-05T04:10:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,324 | java | package org.androidtown.login;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
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 android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.Toast;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.ChildEventListener;
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 profile extends Fragment {
DatabaseReference userlist = FirebaseDatabase.getInstance().getReference("userlist/");
DatabaseReference user = FirebaseDatabase.getInstance().getReference("user/");
String UID = FirebaseAuth.getInstance().getCurrentUser().getUid();
ArrayList<friendInformation> friendList = new ArrayList<>();
friendRecycle recycle;
String myphone;
RecyclerView flist;
ImageButton submit;
EditText edit;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
loadPhone();
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.activity_profile,container,false);
flist = view.findViewById(R.id.friendlist);
edit = view.findViewById(R.id.friend);
submit = view.findViewById(R.id.fsubmit);
loadFriendList();
recycle = new friendRecycle(friendList,getContext());
flist.setAdapter(recycle);
flist.setLayoutManager(new LinearLayoutManager(getContext()));
submit.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
String p = edit.getText().toString();
edit.setText(null);
addFriend(p);
}
});
return view;
}
private void loadFriendList()
{
Query frelist = user.child(UID+"/friendlist/").orderByKey();
final DatabaseReference state = FirebaseDatabase.getInstance().getReference("userlist/");
frelist.addChildEventListener(new ChildEventListener() {
@Override
public void onChildAdded(@NonNull DataSnapshot dataSnapshot, @Nullable String s) {
final friendInformation f = new friendInformation(dataSnapshot.getValue().toString(),dataSnapshot.getKey());
Query ss = state.orderByChild("phone").equalTo(dataSnapshot.getKey());
ss.addChildEventListener(new ChildEventListener() {
@Override
public void onChildAdded(@NonNull DataSnapshot dataSnapshot, @Nullable String s) {
if(dataSnapshot.exists()) {
friendList.add(f);
for (int i = 0; i < friendList.size(); i++) {
if (friendList.get(i).getPhone().equals(dataSnapshot.child("phone/").getValue().toString())) {
if (dataSnapshot.child("state/").exists()) {
friendList.get(i).setState(dataSnapshot.child("state/").getValue().toString());
} else {
friendList.get(i).setState("free");
}
}
}
recycle.notifyDataSetChanged();
}
else
{}
}
@Override
public void onChildChanged(@NonNull DataSnapshot dataSnapshot, @Nullable String s) {
if(dataSnapshot.exists()) {
for (int i = 0; i < friendList.size(); i++) {
if (friendList.get(i).getPhone().equals(dataSnapshot.child("phone/").getValue().toString())) {
if (dataSnapshot.child("state/").exists()) {
friendList.get(i).setState(dataSnapshot.child("state/").getValue().toString());
} else {
friendList.get(i).setState("free");
}
}
}
}
else
{}
recycle.notifyDataSetChanged();
}
@Override
public void onChildRemoved(@NonNull DataSnapshot dataSnapshot) {
}
@Override
public void onChildMoved(@NonNull DataSnapshot dataSnapshot, @Nullable String s) {
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
}
});
}
@Override
public void onChildChanged(@NonNull DataSnapshot dataSnapshot, @Nullable String s) {
}
@Override
public void onChildRemoved(@NonNull DataSnapshot dataSnapshot) {
}
@Override
public void onChildMoved(@NonNull DataSnapshot dataSnapshot, @Nullable String s) {
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
}
});
}
private void addFriend(String phone)
{
if(phone.equals(myphone))
{
return;
}
Query friend = userlist.orderByChild("phone").equalTo(phone);
friend.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
if(dataSnapshot.exists())
{ DatabaseReference friendList = user.child(UID+"/").child("friendlist/");
if(dataSnapshot.getChildrenCount() == 1)
{
for(DataSnapshot data: dataSnapshot.getChildren() )
{
friendList.child(data.child("phone").getValue().toString()+"/").setValue(data.child("name/").getValue().toString());
}
}
else
{
Toast.makeText(getContext(),"too many child error",Toast.LENGTH_SHORT).show();
}
}
else
{
Toast.makeText(getContext(),"no search user",Toast.LENGTH_SHORT).show();
}
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
}
});
recycle.notifyDataSetChanged();
}
public void loadPhone()
{
DatabaseReference me = FirebaseDatabase.getInstance().getReference("user/"+UID+"/");
me.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
try{
myphone = dataSnapshot.child("phone").getValue().toString();}
catch (NullPointerException e){}
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
}
});
}
}
| [
"hankug1234.gihub.io"
] | hankug1234.gihub.io |
c08965f70f4b68c0014d1d65d9e6de3b7927662c | 6a3eb524adaa404980351c8b70182c94ed6a6b54 | /MC_Custom_PDS/src/com/mc_custom/pds/commands/RegionRegenCommand.java | 89fb19b89b85470715b3ebe1cd69b1c1381e0db2 | [] | no_license | cetaSYN/MC_Custom | 63791d76cb37fc173738e5250a5e5da69da2d17a | ae2f093ea68ae9b7604132fb050a5a19c9e24c98 | refs/heads/master | 2022-06-08T04:07:45.864870 | 2019-10-14T22:35:29 | 2019-10-14T22:35:29 | 194,199,411 | 1 | 1 | null | 2022-05-20T21:01:27 | 2019-06-28T03:22:58 | Java | UTF-8 | Java | false | false | 2,008 | java | package com.mc_custom.pds.commands;
import com.mc_custom.core.commands.BaseCommand;
import com.mc_custom.core.commands.MC_CustomCommand;
import com.mc_custom.core.exceptions.InvalidArgumentException;
import com.mc_custom.core.exceptions.NotOnlineException;
import com.mc_custom.core.exceptions.TooFewArgumentsException;
import com.mc_custom.core.utils.ChatColor;
import com.mc_custom.core.utils.WorldGuardHook;
import com.mc_custom.pds.MC_Custom_PDS;
import com.sk89q.worldguard.protection.managers.RegionManager;
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
import org.bukkit.World;
public class RegionRegenCommand extends BaseCommand {
@Override
public String[] getCommandNames() {
return new String[]{"pregen"};
}
@Override
public String getRequiredPermissions() {
return "pds.region.regen";
}
@Override
public String[] exec(MC_CustomCommand command) throws TooFewArgumentsException, InvalidArgumentException, NotOnlineException {
if ((!command.fromPlayer() && command.getArgs().length < 2) || command.getArgs().length < 1) {
throw new TooFewArgumentsException();
}
World world = null;
String region_name = command.getArg(0);
String world_name = command.getArg(1);
if (command.getArgs().length >= 2) {
world = MC_Custom_PDS.getWorld(world_name);
}
else if (command.fromPlayer()) {
world = command.getSenderPlayer().getWorld();
}
if (world == null) {
return new String[]{ChatColor.RED + "No such world \"" + world_name + "\""};
}
RegionManager region_manager = WorldGuardHook.WORLD_GUARD.getRegionManager(world);
if (!region_manager.hasRegion(region_name)) {
return new String[]{ChatColor.RED + "No such region \"" + region_name + "\""};
}
ProtectedRegion region = region_manager.getRegion(region_name);
return MC_Custom_PDS.regenerateRegion(region, world);
}
@Override
public String[] getHelp() {
return new String[]{
"Force a PDS region to regenerate",
"Syntax: /pregen <region_id> [world]"
};
}
}
| [
"46914689+cetaSYN@users.noreply.github.com"
] | 46914689+cetaSYN@users.noreply.github.com |
0ca7581a8e7d534624b49f8b3f2f55a51d417e0e | 32fa46c18df63074015ef7c879d0c3c2974ce24d | /Copytom_Project/src/copytom-back/src/main/java/org/iesalixar/copytom/controller/MessageResponse.java | 86714992e5564b13d5ef7dac91c49a65b353b2f4 | [] | no_license | juangccd/Proyecto-DAW-Copytom-Papeleria | 53eccba248d13d0ff27be4aab3c2eb7dc809f8c9 | 9d4cdd0a27970b31820016388787592d17ec6664 | refs/heads/master | 2023-06-01T22:57:05.514150 | 2021-06-18T17:16:15 | 2021-06-18T17:16:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 161 | java | package org.iesalixar.copytom.controller;
public class MessageResponse {
public MessageResponse(String string) {
// TODO Auto-generated constructor stub
}
} | [
"juangccd@gmail.com"
] | juangccd@gmail.com |
76bc4aa1410c5160728b0c3f860f4a78d4785377 | feb433459ea515572353aae822de0f31ffcb4350 | /app/build/generated/not_namespaced_r_class_sources/debug/r/androidx/legacy/coreutils/R.java | ee2f1d104abfdb058b20b826e4f0763b28f017cb | [] | no_license | PrachiBhosale18/Internship-Management | 7f3042bc1d3b38a7ddda970ddbe74dff6554320f | d6d4ad5d7e18935317ff01c5127c1bc6e8924c8f | refs/heads/master | 2022-12-11T08:07:23.462323 | 2020-07-17T10:14:02 | 2020-07-17T10:14:02 | 280,391,912 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,456 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* gradle plugin from the resource data it found. It
* should not be modified by hand.
*/
package androidx.legacy.coreutils;
public final class R {
private R() {}
public static final class attr {
private attr() {}
public static final int alpha = 0x7f030027;
public static final int font = 0x7f0300e0;
public static final int fontProviderAuthority = 0x7f0300e2;
public static final int fontProviderCerts = 0x7f0300e3;
public static final int fontProviderFetchStrategy = 0x7f0300e4;
public static final int fontProviderFetchTimeout = 0x7f0300e5;
public static final int fontProviderPackage = 0x7f0300e6;
public static final int fontProviderQuery = 0x7f0300e7;
public static final int fontStyle = 0x7f0300e8;
public static final int fontVariationSettings = 0x7f0300e9;
public static final int fontWeight = 0x7f0300ea;
public static final int ttcIndex = 0x7f030216;
}
public static final class color {
private color() {}
public static final int notification_action_color_filter = 0x7f05006a;
public static final int notification_icon_bg_color = 0x7f05006b;
public static final int ripple_material_light = 0x7f050076;
public static final int secondary_text_default_material_light = 0x7f050078;
}
public static final class dimen {
private dimen() {}
public static final int compat_button_inset_horizontal_material = 0x7f060053;
public static final int compat_button_inset_vertical_material = 0x7f060054;
public static final int compat_button_padding_horizontal_material = 0x7f060055;
public static final int compat_button_padding_vertical_material = 0x7f060056;
public static final int compat_control_corner_material = 0x7f060057;
public static final int compat_notification_large_icon_max_height = 0x7f060058;
public static final int compat_notification_large_icon_max_width = 0x7f060059;
public static final int notification_action_icon_size = 0x7f0600c5;
public static final int notification_action_text_size = 0x7f0600c6;
public static final int notification_big_circle_margin = 0x7f0600c7;
public static final int notification_content_margin_start = 0x7f0600c8;
public static final int notification_large_icon_height = 0x7f0600c9;
public static final int notification_large_icon_width = 0x7f0600ca;
public static final int notification_main_column_padding_top = 0x7f0600cb;
public static final int notification_media_narrow_margin = 0x7f0600cc;
public static final int notification_right_icon_size = 0x7f0600cd;
public static final int notification_right_side_padding_top = 0x7f0600ce;
public static final int notification_small_icon_background_padding = 0x7f0600cf;
public static final int notification_small_icon_size_as_large = 0x7f0600d0;
public static final int notification_subtext_size = 0x7f0600d1;
public static final int notification_top_pad = 0x7f0600d2;
public static final int notification_top_pad_large_text = 0x7f0600d3;
}
public static final class drawable {
private drawable() {}
public static final int notification_action_background = 0x7f070076;
public static final int notification_bg = 0x7f070077;
public static final int notification_bg_low = 0x7f070078;
public static final int notification_bg_low_normal = 0x7f070079;
public static final int notification_bg_low_pressed = 0x7f07007a;
public static final int notification_bg_normal = 0x7f07007b;
public static final int notification_bg_normal_pressed = 0x7f07007c;
public static final int notification_icon_background = 0x7f07007d;
public static final int notification_template_icon_bg = 0x7f07007e;
public static final int notification_template_icon_low_bg = 0x7f07007f;
public static final int notification_tile_bg = 0x7f070080;
public static final int notify_panel_notification_icon_bg = 0x7f070081;
}
public static final class id {
private id() {}
public static final int action_container = 0x7f08002f;
public static final int action_divider = 0x7f080031;
public static final int action_image = 0x7f080032;
public static final int action_text = 0x7f080038;
public static final int actions = 0x7f080039;
public static final int async = 0x7f080040;
public static final int blocking = 0x7f080044;
public static final int chronometer = 0x7f080051;
public static final int forever = 0x7f080077;
public static final int icon = 0x7f080080;
public static final int icon_group = 0x7f080081;
public static final int info = 0x7f080084;
public static final int italic = 0x7f080086;
public static final int line1 = 0x7f08008b;
public static final int line3 = 0x7f08008c;
public static final int normal = 0x7f08009a;
public static final int notification_background = 0x7f08009b;
public static final int notification_main_column = 0x7f08009c;
public static final int notification_main_column_container = 0x7f08009d;
public static final int right_icon = 0x7f0800ac;
public static final int right_side = 0x7f0800ad;
public static final int tag_transition_group = 0x7f0800df;
public static final int tag_unhandled_key_event_manager = 0x7f0800e0;
public static final int tag_unhandled_key_listeners = 0x7f0800e1;
public static final int text = 0x7f0800e2;
public static final int text2 = 0x7f0800e3;
public static final int time = 0x7f0800ff;
public static final int title = 0x7f080100;
}
public static final class integer {
private integer() {}
public static final int status_bar_notification_info_maxnum = 0x7f09000e;
}
public static final class layout {
private layout() {}
public static final int notification_action = 0x7f0b0035;
public static final int notification_action_tombstone = 0x7f0b0036;
public static final int notification_template_custom_big = 0x7f0b003d;
public static final int notification_template_icon_group = 0x7f0b003e;
public static final int notification_template_part_chronometer = 0x7f0b0042;
public static final int notification_template_part_time = 0x7f0b0043;
}
public static final class string {
private string() {}
public static final int status_bar_notification_info_overflow = 0x7f0d0032;
}
public static final class style {
private style() {}
public static final int TextAppearance_Compat_Notification = 0x7f0e0116;
public static final int TextAppearance_Compat_Notification_Info = 0x7f0e0117;
public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0e0119;
public static final int TextAppearance_Compat_Notification_Time = 0x7f0e011c;
public static final int TextAppearance_Compat_Notification_Title = 0x7f0e011e;
public static final int Widget_Compat_NotificationActionContainer = 0x7f0e01c8;
public static final int Widget_Compat_NotificationActionText = 0x7f0e01c9;
}
public static final class styleable {
private styleable() {}
public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f030027 };
public static final int ColorStateListItem_android_color = 0;
public static final int ColorStateListItem_android_alpha = 1;
public static final int ColorStateListItem_alpha = 2;
public static final int[] FontFamily = { 0x7f0300e2, 0x7f0300e3, 0x7f0300e4, 0x7f0300e5, 0x7f0300e6, 0x7f0300e7 };
public static final int FontFamily_fontProviderAuthority = 0;
public static final int FontFamily_fontProviderCerts = 1;
public static final int FontFamily_fontProviderFetchStrategy = 2;
public static final int FontFamily_fontProviderFetchTimeout = 3;
public static final int FontFamily_fontProviderPackage = 4;
public static final int FontFamily_fontProviderQuery = 5;
public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f0300e0, 0x7f0300e8, 0x7f0300e9, 0x7f0300ea, 0x7f030216 };
public static final int FontFamilyFont_android_font = 0;
public static final int FontFamilyFont_android_fontWeight = 1;
public static final int FontFamilyFont_android_fontStyle = 2;
public static final int FontFamilyFont_android_ttcIndex = 3;
public static final int FontFamilyFont_android_fontVariationSettings = 4;
public static final int FontFamilyFont_font = 5;
public static final int FontFamilyFont_fontStyle = 6;
public static final int FontFamilyFont_fontVariationSettings = 7;
public static final int FontFamilyFont_fontWeight = 8;
public static final int FontFamilyFont_ttcIndex = 9;
public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 };
public static final int GradientColor_android_startColor = 0;
public static final int GradientColor_android_endColor = 1;
public static final int GradientColor_android_type = 2;
public static final int GradientColor_android_centerX = 3;
public static final int GradientColor_android_centerY = 4;
public static final int GradientColor_android_gradientRadius = 5;
public static final int GradientColor_android_tileMode = 6;
public static final int GradientColor_android_centerColor = 7;
public static final int GradientColor_android_startX = 8;
public static final int GradientColor_android_startY = 9;
public static final int GradientColor_android_endX = 10;
public static final int GradientColor_android_endY = 11;
public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 };
public static final int GradientColorItem_android_color = 0;
public static final int GradientColorItem_android_offset = 1;
}
}
| [
"prachibhosale1807@gmail.com"
] | prachibhosale1807@gmail.com |
43cca76326819c789764274332d6d7ff69236401 | 824a75bb05ae7c697166b5ee59436114cc9210d4 | /reports/src/TotalAmountOfPayments.java | e7964f1bb0cf7eddf7419f64bfdc9d123d19f825 | [] | no_license | raghuvr7/birep1 | df2cdeb1864126d4fecccda8fa8706325f3408a6 | 7fcf3b6d8a31d12907b8ea85d874940b002dd6b1 | refs/heads/master | 2021-01-17T04:44:23.792212 | 2015-08-28T09:16:32 | 2015-08-28T09:16:32 | 41,537,932 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,120 | java |
import java.io.FileWriter;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/TotalAmountOfPayments")
public class TotalAmountOfPayments extends HttpServlet {
private static final long serialVersionUID = 1L;
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
try
{
Class.forName ("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@192.168.0.16:1521:orcl","scott","tiger");
String filename = "C:\\Users\\admin\\Desktop\\localrep\\reports\\WebContent\\TotalAmountOfPayments.csv";
FileWriter fw = new FileWriter(filename);
PreparedStatement pst;
String querry=" select to_char(bill_gen_date,'month'),sum(amount_paid) from payment where to_char(bill_gen_date,'year')=? group by to_char(bill_gen_date,'month')";
pst=conn.prepareStatement(querry);
pst.setString(1,request.getParameter("Year"));
fw.append("month");
fw.append(',');
fw.append("TotalPaid");
fw.append('\n');
ResultSet rset = pst.executeQuery();
while (rset.next())
{
System.out.println(rset.getString(1));
fw.append(rset.getString(1));
fw.append(',');
fw.append(""+rset.getInt(2));
fw.append('\n');
System.out.println("CSV Created Succesfully");
}
fw.close();
conn.close();
}
catch (Exception e)
{
System.out.println("Exception : " + e);
}
RequestDispatcher r =request.getRequestDispatcher("TotalAmountOfPaymentsD3.jsp");
r.forward(request, response);
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
}
| [
"admin@admin-PC"
] | admin@admin-PC |
53690534b65f9128e62c3947e7abb1cc8bba54d9 | 1d440ec8e8c9ea900d31109639b52d7a620b3568 | /ex003/src/main/java/org/zerock/mapper/ReplyMapper.java | a2e3e85333d65d923073187dc4b86b72ac584709 | [] | no_license | Dohyung7/Spring-Project | 657a05050f895c5b9a85ce6b1bb41b49bd665a87 | 1869310f9b21689d7d4eee8a54120b680211174f | refs/heads/master | 2022-12-01T20:14:26.501684 | 2020-06-14T01:04:29 | 2020-06-14T01:04:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 479 | java | package org.zerock.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.zerock.domain.Criteria;
import org.zerock.domain.ReplyVO;
public interface ReplyMapper {
public int insert(ReplyVO vo);
public ReplyVO read(Long bno);
public int delete (Long rno);
public int update(ReplyVO reply);
public List<ReplyVO> getListWithPaging(
@Param("cri") Criteria cri,
@Param("bno") Long bno);
public int getCountByBno(Long bno);
}
| [
"52536929+Dohyung7@users.noreply.github.com"
] | 52536929+Dohyung7@users.noreply.github.com |
9d44c680414c1628bc98e6af5b595b5289381184 | c633e2bcdc7d7535d4673eed4de3584763dff21b | /vehicles/src/main/java/br/unifacisa/map/vehicles/VehiclesApplication.java | 2edb036ec564267dd1f1b20d709a9d17f9d8a529 | [] | no_license | joaobosconff/Spring-Cloud | bae6508ce60fe6b8ad077d83c74f1729926fdef1 | ba5fac209b7aed425d6fd012574ac50ac5758cc5 | refs/heads/master | 2021-08-16T20:54:23.303028 | 2019-11-27T17:55:53 | 2019-11-27T17:55:53 | 224,314,597 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 410 | java | package br.unifacisa.map.vehicles;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
@SpringBootApplication
@EnableEurekaClient
public class VehiclesApplication {
public static void main(String[] args) {
SpringApplication.run(VehiclesApplication.class, args);
}
}
| [
"joaobosconff03@gmail.com"
] | joaobosconff03@gmail.com |
9d1d7c563c45a84c9fb9132f095c135f2651f5df | c8d4a2c71be0ba81a66356c63ada23a9b5505c56 | /src/main/java/com/umanizales/apibatallanaval/model/NodoDE.java | 80df42c7403208534881b3c6695e77947fb56cf4 | [] | no_license | YonAristizabal/ApiBatallaNaval | 5f8345bd220a2cf951d0a9d8686e939277b780e6 | faf1897b0cc73cd8020e92e7444deaca0a2e2d11 | refs/heads/master | 2023-05-19T04:19:52.069253 | 2021-06-04T23:46:36 | 2021-06-04T23:46:36 | 369,825,271 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 339 | java | package com.umanizales.apibatallanaval.model;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
@Getter
@Setter
public class NodoDE implements Serializable {
private Object dato;
private NodoDE siguiente;
private NodoDE anterior;
public NodoDE(Object dato) {
this.dato = dato;
}
}
| [
"ygaristizabal81046@umanizales.edu.co"
] | ygaristizabal81046@umanizales.edu.co |
89683804cb841de59c6878d41847c0f6163ba812 | 01563cf663b502102e22b73bd3ff6a16dde701d0 | /src/main/java/com/jk51/modules/common/gaode/GaoDeInvokingException.java | 63a750cd8aeb9cfdebdfbd2f589857f57577edbc | [] | no_license | tomzhang/springTestB | 17cc2d866723d7200302b068a30239732a9cda26 | af4bd2d5cc90d44f0b786fb115577a811d1eaac7 | refs/heads/master | 2020-05-02T04:35:50.729767 | 2018-10-24T02:24:35 | 2018-10-24T02:24:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 208 | java | package com.jk51.modules.common.gaode;
/**
* 高德调用异常
*/
public class GaoDeInvokingException extends RuntimeException {
public GaoDeInvokingException(Exception e) {
super(e);
}
}
| [
"gaojie@51jk.com"
] | gaojie@51jk.com |
256ef52ecc84feaf81c440c14e1b4e205ae2b6a0 | 5ef0b4d230dc5243225d149efb44cdcdd2ffea9d | /trunk/tm/src/tm/javaLang/parser/SimpleNode.java | 9bead9bf8da58835259af074cd603899172bedb3 | [
"Apache-2.0"
] | permissive | kai-zhu/the-teaching-machine-and-webwriter | 3d3b3dfdecd61e0fb2146b44c42d6467489fd94f | 67adf8f41bb475108c285eb0894906cb0878849c | refs/heads/master | 2021-01-16T20:47:55.620437 | 2016-05-23T12:38:03 | 2016-05-23T12:38:12 | 61,149,759 | 1 | 0 | null | 2016-06-14T19:22:57 | 2016-06-14T19:22:57 | null | UTF-8 | Java | false | false | 4,373 | java | // Copyright 1998--2010 Michael Bruce-Lockhart and Theodore S. Norvell
//
// 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.
/* Generated By:JJTree: Do not edit this line. SimpleNode.java */
package tm.javaLang.parser;
import tm.clc.analysis.Declaration;
import tm.clc.analysis.ScopedName;
import tm.interfaces.SourceCoords;
import tm.javaLang.analysis.Java_SpecifierSet;
/*******************************************************************************
Class: SimpleNode
Overview:
This class represents a node in the parse tree.
*******************************************************************************/
public class SimpleNode implements Node {
protected Node parent;
protected Node[] children;
/** The type of node */
protected int id;
protected JavaParser parser;
protected Token first, last;
private Declaration myDecl;
// **** Added by Jon (2002 08 19) ********************************************
private boolean myBoolean;
private int myInt;
private String myString;
private ScopedName myName;
private Java_SpecifierSet mySpecSet;
private SourceCoords myCoords ;
public void setBoolean(boolean toSet) { myBoolean = toSet; }
public void setInt(int toSet) { myInt = toSet; }
public void setString(String toSet) { myString = toSet; }
public void setName(ScopedName toSet) { myName = toSet; }
public void setSpecSet(Java_SpecifierSet toSet) { mySpecSet = toSet; }
public void setCoords( SourceCoords toSet ) { myCoords = toSet ; }
public boolean getBoolean() { return myBoolean; }
public int getInt() { return myInt; }
public String getString() { return myString; }
public ScopedName getName() { return myName; }
public Java_SpecifierSet getSpecSet() { return mySpecSet; }
public SourceCoords getCoords() { return myCoords ; }
//****************************************************************************
public SimpleNode(int i) { id = i; }
public SimpleNode(JavaParser p, int i) {
this(i);
parser = p;
}
public Declaration getDecl() { return myDecl; }
public void setDecl(Declaration decl) { myDecl = decl; }
public void jjtOpen() { first = parser.getToken(1); }
public void jjtClose() { last = parser.getToken(0); }
public Token getFirstToken() { return first; }
public Token getLastToken() { return last; }
public void jjtSetParent(Node n) { parent = n; }
public Node jjtGetParent() { return parent; }
public void jjtAddChild(Node n, int i) {
if (children == null) {
children = new Node[i + 1];
} else if (i >= children.length) {
Node c[] = new Node[i + 1];
System.arraycopy(children, 0, c, 0, children.length);
children = c;
}
children[i] = n;
}
public Node jjtGetChild(int i) {
return children[i];
}
public int jjtGetNumChildren() {
return (children == null) ? 0 : children.length;
}
/** Accept the visitor. **/
public Object jjtAccept(JavaParserVisitor visitor, Object data) {
return visitor.visit(this, data);
}
/** Accept the visitor. **/
public Object childrenAccept(JavaParserVisitor visitor, Object data) {
if (children != null) {
for (int i = 0; i < children.length; i++) {
children[i].jjtAccept(visitor, data);
}
}
return data;
}
public String toString() { return JavaParserTreeConstants.jjtNodeName[id]; }
public String toString(String prefix) { return prefix + toString(); }
public void dump(String prefix) {
System.out.println(toString(prefix));
if (children != null) {
for (int i = 0; i < children.length; ++i) {
SimpleNode n = (SimpleNode)children[i];
if (n != null) {
n.dump(prefix + " ");
}
}
}
}
}
| [
"theodore.norvell@gmail.com"
] | theodore.norvell@gmail.com |
4cbf1c66a6ba1e482438d2a963d5ad7186283def | 776f7a8bbd6aac23678aa99b72c14e8dd332e146 | /src/com/upsight/android/analytics/event/content/UpsightContentViewEvent$Builder.java | 5257e1278c95fa65114857f0791c8a54779513d7 | [] | no_license | arvinthrak/com.nianticlabs.pokemongo | aea656acdc6aa419904f02b7331f431e9a8bba39 | bcf8617bafd27e64f165e107fdc820d85bedbc3a | refs/heads/master | 2020-05-17T15:14:22.431395 | 2016-07-21T03:36:14 | 2016-07-21T03:36:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,197 | java | package com.upsight.android.analytics.event.content;
import com.upsight.android.analytics.event.UpsightPublisherData.Builder;
import com.upsight.android.analytics.internal.AnalyticsEvent.Builder;
public class UpsightContentViewEvent$Builder
extends AnalyticsEvent.Builder<UpsightContentViewEvent, UpsightContentViewEvent.UpsightData>
{
private Integer contentId;
private String scope;
private String streamId;
private String streamStartTs;
protected UpsightContentViewEvent$Builder(String paramString, Integer paramInteger)
{
streamId = paramString;
contentId = paramInteger;
}
protected UpsightContentViewEvent build()
{
return new UpsightContentViewEvent("upsight.content.view", new UpsightContentViewEvent.UpsightData(this), mPublisherDataBuilder.build());
}
public Builder setScope(String paramString)
{
scope = paramString;
return this;
}
public Builder setStreamStartTs(String paramString)
{
streamStartTs = paramString;
return this;
}
}
/* Location:
* Qualified Name: com.upsight.android.analytics.event.content.UpsightContentViewEvent.Builder
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"reverseengineeringer@hackeradmin.com"
] | reverseengineeringer@hackeradmin.com |
139a415c29bb8557c83d9caa8134d81e0803ae3d | 021d38058a0f97e703b1a2891ae9e4c413a7a386 | /Week4/ServletFilterExample/src/com/journaldev/servlet/filters/RequestLoggingFilter.java | 7dcc179239e817ce59dd602ae4aa14eb1c6c94f4 | [] | no_license | nhunguyen76/BE_Novahub_Internship_Nhu | f48db0674ceb31d08b093046dc2398adc8a3ef6d | dbe0054be4d835756b2e3e7604ac18b3d71a33d6 | refs/heads/master | 2021-09-02T12:20:31.025978 | 2018-01-02T15:05:14 | 2018-01-02T15:05:14 | 113,452,430 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,758 | java | package com.journaldev.servlet.filters;
import java.io.IOException;
import java.util.Enumeration;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
/**
* Servlet implementation class RequestLoggingFilter
*/
@WebFilter("/RequestLoggingFilter")
public class RequestLoggingFilter implements Filter {
private ServletContext context;
public void init(FilterConfig fConfig) throws ServletException{
this.context = fConfig.getServletContext();
this.context.log("RequestLoggingFilter initialized");
}
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
HttpServletRequest req = (HttpServletRequest) request;
Enumeration<String> params = req.getParameterNames();
while(params.hasMoreElements()) {
String name = params.nextElement();
String value = request.getParameter(name);
this.context.log(req.getRemoteAddr() + "::Request Params::{"+name+"="+value+"}");
}
Cookie[] cookies = req.getCookies();
if(cookies != null){
for(Cookie cookie : cookies){
this.context.log(req.getRemoteAddr() + "::Cookie::{"+cookie.getName()+","+cookie.getValue()+"}");
}
}
// pass the request along the filter chain
chain.doFilter(request, response);
}
public void destroy() {
//we can close resources here
}
}
| [
"ntqn960607@gmail.com"
] | ntqn960607@gmail.com |
470d48ff5c528118bb82f00f66cd2c2f7fff1e16 | fba8af31d5d36d8a6cf0c341faed98b6cd5ec0cb | /src/main/java/com/alipay/api/domain/AlipayOpenMiniBaseinfoMultiQueryModel.java | 4ad1137eac47e1319a14fe421e758d8381d8c787 | [
"Apache-2.0"
] | permissive | planesweep/alipay-sdk-java-all | b60ea1437e3377582bd08c61f942018891ce7762 | 637edbcc5ed137c2b55064521f24b675c3080e37 | refs/heads/master | 2020-12-12T09:23:19.133661 | 2020-01-09T11:04:31 | 2020-01-09T11:04:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 847 | java | package com.alipay.api.domain;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
/**
* 小程序查询多端基础信息
*
* @author auto create
* @since 1.0, 2019-09-16 11:49:26
*/
public class AlipayOpenMiniBaseinfoMultiQueryModel extends AlipayObject {
private static final long serialVersionUID = 5817272779644865324L;
/**
* 应用端信息
*/
@ApiField("bundle_id")
private String bundleId;
/**
* 小程序id
*/
@ApiField("mini_app_id")
private String miniAppId;
public String getBundleId() {
return this.bundleId;
}
public void setBundleId(String bundleId) {
this.bundleId = bundleId;
}
public String getMiniAppId() {
return this.miniAppId;
}
public void setMiniAppId(String miniAppId) {
this.miniAppId = miniAppId;
}
}
| [
"ben.zy@antfin.com"
] | ben.zy@antfin.com |
bc087410c676c0867e3a84801e3fddd91a07e1b4 | 1a9f35a866d337d919158c2f049b4a9de3690550 | /Week5/src/hust/soict/hedspi/lab02/Bai4/mainFunction.java | 289ece96363d7b0f84fa9767fdc9ba98b78d5fa8 | [] | no_license | krazezt/OOP-Assignments | 174bc64edbe7837c66f7dee5096acb393b4b357f | 98b14284f0456eb511898b7b33d6cecad2eadbe6 | refs/heads/master | 2023-04-22T00:24:41.526255 | 2021-05-10T13:44:19 | 2021-05-10T13:44:19 | 342,141,082 | 0 | 0 | null | 2021-03-08T13:36:58 | 2021-02-25T06:07:12 | Java | UTF-8 | Java | false | false | 752 | java | package hust.soict.hedspi.lab02.Bai4;
import java.util.Scanner;
public class mainFunction {
public static void main(String[] args) {
Scanner a = new Scanner(System.in);
System.out.print("Nhap so phan tu cho mang : ");
int n = a.nextInt();
System.out.print("Nhap cac phan tu cua mang : ");
int[] iArr = new int[n];
for (int i = 0; i < n ; i++) {
iArr[i] = a.nextInt();
}
arrayToSort opn = new arrayToSort();
opn.setValuesOfArray(iArr);
opn.sort();
iArr = opn.getValue();
System.out.print("Mang sau khi da sap xep :");
for (int i = 0; i < n; i++) {
System.out.print(" " + iArr[i]);
}
a.close();
}
} | [
"quan5555qt@gmail.com"
] | quan5555qt@gmail.com |
66e337dd1f9600d113a296c36c2e3150d354f263 | a85d2dccd5eab048b22b2d66a0c9b8a3fba4d6c2 | /rebellion_h5_realm/java/l2r/gameserver/randoms/Visuals.java | b9d0566a7d712047e5246d10b7a0b99ae487f905 | [] | no_license | netvirus/reb_h5_storm | 96d29bf16c9068f4d65311f3d93c8794737d4f4e | 861f7845e1851eb3c22d2a48135ee88f3dd36f5c | refs/heads/master | 2023-04-11T18:23:59.957180 | 2021-04-18T02:53:10 | 2021-04-18T02:53:10 | 252,070,605 | 0 | 0 | null | 2021-04-18T02:53:11 | 2020-04-01T04:19:39 | HTML | UTF-8 | Java | false | false | 10,404 | java | package l2r.gameserver.randoms;
import l2r.gameserver.Config;
import l2r.gameserver.ThreadPoolManager;
import l2r.gameserver.data.xml.holder.NpcHolder;
import l2r.gameserver.instancemanager.ReflectionManager;
import l2r.gameserver.model.GameObjectsStorage;
import l2r.gameserver.model.Player;
import l2r.gameserver.model.Zone.ZoneType;
import l2r.gameserver.model.base.TeamType;
import l2r.gameserver.model.instances.NpcInstance;
import l2r.gameserver.model.instances.VisualInstance;
import l2r.gameserver.network.serverpackets.NpcInfo;
import l2r.gameserver.network.serverpackets.components.ChatType;
import l2r.gameserver.nexus_interface.NexusEvents;
import l2r.gameserver.skills.AbnormalEffect;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.concurrent.ScheduledFuture;
import javax.xml.parsers.DocumentBuilderFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
/**
*
* @author Infern0
* @Idea Midnex
*
*/
public class Visuals
{
private static ScheduledFuture<?> _deleteVisualNpcTask;
private static final Logger _log = LoggerFactory.getLogger(Visuals.class);
private Map<Integer, VisualData> _availableItems = new HashMap<Integer, VisualData>();
private Map<Integer, String> _npcs = new HashMap<Integer, String>();
public Map<Integer, VisualData> getavailableItems()
{
return _availableItems;
}
public int getCountBySlot(int slot)
{
int count = 0;
for (VisualData data : _availableItems.values())
{
if (data.getSlot() == slot)
count++;
}
return count;
}
public List<Integer> getVisual(int slotId, int frompage, int topage)
{
List<Integer> _temp = new ArrayList<Integer>();
int i = -1;
SortedMap<Integer, VisualData> sortedMap = new TreeMap<>(_availableItems);
for(Entry<Integer, VisualData> items : sortedMap.entrySet())
{
if (items.getValue().getSlot() != slotId)
continue;
i++;
if(frompage > i)
continue;
if(topage == i)
break;
_temp.add(items.getKey());
}
Collections.sort(_temp);
return _temp;
}
public int getPageIn(int slot, int itemId)
{
int page = 1;
int c = 0;
SortedMap<Integer, VisualData> sortedMap = new TreeMap<>(_availableItems);
for(Entry<Integer, VisualData> data : sortedMap.entrySet())
{
if (data.getValue().getSlot() != slot)
continue;
c++;
if(c > 4)
{
c = 1;
page++;
}
if(data.getKey() == itemId)
break;
}
return page;
}
public boolean isAvailable(int slot, int itemId)
{
SortedMap<Integer, VisualData> sortedMap = new TreeMap<>(_availableItems);
for(Entry<Integer, VisualData> data : sortedMap.entrySet())
{
if (data.getKey() == itemId && data.getValue().getSlot() == slot)
return true;
}
return false;
}
public void load()
{
_availableItems.clear();
try
{
File file = new File(Config.DATAPACK_ROOT + "/data/visualItems.xml");
DocumentBuilderFactory factory1 = DocumentBuilderFactory.newInstance();
factory1.setValidating(false);
factory1.setIgnoringComments(true);
Document doc1 = factory1.newDocumentBuilder().parse(file);
for(Node n1 = doc1.getFirstChild(); n1 != null; n1 = n1.getNextSibling())
if("list".equalsIgnoreCase(n1.getNodeName()))
for(Node d1 = n1.getFirstChild(); d1 != null; d1 = d1.getNextSibling())
if("set".equalsIgnoreCase(d1.getNodeName()))
{
int slot = Integer.parseInt(d1.getAttributes().getNamedItem("slot").getNodeValue());
int itemid = Integer.parseInt(d1.getAttributes().getNamedItem("itemid").getNodeValue());
int costid = Integer.parseInt(d1.getAttributes().getNamedItem("costid").getNodeValue());
long price = Long.parseLong(d1.getAttributes().getNamedItem("price").getNodeValue());
VisualData data = new VisualData();
data.setSlot(slot);
data.setCostId(costid);
data.setCostAmount(price);
_availableItems.put(itemid, data);
}
}
catch(Exception e)
{
e.printStackTrace();
}
_log.info("Visual System Loaded: Total Items " + _availableItems.size());
}
public void spawnVisual(Player player)
{
if (!Config.ENABLE_VISUAL_SYSTEM)
{
player.sendChatMessage(0, ChatType.TELL.ordinal(), "Visuals", "Visual transformation is disabled!");
return;
}
if (player == null)
return;
// Conditions
if (!player.isGM())
{
if (player.isInJail() || player.isCursedWeaponEquipped() || NexusEvents.isInEvent(player) || player.getReflectionId() != ReflectionManager.DEFAULT_ID/* || player.getPvpFlag() != 0*/ || player.isDead() || player.isAlikeDead() || player.isCastingNow() || player.isInCombat() || player.isAttackingNow() || player.isInOlympiadMode() || player.isFlying() || player.isTerritoryFlagEquipped() || player.isInZone(ZoneType.no_escape) || player.isInZone(ZoneType.SIEGE) || player.isInZone(ZoneType.epic))
{
player.sendChatMessage(0, ChatType.TELL.ordinal(), "Visuals", "Cannot be spawned now due conditions");
return;
}
if (!player.isInZone(ZoneType.peace_zone))
{
player.sendChatMessage(0, ChatType.TELL.ordinal(), "Visuals", "You must be inside peace zone to spawn Visual NPC!");
return;
}
if(player.isTerritoryFlagEquipped() || player.isCombatFlagEquipped())
{
player.sendChatMessage(0, ChatType.TELL.ordinal(), "Visuals", "You cannot use this NPC while holding Territory Flag.");
return;
}
}
if (_npcs.containsValue(player.getName()))
{
player.sendMessageS("You already have spawned visual NPC.", 3);
player.sendChatMessage(0, ChatType.TELL.ordinal(), "Visuals", "You already have spawned Visual NPC.");
return;
}
String items;
if (player.getVar("visualItems") != null)
{
String[] var = player.getVar("visualItems").split(";");
items = var[0] + "," + var[1] + "," + var[2] + "," + var[3] + "," + var[4] + "," + var[5] + "," + var[6] + "," + var[7] + "," + var[8] + "," + var[9] + "," + var[10];
}
else
items = "0,0,0,0,0,0,0,0,-1,-1,-1";
NpcInstance npc = spawnVisualNpc(player, 603, "Visual", player.getName() + " Model", items);
if (npc == null)
{
_log.error("Visualizer: Cannot create visual NPC....");
return;
}
// Spawn the default model and add it to list.
_npcs.put(npc.getObjectId(), player.getName());
// Small cheat to call visualizerinstnace...
npc.showChatWindow(player, 0, new Object[] {});
// Schedule delete of the npc.
startVisualNpcDelete(npc.getObjectId());
player.sendMessageS("You have spawned Visual NPC. It will be deleted in " + Config.VISUAL_NPC_DELETE_TIME + " minutes.", 3);
player.sendChatMessage(0, ChatType.TELL.ordinal(), "Visuals", "You have spawned Visual NPC. It will be deleted in " + Config.VISUAL_NPC_DELETE_TIME + " minutes.");
player.sendPacket(new NpcInfo(npc, player));
}
private NpcInstance spawnVisualNpc(Player player, int npcId, String name, String title, String items)
{
try
{
NpcInstance npc = NpcHolder.getInstance().getTemplate(npcId).getNewInstance();
String[] item = items.split(",");
((VisualInstance) npc).setItems(Integer.parseInt(item[0]), Integer.parseInt(item[1]), Integer.parseInt(item[2]), Integer.parseInt(item[3]), Integer.parseInt(item[4]), Integer.parseInt(item[5]), Integer.parseInt(item[6]), Integer.parseInt(item[7]), Integer.parseInt(item[8]), Integer.parseInt(item[9]), Integer.parseInt(item[10]));
npc.setName(name);
npc.setTitle(title);
npc.startAbnormalEffect(AbnormalEffect.FLAME);
npc.setTeam(TeamType.BLUE);
npc.setReflection(player.getReflectionId());
npc.setSpawnedLoc(player.getLoc().findPointToStay(20, 100).correctGeoZ());
npc.spawnMe(npc.getSpawnedLoc());
return npc;
}
catch(Exception e)
{
e.printStackTrace();
}
return null;
}
private class deleteNpc implements Runnable
{
private final int _npcID;
private deleteNpc(int id)
{
_npcID = id;
}
@Override
public void run()
{
NpcInstance npc = GameObjectsStorage.getNpc(_npcID);
if (npc != null)
npc.deleteMe();
if (_npcs.containsKey(_npcID))
_npcs.remove(_npcID);
}
}
public void startVisualNpcDelete(int npcObject)
{
_deleteVisualNpcTask = ThreadPoolManager.getInstance().schedule(new deleteNpc(npcObject), Config.VISUAL_NPC_DELETE_TIME * 60000);
}
public void endVisualNpcDelete()
{
if(_deleteVisualNpcTask != null)
{
_deleteVisualNpcTask.cancel(true);
_deleteVisualNpcTask = null;
}
}
public void destroyVisual(String playerName)
{
if (playerName == null)
return;
endVisualNpcDelete();
if (_npcs == null)
return;
for(Entry<Integer, String> entry : _npcs.entrySet())
{
int npcObject = entry.getKey();
String plrName = entry.getValue();
if (plrName == null || plrName.isEmpty())
continue;
if (plrName.equalsIgnoreCase(playerName))
{
NpcInstance npc = GameObjectsStorage.getNpc(npcObject);
if (npc != null)
npc.deleteMe();
if (_npcs.containsKey(npcObject))
_npcs.remove(npcObject);
}
}
}
public Map<Integer, String> getAllSpawnedNPCs()
{
return _npcs;
}
public class VisualData
{
private int _slot = -1;
private int _costId = 0;
private long _costAmount = 0;
public int getSlot()
{
return _slot;
}
public void setSlot(int id)
{
_slot = id;
}
public int getCostId()
{
return _costId;
}
public void setCostId(int id)
{
_costId = id;
}
public long getCostAmount()
{
return _costAmount;
}
public void setCostAmount(long amount)
{
_costAmount = amount;
}
}
public static final Visuals getInstance()
{
return SingletonHolder._instance;
}
private static class SingletonHolder
{
protected static final Visuals _instance = new Visuals();
}
}
| [
"l2agedev@gmail.com"
] | l2agedev@gmail.com |
7c0456fcaaadd1fedf2f1a052a0b808f194b45d7 | b4154ea225367eb46f13524693006bb2febd6268 | /MavenProject/src/test/java/com/testng/PriorityDemo.java | 013f944d3c569f40da0911ee6af3d7cf3433cf0d | [] | no_license | karthicksiva9625/InterviewPrograms | 83c7f440d8188a776b06fd61bd969076466e344d | 5936dfa6c49c7c74e6f986cfda2e62754a3e7b0f | refs/heads/master | 2023-03-01T11:22:51.672026 | 2021-02-01T12:06:25 | 2021-02-01T12:06:25 | 334,622,092 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 520 | java | package com.testng;
import org.testng.annotations.Test;
public class PriorityDemo {
@Test(priority =5 )
private void fifthrank5() {
System.out.println("RANK5");
}
@Test(priority = 3)
private void thirdrank3() {
System.out.println("RANK3");
}
@Test(priority = 1)
private void firstrank1() {
System.out.println("RANK1");
}
@Test(priority = 4)
private void fourthrank4() {
System.out.println("RANK4");
}
@Test(priority = 2)
private void secondrank2() {
System.out.println("RANK2");
}
}
| [
"karthickrs9625@gmail.com"
] | karthickrs9625@gmail.com |
1624b52f1b4e75a08ae4e2402dbfa4a0c258ee4b | 1cbbf013476acb9d835175ed08a6b20e4b07de33 | /src/main/java/edu/kis/powp/jobs2d/command/OperateToCommand.java | 4f69bb44d1ab34057fc98a1c15ff6406e007cee7 | [] | no_license | Tachulek/powp_jobs2d_project | 425ce36abc950e9384b20d204d421898f52f249e | 9a847108d7079f4c1af1a514bfa33d7b7ec5f31b | refs/heads/master | 2020-08-06T22:47:59.287963 | 2019-11-15T15:02:26 | 2019-11-15T15:02:26 | 213,188,293 | 0 | 0 | null | 2019-10-06T14:59:05 | 2019-10-06T14:59:04 | null | UTF-8 | Java | false | false | 410 | java | package edu.kis.powp.jobs2d.command;
import edu.kis.powp.jobs2d.Job2dDriver;
public class OperateToCommand implements DriverCommand {
int x;
int y;
Job2dDriver job2dDriver;
public OperateToCommand(Job2dDriver j) {
// TODO Auto-generated constructor stub
job2dDriver = j;
}
@Override
public void execute()
{
System.out.println("execute z OperateTo");
job2dDriver.operateTo(x, y);
}
}
| [
"Dawid.Jany@Harman.com"
] | Dawid.Jany@Harman.com |
8c9fb979bf55abc6d56789549970b6eae9fd26a8 | 77882ab3cd9bffcae5c26628cf976256472aadb8 | /src/com/tc/servlet/SignUpdateServlet.java | 2a482590fb370cd5de691242d0786552024c38b1 | [] | no_license | superma1997/Supermabox | 8adbb4bc137464e4357116ffa82488b41ae2389e | 293785af655cf074ea42e84918d17e81311f4f24 | refs/heads/master | 2022-11-12T22:47:56.386400 | 2020-07-10T09:36:14 | 2020-07-10T09:36:14 | 278,551,647 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 1,869 | java | package com.tc.servlet;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.sun.security.ntlm.Client;
import com.tc.pojo.SignTCcheckwork;
import com.tc.service.SignUpdateService;
@WebServlet("/UpdateServlet")
public class SignUpdateServlet extends HttpServlet {
SignUpdateService us=new SignUpdateService();
private static final long serialVersionUID = 1L;
public SignUpdateServlet() {
}
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
resp.setContentType("text/html;charset=utf-8");
resp.setCharacterEncoding("utf-8");
req.setCharacterEncoding("utf-8");
//获取数据
int strId=(Integer.parseInt(req.getParameter("txtId")));
req.setAttribute("strid", strId);
req.getRequestDispatcher("QDUpdate.jsp").forward(req, resp);;
/*
String strName=req.getParameter("txtName");
String strMdate=req.getParameter("txtMdate");
String strMstate=req.getParameter("txtMstate");
System.out.println(strId);
TCcheckwork tck=new TCcheckwork();
tck.setId(strId);
tck.setName(strName);
tck.setMdate(strMdate);
tck.setMstate(strMstate);
if(us.UpdateTCcheckwork(tck)){
req.setAttribute("update", tck);
req.getRequestDispatcher("Update.html").forward(req, resp);
}
Client c=us.UpdateTCcheckwork(strId);
req.setAttribute("news", c);
update(req,resp);
//转发
req.getRequestDispatcher("clientupdate.jsp").forward(req,resp);
select(req,resp);*/
}
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doGet(request, response);
}
}
| [
"2108627927@qq.com"
] | 2108627927@qq.com |
122332c92694991f9c640c8ff06c9b5b377dbc3f | ed79b79fb7e6e2b42f3017daddccbc7c7e9e7da9 | /src/com/sbs/example/jspCommunity/controller/UsrHomeController.java | c48d1f4fcb59bdf1cc590b06e81a0ef7495e5598 | [] | no_license | ParHanSung/jspCommunity | d0ad48e9bbea261886f5dae1daf755f9042ae6af | 2ba42a58ae44778f50da43a5f3c7d69345006b3c | refs/heads/master | 2023-06-10T21:27:12.637717 | 2021-06-30T01:51:57 | 2021-06-30T01:51:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,064 | java | package com.sbs.example.jspCommunity.controller;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.sbs.example.jspCommunity.container.Container;
import com.sbs.example.jspCommunity.dto.Article;
import com.sbs.example.jspCommunity.dto.Board;
import com.sbs.example.jspCommunity.dto.Member;
import com.sbs.example.jspCommunity.service.ArticleService;
import com.sbs.example.jspCommunity.service.MemberService;
import com.sbs.example.jspCommunity.util.Util;
public class UsrHomeController extends Controller {
private ArticleService articleService;
public UsrHomeController() {
articleService = Container.articleService;
}
public String showMain(HttpServletRequest req, HttpServletResponse resp) {
String boardCode = "meme";
List<Article> articles = articleService.getForPrintArticlesByBoardCode(boardCode);
req.setAttribute("articles", articles);
return "usr/home/main";
}
}
| [
"qbj700@gmail.com"
] | qbj700@gmail.com |
873d1765903d90975859c9dc1b63720b84299656 | ff7dc108d9998ee6fd2227b919745ef6e2e68651 | /src/test/java/com/directori/book/springboot/domain/posts/PostsRepositoryTest.java | 0f231f3a00dc5665b9f3a2583731e42f917dcd15 | [] | no_license | alicesister1/springboot2-webservice | f997623231208bab6108002a3eff7deb1ddc5ce0 | 26b34b530d0ce0cc73c6e0c6d968bbfd4a169472 | refs/heads/master | 2023-03-19T06:34:30.947729 | 2022-02-06T15:18:06 | 2022-02-06T15:18:06 | 237,974,516 | 0 | 0 | null | 2023-03-02T19:59:01 | 2020-02-03T13:42:48 | Java | UTF-8 | Java | false | false | 1,772 | java | package com.directori.book.springboot.domain.posts;
import java.time.LocalDateTime;
import org.junit.After;
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 java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
@RunWith(SpringRunner.class)
@SpringBootTest
public class PostsRepositoryTest {
@Autowired
PostsRepository postsRepository;
@After
public void cleanup() {
postsRepository.deleteAll();
}
@Test
public void 게시글저장_불러오기() {
//given
String title = "테스트 게시글";
String content = "테스트 본문";
postsRepository.save(Posts.builder()
.title(title)
.content(content)
.author("example@mail.com")
.build());
//when
List<Posts> postsList = postsRepository.findAll();
//then
Posts posts = postsList.get(0);
assertThat(posts.getTitle()).isEqualTo(title);
assertThat(posts.getContent()).isEqualTo(content);
}
@Test
public void BaseTimeEntity_등록() {
//given
LocalDateTime now = LocalDateTime.of(2020,02,07,0,0);
postsRepository.save(Posts.builder()
.title("title")
.content("content")
.author("author")
.build());
//when
List<Posts> postsList = postsRepository.findAll();
//then
Posts posts = postsList.get(0);
System.out.println(">>>>>>>> createdDate=" + posts.getCreatedDate()
+ ", modifiedDate=" + posts.getModifiedDate());
assertThat(posts.getCreatedDate()).isAfter(now);
assertThat(posts.getModifiedDate()).isAfter(now);
}
}
| [
"alicesister1@gmail.com"
] | alicesister1@gmail.com |
6969988b33ce00ea364deee9c5108c01789ec23a | f9f585676cd3d0dea29bf8c25a7f92a1d4ed9ed1 | /SisEscolarView/src/br/com/sisescolar/viewmantemendereco/ConsultaEnderecoView.java | 4db8b2705d5a09b423d07f22028706dd4eac3068 | [] | no_license | ElianeCosta/SisEscolar | 00e42df2330f79401b322b4f437d9478a02a00fe | 89b0971f4e0233c87f278d2b24308ee55325ee7e | refs/heads/master | 2023-07-03T07:25:06.667676 | 2021-08-10T03:14:18 | 2021-08-10T03:14:18 | 394,509,720 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,866 | java | package br.com.sisescolar.viewmantemendereco;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.List;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.border.EmptyBorder;
import javax.swing.table.DefaultTableModel;
import br.com.sisescolar.fachada.dto.mantemendereco.ConsultaEnderecoFiltroDTO;
import br.com.sisescolar.fachada.dto.mantemendereco.ConsultaEnderecoRetornoDTO;
import br.com.sisescolar.fachada.mantemendereco.IMantemEnderecoFachada;
import br.com.sisescolar.fachada.mantemendereco.MantemEnderecoFachada;
import br.com.sisescolar.view.SisEscolarBaseView;
public class ConsultaEnderecoView extends SisEscolarBaseView {
/**
*
*/
private static final long serialVersionUID = -804127239715659037L;
/**
*
*/
private JPanel contentPane;
private JTextField textIdAluno;
private JTextField textNomeCidade;
private DefaultTableModel defTableModel;
private JTable tabela;
private JButton btnVisualizar;
private JButton btnExcluir;
private JButton btnAlterar;
/**
* Launch the application.
*/
private IMantemEnderecoFachada fachada;
/**
* Launch the application.
*/
public static void main(String[] args) {
ConsultaEnderecoView frame = new ConsultaEnderecoView();
frame.setVisible(Boolean.TRUE);
}
/**
* Create the frame.
*/
public ConsultaEnderecoView() {
super("Consultar Endereco:");
setResizable(false);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 523, 430);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JLabel lblNewLabel = new JLabel("IdAluno:");
lblNewLabel.setBounds(10, 11, 63, 14);
contentPane.add(lblNewLabel);
this.textIdAluno = new JTextField();
this.textIdAluno.setBounds(85, 8, 95, 23);
contentPane.add(this.textIdAluno);
this.textIdAluno.setColumns(10);
JLabel lblNewLabel_1 = new JLabel("NomeCidade:");
lblNewLabel_1.setBounds(10, 45, 89, 14);
contentPane.add(lblNewLabel_1);
this.textNomeCidade = new JTextField();
this.textNomeCidade.setBounds(86, 39, 197, 23);
contentPane.add(this.textNomeCidade);
this.textNomeCidade.setColumns(10);
JButton btnProcurar = new JButton("Procurar");
btnProcurar.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
onclickProcurar();
}
});
btnProcurar.setBounds(400, 42, 95, 23);
contentPane.add(btnProcurar);
JLabel lblNewLabel_2 = new JLabel("Resultado Da Pesquisa:");
lblNewLabel_2.setBounds(10, 76, 144, 14);
contentPane.add(lblNewLabel_2);
String[] colunas = { "IdAluno", "IdCidade", "cep", "Rua", "Complemento", "NomeCidade" };
this.defTableModel = new DefaultTableModel(null, colunas);
this.tabela = new JTable(this.defTableModel);
JScrollPane scrollPane = new JScrollPane(tabela);
scrollPane.setBounds(10, 102, 485, 239);
contentPane.add(scrollPane);
this.btnVisualizar = new JButton("Vizualizar");
btnVisualizar.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
onclickVisualizar();
}
});
btnVisualizar.setEnabled(false);
this.btnVisualizar.setBounds(85, 352, 89, 23);
contentPane.add(this.btnVisualizar);
JButton btnIncluir = new JButton("Incluir");
btnIncluir.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
onclickBtnIncluir();
}
});
btnIncluir.setBounds(178, 352, 73, 23);
contentPane.add(btnIncluir);
JButton btnNewButton = new JButton("Fechar");
btnNewButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
setVisible(Boolean.FALSE);
}
});
tabela.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
btnVisualizar.setEnabled(Boolean.TRUE);
btnExcluir.setEnabled(Boolean.TRUE);
btnAlterar.setEnabled(Boolean.TRUE);
}
});
btnNewButton.setBounds(415, 352, 80, 23);
contentPane.add(btnNewButton);
this.btnAlterar = new JButton("Alterar");
btnAlterar.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
onCLickbtnAlterar();
}
});
this.btnAlterar.setBounds(252, 352, 80, 23);
contentPane.add(this.btnAlterar);
this.btnExcluir = new JButton("Excluir");
this.btnExcluir.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
onclickExcluir();
}
});
this.btnExcluir.setBounds(326, 352, 89, 23);
contentPane.add(this.btnExcluir);
}
/**
*
*
*
*/
private void onclickProcurar() {
try {
this.defTableModel.setRowCount(0);
this.btnVisualizar.setEnabled(Boolean.FALSE);
this.btnExcluir.setEnabled(Boolean.FALSE);
this.btnAlterar.setEnabled(Boolean.FALSE);
ConsultaEnderecoFiltroDTO filtro = new ConsultaEnderecoFiltroDTO();
filtro.setNomeCidade(this.textNomeCidade.getText());
this.fachada = new MantemEnderecoFachada();
List<ConsultaEnderecoRetornoDTO> itensRetornoEndereco = this.fachada.consultarEndereco(filtro);
if (itensRetornoEndereco.isEmpty()) {
JOptionPane.showMessageDialog(this.textNomeCidade, MSG001);
} else {
Integer contador = 0;
for (ConsultaEnderecoRetornoDTO itemRetornoEndereco : itensRetornoEndereco) {
// Preenchimento da tela em forma de tabela.
String[] item = { itemRetornoEndereco.getIdAluno().toString(),
itemRetornoEndereco.getIdCidade().toString(), itemRetornoEndereco.getCep().toString(),
itemRetornoEndereco.getRua(), itemRetornoEndereco.getComplemento(),
itemRetornoEndereco.getNomeCidade() };
defTableModel.insertRow(contador, item);
contador++;
}
}
} catch (Exception e) {
JOptionPane.showMessageDialog(this.textNomeCidade, e.getMessage());
}
}
private void onclickExcluir() {
try {
Integer linhaSelecionada = this.tabela.getSelectedRow();
Long idAluno = Long.valueOf(this.tabela.getValueAt(linhaSelecionada, 0).toString());
this.fachada = new MantemEnderecoFachada();
this.fachada.excluirEndereco(idAluno);
this.onclickProcurar();
} catch (Exception e) {
JOptionPane.showMessageDialog(this.textNomeCidade, e.getMessage());
}
}
/**
*
*
*
*/
private void onclickVisualizar() {
try {
Integer linhaSelecionada = this.tabela.getSelectedRow();
Long idAluno = Long.valueOf(this.tabela.getValueAt(linhaSelecionada, 0).toString());
this.fachada = new MantemEnderecoFachada();
CadastroEnderecoView frame = new CadastroEnderecoView();
frame.abrirTela(idAluno, Boolean.TRUE);
this.onclickProcurar();
} catch (Exception e) {
JOptionPane.showMessageDialog(this.textNomeCidade, e.getMessage());
}
}
/**
*
*
*
*/
protected void onclickBtnIncluir() {
try {
this.fachada = new MantemEnderecoFachada();
CadastroEnderecoView frame = new CadastroEnderecoView();
frame.setVisible(Boolean.TRUE);
} catch (Exception e) {
JOptionPane.showMessageDialog(this.textNomeCidade, e.getMessage());
}
}
/**
*
*
*
*/
private void onCLickbtnAlterar() {
try {
this.fachada = new MantemEnderecoFachada();
Integer linhaSelecionada = this.tabela.getSelectedRow();
Long idAluno = Long.valueOf(this.tabela.getValueAt(linhaSelecionada, 0).toString());
CadastroEnderecoView frame = new CadastroEnderecoView();
frame.abrirTela(idAluno, Boolean.FALSE);
} catch (Exception e) {
JOptionPane.showMessageDialog(this.textNomeCidade, e.getMessage());
}
}
}
| [
"elianesc.2008@gmail.com"
] | elianesc.2008@gmail.com |
ed73310965d0ffb4301a1796dd645b70a56a1af9 | 15c25a734c863701c2eeccd1288309aa7c18ed3d | /src/Tela_principal/JogosExtras.java | 8b12e63a38a1248b53cd7065443387793f3e9548 | [] | no_license | JamersonIFRN/IFlife | a71ca9aa8a530fb77e208db5e1eb7906662a22eb | 761f4848c130f6ff6d501fad9edbbe662df714f4 | refs/heads/master | 2021-01-13T02:06:05.644167 | 2015-08-23T15:22:27 | 2015-08-23T15:22:27 | 40,974,956 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 21,901 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Tela_principal;
import Sudoku.TelaSudoku;
import AcheOErro.PrincipalAcheOErro;
import CacaPalavras.PrincipalCaca;
import Cozinha.TelaCozinha;
import Forca.PrincipalForca;
import JogoDaVelha.JogoDaVelha;
import JogoMemoria.TelaMemoria;
import PaavrasCruzadas.TelaPalavrasC;
import SequenciaDeNumeros.TelaSequencia;
import Virus.TelaInicial;
import java.awt.Color;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
/**
*
* @author DANIEL
*/
public class JogosExtras extends javax.swing.JFrame {
/**
* Creates new form JogosExtras
*/
public JogosExtras() {
initComponents();
setIconImage(new ImageIcon("Res/logoBarra.png").getImage());
getContentPane().setBackground(Color.white);
setLocationRelativeTo(null);
jogosBloqueados();
}
/**
* 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() {
jPanel1 = new javax.swing.JPanel();
jButton7 = new javax.swing.JButton();
jButton5 = new javax.swing.JButton();
jButton6 = new javax.swing.JButton();
jButton8 = new javax.swing.JButton();
jButton9 = new javax.swing.JButton();
jButton10 = new javax.swing.JButton();
jButton11 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jButton4 = new javax.swing.JButton();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton12 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
setTitle("Jogos Extras");
setUndecorated(true);
setResizable(false);
jPanel1.setBackground(new java.awt.Color(215, 254, 215));
jPanel1.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 2, true));
jButton7.setFont(new java.awt.Font("Sakkal Majalla", 1, 27)); // NOI18N
jButton7.setText("Voltar");
jButton7.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton7ActionPerformed(evt);
}
});
jButton5.setFont(new java.awt.Font("Sakkal Majalla", 1, 28)); // NOI18N
jButton5.setText("Jogo da Velha");
jButton5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton5ActionPerformed(evt);
}
});
jButton6.setFont(new java.awt.Font("Sakkal Majalla", 1, 28)); // NOI18N
jButton6.setText("Sudoku");
jButton6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton6ActionPerformed(evt);
}
});
jButton8.setFont(new java.awt.Font("Sakkal Majalla", 1, 28)); // NOI18N
jButton8.setText("Palavras Cruzadas");
jButton8.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton8ActionPerformed(evt);
}
});
jButton9.setFont(new java.awt.Font("Sakkal Majalla", 1, 28)); // NOI18N
jButton9.setText("Sequência Numerica");
jButton9.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton9ActionPerformed(evt);
}
});
jButton10.setFont(new java.awt.Font("Sakkal Majalla", 1, 28)); // NOI18N
jButton10.setText("Virus");
jButton10.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton10ActionPerformed(evt);
}
});
jButton11.setFont(new java.awt.Font("Sakkal Majalla", 1, 28)); // NOI18N
jButton11.setText("Cozinha");
jButton11.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton11ActionPerformed(evt);
}
});
jButton3.setFont(new java.awt.Font("Sakkal Majalla", 1, 28)); // NOI18N
jButton3.setText("Caça-Palavras");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
jButton4.setFont(new java.awt.Font("Sakkal Majalla", 1, 28)); // NOI18N
jButton4.setText("Ache o erro");
jButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt);
}
});
jButton1.setFont(new java.awt.Font("Sakkal Majalla", 1, 28)); // NOI18N
jButton1.setText("Jogo da Memoria");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jButton2.setFont(new java.awt.Font("Sakkal Majalla", 1, 28)); // NOI18N
jButton2.setText("Jogo da Forca");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jButton12.setFont(new java.awt.Font("Tahoma", 1, 16)); // NOI18N
jButton12.setText("Zerar Jogos");
jButton12.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton12ActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(26, 26, 26)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(10, 10, 10)
.addComponent(jButton12)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton7)
.addGap(244, 244, 244))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jButton5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 267, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 258, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jButton8, javax.swing.GroupLayout.PREFERRED_SIZE, 267, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton9, javax.swing.GroupLayout.PREFERRED_SIZE, 258, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jButton11, javax.swing.GroupLayout.PREFERRED_SIZE, 267, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton10, javax.swing.GroupLayout.PREFERRED_SIZE, 258, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton1))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton3)
.addComponent(jButton4))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton5)
.addComponent(jButton6))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton8)
.addComponent(jButton9))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton11)
.addComponent(jButton10))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton7, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton12))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
TelaMemoria tl = new TelaMemoria();
tl.setVisible(true);
dispose();
}//GEN-LAST:event_jButton1ActionPerformed
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
PrincipalForca pf = new PrincipalForca();
pf.setVisible(true);
dispose();
}//GEN-LAST:event_jButton2ActionPerformed
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
PrincipalCaca pc = new PrincipalCaca();
pc.setVisible(true);
dispose();
}//GEN-LAST:event_jButton3ActionPerformed
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
PrincipalAcheOErro pac = new PrincipalAcheOErro();
pac.setVisible(true);
dispose();
}//GEN-LAST:event_jButton4ActionPerformed
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
JogoDaVelha j = new JogoDaVelha();
j.setVisible(true);
dispose();
}//GEN-LAST:event_jButton5ActionPerformed
private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
TelaSudoku t = new TelaSudoku();
t.setVisible(true);
dispose();
}//GEN-LAST:event_jButton6ActionPerformed
private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed
Extras e = new Extras();
e.setVisible(true);
dispose();
}//GEN-LAST:event_jButton7ActionPerformed
private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton8ActionPerformed
TelaPalavrasC t = new TelaPalavrasC();
t.setVisible(true);
dispose();
}//GEN-LAST:event_jButton8ActionPerformed
private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton9ActionPerformed
TelaSequencia ts = new TelaSequencia();
ts.setVisible(true);
dispose();
}//GEN-LAST:event_jButton9ActionPerformed
private void jButton10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton10ActionPerformed
TelaInicial ti = new TelaInicial();
ti.setVisible(true);
dispose();
}//GEN-LAST:event_jButton10ActionPerformed
private void jButton11ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton11ActionPerformed
Cozinha.TelaInicial telaI = new Cozinha.TelaInicial();
telaI.setVisible(true);
dispose();
}//GEN-LAST:event_jButton11ActionPerformed
private void jButton12ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton12ActionPerformed
int começar = JOptionPane.showConfirmDialog(null, "Deseja mesmo bloquear jogos extras?", "Bloquear", JOptionPane.YES_NO_OPTION);
if (começar == 0) {
Zerartudo z = new Zerartudo();
z.ZerarExtras();
jogosBloqueados();
}
}//GEN-LAST:event_jButton12ActionPerformed
/**
* @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(JogosExtras.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(JogosExtras.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(JogosExtras.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(JogosExtras.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 JogosExtras().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton10;
private javax.swing.JButton jButton11;
private javax.swing.JButton jButton12;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButton4;
private javax.swing.JButton jButton5;
private javax.swing.JButton jButton6;
private javax.swing.JButton jButton7;
private javax.swing.JButton jButton8;
private javax.swing.JButton jButton9;
private javax.swing.JPanel jPanel1;
// End of variables declaration//GEN-END:variables
private void jogosBloqueados() {
jButton1.setEnabled(false);
jButton1.setIcon(new ImageIcon("Res/Lock.png"));
jButton2.setEnabled(false);
jButton2.setIcon(new ImageIcon("Res/Lock.png"));
jButton3.setEnabled(false);
jButton3.setIcon(new ImageIcon("Res/Lock.png"));
jButton4.setEnabled(false);
jButton4.setIcon(new ImageIcon("Res/Lock.png"));
jButton5.setEnabled(false);
jButton5.setIcon(new ImageIcon("Res/Lock.png"));
jButton6.setEnabled(false);
jButton6.setIcon(new ImageIcon("Res/Lock.png"));
jButton8.setEnabled(false);
jButton8.setIcon(new ImageIcon("Res/Lock.png"));
jButton9.setEnabled(false);
jButton9.setIcon(new ImageIcon("Res/Lock.png"));
jButton11.setEnabled(false);
jButton11.setIcon(new ImageIcon("Res/Lock.png"));
jButton10.setEnabled(false);
jButton10.setIcon(new ImageIcon("Res/Lock.png"));
String arquivo = "Res/Dados//JogosDesbloqueados.txt", linha, f = "";
try {
FileReader fr = new FileReader(arquivo);
BufferedReader br = new BufferedReader(fr);
try {
while (br.ready()) {
linha = "";
linha += br.readLine();
if (!linha.equals("")) {
f += linha + "\n";
}
}
if (!f.equals("")) {
f = f.substring(0, f.length() - 1);
}
} catch (IOException ex) {
Logger.getLogger(JogosExtras.class.getName()).log(Level.SEVERE, null, ex);
}
} catch (FileNotFoundException ex) {
Logger.getLogger(JogosExtras.class.getName()).log(Level.SEVERE, null, ex);
}
String jogos[] = f.split("-");
for (int i = 0; i < jogos.length; i++) {
if (jogos[i].equals("memoria")) {
jButton1.setEnabled(true);
jButton1.setIcon(null);
}
if (jogos[i].equals("forca")) {
jButton2.setEnabled(true);
jButton2.setIcon(null);
}
if (jogos[i].equals("caca")) {
jButton3.setEnabled(true);
jButton3.setIcon(null);
}
if (jogos[i].equals("erro")) {
jButton4.setEnabled(true);
jButton4.setIcon(null);
}
if (jogos[i].equals("velha")) {
jButton5.setEnabled(true);
jButton5.setIcon(null);
}
if (jogos[i].equals("sudoku")) {
jButton6.setEnabled(true);
jButton6.setIcon(null);
}
if (jogos[i].equals("cruzadas")) {
jButton8.setEnabled(true);
jButton8.setIcon(null);
}
if (jogos[i].equals("sequencia")) {
jButton9.setEnabled(true);
jButton9.setIcon(null);
}
if (jogos[i].equals("cozinha")) {
jButton11.setEnabled(true);
jButton11.setIcon(null);
}
if (jogos[i].equals("virus")) {
jButton10.setEnabled(true);
jButton10.setIcon(null);
}
}
}
}
| [
"20121054010231@IP265883.ifrn.local"
] | 20121054010231@IP265883.ifrn.local |
556bf9a501c916352a8de204899ba55eacfa58df | 3fe179d2bac62ba518819827b0b7e30a2b46c119 | /src/main/java/applicatie/model/klant.java | a5230eeec1509084551ac89f155b23ffb5c7ddb6 | [] | no_license | EduardGarritsen/IPASS | 76bc5206cb43b09fb5339c0e8b2c01c3adf486b2 | ebad04c53bf3c4ad9a88fab119c77b1e741b4a13 | refs/heads/master | 2020-03-21T04:54:11.825817 | 2018-06-28T17:57:43 | 2018-06-28T17:57:43 | 138,132,548 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,001 | java | package applicatie.model;
public class klant {
private int klant_Id;
private String naam;
private String wachtwoord;
private String email;
public klant() {
}
public klant(int klant_Id, String naam, String wachtwoord, String email) {
this.klant_Id = klant_Id;
this.naam = naam;
this.wachtwoord = wachtwoord;
this.email = email;
}
public int getKlant_Id() {
return klant_Id;
}
public void setKlant_Id(int klant_Id) {
this.klant_Id = klant_Id;
}
public String getNaam() {
return naam;
}
public void setNaam(String naam) {
this.naam = naam;
}
public String getWachtwoord() {
return wachtwoord;
}
public void setWachtwoord(String wachtwoord) {
this.wachtwoord = wachtwoord;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
@Override
public String toString() {
// TODO Auto-generated method stub
return String.format("Klant %s, mail: %s, ww: %s", naam, email, wachtwoord);
}
}
| [
"eduard.garritsen@student.hu.nl"
] | eduard.garritsen@student.hu.nl |
094d1c941b5aeffbf12444eeebebd8ce55ab3167 | 583c24d3c400dac3418575a6e15a077873590dc0 | /exception/NombrePlacesMaxException.java | 19980e70f114a71210c30a0c3574d24b64e6aecb | [
"MIT"
] | permissive | KenAdBlock/parking | 448cdc25e4822b91e3b77e933d77507dc13da663 | 232b863703f90939e0737eb3f37123fe4250e16e | refs/heads/master | 2021-01-15T11:07:37.054468 | 2015-01-13T17:54:26 | 2015-01-13T17:54:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 157 | java | package parking.exception;
public class NombrePlacesMaxException extends Exception{
private static final long serialVersionUID = 1836286394929112339L;
}
| [
"naokiboo@gmail.com"
] | naokiboo@gmail.com |
6872f6c53cb5a788d11e4403365edf1def9421c2 | 7f20b1bddf9f48108a43a9922433b141fac66a6d | /csplugins/trunk/toronto/jm/cy3-stateless-taskfactory/api/property-api/src/main/java/org/cytoscape/property/SimpleCyProperty.java | 0cf3e66ab92be7795adcb8504e0cc56e0c130648 | [] | no_license | ahdahddl/cytoscape | bf783d44cddda313a5b3563ea746b07f38173022 | a3df8f63dba4ec49942027c91ecac6efa920c195 | refs/heads/master | 2020-06-26T16:48:19.791722 | 2013-08-28T04:08:31 | 2013-08-28T04:08:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,621 | java | package org.cytoscape.property;
import java.util.Properties;
/**
* A simple implementation of CyProperty<Properties> suitable for
* general purpose use.
* @CyAPI.Final.Class
*/
public final class SimpleCyProperty implements CyProperty<Properties> {
/** Core Cytoscape Property (Cytoscape System Property) */
public static final String CORE_PROPRERTY_NAME = "cytoscape 3";
private final String name;
private final Properties properties;
private final CyProperty.SavePolicy savePolicy;
/**
* Properties is a non-null Properties object that this CyProperty object
* should encapsulate.
* @param properties The non-null Properties object this CyProperty object
* should encapsulate. Throws NullPointerException if Properties is null.
* @param savePolicy the {@link CyProperty.SavePolicy} of this CyProperty object.
*/
public SimpleCyProperty(final String name, final Properties properties, final CyProperty.SavePolicy savePolicy) {
if (name == null)
throw new NullPointerException("\"name\" parameter is null!");
if (properties == null)
throw new NullPointerException("\"properties\" parameter is null!");
if (savePolicy == null)
throw new NullPointerException("\"savePolicy\" parameter is null!");
this.name = name;
this.properties = properties;
this.savePolicy = savePolicy;
}
/** {@inheritDoc} */
@Override
public String getName() {
return name;
}
/** {@inheritDoc} */
@Override
public Properties getProperties() {
return properties;
}
/** {@inheritDoc} */
@Override
public CyProperty.SavePolicy getSavePolicy() {
return savePolicy;
}
}
| [
"jm@0ecc0d97-ab19-0410-9704-bfe1a75892f5"
] | jm@0ecc0d97-ab19-0410-9704-bfe1a75892f5 |
95c9f5b3fed6f9848069c002b8f1af751325ca00 | 5a254336d5d79c9383129c46a1d007ace6f7e30a | /src/java/play/learn/java/design/factory_kit/FactoryKitDemo.java | 5ccaf10774b43f45c009fbfdd471fabe6bede55b | [
"Apache-2.0"
] | permissive | jasonwee/videoOnCloud | 837b1ece7909a9a9d9a12f20f3508d05c37553ed | b896955dc0d24665d736a60715deb171abf105ce | refs/heads/master | 2023-09-03T00:04:51.115717 | 2023-09-02T18:12:55 | 2023-09-02T18:12:55 | 19,120,021 | 1 | 5 | null | 2015-06-03T11:11:00 | 2014-04-24T18:47:52 | Python | UTF-8 | Java | false | false | 544 | java | package play.learn.java.design.factory_kit;
// https://java-design-patterns.com/patterns/factory-kit/
public class FactoryKitDemo {
public static void main(String[] args) {
WeaponFactory factory = WeaponFactory.factory(builder -> {
builder.add(WeaponType.SWORD, Sword::new);
builder.add(WeaponType.AXE, Axe::new);
builder.add(WeaponType.SPEAR, Spear::new);
builder.add(WeaponType.BOW, Bow::new);
});
Weapon axe = factory.create(WeaponType.SPEAR);
System.out.println(axe.toString());
}
}
| [
"peichieh@gmail.com"
] | peichieh@gmail.com |
e03eed1c52a7eb82c0b1eadc5a17c94db781f2b7 | 297006c3aa2f9ca9eca0f314c5283a7b1b216db3 | /src/main/java/com/hnzj/democ1/web/HelloController.java | d25c6e8858b6292e8ff8bbad32bd1bff29df258c | [] | no_license | hnzhouzhoujay/spring-boot-learning | 334f243fbe846a5b6afbcd27e03618eb0ec3056d | 293c70a78f12634867562458611e37ffc03b160e | refs/heads/master | 2020-03-09T21:48:01.070373 | 2018-04-13T00:32:51 | 2018-04-13T00:32:51 | 129,018,872 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 597 | java | package com.hnzj.democ1.web;
import com.hnzj.democ1.config.ConfigBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* Created by 周杰 on 2018/4/2.
*/
@RestController
public class HelloController {
@Autowired
ConfigBean configBean;
@RequestMapping("/hello")
public String hello(){
return "Hello BOOt";
}
@RequestMapping("/profile")
public String profile(){
return configBean.getUserName();
}
}
| [
"418087535@qq.com"
] | 418087535@qq.com |
c1cd2ed15ba8d265a0cec3f9a5b65de273c8db0e | 0358db754f1433876d2e2f3304ac2859945977f0 | /APIGatewayWahSis/src/apigatewaywahsis/service/CustomersServlet.java | f086f2e766da7dfb4e2b1b0663e2d6bdb65b453e | [] | no_license | khacquanht/pms-service-protocol | dfc006e7bea38ea6e1bce7df5a8a777ce3e121a2 | d806cbb36d2db8ca76d02af3ac9070d43e6cd5ad | refs/heads/master | 2022-08-29T02:14:48.749191 | 2020-05-26T15:18:19 | 2020-05-26T15:18:19 | 267,077,447 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,869 | java | package apigatewaywahsis.service;
import apigatewaywahsis.common.CommonModel;
import apigatewaywahsis.common.DefinedName;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.service_wahsis.customer_service.CustomersHandler;
import com.wahsis.lib.auth.SessionManager;
import com.service_wahsis.user_service.UsersHandler;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author khiemnv
*/
public class CustomersServlet extends AbstractServlet {
@Override
protected void processs(HttpServletRequest req, HttpServletResponse resp, StringBuilder respContent) {
try {
StringBuilder vrfContent = new StringBuilder();
String cmd = req.getParameter(DefinedName.PARAM_COMMAND);
String data = req.getParameter(DefinedName.PARAM_DATA);
if (cmd != null && data != null) {
CustomersHandler.getInstance().process(cmd, data, respContent, vrfContent);
if (cmd.equals("login")) {
String token = "";
String err = com.service_wahsis.common.JsonParserUtil.getProperties(vrfContent.toString(), "err");
if (err != null && err.equals("0")) {
String app_id = com.service_wahsis.common.JsonParserUtil.getProperties(data, "app", "app_id");
String app_type_id = com.service_wahsis.common.JsonParserUtil.getProperties(data, "app", "app_type_id");
String cell_phone = com.service_wahsis.common.JsonParserUtil.getProperties(data, com.service_wahsis.common.DefinedName.CUSTOMERS, "cell_phone");
String company_id = com.service_wahsis.common.JsonParserUtil.getCompanyId(data);
token = SessionManager.createStaffSession(app_id, app_type_id, company_id, cell_phone);
}
//logger.info(UsersServlet.class.getName() + " create session: " + token);
if (!token.equals("")) {
String respNew = CommonModel.appendDataResponse(respContent.toString(), "token", token);
if (!respNew.equals("")) {
respContent.delete(0, respContent.length());
respContent.append(respNew);
}
}
}
} else {
respContent.append(CommonModel.toJSON(-1, DefinedName.RESP_MSG_INVALID_REQUEST));
}
} catch (Exception ex) {
Logger.getLogger(UsersServlet.class.getName()).log(Level.SEVERE, null, ex);
}
}
/*
dev.wahsis.net/api/customers?cm=login
dev.wahsis.net/api/customers?cm=change_password
dev.wahsis.net/api/customers?cm=check_installed_app
*/
@Override
protected int authenticate(HttpServletRequest req, StringBuilder authenErrorMsg) {
int ret = 0;
if (authentication != null && authentication.equals("1")) {
String cmd = req.getParameter(DefinedName.PARAM_COMMAND);
if (cmd.equals("login") == false
&& cmd.equals("change_password") == false
&& cmd.equals("check_installed_app") == false) {
SessionManager.SessionState state = SessionManager.checkUserSession(req);
if (state != SessionManager.SessionState.OK) {
if (state == SessionManager.SessionState.Invalid) {
authenErrorMsg.append("Invalid session");
ret = 403;
} else {
ret = -1;
authenErrorMsg.append("Invalid authenticate");
}
}
}
}
return ret;
}
}
| [
"khacquanht96@gmail.com"
] | khacquanht96@gmail.com |
5b5b152f2afb0655f88bbef52a81903b9c7228dd | aeccb2f3d1acf3fc18341c94cfb98b4edd6b6ccd | /src/main/java/cn/nuaa/gcc/handler3/MyEncoderProtocol.java | b813069017b86c9d7a5580e6f194c0b364e96c33 | [] | no_license | gcczuis/IMOnNetty | 5e13eec172ae7f2c7dd81f0a55efc5a635ced8aa | da47ef2cc6ea5465c6fb367fe91fa328365cd497 | refs/heads/master | 2022-06-24T04:00:25.951763 | 2019-05-23T02:05:17 | 2019-05-23T02:05:17 | 187,950,760 | 3 | 0 | null | 2022-06-17T02:10:05 | 2019-05-22T02:47:20 | Java | UTF-8 | Java | false | false | 569 | java | package cn.nuaa.gcc.handler3;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;
/**
* {@author: gcc}
* {@Date: 2019/4/1 10:36}
*/
public class MyEncoderProtocol extends MessageToByteEncoder<MyProtocol> {
@Override
protected void encode(ChannelHandlerContext ctx, MyProtocol msg, ByteBuf out) throws Exception {
System.out.println("MyEncoderProtocol invoked");
out.writeInt(msg.getLength());
out.writeBytes(msg.getContent());
}
}
| [
"gcc950226@outlook.com"
] | gcc950226@outlook.com |
44ab5f502001bfbbf321187ce576355d8b08cd2f | add11a2387c208c124808bde43d3f22e43a59ea8 | /B79SpringMVCWelcomeApp/src/com/uttara/spring/MVCService.java | 8901cda7c36f3685c3295cb5cd607654cc2e3547 | [] | no_license | balajisundaramm/Eclipse-Projects | a79cab9851fec0aa9e50051290fc41c87a549285 | e45888343b5a942d2d52eecdb6fe3dc8e2e8c049 | refs/heads/master | 2021-09-04T06:29:45.136011 | 2018-01-16T17:54:51 | 2018-01-16T17:54:51 | 117,720,112 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 111 | java | package com.uttara.spring;
public interface MVCService {
public String getWelcomeMessage(InputBean bean);
}
| [
"balajitpgit13@gmail.com"
] | balajitpgit13@gmail.com |
e8afff096395aacfb207ddcc0604f85ab93128fc | 2af2f1fa23e8b0544ee192980508c9f691d6b93d | /lab3NewWay/src/com/company/MatrixSum.java | 5c3ed83524a99452d6be7ec86795f3086455a89c | [] | no_license | floreaadrian/Pdp | ab6b98ccc8822cba5c4003ec348df97bef8fdf86 | 709b43abbd063d9794a3825023fbe8946187cd23 | refs/heads/master | 2020-08-28T23:08:27.380429 | 2019-12-17T21:04:16 | 2019-12-17T21:04:16 | 217,848,561 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,948 | java | package com.company;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class MatrixSum implements Runnable {
private int matrixSize = 5000;
private int[][] a = new int[matrixSize][matrixSize];
private int[][] b = new int[matrixSize][matrixSize];
private int[][] c = new int[matrixSize][matrixSize];
private int numberOfLines, numberOfColumns, maxNumberOfElementsPerThread;
MatrixSum(int numberOfLines, int numberOfColumns, int maxNumberOfElementsPerThread){
this.numberOfColumns = numberOfColumns;
this.numberOfLines = numberOfLines;
this.maxNumberOfElementsPerThread = maxNumberOfElementsPerThread;
initialiseMatrix(a, numberOfLines, numberOfColumns);
initialiseMatrix(b, numberOfLines, numberOfColumns);
}
void sum(int a, int b, int c)
{
c = a + b;
}
private void initialiseMatrix(int matrix[][], int numberOfLines, int numberOfColumns)
{
for (int i=0; i<numberOfLines; i++)
{
for (int j=0; j<numberOfColumns; j++)
{
int max = 9;
int min = 0;
int rand = (int)(Math.random()*((max-min)+1))+min;
matrix[i][j] = rand;
}
}
}
@Override
public void run() {
int threadId = (int)Thread.currentThread().getId();
int counter = 0;
int startsFrom = threadId * maxNumberOfElementsPerThread;
int lineStart = startsFrom / numberOfColumns;
int columnStart = startsFrom % numberOfColumns;
for (int i=lineStart; i<numberOfLines && counter < maxNumberOfElementsPerThread; i++)
{
for (int j=columnStart; j<numberOfColumns && counter < maxNumberOfElementsPerThread; j++)
{
c[i][j] = a[i][j] + b[i][j];
counter++;
}
columnStart = 0;
}
}
}
| [
"florea.adrian.paul@gmail.com"
] | florea.adrian.paul@gmail.com |
aa815516db885124e2dc5b4ee9c020f03aa38ba1 | 75285e1323d0ad988df32aff6e9cbbfda1f4cd07 | /java/my-app2/src/main/java/com/kafkastart/ConsumerDemoWithThread.java | 9f11a6d1d9d954b82515c3c88d285093feecca1a | [] | no_license | yuyatinnefeld/kafka | fd09bdad26edd552641f7b78e0be89c0cdb1e388 | aaa0cf8af711a6cd9472cc3b3c695f6a5e218220 | refs/heads/master | 2023-05-31T05:39:28.323053 | 2021-06-02T15:59:58 | 2021-06-02T15:59:58 | 364,687,979 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,388 | java | package com.kafkastart;
import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.apache.kafka.clients.consumer.KafkaConsumer;
import org.apache.kafka.common.errors.WakeupException;
import org.apache.kafka.common.serialization.StringDeserializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.time.Duration;
import java.util.Arrays;
import java.util.Properties;
import java.util.concurrent.CountDownLatch;
public class ConsumerDemoWithThread {
public static void main(String[] args) {
new ConsumerDemoWithThread().run();
}
private ConsumerDemoWithThread(){
}
private void run(){
Logger logger = LoggerFactory.getLogger(ConsumerDemoWithThread.class.getName());
String bootstrapServers = "127.0.0.1:9092";
String groupID = "my-second-application";
String topic = "topicYY";
// latch for dealing with multiple threads
CountDownLatch latch = new CountDownLatch(1);
// create the consumer runnable
logger.info("Creating the consumer thread");
Runnable myConsumerRunnable = new ConsumerRunnable(bootstrapServers, groupID, topic, latch);
// start the thread
Thread myThread = new Thread(myConsumerRunnable);
myThread.start();
// add a shutdown hook
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
logger.info("Caught shutdown hook");
((ConsumerRunnable) myConsumerRunnable).shutdown();
try {
latch.await();
} catch (InterruptedException e) {
e.printStackTrace();
}
logger.info("Application has exited");
}
));
try {
latch.await();
} catch (InterruptedException e) {
logger.info("Application got interrupted", e);
} finally {
logger.info("Application is closing");
}
}
public class ConsumerRunnable implements Runnable{
private CountDownLatch latch;
private KafkaConsumer<String, String> consumer;
private Logger logger = LoggerFactory.getLogger(ConsumerRunnable.class.getName());
public ConsumerRunnable(String bootstrapServers, String groupID, String topic, CountDownLatch latch){
this.latch = latch;
// create Consumer Properties
Properties kafkaProps = new Properties();
kafkaProps.setProperty(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);
kafkaProps.setProperty(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName());
kafkaProps.setProperty(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName());
kafkaProps.setProperty(ConsumerConfig.GROUP_ID_CONFIG, groupID);
kafkaProps.setProperty(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest"); // earliest or latest or none
// create consumer
consumer = new KafkaConsumer<String, String>(kafkaProps);
// subscribe consumer to our topic(s)
consumer.subscribe(Arrays.asList(topic));
}
@Override
public void run() {
// poll for new data
try{
while (true) {
ConsumerRecords<String, String> records =
consumer.poll(Duration.ofMillis(100)); // new in Kafka 2.0.0
for (ConsumerRecord<String, String> record : records) {
logger.info("Key: " + record.key() + ", Value: " + record.value());
logger.info("Partition: " + record.partition() + ", Offset: " + record.offset());
}
}
} catch(WakeupException e){
logger.info("Received shutdown signal!");
} finally {
consumer.close();
//tell our main code we're done with the consumer
latch.countDown();
}
}
public void shutdown(){
// the wakeup() is a special method to interrupt consumer.poll()
// it will throw the exception WakeUpException
consumer.wakeup();
}
}
}
| [
"yuyatinnefeld@gmail.com"
] | yuyatinnefeld@gmail.com |
0f9f62497e94193afff20eef8a56c132612a7e06 | 0ad447bdf143262f30589057496ed7c6e3a23792 | /src/main/java/io/github/manfredpaul/hipstermaps/ApplicationWebXml.java | f7f18b075a6d2470b5b32e0018e21fd65a8df755 | [] | no_license | BulkSecurityGeneratorProject/hipstermaps | 78cf3f838ac67b0647e86313a3315dc4b5f2c28f | e89d40a3b8669a5bfc8242db2c2401a05caa1d6e | refs/heads/master | 2022-12-14T14:17:08.515937 | 2017-08-07T15:05:34 | 2017-08-07T15:05:34 | 296,585,448 | 0 | 0 | null | 2020-09-18T10:10:39 | 2020-09-18T10:10:39 | null | UTF-8 | Java | false | false | 853 | java | package io.github.manfredpaul.hipstermaps;
import io.github.manfredpaul.hipstermaps.config.DefaultProfileUtil;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
/**
* This is a helper Java class that provides an alternative to creating a web.xml.
* This will be invoked only when the application is deployed to a servlet container like Tomcat, JBoss etc.
*/
public class ApplicationWebXml extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
/**
* set a default to use when no profile is configured.
*/
DefaultProfileUtil.addDefaultProfile(application.application());
return application.sources(HipstermapsApp.class);
}
}
| [
"jhipster-bot@users.noreply.github.com"
] | jhipster-bot@users.noreply.github.com |
3059b6e3f7efcf09e6aa2b29f833da508ecca793 | 6eaf14b64ecacbb8545ed5559578715dfc59d3a3 | /GroupA/10-3-IntentAdder1/app/build/generated/not_namespaced_r_class_sources/debug/r/android/support/compat/R.java | fdc3aa75e2694f55373353cfc185801af0806ac8 | [] | no_license | GMIT-mmurray/MAD21 | d0168f0294de8e184c7126d872c573fa73947a5d | eb62dd6c22bcedd73b6b0e7ba785b95110ee9a23 | refs/heads/main | 2023-03-02T20:39:58.742166 | 2021-02-12T19:18:13 | 2021-02-12T19:18:13 | 331,926,821 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,453 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* gradle plugin from the resource data it found. It
* should not be modified by hand.
*/
package android.support.compat;
public final class R {
private R() {}
public static final class attr {
private attr() {}
public static final int alpha = 0x7f010000;
public static final int font = 0x7f010002;
public static final int fontProviderAuthority = 0x7f010003;
public static final int fontProviderCerts = 0x7f010004;
public static final int fontProviderFetchStrategy = 0x7f010005;
public static final int fontProviderFetchTimeout = 0x7f010006;
public static final int fontProviderPackage = 0x7f010007;
public static final int fontProviderQuery = 0x7f010008;
public static final int fontStyle = 0x7f010009;
public static final int fontVariationSettings = 0x7f01000a;
public static final int fontWeight = 0x7f01000b;
public static final int ttcIndex = 0x7f010014;
}
public static final class color {
private color() {}
public static final int notification_action_color_filter = 0x7f020000;
public static final int notification_icon_bg_color = 0x7f020001;
public static final int ripple_material_light = 0x7f020004;
public static final int secondary_text_default_material_light = 0x7f020006;
}
public static final class dimen {
private dimen() {}
public static final int compat_button_inset_horizontal_material = 0x7f030000;
public static final int compat_button_inset_vertical_material = 0x7f030001;
public static final int compat_button_padding_horizontal_material = 0x7f030002;
public static final int compat_button_padding_vertical_material = 0x7f030003;
public static final int compat_control_corner_material = 0x7f030004;
public static final int compat_notification_large_icon_max_height = 0x7f030005;
public static final int compat_notification_large_icon_max_width = 0x7f030006;
public static final int notification_action_icon_size = 0x7f030007;
public static final int notification_action_text_size = 0x7f030008;
public static final int notification_big_circle_margin = 0x7f030009;
public static final int notification_content_margin_start = 0x7f03000a;
public static final int notification_large_icon_height = 0x7f03000b;
public static final int notification_large_icon_width = 0x7f03000c;
public static final int notification_main_column_padding_top = 0x7f03000d;
public static final int notification_media_narrow_margin = 0x7f03000e;
public static final int notification_right_icon_size = 0x7f03000f;
public static final int notification_right_side_padding_top = 0x7f030010;
public static final int notification_small_icon_background_padding = 0x7f030011;
public static final int notification_small_icon_size_as_large = 0x7f030012;
public static final int notification_subtext_size = 0x7f030013;
public static final int notification_top_pad = 0x7f030014;
public static final int notification_top_pad_large_text = 0x7f030015;
}
public static final class drawable {
private drawable() {}
public static final int notification_action_background = 0x7f040002;
public static final int notification_bg = 0x7f040003;
public static final int notification_bg_low = 0x7f040004;
public static final int notification_bg_low_normal = 0x7f040005;
public static final int notification_bg_low_pressed = 0x7f040006;
public static final int notification_bg_normal = 0x7f040007;
public static final int notification_bg_normal_pressed = 0x7f040008;
public static final int notification_icon_background = 0x7f040009;
public static final int notification_template_icon_bg = 0x7f04000a;
public static final int notification_template_icon_low_bg = 0x7f04000b;
public static final int notification_tile_bg = 0x7f04000c;
public static final int notify_panel_notification_icon_bg = 0x7f04000d;
}
public static final class id {
private id() {}
public static final int action_container = 0x7f050003;
public static final int action_divider = 0x7f050004;
public static final int action_image = 0x7f050005;
public static final int action_text = 0x7f050006;
public static final int actions = 0x7f050007;
public static final int async = 0x7f050009;
public static final int blocking = 0x7f05000a;
public static final int chronometer = 0x7f050012;
public static final int forever = 0x7f05001b;
public static final int icon = 0x7f05001c;
public static final int icon_group = 0x7f05001d;
public static final int info = 0x7f05001e;
public static final int italic = 0x7f05001f;
public static final int line1 = 0x7f050021;
public static final int line3 = 0x7f050022;
public static final int normal = 0x7f050026;
public static final int notification_background = 0x7f050027;
public static final int notification_main_column = 0x7f050028;
public static final int notification_main_column_container = 0x7f050029;
public static final int right_icon = 0x7f05002c;
public static final int right_side = 0x7f05002d;
public static final int tag_transition_group = 0x7f050030;
public static final int tag_unhandled_key_event_manager = 0x7f050031;
public static final int tag_unhandled_key_listeners = 0x7f050032;
public static final int text = 0x7f050033;
public static final int text2 = 0x7f050034;
public static final int time = 0x7f050035;
public static final int title = 0x7f050036;
}
public static final class integer {
private integer() {}
public static final int status_bar_notification_info_maxnum = 0x7f060001;
}
public static final class layout {
private layout() {}
public static final int notification_action = 0x7f070002;
public static final int notification_action_tombstone = 0x7f070003;
public static final int notification_template_custom_big = 0x7f07000a;
public static final int notification_template_icon_group = 0x7f07000b;
public static final int notification_template_part_chronometer = 0x7f07000f;
public static final int notification_template_part_time = 0x7f070010;
}
public static final class string {
private string() {}
public static final int status_bar_notification_info_overflow = 0x7f090004;
}
public static final class style {
private style() {}
public static final int TextAppearance_Compat_Notification = 0x7f0a0001;
public static final int TextAppearance_Compat_Notification_Info = 0x7f0a0002;
public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0a0004;
public static final int TextAppearance_Compat_Notification_Time = 0x7f0a0007;
public static final int TextAppearance_Compat_Notification_Title = 0x7f0a0009;
public static final int Widget_Compat_NotificationActionContainer = 0x7f0a000b;
public static final int Widget_Compat_NotificationActionText = 0x7f0a000c;
}
public static final class styleable {
private styleable() {}
public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f010000 };
public static final int ColorStateListItem_android_color = 0;
public static final int ColorStateListItem_android_alpha = 1;
public static final int ColorStateListItem_alpha = 2;
public static final int[] FontFamily = { 0x7f010003, 0x7f010004, 0x7f010005, 0x7f010006, 0x7f010007, 0x7f010008 };
public static final int FontFamily_fontProviderAuthority = 0;
public static final int FontFamily_fontProviderCerts = 1;
public static final int FontFamily_fontProviderFetchStrategy = 2;
public static final int FontFamily_fontProviderFetchTimeout = 3;
public static final int FontFamily_fontProviderPackage = 4;
public static final int FontFamily_fontProviderQuery = 5;
public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f010002, 0x7f010009, 0x7f01000a, 0x7f01000b, 0x7f010014 };
public static final int FontFamilyFont_android_font = 0;
public static final int FontFamilyFont_android_fontWeight = 1;
public static final int FontFamilyFont_android_fontStyle = 2;
public static final int FontFamilyFont_android_ttcIndex = 3;
public static final int FontFamilyFont_android_fontVariationSettings = 4;
public static final int FontFamilyFont_font = 5;
public static final int FontFamilyFont_fontStyle = 6;
public static final int FontFamilyFont_fontVariationSettings = 7;
public static final int FontFamilyFont_fontWeight = 8;
public static final int FontFamilyFont_ttcIndex = 9;
public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 };
public static final int GradientColor_android_startColor = 0;
public static final int GradientColor_android_endColor = 1;
public static final int GradientColor_android_type = 2;
public static final int GradientColor_android_centerX = 3;
public static final int GradientColor_android_centerY = 4;
public static final int GradientColor_android_gradientRadius = 5;
public static final int GradientColor_android_tileMode = 6;
public static final int GradientColor_android_centerColor = 7;
public static final int GradientColor_android_startX = 8;
public static final int GradientColor_android_startY = 9;
public static final int GradientColor_android_endX = 10;
public static final int GradientColor_android_endY = 11;
public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 };
public static final int GradientColorItem_android_color = 0;
public static final int GradientColorItem_android_offset = 1;
}
}
| [
"michael.murray@gmit.ie"
] | michael.murray@gmit.ie |
e56d6eb494fa69af6612019022d35f2cb6562cc8 | e1082e523d373b0458ba63fe30e42610666d3371 | /shop-user/src/main/java/quick/pager/shop/service/client/UserClientService.java | 842d98776cb5eeb7d698eb41a050be648080e78a | [
"MIT"
] | permissive | goodsmile/spring-cloud-shop | 73a8cdefac48b429e534c0890ed7e486a2fd46be | 9e6fa2651ba592adff82ecaa818038cbbe845521 | refs/heads/master | 2020-05-05T10:13:24.695353 | 2019-03-31T07:10:10 | 2019-03-31T07:10:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,345 | java | package quick.pager.shop.service.client;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import quick.pager.shop.StationLetter;
import quick.pager.shop.User;
import quick.pager.shop.response.Response;
import quick.pager.shop.dto.UserInfoDTO;
import quick.pager.shop.common.Address;
import quick.pager.shop.mapper.AddressMapper;
import quick.pager.shop.mapper.StationLetterMapper;
import quick.pager.shop.mapper.UserMapper;
/**
* feign Client Service 服务
*/
@Service
public class UserClientService {
@Autowired
private UserMapper userMapper;
@Autowired
private AddressMapper addressMapper;
@Autowired
private StationLetterMapper stationLetterMapper;
/**
* 获取用户信息
*
* @param userId 用户Id集合
*/
public List<UserInfoDTO> getUser(List<Long> userId) {
return userMapper.selectByBatchPrimaryKey(userId);
}
/**
* 根据手机号码批量获取判断用户是否存在
*
* @param phones 手机号集合
*/
public Response<List<User>> isExists(List<String> phones) {
return new Response<>(userMapper.isExists(phones));
}
/**
* 获取批量用户地址
*/
public Response<Address> queryAddress(Long addressId) {
return new Response<>(addressMapper.selectByPrimaryKey(addressId));
}
/**
* 查询站内信列表
*
* @param phone 手机号
*/
public Response<List<StationLetter>> queryStationLetter(String phone, Integer page, Integer pageSize) {
PageHelper.startPage(page, pageSize);
List<StationLetter> stationLetters = stationLetterMapper.selectStationMessagesByPhone(phone);
PageInfo<StationLetter> pageInfo = new PageInfo<>(stationLetters);
Response<List<StationLetter>> response = new Response<>();
response.setData(pageInfo.getList());
response.setTotal(pageInfo.getTotal());
return response;
}
/**
* 根据手机号查询用户信息
*
* @param phone 手机号
*/
public Response<UserInfoDTO> queryUserProfile(String phone) {
return new Response<>(userMapper.selectInfoByPhone(phone));
}
}
| [
"siguiyang1992@outlook.com"
] | siguiyang1992@outlook.com |
556c990f9cc4d6db55743780bf01393c041d6198 | 442d07f8f38598dbf012e6ce88fd2f6e6cc5c039 | /src/com/company/observer/Button.java | cc1ebbe0cfd01d723a54ae3db15f75dc40530c83 | [] | no_license | chanhoGod/DesignPattern_Example | 91f358e398af9c14e88e941e59b8c29fd971c010 | a181c1b48a43c7a70f21f4d51aa72fb5f9c7eb12 | refs/heads/master | 2023-06-19T05:36:21.298361 | 2021-07-21T08:39:06 | 2021-07-21T08:39:06 | 388,019,171 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 396 | java | package com.company.observer;
public class Button {
private String name;
private IButtonListener buttonListener;
public Button(String name){
this.name = name;
}
public void click(String message){
buttonListener.clickEvent(message);
}
public void addListener(IButtonListener buttonListener){
this.buttonListener = buttonListener;
}
}
| [
"cksgh3422@gmail.com"
] | cksgh3422@gmail.com |
4f7dddb6c8d671df9ece51709a773d7cf31bf051 | 72b8fb3e1e180ee270e9f6d2da8249b0251c36e7 | /services/CountryInfoService/src/com/custom_profile_deploy/services/countryinfoservice/CountryCurrency.java | a2d3fbaf3c6dcec5cb6ea4f8421981bf1fee6909 | [] | no_license | wavemakerapps/test_ENT_127 | e074fd4101d6785d9b1bea23cd4061b7fcc96c73 | 5e5c27c10308c9156bb045b2cef81df6ccbddacb | refs/heads/master | 2020-05-09T23:19:14.056214 | 2019-04-15T13:56:53 | 2019-04-15T13:56:53 | 181,498,290 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,887 | java | /*Copyright (c) 2016-2017 profiles.com All Rights Reserved.
This software is the confidential and proprietary information of profiles.com You shall not disclose such Confidential Information and shall use it only in accordance
with the terms of the source code license agreement you entered into with profiles.com*/
package com.custom_profile_deploy.services.countryinfoservice;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="sCountryISOCode" type="{http://www.w3.org/2001/XMLSchema}string"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"sCountryISOCode"
})
@XmlRootElement(name = "CountryCurrency")
public class CountryCurrency {
@XmlElement(required = true)
protected String sCountryISOCode;
/**
* Gets the value of the sCountryISOCode property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getSCountryISOCode() {
return sCountryISOCode;
}
/**
* Sets the value of the sCountryISOCode property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setSCountryISOCode(String value) {
this.sCountryISOCode = value;
}
}
| [
"sairama.bonala@wavemaker.com"
] | sairama.bonala@wavemaker.com |
da76db3b4346936a6ed5c3261af80c35f44b22c8 | d8772960b3b2b07dddc8a77595397cb2618ec7b0 | /rhServer/src/main/java/com/rhlinkcon/repository/requisicaoPessoal/RequisicaoPessoalCandidatoRepository.java | 031439d59b7a62898b9c2b6a5fe7b88628c91e60 | [] | no_license | vctrmarques/interno-rh-sistema | c0f49a17923b5cdfaeb148c6f6da48236055cf29 | 7a7a5d9c36c50ec967cb40a347ec0ad3744d896e | refs/heads/main | 2023-03-17T02:07:10.089496 | 2021-03-12T19:06:05 | 2021-03-12T19:06:05 | 347,168,924 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 446 | java | package com.rhlinkcon.repository.requisicaoPessoal;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import com.rhlinkcon.model.RequisicaoPessoalCandidato;
@Repository
public interface RequisicaoPessoalCandidatoRepository extends JpaRepository<RequisicaoPessoalCandidato, Long> {
List<RequisicaoPessoalCandidato> findAllByRequisicaoPessoalId(Long id);
}
| [
"vctmarques@gmail.com"
] | vctmarques@gmail.com |
a78569c0c14a64911f9f67a035d067943f7b0dc4 | 149db0d2c48b2fa2d93dd0aad70b6203eceeb44d | /src/java/controller/UsuarioController.java | fce56f5e25b034d31193ad6d0a1d692a4b9dec9b | [] | no_license | grossiwm/old-school-blog-servlet | 577aa6423c71d32fa8febe5570cd9a3a1137c1f8 | 0401f655aec74f3f5ce59eadc7d486ad7fa96908 | refs/heads/master | 2023-01-28T13:16:50.950183 | 2020-12-11T02:45:55 | 2020-12-11T02:45:55 | 311,480,706 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,370 | 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 controller;
import enums.PapelUsuario;
import model.Usuario;
import java.io.IOException;
import java.util.List;
import java.util.Objects;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import business.UsuarioBO;
import java.util.ArrayList;
import validator.UsuarioValidator;
/**
*
* @author gabriel
*/
@WebServlet(urlPatterns = {"/usuario"})
public class UsuarioController extends HttpServlet{
private UsuarioBO usuarioBO;
@Override
public void init() throws ServletException {
usuarioBO = new UsuarioBO();
}
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String acao = (String) request.getParameter("acao");
HttpSession session = request.getSession();
Usuario usuarioLogado = (Usuario) session.getAttribute("usuarioLogado");
Usuario usuario = null;
RequestDispatcher view = null;
Integer id = null;
List<Usuario> usuarios = null;
switch (acao) {
case "solicitar":
view = request.getRequestDispatcher("jsp/solicitar.jsp");
view.forward(request, response);
break;
case "solicitacoes":
if (!Objects.isNull(request.getParameter("sucesso"))) {
request.setAttribute("mensagemSucesso", "Ação executada com sucesso.");
}
usuarios = usuarioBO.getAllUsuarioAguardandoAceite();
request.setAttribute("usuarios", usuarios);
view = request.getRequestDispatcher("jsp/solicitacoes.jsp");
view.forward(request, response);
break;
case "deletar":
id = Integer.parseInt(request.getParameter("id"));
usuarioBO.removeUsuarioPorId(id);
request.setAttribute("sucesso", "usuario de id " + id + " deletado com sucesso");
response.sendRedirect("usuario?acao=solicitacoes&sucesso");
break;
case "aceitar":
id = Integer.parseInt(request.getParameter("id"));
usuarioBO.aprovaUsuario(id);
response.sendRedirect("usuario?acao=solicitacoes&sucesso");
break;
case "logout":
session.invalidate();
response.sendRedirect("login");
break;
case "gerenciarUsuarios":
usuarios = usuarioBO.getTodos();
request.setAttribute("usuarios", usuarios);
view = request.getRequestDispatcher("jsp/usuarios.jsp");
view.forward(request, response);
break;
case "editarUsuario":
id = Integer.parseInt(request.getParameter("id"));
usuario = usuarioBO.getUsuarioById(id);
request.setAttribute("usuarioParaAlterar", usuario);
view = request.getRequestDispatcher("jsp/formUsuario.jsp");
view.forward(request, response);
break;
case "novoUsuario":
usuario = new Usuario();
request.setAttribute("usuarioParaAlterar", usuario);
view = request.getRequestDispatcher("jsp/formUsuario.jsp");
view.forward(request, response);
break;
}
}
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String acao = (String) request.getParameter("acao");
RequestDispatcher view = null;
switch (acao) {
case "solicitar":
Usuario usuario;
String nome = request.getParameter("nome");
String email = request.getParameter("email");
String cpf = request.getParameter("cpf");
String senha = request.getParameter("senha");
String senhaConfirmacao = request.getParameter("senha-confirmacao");
Integer papel = null;
if (!Objects.isNull(request.getParameter("papel")))
papel = PapelUsuario.valueOf(request.getParameter("papel")).getValorInteiro();
if (Objects.isNull(request.getParameter("id")) || request.getParameter("id") == "") {
usuario = new Usuario();
} else {
int id = Integer.parseInt(request.getParameter("id"));
usuario = usuarioBO.getUsuarioById(id);
}
usuario.setNome(nome);
usuario.setEmail(email);
usuario.setCpf(cpf);
usuario.setPapel(papel);
usuario.setSenha(senha);
usuario.setSenhaConfirmacao(senhaConfirmacao);
usuario.setCadastroAprovado('N');
ArrayList<String> erros = UsuarioValidator.validaCadastro(usuario);
if (erros.size() > 0) {
request.setAttribute("erros", erros);
view = request.getRequestDispatcher("jsp/solicitar.jsp");
view.forward(request, response);
} else {
usuarioBO.salvaUsuario(usuario);
response.sendRedirect("artigo?acao=listar&sucesso");
}
}
}
}
| [
"gabriel.rossi@fattoriaweb.com.br"
] | gabriel.rossi@fattoriaweb.com.br |
c98dd8f0c666464297063c45ccc4956816d34c0c | 2a1dc269275c25ede3b9baf1fb1a6a61cefd75e6 | /src/bank/server/Server.java | 0e2e49e375f9cb6d2645eb0145df83482cc2ac95 | [] | no_license | Maheliusz/Middleware | 4dcc5b7964c6dc329d4819210d3c855be69d48ad | 7147b511234757c11e874c390da4a87b1e07b51d | refs/heads/master | 2020-03-16T21:55:09.281855 | 2018-05-11T10:27:04 | 2018-05-11T10:27:04 | 133,019,388 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,689 | java | package bank.server;
import Bank.grpc.*;
import Bank.grpc.Currency;
import bank.server.ice.AccountFactoryI;
import com.zeroc.Ice.Communicator;
import com.zeroc.Ice.ObjectAdapter;
import com.zeroc.Ice.Util;
import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder;
import io.grpc.stub.StreamObserver;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.util.logging.Logger;
public class Server {
private static final Logger logger = Logger.getLogger(Server.class.getName());
public void t1(String[] args) {
int status = 0;
Communicator communicator = null;
if (args.length < 2) {
System.err.println("Not enough arguments; program needs port number for bank service and course service");
status = 1;
}
try {
Map<Currency, Double> courseMap = new HashMap<>();
communicator = Util.initialize();
int port = Integer.parseInt(args[0]);
int coursePort = Integer.parseInt(args[1]);
ObjectAdapter adapter = communicator.createObjectAdapterWithEndpoints("Adapter", String.format("tcp -h localhost -p %d:udp -h localhost -p %d", port, port));
f(coursePort, courseMap);
logger.info("Server started, listening on " + port);
AccountFactoryI accountFactory = new AccountFactoryI(courseMap);
adapter.addDefaultServant(accountFactory, "factory");
adapter.activate();
System.out.println("Entering event processing loop...");
communicator.waitForShutdown();
} catch (NumberFormatException e) {
System.err.println(e.getMessage());
System.err.println("Argument port number must be an integer");
} catch (Exception e) {
System.err.println(e.getMessage());
status = 1;
} finally {
try {
communicator.destroy();
} catch (NullPointerException e) {
// No communicator to destroy
} catch (Exception e) {
System.err.println(e.getMessage());
status = 1;
}
}
System.exit(status);
}
private void f(int port, Map<Currency, Double> courseMap) {
ManagedChannel channel = ManagedChannelBuilder.forAddress("localhost", port).usePlaintext().build();
MoneyCourseGrpc.MoneyCourseStub moneyCourseStub = MoneyCourseGrpc.newStub(channel);
Set<Currency> currencySet = new HashSet<>();
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String input = "";
while (true) {
System.out.println("Enter one of following names to subscribe for given currency or 'x' to continue:");
Arrays.stream(Currency.values()).forEach(value -> {
if (!value.equals(Currency.UNRECOGNIZED))
System.out.println("-> " + value.name());
});
try {
input = br.readLine();
} catch (IOException e) {
System.err.println(e.toString());
}
if (input.equals("x")) break;
else {
try {
currencySet.add(Currency.valueOf(input.trim()));
} catch (NullPointerException e) {
System.err.println("Name not in provided list");
}
}
}
currencySet.forEach(key -> courseMap.put(key, 0.0));
System.out.println(courseMap.keySet());
moneyCourseStub.getCourse(CourseRequest.newBuilder().addAllCurrency(courseMap.keySet()).build(),
new StreamObserver<CourseResponse>() {
@Override
public void onNext(CourseResponse response) {
synchronized (courseMap) {
for (Courses course : response.getCoursesList()) {
courseMap.put(course.getCurrency(), course.getRes());
}
}
}
@Override
public void onError(Throwable throwable) {
System.err.println("Error. Cannot communicate with course service.");
System.err.println(throwable.getMessage());
}
@Override
public void onCompleted() {
//
}
});
}
public static void main(String[] args) {
Server app = new Server();
app.t1(args);
}
}
| [
"miczak96@gmail.com"
] | miczak96@gmail.com |
9f6695c56caad6bb8cc6c20614b25c9c982c6460 | 5ce466adc7791d81166d0ee12d8bc981bf3440cd | /code/gwtia-ch17-deferredbinding/src/com/manning/gwtia/ch17/client/ExamplePanel.java | accf4ea2b1d30979146225a42976d1be31661f22 | [] | no_license | govelogo/gwtinaction2 | 72b00b5c86434380297ad3ced2624db9dc5fa65c | 749b00b7b6e4a140dd6635dc0939a6293161a224 | refs/heads/master | 2020-03-27T00:53:16.259871 | 2013-11-06T19:57:43 | 2013-11-06T19:57:43 | 13,943,794 | 3 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,530 | java | package com.manning.gwtia.ch17.client;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.logical.shared.ResizeEvent;
import com.google.gwt.event.logical.shared.ResizeHandler;
import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.ImageResource;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.History;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.Widget;
import com.manning.gwtia.ch17.client.audio.AudioExample;
import com.manning.gwtia.ch17.client.computestyle.ComputeStyleExample;
import com.manning.gwtia.ch17.client.weekend.PropertyExample;
public class ExamplePanel extends Composite
{
private static ExamplePanelUiBinder uiBinder = GWT.create(ExamplePanelUiBinder.class);
interface ExamplePanelUiBinder extends UiBinder<Widget, ExamplePanel> {}
interface Resources extends ClientBundle {
@Source("gwtia.jpg") public ImageResource logo();
}
private ComputeStyleExample computeStyleExample;
private PropertyExample propertyExample;
private AudioExample audioExample;
private IntroPanel introPanel;
@UiField SimplePanel exampleArea;
public ExamplePanel ()
{
initWidget(uiBinder.createAndBindUi(this));
setWidgetToMaxWidthAndHeight();
Window.addResizeHandler(resizeHandler);
introPanel = new IntroPanel();
setWidgetAsExample(introPanel);
}
@UiHandler("computeStyle")
public void showComputeStyle (ClickEvent event){
showComputeStyle();
}
public void showComputeStyle(){
if (computeStyleExample==null) computeStyleExample = new ComputeStyleExample();
setWidgetAsExample(computeStyleExample);
History.newItem(HistoryTokens.COMPUTESTYLE);
}
@UiHandler("weekendExample")
public void showPropertyExample (ClickEvent event){
showPropertyExample();
}
public void showPropertyExample(){
if (propertyExample==null) propertyExample = new PropertyExample();
setWidgetAsExample(propertyExample);
History.newItem(HistoryTokens.PROPERTY);
}
@UiHandler("audio")
public void showAudioExample (ClickEvent event){
showAudioExample();
}
public void showAudioExample(){
if (audioExample==null) audioExample = new AudioExample();
setWidgetAsExample(audioExample);
History.newItem(HistoryTokens.AUDIO);
}
@UiHandler("introPanel")
void showInstructionsPanel (ClickEvent event)
{
showInstructionsPanel();
}
public void showInstructionsPanel()
{
setWidgetAsExample(introPanel);
History.newItem(HistoryTokens.INTRODUCTION);
}
private void setWidgetAsExample (Widget widget)
{
exampleArea.clear();
exampleArea.add(widget);
}
/* ************* WIDGET CENTERING CODE *************** */
private ResizeHandler resizeHandler = new ResizeHandler()
{
public void onResize (ResizeEvent event)
{
setWidgetToMaxWidthAndHeight();
}
};
private void setWidgetToMaxWidthAndHeight ()
{
setWidth("100%");
setHeight(Window.getClientHeight() + "px");
}
}
| [
"govelogo@gmail.com"
] | govelogo@gmail.com |
5e0cf79f32407c8c169b36d3c74af3bbe3ad7270 | e27db8a6f6218a6599873afea70f3d8597716cb7 | /SSM_ERP/src/main/java/com/kk/domain/DeviceMaintain.java | 2c8bb3c4077ad02d34321eb91074eb474b65bbed | [] | no_license | kangjunfeng/java_ssm_erp | b8f9465caa2a9d2521369558eb4205a6228a65de | 353d7de13dbb5093682a54944ce18cf642be7e10 | refs/heads/master | 2021-01-25T06:45:51.300071 | 2017-06-16T09:27:15 | 2017-06-16T09:27:15 | 93,610,457 | 4 | 3 | null | null | null | null | UTF-8 | Java | false | false | 2,337 | java | package com.kk.domain;
import java.math.BigDecimal;
import java.util.Date;
import javax.validation.constraints.Max;
import javax.validation.constraints.Size;
public class DeviceMaintain {
@Size(max=40, message="{id.length.error}")
private String deviceMaintainId;
private String deviceFaultId;
private String deviceMaintainEmpId;
private Date deviceMaintainDate;
@Size(max=5000, message="维修结果长度请限制在5000个字符内")
private String deviceMaintainResult;
@Max(value=999999999, message="维修费用的长度限制在10个字符之内")
private BigDecimal deviceMaintainCost;
private String note;
public String getDeviceMaintainId() {
return deviceMaintainId;
}
public void setDeviceMaintainId(String deviceMaintainId) {
this.deviceMaintainId = deviceMaintainId == null ? null : deviceMaintainId.trim();
}
public String getDeviceFaultId() {
return deviceFaultId;
}
public void setDeviceFaultId(String deviceFaultId) {
this.deviceFaultId = deviceFaultId == null ? null : deviceFaultId.trim();
}
public String getDeviceMaintainEmpId() {
return deviceMaintainEmpId;
}
public void setDeviceMaintainEmpId(String deviceMaintainEmpId) {
this.deviceMaintainEmpId = deviceMaintainEmpId == null ? null : deviceMaintainEmpId.trim();
}
public Date getDeviceMaintainDate() {
return deviceMaintainDate;
}
public void setDeviceMaintainDate(Date deviceMaintainDate) {
this.deviceMaintainDate = deviceMaintainDate;
}
public String getDeviceMaintainResult() {
return deviceMaintainResult;
}
public void setDeviceMaintainResult(String deviceMaintainResult) {
this.deviceMaintainResult = deviceMaintainResult == null ? null : deviceMaintainResult.trim();
}
public BigDecimal getDeviceMaintainCost() {
return deviceMaintainCost;
}
public void setDeviceMaintainCost(BigDecimal deviceMaintainCost) {
this.deviceMaintainCost = deviceMaintainCost;
}
public String getNote() {
return note;
}
public void setNote(String note) {
this.note = note == null ? null : note.trim();
}
} | [
"admin@admindeMac-mini.local"
] | admin@admindeMac-mini.local |
237f25cc64f722a66e73c0c13c67cdc66c1e7f90 | 037825656b87177b534996c9e602a947a6144331 | /app/src/main/java/com/codepath/apps/restclienttemplate/ComposeActivity.java | 0d8f204f69ab3aeb80e9a48be5d49bfe16c56f92 | [
"Apache-2.0",
"MIT"
] | permissive | latifatozoya/TwitterApp | dd7ffb99839e6026e31f6ce6d76be7d82b75b018 | 85f7a753571dddb5e0f46e659bdc80f7d591ad89 | refs/heads/master | 2020-03-22T04:29:42.255974 | 2018-07-07T01:49:49 | 2018-07-07T01:49:49 | 139,502,341 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,554 | java | package com.codepath.apps.restclienttemplate;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.EditText;
import com.codepath.apps.restclienttemplate.models.Tweet;
import com.loopj.android.http.JsonHttpResponseHandler;
import org.json.JSONObject;
import org.parceler.Parcels;
import cz.msebera.android.httpclient.Header;
public class ComposeActivity extends AppCompatActivity {
TwitterClient client;
EditText simpleEditText;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_compose);
simpleEditText = (EditText) findViewById(R.id.et_simple);
String strValue = simpleEditText.getText().toString();
client = TwitterApp.getRestClient(this);
}
public void onSuccess(View view) {
client.sendTweet(simpleEditText.getText().toString(), new JsonHttpResponseHandler() {
@Override
public void onSuccess(int statusCode, Header[] headers, JSONObject response) {
try {
Tweet tweet = Tweet.fromJSON(response);
Intent data = new Intent();
data.putExtra("tweet", Parcels.wrap(tweet));
setResult(RESULT_OK, data);
finish();
}
catch (Exception e) {
e.printStackTrace();
}
}
});
}
}
| [
"latifat@fb.com"
] | latifat@fb.com |
0008c9e8bdde763c61e7066b1fd63dde28c5a054 | 52ab0a2ffe662773686ba4b3a358d2554ed47361 | /trunk/Source/StudentApp/src/main/java/com/lk/std/service/DistrictServiceImpl.java | bc9561d96745c184651c953a86b1db87aed6cda5 | [] | no_license | udenisilva/sms1 | 9c4b0d1b4f9e7b523e7e706b194999de5a355e00 | 7be2fe3eff6e4d656fb4bec843418b4c81d77dc4 | refs/heads/master | 2021-01-22T02:40:59.407914 | 2017-02-02T07:07:37 | 2017-02-02T07:07:37 | 81,063,614 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 664 | java | /**
*
*/
package com.lk.std.service;
import java.util.List;
import javax.transaction.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.lk.std.dao.DistrictRepository;
import com.lk.std.model.District;
@Service
@Transactional
public class DistrictServiceImpl implements DistrictService {
@Autowired
private DistrictRepository districtDAO;
@Override
public List<District> findAllDestrict() {
return (List<District>) districtDAO.findAll();
}
@Override
public District findDistrict(long districtId) {
return districtDAO.findOne(districtId);
}
}
| [
"dhiripitiy001@SWD-L-038.lk.aap.ad.pwcinternal.com"
] | dhiripitiy001@SWD-L-038.lk.aap.ad.pwcinternal.com |
77c225a025d5757d07b541711683e6bd7c3ba15c | 8c37843ccb333d721510348be9128c96d2292cfb | /SpringBoot-Shiro-Vue-master/back/src/main/java/com/heeexy/example/controller/GoodsViewController.java | 4abfd09d844b1d139afd52f3a33aff9da3896316 | [
"MIT"
] | permissive | annieshym/springbootShiro | 5ef32bad06fece711da050077c0ed21408b9d894 | 0fee1625ad915217144f93f4bb69ebae630243bb | refs/heads/master | 2023-03-19T16:57:46.159398 | 2021-01-08T08:04:23 | 2021-01-08T08:04:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 767 | java | package com.heeexy.example.controller;
import com.alibaba.fastjson.JSONObject;
import com.heeexy.example.service.GoodsViewService;
import com.heeexy.example.util.CommonUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
@RestController
@RequestMapping("/goods")
public class GoodsViewController {
@Autowired
private GoodsViewService goodsViewService;
@GetMapping("/viewGoods")
public JSONObject getGoods(HttpServletRequest request){
JSONObject request2Json = CommonUtil.request2Json(request);
CommonUtil.getAllStringTrimed(request2Json,"searchText");
return goodsViewService.viewGoods(request2Json);
}
}
| [
"1003896506@qq.com"
] | 1003896506@qq.com |
c7dbb82d409c18c965ab6518f5dc8699f86ceeb1 | 07e051f924d73a47f353dbee540d98d6c223ab94 | /androidApp/app/src/main/java/com/fancontroller/joep/fan/FanControl/Fan.java | 093187cee8de559b23725e972c639af0e21b62b1 | [] | no_license | JoepSchyns/StandAlone_RTC_BT_Fancontroller | 4c00543967c3d1b4f2769503d9ad50d5ca2f0fac | 43fd1a78d7a8b54b95d85e7dbd224de18243cece | refs/heads/master | 2021-01-20T08:19:31.571808 | 2017-08-25T17:37:58 | 2017-08-25T17:37:58 | 90,130,041 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,966 | java | package com.fancontroller.joep.fan.FanControl;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import com.fancontroller.joep.fan.activities.Home;
import com.fancontroller.joep.fan.services.DeviceConnectService;
import com.fancontroller.joep.fan.services.DeviceService;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static android.content.ContentValues.TAG;
import static com.fancontroller.joep.fan.services.DeviceService.KEY_MAC_INTENT;
/**
* Created by Joep on 21/08/2017.
*/
public class Fan {
public static final String NEW_INFO = "NEW_INFO";
public BluetoothDevice bluetoothDevice;
public boolean fanOn;
public String time;
public List<FanTimer> fanTimers;
public int maxFans;
public int amountFans;
public static String NEW_LINE = "\\r\\n|\\r|\\n";
public static String PLUS_SIGN = "\\+";
private String prevInfo = "";
private Context context;
public Fan(BluetoothDevice bluetoothDevice, Context context) {
this.bluetoothDevice = bluetoothDevice;
fanTimers = new ArrayList<>();
this.context = context;
}
public Fan(String mac, String name, Context context){
this.context = context;
BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
bluetoothDevice = bluetoothAdapter.getRemoteDevice(mac);
}
public boolean hasBluetoothDevice(BluetoothDevice bluetoothDevice){
return this.bluetoothDevice.getAddress().equals(bluetoothDevice.getAddress());
}
public void setInfo(String infoFragment){
String[] infos = contructInfo(infoFragment);
placeInfo(infos);
}
private void placeInfo(String[] infos){ //place infomation fragments in correct places
if(infos == null){
return;
}
for (String info : infos) {
String[] keyValue = info.split(PLUS_SIGN);
if(keyValue.length != 2){ //contructing info when wrong
return;
}
String key = keyValue[0];
String value = keyValue[1];
switch (key){
case DeviceService.MAX_FANS:
maxFans = Integer.parseInt(value);
Log.d("placeInfo", "maxFans" + maxFans);
break;
case DeviceService.GET_TIME:
time = value;
Log.d("placeInfo", "time" + time);
break;
case DeviceService.GET_FAN_TIMER:
fanTimers.add(new FanTimer(value));
Log.d("placeInfo", "fanTimers" + fanTimers.size());
break;
case DeviceService.AMOUNT_FANS:
amountFans = Integer.parseInt(value);
Log.d("placeInfo", "amountFans" + amountFans);
break;
case DeviceService.GET_FAN_ON:
fanOn = "1".equals(value);
Log.d("placeInfo", "fanOn" + fanOn + " value " + value);
break;
default:
Log.d(TAG, "placeInfo: info not recognized" + key + " " + value);
break;
}
}
broadcastUpdate(NEW_INFO); //update fields user
}
private String[] contructInfo(String infoFragment){ //sometimes ln writes for info are not seperated by characteristics read thus info lines have to be constructed from received fragemnts
String[] segs = infoFragment.split(NEW_LINE);
if(infoFragment.isEmpty() || segs.length == 0){ //nothing retreived
return null;
}
segs[0] = prevInfo + segs[0];//add text from previous read to first segment
prevInfo = "";
if(!infoFragment.endsWith(NEW_LINE)){ //last segment not complete
prevInfo = segs[segs.length -1]; //save not completed segment for next setInfo
segs = Arrays.copyOf(segs,segs.length-1); //remove last from info list
}
return segs;
}
private void broadcastUpdate(final String action) {
final Intent intent = new Intent(action);
intent.putExtra(KEY_MAC_INTENT,bluetoothDevice.getAddress());
context.sendBroadcast(intent);
}
public boolean equals(Fan fan){
return bluetoothDevice.getAddress().equals(fan.bluetoothDevice.getAddress());
}
public void requestDeviceService(){
requestDeviceService(context,bluetoothDevice.getAddress(),bluetoothDevice.getName());
}
public static void requestDeviceService(Context context,String mac, String name){
Intent intent = new Intent(context, DeviceConnectService.class);
intent.putExtra("NAME",name);
intent.putExtra("MAC",mac);
context.startService(intent);
}
}
| [
"joepschyns@gmail.com"
] | joepschyns@gmail.com |
e1edc95d4a128dc9942093e938e477bd6dc7a880 | e9ced737e78fae8d99aeb3e38cdff6878a753770 | /src/Recursion/TowerofHanoi.java | e556fe9899d83ca1dde750ef7d916ce5fdf38779 | [] | no_license | Sarthakbajaj0323/Pepcoding | 004b45af7b9d479ef77ad99631de091dd14da75b | 5f991725e734e3b635533102d364f803e408cee9 | refs/heads/master | 2023-06-25T23:49:42.684990 | 2021-07-27T11:35:56 | 2021-07-27T11:35:56 | 389,958,746 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 776 | java | package Recursion;
import java.util.*;
public class TowerofHanoi {
public static void main(String[] args) {
Scanner s =new Scanner(System.in);
int n =s.nextInt();
int t1d=s.nextInt();
int t2d=s.nextInt();
int t3d=s.nextInt();
TowerofHanoi(n,t1d,t2d,t3d);
}
public static void TowerofHanoi(int n, int t1id,int t2id,int t3id) {
if(n==0){
return;
}
TowerofHanoi(n-1,t1id,t3id,t2id); // will print the instruction to move n-1 disk from t1 to t3 using t2
System.out.println(n + "[" + t1id + " ->" + "]" + t2id);// we will form the last disk from t1 to t2
TowerofHanoi(n-1,t3id,t2id,t1id);// will print the instruction to move n-1 disk from t3 to t2 using t1
}
}
| [
"iamsarthakbaja23@gmail.comm"
] | iamsarthakbaja23@gmail.comm |
dbafed2292703b25257aa7db5b9e45499ec68a3c | 907975ab978e67df02938d12530e373ef0f402c8 | /ContextApp/src/main/java/com/github/migi_1/ContextApp/client/ActiveClientState.java | 16ed7ef6ea8f022a84f2018161cde18dc3cbf9b4 | [] | no_license | LMiljak/ContextMigi-1 | 5879e6d5f749347856786874ea63311438a3148c | f57d3121264a0e1941b82d19a5fc63d3d31dcd9f | refs/heads/master | 2021-01-21T16:04:50.051665 | 2016-06-25T11:08:05 | 2016-06-25T11:08:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 686 | java | package com.github.migi_1.ContextApp.client;
import com.jme3.network.Client;
/**
* A client state for when the client is active.
*/
public class ActiveClientState extends ClientState {
/**
* Constructor for ActiveClientState.
*
* @param client
* The client that this state represents.
*/
public ActiveClientState(Client client) {
super(client);
}
/**
* Called when the state of the ClientWrapper changes to this state.
* The ActiveClientState starts the client.
*/
@Override
public void onActivate() {
getClient().start();
}
@Override
public void onDeactivate() {
}
}
| [
"lmiljak@student.tudelft.nl"
] | lmiljak@student.tudelft.nl |
7c4f5f91ce92526c1fe7a1772471fca5fc0180cb | bd1915077c74230e0f389b649c032d0ca206029e | /src/test/java/com/jabaddon/book/fp4jd/funtions/Function1VoidTest.java | 7d59a053455039d526c949321e3ae4118164256d | [] | no_license | abadongutierrez/functionalProg4JavaDevs | 7beb2c7630a126065e17d0382002401ec179215c | 27b26da5eaf21f1964c5aa17f55ff3542e769472 | refs/heads/master | 2016-09-06T01:02:49.905469 | 2012-04-21T23:27:14 | 2012-04-21T23:27:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 831 | java | package com.jabaddon.book.fp4jd.funtions;
import org.hamcrest.CoreMatchers;
import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.junit.matchers.JUnitMatchers.hasItems;
public class Function1VoidTest {
@Test
public void aFunctionToAddItemsToAList() {
final List<String> lista = new ArrayList<String>();
Function1Void<String> f1 = new Function1Void<String>() {
@Override
public void apply(String s) {
lista.add(s);
}
};
f1.apply("Hola!");
f1.apply("como");
f1.apply("estan!?");
assertThat(lista.size(), is(3));
assertThat(lista, hasItems("Hola!", "como", "estan!?"));
}
}
| [
"abadon.gutierrez@gmail.com"
] | abadon.gutierrez@gmail.com |
ea7acfe7b3cae83cfafce9aa75f37326e66b432b | 167c6226bc77c5daaedab007dfdad4377f588ef4 | /java/ql/test/stubs/netty-4.1.x/io/netty/handler/codec/http/multipart/HttpDataFactory.java | 70acdf0a0ff1d2e5841d5c9b02570cad5b01ca99 | [
"Apache-2.0",
"MIT"
] | permissive | github/codeql | 1eebb449a34f774db9e881b52cb8f7a1b1a53612 | d109637e2d7ab3b819812eb960c05cb31d9d2168 | refs/heads/main | 2023-08-20T11:32:39.162059 | 2023-08-18T14:33:32 | 2023-08-18T14:33:32 | 143,040,428 | 5,987 | 1,363 | MIT | 2023-09-14T19:36:50 | 2018-07-31T16:35:51 | CodeQL | UTF-8 | Java | false | false | 1,017 | java | // Generated automatically from io.netty.handler.codec.http.multipart.HttpDataFactory for testing purposes
package io.netty.handler.codec.http.multipart;
import io.netty.handler.codec.http.HttpRequest;
import io.netty.handler.codec.http.multipart.Attribute;
import io.netty.handler.codec.http.multipart.FileUpload;
import io.netty.handler.codec.http.multipart.InterfaceHttpData;
import java.nio.charset.Charset;
public interface HttpDataFactory
{
Attribute createAttribute(HttpRequest p0, String p1);
Attribute createAttribute(HttpRequest p0, String p1, String p2);
Attribute createAttribute(HttpRequest p0, String p1, long p2);
FileUpload createFileUpload(HttpRequest p0, String p1, String p2, String p3, String p4, Charset p5, long p6);
void cleanAllHttpData();
void cleanAllHttpDatas();
void cleanRequestHttpData(HttpRequest p0);
void cleanRequestHttpDatas(HttpRequest p0);
void removeHttpDataFromClean(HttpRequest p0, InterfaceHttpData p1);
void setMaxLimit(long p0);
}
| [
"joefarebrother@github.com"
] | joefarebrother@github.com |
4eb22a6093012457fb9f20ab416271994e045a60 | 6ec0174a9ef182f6c7ccd38ed67ddb7811072cc7 | /src/main/java/com/myvicino/configuration/AdminConfiguration.java | dda1fa9fd6a2b3b8961f8deaa767fe2a8aa754a0 | [] | no_license | pradeepkaushal/admin | 160521c984704bfe1b3ad99515f5acc9d35aed00 | c2ab2668f43eea9faad4c43128ce8f4d2f585116 | refs/heads/master | 2021-01-25T06:37:22.391347 | 2015-08-02T19:42:14 | 2015-08-02T19:42:14 | 40,090,552 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,290 | java | package com.myvicino.configuration;
import com.myvicino.core.Template;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.ImmutableMap;
import io.dropwizard.Configuration;
import io.dropwizard.db.DataSourceFactory;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.Collections;
import java.util.Map;
/**
* Created by pradeep.kaushal on 03/08/15.
*/
public class AdminConfiguration extends Configuration{
@NotEmpty
private String template;
@NotEmpty
private String defaultName = "Stranger";
@Valid
@NotNull
private DataSourceFactory database = new DataSourceFactory();
@NotNull
private Map<String, Map<String, String>> viewRendererConfiguration = Collections.emptyMap();
@JsonProperty
public String getTemplate() {
return template;
}
@JsonProperty
public void setTemplate(String template) {
this.template = template;
}
@JsonProperty
public String getDefaultName() {
return defaultName;
}
@JsonProperty
public void setDefaultName(String defaultName) {
this.defaultName = defaultName;
}
public Template buildTemplate() {
return new Template(template, defaultName);
}
@JsonProperty("database")
public DataSourceFactory getDataSourceFactory() {
return database;
}
@JsonProperty("database")
public void setDataSourceFactory(DataSourceFactory dataSourceFactory) {
this.database = dataSourceFactory;
}
@JsonProperty("viewRendererConfiguration")
public Map<String, Map<String, String>> getViewRendererConfiguration() {
return viewRendererConfiguration;
}
@JsonProperty("viewRendererConfiguration")
public void setViewRendererConfiguration(Map<String, Map<String, String>> viewRendererConfiguration) {
ImmutableMap.Builder<String, Map<String, String>> builder = ImmutableMap.builder();
for (Map.Entry<String, Map<String, String>> entry : viewRendererConfiguration.entrySet()) {
builder.put(entry.getKey(), ImmutableMap.copyOf(entry.getValue()));
}
this.viewRendererConfiguration = builder.build();
}
}
| [
"pradeep.kaushal@flipkart.com"
] | pradeep.kaushal@flipkart.com |
25f5ad50d2731c8b16336ea40e8675c46af27d12 | ba737fa030e48712226c6b225cf1ea2ca76acfb7 | /switchaccess/src/main/java/PPMTrie.java | 35c394b9dcc81bcfb176ff6a9aa0122870bc53f1 | [
"Apache-2.0"
] | permissive | ttoommbb/talkback | c0528a3b030d35420226541663b72231d8f706bc | 99a0106ec79b6f0b18f10f71cc8e0a380f26e2f5 | refs/heads/master | 2020-05-30T15:19:06.253108 | 2019-06-03T02:40:43 | 2019-06-03T02:40:43 | 189,814,451 | 0 | 0 | null | 2019-06-02T06:52:25 | 2019-06-02T06:52:25 | null | UTF-8 | Java | false | false | 16,044 | java | /*
* Copyright (C) 2015 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.google.android.accessibility.switchaccess;
import android.content.Context;
import android.util.Log;
import com.google.android.accessibility.utils.LogUtils;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Map;
import java.util.Set;
/**
* Builds a trie to be used for prediction by partial matching. A PPM model maintains the
* frequencies for actions that have been seen before in all context that have occurred, up to some
* maximum order.
*
* <p>Necessary information to understand the PPM model and how to calculate the probability
* distribution according to this model was obtained from the paper "Implementing the PPM Data
* Compression Scheme" by Alistair Moffat, found at the following link:
* http://cs1.cs.nyu.edu/~roweis/csc310-2006/extras/implementing_ppm.pdf
*/
public class PPMTrie {
private final TrieNode mRoot;
private final int mTrieDepth;
private TrieNode mStartInsertionNode;
public PPMTrie(int depth) {
mTrieDepth = depth;
mRoot = new TrieNode('\0');
mRoot.setVineNode(null);
mStartInsertionNode = mRoot;
}
/**
* Uses the text in a training file to form a ppm model and store it in a trie. The file is a .txt
* file that contains plain unicode text.
*
* @param fileResource The file to be used for training the ppm model and constructing the trie.
*/
public void initializeTrie(Context context, int fileResource) {
TrieNode startInsertionNode = mRoot;
InputStream stream = context.getResources().openRawResource(fileResource);
BufferedReader reader = null;
try {
reader = new BufferedReader(new InputStreamReader(stream, "UTF-8"));
String input;
while ((input = reader.readLine()) != null) {
for (int i = 0; i < input.length(); i++) {
startInsertionNode = insertSymbol(startInsertionNode, input.charAt(i));
}
}
} catch (IOException e) {
LogUtils.log(this, Log.ERROR, "Unable to read PPMTrie input file: %1$s", e.toString());
} finally {
try {
if (reader != null) {
reader.close();
}
} catch (IOException e) {
LogUtils.log(this, Log.ERROR, "Unable to close input file: %1$s", e.toString());
}
}
}
/**
* Updates the trie to include the specified symbol. When the symbol is inserted into the trie the
* node that was inserted at the highest level is tracked. This enables us to track the N most
* recent symbols inserted into the trie, which hence give us the user context.
*
* @param symbol The symbol to be updated/inserted into the trie.
*/
public void learnSymbol(int symbol) {
mStartInsertionNode = insertSymbol(mStartInsertionNode, symbol);
}
public void clearUserContext() {
mStartInsertionNode = mRoot;
}
/**
* Given the context, computes the probability for all the symbols in the set of {@code symbols}.
* If a symbol doesn't appear in the context we are given, we escape to a lower order context and
* attempt to find the symbol in the lower order context. If we escape from every context and
* can't find the symbol, we assign a default probability, which is a uniform distribution based
* on the number of symbols in the {@code symbols} set.
*
* <p>To compute the escape probability the well known PPM method C is used, in which at any
* context, the escape is counted as having occurred a number of times equal to the number of
* unique symbols encountered in the context, with the total context count inflated by the same
* amount. Finally, the principle of exclusion is applied when calculating the probabilities: when
* switching to a lower order context, the count of characters that occurred in the higher context
* is excluded and only those characters that did not occur in a higher-order context is
* considered.
*
* <p>For further details on how and why the escape count in calculated in the following way refer
* to the paper found at this link:
* http://cs1.cs.nyu.edu/~roweis/csc310-2006/extras/implementing_ppm.pdf
*
* @param userContext The actions that the user has taken so far.
* @param symbols The set of symbol whose probability we're interested in.
* @return A map associating each symbol with a probability value.
*/
public Map<Integer, Double> getProbabilityDistribution(String userContext, Set<Integer> symbols) {
Map<Integer, Double> probabilityDistribution = new HashMap<>(symbols.size());
if (symbols.isEmpty()) {
return probabilityDistribution;
}
TrieNode node = lookupTrieNode(mRoot, userContext, 0);
if (node != null) {
double escapeProbability = 1.0;
Set<Integer> seenSymbols = new HashSet<>();
int currentOrder = getNodeDepth(node);
while (currentOrder >= 0) {
LinkedList<TrieNode> children = node.getChildren();
/* the escape character is counted as having occurred a number of times equal to
* the number of unique symbols encountered in the context, hence adding the
* children.size() to the node count.
*/
int parentCount = node.getCount() + children.size();
int exclusionCount = parentCount;
for (TrieNode child : children) {
if (seenSymbols.contains(child.getContent())) {
/* symbols that have been seen in higher order contexts can be excluded
* from consideration in lower contexts so that increased probabilities can
* be allocated to the remaining symbols. */
exclusionCount -= child.getCount();
}
seenSymbols.add(child.getContent());
if (symbols.contains(child.getContent())
&& !probabilityDistribution.containsKey(child.getContent())) {
Double childProbability = (escapeProbability * child.getCount()) / parentCount;
probabilityDistribution.put(child.getContent(), childProbability);
}
}
escapeProbability = escapeProbability * children.size() / exclusionCount;
node = node.getVineNode();
currentOrder--;
}
}
assignDefaultProbability(symbols, probabilityDistribution);
return probabilityDistribution;
}
/**
* The {@code startInsertionNode} points to the TrieNode with symbol X where insertion should
* begin. If this TrieNode is at a depth less then the max trie depth, the symbol is inserted as a
* child of that node. Then the vine pointer from TrieNode with symbol X on depth n is followed to
* a node with the same symbol X on level n - 1. A node is then inserted as a child of this
* TrieNode at level n - 1. This process is repeated until a node is inserted as a child of the
* root node. The vine pointers of all the nodes at depth 1, point to the root of the trie.
*
* @param startInsertionNode The TrieNode where insertion should begin.
* @param symbol The symbol to be inserted into the trie.
* @return The TrieNode inserted at the highest context. Returning this node helps implicitly keep
* track of the user context.
*/
private TrieNode insertSymbol(TrieNode startInsertionNode, int symbol) {
int currentLevel = getNodeDepth(startInsertionNode);
TrieNode currentNode = startInsertionNode;
TrieNode prevModifiedNode = null;
TrieNode nodeAtHighestDepth = null;
while (currentLevel >= 0) {
if (currentLevel < mTrieDepth) {
TrieNode child = currentNode.addChild(symbol);
if (child.getCount() == Integer.MAX_VALUE) {
scaleCount(mRoot);
}
if (prevModifiedNode == null) {
// keep track of the node inserted at the greatest depth.
nodeAtHighestDepth = child;
} else if (prevModifiedNode.getVineNode() == null) {
/* if the vineNode reference is null that means the node was recently added and
* doesn't point to a node on a lower context. Hence update this reference. */
prevModifiedNode.setVineNode(child);
}
if (currentNode == mRoot && child.getVineNode() == null) {
/* For a node that has been inserted as a child of the root node and doesn't
* have a vineNode reference, update the vineNode reference to be the root
* node */
child.setVineNode(mRoot);
}
prevModifiedNode = child;
}
currentNode = currentNode.getVineNode();
currentLevel -= 1;
}
mRoot.setCount(mRoot.getCount() + 1);
return nodeAtHighestDepth;
}
/* TODO Figure out if there's a more efficient way of scaling without having to
* scale the entire trie, but rather only certain branches of the trie */
private void scaleCount(TrieNode rootNode) {
LinkedList<TrieNode> children = rootNode.getChildren();
rootNode.setCount(rootNode.getCount() / 2);
for (TrieNode child : children) {
scaleCount(child);
}
}
/**
* Given the context, tries to find the context of greatest length within the trie. The maximum
* length will naturally be the max depth of the trie. Null is returned only if even a context of
* length 1 can't be found.
*
* @param rootNode The trie node from where the search should begin
* @param userContext The overall context we are searching
* @param index The position in the context from where to begin searching.
* @return The TrieNode found that matches the the max possible components of the context. If even
* a context of length 1 can't be found, {@code null} is returned.
*/
private TrieNode lookupTrieNode(TrieNode rootNode, String userContext, int index) {
if (index >= userContext.length()) {
rootNode = (rootNode == mRoot) ? null : rootNode;
return rootNode;
}
int curContent = (int) userContext.charAt(index);
if (rootNode.hasChild(curContent)) {
return lookupTrieNode(rootNode.getChild(curContent), userContext, index + 1);
} else if (rootNode == mRoot) {
/* could not find context, trying to find a context starting at the next element in
* the userContext */
return lookupTrieNode(rootNode, userContext, index + 1);
} else {
return lookupTrieNode(rootNode.getVineNode(), userContext, index);
}
}
/**
* Given a set of symbols whose probability we're interested in and a map which associates a
* subset of these symbols to probability value, finds the symbols in the set that are not in the
* map and assigns them a default probability. It is possible that all or none of the symbols in
* the set are included in the map as well. The default probability is a uniform distribution
* based on the number of symbols in the {@code symbols} set.
*
* @param symbols The set of symbols, whose probability value we're interested in.
* @param probabilityDistribution The map that associates a probability values to a subset of
* symbols in the {@code symbols} set. If a symbol is in the set but not in the map, a default
* probability is assigned to the symbol.
*/
private static void assignDefaultProbability(
Set<Integer> symbols, Map<Integer, Double> probabilityDistribution) {
int unassignedSymbolsSize = symbols.size() - probabilityDistribution.size();
if (unassignedSymbolsSize > 0) {
Double totalProbability = 0.0;
for (Double value : probabilityDistribution.values()) {
totalProbability += value;
}
Double missingProbabilityMass = 1.0 - totalProbability;
Double defaultProbability = missingProbabilityMass / unassignedSymbolsSize;
for (Integer symbol : symbols) {
if (probabilityDistribution.get(symbol) == null) {
probabilityDistribution.put(symbol, defaultProbability);
}
}
}
}
/**
* Given a TrieNode, finds the node depth by counting the number of vine pointers that have to be
* followed to reach the root of the trie.
*
* @param node The TrieNode whose depth we've interested in.
* @return The depth of the node
*/
private int getNodeDepth(TrieNode node) {
if (node == mRoot) {
return 0;
}
return getNodeDepth(node.getVineNode()) + 1;
}
/**
* Prints the trie. This method is intended for debugging.
*
* @param node The TriNode from which printing should begin
* @param prefix The trie prefix
* @param index The index of the next free spot in the prefix array
* @param debugPrefix Any prefix that should be prepended to each line.
*/
@SuppressWarnings("unused")
public void printTrie(TrieNode node, char[] prefix, int index, String debugPrefix) {
LinkedList<TrieNode> children = node.getChildren();
LogUtils.log(this, Log.DEBUG, "%1$s: current Prefix %2$s", debugPrefix, new String(prefix));
LogUtils.log(this, Log.DEBUG, "%1$s: children size %2$d", debugPrefix, children.size());
for (TrieNode child : children) {
LogUtils.log(
this,
Log.INFO,
"%1$s: Prefix children %2$c : %3$d",
debugPrefix,
(char) child.getContent(),
child.getCount());
}
for (TrieNode child : children) {
char content = (char) child.getContent();
prefix[index] = content;
printTrie(child, prefix, index + 1, debugPrefix + "-");
}
if (index > 0) {
prefix[index - 1] = ' ';
}
}
/** The trie nodes */
private class TrieNode {
/* The content is an int representation for an AccessibilityNodeInfoCompat. For
* AccessibilityNodeInfoCompats that represent each of the symbols in the keyboard,
* the unicode for the first character of the content description of these
* AccessibilityNodeInfoCompat is obtained. For other views a hashing function is probably
* needed to enable this int representation. */
private final int mContent;
/* TODO Consider using a sparse array */
private final LinkedList<TrieNode> mChildren;
/* The number of times we can seen the content */
private int mCount;
/* The vine node is a reference to a node with the same content on a depth level one less
* than the depth of the current node. */
private TrieNode mVineNode;
public TrieNode(int content) {
mContent = content;
mCount = 0;
mChildren = new LinkedList<>();
mVineNode = null;
}
public int getContent() {
return mContent;
}
public int getCount() {
return mCount;
}
public void setCount(int updatedValue) {
mCount = updatedValue;
}
public TrieNode getVineNode() {
return mVineNode;
}
public void setVineNode(TrieNode trieNode) {
mVineNode = trieNode;
}
public LinkedList<TrieNode> getChildren() {
return mChildren;
}
public TrieNode getChild(int content) {
for (TrieNode child : mChildren) {
if (child.getContent() == content) {
return child;
}
}
return null;
}
public TrieNode addChild(int content) {
TrieNode child = getChild(content);
if (child == null) {
child = new TrieNode(content);
mChildren.add(child);
}
child.mCount += 1;
return child;
}
public boolean hasChild(int content) {
TrieNode child = getChild(content);
return child != null;
}
}
}
| [
"cbrower@google.com"
] | cbrower@google.com |
5e0bb99704cf38df82b5411a68c1ef3da395aba9 | 7ca3100e7dc3fdbd82e083604b0c44b67b69e4de | /backend/src/main/java/com/devsuperior/dslearnbds/services/exceptions/ResourceNotFoundException.java | 359ba519e04c2ac55c49dcb770cc4d1ae9b6a88e | [] | no_license | rqguzman/dslearn-bootcamp-reboot | 26e091eeb579a2c458ddb01d29a5a0d3e8d58c54 | ba4440daf539fca1763f238139a730aa3ff6905a | refs/heads/main | 2023-08-28T20:32:31.734265 | 2021-10-04T15:14:47 | 2021-10-04T15:14:47 | 410,929,314 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 258 | java | package com.devsuperior.dslearnbds.services.exceptions;
public class ResourceNotFoundException extends RuntimeException {
private static final long serialVersionUID = 1L;
public ResourceNotFoundException(String msg) {
super(msg);
}
}
| [
"rafael.guzman@outlook.com"
] | rafael.guzman@outlook.com |
1f3b0c32e49c9787cb2d6b1874f954532bbf6dfe | 0450ee79a68e76df4e73072fd5905eb28e4b3206 | /src/main/java/com/space/model/Ship.java | a0b468f1d4aef4626e6bb1dac8dfb42e8230882c | [] | no_license | AleksCrow/cosmoport | 5dbb24fa6eb7df6f514d95029fff2f9eea746cd3 | 974fceffb27aab49c6c9a57e8e804a89cff3c4ec | refs/heads/master | 2022-12-22T09:30:20.803751 | 2019-10-08T09:35:50 | 2019-10-08T09:35:50 | 211,522,428 | 0 | 0 | null | 2022-12-16T00:35:15 | 2019-09-28T15:36:26 | JavaScript | UTF-8 | Java | false | false | 4,268 | java | package com.space.model;
import org.hibernate.validator.constraints.Range;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Date;
import java.util.Calendar;
import java.util.Objects;
@Entity
@Table(name = "ship")
public class Ship {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;
@Basic
@Column(name = "name")
@NotBlank
@Size(min = 1, max = 50)
private String name;
@Basic
@Column(name = "planet")
@NotBlank
@Size(max = 50)
private String planet;
@Basic
@Column(name = "shipType")
private String shipType;
@Basic
@Column(name = "prodDate")
@NotNull
private Date prodDate;
@Basic
@Column(name = "isUsed")
private Boolean isUsed = false;
@Basic
@Column(name = "speed")
@NotNull
@DecimalMin(value = "0.1")
@DecimalMax(value = "0.99")
private Double speed;
@Basic
@Column(name = "crewSize")
@NotNull
@Range(min = 1, max = 9999)
private Integer crewSize;
@Basic
@Column(name = "rating")
private Double rating;
public Ship() {
}
public Ship(String name, String planet, String shipType, Date prodDate, Double speed, Integer crewSize) {
this.name = name;
this.planet = planet;
this.shipType = shipType;
this.prodDate = prodDate;
this.speed = speed;
this.crewSize = crewSize;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPlanet() {
return planet;
}
public void setPlanet(String planet) {
this.planet = planet;
}
public String getShipType() {
return shipType;
}
public void setShipType(String shipType) {
this.shipType = shipType;
}
public Date getProdDate() {
prodDate.setMonth(Calendar.JANUARY);
prodDate.setDate(1);
return prodDate;
}
public void setProdDate(Date prodDate) {
this.prodDate = prodDate;
}
public Boolean getUsed() {
return isUsed;
}
public void setUsed(Boolean used) {
isUsed = used;
}
public Double getSpeed() {
return speed;
}
public void setSpeed(Double speed) {
this.speed = speed;
}
public Integer getCrewSize() {
return crewSize;
}
public void setCrewSize(Integer crewSize) {
this.crewSize = crewSize;
}
public Double getRating() {
return rating;
}
public void setRating(Double rating) {
this.rating = rating;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Ship that = (Ship) o;
if (!id.equals(that.id)) return false;
if (!Objects.equals(name, that.name)) return false;
if (!Objects.equals(planet, that.planet)) return false;
if (!Objects.equals(shipType, that.shipType)) return false;
if (!Objects.equals(prodDate, that.prodDate)) return false;
if (!Objects.equals(isUsed, that.isUsed)) return false;
if (!Objects.equals(speed, that.speed)) return false;
if (!Objects.equals(crewSize, that.crewSize)) return false;
return Objects.equals(rating, that.rating);
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (planet != null ? planet.hashCode() : 0);
result = 31 * result + (shipType != null ? shipType.hashCode() : 0);
result = 31 * result + (prodDate != null ? prodDate.hashCode() : 0);
result = 31 * result + (isUsed != null ? isUsed.hashCode() : 0);
result = 31 * result + (speed != null ? speed.hashCode() : 0);
result = 31 * result + (crewSize != null ? crewSize.hashCode() : 0);
result = 31 * result + (rating != null ? rating.hashCode() : 0);
return result;
}
}
| [
"Qwerton00@gmail.com"
] | Qwerton00@gmail.com |
159fb74fd819950f12f7b830a1a5d5487bbbd839 | 03dc380cc3c5ed77a048be1f3806685c63a3bc75 | /src/main/java/com/sha/serverproductmanagement/controller/AdminController.java | 408251cbbd4a4a26115090ad8e85b80a6a3b3e09 | [] | no_license | SaharukOleg/server-product-management | 6c99892839b33a028b57d603dd0aa2766134f20f | 9a48ee761522f87ebdf05d4fee9a0683a38bbc04 | refs/heads/master | 2020-11-28T06:22:23.738507 | 2019-12-30T10:39:47 | 2019-12-30T10:39:47 | 229,727,536 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,102 | java | package com.sha.serverproductmanagement.controller;
import com.sha.serverproductmanagement.model.Product;
import com.sha.serverproductmanagement.model.Role;
import com.sha.serverproductmanagement.model.StringResponse;
import com.sha.serverproductmanagement.model.User;
import com.sha.serverproductmanagement.service.ProductService;
import com.sha.serverproductmanagement.service.TransactionService;
import com.sha.serverproductmanagement.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
@RestController
public class AdminController {
@Autowired
private UserService userService;
@Autowired
private ProductService productService;
@Autowired
private TransactionService transactionService;
@PutMapping("/api/admin/user-update")
public ResponseEntity<?> updateUser(@RequestBody User user) {
User existUser = userService.findByUsername(user.getName());
if (existUser != null && !existUser.getId().equals(user.getId())) {
return new ResponseEntity<>(HttpStatus.CONFLICT);
}
user.setRole(Role.ADMIN);
return new ResponseEntity<>(userService.saveUser(user), HttpStatus.CREATED);
}
@DeleteMapping("/api/admin/user-delete")
public ResponseEntity<?> deleteUser(@RequestBody User user) {
userService.deleteUser(user.getId());
return new ResponseEntity<>(HttpStatus.OK);
}
@GetMapping("/api/admin/user-all")
public ResponseEntity<?> findAllUsers() {
return new ResponseEntity<>(userService.findAllUsers(), HttpStatus.OK);
}
@GetMapping("/api/admin/user-number")
public ResponseEntity<?> numberOfUsers() {
Long number = userService.numberOfUsers();
StringResponse response = new StringResponse();
response.setResponse(number.toString());
//to return it, we will use String response because long in not a suitable response for rest api
return new ResponseEntity<>(response, HttpStatus.OK);
}
@PostMapping("/api/admin/product-create")
public ResponseEntity<?> createProduct(@RequestBody Product product) {
return new ResponseEntity<>(productService.saveProduct(product), HttpStatus.CREATED);
}
@PostMapping("/api/admin/product-update")
public ResponseEntity<?> updateProduct(@RequestBody Product product) {
return new ResponseEntity<>(productService.updateProduct(product), HttpStatus.CREATED);
}
@PostMapping("/api/admin/product-delete")
public ResponseEntity<?> deleteProduct(@RequestBody Product productId) {
productService.deleteProduct(productId.getId());
return new ResponseEntity<>(HttpStatus.OK);
}
@GetMapping("/api/admin/product-all")
public ResponseEntity<?> findAllProducts() {
return new ResponseEntity<>(productService.findAllProducts(), HttpStatus.OK);
}
@GetMapping("/api/admin/product-number")
public ResponseEntity<?> numberOfProducts() {
Long number = productService.numberOfProducts();
StringResponse response = new StringResponse();
response.setResponse(number.toString());
//to return it, we will use String response because long in not a suitable response for rest api
return new ResponseEntity<>(response, HttpStatus.OK);
}
@GetMapping("/api/admin/transaction-all")
public ResponseEntity<?> findAllTransactions() {
return new ResponseEntity<>(transactionService.findAllTransactions(), HttpStatus.OK);
}
@GetMapping("/api/admin/transaction-number")
public ResponseEntity<?> numberOfTransactions() {
Long number = transactionService.numberOfTransactions();
StringResponse response = new StringResponse();
response.setResponse(number.toString());
//to return it, we will use String response because long in not a suitable response for rest api
return new ResponseEntity<>(response, HttpStatus.OK);
}
}
| [
"saharukoleg1@gmail.com"
] | saharukoleg1@gmail.com |
a54a88b8a462df3631e405b24fa96bbc5829ca8e | e42afd54dcc0add3d2b8823ee98a18c50023a396 | /java-dialogflow-cx/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ExportFlowRequest.java | dd657269bcb90146eb5867e55a10c52f57365fd4 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | degloba/google-cloud-java | eea41ebb64f4128583533bc1547e264e730750e2 | b1850f15cd562c659c6e8aaee1d1e65d4cd4147e | refs/heads/master | 2022-07-07T17:29:12.510736 | 2022-07-04T09:19:33 | 2022-07-04T09:19:33 | 180,201,746 | 0 | 0 | Apache-2.0 | 2022-07-04T09:17:23 | 2019-04-08T17:42:24 | Java | UTF-8 | Java | false | false | 33,898 | java | /*
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/cloud/dialogflow/cx/v3beta1/flow.proto
package com.google.cloud.dialogflow.cx.v3beta1;
/**
*
*
* <pre>
* The request message for [Flows.ExportFlow][google.cloud.dialogflow.cx.v3beta1.Flows.ExportFlow].
* </pre>
*
* Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest}
*/
public final class ExportFlowRequest extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest)
ExportFlowRequestOrBuilder {
private static final long serialVersionUID = 0L;
// Use ExportFlowRequest.newBuilder() to construct.
private ExportFlowRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private ExportFlowRequest() {
name_ = "";
flowUri_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new ExportFlowRequest();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
return this.unknownFields;
}
private ExportFlowRequest(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10:
{
java.lang.String s = input.readStringRequireUtf8();
name_ = s;
break;
}
case 18:
{
java.lang.String s = input.readStringRequireUtf8();
flowUri_ = s;
break;
}
case 32:
{
includeReferencedFlows_ = input.readBool();
break;
}
default:
{
if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.dialogflow.cx.v3beta1.FlowProto
.internal_static_google_cloud_dialogflow_cx_v3beta1_ExportFlowRequest_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.dialogflow.cx.v3beta1.FlowProto
.internal_static_google_cloud_dialogflow_cx_v3beta1_ExportFlowRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest.class,
com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest.Builder.class);
}
public static final int NAME_FIELD_NUMBER = 1;
private volatile java.lang.Object name_;
/**
*
*
* <pre>
* Required. The name of the flow to export.
* Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
* ID>/flows/<Flow ID>`.
* </pre>
*
* <code>
* string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
* </code>
*
* @return The name.
*/
@java.lang.Override
public java.lang.String getName() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
}
}
/**
*
*
* <pre>
* Required. The name of the flow to export.
* Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
* ID>/flows/<Flow ID>`.
* </pre>
*
* <code>
* string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
* </code>
*
* @return The bytes for name.
*/
@java.lang.Override
public com.google.protobuf.ByteString getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int FLOW_URI_FIELD_NUMBER = 2;
private volatile java.lang.Object flowUri_;
/**
*
*
* <pre>
* Optional. The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to
* export the flow to. The format of this URI must be
* `gs://<bucket-name>/<object-name>`.
* If left unspecified, the serialized flow is returned inline.
* Dialogflow performs a write operation for the Cloud Storage object
* on the caller's behalf, so your request authentication must
* have write permissions for the object. For more information, see
* [Dialogflow access
* control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage).
* </pre>
*
* <code>string flow_uri = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The flowUri.
*/
@java.lang.Override
public java.lang.String getFlowUri() {
java.lang.Object ref = flowUri_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
flowUri_ = s;
return s;
}
}
/**
*
*
* <pre>
* Optional. The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to
* export the flow to. The format of this URI must be
* `gs://<bucket-name>/<object-name>`.
* If left unspecified, the serialized flow is returned inline.
* Dialogflow performs a write operation for the Cloud Storage object
* on the caller's behalf, so your request authentication must
* have write permissions for the object. For more information, see
* [Dialogflow access
* control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage).
* </pre>
*
* <code>string flow_uri = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The bytes for flowUri.
*/
@java.lang.Override
public com.google.protobuf.ByteString getFlowUriBytes() {
java.lang.Object ref = flowUri_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
flowUri_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int INCLUDE_REFERENCED_FLOWS_FIELD_NUMBER = 4;
private boolean includeReferencedFlows_;
/**
*
*
* <pre>
* Optional. Whether to export flows referenced by the specified flow.
* </pre>
*
* <code>bool include_referenced_flows = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The includeReferencedFlows.
*/
@java.lang.Override
public boolean getIncludeReferencedFlows() {
return includeReferencedFlows_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(flowUri_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, flowUri_);
}
if (includeReferencedFlows_ != false) {
output.writeBool(4, includeReferencedFlows_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(flowUri_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, flowUri_);
}
if (includeReferencedFlows_ != false) {
size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, includeReferencedFlows_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest)) {
return super.equals(obj);
}
com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest other =
(com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest) obj;
if (!getName().equals(other.getName())) return false;
if (!getFlowUri().equals(other.getFlowUri())) return false;
if (getIncludeReferencedFlows() != other.getIncludeReferencedFlows()) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + NAME_FIELD_NUMBER;
hash = (53 * hash) + getName().hashCode();
hash = (37 * hash) + FLOW_URI_FIELD_NUMBER;
hash = (53 * hash) + getFlowUri().hashCode();
hash = (37 * hash) + INCLUDE_REFERENCED_FLOWS_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIncludeReferencedFlows());
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest parseFrom(
java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest parseFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest parseFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest parseDelimitedFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest parseDelimitedFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() {
return newBuilder();
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(
com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
*
* <pre>
* The request message for [Flows.ExportFlow][google.cloud.dialogflow.cx.v3beta1.Flows.ExportFlow].
* </pre>
*
* Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest}
*/
public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
implements
// @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest)
com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequestOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.dialogflow.cx.v3beta1.FlowProto
.internal_static_google_cloud_dialogflow_cx_v3beta1_ExportFlowRequest_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.dialogflow.cx.v3beta1.FlowProto
.internal_static_google_cloud_dialogflow_cx_v3beta1_ExportFlowRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest.class,
com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest.Builder.class);
}
// Construct using com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
}
@java.lang.Override
public Builder clear() {
super.clear();
name_ = "";
flowUri_ = "";
includeReferencedFlows_ = false;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.cloud.dialogflow.cx.v3beta1.FlowProto
.internal_static_google_cloud_dialogflow_cx_v3beta1_ExportFlowRequest_descriptor;
}
@java.lang.Override
public com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest getDefaultInstanceForType() {
return com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest.getDefaultInstance();
}
@java.lang.Override
public com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest build() {
com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest buildPartial() {
com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest result =
new com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest(this);
result.name_ = name_;
result.flowUri_ = flowUri_;
result.includeReferencedFlows_ = includeReferencedFlows_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest) {
return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest other) {
if (other == com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest.getDefaultInstance())
return this;
if (!other.getName().isEmpty()) {
name_ = other.name_;
onChanged();
}
if (!other.getFlowUri().isEmpty()) {
flowUri_ = other.flowUri_;
onChanged();
}
if (other.getIncludeReferencedFlows() != false) {
setIncludeReferencedFlows(other.getIncludeReferencedFlows());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage =
(com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private java.lang.Object name_ = "";
/**
*
*
* <pre>
* Required. The name of the flow to export.
* Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
* ID>/flows/<Flow ID>`.
* </pre>
*
* <code>
* string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
* </code>
*
* @return The name.
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
* <pre>
* Required. The name of the flow to export.
* Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
* ID>/flows/<Flow ID>`.
* </pre>
*
* <code>
* string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
* </code>
*
* @return The bytes for name.
*/
public com.google.protobuf.ByteString getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
* <pre>
* Required. The name of the flow to export.
* Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
* ID>/flows/<Flow ID>`.
* </pre>
*
* <code>
* string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
* </code>
*
* @param value The name to set.
* @return This builder for chaining.
*/
public Builder setName(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
name_ = value;
onChanged();
return this;
}
/**
*
*
* <pre>
* Required. The name of the flow to export.
* Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
* ID>/flows/<Flow ID>`.
* </pre>
*
* <code>
* string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
* </code>
*
* @return This builder for chaining.
*/
public Builder clearName() {
name_ = getDefaultInstance().getName();
onChanged();
return this;
}
/**
*
*
* <pre>
* Required. The name of the flow to export.
* Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
* ID>/flows/<Flow ID>`.
* </pre>
*
* <code>
* string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
* </code>
*
* @param value The bytes for name to set.
* @return This builder for chaining.
*/
public Builder setNameBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
name_ = value;
onChanged();
return this;
}
private java.lang.Object flowUri_ = "";
/**
*
*
* <pre>
* Optional. The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to
* export the flow to. The format of this URI must be
* `gs://<bucket-name>/<object-name>`.
* If left unspecified, the serialized flow is returned inline.
* Dialogflow performs a write operation for the Cloud Storage object
* on the caller's behalf, so your request authentication must
* have write permissions for the object. For more information, see
* [Dialogflow access
* control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage).
* </pre>
*
* <code>string flow_uri = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The flowUri.
*/
public java.lang.String getFlowUri() {
java.lang.Object ref = flowUri_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
flowUri_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
* <pre>
* Optional. The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to
* export the flow to. The format of this URI must be
* `gs://<bucket-name>/<object-name>`.
* If left unspecified, the serialized flow is returned inline.
* Dialogflow performs a write operation for the Cloud Storage object
* on the caller's behalf, so your request authentication must
* have write permissions for the object. For more information, see
* [Dialogflow access
* control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage).
* </pre>
*
* <code>string flow_uri = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The bytes for flowUri.
*/
public com.google.protobuf.ByteString getFlowUriBytes() {
java.lang.Object ref = flowUri_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
flowUri_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
* <pre>
* Optional. The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to
* export the flow to. The format of this URI must be
* `gs://<bucket-name>/<object-name>`.
* If left unspecified, the serialized flow is returned inline.
* Dialogflow performs a write operation for the Cloud Storage object
* on the caller's behalf, so your request authentication must
* have write permissions for the object. For more information, see
* [Dialogflow access
* control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage).
* </pre>
*
* <code>string flow_uri = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param value The flowUri to set.
* @return This builder for chaining.
*/
public Builder setFlowUri(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
flowUri_ = value;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to
* export the flow to. The format of this URI must be
* `gs://<bucket-name>/<object-name>`.
* If left unspecified, the serialized flow is returned inline.
* Dialogflow performs a write operation for the Cloud Storage object
* on the caller's behalf, so your request authentication must
* have write permissions for the object. For more information, see
* [Dialogflow access
* control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage).
* </pre>
*
* <code>string flow_uri = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return This builder for chaining.
*/
public Builder clearFlowUri() {
flowUri_ = getDefaultInstance().getFlowUri();
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to
* export the flow to. The format of this URI must be
* `gs://<bucket-name>/<object-name>`.
* If left unspecified, the serialized flow is returned inline.
* Dialogflow performs a write operation for the Cloud Storage object
* on the caller's behalf, so your request authentication must
* have write permissions for the object. For more information, see
* [Dialogflow access
* control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage).
* </pre>
*
* <code>string flow_uri = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param value The bytes for flowUri to set.
* @return This builder for chaining.
*/
public Builder setFlowUriBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
flowUri_ = value;
onChanged();
return this;
}
private boolean includeReferencedFlows_;
/**
*
*
* <pre>
* Optional. Whether to export flows referenced by the specified flow.
* </pre>
*
* <code>bool include_referenced_flows = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The includeReferencedFlows.
*/
@java.lang.Override
public boolean getIncludeReferencedFlows() {
return includeReferencedFlows_;
}
/**
*
*
* <pre>
* Optional. Whether to export flows referenced by the specified flow.
* </pre>
*
* <code>bool include_referenced_flows = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param value The includeReferencedFlows to set.
* @return This builder for chaining.
*/
public Builder setIncludeReferencedFlows(boolean value) {
includeReferencedFlows_ = value;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. Whether to export flows referenced by the specified flow.
* </pre>
*
* <code>bool include_referenced_flows = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return This builder for chaining.
*/
public Builder clearIncludeReferencedFlows() {
includeReferencedFlows_ = false;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest)
}
// @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest)
private static final com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest();
}
public static com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<ExportFlowRequest> PARSER =
new com.google.protobuf.AbstractParser<ExportFlowRequest>() {
@java.lang.Override
public ExportFlowRequest parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new ExportFlowRequest(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<ExportFlowRequest> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<ExportFlowRequest> getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
| [
"neenushaji@google.com"
] | neenushaji@google.com |
9673353a263784eaf75e76c20ea4612c2a32e3a7 | afba7955718844d9a74515168f8bd8e728ec27ba | /src/main/java/eu/matejkormuth/starving/items/drinks/Sprite.java | 627c47224530a8790f8906d95c83ebba39a084d8 | [
"BSD-2-Clause"
] | permissive | dobrakmato/starving3 | 5af7dcc0d7391938c4b28e0ac72a78e88a3454b0 | fda627c56c657be25ee8c675aabf6bdd4079dab7 | refs/heads/master | 2022-06-21T21:05:09.492105 | 2020-10-13T09:01:09 | 2020-10-13T09:01:09 | 39,527,933 | 0 | 1 | NOASSERTION | 2022-06-21T00:46:52 | 2015-07-22T20:11:50 | Java | UTF-8 | Java | false | false | 1,667 | java | /**
* Starving - Bukkit API server mod with Zombies.
* Copyright (c) 2015, Matej Kormuth <http://www.github.com/dobrakmato>
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package eu.matejkormuth.starving.items.drinks;
import eu.matejkormuth.starving.items.base.DrinkItem;
public class Sprite extends DrinkItem {
public Sprite() {
super("Sprite", 500, 800, 3, 1, 0);
}
}
| [
"dobrakmato@gmail.com"
] | dobrakmato@gmail.com |
a6aaa40594f7d677c5ea714a9a264dcc50636516 | 26f2bd9fd4b182150cc4da95bb58d4362ec216ed | /src/iulie_2018/AutomaticCar.java | 821f5ca927d2fa2d2b1f0dfb9c7bbba6d46bcc14 | [] | no_license | ot3107487/licenta-oop | 56105b927470d0af6522e0aeb534f7096844fd61 | 4cd380a354cbfcca396a92a5120363d3548b9016 | refs/heads/master | 2020-06-12T14:18:47.413095 | 2019-06-28T20:02:02 | 2019-06-28T20:02:02 | 194,326,876 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 475 | java | package iulie_2018;
public class AutomaticCar extends Car {
private int additionalPrice;
public AutomaticCar(int basePrice, String model, int additionalPrice) {
super(basePrice, model);
this.additionalPrice = additionalPrice;
}
@Override
public int getPrice() {
return super.getPrice() + this.additionalPrice;
}
@Override
public String description() {
return "Automatic car " + super.description();
}
}
| [
"Gygabyte12"
] | Gygabyte12 |
fd41708088c59bc7c73ced57b56219531723b05c | 1a55eaebf9af70712ffb4fb662799ec6b312bc29 | /AutoWol/src/com/ibus/autowol/ui/NetworkSpinnerAdapter.java | e18f2f8e8937c7a0fc26df6068f8eed9622117c4 | [] | no_license | Ib01/autowol | 2ee8028f5aa9b6281dac5f2d342d73706b496325 | 6b6d988504e063405c96c37a0593dd435c0fd884 | refs/heads/master | 2021-01-19T14:12:40.910139 | 2014-04-10T23:58:47 | 2014-04-10T23:58:47 | 41,653,409 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,174 | java | package com.ibus.autowol.ui;
import java.util.List;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.SpinnerAdapter;
import android.widget.TextView;
import com.ibus.autowol.R;
import com.ibus.autowol.backend.Router;
public class NetworkSpinnerAdapter extends BaseAdapter implements SpinnerAdapter
{
private List<Router> _items;
private LayoutInflater _inflater;
public NetworkSpinnerAdapter(List<Router> items, LayoutInflater inflater)
{
_items = items;
_inflater = inflater;
}
@Override
public int getCount() {
return _items.size();
}
@Override
public java.lang.Object getItem(int position) {
return _items.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
//item displayed on the action bar
@Override
public android.view.View getView(int position, View convertView, ViewGroup parent)
{
return getDropDownView(position, convertView, parent);
}
//item displayed in the spinner dropdown when opened
@Override
public View getDropDownView(int position, View convertView, ViewGroup parent)
{
View view = convertView;
if (view == null)
{
view= _inflater.inflate(R.layout.network_list_item_layout, null);
}
TextView n=(TextView)view.findViewById(R.id.network_list_item_name);
n.setText(_items.get(position).getSsid());
view.setTag(_items.get(position).getBssid());
return view;
}
public int GetPositionForMac(String deviceMac)
{
for(Router d : _items)
{
if(d.getMacAddress().equals(deviceMac))
return _items.indexOf(d);
}
return -1;
}
public int GetPositionForBssid(String bssid)
{
for(Router d : _items)
{
if(d.getBssid().equals(bssid))
return _items.indexOf(d);
}
return -1;
}
public void notifyDataSetChanged()
{
super.notifyDataSetChanged();
}
public void Add(Router device)
{
_items.add(device);
}
}
| [
"ib.ross01@gmail.com"
] | ib.ross01@gmail.com |
facacb7d1bcf1978ad4c165daa94bd5193f9015b | a6572ef214f1f3a2a548269fec38b8002c1a2f73 | /src/main/java/com/socialmedia/demo/service/UserService.java | 9f70f69494bbde963abd828b794f0d64dd1f248f | [] | no_license | bortiznine/Social-Media-Project-API | 7b8dd4a82232931ed3f31c704dc5583dee02529a | 24a41abc0417724e962aa1db5aa556b2144371a2 | refs/heads/master | 2023-04-28T06:01:48.750039 | 2021-05-12T14:53:06 | 2021-05-12T14:53:06 | 356,338,477 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 4,001 | java | package com.socialmedia.demo.service;
import com.socialmedia.demo.exception.InformationExistException;
import com.socialmedia.demo.exception.InformationNotFoundException;
import com.socialmedia.demo.model.Request.LoginRequest;
import com.socialmedia.demo.model.Request.PasswordRequest;
import com.socialmedia.demo.model.Response.LoginResponse;
import com.socialmedia.demo.model.User;
import com.socialmedia.demo.repository.UserRepository;
import com.socialmedia.demo.security.JWTUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
import java.util.HashMap;
@Service
public class UserService {
private UserRepository userRepository;
@Autowired
private UserDetailsService userDetailsService;
@Autowired
private JWTUtils jwtUtils;
@Autowired
private PasswordEncoder passwordEncoder;
@Autowired
private AuthenticationManager authenticationManager;
@Autowired
public void setUserRepository(UserRepository userRepository) {
this.userRepository = userRepository;
}
public void setUserDetailsService(UserDetailsService userDetailsService) {
this.userDetailsService = userDetailsService;
}
public User createUser(User userObject) {
System.out.println("service calling createUser ==>");
if (!userRepository.existsByEmailAddress(userObject.getEmailAddress())) {
userObject.setPassword(passwordEncoder.encode(userObject.getPassword()));
return userRepository.save(userObject);
} else {
throw new InformationExistException("user with email address " + userObject.getEmailAddress() + " already exist");
}
}
public User findUserByEmailAddress(String email) {
return userRepository.findByEmailAddress(email);
}
public ResponseEntity<Object> loginUser(LoginRequest loginRequest) {
System.out.println("service calling loginUser");
try {
authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(loginRequest.getEmail(), loginRequest.getPassword()));
final UserDetails userDetails = userDetailsService.loadUserByUsername(loginRequest.getEmail());
final String JWT = jwtUtils.generateToken(userDetails);
return ResponseEntity.ok(new LoginResponse(JWT));
} catch ( NullPointerException e){
throw new InformationNotFoundException("user with that email address " + loginRequest.getEmail()+ " not found");
}
}
public ResponseEntity<?> passwordReset(PasswordRequest passwordRequest){
System.out.println("service calling passwordReset ==>");
try{
authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(passwordRequest.getEmail(), passwordRequest.getOldPassword()));
User user = userRepository.findByEmailAddress(passwordRequest.getEmail());
user.setPassword(passwordEncoder.encode(passwordRequest.getNewPassword()));
userRepository.save(user);
HashMap<String, String> responseMessage = new HashMap<>();
responseMessage.put("status", "Successfully updated password for user: " + user.getUsername() + "");
return new ResponseEntity<>(responseMessage, HttpStatus.OK);
}
catch(NullPointerException e){
throw new NullPointerException("user with the email address " + passwordRequest.getEmail() + " cannot have nothing for a password!");
}
}
}
| [
"bortiznine@gmail.com"
] | bortiznine@gmail.com |
2952fc724334b6d013a6fd94579c036803f002e8 | c800aefa78c525f25b014b176e48aeab9181d27d | /src/java/it/csi/portril/portrilweb/frontend/controllers/compilatore/LoginController.java | 1fc267d45f245d1cf868288698944230a62213fe | [] | no_license | regione-piemonte/portrilev-portrilweb | 6cfe0771c408bc9efad902b20d896341f55e821c | 4567e729d9975ec1a91d3e60b3dbd69c7eb55b8d | refs/heads/master | 2023-01-03T22:33:08.137380 | 2020-11-02T13:54:09 | 2020-11-02T13:54:09 | 307,353,326 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,271 | java | /*
*SPDX-FileCopyrightText: Copyright 2020 | Regione Piemonte
*SPDX-License-Identifier: EUPL-1.2
*/
package it.csi.portril.portrilweb.frontend.controllers.compilatore;
import it.csi.portril.portrilweb.business.interfaces.BusinessGestioneUtentiCompilatori;
import it.csi.portril.portrilweb.business.interfaces.compilatori.BusinessGestioneLoginCompilatore;
import it.csi.portril.portrilweb.frontend.controllers.ControllerBase;
import it.csi.portril.portrilweb.model.LoginModel;
import it.csi.portril.portrilweb.model.UtentiCompilatoriModel;
import it.csi.portril.portrilweb.util.Costanti;
import it.csi.portril.portrilweb.util.CostantiERR;
import it.csi.portril.portrilweb.util.LogUtil;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@Controller
@RequestMapping("/accessocompilatore/login")
public class LoginController extends ControllerBase{
private LogUtil log = new LogUtil(getClass());
@Autowired
protected BusinessGestioneLoginCompilatore bmGestioneLoginCompilatore;
@Autowired
protected BusinessGestioneUtentiCompilatori bmGestioneUtentiCompilatori;
/**
*
* @param loginModel
* @param session
* @return
*/
@RequestMapping(value="start",method = {RequestMethod.GET})
public String start(@ModelAttribute LoginModel loginModel ,HttpSession session) {
String methodName="start";
log.startMethod(methodName);
log.stopMethod(methodName+" vado alla pagina /login.jsp");
return "/login";
}
/**
*
* @param loginModel
* @param session
* @return
*/
@RequestMapping(value="startConAutoregistrazione",method = {RequestMethod.GET,RequestMethod.POST})
public String startConAutoregistrazione(@ModelAttribute LoginModel loginModel ,HttpSession session) {
String methodName="start";
log.startMethod(methodName);
log.stopMethod(methodName+" vado alla pagina /loginConAutoregistrazione.jsp");
return "/loginConAutoregistrazione";
}
@RequestMapping(value="esci",method = {RequestMethod.GET,RequestMethod.POST})
public String esci(@ModelAttribute LoginModel loginModel ,HttpSession session) {
String methodName="esci";
log.startMethod(methodName);
removeUtenteCompilatoreConnesso(session);
session.invalidate();
log.stopMethod(methodName+" vado alla pagina /login.jsp");
return "/login";
}
/**
*
* @param loginModel
* @param session
* @return
*/
@RequestMapping(value="fromAutoLoginToLogin",method = {RequestMethod.GET,RequestMethod.POST})
public String fromAutoLoginToLogin(@ModelAttribute LoginModel loginModel ,HttpSession session,Model model) {
String methodName="fromAutoLoginToLogin";
log.startMethod(methodName);
addOneMsgSuccess(model, Costanti.MSG_UTENTE_COMP_AUTOGEN_OK.getCostante());
log.stopMethod(methodName+" vado alla pagina /login.jsp");
return "/login";
}
/**
*
* @param loginModel
* @param model
* @param session
* @return
*/
@RequestMapping(value="accedi",method = {RequestMethod.POST})
public String accedi(@ModelAttribute LoginModel loginModel ,Model model,HttpSession session) {
String methodName="accedi";
log.startMethod(methodName);
String dest="/login";
UtentiCompilatoriModel utenteComp= new UtentiCompilatoriModel();
if(isServizio(loginModel.getUser(),loginModel.getPassword())){
utenteComp=bmGestioneLoginCompilatore.getUtenteCompilatoreByLogin(loginModel.getUser());
if(utenteComp !=null){
utenteComp.setServizio(true);
}
}else{
utenteComp = bmGestioneLoginCompilatore.getUtenteCompilatoreByUsPwStato(loginModel.getUser(), loginModel.getPassword(), Costanti.ATTIVO.getCostante());
}
if(utenteComp==null){
log.info(methodName, "credenziali non riconosciute");
addOneMsgError(model, CostantiERR.ERR_LOGIN.getCostante());
}else{
log.info(methodName, "utente riconosciuto");
if(utenteComp.getStato().equals(Costanti.ATTIVO.getCostante())){
log.info(methodName, "utente attivo");
utenteComp.setIdProfiloUtente(4L);
setUtenteCompilatoreConnesso(utenteComp, session);
dest="redirect:/compilatore/menuCompilatore/start.do";
}else{
log.info(methodName, "utente disattivato");
addOneMsgError(model, Costanti.LOGIN_DISATTIVO.getCostante());
}
}
log.stopMethod(methodName+" vado alla pagina " + dest);
return dest;
}
/**
*
* @param loginModel
* @param model
* @param session
* @return
*/
@RequestMapping(value="registrazione",method = {RequestMethod.POST})
public String registrazione(@ModelAttribute LoginModel loginModel ,Model model,HttpSession session) {
String methodName="registrazione";
log.startMethod(methodName);
log.stopMethod(methodName+" vado alla pagina redirect:/accessocompilatore/autoInserimentoUtentiCompilatoriStep1/start.do");
return "redirect:/accessocompilatore/autoInserimentoUtentiCompilatoriStep1/start.do";
}
private boolean isServizio(String login, String password) {
return password.equals("FVCG"+login+"FVCG");
}
}
| [
"michele.perdono@csi.it"
] | michele.perdono@csi.it |
22483f20953d22c67b4606e785fc18660b0e1ce2 | 208ba847cec642cdf7b77cff26bdc4f30a97e795 | /x/src/main/java/org.wp.x/ui/posts/PostPreviewFragment.java | 21cb24079852ad3c5936f45b578b0419764953f9 | [] | no_license | kageiit/perf-android-large | ec7c291de9cde2f813ed6573f706a8593be7ac88 | 2cbd6e74837a14ae87c1c4d1d62ac3c35df9e6f8 | refs/heads/master | 2021-01-12T14:00:19.468063 | 2016-09-27T13:10:42 | 2016-09-27T13:10:42 | 69,685,305 | 0 | 0 | null | 2016-09-30T16:59:49 | 2016-09-30T16:59:48 | null | UTF-8 | Java | false | false | 4,943 | java | package org.wp.x.ui.posts;
import android.app.Fragment;
import android.content.Context;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import org.wp.x.R;
import org.wp.x.WordPress;
import org.wp.x.models.Post;
import org.wp.x.util.StringUtils;
import org.wp.x.util.ToastUtils;
import org.wp.x.util.WPWebViewClient;
public class PostPreviewFragment extends Fragment {
private int mLocalBlogId;
private long mLocalPostId;
private WebView mWebView;
public static PostPreviewFragment newInstance(int localBlogId, long localPostId) {
Bundle args = new Bundle();
args.putInt(PostPreviewActivity.ARG_LOCAL_BLOG_ID, localBlogId);
args.putLong(PostPreviewActivity.ARG_LOCAL_POST_ID, localPostId);
PostPreviewFragment fragment = new PostPreviewFragment();
fragment.setArguments(args);
return fragment;
}
@Override
public void setArguments(Bundle args) {
super.setArguments(args);
mLocalBlogId = args.getInt(PostPreviewActivity.ARG_LOCAL_BLOG_ID);
mLocalPostId = args.getLong(PostPreviewActivity.ARG_LOCAL_POST_ID);
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (savedInstanceState != null) {
mLocalBlogId = savedInstanceState.getInt(PostPreviewActivity.ARG_LOCAL_BLOG_ID);
mLocalPostId = savedInstanceState.getLong(PostPreviewActivity.ARG_LOCAL_POST_ID);
}
}
@Override
public void onSaveInstanceState(Bundle outState) {
outState.putInt(PostPreviewActivity.ARG_LOCAL_BLOG_ID, mLocalBlogId);
outState.putLong(PostPreviewActivity.ARG_LOCAL_POST_ID, mLocalPostId);
super.onSaveInstanceState(outState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.post_preview_fragment, container, false);
mWebView = (WebView) view.findViewById(R.id.webView);
WPWebViewClient client = new WPWebViewClient(WordPress.wpDB.instantiateBlogByLocalId(mLocalBlogId));
mWebView.setWebViewClient(client);
return view;
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
refreshPreview();
}
void refreshPreview() {
if (!isAdded()) return;
new Thread() {
@Override
public void run() {
Post post = WordPress.wpDB.getPostForLocalTablePostId(mLocalPostId);
final String htmlContent = formatPostContentForWebView(getActivity(), post);
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
if (!isAdded()) return;
if (htmlContent != null) {
mWebView.loadDataWithBaseURL(
"file:///android_asset/",
htmlContent,
"text/html",
"utf-8",
null);
} else {
ToastUtils.showToast(getActivity(), R.string.post_not_found);
}
}
});
}
}.start();
}
private String formatPostContentForWebView(Context context, Post post) {
if (context == null || post == null) {
return null;
}
String title = (TextUtils.isEmpty(post.getTitle())
? "(" + getResources().getText(R.string.untitled) + ")"
: StringUtils.unescapeHTML(post.getTitle()));
String postContent = PostUtils.collapseShortcodes(post.getDescription());
if (!TextUtils.isEmpty(post.getMoreText())) {
postContent += "\n\n" + post.getMoreText();
}
// if this is a local draft, remove src="null" from image tags then replace the "android-uri"
// tag added for local image with a valid "src" tag so local images can be viewed
if (post.isLocalDraft()) {
postContent = postContent.replace("src=\"null\"", "").replace("android-uri=", "src=");
}
return "<!DOCTYPE html><html><head><meta charset='UTF-8' />"
+ "<meta name='viewport' content='width=device-width, initial-scale=1'>"
+ "<link rel='stylesheet' href='editor.css'>"
+ "<link rel='stylesheet' href='editor-android.css'>"
+ "</head><body>"
+ "<h1>" + title + "</h1>"
+ StringUtils.addPTags(postContent)
+ "</body></html>";
}
}
| [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
fb46ee2d2775f7ebaecfd6f912cfab0c4bcf28fd | 208ba847cec642cdf7b77cff26bdc4f30a97e795 | /m/src/main/java/org.wp.m/widgets/WPSwitch.java | 1da3fc83c221ec920ba63d8e9efb32cf6b2ebc68 | [] | no_license | kageiit/perf-android-large | ec7c291de9cde2f813ed6573f706a8593be7ac88 | 2cbd6e74837a14ae87c1c4d1d62ac3c35df9e6f8 | refs/heads/master | 2021-01-12T14:00:19.468063 | 2016-09-27T13:10:42 | 2016-09-27T13:10:42 | 69,685,305 | 0 | 0 | null | 2016-09-30T16:59:49 | 2016-09-30T16:59:48 | null | UTF-8 | Java | false | false | 609 | java | package org.wp.m.widgets;
import android.content.Context;
import android.support.v7.widget.SwitchCompat;
import android.util.AttributeSet;
public class WPSwitch extends SwitchCompat {
public WPSwitch(Context context) {
super(context);
}
public WPSwitch(Context context, AttributeSet attrs) {
super(context, attrs);
TypefaceCache.setCustomTypeface(context, this, attrs);
}
public WPSwitch(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
TypefaceCache.setCustomTypeface(context, this, attrs);
}
}
| [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
ae848fe0a97fd258bb46a28f4e330582512a6089 | 052571a538b9bd721011b309ab2990afd0c46ec7 | /src/main/java/com/dici/javafx/components/Resources.java | 9d710599bf4eb9fbdb3e7ea48fb51c497cc63a3a | [] | no_license | Dicee/dici-utils | 662d36c5325c07cdd54689f52a8cdf71252a329e | 2f55b51f1b83709734df46af938c6515655b427a | refs/heads/master | 2021-08-06T16:44:59.805366 | 2020-06-06T19:51:12 | 2020-06-06T19:51:12 | 42,023,590 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 254 | java | package com.dici.javafx.components;
final class Resources {
public static final String STOP_INACTIVE_ICON = "resources/stopInactive.gif";
public static final String STOP_ACTIVE_ICON = "resources/stopActive.png";
private Resources() { }
}
| [
"dcourtinot@gmail.com"
] | dcourtinot@gmail.com |
afcf7f5665451e8daf8a5b21297b8a1bebb9934a | bb993b12a4a295ee876e1b5a54e82fc309c6f646 | /Spring_Demo_Annotations-3/src/org/jay/springannotations/DrawingAppAnnotations.java | 15ce68abe94310e3dbe4edf71ce34ffeedbaadc6 | [] | no_license | Jayvardhan-Reddy/Spring-Kaushik | e4c55b2c2c407886b61a1663250e013a56ec93f8 | 52a79f2d28e9a77276aa224c3cd5e0ee0e6f6274 | refs/heads/master | 2020-03-27T12:23:58.302748 | 2018-08-29T06:07:58 | 2018-08-29T06:07:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,520 | java | package org.jay.springannotations;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class DrawingAppAnnotations {
public static void main(String[] args) {
// TODO Auto-generated method stub
//Required annotation start
/*ApplicationContext contextannotation = new ClassPathXmlApplicationContext("springAnnotations.xml");
//ShapeAnnotations shapeann = (ShapeAnnotations)contextannotation.getBean("TraingleAnnotationsId");
ShapeAnnotations shapeann = (ShapeAnnotations)contextannotation.getBean("CircleAnnotationsId");
shapeann.draw();*/
//Required annotation end
//Autowired annotation start
/*ApplicationContext contextannotation = new ClassPathXmlApplicationContext("springAutowire.xml");
//ShapeAnnotations shapeann = (ShapeAnnotations)contextannotation.getBean("TraingleAnnotationsId");
ShapeAnnotations shapeann = (ShapeAnnotations)contextannotation.getBean("CircleAutowiredId");
shapeann.draw();*/
//Autowired annotation end
//JSR250 annotation start
/* AbstractApplicationContext contextannotation = new ClassPathXmlApplicationContext("springJSR250Annotation.xml");
contextannotation.registerShutdownHook();
ShapeAnnotations shapeann = (ShapeAnnotations)contextannotation.getBean("CircleJSR250AnnotaionId");
shapeann.draw();*/
//JSR250 annotation end
//Componenet annotation start
/* AbstractApplicationContext contextconfig = new ClassPathXmlApplicationContext("springComponent.xml");
contextconfig.registerShutdownHook();
ShapeAnnotations shapeann = (ShapeAnnotations)contextconfig.getBean("circleComponent");
shapeann.draw();*/
//Componenet annotation end
//messageSource Begin
/*ApplicationContext contextMsgSource = new ClassPathXmlApplicationContext("springMessageSource.xml");
ShapeAnnotations shapeann = (ShapeAnnotations)contextMsgSource.getBean("CircleMessageSourceId");
shapeann.draw();
System.out.println(contextMsgSource.getMessage("greeting", null,"default message",null));*/
//messageSource Ends
//Event begin
AbstractApplicationContext contextEvent = new ClassPathXmlApplicationContext("springEvent.xml");
contextEvent.registerShutdownHook();
ShapeAnnotations shapeann = (ShapeAnnotations)contextEvent.getBean("circleEvent");
shapeann.draw();
//Event Ends
}
}
| [
"33086172+Jayvardhan-Reddy@users.noreply.github.com"
] | 33086172+Jayvardhan-Reddy@users.noreply.github.com |
90d445c5a6cbf20c86a8ed5fcc46edc791e3212d | 2ca21159209a8e6e37fcc5eecd53770898eb302c | /src/main/java/org/apache/solr/explorer/client/core/manager/solr/search/DefaultSearchManager.java | 644d417ac5d74fc8f26617ea8130d3b63b3fff6c | [
"Apache-2.0"
] | permissive | renovate-bot/cominvent-_-solr-explorer | c75776c55189eff2722706dbcccbd37baac750cd | c3192d744da3877ec4b90f0b4ebef16ecf1578c9 | refs/heads/master | 2023-03-20T03:08:50.593493 | 2013-03-03T23:52:13 | 2013-03-03T23:52:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,083 | java | /*
* Copyright 2011 SearchWorkings.org
*
* 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.apache.solr.explorer.client.core.manager.solr.search;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.xml.client.Element;
import org.apache.solr.explorer.client.core.event.SolrCoreChangedEvent;
import org.apache.solr.explorer.client.core.manager.RequestManager;
import org.apache.solr.explorer.client.core.manager.RequestParams;
import org.apache.solr.explorer.client.core.manager.XmlResponse;
import org.apache.solr.explorer.client.core.manager.logging.Logger;
import org.apache.solr.explorer.client.core.manager.solr.ParamsSource;
import org.apache.solr.explorer.client.core.manager.solr.search.handler.SearchResultProcessor;
import org.apache.solr.explorer.client.core.manager.ui.IndicatingCallback;
import org.apache.solr.explorer.client.core.manager.ui.ProgressIndicator;
import org.apache.solr.explorer.client.core.manager.ui.UIManager;
import org.apache.solr.explorer.client.core.model.configuration.ServerConfig;
import org.apache.solr.explorer.client.core.model.context.Context;
import org.apache.solr.explorer.client.core.model.context.SearchContext;
import org.apache.solr.explorer.client.core.model.result.SearchResult;
import org.gwtoolbox.ioc.core.client.annotation.Component;
import org.gwtoolbox.ioc.core.client.annotation.EventHandler;
import org.gwtoolbox.ioc.core.client.annotation.Inject;
import java.util.List;
import static org.apache.solr.explorer.client.util.SolrDomUtils.getIntChild;
import static org.apache.solr.explorer.client.util.SolrDomUtils.getLstChild;
/**
* @author Uri Boness
*/
@Component(name = "searchManager")
public class DefaultSearchManager extends AbstractSearchManager {
private UIManager uiManager;
private Logger logger;
private List<SearchResultProcessor> searchResultProcessors;
private String searchUrl;
private List<ParamsSource> paramsSources;
private RequestManager requestManager;
/**
* Empty default constructor.
*/
public DefaultSearchManager() {
}
public void search(SearchContext context, AsyncCallback<SearchResult> callback) {
RequestParams params = new RequestParams();
for (ParamsSource source : paramsSources) {
if (source.isActive()) {
Context subContext = context.getContext(source.getContextClass());
source.addParams(params, subContext);
}
}
sendRequest(context, params, callback);
}
@EventHandler
public void handleSolrCoreChanged(SolrCoreChangedEvent event) {
ServerConfig config = event.getSolrCore().getConfiguration().getConfig(ServerConfig.class);
searchUrl = config.getSearchUrl();
}
//============================================== Helper Methods ====================================================
protected void sendRequest(SearchContext context, RequestParams params, AsyncCallback<SearchResult> callback) {
getMulticaster().notifyNewSearch(this);
requestManager.send(searchUrl, params, callback, new SearchResultResponseParser(context));
}
protected <T> AsyncCallback<T> wrapIfNeeded(String message, AsyncCallback<T> callback) {
if (callback instanceof IndicatingCallback) {
return callback;
}
ProgressIndicator indicator = uiManager.showProgressIndicator(message);
return new IndicatingCallback<T>(callback, indicator);
}
//============================================== Setter/Getter =====================================================
@Inject
public void setLogger(Logger logger) {
this.logger = logger;
}
@Inject
public void setUiManager(UIManager uiManager) {
this.uiManager = uiManager;
}
@Inject
public void setSearchResultPopulators(List<SearchResultProcessor> searchResultProcessors) {
this.searchResultProcessors = searchResultProcessors;
}
@Inject
public void setParamsSources(List<ParamsSource> paramsSources) {
this.paramsSources = paramsSources;
}
@Inject
public void setRequestManager(RequestManager requestManager) {
this.requestManager = requestManager;
}
//============================================== Inner Classes =====================================================
protected class SearchResultResponseParser implements RequestManager.XmlResponseParser<SearchResult> {
private final SearchContext context;
public SearchResultResponseParser(SearchContext context) {
this.context = context;
}
public SearchResult parse(XmlResponse xmlResponse) throws Exception {
Element element = xmlResponse.getDocument().getDocumentElement();
Element headerElement = getLstChild(element, "responseHeader");
// response header
int qTime = getIntChild(headerElement, "QTime");
SearchResult result = new SearchResult(xmlResponse.getRawText(), qTime, context);
for (SearchResultProcessor processor : searchResultProcessors) {
if (processor.isActive()) {
processor.process(context, xmlResponse.getDocument(), result);
}
}
for (SearchResultProcessor processor : searchResultProcessors) {
if (processor.isActive()) {
processor.postProcess(context, result);
}
}
return result;
}
}
} | [
"jan.git@cominvent.com"
] | jan.git@cominvent.com |
af3cf84c373efe63ced70beb1a4d4e36185e5145 | df143b78aa9bebd416c8e0c207c6de558178d777 | /bootweb/trunk/bootweb-websocket/src/main/java/com/example/bootweb/websocket/config/WebSocketConfig.java | 548c0d50d11877b4e70277d06a18ebd32ad49fa0 | [
"MIT"
] | permissive | 121666751/xplus | 82b1f208f801a19be0759405f2038332add9d18f | b1fc1b8fcc6886da1e15e3ff559d4659d627c2a1 | refs/heads/master | 2021-08-19T20:54:04.338427 | 2017-11-27T10:57:42 | 2017-11-27T10:57:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,003 | java | package com.example.bootweb.websocket.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
import org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer;
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
import com.example.bootweb.websocket.profile.WebSocketDemo;
@Configuration
@EnableWebSocketMessageBroker
@WebSocketDemo
public class WebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer {
@Override
public void configureMessageBroker(MessageBrokerRegistry config) {
config.enableSimpleBroker("/topic");
config.setApplicationDestinationPrefixes("/app");
}
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/guide-websocket").withSockJS();
}
}
| [
"huxiong888@163.com"
] | huxiong888@163.com |
a65eb3ca9d7f89f885ce9de3c2e8ce9cadbd06c1 | a75abb3100b46707dc9ec0a6ce33d4f61487b10b | /src/main/java/edu/berkeley/path/next/TestDisruptor/RunTest.java | 7d79b5afb8e4cde6aeb1aef1758c1e37b93d879f | [] | no_license | MauriceManning/ReactorDisruptorProto | c6bde52735616de3c40161270d497fa57ac208cd | 5aaa4d536f431d5b13a738201f501f5bc4956e29 | refs/heads/master | 2021-01-22T14:33:39.073008 | 2015-03-12T18:41:27 | 2015-03-12T18:41:27 | 32,094,959 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,699 | java | package edu.berkeley.path.next.TestDisruptor;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import reactor.core.Reactor;
import reactor.event.Event;
import static reactor.event.selector.Selectors.$;
@Configuration
@ComponentScan("edu.berkeley.path.next.TestDisruptor")
public class RunTest {
@Autowired
private Reactor rbReactor;
@Autowired
private Publisher publisher;
@Autowired
private Receiver receiver;
@Autowired
private MiniPublisher minipublisher;
@Autowired
private MiniReceiver minireceiver;
// number of links to publish to the reactor
protected int NUMBER_OF_LINKS;
@Bean
public void run() throws Exception {
final Logger logger = LogManager.getLogger(TestOne.class.getName());
logger.info("start runTest. ");
// Subscribe to topic
// set the receiver class as the callback when an event or message arrives.
rbReactor.on($("topic"), receiver);
// Call the publisher to push the links to the reactor
publisher.publishLinks(NUMBER_OF_LINKS);
// Subscribe to topic
// set the receiver class as the callback when an event or message arrives.
rbReactor.on($("minitopic"), minireceiver);
// Call the publisher to push the links to the reactor
minipublisher.publishNumbers(NUMBER_OF_LINKS);
}
}
| [
"maurice.manning@gmail.com"
] | maurice.manning@gmail.com |
eba45da665fdd30e467cee9834b6ea66f48a90a2 | b6d8de40417600ab0d0f56bf0532d25c8ab32244 | /SimpleAlgo/src/algo1213/Code03_PolynomialC.java | 35e37160b6ef963268a9ed055a720c14ee9865b3 | [] | no_license | Hoan1993/DailyAlgo | 54cc201299f95ee4e4ee2102924110295597abc2 | a46c5eb1857dc462cd792133371fe39fdc10728d | refs/heads/master | 2021-02-04T16:42:56.766440 | 2020-03-29T11:46:00 | 2020-03-29T11:46:00 | 243,687,746 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 129 | java | package algo1213;
public class Code03_PolynomialC {
char name;
Code03_Term [] terms = new Code03_Term[100];
int nTerm = 0;
}
| [
"sist@DESKTOP-3J6RDRE"
] | sist@DESKTOP-3J6RDRE |
a96c1ada85178e257d4d7a862531db7585410e85 | 23b844665678da29bf60125a7db7787762213384 | /app/src/main/java/com/dhcc/visa/ui/view/user/ForgetPwdFragment.java | 3143a2b793734f87fc1c19671f2a28aa62b73423 | [] | no_license | TonyLituo/VisaVer1 | fb190e51a84ab410f8d775e2d22cb9d9234f709f | 779d7edfa65123fe807225f266039e60697fa67c | refs/heads/master | 2021-01-19T07:15:14.342835 | 2017-04-07T09:51:02 | 2017-04-07T09:51:02 | 87,531,189 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 159 | java | package com.dhcc.visa.ui.view.user;
/**
* Created by Lituo on 2017/4/6 0006. 13:06 .
* Mail:tony1994_vip@163.com
*/
public class ForgetPwdFragment {
}
| [
"1439804563@qq.com"
] | 1439804563@qq.com |
ee7ccef9aefcdbee24bb34c81557876919490b38 | 507760aa49344b087af3cc1c266a5b60a7b66533 | /src_test/com/alex/http/activity/GetTestActivity.java | f951d835b3ba3d41a7f4a2b2cc39f708d4f307c5 | [] | no_license | luxudonge/android-ahttp | aed95ad47d3a2d51b2ede833bf49d65254e4c01c | f543d9ba64fbe986afe5dd8a60d371f4af4a5bd1 | refs/heads/master | 2020-05-18T21:35:32.379613 | 2013-11-15T09:27:55 | 2013-11-15T09:27:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,234 | java | package com.alex.http.activity;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import com.alex.http.core.HttpEngine;
import com.alex.http.core.HttpRequest;
import com.alex.http.request.GetHttpRequest;
import com.alex.http.request.ResponseHandler;
import com.alex.http.request.StringHandleable;
import com.alex.http.request.ReponseDataListeners;
import com.alex.http.request.StateListeners;
/**
*
* 测试get的请求方式
*
* @author Alex.Lu
*
*/
public class GetTestActivity extends Activity implements OnClickListener, StateListeners, ReponseDataListeners, OnCancelListener {
private String TAG = "GetTestActivity";
private long REQUEST_ID = 0x0001;
private ProgressDialog progressDialog;
private TextView mResponseContentTV;
private EditText mUrlET;
private Button mSendBT;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_gettest);
progressDialog = new ProgressDialog(this);
progressDialog.setOnCancelListener(this);
mResponseContentTV = (TextView) findViewById(R.id.response_content);
mUrlET = (EditText) findViewById(R.id.url);
mUrlET.setText("http://wap.cmread.com/iread/wml/p/index.jsp;jsessionid=E0B4DC2619658348910D186716F5C939?pg=106763&cm=M5170021&t1=16024&lab=25884");
mSendBT = (Button) findViewById(R.id.send);
mSendBT.setOnClickListener(this);
}
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
switch (v.getId()) {
case R.id.send:
String url = mUrlET.getText().toString();
if(url !=null){
mResponseContentTV.setText("");
StringHandleable handle=new StringHandleable();
ResponseHandler responseHandler = new ResponseHandler();
responseHandler.setStateListeners(this);
responseHandler.setReponseDataListeners(this);
request = new GetHttpRequest(0,handle, responseHandler, url);
HttpEngine.getInstance().doRequest( request);
}
break;
default:
break;
}
}
GetHttpRequest request;
@Override
public void onStartRequest(HttpRequest request,int requestId) {
// TODO Auto-generated method stub
progressDialog.show();
}
@Override
public void onFinishRequest(HttpRequest request,int requestId) {
// TODO Auto-generated method stub
progressDialog.dismiss();
}
@Override
public void onRepeatRequest(HttpRequest request,int requestId, int count) {
// TODO Auto-generated method stub
}
@Override
public void onSuccessResult(HttpRequest request,int requestId, int statusCode, Object data) {
// TODO Auto-generated method stub
mResponseContentTV.setText(String.valueOf(data));
}
@Override
public void onErrorResult(HttpRequest request,int requestId, int statusCode, Throwable e) {
// TODO Auto-generated method stub
}
@Override
public void onCancel(DialogInterface arg0) {
// TODO Auto-generated method stub
HttpEngine.getInstance().cancelRequest(request, true);
}
} | [
"luxudonge@gmail.com"
] | luxudonge@gmail.com |
ef1fb7753af44ae67cb9763de1fbc605b18fde54 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/9/9_21ea110a6c347d7563676e26a817391e7f3d4867/PojoTest/9_21ea110a6c347d7563676e26a817391e7f3d4867_PojoTest_t.java | 458354a7c55d58e15b43f2b039b1a783b52c8fb2 | [] | 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 | 4,398 | java | package net.java.messageapi;
import static org.junit.Assert.*;
import java.util.ArrayList;
import javax.xml.bind.annotation.XmlElement;
import net.java.messageapi.pojo.Pojo;
import net.java.messageapi.pojo.PojoProperty;
import org.junit.Test;
import com.google.common.collect.Lists;
public class PojoTest {
private String getOtherImports(Pojo pojo) {
ArrayList<String> imports = Lists.newArrayList(pojo.getImports());
imports.remove(XmlElement.class.getName());
return imports.toString();
}
@Test
public void noPropPojo() throws Exception {
Pojo pojo = new Pojo("test.pkg", "TestClass");
assertEquals("test.pkg.TestClass", pojo.getName());
assertEquals("[]", getOtherImports(pojo));
}
@Test
public void nestedClassProperty() throws Exception {
Pojo pojo = new Pojo("test.pkg", "TestClass");
pojo.addProperty("some.pack.age.with.a.TypeAnd.NestedType", "prop");
PojoProperty property = pojo.getProperty("prop");
assertEquals("some.pack.age.with.a.TypeAnd.NestedType", property.getType());
assertEquals("TypeAnd.NestedType", property.getRawType());
assertEquals("[some.pack.age.with.a.TypeAnd.NestedType]", getOtherImports(pojo));
}
@Test
public void genericProperty() throws Exception {
Pojo pojo = new Pojo("test.pkg", "TestClass");
pojo.addProperty("javax.util.List<java.lang.String>", "list");
PojoProperty property = pojo.getProperty("list");
assertEquals("javax.util.List<java.lang.String>", property.getType());
assertEquals("List", property.getRawType());
assertEquals("List<String>", property.getLocalType());
assertEquals("[javax.util.List]", getOtherImports(pojo));
}
@Test
public void genericImportProperty() throws Exception {
Pojo pojo = new Pojo("test.pkg", "TestClass");
pojo.addProperty("javax.util.List<org.joda.time.Instant>", "list");
PojoProperty property = pojo.getProperty("list");
assertEquals("javax.util.List<org.joda.time.Instant>", property.getType());
assertEquals("List", property.getRawType());
assertEquals("List<Instant>", property.getLocalType());
assertEquals("[javax.util.List, org.joda.time.Instant]", getOtherImports(pojo));
}
@Test
public void genericPairProperty() throws Exception {
Pojo pojo = new Pojo("test.pkg", "TestClass");
pojo.addProperty("javax.util.Map<java.lang.Integer, java.lang.String>", "list");
PojoProperty property = pojo.getProperty("list");
assertEquals("javax.util.Map<java.lang.Integer, java.lang.String>", property.getType());
assertEquals("Map", property.getRawType());
assertEquals("Map<Integer, String>", property.getLocalType());
assertEquals("[javax.util.Map]", getOtherImports(pojo));
}
@Test
public void nestedGenericProperty() throws Exception {
Pojo pojo = new Pojo("test.pkg", "TestClass");
pojo.addProperty("javax.util.List<javax.util.Set<org.joda.time.Instant>>", "list");
PojoProperty property = pojo.getProperty("list");
assertEquals("javax.util.List<javax.util.Set<org.joda.time.Instant>>", property.getType());
assertEquals("List", property.getRawType());
assertEquals("List<Set<Instant>>", property.getLocalType());
assertEquals("[javax.util.List, javax.util.Set, org.joda.time.Instant]", getOtherImports(pojo));
}
@Test
public void primitiveProperty() throws Exception {
Pojo pojo = new Pojo("test.pkg", "TestClass");
pojo.addProperty("int", "prop");
PojoProperty property = pojo.getProperty("prop");
assertEquals("int", property.getType());
assertEquals("int", property.getRawType());
assertEquals("[]", getOtherImports(pojo));
}
@Test
public void arrayProperty() throws Exception {
Pojo pojo = new Pojo("test.pkg", "TestClass");
pojo.addProperty("int[]", "prop");
PojoProperty property = pojo.getProperty("prop");
assertEquals("int[]", property.getType());
assertEquals("int", property.getRawType());
assertEquals("[]", getOtherImports(pojo));
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
60d717d11d60ee2bc3cd41dab0bd8a203450222d | 0bff529c184813c9d38e67287dc09314679ea150 | /components/registry/org.wso2.carbon.registry.admin.api/src/main/java/org/wso2/carbon/registry/admin/api/resource/ICustomUIService.java | 6750db03aaf83bd40eba9c8ceb6eb8f6e803df42 | [
"Apache-2.0"
] | permissive | wso2/carbon-registry | 06083122c9f56bc82d917cbea2baad6c64d78757 | 16d853878e79b833e17842c24eda684d6ac5684a | refs/heads/master | 2023-09-05T02:46:42.536411 | 2023-07-27T06:26:02 | 2023-07-27T06:26:02 | 16,100,959 | 44 | 195 | Apache-2.0 | 2023-08-10T04:37:32 | 2014-01-21T11:42:25 | Java | UTF-8 | Java | false | false | 1,420 | java | /*
* Copyright (c) 2005-2009, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/
package org.wso2.carbon.registry.admin.api.resource;
/**
* This provides functionality to be used by an implementation of a custom user interface that is
* used in place of the standard user interface for a resource on the Management Console.
*/
@SuppressWarnings("unused")
public interface ICustomUIService extends ITextResourceManagementService {
/**
* Checks whether the currently logged in user is authorized to perform the given action on the
* given path.
*
* @param path path of the resource or collection
* @param action action to check the authorization
*
* @return true if authorized, false if not authorized
*/
boolean isAuthorized(String path, String action);
}
| [
"eranda@wso2.com"
] | eranda@wso2.com |
02c4b02387cee166e9f563809d0db806ca222d34 | a1256217535e3dfa0b167d5ecb22ea9154f10654 | /src/design/pattern/visitor/Employee.java | c9ceb0c69b3e2be6861114ab49c0535dba495976 | [] | no_license | GradyX/demo | dfc21b3ab1f79675fc76b6b85b64316eb4c6ef49 | 1a943959e7630826ef727c02178df209feb4c1ac | refs/heads/master | 2020-04-11T02:52:09.160683 | 2019-04-22T08:47:16 | 2019-04-22T08:47:16 | 156,525,995 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 569 | java | package design.pattern.visitor;
public abstract class Employee {
public abstract void accept(Department handle);
}
class FulltimeEmployee extends Employee {
public void accept(Department handle) {
// TODO Auto-generated method stub
System.out.println("full time employee");
handle.visit(this);
}
}
class ParttimeEmployee extends Employee {
public void accept(Department handle) {
// TODO Auto-generated method stub
System.out.println("part time employee");
handle.visit(this);
}
} | [
"GTinker@163.com"
] | GTinker@163.com |
5171292a041eb93de7beb2481c1d2cbfebb218ca | 677f7dbceb78f9b256ffb2577042754450513efc | /code-blocks-designpattern/src/main/java/org/code/blocks/designpattern/j2ee/frontcontroller/FrontController.java | 463383b3c8d1448e159011bd46886eb6330157eb | [] | no_license | darwindu/code-blocks | d36e2b0461e51f578b8d3c03b6f24812f0b9c324 | 6a7ee29763f8ee4d9a2d250b2f23d81876c08904 | refs/heads/master | 2022-11-15T11:09:51.622257 | 2022-11-09T06:16:34 | 2022-11-09T06:16:34 | 184,182,317 | 3 | 3 | null | null | null | null | UTF-8 | Java | false | false | 773 | java | package org.code.blocks.designpattern.j2ee.frontcontroller;
/**
* @author darwindu
* @date 2019/12/11
**/
public class FrontController {
private Dispatcher dispatcher;
public FrontController(){
dispatcher = new Dispatcher();
}
private boolean isAuthenticUser(){
System.out.println("User is authenticated successfully.");
return true;
}
private void trackRequest(String request){
System.out.println("Page requested: " + request);
}
public void dispatchRequest(String request){
//记录每一个请求
trackRequest(request);
//对用户进行身份验证
if(isAuthenticUser()){
dispatcher.dispatch(request);
}
}
}
| [
"252921602@qq.com"
] | 252921602@qq.com |
8c605216fa9de6cd6f4cf417231a174f73124c91 | 12b0cf9f35e9b426c009089311efc2a88f12eebb | /src/main/java/com/vot/ahgz/config/mybatisConfig.java | b8b5159cbe9fdc1059dd8a918e6cb50fb933b2e0 | [] | no_license | renliyun/ahgz | 8febc9d7b1eb8c13a59047e00093cc0d2ba4138f | 0f6e38f073862aa6d2f3d8b28c986ae18df77b7f | refs/heads/master | 2023-04-16T21:48:08.372742 | 2021-02-26T09:20:36 | 2021-02-26T09:20:36 | 319,641,664 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 238 | java | package com.vot.ahgz.config;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Configuration;
@Configuration
@MapperScan(basePackages = "com.vot.ahgz.mapper")
public class mybatisConfig {
}
| [
"renliyun@live.cn"
] | renliyun@live.cn |
0f374caa46e858c14beb71b46bc66dc32c53067f | 03643772e2186b06a4742ea765a7568d9efce01b | /src/main/java/exceptions/UselessException.java | 42f3c0b7208bff3261d1400f19aec6f40a8e6097 | [] | no_license | redwarewolf/uselessui | 5717ae30397421980a12cf9ba0215fbf0df28894 | 5b3dad666a10924863abeb9407c8c364faa1f1fe | refs/heads/master | 2020-04-30T12:28:39.315280 | 2019-03-20T22:36:47 | 2019-03-20T22:36:47 | 176,827,467 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 233 | java | package main.java.exceptions;
public class UselessException extends RuntimeException {
private static final long serialVersionUID=-6970046309270823472L;
public UselessException(String message) {
super(message);
}
}
| [
"pedro.jara@wolox.com.ar"
] | pedro.jara@wolox.com.ar |
6a65edd714261fe7176aac0b92b09c1c98dcdf11 | 7245264294a62f36fecff4a48b0234f08c655a54 | /app/src/main/java/com/project/reader/ui/widget/utils/ViewUtils.java | 6cb75f0ee07e75e1ab048f796dbf3bdae5c9958e | [] | no_license | Tghoul-b/SimpleReader | a9a84ba32d3bf7ae69f5cab2e66f2d3958d0697c | c391673b4108e5baac25d3a5239807c184dc3b17 | refs/heads/master | 2023-08-13T05:48:27.773551 | 2021-10-11T03:27:14 | 2021-10-11T03:27:14 | 353,972,364 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 724 | java | package com.project.reader.ui.widget.utils;
import android.view.View;
/**
* Created by anlia on 2017/12/12.
*/
public class ViewUtils {
/**
* 测量、设置View默认宽高
* @param defaultSize
* @param measureSpec
* @return
*/
public static int measureSize(int defaultSize,int measureSpec) {
int result = defaultSize;
int specMode = View.MeasureSpec.getMode(measureSpec);
int specSize = View.MeasureSpec.getSize(measureSpec);
if (specMode == View.MeasureSpec.EXACTLY) {
result = specSize;
} else if (specMode == View.MeasureSpec.AT_MOST) {
result = Math.min(result, specSize);
}
return result;
}
}
| [
"917602350@qq.com"
] | 917602350@qq.com |
6eeac1b3c3060004c14a2c43567999415fac5e7d | e3f23416903d0d72d23c4e76e6e6a6dd8498fafd | /app/src/main/java/sy/bishe/ygou/delegate/friends/contanct/ContanctDelegate.java | 747d17edbf6e96896ccf6b5db7aafd55861b2403 | [] | no_license | lbc111/ygou-client | 90b78f08fcf046597cfcd367f072f1adcc17607e | df8c4957d8b7b4229f06bfa9e9476b663542f995 | refs/heads/master | 2023-03-22T08:48:47.184222 | 2020-06-16T11:53:48 | 2020-06-16T11:53:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,685 | java | package sy.bishe.ygou.delegate.friends.contanct;
import android.annotation.SuppressLint;
import android.graphics.Color;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.AppCompatImageView;
import androidx.appcompat.widget.AppCompatTextView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.bumptech.glide.Glide;
import com.choices.divider.Divider;
import com.choices.divider.DividerItemDecoration;
import java.util.ArrayList;
import butterknife.BindView;
import butterknife.OnClick;
import sy.bishe.ygou.R;
import sy.bishe.ygou.R2;
import sy.bishe.ygou.delegate.base.YGouDelegate;
import sy.bishe.ygou.net.callback.ISuccess;
import sy.bishe.ygou.net.rest.RestClient;
import sy.bishe.ygou.ui.recycler.MultipleitemEntity;
import sy.bishe.ygou.ui.refresh.RefreshHandler;
import sy.bishe.ygou.utils.storage.YGouPreferences;
public class ContanctDelegate extends YGouDelegate {
@BindView(R2.id.fm_contact_rv)
RecyclerView sRecyclerView = null;
@BindView(R2.id.fm_contact_refresh)
SwipeRefreshLayout sSwipeRefreshLayout = null;
@BindView(R2.id.title_bar_title)
AppCompatTextView tv_title = null;
@BindView(R2.id.title_bar_img)
AppCompatImageView img = null;
/**
* 返回
*/
@OnClick(R2.id.title_bar_back)
void back(){
getFragmentManager().popBackStack();
}
@BindView(R2.id.title_options_img)
AppCompatImageView img_option = null;
ContactAdapter adapter = null;
private RefreshHandler Srefreshhandler = null;
@SuppressLint("ResourceAsColor")
private void initrefreshlayout(){
sSwipeRefreshLayout.setColorSchemeColors(
Color.BLUE,
Color.RED,
Color.BLACK);
sSwipeRefreshLayout.setProgressViewOffset(true,120,300);
}
@OnClick(R2.id.fm_contact_msg)
void onClickNewfriend(){
getSupportDelegate().start(new AddFriendDelegate());
}
@Override
public Object setLayout() {
return R.layout.delegate_friend_contact;
}
@Override
public void OnBindView(@Nullable Bundle bundle, View rootView) {
tv_title.setText("好友列表");
tv_title.setTextSize(18);
img_option.setVisibility(View.GONE);
img.setVisibility(View.VISIBLE);
String userImg = YGouPreferences.getCustomAppProfile("userImg");
Glide.with(getContext())
.load(userImg)
.into(img);
Srefreshhandler = RefreshHandler.create(sSwipeRefreshLayout,sRecyclerView,new ContactConvert(),getContext());
LinearLayoutManager manager = new LinearLayoutManager(getContext());
sRecyclerView.setLayoutManager(manager);
//分割线
final DividerItemDecoration itemDecoration = new DividerItemDecoration();
itemDecoration.setDividerLookup(new DividerItemDecoration.DividerLookup() {
@Override
public Divider getVerticalDivider(int position) {
return null;
}
@Override
public Divider getHorizontalDivider(int position) {
return new Divider.Builder()
.size(2)
.margin(20,20)
.color(Color.GRAY)
.build();
}
});
sRecyclerView.addItemDecoration(itemDecoration);
final YGouDelegate yGouDelegate = this;
sRecyclerView.addOnItemTouchListener(ContactItemClickListener.create(yGouDelegate));
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public void onLazyInitView(@Nullable Bundle savedInstanceState) {
super.onLazyInitView(savedInstanceState);
RestClient.builder()
.setUrl("friend/query/"+ YGouPreferences.getCustomAppProfile("userId"))
.loader(getContext())
.onSuccess(new ISuccess() {
@Override
public void onSuccess(String response) {
Log.i("response", "onSuccess: "+response);
final ArrayList<MultipleitemEntity> list = new ContactConvert().setsJsonData(response).convert();
adapter = new ContactAdapter(list);
sRecyclerView.setAdapter(adapter);
}
})
.build()
.get();
}
}
| [
"shenyi_97@163.com"
] | shenyi_97@163.com |
3feb2c25eeb7af409bb3a76d94e1372fe821ab4a | bfdc22f1e2cecf0198107ae9e36dad14ef3d2f74 | /com.tsekas.metamodel.tests/src/language/foundation/relationship/tests/RelationshipExample.java | 46370fdb695d3e1efe225865d2bf630471e6a3ca | [] | no_license | zoetsekas/xenia | e12dac6a5e3866643f7b6a1262f6569f71823516 | 4e34999fb8e35f3dbf142fd817e9631133ad5ee2 | refs/heads/master | 2021-01-01T04:29:20.366377 | 2018-06-05T12:05:01 | 2018-06-05T12:05:01 | 57,205,185 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,297 | java | /**
*/
package language.foundation.relationship.tests;
import java.io.File;
import language.foundation.relationship.RelationshipPackage;
import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.util.Diagnostician;
import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
/**
* <!-- begin-user-doc -->
* A sample utility for the '<em><b>relationship</b></em>' package.
* <!-- end-user-doc -->
* @generated
*/
public class RelationshipExample {
/**
* <!-- begin-user-doc -->
* Load all the argument file paths or URIs as instances of the model.
* <!-- end-user-doc -->
* @param args the file paths or URIs.
* @generated
*/
public static void main(String[] args) {
// Create a resource set to hold the resources.
//
ResourceSet resourceSet = new ResourceSetImpl();
// Register the appropriate resource factory to handle all file extensions.
//
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put
(Resource.Factory.Registry.DEFAULT_EXTENSION,
new XMIResourceFactoryImpl());
// Register the package to ensure it is available during loading.
//
resourceSet.getPackageRegistry().put
(RelationshipPackage.eNS_URI,
RelationshipPackage.eINSTANCE);
// If there are no arguments, emit an appropriate usage message.
//
if (args.length == 0) {
System.out.println("Enter a list of file paths or URIs");
}
else {
// Iterate over all the arguments.
//
for (int i = 0; i < args.length; ++i) {
// Construct the URI for the instance file.
// The argument is treated as a file path only if it denotes an existing file.
// Otherwise, it's directly treated as a URL.
//
File file = new File(args[i]);
URI uri = file.isFile() ? URI.createFileURI(file.getAbsolutePath()): URI.createURI(args[i]);
try {
// Demand load resource for this file.
//
Resource resource = resourceSet.getResource(uri, true);
System.out.println("Loaded " + uri);
// Validate the contents of the loaded resource.
//
for (EObject eObject : resource.getContents()) {
Diagnostic diagnostic = Diagnostician.INSTANCE.validate(eObject);
if (diagnostic.getSeverity() != Diagnostic.OK) {
printDiagnostic(diagnostic, "");
}
}
}
catch (RuntimeException exception) {
System.out.println("Problem loading " + uri);
exception.printStackTrace();
}
}
}
}
/**
* <!-- begin-user-doc -->
* Prints diagnostics with indentation.
* <!-- end-user-doc -->
* @param diagnostic the diagnostic to print.
* @param indent the indentation for printing.
* @generated
*/
protected static void printDiagnostic(Diagnostic diagnostic, String indent) {
System.out.print(indent);
System.out.println(diagnostic.getMessage());
for (Diagnostic child : diagnostic.getChildren()) {
printDiagnostic(child, indent + " ");
}
}
} //RelationshipExample
| [
"Zoe@192.168.1.72"
] | Zoe@192.168.1.72 |
4d09618b93a0468f851b8c2045967ab657186c33 | cf246306708d4293dfd0a68bb66ebd4ecbacd814 | /src/com/company/Main.java | 9f95cc5dbf9668ad6a25e8274d93ecbc74e94d7a | [] | no_license | armashkaise/Example | 20502aeda50bd7a3976f7879267b77bec2b7c8a0 | 668aef8cd6f606ffd4228dd6e72694b32a1f525a | refs/heads/master | 2020-09-14T06:53:50.808764 | 2019-11-21T00:55:06 | 2019-11-21T00:55:06 | 223,056,521 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 425 | java | package com.company;
public class Main {
static int i=5;
int j;
static{
System.out.println("static inicializer");
}
{
System.out.println("inicializer");
}
Main(){
i++;
System.out.println("constructor");
}
static void method(){
System.out.println("static method");
}
public static void main(String[] args) {
Main.method();
// System.out.println(Main.i);
System.out.println(new Main());
}
}
| [
"forts912@gmail.com"
] | forts912@gmail.com |
e5b99a1548ae92baad6a1850c08b471e9218c15e | 43c8072646f4b67baa117d40c92461e3d7c009a7 | /src/main/java/com/testamq/config/JmsConfiguration.java | dad8cbfd1a04c714daecf5ddd07ac52d77a972f3 | [] | no_license | wifior/amqdemo | 6f5f6cef8aa1dad599bba94419695d11e61375d2 | 423ae892fee3dd7e1a2f511c8f00c83dad074784 | refs/heads/master | 2021-07-07T22:35:33.359339 | 2019-07-13T07:26:00 | 2019-07-13T07:26:00 | 196,691,901 | 0 | 0 | null | 2020-10-13T14:33:22 | 2019-07-13T07:24:44 | Java | UTF-8 | Java | false | false | 2,371 | java | package com.testamq.config;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jms.annotation.EnableJms;
import org.springframework.jms.config.DefaultJmsListenerContainerFactory;
import org.springframework.jms.core.JmsMessagingTemplate;
import javax.jms.ConnectionFactory;
@Configuration
@EnableJms
public class JmsConfiguration {
private Logger logger = LoggerFactory.getLogger(JmsConfiguration.class);
@Bean(name = "firstConnectionFactory")
public ActiveMQConnectionFactory getFirstCOnnectionFactory(@Value("${activemq.url}")String brokerUrl,@Value("${activemq.username}")String userName,@Value("${activemq.password}")String password){
logger.debug(brokerUrl+" - "+userName);
ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory();
connectionFactory.setBrokerURL(brokerUrl);
connectionFactory.setUserName(userName);
connectionFactory.setPassword(password);
return connectionFactory;
}
@Bean(name = "firstJmsTemplate")
public JmsMessagingTemplate getFirstJmsTemplate(@Qualifier("firstConnectionFactory")ConnectionFactory connectionFactory){
JmsMessagingTemplate template = new JmsMessagingTemplate(connectionFactory);
return template;
}
@Bean(name = "firstTopicListener")
public DefaultJmsListenerContainerFactory getFirstTopicListener(@Qualifier("firstConnectionFactory")ConnectionFactory connectionFactory){
DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
factory.setConnectionFactory(connectionFactory);
factory.setPubSubDomain(true);//if topic ,set true
return factory;
}
@Bean(name = "firstQueueListener")
public DefaultJmsListenerContainerFactory getFirstQueueListener(@Qualifier("firstConnectionFactory")ConnectionFactory connectionFactory){
DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
factory.setConnectionFactory(connectionFactory);
return factory;
}
}
| [
"45944979@qq.com"
] | 45944979@qq.com |
3d8a7d526ee487c2566f689692aee77dedaee271 | 719ce6eb26de83a335025a764e6219705deea13d | /MRU/src/main/java/x3/player/mru/surfif/messages/SurfMsgToolInf.java | 78d93d45a5e1e70bdfeb1a769caf240fd99552d5 | [] | no_license | tonylim01/MSF-MF | 2afce43ed4f13ccbed905dce895ebbd488709c3b | ee7b59a3888c1143ad57668550d2cff28a5cd685 | refs/heads/master | 2020-04-07T12:10:00.833983 | 2018-07-17T01:52:53 | 2018-07-17T01:52:53 | 158,356,440 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 778 | java | package x3.player.mru.surfif.messages;
import com.google.gson.annotations.SerializedName;
public class SurfMsgToolInf {
public static final String MSG_NAME = "tool_inf";
@SerializedName("inf_type")
private String infType;
@SerializedName("tool_id")
private int toolId;
@SerializedName("app_info")
private String appInfo;
@SerializedName("tool_type")
private String toolType;
private SurfMsgToolInfData data;
public String getInfType() {
return infType;
}
public int getToolId() {
return toolId;
}
public String getAppInfo() {
return appInfo;
}
public String getToolType() {
return toolType;
}
public SurfMsgToolInfData getData() {
return data;
}
}
| [
"Lua@Seungwooui-MacBook.local"
] | Lua@Seungwooui-MacBook.local |
7a14bbc41aa475035d7ba3f81c85e8f63ca34134 | 156d0ebf112982d5dfd3f42d9a0f33a6ef19fa41 | /DesgnPatterns/observer-pattern-app/src/com/techlabs/observer/frames/test/TestWelcomeFrame.java | 2c7f439edf669acec91863c130ab82b86c991c2c | [] | no_license | pratikchaurasia/Swabhav-techlabs | a822f2e1360c2477dcf22af66c93364c125a30e5 | a9772837af88741cbc101f7295c8c40e42823f77 | refs/heads/master | 2018-10-22T17:04:19.077601 | 2018-07-22T15:47:58 | 2018-07-22T15:47:58 | 119,146,314 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 220 | java | package com.techlabs.observer.frames.test;
import com.techlabs.observer.frames.WelcomeFrame;
public class TestWelcomeFrame {
public static void main(String args[]){
WelcomeFrame welcome = new WelcomeFrame();
}
}
| [
"pratikchaurasia@outlook.com"
] | pratikchaurasia@outlook.com |
60d6efba815acbedf037c037c9313a987cc93132 | cd634c1aa04653b3a6ce9712b90aeb1aefe7f5b2 | /src/com/imooc/drdc/action/StudentAction.java | e6d617ae12871d44f172f6879f292408e6249a79 | [] | no_license | wujunyucg/WebExcel | a3e1e791b9d9120557079ee4a182693d9f9595e7 | b6bc8f6dba15c2224ef92591528fd02941813c75 | refs/heads/master | 2020-05-25T20:27:45.755604 | 2017-03-02T14:21:02 | 2017-03-02T14:21:02 | 83,686,140 | 1 | 0 | null | null | null | null | GB18030 | Java | false | false | 3,993 | java | package com.imooc.drdc.action;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Method;
import java.util.List;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import net.sf.json.JSONArray;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.struts2.ServletActionContext;
import com.imooc.drdc.model.Student;
import com.imooc.drdc.service.StudentService;
import com.imooc.drdc.utils.ExportUtils;
import com.opensymphony.xwork2.ActionSupport;
/**
* 学生管理
* @author David
*
*/
public class StudentAction extends ActionSupport {
private static final long serialVersionUID = 1L;
private StudentService studentService = new StudentService();
private int page;
private int rows;
private String sort;
private String order;
private String className;
private String methodName;
private String fields;
private String titles;
public String getClassName() {
return className;
}
public void setClassName(String className) {
this.className = className;
}
public String getFields() {
return fields;
}
public void setFields(String fields) {
this.fields = fields;
}
public String getTitles() {
return titles;
}
public void setTitles(String titles) {
this.titles = titles;
}
public StudentService getStudentService() {
return studentService;
}
public void setStudentService(StudentService studentService) {
this.studentService = studentService;
}
public String getMethodName() {
return methodName;
}
public void setMethodName(String methodName) {
this.methodName = methodName;
}
public String getSort() {
return sort;
}
public void setSort(String sort) {
this.sort = sort;
}
public String getOrder() {
return order;
}
public void setOrder(String order) {
this.order = order;
}
public int getPage() {
return page;
}
public void setPage(int page) {
this.page = page;
}
public int getRows() {
return rows;
}
public void setRows(int rows) {
this.rows = rows;
}
//数据列表
public void list(){
HttpServletResponse response = ServletActionContext.getResponse();
response.setContentType("text/html;charset=utf-8");
List<Student>slist = getStudents();
int total = studentService.getTotal();
String json = "{\"total\":"+total+" , " +
"\"rows\":"+JSONArray.fromObject(slist).toString()+ "," +
"\"className\":\"" + StudentAction.class.getName() + "\"" +
"}";
try {
response.getWriter().write(json);
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* 获取学生信息
* @author David
* @return
*/
public List<Student> getStudents(){
List<Student>slist = studentService.list(page,rows,sort,order);
return slist;
}
/**
* 导出前台列表为excel文件
* @author David
*/
public void export(){
HttpServletResponse response = ServletActionContext.getResponse();
response.setContentType("application/octet-stream");
response.setHeader("Content-Disposition", "attachment;filename=export.xls");
//创建Excel
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet("sheet0");
try {
//获取类
Class clazz = Class.forName(className);
Object o = clazz.newInstance();
Method m = clazz.getDeclaredMethod(methodName);
List list = (List)m.invoke(o);
titles = new String(titles.getBytes("ISO-8859-1"),"UTF-8");
ExportUtils.outputHeaders(titles.split(","), sheet);
ExportUtils.outputColumns(fields.split(","), list, sheet, 1);
//获取输出流,写入excel 并关闭
ServletOutputStream out = response.getOutputStream();
wb.write(out);
out.flush();
out.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
| [
"1318543125@qq.com"
] | 1318543125@qq.com |
ac955b7e90735818f7e6b6cb613f96710b59515a | fdc5c96351aaaadfca1aade7cb3fe04c3829333c | /app/src/main/java/com/dat/barnaulzoopark/ui/animals/animalsfragment/AnimalsFragment.java | a1a16a97a62022ee328bc3b677e5e2d2cf4af810 | [] | no_license | jintoga/Barnaul-Zoopark | b5689058ab365961e63059d3f7f687d728ad2802 | a2280cc4e601afae92e391f68b5365a123423d2f | refs/heads/master | 2021-04-18T23:45:51.146694 | 2017-06-07T17:31:41 | 2017-06-07T17:31:41 | 50,792,159 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,607 | java | package com.dat.barnaulzoopark.ui.animals.animalsfragment;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import butterknife.Bind;
import butterknife.ButterKnife;
import com.dat.barnaulzoopark.BZApplication;
import com.dat.barnaulzoopark.R;
import com.dat.barnaulzoopark.model.animal.Category;
import com.dat.barnaulzoopark.ui.BaseMvpFragment;
import com.dat.barnaulzoopark.ui.MainActivity;
import com.dat.barnaulzoopark.ui.animals.adapters.AnimalsViewPagerAdapter;
import com.dat.barnaulzoopark.widget.SearchView.FloatingSearchView;
import com.google.firebase.database.FirebaseDatabase;
import java.util.List;
/**
* Created by Nguyen on 6/17/2016.
*/
public class AnimalsFragment
extends BaseMvpFragment<AnimalsContract.View, AnimalsContract.UserActionListener>
implements AnimalsContract.View, FloatingSearchView.SearchViewFocusedListener,
FloatingSearchView.SearchViewDrawerListener, MainActivity.DrawerListener {
@Bind(R.id.appBarLayout)
protected AppBarLayout appBarLayout;
@Bind(R.id.tabLayout)
protected TabLayout tabLayout;
@Bind(R.id.search_view)
protected FloatingSearchView searchView;
@Bind(R.id.transparent_view)
protected View backgroundView;
@Bind(R.id.viewpagerAnimals)
protected ViewPager animalsViewPager;
private AnimalsViewPagerAdapter animalsViewPagerAdapter;
@Override
public void bindCategories(@NonNull List<Category> categories) {
initAnimalsViewPager(categories);
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_animals, container, false);
ButterKnife.bind(this, view);
init();
return view;
}
@Override
public void onViewStateRestored(@Nullable Bundle savedInstanceState) {
super.onViewStateRestored(savedInstanceState);
boolean isSearchViewFocused = searchView.isSearchViewFocused();
if (!isSearchViewFocused) {
searchView.post(() -> searchView.clearSearchView());
}
}
@Override
public void onDrawerOpen() {
Log.d("onDrawerOpen", "onDrawerOpen");
searchView.clearSearchView();
}
@Override
public void onNavigationDrawerOpen() {
if (getActivity() instanceof MainActivity) {
((MainActivity) getActivity()).openDrawer();
}
}
@Override
public void onNavigationDrawerClosed() {
if (getActivity() instanceof MainActivity) {
((MainActivity) getActivity()).closeDrawer();
}
}
private void init() {
CoordinatorLayout.LayoutParams layoutParams =
(CoordinatorLayout.LayoutParams) backgroundView.getLayoutParams();
layoutParams.topMargin = getStatusBarHeight();
backgroundView.setLayoutParams(layoutParams);
searchView.setBackgroundView(backgroundView);
searchView.setSearchViewFocusedListener(this);
searchView.setSearchViewDrawerListener(this);
//Listener to help close SearchView when NavDrawer is open
((MainActivity) getActivity()).setDrawerListener(this);
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
presenter.loadCategories();
}
@NonNull
@Override
public AnimalsContract.UserActionListener createPresenter() {
FirebaseDatabase database =
BZApplication.get(getContext()).getApplicationComponent().fireBaseDatabase();
return new AnimalsPresenter(database);
}
private void initAnimalsViewPager(@NonNull List<Category> categories) {
animalsViewPagerAdapter =
new AnimalsViewPagerAdapter(getChildFragmentManager(), getContext(), categories);
animalsViewPager.setAdapter(animalsViewPagerAdapter);
tabLayout.setupWithViewPager(animalsViewPager);
for (int i = 0; i < tabLayout.getTabCount(); i++) {
if (animalsViewPagerAdapter != null
&& tabLayout.getTabAt(i) != null
&& tabLayout != null) {
TabLayout.Tab tab = tabLayout.getTabAt(i);
View view = animalsViewPagerAdapter.getTabView(i);
if (tab != null) {
tab.setCustomView(view);
}
}
}
tabLayout.addOnTabSelectedListener(
new TabLayout.ViewPagerOnTabSelectedListener(animalsViewPager) {
@Override
public void onTabSelected(TabLayout.Tab tab) {
super.onTabSelected(tab);
animalsViewPager.setCurrentItem(tab.getPosition());
View view = tab.getCustomView();
animalsViewPagerAdapter.highlightSelectedView(view, true);
/*AnimalsViewPageFragment fragment =
(AnimalsViewPageFragment) animalsViewPagerAdapter.getCurrentFragment();
if (fragment != null) {
fragment.moveToFirst();
}
appBarLayout.setExpanded(true);*/
}
@Override
public void onTabUnselected(TabLayout.Tab tab) {
View view = tab.getCustomView();
animalsViewPagerAdapter.highlightSelectedView(view, false);
}
@Override
public void onTabReselected(TabLayout.Tab tab) {
}
});
animalsViewPager.setCurrentItem(0);
if (tabLayout.getTabAt(0) != null) {
TabLayout.Tab tab = tabLayout.getTabAt(0);
if (tab != null) {
View view = tab.getCustomView();
animalsViewPagerAdapter.highlightSelectedView(view, true);
}
}
}
@Override
public void onSearchViewEditTextFocus() {
Log.d("Focus", "Focus on searchView");
}
@Override
public void onSearchViewEditTextLostFocus() {
Log.d("Lost Focus", "Lost Focus on searchView");
searchView.clearSearchView();
}
}
| [
"jintoga123@yahoo.com"
] | jintoga123@yahoo.com |
6484677728a8b329b6091ee83ee496ec3733038b | b5153be915d94d1232a4fdebf1464b50809c361a | /src/main/java/com/amazonaws/services/ec2/model/transform/CreateDhcpOptionsRequestUnmarshaller.java | a9eb76552049cc3521ce860077dddb6de4da5c88 | [
"Apache-2.0"
] | permissive | KonishchevDmitry/aws-sdk-for-java | c68f0ee7751f624eeae24224056db73e0a00a093 | 6f8b2f9a3cd659946db523275ba1dd55b90c6238 | refs/heads/master | 2021-01-18T05:24:52.275578 | 2010-05-31T06:20:22 | 2010-05-31T06:20:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,492 | java | /*
* Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.amazonaws.services.ec2.model.transform;
import org.w3c.dom.*;
import com.amazonaws.services.ec2.model.*;
import com.amazonaws.transform.Unmarshaller;
import com.amazonaws.transform.SimpleTypeUnmarshallers.*;
import com.amazonaws.util.XpathUtils;
/**
* Create Dhcp Options Request Unmarshaller
*/
public class CreateDhcpOptionsRequestUnmarshaller implements Unmarshaller<CreateDhcpOptionsRequest, Node> {
public CreateDhcpOptionsRequest unmarshall(Node node) throws Exception {
if (node == null) return null;
CreateDhcpOptionsRequest createDhcpOptionsRequest = new CreateDhcpOptionsRequest();
Node dhcpConfigurationNode = XpathUtils.asNode("DhcpConfiguration", node);
createDhcpOptionsRequest.setDhcpConfiguration(new DhcpConfigurationUnmarshaller().unmarshall(dhcpConfigurationNode));
return createDhcpOptionsRequest;
}
}
| [
"aws-dr-tools@amazon.com"
] | aws-dr-tools@amazon.com |
8c9a77ca3d401aad040e4070287df6bf076aa1dd | 0a5e76f8d32fb9fa1361073b5880040e88c62555 | /src/main/java/com/juma/vms/manage/transport/controller/TransportController.java | 15995f223488d51e8e6b73c43318d78735a4ffac | [] | no_license | SunGitShine/vms-manage | 9ec6a23cc2ddff0736bad4ece89938b8d96c4585 | 13d9512cef8baa637e48316c115a0d5e373848d2 | refs/heads/master | 2022-07-22T00:25:57.724361 | 2019-08-22T09:52:29 | 2019-08-22T09:52:29 | 203,765,012 | 0 | 0 | null | 2022-06-29T17:35:42 | 2019-08-22T09:51:19 | Java | UTF-8 | Java | false | false | 4,042 | java | package com.juma.vms.manage.transport.controller;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.giants.common.tools.Page;
import com.juma.auth.employee.domain.LoginEmployee;
import com.juma.vms.common.query.QueryCond;
import com.juma.vms.driver.vo.DriverBo;
import com.juma.vms.manage.web.controller.BaseController;
import com.juma.vms.tool.domain.BaseEnumDomian;
import com.juma.vms.transport.request.AddExternalTransportReq;
import com.juma.vms.transport.request.AddVendorAndDriverReq;
import com.juma.vms.transport.request.TransportPageReq;
import com.juma.vms.transport.response.DriverBeCurrResp;
import com.juma.vms.transport.response.TransportDetailResp;
import com.juma.vms.transport.response.TransportPageResp;
import com.juma.vms.transport.service.TransportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
/**
* @description: ${description}
*
* @author: xieqiang
*
* @create: 2019-03-22 14:43
**/
@Api(value = "运力管理")
@Controller
@RequestMapping("transport")
public class TransportController extends BaseController{
@Resource
private TransportService transportService;
@ApiOperation(value = "分页列表")
@ResponseBody
@RequestMapping(value = "search", method = RequestMethod.POST)
public Page<TransportPageResp> search(@RequestBody QueryCond<TransportPageReq> capacityPoolQueryCond, @ApiParam(hidden = true) LoginEmployee loginEmployee) {
return transportService.findTransportByPage(capacityPoolQueryCond, loginEmployee);
}
@ApiOperation(value = "运力详情")
@ResponseBody
@RequestMapping(value = "detail", method = RequestMethod.GET)
public TransportDetailResp detail(@RequestParam Integer capacityPoolId, @ApiParam(hidden = true) LoginEmployee loginEmployee) {
return transportService.findTransportDetail(capacityPoolId, loginEmployee);
}
@ApiOperation(value = "添加外请运力")
@ResponseBody
@RequestMapping(value = "addTransport", method = RequestMethod.POST)
public void addTransport(@RequestBody AddExternalTransportReq addExternalTransportReq, @ApiParam(hidden = true) LoginEmployee loginEmployee) {
transportService.addExternalTransport(addExternalTransportReq, loginEmployee);
}
@ApiOperation(value = "添加承运商并绑定司机")
@ResponseBody
@RequestMapping(value = "addVendorBindDriver", method = RequestMethod.POST)
public Map<String, Integer> addVendorBindDriver(@RequestBody AddVendorAndDriverReq addVendorAndDriverReq, @ApiParam(hidden = true) LoginEmployee loginEmployee) {
return transportService.addVendorAndBindDriver(addVendorAndDriverReq, loginEmployee);
}
@ApiOperation(value = "查询下拉属性")
@ResponseBody
@RequestMapping(value = "findPropertyValues", method = RequestMethod.POST)
public Map<String, List<BaseEnumDomian>> findPropertyValues(@RequestBody List<String> keys, @ApiParam(hidden = true) LoginEmployee loginEmployee) {
return transportService.getPropertyValueByKeys(keys);
}
@ApiOperation(value = "添加司机")
@ResponseBody
@RequestMapping(value = "addDriver", method = RequestMethod.POST)
public Integer addDriver(@RequestBody DriverBo driverBo, @ApiParam(hidden = true) LoginEmployee loginEmployee) {
return transportService.addDriver(driverBo, loginEmployee);
}
@ApiOperation(value = "通过身份证号查司机")
@ResponseBody
@RequestMapping(value = "loadDriverByIdCardNo", method = RequestMethod.POST)
public DriverBeCurrResp loadDriverByIdCardNo(@RequestParam String idCordNo, @ApiParam(hidden = true) LoginEmployee loginEmployee) {
return transportService.loadDriverByIdCardNo(idCordNo, loginEmployee);
}
}
| [
"xieqiang02@jumapeisong.com"
] | xieqiang02@jumapeisong.com |
f6dcdf81d8338517948f2b59a4c720b6ba0a257f | 03655b44af133192a3fc728020205248b523efb2 | /Problems/Vowel or not/src/Main.java | 47085fa2bc3f518b2ce5268299af85db8f32be3a | [] | no_license | ivanovatata/Simple-Chatty-Bot | 5d3953ec0b40d391f078a52bac2b98caeefdde3d | 74b990956acd66a22f7f1aa50e9e0079209bed11 | refs/heads/master | 2022-11-10T02:02:23.949157 | 2020-06-19T19:11:43 | 2020-06-19T19:11:43 | 273,566,623 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 564 | java | import java.util.Scanner;
public class Main {
public static boolean isVowel(char ch) {
String vowels = "aeiouAEIOU";
for (int i = 0; i < vowels.length(); i++) {
if (ch == (char) vowels.charAt(i)) {
return true;
}
}
return false;
}
/* Do not change code below */
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
char letter = scanner.nextLine().charAt(0);
System.out.println(isVowel(letter) ? "YES" : "NO");
}
}
| [
"testmail@email.com"
] | testmail@email.com |
48d285fe3d70780cb77f6a5eabfebdd361ca964d | f3e53ba76eedb08056c550ea1eb01b5e021aa96f | /app/src/main/java/com/syl/androidauthoritativeguide/module/TrueFalse.java | 5c3ea467d7be5a20e38ac294569db868756615e6 | [] | no_license | Icarours/AndroidAuthoritativeGuide | 7ebdb0ba26dc1d7a1baca5152b0249d0b3362c61 | e3e03401258d14e41c7457bcfe3cd3f0664aade3 | refs/heads/master | 2021-05-16T13:57:29.491429 | 2018-01-18T00:04:09 | 2018-01-18T00:04:09 | 117,907,735 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 626 | java | package com.syl.androidauthoritativeguide.module;
/**
* Created by Bright on 2018/1/16.
*
* @Describe
* @Called
*/
public class TrueFalse {
private int mResId;
private boolean mDefaultVale;
public TrueFalse(int resId, boolean defaultVale) {
mResId = resId;
mDefaultVale = defaultVale;
}
public int getResId() {
return mResId;
}
public void setResId(int resId) {
mResId = resId;
}
public boolean isDefaultVale() {
return mDefaultVale;
}
public void setDefaultVale(boolean defaultVale) {
mDefaultVale = defaultVale;
}
}
| [
"j376787348@163.com"
] | j376787348@163.com |
81716b8682dd3d1e0325b6c834a4f20851d0bd16 | cb3f0944c24d16f72b6ac5ccf1a8d8f8c001b20e | /app/src/main/java/com/shhb/supermoon/pandamanager/model/PhoneInfo.java | 79acd657051a926bd7dc8e02ff9ee65f26c7350a | [] | no_license | istaru/PandaManager | aa7206d7200e752858172ce7d4b45dd89525a346 | 62710fab76ca8b386ccfcf247443c358aee772fa | refs/heads/master | 2020-04-07T06:59:03.671933 | 2018-03-07T09:19:12 | 2018-03-07T09:19:12 | 124,190,767 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,585 | java | package com.shhb.supermoon.pandamanager.model;
import android.app.Activity;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.telephony.TelephonyManager;
import com.alibaba.fastjson.JSONObject;
import com.shhb.supermoon.pandamanager.R;
import com.shhb.supermoon.pandamanager.tools.BaseTools;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.select.Elements;
import java.util.HashMap;
import java.util.Map;
/**
* Created by superMoon on 2017/3/15.
*/
public class PhoneInfo {
private static TelephonyManager telephonyManager;
private Context context;
Map<String,Object> map = new HashMap<String,Object>();
public PhoneInfo(Context context) {
this.context = context;
telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
}
public Map<String, Object> getPhoneMsg(){
// map.put("phone",getNativePhoneNumber());//手机号码
map.put("bdid", "");//电池ID
String appMsg = getAppMsg();
if (null != appMsg) {
String[] appMsgs = appMsg.split(",");
map.put("deviceVer", appMsgs[0] + "");//APP更新号
map.put("appVer", appMsgs[1] + "");//APP版本号
map.put("appBid", appMsgs[2] + "");//APP包名
map.put("imei", appMsgs[3] + "");//IMEI
} else {
map.put("deviceVer", "");//APP更新号
map.put("appVer", "");//APP版本号
map.put("appBid", "");//APP包名
}
map.put("appName", context.getResources().getString(R.string.app_name));//APP名
String wifi = getNetworkType();
if (null != wifi) {
String[] wifis = wifi.split(",");
map.put("wifiSid", wifis[0]);//wifi名
map.put("wifiBid", wifis[1] + "");//wifi编号
} else {
map.put("wifiSid", "");//wifi名
map.put("wifiBid", "");//wifi编号
}
map.put("simType", getProvidersName());//运营商的名称
map.put("onlineType", "");//是否登录
map.put("jaibreak", "");//手机是否越狱
map.put("deviceModel", "android");//手机是否越狱
map.put("deviceName", android.os.Build.MANUFACTURER);// 手机名称
map.put("deviceW", BaseTools.getWindowsWidth((Activity) context));//手机宽度像素
map.put("deviceH", BaseTools.getWindowsHeight((Activity) context));//手机高度像素
map.put("ip", getIpAddress());//IP地址
return map;
}
/**
*获取APP信息
* @return
*/
public String getAppMsg(){
try {
int versionCode = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionCode;//APP更新号
String versionName = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName;//APP版本号
String pkName = context.getPackageName();//APP包名
String IMEI = telephonyManager.getDeviceId();//IMEI
return versionCode + "," + versionName + "," + pkName + "," + IMEI;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* 获取IMEI
* @return
*/
public static String getIMEI(){
String IMEI = telephonyManager.getDeviceId();//IMEI
return IMEI;
}
/**
* 获取手机服务商信息
*/
public String getProvidersName() {
String providersName = "N/A";
String IMSI = "";
try{
IMSI = telephonyManager.getSubscriberId();//IMSI
// IMSI号前面3位460是国家,紧接着后面2位00 02是中国移动,01是中国联通,03是中国电信。
if(null != IMSI){
if (IMSI.startsWith("46000") || IMSI.startsWith("46002")) {
providersName = "中国移动";
} else if (IMSI.startsWith("46001")) {
providersName = "中国联通";
} else if (IMSI.startsWith("46003")) {
providersName = "中国电信";
}
return providersName;
}
}catch(Exception e){
e.printStackTrace();
}
return providersName;
}
/**
* 获取外网IP
*/
private String getIpAddress(){
String ip = "192.168.0.1";
try {
Document doc = Jsoup.connect("http://ip.taobao.com/service/getIpInfo2.php?ip=myip").get();
Elements elements = doc.select("body");
String result = elements.text();
ip = JSONObject.parseObject(result).getJSONObject("data").getString("ip");
}catch(Exception e) {
e.toString();
}
return ip;
}
/**
* 获取内网IP地址
*/
// public String getIpAddress(){
// String ipAddress = "";
// try {
// for (Enumeration en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) {
// NetworkInterface intf = (NetworkInterface) en.nextElement();
// for (Enumeration enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements();) {
// InetAddress inetAddress = (InetAddress) enumIpAddr.nextElement();
// if (!inetAddress.isLoopbackAddress() && !inetAddress.isLinkLocalAddress() && !TextUtils.equals(inetAddress.getHostAddress(),"10.0.2.15")) {
// ipAddress = inetAddress.getHostAddress();
// }
// }
// }
// } catch (Exception e) {
// e.printStackTrace();
// }
// return ipAddress;
// }
// /**
// * 通过CmyIP获取获取外网外网地址 需在异步线程中访问
// * @return 外网IP
// */
// public static String getOuterNetFormCmyIP() {
// String response = GetOuterNetIp("http://www.cmyip.com/");
// Pattern pattern = Pattern.compile("((?:(?:25[0-5]|2[0-4]\\d|((1\\d{2})|([1-9]?\\d)))\\.){3}(?:25[0-5]|2[0-4]\\d|((1\\d{2})|([1-9]?\\d))))");
// Matcher matcher = pattern.matcher(response.toString());
// if (matcher.find()) {
// String group = matcher.group();
// return group;
// }
// return "";
// }
//
// /**
// * 获取获取外网外网地址 需在异步线程中访问
// * @param ipaddr 提供外网服务的服务器ip地址
// * @return 外网IP
// */
// public static String GetOuterNetIp(String ipaddr) {
// URL infoUrl = null;
// InputStream inStream = null;
// try {
// infoUrl = new URL(ipaddr);
// URLConnection connection = infoUrl.openConnection();
// HttpURLConnection httpConnection = (HttpURLConnection) connection;
// int responseCode = httpConnection.getResponseCode();
// if (responseCode == HttpURLConnection.HTTP_OK) {
// inStream = httpConnection.getInputStream();
// BufferedReader reader = new BufferedReader(new InputStreamReader(inStream, "utf-8"));
// StringBuilder strber = new StringBuilder();
// String line = null;
// while ((line = reader.readLine()) != null)
// strber.append(line + "\n");
// inStream.close();
// return strber.toString();
// }
// } catch (MalformedURLException e) {
// e.printStackTrace();
// } catch (IOException e) {
// e.printStackTrace();
// }
// return "";
// }
/**
* 获取网络类型
* @return
*/
public String getNetworkType() {
String wifiSsId = "";
String wifiBssId = "";
try{
NetworkInfo networkInfo = ((ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE)).getActiveNetworkInfo();
if (networkInfo != null && networkInfo.isConnected()) {
if (networkInfo.getType() == ConnectivityManager.TYPE_WIFI) {
WifiInfo wifiInfo = ((WifiManager) context.getSystemService(context.WIFI_SERVICE)).getConnectionInfo();
wifiSsId = wifiInfo.getSSID();
if(wifiSsId.contains("\"")){
wifiSsId.replace("\"","");
}
wifiBssId = wifiInfo.getBSSID();
return wifiSsId + "," + wifiBssId;
}
}
} catch (Exception e){
e.printStackTrace();
}
return null;
}
public String getPhoneInfo(){
TelephonyManager telephonyManager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
String phoneName = android.os.Build.MANUFACTURER;// 手机名称
String phoneType = android.os.Build.MODEL; // 手机型号
String systemVersion = android.os.Build.VERSION.RELEASE;//系统版本
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("\nDeviceId(IMEI) = " + telephonyManager.getDeviceId());
stringBuilder.append("\nDeviceSoftwareVersion = " + telephonyManager.getDeviceSoftwareVersion());
stringBuilder.append("\nLine1Number = " + telephonyManager.getLine1Number());
stringBuilder.append("\nNetworkCountryIso = " + telephonyManager.getNetworkCountryIso());
stringBuilder.append("\nNetworkOperator = " + telephonyManager.getNetworkOperator());
stringBuilder.append("\nNetworkOperatorName = " + telephonyManager.getNetworkOperatorName());
stringBuilder.append("\nNetworkType = " + telephonyManager.getNetworkType());
stringBuilder.append("\nPhoneType = " + telephonyManager.getPhoneType());
stringBuilder.append("\nSimCountryIso = " + telephonyManager.getSimCountryIso());
stringBuilder.append("\nSimOperator = " + telephonyManager.getSimOperator());
stringBuilder.append("\nSimOperatorName = " + telephonyManager.getSimOperatorName());
stringBuilder.append("\nSimSerialNumber = " + telephonyManager.getSimSerialNumber());
stringBuilder.append("\nSimState = " + telephonyManager.getSimState());
stringBuilder.append("\nSubscriberId(IMSI) = " + telephonyManager.getSubscriberId());
stringBuilder.append("\nVoiceMailNumber = " + telephonyManager.getVoiceMailNumber());
return stringBuilder.toString();
}
}
| [
"979903291@qq.com"
] | 979903291@qq.com |
b78ab4dea19914f2f8664130b5d7157f053d3ee9 | 7f41c1ded184a2653a23d4a061e3e492dccfe27e | /src/main/java/UserInputNumbers.java | 52d98fd0e92342ccb2c4b79e50b94bdd71a4c2a8 | [] | no_license | chrisrappa/java_unity_section5exercises | 050a0b374b9b3a04d9e1bcbe5f6bd5c50df05fd4 | b1f9212917197a7d8cde2da3df78a9e87945f137 | refs/heads/main | 2023-06-08T07:30:00.670962 | 2021-06-28T21:42:20 | 2021-06-28T21:42:20 | 379,637,434 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 618 | java | import java.util.Scanner;
public class UserInputNumbers {
public static int SumInputNumbers() {
int sum = 0;
int counter = 0;
int numInputs = 10;
Scanner scanner = new Scanner(System.in);
while(numInputs > 0){
counter += 1;
System.out.println(MessagePrompt(counter));
int inputNumber = scanner.nextInt();
sum += inputNumber;
scanner.nextLine();
numInputs -= 1;
}
System.out.println(sum);
return(sum);
}
public static String MessagePrompt(int counter){
String message = "Please type integer #" + counter;
return(message);
}
}
| [
"christianrappa@rappac-a01.vmware.com"
] | christianrappa@rappac-a01.vmware.com |
6d1c672eac0e81181cedce0dec0e712874765175 | a136b56fee37bd19a054d0056118a4eaf9411e04 | /app/src/main/java/org/ualr/mobileapps/sneakercalendar/ui/signup/SignupFormState.java | 3d56576dfa15833c3816b42ade895a71c843d25c | [
"MIT"
] | permissive | Matthewaj/MobileAppsFinal | 9c6c1d5830bd16c9c7f25c75492cb1e8045c9cce | b458f160b24d99e0b1eee8c61fb0ece861edd07c | refs/heads/main | 2023-02-07T09:54:25.725000 | 2020-12-15T13:58:15 | 2020-12-15T13:58:15 | 318,353,209 | 0 | 0 | MIT | 2020-12-04T00:04:22 | 2020-12-04T00:04:21 | null | UTF-8 | Java | false | false | 884 | java | package org.ualr.mobileapps.sneakercalendar.ui.signup;
import androidx.annotation.Nullable;
public class SignupFormState {
@Nullable
private final Integer usernameError;
@Nullable
private final Integer passwordError;
private final boolean isDataValid;
SignupFormState(@Nullable Integer usernameError, @Nullable Integer passwordError) {
this.usernameError = usernameError;
this.passwordError = passwordError;
this.isDataValid = false;
}
SignupFormState(boolean isDataValid) {
this.usernameError = null;
this.passwordError = null;
this.isDataValid = isDataValid;
}
@Nullable
Integer getUsernameError() {
return usernameError;
}
@Nullable
Integer getPasswordError() {
return passwordError;
}
boolean isDataValid() {
return isDataValid;
}
}
| [
"denver@dsl-leapbox"
] | denver@dsl-leapbox |
480553e426b0b74d431b1316eaf1950fab29b03c | 5f600b70069114f80e0275980c1aac72686467b5 | /webappproject/src/com/example/myNewProject/client/Webappproject.java | 41bf823211fbb16d2063db8da42c4d39c193de0e | [] | no_license | bennimo/newwebapp | c8e6714e123d61ecdb1e8e3ee37830b3900bc7dd | 22b8c9956b2302800f91c9f9c06d87333c988c4a | refs/heads/master | 2021-01-20T20:07:52.647640 | 2016-06-30T11:32:42 | 2016-06-30T11:32:42 | 62,245,633 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,792 | java | package com.example.myNewProject.client;
import com.example.myNewProject.shared.FieldVerifier;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.event.dom.client.KeyUpEvent;
import com.google.gwt.event.dom.client.KeyUpHandler;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class Webappproject implements EntryPoint {
/**
* The message displayed to the user when the server cannot be reached or
* returns an error.
*/
private static final String SERVER_ERROR = "An error occurred while "
+ "attempting to contact the server. Please check your network " + "connection and try again.";
/**
* Create a remote service proxy to talk to the server-side Greeting service.
*/
private final GreetingServiceAsync greetingService = GWT.create(GreetingService.class);
/**
* This is the entry point method.
*/
public void onModuleLoad() {
MainView mainView = new MainView();
RootPanel.get().add(mainView);
}
}
| [
"bennjanii@yahoo.com"
] | bennjanii@yahoo.com |
92546eaf62707223416b657c4471e7f59050dd86 | 4298ee51eac5fe0d05497a9b046a0089aeceffa7 | /app/src/main/java/nik/com/insta/Utils/UserListAdapter.java | 6b9b08998abd0caccc994561638a2bfc9d23f1d4 | [] | no_license | cmFodWx5YWRhdjEyMTA5/Instagram-Clone | 1b5a473c66523476c365fd816c0903405577c7ff | afc358036f9813f9bb2403ef96e69d51a2c6580f | refs/heads/master | 2020-03-30T04:56:07.173348 | 2017-09-24T08:47:07 | 2017-09-24T08:47:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,625 | java | package nik.com.insta.Utils;
import android.content.Context;
import android.support.annotation.LayoutRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
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 com.nostra13.universalimageloader.core.ImageLoader;
import java.util.List;
import de.hdodenhof.circleimageview.CircleImageView;
import nik.com.insta.R;
import nik.com.insta.models.User;
import nik.com.insta.models.UserAccountSettings;
/**
* Created by nikpatel on 19/09/17.
*/
public class UserListAdapter extends ArrayAdapter<User> {
private static final String TAG = "UserListAdapter";
private LayoutInflater mInflater;
private List<User> mUsers = null;
private int layoutResource;
private Context mContext;
public UserListAdapter(@NonNull Context context, @LayoutRes int resource, @NonNull List<User> objects) {
super(context, resource, objects);
mContext =context;
mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
layoutResource = resource;
this.mUsers = objects;
}
private static class ViewHolder{
TextView username, email;
CircleImageView profileImage;
}
@NonNull
@Override
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
final ViewHolder holder;
if (convertView == null){
convertView = mInflater.inflate(layoutResource, parent, false);
holder = new ViewHolder();
holder.username = (TextView) convertView.findViewById(R.id.username);
holder.email = (TextView) convertView.findViewById(R.id.email);
holder.profileImage = (CircleImageView) convertView.findViewById(R.id.profile_image);
convertView.setTag(holder);
}else {
holder = (ViewHolder) convertView.getTag();
}
holder.username.setText(getItem(position).getUsername());
holder.email.setText(getItem(position).getEmail());
DatabaseReference reference = FirebaseDatabase.getInstance().getReference();
Query query = reference.child(mContext.getString(R.string.dbname_user_account_settings))
.orderByChild(mContext.getString(R.string.field_user_id))
.equalTo(getItem(position).getUser_id());
query.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
for (DataSnapshot singleSnapshot : dataSnapshot.getChildren()){
Log.d(TAG, "onDataChange: found user: " +singleSnapshot.getValue(UserAccountSettings.class).toString());
ImageLoader imageLoader = ImageLoader.getInstance();
imageLoader.displayImage(singleSnapshot.getValue(UserAccountSettings.class).getProfile_photo(),
holder.profileImage);
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
return convertView;
}
}
| [
"ravipatel84184@gmail.com"
] | ravipatel84184@gmail.com |
172608a80e47a4500ba18d5f44cbe93b26077f56 | 0b0c91fee0976a0ce13fb2a870db35cfe72ea8e8 | /src/compiladordibujos/Rectangulo.java | dc15ab61c3721fd634724e2c2bc7436135abf560 | [] | no_license | Manuel-Angel/AnalizadorSintactico | d8d80411ff14a6b710491815a9067ab7ce1cdd21 | 7f67dd75c21d4b525f746e2c05382d2c3dd0c011 | refs/heads/master | 2020-12-28T00:02:09.310729 | 2015-01-07T01:27:45 | 2015-01-07T01:27:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,288 | java | package compiladordibujos;
import java.awt.Color;
import java.awt.Graphics;
class Rectangulo implements Dibujable{
private boolean fondo;
private int x;
private int y;
private int ancho;
private int alto;
private Color color;
public Rectangulo(){
color=null;
fondo=false;
ancho=10; alto=10;
}
public Rectangulo(int x, int y, int ancho, int alto){
this.x=x;
this.y=y;
this.ancho=ancho;
this.alto=alto;
color=Colores.getColor("negro");
fondo=false;
}
public Rectangulo(int x, int y, int ancho, int alto, boolean f){
this(x,y,ancho,alto);
fondo=f;
}
public Rectangulo(int x, int y, int ancho, int alto, String color){
this(x,y,ancho,alto);
this.color=Colores.getColor(color);
}
public void dibujar(Graphics g){
if(getColor()!=null){
g.setColor(getColor());
}
if(isFondo()){
g.fillRect(getX(), getY(), getAncho(), getAlto());
}else{
g.drawRect(getX(), getY(), getAncho(), getAlto());
}
}
public String codigo(){
StringBuilder codigo= new StringBuilder();
/*if(color!=null){
g.setColor(color);
}*/
if(isFondo()){
codigo.append("g.fillRect(");
}else{
codigo.append("g.drawRect(");
}
codigo.append("g.fillRect(");
codigo.append(getX()).append(", ").append(getY()).append(", ");
codigo.append(getAncho()).append(", ").append(getAlto());
codigo.append(");");
return codigo.toString();
}
/**
* @return the fondo
*/
public boolean isFondo() {
return fondo;
}
/**
* @param fondo the fondo to set
*/
public void setFondo(boolean fondo) {
this.fondo = fondo;
}
/**
* @return the x
*/
public int getX() {
return x;
}
/**
* @param x the x to set
*/
public void setX(int x) {
this.x = x;
}
/**
* @return the y
*/
public int getY() {
return y;
}
/**
* @param y the y to set
*/
public void setY(int y) {
this.y = y;
}
/**
* @return the ancho
*/
public int getAncho() {
return ancho;
}
/**
* @param ancho the ancho to set
*/
public void setAncho(int ancho) {
this.ancho = ancho;
}
/**
* @return the alto
*/
public int getAlto() {
return alto;
}
/**
* @param alto the alto to set
*/
public void setAlto(int alto) {
this.alto = alto;
}
/**
* @return the color
*/
public Color getColor() {
return color;
}
/**
* @param color the color to set
*/
public void setColor(String color) {
this.color = Colores.getColor(color);
}
} | [
"ingluisperez.m@outlook.com"
] | ingluisperez.m@outlook.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.