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
99923cf11c0fcaa0c55116c8446546e925ac4ad6
c4123491153cf906bbc95581c6218867b3327fca
/myfirstjava/GCD.java
23c5d3afdb346cc8c38503830fa87dd8d034d8b2
[]
no_license
raj2029rahul/java-programming
e7a3e0be1b74d4e61e8423109716f19187226a53
c10dae2c3fce49b561c4a51e8302de522ef04d44
refs/heads/main
2023-06-16T07:55:53.048604
2021-07-13T04:28:54
2021-07-13T04:28:54
385,472,725
0
0
null
null
null
null
UTF-8
Java
false
false
559
java
package myfirstjava; import java.util.Scanner; public class GCD { public static void main(String[] args) { int n1,n2; Scanner sc=new Scanner(System.in); System.out.println("enter first number"); n1=sc.nextInt(); System.out.println("enter second number"); n2=sc.nextInt(); System.out.println(gcd(n1,n2)); } //euclid division algorithm static int gcd(int n1,int n2) { if(n1==0 || n2==0) return 0; if(n1==n2) return n1; if(n1>n2) return gcd(n1-n2,n2); else return gcd(n1,n2-n1); } }
[ "noreply@github.com" ]
raj2029rahul.noreply@github.com
4ea4aff2a430e0287b8b81531703ae62b32e4b36
8d65f9656246b5b651b2588c5e3f0156a96f6635
/service/src/main/java/com/moonassist/service/authentication/TimeBased2FA.java
6297a2c5b2a362636690f0a976debd0de283e052
[]
no_license
Mrinal205/BackEnd_System_Master
936e74a6b49bbfff8ccf19c4e1b4f9e343891aef
f735b6aa1bf50a60388f2aec1940daacdbac9723
refs/heads/master
2022-12-21T13:59:23.799666
2019-07-09T07:53:10
2019-07-09T07:53:10
195,958,367
0
0
null
2022-12-10T04:51:14
2019-07-09T07:43:00
Java
UTF-8
Java
false
false
2,418
java
package com.moonassist.service.authentication; import com.google.zxing.BarcodeFormat; import com.google.zxing.MultiFormatWriter; import com.google.zxing.WriterException; import com.google.zxing.client.j2se.MatrixToImageWriter; import com.google.zxing.common.BitMatrix; import org.apache.commons.codec.binary.Base32; import org.apache.commons.codec.binary.Hex; import org.springframework.stereotype.Service; import java.io.FileOutputStream; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.security.SecureRandom; @Service public class TimeBased2FA { public String getRandomSecretKey() { SecureRandom random = new SecureRandom(); byte[] bytes = new byte[20]; random.nextBytes(bytes); Base32 base32 = new Base32(); String secretKey = base32.encodeToString(bytes); // make the secret key more human-readable by lower-casing and // inserting spaces between each group of 4 characters return secretKey.toLowerCase().replaceAll("(.{4})(?=.{4})", "$1 "); } public String getTOTPCode(String secretKey) { String normalizedBase32Key = secretKey.replace(" ", "").toUpperCase(); Base32 base32 = new Base32(); byte[] bytes = base32.decode(normalizedBase32Key); String hexKey = Hex.encodeHexString(bytes); long time = (System.currentTimeMillis() / 1000) / 30; String hexTime = Long.toHexString(time); return TOTP.generateTOTP(hexKey, hexTime, "6"); } public String getGoogleAuthenticatorBarCode(String secretKey, String account, String issuer) { String normalizedBase32Key = secretKey.replace(" ", "").toUpperCase(); try { return "otpauth://totp/" + URLEncoder.encode(issuer + ":" + account, "UTF-8").replace("+", "%20") + "?secret=" + URLEncoder.encode(normalizedBase32Key, "UTF-8").replace("+", "%20") + "&issuer=" + URLEncoder.encode(issuer, "UTF-8").replace("+", "%20"); } catch (UnsupportedEncodingException e) { throw new IllegalStateException(e); } } public void createQRCode(String barCodeData, String filePath, int height, int width) throws WriterException, IOException { BitMatrix matrix = new MultiFormatWriter().encode(barCodeData, BarcodeFormat.QR_CODE, width, height); try (FileOutputStream out = new FileOutputStream(filePath)) { MatrixToImageWriter.writeToStream(matrix, "png", out); } } }
[ "Mrinal205@gmail.com" ]
Mrinal205@gmail.com
5df094bfa20fdb8ca23433b581448fa7c01288ad
840ee35240e4f8840d67524f17d1be29e9be3629
/app/src/main/java/company/viral/organizadorjec/FragmentMenu/InicioF.java
2d3e7d84dde12aff22b825ff438767342809f13e
[]
no_license
ernyhidalgo/OrganizadorJEC
80a5ed486220bcaca7ce57aac46e734b520265ba
dc21cd8e426465850dd39e06486c3454cff709c4
refs/heads/master
2020-06-16T00:47:12.566413
2017-02-02T00:55:00
2017-02-02T00:55:00
75,256,576
1
1
null
2016-12-06T23:35:41
2016-12-01T04:56:30
Java
UTF-8
Java
false
false
2,708
java
package company.viral.organizadorjec.FragmentMenu; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.ListView; import company.viral.organizadorjec.Clases.SQLite; import company.viral.organizadorjec.R; public class InicioF extends Fragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_inicio, container, false); Bundle bundle=getActivity().getIntent().getExtras(); int identificar = bundle.getInt("identificador"); SQLite admin = new SQLite(getContext(),"administracion",null,1); SQLiteDatabase bd = admin.getWritableDatabase(); Cursor buscador = bd.rawQuery("select nombre_tarea from asignacion where id_usuario='" + identificar + "' ", null); String [] menuDias = new String[buscador.getCount()]; int i=0; while (buscador.moveToNext()){ String contenedor = buscador.getString(buscador.getColumnIndex("nombre_tarea")); menuDias[i]=contenedor; i++; } String[] menu15Das = { "Tareaaaaaaa", "Trabajo", "Salida"}; String[] menumes = { "Tareaaaaaaaaaa", "Trabajo", "Salida", "paseo de perro","comer"}; //adaptadores //adaptador dias ListView listdias = (ListView) view.findViewById(R.id.menudias); ArrayAdapter<String> listavistadias = new ArrayAdapter<String>( getActivity(), android.R.layout.simple_list_item_1,menuDias); listdias.setAdapter(listavistadias); //adaptador 15dias ListView lista15dias = (ListView) view.findViewById(R.id.menu15dias); ArrayAdapter<String> listavista15dias = new ArrayAdapter<String>( getActivity(), android.R.layout.simple_list_item_1,menu15Das); lista15dias.setAdapter(listavista15dias); //adaptador mes ListView listames = (ListView) view.findViewById(R.id.menumes); ArrayAdapter<String> listavistames =new ArrayAdapter<String>( getActivity(), android.R.layout.simple_list_item_1,menumes); listames.setAdapter(listavistames); return view ; } }
[ "ernyhidalgo@gmail.com" ]
ernyhidalgo@gmail.com
6d7634f2b76ac82ec06583851565035914278e41
9b092ed006491ebd278671a20fe11a7bd53b652b
/src/com/aps/collection/ComparatorByValue.java
9b2ecbf7947963feba5c09f363519016e2cdc153
[]
no_license
shuklabhanuprakash/deployment
862f65acf2ed90a5e3bfba27157713b6b18e3718
5e28cee3e466727990c417ac62f67dcafb6a0cb7
refs/heads/master
2021-08-02T21:42:12.920690
2018-06-22T11:09:58
2018-06-22T11:09:58
134,255,897
0
0
null
null
null
null
UTF-8
Java
false
false
404
java
package com.aps.collection; import java.util.Comparator; import java.util.HashMap; import java.util.Map; public class ComparatorByValue<K, V extends Comparable<V>> implements Comparator<K> { Map<K, V> map = new HashMap<K, V>(); ComparatorByValue(Map<K, V> map) { this.map = map; } @Override public int compare(K k1, K k2) { return -map.get(k2).compareTo(map.get(k1)) > 0 ? 1 : -1; } }
[ "shuklabhanuprakash@gmail.com" ]
shuklabhanuprakash@gmail.com
a9f9bf09959156fba4f5c5017594fce836046f1d
063f3b313356c366f7c12dd73eb988a73130f9c9
/erp_ejb/src_seguridad/com/bydan/erp/seguridad/business/logic/ContinenteLogicAdditional.java
7aac7dd5f72a172b98f84b4b1996a1094196830e
[ "Apache-2.0" ]
permissive
bydan/pre
0c6cdfe987b964e6744ae546360785e44508045f
54674f4dcffcac5dbf458cdf57a4c69fde5c55ff
refs/heads/master
2020-12-25T14:58:12.316759
2016-09-01T03:29:06
2016-09-01T03:29:06
67,094,354
0
0
null
null
null
null
UTF-8
Java
false
false
8,274
java
/* * ============================================================================ * GNU Lesser General Public License * ============================================================================ * * BYDAN - Free Java BYDAN library. * Copyright (C) 2008 * * 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. * * BYDAN Corporation */ package com.bydan.erp.seguridad.business.logic; import org.json.JSONArray; import org.json.JSONObject; import org.apache.log4j.Logger; import java.sql.Timestamp; import java.util.List; import java.util.ArrayList; import java.util.Set; import java.util.Date; //import java.util.ArrayList; import com.bydan.framework.erp.business.entity.GeneralEntity; import com.bydan.framework.erp.business.entity.GeneralEntityLogic; import com.bydan.framework.erp.business.entity.GeneralEntityParameterGeneral; import com.bydan.framework.erp.business.entity.*; import com.bydan.framework.erp.business.entity.DatoGeneral; import com.bydan.framework.erp.util.ConstantesJsp; import com.bydan.framework.erp.business.dataaccess.ConstantesSql; import com.bydan.erp.seguridad.util.ContinenteConstantesFunciones; import com.bydan.framework.erp.business.logic.*; import com.bydan.framework.erp.util.FuncionesJsp; import com.bydan.framework.erp.business.logic.DatosCliente; import com.bydan.framework.erp.util.*; import com.bydan.erp.seguridad.business.entity.*; //import com.bydan.erp.seguridad.business.interfaces.ContinenteAdditionable; //import com.bydan.framework.erp.util.*; //import com.bydan.framework.erp.business.logic.*; //import com.bydan.erp.seguridad.business.dataaccess.*; //import com.bydan.erp.seguridad.business.logic.*; //import java.sql.SQLException; //CONTROL_INCLUDE @SuppressWarnings("unused") public class ContinenteLogicAdditional extends ContinenteLogic { // implements ContinenteAdditionable{ public ContinenteLogicAdditional(Connexion connexion)throws Exception { super(connexion); } //PARA EVENTOS GENERALES public static GeneralEntityParameterReturnGeneral procesarEventos(ParametroGeneralUsuario parametroGeneralUsuario,Modulo modulo,Opcion opcion,Usuario usuario,GeneralEntityLogic generalEntityLogic,EventoGlobalTipo eventoGlobalTipo,ControlTipo controlTipo,EventoTipo eventoTipo,EventoSubTipo eventoSubTipo,String sTipo,Object objects,Object object,GeneralEntityParameterGeneral generalEntityParameterGeneral,GeneralEntityParameterReturnGeneral generalEntityReturnGeneral,Boolean isEsNuevo,ArrayList<Classe> classes)throws Exception { try { //CONTROL_19 return generalEntityReturnGeneral; } catch(Exception e) { Funciones.manageException(logger,e); throw e; } finally { } } public static Boolean validarSaveRelaciones(GeneralEntity generalEntity,GeneralEntityLogic generalEntityLogic) { //CONTROL_20 Boolean validado=true; return validado; } public static void updateRelacionesToSave(GeneralEntity generalEntity,GeneralEntityLogic generalEntityLogic) { //CONTROL_21 } public static void updateRelacionesToSaveAfter(GeneralEntity generalEntity,GeneralEntityLogic generalEntityLogic) { //CONTROL_21 } //CONTROL_INICIO public ContinenteLogicAdditional()throws Exception { super(); } public static void checkContinenteToSave(Continente continente,DatosCliente datosCliente,ArrayList<DatoGeneral> arrDatoGeneral) { //CONTROL_1 } public static void checkContinenteToSave(Continente continente,DatosCliente datosCliente,Connexion connexion,ArrayList<DatoGeneral> arrDatoGeneral) { //CONTROL_2 } public static void checkContinenteToSaveAfter(Continente continente,DatosCliente datosCliente,Connexion connexion,ArrayList<DatoGeneral> arrDatoGeneral) { //CONTROL_3 } public static void checkContinenteToSaves(List<Continente> continentes,DatosCliente datosCliente,ArrayList<DatoGeneral> arrDatoGeneral) { //CONTROL_4 } public static void checkContinenteToSaves(List<Continente> continentes,DatosCliente datosCliente,Connexion connexion,ArrayList<DatoGeneral> arrDatoGeneral) { //CONTROL_5 } public static void checkContinenteToSavesAfter(List<Continente> continentes,DatosCliente datosCliente,Connexion connexion,ArrayList<DatoGeneral> arrDatoGeneral) { //CONTROL_6 } public static void checkContinenteToGet(Continente continente,DatosCliente datosCliente,ArrayList<DatoGeneral> arrDatoGeneral) { //CONTROL_7 } public static void checkContinenteToGets(List<Continente> continentes,DatosCliente datosCliente,ArrayList<DatoGeneral> arrDatoGeneral) { //CONTROL_8 } public static void updateContinenteToSave(Continente continente,ArrayList<DatoGeneral> arrDatoGeneral) { //CONTROL_9 } public static void updateContinenteToGet(Continente continente,ArrayList<DatoGeneral> arrDatoGeneral) { //CONTROL_10 } public static void updateJSONObjectContinenteActions(String sTipoJsonResponse,JSONObject jsonObjectContinente,ArrayList<DatoGeneral> arrDatoGeneral) { //CONTROL_11 } public static String getJsonContinenteDataTable(String sTipoJsonResponse,Continente continente,ArrayList<DatoGeneral> arrDatoGeneral) { String sJsonDataTable=""; //CONTROL_12 return sJsonDataTable; } public static String getJsonContinentesDataTable(String sTipoJsonResponse,List<Continente> continentes,ArrayList<DatoGeneral> arrDatoGeneral) { String sJsonDataTable=""; //CONTROL_13 return sJsonDataTable; } public static JSONArray getJsonArrayContinenteColumnsDefaultTable(String sTipoJsonResponse,ArrayList<DatoGeneral> arrDatoGeneral)throws Exception { JSONArray jsonArrayContinentesColumns = new JSONArray(); //CONTROL_14 return jsonArrayContinentesColumns; } public static void updateJSONArrayContinenteActionsColumns(String sTipoJsonResponse,JSONArray jsonObjectContinente,ArrayList<DatoGeneral> arrDatoGeneral) { //CONTROL_15 } //CONTROL_FUNCION1 public static void quitarEspaciosContinente(Continente continente,ArrayList<DatoGeneral> arrDatoGeneral) throws Exception { continente.setcodigo(continente.getcodigo().trim()); continente.setnombre(continente.getnombre().trim()); } public static void quitarEspaciosContinentes(List<Continente> continentes,ArrayList<DatoGeneral> arrDatoGeneral) throws Exception { for(Continente continente: continentes) { continente.setcodigo(continente.getcodigo().trim()); continente.setnombre(continente.getnombre().trim()); } } public static ArrayList<String> getArrayColumnasGlobalesContinente(ArrayList<DatoGeneral> arrDatoGeneral) throws Exception { ArrayList<String> arrColumnasGlobales=new ArrayList<String>(); return arrColumnasGlobales; } //PARA ACCIONES NORMALES public static GeneralEntityParameterReturnGeneral procesarAccions(ParametroGeneralUsuario parametroGeneralUsuario,Modulo modulo,Opcion opcion,Usuario usuario,GeneralEntityLogic generalEntityLogic,String sProceso,Object objects,GeneralEntityParameterGeneral generalEntityParameterGeneral,GeneralEntityParameterReturnGeneral generalEntityReturnGeneral)throws Exception { try { //GeneralEntityParameterReturnGeneral generalEntityReturnGeneral=new GeneralEntityParameterReturnGeneral(); return generalEntityReturnGeneral; } catch(Exception e) { //Funciones.manageException(logger,e); throw e; } finally { } } //CONTROL_FUNCION2 }
[ "byrondanilo10@hotmail.com" ]
byrondanilo10@hotmail.com
ea55c2b6e1eaf7dcd7a7c5c5e403fccb30870f46
ef830bb18e1f432122e1c9523d4c807c9ef077a5
/src/main/java/com/taobao/api/domain/BrandCatMetaData.java
9f2c355127afbd42c77b6e4ae7bb3fc61769a570
[]
no_license
daiyuok/TopSecuritySdk
bb424c5808bd103079cbbbfcb56689a73259a24d
8ac8eb48b88158a741c820a940564fd0b876e9db
refs/heads/master
2021-01-22T06:49:05.025064
2017-03-01T06:19:42
2017-03-01T06:19:42
81,789,925
2
2
null
null
null
null
UTF-8
Java
false
false
1,359
java
package com.taobao.api.domain; import com.taobao.api.internal.mapping.ApiField; import com.taobao.api.TaobaoObject; /** * 类目、品牌下的达尔文元数据 * * @author top auto create * @since 1.0, null */ public class BrandCatMetaData extends TaobaoObject { private static final long serialVersionUID = 3346423716715493355L; /** * 品牌id */ @ApiField("brand_id") private Long brandId; /** * 叶子类目id */ @ApiField("cat_id") private Long catId; /** * 以;隔开多个认证资料。:隔开资料ID与内容。如?1:产品包装图片;2:完整产品资质 */ @ApiField("certified_data") private String certifiedData; /** * 类目、品牌是否切入达尔文 */ @ApiField("is_darwin") private Boolean isDarwin; public Long getBrandId() { return this.brandId; } public void setBrandId(Long brandId) { this.brandId = brandId; } public Long getCatId() { return this.catId; } public void setCatId(Long catId) { this.catId = catId; } public String getCertifiedData() { return this.certifiedData; } public void setCertifiedData(String certifiedData) { this.certifiedData = certifiedData; } public Boolean getIsDarwin() { return this.isDarwin; } public void setIsDarwin(Boolean isDarwin) { this.isDarwin = isDarwin; } }
[ "daixinyu@shopex.cn" ]
daixinyu@shopex.cn
1ab730fe2cf2cd4b1ac618f670e43db7a59f2136
956ca948c5a5852d7f0e9451c552084c690a5aee
/minggu 2/src/minggu/pkg2/ManagingPeople.java
022f1857609f75bb0044feef7067523eefa4f30e
[]
no_license
boydymas21/E41201609_Boy-Dymas_Hidayat_C
f7d27fcabf57306d1f8f16937cee192f597239ae
a4369bcc1dfabfd405e11344826c988ddc18fd32
refs/heads/main
2023-04-19T02:07:03.699723
2021-04-24T02:23:48
2021-04-24T02:23:48
347,612,032
0
0
null
null
null
null
UTF-8
Java
false
false
774
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 minggu.pkg2; /** * * @author USER */ public class ManagingPeople { public static void main(String[] args) { Person p1 = new Person("arial", 37); Person p2 = new Person("joseph", 15); if(p1.getAge()==p2.getAge()) { System.out.println(p1.getName()+" is the same age as "+p2.getName()); } else { System.out.println(p1.getName()+" is NOT the same age as "+p2.getName()); } } }
[ "80624528+boydymas21@users.noreply.github.com" ]
80624528+boydymas21@users.noreply.github.com
78a8fc1d5cdd9a4410300515b24ced56281d4589
a5304bd1901113c0937a4148b03d04ff67a1c72e
/src/main/java/com/laioffer/secondhandmarket/storage/StorageProperties.java
60a30fdd3beea8fb6d903639792f6fcca2bac0f2
[]
no_license
YingyingXin/SecondHandMarket
77eb0ace7989fe7725864f3d58123a132ff5892e
4ef8ae68ee35ff5bfaed21aa08c22b6b789fa299
refs/heads/master
2023-04-08T02:20:37.795557
2021-04-21T04:21:31
2021-04-21T04:21:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
453
java
package com.laioffer.secondhandmarket.storage; import org.springframework.boot.context.properties.ConfigurationProperties; @ConfigurationProperties("storage") public class StorageProperties { /** * Folder location for storing files */ private String location = "upload-dir"; public String getLocation() { return location; } public void setLocation(String location) { this.location = location; } }
[ "wangweixidian@gmail.com" ]
wangweixidian@gmail.com
c455c1aee112225e2de34712994952fe5e7747e5
93ff4eb9c1a5816f1cf6d41e8646ccc696fcb90e
/android-p/app/src/main/java/com/phicomm/prototype/model/cloud/CloudRouterModel.java
426ac44bac95926fd95e740e0e88fb05480ac73f
[]
no_license
ranshao2017/auts501-demo-prototype
91bc4c5d3099c3a3a30ae3c49c04a60ecf6b672d
2e3b0291c8c49fad4aac32cbfd5d61320e152c1b
refs/heads/master
2020-12-25T19:03:15.373849
2017-05-28T15:04:33
2017-05-28T15:04:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,314
java
package com.phicomm.prototype.model.cloud; import com.phicomm.prototype.constants.UrlConfig; import com.phicomm.prototype.net.OkHttpUtil; import com.phicomm.prototype.net.callback.BaseCallback; /** * 云设备相关 * Created by qisheng.lv on 2017/4/19. */ public class CloudRouterModel { private String mTag; private String mTagDevType = "devType"; public CloudRouterModel(String tag) { this.mTag = tag; } /** * 获取账号下绑定的路由器 * * @param devType * @param callback */ public void getBindRouters(String devType, BaseCallback callback) { OkHttpUtil.get(UrlConfig.DeviceCloudUrl.GET_BIND_DEVICES) .addParams(mTagDevType, devType) .doRequest(mTag, callback); } /** * 解绑设备 * * @param accountIDs * @param authorizationcode * @param devType * @param devSN * @param callback */ public void unBindRouter(String accountIDs, String authorizationcode, String devType, String devSN, BaseCallback callback) { OkHttpUtil.post(UrlConfig.DeviceCloudUrl.UNBIND_ROUTER) .addParams("accountIDs", accountIDs) .addParams("authorizationcode", authorizationcode) .addParams(mTagDevType, devType) .addParams("devSN", devSN) .doRequest(mTag, callback); } /** * 检查设备的绑定状态 * * @param devSN * @param devType * @param callback */ public void checkBindState(String devSN, String devType, BaseCallback callback) { OkHttpUtil.get(UrlConfig.DeviceCloudUrl.CHECK_BIND_STATE) .addParams("devSN", devSN) .addParams(mTagDevType, devType) .doRequest(mTag, callback); } /** * 绑定设备 * * @param devName * @param devSN * @param devType * @param callback */ public void bindRouter(String devName, String devSN, String devType, BaseCallback callback) { OkHttpUtil.bindRouter(UrlConfig.DeviceCloudUrl.BIND_ROUTER) .addParams("devName", devName) .addParams("devSN", devSN) .addParams(mTagDevType, devType) .doRequest(mTag, callback); } }
[ "rongwei84n@163.com" ]
rongwei84n@163.com
2f3191ed3b2940d724b6489f4a6a055fa8e50a0b
712ec865a5ae55cd7d56e2de1d51d2af3a22abd2
/src/main/java/com/lrm/service/BlogServiceImpl.java
e2c372974658bb9179eb1e8d360dc043ecb0ad95
[]
no_license
LuMing-China/blog_2020
0c3bd4710559ed369dabec1fb87bc680e3253bf7
58c003ba6cc437f73baa9c66cf2ba198acab9432
refs/heads/master
2022-07-15T19:20:07.627187
2020-05-21T03:50:29
2020-05-21T03:50:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,735
java
package com.lrm.service; import com.lrm.NotFoundException; import com.lrm.dao.BlogRepository; import com.lrm.po.Blog; import com.lrm.po.Type; import com.lrm.util.MarkdownUtils; import com.lrm.util.MyBeanUtils; import com.lrm.vo.BlogQuery; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Sort; import org.springframework.data.jpa.domain.Specification; import org.springframework.stereotype.Service; import javax.persistence.criteria.*; import org.springframework.data.domain.Pageable; import org.springframework.transaction.annotation.Transactional; import java.util.*; /** * @author shkstart * @date 2020/5/12 - 12:52 */ @Service public class BlogServiceImpl implements BlogService { @Autowired private BlogRepository blogRepository; @Override public Blog getBlog(Long id) { return blogRepository.findOne(id); } /** * Markdown * @param id * @return */ @Transactional @Override public Blog getAndConvert(Long id) { Blog blog = blogRepository.findOne(id); if(blog==null){ throw new NotFoundException("该博客不存在"); } Blog b = new Blog(); BeanUtils.copyProperties(blog,b); String content = b.getContent(); b.setContent(MarkdownUtils.markdownToHtmlExtensions(content)); blogRepository.updateViews(id); return b; } @Override public Page<Blog> listBlog(Pageable pageable,BlogQuery blog) { return blogRepository.findAll(new Specification<Blog>() { @Override public Predicate toPredicate(Root<Blog> root, CriteriaQuery<?> cq, CriteriaBuilder cb) { List<Predicate> predicates = new ArrayList<>(); if(!"".equals(blog.getTitle())&& blog.getTitle()!=null){ predicates.add(cb.like(root.<String>get("title"),"%"+blog.getTitle()+"%")); } if(blog.getTypeId() != null){ predicates.add(cb.equal(root.<Type>get("type").get("id"),blog.getTypeId())); } if(blog.isRecommend()){ predicates.add(cb.equal(root.<Boolean>get("recommend"),blog.isRecommend())); } cq.where(predicates.toArray(new Predicate[predicates.size()])); return null; } },pageable); } @Override public Page<Blog> listBlog(Pageable pageable) { return blogRepository.findAll(pageable); } @Override public Page<Blog> listBlog(Long tagId, Pageable pageable) { return blogRepository.findAll(new Specification<Blog>() { @Override public Predicate toPredicate(Root<Blog> root, CriteriaQuery<?> cq, CriteriaBuilder cb) { Join join = root.join("tags"); return cb.equal(join.get("id"),tagId); } },pageable); } @Override public Page<Blog> listBlog(String query, Pageable pageable) { return blogRepository.findByQuery(query,pageable); } @Override public List<Blog> listRecommendBlogTop(Integer size) { Sort sort = new Sort(Sort.Direction.DESC,"updateTime"); Pageable pageable = new PageRequest(0,size,sort); return blogRepository.findTop(pageable); } @Override public Map<String, List<Blog>> archiveBlog() { List<String> years = blogRepository.findGroupYear(); Map<String,List<Blog>> map = new HashMap<>(); for(String year :years){ map.put(year,blogRepository.findByYear(year)); } return map; } @Override public Long countBlog() { return blogRepository.count(); } @Transactional @Override public Blog saveBlog(Blog blog) { if(blog.getId()==null){ blog.setCreateTime(new Date()); blog.setUpdateTime(new Date()); blog.setViews(0); }else{ blog.setUpdateTime(new Date()); } return blogRepository.save(blog); } @Transactional @Override public Blog updateBlog(Long id, Blog blog) { Blog b = blogRepository.findOne(id); if(b==null){ throw new NotFoundException("该博客不存在"); } BeanUtils.copyProperties(blog,b, MyBeanUtils.getNullPropertyNames(blog)); b.setUpdateTime(new Date()); return blogRepository.save(b); } @Transactional @Override public void deleteBlog(Long id) { blogRepository.delete(id); } }
[ "15056972286@163.com" ]
15056972286@163.com
e5374b92fe61f9e6d0b3cd65847ffc31c843b494
c1be70c319b8ad9d30d64a25b416fad87dc32c8f
/src/main/java/com/mvcframework/annotation/MyService.java
d372f5aa3d9651d0ea9758db824f6035a505c2b2
[]
no_license
pandaapo/myspring_300rows
af2a9b5fd7c52a14cd8612b22ada46e55c6ef580
1fdb13a15887d5d94723d833a7b52fef7f8952d1
refs/heads/master
2020-05-21T09:02:18.425720
2019-06-02T15:37:35
2019-06-02T15:37:35
185,988,438
0
0
null
null
null
null
UTF-8
Java
false
false
209
java
package com.mvcframework.annotation; import java.lang.annotation.*; @Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface MyService { String value() default ""; }
[ "1052156701@qq.com" ]
1052156701@qq.com
4a6b3cd6da0cd2b1a1e34d2d22946d26ac127b8c
441b52b2ebb6457d8a05a9b1655a3fa932377307
/src/servlets/ProfileServlet.java
a74ee12d8560793a1a627032cd8ba55b68dcbc84
[]
no_license
zlczlc/cs5200-final-project
6cb4d69c101e72a0dc83aeaabc3f9522b019ebb6
06ef1bb886846efef2d0d1cb32cb880995aee81b
refs/heads/master
2020-07-04T03:45:49.885175
2016-02-05T04:50:16
2016-02-05T04:50:16
27,897,217
0
0
null
null
null
null
UTF-8
Java
false
false
2,098
java
package servlets; import java.io.IOException; import java.util.ArrayList; import java.util.List; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import DAOs.MovieDao; import DAOs.UserDao; import tables.*; /** * Servlet implementation class ProfileServlet */ @WebServlet("/profile") public class ProfileServlet extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public ProfileServlet() { super(); // TODO Auto-generated constructor stub } protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { List<Movietype> mts=(List<Movietype>) request.getSession().getAttribute("movietypes"); System.out.println(mts); User user=(User)request.getSession().getAttribute("user"); if (user==null){ response.sendRedirect("/Etertainment2/login.jsp"); return; } UserDao udao=new UserDao(); MovieDao mdao = new MovieDao(); System.out.println(user.getUsername()); String action = request.getParameter("Action"); System.out.println(action); String zipcode = request.getParameter("zipcode"); City city = new City(); city.setZipcode(zipcode); user.setCity(city); user.setMovietypes(new ArrayList<Movietype>()); for (Movietype mt: mts){ //System.out.println(mt.getType()); String s = (String) request.getParameter(mt.getType().replace(" ", "")); //System.out.println("s="+s); if (s!=null){ System.out.println("s="+s); user.getMovietypes().add(mt); } } System.out.println(user.getCity()); udao.updateUser(user.getUsername(), user); request.getSession().setAttribute("user", user); //RequestDispatcher dispatcher = request.getRequestDispatcher("/rec"); response.sendRedirect("/Etertainment2/rec"); //dispatcher.forward(request, response); } }
[ "zlchaha@gmail.com" ]
zlchaha@gmail.com
5e62501351f81126f6de5e6a3f551c9af281b4fe
d67abe2b16cabbfe05af3137e1a3cd9e673fac6d
/src/main/java/org/spongepowered/plugin/metadata/PluginContributor.java
08ca9cde8010ca2df166aaad985d2e3786c35875
[ "MIT" ]
permissive
jamierocks/plugin-spi
c795f7b234f53b43ebd4d3ca6cface03278caaa8
c1413bee08ca3b225e78f1b63f778766efb30dc2
refs/heads/master
2022-11-21T07:45:18.692718
2020-06-12T04:48:48
2020-06-12T04:48:48
271,871,563
0
0
null
2020-06-12T19:06:32
2020-06-12T19:06:32
null
UTF-8
Java
false
false
3,109
java
/* * This file is part of plugin-spi, licensed under the MIT License (MIT). * * Copyright (c) SpongePowered <https://www.spongepowered.org> * Copyright (c) contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package org.spongepowered.plugin.metadata; import com.google.common.base.MoreObjects; import com.google.common.base.Preconditions; import java.util.Objects; import java.util.Optional; import javax.annotation.Nullable; public final class PluginContributor { private final String name, description; private PluginContributor(final Builder builder) { this.name = builder.name; this.description = builder.description; } public static Builder builder() { return new Builder(); } public String getName() { return this.name; } public Optional<String> getDescription() { return Optional.ofNullable(this.description); } @Override public int hashCode() { return Objects.hash(this.name); } @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || this.getClass() != o.getClass()) { return false; } final PluginContributor that = (PluginContributor) o; return this.name.equals(that.name); } @Override public String toString() { return MoreObjects.toStringHelper(this) .add("name", this.name) .add("description", this.description) .toString(); } public static class Builder { String name, description; public Builder setName(final String name) { this.name = Preconditions.checkNotNull(name); return this; } public Builder setDescription(@Nullable final String description) { this.description = description; return this; } public PluginContributor build() { Preconditions.checkNotNull(this.name); return new PluginContributor(this); } } }
[ "zidane@spongepowered.org" ]
zidane@spongepowered.org
8ee1ed94aa596ce0f8473035830b4156e10920ed
e4cf946238b8935e52e8ac96a921ba8144479165
/blink/src/java/Controller/Admin/AppointmentUPDATE.java
5280ca8b561f75e133fa90dd6b5f76dfba9e974d
[ "MIT" ]
permissive
vishwa-g-pathirana/HealthWave
84b315be0cf0b1640237facc6250e62c77effec2
b7753c9817986997e746ba7bcc6adbabbf79357c
refs/heads/main
2023-05-06T22:02:05.939102
2021-05-10T17:20:23
2021-05-10T17:20:23
351,168,627
0
1
MIT
2021-05-10T15:07:51
2021-03-24T17:33:04
JavaScript
UTF-8
Java
false
false
5,487
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package Controller.Admin; import Model.Admin.AppoinmentCRUD; import java.io.IOException; import java.io.PrintWriter; import java.sql.ResultSet; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * * @author Pubz */ @WebServlet(name = "AppointmentUPDATE", urlPatterns = {"/AppointmentUPDATE"}) public class AppointmentUPDATE 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 { response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); String Pname = ""; String Dep = ""; String Dname = ""; String date=""; String Time=""; String mail=""; String num=""; String message=""; String status = request.getParameter("stat"); AppoinmentCRUD app = new AppoinmentCRUD(); String id = request.getParameter("id"); try { ResultSet rsa = app.getAppoinment(id); if(rsa.next()){ Pname = rsa.getString("Pname"); Dep = rsa.getString("Dep"); Dname = rsa.getString("Dname"); date = rsa.getString("Date"); Time = rsa.getString("Time"); mail = rsa.getString("Pmail"); num = rsa.getString("Pnum"); message = rsa.getString("Message"); status = rsa.getString("Status"); } } catch (Exception e) { System.out.println(e.getMessage()); } if(request.getParameter("pname") != null && !request.getParameter("pname").isEmpty()){ Pname = request.getParameter("pname"); } if(request.getParameter("Dep") != null && !request.getParameter("Dep").isEmpty()){ Dep = request.getParameter("Dep"); } if(request.getParameter("dname") != null && !request.getParameter("dname").isEmpty()){ Dname = request.getParameter("dname"); } if(request.getParameter("date") != null && !request.getParameter("date").isEmpty()){ date = request.getParameter("date"); } if(request.getParameter("time") != null && !request.getParameter("time").isEmpty()){ Time = request.getParameter("time"); } if(request.getParameter("mail") != null && !request.getParameter("mail").isEmpty()){ mail = request.getParameter("mail"); } if(request.getParameter("number") != null && !request.getParameter("number").isEmpty()){ num = request.getParameter("number"); } if(request.getParameter("message") != null && !request.getParameter("message").isEmpty()){ message = request.getParameter("message"); } if(app.updateAppointment(id, Pname, Dep, Dname,date,Time,mail,num,message,status)){ out.println("<script type=\"text/javascript\">"); out.println("alert('Successfully Updated !! ');"); out.println("location='profiles/adminprofile/appointments.html';"); out.println("</script>"); }else{ out.println("<script type=\"text/javascript\">"); out.println("alert('Error :( ');"); out.println("location='profiles/adminprofile/appointments.html';"); out.println("</script>"); } } // <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> }
[ "63660305+Pubzzz@users.noreply.github.com" ]
63660305+Pubzzz@users.noreply.github.com
529e8768312ce20653b7b2e566ecb5022f4f0dcd
d03da7cba4cc881384618be6bcd9177de7df2bc3
/hellocucumber/src/main/java/hellocucumber/stepdef/BoardStep.java
1a66703a6487f4675b6b9a1f0b835e807621c97e
[]
no_license
NanjanChung/cucumber_practice
f2c0465a5f2958ea2e9c57e55a33f052864ae8d7
20ea38a4243f79519a26cfa1e122498f6a2e60b7
refs/heads/master
2022-10-06T23:44:55.500590
2018-06-06T11:51:44
2018-06-06T11:51:44
135,658,640
0
0
null
2022-09-29T16:47:33
2018-06-01T02:38:30
Java
UTF-8
Java
false
false
1,545
java
package hellocucumber.stepdef; import java.util.ArrayList; import java.util.List; import cucumber.api.DataTable; import cucumber.api.java.en.Given; import cucumber.api.java.en.Then; import cucumber.api.java.en.When; public class BoardStep { private List<List<String>> board; @Given("^a board like this:$") public void a_board_like_this (DataTable table) throws Exception { this.board = new ArrayList<List<String>>(); for (List<String> row : table.raw()) { this.board.add(new ArrayList<String>(row)); } // Write code here that turns the phrase above into concrete actions // For automatic transformation, change DataTable to one of // List<YourType>, List<List<E>>, List<Map<K,V>> or Map<K,V>. // E,K,V must be a scalar (String, Integer, Date, enum etc) } @When("^player x plays in row (\\d+), column (\\d+)$") public void player_x_plays_in_row_column (int row, int column) throws Exception { board.get(row).set(column, "x"); } @Then("^the board should look like this:$") public void the_board_should_look_like_this (DataTable expectedTable) throws Exception { expectedTable.diff(board); // Write code here that turns the phrase above into concrete actions // For automatic transformation, change DataTable to one of // List<YourType>, List<List<E>>, List<Map<K,V>> or Map<K,V>. // E,K,V must be a scalar (String, Integer, Date, enum etc) } }
[ "dchung@netbase.com" ]
dchung@netbase.com
f60389c92ea5954060cd4d9f968f8ed46245ff2d
5bec8dbaa0879dc2d5565cf55e8d0b85992d92ee
/MovieVaultJee/MovieVaultFinalEjb/ejbModule/MovieVault/Persistence/Reponse.java
11f718f408abe55f21356c3f2bedc422ece6cf5b
[]
no_license
Frirou/CineastJee
6ebb29f4664a48f56489f58a719971e3709495d3
18b602b826e0dc9778eab72951baefb15adc705f
refs/heads/master
2021-01-10T17:22:44.234349
2016-03-21T12:16:18
2016-03-21T12:16:18
54,385,947
0
0
null
null
null
null
UTF-8
Java
false
false
1,125
java
package MovieVault.Persistence; import java.io.Serializable; import java.lang.String; import javax.persistence.*; /** * Entity implementation class for Entity: Reponse * */ @Entity public class Reponse implements Serializable { @Id @GeneratedValue(strategy=GenerationType.IDENTITY) private int id_rep; private String rep_1; private String rep_2; private String rep_3; private static final long serialVersionUID = 1L; @ManyToOne private Question question; public Question getQuestion() { return question; } public void setQuestion(Question question) { this.question = question; } public Reponse() { super(); } public int getId_rep() { return this.id_rep; } public void setId_rep(int id_rep) { this.id_rep = id_rep; } public String getRep_1() { return this.rep_1; } public void setRep_1(String rep_1) { this.rep_1 = rep_1; } public String getRep_2() { return this.rep_2; } public void setRep_2(String rep_2) { this.rep_2 = rep_2; } public String getRep_3() { return this.rep_3; } public void setRep_3(String rep_3) { this.rep_3 = rep_3; } }
[ "am.frioui@gmail.com" ]
am.frioui@gmail.com
ec6fbde412afa98a685ae820e19fe6bddfbe9b78
5c4a858b5546d067fd4da4ae37d3c86a4ec593fa
/docs/antora/modules/ROOT/examples/peacetrue-spring-operator/src/main/java/com/github/peacetrue/spring/operator/OperatorAdvisingPostProcessor.java
3e0dcefeab7c2d842499fd3fbf2df16a519420b5
[ "Apache-2.0" ]
permissive
peacetrue/peacetrue-spring
35d88e9b7a0969cd12e68d150c112b4a759fa3bd
3cbee65c47a985f99b72e4c799c34cb54524b3b9
refs/heads/master
2023-03-22T22:31:01.129017
2023-03-11T10:47:45
2023-03-11T10:47:45
211,640,115
3
0
null
null
null
null
UTF-8
Java
false
false
504
java
package com.github.peacetrue.spring.operator; import org.springframework.aop.Advisor; import org.springframework.aop.framework.autoproxy.AbstractBeanFactoryAwareAdvisingPostProcessor; import java.util.Objects; /** * 操作者织入后置处理器。 * * @author peace **/ public class OperatorAdvisingPostProcessor extends AbstractBeanFactoryAwareAdvisingPostProcessor { public OperatorAdvisingPostProcessor(Advisor advisor) { this.advisor = Objects.requireNonNull(advisor); } }
[ "xiayouxue@gmail.com" ]
xiayouxue@gmail.com
756cde94d1da28bc339e5b9b89aa6d1022adadd2
bbbda7920e9bf38943dc2b4d6d477d28c5a3de63
/wxapp-server/src/main/java/com/wxapp/cms/controller/SettingController.java
a983a9c18ad0ed99f281ffe44d73046d7c860ca0
[ "MIT" ]
permissive
itsoo/wxapp-cms
7ecf7fc5c9fd8d401ec8f57560a3a44a5a057c9b
edaa1ba0c16c4699f2a02518455e0c91b196849d
refs/heads/master
2022-06-25T06:03:39.478859
2021-07-22T15:26:36
2021-07-22T15:26:36
154,524,560
4
2
MIT
2022-06-21T00:51:14
2018-10-24T15:26:33
Java
UTF-8
Java
false
false
588
java
package com.wxapp.cms.controller; import com.wxapp.cms.controller.base.BaseController; import com.wxapp.cms.service.SettingService; /** * 设置控制层 * * @author zxy */ public class SettingController extends BaseController { private SettingService service = SettingService.me; /** * 查询系统设置 */ public void queryById() { renderJson(service.queryById(getOpenId())); } /** * 修改系统设置 */ public void update() { setAttr("success", service.update(getRequestMap("id"))); renderJson(); } }
[ "84235789@qq.com" ]
84235789@qq.com
71ad1b51cabb5f0f86b1417ff089771dc1864ea6
4905a9c75df93f526e0570f008443fa49a4279e4
/src/main/java/edu/suai/recommendations/security/WebSecurityConfig.java
811fcd56d5daeb0e831e0162062dd6a0d3118f3a
[]
no_license
13thUnknown/Adviser
5f4053fb0d46fd7d51715eb22cf3e2be2d06695c
d7a539fdf07b68602571a9ec6bb613d037a711a5
refs/heads/master
2022-12-10T15:38:03.495241
2020-09-13T12:45:55
2020-09-13T12:45:55
239,205,229
0
0
null
null
null
null
UTF-8
Java
false
false
2,771
java
package edu.suai.recommendations.security; import edu.suai.recommendations.common.RolesEnum; import edu.suai.recommendations.service.UserService; import lombok.AllArgsConstructor; import lombok.SneakyThrows; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.core.userdetails.User; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.provisioning.InMemoryUserDetailsManager; @Configuration @EnableWebSecurity @AllArgsConstructor public class WebSecurityConfig extends WebSecurityConfigurerAdapter { private final UserService userService; @Override protected void configure(HttpSecurity http) throws Exception { http .csrf() .disable() .authorizeRequests() .antMatchers("/", "/index","/home","/css/**","/sing-up").permitAll() .antMatchers("/js","/control").hasRole("ADMIN") .anyRequest().authenticated() .and() .formLogin() .loginPage("/login") .defaultSuccessUrl("/") .permitAll() .and() .logout() .logoutUrl("/logout") .logoutSuccessUrl("/") .permitAll(); } @Bean @Override public UserDetailsService userDetailsService() { UserDetails user = User.withDefaultPasswordEncoder() .username("1") .password("1") .roles("Admin") .build(); return new InMemoryUserDetailsManager(user); } @SneakyThrows @Autowired public void configureGlobal(AuthenticationManagerBuilder auth){ auth.userDetailsService(userService).passwordEncoder(passwordEncoder()); } @Bean public BCryptPasswordEncoder passwordEncoder() { return new BCryptPasswordEncoder(); } }
[ "noreply@github.com" ]
13thUnknown.noreply@github.com
f04aefa530643736b8f640a1633fbf35b0ee586a
bd4d151b0cc420240713338012c008b9edae02a2
/src/main/java/br/com/jcp/model/estabelecimento/EstabelecimentoRepository.java
181c3b9691a7814d06ef01de9ff2ce6cad1e24cb
[]
no_license
jeanpandini/api-recebimento
acae774892f25c5b8af10ea8cff2265d7492decc
f423688c73b89ed278c33b0a35cf385bfd0fc733
refs/heads/master
2020-04-06T07:07:41.215299
2018-03-07T04:30:19
2018-03-07T04:30:19
124,178,739
1
0
null
null
null
null
UTF-8
Java
false
false
199
java
package br.com.jcp.model.estabelecimento; import org.springframework.data.jpa.repository.JpaRepository; public interface EstabelecimentoRepository extends JpaRepository<Estabelecimento, Long> { }
[ "jean@jcp-notebook.lan" ]
jean@jcp-notebook.lan
f200aef412b943df2dcd8f9492cef1029c40b4c9
a343e29f8cf5e6cedf2c10656745100c15dc39f6
/samza-sql-planner/src/main/java/org/apache/samza/sql/physical/window/SlidingWindowGroup.java
3461bab37974028a3082e1643127da0de632fd07
[ "Apache-2.0" ]
permissive
desperado1992/samza-sql
1cafc981f5a6be76d1150563f4740e8470a49e05
227b0d62635db0eb6c99271f52442b75289d207e
refs/heads/master
2021-05-31T22:54:15.833757
2016-06-03T19:26:14
2016-06-03T19:26:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
9,888
java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.samza.sql.physical.window; import org.apache.calcite.linq4j.tree.Expressions; import org.apache.calcite.rel.RelCollation; import org.apache.calcite.rel.RelFieldCollation; import org.apache.calcite.rel.type.RelDataType; import org.apache.calcite.rel.type.RelDataTypeField; import org.apache.calcite.sql.type.SqlTypeName; import org.apache.samza.SamzaException; import org.apache.samza.sql.data.IntermediateMessageTuple; import org.apache.samza.sql.window.storage.MessageStore; import org.apache.samza.sql.window.storage.OrderedStoreKey; import org.apache.samza.sql.window.storage.TimeAndOffsetKey; import org.apache.samza.sql.window.storage.TimeKey; import org.apache.samza.storage.kv.Entry; import org.apache.samza.storage.kv.KeyValueIterator; import org.apache.samza.storage.kv.KeyValueStore; import org.apache.samza.task.TaskContext; import org.apache.samza.task.sql.SimpleMessageCollector; import java.sql.Date; import java.sql.Time; import java.util.ArrayList; import java.util.List; public class SlidingWindowGroup { /** * Keep windows within the retention period */ private WindowStore windowStore; private MessageStore messageStore; /** * Constants used in aggregate expressions */ private final List<Expressions> constants; /** * Stream window group id */ private final String id; /** * Field where this stream is ordered */ private final int orderFieldIndex; private final SqlTypeName orderFieldTypeName; /** * Type of the input tuple */ private final RelDataType inputType; /** * Type of the output tuple */ private final RelDataType outputType; /** * Lower bound of the current sliding window in milli seconds */ private long lowerBoundMillis = Long.MAX_VALUE; /** * Upper bound of the current sliding window in milli seconds. In streaming upper bound will always be the max * timestamp the operator has seen. */ private long upperBoundMillis = Long.MIN_VALUE; private final long windowPrecededByMills; public SlidingWindowGroup(String id, long windowPrecededByMills, List<Expressions> constants, RelCollation orderKeys, RelDataType inputType, RelDataType outputType) { this.id = id; this.windowPrecededByMills = windowPrecededByMills; this.constants = constants; if (orderKeys.getFieldCollations().size() != 1) { throw new SamzaException("For time based sliding windows, ORDER BY should have exactly one expression. Actual collation is " + orderKeys); } RelFieldCollation fieldCollation = orderKeys.getFieldCollations().get(0); RelFieldCollation.Direction orderFieldDirection = fieldCollation.getDirection(); if (orderFieldDirection != RelFieldCollation.Direction.ASCENDING && orderFieldDirection != RelFieldCollation.Direction.STRICTLY_ASCENDING) { throw new SamzaException("For time based sliding window, we expect increasing time column"); // TODO: is increasing this necessary } RelDataTypeField orderFieldType = inputType.getFieldList().get(fieldCollation.getFieldIndex()); this.orderFieldTypeName = orderFieldType.getType().getSqlTypeName(); if (orderFieldTypeName != SqlTypeName.DATE && orderFieldTypeName != SqlTypeName.TIME && orderFieldTypeName != SqlTypeName.TIMESTAMP) { throw new SamzaException("For time based sliding window, order field should be one of the following types: DATE, TIME, TIMESTAMP"); } this.orderFieldIndex = orderFieldType.getIndex(); this.inputType = inputType; this.outputType = outputType; } public void init(TaskContext taskContext) { this.windowStore = new WindowStore( (KeyValueStore<OrderedStoreKey, TimeBasedSlidingWindowAggregatorState>) taskContext.getStore("wnd-store-" + id)); this.messageStore = (MessageStore) taskContext.getStore("wnd-msg-" + id); } public IntermediateMessageTuple send(IntermediateMessageTuple t, SimpleMessageCollector collector) { /* * 09-26-2015 - Milinda Pathirage * ============================== * - Handling late arrivals is not clear yet. So the basic implementation discard late arrivals. * - Output tuple contains input tuple + aggregated values * - TODO: Implement support for count and sum * - TODO: lower and upper bounds should be updated as we go along (use current tuple's timestamp or max time stamp as a reference) * - TODO: we need to generate expressions to update lower bound and upper bound * - TODO: Logic can be discovered by writing a simple test program calculating time based sliding window */ // TODO: We need to process this and compute on it to check whether message is in the window Object tupleTimeObj = t.getContent()[orderFieldIndex]; Long tupleTimestamp; switch (orderFieldTypeName) { case DATE: tupleTimestamp = ((Date) tupleTimeObj).getTime(); break; case TIME: tupleTimestamp = ((Time) tupleTimeObj).getTime(); break; case TIMESTAMP: tupleTimestamp = (Long) tupleTimeObj; break; default: throw new SamzaException("Order fields type should be a time related type."); } if(isReplay(tupleTimestamp, t)){ /* TODO: Handling replay may not be simple like this. We may need to persist bounds as well or update bounds from replayed messages. */ return null; } /* Persisting the tuple to handle replay, etc. */ messageStore.put(new TimeAndOffsetKey(tupleTimestamp, t.getOffset()), t); if (tupleTimestamp > upperBoundMillis) { /* Sliding window's upper bound is calculated based on timestamps of the incoming tuples. If messages get delayed * and we somehow receive a message from future with respect to the current flow, some message may get lost * because their timestamp is lower than the lower bound calculated based on upper bound. * TODO: Explore how to utilize techniques (punctuations, low water marks, heart beats) from literature to solve this case. */ upperBoundMillis = tupleTimestamp; } if (upperBoundMillis > windowPrecededByMills) { lowerBoundMillis = upperBoundMillis - windowPrecededByMills; } else { if (tupleTimestamp < lowerBoundMillis) { lowerBoundMillis = tupleTimestamp; } } /* if(tupleTimestamp > getUpperBound(i)) { updateUpperBound(i, tupleTimestamp); } if (getLowerBound(i) == Long.MAX_VALUE) { updateLowerBound(i, tupleTimestamp); } else { Long diff = calculateLowerBound(getUpperBound(i)); if ( diff > 0 ) { updateLowerBound(i, diff); } } KeyValueIterator<OrderedStoreKey, TimeBasedSlidingWindowAggregateState> messagesToPurge = windowStore.range(new TimeKey(0L), new TimeKey(lowerBound)); // Lets say aggregate is a count and we have partitions. Lets also assume that we only supports monotonic aggregates // so for each group, we have to initialize aggregate state // AggregateState {Map<aggId or agg Name, aggValue>} // Map<GroupId, Map<Partition, AggState>> aggs if(getPartitions(gId) == null) { initPartitions(gId); } Map<Partition, AggState> aggState = getAggregateState(gId); forAll(messagesToPurge) { Partition pkey = createPartitionFromTuple(pt); removeValue(aggState.get(pKey), pt); } Partion pkey = createPartitionKeyFromTuple(t); AggState st = aggState.get(pkey); addCurrentTuple(st, t); emitResult(st, t); purgeMessages(); */ KeyValueIterator<OrderedStoreKey, TimeBasedSlidingWindowAggregatorState> messagesToPurge = windowStore.range(new TimeKey(0L), new TimeKey(lowerBoundMillis)); List<OrderedStoreKey> messageKeysToPurge = new ArrayList<OrderedStoreKey>(); while(messagesToPurge.hasNext()){ Entry<OrderedStoreKey, TimeBasedSlidingWindowAggregatorState> message = messagesToPurge.next(); // TODO: Update aggregates messageKeysToPurge.add(message.getKey()); } for(OrderedStoreKey key: messageKeysToPurge){ windowStore.delete(key); } if(tupleTimestamp >= lowerBoundMillis){ OrderedStoreKey timeKey = new TimeKey(tupleTimestamp); TimeBasedSlidingWindowAggregatorState state = windowStore.get(timeKey); if(state != null) { // state.addTuple(tupleTimestamp, t.getOffset()); // TODO: Do we need to update bounds as well windowStore.put(timeKey, state); } else { // TODO: Dow we really need offset windowStore.put(timeKey, null); } // Calcite has standard aggregator implementors. What I need to do is select the proper partition and invoke the aggregator accorss that partition // We need to decide how we store partitions of window } return null; } private boolean isReplay(long tupleTimestamp, IntermediateMessageTuple tuple) { return messageStore.get(new TimeAndOffsetKey(tupleTimestamp, tuple.getOffset())) != null; } }
[ "milinda.pathirage@gmail.com" ]
milinda.pathirage@gmail.com
1d766f07077048338b995da23711e4b9e75223ac
295b2b42204c3430dc1fe1f12af42fc9bf8f791f
/src/main/java/com/server/user/item/entity/ItemStorageEnt.java
be5746051a52aa89de2c93b6487caf056bb45e82
[]
no_license
yyy0/GameDemo
e53687744390dc06d3a64aee9000f1e20338e55e
1b19919e61670c83ca4a126d59f01617b317f070
refs/heads/master
2022-11-26T23:22:02.538801
2020-02-06T07:39:58
2020-02-06T07:39:58
182,914,882
1
1
null
2022-11-16T08:51:15
2019-04-23T02:55:02
Java
UTF-8
Java
false
false
2,117
java
package com.server.user.item.entity; import com.server.tool.JsonUtils; import com.server.user.item.constant.StorageConstant; import com.server.user.item.storage.ItemStorage; import javax.persistence.*; /** * 背包 * * @author yuxianming * @date 2019/5/13 21:52 */ @Entity @Table(name = "item_storage") public class ItemStorageEnt { @Id @Column(columnDefinition = "varchar(255) CHARACTER SET utf8 COLLATE utf8_bin comment '账号名称'", nullable = false) private String accountId; @Transient private ItemStorage itemStorage; @Lob @Column(columnDefinition = "blob comment '账号背包数据'") private byte[] storageData; public static ItemStorageEnt valueOf(String accountId) { ItemStorageEnt storageEnt = new ItemStorageEnt(); storageEnt.accountId = accountId; ItemStorage storage = ItemStorage.valueOf(); int maxSize = StorageConstant.BAG_MAXSIZE; storage.ensureCapacity(maxSize); storageEnt.setItemStorage(storage); storageEnt.doSerialize(); return storageEnt; } public boolean doSerialize() { this.storageData = JsonUtils.objToByte(itemStorage); return true; } public boolean doSerialize(ItemStorage itemStorage) { this.storageData = JsonUtils.objToByte(itemStorage); return true; } public boolean doDeserialize() { this.itemStorage = JsonUtils.byteToObj(storageData, ItemStorage.class); int maxSize = StorageConstant.BAG_MAXSIZE; this.itemStorage.ensureCapacity(maxSize); return true; } public String getAccountId() { return accountId; } public void setAccountId(String accountId) { this.accountId = accountId; } public ItemStorage getItemStorage() { return itemStorage; } public void setItemStorage(ItemStorage itemStorage) { this.itemStorage = itemStorage; } public byte[] getStorageData() { return storageData; } public void setStorageData(byte[] storageData) { this.storageData = storageData; } }
[ "649675065@qq.com" ]
649675065@qq.com
2112420308006ae3949bbc7adc50253dbb4618b5
fc36199760e3fbff1777e299fb922a48321fa60d
/src/test/java/com/github/mauricioaniche/springlint/analysis/smells/controller/NumberOfRoutesVisitorTest.java
dd591a0567dc7295541e22aea93082bcb7074b47
[ "Apache-2.0" ]
permissive
aspineon/springlint
e353d746d5d0c44ddd02e51affac89d1c80eede7
ca89018c244c55f545a3e8563f7ac83fa7f36429
refs/heads/master
2021-09-26T20:40:19.840328
2017-01-04T15:21:05
2017-01-04T15:21:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,504
java
package com.github.mauricioaniche.springlint.analysis.smells.controller; import java.io.ByteArrayInputStream; import java.util.Collections; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import com.github.mauricioaniche.springlint.analysis.smells.controller.NumberOfRoutesVisitor; import com.github.mauricioaniche.springlint.domain.SmellyClass; import com.github.mauricioaniche.springlint.utils.jdt.SingleClassJDTRunner; public class NumberOfRoutesVisitorTest { private SmellyClass clazz; @Before public void setUp() { clazz = new SmellyClass("a", "a", "class", "", Collections.emptySet()); } @Test public void shouldCountAnnotations() { String sc = "class Controller {" + "@RequestMapping" + " public void m1() {" + " a = a + 1;" + " }" + "@RequestMapping" + " public void m2() {" + " a = a + 1;" + " }" + "}" ; NumberOfRoutesVisitor visitor = new NumberOfRoutesVisitor(clazz); new SingleClassJDTRunner().visit(visitor, new ByteArrayInputStream(sc.getBytes())); Assert.assertEquals(2, clazz.getAttribute("number-of-routes")); } @Test public void shouldCountAnnotationsWithSingleMember() { String sc = "class Controller {" + "@RequestMapping(\"bla\")" + " public void m1() {" + " a = a + 1;" + " }" + "}" ; NumberOfRoutesVisitor visitor = new NumberOfRoutesVisitor(clazz); new SingleClassJDTRunner().visit(visitor, new ByteArrayInputStream(sc.getBytes())); Assert.assertEquals(1, clazz.getAttribute("number-of-routes")); } @Test public void shouldCountAnnotationsWithManyParams() { String sc = "class Entity {" + "@RequestMapping(rota=\"bla\", rota2=2)" + " public void m1() {" + " a = a + 1;" + " }" + "}" ; NumberOfRoutesVisitor visitor = new NumberOfRoutesVisitor(clazz); new SingleClassJDTRunner().visit(visitor, new ByteArrayInputStream(sc.getBytes())); Assert.assertEquals(1, clazz.getAttribute("number-of-routes")); } @Test public void shouldIgnoreOtherAnnotations() { String sc = "class Entity {" + "@Bla @Ble(1) @Bli(rota=1,rota2=2)" + " public void m1() {" + " a = a + 1;" + " }" + "}" ; NumberOfRoutesVisitor visitor = new NumberOfRoutesVisitor(clazz); new SingleClassJDTRunner().visit(visitor, new ByteArrayInputStream(sc.getBytes())); Assert.assertEquals(0, clazz.getAttribute("number-of-routes")); } }
[ "mauricioaniche@gmail.com" ]
mauricioaniche@gmail.com
f22ff4e3c85e14565c643793275b9d72e24dca1d
341a1d3f3d61284e9fbd1ac5d1f627c6ef7499bc
/app/src/main/java/com/myhealth/measurementemulator/measurementemulator/measurement/BaseMeasurement.java
036dd63cd277e8f7636029b8b01f77bf366c0d00
[]
no_license
MyHealthHanze/MeasurementEmulator
ffc5a5fb32bf52a5d42f7ce2bd42bc98fb3099b8
c55145689d72f2bc387e2d4ff96b9f8bc30c60ec
refs/heads/master
2021-01-13T02:11:45.063776
2015-10-07T09:49:57
2015-10-07T09:49:57
42,237,549
0
0
null
2015-09-30T12:10:46
2015-09-10T10:17:33
Java
UTF-8
Java
false
false
1,112
java
package com.myhealth.measurementemulator.measurementemulator.measurement; /** * Created by Sander on 28-9-2015. * A Base for other measurements, to hold the date and time */ public class BaseMeasurement { // The date and time of the measurement private String measurementDate; // The type of the measurement private String type; public BaseMeasurement(String type) { setType(type); } /** * Get the date and time of the measurement * * @return The date and time */ public String getMeasurementDate() { return measurementDate; } /** * Set the date and time of the measurement * * @param measurementDate The date and time */ public void setMeasurementDate(String measurementDate) { this.measurementDate = measurementDate; } /** * Get the type * * @return The type */ public String getType() { return type; } /** * Set the type * * @param type The type */ public void setType(String type) { this.type = type; } }
[ "masterfenrir@outlook.com" ]
masterfenrir@outlook.com
23fb5ad46c530d87f4bc07dc91a47ecdfe688cb7
c6d93152ab18b0e282960b8ff224a52c88efb747
/huntkey/code/biz-purchase-method/biz-purchase-method-common/src/main/java/com/huntkey/rx/purchase/common/model/custom/CumoSystemSetDTO.java
03bba75f091b9ddf0ce6c6d42685ecd24bf52e36
[]
no_license
BAT6188/company-database
adfe5d8b87b66cd51efd0355e131de164b69d3f9
40d0342345cadc51ca2555840e32339ca0c83f51
refs/heads/master
2023-05-23T22:18:22.702550
2018-12-25T00:58:15
2018-12-25T00:58:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,543
java
package com.huntkey.rx.purchase.common.model.custom; import com.alibaba.fastjson.annotation.JSONField; import java.io.Serializable; /** * 客户维护单-体系认证DTO * * @author zhangyu * @create 2018-01-03 9:55 **/ public class CumoSystemSetDTO implements Serializable { /** * id */ @JSONField(name = "id") private String id; /** * pid */ @JSONField(name = "pid") private String pid; /** * 体系名称 */ @JSONField(name = "cumo_sname") private String cumoSname; /** * 体系名称(旧) */ @JSONField(name = "cumo_sname_old") private String cumoSnameOld; 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 getCumoSname() { return cumoSname; } public void setCumoSname(String cumoSname) { this.cumoSname = cumoSname; } public String getCumoSnameOld() { return cumoSnameOld; } public void setCumoSnameOld(String cumoSnameOld) { this.cumoSnameOld = cumoSnameOld; } @Override public String toString() { return "CumoSystemSetDTO{" + "id='" + id + '\'' + ", pid='" + pid + '\'' + ", cumoSname='" + cumoSname + '\'' + ", cumoSnameOld='" + cumoSnameOld + '\'' + '}'; } }
[ "729235023@qq.com" ]
729235023@qq.com
f829b5bcfc457333aa7e8848a6f8a2ff49080902
a385e88fd3bee2dfcce2c585d83ee3a555f859a0
/src/main/java/uk/ac/glam/wcsclient/gml311/LinearCSRefType.java
8a60fbe546d2b9a057c2c1b120dd4292d898f70c
[]
no_license
deadpassive/wcsclient
d6bf681fc1cab5212cd4a97cf3922d48880f13a2
f0679c2403477b64616ffc1eda7ce1a078694f50
refs/heads/master
2016-09-06T03:09:35.958567
2012-11-15T09:46:15
2012-11-15T09:46:15
6,627,114
0
1
null
null
null
null
UTF-8
Java
false
false
14,396
java
/** * <copyright> * </copyright> * * $Id$ */ package uk.ac.glam.wcsclient.gml311; import org.eclipse.emf.ecore.EObject; import uk.ac.glam.wcsclient.wcs111.xlink.ActuateType; import uk.ac.glam.wcsclient.wcs111.xlink.ShowType; /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>Linear CS Ref Type</b></em>'. * <!-- end-user-doc --> * * <!-- begin-model-doc --> * Association to a linear coordinate system, either referencing or containing the definition of that coordinate system. * <!-- end-model-doc --> * * <p> * The following features are supported: * <ul> * <li>{@link uk.ac.glam.wcsclient.gml311.LinearCSRefType#getLinearCS <em>Linear CS</em>}</li> * <li>{@link uk.ac.glam.wcsclient.gml311.LinearCSRefType#getActuate <em>Actuate</em>}</li> * <li>{@link uk.ac.glam.wcsclient.gml311.LinearCSRefType#getArcrole <em>Arcrole</em>}</li> * <li>{@link uk.ac.glam.wcsclient.gml311.LinearCSRefType#getHref <em>Href</em>}</li> * <li>{@link uk.ac.glam.wcsclient.gml311.LinearCSRefType#getRemoteSchema <em>Remote Schema</em>}</li> * <li>{@link uk.ac.glam.wcsclient.gml311.LinearCSRefType#getRole <em>Role</em>}</li> * <li>{@link uk.ac.glam.wcsclient.gml311.LinearCSRefType#getShow <em>Show</em>}</li> * <li>{@link uk.ac.glam.wcsclient.gml311.LinearCSRefType#getTitle <em>Title</em>}</li> * <li>{@link uk.ac.glam.wcsclient.gml311.LinearCSRefType#getType <em>Type</em>}</li> * </ul> * </p> * * @see uk.ac.glam.wcsclient.gml311.Gml311Package#getLinearCSRefType() * @model extendedMetaData="name='LinearCSRefType' kind='elementOnly'" * @generated */ public interface LinearCSRefType extends EObject { /** * Returns the value of the '<em><b>Linear CS</b></em>' containment reference. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Linear CS</em>' containment reference isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Linear CS</em>' containment reference. * @see #setLinearCS(LinearCSType) * @see uk.ac.glam.wcsclient.gml311.Gml311Package#getLinearCSRefType_LinearCS() * @model containment="true" * extendedMetaData="kind='element' name='LinearCS' namespace='##targetNamespace'" * @generated */ LinearCSType getLinearCS(); /** * Sets the value of the '{@link uk.ac.glam.wcsclient.gml311.LinearCSRefType#getLinearCS <em>Linear CS</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Linear CS</em>' containment reference. * @see #getLinearCS() * @generated */ void setLinearCS(LinearCSType value); /** * Returns the value of the '<em><b>Actuate</b></em>' attribute. * The literals are from the enumeration {@link uk.ac.glam.wcsclient.wcs111.xlink.ActuateType}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * <!-- begin-model-doc --> * * The 'actuate' attribute is used to communicate the desired timing * of traversal from the starting resource to the ending resource; * it's value should be treated as follows: * onLoad - traverse to the ending resource immediately on loading * the starting resource * onRequest - traverse from the starting resource to the ending * resource only on a post-loading event triggered for * this purpose * other - behavior is unconstrained; examine other markup in link * for hints * none - behavior is unconstrained * * <!-- end-model-doc --> * @return the value of the '<em>Actuate</em>' attribute. * @see uk.ac.glam.wcsclient.wcs111.xlink.ActuateType * @see #isSetActuate() * @see #unsetActuate() * @see #setActuate(ActuateType) * @see uk.ac.glam.wcsclient.gml311.Gml311Package#getLinearCSRefType_Actuate() * @model unsettable="true" * extendedMetaData="kind='attribute' name='actuate' namespace='http://www.w3.org/1999/xlink'" * @generated */ ActuateType getActuate(); /** * Sets the value of the '{@link uk.ac.glam.wcsclient.gml311.LinearCSRefType#getActuate <em>Actuate</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Actuate</em>' attribute. * @see uk.ac.glam.wcsclient.wcs111.xlink.ActuateType * @see #isSetActuate() * @see #unsetActuate() * @see #getActuate() * @generated */ void setActuate(ActuateType value); /** * Unsets the value of the '{@link uk.ac.glam.wcsclient.gml311.LinearCSRefType#getActuate <em>Actuate</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #isSetActuate() * @see #getActuate() * @see #setActuate(ActuateType) * @generated */ void unsetActuate(); /** * Returns whether the value of the '{@link uk.ac.glam.wcsclient.gml311.LinearCSRefType#getActuate <em>Actuate</em>}' attribute is set. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return whether the value of the '<em>Actuate</em>' attribute is set. * @see #unsetActuate() * @see #getActuate() * @see #setActuate(ActuateType) * @generated */ boolean isSetActuate(); /** * Returns the value of the '<em><b>Arcrole</b></em>' attribute. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Arcrole</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Arcrole</em>' attribute. * @see #setArcrole(String) * @see uk.ac.glam.wcsclient.gml311.Gml311Package#getLinearCSRefType_Arcrole() * @model dataType="org.eclipse.emf.ecore.xml.type.AnyURI" * extendedMetaData="kind='attribute' name='arcrole' namespace='http://www.w3.org/1999/xlink'" * @generated */ String getArcrole(); /** * Sets the value of the '{@link uk.ac.glam.wcsclient.gml311.LinearCSRefType#getArcrole <em>Arcrole</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Arcrole</em>' attribute. * @see #getArcrole() * @generated */ void setArcrole(String value); /** * Returns the value of the '<em><b>Href</b></em>' attribute. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Href</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Href</em>' attribute. * @see #setHref(String) * @see uk.ac.glam.wcsclient.gml311.Gml311Package#getLinearCSRefType_Href() * @model dataType="org.eclipse.emf.ecore.xml.type.AnyURI" * extendedMetaData="kind='attribute' name='href' namespace='http://www.w3.org/1999/xlink'" * @generated */ String getHref(); /** * Sets the value of the '{@link uk.ac.glam.wcsclient.gml311.LinearCSRefType#getHref <em>Href</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Href</em>' attribute. * @see #getHref() * @generated */ void setHref(String value); /** * Returns the value of the '<em><b>Remote Schema</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * <!-- begin-model-doc --> * Reference to an XML Schema fragment that specifies the content model of the propertys value. This is in conformance with the XML Schema Section 4.14 Referencing Schemas from Elsewhere. * <!-- end-model-doc --> * @return the value of the '<em>Remote Schema</em>' attribute. * @see #setRemoteSchema(String) * @see uk.ac.glam.wcsclient.gml311.Gml311Package#getLinearCSRefType_RemoteSchema() * @model dataType="org.eclipse.emf.ecore.xml.type.AnyURI" * extendedMetaData="kind='attribute' name='remoteSchema' namespace='##targetNamespace'" * @generated */ String getRemoteSchema(); /** * Sets the value of the '{@link uk.ac.glam.wcsclient.gml311.LinearCSRefType#getRemoteSchema <em>Remote Schema</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Remote Schema</em>' attribute. * @see #getRemoteSchema() * @generated */ void setRemoteSchema(String value); /** * Returns the value of the '<em><b>Role</b></em>' attribute. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Role</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Role</em>' attribute. * @see #setRole(String) * @see uk.ac.glam.wcsclient.gml311.Gml311Package#getLinearCSRefType_Role() * @model dataType="org.eclipse.emf.ecore.xml.type.AnyURI" * extendedMetaData="kind='attribute' name='role' namespace='http://www.w3.org/1999/xlink'" * @generated */ String getRole(); /** * Sets the value of the '{@link uk.ac.glam.wcsclient.gml311.LinearCSRefType#getRole <em>Role</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Role</em>' attribute. * @see #getRole() * @generated */ void setRole(String value); /** * Returns the value of the '<em><b>Show</b></em>' attribute. * The literals are from the enumeration {@link uk.ac.glam.wcsclient.wcs111.xlink.ShowType}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * <!-- begin-model-doc --> * * The 'show' attribute is used to communicate the desired presentation * of the ending resource on traversal from the starting resource; it's * value should be treated as follows: * new - load ending resource in a new window, frame, pane, or other * presentation context * replace - load the resource in the same window, frame, pane, or * other presentation context * embed - load ending resource in place of the presentation of the * starting resource * other - behavior is unconstrained; examine other markup in the * link for hints * none - behavior is unconstrained * * <!-- end-model-doc --> * @return the value of the '<em>Show</em>' attribute. * @see uk.ac.glam.wcsclient.wcs111.xlink.ShowType * @see #isSetShow() * @see #unsetShow() * @see #setShow(ShowType) * @see uk.ac.glam.wcsclient.gml311.Gml311Package#getLinearCSRefType_Show() * @model unsettable="true" * extendedMetaData="kind='attribute' name='show' namespace='http://www.w3.org/1999/xlink'" * @generated */ ShowType getShow(); /** * Sets the value of the '{@link uk.ac.glam.wcsclient.gml311.LinearCSRefType#getShow <em>Show</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Show</em>' attribute. * @see uk.ac.glam.wcsclient.wcs111.xlink.ShowType * @see #isSetShow() * @see #unsetShow() * @see #getShow() * @generated */ void setShow(ShowType value); /** * Unsets the value of the '{@link uk.ac.glam.wcsclient.gml311.LinearCSRefType#getShow <em>Show</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #isSetShow() * @see #getShow() * @see #setShow(ShowType) * @generated */ void unsetShow(); /** * Returns whether the value of the '{@link uk.ac.glam.wcsclient.gml311.LinearCSRefType#getShow <em>Show</em>}' attribute is set. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return whether the value of the '<em>Show</em>' attribute is set. * @see #unsetShow() * @see #getShow() * @see #setShow(ShowType) * @generated */ boolean isSetShow(); /** * Returns the value of the '<em><b>Title</b></em>' attribute. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Title</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Title</em>' attribute. * @see #setTitle(String) * @see uk.ac.glam.wcsclient.gml311.Gml311Package#getLinearCSRefType_Title() * @model dataType="org.eclipse.emf.ecore.xml.type.String" * extendedMetaData="kind='attribute' name='title' namespace='http://www.w3.org/1999/xlink'" * @generated */ String getTitle(); /** * Sets the value of the '{@link uk.ac.glam.wcsclient.gml311.LinearCSRefType#getTitle <em>Title</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Title</em>' attribute. * @see #getTitle() * @generated */ void setTitle(String value); /** * Returns the value of the '<em><b>Type</b></em>' attribute. * The default value is <code>"simple"</code>. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Type</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Type</em>' attribute. * @see #isSetType() * @see #unsetType() * @see #setType(String) * @see uk.ac.glam.wcsclient.gml311.Gml311Package#getLinearCSRefType_Type() * @model default="simple" unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.String" * extendedMetaData="kind='attribute' name='type' namespace='http://www.w3.org/1999/xlink'" * @generated */ String getType(); /** * Sets the value of the '{@link uk.ac.glam.wcsclient.gml311.LinearCSRefType#getType <em>Type</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Type</em>' attribute. * @see #isSetType() * @see #unsetType() * @see #getType() * @generated */ void setType(String value); /** * Unsets the value of the '{@link uk.ac.glam.wcsclient.gml311.LinearCSRefType#getType <em>Type</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #isSetType() * @see #getType() * @see #setType(String) * @generated */ void unsetType(); /** * Returns whether the value of the '{@link uk.ac.glam.wcsclient.gml311.LinearCSRefType#getType <em>Type</em>}' attribute is set. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return whether the value of the '<em>Type</em>' attribute is set. * @see #unsetType() * @see #getType() * @see #setType(String) * @generated */ boolean isSetType(); } // LinearCSRefType
[ "mankillseverything@gmail.com" ]
mankillseverything@gmail.com
65412f0980a4afad9628a86f7e07966ad84c2812
1891adea40c0911c4f2254e4a22758ae8da744c3
/web_Tomcat/src/cn/it/ServletContext_code/Servlet_context01.java
2f00681b6746e1d5668932f947e75d8657eacff2
[]
no_license
suishisuidi000/repo5
d88948dd0e3c205d521f0931476c238b727e9ed8
fc5a7f77bc36e943a9dc561afcfa98001606992b
refs/heads/master
2020-06-03T12:45:40.059055
2019-06-13T06:12:12
2019-06-13T06:12:12
191,572,561
0
0
null
null
null
null
UTF-8
Java
false
false
1,356
java
package cn.it.ServletContext_code; import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.File; import java.io.IOException; @WebServlet("/servlet_context01") public class Servlet_context01 extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { /* ServletContext context = request.getServletContext(); String mimeType = context.getMimeType("c.jpg"); System.out.println(mimeType);*/ ServletContext context = this.getServletContext(); //web下的文件访问 String realPath = context.getRealPath("/a.txt"); System.out.println(realPath); File file = new File(realPath); //WEB-INF下的文件访问 String c = context.getRealPath("/WEB-INF/c.txt"); System.out.println(c); //src下的文件访问 String b = context.getRealPath("/WEB-INF/classes/b.txt"); System.out.println(b); } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request,response); } }
[ "suishisuidi000@163.com" ]
suishisuidi000@163.com
715444a8b7f5ba7c793f84481f02c9ab9118d049
d6f153ac2d76ee4f606b5058b9ea01f699ad7c95
/src/main/java/mode/demo/BroomFacoryDemo.java
0fb3824181595eb76c807ac9028810364c308ae1
[ "Apache-2.0" ]
permissive
Ecloss/Java-EE
4290613fe6f85273e4c97ee5ef6602d74a5dfb11
e56279576b2c41cdc296f19efcaed42f00d84137
refs/heads/master
2020-03-23T06:58:01.648491
2019-01-14T15:20:56
2019-01-14T15:20:56
141,240,280
0
0
Apache-2.0
2018-11-15T06:07:13
2018-07-17T06:13:55
Java
UTF-8
Java
false
false
423
java
package mode.demo; import mode.factory.morefactory.BaseVehicleFactory; import mode.factory.morefactory.Moveable; import mode.factory.morefactory.PlaneFactory; /** * 详细工厂模式,测试类 * * @author Ecloss */ public class BroomFacoryDemo { public static void main(String[] args) { BaseVehicleFactory factory = new PlaneFactory(); Moveable m = factory.create(); m.run(); } }
[ "yuxiuwen@cheok.com" ]
yuxiuwen@cheok.com
c451e2e4424efbecc798692a4806b0a865f9f7d7
25c8058dd63c712b11d7cb0d5fe9ee97892898c9
/src/main/java/cn/ken/question/answering/system/utils/TextFileReader.java
b0043282cd7421bcae33135fe4ee12057ff3ddf8
[]
no_license
shangkun/question-answering-system
21e5ec04127558190980de4f982a52e3f3cea31b
e43f73fa4f60d8362529b6228053a4b2bd869d5a
refs/heads/master
2020-03-22T23:19:27.644512
2018-09-20T06:20:00
2018-09-20T06:20:00
140,803,161
1
0
null
null
null
null
UTF-8
Java
false
false
5,028
java
package cn.ken.question.answering.system.utils; import cn.ken.question.answering.system.model.knowledge.LemmaList; import com.hankcs.hanlp.HanLP; import com.hankcs.hanlp.dictionary.stopword.CoreStopWordDictionary; import com.hankcs.hanlp.seg.common.Term; import java.io.*; import java.util.Arrays; import java.util.List; import java.util.Map; /** * author: shangkun <br/> * date: 2018/7/19 <br/> * what: TextFileReader <br/> */ public class TextFileReader{ private static final String START = "Q:"; private static final String END = "A:"; public static void readFileByLines(Map<String,String> map,String fileName){ File file = new File(fileName); if(!file.exists()){ return; } try (FileInputStream fileInputStream = new FileInputStream(fileName); InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream, "UTF-8"); BufferedReader reader = new BufferedReader(inputStreamReader)){ String tempString = null; String question = "",answer = ""; int q = 0,a = 0,qPlus = 0,aPlus = 0; while ((tempString = reader.readLine()) != null) { int qIndex = tempString.indexOf(START); if(qIndex>=0){ qPlus++; if(qPlus==2 && aPlus==1){ answer = removeNumber(answer); map.put(question,answer); qPlus = 1; aPlus = 0; question = ""; answer = ""; } question+=tempString.substring(qIndex+2,tempString.length()); q = 1; a = 0; continue; } int aIndex = tempString.indexOf(END); if(aIndex>=0){ aPlus++; answer+=tempString.substring(aIndex+2,tempString.length()); a = 1; q = 0; continue; } if(q == 1){ question+=tempString; }else if(a == 1){ answer+=tempString; } } } catch (IOException e) { e.printStackTrace(); } } public static void readByLines(Map<String,String> map,String fileName){ File file = new File(fileName); if(!file.exists()){ return; } try (FileInputStream fileInputStream = new FileInputStream(fileName); InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream, "UTF-8"); BufferedReader reader = new BufferedReader(inputStreamReader)){ String tempString = null; while ((tempString = reader.readLine()) != null) { StringBuilder stringBuilder = new StringBuilder(); // List<Term> terms = HanLP.segment(tempString); // CoreStopWordDictionary.apply(terms); // for(Term term:terms){ // stringBuilder.append(term.word); // } List<String> terms = HanLP.extractKeyword(tempString,3); for(String term:terms){ stringBuilder.append(term); } map.put(tempString,stringBuilder.toString()); } } catch (IOException e) { e.printStackTrace(); } } public static String readByLines(String fileName){ File file = new File(fileName); if(!file.exists()){ return null; } try (FileInputStream fileInputStream = new FileInputStream(fileName); InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream, "UTF-8"); BufferedReader reader = new BufferedReader(inputStreamReader)){ String tempString = null; StringBuilder stringBuilder = new StringBuilder(); while ((tempString = reader.readLine()) != null) { stringBuilder.append(tempString); } return stringBuilder.toString(); } catch (IOException e) { e.printStackTrace(); return null; } } public static String removeNumber(String string){ String three = string.substring(string.length()-3,string.length()); if(StringUtils.regular(StringUtils.INT_REGULAR,three)){ return string.substring(0,string.length()-3); } String two = string.substring(string.length()-2,string.length()); if(StringUtils.regular(StringUtils.INT_REGULAR,two)){ return string.substring(0,string.length()-2); } String one = string.substring(string.length()-1,string.length()); if(StringUtils.regular(StringUtils.INT_REGULAR,one)){ return string.substring(0,string.length()-1); } return string; } }
[ "1157317608@qq.com" ]
1157317608@qq.com
790c393606778ad629c8679509f2fc05ac240e65
465b4beb34e17c511a1d1f4ce9f7162414856fe6
/src/main/java/com/baojie/threadpool/TFactory.java
ad99ef5380682828d3f208c0d56caed0e85b9e48
[]
no_license
lizengqing/hahaseda
e075cd87c7778379056f083a856fd2e229aa2768
cb9b366695625366f621fd76da7af62ef45b20e0
refs/heads/master
2020-12-04T23:18:44.972569
2018-06-19T09:54:08
2018-06-19T09:54:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,067
java
package com.baojie.threadpool; import java.util.concurrent.ThreadFactory; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; public class TFactory implements ThreadFactory { private static final Uncaught UNCAUGHT_EXCEPTION_HANDLER = Uncaught.getInstance(); private static final AtomicInteger POOL_NUMBER = new AtomicInteger(1); private static final int NO_THREAD_PRIORITY = Thread.NORM_PRIORITY; private final AtomicLong t_number = new AtomicLong(1); private final ThreadGroup group; private final String factoryName; private final int t_Priority; private final String poolName; private final boolean isDaemon; public static TFactory create(final String name) { return new TFactory(name, false, NO_THREAD_PRIORITY); } public static TFactory create(final String name, final boolean isDaemon) { return new TFactory(name, isDaemon, NO_THREAD_PRIORITY); } public static TFactory create(final String name, final int threadPriority) { return new TFactory(name, false, threadPriority); } public static TFactory create(final String name, final boolean isDaemon, final int threadPriority) { return new TFactory(name, isDaemon, threadPriority); } private TFactory(final String name, final boolean isDaemon, final int threadPriority) { this.group = TGroup.getGroup(); this.factoryName = name; this.isDaemon = isDaemon; this.t_Priority = threadPriority; this.poolName = factoryName + "_" + POOL_NUMBER.getAndIncrement(); } @Override public Thread newThread(final Runnable r) { final String threadNum = String.valueOf(t_number.getAndIncrement()); final Thread thread = new Thread(group, r, poolName + "_thread_" + threadNum, 0); setProperties(thread); return thread; } private void setProperties(final Thread thread) { setDaemon(thread); setPriority(thread); thread.setUncaughtExceptionHandler(UNCAUGHT_EXCEPTION_HANDLER); } private void setDaemon(final Thread thread) { if (isDaemon == true) { thread.setDaemon(true); } else { if (thread.isDaemon()) { thread.setDaemon(false); } } } private void setPriority(final Thread thread) { if (t_Priority == NO_THREAD_PRIORITY) { if (thread.getPriority() != Thread.NORM_PRIORITY) { thread.setPriority(Thread.NORM_PRIORITY); } } else { final int priority = checkPriority(); thread.setPriority(priority); } } private int checkPriority() { if (t_Priority <= Thread.MIN_PRIORITY) { return Thread.MIN_PRIORITY; } else { if (t_Priority >= Thread.MAX_PRIORITY) { return Thread.MAX_PRIORITY; } else { return t_Priority; } } } public static Uncaught getUncaught() { return UNCAUGHT_EXCEPTION_HANDLER; } public int getPoolNumber() { return POOL_NUMBER.get(); } public long getThreadNumber() { return t_number.get(); } public String getFactoryName() { return factoryName; } public int getThreadPriority() { return t_Priority; } public String getPoolName() { return poolName; } public boolean isDaemon() { return isDaemon; } }
[ "1039245098@qq.com" ]
1039245098@qq.com
f1785ce88a95e64e0b13864e0e3236347392bec5
0ada9ef9ccf859200133aeb5edc128c63c8501b9
/Week_01/id_82/链表/Main.java
c3f9a6d889f9f69f40906c93713c0ddf358980d2
[]
no_license
yanlingli3799/algorithm
a0b24092fd84e3e2e2568b01c17a3473e44b1288
2471dc738669ad3d9383a6e45bfd176986d58c90
refs/heads/master
2020-05-09T23:47:32.423942
2019-05-12T12:50:53
2019-05-12T12:50:53
181,512,276
1
0
null
2019-04-29T02:26:00
2019-04-15T15:10:44
Java
UTF-8
Java
false
false
6,881
java
import java.util.HashMap; import java.util.Map; import java.util.Scanner; public class Main { public static void main(String[] args) { // Output.printf(Solution.deleteDuplicates(Input.getHeadList().getHead())); // Output.printf(Solution.mergeTwoLists(Input.getHeadList().getHead(),Input.getHeadList().getHead())); // Output.printf(Solution.swapPairs(Input.getHeadList().getHead())); // HeadList list = Input.getHeadList(); // Output.printf(HeadList.searchNode(Solution.detectCycle(HeadList.createCycle(Input.getPositionOrK(),list)),list)); // Output.printf(Solution.reverseKGroup(Input.getHeadList().getHead(),Input.getPositionOrK())); } } /* Here is Interface class Name: ListNode */ class Solution{ static HeadList.ListNode deleteDuplicates(HeadList.ListNode head) { Map<Integer,HeadList.ListNode> map = new HashMap<>(); HeadList.ListNode tmp = head; while (tmp != null){ //JC: tmp.next == null if(map.get(tmp.val) == null){ //JC: map.get() return something map.put(tmp.val,tmp); } else HeadList.delete(head,tmp); tmp = tmp.next; } return head; } static HeadList.ListNode mergeTwoLists(HeadList.ListNode l1, HeadList.ListNode l2){ HeadList list = new HeadList(); HeadList.ListNode tmp1 = l1.next; //because of head node. HeadList.ListNode tmp2 = l2.next; while (true){ if (tmp1 == null){ for( ; tmp2 != null; tmp2 = tmp2.next){ list.insert(tmp2.val); } break; } else if (tmp2 == null){ for( ; tmp1 != null; tmp1 = tmp1.next){ list.insert(tmp1.val); } break; } else if (tmp1.val > tmp2.val){ list.insert(tmp2.val); tmp2 = tmp2.next; } else { list.insert(tmp1.val); tmp1 = tmp1.next; } } return list.getHead(); } static HeadList.ListNode swapPairs(HeadList.ListNode head){ HeadList.ListNode pre, tmp, tail; pre = head; while (true){ if (pre.next == null) break; if (pre.next.next == null) break; tmp = pre.next; tail = pre.next.next.next; pre.next = pre.next.next; pre.next.next = tmp; tmp.next = tail; pre = pre.next.next; } return head; } static HeadList.ListNode detectCycle(HeadList.ListNode head){ Map<HeadList.ListNode,Integer> map = new HashMap<>(); HeadList.ListNode tmp = head; int pos = 0; while (tmp != null){ //JC: tmp.next == null if (map.get(tmp) == null){ //JC: map.get() return something map.put(tmp,pos); tmp = tmp.next; pos++; } else break; } return tmp; } static HeadList.ListNode reverseKGroup(HeadList.ListNode head, int k){ if(k == 1 || k == 0) return head; HeadList.ListNode detect, pre, segPre, segTmp, tail, tailNext; if (head.next == null) return head; segPre = head; detect = pre = segTmp = head.next; if (head.next.next == null) return head; tail = pre.next; tailNext = tail.next; while (true){ int i = 0; for ( ; i < k; i++){ if (detect == null){ segPre.next = tailNext; return head; } else detect = detect.next; } for (int j = 0; j < k - 1; j++){ //K-1:N elements need N reverses. tail.next = pre; pre = tail; tail = tailNext; if (tailNext != null) tailNext = tailNext.next; } segPre.next = pre; pre = tail; tail = tailNext; if (tailNext != null) tailNext = tailNext.next; segPre = segTmp; segTmp = pre; } } } /* Here is Supporting class Name: HeadList */ class HeadList{ static class ListNode{ int val; ListNode next; ListNode(int x){ val = x; } } private ListNode head; HeadList() { head = new ListNode(Integer.MIN_VALUE); } ListNode getHead(){ return this.head; } static boolean delete(ListNode head,ListNode node){ if (head == null || node == null) return false; ListNode tmp = head; while (tmp.next != node && tmp.next != null){ //JC: tmp.next == node || tmp.next == null tmp = tmp.next; } if (tmp.next == node){ tmp.next = node.next; return true; } else return false; } void insert(int x){ ListNode tmp = new ListNode(x); ListNode tail = head; while (tail.next !=null){ tail = tail.next; } tail.next = tmp; } static ListNode createCycle(int pos, HeadList list){ ListNode tail = list.head; while (tail.next !=null){ //get tail node. tail = tail.next; } ListNode pre = list.head; while (true){ for (int i = 0; i < pos+1; i++){ //because of the head node. pre = pre.next; } break; } tail.next = pre; return list.head; } static int searchNode(ListNode node, HeadList list){ ListNode tmp = list.head; int index = 0; while (node != tmp){ //JC: node == tmp if (tmp != null){ tmp = tmp.next; index++; } else return -1; } return index - 1; } } /* Here is Interface class Name: Output Input */ class Output{ static void printf(HeadList.ListNode head){ HeadList.ListNode tmp = head; while (tmp.next != null){ System.out.print(tmp.next.val); tmp = tmp.next; } } static void printf(int val){ System.out.print(val); } } class Input{ static HeadList getHeadList(){ Scanner sc = new Scanner(System.in); int length = sc.nextInt(); int[] array = new int[length]; for (int i = 0; i < array.length; i++){ array[i] = sc.nextInt(); } HeadList list = new HeadList(); for (int i : array){ list.insert(i); } return list; } static int getPositionOrK(){ Scanner sc = new Scanner(System.in); return sc.nextInt(); } }
[ "yz9494niu@gmail.com" ]
yz9494niu@gmail.com
88a1f82860bae6217b6c2395aaa18f84ee41f673
02d7815d44030fa9cee804c3736320baef63f858
/sdk/src/main/java/org/zstack/sdk/UpdateUserGroupResult.java
123d5044306d2c450012f08d8020e4d48a866678
[ "Apache-2.0" ]
permissive
txdyzdy/zstack
b9d60f1f580fefa4734bce6a5ddedb081a383caa
3b919f5d1c9b156fcef374cfd61c80ce5b52d8a2
refs/heads/master
2021-09-05T22:22:45.585615
2018-01-31T06:36:03
2018-01-31T06:36:03
114,520,620
1
0
null
2017-12-17T08:19:48
2017-12-17T08:19:48
null
UTF-8
Java
false
false
293
java
package org.zstack.sdk; public class UpdateUserGroupResult { public UserGroupInventory inventory; public void setInventory(UserGroupInventory inventory) { this.inventory = inventory; } public UserGroupInventory getInventory() { return this.inventory; } }
[ "xin.zhang@mevoco.com" ]
xin.zhang@mevoco.com
e44fc350d9c6b670eb3258ca5c94f26f16c810fb
a300cb7883e299b2dfb0945db96299244e34ca7e
/src/main/java/com/test/blinkapp/demo/repo/IndexRepo.java
fcee7c449744b2f6b24dde24025ee24034fb269b
[]
no_license
eglushenko/blinkApp
70fb566b3f7848ec8f4a0beec83bc6537d3a9cff
c6ef81433207bcf73dfa7596064c51f81cf1dda1
refs/heads/master
2020-08-29T04:12:50.721716
2019-10-27T22:02:22
2019-10-27T22:02:22
217,922,314
0
0
null
null
null
null
UTF-8
Java
false
false
216
java
package com.test.blinkapp.demo.repo; import com.test.blinkapp.demo.model.Index; import org.springframework.data.repository.CrudRepository; public interface IndexRepo extends CrudRepository<Index,Long> { }
[ "e.glushenko@hotmail.com" ]
e.glushenko@hotmail.com
467dd76cf0e49189cde9236634d7f39662c2e891
3b129d50895974771234531ce0a97e7a6e1543b5
/SistemaVendas/src/main/java/com/cepalab/sistemaVendas/cadastro/dominio/IntervaloVendaConsignacaoProduto.java
f83d9725083a7de9380173d41bd0cd1fc22439bc
[]
no_license
fabiano1749/cepalab
4ab0df2056eec2e3809307e1ea0263f982f7188d
16fba9d3ffea83f5ae977a1fb9961993daaf7c1b
refs/heads/master
2022-12-05T10:21:30.016602
2020-01-16T23:22:48
2020-01-16T23:22:48
187,932,627
0
0
null
2022-11-24T08:34:11
2019-05-22T00:20:56
Java
UTF-8
Java
false
false
2,997
java
package com.cepalab.sistemaVendas.cadastro.dominio; import java.math.BigDecimal; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import javax.persistence.Transient; @Entity @Table(name="intervalo_venda_consignacao") public class IntervaloVendaConsignacaoProduto extends GenericDTO{ private static final long serialVersionUID = 1L; private int inicio; private int fim; private BigDecimal minVenda = BigDecimal.ZERO; private BigDecimal minConsignacao = BigDecimal.ZERO; private BigDecimal comissaoProntaEntrega = BigDecimal.ZERO; private BigDecimal comissaoTransportadora = BigDecimal.ZERO; private PoliticaVendaConsignacaoTipoVendedorProduto politicaTipoVendedorProduto; @Override @Id @GeneratedValue(strategy=GenerationType.IDENTITY) public Long getId() { return id; } public void setInicio(int inicio) { this.inicio = inicio; } @Column(nullable=false) public int getInicio() { return inicio; } public void setFim(int fim) { this.fim = fim; } @Column(nullable=false) public int getFim() { return fim; } public void setMinVenda(BigDecimal minVenda) { this.minVenda = minVenda; } @Column(name="min_venda", precision=10, scale=2) public BigDecimal getMinVenda() { return minVenda; } @Column(name="min_consignacao", precision=10, scale=2) public BigDecimal getMinConsignacao() { return minConsignacao; } public void setMinConsignacao(BigDecimal minConsignacao) { this.minConsignacao = minConsignacao; } @Column(name="comissao_pronta_entrega", precision=10, scale=2) public BigDecimal getComissaoProntaEntrega() { return comissaoProntaEntrega; } public void setComissaoProntaEntrega(BigDecimal comissaoProntaEntrega) { this.comissaoProntaEntrega = comissaoProntaEntrega; } @Column(name="comissao_transportadora", precision=10, scale=2) public BigDecimal getComissaoTransportadora() { return comissaoTransportadora; } public void setComissaoTransportadora(BigDecimal comissaoTransportadora) { this.comissaoTransportadora = comissaoTransportadora; } @ManyToOne @JoinColumn(name = "politica_vc_tv_produto_id", nullable=false) public PoliticaVendaConsignacaoTipoVendedorProduto getPoliticaTipoVendedorProduto() { return politicaTipoVendedorProduto; } public void setPoliticaTipoVendedorProduto(PoliticaVendaConsignacaoTipoVendedorProduto politicaTipoVendedorProduto) { this.politicaTipoVendedorProduto = politicaTipoVendedorProduto; } @Transient public boolean estaNoIntervalo(int quantidade) { if(quantidade >= inicio && quantidade <= fim) { return true; } return false; } @Transient public BigDecimal taxaComissao(boolean prontraEntrega) { if(prontraEntrega) { return comissaoProntaEntrega; } return comissaoTransportadora; } }
[ "fabiano1749@gmail.com" ]
fabiano1749@gmail.com
ee5e6e7327e3ac0d642513a2beef8ac7650bc17c
0e3ebd531666d66314fe04d2fde0483fbea37f8c
/casterly-rock-api/src/main/java/kz/zhadyrassyn/casterly/rock/api/Application.java
26b5eb7fbd11ca09c2db949426f917fca0f749c8
[]
no_license
zhadyrassyn/casterly-rock
6de767be42a7ca22bb5713f31d749757175f5ef0
db5ec7d5605738ca4a225118518666bfa05040f3
refs/heads/master
2020-05-15T01:18:17.377213
2019-05-15T11:29:31
2019-05-15T11:29:31
182,017,405
0
0
null
null
null
null
UTF-8
Java
false
false
446
java
package kz.zhadyrassyn.casterly.rock.api; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.ComponentScan; @SpringBootApplication @ComponentScan(basePackages = "kz.zhadyrassyn.casterly.rock") public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } }
[ "dzhadyrassyn@alfabank.kz" ]
dzhadyrassyn@alfabank.kz
3c0ee3542ea3e1f1ef46a657c5b7d96a456cfaa6
b5657b38fa5e96193b5389d6fd88840559d33d2e
/pzmall-db/src/main/java/org/linlinjava/litemall/db/domain/VisituserExample.java
a89408764838d5a689535b39e9d4d05c5b049cf9
[ "MIT" ]
permissive
sorthman/nanjing
c1a79d7deb3e70b8b7e5dff2fb0df41d23b6b180
6bab6516608949816898c5e58d2fc6cbace8b16b
refs/heads/master
2023-02-05T04:51:40.673502
2020-02-26T02:53:36
2020-02-26T02:53:36
237,586,187
1
2
MIT
2023-02-02T00:48:34
2020-02-01T08:38:25
Java
UTF-8
Java
false
false
99,325
java
package org.linlinjava.litemall.db.domain; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; public class VisituserExample { /** * This field was generated by MyBatis Generator. * This field corresponds to the database table visituser * * @mbg.generated */ protected String orderByClause; /** * This field was generated by MyBatis Generator. * This field corresponds to the database table visituser * * @mbg.generated */ protected boolean distinct; /** * This field was generated by MyBatis Generator. * This field corresponds to the database table visituser * * @mbg.generated */ protected List<Criteria> oredCriteria; /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public VisituserExample() { oredCriteria = new ArrayList<Criteria>(); } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public String getOrderByClause() { return orderByClause; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public void setDistinct(boolean distinct) { this.distinct = distinct; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public boolean isDistinct() { return distinct; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public List<Criteria> getOredCriteria() { return oredCriteria; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public void or(Criteria criteria) { oredCriteria.add(criteria); } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria or() { Criteria criteria = createCriteriaInternal(); oredCriteria.add(criteria); return criteria; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public VisituserExample orderBy(String orderByClause) { this.setOrderByClause(orderByClause); return this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public VisituserExample orderBy(String ... orderByClauses) { StringBuffer sb = new StringBuffer(); for (int i = 0; i < orderByClauses.length; i++) { sb.append(orderByClauses[i]); if (i < orderByClauses.length - 1) { sb.append(" , "); } } this.setOrderByClause(sb.toString()); return this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); if (oredCriteria.size() == 0) { oredCriteria.add(criteria); } return criteria; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(this); return criteria; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public void clear() { oredCriteria.clear(); orderByClause = null; distinct = false; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public static Criteria newAndCreateCriteria() { VisituserExample example = new VisituserExample(); return example.createCriteria(); } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public VisituserExample when(boolean condition, IExampleWhen then) { if (condition) { then.example(this); } return this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public VisituserExample when(boolean condition, IExampleWhen then, IExampleWhen otherwise) { if (condition) { then.example(this); } else { otherwise.example(this); } return this; } /** * This class was generated by MyBatis Generator. * This class corresponds to the database table visituser * * @mbg.generated */ protected abstract static class GeneratedCriteria { protected List<Criterion> criteria; protected GeneratedCriteria() { super(); criteria = new ArrayList<Criterion>(); } public boolean isValid() { return criteria.size() > 0; } public List<Criterion> getAllCriteria() { return criteria; } public List<Criterion> getCriteria() { return criteria; } protected void addCriterion(String condition) { if (condition == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion(condition)); } protected void addCriterion(String condition, Object value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value)); } protected void addCriterion(String condition, Object value1, Object value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value1, value2)); } public Criteria andIdIsNull() { addCriterion("id is null"); return (Criteria) this; } public Criteria andIdIsNotNull() { addCriterion("id is not null"); return (Criteria) this; } public Criteria andIdEqualTo(Integer value) { addCriterion("id =", value, "id"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andIdEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("id = ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andIdNotEqualTo(Integer value) { addCriterion("id <>", value, "id"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andIdNotEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("id <> ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andIdGreaterThan(Integer value) { addCriterion("id >", value, "id"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andIdGreaterThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("id > ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andIdGreaterThanOrEqualTo(Integer value) { addCriterion("id >=", value, "id"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andIdGreaterThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("id >= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andIdLessThan(Integer value) { addCriterion("id <", value, "id"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andIdLessThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("id < ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andIdLessThanOrEqualTo(Integer value) { addCriterion("id <=", value, "id"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andIdLessThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("id <= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andIdIn(List<Integer> values) { addCriterion("id in", values, "id"); return (Criteria) this; } public Criteria andIdNotIn(List<Integer> values) { addCriterion("id not in", values, "id"); return (Criteria) this; } public Criteria andIdBetween(Integer value1, Integer value2) { addCriterion("id between", value1, value2, "id"); return (Criteria) this; } public Criteria andIdNotBetween(Integer value1, Integer value2) { addCriterion("id not between", value1, value2, "id"); return (Criteria) this; } public Criteria andNameIsNull() { addCriterion("`name` is null"); return (Criteria) this; } public Criteria andNameIsNotNull() { addCriterion("`name` is not null"); return (Criteria) this; } public Criteria andNameEqualTo(String value) { addCriterion("`name` =", value, "name"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andNameEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("`name` = ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andNameNotEqualTo(String value) { addCriterion("`name` <>", value, "name"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andNameNotEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("`name` <> ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andNameGreaterThan(String value) { addCriterion("`name` >", value, "name"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andNameGreaterThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("`name` > ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andNameGreaterThanOrEqualTo(String value) { addCriterion("`name` >=", value, "name"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andNameGreaterThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("`name` >= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andNameLessThan(String value) { addCriterion("`name` <", value, "name"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andNameLessThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("`name` < ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andNameLessThanOrEqualTo(String value) { addCriterion("`name` <=", value, "name"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andNameLessThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("`name` <= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andNameLike(String value) { addCriterion("`name` like", value, "name"); return (Criteria) this; } public Criteria andNameNotLike(String value) { addCriterion("`name` not like", value, "name"); return (Criteria) this; } public Criteria andNameIn(List<String> values) { addCriterion("`name` in", values, "name"); return (Criteria) this; } public Criteria andNameNotIn(List<String> values) { addCriterion("`name` not in", values, "name"); return (Criteria) this; } public Criteria andNameBetween(String value1, String value2) { addCriterion("`name` between", value1, value2, "name"); return (Criteria) this; } public Criteria andNameNotBetween(String value1, String value2) { addCriterion("`name` not between", value1, value2, "name"); return (Criteria) this; } public Criteria andPhoneIsNull() { addCriterion("phone is null"); return (Criteria) this; } public Criteria andPhoneIsNotNull() { addCriterion("phone is not null"); return (Criteria) this; } public Criteria andPhoneEqualTo(String value) { addCriterion("phone =", value, "phone"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andPhoneEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("phone = ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andPhoneNotEqualTo(String value) { addCriterion("phone <>", value, "phone"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andPhoneNotEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("phone <> ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andPhoneGreaterThan(String value) { addCriterion("phone >", value, "phone"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andPhoneGreaterThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("phone > ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andPhoneGreaterThanOrEqualTo(String value) { addCriterion("phone >=", value, "phone"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andPhoneGreaterThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("phone >= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andPhoneLessThan(String value) { addCriterion("phone <", value, "phone"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andPhoneLessThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("phone < ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andPhoneLessThanOrEqualTo(String value) { addCriterion("phone <=", value, "phone"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andPhoneLessThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("phone <= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andPhoneLike(String value) { addCriterion("phone like", value, "phone"); return (Criteria) this; } public Criteria andPhoneNotLike(String value) { addCriterion("phone not like", value, "phone"); return (Criteria) this; } public Criteria andPhoneIn(List<String> values) { addCriterion("phone in", values, "phone"); return (Criteria) this; } public Criteria andPhoneNotIn(List<String> values) { addCriterion("phone not in", values, "phone"); return (Criteria) this; } public Criteria andPhoneBetween(String value1, String value2) { addCriterion("phone between", value1, value2, "phone"); return (Criteria) this; } public Criteria andPhoneNotBetween(String value1, String value2) { addCriterion("phone not between", value1, value2, "phone"); return (Criteria) this; } public Criteria andIdcardIsNull() { addCriterion("idcard is null"); return (Criteria) this; } public Criteria andIdcardIsNotNull() { addCriterion("idcard is not null"); return (Criteria) this; } public Criteria andIdcardEqualTo(String value) { addCriterion("idcard =", value, "idcard"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andIdcardEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("idcard = ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andIdcardNotEqualTo(String value) { addCriterion("idcard <>", value, "idcard"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andIdcardNotEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("idcard <> ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andIdcardGreaterThan(String value) { addCriterion("idcard >", value, "idcard"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andIdcardGreaterThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("idcard > ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andIdcardGreaterThanOrEqualTo(String value) { addCriterion("idcard >=", value, "idcard"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andIdcardGreaterThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("idcard >= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andIdcardLessThan(String value) { addCriterion("idcard <", value, "idcard"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andIdcardLessThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("idcard < ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andIdcardLessThanOrEqualTo(String value) { addCriterion("idcard <=", value, "idcard"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andIdcardLessThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("idcard <= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andIdcardLike(String value) { addCriterion("idcard like", value, "idcard"); return (Criteria) this; } public Criteria andIdcardNotLike(String value) { addCriterion("idcard not like", value, "idcard"); return (Criteria) this; } public Criteria andIdcardIn(List<String> values) { addCriterion("idcard in", values, "idcard"); return (Criteria) this; } public Criteria andIdcardNotIn(List<String> values) { addCriterion("idcard not in", values, "idcard"); return (Criteria) this; } public Criteria andIdcardBetween(String value1, String value2) { addCriterion("idcard between", value1, value2, "idcard"); return (Criteria) this; } public Criteria andIdcardNotBetween(String value1, String value2) { addCriterion("idcard not between", value1, value2, "idcard"); return (Criteria) this; } public Criteria andSexIsNull() { addCriterion("sex is null"); return (Criteria) this; } public Criteria andSexIsNotNull() { addCriterion("sex is not null"); return (Criteria) this; } public Criteria andSexEqualTo(String value) { addCriterion("sex =", value, "sex"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andSexEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("sex = ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andSexNotEqualTo(String value) { addCriterion("sex <>", value, "sex"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andSexNotEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("sex <> ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andSexGreaterThan(String value) { addCriterion("sex >", value, "sex"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andSexGreaterThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("sex > ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andSexGreaterThanOrEqualTo(String value) { addCriterion("sex >=", value, "sex"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andSexGreaterThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("sex >= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andSexLessThan(String value) { addCriterion("sex <", value, "sex"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andSexLessThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("sex < ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andSexLessThanOrEqualTo(String value) { addCriterion("sex <=", value, "sex"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andSexLessThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("sex <= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andSexLike(String value) { addCriterion("sex like", value, "sex"); return (Criteria) this; } public Criteria andSexNotLike(String value) { addCriterion("sex not like", value, "sex"); return (Criteria) this; } public Criteria andSexIn(List<String> values) { addCriterion("sex in", values, "sex"); return (Criteria) this; } public Criteria andSexNotIn(List<String> values) { addCriterion("sex not in", values, "sex"); return (Criteria) this; } public Criteria andSexBetween(String value1, String value2) { addCriterion("sex between", value1, value2, "sex"); return (Criteria) this; } public Criteria andSexNotBetween(String value1, String value2) { addCriterion("sex not between", value1, value2, "sex"); return (Criteria) this; } public Criteria andAgeIsNull() { addCriterion("age is null"); return (Criteria) this; } public Criteria andAgeIsNotNull() { addCriterion("age is not null"); return (Criteria) this; } public Criteria andAgeEqualTo(Integer value) { addCriterion("age =", value, "age"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andAgeEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("age = ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andAgeNotEqualTo(Integer value) { addCriterion("age <>", value, "age"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andAgeNotEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("age <> ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andAgeGreaterThan(Integer value) { addCriterion("age >", value, "age"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andAgeGreaterThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("age > ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andAgeGreaterThanOrEqualTo(Integer value) { addCriterion("age >=", value, "age"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andAgeGreaterThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("age >= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andAgeLessThan(Integer value) { addCriterion("age <", value, "age"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andAgeLessThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("age < ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andAgeLessThanOrEqualTo(Integer value) { addCriterion("age <=", value, "age"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andAgeLessThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("age <= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andAgeIn(List<Integer> values) { addCriterion("age in", values, "age"); return (Criteria) this; } public Criteria andAgeNotIn(List<Integer> values) { addCriterion("age not in", values, "age"); return (Criteria) this; } public Criteria andAgeBetween(Integer value1, Integer value2) { addCriterion("age between", value1, value2, "age"); return (Criteria) this; } public Criteria andAgeNotBetween(Integer value1, Integer value2) { addCriterion("age not between", value1, value2, "age"); return (Criteria) this; } public Criteria andBirthdayIsNull() { addCriterion("birthday is null"); return (Criteria) this; } public Criteria andBirthdayIsNotNull() { addCriterion("birthday is not null"); return (Criteria) this; } public Criteria andBirthdayEqualTo(String value) { addCriterion("birthday =", value, "birthday"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andBirthdayEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("birthday = ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andBirthdayNotEqualTo(String value) { addCriterion("birthday <>", value, "birthday"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andBirthdayNotEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("birthday <> ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andBirthdayGreaterThan(String value) { addCriterion("birthday >", value, "birthday"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andBirthdayGreaterThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("birthday > ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andBirthdayGreaterThanOrEqualTo(String value) { addCriterion("birthday >=", value, "birthday"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andBirthdayGreaterThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("birthday >= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andBirthdayLessThan(String value) { addCriterion("birthday <", value, "birthday"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andBirthdayLessThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("birthday < ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andBirthdayLessThanOrEqualTo(String value) { addCriterion("birthday <=", value, "birthday"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andBirthdayLessThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("birthday <= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andBirthdayLike(String value) { addCriterion("birthday like", value, "birthday"); return (Criteria) this; } public Criteria andBirthdayNotLike(String value) { addCriterion("birthday not like", value, "birthday"); return (Criteria) this; } public Criteria andBirthdayIn(List<String> values) { addCriterion("birthday in", values, "birthday"); return (Criteria) this; } public Criteria andBirthdayNotIn(List<String> values) { addCriterion("birthday not in", values, "birthday"); return (Criteria) this; } public Criteria andBirthdayBetween(String value1, String value2) { addCriterion("birthday between", value1, value2, "birthday"); return (Criteria) this; } public Criteria andBirthdayNotBetween(String value1, String value2) { addCriterion("birthday not between", value1, value2, "birthday"); return (Criteria) this; } public Criteria andLiveaddressIsNull() { addCriterion("liveaddress is null"); return (Criteria) this; } public Criteria andLiveaddressIsNotNull() { addCriterion("liveaddress is not null"); return (Criteria) this; } public Criteria andLiveaddressEqualTo(String value) { addCriterion("liveaddress =", value, "liveaddress"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andLiveaddressEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("liveaddress = ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andLiveaddressNotEqualTo(String value) { addCriterion("liveaddress <>", value, "liveaddress"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andLiveaddressNotEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("liveaddress <> ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andLiveaddressGreaterThan(String value) { addCriterion("liveaddress >", value, "liveaddress"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andLiveaddressGreaterThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("liveaddress > ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andLiveaddressGreaterThanOrEqualTo(String value) { addCriterion("liveaddress >=", value, "liveaddress"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andLiveaddressGreaterThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("liveaddress >= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andLiveaddressLessThan(String value) { addCriterion("liveaddress <", value, "liveaddress"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andLiveaddressLessThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("liveaddress < ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andLiveaddressLessThanOrEqualTo(String value) { addCriterion("liveaddress <=", value, "liveaddress"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andLiveaddressLessThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("liveaddress <= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andLiveaddressLike(String value) { addCriterion("liveaddress like", value, "liveaddress"); return (Criteria) this; } public Criteria andLiveaddressNotLike(String value) { addCriterion("liveaddress not like", value, "liveaddress"); return (Criteria) this; } public Criteria andLiveaddressIn(List<String> values) { addCriterion("liveaddress in", values, "liveaddress"); return (Criteria) this; } public Criteria andLiveaddressNotIn(List<String> values) { addCriterion("liveaddress not in", values, "liveaddress"); return (Criteria) this; } public Criteria andLiveaddressBetween(String value1, String value2) { addCriterion("liveaddress between", value1, value2, "liveaddress"); return (Criteria) this; } public Criteria andLiveaddressNotBetween(String value1, String value2) { addCriterion("liveaddress not between", value1, value2, "liveaddress"); return (Criteria) this; } public Criteria andTraffictypeIsNull() { addCriterion("traffictype is null"); return (Criteria) this; } public Criteria andTraffictypeIsNotNull() { addCriterion("traffictype is not null"); return (Criteria) this; } public Criteria andTraffictypeEqualTo(String value) { addCriterion("traffictype =", value, "traffictype"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andTraffictypeEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("traffictype = ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andTraffictypeNotEqualTo(String value) { addCriterion("traffictype <>", value, "traffictype"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andTraffictypeNotEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("traffictype <> ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andTraffictypeGreaterThan(String value) { addCriterion("traffictype >", value, "traffictype"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andTraffictypeGreaterThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("traffictype > ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andTraffictypeGreaterThanOrEqualTo(String value) { addCriterion("traffictype >=", value, "traffictype"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andTraffictypeGreaterThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("traffictype >= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andTraffictypeLessThan(String value) { addCriterion("traffictype <", value, "traffictype"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andTraffictypeLessThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("traffictype < ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andTraffictypeLessThanOrEqualTo(String value) { addCriterion("traffictype <=", value, "traffictype"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andTraffictypeLessThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("traffictype <= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andTraffictypeLike(String value) { addCriterion("traffictype like", value, "traffictype"); return (Criteria) this; } public Criteria andTraffictypeNotLike(String value) { addCriterion("traffictype not like", value, "traffictype"); return (Criteria) this; } public Criteria andTraffictypeIn(List<String> values) { addCriterion("traffictype in", values, "traffictype"); return (Criteria) this; } public Criteria andTraffictypeNotIn(List<String> values) { addCriterion("traffictype not in", values, "traffictype"); return (Criteria) this; } public Criteria andTraffictypeBetween(String value1, String value2) { addCriterion("traffictype between", value1, value2, "traffictype"); return (Criteria) this; } public Criteria andTraffictypeNotBetween(String value1, String value2) { addCriterion("traffictype not between", value1, value2, "traffictype"); return (Criteria) this; } public Criteria andTrafficinfoIsNull() { addCriterion("trafficinfo is null"); return (Criteria) this; } public Criteria andTrafficinfoIsNotNull() { addCriterion("trafficinfo is not null"); return (Criteria) this; } public Criteria andTrafficinfoEqualTo(String value) { addCriterion("trafficinfo =", value, "trafficinfo"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andTrafficinfoEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("trafficinfo = ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andTrafficinfoNotEqualTo(String value) { addCriterion("trafficinfo <>", value, "trafficinfo"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andTrafficinfoNotEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("trafficinfo <> ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andTrafficinfoGreaterThan(String value) { addCriterion("trafficinfo >", value, "trafficinfo"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andTrafficinfoGreaterThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("trafficinfo > ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andTrafficinfoGreaterThanOrEqualTo(String value) { addCriterion("trafficinfo >=", value, "trafficinfo"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andTrafficinfoGreaterThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("trafficinfo >= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andTrafficinfoLessThan(String value) { addCriterion("trafficinfo <", value, "trafficinfo"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andTrafficinfoLessThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("trafficinfo < ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andTrafficinfoLessThanOrEqualTo(String value) { addCriterion("trafficinfo <=", value, "trafficinfo"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andTrafficinfoLessThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("trafficinfo <= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andTrafficinfoLike(String value) { addCriterion("trafficinfo like", value, "trafficinfo"); return (Criteria) this; } public Criteria andTrafficinfoNotLike(String value) { addCriterion("trafficinfo not like", value, "trafficinfo"); return (Criteria) this; } public Criteria andTrafficinfoIn(List<String> values) { addCriterion("trafficinfo in", values, "trafficinfo"); return (Criteria) this; } public Criteria andTrafficinfoNotIn(List<String> values) { addCriterion("trafficinfo not in", values, "trafficinfo"); return (Criteria) this; } public Criteria andTrafficinfoBetween(String value1, String value2) { addCriterion("trafficinfo between", value1, value2, "trafficinfo"); return (Criteria) this; } public Criteria andTrafficinfoNotBetween(String value1, String value2) { addCriterion("trafficinfo not between", value1, value2, "trafficinfo"); return (Criteria) this; } public Criteria andIfwhIsNull() { addCriterion("ifwh is null"); return (Criteria) this; } public Criteria andIfwhIsNotNull() { addCriterion("ifwh is not null"); return (Criteria) this; } public Criteria andIfwhEqualTo(String value) { addCriterion("ifwh =", value, "ifwh"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andIfwhEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("ifwh = ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andIfwhNotEqualTo(String value) { addCriterion("ifwh <>", value, "ifwh"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andIfwhNotEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("ifwh <> ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andIfwhGreaterThan(String value) { addCriterion("ifwh >", value, "ifwh"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andIfwhGreaterThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("ifwh > ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andIfwhGreaterThanOrEqualTo(String value) { addCriterion("ifwh >=", value, "ifwh"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andIfwhGreaterThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("ifwh >= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andIfwhLessThan(String value) { addCriterion("ifwh <", value, "ifwh"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andIfwhLessThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("ifwh < ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andIfwhLessThanOrEqualTo(String value) { addCriterion("ifwh <=", value, "ifwh"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andIfwhLessThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("ifwh <= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andIfwhLike(String value) { addCriterion("ifwh like", value, "ifwh"); return (Criteria) this; } public Criteria andIfwhNotLike(String value) { addCriterion("ifwh not like", value, "ifwh"); return (Criteria) this; } public Criteria andIfwhIn(List<String> values) { addCriterion("ifwh in", values, "ifwh"); return (Criteria) this; } public Criteria andIfwhNotIn(List<String> values) { addCriterion("ifwh not in", values, "ifwh"); return (Criteria) this; } public Criteria andIfwhBetween(String value1, String value2) { addCriterion("ifwh between", value1, value2, "ifwh"); return (Criteria) this; } public Criteria andIfwhNotBetween(String value1, String value2) { addCriterion("ifwh not between", value1, value2, "ifwh"); return (Criteria) this; } public Criteria andIfxqIsNull() { addCriterion("ifxq is null"); return (Criteria) this; } public Criteria andIfxqIsNotNull() { addCriterion("ifxq is not null"); return (Criteria) this; } public Criteria andIfxqEqualTo(String value) { addCriterion("ifxq =", value, "ifxq"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andIfxqEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("ifxq = ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andIfxqNotEqualTo(String value) { addCriterion("ifxq <>", value, "ifxq"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andIfxqNotEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("ifxq <> ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andIfxqGreaterThan(String value) { addCriterion("ifxq >", value, "ifxq"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andIfxqGreaterThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("ifxq > ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andIfxqGreaterThanOrEqualTo(String value) { addCriterion("ifxq >=", value, "ifxq"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andIfxqGreaterThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("ifxq >= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andIfxqLessThan(String value) { addCriterion("ifxq <", value, "ifxq"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andIfxqLessThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("ifxq < ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andIfxqLessThanOrEqualTo(String value) { addCriterion("ifxq <=", value, "ifxq"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andIfxqLessThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("ifxq <= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andIfxqLike(String value) { addCriterion("ifxq like", value, "ifxq"); return (Criteria) this; } public Criteria andIfxqNotLike(String value) { addCriterion("ifxq not like", value, "ifxq"); return (Criteria) this; } public Criteria andIfxqIn(List<String> values) { addCriterion("ifxq in", values, "ifxq"); return (Criteria) this; } public Criteria andIfxqNotIn(List<String> values) { addCriterion("ifxq not in", values, "ifxq"); return (Criteria) this; } public Criteria andIfxqBetween(String value1, String value2) { addCriterion("ifxq between", value1, value2, "ifxq"); return (Criteria) this; } public Criteria andIfxqNotBetween(String value1, String value2) { addCriterion("ifxq not between", value1, value2, "ifxq"); return (Criteria) this; } public Criteria andVisitaddressIsNull() { addCriterion("visitaddress is null"); return (Criteria) this; } public Criteria andVisitaddressIsNotNull() { addCriterion("visitaddress is not null"); return (Criteria) this; } public Criteria andVisitaddressEqualTo(String value) { addCriterion("visitaddress =", value, "visitaddress"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andVisitaddressEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("visitaddress = ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andVisitaddressNotEqualTo(String value) { addCriterion("visitaddress <>", value, "visitaddress"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andVisitaddressNotEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("visitaddress <> ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andVisitaddressGreaterThan(String value) { addCriterion("visitaddress >", value, "visitaddress"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andVisitaddressGreaterThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("visitaddress > ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andVisitaddressGreaterThanOrEqualTo(String value) { addCriterion("visitaddress >=", value, "visitaddress"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andVisitaddressGreaterThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("visitaddress >= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andVisitaddressLessThan(String value) { addCriterion("visitaddress <", value, "visitaddress"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andVisitaddressLessThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("visitaddress < ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andVisitaddressLessThanOrEqualTo(String value) { addCriterion("visitaddress <=", value, "visitaddress"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andVisitaddressLessThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("visitaddress <= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andVisitaddressLike(String value) { addCriterion("visitaddress like", value, "visitaddress"); return (Criteria) this; } public Criteria andVisitaddressNotLike(String value) { addCriterion("visitaddress not like", value, "visitaddress"); return (Criteria) this; } public Criteria andVisitaddressIn(List<String> values) { addCriterion("visitaddress in", values, "visitaddress"); return (Criteria) this; } public Criteria andVisitaddressNotIn(List<String> values) { addCriterion("visitaddress not in", values, "visitaddress"); return (Criteria) this; } public Criteria andVisitaddressBetween(String value1, String value2) { addCriterion("visitaddress between", value1, value2, "visitaddress"); return (Criteria) this; } public Criteria andVisitaddressNotBetween(String value1, String value2) { addCriterion("visitaddress not between", value1, value2, "visitaddress"); return (Criteria) this; } public Criteria andTemperatureIsNull() { addCriterion("temperature is null"); return (Criteria) this; } public Criteria andTemperatureIsNotNull() { addCriterion("temperature is not null"); return (Criteria) this; } public Criteria andTemperatureEqualTo(String value) { addCriterion("temperature =", value, "temperature"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andTemperatureEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("temperature = ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andTemperatureNotEqualTo(String value) { addCriterion("temperature <>", value, "temperature"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andTemperatureNotEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("temperature <> ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andTemperatureGreaterThan(String value) { addCriterion("temperature >", value, "temperature"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andTemperatureGreaterThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("temperature > ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andTemperatureGreaterThanOrEqualTo(String value) { addCriterion("temperature >=", value, "temperature"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andTemperatureGreaterThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("temperature >= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andTemperatureLessThan(String value) { addCriterion("temperature <", value, "temperature"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andTemperatureLessThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("temperature < ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andTemperatureLessThanOrEqualTo(String value) { addCriterion("temperature <=", value, "temperature"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andTemperatureLessThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("temperature <= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andTemperatureLike(String value) { addCriterion("temperature like", value, "temperature"); return (Criteria) this; } public Criteria andTemperatureNotLike(String value) { addCriterion("temperature not like", value, "temperature"); return (Criteria) this; } public Criteria andTemperatureIn(List<String> values) { addCriterion("temperature in", values, "temperature"); return (Criteria) this; } public Criteria andTemperatureNotIn(List<String> values) { addCriterion("temperature not in", values, "temperature"); return (Criteria) this; } public Criteria andTemperatureBetween(String value1, String value2) { addCriterion("temperature between", value1, value2, "temperature"); return (Criteria) this; } public Criteria andTemperatureNotBetween(String value1, String value2) { addCriterion("temperature not between", value1, value2, "temperature"); return (Criteria) this; } public Criteria andVisitcodeIsNull() { addCriterion("visitcode is null"); return (Criteria) this; } public Criteria andVisitcodeIsNotNull() { addCriterion("visitcode is not null"); return (Criteria) this; } public Criteria andVisitcodeEqualTo(Integer value) { addCriterion("visitcode =", value, "visitcode"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andVisitcodeEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("visitcode = ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andVisitcodeNotEqualTo(Integer value) { addCriterion("visitcode <>", value, "visitcode"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andVisitcodeNotEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("visitcode <> ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andVisitcodeGreaterThan(Integer value) { addCriterion("visitcode >", value, "visitcode"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andVisitcodeGreaterThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("visitcode > ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andVisitcodeGreaterThanOrEqualTo(Integer value) { addCriterion("visitcode >=", value, "visitcode"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andVisitcodeGreaterThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("visitcode >= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andVisitcodeLessThan(Integer value) { addCriterion("visitcode <", value, "visitcode"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andVisitcodeLessThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("visitcode < ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andVisitcodeLessThanOrEqualTo(Integer value) { addCriterion("visitcode <=", value, "visitcode"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andVisitcodeLessThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("visitcode <= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andVisitcodeIn(List<Integer> values) { addCriterion("visitcode in", values, "visitcode"); return (Criteria) this; } public Criteria andVisitcodeNotIn(List<Integer> values) { addCriterion("visitcode not in", values, "visitcode"); return (Criteria) this; } public Criteria andVisitcodeBetween(Integer value1, Integer value2) { addCriterion("visitcode between", value1, value2, "visitcode"); return (Criteria) this; } public Criteria andVisitcodeNotBetween(Integer value1, Integer value2) { addCriterion("visitcode not between", value1, value2, "visitcode"); return (Criteria) this; } public Criteria andRemarkIsNull() { addCriterion("remark is null"); return (Criteria) this; } public Criteria andRemarkIsNotNull() { addCriterion("remark is not null"); return (Criteria) this; } public Criteria andRemarkEqualTo(String value) { addCriterion("remark =", value, "remark"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andRemarkEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("remark = ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andRemarkNotEqualTo(String value) { addCriterion("remark <>", value, "remark"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andRemarkNotEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("remark <> ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andRemarkGreaterThan(String value) { addCriterion("remark >", value, "remark"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andRemarkGreaterThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("remark > ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andRemarkGreaterThanOrEqualTo(String value) { addCriterion("remark >=", value, "remark"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andRemarkGreaterThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("remark >= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andRemarkLessThan(String value) { addCriterion("remark <", value, "remark"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andRemarkLessThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("remark < ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andRemarkLessThanOrEqualTo(String value) { addCriterion("remark <=", value, "remark"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andRemarkLessThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("remark <= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andRemarkLike(String value) { addCriterion("remark like", value, "remark"); return (Criteria) this; } public Criteria andRemarkNotLike(String value) { addCriterion("remark not like", value, "remark"); return (Criteria) this; } public Criteria andRemarkIn(List<String> values) { addCriterion("remark in", values, "remark"); return (Criteria) this; } public Criteria andRemarkNotIn(List<String> values) { addCriterion("remark not in", values, "remark"); return (Criteria) this; } public Criteria andRemarkBetween(String value1, String value2) { addCriterion("remark between", value1, value2, "remark"); return (Criteria) this; } public Criteria andRemarkNotBetween(String value1, String value2) { addCriterion("remark not between", value1, value2, "remark"); return (Criteria) this; } public Criteria andAddtimeIsNull() { addCriterion("addtime is null"); return (Criteria) this; } public Criteria andAddtimeIsNotNull() { addCriterion("addtime is not null"); return (Criteria) this; } public Criteria andAddtimeEqualTo(LocalDateTime value) { addCriterion("addtime =", value, "addtime"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andAddtimeEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("addtime = ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andAddtimeNotEqualTo(LocalDateTime value) { addCriterion("addtime <>", value, "addtime"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andAddtimeNotEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("addtime <> ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andAddtimeGreaterThan(LocalDateTime value) { addCriterion("addtime >", value, "addtime"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andAddtimeGreaterThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("addtime > ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andAddtimeGreaterThanOrEqualTo(LocalDateTime value) { addCriterion("addtime >=", value, "addtime"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andAddtimeGreaterThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("addtime >= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andAddtimeLessThan(LocalDateTime value) { addCriterion("addtime <", value, "addtime"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andAddtimeLessThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("addtime < ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andAddtimeLessThanOrEqualTo(LocalDateTime value) { addCriterion("addtime <=", value, "addtime"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andAddtimeLessThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("addtime <= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andAddtimeIn(List<LocalDateTime> values) { addCriterion("addtime in", values, "addtime"); return (Criteria) this; } public Criteria andAddtimeNotIn(List<LocalDateTime> values) { addCriterion("addtime not in", values, "addtime"); return (Criteria) this; } public Criteria andAddtimeBetween(LocalDateTime value1, LocalDateTime value2) { addCriterion("addtime between", value1, value2, "addtime"); return (Criteria) this; } public Criteria andAddtimeNotBetween(LocalDateTime value1, LocalDateTime value2) { addCriterion("addtime not between", value1, value2, "addtime"); return (Criteria) this; } public Criteria andModifytimeIsNull() { addCriterion("modifytime is null"); return (Criteria) this; } public Criteria andModifytimeIsNotNull() { addCriterion("modifytime is not null"); return (Criteria) this; } public Criteria andModifytimeEqualTo(LocalDateTime value) { addCriterion("modifytime =", value, "modifytime"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andModifytimeEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("modifytime = ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andModifytimeNotEqualTo(LocalDateTime value) { addCriterion("modifytime <>", value, "modifytime"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andModifytimeNotEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("modifytime <> ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andModifytimeGreaterThan(LocalDateTime value) { addCriterion("modifytime >", value, "modifytime"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andModifytimeGreaterThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("modifytime > ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andModifytimeGreaterThanOrEqualTo(LocalDateTime value) { addCriterion("modifytime >=", value, "modifytime"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andModifytimeGreaterThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("modifytime >= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andModifytimeLessThan(LocalDateTime value) { addCriterion("modifytime <", value, "modifytime"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andModifytimeLessThanColumn(Visituser.Column column) { addCriterion(new StringBuilder("modifytime < ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andModifytimeLessThanOrEqualTo(LocalDateTime value) { addCriterion("modifytime <=", value, "modifytime"); return (Criteria) this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria andModifytimeLessThanOrEqualToColumn(Visituser.Column column) { addCriterion(new StringBuilder("modifytime <= ").append(column.getEscapedColumnName()).toString()); return (Criteria) this; } public Criteria andModifytimeIn(List<LocalDateTime> values) { addCriterion("modifytime in", values, "modifytime"); return (Criteria) this; } public Criteria andModifytimeNotIn(List<LocalDateTime> values) { addCriterion("modifytime not in", values, "modifytime"); return (Criteria) this; } public Criteria andModifytimeBetween(LocalDateTime value1, LocalDateTime value2) { addCriterion("modifytime between", value1, value2, "modifytime"); return (Criteria) this; } public Criteria andModifytimeNotBetween(LocalDateTime value1, LocalDateTime value2) { addCriterion("modifytime not between", value1, value2, "modifytime"); return (Criteria) this; } } /** * This class was generated by MyBatis Generator. * This class corresponds to the database table visituser * * @mbg.generated do_not_delete_during_merge */ public static class Criteria extends GeneratedCriteria { /** * This field was generated by MyBatis Generator. * This field corresponds to the database table visituser * * @mbg.generated */ private VisituserExample example; /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ protected Criteria(VisituserExample example) { super(); this.example = example; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public VisituserExample example() { return this.example; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ @Deprecated public Criteria andIf(boolean ifAdd, ICriteriaAdd add) { if (ifAdd) { add.add(this); } return this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria when(boolean condition, ICriteriaWhen then) { if (condition) { then.criteria(this); } return this; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ public Criteria when(boolean condition, ICriteriaWhen then, ICriteriaWhen otherwise) { if (condition) { then.criteria(this); } else { otherwise.criteria(this); } return this; } @Deprecated public interface ICriteriaAdd { /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ Criteria add(Criteria add); } } /** * This class was generated by MyBatis Generator. * This class corresponds to the database table visituser * * @mbg.generated */ public static class Criterion { private String condition; private Object value; private Object secondValue; private boolean noValue; private boolean singleValue; private boolean betweenValue; private boolean listValue; private String typeHandler; public String getCondition() { return condition; } public Object getValue() { return value; } public Object getSecondValue() { return secondValue; } public boolean isNoValue() { return noValue; } public boolean isSingleValue() { return singleValue; } public boolean isBetweenValue() { return betweenValue; } public boolean isListValue() { return listValue; } public String getTypeHandler() { return typeHandler; } protected Criterion(String condition) { super(); this.condition = condition; this.typeHandler = null; this.noValue = true; } protected Criterion(String condition, Object value, String typeHandler) { super(); this.condition = condition; this.value = value; this.typeHandler = typeHandler; if (value instanceof List<?>) { this.listValue = true; } else { this.singleValue = true; } } protected Criterion(String condition, Object value) { this(condition, value, null); } protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { super(); this.condition = condition; this.value = value; this.secondValue = secondValue; this.typeHandler = typeHandler; this.betweenValue = true; } protected Criterion(String condition, Object value, Object secondValue) { this(condition, value, secondValue, null); } } public interface ICriteriaWhen { /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ void criteria(Criteria criteria); } public interface IExampleWhen { /** * This method was generated by MyBatis Generator. * This method corresponds to the database table visituser * * @mbg.generated */ void example(org.linlinjava.litemall.db.domain.VisituserExample example); } }
[ "tangj@axon.com.cn" ]
tangj@axon.com.cn
1fd0efdd7ecf7ed53ea263b4bef02961069b8a28
34886bd8cba7c0ba1284f5a1fea32f40345a064d
/example-4/demo-app/src/main/java/com/github/demo/RestTemplateConfig.java
473806986fb11d4d5adf610458d5fa6d748b97c7
[]
no_license
SoShibby/efk-demo
4a657f7fa7317bd02278a9a3654c4ee1ed558823
6c6ebf74f3f5ab7c4be002a8164c976f8bada4e3
refs/heads/master
2020-06-01T02:50:59.044656
2019-11-26T13:23:39
2019-11-26T13:23:39
190,605,450
0
0
null
2019-06-06T15:30:13
2019-06-06T15:30:12
null
UTF-8
Java
false
false
449
java
package com.github.demo; import org.springframework.boot.web.client.RestTemplateBuilder; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.client.RestTemplate; @Configuration public class RestTemplateConfig { @Bean public RestTemplate restTemplate(RestTemplateBuilder restTemplateBuilder) { return restTemplateBuilder.build(); } }
[ "hnilsson90@gmail.com" ]
hnilsson90@gmail.com
8cb8f07d6ea3cf14c61aace416a15af72e20de20
346b6485876c2de75876b8304a5796811ec5f1a5
/owsi-core/owsi-core-components/owsi-core-component-wicket-more/src/main/java/fr/openwide/core/wicket/more/util/convert/converters/HumanReadableLocalizedTextConverter.java
ef700aa5958340dfd27d7f406b2c94eccaf8e1f7
[ "Apache-2.0" ]
permissive
gsmet/owsi-core-parent
286eeb85428d85f8c9377396e95e7ee8df254c3c
e0f8448fb41f6b4aa916f4743ecd11f330b1d987
refs/heads/master
2021-01-15T22:04:34.222096
2016-06-30T14:11:46
2016-06-30T14:11:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,242
java
/* * Copyright (C) 2009-2011 Open Wide * Contact: contact@openwide.fr * * 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 fr.openwide.core.wicket.more.util.convert.converters; import fr.openwide.core.wicket.more.rendering.LocalizedTextRenderer; /** * @deprecated Use {@link LocalizedTextRenderer} instead. */ @Deprecated public class HumanReadableLocalizedTextConverter extends LocalizedTextRenderer { private static final long serialVersionUID = -6397339082088737503L; private static HumanReadableLocalizedTextConverter INSTANCE = new HumanReadableLocalizedTextConverter(); public static HumanReadableLocalizedTextConverter get() { return INSTANCE; } private HumanReadableLocalizedTextConverter() { } }
[ "yoann.rodiere@openwide.fr" ]
yoann.rodiere@openwide.fr
dae3b3dc2e879de80c854651ef85ebfef3aedf59
35e080e12d94181b37268db3704501a264ad5f80
/run/SingleCellChemostat/SingleCellChemostat.java
7dccefb7708104a614118d703e2a77223155c807
[]
no_license
cheekolegend/bsim_personal
bde31ff2c4cc66232d54a8ab2a7081c437ff84e0
f86813f30f23f06b7df42089d3b11e0eff97022a
refs/heads/master
2023-02-10T15:35:04.129695
2021-01-07T17:16:10
2021-01-07T17:16:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
17,167
java
package SingleCellChemostat; import bsim.BSim; import bsim.BSimTicker; import bsim.BSimUtils; import bsim.capsule.BSimCapsuleBacterium; import bsim.capsule.Mover; import bsim.capsule.RelaxationMoverGrid; import bsim.draw.BSimDrawer; import bsim.draw.BSimP3DDrawer; import bsim.export.BSimLogger; import bsim.export.BSimMovExporter; import bsim.export.BSimPngExporter; import com.beust.jcommander.JCommander; import com.beust.jcommander.Parameter; import processing.core.PConstants; import processing.core.PGraphics3D; import javax.vecmath.Vector3d; import java.lang.Math; import java.awt.*; import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; import java.util.*; import java.util.List; /** * Just a test to see if I can get bacteria to grow in a box and output their locations over time */ public class SingleCellChemostat { // Simulation export options. true = simulation results go to .csv. false = shows GUI @Parameter(names = "-export", description = "Enable export mode.") private boolean export = true; @Parameter(names = "-dt", arity = 1, description = "Export data every x [simulation time in s]") public int dt_export = 1; // Simulation setup parameters @Parameter(names = "-dim", arity = 3, description = "The dimensions (x, y, z) of simulation environment (um).") public List<Double> simDimensions = new ArrayList<>(Arrays.asList(new Double[] {1., 50., 1.})); @Parameter(names = "-pop", arity = 1, description = "Initial seed population (n_total).") public int initialPopulation = 5; // Cell parameters @Parameter(names="-gr_stdv",arity=1,description = "growth rate standard deviation") public double growth_stdv=0.05; @Parameter(names="-gr_mean",arity=1,description = "growth rate mean") public double growth_mean=0.2; // BSimCapsuleBacterium default is 0.2 @Parameter(names="-len_stdv",arity=1,description = "elongation threshold standard deviation") public double length_stdv=0.1; @Parameter(names="-len_mean",arity=1,description = "elongation threshold mean") public double length_mean=5.0; // BsimCapsuleBacterium default is 2*L_initial. Catie: 7.0 /** * Whether to enable growth in the ticker etc. or not... */ private static final boolean WITH_GROWTH = true; public static void main(String[] args) { SingleCellChemostat bsim_ex = new SingleCellChemostat(); new JCommander(bsim_ex, args); bsim_ex.run(); } public void run() { /********************************************************* * Initialise parameters from command line */ double simX = simDimensions.get(0); double simY = simDimensions.get(1); double simZ = simDimensions.get(2); long simulationStartTime = System.nanoTime(); // create the simulation object BSim sim = new BSim(); sim.setDt(0.0001); // Simulation Timestep sim.setSimulationTime(100); // 21600 = 6 hours sim.setTimeFormat("0.00"); // Time Format for display sim.setBound(simX, simY, simZ); // Simulation Boundaries /* NOTE - solid=false sets a periodic boundary condition. This overrides leakiness! */ // sim.setSolid(true, false, true); // Periodic bounds y+ and y- sim.setLeaky(false, false, true, true, false, false); /********************************************************* * Create the bacteria */ // Track all of the bacteria in the simulation, for use of common methods etc final ArrayList<BSimCapsuleBacterium> bacteriaAll = new ArrayList(); Random bacRng = new Random(); generator: while(bacteriaAll.size() < initialPopulation) { double bL = 1. + 0.1*(bacRng.nextDouble() - 0.5); double angle = bacRng.nextDouble()*2*Math.PI; Vector3d pos = new Vector3d( 0.5, 1.1 + bacRng.nextDouble()*(sim.getBound().y - 2.2), 0.5); // Test intersection Vector3d distance = new Vector3d(0,0,0); for(BSimCapsuleBacterium otherBac : bacteriaAll){ distance.sub(otherBac.position, pos); if(distance.lengthSquared() < length_mean){ continue generator; } } SingleCellChemostatBacterium bac = new SingleCellChemostatBacterium(sim, new Vector3d(pos.x, pos.y - bL*Math.cos(angle), pos.z), new Vector3d(pos.x, pos.y + bL*Math.cos(angle), pos.z) ); // assigns a growth rate and a division length to each bacterium according to a normal distribution double growthRate = BSimUtils.sampleNormal(growth_mean,growth_stdv); bac.setK_growth(growthRate); double lengthThreshold = BSimUtils.sampleNormal(length_mean,length_stdv); bac.setElongationThreshold(lengthThreshold); bacteriaAll.add(bac); } // Set up stuff for growth. final ArrayList<BSimCapsuleBacterium> act_born = new ArrayList(); final ArrayList<BSimCapsuleBacterium> act_dead = new ArrayList(); final Mover mover; mover = new RelaxationMoverGrid(bacteriaAll, sim); /********************************************************* * Set up the ticker */ int LOG_INTERVAL = 1; BSimTicker ticker = new BSimTicker() { @Override public void tick() { // ********************************************** Action long startTimeAction = System.nanoTime(); for(BSimCapsuleBacterium b : bacteriaAll) { b.action(); } long endTimeAction = System.nanoTime(); if((sim.getTimestep() % LOG_INTERVAL) == 0) { System.out.println("Action update for " + bacteriaAll.size() + " bacteria took " + (endTimeAction - startTimeAction)/1e6 + " ms."); } // ********************************************** Growth related activities if enabled. if(WITH_GROWTH) { // ********************************************** Growth and division startTimeAction = System.nanoTime(); for (BSimCapsuleBacterium b : bacteriaAll) { b.grow(); // Divide if grown past threshold if (b.L > b.L_th) { act_born.add(b.divide()); } } bacteriaAll.addAll(act_born); act_born.clear(); endTimeAction = System.nanoTime(); if ((sim.getTimestep() % LOG_INTERVAL) == 0) { System.out.println("Growth and division took " + (endTimeAction - startTimeAction) / 1e6 + " ms."); } // ********************************************** Neighbour interactions startTimeAction = System.nanoTime(); mover.move(); endTimeAction = System.nanoTime(); if ((sim.getTimestep() % LOG_INTERVAL) == 0) { System.out.println("Wall and neighbour interactions took " + (endTimeAction - startTimeAction) / 1e6 + " ms."); } // ********************************************** Boundaries/removal startTimeAction = System.nanoTime(); // Removal for (BSimCapsuleBacterium b : bacteriaAll) { // Kick out if past the top or bottom boundaries // if ((b.x1.y < 0) && (b.x2.y < 0)) { // act_dead.add(b); // } // if ((b.x1.y > sim.getBound().y) && (b.x2.y > sim.getBound().y)) { // act_dead.add(b); // } // kick out if past any boundary if(b.position.x < 0 || b.position.x > sim.getBound().x || b.position.y < 0 || b.position.y > sim.getBound().y || b.position.z < 0 || b.position.z > sim.getBound().z){ act_dead.add(b); } } bacteriaAll.removeAll(act_dead); act_dead.clear(); endTimeAction = System.nanoTime(); if ((sim.getTimestep() % LOG_INTERVAL) == 0) { System.out.println("Death and removal took " + (endTimeAction - startTimeAction) / 1e6 + " ms."); } } } }; sim.setTicker(ticker); /********************************************************* * Set up the drawer */ BSimDrawer drawer = new BSimP3DDrawer(sim, 800, 600) { /** * Draw the default cuboid boundary of the simulation as a partially transparent box * with a wireframe outline surrounding it. */ @Override public void boundaries() { p3d.noFill(); p3d.stroke(128, 128, 255); p3d.pushMatrix(); p3d.translate((float)boundCentre.x,(float)boundCentre.y,(float)boundCentre.z); p3d.box((float)bound.x, (float)bound.y, (float)bound.z); p3d.popMatrix(); p3d.noStroke(); } @Override public void draw(Graphics2D g) { p3d.beginDraw(); if(!cameraIsInitialised){ // camera(eyeX, eyeY, eyeZ, centerX, centerY, centerZ, upX, upY, upZ) p3d.camera((float)bound.x*0.5f, (float)bound.y*0.5f, // Set the Z offset to the largest of X/Y dimensions for a reasonable zoom-out distance: simX > simY ? (float)simX : (float)simY, // 10, (float)bound.x*0.5f, (float)bound.y*0.5f, 0, 0,1,0); cameraIsInitialised = true; } p3d.textFont(font); p3d.textMode(PConstants.SCREEN); p3d.sphereDetail(10); p3d.noStroke(); p3d.background(255, 255,255); scene(p3d); boundaries(); time(); p3d.endDraw(); g.drawImage(p3d.image, 0,0, null); } /** * Draw the formatted simulation time to screen. */ @Override public void time() { p3d.fill(0); //p3d.text(sim.getFormattedTimeHours(), 50, 50); p3d.text(sim.getFormattedTime(), 50, 50); } @Override public void scene(PGraphics3D p3d) { p3d.ambientLight(128, 128, 128); p3d.directionalLight(128, 128, 128, 1, 1, -1); for(BSimCapsuleBacterium b : bacteriaAll) { draw(b, Color.blue); } } }; sim.setDrawer(drawer); if(export) { String simParameters = "" + BSimUtils.timeStamp() + "__dim_" + simX + "_" + simY + "_" + simZ; String filePath = BSimUtils.generateDirectoryPath("./run/SingleCellChemostat/results/" + simParameters + "/"); /********************************************************* * Various properties of the simulation, for future reference. */ BSimLogger metaLogger = new BSimLogger(sim, filePath + "simInfo.txt") { @Override public void before() { super.before(); write("Simulation metadata."); write("SingleCellChemostat based on ChenOscillator"); write("Simulation dimensions: (" + simX + ", " + simY + ", " + simZ + ")"); } @Override public void during() { } }; metaLogger.setDt(1); // Set export time step sim.addExporter(metaLogger); /********************************************************* * Position is fixed at the start; we log it once. */ // BSimLogger posLogger = new BSimLogger(sim, filePath + "position.csv") { // DecimalFormat formatter = new DecimalFormat("###.##", DecimalFormatSymbols.getInstance( Locale.ENGLISH )); // // @Override // public void before() { // super.before(); // write("Initial cell positions. Fixed for the duration."); // write("per Act; per Rep; id, p1x, p1y, p1z, p2x, p2y, p2z"); // String buffer = new String(); // // write("Activators"); // // buffer = ""; // for(BSimCapsuleBacterium b : bacteriaAll) { // buffer += b.id + "," + formatter.format(b.x1.x) // + "," + formatter.format(b.x1.y) // + "," + formatter.format(b.x1.z) // + "," + formatter.format(b.x2.x) // + "," + formatter.format(b.x2.y) // + "," + formatter.format(b.x2.z) // + "\n"; // } // // write(buffer); // // write("Repressors"); // // buffer = ""; // for(BSimCapsuleBacterium b : bacteriaRepressors) { // buffer += b.id + "," + formatter.format(b.x1.x) // + "," + formatter.format(b.x1.y) // + "," + formatter.format(b.x1.z) // + "," + formatter.format(b.x2.x) // + "," + formatter.format(b.x2.y) // + "," + formatter.format(b.x2.z) // + "\n"; // } // // write(buffer); // } // // @Override // public void during() { // // } // }; // posLogger.setDt(30); // Set export time step // sim.addExporter(posLogger); BSimLogger posLogger = new BSimLogger(sim, filePath + "position.csv") { DecimalFormat formatter = new DecimalFormat("###.##", DecimalFormatSymbols.getInstance( Locale.ENGLISH )); @Override public void before() { super.before(); write("time (s); id, p1x, p1y, p1z, p2x, p2y, p2z, py"); } @Override public void during() { String buffer = new String(); buffer += sim.getFormattedTime() + "\n"; write(buffer); write("Frame"); buffer = ""; for(BSimCapsuleBacterium b : bacteriaAll) { buffer += b.id + "," + formatter.format(b.x1.x) + "," + formatter.format(b.x1.y) + "," + formatter.format(b.x1.z) + "," + formatter.format(b.x2.x) + "," + formatter.format(b.x2.y) + "," + formatter.format(b.x2.z) + "," + formatter.format(b.position.y) + "\n"; } write(buffer); } }; posLogger.setDt(dt_export); // Set export time step sim.addExporter(posLogger); /** * Export a rendered image file */ BSimPngExporter imageExporter = new BSimPngExporter(sim, drawer, filePath); imageExporter.setDt(30); sim.addExporter(imageExporter); /** * Export a movie file */ BSimMovExporter movieExporter = new BSimMovExporter(sim, drawer, filePath + "SSchemostat.mov"); movieExporter.setSpeed(10); movieExporter.setDt(1); // Output every 1 s of simulation time sim.addExporter(movieExporter); sim.export(); /** * Drawing a java plot once we're done? * See TwoCellsSplitGRNTest */ } else { sim.preview(); } long simulationEndTime = System.nanoTime(); System.out.println("Total simulation time: " + (simulationEndTime - simulationStartTime)/1e9 + " sec."); } }
[ "aaronyip.ca@gmail.com" ]
aaronyip.ca@gmail.com
f41d655442dbeb42c619ceff5653b6d67423b510
be4bc7ed09e468dbfc1cd25bae8ab025858c4c22
/src/Messenger/Server/ServerApp.java
d8ab3f901aaeed76ae849b011002ddd05d32ebd5
[]
no_license
anatomica/Messenger
99391bdcadd2fc534ab05cc39bd00ec4cec890c6
3eac4d8f453043fd0e8e86b11448e0362a375e92
refs/heads/master
2020-08-30T23:39:37.158693
2019-10-30T12:32:01
2019-10-30T12:32:01
218,523,280
0
0
null
null
null
null
UTF-8
Java
false
false
130
java
package Messenger.Server; public class ServerApp { public static void main(String[] args) { new MyServer(); } }
[ "maksfomin@gmail.com" ]
maksfomin@gmail.com
e949ad3db1b3af8d5fb94e302f05602327a8c6bf
8ec33a9f5ce85617aefe2d406f837e248f7e74bc
/src/main/java/com/hikvision/cms/ws/server/GetAllPersonInspectionResult.java
88cf25b4f5cbe5460ca89a0cbc9e595fd3af5d5e
[]
no_license
safger/police
88d59ab30cbf950f6d987e4f36b13c7923d59c78
59a80adf0add61a73ae05ca2fc6952756e700ec2
refs/heads/master
2021-09-05T21:08:54.357788
2018-01-31T02:07:20
2018-01-31T02:08:00
119,620,916
0
0
null
null
null
null
UTF-8
Java
false
false
1,518
java
package com.hikvision.cms.ws.server; import javax.xml.bind.JAXBElement; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElementRef; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="xml" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "xml" }) @XmlRootElement(name = "getAllPersonInspectionResult") public class GetAllPersonInspectionResult { @XmlElementRef(name = "xml", namespace = "http://server.ws.cms.hikvision.com", type = JAXBElement.class, required = false) protected JAXBElement<String> xml; /** * * @return * possible object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public JAXBElement<String> getXml() { return xml; } /** * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link String }{@code >} * */ public void setXml(JAXBElement<String> value) { this.xml = value; } }
[ "314351068@qq.com" ]
314351068@qq.com
733137abb2b9c55ba987204947f11677197ab43c
9b84a5f945fef1b633a55fe18ec53a997bc59d12
/addperkiraan.java
97d838dd152d240a40ba41e67b2a1848b8a1f0d4
[]
no_license
sekolahrobothijau/Potrosari
2150450e92442b9bc8ae6df9352099dbf5eae286
ea5d48ab477fa754a5a5009cd3ccb18547e83d86
refs/heads/master
2020-04-14T17:46:09.133720
2019-01-03T16:06:00
2019-01-03T16:06:00
163,993,124
0
0
null
2019-01-03T16:06:01
2019-01-03T15:53:42
Java
UTF-8
Java
false
false
27,775
java
/* * addbarang.java * * Created on March 10, 2008, 4:22 PM */ package src; import java.awt.Color; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.JDialog; /** * * @author aquwan */ public class addperkiraan extends javax.swing.JDialog { public static String isikodesubdept=""; public static String isiperkiraan; private String loguser; private Connection cnadd; private boolean status; private Statement stadd; private String namadb; /** Creates new form addbarang */ public addperkiraan(java.awt.Frame parent,boolean stat,String menu,String judul) { super(parent,judul,true); try { initComponents(); namadb = Login.namadbase; loguser = lib2.LOGuser; cnadd = lib2.CNC; status = stat; stadd = cnadd.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); //System.out.println(MainForm.test); if (status) { jTextFieldperkiraan.setEditable(true); jLabeljudul.setText(judul); } else { jLabeljudul.setText(judul); jTextFieldperkiraan.setEditable(false); jTextFieldperkiraan.setText(formok.ATable.getValueAt(formok.ATable.getSelectedRow(), 0).toString().trim()); cekmesin(); jTextFieldnamaperkiraan.requestFocus(); } } catch (SQLException ex) { Logger.getLogger(addperkiraan.class.getName()).log(Level.SEVERE, null, ex); } } /** 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. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { buttonGroupSub = new javax.swing.ButtonGroup(); buttonGroupNL = new javax.swing.ButtonGroup(); buttonGroupDK = new javax.swing.ButtonGroup(); buttonGroupDK1 = new javax.swing.ButtonGroup(); jPanel1 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jTextFieldperkiraan = new javax.swing.JTextField(); jTextFieldnamaperkiraan = new javax.swing.JTextField(); jButtonsimpan = new javax.swing.JButton(lib2.createImageIcon("24x24/simpan.png")); jButtonbatal = new javax.swing.JButton(lib2.createImageIcon("24x24/delete.png")); jLabel6 = new javax.swing.JLabel(); jRadioSubYa = new javax.swing.JRadioButton(); jRadioSubTidak = new javax.swing.JRadioButton(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jRadioNeraca = new javax.swing.JRadioButton(); jRadioLabarugi = new javax.swing.JRadioButton(); jLabel4 = new javax.swing.JLabel(); jRadioDebet = new javax.swing.JRadioButton(); jRadioKredit = new javax.swing.JRadioButton(); jLabeljudul = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { formWindowClosing(evt); } }); jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); jLabel1.setFont(new java.awt.Font("DejaVu Sans", 0, 18)); // NOI18N jLabel1.setText("Sub"); jPanel1.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 100, 150, 30)); jTextFieldperkiraan.setFont(new java.awt.Font("DejaVu Sans", 1, 18)); // NOI18N jTextFieldperkiraan.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { jTextFieldperkiraanKeyPressed(evt); } public void keyReleased(java.awt.event.KeyEvent evt) { jTextFieldperkiraanKeyReleased(evt); } }); jPanel1.add(jTextFieldperkiraan, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 10, 180, -1)); jTextFieldnamaperkiraan.setFont(new java.awt.Font("DejaVu Sans", 1, 18)); // NOI18N jTextFieldnamaperkiraan.addFocusListener(new java.awt.event.FocusAdapter() { public void focusLost(java.awt.event.FocusEvent evt) { jTextFieldnamaperkiraanFocusLost(evt); } }); jTextFieldnamaperkiraan.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { jTextFieldnamaperkiraanKeyPressed(evt); } public void keyReleased(java.awt.event.KeyEvent evt) { jTextFieldnamaperkiraanKeyReleased(evt); } }); jPanel1.add(jTextFieldnamaperkiraan, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 60, 350, -1)); jButtonsimpan.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N jButtonsimpan.setMnemonic('S'); jButtonsimpan.setText("Simpan"); jButtonsimpan.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonsimpanActionPerformed(evt); } }); jButtonsimpan.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { jButtonsimpanKeyPressed(evt); } }); jPanel1.add(jButtonsimpan, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 230, 140, 40)); jButtonbatal.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N jButtonbatal.setMnemonic('B'); jButtonbatal.setText("Batal"); jButtonbatal.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonbatalActionPerformed(evt); } }); jButtonbatal.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { jButtonbatalKeyPressed(evt); } }); jPanel1.add(jButtonbatal, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 230, 140, 40)); jLabel6.setFont(new java.awt.Font("DejaVu Sans", 0, 18)); // NOI18N jLabel6.setText("Nama Perkiraan"); jPanel1.add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 60, 150, -1)); buttonGroupSub.add(jRadioSubYa); jRadioSubYa.setFont(new java.awt.Font("DejaVu Sans", 0, 18)); // NOI18N jRadioSubYa.setText("Ya"); jRadioSubYa.setToolTipText("K"); jRadioSubYa.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRadioSubYaActionPerformed(evt); } }); jPanel1.add(jRadioSubYa, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 100, -1, -1)); buttonGroupSub.add(jRadioSubTidak); jRadioSubTidak.setFont(new java.awt.Font("DejaVu Sans", 0, 18)); // NOI18N jRadioSubTidak.setSelected(true); jRadioSubTidak.setText("Tidak"); jRadioSubTidak.setToolTipText("P"); jPanel1.add(jRadioSubTidak, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 100, -1, -1)); jLabel2.setFont(new java.awt.Font("DejaVu Sans", 0, 18)); // NOI18N jLabel2.setText("Perkiraan"); jPanel1.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 10, 150, 30)); jLabel3.setFont(new java.awt.Font("DejaVu Sans", 0, 18)); // NOI18N jLabel3.setText("Jenis Laporan"); jPanel1.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 140, 150, 30)); buttonGroupNL.add(jRadioNeraca); jRadioNeraca.setFont(new java.awt.Font("DejaVu Sans", 0, 18)); // NOI18N jRadioNeraca.setSelected(true); jRadioNeraca.setText("Neraca"); jRadioNeraca.setToolTipText("K"); jRadioNeraca.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRadioNeracaActionPerformed(evt); } }); jPanel1.add(jRadioNeraca, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 140, -1, -1)); buttonGroupNL.add(jRadioLabarugi); jRadioLabarugi.setFont(new java.awt.Font("DejaVu Sans", 0, 18)); // NOI18N jRadioLabarugi.setText("Laba Rugi"); jRadioLabarugi.setToolTipText("P"); jPanel1.add(jRadioLabarugi, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 140, -1, -1)); jLabel4.setFont(new java.awt.Font("DejaVu Sans", 0, 18)); // NOI18N jLabel4.setText("Kolom"); jPanel1.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 180, 150, 30)); buttonGroupDK.add(jRadioDebet); jRadioDebet.setFont(new java.awt.Font("DejaVu Sans", 0, 18)); // NOI18N jRadioDebet.setSelected(true); jRadioDebet.setText("Debet"); jRadioDebet.setToolTipText("K"); jRadioDebet.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRadioDebetActionPerformed(evt); } }); jPanel1.add(jRadioDebet, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 180, -1, -1)); buttonGroupDK.add(jRadioKredit); jRadioKredit.setFont(new java.awt.Font("DejaVu Sans", 0, 18)); // NOI18N jRadioKredit.setText("Kredit"); jRadioKredit.setToolTipText("P"); jPanel1.add(jRadioKredit, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 180, -1, -1)); jLabeljudul.setBackground(new java.awt.Color(37, 126, 197)); jLabeljudul.setFont(new java.awt.Font("DejaVu LGC Sans", 1, 18)); // NOI18N jLabeljudul.setForeground(new java.awt.Color(251, 246, 246)); jLabeljudul.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabeljudul.setText("Tambah"); jLabeljudul.setOpaque(true); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabeljudul, javax.swing.GroupLayout.DEFAULT_SIZE, 522, Short.MAX_VALUE) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 522, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jLabeljudul, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 302, Short.MAX_VALUE)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void cekmesin(){ String sqlmesin = "SELECT perkiraan,namaperkiraan,sub,nl,dk,ifnull(opr,'T')as opr FROM "+ namadb +".a_perkiraan WHERE perkiraan='" + jTextFieldperkiraan.getText().toString().trim() +"'"; String[] cekdt = lib1.cekdataarr(sqlmesin, new String[]{"perkiraan", "namaperkiraan", "sub", "nl", "dk","opr"}); if (cekdt[0] != null) { jTextFieldperkiraan.setText(cekdt[0].trim()); jTextFieldnamaperkiraan.setText(cekdt[1].trim()); if ((cekdt[2].trim()).equals("Y")){ jRadioSubYa.setSelected(true); } else if ((cekdt[2].trim()).equals("T")) { jRadioSubTidak.setSelected(true); } if ((cekdt[3].trim()).equals("N")){ jRadioNeraca.setSelected(true); } else if ((cekdt[3].trim()).equals("L")) { jRadioLabarugi.setSelected(true); } if ((cekdt[4].trim()).equals("D")){ jRadioDebet.setSelected(true); } else if ((cekdt[4].trim()).equals("K")) { jRadioKredit.setSelected(true); } } } private void jTextFieldperkiraanKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldperkiraanKeyPressed // TODO add your handling code here: int ascii = evt.getKeyCode(); if (ascii == 10) { //jika di tekan enter if (cekPerkiraan()) { if (lib2.left(jTextFieldperkiraan.getText(), 1).equals("1")) { jRadioNeraca.setSelected(true); } else if (lib2.left(jTextFieldperkiraan.getText(), 1).equals("2")) { jRadioNeraca.setSelected(true); } else if (lib2.left(jTextFieldperkiraan.getText(), 1).equals("3")) { jRadioNeraca.setSelected(true); } else { jRadioLabarugi.setSelected(true); } jTextFieldnamaperkiraan.requestFocus(); } } else if (ascii == 27) { //jika di tekan esc } }//GEN-LAST:event_jTextFieldperkiraanKeyPressed private void jButtonsimpanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonsimpanActionPerformed // TODO add your handling code here: simpan(); }//GEN-LAST:event_jButtonsimpanActionPerformed private void jButtonbatalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonbatalActionPerformed setVisible(false); dispose(); }//GEN-LAST:event_jButtonbatalActionPerformed private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing // TODO add your handling code here: }//GEN-LAST:event_formWindowClosing private void jRadioSubYaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioSubYaActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jRadioSubYaActionPerformed private void jRadioNeracaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioNeracaActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jRadioNeracaActionPerformed private void jRadioDebetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioDebetActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jRadioDebetActionPerformed private void jTextFieldperkiraanKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldperkiraanKeyReleased if (!lib2.maxisi(jTextFieldperkiraan, 11)) { lib1.msgerr("Kode tidak boleh lebih dari 12 digit, Ulangi !!!"); jTextFieldperkiraan.setText(lib2.left(jTextFieldperkiraan.getText(), 13)); } }//GEN-LAST:event_jTextFieldperkiraanKeyReleased private void jTextFieldnamaperkiraanKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldnamaperkiraanKeyPressed int ascii = evt.getKeyCode(); if (ascii == 10) { //jika di tekan enter jButtonsimpan.requestFocus(); } else if (ascii == 27) { //jika di tekan esc jTextFieldperkiraan.requestFocus(); jTextFieldperkiraan.selectAll(); } }//GEN-LAST:event_jTextFieldnamaperkiraanKeyPressed private void jTextFieldnamaperkiraanKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldnamaperkiraanKeyReleased if (lib2.hurufbesar(evt)) { //jTextFieldnamaperkiraan.setText(jTextFieldnamaperkiraan.getText().toUpperCase()); } }//GEN-LAST:event_jTextFieldnamaperkiraanKeyReleased private void jButtonsimpanKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jButtonsimpanKeyPressed int ascii = evt.getKeyCode(); if (ascii == 10) { //jika di tekan enter simpan(); } else if (ascii == 27) { //jika di tekan esc jTextFieldnamaperkiraan.requestFocus(); jTextFieldnamaperkiraan.selectAll(); } }//GEN-LAST:event_jButtonsimpanKeyPressed private void jButtonbatalKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jButtonbatalKeyPressed int ascii = evt.getKeyCode(); if (ascii == 10) { //jika di tekan enter setVisible(false); dispose(); } }//GEN-LAST:event_jButtonbatalKeyPressed private void jTextFieldnamaperkiraanFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextFieldnamaperkiraanFocusLost jTextFieldnamaperkiraan.setText(jTextFieldnamaperkiraan.getText().toUpperCase()); }//GEN-LAST:event_jTextFieldnamaperkiraanFocusLost private void mati(){ jTextFieldperkiraan.setEditable(false); } private void bersih() { /*menambah percobaan github for programming*/ if (status) { jTextFieldperkiraan.setText(""); jTextFieldnamaperkiraan.setText(""); jTextFieldperkiraan.setEditable(true); jTextFieldnamaperkiraan.setEditable(true); jTextFieldperkiraan.requestFocus(); } else { /*how to use branch on github*/ jTextFieldnamaperkiraan.setText(formok.ATable.getValueAt(formok.ATable.getSelectedRow(), 2).toString().trim()); jTextFieldnamaperkiraan.requestFocus(); } } private boolean cekPerkiraan() { boolean result = true; String sql= "SELECT PERKIRAAN FROM "+ namadb +".a_perkiraan WHERE PERKIRAAN='" +jTextFieldperkiraan.getText().toString().trim() + "'"; String[] hsl = lib1.cekdataarr(sql, new String[]{"PERKIRAAN"}); if (hsl[0] != null) { lib1.msgerr("Perkiraan " +jTextFieldperkiraan.getText().toString().trim() +" sudah dipakai, Ulangi !!!"); result = false; } else { result = true; } if (jTextFieldperkiraan.getText().length() > 6) { sql = "SELECT PERKIRAAN,SUB FROM " + namadb + ".a_perkiraan WHERE PERKIRAAN='" + lib2.left(jTextFieldperkiraan.getText().toString().trim(),6) + "'"; hsl = lib1.cekdataarr(sql, new String[]{"PERKIRAAN","SUB"}); if (hsl[0] != null) { result = true; } else { lib1.msgerr("Perkiraan " + lib2.left(jTextFieldperkiraan.getText().toString().trim(),6) + " belum terdaftar, Ulangi !!!"); result = false; } if (hsl[1].contentEquals("Y")) { result = true; } else { lib1.msgerr("Perkiraan " + lib2.left(jTextFieldperkiraan.getText().toString().trim(),6) + " tidak diset punya sub, Ulangi !!!"); result = false; } } return result; } private boolean cekkosong() { boolean result = true; if (jTextFieldperkiraan.getText().length() < 1) { jTextFieldperkiraan.requestFocus(); result = false; } if (jTextFieldnamaperkiraan.getText().length() < 1) { jTextFieldnamaperkiraan.requestFocus(); result = false; } return result; } private void simpan() { if (cekkosong()) { char sub = 0; char nl = 0; char dk = 0; char opr = 0; if (jRadioSubYa.isSelected()) { sub = 'Y'; } else if (jRadioSubTidak.isSelected()) { sub = 'T'; } if (jRadioNeraca.isSelected()) { nl = 'N'; } else if (jRadioLabarugi.isSelected()) { nl = 'L'; } if (jRadioDebet.isSelected()) { dk = 'D'; } else if (jRadioKredit.isSelected()) { dk = 'K'; } if (status) { String sql= "SELECT PERKIRAAN FROM "+ namadb +".a_perkiraan WHERE PERKIRAAN='" +jTextFieldperkiraan.getText().toString().trim() + "'"; String[] hsl = lib1.cekdataarr(sql, new String[]{"PERKIRAAN"}); if (hsl[0] != null) { int mpil = javax.swing.JOptionPane.showOptionDialog(this, "Perkiraan " + jTextFieldperkiraan.getText().trim() + " Sudah Dipakai", "Warning...", -1, 3, null, new Object[]{"OK"}, null); jTextFieldperkiraan.requestFocus(); } else { int mpil = javax.swing.JOptionPane.showOptionDialog(this, "Yakin Data Akan Di Simpan ?", "Simpan...", -1, 3, null, new Object[]{"Tidak", "Simpan"}, null); String newdept = "INSERT INTO "+ namadb +".a_perkiraan (perkiraan,namaperkiraan,sub,nl,dk,user) " + " VALUES('" + jTextFieldperkiraan.getText().trim() + "','" + jTextFieldnamaperkiraan.getText().trim() + "','" + sub + "','" + nl + "','" + dk + "','" + loguser + "')"; if (mpil == 1) { try { stadd.execute(newdept); } catch (SQLException ex) { ex.printStackTrace(); } bersih(); } setVisible(false); dispose(); } } else { int mpil = javax.swing.JOptionPane.showOptionDialog(this, "Yakin Data Akan Di Ubah ?", "Ubah...", -1, 3, null, new Object[]{"Tidak", "Ya"}, null); String editdept = "UPDATE "+ namadb +".a_perkiraan SET namaperkiraan" + "='" + jTextFieldnamaperkiraan.getText().trim() + "'," + "sub='" + sub + "'," + "nl='" + nl + "'," + "dk='" + dk + "'," + "user='" + loguser + "'" + " WHERE perkiraan='" + jTextFieldperkiraan.getText().trim() + "'"; if (mpil == 1) { try { stadd.execute(editdept); } catch (SQLException ex) { ex.printStackTrace(); } } setVisible(false); dispose(); } } } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.ButtonGroup buttonGroupDK; private javax.swing.ButtonGroup buttonGroupDK1; private javax.swing.ButtonGroup buttonGroupNL; private javax.swing.ButtonGroup buttonGroupSub; private javax.swing.JButton jButtonbatal; private javax.swing.JButton jButtonsimpan; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabeljudul; private javax.swing.JPanel jPanel1; private javax.swing.JRadioButton jRadioDebet; private javax.swing.JRadioButton jRadioKredit; private javax.swing.JRadioButton jRadioLabarugi; private javax.swing.JRadioButton jRadioNeraca; private javax.swing.JRadioButton jRadioSubTidak; private javax.swing.JRadioButton jRadioSubYa; private javax.swing.JTextField jTextFieldnamaperkiraan; private javax.swing.JTextField jTextFieldperkiraan; // End of variables declaration//GEN-END:variables } class perkiraantools { private static addperkiraan frmasal; public perkiraantools() { } public void ambil(String isi) { addperkiraan.isiperkiraan=isi; } public void tambah(Statement stA, String MXmenu, String Judul, String sql) { javax.swing.JDialog JDEdit = new addperkiraan(null, true, MXmenu, Judul); JDEdit.setLocationRelativeTo(null); JDEdit.setVisible(true); formok.reloadRecord(); } public void ubah(Statement stA, String MXmenu, String Judul, String sql) { if (formok.ATable.getSelectedRow() >= 0) { int x1 = 0; int x2 = 0; x2 = formok.ATable.getSelectedRow(); x1 = formok.ATable.getSelectedColumn()-1; javax.swing.JDialog JDEdit = new addperkiraan(null, false, MXmenu, Judul); JDEdit.setLocationRelativeTo(null); JDEdit.setVisible(true); //formok.reloadRecord(); formok.reloadRecord(x1,x2); } else { lib1.msgerr("Pilih dulu yg akan di Edit...."); } } public void cari(Statement stA, String MXmenu, String Judul, String sql) { String namadb = Login.namadbase; String tglAwal = Login.tglAwal; String tglAkhir = Login.tglAkhir; String sqlCek = " SELECT INSTR('" + sql + "','namadb') AS CEK"; String[] ceksql = lib1.cekdataarr(sqlCek, new String[]{"CEK"}); if (!ceksql[0].contentEquals("0")) { String sqlRepl = "SELECT REPLACE(REPLACE(REPLACE('" + sql + "','namadb','" + namadb + "'),'tglAwal','" + tglAwal + "'),'tglAkhir','" + tglAkhir + "') AS MSQL"; String[] datasql = lib1.cekdataarr(sqlRepl, new String[]{"MSQL"}); if (datasql[0] != null) { sql = datasql[0]; } } javax.swing.JDialog JDEdit = new FrmSearch(null, stA, sql, Judul, "formoktools.formokrefreshsql()"); JDEdit.setLocationRelativeTo(null); JDEdit.setVisible(true); } public void hapus(Statement stA, String MXmenu, String Judul, String sql) { if (formok.ATable.getSelectedRow() >= 0) { String perkiraan = formok.ATable.getValueAt(formok.ATable.getSelectedRow(), 0).toString().trim(); String namadb = Login.namadbase; int posawal=formok.ATable.getSelectedRow(); int mpil = cfunction.msgbox("Data Yakin akan di Hapus? ", "Hapus..", 0, new String[]{"Ya", "Tidak"}, 1); if (mpil == 0) { try { stA.execute("DELETE FROM "+ namadb +".a_perkiraan WHERE perkiraan='" + perkiraan +"'"); formok.reloadRecord(); formok.ATable.changeSelection(posawal,0, false, false); } catch (SQLException ex) { lib1.msgerr(ex.toString()); } } } else { lib1.msgerr("Pilih dulu yg akan di Hapus...."); } } }
[ "noreply@github.com" ]
sekolahrobothijau.noreply@github.com
9058bd87c0de705f70a9e1f058f70de7687a9144
2007887eed4953caa692f8074949ca21e33f1805
/src/Database/database.java
96aebfbb648dda72e2bb4935dc098c3e4361b07f
[]
no_license
abdulhamidmazroua/Courses-Center
7b2fc35fe632a0dd6788127b512e2550e1046024
1364328ce920bb29ab010e03990111a025f4835a
refs/heads/master
2023-01-28T23:23:51.726994
2020-12-07T19:25:25
2020-12-07T19:25:25
319,421,727
0
1
null
null
null
null
UTF-8
Java
false
false
13,636
java
// // Source code recreated from a .class file by IntelliJ IDEA // (powered by Fernflower decompiler) // package Database; import Designs.Home.group_S; import Tools.tools; import Tools.tools.table; import entities.books; import entities.group; import entities.instructor; import entities.subjects; import entities.year; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.sql.Statement; import java.text.SimpleDateFormat; import java.util.Date; import java.util.logging.Level; import java.util.logging.Logger; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.scene.control.ComboBox; import javafx.scene.image.ImageView; public class database { public static Connection con; private static final String DB_NAME = "course"; private static String url; public static ImageView backGround; public database() { } private static String setURL() { url = "jdbc:mysql://localhost:3306/course?autoReconnect=true&amp;useEncoding=true&amp;characterEncoding=UTF-8"; return url; } // establishing the connection public static void setConnection() { try { Class.forName("com.mysql.jdbc.Driver").newInstance(); con = DriverManager.getConnection(setURL(), "root", ""); } catch (SQLException var1) { tools.ErrorBox(var1.getMessage()); System.out.println(var1.getMessage()); } catch (ClassNotFoundException var2) { Logger.getLogger(database.class.getName()).log(Level.SEVERE, (String)null, var2); } catch (InstantiationException var3) { Logger.getLogger(database.class.getName()).log(Level.SEVERE, (String)null, var3); } catch (IllegalAccessException var4) { Logger.getLogger(database.class.getName()).log(Level.SEVERE, (String)null, var4); } } public static boolean checkUserAndPassword(String userName, String password) { try { setConnection(); Statement statement = con.createStatement(); String strCheck = "select * from users where username= '" + userName + "' and password= '" + password + "'"; statement.executeQuery(strCheck); if (statement.getResultSet().next()) { return true; } con.close(); } catch (SQLException var4) { tools.ErrorBox(var4.getMessage()); } return false; } // to check the sql statement validity public static boolean excuteQuery(String sqlStatement) { try { setConnection(); Statement statement = con.createStatement(); statement.executeUpdate(sqlStatement); con.close(); return true; } catch (SQLException var2) { return false; } } public static String AutoIncrementCoulmn(String tableName, String coulmnName) { try { setConnection(); Statement statement = con.createStatement(); String strDBcode = "select max(" + coulmnName + ") +1 AS auto from " + tableName; statement.executeQuery(strDBcode); String num; for(num = ""; statement.getResultSet().next(); num = statement.getResultSet().getString("auto")) { } con.close(); return num != null && !"".equals(num) ? num : "1"; } catch (SQLException var5) { tools.ErrorBox(var5.getMessage()); return null; } } public static table getTableData(String statement) { tools t = new tools(); try { setConnection(); Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery(statement); ResultSetMetaData rsmd = rs.getMetaData(); int coulmnCount = rsmd.getColumnCount(); t.getClass(); Tools.tools.table table = new table(coulmnCount); while(rs.next()) { Object[] row = new Object[coulmnCount]; for(int i = 0; i < coulmnCount; ++i) { row[i] = rs.getString(i + 1); } table.addNewRow(row); } con.close(); return table; } catch (SQLException var9) { t.getClass(); return new table(0); } } public static void fillComboBoxData(String tableName, String coulmnName, String condition, ComboBox<String> combo) { try { setConnection(); Statement stmt = con.createStatement(); String strSelect = "select " + coulmnName + " from " + tableName + condition; ResultSet rs = stmt.executeQuery(strSelect); rs.last(); int rowCount = rs.getRow(); rs.beforeFirst(); String[] values = new String[rowCount]; for(int i = 0; rs.next(); ++i) { values[i] = rs.getString(coulmnName); } con.close(); combo.getItems().addAll(values); } catch (SQLException var10) { } } public static ObservableList<books> buildBooksTable(String SQL) { setConnection(); ObservableList data = FXCollections.observableArrayList(); try { ResultSet rs = con.createStatement().executeQuery(SQL); while(rs.next()) { books cm = new books(); cm.setSubject_id(Integer.parseInt(rs.getString("subject_id"))); cm.setBook_id(Integer.parseInt(rs.getString("book_id"))); cm.setYear_id(Integer.parseInt(rs.getString("year_id"))); cm.setBook_name(rs.getString("book_name")); cm.setBooksNo(rs.getString("booksNo")); cm.setBook_price(Double.parseDouble(rs.getString("book_price"))); data.add(cm); } } catch (Exception var12) { var12.printStackTrace(); tools.ErrorBox("هنالك خطأ فى اضاف الداتا من قاعده البيانات الى الجدول"); } finally { try { con.close(); } catch (SQLException var11) { Logger.getLogger(database.class.getName()).log(Level.SEVERE, (String)null, var11); } return data; } } public static ObservableList<subjects> buildSubjectsTable(String SQL) { setConnection(); ObservableList data = FXCollections.observableArrayList(); try { ResultSet rs = con.createStatement().executeQuery(SQL); while(rs.next()) { subjects in = new subjects(); in.setSubject_id(Integer.parseInt(rs.getString("subject_id"))); in.setSubject_name(rs.getString("subject_name")); in.setSubject_price(Double.parseDouble(rs.getString("subject_price"))); in.setYear_id(Integer.parseInt(rs.getString("year_id"))); data.add(in); } } catch (Exception var12) { var12.printStackTrace(); tools.ErrorBox("هنالك خطأ فى اضاف الداتا من قاعده البيانات الى الجدول"); } finally { try { con.close(); } catch (SQLException var11) { Logger.getLogger(database.class.getName()).log(Level.SEVERE, (String)null, var11); } return data; } } public static ObservableList<group> buildGroupsTable(String SQL) { setConnection(); ObservableList data = FXCollections.observableArrayList(); try { ResultSet rs = con.createStatement().executeQuery(SQL); while(rs.next()) { group out = new group(); out.setGroup_id(Integer.parseInt(rs.getString("group_id"))); out.setGroup_name(rs.getString("group_name")); out.setYear_id(Integer.parseInt(rs.getString("year_id"))); out.setSubject_id(Integer.parseInt(rs.getString("subject_id"))); out.setInstructor_id(Integer.parseInt(rs.getString("instructor_id"))); out.setDateOne(rs.getString("dateOne")); out.setDateOne_hour(rs.getString("dateOne_hour")); out.setDateTwo(rs.getString("dateTwo")); out.setDateTwo_hour(rs.getString("dateTwo_hour")); data.add(out); } } catch (Exception var12) { var12.printStackTrace(); tools.ErrorBox("هنالك خطأ فى اضاف الداتا من قاعده البيانات الى الجدول"); } finally { try { con.close(); } catch (SQLException var11) { Logger.getLogger(database.class.getName()).log(Level.SEVERE, (String)null, var11); } return data; } } public static ObservableList<instructor> buildInstructorsTable(String SQL) { ObservableList<instructor> data = FXCollections.observableArrayList(); setConnection(); try { ResultSet rs = con.createStatement().executeQuery(SQL); while(rs.next()) { instructor s = new instructor(); s.setInstructor_id(Integer.parseInt(rs.getString("instractor_id"))); s.setInstructor_name(rs.getString("instractor_name")); s.setInstructor_phone(rs.getString("instractor_phone")); s.setInstructor_address(rs.getString("instractor_address")); s.setInstructor_salary((double)Integer.parseInt(rs.getString("instractor_notes"))); data.add(s); } con.close(); return data; } catch (Exception var7) { tools.WarningBox(var7.getMessage()); return data; } finally { ; } } public static ObservableList<year> buildYearsTable(String SQL) { ObservableList<year> data = FXCollections.observableArrayList(); setConnection(); try { ResultSet rs = con.createStatement().executeQuery(SQL); while(rs.next()) { year s = new year(); s.setYear_id(Integer.parseInt(rs.getString("year_id"))); s.setYear_name(rs.getString("year_name")); data.add(s); } con.close(); return data; } catch (Exception var7) { tools.WarningBox(var7.getMessage()); return data; } finally { ; } } public static ObservableList<instructor> buildTeachersTable(String SQL) { ObservableList<instructor> data = FXCollections.observableArrayList(); setConnection(); try { ResultSet rs = con.createStatement().executeQuery(SQL); while(rs.next()) { instructor s = new instructor(); s.setInstructor_id(Integer.parseInt(rs.getString("instructor_id"))); s.setSubject_id(Integer.parseInt(rs.getString("subject_id"))); s.setInstructor_name(rs.getString("instructor_name")); s.setInstructor_phone(rs.getString("instructor_phone")); s.setInstructor_address(rs.getString("instructor_address")); s.setInstructor_salary(Double.parseDouble(rs.getString("instructor_salary"))); data.add(s); } con.close(); return data; } catch (Exception var7) { tools.WarningBox(var7.getMessage()); return data; } finally { ; } } public static ObservableList<group_S> buildAllStudentsInGroupTable(String SQL) { ObservableList<group_S> data = FXCollections.observableArrayList(); setConnection(); try { ResultSet rs = con.createStatement().executeQuery(SQL); while(rs.next()) { group_S s = new group_S(); s.setS_code(rs.getString("s_code")); s.setS_name(rs.getString("s_name")); s.setGroup_name(rs.getString("group_name")); s.setSubject_name(rs.getString("subject_name")); s.setYear_name(rs.getString("year_name")); data.add(s); } con.close(); return data; } catch (Exception var7) { return data; } finally { ; } } public static ObservableList<group_S> buildAllTeacherInGroupTable(String SQL) { ObservableList<group_S> data = FXCollections.observableArrayList(); setConnection(); try { ResultSet rs = con.createStatement().executeQuery(SQL); while(rs.next()) { group_S s = new group_S(); s.setS_code(rs.getString("instructor_id")); s.setS_name(rs.getString("instructor_name")); s.setGroup_name(rs.getString("instructor_phone")); s.setSubject_name(rs.getString("subject_id")); s.setYear_name(rs.getString("instructor_address")); data.add(s); } con.close(); return data; } catch (Exception var7) { return data; } finally { ; } } }
[ "abdulhamidmazroua@gmail.com" ]
abdulhamidmazroua@gmail.com
f7633f416b4280e6823f2711111286a83220c94a
167facd27579a44f1c27211cb074e533fa8ce1e4
/TigerConnectDemoApp/app/src/main/java/com/tigertext/ttandroid/sample/bottomsheet/BottomSheetOptions.java
1240cd74a3983ccc19614e4d333a3d246aaa21a3
[]
no_license
Binod-Shrestha/android_sdk_demo
c95b9613bacd215bcc8ef58e3e574e5bf8b65369
54051a8805191c2fdb8d907699a77acb7d72af5f
refs/heads/master
2022-02-19T22:37:15.283769
2019-09-23T20:27:11
2019-09-23T20:27:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,189
java
package com.tigertext.ttandroid.sample.bottomsheet; import android.app.Dialog; import android.os.Bundle; import android.support.design.widget.BottomSheetBehavior; import android.support.design.widget.BottomSheetDialogFragment; import android.support.v7.widget.DividerItemDecoration; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.View; import android.widget.FrameLayout; import com.tigertext.ttandroid.sample.R; import org.jetbrains.annotations.NotNull; public class BottomSheetOptions extends BottomSheetDialogFragment { public static final String TAG = "BottomSheetOptions"; private BottomSheetOptionsAdapter bottomSheetOptionsAdapter; private BottomSheetOptionsAdapter.BottomDialogItemClick listener; @NotNull @Override public Dialog onCreateDialog(Bundle savedInstanceState) { Dialog bottomSheetDialog = super.onCreateDialog(savedInstanceState); bottomSheetDialog.setOnShowListener(dialog -> { FrameLayout bottomSheet = bottomSheetDialog.findViewById(android.support.design.R.id.design_bottom_sheet); BottomSheetBehavior<FrameLayout> behavior = BottomSheetBehavior.from(bottomSheet); behavior.setSkipCollapsed(true); behavior.setState(BottomSheetBehavior.STATE_EXPANDED); }); return bottomSheetDialog; } @Override public void setupDialog(Dialog dialog, int style) { View rootView = View.inflate(getContext(), R.layout.message_option_bottom_sheet, null); dialog.setContentView(rootView); setupRecyclerView(rootView); addDialogItems(); } private void addDialogItems() { bottomSheetOptionsAdapter.setListener(new BottomSheetOptionsAdapter.BottomDialogItemClick() { @Override public void onItemSelected(View view, int position) { if (isStateSaved()) return; listener.onItemSelected(view, position); dismiss(); } @Override public void onNothingSelected() { listener.onNothingSelected(); } }); if (getArguments() != null) { bottomSheetOptionsAdapter.addItemOptions(getArguments().getStringArrayList("itemOptions")); } } private void setupRecyclerView(View rootView) { RecyclerView recyclerMessageOptions = rootView.findViewById(R.id.message_options_recycler_view); bottomSheetOptionsAdapter = new BottomSheetOptionsAdapter(); recyclerMessageOptions.setAdapter(bottomSheetOptionsAdapter); LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext()); recyclerMessageOptions.setLayoutManager(linearLayoutManager); DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(recyclerMessageOptions.getContext(), linearLayoutManager.getOrientation()); recyclerMessageOptions.addItemDecoration(dividerItemDecoration); } public void setOnItemSelected(BottomSheetOptionsAdapter.BottomDialogItemClick listener) { this.listener = listener; } }
[ "cary.dobeck@gmail.com" ]
cary.dobeck@gmail.com
2fe992fa9b5d03397313c6923ef3a65180667cb5
b5241a93051aef2305b6848300609ee3db9deef3
/ejercicio-03-convertidor-tasas/src/test/java/com/eiv/convertidor/ConversorTeParaTnvTest.java
bed91bba8227c61d92e9e80c2536c8dd82d760a5
[]
no_license
EIVSoftware/ejercicios-java-2019
54bcc8dbffc190039ed8feaba7fb095fe92759ed
0718bb49c94be0852062d0db4f7ce3733e701a29
refs/heads/master
2022-01-26T16:18:44.935434
2019-10-18T19:25:02
2019-10-18T19:25:02
190,193,580
0
10
null
2022-01-21T23:32:11
2019-06-04T12:07:47
Java
UTF-8
Java
false
false
1,637
java
package com.eiv.convertidor; import static org.junit.Assert.assertThat; import java.math.BigDecimal; import java.util.Arrays; import java.util.Collection; import org.hamcrest.core.Is; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameter; import org.junit.runners.Parameterized.Parameters; @RunWith(Parameterized.class) public class ConversorTeParaTnvTest { public static Conversor CONVERSOR; static { CONVERSOR = new Conversor(); } @Parameter(0) public long moduloOrigen; @Parameter(1) public long moduloDestino; @Parameter(2) public BigDecimal tasaOrigen; @Parameter(3) public BigDecimal tasaEsperada; @Parameter(4) public long dias; @Parameters(name = "{index}: MODULO: {0}, TIPO: {1}, VALOR: {2}") public static Collection<Object[]> data() { return Arrays.asList(new Object[][] { { 360, 360, BigDecimal.valueOf(60), BigDecimal.valueOf(47.93), 30 } }); } @Test public void givenTe_thenTnv() { CONVERSOR .datosIniciales(tasa -> { tasa.setModulo(moduloOrigen); tasa.setTipo(TipoTasaEnum.TE); tasa.setValor(tasaOrigen); }) .calcular(TipoTasaEnum.TNV, moduloDestino, dias) .resultado() .ifPresent(tasa -> { assertThat(tasa.getValor().compareTo(tasaEsperada), Is.is(0)); }); } }
[ "dcairone@eiva.com.ar" ]
dcairone@eiva.com.ar
925019c5fc8bca580c47fc5356ae2c5181b29451
c968ca5fed448f3425b3d5fe27327382dc9085ee
/app/src/main/java/fragments/CurrCashPosTabSummaryFragment.java
9a6aea5c61d86659257e063e75429ad6c1012298
[]
no_license
aartisoft/CashBox
7fa7a702b8ebf115dd2b846bda2766c55ecef04c
6d123c0f7698b1cda364a28dfed845e5971223c6
refs/heads/master
2020-06-04T08:08:02.475391
2019-06-13T09:37:07
2019-06-13T09:37:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,721
java
package fragments; import android.content.Context; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ListView; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; import com.example.dd.cashbox.R; import java.text.DecimalFormat; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import adapter.ListViewCurrCashPositionAdapter; import global.GlobVar; import objects.ObjBillProduct; import static global.GlobVar.g_lstTables; public class CurrCashPosTabSummaryFragment extends Fragment { private ListViewCurrCashPositionAdapter m_adapterlvsumincome; private ListViewCurrCashPositionAdapter m_adapterlvsumoincome; private ListView m_lvsumincome; private ListView m_lvsumoincome; private Context m_Context; @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_currcashpostabsummary, container, false); //init variables m_Context = view.getContext(); m_lvsumincome = view.findViewById(R.id.fragment_currcashpostabsummary_lvincome); m_lvsumoincome = view.findViewById(R.id.fragment_currcashpostabsummary_lvoincome); //set listview setListViewIncome(); setListViewOtherIncome(); return view; } private void setListViewIncome(){ //build data for listview List lstViewAttr = new ArrayList<>(); DecimalFormat df = new DecimalFormat("0.00"); HashMap<String,String> hashMap = new HashMap<>(); hashMap.put("typ", getResources().getString(R.string.src_Start)); String strDate = getStartingDate(); hashMap.put("value", strDate); lstViewAttr.add(hashMap); hashMap = new HashMap<>(); hashMap.put("typ", getResources().getString(R.string.src_Barzahlungen)); //get sum double dSum = getAllIncomeSum(); String strOutput = df.format(dSum); hashMap.put("value", strOutput + " €"); lstViewAttr.add(hashMap); hashMap = new HashMap<>(); hashMap.put("typ", getResources().getString(R.string.src_Retoure)); //get sum dSum = getRetoureSum(); strOutput = df.format(dSum); hashMap.put("value", "-" + strOutput + " €"); lstViewAttr.add(hashMap); hashMap = new HashMap<>(); hashMap.put("typ", getResources().getString(R.string.src_Gesamt)); //get sum double dSumAll = getRevenueSum(); String strSumAll = df.format(dSumAll); hashMap.put("value", strSumAll + " €"); lstViewAttr.add(hashMap); m_adapterlvsumincome = new ListViewCurrCashPositionAdapter(lstViewAttr); m_lvsumincome.setAdapter(m_adapterlvsumincome); } private void setListViewOtherIncome(){ //build data for listview List lstViewAttr = new ArrayList<>(); HashMap<String,String> hashMap = new HashMap<>(); hashMap.put("typ", getResources().getString(R.string.src_Trinkgeld)); //get sum double dSum = getAllTip(); DecimalFormat df = new DecimalFormat("0.00"); String strOutput = df.format(dSum); hashMap.put("value", strOutput + " €"); lstViewAttr.add(hashMap); /*hashMap = new HashMap<>(); hashMap.put("typ", getResources().getString(R.string.src_DruckerName)); hashMap.put("value", printer.getDeviceName()); lstViewAttr.add(hashMap);*/ m_adapterlvsumoincome = new ListViewCurrCashPositionAdapter(lstViewAttr); m_lvsumoincome.setAdapter(m_adapterlvsumoincome); } private String getStartingDate(){ String strDate = ""; for(int iCounterTables = 0; iCounterTables < g_lstTables.size(); iCounterTables++){ for(int iCounterBills = 0; iCounterBills < g_lstTables.get(iCounterTables).g_lstBills.size(); iCounterBills++){ if(g_lstTables.get(iCounterTables).g_lstBills.get(iCounterBills).getBillNr() == 1){ strDate = GlobVar.g_lstTables.get(iCounterTables).g_lstBills.get(iCounterBills).getBillingDate(); return strDate; } } } return strDate; } private double getAllIncomeSum(){ double dSum = 0.0; for(int iCounterTables = 0; iCounterTables < g_lstTables.size(); iCounterTables++){ for(int iCounterBills = 0; iCounterBills < g_lstTables.get(iCounterTables).g_lstBills.size(); iCounterBills++){ for(ObjBillProduct objBillProduct : g_lstTables.get(iCounterTables).g_lstBills.get(iCounterBills).m_lstProducts){ if(objBillProduct.getPaid()){ dSum += objBillProduct.getVK(); } } } } return dSum; } private double getRevenueSum(){ double dSum = 0.0; for(int iCounterTables = 0; iCounterTables < g_lstTables.size(); iCounterTables++){ for(int iCounterBills = 0; iCounterBills < g_lstTables.get(iCounterTables).g_lstBills.size(); iCounterBills++){ for(ObjBillProduct objBillProduct : g_lstTables.get(iCounterTables).g_lstBills.get(iCounterBills).m_lstProducts){ if(objBillProduct.getPaid() && !objBillProduct.getReturned()){ dSum += objBillProduct.getVK(); } } } } return dSum; } private double getRetoureSum(){ double dSum = 0.0; for(int iCounterTables = 0; iCounterTables < g_lstTables.size(); iCounterTables++){ for(int iCounterBills = 0; iCounterBills < g_lstTables.get(iCounterTables).g_lstBills.size(); iCounterBills++){ for(ObjBillProduct objBillProduct : g_lstTables.get(iCounterTables).g_lstBills.get(iCounterBills).m_lstProducts){ if(objBillProduct.getReturned() && objBillProduct.getPaid()){ dSum += objBillProduct.getVK(); } } } } return dSum; } private double getAllTip(){ double dSum = 0.0; for(int iCounterTables = 0; iCounterTables < g_lstTables.size(); iCounterTables++){ for(int iCounterBills = 0; iCounterBills < g_lstTables.get(iCounterTables).g_lstBills.size(); iCounterBills++){ dSum += g_lstTables.get(iCounterTables).g_lstBills.get(iCounterBills).getTip(); } } return dSum; } }
[ "diedrich.dominik@yahoo.com" ]
diedrich.dominik@yahoo.com
885f026e939026c82d4415320279d80c993a3031
eafae636c22b5d95db19e5271d58796bd7be4a66
/app-release-unsigned/sources/io/reactivex/internal/operators/flowable/FlowableReduce.java
3e982b1da2dc1a62640156112b76cd896898c200
[]
no_license
agustrinaldokurniawan/News_Kotlin_Native
5fb97e9c9199c464e64a6ef901b133c88da3db55
411f2ae0c01f2cc490f9b80a6b8f40196bc74176
refs/heads/main
2023-05-31T20:59:44.356059
2021-06-15T14:43:42
2021-06-15T14:43:42
377,077,236
0
0
null
2021-06-15T07:44:11
2021-06-15T07:38:27
null
UTF-8
Java
false
false
4,128
java
package io.reactivex.internal.operators.flowable; import io.reactivex.Flowable; import io.reactivex.FlowableSubscriber; import io.reactivex.exceptions.Exceptions; import io.reactivex.functions.BiFunction; import io.reactivex.internal.functions.ObjectHelper; import io.reactivex.internal.subscriptions.DeferredScalarSubscription; import io.reactivex.internal.subscriptions.SubscriptionHelper; import io.reactivex.plugins.RxJavaPlugins; import kotlin.jvm.internal.LongCompanionObject; import org.reactivestreams.Subscriber; import org.reactivestreams.Subscription; public final class FlowableReduce<T> extends AbstractFlowableWithUpstream<T, T> { final BiFunction<T, T, T> reducer; public FlowableReduce(Flowable<T> flowable, BiFunction<T, T, T> biFunction) { super(flowable); this.reducer = biFunction; } /* access modifiers changed from: protected */ @Override // io.reactivex.Flowable public void subscribeActual(Subscriber<? super T> subscriber) { this.source.subscribe((FlowableSubscriber) new ReduceSubscriber(subscriber, this.reducer)); } static final class ReduceSubscriber<T> extends DeferredScalarSubscription<T> implements FlowableSubscriber<T> { private static final long serialVersionUID = -4663883003264602070L; final BiFunction<T, T, T> reducer; Subscription upstream; ReduceSubscriber(Subscriber<? super T> subscriber, BiFunction<T, T, T> biFunction) { super(subscriber); this.reducer = biFunction; } @Override // io.reactivex.FlowableSubscriber, org.reactivestreams.Subscriber public void onSubscribe(Subscription subscription) { if (SubscriptionHelper.validate(this.upstream, subscription)) { this.upstream = subscription; this.downstream.onSubscribe(this); subscription.request(LongCompanionObject.MAX_VALUE); } } /* JADX DEBUG: Multi-variable search result rejected for r1v1, resolved type: io.reactivex.functions.BiFunction<T, T, T> */ /* JADX WARN: Multi-variable type inference failed */ @Override // org.reactivestreams.Subscriber public void onNext(T t) { if (this.upstream != SubscriptionHelper.CANCELLED) { Object obj = this.value; if (obj == null) { this.value = t; return; } try { this.value = ObjectHelper.requireNonNull(this.reducer.apply(obj, t), "The reducer returned a null value"); } catch (Throwable th) { Exceptions.throwIfFatal(th); this.upstream.cancel(); onError(th); } } } @Override // org.reactivestreams.Subscriber public void onError(Throwable th) { if (this.upstream == SubscriptionHelper.CANCELLED) { RxJavaPlugins.onError(th); return; } this.upstream = SubscriptionHelper.CANCELLED; this.downstream.onError(th); } /* JADX DEBUG: Multi-variable search result rejected for r2v0, resolved type: io.reactivex.internal.operators.flowable.FlowableReduce$ReduceSubscriber<T> */ /* JADX WARN: Multi-variable type inference failed */ @Override // org.reactivestreams.Subscriber public void onComplete() { if (this.upstream != SubscriptionHelper.CANCELLED) { this.upstream = SubscriptionHelper.CANCELLED; Object obj = this.value; if (obj != null) { complete(obj); } else { this.downstream.onComplete(); } } } @Override // io.reactivex.internal.subscriptions.DeferredScalarSubscription, org.reactivestreams.Subscription public void cancel() { super.cancel(); this.upstream.cancel(); this.upstream = SubscriptionHelper.CANCELLED; } } }
[ "agust.kurniawan@Agust-Rinaldo-Kurniawan.local" ]
agust.kurniawan@Agust-Rinaldo-Kurniawan.local
4c0ed47f23fe442731603dc5d0a65b550d0e1d81
a56c0cd03b3731c8e6a340e8d77bee09746a92cd
/src/main/java/com/fansin/message/tool/core/AbstractMessageProcessor.java
f46375ac7e4dca71f88442c94dbdb2468285c57c
[]
no_license
August2016/message-tool
0b47fd372aebac4940c98251a4ee33ce71b149e4
e9968cfadefc54ffb3bbabb38518fc033df5cec4
refs/heads/master
2020-03-19T20:20:52.390548
2018-05-04T02:35:58
2018-05-04T02:35:58
136,897,700
1
0
null
2018-06-11T08:35:40
2018-06-11T08:35:40
null
UTF-8
Java
false
false
3,646
java
package com.fansin.message.tool.core; import cn.hutool.core.util.ZipUtil; import lombok.extern.slf4j.Slf4j; import java.io.File; import java.util.concurrent.ForkJoinPool; import java.util.concurrent.TimeUnit; /** * <p>Title: AbstractMessageProcessor</p> * <p>Description: </p> * * @author zhaofeng * @version 1.0 * @date 18 -5-2 */ @Slf4j public abstract class AbstractMessageProcessor { private static final String MODE_READ = "r"; private static final String MODE_WRITE = "rw"; private static final int WAITING_DAYS = 1; /** * The Receiver. */ protected LinkedDataReceiver receiver; /** * 使用一个,太多占用资源 */ private ForkJoinPool pool; /** * Instantiates a new Abstract message processor. * * @param receiver the receiver */ public AbstractMessageProcessor(LinkedDataReceiver receiver) { this.receiver = receiver; } /** * 从zip读取文件 * * @param filePath the file path */ public void readZip(String filePath) { //限于RandomAccessFile只能从文件获取流,先解压文件 readZip(new File(filePath)); } /** * Read zip. * * @param file the file */ public void readZip(File file) { log.info("识别文件类型为zip....{}", file.getAbsolutePath()); File files = ZipUtil.unzip(file); readDir(files); } /** * 读取目录 * * @param files */ private void readDir(File files) { log.info("识别文件类型为 目录....{}", files.getAbsolutePath()); if (files.isDirectory()) { //递归目录 File[] list = files.listFiles(); for (File file : list) { readDir(file); } } else { //读取文件 read(files.getAbsolutePath()); } } /** * Read dir. * * @param filePath the file path */ public void readDir(String filePath) { readDir(new File(filePath)); } /** * 读取文件 * * @param filePath the file path */ public void read(String filePath) { if (filePath.toLowerCase().endsWith(".txt")) { readFile(filePath); } else if (filePath.toLowerCase().endsWith(".zip")) { readZip(filePath); } else if (new File(filePath).isDirectory()) { readDir(filePath); } else { log.error("文件类型不支持{}", filePath); } } /** * @param filePath */ private void readFile(String filePath) { log.info("识别文件类型为 文件....{}", filePath); read0(filePath, MODE_READ); } /** * 增加统计代码 * * @param filePath * @param mode */ private void read0(String filePath, String mode) { log.info("解析任务开始...异步任务处理"); init(); read(filePath, mode); // destroy(); } /** * 初始化ForkJoinPool */ private void init() { //默认cup线程数 pool = new ForkJoinPool(); } /** * 关闭资源 */ private void destroy() { pool.shutdown(); try { pool.awaitTermination(WAITING_DAYS, TimeUnit.DAYS); } catch (InterruptedException e) { e.printStackTrace(); } } /** * 为不同的报文解析提供具体实现 * * @param filePath the file path * @param mode the mode */ protected abstract void read(String filePath, String mode); }
[ "171388204@qq.com" ]
171388204@qq.com
149f69c971ca32a19d2aef1b887a8ff51acc4c96
1fe18134cb6cab829449f874be47cb5e7b2143e0
/dynamic-datasource/src/main/java/com/gonar/dynamicdatasource/crm/service/impl/RoleServiceImpl.java
8fc5a6cb1bdc6c0e3839e37cc52173c5b70b94ef
[ "MIT" ]
permissive
13797411476/gonar
7ff57097dccfcefe64910148787f9da94f7f9544
d2e2e7b624633579bd53434a153a8fa337b70400
refs/heads/master
2022-12-22T04:40:12.376896
2020-01-20T10:31:30
2020-01-20T10:31:30
232,939,037
1
0
MIT
2022-11-16T09:21:50
2020-01-10T01:22:34
Java
UTF-8
Java
false
false
528
java
package com.gonar.dynamicdatasource.crm.service.impl; import com.gonar.dynamicdatasource.crm.entity.Role; import com.gonar.dynamicdatasource.crm.dao.RoleMapper; import com.gonar.dynamicdatasource.crm.service.IRoleService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; /** * <p> * 服务实现类 * </p> * * @author YeJin * @since 2019-08-28 */ @Service public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IRoleService { }
[ "1075385856@qq.com" ]
1075385856@qq.com
ebae53e1b33d3712cad62193edc7604fd1764333
383536f217283580bd2dd2bfe18cc47136ecf529
/src/main/java/io/oneko/helm/HelmCommands.java
f9c3e007a04c0c2040bf115e0a9d58ead512be6f
[ "Apache-2.0" ]
permissive
subshell/o-neko
04c17118002469a3390d191dd107005213df785e
254a2790b79dfc7c67fdc2614812733d52aaec3f
refs/heads/master
2023-07-17T07:58:00.745567
2023-04-12T14:26:33
2023-04-12T14:26:33
206,104,667
13
7
Apache-2.0
2023-07-12T01:34:47
2019-09-03T15:01:28
Java
UTF-8
Java
false
false
8,189
java
package io.oneko.helm; import java.time.Instant; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import com.google.common.annotations.VisibleForTesting; import io.micrometer.core.instrument.Counter; import io.micrometer.core.instrument.MeterRegistry; import io.micrometer.core.instrument.Timer; import io.oneko.helmapi.api.Helm; import io.oneko.helmapi.model.Chart; import io.oneko.helmapi.model.InstallStatus; import io.oneko.helmapi.model.Release; import io.oneko.helmapi.model.Status; import io.oneko.helmapi.model.Values; import io.oneko.helmapi.process.CommandException; import io.oneko.metrics.MetricNameBuilder; import io.oneko.project.ProjectVersion; import io.oneko.templates.WritableConfigurationTemplate; import lombok.extern.slf4j.Slf4j; @Service @Slf4j public class HelmCommands { private final Helm helm = new Helm(); private final Counter commandErrorCounter; private final Timer addRepoTimer; private final Timer deleteRepoTimer; private final Timer repoUpdateTimer; private final Timer searchRepoTimer; private final Timer installTimer; private final Timer uninstallTimer; private final Timer statusTimer; private Instant lastRepoUpdate = Instant.MIN; public HelmCommands(MeterRegistry meterRegistry) { this.commandErrorCounter = Counter.builder(new MetricNameBuilder().amountOf("helm.command.errors").build()) .description("number of errors during Helm command execution") .register(meterRegistry); this.addRepoTimer = timer("repo_add", meterRegistry); this.deleteRepoTimer = timer("repo_delete", meterRegistry); this.repoUpdateTimer = timer("repo_update", meterRegistry); this.searchRepoTimer = timer("search_repo", meterRegistry); this.installTimer = timer("install", meterRegistry); this.uninstallTimer = timer("uninstall", meterRegistry); this.statusTimer = timer("status", meterRegistry); } private Timer timer(String operation, MeterRegistry meterRegistry) { return Timer.builder(new MetricNameBuilder().durationOf("helm.command").build()) .description("duration of Helm commands") .publishPercentileHistogram() .tag("operation", operation) .register(meterRegistry); } public void addRegistry(ReadableHelmRegistry helmRegistry) throws HelmRegistryException { try { addRepoTimer.record(() -> helm.addRepo(helmRegistry.getName(), helmRegistry.getUrl(), helmRegistry.getUsername(), helmRegistry.getPassword()) ); } catch (CommandException e) { commandErrorCounter.increment(); throw HelmRegistryException.fromCommandException(e, helmRegistry.getUrl(), helmRegistry.getName()); } } public void deleteRegistry(ReadableHelmRegistry helmRegistry) throws HelmRegistryException { try { deleteRepoTimer.record(() -> helm.removeRepo(helmRegistry.getName()) ); } catch (CommandException e) { commandErrorCounter.increment(); throw HelmRegistryException.fromCommandException(e, helmRegistry.getUrl(), helmRegistry.getName()); } } public synchronized void updateReposNotTooOften() { final Instant now = Instant.now(); if (now.isBefore(lastRepoUpdate.plusSeconds(30))) { log.debug("not updating helm repos because the last update was less than 30 seconds ago"); return; } lastRepoUpdate = now; repoUpdateTimer.record(helm::updateRepos); } public List<Chart> getCharts(ReadableHelmRegistry helmRegistry) throws HelmRegistryException { try { updateReposNotTooOften(); return searchRepoTimer.record(() -> helm.searchRepo(helmRegistry.getName() + "/", true, false) ); } catch (CommandException e) { commandErrorCounter.increment(); throw HelmRegistryException.fromCommandException(e, helmRegistry.getUrl(), helmRegistry.getName()); } } public List<InstallStatus> install(ProjectVersion<?, ?> projectVersion, boolean wait) throws HelmRegistryException { try { updateReposNotTooOften(); final var sample = Timer.start(); List<WritableConfigurationTemplate> calculatedConfigurationTemplates = projectVersion.getCalculatedConfigurationTemplates(); List<InstallStatus> result = new ArrayList<>(); for (int i = 0; i < calculatedConfigurationTemplates.size(); i++) { WritableConfigurationTemplate template = calculatedConfigurationTemplates.get(i); result.add(helm.install(getReleaseName(projectVersion, i), template.getChartName(), template.getChartVersion(), Values.fromYamlString(template.getContent()), projectVersion.getNamespaceOrElseFromProject(), false, wait)); } sample.stop(installTimer); return result; } catch (CommandException e) { commandErrorCounter.increment(); throw new HelmRegistryException(e.getMessage()); } } public void uninstall(List<String> releaseNames, boolean wait) throws HelmRegistryException { try { uninstallTimer.record(() -> helm.listInAllNamespaces().stream() .filter(release -> releaseNames.contains(release.getName())) .forEach(release -> helm.uninstall(release.getName(), release.getNamespace(), false, wait)) ); } catch (CommandException e) { commandErrorCounter.increment(); throw new HelmRegistryException(e.getMessage()); } } public void uninstall(ProjectVersion<?, ?> projectVersion, boolean wait) throws HelmRegistryException { try { uninstallTimer.record(() -> helm.listInAllNamespaces().stream() .filter(release -> release.getName().startsWith(getReleaseNamePrefix(projectVersion))) .forEach(release -> helm.uninstall(release.getName(), release.getNamespace(), false, wait)) ); } catch (CommandException e) { commandErrorCounter.increment(); throw new HelmRegistryException(e.getMessage()); } } public List<Status> status(ProjectVersion<?, ?> projectVersion) throws HelmRegistryException { try { return statusTimer.record(() -> helm.listInAllNamespaces() .stream() .filter(release -> release.getName().startsWith(getReleaseNamePrefix(projectVersion))) .map(release -> helm.status(release.getName(), release.getNamespace())) .collect(Collectors.toList()) ); } catch (CommandException e) { commandErrorCounter.increment(); throw new HelmRegistryException(e.getMessage()); } } private String getReleaseName(ProjectVersion<?, ?> projectVersion, int templateIndex) { final String fullReleaseName = getReleaseNamePrefix(projectVersion) + "-" + templateIndex + "-" + maxLength(Long.toString(System.currentTimeMillis()), 10); return sanitizeReleaseName(maxLength(fullReleaseName, 53)); } public List<String> getReferencedHelmReleases(ProjectVersion<?, ?> projectVersion) { final String namespace = projectVersion.getNamespaceOrElseFromProject(); final List<Release> list = helm.list(namespace, null); return list.stream() .map(Release::getName) .filter(name -> name.startsWith(getReleaseNamePrefix(projectVersion))) .collect(Collectors.toList()); } @VisibleForTesting protected String getReleaseNamePrefix(ProjectVersion<?, ?> projectVersion) { var projectName = maxLength(projectVersion.getProject().getName(), 10); var versionName = maxLength(projectVersion.getName(), 18); var versionId = maxLength(projectVersion.getId().toString(), 8); return sanitizeReleaseName(String.format("%s-%s-%s", projectName, versionName, versionId)); } private String sanitizeReleaseName(String in) { String candidate = in.toLowerCase(); candidate = candidate.replaceAll("_", "-"); candidate = candidate.replaceAll("[^a-z0-9\\-]", StringUtils.EMPTY);//remove invalid chars (only alphanumeric and dash allowed) candidate = candidate.replaceAll("^[\\-]*", StringUtils.EMPTY);//remove invalid start (remove dot, dash and underscore from start) candidate = candidate.replaceAll("[\\-]*$", StringUtils.EMPTY);//remove invalid end (remove dot, dash and underscore from end) if (StringUtils.isBlank(candidate)) { throw new IllegalArgumentException("can not create a legal namespace name from " + in); } return candidate; } private String maxLength(String in, int length) { return in.substring(0, Math.min(in.length(), length)); } }
[ "noreply@github.com" ]
subshell.noreply@github.com
222286a6205efeb34e4db8643fef36cabb4f496e
dd58f4b622faa2b06fb06c4e69d77b36c926821e
/demo/src/main/java/com/example/demo/WeatherList.java
9b8da409f82dcecd54d85192e4a68f4e5ce7cd01
[]
no_license
mindingding/RecommendCloth
cc042c199290c4fc20c5483a31fd12a8b92922c1
cd25e44aae22491eba132430814384d81d4b0874
refs/heads/master
2020-03-19T12:09:04.048504
2018-06-07T15:54:39
2018-06-07T15:54:39
136,499,095
0
0
null
null
null
null
UTF-8
Java
false
false
435
java
package com.example.demo; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @JsonIgnoreProperties(ignoreUnknown = true) public class WeatherList { public Weather weather; public WeatherList() {} public WeatherList(Weather weather) { this.weather = weather; } public Weather getweather() { return weather; } public void setweather(Weather weather) { this.weather = weather; } }
[ "noreply@github.com" ]
mindingding.noreply@github.com
72a5ae65a6f82906ea6e2b892a981d0f2f72616e
fd725fbe3b1377810a7c48f47a0c4dd845a6c263
/src/main/java/br/com/gustavodias94/swaggerspring/config/WebConfiguration.java
87f8b5b111637bdea481335c489fb64bc71bd05f
[]
no_license
gustavodiasdev/swaggerspring
73347458df190a1255f56c6b20fa225e3ac7732d
1170b519ef6aae42b1d8f2b19a8368bd606d5503
refs/heads/master
2021-07-09T10:57:51.944406
2020-07-09T21:20:47
2020-07-09T21:20:47
131,153,724
0
0
null
null
null
null
UTF-8
Java
false
false
716
java
package br.com.gustavodias94.swaggerspring.config; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; @Configuration public class WebConfiguration extends WebMvcConfigurerAdapter { @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("swagger-ui.html") .addResourceLocations("classpath:/META-INF/resources/"); registry.addResourceHandler("/webjars/**") .addResourceLocations("classpath:/META-INF/resources/webjars/"); } }
[ "sdias.gustavo@gmail.com" ]
sdias.gustavo@gmail.com
f540ba772ecf7d7d33c8b02950073728ed1c406b
6dc029e03ff39ddfea9d73e069510b57570ebee3
/src/com/sgic/dao/BookDao.java
fa312fb6214fb304de4237ef3856aa5141f81173
[]
no_license
MathuraSivarajah/Library-Management-System
6adfd9596dee8b32950d2e80cf49c03fd888a06a
98c39acf9fa0a93444cb2687b06ef74f0899d997
refs/heads/master
2020-04-29T06:43:13.976155
2019-03-16T04:39:22
2019-03-16T04:39:22
175,926,341
0
0
null
null
null
null
UTF-8
Java
false
false
4,692
java
package com.sgic.dao; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import org.eclipse.jdt.internal.compiler.ast.ThrowStatement; import com.sgic.bean.Book; public class BookDao { static String searchValue; public void save(Book book) throws ClassNotFoundException, SQLException { databaseConnection dbConnection = new databaseConnection(); Connection con = dbConnection.getConnection(); PreparedStatement stmt = con.prepareStatement("insert into bookinfo values(?,?,?,?,?)"); stmt.setString(1, book.getBookId()); stmt.setString(2, book.getTitle()); stmt.setString(3, book.getAuthor()); stmt.setString(4, book.getMainclassification()); stmt.setString(5, book.getSubclassification()); stmt.executeUpdate(); } public static List<Book> getAllRecords() throws ClassNotFoundException, SQLException { List<Book> list = new ArrayList<Book>(); databaseConnection dbConnection = new databaseConnection(); try { Connection con = dbConnection.getConnection(); PreparedStatement ps = con.prepareStatement("select * from bookinfo"); ResultSet rs = ps.executeQuery(); while (rs.next()) { Book book = new Book(); book.setBookId(rs.getString("bookId")); book.setTitle(rs.getString("title")); book.setAuthor(rs.getString("author")); book.setMainclassification(rs.getString("mainclassification")); book.setSubclassification(rs.getString("subclassification")); list.add(book); } } catch (Exception e) { System.out.println(e); } return list; } public String getSearchValue(String value) { searchValue = value; return searchValue; } public static List<Book> searchBook() throws ClassNotFoundException, SQLException{ List<Book> list = new ArrayList<Book>(); String s = "'"; databaseConnection dbConnection = new databaseConnection(); try { Connection con = dbConnection.getConnection(); PreparedStatement ps = con.prepareStatement("select * from bookinfo where bookId like '%"+searchValue+"%'" + " or title like '%"+searchValue+"%'" + " or author like '%"+searchValue+"%'" + " or mainclassification like '%"+searchValue+"%'" + " or subclassification like '%"+searchValue+"%'"); //System.out.println(ps); ResultSet rs = ps.executeQuery(); while(rs.next()) { Book book = new Book(); book.setBookId(rs.getString("bookId")); book.setTitle(rs.getString("title")); book.setAuthor(rs.getString("author")); book.setMainclassification(rs.getString("mainclassification")); book.setSubclassification(rs.getString("subclassification")); list.add(book); } } catch(Exception e) { System.out.println(e); } return list; } public void delete(String id) { // int status = 0; databaseConnection dbConnection = new databaseConnection(); String s = "'"; try { Connection con = dbConnection.getConnection(); PreparedStatement ps = con.prepareStatement("delete from bookinfo where bookId=" + s + id + s); //ps.setString(1, book.getBookId()); ps.executeUpdate(); } catch (Exception e) { System.out.println(e); } // return status; } public void update(Book book) { databaseConnection dbConnection = new databaseConnection(); // int status = 0; try { Connection con = dbConnection.getConnection(); PreparedStatement ps = con.prepareStatement( "update bookinfo set bookId=?,title=?,author=?,mainclassification=?,subclassification=? where bookId=?"); ps.setString(1, book.getBookId()); ps.setString(2, book.getTitle()); ps.setString(3, book.getAuthor()); ps.setString(4, book.getMainclassification()); ps.setString(5, book.getSubclassification()); ps.setString(6, book.getBookId()); ps.executeUpdate(); } catch (Exception e) { System.out.println(e); } // return status; } public static Book getRecordById(String id) { databaseConnection dbConnection = new databaseConnection(); Book book = null; try { Connection con = dbConnection.getConnection(); PreparedStatement ps = con.prepareStatement("select * from bookinfo where bookId=?"); // ps.setInt(1,id); ps.setString(1, id); ResultSet rs = ps.executeQuery(); while (rs.next()) { book = new Book(); book.setBookId(rs.getString("bookId")); book.setTitle(rs.getString("title")); book.setAuthor(rs.getString("author")); book.setMainclassification(rs.getString("mainclassification")); book.setSubclassification(rs.getString("subclassification")); } } catch (Exception e) { System.out.println(e); } return book; } }
[ "smadhura94@gmail.com" ]
smadhura94@gmail.com
634cc586107520c91d1bc5a6d1b0e5de13d6c594
ea186e4bf5864186897e2f958d103a44269af294
/dominatorarena/src/main/java/com/biel/dominatorarena/Config.java
0042c671780a089c442e84050ff5f84a01acbedb
[]
no_license
biels/dominatorarena
77d989643f5e0a1c7d4c8f137c5d20398f5a7e9a
e73c94b39abe43f6957e0e1da10e7d5295b5e2db
refs/heads/master
2021-01-20T01:04:49.046377
2017-06-02T14:59:22
2017-06-02T14:59:22
75,611,814
0
0
null
null
null
null
UTF-8
Java
false
false
369
java
package com.biel.dominatorarena; import java.io.File; /** * Created by Biel on 1/12/2016. */ public class Config { public final static String FILES = "files"; public final static String VERSION_DIR = FILES + "/versions"; public final static String INPUT_DIR = FILES + "/input"; public final static String INPUT_FIRST_DIR = FILES + "/input_first"; }
[ "bielsimon2@gmail.com" ]
bielsimon2@gmail.com
9417a9f5f3a8d9b6f08fbec1accfe769bb108ed1
e7b2885a98a7956d8d8ff4649f3ebd8a312c1790
/spring-aop/src/main/java/com/wyl/cglib/DaoFilter.java
2dfbe8e90cdc573f5c2d55b26700fbd5ac9caa52
[]
no_license
wangyulin/study
b918476329b38235620b009187f61e5c987ee330
20b57d0399c2f5406bf5c3f183681e80f6b4e346
refs/heads/master
2020-06-30T19:25:24.036645
2018-11-06T00:15:03
2018-11-06T00:15:03
66,319,561
0
0
null
2016-09-05T05:09:27
2016-08-23T00:56:36
Java
UTF-8
Java
false
false
360
java
package com.wyl.cglib; import net.sf.cglib.proxy.CallbackFilter; import java.lang.reflect.Method; /** * Created by wangyulin on 12/02/2018. */ public class DaoFilter implements CallbackFilter { @Override public int accept(Method method) { if ("select".equals(method.getName())) { return 0; } return 1; } }
[ "jieyebing@gmail.com" ]
jieyebing@gmail.com
e3ba88cb03027773e4a0cfcdacd7cb744b15b914
19f9bc0b2971717571f68f628182db194a86c3a1
/src/main/java/ru/valerykorzh/springdemo/controller/validator/AccountPostDtoValidator.java
845394cd4a10b14036a1bbf90ba6177603793125
[]
no_license
ValeryKorzhavin/stackoverflow
8a3f3cdf175adb6bd042f5f3aadb62c01344eb66
17b624fa48248f8da25c23c319f4a1308f183fcc
refs/heads/master
2022-05-09T10:29:44.203360
2020-02-24T19:36:06
2020-02-24T19:36:06
228,776,866
11
4
null
2022-03-08T21:17:41
2019-12-18T06:50:30
Java
UTF-8
Java
false
false
775
java
package ru.valerykorzh.springdemo.controller.validator; import org.springframework.stereotype.Component; import org.springframework.validation.Errors; import org.springframework.validation.Validator; import ru.valerykorzh.springdemo.dto.AccountPostDto; @Component public class AccountPostDtoValidator implements Validator { @Override public boolean supports(Class<?> aClass) { return AccountPostDto.class.equals(aClass); } @Override public void validate(Object o, Errors errors) { AccountPostDto accountPostDto = (AccountPostDto) o; if (!accountPostDto.getPasswordConfirm().equals(accountPostDto.getPassword())) { errors.rejectValue("passwordConfirm", "error.validation.password.confirmation"); } } }
[ "white.and.bushy@gmail.com" ]
white.and.bushy@gmail.com
e3653481c22df5b38c6a9c9acbf7db461c098ebd
c761e74884a0f8e733a8d7c3af00dce0f4d76a92
/src/main/java/com/samir/sms/controller/services/administrativeStaff/AdministrativeStaffService.java
d8c67a8ff089deb007c58b8f5ef6b39e3aa287a2
[]
no_license
samirguemri/school-management-software
f794f9eaab0425c7402b49a55d41dd34007a3622
016b080fefdb919cbbebd071202350468582b4f8
refs/heads/master
2022-12-17T05:46:55.948544
2020-09-16T13:59:13
2020-09-16T13:59:13
294,060,019
0
0
null
null
null
null
UTF-8
Java
false
false
1,700
java
package com.samir.sms.controller.services.administrativeStaff; import com.samir.sms.controller.data.dao.administrativeStaff.IAdministrativeStaffDAO; import com.samir.sms.model.person.AdministrativeStaff; import com.samir.sms.model.object.LocalUniqueId; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Service; @Service("AdministrativeStaffService") public class AdministrativeStaffService { private final IAdministrativeStaffDAO administrativeStaffDAO; @Autowired public AdministrativeStaffService(@Qualifier("PgsqlAdministrativeStaffDAO") IAdministrativeStaffDAO administrativeStaffDAO) { this.administrativeStaffDAO = administrativeStaffDAO; } public void addNewAdministrativeStaff(AdministrativeStaff administrativeStaff) { administrativeStaffDAO.insertNewAdministrativeStaff(administrativeStaff); } public AdministrativeStaff getAdministrativeStaffById(LocalUniqueId administrativeStaffId) { return administrativeStaffDAO.selectAdministrativeStaffById(administrativeStaffId); } public AdministrativeStaff updateAdministrativeStaffById(LocalUniqueId administrativeStaffId) { return administrativeStaffDAO.updateAdministrativeStaffById(administrativeStaffId); } public boolean deleteAdministrativeStaffById(LocalUniqueId administrativeStaffIdD) { return administrativeStaffDAO.deleteAdministrativeStaffById(administrativeStaffIdD); } public boolean connect(String login, String password) { return true; } public boolean disconnect() { return true; } }
[ "samir.guemri@gmx.fr" ]
samir.guemri@gmx.fr
b3971e4adbc40fc7418ed54bee7259e6c5d0892d
54d2cc766ccbfe5072dd557985530e70a6e3e026
/app/src/main/java/com/nicklin/easyandroid_payutil/MainActivity.java
51991a1c6b47d8e32ba61aede322b403bb51db07
[]
no_license
nicklin99/easyandroid_payutil
9587530416465d5c2d58c182eab8f34a352acdf5
6c32c6777723d00493f891b6e6aafb72b4576061
refs/heads/master
2021-09-09T17:21:28.178482
2018-03-18T12:45:30
2018-03-18T12:45:30
125,650,757
1
1
null
null
null
null
UTF-8
Java
false
false
960
java
package com.nicklin.easyandroid_payutil; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import com.nicklin.easyandroid_payutil.pay.PayResult; import com.nicklin.easyandroid_payutil.pay.PayUtil; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } /** * alipay 支付宝支付 * wx 微信支付 * * onFinish都会回调 * onSuccess仅支付成功回调 */ private void pay(){ String orderInfo = ""; String type = "alipay"; PayUtil.pay(this, type, orderInfo, new PayUtil.PayCallback() { @Override public void onFinish(PayResult payResult) { } @Override public void onSuccess(PayResult payResult) { } }); } }
[ "authen@qq.com" ]
authen@qq.com
2cf4e94d45eea60cbce93e42a5b39f4bce717f3c
2be11c2a859ff4da843b7e219038dea027a79ed9
/src/main/java/me/ygy/jjvm/instructions/stack/Dup2.java
2acbfbe794e8f9aef0236a5d839417fed743a199
[]
no_license
ab409/jjvm
e0bec5cdb942c2d14b708fc6fb05d78feaf6e6c9
3da8d7f3ce428531bda77e2008ebff306b3fb947
refs/heads/master
2020-05-30T14:45:30.660520
2017-11-07T12:39:40
2017-11-07T12:39:40
69,659,210
9
2
null
null
null
null
UTF-8
Java
false
false
847
java
package me.ygy.jjvm.instructions.stack; import me.ygy.jjvm.instructions.base.NoOperandsInstruction; import me.ygy.jjvm.rtda.Frame; import me.ygy.jjvm.rtda.LocalVars; import me.ygy.jjvm.rtda.OperandStack; /** * Created by guangyuanyu on 2016/10/14. */ public class Dup2 extends NoOperandsInstruction { @Override public void execute(Frame frame) { OperandStack stack = frame.getOperandStack(); LocalVars.Slot v1 = stack.popSlot(); LocalVars.Slot v2 = stack.popSlot(); LocalVars.Slot v1Dup = new LocalVars.Slot(); LocalVars.Slot v2Dup = new LocalVars.Slot(); v1Dup.num = v1.num; v1Dup.ref = v1.ref; v2Dup.num = v2.num; v2Dup.ref = v2.ref; stack.pushSlot(v2); stack.pushSlot(v1); stack.pushSlot(v2Dup); stack.pushSlot(v1Dup); } }
[ "guangyuanyu@sohu-inc.com" ]
guangyuanyu@sohu-inc.com
6788e23637c17f21148b60e52b90cd2b56f4a54c
6b7b1dec396b1929257732ae2f5ab9d9d99ec18b
/WebGamesBridge/app/src/main/java/com/felkertech/n/myapplication/ACHIEVEMENTS.java
eb06624b03e2b766e67ec3ce33a836adad1fbc4b
[]
no_license
Fleker/WebGameBridge.js
e5906b23713f74236f1f9bec9e815172295916d0
efbd6e016f1fada17e129798841d50e4b1c8d986
refs/heads/master
2021-06-24T22:19:09.315078
2016-10-12T04:26:18
2016-10-12T04:26:18
28,768,007
3
2
null
null
null
null
UTF-8
Java
false
false
894
java
package com.felkertech.n.myapplication; import com.google.android.gms.games.achievement.Achievement; /** * Created by N on 2/14/2015. */ public abstract class ACHIEVEMENTS { public static int STANDARD = Achievement.TYPE_STANDARD; public static int INCREMENTAL = Achievement.TYPE_INCREMENTAL; public static int HIDDEN = Achievement.STATE_HIDDEN; public static int REVEALED = Achievement.STATE_REVEALED; public static int UNLOCKED = Achievement.STATE_UNLOCKED; public static int TYPE_TO_INT(String t) { if(t.equals("STANDARD")) return STANDARD; else return INCREMENTAL; } public static int STATE_TO_INT(String s) { if(s.equals("HIDDEN")) return HIDDEN; else if(s.equals("REVEALED")) return REVEALED; else return UNLOCKED; } }
[ "handnf@gmail.com" ]
handnf@gmail.com
8cfed51db32fb293594010348d3c5ccea5969422
8e6393c5005bc93cc1a6ff584ea41957f7a76886
/service-user-center/src/main/java/tech/techstack/service/user/center/controller/HelloController.java
f683a6380ecb078c179b0f4631f294d98af46ebc
[]
no_license
Jagali/spring-cloud-demo
a0540f41fa6679cd2b80c6c01e85093ca5100412
7e867d7d0d721c04a6f93c5d25c1865e04edcce2
refs/heads/master
2020-12-12T22:34:23.393476
2020-01-15T10:14:57
2020-01-15T10:14:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
525
java
package tech.techstack.service.user.center.controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; /** * @author chenjianyuan * @date 2020/1/14 20:59 */ @RestController public class HelloController { @GetMapping("/hello") public String hello(@RequestParam(required = false, defaultValue = "MR.C") String name) { return "[service-user-center] -> " + name; } }
[ "1752133445@qq.com" ]
1752133445@qq.com
6546e2b0dbed16261d5811494326cd771bf51576
475323026c94644a6170483722623d850cb8b022
/core-service/src/main/java/com/example/sample/coreservice/UserEntity.java
84729f50f504e9221375ab864796c70cf6610ab3
[]
no_license
dilwarmandal/Microservices
e8aac53c21740dd85b65a244f19321cd1cb19eb2
ce5d689be8b1c4feabb96c677cd88ce139ba709e
refs/heads/master
2020-09-09T14:56:25.293782
2019-11-12T10:56:35
2019-11-12T10:56:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,589
java
package com.example.sample.coreservice; import javax.persistence.*; import javax.validation.constraints.Email; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import java.io.Serializable; @Entity @Table(name="user") public class UserEntity implements Serializable { @Id @GeneratedValue Long Id; @Column(nullable = false,length = 50) private String firstName; @Column(nullable = false,length = 50) private String lastName; @Column(nullable = false,length = 120,unique = true) private String emailId; @Column(nullable = false) private String password; @Column(nullable = false,unique = true ) private String userId; public Long getId() { return Id; } public void setId(Long id) { Id = id; } 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 getEmailId() { return emailId; } public void setEmailId(String emailId) { this.emailId = emailId; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } }
[ "MB99EMd@ad.ing.net" ]
MB99EMd@ad.ing.net
973ec12057623c67ff5881b19eca4e5691e284c0
90a738eac57a06e6ddf1e85f32f021876fdd0516
/src/main/java/de/micha/dijkstra/view/NearPointView.java
d0695c74897e8bea3956a6b2991785a54a146f54
[]
no_license
mherttrich/dijkstra-java8
4814471b27be2c39bf1e672d2313464246a4d16b
44a0d267baacd000765f3d509bf4e1fcdea32e8f
refs/heads/master
2020-02-26T13:56:30.144369
2016-09-27T15:49:21
2016-09-27T15:49:21
65,321,845
1
0
null
null
null
null
UTF-8
Java
false
false
465
java
package de.micha.dijkstra.view; /** * Created by micha on 07.08.16. * Viewclass to encapsulate a result of a near neighbour search */ public class NearPointView { private final String nodeName; private final int distance; public NearPointView(String nodeName, int distance) { this.nodeName = nodeName; this.distance = distance; } @Override public String toString() { return nodeName + ": " + distance; } }
[ "m.herttrich@web.de" ]
m.herttrich@web.de
06c92414bc0ce72adc80da6e278812f7437d4138
995b9355776e6f41919f17d8ec0f96b7293181ab
/agency-server/src/main/java/com/al/agency/configs/AWSS3Config.java
61434798955571fa073580c48ac6300b127a15c8
[]
no_license
iGunya/agency
b27b5271de5ce88169eca6e8533d03078d3179a2
f697effd2cc78aaa9c5ae9c4863febe0d898d126
refs/heads/master
2023-08-21T13:08:09.453414
2021-10-02T06:13:44
2021-10-02T06:13:44
384,025,768
0
0
null
null
null
null
UTF-8
Java
false
false
1,264
java
package com.al.agency.configs; import com.amazonaws.auth.AWSStaticCredentialsProvider; import com.amazonaws.auth.BasicAWSCredentials; import com.amazonaws.regions.Regions; import com.amazonaws.services.s3.AmazonS3; import com.amazonaws.services.s3.AmazonS3ClientBuilder; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class AWSS3Config { @Value("${aws.access_key_id}") private String accessKeyId; @Value("${aws.secret_access_key}") private String secretAccessKey; @Value("${aws.s3.region}") private String region; @Bean public AmazonS3 getAmazonS3Client() { final BasicAWSCredentials basicAWSCredentials = new BasicAWSCredentials(accessKeyId, secretAccessKey); return AmazonS3ClientBuilder .standard() .withEndpointConfiguration( new AmazonS3ClientBuilder.EndpointConfiguration( "storage.yandexcloud.net",region ) ) .withCredentials(new AWSStaticCredentialsProvider(basicAWSCredentials)) .build(); } }
[ "al.cuznecz2000@yandex.ru" ]
al.cuznecz2000@yandex.ru
f9a91e73e744b570d762337f0d26d3467ae42885
da8fac5eaf6c40e593768fff9ab9f9a9567a2808
/tlatools/org.lamport.tlatools/test/pcal/ULEuclidTest.java
f6a144210ca0a39eda9a94c95a9edacadfc4d569
[ "MIT" ]
permissive
tlaplus/tlaplus
dd02971ea1fface9a4e6642d0b433291ad462db4
baf6f1b4000ba72cd4ac2704d07c60ea2ae8343b
refs/heads/master
2023-09-03T17:39:23.238115
2023-08-28T00:28:30
2023-08-28T02:46:40
50,906,927
2,214
203
MIT
2023-09-05T21:38:47
2016-02-02T08:48:27
Java
UTF-8
Java
false
false
2,218
java
/******************************************************************************* * Copyright (c) 2018 Microsoft Research. All rights reserved. * * The MIT License (MIT) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies * of the Software, and to permit persons to whom the Software is furnished to do * so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Contributors: * Markus Alexander Kuppe - initial API and implementation ******************************************************************************/ package pcal; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import org.junit.Test; import tlc2.output.EC; public class ULEuclidTest extends PCalModelCheckerTestCase { public ULEuclidTest() { super("ULEuclid", "pcal", new String[] {"-wf", "-termination"}); } @Test public void testSpec() { assertTrue(recorder.recordedWithStringValue(EC.TLC_INIT_GENERATED1, "400")); assertTrue(recorder.recordedWithStringValues(EC.TLC_CHECKING_TEMPORAL_PROPS, "complete", "6352")); assertTrue(recorder.recorded(EC.TLC_FINISHED)); assertFalse(recorder.recorded(EC.GENERAL)); assertTrue(recorder.recordedWithStringValues(EC.TLC_STATS, "6752", "6352", "0")); assertTrue(recorder.recordedWithStringValue(EC.TLC_SEARCH_DEPTH, "42")); assertZeroUncovered(); } }
[ "tlaplus.net@lemmster.de" ]
tlaplus.net@lemmster.de
64af681309adf642e6af5b0878782608151b309c
580ee6b53d278aaf3a3e8003539e22a41efbe513
/JAVA/First/src/chapter4/DowhileEx1.java
3175aef87c90aaf6fb53cf6ebc52a9b932ef43d8
[]
no_license
KMG-code/study-note
f4f15b161bb0c22ed9a76900bf3ac2e6e5582698
f7118a32b9709ef2ae211e562c73b3cb8dd7165a
refs/heads/master
2023-01-11T09:36:24.583474
2020-11-12T14:47:03
2020-11-12T14:47:03
309,089,307
0
0
null
null
null
null
UHC
Java
false
false
291
java
package chapter4; public class DowhileEx1 { public static void main(String[] args) { // TODO Auto-generated method stub int sum = 0; int num = 1; do { sum=sum+num; num=num+1; }while(num<=10); System.out.println("1부터 10까지의 합은"+sum+"입니다"); } }
[ "snow9069@naver.com" ]
snow9069@naver.com
e28d3aad9a9820a2ec7a01657140337a30aa1286
4f4de80810ec012d9cd45784a6668c220a23cc31
/src/halma/minimax/features/DontBlockFriendFeature.java
cd5b4c0328e4accfc7856f1cf70719914eef895f
[]
no_license
jokeofweek/comp424
f1b2218c64dcac44aa15dbe6bf499d0c53491b26
68c75d6da68a8e88bdc480547bbb0b180727b1fc
refs/heads/master
2021-01-22T23:53:13.417726
2014-04-10T05:38:00
2014-04-10T05:38:00
17,028,136
2
2
null
null
null
null
UTF-8
Java
false
false
1,759
java
package halma.minimax.features; import halma.CCBoard; import java.awt.Point; public class DontBlockFriendFeature extends Feature { private static Point[] DEFAULT_FRIEND_PIECE = {new Point(0, 0)}; private static Point[] DEFAULT_TRAP_PIECES = { new Point(1, 1), new Point(0, 1), new Point(1, 0), new Point(2, 0), new Point(0, 2), new Point(2, 2) }; private static Point[][] FRIEND_PIECE = new Point[4][DEFAULT_FRIEND_PIECE.length]; private static Point[][] TRAP_PIECES = new Point[4][DEFAULT_TRAP_PIECES.length]; { for (int i = 0; i < DEFAULT_FRIEND_PIECE.length; i++) { Point piece = DEFAULT_FRIEND_PIECE[i]; FRIEND_PIECE[0][i] = new Point(15 - piece.x, 15 - piece.y); FRIEND_PIECE[1][i] = new Point(piece.x, 15 - piece.y); FRIEND_PIECE[2][i] = new Point(15 - piece.x, piece.y); FRIEND_PIECE[3][i] = new Point(piece.x, piece.y); } for (int i = 0; i < DEFAULT_TRAP_PIECES.length; i++) { Point piece = DEFAULT_TRAP_PIECES[i]; TRAP_PIECES[0][i] = new Point(15 - piece.x, 15 - piece.y); TRAP_PIECES[1][i] = new Point(piece.x, 15 - piece.y); TRAP_PIECES[2][i] = new Point(15 - piece.x, piece.y); TRAP_PIECES[3][i] = new Point(piece.x, piece.y); } } @Override public double getScore(CCBoard board, CCBoard original, int playerID) { // If we trapped our friend, return -500 since we're basically going to lose. for (Point p : FRIEND_PIECE[playerID]) { if (board.getPieceAt(p) == null || board.getPieceAt(p) != (playerID ^ 3)) return 0; } for (Point p : TRAP_PIECES[playerID]) { if (board.getPieceAt(p) == null || board.getPieceAt(p) != playerID) return 0; } return -500; } @Override public double getWeight(CCBoard board, CCBoard original, int playerID) { return 1; } }
[ "dominiccharleyroy@gmail.com" ]
dominiccharleyroy@gmail.com
10abc35f0059bec25a3f103672ff111e72181269
a3270bab31b032641ccbdb28b4d586d06c3e820f
/SamplePracticeProject/src/main/java/com/bit/shared/test/Header.java
2f45ba913a977b6b82083d4d7d6933483ac35db4
[]
no_license
bittechusa/Couple
062a4d0d2f10a5f6e14bdfccffb00f40cca0f2a7
77efbf962db9d165c15d5f567397f973fb17574c
refs/heads/master
2016-08-11T20:55:39.141497
2016-01-16T22:55:19
2016-01-16T22:55:19
48,623,348
0
0
null
null
null
null
UTF-8
Java
false
false
55
java
package com.bit.shared.test; public class Header { }
[ "you@example.com" ]
you@example.com
194474922d1ff2c2fbe54dc00e01c0dd2b24e9d1
5e45ccf76f8e1f61a35916e2ec7f126a4aeea1b4
/Battle/src/Army/Villager.java
ee8b97bb82e0b8699269bbe2097970e15db9f2ee
[]
no_license
zbytspokojna/VikingSimulator
7aeb2846d8dc6df36d3641336c8d1771c824704f
3f15fa53b53d105e46907647b29352aeaa9a1f2f
refs/heads/master
2021-05-01T20:21:09.367925
2017-01-23T22:59:51
2017-01-23T22:59:51
79,175,615
0
0
null
null
null
null
UTF-8
Java
false
false
24,050
java
package Army; import Armament.Shield; import Armament.Weapon; import Map.Building; import Map.Terrain; import Map.Village; import Schemes.Colors; import Schemes.Directions; import Schemes.States; import Schemes.Weapons; import java.awt.*; import java.util.ArrayList; import java.util.Random; import static Colision.Direction.direction; import static Colision.Direction.vector; import static Colision.Distance.distanceC; import static Colision.Moving.*; import static Colision.Moving.moveUpLeft; import static java.lang.Math.*; import static java.lang.Math.sin; public class Villager { // Stats for battle private int health; private int moral; private int moralThreshold; private int defense; private int accuracy; private int dodge; private int loot; private int state; private boolean inForest; private int targeted; private boolean leader; // Stats for locations and targets private Point speed; private Point currentLocation; private Point previousLocation; private Building targetBuilding; private Viking targetEnemy; private Point currentTarget; private int vector; private int direction; // Stats for armament private Weapon primeWeapon; private Shield shield; private int shieldDirection; // Drawing private int size; private Color color; // Map information private Terrain map; private Village village; // Other agents private ArrayList<SquadVillagers> allies; private ArrayList<SquadVikings> enemies; public Villager(Point location, Terrain map, Village village, Building targetBuilding, Color color, int size, ArrayList<SquadVillagers> allies){ Random r = new Random(); // Stats for battle if (color == Colors.VILLAGER_LEADER) leader = true; if (!leader) { this.health = 100; this.moralThreshold = r.nextInt(11) + 25; this.defense = r.nextInt(3) + 1; this.accuracy = r.nextInt(31) + 30; this.dodge = r.nextInt(21) + 10; } else { this.health = 200; this.moralThreshold = r.nextInt(6) + 5; this.defense = r.nextInt(3) + 2; this.accuracy = r.nextInt(31) + 40; this.dodge = r.nextInt(21) + 20; } this.moral = 100; this.loot = 0; this.state = 1; this.inForest = false; this.targeted = 0; // Stats for locations and targets this.speed = new Point(1,1); this.currentLocation = new Point(location); this.previousLocation = new Point(location); this.targetBuilding = targetBuilding; this.targetEnemy = null; // Stats for armament this.primeWeapon = Weapons.ARSENAL[r.nextInt(Weapons.ARSENAL.length)]; if ( r.nextInt(101) > 50 ) this.shield = new Shield(); else this.shield = null; this.shieldDirection = - (r.nextInt(61) + 30); // Drawing this.size = size; this.color = color; // Map information this.map = map; this.village = village; // Other agents this.allies = allies; currentTarget = targetBuilding.getLocation(); vector = vector(currentLocation, currentTarget); direction = direction(vector); } // Setters public void setEnemies(ArrayList<SquadVikings> enemies) { this.enemies = enemies; } public void setTargetBuilding(Building targetBuilding) { this.targetBuilding = targetBuilding; } // Changing states public void setWin() { if (state != States.DEAD) state = States.WIN; moral = 100; } public void setLoss() { if (state != States.DEAD) state = States.LOSS; moral = 100; } public void setReAttack() { if (state != States.DEAD) { state = States.FIGHT; moral = 100; } } public void setFighting() { if (state != States.DEAD && state != States.LOSS && state != States.WIN && state != States.RETREAT) state = States.FIGHT; } // Changing targeted and moral public void setTargeted() { targeted ++; } public void unsetTargeted() { targeted--; } public void increaseMoral(double increase) { moral += increase; if (moral > 100) moral = 100; } public void decreaseMoral(double decrease) { moral -= decrease; if (moral < 0) moral= 0; } // Getters public Point getCurrentLocation() { return currentLocation; } public int getState() { return state; } public int getHealth() { return health; } public int getLoot() { return loot; } public int getTargeted() { return targeted; } public int getDodge() { return dodge; } public boolean getInForest() { return inForest; } // OTHER FUNTIONS // Moral public void updateMoral() { int ally = 0, enemy = 0, difference; // count allies in area if (!inForest) { for (SquadVillagers i : allies) for (Villager j : i.getVillagers()) if (j != this) if (distanceC(currentLocation.x, j.getCurrentLocation().x, currentLocation.y, j.getCurrentLocation().y) < 25 && j.getHealth() > 0) ally++; // count enemies in ares for (SquadVikings i : enemies) for (Viking j : i.getVikings()) if (distanceC(currentLocation.x, j.getCurrentLocation().x, currentLocation.y, j.getCurrentLocation().y) < 25 && j.getHealth() > 0) enemy++; // update moral difference = enemy - ally; if (difference > 0) decreaseMoral((difference * difference) / 2); else increaseMoral((difference * difference) / 5); if (state == States.RETREAT) increaseMoral(0.01); if (health < 10 && (state != States.WIN || state != States.LOSS)) moral = moralThreshold + 5; } } private boolean moralCheck(){ updateMoral(); return moral > moralThreshold; } // State public void estimateState() { // No matter what state check if not dead or retreated inForest = map.getTerrainGrid()[currentLocation.x][currentLocation.y] == Colors.FOREST; if (health == 0) { state = States.DEAD; return; } if (!moralCheck()) { state = States.RETREAT; return; } switch (state){ case States.WIN: break; case States.LOSS: break; case States.DEAD: break; case States.RETREAT: if (moralCheck()) state = States.FIGHT; break; case States.FIGHT: if (!moralCheck()) state = States.RETREAT; break; case States.IDLE: if (targetEnemy != null ) state = States.FIGHT; } } // Updating currentTarget based on state private void updateCurrentTarget(){ switch (state){ case States.DEAD: currentTarget = currentLocation; break; case States.FIGHT: if (targetEnemy != null) currentTarget = targetEnemy.getCurrentLocation(); else currentTarget = targetBuilding.getLocation(); break; case States.RETREAT: currentTarget = new Point(20,20); break; case States.LOSS: currentTarget = new Point(20,20); break; case States.WIN: currentTarget = village.getCenter(); break; case States.IDLE: currentTarget = targetBuilding.getLocation(); } } public void findTargetEnemy(int radius) { boolean found = false; // In fight search for the best target if (state == States.FIGHT && targetEnemy != null && targetEnemy.getState() != States.DEAD){ double min = distanceFromTargetEnemy(); Viking newTarget = targetEnemy; for (SquadVikings i : enemies) for (Viking j : i.getVikings()) if (j.getState() != States.DEAD) { double distance = distanceC(j.getCurrentLocation().x, currentLocation.x, j.getCurrentLocation().y, currentLocation.y); if (distance < min && j.getTargeted() < 2 && !j.getInBoat()) { min = distance; newTarget = j; } } targetEnemy.unsetTargeted(); newTarget.setTargeted(); targetEnemy = newTarget; return; } // If fighting or idling find target if ((state == States.FIGHT || state == States.IDLE) && (targetEnemy == null || targetEnemy.getHealth() == 0)) { if (targetEnemy != null && (targetEnemy.getState() == States.DEAD || targetEnemy.getState() == States.RETREAT || targetEnemy.getState() == States.LOSS)) { targetEnemy.unsetTargeted(); targetEnemy = null; } double building = sqrt((targetBuilding.getWidth()*targetBuilding.getWidth()) + targetBuilding.getHeight()*targetBuilding.getHeight()); for (SquadVikings i : enemies) { for (Viking j : i.getVikings()) { if (j.getHealth() > 0) if (distanceC(targetBuilding.getLocation().x, j.getCurrentLocation().x, targetBuilding.getLocation().y, j.getCurrentLocation().y) < building*radius) if (j.getTargeted() < 3 && (j.getState() != States.RETREAT || j.getState() != States.LOSS)) { targetEnemy = j; j.setTargeted(); state = States.FIGHT; found = true; } if (found) return; } if (found) return; } return; } // If not figthing loose target if (state != States.FIGHT && state != States.IDLE && targetEnemy != null){ targetEnemy.unsetTargeted(); targetEnemy = null; } } // Distance from targets private double distanceFromTargetBuilding(){ return distanceC(currentLocation.x, targetBuilding.getLocation().x, currentLocation.y, targetBuilding.getLocation().y); } private double distanceFromTargetEnemy() { return distanceC(currentLocation.x, targetEnemy.getCurrentLocation().x, currentLocation.y, targetEnemy.getCurrentLocation().y); } public void action() { // update target findTargetEnemy(2); updateCurrentTarget(); // update vectors vector = vector(currentLocation, currentTarget); direction = direction(vector); double radius = sqrt((targetBuilding.getWidth()*targetBuilding.getWidth()) + targetBuilding.getHeight()*targetBuilding.getHeight()); // if dead if (state == States.DEAD){ if (loot != 0) dropLoot(); return; } // if fighting // TODO: 20.01.17 implement behaviour for bow if (state == States.FIGHT){ if (targetEnemy == null){ if (distanceFromTargetBuilding() > radius) move(); else state = States.IDLE; return; } else if (distanceFromTargetEnemy() <= size + primeWeapon.getRange()) { attack(); return; } else if (distanceFromTargetBuilding() > radius*4.2){ targetEnemy.unsetTargeted(); targetEnemy = null; currentTarget = targetBuilding.getLocation(); move(); return; } else { move(); return; } } // If going to the forest if (state == States.RETREAT){ if (currentLocation.x == currentTarget.x && currentLocation.y == currentTarget.y) return; else { move(); return; } } // If battle is done if (state == States.WIN || state == States.LOSS){ if (currentLocation.x == currentTarget.x && currentLocation.y == currentTarget.y) return; else { move(); return; } } if (state == States.IDLE){ findTargetEnemy(5); updateCurrentTarget(); if (targetBuilding.getLoot() == 0) changeTargetBuilding(); } } private void changeTargetBuilding() { for (Building building : village.getBuildings()){ if (building != targetBuilding && building.getLoot() > 0 ){ targetBuilding = building; state = States.FIGHT; } } } private void dropLoot() { loot = 0; } private void attack() { Random r = new Random(); if (r.nextInt(101) <= accuracy + primeWeapon.getAccuracy()){ if (r.nextInt(101) > targetEnemy.getDodge() ) { int damage = r.nextInt(5) + 1; targetEnemy.damage(damage + primeWeapon.getDamage(), primeWeapon.getPenetration()); // if got a hit increaseMoral(damage/30); for (SquadVillagers squadVillagers : allies) for (Villager villager : squadVillagers.getVillagers()) if (villager != this) if (distanceC(currentLocation.x, villager.getCurrentLocation().x, currentLocation.y, villager.getCurrentLocation().y) <= 20) villager.increaseMoral(0.01); } } // If he missed else moral -= 0.03; } // TODO: 20.01.17 make people around loss moral public void damage(int damage, int penetration) { int def = defense; if (shield != null ) def += shield.getDefense(); def = defense - penetration; if (def < 0) def = 0; if (def >= damage) return; health -= (damage - def); if (health < 0) health = 0; decreaseMoral((damage-def)/30); if (leader) color = new Color(color.getRed(), color.getGreen() + (damage-def)/2, color.getBlue() + (damage-def)/2); else color = new Color(color.getRed(), color.getGreen() + (damage-def)*2 , color.getBlue() + (damage-def)*2); } // MOVING TEMP!!! public void move() { if (direction == Directions.UP) Up(); if (direction == Directions.UPRIGHT) UpRight(); if (direction == Directions.RIGHT) Right(); if (direction == Directions.DOWNRIGHT) DownRight(); if (direction == Directions.DOWN) Down(); if (direction == Directions.DOWNLEFT) DownLeft(); if (direction == Directions.LEFT) Left(); if (direction == Directions.UPLEFT) UpLeft(); } private boolean checkV(){ for (SquadVikings squadVikings : enemies) for (Viking viking : squadVikings.getVikings()) if (distanceC(currentLocation.x, viking.getCurrentLocation().x, currentLocation.y, viking.getCurrentLocation().y) < size && viking.getState() != States.DEAD) return false; for (SquadVillagers squadVillagers : allies) for (Villager villager : squadVillagers.getVillagers()) if (villager != this) if (distanceC(currentLocation.x, villager.getCurrentLocation().x, currentLocation.y, villager.getCurrentLocation().y) < size && villager.getState() != States.DEAD) return false; return true; } private boolean checkB(){ double radius = sqrt((targetBuilding.getWidth() * targetBuilding.getWidth()) + targetBuilding.getHeight() * targetBuilding.getHeight())/2; for (Building i : village.getBuildings()) if (distanceC(currentLocation.x, i.getLocation().x, currentLocation.y, i.getLocation().y) < radius) return false; return true; } private boolean checkM(){ // Is in previous location if(currentLocation.x == previousLocation.x && currentLocation.y == previousLocation.y) { return false; } // Is outside the border if(currentLocation.x < size || currentLocation.y < size || currentLocation.x > map.numRows - size || currentLocation.y > map.numCols - size) { return false; } // Is on the land double angle2 = 0; while (angle2 < 6.3) { if (map.getTerrainGrid()[currentLocation.x + (int) (size/2 * cos(angle2))][currentLocation.y + (int) (size/2 * sin(angle2))] == Colors.OCEAN) { return false; } angle2 += 0.3; } return true; } private boolean check(){ return (checkB() && checkM() && checkV()); } private void setPreviousLocation(int x, int y){ previousLocation.x = x; previousLocation.y = y; } // changed private boolean Right() { int x = currentLocation.x; int y = currentLocation.y; if (!tryRight(x,y)) if (!tryDownRight(x,y)) if (!tryDown(x,y)) if (!tryDownLeft(x,y)) if (!tryLeft(x,y)) if (!tryUpLeft(x,y)) if (!tryUp(x,y)) return false; return true; } private boolean Left() { int x = currentLocation.x; int y = currentLocation.y; if (!tryLeft(x,y)) if (!tryUpLeft(x,y)) if (!tryUp(x,y)) if (!tryUpRight(x,y)) if (!tryRight(x,y)) if (!tryDownRight(x,y)) if (!tryDown(x,y)) return false; return true; } private boolean Up() { int x = currentLocation.x; int y = currentLocation.y; if (!tryUp(x,y)) if (!tryUpRight(x,y)) if (!tryRight(x,y)) if (!tryDownRight(x,y)) if (!tryDown(x,y)) if (!tryDownLeft(x,y)) if (!tryRight(x,y)) return false; return true; } private boolean Down() { int x = currentLocation.x; int y = currentLocation.y; if (!tryDown(x,y)) if (!tryDownLeft(x,y)) if (!tryLeft(x,y)) if (!tryUpLeft(x,y)) if (!tryUp(x,y)) if (!tryUpRight(x,y)) if (!tryLeft(x,y)) return false; return true; } private boolean UpRight() { int x = currentLocation.x; int y = currentLocation.y; if (!tryUpRight(x,y)) if (!tryRight(x,y)) if (!tryDownRight(x,y)) if (!tryDown(x,y)) if (!tryDownLeft(x,y)) if (!tryLeft(x,y)) if (!tryUpLeft(x,y)) return false; return true; } private boolean UpLeft() { int x = currentLocation.x; int y = currentLocation.y; if (!tryUpLeft(x, y)) if (!tryLeft(x, y)) if (!tryDownLeft(x, y)) if (!tryDown(x, y)) if (!tryDownRight(x, y)) if (!tryRight(x,y)) if (!tryUpLeft(x,y)) return false; return true; } private boolean DownLeft() { int x = currentLocation.x; int y = currentLocation.y; if (!tryDownLeft(x,y)) if (!tryLeft(x,y)) if (!tryUpLeft(x,y)) if (!tryUp(x,y)) if (!tryUpRight(x,y)) if (!tryRight(x,y)) if (!tryDownRight(x,y)) return false; return true; } private boolean DownRight() { int x = currentLocation.x; int y = currentLocation.y; if (!tryDownRight(x,y)) if (!tryRight(x,y)) if (!tryUpRight(x,y)) if (!tryUp(x,y)) if (!tryDownLeft(x,y)) if (!tryLeft(x,y)) if (!tryDownLeft(x,y)) return false; return true; } private boolean tryUp(int x, int y){ moveUp(currentLocation); if (check()) { setPreviousLocation(x,y); return true; } moveDown(currentLocation); return false; } private boolean tryDown(int x, int y){ moveDown(currentLocation); if (check()) { setPreviousLocation(x,y); return true; } moveUp(currentLocation); return false; } private boolean tryLeft(int x, int y){ moveLeft(currentLocation); if (check()) { setPreviousLocation(x,y); return true; } moveRight(currentLocation); return false; } private boolean tryRight(int x, int y){ moveRight(currentLocation); if (check()) { setPreviousLocation(x,y); return true; } moveLeft(currentLocation); return false; } private boolean tryUpLeft(int x, int y){ moveUpLeft(currentLocation); if (check()) { setPreviousLocation(x,y); return true; } moveDownRight(currentLocation); return false; } private boolean tryUpRight(int x, int y){ moveUpRight(currentLocation); if (check()) { setPreviousLocation(x,y); return true; } moveDownLeft(currentLocation); return false; } private boolean tryDownLeft(int x, int y){ moveDownLeft(currentLocation); if (check()) { setPreviousLocation(x,y); return true; } moveUpRight(currentLocation); return false; } private boolean tryDownRight(int x, int y){ moveDownRight(currentLocation); if (check()) { setPreviousLocation(x,y); return true; } moveUpLeft(currentLocation); return false; } // Drawing public void draw(Graphics g) { if (health > 0) { Graphics2D g2d = (Graphics2D) g.create(); // Villager g2d.setColor(color); g2d.rotate(toRadians(vector), currentLocation.x, currentLocation.y); g2d.fillOval(currentLocation.x - size / 2, currentLocation.y - size / 2, size, size); g2d.setColor(Colors.VILLAGER); g2d.fillRect(currentLocation.x, currentLocation.y, 2, 2); // Weapon primeWeapon.draw(g, currentLocation, size, vector); // Shield if (shield != null) shield.draw(g, currentLocation, size, vector + shieldDirection); } } }
[ "noreply@github.com" ]
zbytspokojna.noreply@github.com
060c84dee9251d23ecdd7d2b8bdfd06343bfa60b
74539d9e911ccfd18b0c13a526810be052eec77b
/src/com/amazonaws/services/sns/model/transform/ListSubscriptionsResultStaxUnmarshaller.java
ea816bc5c8e7398934ef512551661fd528b37467
[]
no_license
dovikn/inegotiate-android
723f12a3ee7ef46b980ee465b36a6a154e5adf6f
cea5e088b01ae4487d83cd1a84e6d2df78761a6e
refs/heads/master
2021-01-12T02:14:41.503567
2017-01-10T04:20:15
2017-01-10T04:20:15
78,492,148
0
1
null
null
null
null
UTF-8
Java
false
false
2,107
java
package com.amazonaws.services.sns.model.transform; import com.amazonaws.javax.xml.stream.events.XMLEvent; import com.amazonaws.services.sns.model.ListSubscriptionsResult; import com.amazonaws.transform.SimpleTypeStaxUnmarshallers.StringStaxUnmarshaller; import com.amazonaws.transform.StaxUnmarshallerContext; import com.amazonaws.transform.Unmarshaller; public class ListSubscriptionsResultStaxUnmarshaller implements Unmarshaller<ListSubscriptionsResult, StaxUnmarshallerContext> { private static ListSubscriptionsResultStaxUnmarshaller instance; public static ListSubscriptionsResultStaxUnmarshaller getInstance() { if (instance == null) { instance = new ListSubscriptionsResultStaxUnmarshaller(); } return instance; } public ListSubscriptionsResult unmarshall(StaxUnmarshallerContext staxUnmarshallerContext) throws Exception { ListSubscriptionsResult listSubscriptionsResult = new ListSubscriptionsResult(); int currentDepth = staxUnmarshallerContext.getCurrentDepth(); int i = currentDepth + 1; if (staxUnmarshallerContext.isStartOfDocument()) { i += 2; } while (true) { XMLEvent nextEvent = staxUnmarshallerContext.nextEvent(); if (nextEvent.isEndDocument()) { return listSubscriptionsResult; } if (nextEvent.isAttribute() || nextEvent.isStartElement()) { if (staxUnmarshallerContext.testExpression("Subscriptions/member", i)) { listSubscriptionsResult.getSubscriptions().add(SubscriptionStaxUnmarshaller.getInstance().unmarshall(staxUnmarshallerContext)); } else if (staxUnmarshallerContext.testExpression("NextToken", i)) { listSubscriptionsResult.setNextToken(StringStaxUnmarshaller.getInstance().unmarshall(staxUnmarshallerContext)); } } else if (nextEvent.isEndElement() && staxUnmarshallerContext.getCurrentDepth() < currentDepth) { return listSubscriptionsResult; } } } }
[ "dovik@dovik-macbookpro.roam.corp.google.com" ]
dovik@dovik-macbookpro.roam.corp.google.com
82427e1fd2aa5c5eb2c1c8b0ce5550016257743e
f3089f62135c9e230436e65ca23c8ea1df823725
/src/main/java/com/mzweigert/jobnotifier/controller/ResendJobsRESTController.java
72ca8ac2821e4af23205d40d4f440e47f63e610c
[]
no_license
mzweigert/job-notifier
d0ad5842a6f34facca8d4640ca77e1a50dcd5172
cb444d5fdbff9d34d100a8ed48f4c66c2f034051
refs/heads/master
2020-07-16T17:16:07.767630
2019-11-06T16:34:26
2019-11-06T16:34:26
205,830,876
0
0
null
null
null
null
UTF-8
Java
false
false
1,285
java
package com.mzweigert.jobnotifier.controller; import com.mzweigert.jobnotifier.service.ResendJobsService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.util.Objects; @RestController public class ResendJobsRESTController { @Value("${resend.password}") private String resendPassword; private final ResendJobsService resendJobsService; @Autowired public ResendJobsRESTController(ResendJobsService resendJobsService) { this.resendJobsService = resendJobsService; } @PostMapping(path = "/resend") public ResponseEntity<?> resend(@RequestParam String password) { if (Objects.equals(password, resendPassword)) { resendJobsService.resend(); return new ResponseEntity<>("\n resend done \n", HttpStatus.OK); } else { return new ResponseEntity<>("\n password for resend is not correct! \n", HttpStatus.FORBIDDEN); } } }
[ "mateuszzweigert@gmail.com" ]
mateuszzweigert@gmail.com
a64d8837d35806d7e5f2a27af96d9038fd52b47a
26c0c9ff56ffbdf7071a65332f8b746ce274c8fb
/src/ru/nsu/hci/bayrakh/javalabs/lab3/Infix2PostfixCalculator.java
afcb374f3994062a5057ee10fc8ae03414998966
[]
no_license
vki-group-503b/bayrakh
e9801ad470be0dd0f91ff5d1957991f7a582168c
57a6a4516e7198e7823904960706edb70b616330
refs/heads/master
2021-09-01T20:07:00.144083
2017-12-28T14:20:35
2017-12-28T14:20:35
105,347,610
0
0
null
null
null
null
UTF-8
Java
false
false
658
java
package ru.nsu.hci.bayrakh.javalabs.lab3; import java.util.Scanner; public class Infix2PostfixCalculator { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Введите выражение: "); String expression = input.nextLine(); try { Calculator calc = new Calculator(expression); System.out.printf("Результат: %.3f%n", calc.getResult()); System.out.printf("Постфиксная форма: %s%n", calc.getResultExpr()); } catch (Exception e) { System.out.println(e.getMessage()); } } }
[ "linsi30898@gmail.com" ]
linsi30898@gmail.com
0b699921027407633ab3e7d87bdb94f70430b60f
3672cc71d1d6655449cf883da52763664bf95a73
/javasource/src/ch5/Person.java
f6bbcaebfdeab099d4895ae70a4cb5db681cdf9c
[]
no_license
youngkwonnoh/javasource
4a19dbc97e6f9380d2b434f4aea1ef8a500b2a0e
edbb24c7341bb2bece1241b3b5f05bd9c82d94bb
refs/heads/master
2023-05-11T16:50:42.714124
2021-06-02T14:21:22
2021-06-02T14:21:22
357,107,193
0
0
null
null
null
null
UTF-8
Java
false
false
158
java
package ch5; public class Person { // final => 상수(고정된 값, 변경 불가) static final String NATION = "Korea"; String ssn; String name; }
[ "yknoh.sol@gmail.com" ]
yknoh.sol@gmail.com
7a4ecc5945d840e21fc3d07509bab1af33304e1b
66526a23aab5c5993bc618b190327a203c15e27c
/src/main/java/com/ocp/day18/ArrayListDemo.java
9732a09750375c324bffeac35713062427717660
[]
no_license
vincenttuan/Java20210219
5cc4bdd90ce1906619fe57a2e9b86b79d3960ccb
969b5862bd8b815f2fcf59cc52405ea552925d92
refs/heads/master
2023-05-30T08:42:31.304407
2021-05-28T13:40:37
2021-05-28T13:40:37
340,356,674
1
1
null
null
null
null
UTF-8
Java
false
false
473
java
package com.ocp.day18; import java.util.ArrayList; import java.util.List; import java.util.Random; public class ArrayListDemo { public static void main(String[] args) { // 四星彩(0~9)取四個可重複的數字 List<Integer> lotto = new ArrayList<>(); Random r = new Random(); for(int i=0;i<4;i++) { int n = r.nextInt(10); lotto.add(n); } System.out.println(lotto); } }
[ "teacher@192.168.1.180" ]
teacher@192.168.1.180
524561617c4b936cf16f1619dbf64e3758f37c4d
afcf2eed601ec318f46b186915c1f98ed50064a4
/JavaBean/src/java/models/Order.java
5aaf91e91b51572899d8318a1316e4a8b97754c3
[]
no_license
aishahzaharii/webapp
c94a81c2db68a30d79aba9a446096529d7239071
743c9ba98d3c67ea5eeaaef4329907c6bd839194
refs/heads/master
2020-09-25T04:18:24.682506
2019-12-30T12:41:34
2019-12-30T12:41:34
225,915,874
0
1
null
null
null
null
UTF-8
Java
false
false
464
java
package java.models; public class Order { public int foodId; public String name; public String category; public int orderno; public int price; public int cost; public Order(int foodId,String name,String category,int orderno,int price,int cost){ this.foodId = foodId; this.name = name; this.category = category; this.orderno = orderno; this.price = price; this.cost = cost; } }
[ "noreply@github.com" ]
aishahzaharii.noreply@github.com
2d801a8837eb3406965015ea9938f6887e573ea9
defeb3dbf0269f4305d0520e20c807731646e090
/src/main/java/Termin.java
87e59d16d5112c0edfa17c651387d047f2f55e21
[ "Unlicense" ]
permissive
PrzemekDulat/java-crud-hibernate
e4a69429b1d20c3d7bb8d43832b92413dee371b2
a118d7fb2e2b6d7c45fafef1daf1c3e7ccd15f8f
refs/heads/master
2020-06-23T14:27:20.176147
2019-07-24T14:14:54
2019-07-24T14:14:54
198,649,341
0
0
null
null
null
null
UTF-8
Java
false
false
625
java
import javax.persistence.*; import java.util.List; @Entity public class Termin { public Termin(String data) { this.data = data; } @Id //@GeneratedValue(strategy= GenerationType.AUTO) @GeneratedValue(strategy = GenerationType.IDENTITY) private int idTermin; private String data; public int getIdTermin() { return idTermin; } public void setIdTermin(int idTermin) { this.idTermin = idTermin; } public String getData() { return data; } public void setData(String data) { this.data = data; } public Termin(){} }
[ "53231562+PrzemekDulat@users.noreply.github.com" ]
53231562+PrzemekDulat@users.noreply.github.com
9c5d89822891735a3aec36d439d41dcefb9a6e95
b580639d26f6ed4fe6e64b77a164812caee0fdac
/mybatis-generator/target/com/xuanhe/prize/commons/db/mapper/CardUserHitMapper.java
fbaec82c2fa2d4c2b09402b3fc152693093da75e
[]
no_license
xuanhe789/frontend
149c0bc433ff8a78d74904e5246b49932f98e423
65be809fd471c00fad9088d66a82ee139792f35b
refs/heads/main
2023-02-23T15:35:47.210263
2021-01-28T16:05:21
2021-01-28T16:05:21
330,382,247
0
0
null
null
null
null
UTF-8
Java
false
false
4,086
java
package com.xuanhe.prize.commons.db.mapper; import com.xuanhe.prize.commons.db.entity.CardUserHit; import com.xuanhe.prize.commons.db.entity.CardUserHitExample; import java.util.List; import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.ResultMap; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.SelectKey; import org.apache.ibatis.annotations.Update; public interface CardUserHitMapper { /** * This method was generated by MyBatis Generator. * This method corresponds to the database table card_user_hit * * @mbg.generated */ long countByExample(CardUserHitExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table card_user_hit * * @mbg.generated */ int deleteByExample(CardUserHitExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table card_user_hit * * @mbg.generated */ @Delete({ "delete from card_user_hit", "where id = #{id,jdbcType=INTEGER}" }) int deleteByPrimaryKey(Integer id); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table card_user_hit * * @mbg.generated */ @Insert({ "insert into card_user_hit (gameid, userid, ", "productid, hittime)", "values (#{gameid,jdbcType=INTEGER}, #{userid,jdbcType=INTEGER}, ", "#{productid,jdbcType=INTEGER}, #{hittime,jdbcType=TIMESTAMP})" }) @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class) int insert(CardUserHit record); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table card_user_hit * * @mbg.generated */ int insertSelective(CardUserHit record); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table card_user_hit * * @mbg.generated */ List<CardUserHit> selectByExample(CardUserHitExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table card_user_hit * * @mbg.generated */ @Select({ "select", "id, gameid, userid, productid, hittime", "from card_user_hit", "where id = #{id,jdbcType=INTEGER}" }) @ResultMap("com.xuanhe.prize.commons.db.mapper.CardUserHitMapper.BaseResultMap") CardUserHit selectByPrimaryKey(Integer id); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table card_user_hit * * @mbg.generated */ int updateByExampleSelective(@Param("record") CardUserHit record, @Param("example") CardUserHitExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table card_user_hit * * @mbg.generated */ int updateByExample(@Param("record") CardUserHit record, @Param("example") CardUserHitExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table card_user_hit * * @mbg.generated */ int updateByPrimaryKeySelective(CardUserHit record); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table card_user_hit * * @mbg.generated */ @Update({ "update card_user_hit", "set gameid = #{gameid,jdbcType=INTEGER},", "userid = #{userid,jdbcType=INTEGER},", "productid = #{productid,jdbcType=INTEGER},", "hittime = #{hittime,jdbcType=TIMESTAMP}", "where id = #{id,jdbcType=INTEGER}" }) int updateByPrimaryKey(CardUserHit record); }
[ "506078418@qq.com" ]
506078418@qq.com
78b2227077fc328aaffd0c974efb80cc4c6dae82
4f24bf08bcb42a079db8e48938f48fe74d68257b
/lizard-query-server/src/main/java/lizard/query/LzDataset.java
64505e8b135b11459269660f8907fb6dee6614f0
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
anukat2015/lizard
a5d6226c2d809ce8e94f734d93d3a2daaaacae0d
eb9de7407cf7b20531910a77fb29e6be3b9768e3
refs/heads/master
2020-12-29T00:29:33.050304
2015-08-20T19:10:24
2015-08-20T19:10:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,273
java
/* * 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. * * See the NOTICE file distributed with this work for additional * information regarding copyright ownership. */ package lizard.query; import java.util.List ; import lizard.system.Component ; import lizard.system.LifeCycle ; import org.seaborne.dboe.transaction.txn.TransactionCoordinator ; import org.seaborne.tdb2.store.DatasetGraphTDB ; /** The query platform for Lizard - a dataset and the local components (clients to index and nodes) */ public class LzDataset implements LifeCycle { private DatasetGraphTDB dsg ; private List<Component> components ; private boolean started = false ; private TransactionCoordinator txnCoord ; public LzDataset(TransactionCoordinator txnCoord, DatasetGraphTDB dsg, List<Component> components) { this.txnCoord = txnCoord ; this.dsg = dsg ; this.components = components ; } public DatasetGraphTDB getDataset() { return dsg ; } public TransactionCoordinator getTxnMgr() { return txnCoord ; } public List<Component> getStartables() { return components ; } public List<Component> getComponents() { return this.components ; } @Override public void start() { txnCoord.start(); components.stream().forEach(s -> s.start() ); started = true ; } @Override public void stop() { components.stream().forEach(s -> s.stop()); started = false ; txnCoord.shutdown(); } @Override public boolean isRunning() { return started ; } @Override public boolean hasFailed() { return false ; } @Override public void setStatus(Status status) {} }
[ "andy@seaborne.org" ]
andy@seaborne.org
5bc9b9c639f4810e57704dc1ce0be898d99ad90d
c8e8e740e00320e0a1be0d40dad5263471bdda3d
/src/leetcode/L2017042702_442_Find_All_Duplicates_in_an_Array.java
d0d6c34dbcda8255fd267be0d053656f3b7c0bef
[]
no_license
zhangruimin/leetcode
7fdf4d64be48711ffc5579b673a1df2d4c68da96
3299b40534050caa7575e47ba8cf6514df98b844
refs/heads/master
2021-01-23T04:39:18.326871
2018-05-20T12:22:44
2018-05-20T12:22:44
86,231,072
0
0
null
null
null
null
UTF-8
Java
false
false
895
java
package leetcode; import java.util.ArrayList; import java.util.Comparator; import java.util.List; /** */ public class L2017042702_442_Find_All_Duplicates_in_an_Array { public List<Integer> findDuplicates(int[] nums) { ArrayList<Integer> result = new ArrayList<>(); for (int num : nums) { if (nums[Math.abs(num) - 1] < 0) { result.add(num); continue; } nums[Math.abs(num) - 1] = -nums[Math.abs(num) - 1]; } return result; } public List<Integer> findDuplicates_mind(int[] nums) { boolean[] found = new boolean[nums.length + 1]; ArrayList<Integer> result = new ArrayList<>(); for (int num : nums) { if (found[num]) { result.add(num); } found[num] = true; } return result; } }
[ "zrruimin@amazon.com" ]
zrruimin@amazon.com
ca68d4b1adb9d718a8140814807e7d4f20ab4f14
4e5938d9d4ba04031c53508805a39c6b9fc13f00
/src/boletin19/Correo.java
29b08c17eaa85161f5477684a03dbb129b79c74c
[]
no_license
garciaamor/Boletin19
09b355d573887800cb839ba05d788bf43a8e87e9
0c865535ff9f866cb60b8f49b047f4b8ec4dc5e3
refs/heads/master
2021-01-10T11:11:58.308745
2016-02-04T10:03:41
2016-02-04T10:03:41
51,067,298
0
0
null
null
null
null
UTF-8
Java
false
false
648
java
package boletin19; public class Correo { String contido="Prueba de correo"; boolean leido; public Correo(String contido, boolean leido) { this.contido = contido; this.leido = leido; } public String getContido() { return contido; } public void setContido(String contido) { this.contido = contido; } public boolean isLeido() { return leido; } public void setLeido(boolean leido) { this.leido = leido; } @Override public String toString() { return "Correo{" + "contido=" + contido + ", leido=" + leido + '}'; } }
[ "jgarciaamor@atanasoff01.danielcastelao.org" ]
jgarciaamor@atanasoff01.danielcastelao.org
216a03183ddf9ebf9c387452ea26c5e943095288
28836d77e32aa894e3388b35e7163412cf017da1
/src/main/java/com/tw/apistackbase/security/user/Role.java
60bcccd0bfba560c4ec5764bc7555e95e4bd2ab7
[]
no_license
zjx-immersion/spring-jwt-rest-api
4ae2e48722c328b62d7e3a549908917611a8b625
8b2dcd98cd4124dc521b9c0cea2e7ac50716c3a9
refs/heads/master
2020-03-25T02:30:44.238722
2018-08-02T12:40:47
2018-08-02T12:40:47
143,293,106
1
1
null
null
null
null
UTF-8
Java
false
false
1,039
java
package com.tw.apistackbase.security.user; import javax.persistence.*; import javax.validation.constraints.NotNull; import java.util.List; @Entity @Table(name = "AUTHORITY") public class Role { @Id @Column(name = "ID") @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "authority_seq") @SequenceGenerator(name = "authority_seq", sequenceName = "authority_seq", allocationSize = 1) private Long id; @Column(name = "NAME", length = 50) @NotNull @Enumerated(EnumType.STRING) private RoleName name; @ManyToMany(mappedBy = "authorities", fetch = FetchType.LAZY) private List<User> users; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public RoleName getName() { return name; } public void setName(RoleName name) { this.name = name; } public List<User> getUsers() { return users; } public void setUsers(List<User> users) { this.users = users; } }
[ "jianxin_home@163.com" ]
jianxin_home@163.com
b867376ae8a6784cd00668ce2c0bf47c0a21c614
eba8f0968ac305935d1573d5429ae48317fe081a
/controle-frequencia/src/main/java/dao/GenericService.java
1b101f87c4acdfa131227ef177f12cad3d94f2b9
[]
no_license
victorborg3s/controle-frequencia
48af82490bd638cf25d752544602ae33baa3f16b
94b8a5238f1eeb79ce62dbb0d0c0fedb0aeee914
refs/heads/master
2020-03-28T23:54:18.296476
2018-03-26T04:59:08
2018-03-26T04:59:08
94,632,678
0
0
null
null
null
null
UTF-8
Java
false
false
1,076
java
package dao; import java.util.List; import javax.persistence.criteria.CriteriaQuery; import org.hibernate.Session; import org.hibernate.SessionFactory; import entity.BaseEntity; import util.HibernateUtils; public class GenericService { public static List<?> getAll(Class<?> clazz) { List<?> data = null; SessionFactory sessFact = HibernateUtils.getSessionFactory(); Session session = sessFact.getCurrentSession(); org.hibernate.Transaction tr = session.beginTransaction(); CriteriaQuery<?> cq = session.getCriteriaBuilder().createQuery(clazz); cq.from(clazz); data = session.createQuery(cq).getResultList(); tr.commit(); return data; } public static BaseEntity load(Class<?> clazz, Integer id) { BaseEntity entity = null; SessionFactory sessFact = HibernateUtils.getSessionFactory(); Session session = sessFact.getCurrentSession(); org.hibernate.Transaction tr = session.beginTransaction(); entity = (BaseEntity) session.get(clazz, id); tr.commit(); return entity; } }
[ "victor.borges@ifbaiano.edu.br" ]
victor.borges@ifbaiano.edu.br
3b3b54a0fd40c8f3840a08e53244f5ecb269c4dc
38bf794b332be79fb3b73840302207a3d45d6bdf
/src/main/java/com/wipro/EmployeeDatabase/Repository/EmployeeRepository.java
8920c783fe044fc548a8bfc953450baeff7393b3
[]
no_license
KrishnaVamsii/EmployeeDatabase
edad4b7f801002fce2e35e5abafa3b5cf80099cf
31aff67a0c95effba0910a1fe4c256ef88f555e3
refs/heads/master
2020-08-01T13:24:39.293399
2019-09-26T05:55:08
2019-09-26T05:55:08
211,010,526
0
0
null
null
null
null
UTF-8
Java
false
false
330
java
package com.wipro.EmployeeDatabase.Repository; import com.wipro.EmployeeDatabase.model.Employee; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.repository.CrudRepository; public interface EmployeeRepository extends JpaRepository<Employee,String>,CrudRepository<Employee,String>{ }
[ "krishna.vamsi@wipro.com" ]
krishna.vamsi@wipro.com
29739c6ba031a74b09c8a9440da997c94ccf11c0
f8e66a3b352038fe1020640d7bfc3457216470df
/app/src/main/java/com/digitalhouse/firebaseentregavel/modules/CadastroGame/view/CadastroGameActivity.java
d495a16a837e9ae6afb8f285b07c7331243a14eb
[]
no_license
JeffLasa/FirebaseEntregavel
b89d0d0c075ed4f0ee38c91ae8d3ce6f07f06fef
19a9e0c83cbf3230abb5a96daece50a60179a62e
refs/heads/master
2020-07-06T14:46:59.827544
2019-09-03T19:34:20
2019-09-03T19:34:20
203,055,911
0
0
null
null
null
null
UTF-8
Java
false
false
1,330
java
package com.digitalhouse.firebaseentregavel.modules.CadastroGame.view; import android.content.Intent; import android.os.Bundle; import android.widget.TextView; import androidx.appcompat.app.AppCompatActivity; import com.digitalhouse.firebaseentregavel.R; public class CadastroGameActivity extends AppCompatActivity { String nomeGame; String anoGame ; String deckGame; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_cadastro_game); Intent intent = getIntent(); if (intent!=null){ Bundle bundle = getIntent().getExtras(); if (bundle !=null){ nomeGame = bundle.getString("GAME"); anoGame = bundle.getString("ANO"); deckGame = bundle.getString("DECK"); TextView nomeGameTextView = findViewById(R.id.cadastro_input_text_nome_id); TextView anoGameTextView = findViewById(R.id.cadastro_ano_input_text_id); TextView deckGameTextView = findViewById(R.id.cadastro_deck_input_text_id); nomeGameTextView.setText(nomeGame); anoGameTextView.setText(anoGame); deckGameTextView.setText(deckGame); } } } }
[ "jeff.lasa@hotmail" ]
jeff.lasa@hotmail
542e39f21e8c046bd62c603a5809c920a5532bab
c4a2eff1301b6e927e5f6e1c7300d0dc8dbefd27
/src/Offer29.java
ba9d3bb7838ca7acd42af0128613ef9aab7979ef
[]
no_license
HuangNobody/JianZhi_Offer
1d165cfbc3f61b158b7cd2de3066cbe0d1fda9d8
9f5f6303ccd3aaed6791b0da36dd926cf8badee0
refs/heads/master
2020-04-24T23:03:18.327058
2019-03-28T08:47:50
2019-03-28T08:47:50
172,331,601
0
0
null
null
null
null
GB18030
Java
false
false
2,529
java
public class Offer29 { //选用partition函数 public int partition(int [] arr, int left, int right){ int result = arr[left]; if(left>right) return -1; while(left<right){ while(left<right && arr[right] >= result) right--; arr[left] = arr[right]; while(left<right && arr[left] < result) left++; arr[right] = arr[left]; } arr[left] = result; return left; } public int moreThanHalfNum(int [] arr){ if(arr == null ||arr.length == 0) return -1; int length = arr.length; int middle = length >>1; int start = 0; int end = length-1; int index = partition(arr, start, end); while(index != middle){ if(index > middle){ end = index-1; index = partition(arr, start, end); }else{ start = index+1; index = partition(arr, start, end); } } int result = arr[middle]; if(!checkMoreThanHalf(arr, result)) result = -1; return result; } public boolean checkMoreThanHalf(int[] arr, int result) { int times = 0; for(int i = 0;i<arr.length;i++){ if(arr[i] == result) times++; } boolean isMoreThanHalf = true; if(times*2<=arr.length) isMoreThanHalf = false; return isMoreThanHalf; } //方法2 public int moreThanHalfNum_2(int [] arr){ if(arr == null || arr.length == 0) return -1; int result = arr[0]; int times = 1; for(int i = 0;i<arr.length;i++){ if(times == 0){ result = arr[i]; times = 1; }else if(arr[i] == result) times++; else times--; } if(!checkMoreThanHalf(arr, result)) result = -1; return result; } public static void main(String[] args) { Offer29 of29 = new Offer29(); //功能测试,1,输入的数组中存在一个出现次数超过数组长度一般的数字 int [] arr11 = {1,2,3,2,2,2,5,4,2}; //System.out.println(of29.moreThanHalfNum(arr11)); System.out.println(of29.moreThanHalfNum_2(arr11)); //功能测试,2,输入的数组中不存在一个出现次数超过数组长度一般的数字 int [] arr21 = {1,2,3,2,1,3,5,4,2}; //System.out.println(of29.moreThanHalfNum(arr21)); System.out.println(of29.moreThanHalfNum_2(arr21)); //特殊输入测试,3,输入的数组中只有一个数字 int [] arr31 = {1}; //System.out.println(of29.moreThanHalfNum(arr31)); System.out.println(of29.moreThanHalfNum_2(arr31)); //特殊输入测试,3,输入NULL指针 int [] arr41 = null; //System.out.println(of29.moreThanHalfNum(arr41)); System.out.println(of29.moreThanHalfNum_2(arr41)); } }
[ "haohuang_work@163.com" ]
haohuang_work@163.com
86f2693cee63603833dc24d4f6ee434212ed8dac
8e94005abdd35f998929b74c19a86b7203c3dbbc
/src/bloomberg/tree/MaxValInTree.java
456c16b737638426947e6c157b4b29c27d467076
[]
no_license
tinapgaara/leetcode
d1ced120da9ca74bfc1712c4f0c5541ec12cf980
8a93346e7476183ecc96065062da8585018b5a5b
refs/heads/master
2020-12-11T09:41:39.468895
2018-04-24T07:15:27
2018-04-24T07:15:27
43,688,533
1
0
null
null
null
null
UTF-8
Java
false
false
99
java
package bloomberg.tree; /** * Created by yingtan on 10/16/15.s */ public class MaxValInTree { }
[ "yt2443@columbia.edu" ]
yt2443@columbia.edu
cc54e6974e2eeba4a3cae1411dff5abdea9f9a4b
3adc99579f53ee8f56e37c4a9e9107b4438abe8f
/2.JavaCore/src/main/java/com/jr/level/level19/task1907/Solution.java
153d33274cdf4b8bc3203ab2b8164966b8dddf9b
[]
no_license
Qventeen/JavaLearn
3fa87b7b48c968f3c3813816c524e14702786f6b
9157dae1be1c73da587457c17906bcb3a75e54ec
refs/heads/master
2023-02-04T16:24:59.982269
2020-12-18T16:17:58
2020-12-18T16:17:58
322,562,417
0
0
null
null
null
null
UTF-8
Java
false
false
797
java
package com.jr.level.level19.task1907; /* Считаем слово */ import java.io.BufferedReader; import java.io.FileReader; import java.io.InputStreamReader; public class Solution { public static void main(String[] args) throws Exception{ BufferedReader rd = new BufferedReader(new InputStreamReader(System.in)); String nfin = rd.readLine(); rd.close(); BufferedReader fin = new BufferedReader(new FileReader(nfin)); String tmp; String[] tmps; int count = 0; while(fin.ready()){ tmp = fin.readLine(); tmps = tmp.split("\\W"); for(String s: tmps){ if(s.matches("world")) count++; } } System.out.println(count); fin.close(); } }
[ "qventeen@gmail.com" ]
qventeen@gmail.com
dd3f0025af36cddacc5d715e4c8c4e86fd38df32
9a22b1e7309e680401d5fd173b0e89e8b71f888d
/src/main/java/ru/study/homework/pattern/task2/Plant.java
49f0ab5e9b6c6c543e459c57be0a8de56e776d6f
[]
no_license
Casa-Bonita/BigProject
b5f3da0a2731926670304ba9a0e0cf7bc751212a
95ea6611dad99a79d2cf548df251bec9c01c3f0f
refs/heads/master
2023-04-05T23:56:51.867914
2021-05-10T12:18:47
2021-05-10T12:18:47
297,807,113
0
0
null
null
null
null
UTF-8
Java
false
false
1,055
java
package ru.study.homework.pattern.task2; import java.util.*; public class Plant { private List<Product> productList; private static Plant plant; private Plant(){ productList = new ArrayList<>(); } public static Plant getInstance(){ if(plant == null){ plant = new Plant(); } return plant; } public int orderProducts(Product product, int count){ for (int i = 0; i < productList.size(); i++) { if(productList.get(i).equals(product)){ Product productFromPlant = productList.get(i); if(productFromPlant.getBalanceAtPlant() < count){ count = productFromPlant.getBalanceAtPlant(); } productFromPlant.setBalanceAtPlant(productFromPlant.getBalanceAtPlant() - count); } } return count; } public void add(Product product){ productList.add(product); } public Product get(int index){ return productList.get(index); } }
[ "pol33@rambler.ru" ]
pol33@rambler.ru
95505e26f729c6e0d33255118e8d072da8e93057
4f2d207832a803725e1aea5b60fd4fcb8689a077
/app/src/androidTest/java/com/example/modhi/myapplication/ExampleInstrumentedTest.java
4183f10abd38ac5b66f2679bdb0b45359f6ec9ab
[]
no_license
AnAstronautGirl/MyApplication3
17a748d82a7904954e58486d81cc58cdf6e3a9d7
c86b51bfe13e2207825005297bb3e655afe4e773
refs/heads/master
2021-01-18T22:00:49.232728
2016-09-29T07:24:08
2016-09-29T07:24:08
69,540,366
0
0
null
null
null
null
UTF-8
Java
false
false
766
java
package com.example.modhi.myapplication; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumentation test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.modhi.myapplication", appContext.getPackageName()); } }
[ "astronomy hobbyist" ]
astronomy hobbyist
bed5bf331609da8f386b67ccdaa6cb343db3728d
2dfbf0f6fbbd81bcd47162ea0a9ea8a34b56e23b
/src/br/com/travelmate/bean/TelefoneBean.java
b2d405b2bae846513388edb1d36e25b0366dc895
[]
no_license
julioizidoro/systm-eclipse
25e5cce7b86d5ffeb241731c6949fa5ff614c90c
cc501300c4a5740492cd4fb409ec23529f67297d
refs/heads/master
2021-01-21T12:27:39.100941
2019-01-23T11:33:18
2019-01-23T11:33:18
47,205,022
0
0
null
null
null
null
UTF-8
Java
false
false
445
java
package br.com.travelmate.bean; public class TelefoneBean { private String numero; private String tiponumero; public TelefoneBean() { tiponumero = "Fixo"; } public String getNumero() { return numero; } public void setNumero(String numero) { this.numero = numero; } public String getTiponumero() { return tiponumero; } public void setTiponumero(String tiponumero) { this.tiponumero = tiponumero; } }
[ "andersonluizmachadodearaujo@192.168.100.8" ]
andersonluizmachadodearaujo@192.168.100.8
432c346e6a403f9f7bffa74d75345ac0c5e16787
8ed53ce1154e6d6d92c6514540c35d0f3e388ef9
/app/src/main/java/mvp/cool/master/layout/RecyclerScrollView.java
e31fe6492a0d6db3cf5b4347ab33ef33902c64ac
[]
no_license
tanhaoshi/Cool-master
fe32fa1af53d6a35627b01c289e9c20276f6e605
ad61dd2ef314d96c197b256901d3c2689de269af
refs/heads/master
2021-01-20T01:36:09.378592
2017-06-14T07:20:42
2017-06-14T07:20:42
89,304,981
0
0
null
null
null
null
UTF-8
Java
false
false
1,536
java
package mvp.cool.master.layout; import android.content.Context; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.ViewConfiguration; import android.widget.ScrollView; /** * @version 1.0 * @author TanHaoShi * Created by Administrator on 2017/5/26. */ public class RecyclerScrollView extends ScrollView { private int downX; private int downY; private int mTouchSlop; public RecyclerScrollView(Context context) { super(context); mTouchSlop= ViewConfiguration.get(context).getScaledTouchSlop(); } public RecyclerScrollView(Context context, AttributeSet attrs) { super(context, attrs); mTouchSlop= ViewConfiguration.get(context).getScaledTouchSlop(); } public RecyclerScrollView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); mTouchSlop= ViewConfiguration.get(context).getScaledTouchSlop(); } @Override public boolean onInterceptTouchEvent(MotionEvent e) { int action = e.getAction(); switch (action) { case MotionEvent.ACTION_DOWN: downX = (int) e.getRawX(); downY = (int) e.getRawY(); break; case MotionEvent.ACTION_MOVE: int moveY = (int) e.getRawY(); if (Math.abs(moveY - downY) > mTouchSlop) { return true; } } return super.onInterceptTouchEvent(e); } }
[ "tan_hao_shii@163.com" ]
tan_hao_shii@163.com
5ceb925c7587abb8036f4f1125dfd68244784bd2
4f2542b889bf5f3696900d1015995f3a6fa02517
/demo-system/src/main/java/com/liyuan/exception/DaoException.java
80c2a3857693101980f10bc718179dd2e01e3ccc
[]
no_license
ly302637371/demo
5f94c57d2f6025fed99d201f1e0db5947fad0773
66a73fd32973aac6934284fbb1a6c50379e5fd78
refs/heads/master
2021-01-18T07:44:49.650107
2017-08-18T07:56:32
2017-08-18T07:56:32
100,352,416
0
0
null
null
null
null
UTF-8
Java
false
false
326
java
package com.liyuan.exception; import org.springframework.dao.DataAccessException; public class DaoException extends DataAccessException { private static final long serialVersionUID = -812180847L; public DaoException(String msg, Throwable cause) { super(msg, cause); } public DaoException(String s) { super(s); } }
[ "302637371@qq.com" ]
302637371@qq.com
83463171960d764351442e1a2cc1e4ce15f34c7f
d35d5bdfe5fca9523c4cbfd143faf9ec75a3743c
/src/net/diva/browser/page/InformationFragment.java
7d105842d7282f7deeaae056cca3a3e3083adb38
[]
no_license
ddnbrowser/Diva.NetBrowser
06ea051d751d688e3d204bf19a41ebec873b027a
391f820f1eb50e29c0285d1089976c8614b3c1de
refs/heads/master
2021-01-10T20:00:59.933181
2015-03-07T12:04:44
2015-03-07T12:04:44
2,087,201
4
3
null
null
null
null
UTF-8
Java
false
false
6,217
java
package net.diva.browser.page; import net.diva.browser.DdN; import net.diva.browser.R; import net.diva.browser.model.MyList; import net.diva.browser.model.PlayRecord; import net.diva.browser.service.ServiceClient; import net.diva.browser.ticket.DecorPrizeActivity; import net.diva.browser.ticket.SkinPrizeActivity; import net.diva.browser.util.ComplexAdapter; import net.diva.browser.util.ComplexAdapter.Item; import net.diva.browser.util.ComplexAdapter.MultiTextItem; import net.diva.browser.util.ComplexAdapter.TextItem; import net.diva.browser.util.ProgressTask; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.ListFragment; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.ProgressBar; import android.widget.TextView; public class InformationFragment extends ListFragment implements DdN.Observer { private ComplexAdapter m_adapter; private TextItem m_name = new TextItem(R.layout.info_item, R.id.text1); private TextItem m_title = new TextItem(R.layout.info_item, R.id.text1); private TextItem m_level = new TextItem(R.layout.info_item, R.id.text1); private ProgressItem m_experience = new ProgressItem(DdN.EXPERIENCE_UNIT); private MultiTextItem m_total = new MultiTextItem(R.layout.info_right_with_label, R.id.text1, R.id.text2); private MultiTextItem m_toNextLevel = new MultiTextItem(R.layout.info_right_with_label, R.id.text1, R.id.text2); private MultiTextItem m_toNextRank = new MultiTextItem(R.layout.info_right_with_label, R.id.text1, R.id.text2); private TextItem m_vp = new TextItem(R.layout.info_right, R.id.text1); private TextItem m_ticket = new TextItem(R.layout.info_right, R.id.text1); @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setHasOptionsMenu(true); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.basic_list, container, false); TextView empty = (TextView)v.findViewById(R.id.empty_message); if (empty != null) empty.setText(R.string.no_record); return v; } @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); m_total.setText(R.id.text1, getText(R.string.total_exp)); m_toNextLevel.setText(R.id.text1, getText(R.string.next_level)); m_toNextRank.setText(R.id.text1, getText(R.string.next_rank)); m_adapter = new ComplexAdapter(getActivity()); m_adapter.add(new TextItem(android.R.layout.preference_category, android.R.id.title, getText(R.string.player_name))); m_adapter.add(m_name); m_adapter.add(new TextItem(android.R.layout.preference_category, android.R.id.title, getText(R.string.level_rank))); m_adapter.add(m_title); m_adapter.add(m_level); m_adapter.add(m_experience); m_adapter.add(m_total); m_adapter.add(m_toNextLevel); m_adapter.add(m_toNextRank); m_adapter.add(new TextItem(android.R.layout.preference_category, android.R.id.title, getText(R.string.vocaloid_point))); m_adapter.add(m_vp); m_adapter.add(new TextItem(android.R.layout.preference_category, android.R.id.title, getText(R.string.diva_ticket))); m_adapter.add(m_ticket); setListAdapter(m_adapter); } @Override public void onResume() { super.onResume(); final PlayRecord record = DdN.getPlayRecord(); if (record != null) onUpdate(record, false); } @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { inflater.inflate(R.menu.information_options, menu); } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.item_update: new UpdateTask(getActivity()).execute(); break; case R.id.item_exchange_skin: startActivity(new Intent(getActivity(), SkinPrizeActivity.class)); break; case R.id.item_exchange_title: startActivity(new Intent(getActivity(), DecorPrizeActivity.class)); break; default: return super.onOptionsItemSelected(item); } return true; } public void onUpdate(MyList myList, boolean noMusic) { // do nothing. } public void onUpdate(PlayRecord record, boolean noMusic) { long total = record.experience(); int experience = (int)(total % DdN.EXPERIENCE_UNIT); int nextLevel = DdN.EXPERIENCE_UNIT - experience; int[] nextRank = new int[1]; record.rank(nextRank); m_name.setText(record.player_name); m_title.setText(record.title); m_level.setText(record.level); m_experience.value = experience; m_total.setText(R.id.text2, String.format("%d.%02d %%", total/100, total%100)); m_toNextLevel.setText(R.id.text2, String.format("%d.%02d %%", nextLevel/100, nextLevel%100)); m_toNextRank.setText(R.id.text2, String.format("%d pts", nextRank[0])); m_vp.setText(String.format("%d VP", record.vocaloid_point)); m_ticket.setText(String.format("%d 枚", record.ticket)); m_adapter.notifyDataSetChanged(); } private static class ProgressItem extends Item { int max; int value; ProgressItem(int max_) { super(R.layout.info_bar, null); max = max_; } @Override public void prepare(View view) { view.setTag(view.findViewById(R.id.progress)); } @Override public void attach(View view) { ProgressBar progress = (ProgressBar)view.getTag(); progress.setMax(max); progress.setProgress(value); } } private static class UpdateTask extends ProgressTask<Void, Void, Boolean> { public UpdateTask(Context context) { super(context, R.string.message_updating); } @Override protected Boolean doInBackground(Void... params) { ServiceClient service = DdN.getServiceClient(); try { PlayRecord record = service.login(); DdN.getLocalStore().update(record); DdN.setPlayRecord(record); return Boolean.TRUE; } catch (Exception e) { e.printStackTrace(); } return Boolean.FALSE; } } }
[ "ddnbrowser@gmail.com" ]
ddnbrowser@gmail.com
fbe28ece5c649c0807c608668393e366050d7f75
b4ebc263ed87f18ffe7d1cc2227608b28b404f43
/src/main/java/com/wkj/project/test/FanoutReceiveC.java
8cb82f80bf4cc41d099afc2cf01fd65a056e91bc
[]
no_license
jj11332906/Initialprojectmodel
a3a43173fa725eabade0e133c7a1804b5f58ba07
c81c79ad3458ceb853b7ad51656f6da57ff7d319
refs/heads/master
2022-12-07T21:31:28.615597
2020-01-19T06:16:26
2020-01-19T06:16:26
222,862,549
0
0
null
2022-11-16T11:59:33
2019-11-20T06:01:02
Java
UTF-8
Java
false
false
512
java
package com.wkj.project.test; import lombok.extern.slf4j.Slf4j; import org.springframework.amqp.rabbit.annotation.RabbitHandler; import org.springframework.amqp.rabbit.annotation.RabbitListener; import org.springframework.stereotype.Component; @Component @RabbitListener(queues = "fanout.C") @Slf4j public class FanoutReceiveC { //todo 发布订阅模式,消息消费者 @RabbitHandler public void process(String message) { System.out.println("fanout Receiver C : " + message); } }
[ "11332906@qq.com" ]
11332906@qq.com
a5e9abbd7b9b6cb476fd4b7101e1ce76bcafe430
f7d83641a3c5baa8b9ab5fc4b7ec9d202dac1b98
/mmdshop-provider-8001/src/main/java/com/mmd/mmdshop/controller/ChangeTypeController.java
850f3fb14cf7797cd4c8fcd109c3f6c344b546de
[]
no_license
mmnbplus/MMD
c446210e11bb357d506f081e5131391fb5ba8f1c
c6dbd8b0ad7b0c40c3d03158fa78dcc6674e2ed1
refs/heads/master
2020-04-24T02:03:14.088974
2019-04-03T11:03:42
2019-04-03T11:03:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,144
java
package com.mmd.mmdshop.controller; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import com.mmd.mmdshop.dbdo.ChangeTypeDO; import com.mmd.mmdshop.service.ChangeTypeService; /** * * @ClassName ChangeTypeController.java * @author MM * @version 1.0 * @date 2019/2/18 */ @RestController public class ChangeTypeController{ protected final Logger logger = LoggerFactory.getLogger(getClass()); @Autowired private ChangeTypeService service; @PostMapping("/provider/findChangeType") public List<ChangeTypeDO> findChangeType() { return service.find(); } @PostMapping("/provider/findChangeTypeAll") public List<ChangeTypeDO> findChangeTypeAll() { return service.findAll(); } @PostMapping("/provider/modifyChangeType") public int modifyChangeType(@RequestBody ChangeTypeDO changeTypeDO) { return service.modifyChangeType(changeTypeDO); } }
[ "30348056+babysmm@users.noreply.github.com" ]
30348056+babysmm@users.noreply.github.com
4a2e571b277ae7e793a0433de4f3d6ab86e0e2c3
9099d8901dbfd8bbc8f2f06c86ead72ae51e584e
/src/main/java/net/wesjd/towny/ngin/storage/pack/impl/java/UUIDPacker.java
c549a77f57cceef776b861f1aade8df7b8697212
[]
no_license
CyberFlameGO/towny-ngin
07da5d3deeb75951454d5c464417a202991b8745
12922f12c0814440e8a10b62cd63c3d9f5176d63
refs/heads/master
2023-08-17T05:25:58.773944
2017-10-28T02:22:15
2017-10-28T02:22:15
487,011,295
0
0
null
2023-08-11T21:14:43
2022-04-29T14:55:24
null
UTF-8
Java
false
false
579
java
package net.wesjd.towny.ngin.storage.pack.impl.java; import net.wesjd.towny.ngin.storage.pack.Packer; import org.msgpack.core.MessagePacker; import org.msgpack.core.MessageUnpacker; import java.io.IOException; import java.util.UUID; public class UUIDPacker extends Packer<UUID> { @Override public void packup(UUID packing, MessagePacker packer) throws IOException { packer.packString(packing.toString()); } @Override public UUID unbox(MessageUnpacker unpacker) throws IOException { return UUID.fromString(unpacker.unpackString()); } }
[ "gongora656@gmail.com" ]
gongora656@gmail.com
e74e76b0fe68480f3e910157d364a06092db2a29
49a1b45afec6344e2857aea74d3c656d00621843
/Hibernate/One To Many Mapping Using Annotations/src/com/VendorCustomer/TestVendorCustomer.java
949f579faebbdba1543aca80b416f7d5241ffc67
[]
no_license
manish84ya/Hibernate
444f868d190ab39a120dc759bfaa6aacccf203d1
66c918f3911c0c57c23e15f77929e9ff8ecda7f9
refs/heads/master
2020-03-26T18:13:05.962818
2018-08-18T08:09:40
2018-08-18T08:09:40
138,546,615
0
0
null
null
null
null
UTF-8
Java
false
false
2,035
java
package com.VendorCustomer; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.Transaction; import org.hibernate.cfg.AnnotationConfiguration; public class TestVendorCustomer { static AnnotationConfiguration cfg=new AnnotationConfiguration().configure(); static SessionFactory sf=cfg.buildSessionFactory(); public static void main(String[] args) { saveRecord(); //getRecord(); //updateRecord(); // DeleteRecord(); } public static void DeleteRecord() { Session s=sf.openSession(); Transaction t=s.beginTransaction(); Vendor v=(Vendor)s.get(Vendor.class,101); s.delete(v); t.commit(); s.close(); } public static void updateRecord() { Session s=sf.openSession(); Transaction t=s.beginTransaction(); Vendor v=(Vendor)s.get(Vendor.class,101); Customer c=(Customer)s.get(Customer.class,1); c.setCname("Taksh"); Set set=v.getChildren(); set.add(c); v.setChildren(set); s.update(v); t.commit(); s.close(); } public static void getRecord() { Session s=sf.openSession(); Transaction t=s.beginTransaction(); List l=s.createQuery("from Vendor").list(); for(Iterator itr=l.iterator();itr.hasNext();) { Vendor v=(Vendor)itr.next(); System.out.println("\t Vendor Name Is: "+v.getVname()); Set set=v.getChildren(); for(Iterator itr1=set.iterator();itr1.hasNext();) { Customer c=(Customer)itr1.next(); System.out.println("\t Customer Name:"+c.getCname()); } } } public static void saveRecord() { Session s=sf.openSession(); Transaction t=s.beginTransaction(); Vendor v=new Vendor(); v.setVid(101); v.setVname("MI"); Customer c=new Customer(); c.setCid(1); c.setCname("manish"); Customer c1=new Customer(); c1.setCid(2); c1.setCname("anish"); Customer c2=new Customer(); c2.setCid(3); c2.setCname("hansh"); Set set=new HashSet<>(); set.add(c); set.add(c1); set.add(c2); v.setChildren(set); s.save(v); t.commit(); s.close(); } }
[ "13Mca@#1042" ]
13Mca@#1042
57b249e4d9157d64e41e2179e390c3e06ef146d1
546d0de2a2a047915e1040bb0043f012eea7ffd0
/src/main/java/fr/univ_lille1/fil/pjea/data/builder/RabinHashCodeBuilder.java
36021ea536064db8ee6b73c42293cc71ab108612
[]
no_license
eric-ampire/PJEA-Plagiat
b8bafc485d8ab452e9331b0639341641b52d85d0
3b6ead326e40cda51d002bcbd9af813c8b722de5
refs/heads/master
2021-06-13T20:08:50.484678
2016-12-12T16:25:04
2016-12-12T16:25:04
284,855,440
2
0
null
2020-08-04T02:19:53
2020-08-04T02:19:52
null
UTF-8
Java
false
false
1,606
java
package fr.univ_lille1.fil.pjea.data.builder; import java.math.BigInteger; import java.util.LinkedList; import java.util.Queue; /** * Class based on the Rabin fingerprint algorithm. * It provide optimisations for computing hashCodes * of QGrams when iterating over TokenReader. * * This class works internally with {@link BigInteger} to * avoid overflow issues. */ public class RabinHashCodeBuilder { private BigInteger currentHashCode = BigInteger.valueOf(0); private Queue<Integer> singleHashCodes = new LinkedList<>(); private final BigInteger base; private final int nbMaxElement; private final BigInteger basePowNbMaxElementMinus1; public RabinHashCodeBuilder(int base, int nbMaxElement, int... hashCodes) { this.base = BigInteger.valueOf(base); this.nbMaxElement = nbMaxElement; this.basePowNbMaxElementMinus1 = this.base.pow(nbMaxElement - 1); putHashCode(hashCodes); } public void putHashCode(int... hashCodes) { for (int hashCode : hashCodes) putUniqueHashCode(hashCode); } private void putUniqueHashCode(int hashCode) { if (hashCode < 0) hashCode ^= (1 << 31); // change sign bit to 0 to et as positive value if (singleHashCodes.size() == nbMaxElement) { int hashToRemove = singleHashCodes.poll(); currentHashCode = currentHashCode .subtract(BigInteger.valueOf(hashToRemove).multiply(basePowNbMaxElementMinus1)); } currentHashCode = currentHashCode .multiply(base) .add(BigInteger.valueOf(hashCode)); singleHashCodes.add(hashCode); } public int getCurrentHashCode() { return currentHashCode.intValue(); } }
[ "marc.baloup@etudiant.univ-lille1.fr" ]
marc.baloup@etudiant.univ-lille1.fr
903c99adf0ac3202ae399d893e1a1856b98621a4
f1294c9cbd3add95aea14c3134840e8cf669f8f0
/enamTraders2/src/com/shujon/pojo/User.java
058b190bdfd9a7e7c94dd9ea54e4ff3c76d03840
[]
no_license
ForruQ/gitProjects
f70b3c173094247e855d5b07b42ef63ba988853b
bf8dda05593826f874973f160da0dcbcd10599d9
refs/heads/main
2023-03-05T09:03:03.133748
2021-02-18T05:27:30
2021-02-18T05:27:30
339,944,080
0
0
null
null
null
null
UTF-8
Java
false
false
943
java
package com.shujon.pojo; public class User { private int id; private String name; private String userid; private String password; private String type; public User() { } public User(int id, String name, String userid, String password, String type) { this.id = id; this.name = name; this.userid = userid; this.password = password; this.type = type; } public User(String name, String userid, String password, String type) { this.name = name; this.userid = userid; this.password = password; this.type = type; } public int getId() { return id; } public String getName() { return name; } public String getUserid() { return userid; } public String getPassword() { return password; } public String getType() { return type; } }
[ "56950250+ForruQ@users.noreply.github.com" ]
56950250+ForruQ@users.noreply.github.com
2a1b7510d462c00e40330f432c5ba2cf00772ea6
00cf990d93179f2c2f71ce5db2fcc4c92e7f3328
/src/main/java/com/example/demo/security/UserRole.java
aeefc88b50834431445251a061fb10a27f833774
[]
no_license
shubhisinha2010/CapstoneProject
671f30b115993ab845ea4155e53efb4cc3782484
983349a2d864d78974d10f1c0e28bbf88f687942
refs/heads/master
2023-04-21T22:46:39.664979
2021-05-12T07:47:00
2021-05-12T07:47:00
365,792,515
0
0
null
null
null
null
UTF-8
Java
false
false
1,259
java
package com.example.demo.security; import com.example.demo.entity.User; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; @Entity @Table(name = "user_role") public class UserRole { @Id @GeneratedValue(strategy = GenerationType.AUTO) private long userRoleId; @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "user_id") private User user; @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "role_id") private Role role; public UserRole(User user, Role role) { this.user = user; this.role = role; } public UserRole() { } public long getUserRoleId() { return userRoleId; } public void setUserRoleId(long userRoleId) { this.userRoleId = userRoleId; } public User getUser() { return user; } public void setUser(User user) { this.user = user; } public Role getRole() { return role; } public void setRole(Role role) { this.role = role; } }
[ "shusinha@BLR.ALLEGISINDIA.COM" ]
shusinha@BLR.ALLEGISINDIA.COM