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
8d03fc657a3650775e5785aefdc5e4e270770466
8ec2cbabd6125ceeb00e0c6192c3ce84477bdde6
/com.nokia.as.cswl/src/com/nsn/ood/cls/cljl/plugin/CLSPreferences.java
5421a7839c255ed098e4e6c4db7236275925cbb1
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
nokia/osgi-microfeatures
2cc2b007454ec82212237e012290425114eb55e6
50120f20cf929a966364550ca5829ef348d82670
refs/heads/main
2023-08-28T12:13:52.381483
2021-11-12T20:51:05
2021-11-12T20:51:05
378,852,173
1
1
null
null
null
null
UTF-8
Java
false
false
1,464
java
/* * Copyright (c) 2014 Nokia Solutions and Networks. All rights reserved. */ package com.nsn.ood.cls.cljl.plugin; import java.io.IOException; import java.io.InputStream; import java.util.prefs.InvalidPreferencesFormatException; import java.util.prefs.Preferences; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.nokia.licensing.interfaces.CLJLPreferences; import com.nokia.licensing.interfaces.LicenseException; import com.nsn.ood.cls.util.DevMode; /** * @author marynows * */ public class CLSPreferences implements CLJLPreferences { private static final Logger LOG = LoggerFactory.getLogger(CLSPreferences.class); private static final String ROOT_NODE = "cls"; @Override public Preferences getPreferencesSystemRoot() throws LicenseException { return DevMode.isEnable() ? getPreferencesUserRoot() : Preferences.systemRoot().node(ROOT_NODE); } @Override public Preferences getPreferencesUserRoot() throws LicenseException { return Preferences.userRoot().node(ROOT_NODE); } public static void importPreferences() { final String resourceName = (DevMode.isEnable() ? "/Pref_system_LicenseInstall_user_CLS.xml" : "/Pref_system_LicenseInstall_CLS.xml"); final InputStream prefStream = CLSPreferences.class.getResourceAsStream(resourceName); try { Preferences.importPreferences(prefStream); } catch (IOException | InvalidPreferencesFormatException e) { LOG.warn("Cannot import preferences.", e); } } }
[ "pierre.de_rop@nokia.com" ]
pierre.de_rop@nokia.com
66307291f43eed905572c4eb9c69ad1d7be98000
58c103bdc660580e8d877b36abc2d2d893fd1fd8
/src/model/MIncidencias.java
3195d95448cff21385e5c22ede091d23f0c87a41
[]
no_license
marcorm91/bg-academy-JSP-integration
ef3620621dc28abb51702fbf2d2bf2cf28e380a6
ebb2ae52242ac8ec3e5c788771971b538f317bc0
refs/heads/master
2021-01-20T08:43:25.377248
2017-06-19T17:31:37
2017-06-19T17:31:37
90,184,879
1
0
null
null
null
null
ISO-8859-1
Java
false
false
12,394
java
package model; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.text.SimpleDateFormat; import java.util.Calendar; public class MIncidencias { private Connection conexion; public MIncidencias(Connection conexion){ this.conexion = conexion; } /** * Realiza el registro de una incidencia (Alumno). * @param id ID del alumno. * @param incidencia Contenido de la incidencia. */ public void registraIncidenciaAlumn(String id, String incidencia) { String insertInci = "INSERT INTO bgacademy.incidencias (idalumno, idprofesor, incidencia, resolucion, idgestor, fechaentrada, fechasalida, tipo) VALUES (?,?,?,?,?,?,?,?);"; Calendar cal = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); String strDate = sdf.format(cal.getTime()); try{ PreparedStatement sentencia = conexion.prepareStatement(insertInci); sentencia.setInt(1, Integer.valueOf(id)); sentencia.setNull(2, java.sql.Types.INTEGER); sentencia.setString(3, incidencia); sentencia.setString(4, "N"); sentencia.setNull(5, java.sql.Types.INTEGER); sentencia.setString(6, strDate); sentencia.setNull(7, java.sql.Types.DATE); sentencia.setString(8, "A"); sentencia.executeUpdate(); }catch(Exception e){ System.out.println(e); } } /** * Realiza el registro de una incidencia (Profesor). * @param id ID del profesor. * @param incidencia Contenido de la incidencia. */ public void registraIncidenciaProf(String id, String incidencia) { String insertInci = "INSERT INTO bgacademy.incidencias (idalumno, idprofesor, incidencia, resolucion, idgestor, fechaentrada, fechasalida, tipo) VALUES (?,?,?,?,?,?,?,?);"; Calendar cal = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); String strDate = sdf.format(cal.getTime()); try{ PreparedStatement sentencia = conexion.prepareStatement(insertInci); sentencia.setNull(1, java.sql.Types.INTEGER); sentencia.setInt(2, Integer.valueOf(id)); sentencia.setString(3, incidencia); sentencia.setString(4, "N"); sentencia.setNull(5, java.sql.Types.INTEGER); sentencia.setString(6, strDate); sentencia.setNull(7, java.sql.Types.DATE); sentencia.setString(8, "P"); sentencia.executeUpdate(); }catch(Exception e){ System.out.println(e); } } /** * Devuelve las incidencias registradas por el usuario Alumno. * @param id ID del alumno. * @return Devuelve en una matriz todas las incidencias del alumno que se le pasa por parámetro el ID. */ public Object[][] devuelveIncidenciasAlumn(String id) { int cantidad = totalRegistrosIncidenciasAlumn(id); Object datos[][] = new Object[cantidad][4]; int i = 0; String selectIncidencias = "SELECT idincidencia, fechasalida, resolucion, fechaentrada FROM bgacademy.incidencias WHERE idalumno = ?;"; try{ PreparedStatement sentencia = conexion.prepareStatement(selectIncidencias); sentencia.setInt(1, Integer.parseInt(id)); ResultSet rs = sentencia.executeQuery(); while(rs.next()){ datos[i][0] = rs.getInt("idincidencia"); datos[i][1] = rs.getString("fechaentrada"); datos[i][2] = rs.getString("fechasalida"); datos[i][3] = rs.getString("resolucion"); i++; } }catch(SQLException e){ System.out.println(e); } return datos; } /** * Devuelve las incidencias registradas por el usuario Profesor. * @param id ID del profesor. * @return Devuelve en una matriz todas las incidencias del profesor que se le pasa por parámetro el ID. */ public Object[][] devuelveIncidenciasProf(String id) { int cantidad = totalRegistrosIncidenciasProf(id); Object datos[][] = new Object[cantidad][4]; int i = 0; String selectIncidencias = "SELECT idincidencia, fechasalida, resolucion, fechaentrada FROM bgacademy.incidencias WHERE idprofesor = ?;"; try{ PreparedStatement sentencia = conexion.prepareStatement(selectIncidencias); sentencia.setInt(1, Integer.parseInt(id)); ResultSet rs = sentencia.executeQuery(); while(rs.next()){ datos[i][0] = rs.getInt("idincidencia"); datos[i][1] = rs.getString("fechaentrada"); datos[i][2] = rs.getString("fechasalida"); datos[i][3] = rs.getString("resolucion"); i++; } }catch(SQLException e){ System.out.println(e); } return datos; } /** * Devuelve el total de filas de incidencias del profesor. * @param id ID del profesor. * @return Devuelve el total de incidencias que registró un profesor en concreto. */ private int totalRegistrosIncidenciasProf(String id) { String total = "SELECT COUNT(*) AS contador FROM bgacademy.incidencias WHERE idprofesor = ?;"; int filas = 0; try{ PreparedStatement sentencia = conexion.prepareStatement(total); sentencia.setInt(1, Integer.parseInt(id)); ResultSet rs = sentencia.executeQuery(); while(rs.next()){ filas = rs.getInt("contador"); } }catch(Exception e){ System.out.println(e); } return filas; } /** * Devuelve el total de incidencias por alumno. * @param id ID del alumno. * @return Devuelve el total de incidencias que registró un alumno en concreto. */ private int totalRegistrosIncidenciasAlumn(String id) { String total = "SELECT COUNT(*) AS contador from bgacademy.incidencias WHERE idalumno = ?;"; int filas = 0; try{ PreparedStatement sentencia = conexion.prepareStatement(total); sentencia.setInt(1, Integer.parseInt(id)); ResultSet rs = sentencia.executeQuery(); while(rs.next()){ filas = rs.getInt("contador"); } }catch(Exception e){ System.out.println(e); } return filas; } /** * Devuelve el contenido de la incidencia. * @param id ID de la incidencia. * @return Retorna el detalle de la incidencia. */ public String dameIncidencia(String id) { String total = "SELECT incidencia FROM bgacademy.incidencias WHERE idincidencia = ?;"; String result = null; try{ PreparedStatement sentencia = conexion.prepareStatement(total); sentencia.setInt(1, Integer.parseInt(id)); ResultSet rs = sentencia.executeQuery(); while(rs.next()){ result = rs.getString(1); } }catch(Exception e){ System.out.println(e); } return result; } /** * Devuelve todas las incidencias de los profesores de la academia. * @return Devuelve en una matriz todas las incidencias registradas por el profesor. */ public Object[][] devuelveIncidenciasProf() { int cantidad = totalRegistrosIncidenciasProf(); String total = "SELECT idincidencia, idprofesor, fechaentrada, fechasalida, incidencia, resolucion FROM bgacademy.incidencias WHERE tipo = ? ORDER BY resolucion, fechaentrada asc;"; Object datos[][] = new Object[cantidad][6]; int i = 0; try{ PreparedStatement sentencia = conexion.prepareStatement(total); sentencia.setString(1, "P"); ResultSet rs = sentencia.executeQuery(); while(rs.next()){ datos[i][0] = rs.getInt("idincidencia"); datos[i][1] = rs.getString("idprofesor"); datos[i][2] = rs.getString("fechaentrada"); datos[i][3] = rs.getString("fechasalida"); datos[i][4] = rs.getString("incidencia"); datos[i][5] = rs.getString("resolucion"); i++; } }catch(Exception e){ System.out.println(e); } return datos; } /** * Devuelve el total de incidencias de los profesores. * @return Devuelve la cantidad de registros de incidencias por parte de los profesores. */ private int totalRegistrosIncidenciasProf() { String total = "SELECT COUNT(*) AS contador FROM bgacademy.incidencias WHERE tipo = ?;"; int filas = 0; try{ PreparedStatement sentencia = conexion.prepareStatement(total); sentencia.setString(1, "P"); ResultSet rs = sentencia.executeQuery(); while(rs.next()){ filas = rs.getInt("contador"); } }catch(Exception e){ System.out.println(e); } return filas; } /** * Devuelve todas las incidencias de los alumnos de la academia. * @return Retorna en una matriz todas las incidencias de los alumnos. */ public Object[][] devuelveIncidenciasAlumn() { int cantidad = totalRegistrosIncidenciasAlumn(); String total = "SELECT idincidencia, idalumno, fechaentrada, fechasalida, incidencia, resolucion FROM bgacademy.incidencias WHERE tipo = ?;"; Object datos[][] = new Object[cantidad][6]; int i = 0; try{ PreparedStatement sentencia = conexion.prepareStatement(total); sentencia.setString(1, "A"); ResultSet rs = sentencia.executeQuery(); while(rs.next()){ datos[i][0] = rs.getInt("idincidencia"); datos[i][1] = rs.getString("idalumno"); datos[i][2] = rs.getString("fechaentrada"); datos[i][3] = rs.getString("fechasalida"); datos[i][4] = rs.getString("incidencia"); datos[i][5] = rs.getString("resolucion"); i++; } }catch(Exception e){ System.out.println(e); } return datos; } /** * Devuelve el total de incidencias de los alumnos. * @return Devuelve la cantidad de registros de incidencias por parte de los alumnos. */ private int totalRegistrosIncidenciasAlumn() { String total = "SELECT COUNT(*) as contador FROM bgacademy.incidencias WHERE tipo = ?;"; int filas = 0; try{ PreparedStatement sentencia = conexion.prepareStatement(total); sentencia.setString(1, "A"); ResultSet rs = sentencia.executeQuery(); while(rs.next()){ filas = rs.getInt("contador"); } }catch(Exception e){ System.out.println(e); } return filas; } /** * Resolución de incidencia. * @param id ID de la incidencia * @return Retorna la fecha en que se modificó la incidencia. */ public String updateInci_s(String id) { String updateUser = "UPDATE bgacademy.incidencias SET resolucion = ?, fechasalida = ? WHERE idincidencia = ?;"; Calendar cal = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); String strDate = sdf.format(cal.getTime()); try{ PreparedStatement sentencia = conexion.prepareStatement(updateUser); sentencia.setString(1, "S"); sentencia.setString(2, strDate); sentencia.setInt(3, Integer.parseInt(id)); sentencia.executeUpdate(); }catch(Exception e){ System.out.println(e); } return strDate; } /** * Retorna la cancelación de incidencia. * @param id ID de la incidencia. */ public void updateInci_n(String id) { String updateUser = "UPDATE bgacademy.incidencias SET resolucion = ?, fechasalida = ? WHERE idincidencia = ?;"; try{ PreparedStatement sentencia = conexion.prepareStatement(updateUser); sentencia.setString(1, "N"); sentencia.setNull(2, java.sql.Types.VARCHAR); sentencia.setInt(3, Integer.parseInt(id)); sentencia.executeUpdate(); }catch(Exception e){ System.out.println(e); } } /** * Devuelve el total de incidencias sin resolver. * @return Retorna un entero con la cantidad de incidencias sin resolver. */ public int totalIncidencias() { String total = "SELECT COUNT(*) as contador FROM bgacademy.incidencias WHERE resolucion = ?;"; int filas = 0; try{ PreparedStatement sentencia = conexion.prepareStatement(total); sentencia.setString(1, "N"); ResultSet rs = sentencia.executeQuery(); while(rs.next()){ filas = rs.getInt("contador"); } }catch(Exception e){ System.out.println(e); } return filas; } }
[ "marco_antonio88_9@hotmail.com" ]
marco_antonio88_9@hotmail.com
c696e31efcfb7600f56b05469d75f18abaa81664
60aa0ff401afc14b928e378d44e46ec7413f2fe6
/gateway/src/main/java/com/li/oauth/gateway/dao/UserDao.java
dd2e2ff6734aa49e40b7183c5657c8dd79aed699
[]
no_license
JiaxiLee/oauth2
35d16179e79cb61ba9944f188a5de3a41bf99b5d
f1bd91ce32e8b1a058ec93afcdd6ec4ec227dac7
refs/heads/master
2023-06-04T10:09:42.092037
2021-06-29T03:26:25
2021-06-29T03:26:25
381,255,078
1
0
null
null
null
null
UTF-8
Java
false
false
400
java
package com.li.oauth.gateway.dao; import com.li.oauth.gateway.entity.User; import org.apache.ibatis.annotations.Mapper; import org.springframework.stereotype.Repository; /** * description: UserDao * date: 2020/10/10 * author: lijiaxi-os */ @Mapper @Repository public interface UserDao { User findByUsername(String username); User findByPhone(String phone); int insert(User user); }
[ "lijiaxi-os@360os.com" ]
lijiaxi-os@360os.com
c711be186ed7e31b0ff9a155774a982906d6897c
8b14c9072c105d3c15c7771c341e9277560e1fc4
/src/ru/mirea/practice3/human/Hand.java
1471d6361b2f145aaf00e107635a2dae196f568a
[]
no_license
Danilov-all/JavaPractice
115c8ec99bf1cc86cf27fbb3c9da1dc13fcdee05
029a8ab271dd56ac488988258bb568462cecb82f
refs/heads/main
2022-12-17T07:41:01.173657
2020-09-25T08:59:56
2020-09-25T08:59:56
296,547,785
0
0
null
null
null
null
UTF-8
Java
false
false
343
java
package ru.mirea.practice3.human; public class Hand { String handOrientation; public Hand(String handOrientation) { this.handOrientation = handOrientation; } @Override public String toString() { return "Hand{" + "handOrientation='" + handOrientation + '\'' + '}'; } }
[ "danilov.all@yandex.ru" ]
danilov.all@yandex.ru
e2be05083b6d41c80ce5f416ea490c7f4a4ca68b
e253f0ce51a9a8eb170ae70ddc23f3dcbc09dab4
/src/test/java/org/seasar/doma/jdbc/SelectOptionsImprovedTest.java
c234fc1e5d60671dc6032108ba4cbb5f7c311414
[ "Apache-2.0" ]
permissive
mstaehely/doma
d47a839a013f2e505fcc2dc88a370c8781c81dd2
dd9068b00010eb1ddc3c90cffde8a19aad6d8560
refs/heads/master
2021-01-11T21:51:28.410999
2017-01-15T05:47:59
2017-01-15T05:47:59
78,866,234
0
0
null
null
null
null
UTF-8
Java
false
false
790
java
/* * Copyright 2017 Matthew Staehely * * Extension of test cases for original doma framework as part of Assignment 4 * in the UW CSE 490E course. * * This adds a set of test cases missing from the Standard Options Test suite. */ package org.seasar.doma.jdbc; import junit.framework.TestCase; public class SelectOptionsImprovedTest extends TestCase { /** * Test the setter for SelectOptions' count field. */ public void testSetCountSize() { SelectOptions options = SelectOptions.get(); assertTrue(SelectOptionsAccessor.isCount(options.count())); } /** * Test the setter for SelectOptions' offset method. */ public void testOffset() { SelectOptions options = SelectOptions.get(); assertEquals(1, SelectOptionsAccessor.getOffset(options.offset(1))); } }
[ "mstaehel@cs.washington.edu" ]
mstaehel@cs.washington.edu
b0dd1b6029a160106f2a9ffdeabb6561f023cf58
2b69d7124ce03cb40c3ee284aa0d3ce0d1814575
/p2p-order/p2p-trading/src/main/java/com/zb/txs/p2p/exception/GlobalExceptionHandler.java
c3f6cd4a6569b6be7df0079e013d9bd435189bfa
[]
no_license
hhhcommon/fincore_p2p
6bb7a4c44ebd8ff12a4c1f7ca2cf5cc182b55b44
550e937c1f7d1c6642bda948cd2f3cc9feb7d3eb
refs/heads/master
2021-10-24T12:12:22.322007
2019-03-26T02:17:01
2019-03-26T02:17:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
724
java
package com.zb.txs.p2p.exception; import com.zb.txs.foundation.response.ResponseEntity; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestControllerAdvice; /** * User: hushenbing@zillionfortune.com * Date: 2017/2/10 * Time: 下午7:57 */ @RestControllerAdvice @Slf4j public class GlobalExceptionHandler { @ExceptionHandler(Exception.class) public ResponseEntity<Void> handle(Exception ex) { log.error("系统异常", ex); return ResponseEntity.failure(null); } }
[ "kaiyun@zillionfortune.com" ]
kaiyun@zillionfortune.com
bc4fb8e64c8b026ac2e0b6be616c59dca43e24e8
09343e7c1f92c2da964f68a1fb7f2d8e1fcad23c
/src/test/java/positions_testcase/TestCase02_HappyPath_Ten_Timestamps.java
dd009d9786a6ed8d75c481c38e7a69a79f5519e8
[]
no_license
mail2sou/RestAssuredFramework
d792461b7c748e924413afdac209581706d49445
11a518531567c7f9eed39e0c6308ab5bd07b684b
refs/heads/master
2023-07-08T15:03:30.073833
2021-08-14T08:46:33
2021-08-14T08:46:33
395,914,762
0
0
null
null
null
null
UTF-8
Java
false
false
1,862
java
package positions_testcase; import io.restassured.http.ContentType; import org.json.simple.JSONObject; import org.testng.annotations.Test; import utilpackage.Util; import static io.restassured.RestAssured.given; import static org.hamcrest.Matchers.notNullValue; public class TestCase02_HappyPath_Ten_Timestamps { @Test void test02(){ int id = 25544; String URL = Util.baseURI+id+"/positions?timestamps="+Util.getRandomNumber()+","+Util.getRandomNumber()+","+Util.getRandomNumber()+","+Util.getRandomNumber()+","+Util.getRandomNumber()+","+Util.getRandomNumber()+","+Util.getRandomNumber()+","+Util.getRandomNumber()+","+Util.getRandomNumber()+","+Util.getRandomNumber()+"&units=miles"; System.out.println("URL generated is: "+URL); JSONObject request = new JSONObject(); given(). header("Content-Type", "application/json"). contentType(ContentType.JSON). accept(ContentType.JSON). body(request.toJSONString()). get(URL). then(). assertThat(). statusCode(200). body("[9].timestamp", notNullValue()). body("[9].name", notNullValue()). body("[9].id", notNullValue()). body("[9].latitude", notNullValue()). body("[9].longitude", notNullValue()). body("[9].altitude", notNullValue()). body("[9].velocity", notNullValue()). body("[9].visibility", notNullValue()). body("[9].footprint", notNullValue()). body("[9].daynum", notNullValue()). body("[9].solar_lat", notNullValue()). body("[9].solar_lon", notNullValue()). body("[9].units", notNullValue()). log().all(); } }
[ "mail2sou@gmail.com" ]
mail2sou@gmail.com
9fc780775510365606597c902893b58c5ac4382c
de5a06159b8e5cf29e38a177ec5a5b61f1fadda5
/src/UI/mainnn.java
b49105ab78d3a58aa32f50df3ab457ec2bd1d736
[]
no_license
inggridamalias/TIF-B_KELOMPOK-5_E-Chasier
73d4ce6cd118e3dab9924241ff083f5ef0c84500
a9d635be158dc7613778649b0ab6bea400342490
refs/heads/main
2023-06-19T11:10:46.236481
2021-07-21T02:24:46
2021-07-21T02:24:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
407
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 UI; import java.sql.ResultSet; import modul.Database; /** * * @author Fikri */ public class mainnn { public static void main(String[] args) { Database.koneksi(); } }
[ "noreply@github.com" ]
inggridamalias.noreply@github.com
f2280b3716c5b2c26553c1028ab68288adfdf551
2cd64269df4137e0a39e8e67063ff3bd44d72f1b
/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/inventory/InventoryEntryChangeQuantityActionQueryBuilderDsl.java
a72a6cbd937c45f3ae3350f5ae4c1dd7d1f3dea9
[ "Apache-2.0", "GPL-2.0-only", "EPL-2.0", "CDDL-1.0", "MIT", "BSD-3-Clause", "Classpath-exception-2.0" ]
permissive
commercetools/commercetools-sdk-java-v2
a8703f5f8c5dde6cc3ebe4619c892cccfcf71cb8
76d5065566ff37d365c28829b8137cbc48f14df1
refs/heads/main
2023-08-14T16:16:38.709763
2023-08-14T11:58:19
2023-08-14T11:58:19
206,558,937
29
13
Apache-2.0
2023-09-14T12:30:00
2019-09-05T12:30:27
Java
UTF-8
Java
false
false
1,121
java
package com.commercetools.api.predicates.query.inventory; import com.commercetools.api.predicates.query.*; public class InventoryEntryChangeQuantityActionQueryBuilderDsl { public InventoryEntryChangeQuantityActionQueryBuilderDsl() { } public static InventoryEntryChangeQuantityActionQueryBuilderDsl of() { return new InventoryEntryChangeQuantityActionQueryBuilderDsl(); } public StringComparisonPredicateBuilder<InventoryEntryChangeQuantityActionQueryBuilderDsl> action() { return new StringComparisonPredicateBuilder<>( BinaryQueryPredicate.of().left(new ConstantQueryPredicate("action")), p -> new CombinationQueryPredicate<>(p, InventoryEntryChangeQuantityActionQueryBuilderDsl::of)); } public LongComparisonPredicateBuilder<InventoryEntryChangeQuantityActionQueryBuilderDsl> quantity() { return new LongComparisonPredicateBuilder<>( BinaryQueryPredicate.of().left(new ConstantQueryPredicate("quantity")), p -> new CombinationQueryPredicate<>(p, InventoryEntryChangeQuantityActionQueryBuilderDsl::of)); } }
[ "automation@commercetools.com" ]
automation@commercetools.com
fe87477e7143aa96d2dd750242554f2c7f5498b1
e0817e85c2ef1ee79f675d1334718f4ccd240b5d
/src/com/statnlp/projects/dep/model/segdep/SegSpan.java
db2993e92670041b24a414b150de8084a1dd662c
[]
no_license
allanj/StatNLP-Projects
ff6500f898c871454493769bccc48a8403fdf073
bf55d45412c14d8a4a9445fdc8923be7b159355d
refs/heads/master
2021-06-12T06:22:17.345455
2017-01-09T11:44:17
2017-01-09T11:44:17
65,527,613
1
0
null
null
null
null
UTF-8
Java
false
false
1,372
java
package com.statnlp.projects.dep.model.segdep; import java.io.Serializable; /** * Span like semi-CRFs. * @author allanjie * */ public class SegSpan implements Comparable<SegSpan>, Serializable{ private static final long serialVersionUID = 1849557517361796614L; public SpanLabel label; public int start; public int end; public SegSpan(int start, int end, SpanLabel label) { if(start>end) throw new RuntimeException("Start cannot be larger than end"); this.start = start; this.end = end; this.label = label; } public int length() { return this.end - this.start + 1; } @Override public boolean equals(Object o){ if(o instanceof SegSpan){ SegSpan s = (SegSpan)o; if(start != s.start) return false; if(end != s.end) return false; return label.equals(s.label); } return false; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + end; result = prime * result + ((label == null) ? 0 : label.hashCode()); result = prime * result + start; return result; } @Override public int compareTo(SegSpan o) { if(start < o.start) return -1; if(start > o.start) return 1; if(end < o.start) return -1; if(end > o.end) return 1; return label.compareTo(o.label); } public String toString(){ return String.format("[%d, %d, %s]", start, end, label); } }
[ "allanmcgrady@gmail.com" ]
allanmcgrady@gmail.com
24f9e5fe33148e266ae4984ee1b76b2a3bc0c278
3896919c8d489d2110ec6e8198907bfd06d38f7d
/SampleExams/Sample-Final-201510/FinalExam-201510/src/moveableRectangle/MoveableRectangleMain.java
03d82ee2272bf9ca66137083db8d3f150986faaf
[]
no_license
RHIT-CSSE/csse220
d74eb1f387f0bd7fafb0889e386dded7ef3f9e24
f7dc75787664a65fa024f078f01792e777a7649e
refs/heads/master
2023-08-30T13:06:00.970080
2023-08-28T19:58:27
2023-08-28T19:58:27
142,434,162
13
71
null
2023-08-23T13:13:59
2018-07-26T11:52:32
Java
UTF-8
Java
false
false
833
java
package moveableRectangle; import java.awt.Dimension; import javax.swing.JFrame; /** * Basic viewer classes. Nothing too exciting here. * * @author hewner * */ public class MoveableRectangleMain { private static final Dimension FRAME_SIZE = new Dimension(640,480); /** * The main - creates the window. * * You can modify this if you want but you probably don't need to. * * @param args ignored */ public static void main(String[] args) { JFrame frame = new JFrame(); frame.setTitle("Move some rectangles"); MoveableRectangleComponent bars = new MoveableRectangleComponent(frame); bars.setPreferredSize(FRAME_SIZE); frame.add(bars); frame.pack(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); } }
[ "hewner@gmail.com" ]
hewner@gmail.com
67ce513c9c8183a73e631c4e41a3f37e667d291d
3c367eb49f58c7099d58d1dd0c1d937b9d7e4910
/api/src/main/java/com/ade/JPAConfig.java
2c74cab8f1f72c4ae1dbdf75320ecb1a3b7172f1
[]
no_license
sunilampb/tracker
fb850778bef62ed16eaeb1d9a779328234d9b131
b107480cde2767d583ba9076b6502f6f2c27ed30
refs/heads/master
2021-01-16T21:38:06.069781
2018-09-23T03:58:00
2018-09-23T03:58:00
99,278,102
0
0
null
null
null
null
UTF-8
Java
false
false
2,743
java
package com.ade; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.jdbc.datasource.DriverManagerDataSource; import org.springframework.orm.jpa.JpaTransactionManager; import org.springframework.orm.jpa.JpaVendorAdapter; import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; import org.springframework.orm.jpa.vendor.Database; import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.annotation.EnableTransactionManagement; import javax.persistence.EntityManagerFactory; import javax.sql.DataSource; @Configuration @EnableTransactionManagement public class JPAConfig { protected static final String PROPERTY_NAME_DATABASE_DRIVER = "com.mysql.jdbc.Driver"; protected static final String PROPERTY_NAME_DATABASE_PASSWORD = "root"; protected static final String PROPERTY_NAME_DATABASE_URL = "jdbc:mysql://localhost:3306/tracker_db"; protected static final String PROPERTY_NAME_DATABASE_USERNAME = "root"; //private static final String PROPERTY_PACKAGES_TO_SCAN = "com.ade.vo"; @Bean public LocalContainerEntityManagerFactoryBean entityManagerFactoryBean(DataSource dataSource, JpaVendorAdapter jpaVendorAdapter){ LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean(); entityManagerFactoryBean.setDataSource(dataSource); entityManagerFactoryBean.setJpaVendorAdapter(jpaVendorAdapter); entityManagerFactoryBean.setPackagesToScan("com.ade.Entity"); return entityManagerFactoryBean; } @Bean public DataSource dataSource(){ DriverManagerDataSource ds = new DriverManagerDataSource(); ds.setDriverClassName(PROPERTY_NAME_DATABASE_DRIVER); ds.setUrl(PROPERTY_NAME_DATABASE_URL); ds.setUsername(PROPERTY_NAME_DATABASE_USERNAME); ds.setPassword(PROPERTY_NAME_DATABASE_PASSWORD); //ds.setInitialSize(5); return ds; } @Bean public JpaVendorAdapter jpaVendorAdapter(){ HibernateJpaVendorAdapter adapter = new HibernateJpaVendorAdapter(); adapter.setDatabase(Database.MYSQL); adapter.setShowSql(true); adapter.setGenerateDdl(true); adapter.setDatabasePlatform("org.hibernate.dialect.MySQL5InnoDBDialect"); return adapter; } @Bean public PlatformTransactionManager transactionManager(EntityManagerFactory entityManagerFactory) { return new JpaTransactionManager(entityManagerFactory); } }
[ "sunilampb@gmail.com" ]
sunilampb@gmail.com
b85d59039f230060a622e9e49c750175b3cd784b
ec99f9710b0b180d98196bfcd9821d094990be81
/contribs/vsp/src/main/java/playground/vsp/pt/fare/PtFareModule.java
3df214c684b6881b01b973ca8562fc95f2c752d4
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
TAIPlanner/matsim-libs
71c122cda3b7423d584c75bf171856e076d4f21b
ae729ac590c1632dea63011db293ce664c13a03e
refs/heads/master
2023-08-22T16:16:39.864475
2021-10-08T14:25:56
2021-10-08T14:25:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,085
java
package playground.vsp.pt.fare; import org.matsim.core.controler.AbstractModule; public class PtFareModule extends AbstractModule { @Override public void install() { PtFareConfigGroup ptFareConfigGroup = new PtFareConfigGroup(); if (ptFareConfigGroup.getPtFareCalculation().equals(DistanceBasedPtFareParams.SET_NAME)) { DistanceBasedPtFareParams distanceBasedPtFareParams = new DistanceBasedPtFareParams(); addEventHandlerBinding().toInstance(new DistanceBasedPtFareHandler(distanceBasedPtFareParams)); } else { throw new RuntimeException("Please choose from the following fare Calculation method: [" + DistanceBasedPtFareParams.SET_NAME + "]"); } if (ptFareConfigGroup.getApplyUpperBound()) { PtFareUpperBoundHandler ptFareUpperBoundHandler = new PtFareUpperBoundHandler(ptFareConfigGroup.getUpperBoundFactor()); addEventHandlerBinding().toInstance(ptFareUpperBoundHandler); addControlerListenerBinding().toInstance(ptFareUpperBoundHandler); } } }
[ "noreply@github.com" ]
TAIPlanner.noreply@github.com
665e1402d2348dc46c5ab132ec0d090c176d894a
aa4de3f817382525314dbd58275f6f5c47bfd857
/src/main/java/Iterator/IteratorClimbingFriendStack.java
e3467dc95077b9bb0871ee7d1e5807d03b1b8f1c
[]
no_license
EkaterinaKaprizova/Object-oriented-design
78342a7f0e81bc5f9ccc5fb2cb5b934b4268068b
96425779c136f69dc450c23a1b0e9eae2a1b2c0a
refs/heads/main
2023-01-23T00:01:50.020314
2020-12-02T06:27:52
2020-12-02T06:27:52
306,325,677
0
0
null
null
null
null
UTF-8
Java
false
false
467
java
package Iterator; import java.util.Stack; public class IteratorClimbingFriendStack implements Iterator { Stack<Friend> stack; public IteratorClimbingFriendStack(Stack<Friend> stack) { this.stack = stack; } @Override public boolean hasNext() { if (stack.empty()) { return false; } else { return true; } } @Override public Object next() { return stack.pop(); } }
[ "kaprizovakatya@gmail.com" ]
kaprizovakatya@gmail.com
6a196e8de876e3dd3b96aa1185e04a0cc1d8b35c
8315aaa4204c01ab64e7719eb247a3c598541be6
/animatedx-rest/rest-core/src/main/java/com/cs/rest/status/Message.java
1178d31d230d49ae34ed74365dce7bd8232566d8
[]
no_license
fabjj77/animatedx
18fc2a66186d9a1ff99b8438990e4293ca6adb5c
173f71df994b77515b5873f18f6bb2908c403eb7
refs/heads/master
2021-06-01T00:07:55.744499
2016-07-28T16:44:56
2016-07-28T16:44:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
882
java
package com.cs.rest.status; import javax.annotation.Nullable; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import java.io.Serializable; import static javax.xml.bind.annotation.XmlAccessType.FIELD; /** * @author Omid Alaepour. */ @XmlAccessorType(FIELD) public abstract class Message implements Serializable { private static final long serialVersionUID = 1L; @XmlElement private final Integer code; @XmlElement private final String value; @XmlElement private final String message; protected Message(final StatusCode code, final String message) { this(code, message, null); } protected Message(final StatusCode code, final String value, @Nullable final String message) { this.code = code.getCode(); this.value = value; this.message = message; } }
[ "manuelherrera@Manuels-MacBook-Pro.local" ]
manuelherrera@Manuels-MacBook-Pro.local
da9fa6a96ca9e442f6798ca41a33a6a1a157813e
fa1408365e2e3f372aa61e7d1e5ea5afcd652199
/src/testcases/CWE80_XSS/s01/CWE80_XSS__CWE182_Servlet_getCookies_Servlet_61b.java
0d6397ff2c6bbfd0aece9bd6f1905e31ed7ad43b
[]
no_license
bqcuong/Juliet-Test-Case
31e9c89c27bf54a07b7ba547eddd029287b2e191
e770f1c3969be76fdba5d7760e036f9ba060957d
refs/heads/master
2020-07-17T14:51:49.610703
2019-09-03T16:22:58
2019-09-03T16:22:58
206,039,578
1
2
null
null
null
null
UTF-8
Java
false
false
1,706
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE80_XSS__CWE182_Servlet_getCookies_Servlet_61b.java Label Definition File: CWE80_XSS__CWE182_Servlet.label.xml Template File: sources-sink-61b.tmpl.java */ /* * @description * CWE: 80 Cross Site Scripting (XSS) * BadSource: getCookies_Servlet Read data from the first cookie using getCookies() * GoodSource: A hardcoded string * Sinks: * BadSink : Display of data in web page after using replaceAll() to remove script tags, which will still allow XSS (CWE 182: Collapse of Data into Unsafe Value) * Flow Variant: 61 Data flow: data returned from one method to another in different classes in the same package * * */ package testcases.CWE80_XSS.s01; import testcasesupport.*; import javax.servlet.http.*; public class CWE80_XSS__CWE182_Servlet_getCookies_Servlet_61b { public String badSource(HttpServletRequest request, HttpServletResponse response) throws Throwable { String data; data = ""; /* initialize data in case there are no cookies */ /* Read data from cookies */ { Cookie cookieSources[] = request.getCookies(); if (cookieSources != null) { /* POTENTIAL FLAW: Read data from the first cookie value */ data = cookieSources[0].getValue(); } } return data; } /* goodG2B() - use goodsource and badsink */ public String goodG2BSource(HttpServletRequest request, HttpServletResponse response) throws Throwable { String data; /* FIX: Use a hardcoded string */ data = "foo"; return data; } }
[ "bqcuong2212@gmail.com" ]
bqcuong2212@gmail.com
9647db215eb7577a1561b25e2e93278cf534f6ea
dd209c1877ea9c0c977f76f0b29fcd3cd812ca8b
/src/main/java/com/phiz/common/config/InterceptorConfig.java
b9733a79c5e74bd4679fe00d22b08611996d8915
[]
no_license
Expried/phiz-admin
16e20f44f688d07acda97faa1c955061365e6a08
3a8e79b28444be1f1dbb43aeee393491cab76697
refs/heads/master
2020-04-06T13:07:45.291554
2018-11-14T10:04:38
2018-11-14T10:04:38
157,485,141
0
0
null
null
null
null
UTF-8
Java
false
false
1,331
java
package com.phiz.common.config; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import com.phiz.common.handler.LogHandler; /** * <pre> * <b>.</b> * <b>Project:hzfare-core</b> * <b>ClassName:com.hz.fare.common.config.InterceptorConfig</b> * <b>Description:拦截器配置</b> * ---------------------------------------------------------------------- * <b>Author:</b> <b>淳峰 1569812004@qq.com</b> * <b>Date:</b> <b>2018年5月30日 下午7:22:53</b> * ---------------------------------------------------------------------- * <b>Changelog:</b> * Ver Date Author Detail * ---------------------------------------------------------------------- * 1.0 2018年5月30日 下午7:22:53 <b>淳峰 1569812004@qq.com</b> * new file. * </pre> */ @Configuration public class InterceptorConfig extends WebMvcConfigurerAdapter { @Override public void addInterceptors(InterceptorRegistry registry) { //这里可以添加多个拦截器 registry.addInterceptor(new LogHandler()).addPathPatterns("/**"); super.addInterceptors(registry); } }
[ "1569812004@qq.com" ]
1569812004@qq.com
24da0d5396780ebac52c61558f880a61d59fd134
7811990c66cda8f8d34c5cd3340dcfacf3e7650f
/entitlement/src/main/java/com/ning/billing/entitlement/DefaultEntitlementService.java
5962bd163986d8be9aac5d0047260ea392ac80e3
[ "Apache-2.0" ]
permissive
nsiitk/killbill
7e2334a34cb62919d8cc8e310616f988f34e43d0
158d316dc5fa9f7682c61a4525b64519a80448ef
refs/heads/master
2020-12-31T02:00:50.851241
2013-11-11T17:17:02
2013-11-11T17:17:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
847
java
/* * Copyright 2010-2013 Ning, Inc. * * Ning 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.ning.billing.entitlement; public class DefaultEntitlementService implements EntitlementService { @Override public String getName() { return EntitlementService.ENTITLEMENT_SERVICE_NAME; } }
[ "stephane@ning.com" ]
stephane@ning.com
9844a5ebf84391af023c8f5731bfbb59bab59d65
994e72241a493b8afa531e0c20114db436fec1ec
/app/controllers/SubmissionsController.java
8ca74f039444d2625053cda2c14811600bebb072
[ "CC0-1.0" ]
permissive
pdutt111/play-backend
3354d547ef0c9c11b9df860ce523716aa82ac274
6dccfada70716121bcdf033f6ad1376776ecdebb
refs/heads/master
2020-04-09T07:08:00.224287
2018-12-04T00:26:28
2018-12-04T00:26:28
160,141,600
0
0
null
null
null
null
UTF-8
Java
false
false
4,284
java
package controllers; import com.avaje.ebean.Ebean; import com.avaje.ebean.Transaction; import models.Submission; import models.UpdateUser; import models.User; import play.data.Form; import play.data.FormFactory; import play.libs.Json; import play.mvc.Controller; import play.mvc.Result; import play.mvc.Results; import javax.inject.Inject; import javax.persistence.PersistenceException; import java.util.ArrayList; import java.util.List; public class SubmissionsController extends Controller { private FormFactory formFactory; GlobalObjects globalObjects = new GlobalObjects(); @Inject public SubmissionsController(FormFactory formFactory) { this.formFactory = formFactory; } public Result fetchSubmissions(String email) { User user = User.find.where().eq("email", email).findUnique(); List<Submission> submissions = Submission.find.where() .eq("email", user.email) .findList(); if (user.authority.equals("admin")) { submissions = Submission.find.all(); } return ok( Json.toJson(submissions) ); } public Result fetchSubmission(Long id, String email) { System.out.println("fetch submissions"+id); User user = User.find.where().eq("email", email).findUnique(); Submission submission = Submission.find.where().eq("id", id).findUnique(); if (!user.authority.equals("admin")) { submission = Submission.find.where().eq("email", user.email).eq("id", id).findUnique(); } if(submission == null){ return badRequest(); } return ok( Json.toJson(submission) ); } public Result save(String email) { User user = User.find.where().eq("email", email).findUnique(); Submission submission = Json.fromJson(request().body().asJson(), Submission.class); try { submission.status = "0"; submission.email = user.email; submission.save(); return ok(); } catch (PersistenceException e) { return badRequest(); } } public Result update(Long submissionId, String email) throws PersistenceException { User user = User.find.where().eq("email", email).findUnique(); Submission submissionForm = Json.fromJson(request().body().asJson(), Submission.class); Submission savedSubmission = Submission.find.where().eq("id", submissionId).findUnique(); if(!user.authority.equals("admin")){ savedSubmission = Submission.find.where().eq("id", submissionId).eq("email", user.email).findUnique(); } if (savedSubmission != null) { Transaction txn = Ebean.beginTransaction(); String ownerEmail = savedSubmission.email; savedSubmission = submissionForm; savedSubmission.email = ownerEmail; savedSubmission.id = submissionId; savedSubmission.status = "0"; savedSubmission.update(); txn.commit(); txn.end(); return ok(); } else { return badRequest(); } } public Result approve(Long submissionId,String email) throws PersistenceException { User user = User.find.where().eq("email", email).findUnique(); if (user.authority.equals("admin")) { Transaction txn = Ebean.beginTransaction(); Submission submission = Submission.find.byId(submissionId); submission.status = "1"; submission.update(); txn.commit(); return ok("blah blah"); }else{ return badRequest("blah blah"); } } public Result reject(Long submissionId,String email) throws PersistenceException { User user = User.find.where().eq("email", email).findUnique(); if (user.authority.equals("admin")) { Transaction txn = Ebean.beginTransaction(); Submission submission = Submission.find.byId(submissionId); submission.status = "-1"; submission.update(); txn.commit(); return ok("blah blah"); }else{ return badRequest("blah blah"); } } }
[ "pdutt111@gmail.com" ]
pdutt111@gmail.com
c658f88b9350fbb216781a8b5c567ee0aea5dec1
222a7c99f37128d305e22c7d6035b20c21099675
/example/app/src/main/java/com/teamwork/example/model/TWPerson.java
d5cafac260a9df4ff2f7c67e5cb69ce8305515ce
[]
no_license
jonathansds/teamwork-example-app
81c383c19d2c35ef185035bd77188c892ff1c069
ca95e956762766d5c7ad02ce0a162ddd19d4879a
refs/heads/master
2020-03-15T02:27:41.001910
2018-05-03T00:06:43
2018-05-03T00:06:43
131,918,358
0
0
null
null
null
null
UTF-8
Java
false
false
8,133
java
package com.teamwork.example.model; import com.google.gson.annotations.SerializedName; import org.parceler.Parcel; @Parcel public class TWPerson { @SerializedName("id") String id; @SerializedName("pid") String pid; @SerializedName("company-id") String companyId; @SerializedName("company-name") String companyName; @SerializedName("title") String title; @SerializedName("first-name") String firstName; @SerializedName("last-name") String lastName; @SerializedName("user-name") String nickname; @SerializedName("avatar-url") String avatarURL; @SerializedName("user-type") String userType; @SerializedName("administrator") boolean admin; @SerializedName("site-owner") boolean siteOwner; @SerializedName("deleted") boolean deleted; @SerializedName("has-access-to-new-projects") boolean hasAccessNewProjects; @SerializedName("in-owner-company") boolean inOwnerCompany; @SerializedName("address-zip") String zipCode; @SerializedName("address-line-1") String addressOne; @SerializedName("address-line-2") String addressTwo; @SerializedName("address-city") String city; @SerializedName("address-state") String state; @SerializedName("address-country") String country; @SerializedName("email-address") String email; @SerializedName("email-alt-1") String altEmailOne; @SerializedName("email-alt-2") String altEmailTwo; @SerializedName("email-alt-3") String altEmailThree; @SerializedName("twitter") String twitter; @SerializedName("phone-number-mobile") String phoneNumberMobile; @SerializedName("phone-number-home") String phoneNumberHome; @SerializedName("phone-number-office") String phoneNumberOffice; @SerializedName("phone-number-office-ext") String phoneNumberOfficeExt; @SerializedName("phone-number-fax") String fax; @SerializedName("created-at") String dateCreated; @SerializedName("userUUID") String userUUID; @SerializedName("privateNotes") String privateNotes; @SerializedName("im-service") String imService; @SerializedName("im-handle") String imHandle; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getPid() { return pid; } public void setPid(String pid) { this.pid = pid; } public String getCompanyId() { return companyId; } public void setCompanyId(String companyId) { this.companyId = companyId; } public String getCompanyName() { return companyName; } public void setCompanyName(String companyName) { this.companyName = companyName; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public String getNickname() { return nickname; } public void setNickname(String nickname) { this.nickname = nickname; } public String getAvatarURL() { return avatarURL; } public void setAvatarURL(String avatarURL) { this.avatarURL = avatarURL; } public String getUserType() { return userType; } public void setUserType(String userType) { this.userType = userType; } public boolean isAdmin() { return admin; } public void setAdmin(boolean admin) { this.admin = admin; } public boolean isSiteOwner() { return siteOwner; } public void setSiteOwner(boolean siteOwner) { this.siteOwner = siteOwner; } public boolean isDeleted() { return deleted; } public void setDeleted(boolean deleted) { this.deleted = deleted; } public boolean isHasAccessNewProjects() { return hasAccessNewProjects; } public void setHasAccessNewProjects(boolean hasAccessNewProjects) { this.hasAccessNewProjects = hasAccessNewProjects; } public boolean isInOwnerCompany() { return inOwnerCompany; } public void setInOwnerCompany(boolean inOwnerCompany) { this.inOwnerCompany = inOwnerCompany; } public String getZipCode() { return zipCode; } public void setZipCode(String zipCode) { this.zipCode = zipCode; } public String getAddressOne() { return addressOne; } public void setAddressOne(String addressOne) { this.addressOne = addressOne; } public String getAddressTwo() { return addressTwo; } public void setAddressTwo(String addressTwo) { this.addressTwo = addressTwo; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } public String getState() { return state; } public void setState(String state) { this.state = state; } public String getCountry() { return country; } public void setCountry(String country) { this.country = country; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getAltEmailOne() { return altEmailOne; } public void setAltEmailOne(String altEmailOne) { this.altEmailOne = altEmailOne; } public String getAltEmailTwo() { return altEmailTwo; } public void setAltEmailTwo(String altEmailTwo) { this.altEmailTwo = altEmailTwo; } public String getAltEmailThree() { return altEmailThree; } public void setAltEmailThree(String altEmailThree) { this.altEmailThree = altEmailThree; } public String getTwitter() { return twitter; } public void setTwitter(String twitter) { this.twitter = twitter; } public String getPhoneNumberMobile() { return phoneNumberMobile; } public void setPhoneNumberMobile(String phoneNumberMobile) { this.phoneNumberMobile = phoneNumberMobile; } public String getPhoneNumberHome() { return phoneNumberHome; } public void setPhoneNumberHome(String phoneNumberHome) { this.phoneNumberHome = phoneNumberHome; } public String getPhoneNumberOffice() { return phoneNumberOffice; } public void setPhoneNumberOffice(String phoneNumberOffice) { this.phoneNumberOffice = phoneNumberOffice; } public String getPhoneNumberOfficeExt() { return phoneNumberOfficeExt; } public void setPhoneNumberOfficeExt(String phoneNumberOfficeExt) { this.phoneNumberOfficeExt = phoneNumberOfficeExt; } public String getFax() { return fax; } public void setFax(String fax) { this.fax = fax; } public String getDateCreated() { return dateCreated; } public void setDateCreated(String dateCreated) { this.dateCreated = dateCreated; } public String getUserUUID() { return userUUID; } public void setUserUUID(String userUUID) { this.userUUID = userUUID; } public String getPrivateNotes() { return privateNotes; } public void setPrivateNotes(String privateNotes) { this.privateNotes = privateNotes; } public String getImService() { return imService; } public void setImService(String imService) { this.imService = imService; } public String getImHandle() { return imHandle; } public void setImHandle(String imHandle) { this.imHandle = imHandle; } }
[ "ti.jonathan.santos@gmail.com" ]
ti.jonathan.santos@gmail.com
3f10f2f6cd10debf39e24ebdcd9dc9f1a051f878
46a5a67828f01fdb7a47c7ec96e38dffdae2b7b7
/app/src/main/java/org/goodev/retrofitdemo/MainActivity.java
735e4250a168c9e3b2395cb830c142caec28bdca
[]
no_license
joelmora9618/RetrofitDemo
ee4b2f41b78fef645535aa8c4b03e699c664e295
b17bc5fc564b9c4a16a236045a155bcf2b155b48
refs/heads/master
2020-04-17T09:23:16.087169
2019-01-20T04:38:57
2019-01-20T04:38:57
166,455,648
0
0
null
null
null
null
UTF-8
Java
false
false
1,085
java
package org.goodev.retrofitdemo; import java.util.List; import org.goodev.retrofitdemo.model.Contacto; import retrofit.Callback; import retrofit.RetrofitError; import retrofit.client.Response; import android.app.ListActivity; import android.os.Bundle; import android.widget.ArrayAdapter; import android.widget.ListView; public class MainActivity extends ListActivity { ListView mListView; Callback<List<Contacto>> callback = new Callback<List<Contacto>>() { @Override public void success(List<Contacto> contributors, Response response) { ArrayAdapter<Contacto> adapter = new ArrayAdapter<Contacto>(getApplicationContext(), android.R.layout.simple_list_item_1, contributors); mListView.setAdapter(adapter); } @Override public void failure(RetrofitError error) { } }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mListView = getListView(); GitHubClient.getContributors(callback); } }
[ "joel_mora@itrsa.com.ar" ]
joel_mora@itrsa.com.ar
35f57b17e74d9341c9b3b487bcf22048b784729d
5fe7c72e49811637505a55e30e0a096ef8653be6
/gen/com/example/banderapaises/BuildConfig.java
a2fda65803a904142d799a2dc2a6da375f15a525
[]
no_license
servandomodica/AndroidJavaJuegoBanderas
235f26487effb12759f9943e8695631ff0198a90
8a2e484d9b006f4e5fd7fb3b0d5bfc03316709e9
refs/heads/master
2022-11-30T21:31:09.889745
2020-08-08T13:20:16
2020-08-08T13:20:16
286,046,962
0
0
null
null
null
null
UTF-8
Java
false
false
167
java
/** Automatically generated file. DO NOT MODIFY */ package com.example.banderapaises; public final class BuildConfig { public final static boolean DEBUG = true; }
[ "noreply@github.com" ]
servandomodica.noreply@github.com
07f14dae25c9622d5a05473f8d4a8ccca3dbca27
b47496abfc8c477949838babc98e46eb3f616c05
/src/main/java/com/kfizzle/ChallengeBlog/repo/PostRepo.java
27d132d0ebb93d13774caad26d1cab0260bd1621
[]
no_license
Foscat/springStackChallenge
09faf292696d69329e8c6fa8a0a1de1a2d5c33cb
b45068631335c49e760e966d02f3f68483c8755d
refs/heads/master
2020-06-11T13:40:58.303685
2019-06-26T22:23:18
2019-06-26T22:23:18
193,985,194
0
0
null
null
null
null
UTF-8
Java
false
false
221
java
package com.kfizzle.ChallengeBlog.repo; import com.kfizzle.ChallengeBlog.model.Post; import org.springframework.data.repository.CrudRepository; public interface PostRepo extends CrudRepository<Post, Long>{ }
[ "noreply@github.com" ]
Foscat.noreply@github.com
d80f6560a1729a76459fb47866023329e4d2c274
cc08d3fd1dc813fcec32b32883253c8d39c9f5e6
/cloudalibaba-consumer-nacos-order84/src/main/java/com/xinchen/springcloud/alibaba/config/ApplicationContextConfig.java
b03fd6527888bf5f83e25dc4ff558f83bd5eb424
[]
no_license
mygithub-xu/springcloud
36056cb1c07aafbb301adb39294585f3bc7a970a
be3e26571ad47dd8a8cc5aa5310f5b484d006691
refs/heads/master
2023-05-07T22:22:50.266557
2021-06-09T09:33:57
2021-06-09T09:33:57
362,402,163
0
0
null
null
null
null
UTF-8
Java
false
false
508
java
package com.xinchen.springcloud.alibaba.config; import org.springframework.cloud.client.loadbalancer.LoadBalanced; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.client.RestTemplate; /** * @auther zzyy * @create 2020-02-25 16:06 */ @Configuration public class ApplicationContextConfig { @Bean @LoadBalanced public RestTemplate getRestTemplate() { return new RestTemplate(); } }
[ "1967368657@qq.com" ]
1967368657@qq.com
df9eefa5e6f8cd11a9fd1fb36ca0aed3624a69f4
ad3932f7aff8d16114bb3cbe573721f5bd4c6730
/app/src/main/java/com/example/sirawich/herb4test/Uploadimage.java
243830fe3b34f34524318466069f9e5fa3b4f472
[]
no_license
SirawichDev/NSC_Herb4Health
fe9f9f1693b7282b38082fa6b6f46e352f60c8ef
29cfacb76fa26d7bc8b0d4c17f20e1b239bbd994
refs/heads/master
2021-07-04T03:57:29.765399
2017-09-24T19:46:03
2017-09-24T19:46:03
104,600,988
0
0
null
null
null
null
UTF-8
Java
false
false
5,411
java
package com.example.sirawich.herb4test; import android.app.ProgressDialog; import android.content.ContentResolver; import android.content.Intent; import android.graphics.Bitmap; import android.net.Uri; import android.os.Bundle; import android.provider.MediaStore; import android.support.annotation.NonNull; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.webkit.MimeTypeMap; import android.widget.EditText; import android.widget.ImageView; import android.widget.Toast; import com.google.android.gms.tasks.OnFailureListener; import com.google.android.gms.tasks.OnSuccessListener; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.storage.FirebaseStorage; import com.google.firebase.storage.OnProgressListener; import com.google.firebase.storage.StorageReference; import com.google.firebase.storage.UploadTask; import java.io.FileNotFoundException; import java.io.IOException; public class Uploadimage extends AppCompatActivity { private StorageReference mStorageRef; private DatabaseReference mDatabaseRef; private ImageView imgview; private EditText editext; private EditText editTextopt; private Uri imgUrl; public static final String STORAGE_URL = "สมุนไพร/"; public static final String DATABASE_PATH ="สมุนไพร"; public static final int REQ_CODE= 1234; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_uploadimage); mStorageRef = FirebaseStorage.getInstance().getReference(); mDatabaseRef = FirebaseDatabase.getInstance().getReference(DATABASE_PATH); imgview =(ImageView) findViewById(R.id.image_View); editext = (EditText) findViewById(R.id.txtImageName); editTextopt = (EditText) findViewById(R.id.txtImageoption); } public void btnBrow(View v){ Intent intent = new Intent(); intent.setType("image/*"); intent.setAction(Intent.ACTION_GET_CONTENT); startActivityForResult(Intent.createChooser(intent,"Select image"),REQ_CODE) ; } @Override protected void onActivityResult(int requestCode,int resultCode,Intent data){ super.onActivityResult(requestCode,resultCode,data); if(requestCode == REQ_CODE && resultCode == RESULT_OK && data != null && data.getData() != null){ imgUrl = data.getData(); try{ Bitmap bm = MediaStore.Images.Media.getBitmap(getContentResolver(),imgUrl); imgview.setImageBitmap(bm); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } } public String getImagetxt(Uri uri){ ContentResolver contentResolver = getContentResolver(); MimeTypeMap mimeTypeMap = MimeTypeMap.getSingleton(); return MimeTypeMap.getFileExtensionFromUrl(contentResolver.getType(uri)); } public void btnUpload_Click(View v){ if(imgUrl != null){ final ProgressDialog dialog = new ProgressDialog(this); dialog.setTitle("Uploading image"); dialog.show(); StorageReference ref = mStorageRef.child(STORAGE_URL+ System.currentTimeMillis()+"."+getImagetxt(imgUrl)); ref.putFile(imgUrl).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() { @SuppressWarnings("VisibleForTests") @Override public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) { dialog.dismiss(); Toast.makeText(getApplicationContext(),"Inmage Uploaded", Toast.LENGTH_SHORT).show(); ImageUploadConfig imgup = new ImageUploadConfig(editext.getText().toString(),taskSnapshot.getDownloadUrl().toString(),editTextopt.getText().toString()); String uploadedid = mDatabaseRef.push().getKey(); mDatabaseRef.child(uploadedid).setValue(imgup); } }) .addOnFailureListener(new OnFailureListener() { @Override public void onFailure(@NonNull Exception e) { dialog.dismiss(); Toast.makeText(getApplicationContext(),e.getMessage(), Toast.LENGTH_SHORT).show(); } }) .addOnProgressListener(new OnProgressListener<UploadTask.TaskSnapshot>() { @SuppressWarnings("VisibleForTests") @Override public void onProgress(UploadTask.TaskSnapshot taskSnapshot) { double progres = (100 * taskSnapshot.getBytesTransferred())/taskSnapshot.getTotalByteCount(); dialog.setMessage("Uploaded"+(int)progres+"%"); } }); } else Toast.makeText(getApplicationContext(),"please select image", Toast.LENGTH_SHORT).show(); } public void btnShowlistImage_Click(View v){ Intent i = new Intent(Uploadimage.this,FetchImageFirebase.class); startActivity(i); } }
[ "sirawit0676@gmail.com" ]
sirawit0676@gmail.com
c69010aa4a267c41fe6647d79b63d48dc8e700b9
59f073faa968efd98667f2370a651c06e85d8bec
/app/src/test/java/paket/talerez/mvpexample/ExampleUnitTest.java
0fe5328a3ada94be140458bbaf7cd5450679ea83
[]
no_license
tallevi112/mvpList
97d0b8a23b233f493e9d77a0a9159cef476c764a
cab6db64d31ff24c5997becc0584eafc8cccace7
refs/heads/master
2020-04-09T13:27:19.172993
2018-12-07T15:09:52
2018-12-07T15:09:52
160,372,639
0
0
null
null
null
null
UTF-8
Java
false
false
385
java
package paket.talerez.mvpexample; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
[ "TALHOD1@GMAIL.COM" ]
TALHOD1@GMAIL.COM
f5e2545f29a6e137f4936c909544ad209303f674
d58be648b4abd1f8efd2906028675e67b131ae8d
/ShoppingCart-springmvc-security-mysql/src/main/java/com/example/springsecuritywebmvc/shopping/user/ShoppingUserServiceImpl.java
708ef8df3e77e8a0914d050ca551162f88b06432
[]
no_license
shirishphatangare/ShoppingCart
9af3eb6efdb71c3c650619abebef256cc50cbc04
bd28181daa5fa8272673080fb882606272ea8400
refs/heads/master
2021-05-02T06:18:09.017306
2019-09-05T02:24:11
2019-09-05T02:24:11
120,856,058
0
0
null
null
null
null
UTF-8
Java
false
false
1,354
java
package com.example.springsecuritywebmvc.shopping.user; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.example.springsecuritywebmvc.shopping.entity.ShoppingProductBean; import com.example.springsecuritywebmvc.shopping.entity.ShoppingProductDetailBean; @Service public class ShoppingUserServiceImpl implements ShoppingUserService { @Autowired private ShoppingUserDAO shoppingUserDAO; /* (non-Javadoc) * @see com.shopping.user.ShoppingUserService#showAllProducts() */ public List <ShoppingProductBean> showAllProducts() { List <ShoppingProductBean> products = null; try { products = shoppingUserDAO.showAllProducts(); }catch(Exception e) { } return products; } /* (non-Javadoc) * @see com.shopping.user.ShoppingUserService#getProduct(int) */ public ShoppingProductBean getProduct(int productId) { ShoppingProductBean product = null; try { product = shoppingUserDAO.getProduct(productId); }catch(Exception e) { } return product; } /* (non-Javadoc) * @see com.shopping.user.ShoppingUserService#placeOrder(java.util.List) */ public void placeOrder(List <ShoppingProductDetailBean> productsList) { try { shoppingUserDAO.placeOrder(productsList); }catch (Exception e) { } } }
[ "sphatangare@gmail.com" ]
sphatangare@gmail.com
867ab30d4cc3afbf9ebde98f1dd57dbdd6bd7626
747a159688e9bb044063bdc635ccc072bc9314bd
/ExamGrading.java
cdb0d9880a42158aa632ce797f29e49b421f94c6
[]
no_license
IanXTs/COMP202
20e9786ac9d62ced248a9762351d5cddc0b2c7bd
ec6efaf6ee7356b433b8768627fda21c5b1f2d3f
refs/heads/master
2020-04-10T11:57:40.681148
2018-12-09T11:27:39
2018-12-09T11:27:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,209
java
import java.util.Arrays; //Name: Yao An Tsai //McGill ID : 260741766 public class ExamGrading { //main method for testing public static void main(String[] main) { char[][] responses = {{'C','A','B','B','C','A'},{'A','A','B','B','B','B'},//responses from students {'C','B','A','B','C','A'},{'A','B','A','B','B','B'}};//right answers char[] solutions={'C','A','B','B','C','C'}; double[] grades = gradeAllStudents(responses , solutions); System.out.println(Arrays.toString(grades)); char[]studentsResponse1 = {'A','B','C','D','C','A'}; char[]studentsResponse2={'A','B','D','B','B','A'}; char[] correctAnswer = {'C','B','C','D','A','A'}; int numOfsame = numWrongSimilar(studentsResponse1 , studentsResponse2,correctAnswer); System.out.println("the number of responses that both do wrong is: " +numOfsame); char[][] studentAnswers={{'A','B','C','D','B','A'},{'C','B','D','D','B','B'},{'C','B','D','D','C','B'}}; char[] theAnswers = {'C','B','C','D','A','A'}; int index = 1 ; int threshold = 2; int result = numMatches(studentAnswers , theAnswers , index , threshold); System.out.println("the number of student having at lease similarity threshold wrong answers is: " +result); int threshold2 = 1; int[][] questionC = findSimilarAnswers(responses,solutions,threshold2); System.out.println(Arrays.deepToString(questionC)); } public static double[] gradeAllStudents(char[][] arr , char[] solutions) { String s = "the index of student who causes problem is" ; int x = 6; //we set an int variable here as 6 because there are 6 questions in total double [] result = new double[4]; for(int i= 0;i<arr.length ;i++) { char[]studentResponse = arr[i]; x=6; for(int j= 0; j< solutions.length ;j++) { char r = studentResponse[j]; char a = solutions[j]; //if the student doesn't answer all the question leades to illegal and we use it as the value if(studentResponse.length !=solutions.length) { s= s+" " +i; throw new IllegalArgumentException (s); } if(r != a) { x=x-1; //if the student has one answer that does not match the correct solution, we minus x by 1, showing the # who got the quesiton right } } double grades = x*100/6; result[i] = grades; // and now we can finally calculate the final grade and return the result } return result ; } public static int numWrongSimilar(char[] arr1 , char[] arr2 ,char[] correctAnswer) { int num = 0 ; for(int i = 0; i<arr1.length ; i++) { char a = arr1[i]; char b = arr2[i]; char c = correctAnswer[i]; if (a==b && b != c) { num = num +1 ; } } if(arr1.length != correctAnswer.length || arr2.length != correctAnswer.length) { throw new IllegalArgumentException("somoeone doesn't fully answer the exam"); } return num; } public static int numMatches(char[][] arr1 , char[] arr2 ,int x ,int y) { int value = 0 ; for(int i = 0 ; i<arr1.length ; i++) { char [] arr3 = arr1[i]; if(i != x) { int hh= numWrongSimilar(arr1[x], arr3 , arr2); if( hh >= y) { value = value +1 ; } } } return value ; } public static int [][] findSimilarAnswers(char[][] arr1 ,char[] arr2 ,int x ) { int [][] result = new int[arr1.length][]; for(int i = 0;i < arr1.length ; i++) { char[] arr3 = arr1[i]; int length = numMatches(arr1 ,arr2 , i , x); int[] eachStudent = new int[length]; int k = 0; for(int j= 0 ; j <arr1.length ;j ++) { char[] subAnswers = arr1[j]; result[i] = eachStudent ; if (i != j) { int numWrong = numWrongSimilar(arr3 , subAnswers , arr2); if(numWrong >= x) { eachStudent[k] = j; k = k + 1 ; } } } } return result ; } }
[ "noreply@github.com" ]
IanXTs.noreply@github.com
6c43e22d10ded820a01e59c2c7d647f4ad68b08e
e9b9eaa6532cbf4f8d6b5d037ed8453cc5637166
/A1/TestPersonWeight.java
f4e2a8495fb1fd9b2cefae1334d37a29522f6a36
[]
no_license
VictoriaXY6/CSC22100-Projects
dfc010a6e0288f7b1b339de50caa3def2e271406
612670cf9dc91208cb79b68589dc6efc16d399ba
refs/heads/master
2022-11-08T06:34:00.753614
2020-06-24T16:12:11
2020-06-24T16:12:11
274,574,159
0
0
null
null
null
null
UTF-8
Java
false
false
1,587
java
import java.util.Scanner; public class TestPersonWeight{ public static void main(String[] args) { PersonWeight person1 = new PersonWeight(); person1.setFullName("Kate Williams"); person1.setYearOfBirth(2000); person1.setHeight(1.68); person1.setWeight(56.8); //System.out.printf("%s%n%d%n%.2f%n%.2f%n%n", person1.getFullName(), person1.getYearOfBirth(), person1.getHeight(), person1.getWeight()); Scanner input = new Scanner(System.in); System.out.printf("%s", "Enter person's name: "); String fullName = input.nextLine(); System.out.printf("%s", "Enter person's year of birth: "); int yearOfBirth = input.nextInt(); System.out.printf("%s", "Enter person's height in meters: "); double height = input.nextDouble(); System.out.printf("%s", "Enter person's weight in kilograms: "); double weight = input.nextDouble(); PersonWeight person2 = new PersonWeight(fullName, yearOfBirth, height, weight); System.out.printf("%16s%s%n", "Full Name: ", person2.getFullName()); System.out.printf("%16s%d%n", "Age: ",person2.computeAge()); System.out.printf("%16s%.2f%n", "Height: ", person2.getHeight()); System.out.printf("%16s%.2f%n", "Weight: ", person2.getWeight()); System.out.printf("%16s%s%n", "Classification: ", classifyBMI(person2.computeBMI())); input.close(); } public static String classifyBMI(double BMI) { if(BMI < 18.5) { return "Underweight"; } else if(BMI >= 18.5 && BMI < 25.0) { return "Normal Weight"; } else if(BMI >= 25.0 && BMI < 30.0) { return "Overweight"; } else { return "Obese"; } } }
[ "noreply@github.com" ]
VictoriaXY6.noreply@github.com
3a1b3852ca68a9352501de683e184f5731bcf0f1
3269292958a163b70d6a0102926a67a03c3241ee
/Java/Tasks/Design patterns/Template method/TemplateMethod2.java
095f0eaa96a3f5b328e328cd9b045a5d18214cb7
[]
no_license
synthon/hyperskill
ca4851e12418c7b2d7fa4b8e57d05de8dcb59a23
22daf372502a31110b11719824d6765a4eb4f5c2
refs/heads/master
2020-12-11T06:44:10.893103
2020-04-11T18:53:27
2020-04-11T18:53:27
233,791,386
0
0
null
null
null
null
UTF-8
Java
false
false
1,829
java
import java.util.Scanner; abstract class Meal { /** * It provides template method of meal routine. */ public void doMeal() { prepareIngredients(); cook(); eat(); cleanUp(); } public abstract void prepareIngredients(); public abstract void cook(); public void eat() { System.out.println("That's good"); } public abstract void cleanUp(); } class Steak extends Meal { @Override public void prepareIngredients() { System.out.println("Ingredients: beef steak, lemon, olive oil, salt, sugar"); } @Override public void cook() { System.out.println("Fry the steak in the pan"); } @Override public void cleanUp() { System.out.println("Push dishes in the sink and go coding"); } } class Sandwich extends Meal { @Override public void cleanUp() { System.out.println("Lick fingers and go to sleep"); } @Override public void cook() { System.out.println("Paste ingredients between bread slices. Toast sandwich"); } @Override public void prepareIngredients() { System.out.println("Ingredients: bacon, white bread, egg, cheese, mayonnaise, tomato"); } } public class Main { public static void main(String[] args) { final Scanner scanner = new Scanner(System.in); final String order = scanner.nextLine(); scanner.close(); Meal meal = null; if ("Sandwich".equals(order)) { meal = new Sandwich(); meal.doMeal(); } else if ("Steak".equals(order)) { meal = new Steak(); meal.doMeal(); } else { System.out.println("Error"); } } }
[ "40410117+synthon@users.noreply.github.com" ]
40410117+synthon@users.noreply.github.com
735e428d5a8685fa1932a4e1a9f82baecdda2136
4b8b83e997c046771c2ba8949d1f8744958e36e9
/app/src/main/java/org/jf/dexlib2/writer/pool/StringTypeBasePool.java
888d81a6331cd5bf99af39a242274510c3ddaac8
[ "Apache-2.0", "LicenseRef-scancode-free-unknown" ]
permissive
vaginessa/show-java
978fcf3cfc5e875e3f5f81ad9e47ceb2d60b2dc2
31f540fb9e13a74e0a0ead27715888f022bff14c
refs/heads/master
2021-01-18T04:09:53.521444
2015-12-09T20:58:32
2015-12-09T20:58:32
42,273,420
0
0
Apache-2.0
2019-01-18T07:06:51
2015-09-10T22:12:08
Java
UTF-8
Java
false
false
2,690
java
/* * Copyright 2013, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * 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 Google Inc. 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 * OWNER 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 org.jf.dexlib2.writer.pool; import com.google.common.collect.Maps; import org.jf.dexlib2.writer.DexWriter; import org.jf.dexlib2.writer.NullableIndexSection; import org.jf.util.ExceptionWithContext; import java.util.Collection; import java.util.Map; import javax.annotation.Nonnull; import javax.annotation.Nullable; public abstract class StringTypeBasePool implements NullableIndexSection<CharSequence> { @Nonnull protected final Map<String, Integer> internedItems = Maps.newHashMap(); @Nonnull @Override public Collection<Map.Entry<String, Integer>> getItems() { return internedItems.entrySet(); } @Override public int getItemIndex(@Nonnull CharSequence key) { Integer index = internedItems.get(key.toString()); if (index == null) { throw new ExceptionWithContext("Item not found.: %s", key.toString()); } return index; } @Override public int getNullableItemIndex(@Nullable CharSequence key) { if (key == null) { return DexWriter.NO_INDEX; } return getItemIndex(key); } }
[ "niranjan94@yahoo.com" ]
niranjan94@yahoo.com
c6c49f1eb7336c311b56615fee31faae6d2aa7c7
7cfd82a828312972f4997b13582e9ce2d0e12a27
/src/main/java/com/caucraft/commandbridge/BungeePlugin.java
7906b1184de236a1b7d97396e67cfb1c8b1bf1cc
[]
no_license
caucow/BungeeCommandBridge
544fe8c62ed0c47fefe4fa48612694ddcb8d8c12
3f59a13555fdb7f2b37618dc6a123382af6b5d5d
refs/heads/master
2023-02-20T18:46:18.732014
2021-01-29T05:42:14
2021-01-29T05:42:14
330,037,351
0
0
null
null
null
null
UTF-8
Java
false
false
2,226
java
package com.caucraft.commandbridge; import com.google.common.io.ByteArrayDataInput; import com.google.common.io.ByteStreams; import java.util.UUID; import java.util.logging.Level; import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.api.connection.Server; import net.md_5.bungee.api.event.PluginMessageEvent; import net.md_5.bungee.api.plugin.Listener; import net.md_5.bungee.api.plugin.Plugin; import net.md_5.bungee.event.EventHandler; /** * * @author caucow */ public class BungeePlugin extends Plugin implements Listener { public static final String CHANNEL = "cccmdcridge:cmd"; @Override public void onLoad() { getLogger().log(Level.INFO, "Plugin loaded"); } @Override public void onEnable() { getProxy().getPluginManager().registerListener(this, this); getProxy().registerChannel(CHANNEL); getLogger().log(Level.INFO, "Plugin enabled"); } @EventHandler public void onPluginMessage(PluginMessageEvent evt) { if (!CHANNEL.equals(evt.getTag())) { return; } evt.setCancelled(true); // The player shouldn't ever be sending transfer/sharding packets, // otherwise we're just giving them free item spawning and // teleport-anywhere backdoors. Also servers should only send messages // to players. Dunno how that could go wrong but okay. if (!(evt.getSender() instanceof Server) || !(evt.getReceiver() instanceof ProxiedPlayer)) { System.out.println("L"); return; } ByteArrayDataInput in = ByteStreams.newDataInput(evt.getData()); UUID id = UUID.fromString(in.readUTF()); String command = in.readUTF(); ProxiedPlayer p = getProxy().getPlayer(id); if (p == null || !p.isConnected()) { getLogger().log(Level.SEVERE, "Player not online with UUID: {0}", id); } else { getLogger().log(Level.INFO, "Running command ''{0}'' as player {1} with uuid {2}", new Object[]{command, p.getName(), id}); } getProxy().getPluginManager().dispatchCommand(p, command); } }
[ "caucow98@gmail.com" ]
caucow98@gmail.com
b34d3ae7edca50ec41663cbab7d924eee80946b4
e740e094a51bbf224f04cd748af6f5302463c3f4
/mima-api/src/main/java/edu/kit/mima/api/util/FileName.java
d1cde375aed6f8e40e3365306e1d7e912583ba4a
[ "MIT" ]
permissive
weisJ/Mima
b959d9106ffa33592b63e42810b71f5dcd81d71e
e735ed27591d76f46a6d70bc16b171bcbb4740df
refs/heads/master
2021-06-02T04:00:26.374991
2020-06-15T23:16:29
2020-06-15T23:16:29
135,634,905
12
0
MIT
2020-06-15T23:16:31
2018-05-31T21:00:32
Java
UTF-8
Java
false
false
7,247
java
package edu.kit.mima.api.util; import org.apache.commons.io.FileUtils; import org.apache.commons.io.FilenameUtils; import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; import java.io.File; import java.nio.file.InvalidPathException; import java.nio.file.Paths; /** * Utility class for manipulating file names. * * @author Jannis Weis * @since 2018 */ public final class FileName { private static final int MAX_FILE_DISPLAY_LENGTH = 45; @Contract(" -> fail") private FileName() { assert false : "utility class constructor"; } /** * Shortens fileName. See {@link #shorten(String, int) shorten(fileName, maxLength}. Uses {@link * #MAX_FILE_DISPLAY_LENGTH} as parameter. * * @param fileName Name to shorten * @return shortened String */ public static String shorten(final String fileName) { return shorten(fileName, MAX_FILE_DISPLAY_LENGTH); } /** * Shorten a fileName to the given length. Shortens by deleting directories in the middle and * replacing them by \...\ * * @param fileName Name to shorten * @param maxLength maximum length to shorten to. * @return shortened String */ public static String shorten(final String fileName, final int maxLength) { String name = fileName; final String[] split = name.split("\\\\"); int indexLow = split.length / 2; int indexHigh = indexLow + 1; while (name.length() > maxLength && indexHigh < split.length && indexLow > 0) { final StringBuilder sb = new StringBuilder(); for (int i = 0; i < indexLow; i++) { sb.append(split[i]).append('\\'); } sb.append("...\\"); for (int i = indexHigh; i < split.length; i++) { sb.append(split[i]); if (i != split.length - 1) { sb.append('\\'); } } name = sb.toString(); indexHigh++; indexLow--; } return name; } /** * Remove specified extensions from file. * * @param file file to remove extension from * @param blacklist extensions to remove * @return file without extension. */ @NotNull public static String removeExtension( @NotNull final File file, @NotNull final String[] blacklist) { final String name = file.getName(); for (final var s : blacklist) { if (FilenameUtils.isExtension(name, s)) { return FilenameUtils.removeExtension(name); } } return name; } /** * Escape all special characters in String. * * @param inputString input * @return input string with all special characters escaped */ @NotNull public static String escapeMetaCharacters(@NotNull final String inputString) { final String[] metaCharacters = { "\\", "^", "$", "{", "}", "[", "]", "(", ")", ".", "*", "+", "?", "|", "<", ">", "-", "&", "%" }; String input = inputString; for (final String metaCharacter : metaCharacters) { if (inputString.contains(metaCharacter)) { input = inputString.replace(metaCharacter, "\\" + metaCharacter); } } return input; } /** * Gets the base name, minus the full path and extension, from a full filename. * <p>This method will handle a file in either Unix or Windows format. * The text after the last forward or backslash and before the last dot is returned. * <pre> * a/b/c.txt --&gt; c * a.txt --&gt; a * a/b/c --&gt; c * a/b/c/ --&gt; "" * </pre> * <p>The output will be the same irrespective of the machine that the code is running on. * * @param filename the filename to query, null returns null * @return the name of the file without the path, or an empty string if none exists. Null bytes inside string * will be removed */ public static String getBaseName(final String filename) { return FilenameUtils.getBaseName(filename); } /** * Checks whether the extension of the filename is that specified. * <p>This method obtains the extension as the textual part of the filename * after the last dot. There must be no directory separator after the dot. * The extension check is case-sensitive on all platforms. * * @param filename the filename to query, null returns false * @param extension the extension to check for, null or empty checks for no extension * @return true if the filename has the specified extension * @throws java.lang.IllegalArgumentException if the supplied filename contains null bytes */ public static boolean isExtension(final String filename, final String extension) { return FilenameUtils.isExtension(filename, extension); } /** * Removes the extension from a filename. * <p>This method returns the textual part of the filename before the last dot. * There must be no directory separator after the dot. * <pre> * foo.txt --&gt; foo * a\b\c.jpg --&gt; a\b\c * a\b\c --&gt; a\b\c * a.b\c --&gt; a.b\c * </pre> * <p>The output will be the same irrespective of the machine that the code is running on. * * @param filename the filename to query, null returns null * @return the filename minus the extension */ public static String removeExtension(final String filename) { return FilenameUtils.removeExtension(filename); } /** * Gets the extension of a filename. * <p>This method returns the textual part of the filename after the last dot. * There must be no directory separator after the dot. * <pre> * foo.txt --&gt; "txt" * a/b/c.jpg --&gt; "jpg" * a/b.txt/c --&gt; "" * a/b/c --&gt; "" * </pre> * <p>The output will be the same irrespective of the machine that the code is running on. * * @param filename the filename to retrieve the extension of. * @return the extension of the file or an empty string if none exists or {@code null} * if the filename is {@code null}. */ public static String getExtension(final String filename) { return FilenameUtils.getExtension(filename); } /** * Check if the given path resembles a valid path on the machine. * * @param path the path to check. * @return true if valid. The path must not exist for this to evaluate to true but has to be valid. */ public static boolean isValidPath(final String path) { try { Paths.get(path); } catch (InvalidPathException e) { return false; } return true; } /** * Check if given name is a valid file/directory name on this machine. * * @param name name of file. * @return true if valid. */ public static boolean isValidFileName(final String name) { return isValidPath(FilenameUtils.concat(FileUtils.getUserDirectoryPath(), name)); } }
[ "weisj@arcor.de" ]
weisj@arcor.de
20c8682ac0d3760ebc8d4f7cd7e05a3ac00e30f5
61e9bd20688ac71a7643500eb0ac74190252de7d
/src/fundamentals/EXAMPLE16.java
cc96a6f548cafcc011b7ca0c02add77188d6c28a
[]
no_license
tejapavan0052/fundamentals
05a971d90cd2206fe018cedd359c5292916e95ca
1786359c5b17c5c060023f569457228b4f65043e
refs/heads/master
2021-07-16T10:27:30.735955
2020-07-25T04:03:56
2020-07-25T04:03:56
193,488,849
1
0
null
null
null
null
UTF-8
Java
false
false
506
java
package fundamentals; public class EXAMPLE16 { public static void main(String[] args) { int i, number, count; System.out.println(" Prime Numbers from 1 to 100 are : "); for(number = 10; number <=99; number++) { count = 0; for (i = 2; i <= number/2; i++) { if(number % i == 0) { count++; break; } } if(count == 0 && number != 1 ) { System.out.print(number + " "); } } } }
[ "mylaptop@DESKTOP-2QOB21C" ]
mylaptop@DESKTOP-2QOB21C
1fa5187e428a5b60915eb3961bb499c54aa58d21
918896902d74946e2d73e709d4cee93998774bd1
/library-api/src/main/java/br/com/libraryapi/api/dto/ReturnedLoanDTO.java
d2a429a1c0302915efc3ee529496512e47ddbd1b
[]
no_license
biancalr/library-api
537e8ba13f3fed959d7f7ca6a1062314b4009bae
b9d4a46f1e9cd4c69e87ed850e1144ef515191c5
refs/heads/main
2023-03-05T11:44:25.586080
2021-02-24T21:07:20
2021-02-24T21:07:20
342,026,172
0
0
null
null
null
null
UTF-8
Java
false
false
280
java
package br.com.libraryapi.api.dto; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; @Builder @Data @AllArgsConstructor @NoArgsConstructor public class ReturnedLoanDTO { private Boolean returned; }
[ "33333728+biancalr@users.noreply.github.com" ]
33333728+biancalr@users.noreply.github.com
5613f045be1e10fdac949f360c56e0d4ff38aff6
1495529d5d9b49166bb2ca6508c4f1b6723dbb34
/ws/p7-webservice-app-business/src/main/java/com/berthoud/p7/webserviceapp/business/exceptions/ServiceStatus.java
cc26bdfd91db337aabc495c3b9aaf47b0e348ee1
[]
no_license
JulienDeBerlin/p10
154e4c72acc71d27ca8c155e4f19ad6572bedd8c
334c10165bd5fc8c0c6fadf3f8b0b39c162a6b5a
refs/heads/master
2022-09-23T11:16:15.433552
2019-09-10T15:14:19
2019-09-10T15:14:19
201,416,383
0
0
null
null
null
null
UTF-8
Java
false
false
887
java
package com.berthoud.p7.webserviceapp.business.exceptions; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "serviceStatus", propOrder = { "code", "description" }) public class ServiceStatus { private String code; private String description; public ServiceStatus() { } public ServiceStatus(String code, String description) { this.code = code; this.description = description; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } }
[ "julien_berthoud@yahoo.fr" ]
julien_berthoud@yahoo.fr
61c28e159e62c524b3d075110fee8a66a01f5499
0bd87ff0f54be5a92cd197b921e528f3e419f530
/16.1 BST/Solution.java
c67c246630fda5e77bf7c68a7abecd8642947eb9
[]
no_license
ramidisowmya595/Ads-1
e9a08fa13c642956cb9c7abe95c650df3f9897a7
a297b7f961252edd388115f25966485b59987630
refs/heads/master
2021-10-28T19:24:43.068092
2019-04-24T15:10:13
2019-04-24T15:10:13
151,047,278
0
0
null
null
null
null
UTF-8
Java
false
false
2,353
java
import java.util.Scanner; class Book { String name; String author; Double price; Book(String n,String a,Double p) { this.name = n; this.author = a; this.price = p; } String getname() { return this.name; } String getauthor() { return this.author; } Double getprice() { return this.price; } int compareTo(Book current) { if(this.name.compareTo(current.name) > 0) { return 1; } else if(this.name.compareTo(current.name)<0) { return -1; } else { return 0; } } } class BinarySearchTree { Node root=null; class Node { Book key; Integer value; Node left; Node right; Node(Book key,Integer value) { this.key=key; this.value=value; } } public boolean isEmpty() { return root == null; } public void put(Book key, Integer value) { root = put(root, key, value); } private Node put(Node x, Book key, Integer val) { if (x == null) return new Node(key, val); int cmp = key.compareTo(x.key); if (cmp < 0) { x.left = put(x.left, key, val); } else if (cmp > 0) { x.right = put(x.right, key, val); } else { x.value = val; } return x; } public Integer get(Book key) { return get(root, key); } private Integer get(Node x, Book key) { if(x == null) return null; int cmp = key.compareTo(x.key); if(cmp < 0) return get(x.left, key); else if(cmp > 0) return get(x.right, key); else if(cmp == 0) return x.value; return null; } } class Solution { public static void main(String args[]) { Scanner sc=new Scanner(System.in); BinarySearchTree bt=new BinarySearchTree(); while(sc.hasNext()) { String i=sc.nextLine(); String input[]=i.split(","); Book k=new Book(input[1],input[2],Double.parseDouble(input[3])); switch(input[0]) { case "put": bt.put( k,Integer.parseInt(input[4])); break; case "get": System.out.println(bt.get(k)); break; } } } }
[ "ramidisowmya595@gmail.com" ]
ramidisowmya595@gmail.com
d39b6bf91799a59a9945f1dc214c7341c1a386c2
73267be654cd1fd76cf2cb9ea3a75630d9f58a41
/services/dataartsstudio/src/main/java/com/huaweicloud/sdk/dataartsstudio/v1/model/ShowConsistencyTaskDetailRequest.java
5ad17932d8318a18be4be41108edc495516d4ac5
[ "Apache-2.0" ]
permissive
huaweicloud/huaweicloud-sdk-java-v3
51b32a451fac321a0affe2176663fed8a9cd8042
2f8543d0d037b35c2664298ba39a89cc9d8ed9a3
refs/heads/master
2023-08-29T06:50:15.642693
2023-08-24T08:34:48
2023-08-24T08:34:48
262,207,545
91
57
NOASSERTION
2023-09-08T12:24:55
2020-05-08T02:27:00
Java
UTF-8
Java
false
false
2,336
java
package com.huaweicloud.sdk.dataartsstudio.v1.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Objects; /** * Request Object */ public class ShowConsistencyTaskDetailRequest { @JsonInclude(JsonInclude.Include.NON_NULL) @JsonProperty(value = "id") private String id; @JsonInclude(JsonInclude.Include.NON_NULL) @JsonProperty(value = "workspace") private String workspace; public ShowConsistencyTaskDetailRequest withId(String id) { this.id = id; return this; } /** * 对账作业ID * @return id */ public String getId() { return id; } public void setId(String id) { this.id = id; } public ShowConsistencyTaskDetailRequest withWorkspace(String workspace) { this.workspace = workspace; return this; } /** * workspace 信息 * @return workspace */ public String getWorkspace() { return workspace; } public void setWorkspace(String workspace) { this.workspace = workspace; } @Override public boolean equals(java.lang.Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } ShowConsistencyTaskDetailRequest that = (ShowConsistencyTaskDetailRequest) obj; return Objects.equals(this.id, that.id) && Objects.equals(this.workspace, that.workspace); } @Override public int hashCode() { return Objects.hash(id, workspace); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ShowConsistencyTaskDetailRequest {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" workspace: ").append(toIndentedString(workspace)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
[ "hwcloudsdk@huawei.com" ]
hwcloudsdk@huawei.com
10124bf7089d2ace1467c6e721de48b700159daf
b743bd285fffdccdd5558bb0ae266ea5bc824fd7
/Lec_38/Client_Q.java
99a67cdcf652bd3d033ef758c351ab1bd3d8f349
[]
no_license
devsumanprasad/Nagarro
f6f91d2ef3ff62deb5f5ac037e25665fc5a71d1a
5136cab32fae59276b9d7c75c5ed7346a7107262
refs/heads/main
2023-08-29T09:06:24.642882
2021-10-22T17:49:45
2021-10-22T17:49:45
357,958,762
1
0
null
2021-04-14T20:34:58
2021-04-14T15:44:51
Java
UTF-8
Java
false
false
624
java
package Lec_38; public class Client_Q { public static void main(String[] args) throws Exception { Queue Q = new Queue(); Q.EnQueue(10); Q.EnQueue(20); Q.EnQueue(30); Q.EnQueue(40); Q.EnQueue(50); Q.disp(); Q.DeQueue(); Q.disp(); Q.DeQueue(); Q.disp(); Q.DeQueue(); Q.disp(); Q.DeQueue(); Q.disp(); Q.EnQueue(60); Q.disp(); Q.EnQueue(70); Q.disp(); Q.EnQueue(80); Q.disp(); Q.EnQueue(90); Q.disp(); // Q.EnQueue(90); // Q.disp(); // Q.EnQueue(90); // Q.disp(); // Q.EnQueue(90); // Q.disp(); // Q.EnQueue(90); // Q.disp(); } }
[ "noreply@github.com" ]
devsumanprasad.noreply@github.com
70980683ecb240513d8ea8b7660b880f557dda3c
d38b9bd1125046be7000298b7403a9baa60dbe5b
/initializr-generator-spring/src/test/java/io/spring/initializr/generator/spring/code/kotlin/GroovyDslKotlinGradleBuildCustomizerTests.java
b1b8ff0ef0ea6d7a847fe5c441eb428e47f5d734
[ "Apache-2.0" ]
permissive
FanJups/initializr
12b9f4e1de198f883f80b4e632657b9af915a85f
372e823d21396de145bb5bd889463361c4846d95
refs/heads/master
2020-05-24T22:03:06.714249
2019-05-17T16:45:40
2019-05-17T16:45:40
187,489,881
1
0
Apache-2.0
2019-05-19T14:50:40
2019-05-19T14:50:39
null
UTF-8
Java
false
false
2,872
java
/* * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.spring.initializr.generator.spring.code.kotlin; import io.spring.initializr.generator.buildsystem.gradle.GradleBuild; import io.spring.initializr.generator.buildsystem.gradle.GradleBuild.TaskCustomization; import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; /** * Tests for {@link GroovyDslKotlinGradleBuildCustomizer}. * * @author Andy Wilkinson * @author Jean-Baptiste Nizet */ class GroovyDslKotlinGradleBuildCustomizerTests { @Test void kotlinPluginsAreConfigured() { GradleBuild build = new GradleBuild(); new GroovyDslKotlinGradleBuildCustomizer( new SimpleKotlinProjectSettings("1.2.70")).customize(build); assertThat(build.getPlugins()).hasSize(2); assertThat(build.getPlugins().get(0).getId()) .isEqualTo("org.jetbrains.kotlin.jvm"); assertThat(build.getPlugins().get(0).getVersion()).isEqualTo("1.2.70"); assertThat(build.getPlugins().get(1).getId()) .isEqualTo("org.jetbrains.kotlin.plugin.spring"); assertThat(build.getPlugins().get(1).getVersion()).isEqualTo("1.2.70"); } @Test void kotlinCompilationTasksAreCustomized() { GradleBuild build = new GradleBuild(); new GroovyDslKotlinGradleBuildCustomizer( new SimpleKotlinProjectSettings("1.2.70")).customize(build); assertThat(build.getImportedTypes()) .contains("org.jetbrains.kotlin.gradle.tasks.KotlinCompile"); assertThat(build.getTasksWithTypeCustomizations()).hasSize(1); assertThat(build.getTasksWithTypeCustomizations()).containsKeys("KotlinCompile"); assertKotlinOptions(build.getTasksWithTypeCustomizations().get("KotlinCompile")); } private void assertKotlinOptions(TaskCustomization compileTask) { assertThat(compileTask.getAssignments()).isEmpty(); assertThat(compileTask.getInvocations()).isEmpty(); assertThat(compileTask.getNested()).hasSize(1); TaskCustomization kotlinOptions = compileTask.getNested().get("kotlinOptions"); assertThat(kotlinOptions.getInvocations()).hasSize(0); assertThat(kotlinOptions.getNested()).hasSize(0); assertThat(kotlinOptions.getAssignments()).hasSize(2); assertThat(kotlinOptions.getAssignments()) .containsEntry("freeCompilerArgs", "['-Xjsr305=strict']") .containsEntry("jvmTarget", "'1.8'"); } }
[ "snicoll@pivotal.io" ]
snicoll@pivotal.io
6d18ec313cfebee36d815295bc0b566c7ebad761
41af320a7766db20f0ec29a2e04acd8dbe6aa105
/app/src/main/java/com/hekatomsoft/androidcor/zoomphotoview/src/main/java/com/github/chrisbanes/photoview/Compat.java
cf49664bd79f73e37e6616bb495265167d77ecdf
[]
no_license
mohammadrezaabiri1991/ModelAgency
c864c98cf0fb74e2fdcb113c719c666da3436175
d197af9a332854117a8387bc512d53412ddea40b
refs/heads/master
2022-12-26T15:27:54.393529
2020-09-29T13:39:45
2020-09-29T13:39:45
299,628,704
0
0
null
null
null
null
UTF-8
Java
false
false
1,309
java
/* Copyright 2011, 2012 Chris Banes. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package com.hekatomsoft.androidcor.zoomphotoview.src.main.java.com.github.chrisbanes.photoview; import android.annotation.TargetApi; import android.os.Build.VERSION; import android.os.Build.VERSION_CODES; import android.view.View; class Compat { private static final int SIXTY_FPS_INTERVAL = 1000 / 60; public static void postOnAnimation(View view, Runnable runnable) { if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) { postOnAnimationJellyBean(view, runnable); } else { view.postDelayed(runnable, SIXTY_FPS_INTERVAL); } } @TargetApi(16) private static void postOnAnimationJellyBean(View view, Runnable runnable) { view.postOnAnimation(runnable); } }
[ "mohammadreza.abiri.1991@gmail.com" ]
mohammadreza.abiri.1991@gmail.com
d5d0fbc0369e8beb7477e944629472943bc42696
c386aaa3a3d5bd366a1a46477047c78a04626ba3
/app/src/main/java/com/refridginator/app/api/RecipeItem.java
5acb107f74bfe29bd6baccfb2e238c0ec5a0a74a
[]
no_license
Ruby-Jiang/Refridginator
2e03f18420d3e5d4e91268f1661ba904dcd1973c
09e81ff6db31ee3ea1c56ef189ae4b3d43f17198
refs/heads/master
2023-01-23T21:39:33.186119
2020-12-06T16:13:51
2020-12-06T16:13:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
482
java
package com.refridginator.app.api; public class RecipeItem { private String mImageUrl; private String mTitle; private String mURL; public RecipeItem (String imageUrl, String title, String url){ mImageUrl = imageUrl; mTitle = title; mURL = url; } public String getImageUrl() { return mImageUrl; } public String getTitle() { return mTitle; } public String getURL() { return mURL; } }
[ "Stacy.Wandrey@ucdconnect.ie" ]
Stacy.Wandrey@ucdconnect.ie
e4f0b9fe001284f584c1f687286bcb8b06a7fed5
dc3b918d1249bdb2efbf00412a83712e92c9a4aa
/src/cms/appointments/Dlg_appointments.java
6586b48d1f47d81da227efa0f8f0ab8d241bfda8
[]
no_license
yespickmeup/clinic_management
f11067d9ab4453828f511d8d3e3a8da86c6e675a
c5275fdd83bba68e5d6d2c11d60292eec9f521df
refs/heads/master
2021-01-15T22:20:10.218253
2017-11-27T08:20:07
2017-11-27T08:20:07
99,899,214
0
0
null
null
null
null
UTF-8
Java
false
false
48,003
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 cms.appointments; import cms.doctors.Dlg_doctors; import cms.doctors.Doctors; import cms.patients.Dlg_patients; import cms.patients.Patients; import cms.users.MyUser; import cms.util.Alert; import cms.util.DateType; import cms.util.Dlg_confirm_action; import cms.util.Dlg_confirm_delete; import cms.util.TableRenderer; import com.jgoodies.binding.adapter.AbstractTableAdapter; import com.jgoodies.binding.list.ArrayListModel; import java.awt.Color; import java.awt.Component; import java.awt.Dimension; import java.awt.Toolkit; import java.awt.Window; import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.logging.Level; import javax.swing.JLabel; import javax.swing.JTable; import javax.swing.ListModel; import javax.swing.ListSelectionModel; import javax.swing.table.DefaultTableCellRenderer; import mijzcx.synapse.desk.utils.CloseDialog; import mijzcx.synapse.desk.utils.FitIn; import mijzcx.synapse.desk.utils.KeyMapping; import mijzcx.synapse.desk.utils.KeyMapping.KeyAction; import mijzcx.synapse.desk.utils.TableWidthUtilities; import synsoftech.fields.Button; import synsoftech.fields.Field; import synsoftech.util.ImageRenderer; /** * * @author RAZOR Defianz */ public class Dlg_appointments extends javax.swing.JDialog { /** * Creates new form Dlg_doctor_appointments */ //<editor-fold defaultstate="collapsed" desc=" callback "> private Callback callback; public void setCallback(Callback callback) { this.callback = callback; } public static interface Callback { void ok(CloseDialog closeDialog, OutputData data); } public static class InputData { } public static class OutputData { } //</editor-fold> //<editor-fold defaultstate="collapsed" desc=" Constructors "> private Dlg_appointments(java.awt.Frame parent, boolean modal) { super(parent, modal); setUndecorated(true); initComponents(); myInit(); } private Dlg_appointments(java.awt.Dialog parent, boolean modal) { super(parent, modal); setUndecorated(true); initComponents(); myInit(); } public Dlg_appointments() { super(); setUndecorated(true); initComponents(); myInit(); } private Dlg_appointments myRef; private void setThisRef(Dlg_appointments myRef) { this.myRef = myRef; } private static java.util.Map<Object, Dlg_appointments> dialogContainer = new java.util.HashMap(); public static void clearUpFirst(java.awt.Window parent) { if (dialogContainer.containsKey(parent)) { dialogContainer.remove(parent); } } public static Dlg_appointments create(java.awt.Window parent, boolean modal) { if (modal) { return create(parent, ModalityType.APPLICATION_MODAL); } return create(parent, ModalityType.MODELESS); } public static Dlg_appointments create(java.awt.Window parent, java.awt.Dialog.ModalityType modalType) { if (parent instanceof java.awt.Frame) { Dlg_appointments dialog = dialogContainer.get(parent); if (dialog == null) { dialog = new Dlg_appointments((java.awt.Frame) parent, false); dialog.setModalityType(modalType); dialogContainer.put(parent, dialog); java.util.logging.Logger.getAnonymousLogger().log(Level.INFO, "instances: {0}", dialogContainer.size()); dialog.setThisRef(dialog); return dialog; } else { dialog.setModalityType(modalType); return dialog; } } if (parent instanceof java.awt.Dialog) { Dlg_appointments dialog = dialogContainer.get(parent); if (dialog == null) { dialog = new Dlg_appointments((java.awt.Dialog) parent, false); dialog.setModalityType(modalType); dialogContainer.put(parent, dialog); java.util.logging.Logger.getAnonymousLogger().log(Level.INFO, "instances: {0}", dialogContainer.size()); dialog.setThisRef(dialog); return dialog; } else { dialog.setModalityType(modalType); return dialog; } } return null; } //</editor-fold> //<editor-fold defaultstate="collapsed" desc=" main "> public static void main(String args[]) { try { javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { throw new RuntimeException(e); } Dlg_appointments dialog = Dlg_appointments.create(new javax.swing.JFrame(), true); Toolkit tk = Toolkit.getDefaultToolkit(); int xSize = ((int) tk.getScreenSize(). getWidth()); int ySize = ((int) tk.getScreenSize(). getHeight()); dialog.setSize(xSize, ySize); dialog.setVisible(true); } //</editor-fold> //<editor-fold defaultstate="collapsed" desc=" added "> @Override public void setVisible(boolean visible) { super.setVisible(visible); if (visible == true) { getContentPane().removeAll(); initComponents(); myInit(); repaint(); } } public javax.swing.JPanel getSurface() { return (javax.swing.JPanel) getContentPane(); } public void nullify() { myRef.setVisible(false); myRef = null; } //</editor-fold> /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanel1 = new javax.swing.JPanel(); jTabbedPane1 = new javax.swing.JTabbedPane(); jPanel2 = new javax.swing.JPanel(); jPanel4 = new javax.swing.JPanel(); jLabel28 = new javax.swing.JLabel(); jTextField24 = new Field.Combo(); jButton5 = new Button.Default(); jLabel25 = new javax.swing.JLabel(); jDateChooser1 = new com.toedter.calendar.JDateChooser(); jLabel22 = new javax.swing.JLabel(); jTextField19 = new Field.Search(); jLabel6 = new javax.swing.JLabel(); jTextField4 = new Field.Input(); jLabel8 = new javax.swing.JLabel(); jTextField6 = new Field.Input(); jLabel7 = new javax.swing.JLabel(); jTextField5 = new Field.Input(); jTextField7 = new Field.Combo(); jLabel9 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); jLabel10 = new javax.swing.JLabel(); jTextField3 = new Field.Input(); jTextField8 = new Field.Combo(); jTextField9 = new Field.Input(); jLabel11 = new javax.swing.JLabel(); jButton6 = new Button.Default(); jLabel4 = new javax.swing.JLabel(); jTextField2 = new Field.Input(); jPanel6 = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); tbl_degrees = new javax.swing.JTable(); jPanel3 = new javax.swing.JPanel(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); jPanel1.setBackground(new java.awt.Color(255, 255, 255)); jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 204))); jTabbedPane1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jPanel2.setBackground(new java.awt.Color(255, 255, 255)); jPanel4.setBackground(new java.awt.Color(255, 255, 255)); jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Details", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 14))); // NOI18N jLabel28.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jLabel28.setText("Doctor:"); jTextField24.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jTextField24.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jTextField24MouseClicked(evt); } }); jTextField24.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField24ActionPerformed(evt); } }); jButton5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cms/icons/add.png"))); // NOI18N jButton5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton5ActionPerformed(evt); } }); jLabel25.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jLabel25.setText("Date:"); jDateChooser1.setDate(new Date()); jDateChooser1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jLabel22.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jLabel22.setText("Patient:"); jTextField19.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jTextField19.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jTextField19MouseClicked(evt); } }); jTextField19.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField19ActionPerformed(evt); } }); jLabel6.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jLabel6.setText("First Name:"); jTextField4.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jTextField4.setFocusable(false); jTextField4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField4ActionPerformed(evt); } }); jLabel8.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jLabel8.setText("Birth Date:"); jTextField6.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jTextField6.setFocusable(false); jTextField6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField6ActionPerformed(evt); } }); jLabel7.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jLabel7.setText("Middle Name:"); jTextField5.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jTextField5.setFocusable(false); jTextField7.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jTextField7.setFocusable(false); jLabel9.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jLabel9.setText("Gender:"); jLabel5.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jLabel5.setText("Last Name:"); jLabel10.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jLabel10.setText("Blood Type:"); jTextField3.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jTextField3.setFocusable(false); jTextField8.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jTextField8.setFocusable(false); jTextField9.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jTextField9.setFocusable(false); jTextField9.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField9ActionPerformed(evt); } }); jLabel11.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jLabel11.setText("Suffix Name:"); jButton6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cms/icons/add.png"))); // NOI18N jButton6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton6ActionPerformed(evt); } }); jLabel4.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jLabel4.setText("Clinic:"); jTextField2.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jTextField2.setFocusable(false); jTextField2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField2ActionPerformed(evt); } }); javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout.setHorizontalGroup( jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabel28, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel25, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel22, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel5, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 79, Short.MAX_VALUE) .addComponent(jLabel6, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() .addComponent(jTextField19) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel4Layout.createSequentialGroup() .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jTextField4) .addComponent(jTextField3)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jTextField5)) .addGroup(jPanel4Layout.createSequentialGroup() .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jTextField9)))) .addGroup(jPanel4Layout.createSequentialGroup() .addComponent(jTextField6, javax.swing.GroupLayout.DEFAULT_SIZE, 129, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel9) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel10) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jTextField8, javax.swing.GroupLayout.DEFAULT_SIZE, 78, Short.MAX_VALUE)) .addGroup(jPanel4Layout.createSequentialGroup() .addComponent(jTextField24) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(10, 10, 10)) .addGroup(jPanel4Layout.createSequentialGroup() .addComponent(jDateChooser1, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(jPanel4Layout.createSequentialGroup() .addComponent(jTextField2) .addContainerGap()))) ); jPanel4Layout.setVerticalGroup( jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel28, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField24, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(1, 1, 1) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel25, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jDateChooser1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel22, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField19, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(1, 1, 1) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(1, 1, 1) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(1, 1, 1) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))) .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(1, 1, 1) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(176, Short.MAX_VALUE)) ); jPanel6.setBackground(new java.awt.Color(255, 255, 255)); jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Time", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 14))); // NOI18N tbl_degrees.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {}, {}, {}, {} }, new String [] { } )); tbl_degrees.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { tbl_degreesMouseClicked(evt); } }); jScrollPane1.setViewportView(tbl_degrees); javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6); jPanel6.setLayout(jPanel6Layout); jPanel6Layout.setHorizontalGroup( jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); jPanel6Layout.setVerticalGroup( jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 370, Short.MAX_VALUE) .addContainerGap()) ); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel4, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jTabbedPane1.addTab("Appointments", jPanel2); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 761, Short.MAX_VALUE) ); jPanel3Layout.setVerticalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 440, Short.MAX_VALUE) ); jTabbedPane1.addTab("Reports", jPanel3); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 766, Short.MAX_VALUE) .addContainerGap()) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addComponent(jTabbedPane1) .addContainerGap()) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents private void jTextField24MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextField24MouseClicked init_doctors(); }//GEN-LAST:event_jTextField24MouseClicked private void jTextField24ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField24ActionPerformed init_doctors(); }//GEN-LAST:event_jTextField24ActionPerformed private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed dlg_doctors(); }//GEN-LAST:event_jButton5ActionPerformed private void jTextField19MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextField19MouseClicked init_patients(); }//GEN-LAST:event_jTextField19MouseClicked private void jTextField19ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField19ActionPerformed init_patients(); }//GEN-LAST:event_jTextField19ActionPerformed private void jTextField4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField4ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jTextField4ActionPerformed private void jTextField6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField6ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jTextField6ActionPerformed private void jTextField9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField9ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jTextField9ActionPerformed private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed dlg_patient(); }//GEN-LAST:event_jButton6ActionPerformed private void jTextField2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField2ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jTextField2ActionPerformed private void tbl_degreesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tbl_degreesMouseClicked new_appointment(); }//GEN-LAST:event_tbl_degreesMouseClicked /** * @param args the command line arguments */ // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButton5; private javax.swing.JButton jButton6; private com.toedter.calendar.JDateChooser jDateChooser1; private javax.swing.JLabel jLabel10; private javax.swing.JLabel jLabel11; private javax.swing.JLabel jLabel22; private javax.swing.JLabel jLabel25; private javax.swing.JLabel jLabel28; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JLabel jLabel9; private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel2; private javax.swing.JPanel jPanel3; private javax.swing.JPanel jPanel4; private javax.swing.JPanel jPanel6; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTabbedPane jTabbedPane1; private javax.swing.JTextField jTextField19; private javax.swing.JTextField jTextField2; private javax.swing.JTextField jTextField24; private javax.swing.JTextField jTextField3; private javax.swing.JTextField jTextField4; private javax.swing.JTextField jTextField5; private javax.swing.JTextField jTextField6; private javax.swing.JTextField jTextField7; private javax.swing.JTextField jTextField8; private javax.swing.JTextField jTextField9; private javax.swing.JTable tbl_degrees; // End of variables declaration//GEN-END:variables private void myInit() { init_key(); init_tbl_degrees(tbl_degrees); init_date_schedule(); } public void do_pass() { } // <editor-fold defaultstate="collapsed" desc="Key"> private void disposed() { this.dispose(); } private void init_key() { KeyMapping.mapKeyWIFW(getSurface(), KeyEvent.VK_ESCAPE, new KeyAction() { @Override public void actionPerformed(ActionEvent e) { // btn_0.doClick(); disposed(); } }); } // </editor-fold> List<Doctors.to_doctors> doctor_list = new ArrayList(); private void init_doctors() { String search = jTextField24.getText(); doctor_list.clear(); String where = " where concat(lname,space(1),fname) like '%" + search + "%' " + " or concat(fname,space(1),lname) like '%" + search + "%' " + " order by lname asc "; doctor_list = Doctors.ret_data(where); Object[][] obj = new Object[doctor_list.size()][1]; int i = 0; for (Doctors.to_doctors to : doctor_list) { obj[i][0] = " " + to.designation + " " + to.fname + ", " + to.mi + " " + to.lname; i++; } JLabel[] labels = {}; int[] tbl_widths_customers = {jTextField24.getWidth()}; String[] col_names = {"NAME"}; TableRenderer tr = new TableRenderer(); TableRenderer.setPopup(jTextField24, obj, labels, tbl_widths_customers, col_names); tr.setCallback(new TableRenderer.Callback() { @Override public void ok(TableRenderer.OutputData data) { Doctors.to_doctors to = doctor_list.get(data.selected_row); Field.Combo doc = (Field.Combo) jTextField24; doc.setText(to.designation + " " + to.fname + " " + to.mi + " " + to.lname); doc.setId("" + to.id); ret_time_schedules(); } }); } private void dlg_doctors() { Window p = (Window) this; Dlg_doctors nd = Dlg_doctors.create(p, true); nd.setTitle(""); nd.setCallback(new Dlg_doctors.Callback() { @Override public void ok(CloseDialog closeDialog, Dlg_doctors.OutputData data) { closeDialog.ok(); } }); nd.setLocationRelativeTo(this); nd.setVisible(true); } List<Patients.to_patients> patient_list = new ArrayList(); private void init_patients() { String search = jTextField19.getText(); patient_list.clear(); String where = " where concat(lname,space(1),fname) like '%" + search + "%' " + " or concat(fname,space(1),lname) like '%" + search + "%' " + " order by lname asc "; patient_list = Patients.ret_data(where); Object[][] obj = new Object[patient_list.size()][1]; int i = 0; for (Patients.to_patients to : patient_list) { obj[i][0] = " " + to.lname + ", " + to.fname + " " + to.mi; i++; } JLabel[] labels = {}; int[] tbl_widths_customers = {jTextField19.getWidth()}; String[] col_names = {"NAME"}; TableRenderer tr = new TableRenderer(); TableRenderer.setPopup(jTextField19, obj, labels, tbl_widths_customers, col_names); tr.setCallback(new TableRenderer.Callback() { @Override public void ok(TableRenderer.OutputData data) { Patients.to_patients to = patient_list.get(data.selected_row); Field.Input cl = (Field.Input) jTextField2; Field.Input pa = (Field.Input) jTextField4; cl.setText(to.clinic); cl.setId(to.clinic_id); pa.setText(to.fname); pa.setId("" + to.id); jTextField5.setText(to.mi); jTextField3.setText(to.lname); jTextField6.setText(DateType.convert_slash_datetime2(to.bday)); if (to.gender == 0) { jTextField7.setText("Female"); } else { jTextField7.setText("Male"); } jTextField8.setText(to.blood_type); } }); } private void dlg_patient() { Window p = (Window) this; Dlg_patients nd = Dlg_patients.create(p, true); nd.setTitle(""); nd.setCallback(new Dlg_patients.Callback() { @Override public void ok(CloseDialog closeDialog, Dlg_patients.OutputData data) { closeDialog.ok(); } }); nd.setLocationRelativeTo(this); nd.setVisible(true); } //<editor-fold defaultstate="collapsed" desc=" degrees "> public static ArrayListModel tbl_degrees_ALM; public static TbldegreesModel tbl_degrees_M; public static void init_tbl_degrees(JTable tbl_degrees) { tbl_degrees_ALM = new ArrayListModel(); tbl_degrees_M = new TbldegreesModel(tbl_degrees_ALM); tbl_degrees.setModel(tbl_degrees_M); tbl_degrees.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION); tbl_degrees.setRowHeight(25); int[] tbl_widths_degrees = {100, 0, 30}; for (int i = 0, n = tbl_widths_degrees.length; i < n; i++) { if (i == 0) { continue; } TableWidthUtilities.setColumnWidth(tbl_degrees, i, tbl_widths_degrees[i]); } Dimension d = tbl_degrees.getTableHeader().getPreferredSize(); d.height = 0; tbl_degrees.getTableHeader().setPreferredSize(d); tbl_degrees.getTableHeader().setFont(new java.awt.Font("Arial", 0, 12)); tbl_degrees.setRowHeight(25); tbl_degrees.setFont(new java.awt.Font("Arial", 0, 12)); tbl_degrees.getColumnModel().getColumn(0).setCellRenderer(new CustomRenderer()); tbl_degrees.getColumnModel().getColumn(2).setCellRenderer(new ImageRenderer()); } static class CustomRenderer extends DefaultTableCellRenderer { public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { Component cellComponent = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); int status = FitIn.toInt(table.getModel().getValueAt(row, 1).toString()); if (status == 1) { cellComponent.setBackground(new Color(23, 140, 203)); } else { cellComponent.setBackground(Color.WHITE); cellComponent.setForeground(Color.BLACK); } return cellComponent; } } public static void loadData_degrees(List<time_schedule> acc) { tbl_degrees_ALM.clear(); tbl_degrees_ALM.addAll(acc); } public static class TbldegreesModel extends AbstractTableAdapter { public static String[] COLUMNS = { "Time", "", "" }; public TbldegreesModel(ListModel listmodel) { super(listmodel, COLUMNS); } @Override public boolean isCellEditable(int row, int column) { if (column == 100) { return true; } return false; } @Override public Class getColumnClass(int col) { if (col == 1000) { return Boolean.class; } return Object.class; } @Override public Object getValueAt(int row, int col) { time_schedule tt = (time_schedule) getRow(row); switch (col) { case 0: return " " + tt.time; case 1: return tt.status; default: return "/cms/icons/remove11.png"; } } } private void ret_time_schedules() { String slot = "07:00am,07:30am,08:00am,08:30am,09:00am,09:30am,10:00am,10:30am,11:00am,11:30am,12:00pm,12:30pm,01:00pm,01:30pm,02:00pm,02:30pm,03:00pm,03:30pm,04:00pm,04:30pm,05:00pm,05:30pm,06:00pm,06:30pm,07:00pm,07:30pm"; String time_slots = System.getProperty("time_slots", slot); String[] time_slot = time_slots.split(","); List<time_schedule> datas = new ArrayList(); Field.Combo doc = (Field.Combo) jTextField24; String date = DateType.sf.format(jDateChooser1.getDate()); String where = " where doctor_id='" + doc.getId() + "' and appointment_date='" + date + "' "; List<Appointments.to_appointments> appointments = Appointments.ret_data(where); for (String s : time_slot) { int id = 0; String time = s; int status = 0; for (Appointments.to_appointments to : appointments) { if (to.appointment_time.equals(s)) { id = to.id; status = 1; } } time_schedule time1 = new time_schedule(id, time, status); datas.add(time1); } // tbl_degrees_M.fireTableDataChanged(); loadData_degrees(datas); } private void new_appointment() { int row = tbl_degrees.getSelectedRow(); if (row < 0) { return; } time_schedule to = (time_schedule) tbl_degrees_ALM.get(row); if (to.status == 0) { Field.Input cl = (Field.Input) jTextField2; Field.Combo doc = (Field.Combo) jTextField24; Field.Input pa = (Field.Input) jTextField4; if (doc.getId() == null || doc.getId().isEmpty()) { Alert.set(0, "Select doctor!"); jTextField24.grabFocus(); return; } if (pa.getId() == null || pa.getId().isEmpty()) { Alert.set(0, "Select patient!"); jTextField4.grabFocus(); return; } Window p = (Window) this; Dlg_confirm_action nd = Dlg_confirm_action.create(p, true); nd.setTitle(""); nd.do_pass("Proceed adding appointment!"); nd.setCallback(new Dlg_confirm_action.Callback() { @Override public void ok(CloseDialog closeDialog, Dlg_confirm_action.OutputData data) { closeDialog.ok(); int id = 0; String clinic = cl.getText(); String clinic_id = cl.getId(); String doctor = doc.getText(); String doctor_id = doc.getId(); String patient_id = pa.getId(); String patient_fname = pa.getText(); String patient_mi = jTextField5.getText(); String patient_lname = jTextField3.getText(); String patient_sname = jTextField9.getText(); String patient_bday = DateType.convert_slash_datetime_sf(jTextField6.getText()); String patient_gender = jTextField7.getText(); String patient_blood_type = jTextField8.getText(); String appointment_date = DateType.sf.format(jDateChooser1.getDate()); String appointment_time = to.time; String created_by = MyUser.getUser_id(); String updated_by = MyUser.getUser_id(); String created_at = DateType.now(); String updated_at = DateType.now(); int status = 0; int is_uploaded = 0; Appointments.to_appointments appoint = new Appointments.to_appointments(id, clinic, clinic_id, doctor, doctor_id, patient_id, patient_fname, patient_mi, patient_lname, patient_sname, patient_bday, patient_gender, patient_blood_type, appointment_date, appointment_time, created_by, updated_by, created_at, updated_at, status, is_uploaded); Appointments.add_data(appoint); ret_time_schedules(); Alert.set(1, ""); } } ); nd.setLocationRelativeTo( this); nd.setVisible( true); } if (to.status == 1) { int col = tbl_degrees.getSelectedColumn(); if (col == 2) { Window p = (Window) this; Dlg_confirm_delete nd = Dlg_confirm_delete.create(p, true); nd.setTitle(""); nd.setCallback(new Dlg_confirm_delete.Callback() { @Override public void ok(CloseDialog closeDialog, Dlg_confirm_delete.OutputData data) { closeDialog.ok(); Appointments.delete_data(to.id); ret_time_schedules(); Alert.set(3, ""); } }); nd.setLocationRelativeTo(this); nd.setVisible(true); } if (col == 0) { String where=" where id = '"+to.id+"' "; List<Appointments.to_appointments> datas=Appointments.ret_data(where); Appointments.to_appointments app=(Appointments.to_appointments) datas.get(0); Window p = (Window) this; Dlg_appointment_details nd = Dlg_appointment_details.create(p, true); nd.setTitle(""); nd.do_pass(app); nd.setCallback(new Dlg_appointment_details.Callback() { @Override public void ok(CloseDialog closeDialog, Dlg_appointment_details.OutputData data) { closeDialog.ok(); } }); nd.setLocationRelativeTo(this); nd.setVisible(true); } } } private void init_date_schedule() { jDateChooser1.addPropertyChangeListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { ret_time_schedules(); } }); } private class time_schedule { public final int id; public final String time; public final int status; public time_schedule(int id, String time, int status) { this.id = id; this.time = time; this.status = status; } } //</editor-fold> }
[ "RAZOR Defianz@RAZORDefianz-PC" ]
RAZOR Defianz@RAZORDefianz-PC
65538213bb29b386b8d01555f199d4f911a9be4c
e9affefd4e89b3c7e2064fee8833d7838c0e0abc
/aws-java-sdk-ram/src/main/java/com/amazonaws/services/ram/model/transform/UpdateResourceShareResultJsonUnmarshaller.java
a816154dc414ed981ece54acc8615809b66c6ccf
[ "Apache-2.0" ]
permissive
aws/aws-sdk-java
2c6199b12b47345b5d3c50e425dabba56e279190
bab987ab604575f41a76864f755f49386e3264b4
refs/heads/master
2023-08-29T10:49:07.379135
2023-08-28T21:05:55
2023-08-28T21:05:55
574,877
3,695
3,092
Apache-2.0
2023-09-13T23:35:28
2010-03-22T23:34:58
null
UTF-8
Java
false
false
3,139
java
/* * Copyright 2018-2023 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.ram.model.transform; import java.math.*; import javax.annotation.Generated; import com.amazonaws.services.ram.model.*; import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; import com.amazonaws.transform.*; import com.fasterxml.jackson.core.JsonToken; import static com.fasterxml.jackson.core.JsonToken.*; /** * UpdateResourceShareResult JSON Unmarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class UpdateResourceShareResultJsonUnmarshaller implements Unmarshaller<UpdateResourceShareResult, JsonUnmarshallerContext> { public UpdateResourceShareResult unmarshall(JsonUnmarshallerContext context) throws Exception { UpdateResourceShareResult updateResourceShareResult = new UpdateResourceShareResult(); int originalDepth = context.getCurrentDepth(); String currentParentElement = context.getCurrentParentElement(); int targetDepth = originalDepth + 1; JsonToken token = context.getCurrentToken(); if (token == null) token = context.nextToken(); if (token == VALUE_NULL) { return updateResourceShareResult; } while (true) { if (token == null) break; if (token == FIELD_NAME || token == START_OBJECT) { if (context.testExpression("resourceShare", targetDepth)) { context.nextToken(); updateResourceShareResult.setResourceShare(ResourceShareJsonUnmarshaller.getInstance().unmarshall(context)); } if (context.testExpression("clientToken", targetDepth)) { context.nextToken(); updateResourceShareResult.setClientToken(context.getUnmarshaller(String.class).unmarshall(context)); } } else if (token == END_ARRAY || token == END_OBJECT) { if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) { if (context.getCurrentDepth() <= originalDepth) break; } } token = context.nextToken(); } return updateResourceShareResult; } private static UpdateResourceShareResultJsonUnmarshaller instance; public static UpdateResourceShareResultJsonUnmarshaller getInstance() { if (instance == null) instance = new UpdateResourceShareResultJsonUnmarshaller(); return instance; } }
[ "" ]
6544c97f4f3bf77830875033429d01854a9badd8
fae83a7a4b1f0e4bc3e28b8aaef5ca8998918183
/src/org/daisy/util/xml/xslt/stylesheets/Stylesheets.java
2dfa53fc42d6d2b3e14cd4c4284bc53897844f4d
[]
no_license
techmilano/pipeline1
2bd3c64edf9773c868bbe23123b80b2302212ca5
f4b7c92ef9d84bf9caeebc4e17870059d044d83c
refs/heads/master
2020-04-10T14:27:46.762074
2018-03-09T14:35:31
2018-03-13T13:48:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,618
java
/* * org.daisy.util (C) 2005-2008 Daisy Consortium * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with this library; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package org.daisy.util.xml.xslt.stylesheets; import java.net.URL; import org.daisy.util.xml.catalog.CatalogExceptionNotRecoverable; /** * A static getter for access to the canonical stylesheets * who has their home in this directory. Note; the URL returned * may be a URL to a file in a jar; therefore use url.openStream() * as new File(url.toURI()) will break if in jar. * @author Markus Gylling */ public class Stylesheets { /** * Get the URL of an XSLT stylesehet * @param identifier A system id of the wanted stylesheet (check ./catalog.xml). * @return a URL of the stylesheet if found, else null */ public static URL get(String identifier) { try { return StylesheetResolver.getInstance().resolve(identifier); } catch (CatalogExceptionNotRecoverable e) { return null; } } }
[ "markus.gylling@gmail.com" ]
markus.gylling@gmail.com
b343d9c2ade5796d5545db6db9b2f25371d8ca56
7645d26415fc80bcb36effdfa9e055b4edd6bcef
/Image-Shopping/src/java/Servlet/ViewUser.java
75610403a5dbe72695cc91e095a820012baa41c9
[]
no_license
LTNThach/Image-Shopping
d96fd7c949b546ffee42495439385f30ed9c77a7
ae32568e72fb2e91320d79ef33c29f01038a04c1
refs/heads/master
2021-01-10T16:51:07.399609
2016-01-25T09:33:16
2016-01-25T09:33:16
49,052,238
0
0
null
null
null
null
UTF-8
Java
false
false
4,267
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 Servlet; import Class.Album; import Class.Photo; import Class.Utilisateur; import Utils.DBUtils; import Utils.Utils; import java.io.IOException; import java.sql.Connection; import java.util.ArrayList; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; /** * * @author Thach */ @WebServlet(name = "ViewUser", urlPatterns = {"/ViewUser"}) public class ViewUser extends HttpServlet { /** * Processes requests for both HTTP <code>GET</code> and <code>POST</code> * methods. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { HttpSession session = request.getSession(); Connection conn = Utils.getStoredConnection(session); int IDU = Integer.parseInt(request.getParameter("IDU")); Utilisateur user = DBUtils.GetUserInfo(conn, IDU); Utilisateur loginedUser = Utils.getLoginedUser(session); ArrayList<Album> ListAlbum = DBUtils.LoadListAlbum(conn, IDU); user.setListAlbum(ListAlbum); String errorString = (String) session.getAttribute("errorString"); ArrayList<Photo> ListInCart = null; int Sum = 0; ArrayList<Album> ListAlbumUserLogined = new ArrayList<Album>(); if (loginedUser != null) { errorString = null; ListAlbumUserLogined = DBUtils.LoadListAlbum(conn, loginedUser.getIDU()); ListInCart = DBUtils.SearchPhoto(conn, loginedUser.getIDU()); if (ListInCart != null) { for (Photo p : ListInCart) { Sum = Sum + p.getPrix(); } } } request.setAttribute("ListAlbum", ListAlbum); request.setAttribute("user", user); request.setAttribute("errorString", errorString); request.setAttribute("ListInCart", ListInCart); request.setAttribute("Sum", Sum); request.setAttribute("ListAlbumUserLogined", ListAlbumUserLogined); RequestDispatcher view = request.getRequestDispatcher("viewuser.jsp"); view.forward(request, response); } // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> /** * Handles the HTTP <code>GET</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Handles the HTTP <code>POST</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Returns a short description of the servlet. * * @return a String containing servlet description */ @Override public String getServletInfo() { return "Short description"; }// </editor-fold> }
[ "Thach@USER" ]
Thach@USER
f03c93e601713bb1d41f2fe78455a38caad2550f
65b236f4aa3cf527dc4a578c6d3a0f8a4ee1bdde
/app/src/test/java/meemseen/podcasto/ExampleUnitTest.java
13934f1ab110123a5050f87f0d8e7939628088ea
[]
no_license
githussein/podcasto
dc3203ef90adaeb75c9f55439e8efd75bd72e3ca
929fc81cc12858efbc353defd59148a90c8c1637
refs/heads/master
2022-11-29T22:53:35.594297
2020-04-18T10:32:56
2020-04-18T10:32:56
286,728,998
0
0
null
null
null
null
UTF-8
Java
false
false
378
java
package meemseen.podcasto; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
[ "muhamed.samy1@gmail.com" ]
muhamed.samy1@gmail.com
ae8292c63d68ec3292f30e2cc64ecb5a15e5c237
7fd18685d7ec5d41b470c05712812f168f09bd42
/app/src/main/java/samaco/idepardazan/phoneplus/Entities/EntityReport.java
3ab553c0fb51fe03323b26f5767454ef0514d146
[]
no_license
AlirezaaYaghoubii/PhonePlus
6b60b96ff93da8f53bce4a68d29694b7fae9dea5
ce0401e903dbeb458bd4c739f7e0c7d59907cbcc
refs/heads/master
2023-02-19T07:10:43.171930
2021-01-20T09:42:01
2021-01-20T09:42:01
331,258,428
0
0
null
null
null
null
UTF-8
Java
false
false
4,217
java
package samaco.idepardazan.phoneplus.Entities; public class EntityReport { private String Id; private String Details_Id; private String Name; private String Nesbat; private String NesbatName; private String Mobile; private String _Date; private String _DateWithSlash; private String _DateMiladi; private String _DateMiladiWithSlash; private String _DateDayName; private String _DateDiff; private String _DateWithMonthWord; private String _DateMiladiWithMonthWord; private String _DateDiffDay; private String _DateDiffHour; private String _DateDiffMinute; private String _DateDiffMandeh; private String _DateType; private String _DateTypeTitle; public String get_DateType() { return _DateType; } public void set_DateType(String _DateType) { this._DateType = _DateType; } public String get_DateTypeTitle() { return _DateTypeTitle; } public void set_DateTypeTitle(String _DateTypeTitle) { this._DateTypeTitle = _DateTypeTitle; } public String get_DateWithMonthWord() { return _DateWithMonthWord; } public void set_DateWithMonthWord(String _DateWithMonthWord) { this._DateWithMonthWord = _DateWithMonthWord; } public String get_DateMiladiWithMonthWord() { return _DateMiladiWithMonthWord; } public void set_DateMiladiWithMonthWord(String _DateMiladiWithMonthWord) { this._DateMiladiWithMonthWord = _DateMiladiWithMonthWord; } public String get_DateDiffDay() { return _DateDiffDay; } public void set_DateDiffDay(String _DateDiffDay) { this._DateDiffDay = _DateDiffDay; } public String get_DateDiffHour() { return _DateDiffHour; } public void set_DateDiffHour(String _DateDiffHour) { this._DateDiffHour = _DateDiffHour; } public String get_DateDiffMinute() { return _DateDiffMinute; } public void set_DateDiffMinute(String _DateDiffMinute) { this._DateDiffMinute = _DateDiffMinute; } public String get_DateDiffMandeh() { return _DateDiffMandeh; } public void set_DateDiffMandeh(String _DateDiffMandeh) { this._DateDiffMandeh = _DateDiffMandeh; } public String getId() { return Id; } public void setId(String id) { Id = id; } public String getDetails_Id() { return Details_Id; } public void setDetails_Id(String details_Id) { Details_Id = details_Id; } public String getName() { return Name; } public void setName(String name) { Name = name; } public String getNesbat() { return Nesbat; } public void setNesbat(String nesbat) { Nesbat = nesbat; } public String getNesbatName() { return NesbatName; } public void setNesbatName(String nesbatName) { NesbatName = nesbatName; } public String getMobile() { return Mobile; } public void setMobile(String mobile) { Mobile = mobile; } public String get_Date() { return _Date; } public void set_Date(String _Date) { this._Date = _Date; } public String get_DateWithSlash() { return _DateWithSlash; } public void set_DateWithSlash(String _DateWithSlash) { this._DateWithSlash = _DateWithSlash; } public String get_DateMiladi() { return _DateMiladi; } public void set_DateMiladi(String _DateMiladi) { this._DateMiladi = _DateMiladi; } public String get_DateMiladiWithSlash() { return _DateMiladiWithSlash; } public void set_DateMiladiWithSlash(String _DateMiladiWithSlash) { this._DateMiladiWithSlash = _DateMiladiWithSlash; } public String get_DateDayName() { return _DateDayName; } public void set_DateDayName(String _DateDayName) { this._DateDayName = _DateDayName; } public String get_DateDiff() { return _DateDiff; } public void set_DateDiff(String _DateDiff) { this._DateDiff = _DateDiff; } }
[ "61379582+AlirezaaYaghoubii@users.noreply.github.com" ]
61379582+AlirezaaYaghoubii@users.noreply.github.com
5c969ca9529fb5a9b25be2e56f8ce178fa2c2f34
4e2dcff1ffa42f10211e735c3c4830cff03aac5d
/parttimejob/src/main/java/com/hnqj/controller/BaseController.java
41e3650c41972a3f0279c1abd2119101036caa01
[]
no_license
zw1002/parttimejob
a480af7a79ec52757b07dff818befec49f456a64
3e104b4d667410282b47347c8ba2ef7812df9ed3
refs/heads/master
2021-05-08T14:41:56.370945
2018-02-03T14:05:22
2018-02-03T14:05:22
120,096,007
0
0
null
null
null
null
UTF-8
Java
false
false
1,398
java
package com.hnqj.controller; import com.hnqj.model.Sysusermgr; import com.hnqj.model.Userinfo; import com.hnqj.services.UserinfoServices; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.RequestAttributes; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; /** * 张威 2017/11 */ public class BaseController { protected final Log logger = LogFactory.getLog(getClass()); /** * 获取Session * * @return */ public HttpSession getSession() { RequestAttributes ra = RequestContextHolder.getRequestAttributes(); HttpServletRequest request = ((ServletRequestAttributes) ra).getRequest(); return request.getSession(); } /** * 获取用户 * * @return */ public Sysusermgr getUser() { RequestAttributes ra = RequestContextHolder.getRequestAttributes(); HttpServletRequest request = ((ServletRequestAttributes) ra).getRequest(); Sysusermgr user = (Sysusermgr) request.getSession().getAttribute("user"); return user; } }
[ "1742799266@qq.com" ]
1742799266@qq.com
18a2b08780e82f745d4bf183fa9d7653c63e0123
5786b8c28f069ae9b9b7f850edf4d4c1b5cf976c
/languages/CSharp/source_gen/CSharp/behavior/Array_type_BehaviorDescriptor.java
279c5cc34ab9f1f223fe379f62bb3bcf99279f09
[ "Apache-2.0" ]
permissive
vaclav/MPS_CSharp
681ea277dae2e7503cd0f2d21cb3bb7084f6dffc
deea11bfe3711dd241d9ca3f007b810d574bae76
refs/heads/master
2021-01-13T14:36:41.949662
2019-12-03T15:26:21
2019-12-03T15:26:21
72,849,927
19
5
null
null
null
null
UTF-8
Java
false
false
363
java
package CSharp.behavior; /*Generated by MPS */ /** * Will be removed after 3.4 * Need to support compilation of the legacy behavior descriptors before the language is rebuilt * This class is not involved in the actual method invocation */ @Deprecated public class Array_type_BehaviorDescriptor { public String getConceptFqName() { return null; } }
[ "vaclav.pech@gmail.com" ]
vaclav.pech@gmail.com
d588f952d7a945fe00023f6f833bf6491a94134d
852988cf7523eed39ab200ce57f1e8cff7c3eed6
/src/main/java/de/flxnet/schematx/helper/LagMeter.java
7a1f899a501b3197defac4c5a7a723be5d183524
[]
no_license
MineWaveDevelopment/schematx
62bbdbcec06e9cbc079ac328eb3028ee1166d488
1af1c525acc437dce707e11ed561fe7c4907e2b3
refs/heads/master
2022-11-19T15:40:36.564366
2020-07-19T08:40:59
2020-07-19T08:40:59
279,681,575
0
0
null
null
null
null
UTF-8
Java
false
false
1,544
java
package de.flxnet.schematx.helper; import java.text.DecimalFormat; /** * Software by FLXnet More info at FLXnet.de Copyright (c) 2015-2020 by FLXnet * * @author Felix */ public class LagMeter implements Runnable { public static int TICK_COUNT = 0; public static long[] TICKS = new long[600]; public static long LAST_TICK = 0L; public void run() { TICKS[(TICK_COUNT % TICKS.length)] = System.currentTimeMillis(); TICK_COUNT += 1; } public static double getTPS() { return getTPS(100); } public static double getTPS(int ticks) { if (TICK_COUNT < ticks) { return 20.0D; } int target = (TICK_COUNT - 1 - ticks) % TICKS.length; long elapsed = System.currentTimeMillis() - TICKS[target]; double result = ticks / (elapsed / 1000.0D); return result > 20 ? 20.00 : result; } public static long getElapsed(int tickID) { if (TICK_COUNT - tickID >= TICKS.length) { } long time = TICKS[(tickID % TICKS.length)]; return System.currentTimeMillis() - time; } public static String formatTps(double tps) { DecimalFormat tpsFormat = new DecimalFormat("#.##"); String formattedTps = tpsFormat.format(tps); if(tps > 19) { return "§2" + formattedTps; } if(tps > 14) { return "§e" + formattedTps; } if(tps > 9) { return "§c" + formattedTps; } if(tps < 9) { return "§4" + formattedTps; } return "§f--.--"; } public static String getTpsString() { return formatTps(getTPS(20)) + "§7, " + formatTps(getTPS(60)) + "§7, " + formatTps(getTPS(100)); } }
[ "fcjfb@junger-dettenhausen.de" ]
fcjfb@junger-dettenhausen.de
6951db4525919ad19d93f6214cd5ad3424e4d7d3
402f175a2506c1396fac6edc7685c0c5f57f098d
/Seção 04 - Wallet API - User/wallet/src/main/java/com/jnsdev/wallet/WalletApplication.java
dbaba7b4fee3b4c55858edc60a07b03b822805a0
[]
no_license
jairosousa/walletAPI
d2b343c9417c60edaf278063d0929b73a8e55850
1023905066840a59aeeb47ed58afd198e63b4c24
refs/heads/master
2020-09-22T11:02:46.684142
2020-02-11T09:31:09
2020-02-11T09:31:09
225,167,136
0
0
null
null
null
null
UTF-8
Java
false
false
310
java
package com.jnsdev.wallet; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class WalletApplication { public static void main(String[] args) { SpringApplication.run(WalletApplication.class, args); } }
[ "jaironsousa@gmail.com" ]
jaironsousa@gmail.com
3b59a6ec8c99322b4bf2097d17287d9f76c9c4b3
035ed5e888341f47e037fb00aca30d8f269d79ed
/src/main/java/com/sheffmachine/config/CloudDatabaseConfiguration.java
dad954035d0ad4b17680f1260b49b63dfc034a3d
[]
no_license
SHEFFcode/jhipster-tasks-mogo
0e4f42ed648b6f07020cee9e3debda5c6df5da65
d2e02ea5dc75d0dc1efec03312c0814ad15e3976
refs/heads/master
2020-04-24T21:27:56.303572
2019-02-24T16:54:23
2019-02-24T16:54:23
172,278,973
0
0
null
null
null
null
UTF-8
Java
false
false
3,032
java
package com.sheffmachine.config; import com.github.mongobee.Mongobee; import io.github.jhipster.config.JHipsterConstants; import io.github.jhipster.domain.util.JSR310DateConverters.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.cloud.Cloud; import org.springframework.cloud.CloudException; import org.springframework.cloud.config.java.AbstractCloudConfig; import org.springframework.cloud.service.ServiceInfo; import org.springframework.cloud.service.common.MongoServiceInfo; import org.springframework.context.annotation.*; import org.springframework.core.convert.converter.Converter; import org.springframework.data.mongodb.MongoDbFactory; import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.data.mongodb.core.convert.MongoCustomConversions; import org.springframework.data.mongodb.core.mapping.event.ValidatingMongoEventListener; import org.springframework.data.mongodb.repository.config.EnableMongoRepositories; import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; import java.util.ArrayList; import java.util.List; @Configuration @EnableMongoRepositories("com.sheffmachine.repository") @Profile(JHipsterConstants.SPRING_PROFILE_CLOUD) public class CloudDatabaseConfiguration extends AbstractCloudConfig { private final Logger log = LoggerFactory.getLogger(CloudDatabaseConfiguration.class); @Bean public MongoDbFactory mongoFactory() { return connectionFactory().mongoDbFactory(); } @Bean public LocalValidatorFactoryBean validator() { return new LocalValidatorFactoryBean(); } @Bean public ValidatingMongoEventListener validatingMongoEventListener() { return new ValidatingMongoEventListener(validator()); } @Bean public MongoCustomConversions customConversions() { List<Converter<?, ?>> converterList = new ArrayList<>(); converterList.add(DateToZonedDateTimeConverter.INSTANCE); converterList.add(ZonedDateTimeToDateConverter.INSTANCE); return new MongoCustomConversions(converterList); } @Bean public Mongobee mongobee(MongoDbFactory mongoDbFactory, MongoTemplate mongoTemplate, Cloud cloud) { log.debug("Configuring Cloud Mongobee"); List<ServiceInfo> matchingServiceInfos = cloud.getServiceInfos(MongoDbFactory.class); if (matchingServiceInfos.size() != 1) { throw new CloudException("No unique service matching MongoDbFactory found. Expected 1, found " + matchingServiceInfos.size()); } MongoServiceInfo info = (MongoServiceInfo) matchingServiceInfos.get(0); Mongobee mongobee = new Mongobee(info.getUri()); mongobee.setDbName(mongoDbFactory.getDb().getName()); mongobee.setMongoTemplate(mongoTemplate); // package to scan for migrations mongobee.setChangeLogsScanPackage("com.sheffmachine.config.dbmigrations"); mongobee.setEnabled(true); return mongobee; } }
[ "sheff@sheffmachine.com" ]
sheff@sheffmachine.com
beeb81b53b492783b800ba60982e6b11615eff0e
9b0fe66ab981eca10daedd3767c334c09335524d
/src/TicTacToe.java
cb4f9cf96435d1561cfea987dc90bbe21fbfc9b5
[]
no_license
sixsalman/TicTacToe
6eda80c4d67e2a941b6f5e64e90544dd57cb2cc2
29bd08014b4804f1f8972fa61ad4ef274d8dff93
refs/heads/master
2022-03-29T22:20:19.211349
2019-12-08T17:03:24
2019-12-08T17:03:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
10,512
java
import java.util.*; /** * Author: Muhammad Salman Khan * * This program plays Tic Tac Toe game with user */ public class TicTacToe { private static char[] board = new char[9]; private static ArrayList<Integer> empSpots = new ArrayList<>(9); private static Scanner kbd = new Scanner(System.in); private static char comp; private static char player; /** * Main method gets user's choice of mark, gives array representing boards and ArrayList representing empty spots * initial values and keeps calling playerTurn and ComputerTurn methods along with checkWin and checkDraw methods * until either there is a winner or game draws * @param args is not used */ public static void main(String[] args) { System.out.println("TIC TAC TOE"); boolean isValid = false; String rawResp; do { System.out.println("\nChoose a mark:\n1 - x\n2 - o"); rawResp = kbd.nextLine(); if (rawResp.equals("1")) { player = 'x'; comp = 'o'; isValid = true; } else if (rawResp.equals("2")) { player = 'o'; comp = 'x'; isValid = true; } else { System.out.println("\nInvalid Entry"); } } while(!isValid); System.out.printf("\nYour Mark: %c\nComputer's Mark: %c\n", player, comp); for (int i = 0; i < board.length; i++) { board[i] = Character.forDigit(i, 10); empSpots.add(i); } System.out.print("\n"); showBoard(); while(true){ playerTurn(); showBoard(); if(checkWin(player)) { System.out.println("\nYOU WIN!"); kbd.close(); break; } compTurn(); showBoard(); if(checkWin(comp)) { System.out.println("\nCOMPUTER WINS"); kbd.close(); break; } if(empSpots.size() == 1) checkDraw(); } } /** * This method displays array representing board */ private static void showBoard() { int ind = 0; for (int i = 0; i <= 2; i++){ for (int j = 0; j <= 2; j++){ System.out.print(board[ind] + " "); ind++; } System.out.print("\n"); } } /** * This method asks user for his/her choice of next mark and validates it */ private static void playerTurn() { boolean isValid = false; String rawResp; int resp = -1; do { System.out.print("\nChoose an available integer to replace with '" + player + "': "); rawResp = kbd.nextLine(); if (rawResp.length() == 1) { rawResp = String.valueOf(rawResp.charAt(0)); if (Arrays.asList("0", "1", "2", "3", "4", "5", "6", "7", "8").contains(rawResp)) { resp = Integer.parseInt(rawResp); if (empSpots.contains(resp)) { isValid = true; removeSpot(resp); } else { System.out.println("\nInvalid Entry"); } } else { System.out.println("\nInvalid Entry"); } } else { System.out.println("\nInvalid Entry"); } } while(!isValid); board[resp] = player; System.out.print("\n"); } /** * This method analyses board representing array and places computer's mark appropriately */ private static void compTurn() { Random rand = new Random(); int choice; System.out.println("\nComputer's Turn:\n"); if ((board[0] == player && board[2] == player || board[0] == comp && board[2] == comp) && empSpots.contains(1)) { board[1] = comp; removeSpot(1); } else if ((board[3] == player && board[5] == player || board[3] == comp && board[5] == comp) && empSpots.contains(4)) { board[4] = comp; removeSpot(4); } else if ((board[6] == player && board[8] == player || board[6] == comp && board[8] == comp) && empSpots.contains(7)) { board[7] = comp; removeSpot(7); } else if ((board[0] == player && board[6] == player || board[0] == comp && board[6] == comp) && empSpots.contains(3)) { board[3] = comp; removeSpot(3); } else if ((board[1] == player && board[7] == player || board[1] == comp && board[7] == comp) && empSpots.contains(4)) { board[4] = comp; removeSpot(4); } else if ((board[2] == player && board[8] == player || board[2] == comp && board[8] == comp) && empSpots.contains(5)) { board[5] = comp; removeSpot(5); } else if ((board[0] == player && board[8] == player || board[0] == comp && board[8] == comp) && empSpots.contains(4)) { board[4] = comp; removeSpot(4); } else if ((board[2] == player && board[6] == player || board[2] == comp && board[6] == comp) && empSpots.contains(4)) { board[4] = comp; removeSpot(4); } else if ((board[0] == player && board[1] == player || board[0] == comp && board[1] == comp) && empSpots.contains(2)) { board[2] = comp; removeSpot(2); } else if ((board[3] == player && board[4] == player || board[3] == comp && board[4] == comp) && empSpots.contains(5)) { board[5] = comp; removeSpot(5); } else if ((board[6] == player && board[7] == player || board[6] == comp && board[7] == comp) && empSpots.contains(8)) { board[8] = comp; removeSpot(8); } else if ((board[0] == player && board[3] == player || board[0] == comp && board[3] == comp) && empSpots.contains(6)) { board[6] = comp; removeSpot(6); } else if ((board[1] == player && board[4] == player || board[1] == comp && board[4] == comp) && empSpots.contains(7)) { board[7] = comp; removeSpot(7); } else if ((board[2] == player && board[5] == player || board[2] == comp && board[5] == comp) && empSpots.contains(8)) { board[8] = comp; removeSpot(8); } else if ((board[1] == player && board[2] == player || board[1] == comp && board[2] == comp) && empSpots.contains(0)) { board[0] = comp; removeSpot(0); } else if ((board[4] == player && board[5] == player || board[4] == comp && board[5] == comp) && empSpots.contains(3)) { board[3] = comp; removeSpot(3); } else if ((board[7] == player && board[8] == player || board[7] == comp && board[8] == comp) && empSpots.contains(6)) { board[6] = comp; removeSpot(6); } else if ((board[3] == player && board[6] == player || board[3] == comp && board[6] == comp) && empSpots.contains(0)) { board[0] = comp; removeSpot(0); } else if ((board[4] == player && board[7] == player || board[4] == comp && board[7] == comp) && empSpots.contains(1)) { board[1] = comp; removeSpot(1); } else if ((board[5] == player && board[8] == player || board[5] == comp && board[8] == comp) && empSpots.contains(2)) { board[2] = comp; removeSpot(2); } else if ((board[0] == player && board[4] == player || board[0] == comp && board[4] == comp) && empSpots.contains(8)) { board[8] = comp; removeSpot(8); } else if ((board[4] == player && board[8] == player || board[4] == comp && board[8] == comp) && empSpots.contains(0)) { board[0] = comp; removeSpot(0); } else if ((board[6] == player && board[4] == player || board[6] == comp && board[4] == comp) && empSpots.contains(2)) { board[2] = comp; removeSpot(2); } else if ((board[2] == player && board[4] == player || board[2] == comp && board[4] == comp) && empSpots.contains(6)) { board[6] = comp; removeSpot(6); } else { choice = rand.nextInt(empSpots.size()); board[empSpots.get(choice)] = comp; empSpots.remove(choice); } } /** * Checks whether a player has won * @param sign receives 'x' or 'o' * @return true if player with the sign received in parameter has won, false otherwise */ private static boolean checkWin(char sign) { return (board[0] == sign && board[1] == sign && board[2] == sign || board[3] == sign && board[4] == sign && board[5] == sign || board[6] == sign && board[7] == sign && board[8] == sign || board[0] == sign && board[3] == sign && board[6] == sign || board[1] == sign && board[4] == sign && board[7] == sign || board[2] == sign && board[5] == sign && board[8] == sign || board[0] == sign && board[4] == sign && board[8] == sign || board[2] == sign && board[4] == sign && board[6] == sign); } /** * Checks whether game is draw or not */ private static void checkDraw() { if(checkWin(player)){ System.out.println("\nYOU WIN!"); } else if (checkWin(comp)){ System.out.println("\nCOMPUTER WINS"); } else { System.out.println("\nIT'S A DRAW"); } kbd.close(); System.exit(0); } /** * Removes received spot from ArrayList containing empty spots * @param spot receives number of the spot to be removed */ private static void removeSpot(int spot) { for (int i = 0; i < empSpots.size(); i++){ if (empSpots.get(i) == spot) { empSpots.remove(i); break; } } } }
[ "-" ]
-
3291e2010768ffc8b0a7e544bf354f390d90e5ef
304ef06c32afaf4f0615fa73a447af537ad75c57
/ch09-bus/ch09-bus-config-server-eureka-rabbitmq/src/main/java/com/zccoder/cloud2/ch9/bus/config/server/eureka/rabbitmq/BusConfigServerEurekaRabbitmqApplication.java
9fd673687923fab198e686455e27231c674f8d2c
[]
no_license
wu4yong/study-cloud2
a95c49cbeaec4ff6d3826a5cfcf71d23ba5bd759
394ac095310a4e30310f59fffdcdf222116d0a08
refs/heads/master
2020-07-01T16:38:43.270736
2018-10-15T03:07:11
2018-10-15T03:07:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
735
java
package com.zccoder.cloud2.ch9.bus.config.server.eureka.rabbitmq; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.config.server.EnableConfigServer; /** * <br> * 标题: 启动类<br> * 描述: 启动类<br> * 时间: 2018/10/04<br> * * @author zc */ @EnableDiscoveryClient @EnableConfigServer @SpringBootApplication public class BusConfigServerEurekaRabbitmqApplication { public static void main(String[] args) { new SpringApplicationBuilder(BusConfigServerEurekaRabbitmqApplication.class).web(true).run(args); } }
[ "zccoder@aliyun.com" ]
zccoder@aliyun.com
46728bb88963d91a19dc16b7e5cc155e37de4749
24afb09a3d46646b61f338b252f900c585958ee0
/aixbackend-aix-test-api-904c6efbc87b/E2EServicesTest/src/test/java/com/aixtrade/hooks/TaggedHooks.java
c2ec9cc4d224692d13dcc64c5117de6adfe83cef
[]
no_license
yash1731/swati_x_api_project
00c526794ef1b00883708b3991a71d1610e05367
e72a377c55fbb90558c13cfca2172d705931e88c
refs/heads/master
2023-04-07T23:40:34.365584
2021-04-21T13:56:06
2021-04-21T13:56:06
360,189,927
0
0
null
null
null
null
UTF-8
Java
false
false
1,091
java
package com.aixtrade.hooks; //import cucumber.api.java.After; //import cucumber.api.java.Before; import io.cucumber.java.After; import io.cucumber.java.Before; public class TaggedHooks { // Tagged Hooks @Before("@sanity") public void setUpTaggedHooks() { System.out.println("setting up sanity test"); } @After("@sanity") public void cleanUpTaggedHooks() { System.out.println("Cleaning up sanity tests with tagged hooks"); } @Before(value = "@wip", order = 4) public void setUpTaggedHooks1() { System.out.println("This is work in progress starting up 1"); } @After(value = "@wip", order = 4) public void cleanUpTaggedHooks1() { System.out.println("This is work in progress cleaning up 1"); } @Before(value = "@wip", order = 5) public void setUpTaggedHooks2() { System.out.println("This is work in progress starting up 2"); } @After(value = "@wip", order = 5) public void cleanUpTaggedHooks2() { System.out.println("This is work in progress cleaning up 2"); } }
[ "yash.dewangan82@gmail.com" ]
yash.dewangan82@gmail.com
46be82d06d8656254c881a864791ce40d7ffee26
80836ff2605b8e735c55a1d828725dc536a21a75
/SortCharactersByFrequency.java
ce5b80b7c676254002bde0a776834abbebd40532
[]
no_license
Afaf-Athar/May-LeetCoding-Challenge
c022dbd550c165d874235044b2b71608ba09be6a
e3f396886cfabe28abc218d0e8a0e42b222ac64f
refs/heads/master
2022-10-07T11:10:48.692769
2020-05-31T23:43:49
2020-05-31T23:43:49
260,521,723
1
0
null
null
null
null
UTF-8
Java
false
false
1,355
java
/* Given a string, sort it in decreasing order based on the frequency of characters. Example 1: Input: "tree" Output: "eert" Explanation: 'e' appears twice while 'r' and 't' both appear once. So 'e' must appear before both 'r' and 't'. Therefore "eetr" is also a valid answer. */ public class Solution { public String frequencySort(String s) { Map<Character, Integer> map = new HashMap<>(); for (char c : s.toCharArray()) { if (map.containsKey(c)) { map.put(c, map.get(c) + 1); } else { map.put(c, 1); } } List<Character> [] bucket = new List[s.length() + 1]; for (char key : map.keySet()) { int frequency = map.get(key); if (bucket[frequency] == null) { bucket[frequency] = new ArrayList<>(); } bucket[frequency].add(key); } StringBuilder sb = new StringBuilder(); for (int pos = bucket.length - 1; pos >=0; pos--) { if (bucket[pos] != null) { for (char num : bucket[pos]) { for (int i = 0; i < map.get(num); i++) { sb.append(num); } } } } return sb.toString(); } }
[ "noreply@github.com" ]
Afaf-Athar.noreply@github.com
e219a87241a6dcc646967374a94be746b3609512
f6211d395ba25f587dd4b29681772d5c708fff28
/src/teachers/salary/calculator/editTeacher.java
73395b4028f9963a44e3882c8744a850f0a04c7b
[]
no_license
Ahmed067Abdullah/salary-calculator-Java
719a21c945a242a34864322bf42a547d0da88904
6025d555487465bdc38526274df37e2e7544c4ad
refs/heads/master
2020-03-28T17:23:35.681314
2018-10-05T05:27:29
2018-10-05T05:27:29
148,784,850
0
0
null
null
null
null
UTF-8
Java
false
false
19,056
java
package teachers.salary.calculator; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import javax.swing.JOptionPane; public class editTeacher extends javax.swing.JFrame { Connection con; ResultSet rs; PreparedStatement ps; String sql; int idForUpdation; public editTeacher() { super("Edit Teacher Breakup"); initComponents(); } public boolean isNumeric(String str) { return str.matches("^\\d+$"); } public void clearFields() { jTextField4.setText(""); jTextField6.setText(""); } @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel2 = new javax.swing.JLabel(); jLabel1 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); jTextField4 = new javax.swing.JTextField(); jTextField3 = new javax.swing.JTextField(); jTextField5 = new javax.swing.JTextField(); jTextField6 = new javax.swing.JTextField(); jButton8 = new javax.swing.JButton(); jButton9 = new javax.swing.JButton(); jButton10 = new javax.swing.JButton(); jLabel13 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jLabel2.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N jLabel2.setText("Course"); jLabel1.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N jLabel1.setText("Name"); jLabel3.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N jLabel3.setText("Teacher ID"); jLabel6.setFont(new java.awt.Font("Trajan Pro", 0, 44)); // NOI18N jLabel6.setText("Edit Teacher Breakup"); jLabel6.setBorder(javax.swing.BorderFactory.createCompoundBorder()); jLabel5.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N jLabel5.setText("Pay per student"); jTextField4.setEditable(false); jTextField4.setFont(new java.awt.Font("Tahoma", 0, 20)); // NOI18N jTextField3.setFont(new java.awt.Font("Tahoma", 0, 20)); // NOI18N jTextField3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField3ActionPerformed(evt); } }); jTextField5.setFont(new java.awt.Font("Tahoma", 0, 20)); // NOI18N jTextField6.setFont(new java.awt.Font("Tahoma", 0, 20)); // NOI18N jTextField6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField6ActionPerformed(evt); } }); jButton8.setFont(new java.awt.Font("Tahoma", 0, 20)); // NOI18N jButton8.setText("Back"); jButton8.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton8ActionPerformed(evt); } }); jButton9.setFont(new java.awt.Font("Tahoma", 0, 20)); // NOI18N jButton9.setText("Search"); jButton9.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton9ActionPerformed(evt); } }); jButton10.setFont(new java.awt.Font("Tahoma", 0, 20)); // NOI18N jButton10.setText("Save"); jButton10.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton10ActionPerformed(evt); } }); jLabel13.setIcon(new javax.swing.ImageIcon(getClass().getResource("/home.png"))); // NOI18N jLabel13.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel13MouseClicked(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(38, 38, 38) .addComponent(jLabel6)) .addGroup(layout.createSequentialGroup() .addGap(63, 63, 63) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel1) .addComponent(jLabel3) .addComponent(jLabel2) .addComponent(jLabel5)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, 191, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, 191, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 191, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, 191, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(26, 26, 26) .addComponent(jButton9, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap() .addComponent(jButton8, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jButton10, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(137, 137, 137))) .addGap(0, 11, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addComponent(jLabel13))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(48, 48, 48) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel3)) .addGap(27, 27, 27) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1) .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(layout.createSequentialGroup() .addGap(166, 166, 166) .addComponent(jButton9, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(30, 30, 30) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2) .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(25, 25, 25) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel5) .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 26, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton8, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButton10, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(16, 16, 16) .addComponent(jLabel13) .addContainerGap()) ); setSize(new java.awt.Dimension(618, 547)); setLocationRelativeTo(null); }// </editor-fold>//GEN-END:initComponents private void jTextField6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField6ActionPerformed }//GEN-LAST:event_jTextField6ActionPerformed private void jTextField3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField3ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jTextField3ActionPerformed private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton8ActionPerformed setVisible(false); teacherMenu m = new teacherMenu(); m.setVisible(true); }//GEN-LAST:event_jButton8ActionPerformed private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton9ActionPerformed String id = jTextField5.getText().trim(); String name = jTextField3.getText().trim().toLowerCase(); // Checking for empty fields if (id.equals("") && name.equals("")) { clearFields(); JOptionPane.showMessageDialog(null, "Enter either ID or Name"); } else { con = DBConnection.connect(); int flag = 0; // Search by id if available if (!id.equals("")) { sql = "Select * from teachers where id = ?"; try { ps = con.prepareStatement(sql); ps.setString(1, id); rs = ps.executeQuery(); while (rs.next()) { flag = 1; break; } } catch (Exception e) { JOptionPane.showMessageDialog(null, e); } } // Search by name if id is not there else { sql = "Select * from teachers where t_name = ?"; try { ps = con.prepareStatement(sql); ps.setString(1, name); rs = ps.executeQuery(); while (rs.next()) { flag = 2; break; } } catch (Exception e) { JOptionPane.showMessageDialog(null, e); } } try { int t_breakup, t_course; // Setting id and name w.r.t to previous if-else if (flag == 1) { name = rs.getString("t_name"); } else if (flag == 2) { id = rs.getString("id"); } else { clearFields(); throw new resultNotFoundException("Invalid ID or Name, Teacher not found"); } t_course = rs.getInt("t_course"); t_breakup = rs.getInt("t_breakup"); //Finding Course String course, conflict; if (t_course == 0) { course = "Chemistry"; } else if (t_course == 1) { course = "Physics"; } else if (t_course == 2) { course = "Maths"; } else if (t_course == 3) { course = "Biology"; } else { course = "Something Wrong"; } Teacher t = new Teacher(); idForUpdation = Integer.parseInt(id); jTextField5.setText(id); jTextField3.setText(t.capitalizeTeacherName(name)); jTextField4.setText(course); jTextField6.setText(Integer.toString(t_breakup)); } catch (resultNotFoundException e) { JOptionPane.showMessageDialog(null, e); } catch (Exception e) { JOptionPane.showMessageDialog(null, e); } finally { try { rs.close(); ps.close(); con.close(); } catch (Exception e) { JOptionPane.showMessageDialog(null, e); } } } }//GEN-LAST:event_jButton9ActionPerformed private void jButton10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton10ActionPerformed // Checking for empty fields if (idForUpdation < 1 || jTextField6.getText().trim().equals("")) { JOptionPane.showMessageDialog(null, "Incomplete Details"); } // Checking for invalid data types else if (!isNumeric(jTextField6.getText().trim())) { JOptionPane.showMessageDialog(null, "Invalid input"); } else { // Only continue if press yes if (JOptionPane.showConfirmDialog(null, "This opeation will effect salaries of previous months as well, Are you sure want to continue", "Warning", JOptionPane.YES_NO_CANCEL_OPTION) == JOptionPane.YES_OPTION) { int t_breakup = Integer.parseInt(jTextField6.getText().trim()); try { con = DBConnection.connect(); sql = "update teachers set t_breakup = ? where id = ?"; ps = con.prepareStatement(sql); ps.setInt(1, t_breakup); ps.setInt(2, idForUpdation); ps.execute(); JOptionPane.showMessageDialog(null, "Record Updated Successfully"); setVisible(false); teacherMenu m = new teacherMenu(); m.setVisible(true); } catch (Exception e) { JOptionPane.showMessageDialog(null, e); } finally { try { rs.close(); ps.close(); con.close(); } catch (Exception e) { JOptionPane.showMessageDialog(null, e); } } } } }//GEN-LAST:event_jButton10ActionPerformed private void jLabel13MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel13MouseClicked setVisible(false); addFeesData m = new addFeesData(); m.setVisible(true); }//GEN-LAST:event_jLabel13MouseClicked /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(editTeacher.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(editTeacher.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(editTeacher.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(editTeacher.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new editTeacher().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButton10; private javax.swing.JButton jButton8; private javax.swing.JButton jButton9; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel13; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JTextField jTextField3; private javax.swing.JTextField jTextField4; private javax.swing.JTextField jTextField5; private javax.swing.JTextField jTextField6; // End of variables declaration//GEN-END:variables }
[ "ahmed067abdullah@gmail.com" ]
ahmed067abdullah@gmail.com
2eb5baa6e9bfec41962b59abdb73d6429ceb8ac9
cae696307271fc196251d4b10c9cc4286780a825
/request-approval/src/main/java/com/order/camunda/Step6.java
fbfef13a78bcba262278342fcc12cd0b25b5a488
[]
no_license
karan121/camunda
a9ffc52dbf084d009e5858887c467153fc69608b
8f58a9dc1a268d5456919b1d95451ccc3bd6d329
refs/heads/master
2023-03-27T17:16:30.840614
2021-04-01T17:08:45
2021-04-01T17:08:45
353,770,130
0
0
null
null
null
null
UTF-8
Java
false
false
942
java
package com.order.camunda; import org.camunda.bpm.engine.delegate.DelegateExecution; import org.camunda.bpm.engine.delegate.JavaDelegate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.kafka.core.KafkaTemplate; import org.springframework.stereotype.Service; @Service public class Step6 implements JavaDelegate{ @Autowired private KafkaTemplate<String, String> kafka; @Override public void execute(DelegateExecution execution) throws Exception { System.out.println("step 6 ==> "+execution.getVariables()); StringBuffer buffer = new StringBuffer(); buffer.append("<GetActOrderDetails><RequestStatus>"). append(execution.getVariable("osmStatus")). append("<orderId>"). append(execution.getVariable("orderId")). append("</orderId>"). append("</RequestStatus></GetActOrderDetails>"); kafka.send("osm_success", buffer.toString()); } }
[ "krnch@192.168.1.6" ]
krnch@192.168.1.6
a76d1a09716cf7459ef8b5c5297a3ea057aece31
bd980c1bb6e39b6403658b61add0a7bdd8154345
/src/test/java/com/example/AppTest.java
1bc89639840dd75e44b0cfe9aace102bf18c90db
[]
no_license
sugimomoto/chapter_3_3_2
ba75686f16d3c7715b748a4487e54c4e562899f3
a45f5cf3f68fcb4d5f91569bf70881d98e14609a
refs/heads/master
2023-07-11T11:11:57.242231
2021-08-22T02:35:26
2021-08-22T02:35:26
398,697,970
0
0
null
null
null
null
UTF-8
Java
false
false
1,525
java
package com.example; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertTrue; import java.util.HashSet; import java.util.Set; import org.junit.Test; /** * Unit test for simple App. */ public class AppTest { /** * Rigorous Test :-) */ @Test public void shouldAnswerWithTrue() { assertTrue( true ); } @Test public void HashCodeCheck(){ Employee emp = new Employee(1, "Kazuya"); Employee empSame = new Employee(1, "Kazuya"); Employee empDiffNo = new Employee(2, "Kazuya"); Employee empDiffName = new Employee(1, "Diff"); // empSame は HashCode が一致する。 assertEquals(emp.hashCode(), empSame.hashCode()); assertNotEquals(emp.hashCode(), empDiffName.hashCode()); assertNotEquals(emp.hashCode(), empDiffNo.hashCode()); } @Test public void HashTableTest(){ Employee emp = new Employee(1, "Kazuya"); Employee empSame = new Employee(1, "Kazuya"); Employee empDiffNo = new Employee(2, "Kazuya"); Employee empDiffName = new Employee(1, "Diff"); Set<Employee> employees = new HashSet<>(); employees.add(emp); employees.add(empSame); employees.add(empDiffNo); employees.add(empDiffName); // empSame は Hash値が一緒のため、重複と判断され、除外される。 assertEquals(3, employees.size()); } }
[ "sugimomoto@gmail.com" ]
sugimomoto@gmail.com
05775600927e706f347f12f0584ecf1554c3f0bb
9d4f7ad3367e77a2aec74eaec996300371dcef99
/src/com/wiki/entity/MCategory.java
ab9286da27a3da77b24655e2cbe7feb1ef774985
[]
no_license
songboyu/word-expand-java
18f8e60f6d9deae818ec4d53e9cd50842f5f5f04
4913aa39270753974bf22b5e69feae22b52cc9b4
refs/heads/master
2020-12-26T00:45:34.768876
2015-06-02T02:43:32
2015-06-02T02:43:32
26,667,201
0
0
null
null
null
null
UTF-8
Java
false
false
1,397
java
package com.wiki.entity; import com.wiki.expand.WikiFetcher; import de.tudarmstadt.ukp.wikipedia.api.Category; /** * Category类型扩展 * @author Xiang * */ public class MCategory{ private String title; private Category category; private boolean up; private boolean down; public MCategory(){} public MCategory(Category category,boolean up,boolean down){ this.category = category; this.title = WikiFetcher.getTitleStrForCat(category); this.up = up; this.down = down; } public Category getCategory() { return category; } public void setCategory(Category category) { this.category = category; } public boolean isUp() { return up; } public void setUp(boolean up) { this.up = up; } public boolean isDown() { return down; } public void setDown(boolean down) { this.down = down; } public String getTitle() { return title; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((title == null) ? 0 : title.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; MCategory other = (MCategory) obj; if (title == null) { if (other.title != null) return false; } else if (!title.equals(other.title)) return false; return true; } }
[ "linxiangruanjian@gmail.com" ]
linxiangruanjian@gmail.com
6a628afc60ad9242af8597853a4d9484997df57b
78af0113ca442ca31e247ef1125141a90c24b9c5
/joana.ifc.sdg.graph/src/edu/kit/joana/ifc/sdg/graph/BitVectorBase.java
92cd60d13860a29c0a28a1a7cda19314b71aec0c
[]
no_license
rsmbf/joana
25b6c684f538449aadd47c99165aaf69caa76edf
1112af9f05a3ede342736ecddae0f050b008f183
refs/heads/master
2021-01-24T21:11:59.363636
2016-11-21T17:22:17
2016-11-21T17:22:17
44,451,066
1
1
null
2015-10-17T19:25:40
2015-10-17T19:25:40
null
UTF-8
Java
false
false
5,415
java
/** * This file is part of the Joana IFC project. It is developed at the * Programming Paradigms Group of the Karlsruhe Institute of Technology. * * For further details on licensing please read the information at * http://joana.ipd.kit.edu or contact the authors. */ /******************************************************************************* * Copyright (c) 2002 - 2006 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package edu.kit.joana.ifc.sdg.graph; import java.io.Serializable; /** * Abstract base class for implementations of bitvectors */ @SuppressWarnings("rawtypes") abstract public class BitVectorBase<T extends BitVectorBase> implements Cloneable, Serializable { private static final long serialVersionUID = 6616478949492760615L; protected final static int LOG_BITS_PER_UNIT = 5; protected final static int BITS_PER_UNIT = 32; protected final static int MASK = 0xffffffff; protected final static int LOW_MASK = 0x1f; protected int bits[]; public abstract void set(int bit); public abstract void clear(int bit); public abstract boolean get(int bit); public abstract int length(); public abstract void and(T other); public abstract void andNot(T other); public abstract void or(T other); public abstract void xor(T other); public abstract boolean sameBits(T other); public abstract boolean isSubset(T other); public abstract boolean intersectionEmpty(T other); /** * Convert bitIndex to a subscript into the bits[] array. */ public static int subscript(int bitIndex) { return bitIndex >> LOG_BITS_PER_UNIT; } /** * Clears all bits. */ public final void clearAll() { for (int i = 0; i < bits.length; i++) { bits[i] = 0; } } @Override public int hashCode() { int h = 1234; for (int i = bits.length - 1; i >= 0;) { h ^= bits[i] * (i + 1); i--; } return h; } /** * How many bits are set? */ public final int populationCount() { int count = 0; for (int i = 0; i < bits.length; i++) { count += Bits.populationCount(bits[i]); } return count; } public boolean isZero() { int setLength = bits.length; for (int i = setLength - 1; i >= 0;) { if (bits[i] != 0) return false; i--; } return true; } @Override @SuppressWarnings("unchecked") public Object clone() { BitVectorBase<T> result = null; try { result = (BitVectorBase<T>) super.clone(); } catch (CloneNotSupportedException e) { // this shouldn't happen, since we are Cloneable throw new InternalError(); } result.bits = new int[bits.length]; System.arraycopy(bits, 0, result.bits, 0, result.bits.length); return result; } @Override public String toString() { StringBuffer buffer = new StringBuffer(); boolean needSeparator = false; buffer.append('{'); int limit = length(); for (int i = 0; i < limit; i++) { if (get(i)) { if (needSeparator) { buffer.append(", "); } else { needSeparator = true; } buffer.append(i); } } buffer.append('}'); return buffer.toString(); } /* * @see com.ibm.wala.util.intset.IntSet#contains(int) */ public boolean contains(int i) { return get(i); } private static final int[][] masks = new int[][] { { 0xFFFF0000 }, { 0xFF000000, 0x0000FF00 }, { 0xF0000000, 0x00F00000, 0x0000F000, 0x000000F0 }, { 0xC0000000, 0x0C000000, 0x00C00000, 0x000C0000, 0x0000C000, 0x00000C00, 0x000000C0, 0x0000000C }, { 0x80000000, 0x20000000, 0x08000000, 0x02000000, 0x00800000, 0x00200000, 0x00080000, 0x00020000, 0x00008000, 0x00002000, 0x00000800, 0x00000200, 0x00000080, 0x00000020, 0x00000008, 0x00000002 } }; public int max() { int lastWord = bits.length - 1; while (lastWord >= 0 && bits[lastWord] == 0) lastWord--; if (lastWord < 0) return -1; int count = lastWord * BITS_PER_UNIT; int top = bits[lastWord]; int j = 0; for (int i = 0; i < masks.length; i++) { if ((top & masks[i][j]) != 0) { j <<= 1; } else { j <<= 1; j++; } } return count + (31 - j); } /** * @return min j >= start s.t get(j) */ public int nextSetBit(int start) { if (start < 0) { throw new IllegalArgumentException("illegal start: " + start); } int word = subscript(start); int bit = (1 << (start & LOW_MASK)); while (word < bits.length) { if (bits[word] != 0) { do { if ((bits[word] & bit) != 0) return start; bit <<= 1; start++; } while (bit != 0); } else { start += (BITS_PER_UNIT - (start & LOW_MASK)); } word++; bit = 1; } return -1; } /** * Copies the values of the bits in the specified set into this set. * * @param set * the bit set to copy the bits from * @throws IllegalArgumentException * if set is null */ public void copyBits(BitVectorBase set) { if (set == null) { throw new IllegalArgumentException("set is null"); } int setLength = set.bits.length; bits = new int[setLength]; for (int i = setLength - 1; i >= 0;) { bits[i] = set.bits[i]; i--; } } }
[ "rodrigo_cardoso@hotmail.it" ]
rodrigo_cardoso@hotmail.it
c0aed0500fef457ef84a805402edb4b34b353d36
a0498fbbf6a9c8b95f5ded429683ba1762e831a0
/src/main/java/com/example/cache/entities/Seller.java
c942909b042616f277bd6efec8926dd87641d216
[]
no_license
rohitfortune/spring-rest-jpa-cache
e54554215db57b1814de0dc6b32cd5adc44d2f3f
5a497dd703f8309b41688b1082c8a5f1fd72e455
refs/heads/master
2022-11-05T19:14:28.124295
2020-06-17T20:55:19
2020-06-17T20:55:19
151,675,171
0
0
null
null
null
null
UTF-8
Java
false
false
730
java
package com.example.cache.entities; import java.io.Serializable; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; @Entity public class Seller implements Serializable{ private static final long serialVersionUID = -8729652893792540271L; @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; private String name; public Seller() { } public Seller(String name) { super(); this.name = name; } public String getName() { return name; } public void setName(String name) { this.name = name; } @Override public String toString() { return "Seller [id=" + id + ", name=" + name + "]"; } }
[ "rohitfortune@gmail.com" ]
rohitfortune@gmail.com
17301232199ff17d25cc14adc5f05364d3bf2ed2
0ff10c89967b30cd646e94e9e57681f58f8db8c9
/Aim.java
68966d817edbc0b1cdd6ac625e1fa379f7a58005
[]
no_license
EliteSpud/BlockBreaker
8a135ff52e3588c8be174cbd0c427450922a92dd
e044fa64f91bc51fe3e13dca2a791eda3b051ba2
refs/heads/master
2020-03-12T22:28:52.790074
2018-05-22T12:37:25
2018-05-22T12:37:25
130,848,071
0
0
null
null
null
null
UTF-8
Java
false
false
608
java
import javafx.scene.shape.Line; import javafx.scene.paint.Paint; import javafx.scene.layout.Pane; public class Aim { Line line; Pane leftPane; int fireX; int fireY; public void drawLine(double x,double y,BuildGUI bg) { System.out.println("drawLine :"+x+","+y); line = bg.getLine(); line.setStartX((double)bg.getBallCenterX()); line.setStartY((double)bg.getBallCenterY()); line.setEndX(x); line.setEndY(y); line.setStroke(Paint.valueOf("DDDDDD")); leftPane = bg.getLeftPane(); leftPane.getChildren().remove(line); leftPane.getChildren().add(line); bg.setAimed(true); } }
[ "37165449+EliteSpud@users.noreply.github.com" ]
37165449+EliteSpud@users.noreply.github.com
31839c9409333b86a989e36647ddcc4de2a8cc3e
df7ee9d63808b691704e5402e6218b57a9686994
/PingPong/src/main/java/PingPong/Ping.java
7762b9f569e557a2bcb3d839c7e08abf5e982045
[]
no_license
DnlVldz-git/Practicas
d305af74f15d499ba2bcda02826375c43d42e0ee
1881dcddff4e7a18c1731598ba097468cd6a5098
refs/heads/main
2023-05-12T08:50:11.609815
2021-05-30T23:43:05
2021-05-30T23:43:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
913
java
package PingPong; import java.util.logging.Level; import java.util.logging.Logger; /* * 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. */ /** * * @author dani_ */ public class Ping extends Thread { private Semaforo semaforo; public Ping(Semaforo semaforo) { this.semaforo = semaforo; } @Override public void run() { while (true) { try { Thread.sleep(70); if (!semaforo.isSemaforo()) { System.out.println("PING"); semaforo.setSemaforo(true); } yield(); } catch (InterruptedException ex) { Logger.getLogger(Ping.class.getName()).log(Level.SEVERE, null, ex); } } } }
[ "dani_wii20@hotmail.com" ]
dani_wii20@hotmail.com
8ef60c4128a13d184cebd79cbf0c6cb07486852e
a570b49f8a40f2e3de4bce0241b7136f3f677fe5
/PokemonJSON/app/src/androidTest/java/udacity/pokemon/ExampleInstrumentedTest.java
ab71117ccbfeff9566144dd5f19350d44eb79e74
[ "Apache-2.0" ]
permissive
fabiotp91/Android-Basics-Nanodegree
f4674bc4c3d5c17deea8c54b72487465987185f2
673da43cb5b6191b466a7d77baf0e2fb3cfde281
refs/heads/master
2021-04-29T15:14:14.181435
2018-07-04T18:48:28
2018-07-04T18:48:28
121,793,371
1
1
null
null
null
null
UTF-8
Java
false
false
734
java
package udacity.pokemon; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumentation test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("udacity.pokemon", appContext.getPackageName()); } }
[ "fabiotrilhopereira@gmail.com" ]
fabiotrilhopereira@gmail.com
8be2196ba48ceba12ea238a295872dd1842edc1b
1fff964be93a27a60e2141466612cc7798c92815
/cipher/Caesar.java
18a22792a5fca429e4a2ff1972a45c9956ca3cab
[]
no_license
AlexSafatli/GammaMessenger
2be47c3493935c0ac18db88501c0cbc3c611a202
0f1078d5e945f01eca7a085767dbf9d7488adf19
refs/heads/master
2021-01-10T20:36:08.707296
2012-04-03T17:06:38
2012-04-03T17:06:38
3,475,049
1
0
null
null
null
null
UTF-8
Java
false
false
4,356
java
// A class dedicated to encoding and decoding // a Message into a CodedMessage, or vice versa, // respectively using both a classical and // modern implementation of the Caesar Cipher. package cipher; public class Caesar implements Cipher { // Attributes private int shift=3; // While the conventional Caesar cipher // employs a shift of 3, this class allows // for a Shift Cipher of any variant shift // amount, if specified as such. // Constructor public Caesar() { } public Caesar(int s) { shift = s; } // Get, set methods. public int getShift() { return shift; } public void setShift(int s) { shift = s; } // Encoding methods. public CodedMessage encode(String plaintext) { return new CodedMessage(cipher(plaintext.toCharArray())); } public CodedMessage encode(Message plaintext) { return new CodedMessage(cipher(plaintext.getCharArray()), plaintext.getSender(), plaintext.getTime()); } public CodedMessage encodeAlpha(String plaintext) { return new CodedMessage(cipherAlpha(plaintext.toCharArray())); } public CodedMessage encodeAlpha(Message plaintext) { return new CodedMessage(cipherAlpha(plaintext.getCharArray()), plaintext.getSender(), plaintext.getTime()); } private char[] cipher(char[] plaintext) { // The char primitive data type in Java contains // all 65535 characters of the Unicode character set. // Therefore, a modulus is done in the off-chance that // the addition of two characters takes us out of those // bounds. char[] ciphertext = new char[plaintext.length]; for (int i = 0; i < plaintext.length; i++) ciphertext[i] = (char)((plaintext[i] + shift)%UNICODE); return ciphertext; } private char[] cipherAlpha(char[] plaintext) { // Performs the encoding by ignoring all non-alphabet // characters and leaving them as they are, and then encoding // all alphabet characters modulo 26 (i.e. wraps them around // the alphabet); this is the conventional Caesar cipher. char[] ciphertext = new char[plaintext.length]; for (int i = 0; i < plaintext.length; i++) { if (Character.isLetter(plaintext[i])) { int result = ((Character.getNumericValue(plaintext[i])-10) + shift)%26; result += (Character.isUpperCase(plaintext[i])) ? UPPERCASE : LOWERCASE; // Correct case. ciphertext[i] = (char)(result); } else ciphertext[i] = plaintext[i]; } return ciphertext; } // Decoding methods. public Message decode(String plaintext) { return new Message(decipher(plaintext.toCharArray())); } public Message decode(CodedMessage plaintext) { return new Message(decipher(plaintext.getMessage().toCharArray()), plaintext.getSender(), plaintext.getTime()); } public Message decodeAlpha(String plaintext) { return new Message(decipherAlpha(plaintext.toCharArray())); } public Message decodeAlpha(CodedMessage plaintext) { return new Message(decipherAlpha(plaintext.getMessage().toCharArray()), plaintext.getSender(), plaintext.getTime()); } private char[] decipher(char[] ciphertext) { // The char primitive data type in Java contains // all 65535 characters of the Unicode character set. // Therefore, checks are done to ensure a wrapping around // when subtracting. char[] plaintext = new char[ciphertext.length]; for (int i = 0; i < ciphertext.length; i++) { int result = (ciphertext[i] - shift); result = (result < 0) ? UNICODE+result : result; plaintext[i] = (char)(result); } return plaintext; } private char[] decipherAlpha(char[] ciphertext) { // Performs the decoding by ignoring all non-alphabet // characters and leaving them as they are, and then decoding // all alphabet characters modulo 26 (i.e. wraps them around // the alphabet); this is the conventional Caesar cipher. char[] plaintext = new char[ciphertext.length]; for (int i = 0; i < ciphertext.length; i++) { if (Character.isLetter(ciphertext[i])) { int result = ((Character.getNumericValue(ciphertext[i])-10) - shift)%26; result = (result<0) ? 26+result : result; result += (Character.isUpperCase(ciphertext[i])) ? UPPERCASE : LOWERCASE; // Correct case. plaintext[i] = (char)(result); } else plaintext[i] = ciphertext[i]; } return plaintext; } }
[ "iltafas@gmail.com" ]
iltafas@gmail.com
e3e11c2c64e151979f8f8fc36880db77b2f7d3ce
a1780458ec351ac03e1d77f4425c4cdbba38f013
/dbflute-jdk15-example/src/main/java/com/example/dbflute/spring/dbflute/cbean/cq/ciq/VendorCheckCIQ.java
6249888c4ea2ebb84c1b9663a586c384751f4c42
[]
no_license
seasarorg/dbflute-jdk15
4ed513486277c5f79ed2de5ff4a6eeeaaf84e0ff
ee920d7580d89725ded68c958b6788da0d574bd2
refs/heads/master
2018-12-28T05:27:19.388357
2014-01-18T11:49:23
2014-01-18T11:49:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,153
java
/* * Copyright(c) DBFlute TestCo.,TestLtd. All Rights Reserved. */ package com.example.dbflute.spring.dbflute.cbean.cq.ciq; import org.seasar.dbflute.cbean.*; import org.seasar.dbflute.cbean.ckey.*; import org.seasar.dbflute.cbean.coption.ConditionOption; import org.seasar.dbflute.cbean.cvalue.ConditionValue; import org.seasar.dbflute.cbean.sqlclause.SqlClause; import org.seasar.dbflute.exception.IllegalConditionBeanOperationException; import com.example.dbflute.spring.dbflute.cbean.*; import com.example.dbflute.spring.dbflute.cbean.cq.bs.*; import com.example.dbflute.spring.dbflute.cbean.cq.*; /** * The condition-query for in-line of VENDOR_CHECK. * @author DBFlute(AutoGenerator) */ public class VendorCheckCIQ extends AbstractBsVendorCheckCQ { // =================================================================================== // Attribute // ========= protected BsVendorCheckCQ _myCQ; // =================================================================================== // Constructor // =========== public VendorCheckCIQ(ConditionQuery childQuery, SqlClause sqlClause , String aliasName, int nestLevel, BsVendorCheckCQ myCQ) { super(childQuery, sqlClause, aliasName, nestLevel); _myCQ = myCQ; _foreignPropertyName = _myCQ.xgetForeignPropertyName(); // accept foreign property name _relationPath = _myCQ.xgetRelationPath(); // accept relation path _inline = true; } // =================================================================================== // Override about Register // ======================= @Override protected void reflectRelationOnUnionQuery(ConditionQuery bq, ConditionQuery uq) { String msg = "InlineView must not need UNION method: " + bq + " : " + uq; throw new IllegalConditionBeanOperationException(msg); } @Override protected void setupConditionValueAndRegisterWhereClause(ConditionKey k, Object v, ConditionValue cv, String col) { regIQ(k, v, cv, col); } @Override protected void setupConditionValueAndRegisterWhereClause(ConditionKey k, Object v, ConditionValue cv, String col, ConditionOption op) { regIQ(k, v, cv, col, op); } @Override protected void registerWhereClause(String wc) { registerInlineWhereClause(wc); } @Override protected boolean isInScopeRelationSuppressLocalAliasName() { if (_onClause) { throw new IllegalConditionBeanOperationException("InScopeRelation on OnClause is unsupported."); } return true; } // =================================================================================== // Override about Query // ==================== protected ConditionValue getCValueVendorCheckId() { return _myCQ.getVendorCheckId(); } protected ConditionValue getCValueTypeOfChar() { return _myCQ.getTypeOfChar(); } protected ConditionValue getCValueTypeOfVarchar() { return _myCQ.getTypeOfVarchar(); } protected ConditionValue getCValueTypeOfClob() { return _myCQ.getTypeOfClob(); } protected ConditionValue getCValueTypeOfText() { return _myCQ.getTypeOfText(); } protected ConditionValue getCValueTypeOfNumericInteger() { return _myCQ.getTypeOfNumericInteger(); } protected ConditionValue getCValueTypeOfNumericBigint() { return _myCQ.getTypeOfNumericBigint(); } protected ConditionValue getCValueTypeOfNumericDecimal() { return _myCQ.getTypeOfNumericDecimal(); } protected ConditionValue getCValueTypeOfNumericIntegerMin() { return _myCQ.getTypeOfNumericIntegerMin(); } protected ConditionValue getCValueTypeOfNumericIntegerMax() { return _myCQ.getTypeOfNumericIntegerMax(); } protected ConditionValue getCValueTypeOfNumericBigintMin() { return _myCQ.getTypeOfNumericBigintMin(); } protected ConditionValue getCValueTypeOfNumericBigintMax() { return _myCQ.getTypeOfNumericBigintMax(); } protected ConditionValue getCValueTypeOfNumericSuperintMin() { return _myCQ.getTypeOfNumericSuperintMin(); } protected ConditionValue getCValueTypeOfNumericSuperintMax() { return _myCQ.getTypeOfNumericSuperintMax(); } protected ConditionValue getCValueTypeOfNumericMaxdecimal() { return _myCQ.getTypeOfNumericMaxdecimal(); } protected ConditionValue getCValueTypeOfInteger() { return _myCQ.getTypeOfInteger(); } protected ConditionValue getCValueTypeOfBigint() { return _myCQ.getTypeOfBigint(); } protected ConditionValue getCValueTypeOfDate() { return _myCQ.getTypeOfDate(); } protected ConditionValue getCValueTypeOfTimestamp() { return _myCQ.getTypeOfTimestamp(); } protected ConditionValue getCValueTypeOfTime() { return _myCQ.getTypeOfTime(); } protected ConditionValue getCValueTypeOfBoolean() { return _myCQ.getTypeOfBoolean(); } protected ConditionValue getCValueTypeOfBinary() { return _myCQ.getTypeOfBinary(); } protected ConditionValue getCValueTypeOfBlob() { return _myCQ.getTypeOfBlob(); } protected ConditionValue getCValueTypeOfUuid() { return _myCQ.getTypeOfUuid(); } protected ConditionValue getCValueTypeOfArray() { return _myCQ.getTypeOfArray(); } protected ConditionValue getCValueTypeOfOther() { return _myCQ.getTypeOfOther(); } protected ConditionValue getCValueJAVABeansProperty() { return _myCQ.getJAVABeansProperty(); } protected ConditionValue getCValueJPopBeansProperty() { return _myCQ.getJPopBeansProperty(); } public String keepScalarCondition(VendorCheckCQ subQuery) { throwIICBOE("ScalarCondition"); return null; } public String keepMyselfExists(VendorCheckCQ subQuery) { throwIICBOE("MyselfExists"); return null;} public String keepMyselfInScope(VendorCheckCQ subQuery) { throwIICBOE("MyselfInScope"); return null;} protected void throwIICBOE(String name) { // throwInlineIllegalConditionBeanOperationException() throw new IllegalConditionBeanOperationException(name + " at InlineView is unsupported."); } // =================================================================================== // Very Internal // ============= // very internal (for suppressing warn about 'Not Use Import') protected String xinCB() { return VendorCheckCB.class.getName(); } protected String xinCQ() { return VendorCheckCQ.class.getName(); } }
[ "dbflute@gmail.com" ]
dbflute@gmail.com
48e5df2b68d439b4c4a75e19446d7d713eb5f54d
0e4eaad03e0d49ab948e85753c653ba35f27186c
/src/main/java/hello/TeacherBean.java
44bea84270d78acca14ab89294ce7e66851c14c7
[]
no_license
elmansy89/JSFFromScratch01
cf217872c4fd0ac165b2441c48419ab5f19a2f71
c5eb8438e901e180ff2047bca73557adc63b0f3f
refs/heads/master
2023-04-29T03:57:52.248332
2021-05-14T08:01:56
2021-05-14T08:01:56
367,292,673
0
0
null
null
null
null
UTF-8
Java
false
false
5,108
java
package hello; import DbController.DataBaseController; import DbModelBackage.ContactNumbers; import DbModelBackage.Student; import DbModelBackage.Teacher; import Wrapper.IdNameWrapper; import javax.annotation.PostConstruct; import javax.faces.application.FacesMessage; import javax.faces.bean.ManagedBean; import javax.faces.bean.SessionScoped; import javax.faces.bean.ViewScoped; import javax.faces.context.FacesContext; import java.io.Serializable; import java.util.*; @ManagedBean(name ="TeacherBean") @SessionScoped public class TeacherBean implements Serializable { private Date minDate; private Date maxDate; long oneDay; public Teacher teacher; public List<String> Governorate; public List<ContactNumbers> contactNumbersList; public boolean showAddPhoneElements ; public boolean disableAddTeacherAndAddPhoneButton; public ContactNumbers contactNumbers; public void addTeacher(Teacher teacher) { teacher.setTeJoinDate(new Date()); teacher.setTePhones(contactNumbersList); DataBaseController dataBaseController = new DataBaseController(); dataBaseController.addNewTeacher(teacher); contactNumbersList.clear(); this.teacher=new Teacher(); contactNumbers=new ContactNumbers(); } public List<Teacher> getLastAddedTeacher() { DataBaseController dataBaseController = new DataBaseController(); Teacher teacher = dataBaseController.getLastAddedTeacher(); List<Teacher> teacherList = new ArrayList<>(); teacherList.add(teacher); return teacherList; } public List<ContactNumbers> getAddedTeacherPhones() { DataBaseController dataBaseController = new DataBaseController(); Teacher teacher = dataBaseController.getLastAddedTeacher(); List<ContactNumbers> contactNumbersList=new ArrayList<>(); contactNumbersList.addAll(teacher.getTePhones()); return contactNumbersList; } public void showPhoneElement(){ showAddPhoneElements=true; disableAddTeacherAndAddPhoneButton=true; } public void savePhoneDetails(){ contactNumbersList.add(contactNumbers.clone()); showAddPhoneElements=false; disableAddTeacherAndAddPhoneButton=false; contactNumbers=new ContactNumbers(); FacesContext.getCurrentInstance() .addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Info","Phone number has been added")); } @PostConstruct public void init() { Date today = new Date(); oneDay = 24 * 60 * 60 * 1000; minDate = new Date(today.getTime() - (50*365 * oneDay)); maxDate = new Date(today.getTime() - (20*365 * oneDay)); Governorate = Arrays.asList("Alexandria", "Aswan", "Asyut", "Beheira", "Beni Suef", "Cairo", "Dakahlia", "Damietta", "Faiyum", "Gharbia", "Giza", "Ismailia", "Kafr El Sheikh", "Luxor", "Matruh", "Minya", "Monufia", "New Valley", "North Sinai", "Port Said", "Qalyubia", "Qena", "Red Sea", "Sharqia", "Sohag", "South Sinai", "Suez"); teacher =new Teacher(); contactNumbersList =new ArrayList<>(); showAddPhoneElements=false; disableAddTeacherAndAddPhoneButton=false; contactNumbers =new ContactNumbers(); } public Date getMinDate() { return minDate; } public void setMinDate(Date minDate) { this.minDate = minDate; } public Date getMaxDate() { return maxDate; } public void setMaxDate(Date maxDate) { this.maxDate = maxDate; } public long getOneDay() { return oneDay; } public void setOneDay(long oneDay) { this.oneDay = oneDay; } public Teacher getTeacher() { return teacher; } public void setTeacher(Teacher teacher) { this.teacher = teacher; } public List<String> getGovernorate() { return Governorate; } public void setGovernorate(List<String> governorate) { Governorate = governorate; } public List<ContactNumbers> getContactNumbersList() { return contactNumbersList; } public void setContactNumbersList(List<ContactNumbers> contactNumbersList) { this.contactNumbersList = contactNumbersList; } public boolean isShowAddPhoneElements() { return showAddPhoneElements; } public void setShowAddPhoneElements(boolean showAddPhoneElements) { this.showAddPhoneElements = showAddPhoneElements; } public boolean isDisableAddTeacherAndAddPhoneButton() { return disableAddTeacherAndAddPhoneButton; } public void setDisableAddTeacherAndAddPhoneButton(boolean disableAddTeacherAndAddPhoneButton) { this.disableAddTeacherAndAddPhoneButton = disableAddTeacherAndAddPhoneButton; } public ContactNumbers getContactNumbers() { return contactNumbers; } public void setContactNumbers(ContactNumbers contactNumbers) { this.contactNumbers = contactNumbers; } }
[ "m.elmansy89@gmail.com" ]
m.elmansy89@gmail.com
8d430b3f7cc5c18aeae74bb808fb6bf46391fc76
f6f2d57cba8c6b591fdf815cedb12f55429e5ede
/app/src/main/java/com/example/hassaan/leadcrm/Adapters/LeadPagerAdapter.java
601b98f5da3e30352ebeb3595dec143eb92c5015
[]
no_license
Hassaan-sane/LeadCRM
cb0394a41fb3352ac9e319fff873997d38aba935
65395f2a55f52dbc88bc1bf3e7289e74ff70852c
refs/heads/master
2020-03-30T18:56:37.592890
2018-11-05T11:50:29
2018-11-05T11:50:29
151,521,360
0
0
null
null
null
null
UTF-8
Java
false
false
1,520
java
package com.example.hassaan.leadcrm.Adapters; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentStatePagerAdapter; import com.example.hassaan.leadcrm.Fragments.AccountDetailsFragment; import com.example.hassaan.leadcrm.Fragments.HomeFragment; import com.example.hassaan.leadcrm.Fragments.LeadDetailsFragment; import com.example.hassaan.leadcrm.Fragments.LeadRelatedFragment; public class LeadPagerAdapter extends FragmentStatePagerAdapter { int mNumOfTabs; int LeadPostion; public LeadPagerAdapter(FragmentManager fm, int mNumOfTabs, int LeadPostion) { super(fm); this.mNumOfTabs = mNumOfTabs; this.LeadPostion=LeadPostion; } @Override public Fragment getItem(int i) { switch (i) { case 0: LeadDetailsFragment leadDetailsFragment = new LeadDetailsFragment(); Bundle data = new Bundle();//Use bundle to pass data data.putInt("LeadPostion",LeadPostion);//put string, int, etc in bundle with a key value leadDetailsFragment.setArguments(data); return leadDetailsFragment; case 1: LeadRelatedFragment leadRelatedFragment = new LeadRelatedFragment(); return leadRelatedFragment; default: return null; } } @Override public int getCount() { return mNumOfTabs; } }
[ "hassaanbinsajjad03@gmail.com" ]
hassaanbinsajjad03@gmail.com
864193fb5546cbbc7b04c3369c1300f8b588a6dc
d4a877437612a282a31e9811bf7c4f3d0ad5a07f
/app/src/main/java/com/tns/espapp/activity/DesignFragment.java
f083e029eb59a45e55d6fd04dc751d2e393cbd07
[]
no_license
deepak-tns/ESPAppLatest
cfa91f048f936220d934b96622232427523294b7
80aac7600a4b00b950fcff0fe4cd2f10e0e41652
refs/heads/master
2020-03-20T00:30:06.442833
2018-06-12T09:07:17
2018-06-12T09:07:17
137,046,168
0
0
null
null
null
null
UTF-8
Java
false
false
955
java
package com.tns.espapp.activity; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.tns.espapp.R; public class DesignFragment extends Fragment { public DesignFragment() { // Required empty public constructor } // TODO: Rename and change types and number of parameters public static DesignFragment newInstance(int index) { DesignFragment fragment = new DesignFragment(); Bundle args = new Bundle(); args.putInt("index", index); fragment.setArguments(args); return fragment; } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment return inflater.inflate(R.layout.fragment_design, container, false); } }
[ "deepaksachan8@gmail.com" ]
deepaksachan8@gmail.com
f99c17e6adf7c6367b944d570067819f0aaec6cb
83b2f4ce695fae9368255d1602a4620fe6029865
/src/entity/HuaguanCashOut.java
173c7f9dcd2738d7b7cf51a5b2cfe49b1cfc724f
[]
no_license
lzq817/FlowerSendWeb
4c1b2cad28270bc6df65bff3463b1479ebc7a518
c76fbf2596c6587588b9d9c16253fcb39aa9bbea
refs/heads/master
2023-01-28T04:13:56.145031
2018-04-09T13:50:02
2018-04-09T13:50:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,474
java
package entity; import java.sql.Timestamp; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name = "HUAGUAN_CASH_OUT") public class HuaguanCashOut implements java.io.Serializable { /** 版本号 */ private static final long serialVersionUID = 5869806724177150895L; /** 处理序号 */ @Id private Integer serialnumber; /** 用户id */ private String userId; /** 订单生成时间 */ private Timestamp time; /** 提现数量 */ private Integer amount; /** 提现金额 */ private Integer money; private String nickname; public String getNickname() { return nickname; } public void setNickname(String nickname) { this.nickname = nickname; } /** * 获取处理序号 * * @return 处理序号 */ public Integer getSerialnumber() { return this.serialnumber; } /** * 设置处理序号 * * @param serialnumber * 处理序号 */ public void setSerialnumber(Integer serialnumber) { this.serialnumber = serialnumber; } /** * 获取用户id * * @return 用户id */ public String getUserId() { return this.userId; } /** * 设置用户id * * @param userId * 用户id */ public void setUserId(String userId) { this.userId = userId; } /** * 获取订单生成时间 * * @return 订单生成时间 */ public Timestamp getTime() { return this.time; } /** * 设置订单生成时间 * * @param time * 订单生成时间 */ public void setTime(Timestamp time) { this.time = time; } /** * 获取提现数量 * * @return 提现数量 */ public Integer getAmount() { return this.amount; } /** * 设置提现数量 * * @param amount * 提现数量 */ public void setAmount(Integer amount) { this.amount = amount; } /** * 获取提现金额 * * @return 提现金额 */ public Integer getMoney() { return this.money; } /** * 设置提现金额 * * @param money * 提现金额 */ public void setMoney(Integer money) { this.money = money; } }
[ "l" ]
l
46685a92a6ad055d539891a2e43886c892915dad
778526a0bce5767d0743b22c3b76391b81777c8b
/src/ESelectionType.java
4ec9d664e289684f1375d6700fccd2c22d2658dc
[]
no_license
yiwzhong/ELBSA4TSP
a58b9254d357a06a787361e4b38c212449f19796
6979db262640c76dda794f9e8b864353425bf3a1
refs/heads/master
2020-07-14T16:21:02.983054
2019-10-08T00:14:24
2019-10-08T00:14:24
205,351,646
1
1
null
null
null
null
UTF-8
Java
false
false
87
java
public enum ESelectionType { RANDOM, SYSTEMATIC_SEQUENCE, SYSTEMATIC_FOLLOWING }
[ "noreply@github.com" ]
yiwzhong.noreply@github.com
af4e5933bac3290ffefefb56884e66d2ca91950d
13dbb295745241fddbc66f78e19c3d6aee9f655b
/BankAccountKata/src/main/java/com/ividata/BankAccountKata/exception/InvalidTransactionException.java
508ba4e3ced49f337b5fb4852a86098744d1fb46
[]
no_license
moradjee/WorkspaceBank
a9ac6acb02833a5b4890e8c4fea9c66496e1b205
72fdd28b744ef6fdaf40bd0974c43cf171f2b1af
refs/heads/master
2020-06-12T10:24:19.294058
2019-06-28T13:02:48
2019-06-28T13:02:48
194,270,493
0
0
null
null
null
null
UTF-8
Java
false
false
339
java
package com.ividata.BankAccountKata.exception; public class InvalidTransactionException extends Exception { /** * Author Morad MELSAOUI * Classe exception pour les traitements transactional */ private static final long serialVersionUID = 1L; public InvalidTransactionException(String message) { super(message); } }
[ "52320939+moradjee@users.noreply.github.com" ]
52320939+moradjee@users.noreply.github.com
89b7e05efcb6a803de14d16295340fdc16bcb2e3
66f97a39e799281b37cc3afb5eeff6ba60918a30
/src/tinyrenderer/math/Vector2.java
a9b9316490a01366f30dba939fecc13dbdbed145
[]
no_license
FudgeRacoon/TinyRenderer
2727d1c999c646dec11606489d3aac9e11163ef8
f9ac8d9dce052cc949e79be8b885f4f8502318fb
refs/heads/master
2023-05-12T14:31:01.886311
2021-06-01T10:42:25
2021-06-01T10:42:25
365,608,838
0
0
null
null
null
null
UTF-8
Java
false
false
2,468
java
package tinyrenderer.math; /** * Representation of 2D vectors and points. */ public class Vector2 implements Comparable<Vector2> { public float x, y; public Vector2() { this.x = 0; this.y = 0; } public Vector2(float x, float y) { this.x = x; this.y = y; } public static final Vector2 ZERO = new Vector2(); public static final Vector2 UP = new Vector2(0, 1); public static final Vector2 DOWN = new Vector2(0, -1); public static final Vector2 RIGHT = new Vector2(1, 0); public static final Vector2 LEFT = new Vector2(-1, 0); public static Vector2 Add(Vector2 v1, Vector2 v2) { return new Vector2(v1.x + v2.x, v1.y + v2.y); } public static Vector2 Sub(Vector2 v1, Vector2 v2) { return new Vector2(v1.x - v2.x, v1.y - v2.y); } public static Vector2 Mult(Vector2 v, float value) { return new Vector2(v.x * value, v.y * value); } public static Vector2 Negate(Vector2 v) { return new Vector2(-v.x, -v.y); } public static float Magnitude(Vector2 v) { return (float)Math.sqrt((v.x * v.x) + (v.y * v.y)); } public static Vector2 Normalize(Vector2 v) { return Vector2.Mult(v, 1 / Vector2.Magnitude(v)); } public static Float Dot(Vector2 v1, Vector2 v2) { return ((v1.x * v2.x) + (v1.y * v2.y)); } public static float Distance(Vector2 v1, Vector2 v2) { float diffX = v1.x - v2.x; float diffY = v1.y - v2.y; return Vector2.Magnitude(new Vector2(diffX, diffY)); } public static float Angle(Vector2 v1, Vector2 v2) { float dot = Vector2.Dot(v1, v2); float v1Mag = Vector2.Magnitude(v1); float v2Mag = Vector2.Magnitude(v2); return (float)Math.acos(dot / v1Mag * v2Mag); } public static Vector2 Lerp(Vector2 v1, Vector2 v2, float t) { Vector2 result = Vector2.Sub(v2, v1); result = Vector2.Mult(result, t); return Vector2.Add(v1, result); } @Override public int compareTo(Vector2 v) { float thisMag = Vector2.Magnitude(this); float otherMag = Vector2.Magnitude(v); if(thisMag > otherMag) return 1; else if(thisMag < otherMag) return -1; else return 0; } @Override public String toString() { return this.x + " " + this.y; } }
[ "fudgeracoon@gmail.com" ]
fudgeracoon@gmail.com
a610aad9466501da8f22802f78335ed32abbfcdc
71bbbed252336ab60ef2d43fee215d05ea2dc736
/eHealthSystemRest/src/main/java/nirmalya/aatithya/restmodule/common/utils/GenerateReceptionDocumentUploadParameter.java
8301772458ed8a9caedc0daadfa7a1e05edd0ec5
[]
no_license
amarendra108/ehealthsystemamar
9d3617194030c12c8aca88b2716510308315f1f8
ff283dfa5796636dffbf78e706d6e612e081c5ac
refs/heads/main
2023-08-21T09:20:04.709191
2021-10-22T17:13:48
2021-10-22T17:13:48
420,140,538
0
1
null
null
null
null
UTF-8
Java
false
false
946
java
package nirmalya.aatithya.restmodule.common.utils; import nirmalya.aatithya.restmodule.reception.model.RestReceptionProfileDocumentModel; import nirmalya.aatithya.restmodule.reception.model.RestReceptionProfileModel; public class GenerateReceptionDocumentUploadParameter { public static String getdrDataUpload(RestReceptionProfileModel doctor) { String s = ""; String document = ""; for (RestReceptionProfileDocumentModel a : doctor.getDocumentList()) { //System.out.println("doctor.getRoleId()"+doctor.getRoleId()); document = document + "(\'"+doctor.getRoleId()+ "\',\'" + doctor.getDoctorId()+ "\',\'" + a.getDocumnentName() + "\',\'" + a.getFileName() + "\'),"; } document = document.substring(0, document.length() - 1); s = s + "" + document + ","; if (s != "") { s = s.substring(0, s.length() - 1); } System.out.println("Generate Parameter"+s); return s; } }
[ "84181098+amarendra108@users.noreply.github.com" ]
84181098+amarendra108@users.noreply.github.com
b9dcecc0a119d57d51ba851db9e1572f4cd27390
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/29/29_aae849bfcc32353d039fc4ecd3b086dcbc3a5d1b/HttpServer/29_aae849bfcc32353d039fc4ecd3b086dcbc3a5d1b_HttpServer_t.java
52bfdee4ebf74774be53d262852869368430700c
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
6,445
java
import java.io.*; import java.text.*; import java.net.*; import java.util.*; import java.nio.file.*; import javax.activation.*; public class HttpServer { // Defualt Port set to 8080 private static int port = 8080; public static void main(String args[]) throws Exception{ /* Reads in the Args from the project call * Will read in all args, does not matter the order as * long as each call is preceded by the proper - identifier * Will set the log file, doc root, and port properly * if no port, port is preset to 8080. */ String docroot = System.getProperty("user.dir"); //set default directory String logfile = ""; for(int x = 0; x < args.length; x++){ switch(args[x]){ case"-p":{ x++; port = Integer.parseInt(args[x]); break; }case"-docroot":{ x++; docroot = args[x]; break; }case"-logfile":{ x++; logfile = args[x]; break; }default:{ System.out.println("Error reading args"); } } } ServerSocket listener = new ServerSocket(port); System.out.println("HTTP server is running on port " + port + "."); while(true){ Socket s = listener.accept(); Clienthandler c = new Clienthandler(s, docroot, logfile); Thread t = new Thread(c); t.start(); } } } class Clienthandler implements Runnable{ Socket connection; int length; String line; String mimeType; String date; String lastMod; String directory; File file; FileWriter filewrite; BufferedWriter out; StringTokenizer st; byte[] fileBytes; BufferedReader clientRequest; DataOutputStream clientReply; static SimpleDateFormat dateFormat = new SimpleDateFormat( "EEE, dd MMM yyyy HH:mm:ss z", Locale.US); boolean valid = false; Clienthandler(Socket s, String docroot, String logfile){ connection = s; file = new File(logfile); try { filewrite = new FileWriter(logfile); } catch (IOException e1) { e1.printStackTrace(); } out = new BufferedWriter(filewrite); directory = docroot; try{ connection.setKeepAlive(false); }catch(Exception e){ System.out.println("Error at socket creation"); } } public void run(){ try{ boolean open = true; clientRequest = new BufferedReader(new InputStreamReader(connection.getInputStream())); clientReply = new DataOutputStream(connection.getOutputStream()); line = clientRequest.readLine(); System.out.println(line); ///////////////// valid = line.startsWith("GET"); System.out.println(valid); //////////////// if(!valid) sendNotImplemented(); if(!parseRequest()) sendNotFound(); URLConnection url = new URLConnection("");//not working yet mimeType = URLConnection.getContentType(); System.out.println("Type: " + mimeType);//////////// length = URLConnection.getContentLength(); System.out.println("Length: " + length);///////// fileBytes = Files.readAllBytes(file.toPath()); lastMod = getLastModified(); System.out.println(lastMod); /////////////// date = getServerTime(); System.out.println(date);///////////////// System.out.println(mimeType + " " + lastMod + " " + date); sendValidResponse(); connection.close(); }catch(Exception e){ System.out.println("Error running."); } } private synchronized void sendNotImplemented(){ try{ clientReply.writeBytes("501 Not Implemented"); clientReply.flush(); connection.close(); }catch(Exception e){ System.out.println("Error sending 501."); } } private synchronized void sendNotFound(){ try{ clientReply.writeBytes("HTTP/1.1 404 Not Found\r\n"); clientReply.writeBytes("Date: " + date + "\r\n"); clientReply.writeBytes("Connection: close\r\n"); clientReply.writeBytes("\r\n"); clientReply.writeBytes("404 File Not Found\n\n"); clientReply.writeBytes("The server was unable to find the file requested."); clientReply.flush(); connection.close(); }catch(Exception e){ System.out.println("Error sending 404."); } } private synchronized void sendValidResponse(){ try{ clientReply.writeBytes("HTTP/1.1 200 OK\r\n"); writeToLog("HTTP/1.1 200 OK\r\n"); clientReply.writeBytes("Content-Type: " + mimeType + "\r\n"); writeToLog("Content-Type: " + mimeType + "\r\n"); clientReply.writeBytes("Last-Modified: " + lastMod + "\r\n"); writeToLog("Last-Modified: " + lastMod + "\r\n"); clientReply.writeBytes("Date: " + date + "\r\n"); writeToLog("Date: " + date + "\r\n"); clientReply.writeBytes("Length: " + length + "\r\n"); writeToLog("Length: " + length + "\r\n"); if(connection.getKeepAlive()){ clientReply.writeBytes("Connection: keep-alive\r\n"); }else{ clientReply.writeBytes("Connection: close\r\n"); } clientReply.writeBytes("\r\n"); for(int i = 0; i < fileBytes.length; i++){ clientReply.write(fileBytes[i]); } clientReply.flush(); connection.close(); }catch(Exception e){ System.out.println("Error sending 200."); } } private boolean parseRequest(){ String temp; try{ line = line.substring(3); System.out.println(line); ///////// st = new StringTokenizer(line); temp = st.nextToken(); file = new File(temp.substring(1)); System.out.println(file.toString()); ///////// st.nextToken(); clientRequest.readLine(); line = clientRequest.readLine(); System.out.println(line); ///////// st = new StringTokenizer(line); st.nextToken(); if(st.nextToken().equals("keep-alive")){ connection.setSoTimeout(20000); } writeToLog("Request: " + line); }catch(Exception e){ System.out.println("Error parsing request."); } return file.exists(); } private synchronized void writeToLog(String s){ try { out.write(s); } catch (IOException e) { e.printStackTrace(); } if(s.equals("Close Log")){ try { out.close(); } catch (IOException e) { e.printStackTrace(); } } } private String getLastModified(){ dateFormat.setTimeZone(TimeZone.getTimeZone("GMT")); return dateFormat.format(file.lastModified()); } private String getServerTime() { Calendar calendar = Calendar.getInstance(); dateFormat.setTimeZone(TimeZone.getTimeZone("GMT")); return dateFormat.format(calendar.getTime()); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
b36d289ae413189c1d042f80b3a63892d10dc092
58a8ed34f613c281a5faaaefe5da1788f5739d17
/Application_code_source/eMybaby/sources/a/c/d/m/f/f.java
90b7d50d11ba747516cbd6efbfe29101ec960fc2
[]
no_license
wagnerwave/Dossier_Hacking_de_peluche
01c78629e52a94ed6a208e11ff7fcd268e10956e
514f81b1e72d88e2b8835126b2151e368dcad7fb
refs/heads/main
2023-03-31T13:28:06.247243
2021-03-25T23:03:38
2021-03-25T23:03:38
351,597,654
5
1
null
null
null
null
UTF-8
Java
false
false
734
java
package a.c.d.m.f; import android.content.Intent; import android.view.View; import com.cuatroochenta.miniland.pregnancy.babyDiary.BabyDiaryActivity; import com.cuatroochenta.miniland.pregnancy.babyDiary.FormBabyDiaryEntryActivity; public class f implements View.OnClickListener { /* renamed from: a reason: collision with root package name */ public final /* synthetic */ BabyDiaryActivity f438a; public f(BabyDiaryActivity babyDiaryActivity) { this.f438a = babyDiaryActivity; } public void onClick(View view) { BabyDiaryActivity babyDiaryActivity = this.f438a; babyDiaryActivity.startActivityForResult(new Intent(babyDiaryActivity, FormBabyDiaryEntryActivity.class), 42830); } }
[ "alexandre1.wagner@epitech.eu" ]
alexandre1.wagner@epitech.eu
71b250ab3d0ffaa9b9adc5ebbb67e2a68dfe6dca
717c65b38b92f3468e64b863cbb76d29507b6140
/Kattis/torn2pieces/Main.java
6d0a3efe28ea561ea07fbbe1c17f9db941ab0640
[]
no_license
shaheedebrahim/practice-problems
53fe92ca7f685179f8b9a6fdcf1c37760ee3056b
cad502bad8f64e1197cfd9dd898daa9415537696
refs/heads/master
2020-05-22T16:47:23.770673
2017-03-20T05:22:07
2017-03-20T05:22:07
84,705,469
0
0
null
null
null
null
UTF-8
Java
false
false
3,071
java
import java.util.*; public class Main{ public static void main (String[] args){ Scanner input = new Scanner(System.in); int n = input.nextInt(); input.nextLine(); HashMap<String, ArrayList<String>> graph = new HashMap<String, ArrayList<String>>(); HashMap<String, String> parents = new HashMap<String, String>(); //Adding bidirectional for the cities is why this part is so long for (int i = 0; i < n; i++){ String line = input.nextLine(); String[] split = line.split(" "); ArrayList<String> list; if (graph.containsKey(split[0])){ list = graph.get(split[0]); }else{ list = new ArrayList<String>(); } for (int j = 1; j < split.length; j++){ if (list.indexOf(split[j]) == -1){ list.add(split[j]); ArrayList<String> valueList; if (graph.containsKey(split[j])){ valueList = graph.get(split[j]); }else{ valueList = new ArrayList<String>(); } if (valueList.indexOf(split[0]) == -1) valueList.add(split[0]); graph.put(split[j], valueList); } } graph.put(split[0], list); } Iterator<String> iter = graph.keySet().iterator(); while (iter.hasNext()){ parents.put(iter.next(), ""); } String line = input.nextLine(); parents = bfs(line.split(" ")[0], line.split(" ")[1], parents, graph); if (parents == null){ System.out.println("no route found"); }else{ ArrayList<String> path = new ArrayList<String>(); String parent = line.split(" ")[1]; while (!parent.equals("")){ path.add(parent); parent = parents.get(parent); } Collections.reverse(path); for (String s : path){ System.out.print(s +" "); } } } public static HashMap<String, String> bfs (String start, String end, HashMap<String, String> p, HashMap<String, ArrayList<String>> graph){ Queue<String> q = new LinkedList<String>(); HashSet visited = new HashSet<String>(); HashMap<String, String> parents = p; q.add(start); visited.add(start); while (!q.isEmpty()){ String current = q.poll(); if (current.equals(end)) return parents; ArrayList<String> neighbors = graph.get(current); if (neighbors != null){ for (String neighbor : neighbors){ if (!visited.contains(neighbor)){ visited.add(neighbor); parents.put(neighbor, current); q.add(neighbor); } } } } return null; } }
[ "shaheed_ebrahim@hotmail.com" ]
shaheed_ebrahim@hotmail.com
a9e83a936aa1495e243b7ca1ca5ebdbddb7741d6
bc95bdb5e25837d3e14a13f95b1d83cd6a34fdcf
/dbflute-spring-example/src/main/java/com/example/dbflute/spring/dbflute/exentity/customize/PmCommentHint.java
589745b9e5e6ad1abe3ae586208f129e61f97f46
[ "Apache-2.0" ]
permissive
seasarorg/dbflute-example-container
6c296135cc8bc6aeae37064621f106adc31fb76d
acb34a648eab7dbfcf50cd59a60ee95a06b26420
refs/heads/master
2022-07-20T07:21:44.095260
2019-08-04T12:43:29
2019-08-04T12:43:29
13,245,011
1
1
null
2022-06-29T19:21:49
2013-10-01T13:46:16
Java
UTF-8
Java
false
false
1,099
java
/* * Copyright 2004-2014 the Seasar Foundation and the Others. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package com.example.dbflute.spring.dbflute.exentity.customize; import com.example.dbflute.spring.dbflute.bsentity.customize.BsPmCommentHint; /** * The entity of PmCommentHint. * <p> * You can implement your original methods here. * This class remains when re-generating. * </p> * @author DBFlute(AutoGenerator) */ public class PmCommentHint extends BsPmCommentHint { /** Serial version UID. (Default) */ private static final long serialVersionUID = 1L; }
[ "dbflute@gmail.com" ]
dbflute@gmail.com
b03995dc7634c7bf6082628b388fda0d02ffdc07
81b373ec4dacda89556163856876c72a98cd7aab
/interest_engine/src/main/java/com/interest/model/UpPlaylistSong.java
4f326f5c26aafca687754bbe092595e077b34c9e
[]
no_license
xutao1989103/interest_graph
26d2fee08e8a508250b17951bbae4e72429826ea
f9c49a897cd8d9e64536b764f76f790b6002c3c0
refs/heads/master
2020-05-27T00:55:18.310439
2015-05-13T06:48:00
2015-05-13T06:48:00
33,297,770
3
0
null
null
null
null
UTF-8
Java
false
false
1,299
java
package com.interest.model; /** * Created by 431 on 2015/4/25. */ public class UpPlaylistSong { private String artist; private String title; private String album; private Integer playTimes; private Long duration; private boolean like; private boolean dislike; public String getArtist() { return artist; } public void setArtist(String artist) { this.artist = artist; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getAlbum() { return album; } public void setAlbum(String album) { this.album = album; } public Integer getPlayTimes() { return playTimes; } public void setPlayTimes(Integer playTimes) { this.playTimes = playTimes; } public Long getDuration() { return duration; } public void setDuration(Long duration) { this.duration = duration; } public boolean isLike() { return like; } public void setLike(boolean like) { this.like = like; } public boolean isDislike() { return dislike; } public void setDislike(boolean dislike) { this.dislike = dislike; } }
[ "xutao1989103@gmail.com" ]
xutao1989103@gmail.com
732dd03aa2f750acdef24cb21548836ad3d6ffaa
651124f882a9e8024fdaaef9184fc0e5d3eed31a
/app/src/main/java/com/actiknow/clearsale/utils/VerticalViewPager.java
6470a81df769db1ae6c02be64035a6a5d709f230
[]
no_license
actimobiledev/ClearSale
9370b5cff0f747e5492eb23dfd9a918261ae4508
c361d07c4a59b14b0d4a256cf417bc8f1dd14ca6
refs/heads/master
2021-01-21T18:29:12.901119
2017-06-12T11:51:44
2017-06-12T11:51:44
92,051,630
1
1
null
null
null
null
UTF-8
Java
false
false
1,143
java
package com.actiknow.clearsale.utils; import android.content.Context; import android.support.v4.view.ViewPager; import android.util.AttributeSet; import android.view.MotionEvent; /** * Created by deming_huang on 2016/3/25. */ public class VerticalViewPager extends ViewPager { public VerticalViewPager(Context context) { super(context); } public VerticalViewPager(Context context, AttributeSet attrs) { super(context, attrs); } public MotionEvent swapTouchEvent(MotionEvent event) { float width = getWidth(); float height = getHeight(); float swapX = (event.getY() / height) * width; float swapY = (event.getX() / width) * height; event.setLocation(swapX, swapY); return event; } @Override public boolean onInterceptTouchEvent(MotionEvent event) { boolean intercept = super.onInterceptTouchEvent(swapTouchEvent(event)); swapTouchEvent(event); return intercept; } @Override public boolean onTouchEvent(MotionEvent event) { swapTouchEvent(event); return super.onTouchEvent(event); } }
[ "actiknow.mobiledev@gmail.com" ]
actiknow.mobiledev@gmail.com
5113c7f268d077fde1452ebf9d640b341cb31f75
2a6e33b1ddf5c17d8300c95041ec8589b30f405f
/Komunikator/app/src/androidTest/java/com/example/leszek/komunikator/ApplicationTest.java
f000db7bfd88a6bc3d96dc572107dedafd62b6f2
[]
no_license
Nehood/Android
34300f381cb257eeee126d0f395ddceba0ca58c4
ab4e31b37f7a4e9ed483790b18aa5b4a3eb0add6
refs/heads/master
2021-01-17T16:04:05.426377
2016-08-20T06:53:32
2016-08-20T06:53:32
63,854,473
0
0
null
null
null
null
UTF-8
Java
false
false
361
java
package com.example.leszek.komunikator; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
[ "gorkiewiczm@gmail.com" ]
gorkiewiczm@gmail.com
1b3a6695bc8b146e8646bb0999b30ab984df38bb
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/openhab--openhab1-addons/f83d6b2fbec4ac5fea8bebe2f57fb7f4469d5403/after/IhcResourceInteractionService.java
2135d4e649c8fc65fdc2cd52a4e30f364a7e7150
[]
no_license
fracz/refactor-extractor
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
dd5e82bfcc376e74a99e18c2bf54c95676914272
refs/heads/master
2021-01-19T06:50:08.211003
2018-11-30T13:00:57
2018-11-30T13:00:57
87,353,478
0
0
null
null
null
null
UTF-8
Java
false
false
21,080
java
/** * Copyright (c) 2010-2015, openHAB.org and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ package org.openhab.binding.ihc.ws; import java.io.ByteArrayInputStream; import java.io.InputStream; import java.io.UnsupportedEncodingException; import java.net.SocketTimeoutException; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import javax.xml.namespace.NamespaceContext; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpression; import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathFactory; import org.apache.commons.lang.StringUtils; import org.openhab.binding.ihc.ws.datatypes.WSBaseDataType; import org.openhab.binding.ihc.ws.datatypes.WSBooleanValue; import org.openhab.binding.ihc.ws.datatypes.WSDateValue; import org.openhab.binding.ihc.ws.datatypes.WSEnumValue; import org.openhab.binding.ihc.ws.datatypes.WSFloatingPointValue; import org.openhab.binding.ihc.ws.datatypes.WSIntegerValue; import org.openhab.binding.ihc.ws.datatypes.WSResourceValue; import org.openhab.binding.ihc.ws.datatypes.WSTimeValue; import org.openhab.binding.ihc.ws.datatypes.WSTimerValue; import org.openhab.binding.ihc.ws.datatypes.WSWeekdayValue; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.InputSource; /** * Class to handle IHC / ELKO LS Controller's resource interaction service. * * Service is used to fetch or update resource values from/to controller. * * @author Pauli Anttila * @since 1.5.0 */ public class IhcResourceInteractionService extends IhcHttpsClient { private String url; private int timeout; IhcResourceInteractionService(String host, int timeout) { url = "https://" + host + "/ws/ResourceInteractionService"; this.timeout = timeout; super.setConnectTimeout(timeout); } /** * Query resource value from controller. * * * @param resoureId * Resource Identifier. * @return Resource value. */ public WSResourceValue resourceQuery(int resoureId) throws IhcExecption { final String soapQuery = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">" + "<soapenv:Body>" + " <ns1:getRuntimeValue1 xmlns:ns1=\"utcs\">%s</ns1:getRuntimeValue1>" + "</soapenv:Body>" + "</soapenv:Envelope>"; String query = String.format(soapQuery, String.valueOf(resoureId)); openConnection(url); String response = sendQuery(query, timeout); closeConnection(); NodeList nodeList; try { nodeList = parseList(response, "/SOAP-ENV:Envelope/SOAP-ENV:Body/ns1:getRuntimeValue2"); if (nodeList.getLength() == 1) { WSResourceValue val = parseResourceValue(nodeList.item(0), 2); if (val.getResourceID() == resoureId) { return val; } else { throw new IhcExecption("No resource id found"); } } else { throw new IhcExecption("No resource value found"); } } catch (XPathExpressionException e) { throw new IhcExecption(e); } catch (UnsupportedEncodingException e) { throw new IhcExecption(e); } } private NodeList parseList(String xml, String xpathExpression) throws XPathExpressionException, UnsupportedEncodingException { InputStream is = new ByteArrayInputStream(xml.getBytes("UTF8")); XPath xpath = XPathFactory.newInstance().newXPath(); InputSource inputSource = new InputSource(is); xpath.setNamespaceContext(new NamespaceContext() { public String getNamespaceURI(String prefix) { if (prefix == null) throw new NullPointerException("Null prefix"); else if ("SOAP-ENV".equals(prefix)) return "http://schemas.xmlsoap.org/soap/envelope/"; else if ("ns1".equals(prefix)) return "utcs"; else if ("ns2".equals(prefix)) return "utcs.values"; return null; } public String getPrefix(String uri) { return null; } @SuppressWarnings("rawtypes") public Iterator getPrefixes(String uri) { throw new UnsupportedOperationException(); } }); return (NodeList) xpath.evaluate(xpathExpression, inputSource, XPathConstants.NODESET); } private WSResourceValue parseResourceValue(Node n, int index) throws XPathExpressionException { // parse resource id String resourceId = getValue(n, "ns1:resourceID"); if (StringUtils.isNotBlank(resourceId)) { int id = Integer.parseInt(resourceId); // Parse floating point value String value = getValue(n, "ns1:value/ns" + index + ":floatingPointValue"); if (StringUtils.isNotBlank(value)) { WSFloatingPointValue val = new WSFloatingPointValue(); val.setResourceID(id); val.setFloatingPointValue(Double.valueOf(value)); value = getValue(n, "ns1:value/ns" + index + ":maximumValue"); if (StringUtils.isNotBlank(value)) { val.setMaximumValue(Double.valueOf(value)); } value = getValue(n, "ns1:value/ns" + index + ":minimumValue"); if (StringUtils.isNotBlank(value)) { val.setMinimumValue(Double.valueOf(value)); } return val; } // Parse boolean value value = getValue(n, "ns1:value/ns" + index + ":value"); if (StringUtils.isNotBlank(value)) { WSBooleanValue val = new WSBooleanValue(); val.setResourceID(id); val.setValue(Boolean.valueOf(value)); return val; } // Parse integer value value = getValue(n, "ns1:value/ns" + index + ":integer"); if (StringUtils.isNotBlank(value)) { WSIntegerValue val = new WSIntegerValue(); val.setResourceID(id); val.setInteger(Integer.valueOf(value)); value = getValue(n, "ns1:value/ns" + index + ":maximumValue"); if (StringUtils.isNotBlank(value)) { val.setMaximumValue(Integer.valueOf(value)); } value = getValue(n, "ns1:value/ns" + index + ":minimumValue"); if (StringUtils.isNotBlank(value)) { val.setMinimumValue(Integer.valueOf(value)); } return val; } // Parse timer value value = getValue(n, "ns1:value/ns" + index + ":milliseconds"); if (StringUtils.isNotBlank(value)) { WSTimerValue val = new WSTimerValue(); val.setResourceID(id); val.setMilliseconds(Integer.valueOf(value)); return val; } // Parse time value value = getValue(n, "ns1:value/ns" + index + ":hours"); if (StringUtils.isNotBlank(value)) { WSTimeValue val = new WSTimeValue(); val.setResourceID(id); val.setHours(Integer.valueOf(value)); value = getValue(n, "ns1:value/ns" + index + ":minutes"); if (StringUtils.isNotBlank(value)) { val.setMinutes(Integer.valueOf(value)); } value = getValue(n, "ns1:value/ns" + index + ":seconds"); if (StringUtils.isNotBlank(value)) { val.setSeconds(Integer.valueOf(value)); } return val; } // Parse date value value = getValue(n, "ns1:value/ns" + index + ":day"); if (StringUtils.isNotBlank(value)) { WSDateValue val = new WSDateValue(); val.setResourceID(id); val.setDay(Byte.valueOf(value)); value = getValue(n, "ns1:value/ns" + index + ":month"); if (StringUtils.isNotBlank(value)) { val.setMonth(Byte.valueOf(value)); } value = getValue(n, "ns1:value/ns" + index + ":year"); if (StringUtils.isNotBlank(value)) { val.setYear(Short.valueOf(value)); } return val; } // Parse enum value value = getValue(n, "ns1:value/ns" + index + ":definitionTypeID"); if (StringUtils.isNotBlank(value)) { WSEnumValue val = new WSEnumValue(); val.setResourceID(id); val.setDefinitionTypeID(Integer.valueOf(value)); value = getValue(n, "ns1:value/ns" + index + ":enumValueID"); if (StringUtils.isNotBlank(value)) { val.setEnumValueID(Integer.valueOf(value)); } value = getValue(n, "ns1:value/ns" + index + ":enumName"); if (StringUtils.isNotBlank(value)) { val.setEnumName(value); } return val; } // Parse week day value value = getValue(n, "ns1:value/ns" + index + ":weekdayNumber"); if (StringUtils.isNotBlank(value)) { WSWeekdayValue val = new WSWeekdayValue(); val.setResourceID(id); val.setWeekdayNumber(Integer.valueOf(value)); return val; } throw new IllegalArgumentException("Unsupported value type"); } return null; } private String getValue(Node n, String expr) throws XPathExpressionException { XPath xpath = XPathFactory.newInstance().newXPath(); xpath.setNamespaceContext(new NamespaceContext() { public String getNamespaceURI(String prefix) { if (prefix == null) { throw new NullPointerException("Null prefix"); } else if ("SOAP-ENV".equals(prefix)) { return "http://schemas.xmlsoap.org/soap/envelope/"; } else if ("ns1".equals(prefix)) { return "utcs"; } // else if ("ns2".equals(prefix)) return "utcs.values"; return "utcs.values"; // return null; } public String getPrefix(String uri) { return null; } @SuppressWarnings("rawtypes") public Iterator getPrefixes(String uri) { throw new UnsupportedOperationException(); } }); XPathExpression pathExpr = xpath.compile(expr); return (String) pathExpr.evaluate(n, XPathConstants.STRING); } /** * Update resource value to controller. * * * @param value * Resource value. * @return True if value is successfully updated. */ public boolean resourceUpdate(WSResourceValue value) throws IhcExecption { boolean retval = false; if (value instanceof WSFloatingPointValue) { retval = resourceUpdate((WSFloatingPointValue) value); } else if (value instanceof WSBooleanValue) { retval = resourceUpdate((WSBooleanValue) value); } else if (value instanceof WSIntegerValue) { retval = resourceUpdate((WSIntegerValue) value); } else if (value instanceof WSTimerValue) { retval = resourceUpdate((WSTimerValue) value); } else if (value instanceof WSWeekdayValue) { retval = resourceUpdate((WSWeekdayValue) value); } else if (value instanceof WSEnumValue) { retval = resourceUpdate((WSEnumValue) value); } else if (value instanceof WSTimeValue) { retval = resourceUpdate((WSTimeValue) value); } else if (value instanceof WSDateValue) { retval = resourceUpdate((WSDateValue) value); } else { throw new IhcExecption("Unsupported value type " + value.getClass().toString()); } return retval; } public boolean resourceUpdate(WSBooleanValue value) throws IhcExecption { final String soapQuery = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" + "<soap:Body>" + " <setResourceValue1 xmlns=\"utcs\">" + " <value xmlns:q1=\"utcs.values\" xsi:type=\"q1:WSBooleanValue\">" + " <q1:value>%s</q1:value>" + " </value>" + " <resourceID>%s</resourceID>" + " <isValueRuntime>true</isValueRuntime>" + " </setResourceValue1>" + "</soap:Body>" + "</soap:Envelope>"; String query = String.format(soapQuery, value.isValue() ? "true" : "false", value.getResourceID()); return doResourceUpdate(query); } public boolean resourceUpdate(WSFloatingPointValue value) throws IhcExecption { final String soapQuery = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" + "<soap:Body>" + " <setResourceValue1 xmlns=\"utcs\">" + " <value xmlns:q1=\"utcs.values\" xsi:type=\"q1:WSFloatingPointValue\">" + " <q1:maximumValue>%s</q1:maximumValue>" + " <q1:minimumValue>%s</q1:minimumValue>" + " <q1:floatingPointValue>%s</q1:floatingPointValue>" + " </value>" + " <resourceID>%s</resourceID>" + " <isValueRuntime>true</isValueRuntime>" + " </setResourceValue1>" + "</soap:Body>" + "</soap:Envelope>"; String query = String.format(soapQuery, value.getMaximumValue(), value.getMinimumValue(), value.getFloatingPointValue(), value.getResourceID()); return doResourceUpdate(query); } public boolean resourceUpdate(WSIntegerValue value) throws IhcExecption { final String soapQuery = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" + "<soap:Body>" + " <setResourceValue1 xmlns=\"utcs\">" + " <value xmlns:q1=\"utcs.values\" xsi:type=\"q1:WSIntegerValue\">" + " <q1:maximumValue>%s</q1:maximumValue>" + " <q1:minimumValue>%s</q1:minimumValue>" + " <q1:integer>%s</q1:integer>" + " </value>" + " <resourceID>%s</resourceID>" + " <isValueRuntime>true</isValueRuntime>" + " </setResourceValue1>" + "</soap:Body>" + "</soap:Envelope>"; String query = String.format(soapQuery, value.getMaximumValue(), value.getMinimumValue(), value.getInteger(), value.getResourceID()); return doResourceUpdate(query); } public boolean resourceUpdate(WSTimerValue value) throws IhcExecption { final String soapQuery = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" + "<soap:Body>" + " <setResourceValue1 xmlns=\"utcs\">" + " <value xmlns:q1=\"utcs.values\" xsi:type=\"q1:WSTimerValue\">" + " <q1:milliseconds>%s</q1:milliseconds>" + " </value>" + " <resourceID>%s</resourceID>" + " <isValueRuntime>true</isValueRuntime>" + " </setResourceValue1>" + "</soap:Body>" + "</soap:Envelope>"; String query = String.format(soapQuery, value.getMilliseconds(), value.getResourceID()); return doResourceUpdate(query); } public boolean resourceUpdate(WSWeekdayValue value) throws IhcExecption { final String soapQuery = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" + "<soap:Body>" + " <setResourceValue1 xmlns=\"utcs\">" + " <value xmlns:q1=\"utcs.values\" xsi:type=\"q1:WSWeekdayValue\">" + " <q1:weekdayNumber>%s</q1:weekdayNumber>" + " </value>" + " <resourceID>%s</resourceID>" + " <isValueRuntime>true</isValueRuntime>" + " </setResourceValue1>" + "</soap:Body>" + "</soap:Envelope>"; String query = String.format(soapQuery, value.getWeekdayNumber(), value.getResourceID()); return doResourceUpdate(query); } public boolean resourceUpdate(WSEnumValue value) throws IhcExecption { final String soapQuery = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" + "<soap:Body>" + " <setResourceValue1 xmlns=\"utcs\">" + " <value xmlns:q1=\"utcs.values\" xsi:type=\"q1:WSEnumValue\">" + " <q1:definitionTypeID>%s</q1:definitionTypeID>" + " <q1:enumValueID>%s</q1:enumValueID>" + " <q1:enumName>%s</q1:enumName>" + " </value>" + " <resourceID>%s</resourceID>" + " <isValueRuntime>true</isValueRuntime>" + " </setResourceValue1>" + "</soap:Body>" + "</soap:Envelope>"; String query = String.format(soapQuery, value.getDefinitionTypeID(), value.getEnumValueID(), value.getEnumName(), value.getResourceID()); return doResourceUpdate(query); } public boolean resourceUpdate(WSTimeValue value) throws IhcExecption { final String soapQuery = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" + "<soap:Body>" + " <setResourceValue1 xmlns=\"utcs\">" + " <value xmlns:q1=\"utcs.values\" xsi:type=\"q1:WSTimeValue\">" + " <q1:hours>%s</q1:hours>" + " <q1:minutes>%s</q1:minutes>" + " <q1:seconds>%s</q1:seconds>" + " </value>" + " <resourceID>%s</resourceID>" + " <isValueRuntime>true</isValueRuntime>" + " </setResourceValue1>" + "</soap:Body>" + "</soap:Envelope>"; String query = String.format(soapQuery, value.getHours(), value.getMinutes(), value.getSeconds(), value.getResourceID()); return doResourceUpdate(query); } public boolean resourceUpdate(WSDateValue value) throws IhcExecption { final String soapQuery = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" + "<soap:Body>" + " <setResourceValue1 xmlns=\"utcs\">" + " <value xmlns:q1=\"utcs.values\" xsi:type=\"q1:WSDateValue\">" + " <q1:month>%s</q1:month>" + " <q1:year>%s</q1:year>" + " <q1:day>%s</q1:day>" + " </value>" + " <resourceID>%s</resourceID>" + " <isValueRuntime>true</isValueRuntime>" + " </setResourceValue1>" + "</soap:Body>" + "</soap:Envelope>"; String query = String.format(soapQuery, value.getMonth(), value.getYear(), value.getDay(), value.getResourceID()); return doResourceUpdate(query); } private boolean doResourceUpdate(String query) throws IhcExecption { openConnection(url); String response = sendQuery(query, timeout); closeConnection(); return Boolean.parseBoolean(WSBaseDataType.parseValue(response, "/SOAP-ENV:Envelope/SOAP-ENV:Body/ns1:setResourceValue2")); } /** * Enable resources runtime value notifications. * * @param resourceIdList * List of resource Identifiers. * @return True is connection successfully opened. */ public void enableRuntimeValueNotifications( List<? extends Integer> resourceIdList) throws IhcExecption { final String soapQueryPrefix = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" + "<soap:Body>" + "<enableRuntimeValueNotifications1 xmlns=\"utcs\">"; final String soapQuerySuffix = "</enableRuntimeValueNotifications1>" + "</soap:Body>" + "</soap:Envelope>"; String query = soapQueryPrefix; for (int i : resourceIdList) { query += "<xsd:arrayItem>" + i + "</xsd:arrayItem>"; } query += soapQuerySuffix; openConnection(url); @SuppressWarnings("unused") String response = sendQuery(query, timeout); closeConnection(); } /** * Wait runtime value notifications. * * Runtime value notification should firstly be activated by * enableRuntimeValueNotifications function. * * @param timeoutInSeconds * How many seconds to wait notifications. * @return List of received runtime value notifications. * @throws SocketTimeoutException */ public List<? extends WSResourceValue> waitResourceValueNotifications( int timeoutInSeconds) throws IhcExecption, SocketTimeoutException { final String soapQuery = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:utcs=\"utcs\">" + "<soapenv:Header/>" + "<soapenv:Body>" + " <utcs:waitForResourceValueChanges1>%s</utcs:waitForResourceValueChanges1>" + "</soapenv:Body>" + "</soapenv:Envelope>"; String query = String.format(soapQuery, timeoutInSeconds); openConnection(url); String response = sendQuery(query, timeout + timeoutInSeconds * 1000); closeConnection(); List<WSResourceValue> resourceValueList = new ArrayList<WSResourceValue>(); NodeList nodeList; try { nodeList = parseList( response, "/SOAP-ENV:Envelope/SOAP-ENV:Body/ns1:waitForResourceValueChanges2/ns1:arrayItem"); if (nodeList.getLength() == 1) { String resourceId = getValue(nodeList.item(0), "ns1:resourceID"); if (resourceId == null || resourceId == "") { throw new SocketTimeoutException(); } } for (int i = 0; i < nodeList.getLength(); i++) { int index = i + 2; WSResourceValue newVal = parseResourceValue(nodeList.item(i), index); resourceValueList.add(newVal); } return resourceValueList; } catch (XPathExpressionException e) { throw new IhcExecption(e); } catch (UnsupportedEncodingException e) { throw new IhcExecption(e); } } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
af9ee61a79bbc0eb8461ec7c6888ffc6f6c56001
dcb64d4a551470dc077b6502a2fe583e78275abc
/Fathom_com.brynk.fathom-dex2jar.src/org/java_websocket/drafts/Draft_17.java
da23031e97a9eef47d8af021e03c43ba1c7f7b05
[]
no_license
lenjonemcse/Fathom-Drone-Android-App
d82799ee3743404dd5d7103152964a2f741b88d3
f3e3f0225680323fa9beb05c54c98377f38c1499
refs/heads/master
2022-01-13T02:10:31.014898
2019-07-10T19:42:02
2019-07-10T19:42:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,129
java
package org.java_websocket.drafts; import org.java_websocket.exceptions.InvalidHandshakeException; import org.java_websocket.handshake.ClientHandshake; import org.java_websocket.handshake.ClientHandshakeBuilder; public class Draft_17 extends Draft_10 { public Draft.HandshakeState acceptHandshakeAsServer(ClientHandshake paramClientHandshake) throws InvalidHandshakeException { if (readVersion(paramClientHandshake) == 13) return Draft.HandshakeState.MATCHED; return Draft.HandshakeState.NOT_MATCHED; } public Draft copyInstance() { return new Draft_17(); } public ClientHandshakeBuilder postProcessHandshakeRequestAsClient(ClientHandshakeBuilder paramClientHandshakeBuilder) { super.postProcessHandshakeRequestAsClient(paramClientHandshakeBuilder); paramClientHandshakeBuilder.put("Sec-WebSocket-Version", "13"); return paramClientHandshakeBuilder; } } /* Location: C:\Users\c_jealom1\Documents\Scripts\Android\Fathom_com.brynk.fathom\Fathom_com.brynk.fathom-dex2jar.jar * Qualified Name: org.java_websocket.drafts.Draft_17 * JD-Core Version: 0.6.0 */
[ "jean-francois.lombardo@exfo.com" ]
jean-francois.lombardo@exfo.com
2ce48412cd2f313ea7bd4ae5894062211f9517a4
c1976e919301c2be60b2af1dc3aac0cfa3b4ffec
/src/main/java/com/smartphone/controller/HomeController.java
1001f002a00467535109a8829594cbed250a878c
[]
no_license
BrickMover/smartMobile
826a2d1fa5aff537d49e321a6c5b7570e6a01588
a3e3fbde28c3113d72e78fbb77221f0fbe195fe5
refs/heads/master
2021-01-19T06:18:56.431025
2015-01-12T12:30:25
2015-01-12T12:30:25
29,009,422
0
0
null
null
null
null
UTF-8
Java
false
false
971
java
package com.smartphone.controller; import org.springframework.mobile.device.Device; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @Controller public class HomeController { @RequestMapping(value={"/", "/home"}) public String home(Device device) { if (device.isMobile()) { System.out.println("Hello mobile user!"); } else if (device.isTablet()) { System.out.println("Hello tablet user!"); } else { System.out.println("Hello desktop user!"); } return "index"; } @RequestMapping("/mail") public String mailJump() { return "mail"; } @RequestMapping("/contacts") public String contactsJump() { return "contacts"; } @RequestMapping("/calendar") public String calendarJump() { return "calendar"; } }
[ "wangyitaocp3@163.com" ]
wangyitaocp3@163.com
1d98cc9bd5787bda4b5198d661448be73734fa2a
5345ad8f6b69fa1431a32895d9ac3ba07c31e607
/src/main/java/com/ruoyi/project/system/cultrue/controller/ServersController.java
2abdf8b60a0a02ffea03bca1c486b2964e278f4b
[ "MIT" ]
permissive
heavypig/di_xjk
35f9c0dbdfaa844d41296917ce632df9df5e611d
e46c50e608639bc0aaf7636a1a51d3c5b3181f97
refs/heads/master
2023-01-14T07:21:03.415862
2020-11-25T08:34:27
2020-11-25T08:34:27
298,728,547
0
0
null
null
null
null
UTF-8
Java
false
false
1,162
java
package com.ruoyi.project.system.cultrue.controller; import com.baidu.ueditor.ActionEnter; import org.springframework.stereotype.Controller; import org.springframework.util.ClassUtils; import org.springframework.web.bind.annotation.RequestMapping; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.PrintWriter; @Controller public class ServersController { @RequestMapping("/config") public void config(HttpServletRequest request, HttpServletResponse response) { response.setContentType("application/json"); String rootPath = ClassUtils.getDefaultClassLoader().getResource("").getPath()+"static/ueditor/jsp"; try { response.setCharacterEncoding("UTF-8"); String exec = new ActionEnter(request, rootPath).exec(); System.out.println(exec); PrintWriter writer = response.getWriter(); writer.write(new ActionEnter( request, rootPath ).exec()); writer.flush(); writer.close(); } catch (IOException e) { e.printStackTrace(); } } }
[ "chun0322@" ]
chun0322@
fa447873347bd880405d009e55f3acbf98261ea3
7375587ca055ec1b71bb9b5907eb6dba48783300
/src/tw/org/iii/mesa0515/LAB1551.java
76d5f85f8641e581019a7f589ff21a13159f4e8d
[]
no_license
jamiedream/JamieJava
984f3fff061aa41c14a146db4e91bc3ab65a9f38
23fb6b47c0f435befd409e33208c2f31e6feebb9
refs/heads/master
2020-12-08T23:50:43.127509
2016-09-19T14:12:49
2016-09-19T14:12:49
66,894,291
0
0
null
null
null
null
UTF-8
Java
false
false
640
java
package tw.org.iii.mesa0515; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetAddress; import java.net.SocketException; //同一網域接收 public class LAB1551 { public static void main(String[] args) { String x = "Hello!!哈哈"; byte[] buf = x.getBytes(); try { DatagramSocket socket = new DatagramSocket(); DatagramPacket packet = new DatagramPacket(buf, buf.length, InetAddress.getByName("10.1.6.65"), 8888); socket.send(packet); System.out.println("SENT OK"); socket.close(); } catch (Exception e) { System.out.println("Sent Fail"); } } }
[ "jamie78831@gmail.com" ]
jamie78831@gmail.com
0388add15cf40a8e076d85b4981518e9051aa039
108cafd377f0acbc608b8b735c11dec5ee2d056f
/HarvesterProject/src/net/quantium/harvester/screen/components/BackButton.java
396b90d184ee559573a1803879df16332c1b439d
[ "MIT" ]
permissive
Quant1um/The-Harvester
919ba2ed876c32bdcf22ceabb7d8de95fbc5eb12
e9e5fcc3ac3d76bf58220c321805bb15465946d0
refs/heads/master
2022-03-05T06:30:31.024150
2019-10-31T10:17:48
2019-10-31T10:17:48
104,643,863
0
0
null
null
null
null
UTF-8
Java
false
false
366
java
package net.quantium.harvester.screen.components; import net.quantium.harvester.Main; import net.quantium.harvester.input.MouseState; public class BackButton extends Button { public BackButton(int x, int y) { super(x, y, 7, "back", 5, 1); } @Override public void onClick(MouseState button) { Main.instance().getScreenService().back(); } }
[ "spitfirexv22@gmail.com" ]
spitfirexv22@gmail.com
e05eb3ddff5c37c307bd99c3c91060b1e7e4738d
8b1f9ceb6c77f2c5c72280221804d36a643903f9
/Hibernate/T4/30张文康/上机作业/HB_T04/test/com/qhit/lh/g4/ZWK/HB_T03/EmpTest.java
35e3a86443f276f2caeaeba43a1abdc3d699e931
[]
no_license
ZWK123456789/163G4G
da4a1258a933fbf966b6b043ba55507de025f093
2ff0d48166fabb62a0c3b01d7ae12da42dbb28b3
refs/heads/master
2021-09-10T20:11:53.816266
2018-04-01T12:56:12
2018-04-01T12:56:12
111,619,300
0
0
null
2017-12-01T03:28:26
2017-11-22T01:02:25
Java
UTF-8
Java
false
false
1,310
java
/** * */ package com.qhit.lh.g4.ZWK.HB_T03; import static org.junit.Assert.*; import org.junit.Test; import com.qhit.lh.g4.ZWK.HB_T04.bean.Dept; import com.qhit.lh.g4.ZWK.HB_T04.bean.Emp; import com.qhit.lh.g4.ZWK.HB_T04.bean.UserInfo; import com.qhit.lh.g4.ZWK.HB_T04.sevice.impl.BaseServiceImpl; /** * @author ZWK *2017年12月13日下午5:45:08 *TODO */ public class EmpTest { private BaseServiceImpl bsi = new BaseServiceImpl(); //@Test public void add() { //创建员工类对象 Emp emp = new Emp(); emp.setEmpName("bobe"); emp.setEmpSex("M"); emp.setBirthday("2017-12-13"); //创建员工信息类对象 UserInfo userinfo = new UserInfo(); userinfo.setUserName("bobe"); userinfo.setUserPassword("123456"); //进行一对一映射 userinfo.setEmp(emp); emp.setUserinfo(userinfo); //获取员工部门对象 Dept dept = (Dept) bsi.getObjectById(Dept.class, 1); emp.setDept(dept); bsi.add(emp); } //@Test public void update() { Emp emp = (Emp) bsi.getObjectById(Emp.class, 1); Emp emp1 = (Emp) bsi.getObjectById(Emp.class, 2); Dept dept = (Dept) bsi.getObjectById(Dept.class, 4); emp.setDept(dept); emp1.setDept(dept); bsi.update(emp); bsi.update(emp1); } //@Test public void delete() { } //@Test public void query() { } }
[ "793592359@qq.com" ]
793592359@qq.com
a32369bf7da2c5e97c741a5ce791f83e3bdf9cbd
fe58305e048b8a2419a06ddacef83626f200e858
/Source/Welcome.java
2d3422b52bb67cd6865c90cfcb2a0ca94297e1da
[]
no_license
RishabhKumr/Accident_Prediction
24887ac6aed16aa6a5214a23a47790af4d202eb7
d87f7b64a7efcb66c78c20098cbb9a48ee630213
refs/heads/master
2022-08-27T11:32:53.580020
2022-08-04T07:58:30
2022-08-04T07:58:30
203,400,757
1
0
null
null
null
null
UTF-8
Java
false
false
219
java
import javax.swing.*; import java.awt.*; class Welcome extends JFrame { Welcome() { setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Welcome"); setSize(400, 200); } }
[ "500054802@stu.upes.ac.in" ]
500054802@stu.upes.ac.in
8be020a23690889af7162185452f715b8bdf1877
b6d3404ae78074efe831bf781d6adb8de6d8f7db
/app/src/main/java/com/example/projecteandroiduf1/HeaderFragment.java
e0ef70a4582ea91b975bf0a33050a724efa0f511
[]
no_license
KurtisLofu/ProjecteAndroidUF1
94987dc49c937620ca6462adbf2bc62540329cfe
1f2a2fcb76050cc799ae67604db6d39ba1b06f74
refs/heads/master
2020-09-24T23:53:34.475125
2019-12-04T13:24:55
2019-12-04T13:24:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
664
java
package com.example.projecteandroiduf1; import android.os.Bundle; import androidx.fragment.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; /** * A simple {@link Fragment} subclass. */ public class HeaderFragment extends Fragment { public HeaderFragment() { // Required empty public constructor } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment return inflater.inflate(R.layout.fragment_header, container, false); } }
[ "adcorteslo5@gmail.com" ]
adcorteslo5@gmail.com
c134c7563941ba0371e18ae9d83236f63e79a453
aabced495e9775dd55181a6d3af45d973fe05f90
/product_catalog_search/src/main/java/com/catalogsearch/application/controller/ExceptionController.java
ee53a1e6f36556ed56b1f38f03290c6800e966d4
[]
no_license
vaibhavthapliyal/Product-Catalog-Search
268bd9dc722ec894e09c2efb517860bb608d68bb
3999a420c4bc9a96740c77539faf484d2be6c8dd
refs/heads/master
2023-03-10T10:32:24.586715
2021-02-26T06:05:18
2021-02-26T06:05:18
342,477,782
0
0
null
null
null
null
UTF-8
Java
false
false
855
java
package com.catalogsearch.application.controller; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import com.catalogsearch.application.exception.CatalogSearchException; @ControllerAdvice public class ExceptionController { @ExceptionHandler({RuntimeException.class}) public ResponseEntity<String> handleRunTimeException(RuntimeException e) { return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(e.getMessage()); } @ExceptionHandler({CatalogSearchException.class}) public ResponseEntity<String> handleNotFoundException(CatalogSearchException e) { return ResponseEntity.status(HttpStatus.NOT_FOUND).body(e.getMessage()); } }
[ "vaibhav.thapliyal.91@gmail.com" ]
vaibhav.thapliyal.91@gmail.com
391a96d3269833f64e14914994d13f7e45b21bc0
2506a7d35ab0a574ae648d34c9d52d8115e73387
/SSAFY_SecondProject/src/com/file3/FileManagerImpl.java
b2244a80a5622543e3a434d1a67e342092070540
[]
no_license
rheehot/web-mobile
adfeb381e1cdc76ff3aee96b51e16af3131c986a
1b96b81bf5a21b0489cdffff7f1b0d8690705b3b
refs/heads/master
2022-11-14T11:04:23.433702
2019-08-18T08:54:40
2019-08-18T08:54:40
null
0
0
null
null
null
null
UHC
Java
false
false
2,128
java
package com.file3; import java.util.ArrayList; public class FileManagerImpl implements FileManager{ ArrayList<File> playList; FileManagerImpl(){ playList = new ArrayList<>(); } @Override public ArrayList<File> allFiles() { // TODO Auto-generated method stub return playList; } @Override public void addFile(File f) { playList.add(f); } @Override public ArrayList<File> findByName(String name) { ArrayList<File> tmp = new ArrayList<>(); for(File f : playList) { if(f.getName().equals(name)) { tmp.add(f); } } if(tmp.size() == 0) { return null; } else { return tmp; } } @Override public ArrayList<File> findBySinger(String singer) { ArrayList<File> tmp = new ArrayList<>(); for(File f : playList) { if(f instanceof MP3File) { if(((MP3File)f).getSinger().equals(singer)) { tmp.add(f); } } } if(tmp.size() == 0) { return null; } else { return tmp; } } @Override public ArrayList<File> findMP3() { ArrayList<File> tmp = new ArrayList<>(); for(File f : playList) { if(f instanceof MP3File) { tmp.add(f); } } if(tmp.size() == 0) { return null; } else { return tmp; } } @Override public ArrayList<File> findText() { ArrayList<File> tmp = new ArrayList<>(); for(File f : playList) { if(f instanceof TextFile) { tmp.add(f); } } if(tmp.size() == 0) { return null; } else { return tmp; } } @Override public boolean isEmpty() { return playList.isEmpty(); // if(playList.size() == 0) { // return true; // }else { // return false; // } } @Override public void deleteFile(int index) { try { playList.remove(index); }catch(Exception e) { System.out.println("잘못된 index를 입력하셨습니다."); } } @Override public int size() { return playList.size(); } @Override public void deleteAll() { playList.clear(); } @Override public File getFile(int index) { return playList.get(index); } }
[ "gimoon0226@naver.com" ]
gimoon0226@naver.com
67c19a07973ce37de2f2bc900e66f61efdaf5260
445b456c20b3713049bc16e6f256a349581bfb24
/src/java/controller/docentes/CorrecaoDocente.java
cf815702d264e4ce7d235e72356df6b20de3baa0
[]
no_license
Janio-Rosa/correcaoonline
d7c79d53bd7823d7eca69f432cbd497d5cce4937
9e546068fa82c4be47dbcded3c0794e1bf5db6c6
refs/heads/master
2020-09-15T11:42:10.598245
2019-11-22T15:51:01
2019-11-22T15:51:01
223,434,797
0
0
null
null
null
null
UTF-8
Java
false
false
793
java
package controller.docentes; import controller.CorrecaoBasic; import javax.faces.bean.ManagedBean; import javax.faces.bean.SessionScoped; import javax.faces.context.FacesContext; import javax.servlet.http.HttpSession; /** * * @author Janio */ @ManagedBean(name = "CorrecaoDocente") @SessionScoped public class CorrecaoDocente extends CorrecaoBasic { public CorrecaoDocente() { } public static CorrecaoDocente getInstance() { HttpSession session = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(true); Object temp = session.getAttribute("CorrecaoDocente"); if (temp instanceof CorrecaoDocente) { CorrecaoDocente cd = (CorrecaoDocente) temp; return cd; } return null; } }
[ "janio@ufu.br" ]
janio@ufu.br
e628b436180d0c7991bcbc5dca4a4b377aa90e41
af90df381627ef68e0dd671d217fdbfa58cd7cef
/tom1_ch10/src/properties/PropertiesTest.java
c52d5b635ac772b471b62617d0d8ec0543d93f49
[]
no_license
mr-mdk/workspase_horstmann
720bdc0b6ff013cce448f6cea1d1a2cf347c3526
6c468c3ff7c32741783dc83c12ea14fe71a1eb79
refs/heads/master
2020-06-04T00:15:16.091743
2015-09-08T23:07:06
2015-09-08T23:07:06
42,143,626
0
0
null
null
null
null
UTF-8
Java
false
false
2,697
java
package properties; import java.awt.EventQueue; import java.awt.event.*; import java.io.*; import java.util.Properties; import javax.swing.*; /** * A program to test properties. The program remembers the frame position, size, * and title. * * @version 1.00 2007-04-29 * @author Cay Horstmann */ public class PropertiesTest { public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { PropertiesFrame frame = new PropertiesFrame(); frame.setVisible(true); } }); } } /** * A frame that restores position and size from a properties file and updates * the properties upon exit. */ class PropertiesFrame extends JFrame { private static final int DEFAULT_WIDTH = 300; private static final int DEFAULT_HEIGHT = 200; private File propertiesFile; private Properties settings; public PropertiesFrame() { // get position, size, title from properties String userDir = System.getProperty("user.home"); File propertiesDir = new File(userDir, ".corejava"); if (!propertiesDir.exists()) propertiesDir.mkdir(); propertiesFile = new File(propertiesDir, "program.properties"); Properties defaultSettings = new Properties(); defaultSettings.put("left", "0"); defaultSettings.put("top", "0"); defaultSettings.put("width", "" + DEFAULT_WIDTH); defaultSettings.put("height", "" + DEFAULT_HEIGHT); defaultSettings.put("title", ""); settings = new Properties(defaultSettings); if (propertiesFile.exists()) try { FileInputStream in = new FileInputStream(propertiesFile); settings.load(in); } catch (IOException ex) { ex.printStackTrace(); } int left = Integer.parseInt(settings.getProperty("left")); int top = Integer.parseInt(settings.getProperty("top")); int width = Integer.parseInt(settings.getProperty("width")); int height = Integer.parseInt(settings.getProperty("height")); setBounds(left, top, width, height); // if no title given, ask user String title = settings.getProperty("title"); if (title.equals("")) title = JOptionPane.showInputDialog("Please supply a frame title:"); if (title == null) title = ""; setTitle(title); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent event) { settings.put("left", "" + getX()); settings.put("top", "" + getY()); settings.put("width", "" + getWidth()); settings.put("height", "" + getHeight()); settings.put("title", getTitle()); try { FileOutputStream out = new FileOutputStream(propertiesFile); settings.store(out, "Program Properties"); } catch (IOException ex) { ex.printStackTrace(); } System.exit(0); } }); } }
[ "morris@i.ua" ]
morris@i.ua
171fe38cd98058a68d968d5e12c14292819fcf07
73e5f3587bccb123588418e20782d24af278247f
/src/tetris/pecas/L.java
0966572f423d9e97b3013c2a312ecc484ff6071b
[]
no_license
ctmartinez1992/Tetris
d0504fe596df22b1df94dc63b4aa7d56b9021eed
6f6aa3de3e5d1d2914a2bff6e2b9637bb7660dc8
refs/heads/master
2020-06-04T11:49:23.542242
2014-02-24T14:40:42
2014-02-24T14:40:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
324
java
package tetris.pecas; public class L extends Peca { byte [][] kernel = {{0,0,0,0},{0,1,0,0},{0,1,0,0},{0,1,1,0}}; @Override public byte[][] getKernel() { return kernel; } @Override public void setKernel(byte[][] newKernel) { this.kernel = newKernel; } @Override public byte getCor() { return 2; } }
[ "ctmartinez1992@gmail.com" ]
ctmartinez1992@gmail.com
0c128d485eb031dfa3b0119ab8ea95585a52a7e6
a4db3f44ab6d6b749bbe439d86a000ad960cd07a
/app/src/test/java/com/emre/android/weatherapp/SettingsDAOTest.java
f8331ca6b885f3135daf9d4881186805b275f135
[]
no_license
emreuskuplu/Weather
020658f7adce56e6ead74bd6e81748c51fdcc86c
fbabb6b39be01c7813d689619084306305f512ed
refs/heads/master
2020-06-01T12:41:23.629024
2020-01-23T15:00:06
2020-01-23T15:00:06
190,782,293
2
0
null
2020-01-23T14:56:58
2019-06-07T17:18:25
Java
UTF-8
Java
false
false
2,329
java
/* * Copyright (c) 2019. Emre Üsküplü * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.emre.android.weatherapp; import android.content.Context; import android.os.Build; import androidx.test.core.app.ApplicationProvider; import com.emre.android.weatherapp.dataaccessobjects.settingsdataaccess.ISettingsDAO; import com.emre.android.weatherapp.dataaccessobjects.settingsdataaccess.SettingsDAO; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.RobolectricTestRunner; import org.robolectric.annotation.Config; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; /** * @author Emre Üsküplü */ @RunWith(RobolectricTestRunner.class) @Config(sdk = Build.VERSION_CODES.P) public class SettingsDAOTest { private Context mContext = ApplicationProvider.getApplicationContext(); private ISettingsDAO mISettingsDAO; private String mExpectedUnitsFormat; @Test public void setsAndGetsUnitsFormatValuesInPrefUnitsFormatStorage() { givenSettingsDAOAndUnitsFormat(); whenSetsAndGetsUnitsFormatValuesInPrefUnitsFormatStorage(); thenVerifyTakenValuesInPrefUnitsFormatStorage(); } private void givenSettingsDAOAndUnitsFormat() { mISettingsDAO = new SettingsDAO(); mExpectedUnitsFormat = "metric"; } private void whenSetsAndGetsUnitsFormatValuesInPrefUnitsFormatStorage() { mISettingsDAO.setPrefUnitsFormatStorage(mContext, "metric"); } private void thenVerifyTakenValuesInPrefUnitsFormatStorage() { String actualUnitsFormat = mISettingsDAO.getPrefUnitsFormatStorage(mContext); assertThat(mExpectedUnitsFormat, is(equalTo(actualUnitsFormat))); } }
[ "uskupluemre@gmail.com" ]
uskupluemre@gmail.com
b13b157213c20bdcda89d9bfb7bdac3d245cf448
d26fb66bf4596b8e4becf70e865f0e3414c1521a
/src/test/java/com/betterfly/repository/search/ObligationConformiteSearchRepositoryMockConfiguration.java
d55f765f4c74b8c54230fc2e829a00cd0db0c364
[]
no_license
AbdeljalilNachi/betterfly
55c1207cea29f5fa620ca9e37e8435bb8eeb9176
2c6d07ae5f7572f1a62f2e4ec06d0d8aab2b39dd
refs/heads/master
2023-03-26T18:37:20.393673
2021-03-18T12:19:30
2021-03-18T12:19:30
343,828,443
0
0
null
null
null
null
UTF-8
Java
false
false
500
java
package com.betterfly.repository.search; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Configuration; /** * Configure a Mock version of {@link ObligationConformiteSearchRepository} to test the * application without starting Elasticsearch. */ @Configuration public class ObligationConformiteSearchRepositoryMockConfiguration { @MockBean private ObligationConformiteSearchRepository mockObligationConformiteSearchRepository; }
[ "abdeljalilnachi@gmail.com" ]
abdeljalilnachi@gmail.com
6f26bca0ad52881507e492dc815792d0aa74ac45
b0fa099436420034a21be30dda255ac706a55e81
/src/main/java/com/huahua/service/system/SiteService.java
46371915c8214feb3d90d85cecb201768f03ce04
[]
no_license
dreamkele2007/springboot
f935a27d185aff47d2eb04f5fa22870e003342b4
0f8a6b53f708632b48e3d334ddf427d22ba8155f
refs/heads/master
2022-06-29T02:26:56.619354
2020-05-31T05:30:08
2020-05-31T05:30:08
103,279,150
2
2
null
2022-06-20T23:22:23
2017-09-12T14:11:14
CSS
UTF-8
Java
false
false
919
java
package com.huahua.service.system; import com.huahua.domain.system.SmSite; import java.util.List; /** * @author GYM * @date 2020/4/17 14:24 * @Description: TODO */ public interface SiteService { /** * 新增 * * @param smSite */ public int insertSelective(SmSite smSite); /** * @Description: * @Param: * @return: */ public int delete(SmSite smSite); /** * @Description: 保存用户 * @Param: userDO * @return: */ public void insert(SmSite smSite); /** * @Description: 查询根据主键 * @Param: Integer id * @return: */ public SmSite selectById(Integer id); /** * @Description: 查询所有 * @Param: * @return: */ List<SmSite> selectAll(); /** * @Description: * @Param: * @return: */ int updateByIdWithTx(SmSite smSite); }
[ "gaoymf@yonyou.com" ]
gaoymf@yonyou.com