blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
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
132 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
28 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
352
fc2edad30106639197380dec71513cb26a8e6c96
3a7ca75faef29a9ee88c0d49909f255651c295a2
/src/test/java/cn/wmyskxz/springboot/controller/DrugControllerTest.java
f8f2b8996586f3383a5e19d8c1f52e16ae62f1b0
[]
no_license
wzj9050/FinalWeb
cc3496c3fbfedcff86ba2f5dcd42fefd61be1755
5de6a51e1bf6eafa5b09397dce22bfd7f8688f6d
refs/heads/master
2023-05-01T14:20:06.216631
2021-05-20T16:41:28
2021-05-20T16:41:28
368,939,043
0
0
null
null
null
null
UTF-8
Java
false
false
290
java
package cn.wmyskxz.springboot.controller; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.*; class DrugControllerTest { @Test void getServletContext() { } @Test void drugs() { } @Test void setServletContext() { } }
[ "Zijin.19@intl.zju.edu.cn" ]
Zijin.19@intl.zju.edu.cn
fabaf6d94f0e33211704a210c89aa9eb4d50e217
fec5a7157473a25b68db77de911e3ead805fab5b
/javatest/src/main/java/com/example/Action.java
f5b042d9969765e280b108e43f73c3b540a350c4
[]
no_license
oceanhai/MyFrame
b0c75b8af0d61fa4102842c0817e419773c5f7e8
1bc59b114db07edcbf432c07b2c9043eeab2a0e5
refs/heads/master
2020-04-12T10:09:44.064775
2019-07-31T14:26:09
2019-07-31T14:26:09
65,266,635
17
8
null
null
null
null
UTF-8
Java
false
false
174
java
package com.example; /** * Created by Administrator on 2016/10/15. */ public abstract class Action { public abstract void eat(); public abstract void sleep(); }
[ "1945163213@qq.com" ]
1945163213@qq.com
7817c09c6bccbefeffd74ac6d5654c0069dda849
ec1deefbf381c6d1da1eb5f737bbac1e566b3a4e
/clienteServidor/src/Mensaje/Mensaje.java
cad753afcf51d0064482edcdf931518edf8faac8
[]
no_license
jaimedelgado/JAVA
1751d514ad2b8bc02b254e4432698c188b9e4329
1227e0823996522220238f85b277b61c29721ee0
refs/heads/master
2020-03-29T23:04:17.994026
2015-02-12T23:01:44
2015-02-12T23:01:44
30,725,707
1
0
null
null
null
null
UTF-8
Java
false
false
293
java
package Mensaje; public abstract class Mensaje { protected String origen, destino, tipo; public abstract String toString(); public String getOrigen() { return origen; } public String getDestino() { return destino; } public String getTipo(){ return this.tipo; } }
[ "jaimedel@ucm.es" ]
jaimedel@ucm.es
378cfd94dd79571b7e32113088678e30ce84832f
49d9a05970305bbc1c336e9a55d051ac7b467c55
/credit_risk_control_web/src/main/java/com/hanzhou/www/controller/user/SysPermissionController.java
28d912a6706a7c62effb11868422e619fe0f655a
[]
no_license
codeamateur/credit_risk_control_parent
ba1f78eb9c883434193c94bbbc43cad920725cc9
a3f0fa8dcf580495239015044ae4a231bd7b7d6b
refs/heads/master
2020-05-20T23:32:39.981580
2017-03-17T07:49:17
2017-03-17T07:49:17
84,545,489
0
1
null
null
null
null
UTF-8
Java
false
false
1,883
java
package com.hanzhou.www.controller.user; import java.util.ArrayList; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import org.springside.modules.utils.mapper.BeanMapper; import com.hanzhou.www.EasyUiPage; import com.hanzhou.www.dto.sys.PermissionDto; import com.hanzhou.www.model.sys.Permission; import com.hanzhou.www.service.sys.SysPermissionService; @Controller @RequestMapping("/permission") public class SysPermissionController { private static final Logger LOGGER = LoggerFactory.getLogger(SysPermissionController.class); @Autowired private SysPermissionService sysPermissionService; @RequestMapping(value = "/toList", method = RequestMethod.GET) public String toList(){ return "system/sys/menuList"; } @RequestMapping(value = "/list", method = RequestMethod.GET) @ResponseBody public EasyUiPage list() { List<PermissionDto> dtoList = new ArrayList<PermissionDto>(); List<Permission> menuPermissions = sysPermissionService.getMenusByLevel(0); if(menuPermissions !=null && !menuPermissions.isEmpty()){ List<Permission> subPermissions = null; PermissionDto dto = null; for(Permission permission:menuPermissions){ dto = BeanMapper.map(permission, PermissionDto.class); dtoList.add(dto); subPermissions = sysPermissionService.getListByRefId(permission.getId()); if(subPermissions != null && !subPermissions.isEmpty()){ dtoList.addAll(BeanMapper.mapList(subPermissions, Permission.class, PermissionDto.class)); } } } return new EasyUiPage(dtoList.size(),dtoList); } }
[ "network404@outlook.com" ]
network404@outlook.com
ded9a95bf38a0f1a3a4d1c22978945e2d5538740
41d101f238460b17accb8df4ca65d2807d0044e6
/metrics-sampler-extension-http/src/main/java/org/metricssampler/extensions/http/parsers/regexp/RegExpLineFormatXBean.java
bdf34de2ac33d2a5c72379c1c74b1dc3ce0f0cea
[]
no_license
stropa/metrics-sampler
d8216ee48358c35fa9b286cb2f04b077e91d7139
7c270918ece76e63a5cb2317d9f28f2c007ffb11
refs/heads/master
2020-04-08T11:32:40.688211
2015-08-06T20:47:15
2015-08-06T20:47:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,570
java
package org.metricssampler.extensions.http.parsers.regexp; import static org.metricssampler.config.loader.xbeans.ValidationUtils.greaterThanZero; import static org.metricssampler.config.loader.xbeans.ValidationUtils.notEmpty; import static org.metricssampler.config.loader.xbeans.ValidationUtils.validPattern; import java.util.regex.Pattern; import com.thoughtworks.xstream.annotations.XStreamAlias; import com.thoughtworks.xstream.annotations.XStreamAsAttribute; @XStreamAlias("regexp-line-format") public class RegExpLineFormatXBean { @XStreamAsAttribute private String expression; @XStreamAlias("name-index") @XStreamAsAttribute private int nameIndex; @XStreamAlias("value-index") @XStreamAsAttribute private int valueIndex; public String getExpression() { return expression; } public void setExpression(final String expression) { this.expression = expression; } public int getNameIndex() { return nameIndex; } public void setNameIndex(final int nameIndex) { this.nameIndex = nameIndex; } public int getValueIndex() { return valueIndex; } public void setValueIndex(final int valueIndex) { this.valueIndex = valueIndex; } protected void validate() { notEmpty(this, "expression", getExpression()); validPattern(this, "expression", getExpression()); greaterThanZero(this, "name-index", getNameIndex()); greaterThanZero(this, "value-index", getValueIndex()); } public RegExpLineFormat createFormat() { validate(); return new RegExpLineFormat(Pattern.compile(expression), getNameIndex(), getValueIndex()); } }
[ "dimo.velev@gmail.com" ]
dimo.velev@gmail.com
e8d6e8a1da1f15474917da9e12c21345cdaf819d
3ef70f3fc39bb00c754bf4196a6e46d9a071cfa1
/quizzMetier/src/main/java/fr/gfi/cmg/QuizzCmg/metier/entite/hibernate/TypeSujet.java
3d5948e13029f2502e2ec449bb89baba79f43f78
[]
no_license
ouar/trunk
14a2c271e82234e0336236a8bd49c562915c2a4a
c46d471616eb1d6f5e9f61fc90dfec87a6573030
refs/heads/master
2016-09-06T18:28:04.728778
2014-05-25T09:29:09
2014-05-25T09:29:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,596
java
package fr.gfi.cmg.QuizzCmg.metier.entite.hibernate; // Generated 17 sept. 2013 17:50:17 by Hibernate Tools 3.4.0.CR1 import java.util.HashSet; import java.util.Set; /** * TypeSujet generated by hbm2java */ public class TypeSujet implements java.io.Serializable { private Integer id; private Langage langage; private String libelle; private Set<Question> questions = new HashSet<Question>(0); private Set<QuizzSujet> quizzSujets = new HashSet<QuizzSujet>(0); public TypeSujet() { } public TypeSujet(Langage langage, String libelle) { this.langage = langage; this.libelle = libelle; } public TypeSujet(Langage langage, String libelle, Set<Question> questions, Set<QuizzSujet> quizzSujets) { this.langage = langage; this.libelle = libelle; this.questions = questions; this.quizzSujets = quizzSujets; } public Integer getId() { return this.id; } public void setId(Integer id) { this.id = id; } public Langage getLangage() { return this.langage; } public void setLangage(Langage langage) { this.langage = langage; } public String getLibelle() { return this.libelle; } public void setLibelle(String libelle) { this.libelle = libelle; } public Set<Question> getQuestions() { return this.questions; } public void setQuestions(Set<Question> questions) { this.questions = questions; } public Set<QuizzSujet> getQuizzSujets() { return this.quizzSujets; } public void setQuizzSujets(Set<QuizzSujet> quizzSujets) { this.quizzSujets = quizzSujets; } }
[ "salah.ouar@gmail.com@8a90c874-dc04-0533-cdee-ece230407e5f" ]
salah.ouar@gmail.com@8a90c874-dc04-0533-cdee-ece230407e5f
4cce51b409186a024ddb158997852ca400531be5
062e02815799719d9b38073dc79e7d678661e980
/basecore/src/main/java/com.example.basecore/mapper/IBaseMapper.java
15488e51a4d63135bfe04a1e56b96a77b69f2447
[]
no_license
xiaoyang123456/demo
d80889c35ae18413b9f25747ae8e431061e3372a
15cfa3375c350a5070a6a63c34f1671d865b8087
refs/heads/master
2022-11-15T00:01:15.033855
2020-01-23T03:55:55
2020-01-23T03:55:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
965
java
package com.example.basecore.mapper; import com.example.basecore.entity.BaseDO; import com.github.pagehelper.Page; import java.util.List; import java.util.Map; /** * 数据持久层接口 * * @author caoshichuan * @date 2017-08-22 13:19 **/ public interface IBaseMapper<T extends BaseDO> { <V extends T> V getOne(Map<String, Object> map); <V extends T> V getByPrimaryKey(Long id); <V extends T> List<V> listByParams(Map<String, Object> map); <V extends T> List<V> listAll(); <V extends T> Page<V> listPage(T entity); Integer count(Map<String, Object> map); int insert(T entity); int insertSelective(T entity); int deleteByPrimaryKey(Long id); int deleteByIdFalse(Long id); int updateByPrimaryKey(T entity); int updateByPrimaryKeySelective(T entity); int addInBatch(List<T> entityList); int updateInBatch(List<T> entityList); int deleteByPrimaryKeyInBatch(List<String> idList); }
[ "yi.yang@founder.com.cn" ]
yi.yang@founder.com.cn
e991caaa4f3b16f65d327a2ad5d2b3fb9cc2afc0
0bffcdd8c5f803627956bd7cec7b28d1cea00dc3
/src/main/java/com/nativex/monetization/business/GetDeviceBalanceResponseData.java
362b68fd2ad0634a9e743f28edee4dae8c6353c2
[]
no_license
sinzua/baseApk
eb5d8c28cdb385ec49413217151ebba7c2fbb723
9011fb631ed84b1747561244cc08fff38205e97c
refs/heads/master
2021-01-21T17:39:20.367401
2017-05-21T18:06:26
2017-05-21T18:06:26
91,977,496
3
2
null
null
null
null
UTF-8
Java
false
false
700
java
package com.nativex.monetization.business; import com.google.gson.annotations.SerializedName; import com.nativex.common.LogItem; import com.nativex.common.Message; import com.nativex.common.Violation; import com.nativex.monetization.business.reward.Reward; import java.util.List; public class GetDeviceBalanceResponseData { @SerializedName("Balances") private List<Reward> balances = null; @SerializedName("Log") private List<LogItem> log = null; @SerializedName("Messages") private List<Message> messages = null; @SerializedName("Violations") private List<Violation> violations = null; public List<Reward> getBalances() { return this.balances; } }
[ "sinzua@gmail.com" ]
sinzua@gmail.com
8de3c77ed655bd17e6aa75a58a1a5eb64cc1e42b
0f90ce7bca8a10e8bb034fa7845c76edd282d07b
/header/src/main/java/org/zstack/header/volume/APIExpungeDataVolumeMsg.java
b64a290a590b30cf4211b4806a652a28267a8bca
[ "Apache-2.0" ]
permissive
cathywife/zstack
f8fac904c99af58fc742326193377657f969965b
3c282617f08c8535cf135fab31f2db7ac8bba121
refs/heads/master
2021-01-12T05:48:01.271101
2016-12-23T04:54:27
2016-12-23T04:55:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
535
java
package org.zstack.header.volume; import org.zstack.header.identity.Action; import org.zstack.header.message.APIMessage; /** * Created by frank on 11/16/2015. */ @Action(category = VolumeConstant.ACTION_CATEGORY) public class APIExpungeDataVolumeMsg extends APIMessage implements VolumeMessage { private String uuid; public String getUuid() { return uuid; } public void setUuid(String uuid) { this.uuid = uuid; } @Override public String getVolumeUuid() { return uuid; } }
[ "xuexuemiao@yeah.net" ]
xuexuemiao@yeah.net
5421528cf28714073b7e381ce7550de4136053d3
40d844c1c780cf3618979626282cf59be833907f
/src/testcases/CWE197_Numeric_Truncation_Error/s02/CWE197_Numeric_Truncation_Error__short_random_10.java
0f321cfa49586ed9fe06ee26376e793aade88ed7
[]
no_license
rubengomez97/juliet
f9566de7be198921113658f904b521b6bca4d262
13debb7a1cc801977b9371b8cc1a313cd1de3a0e
refs/heads/master
2023-06-02T00:37:24.532638
2021-06-23T17:22:22
2021-06-23T17:22:22
379,676,259
1
0
null
null
null
null
UTF-8
Java
false
false
3,437
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE197_Numeric_Truncation_Error__short_random_10.java Label Definition File: CWE197_Numeric_Truncation_Error__short.label.xml Template File: sources-sink-10.tmpl.java */ /* * @description * CWE: 197 Numeric Truncation Error * BadSource: random Set data to a random value * GoodSource: A hardcoded non-zero, non-min, non-max, even number * BadSink: to_byte Convert data to a byte * Flow Variant: 10 Control flow: if(IO.staticTrue) and if(IO.staticFalse) * * */ package testcases.CWE197_Numeric_Truncation_Error.s02; import testcasesupport.*; import java.security.SecureRandom; public class CWE197_Numeric_Truncation_Error__short_random_10 extends AbstractTestCase { /* uses badsource and badsink */ public void bad() throws Throwable { short data; if (IO.staticTrue) { /* FLAW: Set data to a random value */ data = (short)((new SecureRandom()).nextInt(Short.MAX_VALUE + 1)); } else { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run * but ensure data is inititialized before the Sink to avoid compiler errors */ data = 0; } { /* POTENTIAL FLAW: Convert data to a byte, possibly causing a truncation error */ IO.writeLine((byte)data); } } /* goodG2B1() - use goodsource and badsink by changing IO.staticTrue to IO.staticFalse */ private void goodG2B1() throws Throwable { short data; if (IO.staticFalse) { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run * but ensure data is inititialized before the Sink to avoid compiler errors */ data = 0; } else { /* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */ data = 2; } { /* POTENTIAL FLAW: Convert data to a byte, possibly causing a truncation error */ IO.writeLine((byte)data); } } /* goodG2B2() - use goodsource and badsink by reversing statements in if */ private void goodG2B2() throws Throwable { short data; if (IO.staticTrue) { /* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */ data = 2; } else { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run * but ensure data is inititialized before the Sink to avoid compiler errors */ data = 0; } { /* POTENTIAL FLAW: Convert data to a byte, possibly causing a truncation error */ IO.writeLine((byte)data); } } public void good() throws Throwable { goodG2B1(); goodG2B2(); } /* Below is the main(). It is only used when building this testcase on * its own for testing or for building a binary to use in testing binary * analysis tools. It is not used when compiling all the testcases as one * application, which is how source code analysis tools are tested. */ public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException { mainFromParent(args); } }
[ "you@example.com" ]
you@example.com
d1d3fd36da27a9fb61fb5b83ff4a938f17b4cd94
799cce351010ca320625a651fb2e5334611d2ebf
/Data Set/Synthetic/After/after_1611.java
4285d9964064645429f0327606ef6a97dbb2b505
[]
no_license
dareenkf/SQLIFIX
239be5e32983e5607787297d334e5a036620e8af
6e683aa68b5ec2cfe2a496aef7b467933c6de53e
refs/heads/main
2023-01-29T06:44:46.737157
2020-11-09T18:14:24
2020-11-09T18:14:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
312
java
public class Dummy { void sendRequest(Connection conn) throws SQLException { PreparedStatement stmt = conn.prepareStatement("SELECT EMPLOYEE_ID, LAST_NAME, EMAIL FROM EMPLOYEES WHERE LAST_NAME >? OR EMAIL >?"); stmt.setObject(1 , val2); stmt.setObject(2 , rand1); ResultSet rs = stmt.executeQuery(); } }
[ "jahin99@gmail.com" ]
jahin99@gmail.com
44a7cb631da42e50c47897299e741b5dd2cf716b
06c2367a30ba254308b6c99746bc363404e3133e
/salary-app/src/main/java/cn/com/flaginfo/AppWebApplication.java
09ff8f66b3a584ed7c360424c0dc03f0956c2e56
[]
no_license
fcoregithub/salaryManage
6715d309910643d96188b4d320ff0c7c75e8033d
3e1bccbaf35fa35eeb527a759ab6071cfc932b53
refs/heads/master
2020-12-02T22:55:10.150411
2017-07-04T10:02:23
2017-07-04T10:02:23
96,203,848
0
0
null
null
null
null
UTF-8
Java
false
false
1,793
java
package cn.com.flaginfo; import javax.servlet.Filter; import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.boot.web.servlet.ServletComponentScan; import org.springframework.context.annotation.Bean; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.web.bind.annotation.RestController; @SpringBootApplication @RestController @ServletComponentScan @EnableScheduling @MapperScan(value = { "cn.com.flaginfo.dao" }) public class AppWebApplication { @Bean public FilterRegistrationBean filterRegistrationBean () { FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(); filterRegistrationBean.setFilter(AppSSOFilter()); filterRegistrationBean.addInitParameter("index_url", ""); filterRegistrationBean.addInitParameter("error_url", "http://zx.ums86.com"); filterRegistrationBean.addInitParameter("key_cookie_login_flag", "_sso_user"); filterRegistrationBean.addInitParameter("key_sso_session_user", "loginUser"); filterRegistrationBean.addInitParameter("ignoreUrls","/css/**,/images/**,/img/**,js/**"); filterRegistrationBean.addInitParameter("targetBeanName","appSSOFilter"); filterRegistrationBean.addInitParameter("targetFilterLifecycle","true"); filterRegistrationBean.setEnabled(true); filterRegistrationBean.addUrlPatterns("/*"); return filterRegistrationBean; } @Bean public Filter AppSSOFilter() { return new cn.com.flaginfo.filter.AppSSOFilter(); } public static void main(String[] args) { SpringApplication.run(AppWebApplication.class, args); } }
[ "jk_zhangjukai@163.com" ]
jk_zhangjukai@163.com
01fa4777b67f2384f8f6d41d592a5b099403e145
ccb61753e9a54b870449b1790342ab05fb09d8e4
/Praktikum-9/DaftarBelanja/app/src/main/java/com/erpambudi/daftarbelanja/model/Data.java
b19f5a3b658cb3180a35a07578f715fa19d6dfee
[]
no_license
erpambudi/Pemrograman-Mobile
b0dee37f577d7630f5bea0e5d4f0a554aa0017dc
c03882eec92c4422824e6c115b5e594275acfee2
refs/heads/master
2020-08-07T09:20:24.340555
2020-01-07T10:54:36
2020-01-07T10:54:36
212,946,479
0
0
null
null
null
null
UTF-8
Java
false
false
1,076
java
package com.erpambudi.daftarbelanja.model; public class Data { private String type; private int amount; private String note; private String date; private String id; public Data() { } public Data(String type, int amount, String note, String date, String id) { this.type = type; this.amount = amount; this.note = note; this.date = date; this.id = id; } public String getType() { return type; } public void setType(String type) { this.type = type; } public int getAmount() { return amount; } public void setAmount(int amount) { this.amount = amount; } public String getNote() { return note; } public void setNote(String note) { this.note = note; } public String getDate() { return date; } public void setDate(String date) { this.date = date; } public String getId() { return id; } public void setId(String id) { this.id = id; } }
[ "erpambudi76@gmail.com" ]
erpambudi76@gmail.com
a98b6405ae5a377b76942804747645ec4ea2b627
b45a057b52344497f800d247c8aca9ec890c2714
/holly-chains-mobile/src/main/java/com/bt/chains/mapper/RewardMapper.java
d39f19960677427bdc18c62ecac10ffe530610e5
[]
no_license
scorpiopapa/game-hollychains
8f6269663dddf7749066c30583a6eab01e4c5b95
fc39e8b21d379dc8a89083913e2ef2a407de6368
refs/heads/master
2020-06-02T01:27:10.053166
2014-09-27T09:40:08
2014-09-27T09:40:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,864
java
package com.bt.chains.mapper; import java.util.List; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; import com.bt.chains.bean.domain.RewardConfig; import com.bt.chains.bean.domain.RewardMaster; import com.bt.chains.bean.domain.UserAchievementHistory; import com.bt.chains.bean.domain.UserReward; import com.bt.chains.bean.domain.UserRewardHis; import com.bt.chains.bean.domain.UserRewardStatus; import com.bt.chains.bean.domain.UserScore; import com.bt.chains.bean.view.UserAchivementView; @Repository public interface RewardMapper { /** * 获取用户奖励信息 * @param int * @return UserRewardView */ public List<UserAchivementView> getAchivementListDetail(@Param("userId")int userId); /** * 获取成就种类 * @param int * @return UserRewardView */ public List<RewardMaster> getRewardMaster(); /** * 获取成就详情 * @param int * @return UserRewardView */ public List<RewardConfig> getRewardConfig(); /** * 获取成就列表 * @param int * @return UserRewardView */ public List<UserAchievementHistory> userAchievementHistoryList(@Param("userId")int userId); /** * 查询当日成就 * @param UserMagic * @return */ public int selectCurrentAchievements(@Param("userId")int userId); /** * 查询其他成就 * @param UserMagic * @return */ public int selectOtherAchievements(@Param("userId")int userId); /** * 获取成就信息 * @param int * @return UserAchievementHistory */ public UserAchievementHistory selectUserAchievementHistory( UserAchievementHistory uarh); /** * 插入用户成就(有关money) * @param user * @return */ public void inserUserRewardHis(UserRewardHis rhis); /** * 查询用户成就状态 * @param user * @return */ public UserRewardStatus selectRewardStatus(int userId); /** * 插入用户成就状态 * @param user * @return */ public void insertRewardStatus(UserRewardStatus urs); /** * 更新用户成就状态 * @param user * @return */ public void updateRewardStatus(UserRewardStatus urs); /** * 获取用户可以获取的奖励 * @return */ public RewardConfig queryUserReward(@Param("category")int category, @Param("rewardType")int rewardType); /** * 根据类型获取奖励信息 * @param type * @return */ public RewardMaster getRewardMasterByType(@Param("type")int type); /** * 根据ID获取奖励配置信息 * @param id * @return */ public RewardConfig getRewardConfigById(@Param("id")int id); /** * 查询本月登陆天数 * @param userId * @param minMonthDate * @param nextMinMonthDate * @return int */ public int queryCurrMonthLoginSum(@Param("userId")int userId, @Param("type")int type, @Param("minMonthDate")String minMonthDate, @Param("nextMinMonthDate")String nextMinMonthDate); }
[ "liliang2005@gmail.com" ]
liliang2005@gmail.com
55a1751a0fd68d9ffe58d12c2cb50b11659949e5
cb9398f30e5fd05ec376f45f943af4ed6447506c
/src/com/kk/rainbow/core/json/ResponseUtil.java
0da7fde19e0fcddc57b655735a6fc919830e759e
[]
no_license
kkchengxin/kkTry
e1372270f5b270e9859c7b9668ee3edf27a27dae
9da54c578e8ad61b1bb240be89b67df82cad2321
refs/heads/master
2020-06-12T04:55:01.367470
2017-04-10T10:56:32
2017-04-10T10:56:32
75,604,739
0
0
null
null
null
null
UTF-8
Java
false
false
2,983
java
package com.kk.rainbow.core.json; import org.codehaus.jackson.JsonNode; import com.kk.rainbow.core.exception.RException; import com.kk.rainbow.core.mybatis3.Page; public class ResponseUtil { public static final boolean isSuccess(JsonNode paramJsonNode) throws RException { if (paramJsonNode == null) return false; int i = getCode(paramJsonNode); return i > 0; } public static final int getCode(JsonNode paramJsonNode) throws RException { if (paramJsonNode == null) return -1000; JsonNode localJsonNode = paramJsonNode.get(JSONKeys.CODE.getValue()); if (localJsonNode == null) throw new RException("-1", "缺少节点:" + JSONKeys.CODE.getValue()); return Integer.parseInt(localJsonNode.getTextValue()); } public static final String getDesc(JsonNode paramJsonNode) throws RException { if (paramJsonNode == null) return null; JsonNode localJsonNode = paramJsonNode.get(JSONKeys.DESC.getValue()); if (localJsonNode == null) throw new RException("-1", "缺少节点:" + JSONKeys.DESC.getValue()); return localJsonNode.getTextValue(); } public static final JsonNode getData(JsonNode paramJsonNode) throws RException { if (paramJsonNode == null) return null; JsonNode localJsonNode = paramJsonNode.get(JSONKeys.DATA.getValue()); if (localJsonNode == null) throw new RException("-1", "缺少节点:" + JSONKeys.DATA.getValue()); return localJsonNode; } public static final Page getPage(JsonNode paramJsonNode) throws RException { if (paramJsonNode == null) return null; JsonNode localJsonNode1 = getData(paramJsonNode); if (localJsonNode1 == null) return null; JsonNode localJsonNode2 = localJsonNode1.get(JSONKeys.PAGE.getValue()); return (Page)JSONUtils.toObject(localJsonNode2, Page.class); } public static final <T> T getArray(JsonNode paramJsonNode, Class<T> paramClass) throws RException { if (paramJsonNode == null) return null; JsonNode localJsonNode1 = getData(paramJsonNode); if (localJsonNode1 == null) return null; JsonNode localJsonNode2 = localJsonNode1.get(JSONKeys.LIST.getValue()); return JSONUtils.toObject(localJsonNode2, paramClass); } public static final <T> T getData(JsonNode paramJsonNode, Class<T> paramClass) throws RException { if (paramJsonNode == null) return null; JsonNode localJsonNode = getData(paramJsonNode); return JSONUtils.toObject(localJsonNode, paramClass); } public static final <T> T getObject(JsonNode paramJsonNode, String paramString, Class<T> paramClass) throws RException { if ((paramJsonNode == null) || (paramString == null)) return null; JsonNode localJsonNode = paramJsonNode.get(paramString); if (localJsonNode == null) throw new RException("-1", "缺少节点:" + paramString); return JSONUtils.toObject(localJsonNode, paramClass); } }
[ "0_zero_00@sina.com" ]
0_zero_00@sina.com
410f3c417b8622846b9b189e63593c7715820a8b
df19c607ee6456b52595ea0110014defa8d2411a
/src/com/example/mynas/Connect.java
73a17490312ac2c7cedf9b8291e8d46daeba66a4
[]
no_license
mac9k/MyNAS
25fd16209bb04124375e3dbea2c00442726be870
b0b44a6127080283df59bf052e21a384c8a21c9f
refs/heads/master
2016-09-13T21:54:19.421466
2016-05-23T00:44:56
2016-05-23T00:44:56
59,290,079
0
0
null
null
null
null
UHC
Java
false
false
6,019
java
package com.example.mynas; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.Serializable; import java.util.ArrayList; import org.apache.commons.net.ftp.FTP; import org.apache.commons.net.ftp.FTPClient; import org.apache.commons.net.ftp.FTPFile; import org.apache.commons.net.ftp.FTPReply; import android.util.Log; public class Connect implements Serializable{ private static final long serialVersionUID=-1231252353; // Class Serial ID private final static String TAG = "In_Connect"; private static final int Directory = 1; private static final int Existing = 2; private static final int Success = 3; public static String FtpCurrent, deviceCurrent; public static FTPClient mFTPClient = null; public static final int progress_bar_type = 0 ; private ArrayList<String> arFiles; public String mRoot,fullPath,fileName; public boolean ftpConnect(String host, String username,String password, int port){ try { mFTPClient = new FTPClient(); //FTP Client 객체 생성 mFTPClient.connect(host,port); //서버 접속 mFTPClient.enterLocalPassiveMode();//FTP를 Passive mode 로 접속 if (FTPReply.isPositiveCompletion(mFTPClient.getReplyCode())) { //응답코드가 정상이면 수행 boolean status = mFTPClient.login(username, password); // 사용자 인증 mFTPClient.setControlEncoding("UTF-8"); mFTPClient.setAutodetectUTF8(true); mFTPClient.setFileType(FTP.BINARY_FILE_TYPE);// 파일 형태 설정 FtpCurrent = ftpGetCurrentWorkingDirectory(); // 접속 주소 리턴 mFTPClient.setBufferSize(1024*1024); // 버퍼사이즈 mFTPClient.setSoTimeout(10000); // 커넥션 타임아웃 mRoot= FtpCurrent; return status; } } catch(Exception e) { Log.d(TAG, "Error: ftpConnect() " ); e.printStackTrace(); } return false; } public static boolean ftpDisconnect(){ try { mFTPClient.logout(); // 로그아웃 mFTPClient.disconnect(); //접속종료 return true; } catch (Exception e) { Log.d(TAG, "Error : ftpDisconnect()"); e.printStackTrace(); } return false; } public static String ftpGetCurrentWorkingDirectory(){ try { String workingDir = mFTPClient.printWorkingDirectory(); //현 위치 디렉토리 리턴 return workingDir; } catch(Exception e) { Log.d(TAG, "Error : ftpGetCurrentWorkingDirectory()"); } return null; } public static boolean ftpChangeDirectory(String directory_path){ try { mFTPClient.changeWorkingDirectory(directory_path); // 디렉토리 간 이동 } catch(Exception e) { Log.d(TAG, "Error: ftpChangeDirectory()"); e.printStackTrace(); } return true; } public boolean ftpRemoveFile(String filePath){ try { boolean status = mFTPClient.deleteFile(filePath); // 파일 삭제 return status; } catch (Exception e) { e.printStackTrace(); } return false; } public static int ftpDownload(String srcFilePath, String desFileName, String desFilePath) { int status = Success; try { File dCurrent = new File(desFilePath); // 디렉토리 객체 생성 String[] deviceFiles = dCurrent.list(); // 현 디렉토리 파일 목록들 리턴 int length = deviceFiles.length; boolean isRepeated = false; for(int i = 0 ; i < length; i++){ // 중복 체크 String name = deviceFiles[i]; if(name.contains(desFileName) && !isRepeated){ isRepeated = true; status = Existing; break; } } if(!isRepeated){ // 중복되지 않는다면 파일 지정한 경로에 파일 다운로드 시작 FileOutputStream desFileStream = new FileOutputStream( desFilePath+"/"+desFileName); mFTPClient.retrieveFile(srcFilePath, desFileStream); desFileStream.close(); }else Log.d(TAG,"Error : File is existed"); return status; } catch (IOException e) { Log.d(TAG, "Error : ftpDownload()"); e.printStackTrace(); } return Directory; } public int ftpUpload(String srcFilePath, String desFileName,String desDirectory){ int status = Success; try { String[] ftpFiles = mFTPClient.listNames(desDirectory); // 디렉토리 객체 생성 int length = ftpFiles.length; boolean isRepeated = false; for (int i = 0; i < length; i++) { // 중복체크 String name = ftpFiles[i]; if (name.contains(desFileName) && !isRepeated){ isRepeated = true; status = Existing; break; } } if (ftpChangeDirectory(desDirectory)&& !isRepeated){ //중복되지 않고 해당 경로로 이동가능하면 다운로드 시작 FileInputStream srcFileStream = new FileInputStream(srcFilePath); mFTPClient.storeFile(desFileName, srcFileStream); srcFileStream.close(); } mFTPClient.changeWorkingDirectory(mRoot); // 업로드를 위해 움직인 경로를 처음 접속 경로로 변경 (변경을 안할시엔 list 가 null을 리턴함) return status; } catch (Exception e) { Log.d(TAG, "Error : ftpUpload()"); e.printStackTrace(); } return status; } public boolean ftpTempDownload(String srcFilePath, String desFilePath){ boolean status = false; try { FileOutputStream desFileStream = new FileOutputStream(desFilePath); status = mFTPClient.retrieveFile(srcFilePath, desFileStream); //지정 경로 다운 시작 desFileStream.close(); return status; } catch (Exception e) { Log.d(TAG, "Error : ftpTempDownlad()"); } return status; } }
[ "lkhmack@hotmail.com" ]
lkhmack@hotmail.com
0d8ead3e61c4b43eca34d6962822d83f4bdd20d7
3d821a43c16264cb2e3730e6236b4058df41ac63
/simple-junitintegration-module/src/test/java/com/hung/experiment/params/domainUsers/DomainUserFileParamIntegrationTest.java
97b724541082abf5660f72e1ae3c694b443dd8f3
[]
no_license
ht02135/ht02135
e905ca723555bb6322c3b35ee239aec0c3fe6386
fb3174eb831e0256cf3a8300fb02a15e84d28e6d
refs/heads/master
2020-04-05T19:33:50.371011
2012-11-28T18:54:29
2012-11-28T18:54:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,329
java
package com.hung.experiment.params.domainUsers; import java.util.Collection; import org.apache.log4j.Logger; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; import com.hung.utils.parameters.domainUsers.DomainUserParameters; @RunWith(Parameterized.class) public class DomainUserFileParamIntegrationTest { private static Logger log = Logger.getLogger(DomainUserFileParamIntegrationTest.class); private String loginId; private String name; private String domainName; public DomainUserFileParamIntegrationTest(String loginId, String name, String domainName) { this.loginId = loginId; this.name = name; this.domainName = domainName; } @Parameters public static Collection data() { return DomainUserParameters.NEW_DOMAIN_USERS_FILE_DATA; } @Before public void setUp() { } @Test public void testData() { log.info("########## testData : start ##########"); log.info("loginId="+loginId); log.info("name="+name); log.info("domainName="+domainName); log.info("########## testData : end ##########"); } }
[ "ht02135@yahoo.com" ]
ht02135@yahoo.com
f9c5ea8963f6988837458edcf0d83c7ef642f88a
1115ab0952fb90e1da862cabbab2c18a67296267
/ALifeJetpack/src/main/java/me/peace/jetpack/lifecycle/BuryingPoint.java
1fc95b04902ccb00aba7937974d9e355d0cb7e26
[]
no_license
peace710/AJLife
83ef84e5af267bdf9e897d7043f707200e29f486
f7f421a41e1ff78a4a0eba3dface954f6a454dc2
refs/heads/master
2022-06-23T09:32:42.994732
2022-06-15T16:42:17
2022-06-15T16:42:17
247,745,404
2
0
null
null
null
null
UTF-8
Java
false
false
957
java
package me.peace.jetpack.lifecycle; import android.util.Log; public class BuryingPoint implements Command { public static BuryingPoint get(){ return BuryingPointHolder.instance; } private BuryingPoint() { } private static class BuryingPointHolder{ private static BuryingPoint instance = new BuryingPoint(); } private BuryingPointCommand command; public void init(){ command = new BuryingPointCommand(); } public void destroy(){ command = null; } @Override public void markLifecycle(String life) { if (command != null){ command.markLifecycle(life); } } class BuryingPointCommand implements Command{ private static final String TAG = "BuryingPointCommand"; @Override public void markLifecycle(String life) { Log.d(TAG, "markLifecycle() called with: life = [" + life + "]"); } } }
[ "nothingsuper@163.com" ]
nothingsuper@163.com
5ed940ae14d8f430ec0b9b3c0690c9b05d9de395
628de1aa2d2d5d960f949b6868b03a427721a482
/src/main/java/com/canzs/czs/pojo/vo/ApiResult.java
cbaf683af066ed87a6c977f8c1741f37b80da41e
[]
no_license
xiwc/czs
402197e4cda814b95176221319da88d044978341
288ee97253adf4ba22724d6df85887d8f2d913fa
refs/heads/master
2016-09-05T09:40:02.021254
2014-07-15T11:16:48
2014-07-15T11:16:48
19,299,966
0
0
null
null
null
null
UTF-8
Java
false
false
3,289
java
/** * ApiResult.java */ package com.canzs.czs.pojo.vo; import java.io.Serializable; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.canzs.czs.util.StringUtil; /** * 对调用zabbix api返回结果的封装. * * @creation 2013-10-15 上午11:44:31 * @modification 2013-10-15 上午11:44:31 * @company Canzs * @author xiweicheng * @version 1.0 * */ public class ApiResult implements Serializable { /** serialVersionUID [long] */ private static final long serialVersionUID = 8896678889526483526L; public static final String RESULT = "result"; public static final String ERROR = "error"; public static final String MESSAGE = "message"; public static final String DATA = "data"; public static final String EMPTY = ""; private String message; private JSONObject jsonObject; private boolean succeed; private Object extraData; public ApiResult() { } public ApiResult(JSONObject jsonObject) { this.jsonObject = jsonObject; this.succeed = this.jsonObject.containsKey(RESULT); if (!succeed) { setMessage(getErrorData()); } } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } public Object getExtraData() { return extraData; } public void setExtraData(Object extraData) { this.extraData = extraData; } public JSONObject getJsonObject() { return jsonObject; } public boolean succeed() { return succeed; } public boolean failed() { return !succeed; } public void setSucceed(boolean succeed) { this.succeed = succeed; } public JSONObject getJSONObjectResult() { return jsonObject.getJSONObject(RESULT); } public JSONArray getJSONArrayResult() { return jsonObject.getJSONArray(RESULT); } public boolean getBooleanResult() { return jsonObject.getBooleanValue(RESULT); } public String getStringResult() { return jsonObject.getString(RESULT); } public int getIntResult() { return jsonObject.getIntValue(RESULT); } public double getDoubleResult() { return jsonObject.getDoubleValue(RESULT); } public long getLongResult() { return jsonObject.getLongValue(RESULT); } public JSONObject getError() { JSONObject error = jsonObject.getJSONObject(ERROR); return error == null ? new JSONObject() : error; } public String getErrorMsg() { return succeed ? EMPTY : StringUtil.toString(getError().get(MESSAGE)); } public String getErrorData() { return succeed ? EMPTY : StringUtil.toString(getError().get(DATA)); } public String getIdResult(String idName) { String[] idArrResult = getIdArrResult(idName); if (idArrResult != null && idArrResult.length > 0) { return idArrResult[0]; } return null; } public String[] getIdArrResult(String idName) { if (succeed() && getJSONObjectResult() != null && getJSONObjectResult().getJSONArray(idName) != null) { JSONArray jsonArr = getJSONObjectResult().getJSONArray(idName); String[] arr = new String[jsonArr.size()]; for (int i = 0; i < jsonArr.size(); i++) { arr[i] = jsonArr.getString(i); } return arr; } return null; } @Override public String toString() { return "ApiResult [succeed=" + succeed + ", jsonObject=" + jsonObject + ", extraData=" + extraData + "]"; } }
[ "xiweicheng@yeah.net" ]
xiweicheng@yeah.net
af883b70c9df739b0fd1a0bf2ed438ca055a2754
e1c12b0ea06c11be6e36b65fd8449117424f6821
/src/main/java/dev/dmhdevelopment/modernindustrialization/items/dust/SodiumDust.java
f0a033b085185c4d6020ae227b230c83472b0a07
[]
no_license
DMHDevelopment/Modern-Industrialization
53e847e2a93e25f913fbcf5e7a3172f8290363cb
f612d28c76163e2298cb94700db7bd1395cfb640
refs/heads/forge-rewrite-1.15.x
2023-01-04T19:52:32.850247
2020-11-06T07:05:11
2020-11-06T07:05:11
298,826,765
1
1
null
2020-09-30T18:27:41
2020-09-26T14:04:52
null
UTF-8
Java
false
false
376
java
package dev.dmhdevelopment.modernindustrialization.items.dust; import dev.dmhdevelopment.modernindustrialization.utils.ModernIndustrializationCreativeTab; import net.minecraft.item.Item; public class SodiumDust extends Item{ public SodiumDust() { super(new Item.Properties().group(ModernIndustrializationCreativeTab.ModernIndustrializationCreativeTab)); } }
[ "belicdima9@gmail.com" ]
belicdima9@gmail.com
7d6f0e711a8054e646e45fa216c3d155a62478df
5b1fd2ed6958c08e3d43d5aa6e5f9088e764c159
/src/main/java/laboratorio/ITree.java
96a39a3be082a913904b0e03926467dcbd2fa68c
[]
no_license
Pablo1634/AS1_LAB3
90b4eed3b55bf8a4ef027ff69e2e7970fa2951c6
8d85ec1d281e48f87bb48e5caaad79262a8fb55e
refs/heads/main
2023-04-24T00:39:09.992009
2021-05-12T06:21:30
2021-05-12T06:21:30
366,577,780
0
0
null
null
null
null
UTF-8
Java
false
false
133
java
package laboratorio; import java.util.*; /** * */ public interface ITree { /** * */ public void place(); }
[ "raularroyave163@icloud.com" ]
raularroyave163@icloud.com
dd8763ca2d6de375f7939d0a731db0d7ef66627c
0136bdbcba620caae2ede8668f05c038afd8807f
/basic/src/com/algorithm/a_sort/SelectSort.java
620a0a658529346bd277c0c9cfee4e680838eea5
[]
no_license
dh37789/basic
40c7ae83fdb20d2763b7ebf55f9f247e87fd448f
b9b84db0e832ae0dd4d0d9c1ed5bf2259dbefc38
refs/heads/master
2023-08-31T01:27:12.497153
2023-08-20T07:12:22
2023-08-20T07:12:22
199,305,523
2
0
null
null
null
null
UTF-8
Java
false
false
724
java
package com.algorithm.a_sort; public class SelectSort { public static void main(String[] args) { int[] arr = {9, 2, 10, 6, 3, 4, 1, 8, 7, 5}; System.out.println("Before : "); for (int i : arr) { System.out.print(i + " "); } System.out.println(); selectSort(arr); System.out.println("After : "); for (int i : arr) { System.out.print(i + " "); } } private static void selectSort(int[] arr) { for (int i = 0; i < arr.length; i++) { int tmp = i; int tmp2; for (int j = i; j < arr.length; j++) { if (arr[tmp] > arr[j]) { tmp = j; } } tmp2 = arr[i]; arr[i] = arr[tmp]; arr[tmp] = tmp2; } } }
[ "dhaudgkr@gmail.com" ]
dhaudgkr@gmail.com
346b337d0c8db9dc7b7b0428b89336e8849b97fc
5732bb8a0fe586182c6c769a6cf62c091832c82f
/app/src/main/java/edu/ritindia/aman_magdum/OOPS7.java
e8eeed5a5e710aa5b75c86c3a7c4d0bb3e444173
[]
no_license
amanmagdum77/Last-Minute-Notes-complete-source-code
bbccab9849feaa77bcac940d4bdc04cc03a96fa2
330cab282877880a1cdba0c2fade18752e985f2c
refs/heads/master
2023-04-14T13:35:54.910343
2021-04-20T05:43:04
2021-04-20T05:43:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
662
java
package edu.ritindia.aman_magdum; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.webkit.WebSettings; import android.webkit.WebView; import com.example.java.R; public class OOPS7 extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_o_o_p_s7); WebView myWebView = (WebView)findViewById(R.id.oops7); WebSettings webSettings= myWebView.getSettings(); webSettings.setJavaScriptEnabled(true); myWebView.loadUrl("file:///android_asset/oops7.html"); } }
[ "amanmagdum77@gmail.com" ]
amanmagdum77@gmail.com
2e492e9d664f3222e3bb68e2ebb93a6d10993e58
0260b7def05fdcc3c839f839282784c7a4d61853
/src/main/java/io/github/cavvar/orderservice/model/Customer.java
283c84c27615fdf508e147bce4fa1b641af79118
[]
no_license
Cavvar/Order-Service-Imperative
37672ced82b37a676224516c9f785af34749d473
4c31346024bb8893d97750888e7bc5d3a2cfb5cf
refs/heads/main
2023-05-24T10:10:25.187992
2021-06-07T21:18:01
2021-06-07T21:18:01
368,170,248
0
0
null
2021-06-01T11:53:33
2021-05-17T12:03:52
Java
UTF-8
Java
false
false
479
java
package io.github.cavvar.orderservice.model; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; @Data @NoArgsConstructor @AllArgsConstructor @Entity(name = "customers") public class Customer { @Id @Column(name = "customer_id") private int id; private String firstName; private String lastName; private String userName; }
[ "d.angelett@hm.edu" ]
d.angelett@hm.edu
5475bda7eb791f4677bd64562a6a7227156f40dd
69d2268a2c24172ae789bb92b73d7e185102698e
/U1_ColorPicker/src/ColorPicker/Sliders/Sliders.java
c957b6fe226a8a8bf7cc9281f038443f3f4758df
[]
no_license
riscie/DEPA_HS2016
76f7a619a397d8c33b0789dab59064b66906316c
2ccb5cc745ed91d4f8d603b745c558123a1a7f77
refs/heads/master
2021-01-12T13:44:00.254038
2016-11-01T14:38:37
2016-11-01T14:38:37
69,157,064
0
0
null
null
null
null
UTF-8
Java
false
false
2,233
java
package ColorPicker.Sliders; import ColorPicker.ColorModel; import ColorPicker.Observer; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.scene.control.Slider; import javafx.scene.control.TextField; import javafx.scene.layout.VBox; import java.io.IOException; public class Sliders extends VBox implements Observer { private ColorModel colorModel; //Red @FXML private Slider r; @FXML private TextField rDec; @FXML private TextField rHex; //Green @FXML private Slider g; @FXML private TextField gDec; @FXML private TextField gHex; //Blue @FXML private Slider b; @FXML private TextField bDec; @FXML private TextField bHex; public Sliders(final ColorModel colorModel) { this.colorModel = colorModel; colorModel.registerObserver(this); FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("sliders.fxml")); fxmlLoader.setRoot(this); fxmlLoader.setController(this); try { fxmlLoader.load(); } catch (IOException exception) { throw new RuntimeException(exception); } // Listen for red value changes r.valueProperty().addListener((observable, oldValue, newValue) -> colorModel.updateRed(newValue.intValue())); // Listen for red value changes g.valueProperty().addListener((observable, oldValue, newValue) -> colorModel.updateGreen(newValue.intValue())); // Listen for red value changes b.valueProperty().addListener((observable, oldValue, newValue) -> colorModel.updateBlue(newValue.intValue())); } @Override public void update(int r, int g, int b) { //Sliders this.r.setValue(r); this.g.setValue(g); this.b.setValue(b); //Decimal Values rDec.setText(String.valueOf(r)); gDec.setText(String.valueOf(g)); bDec.setText(String.valueOf(b)); //Hex Values rHex.setText(intToHexString(r)); gHex.setText(intToHexString(g)); bHex.setText(intToHexString(b)); } private static String intToHexString(int n) { return "0x"+Integer.toHexString(n); } }
[ "matthias.langhard@ecologic.ch" ]
matthias.langhard@ecologic.ch
c9e60f8e865e4e44174482c23f7e4622d45f858b
b47c030bdda525570baea329719dd392eb037e22
/src/Models/java/bidProc.java
591a0164a2394b8e781b5f7560d8548bb5586ebb
[]
no_license
BrokenMental/Fork-DEVS_Simulation_Study
02047255bc2e92bbc9b4027913f6a0a0088b5a1b
07d7cfa2855acd4cda77fb3a3193421a2e155516
refs/heads/master
2022-05-01T18:36:07.151465
2012-12-12T15:45:47
2012-12-12T15:45:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,484
java
package Models.java; import genDevs.modeling.*; import genDevs.simulation.*; import java.util.*; import GenCol.*; import simView.*; import java.awt.*; public class bidProc extends ViewableAtomic{ double Infinity = INFINITY; public bidProc(){ this("bidProc");} public bidProc(String nm){ super(nm); addInport("inJob"); addTestInput("inJob",new entity()); addTestInput("inJob",new entity(),1); addInport("infree?"); addTestInput("infree?",new entity()); addTestInput("infree?",new entity(),1); addOutport("outJobDone"); addOutport("outBid"); } public void initialize(){ passivate(); } public void deltint(){ if(phaseIs("busy")){ passivate(); } else if(phaseIs("bid")){ passivate(); } else if(phaseIs("passive")){ passivate(); } else passivate(); } public void deltext(double e, message x){ Continue(e); for(int i=0; i<x.getLength(); i++){ if(this.messageOnPort(x, "inJob", i)){ if(phaseIs("passive" )){ processbusy(); holdIn("busy",5.0); } } if(this.messageOnPort(x, "infree?", i)){ if(phaseIs("passive" )){ processbid(); holdIn("bid",0.1); } } } } public void processbusy(){ System.out.println("Processing: busy()"); } public void processbid(){ System.out.println("Processing: bid()"); } public message out(){ message m = new message(); if(phaseIs("bid")){ m.add(makeContent("outBid",new entity("Bid"))); } if(phaseIs("busy")){ m.add(makeContent("outJobDone",new entity("JobDone"))); } return m; } }
[ "jphilli85@gmail.com" ]
jphilli85@gmail.com
c1aee0da738e51f894a248e05068da8af5ab502f
f414bbf19b24be9d238fba53bd59dd725865c0d7
/webserver/src/main/java/com/iodice/webserver/http/response/PageRankNotFoundResponse.java
540f50b8e0a9a82dd4187f197f0b25fcfbb18d5a
[]
no_license
nmiodice/domain-trustworthiness
accd5dbf80e5689bbfc5accf299af2461c92448c
eb02b4d29bed8cc5b562f273b13b8008d559c142
refs/heads/master
2021-01-20T11:47:56.366561
2017-09-04T13:02:39
2017-09-04T13:02:39
83,571,533
1
0
null
null
null
null
UTF-8
Java
false
false
463
java
package com.iodice.webserver.http.response; import io.undertow.util.StatusCodes; import lombok.ToString; @ToString public class PageRankNotFoundResponse extends PageRankResponse { public PageRankNotFoundResponse(String domain) { responseMap.put(ERROR_KEY, "page rank not found"); responseMap.put(CAUSE_KEY, "no page rank for " + domain); } @Override public int getHTTPStatusCode() { return StatusCodes.NOT_FOUND; } }
[ "nickio@amazon.com" ]
nickio@amazon.com
0362e1eb8ea7abb860492fd28ecbd94296d6d602
550ca505ed8ef14d389cdabfe0b0ab564117f27e
/src/com/valens/base/doc/Doc.java
a5f35f01025e78d592fc6a4459cb97d9941a454b
[]
no_license
valens77/valens
ffdfaddaca00c2c8788cba69c04026c177677626
df7df278208e561c64b3227029f183d1a324fc78
refs/heads/master
2021-01-23T05:18:53.881610
2017-08-25T07:41:31
2017-08-25T07:41:31
86,295,652
0
0
null
null
null
null
UTF-8
Java
false
false
2,097
java
/** * */ package com.valens.base.doc; /** * @Description TODO * @author Huangxiaohua * @CreateDate 2017-3-27 * @updater * @updateDate * @remark * @version v1.0 */ public class Doc { /**myeclipse 设置注释 * Window --> Java --> Code Style --> CodeTemplates --> Comments --> (types类,method方法) --> Edit * */ //types /** * @Description ${todo} * @author Huangxiaohua * @CreateDate ${date} * @updater * @updateDate * @remark * ${tags} * @version v1.0 */ //method /** @Description ${todo} * ${tags} ${return_type} * @author Huangxiaohua * @CreateDate ${date} */ //类型(Types)注释标签(类的注释): /** * @ClassName: ${type_name} * @Description: ${todo}(这里用一句话描述这个类的作用) * @author A18ccms a18ccms_gmail_com * @date ${date} ${time} * ${tags} */ // or /** * ProjectName:${project_name} * ClassName:${type_name} * Description: * @Copyright: * @Company: * @author:${user} * @version * Create Date:${date} ${time} */ //字段(Fields)注释标签: /** * @Fields ${field} : ${todo}(用一句话描述这个变量表示什么) */ //构造函数标签: /** * <p>Title: </p> * <p>Description: </p> * ${tags} */ //方法(Constructor & Methods)标签: /** * @Title : ${enclosing_method} * @Description: ${todo} * ${tags} : ${return_type} * @author :xingchen * Create Date : ${date} ${time} * @throws */ //覆盖方法(OverridingMethods)标签: /* (非 Javadoc) * <p>Title:${enclosing_method}</p> * <p>Description: </p> * ${tags} * ${see_to_overridden} */ //代表方法(DelegateMethods)标签: /** * ${tags} * ${see_to_target} */ //getter方法标签: /** * @return ${bare_field_name} */ //setter方法标签: /** * @param ${param} 要设置的 ${bare_field_name} */ }
[ "yuanlian14@163.com" ]
yuanlian14@163.com
0221128d2c62ab6ae1dd0275a0ffb761a43a0876
9da364fbc6465b57676cb3b04fdfa89b0817abd6
/app/src/main/java/id/sch/smktelkom_mlg/privateassignment/xirpl525/moviehd/DatabaseHelper.java
a1091933ca2ac94d4de6dcd54bee0aa886f96286
[]
no_license
pradanadike/MovieHD
f0cb0c9ca9568c971e67ea9826146b0dd592f565
854aac3c8dcea7f68d7fc8b4e888576873b7503f
refs/heads/master
2020-12-30T14:19:58.868395
2017-06-13T06:01:36
2017-06-13T06:01:36
91,310,627
0
0
null
null
null
null
UTF-8
Java
false
false
2,458
java
package id.sch.smktelkom_mlg.privateassignment.xirpl525.moviehd; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.util.Log; /** * Created by PC on 6/13/2017. */ public class DatabaseHelper extends SQLiteOpenHelper { public static int DATABASE_VERSION = 1; public static String DATABASE_NAME = "db_movie"; public static String TABLE_NAME = "tb_saved"; public static String KEY1 = "id_saved"; public static String KEY2 = "title"; public static String KEY3 = "desc"; private String TAG = "~DatabaseHelper"; public DatabaseHelper(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); } @Override public void onCreate(SQLiteDatabase db) { Log.d(TAG, "Creating table " + TABLE_NAME); // String CREATE_TABLE = "CREATE TABLE " + TABLE_NAME // + "(" + KEY1 + " INTEGER PRIMARY KEY," // + KEY2 + " VARCHAR(70)," // + KEY3 + " VARCHAR(200)," // + KEY4 + " TEXT" + ")"; String CREATE_TABLE = "CREATE TABLE " + TABLE_NAME + "(" + KEY1 + " INTEGER PRIMARY KEY," + KEY2 + " VARCHAR(70)," + KEY3 + " VARCHAR(200)" + ")"; db.execSQL(CREATE_TABLE); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { // on upgrade drop older tables db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME); // create new tables onCreate(db); } public boolean saveMovie(String title, String desc) { SQLiteDatabase db = this.getWritableDatabase(); ContentValues contentValues = new ContentValues(); contentValues.put(KEY2, title); contentValues.put(KEY3, desc); // contentValues.put(KEY4, banner); long result = db.insert(TABLE_NAME, null, contentValues); if (result == -1) { Log.d(TAG, "Insert failed"); return false; } else { Log.d(TAG, "Insert successfull"); return true; } } public Cursor getAllMovie() { SQLiteDatabase db = this.getWritableDatabase(); String query = "SELECT * FROM " + TABLE_NAME; Cursor data = db.rawQuery(query, null); return data; } }
[ "pradanadike5@gmail.com" ]
pradanadike5@gmail.com
bf68cd792aa9f59ceadd0b5547a0fafe805e83bc
0821b16cbb19a3a362677809c8cb6e0eada9f1c2
/ex02/src/main/src/main/java/org/zerock/persistence/ReplyDaoImpl.java
b97b99fc875d12e6747da04ef9635e6b7565067d
[]
no_license
automind/atmind
2f29473c3bbf0770c273258493f34163c4a08cc5
c4c3f9223f09393952705f3ce286bf508f3dadad
refs/heads/master
2021-01-21T20:30:00.618706
2017-06-05T05:34:32
2017-06-05T05:34:32
92,243,397
0
0
null
null
null
null
UTF-8
Java
false
false
1,334
java
package org.zerock.persistence; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.inject.Inject; import org.apache.ibatis.session.SqlSession; import org.springframework.stereotype.Repository; import org.zerock.domain.Criteria; import org.zerock.domain.ReplyDto; @Repository public class ReplyDaoImpl implements ReplyDao{ @Inject private SqlSession session; private String ns = "org.zerock.mapper.ReplyMapper"; @Override public List<ReplyDto> list(int bno) throws Exception { return session.selectList(ns + ".list", bno); } @Override public void create(ReplyDto rDto) throws Exception { session.insert(ns + ".create", rDto); } @Override public void update(ReplyDto rDto) throws Exception { session.update(ns + ".update", rDto); } @Override public void delete(Integer rno) throws Exception { session.delete(ns + ".delete", rno); } @Override public List<ReplyDto> listPage(Integer bno, Criteria cri) throws Exception { Map<String, Object> paramMap = new HashMap<>(); paramMap.put("bno", bno); paramMap.put("cri", cri); return session.selectList(ns + ".listPage", paramMap); } @Override public int count(Integer bno) throws Exception { return session.selectOne(ns + ".count", bno); } }
[ "hong@302-02PC" ]
hong@302-02PC
06139db2e8ca15d80a5fb113dd6cda2c38ecbb2d
d4dd7c62d14ad6f70110b73cdefe29c65fcab2e2
/easyLoader/src/main/java/site/hanschen/easyloader/util/CloseUtils.java
294b4b63e47a3c1eaed0ea84588729391b46aa11
[ "Apache-2.0" ]
permissive
hanschencoder/EasyLoader
58c5a8d86734decff931ca3fd661c5ebfe8c2ece
3797f3d38db9b77262ffbab64cc8e582f5a07da1
refs/heads/master
2022-05-12T07:54:16.473272
2017-04-12T02:00:04
2017-04-12T02:00:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
930
java
/* * Copyright 2016 Hans Chen * * 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 site.hanschen.easyloader.util; import java.io.Closeable; import java.io.IOException; public class CloseUtils { public static void close(Closeable closeable) { if (closeable != null) { try { closeable.close(); } catch (IOException ignored) { } } } }
[ "shensky711@qq.com" ]
shensky711@qq.com
147eb063ef355d5a17c83e74e20b4e16f3dfbd60
ca4787335cc325827d41e493e6912980a3cae82c
/server/src/main/java/password/pwm/util/cli/commands/ImportResponsesCommand.java
fdd3da97bf4bdeba9f52e4863f3528bdf1a54e42
[ "Apache-2.0" ]
permissive
duttonw/pwm-project
7e94e820d938e5ae51e61fe070121765a3ac5db8
9aa9ad199029e4b033d3be98a45ac08f3c22978e
refs/heads/master
2023-01-23T05:51:11.717608
2021-11-16T22:16:16
2021-11-16T22:16:16
53,453,307
0
0
NOASSERTION
2023-01-08T03:25:48
2016-03-08T23:42:11
Java
UTF-8
Java
false
false
5,982
java
/* * Password Management Servlets (PWM) * http://www.pwm-project.org * * Copyright (c) 2006-2009 Novell, Inc. * Copyright (c) 2009-2021 The PWM Project * * 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 password.pwm.util.cli.commands; import com.novell.ldapchai.ChaiUser; import com.novell.ldapchai.cr.ChallengeSet; import password.pwm.PwmApplication; import password.pwm.PwmDomain; import password.pwm.PwmConstants; import password.pwm.bean.DomainID; import password.pwm.bean.ResponseInfoBean; import password.pwm.bean.SessionLabel; import password.pwm.bean.UserIdentity; import password.pwm.config.profile.ChallengeProfile; import password.pwm.config.profile.PwmPasswordPolicy; import password.pwm.error.PwmError; import password.pwm.error.PwmUnrecoverableException; import password.pwm.ldap.LdapOperationsHelper; import password.pwm.util.cli.CliParameters; import password.pwm.util.java.JsonUtil; import password.pwm.util.java.TimeDuration; import password.pwm.ws.server.rest.RestChallengesServer; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.InputStreamReader; import java.util.Collections; public class ImportResponsesCommand extends AbstractCliCommand { @Override void doCommand( ) throws Exception { final PwmApplication pwmApplication = cliEnvironment.getPwmApplication(); final File inputFile = ( File ) cliEnvironment.getOptions().get( CliParameters.REQUIRED_EXISTING_INPUT_FILE.getName() ); try ( BufferedReader reader = new BufferedReader( new InputStreamReader( new FileInputStream( inputFile ), PwmConstants.DEFAULT_CHARSET.toString() ) ) ) { out( "importing stored responses from " + inputFile.getAbsolutePath() + "...." ); int counter = 0; String line; final long startTime = System.currentTimeMillis(); while ( ( line = reader.readLine() ) != null ) { counter++; final RestChallengesServer.JsonChallengesData inputData; inputData = JsonUtil.deserialize( line, RestChallengesServer.JsonChallengesData.class ); final UserIdentity userIdentity = UserIdentity.fromDelimitedKey( SessionLabel.CLI_SESSION_LABEL, inputData.username ); final PwmDomain pwmDomain = figureDomain( userIdentity, pwmApplication ); final ChaiUser user = pwmDomain.getProxiedChaiUser( SessionLabel.CLI_SESSION_LABEL, userIdentity ); if ( user.exists() ) { out( "writing responses to user '" + user.getEntryDN() + "'" ); try { final ChallengeProfile challengeProfile = pwmDomain.getCrService().readUserChallengeProfile( null, userIdentity, user, PwmPasswordPolicy.defaultPolicy(), PwmConstants.DEFAULT_LOCALE ); final ChallengeSet challengeSet = challengeProfile.getChallengeSet() .orElseThrow( () -> new PwmUnrecoverableException( PwmError.ERROR_NO_CHALLENGES.toInfo() ) ); final String userGuid = LdapOperationsHelper.readLdapGuidValue( pwmDomain, null, userIdentity, false ); final ResponseInfoBean responseInfoBean = inputData.toResponseInfoBean( PwmConstants.DEFAULT_LOCALE, challengeSet.getIdentifier() ); pwmDomain.getCrService().writeResponses( null, userIdentity, user, userGuid, responseInfoBean ); } catch ( final Exception e ) { out( "error writing responses to user '" + user.getEntryDN() + "', error: " + e.getMessage() ); return; } } else { out( "user '" + user.getEntryDN() + "' is not a valid userDN" ); return; } } out( "output complete, " + counter + " responses imported in " + TimeDuration.fromCurrent( startTime ).asCompactString() ); } } private PwmDomain figureDomain( final UserIdentity userIdentity, final PwmApplication pwmApplication ) { if ( pwmApplication.isMultiDomain() ) { final DomainID domainID = userIdentity.getDomainID(); if ( domainID == null ) { throw new IllegalArgumentException( "user '" + userIdentity + " does not have a domain specified" ); } final PwmDomain pwmDomain = pwmApplication.domains().get( domainID ); if ( pwmDomain == null ) { throw new IllegalArgumentException( "user '" + userIdentity + " has an invalid domain specified" ); } return pwmDomain; } return pwmApplication.domains().values().iterator().next(); } @Override public CliParameters getCliParameters( ) { final CliParameters cliParameters = new CliParameters(); cliParameters.commandName = "ImportResponses"; cliParameters.description = "Import responses from file"; cliParameters.options = Collections.singletonList( CliParameters.REQUIRED_EXISTING_INPUT_FILE ); cliParameters.needsPwmApplication = true; cliParameters.readOnly = false; return cliParameters; } }
[ "jrivard@gmail.com" ]
jrivard@gmail.com
f04b2570956f86caad9df63a1d935d686f0b85a6
c4b9ff36af7353aa99ce21b4f2c46ff645232d96
/src/logintest/signup.java
e0364b4278c2a984b37529f7dcbc218111aa968b
[]
no_license
pranavlawrence/logintest
15230f060ea948836e14a94e32080a44fde89e74
819992f34bb78351358e25a6bca25224c462ef32
refs/heads/master
2020-03-31T00:39:35.357349
2018-10-12T11:10:13
2018-10-12T11:10:13
151,748,737
0
0
null
null
null
null
UTF-8
Java
false
false
3,222
java
package logintest; /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * * @author Pranav Aditya */ public class signup extends javax.swing.JFrame { /** * Creates new form signup */ public signup() { initComponents(); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 800, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 600, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(signup.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(signup.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(signup.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(signup.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new signup().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables // End of variables declaration//GEN-END:variables }
[ "pranavlawrence40@gmail.com" ]
pranavlawrence40@gmail.com
fae092fddefaf20d0cb4606b0fb931162a3d5d28
0f605130d15ab40d56db5fe433d5248fd6f1fa8b
/src/main/java/az/menagerie/entity/EntityFrog.java
bc4d4096fde023cf715ac0a188bfadfed3f31a5b
[]
no_license
Azulaloi/Menagerie
e4b2ff1d6040f862c2106cda2848725905637fb5
7c61c42064b5e3619d97c1cb08fea45bc77225b1
refs/heads/master
2021-01-22T18:06:49.959273
2017-12-11T17:59:41
2017-12-11T17:59:41
100,740,735
0
0
null
null
null
null
UTF-8
Java
false
false
9,291
java
package az.menagerie.entity; import net.minecraft.entity.EntityAgeable; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.*; import net.minecraft.entity.passive.EntityAnimal; import net.minecraft.entity.passive.EntityRabbit; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.SoundEvents; import net.minecraft.pathfinding.Path; import net.minecraft.util.DamageSource; import net.minecraft.util.SoundCategory; import net.minecraft.util.SoundEvent; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import javax.annotation.Nullable; public class EntityFrog extends EntityAnimal { private int jumpTicks; private int jumpDuration; private boolean wasOnGround; private int currentMoveTypeDuration; public EntityFrog(World worldIn) { super(worldIn); this.setSize(0.4F, 0.5F); this.jumpHelper = new EntityFrog.FrogJumpHelper(this); this.moveHelper = new EntityFrog.FrogMoveHelper(this); this.setMovementSpeed(0.0D); } protected void initEntityAI() { this.tasks.addTask(1, new EntityAISwimming(this)); this.tasks.addTask(1, new EntityFrog.AIPanic(this, 2.2D)); this.tasks.addTask(6, new EntityAIWanderAvoidWater(this, 0.6D)); this.tasks.addTask(11, new EntityAIWatchClosest(this, EntityPlayer.class, 10.0F)); } protected void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(3.0D); this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.3D); } public void onLivingUpdate() { super.onLivingUpdate(); if (this.jumpTicks != this.jumpDuration) { ++this.jumpTicks; } else if (this.jumpDuration != 0) { this.jumpTicks = 0; this.jumpDuration = 0; this.setJumping(false); } } @Nullable @Override public EntityAgeable createChild(EntityAgeable ageable) { EntityFrog frog = new EntityFrog(this.world); return frog; } protected float getJumpUpwardsMotion() { if (!this.isCollidedHorizontally && (!this.moveHelper.isUpdating() || this.moveHelper.getY() <= this.posY + 0.5D)) { Path path = this.navigator.getPath(); if (path != null && path.getCurrentPathIndex() < path.getCurrentPathLength()) { Vec3d vec3d = path.getPosition(this); if (vec3d.y > this.posY + 0.5D) { return 0.5F; } } return this.moveHelper.getSpeed() <= 0.6D ? 0.2F : 0.3F; } else { return 0.5F; } } protected void jump() { super.jump(); double d0 = this.moveHelper.getSpeed(); if (d0 > 0.0D) { double d1 = this.motionX * this.motionX + this.motionZ * this.motionZ; if (d1 < 0.010000000000000002D) { this.moveRelative(0.0F, 0.0F, 1.0F, 0.1F); } } if (!this.world.isRemote) { this.world.setEntityState(this, (byte)1); } } @SideOnly(Side.CLIENT) public float setJumpCompletion(float p_175521_1_) { return this.jumpDuration == 0 ? 0.0F : ((float)this.jumpTicks + p_175521_1_) / (float)this.jumpDuration; } public void updateAITasks() { if (this.currentMoveTypeDuration > 0) { --this.currentMoveTypeDuration; } if (this.onGround) { if (!this.wasOnGround) { this.setJumping(false); this.checkLandingDelay(); } EntityFrog.FrogJumpHelper entityrabbit$rabbitjumphelper = (EntityFrog.FrogJumpHelper)this.jumpHelper; if (!entityrabbit$rabbitjumphelper.getIsJumping()) { if (this.moveHelper.isUpdating() && this.currentMoveTypeDuration == 0) { Path path = this.navigator.getPath(); Vec3d vec3d = new Vec3d(this.moveHelper.getX(), this.moveHelper.getY(), this.moveHelper.getZ()); if (path != null && path.getCurrentPathIndex() < path.getCurrentPathLength()) { vec3d = path.getPosition(this); } this.calculateRotationYaw(vec3d.x, vec3d.z); this.startJumping(); } } else if (!entityrabbit$rabbitjumphelper.canJump()) { this.enableJumpControl(); } } this.wasOnGround = this.onGround; } private void calculateRotationYaw(double x, double z) { this.rotationYaw = (float)(MathHelper.atan2(z - this.posZ, x - this.posX) * (180D / Math.PI)) - 90.0F; } public void setMovementSpeed(double newSpeed) { this.getNavigator().setSpeed(newSpeed); this.moveHelper.setMoveTo(this.moveHelper.getX(), this.moveHelper.getY(), this.moveHelper.getZ(), newSpeed); } public void setJumping(boolean jumping) { super.setJumping(jumping); if (jumping) { this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) * 0.8F); } } public void startJumping() { this.setJumping(true); this.jumpDuration = 10; this.jumpTicks = 0; } private void checkLandingDelay() { this.updateMoveTypeDuration(); this.disableJumpControl(); } private void updateMoveTypeDuration() { if (this.moveHelper.getSpeed() < 2.2D) { this.currentMoveTypeDuration = 10; } else { this.currentMoveTypeDuration = 1; } } private void enableJumpControl() { ((EntityFrog.FrogJumpHelper)this.jumpHelper).setCanJump(true); } private void disableJumpControl() { ((EntityFrog.FrogJumpHelper)this.jumpHelper).setCanJump(false); } public class FrogJumpHelper extends EntityJumpHelper { private final EntityFrog frog; private boolean canJump; public FrogJumpHelper(EntityFrog frog) { super(frog); this.frog = frog; } public boolean getIsJumping() { return this.isJumping; } public boolean canJump() { return this.canJump; } public void setCanJump(boolean canJumpIn) { this.canJump = canJumpIn; } /** * Called to actually make the entity jump if isJumping is true. */ public void doJump() { if (this.isJumping) { this.frog.startJumping(); this.isJumping = false; } } } static class FrogMoveHelper extends EntityMoveHelper { private final EntityFrog frog; private double nextJumpSpeed; public FrogMoveHelper(EntityFrog frog) { super(frog); this.frog = frog; } public void onUpdateMoveHelper() { if (this.frog.onGround && !this.frog.isJumping && !((EntityFrog.FrogJumpHelper)this.frog.jumpHelper).getIsJumping()) { this.frog.setMovementSpeed(0.0D); } else if (this.isUpdating()) { this.frog.setMovementSpeed(this.nextJumpSpeed); } super.onUpdateMoveHelper(); } /** * Sets the speed and location to move to */ public void setMoveTo(double x, double y, double z, double speedIn) { if (this.frog.isInWater()) { speedIn = 1.5D; } super.setMoveTo(x, y, z, speedIn); if (speedIn > 0.0D) { this.nextJumpSpeed = speedIn; } } } static class AIPanic extends EntityAIPanic { private final EntityFrog frog; public AIPanic(EntityFrog frog, double speedIn) { super(frog, speedIn); this.frog = frog; } public void updateTask() { super.updateTask(); this.frog.setMovementSpeed(this.speed); } } //SOUNDS protected SoundEvent getJumpSound() { return SoundEvents.ENTITY_RABBIT_JUMP; } protected SoundEvent getAmbientSound() { return SoundEvents.ENTITY_RABBIT_AMBIENT; } protected SoundEvent getHurtSound(DamageSource p_184601_1_) { return SoundEvents.ENTITY_RABBIT_HURT; } protected SoundEvent getDeathSound() { return SoundEvents.ENTITY_RABBIT_DEATH; } public SoundCategory getSoundCategory() { return SoundCategory.NEUTRAL; } }
[ "azulaloichampagne@gmail.com" ]
azulaloichampagne@gmail.com
0d4534c92e8fd4f8e52621376849aaf49b5d6939
e32eb170db5419fd849058ba0a7fd63d3e35f16a
/utils/utils-api/src/main/java/com/redshape/utils/config/AbstractConfig.java
3a4d9e10a11730dea853a5eedf540f42a43ed2e8
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
nikelin/Redshape-AS
9803f6825e310fdc0b0870513c977fea06d1c069
252d10988daadb9ca5972b61da2ef9d84eedafac
refs/heads/3.1.6
2022-09-02T23:48:47.958888
2012-11-13T10:02:03
2012-11-13T10:02:03
6,657,575
0
1
Apache-2.0
2022-09-01T22:51:08
2012-11-12T17:39:26
Java
UTF-8
Java
false
false
6,046
java
/* * Copyright 2012 Cyril A. Karpenko * * 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.redshape.utils.config; import com.redshape.utils.config.sources.IConfigSource; import java.util.*; /** * @author Cyril A. Karpenko <self@nikelin.ru> * @package com.redshape.utils.config * @date 10/20/11 1:13 PM */ public abstract class AbstractConfig implements IConfig { protected boolean nulled; protected String value; protected IConfig parent; protected String name; protected Map<String, String> attributes = new LinkedHashMap<String, String>(); protected List<IConfig> childs = new ArrayList<IConfig>(); protected IConfigSource source; protected boolean initialized; public AbstractConfig() { this(null, null, null); } protected AbstractConfig(IConfig parent, String name, String value) { this.parent = parent; this.name = name; this.value = value; } protected AbstractConfig(String name, String value) { this(null, name, value); } public AbstractConfig(IConfigSource source) throws ConfigException { this.source = source; this.init(); } abstract protected void actualInit() throws ConfigException ; protected void init() throws ConfigException { this.actualInit(); } protected void clear() { this.value = null; this.name = null; this.parent = null; this.attributes.clear(); this.childs.clear(); } @Override public boolean isNull() { return this.nulled; } @Override public String path() throws ConfigException { List<String> route = new ArrayList<String>(); IConfig parent = this; while ( null != parent ) { route.add( parent.name() ); parent = parent.parent(); } String[] routes = route.toArray( new String[route.size()] ); StringBuilder result = new StringBuilder(); for ( int i = routes.length; i > 0; i-- ) { result.append( routes[i] ); if ( i != routes.length - 1 ) { result.append("."); } } return result.toString(); } @Override public <T extends IConfig> List<T> childs() { return (List<T>) this.childs; } @Override public boolean hasChilds() { return !this.childs.isEmpty(); } @Override public IConfig get(String name) throws ConfigException { if (this.isNull()) { return this.createNull(); } IConfig result = this; String[] pathNodes = name.split("\\."); if ( pathNodes.length == 1 ) { return this._get(name); } for ( String pathNode : pathNodes ) { result = result.get(pathNode); if ( result.isNull() ) { break; } } return result; } private IConfig _get( String name ) { for ( IConfig config : this.childs() ) { if ( config.name().equals(name) ) { return config; } } return this.createNull(); } @Override public String[] list() { return this.list(null); } @Override public String[] list(String name) { List<String> list = new ArrayList<String>(); for ( IConfig node : this.childs() ) { if ( name == null || !node.name().equals(name) ) { continue; } list.add( node.value() ); } return list.toArray( new String[ list.size() ] ); } @Override public String name() { return this.name; } @Override public String[] names() { List<String> list = new ArrayList<String>(); for ( IConfig node : this.childs() ) { list.add( node.name() ); } return list.toArray( new String[ list.size() ] ); } @Override public String attribute(String name) { return this.attributes.get(name); } @Override public String[] attributeNames() { return this.attributes.keySet().toArray( new String[this.attributes.size()] ); } @Override public String value() { return this.value; } @Override public IConfig parent() throws ConfigException { return this.parent; } @Override public IConfig append(IConfig config) { config.parent(this); this.childs.add(config); return this; } @Override public IConfig parent(IConfig config) { this.parent = config; return this; } @Override public IConfig set(String value) throws ConfigException { this.value = value; return this; } @Override public IConfig attribute(String name, String value) { this.attributes.put(name, value); return this; } @Override public IConfig remove() throws ConfigException { this.parent.remove(this); this.nulled = true; return this; } @Override public IConfig remove(IConfig config) throws ConfigException { this.childs.remove(config); return this; } @Override public void save() throws ConfigException { if ( this.source == null ) { throw new IllegalStateException("Associated holder not exists"); } this.source.write( this.serialize() ); } abstract protected IConfig createNull(); }
[ "self@nikelin.ru" ]
self@nikelin.ru
c70d86e0878e63b21da7b9fa21a2d2b80b0b8593
b96817be9c54acaeed3503d6940500a133a8e7af
/java8/part1/src/lambda/types/ConsumerTest.java
6ac5b2c347299b63d2ab205164832879e7082bf0
[]
no_license
anbarasupr/java
3072fe76652205e163e7e1e3fe9848e80ecf11a6
e0cd42c6b9d1b675047ab178a9012509e37d6671
refs/heads/master
2023-07-11T11:49:56.153323
2023-06-22T15:09:47
2023-06-22T15:09:47
193,373,509
0
0
null
null
null
null
UTF-8
Java
false
false
1,433
java
package lambda.types; import java.util.*; import java.util.Iterator; import java.util.function.*; import common.Employee; import common.Student; public class ConsumerTest { public static void main(String[] args) { String s = "Hello my dear darling. How are you?"; Consumer<String> c = str -> System.out.println("consumer received:" + str); c.accept(s); // find students information including grade whose marks >=60 Function<Student, String> f = stud -> { int marks = stud.getMarks(); if (marks >= 80) { return "A[Distinction]"; } else if (marks >= 60) { return "B[First Class]"; } else if (marks >= 50) { return "B[Second Class]"; } else if (marks >= 40) { return "B[Third Class]"; } else { return "E[Failed]"; } }; Predicate<Student> p=stud->stud.getMarks()>=60; Consumer<Student> con=stud->System.out .println("name: " + stud.getName() + ", marks: " + stud.getMarks() + " , Grade: " + f.apply(stud)); System.out.println("PRINTING STUDENTS GRADE WHOSE MARKS >=60"); List<Student> list=getStudentList(); for (Student stud : list) { if(p.test(stud)) { con.accept(stud); } } } public static List<Student> getStudentList() { List<Student> list = new ArrayList<>(); list.add(new Student("anbu", 100)); list.add(new Student("priya", 99)); list.add(new Student("selvam", 60)); list.add(new Student("aruna", 30)); return list; } }
[ "anbarasu.2013@gmail.com" ]
anbarasu.2013@gmail.com
398aa3cdf8d7cf345f50abbf80bd71c3a2d27fc0
c2fb6846d5b932928854cfd194d95c79c723f04c
/arduino_backup/MySqljdbcdriver/mysql-connector-java-5.1.42/mysql-connector-java-5.1.42/src/com/mysql/jdbc/Statement.java
c3499bb0dda48831bcedc09b806653ff9134f52a
[ "GPL-2.0-only", "LicenseRef-scancode-other-copyleft", "LicenseRef-scancode-unknown-license-reference", "LGPL-2.1-only", "GPL-1.0-or-later", "LGPL-2.0-or-later", "LGPL-2.1-or-later", "LicenseRef-scancode-warranty-disclaimer", "MIT" ]
permissive
Jimut123/code-backup
ef90ccec9fb6483bb6dae0aa6a1f1cc2b8802d59
8d4c16b9e960d352a7775786ea60290b29b30143
refs/heads/master
2022-12-07T04:10:59.604922
2021-04-28T10:22:19
2021-04-28T10:22:19
156,666,404
9
5
MIT
2022-12-02T20:27:22
2018-11-08T07:22:48
Jupyter Notebook
UTF-8
Java
false
false
3,889
java
/* Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. The MySQL Connector/J is licensed under the terms of the GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most MySQL Connectors. There are special exceptions to the terms and conditions of the GPLv2 as it is applied to this software, see the FOSS License Exception <http://www.mysql.com/about/legal/licensing/foss-exception.html>. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ package com.mysql.jdbc; import java.io.InputStream; import java.sql.SQLException; /** * This interface contains methods that are considered the "vendor extension" to the JDBC API for MySQL's implementation of java.sql.Statement. * * For those looking further into the driver implementation, it is not an API that is used for plugability of implementations inside our driver * (which is why there are still references to StatementImpl throughout the code). */ public interface Statement extends java.sql.Statement, Wrapper { /** * Workaround for containers that 'check' for sane values of * Statement.setFetchSize() so that applications can use * the Java variant of libmysql's mysql_use_result() behavior. * * @throws SQLException */ public abstract void enableStreamingResults() throws SQLException; /** * Resets this statements fetch size and result set type to the values * they had before enableStreamingResults() was called. * * @throws SQLException */ public abstract void disableStreamingResults() throws SQLException; /** * Sets an InputStream instance that will be used to send data * to the MySQL server for a "LOAD DATA LOCAL INFILE" statement * rather than a FileInputStream or URLInputStream that represents * the path given as an argument to the statement. * * This stream will be read to completion upon execution of a * "LOAD DATA LOCAL INFILE" statement, and will automatically * be closed by the driver, so it needs to be reset * before each call to execute*() that would cause the MySQL * server to request data to fulfill the request for * "LOAD DATA LOCAL INFILE". * * If this value is set to NULL, the driver will revert to using * a FileInputStream or URLInputStream as required. */ public abstract void setLocalInfileInputStream(InputStream stream); /** * Returns the InputStream instance that will be used to send * data in response to a "LOAD DATA LOCAL INFILE" statement. * * This method returns NULL if no such stream has been set * via setLocalInfileInputStream(). */ public abstract InputStream getLocalInfileInputStream(); public void setPingTarget(PingTarget pingTarget); public ExceptionInterceptor getExceptionInterceptor(); /** * Callback for result set instances to remove them from the Set that * tracks them per-statement */ public abstract void removeOpenResultSet(ResultSetInternalMethods rs); /** * Returns the number of open result sets for this statement. */ public abstract int getOpenResultSetCount(); public void setHoldResultsOpenOverClose(boolean holdResultsOpenOverClose); }
[ "jimutbahanpal@yahoo.com" ]
jimutbahanpal@yahoo.com
9ac258d23dfb2d20bd64d291c1c1d9937aca576a
1cd15cbd9321986bbacad9da3b4a41034f939924
/src/Day46_final_abstract/Circle.java
3fa317bb72d44504789e2d5714d602ce1b7f94af
[]
no_license
senrabia/JAVA_2020B18
00dace6664f8c1e90e1d80b84e8637fe483af2e0
8db7ddbba36364412b3d3ba77b54b0b04e1ede05
refs/heads/master
2022-10-01T11:45:52.737984
2020-06-09T13:20:52
2020-06-09T13:20:52
268,657,470
0
0
null
null
null
null
UTF-8
Java
false
false
375
java
package Day46_final_abstract; //15:30 public final class Circle extends Shape { //absrtact ta burda calisir public double radius; public final static double PI = 3.14; public Circle (double radius){ this.radius=radius; } public void Area(){ double area=radius * radius * PI; System.out.println("Area of circle:"+ area); } }
[ "senergunerrabia@gmail.com" ]
senergunerrabia@gmail.com
e64ad25687c71ff014c7e3b87e1398e2d3321fb6
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/30/30_caaf0ccfc3d634f8ddf0f68db4d19ee1775a1f25/TCPio/30_caaf0ccfc3d634f8ddf0f68db4d19ee1775a1f25_TCPio_s.java
05261d863d269b33928183f171598bc1102b1b65
[]
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,201
java
/** * DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE * Version 2, December 2004 * * Copyright (C) sponge * Planet Earth * Everyone is permitted to copy and distribute verbatim or modified * copies of this license document, and changing it is allowed as long * as the name is changed. * * DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE * TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION * * 0. You just DO WHAT THE FUCK YOU WANT TO. * * See... * * http://sam.zoy.org/wtfpl/ * and * http://en.wikipedia.org/wiki/WTFPL * * ...for any additional details and liscense questions. */ package net.i2p.BOB; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; /** * Shove data from one stream to the other. * * @author sponge */ public class TCPio implements Runnable { private InputStream Ain; private OutputStream Aout; private nickname info; /** * Constructor * * @param Ain * @param Aout * @param db */ TCPio(InputStream Ain, OutputStream Aout, nickname db) { this.Ain = Ain; this.Aout = Aout; this.info = db; } /** * kill off the streams, to hopefully cause an IOException in the thread in order to kill it. */ /** * Copy from source to destination... * and yes, we are totally OK to block here on writes, * The OS has buffers, and I intend to use them. * */ public void run() { int b; byte a[] = new byte[1]; try { while(info.get("RUNNING").equals(true)) { b = Ain.read(a, 0, 1); // System.out.println(info.get("NICKNAME").toString() + " " + b); if(b > 0) { Aout.write(a,0,1); // Aout.flush(); too slow! } else if(b == 0) { try { // Thread.yield(); Thread.sleep(10); } catch(InterruptedException ex) { } } else { /* according to the specs: * * The total number of bytes read into the buffer, * or -1 is there is no more data because the end of * the stream has been reached. * */ return; } } } catch(IOException e) { } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
002c6506a7c3647bf167e0110048169135ce88d1
b3e911d946a7761ddcec895e25e79ec042b87ca3
/app/src/main/java/root/iv/androidacademy/util/GlideModule.java
9427b8939f2c2127ea09dab744ffb38b8cd4f0cd
[]
no_license
lichtstrahl/AndroidAcademy
e3bb4e1678497072008dbf02382f23d2e4d0145f
4d5ad5747aa9b3ec48a4c3b2dff85391d0a82f3a
refs/heads/master
2022-08-13T14:39:30.258788
2022-07-20T14:01:42
2022-07-20T14:01:42
160,808,909
1
0
null
2019-01-16T10:16:04
2018-12-07T10:26:37
Java
UTF-8
Java
false
false
183
java
package root.iv.androidacademy.util; import com.bumptech.glide.module.AppGlideModule; @com.bumptech.glide.annotation.GlideModule public class GlideModule extends AppGlideModule { }
[ "cool.rainbow2012@yandex.ru" ]
cool.rainbow2012@yandex.ru
a35e4e85d32c936bad703e02b436a1915c799eb3
c3445da9eff3501684f1e22dd8709d01ff414a15
/LIS/sinosoft-parents/lis-business/src/main/java_schema/com/sinosoft/lis/vdb/LOBonusAssignGrpErrLogDBSet.java
fa911c17d0c0cf80ff33e6f7ffd4fe8dd6a41a81
[]
no_license
zhanght86/HSBC20171018
954403d25d24854dd426fa9224dfb578567ac212
c1095c58c0bdfa9d79668db9be4a250dd3f418c5
refs/heads/master
2021-05-07T03:30:31.905582
2017-11-08T08:54:46
2017-11-08T08:54:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
9,052
java
/** * Copyright (c) 2002 sinosoft Co. Ltd. * All right reserved. */ package com.sinosoft.lis.vdb; import org.apache.log4j.Logger; import java.sql.*; import com.sinosoft.lis.schema.LOBonusAssignGrpErrLogSchema; import com.sinosoft.lis.vschema.LOBonusAssignGrpErrLogSet; import com.sinosoft.lis.pubfun.*; import com.sinosoft.utility.*; /* * <p>ClassName: LOBonusAssignGrpErrLogDBSet </p> * <p>Description: DB层多记录数据库操作类文件 </p> * <p>Copyright: Copyright (c) 2007</p> * <p>Company: sinosoft </p> * @Database: 分红管理 */ public class LOBonusAssignGrpErrLogDBSet extends LOBonusAssignGrpErrLogSet { private static Logger logger = Logger.getLogger(LOBonusAssignGrpErrLogDBSet.class); // @Field private Connection con; private DBOper db; /** * flag = true: 传入Connection * flag = false: 不传入Connection **/ private boolean mflag = false; // @Constructor public LOBonusAssignGrpErrLogDBSet(Connection tConnection) { con = tConnection; db = new DBOper(con,"LOBonusAssignGrpErrLog"); mflag = true; } public LOBonusAssignGrpErrLogDBSet() { db = new DBOper( "LOBonusAssignGrpErrLog" ); } // @Method public boolean deleteSQL() { if (db.deleteSQL(this)) { return true; } else { // @@错误处理 this.mErrors.copyAllErrors(db.mErrors); CError tError = new CError(); tError.moduleName = "LOBonusAssignGrpErrLogDBSet"; tError.functionName = "deleteSQL"; tError.errorMessage = "操作失败!"; this.mErrors .addOneError(tError); return false; } } /** * 删除操作 * 删除条件:主键 * @return boolean */ public boolean delete() { PreparedStatement pstmt = null; if( !mflag ) { con = DBConnPool.getConnection(); } try { int tCount = this.size(); pstmt = con.prepareStatement("DELETE FROM LOBonusAssignGrpErrLog WHERE SerialNo = ? AND GrpContNo = ?"); for (int i = 1; i <= tCount; i++) { if(this.get(i).getSerialNo() == null || this.get(i).getSerialNo().equals("null")) { pstmt.setString(1,null); } else { pstmt.setString(1, this.get(i).getSerialNo()); } if(this.get(i).getGrpContNo() == null || this.get(i).getGrpContNo().equals("null")) { pstmt.setString(2,null); } else { pstmt.setString(2, this.get(i).getGrpContNo()); } // only for debug purpose SQLString sqlObj = new SQLString("LOBonusAssignGrpErrLog"); sqlObj.setSQL(4, this.get(i)); sqlObj.getSQL(); pstmt.addBatch(); } pstmt.executeBatch(); pstmt.close(); } catch (Exception ex) { // @@错误处理 ex.printStackTrace(); this.mErrors.copyAllErrors(db.mErrors); CError tError = new CError(); tError.moduleName = "LOBonusAssignGrpErrLogDBSet"; tError.functionName = "delete()"; tError.errorMessage = ex.toString(); this.mErrors .addOneError(tError); try { pstmt.close(); } catch (Exception e){e.printStackTrace();} if( !mflag ) { try { con.close(); } catch (Exception e){e.printStackTrace();} } return false; } if( !mflag ) { try { con.close(); } catch (Exception e){e.printStackTrace();} } return true; } /** * 更新操作 * 更新条件:主键 * @return boolean */ public boolean update() { PreparedStatement pstmt = null; if( !mflag ) { con = DBConnPool.getConnection(); } try { int tCount = this.size(); pstmt = con.prepareStatement("UPDATE LOBonusAssignGrpErrLog SET SerialNo = ? , GrpPolNo = ? , FiscalYear = ? , Type = ? , ErrMsg = ? , MakeDate = ? , MakeTime = ? , GrpContNo = ? WHERE SerialNo = ? AND GrpContNo = ?"); for (int i = 1; i <= tCount; i++) { if(this.get(i).getSerialNo() == null || this.get(i).getSerialNo().equals("null")) { pstmt.setString(1,null); } else { pstmt.setString(1, this.get(i).getSerialNo()); } if(this.get(i).getGrpPolNo() == null || this.get(i).getGrpPolNo().equals("null")) { pstmt.setString(2,null); } else { pstmt.setString(2, this.get(i).getGrpPolNo()); } pstmt.setInt(3, this.get(i).getFiscalYear()); if(this.get(i).getType() == null || this.get(i).getType().equals("null")) { pstmt.setString(4,null); } else { pstmt.setString(4, this.get(i).getType()); } if(this.get(i).getErrMsg() == null || this.get(i).getErrMsg().equals("null")) { pstmt.setString(5,null); } else { pstmt.setString(5, this.get(i).getErrMsg()); } if(this.get(i).getMakeDate() == null || this.get(i).getMakeDate().equals("null")) { pstmt.setDate(6,null); } else { pstmt.setDate(6, Date.valueOf(this.get(i).getMakeDate())); } if(this.get(i).getMakeTime() == null || this.get(i).getMakeTime().equals("null")) { pstmt.setString(7,null); } else { pstmt.setString(7, this.get(i).getMakeTime()); } if(this.get(i).getGrpContNo() == null || this.get(i).getGrpContNo().equals("null")) { pstmt.setString(8,null); } else { pstmt.setString(8, this.get(i).getGrpContNo()); } // set where condition if(this.get(i).getSerialNo() == null || this.get(i).getSerialNo().equals("null")) { pstmt.setString(9,null); } else { pstmt.setString(9, this.get(i).getSerialNo()); } if(this.get(i).getGrpContNo() == null || this.get(i).getGrpContNo().equals("null")) { pstmt.setString(10,null); } else { pstmt.setString(10, this.get(i).getGrpContNo()); } // only for debug purpose SQLString sqlObj = new SQLString("LOBonusAssignGrpErrLog"); sqlObj.setSQL(2, this.get(i)); sqlObj.getSQL(); pstmt.addBatch(); } pstmt.executeBatch(); pstmt.close(); } catch (Exception ex) { // @@错误处理 ex.printStackTrace(); this.mErrors.copyAllErrors(db.mErrors); CError tError = new CError(); tError.moduleName = "LOBonusAssignGrpErrLogDBSet"; tError.functionName = "update()"; tError.errorMessage = ex.toString(); this.mErrors .addOneError(tError); try { pstmt.close(); } catch (Exception e){e.printStackTrace();} if( !mflag ) { try { con.close(); } catch (Exception e){e.printStackTrace();} } return false; } if( !mflag ) { try { con.close(); } catch (Exception e){e.printStackTrace();} } return true; } /** * 新增操作 * @return boolean */ public boolean insert() { PreparedStatement pstmt = null; if( !mflag ) { con = DBConnPool.getConnection(); } try { int tCount = this.size(); pstmt = con.prepareStatement("INSERT INTO LOBonusAssignGrpErrLog(SerialNo ,GrpPolNo ,FiscalYear ,Type ,ErrMsg ,MakeDate ,MakeTime ,GrpContNo) VALUES( ? , ? , ? , ? , ? , ? , ? , ?)"); for (int i = 1; i <= tCount; i++) { if(this.get(i).getSerialNo() == null || this.get(i).getSerialNo().equals("null")) { pstmt.setString(1,null); } else { pstmt.setString(1, this.get(i).getSerialNo()); } if(this.get(i).getGrpPolNo() == null || this.get(i).getGrpPolNo().equals("null")) { pstmt.setString(2,null); } else { pstmt.setString(2, this.get(i).getGrpPolNo()); } pstmt.setInt(3, this.get(i).getFiscalYear()); if(this.get(i).getType() == null || this.get(i).getType().equals("null")) { pstmt.setString(4,null); } else { pstmt.setString(4, this.get(i).getType()); } if(this.get(i).getErrMsg() == null || this.get(i).getErrMsg().equals("null")) { pstmt.setString(5,null); } else { pstmt.setString(5, this.get(i).getErrMsg()); } if(this.get(i).getMakeDate() == null || this.get(i).getMakeDate().equals("null")) { pstmt.setDate(6,null); } else { pstmt.setDate(6, Date.valueOf(this.get(i).getMakeDate())); } if(this.get(i).getMakeTime() == null || this.get(i).getMakeTime().equals("null")) { pstmt.setString(7,null); } else { pstmt.setString(7, this.get(i).getMakeTime()); } if(this.get(i).getGrpContNo() == null || this.get(i).getGrpContNo().equals("null")) { pstmt.setString(8,null); } else { pstmt.setString(8, this.get(i).getGrpContNo()); } // only for debug purpose SQLString sqlObj = new SQLString("LOBonusAssignGrpErrLog"); sqlObj.setSQL(1, this.get(i)); sqlObj.getSQL(); pstmt.addBatch(); } pstmt.executeBatch(); pstmt.close(); } catch (Exception ex) { // @@错误处理 ex.printStackTrace(); this.mErrors.copyAllErrors(db.mErrors); CError tError = new CError(); tError.moduleName = "LOBonusAssignGrpErrLogDBSet"; tError.functionName = "insert()"; tError.errorMessage = ex.toString(); this.mErrors .addOneError(tError); try { pstmt.close(); } catch (Exception e){e.printStackTrace();} if( !mflag ) { try { con.close(); } catch (Exception e){e.printStackTrace();} } return false; } if( !mflag ) { try { con.close(); } catch (Exception e){e.printStackTrace();} } return true; } }
[ "dingzansh@sinosoft.com.cn" ]
dingzansh@sinosoft.com.cn
23112f8d630906232c6a32bbbf88cadc2df69465
926ebcb8c9b0734ea588777f1e7ffed7722e9e8c
/ASSA_source_code/app/src/main/java/com/example/user/gjsd/view/costlist/DistanceViewItem.java
7816125c6bb298831da4cb7ee8bcce961cafcbda
[]
no_license
MobileSeoul/2018seoul-92
a885051ede49492ebd5bf7f9f559b56c7bf0006f
5e998e404d66853bdf090b49bae10d6c35c3dda4
refs/heads/master
2020-04-11T21:37:13.338984
2018-12-17T10:13:25
2018-12-17T10:13:25
162,111,393
0
0
null
null
null
null
UTF-8
Java
false
false
1,251
java
package com.example.user.gjsd.view.costlist; import com.example.user.gjsd.model.Market; public class DistanceViewItem { // private String numberStr ; // private String titleStr ; // private String descStr ; // private String disStr ; // // public void setNumber(String number) { // numberStr = number; // } // public void setTitle(String title) { // titleStr = title ; // } // public void setDesc(String desc) { // descStr = desc ; // } // // public void setDisStr(String disStr) { // this.disStr = disStr; // } // // public String getNumber() { // return this.numberStr ; // } // public String getTitle() { // return this.titleStr ; // } // public String getDesc() { // return this.descStr ; // } // // public String getDisStr() { // return disStr; // } // // // private String name; public void setName(String name) { this.name = name; } public String getName() { return name; } public Market getMarket() { return market; } private Market market; public DistanceViewItem(String name, Market market){ this.name = name; this.market = market; } }
[ "ianyrchoi@gmail.com" ]
ianyrchoi@gmail.com
04e4d74c9e3bb13aea521f61d3ff2ffb7ea37197
1931c1848b050bd58c597959e07f69c090dcdf39
/src/test/java/org/turbogwt/mvp/databind/client/mock/HasValueMock.java
20c89b222dd769a6b3b7500df2c3926ad9c68738
[ "Apache-2.0" ]
permissive
growbit/turbogwt-databind
8e488f507f9f76f9772301f0820ba9ebc94ad566
899c2b56c3e6fa8881762e84676393ec34edba15
refs/heads/master
2020-05-19T08:13:17.803489
2014-11-27T20:09:32
2014-11-27T20:09:32
16,531,396
1
0
null
null
null
null
UTF-8
Java
false
false
2,485
java
/* * Copyright 2014 Grow Bit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.turbogwt.mvp.databind.client.mock; import com.google.gwt.event.logical.shared.ValueChangeEvent; import com.google.gwt.event.logical.shared.ValueChangeHandler; import com.google.gwt.event.shared.EventHandler; import com.google.gwt.event.shared.GwtEvent; import com.google.gwt.event.shared.HandlerManager; import com.google.gwt.event.shared.HandlerRegistration; import com.google.gwt.user.client.ui.HasValue; import com.google.gwt.user.client.ui.IsWidget; import com.google.gwt.user.client.ui.Widget; /** * @param <V> Value type * * @author Danilo Reinert */ public class HasValueMock<V> extends TakesValueMock<V> implements HasValue<V>, IsWidget { private HandlerManager handlerManager; @Override public HandlerRegistration addValueChangeHandler(ValueChangeHandler<V> handler) { return addHandler(handler, ValueChangeEvent.getType()); } /** * Returns the {@link com.google.gwt.user.client.ui.Widget} aspect of the receiver. */ @Override public Widget asWidget() { return null; } @Override public void fireEvent(GwtEvent<?> event) { if (handlerManager != null) { handlerManager.fireEvent(event); } } public final <H extends EventHandler> HandlerRegistration addHandler(H handler, GwtEvent.Type<H> type) { return ensureHandlerManager().addHandler(type, handler); } @Override public void setValue(V value) { setValue(value, true); } @Override public void setValue(V value, boolean fireEvents) { V oldValue = getValue(); super.setValue(value); if (fireEvents) { ValueChangeEvent.fireIfNotEqual(this, oldValue, value); } } private HandlerManager ensureHandlerManager() { return handlerManager == null ? handlerManager = new HandlerManager(this) : handlerManager; } }
[ "daniloreinert@gmail.com" ]
daniloreinert@gmail.com
53d1c45da1da7284e347748d8efd2b01bb87bd6d
7896839c9b1a3a41b01e104142a00efcb7d3f66a
/START_frontend/Sources/StartApp/test_parent_child_play/src/main/java/com/reading/start/tests/test_parent_child_play/data/entity/DataUploadSurveyResultItem.java
55d0732e57ad3f5a90ebdf25e7dcdf5faf2857a6
[ "Apache-2.0" ]
permissive
bhismalab/START
4051e0f2384a1bb8a5b5ef1f01e0e1565ab7aa0c
86b0682489e6d0d1d2514d341718c1d189dbf83f
refs/heads/master
2023-04-10T19:58:53.560126
2022-03-03T22:17:22
2022-03-03T22:17:22
465,897,908
1
0
null
null
null
null
UTF-8
Java
false
false
1,458
java
package com.reading.start.tests.test_parent_child_play.data.entity; import com.google.gson.annotations.SerializedName; public class DataUploadSurveyResultItem { public static final String FILED_ASSESSMENT_TYPE = "assestment_type"; public static final String FILED_SURVEY_ID = "survey_id"; public static final String FILED_FILE_NAME = "file_name"; public static final String FILED_FILE_CONTENT = "file_content"; @SerializedName(FILED_ASSESSMENT_TYPE) private String assessmentType = ""; @SerializedName(FILED_SURVEY_ID) private String surveyId = null; @SerializedName(FILED_FILE_NAME) private String fileName = ""; @SerializedName(FILED_FILE_CONTENT) private String fileContent = ""; public DataUploadSurveyResultItem() { } public String getAssessmentType() { return assessmentType; } public void setAssessmentType(String assessmentType) { this.assessmentType = assessmentType; } public String getSurveyId() { return surveyId; } public void setSurveyId(String surveyId) { this.surveyId = surveyId; } public String getFileName() { return fileName; } public void setFileName(String fileName) { this.fileName = fileName; } public String getFileContent() { return fileContent; } public void setFileContent(String fileContent) { this.fileContent = fileContent; } }
[ "abhinavkumar045@gmail.com" ]
abhinavkumar045@gmail.com
12b27677bfc621de4dacbe2e79fe8692a676dbe5
8310c399f13a7499a4df9c3ba7fa478448782616
/service-feign/src/main/java/com/qiweb/service/SchedualServiceHiHystric.java
96842b74b9f75bcb6f74db9c72a22a6d135885bd
[]
no_license
QIWEB/qiweb_SpringCloud2018
1adf89401604688b49739dc37ba2e8c30f318fab
6015b09371a373c21bb0366915cb19b39816377f
refs/heads/master
2020-03-26T10:52:11.943091
2018-08-24T02:49:10
2018-08-24T02:49:10
144,818,494
1
0
null
null
null
null
UTF-8
Java
false
false
333
java
package com.qiweb.service; import org.springframework.stereotype.Component; @Component public class SchedualServiceHiHystric implements SchedualServiceHi { @Override public String sayHiFromClientOne(String name) { return "sorry 这是feign自带的熔断器不用改pom需要在配置文件中开启 "+name; } }
[ "zhangqi@dbgo.cn" ]
zhangqi@dbgo.cn
2cdcc3dd2e6252f6f49f83f70eac12f1b827bef3
cc11f81f121775f760cb1984d0a3b9879007237a
/HBSNewVentureCompetition/app/src/main/java/org1hnvc/httpshbssup/hbsnewventurecompetition/Objects/Coordinator.java
243554024f6816e3cd61c11f3328882a826dfae2
[]
no_license
theonlynick0430/HBS-New-Venture-Competition-Android
4be3040a883742d000ded3e680149349de8bb6c5
35167561a4f526b479e50abf3356c0f763cbe874
refs/heads/master
2020-04-15T04:04:45.776730
2020-02-27T08:04:07
2020-02-27T08:04:07
164,370,565
0
0
null
null
null
null
UTF-8
Java
false
false
992
java
package org1hnvc.httpshbssup.hbsnewventurecompetition.Objects; public class Coordinator implements Comparable<Coordinator> { public String firstName; public String lastName; public String profileImageURL; public String position; public String organization; public String linkedInURL; public Double order; public Coordinator(String firstName, String lastName, String profileImageURL, String position, String organization, String linkedInURL, Double order){ this.firstName = firstName; this.lastName = lastName; this.profileImageURL = profileImageURL; this.position = position; this.organization = organization; this.linkedInURL = linkedInURL; this.order = order; } public int compareTo(Coordinator f) { if (order > f.order) { return 1; } else if (order < f.order) { return -1; } else { return 0; } } }
[ "nik.sridhar@gmail.com" ]
nik.sridhar@gmail.com
9db5b836ed341b74ae6df1e3d1dee7848d9775fb
63f14625508e9e62b69798634d18ffb8f31bf571
/src/com/tonmx/exmark/bean/Point.java
5abb0fc4384c5f3639b56d30d80779e4799ec164
[]
no_license
596785154/EXMark
3d841a613fd1a319fd3bfc9f6d3bd7ae0e471226
841cf760ea943496971b7020fce16470227cbeec
refs/heads/master
2020-12-03T01:48:26.530109
2017-06-30T09:00:27
2017-06-30T09:00:27
75,275,111
0
0
null
null
null
null
UTF-8
Java
false
false
410
java
package com.tonmx.exmark.bean; public class Point { int pointX; int pointY; public Point(int x,int y) { // TODO Auto-generated constructor stub pointX = x; pointY = y; } public int getPointX() { return pointX; } public int getPointY() { return pointY; } public void setPointX(int pointX) { this.pointX = pointX; } public void setPointY(int pointY) { this.pointY = pointY; } }
[ "596785154@qq.com" ]
596785154@qq.com
7ce686e7667b6a213f29f4a84bfb44ef213bc610
2f3c04382a66dbf222c8587edd67a5df4bc80422
/src/com/cedar/cp/ejb/api/budgetlocation/UserModelSecurityEditorSessionLocalHome.java
80394fe03982bad3f6a0aceb0b9d630ab1fbd387
[]
no_license
arnoldbendaa/cppro
d3ab6181cc51baad2b80876c65e11e92c569f0cc
f55958b85a74ad685f1360ae33c881b50d6e5814
refs/heads/master
2020-03-23T04:18:00.265742
2018-09-11T08:15:28
2018-09-11T08:15:28
141,074,966
0
0
null
null
null
null
UTF-8
Java
false
false
272
java
package com.cedar.cp.ejb.api.budgetlocation; import javax.ejb.CreateException; import javax.ejb.EJBLocalHome; public interface UserModelSecurityEditorSessionLocalHome extends EJBLocalHome { UserModelSecurityEditorSessionLocal create() throws CreateException; }
[ "arnoldbendaa@gmail.com" ]
arnoldbendaa@gmail.com
b188dbe5fee548ac02bae8f3bbb124b7ae027dc8
813200515ac0f0c42098b3f475c84a6568c9ec12
/src/data/Constants.java
6564cf8d9c4f0b08bffd1eb794ae2fbcbffb2993
[]
no_license
ichi84/FunFavTwt
ccabff497793fc77206f501fd3b74bbef765dad4
e24129c6afc8c007c7cf5bc51212594e3f48dd61
refs/heads/master
2016-09-09T19:08:46.377412
2013-11-20T12:34:12
2014-11-17T09:24:55
null
0
0
null
null
null
null
SHIFT_JIS
Java
false
false
1,682
java
package data; public class Constants { //request token取得用url public static final String REQUEST_TOKEN_ENDPOINT_URL = "https://api.twitter.com/oauth/request_token"; //Access token取得用url public static final String ACCESS_TOKEN_ENDPOINT_URL = "https://api.twitter.com/oauth/access_token"; //Oauth認証用url public static final String OAUTH_URL = "https://api.twitter.com/oauth/authorize"; //コールバック用url public static final String CALBACK_URL = "app://FunFav"; //= "http://ichi84.blogspot.com/"; //コンシューマキー public static final String CONSUMER_KEY = "P80lTx8An2Lw8O3XouPfQ"; //コンシューマシークレットキー public static final String CONSUMER_SECRET = "dSwJJyntZYErB2bNiS9CPEotFxyg9jHeuR2QlrHswNM"; // // CommonsHttpOAuthConsumer引き渡し用パラメータ名 public static final String OAUTH_CONSUMER = "oauthConsumer"; // タイムラインのURI public static final String TIMELINE_REQUEST_URL = "https://api.twitter.com/1.1/statuses/home_timeline.json"; public static final String STREAM_TIMELINE_REQUEST_URL = "https://userstream.twitter.com/2/user.json"; public static final String MENTION_REQUEST_URL = "https://api.twitter.com/1.1/statuses/mentions_timeline.json?include_rts=1"; // つぶやきを投稿するURI public static final String TWEET_REQUEST_URL = "https://api.twitter.com/1.1/statuses/update.json"; // 認証画面で許可しなかった場合の判定用 public static final String REQUEST_TOKEN_DENIED = "denied"; }
[ "dichihashi@miew.co.jp" ]
dichihashi@miew.co.jp
65eee1e35c275639ef92200dc417d782ec5804b3
3b5c8c5f62689fa2264581a5777ff7caf8c7608c
/25.visitor/src/main/java/visitors/acyclic/ExpressionPrinter.java
3f7c5c3ba7b71872b6a8e57d2e6eeef6b635361c
[]
no_license
slemjet/design-patterns
085adae813c1e257fcdf5009b20a64dc7f31c051
811b9b1ff9ca9654d3e20590986012f5b6862ac3
refs/heads/master
2021-06-15T16:22:17.668179
2019-09-08T08:50:10
2019-09-08T08:50:10
145,006,766
0
0
null
2021-03-31T21:32:02
2018-08-16T15:28:52
Java
UTF-8
Java
false
false
684
java
package visitors.acyclic; public class ExpressionPrinter implements DoubleExpressionVisitor, AdditionExpressionVisitor { private StringBuilder stringBuilder = new StringBuilder(); public void visit(DoubleExpression doubleExpression) { stringBuilder.append(doubleExpression.getValue()); } public void visit(AdditionExpression additionExpression) { stringBuilder.append("("); additionExpression.getLeft().accept(this); stringBuilder.append("+"); additionExpression.getRight().accept(this); stringBuilder.append(")"); } @Override public String toString() { return stringBuilder.toString(); } }
[ "slemjet@gmail.com" ]
slemjet@gmail.com
24fcec4534b1560261a25454c462c4182182a160
eb732ba7794177d449a0b949347dff4b99b9f303
/test/Collection/map/EnumMapTest.java
67e5f3a1914bc134642e5963912c2b3e3549698b
[]
no_license
Bohdan-Dovbush/patternsTasks
00e60f60852531803ee9f37eceba75a906a64bc0
356ac4ccc345af5bb7f3348d053e3cc93aaf4db1
refs/heads/master
2023-05-04T00:43:52.302948
2021-05-22T08:51:56
2021-05-22T08:51:56
364,953,315
0
0
null
null
null
null
UTF-8
Java
false
false
27,111
java
package Collection.map; import generic.util.Size; import generic.util.Color; import generic.util.Empty; import junit.framework.TestCase; import org.junit.jupiter.api.Test; import java.util.*; import static org.springframework.test.util.AssertionErrors.assertNotEquals; public class EnumMapTest extends TestCase { @Test public void testClear() { EnumMap enumSizeMap = new EnumMap(Size.class); enumSizeMap.put(Size.Small, 1); enumSizeMap.clear(); assertNull("Failed to clear all elements", enumSizeMap.get(Size.Small)); } @Test public void testContainsKey() { EnumMap enumSizeMap = new EnumMap(Size.class); assertFalse("Returned true for uncontained key", enumSizeMap.containsKey(Size.Small)); enumSizeMap.put(Size.Small, 1); assertTrue("Returned false for contained key", enumSizeMap.containsKey(Size.Small)); enumSizeMap.put(Size.Big, null); assertTrue("Returned false for contained key", enumSizeMap.containsKey(Size.Big)); assertFalse("Returned true for uncontained key", enumSizeMap.containsKey(Color.Red)); assertFalse("Returned true for uncontained key", enumSizeMap.containsKey(3)); assertFalse("Returned true for uncontained key", enumSizeMap.containsKey(null)); } @Test public void testContainsValue() { EnumMap enumSizeMap = new EnumMap(Size.class); Double double1 = 3.0; Double double2 = 3.0; assertFalse("Returned true for uncontained value", enumSizeMap.containsValue(double1)); enumSizeMap.put(Size.Middle, 2); enumSizeMap.put(Size.Small, double1); assertTrue("Returned false for contained value", enumSizeMap.containsValue(double1)); assertTrue("Returned false for contained value", enumSizeMap.containsValue(double2)); assertTrue("Returned false for contained value", enumSizeMap.containsValue(2)); assertFalse("Returned true for uncontained value", enumSizeMap.containsValue(1)); assertFalse("Returned true for uncontained value", enumSizeMap.containsValue(null)); enumSizeMap.put(Size.Big, null); assertTrue("Returned false for contained value", enumSizeMap.containsValue(null)); } @Test public void testEntrySet() { EnumMap enumSizeMap = new EnumMap(Size.class); enumSizeMap.put(Size.Middle, 1); enumSizeMap.put(Size.Big, null); MockEntry mockEntry = new MockEntry(Size.Middle, 1); Set set = enumSizeMap.entrySet(); Set set1 = enumSizeMap.entrySet(); assertSame("Should be same", set1, set); try { set.add(mockEntry); fail("Should throw UnsupportedOperationException"); } catch (UnsupportedOperationException e) {// Expected } assertTrue("Returned false for contained object", set.contains(mockEntry)); mockEntry = new MockEntry(Size.Middle, null); assertFalse("Returned true for uncontained object", set.contains(mockEntry)); assertFalse("Returned true for uncontained object", set.contains(Size.Small)); mockEntry = new MockEntry(1, 1); assertFalse("Returned true for uncontained object", set.contains(mockEntry)); assertFalse("Returned true for uncontained object", set.contains(1)); mockEntry = new MockEntry(Size.Big, null); assertTrue("Returned false for contained object", set.contains(mockEntry)); assertTrue("Returned false when the object can be removed", set.remove(mockEntry)); assertFalse("Returned true for uncontained object", set.contains(mockEntry)); assertFalse("Returned true when the object can not be removed", set.remove(mockEntry)); mockEntry = new MockEntry(1, 1); assertFalse("Returned true when the object can not be removed", set.remove(mockEntry)); assertFalse("Returned true when the object can not be removed", set.remove(1)); // The set is backed by the map so changes to one are reflected by the other. enumSizeMap.put(Size.Big, 3); mockEntry = new MockEntry(Size.Big, 3); assertTrue("Returned false for contained object", set.contains(mockEntry)); enumSizeMap.remove(Size.Big); assertFalse("Returned true for uncontained object", set.contains(mockEntry)); assertEquals("Wrong size", 1, set.size()); set.clear(); assertTrue("Wrong size", set.isEmpty()); enumSizeMap = new EnumMap(Size.class); enumSizeMap.put(Size.Middle, 1); enumSizeMap.put(Size.Big, null); set = enumSizeMap.entrySet(); Collection c = new ArrayList(); c.add(new MockEntry(Size.Middle, 1)); assertTrue("Return wrong value", set.containsAll(c)); assertTrue("Remove does not success", set.removeAll(c)); enumSizeMap.put(Size.Middle, 1); c.add(new MockEntry(Size.Big, 3)); assertTrue("Remove does not success", set.removeAll(c)); assertFalse("Should return false", set.removeAll(c)); assertEquals("Wrong size", 1, set.size()); enumSizeMap = new EnumMap(Size.class); enumSizeMap.put(Size.Middle, 1); enumSizeMap.put(Size.Big, null); set = enumSizeMap.entrySet(); c = new ArrayList(); c.add(new MockEntry(Size.Middle, 1)); c.add(new MockEntry(Size.Big, 3)); assertTrue("Retain does not success", set.retainAll(c)); assertEquals("Wrong size", 1, set.size()); assertFalse("Should return false", set.retainAll(c)); enumSizeMap = new EnumMap(Size.class); enumSizeMap.put(Size.Middle, 1); enumSizeMap.put(Size.Big, null); set = enumSizeMap.entrySet(); Object[] array = set.toArray(); assertEquals("Wrong length", 2, array.length); Map.Entry entry = (Map.Entry) array[0]; assertEquals("Wrong key", Size.Middle, entry.getKey()); assertEquals("Wrong value", 1, entry.getValue()); Object[] array1; array1 = set.toArray(); assertEquals("Wrong length", 2, array1.length); entry = (Map.Entry) array[0]; assertEquals("Wrong key", Size.Middle, entry.getKey()); assertEquals("Wrong value", 1, entry.getValue()); array1 = new Object[10]; array1 = set.toArray(array1); assertEquals("Wrong length", 10, array1.length); entry = (Map.Entry) array[1]; assertEquals("Wrong key", Size.Big, entry.getKey()); assertNull("Should be null", array1[2]); set = enumSizeMap.entrySet(); Integer integer = 1; assertFalse("Returned true when the object can not be removed", set.remove(integer)); assertTrue("Returned false when the object can be removed", set.remove(entry)); enumSizeMap = new EnumMap(Size.class); enumSizeMap.put(Size.Middle, 1); enumSizeMap.put(Size.Big, null); set = enumSizeMap.entrySet(); Iterator iter = set.iterator(); entry = (Map.Entry) iter.next(); assertTrue("Returned false for contained object", set.contains(entry)); mockEntry = new MockEntry(Size.Middle, 2); assertFalse("Returned true for uncontained object", set.contains(mockEntry)); mockEntry = new MockEntry(2, 2); assertFalse("Returned true for uncontained object", set.contains(mockEntry)); entry = (Map.Entry) iter.next(); assertTrue("Returned false for contained object", set.contains(entry)); enumSizeMap.put(Size.Middle, 1); enumSizeMap.remove(Size.Big); mockEntry = new MockEntry(Size.Big, null); assertEquals("Wrong size", 1, set.size()); assertFalse("Returned true for uncontained object", set.contains(mockEntry)); enumSizeMap.put(Size.Big, 2); mockEntry = new MockEntry(Size.Big, 2); assertTrue("Returned false for contained object", set.contains(mockEntry)); iter.remove(); try { iter.remove(); fail("Should throw IllegalStateException"); } catch (IllegalStateException e) {// Expected } try { entry.setValue(2); fail("Should throw IllegalStateException"); } catch (IllegalStateException e) {// Expected } try { set.contains(entry); fail("Should throw IllegalStateException"); } catch (IllegalStateException e) {// Expected } enumSizeMap = new EnumMap(Size.class); enumSizeMap.put(Size.Middle, 1); enumSizeMap.put(Size.Big, null); set = enumSizeMap.entrySet(); iter = set.iterator(); entry = (Map.Entry) iter.next(); assertEquals("Wrong key", Size.Middle, entry.getKey()); assertTrue("Returned false for contained object", set.contains(entry)); enumSizeMap.put(Size.Middle, 3); assertTrue("Returned false for contained object", set.contains(entry)); entry.setValue(2); assertTrue("Returned false for contained object", set.contains(entry)); assertFalse("Returned true for uncontained object", set.remove(1)); iter.next(); assertEquals("Wrong key", Size.Middle, entry.getKey()); set.clear(); assertEquals("Wrong size", 0, 0); enumSizeMap = new EnumMap(Size.class); enumSizeMap.put(Size.Middle, 1); enumSizeMap.put(Size.Big, null); set = enumSizeMap.entrySet(); iter = set.iterator(); mockEntry = new MockEntry(Size.Middle, 1); assertNotEquals("Wrong result", entry, mockEntry); try { iter.remove(); fail("Should throw IllegalStateException"); } catch (IllegalStateException e) {// Expected } entry = (Map.Entry) iter.next(); assertEquals("Wrong key", Size.Middle, entry.getKey()); assertEquals("Should return true", entry, mockEntry); assertEquals("Should be equal", mockEntry.hashCode(), entry.hashCode()); mockEntry = new MockEntry(Size.Big, 1); assertNotEquals("Wrong result", entry, mockEntry); entry = (Map.Entry) iter.next(); assertNotEquals("Wrong result", entry, mockEntry); assertEquals("Wrong key", Size.Big, entry.getKey()); iter.remove(); assertNotEquals("Wrong result", entry, mockEntry); assertEquals("Wrong size", 1, set.size()); try { iter.remove(); fail("Should throw IllegalStateException"); } catch (IllegalStateException e) {// Expected } try { iter.next(); fail("Should throw NoSuchElementException"); } catch (NoSuchElementException e) {// Expected } } @Test public void testKeySet() { EnumMap enumSizeMap = new EnumMap(Size.class); enumSizeMap.put(Size.Middle, 2); enumSizeMap.put(Size.Big, null); Set set = enumSizeMap.keySet(); Set set1 = enumSizeMap.keySet(); assertSame("Should be same", set1, set); try { set.add(Size.Big); fail("Should throw UnsupportedOperationException"); } catch (UnsupportedOperationException e) {// Expected } assertTrue("Returned false for contained object", set.contains(Size.Middle)); assertTrue("Returned false for contained object", set.contains(Size.Big)); assertFalse("Returned true for uncontained object", set.contains(Size.Small)); assertFalse("Returned true for uncontained object", set.contains(1)); assertTrue("Returned false when the object can be removed", set.remove(Size.Big)); assertFalse("Returned true for uncontained object", set.contains(Size.Big)); assertFalse("Returned true when the object can not be removed", set.remove(Size.Big)); assertFalse("Returned true when the object can not be removed", set.remove(1)); // The set is backed by the map so changes to one are reflected by the other. enumSizeMap.put(Size.Big, 3); assertTrue("Returned false for contained object", set.contains(Size.Big)); enumSizeMap.remove(Size.Big); assertFalse("Returned true for uncontained object", set.contains(Size.Big)); assertEquals("Wrong size", 1, set.size()); set.clear(); assertEquals("Wrong size", 0, 0); enumSizeMap = new EnumMap(Size.class); enumSizeMap.put(Size.Middle, 1); enumSizeMap.put(Size.Big, null); set = enumSizeMap.keySet(); Collection c = new ArrayList(); c.add(Size.Big); assertTrue("Should return true", set.containsAll(c)); c.add(Size.Small); assertFalse("Should return false", set.containsAll(c)); assertTrue("Should return true", set.removeAll(c)); assertEquals("Wrong size", 1, set.size()); assertFalse("Should return false", set.removeAll(c)); assertEquals("Wrong size", 1, set.size()); try { set.addAll(c); fail("Should throw UnsupportedOperationException"); } catch (UnsupportedOperationException e) {// Expected } enumSizeMap.put(Size.Big, null); assertEquals("Wrong size", 2, set.size()); assertTrue("Should return true", set.retainAll(c)); assertEquals("Wrong size", 1, set.size()); assertFalse("Should return false", set.retainAll(c)); assertEquals(1, set.size()); Object[] array = set.toArray(); assertEquals("Wrong length", 1, array.length); assertEquals("Wrong key", Size.Big, array[0]); enumSizeMap = new EnumMap(Size.class); enumSizeMap.put(Size.Middle, 1); enumSizeMap.put(Size.Big, null); set = enumSizeMap.keySet(); c = new ArrayList(); c.add(Color.Blue); assertFalse("Should return false", set.remove(c)); assertEquals("Wrong size", 2, set.size()); assertTrue("Should return true", set.retainAll(c)); assertEquals("Wrong size", 0, set.size()); enumSizeMap = new EnumMap(Size.class); enumSizeMap.put(Size.Middle, 1); enumSizeMap.put(Size.Big, null); set = enumSizeMap.keySet(); Iterator iter = set.iterator(); Enum enumKey = (Enum) iter.next(); assertTrue("Returned false for contained object", set.contains(enumKey)); enumKey = (Enum) iter.next(); assertTrue("Returned false for contained object", set.contains(enumKey)); enumSizeMap.remove(Size.Big); assertFalse("Returned true for uncontained object", set.contains(enumKey)); iter.remove(); try { iter.remove(); fail("Should throw IllegalStateException"); } catch (IllegalStateException e) {// Expected } assertFalse("Returned true for uncontained object", set.contains(enumKey)); iter = set.iterator(); enumKey = (Enum) iter.next(); assertTrue("Returned false for contained object", set.contains(enumKey)); enumSizeMap.put(Size.Middle, 3); assertTrue("Returned false for contained object", set.contains(enumKey)); enumSizeMap = new EnumMap(Size.class); enumSizeMap.put(Size.Middle, 1); enumSizeMap.put(Size.Big, null); set = enumSizeMap.keySet(); iter = set.iterator(); try { iter.remove(); fail("Should throw IllegalStateException"); } catch (IllegalStateException e) {// Expected } enumKey = (Enum) iter.next(); assertEquals("Wrong key", Size.Middle, enumKey); assertSame("Wrong key", Size.Middle, enumKey); assertNotEquals("Returned true for unequal object", iter, enumKey); iter.remove(); assertFalse("Returned true for uncontained object", set.contains(enumKey)); try { iter.remove(); fail("Should throw IllegalStateException"); } catch (IllegalStateException e) {// Expected } assertEquals("Wrong size", 1, set.size()); enumKey = (Enum) iter.next(); assertEquals("Wrong key", Size.Big, enumKey); iter.remove(); try { iter.next(); fail("Should throw NoSuchElementException"); } catch (NoSuchElementException e) {// Expected } } @Test public void testPut() { EnumMap enumSizeMap = new EnumMap(Size.class); try { enumSizeMap.put(Color.Red, 2); fail("Expected ClassCastException"); } catch (ClassCastException e) {// Expected } assertNull("Return non-null for non mapped key", enumSizeMap.put(Size.Small, 1)); EnumMap enumColorMap = new EnumMap<Color, Double>(Color.class); try { enumColorMap.put(Size.Big, 2); fail("Expected ClassCastException"); } catch (ClassCastException e) {// Expected } try { enumColorMap.put(null, 2); fail("Expected NullPointerException"); } catch (NullPointerException e) {// Expected } assertNull("Return non-null for non mapped key", enumColorMap.put(Color.Green, 2)); assertEquals("Return wrong value", 2, enumColorMap.put(Color.Green, 4.0)); assertEquals("Return wrong value", 4.0, enumColorMap.put(Color.Green, 3)); assertEquals("Return wrong value", 3, enumColorMap.put(Color.Green, null)); Float f = (float) 3.4; assertNull("Return non-null for non mapped key", enumColorMap.put(Color.Green, f)); assertNull("Return non-null for non mapped key", enumColorMap.put(Color.Blue, 2)); assertEquals("Return wrong value", 2, enumColorMap.put(Color.Blue, 4.0)); } @Test public void testRemove() { EnumMap enumSizeMap = new EnumMap(Size.class); assertNull("Remove of non-mapped key returned non-null", enumSizeMap.remove(Size.Big)); enumSizeMap.put(Size.Big, 3); enumSizeMap.put(Size.Middle, 2); assertNull("Get returned non-null for non mapped key", enumSizeMap.get(Size.Small)); assertEquals("Remove returned incorrect value", 3, enumSizeMap.remove(Size.Big)); assertNull("Get returned non-null for non mapped key", enumSizeMap.get(Size.Big)); assertNull("Remove of non-mapped key returned non-null", enumSizeMap.remove(Size.Big)); assertNull("Remove of non-existent key returned non-null", enumSizeMap.remove(Color.Red)); assertNull("Remove of non-existent key returned non-null", enumSizeMap.remove(4.0)); assertNull("Remove of non-existent key returned non-null", enumSizeMap.remove(null)); EnumMap enumColorMap = new EnumMap<Color, Double>(Color.class); assertNull("Get returned non-null for non mapped key", enumColorMap.get(Color.Green)); enumColorMap.put(Color.Green, 4.0); assertEquals("Remove returned incorrect value", 4.0, enumColorMap.remove(Color.Green)); assertNull("Get returned non-null for non mapped key", enumColorMap.get(Color.Green)); enumColorMap.put(Color.Green, null); assertNull("Can not handle null value", enumColorMap.remove(Color.Green)); assertNull("Get returned non-null for non mapped key", enumColorMap.get(Color.Green)); } @Test public void testSize() { EnumMap enumSizeMap = new EnumMap(Size.class); assertEquals("Wrong size", 0, enumSizeMap.size()); enumSizeMap.put(Size.Small, 1); assertEquals("Wrong size", 1, enumSizeMap.size()); enumSizeMap.put(Size.Small, 0); assertEquals("Wrong size", 1, enumSizeMap.size()); try { enumSizeMap.put(Color.Red, 2); fail("Expected ClassCastException"); } catch (ClassCastException e) {// Expected } assertEquals("Wrong size", 1, enumSizeMap.size()); enumSizeMap.put(Size.Middle, null); assertEquals("Wrong size", 2, enumSizeMap.size()); enumSizeMap.remove(Size.Big); assertEquals("Wrong size", 2, enumSizeMap.size()); enumSizeMap.remove(Size.Middle); assertEquals("Wrong size", 1, enumSizeMap.size()); enumSizeMap.remove(Color.Green); assertEquals("Wrong size", 1, enumSizeMap.size()); EnumMap enumColorMap = new EnumMap<Color, Double>(Color.class); enumColorMap.put(Color.Green, 2); assertEquals("Wrong size", 1, enumColorMap.size()); enumColorMap.remove(Color.Green); assertEquals("Wrong size", 0, enumColorMap.size()); EnumMap enumEmptyMap = new EnumMap<Empty, Double>(Empty.class); assertEquals("Wrong size", 0, enumEmptyMap.size()); } @Test public void testValues() { EnumMap enumColorMap = new EnumMap<Color, Double>(Color.class); enumColorMap.put(Color.Red, 1); enumColorMap.put(Color.Blue, null); Collection collection = enumColorMap.values(); Collection collection1 = enumColorMap.values(); assertSame("Should be same", collection1, collection); try { collection.add(1); fail("Should throw UnsupportedOperationException"); } catch (UnsupportedOperationException e) {// Expected } assertTrue("Returned false for contained object", collection.contains(1)); assertTrue("Returned false for contained object", collection.contains(null)); assertFalse("Returned true for uncontained object", collection.contains(2)); assertTrue("Returned false when the object can be removed", collection.remove(null)); assertFalse("Returned true for uncontained object", collection.contains(null)); assertFalse("Returned true when the object can not be removed", collection.remove(null)); // The set is backed by the map so changes to one are reflected by the other. enumColorMap.put(Color.Blue, 3); assertTrue("Returned false for contained object", collection.contains(3)); enumColorMap.remove(Color.Blue); assertFalse("Returned true for uncontained object", collection.contains(3)); assertEquals("Wrong size", 1, collection.size()); collection.clear(); assertEquals("Wrong size", 0, 0); enumColorMap = new EnumMap<Color, Double>(Color.class); enumColorMap.put(Color.Red, 1); enumColorMap.put(Color.Blue, null); collection = enumColorMap.values(); Collection c = new ArrayList(); c.add(1); assertTrue("Should return true", collection.containsAll(c)); c.add(3.4); assertFalse("Should return false", collection.containsAll(c)); assertTrue("Should return true", collection.removeAll(c)); assertEquals("Wrong size", 1, collection.size()); assertFalse("Should return false", collection.removeAll(c)); assertEquals("Wrong size", 1, collection.size()); try { collection.addAll(c); fail("Should throw UnsupportedOperationException"); } catch (UnsupportedOperationException e) {// Expected } enumColorMap.put(Color.Red, 1); assertEquals("Wrong size", 2, collection.size()); assertTrue("Should return true", collection.retainAll(c)); assertEquals("Wrong size", 1, collection.size()); assertFalse("Should return false", collection.retainAll(c)); assertEquals(1, collection.size()); Object[] array = collection.toArray(); assertEquals("Wrong length", 1, array.length); assertEquals("Wrong key", 1, array[0]); enumColorMap = new EnumMap<Color, Double>(Color.class); enumColorMap.put(Color.Red, 1); enumColorMap.put(Color.Blue, null); collection = enumColorMap.values(); assertEquals("Wrong size", 2, collection.size()); assertFalse("Returned true when the object can not be removed", collection.remove(10)); Iterator iter = enumColorMap.values().iterator(); Object value = iter.next(); assertTrue("Returned false for contained object", collection.contains(value)); value = iter.next(); assertTrue("Returned false for contained object", collection.contains(value)); enumColorMap.put(Color.Green, 1); enumColorMap.remove(Color.Blue); assertFalse("Returned true for uncontained object", collection.contains(value)); iter.remove(); try { iter.remove(); fail("Should throw IllegalStateException"); } catch (IllegalStateException e) {// Expected } assertFalse("Returned true for uncontained object", collection.contains(value)); iter = enumColorMap.values().iterator(); value = iter.next(); assertTrue("Returned false for contained object", collection.contains(value)); enumColorMap.put(Color.Green, 3); assertTrue("Returned false for contained object", collection.contains(value)); assertTrue("Returned false for contained object", collection.remove(1)); assertEquals("Wrong size", 1, collection.size()); collection.clear(); assertSame("Wrong size", 0, 0); enumColorMap = new EnumMap<Color, Double>(Color.class); Integer integer1 = 1; enumColorMap.put(Color.Green, integer1); enumColorMap.put(Color.Blue, null); collection = enumColorMap.values(); iter = enumColorMap.values().iterator(); try { iter.remove(); fail("Should throw IllegalStateException"); } catch (IllegalStateException e) {// Expected } value = iter.next(); assertEquals("Wrong value", integer1, value); assertSame("Wrong value", integer1, value); assertNotEquals("Returned true for unequal object", iter, value); iter.remove(); assertNotEquals("Returned true for unequal object", iter, value); try { iter.remove(); fail("Should throw IllegalStateException"); } catch (IllegalStateException e) {// Expected } assertEquals("Wrong size", 1, collection.size()); value = iter.next(); assertNotEquals("Returned true for unequal object", iter, value); iter.remove(); try { iter.next(); fail("Should throw NoSuchElementException"); } catch (NoSuchElementException e) {// Expected } } private static class MockEntry<K, V> implements Map.Entry<K, V> { private final K key; private V value; public MockEntry(K key, V value) { this.key = key; this.value = value; } @Override public int hashCode() { return (key == null ? 0 : key.hashCode()) ^ (value == null ? 0 : value.hashCode()); } public K getKey() { return key; } public V getValue() { return value; } public V setValue(V object) { V oldValue = value; value = object; return oldValue; } } }
[ "dovbushb@gmail.com" ]
dovbushb@gmail.com
626d1ea9535793915977738390b22ed64be8bd85
5f2fb08c46b2acdfe52583cf95925325b36c6820
/skWeiChatBaidu/src/main/java/com/xfyyim/cn/ui/mucfile/ThreadPoolProxy.java
9cec04526be202219565c9f25a7578cf658c8eb8
[]
no_license
309925753/xinfuyouyue
7324fb7062c126156ee350a0e14b8b18bed7afe6
0bc8f8bb387d2203b74af05bfcc6733cde51cda2
refs/heads/master
2022-11-30T23:46:53.082249
2020-05-19T11:48:55
2020-05-19T11:48:55
287,436,362
3
6
null
null
null
null
UTF-8
Java
false
false
2,998
java
package com.xfyyim.cn.ui.mucfile; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; /** * @author liuxuan * @time 2017-7-7 14:39:11 * @des 创建线程池, 执行任务, 提交任务 */ public class ThreadPoolProxy { ThreadPoolExecutor mExecutor; int mCorePoolSize = 3; int mMaximumPoolSize = 3; long mKeepAliveTime = 1800; TimeUnit mUnit = TimeUnit.SECONDS; private ThreadPoolProxy(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit) { super(); mCorePoolSize = corePoolSize; mMaximumPoolSize = maximumPoolSize; mKeepAliveTime = keepAliveTime; mUnit = unit; } private static volatile ThreadPoolProxy instance = null; public static ThreadPoolProxy getInstance() { synchronized (ThreadPoolProxy.class) { if (instance == null) { instance = new ThreadPoolProxy(3, 3, 3000, TimeUnit.MILLISECONDS); } } return instance; } private ThreadPoolExecutor initThreadPoolExecutor() { // 双重检查加锁 if (mExecutor == null) { synchronized (ThreadPoolProxy.class) { if (mExecutor == null) { BlockingQueue<Runnable> workQueue = new LinkedBlockingQueue<Runnable>();// 无界队列 /* ThreadFactory threadFactory = Executors.defaultThreadFactory(); RejectedExecutionHandler handler = new ThreadPoolExecutor.AbortPolicy(); mExecutor = new ThreadPoolExecutor( mCorePoolSize, // 核心线程数 mMaximumPoolSize,// 最大的线程数 mKeepAliveTime, // 非核心线程超时时长(存活时长) mUnit, // 超时时间单位 workQueue, // 线程池中的任务队列 ); */ mExecutor = new ThreadPoolExecutor( mCorePoolSize, // 核心线程数 mMaximumPoolSize,// 最大的线程数 mKeepAliveTime, // 非核心线程超时时长(存活时长) mUnit, // 超时时间单位 workQueue // 线程池中的任务队列 ); // mExecutor.allowCoreThreadTimeOut(true);// 核心线程也存在超时策略 } } } return mExecutor; } /** * 执行任务 */ public void execute(Runnable task) { initThreadPoolExecutor(); mExecutor.execute(task); } /** * 移除任务 */ public void removeTask(Runnable task) { initThreadPoolExecutor(); mExecutor.remove(task); } }
[ "309925753@qq.com" ]
309925753@qq.com
53157088d1815d9dc64de548c6ce59e013342c50
5c47ecb4549223481b7907b74ce7d1041271ac42
/as_code/app/src/main/java/com/ahdi/wallet/cashier/ui/activities/PayModeSelectActivity.java
4e99475b9b1ca9d61d769bce46ce1841d0ed3b2f
[]
no_license
eddy151310/VVVV
e0eaa7257ea59e7c81621791e919847b643b6777
20ea13bc581bfe84453cf2921bde26df834cb1c4
refs/heads/master
2020-07-10T05:21:36.972130
2019-08-29T12:05:23
2019-08-29T12:05:23
204,171,847
0
0
null
null
null
null
UTF-8
Java
false
false
12,767
java
package com.ahdi.wallet.cashier.ui.activities; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.text.TextUtils; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.TextView; import com.ahdi.wallet.R; import com.ahdi.wallet.app.sdk.BankCardSdk; import com.ahdi.wallet.cashier.PayCashierSdk; import com.ahdi.wallet.cashier.RechrCashierSdk; import com.ahdi.wallet.cashier.main.RechrCashierMain; import com.ahdi.wallet.app.callback.BankCardSdkCallBack; import com.ahdi.wallet.cashier.callback.PaymentSdkCallBack; import com.ahdi.wallet.app.main.CashierPricing; import com.ahdi.wallet.cashier.main.PayCashierMain; import com.ahdi.wallet.cashier.response.pay.PricingResponse; import com.ahdi.wallet.cashier.response.rechr.RechrListQueryRsp; import com.ahdi.wallet.cashier.schemas.PayTypeSchema; import com.ahdi.wallet.cashier.ui.adapter.CashierPayModeSelectAdapter; import com.ahdi.wallet.app.utils.ConstantsPayment; import com.ahdi.lib.utils.base.ActivityManager; import com.ahdi.lib.utils.config.Constants; import com.ahdi.lib.utils.listener.OnItemClickListener; import com.ahdi.lib.utils.utils.LogUtil; import com.ahdi.lib.utils.widgets.dialog.LoadingDialog; import org.json.JSONObject; import java.util.List; /** * 选择支付/充值方式列表界面 */ public class PayModeSelectActivity extends PayBaseActivity { private static final String TAG = PayModeSelectActivity.class.getSimpleName(); //title back + close private static final int RES_ID_BACK_CLOSE = R.drawable.selector_btn_title_close; private static final int RES_ID_BACK_BACK = R.drawable.selector_btn_title_back; public static final int TITLE_LEFT_ICON_CLOSE = 0; public static final int TITLE_LEFT_ICON_BACK = 1; public static final int RESULT_CODE_CLOSE_PAY_MODE = 3; private ImageView imageViewBack; private RecyclerView enableListView, blockListView; private TextView tv_card_balance_not_enough; private View ll_text_tips; private int mPosition; private String TT; private String errorMsg; private int close; // 0: 左上角显示关闭 X 1: 左上角显示返回 < private int height; private int from; private int touchFlag = -100; private Context mContext; private String rechrEdtAmount; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (isMemoryRecover(savedInstanceState)) { return; } initIntentData(getIntent()); setContentView(R.layout.dialog_activity_select_pay_mode); mContext = this; initTitleView(); initView(); } public void initTitleView() { TextView tv_title = findViewById(R.id.tv_title); tv_title.setText(getString(R.string.SDKPayTypeList_A0)); imageViewBack = findViewById(R.id.btn_back); imageViewBack.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (!isCanClick()) { return; } onBack(); } }); } private void initView() { initRootViewHeight(); enableListView = findViewById(R.id.payType_list); blockListView = findViewById(R.id.payType_list_block); findViewById(R.id.layout_add_card_view).setOnClickListener(this); tv_card_balance_not_enough = findViewById(R.id.tv_card_balance_not_enough); ll_text_tips = findViewById(R.id.ll_text_tips); initErrorTips(); initListData(); } private void initIntentData(Intent intent) { if (intent == null) { return; } mPosition = intent.getIntExtra(Constants.LOCAL_ID_KEY, -1); TT = intent.getStringExtra(Constants.LOCAL_TT_KEY); errorMsg = intent.getStringExtra(Constants.MSG_KEY); height = intent.getIntExtra(Constants.LOCAL_HEIGHT_KEY, 0); from = intent.getIntExtra(Constants.LOCAL_FROM_KEY, -1); rechrEdtAmount = intent.getStringExtra("rechrEdtAmountKey"); } /** * 初始化支付方式列表: 包括可用和不可用 */ public void initListData() { List<PayTypeSchema> enablePayTypes = CashierPricing.getInstance(mContext).getEnablePayTypes(); if (enablePayTypes != null && enablePayTypes.size() > 0) { close = TITLE_LEFT_ICON_BACK; } else { close = TITLE_LEFT_ICON_CLOSE; } // 首先初始化可用支付方式列表, 根据列表的size是否大于0, 设置title的左边icon X 或者 < initTitleLeftBtn(); // 解决ScrollView嵌套RecyclerView滑动卡顿问题 enableListView.setLayoutManager(new LinearLayoutManager(mContext) { @Override public boolean canScrollVertically() { return false; } }); CashierPayModeSelectAdapter enableAdapter = new CashierPayModeSelectAdapter(mContext, enablePayTypes, mPosition); enableListView.setAdapter(enableAdapter); enableAdapter.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(View view, int position) { mPosition = position; onBack(); } }); List<PayTypeSchema> blockPayTypes = CashierPricing.getInstance(mContext).getUnablePayTypes(); // 解决ScrollView嵌套RecyclerView滑动卡顿问题 blockListView.setLayoutManager(new LinearLayoutManager(mContext) { @Override public boolean canScrollVertically() { return false; } }); CashierPayModeSelectAdapter blockAdapter = new CashierPayModeSelectAdapter(mContext, blockPayTypes, mPosition); blockListView.setAdapter(blockAdapter); blockAdapter.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(View view, int position) { mPosition = position; onBack(); } }); } /** * 初始化title左上角按钮图片 */ private void initTitleLeftBtn() { if (close == TITLE_LEFT_ICON_CLOSE) { imageViewBack.setImageResource(RES_ID_BACK_CLOSE); } else { imageViewBack.setImageResource(RES_ID_BACK_BACK); } } /** * 初始化错误提示文案 */ private void initErrorTips() { if (!TextUtils.isEmpty(errorMsg)) { tv_card_balance_not_enough.setText(errorMsg); ll_text_tips.setVisibility(View.VISIBLE); } else { ll_text_tips.setVisibility(View.GONE); } } private void initRootViewHeight() { RelativeLayout bg_view = findViewById(R.id.bg_view); ViewGroup.LayoutParams layoutParams = bg_view.getLayoutParams(); layoutParams.height = height; bg_view.setLayoutParams(layoutParams); bg_view.setBackgroundResource(R.drawable.bg_dialog_payhub_title); } @Override public void onClick(View view) { if (!isCanClick()) { return; } if (view.getId() == R.id.layout_add_card_view) { // 绑卡流程 onBindBankCard(); } } /** * 绑定银行卡 */ private void onBindBankCard() { BankCardSdk.bindCard(this, getSid(), new BankCardSdkCallBack() { @Override public void onResult(String code, String errorMsg, JSONObject jsonObject) { if (TextUtils.equals(code, BankCardSdk.LOCAL_PAY_SUCCESS)) { LogUtil.e(TAG, "------绑定银行卡成功, 重新批价/重新查询支付方式------"); if (from == Constants.LOCAL_FROM_PAY) { // 重新批价 rePricing(); } else if (from == Constants.LOCAL_FROM_TOP_UP) { // 重新查询支付方式 reQueryRechrType(); } } else { LogUtil.e(TAG, "code: " + code); } } }); } private String getSid() { String sid = ""; if (from == Constants.LOCAL_FROM_PAY) { sid = PayCashierMain.getInstance().sid; } else if (from == Constants.LOCAL_FROM_TOP_UP) { sid = RechrCashierMain.getInstance().sid; } return sid; } /** * 绑卡成功之后 重新批价 */ private void rePricing() { if (TextUtils.isEmpty(TT)) { LogUtil.e(TAG, "rePricing TT = null"); return; } LoadingDialog loadingDialog = showLoading(); PayCashierMain.getInstance().restartPay(mContext, TT, new PaymentSdkCallBack() { @Override public void onResult(String code, String errorMsg, JSONObject jsonObject) { closeLoading(loadingDialog); if (TextUtils.equals(PayCashierSdk.LOCAL_PAY_SUCCESS, code)) { PricingResponse resp = PricingResponse.decodeJson(PricingResponse.class, jsonObject); // 刷新支付方式列表数据 CashierPricing.getInstance(mContext).notifyPricingResponse(resp); mPosition = 0; // 更新支付方式列表和标题栏左边按钮 initListData(); if (resp != null) { touchFlag = resp.touchFlag; } } else { PayCashierMain.getInstance().onResultBack(mContext, code, errorMsg, jsonObject, ConstantsPayment.PayResult_OTHER); onExitPayHub(errorMsg); } } }); } /** * 重新查询支付方式 */ private void reQueryRechrType() { if (TextUtils.isEmpty(rechrEdtAmount)) { LogUtil.e(TAG, "rechrEdtAmount is null"); return; } LoadingDialog loadingDialog = showLoading(); RechrCashierMain.getInstance().onReQueryRechrMode(mContext, rechrEdtAmount, true, new RechrCashierMain.OnReTopUpCallback() { @Override public void onCallback(String retCode, String errorMsg, JSONObject json) { closeLoading(loadingDialog); RechrListQueryRsp resp = RechrListQueryRsp.decodeJson(RechrListQueryRsp.class, json); if (TextUtils.equals(retCode, RechrCashierSdk.LOCAL_PAY_SUCCESS)) { CashierPricing.getInstance(mContext).notifyQueryChargeListResponse(resp); initListData(); mPosition = 0; if (resp != null) { touchFlag = resp.TouchFlag; } } else { RechrCashierMain.getInstance().onResultBack(retCode, errorMsg, null, "", ConstantsPayment.PayResult_OTHER, ""); onExitPayHub(errorMsg); } } }); } private void onBack() { Intent intent = new Intent(); if (close == TITLE_LEFT_ICON_BACK) { intent.putExtra(Constants.LOCAL_POSITION_KEY, mPosition); intent.putExtra("TouchFlag", touchFlag); setResult(RESULT_CODE_CLOSE_PAY_MODE, intent); finish(); onCloseLeftToRightActivity(); } else if (close == TITLE_LEFT_ICON_CLOSE) { if (from == Constants.LOCAL_FROM_PAY) { PayCashierMain.getInstance().onResultBack(mContext, PayCashierSdk.LOCAL_PAY_USER_CANCEL, PayCashierSdk.USER_CANCEL, null, ConstantsPayment.PayResult_OTHER); } else if (from == Constants.LOCAL_FROM_TOP_UP) { RechrCashierMain.getInstance().onResultBack(RechrCashierSdk.LOCAL_PAY_USER_CANCEL, RechrCashierSdk.USER_CANCEL, null, "", ConstantsPayment.PayResult_OTHER, ""); } ActivityManager.getInstance().finishPayHubActivity(); finish(); onBottom_out_Activity(); } } @Override public void onBackPressed() { onBack(); } private void onExitPayHub(String errorMsg) { ActivityManager.getInstance().finishPayHubActivity(); LogUtil.e(TAG, "errorMsg: " + errorMsg); finish(); onBottom_out_Activity(); } }
[ "258131820@qq.com" ]
258131820@qq.com
8325ffd4195b262b751961750ed0c1b288e55dac
7755d0fd3e0e45a9306c96e1c9fb2834cf93cf49
/src/main/java/s2gx/task/Processor.java
4de16fb888368f0ec56d5144c707b1ea71af6fd9
[]
no_license
chandanws/java-concurrency-3
925963f71382a43d980cfdcf03baa6d10b72ba6e
5d3e208b3780eb0d3985e79a3ad65c2b04a282da
refs/heads/master
2022-12-26T08:01:34.670419
2020-09-08T21:44:50
2020-09-08T21:44:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
84
java
package s2gx.task; public interface Processor { String process(String input); }
[ "sanghyuk.jung@navercorp.com" ]
sanghyuk.jung@navercorp.com
148f5100df4cba6596cb6cfe46f5eb6168f18857
7510960e0a6aea5206de97081fce823e282d6ca8
/monitorstat-common/src/main/java/com/taobao/monitor/common/db/impl/center/HostDao.java
7060adaaf12eb0e9564ea1fd3f7291772baa29da
[]
no_license
sjywying/csp
ef8e348e2866643562edefc8b190e4994f3308ce
c4c858dd0b91dc41be4dd00b639601d23db8fd3a
refs/heads/master
2021-01-18T10:01:02.744898
2013-08-05T06:36:38
2013-08-05T06:36:38
null
0
0
null
null
null
null
GB18030
Java
false
false
19,615
java
package com.taobao.monitor.common.db.impl.center; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import org.apache.log4j.Logger; import com.taobao.monitor.common.db.base.MysqlRouteBase; import com.taobao.monitor.common.po.AppInfoPo; import com.taobao.monitor.common.po.HostPo; /** * 主机的DAO * * @author wuhaiqian.pt * */ public class HostDao extends MysqlRouteBase { private static final Logger logger = Logger.getLogger(HostDao.class); /** * 添加addHostData * * @param hostPo */ public boolean addHostData(HostPo hostPo) { try { String sql = "insert into MS_MONITOR_HOST " + "(APP_ID, HOST_IP, HOST_SITE,HOST_NAME, SAVE_DATA,user_name,user_psw) values(?,?,?,?,?,?,?)"; this.execute(sql, new Object[] { hostPo.getAppId(), hostPo.getHostIp(), hostPo.getHostSite(), hostPo.getHostName(), hostPo.getSavedata(), hostPo.getUserName(), hostPo.getUserPassword() }); } catch (Exception e) { logger.error("addHostData 出错,", e); return false; } return true; } /** * 添加hostList * * @param hostList */ public boolean addHostList(List<HostPo> hostList) { try { for (HostPo hostPo : hostList) { if (!isExistHostByHostIpAndAppId(hostPo.getAppId(), hostPo .getHostIp())) { String sql = "insert into MS_MONITOR_HOST " + "(APP_ID, HOST_IP, HOST_SITE,HOST_NAME, SAVE_DATA,user_name,user_psw) values(?,?,?,?,?,?,?)"; this.execute(sql, new Object[] { hostPo.getAppId(), hostPo.getHostIp(), hostPo.getHostSite(), hostPo.getHostName(), hostPo.getSavedata(), hostPo.getUserName(), hostPo.getUserPassword() }); } } } catch (Exception e) { logger.error("addHostList 出错,", e); return false; } return true; } /** *@author wb-lixing 2012-3-8 下午06:56:34 *@param hostList *@return */ public boolean addHostListSync(List<HostPo> hostList) { try { String sql = "insert into csp_app_host_info_sync" + "(ops_name, NODEGROUP, dns_ip, nodename, site, rack, hdrs_chassis, state, model, description, vmparent, csp_version) values(?,?,?,?,?, ?,?,?,?,? ,?,?)"; List<Object[]> params = new ArrayList<Object[]>(); for (HostPo hostPo : hostList) { Object[] param = new Object[] { hostPo.getOpsName(), hostPo.getNodeGroup(), hostPo.getHostIp(), hostPo.getHostName(), hostPo.getHostSite(), hostPo.getRack(), hostPo.getHdrs_chassis(), hostPo.getState(), hostPo.getHostType(), hostPo.getDescription(), hostPo.getVmparent(), hostPo.getCpsVersion() }; params.add(param); } this.executeBatch(sql, params); } catch (Exception e) { logger.error("addHostList 出错,", e); return false; } return true; } /** * 删除HostPo * * @param appId */ public boolean deleteHostData(int appId) { String sql = "delete from MS_MONITOR_HOST where APP_ID=?"; try { this.execute(sql, new Object[] { appId }); } catch (SQLException e) { logger.error("deleteHostData: ", e); return false; } return true; } /** * 删除HostPo * * @param hostId */ public boolean deleteHostbyHostId(int hostId) { String sql = "delete from MS_MONITOR_HOST where Host_ID=?"; try { this.execute(sql, new Object[] { hostId }); } catch (SQLException e) { logger.error("deleteHostData: ", e); return false; } return true; } /** * 删除HostPo * * @param hostIdList */ public boolean deleteHostList(String[] hostIdList) { String sql = "delete from MS_MONITOR_HOST where Host_ID=?"; try { for (String hostId : hostIdList) { this.execute(sql, new Object[] { Integer.parseInt(hostId) }); } } catch (SQLException e) { logger.error("deleteHostList: ", e); return false; } return true; } /** *@author wb-lixing 2012-3-8 下午07:31:18 */ public boolean deleteHostListSyncByOpsName(String opsName) { String sql = "delete from csp_app_host_info_sync where ops_name=?"; try { this.execute(sql, new Object[] { opsName }); } catch (SQLException e) { logger.error("deleteHostList: ", e); return false; } return true; } /** *@author wb-lixing 2012-3-8 下午07:31:18 */ public boolean deleteHostListSync(String[] ipList) { String sql = "delete from csp_app_host_info_sync where dns_ip=?"; try { List<Object[]> params = new ArrayList<Object[]>(); for (String ip : ipList) { Object[] param = new Object[] { ip }; params.add(param); } this.executeBatch(sql, params); } catch (SQLException e) { logger.error("deleteHostList: ", e); return false; } return true; } public boolean deleteHostData(HostPo hostPo) { String sql = "delete from MS_MONITOR_HOST where APP_ID=?"; try { this.execute(sql, new Object[] { hostPo.getAppId() }); } catch (SQLException e) { logger.error("deleteHostData: ", e); return false; } return true; } /** * 根据hostIp查询host是否存在 * * @return */ public boolean isExistHostByHostIp(String hostIp) { String sql = "select * from MS_MONITOR_HOST where host_ip=?"; final HostPo po = new HostPo(); try { this.query(sql, new Object[] { hostIp }, new SqlCallBack() { public void readerRows(ResultSet rs) throws Exception { po.setAppId(rs.getInt("app_id")); po.setHostIp(rs.getString("host_ip")); po.setHostName(rs.getString("HOST_NAME")); po.setSavedata(rs.getString("SAVE_DATA")); po.setHostId(rs.getInt("host_id")); po.setHostSite(rs.getString("host_site")); } }); } catch (Exception e) { logger.error("findAllHost出错", e); } if (null == po.getHostIp() || po.getHostIp().equals("")) { return false; } return true; } /** * 根据hostid返回hostPo * * @param hostId * @return */ public HostPo findHostByHostId(int hostId) { String sql = "select * from MS_MONITOR_HOST where host_id=?"; final HostPo po = new HostPo(); try { this.query(sql, new Object[] { hostId }, new SqlCallBack() { public void readerRows(ResultSet rs) throws Exception { po.setAppId(rs.getInt("app_id")); po.setHostIp(rs.getString("host_ip")); po.setHostName(rs.getString("HOST_NAME")); po.setSavedata(rs.getString("SAVE_DATA")); po.setHostId(rs.getInt("host_id")); po.setHostSite(rs.getString("host_site")); po.setUserName(rs.getString("user_name")); po.setUserPassword(rs.getString("user_psw")); } }); } catch (Exception e) { logger.error("findAllHost出错", e); } return po; } /** * 返回持久表的个数 * * @return */ public int sumOfSaveData(int appId) { String sql = "select * from MS_MONITOR_HOST where app_id=?"; final List<HostPo> hostPoList = new ArrayList<HostPo>(); int num = 0; try { this.query(sql, new Object[] { appId }, new SqlCallBack() { public void readerRows(ResultSet rs) throws Exception { HostPo po = new HostPo(); po.setAppId(rs.getInt("app_id")); po.setHostIp(rs.getString("host_ip")); po.setHostName(rs.getString("HOST_NAME")); po.setSavedata(rs.getString("SAVE_DATA")); po.setHostId(rs.getInt("host_id")); po.setHostSite(rs.getString("host_site")); po.setUserName(rs.getString("user_name")); po.setUserPassword(rs.getString("user_psw")); hostPoList.add(po); } }); } catch (Exception e) { logger.error("findAllHost出错", e); } for (HostPo p : hostPoList) { // saveData : 第一位 表示只保存 limit ,第二位表示保存data ,0为不保存,1为保存 String saveData = p.getSavedata(); char save = saveData.charAt(1); if (save == '1') { num++; } } return num; } /** * 根据hostIp和AppId查询host是否存在 * * @return */ public boolean isExistHostByHostIpAndAppId(int appId, String hostIp) { String sql = "select * from MS_MONITOR_HOST where host_ip=? and app_id=?"; final HostPo po = new HostPo(); try { this.query(sql, new Object[] { hostIp, appId }, new SqlCallBack() { public void readerRows(ResultSet rs) throws Exception { po.setAppId(rs.getInt("app_id")); po.setHostIp(rs.getString("host_ip")); po.setHostName(rs.getString("HOST_NAME")); po.setSavedata(rs.getString("SAVE_DATA")); po.setHostId(rs.getInt("host_id")); po.setHostSite(rs.getString("host_site")); } }); } catch (Exception e) { logger.error("findAllHost出错", e); } if (null == po.getHostIp() || po.getHostIp().equals("")) { return false; } return true; } /** * 获取全部HostPo * * @return */ public List<HostPo> findAllHost() { String sql = "select * from MS_MONITOR_HOST"; final List<HostPo> hostPoList = new ArrayList<HostPo>(); try { this.query(sql, new SqlCallBack() { public void readerRows(ResultSet rs) throws Exception { HostPo po = new HostPo(); po.setAppId(rs.getInt("app_id")); po.setHostIp(rs.getString("host_ip")); po.setHostName(rs.getString("HOST_NAME")); po.setSavedata(rs.getString("SAVE_DATA")); po.setHostId(rs.getInt("host_id")); po.setHostSite(rs.getString("host_site")); po.setUserName(rs.getString("user_name")); po.setUserPassword(rs.getString("user_psw")); hostPoList.add(po); } }); } catch (Exception e) { logger.error("findAllHost出错", e); } return hostPoList; } /** * 根据appId获得全部相关的HostPo * * @return */ public List<HostPo> findAllHostByAppId(int appId) { String sql = "select * from MS_MONITOR_HOST where app_id=?"; final List<HostPo> hostPoList = new ArrayList<HostPo>(); try { this.query(sql, new Object[] { appId }, new SqlCallBack() { public void readerRows(ResultSet rs) throws Exception { HostPo po = new HostPo(); po.setAppId(rs.getInt("app_id")); po.setHostIp(rs.getString("host_ip")); po.setHostName(rs.getString("HOST_NAME")); po.setSavedata(rs.getString("SAVE_DATA")); po.setHostId(rs.getInt("host_id")); po.setHostSite(rs.getString("host_site")); po.setUserName(rs.getString("user_name")); po.setUserPassword(rs.getString("user_psw")); hostPoList.add(po); } }); } catch (Exception e) { logger.error("findAllHost出错", e); } return hostPoList; } /** * 根据appId返回包含有对应包含HostList的AppInfoPo * * @return */ public AppInfoPo findAppWithHostListByAppId(int appId) { String sql = "select a.*, h.* from MS_MONITOR_APP a, MS_MONITOR_HOST h where a.app_id = h.app_id and a.app_id =?"; final List<HostPo> hostList = new ArrayList<HostPo>(); final AppInfoPo appPo = new AppInfoPo(); try { this.query(sql, new Object[] { appId }, new SqlCallBack() { public void readerRows(ResultSet rs) throws Exception { HostPo po = new HostPo(); appPo.setAppId(rs.getInt("APP_ID")); appPo.setAppName(rs.getString("APP_NAME")); appPo.setFeature(rs.getString("feature")); appPo.setSortIndex(rs.getInt("SORT_INDEX")); appPo.setOpsName(rs.getString("OPS_NAME")); appPo.setGroupName(rs.getString("GROUP_NAME")); appPo.setDayDeploy(rs.getInt("day_deploy")); appPo.setTimeDeploy(rs.getInt("time_deploy")); appPo.setAppStatus(rs.getInt("app_status")); po.setAppId(rs.getInt("h.app_id")); po.setHostIp(rs.getString("h.host_ip")); po.setHostName(rs.getString("h.HOST_NAME")); po.setSavedata(rs.getString("h.SAVE_DATA")); po.setHostId(rs.getInt("h.host_id")); po.setHostSite(rs.getString("h.host_site")); po.setUserName(rs.getString("h.user_name")); po.setUserPassword(rs.getString("h.user_psw")); hostList.add(po); } }); appPo.setHostList(hostList); } catch (Exception e) { logger.error("findHostById出错", e); } return appPo; } /** * 获取全部HostPo * * @return */ public List<HostPo> findAppAllHost(int appId) { String sql = "select * from MS_MONITOR_HOST where app_id = ?"; final List<HostPo> hostPoList = new ArrayList<HostPo>(); try { this.query(sql, new Object[] { appId }, new SqlCallBack() { public void readerRows(ResultSet rs) throws Exception { HostPo po = new HostPo(); po.setAppId(rs.getInt("app_id")); po.setHostIp(rs.getString("host_ip")); po.setHostName(rs.getString("HOST_NAME")); po.setSavedata(rs.getString("SAVE_DATA")); po.setHostId(rs.getInt("host_id")); po.setHostSite(rs.getString("host_site")); po.setUserName(rs.getString("user_name")); po.setUserPassword(rs.getString("user_psw")); hostPoList.add(po); } }); } catch (Exception e) { logger.error("findAllHost出错", e); } return hostPoList; } /** * 根据HostPo更新 * * @param HostPo * @return */ public boolean updateHostInfo(HostPo hostPo) { String sql = "update MS_MONITOR_HOST set app_id=?,host_ip=?,HOST_NAME=?,SAVE_DATA=?, host_site=? where host_id=? "; try { this.execute(sql, new Object[] { hostPo.getAppId(), hostPo.getHostIp(), hostPo.getHostName(), hostPo.getSavedata(), hostPo.getHostSite(), hostPo.getHostId() }); } catch (SQLException e) { logger.error("updateHostInfo出错", e); return false; } return true; } /*****************************************************/ public boolean addSyncPeSystemHostInfo(HostPo hostPo, int version) { String sql = "insert into CSP_APP_HOST_INFO_SYNC" + "(ops_name,nodegroup,dns_ip,nodename,site,rack,hdrs_chassis,state,model,description,vmparent,manifest,csp_version) values(?,?,?,?,?,?,?,?,?,?,?,?,?) "; try { this.execute(sql, new Object[] { hostPo.getOpsName(), hostPo.getNodeGroup(), hostPo.getHostIp(), hostPo.getHostName(), hostPo.getHostSite().toUpperCase(), hostPo.getRack(), hostPo.getHdrs_chassis(), hostPo.getState(), hostPo.getHostType(), hostPo.getDescription(), hostPo.getVmparent(), hostPo.getManifest(),version }); } catch (SQLException e) { logger.error("addSyncPeSystemHostInfo出错", e); return false; } return true; } public boolean deleteSyncPeSystemHostInfo(String appName, int version) { String sql = "delete from CSP_APP_HOST_INFO_SYNC where ops_name = ? and csp_version=?"; try { this.execute(sql, new Object[] { appName, version }); } catch (SQLException e) { logger.error("deleteSyncPeSystemHostInfo出错", e); return false; } return true; } public List<HostPo> findAllSyncHostInfos(int version) { final List<HostPo> list = new ArrayList<HostPo>(); String sql = "select * from CSP_APP_HOST_INFO_SYNC where csp_version =? or csp_version = -99"; try { this.query(sql, new Object[] { version }, new SqlCallBack() { @Override public void readerRows(ResultSet rs) throws Exception { HostPo hostPo = new HostPo(); hostPo.setOpsName(rs.getString("ops_name")); hostPo.setNodeGroup(rs.getString("nodegroup")); hostPo.setHostIp(rs.getString("dns_ip")); hostPo.setHostName(rs.getString("nodename")); hostPo.setHostSite(rs.getString("site")); hostPo.setRack(rs.getString("rack")); hostPo.setHdrs_chassis(rs.getString("hdrs_chassis")); hostPo.setState(rs.getString("state")); hostPo.setHostType(rs.getString("model")); hostPo.setDescription(rs.getString("description")); hostPo.setVmparent(rs.getString("vmparent")); hostPo.setManifest(rs.getString("manifest")); hostPo.setCpsVersion(rs.getInt("csp_version")); list.add(hostPo); } }); } catch (Exception e) { logger.error("findAllHostInfos出错", e); } return list; } /** *@author wb-lixing 2012-3-8 下午07:27:19 */ public List<HostPo> findAllSyncHostInfos(String opsName) { final List<HostPo> list = new ArrayList<HostPo>(); String sql = "select * from CSP_APP_HOST_INFO_SYNC where ops_name=?"; try { this.query(sql, new Object[] { opsName }, new SqlCallBack() { @Override public void readerRows(ResultSet rs) throws Exception { HostPo hostPo = new HostPo(); hostPo.setOpsName(rs.getString("ops_name")); hostPo.setNodeGroup(rs.getString("nodegroup")); hostPo.setHostIp(rs.getString("dns_ip")); hostPo.setHostName(rs.getString("nodename")); hostPo.setHostSite(rs.getString("site")); hostPo.setRack(rs.getString("rack")); hostPo.setHdrs_chassis(rs.getString("hdrs_chassis")); hostPo.setState(rs.getString("state")); hostPo.setHostType(rs.getString("model")); hostPo.setDescription(rs.getString("description")); hostPo.setVmparent(rs.getString("vmparent")); hostPo.setManifest(rs.getString("manifest")); hostPo.setCpsVersion(rs.getInt("csp_version")); list.add(hostPo); } }); } catch (Exception e) { logger.error("findAllHostInfos出错", e); } return list; } public List<HostPo> findAllSyncHostInfos(String opsName, int version) { final List<HostPo> list = new ArrayList<HostPo>(); String sql = "select * from CSP_APP_HOST_INFO_SYNC where ops_name=? and csp_version=?"; try { this.query(sql, new Object[] { opsName, version }, new SqlCallBack() { @Override public void readerRows(ResultSet rs) throws Exception { HostPo hostPo = new HostPo(); hostPo.setOpsName(rs.getString("ops_name")); hostPo.setNodeGroup(rs.getString("nodegroup")); hostPo.setHostIp(rs.getString("dns_ip")); hostPo.setHostName(rs.getString("nodename")); hostPo.setHostSite(rs.getString("site")); hostPo.setRack(rs.getString("rack")); hostPo .setHdrs_chassis(rs .getString("hdrs_chassis")); hostPo.setState(rs.getString("state")); hostPo.setHostType(rs.getString("model")); hostPo.setDescription(rs.getString("description")); hostPo.setVmparent(rs.getString("vmparent")); hostPo.setManifest(rs.getString("manifest")); hostPo.setCpsVersion(rs.getInt("csp_version")); list.add(hostPo); } }); } catch (Exception e) { logger.error("findAllHostInfos出错", e); } return list; } public int getSyncVersion() { String sql = "select sync_version from csp_sync_flag_summary where sync_name=?"; try { return this.getIntValue(sql, new String[] { "CSP-SYNC-OPS-FLAG" }); } catch (Exception e) { logger.error("findAllHostInfos出错", e); } return -1; } public int isSync() { String sql = "select sync_stat from csp_sync_flag_summary where sync_name=?"; try { return this.getIntValue(sql, new String[] { "CSP-SYNC-OPS-FLAG" }); } catch (Exception e) { logger.error("findAllHostInfos出错", e); } return -1; } public boolean addSync(int flag) { String sql = "update csp_sync_flag_summary set sync_stat =? where sync_name=? "; try { this.execute(sql, new Object[] { flag, "CSP-SYNC-OPS-FLAG" }); } catch (Exception e) { logger.error("findAllHostInfos出错", e); } return false; } public boolean updateSyncVersion(int version) { String sql = "update csp_sync_flag_summary set sync_version=?, update_time = now() where sync_name=? "; try { this.execute(sql, new Object[] { version, "CSP-SYNC-OPS-FLAG" }); return true; } catch (Exception e) { logger.error("findAllHostInfos出错", e); } return false; } public boolean deleteSyncOldVersion(int version) { String sql = "delete from CSP_APP_HOST_INFO_SYNC where csp_version=?"; try { this.execute(sql, new Object[] {version }); } catch (SQLException e) { logger.error("deleteSyncPeSystemHostInfo出错", e); return false; } return true; } }
[ "zunyan.zb@taobao.com" ]
zunyan.zb@taobao.com
e801cd0c4e3bc1901f665a84bbb98206dbd1cacc
9cb742d2ad80c61535a2641236bb237ce514f723
/swe.java
f4a6a22182122b63dc8d7e6b159b672f5d3c30d5
[]
no_license
nazareen/Java-Program
90d6a7cd8f3357403e3ff11aa8ff69871b9ad4c9
cf9329ce22372e800ccbea2517f3f32eb74539e1
refs/heads/master
2020-03-26T08:01:39.939976
2018-08-14T07:08:45
2018-08-14T07:08:45
144,682,786
0
0
null
null
null
null
UTF-8
Java
false
false
336
java
public class swe{ public static void main(String[] args) { int num=0; int reversenum=0; num=501; int temp=num; while(num!=0){ reversenum=reversenum*10; reversenum=reversenum+num%10; num=num/10; } System.out.println("reversenum num of" + temp +"is" + reversenum); } }
[ "nazareen3241@gmail.com" ]
nazareen3241@gmail.com
3a479c86808e964286492fb62af1253267a18407
46167791cbfeebc8d3ddc97112764d7947fffa22
/quarkus/src/main/java/com/justexample/entity/Entity1443.java
d8504ff13af05ecd18255bc62633b56c8f5054bd
[]
no_license
kahlai/unrealistictest
4f668b4822a25b4c1f06c6b543a26506bb1f8870
fe30034b05f5aacd0ef69523479ae721e234995c
refs/heads/master
2023-08-25T09:32:16.059555
2021-11-09T08:17:22
2021-11-09T08:17:22
425,726,016
0
0
null
null
null
null
UTF-8
Java
false
false
1,130
java
package com.example.entity; import java.sql.Timestamp; import javax.persistence.Entity; import javax.persistence.Id; @Entity public class Entity1443 { @Id private Long id; private String code; private String name; private String status; private int seq; private Timestamp createdDate; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public int getSeq() { return seq; } public void setSeq(int seq) { this.seq = seq; } public Timestamp getCreatedDate() { return createdDate; } public void setCreatedDate(Timestamp createdDate) { this.createdDate = createdDate; } }
[ "laikahhoe@gmail.com" ]
laikahhoe@gmail.com
d5239b5dd23855774aac0d98c7ce0cc248d6450c
038ee6b20cae51169a2ed4ed64a7b8e99b5cbaad
/schemaOrgGson/src/org/kyojo/schemaOrg/m3n3/gson/healthLifesci/clazz/SubstanceDeserializer.java
60ae0a15d611648e833d80fd09f8d2ad3e943d85
[ "Apache-2.0" ]
permissive
nagaikenshin/schemaOrg
3dec1626781913930da5585884e3484e0b525aea
4c9d6d098a2741c2dc2a814f1c708ee55c36e9a8
refs/heads/master
2021-06-25T04:52:49.995840
2019-05-12T06:22:37
2019-05-12T06:22:37
134,319,974
1
0
null
null
null
null
UTF-8
Java
false
false
2,067
java
package org.kyojo.schemaorg.m3n3.gson.healthLifesci.clazz; import java.lang.reflect.Field; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map.Entry; import org.kyojo.gson.JsonDeserializationContext; import org.kyojo.gson.JsonDeserializer; import org.kyojo.gson.JsonElement; import org.kyojo.gson.JsonObject; import org.kyojo.gson.JsonParseException; import org.kyojo.gson.reflect.TypeToken; import org.kyojo.schemaorg.m3n3.healthLifesci.impl.SUBSTANCE; import org.kyojo.schemaorg.m3n3.healthLifesci.Clazz.Substance; public class SubstanceDeserializer implements JsonDeserializer<Substance> { @Override public Substance deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext context) throws JsonParseException { if(jsonElement.isJsonPrimitive()) { return new SUBSTANCE(jsonElement.getAsString()); } JsonObject jsonObject = jsonElement.getAsJsonObject(); Substance obj = new SUBSTANCE(); HashMap<String, Field> fldMap = new HashMap<>(); Field[] flds = SUBSTANCE.class.getFields(); for(Field fld : flds) { fldMap.put(fld.getName(), fld); } for(Entry<String, JsonElement> ent : jsonObject.entrySet()) { if(fldMap.containsKey(ent.getKey())) { Field fld = fldMap.get(ent.getKey()); JsonElement elm = ent.getValue(); try { if(fld.getType().equals(List.class)) { ParameterizedType gType = (ParameterizedType)fld.getGenericType(); Type[] aTypes = gType.getActualTypeArguments(); Type listType = TypeToken.getParameterized(ArrayList.class, (Class<?>)aTypes[0]).getType(); List<?> list = context.deserialize(elm, listType); fld.set(obj, list); } else { Object val = context.deserialize(elm, fld.getType()); fld.set(obj, val); } } catch(IllegalArgumentException iae) { throw new JsonParseException(iae); } catch(IllegalAccessException iae) { throw new JsonParseException(iae); } } } return obj; } }
[ "nagai@nagaikenshin.com" ]
nagai@nagaikenshin.com
d30b2b83abd16fe469b18ae58ee33b9ccdcbc7be
254292bbb95222cd6a97eae493e28b5a63c14a9d
/spring-boot-samples/spring-boot-sample-hibernate52/src/main/java/sample/hibernate52/service/HotelServiceImpl.java
7bb9d4902f4b92a6420bd1bf10b3f206a79958dc
[ "Apache-2.0", "Noweb" ]
permissive
pikefeier/springboot
0e881a59ceefd3ae1991e83a0ad4a4d787831097
2fb23ab250f095dec39bf5e4d114c26d51467142
refs/heads/master
2023-01-09T02:51:23.939848
2019-12-30T12:19:14
2019-12-30T12:19:14
230,909,567
0
0
Apache-2.0
2022-12-27T14:51:00
2019-12-30T12:10:46
Java
UTF-8
Java
false
false
3,136
java
/* * Copyright 2012-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * 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 sample.hibernate52.service; import java.util.HashMap; import java.util.List; import java.util.Map; import sample.hibernate52.domain.City; import sample.hibernate52.domain.Hotel; import sample.hibernate52.domain.Rating; import sample.hibernate52.domain.RatingCount; import sample.hibernate52.domain.Review; import sample.hibernate52.domain.ReviewDetails; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.Assert; @Component("hotelService") @Transactional class HotelServiceImpl implements HotelService { private final HotelRepository hotelRepository; private final ReviewRepository reviewRepository; public HotelServiceImpl(HotelRepository hotelRepository, ReviewRepository reviewRepository) { this.hotelRepository = hotelRepository; this.reviewRepository = reviewRepository; } @Override public Hotel getHotel(City city, String name) { Assert.notNull(city, "City must not be null"); Assert.hasLength(name, "Name must not be empty"); return this.hotelRepository.findByCityAndName(city, name); } @Override public Page<Review> getReviews(Hotel hotel, Pageable pageable) { Assert.notNull(hotel, "Hotel must not be null"); return this.reviewRepository.findByHotel(hotel, pageable); } @Override public Review getReview(Hotel hotel, int reviewNumber) { Assert.notNull(hotel, "Hotel must not be null"); return this.reviewRepository.findByHotelAndIndex(hotel, reviewNumber); } @Override public Review addReview(Hotel hotel, ReviewDetails details) { Review review = new Review(hotel, 1, details); return this.reviewRepository.save(review); } @Override public ReviewsSummary getReviewSummary(Hotel hotel) { List<RatingCount> ratingCounts = this.hotelRepository.findRatingCounts(hotel); return new ReviewsSummaryImpl(ratingCounts); } private static class ReviewsSummaryImpl implements ReviewsSummary { private final Map<Rating, Long> ratingCount; public ReviewsSummaryImpl(List<RatingCount> ratingCounts) { this.ratingCount = new HashMap<Rating, Long>(); for (RatingCount ratingCount : ratingCounts) { this.ratingCount.put(ratingCount.getRating(), ratingCount.getCount()); } } @Override public long getNumberOfReviewsWithRating(Rating rating) { Long count = this.ratingCount.get(rating); return count == null ? 0 : count; } } }
[ "945302777@qq.com" ]
945302777@qq.com
f5d72b136f40ded8052a39206e7ec0962d69f5b8
3aa3a304ba0d57d4e1deb625e97afd7d900ab38d
/cas-client3/src/main/java/com/example/casclient3/connect/CustomAuthConfig.java
42f7e3aedf054336d77c754533e0fd559e506500
[]
no_license
Saberfor/cas
1f3dbacc0cb191a64533fc9f0f1d366dee6760c5
ae059a6983d30c34e36ed1db486f231b6439d476
refs/heads/master
2020-03-21T07:38:23.570290
2018-06-27T03:26:08
2018-06-27T03:26:08
138,290,956
0
0
null
null
null
null
UTF-8
Java
false
false
1,522
java
package com.example.casclient3.connect; import org.apereo.cas.authentication.AuthenticationEventExecutionPlan; import org.apereo.cas.authentication.AuthenticationEventExecutionPlanConfigurer; import org.apereo.cas.authentication.AuthenticationHandler; import org.apereo.cas.authentication.principal.DefaultPrincipalFactory; import org.apereo.cas.configuration.CasConfigurationProperties; import org.apereo.cas.services.ServicesManager; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration("CustomAuthConfig") @EnableConfigurationProperties(CasConfigurationProperties.class) public class CustomAuthConfig implements AuthenticationEventExecutionPlanConfigurer { @Autowired private CasConfigurationProperties casProperties; @Autowired @Qualifier("servicesManager") private ServicesManager servicesManager; @Bean public AuthenticationHandler myAuthenticationHandler() { final Login handler = new Login(Login.class.getSimpleName(), servicesManager, new DefaultPrincipalFactory(), 10); return handler; } @Override public void configureAuthenticationExecutionPlan(AuthenticationEventExecutionPlan plan) { plan.registerAuthenticationHandler(myAuthenticationHandler()); } }
[ "435257945@qq.com" ]
435257945@qq.com
9f066e2a0bbe3966d1069c1eb4258fbbb621eabc
19bb95e44892855823bb63de44e44c2ae63eddb2
/sch/src/com/huahong/admin/action/SchLogUrlFilter.java
dab4ab07e9325d9f2a1b723c67ad8cd502765db1
[]
no_license
tgactga/sch
e1199d37f69defcbc4d5c51cf8253d26ba51fbfb
1539e02f8f65448b3fd4964d05245b1fe1ed726c
refs/heads/master
2020-12-31T04:41:16.442932
2016-01-26T08:45:52
2016-01-26T08:45:52
47,875,446
0
0
null
null
null
null
UTF-8
Java
false
false
1,246
java
package com.huahong.admin.action; import java.io.IOException; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; public class SchLogUrlFilter implements Filter{ public void destroy() { } public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { HttpServletRequest request = (HttpServletRequest)servletRequest; HttpServletResponse response = (HttpServletResponse)servletResponse; HttpSession session = request.getSession(); String requestUrl = request.getServletPath() + (request.getPathInfo() == null ? "" : request.getPathInfo()); System.out.println(requestUrl); System.out.println(request.getRemoteAddr()); if(requestUrl.endsWith(".do") || requestUrl.endsWith(".jsp")){ }else{ } filterChain.doFilter(servletRequest, servletResponse); } public void init(FilterConfig arg0) throws ServletException { } }
[ "tgactga@126.com" ]
tgactga@126.com
99d3aefb812a6029d2e0dbe61adc0dafdf5cc6f3
d2984ba2b5ff607687aac9c65ccefa1bd6e41ede
/src/net/datenwerke/gxtdto/client/forms/simpleform/conditions/FieldChanged.java
af32bc98b0b0db8ca7e2fb59531b715cf6ab20cd
[]
no_license
bireports/ReportServer
da979eaf472b3e199e6fbd52b3031f0e819bff14
0f9b9dca75136c2bfc20aa611ebbc7dc24cfde62
refs/heads/master
2020-04-18T10:18:56.181123
2019-01-25T00:45:14
2019-01-25T00:45:14
167,463,795
0
0
null
null
null
null
UTF-8
Java
false
false
1,318
java
/* * ReportServer * Copyright (c) 2018 InfoFabrik GmbH * http://reportserver.net/ * * * This file is part of ReportServer. * * ReportServer is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package net.datenwerke.gxtdto.client.forms.simpleform.conditions; import net.datenwerke.gxtdto.client.forms.simpleform.SimpleForm; import net.datenwerke.gxtdto.client.forms.simpleform.hooks.FormFieldProviderHook; import com.google.gwt.user.client.ui.Widget; /** * * */ public class FieldChanged implements SimpleFormCondition { public boolean isMet(Widget formField, FormFieldProviderHook responsibleHook, SimpleForm form) { return true; } }
[ "srbala@gmail.com" ]
srbala@gmail.com
80295fe597d5a685e2c48d8693935ac2e63850c1
1d928c3f90d4a0a9a3919a804597aa0a4aab19a3
/java/neo4j/2016/8/EdgeServerReplicationIT.java
757f46089a3fa4809793ea7e8a3266a807974dc4
[]
no_license
rosoareslv/SED99
d8b2ff5811e7f0ffc59be066a5a0349a92cbb845
a062c118f12b93172e31e8ca115ce3f871b64461
refs/heads/main
2023-02-22T21:59:02.703005
2021-01-28T19:40:51
2021-01-28T19:40:51
306,497,459
1
1
null
2020-11-24T20:56:18
2020-10-23T01:18:07
null
UTF-8
Java
false
false
15,087
java
/* * Copyright (c) 2002-2016 "Neo Technology," * Network Engine for Objects in Lund AB [http://neotechnology.com] * * This file is part of Neo4j. * * Neo4j is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.neo4j.coreedge.scenarios; import java.io.File; import java.io.IOException; import java.util.Collection; import java.util.List; import java.util.Map; import java.util.Set; import java.util.SortedMap; import java.util.concurrent.TimeUnit; import java.util.function.BinaryOperator; import org.junit.Rule; import org.junit.Test; import org.neo4j.coreedge.discovery.Cluster; import org.neo4j.coreedge.discovery.CoreClusterMember; import org.neo4j.coreedge.discovery.EdgeClusterMember; import org.neo4j.coreedge.core.consensus.log.segmented.FileNames; import org.neo4j.coreedge.core.consensus.roles.Role; import org.neo4j.coreedge.core.CoreEdgeClusterSettings; import org.neo4j.coreedge.core.CoreGraphDatabase; import org.neo4j.coreedge.discovery.HazelcastDiscoveryServiceFactory; import org.neo4j.coreedge.edge.EdgeGraphDatabase; import org.neo4j.function.ThrowingSupplier; import org.neo4j.graphdb.GraphDatabaseService; import org.neo4j.graphdb.Label; import org.neo4j.graphdb.Node; import org.neo4j.graphdb.Transaction; import org.neo4j.graphdb.TransactionFailureException; import org.neo4j.io.fs.DefaultFileSystemAbstraction; import org.neo4j.io.fs.FileUtils; import org.neo4j.io.pagecache.PageCache; import org.neo4j.kernel.impl.factory.GraphDatabaseFacade; import org.neo4j.kernel.impl.pagecache.StandalonePageCacheFactory; import org.neo4j.kernel.impl.store.MetaDataStore; import org.neo4j.kernel.impl.store.format.highlimit.HighLimit; import org.neo4j.kernel.impl.store.format.standard.StandardV3_0; import org.neo4j.kernel.impl.transaction.log.TransactionIdStore; import org.neo4j.kernel.lifecycle.LifecycleException; import org.neo4j.logging.Log; import org.neo4j.storageengine.api.lock.AcquireLockTimeoutException; import org.neo4j.test.DbRepresentation; import org.neo4j.test.coreedge.ClusterRule; import static java.util.concurrent.TimeUnit.MINUTES; import static java.util.concurrent.TimeUnit.SECONDS; import static java.util.stream.Collectors.toList; import static java.util.stream.Collectors.toSet; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.core.Is.is; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import static org.mockito.Mockito.mock; import static org.neo4j.coreedge.core.EnterpriseCoreEditionModule.CLUSTER_STATE_DIRECTORY_NAME; import static org.neo4j.coreedge.core.consensus.log.RaftLog.PHYSICAL_LOG_DIRECTORY_NAME; import static org.neo4j.function.Predicates.awaitEx; import static org.neo4j.helpers.collection.Iterables.count; import static org.neo4j.helpers.collection.MapUtil.stringMap; import static org.neo4j.kernel.impl.store.MetaDataStore.Position.TIME; import static org.neo4j.test.assertion.Assert.assertEventually; public class EdgeServerReplicationIT { @Rule public final ClusterRule clusterRule = new ClusterRule( getClass() ) .withNumberOfCoreMembers( 3 ) .withNumberOfEdgeMembers( 1 ) .withDiscoveryServiceFactory( new HazelcastDiscoveryServiceFactory() ); @Test public void shouldNotBeAbleToWriteToEdge() throws Exception { // given Cluster cluster = clusterRule.startCluster(); EdgeGraphDatabase edgeDB = cluster.findAnEdgeMember().database(); // when (write should fail) boolean transactionFailed = false; try ( Transaction tx = edgeDB.beginTx() ) { Node node = edgeDB.createNode(); node.setProperty( "foobar", "baz_bat" ); node.addLabel( Label.label( "Foo" ) ); tx.success(); } catch ( TransactionFailureException e ) { // expected transactionFailed = true; } assertTrue( transactionFailed ); } @Test public void allServersBecomeAvailable() throws Exception { // given Cluster cluster = clusterRule.startCluster(); // then for ( final EdgeClusterMember edgeClusterMember : cluster.edgeMembers() ) { ThrowingSupplier<Boolean,Exception> availability = () -> edgeClusterMember.database().isAvailable( 0 ); assertEventually( "edge server becomes available", availability, is( true ), 10, SECONDS ); } Thread.sleep( 20_000 ); } @Test public void shouldEventuallyPullTransactionDownToAllEdgeServers() throws Exception { // given Cluster cluster = clusterRule.withNumberOfEdgeMembers( 0 ).startCluster(); int nodesBeforeEdgeServerStarts = 1; // when executeOnLeaderWithRetry( db -> { for ( int i = 0; i < nodesBeforeEdgeServerStarts; i++ ) { Node node = db.createNode(); node.setProperty( "foobar", "baz_bat" ); } }, cluster ); cluster.addEdgeMemberWithId( 0 ).start(); // when executeOnLeaderWithRetry( db -> { Node node = db.createNode(); node.setProperty( "foobar", "baz_bat" ); }, cluster ); // then for ( final EdgeClusterMember server : cluster.edgeMembers() ) { GraphDatabaseService edgeDB = server.database(); try ( Transaction tx = edgeDB.beginTx() ) { ThrowingSupplier<Long,Exception> nodeCount = () -> count( edgeDB.getAllNodes() ); assertEventually( "node to appear on edge server", nodeCount, is( nodesBeforeEdgeServerStarts + 1L ), 1, MINUTES ); for ( Node node : edgeDB.getAllNodes() ) { assertEquals( "baz_bat", node.getProperty( "foobar" ) ); } tx.success(); } } } @Test public void shouldShutdownRatherThanPullUpdatesFromCoreMemberWithDifferentStoreIdIfLocalStoreIsNonEmpty() throws Exception { Cluster cluster = clusterRule.withNumberOfEdgeMembers( 0 ).startCluster(); executeOnLeaderWithRetry( this::createData, cluster ); CoreClusterMember follower = cluster.awaitCoreMemberWithRole( 2000, Role.FOLLOWER ); // Shutdown server before copying its data, because Windows can't copy open files. follower.shutdown(); EdgeClusterMember edgeClusterMember = cluster.addEdgeMemberWithId( 4 ); putSomeDataWithDifferentStoreId( edgeClusterMember.storeDir(), follower.storeDir() ); try { edgeClusterMember.start(); fail( "Should have failed to start" ); } catch ( RuntimeException required ) { // Lifecycle should throw exception, server should not start. assertThat( required.getCause(), instanceOf( LifecycleException.class ) ); assertThat( required.getCause().getCause(), instanceOf( IllegalStateException.class ) ); assertThat( required.getCause().getCause().getMessage(), containsString( "This edge machine cannot join the cluster. " + "The local database is not empty and has a mismatching storeId:" ) ); } } private boolean edgesUpToDateAsTheLeader( CoreClusterMember leader, Collection<EdgeClusterMember> edgeClusterMembers ) { long leaderTxId = lastClosedTransactionId( leader.database() ); return edgeClusterMembers.stream().map( EdgeClusterMember::database ).map( this::lastClosedTransactionId ) .reduce( true, ( acc, txId ) -> acc && txId == leaderTxId, Boolean::logicalAnd ); } private void putSomeDataWithDifferentStoreId( File storeDir, File coreStoreDir ) throws IOException { FileUtils.copyRecursively( coreStoreDir, storeDir ); changeStoreId( storeDir ); } private void changeStoreId( File storeDir ) throws IOException { File neoStoreFile = new File( storeDir, MetaDataStore.DEFAULT_NAME ); try ( PageCache pageCache = StandalonePageCacheFactory.createPageCache( new DefaultFileSystemAbstraction() ) ) { MetaDataStore.setRecord( pageCache, neoStoreFile, TIME, System.currentTimeMillis() ); } } @Test public void anEdgeServerShouldBeAbleToRejoinTheCluster() throws Exception { int edgeServerId = 4; Cluster cluster = clusterRule.withNumberOfEdgeMembers( 0 ).startCluster(); executeOnLeaderWithRetry( this::createData, cluster ); cluster.addEdgeMemberWithId( edgeServerId ); // let's spend some time by adding more data executeOnLeaderWithRetry( this::createData, cluster ); cluster.removeEdgeMemberWithMemberId( edgeServerId ); // let's spend some time by adding more data executeOnLeaderWithRetry( this::createData, cluster ); cluster.addEdgeMemberWithId( edgeServerId ).start(); awaitEx( () -> edgesUpToDateAsTheLeader( cluster.awaitLeader(), cluster.edgeMembers() ), 1, TimeUnit.MINUTES ); List<File> coreStoreDirs = cluster.coreMembers().stream().map( CoreClusterMember::storeDir ).collect( toList() ); List<File> edgeStoreDirs = cluster.edgeMembers().stream().map( EdgeClusterMember::storeDir ).collect( toList() ); cluster.shutdown(); Set<DbRepresentation> dbs = coreStoreDirs.stream().map( DbRepresentation::of ).collect( toSet() ); dbs.addAll( edgeStoreDirs.stream().map( DbRepresentation::of ).collect( toSet() ) ); assertEquals( 1, dbs.size() ); } private long lastClosedTransactionId( GraphDatabaseFacade db ) { return db.getDependencyResolver().resolveDependency( TransactionIdStore.class ).getLastClosedTransactionId(); } @Test public void shouldThrowExceptionIfEdgeRecordFormatDiffersToCoreRecordFormat() throws Exception { // given Cluster cluster = clusterRule.withNumberOfEdgeMembers( 0 ).withRecordFormat( HighLimit.NAME ).startCluster(); // when executeOnLeaderWithRetry( this::createData, cluster ); try { cluster.addEdgeMemberWithIdAndRecordFormat( 0, StandardV3_0.NAME ); } catch ( Exception e ) { assertThat( e.getCause().getCause().getMessage(), containsString( "Failed to start database with copied store" ) ); } } @Test public void shouldBeAbleToCopyStoresFromCoreToEdge() throws Exception { // given Map<String,String> params = stringMap( CoreEdgeClusterSettings.raft_log_rotation_size.name(), "1k", CoreEdgeClusterSettings.raft_log_pruning_frequency.name(), "500ms", CoreEdgeClusterSettings.state_machine_flush_window_size.name(), "1", CoreEdgeClusterSettings.raft_log_pruning_strategy.name(), "1 entries" ); Cluster cluster = clusterRule.withNumberOfEdgeMembers( 0 ).withSharedCoreParams( params ) .withRecordFormat( HighLimit.NAME ).startCluster(); cluster.coreTx( ( db, tx ) -> { Node node = db.createNode( Label.label( "L" ) ); for ( int i = 0; i < 10; i++ ) { node.setProperty( "prop-" + i, "this is a quite long string to get to the log limit soonish" ); } tx.success(); } ); long baseVersion = versionBy( cluster.awaitLeader().storeDir(), Math::max ); CoreClusterMember coreGraphDatabase = null; for ( int j = 0; j < 2; j++ ) { coreGraphDatabase = cluster.coreTx( ( db, tx ) -> { Node node = db.createNode( Label.label( "L" ) ); for ( int i = 0; i < 10; i++ ) { node.setProperty( "prop-" + i, "this is a quite long string to get to the log limit soonish" ); } tx.success(); } ); } File storeDir = coreGraphDatabase.storeDir(); assertEventually( "pruning happened", () -> versionBy( storeDir, Math::min ), greaterThan( baseVersion ), 5, SECONDS ); // when cluster.addEdgeMemberWithIdAndRecordFormat( 42, HighLimit.NAME ).start(); // then for ( final EdgeClusterMember edge : cluster.edgeMembers() ) { assertEventually( "edge server available", () -> edge.database().isAvailable( 0 ), is( true ), 10, SECONDS ); } } private long versionBy( File storeDir, BinaryOperator<Long> operator ) { File raftLogDir = new File( new File( storeDir, CLUSTER_STATE_DIRECTORY_NAME ), PHYSICAL_LOG_DIRECTORY_NAME ); SortedMap<Long,File> logs = new FileNames( raftLogDir ).getAllFiles( new DefaultFileSystemAbstraction(), mock( Log.class ) ); return logs.keySet().stream().reduce( operator ).orElseThrow( IllegalStateException::new ); } private void executeOnLeaderWithRetry( Workload workload, Cluster cluster ) throws Exception { assertEventually( "Executed on leader", () -> { try { CoreGraphDatabase coreDB = cluster.awaitLeader( 5000 ).database(); try ( Transaction tx = coreDB.beginTx() ) { workload.doWork( coreDB ); tx.success(); return true; } } catch ( AcquireLockTimeoutException | TransactionFailureException e ) { // print the stack trace for diagnostic purposes, but retry as this is most likely a transient failure e.printStackTrace(); return false; } }, is( true ), 30, SECONDS ); } private interface Workload { void doWork( GraphDatabaseService database ); } private void createData( GraphDatabaseService db ) { for ( int i = 0; i < 10; i++ ) { Node node = db.createNode(); node.setProperty( "foobar", "baz_bat" ); } } }
[ "rodrigosoaresilva@gmail.com" ]
rodrigosoaresilva@gmail.com
ee8bfdea716e91d11c075581ec6882374d2348ce
5acf5a1c729e39b818a6b81733b593221b402b1a
/v12/src/chapter36/ResourceBundleDemo.java
23f8f83d4cd3655aef152e2ee92ed62748d6650e
[ "Apache-2.0" ]
permissive
txs72/BUPTJava
e7fe35376f109b56cf1e48c8291e8054eaaf1960
bfabd434736cf02a6efc1148236839fa4503c7ac
refs/heads/master
2023-02-18T02:05:21.023572
2023-02-06T07:25:50
2023-02-06T07:25:50
46,569,013
51
42
null
null
null
null
UTF-8
Java
false
false
7,094
java
package chapter36; import java.util.*; import java.text.NumberFormat; import javafx.application.Application; import javafx.geometry.Pos; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.ComboBox; import javafx.scene.control.Label; import javafx.scene.control.TextField; import javafx.scene.layout.GridPane; import javafx.scene.layout.HBox; import javafx.scene.layout.VBox; import javafx.stage.Stage; public class ResourceBundleDemo extends Application { private ResourceBundle res = ResourceBundle.getBundle("MyResource"); // Create labels private Label lblInterestRate = new Label(res.getString("Annual_Interest_Rate")); private Label lblNumberOfYears = new Label(res.getString("Number_Of_Years")); private Label lblLoanAmount = new Label(res.getString("Loan_Amount")); private Label lblMonthlyPayment = new Label(res.getString("Monthly_Payment")); private Label lblTotalPayment = new Label(res.getString("Total_Payment")); private Label lblPayment = new Label(res.getString("Payment")); private Label lblChooseALocale = new Label(res.getString("Choose_a_Locale")); private Label lblEnterInterestRate = new Label(res.getString("Enter_Interest_Rate")); // Combo box for selecting available locales private ComboBox<String> cboLocale = new ComboBox<>(); // Text fields for interest rate, year, and loan amount private TextField tfInterestRate = new TextField("6.75"); private TextField tfNumberOfYears = new TextField("15"); private TextField tfLoanAmount = new TextField("107000"); private TextField tfFormattedInterestRate = new TextField(); private TextField tfFormattedNumberOfYears = new TextField(); private TextField tfFormattedLoanAmount = new TextField(); // Text fields for monthly payment and total payment private TextField tfTotalPayment = new TextField(); private TextField tfMonthlyPayment = new TextField(); // Compute button private Button btCompute = new Button("Compute"); // Current locale private Locale locale = Locale.getDefault(); // Declare locales to store available locales private Locale locales[] = Calendar.getAvailableLocales(); /** Initialize the combo box */ public void initializeComboBox() { // Add locale names to the combo box for (int i = 0; i < locales.length; i++) cboLocale.getItems().add(locales[i].getDisplayName()); } @Override // Override the start method in the Application class public void start(Stage primaryStage) { initializeComboBox(); // Pane to hold the combo box for selecting locales HBox hBox = new HBox(5); hBox.getChildren().addAll(lblChooseALocale, cboLocale); // Pane to hold the input GridPane gridPane = new GridPane(); gridPane.add(lblInterestRate, 0, 0); gridPane.add(tfInterestRate, 1, 0); gridPane.add(tfFormattedInterestRate, 2, 0); gridPane.add(lblNumberOfYears, 0, 1); gridPane.add(tfNumberOfYears, 1, 1); gridPane.add(tfFormattedNumberOfYears, 2, 1); gridPane.add(lblLoanAmount, 0, 2); gridPane.add(tfLoanAmount, 1, 2); gridPane.add(tfFormattedLoanAmount, 2, 2); // Pane to hold the output GridPane gridPaneOutput = new GridPane(); gridPaneOutput.add(lblMonthlyPayment, 0, 0); gridPaneOutput.add(tfMonthlyPayment, 1, 0); gridPaneOutput.add(lblTotalPayment, 0, 1); gridPaneOutput.add(tfTotalPayment, 1, 1); // Set text field alignment tfFormattedInterestRate.setAlignment(Pos.BASELINE_RIGHT); tfFormattedNumberOfYears.setAlignment(Pos.BASELINE_RIGHT); tfFormattedLoanAmount.setAlignment(Pos.BASELINE_RIGHT); tfTotalPayment.setAlignment(Pos.BASELINE_RIGHT); tfMonthlyPayment.setAlignment(Pos.BASELINE_RIGHT); // Set editable false tfFormattedInterestRate.setEditable(false); tfFormattedNumberOfYears.setEditable(false); tfFormattedLoanAmount.setEditable(false); tfTotalPayment.setEditable(false); tfMonthlyPayment.setEditable(false); VBox vBox = new VBox(5); vBox.getChildren().addAll(hBox, lblEnterInterestRate, gridPane, lblPayment, gridPaneOutput, btCompute); // Create a scene and place it in the stage Scene scene = new Scene(vBox, 400, 300); primaryStage.setTitle("ResourceBundleDemo"); // Set the stage title primaryStage.setScene(scene); // Place the scene in the stage primaryStage.show(); // Display the stage // Register listeners cboLocale.setOnAction(e -> { locale = locales[cboLocale .getSelectionModel().getSelectedIndex()]; updateStrings(); computeLoan(); }); btCompute.setOnAction(e -> computeLoan()); } /** Compute payments and display results locale-sensitive format */ private void computeLoan() { // Retrieve input from user double loan = new Double(tfLoanAmount.getText()).doubleValue(); double interestRate = new Double(tfInterestRate.getText()).doubleValue() / 1240; int numberOfYears = new Integer(tfNumberOfYears.getText()).intValue(); // Calculate payments double monthlyPayment = loan * interestRate/ (1 - (Math.pow(1 / (1 + interestRate), numberOfYears * 12))); double totalPayment = monthlyPayment * numberOfYears * 12; // Get formatters NumberFormat percentFormatter = NumberFormat.getPercentInstance(locale); NumberFormat currencyForm = NumberFormat.getCurrencyInstance(locale); NumberFormat numberForm = NumberFormat.getNumberInstance(locale); percentFormatter.setMinimumFractionDigits(2); // Display formatted input tfFormattedInterestRate.setText( percentFormatter.format(interestRate * 12)); tfFormattedNumberOfYears.setText (numberForm.format(numberOfYears)); tfFormattedLoanAmount.setText(currencyForm.format(loan)); // Display results in currency format tfMonthlyPayment.setText(currencyForm.format(monthlyPayment)); tfTotalPayment.setText(currencyForm.format(totalPayment)); } /** Update resource strings */ private void updateStrings() { res = ResourceBundle.getBundle("MyResource", locale); lblInterestRate.setText(res.getString("Annual_Interest_Rate")); lblNumberOfYears.setText(res.getString("Number_Of_Years")); lblLoanAmount.setText(res.getString("Loan_Amount")); lblTotalPayment.setText(res.getString("Total_Payment")); lblMonthlyPayment.setText(res.getString("Monthly_Payment")); btCompute.setText(res.getString("Compute")); lblChooseALocale.setText(res.getString("Choose_a_Locale")); lblEnterInterestRate.setText( res.getString("Enter_Interest_Rate")); lblPayment.setText(res.getString("Payment")); } /** * The main method is only needed for the IDE with limited * JavaFX support. Not needed for running from the command line. */ public static void main(String[] args) { launch(args); } }
[ "young@buptnet.edu.cn" ]
young@buptnet.edu.cn
8800ce368d5ecf7891b39e4b5ee7d5fa5203dcc2
d6869915912438cb0860647978429f5b7561fc54
/app/src/main/java/com/example/dongtv2/introslider/WelcomeActivity.java
9612e20cb479d88f75c2d8f9d7b7f86bb0b69811
[]
no_license
vandong140389/IntroSlider
f60bb8a0664dbdfe87f5adec9a84033a2cba52eb
dcc4a9d1084a455ad0cfc72a577c1b051deac00c
refs/heads/master
2022-05-24T20:42:35.945066
2017-10-02T09:53:24
2017-10-02T09:53:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,515
java
package com.example.dongtv2.introslider; import android.content.Context; import android.os.Bundle; import android.support.v4.view.PagerAdapter; import android.support.v4.view.ViewPager; import android.support.v7.app.AppCompatActivity; import android.text.Html; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.LinearLayout; import android.widget.TextView; public class WelcomeActivity extends AppCompatActivity implements View.OnClickListener{ private ViewPager viewPager; private LinearLayout dotsLayout; private TextView[] dots; private int[] layouts = new int[]{R.layout.intro_slide1, R.layout.intro_slide2, R.layout.intro_slide3, R.layout.intro_slide4}; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_welcome); viewPager = (ViewPager) findViewById(R.id.view_pager); dotsLayout = (LinearLayout) findViewById(R.id.layoutDots); setBtnClickListener(R.id.btn_got_it); setBtnClickListener(R.id.btn_next); setBtnClickListener(R.id.btn_skip); // adding bottom dots addBottomDots(); // By default, select dot in the first position updateBottomDots(0, 0); viewPager.setAdapter(new MyViewPagerAdapter()); viewPager.addOnPageChangeListener(pageChangeListener); } private void setBtnClickListener(int id) { Button button = (Button) findViewById(id); if (button != null) { button.setOnClickListener(this); } } private void showHideView(int id, int visibility) { View view = findViewById(id); if (view != null) { view.setVisibility(visibility); } } private void addBottomDots() { if ((dotsLayout == null) || (layouts == null)) return; int dotSize = layouts.length; dotsLayout.removeAllViews(); dots = new TextView[dotSize]; for (int i = 0; i < dots.length; i++) { dots[i] = new TextView(this); dots[i].setText(Html.fromHtml("&#8226;")); dots[i].setTextSize(35); dotsLayout.addView(dots[i]); } } private void updateBottomDots(int prevPosition, int curPosition) { if (dots == null) return; int dotLength = dots.length; if ((dotLength > prevPosition) && (dotLength > curPosition)) { dots[prevPosition].setTextColor(getResources().getColor(R.color.dot_inactive)); dots[curPosition].setTextColor(getResources().getColor(R.color.dot_active)); } } ViewPager.OnPageChangeListener pageChangeListener = new ViewPager.OnPageChangeListener() { int prevPos = 0; @Override public void onPageSelected(int position) { updateBottomDots(prevPos, position); boolean isFirstPage = (position == 0); boolean isLastPage = (position == (layouts.length - 1)); showHideView(R.id.btn_next, isLastPage ? View.GONE : View.VISIBLE); showHideView(R.id.btn_skip, isFirstPage ? View.GONE : View.VISIBLE); showHideView(R.id.btn_got_it, isLastPage ? View.VISIBLE : View.GONE); prevPos = position; } @Override public void onPageScrolled(int arg0, float arg1, int arg2) { } @Override public void onPageScrollStateChanged(int arg0) { } }; @Override public void onClick(View view) { switch (view.getId()) { case R.id.btn_skip: showBackSlide(); break; // case R.id.btn_got_it: // launchHomeScreen(); // break; case R.id.btn_next: showNextSlide(); break; } } private void showNextSlide() { // Checking for last page // If last page home screen will be launched int nextIndex = viewPager.getCurrentItem() + 1; if ((viewPager != null) && (nextIndex < layouts.length)) { viewPager.setCurrentItem(nextIndex); } } private void showBackSlide() { // Checking for last page // If first page home screen will be launched int nextIndex = viewPager.getCurrentItem() - 1; if ((viewPager != null) && (nextIndex >= 0)) { viewPager.setCurrentItem(nextIndex); } } public class MyViewPagerAdapter extends PagerAdapter { private LayoutInflater layoutInflater; public MyViewPagerAdapter() { layoutInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @Override public Object instantiateItem(ViewGroup container, int position) { View view = layoutInflater.inflate(layouts[position], container, false); container.addView(view); return view; } @Override public int getCount() { return (layouts != null) ? layouts.length : 0; } @Override public boolean isViewFromObject(View view, Object obj) { return (view == obj); } @Override public void destroyItem(ViewGroup container, int position, Object object) { View view = (View) object; container.removeView(view); } } }
[ "vandong140389@gmail.com" ]
vandong140389@gmail.com
b950fef946e8c964634ff8fe9127241a2d2dc8a2
3c9ad37b1b3ec921a546feac62627e52aa87284b
/Java/javaFun/StringManipulator/StringManipulatorTest.java
a86216bf19877d35879295da253a61a1d09af8b2
[]
no_license
jcbarn5/DojoAssignments
ee46c03a3ccd277098bfdaede743458c4c0fe70e
4f559ed852746eb4825831841f29f7bc6e1e3205
refs/heads/master
2021-01-20T14:07:42.642346
2017-08-01T15:13:43
2017-08-01T15:13:43
82,738,007
0
0
null
null
null
null
UTF-8
Java
false
false
417
java
public class StringManipulatorTest { public static void main(String[] args) { StringManipulator tester = new StringManipulator(); System.out.println(tester.trimAndConcat("Hello", "World")); System.out.println(tester.getIndexOrNull("Upstanding", 't')); System.out.println(tester.getIndexOrNullSt("Upstanding", "tan")); System.out.println(tester.concatSubstring("Hello", 1, 2, "world")); } }
[ "jacob.barnes8@gmail.com" ]
jacob.barnes8@gmail.com
bc74400d096e0b91fd8e3fa3f76700b1282cde21
3965aaf0046c17f6260fd42c44f1e7578dd6ddd8
/KesavanDemo/src/test/java/com/example/KesavanDemo/KesavanDemoApplicationTests.java
0e428d88e4b98d48a3cc45605ecca375477d0f72
[]
no_license
kesavangkit/General
b4eb6a77de049df97f7d0940f56acd88eb9d5960
46dc12c4a27ef900df7dcc4214c16d5dffc894b8
refs/heads/master
2023-07-09T02:38:39.381862
2021-08-03T14:54:06
2021-08-03T14:54:06
392,334,114
0
0
null
null
null
null
UTF-8
Java
false
false
220
java
package com.example.KesavanDemo; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class KesavanDemoApplicationTests { @Test void contextLoads() { } }
[ "kesav@Kesavan" ]
kesav@Kesavan
ff993cee314ef1fb6a72f9d313f9d16834f067da
9523186104912efcd481411eeaf14bb0fb27820e
/post-bmide/code/get_client/com.ge.transportation.plm.mfg/src/com/ge/transportation/plm/mfg/handlers/CreateGetNCMachiningHandler.java
34dafdd7d22f3c4471697ad8c5279bc1d8437830
[]
no_license
qistchan/knowledge
339950e245cb8c19b54fbea0587ad7e604d2af8f
f4a566d746d57c3d0c95b18ff5e31ee9bf704233
refs/heads/master
2020-05-15T00:04:55.405867
2018-07-13T06:18:02
2018-07-13T06:18:02
182,003,864
0
1
null
2019-04-18T02:42:08
2019-04-18T02:42:08
null
UTF-8
Java
false
false
2,587
java
package com.ge.transportation.plm.mfg.handlers; import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.handlers.HandlerUtil; import com.ge.transportation.plm.mfg.ui.CreateGetNCMachiningItem; import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent; import com.teamcenter.rac.aifrcp.AIFUtility; import com.teamcenter.rac.aifrcp.SelectionHelper; import com.teamcenter.rac.kernel.TCComponentBOMLine; import com.teamcenter.rac.kernel.TCComponentFolder; import com.teamcenter.rac.kernel.TCSession; /** * Our sample handler extends AbstractHandler, an IHandler base class. * @see org.eclipse.core.commands.IHandler * @see org.eclipse.core.commands.AbstractHandler */ public class CreateGetNCMachiningHandler extends AbstractHandler { /** * The constructor. */ public CreateGetNCMachiningHandler() { } /** * the command has been executed, to extract the needed information * from the application context. */ public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event); try { InterfaceAIFComponent[] selectedComponents = SelectionHelper.getTargetComponents(HandlerUtil.getCurrentSelection(event)); if((null != selectedComponents) && (selectedComponents.length == 1)) { if((selectedComponents[0] instanceof TCComponentFolder) || (selectedComponents[0] instanceof TCComponentBOMLine)) { CreateGetNCMachiningItem createNCMacining = new CreateGetNCMachiningItem(window, selectedComponents); createNCMacining.createGetOperation(); } else { selectedComponents = new InterfaceAIFComponent[1]; selectedComponents[0] = ((TCSession)AIFUtility.getDefaultSession()).getUser().getNewStuffFolder(); CreateGetNCMachiningItem createNCMacining = new CreateGetNCMachiningItem(window, selectedComponents); createNCMacining.createGetOperation(); } } else { selectedComponents = new InterfaceAIFComponent[1]; selectedComponents[0] = ((TCSession)AIFUtility.getDefaultSession()).getUser().getNewStuffFolder(); CreateGetNCMachiningItem createNCMacining = new CreateGetNCMachiningItem(window, selectedComponents); createNCMacining.createGetOperation(); } } catch(Exception eObj) { MessageDialog.openError(window.getShell(), "Error", eObj.getMessage()); } return null; } }
[ "naraharirao.uppaluri@ge.com" ]
naraharirao.uppaluri@ge.com
081599d15e8782ba4f59e7d46cb2cdf1516382e4
b95ab48e8ab240e4aac34dccb842654688f1abc6
/piggyback-invoice/src/main/java/com/incentives/piggyback/invoice/SwaggerConfig.java
bb0bd6885cc41deb25e9ebe6da8393631f55b70c
[]
no_license
ashish1595/Piggyback
4fcb11cbf2b85d70f183e2803059458bff407369
47efb1ae3c06f479efab5585477b054b31b10f02
refs/heads/master
2023-02-04T04:51:22.191325
2020-09-21T20:49:55
2020-09-21T20:49:55
237,634,882
0
0
null
2023-01-24T03:23:04
2020-02-01T15:29:14
Java
UTF-8
Java
false
false
764
java
package com.incentives.piggyback.invoice; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import springfox.documentation.builders.PathSelectors; import springfox.documentation.builders.RequestHandlerSelectors; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger2.annotations.EnableSwagger2; @Configuration @EnableSwagger2 public class SwaggerConfig { @Bean public Docket api() { return new Docket(DocumentationType.SWAGGER_2) .select() .apis(RequestHandlerSelectors.any()) .paths(PathSelectors.any()) .build(); } }
[ "ashishgupta@Ashishs-MacBook-Pro-2.local" ]
ashishgupta@Ashishs-MacBook-Pro-2.local
8915eb12c2ba3797c874bd68fc2e109ab811a98d
936890f839147a21edd459bafa38f838bd229344
/app/src/test/java/com/example/Planner_team4/ExampleUnitTest.java
cdcc2edc9375d48806578f8573a1ffd5c744b30d
[]
no_license
talgelfand/Planner_team4
17197e7471c403793485b87ad77af365d51fe79a
e5a9d970a1767144233ece3bf7bedc08abddb9dd
refs/heads/master
2022-11-21T16:59:08.586278
2020-07-24T14:00:19
2020-07-24T14:00:19
279,860,415
0
1
null
null
null
null
UTF-8
Java
false
false
386
java
package com.example.Planner_team4; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
[ "talj.gelfand@gmail.com" ]
talj.gelfand@gmail.com
9117743b18b73c53dd8c6a807c5935a7f52ab44f
9abcf6981bd072be432af1c9920c7c982c36b84d
/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/job/internal/InstallPlanJob.java
3c72c47c3f30ba4207d7219974b64b42273b984f
[]
no_license
Spencerx/xwiki-commons
026b6c0bfc31a3ba816a1b05e0c6f1c64824ec48
98ca9079598d7c90b8e2b7589c55d0f0e21eed7a
refs/heads/master
2021-01-16T17:52:07.194692
2014-06-27T08:51:59
2014-06-27T08:51:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,784
java
/* * See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.xwiki.extension.job.internal; import java.util.Collection; import java.util.LinkedHashMap; import java.util.Map; import javax.inject.Named; import org.xwiki.component.annotation.Component; import org.xwiki.extension.ExtensionId; import org.xwiki.extension.job.InstallRequest; import org.xwiki.job.Request; /** * Create an Extension installation plan. * * @version $Id$ * @since 4.0M1 */ @Component @Named(InstallPlanJob.JOBTYPE) public class InstallPlanJob extends AbstractInstallPlanJob<InstallRequest> { /** * The id of the job. */ public static final String JOBTYPE = "installplan"; @Override public String getType() { return JOBTYPE; } @Override protected InstallRequest castRequest(Request request) { InstallRequest installRequest; if (request instanceof InstallRequest) { installRequest = (InstallRequest) request; } else { installRequest = new InstallRequest(request); } return installRequest; } @Override protected void runInternal() throws Exception { Map<ExtensionId, Collection<String>> extensionsByNamespace = new LinkedHashMap<ExtensionId, Collection<String>>(); Collection<ExtensionId> extensions = getRequest().getExtensions(); for (ExtensionId extensionId : extensions) { if (getRequest().hasNamespaces()) { Collection<String> namespaces = getRequest().getNamespaces(); for (String namespace : namespaces) { addExtensionToProcess(extensionsByNamespace, extensionId, namespace); } } else { addExtensionToProcess(extensionsByNamespace, extensionId, null); } } // Start the actual plan creation start(extensionsByNamespace); } }
[ "thomas.mortagne@gmail.com" ]
thomas.mortagne@gmail.com
22bff5f4008094ac7b889cca5e70d4ee7d4b108a
e1575a7e852fefca8c244ef9709b024f3937e2e9
/lab2/src/main/java/com/bsuir/modeling/generator/Generator.java
47c7ceda999e1d3846d9fb531039bf25fd60f1dc
[]
no_license
danilchican/Modeling
c121718300705a38843e96492e2ff3fc702684f2
e2ef03a9d3791ef68bc302c7ff5a1859fcc20dd1
refs/heads/master
2021-08-19T12:34:37.312206
2017-11-26T09:03:37
2017-11-26T09:03:37
103,372,268
0
0
null
null
null
null
UTF-8
Java
false
false
4,918
java
package com.bsuir.modeling.generator; import com.bsuir.modeling.data.Printer; import com.bsuir.modeling.drawing.Graph; import java.math.BigDecimal; import java.math.RoundingMode; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Scanner; import java.util.concurrent.ThreadLocalRandom; public abstract class Generator { /** * Constants. */ public static final int INTERVAL_COUNT = 20; private static final int VALUES_COUNT = 10_000; static final int N_POW = 2; private boolean isHistogramCalculated = false; /** * Storage of generated values. */ List<Double> values; private List<Double> xAxis; private List<Double> yAxis; /** * Input manager. */ Scanner in; /** * Generator's histogram. */ Graph histogram; /** * Default constructor. */ Generator() { this.values = new ArrayList<>(); this.xAxis = new ArrayList<>(); this.yAxis = new ArrayList<>(); this.in = new Scanner(System.in); } /** * Calculate Mean value. * * @return Mx */ public double calculateMx() { if (values.isEmpty()) { Printer.print("Cannot calculate Mx: list is empty"); return -1; } return values .stream() .mapToDouble(Double::doubleValue).sum() / values.size(); } /** * Calculate Dispersion value. * * @return Dx */ public double calculateDx() { if (values.isEmpty()) { Printer.print("Cannot calculate Dx: list is empty"); return -1; } ArrayList<Double> list = new ArrayList<>(); double Mx = calculateMx(); values.forEach(v -> list.add(Math.pow(v - Mx, N_POW))); double Dx = list.stream().mapToDouble(Double::doubleValue).sum(); return Dx / (values.size() - 1); } /** * Print generator data. */ public void print() { Printer.print("Histogram data: " + getHistogramData()); Printer.print("Mx: " + calculateMx()); Printer.print("Dx: " + calculateDx()); Printer.print("Std: " + calculateStd()); } /** * Generate numbers. */ public void generate() { values.clear(); for (int i = 0; i < VALUES_COUNT; i++) { double value = getRandomNumber(); values.add(value); } calculateHistogram(); } protected abstract double getRandomNumber(); public abstract void showHistogram(); public abstract void input(); protected abstract boolean isValidValues(); /** * Get histogram data. * * @return histogram data */ List<Double> getHistogramData() { if (isHistogramCalculated()) { return this.yAxis; } Printer.print("Cannot get histogram data: that is not calculated"); return null; } private boolean isHistogramCalculated() { return isHistogramCalculated; } private void setHistogramCalculated(boolean histogramCalculated) { isHistogramCalculated = histogramCalculated; } /** * Calculate standard deviation. * * @return std */ private double calculateStd() { if (values.isEmpty()) { Printer.print("Cannot calculate std: list is empty"); return -1; } double Dx = calculateDx(); return new BigDecimal(Math.sqrt(Dx)) .setScale(4, RoundingMode.HALF_UP) .doubleValue(); } /** * Calculate histogram data. */ private void calculateHistogram() { if (values.isEmpty()) { Printer.print("Cannot calculate histogram. Values list is empty."); return; } xAxis.clear(); yAxis.clear(); Collections.sort(values); final double startValue = 0; final double width = values.get(values.size() - 1) - values.get(0); final double intervalWidth = width / INTERVAL_COUNT; xAxis.add(0.0245 * width + values.get(0)); for (int i = 1; i < INTERVAL_COUNT; i++) { xAxis.add(xAxis.get(i - 1) + intervalWidth); } for (int i = 0; i < INTERVAL_COUNT; i++) { this.yAxis.add(startValue); } double xLeft = values.get(0); double xRight = xLeft + intervalWidth; int j = 0; for (int i = 0; i < INTERVAL_COUNT; i++) { while (j < values.size() && xLeft <= values.get(j) && xRight > values.get(j)) { yAxis.set(i, yAxis.get(i) + 1); j++; } yAxis.set(i, yAxis.get(i) / VALUES_COUNT); xLeft = xRight; xRight += intervalWidth; } this.setHistogramCalculated(true); } }
[ "danilchican@mail.ru" ]
danilchican@mail.ru
b19bb9d9ae8a71dd4e02c242ccd937a4020d77e0
0035c4192aa758b46a4db24c6978b036f7c0d3b0
/R_aid-VANETS-FINAL/app/src/test/java/com/example/leosi/r_aid/ExampleUnitTest.java
2ce61083c039f0fb2fec27ba08885f6d2b4680e5
[]
no_license
LeoSilva100/Trabalho-ADS
a323aceef6cd0b8c0078f054ae426b1835045859
ccf05b814b4a3300a0f75be6d5460e3896836c76
refs/heads/master
2021-06-26T06:25:19.769703
2017-09-13T02:31:32
2017-09-13T02:31:32
103,342,582
0
0
null
null
null
null
UTF-8
Java
false
false
417
java
package com.example.leosi.r_aid; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "leosilvadrum100@gmail.com" ]
leosilvadrum100@gmail.com
313c18ece2de6fd46c39269961d5cc640f077815
c3242fd96740d98638d14fe4d677816443034abe
/org.xtext.project439/src-gen/org/xtext/project439/grocery/impl/AbstractElementImpl.java
072c08f09650dadb9f409216e6ce88c5910d1018
[]
no_license
Ixgauth/ECSE439FinalProject
0677100764b85843f6e734d075c33b6c4ed1bcd2
072f8288013d3efe1f3ab497acc90af418e1a28f
refs/heads/master
2020-04-07T05:56:29.164164
2018-11-29T02:58:06
2018-11-29T02:58:06
158,116,308
0
0
null
null
null
null
UTF-8
Java
false
false
3,786
java
/** * generated by Xtext 2.15.0 */ package org.xtext.project439.grocery.impl; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; import org.xtext.project439.grocery.AbstractElement; import org.xtext.project439.grocery.GroceryPackage; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Abstract Element</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link org.xtext.project439.grocery.impl.AbstractElementImpl#getName <em>Name</em>}</li> * </ul> * * @generated */ public class AbstractElementImpl extends MinimalEObjectImpl.Container implements AbstractElement { /** * The default value of the '{@link #getName() <em>Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getName() * @generated * @ordered */ protected static final String NAME_EDEFAULT = null; /** * The cached value of the '{@link #getName() <em>Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getName() * @generated * @ordered */ protected String name = NAME_EDEFAULT; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected AbstractElementImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return GroceryPackage.Literals.ABSTRACT_ELEMENT; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getName() { return name; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setName(String newName) { String oldName = name; name = newName; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, GroceryPackage.ABSTRACT_ELEMENT__NAME, oldName, name)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case GroceryPackage.ABSTRACT_ELEMENT__NAME: return getName(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case GroceryPackage.ABSTRACT_ELEMENT__NAME: setName((String)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case GroceryPackage.ABSTRACT_ELEMENT__NAME: setName(NAME_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case GroceryPackage.ABSTRACT_ELEMENT__NAME: return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); } return super.eIsSet(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (name: "); result.append(name); result.append(')'); return result.toString(); } } //AbstractElementImpl
[ "Ixgauth@yahoo.com" ]
Ixgauth@yahoo.com
f76d6487d44e1f1f8f44b5601cc9e0643ec7553b
5dca4c9ecaa2be0b4891bf5e8977e32c6cc8ef44
/src/main/java/com/jag/sql/TestDB2.java
7f6fdb85b7409363895b9c7eab001c3902f8e422
[]
no_license
jag522/JavaExamples
b1f3464528a160195ebc8ca1016284bbda412798
04fe9515ed7c9b23c0b923be732a3548be75e58a
refs/heads/master
2021-01-15T10:47:16.953273
2014-07-19T06:12:34
2014-07-19T06:12:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,985
java
package com.jag.sql; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.Statement; import java.sql.Timestamp; import java.sql.Types; public class TestDB2 { public static void main(String[] args) { Connection conn = null; try { String driver = "com.ibm.db2.jcc.DB2Driver"; String user = "sndbusr"; String password = "Jsu39asd"; String url = "jdbc:db2://192.168.40.5:60004/devdb"; Class.forName(driver); conn = DriverManager.getConnection(url, user, password); System.out.println("OK"); Statement s = conn.createStatement(); PreparedStatement ps = conn.prepareStatement("update rep_test_jag set field1=?,field2=?, field3=? where id=?"); ps.setObject(1, ""); ps.setObject(2, null); ps.setObject(3, new Timestamp(System.currentTimeMillis())); ps.setObject(4, "3"); ps.addBatch(); ps.setObject(1, "field2"); ps.setInt(2, 2); ps.setObject(3, new Timestamp(System.currentTimeMillis())); ps.setObject(4, "2"); ps.addBatch(); // String sql1 = "select count(*) from zst_role"; // ResultSet rs = s.executeQuery(sql1); // if(rs.next()) { // System.out.println(rs.getString(1)); // } int[] result1 = ps.executeBatch(); System.out.println(result1); ps.setObject(1, "field1"); ps.setInt(2, 1); ps.setObject(3, new Timestamp(System.currentTimeMillis())); ps.setObject(4, "1"); ps.addBatch(); int[] result2 = ps.executeBatch(); System.out.println(result2); // String sql2 = "insert into XACTIVITYSN (id,activityname,sn) values(1,'22','33')"; // s.execute(sql2); } catch (ClassNotFoundException e) { } catch (SQLException e) { System.err.println(e); System.out.println("SQLState:" + e.getSQLState()); System.out.println("ErrorCode:" + e.getErrorCode()); } finally { try { conn.close(); } catch (Exception e) { System.err.println(e); } } } }
[ "tyouketu@gmail.com" ]
tyouketu@gmail.com
d32422e11e06b1d8c4c665d68a3c2aec68848fe0
508c6fe17cfa3768d2ef1a2922b404677b04406a
/src/main/java/com/scht/common/ValidateCodeServlet.java
500dfddd60e27c706c4e0fe10a4c062b19d18780
[]
no_license
vanjogger/SchtWeb
571bed0abab52bcaf28f9f8baaa8dffbfccdc6c2
2b4402efcbf44809b8610887a9ba7889b6b287f9
refs/heads/master
2020-07-02T07:45:39.802088
2017-09-16T01:09:54
2017-09-16T01:09:54
74,320,069
0
0
null
null
null
null
UTF-8
Java
false
false
1,836
java
package com.scht.common; import com.scht.admin.SystemCache; import com.scht.util.VerifyCodeUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.imageio.ImageIO; import javax.servlet.Servlet; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.awt.*; import java.awt.image.BufferedImage; import java.io.IOException; /** * Created by Administrator on 2015/12/23. */ public class ValidateCodeServlet extends HttpServlet implements Servlet { private static Logger logger = LoggerFactory.getLogger(ValidateCodeServlet.class); @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setHeader("Pragma", "no-cache"); response.setHeader("Cache-Control", "no-cache"); response.setDateHeader("Expires", 0); String verifyCode = VerifyCodeUtil.generateTextCode(VerifyCodeUtil.TYPE_NUM_ONLY, 4, null); //将验证码放到HttpSession里面 request.getSession().setAttribute(SystemCache.SESSION_YZM, verifyCode); //设置输出的内容的类型为JPEG图像 response.setContentType("image/jpeg"); BufferedImage bufferedImage = VerifyCodeUtil.generateImageCode(verifyCode, 90, 30, 3, true, Color.WHITE, Color.BLACK, null); //写给浏览器 ImageIO.write(bufferedImage, "JPEG", response.getOutputStream()); } @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { doPost(req, resp); } @Override public void init() throws ServletException { super.init(); ImageIO.setUseCache(false); } }
[ "rpg0209" ]
rpg0209
f3726f5152ae36ec729a1a4cb6656d07cab3beed
73b47ff3acbaecf3ceab082b57ac20db84c83292
/src/main/java/com/pupuly/webapp/listener/StartupListener.java
0849a9c350c8fc09a27c1b41ce4e94d2fb151184
[]
no_license
hadoopeco/qrcode
f6120f47cb88c65206817f1daacc59dd48024990
a95a5fe793cced1ad94d753734dfdf4eece8c9a9
refs/heads/master
2020-12-25T19:26:11.898993
2012-06-16T07:45:52
2012-06-16T07:45:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,128
java
package com.pupuly.webapp.listener; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import com.pupuly.Constants; import com.pupuly.service.LookupManager; import org.compass.gps.CompassGps; import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.context.ApplicationContext; import org.springframework.security.authentication.AuthenticationProvider; import org.springframework.security.authentication.ProviderManager; import org.springframework.security.authentication.RememberMeAuthenticationProvider; import org.springframework.security.authentication.encoding.PasswordEncoder; import org.springframework.web.context.support.WebApplicationContextUtils; import javax.servlet.ServletContext; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; import java.util.HashMap; import java.util.Map; /** * <p>StartupListener class used to initialize and database settings * and populate any application-wide drop-downs. * <p/> * <p>Keep in mind that this listener is executed outside of OpenSessionInViewFilter, * so if you're using Hibernate you'll have to explicitly initialize all loaded data at the * GenericDao or service level to avoid LazyInitializationException. Hibernate.initialize() works * well for doing this. * * @author <a href="mailto:matt@raibledesigns.com">Matt Raible</a> */ public class StartupListener implements ServletContextListener { private static final Log log = LogFactory.getLog(StartupListener.class); /** * {@inheritDoc} */ @SuppressWarnings("unchecked") public void contextInitialized(ServletContextEvent event) { log.debug("Initializing context..."); ServletContext context = event.getServletContext(); // Orion starts Servlets before Listeners, so check if the config // object already exists Map<String, Object> config = (HashMap<String, Object>) context.getAttribute(Constants.CONFIG); if (config == null) { config = new HashMap<String, Object>(); } if (context.getInitParameter(Constants.CSS_THEME) != null) { config.put(Constants.CSS_THEME, context.getInitParameter(Constants.CSS_THEME)); } ApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(context); /*String[] beans = ctx.getBeanDefinitionNames(); for (String bean : beans) { log.debug(bean); }*/ PasswordEncoder passwordEncoder = null; try { ProviderManager provider = (ProviderManager) ctx.getBean("org.springframework.security.authentication.ProviderManager#0"); for (Object o : provider.getProviders()) { AuthenticationProvider p = (AuthenticationProvider) o; if (p instanceof RememberMeAuthenticationProvider) { config.put("rememberMeEnabled", Boolean.TRUE); } else if (ctx.getBean("passwordEncoder") != null) { passwordEncoder = (PasswordEncoder) ctx.getBean("passwordEncoder"); } } } catch (NoSuchBeanDefinitionException n) { log.debug("authenticationManager bean not found, assuming test and ignoring..."); // ignore, should only happen when testing } context.setAttribute(Constants.CONFIG, config); // output the retrieved values for the Init and Context Parameters if (log.isDebugEnabled()) { log.debug("Remember Me Enabled? " + config.get("rememberMeEnabled")); if (passwordEncoder != null) { log.debug("Password Encoder: " + passwordEncoder.getClass().getSimpleName()); } log.debug("Populating drop-downs..."); } setupContext(context); } /** * This method uses the LookupManager to lookup available roles from the data layer. * * @param context The servlet context */ public static void setupContext(ServletContext context) { ApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(context); LookupManager mgr = (LookupManager) ctx.getBean("lookupManager"); // get list of possible roles context.setAttribute(Constants.AVAILABLE_ROLES, mgr.getAllRoles()); log.debug("Drop-down initialization complete [OK]"); CompassGps compassGps = ctx.getBean(CompassGps.class); compassGps.index(); } /** * Shutdown servlet context (currently a no-op method). * * @param servletContextEvent The servlet context event */ public void contextDestroyed(ServletContextEvent servletContextEvent) { //LogFactory.release(Thread.currentThread().getContextClassLoader()); //Commented out the above call to avoid warning when SLF4J in classpath. //WARN: The method class org.apache.commons.logging.impl.SLF4JLogFactory#release() was invoked. //WARN: Please see http://www.slf4j.org/codes.html for an explanation. } }
[ "wbmark@gmail.com" ]
wbmark@gmail.com
0f083a192295abba08481c03867831a2b9e0922b
04de259c6997adc80d1a64c732f4e5958261676c
/src/main/java/com/recon/dao/TrainingDao.java
54a708d368df28e2394a850c3ea3cc892743b379
[]
no_license
vsanse/myresume-spring-server
c00a44962bf6e8803556a68905296e57aad8b20c
e5483386d17a9e5f5d2866f099ac636a534daf1f
refs/heads/master
2020-03-21T06:59:37.314752
2018-08-11T07:54:09
2018-08-11T07:54:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
666
java
package com.recon.dao; import java.util.List; import com.recon.entity.TrainingDetails; import javassist.NotFoundException; public interface TrainingDao { public String addTrainingDetails(TrainingDetails trainingdetails); public TrainingDetails updateTrainingDetails(TrainingDetails trainingdetails) throws NotFoundException; public int removeTrainingDetails(Long trainingId); public List<TrainingDetails> getAllTrainingDetails(); public TrainingDetails findByTrainingId(Long trainingId); public List<TrainingDetails> getTrainingDetailsByUser(String username); public TrainingDetails findbyTrainingIDandUsername(Long trainingId, String username); }
[ "vishal2421@outlook.com" ]
vishal2421@outlook.com
5a2d1eeaa768e10f319b41c5ee175b0b12409c8a
e6f1557f525af5c4c3c6e9bce7d07f035625199a
/config-client/src/main/java/com/gettop/configclient/business/model/GatewayRoute.java
adcff37b37410a226414f283bd284e8ae5b05043
[]
no_license
songpeng-inspur/SpringCloud
4b7f25c24c7309750d9516d55ec73000167e52c1
b6c5b312d629c9ec61b44dfb260bf8d92c69c9c1
refs/heads/master
2022-06-22T14:13:14.922723
2019-12-25T09:01:09
2019-12-25T09:01:09
230,030,363
1
0
null
2022-06-17T02:48:34
2019-12-25T02:42:12
Java
UTF-8
Java
false
false
6,682
java
package com.gettop.configclient.business.model; import java.io.Serializable; import java.util.Date; /** * gateway_route * @author */ public class GatewayRoute implements Serializable { /** * 主键 */ private Integer id; /** * 服务ID */ private String serviceid; /** * URI */ private String uri; /** * 断言 */ private String predicates; /** * 过滤器 */ private String filters; /** * 序号 */ private String order; /** * 创建者 */ private Integer creatorid; /** * 创建时间 */ private Date createdate; /** * 更新者 */ private Integer updateid; /** * 更新时间 */ private Date updatedate; /** * 备注 */ private String remarks; /** * 删除标记 */ private String delflag; private static final long serialVersionUID = 1L; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getServiceid() { return serviceid; } public void setServiceid(String serviceid) { this.serviceid = serviceid; } public String getUri() { return uri; } public void setUri(String uri) { this.uri = uri; } public String getPredicates() { return predicates; } public void setPredicates(String predicates) { this.predicates = predicates; } public String getFilters() { return filters; } public void setFilters(String filters) { this.filters = filters; } public String getOrder() { return order; } public void setOrder(String order) { this.order = order; } public Integer getCreatorid() { return creatorid; } public void setCreatorid(Integer creatorid) { this.creatorid = creatorid; } public Date getCreatedate() { return createdate; } public void setCreatedate(Date createdate) { this.createdate = createdate; } public Integer getUpdateid() { return updateid; } public void setUpdateid(Integer updateid) { this.updateid = updateid; } public Date getUpdatedate() { return updatedate; } public void setUpdatedate(Date updatedate) { this.updatedate = updatedate; } public String getRemarks() { return remarks; } public void setRemarks(String remarks) { this.remarks = remarks; } public String getDelflag() { return delflag; } public void setDelflag(String delflag) { this.delflag = delflag; } @Override public boolean equals(Object that) { if (this == that) { return true; } if (that == null) { return false; } if (getClass() != that.getClass()) { return false; } GatewayRoute other = (GatewayRoute) that; return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) && (this.getServiceid() == null ? other.getServiceid() == null : this.getServiceid().equals(other.getServiceid())) && (this.getUri() == null ? other.getUri() == null : this.getUri().equals(other.getUri())) && (this.getPredicates() == null ? other.getPredicates() == null : this.getPredicates().equals(other.getPredicates())) && (this.getFilters() == null ? other.getFilters() == null : this.getFilters().equals(other.getFilters())) && (this.getOrder() == null ? other.getOrder() == null : this.getOrder().equals(other.getOrder())) && (this.getCreatorid() == null ? other.getCreatorid() == null : this.getCreatorid().equals(other.getCreatorid())) && (this.getCreatedate() == null ? other.getCreatedate() == null : this.getCreatedate().equals(other.getCreatedate())) && (this.getUpdateid() == null ? other.getUpdateid() == null : this.getUpdateid().equals(other.getUpdateid())) && (this.getUpdatedate() == null ? other.getUpdatedate() == null : this.getUpdatedate().equals(other.getUpdatedate())) && (this.getRemarks() == null ? other.getRemarks() == null : this.getRemarks().equals(other.getRemarks())) && (this.getDelflag() == null ? other.getDelflag() == null : this.getDelflag().equals(other.getDelflag())); } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); result = prime * result + ((getServiceid() == null) ? 0 : getServiceid().hashCode()); result = prime * result + ((getUri() == null) ? 0 : getUri().hashCode()); result = prime * result + ((getPredicates() == null) ? 0 : getPredicates().hashCode()); result = prime * result + ((getFilters() == null) ? 0 : getFilters().hashCode()); result = prime * result + ((getOrder() == null) ? 0 : getOrder().hashCode()); result = prime * result + ((getCreatorid() == null) ? 0 : getCreatorid().hashCode()); result = prime * result + ((getCreatedate() == null) ? 0 : getCreatedate().hashCode()); result = prime * result + ((getUpdateid() == null) ? 0 : getUpdateid().hashCode()); result = prime * result + ((getUpdatedate() == null) ? 0 : getUpdatedate().hashCode()); result = prime * result + ((getRemarks() == null) ? 0 : getRemarks().hashCode()); result = prime * result + ((getDelflag() == null) ? 0 : getDelflag().hashCode()); return result; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(getClass().getSimpleName()); sb.append(" ["); sb.append("Hash = ").append(hashCode()); sb.append(", id=").append(id); sb.append(", serviceid=").append(serviceid); sb.append(", uri=").append(uri); sb.append(", predicates=").append(predicates); sb.append(", filters=").append(filters); sb.append(", order=").append(order); sb.append(", creatorid=").append(creatorid); sb.append(", createdate=").append(createdate); sb.append(", updateid=").append(updateid); sb.append(", updatedate=").append(updatedate); sb.append(", remarks=").append(remarks); sb.append(", delflag=").append(delflag); sb.append(", serialVersionUID=").append(serialVersionUID); sb.append("]"); return sb.toString(); } }
[ "Sp520109" ]
Sp520109
9147a73ca10dd0a2f3eb488d594d9dc72164e423
349b0dbeaccc8b9113434c7bce7b9166f4ad51de
/src/java/intaplet/server.java
06085df2d7c9df6fc57fb9c84d29037815a54c18
[]
no_license
jbailhache/log
94a89342bb2ac64018e5aa0cf84c19ef40aa84b4
2780adfe3df18f9e40653296aae9c56a31369d47
refs/heads/master
2021-01-10T08:55:43.044934
2020-01-09T02:57:38
2020-01-09T02:57:38
54,238,064
0
0
null
null
null
null
UTF-8
Java
false
false
410
java
import java.net.*; import java.io.*; class server { public static void main (String args[]) { try { ServerSocket s = new ServerSocket (1234); Socket c = s.accept(); DataOutputStream out = new DataOutputStream (c.getOutputStream()); out.writeBytes ("Bonjour !"); c.close(); s.close(); } catch (Exception e) { System.out.println (e.toString()); } } }
[ "jacques.bailhache@gmail.com" ]
jacques.bailhache@gmail.com
f54f9d655d544adafcba1d35363b5800f90fbf74
9b95822b466fb5152e38bced0ef61f901c5d417d
/news/app/src/generated/debug/java/com/wanfang/personal/UploadFileResponse.java
dfc9fc68ee69e190866dc10102f6df5be377d7c6
[]
no_license
johan--/android-model
4817c21af9fa423ca699431454babb81a8704dc8
a37980e0e5ded5fc848f4ce9a7b1e3e575af1dd1
refs/heads/master
2021-08-24T05:56:26.428347
2017-12-08T09:19:44
2017-12-08T09:19:44
null
0
0
null
null
null
null
UTF-8
Java
false
true
28,085
java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: personalCenter/msg_common.proto package com.wanfang.personal; /** * Protobuf type {@code personal.UploadFileResponse} */ public final class UploadFileResponse extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:personal.UploadFileResponse) UploadFileResponseOrBuilder { // Use UploadFileResponse.newBuilder() to construct. private UploadFileResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private UploadFileResponse() { } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } private UploadFileResponse( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); int mutable_bitField0_ = 0; try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; default: { if (!input.skipField(tag)) { done = true; } break; } case 10: { if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { uploadUrls_ = com.google.protobuf.MapField.newMapField( UploadUrlsDefaultEntryHolder.defaultEntry); mutable_bitField0_ |= 0x00000001; } com.google.protobuf.MapEntry<java.lang.String, java.lang.String> uploadUrls__ = input.readMessage( UploadUrlsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); uploadUrls_.getMutableMap().put( uploadUrls__.getKey(), uploadUrls__.getValue()); break; } case 18: { com.wanfang.grpcCommon.MsgError.GrpcError.Builder subBuilder = null; if (error_ != null) { subBuilder = error_.toBuilder(); } error_ = input.readMessage(com.wanfang.grpcCommon.MsgError.GrpcError.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(error_); error_ = subBuilder.buildPartial(); } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.wanfang.personal.MsgCommon.internal_static_personal_UploadFileResponse_descriptor; } @SuppressWarnings({"rawtypes"}) protected com.google.protobuf.MapField internalGetMapField( int number) { switch (number) { case 1: return internalGetUploadUrls(); default: throw new RuntimeException( "Invalid map field number: " + number); } } protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.wanfang.personal.MsgCommon.internal_static_personal_UploadFileResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( com.wanfang.personal.UploadFileResponse.class, com.wanfang.personal.UploadFileResponse.Builder.class); } private int bitField0_; public static final int UPLOAD_URLS_FIELD_NUMBER = 1; private static final class UploadUrlsDefaultEntryHolder { static final com.google.protobuf.MapEntry< java.lang.String, java.lang.String> defaultEntry = com.google.protobuf.MapEntry .<java.lang.String, java.lang.String>newDefaultInstance( com.wanfang.personal.MsgCommon.internal_static_personal_UploadFileResponse_UploadUrlsEntry_descriptor, com.google.protobuf.WireFormat.FieldType.STRING, "", com.google.protobuf.WireFormat.FieldType.STRING, ""); } private com.google.protobuf.MapField< java.lang.String, java.lang.String> uploadUrls_; private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetUploadUrls() { if (uploadUrls_ == null) { return com.google.protobuf.MapField.emptyMapField( UploadUrlsDefaultEntryHolder.defaultEntry); } return uploadUrls_; } public int getUploadUrlsCount() { return internalGetUploadUrls().getMap().size(); } /** * <code>map&lt;string, string&gt; upload_urls = 1;</code> */ public boolean containsUploadUrls( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } return internalGetUploadUrls().getMap().containsKey(key); } /** * Use {@link #getUploadUrlsMap()} instead. */ @java.lang.Deprecated public java.util.Map<java.lang.String, java.lang.String> getUploadUrls() { return getUploadUrlsMap(); } /** * <code>map&lt;string, string&gt; upload_urls = 1;</code> */ public java.util.Map<java.lang.String, java.lang.String> getUploadUrlsMap() { return internalGetUploadUrls().getMap(); } /** * <code>map&lt;string, string&gt; upload_urls = 1;</code> */ public java.lang.String getUploadUrlsOrDefault( java.lang.String key, java.lang.String defaultValue) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map<java.lang.String, java.lang.String> map = internalGetUploadUrls().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** * <code>map&lt;string, string&gt; upload_urls = 1;</code> */ public java.lang.String getUploadUrlsOrThrow( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map<java.lang.String, java.lang.String> map = internalGetUploadUrls().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); } public static final int ERROR_FIELD_NUMBER = 2; private com.wanfang.grpcCommon.MsgError.GrpcError error_; /** * <code>optional .grpcCommon.GrpcError error = 2;</code> */ public boolean hasError() { return error_ != null; } /** * <code>optional .grpcCommon.GrpcError error = 2;</code> */ public com.wanfang.grpcCommon.MsgError.GrpcError getError() { return error_ == null ? com.wanfang.grpcCommon.MsgError.GrpcError.getDefaultInstance() : error_; } /** * <code>optional .grpcCommon.GrpcError error = 2;</code> */ public com.wanfang.grpcCommon.MsgError.GrpcErrorOrBuilder getErrorOrBuilder() { return getError(); } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { com.google.protobuf.GeneratedMessageV3 .serializeStringMapTo( output, internalGetUploadUrls(), UploadUrlsDefaultEntryHolder.defaultEntry, 1); if (error_ != null) { output.writeMessage(2, getError()); } } public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; for (java.util.Map.Entry<java.lang.String, java.lang.String> entry : internalGetUploadUrls().getMap().entrySet()) { com.google.protobuf.MapEntry<java.lang.String, java.lang.String> uploadUrls__ = UploadUrlsDefaultEntryHolder.defaultEntry.newBuilderForType() .setKey(entry.getKey()) .setValue(entry.getValue()) .build(); size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, uploadUrls__); } if (error_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, getError()); } memoizedSize = size; return size; } private static final long serialVersionUID = 0L; @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.wanfang.personal.UploadFileResponse)) { return super.equals(obj); } com.wanfang.personal.UploadFileResponse other = (com.wanfang.personal.UploadFileResponse) obj; boolean result = true; result = result && internalGetUploadUrls().equals( other.internalGetUploadUrls()); result = result && (hasError() == other.hasError()); if (hasError()) { result = result && getError() .equals(other.getError()); } return result; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (!internalGetUploadUrls().getMap().isEmpty()) { hash = (37 * hash) + UPLOAD_URLS_FIELD_NUMBER; hash = (53 * hash) + internalGetUploadUrls().hashCode(); } if (hasError()) { hash = (37 * hash) + ERROR_FIELD_NUMBER; hash = (53 * hash) + getError().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.wanfang.personal.UploadFileResponse parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.wanfang.personal.UploadFileResponse parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.wanfang.personal.UploadFileResponse parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.wanfang.personal.UploadFileResponse parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.wanfang.personal.UploadFileResponse parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.wanfang.personal.UploadFileResponse parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static com.wanfang.personal.UploadFileResponse parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.wanfang.personal.UploadFileResponse parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static com.wanfang.personal.UploadFileResponse parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.wanfang.personal.UploadFileResponse parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.wanfang.personal.UploadFileResponse prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * Protobuf type {@code personal.UploadFileResponse} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:personal.UploadFileResponse) com.wanfang.personal.UploadFileResponseOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.wanfang.personal.MsgCommon.internal_static_personal_UploadFileResponse_descriptor; } @SuppressWarnings({"rawtypes"}) protected com.google.protobuf.MapField internalGetMapField( int number) { switch (number) { case 1: return internalGetUploadUrls(); default: throw new RuntimeException( "Invalid map field number: " + number); } } @SuppressWarnings({"rawtypes"}) protected com.google.protobuf.MapField internalGetMutableMapField( int number) { switch (number) { case 1: return internalGetMutableUploadUrls(); default: throw new RuntimeException( "Invalid map field number: " + number); } } protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.wanfang.personal.MsgCommon.internal_static_personal_UploadFileResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( com.wanfang.personal.UploadFileResponse.class, com.wanfang.personal.UploadFileResponse.Builder.class); } // Construct using com.wanfang.personal.UploadFileResponse.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } public Builder clear() { super.clear(); internalGetMutableUploadUrls().clear(); if (errorBuilder_ == null) { error_ = null; } else { error_ = null; errorBuilder_ = null; } return this; } public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.wanfang.personal.MsgCommon.internal_static_personal_UploadFileResponse_descriptor; } public com.wanfang.personal.UploadFileResponse getDefaultInstanceForType() { return com.wanfang.personal.UploadFileResponse.getDefaultInstance(); } public com.wanfang.personal.UploadFileResponse build() { com.wanfang.personal.UploadFileResponse result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } public com.wanfang.personal.UploadFileResponse buildPartial() { com.wanfang.personal.UploadFileResponse result = new com.wanfang.personal.UploadFileResponse(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; result.uploadUrls_ = internalGetUploadUrls(); result.uploadUrls_.makeImmutable(); if (errorBuilder_ == null) { result.error_ = error_; } else { result.error_ = errorBuilder_.build(); } result.bitField0_ = to_bitField0_; onBuilt(); return result; } public Builder clone() { return (Builder) super.clone(); } public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { return (Builder) super.setField(field, value); } public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return (Builder) super.clearField(field); } public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return (Builder) super.clearOneof(oneof); } public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value) { return (Builder) super.setRepeatedField(field, index, value); } public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { return (Builder) super.addRepeatedField(field, value); } public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.wanfang.personal.UploadFileResponse) { return mergeFrom((com.wanfang.personal.UploadFileResponse)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.wanfang.personal.UploadFileResponse other) { if (other == com.wanfang.personal.UploadFileResponse.getDefaultInstance()) return this; internalGetMutableUploadUrls().mergeFrom( other.internalGetUploadUrls()); if (other.hasError()) { mergeError(other.getError()); } onChanged(); return this; } public final boolean isInitialized() { return true; } public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.wanfang.personal.UploadFileResponse parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.wanfang.personal.UploadFileResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_; private com.google.protobuf.MapField< java.lang.String, java.lang.String> uploadUrls_; private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetUploadUrls() { if (uploadUrls_ == null) { return com.google.protobuf.MapField.emptyMapField( UploadUrlsDefaultEntryHolder.defaultEntry); } return uploadUrls_; } private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetMutableUploadUrls() { onChanged();; if (uploadUrls_ == null) { uploadUrls_ = com.google.protobuf.MapField.newMapField( UploadUrlsDefaultEntryHolder.defaultEntry); } if (!uploadUrls_.isMutable()) { uploadUrls_ = uploadUrls_.copy(); } return uploadUrls_; } public int getUploadUrlsCount() { return internalGetUploadUrls().getMap().size(); } /** * <code>map&lt;string, string&gt; upload_urls = 1;</code> */ public boolean containsUploadUrls( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } return internalGetUploadUrls().getMap().containsKey(key); } /** * Use {@link #getUploadUrlsMap()} instead. */ @java.lang.Deprecated public java.util.Map<java.lang.String, java.lang.String> getUploadUrls() { return getUploadUrlsMap(); } /** * <code>map&lt;string, string&gt; upload_urls = 1;</code> */ public java.util.Map<java.lang.String, java.lang.String> getUploadUrlsMap() { return internalGetUploadUrls().getMap(); } /** * <code>map&lt;string, string&gt; upload_urls = 1;</code> */ public java.lang.String getUploadUrlsOrDefault( java.lang.String key, java.lang.String defaultValue) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map<java.lang.String, java.lang.String> map = internalGetUploadUrls().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** * <code>map&lt;string, string&gt; upload_urls = 1;</code> */ public java.lang.String getUploadUrlsOrThrow( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map<java.lang.String, java.lang.String> map = internalGetUploadUrls().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); } public Builder clearUploadUrls() { getMutableUploadUrls().clear(); return this; } /** * <code>map&lt;string, string&gt; upload_urls = 1;</code> */ public Builder removeUploadUrls( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } getMutableUploadUrls().remove(key); return this; } /** * Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map<java.lang.String, java.lang.String> getMutableUploadUrls() { return internalGetMutableUploadUrls().getMutableMap(); } /** * <code>map&lt;string, string&gt; upload_urls = 1;</code> */ public Builder putUploadUrls( java.lang.String key, java.lang.String value) { if (key == null) { throw new java.lang.NullPointerException(); } if (value == null) { throw new java.lang.NullPointerException(); } getMutableUploadUrls().put(key, value); return this; } /** * <code>map&lt;string, string&gt; upload_urls = 1;</code> */ public Builder putAllUploadUrls( java.util.Map<java.lang.String, java.lang.String> values) { getMutableUploadUrls().putAll(values); return this; } private com.wanfang.grpcCommon.MsgError.GrpcError error_ = null; private com.google.protobuf.SingleFieldBuilderV3< com.wanfang.grpcCommon.MsgError.GrpcError, com.wanfang.grpcCommon.MsgError.GrpcError.Builder, com.wanfang.grpcCommon.MsgError.GrpcErrorOrBuilder> errorBuilder_; /** * <code>optional .grpcCommon.GrpcError error = 2;</code> */ public boolean hasError() { return errorBuilder_ != null || error_ != null; } /** * <code>optional .grpcCommon.GrpcError error = 2;</code> */ public com.wanfang.grpcCommon.MsgError.GrpcError getError() { if (errorBuilder_ == null) { return error_ == null ? com.wanfang.grpcCommon.MsgError.GrpcError.getDefaultInstance() : error_; } else { return errorBuilder_.getMessage(); } } /** * <code>optional .grpcCommon.GrpcError error = 2;</code> */ public Builder setError(com.wanfang.grpcCommon.MsgError.GrpcError value) { if (errorBuilder_ == null) { if (value == null) { throw new NullPointerException(); } error_ = value; onChanged(); } else { errorBuilder_.setMessage(value); } return this; } /** * <code>optional .grpcCommon.GrpcError error = 2;</code> */ public Builder setError( com.wanfang.grpcCommon.MsgError.GrpcError.Builder builderForValue) { if (errorBuilder_ == null) { error_ = builderForValue.build(); onChanged(); } else { errorBuilder_.setMessage(builderForValue.build()); } return this; } /** * <code>optional .grpcCommon.GrpcError error = 2;</code> */ public Builder mergeError(com.wanfang.grpcCommon.MsgError.GrpcError value) { if (errorBuilder_ == null) { if (error_ != null) { error_ = com.wanfang.grpcCommon.MsgError.GrpcError.newBuilder(error_).mergeFrom(value).buildPartial(); } else { error_ = value; } onChanged(); } else { errorBuilder_.mergeFrom(value); } return this; } /** * <code>optional .grpcCommon.GrpcError error = 2;</code> */ public Builder clearError() { if (errorBuilder_ == null) { error_ = null; onChanged(); } else { error_ = null; errorBuilder_ = null; } return this; } /** * <code>optional .grpcCommon.GrpcError error = 2;</code> */ public com.wanfang.grpcCommon.MsgError.GrpcError.Builder getErrorBuilder() { onChanged(); return getErrorFieldBuilder().getBuilder(); } /** * <code>optional .grpcCommon.GrpcError error = 2;</code> */ public com.wanfang.grpcCommon.MsgError.GrpcErrorOrBuilder getErrorOrBuilder() { if (errorBuilder_ != null) { return errorBuilder_.getMessageOrBuilder(); } else { return error_ == null ? com.wanfang.grpcCommon.MsgError.GrpcError.getDefaultInstance() : error_; } } /** * <code>optional .grpcCommon.GrpcError error = 2;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.wanfang.grpcCommon.MsgError.GrpcError, com.wanfang.grpcCommon.MsgError.GrpcError.Builder, com.wanfang.grpcCommon.MsgError.GrpcErrorOrBuilder> getErrorFieldBuilder() { if (errorBuilder_ == null) { errorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.wanfang.grpcCommon.MsgError.GrpcError, com.wanfang.grpcCommon.MsgError.GrpcError.Builder, com.wanfang.grpcCommon.MsgError.GrpcErrorOrBuilder>( getError(), getParentForChildren(), isClean()); error_ = null; } return errorBuilder_; } public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return this; } public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return this; } // @@protoc_insertion_point(builder_scope:personal.UploadFileResponse) } // @@protoc_insertion_point(class_scope:personal.UploadFileResponse) private static final com.wanfang.personal.UploadFileResponse DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.wanfang.personal.UploadFileResponse(); } public static com.wanfang.personal.UploadFileResponse getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<UploadFileResponse> PARSER = new com.google.protobuf.AbstractParser<UploadFileResponse>() { public UploadFileResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new UploadFileResponse(input, extensionRegistry); } }; public static com.google.protobuf.Parser<UploadFileResponse> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<UploadFileResponse> getParserForType() { return PARSER; } public com.wanfang.personal.UploadFileResponse getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }
[ "438157030@qq.com" ]
438157030@qq.com
8f09e2b9dca17ba72ec97f5560c237051cd2f7f3
3c5b9d4e62b5289a098d5026476dc0a226aefa9b
/app/src/test/java/com/example/abhay/mausamaajkal/ExampleUnitTest.java
b1995ee36d25b6607a3bda2dbc86c2d4f8655467
[]
no_license
abhay-kr/WeatherApp
9b1fa795f004003616fe6e9877efdf27f1ca5512
a3ecffa55827375c5506d8df34bc088426888633
refs/heads/master
2020-05-01T10:52:29.263271
2019-03-24T15:08:35
2019-03-24T15:08:35
177,427,312
0
0
null
null
null
null
UTF-8
Java
false
false
391
java
package com.example.abhay.mausamaajkal; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
[ "abhaykrpro@gmail.com" ]
abhaykrpro@gmail.com
32c3b105653d10a83dee8d13860d5a6884a7b897
bf2966abae57885c29e70852243a22abc8ba8eb0
/aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/transform/GetApplicationSettingsRequestMarshaller.java
2f0c9bc9caf001ee4173a6565fe6cd80e11bb3b3
[ "Apache-2.0" ]
permissive
kmbotts/aws-sdk-java
ae20b3244131d52b9687eb026b9c620da8b49935
388f6427e00fb1c2f211abda5bad3a75d29eef62
refs/heads/master
2021-12-23T14:39:26.369661
2021-07-26T20:09:07
2021-07-26T20:09:07
246,296,939
0
0
Apache-2.0
2020-03-10T12:37:34
2020-03-10T12:37:33
null
UTF-8
Java
false
false
2,098
java
/* * Copyright 2016-2021 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.pinpoint.model.transform; import javax.annotation.Generated; import com.amazonaws.SdkClientException; import com.amazonaws.services.pinpoint.model.*; import com.amazonaws.protocol.*; import com.amazonaws.annotation.SdkInternalApi; /** * GetApplicationSettingsRequestMarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") @SdkInternalApi public class GetApplicationSettingsRequestMarshaller { private static final MarshallingInfo<String> APPLICATIONID_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PATH).marshallLocationName("application-id").build(); private static final GetApplicationSettingsRequestMarshaller instance = new GetApplicationSettingsRequestMarshaller(); public static GetApplicationSettingsRequestMarshaller getInstance() { return instance; } /** * Marshall the given parameter object. */ public void marshall(GetApplicationSettingsRequest getApplicationSettingsRequest, ProtocolMarshaller protocolMarshaller) { if (getApplicationSettingsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(getApplicationSettingsRequest.getApplicationId(), APPLICATIONID_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
[ "" ]
07b29450904f0f6592104056a316801364620259
577febbc697ea9cc2d645d79677b247d0c96af32
/src/test/java/com/alphadevs/tools/repository/timezone/DateTimeWrapperRepository.java
feda8536f33ea3ba4791a83ffc3fc1822ddc4c0d
[]
no_license
AlphaDevTeam/DBTool
e57c596f35eac0b336f116d970216805560e5c58
621055301908ba31e747eba3dd9d58e3a569db39
refs/heads/master
2020-12-21T03:09:33.332916
2020-01-26T08:46:38
2020-01-26T08:46:38
236,287,249
0
0
null
2020-01-26T08:51:30
2020-01-26T08:46:24
Java
UTF-8
Java
false
false
346
java
package com.alphadevs.tools.repository.timezone; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; /** * Spring Data JPA repository for the {@link DateTimeWrapper} entity. */ @Repository public interface DateTimeWrapperRepository extends JpaRepository<DateTimeWrapper, Long> { }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
d9418e998b887e5ba0c717d4f22de1f74a8c6208
9d7e249528fea8d7172275e7764d26edc8a84499
/insertsGenerators/src/Generator/PlacesGenerator.java
c64806e04c852110a0697bb325886fb47c70040d
[]
no_license
BSniegowski/internship-database
cae4005339cfb2f68955b5eccbe63cc59eebee85
d23680e5f26ccf20469146fb13f65ab4efb55586
refs/heads/master
2023-05-29T12:44:08.090173
2021-06-08T22:00:10
2021-06-08T22:00:10
352,678,713
0
0
null
null
null
null
UTF-8
Java
false
false
19,118
java
import java.util.Random; public class PlacesGenerator { static int cities = 673; static int MANY = 1500; static int companies = 500; static String [] streetsArray = new String[] {"AALTO PLACE", "ABASCO COURT", "ABDELLA WAY", "ABER LANE", "ABERDEEN RUN", "ABNEY AVENUE", "ACOSTA COURT", "ADDISON AVENUE", "ADLER COURT", "ADRIENNE WAY", "AGUA WAY", "AINTREE LANE", "ALANDARI LANE", "ALBEMARLE AVENUE", "ALCARAZ PLACE", "ALCOTT AVENUE", "ALDAMA AVENUE", "ALESIO STREET", "ALFONSO LANE", "ALHAMBRA WAY", "ALLAGASH AVENUE", "ALLENDE AVENUE", "ALLSTON COURT", "ALMERIA STREET", "ALONZO AVENUE", "ALTAMAHA COURT", "ALTMAN AVENUE", "ALVEREZ AVENUE", "ALZARINE TERRACE", "AMBER COURT", "AMBLER CIRCLE", "AMHERST WAY", "AMISH PATH", "ANCHORAGE ROAD", "ANDREWS AVENUE", "ANHINGA LANE", "ANNA MARIA AVENUE", "ANSEL AVENUE", "ANTHEM ROAD", "ANVIL AVENUE", "APOLLO LANE", "ARANDA LANE", "ARBOR TRAIL", "ARCHER AVENUE", "ARDMORE WAY", "ARGYLL STREET", "ARJAY COURT", "ARMONDO DRIVE", "ARREDONDO DRIVE", "ARRUDA TERRACE", "ARVIN LANE", "ASHER PATH", "ASHLAND AVENUE", "ASHWOOD RUN", "ASTORIA AVENUE", "ATHENS LANE", "ATWELL AVENUE", "AUBURN AVENUE", "AUBURNDALE AVENUE", "AUGUSTINE DRIVE", "AVALOS DRIVE", "AVENIDA CENTRAL", "AVERY PLACE", "AVON LOOP", "AYALA WAY", "BACHMAN PATH", "BACKWATER WAY", "BAEZ WAY", "BAINAN PLACE", "BAKER LANE", "BALDWIN RUN", "BALMORAL LANE", "BANBERRY RUN", "BANDO LANE", "BARBADOS PLACE", "BARCELONA DRIVE", "BARNACLE TERRACE", "BARNWELL PLACE", "BARREL LOOP", "BARRINEAU PLACE", "BARTLET LANE", "BARTRAM LOOP", "BATALLY COURT", "BATON PLACE", "BAY MEADOWS LANE", "BAYHILL DRIVE", "BAYPOINT WAY", "BEACON HILL COURT", "BEATRICE WAY", "BEAULIEU LOOP", "BECERRIL COURT", "BEDFORD WAY", "BEECHWOOD AVENUE", "BELCHERRY LOOP", "BELHAVEN LOOP", "BELLA CRUZ DRIVE", "BELLE GLADE AVENUE", "BELLEROSE TRAIL", "BELVEDERE BOULEVARD", "BENITEZ STREET", "BENTWOOD LANE", "BERKELEY LANE", "BERMUDEZ COURT", "BERNAY COURT", "BERRIEN COURT", "BERWYN WAY", "BEVILL LANE", "BICHARA BLVD.", "BIRCHBROOK AVENUE", "BIRMINGHAM TERRACE", "BLACK BEAR LANE", "BLACK STONE PLACE", "BLACKSBURG WAY", "BLACKVILLE DRIVE", "BLAKE LANE", "BLOOMINGTON PLACE", "BLUE HERON AVENUE", "BLUEBIRD LANE", "BLYTHEWOOD LOOP", "BOARDROOM TRAIL", "BOILING SPRINGS COURT", "BOLIVAR STREET", "BONHAM LANE", "BONITA DRIVE", "BORDER COURT", "BOSTIC LANE", "BOTTLEBRUSH STREET", "BOWEN TERRACE", "BOWLES PLACE", "BOXWOOD TERRACE", "BRACCI AVENUE", "BRADFORD LOOP", "BRAEMAR PLACE", "BRAMBLE TERRACE", "BRANDENBURG COURT", "BRASSIE TERRACE", "BRENTWOOD AVENUE", "BRIDGEFIELD COURT", "BRIGHTON DRIVE", "BRINKLEY LANE", "BRITTON DRIVE", "BROOKSIDE PLACE", "BROWNWOOD BOULEVARD", "BRUNELL STREET", "BRUSKO DRIVE", "BUCKEYE LANE", "BUENA VISTA BOULEVARD", "BUENOS AIRES BOULEVARD", "BUGLE TERRACE", "BURCH STREET", "BURKE COURT", "BURNETTOWN PLACE", "BURNSED BOULEVARD", "BURTON LANE", "BUTTERCUP WAY", "BUXTON TERRACE", "CABELLA CIRCLE", "CAINSWORTH PLACE", "CALDWELL COURT", "CALHOUN COURT", "CALLAWAY DRIVE", "CALZADA COURT", "CAMBRIDGE COURT", "CAMERO DRIVE", "CAMINO DEL REY DRIVE", "CAMPOBELLO TERRACE", "CANAL STREET", "CANDLER PLACE", "CANNON LOOP", "CAPRI COURT", "CARBONDALE COURT", "CARDONA WAY", "CARIBOU WAY", "CARLISLE COURT", "CARMEL AVENUE", "CAROLINA COURT", "CARRERA DRIVE", "CARRIAGE HILL WAY", "CARROLL COURT", "CARSON TERRACE", "CARVELLO DRIVE", "CARYLE LANE", "CASON COURT", "CASTILLO DRIVE", "CASTLEHILL DRIVE", "CATALANI LANE", "CAULK COURT", "CAVAZOS COURT", "CECILIA COURT", "CEDAR WAXWING DRIVE", "CENTRAL STREET", "CHAMBERLAIN COURT", "CHANCE COURT", "CHAPARRAL DRIVE", "CHAPMAN LOOP", "CHARLESFORT AVENUE", "CHARLOTTE COURT", "CHATHAM AVENUE", "CHELTENHAM COURT", "CHERRY BLOSSOM LANE", "CHESAPEAKE PLACE", "CHESTERFIELD LANE", "CHILTON COURT", "CHULA VISTA AVENUE", "CHULA VISTA AVENUE", "CHURCHILL DOWNS", "CICHIELO COURT", "CINDY DRIVE", "CIRCLEWOOD COURT", "CLAUDIO LANE", "CLEMSON CIRCLE", "CLIFTON PLACE", "CLOVER COURT", "CLUSTER COURT", "COBBLESTONE STREET", "COLEMAN DRIVE", "COLLETON COURT", "COLLINS COURT", "COLUMBIA PLACE", "COMMODORE DRIVE", "CONDREY COURT", "CONTRERAS LANE", "COOK PLACE", "CORAL WAY", "CORBIN TRAIL", "CORDERO COURT", "CORDOVA CIRCLE", "CORONA COURT", "CORTEZ AVENUE", "COSMOS WAY", "COTE LOOP", "COULTS CIRCLE", "COUNTRYWIND COURT", "CRABAPPLE LANE", "CRAWFORD COURT", "CREEKSIDE WAY", "CRESTBROOK COURT", "CREWS COURT", "CROWFIELD AVENUE", "CRUZ COURT", "CULVERT COURT", "CURRITUCK TERRACE", "CYPRESS POINT", "DAFFODIL COURT", "DALECROFT TRAIL", "DALZELL COURT", "DANDREA PLACE", "DANNA AVENUE", "DARBY PLACE", "DARLINGTON DRIVE", "DAVENPORT DRIVE", "DAY DRIVE", "DE LA GARZA PLACE", "DE SILVA STREET", "DEBRA DRIVE", "DEES DRIVE", "DEL MAR DRIVE", "DEL MAR DRIVE", "DEL RIO DRIVE", "DEL TORO DRIVE", "DELIA PLACE", "DELPHINA LOOP", "DEMOSS COURT", "DENNIS PLACE", "DEPTFORD COURT", "DESKIN LANE", "DESKIN LANE", "DEVEAUX LANE", "DEVON DRIVE", "DEWITT CIRCLE", "DILLON LANE", "DIVIDING CREEK PATH", "DOGWOOD STREET", "DOOLEY STREET", "DORCHESTER AVENUE", "DORST LANE", "DOVE HOLLOW RUN", "DOWNEY LANE", "DRAKESWOOD AVENUE", "DRESSENDORFER DRIVE", "DUARTE LANE", "DUDLEY TERRACE", "DUFFY LOOP", "DUNBAR AVENUE", "DUNDEE TERRACE", "DURAN DRIVE", "DUSTIN DRIVE", "DUVAL COURT", "DYNASTY PLACE", "EAGLE RIDGE DRIVE", "EASLEY WAY", "EAST SCHWARTZ BLVD.", "EASTBOURNE LANE", "EASTOVER TERRACE", "EDENTON TERRACE", "EDGEMOOR TERRACE", "EDISTO LANE", "EDWARDS LANE", "EHRHARDT PLACE", "EL CAMINO REAL", "EL ESPARZA LANE", "EL NINO STREET", "ELDERBERRY PLACE", "ELDRIDGE LOOP", "ELIZABETH COURT", "ELLERBE AVENUE", "ELLIS STREET", "ELM STREET", "EMBROOK STREET", "EMMALEE PLACE", "EMPORIA PLACE", "ENDICOTT WAY", "ENGLISH IVY CIRCLE", "ENRIGHT PLACE", "ENRIQUE DRIVE", "ESPANA STREET", "ESTAFANA WAY", "ESTRADA PLACE", "EUBANKS LANE", "EUTAWVILLE PLACE", "EVANS PRAIRIE TRAIL", "EVATT PLACE", "EVELYNTON LOOP", "EVERGREEN COURT", "EVINSTON COURT", "FAIR OAK TERRACE", "FAIRFIELD STREET", "FAIRVIEW LANE", "FAITH TERRACE", "FARMINGTON AVENUE", "FAWNRIDGE COURT", "FELIU RUN", "FENIMORE LANE", "FENWICK LOOP", "FEUSTEL AVENUE", "FIELDCREST DRIVE", "FILLMORE PLACE", "FINK STREET", "FIRESIDE AVENUE", "FIVE FORKS TRAIL", "FLANDERS PLACE", "FLETCHER LANE", "FLORAHOME STREET", "FLORES AVENUE", "FOGGY BROOK LOOP", "FOLKSTONE WAY", "FONSECA WAY", "FORD STREET", "FOREST GROVE RUN", "FORSYTH STREET", "FORT MILL COURT", "FORTALEZA DRIVE", "FOUNTAIN INN COURT", "FOXBRIDGE TERRACE", "FOXWOOD LANE", "FREEDOM COURT", "FRINGE TREE TRAIL", "FURMAN LOOP", "FUSSELL WAY", "GADSDEN PLACE", "GAGE STREET", "GAITHER COURT", "GALINDO PLACE", "GANTT STREET", "GARDENA COURT", "GARZA PLACE", "GASTON LOOP", "GAUCHO WAY", "GEDDES TERRACE", "GEORGETOWN AVENUE", "GERBER LANE", "GIFFORD COURT", "GIST COURT", "GLEN HOLLOW WAY", "GLENARDEN PATH", "GLENDALE LANE", "GLENWOOD PLACE", "GOEDKEN DRIVE", "GOLIATH PLACE", "GOOD HOPE WAY", "GORDON PATH", "GRAHAM CIRCLE", "GRANBURY STREET", "GRANVILLE TERRACE", "GRASSMERE STREET", "GRAVEL COURT", "GREAT BIRCH TERRACE", "GREENACRES TERRACE", "GREENVILLE WAY", "GRENADIER WAY", "GREYFORD LANE", "GRIMBALL AVENUE", "GUADALUPE COURT", "GUIDO AVENUE", "GULLBERRY PLACE", "GYPSY COURT", "HACKNEY PLACE", "HAISLIP COURT", "HALLMARK PATH", "HALYARD COURT", "HAMLIN PLACE", "HAMPTON LANE", "HANOVER TERRACE", "HARDING PATH", "HARLESTON STREET", "HARLOW LANE", "HARMONY CIRCLE", "HARRIS COURT", "HARSTON TRAIL", "HARTFORD PATH", "HARVEY LANE", "HATCH LANE", "HAVANA TRAIL", "HAZELWOOD LOOP", "HEATHER HILL LOOP", "HEBB AVENUE", "HENDERSON LANE", "HENGAN PLACE", "HERNANDEZ DRIVE", "HERRERA COURT", "HIBISCUS DRIVE", "HICKORY HEAD HAMMOCK", "HIGHBANKS COURT", "HIGHRIDGE STREET", "HILL STREET", "HILLSBOROUGH TRAIL", "HILLTOP LOOP", "HINCKLEY LANE", "HOBART COURT", "HODGES LANE", "HOLLIS WAY", "HOLLY LANE", "HOLLYHOCK WAY", "HOLLYWOOD TERRACE", "HONEA PATH", "HOOK HOLLOW TERRACE", "HOPEWELL STREET", "HORST PLACE", "HOYOS COURT", "HUDSON COURT", "HUMPHREYS LOOP", "HUNTINGTON PATH", "HYDRANGEA AVENUE", "IBISES COURT", "IDLE COURT", "IIAMS COURT", "IMAGE COURT", "INCORVAIA WAY", "INDEPENDENCE PATH", "INDIANWOOD ROAD", "INFINITY RUN", "INGRAM STREET", "INKWOOD LANE", "INNER CIRCLE", "INNISBROOK PLACE", "INVERARY AVENUE", "IPSWITCH STREET", "IRISH COURT", "IRON OAK WAY", "IRWIN WAY", "ISLAND HOUSE PATH", "ISLEWORTH CIRCLE", "IVAWOOD WAY", "IVERSON COURT", "IVEYWOOD STREET", "JACE PLACE", "JACKSON STREET", "JAFFIA COURT", "JAMESTON AVENUE", "JANWOOD AVENUE", "JARVIS COURT", "JASON DRIVE", "JASPER WAY", "JEFFCOAT COURT", "JEM PATH", "JENNIFER DRIVE", "JESSUP STREET", "JEWEL COURT", "JODPHUR LANE", "JOHN MICHAEL COURT", "JOINER PLACE", "JONESBURY RUN", "JORDAN STREET", "JUANITA COURT", "JUAREZ WAY", "JUDGE PLACE", "JULIA COURT", "JUNEBERRY AVENUE", "JUPITER WAY", "JUTLAND PLACE", "KANE PLACE", "KASPER COURT", "KATHERINE PLACE", "KAUFMAN CIRCLE", "KAUSKA WAY", "KEARNS CORNER", "KEELEY COURT", "KELLER COURT", "KELSEA CIRCLE", "KEMPTON PLACE", "KENMORE LANE", "KENSINGTON PLACE", "KERSHAW ROAD", "KETTERING COURT", "KEY DEER PATH", "KEYSTONE COURT", "KIESSEL ROAD", "KILEY COURT", "KILLINGSWORTH WAY", "KILT TERRACE", "KIMBERWICKE AVENUE", "KINDLE AVENUE", "KINGMONT TERRACE", "KINGSTREE PLACE", "KITTREDGE LOOP", "KNIGHT AVENUE", "KNOTTY PINE TERRACE", "KOLLER COURT", "KRAMER COURT", "KRISTINE WAY", "KUZMANY COURT", "LA FRANCE COURT", "LA GRANDE BLVD.", "LA PALOMA PLACE", "LA PLAZA PLACE", "LACROSSE LANE", "LADSON LOOP", "LAGUNA LANE", "LAKE MIONA DRIVE", "LAKE SUMTER LANDING", "LAKEVIEW LANE", "LAMMER LANE", "LANCE COURT", "LANDEROS LANE", "LANE TERRACE", "LANTANA AVENUE", "LARCHMONT COURT", "LARRANAGA DRIVE", "LATTA COURT", "LAUREL BAY LANE", "LAUREL MANOR DRIVE", "LAUREN LANE", "LAWSON LOOP", "LAYTON TERRACE", "LE FLORE LANE", "LEEDS PLACE", "LEGACY LANE", "LEGGETT LANE", "LEISURE STREET", "LENORE LANE", "LESTER DRIVE", "LEWISFIELD TERRACE", "LEYTON PLACE", "LILLY LANE", "LIMERICK LANE", "LINDEWOOD STREET", "LINKS COURT", "LISBON LANE", "LITTLE LANE", "LITTLESTONE TERRACE", "LOADSTAR AVENUE", "LOCKHART AVENUE", "LOCKWOOD LOOP", "LOMA LANE", "LONE PALM AVENUE", "LONGLEAF LANE", "LOPEZ LANE", "LOVE AVENUE", "LOWELL TERRACE", "LOWNDESVILLE PLACE", "LOYOLA COURT", "LUCKETT COURT", "LUDWELL LANE", "LUNSFORD LANE", "LYALL LOOP", "LYNN COURT", "LYSTRA COURT", "MACON COURT", "MADISON LANE", "MAGELLAN COURT", "MAIDEN LANE", "MALACHITE TERRACE", "MALMAISON STREET", "MANDRAKE STREET", "MANLY PLACE", "MANSFIELD STREET", "MANTONYA TERRACE", "MAPLETON ROAD", "MARDELL LANE", "MARGARITA COURT", "MARGAUX TRAIL", "MARIANO LANE", "MARIGOLD DRIVE", "MARIPOSA WAY", "MARKWARD DRIVE", "MARLBORO STREET", "MARSH COURT", "MARTIN LANE", "MATHEWS LANE", "MAULDIN PLACE", "MAYBERRY COURT", "MAYFLOWER LOOP", "MAYO DRIVE", "McALPIN STREET", "MCCABE STREET", "McCONNELLS AVENUE", "McCORMICK LANE", "MCDONOUGH PLACE", "MCDOWELL DRIVE", "McLEOD LANE", "MCLIN LANE", "MCQUIRE ROAD", "MEADOWLARK AVENUE", "MEDINA AVENUE", "MEGGETT WAY", "MELBOURNE LANE", "MELROSE COURT", "MELVILLE LOOP", "MERCER WAY", "MERRY ROAD", "MI TIERRA WAY", "MIDORA TERRACE", "MILKWEED ROAD", "MILLWOOD WAY", "MIRANDA WAY", "MISTWOOD LANE", "MITZI STREET", "MODOC LANE", "MONCAYO AVENUE", "MONROE TERRACE", "MONTCLAIR LANE", "MONTEZ LOOP", "MOON FLOWER PLACE", "MORENO PLACE", "MORSE BLVD.", "MORTON LANE", "MOSBY TERRACE", "MOSSY OAK DRIVE", "MOUNT CARMEL TERRACE", "MOUNT PLEASANT TERRACE", "MOUNTVILLE COURT", "MOYER LOOP", "MULBERRY LANE", "MURPHY''S ESTATE DRIVE", "MYRTLE BEACH DRIVE", "NANCE RUN", "NAPIER COURT", "NASH LOOP", "NATION COURT", "NAVARRO COURT", "NEAPTIDE PATH", "NEESES LANE", "NEILSON COURT", "NELLIE ROAD", "NESTLEBRANCH AVENUE", "NETHERWOOD PLACE", "NEW HAVEN LANE", "NEW MOON AVENUE", "NEWBRIDGE PLACE", "NEWINGTON STREET", "NICHOLS LANE", "NIGHTHAWK TERRACE", "NOBLETON LANE", "NORDIC LANE", "NORLAND AVENUE", "NORTHBROOK PLACE", "NORTHWOOD PLACE", "NOTCH AVENUE", "NUEVO LEON LANE", "NUTHATCH AVENUE", "OAK BEND PLACE", "OAK HAMMOCK LANE", "OAK MEADOWS LANE", "OAK POINT TERRACE", "OAKLAND COURT", "OAKWOOD STREET", "O''BRIEN PLACE", "ODELL CIRCLE", "ODYSSEY PLACE", "O''HARA COURT", "OLAR COURT", "OLD MILL RUN", "OLDSMAR TERRACE", "OLENDA DRIVE", "OLSON LANE", "OMEGA STREET", "OPAL COURT", "ORACLE COURT", "ORANGEDALE TERRACE", "OREN AVENUE", "OROURKE ROAD", "ORTEGA WAY", "OSADA AVENUE", "OSPREY AVENUE", "OTTER LANE", "OVERSTREET PLACE", "OWEN DRIVE", "OXBOW DRIVE", "OXFORD OAKS LANE", "PACIFIC LANE", "PADDOCK PLACE", "PAISLEY WAY", "PALERMO PLACE", "PALM CREST WAY", "PALO ALTO AVENUE", "PALO ALTO AVENUE", "PAMONA LANE", "PANAMA PLACE", "PAPE PLACE", "PARDO PLACE", "PARKER PLACE", "PARLOR PLACE", "PARRIS ISLAND PLACE", "PARSLEY ROAD", "PASSION FLOWER WAY", "PATRICIA PLACE", "PAXVILLE PLACE", "PEACHTREE AVENUE", "PEARSON STREET", "PEBBLEBROOK COURT", "PELHAM AVENUE", "PELZER AVENUE", "PENINSULA STREET", "PENNECAMP DRIVE", "PENSACOLA PLACE", "PERCIVAL WAY", "PEREZ PLACE", "PERSIMMON LOOP", "PETOSKEY PLACE", "PHEASANT PLACE", "PICASSO PLACE", "PICKETT ROAD", "PIGEON COURT", "PINCKNEY LANE", "PINEAPPLE PLACE", "PINELAND TERRACE", "PINEWOOD PLACE", "PINK BLOSSOM COURT", "PISANO WAY", "PLACIDA TERRACE", "PLANK STREET", "PLEASANT VIEW PLACE", "PLUMOSA COURT", "POMEGRANATE PATH", "POMPION STREET", "POPE PLACE", "PORT ROYAL COURT", "POWELL ROAD", "PRESA PLACE", "PRESTON DRIVE", "PRIVADA DRIVE", "PRIVETT DRIVE", "PUEBLO PLACE", "QUAIL COURT", "QUAINT COURT", "QUARTET ROAD", "QUARY PLACE", "QUEENSBURY TERRACE", "QUIETWOODS DRIVE", "QUINBY WAY", "QUINTERO COURT", "RADBOURNE WAY", "RADLEY LANE", "RAIN LILY LOOP", "RAINEY TRAIL", "RAINWOOD AVENUE", "RAMBLING ROSE COURT", "RAMOS DRIVE", "RAMSBURY COURT", "RAVEN CROFT TERRACE", "RAWCLIFFE COURT", "READER PATH", "REBECCA CIRCLE", "RED CEDAR LANE", "REDBUD LANE", "REEDY CREEK PLACE", "REGENCY AVENUE", "REMINGTON ROAD", "RESTHAVEN WAY", "REYES AVENUE", "RIALTO ROAD", "RICHARDSON ROAD", "RICHFIELD STREET", "RIDGE COURT", "RIDGEVILLE ROAD", "RIDGEWOOD PATH", "RIO GRANDE AVENUE", "RIOS COURT", "RIVERA ROAD", "ROANOKE STREET", "ROBERTSON WAY", "ROCHA LANE", "ROCKVILLE PLACE", "ROHAN ROAD", "ROLLING OAK AVENUE", "ROSALES ROAD", "ROSE CROFT TERRACE", "ROSEAPPLE AVENUE", "ROSEDALE WAY", "ROSLYN COURT", "ROWE PLACE", "ROYAL ELM ROAD", "ROYAL PINE COURT", "RUGBY WAY", "RUTLAND AVENUE", "SADDLEBROOK CIRCLE", "SAFFRON LANE", "SAGAMORE STREET", "SALAMANCA STREET", "SALEM PLACE", "SALINAS AVENUE", "SALMON WAY", "SAN BENITO LANE", "SAN CARLOS COURT", "SAN FELIPE LANE", "SAN GABRIEL STREET", "SAN LEONARDO WAY", "SAN MARIA STREET", "SAN MARINO DRIVE", "SAN PEDRO DRIVE", "SAN SABA COURT", "SANCHEZ COURT", "SANDERLING STREET", "SANDY LANE", "SANTA ANNA LANE", "SANTA CRUZ DRIVE", "SANTA RITA WAY", "SANTEE PLACE", "SANTOS PLACE", "SARASOTA STREET", "SATINWOOD PATH", "SAYBROOK WAY", "SCHMID LANE", "SCHULZ WAY", "SCOTT STREET", "SEA OATS LANE", "SEBASTION AVENUE", "SEDGEFIELD TERRACE", "SELLERS COURT", "SENECA AVENUE", "SEVEN OAKS LANE", "SHADY NOOK RUN", "SHALIMAR STREET", "SHARON DRIVE", "SHELBURNE LANE", "SHELL POINT AVENUE", "SHEPPARD WAY", "SHERWOOD STREET", "SHOREWOOD STREET", "SILK TREE TERRACE", "SILVERSTREET WAY", "SIMPSONVILLE LANE", "SMALLWOOD PLACE", "SMOAKS STREET", "SNELLING AVENUE", "SOCIETY HILL CIRCLE", "SONOMA LANE", "SOULLIERE AVENUE", "SOUTH SHORE LANE", "SOUTHERN STAR WAY", "SOUTHERN TRACE", "SOUTHFIELD DRIVE", "SOUTHPORT STREET", "SPANISH MOSS WAY", "SPIDER LILY STREET", "SPRING ARBOR LANE", "SPRINGSIDE TERRACE", "ST. ANDREWS BLVD.", "ST. ANDREWS CIRCLE", "ST. CHARL", "SUGAR CANE COURT", "SUN BLUFF COURT", "SUNNYBROOK CIRCLE", "SURFSIDE LANE", "SWAINWOOD COURT", "SWAYING PALM COURT", "SWEETGUM STREET", "SYCAMORE AVENUE", "TAILFER STREET", "TALL TREES LANE", "TALLEY RIDGE DRIVE", "TAMARIND GROVE RUN", "TAMBOURINE TERRACE", "TANGERINE CIRCLE", "TANGO STREET", "TARFLOWER TERRACE", "TARRSON BLVD.", "TARRSON BLVD.", "TATUM TERRACE", "TEAKWOOD LANE", "TELLFIER TERRACE", "TERNBERRY FOREST DRIVE", "THAYER TERRACE", "THOMPSON AVENUE", "THORNE PATH", "THUNDERBIRD WAY", "TILLMAN TERRACE", "TIMBER TERRACE", "TIPTON LANE", "TOLLESON TRAIL", "TORRES PLACE", "TOWNSEND TERRACE", "TRANQUILITY LANE", "TRAVERSE TRAIL", "TREELINE PLACE", "TREMONT STREET", "TRIGGERFISH RUN", "TRINITY PLACE", "TROUT COURT", "TRULUCK PLACE", "TRUMBULL TERRACE", "TUDOR TERRACE", "TUPELO TERRACE", "TURNBERRY LANE", "TURNBULL COURT", "TUSCALOOSA PATH", "TWEEDSIDE LOOP", "TWINKLE CIRCLE", "TYNTE TERRACE", "ULMER TERRACE", "UMBRELLA LOOP", "UNDERHILL COURT", "UNGER COURT", "UNIQUE STREET", "UPLAND PLACE", "URBANE PLACE", "UTICA WAY", "VAIL COURT", "VALENTINE AVENUE", "VALLEY OAK STREET", "VALOR COURT", "VAN BUREN WAY", "VANCE TRAIL", "VANDENBERG COURT", "VAPOR COURT", "VASQUEZ AVENUE", "VAUGHN WAY", "VELVET PLACE", "VENTURA COURT", "VENTURA DRIVE", "VERMONT AVENUE", "VERTIGO LANE", "VICEROY COURT", "VICTORIA LANE", "VIDALIA PLACE", "VIEWPOINT TERRACE", "VILLAGE CAMPUS CIRCLE", "VINE AVENUE", "VINEWOOD AVENUE", "VINTAGE PLACE", "VIOLA COURT", "VISCAYA COURT", "VISTA COURT", "VIVIENNE DRIVE", "WADE MEADOW LANE", "WAKE FOREST LANE", "WALDO TERRACE", "WALKER LOOP", "WALTERBORO LANE", "WARNOCK ROAD", "WATCH HILL STREET", "WATERCRESS STREET", "WATSON TERRACE", "WAYLAND STREET", "WEBB WAY", "WEDGEWOOD LANE", "WEEPING WILLOW AVE.", "WELCOME WAY", "WENTROP AVENUE", "WEST BOONE COURT", "WEST SCHWARTZ BLVD.", "WEST STREET", "WESTMONT PLACE", "WESTOVER WAY", "WHEELOCK STREET", "WHITE TERRACE", "WHITMIRE TERRACE", "WICKER TERRACE", "WICKLOW COURT", "WILDFLOWER PLACE", "WILKERSON STREET", "WILLIAMS ROAD", "WILLOW BROOK LANE", "WILLOWICK CIRCLE", "WILTON WAY", "WINDEMERE COURT", "WINE PALM WAY", "WINTERTHUR LOOP", "WISTERIA STREET", "WOOD STORK WAY", "WOODBRIDGE WAY", "WOODLAWN AVENUE", "WOODRIDGE DRIVE", "WOODS WAY", "WOTRING WAY", "WYATT AVENUE", "XANADU LOOP", "YAGER LANE", "YANKEE CLIPPER RUN", "YARDLEY COURT", "YEAMANS PLACE", "YELLOWSTONE COURT", "YODER DRIVE", "YORKTOWN COURT", "YUCCA COURT", "ZANZIBAR PLACE", "ZEBRA LONGWING PATH", "ZENITH LOOP", "ZEST AVENUE", "ZINA LANE", "ZIPPERER WAY", "ZUMWALT LANE"}; public static void main(String[] args) { //System.out.println(citiesArray.length); for(int i=1;i<=MANY;i++){ Random random1 = new Random(); int r1 = random1.nextInt(cities) + 1; int r2 = random1.nextInt(streetsArray.length); int bound = random1.nextInt(1000) + 1; int bound2 = random1.nextInt(bound) + 1; int street_n = random1.nextInt(bound2) + 1; // int company_id = random1.nextInt(companies) + 1; System.out.println("insert into work_places (id, city_id, company_id, street, street_number) " + "values (" + i + ", " + r1 + ", " + (i+2)/3 + ", '" + streetsArray[r2] + "', " + street_n + ");" ); // else { // System.out.println("insert into work_places (id, city_id, company_id, street, street_number) " + // "values (" + i + ", " + r1 + ", " + company_id + ", '" + streetsArray[r2] + "', " + street_n + ");" ); // } } } }
[ "piotr.kubaty@student.uj.edu.pl" ]
piotr.kubaty@student.uj.edu.pl
1c8fcd9393cc8aaf87b539bdf625f5c453f43946
36257d72aa70f8570b2fa9e9b593b2a616ae876c
/android/app/src/main/java/com/react_project/MainActivity.java
a578eac8c20ed21f5039c2550c6e39299dbd86d1
[]
no_license
itztejas01/react-native
4196f9c7c7df66459f3171fbb304dc698d59783b
4919a1aeaef0c35cf001b8ce7786feb622a8545e
refs/heads/master
2023-09-04T21:57:53.090351
2021-10-31T09:49:48
2021-10-31T09:49:48
421,276,543
0
0
null
null
null
null
UTF-8
Java
false
false
353
java
package com.react_project; import com.facebook.react.ReactActivity; public class MainActivity extends ReactActivity { /** * Returns the name of the main component registered from JavaScript. This is used to schedule * rendering of the component. */ @Override protected String getMainComponentName() { return "react_project"; } }
[ "tejas.chaplot@somaiya.edu" ]
tejas.chaplot@somaiya.edu
b23ec5e6700f59a65f76430d4f7b61086a8c1d61
893100224187a2aa8643d5067cbf634a0677fa37
/src/main/java/com/bytatech/ayoos/appointment/resource/assembler/NextTaskResource.java
58cef254eef00208e9d0b041d2fe994bf2f56c59
[]
no_license
BYTA-TECH/Appointment
7dd4bc10c09ef0c286dc21fe77667df9565e5dbe
7fbb1dedb0585cec2cbb3838a57a721d11435a3a
refs/heads/master
2022-12-22T22:45:25.459180
2020-03-16T11:24:34
2020-03-16T11:24:34
236,931,411
0
0
null
2022-12-16T04:43:44
2020-01-29T08:00:09
Java
UTF-8
Java
false
false
1,021
java
package com.bytatech.ayoos.appointment.resource.assembler; public class NextTaskResource { private String nextTaskId; private String nextTaskName; private String processId; /** * @return the nextTaskId */ public String getNextTaskId() { return nextTaskId; } /** * @return the selfId */ @Override public String toString() { return String.format( "CommandResource [nextTaskId=%s,\n nextTaskName=%s, \n processId=%s]", nextTaskId, nextTaskName, processId); } /** * @param nextTaskId the nextTaskId to set */ public void setNextTaskId(String nextTaskId) { this.nextTaskId = nextTaskId; } /** * @return the nextTaskName */ public String getNextTaskName() { return nextTaskName; } /** * @param nextTaskName the nextTaskName to set */ public void setNextTaskName(String nextTaskName) { this.nextTaskName = nextTaskName; } public String getProcessId() { return processId; } public void setProcessId(String processId) { this.processId = processId; } }
[ "ajay.e.s@lxisoft.com" ]
ajay.e.s@lxisoft.com
2bb3fd35550b61289330186db9ffffe23eaf5b4f
9ac38c50a825ecb0879849ebb1e6ba32e32b74ab
/src/codeimp/graders/SharedMethodsInChildren.java
75547ca1a15dea95d2b9b67d0c873770308d8ef9
[]
no_license
chuxuankhoi/CodeImpPlugin
e1d51ba3efc662a1d61350abff7f3690d7596d23
20e6d59275a8b63a2f97bbe549fbe7714b4c6df8
refs/heads/master
2021-01-19T08:15:29.001418
2014-10-28T11:54:35
2014-10-28T11:54:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,768
java
package codeimp.graders; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.jdt.core.IType; import org.eclipse.jdt.core.ITypeHierarchy; import org.eclipse.jdt.core.JavaModelException; /** * <p> * Judge methods in the way that brother classes use them or not. * </p> * <p> * Brother classes are the classes which have the same super-class with the * given class * </p> * <p> * Score is the average score of each method. Score of each method is counted by * the fraction of the same method in all methods which have the same * declaration. * </p> * <p> * In this version, the methods are compared in the simplest way that they use * the same source code. In fact, in order to compare the method, we can see * another way like comparing the output set. * </p> * * <strong>Note: prevent the error that 2 methods have the same declaration in 1 * class (error of refactoring actions) - the method should be counted</strong> * * @author Chu Xuan Khoi * */ public class SharedMethodsInChildren extends SharedMethodsAbstract implements IGrader { // private static final double DUP_THRESHOLD = 0.2; public SharedMethodsInChildren(IType type) { super(type); } @Override public double getScore() { // Get all subclasses of the given class ITypeHierarchy hierachy = null; try { hierachy = type.newTypeHierarchy(new NullProgressMonitor()); } catch (JavaModelException e) { e.printStackTrace(); } if (hierachy == null) { return 0; } IType[] subclasses = hierachy.getSubtypes(type); if (subclasses.length == 0) { return 0; } double sumMethod = getScoreOfGroup(subclasses); return sumMethod;// / allDiffMethods.size(); } }
[ "khoi.chu@ucdconnect.ie" ]
khoi.chu@ucdconnect.ie
f7d11465fb3d6d10c7a7264a7db277ed36dd3dee
a25ffce70545f7a6afeb58e5c70eb24a17426318
/jbm-cluster/jbm-cluster-platform/jbm-cluster-platform-gateway/src/main/java/com/jbm/cluster/platform/gateway/handler/ValidateCodeHandler.java
23082b7a4bad392815cb0d38f62589a6d1dc60bc
[ "Apache-2.0" ]
permissive
numen06/JBM
4b3b2158f8199957c6e1500ab05ae5aca375a98f
827df87659e9392d73897753142271ab1e573974
refs/heads/7.1
2023-08-31T15:35:34.579275
2023-08-23T01:12:01
2023-08-23T01:12:01
160,906,536
10
9
Apache-2.0
2023-04-14T19:31:19
2018-12-08T05:16:32
Java
UTF-8
Java
false
false
1,408
java
package com.jbm.cluster.platform.gateway.handler; import com.alibaba.fastjson.JSON; import com.jbm.cluster.platform.gateway.service.ValidateCodeService; import com.jbm.framework.exceptions.CaptchaException; import com.jbm.framework.metadata.bean.ResultBody; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Component; import org.springframework.web.reactive.function.BodyInserters; import org.springframework.web.reactive.function.server.HandlerFunction; import org.springframework.web.reactive.function.server.ServerRequest; import org.springframework.web.reactive.function.server.ServerResponse; import reactor.core.publisher.Mono; import java.io.IOException; import java.util.Map; /** * 验证码获取 * * @author wesley.zhang */ @Component public class ValidateCodeHandler implements HandlerFunction<ServerResponse> { @Autowired private ValidateCodeService validateCodeService; @Override public Mono<ServerResponse> handle(ServerRequest serverRequest) { ResultBody<Map<String, Object>> ajax; try { ajax = validateCodeService.createCaptcha(); } catch (CaptchaException | IOException e) { return Mono.error(e); } return ServerResponse.status(HttpStatus.OK).body(BodyInserters.fromValue(JSON.toJSONString(ajax))); } }
[ "numen06@sina.com" ]
numen06@sina.com
ff74f5b1c367a9883087e16886fbea048f3adbd8
32e86e857701311f80fec7ebd8aefd74d80d077a
/SportNetwork/src/main/java/com/sportnetwork/common/service/IEventService.java
9c530f56a48d9bbe441e64fa6fbb697b3e798588
[]
no_license
kemalacar/sportnetwork
3f17c861a6adc3867870bed46f29fa3aa3b6de95
34cc8a88ea868a8c87d130944273d3cf5e65737e
refs/heads/master
2020-04-13T10:00:36.818748
2014-02-12T20:54:19
2014-02-12T20:54:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
366
java
package com.sportnetwork.common.service; import com.sportnetwork.common.model.Event; public interface IEventService { public void addEvent(Event event); public void deleteEvent(String eventID); public void getEvent(String eventID); public void updateEvent(String eventID); public void addarticipantToEvent(String participantId , String eventID); }
[ "kemalacar477@hotmail.com" ]
kemalacar477@hotmail.com
4a665afff0dc0e7cd4cc670a24c4a3f28b0c3b8a
767472531f0484c308df8cc67fe38b8610d03a9f
/src/IndestructibleBlock.java
1480ec8209eaf41d85ea1e0776c3cb226b3b1dc1
[]
no_license
silvanrichner/Bomberman
cfb05c446966e1e22676e9cea306f89e8c5b0ecb
1008a61ad180d51bcb3214f2b426cc01ca1f3d38
refs/heads/master
2021-01-10T18:31:30.173542
2016-06-06T10:42:07
2016-06-06T10:42:07
56,756,061
0
0
null
null
null
null
UTF-8
Java
false
false
735
java
import java.io.File; import processing.core.PApplet; import processing.core.PImage; /** * Indestructible Blocks are used to build the map. * They block the players movement and aren't affected by explosions. * * @author Silvan * */ public class IndestructibleBlock implements MapItem { private PApplet applet; private PImage image; public IndestructibleBlock(PApplet applet) { this.applet = applet; this.image = applet.loadImage("src"+File.separator+"resources"+File.separator+"wall.png"); } @Override public boolean isBlocking(Player player) { return true; } @Override public void paint(int x, int y) { applet.image(image, x,y); } @Override public boolean isDestructible() { return false; } }
[ "silvan.richner@gmx.ch" ]
silvan.richner@gmx.ch
25d0d6ebe825950d540e923076f8a363823c7eff
e130cdc4dc2c16f40f989536adc0d002ab5bf71a
/src/main/java/com/ipplus360/entity/OrderItem.java
0acfb9e736e01a38df2b7d08409c1def80da3ea5
[]
no_license
mayanxi/testgit
281087dcde7eb46ce5a1ff3c945f560208a1ddc8
88c5d65acff74010d3d22f17443d35873722ef5c
refs/heads/master
2020-03-18T11:26:40.561574
2018-05-24T06:58:11
2018-05-24T06:58:24
134,671,805
0
1
null
null
null
null
UTF-8
Java
false
false
3,342
java
package com.ipplus360.entity; import java.math.BigDecimal; import org.apache.ibatis.type.Alias; /** * 订单项</br> * 一个订单项只能属于一个订单, 与订单关系是多对一</br> * Created by 辉太郎 on 2017/2/22. */ @Alias("orderItem") public class OrderItem { /* 订单项ID */ private Long id; /* 订单ID */ private Long orderId; /* 订单项数量 */ private Integer itemNum; /* 产品信息 */ private Product product; /* 价格包 */ private PricePackage pricePackage; private Long pricePackageId; /* 数量 */ private String amountStr; private Long amount; /** * 订单类型 1.IPSceneAPI 2.IPSceneDownload 3.IPDistrictAPI 4.IPDistrictDownload */ private String itemType; /** * 区县库, 场景库规格 WGS84,BD09 更新频率 数据格式... */ private String attrs; private String attrIds; /* 实际总价 */ private BigDecimal price; /* 原始总价 */ private BigDecimal originalPrice; /* 折扣信息 */ private String discount; public OrderItem() { } public OrderItem(Product product) { this.product = product; this.pricePackage = new PricePackage(); } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Long getOrderId() { return orderId; } public void setOrderId(Long orderId) { this.orderId = orderId; } public Integer getItemNum() { return itemNum; } public void setItemNum(Integer itemNum) { this.itemNum = itemNum; } public Product getProduct() { return product; } public void setProduct(Product product) { this.product = product; } public PricePackage getPricePackage() { return pricePackage; } public void setPricePackage(PricePackage pricePackage) { this.pricePackage = pricePackage; } public Long getPricePackageId() { return pricePackageId; } public void setPricePackageId(Long pricePackageId) { this.pricePackageId = pricePackageId; } public BigDecimal getPrice() { return price; } public void setPrice(BigDecimal price) { this.price = price; } public BigDecimal getOriginalPrice() { return originalPrice; } public void setOriginalPrice(BigDecimal originalPrice) { this.originalPrice = originalPrice; } public String getDiscount() { return discount; } public void setDiscount(String discount) { this.discount = discount; } public String getAmountStr() { return amountStr; } public void setAmountStr(String amountStr) { this.amountStr = amountStr; } public Long getAmount() { return amount; } public void setAmount(Long amount) { this.amount = amount; } public String getItemType() { return itemType; } public void setItemType(String itemType) { this.itemType = itemType; } public String getAttrs() { return attrs; } public void setAttrs(String attrs) { this.attrs = attrs; } public String getAttrIds() { return attrIds; } public void setAttrIds(String attrIds) { this.attrIds = attrIds; } public String toString() { return "OrderItem [id=" + id + ", orderId=" + orderId + ", itemNum=" + itemNum + ", product=" + product + ", pricePackage=" + pricePackage + ", amountStr=" + amountStr + ", amount=" + amount + ", price=" + price + ", originalPrice=" + originalPrice + ", discount=" + discount + ", itemType=" + itemType + ", attrs=" + attrs + "]"; } }
[ "Y99280420X@163.com" ]
Y99280420X@163.com
d7d801be44256018fad717c5a5b903e690d8385a
0b7109015eb4a7161bedbac327e9ef7b91a59473
/src/main/java/com/salesbox/dao/AppointmentInviteeContactDAO.java
3585274728e7cbc5e0ab20ee33c0a7fdf59abffb
[]
no_license
tuanhle2410/salesbox_export_as_microservice
d500df32abc9ccd3e9d0e8e96e53c5cb750a49d9
09d032f978da398864847c766fd1619af032ce57
refs/heads/master
2022-12-23T20:05:37.691253
2020-02-28T02:37:28
2020-02-28T02:37:28
243,457,583
0
0
null
2022-12-10T04:20:37
2020-02-27T07:27:09
Java
UTF-8
Java
false
false
2,625
java
package com.salesbox.dao; import com.salesbox.entity.*; import java.util.Collection; import java.util.Date; import java.util.List; /** * Created by hungnh on 15/07/2014. */ public interface AppointmentInviteeContactDAO extends BaseDAO<AppointmentInviteeContact> { List<AppointmentInviteeContact> findByAppointment(Appointment appointment); List<AppointmentInviteeContact> findByAppointmentIn(List<Appointment> appointmentList); List<AppointmentInviteeContact> findByContactInAndUpdatedDateAfterOrderByUuidAsc(List<Contact> contactList, Date updatedDate, Integer pageIndex, Integer pageSize); List<AppointmentInviteeContact> findByContactAndNotFinishedOrderByStartDateAsc(Contact contact); List<AppointmentInviteeContact> findByContactInAndNotFinished(Collection<Contact> contactList); AppointmentInviteeContact findByAppointmentAndInviteeEmail(Appointment appointment, String email); Long countByAppointmentInAndContact(Collection<Appointment> appointments, Contact contact); AppointmentInviteeContact findClosestAppointmentByInviteeInAndNotDeleted(Collection<Contact> contacts); List<AppointmentInviteeContact> findByContact(Contact contact); List<Appointment> findAppointmentByContactInAndCreatedDateAfter(List<Contact> contactList, Date createdDate); void removeWhereAppointmentIn(List<Appointment> appointmentList); List<Object[]> findContactAppointmentPropertyByAppointment(Appointment appointment); List<Object[]> findContactAndAppointment(); void removeWhereContactIn(List<Contact> contactList); List<SharedContact> findSharedContactByAppointment(Appointment appointment); List<Contact> findContactByAppointment(Appointment appointment); void removeWhereAppointmentAndContactIn(Appointment appointment, List<Contact> contactList); List<AppointmentInviteeContact> findByUserAndAppointmentIn(User user, List<Appointment> appointmentList); List<AppointmentInviteeContact> findByAppointmentInAndContactEnterprise(List<Appointment> appointmentList, Enterprise enterprise); List<AppointmentInviteeContact> findByAppointmentAndContactEnterprise(Appointment appointment, Enterprise enterprise); long countByAppointmentAndContact(Appointment appointment, Contact contact); List<AppointmentInviteeContact> findByContactInAndNotFinishedOrderByStartDateAsc(List<Contact> contactList); List<AppointmentInviteeContact> findByAppointmentListOrContactIn(List<Appointment> appointmentList, List<Contact> contactList); List<AppointmentInviteeContact> findByContactIn(List<Contact> deletedContactList); }
[ "tuanhle2410@outlook.com" ]
tuanhle2410@outlook.com
2c559050c5d59c6e09ff8d924dc926c20f904e40
a00326c0e2fc8944112589cd2ad638b278f058b9
/src/main/java/000/143/209/CWE789_Uncontrolled_Mem_Alloc__console_readLine_HashSet_51b.java
44356d86815cd9721841ea81db71ad3f9c29f88b
[]
no_license
Lanhbao/Static-Testing-for-Juliet-Test-Suite
6fd3f62713be7a084260eafa9ab221b1b9833be6
b095b11c7cb6d4a5bb2b76181e35d6ee00e96e68
refs/heads/master
2020-08-24T13:34:04.004149
2019-10-25T09:26:00
2019-10-25T09:26:00
216,822,684
0
1
null
2019-11-08T09:51:54
2019-10-22T13:37:13
Java
UTF-8
Java
false
false
1,276
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE789_Uncontrolled_Mem_Alloc__console_readLine_HashSet_51b.java Label Definition File: CWE789_Uncontrolled_Mem_Alloc.int.label.xml Template File: sources-sink-51b.tmpl.java */ /* * @description * CWE: 789 Uncontrolled Memory Allocation * BadSource: console_readLine Read data from the console using readLine * GoodSource: A hardcoded non-zero, non-min, non-max, even number * BadSink: HashSet Create a HashSet using data as the initial size * Flow Variant: 51 Data flow: data passed as an argument from one function to another in different classes in the same package * * */ import java.util.HashSet; public class CWE789_Uncontrolled_Mem_Alloc__console_readLine_HashSet_51b { public void badSink(int data ) throws Throwable { /* POTENTIAL FLAW: Create a HashSet using data as the initial size. data may be very large, creating memory issues */ HashSet intHashSet = new HashSet(data); } /* goodG2B() - use goodsource and badsink */ public void goodG2BSink(int data ) throws Throwable { /* POTENTIAL FLAW: Create a HashSet using data as the initial size. data may be very large, creating memory issues */ HashSet intHashSet = new HashSet(data); } }
[ "anhtluet12@gmail.com" ]
anhtluet12@gmail.com
597c35df555a4e6d5ea413c52862a1c25b4092c8
8afcdec8d47c81ee9786a1b6fa7690fc8b442822
/src/main/java/com/ajgaonkar/leetcode/LC224_Basic_Calculator.java
90a8f1c62c739dcc2ec67a637b6b9f7b3a724cec
[ "Apache-2.0" ]
permissive
yusuflimdiwala/LeetCode-2
841190e9ffa4ef25c689e74252b3c0f532e33e91
30aebbfebd0dd4cd57146516265ca06e37ceeab8
refs/heads/master
2022-03-24T02:15:09.467423
2018-09-04T06:08:33
2018-09-04T06:08:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
661
java
package com.ajgaonkar.leetcode; import java.util.Stack; public class LC224_Basic_Calculator { public static class Operation{ private final int a; private final char o; public int b; public Operation(int a, char o) { this.a = a; this.o = o; } public int doOp() { if(o == '+'){ return a + b; } else { return a -b; } } } public int calculate(String s) { String a = s.replace(" ", ""); int result = 0; char[] c = a.toCharArray(); Stack<Object> stack = new Stack<Object>(); for(char n : c){ if((n == '(')){ stack.push(n); continue; } else if((n == '+') ||(n == '-')){ } } return -1; } }
[ "virajajgaonkar@gmail.com" ]
virajajgaonkar@gmail.com
367747dfaebc2d80614feb3a0a3fd0f5f88ccd68
d31ab0f4521a34782406320ec6ee5e5a3461d05d
/src/main/java/tbl/tool/english/mappers/VocabularyMapper.java
f5a6b5f6e2d98d37b4f076791ee9d31cf6714b87
[]
no_license
longdt21111997/vocabulary_be
9faa1e91ec472bb9389ce1174377073da18b7914
a5cdb0dfe34892f796e64596eb492f60b5ce4813
refs/heads/master
2023-06-02T16:16:28.029343
2021-06-28T08:42:17
2021-06-28T08:42:17
377,453,403
0
0
null
null
null
null
UTF-8
Java
false
false
1,293
java
package tbl.tool.english.mappers; import org.springframework.stereotype.Service; import tbl.tool.english.dto.VocabularyDTO; import tbl.tool.english.entities.VocabularyEntity; import tbl.tool.english.web.vm.InsertVocabularyVm; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; @Service public class VocabularyMapper { public List<VocabularyDTO> transferToListVocabularyDTOFromListEntity(List<VocabularyEntity> listEntity) { if (null == listEntity || listEntity.size() == 0) { return new ArrayList<>(); } return listEntity.stream().map( entity -> VocabularyDTO .builder() .id(entity.getId().toHexString()) .en(entity.getEn()) .vn(entity.getVn()) .labelCode(entity.getLabelCode()) .build() ).collect(Collectors.toList()); } public VocabularyEntity transferToVocabularyEntityFromInsertVm(InsertVocabularyVm insertVm) { return VocabularyEntity .builder() .en(insertVm.getEn()) .vn(insertVm.getVn()) .labelCode(insertVm.getLabelCode()) .build(); } }
[ "63586598+longdt21111997@users.noreply.github.com" ]
63586598+longdt21111997@users.noreply.github.com
3b94958bfe3610452822d5ee699b35ad2f48dfad
2fb03a25c3cd0ead7a4f4279e3edac7aab5fbf8e
/app/src/main/java/com/example/encouragingminds/IntermediateLevelsActivity.java
7b2313a3379135661f59fda823df9e8d5121d6c5
[]
no_license
AnjuReji/EncouragingMinds_FYP_26012195
9c16112188a1ab360709f21cf3bf71e5665e9701
d1a9297f348f49ae63ed1dcc72d5d6a3a1ecb9fc
refs/heads/master
2023-04-13T18:40:18.345906
2021-04-13T11:58:54
2021-04-13T11:58:54
357,505,679
0
0
null
null
null
null
UTF-8
Java
false
false
4,543
java
package com.example.encouragingminds; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.view.View; import android.view.WindowManager; import android.widget.Button; import androidx.appcompat.app.AppCompatActivity; import androidx.core.content.ContextCompat; public class IntermediateLevelsActivity extends AppCompatActivity implements View.OnClickListener{ Button btLevel1, btLevel2, btLevel3; String categoryValue = ""; int IL1, IL2, IL3; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.activity_intermediatelevels); btLevel1 = findViewById(R.id.btLevel1); btLevel2 = findViewById(R.id.btLevel2); btLevel3 = findViewById(R.id.btLevel3); // btLevel1.setOnClickListener(this); This bit was commented out because the onClickListener is being called below // btLevel2.setOnClickListener(this); // btLevel3.setOnClickListener(this); lockandunlockLevels(); Intent intentCategory = getIntent(); categoryValue = intentCategory.getStringExtra("Category"); } private void lockandunlockLevels() { SharedPreferences sharedPreferences = getSharedPreferences(getPackageName() + Constant.MY_LEVEL_PREFERENCE, Context.MODE_PRIVATE); IL1 = sharedPreferences.getInt(Constant.KEY_INTERMEDIATE_LEVEL_1, 1); IL2 = sharedPreferences.getInt(Constant.KEY_INTERMEDIATE_LEVEL_2, 0); IL3 = sharedPreferences.getInt(Constant.KEY_INTERMEDIATE_LEVEL_3, 0); if (IL1 == 1){ btLevel1.setClickable(true); btLevel1.setBackground(ContextCompat.getDrawable(this, R.drawable.buttons_background)); btLevel1.setOnClickListener(this); }else if (IL1 == 0) { btLevel1.setClickable(false); btLevel1.setBackground(ContextCompat.getDrawable(this, R.drawable.level_lock)); } if (IL2 == 1) { btLevel2.setClickable(true); btLevel2.setBackground(ContextCompat.getDrawable(this, R.drawable.buttons_background)); btLevel2.setOnClickListener(this); } else if (IL2 == 0) { btLevel2.setClickable(false); btLevel2.setBackground(ContextCompat.getDrawable(this, R.drawable.level_lock)); } if (IL3 == 1) { btLevel3.setClickable(true); btLevel3.setBackground(ContextCompat.getDrawable(this, R.drawable.buttons_background)); btLevel3.setOnClickListener(this); } else if (IL3 == 0) { btLevel3.setClickable(false); btLevel3.setBackground(ContextCompat.getDrawable(this, R.drawable.level_lock)); } } @Override public void onClick(View v) { if (categoryValue.equals("Intermediate")){ switch (v.getId()){ case R.id.btLevel1: Intent intentIntermediateLevel1 = new Intent(IntermediateLevelsActivity.this, QuizActivity.class); intentIntermediateLevel1.putExtra("Category", categoryValue); intentIntermediateLevel1.putExtra("Level", Questions.LEVEL1); startActivity(intentIntermediateLevel1); break; case R.id.btLevel2: Intent intentIntermediateLevel2 = new Intent(IntermediateLevelsActivity.this, QuizActivity.class); intentIntermediateLevel2.putExtra("Category", categoryValue); intentIntermediateLevel2.putExtra("Level", Questions.LEVEL2); startActivity(intentIntermediateLevel2); break; case R.id.btLevel3: Intent intentIntermediateLevel3 = new Intent(IntermediateLevelsActivity.this, QuizActivity.class); intentIntermediateLevel3.putExtra("Category", categoryValue); intentIntermediateLevel3.putExtra("Level", Questions.LEVEL3); startActivity(intentIntermediateLevel3); break; } } } }
[ "bt012195@student.reading.ac.uk" ]
bt012195@student.reading.ac.uk
8e4c4ed817cfdf14704411ea64958df6fd2fd68b
43d68a329037c6490a4848d34781a8ed07db45a9
/src/com/facebook/buck/android/AndroidBinaryInstallGraphEnhancer.java
0db17789bedfbfa43f080ac51c641484cafa2ed2
[ "Apache-2.0" ]
permissive
thalescm/buck
415a1be0936ce4ec962fe255503f3c913cfe9f3a
8bf1ef65b9238854a7a622e5caaa7a292dc2ed9a
refs/heads/master
2022-01-05T23:47:17.703353
2019-03-01T15:21:17
2019-03-01T16:09:56
116,996,764
0
0
Apache-2.0
2019-05-15T08:56:13
2018-01-10T18:43:50
Java
UTF-8
Java
false
false
7,249
java
/* * Copyright 2017-present Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain * a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package com.facebook.buck.android; import com.facebook.buck.android.exopackage.ExopackageInfo; import com.facebook.buck.android.exopackage.ExopackagePathAndHash; import com.facebook.buck.core.model.BuildTarget; import com.facebook.buck.core.model.Flavor; import com.facebook.buck.core.model.InternalFlavor; import com.facebook.buck.core.rules.ActionGraphBuilder; import com.facebook.buck.core.rules.BuildRule; import com.facebook.buck.core.rules.SourcePathRuleFinder; import com.facebook.buck.core.rules.impl.NoopBuildRule; import com.facebook.buck.core.sourcepath.SourcePath; import com.facebook.buck.io.filesystem.ProjectFilesystem; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableListMultimap; import com.google.common.collect.Multimap; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Optional; class AndroidBinaryInstallGraphEnhancer { static final Flavor INSTALL_FLAVOR = InternalFlavor.of("install"); private static final Flavor DIRECTORY_LISTING_FLAVOR = InternalFlavor.of("exo_directory_listing"); private static final Flavor EXO_FILE_INSTALL_FLAVOR = InternalFlavor.of("exo_file_installer"); private static final Flavor EXO_FILE_RESOURCE_INSTALL_FLAVOR = InternalFlavor.of("exo_resources_installer"); private ProjectFilesystem projectFilesystem; private BuildTarget buildTarget; private HasInstallableApk installableApk; private AndroidInstallConfig androidInstallConfig; AndroidBinaryInstallGraphEnhancer( AndroidInstallConfig androidInstallConfig, ProjectFilesystem projectFilesystem, BuildTarget buildTarget, HasInstallableApk installableApk) { this.projectFilesystem = projectFilesystem; this.buildTarget = buildTarget.withFlavors(INSTALL_FLAVOR); this.installableApk = installableApk; this.androidInstallConfig = androidInstallConfig; } public void enhance(ActionGraphBuilder graphBuilder) { if (androidInstallConfig.getConcurrentInstallEnabled(Optional.empty())) { if (exopackageEnabled()) { enhanceForConcurrentExopackageInstall(graphBuilder); } else { enhanceForConcurrentInstall(graphBuilder); } } else { enhanceForLegacyInstall(graphBuilder); } } private boolean exopackageEnabled() { return installableApk.getApkInfo().getExopackageInfo().isPresent(); } private void enhanceForConcurrentExopackageInstall(ActionGraphBuilder graphBuilder) { ApkInfo apkInfo = installableApk.getApkInfo(); Preconditions.checkState(apkInfo.getExopackageInfo().isPresent()); ExopackageDeviceDirectoryLister directoryLister = new ExopackageDeviceDirectoryLister( buildTarget.withFlavors(DIRECTORY_LISTING_FLAVOR), projectFilesystem); SourcePathRuleFinder ruleFinder = new SourcePathRuleFinder(graphBuilder); ExopackageInfo exopackageInfo = apkInfo.getExopackageInfo().get(); ImmutableList.Builder<BuildRule> finisherDeps = ImmutableList.builder(); if (exopackageInfo.getDexInfo().isPresent() || exopackageInfo.getNativeLibsInfo().isPresent() || exopackageInfo.getModuleInfo().isPresent()) { ExopackageInfo filteredExopackageInfo = ExopackageInfo.builder() .setDexInfo(exopackageInfo.getDexInfo()) .setNativeLibsInfo(exopackageInfo.getNativeLibsInfo()) .setModuleInfo(exopackageInfo.getModuleInfo()) .build(); ExopackageFilesInstaller fileInstaller = new ExopackageFilesInstaller( buildTarget.withFlavors(EXO_FILE_INSTALL_FLAVOR), projectFilesystem, ruleFinder, directoryLister.getSourcePathToOutput(), apkInfo.getManifestPath(), filteredExopackageInfo); graphBuilder.addToIndex(fileInstaller); finisherDeps.add(fileInstaller); } if (exopackageInfo.getResourcesInfo().isPresent()) { List<BuildRule> resourceInstallRules = createResourceInstallRules( exopackageInfo.getResourcesInfo().get(), ruleFinder, apkInfo.getManifestPath(), directoryLister.getSourcePathToOutput()); resourceInstallRules.forEach(graphBuilder::addToIndex); finisherDeps.addAll(resourceInstallRules); } BuildRule apkInstaller = new ExopackageInstallFinisher( buildTarget, projectFilesystem, ruleFinder, apkInfo, directoryLister, finisherDeps.build()); graphBuilder.addToIndex(directoryLister); graphBuilder.addToIndex(apkInstaller); } private List<BuildRule> createResourceInstallRules( ExopackageInfo.ResourcesInfo resourcesInfo, SourcePathRuleFinder ruleFinder, SourcePath manifestPath, SourcePath deviceExoContents) { // We construct a single ExopackageResourcesInstaller for each creator of exopackage resources. // This is done because the installers will synchronize on the underlying AndroidDevicesHelper // and so we don't want a single rule to generate a bunch of resource files and then take up a // bunch of build threads all waiting on each other. Multimap<BuildRule, ExopackagePathAndHash> creatorMappedPaths = resourcesInfo .getResourcesPaths() .stream() .collect( ImmutableListMultimap.toImmutableListMultimap( (ExopackagePathAndHash pathAndHash) -> ruleFinder.getRule(pathAndHash.getPath()).orElse(null), v -> v)); List<BuildRule> installers = new ArrayList<>(); int index = 0; for (Collection<ExopackagePathAndHash> paths : creatorMappedPaths.asMap().values()) { installers.add( new ExopackageResourcesInstaller( buildTarget.withAppendedFlavors( EXO_FILE_RESOURCE_INSTALL_FLAVOR, InternalFlavor.of(String.format("resources-%d", index))), projectFilesystem, ruleFinder, paths, manifestPath, deviceExoContents)); index++; } return installers; } private void enhanceForConcurrentInstall(ActionGraphBuilder graphBuilder) { graphBuilder.addToIndex( new AndroidBinaryNonExoInstaller(buildTarget, projectFilesystem, installableApk)); } private void enhanceForLegacyInstall(ActionGraphBuilder graphBuilder) { graphBuilder.addToIndex(new NoopBuildRule(buildTarget, projectFilesystem)); } }
[ "facebook-github-bot@users.noreply.github.com" ]
facebook-github-bot@users.noreply.github.com
fe287b5584ca9c67b33e2d74ff09d3103f7e5ccd
a4ea57af47ce28d9a51d2b304392e91c4e8c1a43
/src/com/br/gui/TelaVenda.java
c5780d6bdb75a21c1b204151bb7cd10b1c23d11f
[]
no_license
cledsonAlves/ForcaVendas
68f0c08c15917aa97a2ca3f820e2fcab4b116bf7
614f1aab84520899c7a0d86bb36d1aedab931103
refs/heads/master
2021-01-13T02:03:16.008210
2014-03-07T00:40:19
2014-03-07T00:40:19
16,924,179
4
0
null
null
null
null
ISO-8859-1
Java
false
false
7,574
java
package com.br.gui; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.text.InputFilter; import android.view.View; import android.view.Window; import android.view.WindowManager; import android.widget.ArrayAdapter; import android.widget.EditText; import android.widget.Spinner; import android.widget.Toast; import com.br.kelma.R; import com.br.logica.Logica; import com.br.objetos.Pedido; /** * * @author Tela Inicial de venda do pedido * */ public class TelaVenda extends Activity { private Spinner spCondicao, spOperacao, spFilial, spTabela, spPagamento; private ArrayAdapter<String> adaptador1, adaptador2, adaptador3, adaptador4, adaptador5; private EditText edDataVenda, edNumPed, edCliente, edtObs; private Logica logica = new Logica(); private String[] lista_pagamento = new String[] { "Boleto Bancário","Dinheiro", "Cheque" }; private String[] lista_tabela = new String[] { "A Vista", "14 dias","21 dias", "28 dias", "35 dias","42 dias" }; private String[] lista_condicoes = new String[] {"A Vista","7","10","14","21","28", "7/14/21","7/14 (TAB 14)","14","14/21","14/21(TAB 14)","14/21/28","21/28 (TAB 21)","21/28 (TAB 14)","21 (A Vista)","21/28/35 (TAB 21)","21/28/35 (TAB14)","28/35 (TAB 28)","35/42(TAB 35)","42/60(TAB 42)","42" }; private String[] lista_filiais = new String[] { "Kelma Cosmeticos"}; private String[] lista_operacoes = new String[] { "Venda Normal","Bonificação" , "Orçamento","Troca"}; // Construtor inicial da tela @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.teste); // esconder o teclado ... getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN); iniciaComponentes(); } // inicia os componentes da tela public void iniciaComponentes() { // Edit Text edCliente = (EditText) findViewById(R.id.editCodRep); edCliente.setEnabled(false); edNumPed = (EditText) findViewById(R.id.editNomeRep); edNumPed.setEnabled(false); edtObs = (EditText) findViewById(R.id.editObser); edtObs.setFilters(new InputFilter[]{new InputFilter.AllCaps()}); edDataVenda = (EditText) findViewById(R.id.editCpfRep); edDataVenda.setEnabled(false); // Spiner spOperacao = (Spinner) findViewById(R.id.spOperacao); spPagamento = (Spinner) findViewById(R.id.spPagamento); spCondicao = (Spinner) findViewById(R.id.spPrazo); spFilial = (Spinner) findViewById(R.id.spEmbalagem); spTabela = (Spinner) findViewById(R.id.spTabela); // criando os adaptadores de spinner adaptador1 = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item,logica.buscaPlanos(this)); adaptador1.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spCondicao.setAdapter(adaptador1); adaptador2 = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item, lista_operacoes); adaptador2.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spOperacao.setAdapter(adaptador2); adaptador3 = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item, lista_filiais); adaptador3.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spFilial.setAdapter(adaptador3); adaptador4 = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item, lista_tabela); adaptador4.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spTabela.setAdapter(adaptador4); adaptador5 = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item, lista_pagamento); adaptador5.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spPagamento.setAdapter(adaptador5); carregaCamposDefault(); } // carrega os campos defaul ao iniciar a aplicação private void carregaCamposDefault() { edDataVenda.setText(Logica.DataAtual()); // carrega o numero do proximo pedido edNumPed.setText(String.valueOf(logica.buscaCodigoPedido(this))); } // desabilita os widgts private void desabilitaCampos(){ spOperacao.setEnabled(false); edNumPed.setEnabled(false); spFilial.setEnabled(false); spCondicao.setEnabled(false); spTabela.setEnabled(false); spPagamento.setEnabled(false); edDataVenda.setEnabled(false); edCliente.setEnabled(false); } // habilita os widgts private void habilitaCampos(){ spOperacao.setEnabled(true); spFilial.setEnabled(true); spCondicao.setEnabled(true); spTabela.setEnabled(true); spPagamento.setEnabled(true); edNumPed.setEnabled(true); edCliente.setEnabled(true); } // Ações dos botões // Confirma e inicia a venda public void btn_confirma(View v) { if (edCliente.getText().toString().equals("")){ Toast.makeText(this,"Informe o Cliente!!", Toast.LENGTH_SHORT).show(); } else { Pedido pedido = new Pedido(); pedido.setNumero(Integer.parseInt(edNumPed.getText().toString())); // busca codigo do cliente no banco passando o nome dele pedido.setRepresentante(Autentica.usuario); pedido.setCodigoCliente(logica.buscaCliente(edCliente.getText().toString(), this)); pedido.setCondPagamento(spCondicao.getSelectedItem().toString()); pedido.setTipoPagamento(spPagamento.getSelectedItem().toString()); pedido.setTipoVenda(spOperacao.getSelectedItem().toString()); pedido.setFilialVenda(spFilial.getSelectedItem().toString()); pedido.setObs(edtObs.getText().toString()); // tabela if (spTabela.getSelectedItem().toString().equalsIgnoreCase("A Vista")){ pedido.setCodTabela(1); }else if (spTabela.getSelectedItem().toString().equalsIgnoreCase("14 dias")){ pedido.setCodTabela(2); }else if (spTabela.getSelectedItem().toString().equalsIgnoreCase("21 dias")){ pedido.setCodTabela(3); } else if (spTabela.getSelectedItem().toString().equalsIgnoreCase("28 dias")){ pedido.setCodTabela(4); } else if (spTabela.getSelectedItem().toString().equalsIgnoreCase("35 dias")){ pedido.setCodTabela(5); } else if (spTabela.getSelectedItem().toString().equalsIgnoreCase("42 dias")){ pedido.setCodTabela(6); } pedido.setTabela(spTabela.getSelectedItem().toString()); pedido.setDataVenda(edDataVenda.getText().toString()); // passa o cabeçalho para tela de digitação do pedido TelaDigitacao.pedido = pedido; //logica.buscaPedido(this); this.finish(); startActivity(new Intent(this, TelaDigitacao.class)); } } // cancela digitação ... public void btnCancela(View v){ this.finish(); } // Busca cliente public void btn_buscaCliente(View v) { startActivityForResult(new Intent(this, TelaClientes.class),2); } @Override protected void onActivityResult(int codigo, int resultado, Intent it) { Bundle params = it != null? it.getExtras():null; if (params != null){ String msg = params.getString("id"); edCliente.setText(msg); } } public void btn_novo(View v){ habilitaCampos(); carregaCamposDefault(); } // desabilitando o botão voltar ..... @Override public void onBackPressed() { Toast.makeText(this,"Para sair, pressione o botão cancelar ",Toast.LENGTH_SHORT).show(); } }
[ "clsddd@hotmail.com" ]
clsddd@hotmail.com
ffbdb6184464c5a7c5c915bd5442867ca8f5e3f7
968afb665e0641285c5996df3a9792e044038895
/src/ia/Peaton.java
84164e8e83b5e3ef274cdd7bcefe30664decc1e2
[]
no_license
Diego94FC/IA
d87a22719ab0b3b8462e9c445d84cdb0a49f02c2
c6cf1249e9eda7a59fad70183021f002baf2e02f
refs/heads/master
2020-04-05T00:44:12.199202
2018-11-06T15:53:37
2018-11-06T15:53:37
156,407,001
0
0
null
null
null
null
UTF-8
Java
false
false
4,337
java
package ia; import java.util.TimerTask; public class Peaton extends TimerTask implements Constantes{ public Laberinto laberinto; public Celda peaton; public int id; public char previoustypeWalker = 'S'; int cont = 0; public Peaton(Laberinto laberinto, int id, int x, int y) { this.laberinto = laberinto; peaton = new Celda(x, y,'W',0,id); laberinto.celdas[peaton.x][peaton.y].tipo = 'W'; } public void moverPeaton1(){ if(peaton.walkerID == 1){ if(peaton.walkerID == 1 && peaton.y == alturaMundoVirtual-5) moverPeatonIzquierda(1); if(peaton.walkerID == 1 && peaton.x == 1) moverPeatonArriba(alturaMundoVirtual-10); if(peaton.walkerID == 1 && peaton.y == alturaMundoVirtual-10) moverPeatonDerecha(5); if(peaton.walkerID == 1 && peaton.x == 5) moverPeatonAbajo(alturaMundoVirtual-5); } } public void moverPeaton2(){ if(peaton.walkerID == 2){ if(peaton.walkerID == 2 && peaton.y == 1) moverPeatonDerecha(23); if(peaton.walkerID == 2 && peaton.x == 23) moverPeatonAbajo(4); if(peaton.walkerID == 2 && peaton.y == 4) moverPeatonIzquierda(12); if(peaton.walkerID == 2 && peaton.x == 13) moverPeatonArriba(1); } } public void moverPeaton3(){ if(peaton.walkerID == 3){ if(peaton.walkerID == 3 && peaton.y == alturaMundoVirtual-5) moverPeatonIzquierda(anchuraMundoVirtual-22); if(peaton.walkerID == 3 && peaton.x == anchuraMundoVirtual-22) moverPeatonArriba(alturaMundoVirtual-10); if(peaton.walkerID == 3 && peaton.y == alturaMundoVirtual-10) moverPeatonDerecha(anchuraMundoVirtual-12); if(peaton.walkerID == 3 && peaton.x == anchuraMundoVirtual-12) moverPeatonAbajo(alturaMundoVirtual-5); } } public void moverPeatonIzquierda(int celdaDestino){ if(peaton.x > 0 && peaton.x > celdaDestino && laberinto.celdas[peaton.x-1][peaton.y].tipo != 'P'){ laberinto.celdas[peaton.x][peaton.y].tipo = previoustypeWalker; peaton.x = peaton.x - 1; previoustypeWalker = laberinto.celdas[peaton.x][peaton.y].tipo; laberinto.celdas[peaton.x][peaton.y].tipo= 'W'; laberinto.celdas[peaton.x][peaton.y].indexWalkerSprite = 1; } } public void moverPeatonAbajo(int celdaDestino){ if(peaton.y < alturaMundoVirtual && peaton.y < celdaDestino && laberinto.celdas[peaton.x][peaton.y+1].tipo != 'P'){ laberinto.celdas[peaton.x][peaton.y].tipo = previoustypeWalker; peaton.y = peaton.y + 1; previoustypeWalker = laberinto.celdas[peaton.x][peaton.y].tipo; laberinto.celdas[peaton.x][peaton.y].tipo= 'W'; if(peaton.y < celdaDestino){ for(int i = 0; i < 9; i++){ laberinto.celdas[peaton.x][peaton.y].indexWalkerSprite = cont; cont = cont+4; if(cont == 8) cont = 0; } } } } public void moverPeatonDerecha(int celdaDestino){ if(peaton.x < anchuraMundoVirtual && peaton.x < celdaDestino && laberinto.celdas[peaton.x+1][peaton.y].tipo != 'P'){ laberinto.celdas[peaton.x][peaton.y].tipo = previoustypeWalker; peaton.x = peaton.x + 1; previoustypeWalker = laberinto.celdas[peaton.x][peaton.y].tipo; laberinto.celdas[peaton.x][peaton.y].tipo= 'W'; laberinto.celdas[peaton.x][peaton.y].indexWalkerSprite = 2; } } public void moverPeatonArriba(int celdaDestino){ if(peaton.y > 0 && peaton.y > celdaDestino && laberinto.celdas[peaton.x][peaton.y-1].tipo != 'P'){ laberinto.celdas[peaton.x][peaton.y].tipo = previoustypeWalker; peaton.y = peaton.y - 1; previoustypeWalker = laberinto.celdas[peaton.x][peaton.y].tipo; laberinto.celdas[peaton.x][peaton.y].tipo= 'W'; laberinto.celdas[peaton.x][peaton.y].indexWalkerSprite = 3; } } @Override public void run() { moverPeaton1(); moverPeaton2(); moverPeaton3(); laberinto.lienzoPadre.repaint(); } }
[ "diego94.fc@gmail.com" ]
diego94.fc@gmail.com