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
eca640f111bcd9f381b2189099f5d7782393c107
3bc62f2a6d32df436e99507fa315938bc16652b1
/play/src/test/java/com/intellij/frameworks/play/PlayFormatterTest.java
5b85a8df7a0aed3d154865d1376f884c77d555a0
[ "Apache-2.0" ]
permissive
JetBrains/intellij-obsolete-plugins
7abf3f10603e7fe42b9982b49171de839870e535
3e388a1f9ae5195dc538df0d3008841c61f11aef
refs/heads/master
2023-09-04T05:22:46.470136
2023-06-11T16:42:37
2023-06-11T16:42:37
184,035,533
19
29
Apache-2.0
2023-07-30T14:23:05
2019-04-29T08:54:54
Java
UTF-8
Java
false
false
777
java
package com.intellij.frameworks.play; import com.intellij.openapi.fileTypes.FileType; import com.intellij.play.language.PlayFileType; import com.intellij.psi.formatter.FormatterTestCase; import java.io.File; public class PlayFormatterTest extends FormatterTestCase { @Override protected String getTestDataPath() { return new File(".").getAbsolutePath(); } @Override protected String getBasePath() { return "src/test/testData/formatter/"; } @Override protected String getFileExtension() { return "html"; } public void testSimple() throws Exception { doTest(); } public void testChildTag() throws Exception { doTest(); } @Override protected FileType getFileType(String fileName) { return PlayFileType.INSTANCE; } }
[ "yuriy.artamonov@jetbrains.com" ]
yuriy.artamonov@jetbrains.com
085019a1da7b86d840b3b32a2043e4944c3d4a55
49b13837e669076e5885692a8ecc8ad150b03ed8
/mobile/app/src/main/java/team9/cfg/mobileapp/WebActivity.java
435cf82a2ecc8c4574cd2b3d2f26c6acf465f3c7
[]
no_license
glasgow2017/team-9
0f142ce48f408a400354b554b335a7d0bef5bdb7
897aeb6e7469ac802b4004af6dcf0a21ba1845f7
refs/heads/master
2021-07-24T03:21:56.057604
2017-11-05T11:30:12
2017-11-05T11:30:12
109,385,084
0
0
null
null
null
null
UTF-8
Java
false
false
3,755
java
package team9.cfg.mobileapp; import android.annotation.SuppressLint; import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.os.Handler; import android.view.MotionEvent; import android.view.View; import android.webkit.WebView; /** * An example full-screen activity that shows and hides the system UI (i.e. * status bar and navigation/system bar) with user interaction. */ public class WebActivity extends AppCompatActivity { /** * Whether or not the system UI should be auto-hidden after * {@link #AUTO_HIDE_DELAY_MILLIS} milliseconds. */ private static final boolean AUTO_HIDE = true; /** * If {@link #AUTO_HIDE} is set, the number of milliseconds to wait after * user interaction before hiding the system UI. */ private static final int AUTO_HIDE_DELAY_MILLIS = 3000; /** * Some older devices needs a small delay between UI widget updates * and a change of the status and navigation bar. */ private static final int UI_ANIMATION_DELAY = 300; private final Handler mHideHandler = new Handler(); private WebView webView; private boolean mVisible; private final Runnable mHideRunnable = new Runnable() { @Override public void run() { hide(); } }; /** * Touch listener to use for in-layout UI controls to delay hiding the * system UI. This is to prevent the jarring behavior of controls going away * while interacting with activity UI. */ private final View.OnTouchListener mDelayHideTouchListener = new View.OnTouchListener() { @Override public boolean onTouch(View view, MotionEvent motionEvent) { if (AUTO_HIDE) { delayedHide(AUTO_HIDE_DELAY_MILLIS); } return false; } }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_web); mVisible = true; // Set up the user interaction to manually show or hide the system UI. this.webView = findViewById(R.id.webview); this.webView.getSettings().setJavaScriptEnabled(true); this.webView.loadUrl("http://34.241.64.98"); // Upon interacting with UI controls, delay any scheduled hide() // operations to prevent the jarring behavior of controls going away // while interacting with the UI. } @Override protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); // Trigger the initial hide() shortly after the activity has been // created, to briefly hint to the user that UI controls // are available. delayedHide(100); } private void toggle() { if (mVisible) { hide(); } else { show(); } } private void hide() { // Hide UI first ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.hide(); } mVisible = false; // Schedule a runnable to remove the status and navigation bar after a delay } @SuppressLint("InlinedApi") private void show() { // Show the system bar mVisible = true; // Schedule a runnable to display UI elements after a delay } /** * Schedules a call to hide() in delay milliseconds, canceling any * previously scheduled calls. */ private void delayedHide(int delayMillis) { mHideHandler.removeCallbacks(mHideRunnable); mHideHandler.postDelayed(mHideRunnable, delayMillis); } }
[ "sebestyen.bence.125@gmail.com" ]
sebestyen.bence.125@gmail.com
ea33eac11faa36b57ec1ab374111d002f8bf993e
e7c57b9b515a4b891f6e8b416d9aa7d94a6339ef
/ICAROChattersConInfrastrV0_3/src/icaro/infraestructura/recursosOrganizacion/recursoTrazas/imp/componentes/ClasificadorTextual.java
b3790f9b4301d1547eb8a66f7d894c84522ad8eb
[]
no_license
iosusam/DASI
83ebba4e4db06be0139d48fb31ce57fef5e021b2
6c97c74b86c825620f164a21398c4da65ff7beb1
refs/heads/master
2021-01-19T22:14:03.794525
2017-04-24T16:16:21
2017-04-24T16:16:21
88,772,224
2
0
null
null
null
null
UTF-8
Java
false
false
7,477
java
package icaro.infraestructura.recursosOrganizacion.recursoTrazas.imp.componentes; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.io.PrintWriter; import java.io.Serializable; import java.util.HashMap; import java.util.LinkedList; import java.util.List; /* * Esta clase se encarga de clasificar los mensajes de traza, * escribindolos correctamente en los ficheros correspondientes * */ public class ClasificadorTextual implements Serializable{ private static final String rutaLogs = "./log/"; private List<String> agentesSesion; //panel principal de trazas private HashMap tablaInfoPanelesEspecificos; //tabla con informacion de las rutas asignadas a las entidades en la sesion private HashMap tablaEntidadesTrazables; private String nombreEntidad; private int versionArchivo; private String rutaFichero = ""; private String nombreFicheroRegistroLogs; // notificador = notifEventos; // tablaPanelesEspecificos = new HashMap () ; public ClasificadorTextual(){ tablaEntidadesTrazables = new HashMap(); } public void clasificaTraza(InfoTraza traza){ //genero el mensaje a escribir en la persistencia String mensajeAEscribir =traza.getNivel().toString()+" : "+traza.getEntidadEmisora()+" : "+traza.getMensaje(); //genero el archivo donde se debe escribir // String rutaValida = getRuta(traza.getNombre().toString()); // escribeFichero(mensajeAEscribir,rutaValida); nombreEntidad =traza.getEntidadEmisora(); if ( !tablaEntidadesTrazables.containsKey(nombreEntidad)){ versionArchivo = getVersion(nombreEntidad); rutaFichero = getRuta( nombreEntidad); tablaEntidadesTrazables.put(nombreEntidad, rutaFichero); } else { rutaFichero = tablaEntidadesTrazables.get(nombreEntidad).toString(); } escribeFichero(mensajeAEscribir,rutaFichero); } private String getRuta(String nombreAgente){ /* genero el fichero en el que se debe escribir. */ String rutaFichero = ""; if ( tablaEntidadesTrazables.containsKey(nombreEntidad)){ /*no es inicio de sesion -> se aade el mensaje al ltimo archivo del agente especificado*/ versionArchivo = getVersion(nombreAgente); rutaFichero = rutaLogs + nombreAgente + versionArchivo + ".log"; } else{ //inicio de sesin -> se devuelve la ruta de un fichero nuevo siguiendo la numeracin // agentesSesion.add(nombreAgente); int versionArchivo = getVersion(nombreAgente); if(versionArchivo == -1) { //no existe ningn fichero del agente -> se devuelve la ruta para el primer archivo //y se actualiza el fichero de registro rutaFichero = rutaLogs+nombreAgente+"0.log"; actualizaRegistro(nombreAgente,0); } else{ //enviamos la versin siguiente y actualizamos el fichero de registro versionArchivo++; rutaFichero = rutaLogs+nombreAgente+versionArchivo+".log"; actualizaRegistro(nombreAgente,versionArchivo); } } return rutaFichero; } private int getNumeroDigitos(int numero){ int numDigitos = 1; while(numero>9){ numero = numero/10; numDigitos++; } return numDigitos; } private void actualizaRegistro(String nombreAgente, int versionArchivo){ String rutaFichero = rutaLogs + nombreFicheroRegistroLogs; // Sustituir por RandomAccessFile File archivo = new File(rutaFichero); boolean encontrado = false; try{ if (!archivo.exists()){ PrintWriter writer = new PrintWriter(archivo); //se crea } //leo el archivo y actualizo la versin del agente BufferedReader bf = new BufferedReader(new FileReader(rutaFichero)); String cadenaActual = ""; String cadenaNueva = ""; if(versionArchivo == 0){ //primera version del agente cadenaNueva += "0"+nombreAgente+"\n"; } else{ //genero la cadena con el valor actualizado //en funcin de la longitud de este valor while (((cadenaActual = bf.readLine())!=null)&&(!encontrado)) { if (cadenaActual.contains(nombreAgente)){ encontrado = true; cadenaNueva += versionArchivo + cadenaActual.substring (getNumeroDigitos(versionArchivo-1),cadenaActual.length())+"\n"; } } } //escribo en el fichero la nueva cadena,sustituyendo a la otra, junto al resto del mensaje BufferedReader bf2= new BufferedReader(new FileReader(rutaFichero)); String contenidoFichero = cadenaNueva; while ((cadenaActual = bf2.readLine())!=null) { if (!cadenaActual.contains(nombreAgente)){ contenidoFichero += cadenaActual+"\n"; } } PrintWriter writer = new PrintWriter(archivo); writer.write(contenidoFichero); writer.close(); }catch(Exception e){ e.printStackTrace(); } } private int getVersion(String nombreAgente){ /* Busca en el archivo "registroLog.log" el registro del agente especificado. * Devuelve el nmero que est antes del nombre del agente (ltima versin) * Si no est registrado el agente, se devuelve -1 */ String rutaFichero = rutaLogs + nombreFicheroRegistroLogs; File archivo = new File(rutaFichero); int version = -1; boolean encontrado = false; try{ if (archivo.exists()){ //leo el archivo y tomo todo su contenido para comprobar si est el agente BufferedReader bf = new BufferedReader(new FileReader(rutaFichero)); String cadenaActual = ""; String caracterActual = ""; int numeroConstruido = 0; while (((cadenaActual = bf.readLine())!=null)&&(!encontrado)) { if (cadenaActual.contains(nombreAgente)){ encontrado = true; //recorro caracteres mientras sean dgitos para ir formando el nmero completo int indice = 0; caracterActual = cadenaActual.substring(indice, indice + 1); do{ numeroConstruido = numeroConstruido*10 + (new Integer(caracterActual).intValue()); indice++; caracterActual = cadenaActual.substring(indice, indice + 1); }while(caracterActual.equals("0")||caracterActual.equals("1")||caracterActual.equals("2")||caracterActual.equals("3") ||caracterActual.equals("4")||caracterActual.equals("5")||caracterActual.equals("6")||caracterActual.equals("7") ||caracterActual.equals("8")||caracterActual.equals("9")); version = numeroConstruido; } } } }catch(Exception e){ e.printStackTrace(); } return version; } private void escribeFichero(String mensaje,String rutaFichero){ /*escribe el mensaje dado en la ruta especificada. Si el fichero contena * algo anteriormente, lo concatena */ File archivo = new File(rutaFichero); String contenidoAnterior = ""; try{ if (archivo.exists()){ //leo el archivo y tomo todo su contenido BufferedReader bf = new BufferedReader(new FileReader(rutaFichero)); String cadenaActual = ""; while ((cadenaActual = bf.readLine())!=null) { contenidoAnterior += cadenaActual; contenidoAnterior += "\n"; } } PrintWriter writer = new PrintWriter(archivo); //Escribimos la nueva traza writer.print(contenidoAnterior+mensaje); writer.close(); } catch(IOException e){ e.printStackTrace(); } } }
[ "dsalc@DESKTOP-FO9HLT8" ]
dsalc@DESKTOP-FO9HLT8
98fd3c303070328df754f2d6b69928c78b024f9b
3be8f052dcad42946ef479109d9c7a142bf9b186
/monProjet/Noyau/src/main/java/noyau/repository/ModuleRepository.java
41fd5e0cdf656024a33a2903b384de735495ae36
[]
no_license
frankybo57/ProjetPerso-Maven
e7c066a270e4e190f93805a66383891558b8089f
de0d156369a65777637291d548169c6eae26336f
refs/heads/master
2021-05-07T00:32:24.952251
2017-11-11T10:36:05
2017-11-11T10:36:05
110,154,920
0
0
null
null
null
null
UTF-8
Java
false
false
191
java
/** * */ package noyau.repository; import noyau.model.Module; /** * @author Francois 2 * @version 1.0 * */ public interface ModuleRepository extends Repository<Module, Integer> { }
[ "32872685+frankybo57@users.noreply.github.com" ]
32872685+frankybo57@users.noreply.github.com
186f9cda7050a7e3de009ea3635840cb2ae95f9b
805ece6af666db33cf6e3defd4c34fffe9b431fe
/src/main/java/com/imedis/cntrial/service/HelloService.java
9d35aaacdba29dfb9780a71a181b0aeebef9be5d
[]
no_license
stingh711/cntrial
2415798d8fcb04b54d0710df98966a11caad8519
f421a8426e027c0e684795097f1ee9e920cfeeb3
refs/heads/master
2021-01-23T18:51:34.277727
2013-04-10T14:15:14
2013-04-10T14:15:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
296
java
package com.imedis.cntrial.service; /** * Created with IntelliJ IDEA. * User: Administrator * Date: 13-4-9 * Time: 上午11:42 * To change this template use File | Settings | File Templates. */ public class HelloService { public String hello() { return "hello, sting"; } }
[ "stingh711@gmail.com" ]
stingh711@gmail.com
94a9607fe76a3bd7869aacfb8bc502ce654e2527
f42bf04da01d311db3c85b28cf82381792ff5c5a
/backEnd/LocosXEcoturismo/src/main/java/com/servicios/lxe/LocosXEcoturismo.java
d3ba6bfc48075f567a375217db45a433212109d0
[]
no_license
IngSwEspec2030/LxEcoturismo
111aeb54ae310f9926e57051d637b792ced461d0
7c777e3d5433700ca05590cb01322b3531b4cb75
refs/heads/master
2022-12-19T11:18:05.160557
2020-10-02T00:03:51
2020-10-02T00:03:51
287,166,726
0
0
null
2020-10-01T13:45:23
2020-08-13T02:56:44
SCSS
UTF-8
Java
false
false
307
java
package com.servicios.lxe; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class LocosXEcoturismo { public static void main(String[] args) { SpringApplication.run(LocosXEcoturismo.class, args); } }
[ "leonc.natalia@gmail.com" ]
leonc.natalia@gmail.com
44f630a8ad221210143aadbba94dd7834c731018
c36e51c7458383f6561b622028b06abc15579610
/src/Main.java
e346e0ffcf5f011e5382e06dbd137154346051ce
[]
no_license
DeepSabbath/E_Dmuchawka2
a1079086c78d38fd47c64b9058303838673e81a3
22473f594c295ecf278a833a0cf35d500b0b4b66
refs/heads/master
2021-01-10T18:01:02.794388
2016-01-07T19:42:00
2016-01-07T19:42:00
48,613,875
0
0
null
null
null
null
UTF-8
Java
false
false
4,305
java
import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.Clip; import javax.swing.*; import java.awt.*; import java.io.EOFException; import java.io.FileInputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.File; /** * <b>Main</b> - klasa główna aplikajci. * Jest to prosta gra symulująca aplikację na platformę E-Dmuchawka * @author Amadeusz Kardasz */ public class Main { /** okresla wysokosc okna */ static final int WYSOKOSC = 700; /** okresla szerokosc okna */ static final int SZEROKOSC = 1280; /** przechowuje calkowity czas odpalenia aplikacji */ public static int lacznyCzasOdpaleniaAplikacji; /** przechowuje calkowity czas dmuchania (klikania dynamitu) */ public static int lacznyCzasDmuchania; /** * metoda uruchamiająca grę. Najpierw pobierane są dane na temat czasu gry. * Potem następuje pobranie parametrów ekranu i ustalenie jego środka, * na koniec tworzony jest obiekt klasy OknoGlowne, gdzie wykonuje się dalsza część programu */ public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { try { odczyt("czas.txt"); } catch (IOException e) { System.out.println("Błąd odczytu"); } catch (ClassNotFoundException e) { System.out.println("Błąd odczytu"); } //pobierz rozmiar ekranu /** przechowuje szerokosc ekranu */ int szerokoscEkranu=Toolkit.getDefaultToolkit().getScreenSize().width; /** przechowuje wysokosc ekranu */ int wysokoscEkranu=Toolkit.getDefaultToolkit().getScreenSize().height; //oblicz współrzędne narożnika tak, aby pole gry było wyśrodkowane /** przechowuje srodek szerokosci ekranu */ int xSrodek=(szerokoscEkranu - SZEROKOSC)/2; /** przechowuje srodek wyskokosci ekranu */ int ySrodek=(wysokoscEkranu - WYSOKOSC)/2; OknoGlowne o = new OknoGlowne(SZEROKOSC, WYSOKOSC, xSrodek, ySrodek); // utworzenie okna głównego aplikacji o.setDefaultCloseOperation(o.EXIT_ON_CLOSE); } // koniec run }); // koniec Runnable } // koniec main /** * metoda odczytująca z pliku dotychczasowe czasy gry oraz dmuchania * @param nazwaPliku - ścieżka do pliku z danymi * @throws IOException * @throws ClassNotFoundException */ public static void odczyt(String nazwaPliku) throws IOException, ClassNotFoundException { ObjectInputStream ois = null; CzasDoZapisu cdz = null; try { ois = new ObjectInputStream(new FileInputStream(nazwaPliku)); cdz = (CzasDoZapisu) ois.readObject(); } catch (EOFException ex) { //System.out.println("Koniec pliku"); } finally { if (ois != null) ois.close(); } lacznyCzasOdpaleniaAplikacji = cdz.lacznyCzasGry; lacznyCzasDmuchania = cdz.lacznyCzasDmuchania; } // koniec odczyt /** * metoda pozwalająca ustawić rozmiar czcionki */ public static Font ustawCzcionke(int rozmiar) { /** ustawia czcionke */ Font font = new Font("Helvetica", Font.BOLD, rozmiar); return font; } /** * metoda oddtwarzająca dźwięk * @param f - ścieżka do pliku */ public static synchronized void grajDzwiek(final File f) { new Thread(new Runnable() { public void run() { try { Clip clip = AudioSystem.getClip(); AudioInputStream inputStream = AudioSystem.getAudioInputStream(f); clip.open(inputStream); clip.start(); } catch (Exception e) { System.err.println(e.getMessage()); } } }).start(); }// koniec grajDzwiek }
[ "ama7kar77@onet.eu" ]
ama7kar77@onet.eu
662562e4c546d256599995a33784d25cd4746e61
57dd108db8368a4fb60b34119b94e4d8d54cd988
/src/main/java/com/sdiemert/jgt/fs/FileParser.java
e79a7742b14b1cfb3a9c45919b51a733114a231f
[ "MIT" ]
permissive
sdiemert/jgt
ac3048b6204f480d6c052f1bddc446990bf6763e
38da4fa6ba1e21f64311705700052a776d564544
refs/heads/master
2021-05-26T05:18:37.067420
2018-12-16T04:36:42
2018-12-16T04:36:42
127,568,860
0
0
null
null
null
null
UTF-8
Java
false
false
876
java
package com.sdiemert.jgt.fs; import com.sdiemert.jgt.core.GTSystem; import com.sdiemert.jgt.core.Graph; import com.sdiemert.jgt.core.GraphException; import com.sdiemert.jgt.core.RuleException; import org.apache.commons.io.FileUtils; import org.json.JSONException; import org.json.JSONObject; import java.io.File; import java.io.IOException; /** * Builds up a GTSystem and/or Graphs from the contents of a file. */ public abstract class FileParser { public abstract Graph loadGraph(String filePath) throws IOException, JSONException, GraphException; public abstract GTSystem loadSystem(String filePath) throws IOException, JSONException, GraphException, RuleException; JSONObject fromFile(String path) throws IOException { File f = new File(path); String c = FileUtils.readFileToString(f, "utf-8"); return new JSONObject(c); } }
[ "simon.diemert@gmail.com" ]
simon.diemert@gmail.com
ff8afde53030259a4631e9d2f93fe785ba78d5a5
3c86d74a13be1824971df2dcc45cb43ec08ab92b
/src/zadaci_23_07_2015/IspisSortiranihBrojeva.java
75a131760f116596b2988081327a1bc184bd947d
[]
no_license
djomla79/BILD-IT-Zadaci
a68d7663475d6f3ae71f09f04810ca021c75f0b1
12c67f55745239fe01fbef76e874494520c06db5
refs/heads/master
2020-04-13T16:19:10.050471
2015-09-03T08:16:32
2015-09-03T08:16:32
39,501,121
0
0
null
null
null
null
WINDOWS-1250
Java
false
false
1,169
java
package zadaci_23_07_2015; import java.util.Arrays; import java.util.Scanner; public class IspisSortiranihBrojeva { public static void main(String[] args) { /* Napisati metodu sa sljedećim headerom koja ispisuje tri broja u rastućem redosljedu: public static void displaySortedNumbers(double num1, double num2, double num3). Napisati program koji pita korisnika da unese tri broja te ispiše ta tri broja u rastućem redosljedu. */ Scanner input = new Scanner(System.in); System.out.println("Unesite tri broja: "); // unos tri broja double br1 = input.nextDouble(); double br2 = input.nextDouble(); double br3 = input.nextDouble(); displaySortedNumbers(br1, br2, br3); // pozivanje metode input.close(); } /** Metoda koja sortira brojeve u rastucem nizu */ public static void displaySortedNumbers(double num1, double num2, double num3) { double [] niz = {num1, num2, num3}; // ubacivanje argumenata u niz Arrays.sort(niz); // sortiranje niza System.out.print("Brojevi u rastucem redoslijedu: " + Arrays.toString(niz)); // ispis elemenata niza } }
[ "tm.djomla79@gmail.com" ]
tm.djomla79@gmail.com
b0fb938159e4c76a2fbf4b76039dc3d7787b26b8
5cea2007bd80278466698e186dddf02e5b3e7c64
/rest-web-services/src/main/java/deepak/desh/restwebservices/user/User.java
55b78156a2d2bd0f8fcb85137547bd7711466ba4
[]
no_license
deepak1986-coder/Develop_code
522995bdc0315fce5acb47e3440f2bede20d0f20
67bf70294a657862a88ce1fc5eb5f91901a41176
refs/heads/master
2023-03-04T11:28:27.971502
2021-02-17T20:24:56
2021-02-17T20:24:56
338,242,730
0
0
null
null
null
null
UTF-8
Java
false
false
1,503
java
package deepak.desh.restwebservices.user; import java.util.Date; import java.util.List; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.OneToMany; import javax.validation.constraints.Past; import javax.validation.constraints.Size; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "All detail about the user ") @Entity public class User { @Id @GeneratedValue private Integer id; @Size(min = 2, message = "Name should be atleast 2 character") @ApiModelProperty(notes = "Names atleast have 2 character") private String name; @Past @ApiModelProperty(notes = "Birth date should be in the past") private Date date; @OneToMany(mappedBy = "user") private List<Post> post; protected User() { } public User(Integer id, String name, Date date) { super(); this.id = id; this.name = name; this.date = date; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Date getDate() { return date; } public void setDate(Date date) { this.date = date; } public List<Post> getPost() { return post; } public void setPost(List<Post> post) { this.post = post; } @Override public String toString() { return "User [id=" + id + ", name=" + name + ", date=" + date + "]"; } }
[ "deshdeepak@deshdeepak-Vostro-3480" ]
deshdeepak@deshdeepak-Vostro-3480
9ec68b6383598d726e0bef4bc10de9dc6eaa5b74
4980af1616a366c360d8317ff52c24e8828e07e6
/UseCaseToModalSequenceDiagramIntegration/gen/UseCaseToModalSequenceDiagramIntegration/Rules/NormalStepBFToMessageRule.java
5f74472d2d09b3819fc64aa2d7ec37561c032dad
[]
no_license
mabilov/tgg_moflon_bpmn2usecase2msd
ddfec176800cb9706862e172a4b89d9c3641ed70
99b941f2557648ef340b12ebe473b9b29a6437ad
refs/heads/master
2018-05-30T15:25:21.136601
2015-04-27T09:42:56
2015-04-27T09:42:56
32,983,695
0
0
null
null
null
null
UTF-8
Java
false
false
684
java
/** */ package UseCaseToModalSequenceDiagramIntegration.Rules; import TGGRuntime.AbstractRule; // <-- [user defined imports] // [user defined imports] --> /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>Normal Step BF To Message Rule</b></em>'. * <!-- end-user-doc --> * * * @see UseCaseToModalSequenceDiagramIntegration.Rules.RulesPackage#getNormalStepBFToMessageRule() * @model abstract="true" * @generated */ public interface NormalStepBFToMessageRule extends AbstractRule, NormalStepToMessageRule { // <-- [user code injected with eMoflon] // [user code injected with eMoflon] --> } // NormalStepBFToMessageRule
[ "marat.abilov@gmail.com" ]
marat.abilov@gmail.com
a164c0f39e8315244089558a73f0dc21e661bd84
d26be914b0277a35d4109193da8c6305247e999a
/moduli/src/main/java/com/gek/and/moduli/adapter/CategoryGridAdapter.java
8464a0a03238da135c3783a6ce660b2fc149f9fd
[]
no_license
devgek/Moduli
87f6511a85eb9362a1bfa41768d612350509c38e
44a9bcdd47a1f74751e0b449223fd73c9c8e626d
refs/heads/master
2020-03-27T05:00:30.749765
2018-08-24T12:22:14
2018-08-24T12:22:14
28,821,740
0
0
null
null
null
null
UTF-8
Java
false
false
2,553
java
package com.gek.and.moduli.adapter; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.support.v7.widget.CardView; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.TextView; import com.gek.and.moduli.AppConstants; import com.gek.and.moduli.R; import com.gek.and.moduli.activity.ModuleSelectionActivity; import com.gek.and.moduli.model.Category; import com.gek.and.moduli.util.SemesterUtil; public class CategoryGridAdapter extends ArrayAdapter<Category> { static class CategoryCardViewHolder { TextView line1; int position; } public CategoryGridAdapter(Context context, int resource) { super(context, resource); } @Override public Category getItem(int position) { return super.getItem(position); } @Override public long getItemId(int position) { return 0; } @Override public View getView(int position, View convertView, ViewGroup parent) { Category category = getItem(position); View view = convertView; CategoryCardViewHolder viewHolder; if (view == null) { LayoutInflater inflater = (LayoutInflater) this.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); view = inflater.inflate(R.layout.category, parent, false); CardView cardView = (CardView)view; cardView.setCardBackgroundColor(SemesterUtil.getSemesterColor((Activity) getContext())); view.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { CategoryCardViewHolder holder = (CategoryCardViewHolder) v.getTag(); startModuleSelection(holder.position); } }); viewHolder = new CategoryCardViewHolder(); viewHolder.line1 = (TextView) view.findViewById(R.id.category_line1); viewHolder.position = position; view.setTag(viewHolder); } else { viewHolder = (CategoryCardViewHolder) view.getTag(); } viewHolder.line1.setText(category.getName()); return view; } protected void startModuleSelection(int position) { // Toast.makeText(getContext(), "clicked", Toast.LENGTH_SHORT).show(); Category category = getItem(position); Intent intent = new Intent(getContext(), ModuleSelectionActivity.class); intent.putExtra(AppConstants.INTENT_EXTRA_CATEGORY_KEY, category.getKey()); intent.putExtra(AppConstants.INTENT_EXTRA_CATEGORY_NAME, category.getName()); getContext().startActivity(intent); } }
[ "gerald.kahrer@gmail.com" ]
gerald.kahrer@gmail.com
ab18e4527b8f27dea52463f41bbc118fb40eb7e8
56fe53e612720292dc30927072e6f76c2eea6567
/onvif/src/org/onvif/ver10/schema/Space2DDescription.java
3a856f33960d962aa7169fdf1bb929e92d46c25f
[]
no_license
guishijin/onvif4java
f0223e63cda3a7fcd44e49340eaae1d7e5354ad0
9b15dba80f193ee4ba952aad377dda89a9952343
refs/heads/master
2020-04-08T03:22:51.810275
2019-10-23T11:16:46
2019-10-23T11:16:46
124,234,334
1
1
null
null
null
null
UTF-8
Java
false
false
2,492
java
package org.onvif.ver10.schema; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; /** * <p> * Java class for Space2DDescription complex type. * * <p> * The following schema fragment specifies the expected content contained within * this class. * * <pre> * &lt;complexType name="Space2DDescription"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="URI" type="{http://www.w3.org/2001/XMLSchema}anyURI"/> * &lt;element name="XRange" type="{http://www.onvif.org/ver10/schema}FloatRange"/> * &lt;element name="YRange" type="{http://www.onvif.org/ver10/schema}FloatRange"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "Space2DDescription", propOrder = { "uri", "xRange", "yRange" }) public class Space2DDescription { @XmlElement(name = "URI", required = true) @XmlSchemaType(name = "anyURI") protected String uri; @XmlElement(name = "XRange", required = true) protected FloatRange xRange; @XmlElement(name = "YRange", required = true) protected FloatRange yRange; /** * Gets the value of the uri property. * * @return possible object is {@link String } * */ public String getURI() { return uri; } /** * Sets the value of the uri property. * * @param value * allowed object is {@link String } * */ public void setURI(String value) { this.uri = value; } /** * Gets the value of the xRange property. * * @return possible object is {@link FloatRange } * */ public FloatRange getXRange() { return xRange; } /** * Sets the value of the xRange property. * * @param value * allowed object is {@link FloatRange } * */ public void setXRange(FloatRange value) { this.xRange = value; } /** * Gets the value of the yRange property. * * @return possible object is {@link FloatRange } * */ public FloatRange getYRange() { return yRange; } /** * Sets the value of the yRange property. * * @param value * allowed object is {@link FloatRange } * */ public void setYRange(FloatRange value) { this.yRange = value; } }
[ "420188751@qq.com" ]
420188751@qq.com
6d80259a57c208509c79461820236a27e461a7cc
689cdf772da9f871beee7099ab21cd244005bfb2
/classes/com/tencent/avsdkhost/widget/AboveVideoBottomViewHost$7.java
3617c6f58cee37a802a642a931af8233b60770c7
[]
no_license
waterwitness/dazhihui
9353fd5e22821cb5026921ce22d02ca53af381dc
ad1f5a966ddd92bc2ac8c886eb2060d20cf610b3
refs/heads/master
2020-05-29T08:54:50.751842
2016-10-08T08:09:46
2016-10-08T08:09:46
70,314,359
2
4
null
null
null
null
UTF-8
Java
false
false
665
java
package com.tencent.avsdkhost.widget; import android.view.View; import android.view.View.OnClickListener; import android.view.inputmethod.InputMethodManager; class AboveVideoBottomViewHost$7 implements View.OnClickListener { AboveVideoBottomViewHost$7(AboveVideoBottomViewHost paramAboveVideoBottomViewHost, InputMethodManager paramInputMethodManager) {} public void onClick(View paramView) { this.val$inputMethodManager.toggleSoftInput(1, 1); } } /* Location: E:\apk\dazhihui2\classes-dex2jar.jar!\com\tencent\avsdkhost\widget\AboveVideoBottomViewHost$7.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "1776098770@qq.com" ]
1776098770@qq.com
ae580d0b18e24197050776d1c3b2aa83b26e822d
63ff5eda782fb35e4c76dba68d66a990610d6347
/src/main/java/com/tinpan/model/EventLocation.java
e36e9041201802ce19264d27048edaedf2abae09
[]
no_license
hepaces89/TinPan
02a9fc94989eeff081dd91fdd8e7cfe94b2eff6b
ec61445d3ca638f3376a6b0ae858d9e4fea25614
refs/heads/master
2016-09-14T11:49:00.974749
2016-05-15T21:21:20
2016-05-15T21:21:20
58,885,043
0
0
null
null
null
null
UTF-8
Java
false
false
59
java
package com.tinpan.model; public class EventLocation { }
[ "hepaces89@gmail.com" ]
hepaces89@gmail.com
8d0a43e0f9a56177f20b22c2b7f3e9a22a5189e3
fadb7be3139596273f8741f895508e16cbbac2d4
/src/repline_tasks/counteven.java
d5b019eada66ae1fc6277eaeb1beb9a9d60ea47d
[]
no_license
Abasiyanik/SummerCamp
4b728f419864c9d0ed454f4cf0acf48c4097e30e
ff08719839b0fe59c236d4fa4672dbecf10c4a0e
refs/heads/master
2023-02-08T17:33:47.593143
2020-10-03T23:39:36
2020-10-03T23:39:36
285,593,430
0
0
null
null
null
null
UTF-8
Java
false
false
429
java
package repline_tasks; public class counteven { /* [2, 1, 2, 3, 4]) → 3 nums → [2, 2, 0, 3, 5]) → 3 nums → [1, 3, 5, 7, 9]) → 0 */ public static void main(String[] args) { int [] nums= {2,1,2,3,4}; int count=0; for (int each: nums){ if (each%2!=0){ continue; } count++; } System.out.println(count); } }
[ "abasiyanik@gmail.com" ]
abasiyanik@gmail.com
5c71b4dec2657c3eb093a2e7b73d0f3450495f80
bad1a83f765e0714f921cb2aa99af31d3c69592b
/skolarbete/EShop/src/main/java/com/jonasson/eshop/dt/helpers/MongoClientProvider.java
574501f35d81d2f68a461f41dfa4099549945c2c
[]
no_license
sjo0911/A-portfolio-project
6705a1b1f508755048d4dce667dfca333de5f230
b26c9063ae5927ad7dabbf3f726099a9ac749b3e
refs/heads/main
2023-08-22T14:44:15.279588
2021-10-20T05:33:46
2021-10-20T05:33:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
870
java
package com.jonasson.eshop.dt.helpers; import javax.annotation.PostConstruct; import javax.ejb.ConcurrencyManagement; import javax.ejb.ConcurrencyManagementType; import javax.ejb.Lock; import javax.ejb.LockType; import javax.ejb.Singleton; import com.mongodb.MongoClient; import com.mongodb.MongoClientURI; @Singleton @ConcurrencyManagement(ConcurrencyManagementType.CONTAINER) public class MongoClientProvider implements IMongoClientProvider { private MongoClient mongoClient = null; @Override @Lock(LockType.READ) public MongoClient getMongoClient(){ return mongoClient; } @Override @PostConstruct public void init() { String mongoIpAddress = "mongodb+srv://sven:eriksson@cluster0.2si5o.mongodb.net/eshop?retryWrites=true&w=majority"; MongoClientURI mongoUri = new MongoClientURI(mongoIpAddress); mongoClient = new MongoClient(mongoUri); } }
[ "jonasson_simon@hotmail.com" ]
jonasson_simon@hotmail.com
c31231fa9aab101971ecec1a8c738179cd354a6c
ec88f347ab9c9514bfcec5820eb1792bf3fa440a
/cdr.batch/src/main/java/com/yly/cdr/batch/writer/MS028Writer.java
6cf9dbfbffe7b8a0b729f653096e2f9231b52446
[]
no_license
zhiji6/szbj-code
67018746538eb0b7b74b15a5a5fd634c5bf83c24
56367d000e20b9851d9e8e4b22b7f1091928a651
refs/heads/master
2023-08-20T06:58:34.625901
2017-07-18T07:40:19
2017-07-18T07:40:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,709
java
package com.yly.cdr.batch.writer; import java.math.BigDecimal; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; import com.yly.cdr.core.Constants; import com.yly.cdr.entity.CodeDrug; import com.yly.cdr.hl7.dto.CodeValueDto; import com.yly.cdr.hl7.dto.Drug; import com.yly.cdr.util.StringUtils; /** * 药品字典 * @author tong_meng * */ @Component(value = "ms028Writer") @Scope(BeanDefinition.SCOPE_PROTOTYPE) public class MS028Writer extends MSBaseWriter<Drug> { /** * 包装号默认值 */ private static final String SERIAL_DEFAULT = "00"; @Override public Object getNewCodeValue(CodeValueDto codeValue) { Drug drug = (Drug) codeValue; CodeDrug cd = null; cd = new CodeDrug(); cd.setCsId(codeSystem.getCsId()); cd.setCode(drug.getCode()); // $Author :tong_meng // $Date : 2012/10/29 15:00$ // [BUG]0010821 MODIFY BEGIN cd.setSerial(StringUtils.isEmpty(drug.getSerial()) ? SERIAL_DEFAULT:drug.getSerial()); // [BUG]0010821 MODIFY END cd.setDrugId(StringUtils.isEmpty(drug.getDrugId()) ? drug.getCode():drug.getDrugId()); // $Author :tong_meng // $Date : 2012/9/5 10:00$ // [BUG]0009337 MODIFY BEGIN cd.setDrugStandardId(drug.getDrugStandardId()); // [BUG]0009337 MODIFY END cd.setName(drug.getName()); cd.setDosage(drug.getDosage()); cd.setConcentration(drug.getConcentration()); cd.setWeight(drug.getWeight()); cd.setWeightUnit(drug.getWeightUnit()); cd.setVolum(drug.getVolum()); cd.setVolUnit(drug.getVolUnit()); cd.setMiniUnit(drug.getMiniUnit()); cd.setPackSize(StringUtils.strToBigDecimal(drug.getPackSize(), "pe")); cd.setPackUnit(drug.getPackUnit()); cd.setSpecification(drug.getSpecification()); cd.setSpeComment(drug.getSpeComment()); cd.setFixPrice(StringUtils.strToBigDecimal(drug.getFixPrice(), "pe")); cd.setRetprice(StringUtils.strToBigDecimal(drug.getRetprice(), "pe")); cd.setManufactory(drug.getManufactory()); cd.setSelfFlag(drug.getSelfFlag()); cd.setSeparateFlag(drug.getSeparateFlag()); cd.setSupriceFlag(drug.getSupriceFlag()); cd.setDrugFlag(drug.getDrugFlag()); cd.setPyCode(drug.getPyCode()); cd.setInfusionFlag(drug.getInfusionFlag()); cd.setCountryFlag(drug.getCountryFlag()); cd.setDivideFlag(drug.getDivideFlag()); cd.setDrugKind(drug.getDrugKind()); cd.setZyBillItem(drug.getZyBillItem()); cd.setMzBillItem(drug.getMzBillItem()); cd.setZyChargeGroup(drug.getZyChargeGroup()); cd.setMzChargeGroup(drug.getMzChargeGroup()); cd.setClassCode(drug.getClassCode()); cd.setExtendCode(drug.getExtendCode()); cd.setSupplyCode(drug.getSupplyCode()); cd.setFrequCode(drug.getFrequCode()); cd.setOrderDosage(drug.getOrderDosage()); cd.setDosageUnit(drug.getDosageUnit()); cd.setBuyPrice(StringUtils.strToBigDecimal(drug.getBuyPrice(), "pe")); cd.setLowdosageFlag(drug.getLowdosageFlag()); cd.setAuditCode(drug.getAuditCode()); cd.setSkinTestFlag(drug.getSkinTestFlag()); cd.setPrintName(drug.getPrintName()); cd.setLicenseNo(drug.getLicenseNo()); cd.setEffMonth(drug.getEffMonth()); cd.setTradMark(drug.getTradMark()); cd.setFuFlag(drug.getFuFlag()); cd.setZySupplyCode(drug.getZySupplyCode()); cd.setZyFrequCode(drug.getZyFrequCode()); cd.setSeqNo(drug.getSeqNo()); cd.setVersionNo(drug.getVersionNo()); cd.setCreateTime(systemDate); cd.setUpdateCount(Constants.INSERT_UPDATE_COUNT); cd.setUpdateTime(systemDate); if (isDeleteMessage(drug.getNewUpFlag())) { cd.setDeleteFlag(Constants.DELETE_FLAG); cd.setDeleteTime(systemDate); } else if (isNewMessage(drug.getNewUpFlag()) || isUpdateMessage(drug.getNewUpFlag())) { cd.setDeleteFlag(Constants.NO_DELETE_FLAG); cd.setDeleteTime(null); } return cd; } @Override public Object getUpdateCodeValue(CodeValueDto codeValue) { Drug drug = (Drug) codeValue; // $Author :tong_meng // $Date : 2012/10/25 15:00$ // [BUG]0010742 MODIFY BEGIN CodeDrug cd = getCDList(drug.getCode(), codeSystem.getCsId(), StringUtils.isEmpty(drug.getSerial()) ? SERIAL_DEFAULT:drug.getSerial()); // [BUG]0010742 MODIFY END // $Author :tong_meng // $Date : 2012/10/29 15:00$ // [BUG]0010821 MODIFY BEGIN cd.setSerial(StringUtils.isEmpty(drug.getSerial()) ? SERIAL_DEFAULT:drug.getSerial()); // [BUG]0010821 MODIFY END cd.setDrugId(StringUtils.isEmpty(drug.getDrugId()) ? drug.getCode():drug.getDrugId()); // $Author :tong_meng // $Date : 2012/9/5 10:00$ // [BUG]0009337 MODIFY BEGIN cd.setDrugStandardId(drug.getDrugStandardId()); // [BUG]0009337 MODIFY END cd.setName(drug.getName()); cd.setDosage(drug.getDosage()); cd.setConcentration(drug.getConcentration()); cd.setWeight(drug.getWeight()); cd.setWeightUnit(drug.getWeightUnit()); cd.setVolum(drug.getVolum()); cd.setVolUnit(drug.getVolUnit()); cd.setMiniUnit(drug.getMiniUnit()); cd.setPackSize(StringUtils.strToBigDecimal(drug.getPackSize(), "pe")); cd.setPackUnit(drug.getPackUnit()); cd.setSpecification(drug.getSpecification()); cd.setSpeComment(drug.getSpeComment()); cd.setFixPrice(StringUtils.strToBigDecimal(drug.getFixPrice(), "pe")); cd.setRetprice(StringUtils.strToBigDecimal(drug.getRetprice(), "pe")); cd.setManufactory(drug.getManufactory()); cd.setSelfFlag(drug.getSelfFlag()); cd.setSeparateFlag(drug.getSeparateFlag()); cd.setSupriceFlag(drug.getSupriceFlag()); cd.setDrugFlag(drug.getDrugFlag()); cd.setPyCode(drug.getPyCode()); cd.setInfusionFlag(drug.getInfusionFlag()); cd.setCountryFlag(drug.getCountryFlag()); cd.setDivideFlag(drug.getDivideFlag()); cd.setDrugKind(drug.getDrugKind()); cd.setZyBillItem(drug.getZyBillItem()); cd.setMzBillItem(drug.getMzBillItem()); cd.setZyChargeGroup(drug.getZyChargeGroup()); cd.setMzChargeGroup(drug.getMzChargeGroup()); cd.setClassCode(drug.getClassCode()); cd.setExtendCode(drug.getExtendCode()); cd.setSupplyCode(drug.getSupplyCode()); cd.setFrequCode(drug.getFrequCode()); cd.setOrderDosage(drug.getOrderDosage()); cd.setDosageUnit(drug.getDosageUnit()); cd.setBuyPrice(StringUtils.strToBigDecimal(drug.getBuyPrice(), "pe")); cd.setLowdosageFlag(drug.getLowdosageFlag()); cd.setAuditCode(drug.getAuditCode()); cd.setSkinTestFlag(drug.getSkinTestFlag()); cd.setPrintName(drug.getPrintName()); cd.setLicenseNo(drug.getLicenseNo()); cd.setEffMonth(drug.getEffMonth()); cd.setTradMark(drug.getTradMark()); cd.setFuFlag(drug.getFuFlag()); cd.setZySupplyCode(drug.getZySupplyCode()); cd.setZyFrequCode(drug.getZyFrequCode()); cd.setSeqNo(drug.getSeqNo()); cd.setVersionNo(drug.getVersionNo()); cd.setUpdateTime(systemDate); cd.setDeleteFlag(Constants.NO_DELETE_FLAG); cd.setDeleteTime(null); return cd; } @Override public Object getDeleteCodeValue(CodeValueDto codeValue) { Drug drug = (Drug) codeValue; // $Author :tong_meng // $Date : 2012/10/25 15:00$ // [BUG]0010742 MODIFY BEGIN CodeDrug cd = getCDList(drug.getCode(), codeSystem.getCsId(), StringUtils.isEmpty(drug.getSerial()) ? SERIAL_DEFAULT:drug.getSerial()); // [BUG]0010742 MODIFY END cd.setVersionNo(drug.getVersionNo()); cd.setUpdateTime(systemDate); cd.setDeleteFlag(Constants.DELETE_FLAG); cd.setDeleteTime(systemDate); return cd; } // $Author :tong_meng // $Date : 2012/10/25 15:00$ // [BUG]0010742 MODIFY BEGIN private CodeDrug getCDList(String code, BigDecimal csId, String serial) { return dictionaryService.getCDList(code, csId, serial); } // [BUG]0010742 MODIFY END @Override public String getTableName() { return "CODE_DRUG"; } }
[ "149516374@qq.com" ]
149516374@qq.com
3de057784a5bede8d212083441db26ffcd05101d
ef902fa70a6fe591d34c0311bf01f358e4cd7224
/src/pbo2/pkg10118046/latihan54/koordinat/Koordinat.java
528903c79eff7b71ddd1a55be7db1d2017f79896
[]
no_license
hilmynaufal/PBO2-10118046-Latihan54-Koordinat
1765481a85bcb44606d0eab0ecdebd3d6edf6693
7d5c070ecbe28e9b7c50f2f15b4a5854965e2e39
refs/heads/master
2020-09-05T22:48:15.899084
2019-11-07T12:48:30
2019-11-07T12:48:30
220,235,605
0
0
null
null
null
null
UTF-8
Java
false
false
653
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 pbo2.pkg10118046.latihan54.koordinat; /** * * @author ASUS */ public class Koordinat { protected int x, y; public Koordinat(int x, int y) { this.x = x; this.y = y; } public int getX() { return x; } public void setX(int x) { this.x = x; } public int getY() { return y; } public void setY(int y) { this.y = y; } }
[ "noreply@github.com" ]
hilmynaufal.noreply@github.com
d2415d5c20c7c5e546c19fa5d90b9d64f11602f3
a94d20a6346d219c84cc97c9f7913f1ce6aba0f8
/felles/integrasjon/behandleoppgave-klient/src/main/java/no/nav/vedtak/felles/integrasjon/behandleoppgave/BehandleoppgaveSelftestConsumer.java
0795649744480797d3c12d1c79590cfd821893e8
[ "MIT" ]
permissive
junnae/spsak
3c8a155a1bf24c30aec1f2a3470289538c9de086
ede4770de33bd896d62225a9617b713878d1efa5
refs/heads/master
2020-09-11T01:56:53.748986
2019-02-06T08:14:42
2019-02-06T08:14:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
206
java
package no.nav.vedtak.felles.integrasjon.behandleoppgave; import no.nav.vedtak.felles.integrasjon.felles.ws.SelftestConsumer; public interface BehandleoppgaveSelftestConsumer extends SelftestConsumer { }
[ "roy.andre.gundersen@nav.no" ]
roy.andre.gundersen@nav.no
fd8fb61f47ca835f85d75c61143a8b9aee5d6e2b
4e843621e2e171d6e638f96965809141d89082df
/src/main/java/com/leimingtech/service/module/goods/service/impl/GoodsServiceImpl.java
92fb24335f5939d64b9fcf33234f18f7ebc8b8c8
[]
no_license
prajuacj/fnh-new
f00d3385d75e70c3804ada8041e03efee189aed2
17a0a285851d1e8e8ee58b7d09d47456f1430654
refs/heads/master
2021-08-18T16:53:27.953394
2017-11-23T10:27:04
2017-11-23T10:27:04
111,794,953
0
1
null
null
null
null
UTF-8
Java
false
false
11,253
java
package com.leimingtech.service.module.goods.service.impl; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.annotation.Resource; import org.apache.commons.lang3.StringEscapeUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.leimingtech.core.common.Encodes; import com.leimingtech.core.entity.GoodsExcel; import com.leimingtech.core.entity.GoodsSpec; import com.leimingtech.core.entity.base.Goods; import com.leimingtech.core.entity.base.ReserveInfo; import com.leimingtech.core.entity.vo.GoodsAttrVo; import com.leimingtech.core.entity.vo.GoodsSpecVo; import com.leimingtech.core.entity.vo.GoodsTradeVo; import com.leimingtech.core.jackson.JsonUtils; import com.leimingtech.core.state.goods.GoodsState; import com.leimingtech.service.module.goods.dao.GoodsAttrIndexDao; import com.leimingtech.service.module.goods.dao.GoodsDao; import com.leimingtech.service.module.goods.dao.GoodsSpecDao; import com.leimingtech.service.module.goods.dao.GoodsSpecIndexDao; import com.leimingtech.service.module.goods.service.GoodsService; import com.leimingtech.service.module.goods.service.GoodsSpecService; import com.leimingtech.service.module.lucence.service.LucenceService; import com.leimingtech.service.module.search.service.GoodsSearchService; import com.leimingtech.service.module.setting.service.SettingService; import com.leimingtech.service.module.tostatic.service.ToStaticService; import com.leimingtech.service.utils.goods.GoodsUtils; import com.leimingtech.service.utils.page.Pager; import com.leimingtech.service.utils.sessionkey.front.CacheUtils; @Service public class GoodsServiceImpl implements GoodsService { @Resource private GoodsDao goodsDao; @Resource private GoodsSpecDao goodsSpecDao; @Resource private GoodsSpecIndexDao goodsSpecIndexDao; @Resource private GoodsAttrIndexDao goodsAttrIndexDao; @Resource private GoodsSpecService goodsSpecService; @Resource private GoodsSearchService goodsSearchService; @Autowired private ToStaticService toStaticService; @Autowired private SettingService settingService; @Resource private LucenceService lucenceService; public Goods findGoodById(String goodsId) { return goodsDao.findGoodById(goodsId); } public Pager findGoodPagerList(Pager pager) { List<Goods> list = goodsDao.findGoodPagerList(pager); pager.setResult(list); return pager; } public void saveGoods(Goods goods) { goods = enGoods(goods); goods.setCreateTime(System.currentTimeMillis()); goodsDao.saveGoods(goods); } /** * 对商品的个别字段进行解码 * * @param goods * @return */ private Goods enGoods(Goods goods) { goods.setSpecName(Encodes.unescapeHtml(goods.getSpecName())); goods.setGoodsBody(Encodes.unescapeHtml(goods.getGoodsBody())); goods.setGoodsSpec(Encodes.unescapeHtml(goods.getGoodsSpec())); goods.setGoodsAttr(Encodes.unescapeHtml(goods.getGoodsAttr())); goods.setGoodsColImg(Encodes.unescapeHtml(goods.getGoodsColImg())); return goods; } public void updateGoods(Goods goods) { // 获取商品审核状态设置值 Map<String, String> map = settingService.findByNameResultMap("goods_isApply"); // 收藏商品时更新商品的收藏数量 if (goods.getGoodsCollect() != null && (goods.getGoodsCollect() == 1 || goods.getGoodsCollect() == -1)) { goodsDao.updateGoods(goods); } else { int goodsApply = Integer.valueOf(map.get("goods_isApply")); if (0 == goodsApply) { // 审核状态关闭 // 商品状态值 30:审核通过,40:违规下架,50:审核未通过,60:待审核 goods.setGoodsState(GoodsState.GOODS_OPEN_STATE); } else { // 审核状态开启 goods.setGoodsState(GoodsState.GOODS_APPLY_PREPARE); } // 修改上架则增量索引 goods = enGoods(goods); goods.setUpdateTime(System.currentTimeMillis()); goodsDao.updateGoods(goods); // 修改下架等操作,删除索引 if (goods.getGoodsId() != null) { String goodsId = goods.getGoodsId(); // 需要删除索引 lucenceService.deleteOneIndex(goods); // goodsSearchService.deleteGoodsIndex("goodsId",goodsId); // 商品审核通过且上架生成索引 if (goods.getGoodsState() == GoodsState.GOODS_OPEN_STATE && goods.getGoodsShow() == GoodsState.GOODS_ON_SHOW) { // 保存到2涨索引表(goodsAttrIndex&goodsSpecIndex) goodsSearchService.saveOneGoodsIndex(goodsId); } } } } /** * 商品下架,通过商品,拒绝商品 */ public void updateGoodOutEdit(Goods goods) { Integer goodsState = goods.getGoodsState(); if (goodsState != null) { // 审核状态关闭 // 商品状态值 30:审核通过,40:违规下架,50:审核未通过,60:待审核 goods.setGoodsState(goodsState); } // 修改上架则增量索引 goods = enGoods(goods); goodsDao.updateGoods(goods); // 修改下架等操作,删除索引 if (goods.getGoodsId() != null) { String goodsId = goods.getGoodsId(); // 需要删除索引 lucenceService.deleteOneIndex(goods); // goodsSearchService.deleteGoodsIndex("goodsId",goodsId); // 商品审核通过且上架生成索引 if (goods.getGoodsState() == GoodsState.GOODS_OPEN_STATE && goods.getGoodsShow() == GoodsState.GOODS_ON_SHOW) { // 保存到2涨索引表(goodsAttrIndex&goodsSpecIndex) goodsSearchService.saveOneGoodsIndex(goodsId); } } } public void deleteGoods(String goodsId) { // 删除商品表(shop_goods) goodsDao.deleteGoods(goodsId); // lucenceService.deleteOneIndex("goodsId",goodsId); // shop_goods_spec // goodsSpecDao.deleteGoodsSpecByGoodsId(goodsId); // shop_goods_spec_index // goodsSpecIndexDao.deleteByGoodsId(goodsId); // shou_goods_attr_index // goodsAttrIndexDao.deleteByGoodsId(goodsId); // goodsSearchService.deleteGoodsIndex("goodsId",goodsId); // 同时删除索引 lucenceService.deleteOneIndex("goodsId", goodsId); } public Goods findOneGoodByCondition(Goods goods) { return goodsDao.findOneGoodByCondition(goods); } public List<String> getGoodsImgList(String goodsId) { Goods goods = goodsDao.findGoodById(goodsId); List<String> imageList = null; if (goods != null) { if (goods.getGoodsImageMore() != null && !"".equals(goods.getGoodsImageMore())) { imageList = Arrays.asList(goods.getGoodsImageMore().split(",")); } } return imageList; } public Map<String, Object> getGoodsSpec(String goodsId) { Goods goods = goodsDao.findGoodById(goodsId); String goodsSpec = goods.getGoodsSpec(); String specName = goods.getSpecName(); if (specName == null || specName.equals("")) { return null; } Map<String, String> specNameMap = JsonUtils.readJsonToMap(specName); Map<String, List<GoodsSpecVo>> goodsSpecMap = GoodsUtils.goodsSpecStrToMapList(goodsSpec); List<GoodsSpec> goodsSpecs = goodsSpecService.findListByGoodsId(goodsId); // 规格颜色对应的图片 Map<String, String> goodsColImg = GoodsUtils.goodsColImgStrToMap(goods.getGoodsColImg()); // 得到该商品的所有goodsvalueId的String,以逗号分割 for (int i = 0; i < goodsSpecs.size(); i++) { goodsSpecs.get(i) .setSpecValueIdStr(GoodsUtils.getThisGoodsAllSpecValueId(goodsSpecs.get(i).getSpecGoodsSpec())); } Map<String, Object> specmap = new HashMap<String, Object>(); specmap.put("goodsColImg", goodsColImg); specmap.put("specname", specNameMap); specmap.put("specvalue", goodsSpecMap); specmap.put("goodsSpecs", goodsSpecs); return specmap; } public Map<String, Object> getGoodsAttr(String goodsId) { Goods goods = goodsDao.findGoodById(goodsId); String attr = goods.getGoodsAttr(); List<GoodsAttrVo> goodsAttrVos = GoodsUtils.goodsAttrStrToGoodsAttrVoClass(attr); String goodsBody = StringEscapeUtils.unescapeHtml4(goods.getGoodsBody()); Map<String, Object> map = new HashMap<String, Object>(); map.put("goodsattr", goodsAttrVos); map.put("goodsbody", goodsBody); map.put("goodsbrandname", goods.getBrandName()); return map; } public int countGoods(Goods goods) { goods.setCreateTime(System.currentTimeMillis()); return goodsDao.countGoods(goods); } /** * 分页查询获得findTradeGoodlist * * @param pager * @return */ @Override public Pager findTradeGoodPagerList(Pager pager) { List<GoodsTradeVo> list = goodsDao.findTradeGoodPagerList(pager); pager.setResult(list); return pager; } /** * 根据商品字段获取商品的数量 * * @param goodsTradeVo * @return */ @Override public int findTradeGoodcount(GoodsTradeVo goodsTradeVo) { // TODO Auto-generated method stub return goodsDao.findTradeGoodcount(goodsTradeVo); } @Override public void delserchgoods(String storeId) { List<Goods> goodslist = goodsDao.findGoodListbystoreid(storeId); for (Goods goodst : goodslist) { if (goodst.getGoodsId() != null) { Goods goods = new Goods(); goods.setGoodsId(goodst.getGoodsId()); goods.setGoodsState(GoodsState.GOODS_CLOSE_STATE); goods.setGoodsShow(GoodsState.GOODS_OFF_SHOW); goods.setGoodsCloseReason("店铺关闭"); try { updateGoods(goods); } catch (Exception e) { e.printStackTrace(); } } } } @Override public List<Map<String, Object>> countGoodsClick(String storeId) { return goodsDao.countGoodsClick(storeId); } /** * 根据店铺id字段商品 * * @param storeId * @return */ @Override public List<Goods> findGoodListbystoreid(String storeId) { return goodsDao.findGoodListbystoreid(storeId); } @Override public List<GoodsExcel> findGoodListbystoreid2(String storeId) { return goodsDao.findGoodListbystoreid2(storeId); } /** * 根据分类id查询商品 * * @param gcId * @return */ @Override public List<Goods> findGoodListByGcId(String gcId) { return goodsDao.findGoodListByGcId(gcId); } /** * 分页查询获得list sellerApi专用 * * @param pager * @return */ @Override public Pager findGoodPagerListSeller(Pager pager) { List<Goods> list = goodsDao.findGoodPagerListSeller(pager); pager.setResult(list); return pager; } @Override public int saveReserveInfo(ReserveInfo reserveInfo) { return goodsDao.saveReserveInfo(reserveInfo); } @Override public List<ReserveInfo> findReserveByExample(ReserveInfo reserveInfo) { reserveInfo.setPhonecode(CacheUtils.getCacheUser().getMember().getMemberName()); return goodsDao.findReserveByExample(reserveInfo); } @Override public Pager findReserveByPager(Pager pager) { List<ReserveInfo> list = goodsDao.findReserveByPager(pager); pager.setResult(list); return pager; } @Override public int updateReserve(ReserveInfo reserveInfo) { return goodsDao.updateReserveInfo(reserveInfo); } @Override public List<Goods> findStoreByGoodsList(Goods gs) { return goodsDao.findStoreByGoodsList(gs); } @Override public Goods findIdByGoods(String goodsId) { return goodsDao.findIdByGoods(goodsId); } @Override public List<Goods> findFrontGoodList(Goods goods) { return goodsDao.findFrontGoodList(goods); } @Override public List<Goods> findGoodLimitList(Goods goods) { List<Goods> goodsList = goodsDao.findGoodLimitList(goods); return goodsList; } }
[ "prajuacj@163.com" ]
prajuacj@163.com
bf91b8b7b164e841823e7a9a488a386501aa6020
2f7ecc75bc13ef9e49ca1994a84c4400053b08c9
/src/com/javarush/test/level36/lesson04/big01/model/ModelData.java
09924495e1678787029f968e4dd04eab7b4d0692
[]
no_license
BogdanKartawcew/JavaRushHomeWork
d47574392db5c4720245dec08d8ea0b896138402
70bf310ed564293c1855a2650197bff74dce2271
refs/heads/master
2021-01-01T20:22:06.234055
2018-01-30T19:58:33
2018-01-30T19:58:33
80,110,449
1
0
null
null
null
null
UTF-8
Java
false
false
989
java
package com.javarush.test.level36.lesson04.big01.model; import com.javarush.test.level36.lesson04.big01.bean.User; import java.util.List; /** * ModelData - это объект, который будет хранить необходимые данные для отображения на клиенте */ public class ModelData { private List<User> users; private User activeUser; private boolean displayDeletedUserList; public List<User> getUsers() { return users; } public void setUsers(List<User> users) { this.users = users; } public User getActiveUser() { return activeUser; } public void setActiveUser(User activeUser) { this.activeUser = activeUser; } public boolean isDisplayDeletedUserList() { return displayDeletedUserList; } public void setDisplayDeletedUserList(boolean displayDeletedUserList) { this.displayDeletedUserList = displayDeletedUserList; } }
[ "kartawcew.b@gmail.com" ]
kartawcew.b@gmail.com
0d24db25f262bdab3d470ddafcb2d4a0ddbe30ed
187e5404c6f8bcdf0556e11a4f5a59f56f8c2f3e
/src/ch11/DateTimeOperationExam.java
e83bbae0c6d29126168bedc76d1e75e764c22fcd
[]
no_license
snagwuk/JAVA
6e5f751b70de7fdababc7dcad84c412adcccec90
6d583b3b916e8b34666f1ea2bad11de7e9db7e00
refs/heads/master
2022-03-04T22:02:47.031505
2019-11-18T08:09:02
2019-11-18T08:09:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
452
java
package ch11; import java.time.LocalDateTime; public class DateTimeOperationExam { public static void main(String[] args) { // TODO Auto-generated method stub LocalDateTime now = LocalDateTime.now(); System.out.println(now); LocalDateTime tar = now.plusYears(1).plusDays(2).plusHours(3).plusMinutes(4).minusMonths(2).minusWeeks(1); System.out.println(tar); } }
[ "snagwuk@gmail.com" ]
snagwuk@gmail.com
2799ded3800823bcd5f072319d930df79f656707
942a60f08248c7c8a79a26f599446f916894662e
/app/src/main/java/wiwiwi/io/wearwithweather/weather_utils/Weather_Wizard.java
1aef9ed981091134bd7b626f615af291176faab3
[]
no_license
hakanyildiz/WiwiWi
a833e0655b12a2f57745219e12bdbd330a30d4a4
feb8fcfb89f630d9cbff7a97c658ba84e532c693
refs/heads/master
2021-06-08T16:13:49.817815
2016-05-25T15:31:07
2016-05-25T15:31:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
14,831
java
package wiwiwi.io.wearwithweather.weather_utils; import android.util.Log; import java.util.ArrayList; /** * Created by dilkom-hak on 18.05.2016. */ public class Weather_Wizard { private static final String TAG = "Weather"; Advisor my_Advisor; /*CLEAR TYPES */ public static String CLEAR_SKY = "clear sky"; /*RAIN TYPES */ public static String LIGHT_RAIN = "light rain"; public static String MODERATE_RAIN = "moderate rain"; public static String HEAVY_INTENSITY_RAIN = "heavy intensity rain"; public static String VERY_HEAVY_RAIN = "very heavy rain"; public static String EXTREME_RAIN = "extreme rain"; public static String FREEZING_RAIN = "freezing rain"; public static String LIGHT_INTENSITY_SHOWER_RAIN = "light intensity shower rain"; public static String SHOWER_RAIN = "shower rain"; public static String HEAVY_INTENSITY_SHOWER_RAIN = "heavy intensity shower rain"; public static String RAGGED_SHOWER_RAIN = "ragged shower rain"; /* CLOUDS TYPES */ public static String FEW_CLOUDS = "few clouds"; public static String SCATTERED_CLOUDS = "scattered clouds"; public static String BROKEN_CLOUDS = "broken clouds"; public static String OVERCAST_CLOUDS = "overcast clouds"; /* SNOW TYPES */ public static String LIGHT_SNOW = "light snow"; public static String SNOW = "snow"; public static String HEAVY_SNOW = "heavy snow"; public static String SLEET = "sleet"; public static String SHOWER_SLEET = "shower sleet"; public static String LIGHT_RAIN_AND_SNOW = "light rain and snow"; public static String RAIN_AND_SNOW = "rain and snow"; public static String SHOWER_SNOW = "shower snow"; public static String HEAVY_SHOWER_SNOW = "heavy shower snow"; /*THUNDERSTORM TYPES */ public static String THUNDERSTORM_WITH_LIGHT_RAIN = "thunderstorm with light rain"; public static String THUNDERSTORM_WITH_RAIN = "thunderstorm with rain"; public static String THUNDERSTORM_WITH_HEAVY_RAIN = "thunderstorm with heavy rain"; public static String LIGHT_THUNDERSTORM = "light thunderstorm"; public static String THUNDERSTORM = "thunderstorm"; public static String HEAVY_THUNDERSTORM = "heavy thunderstorm"; public static String RAGGED_THUNDERSTORM = "ragged thunderstorm"; public static String THUNDERSTORM_WITH_LIGHT_DRIZZLE = "thunderstorm with light drizzle"; public static String THUNDERSTORM_WITH_DRIZZLE = "thunderstorm with drizzle"; public static String THUNDERSTORM_WITH_HEAVY_DRIZZLE = "thunderstorm with heavy drizzle"; String userGender; Double temperature; String main; String description; public Weather_Wizard(String userGender, Double temperature, String main, String description) { this.userGender = userGender; this.temperature = temperature; this.main = main; this.description = description; } public Advisor Clothes_Advisor(String main) { AdvisorMethods advisorMethods = new AdvisorMethods(); my_Advisor = new Advisor(); Log.d(TAG, "main=" + main); switch (main) { case WeatherTypes.RAIN: Log.d(TAG,"rain"); my_Advisor = advisorMethods.getRainResult(userGender, temperature, description); break; case WeatherTypes.THUNDERSTORM: Log.d(TAG,"rain"); my_Advisor = advisorMethods.getThunderstormResult(userGender, temperature, description); break; case WeatherTypes.ATMOSPHERE: my_Advisor = advisorMethods.getAtmosphereResult(userGender, temperature, description); break; case WeatherTypes.DRIZZLE: my_Advisor = advisorMethods.getDrizzleResult(userGender, temperature, description); break; case WeatherTypes.CLOUDS: Log.d(TAG,"clouds"); my_Advisor = advisorMethods.getCloudsResult(userGender, temperature, description); break; case WeatherTypes.SNOW: my_Advisor = advisorMethods.getSnowResult(userGender, temperature, description); break; case WeatherTypes.CLEAR: Log.d(TAG,"clear"); my_Advisor = advisorMethods.getClearResult(userGender, temperature, description); break; default: Log.d(TAG,"default"); break; } return my_Advisor; } class AdvisorMethods implements AdvisorInterface { private Advisor advisor; private ArrayList<String> clothesList = new ArrayList<>(); private String comment = ""; public AdvisorMethods() { advisor = new Advisor(); } @Override public Advisor getRainResult(String gender, Double temp, String desc) { comment = "Yağmurlu bir hava bizi bekliyor..\n"; //14 derece light rain //12 clothesList.clear(); if(desc.equals(LIGHT_RAIN) || desc.equals(MODERATE_RAIN) || desc.equals(LIGHT_INTENSITY_SHOWER_RAIN)) { if(temp <= 10) { comment += "Hafif bir yağmurla beraber dışarısı soğuk görünüyor. Güzel giyin derim"; clothesList.add(ClothesTypes.INCE_CEKET); clothesList.add(ClothesTypes.INCE_MONT); } else if(temp > 10 && temp <= 18) { comment += "Kıyafetlerimize biraz dikkat etme vakti. Serin olucak"; clothesList.add(ClothesTypes.INCE_CEKET); clothesList.add(ClothesTypes.INCE_MONT); } else if(temp > 18) { clothesList.add(ClothesTypes.SWEATSHIRT); clothesList.add(ClothesTypes.HIRKA); comment += "Yaz yağmuru desek yeridir. İnce bir hırka hiiç fena olmaz "; } } else if(desc.equals(HEAVY_INTENSITY_RAIN) || desc.equals(VERY_HEAVY_RAIN) || desc.equals(EXTREME_RAIN) || desc.equals(SHOWER_RAIN)) { if(temp <= 10) { comment += "Şiddetli bir yağmurla beraber dışarısı soğuk görünüyor. Güzel giyin derim"; clothesList.add(ClothesTypes.INCE_MONT); } else if(temp > 10 && temp <= 18) { comment += "Kıyafetlerimize biraz dikkat etme vakti. Serin olucak"; clothesList.add(ClothesTypes.INCE_CEKET); clothesList.add(ClothesTypes.INCE_MONT); } else if(temp > 18) { clothesList.add(ClothesTypes.SWEATSHIRT); clothesList.add(ClothesTypes.HIRKA); comment += "Yaz yağmuru desek yeridir. İnce bir hırka hiiç fena olmaz "; } } else if(desc.equals(RAGGED_SHOWER_RAIN) || desc.equals(HEAVY_INTENSITY_SHOWER_RAIN) || desc.equals(FREEZING_RAIN)) { comment += "Ben olsam çık abi dışarı. \n Pencere kenarından kahve keyfi misss"; clothesList.add(ClothesTypes.KAHVELI_VE_YAGMURLU); } advisor.setComment(comment); advisor.setClothesList(clothesList); return advisor; } @Override public Advisor getThunderstormResult(String gender, Double temp, String description) { return null; } @Override public Advisor getDrizzleResult(String gender, Double temp, String description) { return null; } @Override public Advisor getSnowResult(String gender, Double temp, String description) { clothesList.clear(); Advisor localAdvisor = new Advisor(); ArrayList<String> localList = new ArrayList<>(); comment = "Winter has already comed."; comment += "Gebereceenn gebereceen. Mont giy mk!"; clothesList.add(ClothesTypes.INCE_CEKET); clothesList.add(ClothesTypes.INCE_MONT); localAdvisor.setClothesList(clothesList); localAdvisor.setComment(comment); return localAdvisor; } @Override public Advisor getAtmosphereResult(String gender, Double temp, String description) { return null; } @Override public Advisor getClearResult(String gender, Double temp, String desc) { Advisor localAdvisor = new Advisor(); ArrayList<String> localList = new ArrayList<>(); Log.d(TAG,"GELEN PARAMETRELER.. gender = " + gender + ", temp:" +temp + ",decritpion = "+ desc ); comment = "Güneşli bir hava bizi bekliyor..\n"; Log.d(TAG,"getClearResult Start"); clothesList.clear(); if(desc.equals(CLEAR_SKY)) { Log.d(TAG,"decs=CLEAR_SKY ı geçtik"); if(temp < 10) { Log.d(TAG,"temp < 10 dan..."); clothesList.add(ClothesTypes.INCE_CEKET); clothesList.add(ClothesTypes.HIRKA); comment += "Ama çokta güneşe aldanma!"; } else if(temp >= 10 && temp <= 16) { if(gender == "Male") { clothesList.add(ClothesTypes.SWEATSHIRT); clothesList.add(ClothesTypes.HIRKA); clothesList.add(ClothesTypes.GOMLEK); } else if(gender == "Female") { clothesList.add(ClothesTypes.SWEATSHIRT); clothesList.add(ClothesTypes.TUNIK); clothesList.add(ClothesTypes.GOMLEK); } comment += "Yavaş yavaş ısınıyoooruz."; } else if(temp > 16 && temp <= 21) { if(gender == "Male") { clothesList.add(ClothesTypes.SWEATSHIRT); clothesList.add(ClothesTypes.TISORT); clothesList.add(ClothesTypes.GOMLEK); } else if(gender == "Female") { clothesList.add(ClothesTypes.GOMLEK); clothesList.add(ClothesTypes.BLUZ); clothesList.add(ClothesTypes.ELBISE); } comment += "Bahar havası, gevşer gönül yayları.."; } else if(temp >= 22 && temp <= 26) { if(gender == "Male") { clothesList.add(ClothesTypes.SWEATSHIRT); clothesList.add(ClothesTypes.TISORT); clothesList.add(ClothesTypes.SORT); } else if(gender == "Female") { clothesList.add(ClothesTypes.TISORT); clothesList.add(ClothesTypes.BLUZ); clothesList.add(ClothesTypes.ELBISE); } comment += "Sıcak çok sıcak, sıcak daha da sıcak olucaaak"; } else // > 30 { if(gender == "Male") { clothesList.add(ClothesTypes.TISORT); clothesList.add(ClothesTypes.SORT); } else if(gender == "Female") { clothesList.add(ClothesTypes.ELBISE); clothesList.add(ClothesTypes.ETEK); clothesList.add(ClothesTypes.BLUZ); } comment += "Aman Allah'ım! Dışarısı yanıyoor"; } } Log.d(TAG, "comment =>" +comment); Log.d(TAG, "clothes list =>" +clothesList); localAdvisor.setComment(comment); localAdvisor.setClothesList(clothesList); return localAdvisor; } @Override public Advisor getCloudsResult(String gender, Double temp, String desc) { comment = "Bulut mu o?\n"; Advisor localAdvisor = new Advisor(); ArrayList<String> localList = new ArrayList<>(); Log.d(TAG,"CLOUDS GELEN PARAMETRELER.. gender = " + gender + ", temp:" +temp + ",decritpion = "+ desc ); clothesList.clear(); if(desc.equals(FEW_CLOUDS)) { comment += "Az bulutlu, hatta bulutcuk :)"; if(gender == "Male") { clothesList.add(ClothesTypes.SORT); clothesList.add(ClothesTypes.TISORT); } else { clothesList.add(ClothesTypes.TISORT); clothesList.add(ClothesTypes.ETEK); clothesList.add(ClothesTypes.ELBISE); } } else if(desc.equals(SCATTERED_CLOUDS)) { comment += "Eveet, hemde parçalı bulutlu. Gökyüzü bi başka güzel oluyor"; if(gender == "Male") { clothesList.add(ClothesTypes.GOMLEK); clothesList.add(ClothesTypes.TISORT); } else { clothesList.add(ClothesTypes.ELBISE); clothesList.add(ClothesTypes.TISORT); } } else if(desc.equals(BROKEN_CLOUDS) || desc.equals(OVERCAST_CLOUDS)) { comment += "omg! bulut cümbüşü vaaaar"; if(gender == "Male") { clothesList.add(ClothesTypes.SWEATSHIRT); clothesList.add(ClothesTypes.INCE_CEKET); clothesList.add(ClothesTypes.GOMLEK); } else { clothesList.add(ClothesTypes.SWEATSHIRT); clothesList.add(ClothesTypes.HIRKA); clothesList.add(ClothesTypes.GOMLEK); } } localAdvisor.setComment(comment); localAdvisor.setClothesList(clothesList); return localAdvisor; } } }
[ "hakanhknyldz@gmail.com" ]
hakanhknyldz@gmail.com
ff9e4d59bfea71f7a285a65526c51046bc9d9c04
675e2ceae02eaa7c8d1a39cebbeb46655df086be
/src/Graph.java
70298f41ca1382cabf8e349ae1103529b6008540
[]
no_license
hennessytj/Shortest-Path
1ce8b27dcff0493a2df5f2d9bfc69e069f7253f3
6ffa2e8869c93d93e8b4a6afce7b31950608ccb2
refs/heads/master
2021-01-13T11:41:12.185256
2017-01-01T02:19:39
2017-01-01T02:19:39
77,762,907
0
0
null
null
null
null
UTF-8
Java
false
false
1,934
java
import edu.princeton.cs.algs4.In; import edu.princeton.cs.algs4.StdOut; public class Graph { // state private final int V; private int E; Bag[] adjList; public Graph(int v) { V = v; E = 0; adjList = new Bag[V]; for (int i = 0; i < V; i++) adjList[i] = new Bag(); } public Graph(In in) { V = in.readInt(); E = in.readInt(); adjList = new Bag[V]; for (int i = 0; i < V; i++) adjList[i] = new Bag(); int n = E; for (int i = 0; i < n; i++) { int vertex1 = in.readInt(); int vertex2 = in.readInt(); addEdge(vertex1, vertex2); } } public int numOfVertices() { return V; } public int numOfEdges() { return E; } public void addEdge(int v, int w) { adjList[v].insert(w); adjList[w].insert(v); E++; } public Queue<Integer> adjacentVertices(int v) { return adjList[v].getSet(); } public static void main(String[] args) { Graph g = new Graph(new In("/Users/Hennessy/Graph Algorithms/Graph Data Types/Undirected/data/largeG.txt")); StdOut.println(g.numOfVertices()); StdOut.println(g.numOfEdges()); //g.printGraph(); Queue<Integer> adjVQ = g.adjacentVertices(0); StdOut.print("Adjacent Vertices incident to 0: "); while (!adjVQ.isEmpty()) { int adjVertex = adjVQ.dequeue(); StdOut.print(adjVertex + " "); } StdOut.println(); } /* Methods for testing */ public void printAdjacentVertices(int v) { System.out.print(v + ": "); adjList[v].print(); } public void printGraph() { for (int v = 0; v < V; v++) printAdjacentVertices(v); } }
[ "timothy.hennessy23@gmail.com" ]
timothy.hennessy23@gmail.com
ef923e10b23f22c375e06f3ee85e045610d89d48
8c59db74c9e10d611769f90d6bfd149be787f4a7
/DiceGame/src/hw2/TimidPlayer.java
9c089a8fc22b1fbef48864d4559e3c34ebdee382
[]
no_license
syoun0620/Object-Oriented-Design-Course-Projects
952af57b3c937cd17a58a13dfae6756bc568f4d0
e68613256b3939ce55c59190a8952bdca19ca2a7
refs/heads/master
2021-04-30T12:49:43.635273
2018-02-18T21:56:37
2018-02-18T21:56:37
121,282,410
0
0
null
null
null
null
UTF-8
Java
false
false
607
java
package hw2; public class TimidPlayer implements Player { private int numChip; private int playerId; public TimidPlayer(int i){ this.playerId = i; this.numChip = 0; } public boolean decide(int maxChipAmongPlayers, int chipsInPot){ // true - if keep going. false - if stop and take the pot. return false; // always return false for TimidPlayer. } public int getChip(){ return this.numChip; } public void addChip(int n){ this.numChip += n; } public int getPlayerId(){ return this.playerId; } public String toString(){ return this.playerId + ":" + this.numChip + " "; } }
[ "younsa@bc.edu" ]
younsa@bc.edu
f080c14e21b62b9ac8a708b0ea3460bb67d60e92
8f70415ad5be4e0f372973189a866ed6fb087c41
/app/src/main/java/com/carzis/util/custom/view/TroubleTypeBtn.java
cec2564f6761200a8b3300734a5443a4c379c938
[]
no_license
matvapps/OBDProject
7f25d12243bac1e1ac64d64ffebbf385e4035e44
4715c4b14e0eeec13d13228795626b5dce761938
refs/heads/master
2021-07-09T11:35:03.142122
2019-02-06T19:56:10
2019-02-06T19:56:10
133,265,637
1
0
null
null
null
null
UTF-8
Java
false
false
2,717
java
package com.carzis.util.custom.view; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Color; import android.graphics.drawable.Drawable; import android.support.v4.content.ContextCompat; import android.text.TextUtils; import android.util.AttributeSet; import android.view.LayoutInflater; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import com.carzis.R; /** * Created by Alexandr. */ public class TroubleTypeBtn extends LinearLayout { private TextView textView; private ImageView imageView; private ImageView background; private String textStr; private boolean useBtnImage; private boolean enabled; public TroubleTypeBtn(Context context) { this(context, null); } public TroubleTypeBtn(Context context, AttributeSet attrs) { this(context, attrs, 0); } public TroubleTypeBtn(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); LayoutInflater.from(context).inflate(R.layout.btn_trouble_type, this, true); textView = findViewById(R.id.text); imageView = findViewById(R.id.image); background = findViewById(R.id.background); textView.setAllCaps(true); TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TroubleTypeBtn); textStr = a.getString(R.styleable.TroubleTypeBtn_btnText); useBtnImage = a.getBoolean(R.styleable.TroubleTypeBtn_useBtnImage, true); if (useBtnImage) imageView.setVisibility(VISIBLE); else imageView.setVisibility(GONE); final Drawable drawable = a.getDrawable(R.styleable.TroubleTypeBtn_btnImage); if (drawable != null) { imageView.setImageDrawable(drawable); } if (!TextUtils.isEmpty(textStr)) { textView.setText(textStr); } setDefaults(); a.recycle(); } public void setDefaults() { enabled = false; background .setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.light_gray_field_background)); imageView.setAlpha(0.6f); textView.setTextColor(Color.GRAY); } public void setSelected(boolean selected) { if (selected) { enabled = true; background.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.button_blue_rect_selector)); imageView.setAlpha(1f); textView.setTextColor(Color.WHITE); } else { setDefaults(); } } public boolean isSelected() { return enabled; } }
[ "alex____98@hotmail.com" ]
alex____98@hotmail.com
c9a33ad2da1a349d2ef03bc1f1c30b06042ee841
4934772a2f4d004c2c351ee30a561682e2c4d695
/09-JPA-ChaveComposta/src/br/com/fiap/tds/exercicio/entity/NanoCourse.java
d7de954d82b31d15cc70e57531f63b2ae9ea5339
[]
no_license
GarciaGP/2021-1-Semestre-2TDSR
f0f544e9432de8f2d14d8a0dfabeba4fc55628d4
7f3992b0e8351df13b24b90b199a5367eb2de383
refs/heads/main
2023-05-05T15:44:06.462453
2021-05-26T01:56:14
2021-05-26T01:56:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
965
java
package br.com.fiap.tds.exercicio.entity; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.SequenceGenerator; import javax.persistence.Table; @Entity @Table(name="TB_NANO_COURSE") @SequenceGenerator(name="nano", sequenceName = "SQ_TB_NANO_COURSE", allocationSize = 1) public class NanoCourse { @Id @Column(name="cd_course") @GeneratedValue(generator = "nano", strategy = GenerationType.SEQUENCE) private int codigo; @Column(name="nm_course", nullable = false, length = 80) private String nome; public NanoCourse() {} public NanoCourse(String nome) { this.nome = nome; } public int getCodigo() { return codigo; } public void setCodigo(int codigo) { this.codigo = codigo; } public String getNome() { return nome; } public void setNome(String nome) { this.nome = nome; } }
[ "thiagoyama@Thiagos-MacBook-Pro.local" ]
thiagoyama@Thiagos-MacBook-Pro.local
aba51a654dba0cf2fa0e86e677ac5b59c2cf9e48
165a6bd97e53b135a709d38132e2207bc806d185
/DonationApp/app/src/main/java/edu/vcu/cmsc/softwareengineering/donationapp/MoreInfo.java
35ec64731a0f103f1c4e14716d1276199247aaa1
[]
no_license
spiersmm/CMSC-355-Donation-App
e62b84a542b2c02b2cee3cbb3ab839000c5422b2
699bdfddb5eec15f9f724715c7fe428c1b25a05f
refs/heads/master
2022-12-14T20:24:30.801945
2020-08-22T01:11:53
2020-08-22T01:11:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,678
java
package edu.vcu.cmsc.softwareengineering.donationapp; import android.content.Intent; import android.os.Bundle; import android.widget.ImageView; import android.widget.TextView; import androidx.appcompat.app.AppCompatActivity; import com.squareup.picasso.Picasso; public class MoreInfo extends AppCompatActivity { String editDescription, editCategory, editDelivery, editCondition, editQuantity, editImage; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_more_info); Intent intent = getIntent(); editDescription = intent.getStringExtra("description"); editCategory = intent.getStringExtra("category"); editDelivery = intent.getStringExtra("delivery"); editCondition = intent.getStringExtra("condition"); editQuantity = intent.getStringExtra("quantity"); editImage = intent.getStringExtra("image"); ImageView image = findViewById(R.id.imageViewMoreInfo); Picasso.get().load(editImage).into(image); TextView descriptionView = findViewById(R.id.textViewDescription); TextView categoryView = findViewById(R.id.textViewCategory); TextView conditionView = findViewById(R.id.textViewCondition); TextView deliveryView = findViewById(R.id.textViewDelivery); TextView quantityView = findViewById(R.id.textViewQuantity); descriptionView.setText(editDescription); categoryView.setText(editCategory); conditionView.setText(editCondition); deliveryView.setText(editDelivery); quantityView.setText(editQuantity); } }
[ "caadzima@gmail.com" ]
caadzima@gmail.com
afa3330f6b45a0c39f100f3d9ad92aab4dd0730e
20eb62855cb3962c2d36fda4377dfd47d82eb777
/newEvaluatedBugs/Jsoup_40_buggy/mutated/190/Whitelist.java
b84dfd2aa52e3d7f8ad237311f050c0d066060a0
[]
no_license
ozzydong/CapGen
356746618848065cce4e253e5d3c381baa85044a
0ba0321b6b1191443276021f1997833342f02515
refs/heads/master
2023-03-18T20:12:02.923428
2020-08-21T03:08:28
2020-08-21T03:08:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
16,963
java
package org.jsoup.safety; /* Thank you to Ryan Grove (wonko.com) for the Ruby HTML cleaner http://github.com/rgrove/sanitize/, which inspired this whitelist configuration, and the initial defaults. */ import org.jsoup.helper.Validate; import org.jsoup.nodes.Attribute; import org.jsoup.nodes.Attributes; import org.jsoup.nodes.Element; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; /** Whitelists define what HTML (elements and attributes) to allow through the cleaner. Everything else is removed. <p/> Start with one of the defaults: <ul> <li>{@link #none} <li>{@link #simpleText} <li>{@link #basic} <li>{@link #basicWithImages} <li>{@link #relaxed} </ul> <p/> If you need to allow more through (please be careful!), tweak a base whitelist with: <ul> <li>{@link #addTags} <li>{@link #addAttributes} <li>{@link #addEnforcedAttribute} <li>{@link #addProtocols} </ul> <p/> The cleaner and these whitelists assume that you want to clean a <code>body</code> fragment of HTML (to add user supplied HTML into a templated page), and not to clean a full HTML document. If the latter is the case, either wrap the document HTML around the cleaned body HTML, or create a whitelist that allows <code>html</code> and <code>head</code> elements as appropriate. <p/> If you are going to extend a whitelist, please be very careful. Make sure you understand what attributes may lead to XSS attack vectors. URL attributes are particularly vulnerable and require careful validation. See http://ha.ckers.org/xss.html for some XSS attack examples. @author Jonathan Hedley */ public class Whitelist { private Set<TagName> tagNames; // tags allowed, lower case. e.g. [p, br, span] private Map<TagName, Set<AttributeKey>> attributes; // tag -> attribute[]. allowed attributes [href] for a tag. private Map<TagName, Map<AttributeKey, AttributeValue>> enforcedAttributes; // always set these attribute values private Map<TagName, Map<AttributeKey, Set<Protocol>>> protocols; // allowed URL protocols for attributes private boolean preserveRelativeLinks; // option to preserve relative links /** This whitelist allows only text nodes: all HTML will be stripped. @return whitelist */ public static Whitelist none() { return new Whitelist(); } /** This whitelist allows only simple text formatting: <code>b, em, i, strong, u</code>. All other HTML (tags and attributes) will be removed. @return whitelist */ public static Whitelist simpleText() { return new Whitelist() .addTags("b", "em", "i", "strong", "u") ; } /** This whitelist allows a fuller range of text nodes: <code>a, b, blockquote, br, cite, code, dd, dl, dt, em, i, li, ol, p, pre, q, small, strike, strong, sub, sup, u, ul</code>, and appropriate attributes. <p/> Links (<code>a</code> elements) can point to <code>http, https, ftp, mailto</code>, and have an enforced <code>rel=nofollow</code> attribute. <p/> Does not allow images. @return whitelist */ public static Whitelist basic() { return new Whitelist() .addTags( "a", "b", "blockquote", "br", "cite", "code", "dd", "dl", "dt", "em", "i", "li", "ol", "p", "pre", "q", "small", "strike", "strong", "sub", "sup", "u", "ul") .addAttributes("a", "href") .addAttributes("blockquote", "cite") .addAttributes("q", "cite") .addProtocols("a", "href", "ftp", "http", "https", "mailto") .addProtocols("blockquote", "cite", "http", "https") .addProtocols("cite", "cite", "http", "https") .addEnforcedAttribute("a", "rel", "nofollow") ; } /** This whitelist allows the same text tags as {@link #basic}, and also allows <code>img</code> tags, with appropriate attributes, with <code>src</code> pointing to <code>http</code> or <code>https</code>. @return whitelist */ public static Whitelist basicWithImages() { return basic() .addTags("img") .addAttributes("img", "align", "alt", "height", "src", "title", "width") .addProtocols("img", "src", "http", "https") ; } /** This whitelist allows a full range of text and structural body HTML: <code>a, b, blockquote, br, caption, cite, code, col, colgroup, dd, dl, dt, em, h1, h2, h3, h4, h5, h6, i, img, li, ol, p, pre, q, small, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, u, ul</code> <p/> Links do not have an enforced <code>rel=nofollow</code> attribute, but you can add that if desired. @return whitelist */ public static Whitelist relaxed() { return new Whitelist() .addTags( "a", "b", "blockquote", "br", "caption", "cite", "code", "col", "colgroup", "dd", "div", "dl", "dt", "em", "h1", "h2", "h3", "h4", "h5", "h6", "i", "img", "li", "ol", "p", "pre", "q", "small", "strike", "strong", "sub", "sup", "table", "tbody", "td", "tfoot", "th", "thead", "tr", "u", "ul") .addAttributes("a", "href", "title") .addAttributes("blockquote", "cite") .addAttributes("col", "span", "width") .addAttributes("colgroup", "span", "width") .addAttributes("img", "align", "alt", "height", "src", "title", "width") .addAttributes("ol", "start", "type") .addAttributes("q", "cite") .addAttributes("table", "summary", "width") .addAttributes("td", "abbr", "axis", "colspan", "rowspan", "width") .addAttributes( "th", "abbr", "axis", "colspan", "rowspan", "scope", "width") .addAttributes("ul", "type") .addProtocols("a", "href", "ftp", "http", "https", "mailto") .addProtocols("blockquote", "cite", "http", "https") .addProtocols("img", "src", "http", "https") .addProtocols("q", "cite", "http", "https") ; } /** Create a new, empty whitelist. Generally it will be better to start with a default prepared whitelist instead. @see #basic() @see #basicWithImages() @see #simpleText() @see #relaxed() */ public Whitelist() { tagNames = new HashSet<TagName>(); attributes = new HashMap<TagName, Set<AttributeKey>>(); enforcedAttributes = new HashMap<TagName, Map<AttributeKey, AttributeValue>>(); protocols = new HashMap<TagName, Map<AttributeKey, Set<Protocol>>>(); preserveRelativeLinks = false; } /** Add a list of allowed elements to a whitelist. (If a tag is not allowed, it will be removed from the HTML.) @param tags tag names to allow @return this (for chaining) */ public Whitelist addTags(String... tags) { Validate.notNull(tags); for (String tagName : tags) { Validate.notEmpty(tagName); tagNames.add(TagName.valueOf(tagName)); } return this; } /** Add a list of allowed attributes to a tag. (If an attribute is not allowed on an element, it will be removed.) <p/> E.g.: <code>addAttributes("a", "href", "class")</code> allows <code>href</code> and <code>class</code> attributes on <code>a</code> tags. <p/> To make an attribute valid for <b>all tags</b>, use the pseudo tag <code>:all</code>, e.g. <code>addAttributes(":all", "class")</code>. @param tag The tag the attributes are for. The tag will be added to the allowed tag list if necessary. @param keys List of valid attributes for the tag @return this (for chaining) */ public Whitelist addAttributes(String tag, String... keys) { Validate.notEmpty(this.value); Validate.notNull(keys); Validate.isTrue(keys.length > 0, "No attributes supplied."); TagName tagName = TagName.valueOf(tag); if (!tagNames.contains(tagName)) tagNames.add(tagName); Set<AttributeKey> attributeSet = new HashSet<AttributeKey>(); for (String key : keys) { Validate.notEmpty(key); attributeSet.add(AttributeKey.valueOf(key)); } if (attributes.containsKey(tagName)) { Set<AttributeKey> currentSet = attributes.get(tagName); currentSet.addAll(attributeSet); } else { attributes.put(tagName, attributeSet); } return this; } /** Add an enforced attribute to a tag. An enforced attribute will always be added to the element. If the element already has the attribute set, it will be overridden. <p/> E.g.: <code>addEnforcedAttribute("a", "rel", "nofollow")</code> will make all <code>a</code> tags output as <code>&lt;a href="..." rel="nofollow"></code> @param tag The tag the enforced attribute is for. The tag will be added to the allowed tag list if necessary. @param key The attribute key @param value The enforced attribute value @return this (for chaining) */ public Whitelist addEnforcedAttribute(String tag, String key, String value) { Validate.notEmpty(tag); Validate.notEmpty(key); Validate.notEmpty(value); TagName tagName = TagName.valueOf(tag); if (!tagNames.contains(tagName)) tagNames.add(tagName); AttributeKey attrKey = AttributeKey.valueOf(key); AttributeValue attrVal = AttributeValue.valueOf(value); if (enforcedAttributes.containsKey(tagName)) { enforcedAttributes.get(tagName).put(attrKey, attrVal); } else { Map<AttributeKey, AttributeValue> attrMap = new HashMap<AttributeKey, AttributeValue>(); attrMap.put(attrKey, attrVal); enforcedAttributes.put(tagName, attrMap); } return this; } /** * Configure this Whitelist to preserve relative links in an element's URL attribute, or convert them to absolute * links. By default, this is <b>false</b>: URLs will be made absolute (e.g. start with an allowed protocol, like * e.g. {@code http://}. * <p /> * Note that when handling relative links, the input document must have an appropriate {@code base URI} set when * parsing, so that the link's protocol can be confirmed. Regardless of the setting of the {@code preserve relative * links} option, the link must be resolvable against the base URI to an allowed protocol; otherwise the attribute * will be removed. * * @param preserve {@code true} to allow relative links, {@code false} (default) to deny * @return this Whitelist, for chaining. * @see #addProtocols */ public Whitelist preserveRelativeLinks(boolean preserve) { preserveRelativeLinks = preserve; return this; } /** Add allowed URL protocols for an element's URL attribute. This restricts the possible values of the attribute to URLs with the defined protocol. <p/> E.g.: <code>addProtocols("a", "href", "ftp", "http", "https")</code> @param tag Tag the URL protocol is for @param key Attribute key @param protocols List of valid protocols @return this, for chaining */ public Whitelist addProtocols(String tag, String key, String... protocols) { Validate.notEmpty(tag); Validate.notEmpty(key); Validate.notNull(protocols); TagName tagName = TagName.valueOf(tag); AttributeKey attrKey = AttributeKey.valueOf(key); Map<AttributeKey, Set<Protocol>> attrMap; Set<Protocol> protSet; if (this.protocols.containsKey(tagName)) { attrMap = this.protocols.get(tagName); } else { attrMap = new HashMap<AttributeKey, Set<Protocol>>(); this.protocols.put(tagName, attrMap); } if (attrMap.containsKey(attrKey)) { protSet = attrMap.get(attrKey); } else { protSet = new HashSet<Protocol>(); attrMap.put(attrKey, protSet); } for (String protocol : protocols) { Validate.notEmpty(protocol); Protocol prot = Protocol.valueOf(protocol); protSet.add(prot); } return this; } boolean isSafeTag(String tag) { return tagNames.contains(TagName.valueOf(tag)); } boolean isSafeAttribute(String tagName, Element el, Attribute attr) { TagName tag = TagName.valueOf(tagName); AttributeKey key = AttributeKey.valueOf(attr.getKey()); if (attributes.containsKey(tag)) { if (attributes.get(tag).contains(key)) { if (protocols.containsKey(tag)) { Map<AttributeKey, Set<Protocol>> attrProts = protocols.get(tag); // ok if not defined protocol; otherwise test return !attrProts.containsKey(key) || testValidProtocol(el, attr, attrProts.get(key)); } else { // attribute found, no protocols defined, so OK return true; } } } // no attributes defined for tag, try :all tag return !tagName.equals(":all") && isSafeAttribute(":all", el, attr); } private boolean testValidProtocol(Element el, Attribute attr, Set<Protocol> protocols) { // try to resolve relative urls to abs, and optionally update the attribute so output html has abs. // rels without a baseuri get removed String value = el.absUrl(attr.getKey()); if (value.length() == 0) value = attr.getValue(); // if it could not be made abs, run as-is to allow custom unknown protocols if (!preserveRelativeLinks) attr.setValue(value); for (Protocol protocol : protocols) { String prot = protocol.toString() + ":"; if (value.toLowerCase().startsWith(prot)) { return true; } } return false; } Attributes getEnforcedAttributes(String tagName) { Attributes attrs = new Attributes(); TagName tag = TagName.valueOf(tagName); if (enforcedAttributes.containsKey(tag)) { Map<AttributeKey, AttributeValue> keyVals = enforcedAttributes.get(tag); for (Map.Entry<AttributeKey, AttributeValue> entry : keyVals.entrySet()) { attrs.put(entry.getKey().toString(), entry.getValue().toString()); } } return attrs; } // named types for config. All just hold strings, but here for my sanity. static class TagName extends TypedValue { TagName(String value) { super(value); } static TagName valueOf(String value) { return new TagName(value); } } static class AttributeKey extends TypedValue { AttributeKey(String value) { super(value); } static AttributeKey valueOf(String value) { return new AttributeKey(value); } } static class AttributeValue extends TypedValue { AttributeValue(String value) { super(value); } static AttributeValue valueOf(String value) { return new AttributeValue(value); } } static class Protocol extends TypedValue { Protocol(String value) { super(value); } static Protocol valueOf(String value) { return new Protocol(value); } } abstract static class TypedValue { private String value; TypedValue(String value) { Validate.notNull(value); this.value = value; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((value == null) ? 0 : value.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; TypedValue other = (TypedValue) obj; if (value == null) { if (other.value != null) return false; } else if (!value.equals(other.value)) return false; return true; } @Override public String toString() { return value; } } }
[ "justinwm@163.com" ]
justinwm@163.com
67778c4ef501d9c463910a05cf1d492d48f28430
e750bb7b34dd0681713e34f4fd40548d92b350fb
/bikeshare/src/com/lyd/bikeEntity/LimiteRole.java
ee8a08803dfc65bbdd9e17aa3997ffe9912d43d8
[]
no_license
leiyide/bike_sharing
c66804670771667085b3d1c80b9071636860de3a
b8307725b72cb910602aee760be1729cdef2b6ef
refs/heads/master
2020-04-18T00:46:52.978695
2019-01-23T01:23:32
2019-01-23T01:23:32
167,091,113
0
0
null
null
null
null
UTF-8
Java
false
false
755
java
package com.lyd.bikeEntity; public class LimiteRole { private Integer limiteRoleId; private Integer columnId; private Integer employeeRank; private Integer userRank; public Integer getLimiteRoleId() { return limiteRoleId; } public void setLimiteRoleId(Integer limiteRoleId) { this.limiteRoleId = limiteRoleId; } public Integer getColumnId() { return columnId; } public void setColumnId(Integer columnId) { this.columnId = columnId; } public Integer getEmployeeRank() { return employeeRank; } public void setEmployeeRank(Integer employeeRank) { this.employeeRank = employeeRank; } public Integer getUserRank() { return userRank; } public void setUserRank(Integer userRank) { this.userRank = userRank; } }
[ "1026938865@qq.com" ]
1026938865@qq.com
51d814fd8a0598d2b8f6dd7139332899ef85a592
2b76e890d6a2072b61227958f1618d3690cb316f
/src/test/java/com/github/koraktor/mavanagaiata/mojo/AbstractGitOutputMojoTest.java
53cc21ef6ed445a9f181e6b1c6dfeef9d69d7f68
[ "BSD-3-Clause" ]
permissive
deepeshtelkar/mavanagaiata
045284018a5ea0b9204cb0c6ef6b56cde415eebc
0ea0c31164d3d06446b10331ab66128e5e50aa04
refs/heads/master
2021-07-08T22:32:06.617677
2017-10-06T20:24:23
2017-10-06T20:24:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,123
java
/* * This code is free software; you can redistribute it and/or modify it under * the terms of the new BSD License. * * Copyright (c) 2012-2016, Sebastian Staudt */ package com.github.koraktor.mavanagaiata.mojo; import java.io.File; import java.io.FileNotFoundException; import java.io.PrintStream; import org.junit.Before; import org.junit.Test; import com.github.koraktor.mavanagaiata.git.GitRepository; import static org.hamcrest.core.Is.is; import static org.hamcrest.core.IsEqual.equalTo; import static org.hamcrest.core.IsInstanceOf.instanceOf; import static org.hamcrest.core.IsNull.nullValue; import static org.junit.Assert.assertThat; import static org.junit.Assert.fail; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; public class AbstractGitOutputMojoTest extends MojoAbstractTest<AbstractGitOutputMojo> { private GenericAbstractGitOutputMojo genericMojo() { return (GenericAbstractGitOutputMojo) mojo; } @Before @Override public void setup() { mojo = new GenericAbstractGitOutputMojo(); mojo.dateFormat = "MM/dd/yyyy hh:mm a Z"; mojo.footer = ""; } @Test public void testInitStdout() throws Exception { mojo.setOutputFile(null); mojo.run(repository); assertThat(genericMojo().printStream, is(System.out)); } @Test public void testInitOutputFile() throws Exception { File outputFile = mock(File.class); File parentFile = mock(File.class); when(parentFile.exists()).thenReturn(true); when(parentFile.isDirectory()).thenReturn(true); when(outputFile.getParentFile()).thenReturn(parentFile); PrintStream printStream = mock(PrintStream.class); mojo = spy(mojo); doReturn(printStream).when(mojo).createPrintStream(); this.mojo.encoding = "someencoding"; this.mojo.setOutputFile(outputFile); this.mojo.run(repository); assertThat(genericMojo().printStream, is(printStream)); } @Test public void testInitOutputFileCreateDirectories() throws Exception { File outputFile = mock(File.class); File parentFile = mock(File.class); when(parentFile.exists()).thenReturn(false); when(parentFile.mkdirs()).thenReturn(true); when(outputFile.getParentFile()).thenReturn(parentFile); PrintStream printStream = mock(PrintStream.class); mojo = spy(mojo); doReturn(printStream).when(mojo).createPrintStream(); mojo.encoding = "someencoding"; mojo.setOutputFile(outputFile); mojo.run(repository); assertThat(((GenericAbstractGitOutputMojo) mojo).printStream, is(printStream)); } @Test public void testInitOutputFileCreateDirectoriesFailed() throws Exception { File outputFile = mock(File.class); File parentFile = mock(File.class); when(parentFile.exists()).thenReturn(false); when(parentFile.getAbsolutePath()).thenReturn("/some"); when(parentFile.mkdirs()).thenReturn(false); when(outputFile.getParentFile()).thenReturn(parentFile); PrintStream printStream = mock(PrintStream.class); mojo = spy(mojo); doReturn(printStream).when(mojo).createPrintStream(); mojo.encoding = "someencoding"; mojo.setOutputFile(outputFile); try { mojo.run(repository); } catch (Exception e) { assertThat(e, is(instanceOf(MavanagaiataMojoException.class))); assertThat(e.getMessage(), is(equalTo("Could not create directory \"/some\" for output file."))); assertThat(e.getCause(), is(nullValue())); } } @Test public void testInitOutputFileException() throws Exception { FileNotFoundException fileNotFoundException = mock(FileNotFoundException.class); File outputFile = mock(File.class); when(outputFile.getAbsolutePath()).thenReturn("/some/file"); File parentFile = mock(File.class); when(parentFile.exists()).thenReturn(true); when(outputFile.getParentFile()).thenReturn(parentFile); mojo = spy(mojo); doThrow(fileNotFoundException).when(mojo).createPrintStream(); this.mojo.encoding = "someencoding"; this.mojo.setOutputFile(outputFile); try { mojo.run(repository); fail("No exception thrown."); } catch (Exception e) { assertThat(e, is(instanceOf(MavanagaiataMojoException.class))); assertThat(e.getMessage(), is(equalTo("Could not open output file \"/some/file\" for writing."))); assertThat(e.getCause(), is((Throwable) fileNotFoundException)); } } @Test public void testGenerateOutputWithFooter() throws MavanagaiataMojoException { PrintStream printStream = mock(PrintStream.class); this.mojo.footer = "Test footer"; this.mojo.generateOutput(repository, printStream); verify(printStream).println("Test footer"); verify(printStream).flush(); } @Test public void testGenerateOutputWithoutFooter() throws MavanagaiataMojoException { PrintStream printStream = mock(PrintStream.class); mojo.generateOutput(repository, printStream); verify(printStream, never()).println(); verify(printStream).flush(); } class GenericAbstractGitOutputMojo extends AbstractGitOutputMojo { File outputFile; PrintStream printStream; public File getOutputFile() { return this.outputFile; } public void setOutputFile(File outputFile) { this.outputFile = outputFile; } protected void writeOutput(GitRepository repository, PrintStream printStream) throws MavanagaiataMojoException { this.printStream = printStream; } } }
[ "koraktor@gmail.com" ]
koraktor@gmail.com
69cbb53239be60af09be36548e1a74f67a00bd7f
dd50689f2b35073cab1b177edb28f04987d056fc
/src/main/java/com/wynprice/secretroomsmod/intergration/jei/energizedpaste/EnergizedPasteRecipe.java
c0032a16c4537cc31f099d3e36f27f59ea446e41
[]
no_license
MrDiamond123/SecretRoomsMod-forge
1a7f4a5a2cbd34936ad4e02d6eb7b8b23746de5b
406d8c1f2a58a998c2ae599f276c18a2dbaf02fb
refs/heads/master
2021-01-22T20:49:31.574671
2018-01-28T16:08:24
2018-01-28T16:08:24
85,363,597
0
0
null
2018-01-28T16:08:25
2017-03-17T23:45:47
Java
UTF-8
Java
false
false
1,089
java
package com.wynprice.secretroomsmod.intergration.jei.energizedpaste; import java.util.ArrayList; import java.util.List; import com.google.common.collect.Lists; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.item.ItemStack; public class EnergizedPasteRecipe { private final ArrayList<ItemStack> inputs; private final ItemStack output; private final TextureAtlasSprite backgroundSprite; public EnergizedPasteRecipe(ItemStack input1, ItemStack input2, ItemStack input3, ItemStack input4, ItemStack input5, ItemStack output, TextureAtlasSprite backgroundSprite) { inputs = Lists.newArrayList(input1, input2, input3, input4, input5); this.output = output; this.backgroundSprite = backgroundSprite; } public ItemStack getOutput() { return output; } public List<List<ItemStack>> getInputs() { List<List<ItemStack>> list = new ArrayList<>(); for(ItemStack stack : this.inputs) list.add(Lists.newArrayList(stack)); return list; } public TextureAtlasSprite getBackgroundSprite() { return backgroundSprite; } }
[ "noreply@github.com" ]
MrDiamond123.noreply@github.com
a45ebbaa970552a42870e4226196199856c480da
9f032033d7c47f0443d918795ebc819ec33e0f13
/management/src/main/java/com/kid/chinese/util/FuturesQuoteDecoder.java
c226628b7bc02851fd93400d437b65e3726ededd
[]
no_license
xiaowulf/management
887f82893dae8a506a1ae026aa06ecab3b84d1c9
37d8d6c95d5df5a0b46d698ecfa9524427943988
refs/heads/master
2022-12-22T11:53:44.084293
2020-04-09T05:59:45
2020-04-09T05:59:45
249,591,651
0
0
null
2022-12-16T10:02:39
2020-03-24T02:16:37
CSS
UTF-8
Java
false
false
844
java
package com.kid.chinese.util; import javax.websocket.DecodeException; import javax.websocket.EndpointConfig; import com.google.gson.Gson; import com.kid.chinese.vo.FuturesQuoteVO; import com.alibaba.fastjson.JSON; public class FuturesQuoteDecoder implements javax.websocket.Decoder.Text<FuturesQuoteVO>{ @Override public void init(EndpointConfig config) { // TODO Auto-generated method stub } @Override public void destroy() { // TODO Auto-generated method stub } @Override public FuturesQuoteVO decode(String futuresQuoteVO) throws DecodeException { Gson gson = new Gson(); return gson.fromJson(futuresQuoteVO, FuturesQuoteVO.class); //return JSON.parseObject(futuresQuoteVO, FuturesQuoteDecoder.class); } @Override public boolean willDecode(String s) { return true; } }
[ "Administrator@5EK7BPA2DXTNCJK.local" ]
Administrator@5EK7BPA2DXTNCJK.local
910baed0a3036fd1234e013fea8203c7f1a4e157
2fca8dbb1890e2956ab25835e1695595b1d3aa3a
/app/src/main/java/com/app/huawei/overlay/ZoomImageView.java
96e78b92855a119b231919a4cad85778ade6c80f
[]
no_license
scrumML/MyHmsTest-ing
46b60850e706da7878db6db72e67cd7c4a1d7f2e
37af182f63625fc67400ab51727d3b1f8dc1da15
refs/heads/master
2022-11-30T19:41:17.726194
2020-08-12T10:31:31
2020-08-12T10:31:31
286,550,806
0
1
null
2020-08-12T11:24:24
2020-08-10T18:30:22
Java
UTF-8
Java
false
false
47,227
java
/** * Copyright 2020 https://github.com/MikeOrtiz/TouchImageView * * Licensed under the MIT License; * you may not use this file except in compliance with the License. * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, publish, distribute, * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * The above copyright notice and this permission notice shall be included in all copies or * substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE */ package com.app.huawei.overlay; import android.annotation.SuppressLint; import android.annotation.TargetApi; import android.content.Context; import android.content.res.Configuration; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Matrix; import android.graphics.PointF; import android.graphics.RectF; import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Build.VERSION; import android.os.Build.VERSION_CODES; import android.os.Bundle; import android.os.Parcelable; import android.util.AttributeSet; import android.view.GestureDetector; import android.view.MotionEvent; import android.view.ScaleGestureDetector; import android.view.View; import android.view.animation.AccelerateDecelerateInterpolator; import android.widget.ImageView; import android.widget.OverScroller; import android.widget.Scroller; @SuppressLint("AppCompatCustomView") public class ZoomImageView extends ImageView { private static final String DEBUG = "DEBUG"; // // SuperMin and SuperMax multipliers. Determine how much the image can be // zoomed below or above the zoom boundaries, before animating back to the // min/max zoom boundary. // private static final float SUPER_MIN_MULTIPLIER = 0.75f; private static final float SUPER_MAX_MULTIPLIER = 1.25f; // // Scale of image ranges from minScale to maxScale, where minScale == 1 // when the image is stretched to fit view. // private float normalizedScale; // // Matrix applied to image. MSCALE_X and MSCALE_Y should always be equal. // MTRANS_X and MTRANS_Y are the other values used. prevMatrix is the matrix // saved prior to the screen rotating. // private Matrix matrix, prevMatrix; private enum State {NONE, DRAG, ZOOM, FLING, ANIMATE_ZOOM} private State state; private float minScale; private float maxScale; private float superMinScale; private float superMaxScale; private float[] m; private Context context; private Fling fling; private ScaleType mScaleType; private boolean imageRenderedAtLeastOnce; private boolean onDrawReady; private ZoomVariables delayedZoomVariables; // // Size of view and previous view size (ie before rotation) // private int viewWidth, viewHeight, prevViewWidth, prevViewHeight; // // Size of image when it is stretched to fit view. Before and After rotation. // private float matchViewWidth, matchViewHeight, prevMatchViewWidth, prevMatchViewHeight; private ScaleGestureDetector mScaleDetector; private GestureDetector mGestureDetector; private GestureDetector.OnDoubleTapListener doubleTapListener = null; private OnTouchListener userTouchListener = null; private OnTouchImageViewListener touchImageViewListener = null; public ZoomImageView(Context context) { this(context, null); } public ZoomImageView(Context context, AttributeSet attrs) { this(context, attrs, 0); } public ZoomImageView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); this.configureImageView(context); } private void configureImageView(Context context) { this.context = context; super.setClickable(true); this.mScaleDetector = new ScaleGestureDetector(context, new ScaleListener()); this.mGestureDetector = new GestureDetector(context, new GestureListener()); this.matrix = new Matrix(); this.prevMatrix = new Matrix(); this.m = new float[9]; this.normalizedScale = 1; if (this.mScaleType == null) { this.mScaleType = ScaleType.FIT_CENTER; } this.minScale = 1; this.maxScale = 3; this.superMinScale = ZoomImageView.SUPER_MIN_MULTIPLIER * this.minScale; this.superMaxScale = ZoomImageView.SUPER_MAX_MULTIPLIER * this.maxScale; this.setImageMatrix(this.matrix); this.setScaleType(ScaleType.MATRIX); this.setState(State.NONE); this.onDrawReady = false; super.setOnTouchListener(new PrivateOnTouchListener()); } @Override public void setOnTouchListener(OnTouchListener l) { this.userTouchListener = l; } public void setOnTouchImageViewListener(OnTouchImageViewListener l) { this.touchImageViewListener = l; } public void setOnDoubleTapListener(GestureDetector.OnDoubleTapListener l) { this.doubleTapListener = l; } @Override public void setImageResource(int resId) { this.imageRenderedAtLeastOnce = false; super.setImageResource(resId); this.savePreviousImageValues(); this.fitImageToView(); } @Override public void setImageBitmap(Bitmap bm) { this.imageRenderedAtLeastOnce = false; super.setImageBitmap(bm); this.savePreviousImageValues(); this.fitImageToView(); } @Override public void setImageDrawable(Drawable drawable) { this.imageRenderedAtLeastOnce = false; super.setImageDrawable(drawable); this.savePreviousImageValues(); this.fitImageToView(); } @Override public void setImageURI(Uri uri) { this.imageRenderedAtLeastOnce = false; super.setImageURI(uri); this.savePreviousImageValues(); this.fitImageToView(); } @Override public void setScaleType(ScaleType type) { if (type == ScaleType.MATRIX) { super.setScaleType(ScaleType.MATRIX); } else { this.mScaleType = type; if (this.onDrawReady) { // // If the image is already rendered, scaleType has been called programmatically // and the TouchImageView should be updated with the new scaleType. // this.setZoom(this); } } } @Override public ScaleType getScaleType() { return this.mScaleType; } /** * Returns false if image is in initial, unzoomed state. False, otherwise. * * @return true if image is zoomed */ public boolean isZoomed() { return this.normalizedScale != 1; } /** * Return a Rect representing the zoomed image. * * @return rect representing zoomed image */ public RectF getZoomedRect() { if (this.mScaleType == ScaleType.FIT_XY) { throw new UnsupportedOperationException("getZoomedRect() not supported with FIT_XY"); } PointF topLeft = this.transformCoordTouchToBitmap(0, 0, true); PointF bottomRight = this.transformCoordTouchToBitmap(this.viewWidth, this.viewHeight, true); float w = this.getDrawable().getIntrinsicWidth(); float h = this.getDrawable().getIntrinsicHeight(); return new RectF(topLeft.x / w, topLeft.y / h, bottomRight.x / w, bottomRight.y / h); } /** * Save the current matrix and view dimensions * in the prevMatrix and prevView variables. */ public void savePreviousImageValues() { if (this.matrix != null && this.viewHeight != 0 && this.viewWidth != 0) { this.matrix.getValues(this.m); this.prevMatrix.setValues(this.m); this.prevMatchViewHeight = this.matchViewHeight; this.prevMatchViewWidth = this.matchViewWidth; this.prevViewHeight = this.viewHeight; this.prevViewWidth = this.viewWidth; } } @Override public Parcelable onSaveInstanceState() { Bundle bundle = new Bundle(); bundle.putParcelable("instanceState", super.onSaveInstanceState()); bundle.putFloat("saveScale", this.normalizedScale); bundle.putFloat("matchViewHeight", this.matchViewHeight); bundle.putFloat("matchViewWidth", this.matchViewWidth); bundle.putInt("viewWidth", this.viewWidth); bundle.putInt("viewHeight", this.viewHeight); this.matrix.getValues(this.m); bundle.putFloatArray("matrix", this.m); bundle.putBoolean("imageRendered", this.imageRenderedAtLeastOnce); return bundle; } @Override public void onRestoreInstanceState(Parcelable state) { if (state instanceof Bundle) { Bundle bundle = (Bundle) state; this.normalizedScale = bundle.getFloat("saveScale"); this.m = bundle.getFloatArray("matrix"); this.prevMatrix.setValues(this.m); this.prevMatchViewHeight = bundle.getFloat("matchViewHeight"); this.prevMatchViewWidth = bundle.getFloat("matchViewWidth"); this.prevViewHeight = bundle.getInt("viewHeight"); this.prevViewWidth = bundle.getInt("viewWidth"); this.imageRenderedAtLeastOnce = bundle.getBoolean("imageRendered"); super.onRestoreInstanceState(bundle.getParcelable("instanceState")); return; } super.onRestoreInstanceState(state); } @Override protected void onDraw(Canvas canvas) { this.onDrawReady = true; this.imageRenderedAtLeastOnce = true; if (this.delayedZoomVariables != null) { this.setZoom(this.delayedZoomVariables.scale, this.delayedZoomVariables.focusX, this.delayedZoomVariables.focusY, this.delayedZoomVariables.scaleType); this.delayedZoomVariables = null; } super.onDraw(canvas); } @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); this.savePreviousImageValues(); } /** * Get the max zoom multiplier. * * @return max zoom multiplier. */ public float getMaxZoom() { return this.maxScale; } /** * Set the max zoom multiplier. Default value: 3. * * @param max max zoom multiplier. */ public void setMaxZoom(float max) { this.maxScale = max; this.superMaxScale = ZoomImageView.SUPER_MAX_MULTIPLIER * this.maxScale; } /** * Get the min zoom multiplier. * * @return min zoom multiplier. */ public float getMinZoom() { return this.minScale; } /** * Get the current zoom. This is the zoom relative to the initial * scale, not the original resource. * * @return current zoom multiplier. */ public float getCurrentZoom() { return this.normalizedScale; } /** * Set the min zoom multiplier. Default value: 1. * * @param min min zoom multiplier. */ public void setMinZoom(float min) { this.minScale = min; this.superMinScale = ZoomImageView.SUPER_MIN_MULTIPLIER * this.minScale; } /** * Reset zoom and translation to initial state. */ public void resetZoom() { this.normalizedScale = 1; this.fitImageToView(); } /** * Set zoom to the specified scale. Image will be centered by default. * * @param scale */ public void setZoom(float scale) { this.setZoom(scale, 0.5f, 0.5f); } /** * Set zoom to the specified scale. Image will be centered around the point * (focusX, focusY). These floats range from 0 to 1 and denote the focus point * as a fraction from the left and top of the view. For example, the top left * corner of the image would be (0, 0). And the bottom right corner would be (1, 1). * * @param scale * @param focusX * @param focusY */ public void setZoom(float scale, float focusX, float focusY) { this.setZoom(scale, focusX, focusY, this.mScaleType); } /** * Set zoom to the specified scale. Image will be centered around the point * (focusX, focusY). These floats range from 0 to 1 and denote the focus point * as a fraction from the left and top of the view. For example, the top left * corner of the image would be (0, 0). And the bottom right corner would be (1, 1). * * @param scale * @param focusX * @param focusY * @param scaleType */ public void setZoom(float scale, float focusX, float focusY, ScaleType scaleType) { // // setZoom can be called before the image is on the screen, but at this point, // image and view sizes have not yet been calculated in onMeasure. Thus, we should // delay calling setZoom until the view has been measured. // if (!this.onDrawReady) { this.delayedZoomVariables = new ZoomVariables(scale, focusX, focusY, scaleType); return; } if (scaleType != this.mScaleType) { this.setScaleType(scaleType); } this.resetZoom(); this.scaleImage(scale, this.viewWidth / 2.0f, this.viewHeight / 2.0f, true); this.matrix.getValues(this.m); this.m[Matrix.MTRANS_X] = -((focusX * this.getImageWidth()) - (this.viewWidth * 0.5f)); this.m[Matrix.MTRANS_Y] = -((focusY * this.getImageHeight()) - (this.viewHeight * 0.5f)); this.matrix.setValues(this.m); this.fixTrans(); this.setImageMatrix(this.matrix); } /** * Set zoom parameters equal to another TouchImageView. Including scale, position, * and ScaleType. * * @param img */ public void setZoom(ZoomImageView img) { PointF center = img.getScrollPosition(); this.setZoom(img.getCurrentZoom(), center.x, center.y, img.getScaleType()); } /** * Return the point at the center of the zoomed image. The PointF coordinates range * in value between 0 and 1 and the focus point is denoted as a fraction from the left * and top of the view. For example, the top left corner of the image would be (0, 0). * And the bottom right corner would be (1, 1). * * @return PointF representing the scroll position of the zoomed image. */ public PointF getScrollPosition() { Drawable drawable = this.getDrawable(); if (drawable == null) { return null; } int drawableWidth = drawable.getIntrinsicWidth(); int drawableHeight = drawable.getIntrinsicHeight(); PointF point = this.transformCoordTouchToBitmap(this.viewWidth / 2.0f, this.viewHeight / 2.0f, true); point.x /= drawableWidth; point.y /= drawableHeight; return point; } /** * Set the focus point of the zoomed image. The focus points are denoted as a fraction from the * left and top of the view. The focus points can range in value between 0 and 1. * * @param focusX * @param focusY */ public void setScrollPosition(float focusX, float focusY) { this.setZoom(this.normalizedScale, focusX, focusY); } /** * Performs boundary checking and fixes the image matrix if it * is out of bounds. */ private void fixTrans() { this.matrix.getValues(this.m); float transX = this.m[Matrix.MTRANS_X]; float transY = this.m[Matrix.MTRANS_Y]; float fixTransX = this.getFixTrans(transX, this.viewWidth, this.getImageWidth()); float fixTransY = this.getFixTrans(transY, this.viewHeight, this.getImageHeight()); if (fixTransX != 0 || fixTransY != 0) { this.matrix.postTranslate(fixTransX, fixTransY); } } /** * When transitioning from zooming from focus to zoom from center (or vice versa) * the image can become unaligned within the view. This is apparent when zooming * quickly. When the content size is less than the view size, the content will often * be centered incorrectly within the view. fixScaleTrans first calls fixTrans() and * then makes sure the image is centered correctly within the view. */ private void fixScaleTrans() { this.fixTrans(); this.matrix.getValues(this.m); if (this.getImageWidth() < this.viewWidth) { this.m[Matrix.MTRANS_X] = (this.viewWidth - this.getImageWidth()) / 2; } if (this.getImageHeight() < this.viewHeight) { this.m[Matrix.MTRANS_Y] = (this.viewHeight - this.getImageHeight()) / 2; } this.matrix.setValues(this.m); } private float getFixTrans(float trans, float viewSize, float contentSize) { float minTrans, maxTrans; if (contentSize <= viewSize) { minTrans = 0; maxTrans = viewSize - contentSize; } else { minTrans = viewSize - contentSize; maxTrans = 0; } if (trans < minTrans) { return -trans + minTrans; } if (trans > maxTrans) { return -trans + maxTrans; } return 0; } private float getFixDragTrans(float delta, float viewSize, float contentSize) { if (contentSize <= viewSize) { return 0; } return delta; } private float getImageWidth() { return this.matchViewWidth * this.normalizedScale; } private float getImageHeight() { return this.matchViewHeight * this.normalizedScale; } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { Drawable drawable = this.getDrawable(); if (drawable == null || drawable.getIntrinsicWidth() == 0 || drawable.getIntrinsicHeight() == 0) { this.setMeasuredDimension(0, 0); return; } int drawableWidth = drawable.getIntrinsicWidth(); int drawableHeight = drawable.getIntrinsicHeight(); int widthSize = MeasureSpec.getSize(widthMeasureSpec); int widthMode = MeasureSpec.getMode(widthMeasureSpec); int heightSize = MeasureSpec.getSize(heightMeasureSpec); int heightMode = MeasureSpec.getMode(heightMeasureSpec); int totalViewWidth = this.setViewSize(widthMode, widthSize, drawableWidth); int totalViewHeight = this.setViewSize(heightMode, heightSize, drawableHeight); // Image view width, height must consider padding this.viewWidth = totalViewWidth - this.getPaddingLeft() - this.getPaddingRight(); this.viewHeight = totalViewHeight - this.getPaddingTop() - this.getPaddingBottom(); // // Set view dimensions // this.setMeasuredDimension(this.viewWidth, this.viewHeight); // // Fit content within view // this.fitImageToView(); } /** * If the normalizedScale is equal to 1, then the image is made to fit the screen. Otherwise, * it is made to fit the screen according to the dimensions of the previous image matrix. This * allows the image to maintain its zoom after rotation. */ private void fitImageToView() { Drawable drawable = this.getDrawable(); if (drawable == null || drawable.getIntrinsicWidth() == 0 || drawable.getIntrinsicHeight() == 0) { return; } if (this.matrix == null || this.prevMatrix == null) { return; } int drawableWidth = drawable.getIntrinsicWidth(); int drawableHeight = drawable.getIntrinsicHeight(); // // Scale image for view // float scaleX = this.viewWidth / (float) drawableWidth; float scaleY = this.viewHeight / (float) drawableHeight; switch (this.mScaleType) { case CENTER: scaleX = scaleY = 1; break; case CENTER_CROP: scaleX = scaleY = Math.max(scaleX, scaleY); break; case CENTER_INSIDE: scaleX = scaleY = Math.min(1, Math.min(scaleX, scaleY)); case FIT_CENTER: // fall-through case FIT_START: // fall-through case FIT_END: scaleX = scaleY = Math.min(scaleX, scaleY); break; case FIT_XY: break; default: } // // Center the image // float redundantXSpace = this.viewWidth - (scaleX * drawableWidth); float redundantYSpace = this.viewHeight - (scaleY * drawableHeight); this.matchViewWidth = this.viewWidth - redundantXSpace; this.matchViewHeight = this.viewHeight - redundantYSpace; if (!this.isZoomed() && !this.imageRenderedAtLeastOnce) { // // Stretch and center image to fit view // this.matrix.setScale(scaleX, scaleY); switch (this.mScaleType) { case FIT_START: this.matrix.postTranslate(0, 0); break; case FIT_END: this.matrix.postTranslate(redundantXSpace, redundantYSpace); break; default: this.matrix.postTranslate(redundantXSpace / 2.0f, redundantYSpace / 2.0f); } this.normalizedScale = 1; } else { // // These values should never be 0 or we will set viewWidth and viewHeight // to NaN in translateMatrixAfterRotate. To avoid this, call savePreviousImageValues // to set them equal to the current values. // // if (prevMatchViewWidth == 0 || prevMatchViewHeight == 0) { this.savePreviousImageValues(); // } this.prevMatrix.getValues(this.m); // // Rescale Matrix after rotation // this.m[Matrix.MSCALE_X] = this.matchViewWidth / drawableWidth * this.normalizedScale; this.m[Matrix.MSCALE_Y] = this.matchViewHeight / drawableHeight * this.normalizedScale; // // TransX and TransY from previous matrix // float transX = this.m[Matrix.MTRANS_X]; float transY = this.m[Matrix.MTRANS_Y]; // // Width // float prevActualWidth = this.prevMatchViewWidth * this.normalizedScale; float actualWidth = this.getImageWidth(); this.translateMatrixAfterRotate(Matrix.MTRANS_X, transX, prevActualWidth, actualWidth, this.prevViewWidth, this.viewWidth, drawableWidth); // // Height // float prevActualHeight = this.prevMatchViewHeight * this.normalizedScale; float actualHeight = this.getImageHeight(); this.translateMatrixAfterRotate(Matrix.MTRANS_Y, transY, prevActualHeight, actualHeight, this.prevViewHeight, this.viewHeight, drawableHeight); // // Set the matrix to the adjusted scale and translate values. // this.matrix.setValues(this.m); } this.fixTrans(); this.setImageMatrix(this.matrix); } /** * Set view dimensions based on layout params * * @param mode * @param size * @param drawableWidth * @return */ private int setViewSize(int mode, int size, int drawableWidth) { int viewSize; switch (mode) { case MeasureSpec.EXACTLY: viewSize = size; break; case MeasureSpec.AT_MOST: viewSize = Math.min(drawableWidth, size); break; case MeasureSpec.UNSPECIFIED: viewSize = drawableWidth; break; default: viewSize = size; break; } return viewSize; } /** * After rotating, the matrix needs to be translated. This function finds the area of image * which was previously centered and adjusts translations so that is again the center, post-rotation. * * @param axis Matrix.MTRANS_X or Matrix.MTRANS_Y * @param trans the value of trans in that axis before the rotation * @param prevImageSize the width/height of the image before the rotation * @param imageSize width/height of the image after rotation * @param prevViewSize width/height of view before rotation * @param viewSize width/height of view after rotation * @param drawableSize width/height of drawable */ private void translateMatrixAfterRotate(int axis, float trans, float prevImageSize, float imageSize, int prevViewSize, int viewSize, int drawableSize) { if (imageSize < viewSize) { // // The width/height of image is less than the view's width/height. Center it. // this.m[axis] = (viewSize - (drawableSize * this.m[Matrix.MSCALE_X])) * 0.5f; } else if (trans > 0) { // // The image is larger than the view, but was not before rotation. Center it. // this.m[axis] = -((imageSize - viewSize) * 0.5f); } else { // // Find the area of the image which was previously centered in the view. Determine its distance // from the left/top side of the view as a fraction of the entire image's width/height. Use that percentage // to calculate the trans in the new view width/height. // float percentage = (Math.abs(trans) + (0.5f * prevViewSize)) / prevImageSize; this.m[axis] = -((percentage * imageSize) - (viewSize * 0.5f)); } } private void setState(State state) { this.state = state; } public boolean canScrollHorizontallyFroyo(int direction) { return this.canScrollHorizontally(direction); } @Override public boolean canScrollHorizontally(int direction) { this.matrix.getValues(this.m); float x = this.m[Matrix.MTRANS_X]; if (this.getImageWidth() < this.viewWidth) { return false; } else if (x >= -1 && direction < 0) { return false; } else { return !(Math.abs(x) + this.viewWidth + 1 >= this.getImageWidth()) || direction <= 0; } } @Override public boolean canScrollVertically(int direction) { this.matrix.getValues(this.m); float y = this.m[Matrix.MTRANS_Y]; if (this.getImageHeight() < this.viewHeight) { return false; } else if (y >= -1 && direction < 0) { return false; } else { return !(Math.abs(y) + this.viewHeight + 1 >= this.getImageHeight()) || direction <= 0; } } private class GestureListener extends GestureDetector.SimpleOnGestureListener { @Override public boolean onSingleTapConfirmed(MotionEvent e) { if (ZoomImageView.this.doubleTapListener != null) { return ZoomImageView.this.doubleTapListener.onSingleTapConfirmed(e); } return ZoomImageView.this.performClick(); } @Override public void onLongPress(MotionEvent e) { ZoomImageView.this.performLongClick(); } @Override public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { if (ZoomImageView.this.fling != null) { // // If a previous fling is still active, it should be cancelled so that two flings // are not run simultaenously. // ZoomImageView.this.fling.cancelFling(); } ZoomImageView.this.fling = new Fling((int) velocityX, (int) velocityY); ZoomImageView.this.compatPostOnAnimation(ZoomImageView.this.fling); return super.onFling(e1, e2, velocityX, velocityY); } @Override public boolean onDoubleTap(MotionEvent e) { boolean consumed = false; if (ZoomImageView.this.doubleTapListener != null) { consumed = ZoomImageView.this.doubleTapListener.onDoubleTap(e); } if (ZoomImageView.this.state == State.NONE) { float targetZoom = (Math.abs(ZoomImageView.this.normalizedScale - ZoomImageView.this.minScale) < 0.00001f) ? ZoomImageView.this.maxScale : ZoomImageView.this.minScale; DoubleTapZoom doubleTap = new DoubleTapZoom(targetZoom, e.getX(), e.getY(), false); ZoomImageView.this.compatPostOnAnimation(doubleTap); consumed = true; } return consumed; } @Override public boolean onDoubleTapEvent(MotionEvent e) { if (ZoomImageView.this.doubleTapListener != null) { return ZoomImageView.this.doubleTapListener.onDoubleTapEvent(e); } return false; } } public interface OnTouchImageViewListener { void onMove(); } private class PrivateOnTouchListener implements OnTouchListener { // // Remember last point position for dragging // private PointF last = new PointF(); @Override public boolean onTouch(View v, MotionEvent event) { ZoomImageView.this.mScaleDetector.onTouchEvent(event); ZoomImageView.this.mGestureDetector.onTouchEvent(event); PointF curr = new PointF(event.getX(), event.getY()); if (ZoomImageView.this.state == State.NONE || ZoomImageView.this.state == State.DRAG || ZoomImageView.this.state == State.FLING) { switch (event.getAction()) { case MotionEvent.ACTION_DOWN: this.last.set(curr); if (ZoomImageView.this.fling != null) { ZoomImageView.this.fling.cancelFling(); } ZoomImageView.this.setState(State.DRAG); break; case MotionEvent.ACTION_MOVE: if (ZoomImageView.this.state == State.DRAG) { float deltaX = curr.x - this.last.x; float deltaY = curr.y - this.last.y; float fixTransX = ZoomImageView.this.getFixDragTrans(deltaX, ZoomImageView.this.viewWidth, ZoomImageView.this.getImageWidth()); float fixTransY = ZoomImageView.this.getFixDragTrans(deltaY, ZoomImageView.this.viewHeight, ZoomImageView.this.getImageHeight()); ZoomImageView.this.matrix.postTranslate(fixTransX, fixTransY); ZoomImageView.this.fixTrans(); this.last.set(curr.x, curr.y); } break; case MotionEvent.ACTION_UP: case MotionEvent.ACTION_POINTER_UP: ZoomImageView.this.setState(State.NONE); break; default: break; } } ZoomImageView.this.setImageMatrix(ZoomImageView.this.matrix); // // User-defined OnTouchListener // if (ZoomImageView.this.userTouchListener != null) { ZoomImageView.this.userTouchListener.onTouch(v, event); } // // OnTouchImageViewListener is set: TouchImageView dragged by user. // if (ZoomImageView.this.touchImageViewListener != null) { ZoomImageView.this.touchImageViewListener.onMove(); } // // indicate event was handled // return true; } } private class ScaleListener extends ScaleGestureDetector.SimpleOnScaleGestureListener { @Override public boolean onScaleBegin(ScaleGestureDetector detector) { ZoomImageView.this.setState(State.ZOOM); return true; } @Override public boolean onScale(ScaleGestureDetector detector) { ZoomImageView.this.scaleImage(detector.getScaleFactor(), detector.getFocusX(), detector.getFocusY(), true); // // OnTouchImageViewListener is set: TouchImageView pinch zoomed by user. // if (ZoomImageView.this.touchImageViewListener != null) { ZoomImageView.this.touchImageViewListener.onMove(); } return true; } @Override public void onScaleEnd(ScaleGestureDetector detector) { super.onScaleEnd(detector); ZoomImageView.this.setState(State.NONE); boolean animateToZoomBoundary = false; float targetZoom = ZoomImageView.this.normalizedScale; if (ZoomImageView.this.normalizedScale > ZoomImageView.this.maxScale) { targetZoom = ZoomImageView.this.maxScale; animateToZoomBoundary = true; } else if (ZoomImageView.this.normalizedScale < ZoomImageView.this.minScale) { targetZoom = ZoomImageView.this.minScale; animateToZoomBoundary = true; } if (animateToZoomBoundary) { DoubleTapZoom doubleTap = new DoubleTapZoom(targetZoom, ZoomImageView.this.viewWidth / 2.0f, ZoomImageView.this.viewHeight / 2.0f, true); ZoomImageView.this.compatPostOnAnimation(doubleTap); } } } private void scaleImage(double deltaScale, float focusX, float focusY, boolean stretchImageToSuper) { float lowerScale, upperScale; if (stretchImageToSuper) { lowerScale = this.superMinScale; upperScale = this.superMaxScale; } else { lowerScale = this.minScale; upperScale = this.maxScale; } float origScale = this.normalizedScale; this.normalizedScale *= deltaScale; if (this.normalizedScale > upperScale) { this.normalizedScale = upperScale; deltaScale = upperScale / origScale; } else if (this.normalizedScale < lowerScale) { this.normalizedScale = lowerScale; deltaScale = lowerScale / origScale; } this.matrix.postScale((float) deltaScale, (float) deltaScale, focusX, focusY); this.fixScaleTrans(); } private class DoubleTapZoom implements Runnable { private long startTime; private static final float ZOOM_TIME = 500; private float startZoom, targetZoom; private float bitmapX, bitmapY; private boolean stretchImageToSuper; private AccelerateDecelerateInterpolator interpolator = new AccelerateDecelerateInterpolator(); private PointF startTouch; private PointF endTouch; DoubleTapZoom(float targetZoom, float focusX, float focusY, boolean stretchImageToSuper) { ZoomImageView.this.setState(State.ANIMATE_ZOOM); this.startTime = System.currentTimeMillis(); this.startZoom = ZoomImageView.this.normalizedScale; this.targetZoom = targetZoom; this.stretchImageToSuper = stretchImageToSuper; PointF bitmapPoint = ZoomImageView.this.transformCoordTouchToBitmap(focusX, focusY, false); this.bitmapX = bitmapPoint.x; this.bitmapY = bitmapPoint.y; // // Used for translating image during scaling // this.startTouch = ZoomImageView.this.transformCoordBitmapToTouch(this.bitmapX, this.bitmapY); this.endTouch = new PointF(ZoomImageView.this.viewWidth / 2.0f, ZoomImageView.this.viewHeight / 2.0f); } @Override public void run() { float t = this.interpolate(); double deltaScale = this.calculateDeltaScale(t); ZoomImageView.this.scaleImage(deltaScale, this.bitmapX, this.bitmapY, this.stretchImageToSuper); this.translateImageToCenterTouchPosition(t); ZoomImageView.this.fixScaleTrans(); ZoomImageView.this.setImageMatrix(ZoomImageView.this.matrix); // // OnTouchImageViewListener is set: double tap runnable updates listener // with every frame. // if (ZoomImageView.this.touchImageViewListener != null) { ZoomImageView.this.touchImageViewListener.onMove(); } if (t < 1f) { // // We haven't finished zooming // ZoomImageView.this.compatPostOnAnimation(this); } else { // // Finished zooming // ZoomImageView.this.setState(State.NONE); } } /** * Interpolate between where the image should start and end in order to translate * the image so that the point that is touched is what ends up centered at the end * of the zoom. * * @param t */ private void translateImageToCenterTouchPosition(float t) { float targetX = this.startTouch.x + t * (this.endTouch.x - this.startTouch.x); float targetY = this.startTouch.y + t * (this.endTouch.y - this.startTouch.y); PointF curr = ZoomImageView.this.transformCoordBitmapToTouch(this.bitmapX, this.bitmapY); ZoomImageView.this.matrix.postTranslate(targetX - curr.x, targetY - curr.y); } /** * Use interpolator to get t * * @return */ private float interpolate() { long currTime = System.currentTimeMillis(); float elapsed = (currTime - this.startTime) / DoubleTapZoom.ZOOM_TIME; elapsed = Math.min(1f, elapsed); return this.interpolator.getInterpolation(elapsed); } /** * Interpolate the current targeted zoom and get the delta * from the current zoom. * * @param t * @return */ private double calculateDeltaScale(float t) { double zoom = this.startZoom + t * (this.targetZoom - this.startZoom); return zoom / ZoomImageView.this.normalizedScale; } } /** * This function will transform the coordinates in the touch event to the coordinate * system of the drawable that the imageview contain * * @param x x-coordinate of touch event * @param y y-coordinate of touch event * @param clipToBitmap Touch event may occur within view, but outside image content. True, to clip return value * to the bounds of the bitmap size. * @return Coordinates of the point touched, in the coordinate system of the original drawable. */ private PointF transformCoordTouchToBitmap(float x, float y, boolean clipToBitmap) { this.matrix.getValues(this.m); float origW = this.getDrawable().getIntrinsicWidth(); float origH = this.getDrawable().getIntrinsicHeight(); float transX = this.m[Matrix.MTRANS_X]; float transY = this.m[Matrix.MTRANS_Y]; float finalX = ((x - transX) * origW) / this.getImageWidth(); float finalY = ((y - transY) * origH) / this.getImageHeight(); if (clipToBitmap) { finalX = Math.min(Math.max(finalX, 0), origW); finalY = Math.min(Math.max(finalY, 0), origH); } return new PointF(finalX, finalY); } /** * Inverse of transformCoordTouchToBitmap. This function will transform the coordinates in the * drawable's coordinate system to the view's coordinate system. * * @param bx x-coordinate in original bitmap coordinate system * @param by y-coordinate in original bitmap coordinate system * @return Coordinates of the point in the view's coordinate system. */ private PointF transformCoordBitmapToTouch(float bx, float by) { this.matrix.getValues(this.m); float origW = this.getDrawable().getIntrinsicWidth(); float origH = this.getDrawable().getIntrinsicHeight(); float px = bx / origW; float py = by / origH; float finalX = this.m[Matrix.MTRANS_X] + this.getImageWidth() * px; float finalY = this.m[Matrix.MTRANS_Y] + this.getImageHeight() * py; return new PointF(finalX, finalY); } private class Fling implements Runnable { CompatScroller scroller; int currX, currY; Fling(int velocityX, int velocityY) { ZoomImageView.this.setState(State.FLING); this.scroller = new CompatScroller(ZoomImageView.this.context); ZoomImageView.this.matrix.getValues(ZoomImageView.this.m); int startX = (int) ZoomImageView.this.m[Matrix.MTRANS_X]; int startY = (int) ZoomImageView.this.m[Matrix.MTRANS_Y]; int minX, maxX, minY, maxY; if (ZoomImageView.this.getImageWidth() > ZoomImageView.this.viewWidth) { minX = ZoomImageView.this.viewWidth - (int) ZoomImageView.this.getImageWidth(); maxX = 0; } else { minX = maxX = startX; } if (ZoomImageView.this.getImageHeight() > ZoomImageView.this.viewHeight) { minY = ZoomImageView.this.viewHeight - (int) ZoomImageView.this.getImageHeight(); maxY = 0; } else { minY = maxY = startY; } this.scroller.fling(startX, startY, velocityX, velocityY, minX, maxX, minY, maxY); this.currX = startX; this.currY = startY; } public void cancelFling() { if (this.scroller != null) { ZoomImageView.this.setState(State.NONE); this.scroller.forceFinished(true); } } @Override public void run() { // // OnTouchImageViewListener is set: TouchImageView listener has been flung by user. // Listener runnable updated with each frame of fling animation. // if (ZoomImageView.this.touchImageViewListener != null) { ZoomImageView.this.touchImageViewListener.onMove(); } if (this.scroller.isFinished()) { this.scroller = null; return; } if (this.scroller.computeScrollOffset()) { int newX = this.scroller.getCurrX(); int newY = this.scroller.getCurrY(); int transX = newX - this.currX; int transY = newY - this.currY; this.currX = newX; this.currY = newY; ZoomImageView.this.matrix.postTranslate(transX, transY); ZoomImageView.this.fixTrans(); ZoomImageView.this.setImageMatrix(ZoomImageView.this.matrix); ZoomImageView.this.compatPostOnAnimation(this); } } } @TargetApi(VERSION_CODES.GINGERBREAD) private static class CompatScroller { Scroller scroller; OverScroller overScroller; boolean isPreGingerbread; public CompatScroller(Context context) { if (VERSION.SDK_INT < VERSION_CODES.GINGERBREAD) { this.isPreGingerbread = true; this.scroller = new Scroller(context); } else { this.isPreGingerbread = false; this.overScroller = new OverScroller(context); } } public void fling(int startX, int startY, int velocityX, int velocityY, int minX, int maxX, int minY, int maxY) { if (this.isPreGingerbread) { this.scroller.fling(startX, startY, velocityX, velocityY, minX, maxX, minY, maxY); } else { this.overScroller.fling(startX, startY, velocityX, velocityY, minX, maxX, minY, maxY); } } public void forceFinished(boolean finished) { if (this.isPreGingerbread) { this.scroller.forceFinished(finished); } else { this.overScroller.forceFinished(finished); } } public boolean isFinished() { if (this.isPreGingerbread) { return this.scroller.isFinished(); } else { return this.overScroller.isFinished(); } } public boolean computeScrollOffset() { if (this.isPreGingerbread) { return this.scroller.computeScrollOffset(); } else { this.overScroller.computeScrollOffset(); return this.overScroller.computeScrollOffset(); } } public int getCurrX() { if (this.isPreGingerbread) { return this.scroller.getCurrX(); } else { return this.overScroller.getCurrX(); } } public int getCurrY() { if (this.isPreGingerbread) { return this.scroller.getCurrY(); } else { return this.overScroller.getCurrY(); } } } @TargetApi(VERSION_CODES.JELLY_BEAN) private void compatPostOnAnimation(Runnable runnable) { if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) { this.postOnAnimation(runnable); } else { this.postDelayed(runnable, 1000 / 60); } } private static class ZoomVariables { public float scale; public float focusX; public float focusY; public ScaleType scaleType; public ZoomVariables(float scale, float focusX, float focusY, ScaleType scaleType) { this.scale = scale; this.focusX = focusX; this.focusY = focusY; this.scaleType = scaleType; } } }
[ "1131484477@qq.com" ]
1131484477@qq.com
346235d39e1272a81220eeea3138efce49ab0a5b
94084dbe7df468abf73698b940ad9d90aefd478a
/src/test/java/com/sunyard/Proxy/ProxyUtilsTest.java
7c4dfcd012b10f083c697967ba03e996c873bac4
[]
no_license
liww666/Nettydemo
41798411d640ffac662c768645450c232612c2f9
f2fa5595536008e43b0f5f54ee318b94e861de30
refs/heads/master
2020-04-16T12:36:22.846102
2019-01-14T03:13:51
2019-01-14T03:13:51
165,587,348
0
0
null
null
null
null
UTF-8
Java
false
false
258
java
package com.sunyard.Proxy; /** * Created by lww on 2018/11/12. */ public class ProxyUtilsTest { public static void main(String[] args) { Inter inter=new InterImpl(); ProxyUtils.generateClassFile(inter.getClass(),"InterProxy"); } }
[ "1065034454@qq.com" ]
1065034454@qq.com
dac7b9438c8556b39dd840f824a997c4931bbb52
ea282cc70de0f867f671a71fc515cc7641d3d3fe
/src/xfuzzy/xfsp/model/types/XfspCluster.java
922bdb4499f0752da495981c08cd1430ba7b1f3f
[ "MIT" ]
permissive
dayse/gesplan
aff1cc1e38ec22231099063592648674d77b575d
419ee1dcad2fa96550c99032928e9ea30e7da7cd
refs/heads/master
2021-01-23T07:03:23.606901
2014-08-12T14:38:26
2014-08-12T14:38:26
null
0
0
null
null
null
null
ISO-8859-1
Java
false
false
8,476
java
//--------------------------------------------------------------------------------// // COPYRIGHT NOTICE // //--------------------------------------------------------------------------------// // Copyright (c) 2012, Instituto de Microelectronica de Sevilla (IMSE-CNM) // // // // All rights reserved. // // // // Redistribution and use in source and binary forms, with or without // // modification, are permitted provided that the following conditions are met: // // // // * Redistributions of source code must retain the above copyright notice, // // this list of conditions and the following disclaimer. // // // // * Redistributions in binary form must reproduce the above copyright // // notice, this list of conditions and the following disclaimer in the // // documentation and/or other materials provided with the distribution. // // // // * Neither the name of the IMSE-CNM nor the names of its contributors may // // be used to endorse or promote products derived from this software // // without specific prior written permission. // // // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE // // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL // // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR // // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER // // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, // // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // //--------------------------------------------------------------------------------// package xfuzzy.xfsp.model.types; /** * <p> <b>Descripción:</b> representa los clusters utilizados por el modelo * para la simplificación de tipos mediante la técnica de <i>clustering</i>. * <p> <b>E-mail</b>: <ADDRESS>joragupra@us.es</ADDRRESS> * @author Jorge Agudo Praena * @version 1.4 * @see XfspClustering * */ public class XfspCluster { //almacena las asignaciones de clusters hechas a cada una de las funciones de //pertenencia del tipo que se quiere simplificar public int[] assign; //almacena los datos relativos a los clusters encontrados public double[][] cluster; //almacena los pesos que se deben dar a cada uno de los parámetros de las //funciones de pertenencia public double[] weights; //almacena los parámetros de las funciones de pertenencia del tipo que se //quiere simplificar por clustering public double[][] data; /** * <p> <b>Descripción:</b> crea una objeto que representa un conjunto de C * clusters bajo los que agrupar los datos contenidos en <b>data</b>, * considerando que los pesos que hay que dar a los elementos que componen los * datos son los especificados en el array <b>weights</b>. * @param data Array de vectores de elementos de tipo <i>double</i> que serán * asignados a clusters. * @param C Número de clusters en que queremos agrupar los elementos de * <b>data</b>. * @param weights Pesos que queremos asignar a cada uno de los elementos de * los vectores contenidos en <b>data</b>. * */ public XfspCluster(double[][] data, int C, double[] weights) { //nuevo array de datos que vamos a agrupar en clusters this.data = data; //inicialización del array que contendrá tantos centros de clusters como se //nos indique a través del atributo C this.cluster = new double[C][data[0].length]; //pesos que se utilizarán en los cálculos de las distancias a la hora de //agrupar los datos en clusters this.weights = weights; //inicialización del array que informa de a qué cluster ha sido asignado //cada dato this.assign = new int[data.length]; //para los C primeros datos, asignamos dichos datos al cluster correspondiente //a la posición que ocupa el dato en el array data for (int i = 0; i < C; i++) { assign[i] = i; } //el resto de los datos no se asigna a ningún cluster, lo que se representa //con -1... for (int i = C; i < assign.length; i++) { assign[i] = -1; } //...y lo vamos insertando uno a uno en el cluster que le corresponda for (int i = C; i < assign.length; i++) { insert(i); } } /** * <p> <b>Descripción:</b> agrupa las funciones de pertenencia del tipo en * clusters hasta obtener la agrupación óptima. * */ public void apply() { do { setCluster(); } while (reassign()); } /** * <p> <b>Descripción:</b> inicializa el conjunto los <i>clusters</i>. * */ private void setCluster() { //para todos los clusters en que se quieren agrupar las funciones de //pertenencia del tipo... for (int i = 0; i < cluster.length; i++) { int n = 0; //inicialmente no asigna ninguna función de pertenencia a ninguna //cluster... for (int k = 0; k < cluster[i].length; k++) { cluster[i][k] = 0; } for (int j = 0; j < data.length; j++) { if (assign[j] == i) { for (int k = 0; k < cluster[i].length; k++) { cluster[i][k] += data[j][k]; } n++; } } if (n > 0) { for (int k = 0; k < cluster[i].length; k++) { cluster[i][k] /= n; } } } } /** * <p> <b>Descripción:</b> reasigna los datos a los <i>clusters</i> * disponibles. * */ private boolean reassign() { IXfspDistance d = new XfspEuclideanDistance(weights); boolean change = false; for (int i = 0; i < data.length; i++) { int sel = 0; double min = d.distance(data, cluster, i, 0); for (int j = 1; j < cluster.length; j++) { double dist = d.distance(data, cluster, i, j); if (min > dist) { min = dist; sel = j; } } if (assign[i] != sel) { assign[i] = sel; change = true; } } return change; } /** * <p> <b>Descripción:</b> inserta un dato en un <i>clusters</i>. * @param n Posición ocupada por el dato a insertar en el array de datos. * */ private void insert(int n) { IXfspDistance d = new XfspEuclideanDistance(weights); double dist_new; double dist_cl1; double min; int sel_new = 0; int sel_cl1 = 0; int sel_cl2 = 0; setCluster(); min = Double.MAX_VALUE; for (int i = 0; i < cluster.length; i++) { double dist = d.distance(data, cluster, n, i); if (dist < min) { min = dist; sel_new = i; } } dist_new = min; min = Double.MAX_VALUE; for (int i = 0; i < cluster.length; i++) { for (int j = i + 1; j < cluster.length; j++) { double dist = d.distance(cluster, cluster, i, j); if (dist < min) { min = dist; sel_cl1 = i; sel_cl2 = j; } } } dist_cl1 = min; if (dist_new < dist_cl1) { assign[n] = sel_new; } else { for (int i = 0; i < n; i++) { if (assign[i] == sel_cl2) { assign[i] = sel_cl1; } assign[n] = sel_cl2; } } } }
[ "felipe.arruda.pontes@gmail.com" ]
felipe.arruda.pontes@gmail.com
ae08004f269ebc05bd139e4f5661530385ff432b
1fcfd45bd0e4512ce78c2d6026c4d722a35351e7
/leapyear ss.java
2bc9f95f34bafef0305d0e56280d2073c50534e8
[]
no_license
sridharanv09/Srisri
9509dff58d043cba5b57691462ee258b1685ee53
3c309733f86972c1e2cecd8cb4263339bfef6658
refs/heads/master
2021-01-23T06:15:21.002107
2017-07-25T06:31:17
2017-07-25T06:31:17
93,016,108
0
0
null
null
null
null
UTF-8
Java
false
false
527
java
package guvi; import java.util.Scanner; public class leapyear { public static void main(String[] args) { int n; Scanner in=new Scanner(System.in); System.out.println("enter the year"); n=in.nextInt(); if((n%2==0) &&(n%100!=0)) { System.out.println("this is leap year"); } else if(n%100==0) { System.out.println("this is not a leap year"); } else if(n%400==0){ System.out.println("is leap year"); } else { System.out.println("this is not a leap year"); } } }
[ "noreply@github.com" ]
sridharanv09.noreply@github.com
1795672abeeffa3d331096e6208bc1a3c00a4cea
ccc98c90b7bcbb9f603168af97ffae53573fac18
/src/main/java/cd/home/redditbackend/service/UserDetailsServiceImpl.java
866ba91481c0c37982a2d8ca94c89ba4cbb4c77c
[]
no_license
Chrisdanyk/reddit-backend
e3659c3ebd7f32d3cc834d5cea5ad5f2b4c04d7e
9525c30c9f5b447d324762acdbba5d5bd26de52a
refs/heads/main
2023-08-30T23:01:22.943727
2021-10-18T09:34:09
2021-10-18T09:34:09
410,275,952
0
0
null
null
null
null
UTF-8
Java
false
false
1,640
java
package cd.home.redditbackend.service; import cd.home.redditbackend.model.User; import cd.home.redditbackend.repository.UserRepository; import lombok.AllArgsConstructor; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.Collection; import java.util.Optional; import static java.util.Collections.singletonList; @Service @AllArgsConstructor public class UserDetailsServiceImpl implements UserDetailsService { private final UserRepository userRepository; @Override @Transactional(readOnly = true) public UserDetails loadUserByUsername(String username) { Optional<User> userOptional = userRepository.findByUsername(username); User user = userOptional .orElseThrow(() -> new UsernameNotFoundException("No user " + "Found with username : " + username)); return new org.springframework.security .core.userdetails.User(user.getUsername(), user.getPassword(), user.isEnabled(), true, true, true, getAuthorities("USER")); } private Collection<? extends GrantedAuthority> getAuthorities(String role) { return singletonList(new SimpleGrantedAuthority(role)); } }
[ "ckandanda@scopex.be" ]
ckandanda@scopex.be
786f8c70d84b8f345d2e098660e75e362586b2fc
c583e42f22064bc5f3814b3d3c5f8bc62ee47a75
/src/main/java/com/woime/iboss/guest/web/RegisterController.java
6df256c3724910bfa0f770c70750cbbdf797a750
[]
no_license
vipsql/iboss
c42ab22f553b71cb56431f1e507e25434b238ede
9329b9a9f29d1289ffc047b44baa184f6e3636ab
refs/heads/master
2020-03-07T17:21:39.373944
2017-04-03T04:19:57
2017-04-03T04:19:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,571
java
package com.woime.iboss.guest.web; import java.util.Date; import javax.annotation.Resource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.woime.iboss.core.auth.CustomPasswordEncoder; import com.woime.iboss.core.id.IdGenerator; import com.woime.iboss.core.spring.MessageHelper; import com.woime.iboss.user.persistence.domain.AccountCredential; import com.woime.iboss.user.persistence.domain.AccountInfo; import com.woime.iboss.user.persistence.manager.AccountCredentialManager; import com.woime.iboss.user.persistence.manager.AccountInfoManager; @Controller @RequestMapping("guest") public class RegisterController { private static Logger logger = LoggerFactory.getLogger(RegisterController.class); private MessageHelper messageHelper; private AccountInfoManager accountInfoManager; private AccountCredentialManager accountCredentialManager; private CustomPasswordEncoder customPasswordEncoder; private IdGenerator idGenerator; @RequestMapping("register-view") public String registerView() { return "guest/register-view"; } @RequestMapping("register-save") public String registerSave(@ModelAttribute AccountInfo accountInfo, @RequestParam(value = "password", required = false) String password, @RequestParam(value = "confirmPassword", required = false) String confirmPassword, RedirectAttributes redirectAttributes) throws Exception { // 先进行校验 if (password != null) { if (!password.equals(confirmPassword)) { messageHelper.addFlashMessage(redirectAttributes, "user.user.input.passwordnotequals", "两次输入密码不符"); // TODO: 还要填充schema return "guest/register-view"; } } // 再进行数据复制 AccountInfo dest = accountInfo; dest.setId(idGenerator.generateId()); dest.setCreateTime(new Date()); accountInfoManager.insert(dest); if (dest.getCode() == null) { dest.setCode(Long.toString(dest.getId())); accountInfoManager.save(dest); } if (password != null) { String hql = "from AccountCredential where accountInfo=? and catalog='default'"; AccountCredential accountCredential = accountCredentialManager.findUnique(hql, accountInfo); if (accountCredential == null) { accountCredential = new AccountCredential(); accountCredential.setAccountInfo(accountInfo); accountCredential.setType("normal"); accountCredential.setCatalog("default"); } if (customPasswordEncoder != null) { accountCredential.setPassword(customPasswordEncoder.encode(password)); } else { accountCredential.setPassword(password); } accountCredentialManager.save(accountCredential); } accountInfo.setStatus("disabled"); accountInfo.setType("register"); accountInfoManager.save(accountInfo); return "redirect:/guest/register-success.do"; } @RequestMapping("register-success") public String registerSuccess() { return "guest/register-success"; } @RequestMapping("register-checkUsername") @ResponseBody public boolean checkUsername(@RequestParam("username") String username, @RequestParam(value = "id", required = false) Long id) throws Exception { String hql = "from AccountInfo where username=?"; Object[] params = { username }; if (id != null) { hql = "from AccountInfo where username=? and id<>?"; params = new Object[] { username, id }; } boolean result = accountInfoManager.findUnique(hql, params) == null; return result; } // ~ ====================================================================== @Resource public void setMessageHelper(MessageHelper messageHelper) { this.messageHelper = messageHelper; } @Resource public void setAccountInfoManager(AccountInfoManager accountInfoManager) { this.accountInfoManager = accountInfoManager; } @Resource public void setAccountCredentialManager(AccountCredentialManager accountCredentialManager) { this.accountCredentialManager = accountCredentialManager; } @Resource public void setCustomPasswordEncoder(CustomPasswordEncoder customPasswordEncoder) { this.customPasswordEncoder = customPasswordEncoder; } @Resource public void setIdGenerator(IdGenerator idGenerator) { this.idGenerator = idGenerator; } }
[ "Administrator@192.168.148.1" ]
Administrator@192.168.148.1
2bb5074cf203d349adbe293b300416f6c12f6862
7976b1ef60af1f14ac556061b7858ddccb06dd8a
/app/src/main/java/com/example/projectwalgreens/model/OrderConfirmedItem.java
23a1557ec9b966a4f24732d52b131f72d5b8c9b5
[]
no_license
hsun35/project_walgreens
4471bae2da1c1ce88e71ec2824ebc4f17dca2aa9
fd98568adf86d1980eba2bc85d37ef99f39ac8b0
refs/heads/master
2021-04-27T09:25:35.929683
2018-03-22T17:40:44
2018-03-22T17:40:44
122,514,492
0
0
null
null
null
null
UTF-8
Java
false
false
425
java
package com.example.projectwalgreens.model; import com.google.gson.annotations.SerializedName; public class OrderConfirmedItem{ @SerializedName("OrderId") private int orderId; public void setOrderId(int orderId){ this.orderId = orderId; } public int getOrderId(){ return orderId; } @Override public String toString(){ return "OrderConfirmedItem{" + "orderId = '" + orderId + '\'' + "}"; } }
[ "hsun35@jhu.edu" ]
hsun35@jhu.edu
f1c7b5e2fefb668e8ecd09ebe8c76627b79f9df7
282b0a60bf9862d3903378018734e12d44f92929
/src/pt/ipb/agentapi/macros/XMLTaskReader.java
b75de79609d9ef5c40b91009600d563d4cb1678d
[]
no_license
xiptos/AgentAPI
604eef2f4a9fcb01998a6faf74a2d4c4a43be79b
4f60a52802ee7c783ba36e458f267292d1ea69b0
refs/heads/master
2021-01-15T11:14:41.288065
2013-10-10T20:00:20
2013-10-10T20:00:20
35,282,982
0
0
null
null
null
null
UTF-8
Java
false
false
9,149
java
/* * File: SnmpMacrosHandlerImpl.java Date: 26 de Junho de 2002 14:46 * * @author rlopes * * @version generated by NetBeans XML module */ package pt.ipb.agentapi.macros; import java.io.InputStream; import org.xml.sax.Attributes; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import pt.ipb.snmp.SnmpConstants; import pt.ipb.snmp.SnmpProperties; import pt.ipb.snmp.type.smi.Var; import pt.ipb.snmp.type.smi.VarBind; public class XMLTaskReader implements SnmpMacrosHandler, TaskReader { public static final String SNMP = "snmp"; public static final String MIB = "mib"; public static final String PROPERTY = "property"; public static final String TASK = "task"; public static final String GET = "get"; public static final String GETNEXT = "getNext"; public static final String GETBULK = "getBulk"; public static final String SET = "set"; public static final String INFORM = "inform"; public static final String RESPONSE = "response"; public static final String TRAP = "trap"; public static final String VARBIND = "varBind"; public static final String RUNTASK = "runTask"; public static final String VERSION = "version"; public static final String USER = "user"; public static final String AUTHPROTO = "authProtocol"; public static final String AUTHPASS = "authPassword"; public static final String PRIVPASS = "privPassword"; public static final String COMMUNITY = "community"; public static final String WRITECOMMUNITY = "writeCommunity"; public static final String NAME = "name"; public static final String LOCATION = "location"; public static final String VALUE = "value"; public static final String DESTINATION = "destination"; public static final String OID = "oid"; public static final String NONREP = "nonrep"; public static final String MAXREP = "maxrep"; public static final String DOCUMENT = "document"; public static final String TYPE = "type"; InputStream stream = null; Tasks tasks = null; Task task = null; Op current = null; public XMLTaskReader(InputStream s) { this.stream = s; } public void start_snmp(final Attributes attrs) throws SAXException { if (tasks == null) tasks = new Tasks(); SnmpProperties props = new SnmpProperties(); if (attrs.getValue(VERSION) != null) { try { props.setVersion(Integer.parseInt(attrs.getValue(VERSION))); } catch (Exception e) { throw new SAXException(e); } } if (attrs.getValue(USER) != null) { props.setUser(attrs.getValue(USER)); } if (attrs.getValue(AUTHPROTO) != null) { props.setProperty(SnmpProperties.AUTHPROTO, attrs.getValue(AUTHPROTO)); } if (attrs.getValue(AUTHPASS) != null) { props.setAuthPass(attrs.getValue(AUTHPASS)); } if (attrs.getValue(PRIVPASS) != null) { props.setPrivPass(attrs.getValue(PRIVPASS)); props.setPrivProto(SnmpConstants.DES); } if (attrs.getValue(COMMUNITY) != null) { props.setCommunity(attrs.getValue(COMMUNITY)); } if (attrs.getValue(WRITECOMMUNITY) != null) { props.setWriteCommunity(attrs.getValue(WRITECOMMUNITY)); } tasks.setSnmpProperties(props); } public void end_snmp() throws SAXException { } public void start_trap(final Attributes attrs) throws SAXException { current = new Trap(); if (attrs.getValue(VERSION) != null) { try { ((Trap) current).setVersion(Integer.parseInt(attrs.getValue(VERSION))); } catch (Exception e) { } } completeAttrs(current, attrs); } public void end_trap() throws SAXException { task.addOp(current); } public void start_inform(final Attributes attrs) throws SAXException { current = new Inform(); completeAttrs(current, attrs); } public void end_inform() throws SAXException { task.addOp(current); } public void start_getNext(final Attributes attrs) throws SAXException { current = new GetNext(); completeAttrs(current, attrs); } public void end_getNext() throws SAXException { task.addOp(current); } public void start_getBulk(final Attributes attrs) throws SAXException { current = new GetBulk(); if (attrs.getValue(NONREP) != null) { try { ((GetBulk) current).setNonRep(Integer.parseInt(attrs.getValue(NONREP))); } catch (Exception e) { throw new SAXException(e); } } if (attrs.getValue(MAXREP) != null) { try { ((GetBulk) current).setMaxRep(Integer.parseInt(attrs.getValue(MAXREP))); } catch (Exception e) { throw new SAXException(e); } } completeAttrs(current, attrs); } public void end_getBulk() throws SAXException { task.addOp(current); } public void start_get(final Attributes attrs) throws SAXException { current = new Get(); completeAttrs(current, attrs); } public void end_get() throws SAXException { task.addOp(current); } public void handle_mib(final Attributes attrs) throws SAXException { try { tasks.addMib(new Mib(new java.net.URL(attrs.getValue(LOCATION)), attrs .getValue(NAME))); } catch (Exception e) { throw new SAXException(e); } } public void start_task(final Attributes attrs) throws SAXException { task = new Task(attrs.getValue(NAME)); } public void end_task() throws SAXException { tasks.addTask(task); } public void handle_property(final Attributes attrs) throws SAXException { tasks .addProperty(new Property(attrs.getValue(NAME), attrs.getValue(VALUE))); } public void handle_varBind(final Attributes attrs) throws SAXException { current.addVarBind(getVarBind(attrs)); } public void start_set(final Attributes attrs) throws SAXException { current = new Set(); completeAttrs(current, attrs); } public void end_set() throws SAXException { task.addOp(current); } public void start_response(final Attributes attrs) throws SAXException { current = new Response(); completeAttrs(current, attrs); } public void end_response() throws SAXException { task.addOp(current); } public void handle_runTask(final Attributes attrs) throws SAXException { try { RunTask r = new RunTask(attrs.getValue(NAME), new java.net.URL(attrs .getValue(DOCUMENT))); task.addOp(r); } catch (Exception e) { e.printStackTrace(); } } public Tasks read() throws Exception { SnmpMacrosParser parser = new SnmpMacrosParser(this, null); parser.parse(new InputSource(stream)); return tasks; } protected void completeAttrs(Op p, Attributes attrs) { if (attrs.getValue(DESTINATION) != null) { p.setDestination(attrs.getValue(DESTINATION)); } VarBind v = getVarBind(attrs); if (v != null) p.addVarBind(v); } protected VarBind getVarBind(Attributes attrs) { String name = null; String oid = null; byte type = SnmpConstants.UNKNOWN; String value = null; if (attrs.getValue(OID) != null) { oid = attrs.getValue(OID); } else { return null; } if (attrs.getValue(NAME) != null) { name = attrs.getValue(NAME); } if (attrs.getValue(TYPE) != null) { type = SnmpConstants.string2type(attrs.getValue(TYPE)); } if (attrs.getValue(VALUE) != null) { value = attrs.getValue(VALUE); } try { VarBind v = new VarBind(); if (type != SnmpConstants.UNKNOWN) { v.setValue(Var.createVar(value, type)); } v.setOID(oid); if (name != null) v.setName(name); return v; } catch (NumberFormatException e) { e.printStackTrace(); } return null; } public static void main(String arg[]) { try { InputStream s = new java.io.FileInputStream(arg[0]); XMLTaskReader xml = new XMLTaskReader(s); Tasks t = xml.read(); System.out.println(t.toXML()); System.out.println("--------------------------------------"); for (java.util.Iterator i = t.iterator(); i.hasNext();) { Op op = (Op) i.next(); System.out.println(op.toXML()); } /* * System.out.println("--------------------------------------"); * for(Iterator i=t.iterator(); i.hasNext(); ) { Op op = (Op)i.next(); * i.remove(); * System.out.println(((Task)t.getTaskList().get(0)).getOpList().size()); } */ TasksResolver resolveTasks = new TasksResolver(t); resolveTasks.resolve(); System.out.println("--------------------------------------"); for (java.util.Iterator i = resolveTasks.iterator(); i.hasNext();) { Op op = (Op) i.next(); System.out.println(op.toXML()); } } catch (Exception e) { e.printStackTrace(); } } }
[ "rlopes@ipb.pt" ]
rlopes@ipb.pt
c7127c081f0ffbee5e770294a37ad5510bf5874f
88d3bd300d4fb42d8de815b0ebfc04921e37107f
/Game_Platform/src/com/rafay/objects/Enemy.java
e745e719b6969c287bfb45d0bdc3899171ce983a
[]
no_license
Ahme0880/Game_Platform
ad8806566c5326a43c2ee8194c0ce13cffe6a6fe
d927da21a6ca3f57747aab8f6fc0574bd41c1437
refs/heads/master
2023-03-25T10:30:25.386715
2021-03-28T01:35:37
2021-03-28T01:35:37
352,193,047
0
0
null
null
null
null
UTF-8
Java
false
false
4,299
java
package com.rafay.objects; import java.awt.Color; import java.awt.Graphics; import java.awt.Rectangle; import java.util.LinkedList; import com.rafay.framework.GameObject; import com.rafay.framework.ObjectId; import com.rafay.framework.Texture; import com.rafay.window.Animations; import com.rafay.window.Game; import com.rafay.window.Handler; public class Enemy extends GameObject{ Texture text = Game.getInstance(); float distance, dif_x,dif_y; private int hp = 50; private Handler handler; private Animations enemyfront, enemyright, enemyleft, enemyback; private float width = 32, height = 32; public Enemy(float x, float y, ObjectId id, Handler handler) { super(x, y, id); this.handler = handler; falling = false; enemyfront = new Animations(8, text.enemy[0], text.enemy[1],text.enemy[2]); enemyright = new Animations(8, text.enemy[3], text.enemy[4],text.enemy[5]); enemyleft= new Animations(8, text.enemy[6], text.enemy[7],text.enemy[8]); enemyback = new Animations(8, text.enemy[9], text.enemy[10],text.enemy[11]); // TODO Auto-generated constructor stub } public void tick(LinkedList<GameObject> object) { // TODO Auto-generated method stub x+= velX; y += velY; for(int i = 0;i< handler.object.size(); i++) { GameObject tempObject = handler.object.get(i); if (tempObject.getId() == ObjectId.Player){ dif_x = x - tempObject.getX() - width; dif_y = y - tempObject.getY() - height; distance = (float) Math.sqrt((x - tempObject.getX()) * (x - tempObject.getX()) + (y - tempObject.getY()) * (y - tempObject.getY())); } } if (distance < 300) { velX = -((1/ distance) * dif_x); velY = -((1/distance) * dif_y); }else { velX = 0; velY = 0; } enemyfront.runAnimation(); enemyright.runAnimation(); enemyleft.runAnimation(); enemyback.runAnimation(); collision(object); } public void render(Graphics g) { // TODO Auto-generated method stub for (int i = 0; i< handler.object.size(); i++) { GameObject tempObject = handler.object.get(i); if (tempObject.getId() == ObjectId.Player) { if (velY == 0 && velX == 0) { enemyfront.drawAnimations(g,(int) x,(int) y, 0); }else if(Math.abs(tempObject.getX() - x) > Math.abs(tempObject.getY() - y)); if (velX >0) { enemyright.drawAnimations(g,(int) x,(int) y, 0); }else if (velX < 0) { enemyleft.drawAnimations(g,(int) x,(int) y, 0); } }else if (Math.abs(tempObject.getY() - y) > Math.abs(tempObject.getX() - x)) { if (velY > 0) { enemyfront.drawAnimations(g,(int) x,(int) y, 0); } else if (velY <0) { enemyback.drawAnimations(g,(int) x,(int) y, 0); } } } } private void collision(LinkedList<GameObject>object) { for(int i = 0; i< handler.object.size();i++) { GameObject tempObject = handler.object.get(i); if(tempObject.getId() == ObjectId.Block) { if(getBoundsTop().intersects(tempObject.getBounds())){ y = tempObject.getY() + 32; } if(getBoundsBottom().intersects(tempObject.getBounds())){ y = tempObject.getY() - height; } //Right if(getBoundsRight().intersects(tempObject.getBounds())){ x = tempObject.getX() - width; } //Left if(getBoundsLeft().intersects(tempObject.getBounds())){ x = tempObject.getX() + 32; } } } } @Override public Rectangle getBounds() { // TODO Auto-generated method stub return new Rectangle((int) ((int)x +(width/2)-((width/2)/2)), (int) ((int)y + ( height/2)),(int) width/2,(int) height/2); } public Rectangle getBoundsLeft() { // TODO Auto-generated method stub return new Rectangle((int)x, (int)y + 5,(int) 5,(int) height-10); } public Rectangle getBoundsRight() { // TODO Auto-generated method stub return new Rectangle((int) ((int)x+ width -5), (int)y + 5,(int) 5,(int) height - 10); } public Rectangle getBoundsTop() { // TODO Auto-generated method stub return new Rectangle((int) ((int)x + (width/2)-((width/2)/2)), (int)y,(int) width /2,(int) height/2); } public Rectangle getBoundsBottom() { return new Rectangle((int) ((int)x + (width/2)-((width/2)/2)), (int)y + (int)(height / 2),(int) width /2,(int) height/2); } }
[ "Ahme0880@mylaurier.ca" ]
Ahme0880@mylaurier.ca
4233f23021b118fdd34f158f19d0d9a3ede9c319
ddf787cc7a413e2bf037f774037a7b91e826273c
/simple-pay-helper/src/main/java/com/simple/result/wechatpay/WeChatAuthTicketResult.java
0580f59a40112fbb2669f8e5767d1317a8808814
[ "Apache-2.0" ]
permissive
cena009/simple-pay
79deafb03731b3a7f34f176e482a7e0c40421512
365dad29fa463db94c87b0536aa02d483e58175d
refs/heads/main
2023-03-29T14:49:19.476384
2021-03-30T09:36:44
2021-03-30T09:36:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
998
java
package com.simple.result.wechatpay; import com.simple.result.SimplePayResult; /** * Created by Jin.Z.J 2021/2/25 */ public class WeChatAuthTicketResult implements SimplePayResult { private Integer errcode; private String errmsg; private String ticket; private Integer expires_in; public Integer getErrcode() { return errcode; } public void setErrcode(Integer errcode) { this.errcode = errcode; } public String getErrmsg() { return errmsg; } public void setErrmsg(String errmsg) { this.errmsg = errmsg; } public String getTicket() { return ticket; } public void setTicket(String ticket) { this.ticket = ticket; } public Integer getExpires_in() { return expires_in; } public void setExpires_in(Integer expires_in) { this.expires_in = expires_in; } @Override public boolean isSuccess() { return this.errcode == 0; } }
[ "javahobbies@163.com" ]
javahobbies@163.com
8d69bc0a5b6b334eac1d6cebb569ceae4f6dc5d6
3007efad1484db91b2af0e507092fd27cef78579
/src/main/java/com/ace/controller/admin/concerns/RemoteOption.java
107525195225101b11abdd71110a5e2d9894a14c
[ "MIT" ]
permissive
john1228/ace
9d493f9e52ccd105e29abf4bf4c004e05923e79e
e05da3fce760bfe33eaa177ec6058caffb30418c
refs/heads/master
2020-04-15T04:27:40.419400
2019-12-16T06:11:46
2019-12-16T06:11:46
164,384,227
0
0
MIT
2019-01-07T05:49:17
2019-01-07T05:49:17
null
UTF-8
Java
false
false
306
java
package com.ace.controller.admin.concerns; import lombok.Getter; import lombok.Setter; import java.util.List; @Getter @Setter public class RemoteOption { private List<Option> results; @Getter @Setter public class Option { private String id; private String text; } }
[ "johnzheng@aidong.me" ]
johnzheng@aidong.me
e3004951bbfb4542f1c7afa0f21a5bd7bf36f287
5246feaeda9771220f035bf34b26d65ad1d21df6
/mongodb-v3-driver/src/main/java/com/github/cloudyrock/mongock/driver/mongodb/v3/decorator/impl/MapReduceIterableDecoratorImpl.java
022d02dce94ae74bc1c09b83b1632073ed6d09a3
[ "Apache-2.0" ]
permissive
oliverlockwood/mongock
dd47ade9f3c1d6606811ee1ab97211f1e839f32b
5caaf20b0976f6a976c231b065fe5137d1841902
refs/heads/master
2023-05-14T18:31:44.886241
2021-04-28T17:11:13
2021-04-28T17:11:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
821
java
package com.github.cloudyrock.mongock.driver.mongodb.v3.decorator.impl; import com.github.cloudyrock.mongock.driver.api.lock.guard.invoker.LockGuardInvoker; import com.github.cloudyrock.mongock.driver.mongodb.v3.decorator.MapReduceIterableDecorator; import com.mongodb.client.MapReduceIterable; public class MapReduceIterableDecoratorImpl<T> implements MapReduceIterableDecorator<T> { private final MapReduceIterable<T> impl; private final LockGuardInvoker checker; public MapReduceIterableDecoratorImpl(MapReduceIterable<T> implementation, LockGuardInvoker lockerCheckInvoker) { this.impl = implementation; this.checker = lockerCheckInvoker; } @Override public MapReduceIterable<T> getImpl() { return impl; } @Override public LockGuardInvoker getInvoker() { return checker; } }
[ "noreply@github.com" ]
oliverlockwood.noreply@github.com
04eda8178fb9553304ad82f7650bd9ff8bc7c15d
eac90a1508cd9be5d99fd1907109acbbcabc8a9e
/PACT/web-services-spring-pact-server/src/test/java/de/example/spring/pact/provider/infrastructure/message/CustomAmqpTarget.java
cea3220f47b99602147647f46c67453584fa2861
[]
no_license
gumartinm/SpringWebServicesForFun
49504891972343a9947c5351fcc4f4ac187944ee
54115341303f2582594cb7800e7bb01ef98c5beb
refs/heads/master
2020-12-24T05:23:08.879186
2019-02-25T01:27:24
2019-02-25T01:27:24
6,536,784
1
1
null
null
null
null
UTF-8
Java
false
false
1,474
java
package de.example.spring.pact.provider.infrastructure.message; import au.com.dius.pact.model.Interaction; import au.com.dius.pact.model.ProviderState; import au.com.dius.pact.provider.ConsumerInfo; import au.com.dius.pact.provider.ProviderInfo; import au.com.dius.pact.provider.ProviderVerifier; import au.com.dius.pact.provider.junit.target.AmqpTarget; import java.util.List; // Taken from https://github.com/thombergs/code-examples/blob/de7fa53d554c7ff4495c9efdb41b12386494be0f/pact/pact-message-producer/src/test/java/io/reflectoring/CustomAmqpTarget.java public class CustomAmqpTarget extends AmqpTarget { public CustomAmqpTarget(List<String> packagesToScan) { super(packagesToScan); } @Override protected ProviderVerifier setupVerifier(Interaction interaction, ProviderInfo provider, ConsumerInfo consumer) { ProviderVerifier verifier = new CustomProviderVerifier(getPackagesToScan()); setupReporters(verifier, provider.getName(), interaction.getDescription()); verifier.initialiseReporters(provider); verifier.reportVerificationForConsumer(consumer, provider); if (!interaction.getProviderStates().isEmpty()) { for (ProviderState state : interaction.getProviderStates()) { verifier.reportStateForInteraction(state.getName(), provider, consumer, true); } } verifier.reportInteractionDescription(interaction); return verifier; } }
[ "gu.martinm@gmail.com" ]
gu.martinm@gmail.com
bf92e18630a46ac90747bf8d3d883a5da5a6d520
776335da6db7b354d519f32fe3c7bcf01be67914
/Iteration 3/src/OrderLine.java
dacd7848f29d201228f38c090fc015c348f481de
[]
no_license
PatrickSnell/COMP-3700-Course-Project
1a160fc4a46193d997eb3e8a8eb4df277c2e4704
0c6bae9268633ccc74a9f3f1375d38d95a8f016f
refs/heads/master
2021-01-23T17:34:56.947241
2017-12-17T05:06:11
2017-12-17T05:06:11
102,766,514
0
1
null
2017-11-14T05:11:19
2017-09-07T17:30:10
null
UTF-8
Java
false
false
923
java
public class OrderLine { private int orderID; private int productID; private String productName; private double quantity; private double cost; public int getOrderID() { return orderID; } public void setOrderID(int orderID) { this.orderID = orderID; } public int getProductID() { return productID; } public void setProductID(int productID) { this.productID = productID; } public String getProductName() { return productName; } public void setProductName(String customerName) { this.productName = customerName; } public double getQuantity() { return quantity; } public void setQuantity(double quantity) { this.quantity = quantity; } public double getCost() { return cost; } public void setCost(double cost) { this.cost = cost; } }
[ "noreply@github.com" ]
PatrickSnell.noreply@github.com
9db96c0e5217e8efd4d1b0e90ff59d8c79451c8c
384950dfb62513ed62199eb167a360aea1c61271
/component_base/src/main/java/com/soyoung/component_base/util/ObjectUtils.java
968463e3dffa0f7615e3f178036c224d3d7ca88e
[]
no_license
merlin721/Network
e9d2d5aa14a1699fee2d96c627a7611071fc4609
2424de42cdf46c237dca7c91e11b28f055e36f4d
refs/heads/master
2020-07-03T13:58:23.262278
2019-08-12T12:56:23
2019-08-12T12:56:23
201,927,101
0
0
null
null
null
null
UTF-8
Java
false
false
3,531
java
package com.soyoung.component_base.util; import android.os.Build; import android.support.v4.util.LongSparseArray; import android.support.v4.util.SimpleArrayMap; import android.util.SparseArray; import android.util.SparseBooleanArray; import android.util.SparseIntArray; import android.util.SparseLongArray; import java.lang.reflect.Array; import java.util.Collection; import java.util.Map; /** * <pre> * author: Blankj * blog : http://blankj.com * time : 2017/12/24 * desc : 对象相关工具类 * </pre> */ public final class ObjectUtils { private ObjectUtils() { throw new UnsupportedOperationException("u can't instantiate me..."); } /** * 判断对象是否为空 * * @param obj 对象 * @return {@code true}: 为空<br>{@code false}: 不为空 */ public static boolean isEmpty(final Object obj) { if (obj == null) { return true; } if (obj instanceof CharSequence && obj.toString().length() == 0) { return true; } if (obj.getClass().isArray() && Array.getLength(obj) == 0) { return true; } if (obj instanceof Collection && ((Collection) obj).isEmpty()) { return true; } if (obj instanceof Map && ((Map) obj).isEmpty()) { return true; } if (obj instanceof SimpleArrayMap && ((SimpleArrayMap) obj).isEmpty()) { return true; } if (obj instanceof SparseArray && ((SparseArray) obj).size() == 0) { return true; } if (obj instanceof SparseBooleanArray && ((SparseBooleanArray) obj).size() == 0) { return true; } if (obj instanceof SparseIntArray && ((SparseIntArray) obj).size() == 0) { return true; } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) { if (obj instanceof SparseLongArray && ((SparseLongArray) obj).size() == 0) { return true; } } if (obj instanceof LongSparseArray && ((LongSparseArray) obj).size() == 0) { return true; } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { if (obj instanceof android.util.LongSparseArray && ((android.util.LongSparseArray) obj).size() == 0) { return true; } } return false; } /** * 判断对象是否非空 * * @param obj 对象 * @return {@code true}: 非空<br>{@code false}: 空 */ public static boolean isNotEmpty(final Object obj) { return !isEmpty(obj); } /** * 判断对象是否相等 * * @param o1 对象1 * @param o2 对象2 * @return {@code true}: 相等<br>{@code false}: 不相等 */ public static boolean equals(Object o1, Object o2) { return o1 == o2 || (o1 != null && o1.equals(o2)); } /** * 检查对象非空 * * @param object 对象 * @param message 报错 * @param <T> 范型 * @return 非空对象 */ public static <T> T requireNonNull(T object, String message) { if (object == null) { throw new NullPointerException(message); } return object; } /** * 获取对象哈希值 * * @param o 对象 * @return 哈希值 */ public static int hashCode(Object o) { return o != null ? o.hashCode() : 0; } }
[ "zhouyang@soyoung.com" ]
zhouyang@soyoung.com
ed291d5178938e97500d0a91f86453609e34843b
4b6fe887f28bfba5d2b8cc8fc794a1c362d4a15e
/flyway-core/src/main/java/org/flywaydb/core/internal/database/mysql/MySQLConnection.java
1908bb6fd7cc90f7c21b9b77bdc4672aa5fa3dd4
[ "Apache-2.0" ]
permissive
Radioafricagroup/flyway
c6c68f1d5f9e94a9980f7ce4a4fe5f5377c7ee0a
eab22fbb96bbfe48cfda348f62019ae45e3776f1
refs/heads/master
2023-08-18T19:41:51.179263
2018-05-17T08:51:31
2018-05-17T08:51:31
129,399,319
0
0
Apache-2.0
2023-08-15T17:41:36
2018-04-13T12:28:31
Java
UTF-8
Java
false
false
2,717
java
/* * Copyright 2010-2018 Boxfuse GmbH * * 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.flywaydb.core.internal.database.mysql; import org.flywaydb.core.api.configuration.Configuration; import org.flywaydb.core.api.logging.Log; import org.flywaydb.core.api.logging.LogFactory; import org.flywaydb.core.internal.database.Connection; import org.flywaydb.core.internal.database.Schema; import org.flywaydb.core.internal.database.Table; import org.flywaydb.core.internal.util.StringUtils; import java.sql.SQLException; import java.sql.Types; import java.util.UUID; import java.util.concurrent.Callable; /** * MySQL connection. */ public class MySQLConnection extends Connection<MySQLDatabase> { private static final Log LOG = LogFactory.getLog(MySQLConnection.class); MySQLConnection(Configuration configuration, MySQLDatabase database, java.sql.Connection connection ) { super(configuration, database, connection, Types.VARCHAR ); } @Override protected String getCurrentSchemaNameOrSearchPath() throws SQLException { return jdbcTemplate.getConnection().getCatalog(); } @Override public void doChangeCurrentSchemaOrSearchPathTo(String schema) throws SQLException { if (!StringUtils.hasLength(schema)) { try { // Weird hack to switch back to no database selected... String newDb = database.quote(UUID.randomUUID().toString()); jdbcTemplate.execute("CREATE SCHEMA " + newDb); jdbcTemplate.execute("USE " + newDb); jdbcTemplate.execute("DROP SCHEMA " + newDb); } catch (Exception e) { LOG.warn("Unable to restore connection to having no default schema: " + e.getMessage()); } } else { jdbcTemplate.getConnection().setCatalog(schema); } } @Override public Schema getSchema(String name) { return new MySQLSchema(jdbcTemplate, database, name); } @Override public <T> T lock(Table table, Callable<T> callable) { return new MySQLNamedLockTemplate(jdbcTemplate, table.toString().hashCode()).execute(callable); } }
[ "business@axelfontaine.com" ]
business@axelfontaine.com
b56561da444445a77645153d47c896b28fb7bbf4
bc83bb405c559f8cbe1ad7dc2d8e56cbf834462a
/src/main/java/edu/iit/sat/itmd4515/karthikk99/fp/service/BankService.java
3fdf02efd35062ca44b6612a1be124b692d1e398
[]
no_license
karthikk99/Enterprise-Bank-Application-
99fcac4948ffebeb230d730acc62c8d647bb5267
1248b401ef0e5399b59280f36b4ae6f281d7c92b
refs/heads/master
2021-01-12T17:50:46.921686
2016-10-22T15:45:34
2016-10-22T15:45:34
71,648,685
0
0
null
null
null
null
UTF-8
Java
false
false
985
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 edu.iit.sat.itmd4515.karthikk99.fp.service; import edu.iit.sat.itmd4515.karthikk99.fp.domain.Bank; import java.util.List; import javax.ejb.Stateless; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; /** * Service class to define Bank Entity database operations in Banking system * * @author Karthik Keshav */ @Stateless public class BankService extends AbstractService<Bank> { @PersistenceContext(unitName = "karthikk99PU") private EntityManager em; @Override protected EntityManager getEntityManager() { return em; } public BankService() { super(Bank.class); } @Override public List<Bank> findAll() { return getEntityManager().createNamedQuery("Bank.findAll").getResultList(); } }
[ "I314364@global.corp.sap" ]
I314364@global.corp.sap
be7b62d08b7e24924096ddf1d13b049462813552
f4db5cc33a0b0ba34a62aa7e2fc261f48e1ce990
/Hostel/src/main/java/by/bsu/hostel/util/MD5Util.java
2c99cdbcaf77f9692531b1bfb56989c8fd195b65
[]
no_license
siciliantom/Projects
78a6887370b890b4ebabcb7b585a01455fa13e15
c20e9266f315b49ad5b6a69c4d224682b6a5ce1f
refs/heads/master
2021-01-20T17:21:35.342996
2016-06-12T14:36:24
2016-06-12T14:36:24
60,970,173
0
0
null
null
null
null
UTF-8
Java
false
false
274
java
package by.bsu.hostel.util; import org.apache.commons.codec.digest.DigestUtils; /** * Created by Kate on 28.02.2016. */ public class MD5Util { public static String md5Apache(String st) { String md5Hex = DigestUtils.md5Hex(st); return md5Hex; } }
[ "museland78@gmail.com" ]
museland78@gmail.com
8b34857ad87c56d672c651b7de905549ab7a29c0
5d7c8d78e72ae3ea6e61154711fdd23248c19614
/sources/anet/channel/strategy/SchemeGuesser.java
8ff6e7a8ec2c39ce80cd251fcb938bdc25a6157e
[]
no_license
activeliang/tv.taobao.android
8058497bbb45a6090313e8445107d987d676aff6
bb741de1cca9a6281f4c84a6d384333b6630113c
refs/heads/master
2022-11-28T10:12:53.137874
2020-08-06T05:43:15
2020-08-06T05:43:15
285,483,760
7
6
null
null
null
null
UTF-8
Java
false
false
962
java
package anet.channel.strategy; import java.util.concurrent.ConcurrentHashMap; public class SchemeGuesser { private boolean enabled = true; private final ConcurrentHashMap<String, String> guessSchemeMap = new ConcurrentHashMap<>(); public static SchemeGuesser getInstance() { return holder.instance; } private static class holder { static SchemeGuesser instance = new SchemeGuesser(); private holder() { } } public void setEnabled(boolean enabled2) { this.enabled = enabled2; } public String guessScheme(String host) { if (!this.enabled) { return null; } String scheme = this.guessSchemeMap.get(host); if (scheme != null) { return scheme; } this.guessSchemeMap.put(host, "https"); return "https"; } public void onSslFail(String host) { this.guessSchemeMap.put(host, "http"); } }
[ "activeliang@gmail.com" ]
activeliang@gmail.com
0624fee656f674bc1e77ea60d3557d008f36c306
d7973d96c03b2acba1fe176390475784dd45f689
/domain/src/main/java/com/nrgentoo/dumbchat/domain/features/users/usecase/GetMyselfUseCase.java
0fe4e4db6c9e83b5aec7915f8171444241ab505a
[]
no_license
nrgentoo/dumbchat
2260b5c241f2e73124d2bd35b7d065f24be5611a
83ec1bd2e9996423c68867fe1128305c1eb3dc03
refs/heads/master
2021-01-21T10:04:39.401829
2017-02-27T22:03:11
2017-02-27T22:03:11
83,361,650
0
0
null
null
null
null
UTF-8
Java
false
false
1,031
java
package com.nrgentoo.dumbchat.domain.features.users.usecase; import com.nrgentoo.dumbchat.domain.core.executor.PostExecutionThread; import com.nrgentoo.dumbchat.domain.core.executor.ThreadExecutor; import com.nrgentoo.dumbchat.domain.core.usecase.SingleUseCase; import com.nrgentoo.dumbchat.domain.features.users.entity.User; import com.nrgentoo.dumbchat.domain.features.users.repository.UserRepo; import javax.inject.Inject; import io.reactivex.Single; /** * Use case to get user's {@link User} object */ public class GetMyselfUseCase extends SingleUseCase<User, Void> { @Inject UserRepo mUserRepo; @Inject public GetMyselfUseCase(ThreadExecutor threadExecutor, PostExecutionThread postExecutionThread) { super(threadExecutor, postExecutionThread); } @Override protected Single<User> buildSingle(Void params) { return Single.create(e -> { if (e.isDisposed()) return; e.onSuccess(mUserRepo.getMyself()); }); } }
[ "nrgentoo@gmail.com" ]
nrgentoo@gmail.com
a63278d6e8bbd32025e2c2aada177badd9242086
c8800e493abfdd503807a889bdf259e00add6023
/manageitem/src/main/java/itemmanager/respository/DeckRepository.java
8b0f344c6d39a527e647f6299048e23e0118e637
[]
no_license
xuxueyang/game-java-card
2b858ddcddc9bada7c263cc07c88ba945f930178
fbf91884aabe0d62991a1596d84941f56e4dcbe5
refs/heads/master
2022-12-22T13:33:19.890601
2020-07-02T02:59:54
2020-07-02T02:59:54
197,751,204
0
0
null
2022-12-10T05:10:17
2019-07-19T10:11:14
Java
UTF-8
Java
false
false
1,228
java
package itemmanager.respository; import core.core.BaseRepository; import itemmanager.domain.battle.Card; import itemmanager.domain.battle.Deck; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Repository; import java.util.List; @Repository public interface DeckRepository extends BaseRepository<Deck,Long> { void deleteAllByDeckIdAndUserId(String deckId, Long id); List<Deck> findAllByDeckIdAndUserId(String deckId, Long userId); List<Deck> findAllByUserId(Long userId); @Modifying @Query(nativeQuery = true,value = "" + "update t_deck set t_deck.actived = 1 where t_deck.userId = ?1 and t_deck.deck_id = ?2;" + "update t_deck set t_deck.actived = 0 where t_deck.userId = ?1 and t_deck.deck_id != ?2;" + "") void deckRepository(Long userId, String deckId); @Query(nativeQuery = true,value = "select deck.id from t_deck deck where deck.userId =?1 and deck.actived = ?2 limit 1") String findAllByDeckIdAndActived(Long deckId,Long actived); List<Deck> findAllByDeckId(String deckId); }
[ "xuxy@fengyuntec.com" ]
xuxy@fengyuntec.com
bf5c36f5d8b8d18e2c3b944e9d867fad3929cc02
0a0256e681e9830ce36d9cbdc9177c08758c382a
/kcm.api/src/main/java/com/fx/wechat/cp/bean/messagebuilder/ImageBuilder.java
0b4140e8392dbd77cf2a47a755c48f241f213151
[]
no_license
zhangguangxi/ftspay
2eab2d9d642ac4d9c7fd8af47113950454dd65ca
813ae522679b7c0e46f944a349f6c6a3aee79eae
refs/heads/master
2021-05-14T16:45:12.254257
2018-01-02T15:21:35
2018-01-02T15:21:35
116,028,580
0
0
null
null
null
null
UTF-8
Java
false
false
693
java
package com.fx.wechat.cp.bean.messagebuilder; import com.fx.common.api.WxConsts; import com.fx.wechat.cp.bean.WxCpMessage; /** * 获得消息builder * <pre> * 用法: WxCustomMessage m = WxCustomMessage.IMAGE().mediaId(...).toUser(...).build(); * </pre> * * @author Daniel Qian */ public final class ImageBuilder extends BaseBuilder<ImageBuilder> { private String mediaId; public ImageBuilder() { this.msgType = WxConsts.KefuMsgType.IMAGE; } public ImageBuilder mediaId(String media_id) { this.mediaId = media_id; return this; } @Override public WxCpMessage build() { WxCpMessage m = super.build(); m.setMediaId(this.mediaId); return m; } }
[ "zhangguangxito@sina.cn" ]
zhangguangxito@sina.cn
56dac51052f2c95d27761c159ffeea682bcd45f3
f9567869166bb91003d0c51883b6375dcd3f9d55
/src/com/example/xslt/Main.java
6729d73749fe9199d64ea69112f4a381d2e06e9c
[]
no_license
misguided-coder/integration
71442b3a61de29608d8607f2bc63beec262f6da6
8a86ae01970f82b8d0d2919214f3cdb0b35aeb6c
refs/heads/master
2020-03-27T22:13:29.733373
2018-09-07T10:44:12
2018-09-07T10:44:12
147,214,529
0
0
null
null
null
null
UTF-8
Java
false
false
988
java
package com.example.xslt; import org.apache.camel.CamelContext; import org.apache.camel.Exchange; import org.apache.camel.ProducerTemplate; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.impl.DefaultCamelContext; public class Main { public static void main(String[] args) throws Exception { new Main(); } public Main() throws Exception { CamelContext context = new DefaultCamelContext(); context.setTracing(true); context.addRoutes(new DynamicRouterBuilder()); context.start(); System.in.read(); context.stop(); System.out.println("Done!"); } class DynamicRouterBuilder extends RouteBuilder { public void configure() throws Exception { from("file://C:/camel-workspace/integration/src/com/example/xslt?noop=true") .tracing() .filter(header(Exchange.FILE_NAME).endsWith(".xml")) .to("stream:out") .to("xslt:C:/camel-workspace/integration/src/com/example/xslt/employee.xsl") .to("stream:out"); } } }
[ "hi2tyagi@yahoo.com" ]
hi2tyagi@yahoo.com
63fbe24cecff2b549fb20173e45f34d405b90192
9dc9b4af65ffaaa6142e6ba336a1d604f1f63d26
/src/main/java/com/nagorniy/webservice/util/validator/NotNullOrEmptyStringsArrayValidator.java
026f2d364d5cb6b89bd98161d98892d366c0c8b5
[]
no_license
NagorniyAleksandr/StringSorterWebService
95c85d78cd4decd7d544749e1ca8d352e82db5c8
9aed013a2023f45e70dbfd318a8e511a80843ee1
refs/heads/master
2020-04-01T22:07:13.804281
2018-10-18T22:03:15
2018-10-18T22:03:15
153,692,639
0
0
null
null
null
null
UTF-8
Java
false
false
806
java
package com.nagorniy.webservice.util.validator; import com.nagorniy.webservice.model.InputDataModel; import org.springframework.stereotype.Component; import org.springframework.util.CollectionUtils; /** * Implementation of {@code InputDataValidator} to check if the strings list is null or empty */ @Component public class NotNullOrEmptyStringsArrayValidator implements InputDataValidator { /** * Check if strings list is null or empty * * @param inputDataModel data to validate * @return an empty string if validation passed {@code ""} or an error message */ public String validate(InputDataModel inputDataModel) { return CollectionUtils.isEmpty(inputDataModel.getStrings()) ? "'strings' array must be not empty" : ""; } }
[ "" ]
9f972c853e5406ee8f385074906a13fc1aec78ac
a2272f1002da68cc554cd57bf9470322a547c605
/src/jdk/jdk.jcmd/sun/tools/jstat/OptionLister.java
cd6cdb19cad0c5c6c3a6ee08af0ac92b18613ab4
[]
no_license
framework-projects/java
50af8953ab46c509432c467c9ad69cc63818fa63
2d131cb46f232d3bf909face20502e4ba4b84db0
refs/heads/master
2023-06-28T05:08:00.482568
2021-08-04T08:42:32
2021-08-04T08:42:32
312,414,414
2
0
null
null
null
null
UTF-8
Java
false
false
1,950
java
/* * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package sun.tools.jstat; /** * A class for listing the available options in the jstat_options file. * * @author Brian Doherty * @since 1.5 */ public class OptionLister { private static final boolean debug = false; private List<URL> sources; public OptionLister(List<URL> sources) { this.sources = sources; } public void print(PrintStream ps) { Comparator<OptionFormat> c = new Comparator<OptionFormat>() { public int compare(OptionFormat o1, OptionFormat o2) { OptionFormat of1 = o1; OptionFormat of2 = o2; return (of1.getName().compareTo(of2.getName())); } }; Set<OptionFormat> options = new TreeSet<OptionFormat>(c); for (URL u : sources) { try { Reader r = new BufferedReader( new InputStreamReader(u.openStream())); Set<OptionFormat> s = new Parser(r).parseOptions(); options.addAll(s); } catch (IOException e) { if (debug) { System.err.println(e.getMessage()); e.printStackTrace(); } } catch (ParserException e) { // Exception in parsing the options file. System.err.println(u + ": " + e.getMessage()); System.err.println("Parsing of " + u + " aborted"); } } for ( OptionFormat of : options) { if (of.getName().compareTo("timestamp") == 0) { // ignore the special timestamp OptionFormat. continue; } ps.println("-" + of.getName()); } } }
[ "chovavea@outlook.com" ]
chovavea@outlook.com
3ae3397129eb037bd5b5f7c90962b935292f2edb
59ff958d75a7110fd291d14d8b895d9efd135a1c
/app/src/main/java/pt/vow/ui/enroll/EnrollViewModel.java
df7fa310e8b8825af93a19f80326a389f30ee9a9
[]
no_license
jf-moura/VOW-AndroidApp
f8eac90f278cf259e8b79a0748b9d065da5db508
81fbacaec10973d8d323718605d07921b65f9783
refs/heads/main
2023-06-27T15:42:45.270424
2021-07-30T14:59:58
2021-07-30T14:59:58
363,157,943
0
0
null
null
null
null
UTF-8
Java
false
false
1,557
java
package pt.vow.ui.enroll; import androidx.lifecycle.LiveData; import androidx.lifecycle.MutableLiveData; import androidx.lifecycle.ViewModel; import java.util.concurrent.Executor; import pt.vow.R; import pt.vow.data.Result; import pt.vow.data.enrollActivity.EnrollRepository; import pt.vow.data.model.EnrolledActivity; public class EnrollViewModel extends ViewModel { private MutableLiveData<EnrollResult> enrollResult = new MutableLiveData<>(); private EnrollRepository enrollRepository; private final Executor executor; EnrollViewModel(EnrollRepository enrollRepository, Executor executor) { this.enrollRepository =enrollRepository; this.executor = executor; } LiveData<EnrollResult> getEnrollResult() { return enrollResult; } public void enrollInActivity(String username, String tokenID, String activityOwner, String activityID) { executor.execute(new Runnable() { @Override public void run() { Result<EnrolledActivity> result = enrollRepository.enrollInActivity(username, tokenID, activityOwner, activityID); if (result instanceof Result.Success) { EnrolledActivity data = ((Result.Success<EnrolledActivity>) result).getData(); enrollResult.postValue(new EnrollResult(new EnrolledActivityView(data.getDisplayName()))); } else { enrollResult.postValue(new EnrollResult(R.string.enroll_failed)); } } }); } }
[ "madasasportes@gmail.com" ]
madasasportes@gmail.com
82426bd1469e992790c8778df65e16dd4ca97ac4
5b3a950275d715806bf2e1a02d5dda0f2ca04015
/MakeRsvpFrame.java
c3fd90bd89ab34a3b289e24b7aa34fb7851c77ef
[]
no_license
kimpham1234/HotelReservationSystem
5151071f365b06892f2f16f6ad7e9e048f610514
8a75d212263c04f5750e467f3e53ff5ddb8f350b
refs/heads/master
2021-05-01T04:50:51.097652
2017-01-03T02:47:23
2017-01-03T02:47:23
74,862,678
0
0
null
null
null
null
UTF-8
Java
false
false
9,088
java
/** * MakeRsvpFrame.java: Frame where guest can make new reservations * Author: Kim Pham */ import java.awt.BorderLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.time.LocalDate; import javax.swing.ImageIcon; 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.JTextArea; import javax.swing.JTextField; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import model.CalendarModel; import model.HotelReservationModel; import model.Reservation; import model.Room; /** * MakeRsvpFrame has: 1/ inputPanel: checkinPanel, checkoutPanel, roomTypePanel * 2/ reservationPanel: roomInfoPanel, * userChoicePanel(roomChoicePanel+navigationPanel) * */ public class MakeRsvpFrame extends JFrame implements ChangeListener { private HotelReservationModel hotel; private CalendarModel calendar; private CalendarDialog calendarChoser; private LocalDate checkInDate; private LocalDate checkOutDate; private boolean isLuxury; private JTextField checkInField; private JTextField checkOutField; private JTextArea availableRoomArea; private JTextField roomChoiceField; /** * Constructor for MakeRsvp scene * * @param hotel * Hotel Model * @param calendar * Calendar Model */ public MakeRsvpFrame(HotelReservationModel hotel, CalendarModel calendar) { this.hotel = hotel; hotel.attach(this); this.calendar = calendar; // setting up inputPanel JPanel inputPanel = new JPanel(); JLabel checkin = new JLabel("Check in"); JLabel checkout = new JLabel("Check out"); JButton checkInButton = new JButton(new ImageIcon("calendar_icon.png")); JButton checkOutButton = new JButton(new ImageIcon("calendar_icon.png")); checkInButton.addActionListener(getDateFromCalendar(true)); checkOutButton.addActionListener(getDateFromCalendar(false)); checkInField = new JTextField(10); checkInField.setEditable(false); checkOutField = new JTextField(10); checkOutField.setEditable(false); JLabel roomTypeLabel = new JLabel("Room Type"); JButton luxuryButton = new JButton("$200"); JButton ecoButton = new JButton("$80"); luxuryButton.addActionListener(roomTypeSelected(true)); ecoButton.addActionListener(roomTypeSelected(false)); // check in panel JPanel checkinPanel = new JPanel(); checkinPanel.add(checkin); checkinPanel.add(checkInButton); checkinPanel.add(checkInField); // check out panel JPanel checkoutPanel = new JPanel(); checkoutPanel.add(checkout); checkoutPanel.add(checkOutButton); checkoutPanel.add(checkOutField); // room type panel JPanel roomTypePanel = new JPanel(); roomTypePanel.add(roomTypeLabel); roomTypePanel.add(luxuryButton); roomTypePanel.add(ecoButton); // add check in panel, check out panel and room type panel to input // panel inputPanel.setLayout(new BorderLayout()); inputPanel.add(checkinPanel, BorderLayout.NORTH); inputPanel.add(checkoutPanel, BorderLayout.CENTER); inputPanel.add(roomTypePanel, BorderLayout.SOUTH); // add input panel to frame this.add(inputPanel, BorderLayout.NORTH); // Reservation Panel JPanel reservationPanel = new JPanel(); reservationPanel.setLayout(new BorderLayout()); JLabel roomInfoLabel = new JLabel("Available rooms"); availableRoomArea = new JTextArea(20, 20); availableRoomArea.setLineWrap(true); availableRoomArea.setEditable(false); JScrollPane scrollPane = new JScrollPane(availableRoomArea); JLabel roomChoiceLabel = new JLabel("Enter room number to reserve"); roomChoiceField = new JTextField(10); roomChoiceField.setEditable(false); // confirm button JButton confirm = new JButton("Confirm"); confirm.addActionListener(event -> { if (checkInField.getText() == null || checkOutField.getText() == null || !roomChoiceField.getText().matches("^[0-9]*$") || roomChoiceField.getText().equals("")) { JOptionPane.showMessageDialog(MakeRsvpFrame.this, "Please enter valid input"); } else { String roomChoice = ""; if (isLuxury) { roomChoice = "LUXURY" + roomChoiceField.getText(); } else { roomChoice = "ECO" + roomChoiceField.getText(); } boolean result = hotel.reserveRoom(roomChoice, checkInDate, checkOutDate); if (checkInDate.isAfter(checkOutDate) || checkInDate.isEqual(checkOutDate)) JOptionPane.showMessageDialog(this, "Please enter valid date"); else { if (result) { JOptionPane.showMessageDialog(this, "Room " + roomChoiceField.getText().toUpperCase() + " is reserved successfully."); hotel.update(); // update model and let changeListener // modify the view } else { JOptionPane.showMessageDialog(this, "Room already reserved by you or unavailable"); } } } }); // more reservation Button JButton moreReservation = new JButton("More Reservation?"); moreReservation.addActionListener(event -> { resetAllField(); }); // done button JButton done = new JButton("Done"); done.addActionListener(event -> { Object[] options = { "Comprehensive", "Simple" }; int n = JOptionPane.showOptionDialog(this, "Simple or Comprehensive", "Print Receipt", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[0]); // simple choice if (n == 1) { hotel.setGetReceipt(new HotelReservationModel.SimpleReceipt()); } else { hotel.setGetReceipt(new HotelReservationModel.ComprehensiveReceipt()); } String receipt = hotel.printReceipt(); JOptionPane.showMessageDialog(this, receipt); resetAllField(); this.setVisible(false); }); JPanel showRoomPanel = new JPanel(); showRoomPanel.setLayout(new BorderLayout()); showRoomPanel.add(roomInfoLabel, BorderLayout.NORTH); showRoomPanel.add(scrollPane, BorderLayout.SOUTH); reservationPanel.add(showRoomPanel, BorderLayout.WEST); // located east of reservation panel to store roomChoicePanel and // navigationPanel JPanel userChoicePanel = new JPanel(); userChoicePanel.setLayout(new BorderLayout()); JPanel roomChoicePanel = new JPanel(); roomChoicePanel.add(roomChoiceLabel); roomChoicePanel.add(roomChoiceField); userChoicePanel.add(roomChoicePanel, BorderLayout.NORTH); JPanel navigationPanel = new JPanel(); navigationPanel.add(confirm); navigationPanel.add(moreReservation); navigationPanel.add(done); userChoicePanel.add(navigationPanel, BorderLayout.SOUTH); reservationPanel.add(userChoicePanel, BorderLayout.EAST); this.add(reservationPanel, BorderLayout.SOUTH); this.setResizable(false); this.setVisible(true); this.pack(); } /** * Updating the textAreas and fields * * @param dateChosen * Date to be checked * @param firstField * boolean variable to determine if Luxury or not */ public void update(LocalDate dateChosen, boolean firstField) { if (firstField) { checkInField.setText(dateChosen.toString()); checkInDate = dateChosen; } else { checkOutField.setText(dateChosen.toString()); checkOutDate = dateChosen; } if (firstField && checkInDate.isBefore(calendar.getDateNow())) { JOptionPane.showMessageDialog(this, "Please pick a future or current date"); calendarChoser.setVisible(true); } else if (!firstField && Reservation.getLengthOfStay(checkInDate, dateChosen) >= 60) { JOptionPane.showMessageDialog(this, "The maximum lenght of stay is 60"); calendarChoser.setVisible(true); } this.repaint(); } /** * Action Listener * * @param firstField * boolean to set to FirstField in CalendarChooser * @return Action Listener */ public ActionListener getDateFromCalendar(boolean firstField) { return new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (calendarChoser == null) { calendarChoser = new CalendarDialog(MakeRsvpFrame.this, calendar); calendar.attachListener(calendarChoser); } calendarChoser.setField(firstField); calendarChoser.setVisible(true); } }; } /** * * @param isluxury * Checking if Luxury or Eco * @return Action Listener */ public ActionListener roomTypeSelected(boolean isluxury) { return new ActionListener() { @Override public void actionPerformed(ActionEvent e) { String list = hotel.getAvailableRoom(checkInDate, checkOutDate, isluxury); isLuxury = isluxury; availableRoomArea.setText(list); roomChoiceField.setEditable(true); } }; } /** * Makes all TextFields and textAreas blank */ public void resetAllField() { checkInField.setText(""); checkOutField.setText(""); availableRoomArea.setText(""); roomChoiceField.setText(""); } @Override /** * Override method that changes the textArea of availableRoomArea and * updates the model */ public void stateChanged(ChangeEvent e) { availableRoomArea.setText(hotel.getAvailableRoom(checkInDate, checkOutDate, isLuxury)); } }
[ "pghkim94@gmail.com" ]
pghkim94@gmail.com
ea7fe6dbcf5033383851fb88e066568a1ba46000
c93126ff1f4334d88168490ab017a992d3643dc4
/Xc/app/src/main/java/com/example/adapter/NewAdapter.java
08abbde9622e75adc35ee77893b27467e2a87041
[]
no_license
Redimi0-99/AndroidXC
5414d993be302b24b355c239ae736903414417a9
6f287e5e9a9b1e0ca264d4a262ce08c2d70cda93
refs/heads/master
2023-05-30T19:27:22.880726
2021-06-20T08:58:21
2021-06-20T08:58:21
378,600,331
0
0
null
null
null
null
UTF-8
Java
false
false
2,305
java
package com.example.adapter; import androidx.recyclerview.widget.RecyclerView; import android.util.Log; import android.view.View; import android.view.ViewGroup; import androidx.fragment.app.FragmentActivity; import androidx.annotation.NonNull; import com.example.xc.R; import android.widget.ImageView; import android.widget.TextView; import android.view.LayoutInflater; public class NewAdapter extends RecyclerView.Adapter<NewAdapter.ViewHolder> { private FragmentActivity activity; private int[] image; private String[] text; public NewAdapter(FragmentActivity activity, int[] image, String[] text){ this.activity=activity; this.image=image; this.text=text; Log.e("test","0000数组长度:"+text.length); } @NonNull @Override public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { Log.e("test","11111"); View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.new_item,parent,false); ViewHolder holder=new ViewHolder(view); //调用内部类ViewHolder return holder; } @Override public void onBindViewHolder(@NonNull final ViewHolder holder, final int position) { //异步加载选项数据 new Thread(new Runnable() { @Override public void run() { activity.runOnUiThread(new Runnable() { @Override public void run() { if((image.length!=0)&&(text.length!=0)){ holder.iv.setImageResource(image[position]); holder.tv.setText(text[position]); } } }); } }).start(); } @Override public int getItemCount() { return image.length ; } public static class ViewHolder extends RecyclerView.ViewHolder{ ImageView iv; TextView tv; public ViewHolder(@NonNull View itemView) { super(itemView); iv=itemView.findViewById(R.id.newImage); //获得列表选项图片控件 tv=itemView.findViewById(R.id.newText); //获得列表选项文本控件 } } }
[ "82999613+Redimi0-99@users.noreply.github.com" ]
82999613+Redimi0-99@users.noreply.github.com
86d3edb1b1c98e175797c4be8e6d27d15b3ae7e4
30508dc7a377fbb58fc13e9eee3da03ff17b6443
/src/main/java/com/nstanogias/taskbackend/repository/UserRepository.java
c54c47e96b1454684103d01c1332427aafe139d7
[]
no_license
nstanogias/angular-task-backend
dc6ab565aca5ecb50f1475d10212885a05c10a01
35ad38403d7fc4a7998ae02ebffdfc5ba7cfbfff
refs/heads/master
2020-05-22T23:19:20.241970
2019-05-18T10:08:43
2019-05-18T10:08:43
186,557,160
0
0
null
null
null
null
UTF-8
Java
false
false
417
java
package com.nstanogias.taskbackend.repository; import com.nstanogias.taskbackend.model.User; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import java.util.Optional; @Repository public interface UserRepository extends JpaRepository<User, Long> { Optional<User> findByUsername(String username); Boolean existsByUsername(String username); }
[ "nstanogias@gmail.com" ]
nstanogias@gmail.com
6a7276c42d9b8353a063f4000b613db3301f86f9
dc4dc9d539de5bef925ffdb6249d2d2e6061a80c
/activiti_samples_provider/src/main/java/com/example/service/common/ActivityService.java
4a5031b0002a79bc71469001ad59608a6c0095bd
[]
no_license
yywzt/activiti_samples
0c207601c4ed4f55310f21e4fdf1c5f0ef158a6c
5feda713d9d0ef8f8421a9933a1b525bbede19c9
refs/heads/master
2020-04-04T18:15:25.945495
2019-03-12T06:38:09
2019-03-12T06:42:23
156,156,357
4
3
null
null
null
null
UTF-8
Java
false
false
4,259
java
package com.example.service.common; import com.example.bo.ActivitiBo; import org.activiti.bpmn.model.*; import org.activiti.engine.RepositoryService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.Collection; import java.util.List; @Service("activityService") public class ActivityService { @Autowired private RepositoryService repositoryService; public List<ActivitiBo> getActivitiList(String processDefId){ BpmnModel model = repositoryService.getBpmnModel(processDefId); Collection<FlowElement> elements = model.getMainProcess().getFlowElements(); List<ActivitiBo> activitiList = new ArrayList<ActivitiBo>(); if(elements!=null){ for(FlowElement ele : elements){ if(ele instanceof Task){ activitiList.add(new ActivitiBo(ele.getId(),ele.getName())); } if(ele instanceof StartEvent){ activitiList.add(new ActivitiBo(ele.getId(),ele.getName())); } } } return activitiList; } public List<ActivitiBo> getActivitiListNotMe(String processDefId,String activitiId){ BpmnModel model = repositoryService.getBpmnModel(processDefId); Collection<FlowElement> elements = model.getMainProcess().getFlowElements(); List<ActivitiBo> activitiList = new ArrayList<ActivitiBo>(); if(elements!=null){ for(FlowElement ele : elements){ if(ele instanceof Task){ if(activitiId.equals(ele.getId())) continue; activitiList.add(new ActivitiBo(ele.getId(),ele.getName())); } } } return activitiList; } public ActivitiBo getActiviti(String processDefId,String activitId){ BpmnModel model = repositoryService.getBpmnModel(processDefId); FlowElement element = model.getMainProcess().getFlowElement(activitId); if(element!=null){ return new ActivitiBo(element.getId(),element.getName()); } return null; } public List<UserTask> getUserTaskList(String processDefId){ BpmnModel model = repositoryService.getBpmnModel(processDefId); Collection<FlowElement> elements = model.getMainProcess().getFlowElements(); List<UserTask> userTaskList = new ArrayList<UserTask>(); if(elements!=null){ for(FlowElement ele : elements){ if(ele instanceof UserTask){ userTaskList.add((UserTask)ele); } } } return userTaskList; } public StartEvent getStartEvent(String processDefId){ BpmnModel model = repositoryService.getBpmnModel(processDefId); Collection<FlowElement> elements = model.getMainProcess().getFlowElements(); StartEvent result = null; if(elements!=null){ for(FlowElement ele : elements){ if(ele instanceof StartEvent){ result=(StartEvent)ele; break; } } } return result; } public UserTask getUserTaskApprove(String processDefId){ BpmnModel model = repositoryService.getBpmnModel(processDefId); Collection<FlowElement> elements = model.getMainProcess().getFlowElements(); UserTask result = null; if(elements!=null){ for(FlowElement ele : elements){ if(ele instanceof UserTask){ result=(UserTask)ele; break; } } } return result; } public EndEvent getEndEvent(String processDefId){ BpmnModel model = repositoryService.getBpmnModel(processDefId); Collection<FlowElement> elements = model.getMainProcess().getFlowElements(); EndEvent result = null; if(elements!=null){ for(FlowElement ele : elements){ if(ele instanceof EndEvent){ result=(EndEvent)ele; break; } } } return result; } }
[ "2507967396@qq.com" ]
2507967396@qq.com
b0204538799a5901e7f22d4a3cd5dd06bce36b71
eff9d1e6ce4032c7a2618cf8b40922401f3d1ce0
/ls-java-core/src/main/java/com/ls/design_pattern/factory/abs/Customer.java
01a8d9ba9064b3239dbc826f162a1acd165b726e
[]
no_license
lishuai2016/all
67d8ff5db911ca5c38b249172d3dcbf4234d49d7
aa7d6774611c21e126e628268a6abd020138974f
refs/heads/master
2022-12-09T11:03:08.571479
2019-08-18T16:38:41
2019-08-18T16:38:44
200,311,974
5
4
null
2022-11-16T07:57:51
2019-08-03T00:08:21
Java
UTF-8
Java
false
false
662
java
package com.ls.design_pattern.factory.abs; import com.ls.design_pattern.factory.abs.factory.FactoryBMW; import com.ls.design_pattern.factory.abs.factory.FactoryBMW320; import com.ls.design_pattern.factory.abs.factory.FactoryBMW523; /** * 抽象工厂模式客户端 * Created by cipher on 2017/9/6. */ public class Customer { public static void main(String[] args) { FactoryBMW factoryBMW320 = new FactoryBMW320(); factoryBMW320.createEngie(); factoryBMW320.createAircondition(); FactoryBMW factoryBMW523 = new FactoryBMW523(); factoryBMW523.createEngie(); factoryBMW523.createAircondition(); } }
[ "1830473670@qq.com" ]
1830473670@qq.com
28dcba95caa31cb1afa592e0e49762cf77e21496
1e5e3158d75d886a3d74e4e4f9060903a4da0260
/app/src/main/java/com/jogger/beautifulapp/function/model/FindChoiceModel.java
0022cb2a7a00e532eab00853bd38835dd7721508
[]
no_license
weileng11/BeautifulApp-master
528a3c282e06b384e5ebad8eba06f20f3a009dc6
ca4227ed2dcd005c8cefe79ef7562e94ba70afd8
refs/heads/master
2020-04-24T14:36:45.458268
2019-02-22T08:35:09
2019-02-22T08:35:09
172,026,897
1
0
null
null
null
null
UTF-8
Java
false
false
778
java
package com.jogger.beautifulapp.function.model; import com.jogger.beautifulapp.entity.AppInfo; import com.jogger.beautifulapp.entity.FindChoiceData; import com.jogger.beautifulapp.function.contract.FindChoiceContract; import com.jogger.beautifulapp.http.HttpAction; import com.jogger.beautifulapp.http.listener.OnHttpRequestListener; public class FindChoiceModel implements FindChoiceContract.Model { @Override public void getFindChoiceDatas(String startDate, OnHttpRequestListener<FindChoiceData> listener) { HttpAction.getHttpAction().getFindChoiceDatas(startDate, listener); } @Override public void getChoiceDescData(int id, OnHttpRequestListener<AppInfo> listener) { HttpAction.getHttpAction().getChoiceDescData(id, listener); } }
[ "litao143" ]
litao143
6c0f2af381f8be9a211376eb2c4e72de43c94c47
870d6d82b3175d5bd2f24b2fd984063eff8a419f
/app/src/main/java/ubasurvey/nawin/com/ubasurvey/FamilyDetailsAdapter.java
8553d121a390f974ce765069cb286b3b5d87502e
[]
no_license
NavinVNK/UBASurvey
4df4e3ca67a14d1128f6c39ee0c2375cbfa6b767
b213553cb51daec9e3407b25545995365162ea83
refs/heads/master
2020-04-07T11:26:48.919109
2020-02-24T01:24:43
2020-02-24T01:24:43
158,326,489
0
0
null
null
null
null
UTF-8
Java
false
false
1,562
java
package ubasurvey.nawin.com.ubasurvey; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import java.util.List; public class FamilyDetailsAdapter extends RecyclerView.Adapter<FamilyDetailsAdapter.MyViewHolder> { private List<FamilyDetails> familyList; public class MyViewHolder extends RecyclerView.ViewHolder { public TextView familyMemberName, familyMemberID; public MyViewHolder(View view) { super(view); familyMemberName = (TextView) view.findViewById(R.id.familymemberdetail); // familyMemberID = (TextView) view.findViewById(R.id.familyid); } } public FamilyDetailsAdapter(List<FamilyDetails> familyList) { this.familyList = familyList; } @Override public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View itemView = LayoutInflater.from(parent.getContext()) .inflate(R.layout.familydetails_list_row, parent, false); return new MyViewHolder(itemView); } @Override public void onBindViewHolder(MyViewHolder holder, int position) { FamilyDetails family = familyList.get(position); holder.familyMemberName.setText(family.getUbaindid().toString()+" . "+family.getName()); //holder.familyMemberID.setText(family.getUbaindid().toString()); } @Override public int getItemCount() { return familyList.size(); } }
[ "nav_wins@yahoo.co.in" ]
nav_wins@yahoo.co.in
94338a2529d4ed6a924883721e11d46572c0f1fb
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_74be2181c8058e20cdde3b2238c038c2fa245696/Partition/2_74be2181c8058e20cdde3b2238c038c2fa245696_Partition_t.java
0961b1dc028701ccf53705405f99917cf2d86d47
[]
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
11,442
java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF 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.apache.directory.server.core.partition; import org.apache.directory.server.core.DirectoryService; import org.apache.directory.server.core.entry.ClonedServerEntry; import org.apache.directory.server.core.entry.ServerSearchResult; import org.apache.directory.server.core.filtering.EntryFilteringCursor; import org.apache.directory.server.core.interceptor.context.AddOperationContext; import org.apache.directory.server.core.interceptor.context.BindOperationContext; import org.apache.directory.server.core.interceptor.context.DeleteOperationContext; import org.apache.directory.server.core.interceptor.context.EntryOperationContext; import org.apache.directory.server.core.interceptor.context.ListOperationContext; import org.apache.directory.server.core.interceptor.context.LookupOperationContext; import org.apache.directory.server.core.interceptor.context.ModifyOperationContext; import org.apache.directory.server.core.interceptor.context.MoveAndRenameOperationContext; import org.apache.directory.server.core.interceptor.context.MoveOperationContext; import org.apache.directory.server.core.interceptor.context.RenameOperationContext; import org.apache.directory.server.core.interceptor.context.SearchOperationContext; import org.apache.directory.server.core.interceptor.context.UnbindOperationContext; import org.apache.directory.shared.ldap.name.LdapDN; import javax.naming.Context; import javax.naming.InvalidNameException; /** * An interfaces that bridges between underlying JNDI entries and JNDI * {@link Context} API. DIT (Directory Information Tree) consists one or * above {@link Partition}s whose parent is {@link PartitionNexus}, * and all of them are mapped to different * base suffix. Each partition contains entries whose name ends with that * base suffix. * * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> * @version $Rev$ */ public interface Partition { // ----------------------------------------------------------------------- // C O N F I G U R A T I O N M E T H O D S // ----------------------------------------------------------------------- /** * Gets the unique identifier for this partition. * * @return the unique identifier for this partition */ String getId(); /** * Sets the unique identifier for this partition. * * @param id the unique identifier for this partition */ void setId( String id ); /** * Gets the suffix for this Partition. * * @return the suffix for this Partition. */ LdapDN getSuffix(); /** * Sets the non-normalized suffix for this Partition as a string. * * @param suffix the suffix string for this Partition. * @throws InvalidNameException If the suffix is not a valid DN */ void setSuffix( String suffix ) throws InvalidNameException; /** * Used to specify the entry cache size for a Partition. Various Partition * implementations may interpret this value in different ways: i.e. total cache * size limit verses the number of entries to cache. * * @param cacheSize the size of the cache */ void setCacheSize( int cacheSize ); /** * Gets the entry cache size for this partition. * * @return the size of the cache */ int getCacheSize(); // ----------------------------------------------------------------------- // E N D C O N F I G U R A T I O N M E T H O D S // ----------------------------------------------------------------------- /** * Initializes this partition. * * @param core the directory core for the server. * @throws Exception if initialization fails in any way */ void init( DirectoryService core ) throws Exception; /** * Deinitialized this partition. */ void destroy() throws Exception; /** * Checks to see if this partition is initialized or not. * @return true if the partition is initialized, false otherwise */ boolean isInitialized(); /** * Flushes any changes made to this partition now. * @throws Exception if buffers cannot be flushed to disk */ void sync() throws Exception; /** * Deletes a leaf entry from this ContextPartition: non-leaf entries cannot be * deleted until this operation has been applied to their children. * * @param opContext the context of the entry to * delete from this ContextPartition. * @throws Exception if there are any problems */ void delete( DeleteOperationContext opContext ) throws Exception; /** * Adds an entry to this ContextPartition. * * @param opContext the context used to add and entry to this ContextPartition * @throws Exception if there are any problems */ void add( AddOperationContext opContext ) throws Exception; /** * Modifies an entry by adding, removing or replacing a set of attributes. * * @param opContext The contetx containin the modification operation * to perform on the entry which is one of constants specified by the * DirContext interface: * <code>ADD_ATTRIBUTE, REMOVE_ATTRIBUTE, REPLACE_ATTRIBUTE</code>. * * @throws Exception if there are any problems * @see javax.naming.directory.DirContext * @see javax.naming.directory.DirContext#ADD_ATTRIBUTE * @see javax.naming.directory.DirContext#REMOVE_ATTRIBUTE * @see javax.naming.directory.DirContext#REPLACE_ATTRIBUTE */ void modify( ModifyOperationContext opContext ) throws Exception; /** * A specialized form of one level search used to return a minimal set of * information regarding child entries under a base. Convenience method * used to optimize operations rather than conducting a full search with * retrieval. * * @param opContext the context containing the distinguished/absolute name for the search/listing * @return a NamingEnumeration containing objects of type {@link ServerSearchResult} * @throws Exception if there are any problems */ EntryFilteringCursor list( ListOperationContext opContext ) throws Exception; /** * Conducts a search against this ContextPartition. Namespace specific * parameters for search are contained within the environment using * namespace specific keys into the hash. For example in the LDAP namespace * a ContextPartition implementation may look for search Controls using a * namespace specific or implementation specific key for the set of LDAP * Controls. * * @param opContext The context containing the information used by the operation * @throws Exception if there are any problems * @return a NamingEnumeration containing objects of type */ EntryFilteringCursor search( SearchOperationContext opContext ) throws Exception; /** * Looks up an entry by distinguished/absolute name. This is a simplified * version of the search operation used to point read an entry used for * convenience. * * Depending on the context parameters, we my look for a simple entry, * or for a restricted set of attributes for this entry * * @param lookupContext The context containing the parameters * @return an Attributes object representing the entry * @throws Exception if there are any problems */ ClonedServerEntry lookup( LookupOperationContext lookupContext ) throws Exception; ClonedServerEntry lookup( Long id ) throws Exception; /** * Fast operation to check and see if a particular entry exists. * * @param opContext The context used to pass informations * @return true if the entry exists, false if it does not * @throws Exception if there are any problems */ boolean hasEntry( EntryOperationContext opContext ) throws Exception; /** * Modifies an entry by changing its relative name. Optionally attributes * associated with the old relative name can be removed from the entry. * This makes sense only in certain namespaces like LDAP and will be ignored * if it is irrelavent. * * @param opContext the modify DN context * @throws Exception if there are any problems */ void rename( RenameOperationContext opContext ) throws Exception; /** * Transplants a child entry, to a position in the namespace under a new * parent entry. * * @param opContext The context containing the DNs to move * @throws Exception if there are any problems */ void move( MoveOperationContext opContext ) throws Exception; /** * Transplants a child entry, to a position in the namespace under a new * parent entry and changes the RN of the child entry which can optionally * have its old RN attributes removed. The removal of old RN attributes * may not make sense in all namespaces. If the concept is undefined in a * namespace this parameters is ignored. An example of a namespace where * this parameter is significant is the LDAP namespace. * * @param opContext The context contain all the information about * the modifyDN operation * @throws Exception if there are any problems */ void moveAndRename( MoveAndRenameOperationContext opContext ) throws Exception; /** * Represents a bind operation issued to authenticate a client. Partitions * need not support this operation. This operation is here to enable those * interested in implementing virtual directories with ApacheDS. * * @param opContext the bind context, containing all the needed informations to bind * @throws Exception if something goes wrong */ void bind( BindOperationContext opContext ) throws Exception; /** * Represents an unbind operation issued by an authenticated client. Partitions * need not support this operation. This operation is here to enable those * interested in implementing virtual directories with ApacheDS. * * @param opContext the context used to unbind * @throws Exception if something goes wrong */ void unbind( UnbindOperationContext opContext ) throws Exception; }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
07eb109c9b96c8f7ef20275d46a6201767d96123
6331d7b7d57799a8eb584672ff33d50cac489143
/source/zookeeper-learning/reflect/src/main/java/com/soul/reflect/demo/ReflectDemo.java
2f213a97886c183849ef6526519cfb8e1aee03af
[]
no_license
wangkunSE/notes
9f7def0d91353eb3f42904e5f7a2f52cb2815ba2
a204010706977a1cc334515e7e40266cdbc34f50
refs/heads/master
2022-12-22T08:59:46.438186
2020-12-17T02:41:08
2020-12-17T02:41:08
89,057,798
0
1
null
2022-12-16T10:31:48
2017-04-22T09:10:25
Java
UTF-8
Java
false
false
1,149
java
package com.soul.reflect.demo; import com.soul.domain.User; import java.lang.reflect.Constructor; import java.lang.reflect.Method; /*** * @author wangkun1 * @version 2018/1/17 */ public class ReflectDemo { public static void main(String[] args) throws Exception { createInstance(); } private static void createInstance() throws Exception { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); System.out.println("Loader : " + classLoader); System.out.println("Parent Loader : " + classLoader.getParent()); System.out.println("GrantParent Loader : " + classLoader.getParent().getParent()); Class<?> loadClass = classLoader.loadClass("com.soul.domain.User"); Constructor<?> constructor = loadClass.getDeclaredConstructor((Class<?>[]) null); User user = (User) constructor.newInstance(); Method userName = loadClass.getMethod("setUserName", String.class); userName.invoke(user, "狗蛋"); Method id = loadClass.getMethod("setId", String.class); id.invoke(user, "1"); System.out.println(user); } }
[ "wangkun1@corp.netease.com" ]
wangkun1@corp.netease.com
e259020d1f5fb655ee6a67cefb3cc7b0ab1c7b36
91c9c7f9115ab72efd8a492dcdd5ddb72c381b33
/app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/com/facebook/messenger/R.java
e203adfe97024fb1ca1e4408b2bdad15b493cdfe
[]
no_license
anant100/restaurant-finder-android
c76c61d104d6f755281951a34689a356b35e10ff
fca0c9ea47c69b895621b1f460e5e57a925b07a2
refs/heads/master
2020-09-17T09:37:35.145712
2019-11-26T00:46:37
2019-11-26T00:46:37
224,067,582
0
0
null
null
null
null
UTF-8
Java
false
false
10,761
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 com.facebook.messenger; public final class R { private R() {} public static final class attr { private attr() {} public static final int font = 0x7f0300d7; public static final int fontProviderAuthority = 0x7f0300d9; public static final int fontProviderCerts = 0x7f0300da; public static final int fontProviderFetchStrategy = 0x7f0300db; public static final int fontProviderFetchTimeout = 0x7f0300dc; public static final int fontProviderPackage = 0x7f0300dd; public static final int fontProviderQuery = 0x7f0300de; public static final int fontStyle = 0x7f0300df; public static final int fontWeight = 0x7f0300e0; } public static final class bool { private bool() {} public static final int abc_action_bar_embed_tabs = 0x7f040000; } public static final class color { private color() {} public static final int notification_action_color_filter = 0x7f050072; public static final int notification_icon_bg_color = 0x7f050073; public static final int ripple_material_light = 0x7f050086; public static final int secondary_text_default_material_light = 0x7f050088; } public static final class dimen { private dimen() {} public static final int compat_button_inset_horizontal_material = 0x7f06007c; public static final int compat_button_inset_vertical_material = 0x7f06007d; public static final int compat_button_padding_horizontal_material = 0x7f06007e; public static final int compat_button_padding_vertical_material = 0x7f06007f; public static final int compat_control_corner_material = 0x7f060080; public static final int notification_action_icon_size = 0x7f060094; public static final int notification_action_text_size = 0x7f060095; public static final int notification_big_circle_margin = 0x7f060096; public static final int notification_content_margin_start = 0x7f060097; public static final int notification_large_icon_height = 0x7f060098; public static final int notification_large_icon_width = 0x7f060099; public static final int notification_main_column_padding_top = 0x7f06009a; public static final int notification_media_narrow_margin = 0x7f06009b; public static final int notification_right_icon_size = 0x7f06009c; public static final int notification_right_side_padding_top = 0x7f06009d; public static final int notification_small_icon_background_padding = 0x7f06009e; public static final int notification_small_icon_size_as_large = 0x7f06009f; public static final int notification_subtext_size = 0x7f0600a0; public static final int notification_top_pad = 0x7f0600a1; public static final int notification_top_pad_large_text = 0x7f0600a2; } public static final class drawable { private drawable() {} public static final int messenger_bubble_large_blue = 0x7f070175; public static final int messenger_bubble_large_white = 0x7f070176; public static final int messenger_bubble_small_blue = 0x7f070177; public static final int messenger_bubble_small_white = 0x7f070178; public static final int messenger_button_blue_bg_round = 0x7f070179; public static final int messenger_button_blue_bg_selector = 0x7f07017a; public static final int messenger_button_send_round_shadow = 0x7f07017b; public static final int messenger_button_white_bg_round = 0x7f07017c; public static final int messenger_button_white_bg_selector = 0x7f07017d; public static final int notification_action_background = 0x7f07018f; public static final int notification_bg = 0x7f070190; public static final int notification_bg_low = 0x7f070191; public static final int notification_bg_low_normal = 0x7f070192; public static final int notification_bg_low_pressed = 0x7f070193; public static final int notification_bg_normal = 0x7f070194; public static final int notification_bg_normal_pressed = 0x7f070195; public static final int notification_icon_background = 0x7f070196; public static final int notification_template_icon_bg = 0x7f070197; public static final int notification_template_icon_low_bg = 0x7f070198; public static final int notification_tile_bg = 0x7f070199; public static final int notify_panel_notification_icon_bg = 0x7f07019a; } public static final class id { private id() {} public static final int action_container = 0x7f08003b; public static final int action_divider = 0x7f08003d; public static final int action_image = 0x7f08003e; public static final int action_text = 0x7f080044; public static final int actions = 0x7f080045; public static final int async = 0x7f080073; public static final int blocking = 0x7f08007d; public static final int chronometer = 0x7f0800b8; public static final int forever = 0x7f080106; public static final int icon = 0x7f080111; public static final int icon_group = 0x7f080112; public static final int info = 0x7f08011b; public static final int italic = 0x7f080123; public static final int line1 = 0x7f080128; public static final int line3 = 0x7f080129; public static final int messenger_send_button = 0x7f08013e; public static final int normal = 0x7f08015f; public static final int notification_background = 0x7f080160; public static final int notification_main_column = 0x7f080161; public static final int notification_main_column_container = 0x7f080162; public static final int right_icon = 0x7f080182; public static final int right_side = 0x7f080183; public static final int tag_transition_group = 0x7f0801bd; public static final int text = 0x7f0801c0; public static final int text2 = 0x7f0801c2; public static final int time = 0x7f0801ca; public static final int title = 0x7f0801cb; } public static final class integer { private integer() {} public static final int status_bar_notification_info_maxnum = 0x7f090009; } public static final class layout { private layout() {} public static final int messenger_button_send_blue_large = 0x7f0b0058; public static final int messenger_button_send_blue_round = 0x7f0b0059; public static final int messenger_button_send_blue_small = 0x7f0b005a; public static final int messenger_button_send_white_large = 0x7f0b005b; public static final int messenger_button_send_white_round = 0x7f0b005c; public static final int messenger_button_send_white_small = 0x7f0b005d; public static final int notification_action = 0x7f0b0064; public static final int notification_action_tombstone = 0x7f0b0065; public static final int notification_template_custom_big = 0x7f0b006c; public static final int notification_template_icon_group = 0x7f0b006d; public static final int notification_template_part_chronometer = 0x7f0b0071; public static final int notification_template_part_time = 0x7f0b0072; } public static final class string { private string() {} public static final int messenger_send_button_text = 0x7f0e007f; public static final int status_bar_notification_info_overflow = 0x7f0e0093; } public static final class style { private style() {} public static final int MessengerButton = 0x7f0f00af; public static final int MessengerButtonText = 0x7f0f00b6; public static final int MessengerButtonText_Blue = 0x7f0f00b7; public static final int MessengerButtonText_Blue_Large = 0x7f0f00b8; public static final int MessengerButtonText_Blue_Small = 0x7f0f00b9; public static final int MessengerButtonText_White = 0x7f0f00ba; public static final int MessengerButtonText_White_Large = 0x7f0f00bb; public static final int MessengerButtonText_White_Small = 0x7f0f00bc; public static final int MessengerButton_Blue = 0x7f0f00b0; public static final int MessengerButton_Blue_Large = 0x7f0f00b1; public static final int MessengerButton_Blue_Small = 0x7f0f00b2; public static final int MessengerButton_White = 0x7f0f00b3; public static final int MessengerButton_White_Large = 0x7f0f00b4; public static final int MessengerButton_White_Small = 0x7f0f00b5; public static final int TextAppearance_Compat_Notification = 0x7f0f010e; public static final int TextAppearance_Compat_Notification_Info = 0x7f0f010f; public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0f0111; public static final int TextAppearance_Compat_Notification_Time = 0x7f0f0114; public static final int TextAppearance_Compat_Notification_Title = 0x7f0f0116; public static final int Widget_Compat_NotificationActionContainer = 0x7f0f018a; public static final int Widget_Compat_NotificationActionText = 0x7f0f018b; } public static final class styleable { private styleable() {} public static final int[] FontFamily = { 0x7f0300d9, 0x7f0300da, 0x7f0300db, 0x7f0300dc, 0x7f0300dd, 0x7f0300de }; 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, 0x7f0300d7, 0x7f0300df, 0x7f0300e0 }; public static final int FontFamilyFont_android_font = 0; public static final int FontFamilyFont_android_fontWeight = 1; public static final int FontFamilyFont_android_fontStyle = 2; public static final int FontFamilyFont_font = 3; public static final int FontFamilyFont_fontStyle = 4; public static final int FontFamilyFont_fontWeight = 5; } }
[ "noreply@github.com" ]
anant100.noreply@github.com
9ab9d4126832d7d1952bce97762096700e7226d6
e629fba87bb93eeaf673d3b6f9be3896a63b2d4f
/samples/books/src/com/apigee/sample/books/BooksApplication.java
4cf083f94e8ecb60096079e749ac469df2a15f3b
[ "Apache-2.0" ]
permissive
PearsonEducation/apigee-android-sdk
a32a35bd5f7be00699c19318dcf77f9f4c2b781c
586572d3322a017be11b25503f543eb9a8875594
refs/heads/master
2021-01-10T19:38:06.036699
2013-09-11T20:37:37
2013-09-11T20:37:37
12,814,318
0
1
null
null
null
null
UTF-8
Java
false
false
742
java
package com.apigee.sample.books; import com.apigee.sdk.ApigeeClient; import com.apigee.sdk.data.client.DataClient; import android.app.Application; public class BooksApplication extends Application { public static final String apigeeNotInitializedLogError = "Check org name on line 28 of BooksListViewActivity.java"; private ApigeeClient apigeeClient; public BooksApplication() { this.apigeeClient = null; } public ApigeeClient getApigeeClient() { return this.apigeeClient; } public void setApigeeClient(ApigeeClient apigeeClient) { this.apigeeClient = apigeeClient; } public DataClient getDataClient() { if (this.apigeeClient != null) { return this.apigeeClient.getDataClient(); } return null; } }
[ "pauldardeau@me.com" ]
pauldardeau@me.com
aaf9da4f259d01671aab9d70dc9b21a97175deae
fae0f6be12056ea29ca026f5de7799bccbf6a68b
/app/src/main/java/com/rimi/xaangel/angeldoctor/activity/UnDealReportActivity.java
60492f6d61d4726a25336c24af3bef7c9430eb32
[]
no_license
wf864617223/XAAngelDoctor
cef4bb3bc0dff8e9f7eb8616d286e4cbec5c50ab
93d687c174c7707e9416e478e103bd677430e97f
refs/heads/master
2021-01-12T15:44:00.535294
2016-10-25T08:03:41
2016-10-25T08:03:41
71,873,850
0
0
null
null
null
null
UTF-8
Java
false
false
3,344
java
package com.rimi.xaangel.angeldoctor.activity; import android.os.Bundle; import android.view.View; import android.widget.ImageButton; import android.widget.ListView; import android.widget.TextView; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import com.rimi.xaangel.angeldoctor.BaseActivity; import com.rimi.xaangel.angeldoctor.R; import com.rimi.xaangel.angeldoctor.adapter.MainListAdapter; import com.rimi.xaangel.angeldoctor.bean.Report; import com.rimi.xaangel.angeldoctor.http.HttpUrls; import com.rimi.xaangel.angeldoctor.http.MyCallBack; import com.rimi.xaangel.angeldoctor.http.XHttpRequest; import com.rimi.xaangel.angeldoctor.utils.CommonUtils; import com.rimi.xaangel.angeldoctor.utils.GsonUtils; import com.rimi.xaangel.angeldoctor.utils.SPUtils; import org.json.JSONException; import org.json.JSONObject; import org.xutils.http.RequestParams; import java.util.List; import butterknife.Bind; import butterknife.ButterKnife; import butterknife.OnClick; /** * Created by Android on 2016/6/1. * 今日待办 */ public class UnDealReportActivity extends BaseActivity implements View.OnClickListener{ @Bind(R.id.back_btn) ImageButton backBtn; @Bind(R.id.mListview) ListView mListView; @Bind(R.id.tishi_tv) TextView tishiTv; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_undeal_report); ButterKnife.bind(this); CommonUtils.getLoading(this, "加载中....."); loadData(); } private void loadData(){ RequestParams params = new RequestParams(HttpUrls.REPORT); params.addBodyParameter("method", "dList"); params.addBodyParameter("doctor_code", (String) SPUtils.get(this,DOC_CODE,CODE,"")); params.addBodyParameter("start_date", CommonUtils.getNowDate() + " 0:00:00"); params.addBodyParameter("end_date", CommonUtils.getNowDate() + " 23:59:59"); XHttpRequest.getInstance().httpPost(this, params, new MyCallBack() { @Override public void onCallBack(boolean isSuccess, Object obj) { CommonUtils.dismiss(); if (!isSuccess){ return; } try { JSONObject response = new JSONObject(obj.toString()); List<Report> list ; Gson gson = GsonUtils.getGson(); list = gson.fromJson(response.getJSONArray("list").toString(), new TypeToken<List<Report>>(){}.getType()); if (list == null || list.size() == 0){ tishiTv.setVisibility(View.VISIBLE); } MainListAdapter adapter = new MainListAdapter(UnDealReportActivity.this,list); mListView.setAdapter(adapter); } catch (JSONException e) { e.printStackTrace(); } } }); } @OnClick({R.id.back_btn}) @Override public void onClick(View view) { switch (view.getId()){ case R.id.back_btn: finish(); break; } } @Override protected void onDestroy() { super.onDestroy(); ButterKnife.unbind(this); } }
[ "864617223@qq.com" ]
864617223@qq.com
8295125e06c1a9ed5156c922cb5b96272abd4138
69ab1a108d1c47e70c1dc102a8a0270433c36338
/app/src/main/java/com/example/shosho/dietfood/api/Service.java
d86c6611d493cb7bf8de8e5fce963bd5aee2fa6b
[]
no_license
AlshimaaRifaat/Diet-Food-Version4
9c0e7ceeb5ee0056c0950d2d42d052ad938edcb4
eb571a5e03a67fb9d8b5e8b56f9d92e904541980
refs/heads/master
2020-04-23T22:16:13.438485
2019-02-21T10:01:19
2019-02-21T10:01:19
171,496,236
1
0
null
null
null
null
UTF-8
Java
false
false
3,977
java
package com.example.shosho.dietfood.api; import com.example.shosho.dietfood.model.AddToCardResponse; import com.example.shosho.dietfood.model.CancelSubscribtionResponse; import com.example.shosho.dietfood.model.CardResponse; import com.example.shosho.dietfood.model.ChangePasswordResponse; import com.example.shosho.dietfood.model.CheckOut.CheckOutResponse; import com.example.shosho.dietfood.model.DeleteCardResponse; import com.example.shosho.dietfood.model.MinCardResponse; import com.example.shosho.dietfood.model.MyOrdersResponse; import com.example.shosho.dietfood.model.MySubscribtionResponse; import com.example.shosho.dietfood.model.OrderDetailsResponse; import com.example.shosho.dietfood.model.PackageDetailsResponse; import com.example.shosho.dietfood.model.PaidConsultationResponse; import com.example.shosho.dietfood.model.PostOrderResponse; import com.example.shosho.dietfood.model.SubscribtionResponse; import com.example.shosho.dietfood.model.home.HomeBannerResponse; import com.example.shosho.dietfood.model.home.HomeProductResponse; import com.example.shosho.dietfood.model.LoginResponse; import com.example.shosho.dietfood.model.MealComponentResponse; import com.example.shosho.dietfood.model.ProducerFamilyResponse; import com.example.shosho.dietfood.model.ProfileResponse; import com.example.shosho.dietfood.model.register.RegisterResponse; import com.example.shosho.dietfood.model.ResetPasswordResponse; import com.example.shosho.dietfood.model.UpdateProfileResponse; import java.util.Map; import retrofit2.Call; import retrofit2.http.Body; import retrofit2.http.GET; import retrofit2.http.POST; public interface Service { @POST("register") Call<RegisterResponse> getRegisterData(@Body Map<String,String> map); @POST("login") Call<LoginResponse> getLoginData(@Body Map<String,String> map); @POST("getProfile") Call<ProfileResponse> getProfileData(@Body Map<String,String> map); @POST("updateProfile") Call<UpdateProfileResponse> getUpdatedProfileData(@Body Map<String,String> map); @GET("homeMeal") Call<HomeProductResponse> getHomeProductData(); @POST("changePassword") Call<ChangePasswordResponse> getChangePasswordData(@Body Map<String,String> map); @GET("banners") Call<HomeBannerResponse>getHomeBannerData(); @POST("restPassword") Call<ResetPasswordResponse> getResetPasswordData(@Body Map<String,String> map); @GET("mealFood") Call<ProducerFamilyResponse> getProducerFamilyData(); @POST("detailsMealFood") Call<MealComponentResponse> getMealComponentData(@Body Map<String,String> map); @POST("detailsPackages") Call<PackageDetailsResponse> getPackageDetailsData(@Body Map<String,String> map); @POST("postCart") Call<AddToCardResponse> getAddToCardData(@Body Map<String,String> map); @POST("getCart") Call<CardResponse> getCardData(@Body Map<String,String> map); @POST("minCart") Call<MinCardResponse> getMinCardData(@Body Map<String,String> map); @POST("deleteCart") Call<DeleteCardResponse> getDeleteCardData(@Body Map<String,String> map); @POST("postOrder") Call<PostOrderResponse> getPostOrderData(@Body Map<String,String> map); @POST("consultings") Call<PaidConsultationResponse> getPaidConsultationData(@Body Map<String,String> map); @POST("getOrder") Call<MyOrdersResponse> getMyOrdersData(@Body Map<String,String> map); @POST("getOrderDetails") Call<OrderDetailsResponse> getMyOrderDetailsData(@Body Map<String,String> map); @POST("subscribe") Call<SubscribtionResponse> getSubscribtionData(@Body Map<String,String> map); @POST("getSubscribe") Call<MySubscribtionResponse> getMySubscribtionData(@Body Map<String,String> map); @POST("cancelSubscribe") Call<CancelSubscribtionResponse> getCancelSubscribtionData(@Body Map<String,String> map); @POST("checkout") Call<CheckOutResponse> getCheckOutData(@Body Map<String,String> map); }
[ "alshimaa.rifaat@gmail.com" ]
alshimaa.rifaat@gmail.com
c325187bf7d8b18f5b826c709bba14822c1565ce
2f8f820585bdff3dc402ee38e5b63a6bb3701eb3
/gyjc-Proj/gyjc-task/src/main/java/com/thinvent/thread/ZDQYCPXSDataThread.java
15cfe6bad0f96eac834eacb46d74aa1b88f36fab
[]
no_license
HolyDogs/Data-Sync
c58c328d7e33d498576beb8c0e137b52d8e72ff5
d070ee24e30cbd338980fdd9127f259098e4bed2
refs/heads/main
2023-04-16T18:20:56.033477
2021-04-24T12:46:10
2021-04-24T12:46:10
361,158,614
0
0
null
null
null
null
UTF-8
Java
false
false
7,068
java
package com.thinvent.thread; import com.thinvent.mapper.IppMapper; import com.thinvent.mapper.MyMapper; import com.github.pagehelper.PageHelper; import org.springframework.stereotype.Component; import java.util.HashMap; import java.util.List; import java.util.UUID; /** * 重点企业主要产品销售、库存、订货及价格 * @author xufeng * @version 1.0 * @date 2020/6/30 上午 9:50 **/ @Component public class ZDQYCPXSDataThread extends Thread { public static Integer getPageNum() { return pageNum; } public static void setPageNum(Integer pageNum) { ZDQYCPXSDataThread.pageNum = pageNum; } static Integer pageNum = 1; public static Integer getMaxPage() { return maxPage; } public static void setMaxPage(Integer maxPage) { ZDQYCPXSDataThread.maxPage = maxPage; } static Integer maxPage = 0;//记录最大页数 public synchronized static int nextPage() { int i = getPageNum(); maxPage = Math.max(maxPage, i); setPageNum(i+1); return i; } public ZDQYCPXSDataThread(IppMapper ippMapper, MyMapper myMapper) { this.myMapper = myMapper; this.ippMapper = ippMapper; } static int max; private IppMapper ippMapper; private MyMapper myMapper; public void run(){ while (true) { int i = nextPage(); //分页查询 PageHelper.startPage(i, 100); List<HashMap<String, String>> list = myMapper.selectZDQYCPXSData(); //超过页数时跳出 if (list == null || list.size() == 0) { break; } for (HashMap theMap:list) { theMap.put("ID", UUID.randomUUID().toString().replace("-", "")); theMap.put("ENROL_NAME", "产品名称(必填项)"); theMap.put("MONTH_MTH_START_DATE", theMap.get("MONTH_MTH_START_DATE").toString().substring(0,10)); theMap.put("MONTH_END_DATE", theMap.get("MONTH_END_DATE").toString().substring(0,10)); theMap.put("ROW", theMap.get("ROW1") == null ? "":String.valueOf(theMap.get("ROW1")) .replaceAll("<FONT>", "").replaceAll("</FONT>", "")); theMap.put("ENROL_ID", theMap.get("DIM_ID")); theMap.put("LYID", "20200630001"); ippMapper.insertToDataMove(theMap); theMap.put("ID", UUID.randomUUID().toString().replace("-", "")); theMap.put("ENROL_NAME", "计量单位"); theMap.put("ROW", String.valueOf(theMap.get("ROW2") == null ? "":theMap.get("ROW2"))); ippMapper.insertToDataMove(theMap); theMap.put("ID", UUID.randomUUID().toString().replace("-", "")); theMap.put("ENROL_NAME", "年初库存量本年"); theMap.put("ROW", String.valueOf(theMap.get("ROW3") == null ? "":theMap.get("ROW3"))); ippMapper.insertToDataMove(theMap); theMap.put("ID", UUID.randomUUID().toString().replace("-", "")); theMap.put("ENROL_NAME", "年初库存量上年同期"); theMap.put("ROW", String.valueOf(theMap.get("ROW4") == null ? "":theMap.get("ROW4"))); ippMapper.insertToDataMove(theMap); theMap.put("ID", UUID.randomUUID().toString().replace("-", "")); theMap.put("ENROL_NAME", "销售量1-本月"); theMap.put("ROW", String.valueOf(theMap.get("ROW5") == null ? "":theMap.get("ROW5"))); ippMapper.insertToDataMove(theMap); theMap.put("ID", UUID.randomUUID().toString().replace("-", "")); theMap.put("ENROL_NAME", "销售量上年同期"); theMap.put("ROW", String.valueOf(theMap.get("ROW6") == null ? "":theMap.get("ROW6"))); ippMapper.insertToDataMove(theMap); theMap.put("ID", UUID.randomUUID().toString().replace("-", "")); theMap.put("ENROL_NAME", "企业自用及其他1-本月"); theMap.put("ROW", String.valueOf(theMap.get("ROW7") == null ? "":theMap.get("ROW7"))); ippMapper.insertToDataMove(theMap); theMap.put("ID", UUID.randomUUID().toString().replace("-", "")); theMap.put("ENROL_NAME", "企业自用及其他上年同期"); theMap.put("ROW", String.valueOf(theMap.get("ROW8") == null ? "":theMap.get("ROW8"))); ippMapper.insertToDataMove(theMap); theMap.put("ID", UUID.randomUUID().toString().replace("-", "")); theMap.put("ENROL_NAME", "期末库存量本年"); theMap.put("ROW", String.valueOf(theMap.get("ROW9") == null ? "":theMap.get("ROW9"))); ippMapper.insertToDataMove(theMap); theMap.put("ID", UUID.randomUUID().toString().replace("-", "")); theMap.put("ENROL_NAME", "期末库存量上年同期"); theMap.put("ROW", String.valueOf(theMap.get("ROW10") == null ? "":theMap.get("ROW10"))); ippMapper.insertToDataMove(theMap); theMap.put("ID", UUID.randomUUID().toString().replace("-", "")); theMap.put("ENROL_NAME", "订货量1-本月"); theMap.put("ROW", String.valueOf(theMap.get("ROW11") == null ? "":theMap.get("ROW11"))); ippMapper.insertToDataMove(theMap); theMap.put("ID", UUID.randomUUID().toString().replace("-", "")); theMap.put("ENROL_NAME", "订货量上年同期"); theMap.put("ROW", String.valueOf(theMap.get("ROW12") == null ? "":theMap.get("ROW12"))); ippMapper.insertToDataMove(theMap); theMap.put("ID", UUID.randomUUID().toString().replace("-", "")); theMap.put("ENROL_NAME", "订货额1-本月"); theMap.put("ROW", String.valueOf(theMap.get("ROW13") == null ? "":theMap.get("ROW13"))); ippMapper.insertToDataMove(theMap); theMap.put("ID", UUID.randomUUID().toString().replace("-", "")); theMap.put("ENROL_NAME", "订货额上年同期"); theMap.put("ROW", String.valueOf(theMap.get("ROW14") == null ? "":theMap.get("ROW14"))); ippMapper.insertToDataMove(theMap); theMap.put("ID", UUID.randomUUID().toString().replace("-", "")); theMap.put("ENROL_NAME", "产品价格(税前)1-本月"); theMap.put("ROW", String.valueOf(theMap.get("ROW15") == null ? "":theMap.get("ROW15"))); ippMapper.insertToDataMove(theMap); theMap.put("ID", UUID.randomUUID().toString().replace("-", "")); theMap.put("ENROL_NAME", "产品价格(税前)上年同期"); theMap.put("ROW", String.valueOf(theMap.get("ROW16") == null ? "":theMap.get("ROW16"))); ippMapper.insertToDataMove(theMap); } } } }
[ "525443029@qq.com" ]
525443029@qq.com
58f73e0bff8c6c802012cffe4114d6bc87b33cb4
452962a7f6dbfe2e7b6f3c1101f657edf4967a74
/src/com/knowology/km/bll/StringOp.java
e6c5695b5106770dac977d55b6e00dd16d4c2227
[]
no_license
mjpln/WordClass
02a2af18399ad01dd613dfd387f901fc5940310b
cf4a23e87cf79b4ded70cf24b6a3e9e49075c272
refs/heads/master
2020-09-20T03:05:42.029964
2019-11-15T09:45:59
2019-11-15T09:45:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,687
java
package com.knowology.km.bll; import java.util.ArrayList; import java.util.List; public class StringOp { // 定义以下三个字符串数组的功能是:由于finalStrs是我们用于定义词模的语法间隔词,因此常在解析词模的过程中使用; // 而词模的关键词(如词类,词条)中也可能出现这些词,为了与间隔词相区分,用户输入时,需加“\\”进行转义。 // 为了保持解析词模过程的简洁性,我们定义了一组中间状态字符串,这些是确认不会出现在关键词中的串。 // 实现解析的过程中,首先用中间串替换转义串,然后用间隔串进行解析;解析后,再将中间串替换成间隔串。 // 例如,将词模“<\\*139>*[<!扣取词类>]*[<!多少词类>]*<话费>@2”先转换成“<\\_a139>*[<!扣取词类>]*[<!多少词类>]*<话费>@2” // 当解析出“\\_a139”是一个模板词后,将其替换成“*139”作为最终结果 // 需替换的字符串数 // const int replacenum = 5; int replacenum = 5; // 词模间隔字符串 String[] finalStrs = new String[] { "*", "@", "#", ">", "<" }; // 转义字符串 String[] orgStrs = new String[] { "\\*", "\\@", "\\#", "\\>", "\\<" }; // 中间状态字符串 String[] repStrs = new String[] { "\\_a", "\\_b", "\\_c", "\\_d", "\\_e" }; // <summary> // 功能说明:将字符串数组转换成无重复项的列表,并去除字符串中的换行符 // 调用说明:批量添加数据(如词模,词类,词条等)时,将一段文本解析成一个字符串数组后的操作 // 创建人:曹亚男 // 创建时间:2008-12 // 维护人:曹亚男 // </summary> // <param name="strArray">字符串数组</param> // <returns>字符串列表</returns> public static List<String> toList(String[] strArray) { // 字符串列表 List<String> list = new ArrayList<String>(); if (strArray != null && strArray.length > 0) { // 循环处理每一个字符串 for (int i = 0; i < strArray.length; i++) { // 去除换行符 String str = strArray[i].replace("\r", "").trim(); // 无重复添加 if (!list.contains(str) && str != "") list.add(str); } } return list; } // <summary> // 功能说明:从词模中抽取模板词,模板词是指组成词模的词条元素,不包括词类 // 如,词模“<!13800138000词类>*[<!扣取词类>]*[<!多少词类>]*<话费>@2”中的模板词有“话费” // 创建人:曹亚男 // 创建时间:2008-12 // 维护人:曹亚男 // </summary> // <param name="pattern">词模</param> // <returns>词模中包含的模板词</returns> public List<String> GetWordItem(String pattern) { // 模板词列表 List<String> wordItemList = new ArrayList<String>(); if (pattern == "") return wordItemList; // 将词模替换成中间状态 String repPattern = ConvertPattern(pattern); // 每一个词模单元的最内层标记是分隔符“<”和“>”,里面的内容有三种情况:词类名称,单个(一组)模板词 List<String> words = SplitByTwoTag(repPattern, "<", ">"); for (String word : words) { // 以“!”开头的是词类名称,不是模板词 if (word.startsWith("!")) continue; else if (word.startsWith("?")) { List<String> tmpWords = SplitByTwoTag(word, "(", ")"); for (String tmpWord : tmpWords) { wordItemList.add(ConvertWordItem(tmpWord)); } } // 单个或一组模板词 else { // 将一组模板词拆分成模板词列表;模板词之间用“|”间隔 List<String> tmpWords = toList(word.split("\\|")); for (String tmpWord : tmpWords) { // 将模板词替换成最终状态,添加至模板词列表 wordItemList.add(ConvertWordItem(tmpWord)); } } } return wordItemList; } // <summary> // 功能说明:将词模转换成中间状态 // 例如,将词模“<!\\*139词类>*[<!扣取词类>]*[<!多少词类>]*<话费>@2”先转换成“<!\\_a139词类>*[<!扣取词类>]*[<!多少词类>]*<话费>@2” // 创建人:曹亚男 // 创建时间:2008-12 // 维护人:曹亚男 // </summary> // <param name="pattern"></param> private String ConvertPattern(String pattern) { // 替换后的词模 String repPattern = pattern; // 依次替换五个转移串 for (int i = 0; i < replacenum; i++) { // 替换成中间状态 repPattern = repPattern.replace(orgStrs[i], repStrs[i]); } return repPattern; } // <summary> // 功能说明:在给定的字符串中,截取两个分隔符之间的字符串 // 例如,字符串是“[<!彩铃词类>]*<是>”,间隔符是“<”和“>”,最后得到的字符串列表是“!彩铃词类”和“是” // 创建人:曹亚男 // 创建时间:2008-12 // 维护人:曹亚男 // </summary> // <param name="pattern">输入字符串</param> // <param name="tag1">分隔符1</param> // <param name="tag2">分隔符2</param> // <returns>分隔符间隔的字符串列表</returns> public static List<String> SplitByTwoTag(String pattern, String tag1, String tag2) { // 字符串列表 List<String> wordList = new ArrayList<String>(); // 两个间隔符之间的字符串 String word = ""; // 从前向后遍历字符串 for (int pos = 0; pos < pattern.length(); pos++) { // 开始分隔符的位置 int beginIndex = pattern.indexOf(tag1, pos); // 结束分隔符的位置 int endIndex = -1; // 找到了开始分隔符,再找结束分隔符 if (beginIndex >= 0) endIndex = pattern.indexOf(tag2, beginIndex); // 没有开始分隔符,直接退出 else break; // 也找到了结束分隔符 if (endIndex >= 0) { // 取两个分隔符之间的字符串 word = pattern.substring(beginIndex + 1, endIndex - beginIndex - 1); // 从当前结束符开始向后继续寻找开始符 pos = endIndex; } else break; // 非空字符串,添加 if (word != "") wordList.add(word); } return wordList; } // <summary> // 功能说明:将模板词里面的中间串替换成间隔符 // 例如,将“\\_a139”替换成“*139”作为最终结果 // 创建人:曹亚男 // 创建时间:2008-12 // 维护人:曹亚男 // </summary> // <param name="wordItem">中间状态的模板词</param> // <returns>最终状态的模板词</returns> private String ConvertWordItem(String wordItem) { // 替换后的模板词 String repItem = wordItem; // 依次替换五个中间串 for (int i = 0; i < replacenum; i++) { // 替换成间隔符 repItem = repItem.replace(repStrs[i], finalStrs[i]); } return repItem; } }
[ "justxzh@hotmail.com" ]
justxzh@hotmail.com
a4977e2b9dbbd70b46aafee63dc68eb73e15343c
7cc39b1ee93832aed70e14224f8a3d991570cca6
/aws-java-sdk-eks/src/main/java/com/amazonaws/services/eks/model/UpdateType.java
96647825db49530d6eaff0bd2bed79404a6d27e2
[ "Apache-2.0" ]
permissive
yijiangliu/aws-sdk-java
74e626e096fe4cee22291809576bb7dc70aef94d
b75779a2ab0fe14c91da1e54be25b770385affac
refs/heads/master
2022-12-17T10:24:59.549226
2020-08-19T23:46:40
2020-08-19T23:46:40
289,107,793
1
0
Apache-2.0
2020-08-20T20:49:17
2020-08-20T20:49:16
null
UTF-8
Java
false
false
1,857
java
/* * Copyright 2015-2020 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.eks.model; import javax.annotation.Generated; /** * */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public enum UpdateType { VersionUpdate("VersionUpdate"), EndpointAccessUpdate("EndpointAccessUpdate"), LoggingUpdate("LoggingUpdate"), ConfigUpdate("ConfigUpdate"); private String value; private UpdateType(String value) { this.value = value; } @Override public String toString() { return this.value; } /** * Use this in place of valueOf. * * @param value * real value * @return UpdateType corresponding to the value * * @throws IllegalArgumentException * If the specified value does not map to one of the known values in this enum. */ public static UpdateType fromValue(String value) { if (value == null || "".equals(value)) { throw new IllegalArgumentException("Value cannot be null or empty!"); } for (UpdateType enumEntry : UpdateType.values()) { if (enumEntry.toString().equals(value)) { return enumEntry; } } throw new IllegalArgumentException("Cannot create enum from " + value + " value!"); } }
[ "" ]
a6d531918e976e001e1e0ced880839d0a58c2bf9
3ebdf60fea8b4961b2ff8104a677549b65d55ea7
/src/data/Checkin.java
c02cb726a49c5f8b4dcbadcde34f162fa169b2f6
[ "MIT" ]
permissive
neilireson/S3HMM
d835fe1a21fb3f2668162d1a0548c592d392c832
437c883fdb751e8d96c884993bb7a82d5f4cd60c
refs/heads/main
2023-05-29T03:35:20.134255
2021-06-15T02:03:23
2021-06-15T02:03:23
376,996,027
0
0
MIT
2021-06-15T00:58:31
2021-06-15T00:58:30
null
UTF-8
Java
false
false
2,078
java
package data; import java.io.Serializable; import java.util.HashMap; import java.util.Map; public class Checkin implements Serializable { String type; int checkinId; Long userId; Location location; int timestamp; int itemId; // music, goods, or other discrete items // Map<Integer, Integer> message; // Key: word, Value:count public Checkin(int checkinId, int timestamp, Long userId, double lat, double lng) { this.type = "geo"; this.checkinId = checkinId; this.timestamp = timestamp; this.userId = userId; this.location = new Location(lng, lat); } public Checkin(int checkinId, int timestamp, Long userId, int itemid) { this.type = "discrete"; this.checkinId = checkinId; this.timestamp = timestamp; this.userId = userId; this.itemId = itemid; } public Checkin(String type, int checkinId, int timestamp, Long userId, double lat, double lng, int item) { this.type = type; this.checkinId = checkinId; this.timestamp = timestamp; this.userId = userId; this.timestamp = timestamp; switch(type){ case("geo"): this.location = new Location(lng, lat); break; case("discrete"): this.itemId = item; break; default: System.out.println("Wrong type name for checkin: " + type); } } public String getType() { return type; } public int getId() { return checkinId; } public Long getUserId() { return userId; } public Location getLocation() { return location; } public int getTimestamp() { return timestamp; } public int getItemId() { return itemId; } @Override public int hashCode() { return new Integer(checkinId).hashCode(); } @Override public boolean equals(Object obj) { if (!(obj instanceof Checkin)) return false; if (obj == this) return true; return checkinId == ((Checkin) obj).getId(); } public Checkin copy() { Checkin res = new Checkin(type, checkinId, timestamp, userId, location.getLat(), location.getLng(), itemId); return res; } }
[ "noreply@github.com" ]
neilireson.noreply@github.com
c35fa26911c59feb838d55e3a065bbc61c39c187
92694d90e344924948ddf4845aae7497d20ecbd1
/submissions/Project06/Project06/bosworthpeter/Project06/src/Project06.java
6cb5ba50478401cd7d1c32375be8d1ead1a5da16
[]
no_license
sorengoyal/java-project-evaluator
7fe34e26fd11d0ac091a36c9d41a1243499a7ded
b953d722fa9933f0523c0e8c5ec1a3ba648687e8
refs/heads/master
2021-01-18T15:32:25.024482
2017-03-14T03:06:54
2017-03-14T03:06:54
84,345,480
0
0
null
null
null
null
UTF-8
Java
false
false
1,846
java
import java.util.Scanner; /* * Project06.java * * @author Peter Bosworth * @version 20172202 * */ public class Project06 { public static void main(String[] args) { Scanner keyboard = new Scanner(System.in); System.out.print("Enter a UPC (enter a blank line to quit): "); String upc = keyboard.nextLine(); if (upc.length() > 0 && upc.length() != 12){ System.out.println("ERROR! UPC MUST have exactly 12 digits"); } if (upc.length() == 0){ System.out.println("Goodbye!"); } else{ while (upc.length() ==12){ int evenDigit = (Character.getNumericValue(upc.charAt(0))+Character.getNumericValue(upc.charAt(2))+Character.getNumericValue(upc.charAt(4))+Character.getNumericValue(upc.charAt(6))+Character.getNumericValue(upc.charAt(8))+Character.getNumericValue(upc.charAt(10))); int oddDigit = (Character.getNumericValue(upc.charAt(1))+Character.getNumericValue(upc.charAt(3))+Character.getNumericValue(upc.charAt(5))+Character.getNumericValue(upc.charAt(7))+Character.getNumericValue(upc.charAt(9))); int sum = 3*evenDigit + oddDigit; int checkDigit = Character.getNumericValue(upc.charAt(11)); if (sum%10 != 0){ int value = (10-(sum%10)); if (checkDigit==value){ System.out.println("Check digit should be: "+value); System.out.println("Check digit is: "+checkDigit); System.out.println("UPC is valid."); } else{ System.out.println("Check digit should be: "+value); System.out.println("Check digit is: "+checkDigit); System.out.println("UPC is not valid."); } } System.out.print("Enter a UPC (enter a blank line to quit): "); upc = keyboard.nextLine(); } } } }
[ "sorengoyal@gmail.com" ]
sorengoyal@gmail.com
887e79559fa2db1efedccfd050da4178e0efd803
1f89819dd2a2d03a984abad49ea32b67c8f050e1
/Star Pattern/StarPattern18.java
63adfbd4df8cc89dc10de914129c55044e04df22
[]
no_license
imavipatel/Pattern-Programs
d6548ff09507d0c06ea074cce184aa469e90b143
0d6cf8be39cc8470c8de7ef6a439f6df15fe5afd
refs/heads/master
2020-07-02T18:21:36.614531
2019-08-10T11:22:48
2019-08-10T11:22:48
201,619,867
3
1
null
null
null
null
UTF-8
Java
false
false
596
java
/* WAP to print the following Pattern. 1 2*3 3*4*5 4*5*6*7 5*6*7*8*9 */ import java.util.Scanner; public class StarPattern18{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("Enter a Number : "); int n = sc.nextInt(); System.out.println("The Pattern is : "); int k; for(int i=1;i<=n;i++) { k=i; //for(int j=1;j<=2*i-1;j++) for(int j=1;j<(2*i);j++) { if(j%2==0) System.out.print("*"); else System.out.print(k++); } System.out.println(); } } }
[ "imavipatel@gmail.com" ]
imavipatel@gmail.com
d388c9d0930a34941e48d09718c525c168d9b38d
d173333ca04022f9981a1acc6c11ebcbaeff7eee
/generators/app/templates/java-akka/src/main/java/daggerok/App.java
bcb3ab3ad47ce352d3bc16f42bc89c6671c233d6
[ "MIT" ]
permissive
daggerok/generator-daggerok-fatjar
2e215d9d6abdf0f100cd4654f7cb677c32faed68
8dc179c8d842c3c369f6d8041e573f602d879f66
refs/heads/master
2021-05-09T16:44:13.076969
2018-04-07T17:18:28
2018-04-07T17:18:28
119,121,736
1
1
null
null
null
null
UTF-8
Java
false
false
2,517
java
package daggerok; import akka.actor.*; import com.typesafe.config.Config; import com.typesafe.config.ConfigFactory; import lombok.*; import lombok.extern.slf4j.Slf4j; import scala.Option; import scala.PartialFunction; import scala.concurrent.Future; import scala.util.Try; import java.util.concurrent.CountDownLatch; import static lombok.AccessLevel.PRIVATE; @Slf4j public class App { @RequiredArgsConstructor(staticName = "with") public static class Init { public final int amount; } public enum Ping { INSTANCE } public enum Pong { INSTANCE } public enum Done { INSTANCE } public static class UntypedPingPongActor extends AbstractActor { private int timeout = 5; private CountDownLatch countDownLatch; @SneakyThrows private void init(final int amount) { if (amount > 0) timeout = amount; countDownLatch = new CountDownLatch(timeout); log.info("Choose {}! So let's get started!", timeout); } @SneakyThrows private void pingPong(final Object msg) { Thread.sleep(timeout); log.info("{} {}", msg.getClass().getSimpleName(), countDownLatch.getCount()); if (countDownLatch.getCount() < 1) { //sender().tell(Done.INSTANCE, self()); self().forward(Done.INSTANCE, context()); } else { countDownLatch.countDown(); //self().tell(msg, self()); self().forward(msg, context()); } } @Override public Receive createReceive() { return receiveBuilder() .match(Init.class, input -> { init(input.amount); pingPong(Ping.INSTANCE); }) .matchEquals(Ping.INSTANCE, msg -> pingPong(Pong.INSTANCE)) .matchEquals(Pong.INSTANCE, msg -> pingPong(Ping.INSTANCE)) .matchEquals(Done.INSTANCE, msg -> { log.info("Done."); context().system().terminate(); }) .matchAny(o -> { log.warn("Unexpected."); context().system().terminate(); }) .build(); } } @SneakyThrows public static void main(String[] args) { final Config config = ConfigFactory.load(App.class.getClassLoader(), "/application.conf"); final ActorSystem actorSystem = ActorSystem.create("ping-pong-system", config); final ActorRef actorRef = actorSystem.actorOf(Props.create(UntypedPingPongActor.class), "ping-pong-actor"); actorRef.tell(Init.with(30), actorRef); } }
[ "daggerok@gmail.com" ]
daggerok@gmail.com
86c49bd6f8852ac2960b8671bdbcda1805fc6030
65b8fa142633c1885b77d6fee80016cb79d584ee
/src/main/java/com/example/demo/calculate/Calculate.java
15dad0a402e376bdf735941f35b1526a4bd37b66
[]
no_license
NaturalGenius/zhuliang-test
758edacba27ab8b2f6ca1b7dd7929a6ebb9cb362
9df0e4f1f02539f12e59ead1cc7b062b0233b420
refs/heads/main
2023-07-06T01:07:23.970388
2021-08-08T14:29:57
2021-08-08T14:29:57
316,961,135
1
0
null
null
null
null
UTF-8
Java
false
false
317
java
package com.example.demo.calculate; public class Calculate { public int add(int a,int b){ return a+b; } public int substract(int a , int b){ return a-b; } public int cheng(int a,int b){ return a*b; } public int chu(int a, int b){ return a/b; } }
[ "zhuliang@huohua.cn" ]
zhuliang@huohua.cn
2dcb188974f0b0b943206096affbc62e7ac35f45
15a7cb66fc9b5904a9720c0ef357c86b78dc11f6
/v2429/Objects/shell/src/xevolution/vrcg/devdemov2400/mainmenu.java
37d4278014c379c828577797d41dc5fcc5026719
[]
no_license
VB6Hobbyst7/vrcg
2c09bb52a0d11c573feb7c64bdb62f9c610646f6
c61acf00fc2a6a464fdd538470a276bd15a3f802
refs/heads/main
2023-04-17T19:03:03.611634
2021-05-11T17:36:07
2021-05-11T17:36:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
23,132
java
package xevolution.vrcg.devdemov2400; import java.io.IOException; import anywheresoftware.b4a.BA; import anywheresoftware.b4a.pc.PCBA; import anywheresoftware.b4a.pc.RDebug; import anywheresoftware.b4a.pc.RemoteObject; import anywheresoftware.b4a.pc.RDebug.IRemote; import anywheresoftware.b4a.pc.Debug; import anywheresoftware.b4a.pc.B4XTypes.B4XClass; import anywheresoftware.b4a.pc.B4XTypes.DeviceClass; public class mainmenu implements IRemote{ public static mainmenu mostCurrent; public static RemoteObject processBA; public static boolean processGlobalsRun; public static RemoteObject myClass; public static RemoteObject remoteMe; public mainmenu() { mostCurrent = this; } public RemoteObject getRemoteMe() { return remoteMe; } public static void main (String[] args) throws Exception { new RDebug(args[0], Integer.parseInt(args[1]), Integer.parseInt(args[2]), args[3]); RDebug.INSTANCE.waitForTask(); } static { anywheresoftware.b4a.pc.RapidSub.moduleToObject.put(new B4XClass("mainmenu"), "xevolution.vrcg.devdemov2400.mainmenu"); } public boolean isSingleton() { return true; } public static RemoteObject getObject() { return myClass; } public RemoteObject activityBA; public RemoteObject _activity; private PCBA pcBA; public PCBA create(Object[] args) throws ClassNotFoundException{ processBA = (RemoteObject) args[1]; activityBA = (RemoteObject) args[2]; _activity = (RemoteObject) args[3]; anywheresoftware.b4a.keywords.Common.Density = (Float)args[4]; remoteMe = (RemoteObject) args[5]; pcBA = new PCBA(this, mainmenu.class); main_subs_0.initializeProcessGlobals(); return pcBA; } public static RemoteObject __c = RemoteObject.declareNull("anywheresoftware.b4a.keywords.Common"); public static RemoteObject _timestart = RemoteObject.declareNull("anywheresoftware.b4a.objects.Timer"); public static RemoteObject _appstarted = RemoteObject.createImmutable(false); public static RemoteObject _mainshowdialogresult = RemoteObject.createImmutable(0); public static RemoteObject _started = RemoteObject.createImmutable(false); public static RemoteObject _waittoconfirm = RemoteObject.createImmutable(false); public static RemoteObject _currentloginuser = RemoteObject.createImmutable(""); public static RemoteObject _islogindone = RemoteObject.createImmutable(false); public static RemoteObject _ismainscreen = RemoteObject.createImmutable(false); public static RemoteObject _device = RemoteObject.declareNull("anywheresoftware.b4a.phone.Phone"); public static RemoteObject _isfirsttime = RemoteObject.createImmutable(false); public static RemoteObject _requestauth = RemoteObject.createImmutable(false); public static RemoteObject _xui = RemoteObject.declareNull("anywheresoftware.b4a.objects.B4XViewWrapper.XUI"); public static RemoteObject _badgeritems = RemoteObject.declareNull("xevolution.vrcg.devdemov2400.badger"); public static RemoteObject _mainbasepanel = RemoteObject.declareNull("anywheresoftware.b4a.objects.PanelWrapper"); public static RemoteObject _mainbottompanel = RemoteObject.declareNull("anywheresoftware.b4a.objects.PanelWrapper"); public static RemoteObject _mainbuttonmenu = RemoteObject.declareNull("anywheresoftware.b4a.objects.ButtonWrapper"); public static RemoteObject _maintopbar = RemoteObject.declareNull("anywheresoftware.b4a.objects.PanelWrapper"); public static RemoteObject _mainbottomline = RemoteObject.declareNull("anywheresoftware.b4a.objects.PanelWrapper"); public static RemoteObject _mainlogo = RemoteObject.declareNull("anywheresoftware.b4a.objects.ImageViewWrapper"); public static RemoteObject _maintopline = RemoteObject.declareNull("anywheresoftware.b4a.objects.PanelWrapper"); public static RemoteObject _mainlabelinfo = RemoteObject.declareNull("anywheresoftware.b4a.objects.LabelWrapper"); public static RemoteObject _paneloptions = RemoteObject.declareNull("anywheresoftware.b4a.objects.PanelWrapper"); public static RemoteObject _butquickaction = RemoteObject.declareNull("anywheresoftware.b4a.objects.ButtonWrapper"); public static RemoteObject _butcallcamera = RemoteObject.declareNull("anywheresoftware.b4a.objects.ButtonWrapper"); public static RemoteObject _butcallactions = RemoteObject.declareNull("anywheresoftware.b4a.objects.ButtonWrapper"); public static RemoteObject _labelversion = RemoteObject.declareNull("anywheresoftware.b4a.objects.LabelWrapper"); public static RemoteObject _labeldatetime = RemoteObject.declareNull("anywheresoftware.b4a.objects.LabelWrapper"); public static RemoteObject _labelappinfo = RemoteObject.declareNull("anywheresoftware.b4a.objects.LabelWrapper"); public static RemoteObject _labelcopyright = RemoteObject.declareNull("anywheresoftware.b4a.objects.LabelWrapper"); public static RemoteObject _dialoglogin = RemoteObject.declareNull("xevolution.vrcg.devdemov2400.appdialogs"); public static RemoteObject _dialogauthorization = RemoteObject.declareNull("xevolution.vrcg.devdemov2400.appdialogs"); public static RemoteObject _buttonuserunavailable = RemoteObject.declareNull("anywheresoftware.b4a.objects.ButtonWrapper"); public static RemoteObject _authversionslist = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.List"); public static RemoteObject _cpbuttontasks = RemoteObject.declareNull("anywheresoftware.b4a.objects.PanelWrapper"); public static RemoteObject _cpbuttonrequests = RemoteObject.declareNull("anywheresoftware.b4a.objects.PanelWrapper"); public static RemoteObject _cpbuttonobjects = RemoteObject.declareNull("anywheresoftware.b4a.objects.PanelWrapper"); public static RemoteObject _cpbuttonuser = RemoteObject.declareNull("anywheresoftware.b4a.objects.PanelWrapper"); public static RemoteObject _cpbuttonkpi = RemoteObject.declareNull("anywheresoftware.b4a.objects.PanelWrapper"); public static RemoteObject _cpbuttonalerts = RemoteObject.declareNull("anywheresoftware.b4a.objects.PanelWrapper"); public static RemoteObject _mainpopmenu = RemoteObject.declareNull("com.jakes.menuonviews.menuonanyview"); public static RemoteObject _mainpopmenulist = RemoteObject.declareNull("anywheresoftware.b4a.objects.ListViewWrapper"); public static RemoteObject _lgo_passwordmode = RemoteObject.createImmutable(false); public static RemoteObject _neterrortrycount = RemoteObject.createImmutable(0); public static RemoteObject _customlistview1 = RemoteObject.declareNull("b4a.example3.customlistview"); public static RemoteObject _buttonactionpause = RemoteObject.declareNull("anywheresoftware.b4a.objects.ButtonWrapper"); public static RemoteObject _buttonappnetwork = RemoteObject.declareNull("anywheresoftware.b4a.objects.ButtonWrapper"); public static RemoteObject _buttonapplatency = RemoteObject.declareNull("anywheresoftware.b4a.objects.ButtonWrapper"); public static RemoteObject _mainactiveuser = RemoteObject.declareNull("anywheresoftware.b4a.objects.LabelWrapper"); public static RemoteObject _mainlayout = RemoteObject.createImmutable(""); public static RemoteObject _lockpanel = RemoteObject.declareNull("anywheresoftware.b4a.objects.PanelWrapper"); public static RemoteObject _mainmenutabstrip = RemoteObject.declareNull("anywheresoftware.b4a.objects.TabStripViewPager"); public static RemoteObject _butcallshort3 = RemoteObject.declareNull("anywheresoftware.b4a.objects.ButtonWrapper"); public static RemoteObject _butcallshort2 = RemoteObject.declareNull("anywheresoftware.b4a.objects.ButtonWrapper"); public static RemoteObject _butcallshort1 = RemoteObject.declareNull("anywheresoftware.b4a.objects.ButtonWrapper"); public static RemoteObject _printer = RemoteObject.declareNull("b4a.example.bt_printer"); public static RemoteObject _updateservicetimer = RemoteObject.declareNull("anywheresoftware.b4a.objects.Timer"); public static RemoteObject _labelavisoprocessamento = RemoteObject.declareNull("anywheresoftware.b4a.objects.LabelWrapper"); public static RemoteObject _panelfirstinstallconfig = RemoteObject.declareNull("anywheresoftware.b4a.objects.PanelWrapper"); public static RemoteObject _progressoinicial2 = RemoteObject.declareNull("anywheresoftware.b4a.objects.ProgressBarWrapper"); public static RemoteObject _labeltarefa = RemoteObject.declareNull("anywheresoftware.b4a.objects.LabelWrapper"); public static RemoteObject _progressoinicial = RemoteObject.declareNull("anywheresoftware.b4a.objects.ProgressBarWrapper"); public static RemoteObject _labeldownloadinicialfases = RemoteObject.declareNull("anywheresoftware.b4a.objects.LabelWrapper"); public static RemoteObject _labeldownloadinicialtitle = RemoteObject.declareNull("anywheresoftware.b4a.objects.LabelWrapper"); public static RemoteObject _paneldownloadinicial = RemoteObject.declareNull("anywheresoftware.b4a.objects.PanelWrapper"); public static RemoteObject _datasyncmanual = RemoteObject.declareNull("xevolution.vrcg.devdemov2400.anotherdatepicker"); public static RemoteObject _currentcld = RemoteObject.declareNull("anywheresoftware.b4a.agraham.dialogs.InputDialog.CustomLayoutDialog"); public static RemoteObject _appldialog = RemoteObject.declareNull("anywheresoftware.b4a.agraham.dialogs.InputDialog.CustomLayoutDialog"); public static RemoteObject _buttonassociated = RemoteObject.declareNull("anywheresoftware.b4a.objects.ButtonWrapper"); public static RemoteObject _buttonscanprinter = RemoteObject.declareNull("anywheresoftware.b4a.objects.ButtonWrapper"); public static RemoteObject _listviewbluetoothdevices = RemoteObject.declareNull("anywheresoftware.b4a.objects.ListViewWrapper"); public static RemoteObject _buttonprint = RemoteObject.declareNull("anywheresoftware.b4a.objects.ButtonWrapper"); public static RemoteObject _printermessage = RemoteObject.createImmutable(""); public static RemoteObject _currentprinterconnected = RemoteObject.declareNull("Object"); public static RemoteObject _butsearch = RemoteObject.declareNull("anywheresoftware.b4a.objects.ButtonWrapper"); public static RemoteObject _editsearch = RemoteObject.declareNull("anywheresoftware.b4a.objects.EditTextWrapper"); public static RemoteObject _searchpanel = RemoteObject.declareNull("anywheresoftware.b4a.objects.PanelWrapper"); public static RemoteObject _editsearchsearch = RemoteObject.declareNull("anywheresoftware.b4a.objects.EditTextWrapper"); public static RemoteObject _butsearchsearch = RemoteObject.declareNull("anywheresoftware.b4a.objects.ButtonWrapper"); public static RemoteObject _butsearchserver = RemoteObject.declareNull("anywheresoftware.b4a.objects.ButtonWrapper"); public static RemoteObject _mainactiveusersearch = RemoteObject.declareNull("anywheresoftware.b4a.objects.LabelWrapper"); public static RemoteObject _mainlogosearch = RemoteObject.declareNull("anywheresoftware.b4a.objects.ImageViewWrapper"); public static RemoteObject _progresssearch = RemoteObject.declareNull("anywheresoftware.b4a.objects.ProgressBarWrapper"); public static RemoteObject _butactionsearch = RemoteObject.declareNull("anywheresoftware.b4a.objects.ButtonWrapper"); public static RemoteObject _butclosesearchpanel = RemoteObject.declareNull("anywheresoftware.b4a.objects.ButtonWrapper"); public static RemoteObject _expandlistsearch = RemoteObject.declareNull("b4a.example3.customlistview"); public static RemoteObject _recordlinepanel = RemoteObject.declareNull("anywheresoftware.b4a.objects.PanelWrapper"); public static RemoteObject _recordlinetitle = RemoteObject.declareNull("anywheresoftware.b4a.objects.LabelWrapper"); public static RemoteObject _recordlinemoreoptions = RemoteObject.declareNull("anywheresoftware.b4a.objects.ButtonWrapper"); public static RemoteObject _recordlinetitlesecond = RemoteObject.declareNull("anywheresoftware.b4a.objects.LabelWrapper"); public static RemoteObject _butsearchclear = RemoteObject.declareNull("anywheresoftware.b4a.objects.ButtonWrapper"); public static RemoteObject _dateutils = RemoteObject.declareNull("b4a.example.dateutils"); public static RemoteObject _encoding = RemoteObject.declareNull("b4a.example.encoding"); public static RemoteObject _esc_pos = RemoteObject.declareNull("b4a.example.esc_pos"); public static xevolution.vrcg.devdemov2400.main _main = null; public static xevolution.vrcg.devdemov2400.starter _starter = null; public static xevolution.vrcg.devdemov2400.comms _comms = null; public static xevolution.vrcg.devdemov2400.utils _utils = null; public static xevolution.vrcg.devdemov2400.dbstructures _dbstructures = null; public static xevolution.vrcg.devdemov2400.sharecode _sharecode = null; public static xevolution.vrcg.devdemov2400.imageedit _imageedit = null; public static xevolution.vrcg.devdemov2400.checklist3 _checklist3 = null; public static xevolution.vrcg.devdemov2400.locationservice _locationservice = null; public static xevolution.vrcg.devdemov2400.dataupdate _dataupdate = null; public static xevolution.vrcg.devdemov2400.alerts _alerts = null; public static xevolution.vrcg.devdemov2400.backgroundupdateservice _backgroundupdateservice = null; public static xevolution.vrcg.devdemov2400.barcodescanner _barcodescanner = null; public static xevolution.vrcg.devdemov2400.cameraactivity _cameraactivity = null; public static xevolution.vrcg.devdemov2400.cameraactivity_innershot _cameraactivity_innershot = null; public static xevolution.vrcg.devdemov2400.cameraactivity2 _cameraactivity2 = null; public static xevolution.vrcg.devdemov2400.checklistnew _checklistnew = null; public static xevolution.vrcg.devdemov2400.common _common = null; public static xevolution.vrcg.devdemov2400.consts _consts = null; public static xevolution.vrcg.devdemov2400.dbutils _dbutils = null; public static xevolution.vrcg.devdemov2400.helpdescriptors _helpdescriptors = null; public static xevolution.vrcg.devdemov2400.logs _logs = null; public static xevolution.vrcg.devdemov2400.mapsactivity _mapsactivity = null; public static xevolution.vrcg.devdemov2400.newsync _newsync = null; public static xevolution.vrcg.devdemov2400.notas _notas = null; public static xevolution.vrcg.devdemov2400.objectedit _objectedit = null; public static xevolution.vrcg.devdemov2400.objects _objects = null; public static xevolution.vrcg.devdemov2400.report _report = null; public static xevolution.vrcg.devdemov2400.reportview _reportview = null; public static xevolution.vrcg.devdemov2400.requests3 _requests3 = null; public static xevolution.vrcg.devdemov2400.signaturecapture _signaturecapture = null; public static xevolution.vrcg.devdemov2400.structures _structures = null; public static xevolution.vrcg.devdemov2400.taskscl2 _taskscl2 = null; public static xevolution.vrcg.devdemov2400.types _types = null; public static xevolution.vrcg.devdemov2400.updateservice _updateservice = null; public static xevolution.vrcg.devdemov2400.user _user = null; public static xevolution.vrcg.devdemov2400.userservice _userservice = null; public static xevolution.vrcg.devdemov2400.httputils2service _httputils2service = null; public static xevolution.vrcg.devdemov2400.xuiviewsutils _xuiviewsutils = null; public Object[] GetGlobals() { return new Object[] {"Activity",mainmenu.mostCurrent._activity,"Alerts",Debug.moduleToString(xevolution.vrcg.devdemov2400.alerts.class),"ApplDialog",mainmenu.mostCurrent._appldialog,"AppStarted",mainmenu._appstarted,"AuthVersionsList",mainmenu.mostCurrent._authversionslist,"BackgroundUpdateService",Debug.moduleToString(xevolution.vrcg.devdemov2400.backgroundupdateservice.class),"BadgerItems",mainmenu.mostCurrent._badgeritems,"BarcodeScanner",Debug.moduleToString(xevolution.vrcg.devdemov2400.barcodescanner.class),"butActionSearch",mainmenu.mostCurrent._butactionsearch,"butCallActions",mainmenu.mostCurrent._butcallactions,"butCallCamera",mainmenu.mostCurrent._butcallcamera,"butCallShort1",mainmenu.mostCurrent._butcallshort1,"butCallShort2",mainmenu.mostCurrent._butcallshort2,"butCallShort3",mainmenu.mostCurrent._butcallshort3,"butCloseSearchPanel",mainmenu.mostCurrent._butclosesearchpanel,"butQuickAction",mainmenu.mostCurrent._butquickaction,"butSearch",mainmenu.mostCurrent._butsearch,"butSearchClear",mainmenu.mostCurrent._butsearchclear,"butSearchSearch",mainmenu.mostCurrent._butsearchsearch,"butSearchServer",mainmenu.mostCurrent._butsearchserver,"ButtonActionPause",mainmenu.mostCurrent._buttonactionpause,"ButtonAppLatency",mainmenu.mostCurrent._buttonapplatency,"ButtonAppNetwork",mainmenu.mostCurrent._buttonappnetwork,"ButtonAssociated",mainmenu.mostCurrent._buttonassociated,"ButtonPrint",mainmenu.mostCurrent._buttonprint,"ButtonScanPrinter",mainmenu.mostCurrent._buttonscanprinter,"ButtonUserUnavailable",mainmenu.mostCurrent._buttonuserunavailable,"CameraActivity",Debug.moduleToString(xevolution.vrcg.devdemov2400.cameraactivity.class),"CameraActivity_InnerShot",Debug.moduleToString(xevolution.vrcg.devdemov2400.cameraactivity_innershot.class),"CameraActivity2",Debug.moduleToString(xevolution.vrcg.devdemov2400.cameraactivity2.class),"CheckList3",Debug.moduleToString(xevolution.vrcg.devdemov2400.checklist3.class),"CheckListNew",Debug.moduleToString(xevolution.vrcg.devdemov2400.checklistnew.class),"Common",Debug.moduleToString(xevolution.vrcg.devdemov2400.common.class),"Comms",Debug.moduleToString(xevolution.vrcg.devdemov2400.comms.class),"Consts",Debug.moduleToString(xevolution.vrcg.devdemov2400.consts.class),"CPButtonAlerts",mainmenu.mostCurrent._cpbuttonalerts,"CPButtonKPI",mainmenu.mostCurrent._cpbuttonkpi,"CPButtonObjects",mainmenu.mostCurrent._cpbuttonobjects,"CPButtonRequests",mainmenu.mostCurrent._cpbuttonrequests,"CPButtonTasks",mainmenu.mostCurrent._cpbuttontasks,"CPButtonUser",mainmenu.mostCurrent._cpbuttonuser,"CurrentCLD",mainmenu.mostCurrent._currentcld,"CurrentLoginUser",mainmenu._currentloginuser,"CurrentPrinterConnected",mainmenu.mostCurrent._currentprinterconnected,"CustomListView1",mainmenu.mostCurrent._customlistview1,"DataSyncManual",mainmenu.mostCurrent._datasyncmanual,"DataUpdate",Debug.moduleToString(xevolution.vrcg.devdemov2400.dataupdate.class),"DateUtils",mainmenu.mostCurrent._dateutils,"DBStructures",Debug.moduleToString(xevolution.vrcg.devdemov2400.dbstructures.class),"DBUtils",Debug.moduleToString(xevolution.vrcg.devdemov2400.dbutils.class),"Device",mainmenu._device,"DialogAuthorization",mainmenu.mostCurrent._dialogauthorization,"DialogLogin",mainmenu.mostCurrent._dialoglogin,"EditSearch",mainmenu.mostCurrent._editsearch,"EditSearchSearch",mainmenu.mostCurrent._editsearchsearch,"Encoding",mainmenu.mostCurrent._encoding,"ESC_POS",mainmenu.mostCurrent._esc_pos,"ExpandListSearch",mainmenu.mostCurrent._expandlistsearch,"HelpDescriptors",Debug.moduleToString(xevolution.vrcg.devdemov2400.helpdescriptors.class),"HttpUtils2Service",Debug.moduleToString(xevolution.vrcg.devdemov2400.httputils2service.class),"ImageEdit",Debug.moduleToString(xevolution.vrcg.devdemov2400.imageedit.class),"IsFirsttime",mainmenu._isfirsttime,"isLoginDone",mainmenu._islogindone,"isMainScreen",mainmenu._ismainscreen,"LabelAppInfo",mainmenu.mostCurrent._labelappinfo,"LabelAvisoProcessamento",mainmenu.mostCurrent._labelavisoprocessamento,"LabelCopyright",mainmenu.mostCurrent._labelcopyright,"LabelDateTime",mainmenu.mostCurrent._labeldatetime,"LabelDownloadInicialFases",mainmenu.mostCurrent._labeldownloadinicialfases,"LabelDownloadInicialTitle",mainmenu.mostCurrent._labeldownloadinicialtitle,"LabelTarefa",mainmenu.mostCurrent._labeltarefa,"LabelVersion",mainmenu.mostCurrent._labelversion,"LGO_PasswordMode",mainmenu._lgo_passwordmode,"ListViewBluetoothDevices",mainmenu.mostCurrent._listviewbluetoothdevices,"LocationService",Debug.moduleToString(xevolution.vrcg.devdemov2400.locationservice.class),"LockPanel",mainmenu.mostCurrent._lockpanel,"Logs",Debug.moduleToString(xevolution.vrcg.devdemov2400.logs.class),"Main",Debug.moduleToString(xevolution.vrcg.devdemov2400.main.class),"mainActiveUser",mainmenu.mostCurrent._mainactiveuser,"mainActiveUserSearch",mainmenu.mostCurrent._mainactiveusersearch,"mainBasePanel",mainmenu.mostCurrent._mainbasepanel,"mainBottomLine",mainmenu.mostCurrent._mainbottomline,"mainBottomPanel",mainmenu.mostCurrent._mainbottompanel,"mainButtonMenu",mainmenu.mostCurrent._mainbuttonmenu,"mainLabelInfo",mainmenu.mostCurrent._mainlabelinfo,"mainLayout",mainmenu.mostCurrent._mainlayout,"mainLogo",mainmenu.mostCurrent._mainlogo,"mainLogoSearch",mainmenu.mostCurrent._mainlogosearch,"MainMenuTabStrip",mainmenu.mostCurrent._mainmenutabstrip,"MainPopMenu",mainmenu.mostCurrent._mainpopmenu,"MainPopMenuList",mainmenu.mostCurrent._mainpopmenulist,"mainShowDialogResult",mainmenu._mainshowdialogresult,"mainTopBar",mainmenu.mostCurrent._maintopbar,"mainTopLine",mainmenu.mostCurrent._maintopline,"MapsActivity",Debug.moduleToString(xevolution.vrcg.devdemov2400.mapsactivity.class),"NetErrorTryCount",mainmenu._neterrortrycount,"NewSync",Debug.moduleToString(xevolution.vrcg.devdemov2400.newsync.class),"notas",Debug.moduleToString(xevolution.vrcg.devdemov2400.notas.class),"ObjectEdit",Debug.moduleToString(xevolution.vrcg.devdemov2400.objectedit.class),"Objects",Debug.moduleToString(xevolution.vrcg.devdemov2400.objects.class),"PanelDownloadInicial",mainmenu.mostCurrent._paneldownloadinicial,"PanelFirstInstallConfig",mainmenu.mostCurrent._panelfirstinstallconfig,"panelOptions",mainmenu.mostCurrent._paneloptions,"Printer",mainmenu.mostCurrent._printer,"PrinterMessage",mainmenu.mostCurrent._printermessage,"ProgressoInicial",mainmenu.mostCurrent._progressoinicial,"ProgressoInicial2",mainmenu.mostCurrent._progressoinicial2,"ProgressSearch",mainmenu.mostCurrent._progresssearch,"RecordLineMoreOptions",mainmenu.mostCurrent._recordlinemoreoptions,"RecordLinePanel",mainmenu.mostCurrent._recordlinepanel,"RecordLineTitle",mainmenu.mostCurrent._recordlinetitle,"RecordLineTitleSecond",mainmenu.mostCurrent._recordlinetitlesecond,"Report",Debug.moduleToString(xevolution.vrcg.devdemov2400.report.class),"ReportView",Debug.moduleToString(xevolution.vrcg.devdemov2400.reportview.class),"Requestauth",mainmenu._requestauth,"requests3",Debug.moduleToString(xevolution.vrcg.devdemov2400.requests3.class),"SearchPanel",mainmenu.mostCurrent._searchpanel,"ShareCode",Debug.moduleToString(xevolution.vrcg.devdemov2400.sharecode.class),"SignatureCapture",Debug.moduleToString(xevolution.vrcg.devdemov2400.signaturecapture.class),"Started",mainmenu._started,"Starter",Debug.moduleToString(xevolution.vrcg.devdemov2400.starter.class),"Structures",Debug.moduleToString(xevolution.vrcg.devdemov2400.structures.class),"TasksCL2",Debug.moduleToString(xevolution.vrcg.devdemov2400.taskscl2.class),"TimeStart",mainmenu._timestart,"Types",Debug.moduleToString(xevolution.vrcg.devdemov2400.types.class),"UpdateService",Debug.moduleToString(xevolution.vrcg.devdemov2400.updateservice.class),"UpdateServiceTimer",mainmenu.mostCurrent._updateservicetimer,"User",Debug.moduleToString(xevolution.vrcg.devdemov2400.user.class),"UserService",Debug.moduleToString(xevolution.vrcg.devdemov2400.userservice.class),"Utils",Debug.moduleToString(xevolution.vrcg.devdemov2400.utils.class),"WaitToConfirm",mainmenu._waittoconfirm,"xui",mainmenu._xui,"XUIViewsUtils",Debug.moduleToString(xevolution.vrcg.devdemov2400.xuiviewsutils.class)}; } }
[ "felipemrvieira@gmail.com" ]
felipemrvieira@gmail.com
dadd55aceddfd32761c318c905e5da0dff80f39b
1c80e8a0893d1c57cf0f343b2a1da54a0d39a213
/app/src/main/java/br/com/douglas/speaktous/TelefonesUteis.java
18032045a20efd9ac227fad1266cd20a676282dc
[]
no_license
TrabalhosFatecADS/speaktous-client
52d78dc5147ad65d8947d7f22aaecb2c24a028da
e250217275eabcffc898869cbd38ab7c5bec43ac
refs/heads/master
2020-04-28T02:09:17.258242
2019-05-24T19:52:46
2019-05-24T19:52:46
174,887,687
0
0
null
null
null
null
UTF-8
Java
false
false
784
java
package br.com.douglas.speaktous; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.ImageButton; public class TelefonesUteis extends AppCompatActivity { ImageButton btnFechar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_telefones_uteis); getSupportActionBar().hide(); //Tirar a Barra do Nome do Projeto btnFechar = (ImageButton)findViewById(R.id.btnFechar); //Botão Sair btnFechar.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { finish(); } }); } }
[ "douglas.ribeiro.id@gmail.com" ]
douglas.ribeiro.id@gmail.com
c11d9f4f6ac12dad6dfeb8fadfc350535ea5e124
c86c9ca63a40208d88bada41b3ea9d532409af77
/aula-java-8/src/main/java/tads/java8/defaultmethod/e2/E2_StaticDefault.java
14a819fbf56dce518e847f711da4b11fd55e31ee
[]
no_license
erikseyti/Java8TechnologyStudy
af1ffeb073c01885429a3c8987e82f0559ecd9d3
11653be383186a2d1cf455fe191103e9e593c8fa
refs/heads/master
2020-03-07T12:52:41.905531
2016-11-03T21:53:17
2016-11-03T21:53:17
127,487,286
0
0
null
null
null
null
UTF-8
Java
false
false
158
java
package tads.java8.defaultmethod.e2; public interface E2_StaticDefault { static void print() { System.out.println("Hello static default method!"); } }
[ "sey_ti@hotmail.com" ]
sey_ti@hotmail.com
66276fc3b01669986a5241545b877f721d874c3f
d2abcdf87d2a1b225beb0af149737cbf09b7fb4f
/app/src/main/java/com/zs/project/bean/CardBannerEntry.java
e1d497461f8abbf1bd6ba7181cb34433e983c405
[]
no_license
QQzs/ForwardStudy
6496f8bc3395abfbeaf5006f584bb352bbbe8763
001496ccd43cb48b80d81bd7a8776a2047c6fa88
refs/heads/master
2021-05-12T13:46:06.544702
2020-03-21T15:02:22
2020-03-21T15:02:22
116,939,823
1
1
null
null
null
null
UTF-8
Java
false
false
2,318
java
package com.zs.project.bean; import android.support.annotation.Nullable; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import com.zs.project.R; import com.zs.project.util.ImageLoaderUtil; import com.zs.project.view.banner.BannerEntry; /** * 创建人 kelin * 创建时间 2017/7/25 下午5:12 * 版本 v 1.0.0 */ public class CardBannerEntry implements BannerEntry<String> { private String title; private String subTitle; private String imgUrl; public CardBannerEntry(String title, String subTitle, String imgUrl) { this.title = title; this.subTitle = subTitle; this.imgUrl = imgUrl; } /** * 获取当前页面的布局视图。 * * @param parent 当前的布局视图的父节点布局。 * @return 返回当前页面所要显示的View。 */ @Override public View onCreateView(ViewGroup parent) { View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.banner_item_layout, parent, false); ImageView imageView = view.findViewById(R.id.iv_image); ImageLoaderUtil.displayImage(imgUrl,imageView); return view; } /** * 获取标题。 * * @return 返回当前条目的标题。 */ @Override public CharSequence getTitle() { return title; } private String getImgUrl() { return imgUrl; } /** * 获取子标题。 * * @return 返回当前条目的子标题。 */ @Nullable @Override public CharSequence getSubTitle() { return null; } /** * 获取当前页面的数据。改方法为辅助方法,是为了方便使用者调用而提供的,Api本身并没有任何调用。如果你不需要该方法可以空实现。 * * @return 返回当前页面的数据。 */ @Override public String getValue() { return title; } @Override public boolean same(BannerEntry newEntry) { return newEntry instanceof CardBannerEntry && TextUtils.equals(title, newEntry.getTitle()) && TextUtils.equals(subTitle, newEntry.getSubTitle()) && TextUtils.equals(imgUrl, ((CardBannerEntry) newEntry).getImgUrl()); } }
[ "552146383@qq.com" ]
552146383@qq.com
9a145e796eacba1c212e8d7ced6ce114a7af1e29
8bfdaeb6177968687c524f91dd21ec5ca4d13217
/src/patrones/I_Salto.java
6b131371971e98f237529f39efa3c4ed0d87cad9
[]
no_license
gnbryan/FlappyBird
624b83a21e8c5d0d078ba8f2db646eab0c8043f5
3a97155a1800c0464d8a4710aae6457cb0263ffe
refs/heads/master
2021-01-01T17:32:45.500344
2015-02-02T15:57:05
2015-02-02T15:57:05
30,194,031
0
0
null
null
null
null
UTF-8
Java
false
false
78
java
package patrones; public interface I_Salto { public float asignarSalto(); }
[ "bryangn@gmail.com" ]
bryangn@gmail.com
13ee0c4ffa5a50eb98358a6bfb8c062873d550ce
63a46f6bad5a9573c8f32ad84692bb1c8dbd1808
/Manpreet-APITests/src/com/badlogic/androidgames/SurfaceViewTest.java
ca4f392e53556d75703b0dc6431057866f62719e
[]
no_license
badlogicmanpreet/novice
4e3ec822a87c7857ec7377d6276b1c1a1712fed5
3ae33d6df0432d92610aed572f0f0ca82a2212b0
refs/heads/master
2021-01-18T14:01:55.342496
2013-11-21T18:54:31
2013-11-21T18:54:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,711
java
package com.badlogic.androidgames; import android.app.Activity; import android.content.Context; import android.graphics.Canvas; import android.os.Bundle; import android.view.SurfaceHolder; import android.view.SurfaceView; import android.view.Window; import android.view.WindowManager; public class SurfaceViewTest extends Activity { FastRenderView fastRenderView; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); fastRenderView = new FastRenderView(this); setContentView(fastRenderView); } public void onResume() { super.onResume(); fastRenderView.onResume(); } public void onPause() { super.onPause(); fastRenderView.onPause(); } class FastRenderView extends SurfaceView implements Runnable { Thread renderThread; SurfaceHolder holder; volatile boolean running = false; public FastRenderView(Context context) { super(context); holder = getHolder(); } public void onResume() { running = true; renderThread = new Thread(this); renderThread.start(); } public void run() { while (running) { if (!holder.getSurface().isValid()) { continue; } else { Canvas canvas = holder.lockCanvas(); canvas.drawRGB(255, 0, 0); holder.unlockCanvasAndPost(canvas); } } } public void onPause() { running = false; while (true) { try { renderThread.join(); } catch (InterruptedException e) { e.printStackTrace(); } } } } }
[ "mghotra81@gmail.com" ]
mghotra81@gmail.com
994a6ad567776d76ab5b88bc28d98d90493242d7
d235bb71e4aac2459d59c92482e2f57bef20a99e
/learning-core/src/main/java/com/tomgs/core/filter/demo3/Result.java
16979e3860885b55a09006ede0f34c34f2935a0a
[]
no_license
tincopper/tomgs-java
58809690760de7d87c76e4575702e2a7dd7a5a0a
45308b4cea41332ad8a48c5a0691ad660699c8ae
refs/heads/master
2023-09-01T04:05:54.883998
2023-08-23T06:30:47
2023-08-23T06:30:47
178,701,500
2
0
null
2022-06-17T02:07:22
2019-03-31T14:48:16
Java
UTF-8
Java
false
false
2,398
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF 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 com.tomgs.core.filter.demo3; import java.util.Map; /** * RPC invoke result. (API, Prototype, NonThreadSafe) * * Result 是会话域,它持有调用过程中返回值,异常等。 * * @serial Don't change the class name and package name. * @see com.alibaba.dubbo.rpc.Invoker#invoke(Invocation) * @see com.alibaba.dubbo.rpc.RpcResult */ public interface Result { /** * Get invoke result. * * @return result. if no result return null. */ Object getValue(); /** * Get exception. * * @return exception. if no exception return null. */ Throwable getException(); /** * Has exception. * * @return has exception. */ boolean hasException(); /** * Recreate. * <p> * <code> * if (hasException()) { * throw getException(); * } else { * return getValue(); * } * </code> * * @return result. * @throws if has exception throw it. */ Object recreate() throws Throwable; /** * @see com.alibaba.dubbo.rpc.Result#getValue() * @deprecated Replace to getValue() */ @Deprecated Object getResult(); /** * get attachments. * * @return attachments. */ Map<String, String> getAttachments(); /** * get attachment by key. * * @return attachment value. */ String getAttachment(String key); /** * get attachment by key with default value. * * @return attachment value. */ String getAttachment(String key, String defaultValue); }
[ "136082619@qq.com" ]
136082619@qq.com
002df3d6a0be38a65795f865635e1ab0023e93c7
013bb41160221b645cc2f574f976942b20c5d221
/app/src/main/java/com/example/vijli/ui/gallery/GalleryFragment.java
88aa484bd85031e0e2b36479937dd0a36c78b85c
[]
no_license
Asad-Mirza/Vijli
f4f152dd5a9b347a9eb4c18e607053eb0ed7027e
36e351167e69da1e75fa7fa8262e9e57d53a33b4
refs/heads/master
2021-02-14T13:35:36.555366
2020-03-04T09:29:46
2020-03-04T09:29:46
244,807,596
0
0
null
2020-03-04T09:29:48
2020-03-04T04:32:10
Java
UTF-8
Java
false
false
1,171
java
package com.example.vijli.ui.gallery; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModelProviders; import com.example.vijli.R; public class GalleryFragment extends Fragment { private GalleryViewModel galleryViewModel; public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { galleryViewModel = ViewModelProviders.of(this).get(GalleryViewModel.class); View root = inflater.inflate(R.layout.fragment_gallery, container, false); final TextView textView = root.findViewById(R.id.text_gallery); galleryViewModel.getText().observe(getViewLifecycleOwner(), new Observer<String>() { @Override public void onChanged(@Nullable String s) { textView.setText(s); } }); return root; } }
[ "tosifmid@gmail.com" ]
tosifmid@gmail.com
b574c9a7f83c7ee41a91f378c3aa5a9ec446f25d
65f6b19a97d87dbb09b731b79cbf3969ea6bf7de
/InventorySystem-Team5/src/main/java/sg/edu/iss/inventory/model/Transaction.java
566de914c94df2fcb1f5f5a6bb3385104005e911
[]
no_license
cobsten/BranchTeam5Inventory
e6665ee020f572efc6cc5dc03b1bda1a11284b98
9b76f61452698fde847408f6dbc3814eb11df1da
refs/heads/master
2021-08-28T11:41:16.995763
2017-12-12T04:12:29
2017-12-12T04:12:29
113,799,967
0
0
null
null
null
null
UTF-8
Java
false
false
2,268
java
package sg.edu.iss.inventory.model; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import org.springframework.format.annotation.DateTimeFormat; @Entity @Table(name = "transaction") public class Transaction { @Id @Column(name = "transactionId") @GeneratedValue(strategy = GenerationType.IDENTITY) private int transactionId; @Temporal(TemporalType.DATE) @Column(name = "transactionDate") @DateTimeFormat(pattern = "yyyy-MM-dd") private Date transactionDate; @ManyToOne @JoinColumn(name = "userId") private User usertran; @Column(name = "customerName") private String customerName; public Transaction() { super(); } public Transaction(int transactionId, Date transactionDate, User usertran, String customerName) { super(); this.transactionId = transactionId; this.transactionDate = transactionDate; this.usertran = usertran; this.customerName = customerName; } public int getTransactionId() { return transactionId; } public void setTransactionId(int transactionId) { this.transactionId = transactionId; } public Date getTransactionDate() { return transactionDate; } public void setTransactionDate(Date transactionDate) { this.transactionDate = transactionDate; } public User getUsertran() { return usertran; } public void setUsertran(User usertran) { this.usertran = usertran; } public String getCustomerName() { return customerName; } public void setCustomerName(String customerName) { this.customerName = customerName; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + transactionId; return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Transaction other = (Transaction) obj; if (transactionId != other.transactionId) return false; return true; } }
[ "cobsten@gmail.com" ]
cobsten@gmail.com
8425a10af6c8c4178275592d6271ef72c394c889
c31edc23ab31c8517da53b308cf48ca7328a6d05
/src/reghzy/guigl/core/render/RenderManager.java
445e6b78ee33ee6455dca18f7838c0f97b64e4d2
[]
no_license
AngryCarrot789/REghZyGUIGL
495f86a6753a99b59cc326164ebda9518a08dea9
f4326ed68cb619ebffd5c2dcb9d9be15aec135de
refs/heads/master
2023-05-09T22:09:31.212651
2021-06-11T19:05:17
2021-06-11T19:05:17
376,022,578
0
0
null
null
null
null
UTF-8
Java
false
false
2,620
java
package reghzy.guigl.core.render; import reghzy.guigl.core.controls.FrameworkElement; import reghzy.guigl.core.controls.primitive.Border; import reghzy.guigl.core.render.controls.BorderRenderer; import java.util.HashMap; import java.util.Map; public class RenderManager { private final Map<Class<? extends FrameworkElement>, IElementRenderer<? extends FrameworkElement>> elementRenderers; private boolean isRegistered; public RenderManager() { this.elementRenderers = new HashMap<>(); } public void registerPrimitiveRenderers() { if (isRegistered) { throw new RuntimeException("Cannot re-register primitive element renderers!"); } registerRenderer(Border.class, new BorderRenderer()); this.isRegistered = true; } public <E extends FrameworkElement> void renderElement(E element) { IElementRenderer<E> renderer; try { renderer = (IElementRenderer<E>) getRenderer(element.getClass()); } catch (ClassCastException e) { throw new UnsupportedOperationException("The renderer for the class " + element.getClass().getName() + " was very wrong! " + e.getMessage()); } if (renderer == null) { throw new UnsupportedOperationException("The renderer for the class " + element.getClass().getName() + " does not exist!"); } renderer.startRender(element, Tesselator.instance); } /** * Registers an element renderer * @param elementClass The class of the element to be rendered * @param renderer The renderer itself * @param <E> The type of the element (generic) */ public <E extends FrameworkElement> void registerRenderer(Class<E> elementClass, IElementRenderer<E> renderer) { this.elementRenderers.put(elementClass, renderer); } /** * Unregisters an element renderer (this is usually a bad thing to do...) * @param elementClass The class of the element to be rendered * @param <E> The type of the element (generic) */ public <E extends FrameworkElement> void unregisterRenderer(Class<E> elementClass) { this.elementRenderers.remove(elementClass); } /** * Gets the element renderer for an element. returns null if one doesn't exist * @param elementClass The class of the element to be rendered * @param <E> The type of the element (generic) */ public <E extends FrameworkElement> IElementRenderer<E> getRenderer(Class<E> elementClass) { return (IElementRenderer<E>) this.elementRenderers.get(elementClass); } }
[ "kettlesimzulator420@gmail.com" ]
kettlesimzulator420@gmail.com
bcba9545f614d0bdd98de21cc3d213accd4c6039
50eab1dbd66cf4a1774596c6d2694327ba63d620
/src/main/java/cn/wizzer/bugwk/controllers/LoginController.java
8695b39ea06949afe186c9c678a03ee9498a78e3
[ "Apache-2.0" ]
permissive
Wizzercn/BugWk
fbc93817ed9e17215a8b8f68f414096147da205b
cdc07e53a1b0551c517fd1ca7f0517692f308349
refs/heads/master
2023-01-11T08:59:51.525409
2019-10-25T03:13:53
2019-10-25T03:13:53
145,130,071
4
1
Apache-2.0
2022-12-29T20:48:54
2018-08-17T14:23:44
Vue
UTF-8
Java
false
false
2,500
java
package cn.wizzer.bugwk.controllers; import cn.wizzer.bugwk.commons.base.Result; import cn.wizzer.bugwk.commons.filter.MyCrossOriginFilter; import cn.wizzer.bugwk.modles.User; import org.nutz.dao.Cnd; import org.nutz.dao.Dao; import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.lang.Lang; import org.nutz.lang.util.NutMap; import org.nutz.log.Log; import org.nutz.log.Logs; import org.nutz.mvc.adaptor.JsonAdaptor; import org.nutz.mvc.annotation.*; import javax.servlet.http.HttpSession; /** * 用户登录并获取角色名 * Created by wizzer on 2018.08 */ @IocBean @At("/platform/login") @Filters({@By(type = MyCrossOriginFilter.class)}) public class LoginController { private static final Log log = Logs.get(); @Inject private Dao dao; @At("/doLogin") @Ok("json") @AdaptBy(type = JsonAdaptor.class) public Object do_login(@Param("loginname") String loginname, @Param("loginpass") String loginpass, HttpSession session) { try { User user = dao.fetch(User.class, Cnd.where("loginname", "=", loginname)); if (user == null) { return Result.error("用户不存在"); } if (user.isDisabled()) { return Result.error("用户已被禁用"); } if (!user.getLoginpass().equals(Lang.md5(loginname + loginpass + user.getSalt()))) { return Result.error("用户密码不正确"); } log.debug("login session id::" + session.getId()); session.setAttribute("loginname", user.getLoginname()); session.setAttribute("userid", user.getId()); session.setAttribute("nickname", user.getNickname()); session.setAttribute("realname", user.getRealname()); session.setAttribute("role", user.getRole()); return Result.success("用户登录成功", NutMap.NEW().addv("loginname", user.getLoginname()) .addv("nickname", user.getNickname()) .addv("realname", user.getRealname()) .addv("role", user.getRole()) ); } catch (Exception e) { return Result.error(); } } @At("/qps") @Ok("raw") public Object qps() { return "too many requests per second"; } @At("/test") @Ok("raw") public Object test() { return "test"; } }
[ "wizzer@qq.com" ]
wizzer@qq.com
4257f08ad5e397958b560d8d8555acbce8836d6f
d8788f52a12fafdb499445bb53a30a0c05d8d1d0
/app/src/main/java/wuxian/me/logannotationsdemo/IWhat.java
eb29f3e58fb70e9e0ea2fbc3213f48b1b8eb5349
[]
no_license
xiaoshenke/LogAnnotations
c26026a66a7fd32c6aee6992172441b3fafe3978
5d896efc1e4495bdcf1cb9c49bdbf969b49ce197
refs/heads/master
2020-06-30T13:30:29.464147
2016-12-11T07:46:12
2016-12-11T07:46:12
74,367,023
2
1
null
null
null
null
UTF-8
Java
false
false
111
java
package wuxian.me.logannotationsdemo; /** * Created by wuxian on 30/11/2016. */ public interface IWhat { }
[ "1205914137@qq.com" ]
1205914137@qq.com
a63a91891d3ad16667807dc74fcea6580a7f48c4
5f59c2a6ab55fb787e5ae73d87891182b4c797f8
/shopnc/src/main/java/top/yokey/shopnc/adapter/DistributionListAdapter.java
df4294747c945dab0e36b74918caba243a190c02
[ "MIT" ]
permissive
jwillber/ShopNc-Android
90d6917009bdc1d3802e262440815c55d3aa97f5
9df0861c1d35ba7c86e26f0655cc8c9fd9c0ef8c
refs/heads/master
2023-03-06T03:38:10.624728
2021-02-18T12:14:38
2021-02-18T12:14:38
340,044,118
0
0
null
null
null
null
UTF-8
Java
false
false
2,806
java
package top.yokey.shopnc.adapter; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.RelativeLayout; import androidx.annotation.NonNull; import androidx.appcompat.widget.AppCompatTextView; import androidx.recyclerview.widget.RecyclerView; import org.xutils.view.annotation.ViewInject; import java.util.ArrayList; import top.yokey.base.bean.MemberDistributionBean; import top.yokey.shopnc.R; import top.yokey.shopnc.base.BaseViewHolder; /** * 适配器 * * @author MapStory * @ qq 1002285057 * @ project https://gitee.com/MapStory/ShopNc-Android */ public class DistributionListAdapter extends RecyclerView.Adapter<DistributionListAdapter.ViewHolder> { private final ArrayList<MemberDistributionBean> arrayList; private OnItemClickListener onItemClickListener; public DistributionListAdapter(ArrayList<MemberDistributionBean> arrayList) { this.arrayList = arrayList; this.onItemClickListener = null; } @Override public int getItemCount() { return arrayList.size(); } @Override public void onBindViewHolder(@NonNull final ViewHolder holder, int position) { final int positionInt = position; final MemberDistributionBean bean = arrayList.get(position); String temp = "会员:" + bean.getMemberName() + ",购买商品"; holder.mainTextView.setText(temp); holder.moneyTextView.setText(bean.getInviteAmount()); temp = "数量:" + bean.getInviteNum(); holder.numberTextView.setText(temp); holder.mainRelativeLayout.setOnClickListener(view -> { if (onItemClickListener != null) { onItemClickListener.onClick(positionInt, bean); } }); } @NonNull @Override public ViewHolder onCreateViewHolder(@NonNull ViewGroup group, int viewType) { View view = LayoutInflater.from(group.getContext()).inflate(R.layout.item_list_distribution, group, false); return new ViewHolder(view); } public void setOnItemClickListener(OnItemClickListener listener) { this.onItemClickListener = listener; } public interface OnItemClickListener { void onClick(int position, MemberDistributionBean bean); } class ViewHolder extends BaseViewHolder { @ViewInject(R.id.mainRelativeLayout) private RelativeLayout mainRelativeLayout; @ViewInject(R.id.mainTextView) private AppCompatTextView mainTextView; @ViewInject(R.id.moneyTextView) private AppCompatTextView moneyTextView; @ViewInject(R.id.numberTextView) private AppCompatTextView numberTextView; private ViewHolder(View view) { super(view); } } }
[ "1727143740@qq.com" ]
1727143740@qq.com
88bf558cfb873031eac63721afd533753a1846b1
2424a468692fc6126e2dbdf6db9806a3d2935fe5
/basemybatis/src/main/java/com/ex/mb/basemybatis/entity/Teacher.java
e0b36869e52d947428b69ab3f324fc8898473d20
[]
no_license
WongJeab/mybatisStudy
16f503eb9845da37d0541b05c845aca3fb3e0704
034879ebdd8597137e6b90e7a39f92ac94492f7f
refs/heads/master
2020-04-01T19:26:06.258691
2018-10-18T08:45:36
2018-10-18T08:45:36
153,553,481
0
0
null
null
null
null
UTF-8
Java
false
false
1,021
java
package com.ex.mb.basemybatis.entity; import java.util.Date; import java.util.List; public class Teacher { public int id; public Date createTime; public String remark; public String name; List<StdTeaRelation> stdTeaRelations; public int getId() { return id; } public void setId(int id) { this.id = id; } public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } public String getName() { return name; } public void setName(String name) { this.name = name; } public List<StdTeaRelation> getStdTeaRelations() { return stdTeaRelations; } public void setStdTeaRelations(List<StdTeaRelation> stdTeaRelations) { this.stdTeaRelations = stdTeaRelations; } }
[ "me_wang_pop@163.com" ]
me_wang_pop@163.com
749aa0e2164a9a72848ce2213e52d66206008086
9212985af9c5ec188c9f837ddbee62c0cde0fdc6
/src/calculator.java
f3e4b95704866a0792c99103ffe2819e8f60c6a5
[]
no_license
Ravinther/Javaassignment
442e299911e344adf6a85e3ef533527b6e165f54
e390c1771782b1de3667bc59f9f7a180dc017f0d
refs/heads/master
2021-01-17T16:09:52.708928
2016-06-13T12:32:32
2016-06-13T12:32:32
61,034,572
0
0
null
null
null
null
UTF-8
Java
false
false
949
java
import java.util.Scanner; public class calculator { public static void main(String[] args) { System.out.println("Enter which method to run:"); System.out.println("1.sum Of Number"); System.out.println("2.subtract of number"); System.out.println("3.Multiplication of number"); System.out.println("4.Division of two number"); Scanner sc=new Scanner(System.in); int c=sc.nextInt(); calcpackage cal=new calcpackage(); System.out.println("Enter the first number"); Scanner sc1=new Scanner(System.in); int i=sc1.nextInt(); System.out.println("Enter the second number"); Scanner sc2=new Scanner(System.in); int j=sc2.nextInt(); switch(c) { case 1: { System.out.println(cal.sum(i, j)); break; } case 2: { System.out.println(cal.sub(i, j)); break; } case 3: { System.out.println(cal.mul(i, j)); break; } case 4: { System.out.println(cal.division(i, j)); break; } } } }
[ "m.ravinther@yahoo.com" ]
m.ravinther@yahoo.com
e4ac55315db39f6ae21e8b9b25f0879a212b47c4
ee9b961b1e7adf33e81f98073cc6db9c1dcebbae
/tree/Node.java
6cbf4cfd2bab90b73066de74cbc50deb9515bee8
[]
no_license
vivekverma6594/Binary_Tree_Java
2647046ded914abba7a76cdf1351aedad0160aaf
65147a35ce32d5d533aaa3c188ad778f51a79842
refs/heads/master
2020-03-22T22:55:01.342526
2018-09-10T19:10:35
2018-09-10T19:10:35
140,778,178
0
0
null
null
null
null
UTF-8
Java
false
false
543
java
package com.company.tree; public class Node { private Node left,right; private int data; public Node(int data){ this.data = data; } public int getData() { return data; } public Node getLeft() { return left; } public Node getRight() { return right; } public void setData(int data) { this.data = data; } public void setLeft(Node left) { this.left = left; } public void setRight(Node right) { this.right = right; } }
[ "vivekverma6594@gmail.com" ]
vivekverma6594@gmail.com
609646228a2dea23a9167e0f40d1ac34d1521530
2f0919d8f86f1235ad2a49130acc34e9795ef773
/src/main/java/com/mano/jms/producer/JMSPublisher.java
577ca8cf6d88ca56110029596b1f664c967a4d95
[]
no_license
manodya/JMS-Basics
5313645fae42310bde67ef92bcbd7e1156620e04
3761a7aac57a24fa92b5b98e74646eb8f2b3b00f
refs/heads/master
2021-04-29T21:52:50.801700
2018-02-15T12:29:27
2018-02-15T12:29:27
121,627,164
0
0
null
null
null
null
UTF-8
Java
false
false
1,047
java
package com.mano.jms.producer; import com.mano.jms.Constants; import org.apache.activemq.ActiveMQConnectionFactory; import javax.jms.*; import java.text.DecimalFormat; /** * Created by manodyas on 2/15/2018. */ public class JMSPublisher { public static void main(String[] args) throws JMSException { ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(Constants.messageBrokerUrl); Connection connection = connectionFactory.createConnection(); connection.start(); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); Topic topic = session.createTopic(Constants.tradeEventTopic); DecimalFormat decimalFormat = new DecimalFormat("##.00"); MessageProducer publisher = session.createProducer(topic); String price = decimalFormat.format(95.0 + Math.random()); TextMessage message = session.createTextMessage("AAPL :" + price); publisher.send(message); connection.close(); } }
[ "noreply@github.com" ]
manodya.noreply@github.com
16d847803c4740ce4a8bbf8d6feecf96838344e8
e8a7f6ef48292c943e5121f78094c3bd8b15a234
/GitHub/src/github/GitHub.java
c522be6aabd6f5815b603f7d4a07c18b81b3a34a
[]
no_license
PedroMartinez471/GutHub_Entorns
6e84c408efa6ac3a104b375eb21ed17161401773
844d755eaa652f3b75bfe2bae9a51727efa77e3e
refs/heads/master
2020-04-22T12:48:54.059775
2019-02-12T20:32:59
2019-02-12T20:32:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
438
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 github; /** * * @author peri_ */ public class GitHub { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here } }
[ "peri_@DESKTOP-H9BOP01" ]
peri_@DESKTOP-H9BOP01
093f92bb6d95281c6d99149daf467b3fa8df0c15
6034d8e028c632684f096daebf42f696c83fda0f
/Opps/Encapsulation_Abstraction/Book/Author.java
378fd5479ce0f7694ad1acff0c7c6a48d7f6ae19
[]
no_license
mkundanjha/Wipro_PJP_Projects
0b56cf1d255db590eb29b51378c9f599aad17816
ccd053762915079c4a06e71fac31332a33e832bc
refs/heads/master
2022-11-25T02:47:56.135956
2020-08-06T13:43:18
2020-08-06T13:43:18
254,656,870
0
0
null
null
null
null
UTF-8
Java
false
false
398
java
public class Author{ String name; String email; char gender; Author(String name,String email,char gender){ this.name=name; this.email=email; this.gender=gender; } public String getName(){ return name; } public String getEmail(){ return email; } public char getGender(){ return gender; } }
[ "noreply@github.com" ]
mkundanjha.noreply@github.com