blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
sequencelengths
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
sequencelengths
1
1
author_id
stringlengths
0
313
d789a786360700d3020e2c9503ecb3a992fd2547
e9affefd4e89b3c7e2064fee8833d7838c0e0abc
/aws-java-sdk-securityhub/src/main/java/com/amazonaws/services/securityhub/model/GetMasterAccountResult.java
85ad18c11b97882aa2424182b8b065c86ba61fda
[ "Apache-2.0" ]
permissive
aws/aws-sdk-java
2c6199b12b47345b5d3c50e425dabba56e279190
bab987ab604575f41a76864f755f49386e3264b4
refs/heads/master
2023-08-29T10:49:07.379135
2023-08-28T21:05:55
2023-08-28T21:05:55
574,877
3,695
3,092
Apache-2.0
2023-09-13T23:35:28
2010-03-22T23:34:58
null
UTF-8
Java
false
false
4,108
java
/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.securityhub.model; import java.io.Serializable; import javax.annotation.Generated; /** * * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/GetMasterAccount" target="_top">AWS API * Documentation</a> */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class GetMasterAccountResult extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata> implements Serializable, Cloneable { /** * <p> * A list of details about the Security Hub administrator account for the current member account. * </p> */ private Invitation master; /** * <p> * A list of details about the Security Hub administrator account for the current member account. * </p> * * @param master * A list of details about the Security Hub administrator account for the current member account. */ public void setMaster(Invitation master) { this.master = master; } /** * <p> * A list of details about the Security Hub administrator account for the current member account. * </p> * * @return A list of details about the Security Hub administrator account for the current member account. */ public Invitation getMaster() { return this.master; } /** * <p> * A list of details about the Security Hub administrator account for the current member account. * </p> * * @param master * A list of details about the Security Hub administrator account for the current member account. * @return Returns a reference to this object so that method calls can be chained together. */ public GetMasterAccountResult withMaster(Invitation master) { setMaster(master); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getMaster() != null) sb.append("Master: ").append(getMaster()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GetMasterAccountResult == false) return false; GetMasterAccountResult other = (GetMasterAccountResult) obj; if (other.getMaster() == null ^ this.getMaster() == null) return false; if (other.getMaster() != null && other.getMaster().equals(this.getMaster()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getMaster() == null) ? 0 : getMaster().hashCode()); return hashCode; } @Override public GetMasterAccountResult clone() { try { return (GetMasterAccountResult) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }
[ "" ]
ff4db673be14eeb1f7d54d36f0fd7afba49ade3a
a1737bfb0c6a79d05dbaf691a8dfbc9d19b0b61e
/src/com/qianfeng/automarking/service/QABiz.java
6cef9cabae32fa86f99e87385008cb0bcc4a9f03
[]
no_license
GitHubAndy80/automarking
a9f0e8120c9e026bf9c4a5597e74fbd495191dfa
791f662ec8a79d57c0e85d9523e72d97310419bc
refs/heads/master
2021-01-10T17:43:43.851538
2015-12-28T05:17:42
2015-12-28T05:17:42
48,566,760
0
0
null
null
null
null
GB18030
Java
false
false
3,249
java
package com.qianfeng.automarking.service; import java.util.List; import java.util.Scanner; import com.qianfeng.automarking.Main; import com.qianfeng.automarking.context.Session; import com.qianfeng.automarking.dao.StudentDao; import com.qianfeng.automarking.entity.Student; import com.qianfeng.automarking.util.CommonUtil; /** * 问答业务 * * @author HuangGuiZhao * */ public class QABiz { private static Scanner input = new Scanner(System.in); private static StudentDao studentDao = new StudentDao(); public static void showLuckyQA() { System.out.println("常用功能--->>幸运问答"); System.out.println("-------------------"); if (Session.checkIsExits("className")) { List<Student> list = studentDao.getList(Session.get("className")); if(list.size()==0){ System.out.println("当前班级不存在学员信息,快去设置学员信息吧"); Main.showMainMenu(); return; } String isContinue; do { int luckyNum = CommonUtil.getRandom(0, list.size()-1); String name = list.get(luckyNum).getName(); System.out.println("本次抽中的幸运学员:" + name); System.out.println("回答是否正确?正确请输入y,其他视为不正确"); String isRight = input.next(); if ("y".equals(isRight)) { studentDao.saveRightTime(name, Session.get("className")); list.remove(luckyNum); System.out.println("恭喜" + name + "同学,答对了,要等到下一轮才有机会回答问题了"); } else { System.out.println(name + "同学,注意了,下一次有可能还是抽到你"); studentDao.saveWrongTime(name, Session.get("className")); } System.out.println("是否继续抽学员回答问题?继续请输入y,其他视为结束"); isContinue = input.next(); } while ("y".equalsIgnoreCase(isContinue)); Main.showMainMenu(); } else { System.out.println("尚未设置全局班级信息,请设置当前班级:"); boolean result = GlobalSetBiz.setGlobalClasses(); if (result) { showLuckyQA(); } else { System.out.println("未成功设置班级信息,将退回到主菜单"); Main.showMainMenu(); } } } public static void showScoreBoard() { System.out.println("常用功能--->>幸运问答龙虎榜"); System.out.println("------------------------"); if (Session.checkIsExits("className")) { List<Student> list = studentDao.getList(Session.get("className")); System.out.println("排行榜规则:"); System.out.println("默认以答对次数来作为首要依据,如果答对次数一样,则答错次数更少的排在前面"); System.out.println("姓名\t答对次数\t答错次数"); for(int i=0;i<list.size();i++){ Student s = list.get(i); System.out.println(s.getName()+"\t"+s.getRights()+"\t"+s.getErrors()); } Main.showMainMenu(); } else { System.out.println("尚未设置全局班级信息,请设置当前班级:"); boolean result = GlobalSetBiz.setGlobalClasses(); if (result) { showLuckyQA(); } else { System.out.println("未成功设置班级信息,将退回到主菜单"); Main.showMainMenu(); } } } }
b4507f7f9a4d9476be1e2fddd2b9d2279430ac98
ed5159d056e98d6715357d0d14a9b3f20b764f89
/src/irvine/oeis/a289/A289751.java
10d639f2572cfa14b38a2fb227ae74d75b2b15b6
[]
no_license
flywind2/joeis
c5753169cf562939b04dd246f8a2958e97f74558
e5efd6971a0062ac99f4fae21a7c78c9f9e74fea
refs/heads/master
2020-09-13T18:34:35.080552
2019-11-19T05:40:55
2019-11-19T05:40:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
418
java
package irvine.oeis.a289; // Generated by gen_seq4.pl pfprime 0 4 10 +137 3 at 2019-07-30 14:36 // DO NOT EDIT here! import irvine.oeis.PowerFactorPrimeSequence; /** * A289751 Numbers k such that <code>(4*10^k + 137)/3</code> is prime. * @author Georg Fischer */ public class A289751 extends PowerFactorPrimeSequence { /** Construct the sequence. */ public A289751() { super(1, 0, 4, 10, +137, 3); } }
da2f70467bf53f9ccfcac5f9f4f1b5f988b4465b
712453a48b3ac198460d7143fec3d1e7abf812c2
/api-gateway/src/main/java/eu/opertusmundi/web/config/OAuthUserInfoDetailResolver.java
b7d826384ea5432e7608e22a7bc6a09a39e2b883
[ "Apache-2.0" ]
permissive
OpertusMundi/api-gateway-interim
1c2cdde9f684042c4e69bdfb23474b791520a30b
6d95a5ac01e30f7bf431c31db2ffc6d790dab081
refs/heads/master
2023-02-17T06:07:16.964937
2021-01-15T12:08:01
2021-01-15T12:08:01
302,048,239
0
0
null
null
null
null
UTF-8
Java
false
false
2,109
java
package eu.opertusmundi.web.config; import java.util.List; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Configuration; @Configuration @ConfigurationProperties(prefix = "opertus-mundi.auth") public class OAuthUserInfoDetailResolver { private List<String> nameAliases; private List<String> emailAliases; private List<String> localeAliases; private List<String> imageAliases; public static final String NAME_PROPERTY = "name"; public static final String EMAIL_PROPERTY = "email"; public static final String LOCALE_PROPERTY = "locale"; public static final String IMAGE_PROPERTY = "image"; public List<String> getNameAliases() { return this.nameAliases; } public void setNameAliases(List<String> nameAliases) { this.nameAliases = nameAliases; } public List<String> getEmailAliases() { return this.emailAliases; } public void setEmailAliases(List<String> emailAliases) { this.emailAliases = emailAliases; } public List<String> getLocaleAliases() { return this.localeAliases; } public void setLocaleAliases(List<String> localeAliases) { this.localeAliases = localeAliases; } public List<String> getImageAliases() { return this.imageAliases; } public void setImageAliases(List<String> imageAliases) { this.imageAliases = imageAliases; } public String resolve(String key) { if (this.nameAliases.stream().anyMatch(alias -> key.trim().equals(alias))) { return NAME_PROPERTY; } if (this.emailAliases.stream().anyMatch(alias -> key.trim().equals(alias))) { return EMAIL_PROPERTY; } if (this.localeAliases.stream().anyMatch(alias -> key.trim().equals(alias))) { return LOCALE_PROPERTY; } if (this.imageAliases.stream().anyMatch(alias -> key.trim().equals(alias))) { return IMAGE_PROPERTY; } return null; } }
eda371d70077b2d87339eade2cba7c1c41367fed
ea5e65efe44955449686a10c65c1f44fe42fd6d8
/fila/Fila.java
739e7d6781b7eafb2874c9b0104928a41a282254
[]
no_license
RafaPak/MazeSolver
283c66d56a5375e836c27fe9f535fd1d80cd4db3
bf058282d8b66c5dfc2db7b9c28719927a9bbebc
refs/heads/master
2020-06-03T13:12:50.428958
2019-06-12T13:53:37
2019-06-12T13:53:37
191,580,689
0
0
null
null
null
null
UTF-8
Java
false
false
7,193
java
package fila; import java.lang.reflect.*; /** * Armazena valores dentro de um vetor no formato Fila * @author u18057 Julia Campoli Sacco * @author u18206 Rafael Pak Bragagnolo */ public class Fila<X> implements Cloneable { /** * Cria um vetor genérico */ protected Object[] vetor; //protected String[] vetor --> ainda não tem tamanho /** * Conta quantos valores tem dentro do vetor */ protected int qtd = 0; /** * Guarda o índice do início da Fila */ protected int inicio = 0; /** * Guarda o índice do fim da Fila */ protected int fim = 0; /** * Cria um vetor genérico * @param inteiro que representa a capacidade do vetor da Fila * @throws Exception caso o valor para a capacidade seja negativo */ public Fila(int capacidade) throws Exception { if(capacidade < 0) throw new Exception("Capacidade inválida"); this.vetor = new Object[capacidade]; } /** * Método de chamar clone quando a classe é genérica * @return Retorna o clone * @param o objeto que você vai clonar da mesma classe */ protected X meuCloneDeX(X x) { X ret = null; try { Class<?> classe = x.getClass(); Class<?>[] tiposDeParametrosFormais = null; Method metodo = classe.getMethod("clone", tiposDeParametrosFormais); Object[] tiposDeParametrosReais = null; ret = (X)metodo.invoke(x,tiposDeParametrosReais); } catch(NoSuchMethodException erro) {} catch(IllegalAccessException erro) {} catch(InvocationTargetException erro) {} return ret; } /** * Guarda dentro da classe o objeto enfileirado * @throws Exception * <ul> * <li>Caso o clone esteja nulo</li> * <li>Caso a Fila esteja cheia</li> * </ul> * @param objeto genérico */ public void guarde(X s) throws Exception { if(s==null) // s.equals antes não daria certo, pois se ele for null vai dar errado já que não se pode chamar método para objeto null throw new Exception("Informação ausente"); if(this.isCheia()) throw new Exception("Fila cheia"); if(s instanceof Cloneable) { if(fim == this.vetor.length-1) { fim = 0; this.vetor[this.fim] = meuCloneDeX(s); } //this.vetor[this.qtd] = (Horario)s.clone(); else this.vetor[this.fim++] = meuCloneDeX(s); } else { if(fim == this.vetor.length-1) { fim = 0; this.vetor[this.fim] = s; } //this.vetor[this.qtd] = (Horario)s.clone(); else this.vetor[this.fim++] = s; } this.qtd++; } /** * Acessa o valor do primeiro item sem perigo de altera-lo * @return Retorna o valor do getter * @throws Exception Caso esteja vazia */ public X getUmItem() throws Exception { if(this.isVazia()) throw new Exception("Nada a recuperar"); if(this.vetor[this.inicio] instanceof Cloneable) return meuCloneDeX((X)this.vetor[this.inicio]); return (X)this.vetor[this.inicio]; } /** * Joga fora o primeiro item da Pilha * @throws Exception Caso a Fila esteja vazia */ public void jogueForaUmItem() throws Exception { if(this.isVazia()) throw new Exception("Pilha vazia"); this.vetor[this.inicio] = null; if(this.inicio == this.vetor.length-1) inicio = 0; else inicio++; qtd--; } /** * Devolve se a Fila está cheia ou não * @return Retorna se a Fila está cheia ou não */ public boolean isCheia() { return this.qtd == this.vetor.length; } /** * Devolve se a Fila está vazia ou não * @return Retorna se a Fila está vazia ou não */ public boolean isVazia() { return this.qtd == 0; } /** * Transforma o elemento em string * @return a string do objeto */ public String toString() { if(this.qtd==0) return "Vazia"; return this.qtd+" elementos, sendo o primeiro "+this.vetor[inicio]; } //compara this e obj /** * Checa se um objeto é igual ao que está sendo comparado * @return um boolean dizendo se é ou não igual * @param uma instância genérica que vai ser checar se é igual ao referente objeto */ public boolean equals (Object obj) //compara this e obj { if(this==obj) //dispensável, mas deixa método mais rápido return true; if(obj == null) return false; if(this.getClass()!=obj.getClass()) return false; Fila<X> fila = (Fila<X>)obj; // java enxerga que existe uma Fila chamada fila (que é o mesmo obj) if(this.qtd!=fila.qtd) return false; for(int i = 0, posThis=this.inicio, posFila=fila.inicio; i < this.qtd; i++, posThis=(posThis<this.vetor.length-1?posThis+1:0), posFila=(posFila<fila.vetor.length-1?posFila+1:0)) if(!this.vetor[posThis].equals(fila.vetor[posFila])) return false; return true; } /** * Gerar um código para algum objeto * @return Retorna um inteiro sendo o código hash da Classe Labirinto */ public int hashCode() { int ret = 1; //só não pode ser 0 ret = ret * 2 + new Integer(this.qtd).hashCode(); for(int i=0, pos=inicio; i<this.qtd; i++, pos=(pos<vetor.length-1?pos+1:0)) ret = ret*2 + this.vetor[pos].hashCode(); return ret; } //construtor de copia /** * Utilizado para não mexer nas variáveis da sua classe * @return um clone do objeto da classe * @throws Exception Lança exceção caso o objeto esteja nulo * @param o objeto que você vai clonar da mesma classe */ public Fila (Fila<X> modelo) throws Exception { if(modelo == null) throw new Exception("Modelo ausente"); this.qtd = modelo.qtd; this.inicio = modelo.inicio; this.fim = modelo.fim; this.vetor = new Object[modelo.vetor.length]; for(int i=0; i<modelo.vetor.length-1; i++) this.vetor[i] = modelo.vetor[i]; } /** * Cria e retorna um clone da Fila * @return Retorna um clone da Fila */ public Object clone() { Fila<X> ret = null; try { ret = new Fila<X>(this); } catch(Exception erro) {} return ret; } }
0d462ae8235014b9c936c286913a67e19de43e6c
498dd2daff74247c83a698135e4fe728de93585a
/clients/google-api-services-vision/v1p1beta1/1.30.1/com/google/api/services/vision/v1p1beta1/model/AsyncAnnotateFileResponse.java
77156c741cca2be1a98e5f7190cf0cc42757b1cc
[ "Apache-2.0" ]
permissive
googleapis/google-api-java-client-services
0e2d474988d9b692c2404d444c248ea57b1f453d
eb359dd2ad555431c5bc7deaeafca11af08eee43
refs/heads/main
2023-08-23T00:17:30.601626
2023-08-20T02:16:12
2023-08-20T02:16:12
147,399,159
545
390
Apache-2.0
2023-09-14T02:14:14
2018-09-04T19:11:33
null
UTF-8
Java
false
false
2,297
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. */ /* * This code was generated by https://github.com/googleapis/google-api-java-client-services/ * Modify at your own risk. */ package com.google.api.services.vision.v1p1beta1.model; /** * The response for a single offline file annotation request. * * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is * transmitted over HTTP when working with the Cloud Vision API. For a detailed explanation see: * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a> * </p> * * @author Google, Inc. */ @SuppressWarnings("javadoc") public final class AsyncAnnotateFileResponse extends com.google.api.client.json.GenericJson { /** * The output location and metadata from AsyncAnnotateFileRequest. * The value may be {@code null}. */ @com.google.api.client.util.Key private OutputConfig outputConfig; /** * The output location and metadata from AsyncAnnotateFileRequest. * @return value or {@code null} for none */ public OutputConfig getOutputConfig() { return outputConfig; } /** * The output location and metadata from AsyncAnnotateFileRequest. * @param outputConfig outputConfig or {@code null} for none */ public AsyncAnnotateFileResponse setOutputConfig(OutputConfig outputConfig) { this.outputConfig = outputConfig; return this; } @Override public AsyncAnnotateFileResponse set(String fieldName, Object value) { return (AsyncAnnotateFileResponse) super.set(fieldName, value); } @Override public AsyncAnnotateFileResponse clone() { return (AsyncAnnotateFileResponse) super.clone(); } }
8c7c23f851dd71f2be2a221c9e1338144af3b45e
d89d1a5b6e7261412fdf3bd36cc8e24f242ef9d6
/src/main/java/pl/edu/agh/dropper/proxy/Proxy.java
06d7e9b565128336d3cc13fdceefc2484a68e0d1
[]
no_license
fracz/dropper
db1a2533551db9baebef90f581599b896d5afff2
e82d886e26803cb31d63b2a0ff14396ae552cac4
refs/heads/master
2021-01-01T17:21:55.844224
2014-01-19T21:17:34
2014-01-19T21:17:34
13,921,527
2
1
null
null
null
null
UTF-8
Java
false
false
1,535
java
package pl.edu.agh.dropper.proxy; import java.net.InetAddress; public interface Proxy { /** * Receive next packet sent to the monitored application. This methods MUST be synchronous. * * @return packet data that was received from monitored application */ Packet receiveSource(); /** * Receives next packet sent from the destination machine to the monitored application (destination response). * This methods MUST be synchronous. * * @return packet data that was received from destination machine */ Packet receiveDestination(); /** * Sends the given packet to the monitored application. * * @param packet packet to send */ void sendSource(Packet packet); /** * Sends the given packet to the destination address. * * @param packet packet to send */ void sendDestination(Packet packet); /** * Sets the local port to listen. * * @param port port to listen for incoming data */ void setSourcePort(int port); /** * Sets the remote port where the data should be forwarded. * * @param port port where the incoming data should be forwarded */ void setDestinationPort(int port); /** * Sets the remote address where the data should be forwarded. * * @param address address where the incoming data should be forwarded */ void setDestinationAddress(InetAddress address); /** * Starts the proxy. */ void startProxy(); }
b0d9ba572ca62c93a33a95e31f3d5b907929b6c5
e30f9f9c1814a143fd338a234f695514dd07de0b
/app/build/generated/not_namespaced_r_class_sources/donateDebug/processDonateDebugResources/r/android/support/loader/R.java
2323565d33f42248875926b98091eaf951d5ea74
[ "LicenseRef-scancode-infineon-free", "Apache-2.0", "LicenseRef-scancode-public-domain" ]
permissive
xkevin190/i2pAndroidModified
6114448728b46dfe7fec1f35474a7cce119466ce
4bac4b2c8f0ab16e09ddcb6a7ef957b854b15704
refs/heads/master
2022-11-29T21:07:45.325369
2020-08-07T20:15:05
2020-08-07T20:15:05
285,911,638
0
0
null
null
null
null
UTF-8
Java
false
false
10,453
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * gradle plugin from the resource data it found. It * should not be modified by hand. */ package android.support.loader; public final class R { private R() {} public static final class attr { private attr() {} public static final int alpha = 0x7f03002b; public static final int font = 0x7f0300b9; public static final int fontProviderAuthority = 0x7f0300bb; public static final int fontProviderCerts = 0x7f0300bc; public static final int fontProviderFetchStrategy = 0x7f0300bd; public static final int fontProviderFetchTimeout = 0x7f0300be; public static final int fontProviderPackage = 0x7f0300bf; public static final int fontProviderQuery = 0x7f0300c0; public static final int fontStyle = 0x7f0300c1; public static final int fontVariationSettings = 0x7f0300c2; public static final int fontWeight = 0x7f0300c3; public static final int ttcIndex = 0x7f0301fc; } public static final class color { private color() {} public static final int notification_action_color_filter = 0x7f050054; public static final int notification_icon_bg_color = 0x7f050055; public static final int ripple_material_light = 0x7f050069; public static final int secondary_text_default_material_light = 0x7f05006b; } public static final class dimen { private dimen() {} public static final int compat_button_inset_horizontal_material = 0x7f06004e; public static final int compat_button_inset_vertical_material = 0x7f06004f; public static final int compat_button_padding_horizontal_material = 0x7f060050; public static final int compat_button_padding_vertical_material = 0x7f060051; public static final int compat_control_corner_material = 0x7f060052; public static final int compat_notification_large_icon_max_height = 0x7f060053; public static final int compat_notification_large_icon_max_width = 0x7f060054; public static final int notification_action_icon_size = 0x7f06008b; public static final int notification_action_text_size = 0x7f06008c; public static final int notification_big_circle_margin = 0x7f06008d; public static final int notification_content_margin_start = 0x7f06008e; public static final int notification_large_icon_height = 0x7f06008f; public static final int notification_large_icon_width = 0x7f060090; public static final int notification_main_column_padding_top = 0x7f060091; public static final int notification_media_narrow_margin = 0x7f060092; public static final int notification_right_icon_size = 0x7f060093; public static final int notification_right_side_padding_top = 0x7f060094; public static final int notification_small_icon_background_padding = 0x7f060095; public static final int notification_small_icon_size_as_large = 0x7f060096; public static final int notification_subtext_size = 0x7f060097; public static final int notification_top_pad = 0x7f060098; public static final int notification_top_pad_large_text = 0x7f060099; } public static final class drawable { private drawable() {} public static final int notification_action_background = 0x7f070082; public static final int notification_bg = 0x7f070083; public static final int notification_bg_low = 0x7f070084; public static final int notification_bg_low_normal = 0x7f070085; public static final int notification_bg_low_pressed = 0x7f070086; public static final int notification_bg_normal = 0x7f070087; public static final int notification_bg_normal_pressed = 0x7f070088; public static final int notification_icon_background = 0x7f070089; public static final int notification_template_icon_bg = 0x7f07008a; public static final int notification_template_icon_low_bg = 0x7f07008b; public static final int notification_tile_bg = 0x7f07008c; public static final int notify_panel_notification_icon_bg = 0x7f07008d; } public static final class id { private id() {} public static final int action_container = 0x7f080015; public static final int action_divider = 0x7f080019; public static final int action_image = 0x7f08001c; public static final int action_text = 0x7f08002d; public static final int actions = 0x7f08002e; public static final int async = 0x7f080034; public static final int blocking = 0x7f080037; public static final int chronometer = 0x7f08004b; public static final int forever = 0x7f080077; public static final int icon = 0x7f08007d; public static final int icon_group = 0x7f08007f; public static final int info = 0x7f080086; public static final int italic = 0x7f080087; public static final int line1 = 0x7f080093; public static final int line3 = 0x7f080094; public static final int normal = 0x7f0800b7; public static final int notification_background = 0x7f0800b8; public static final int notification_main_column = 0x7f0800b9; public static final int notification_main_column_container = 0x7f0800ba; public static final int right_icon = 0x7f0800d5; public static final int right_side = 0x7f0800d7; public static final int tag_transition_group = 0x7f080104; public static final int tag_unhandled_key_event_manager = 0x7f080105; public static final int tag_unhandled_key_listeners = 0x7f080106; public static final int text = 0x7f080107; public static final int text2 = 0x7f080108; public static final int time = 0x7f08010d; public static final int title = 0x7f08010e; } public static final class integer { private integer() {} public static final int status_bar_notification_info_maxnum = 0x7f090012; } public static final class layout { private layout() {} public static final int notification_action = 0x7f0a004f; public static final int notification_action_tombstone = 0x7f0a0050; public static final int notification_template_custom_big = 0x7f0a0057; public static final int notification_template_icon_group = 0x7f0a0058; public static final int notification_template_part_chronometer = 0x7f0a005c; public static final int notification_template_part_time = 0x7f0a005d; } public static final class string { private string() {} public static final int status_bar_notification_info_overflow = 0x7f0e01b9; } public static final class style { private style() {} public static final int TextAppearance_Compat_Notification = 0x7f0f012f; public static final int TextAppearance_Compat_Notification_Info = 0x7f0f0130; public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0f0132; public static final int TextAppearance_Compat_Notification_Time = 0x7f0f0135; public static final int TextAppearance_Compat_Notification_Title = 0x7f0f0137; public static final int Widget_Compat_NotificationActionContainer = 0x7f0f01a4; public static final int Widget_Compat_NotificationActionText = 0x7f0f01a5; } public static final class styleable { private styleable() {} public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f03002b }; public static final int ColorStateListItem_android_color = 0; public static final int ColorStateListItem_android_alpha = 1; public static final int ColorStateListItem_alpha = 2; public static final int[] FontFamily = { 0x7f0300bb, 0x7f0300bc, 0x7f0300bd, 0x7f0300be, 0x7f0300bf, 0x7f0300c0 }; public static final int FontFamily_fontProviderAuthority = 0; public static final int FontFamily_fontProviderCerts = 1; public static final int FontFamily_fontProviderFetchStrategy = 2; public static final int FontFamily_fontProviderFetchTimeout = 3; public static final int FontFamily_fontProviderPackage = 4; public static final int FontFamily_fontProviderQuery = 5; public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f0300b9, 0x7f0300c1, 0x7f0300c2, 0x7f0300c3, 0x7f0301fc }; public static final int FontFamilyFont_android_font = 0; public static final int FontFamilyFont_android_fontWeight = 1; public static final int FontFamilyFont_android_fontStyle = 2; public static final int FontFamilyFont_android_ttcIndex = 3; public static final int FontFamilyFont_android_fontVariationSettings = 4; public static final int FontFamilyFont_font = 5; public static final int FontFamilyFont_fontStyle = 6; public static final int FontFamilyFont_fontVariationSettings = 7; public static final int FontFamilyFont_fontWeight = 8; public static final int FontFamilyFont_ttcIndex = 9; public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 }; public static final int GradientColor_android_startColor = 0; public static final int GradientColor_android_endColor = 1; public static final int GradientColor_android_type = 2; public static final int GradientColor_android_centerX = 3; public static final int GradientColor_android_centerY = 4; public static final int GradientColor_android_gradientRadius = 5; public static final int GradientColor_android_tileMode = 6; public static final int GradientColor_android_centerColor = 7; public static final int GradientColor_android_startX = 8; public static final int GradientColor_android_startY = 9; public static final int GradientColor_android_endX = 10; public static final int GradientColor_android_endY = 11; public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 }; public static final int GradientColorItem_android_color = 0; public static final int GradientColorItem_android_offset = 1; } }
4ace1bee7d66da29381c75d904289e4dfd6df367
515bc9c5139d0e4e22a3a3c98ee39066eb7c6de4
/app/src/androidTest/java/com/southman/southmanclient/ExampleInstrumentedTest.java
630121e3c645e7de4f7491ebc069e27c27c424cd
[]
no_license
mukulraw/southman-client
215ef46d3727e80bffaa6c29ea56b9606c948f4c
6f7f77fb4a646a1c2219bcbcb68e451c6a230333
refs/heads/master
2020-05-26T15:48:31.634214
2020-01-04T06:58:09
2020-01-04T06:58:09
188,292,989
0
1
null
null
null
null
UTF-8
Java
false
false
738
java
package com.southman.southmanclient; 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.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.southman.southmanclient", appContext.getPackageName()); } }
0bcb1ea447c27eda0a20f715e88ff380141f0f4b
830c03ca274a8f069109d9a48d13e0e646ef3ab8
/SpringMvcDemo/src/com/zdcf/tool/Aes.java
9cdcb50b8654d78d401ba4d159ea33d7d3b89e40
[]
no_license
huangleisir/albert
ba8e176d2cca66e0d611f28d36402f97d6762068
d8738b7f41a00ae1f6af672b4eff95f078e24ad5
refs/heads/master
2020-12-02T06:28:37.858912
2017-07-10T15:32:10
2017-07-10T15:32:10
96,840,911
1
0
null
2017-07-11T02:18:08
2017-07-11T02:18:08
null
UTF-8
Java
false
false
1,838
java
package com.zdcf.tool; import java.security.Key; import java.security.MessageDigest; import javax.crypto.Cipher; import javax.crypto.spec.IvParameterSpec; import javax.crypto.spec.SecretKeySpec; import org.apache.commons.codec.binary.Base64; /** * aes加密算法 * @author 图灵机器人 * */ public class Aes { private Key key; /** * AES CBC模式使用的Initialization Vector */ private IvParameterSpec iv; /** * Cipher 物件 */ private Cipher cipher; /** * 构造方法 * @param strKet * 密钥 */ public Aes(String strKey) { try { this.key = new SecretKeySpec(getHash("MD5", strKey), "AES"); this.iv = new IvParameterSpec(new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }); this.cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); } catch (final Exception ex) { throw new RuntimeException(ex.getMessage()); } } /** * 加密方法 * * 说明:采用128位 * * @return 加密结果 */ public String encrypt(String strContent) { try { byte[] data = strContent.getBytes("UTF-8"); cipher.init(Cipher.ENCRYPT_MODE, key, iv); byte[] encryptData = cipher.doFinal(data); String encryptResult = new String(Base64.encodeBase64( encryptData), "UTF-8"); return encryptResult; } catch (Exception ex) { throw new RuntimeException(ex.getMessage()); } } /** * * @param algorithm * @param text * @return */ private static byte[] getHash(String algorithm, String text) { try { byte[] bytes = text.getBytes("UTF-8"); final MessageDigest digest = MessageDigest.getInstance(algorithm); digest.update(bytes); return digest.digest(); } catch (final Exception ex) { throw new RuntimeException(ex.getMessage()); } } }
e2a65a95f9d99743af1e51b4c4f1240fd590a2de
8c81eeaa4bde7c4f9e402c1647940de5deb146fc
/src/CreateTree.java
f23ae39518e128529bc7e3a9c83a1d6e41334f1b
[]
no_license
Luciwar/Example
f4b51b53eef6189ba18ea7714f5ee38be4287864
15b5d4d48e930d75597555b1c9c128b8501812f4
refs/heads/master
2020-06-04T23:41:07.098593
2018-10-11T15:31:24
2018-10-11T15:31:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,450
java
package Utils; import java.util.HashMap; import java.util.Scanner; /** * Created by Trung on 10/19/2017. */ public class CreateTree { /** * Source: GeeksForGeeks.org * Input format: * # of edges * Nodes * * Example: For a tree * 1 * / \ * 2 3 * / \ * 4 5 * * Input will be: * 4 * 1 2 L 1 3 R 2 4 L 3 5 R * * @return A tree */ public static TreeNode readConsole() { TreeNode root; Scanner sc = new Scanner(System.in); HashMap<Integer, TreeNode> m = new HashMap<>(); int n = 0; if (sc.hasNext()) n = sc.nextInt(); root = null; while (n > 0 && sc.hasNext()) { int n1 = sc.nextInt(); int n2 = sc.nextInt(); char lr = sc.next().charAt(0); // cout << n1 << " " << n2 << " " << (char)lr << endl; TreeNode parent = m.get(n1); if (parent == null) { parent = new TreeNode(n1); m.put(n1, parent); if (root == null) root = parent; } TreeNode child = new TreeNode(n2); if (lr == 'L') parent.setLeft(child); else parent.setRight(child); m.put(n2, child); n--; } return root; } }
9e63b88ea091f6d5c6eda7272e8e29f142746403
8238ff3c0385616190f2f975a30f6e912708468f
/src/main/java/dbstructure/CommonAllTablesDump/dto/IndexDTO.java
770ef07aaf9ca6deff9a3d6c915d2e60274efaba
[]
no_license
kpavn/DBStructureDump
31601a583656f558abb91d59be77b1ffa2704a04
50d10ee3ee2cc3a99277debb3a35439b1d2435d3
refs/heads/master
2020-05-30T14:02:58.976069
2013-06-02T09:39:31
2013-06-02T09:39:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,212
java
package dbstructure.CommonAllTablesDump.dto; import java.util.ArrayList; import java.util.List; public final class IndexDTO { public IndexDTO(final String strIndexName, boolean boolIsPrimaryKey, boolean boolIsUnique, boolean boolIsClustered) { this.strIndexName = strIndexName; this.boolIsPrimaryKey = boolIsPrimaryKey; this.boolIsUnique = boolIsUnique; this.boolIsClustered = boolIsClustered; this.columnList = new ArrayList<IndexColumnDTO>(); if (this.boolIsPrimaryKey) { this.boolIsUnique = true; } } /* * Add */ public void addColumn(final IndexColumnDTO indexColumnDTO) { columnList.add(indexColumnDTO); } /* * Get */ public String getIndexName() { return strIndexName; } public boolean isClustered() { return boolIsClustered; } public boolean isPrimaryKey() { return boolIsPrimaryKey; } public boolean isUnique() { return boolIsUnique; } public List<IndexColumnDTO> getColumnList() { return columnList; } private String strIndexName; private boolean boolIsPrimaryKey; private boolean boolIsUnique; private boolean boolIsClustered; private List<IndexColumnDTO> columnList; }
97f810603e8543998255bab4fd243bfaca773d5d
14969bca270ed8dd5b90e0cf27f502d725a76f84
/src/zones/underwater/characters/Whalesknighter.java
7c08c52c1abef278f834b102902f5b70b0f077e6
[ "MIT" ]
permissive
didizlatkova/PatternShooter
b20cc506e0dc8591a4397e79b0ab36cc92117610
14380b29790e4df538d4f897986e46cdefad1488
refs/heads/master
2016-08-11T11:17:44.065902
2015-06-18T12:31:32
2015-06-18T12:31:32
36,864,993
0
0
null
null
null
null
UTF-8
Java
false
false
383
java
package zones.underwater.characters; import zones.underwater.weapons.Harpoon; import elements.abstracts.characters.Enemy; public class Whalesknighter extends Enemy { public Whalesknighter(int healthPoints) { super(new Harpoon(), healthPoints); } @Override public String toString() { return "WK"; } @Override public String getName() { return "Whalesknighter"; } }
4180b5f4b99f2c37ecaa61f3b0c47e5ca3612323
112e2ca16bef079d24323d6a784442ddf2b1ed79
/ivt-lab-master/src/main/java/hu/bme/mit/spaceship/TorpedoStore.java
44a257011db557cd1ef5ed6d074ee659df2e0a9b
[ "MIT" ]
permissive
Hbrndzs/ivt-lab
4e1fa036e919795ec446a626ef056fbc3d05a9b7
f35d6cdd634fdda0907bc562e0d95dd77c66bcd4
refs/heads/master
2020-03-10T12:52:53.342734
2018-04-27T11:37:31
2018-04-27T11:37:31
129,387,101
0
0
null
2018-04-27T11:42:08
2018-04-13T10:28:14
Java
UTF-8
Java
false
false
1,374
java
package hu.bme.mit.spaceship; import java.util.Random; /** * Class storing and managing the torpedoes of a ship */ public class TorpedoStore { private double torpedoFailtureRate = 0.0; private int torpedoCount = 0; private Random generator = new Random(); public TorpedoStore(int numberOfTorpedos){ this.torpedoCount = numberOfTorpedos; // update failure rate if it was specified in an environment variable String failureEnv = System.getenv("IVT_RATE"); if (failureEnv != null){ try { torpedoFailtureRate = Double.parseDouble(failureEnv); } catch (NumberFormatException nfe) { torpedoFailtureRate = 0.0; } } } public boolean fire(int numberOfTorpedos){ if(numberOfTorpedos < 1 || numberOfTorpedos > this.torpedoCount){ throw new IllegalArgumentException("numberOfTorpedos"); } boolean success = false; // simulate random overheating of the launcher bay which prevents firing double r = generator.nextDouble(); if (r >= torpedoFailtureRate) { // successful firing this.torpedoCount -= numberOfTorpedos; success = true; } else { // simulated failure success = false; } return success; } public boolean isEmpty(){ return this.torpedoCount <= 0; } public int getTorpedoCount() { return this.torpedoCount; } }
f486b586961a8f820fa3b318066ae1bd192e4d20
b6348b1d326e2ab442c7fb9ef1cec04da1f8f0b7
/app/src/main/java/com/appavate/motoparking/MapsActivity.java
42b1df754ec4fd5493ba9d0d8d9f672286dccad9
[]
no_license
nzjjay/AucklandMotoParking
8023d709b5e36465f251a8acba4c5f049637e3c9
c9cb66ee7c91aa2610230fc0530aa2b5146c51eb
refs/heads/master
2021-05-29T18:09:33.246924
2015-09-15T08:47:07
2015-09-15T08:47:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,159
java
package com.appavate.motoparking; import android.content.Intent; import android.content.SharedPreferences; import android.support.v4.app.FragmentActivity; import android.os.Bundle; import android.support.v7.app.ActionBarActivity; import android.util.Log; import android.util.Xml; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.widget.ScrollView; import android.widget.TextView; import com.google.android.gms.ads.AdRequest; import com.google.android.gms.ads.AdView; import com.google.android.gms.maps.CameraUpdate; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.Marker; import com.google.android.gms.maps.model.MarkerOptions; import org.xmlpull.v1.XmlPullParser; import java.io.InputStream; public class MapsActivity extends ActionBarActivity { private GoogleMap mMap; // Might be null if Google Play services APK is not available. @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_maps); setUpMapIfNeeded(); ManageAd(); } @Override protected void onResume() { super.onResume(); setUpMapIfNeeded(); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu, menu); return true; } // Leave this alone - works @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { /*case R.id.action_add: Intent aIntent = new Intent(this, Add.class); startActivity(aIntent); break;*/ case R.id.action_about: Intent bIntent = new Intent(this, About.class); startActivity(bIntent); break; } return true; } private void setUpMapIfNeeded() { // Do a null check to confirm that we have not already instantiated the map. if (mMap == null) { // Try to obtain the map from the SupportMapFragment. mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)) .getMap(); mMap.setInfoWindowAdapter(new GoogleMap.InfoWindowAdapter() { @Override public View getInfoWindow(Marker arg0) { return null; } @Override public View getInfoContents(Marker marker) { View myContentView = getLayoutInflater().inflate( R.layout.custommarker, null); TextView tvTitle = ((TextView) myContentView .findViewById(R.id.title)); tvTitle.setText(marker.getTitle()); TextView tvSnippet = ((TextView) myContentView .findViewById(R.id.snippet)); tvSnippet.setText(marker.getSnippet()); return myContentView; } }); // Check if we were successful in obtaining the map. if (mMap != null) { setUpMap(); } } } private void setUpMap() { SetLocation(); try { InputStream is = getAssets().open("cbd.xml"); XmlPullParser xpp = Xml.newPullParser(); xpp.setInput(is, null); int eventType = xpp.getEventType(); String name = ""; String description = ""; // String coordinates = ""; double lat = 0; double lon = 0; while (eventType != XmlPullParser.END_DOCUMENT) { if(eventType == XmlPullParser.START_TAG) { //We look for "title" tag in XML response if (xpp.getName().equalsIgnoreCase("name")) { name = xpp.nextText(); } if (xpp.getName().equalsIgnoreCase("description")) { description = xpp.nextText(); } if (xpp.getName().equalsIgnoreCase("coordinates")) { String coordinates = xpp.nextText(); String[] separated = coordinates.split(","); lon = Double.parseDouble(separated[0]); lat = Double.parseDouble(separated[1]); } } if(!name.equals("") && !description.equals("") && lat != 0 && lon != 0) { mMap.addMarker(CreateMarker(lat, lon, name, description)); } eventType = xpp.next(); } // indicate app done reading the resource. // xpp.close(); } catch (Exception e) { Log.d("EXCEPT", "Exception in parsing " + e); } // This is where things are added // mMap.addMarker(CreateMarker(-36.850868, 174.764414, "TEST", "TEST DESCRIPTION")); } // WORKS private MarkerOptions CreateMarker(double lat, double lon, String title, String description) { MarkerOptions markerOptions = new MarkerOptions(); markerOptions.position(new LatLng(lat, lon)); markerOptions.title(title); markerOptions.snippet(description); return markerOptions; } // WORKS private void SetLocation() { CameraUpdate point = CameraUpdateFactory.newLatLngZoom(new LatLng(-36.8508, 174.76), 15); // moves camera to coordinates mMap.moveCamera(point); // animates camera to coordinates mMap.animateCamera(point); } // JAY - Leave this alone - works private void ManageAd() { // Ads and Payment verification area AdView adView = (AdView) this.findViewById(R.id.adView); // ScrollView _scrollView = (ScrollView) this.findViewById(R.id._scrollview); SharedPreferences myPrefs = getSharedPreferences("Pref", MODE_PRIVATE); Boolean paid = myPrefs.getBoolean("paid", false); // Boolean paid = false; if(paid == false) { // Look up the AdView as a resource and load a request. AdRequest adRequest = new AdRequest.Builder().build(); adView.setVisibility(AdView.VISIBLE); adView.loadAd(adRequest); } else if (paid == true) { adView.destroy(); if (adView.getVisibility() == AdView.VISIBLE) { adView.setVisibility(AdView.GONE); // _scrollView.setLayoutParams(new ActionBar.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.FILL_PARENT)); } } } }
3884d4ab9eb404c907dba3c0a39b79efe7f90bfe
be89141cd462631579fbdde5c300eb6139162473
/practica3-sa/src/main/java/com/practica1/sa/web/app/Logic/Datos.java
24bbdb076b1f34893ee04e4b047514693717cfed
[]
no_license
jmorejon/practica5SA
3cb08ba9799b7ff6b645ad2aaf67fd378582cca6
b998969e60407ff6b6d750bc6164dadcf74a8a52
refs/heads/master
2022-12-09T10:22:23.816288
2020-09-12T04:17:50
2020-09-12T04:17:50
294,867,222
0
0
null
null
null
null
UTF-8
Java
false
false
515
java
package com.practica1.sa.web.app.Logic; import java.util.ArrayList; import java.util.List; import com.practica1.sa.web.app.Entity.*; public class Datos { public List<Cliente> clientes; private int contador; public Datos() { this.contador =0; clientes = new ArrayList<>(); clientes.add(new Cliente(1,"Luisa")); clientes.add(new Cliente(2,"Marina")); clientes.add(new Cliente(3,"Alba")); clientes.add(new Cliente(4,"Liliana")); } public int getContadorPedidos() { return contador++; } }
4319e430c031f9e8721fc09aec209efb27846147
02317d9e4728f0548492132be91b271a84d43b02
/src/main/java/com/evilsay/ship/Enums/ShopStatusEnum.java
3fec6f0035a7c5b0b636703daa459bbe9e0eb193
[]
no_license
zouopen/CampusShopOnline
abe416024ea5f7ba140510be56403f028c8c2812
ed5e7985c17decfe0156e1a570b2924f4cf0d323
refs/heads/master
2022-12-10T15:19:19.656198
2019-12-10T12:37:03
2019-12-10T12:37:03
201,961,559
1
0
null
2022-12-07T04:34:04
2019-08-12T15:50:21
JavaScript
UTF-8
Java
false
false
449
java
package com.evilsay.ship.Enums; import lombok.Getter; /** * @Author: EvilSay * @Date: 2019/1/21 1:03 */ @Getter public enum ShopStatusEnum implements CodeEnum { ONLINE(0,"营业时间"), OFFLINE(1,"非营业时间"), ERROR_CLOSE_SHOP(2,"打烊异常"), ; private Integer code; private String message; ShopStatusEnum(Integer code, String message) { this.code = code; this.message = message; } }
98c9fcebee66ea7a854d6732e7349b5dbeffae12
9c26ad4cb26fcdc5c2f1fd7b501850f6776e8a1c
/MusicFerretCode/src/GenreParrallel.java
de1ea5defcc02754c2d6ee23379bab9f1af34bce
[]
no_license
winstoww/CSCI201FinalProject
c1cb4e2f7d59f8ae703ac127da4643b72c95a74d
5bc0108b721c374470bf2db1edc0b79ef3ca4669
refs/heads/master
2022-04-27T16:54:13.355049
2020-04-27T05:36:39
2020-04-27T05:36:39
251,076,158
0
3
null
2020-04-11T23:59:30
2020-03-29T16:17:33
Java
UTF-8
Java
false
false
2,074
java
import java.text.DecimalFormat; import java.util.ArrayList; import java.util.concurrent.RecursiveTask; public class GenreParrallel extends RecursiveTask<Double>{ protected Profile curr; protected Profile other; public GenreParrallel(Profile curr, Profile other) { this.curr=curr; this.other = other; } public Double compute() { ArrayList<Integer> curr_genres= curr.getGenres(); ArrayList<Integer> other_genres= other.getGenres(); // Integer min_index_curr=-1; // Integer min_index_other=-1; Double min_score= Double.MAX_VALUE;// will store the value corresponding to most liked genre by the two profiles(an average) // low values correspond to the user liking the genre more so will be looking for the min value for(int i=0; i<curr_genres.size();i++) { Double temp_score= Math.abs((double) ((curr_genres.get(i) + other_genres.get(i))/2.0) );// getting the average score for each genre if(temp_score< min_score) { min_score= temp_score;// if this score is bettter (lower) than the min, we have found a new min (i.e a new best liked genre) } } ; // using transformations to convert scores to between a range of 0-1 min_score *=2; min_score -=1; Double OldValue= min_score; Double OldMin= new Double(1); Double NewMin= new Double(0); Double OldRange = (new Double(10) - new Double(1)) ; Double NewRange = (new Double(1) - new Double(0)) ; Double score= ( 1- (((OldValue - OldMin) * NewRange) / OldRange) + NewMin); System.out.println(other.getName() + "'s genre score= "+ score); return score; } //Formula to calculate distance between current location and destination public static double distance(double lat1, double lat2, double long1, double long2) { double total = 3963.0 * Math.acos( Math.sin(Math.toRadians(lat1))*Math.sin(Math.toRadians(lat2)) + Math.cos(Math.toRadians(lat1))*Math.cos(Math.toRadians(lat2))*Math.cos(Math.toRadians(long2 - long1)) ); DecimalFormat df2 = new DecimalFormat("#.#"); return Double.parseDouble(df2.format(total)); } }
83eba4e11e635e3483595ad4107f76419f0b6d3d
76ffb7d4b7bf48e2553909c76c1edb51be6ead95
/AttendanceApp/src/edu/upenn/cis350/AttendanceAppActivityTest.java
641415a0a0bdbf65084b3b7b3677eb04ee35d3a7
[]
no_license
jkodner05/NetterProject
b65b4069b7a1235e72a96cf447eb7733daab5f23
3938985de455bd6da188b30f2d6d87b537001653
refs/heads/master
2021-01-15T21:02:50.559741
2012-03-10T00:21:02
2012-03-10T00:21:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
412
java
package edu.upenn.cis350; import android.app.Activity; import android.test.ActivityInstrumentationTestCase2; import android.widget.Button; import android.widget.ListView; public class AttendanceAppActivityTest extends ActivityInstrumentationTestCase2<AttendanceAppActivity> { public AttendanceAppActivityTest(Class<AttendanceAppActivity> activityClass) { super(activityClass); } }
72d883d3325bb1afabfbc5b731715084c3c9a20b
5497ce6535fa5c0508f326a94aea380a1ec3d4b6
/android/app/src/debug/java/com/second_nature_recipes/ReactNativeFlipper.java
8ec8549ea89dba1f94b3eb66b654ee4d09a0621d
[]
no_license
Marc-Cilliers/react_native_recipes
99b731769b9787a23e2a4e718c924bdcbbbce269
e58fcf5f5ec21b273388bd6e532ed00addb0fc46
refs/heads/master
2022-11-10T22:17:21.615654
2020-07-07T17:18:00
2020-07-07T17:18:00
277,878,950
0
0
null
null
null
null
UTF-8
Java
false
false
3,276
java
/** * Copyright (c) Facebook, Inc. and its affiliates. * * <p>This source code is licensed under the MIT license found in the LICENSE file in the root * directory of this source tree. */ package com.second_nature_recipes; import android.content.Context; import com.facebook.flipper.android.AndroidFlipperClient; import com.facebook.flipper.android.utils.FlipperUtils; import com.facebook.flipper.core.FlipperClient; import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin; import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin; import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin; import com.facebook.flipper.plugins.inspector.DescriptorMapping; import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin; import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor; import com.facebook.flipper.plugins.network.NetworkFlipperPlugin; import com.facebook.flipper.plugins.react.ReactFlipperPlugin; import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin; import com.facebook.react.ReactInstanceManager; import com.facebook.react.bridge.ReactContext; import com.facebook.react.modules.network.NetworkingModule; import okhttp3.OkHttpClient; public class ReactNativeFlipper { public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { if (FlipperUtils.shouldEnableFlipper(context)) { final FlipperClient client = AndroidFlipperClient.getInstance(context); client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults())); client.addPlugin(new ReactFlipperPlugin()); client.addPlugin(new DatabasesFlipperPlugin(context)); client.addPlugin(new SharedPreferencesFlipperPlugin(context)); client.addPlugin(CrashReporterPlugin.getInstance()); NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin(); NetworkingModule.setCustomClientBuilder( new NetworkingModule.CustomClientBuilder() { @Override public void apply(OkHttpClient.Builder builder) { builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin)); } }); client.addPlugin(networkFlipperPlugin); client.start(); // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized // Hence we run if after all native modules have been initialized ReactContext reactContext = reactInstanceManager.getCurrentReactContext(); if (reactContext == null) { reactInstanceManager.addReactInstanceEventListener( new ReactInstanceManager.ReactInstanceEventListener() { @Override public void onReactContextInitialized(ReactContext reactContext) { reactInstanceManager.removeReactInstanceEventListener(this); reactContext.runOnNativeModulesQueueThread( new Runnable() { @Override public void run() { client.addPlugin(new FrescoFlipperPlugin()); } }); } }); } else { client.addPlugin(new FrescoFlipperPlugin()); } } } }
685d67648b92680225c7fd4f770d8f6569592d12
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/22/22_758b398893395d5d52d3df897a6772cdc5ccd1d6/Seed/22_758b398893395d5d52d3df897a6772cdc5ccd1d6_Seed_t.java
d8434003d77175aa5e28625a79fbc09bb9786b5d
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
2,553
java
package EvolvingPlants; import java.awt.Graphics; import tools.RandTools; public class Seed extends PlantPart { private Stem[] stems = null; public boolean germinated = false; double xMod = 0; private double energyPerGrow; public Seed(Plant thisPlant, float x, float y) { super(thisPlant, x, y); energy = thisPlant.genes.seedEnergy; energyPerGrow = thisPlant.genes.energyTransfer * Math.pow(thisPlant.genes.energyTransfer + 0.2, 1.25); xMod = RandTools.getDouble(-thisPlant.genes.seedSpread, thisPlant.genes.seedSpread); } @Override public void tick() { if (!germinated) { if (y < Main.frame.getHeight() - 30) { y += 2; thisPlant.y += 2; double var = (RandTools.getDouble(-xMod, xMod) / 2); x += xMod + var; thisPlant.x += xMod + var; } else if (!thisPlant.genes.germinate) thisPlant.exists = false; else if (stems == null) { germinate(); } } else { for (Stem s : stems) { s.tick(); if (energy > 0) { energy -= energyPerGrow; s.energy += energyPerGrow; } } } } @Override public void render(Graphics g) { if (stems != null) for (Stem s : stems) s.render(g); if (Main.world.viewSeeds) { g.setColor(thisPlant.seedColour); int seedSize = (int) (energy / 15); g.fillOval(Math.round(x - (seedSize / 2)), Math.round(y - (seedSize / 2)), seedSize, seedSize); } } public void germinate() { if (energy > thisPlant.genes.seedEnergy / 2) { energy -= 0.4; if (thisPlant.genes.germinate && Main.world.isSpaceToGerminate(thisPlant)) { germinated = true; if (thisPlant.parentOne != null && thisPlant.parentTwo != null) { thisPlant.parentOne.numGerminatedOffspring++; thisPlant.parentTwo.numGerminatedOffspring++; } int numStems = (int) Math.min(thisPlant.numberOfStemsLeft, thisPlant.genes.numberOfSeedStems); stems = new Stem[numStems]; for (int i = 0; i < numStems; i++) stems[i] = new Stem(thisPlant, x, y); thisPlant.numberOfStemsLeft -= numStems; } } else thisPlant.exists = false; } }
118afaab5a7682bd89330c6acd5df1e2e8420590
4c917a0a66f478be281e00bc354fa32c7dc2f9b5
/telegram-emoji/src/main/java/kani/aitkulov/telegram_emoji/ui/EmojiTextView.java
2c97a3cdf3c9b64c820b86479066164b91105853
[]
no_license
kaitkulov/TelegramEmoji
5c80467b941c409eacd94b38b7251e46dbef4ad1
90d4f5fb25300d3a16e3b9de32608907a6f77a3d
refs/heads/master
2020-04-02T01:50:31.171089
2018-02-22T06:06:09
2018-02-22T06:06:09
83,459,575
4
1
null
2018-02-22T06:06:09
2017-02-28T17:17:03
Java
UTF-8
Java
false
false
2,503
java
/* * Copyright 2014 Hieu Rocker * * 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 kani.aitkulov.telegram_emoji.ui; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Paint; import android.text.TextPaint; import android.text.TextUtils; import android.util.AttributeSet; import android.widget.TextView; import kani.aitkulov.telegram_emoji.Emoji; import kani.aitkulov.telegram_emoji.R; /** * @author Kanimet Aitkulov ([email protected]) */ public class EmojiTextView extends TextView { private int mEmojiSize; private int mEmojiTextSize; private TextPaint textPaintEmoji; public EmojiTextView(Context context) { super(context); init(null); } public EmojiTextView(Context context, AttributeSet attrs) { super(context, attrs); init(attrs); } public EmojiTextView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); init(attrs); } private void init(AttributeSet attrs) { mEmojiTextSize = (int) getTextSize(); if (attrs == null) { mEmojiSize = (int) getTextSize(); } else { TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.Emoji); mEmojiSize = (int) a.getDimension(R.styleable.Emoji_emojiSize, getTextSize()); a.recycle(); } textPaintEmoji = new TextPaint(Paint.ANTI_ALIAS_FLAG); textPaintEmoji.setTextSize(mEmojiSize); setText(getText()); } @Override public void setText(CharSequence text, BufferType type) { if (!TextUtils.isEmpty(text)) { text = Emoji.replaceEmoji(text, textPaintEmoji.getFontMetricsInt(), mEmojiTextSize, false); } super.setText(text, type); } public void setEmojiSize(int pixels) { mEmojiSize = pixels; textPaintEmoji.setTextSize(mEmojiSize); super.setText(getText()); } }
c7f4a82fb5bab9b28a7ab84b7246e673e61031f8
048f731b8914fa175eb14c6b95b7ce38eb61eb79
/microservicios-usuarios/src/main/java/com/example/microserviciosusuarios/client/CursoFeignClient.java
d143eec6f65b180f90b1fbd514761b53118dea0a
[]
no_license
Selphyz/microservicios-spring-eureka
2fccb2371fb43bc3ed0a297bb35f56f0b639bc35
f8038fdb14d11e5727f4152fc4f90673eb59d460
refs/heads/main
2023-08-11T00:53:43.364651
2021-09-13T23:46:42
2021-09-13T23:46:42
402,212,831
0
0
null
null
null
null
UTF-8
Java
false
false
423
java
package com.example.microserviciosusuarios.client; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.PathVariable; @FeignClient(name = "microservicio-cursos") public interface CursoFeignClient { @DeleteMapping("/eliminar-alumno/{id}") public void eliminarCursoAlumnoPorId(@PathVariable Long id); }
c45f83d5df89bd635cf9427a4f8989a7c3d73ba6
c019d248921402edc252461845122bfdb6f60b5e
/app/src/main/java/com/example/hungrykya/ui/collection/list/CollectionRestaurantList.java
6971462ffe2a0a7d376419a4e6fe727c8fb85a02
[]
no_license
abhishal76/HungryKya
35116f680709b2f62fe634a83f9235d1a556b4ec
dc2548fe5b01b2cd5e9434c1d23e49f148fd25ac
refs/heads/master
2022-04-03T15:07:57.342385
2019-11-29T19:33:17
2019-11-29T19:33:17
224,912,095
0
0
null
null
null
null
UTF-8
Java
false
false
6,251
java
package com.example.hungrykya.ui.collection.list; import android.content.Intent; import android.os.Bundle; import com.example.hungrykya.Modal.modal.Restaurant.Photo; import com.example.hungrykya.Modal.modal.Restaurant.Restaurant; import com.example.hungrykya.Modal.modal.Restaurant.RestaurantList; import com.example.hungrykya.api.ZomataApi; import com.example.hungrykya.ui.collection.CollectionRestaurantDetailActivity; import com.example.hungrykya.ui.collection.adapter.CollectionRestaurantListAdapter; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; import retrofit2.Retrofit; import retrofit2.converter.gson.GsonConverterFactory; import android.os.Parcelable; import android.util.Log; import android.view.MenuItem; import android.view.View; import android.widget.AdapterView; import android.widget.ListView; import com.example.hungrykya.R; import java.io.Serializable; import java.util.ArrayList; import java.util.List; public class CollectionRestaurantList extends AppCompatActivity { ZomataApi zomataApi; ArrayList<Restaurant> restaurantArrayList = new ArrayList<>(); ListView resCollectionListView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_collection_restaurant_list); Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); Intent getCollectionIdIntent = getIntent(); String collectionId =getCollectionIdIntent.getStringExtra("collection_id"); final Retrofit retrofit = new Retrofit.Builder() .baseUrl("https://developers.zomato.com/api/v2.1/") .addConverterFactory(GsonConverterFactory.create()) .build(); zomataApi = retrofit.create(ZomataApi.class); resCollectionListView = findViewById(R.id.resCollectionLV); Call<RestaurantList> collectionRestaurantListCall = zomataApi.getCollectionRestaurant("0a1faec1157469592a4ba67285a7c837", collectionId, Double.valueOf(getCollectionIdIntent.getStringExtra("lat")) , Double.valueOf(getCollectionIdIntent.getStringExtra("lon"))); collectionRestaurantListCall.enqueue(new Callback<RestaurantList>() { @Override public void onResponse(Call<RestaurantList> call, Response<RestaurantList> response) { if (response.code() == 200){ RestaurantList restaurantList = response.body(); for (int i = 0; i<restaurantList.getRestaurants().size(); i++){ restaurantArrayList.add(restaurantList.getRestaurants().get(i)); } CollectionRestaurantListAdapter collectionRestaurantListAdapter = new CollectionRestaurantListAdapter(getApplicationContext(), R.layout.restaurant_collection, restaurantArrayList ); resCollectionListView.setAdapter(collectionRestaurantListAdapter); resCollectionListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) { String resName = restaurantArrayList.get(i).getRestaurant().getName(); String resAddress = restaurantArrayList.get(i).getRestaurant().getLocation().getAddress(); String resLocality = restaurantArrayList.get(i).getRestaurant().getLocation().getLocality(); String resCuisines = restaurantArrayList.get(i).getRestaurant().getCuisines(); String resAverageCost = restaurantArrayList.get(i).getRestaurant().getAverageCostForTwo().toString(); String resTimings = restaurantArrayList.get(i).getRestaurant().getTimings(); ArrayList<String> resHighlights = restaurantArrayList.get(i).getRestaurant().getHighlights(); String resRating = restaurantArrayList.get(i).getRestaurant().getUserRating().getAggregateRating(); ArrayList<Photo> test =restaurantArrayList.get(i).getRestaurant().getPhotos(); Intent collectionRestaurantActivityIntent = new Intent(view.getContext(), CollectionRestaurantDetailActivity.class); collectionRestaurantActivityIntent.putExtra("resName", resName); collectionRestaurantActivityIntent.putExtra("resAddress", resAddress); collectionRestaurantActivityIntent.putExtra("resLocality", resLocality); collectionRestaurantActivityIntent.putExtra("resCuisines", resCuisines); collectionRestaurantActivityIntent.putExtra("resAverageCost", resAverageCost); collectionRestaurantActivityIntent.putExtra("resTimings", resTimings); collectionRestaurantActivityIntent.putExtra("resRating", resRating); collectionRestaurantActivityIntent.putStringArrayListExtra("resHighlights", resHighlights); collectionRestaurantActivityIntent.putExtra("test",(ArrayList<Photo>) test ); startActivity(collectionRestaurantActivityIntent); } }); } else { Log.e("RETRY", "retry"); } } @Override public void onFailure(Call<RestaurantList> call, Throwable t) { } }); } @Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); if (id == android.R.id.home){ this.finish(); } return true; } }
42632e2b2332bd14eaefa23daf68d117f136a893
e94283089810516f048bd58590036c88588112cb
/src/S0145BinaryTreePostorderTraversal.java
2f9d9071fe4c21c139712643fc706eaf1a52ab8a
[]
no_license
camelcc/leetcode
e0839e6267ebda5eef57da065d4adaefecb4b557
d982b9e71bc475a599df45d66cf2b78cf017594d
refs/heads/master
2022-07-19T06:24:49.148849
2022-07-10T07:00:34
2022-07-10T07:00:34
135,386,923
5
1
null
null
null
null
UTF-8
Java
false
false
1,850
java
import util.TreeNode; import java.util.ArrayList; import java.util.List; import java.util.Stack; public class S0145BinaryTreePostorderTraversal { public List<Integer> postorderTraversal(TreeNode root) { List<Integer> res = new ArrayList<>(); if (root == null) { return res; } TreeNode dummy = new TreeNode(0); dummy.left = new TreeNode(0); dummy.right = root; Stack<TreeNode> d = new Stack<>(); d.push(dummy); d.push(dummy.left); Stack<Stack<TreeNode>> stacks = new Stack<>(); stacks.push(d); do { Stack<TreeNode> outer = stacks.pop(); res.add(outer.pop().val); if (outer.isEmpty()) { continue; } stacks.push(outer); if (outer.peek().right == null) { continue; } TreeNode n = outer.peek().right; Stack<TreeNode> t = new Stack<>(); t.push(n); while (true) { if (n.left != null) { t.push(n.left); n = n.left; continue; } if (n.right != null) { stacks.push(t); t = new Stack<>(); t.push(n.right); n = n.right; continue; } break; } stacks.push(t); } while (!stacks.isEmpty()); res.remove(0); res.remove(res.size()-1); return res; // if (root.left != null) { // res.addAll(postorderTraversal(root.left)); // } // if (root.right != null) { // res.addAll(postorderTraversal(root.right)); // } // res.add(root.val); } }
5c8a73c351b566f8c4e34b83f472387e8804f46b
7d1ce974b4e0f0a7ab775083c3044b2309eee3ed
/ch07Classloading/BootstrapClassLoader.java
88e6b453d1cf7e3dd0c2b9c6ad4011f5381568b7
[]
no_license
724399396/understanding-the-jvm
65ef2b06a78c75890e00d59786b17e8578d4fcdb
5da3a636753f104b8508a6cb701e4ded69290441
refs/heads/master
2021-01-10T20:43:32.668563
2015-02-15T04:06:19
2015-02-15T04:06:19
30,784,917
0
1
null
null
null
null
UTF-8
Java
false
false
901
java
package ch07Classloading; import sun.security.util.SecurityConstants; /** * Created by liwei on 15-2-13. */ public class BootstrapClassLoader { /** * Returns the class loader for the class. Some implementations may use null * to represent the bootstrap class loader. This method will return null in such * implementations if this class was loaded by the bootstrap class loader. */ public ClassLoader getClassLoader() { ClassLoader cl = getClassLoader(); if (cl == null) return null; SecurityManager sm = System.getSecurityManager(); if (sm != null) { // ClassLoader ccl = ClassLoader.getCallerClassLoader(); // if (ccl != null && ccl != cl && cl.isAncesstor(ccl)) { // sm.checkPermission(SecurityConstants.GET_CLASSLOADER_PERMISSION); // } } return cl; } }
977abd1515ae0b0275872ee9f2383ebd7048af8b
601f5cdd5125a1602ae31ce90bfda4b062e0b4d7
/app/src/main/java/com/example/android/popularmovies/Utility.java
8c9da21a3072bfb4da5233a2c1f7c3e346219e15
[]
no_license
ranjeevmahtani/Popular-Movies
d4f86b79ab561d93ca2d895e596728d786d74511
b2a0941848dbe9a81fc44fad37bfd96977dae6fa
refs/heads/master
2021-01-19T13:24:28.628810
2015-08-28T23:18:01
2015-08-28T23:18:01
39,053,030
0
0
null
null
null
null
UTF-8
Java
false
false
14,280
java
package com.example.android.popularmovies; import android.content.Context; import android.net.ConnectivityManager; import android.net.Uri; import android.util.Log; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; import java.net.URLEncoder; /** * Created by ranjeevmahtani on 7/27/15. */ public class Utility { final static String LOG_TAG = Utility.class.getSimpleName(); public static URL getSearchQueryUrl(Context context, String query){ try { String encodedQuery = URLEncoder.encode(query,"UTF-8"); Uri.Builder builder = new Uri.Builder(); builder.scheme("http") .authority("api.themoviedb.org") .appendPath("3") .appendPath("search") .appendPath("movie") .appendQueryParameter("query", encodedQuery) .appendQueryParameter(context.getString(R.string.API_key_query_param), context.getString(R.string.API_key)); return new URL(builder.build().toString()); } catch (MalformedURLException e) { Log.e(LOG_TAG,e.getMessage()); } catch (UnsupportedEncodingException e) { Log.e(LOG_TAG,e.getMessage()); } return null; } public static URL getDiscoveryQueryUrl(Context context, String sortOption) { try { Uri.Builder builder = new Uri.Builder(); builder.scheme("http") .authority("api.themoviedb.org") .appendPath("3"); if (sortOption.equals(context.getString(R.string.API_param_now_playing)) || sortOption.equals(context.getString(R.string.API_param_upcoming))) { builder.appendPath("movie") .appendPath(sortOption); } else { builder.appendPath("discover") .appendPath("movie") .appendQueryParameter(context.getString(R.string.API_query_sort_by), sortOption) .appendQueryParameter("vote_count.gte", "25"); // hard-coded minimum vote count } builder.appendQueryParameter(context.getString(R.string.API_key_query_param), context.getString(R.string.API_key)); return new URL(builder.build().toString()); } catch (IOException e) { Log.e(LOG_TAG, "Error ", e); return null; } } public static URL getCastQueryUrl(Context context, long movieId) { try { Uri.Builder builder = new Uri.Builder(); builder.scheme("http") .authority("api.themoviedb.org") .appendPath("3") .appendPath("movie") .appendPath(String.valueOf(movieId)) .appendPath("credits") .appendQueryParameter(context.getString(R.string.API_key_query_param), context.getString(R.string.API_key)); return new URL(builder.build().toString()); } catch (IOException e) { Log.e(LOG_TAG, "Error ", e); return null; } } public static URL getVideoQueryUrl(Context context, long movieId) { try { Uri.Builder builder = new Uri.Builder(); builder.scheme("http") .authority("api.themoviedb.org") .appendPath("3") .appendPath("movie") .appendPath(String.valueOf(movieId)) .appendPath("videos") .appendQueryParameter(context.getString(R.string.API_key_query_param), context.getString(R.string.API_key)); return new URL(builder.build().toString()); } catch (IOException e) { Log.e(LOG_TAG, "Error ", e); return null; } } public static URL getReviewQueryUrl(Context context, long movieId) { final String LOG_TAG = "getReviewQueryUrl(...)"; try { Uri.Builder builder = new Uri.Builder(); builder.scheme("http") .authority("api.themoviedb.org") .appendPath("3") .appendPath("movie") .appendPath(String.valueOf(movieId)) .appendPath("reviews") .appendQueryParameter(context.getString(R.string.API_key_query_param), context.getString(R.string.API_key)); // Log.v(LOG_TAG, builder.build().toString()); return new URL(builder.build().toString()); } catch (IOException e) { Log.e(LOG_TAG, "Error ", e); return null; } } public static Movie[] getMovieArrayFromJsonStr(String moviesDataStr) throws JSONException { // These are the names of the JSON objects that need to be extracted. final String TMDB_MOVIES_LIST = "results"; final String TMDB_MOVIE_ID = "id"; final String TMDB_TITLE = "original_title"; final String TMDB_POSTER_PATH = "poster_path"; final String TMDB_PLOT_SYNOPSIS = "overview"; final String TMDB_USER_RATING = "vote_average"; final String TMDB_RELEASE_DATE = "release_date"; final String TMDB_VOTE_COUNT = "vote_count"; JSONObject moviesJsonResult = new JSONObject(moviesDataStr); JSONArray moviesJsonArray = moviesJsonResult.getJSONArray(TMDB_MOVIES_LIST); //Create an array of movie objects to store relevant details from the JSON results Movie[] moviesObjectArray = new Movie[moviesJsonArray.length()]; //for each movie in the JSON array, create a Movie object and store the relevant details for (int i = 0; i < moviesJsonArray.length(); i++) { Movie movie = new Movie(); // Get the JSON object representing the movie JSONObject movieJson = moviesJsonArray.getJSONObject(i); //Set movie details to the movie object movie.setTmdbId(movieJson.getInt(TMDB_MOVIE_ID)); movie.setMovieTitle(movieJson.getString(TMDB_TITLE)); movie.setMoviePosterPath(movieJson.getString(TMDB_POSTER_PATH)); movie.setMovieSynopsis(movieJson.getString(TMDB_PLOT_SYNOPSIS)); movie.setMovieUserRating(movieJson.getDouble(TMDB_USER_RATING)); movie.setMovieReleaseDate(movieJson.getString(TMDB_RELEASE_DATE)); movie.setVoteCount(movieJson.getInt(TMDB_VOTE_COUNT)); moviesObjectArray[i] = movie; //Log.v(LOG_TAG,"Movie " + i + ": " + moviesObjectArray[i].getMovieTitle()); } return moviesObjectArray; } public static void saveMovieCastInfo(Movie movie, URL castQueryUrl) throws JSONException { try { final String TMDB_CAST_LIST = "cast"; final String TMDB_CAST_NAME_KEY = "name"; String castQueryResponseStr = requestDataFromApi(castQueryUrl); if (castQueryResponseStr != null && !castQueryResponseStr.equals("")) { JSONObject castQueryResponseJson = new JSONObject(castQueryResponseStr); JSONArray castJsonArray = castQueryResponseJson.getJSONArray(TMDB_CAST_LIST); if (castJsonArray.length() == 0) { movie.setNoCast(); } else { int castArraySize = Math.min(3,castJsonArray.length()); String[] movieCast = new String[castArraySize]; for (int i = 0; i < castArraySize; i++) { String castMember = castJsonArray.getJSONObject(i).getString(TMDB_CAST_NAME_KEY); movieCast[i] = castMember; } movie.setCastArray(movieCast); } } else { movie.setNoCast(); } } catch (JSONException e) { Log.e(LOG_TAG, "Error ", e); } } public static void saveMovieVideoInfo(Movie movie, URL videoQueryUrl) throws JSONException { final String LOG_TAG = "saveMovieVideoInfo(...)"; try { final String TMDB_VIDEOS_LIST = "results"; final String TMDB_VIDEO_KEY = "key"; final String TMDB_VIDEO_NAME = "name"; String videosQueryResponseStr = requestDataFromApi(videoQueryUrl); if (videosQueryResponseStr != null && !videosQueryResponseStr.equals("")) { JSONObject videosQueryResponseJson = new JSONObject(videosQueryResponseStr); JSONArray videosJsonArray = videosQueryResponseJson.getJSONArray(TMDB_VIDEOS_LIST); if (videosJsonArray.length() == 0) { movie.setNoVideos(); } else { for (int i = 0; i < videosJsonArray.length(); i++) { JSONObject video = videosJsonArray.getJSONObject(i); String[] videoInfo = { video.getString(TMDB_VIDEO_KEY), video.getString(TMDB_VIDEO_NAME) }; movie.addVideo(videoInfo); // Log.v(LOG_TAG, movie.getMovieTitle()); // Log.v(LOG_TAG, movie.getVideos()); } } } else { movie.setNoVideos(); } } catch (JSONException e) { Log.e(LOG_TAG, "Error ", e); } } public static void saveMovieReviews(Movie movie, URL reviewsQueryUrl) throws JSONException { final String LOG_TAG = "saveMovieReviews(...)"; try { final String TMDB_REVIEWS_LIST = "results"; final String TMDB_REVIEW_AUTHOR = "author"; final String TMDB_REVIEW_CONTENT = "content"; String reviewsQueryResponseStr = requestDataFromApi(reviewsQueryUrl); if (reviewsQueryResponseStr != null && !reviewsQueryResponseStr.equals("")) { JSONObject reviewsQueryResponseJson = new JSONObject(reviewsQueryResponseStr); JSONArray reviewsJsonArray = reviewsQueryResponseJson.getJSONArray(TMDB_REVIEWS_LIST); if (reviewsJsonArray.length() == 0) { movie.setNoReviews(); } else { for (int i = 0; i < reviewsJsonArray.length(); i++) { JSONObject review = reviewsJsonArray.getJSONObject(i); String reviewAuthor = review.getString(TMDB_REVIEW_AUTHOR); if (reviewAuthor == null || reviewAuthor.equals("")) { reviewAuthor = "anonymous"; } String[] reviewInfo = { reviewAuthor, review.getString(TMDB_REVIEW_CONTENT) }; movie.addReview(reviewInfo); // Log.v(LOG_TAG, movie.getMovieTitle()); // Log.v(LOG_TAG, movie.getVideos()); } } } else { movie.setNoReviews(); } } catch (JSONException e) { Log.e(LOG_TAG, "Error ", e); } } public static String requestDataFromApi(URL queryURL) { HttpURLConnection urlConnection = null; BufferedReader reader = null; // Will contain the raw JSON response as a string. String moviesJsonStr = null; try { // Create the request to themovieDB, and open the connection urlConnection = (HttpURLConnection) queryURL.openConnection(); urlConnection.setRequestMethod("GET"); urlConnection.connect(); // Read the input stream into a String InputStream inputStream = urlConnection.getInputStream(); StringBuffer buffer = new StringBuffer(); if (inputStream == null) { // Nothing to do. return null; } reader = new BufferedReader(new InputStreamReader(inputStream)); String line; while ((line = reader.readLine()) != null) { // Since it's JSON, adding a newline isn't necessary (it won't affect parsing) // But it does make debugging a *lot* easier if you print out the completed // buffer for debugging. buffer.append(line + "\n"); } if (buffer.length() == 0) { // Stream was empty. No point in parsing. return null; } moviesJsonStr = buffer.toString(); //Log.v(LOG_TAG, moviesJsonStr); return moviesJsonStr; } catch (IOException e) { Log.e(LOG_TAG, "Error ", e); // If the code didn't successfully get the movies data, there's no point in attempting // to parse it. return null; } finally { if (urlConnection != null) { urlConnection.disconnect(); } if (reader != null) { try { reader.close(); } catch (final IOException e) { Log.e(LOG_TAG, "Error closing stream", e); } } } } public static Uri getVideoUri(String videoId) { final String YOUTUBE_BASE_URL = "http://youtube.com/watch?v="; return Uri.parse(YOUTUBE_BASE_URL + videoId); } public static boolean isOnline(Context context) { ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); if (cm.getActiveNetworkInfo() != null && cm.getActiveNetworkInfo().isConnectedOrConnecting()) { return true; } else { return false; } } }
f84c943fcc5c98f2a60359cf9a61e25f6026f281
285127619284cf04c6e8cbd6484dbbb87d699823
/plugin/src/main/java/git4idea/crlf/GitCrlfUtil.java
43c6f92098f8cffe208bdaf3a51ac01d7d4048d4
[ "Apache-2.0" ]
permissive
consulo/consulo-git
c1bc36d8ef053aaed34d991b73e23eafe864bba5
39835384bc64a00baadd8a301aa18abd1e051e21
refs/heads/master
2023-08-18T23:20:48.918195
2023-06-14T06:59:28
2023-06-14T06:59:28
13,809,557
0
0
null
2015-02-20T22:22:44
2013-10-23T17:25:01
Java
UTF-8
Java
false
false
828
java
/* * Copyright 2000-2012 JetBrains s.r.o. * * 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 git4idea.crlf; import consulo.application.util.SystemInfo; /** * @author Kirill Likhodedov */ public class GitCrlfUtil { public static final String RECOMMENDED_VALUE = SystemInfo.isWindows ? "true" : "input"; }
1112a16053f27eeb6fb68945e663dbef6e964d42
8432f98324de92cba5f379d27fd7f33053edff33
/app/src/main/java/com/example/memo/timerdemo/MainActivity.java
893c96220395af19c747437bb4f4ddd806edee94
[]
no_license
memocool/Timer
0d7013e3a8010e540ebda92bbe4bc2a78ef6ed04
818ba1a9bc580dfc3619e3777f8861295350df80
refs/heads/master
2021-01-01T03:53:01.180469
2016-04-20T13:14:41
2016-04-20T13:14:41
56,688,083
0
0
null
null
null
null
UTF-8
Java
false
false
1,260
java
package com.example.memo.timerdemo; import android.os.CountDownTimer; import android.os.Handler; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); new CountDownTimer(10000, 1000) { public void onTick(long millesecondsuntildone) { // when the counting down counting ( every second ) Log.i("Seconds Left" , String.valueOf(millesecondsuntildone / 1000)); } public void onFinish() { // when the counter is finished Log.i("Done", " Count down is finished"); } }.start(); } /*final Handler handler = new Handler(); Runnable run = new Runnable() { @Override public void run() { // Insert code to be run every second Log.i("Runnable has run", "Running"); handler.postDelayed(this , 1000); } }; handler.post(run); } */ }
0c3d81433fd7d6dd28ce88469066b60577d441b8
65b62333d774905e886063db583ff283f2bccffb
/RegMed/Core/src/pojo/File.java
3ade34e5119192a04014461e5425be0a219c4652
[]
no_license
mjochab/-Programowanie_zespolowe_2018_gr1
0590c7e83aeb4270c0fd32f0f5063dd6dc41ec6c
0b7010733b88ce12208d5b9874bda058cfd68062
refs/heads/master
2021-04-27T00:16:00.482980
2018-06-06T14:05:04
2018-06-06T14:05:04
123,781,756
1
3
null
2018-06-06T14:05:05
2018-03-04T11:23:34
Java
UTF-8
Java
false
false
930
java
package pojo; import java.time.LocalDate; import java.time.LocalDateTime; public class File { private int id; private Patient patient; private Doctor doctor; private LocalDateTime date; private String history; public int getId() { return id; } public void setId(int id) { this.id = id; } public Patient getPatient() { return patient; } public void setPatient(Patient patient) { this.patient = patient; } public Doctor getDoctor() { return doctor; } public void setDoctor(Doctor doctor) { this.doctor = doctor; } public LocalDateTime getDate() { return date; } public void setDate(LocalDateTime date) { this.date = date; } public String getHistory() { return history; } public void setHistory(String history) { this.history = history; } }
35eec639076b33e6a4d1b6fa7a5fa38ac6b9a325
2668441a255ebb3c229dee35be44a5c97c502dcb
/src/android/CertificateTrustManager.java
d2f3b08628a71207d98465b99b71e2e32f3846de
[ "MIT" ]
permissive
AdorkDean/countly-sdk-js
817628d5df467c53e78e52ffb6cde14b8689fddf
b9488065761fe7cf98aec4756afeefcbdb399fe5
refs/heads/master
2021-06-13T06:34:21.836021
2017-02-23T05:55:09
2017-02-23T05:55:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,248
java
package ly.count.android.sdk; import android.util.Base64; import android.util.Log; import java.io.ByteArrayInputStream; import java.security.KeyStore; import java.security.cert.Certificate; import java.security.cert.CertificateException; import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import javax.net.ssl.TrustManager; import javax.net.ssl.TrustManagerFactory; import javax.net.ssl.X509TrustManager; /** * Created by artem on 11/06/15. Taken from https://www.owasp.org/index.php/Certificate_and_Public_Key_Pinning */ // Many thanks to Nikolay Elenkov for feedback. // Shamelessly based upon Moxie's example code (AOSP/Google did not offer code) // http://www.thoughtcrime.org/blog/authenticity-is-broken-in-ssl-but-your-app-ha/ public final class CertificateTrustManager implements X509TrustManager { // DER encoded public key private final List<byte[]> keys; public CertificateTrustManager(List<String> certificates) throws CertificateException { if (certificates == null || certificates.size() == 0) { throw new IllegalArgumentException("You must specify non-empty keys list"); } this.keys = new ArrayList<>(); for (String key : certificates) { CertificateFactory cf = CertificateFactory.getInstance("X.509"); Certificate cert = cf.generateCertificate(new ByteArrayInputStream(Base64.decode(key, Base64.DEFAULT))); this.keys.add(cert.getPublicKey().getEncoded()); } } public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException { if (chain == null) { throw new IllegalArgumentException("PublicKeyManager: X509Certificate array is null"); } if (!(chain.length > 0)) { throw new IllegalArgumentException("PublicKeyManager: X509Certificate is empty"); } if (!(null != authType && authType.contains("RSA"))) { throw new CertificateException("PublicKeyManager: AuthType is not RSA"); } // Perform customary SSL/TLS checks TrustManagerFactory tmf; try { tmf = TrustManagerFactory.getInstance("X509"); tmf.init((KeyStore) null); for (TrustManager trustManager : tmf.getTrustManagers()) { ((X509TrustManager) trustManager).checkServerTrusted(chain, authType); } } catch (Exception e) { throw new CertificateException(e); } byte server[] = chain[0].getPublicKey().getEncoded(); for (byte[] key : keys) { if (Arrays.equals(key, server)) { return; } } throw new CertificateException("Public keys didn't pass checks"); } public void checkClientTrusted(X509Certificate[] xcs, String string) { // throw new // UnsupportedOperationException("checkClientTrusted: Not supported yet."); } public X509Certificate[] getAcceptedIssuers() { // throw new // UnsupportedOperationException("getAcceptedIssuers: Not supported yet."); return null; } }
71173f41cd7c299cace8e3d68c1278b501b799a8
df134b422960de6fb179f36ca97ab574b0f1d69f
/it/unimi/dsi/fastutil/shorts/AbstractShortBigList.java
6856e153bd81c81ef03ac91034ed375809d4256d
[]
no_license
TheShermanTanker/NMS-1.16.3
bbbdb9417009be4987872717e761fb064468bbb2
d3e64b4493d3e45970ec5ec66e1b9714a71856cc
refs/heads/master
2022-12-29T15:32:24.411347
2020-10-08T11:56:16
2020-10-08T11:56:16
302,324,687
0
1
null
null
null
null
UTF-8
Java
false
false
30,115
java
/* */ package it.unimi.dsi.fastutil.shorts; /* */ /* */ import it.unimi.dsi.fastutil.BigList; /* */ import it.unimi.dsi.fastutil.BigListIterator; /* */ import java.io.Serializable; /* */ import java.util.Collection; /* */ import java.util.Iterator; /* */ import java.util.NoSuchElementException; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public abstract class AbstractShortBigList /* */ extends AbstractShortCollection /* */ implements ShortBigList, ShortStack /* */ { /* */ protected void ensureIndex(long index) { /* 40 */ if (index < 0L) /* 41 */ throw new IndexOutOfBoundsException("Index (" + index + ") is negative"); /* 42 */ if (index > size64()) { /* 43 */ throw new IndexOutOfBoundsException("Index (" + index + ") is greater than list size (" + size64() + ")"); /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ protected void ensureRestrictedIndex(long index) { /* 56 */ if (index < 0L) /* 57 */ throw new IndexOutOfBoundsException("Index (" + index + ") is negative"); /* 58 */ if (index >= size64()) { /* 59 */ throw new IndexOutOfBoundsException("Index (" + index + ") is greater than or equal to list size (" + /* 60 */ size64() + ")"); /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ public void add(long index, short k) { /* 70 */ throw new UnsupportedOperationException(); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public boolean add(short k) { /* 81 */ add(size64(), k); /* 82 */ return true; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public short removeShort(long i) { /* 92 */ throw new UnsupportedOperationException(); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public short set(long index, short k) { /* 102 */ throw new UnsupportedOperationException(); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public boolean addAll(long index, Collection<? extends Short> c) { /* */ // Byte code: /* */ // 0: aload_0 /* */ // 1: lload_1 /* */ // 2: invokevirtual ensureIndex : (J)V /* */ // 5: aload_3 /* */ // 6: invokeinterface iterator : ()Ljava/util/Iterator; /* */ // 11: astore #4 /* */ // 13: aload #4 /* */ // 15: invokeinterface hasNext : ()Z /* */ // 20: istore #5 /* */ // 22: aload #4 /* */ // 24: invokeinterface hasNext : ()Z /* */ // 29: ifeq -> 54 /* */ // 32: aload_0 /* */ // 33: lload_1 /* */ // 34: dup2 /* */ // 35: lconst_1 /* */ // 36: ladd /* */ // 37: lstore_1 /* */ // 38: aload #4 /* */ // 40: invokeinterface next : ()Ljava/lang/Object; /* */ // 45: checkcast java/lang/Short /* */ // 48: invokevirtual add : (JLjava/lang/Short;)V /* */ // 51: goto -> 22 /* */ // 54: iload #5 /* */ // 56: ireturn /* */ // Line number table: /* */ // Java source line number -> byte code offset /* */ // #110 -> 0 /* */ // #111 -> 5 /* */ // #112 -> 13 /* */ // #113 -> 22 /* */ // #114 -> 32 /* */ // #115 -> 54 /* */ // Local variable table: /* */ // start length slot name descriptor /* */ // 0 57 0 this Lit/unimi/dsi/fastutil/shorts/AbstractShortBigList; /* */ // 0 57 1 index J /* */ // 0 57 3 c Ljava/util/Collection; /* */ // 13 44 4 i Ljava/util/Iterator; /* */ // 22 35 5 retVal Z /* */ // Local variable type table: /* */ // start length slot name signature /* */ // 0 57 3 c Ljava/util/Collection<+Ljava/lang/Short;>; /* */ // 13 44 4 i Ljava/util/Iterator<+Ljava/lang/Short;>; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public boolean addAll(Collection<? extends Short> c) { /* 126 */ return addAll(size64(), c); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public ShortBigListIterator iterator() { /* 136 */ return listIterator(); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public ShortBigListIterator listIterator() { /* 147 */ return listIterator(0L); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ public ShortBigListIterator listIterator(final long index) { /* 156 */ ensureIndex(index); /* 157 */ return new ShortBigListIterator() { /* 158 */ long pos = index; long last = -1L; /* */ /* */ public boolean hasNext() { /* 161 */ return (this.pos < AbstractShortBigList.this.size64()); /* */ } /* */ /* */ public boolean hasPrevious() { /* 165 */ return (this.pos > 0L); /* */ } /* */ /* */ public short nextShort() { /* 169 */ if (!hasNext()) /* 170 */ throw new NoSuchElementException(); /* 171 */ return AbstractShortBigList.this.getShort(this.last = this.pos++); /* */ } /* */ /* */ public short previousShort() { /* 175 */ if (!hasPrevious()) /* 176 */ throw new NoSuchElementException(); /* 177 */ return AbstractShortBigList.this.getShort(this.last = --this.pos); /* */ } /* */ /* */ public long nextIndex() { /* 181 */ return this.pos; /* */ } /* */ /* */ public long previousIndex() { /* 185 */ return this.pos - 1L; /* */ } /* */ /* */ public void add(short k) { /* 189 */ AbstractShortBigList.this.add(this.pos++, k); /* 190 */ this.last = -1L; /* */ } /* */ /* */ public void set(short k) { /* 194 */ if (this.last == -1L) /* 195 */ throw new IllegalStateException(); /* 196 */ AbstractShortBigList.this.set(this.last, k); /* */ } /* */ /* */ public void remove() { /* 200 */ if (this.last == -1L) /* 201 */ throw new IllegalStateException(); /* 202 */ AbstractShortBigList.this.removeShort(this.last); /* */ /* */ /* */ /* */ /* 207 */ if (this.last < this.pos) /* 208 */ this.pos--; /* 209 */ this.last = -1L; /* */ } /* */ }; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public boolean contains(short k) { /* 222 */ return (indexOf(k) >= 0L); /* */ } /* */ /* */ public long indexOf(short k) { /* 226 */ ShortBigListIterator i = listIterator(); /* */ /* 228 */ while (i.hasNext()) { /* 229 */ short e = i.nextShort(); /* 230 */ if (k == e) /* 231 */ return i.previousIndex(); /* */ } /* 233 */ return -1L; /* */ } /* */ /* */ public long lastIndexOf(short k) { /* 237 */ ShortBigListIterator i = listIterator(size64()); /* */ /* 239 */ while (i.hasPrevious()) { /* 240 */ short e = i.previousShort(); /* 241 */ if (k == e) /* 242 */ return i.nextIndex(); /* */ } /* 244 */ return -1L; /* */ } /* */ /* */ public void size(long size) { /* 248 */ long i = size64(); /* 249 */ if (size > i) { /* 250 */ while (i++ < size) /* 251 */ add((short)0); /* */ } else { /* 253 */ while (i-- != size) /* 254 */ remove(i); /* */ } /* */ } /* */ public ShortBigList subList(long from, long to) { /* 258 */ ensureIndex(from); /* 259 */ ensureIndex(to); /* 260 */ if (from > to) /* 261 */ throw new IndexOutOfBoundsException("Start index (" + from + ") is greater than end index (" + to + ")"); /* 262 */ return new ShortSubList(this, from, to); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public void removeElements(long from, long to) { /* 273 */ ensureIndex(to); /* 274 */ ShortBigListIterator i = listIterator(from); /* 275 */ long n = to - from; /* 276 */ if (n < 0L) /* 277 */ throw new IllegalArgumentException("Start index (" + from + ") is greater than end index (" + to + ")"); /* 278 */ while (n-- != 0L) { /* 279 */ i.nextShort(); /* 280 */ i.remove(); /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public void addElements(long index, short[][] a, long offset, long length) { /* */ // Byte code: /* */ // 0: aload_0 /* */ // 1: lload_1 /* */ // 2: invokevirtual ensureIndex : (J)V /* */ // 5: aload_3 /* */ // 6: lload #4 /* */ // 8: lload #6 /* */ // 10: invokestatic ensureOffsetLength : ([[SJJ)V /* */ // 13: lload #6 /* */ // 15: dup2 /* */ // 16: lconst_1 /* */ // 17: lsub /* */ // 18: lstore #6 /* */ // 20: lconst_0 /* */ // 21: lcmp /* */ // 22: ifeq -> 48 /* */ // 25: aload_0 /* */ // 26: lload_1 /* */ // 27: dup2 /* */ // 28: lconst_1 /* */ // 29: ladd /* */ // 30: lstore_1 /* */ // 31: aload_3 /* */ // 32: lload #4 /* */ // 34: dup2 /* */ // 35: lconst_1 /* */ // 36: ladd /* */ // 37: lstore #4 /* */ // 39: invokestatic get : ([[SJ)S /* */ // 42: invokevirtual add : (JS)V /* */ // 45: goto -> 13 /* */ // 48: return /* */ // Line number table: /* */ // Java source line number -> byte code offset /* */ // #292 -> 0 /* */ // #293 -> 5 /* */ // #294 -> 13 /* */ // #295 -> 25 /* */ // #296 -> 48 /* */ // Local variable table: /* */ // start length slot name descriptor /* */ // 0 49 0 this Lit/unimi/dsi/fastutil/shorts/AbstractShortBigList; /* */ // 0 49 1 index J /* */ // 0 49 3 a [[S /* */ // 0 49 4 offset J /* */ // 0 49 6 length J /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public void addElements(long index, short[][] a) { /* 306 */ addElements(index, a, 0L, ShortBigArrays.length(a)); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public void getElements(long from, short[][] a, long offset, long length) { /* */ // Byte code: /* */ // 0: aload_0 /* */ // 1: lload_1 /* */ // 2: invokevirtual listIterator : (J)Lit/unimi/dsi/fastutil/shorts/ShortBigListIterator; /* */ // 5: astore #8 /* */ // 7: aload_3 /* */ // 8: lload #4 /* */ // 10: lload #6 /* */ // 12: invokestatic ensureOffsetLength : ([[SJJ)V /* */ // 15: lload_1 /* */ // 16: lload #6 /* */ // 18: ladd /* */ // 19: aload_0 /* */ // 20: invokevirtual size64 : ()J /* */ // 23: lcmp /* */ // 24: ifle -> 74 /* */ // 27: new java/lang/IndexOutOfBoundsException /* */ // 30: dup /* */ // 31: new java/lang/StringBuilder /* */ // 34: dup /* */ // 35: invokespecial <init> : ()V /* */ // 38: ldc 'End index (' /* */ // 40: invokevirtual append : (Ljava/lang/String;)Ljava/lang/StringBuilder; /* */ // 43: lload_1 /* */ // 44: lload #6 /* */ // 46: ladd /* */ // 47: invokevirtual append : (J)Ljava/lang/StringBuilder; /* */ // 50: ldc ') is greater than list size (' /* */ // 52: invokevirtual append : (Ljava/lang/String;)Ljava/lang/StringBuilder; /* */ // 55: aload_0 /* */ // 56: invokevirtual size64 : ()J /* */ // 59: invokevirtual append : (J)Ljava/lang/StringBuilder; /* */ // 62: ldc ')' /* */ // 64: invokevirtual append : (Ljava/lang/String;)Ljava/lang/StringBuilder; /* */ // 67: invokevirtual toString : ()Ljava/lang/String; /* */ // 70: invokespecial <init> : (Ljava/lang/String;)V /* */ // 73: athrow /* */ // 74: lload #6 /* */ // 76: dup2 /* */ // 77: lconst_1 /* */ // 78: lsub /* */ // 79: lstore #6 /* */ // 81: lconst_0 /* */ // 82: lcmp /* */ // 83: ifeq -> 107 /* */ // 86: aload_3 /* */ // 87: lload #4 /* */ // 89: dup2 /* */ // 90: lconst_1 /* */ // 91: ladd /* */ // 92: lstore #4 /* */ // 94: aload #8 /* */ // 96: invokeinterface nextShort : ()S /* */ // 101: invokestatic set : ([[SJS)V /* */ // 104: goto -> 74 /* */ // 107: return /* */ // Line number table: /* */ // Java source line number -> byte code offset /* */ // #317 -> 0 /* */ // #318 -> 7 /* */ // #319 -> 15 /* */ // #320 -> 27 /* */ // #321 -> 56 /* */ // #322 -> 74 /* */ // #323 -> 86 /* */ // #324 -> 107 /* */ // Local variable table: /* */ // start length slot name descriptor /* */ // 0 108 0 this Lit/unimi/dsi/fastutil/shorts/AbstractShortBigList; /* */ // 0 108 1 from J /* */ // 0 108 3 a [[S /* */ // 0 108 4 offset J /* */ // 0 108 6 length J /* */ // 7 101 8 i Lit/unimi/dsi/fastutil/shorts/ShortBigListIterator; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public void clear() { /* 332 */ removeElements(0L, size64()); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ @Deprecated /* */ public int size() { /* 345 */ return (int)Math.min(2147483647L, size64()); /* */ } /* */ private boolean valEquals(Object a, Object b) { /* 348 */ return (a == null) ? ((b == null)) : a.equals(b); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public int hashCode() { /* 358 */ ShortIterator i = iterator(); /* 359 */ int h = 1; /* 360 */ long s = size64(); /* 361 */ while (s-- != 0L) { /* 362 */ short k = i.nextShort(); /* 363 */ h = 31 * h + k; /* */ } /* 365 */ return h; /* */ } /* */ /* */ public boolean equals(Object o) { /* 369 */ if (o == this) /* 370 */ return true; /* 371 */ if (!(o instanceof BigList)) /* 372 */ return false; /* 373 */ BigList<?> l = (BigList)o; /* 374 */ long s = size64(); /* 375 */ if (s != l.size64()) /* 376 */ return false; /* 377 */ if (l instanceof ShortBigList) { /* 378 */ ShortBigListIterator shortBigListIterator1 = listIterator(), shortBigListIterator2 = ((ShortBigList)l).listIterator(); /* 379 */ while (s-- != 0L) { /* 380 */ if (shortBigListIterator1.nextShort() != shortBigListIterator2.nextShort()) /* 381 */ return false; /* 382 */ } return true; /* */ } /* 384 */ BigListIterator<?> i1 = listIterator(), i2 = l.listIterator(); /* 385 */ while (s-- != 0L) { /* 386 */ if (!valEquals(i1.next(), i2.next())) /* 387 */ return false; /* 388 */ } return true; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public int compareTo(BigList<? extends Short> l) { /* 406 */ if (l == this) /* 407 */ return 0; /* 408 */ if (l instanceof ShortBigList) { /* 409 */ ShortBigListIterator shortBigListIterator1 = listIterator(), shortBigListIterator2 = ((ShortBigList)l).listIterator(); /* */ /* */ /* 412 */ while (shortBigListIterator1.hasNext() && shortBigListIterator2.hasNext()) { /* 413 */ short e1 = shortBigListIterator1.nextShort(); /* 414 */ short e2 = shortBigListIterator2.nextShort(); int r; /* 415 */ if ((r = Short.compare(e1, e2)) != 0) /* 416 */ return r; /* */ } /* 418 */ return shortBigListIterator2.hasNext() ? -1 : (shortBigListIterator1.hasNext() ? 1 : 0); /* */ } /* 420 */ BigListIterator<? extends Short> i1 = listIterator(), i2 = l.listIterator(); /* */ /* 422 */ while (i1.hasNext() && i2.hasNext()) { /* 423 */ int r; if ((r = ((Comparable<Object>)i1.next()).compareTo(i2.next())) != 0) /* 424 */ return r; /* */ } /* 426 */ return i2.hasNext() ? -1 : (i1.hasNext() ? 1 : 0); /* */ } /* */ /* */ public void push(short o) { /* 430 */ add(o); /* */ } /* */ /* */ public short popShort() { /* 434 */ if (isEmpty()) /* 435 */ throw new NoSuchElementException(); /* 436 */ return removeShort(size64() - 1L); /* */ } /* */ /* */ public short topShort() { /* 440 */ if (isEmpty()) /* 441 */ throw new NoSuchElementException(); /* 442 */ return getShort(size64() - 1L); /* */ } /* */ /* */ public short peekShort(int i) { /* 446 */ return getShort(size64() - 1L - i); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public boolean rem(short k) { /* 458 */ long index = indexOf(k); /* 459 */ if (index == -1L) /* 460 */ return false; /* 461 */ removeShort(index); /* 462 */ return true; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public boolean addAll(long index, ShortCollection c) { /* 473 */ return addAll(index, c); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public boolean addAll(long index, ShortBigList l) { /* 484 */ return addAll(index, l); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public boolean addAll(ShortCollection c) { /* 495 */ return addAll(size64(), c); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public boolean addAll(ShortBigList l) { /* 506 */ return addAll(size64(), l); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ @Deprecated /* */ public void add(long index, Short ok) { /* 519 */ add(index, ok.shortValue()); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ @Deprecated /* */ public Short set(long index, Short ok) { /* 532 */ return Short.valueOf(set(index, ok.shortValue())); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ @Deprecated /* */ public Short get(long index) { /* 545 */ return Short.valueOf(getShort(index)); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ @Deprecated /* */ public long indexOf(Object ok) { /* 558 */ return indexOf(((Short)ok).shortValue()); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ @Deprecated /* */ public long lastIndexOf(Object ok) { /* 571 */ return lastIndexOf(((Short)ok).shortValue()); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ @Deprecated /* */ public Short remove(long index) { /* 584 */ return Short.valueOf(removeShort(index)); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ @Deprecated /* */ public void push(Short o) { /* 597 */ push(o.shortValue()); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ @Deprecated /* */ public Short pop() { /* 610 */ return Short.valueOf(popShort()); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ @Deprecated /* */ public Short top() { /* 623 */ return Short.valueOf(topShort()); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ @Deprecated /* */ public Short peek(int i) { /* 636 */ return Short.valueOf(peekShort(i)); /* */ } /* */ /* */ public String toString() { /* 640 */ StringBuilder s = new StringBuilder(); /* 641 */ ShortIterator i = iterator(); /* 642 */ long n = size64(); /* */ /* 644 */ boolean first = true; /* 645 */ s.append("["); /* 646 */ while (n-- != 0L) { /* 647 */ if (first) { /* 648 */ first = false; /* */ } else { /* 650 */ s.append(", "); /* 651 */ } short k = i.nextShort(); /* 652 */ s.append(String.valueOf(k)); /* */ } /* 654 */ s.append("]"); /* 655 */ return s.toString(); /* */ } /* */ /* */ public static class ShortSubList /* */ extends AbstractShortBigList /* */ implements Serializable { /* */ private static final long serialVersionUID = -7046029254386353129L; /* */ protected final ShortBigList l; /* */ protected final long from; /* */ protected long to; /* */ /* */ public ShortSubList(ShortBigList l, long from, long to) { /* 667 */ this.l = l; /* 668 */ this.from = from; /* 669 */ this.to = to; /* */ } /* */ private boolean assertRange() { /* 672 */ assert this.from <= this.l.size64(); /* 673 */ assert this.to <= this.l.size64(); /* 674 */ assert this.to >= this.from; /* 675 */ return true; /* */ } /* */ /* */ public boolean add(short k) { /* 679 */ this.l.add(this.to, k); /* 680 */ this.to++; /* 681 */ assert assertRange(); /* 682 */ return true; /* */ } /* */ /* */ public void add(long index, short k) { /* 686 */ ensureIndex(index); /* 687 */ this.l.add(this.from + index, k); /* 688 */ this.to++; /* 689 */ assert assertRange(); /* */ } /* */ /* */ public boolean addAll(long index, Collection<? extends Short> c) { /* 693 */ ensureIndex(index); /* 694 */ this.to += c.size(); /* 695 */ return this.l.addAll(this.from + index, c); /* */ } /* */ /* */ public short getShort(long index) { /* 699 */ ensureRestrictedIndex(index); /* 700 */ return this.l.getShort(this.from + index); /* */ } /* */ /* */ public short removeShort(long index) { /* 704 */ ensureRestrictedIndex(index); /* 705 */ this.to--; /* 706 */ return this.l.removeShort(this.from + index); /* */ } /* */ /* */ public short set(long index, short k) { /* 710 */ ensureRestrictedIndex(index); /* 711 */ return this.l.set(this.from + index, k); /* */ } /* */ /* */ public long size64() { /* 715 */ return this.to - this.from; /* */ } /* */ /* */ public void getElements(long from, short[][] a, long offset, long length) { /* 719 */ ensureIndex(from); /* 720 */ if (from + length > size64()) /* 721 */ throw new IndexOutOfBoundsException("End index (" + from + length + ") is greater than list size (" + /* 722 */ size64() + ")"); /* 723 */ this.l.getElements(this.from + from, a, offset, length); /* */ } /* */ /* */ public void removeElements(long from, long to) { /* 727 */ ensureIndex(from); /* 728 */ ensureIndex(to); /* 729 */ this.l.removeElements(this.from + from, this.from + to); /* 730 */ this.to -= to - from; /* 731 */ assert assertRange(); /* */ } /* */ /* */ public void addElements(long index, short[][] a, long offset, long length) { /* 735 */ ensureIndex(index); /* 736 */ this.l.addElements(this.from + index, a, offset, length); /* 737 */ this.to += length; /* 738 */ assert assertRange(); /* */ } /* */ /* */ public ShortBigListIterator listIterator(final long index) { /* 742 */ ensureIndex(index); /* 743 */ return new ShortBigListIterator() { /* 744 */ long pos = index; long last = -1L; /* */ /* */ public boolean hasNext() { /* 747 */ return (this.pos < AbstractShortBigList.ShortSubList.this.size64()); /* */ } /* */ /* */ public boolean hasPrevious() { /* 751 */ return (this.pos > 0L); /* */ } /* */ /* */ public short nextShort() { /* 755 */ if (!hasNext()) /* 756 */ throw new NoSuchElementException(); /* 757 */ return AbstractShortBigList.ShortSubList.this.l.getShort(AbstractShortBigList.ShortSubList.this.from + (this.last = this.pos++)); /* */ } /* */ /* */ public short previousShort() { /* 761 */ if (!hasPrevious()) /* 762 */ throw new NoSuchElementException(); /* 763 */ return AbstractShortBigList.ShortSubList.this.l.getShort(AbstractShortBigList.ShortSubList.this.from + (this.last = --this.pos)); /* */ } /* */ /* */ public long nextIndex() { /* 767 */ return this.pos; /* */ } /* */ /* */ public long previousIndex() { /* 771 */ return this.pos - 1L; /* */ } /* */ /* */ public void add(short k) { /* 775 */ if (this.last == -1L) /* 776 */ throw new IllegalStateException(); /* 777 */ AbstractShortBigList.ShortSubList.this.add(this.pos++, k); /* 778 */ this.last = -1L; /* 779 */ if (!$assertionsDisabled && !AbstractShortBigList.ShortSubList.this.assertRange()) throw new AssertionError(); /* */ } /* */ /* */ public void set(short k) { /* 783 */ if (this.last == -1L) /* 784 */ throw new IllegalStateException(); /* 785 */ AbstractShortBigList.ShortSubList.this.set(this.last, k); /* */ } /* */ /* */ public void remove() { /* 789 */ if (this.last == -1L) /* 790 */ throw new IllegalStateException(); /* 791 */ AbstractShortBigList.ShortSubList.this.removeShort(this.last); /* */ /* */ /* */ /* */ /* 796 */ if (this.last < this.pos) /* 797 */ this.pos--; /* 798 */ this.last = -1L; /* 799 */ assert AbstractShortBigList.ShortSubList.this.assertRange(); /* */ } /* */ }; /* */ } /* */ /* */ public ShortBigList subList(long from, long to) { /* 805 */ ensureIndex(from); /* 806 */ ensureIndex(to); /* 807 */ if (from > to) /* 808 */ throw new IllegalArgumentException("Start index (" + from + ") is greater than end index (" + to + ")"); /* 809 */ return new ShortSubList(this, from, to); /* */ } /* */ /* */ public boolean rem(short k) { /* 813 */ long index = indexOf(k); /* 814 */ if (index == -1L) /* 815 */ return false; /* 816 */ this.to--; /* 817 */ this.l.removeShort(this.from + index); /* 818 */ assert assertRange(); /* 819 */ return true; /* */ } /* */ /* */ public boolean addAll(long index, ShortCollection c) { /* 823 */ ensureIndex(index); /* 824 */ return super.addAll(index, c); /* */ } /* */ /* */ public boolean addAll(long index, ShortBigList l) { /* 828 */ ensureIndex(index); /* 829 */ return super.addAll(index, l); /* */ } /* */ } /* */ } /* Location: C:\Users\Josep\Downloads\Decompile Minecraft\tuinity-1.16.3.jar!\i\\unimi\dsi\fastutil\shorts\AbstractShortBigList.class * Java compiler version: 8 (52.0) * JD-Core Version: 1.1.3 */
67fd906b60b5d9ab6c8d1be23211465e1168c7a0
7e4896aaaafea60f29371adb928cf91af9689679
/2018/proj1b/Palindrome.java
02ea72f26363384a7c33b95c24150194cb746c52
[]
no_license
curow/CS61B
cc70e7d06a63d4774f1edee38d3876ef19ccbf2c
868f479ee088e3ae5b98697f903c5ef2e6d98a39
refs/heads/master
2021-01-01T01:36:16.270874
2020-03-29T15:57:25
2020-03-29T15:57:25
239,115,038
0
0
null
null
null
null
UTF-8
Java
false
false
922
java
public class Palindrome { public Deque<Character> wordToDeque(String word) { Deque<Character> res = new LinkedListDeque<>(); for (char ch : word.toCharArray()) { res.addLast(ch); } return res; } private boolean isPalindrome(Deque<Character> word, CharacterComparator cc) { if (word.isEmpty() || word.size() == 1) { return true; } else { char first = word.removeFirst(); char last = word.removeLast(); return cc.equalChars(first, last) && isPalindrome(word, cc); } } public boolean isPalindrome(String word, CharacterComparator cc) { Deque<Character> wordDeque = wordToDeque(word); return isPalindrome(wordDeque, cc); } public boolean isPalindrome(String word) { return isPalindrome(word, (x, y) -> (x == y)); } }
9c523bf901855a44c859292a2c32844c877a33db
c42531b0f0e976dd2b11528504e349d5501249ae
/Hartsbourne/MHSystems/app/src/main/java/com/mh/systems/hartsbourne/web/models/CourseDiaryItemsCopy.java
36831b068b74c19737f81c5fe18d554c132cb399
[ "MIT" ]
permissive
Karan-nassa/MHSystems
4267cc6939de7a0ff5577c22b88081595446e09e
a0e20f40864137fff91784687eaf68e5ec3f842c
refs/heads/master
2021-08-20T05:59:06.864788
2017-11-28T08:02:39
2017-11-28T08:02:39
112,189,266
0
0
null
null
null
null
UTF-8
Java
false
false
1,057
java
package com.mh.systems.hartsbourne.web.models; import java.util.ArrayList; import java.util.List; /** * Created by [email protected] to load * Course diary events items on 04-03-2016. */ public class CourseDiaryItemsCopy { String Message; String Result; List<CourseDiaryDataCopy> Data = new ArrayList<>(); /** * @return The Message */ public String getMessage() { return Message; } /** * @param Message The Message */ public void setMessage(String message) { Message = message; } /** * @return The Result */ public String getResult() { return Result; } /** * @param Result The Result */ public void setResult(String result) { Result = result; } /** * @return The MyAccountData */ public List<CourseDiaryDataCopy> getData() { return Data; } /** * @param Data The MyAccountData */ public void setData(List<CourseDiaryDataCopy> data) { Data = data; } }
b7d3903e70c03f3dcc63ee853ac803576ed8e986
22f0484038cbea21e2d64cfefedd6b518412b21d
/dasa-receituario-rest/src/test/java/br/com/tamanhofamilia/dasa/receituario/services/medicos/ConselhosServiceTest.java
aec2cf2583cabe0dad6cb460f9f3609c6489522a
[]
no_license
luizalbsilva/selecao-dasa
718c2cd6a8aeb3186e7e67dc41390e1b4a809c74
7d39a42f5695867133757364a1f01452cbc1077a
refs/heads/main
2023-06-07T08:58:58.298494
2021-07-05T20:51:14
2021-07-05T20:51:14
382,742,733
0
0
null
null
null
null
UTF-8
Java
false
false
2,831
java
package br.com.tamanhofamilia.dasa.receituario.services.medicos; import br.com.tamanhofamilia.dasa.receituario.daos.medico.ConselhoDao; import br.com.tamanhofamilia.dasa.receituario.models.medico.Conselho; import br.com.tamanhofamilia.dasa.receituario.services.DataNotFoundException; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; import org.springframework.data.domain.Pageable; import java.util.Optional; import static org.junit.jupiter.api.Assertions.assertSame; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) class ConselhosServiceTest { @InjectMocks ConselhosService service; @Mock ConselhoDao dao; @Mock Pageable pageable; @Test void findAll() { service.findAll(pageable); verify(dao).findAll(pageable); } @Test void create() { Conselho conselho = Conselho.builder().nome("CFM").build(); when(dao.save(conselho)).thenAnswer(e -> { Conselho cons = e.getArgument(0); cons.setIdConselho(1); return cons; }); assertSame(1, service.create(conselho)); verify(dao).save(conselho); } @Test void update() throws DataNotFoundException { final int id = 1; when(dao.existsById(id)).thenReturn(true); Conselho conselho = Conselho.builder().idConselho(id).build(); service.update(conselho); verify(dao).save(conselho); } @Test void updateNotFound() { Conselho conselho = Conselho.builder().idConselho(1).build(); assertThrows(DataNotFoundException.class, () -> { service.update(conselho); }); } @Test void getById() { final int id = 1; final Optional<Conselho> daoReturn = Optional.empty(); when(dao.findById(id)).thenReturn(daoReturn); final Optional<Conselho> toCheck = service.getById(id); assertSame(daoReturn, toCheck); verify(dao).findById(id); } @Test void delete() throws DataNotFoundException { final int id = 1; when(dao.existsById(id)) .thenReturn(true); service.delete(id); verify(dao).deleteById(id); } @Test void deleteNotFound() { assertThrows(DataNotFoundException.class, () -> { final int id = 1; when(dao.existsById(id)) .thenReturn(false); service.delete(id); }); } }
dab2412fd37fedf9688aee387cb82e9c5b61ebda
43d40f5422d69feb79607164581f713830424801
/src/main/java/com/jojoldu/book/springboot/domain/posts/PostsRepository.java
582a48c303b6651569089c3f57dbf419c33e7d08
[]
no_license
syleemk/freelec-springboot2-webservice
e45221a7a431d1a7b6329fb3d858171394fd1412
6eba508b394d027245333e3f57e9529f2133dd9a
refs/heads/master
2022-12-18T01:56:56.673791
2020-09-23T15:49:47
2020-09-23T15:49:47
283,802,525
0
0
null
null
null
null
UTF-8
Java
false
false
770
java
package com.jojoldu.book.springboot.domain.posts; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import java.util.List; // 보통 SQL Mapper(MyBatis같은)에서 Dao라고 불리는 DB Layer 접근자 // JPA에서는 Repository 라고 부르며 인터페이스로 생성 // 단순히 인터페이스 생성 후, JpaRepository<Entity 클래스, PK타입>를 상속하면 기본적인 CRUD메소드가 자동으로 생성 // @Repository 추가할 필요 없음 // Entity클래스와 기본 Entity Repository는 가은 위치에 있어야 함 public interface PostsRepository extends JpaRepository<Posts, Long> { @Query("SELECT p FROM Posts p ORDER BY p.id DESC") List<Posts> findAllDesc(); }
6e627bc2ef79885f163e05a1632b3ca7b6947e94
3367419e05bc8cb492c2e35603180adfe13073cf
/src/main/java/com/thoughtworks/bank/domain/AbstractAuditingEntity.java
bc55f8482f19cd96b2b3b726802f4574bb79f6b3
[]
no_license
bharatak/jhipster-demo
0582844bb13b7f75f61d01dc8c7cb6db37c15e90
c00f11803cedc9cfa3c31c1d7243fc1b6b45a5aa
refs/heads/master
2022-12-15T08:52:16.431739
2020-09-15T01:17:36
2020-09-15T01:19:53
295,579,370
0
0
null
null
null
null
UTF-8
Java
false
false
2,175
java
package com.thoughtworks.bank.domain; import com.fasterxml.jackson.annotation.JsonIgnore; import org.springframework.data.annotation.CreatedBy; import org.springframework.data.annotation.CreatedDate; import org.springframework.data.annotation.LastModifiedBy; import org.springframework.data.annotation.LastModifiedDate; import org.springframework.data.jpa.domain.support.AuditingEntityListener; import java.io.Serializable; import java.time.Instant; import javax.persistence.Column; import javax.persistence.EntityListeners; import javax.persistence.MappedSuperclass; /** * Base abstract class for entities which will hold definitions for created, last modified, created by, * last modified by attributes. */ @MappedSuperclass @EntityListeners(AuditingEntityListener.class) public abstract class AbstractAuditingEntity implements Serializable { private static final long serialVersionUID = 1L; @CreatedBy @Column(name = "created_by", nullable = false, length = 50, updatable = false) @JsonIgnore private String createdBy; @CreatedDate @Column(name = "created_date", updatable = false) @JsonIgnore private Instant createdDate = Instant.now(); @LastModifiedBy @Column(name = "last_modified_by", length = 50) @JsonIgnore private String lastModifiedBy; @LastModifiedDate @Column(name = "last_modified_date") @JsonIgnore private Instant lastModifiedDate = Instant.now(); public String getCreatedBy() { return createdBy; } public void setCreatedBy(String createdBy) { this.createdBy = createdBy; } public Instant getCreatedDate() { return createdDate; } public void setCreatedDate(Instant createdDate) { this.createdDate = createdDate; } public String getLastModifiedBy() { return lastModifiedBy; } public void setLastModifiedBy(String lastModifiedBy) { this.lastModifiedBy = lastModifiedBy; } public Instant getLastModifiedDate() { return lastModifiedDate; } public void setLastModifiedDate(Instant lastModifiedDate) { this.lastModifiedDate = lastModifiedDate; } }
d74ab3b25325d083189ea83c361840f93c864f88
e73906122b5a58c9e77420fb69cea7e00584df7a
/InfTech2/src/Doubles/Wort.java
994ad1e12cb33ed741217f4344bffab92aa2d5b7
[]
no_license
tbuz/Java-Projects
2b7916e46dbcd4be850a23bf323d4b7b2e8d498b
c922ec48f74e3c9be9786e530e4d2647eb227152
refs/heads/master
2020-12-24T20:52:16.373551
2017-06-08T18:17:41
2017-06-08T18:17:41
56,684,112
1
0
null
2016-04-20T13:19:02
2016-04-20T12:16:05
Java
UTF-8
Java
false
false
456
java
public class Wort implements Text{ //Klassenattribut wird initialisiert: private String w; //Der Konstruktor weist den Parameter dem Attribut zu: public Wort (String w){ this.w = new String(w); } //Getter-Methode fuer w: public String getText(){ return this.w; } //Fuegt w einen weiteren Text hinzu: public void append(Text txt){ this.w += txt; } //toString-Methode wird überschrieben: public String toString(){ return this.w; } }
9c9db155748acb00b9aa1610ac7fb6120f703491
61f2cdcab3560712d3617855b83e5b4ddc799a39
/CCF_Practice/src/cn/com/arith/PAT_1006.java
757c0fdfab94a19fe5c920bd200c8335a3f7377e
[]
no_license
black111/repository
e66942f62e9581f89fa5ebff7276aed32b31d7dd
15fadc0a08608f3e09709191f5ac18bbfc627360
refs/heads/master
2018-09-02T04:52:24.073247
2018-06-11T08:27:01
2018-06-11T08:27:01
107,487,671
0
0
null
null
null
null
UTF-8
Java
false
false
450
java
package cn.com.arith; import java.util.Scanner; public class PAT_1006 { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int gewei=n%10; n/=10; int shiwei=n%10; n/=10; int baiwei=n; for(int i=0;i<baiwei;i++){ System.out.print("B"); } for(int i=0;i<shiwei;i++){ System.out.print("S"); } for(int i=0;i<gewei;i++){ System.out.print(i+1); } } }
2d6a7944197019b398ebd409baf4bdb6621dc332
6d179acf22eba88bd3f6e3ab58b74a4a5ce0813c
/app/src/main/java/com/example/teamnaji/mhci/EnvironmentFragment.java
203d03ec2375b875a4a66845e9b7688a029cbc32
[]
no_license
gerardward3/mobhci
e7e9def84b5b8a80df7489ea6da925fcd16345f3
3bcab6d5c20c1ece39334747769ae17adbb91b62
refs/heads/master
2020-04-24T06:54:25.839714
2019-03-13T23:07:27
2019-03-13T23:07:27
171,780,696
0
0
null
null
null
null
UTF-8
Java
false
false
771
java
package com.example.teamnaji.mhci; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; public class EnvironmentFragment extends Fragment { public EnvironmentFragment(){} public static EnvironmentFragment newInstance(String param1, String param2) { EnvironmentFragment fragment = new EnvironmentFragment(); Bundle args = new Bundle(); fragment.setArguments(args); return fragment; } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){ View view = inflater.inflate(R.layout.activity_environment, container, false); return view; } }
ffbb96fdb82122afad7c7b30ed46424b5fe03a45
87bef9b146288b8b6cd5e36ed1aec9f4aedf1db2
/src/assignment2/Driver.java
9fd38e01234862fa06d0c9108092fada97415b75
[]
no_license
Australix/Mastermind-game
642a4c22c6b38343bb17dfefe034533bc1bb223c
3aba59282a9cc6f0372feea580f23b303daec983
refs/heads/master
2020-04-07T14:19:27.593336
2018-11-20T19:44:06
2018-11-20T19:44:06
158,442,601
0
0
null
null
null
null
UTF-8
Java
false
false
781
java
/* * EE422C Project 2 (Mastermind) submission by * Timberlon Gray * tg22698 * Slip days used: <0> * Spring 2017 */ package assignment2; import java.util.Scanner; public class Driver { public static void main(String[] args) { Scanner keyboard = new Scanner(System.in); String input = "Y"; System.out.println("Welcome to Mastermind."); // full game loop while(input.equals("Y")){ System.out.println("Do you want to play a new game? (Y/N):"); input = keyboard.next(); if(input.equals("Y")) { boolean cheatEnable; if(args.length != 0 && args[0].equals("1")) cheatEnable = true; else cheatEnable = false; Game currentGame = Game.createGame(cheatEnable, keyboard); currentGame.runGame(); } } keyboard.close(); } }
597bf88d6817d010f5afdd353fb0a936541d01cb
89dab002521fda4c2e02563eda300e6f850b0770
/src/cn/edu/ustc/ttcn/itsec/dao/TestSystemDaoForMysql.java
69ec860522dd654c6f2e14b1d496e17c8a2ce7d1
[]
no_license
Grahamlc/itsec
e38db6b8f4867a6a4b9bd2617bd0264a3567890f
57f8631560aad40a4ac6edba0c1700978e44492a
refs/heads/master
2020-12-03T00:44:33.705853
2017-07-03T06:46:17
2017-07-03T06:46:17
96,075,554
0
1
null
null
null
null
UTF-8
Java
false
false
2,383
java
package cn.edu.ustc.ttcn.itsec.dao; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import org.springframework.orm.hibernate4.support.HibernateDaoSupport; import cn.edu.ustc.ttcn.itsec.model.Role; import cn.edu.ustc.ttcn.itsec.model.Systems; import cn.edu.ustc.ttcn.itsec.model.TestSystem; import cn.edu.ustc.ttcn.itsec.model.Tester; import cn.edu.ustc.ttcn.itsec.model.TesterOfSystem; public class TestSystemDaoForMysql extends HibernateDaoSupport implements TestSystemDao{ private TestSystem testSystem; private TesterOfSystem tos; private Role role; private Tester tester; public TestSystem getTestSystem() { return testSystem; } public void setTestSystem(TestSystem testSystem) { this.testSystem = testSystem; } public TesterOfSystem getTos() { return tos; } public void setTos(TesterOfSystem tos) { this.tos = tos; } public Role getRole() { return role; } public void setRole(Role role) { this.role = role; } public Tester getTester() { return tester; } public void setTester(Tester tester) { this.tester = tester; } @SuppressWarnings("unchecked") @Override public void saveTestSys(TestSystem testsystem) { // TODO Auto-generated method stub this.getHibernateTemplate().save(testsystem); } @Override public void delTestSys(TestSystem testsystem) { // TODO Auto-generated method stub this.getHibernateTemplate().delete(testsystem); } @Override public List<TestSystem> selAllTestSys(int sysId) { // TODO Auto-generated method stub String hql = "from TestSystem as it where it.system.autoId = ?"; return (List<TestSystem>) this.getHibernateTemplate().find(hql, sysId); } @SuppressWarnings("unchecked") @Override public List<TestSystem> selMTestSystem(int testSysId) { // TODO Auto-generated method stub String hql = "from TestSystem as it where it.autoId = ?"; return (List<TestSystem>) this.getHibernateTemplate().find(hql, testSysId); } @Override public void update(TestSystem testSystem) { // TODO Auto-generated method stub this.getHibernateTemplate().update(testSystem); } @Override public List<TestSystem> selMTestSystems(int proId) { // TODO Auto-generated method stub String hql = "from TestSystem as it where it.project.autoId = ?"; return (List<TestSystem>) this.getHibernateTemplate().find(hql, proId); } }
9f1742e2ea105b81f6c8d07e9a112f4986787706
821dbb3ae4ed9f0f4bca33b86be3e5a2b56b99e3
/src/com/collection/class27/Demo1.java
aa89e2a017c035f7b4dba6ea387a5770447602ec
[]
no_license
EhsanullahAsim/SDETJavaBatch10
d267e8c053b0bccb4353473283878e5f53bfe810
cb04a54b46c8b8d1852e68caf0f31ca684122729
refs/heads/master
2023-08-04T09:30:33.261335
2021-09-19T19:12:18
2021-09-19T19:12:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
117
java
package com.collection.class27; public abstract class Demo1 { public static void main(String[] args) { } }
4ca1a9b463118d7d0272a864f27e83bdf4ae3722
353d758f4936639c3e111aa02ac20591a86a214d
/src/lab3p2_franciscovilleda_12111170/Coordinador.java
b189c4b4cf9cf52225525ec7df54c46bb2c8f38d
[]
no_license
villefrancisco/Lab3P2_FranciscoVilleda
856e0ee9868f08b8061dfa3af2245d46c82467fe
b44d83fc8c4a520344c4232825caaa7f8bdaaf12
refs/heads/master
2023-08-19T20:06:37.741746
2021-10-30T01:18:07
2021-10-30T01:18:07
422,688,487
0
0
null
null
null
null
UTF-8
Java
false
false
615
java
package lab3p2_franciscovilleda_12111170; import java.util.ArrayList; public class Coordinador extends Entrenador{ ArrayList <Pokemon> pokemones = new ArrayList(); public Coordinador() { } public Coordinador(String nombre, String sexo, int edad) { super(nombre, sexo, edad); } public ArrayList<Pokemon> getPokemones() { return pokemones; } public void setPokemones(ArrayList<Pokemon> pokemones) { this.pokemones = pokemones; } @Override public String toString() { return "Coordinador{" + "pokemones=" + pokemones + '}'; } }
130d320dce7874c8616fa8bbcbbda4cb16c9ac6f
972b0cf1512ebd17bc18d8d460f34757576eb5c2
/app/src/main/java/com/jsqix/gxt/app/utils/CityUtils.java
3af17fc77bb304130ba74cbacd26b74376ac2981
[]
no_license
a823875383/Gxt
5b4990682c69ddcefa3bfd757ae6f4d2410ca102
2df140179b8935265141eb5e3b155a7d76f3109a
refs/heads/master
2020-04-15T14:57:04.698645
2016-11-07T03:19:21
2016-11-07T03:19:21
68,093,399
0
0
null
null
null
null
UTF-8
Java
false
false
5,154
java
package com.jsqix.gxt.app.utils; import android.content.Context; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; /** * @author dq */ public class CityUtils { /** * 把全国的省市区的信息以json的格式保存,解析完成后赋值为null */ private JSONObject mJsonObj; private Context context; static CityUtils utils; public CityUtils() { } public CityUtils(Context context) { this.context = context; initJsonData(); } public static CityUtils getInstance(Context context) { if (utils == null) { utils = new CityUtils(context); } return utils; } /** * 从assert文件夹中读取省市区的json文件,然后转化为json对象 */ private void initJsonData() { try { StringBuffer sb = new StringBuffer(); InputStream is = context.getAssets().open("city.json"); int len = -1; byte[] buf = new byte[1024]; while ((len = is.read(buf)) != -1) { sb.append(new String(buf, 0, len, "utf-8")); } is.close(); mJsonObj = new JSONObject(sb.toString()); } catch (IOException e) { e.printStackTrace(); } catch (JSONException e) { e.printStackTrace(); } } public ArrayList<String> getPro() { ArrayList<String> pros = new ArrayList<String>(); try { JSONArray jsonArray = mJsonObj.getJSONArray("citylist"); for (int i = 0; i < jsonArray.length(); i++) { JSONObject jsonP = jsonArray.getJSONObject(i);// 每个省的json对象 String province = jsonP.getString("p");// 省名字 pros.add(province); } } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } return pros; } public ArrayList<ArrayList<String>> getCity() { ArrayList<ArrayList<String>> cities = new ArrayList<ArrayList<String>>(); try { JSONArray jsonArray = mJsonObj.getJSONArray("citylist"); for (int i = 0; i < jsonArray.length(); i++) { JSONObject jsonP = jsonArray.getJSONObject(i);// 每个省的json对象 ArrayList<String> pro = new ArrayList<String>(); JSONArray jsonCs; try { /** * Throws JSONException if the mapping doesn't exist or is * not a JSONArray. */ jsonCs = jsonP.getJSONArray("c"); } catch (Exception e1) { continue; } for (int j = 0; j < jsonCs.length(); j++) { JSONObject jsonCity = jsonCs.getJSONObject(j); String city = jsonCity.getString("n");// 市名字 pro.add(city); } cities.add(pro); } } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } return cities; } public ArrayList<ArrayList<ArrayList<String>>> getArea() { ArrayList<ArrayList<ArrayList<String>>> areas = new ArrayList<ArrayList<ArrayList<String>>>(); try { JSONArray jsonArray = mJsonObj.getJSONArray("citylist"); for (int i = 0; i < jsonArray.length(); i++) { JSONObject jsonP = jsonArray.getJSONObject(i);// 每个省的json对象 ArrayList<ArrayList<String>> pro = new ArrayList<ArrayList<String>>(); JSONArray jsonCs; try { /** * Throws JSONException if the mapping doesn't exist or is * not a JSONArray. */ jsonCs = jsonP.getJSONArray("c"); } catch (Exception e1) { continue; } for (int j = 0; j < jsonCs.length(); j++) { JSONObject jsonCity = jsonCs.getJSONObject(j);// 每个市的json对象 ArrayList<String> city = new ArrayList<String>(); JSONArray jsonAs; try { jsonAs = jsonCity.getJSONArray("a"); } catch (Exception e2) { continue; } for (int k = 0; k < jsonAs.length(); k++) { JSONObject jsonArea = jsonAs.getJSONObject(k); String area = jsonArea.getString("s");//区名字 city.add(area); } pro.add(city); } areas.add(pro); } } catch (JSONException e) { } return areas; } public void destory() { utils = null; mJsonObj = null; } }
1c07c16109ce2c058b7c9abb2548639637b35ab3
3c048d15b17bb465426c8758b488befc6a8f26fd
/src/main/java/com/github/chen0040/leetcode/day17/medium/EvaluateDivision.java
da5fb89f87d3fcab420d07f5fa168ad45cf2315f
[ "MIT" ]
permissive
aspineonxyz/java-leetcode
d6b54565f5042535727a2b8986f13c56b0d010be
83cc0ab474cb171cb3d6be869209b4a8c96857ea
refs/heads/master
2020-07-16T04:23:01.528912
2017-08-20T03:29:50
2017-08-20T03:29:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,976
java
package com.github.chen0040.leetcode.day17.medium; import java.util.*; /** * Created by xschen on 12/8/2017. * * link: https://leetcode.com/problems/evaluate-division/description/ */ public class EvaluateDivision { static class Edge { boolean inverse = false; double value; String from; String to; public Edge(String from, String to, double value, boolean inverse) { this.from = from; this.to = to; this.value = value; this.inverse = inverse; } public double compute() { if(inverse) return 1.0 / value; return value; } public String toString(){ return from + "->" + to; } } static class Graph { Map<String, List<Edge>> adjList = new HashMap<String, List<Edge>>(); public void addEdge(String from, String to, double value) { Edge e1 = new Edge(from, to, value, false); adj(from).add(e1); Edge e2 = new Edge(to, from, value, true); adj(to).add(e2); } public List<Edge> adj(String v){ List<Edge> adj_v = null; if(adjList.containsKey(v)) { adj_v = adjList.get(v); } else { adj_v = new ArrayList<Edge>(); adjList.put(v, adj_v); } return adj_v; } public double search(String s, String t) { Set<String> marked = new HashSet<String>(); Queue<String> queue = new LinkedList<String>(); Map<String, Edge> edgeTo = new HashMap<String, Edge>(); Map<String, Double> costs = new HashMap<String, Double>(); queue.add(s); costs.put(s, 0.0); while(!queue.isEmpty()) { String v = queue.remove(); marked.add(v); if(v.equals(t)) { break; } List<Edge> adj_v = adj(v); for(Edge e : adj_v){ String w = e.to; if(!costs.containsKey(w) || costs.get(w) > costs.get(v) + 1) { edgeTo.put(w, e); costs.put(w, costs.get(v) + 1); if(!marked.contains(w)) { queue.add(w); } } } } if(marked.contains(t)){ String x = t; Stack<Edge> stack = new Stack<Edge>(); while(!x.equals(s)) { Edge e = edgeTo.get(x); stack.push(e); x = e.from; } List<Edge> path = new ArrayList<Edge>(); while(!stack.isEmpty()) { path.add(stack.pop()); } double result = 1.0; for(int i=0; i < path.size(); ++i) { result = result * path.get(i).compute(); } return result; } else { return -1.0; } } } public class Solution { public double[] calcEquation(String[][] equations, double[] values, String[][] queries) { Set<String> known = new HashSet<String>(); Graph g = new Graph(); for(int i=0; i < equations.length; ++i) { String[] equation = equations[i]; String from = equation[0]; String to = equation[1]; known.add(from); known.add(to); double value = values[i]; g.addEdge(from, to, value); } double[] result = new double[queries.length]; for(int i=0; i < queries.length; ++i) { String[] query = queries[i]; String from = query[0]; String to = query[1]; if(from.equals(to)) { if(!known.contains(from)) { result[i] = -1.0; } else { result[i] = 1.0; } } else { result[i] = g.search(from, to); } } return result; } } }
bb39cf360d472c387f96d4dfa28c343c9cf8f5e5
9fa866bd96f7d56beb8b8478c49862fbc0c86f7e
/app/src/main/java/co/i014114/www/toolbar/MainActivity.java
111ab06f8ba46a74e61f2c7aa8c2014ebbd797b1
[]
no_license
SantiagoAlvarezA/ToolBar
eea7a401e711d54ec16592e1b6f32aef8aad7654
9388a96d6513c31dac1fec99880b61d32946fdd0
refs/heads/master
2021-07-16T18:06:17.364984
2017-10-24T04:38:50
2017-10-24T04:38:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,246
java
package co.i014114.www.toolbar; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; public class MainActivity extends AppCompatActivity { Toolbar toolbar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); toolbar = (Toolbar) findViewById(R.id.tolbar1); showToolbar(getResources().getString(R.string.str_tb_p1)); } public void showToolbar(String titulo) { setSupportActionBar(toolbar); getSupportActionBar().setTitle(titulo); } @Override public boolean onCreateOptionsMenu(Menu mimenu) { getMenuInflater().inflate(R.menu.mimenu, mimenu); return super.onCreateOptionsMenu(mimenu); } @Override public boolean onOptionsItemSelected(MenuItem item) { showpantallaDos(); return super.onOptionsItemSelected(item); } public void showpantallaDos(){ Intent intent= new Intent(getApplicationContext(), Pantalla2.class ); startActivity(intent); } }
d785e1d6526eb3fbbb7cd1cd36958c4eb3877995
f445ac7f2e7963e2a41920d686024f68e7c2278a
/rpc-common/src/main/java/org/cyka/registry/etcd/EtcdServiceRegistry.java
6b48b4adc9b118b19d36af6aff0a48059728b20a
[ "WTFPL" ]
permissive
18801284571/nettyAll
dc204ee5da5bf6c0bbc6f6ca5f0c6a31f3e0f903
20817a7340703a5d4145bad917990dc6d7e5b1ce
refs/heads/master
2023-04-14T08:45:43.488995
2021-03-25T06:02:16
2021-03-25T06:02:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,570
java
package org.cyka.registry.etcd; import com.google.common.base.Charsets; import io.etcd.jetcd.ByteSequence; import io.etcd.jetcd.Client; import io.etcd.jetcd.KV; import io.etcd.jetcd.Lease; import io.etcd.jetcd.lease.LeaseKeepAliveResponse; import io.etcd.jetcd.options.DeleteOption; import io.etcd.jetcd.options.PutOption; import io.etcd.jetcd.support.CloseableClient; import io.grpc.stub.StreamObserver; import lombok.extern.slf4j.Slf4j; import org.cyka.registry.ServiceRegistry; import java.net.InetAddress; import java.net.UnknownHostException; import java.text.MessageFormat; import java.util.Objects; import java.util.concurrent.ExecutionException; /** etcd 键值存储注册中心 */ @Slf4j public class EtcdServiceRegistry implements ServiceRegistry { // ---------------------------constant----------------------------------------- // lease TTL private static final int LeaseTTL = 60; // ----------------------------etcd-------------------------------------------- // lease id private Long leaseId; // etcd kv client private final KV kv; // lease client -- need to get from etcd client private final Lease lease; private final Client client; private CloseableClient keepAliveClient; @Override public void register(String serviceName, Integer port) { register(serviceName, getHostIp(), port); } @Override public void register(String serviceName, String ipAddress, Integer port) { String strKey = MessageFormat.format( "/{0}/{1}/{2}:{3}", EtcdClientHolder.getRootpath(), serviceName, ipAddress, String.valueOf(port)); ByteSequence key = ByteSequence.from(strKey, Charsets.UTF_8); ByteSequence val = ByteSequence.from("", Charsets.UTF_8); // wait for the future try { kv.put(key, val, PutOption.newBuilder().withLeaseId(leaseId).build()).get(); } catch (InterruptedException e) { log.warn("register has bean interrupt: {}", e.getMessage()); } catch (ExecutionException e) { log.warn("register fail : {}", e.getMessage()); } } @Override public void unRegister(String serviceName, String ipAddress, Integer port) { String strKey = MessageFormat.format( "/{0}/{1}/{2}:{3}", EtcdClientHolder.getRootpath(), serviceName, ipAddress, String.valueOf(port)); ByteSequence key = ByteSequence.from(strKey, Charsets.UTF_8); kv.delete(key, DeleteOption.newBuilder().build()); } @Override public void disconnect() { if (Objects.nonNull(keepAliveClient)) { keepAliveClient.close(); EtcdClientHolder.disconnect(); } } // ----------------------------private method------------------------------------- /** * get local Ip Address : it may be local area network ip (not the public ip) * * @return string */ private String getHostIp() { try { return InetAddress.getLocalHost().getHostAddress(); } catch (UnknownHostException e) { log.warn("cannot get the local host ip , using localhost as service ip"); } return "127.0.0.1"; } private void keepAliveWithEtcd() { keepAliveClient = lease.keepAlive( leaseId, new StreamObserver<LeaseKeepAliveResponse>() { @Override public void onNext(LeaseKeepAliveResponse leaseKeepAliveResponse) { log.info( "lease id :{} ,new lease ttl : {}", leaseKeepAliveResponse.getID(), leaseKeepAliveResponse.getTTL()); } @Override public void onError(Throwable throwable) { log.error("keep alive occurs error: {}", throwable.getMessage()); } @Override public void onCompleted() { log.debug("finish keep alive"); } }); } // -----------------------constructor--------------------------------------- public EtcdServiceRegistry() { this(null, LeaseTTL); } public EtcdServiceRegistry(String registryAddress) { this(registryAddress, LeaseTTL); } public EtcdServiceRegistry(String registryAddress, int leaseTTL) { this.client = EtcdClientHolder.getOrCreateClient(registryAddress); this.kv = client.getKVClient(); this.lease = client.getLeaseClient(); try { this.leaseId = lease.grant(leaseTTL).get().getID(); } catch (InterruptedException | ExecutionException e) { log.error(e.getLocalizedMessage()); e.printStackTrace(); } keepAliveWithEtcd(); } }
be9b9d614c63cc516c89f2edb74f8c629cc351c4
9e98bccb276a8e2b6d899ddd5f75bbb65e8fa9d0
/src/model/Retina.java
d41c978d61b90695472f9e5bb9b8d2ad29d49a32
[]
no_license
Lusquino/WisardEmocoes
f5c292d8e98db31ce5fa469680979553ff17deea
b0df2d092f23688b3386e840abebe70cadbfcbde
refs/heads/master
2021-04-15T02:15:42.951246
2018-03-05T23:35:44
2018-03-05T23:35:44
94,556,506
0
0
null
null
null
null
ISO-8859-1
Java
false
false
2,855
java
package model; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.io.Serializable; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Random; public class Retina implements Serializable { private static final long serialVersionUID = 1L; private Map<Integer, Integer> retina; private OutputStream out; public Retina(int inputLength) { retina = new HashMap<Integer, Integer>(); for(int i = 0; i < inputLength; i++) { retina.put(i, i); } Random rnd = new Random(); for(int i = 0; i < inputLength; i++) { int randomInd = rnd.nextInt(inputLength); int temp = retina.get(i); retina.put(i, retina.get(randomInd)); retina.put(randomInd, temp); } try { out = new FileOutputStream(new File("C:/Users/Usuario/Desktop/Mestrado/Dissertação/DatasetMMI/erros.txt")); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public List<Boolean> organize(List<Boolean> input) throws IOException { List<Boolean> organizedInput = new ArrayList<Boolean>(); // System.out.println("Tamanho do input: "+ input.size()); //System.out.println("Tamanho da retina: "+ retina.keySet().size()); for (int i = 0; i < retina.keySet().size(); i++) { //if(i>=retina.size()){System.out.println("Vai dar caoooooooo");} //out.write((i+"/"+retina.keySet().size()+"/n/n").getBytes()); int temp1 = retina.get(i); boolean temp2 = input.get(temp1); organizedInput.add(temp2); //System.out.println("Adicionei na lista reorganizada: "+ input.get(retina.get(i))); } return organizedInput; } public List<Boolean> reorganize(List<Boolean> inputOrganizado) { List<Boolean> input = inputOrganizado; double verdadeiro = 0, falso = 0; for(int i=0;i<inputOrganizado.size();i++) { if(inputOrganizado.get(i)){verdadeiro++;} if(!inputOrganizado.get(i)){falso++;} } System.out.println(verdadeiro+";"+falso); System.out.println("retina:"+retina.keySet().size()+"; lista:"+inputOrganizado.size()); for (int i = 0; i < retina.keySet().size(); i++) { input.set(retina.get(i), inputOrganizado.get(i)); } return input; } public List<Boolean> sort(List<Boolean> input) { Boolean[] sortedInput = new Boolean[input.size()]; for(int i = 0; i < retina.keySet().size(); i++) { sortedInput[retina.get(i)] = input.get(i); } return Arrays.asList(sortedInput); } }
e07cba4a64fb8d276505ef1faf15fffa1fc27e2c
c2c18c0235ca4073c3d13a21987441335ca9853a
/XooDB/src/com/xoodb/beans/SQLQuery.java
95eb38b196dd884ac1ea4c0752c0109bdb115eb8
[]
no_license
dhanoopbhaskar/xoodb
3d40462187053bf493390de5adfcf4762639e438
8c1f1e0215f69ef1e52556f3f2bed113c79178bc
refs/heads/master
2021-01-21T12:40:56.342455
2013-08-14T09:49:21
2013-08-14T09:49:21
11,561,743
1
0
null
null
null
null
UTF-8
Java
false
false
214
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.xoodb.beans; /** * * @author dhanoopbhaskar */ public interface SQLQuery extends SQLBean { }
c609287c341b048c9a35165e8a64910bdedd8bfa
36b6b363711012d0150e42ca03b9faf66749a11b
/android/app/src/main/java/com/myrn/rnbridge/HelloWorldPackage.java
3ac0625b4f0e75ee05c9483454c54efba3af6043
[]
no_license
defghy/my-rn
4ae8e7f8352cbaef6c0a0e85563fdce96e6a16c6
0977653b0b62496e693c28b41643b3363fa6c93a
refs/heads/master
2023-01-12T12:11:54.458893
2019-10-08T10:30:42
2019-10-08T10:30:42
120,161,057
1
0
null
2022-12-03T05:01:34
2018-02-04T06:28:28
JavaScript
UTF-8
Java
false
false
910
java
// android/app/src/main/java/com/cppreactnative/helloworld/HelloWorldPackage.java package com.myrn.rnbridge; import com.facebook.react.ReactPackage; import com.facebook.react.bridge.NativeModule; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.uimanager.ViewManager; import java.util.ArrayList; import java.util.Collections; import java.util.List; public class HelloWorldPackage implements ReactPackage { @Override public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) { return Collections.emptyList(); } @Override public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { List<NativeModule> modules = new ArrayList<>(); modules.add(new HelloWorld(reactContext)); //this is where we register our module, and any others we may later add return modules; } }
c1298b2b1602eab3a22a3a5fa35afc9aff0ddca9
5da5576711dafa986bfc4b16de62ef632ecaa1fd
/app/src/main/java/com/zomato_demo/NetworkManager/BaseManager.java
d6cfe17dfadd032e7bb777c7bdd2e05682e60e59
[]
no_license
Prajwalpraju3/ZomatoDemo
b72080f1a9a2369bbdcee097a6c20112e56c029d
75d73a99d19c1cf43b92f79e5efcd16e586d118a
refs/heads/master
2020-05-24T22:12:08.526552
2019-05-24T09:46:06
2019-05-24T09:46:06
187,493,326
0
0
null
null
null
null
UTF-8
Java
false
false
2,092
java
package com.zomato_demo.NetworkManager; import android.content.Context; import android.util.Log; import android.widget.Toast; import com.google.gson.Gson; import com.zomato_demo.Interfaces.DataCallBackListener; import java.io.IOException; import androidx.annotation.NonNull; import okhttp3.Request; import okhttp3.RequestBody; import okio.Buffer; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; import static android.content.ContentValues.TAG; public class BaseManager<E> implements Callback<E> { private Context context; public BaseManager(Context context) { this.context = context; } private DataCallBackListener<E> getDataCallBack; public synchronized Call<E> sendRequest(Call<E> call, DataCallBackListener<E> getDataCallBack) { this.getDataCallBack = getDataCallBack; Request request = call.request(); Log.i(TAG, "sendRequest: url=" + request.url() + " header=" + request.headers()+" body="+bodyToString(request.body())); call.enqueue(this); return call; } @Override public void onResponse(@NonNull final Call<E> call, @NonNull Response<E> response) { try { getDataCallBack.onResponse(response.body()); } catch (Exception e) { e.printStackTrace(); } } @Override public void onFailure(@NonNull Call<E> call, @NonNull Throwable t) { //error response to handle try { Toast.makeText(context, t.getMessage(), Toast.LENGTH_SHORT).show(); getDataCallBack.onError(t); } catch (Exception e) { e.printStackTrace(); } } private String bodyToString(final RequestBody request) { try { final RequestBody copy = request; final Buffer buffer = new Buffer(); if (copy != null) copy.writeTo(buffer); else return ""; return buffer.readUtf8(); } catch (final IOException e) { return "did not work"; } } }
faee4d0a913a0283f55fb9b4e1a211d1fb91339b
64cbea24e7394c4c647c019d8194f63b4ddc1d5e
/shakyo/slackjoytasq/java/lesson86.java
1550bcb34df29691c2059b0fa4c8e4c1fb677143
[]
no_license
karakazeviewview/miniSite3
9a524a938e7bc187fb2cf857e566a221e74594b2
6f99d85ef9397cd3aa9102d730bfd7d2304eb8b8
refs/heads/master
2023-01-24T09:28:20.828703
2020-11-27T00:21:24
2020-11-27T00:21:24
313,658,515
0
0
null
null
null
null
UTF-8
Java
false
false
601
java
import java.util.*; public class lesson86{ public static void main(String[] args){ System.out.print("体重を入力してください(kg)>"); int weight=new java.util.Scanner(System.in).nextInt(); System.out.print("身長を入力してください(cm)>"); int height=new java.util.Scanner(System.in).nextInt(); double bmi=calcBMI(weight,height); System.out.print("体重:"+weight+"身長:"+height+"のBMIは"+bmi+"です"); } public static double calcBMI(double weightKg,double heightCm){ double heightM=heightCm/100; double bmi=weightKg/(heightM*heightM); return bmi; } }
85bc7e964210299add234db4e95a558db3966a99
72cbd420d57f970a6bfbf9cf4dc62f662e6a0ebb
/plugin/core/src/com/perl5/lang/perl/idea/editor/smartkeys/options/PerlSmartKeyOptions.java
a02f6c7dcfc320a8095be7fe56d983665c0cc812
[ "Apache-2.0" ]
permissive
xcodejoy/Perl5-IDEA
e36061de84cc1780ed76711190bb5ce4b05fa3f0
2179a9ab2e9006d4c5501a878f484293220046ac
refs/heads/master
2020-09-19T09:15:35.960543
2019-11-23T08:46:28
2019-11-23T08:46:28
224,215,081
1
0
NOASSERTION
2019-11-26T14:44:56
2019-11-26T14:44:55
null
UTF-8
Java
false
false
1,987
java
/* * Copyright 2015-2019 Alexandr Evstigneev * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.perl5.lang.perl.idea.editor.smartkeys.options; import com.intellij.openapi.options.BeanConfigurable; import com.intellij.openapi.options.UnnamedConfigurable; import com.intellij.ui.IdeBorderFactory; import com.perl5.PerlBundle; import com.perl5.lang.perl.idea.codeInsight.Perl5CodeInsightSettings; import javax.swing.*; public class PerlSmartKeyOptions extends BeanConfigurable<Perl5CodeInsightSettings> implements UnnamedConfigurable { public PerlSmartKeyOptions() { super(Perl5CodeInsightSettings.getInstance()); checkBox(PerlBundle.message("perl.options.auto.heredoc"), () -> getInstance().HEREDOC_AUTO_INSERTION, value -> getInstance().HEREDOC_AUTO_INSERTION = value); checkBox(PerlBundle.message("perl.options.auto.colon"), () -> getInstance().AUTO_INSERT_COLON, value -> getInstance().AUTO_INSERT_COLON = value); checkBox(PerlBundle.message("perl.options.smart.comma.sequence"), () -> getInstance().SMART_COMMA_SEQUENCE_TYPING, value -> getInstance().SMART_COMMA_SEQUENCE_TYPING = value); } @Override public JComponent createComponent() { JComponent panel = super.createComponent(); if (panel != null) { panel.setBorder(IdeBorderFactory.PlainSmallWithIndent.createTitledBorder(null, "Perl5", 0, 0, null, null)); } return panel; } }
15a46e38d5c43427b1350b5a6355eec0d915d465
1cc052f06b2044652a36756e7f1a0afa1136590c
/src/main/java/cn/qyl/ssmcrud/pojo/DeptExample.java
eee53afeaedc83c1acffa242ce58698ada975e74
[]
no_license
qyl544752103/ssm-
0ee1f6f415c66d3d74f251aabc5e8c81cf036f91
b82d71ba5613d994ee71cb4617c06eb5813981fa
refs/heads/master
2020-03-25T05:02:08.765585
2018-08-03T12:57:34
2018-08-03T12:57:34
143,424,037
0
0
null
null
null
null
UTF-8
Java
false
false
9,826
java
package cn.qyl.ssmcrud.pojo; import java.util.ArrayList; import java.util.List; public class DeptExample { protected String orderByClause; protected boolean distinct; protected List<Criteria> oredCriteria; public DeptExample() { oredCriteria = new ArrayList<Criteria>(); } public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; } public String getOrderByClause() { return orderByClause; } public void setDistinct(boolean distinct) { this.distinct = distinct; } public boolean isDistinct() { return distinct; } public List<Criteria> getOredCriteria() { return oredCriteria; } public void or(Criteria criteria) { oredCriteria.add(criteria); } public Criteria or() { Criteria criteria = createCriteriaInternal(); oredCriteria.add(criteria); return criteria; } public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); if (oredCriteria.size() == 0) { oredCriteria.add(criteria); } return criteria; } protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); return criteria; } public void clear() { oredCriteria.clear(); orderByClause = null; distinct = false; } protected abstract static class GeneratedCriteria { protected List<Criterion> criteria; protected GeneratedCriteria() { super(); criteria = new ArrayList<Criterion>(); } public boolean isValid() { return criteria.size() > 0; } public List<Criterion> getAllCriteria() { return criteria; } public List<Criterion> getCriteria() { return criteria; } protected void addCriterion(String condition) { if (condition == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion(condition)); } protected void addCriterion(String condition, Object value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value)); } protected void addCriterion(String condition, Object value1, Object value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value1, value2)); } public Criteria andDeptIdIsNull() { addCriterion("dept_id is null"); return (Criteria) this; } public Criteria andDeptIdIsNotNull() { addCriterion("dept_id is not null"); return (Criteria) this; } public Criteria andDeptIdEqualTo(Integer value) { addCriterion("dept_id =", value, "deptId"); return (Criteria) this; } public Criteria andDeptIdNotEqualTo(Integer value) { addCriterion("dept_id <>", value, "deptId"); return (Criteria) this; } public Criteria andDeptIdGreaterThan(Integer value) { addCriterion("dept_id >", value, "deptId"); return (Criteria) this; } public Criteria andDeptIdGreaterThanOrEqualTo(Integer value) { addCriterion("dept_id >=", value, "deptId"); return (Criteria) this; } public Criteria andDeptIdLessThan(Integer value) { addCriterion("dept_id <", value, "deptId"); return (Criteria) this; } public Criteria andDeptIdLessThanOrEqualTo(Integer value) { addCriterion("dept_id <=", value, "deptId"); return (Criteria) this; } public Criteria andDeptIdIn(List<Integer> values) { addCriterion("dept_id in", values, "deptId"); return (Criteria) this; } public Criteria andDeptIdNotIn(List<Integer> values) { addCriterion("dept_id not in", values, "deptId"); return (Criteria) this; } public Criteria andDeptIdBetween(Integer value1, Integer value2) { addCriterion("dept_id between", value1, value2, "deptId"); return (Criteria) this; } public Criteria andDeptIdNotBetween(Integer value1, Integer value2) { addCriterion("dept_id not between", value1, value2, "deptId"); return (Criteria) this; } public Criteria andDeptNameIsNull() { addCriterion("dept_name is null"); return (Criteria) this; } public Criteria andDeptNameIsNotNull() { addCriterion("dept_name is not null"); return (Criteria) this; } public Criteria andDeptNameEqualTo(String value) { addCriterion("dept_name =", value, "deptName"); return (Criteria) this; } public Criteria andDeptNameNotEqualTo(String value) { addCriterion("dept_name <>", value, "deptName"); return (Criteria) this; } public Criteria andDeptNameGreaterThan(String value) { addCriterion("dept_name >", value, "deptName"); return (Criteria) this; } public Criteria andDeptNameGreaterThanOrEqualTo(String value) { addCriterion("dept_name >=", value, "deptName"); return (Criteria) this; } public Criteria andDeptNameLessThan(String value) { addCriterion("dept_name <", value, "deptName"); return (Criteria) this; } public Criteria andDeptNameLessThanOrEqualTo(String value) { addCriterion("dept_name <=", value, "deptName"); return (Criteria) this; } public Criteria andDeptNameLike(String value) { addCriterion("dept_name like", value, "deptName"); return (Criteria) this; } public Criteria andDeptNameNotLike(String value) { addCriterion("dept_name not like", value, "deptName"); return (Criteria) this; } public Criteria andDeptNameIn(List<String> values) { addCriterion("dept_name in", values, "deptName"); return (Criteria) this; } public Criteria andDeptNameNotIn(List<String> values) { addCriterion("dept_name not in", values, "deptName"); return (Criteria) this; } public Criteria andDeptNameBetween(String value1, String value2) { addCriterion("dept_name between", value1, value2, "deptName"); return (Criteria) this; } public Criteria andDeptNameNotBetween(String value1, String value2) { addCriterion("dept_name not between", value1, value2, "deptName"); return (Criteria) this; } } public static class Criteria extends GeneratedCriteria { protected Criteria() { super(); } } public static class Criterion { private String condition; private Object value; private Object secondValue; private boolean noValue; private boolean singleValue; private boolean betweenValue; private boolean listValue; private String typeHandler; public String getCondition() { return condition; } public Object getValue() { return value; } public Object getSecondValue() { return secondValue; } public boolean isNoValue() { return noValue; } public boolean isSingleValue() { return singleValue; } public boolean isBetweenValue() { return betweenValue; } public boolean isListValue() { return listValue; } public String getTypeHandler() { return typeHandler; } protected Criterion(String condition) { super(); this.condition = condition; this.typeHandler = null; this.noValue = true; } protected Criterion(String condition, Object value, String typeHandler) { super(); this.condition = condition; this.value = value; this.typeHandler = typeHandler; if (value instanceof List<?>) { this.listValue = true; } else { this.singleValue = true; } } protected Criterion(String condition, Object value) { this(condition, value, null); } protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { super(); this.condition = condition; this.value = value; this.secondValue = secondValue; this.typeHandler = typeHandler; this.betweenValue = true; } protected Criterion(String condition, Object value, Object secondValue) { this(condition, value, secondValue, null); } } }
d4ac3393ec079057fea52e7fc402a00c61eace87
35a918b184fb55d1a47d5678692f5b5ad4d4d477
/FutureTechGitRepository/InputFromExcel/src/com/excel/input/Main.java
5acf5d6377fdecaf3c7497b3a4a778185ef67b81
[]
no_license
haqasad/Sources_FTech
906e0b3afcafd9e804e86bce9b0c7eb7043ad01e
2b79cca94a7c8d051f5d3d1afe3cf46f887cff7c
refs/heads/master
2020-05-20T23:44:52.337927
2017-03-14T12:47:15
2017-03-14T12:47:15
84,548,626
0
0
null
null
null
null
UTF-8
Java
false
false
2,386
java
package com.excel.input; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Iterator; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook; public class Main { // @SuppressWarnings("deprecation") public static void main(String[] args) throws IOException { /* // TODO Auto-generated method stub String excelFilePath = "Books.xlsx"; FileInputStream inputStream = new FileInputStream(new File(excelFilePath)); Workbook workbook = new XSSFWorkbook(inputStream); Sheet firstSheet = workbook.getSheetAt(0); Iterator<Row> iterator = firstSheet.iterator(); while (iterator.hasNext()) { Row nextRow = iterator.next(); Iterator<Cell> cellIterator = nextRow.cellIterator(); while (cellIterator.hasNext()) { Cell cell = cellIterator.next(); switch (cell.getCellType()) { case Cell.CELL_TYPE_STRING: System.out.print(cell.getStringCellValue()); break; case Cell.CELL_TYPE_BOOLEAN: System.out.print(cell.getBooleanCellValue()); break; case Cell.CELL_TYPE_NUMERIC: System.out.print(cell.getNumericCellValue()); break; } System.out.print(" - "); } System.out.println(); } workbook.close(); inputStream.close();*/ try { FileInputStream readFile = new FileInputStream("INPUT.xlsx"); Workbook workBook = new XSSFWorkbook(readFile); Sheet sheet = workBook.getSheet("input_one"); Row row = sheet.getRow(1); Cell cell = row.getCell(0); System.out.println(cell.getStringCellValue()); System.out.println(sheet.getLastRowNum()); workBook.close(); } catch (FileNotFoundException e) { e.printStackTrace(); //return null; } catch (IOException e) { e.printStackTrace(); //return null; } } }
a1c40aa9db620b42d3fcb92a508cff56f02fb4e4
5092b89a965d96ea1283aec9fa7103030b34997d
/src/main/java/com/fh/model/User.java
babfb738d8b4c11423d527bc998b53c299c3a1d5
[]
no_license
xjjm/user_feihu_springboot
64cda84efa093bad09c4d2e2239e9931c5e35385
23474701617ee32af29196177c8d195ab7b28140
refs/heads/master
2022-12-02T23:50:19.012792
2020-08-09T13:16:05
2020-08-09T13:16:05
286,225,826
0
0
null
null
null
null
UTF-8
Java
false
false
1,579
java
package com.fh.model; import org.springframework.format.annotation.DateTimeFormat; import java.util.Date; public class User { private Integer id; private String name; private String password; private String realname; private String imgpath; @DateTimeFormat(pattern = "yyyy-MM-dd") private Date registerdate; private Integer areaId; private String areaName; public String getAreaName() { return areaName; } public void setAreaName(String areaName) { this.areaName = areaName; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getRealname() { return realname; } public void setRealname(String realname) { this.realname = realname; } public String getImgpath() { return imgpath; } public void setImgpath(String imgpath) { this.imgpath = imgpath; } public Date getRegisterdate() { return registerdate; } public void setRegisterdate(Date registerdate) { this.registerdate = registerdate; } public Integer getAreaId() { return areaId; } public void setAreaId(Integer areaId) { this.areaId = areaId; } }
fbcd86418ae3486a4801efd3c877ac19171ead72
fa1408365e2e3f372aa61e7d1e5ea5afcd652199
/src/testcases/CWE134_Uncontrolled_Format_String/s01/CWE134_Uncontrolled_Format_String__File_printf_73b.java
2618fadf0cee4b343c2f01758b6d17b2922c9b8a
[]
no_license
bqcuong/Juliet-Test-Case
31e9c89c27bf54a07b7ba547eddd029287b2e191
e770f1c3969be76fdba5d7760e036f9ba060957d
refs/heads/master
2020-07-17T14:51:49.610703
2019-09-03T16:22:58
2019-09-03T16:22:58
206,039,578
1
2
null
null
null
null
UTF-8
Java
false
false
1,847
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE134_Uncontrolled_Format_String__File_printf_73b.java Label Definition File: CWE134_Uncontrolled_Format_String.label.xml Template File: sources-sinks-73b.tmpl.java */ /* * @description * CWE: 134 Uncontrolled Format String * BadSource: File Read data from file (named c:\data.txt) * GoodSource: A hardcoded string * Sinks: printf * GoodSink: dynamic printf format with string defined * BadSink : dynamic printf without validation * Flow Variant: 73 Data flow: data passed in a LinkedList from one method to another in different source files in the same package * * */ package testcases.CWE134_Uncontrolled_Format_String.s01; import testcasesupport.*; import java.util.LinkedList; public class CWE134_Uncontrolled_Format_String__File_printf_73b { public void badSink(LinkedList<String> dataLinkedList ) throws Throwable { String data = dataLinkedList.remove(2); if (data != null) { /* POTENTIAL FLAW: uncontrolled string formatting */ System.out.printf(data); } } /* goodG2B() - use GoodSource and BadSink */ public void goodG2BSink(LinkedList<String> dataLinkedList ) throws Throwable { String data = dataLinkedList.remove(2); if (data != null) { /* POTENTIAL FLAW: uncontrolled string formatting */ System.out.printf(data); } } /* goodB2G() - use BadSource and GoodSink */ public void goodB2GSink(LinkedList<String> dataLinkedList ) throws Throwable { String data = dataLinkedList.remove(2); if (data != null) { /* FIX: explicitly defined string formatting */ System.out.printf("%s%n", data); } } }
6ef4699a52420965897113ea84a1715f0a445f1b
ad894c109141f30022b71baf67c0997baaf48f58
/src/test/java/com/mycompany/myapp/service/mapper/DepartmentMapperTest.java
e2dd1c4cfe3f9845bedd8f64ba393ee91ea271ff
[]
no_license
henrique-barreto/jhipster-sample-application
c646be5001c3c391b7e1bd79dcd257a1df9516af
81b99155a92c894060cf29d103143ff2d98fe8d5
refs/heads/master
2022-12-24T14:56:28.176605
2020-01-30T18:15:39
2020-01-30T18:15:39
237,275,221
0
0
null
2022-12-16T04:43:44
2020-01-30T18:13:53
Java
UTF-8
Java
false
false
578
java
package com.mycompany.myapp.service.mapper; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; public class DepartmentMapperTest { private DepartmentMapper departmentMapper; @BeforeEach public void setUp() { departmentMapper = new DepartmentMapperImpl(); } @Test public void testEntityFromId() { Long id = 2L; assertThat(departmentMapper.fromId(id).getId()).isEqualTo(id); assertThat(departmentMapper.fromId(null)).isNull(); } }
9215cdf66872ad551e1250d6983c7a2742700aa3
06801ebd64b8fc7fe2fadf2429ecb3c79db112cc
/leshan-integration-tests/src/test/java/org/eclipse/leshan/integration/tests/RedisObserveTest.java
22bda2c11e76a35a8436ae76b7fd0762b5ef1c84
[ "EPL-2.0", "MPL-1.1", "LicenseRef-scancode-generic-export-compliance", "EPL-1.0", "Apache-2.0", "Apache-1.1", "BSD-3-Clause", "CPL-1.0" ]
permissive
somerb/leshan
dc45e5e812846f26f07fc629868efc364d33889a
79328743c52f69e74dc9d7729a5cdc87117da38d
refs/heads/master
2021-04-02T01:58:11.883175
2020-05-15T18:44:43
2020-05-15T18:44:43
248,231,867
0
0
BSD-3-Clause
2020-03-18T12:56:51
2020-03-18T12:56:50
null
UTF-8
Java
false
false
913
java
/******************************************************************************* * Copyright (c) 2016 Sierra Wireless and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v2.0 * and Eclipse Distribution License v1.0 which accompany this distribution. * * The Eclipse Public License is available at * http://www.eclipse.org/legal/epl-v20.html * and the Eclipse Distribution License is available at * http://www.eclipse.org/org/documents/edl-v10.html. * * Contributors: * Sierra Wireless - initial API and implementation *******************************************************************************/ package org.eclipse.leshan.integration.tests; public class RedisObserveTest extends ObserveTest { public RedisObserveTest() { helper = new RedisIntegrationTestHelper(); } }
8de4c71abe9c36fcb0b7e2a4ebdbfbe543bef44c
253c824459294edac88b292b035528c9a07b45ac
/app/src/main/java/com/azero/sampleapp/activity/weather/fragment/WeatherForecastInfoFragment.java
92aa6510120eccd6d67507b761ba4f072409e606
[ "Apache-2.0" ]
permissive
azerodeveloper/Azero_SDK_for_Android
276f7810b475baa773b889d4d72eb66308ca1568
36feb0054ee3395b89f403c64f264240da47ef62
refs/heads/master
2023-06-28T17:52:09.128144
2021-07-31T06:29:25
2021-07-31T06:29:25
216,775,682
0
0
Apache-2.0
2023-06-26T04:05:38
2019-10-22T09:33:39
Java
UTF-8
Java
false
false
2,666
java
/* * Copyright (c) 2019 SoundAI. All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ package com.azero.sampleapp.activity.weather.fragment; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import com.azero.sampleapp.R; import com.bumptech.glide.Glide; import com.azero.sampleapp.activity.weather.data.WeatherDaily; import androidx.annotation.NonNull; import androidx.annotation.Nullable; /** * A simple {@link } subclass. * Use the {@link WeatherForecastInfoFragment#} factory method to * create an instance of this fragment. */ public class WeatherForecastInfoFragment extends WeatherFragmentBase { private static final String ARG_WEATHER_INFO = "ARG_WEATHER_INFO"; private ImageView weatherIcon; private ImageView backgroundView; private TextView weatherTmpDay; public WeatherForecastInfoFragment() { // Required empty public constructor } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment return inflater.inflate(R.layout.weather_fragment_weather_forecast_info_layout, container, false); } @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); initView(view); updateView(); } public void initView(View view) { weatherIcon = view.findViewById(R.id.weather_icon); backgroundView = view.findViewById(R.id.bg); weatherTmpDay = view.findViewById(R.id.weather_tmp_day); } protected void updateView() { WeatherDaily weatherDaily =weather.getWeather(); weatherTmpDay.setText(getString(R.string.weather_day_temprure, weatherDaily.getLow(), weatherDaily.getHigh())); Glide.with(this).load(weatherDaily.getIconUrl()).into(weatherIcon); Glide.with(this).load(weatherDaily.getBackgroundUrl()).into(backgroundView); } }
6e1bf74cdefb06ce2d99ce90f63328c4252c4d59
9cc817f1b15bc941c3def18ef7ccd6b3f12fe211
/src/main/java/com/xinhuanet/pay/service/QuartzService.java
4bbc488659a975b103701b280d758800e01c9e1e
[]
no_license
liveqmock/xh_pay
a3948e69f2a9c124ed0e59226f914395617d8bed
0ea5db2212f45ee80723d3de01f3163c6432cd60
refs/heads/master
2020-12-28T23:34:53.290914
2014-08-25T09:13:31
2014-08-25T09:13:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
164
java
package com.xinhuanet.pay.service; /** * Created with IntelliJ IDEA. * User: 李野 * Date: 13-5-28 * Time: 上午11:20 */ public interface QuartzService { }
4126fa91c0e0708073c4b10b6a20c2a760f352b0
0b57ce7d4f8dd0cca4a49184db3ac8e09b1a0ef2
/DriverAssistant/app/src/main/java/consumer/entities/AddAccountInformation/Data.java
728928e5665bae470294a1aaf9396c5663462a6b
[]
no_license
Deepankur-Sadana/DriverAssistant
8a9db13676f7c38ff431ac533fcf075fc2947360
96ca05163b75826afbcea5e043b83f05601438c0
refs/heads/master
2021-01-10T18:00:49.571196
2015-11-16T11:29:37
2015-11-16T11:29:37
46,269,111
0
0
null
null
null
null
UTF-8
Java
false
false
3,383
java
package consumer.entities.AddAccountInformation; import java.util.HashMap; import java.util.Map; public class Data { private Integer account_id; private String account_name; private String account_number; private String account_ifsc_code; private String account_type; private String account_branch_name; private String created_at; private String updated_at; private Map<String, Object> additionalProperties = new HashMap<String, Object>(); /** * * @return * The account_id */ public Integer getAccount_id() { return account_id; } /** * * @param account_id * The account_id */ public void setAccount_id(Integer account_id) { this.account_id = account_id; } /** * * @return * The account_name */ public String getAccount_name() { return account_name; } /** * * @param account_name * The account_name */ public void setAccount_name(String account_name) { this.account_name = account_name; } /** * * @return * The account_number */ public String getAccount_number() { return account_number; } /** * * @param account_number * The account_number */ public void setAccount_number(String account_number) { this.account_number = account_number; } /** * * @return * The account_ifsc_code */ public String getAccount_ifsc_code() { return account_ifsc_code; } /** * * @param account_ifsc_code * The account_ifsc_code */ public void setAccount_ifsc_code(String account_ifsc_code) { this.account_ifsc_code = account_ifsc_code; } /** * * @return * The account_type */ public String getAccount_type() { return account_type; } /** * * @param account_type * The account_type */ public void setAccount_type(String account_type) { this.account_type = account_type; } /** * * @return * The account_branch_name */ public String getAccount_branch_name() { return account_branch_name; } /** * * @param account_branch_name * The account_branch_name */ public void setAccount_branch_name(String account_branch_name) { this.account_branch_name = account_branch_name; } /** * * @return * The created_at */ public String getCreated_at() { return created_at; } /** * * @param created_at * The created_at */ public void setCreated_at(String created_at) { this.created_at = created_at; } /** * * @return * The updated_at */ public String getUpdated_at() { return updated_at; } /** * * @param updated_at * The updated_at */ public void setUpdated_at(String updated_at) { this.updated_at = updated_at; } public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } public void setAdditionalProperty(String name, Object value) { this.additionalProperties.put(name, value); } }
1ee408aebafcacb5188ff40d4289fc76dfee80ba
dd70c26cbd7204e0b403ead6a6b8297b57bb3966
/src/main/java/dev/selena/olympicssite/controllers/EventController.java
59c88a790ddabedd66ccd4225b8a074f6fa02a90
[]
no_license
selenacl/olympics-api
b2a5a2a024da0500d2e13c182a3ba397422f3f21
d038a8ac505ef1673d210386c54fe5505aacb6cb
refs/heads/master
2022-04-21T22:58:29.662504
2020-04-19T00:41:56
2020-04-19T00:41:56
256,361,318
0
0
null
null
null
null
UTF-8
Java
false
false
79
java
package dev.selena.olympicssite.controllers; public class EventController { }
055d97ea7f602ef12c8da36f0b11faf550a855b8
ecb108d9f820a91c78ae771d1da8e33b8e6016df
/app/src/main/java/com/dong/easy/image/view/AspectImageView.java
9b3315d6ba62875419215b157eeb471dbc7dbd9e
[]
no_license
jadong/EasyUtil
c9408306ef4297358e8c994db5e0880f0e3f3f62
0f96477ea557390f6beeb324609c9532a64c17ea
refs/heads/master
2021-05-06T00:57:12.094307
2019-03-29T02:59:56
2019-03-29T02:59:56
114,338,369
4
0
null
null
null
null
UTF-8
Java
false
false
2,096
java
package com.dong.easy.image.view; import android.content.Context; import android.content.res.TypedArray; import android.util.AttributeSet; import com.dong.easy.R; public class AspectImageView extends android.support.v7.widget.AppCompatImageView { public static final float DEFAULT_ASPECT = 16f / 9f; private static final int VERTICAL = 0; private static final int HORIZONTAL = 0; private float aspect = DEFAULT_ASPECT; public AspectImageView(Context context) { super(context); } public AspectImageView(Context context, AttributeSet attrs) { super(context, attrs); TypedArray arr = context.obtainStyledAttributes(attrs, new int[] { R.attr.aspect }); aspect = arr.getFloat(0, aspect); arr.recycle(); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int width = MeasureSpec.getSize(widthMeasureSpec); int widthMode = MeasureSpec.getMode(widthMeasureSpec); int height = MeasureSpec.getSize(heightMeasureSpec); int heightMode = MeasureSpec.getMode(heightMeasureSpec); if (widthMode == MeasureSpec.EXACTLY || widthMode == MeasureSpec.AT_MOST) { height = calculate(width, aspect, VERTICAL); } else if (heightMode == MeasureSpec.EXACTLY || heightMode == MeasureSpec.AT_MOST) { width = calculate(height, aspect, HORIZONTAL); } else { throw new IllegalArgumentException("Either width or height should have exact value"); } int specWidth = MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY); int specHeight = MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY); super.onMeasure(specWidth, specHeight); } private int calculate(int size, float aspect, int direction) { int wp = getPaddingLeft() + getPaddingRight(); int hp = getPaddingTop() + getPaddingBottom(); return direction == VERTICAL ? Math.round((size - wp) / aspect) + hp : Math.round((size - hp) * aspect) + wp; } }
b00019b86bce55abe76a45fd4887718633b61e62
703e00ed539ecf22fb880c959adad5df307e4a8f
/src/main/java/com/fh/service/bmf/statistics/ProductBrowseService.java
67c2ef1cbf38816ff9e20ccea3c834bfe90e69ee
[]
no_license
Anthrax1985/bumofang
a4894cc03ca89848b5233667901bc18604b38f21
be342b3e6f94c29195de7e389c7a4b8da6a12f6b
refs/heads/master
2020-03-18T16:00:56.326852
2018-05-26T08:11:43
2018-05-26T08:11:43
134,942,265
0
0
null
null
null
null
UTF-8
Java
false
false
465
java
package com.fh.service.bmf.statistics; import org.springframework.stereotype.Service; import com.fh.service.BaseService; import com.fh.entity.bmf.statistics.ProductBrowse; /** * 类名称:ProductBrowse * 创建人:tyj * 创建时间:2017-08-02 */ @Service("productBrowseService") public class ProductBrowseService extends BaseService<ProductBrowse>{ protected String getNamespace() { return "ProductBrowseMapper"; } }
dbb8f34ace6736f228aa054693d14162da0fe283
acfc6b4cced7713292b5f11e169e357239cdc488
/gen/com/deadshot/andengine2/BuildConfig.java
08f67837a9f40660904cca6a050fd09813eda96a
[]
no_license
Deadshot-tawsoft/GameEngineFirstGame
f3b3665c653ab96c78c3d8aa3079098325778191
3a1f4a50c551894bfbb50179bd70529dcb4bdd0c
refs/heads/master
2020-04-17T08:11:46.001408
2014-05-20T18:02:35
2014-05-20T18:02:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
165
java
/** Automatically generated file. DO NOT MODIFY */ package com.deadshot.andengine2; public final class BuildConfig { public final static boolean DEBUG = true; }
6c8d9c90e1cae992faf2c249a90fef2d9fad7400
375f62237d93e0da0040a6c508a7175b59f53793
/src/test/java/com/wwt/sda/EmailPage.java
67109474b360a92d3fdec42598ef7d0d474975cc
[]
no_license
buchireddy76/sda
72caa5eb3de91e1ccbeb30fe65ff7203e171281f
7e1714218a18258a1b18805459516a473311f483
refs/heads/master
2021-01-25T10:00:31.587167
2013-10-28T20:29:20
2013-10-28T20:29:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,614
java
package com.wwt.sda; import java.util.ArrayList; import java.util.List; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; public class EmailPage { protected final WebDriver driver; @FindBy(xpath = "//*[@class='sub']") private WebElement subjectHeader; @FindBy(xpath = "//*[@class='bdy']//h1") private WebElement bodyFirstLine; @FindBy(xpath = "//*[@class='bdy']//div//table[2]//tbody//tr//td[2]") private WebElement releaseType; @FindBy(xpath = "//*[@class='bdy']//div//table[2]//tbody//tr[5]//td[2]") private WebElement ShpFrom; @FindBy(xpath = "//*[@class='bdy']//div//table[2]//tbody//tr[9]//td[2]") private WebElement ShpTo; @FindBy(xpath = "//*[@class='bdy']//div//table[3]//tbody//tr[4]//table//tbody//tr") private List<WebElement> tableRowsHFlex; @FindBy(xpath = "//*[@class='bdy']//div//table[3]//tbody//tr[2]//table//tbody//tr") private List<WebElement> tableRowsCM; @FindBy(xpath = "//*[@class='bdy']//div//table[3]//tbody//tr[6]//table//tbody//tr") private List<WebElement> tableRowsRFDS; public EmailPage(WebDriver driver) { this.driver = driver; } // For Outlook Interaction public void LoginOutlook() throws InterruptedException{ System.out.println("Logging to the Webmail account"); driver.navigate().to("https://webmail.wwt.com/"); driver.findElement(By.id("username")).sendKeys("ramidib"); driver.findElement(By.id("password")).sendKeys("Hello123"); driver.findElement(By.className("btn")).click(); Thread.sleep(10000); } public void clickInbox() throws InterruptedException{ driver.findElement(By.linkText("Inbox")).click(); Thread.sleep(3000); } public boolean verifyFirstMailSubject(String siteDetails){ boolean email=false; String subject = subjectHeader.getText(); System.out.println("Subject of First email in the Inbox is : "+subject); if (subject.contains("Order Submitted") && subject.contains(siteDetails)) { email = true; } else { email = false; } return email; } public void clickFirstEmail() throws InterruptedException { System.out.println("Click on the First email in the Inbox"); driver.findElement(By.xpath("//tr[3]/td[@class='frst'][6]/h1/a")).click();; Thread.sleep(1000); } public boolean verifySalesOrder(String sOrder) { String firstLineInBody[] = bodyFirstLine.getText().split(":"); String salesOrderInMailBdy = firstLineInBody[1]; String salesOrderInMail = salesOrderInMailBdy.trim(); System.out.println("The first line in Email body is : "+salesOrderInMail); if (salesOrderInMail.equals(sOrder)) { return true; } else { return false; } } public boolean verifyReleaseType(String typeRelease) { String releaseTypeInMail = releaseType.getText(); System.out.println("Release Type in email is : "+releaseTypeInMail); if (releaseTypeInMail.equals(typeRelease)) { return true; } else { return false; } } public boolean verifyShipFrom(String frmLocation) { String shpFromInMail = ShpFrom.getText(); System.out.println("Shipping location from in Email is : "+shpFromInMail); if (shpFromInMail.equals(frmLocation)) { return true; } else { return false; } } public boolean verifyShipTo(String toLocation) { String shpToInMail = ShpTo.getText(); System.out.println("Location to ship in Email is : "+shpToInMail); if (shpToInMail.equals(toLocation)) { return true; } else { return false; } } public boolean verifyTables(){ boolean flag=false; String consMtrlTable = driver.findElement(By.xpath("//h3[contains(text(),'CONSTRUCTION MATERIALS')]")).getText(); String hybriFlexTable = driver.findElement(By.xpath("//h3[contains(text(),'HYBRIFLEX')]")).getText(); String rfdsTable = driver.findElement(By.xpath("//h3[contains(text(),'RFDS MATERIALS')]")).getText(); if(consMtrlTable.contains("CONSTRUCTION") && hybriFlexTable.equals("HYBRIFLEX") && rfdsTable.contains("RFDS")){ System.out.println("RFDS, Hybriflex and Construction Material Tables are verified"); flag=true; } return flag; } public List emlReadTable(String tableName) { List emlCateg=new ArrayList(); List emlPart=new ArrayList(); List emlDesc=new ArrayList(); List emlCurDesg=new ArrayList(); List emlMainList=new ArrayList(); int m=0; if (tableName.equals("RFDS")) m =6; else if (tableName.equals("HFlex")) m =4; else if (tableName.equals("CM")) m =2; List<WebElement> list= driver.findElements(By.xpath("//table[@cellspacing='0'][3]//tr["+m+"]//table//tr")); System.out.println(" "); System.out.println("************** Printing values for " +tableName+ " Table for "+list.size()+" rows from the Email ***************"); for(int rows =2; rows <=list.size(); rows++){ String emlCategory= driver.findElement(By.xpath("//table[@cellspacing='0'][3]//tr["+m+"]//table//tr["+rows+"]/td[5]")).getText(); emlCateg.add(emlCategory); System.out.print(emlCategory+" "); String emlPartNo= driver.findElement(By.xpath("//table[@cellspacing='0'][3]//tr["+m+"]//table//tr["+rows+"]/td[4]")).getText(); emlPart.add(emlPartNo); System.out.print(emlPartNo+" "); String emlDescription= driver.findElement(By.xpath("//table[@cellspacing='0'][3]//tr["+m+"]//table//tr["+rows+"]/td[6]")).getText(); emlDesc.add(emlDescription); System.out.print(emlDescription+" "); String appCrDsgn= driver.findElement(By.xpath("//table[@cellspacing='0'][3]//tr["+m+"]//table//tr["+rows+"]/td[1]")).getText(); emlCurDesg.add(appCrDsgn); System.out.print(appCrDsgn); System.out.println(" "); } System.out.println(" "); emlMainList.add(emlCateg); emlMainList.add(emlPart); emlMainList.add(emlDesc); emlMainList.add(emlCurDesg); return emlMainList; } public boolean verifyLists(List<List> appList, List<List> emlList, String table) { boolean b=true; if (table.equals("RFDS")) { System.out.println("Verifying Email values with the Application Values for RFDS Table"); } else if (table.equals("HFlex")) { System.out.println("Verifying Email values with the Application Values for HybriFlex Table"); } else if (table.equals("CM")) { System.out.println("Verifying Email values with the Application Values for Construction Material Table"); } for(int i=0;i<appList.size();i++) { if(!appList.get(i).containsAll(emlList.get(i))) { System.out.println("We have a miss match in comparing both the list values"); b=false; break; } } return b; } }
c1ad37eae28999a8c6f6e32e43271fea87a164fc
64a5366368f36b25e47b6d754880475022cdcc05
/src/main/java/pl/motorola/sklep/model/Cart.java
b7c1babe8b66cb83dc04b89e412e1c504b965447
[]
no_license
karmilanowski/Sklep
9c7896ccce49e25bc224292c6e8325994e966fad
3b695559aa99994cf54951c3bcceb4d3c29cb00d
refs/heads/master
2023-08-21T18:14:53.943670
2021-09-27T12:30:10
2021-09-27T12:30:10
405,642,317
0
0
null
null
null
null
UTF-8
Java
false
false
457
java
package pl.motorola.sklep.model; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import pl.motorola.sklep.registration.AppUser; import javax.persistence.*; import java.util.List; @Entity @Getter @Setter @NoArgsConstructor public class Cart { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @OneToMany private List<CartItem> cartItmes; @OneToOne private AppUser appUser; }
eb606df67c908d07911ba20a9e644a5423612f8d
9a6ea6087367965359d644665b8d244982d1b8b6
/src/main/java/X/AnonymousClass3B7.java
a064976f820e2d2d97eac2be2101b2fbe7b6c70f
[]
no_license
technocode/com.wa_2.21.2
a3dd842758ff54f207f1640531374d3da132b1d2
3c4b6f3c7bdef7c1523c06d5bd9a90b83acc80f9
refs/heads/master
2023-02-12T11:20:28.666116
2021-01-14T10:22:21
2021-01-14T10:22:21
329,578,591
2
1
null
null
null
null
UTF-8
Java
false
false
1,032
java
package X; import android.content.Context; import java.io.IOException; import java.util.Properties; /* renamed from: X.3B7 reason: invalid class name */ public class AnonymousClass3B7 { public AnonymousClass3BE A00; public AnonymousClass3BI A01; public final Context A02; public final Properties A03; public final AnonymousClass3B6 A04; public final AnonymousClass3BL A05; public AnonymousClass3B7(Context context, AnonymousClass3BL r5) { String str; this.A05 = r5; this.A02 = context; this.A00 = r5.A03; Properties properties = new Properties(); try { properties.load(this.A02.getAssets().open("version.properties")); this.A03 = properties; this.A04 = new AnonymousClass3B6(this); if (r5.A03 != null && (str = r5.A00) != null) { this.A01 = new AnonymousClass3BI(this.A00, str); } } catch (IOException e) { throw new RuntimeException(e); } } }
65ef165a869de2f7991d0c377064ce050c1b7525
39dfc8bfcaa16a599fe1937ad653c381606e2d34
/contact-center/app/src/main/java/com/chatopera/cc/persistence/es/QuickReplyRepository.java
ed673e8d550a1263bee90dc5de0368e701eeff42
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
astra-zhao/cosin
64cbd876551be0c9472d837d84e291660dbc37c6
a038fc2e143a1a1f7e2bf00c03f1d86eb29168b2
refs/heads/osc
2020-12-11T06:57:50.875210
2020-02-27T06:29:24
2020-02-27T06:29:24
233,794,241
0
0
NOASSERTION
2020-02-27T06:29:25
2020-01-14T08:34:23
null
UTF-8
Java
false
false
1,018
java
/* * Copyright (C) 2017 优客服-多渠道客服系统 * Modifications copyright (C) 2018-2019 Chatopera Inc, <https://www.chatopera.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.chatopera.cc.persistence.es; import com.chatopera.cc.model.QuickReply; import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; public interface QuickReplyRepository extends ElasticsearchRepository<QuickReply, String> , QuickReplyEsCommonRepository { }
8a6b86decf42b7b814a6d76fe21a2d1318767588
df4c718be25f1d6d0e58d39fc38c32ca7989c700
/app/src/main/java/eu/inloop/stockquery/provider/NasdaqHttpStockRetriever.java
82867b5e380e38766b37bc32d9473483b2e90fd5
[ "MIT" ]
permissive
Moergil/stockquery
e2aea01e8acf038ed55c10e2869433dfe9246b9e
1a5f0bc4c9175bc0cc4eb08810136080fdbfc1f5
refs/heads/master
2020-12-25T14:48:18.550069
2016-08-04T19:47:56
2016-08-04T19:51:34
64,922,453
0
0
null
null
null
null
UTF-8
Java
false
false
3,322
java
package eu.inloop.stockquery.provider; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import java.io.IOException; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import eu.inloop.stockquery.data.StockItem; import okhttp3.FormBody; import okhttp3.MediaType; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.RequestBody; import okhttp3.Response; import okhttp3.ResponseBody; import retrofit2.Call; import retrofit2.Retrofit; import retrofit2.converter.gson.GsonConverterFactory; import retrofit2.http.GET; import retrofit2.http.Path; import retrofit2.http.Query; public class NasdaqHttpStockRetriever implements StockRetriever { private final Gson gson; private final GoogleFinanceService googleFinanceService; { gson = new GsonBuilder().create(); Retrofit retrofit = new Retrofit.Builder() .baseUrl("https://www.google.com/finance/") .build(); googleFinanceService = retrofit.create(GoogleFinanceService.class); } @Override public List<StockItem> retrieveStockValue(List<String> symbols) throws IOException { String query = assembleQuery(symbols); ResponseBody body = googleFinanceService.listStocksRaw(query).execute().body(); String responseString = extractResponseString(body); return parseStockItems(responseString); } private String assembleQuery(List<String> symbols) { StringBuilder builder = new StringBuilder("NASDAQ:"); boolean first = true; for (String symbol : symbols) { if (!first) { builder.append(","); } else { first = false; } builder.append(symbol); } return builder.toString(); } private String extractResponseString(ResponseBody body) throws IOException { byte[] bytes = body.bytes(); String result = new String(bytes); result = result.replace("//", ""); result = result.replace("\n", ""); return result; } private List<StockItem> parseStockItems(String json) { List<StockItem> stockItems = new ArrayList<>(); JsonArray array = gson.fromJson(json, JsonArray.class); for (int i = 0; i < array.size(); i++) { JsonObject stockItemObject = array.get(i).getAsJsonObject(); String symbol = stockItemObject.get("t").getAsString(); BigDecimal value = stockItemObject.get("l").getAsBigDecimal(); StockItem stockItem = new StockItem(symbol, value); stockItems.add(stockItem); } return stockItems; } private interface GoogleFinanceService { @GET("info") Call<ResponseBody> listStocksRaw(@Query("q") String query); } private class NasdaqStockItem { String id; String t; String e; String l; String l_fix; String l_cur; String s; String ltt; String lt; String lt_dts; String c; String c_fix; String cp; String cp_fix; String ccol; String pcls_fix; } }
9f43b21ac280da686831f7914253fc82f472c03b
b2b894782b931e000af2323cd888f38d14b493bc
/src/main/java/ch05_01/ProduceDataServlet.java
c239b8a90897a1beeb329185249c4d4ddf85f865
[]
no_license
tacticalandy/jspExercise
6b5cfa4ea324d6184402680e8cdd190399f53887
a7c0a74feb85e2c21bdea72665079191f9bcf45e
refs/heads/master
2023-08-16T15:37:11.343044
2020-06-10T08:56:52
2020-06-10T08:56:52
249,900,209
0
0
null
2023-07-23T09:47:45
2020-03-25T06:06:17
Java
UTF-8
Java
false
false
1,860
java
package ch05_01; import java.io.IOException; import java.util.HashMap; import java.util.Map; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet("/ch05_01/ProduceDataServlet") public class ProduceDataServlet extends HttpServlet { private static final long serialVersionUID = 1L; protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response); } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // 本程式將產生資料,然後轉交給JSP,由JSP顯示出來。 // 第一份資料為字串物件,它將會以"Customer"為識別字串,存放在request範圍(requestScope) String str1 = "史努比先生"; request.setAttribute("Customer", str1); // 第二份資料為JavaBean物件,它將會以"PB"為識別字串,存放在request範圍(requestScope) ProductBean pb0 = new ProductBean("A0001", "橡皮擦", 15.0, 0.15); request.setAttribute("PB", pb0); // 第三份資料為Map物件,它將會以"MapKey"為識別字串,存放在request範圍(requestScope) Map<String , ProductBean> map = new HashMap<String, ProductBean>(); ProductBean pb1 = new ProductBean("H0251", "2B鉛筆", 12.0, 0.10); ProductBean pb2 = new ProductBean("H0252", "藍色原子筆", 15.0, 0.12); map.put("key001", pb1); map.put("key002", pb2); request.setAttribute("MapKey", map); RequestDispatcher rd = request.getRequestDispatcher("/ch05_01/ShowData.jsp"); rd.forward(request, response); return; } }
9c73cfcb69cc309a05645a2cf03fb59267394338
216f8e613ddcc304d193c9d508337980cb064ae5
/src/index/N001_TwoSum.java
ea084a8b16a4c1befa79691fa297193571c9522f
[]
no_license
jbaek7023/LeetCode-Java
349649662c49c10c36c79f326d6fd8b97101bea5
810dbb42baa7d1c8268b0a17dde9f8949a5ac741
refs/heads/master
2021-01-19T08:28:18.579141
2017-04-13T05:14:21
2017-04-13T05:14:21
87,633,937
0
0
null
null
null
null
UTF-8
Java
false
false
1,016
java
package index; import java.util.HashMap; import java.util.Map; /** * Given nums = [2, 7, 11, 15], target = 9, Because nums[0] + nums[1] = 2 + 7 = 9, return [0, 1]. * @author jaeminbaek * */ public class N001_TwoSum { public static void main(String[] args) { int[] nums = {2, 3, 7, 11, 15}; int[] output = twoSum(nums, 9); for(Integer i: output) { System.out.println(i); } } public static int[] twoSum(int[] nums, int target) { int[] result = new int[2]; Map<Integer, Integer> map = new HashMap<Integer, Integer>(); for (int i = 0; i < nums.length; i++) { if (map.containsKey(target - nums[i])) { result[1] = i + 1; result[0] = map.get(target - nums[i]); //result(=0) => 2 //result(=1) => 3 return result; //(3,2) } //target(=9) - nums[i] = 7 //(2, 1), (3, 2), //putting takes log(n) time map.put(nums[i], i + 1); } return result; } }
eda77910b45606b530ce2231e80bff423cc81ba5
121a43924c0a57d2dcf4b7854c7b9550c1ff78d1
/src/main/java/db/Way.java
d4503121a2c43fa4404256ea8b4d1c04611f371d
[]
no_license
zy1230/shop
f01ccd121e4d32b1f2ea07289786507edb7cffec
87f03c67aa0e155b5c2a00dc987bbbb6f1123ff6
refs/heads/master
2022-06-29T15:13:56.813052
2019-10-26T09:05:55
2019-10-26T09:05:55
217,683,423
1
0
null
2020-07-02T01:01:32
2019-10-26T09:04:58
Java
UTF-8
Java
false
false
2,238
java
package db; import object.Fruit; import object.User; import java.sql.*; public class Way { public static User select(String name,String password) { Connection conn = null; PreparedStatement pre = null; ResultSet set = null; try { conn = DB.getConn(); pre = conn.prepareStatement("select * from user where name =? and pass = ?"); pre.setString(1,name); pre.setString(2,password); set = pre.executeQuery(); while (set.next()){ User user = new User(); user.setName(set.getString(1)); user.setPassword(set.getString(2)); return user; } } catch (SQLException e){ e.printStackTrace(); } finally { DB.release(set,pre,conn); } return null; } public static int insert(String name,String password){ int a = 0; Connection conn = null; PreparedStatement pre = null; try { conn = DB.getConn(); pre = conn.prepareStatement("insert into user values(?,?)"); pre.setString(1,name); pre.setString(2,password); a = pre.executeUpdate(); return a; }catch (SQLException e){ e.printStackTrace(); }finally { DB.release(null,pre,conn); } return a; } public static Fruit selectF(String name) { Connection conn = null; PreparedStatement pre = null; ResultSet set = null; try { Fruit fruit = new Fruit(); conn = DB.getConn(); pre = conn.prepareStatement("select * from fruit where name = ?"); pre.setString(1,name); set = pre.executeQuery(); while (set.next()) { fruit.setName(set.getString("name")); fruit.setPhoto(set.getString("photo")); fruit.setPrice(set.getDouble("price")); } return fruit; } catch (SQLException e) { e.printStackTrace(); } finally { DB.release(set, pre, conn); } return null; } }
2190dc52dbe159e4ce479fa8d46a2e42ce20cd4d
3f3b3c9b21fb37ea40971b8fc8d1a5548ae1a2d4
/src/main/java/hisense/fdp/cfa/observersubject/impl/ReceiveMsgMQ.java
1c9b2dfe1385700990a778a50c1e08e21a397ff1
[]
no_license
lvxczhuce22/lvxcDeom
94a5e8737028cfcd7e611f941221a5bd9c5dc8e4
d24aebff4accf1ebbbe11a0da95661036573a4cb
refs/heads/master
2022-11-06T08:54:21.406263
2020-06-19T03:07:13
2020-06-19T03:07:13
262,730,322
0
0
null
2020-06-19T03:07:14
2020-05-10T06:58:34
Java
UTF-8
Java
false
false
1,571
java
package hisense.fdp.cfa.observersubject.impl; import hisense.fdp.cfa.model.ConnectorTask; import hisense.fdp.cfa.util.VariableInit; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * 接收设备状态变化协议mq处理类 */ public class ReceiveMsgMQ { // 打印日志 public static Logger log = LoggerFactory.getLogger(ConnectorMQ.class); // mq实例 private ConnectorMQ connectorMQ = null; // 接收设备状态变化协议mq唯一实例 private static ReceiveMsgMQ recevieMsgInstance = new ReceiveMsgMQ(VariableInit.MQ_MAINTAININF_TOPIC); /** * 默认构造函数 */ private ReceiveMsgMQ(String mqName) { connectorMQ = new ConnectorMQ(mqName); connectorMQ.setConnectorTask(initConnectorTask()); } /** * 获取实例 * * @return 实例 */ public static ReceiveMsgMQ getInstance() { return recevieMsgInstance; } /** * 初始化mq连接任务 * * @return mq连接任务 */ private ConnectorTask initConnectorTask() { ConnectorTask connectorTask = new ConnectorTask(); connectorTask.setServerStr(VariableInit.MQ_SEND_URL); connectorTask.setUser(VariableInit.MQ_SEND_USER); connectorTask.setPassword(VariableInit.MQ_SEND_PWD); connectorTask.setIdentify(""); return connectorTask; } /** * 向mq发送消息协议 * * @param message * 消息协议 */ public void sendMsgToMQ(String message) { //TODO 与每分钟短线重现检测重复!!! // if (!connectorMQ.checkAvailable()) { // connectorMQ.startConnector(); // } connectorMQ.sendMsgToMQ(message); } }
f6fd867df9abad58f3b90b9501d9e71c730a9f39
30bd9f126a3aa2984cc3d223153cdbed2f6454d8
/src/enmascarar/Tarjeta.java
85d64ed85320422051e885c16ff1eb448afbda36
[]
no_license
alejoarboleda06/enmascarar
75fea1346936176a8854a2d892d62f138e95f32a
15f03d4b998750c98bb7baf6a92f043fa6097e90
refs/heads/main
2023-03-09T11:17:15.301602
2021-02-14T21:24:45
2021-02-14T21:24:45
338,904,815
0
0
null
null
null
null
UTF-8
Java
false
false
1,030
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 enmascarar; /** * * @author user */ public class Tarjeta { String Numero; public Tarjeta(){ } public Tarjeta(String Numero){ this.Numero = Numero; } public String getNumero() { return Numero; } public void setNumero(String Numero) { this.Numero = Numero; } public boolean validarTarjeta(String Tarjeta){ return (Tarjeta.length()==19); } public String enmascararTarjeta(String Tarjeta){ StringBuilder Mascara = new StringBuilder(Tarjeta); for(int i = 4; i < Tarjeta.length()-4; i++){ if( Mascara.charAt(i) != ' ') Mascara.setCharAt(i,'X'); } return Mascara.toString(); } }
0d68825cf43afdf508658a54717d7d9589e483e2
dd4ea6c4dc8c99d6553de987c5915de31b3d21d2
/fe/fe-core/src/main/java/org/apache/doris/tablefunction/HdfsTableValuedFunction.java
542fc46bee2a5d9ab6e5410a093d0ad343a24bb3
[ "Apache-2.0", "BSD-3-Clause", "PSF-2.0", "GPL-2.0-only", "LicenseRef-scancode-public-domain", "dtoa", "MIT", "LicenseRef-scancode-facebook-patent-rights-2", "bzip2-1.0.6", "OpenSSL" ]
permissive
caiconghui/incubator-doris
ac6036e5162e1204dce59facc0f868f3026d4be6
dd869077f8ce3c2b19f29b3048c4e7e62ac31050
refs/heads/master
2023-08-31T20:57:15.392015
2023-01-19T07:56:51
2023-01-19T07:56:51
211,771,485
0
2
Apache-2.0
2019-09-30T03:57:01
2019-09-30T03:57:00
null
UTF-8
Java
false
false
4,489
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.doris.tablefunction; import org.apache.doris.analysis.BrokerDesc; import org.apache.doris.analysis.ExportStmt; import org.apache.doris.analysis.StorageBackend.StorageType; import org.apache.doris.common.AnalysisException; import org.apache.doris.common.util.URI; import org.apache.doris.thrift.TFileType; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Maps; import org.apache.commons.collections.map.CaseInsensitiveMap; import org.apache.log4j.LogManager; import org.apache.log4j.Logger; import java.util.Map; /** * The Implement of table valued function * hdfs("uri" = "xxx", "hadoop.username" = "xx", "FORMAT" = "csv"). */ public class HdfsTableValuedFunction extends ExternalFileTableValuedFunction { public static final Logger LOG = LogManager.getLogger(HdfsTableValuedFunction.class); public static final String NAME = "hdfs"; public static final String HDFS_URI = "uri"; public static String HADOOP_FS_NAME = "fs.defaultFS"; // simple or kerberos public static String HADOOP_SECURITY_AUTHENTICATION = "hadoop.security.authentication"; public static String HADOOP_USER_NAME = "hadoop.username"; public static String HADOOP_KERBEROS_PRINCIPAL = "hadoop.kerberos.principal"; public static String HADOOP_KERBEROS_KEYTAB = "hadoop.kerberos.keytab"; public static String HADOOP_SHORT_CIRCUIT = "dfs.client.read.shortcircuit"; public static String HADOOP_SOCKET_PATH = "dfs.domain.socket.path"; private static final ImmutableSet<String> LOCATION_PROPERTIES = new ImmutableSet.Builder<String>() .add(HDFS_URI) .add(HADOOP_SECURITY_AUTHENTICATION) .add(HADOOP_FS_NAME) .add(HADOOP_USER_NAME) .add(HADOOP_KERBEROS_PRINCIPAL) .add(HADOOP_KERBEROS_KEYTAB) .add(HADOOP_SHORT_CIRCUIT) .add(HADOOP_SOCKET_PATH) .build(); private URI hdfsUri; private String filePath; public HdfsTableValuedFunction(Map<String, String> params) throws AnalysisException { Map<String, String> fileFormatParams = new CaseInsensitiveMap(); locationProperties = Maps.newHashMap(); for (String key : params.keySet()) { if (FILE_FORMAT_PROPERTIES.contains(key.toLowerCase())) { fileFormatParams.put(key, params.get(key)); } else { // because HADOOP_FS_NAME contains upper and lower case if (HADOOP_FS_NAME.equalsIgnoreCase(key)) { locationProperties.put(HADOOP_FS_NAME, params.get(key)); } else { locationProperties.put(key, params.get(key)); } } } ExportStmt.checkPath(locationProperties.get(HDFS_URI), StorageType.HDFS); hdfsUri = URI.create(locationProperties.get(HDFS_URI)); filePath = locationProperties.get(HADOOP_FS_NAME) + hdfsUri.getPath(); parseProperties(fileFormatParams); parseFile(); } // =========== implement abstract methods of ExternalFileTableValuedFunction ================= @Override public TFileType getTFileType() { return TFileType.FILE_HDFS; } @Override public String getFilePath() { // must be "hdfs://namenode/filepath" return filePath; } @Override public BrokerDesc getBrokerDesc() { return new BrokerDesc("HdfsTvfBroker", StorageType.HDFS, locationProperties); } // =========== implement abstract methods of TableValuedFunctionIf ================= @Override public String getTableName() { return "HDFSTableValuedFunction"; } }
d2ddefc94aaf37d884ae346da6d58351ef77ebff
1f207999be869a53c773c4b3dc4cff3d78f60aca
/pay-java-parent/pay-java-demo/src/main/java/com/egzosn/pay/demo/controller/PayTestController.java
4ac98df2da7be6b4b4016ce3cfcd35969b936b86
[ "Apache-2.0" ]
permissive
BrendaHub/quanmin_admin
8b4f1643112910b728adc172324b8fb8a2f672dc
866548dc219a2eaee0a09efbc3b6410eb3c2beb9
refs/heads/master
2021-05-09T04:17:03.818182
2018-01-28T15:00:12
2018-01-28T15:00:12
119,267,872
1
1
null
null
null
null
UTF-8
Java
false
false
353
java
package com.egzosn.pay.demo.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import io.swagger.annotations.Api; @Api(tags="支付模块") @Controller public class PayTestController { @RequestMapping("/pay/testindex.do") public String index() { return "/demo/index"; } }
80db739e9872c6e796940fab75316d44925d2535
7eae0f11062da665e703f46e3e791e0f53d70aa8
/src/test/java/com/Morning_batch/pom_miniproject.java
cd894d8b00b849e3869c95cdf915bdfc39ca9750
[]
no_license
durai678/JavaData
8ad57022ce1f3a46a25522b4d3503c560c0cd2db
0b933ba2f1aeafac454bbe5a8ffe6b09b94d4d0d
refs/heads/master
2023-08-14T19:32:07.545434
2021-10-05T06:55:40
2021-10-05T06:55:40
413,711,803
0
0
null
null
null
null
UTF-8
Java
false
false
2,213
java
package com.Morning_batch; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; public class pom_miniproject { //login page @FindBy(xpath="//*[@id=\'email\']") public static WebElement username; @FindBy(xpath="//*[@id=\'passwd\']") public static WebElement passward; @FindBy(xpath="//*[@id=\"SubmitLogin\"]/span") public static WebElement login; //Dress page @FindBy(xpath="//*[@id=\"block_top_menu\"]/ul/li[2]/a") public static WebElement dress_page; @FindBy(xpath="//*[@id=\"subcategories\"]/ul/li[1]/div[1]/a/img") public static WebElement casual_dress; @FindBy(xpath="/html/body/div/div[2]/div/div[3]/div[2]/ul/li/div/div[1]/div/a[1]/img") public static WebElement dress; //add to cart @FindBy(xpath="/html/body/div[2]/div/div/div/div/iframe") public static WebElement framee; @FindBy(xpath="/html/body/div/div/div[3]/form/div/div[2]/p[1]/a[2]/span") public static WebElement qty; @FindBy(xpath="/html/body/div/div/div[3]/form/div/div[2]/div/fieldset[1]/div/div/select") public static WebElement size; @FindBy(xpath="/html/body/div/div/div[3]/form/div/div[3]/div[1]/p/button/span") public static WebElement add_to_cart; //checkout page @FindBy(xpath="/html/body/div/div[1]/header/div[3]/div/div/div[4]/div[1]/div[2]/div[4]/a/span") public static WebElement proceed; @FindBy(xpath="/html/body/div/div[2]/div/div[3]/div/p[2]/a[1]/span") public static WebElement proceed1; @FindBy(xpath="/html/body/div/div[2]/div/div[3]/div/form/p/button/span") public static WebElement proceed2; @FindBy(xpath="/html/body/div/div[2]/div/div[3]/div/div/form/div/p[2]/div/span/input") public static WebElement agreee; @FindBy(xpath="/html/body/div/div[2]/div/div[3]/div/div/form/p/button/span") public static WebElement proceed3; @FindBy(xpath="/html/body/div/div[2]/div/div[3]/div/div/div[3]/div[2]/div/p/a") public static WebElement pay_by_cheak; //order page @FindBy(xpath="/html/body/div/div[2]/div/div[3]/div/form/p/button/span") public static WebElement confirm_order; @FindBy(xpath="/html/body/div/div[2]/div/div[3]/div/p[2]/a") public static WebElement back_to_order; }
4a1df13566a6c6a63e9ced2d6867a063660bb154
cc6243837f70bd001af3905efc345ec210bd6e76
/javalib/src/main/java/com/bhargavaroyal/javalib/collections/arraylist/ArrayListSortExample.java
fa3bb2d293c51e8a1d950ac6ae8b91b485d6beff
[]
no_license
bhargavaroyal/OutlineAndJav
01ddb3e30e4c7b1db4ea869d587335a0b9fd9efa
526ce6b697078226a8428ee6219d3a49063ed05c
refs/heads/main
2023-08-03T09:11:06.291351
2021-09-18T16:52:56
2021-09-18T16:52:56
387,354,146
0
0
null
null
null
null
UTF-8
Java
false
false
1,072
java
package com.bhargavaroyal.javalib.collections.arraylist; import java.util.ArrayList; import java.util.Comparator; import java.util.List; public class ArrayListSortExample { public static void main(String[] args) { List<String> names = new ArrayList<>(); names.add("Lisa"); names.add("Jennifer"); names.add("Mark"); names.add("David"); System.out.println("Names : " + names); // Sort an ArrayList using its sort() method. You must pass a Comparator to the ArrayList.sort() method. names.sort(new Comparator<String>() { @Override public int compare(String name1, String name2) { return name1.compareTo(name2); } }); // The above `sort()` method call can also be written simply using lambda expression /* names.sort((name1, name2) -> name1.compareTo(name2)); // Following is an even more concise solution names.sort(Comparator.naturalOrder());*/ System.out.println("Sorted Names : " + names); } }
bff1eb3ce0118a85da524fa9cdd43ad016de7527
59ea12023da4a0b23d86498f1ea839917116885a
/ACMICPC/2020 Local Programming Contest/solutions/badtree/badtree.java
649868b54257aa975d5182af98b03856ac649ace
[]
no_license
electricpants01/ACMicpc-contest
2da6403080d7669f391be255e038909686c46c9d
2fb6a23b9a88f8bbf4a8223525d1aaa1d7724310
refs/heads/master
2022-02-14T07:52:50.112624
2022-01-30T15:15:14
2022-01-30T15:15:14
131,452,331
0
0
null
null
null
null
UTF-8
Java
false
false
1,615
java
// Arup Guha // 9/11/2020 // Solution to UCF 2020 Locals Final Round Problem: Bad Tree import java.util.*; public class badtree { public static void main(String[] args) { // Get size and rank. Scanner stdin = new Scanner(System.in); int n = stdin.nextInt(); long rank = stdin.nextLong()-1; // When we can't do it. if (n <= 60 && rank+1 > (1L<<(n-1)) ) System.out.println(-1); // Key idea behind the solution is that # of valid perms is 2^(n-1), at each // juncture except the last, you can either insert the smallest or largest value // that hasn't been inserted, and half of the trees are formed with the smallest // and the other half with the largest. So, you just see how many more ranks you // have to advance to decide whether or not to take the smallest or largest value // not yet placed and adjust the remaining rank accordingly. Last issue to watch // out for is an overflow if you bit shift too far... else { // Just need to keep pointers to the beginning // and end of the list of values not placed yet. int low = 1, high = n; // Store answer here. int[] res = new int[n]; // Go bit by bit. for (int i=0; i<n; i++) { // If count is too high or rank is too low, we go with low. if (n-i-2 >= 60 || rank < (1L<<(n-i-2)) ) res[i] = low++; // Otherwise, we take from the high end and subtract the bit value from rank. else { res[i] = high--; rank -= (1L<<(n-i-2)); } } // Ta da! for (int i=0; i<n-1; i++) System.out.print(res[i]+" "); System.out.println(res[n-1]); } } }
7535d126691e48f402c495ac1859cbba169f2031
0d037449b455913f394acf2e25060155f324ffce
/vvaras.acsBaciCodeGen.model.edit/src/baciCodeGen/BACIProperties/provider/RObooleanItemProvider.java
a82a392b7a02c5a212d7110e7e00c00fe59d5d65
[]
no_license
javarias/acsBaciCodeGen
7e018dc645d70e6abb43a6f79ae8242e242a02be
acd30a0ad4fc60a96a48e86f3cccc57998165069
refs/heads/master
2020-04-26T04:29:48.131471
2019-03-01T12:50:42
2019-03-01T12:50:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,072
java
/** */ package baciCodeGen.BACIProperties.provider; import baciCodeGen.BACIProperties.BACIPropertiesPackage; import baciCodeGen.BACIProperties.ROboolean; import java.util.Collection; import java.util.List; import org.eclipse.emf.common.notify.AdapterFactory; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; import org.eclipse.emf.edit.provider.ViewerNotification; /** * This is the item provider adapter for a {@link baciCodeGen.BACIProperties.ROboolean} object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public class RObooleanItemProvider extends Pboolean1ItemProvider { /** * This constructs an instance from a factory and a notifier. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public RObooleanItemProvider(AdapterFactory adapterFactory) { super(adapterFactory); } /** * This returns the property descriptors for the adapted class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); addAlarmFaultFamilyPropertyDescriptor(object); addAlarmFaultMemberPropertyDescriptor(object); addAlarmLevelPropertyDescriptor(object); addAlarmOnPropertyDescriptor(object); addAlarmTimerTrigPropertyDescriptor(object); } return itemPropertyDescriptors; } /** * This adds a property descriptor for the Alarm Fault Family feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addAlarmFaultFamilyPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_ROboolean_alarmFaultFamily_feature"), getString("_UI_PropertyDescriptor_description", "_UI_ROboolean_alarmFaultFamily_feature", "_UI_ROboolean_type"), BACIPropertiesPackage.Literals.ROBOOLEAN__ALARM_FAULT_FAMILY, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the Alarm Fault Member feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addAlarmFaultMemberPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_ROboolean_alarmFaultMember_feature"), getString("_UI_PropertyDescriptor_description", "_UI_ROboolean_alarmFaultMember_feature", "_UI_ROboolean_type"), BACIPropertiesPackage.Literals.ROBOOLEAN__ALARM_FAULT_MEMBER, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the Alarm Level feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addAlarmLevelPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_ROboolean_alarmLevel_feature"), getString("_UI_PropertyDescriptor_description", "_UI_ROboolean_alarmLevel_feature", "_UI_ROboolean_type"), BACIPropertiesPackage.Literals.ROBOOLEAN__ALARM_LEVEL, true, false, false, ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the Alarm On feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addAlarmOnPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_ROboolean_alarmOn_feature"), getString("_UI_PropertyDescriptor_description", "_UI_ROboolean_alarmOn_feature", "_UI_ROboolean_type"), BACIPropertiesPackage.Literals.ROBOOLEAN__ALARM_ON, true, false, false, ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the Alarm Timer Trig feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addAlarmTimerTrigPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_ROboolean_alarmTimerTrig_feature"), getString("_UI_PropertyDescriptor_description", "_UI_ROboolean_alarmTimerTrig_feature", "_UI_ROboolean_type"), BACIPropertiesPackage.Literals.ROBOOLEAN__ALARM_TIMER_TRIG, true, false, false, ItemPropertyDescriptor.REAL_VALUE_IMAGE, null, null)); } /** * This returns ROboolean.gif. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/ROboolean")); } /** * This returns the label text for the adapted class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String getText(Object object) { ROboolean rOboolean = (ROboolean)object; return getString("_UI_ROboolean_type") + " " + rOboolean.getArchiveMaxInt(); } /** * This handles model notifications by calling {@link #updateChildren} to update any cached * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void notifyChanged(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(ROboolean.class)) { case BACIPropertiesPackage.ROBOOLEAN__ALARM_FAULT_FAMILY: case BACIPropertiesPackage.ROBOOLEAN__ALARM_FAULT_MEMBER: case BACIPropertiesPackage.ROBOOLEAN__ALARM_LEVEL: case BACIPropertiesPackage.ROBOOLEAN__ALARM_ON: case BACIPropertiesPackage.ROBOOLEAN__ALARM_TIMER_TRIG: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; } super.notifyChanged(notification); } /** * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children * that can be created under this object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); } }
37ae1e660c1f3af8a37b8c275b52537e6bc78407
47db1842e0885b9c8907f47c07acb2ac8cc33604
/src/test/java/com/ido/fdexsercise/dao/FarmStatsDAOImplMemTest.java
f16c1c1d938d7f784ef753672fc077ba79073ed5
[]
no_license
IdoZilberberg/fdexercise
097582da2bf9c1cb7d2d6e311f3ae14af180ec02
8dd09a43ab1e8dc43603c3913d6c8c5809c9e718
refs/heads/master
2021-01-10T17:56:20.376015
2015-11-15T10:34:16
2015-11-15T10:34:16
45,504,381
1
0
null
2015-11-15T10:04:45
2015-11-04T00:16:33
Java
UTF-8
Java
false
false
1,001
java
package com.ido.fdexsercise.dao; import org.junit.After; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; import static org.junit.Assert.*; /** * Created by Ido on 11/4/2015. */ public class FarmStatsDAOImplMemTest { private EmbeddedDatabase db; @Before public void setUp() { // creates a HSQL in-memory db populated from default scripts classpath:schema.sql and classpath:test-data.sql db = new EmbeddedDatabaseBuilder().addDefaultScripts().build(); } @Ignore @Test public void testDataAccess() { JdbcTemplate template = new JdbcTemplate(db); Integer count = template.queryForObject("select count(*) from stats", Integer.class); assertEquals(Integer.valueOf(2), count); } @After public void tearDown() { db.shutdown(); } }
974befb31a2fbc27bc583f5e3e97543fda7320ed
dca28901fb2e0fbb4b6b04a8dca852d2b2449e91
/jtransc-media-game/src/com/jtransc/game/batch/BatchBuilder.java
05f57974824f02d796289e34438543e3d012f499
[]
no_license
wiltonlazary/jtransc-media
73f2afe60de0736afa66ecc7d13194fd0d747ffe
6f5f8a4cbdcad4208efb897621fdb864493de036
refs/heads/master
2021-01-12T03:48:27.034325
2016-12-04T15:03:27
2016-12-04T15:03:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,754
java
package com.jtransc.game.batch; import com.jtransc.FastMemory; import com.jtransc.FastMemory4Float; import com.jtransc.FastMemory4Int; import com.jtransc.Mem; import com.jtransc.game.math.Point; import com.jtransc.media.JTranscRender; public class BatchBuilder { public FastMemory vertices = FastMemory.alloc(4 * 6 * 16 * 1024); public FastMemory4Float verticesFloat = new FastMemory4Float(vertices); public FastMemory4Int verticesInt = new FastMemory4Int(vertices); public short[] indices = new short[6 * 1024 * 6]; public int[] batches = new int[16 * 256]; public int verticesIndex = 0; public int indicesIndex = 0; public int batchCount = 0; // Data public Batch current = new Batch(); public void start() { Mem.select(vertices); } public void reset() { verticesIndex = 0; indicesIndex = 0; batchCount = 0; current.reset(); } private void flush() { if (current.triangleCount <= 0) return; current.write(batches, batchCount * 16); batchCount++; current.startIndex = indicesIndex; current.triangleCount = 0; } public void quad(int texture, Point p0, Point p1, Point p2, Point p3, float tx0, float ty0, float tx1, float ty1, int color1, int color2) { if (current.texture != texture) { flush(); current.texture = texture; } int vii = verticesIndex; int vi = vii * 6; short[] i = indices; int ii = indicesIndex; //println("${p0.x}, ${p0.y}, ${p1.x}, ${p1.y} :: $x, $y, $w, $h :: $matrix") Mem.sf32(vi + 0, (float) p0.x); Mem.sf32(vi + 1, (float) p0.y); Mem.sf32(vi + 2, tx0); Mem.sf32(vi + 3, ty0); Mem.si32(vi + 4, color1); Mem.si32(vi + 5, color2); Mem.sf32(vi + 6, (float) p1.x); Mem.sf32(vi + 7, (float) p1.y); Mem.sf32(vi + 8, tx1); Mem.sf32(vi + 9, ty0); Mem.si32(vi + 10, color1); Mem.si32(vi + 11, color2); Mem.sf32(vi + 12, (float) p2.x); Mem.sf32(vi + 13, (float) p2.y); Mem.sf32(vi + 14, tx0); Mem.sf32(vi + 15, ty1); Mem.si32(vi + 16, color1); Mem.si32(vi + 17, color2); Mem.sf32(vi + 18, (float) p3.x); Mem.sf32(vi + 19, (float) p3.y); Mem.sf32(vi + 20, tx1); Mem.sf32(vi + 21, ty1); Mem.si32(vi + 22, color1); Mem.si32(vi + 23, color2); i[ii + 0] = (short) (vii + 0); i[ii + 1] = (short) (vii + 1); i[ii + 2] = (short) (vii + 2); i[ii + 3] = (short) (vii + 1); i[ii + 4] = (short) (vii + 3); i[ii + 5] = (short) (vii + 2); verticesIndex += 4; indicesIndex += 6; current.triangleCount += 2; } public void render() { flush(); //println(vertices.slice(0 until 4 * 6)) //println(indices.slice(0 until 6)) //println(batches[0]) //println(batches[1]) //println(batches[2]) //println(batches[3]) JTranscRender.render(vertices, verticesIndex, indices, indicesIndex, batches, batchCount); } }
8ab4f9fe7fa4ac71a19fa3cc1961e90c8603a239
43113a5f50d8765e37872a57d9de2474b2c309fa
/hedera-service/src/main/java/com/enzitechnologies/hederaservice/domain/Key.java
bf364140194ee5f6c8803214159467ee1ef1aa02
[]
no_license
KahigaKiguru/Hedera-Test-Service
ad2f7c0ee43600862841cf0376dddb4f45b5bf7e
21d8704265e15e2b25d0184cc10be040c6e45ebe
refs/heads/master
2023-04-04T08:37:27.092190
2021-03-31T20:19:16
2021-03-31T20:19:16
353,333,984
0
0
null
null
null
null
UTF-8
Java
false
false
71
java
package com.enzitechnologies.hederaservice.domain;public class Key { }
089e2e8f249bba2b91d20d395cacb789df48ae49
0ff49d4590ab93381ae5216c7265464b5516c6fb
/TPJenkovServer.java
1168ed7c90cc28086e0b2baa5670defe3d503b73
[]
no_license
Oskilla/MultiCoeur
71d787756924aa3cbbe149ad5658c3149fa46687
d599a8924d1b395580d3a4f14a0c2b6b4dfb6115
refs/heads/master
2022-04-09T04:50:19.162331
2020-03-24T13:28:30
2020-03-24T13:28:30
239,279,349
0
1
null
null
null
null
UTF-8
Java
false
false
1,144
java
package fr.univnantes.multicore.distanciel; import java.util.concurrent.LinkedBlockingDeque; import java.util.concurrent.BlockingQueue; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.FutureTask; public class TPJenkovServer implements Server { ExecutorService threadpool; BlockingQueue taskQueue = new LinkedBlockingDeque<Task>(); public TPJenkovServer() { this.threadpool= Executors.newFixedThreadPool(10); } @Override public Future<Block> getBlock(Task task) { FutureTask<Block> future = new FutureTask<Block>(task); if(task.hasPriority()) { try { ((LinkedBlockingDeque<Task>) taskQueue).putFirst(task); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } }else { try { ((LinkedBlockingDeque<Task>) taskQueue).putLast(task); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } while(taskQueue.peek() != task) {} taskQueue.remove(task); threadpool.submit(future); return future; } }
f369631e78167d2e489ba6a9ee825e01105dd97d
fb4419262dee2d4ae3b3d33c5b9993ef1e724715
/src/main/java/mx/bidg/model/BudgetConceptDistributor.java
4069658667391da67a1ea22a2450ce76a6e6bb0a
[]
no_license
josueolvera/respaldo
e896389c8da6b0ddbec27c3076ba9fdb48800c0f
154277496408fd4fae6097c71963847f41658651
refs/heads/master
2021-01-01T04:46:44.178271
2017-07-11T18:49:01
2017-07-11T18:49:01
97,240,709
0
0
null
null
null
null
UTF-8
Java
false
false
4,867
java
package mx.bidg.model; import com.fasterxml.jackson.annotation.JsonView; import mx.bidg.config.JsonViews; import javax.persistence.*; import javax.validation.constraints.Max; import javax.validation.constraints.NotNull; import java.io.Serializable; import java.math.BigDecimal; /** * * @author rafael */ @Entity @Table( name = "BUDGET_CONCEPT_DISTRIBUTOR", uniqueConstraints = { @UniqueConstraint( name = "UNIQUE_CONCEPT_DISTRIBUTOR", columnNames = {"ID_BUDGET_MONTH_CONCEPT", "ID_DISTRIBUTOR"} ) } ) public class BudgetConceptDistributor implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "ID_BUDGET_CONCEPT_DISTRIBUTOR") @JsonView(JsonViews.Root.class) private Integer idBudgetConceptDistributor; @Column(name = "ID_BUDGET_MONTH_CONCEPT", insertable = false, updatable = false) @JsonView(JsonViews.Root.class) private Integer idBudgetMonthConcept; @Basic(optional = false) @NotNull @Column(name = "ID_DISTRIBUTOR", insertable = false, updatable = false) @JsonView(JsonViews.Root.class) private int idDistributor; @Basic(optional = false) @NotNull @Column(name = "AMOUNT") @JsonView(JsonViews.Root.class) private BigDecimal amount; @Max(value = 1) @Basic(optional = false) @NotNull @Column(name = "PERCENT") @JsonView(JsonViews.Root.class) private BigDecimal percent; @JoinColumn(name = "ID_DISTRIBUTOR", referencedColumnName = "ID_DISTRIBUTOR") @ManyToOne(optional = false) @JsonView(JsonViews.Embedded.class) private CDistributors distributor; @JoinColumn(name = "ID_BUDGET_MONTH_CONCEPT", referencedColumnName = "ID_BUDGET_MONTH_CONCEPT") @ManyToOne(optional = false) @JsonView(JsonViews.Embedded.class) private BudgetMonthConcepts budgetMonthConcept; public BudgetConceptDistributor() { } public BudgetConceptDistributor(Integer idBudgetConceptDistributor) { this.idBudgetConceptDistributor = idBudgetConceptDistributor; } public BudgetConceptDistributor(Integer idBudgetConceptDistributor, int idDistributor, BigDecimal amount, BigDecimal percent) { this.idBudgetConceptDistributor = idBudgetConceptDistributor; this.idDistributor = idDistributor; this.amount = amount; this.percent = percent; } public Integer getIdBudgetConceptDistributor() { return idBudgetConceptDistributor; } public void setIdBudgetConceptDistributor(Integer idBudgetConceptDistributor) { this.idBudgetConceptDistributor = idBudgetConceptDistributor; } public int getIdDistributor() { return idDistributor; } public void setIdDistributor(int idDistributor) { this.idDistributor = idDistributor; } public BigDecimal getAmount() { return amount; } public void setAmount(BigDecimal amount) { this.amount = amount; } public BigDecimal getPercent() { return percent; } public void setPercent(BigDecimal percent) { this.percent = percent; } public Integer getIdBudgetMonthConcept() { return idBudgetMonthConcept; } public void setIdBudgetMonthConcept(Integer idBudgetMonthConcept) { this.idBudgetMonthConcept = idBudgetMonthConcept; } public CDistributors getDistributor() { return distributor; } public void setDistributor(CDistributors distributor) { this.distributor = distributor; } public BudgetMonthConcepts getBudgetMonthConcept() { return budgetMonthConcept; } public void setBudgetMonthConcept(BudgetMonthConcepts budgetMonthConcept) { this.budgetMonthConcept = budgetMonthConcept; } @Override public int hashCode() { int hash = 0; hash += (idBudgetConceptDistributor != null ? idBudgetConceptDistributor.hashCode() : 0); return hash; } @Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof BudgetConceptDistributor)) { return false; } BudgetConceptDistributor other = (BudgetConceptDistributor) object; if ((this.idBudgetConceptDistributor == null && other.idBudgetConceptDistributor != null) || (this.idBudgetConceptDistributor != null && !this.idBudgetConceptDistributor.equals(other.idBudgetConceptDistributor))) { return false; } return true; } @Override public String toString() { return "mx.bidg.model.BudgetConceptDistributor[ idBudgetConceptDistributor=" + idBudgetConceptDistributor + " ]"; } }
e2a3e14490eba1740596d3c81bb51a1b159f89d5
7fcf2f870809b1c4458fdafe37b64f049566e3dd
/set/src/Data2/Branch.java
c68db5ba39fd05fb8eb8234a15ad29c3e38cab37
[]
no_license
lilianzz/data2
1c21c18009871a8d3de709ce95596ece73e1be2e
c4ac4e4541112391275643b3bd0dee3f5a1fea32
refs/heads/master
2020-06-04T09:41:37.103086
2015-04-07T23:58:27
2015-04-07T23:58:27
33,280,152
0
0
null
null
null
null
UTF-8
Java
false
false
10,029
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 Data2; import static java.lang.Integer.min; /** * * @author 栗粒盐 */ public class Branch <T extends Comparable<T>> implements Multiset<T>{ Multiset left; T key; Multiset right; int number; private int depth; // return a new leaf to create an empty finite set public static Multiset empty() { return new Leaf(); } //constructor Branch(Multiset left, T key, Multiset right, int n) { this.left = left; this.key = key; this.right = right; this.number = n; if (left.isEmptyHuh() && right.isEmptyHuh()) this.depth =1; else if (left.isEmptyHuh()) this.depth = right.getDepth()+ 1; else if (right.isEmptyHuh()) this.depth = left.getDepth()+ 1; else depth = (Math.max(left.getDepth(), right.getDepth()) + 1); } public T getKey() { return this.key; } public Multiset right() { return this.right; } public Multiset left() { return this.left; } public int getDepth() { return this.depth; } //add the cardinality of left subtree and right //subtree and 1 for the node itself public int cardinality() { return (this.number+left.cardinality() +right.cardinality()); } //since it's not a Leaf, it's not empty, return false public boolean isEmptyHuh() { return false; } private int balance() { int L = this.left.getDepth(); int R = this.right.getDepth(); if (L - R >= 2) return -1; else if (L - R <= -2) return 1; return 0; } //add an element to the Multiset public Multiset<T> add( T x ) { int k = x.compareTo(this.key); Branch q; if ( k < 0 ) { q= new Branch( this.left.add(x), this.key, this.right, this.number); } else if (k==0) { q= new Branch( this.left, this.key, this.right, (this.number+1));} else { /* if k >= 0 */ q= new Branch( this.left, this.key, this.right.add(x), this.number); } if (this.balance()==1) { return q.rotateL(); } else { if (this.balance() == -1) { return q.rotateR(); } else { return q; } } } public Multiset add(T x, int n) { Branch q; int k = x.compareTo(this.key); if ( k < 0 ) { q = new Branch( this.left.add(x,n), this.key, this.right, this.number); } else if (k==0) { q = new Branch( this.left, this.key, this.right, (this.number+n));} else { /* if k >= 0 */ q = new Branch( this.left, this.key, this.right.add(x,n), this.number); } if (this.balance()==1) { return q.rotateL(); } else { if (this.balance() == -1) { return q.rotateR(); } else { return q; } } } //search if x is in the tree public boolean member(T x) { int k = x.compareTo(this.key); // return true if x equals its value if (k == 0) { return true; } //otherwise see if x in the left subtree or //in the right subree else if (k < 0) { return this.left.member(x); } else return this.right.member(x); } public Multiset remove(T x) { Branch q; int k = x.compareTo(this.key); if (k == 0) { if (this.number ==1 ) { q = (Branch) this.left.union(this.right); } else q = new Branch(this.left, this.key, this.right, (this.number-1)); } else if (k < 0) { q = new Branch(this.left.remove(x), key, right,this.number); } else q = new Branch(left,key,this.right.remove(x),this.number); if (this.balance()==1) { return q.rotateL(); } else { if (this.balance() == -1) { return q.rotateR(); } else { return q; } } } public Multiset remove(T x, int n) { int k = x.compareTo(this.key); if (n==0) {return this;} else { if (k == 0) { if (this.number<=n) { return this.left.union(this.right); } else { return new Branch(this.left, this.key, this.right, (this.number-n)); } } else if (k < 0) { return new Branch(this.left.remove(x,n), key, right,this.number); } else return new Branch(left,key,this.right.remove(x,n),this.number); } } public Multiset union(Multiset u) { return u.union(left).union(right).add(key,this.number); } public Multiset inter(Multiset u) { if (u.member(key)) { return u.inter(this.removeall(key)).add(key,min(this.number,u.count(key))); } else { return u.inter(this.removeall(key)); } } public boolean subset(Multiset u) { Multiset temp = new Leaf(); temp = temp.union(u); boolean t = true; for (int i = 0; i<(number-1); i++) { temp = temp.remove(this.key); } if (temp.member(this.key)) { return left.subset(u) && right.subset(u); } else return false; } public boolean equal(Multiset u) { return (u.subset(this) && this.subset(u)); } // public Multiset diff(Multiset u) { return this.remove(key).diff(u.remove(key)); } public String toString() { String t = ""; for (int i=0; i<number;i++) { t = t+key+" "; } return left.toString() + " " + t + right.toString(); } @Override public int count(T x) { int k = x.compareTo(this.key); if (k == 0) { return (this.number); } else if (k < 0) { return this.left.count(x); } else return this.right.count(x); } public Multiset filter(T x) { int k = x.compareTo(this.key); if (k==0) { return (new Branch(this.left,this.key,this.right,1)); } else if (k<0) { return (new Branch(this.left.filter(x),key,this.right,this.number)); } else return (new Branch(this.left, key, this.right.filter(x),this.number)); } @Override public Multiset removeall(T x) { int k = x.compareTo(this.key); if (k == 0) { return this.left.union(this.right); } else if (k < 0) { return (new Branch(this.left.removeall(x), key, right,number)); } else return (new Branch(left,key,this.right.removeall(x),number)); } /* public int sumItS () { int sum = 0; Sequence as = this; while ( as.notEmpty() ) { sum = sum + this.here(); as = as.next(); } return sum; } */ public T nth(int n) { Sequence as = this.seq(); for (int i = n; i>0; i--) { as = as.next(); System.out.println(as.here()); } return (T) as.here(); } public int sum() { Sequence as = this.seq(); int sum = 0; while ( as.notEmpty() ) { System.out.println(as.here()); sum = sum + ((Integer) as.here()); as = as.next(); } return sum; } public Sequence seq() { return new AS_Branch(key, number, (new AS_Cat(left.seq(), right.seq()))); } /*public Multiset rotateR() { Multiset r = this.right; if (r.isEmptyHuh()) { return new Leaf(); } else { Branch t = (Branch) this.right; return (new Branch(t.right,t.key, new Branch(this.left,this.key,t.left,this.number),t.number)); } }*/ private Multiset<T> rotateR () { Branch q = this; Multiset p = q.left(); Multiset c = q.right(); Multiset a = p.left(); Multiset b = p.right(); q = new Branch(b,q.key,c,q.number); if (p.isEmptyHuh()) { return a.union(q); } else { p = new Branch(a, p.getKey(), q, ((Branch) p).number); return p; } } public Multiset<T> rotateL() { Branch q = this; Multiset p = this.right(); Multiset c = this.left(); Multiset a = p.left(); Multiset b = p.right(); q = new Branch(c,q.key,a,this.number); if (p.isEmptyHuh()) { return q.union(b); } else { p = new Branch(q,this.right().getKey(),b,((Branch) p).number); return p; } } }
229a44e9e84980abb28a32ac6869d7c083ac7ab5
fb65e9ce54a7211f2eb384a7a0ecbda9ac9f6d4f
/LATIHAN3/TestSiswa.java
95403e1531fa5c8309ab10301d4a2185ade108f0
[]
no_license
Syihabuddinsanni/Tugas_PBO2
150347a8a018ba51d8d080a7003cc328e29a2dd3
ed404bfbb5edab3706b1ebb3789605eb4ac89022
refs/heads/master
2020-08-23T05:58:11.494369
2019-10-21T13:53:49
2019-10-21T13:53:49
216,557,890
3
0
null
null
null
null
UTF-8
Java
false
false
476
java
package LATIHAN3; public class TestSiswa { public static void main(String[] args) { EncapSiswa siswa = new EncapSiswa(); siswa.setName("Syihab"); siswa.setAge(16); siswa.setAdress("Malang"); System.out.println("Name : "+siswa.getName()); System.out.println("Age : "+siswa.getAge()); System.out.println("Adress : "+siswa.getAdress()); } }
96d0e12544c21615b261c607ed1544d2291a4cbf
66b2d0cc86ec6717464053113f72b46e67b1dfec
/17_电商虚拟交易(项目)/day95_电商虚拟交易(项目)/代码/sleuth_parent/sleuth_client1/src/main/java/com/sleuth/Application1.java
1d218214452f5bee6763d6d68fcdb63a05b0e159
[]
no_license
wjphappy90/360Java
c33ca9bbb85b310f01ee42c585dd1aa28682e7b4
867dfb7f4788ca4df44e14dd21ffa9322a5dbb43
refs/heads/master
2022-11-28T09:03:28.791935
2020-08-10T02:20:48
2020-08-10T02:20:48
285,675,392
0
1
null
null
null
null
UTF-8
Java
false
false
546
java
package com.sleuth; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; import org.springframework.web.client.RestTemplate; /** * Created by 传智播客*黑马程序员. */ @SpringBootApplication public class Application1 { @Bean RestTemplate restTemplate() { return new RestTemplate(); } public static void main(String[] args) { SpringApplication.run(Application1.class, args); } }
930f95b08afc4b58d82fd429390475124255ec99
e52c2c98a5ebb3ddee4b19d302d9701e7c90541b
/LeetCode-Java/src/base/offer/J25.java
d9271ab4cb31a7da0a2dcce469f32c28c687d567
[]
no_license
EvAn-HuAngBiu/Leetcode
bc578cf320b380d59727b6d4aa31a63555e5c9e6
b5b8104973a99dab13ea6040cba4fe85e0408504
refs/heads/master
2023-08-02T07:03:07.722680
2021-10-09T08:46:52
2021-10-09T08:46:52
279,460,526
0
0
null
null
null
null
UTF-8
Java
false
false
922
java
package base.offer; /** * Project: LeetCode-Java * File: J25 * * @author evan * @date 2021/4/21 */ public class J25 { public ListNode mergeTwoLists(ListNode l1, ListNode l2) { ListNode head = new ListNode(-1), p = l1, q = l2, t = head; while (p != null & q != null) { if (p.val < q.val) { t.next = p; p = p.next; } else { t.next = q; q = q.next; } t = t.next; } if (p != null) { t.next = p; } else { t.next = q; } return head.next; } public static void main(String[] args) { ListNode l1 = new ListNode(1, new ListNode(2, new ListNode(4))); ListNode l2 = new ListNode(1, new ListNode(3, new ListNode(4))); ListNode merge = new J25().mergeTwoLists(l1, l2); merge.print(); } }
602df737e9ecaea4b9c862513c27150fdff10dec
0e4756fbda5832b02258425dd0e94382fdcb40d1
/netty/chat_netty3/server/src/main/java/com/cn/server/Server.java
9df52b38f17f9848bd8feccf5589abb402393203
[]
no_license
bobobokey/learndemo
d1da80636864825a8d1a6e6fe1168b599de119d9
24d6200e39d49362ce37023367627f536ecfa814
refs/heads/master
2022-04-28T14:44:17.970284
2022-04-28T04:33:01
2022-04-28T04:33:01
486,090,706
0
0
null
2022-04-28T04:33:02
2022-04-27T07:30:09
null
UTF-8
Java
false
false
1,583
java
package com.cn.server; import java.net.InetSocketAddress; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import org.jboss.netty.bootstrap.ServerBootstrap; import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.channel.ChannelPipelineFactory; import org.jboss.netty.channel.Channels; import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory; import org.springframework.stereotype.Component; import com.cn.common.core.codc.RequestDecoder; import com.cn.common.core.codc.ResponseEncoder; /** * netty服务端入门 * * */ @Component public class Server { /** * 启动 */ public void start() { //服务类 ServerBootstrap bootstrap = new ServerBootstrap(); //boss线程监听端口,worker线程负责数据读写 ExecutorService boss = Executors.newCachedThreadPool(); ExecutorService worker = Executors.newCachedThreadPool(); //设置niosocket工厂 bootstrap.setFactory(new NioServerSocketChannelFactory(boss, worker)); //设置管道的工厂 bootstrap.setPipelineFactory(new ChannelPipelineFactory() { @Override public ChannelPipeline getPipeline() throws Exception { ChannelPipeline pipeline = Channels.pipeline(); pipeline.addLast("decoder", new RequestDecoder()); pipeline.addLast("encoder", new ResponseEncoder()); pipeline.addLast("helloHandler", new ServerHandler()); return pipeline; } }); bootstrap.setOption("backlog", 1024); bootstrap.bind(new InetSocketAddress(10102)); System.out.println("start!!!"); } }
2eea8251ddc20ed9c4ba3e13c85a36c38a9eb0f2
6cac09e70051fb70a44fdf3b5e10493b718a1484
/src/main/java/cn/mmf/lastsmith/blades/BladeRoukanken.java
c445f3208086ebd49e2f839dc90b9ec202a7de5a
[ "MIT" ]
permissive
Nanamiya738/The-Last-Smith
bf5e9c526139c62a093920c5df93c54365dccfe2
23702d9e16eb203651223257cdf27e65c5ad11cb
refs/heads/master
2022-09-03T23:51:25.095138
2020-03-18T17:55:35
2020-03-18T17:55:35
267,525,039
0
0
MIT
2020-05-29T04:41:25
2020-05-28T07:39:28
null
UTF-8
Java
false
false
7,798
java
package cn.mmf.lastsmith.blades; import cn.mcmod_mmf.mmlib.util.RecipesUtil; import cn.mmf.lastsmith.TLSMain; import cn.mmf.lastsmith.event.RegisterSlashBladeEvent; import cn.mmf.lastsmith.event.RegisterSlashBladeRecipeEvent; import cn.mmf.lastsmith.item.ItemSlashBladeNamedTLS; import cn.mmf.lastsmith.recipe.RecipeAwakeBladeTLS; import cn.mmf.lastsmith.se.SELoader; import cn.mmf.lastsmith.util.BladeUtil; import mods.flammpfeil.slashblade.ItemSlashBladeNamed; import mods.flammpfeil.slashblade.SlashBlade; import mods.flammpfeil.slashblade.item.ItemSlashBlade; import mods.flammpfeil.slashblade.specialeffect.SpecialEffects; import net.minecraft.init.Enchantments; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.common.Mod.EventBusSubscriber; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @EventBusSubscriber public class BladeRoukanken { @SubscribeEvent public static void BladeRegister(RegisterSlashBladeEvent event) { ItemStack customblade = new ItemStack(BladeLoader.bladeNamed, 1, 0); NBTTagCompound tag1 = new NBTTagCompound(); customblade.setTagCompound(tag1); BladeUtil.IsFakeBlade.set(tag1, true); ItemSlashBladeNamed.CurrentItemName.set(tag1, "flammpfeil.slashblade.named.kanrou_fake"); ItemSlashBladeNamed.CustomMaxDamage.set(tag1, 70); ItemSlashBlade.setBaseAttackModifier(tag1, 7.0F); ItemSlashBlade.TextureName.set(tag1, "named/roukan/texture_fake_0"); ItemSlashBlade.ModelName.set(tag1, "named/agito"); BladeLoader.registerCustomItemStack("flammpfeil.slashblade.named.kanrou_fake", customblade); ItemSlashBladeNamedTLS.NamedBlades.add("flammpfeil.slashblade.named.kanrou_fake"); ItemStack customblade2 = new ItemStack(BladeLoader.bladeNamed, 1, 0); NBTTagCompound tag2 = new NBTTagCompound(); customblade2.setTagCompound(tag2); ItemSlashBladeNamed.CurrentItemName.set(tag2, "flammpfeil.slashblade.named.kanrou"); ItemSlashBladeNamed.CustomMaxDamage.set(tag2, 70); ItemSlashBlade.setBaseAttackModifier(tag2, 9.0F); ItemSlashBlade.TextureName.set(tag2, "named/roukan/texture_fake"); ItemSlashBlade.ModelName.set(tag2, "named/agito"); BladeLoader.registerCustomItemStack("flammpfeil.slashblade.named.kanrou", customblade2); ItemSlashBladeNamedTLS.NamedBlades.add("flammpfeil.slashblade.named.kanrou"); ItemStack customblade3 = new ItemStack(BladeLoader.bladeNamed, 1, 0); NBTTagCompound tag3 = new NBTTagCompound(); customblade3.setTagCompound(tag3); ItemSlashBladeNamed.IsDefaultBewitched.set(tag3, true); BladeUtil.IsBewitchedActived.set(tag3, true); ItemSlashBladeNamed.CurrentItemName.set(tag3, "flammpfeil.slashblade.named.roukan"); ItemSlashBladeNamed.CustomMaxDamage.set(tag3, 40); ItemSlashBlade.setBaseAttackModifier(tag3, 15.0F); ItemSlashBlade.SpecialAttackType.set(tag3, 8); customblade3.addEnchantment(Enchantments.UNBREAKING, 2); customblade3.addEnchantment(Enchantments.KNOCKBACK, 1); customblade3.addEnchantment(Enchantments.SHARPNESS, 4); SpecialEffects.addEffect(customblade3, SELoader.EXTREME_SHARPNESS); ItemSlashBlade.TextureName.set(tag3, "named/roukan/texture"); ItemSlashBlade.ModelName.set(tag3, "named/roukan/model"); BladeLoader.registerCustomItemStack("flammpfeil.slashblade.named.roukan", customblade3); ItemSlashBladeNamedTLS.NamedBlades.add("flammpfeil.slashblade.named.roukan"); ItemStack customblade4 = new ItemStack(BladeLoader.bladeNamed, 1, 0); NBTTagCompound tag4 = new NBTTagCompound(); customblade4.setTagCompound(tag4); ItemSlashBladeNamed.IsDefaultBewitched.set(tag4, true); BladeUtil.IsBewitchedActived.set(tag4, true); ItemSlashBladeNamed.CurrentItemName.set(tag4, "flammpfeil.slashblade.named.roukan_nether"); ItemSlashBladeNamed.CustomMaxDamage.set(tag4, 40); ItemSlashBlade.AttackAmplifier.set(tag4, 4F); ItemSlashBlade.setBaseAttackModifier(tag4, 16.0F); ItemSlashBlade.SpecialAttackType.set(tag4, 9); customblade4.addEnchantment(Enchantments.UNBREAKING, 3); customblade4.addEnchantment(Enchantments.KNOCKBACK, 2); customblade4.addEnchantment(Enchantments.SHARPNESS, 5); customblade4.addEnchantment(Enchantments.FIRE_ASPECT, 2); SpecialEffects.addEffect(customblade4, SELoader.EXTREME_SHARPNESS); ItemSlashBlade.TextureName.set(tag4, "named/roukan/texture_tx"); ItemSlashBlade.ModelName.set(tag4, "named/roukan/model"); BladeLoader.registerCustomItemStack("flammpfeil.slashblade.named.roukan_nether", customblade4); ItemSlashBladeNamedTLS.NamedBlades.add("flammpfeil.slashblade.named.roukan_nether"); } @SubscribeEvent public static void onRecipeRegister(RegisterSlashBladeRecipeEvent event) { ItemStack request_1 = new ItemStack(BladeLoader.blade); NBTTagCompound tag1 = new NBTTagCompound(); ItemSlashBlade.KillCount.set(tag1, 50); request_1.setTagCompound(tag1); RecipesUtil.addRecipe(TLSMain.MODID,"flammpfeil.slashblade.named.kanrou_fake", new RecipeAwakeBladeTLS( new ResourceLocation(TLSMain.MODID, "flammpfeil.slashblade.named.kanrou_fake"), "sakura_blade", BladeLoader.getCustomBlade("flammpfeil.slashblade.named.kanrou_fake"), request_1, new Object[] { "PDP", "DSD", "PBP", 'D', "leafSakura", 'P', "ingotGold", 'S', SlashBlade.getCustomBlade(SlashBlade.ProudSoulStr), 'B', request_1 })); ItemStack request_2 = BladeLoader.getCustomBlade("flammpfeil.slashblade.named.kanrou_fake"); NBTTagCompound tag2 = ItemSlashBlade.getItemTagCompound(request_2); ItemSlashBlade.KillCount.set(tag2, 200); ItemSlashBlade.ProudSoul.set(tag2, 1000); request_2.setTagCompound(tag2); RecipesUtil.addRecipe(TLSMain.MODID,"flammpfeil.slashblade.named.kanrou", new RecipeAwakeBladeTLS( new ResourceLocation(TLSMain.MODID, "flammpfeil.slashblade.named.kanrou"), "sakura_blade", BladeLoader.getCustomBlade("flammpfeil.slashblade.named.kanrou"), request_2, new Object[] { "PSD", "SDS", "BSP", 'D', SlashBlade.getCustomBlade(SlashBlade.IngotBladeSoulStr), 'P', "gemDiamond", 'S', "fullSakura", 'B', request_2 })); ItemStack request_3 = BladeLoader.getCustomBlade("flammpfeil.slashblade.named.kanrou"); NBTTagCompound tag3 = ItemSlashBlade.getItemTagCompound(request_3); ItemSlashBlade.KillCount.set(tag3, 1000); ItemSlashBlade.ProudSoul.set(tag3, 5000); ItemSlashBlade.RepairCount.set(tag3, 1); request_3.addEnchantment(Enchantments.SHARPNESS, 1); request_3.setTagCompound(tag3); RecipesUtil.addRecipe(TLSMain.MODID,"flammpfeil.slashblade.named.roukan", new RecipeAwakeBladeTLS( new ResourceLocation(TLSMain.MODID, "flammpfeil.slashblade.named.roukan"), "sakura_blade", BladeLoader.getCustomBlade("flammpfeil.slashblade.named.roukan"), request_3, new Object[] { "SPD", "PBP", "DPS", 'D', "blockSakura", 'P', "blockDiamond", 'S', SlashBlade.getCustomBlade(SlashBlade.SphereBladeSoulStr), 'B', request_3 })); ItemStack request_4 = BladeLoader.getCustomBlade("flammpfeil.slashblade.named.roukan"); NBTTagCompound tag4 = ItemSlashBlade.getItemTagCompound(request_4); ItemSlashBlade.KillCount.set(tag4, 2500); ItemSlashBlade.ProudSoul.set(tag4, 25000); ItemSlashBlade.RepairCount.set(tag4, 5); request_4.addEnchantment(Enchantments.FIRE_ASPECT, 1); request_4.setTagCompound(tag4); RecipesUtil.addRecipe(TLSMain.MODID,"flammpfeil.slashblade.named.roukan_nether", new RecipeAwakeBladeTLS( new ResourceLocation(TLSMain.MODID, "flammpfeil.slashblade.named.roukan_nether"), "sharpness", BladeLoader.getCustomBlade("flammpfeil.slashblade.named.roukan_nether"), request_4, new Object[] { "DSD", "PBP", "DSD", 'D', "sphereSakura", 'P', "blockDiamond", 'S', "netherStar", 'B', request_4 })); } }
0d6bd2556706126d65ee3e33d5567dd262e8a5ea
e947d158b7d201da124d2afa822dc434a2e971c3
/app/src/main/java/com/example/jeff/jsonloginreg/Bind.java
ece57af61d1ce6ff24cd22b64377c4c1965a436f
[]
no_license
jeffatakora/jsonLoginReg
dff55849718bb2895dc84b8561532f35b910dde9
453594f89e65dd72c8084c213e258a0f9bcae599
refs/heads/master
2020-09-29T15:02:04.979324
2019-12-10T07:48:36
2019-12-10T07:48:36
227,059,008
0
0
null
null
null
null
UTF-8
Java
false
false
100
java
package com.example.jeff.jsonloginreg; /** * Created by jeff on 7/10/19. */ @interface Bind { }
42f5748b62be3f5a44546d16cc4a562c883ce89f
7b73756ba240202ea92f8f0c5c51c8343c0efa5f
/classes2/vyw.java
8e98f6b4f49a98f2f224e47b211732394f1bf0fa
[]
no_license
meeidol-luo/qooq
588a4ca6d8ad579b28dec66ec8084399fb0991ef
e723920ac555e99d5325b1d4024552383713c28d
refs/heads/master
2020-03-27T03:16:06.616300
2016-10-08T07:33:58
2016-10-08T07:33:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
653
java
import android.os.Bundle; import com.tencent.mobileqq.hotpatch.NotVerifyClass; import com.tencent.mobileqq.nearby.business.NearbyCardHandler; public final class vyw implements Runnable { public vyw(NearbyCardHandler paramNearbyCardHandler, Bundle paramBundle) { boolean bool = NotVerifyClass.DO_VERIFY_CLASS; } public void run() { this.jdField_a_of_type_ComTencentMobileqqNearbyBusinessNearbyCardHandler.a(this.jdField_a_of_type_AndroidOsBundle, null, null, false, false, false); } } /* Location: E:\apk\QQ_91\classes2-dex2jar.jar!\vyw.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
e2d42914105b17c32701f35d06f981eb7a21007e
8a52d8b76638d247a247d2bf36eb80c3d74f1334
/service-ui/src/main/java/com/example/demo/model/Employee.java
dc043189834143b048ccb8e6faef5cfb8517dc1f
[]
no_license
prosenjit-techHubGit/SpringTestProject
67f23187c1a24c01781fb4e92db5ae6d1fe299a1
c5810ce9043717f0e553b6cd48ae5217bf6eb4ad
refs/heads/master
2020-04-03T10:30:04.816954
2018-10-31T14:02:11
2018-10-31T14:02:11
155,194,619
0
0
null
null
null
null
UTF-8
Java
false
false
1,093
java
package com.example.demo.model; public class Employee { public Employee(String name, String email, String phone, String department, String manager) { super(); this.name = name; this.email = email; this.phone = phone; this.department = department; this.manager = manager; } public Employee() { super(); // TODO Auto-generated constructor stub } private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public String getDepartment() { return department; } public void setDepartment(String department) { this.department = department; } public String getManager() { return manager; } public void setManager(String manager) { this.manager = manager; } private String email; private String phone; private String department; private String manager; }
bbb6b305263ed7b612878dc3941f549faec0d579
d6ab38714f7a5f0dc6d7446ec20626f8f539406a
/backend/collecting/collectedFiles/Java/edited/iluwatarjava-design-patternsblobfaa29f8025f6fb90472dacb6e8ad8569605f8d61facadesrcmainjavacomiluwatarfacadeDwarvenGoldmineFacade.java
5b1377d9baea9b0063996641028835486d13dbb0
[]
no_license
haditabatabaei/webproject
8db7178affaca835b5d66daa7d47c28443b53c3d
86b3f253e894f4368a517711bbfbe257be0259fd
refs/heads/master
2020-04-10T09:26:25.819406
2018-12-08T12:21:52
2018-12-08T12:21:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
965
java
package com.iluwatar.facade; import java.util.ArrayList; import java.util.Collection; import java.util.List; public class DwarvenGoldmineFacade { private final List<DwarvenMineWorker> workers; public DwarvenGoldmineFacade() { workers = new ArrayList<>(); workers.add(new DwarvenGoldDigger()); workers.add(new DwarvenCartOperator()); workers.add(new DwarvenTunnelDigger()); } public void startNewDay() { makeActions(workers, DwarvenMineWorker.Action.WAKE_UP, DwarvenMineWorker.Action.GO_TO_MINE); } public void digOutGold() { makeActions(workers, DwarvenMineWorker.Action.WORK); } public void endDay() { makeActions(workers, DwarvenMineWorker.Action.GO_HOME, DwarvenMineWorker.Action.GO_TO_SLEEP); } private static void makeActions(Collection<DwarvenMineWorker> workers, DwarvenMineWorker.Action... actions) { for (DwarvenMineWorker worker : workers) { worker.action(actions); } } }
5e7d9e6ba3a8426b5efc510a1a7e9c86dc314116
b10171080f469c7e1f8b3150eb0b9e35f9fabc90
/src/fenetre_table_1/Fenetre.java
4824222124c5555bbe20688ec3522e383540800e
[]
no_license
jamnaranjo/Fenetres
293ad06edc2cb9d0fe611506ec9d799351ccbb55
8066eebcc6ae0235b4746a6863ebddfa60039d18
refs/heads/master
2020-03-16T15:44:33.796385
2018-05-09T13:00:34
2018-05-09T13:00:34
132,756,901
0
0
null
null
null
null
UTF-8
Java
false
false
1,288
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 fenetre_table_1; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.util.Vector; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; /** * * @author jalvaro */ public class Fenetre extends JFrame { private JPanel panneauFond; private JTable table; private JScrollPane defileur; public Fenetre(String s, Vector<String> colonnes, Vector<Vector<Object>> lignes) { super(s); addWindowListener(new EcouteFenetre()); panneauFond = new JPanel(); panneauFond.setLayout(new BorderLayout()); panneauFond.setPreferredSize(new Dimension(500, 120)); table = new JTable(lignes, colonnes); table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); defileur = new JScrollPane(table); defileur.getViewport().setBackground(Color.pink); panneauFond.add(defileur); getContentPane().add(panneauFond); pack(); setVisible(true); } }
71321b35d100cfc2c6e4b4ae9415443a1e59eea9
7120f0438c1a4a20d67e88c822a601ad61ef5c4d
/zyr-web/src/main/java/com/zgm/zen/jkglyz/PettyGirl.java
7ea98734cb8654f9faa6004498c533f87c646fd6
[]
no_license
zgmzyr/zyr
f94dea3d7f7f962b6df5e18185d3e61d77dc009a
fea3c44fe6fbe0c110805487096f203fcb8b823b
refs/heads/master
2021-01-17T15:09:02.961884
2016-06-26T08:38:14
2016-06-26T08:38:14
9,864,102
0
0
null
null
null
null
UTF-8
Java
false
false
523
java
package com.zgm.zen.jkglyz; public class PettyGirl implements IGoodBodyGirl, IGreatTemperamentGirl { private String name; public PettyGirl(String name){ this.name = name; } @Override public void goodLooking() { System.out.println(this.name + "---脸蛋很漂亮!"); } @Override public void niceFigure() { System.out.println(this.name + "---身材很棒!"); } @Override public void greatTemperament() { System.out.println(this.name + "---气质非常好!"); } }
[ "Administrator@zgm" ]
Administrator@zgm